Skip to content

Commit a80ae20

Browse files
authored
Add script to auto-generate SDK (#264)
* Add generate typescript SDK * Update operation names for SDK * Add script to generate SDK
1 parent cb00704 commit a80ae20

File tree

150 files changed

+273
-152
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+273
-152
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"dev:worker": "nodemon --watch 'src/worker/**/*.ts' --watch 'core/**/*.ts' --watch 'src/**/*.ts' --exec 'npx tsx ./src/worker/index.ts' --files src/worker/index.ts",
1515
"dev:infra": "docker compose -f ./docker-compose-infra.yml up -d",
1616
"build": "yarn && rm -rf dist && tsc -p ./tsconfig.json --outDir dist",
17+
"generate:sdk": "npx tsx ./src/scripts/generate-sdk",
1718
"prisma:setup:dev": "npx tsx ./src/db/scripts/setup.ts",
1819
"prisma:setup:prod": "npx tsx ./dist/src/db/scripts/setup.js",
1920
"start": "yarn prisma:setup:prod && (yarn start:server & yarn start:worker)",
@@ -92,6 +93,7 @@
9293
"eslint-config-prettier": "^8.7.0",
9394
"hardhat": "^2.1.2",
9495
"nodemon": "^2.0.21",
96+
"openapi-typescript-codegen": "^0.25.0",
9597
"prettier": "^2.8.7",
9698
"prompts": "^2.4.2",
9799
"supertest": "^6.3.3",

server/api/auth/access-tokens/create.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export async function createAccessToken(fastify: FastifyInstance) {
3232
summary: "Create a new access token",
3333
description: "Create a new access token",
3434
tags: ["Access Tokens"],
35-
operationId: "createAccessToken",
35+
operationId: "create",
3636
body: BodySchema,
3737
response: {
3838
[StatusCodes.OK]: ReplySchema,

server/api/auth/access-tokens/getAll.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export async function getAllAccessTokens(fastify: FastifyInstance) {
2626
summary: "Get all access tokens",
2727
description: "Get all access tokens",
2828
tags: ["Access Tokens"],
29-
operationId: "getAllAccessTokens",
29+
operationId: "getAll",
3030
response: {
3131
[StatusCodes.OK]: ReplySchema,
3232
},

server/api/auth/access-tokens/revoke.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export async function revokeAccessToken(fastify: FastifyInstance) {
2424
summary: "Revoke an access token",
2525
description: "Revoke an access token",
2626
tags: ["Access Tokens"],
27-
operationId: "revokeAccessToken",
27+
operationId: "revoke",
2828
body: BodySchema,
2929
response: {
3030
[StatusCodes.OK]: ReplySchema,

server/api/auth/permissions/getAll.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export async function getAllPermissions(fastify: FastifyInstance) {
2323
summary: "Get all permissions",
2424
description: "Get all users with their corresponding permissions",
2525
tags: ["Permissions"],
26-
operationId: "getAllPermissions",
26+
operationId: "getAll",
2727
response: {
2828
[StatusCodes.OK]: ReplySchema,
2929
},

server/api/auth/permissions/grant.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export async function grantPermissions(fastify: FastifyInstance) {
2727
summary: "Grant permissions to user",
2828
description: "Grant permissions to a user",
2929
tags: ["Permissions"],
30-
operationId: "grantPermissions",
30+
operationId: "grant",
3131
body: BodySchema,
3232
response: {
3333
[StatusCodes.OK]: ReplySchema,

server/api/auth/permissions/revoke.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export async function revokePermissions(fastify: FastifyInstance) {
2424
summary: "Revoke permissions from user",
2525
description: "Revoke a user's permissions",
2626
tags: ["Permissions"],
27-
operationId: "revokePermissions",
27+
operationId: "revoke",
2828
body: BodySchema,
2929
response: {
3030
[StatusCodes.OK]: ReplySchema,

server/api/backend-wallet/create.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const createWallet = async (fastify: FastifyInstance) => {
3737
summary: "Create backend wallet",
3838
description: "Create a backend wallet.",
3939
tags: ["Backend Wallet"],
40-
operationId: "backendWallet_create",
40+
operationId: "create",
4141
body: BodySchema,
4242
response: {
4343
...standardResponseSchema,

server/api/backend-wallet/getAll.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export async function getAll(fastify: FastifyInstance) {
3838
summary: "Get all backend wallets",
3939
description: "Get all backend wallets.",
4040
tags: ["Backend Wallet"],
41-
operationId: "backendWallet_getAll",
41+
operationId: "getAll",
4242
response: {
4343
...standardResponseSchema,
4444
[StatusCodes.OK]: responseSchema,

server/api/backend-wallet/getBalance.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export async function getBalance(fastify: FastifyInstance) {
4242
summary: "Get balance",
4343
description: "Get the native balance for a backend wallet.",
4444
tags: ["Backend Wallet"],
45-
operationId: "backendWallet_getBalance",
45+
operationId: "getBalance",
4646
params: requestSchema,
4747
response: {
4848
...standardResponseSchema,

0 commit comments

Comments
 (0)