diff --git a/.changeset/update-npm-oidc.md b/.changeset/update-npm-oidc.md new file mode 100644 index 0000000..19af086 --- /dev/null +++ b/.changeset/update-npm-oidc.md @@ -0,0 +1,5 @@ +--- +"@workleap/create-schemas": patch +--- + +Update NPM publishing to use OIDC authentication diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 13931d0..42292b2 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -9,7 +9,6 @@ runs: - name: Install pnpm uses: pnpm/action-setup@v4 with: - version: 9 run_install: false - name: Install Node.js diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b3b3046..ba73cae 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -30,7 +30,6 @@ jobs: publish: pnpm run changeset:publish env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.WORKLEAP_NPM_TOKEN }} linearb: needs: [release] diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..08c7678 --- /dev/null +++ b/.npmrc @@ -0,0 +1,2 @@ +minimum-release-age=1440 +minimum-release-age-exclude[]="@workleap*" diff --git a/.nvmrc b/.nvmrc index b009dfb..a45fd52 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -lts/* +24 diff --git a/package.json b/package.json index 2a81d1c..e4767f0 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "postinstall": "pnpm -r --parallel --include-workspace-root exec pnpm dlx rimraf node_modules/.cache", "dev": "pnpm --filter \"./packages/**\" -r dev", "test": "pnpm --filter \"./packages/**\" -r test", + "test-update": "pnpm --filter \"./packages/**\" -r test-update", "build": "pnpm --filter \"./packages/**\" -r build", "lint": "pnpm run \"/^lint:.*/\"", "lint:eslint": "eslint --ext .js,.ts,.tsx . --max-warnings=-1 --cache --cache-location node_modules/.cache/eslint", @@ -33,6 +34,7 @@ "typescript": "5.5.3" }, "engines": { - "node": ">=18.0.0" - } -} \ No newline at end of file + "node": ">=24.0.0" + }, + "packageManager": "pnpm@10.19.0" +} diff --git a/packages/create-schemas/bin/create-schemas.js b/packages/create-schemas/bin/create-schemas.js old mode 100644 new mode 100755 diff --git a/packages/create-schemas/package.json b/packages/create-schemas/package.json index ea14031..5033501 100644 --- a/packages/create-schemas/package.json +++ b/packages/create-schemas/package.json @@ -34,6 +34,7 @@ "scripts": { "dev": "tsup --config tsup.dev.ts", "test": "vitest", + "test-update": "vitest -- update-snapshots", "build": "tsup --config tsup.build.ts" }, "devDependencies": { @@ -47,7 +48,7 @@ "vitest": "1.6.0" }, "engines": { - "node": ">=18.0.0" + "node": ">=24.0.0" }, "dependencies": { "c12": "1.11.1", @@ -58,4 +59,4 @@ "typescript": "5.5.3", "zod": "3.23.8" } -} \ No newline at end of file +} diff --git a/packages/create-schemas/tests/__snapshots__/e2e.test.ts.snap b/packages/create-schemas/tests/__snapshots__/e2e.test.ts.snap index 2fa6da9..03b092a 100644 --- a/packages/create-schemas/tests/__snapshots__/e2e.test.ts.snap +++ b/packages/create-schemas/tests/__snapshots__/e2e.test.ts.snap @@ -267,13 +267,13 @@ export interface paths { }; get?: never; /** - * Update an existing pet - * @description Update an existing pet by Id + * Update an existing pet. + * @description Update an existing pet by Id. */ put: operations["updatePet"]; /** - * Add a new pet to the store - * @description Add a new pet to the store + * Add a new pet to the store. + * @description Add a new pet to the store. */ post: operations["addPet"]; delete?: never; @@ -290,8 +290,8 @@ export interface paths { cookie?: never; }; /** - * Finds Pets by status - * @description Multiple status values can be provided with comma separated strings + * Finds Pets by status. + * @description Multiple status values can be provided with comma separated strings. */ get: operations["findPetsByStatus"]; put?: never; @@ -310,7 +310,7 @@ export interface paths { cookie?: never; }; /** - * Finds Pets by tags + * Finds Pets by tags. * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. */ get: operations["findPetsByTags"]; @@ -330,14 +330,20 @@ export interface paths { cookie?: never; }; /** - * Find pet by ID - * @description Returns a single pet + * Find pet by ID. + * @description Returns a single pet. */ get: operations["getPetById"]; put?: never; - /** Updates a pet in the store with form data */ + /** + * Updates a pet in the store with form data. + * @description Updates a pet resource based on the form data. + */ post: operations["updatePetWithForm"]; - /** Deletes a pet */ + /** + * Deletes a pet. + * @description Delete a pet. + */ delete: operations["deletePet"]; options?: never; head?: never; @@ -353,7 +359,10 @@ export interface paths { }; get?: never; put?: never; - /** uploads an image */ + /** + * Uploads an image. + * @description Upload image of the pet. + */ post: operations["uploadFile"]; delete?: never; options?: never; @@ -369,8 +378,8 @@ export interface paths { cookie?: never; }; /** - * Returns pet inventories by status - * @description Returns a map of status codes to quantities + * Returns pet inventories by status. + * @description Returns a map of status codes to quantities. */ get: operations["getInventory"]; put?: never; @@ -391,8 +400,8 @@ export interface paths { get?: never; put?: never; /** - * Place an order for a pet - * @description Place a new order in the store + * Place an order for a pet. + * @description Place a new order in the store. */ post: operations["placeOrder"]; delete?: never; @@ -409,15 +418,15 @@ export interface paths { cookie?: never; }; /** - * Find purchase order by ID + * Find purchase order by ID. * @description For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. */ get: operations["getOrderById"]; put?: never; post?: never; /** - * Delete purchase order by ID - * @description For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete purchase order by identifier. + * @description For valid response try integer IDs with value < 1000. Anything above 1000 or non-integers will generate API errors. */ delete: operations["deleteOrder"]; options?: never; @@ -435,7 +444,7 @@ export interface paths { get?: never; put?: never; /** - * Create user + * Create user. * @description This can only be done by the logged in user. */ post: operations["createUser"]; @@ -455,8 +464,8 @@ export interface paths { get?: never; put?: never; /** - * Creates list of users with given input array - * @description Creates list of users with given input array + * Creates list of users with given input array. + * @description Creates list of users with given input array. */ post: operations["createUsersWithListInput"]; delete?: never; @@ -472,7 +481,10 @@ export interface paths { path?: never; cookie?: never; }; - /** Logs user into the system */ + /** + * Logs user into the system. + * @description Log into the system. + */ get: operations["loginUser"]; put?: never; post?: never; @@ -489,7 +501,10 @@ export interface paths { path?: never; cookie?: never; }; - /** Logs out current logged in user session */ + /** + * Logs out current logged in user session. + * @description Log user out of the system. + */ get: operations["logoutUser"]; put?: never; post?: never; @@ -506,16 +521,19 @@ export interface paths { path?: never; cookie?: never; }; - /** Get user by user name */ + /** + * Get user by user name. + * @description Get user detail based on username. + */ get: operations["getUserByName"]; /** - * Update user + * Update user resource. * @description This can only be done by the logged in user. */ put: operations["updateUser"]; post?: never; /** - * Delete user + * Delete user resource. * @description This can only be done by the logged in user. */ delete: operations["deleteUser"]; @@ -554,26 +572,6 @@ export interface components { status?: "placed" | "approved" | "delivered"; complete?: boolean; }; - Customer: { - /** - * Format: int64 - * @example 100000 - */ - id?: number; - /** @example fehguy */ - username?: string; - address?: components["schemas"]["Address"][]; - }; - Address: { - /** @example 437 Lytton */ - street?: string; - /** @example Palo Alto */ - city?: string; - /** @example CA */ - state?: string; - /** @example 94301 */ - zip?: string; - }; Category: { /** * Format: int64 @@ -681,8 +679,8 @@ export interface operations { [name: string]: unknown; }; content: { - "application/xml": components["schemas"]["Pet"]; "application/json": components["schemas"]["Pet"]; + "application/xml": components["schemas"]["Pet"]; }; }; /** @description Invalid ID supplied */ @@ -700,7 +698,14 @@ export interface operations { content?: never; }; /** @description Validation exception */ - 405: { + 422: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Unexpected error */ + default: { headers: { [name: string]: unknown; }; @@ -730,12 +735,26 @@ export interface operations { [name: string]: unknown; }; content: { - "application/xml": components["schemas"]["Pet"]; "application/json": components["schemas"]["Pet"]; + "application/xml": components["schemas"]["Pet"]; }; }; /** @description Invalid input */ - 405: { + 400: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Validation exception */ + 422: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Unexpected error */ + default: { headers: { [name: string]: unknown; }; @@ -745,9 +764,9 @@ export interface operations { }; findPetsByStatus: { parameters: { - query?: { + query: { /** @description Status values that need to be considered for filter */ - status?: "available" | "pending" | "sold"; + status: "available" | "pending" | "sold"; }; header?: never; path?: never; @@ -761,8 +780,8 @@ export interface operations { [name: string]: unknown; }; content: { - "application/xml": components["schemas"]["Pet"][]; "application/json": components["schemas"]["Pet"][]; + "application/xml": components["schemas"]["Pet"][]; }; }; /** @description Invalid status value */ @@ -772,13 +791,20 @@ export interface operations { }; content?: never; }; + /** @description Unexpected error */ + default: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; }; findPetsByTags: { parameters: { - query?: { + query: { /** @description Tags to filter by */ - tags?: string[]; + tags: string[]; }; header?: never; path?: never; @@ -792,8 +818,8 @@ export interface operations { [name: string]: unknown; }; content: { - "application/xml": components["schemas"]["Pet"][]; "application/json": components["schemas"]["Pet"][]; + "application/xml": components["schemas"]["Pet"][]; }; }; /** @description Invalid tag value */ @@ -803,6 +829,13 @@ export interface operations { }; content?: never; }; + /** @description Unexpected error */ + default: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; }; getPetById: { @@ -823,8 +856,8 @@ export interface operations { [name: string]: unknown; }; content: { - "application/xml": components["schemas"]["Pet"]; "application/json": components["schemas"]["Pet"]; + "application/xml": components["schemas"]["Pet"]; }; }; /** @description Invalid ID supplied */ @@ -841,6 +874,13 @@ export interface operations { }; content?: never; }; + /** @description Unexpected error */ + default: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; }; updatePetWithForm: { @@ -860,8 +900,25 @@ export interface operations { }; requestBody?: never; responses: { + /** @description successful operation */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Pet"]; + "application/xml": components["schemas"]["Pet"]; + }; + }; /** @description Invalid input */ - 405: { + 400: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Unexpected error */ + default: { headers: { [name: string]: unknown; }; @@ -883,6 +940,13 @@ export interface operations { }; requestBody?: never; responses: { + /** @description Pet deleted */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; /** @description Invalid pet value */ 400: { headers: { @@ -890,6 +954,13 @@ export interface operations { }; content?: never; }; + /** @description Unexpected error */ + default: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; }; uploadFile: { @@ -920,6 +991,27 @@ export interface operations { "application/json": components["schemas"]["ApiResponse"]; }; }; + /** @description No file uploaded */ + 400: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Pet not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Unexpected error */ + default: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; }; getInventory: { @@ -942,6 +1034,13 @@ export interface operations { }; }; }; + /** @description Unexpected error */ + default: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; }; placeOrder: { @@ -969,7 +1068,21 @@ export interface operations { }; }; /** @description Invalid input */ - 405: { + 400: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Validation exception */ + 422: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Unexpected error */ + default: { headers: { [name: string]: unknown; }; @@ -995,8 +1108,8 @@ export interface operations { [name: string]: unknown; }; content: { - "application/xml": components["schemas"]["Order"]; "application/json": components["schemas"]["Order"]; + "application/xml": components["schemas"]["Order"]; }; }; /** @description Invalid ID supplied */ @@ -1013,6 +1126,13 @@ export interface operations { }; content?: never; }; + /** @description Unexpected error */ + default: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; }; deleteOrder: { @@ -1027,6 +1147,13 @@ export interface operations { }; requestBody?: never; responses: { + /** @description order deleted */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; /** @description Invalid ID supplied */ 400: { headers: { @@ -1041,6 +1168,13 @@ export interface operations { }; content?: never; }; + /** @description Unexpected error */ + default: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; }; createUser: { @@ -1060,7 +1194,7 @@ export interface operations { }; responses: { /** @description successful operation */ - default: { + 200: { headers: { [name: string]: unknown; }; @@ -1069,6 +1203,13 @@ export interface operations { "application/xml": components["schemas"]["User"]; }; }; + /** @description Unexpected error */ + default: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; }; createUsersWithListInput: { @@ -1090,11 +1231,11 @@ export interface operations { [name: string]: unknown; }; content: { - "application/xml": components["schemas"]["User"]; "application/json": components["schemas"]["User"]; + "application/xml": components["schemas"]["User"]; }; }; - /** @description successful operation */ + /** @description Unexpected error */ default: { headers: { [name: string]: unknown; @@ -1138,6 +1279,13 @@ export interface operations { }; content?: never; }; + /** @description Unexpected error */ + default: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; }; logoutUser: { @@ -1150,6 +1298,13 @@ export interface operations { requestBody?: never; responses: { /** @description successful operation */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Unexpected error */ default: { headers: { [name: string]: unknown; @@ -1163,7 +1318,7 @@ export interface operations { query?: never; header?: never; path: { - /** @description The name that needs to be fetched. Use user1 for testing. */ + /** @description The name that needs to be fetched. Use user1 for testing */ username: string; }; cookie?: never; @@ -1176,8 +1331,8 @@ export interface operations { [name: string]: unknown; }; content: { - "application/xml": components["schemas"]["User"]; "application/json": components["schemas"]["User"]; + "application/xml": components["schemas"]["User"]; }; }; /** @description Invalid username supplied */ @@ -1194,6 +1349,13 @@ export interface operations { }; content?: never; }; + /** @description Unexpected error */ + default: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; }; updateUser: { @@ -1201,7 +1363,7 @@ export interface operations { query?: never; header?: never; path: { - /** @description name that needs to be updated */ + /** @description name that need to be deleted */ username: string; }; cookie?: never; @@ -1216,6 +1378,27 @@ export interface operations { }; responses: { /** @description successful operation */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description bad request */ + 400: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description user not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Unexpected error */ default: { headers: { [name: string]: unknown; @@ -1236,6 +1419,13 @@ export interface operations { }; requestBody?: never; responses: { + /** @description User deleted */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; /** @description Invalid username supplied */ 400: { headers: { @@ -1250,13 +1440,18 @@ export interface operations { }; content?: never; }; + /** @description Unexpected error */ + default: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; }; } export type Order = components["schemas"]["Order"]; -export type Customer = components["schemas"]["Customer"]; -export type Address = components["schemas"]["Address"]; export type Category = components["schemas"]["Category"]; export type User = components["schemas"]["User"]; export type Tag = components["schemas"]["Tag"];