@threatmap/schema-proxy
v0.1.1
Published
ThreatCode Proxy API schemas (GraphQL and OpenAPI)
Readme
📝 Proxy Schema
This package publishes the latest ThreatCode Proxy API schema artifacts so tools can consume a stable, versioned source of truth for GraphQL and OpenAPI definitions.
Included files
schema.graphqlopenapi.yaml
Install
Using npm:
npm install @threatmap/schema-proxyUsing Python:
uv add threatcode-schema-proxyUsage
Node.js
import { readFileSync } from "node:fs";
import { fileURLToPath } from "node:url";
import path from "node:path";
const graphqlSchemaPath = require.resolve("@threatmap/schema-proxy/graphql");
const openApiSchemaPath = require.resolve("@threatmap/schema-proxy/openapi");
const graphqlSchema = readFileSync(graphqlSchemaPath, "utf8");
const openApiSchema = readFileSync(openApiSchemaPath, "utf8");
console.log(graphqlSchema.slice(0, 120));
console.log(openApiSchema.slice(0, 120));Python
from importlib import resources
graphql_schema = resources.files("threatcode_schema_proxy").joinpath("schema.graphql").read_text()
openapi_schema = resources.files("threatcode_schema_proxy").joinpath("openapi.yaml").read_text()
print(graphql_schema[:120])
print(openapi_schema[:120])The package exports the current schema files directly for tooling that needs to fetch or validate the Proxy API contract.
