signet-sdk-generator
v1.0.0
Published
SDK generator for Signet API using OpenAPI specification
Readme
Signet SDK Generator
This project generates SDKs for Node.js/TypeScript and Python from an OpenAPI specification.
Prerequisites
- Node.js (>= 18.0.0)
- pnpm (>= 8.0.0)
- Java (required by OpenAPI Generator)
- TypeScript (installed via pnpm)
Setup
Install pnpm (if not already installed):
npm install -g pnpmInstall dependencies:
pnpm installOpenAPI specifications:
- OpenAPI spec files are automatically published to the
specs/folder via GitHub Actions - The generator will automatically merge all JSON spec files (credentials.json, fraud.json, partner.json) into a unified SDK
- OpenAPI spec files are automatically published to the
Usage
Generate TypeScript/JavaScript SDK
pnpm run generate:typescriptGenerate Python SDK
pnpm run generate:pythonGenerate Both SDKs
pnpm run generate:allClean Generated Files
pnpm run cleanAuthentication
The SDK supports two authentication modes:
- Bearer Token (v1) – Traditional OAuth 2.0 client_credentials flow with
client_idandclient_secret. UsecreateBearerConfigurationfromutils/bearer(orfetchBearerToken/createBearerTokenProviderfor advanced cases). - DPoP (v2) – Enhanced security by binding access tokens to cryptographic keys. See DPoP Documentation and DPoP Flow.
Output
Generated SDKs will be placed in:
- TypeScript/JavaScript:
generated/typescript/ - Python:
generated/python/
CI/CD Integration
The GitHub Actions workflow automatically:
- Merges all OpenAPI spec files from the
specs/folder - Generates TypeScript and Python SDKs
- Uploads the generated SDKs as artifacts
Spec files are published to the repository via GitHub Actions, so no manual fetching is required.
Project Structure
.
├── specs/ # OpenAPI specification files
│ ├── credentials.json # Credentials service spec
│ ├── fraud.json # Fraud service spec
│ ├── partner.json # Partner service spec
│ └── openapi.json # Merged spec (generated, gitignored)
├── generated/ # Generated SDKs (gitignored)
│ ├── typescript/ # TypeScript/JavaScript SDK
│ └── python/ # Python SDK
├── config/ # Configuration files
│ └── dpop.json # DPoP configuration
├── templates/ # Custom templates for SDK generation
│ ├── typescript/ # TypeScript DPoP utilities
│ └── python/ # Python DPoP utilities
├── scripts/ # Generation scripts (TypeScript)
│ ├── merge-specs.ts # Merges multiple spec files
│ ├── generate-typescript.ts
│ ├── generate-python.ts
│ ├── clean.ts
│ └── post-generate-dpop.ts
├── docs/ # Documentation
│ └── DPOP.md # DPoP usage guide
├── tsconfig.json # TypeScript configuration
└── package.jsonCustomization
You can customize the generated SDKs by modifying the additional properties in the generation scripts:
- TypeScript: Edit
scripts/generate-typescript.ts - Python: Edit
scripts/generate-python.ts
For more options, see the OpenAPI Generator documentation.
