From afe06596c6ec4d7026d4df67cf663e6717b90e22 Mon Sep 17 00:00:00 2001 From: nick Date: Thu, 21 May 2026 20:59:26 +0000 Subject: [PATCH] fix(ts): make auth mocks reusable and fix offset pagination wire tests Two fixes for wire test generation: 1. Auth mock endpoints (OAuth and inferred auth) now use { once: false } so they can handle multiple requests during pagination (getNextPage() triggers re-authentication). 2. Offset pagination without an explicit hasNextPage property but with a step/limit now correctly skips getNextPage() assertions, since mock data may not have enough items to satisfy items.length >= step. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../unreleased/fix-wire-test-pagination-oauth.yml | 6 ++++++ .../sdk/generator/src/test-generator/TestGenerator.ts | 9 ++++++--- .../any-auth/always-send-auth/.fern/metadata.json | 3 +-- .../any-auth/always-send-auth/tests/wire/mockAuth.ts | 4 ++-- .../generate-endpoint-metadata/.fern/metadata.json | 3 +-- .../generate-endpoint-metadata/tests/wire/mockAuth.ts | 4 ++-- .../any-auth/no-custom-config/.fern/metadata.json | 3 +-- .../any-auth/no-custom-config/tests/wire/mockAuth.ts | 4 ++-- .../ts-sdk/endpoint-security-auth/.fern/metadata.json | 3 +-- .../endpoint-security-auth/tests/wire/mockAuth.ts | 4 ++-- .../ts-sdk/inferred-auth-explicit/.fern/metadata.json | 3 +-- .../inferred-auth-explicit/tests/wire/mockAuth.ts | 2 +- .../.fern/metadata.json | 3 +-- .../tests/wire/mockAuth.ts | 2 +- .../.fern/metadata.json | 3 +-- .../tests/wire/mockAuth.ts | 2 +- .../.fern/metadata.json | 3 +-- .../tests/wire/mockAuth.ts | 2 +- .../ts-sdk/inferred-auth-implicit/.fern/metadata.json | 3 +-- .../inferred-auth-implicit/tests/wire/mockAuth.ts | 2 +- .../.fern/metadata.json | 3 +-- .../tests/wire/mockAuth.ts | 2 +- .../.fern/metadata.json | 3 +-- .../tests/wire/mockAuth.ts | 2 +- .../no-custom-config/.fern/metadata.json | 3 +-- .../no-custom-config/tests/wire/mockAuth.ts | 2 +- .../no-custom-config/.fern/metadata.json | 3 +-- .../no-custom-config/tests/wire/mockAuth.ts | 2 +- .../never-throw-errors/.fern/metadata.json | 3 +-- .../never-throw-errors/tests/wire/mockAuth.ts | 2 +- .../no-custom-config/.fern/metadata.json | 3 +-- .../no-custom-config/tests/wire/mockAuth.ts | 2 +- .../.fern/metadata.json | 3 +-- .../tests/wire/mockAuth.ts | 2 +- .../.fern/metadata.json | 3 +-- .../tests/wire/mockAuth.ts | 2 +- .../.fern/metadata.json | 3 +-- .../tests/wire/mockAuth.ts | 2 +- .../no-custom-config/.fern/metadata.json | 3 +-- .../no-custom-config/tests/wire/mockAuth.ts | 2 +- .../serde/.fern/metadata.json | 3 +-- .../serde/tests/wire/mockAuth.ts | 2 +- .../pagination/no-custom-config/.fern/metadata.json | 3 +-- .../tests/wire/inline-users/inlineUsers.test.ts | 11 +---------- .../no-custom-config/tests/wire/users.test.ts | 11 +---------- .../page-index-semantics/.fern/metadata.json | 3 +-- .../tests/wire/inline-users/inlineUsers.test.ts | 11 +---------- .../page-index-semantics/tests/wire/users.test.ts | 11 +---------- .../websockets/.fern/metadata.json | 3 +-- .../websockets/tests/wire/mockAuth.ts | 2 +- 50 files changed, 64 insertions(+), 114 deletions(-) create mode 100644 generators/typescript/sdk/changes/unreleased/fix-wire-test-pagination-oauth.yml diff --git a/generators/typescript/sdk/changes/unreleased/fix-wire-test-pagination-oauth.yml b/generators/typescript/sdk/changes/unreleased/fix-wire-test-pagination-oauth.yml new file mode 100644 index 000000000000..a7b1f9634a6b --- /dev/null +++ b/generators/typescript/sdk/changes/unreleased/fix-wire-test-pagination-oauth.yml @@ -0,0 +1,6 @@ +- summary: | + Make auth mock endpoints reusable in wire tests so paginated endpoints + with OAuth or inferred auth can call getNextPage() without ECONNREFUSED. + Skip offset-pagination assertions when step is defined but hasNextPage is + not, since mock data may not satisfy the items >= step check. + type: fix diff --git a/generators/typescript/sdk/generator/src/test-generator/TestGenerator.ts b/generators/typescript/sdk/generator/src/test-generator/TestGenerator.ts index 4aeaf17817df..1e8ecf675fad 100644 --- a/generators/typescript/sdk/generator/src/test-generator/TestGenerator.ts +++ b/generators/typescript/sdk/generator/src/test-generator/TestGenerator.ts @@ -468,7 +468,7 @@ export function ${functionName}(server: MockServer): void { ${rawRequestBody ? code`const rawRequestBody = ${rawRequestBody};` : ""} ${rawResponseBody ? code`const rawResponseBody = ${rawResponseBody};` : ""} server - .mockEndpoint() + .mockEndpoint({ once: false }) .${endpoint.method.toLowerCase()}("${example.url}")${example.serviceHeaders .filter((h) => h.value.jsonExample != null) .map((h) => { @@ -534,7 +534,7 @@ export function ${functionName}(server: MockServer): void { ${rawRequestBody ? code`const rawRequestBody = ${rawRequestBody};` : ""} ${rawResponseBody ? code`const rawResponseBody = ${rawResponseBody};` : ""} server - .mockEndpoint() + .mockEndpoint({ once: false }) .${endpoint.method.toLowerCase()}("${example.url}")${example.serviceHeaders .filter((h) => h.value.jsonExample != null) .map((h) => { @@ -2420,7 +2420,10 @@ function isPaginationCursorMissingInExample({ case "offset": cursorProperty = pagination.hasNextPage; if (cursorProperty == null) { - return false; + // Without an explicit hasNextPage property: + // - With step: SDK uses items.length >= step, which may fail with mock data + // - Without step: SDK uses items.length > 0, which works if there are items + return pagination.step != null; } break; case "uri": diff --git a/seed/ts-sdk/any-auth/always-send-auth/.fern/metadata.json b/seed/ts-sdk/any-auth/always-send-auth/.fern/metadata.json index 8a0203913270..31a161f40304 100644 --- a/seed/ts-sdk/any-auth/always-send-auth/.fern/metadata.json +++ b/seed/ts-sdk/any-auth/always-send-auth/.fern/metadata.json @@ -6,8 +6,7 @@ "alwaysSendAuth": true }, "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } diff --git a/seed/ts-sdk/any-auth/always-send-auth/tests/wire/mockAuth.ts b/seed/ts-sdk/any-auth/always-send-auth/tests/wire/mockAuth.ts index 0d66041ecc29..d2d649cc1d31 100644 --- a/seed/ts-sdk/any-auth/always-send-auth/tests/wire/mockAuth.ts +++ b/seed/ts-sdk/any-auth/always-send-auth/tests/wire/mockAuth.ts @@ -11,7 +11,7 @@ export function mockOAuth(server: MockServer): void { }; const rawResponseBody = { access_token: "access_token", expires_in: 1, refresh_token: "refresh_token" }; server - .mockEndpoint() + .mockEndpoint({ once: false }) .post("/token") .jsonBody(rawRequestBody) .respondWith() @@ -29,7 +29,7 @@ export function mockInferredAuth(server: MockServer): void { }; const rawResponseBody = { access_token: "access_token", expires_in: 1, refresh_token: "refresh_token" }; server - .mockEndpoint() + .mockEndpoint({ once: false }) .post("/token") .jsonBody(rawRequestBody) .respondWith() diff --git a/seed/ts-sdk/any-auth/generate-endpoint-metadata/.fern/metadata.json b/seed/ts-sdk/any-auth/generate-endpoint-metadata/.fern/metadata.json index dd8e27a3e56c..42b80516e9f6 100644 --- a/seed/ts-sdk/any-auth/generate-endpoint-metadata/.fern/metadata.json +++ b/seed/ts-sdk/any-auth/generate-endpoint-metadata/.fern/metadata.json @@ -6,8 +6,7 @@ "generateEndpointMetadata": true }, "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } diff --git a/seed/ts-sdk/any-auth/generate-endpoint-metadata/tests/wire/mockAuth.ts b/seed/ts-sdk/any-auth/generate-endpoint-metadata/tests/wire/mockAuth.ts index 0d66041ecc29..d2d649cc1d31 100644 --- a/seed/ts-sdk/any-auth/generate-endpoint-metadata/tests/wire/mockAuth.ts +++ b/seed/ts-sdk/any-auth/generate-endpoint-metadata/tests/wire/mockAuth.ts @@ -11,7 +11,7 @@ export function mockOAuth(server: MockServer): void { }; const rawResponseBody = { access_token: "access_token", expires_in: 1, refresh_token: "refresh_token" }; server - .mockEndpoint() + .mockEndpoint({ once: false }) .post("/token") .jsonBody(rawRequestBody) .respondWith() @@ -29,7 +29,7 @@ export function mockInferredAuth(server: MockServer): void { }; const rawResponseBody = { access_token: "access_token", expires_in: 1, refresh_token: "refresh_token" }; server - .mockEndpoint() + .mockEndpoint({ once: false }) .post("/token") .jsonBody(rawRequestBody) .respondWith() diff --git a/seed/ts-sdk/any-auth/no-custom-config/.fern/metadata.json b/seed/ts-sdk/any-auth/no-custom-config/.fern/metadata.json index 5789995ae525..9ea68298004b 100644 --- a/seed/ts-sdk/any-auth/no-custom-config/.fern/metadata.json +++ b/seed/ts-sdk/any-auth/no-custom-config/.fern/metadata.json @@ -3,8 +3,7 @@ "generatorName": "fernapi/fern-typescript-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } diff --git a/seed/ts-sdk/any-auth/no-custom-config/tests/wire/mockAuth.ts b/seed/ts-sdk/any-auth/no-custom-config/tests/wire/mockAuth.ts index 0d66041ecc29..d2d649cc1d31 100644 --- a/seed/ts-sdk/any-auth/no-custom-config/tests/wire/mockAuth.ts +++ b/seed/ts-sdk/any-auth/no-custom-config/tests/wire/mockAuth.ts @@ -11,7 +11,7 @@ export function mockOAuth(server: MockServer): void { }; const rawResponseBody = { access_token: "access_token", expires_in: 1, refresh_token: "refresh_token" }; server - .mockEndpoint() + .mockEndpoint({ once: false }) .post("/token") .jsonBody(rawRequestBody) .respondWith() @@ -29,7 +29,7 @@ export function mockInferredAuth(server: MockServer): void { }; const rawResponseBody = { access_token: "access_token", expires_in: 1, refresh_token: "refresh_token" }; server - .mockEndpoint() + .mockEndpoint({ once: false }) .post("/token") .jsonBody(rawRequestBody) .respondWith() diff --git a/seed/ts-sdk/endpoint-security-auth/.fern/metadata.json b/seed/ts-sdk/endpoint-security-auth/.fern/metadata.json index 5789995ae525..9ea68298004b 100644 --- a/seed/ts-sdk/endpoint-security-auth/.fern/metadata.json +++ b/seed/ts-sdk/endpoint-security-auth/.fern/metadata.json @@ -3,8 +3,7 @@ "generatorName": "fernapi/fern-typescript-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } diff --git a/seed/ts-sdk/endpoint-security-auth/tests/wire/mockAuth.ts b/seed/ts-sdk/endpoint-security-auth/tests/wire/mockAuth.ts index 0d66041ecc29..d2d649cc1d31 100644 --- a/seed/ts-sdk/endpoint-security-auth/tests/wire/mockAuth.ts +++ b/seed/ts-sdk/endpoint-security-auth/tests/wire/mockAuth.ts @@ -11,7 +11,7 @@ export function mockOAuth(server: MockServer): void { }; const rawResponseBody = { access_token: "access_token", expires_in: 1, refresh_token: "refresh_token" }; server - .mockEndpoint() + .mockEndpoint({ once: false }) .post("/token") .jsonBody(rawRequestBody) .respondWith() @@ -29,7 +29,7 @@ export function mockInferredAuth(server: MockServer): void { }; const rawResponseBody = { access_token: "access_token", expires_in: 1, refresh_token: "refresh_token" }; server - .mockEndpoint() + .mockEndpoint({ once: false }) .post("/token") .jsonBody(rawRequestBody) .respondWith() diff --git a/seed/ts-sdk/inferred-auth-explicit/.fern/metadata.json b/seed/ts-sdk/inferred-auth-explicit/.fern/metadata.json index 5789995ae525..9ea68298004b 100644 --- a/seed/ts-sdk/inferred-auth-explicit/.fern/metadata.json +++ b/seed/ts-sdk/inferred-auth-explicit/.fern/metadata.json @@ -3,8 +3,7 @@ "generatorName": "fernapi/fern-typescript-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } diff --git a/seed/ts-sdk/inferred-auth-explicit/tests/wire/mockAuth.ts b/seed/ts-sdk/inferred-auth-explicit/tests/wire/mockAuth.ts index b558bea3ba59..f6b514b73d0c 100644 --- a/seed/ts-sdk/inferred-auth-explicit/tests/wire/mockAuth.ts +++ b/seed/ts-sdk/inferred-auth-explicit/tests/wire/mockAuth.ts @@ -12,7 +12,7 @@ export function mockInferredAuthScheme(server: MockServer): void { }; const rawResponseBody = { access_token: "access_token", expires_in: 1, refresh_token: "refresh_token" }; server - .mockEndpoint() + .mockEndpoint({ once: false }) .post("/token") .header("X-Api-Key", "X-Api-Key") .jsonBody(rawRequestBody) diff --git a/seed/ts-sdk/inferred-auth-implicit-api-key/.fern/metadata.json b/seed/ts-sdk/inferred-auth-implicit-api-key/.fern/metadata.json index 5789995ae525..9ea68298004b 100644 --- a/seed/ts-sdk/inferred-auth-implicit-api-key/.fern/metadata.json +++ b/seed/ts-sdk/inferred-auth-implicit-api-key/.fern/metadata.json @@ -3,8 +3,7 @@ "generatorName": "fernapi/fern-typescript-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } diff --git a/seed/ts-sdk/inferred-auth-implicit-api-key/tests/wire/mockAuth.ts b/seed/ts-sdk/inferred-auth-implicit-api-key/tests/wire/mockAuth.ts index 0eca5b17c75b..fa779d77a507 100644 --- a/seed/ts-sdk/inferred-auth-implicit-api-key/tests/wire/mockAuth.ts +++ b/seed/ts-sdk/inferred-auth-implicit-api-key/tests/wire/mockAuth.ts @@ -5,7 +5,7 @@ import type { MockServer } from "../mock-server/MockServer"; export function mockInferredAuthScheme(server: MockServer): void { const rawResponseBody = { access_token: "access_token", token_type: "token_type", expires_in: 1, scope: "scope" }; server - .mockEndpoint() + .mockEndpoint({ once: false }) .post("/token") .header("X-Api-Key", "api_key") .respondWith() diff --git a/seed/ts-sdk/inferred-auth-implicit-no-expiry/.fern/metadata.json b/seed/ts-sdk/inferred-auth-implicit-no-expiry/.fern/metadata.json index 5789995ae525..9ea68298004b 100644 --- a/seed/ts-sdk/inferred-auth-implicit-no-expiry/.fern/metadata.json +++ b/seed/ts-sdk/inferred-auth-implicit-no-expiry/.fern/metadata.json @@ -3,8 +3,7 @@ "generatorName": "fernapi/fern-typescript-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } diff --git a/seed/ts-sdk/inferred-auth-implicit-no-expiry/tests/wire/mockAuth.ts b/seed/ts-sdk/inferred-auth-implicit-no-expiry/tests/wire/mockAuth.ts index d936b66bcc75..57b813dbe6ea 100644 --- a/seed/ts-sdk/inferred-auth-implicit-no-expiry/tests/wire/mockAuth.ts +++ b/seed/ts-sdk/inferred-auth-implicit-no-expiry/tests/wire/mockAuth.ts @@ -12,7 +12,7 @@ export function mockInferredAuthScheme(server: MockServer): void { }; const rawResponseBody = { access_token: "access_token", refresh_token: "refresh_token" }; server - .mockEndpoint() + .mockEndpoint({ once: false }) .post("/token") .header("X-Api-Key", "X-Api-Key") .jsonBody(rawRequestBody) diff --git a/seed/ts-sdk/inferred-auth-implicit-reference/.fern/metadata.json b/seed/ts-sdk/inferred-auth-implicit-reference/.fern/metadata.json index 5789995ae525..9ea68298004b 100644 --- a/seed/ts-sdk/inferred-auth-implicit-reference/.fern/metadata.json +++ b/seed/ts-sdk/inferred-auth-implicit-reference/.fern/metadata.json @@ -3,8 +3,7 @@ "generatorName": "fernapi/fern-typescript-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } diff --git a/seed/ts-sdk/inferred-auth-implicit-reference/tests/wire/mockAuth.ts b/seed/ts-sdk/inferred-auth-implicit-reference/tests/wire/mockAuth.ts index 5fbb3ae402be..720ae6a61dc3 100644 --- a/seed/ts-sdk/inferred-auth-implicit-reference/tests/wire/mockAuth.ts +++ b/seed/ts-sdk/inferred-auth-implicit-reference/tests/wire/mockAuth.ts @@ -12,7 +12,7 @@ export function mockInferredAuthScheme(server: MockServer): void { }; const rawResponseBody = { access_token: "access_token", expires_in: 1, refresh_token: "refresh_token" }; server - .mockEndpoint() + .mockEndpoint({ once: false }) .post("/token") .jsonBody(rawRequestBody) .respondWith() diff --git a/seed/ts-sdk/inferred-auth-implicit/.fern/metadata.json b/seed/ts-sdk/inferred-auth-implicit/.fern/metadata.json index 5789995ae525..9ea68298004b 100644 --- a/seed/ts-sdk/inferred-auth-implicit/.fern/metadata.json +++ b/seed/ts-sdk/inferred-auth-implicit/.fern/metadata.json @@ -3,8 +3,7 @@ "generatorName": "fernapi/fern-typescript-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } diff --git a/seed/ts-sdk/inferred-auth-implicit/tests/wire/mockAuth.ts b/seed/ts-sdk/inferred-auth-implicit/tests/wire/mockAuth.ts index b558bea3ba59..f6b514b73d0c 100644 --- a/seed/ts-sdk/inferred-auth-implicit/tests/wire/mockAuth.ts +++ b/seed/ts-sdk/inferred-auth-implicit/tests/wire/mockAuth.ts @@ -12,7 +12,7 @@ export function mockInferredAuthScheme(server: MockServer): void { }; const rawResponseBody = { access_token: "access_token", expires_in: 1, refresh_token: "refresh_token" }; server - .mockEndpoint() + .mockEndpoint({ once: false }) .post("/token") .header("X-Api-Key", "X-Api-Key") .jsonBody(rawRequestBody) diff --git a/seed/ts-sdk/oauth-client-credentials-custom/.fern/metadata.json b/seed/ts-sdk/oauth-client-credentials-custom/.fern/metadata.json index 5789995ae525..9ea68298004b 100644 --- a/seed/ts-sdk/oauth-client-credentials-custom/.fern/metadata.json +++ b/seed/ts-sdk/oauth-client-credentials-custom/.fern/metadata.json @@ -3,8 +3,7 @@ "generatorName": "fernapi/fern-typescript-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } diff --git a/seed/ts-sdk/oauth-client-credentials-custom/tests/wire/mockAuth.ts b/seed/ts-sdk/oauth-client-credentials-custom/tests/wire/mockAuth.ts index 39c71a83c295..5f402ea9baa1 100644 --- a/seed/ts-sdk/oauth-client-credentials-custom/tests/wire/mockAuth.ts +++ b/seed/ts-sdk/oauth-client-credentials-custom/tests/wire/mockAuth.ts @@ -11,7 +11,7 @@ export function mockOAuthScheme(server: MockServer): void { }; const rawResponseBody = { access_token: "access_token", expires_in: 1, refresh_token: "refresh_token" }; server - .mockEndpoint() + .mockEndpoint({ once: false }) .post("/token") .jsonBody(rawRequestBody) .respondWith() diff --git a/seed/ts-sdk/oauth-client-credentials-default/.fern/metadata.json b/seed/ts-sdk/oauth-client-credentials-default/.fern/metadata.json index 5789995ae525..9ea68298004b 100644 --- a/seed/ts-sdk/oauth-client-credentials-default/.fern/metadata.json +++ b/seed/ts-sdk/oauth-client-credentials-default/.fern/metadata.json @@ -3,8 +3,7 @@ "generatorName": "fernapi/fern-typescript-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } diff --git a/seed/ts-sdk/oauth-client-credentials-default/tests/wire/mockAuth.ts b/seed/ts-sdk/oauth-client-credentials-default/tests/wire/mockAuth.ts index 5c808d1fe96d..9470d0612b78 100644 --- a/seed/ts-sdk/oauth-client-credentials-default/tests/wire/mockAuth.ts +++ b/seed/ts-sdk/oauth-client-credentials-default/tests/wire/mockAuth.ts @@ -6,7 +6,7 @@ export function mockOAuthScheme(server: MockServer): void { const rawRequestBody = { client_id: "client_id", client_secret: "client_secret", grant_type: "client_credentials" }; const rawResponseBody = { access_token: "access_token", expires_in: 1 }; server - .mockEndpoint() + .mockEndpoint({ once: false }) .post("/token") .jsonBody(rawRequestBody) .respondWith() diff --git a/seed/ts-sdk/oauth-client-credentials-environment-variables/no-custom-config/.fern/metadata.json b/seed/ts-sdk/oauth-client-credentials-environment-variables/no-custom-config/.fern/metadata.json index 5789995ae525..9ea68298004b 100644 --- a/seed/ts-sdk/oauth-client-credentials-environment-variables/no-custom-config/.fern/metadata.json +++ b/seed/ts-sdk/oauth-client-credentials-environment-variables/no-custom-config/.fern/metadata.json @@ -3,8 +3,7 @@ "generatorName": "fernapi/fern-typescript-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } diff --git a/seed/ts-sdk/oauth-client-credentials-environment-variables/no-custom-config/tests/wire/mockAuth.ts b/seed/ts-sdk/oauth-client-credentials-environment-variables/no-custom-config/tests/wire/mockAuth.ts index 0dbb0e6081c2..fac862b802b3 100644 --- a/seed/ts-sdk/oauth-client-credentials-environment-variables/no-custom-config/tests/wire/mockAuth.ts +++ b/seed/ts-sdk/oauth-client-credentials-environment-variables/no-custom-config/tests/wire/mockAuth.ts @@ -11,7 +11,7 @@ export function mockOAuthScheme(server: MockServer): void { }; const rawResponseBody = { access_token: "access_token", expires_in: 1, refresh_token: "refresh_token" }; server - .mockEndpoint() + .mockEndpoint({ once: false }) .post("/token") .jsonBody(rawRequestBody) .respondWith() diff --git a/seed/ts-sdk/oauth-client-credentials-mandatory-auth/no-custom-config/.fern/metadata.json b/seed/ts-sdk/oauth-client-credentials-mandatory-auth/no-custom-config/.fern/metadata.json index 5789995ae525..9ea68298004b 100644 --- a/seed/ts-sdk/oauth-client-credentials-mandatory-auth/no-custom-config/.fern/metadata.json +++ b/seed/ts-sdk/oauth-client-credentials-mandatory-auth/no-custom-config/.fern/metadata.json @@ -3,8 +3,7 @@ "generatorName": "fernapi/fern-typescript-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } diff --git a/seed/ts-sdk/oauth-client-credentials-mandatory-auth/no-custom-config/tests/wire/mockAuth.ts b/seed/ts-sdk/oauth-client-credentials-mandatory-auth/no-custom-config/tests/wire/mockAuth.ts index d9c3a85858d4..a0fe771d91eb 100644 --- a/seed/ts-sdk/oauth-client-credentials-mandatory-auth/no-custom-config/tests/wire/mockAuth.ts +++ b/seed/ts-sdk/oauth-client-credentials-mandatory-auth/no-custom-config/tests/wire/mockAuth.ts @@ -11,7 +11,7 @@ export function mockOAuthScheme(server: MockServer): void { }; const rawResponseBody = { access_token: "access_token", expires_in: 1, refresh_token: "refresh_token" }; server - .mockEndpoint() + .mockEndpoint({ once: false }) .post("/token") .jsonBody(rawRequestBody) .respondWith() diff --git a/seed/ts-sdk/oauth-client-credentials-nested-root/never-throw-errors/.fern/metadata.json b/seed/ts-sdk/oauth-client-credentials-nested-root/never-throw-errors/.fern/metadata.json index 2d8840f4633b..413b01aa7ca9 100644 --- a/seed/ts-sdk/oauth-client-credentials-nested-root/never-throw-errors/.fern/metadata.json +++ b/seed/ts-sdk/oauth-client-credentials-nested-root/never-throw-errors/.fern/metadata.json @@ -6,8 +6,7 @@ "neverThrowErrors": true }, "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } diff --git a/seed/ts-sdk/oauth-client-credentials-nested-root/never-throw-errors/tests/wire/mockAuth.ts b/seed/ts-sdk/oauth-client-credentials-nested-root/never-throw-errors/tests/wire/mockAuth.ts index 0dbb0e6081c2..fac862b802b3 100644 --- a/seed/ts-sdk/oauth-client-credentials-nested-root/never-throw-errors/tests/wire/mockAuth.ts +++ b/seed/ts-sdk/oauth-client-credentials-nested-root/never-throw-errors/tests/wire/mockAuth.ts @@ -11,7 +11,7 @@ export function mockOAuthScheme(server: MockServer): void { }; const rawResponseBody = { access_token: "access_token", expires_in: 1, refresh_token: "refresh_token" }; server - .mockEndpoint() + .mockEndpoint({ once: false }) .post("/token") .jsonBody(rawRequestBody) .respondWith() diff --git a/seed/ts-sdk/oauth-client-credentials-nested-root/no-custom-config/.fern/metadata.json b/seed/ts-sdk/oauth-client-credentials-nested-root/no-custom-config/.fern/metadata.json index 5789995ae525..9ea68298004b 100644 --- a/seed/ts-sdk/oauth-client-credentials-nested-root/no-custom-config/.fern/metadata.json +++ b/seed/ts-sdk/oauth-client-credentials-nested-root/no-custom-config/.fern/metadata.json @@ -3,8 +3,7 @@ "generatorName": "fernapi/fern-typescript-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } diff --git a/seed/ts-sdk/oauth-client-credentials-nested-root/no-custom-config/tests/wire/mockAuth.ts b/seed/ts-sdk/oauth-client-credentials-nested-root/no-custom-config/tests/wire/mockAuth.ts index 0dbb0e6081c2..fac862b802b3 100644 --- a/seed/ts-sdk/oauth-client-credentials-nested-root/no-custom-config/tests/wire/mockAuth.ts +++ b/seed/ts-sdk/oauth-client-credentials-nested-root/no-custom-config/tests/wire/mockAuth.ts @@ -11,7 +11,7 @@ export function mockOAuthScheme(server: MockServer): void { }; const rawResponseBody = { access_token: "access_token", expires_in: 1, refresh_token: "refresh_token" }; server - .mockEndpoint() + .mockEndpoint({ once: false }) .post("/token") .jsonBody(rawRequestBody) .respondWith() diff --git a/seed/ts-sdk/oauth-client-credentials-openapi/.fern/metadata.json b/seed/ts-sdk/oauth-client-credentials-openapi/.fern/metadata.json index 5789995ae525..9ea68298004b 100644 --- a/seed/ts-sdk/oauth-client-credentials-openapi/.fern/metadata.json +++ b/seed/ts-sdk/oauth-client-credentials-openapi/.fern/metadata.json @@ -3,8 +3,7 @@ "generatorName": "fernapi/fern-typescript-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } diff --git a/seed/ts-sdk/oauth-client-credentials-openapi/tests/wire/mockAuth.ts b/seed/ts-sdk/oauth-client-credentials-openapi/tests/wire/mockAuth.ts index ac60e34f6699..42d22d488c0f 100644 --- a/seed/ts-sdk/oauth-client-credentials-openapi/tests/wire/mockAuth.ts +++ b/seed/ts-sdk/oauth-client-credentials-openapi/tests/wire/mockAuth.ts @@ -6,7 +6,7 @@ export function mockCustomAuth(server: MockServer): void { const rawRequestBody = { username: "username", password: "password" }; const rawResponseBody = { access_token: "access_token", expires_in: 1, refresh_token: "refresh_token" }; server - .mockEndpoint() + .mockEndpoint({ once: false }) .post("/identity/token") .jsonBody(rawRequestBody) .respondWith() diff --git a/seed/ts-sdk/oauth-client-credentials-reference/.fern/metadata.json b/seed/ts-sdk/oauth-client-credentials-reference/.fern/metadata.json index 5789995ae525..9ea68298004b 100644 --- a/seed/ts-sdk/oauth-client-credentials-reference/.fern/metadata.json +++ b/seed/ts-sdk/oauth-client-credentials-reference/.fern/metadata.json @@ -3,8 +3,7 @@ "generatorName": "fernapi/fern-typescript-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } diff --git a/seed/ts-sdk/oauth-client-credentials-reference/tests/wire/mockAuth.ts b/seed/ts-sdk/oauth-client-credentials-reference/tests/wire/mockAuth.ts index 766ff37bb47f..7c9ca830e5db 100644 --- a/seed/ts-sdk/oauth-client-credentials-reference/tests/wire/mockAuth.ts +++ b/seed/ts-sdk/oauth-client-credentials-reference/tests/wire/mockAuth.ts @@ -4,5 +4,5 @@ import type { MockServer } from "../mock-server/MockServer"; export function mockOAuthScheme(server: MockServer): void { const rawResponseBody = { access_token: "access_token", expires_in: 3600 }; - server.mockEndpoint().post("/token").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + server.mockEndpoint({ once: false }).post("/token").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); } diff --git a/seed/ts-sdk/oauth-client-credentials-with-variables/.fern/metadata.json b/seed/ts-sdk/oauth-client-credentials-with-variables/.fern/metadata.json index 5789995ae525..9ea68298004b 100644 --- a/seed/ts-sdk/oauth-client-credentials-with-variables/.fern/metadata.json +++ b/seed/ts-sdk/oauth-client-credentials-with-variables/.fern/metadata.json @@ -3,8 +3,7 @@ "generatorName": "fernapi/fern-typescript-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } diff --git a/seed/ts-sdk/oauth-client-credentials-with-variables/tests/wire/mockAuth.ts b/seed/ts-sdk/oauth-client-credentials-with-variables/tests/wire/mockAuth.ts index 0dbb0e6081c2..fac862b802b3 100644 --- a/seed/ts-sdk/oauth-client-credentials-with-variables/tests/wire/mockAuth.ts +++ b/seed/ts-sdk/oauth-client-credentials-with-variables/tests/wire/mockAuth.ts @@ -11,7 +11,7 @@ export function mockOAuthScheme(server: MockServer): void { }; const rawResponseBody = { access_token: "access_token", expires_in: 1, refresh_token: "refresh_token" }; server - .mockEndpoint() + .mockEndpoint({ once: false }) .post("/token") .jsonBody(rawRequestBody) .respondWith() diff --git a/seed/ts-sdk/oauth-client-credentials/no-custom-config/.fern/metadata.json b/seed/ts-sdk/oauth-client-credentials/no-custom-config/.fern/metadata.json index 5789995ae525..9ea68298004b 100644 --- a/seed/ts-sdk/oauth-client-credentials/no-custom-config/.fern/metadata.json +++ b/seed/ts-sdk/oauth-client-credentials/no-custom-config/.fern/metadata.json @@ -3,8 +3,7 @@ "generatorName": "fernapi/fern-typescript-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } diff --git a/seed/ts-sdk/oauth-client-credentials/no-custom-config/tests/wire/mockAuth.ts b/seed/ts-sdk/oauth-client-credentials/no-custom-config/tests/wire/mockAuth.ts index c53f7d79f6e2..965f75233e24 100644 --- a/seed/ts-sdk/oauth-client-credentials/no-custom-config/tests/wire/mockAuth.ts +++ b/seed/ts-sdk/oauth-client-credentials/no-custom-config/tests/wire/mockAuth.ts @@ -11,7 +11,7 @@ export function mockOAuthScheme(server: MockServer): void { }; const rawResponseBody = { access_token: "access_token", expires_in: 1, refresh_token: "refresh_token" }; server - .mockEndpoint() + .mockEndpoint({ once: false }) .post("/token") .formUrlEncodedBody(rawRequestBody) .respondWith() diff --git a/seed/ts-sdk/oauth-client-credentials/serde/.fern/metadata.json b/seed/ts-sdk/oauth-client-credentials/serde/.fern/metadata.json index c6aaed856cfd..85d1f19701f3 100644 --- a/seed/ts-sdk/oauth-client-credentials/serde/.fern/metadata.json +++ b/seed/ts-sdk/oauth-client-credentials/serde/.fern/metadata.json @@ -6,8 +6,7 @@ "noSerdeLayer": false }, "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } diff --git a/seed/ts-sdk/oauth-client-credentials/serde/tests/wire/mockAuth.ts b/seed/ts-sdk/oauth-client-credentials/serde/tests/wire/mockAuth.ts index c53f7d79f6e2..965f75233e24 100644 --- a/seed/ts-sdk/oauth-client-credentials/serde/tests/wire/mockAuth.ts +++ b/seed/ts-sdk/oauth-client-credentials/serde/tests/wire/mockAuth.ts @@ -11,7 +11,7 @@ export function mockOAuthScheme(server: MockServer): void { }; const rawResponseBody = { access_token: "access_token", expires_in: 1, refresh_token: "refresh_token" }; server - .mockEndpoint() + .mockEndpoint({ once: false }) .post("/token") .formUrlEncodedBody(rawRequestBody) .respondWith() diff --git a/seed/ts-sdk/pagination/no-custom-config/.fern/metadata.json b/seed/ts-sdk/pagination/no-custom-config/.fern/metadata.json index 5789995ae525..9ea68298004b 100644 --- a/seed/ts-sdk/pagination/no-custom-config/.fern/metadata.json +++ b/seed/ts-sdk/pagination/no-custom-config/.fern/metadata.json @@ -3,8 +3,7 @@ "generatorName": "fernapi/fern-typescript-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } diff --git a/seed/ts-sdk/pagination/no-custom-config/tests/wire/inline-users/inlineUsers.test.ts b/seed/ts-sdk/pagination/no-custom-config/tests/wire/inline-users/inlineUsers.test.ts index ce6c0c349998..b20fbda6a2b2 100644 --- a/seed/ts-sdk/pagination/no-custom-config/tests/wire/inline-users/inlineUsers.test.ts +++ b/seed/ts-sdk/pagination/no-custom-config/tests/wire/inline-users/inlineUsers.test.ts @@ -243,13 +243,7 @@ describe("InlineUsersClient", () => { }, }; - server - .mockEndpoint({ once: false }) - .get("/inline-users") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); + server.mockEndpoint().get("/inline-users").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const expected = rawResponseBody; const page = await client.inlineUsers.inlineUsers.listWithOffsetStepPagination({ @@ -259,9 +253,6 @@ describe("InlineUsersClient", () => { }); expect(expected.data.users).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data.users).toEqual(nextPage.data); }); test("listWithOffsetPaginationHasNextPage", async () => { diff --git a/seed/ts-sdk/pagination/no-custom-config/tests/wire/users.test.ts b/seed/ts-sdk/pagination/no-custom-config/tests/wire/users.test.ts index f6e14466e01b..ed8393bf7f7b 100644 --- a/seed/ts-sdk/pagination/no-custom-config/tests/wire/users.test.ts +++ b/seed/ts-sdk/pagination/no-custom-config/tests/wire/users.test.ts @@ -262,13 +262,7 @@ describe("UsersClient", () => { ], }; - server - .mockEndpoint({ once: false }) - .get("/users") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); + server.mockEndpoint().get("/users").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const expected = rawResponseBody; const page = await client.users.listWithOffsetStepPagination({ @@ -278,9 +272,6 @@ describe("UsersClient", () => { }); expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); }); test("listWithOffsetPaginationHasNextPage (1)", async () => { diff --git a/seed/ts-sdk/pagination/page-index-semantics/.fern/metadata.json b/seed/ts-sdk/pagination/page-index-semantics/.fern/metadata.json index 6cdf59beeedf..0fe287e6fffe 100644 --- a/seed/ts-sdk/pagination/page-index-semantics/.fern/metadata.json +++ b/seed/ts-sdk/pagination/page-index-semantics/.fern/metadata.json @@ -6,8 +6,7 @@ "offsetSemantics": "page-index" }, "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } diff --git a/seed/ts-sdk/pagination/page-index-semantics/tests/wire/inline-users/inlineUsers.test.ts b/seed/ts-sdk/pagination/page-index-semantics/tests/wire/inline-users/inlineUsers.test.ts index ce6c0c349998..b20fbda6a2b2 100644 --- a/seed/ts-sdk/pagination/page-index-semantics/tests/wire/inline-users/inlineUsers.test.ts +++ b/seed/ts-sdk/pagination/page-index-semantics/tests/wire/inline-users/inlineUsers.test.ts @@ -243,13 +243,7 @@ describe("InlineUsersClient", () => { }, }; - server - .mockEndpoint({ once: false }) - .get("/inline-users") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); + server.mockEndpoint().get("/inline-users").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const expected = rawResponseBody; const page = await client.inlineUsers.inlineUsers.listWithOffsetStepPagination({ @@ -259,9 +253,6 @@ describe("InlineUsersClient", () => { }); expect(expected.data.users).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data.users).toEqual(nextPage.data); }); test("listWithOffsetPaginationHasNextPage", async () => { diff --git a/seed/ts-sdk/pagination/page-index-semantics/tests/wire/users.test.ts b/seed/ts-sdk/pagination/page-index-semantics/tests/wire/users.test.ts index f6e14466e01b..ed8393bf7f7b 100644 --- a/seed/ts-sdk/pagination/page-index-semantics/tests/wire/users.test.ts +++ b/seed/ts-sdk/pagination/page-index-semantics/tests/wire/users.test.ts @@ -262,13 +262,7 @@ describe("UsersClient", () => { ], }; - server - .mockEndpoint({ once: false }) - .get("/users") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); + server.mockEndpoint().get("/users").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const expected = rawResponseBody; const page = await client.users.listWithOffsetStepPagination({ @@ -278,9 +272,6 @@ describe("UsersClient", () => { }); expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); }); test("listWithOffsetPaginationHasNextPage (1)", async () => { diff --git a/seed/ts-sdk/websocket-inferred-auth/websockets/.fern/metadata.json b/seed/ts-sdk/websocket-inferred-auth/websockets/.fern/metadata.json index 2782697bde52..2089d029b8c9 100644 --- a/seed/ts-sdk/websocket-inferred-auth/websockets/.fern/metadata.json +++ b/seed/ts-sdk/websocket-inferred-auth/websockets/.fern/metadata.json @@ -6,8 +6,7 @@ "generateWebSocketClients": true }, "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } diff --git a/seed/ts-sdk/websocket-inferred-auth/websockets/tests/wire/mockAuth.ts b/seed/ts-sdk/websocket-inferred-auth/websockets/tests/wire/mockAuth.ts index d936b66bcc75..57b813dbe6ea 100644 --- a/seed/ts-sdk/websocket-inferred-auth/websockets/tests/wire/mockAuth.ts +++ b/seed/ts-sdk/websocket-inferred-auth/websockets/tests/wire/mockAuth.ts @@ -12,7 +12,7 @@ export function mockInferredAuthScheme(server: MockServer): void { }; const rawResponseBody = { access_token: "access_token", refresh_token: "refresh_token" }; server - .mockEndpoint() + .mockEndpoint({ once: false }) .post("/token") .header("X-Api-Key", "X-Api-Key") .jsonBody(rawRequestBody)