@fern-api/venus-api-sdk 0.22.4 → 0.22.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +270 -0
- package/dist/cjs/BaseClient.d.ts +17 -4
- package/dist/cjs/BaseClient.js +59 -0
- package/dist/cjs/Client.d.ts +19 -16
- package/dist/cjs/Client.js +15 -50
- package/dist/cjs/api/resources/apiKeys/client/Client.d.ts +16 -17
- package/dist/cjs/api/resources/apiKeys/client/Client.js +41 -34
- package/dist/cjs/api/resources/apiKeys/client/create.js +1 -1
- package/dist/cjs/api/resources/apiKeys/client/getTokenMetadata.js +1 -1
- package/dist/cjs/api/resources/apiKeys/client/getTokensForOrganization.js +1 -1
- package/dist/cjs/api/resources/apiKeys/client/revokeToken.js +1 -1
- package/dist/cjs/api/resources/apiKeys/client/revokeTokenById.js +1 -1
- package/dist/cjs/api/resources/auth/client/Client.d.ts +69 -0
- package/dist/cjs/api/resources/auth/client/Client.js +295 -0
- package/dist/cjs/api/resources/auth/client/getAutopilotToken.d.ts +24 -0
- package/dist/cjs/api/resources/auth/client/getAutopilotToken.js +65 -0
- package/dist/cjs/api/resources/auth/client/getJwt.d.ts +24 -0
- package/dist/cjs/api/resources/auth/client/getJwt.js +65 -0
- package/dist/cjs/api/resources/auth/client/getOrgForGithubOwner.d.ts +19 -0
- package/dist/cjs/api/resources/auth/client/getOrgForGithubOwner.js +55 -0
- package/dist/cjs/api/resources/auth/client/index.d.ts +4 -0
- package/dist/cjs/api/resources/auth/client/index.js +43 -0
- package/dist/cjs/api/resources/auth/client/requests/GetAutopilotTokenRequest.d.ts +22 -0
- package/dist/cjs/api/resources/auth/client/requests/GetAutopilotTokenRequest.js +3 -0
- package/dist/cjs/api/resources/auth/client/requests/GetJwtRequest.d.ts +16 -0
- package/dist/cjs/api/resources/auth/client/requests/GetJwtRequest.js +3 -0
- package/dist/cjs/api/resources/auth/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/auth/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/auth/index.d.ts +2 -0
- package/dist/cjs/api/resources/auth/index.js +18 -0
- package/dist/cjs/api/resources/auth/types/JwtResponse.d.ts +11 -0
- package/dist/cjs/api/resources/auth/types/JwtResponse.js +3 -0
- package/dist/cjs/api/resources/auth/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/auth/types/index.js +17 -0
- package/dist/cjs/api/resources/index.d.ts +3 -0
- package/dist/cjs/api/resources/index.js +4 -1
- package/dist/cjs/api/resources/organization/client/Client.d.ts +37 -27
- package/dist/cjs/api/resources/organization/client/Client.js +152 -60
- package/dist/cjs/api/resources/organization/client/addUser.js +1 -1
- package/dist/cjs/api/resources/organization/client/create.js +1 -1
- package/dist/cjs/api/resources/organization/client/delete.js +1 -1
- package/dist/cjs/api/resources/organization/client/get.js +1 -1
- package/dist/cjs/api/resources/organization/client/getByPostmanTeamId.d.ts +24 -0
- package/dist/cjs/api/resources/organization/client/getByPostmanTeamId.js +65 -0
- package/dist/cjs/api/resources/organization/client/getMyOrganizationFromScopedToken.js +1 -1
- package/dist/cjs/api/resources/organization/client/getOrgIdsFromToken.js +1 -1
- package/dist/cjs/api/resources/organization/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/organization/client/index.js +2 -1
- package/dist/cjs/api/resources/organization/client/inviteUser.js +1 -1
- package/dist/cjs/api/resources/organization/client/isMember.js +1 -1
- package/dist/cjs/api/resources/organization/client/removeUser.js +1 -1
- package/dist/cjs/api/resources/organization/client/requests/CreateOrganizationRequest.d.ts +8 -0
- package/dist/cjs/api/resources/organization/client/update.js +1 -1
- package/dist/cjs/api/resources/organization/types/Organization.d.ts +2 -0
- package/dist/cjs/api/resources/registry/client/Client.d.ts +12 -13
- package/dist/cjs/api/resources/registry/client/Client.js +28 -26
- package/dist/cjs/api/resources/registry/client/generateRegistryTokens.d.ts +6 -1
- package/dist/cjs/api/resources/registry/client/generateRegistryTokens.js +11 -1
- package/dist/cjs/api/resources/registry/client/hasRegistryPermission.js +1 -1
- package/dist/cjs/api/resources/registry/client/revokeToken.d.ts +6 -1
- package/dist/cjs/api/resources/registry/client/revokeToken.js +11 -1
- package/dist/cjs/api/resources/user/client/Client.d.ts +12 -13
- package/dist/cjs/api/resources/user/client/Client.js +27 -25
- package/dist/cjs/api/resources/user/client/getMyOrganizations.js +1 -1
- package/dist/cjs/api/resources/user/client/getMyself.js +1 -1
- package/dist/cjs/api/resources/user/client/linkAccounts.js +1 -1
- package/dist/cjs/auth/BearerAuthProvider.d.ts +20 -0
- package/dist/cjs/auth/BearerAuthProvider.js +76 -0
- package/dist/cjs/auth/index.d.ts +1 -0
- package/dist/cjs/auth/index.js +5 -0
- package/dist/cjs/core/auth/AuthProvider.d.ts +4 -1
- package/dist/cjs/core/auth/BearerToken.d.ts +3 -1
- package/dist/cjs/core/auth/BearerToken.js +7 -6
- package/dist/cjs/core/auth/NoOpAuthProvider.d.ts +5 -0
- package/dist/cjs/core/auth/NoOpAuthProvider.js +9 -0
- package/dist/cjs/core/auth/index.d.ts +1 -0
- package/dist/cjs/core/auth/index.js +3 -1
- package/dist/cjs/core/exports.d.ts +1 -0
- package/dist/cjs/core/exports.js +17 -0
- package/dist/cjs/core/fetcher/BinaryResponse.d.ts +6 -7
- package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +2 -2
- package/dist/cjs/core/fetcher/Fetcher.d.ts +10 -4
- package/dist/cjs/core/fetcher/Fetcher.js +210 -10
- package/dist/cjs/core/fetcher/getRequestBody.d.ts +1 -1
- package/dist/cjs/core/fetcher/getRequestBody.js +4 -0
- package/dist/cjs/core/fetcher/getResponseBody.js +18 -4
- package/dist/cjs/core/fetcher/makeRequest.d.ts +1 -1
- package/dist/cjs/core/fetcher/makeRequest.js +0 -2
- package/dist/cjs/core/fetcher/requestWithRetries.js +0 -9
- package/dist/cjs/core/fetcher/signals.d.ts +1 -7
- package/dist/cjs/core/fetcher/signals.js +0 -12
- package/dist/cjs/core/headers.d.ts +2 -2
- package/dist/cjs/core/headers.js +6 -4
- package/dist/cjs/core/index.d.ts +1 -0
- package/dist/cjs/core/index.js +2 -1
- package/dist/cjs/core/logging/exports.d.ts +18 -0
- package/dist/cjs/core/logging/exports.js +45 -0
- package/dist/cjs/core/logging/index.d.ts +1 -0
- package/dist/cjs/core/logging/index.js +17 -0
- package/dist/cjs/core/logging/logger.d.ts +126 -0
- package/dist/cjs/core/logging/logger.js +144 -0
- package/dist/cjs/core/runtime/runtime.js +11 -10
- package/dist/cjs/core/schemas/Schema.d.ts +1 -0
- package/dist/cjs/core/schemas/Schema.js +1 -0
- package/dist/cjs/core/schemas/builders/object/object.js +34 -3
- package/dist/cjs/core/schemas/builders/primitives/index.d.ts +1 -0
- package/dist/cjs/core/schemas/builders/primitives/index.js +3 -1
- package/dist/cjs/core/schemas/builders/primitives/never.d.ts +2 -0
- package/dist/cjs/core/schemas/builders/primitives/never.js +14 -0
- package/dist/cjs/core/url/join.js +0 -1
- package/dist/cjs/exports.d.ts +1 -0
- package/dist/cjs/exports.js +17 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +4 -0
- package/dist/cjs/serialization/resources/auth/client/getAutopilotToken.d.ts +10 -0
- package/dist/cjs/serialization/resources/auth/client/getAutopilotToken.js +66 -0
- package/dist/cjs/serialization/resources/auth/client/getJwt.d.ts +10 -0
- package/dist/cjs/serialization/resources/auth/client/getJwt.js +66 -0
- package/dist/cjs/serialization/resources/auth/client/getOrgForGithubOwner.d.ts +8 -0
- package/dist/cjs/serialization/resources/auth/client/getOrgForGithubOwner.js +6 -0
- package/dist/cjs/serialization/resources/auth/client/index.d.ts +4 -0
- package/dist/cjs/serialization/resources/auth/client/index.js +43 -0
- package/dist/cjs/serialization/resources/auth/client/requests/GetAutopilotTokenRequest.d.ts +11 -0
- package/dist/cjs/serialization/resources/auth/client/requests/GetAutopilotTokenRequest.js +43 -0
- package/dist/cjs/serialization/resources/auth/client/requests/GetJwtRequest.d.ts +10 -0
- package/dist/cjs/serialization/resources/auth/client/requests/GetJwtRequest.js +42 -0
- package/dist/cjs/serialization/resources/auth/client/requests/index.d.ts +2 -0
- package/dist/cjs/serialization/resources/auth/client/requests/index.js +7 -0
- package/dist/cjs/serialization/resources/auth/index.d.ts +2 -0
- package/dist/cjs/serialization/resources/auth/index.js +18 -0
- package/dist/cjs/serialization/resources/auth/types/JwtResponse.d.ts +10 -0
- package/dist/cjs/serialization/resources/auth/types/JwtResponse.js +42 -0
- package/dist/cjs/serialization/resources/auth/types/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/auth/types/index.js +17 -0
- package/dist/cjs/serialization/resources/index.d.ts +3 -0
- package/dist/cjs/serialization/resources/index.js +4 -1
- package/dist/cjs/serialization/resources/organization/client/getByPostmanTeamId.d.ts +10 -0
- package/dist/cjs/serialization/resources/organization/client/getByPostmanTeamId.js +66 -0
- package/dist/cjs/serialization/resources/organization/client/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/organization/client/index.js +2 -1
- package/dist/cjs/serialization/resources/organization/client/requests/CreateOrganizationRequest.d.ts +2 -0
- package/dist/cjs/serialization/resources/organization/client/requests/CreateOrganizationRequest.js +2 -0
- package/dist/cjs/serialization/resources/organization/types/Organization.d.ts +1 -0
- package/dist/cjs/serialization/resources/organization/types/Organization.js +1 -0
- package/dist/cjs/serialization/resources/registry/client/generateRegistryTokens.d.ts +4 -1
- package/dist/cjs/serialization/resources/registry/client/generateRegistryTokens.js +3 -0
- package/dist/cjs/serialization/resources/registry/client/revokeToken.d.ts +4 -1
- package/dist/cjs/serialization/resources/registry/client/revokeToken.js +3 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +17 -4
- package/dist/esm/BaseClient.mjs +24 -1
- package/dist/esm/Client.d.mts +19 -16
- package/dist/esm/Client.mjs +16 -18
- package/dist/esm/api/resources/apiKeys/client/Client.d.mts +16 -17
- package/dist/esm/api/resources/apiKeys/client/Client.mjs +40 -33
- package/dist/esm/api/resources/apiKeys/client/create.mjs +1 -1
- package/dist/esm/api/resources/apiKeys/client/getTokenMetadata.mjs +1 -1
- package/dist/esm/api/resources/apiKeys/client/getTokensForOrganization.mjs +1 -1
- package/dist/esm/api/resources/apiKeys/client/revokeToken.mjs +1 -1
- package/dist/esm/api/resources/apiKeys/client/revokeTokenById.mjs +1 -1
- package/dist/esm/api/resources/auth/client/Client.d.mts +69 -0
- package/dist/esm/api/resources/auth/client/Client.mjs +258 -0
- package/dist/esm/api/resources/auth/client/getAutopilotToken.d.mts +24 -0
- package/dist/esm/api/resources/auth/client/getAutopilotToken.mjs +29 -0
- package/dist/esm/api/resources/auth/client/getJwt.d.mts +24 -0
- package/dist/esm/api/resources/auth/client/getJwt.mjs +29 -0
- package/dist/esm/api/resources/auth/client/getOrgForGithubOwner.d.mts +19 -0
- package/dist/esm/api/resources/auth/client/getOrgForGithubOwner.mjs +19 -0
- package/dist/esm/api/resources/auth/client/index.d.mts +4 -0
- package/dist/esm/api/resources/auth/client/index.mjs +4 -0
- package/dist/esm/api/resources/auth/client/requests/GetAutopilotTokenRequest.d.mts +22 -0
- package/dist/esm/api/resources/auth/client/requests/GetAutopilotTokenRequest.mjs +2 -0
- package/dist/esm/api/resources/auth/client/requests/GetJwtRequest.d.mts +16 -0
- package/dist/esm/api/resources/auth/client/requests/GetJwtRequest.mjs +2 -0
- package/dist/esm/api/resources/auth/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/auth/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/auth/index.d.mts +2 -0
- package/dist/esm/api/resources/auth/index.mjs +2 -0
- package/dist/esm/api/resources/auth/types/JwtResponse.d.mts +11 -0
- package/dist/esm/api/resources/auth/types/JwtResponse.mjs +2 -0
- package/dist/esm/api/resources/auth/types/index.d.mts +1 -0
- package/dist/esm/api/resources/auth/types/index.mjs +1 -0
- package/dist/esm/api/resources/index.d.mts +3 -0
- package/dist/esm/api/resources/index.mjs +3 -0
- package/dist/esm/api/resources/organization/client/Client.d.mts +37 -27
- package/dist/esm/api/resources/organization/client/Client.mjs +151 -59
- package/dist/esm/api/resources/organization/client/addUser.mjs +1 -1
- package/dist/esm/api/resources/organization/client/create.mjs +1 -1
- package/dist/esm/api/resources/organization/client/delete.mjs +1 -1
- package/dist/esm/api/resources/organization/client/get.mjs +1 -1
- package/dist/esm/api/resources/organization/client/getByPostmanTeamId.d.mts +24 -0
- package/dist/esm/api/resources/organization/client/getByPostmanTeamId.mjs +29 -0
- package/dist/esm/api/resources/organization/client/getMyOrganizationFromScopedToken.mjs +1 -1
- package/dist/esm/api/resources/organization/client/getOrgIdsFromToken.mjs +1 -1
- package/dist/esm/api/resources/organization/client/index.d.mts +1 -0
- package/dist/esm/api/resources/organization/client/index.mjs +1 -0
- package/dist/esm/api/resources/organization/client/inviteUser.mjs +1 -1
- package/dist/esm/api/resources/organization/client/isMember.mjs +1 -1
- package/dist/esm/api/resources/organization/client/removeUser.mjs +1 -1
- package/dist/esm/api/resources/organization/client/requests/CreateOrganizationRequest.d.mts +8 -0
- package/dist/esm/api/resources/organization/client/update.mjs +1 -1
- package/dist/esm/api/resources/organization/types/Organization.d.mts +2 -0
- package/dist/esm/api/resources/registry/client/Client.d.mts +12 -13
- package/dist/esm/api/resources/registry/client/Client.mjs +27 -25
- package/dist/esm/api/resources/registry/client/generateRegistryTokens.d.mts +6 -1
- package/dist/esm/api/resources/registry/client/generateRegistryTokens.mjs +11 -1
- package/dist/esm/api/resources/registry/client/hasRegistryPermission.mjs +1 -1
- package/dist/esm/api/resources/registry/client/revokeToken.d.mts +6 -1
- package/dist/esm/api/resources/registry/client/revokeToken.mjs +11 -1
- package/dist/esm/api/resources/user/client/Client.d.mts +12 -13
- package/dist/esm/api/resources/user/client/Client.mjs +26 -24
- package/dist/esm/api/resources/user/client/getMyOrganizations.mjs +1 -1
- package/dist/esm/api/resources/user/client/getMyself.mjs +1 -1
- package/dist/esm/api/resources/user/client/linkAccounts.mjs +1 -1
- package/dist/esm/auth/BearerAuthProvider.d.mts +20 -0
- package/dist/esm/auth/BearerAuthProvider.mjs +39 -0
- package/dist/esm/auth/index.d.mts +1 -0
- package/dist/esm/auth/index.mjs +1 -0
- package/dist/esm/core/auth/AuthProvider.d.mts +4 -1
- package/dist/esm/core/auth/BearerToken.d.mts +3 -1
- package/dist/esm/core/auth/BearerToken.mjs +7 -6
- package/dist/esm/core/auth/NoOpAuthProvider.d.mts +5 -0
- package/dist/esm/core/auth/NoOpAuthProvider.mjs +5 -0
- package/dist/esm/core/auth/index.d.mts +1 -0
- package/dist/esm/core/auth/index.mjs +1 -0
- package/dist/esm/core/exports.d.mts +1 -0
- package/dist/esm/core/exports.mjs +1 -0
- package/dist/esm/core/fetcher/BinaryResponse.d.mts +6 -7
- package/dist/esm/core/fetcher/EndpointSupplier.d.mts +2 -2
- package/dist/esm/core/fetcher/Fetcher.d.mts +10 -4
- package/dist/esm/core/fetcher/Fetcher.mjs +210 -10
- package/dist/esm/core/fetcher/getRequestBody.d.mts +1 -1
- package/dist/esm/core/fetcher/getRequestBody.mjs +4 -0
- package/dist/esm/core/fetcher/getResponseBody.mjs +18 -4
- package/dist/esm/core/fetcher/makeRequest.d.mts +1 -1
- package/dist/esm/core/fetcher/makeRequest.mjs +0 -2
- package/dist/esm/core/fetcher/requestWithRetries.mjs +0 -9
- package/dist/esm/core/fetcher/signals.d.mts +1 -7
- package/dist/esm/core/fetcher/signals.mjs +0 -12
- package/dist/esm/core/headers.d.mts +2 -2
- package/dist/esm/core/headers.mjs +6 -4
- package/dist/esm/core/index.d.mts +1 -0
- package/dist/esm/core/index.mjs +1 -0
- package/dist/esm/core/logging/exports.d.mts +18 -0
- package/dist/esm/core/logging/exports.mjs +9 -0
- package/dist/esm/core/logging/index.d.mts +1 -0
- package/dist/esm/core/logging/index.mjs +1 -0
- package/dist/esm/core/logging/logger.d.mts +126 -0
- package/dist/esm/core/logging/logger.mjs +138 -0
- package/dist/esm/core/runtime/runtime.mjs +11 -10
- package/dist/esm/core/schemas/Schema.d.mts +1 -0
- package/dist/esm/core/schemas/Schema.mjs +1 -0
- package/dist/esm/core/schemas/builders/object/object.mjs +34 -3
- package/dist/esm/core/schemas/builders/primitives/index.d.mts +1 -0
- package/dist/esm/core/schemas/builders/primitives/index.mjs +1 -0
- package/dist/esm/core/schemas/builders/primitives/never.d.mts +2 -0
- package/dist/esm/core/schemas/builders/primitives/never.mjs +11 -0
- package/dist/esm/core/url/join.mjs +0 -1
- package/dist/esm/exports.d.mts +1 -0
- package/dist/esm/exports.mjs +1 -0
- package/dist/esm/index.d.mts +1 -0
- package/dist/esm/index.mjs +1 -0
- package/dist/esm/serialization/resources/auth/client/getAutopilotToken.d.mts +10 -0
- package/dist/esm/serialization/resources/auth/client/getAutopilotToken.mjs +30 -0
- package/dist/esm/serialization/resources/auth/client/getJwt.d.mts +10 -0
- package/dist/esm/serialization/resources/auth/client/getJwt.mjs +30 -0
- package/dist/esm/serialization/resources/auth/client/getOrgForGithubOwner.d.mts +8 -0
- package/dist/esm/serialization/resources/auth/client/getOrgForGithubOwner.mjs +3 -0
- package/dist/esm/serialization/resources/auth/client/index.d.mts +4 -0
- package/dist/esm/serialization/resources/auth/client/index.mjs +4 -0
- package/dist/esm/serialization/resources/auth/client/requests/GetAutopilotTokenRequest.d.mts +11 -0
- package/dist/esm/serialization/resources/auth/client/requests/GetAutopilotTokenRequest.mjs +7 -0
- package/dist/esm/serialization/resources/auth/client/requests/GetJwtRequest.d.mts +10 -0
- package/dist/esm/serialization/resources/auth/client/requests/GetJwtRequest.mjs +6 -0
- package/dist/esm/serialization/resources/auth/client/requests/index.d.mts +2 -0
- package/dist/esm/serialization/resources/auth/client/requests/index.mjs +2 -0
- package/dist/esm/serialization/resources/auth/index.d.mts +2 -0
- package/dist/esm/serialization/resources/auth/index.mjs +2 -0
- package/dist/esm/serialization/resources/auth/types/JwtResponse.d.mts +10 -0
- package/dist/esm/serialization/resources/auth/types/JwtResponse.mjs +6 -0
- package/dist/esm/serialization/resources/auth/types/index.d.mts +1 -0
- package/dist/esm/serialization/resources/auth/types/index.mjs +1 -0
- package/dist/esm/serialization/resources/index.d.mts +3 -0
- package/dist/esm/serialization/resources/index.mjs +3 -0
- package/dist/esm/serialization/resources/organization/client/getByPostmanTeamId.d.mts +10 -0
- package/dist/esm/serialization/resources/organization/client/getByPostmanTeamId.mjs +30 -0
- package/dist/esm/serialization/resources/organization/client/index.d.mts +1 -0
- package/dist/esm/serialization/resources/organization/client/index.mjs +1 -0
- package/dist/esm/serialization/resources/organization/client/requests/CreateOrganizationRequest.d.mts +2 -0
- package/dist/esm/serialization/resources/organization/client/requests/CreateOrganizationRequest.mjs +2 -0
- package/dist/esm/serialization/resources/organization/types/Organization.d.mts +1 -0
- package/dist/esm/serialization/resources/organization/types/Organization.mjs +1 -0
- package/dist/esm/serialization/resources/registry/client/generateRegistryTokens.d.mts +4 -1
- package/dist/esm/serialization/resources/registry/client/generateRegistryTokens.mjs +3 -0
- package/dist/esm/serialization/resources/registry/client/revokeToken.d.mts +4 -1
- package/dist/esm/serialization/resources/registry/client/revokeToken.mjs +3 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +8 -3
- package/reference.md +1369 -0
- package/dist/cjs/core/fetcher/ResponseWithBody.d.ts +0 -4
- package/dist/cjs/core/fetcher/ResponseWithBody.js +0 -6
- package/dist/esm/core/fetcher/ResponseWithBody.d.mts +0 -4
- package/dist/esm/core/fetcher/ResponseWithBody.mjs +0 -3
|
@@ -8,18 +8,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
import {
|
|
11
|
+
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
12
|
+
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
12
13
|
import * as core from "../../../../core/index.mjs";
|
|
13
14
|
import * as environments from "../../../../environments.mjs";
|
|
14
15
|
import * as serializers from "../../../../serialization/index.mjs";
|
|
15
16
|
import * as FernVenusApi from "../../../index.mjs";
|
|
16
|
-
export class
|
|
17
|
-
constructor(
|
|
18
|
-
this._options =
|
|
17
|
+
export class ApiKeysClient {
|
|
18
|
+
constructor(options = {}) {
|
|
19
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
19
20
|
}
|
|
20
21
|
/**
|
|
21
22
|
* @param {FernVenusApi.CreateApiKeyRequest} request
|
|
22
|
-
* @param {
|
|
23
|
+
* @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
23
24
|
*
|
|
24
25
|
* @example
|
|
25
26
|
* await client.apiKeys.create({
|
|
@@ -36,8 +37,9 @@ export class ApiKeys {
|
|
|
36
37
|
}
|
|
37
38
|
__create(request, requestOptions) {
|
|
38
39
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
40
|
-
const
|
|
40
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
41
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
42
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
41
43
|
const _response = yield core.fetcher({
|
|
42
44
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FernVenusApiEnvironment.Prod, "/api-keys/create"),
|
|
43
45
|
method: "POST",
|
|
@@ -52,6 +54,8 @@ export class ApiKeys {
|
|
|
52
54
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
53
55
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
54
56
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
57
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
58
|
+
logging: this._options.logging,
|
|
55
59
|
});
|
|
56
60
|
if (_response.ok) {
|
|
57
61
|
return {
|
|
@@ -71,7 +75,7 @@ export class ApiKeys {
|
|
|
71
75
|
};
|
|
72
76
|
}
|
|
73
77
|
if (_response.error.reason === "status-code") {
|
|
74
|
-
switch ((
|
|
78
|
+
switch ((_k = _response.error.body) === null || _k === void 0 ? void 0 : _k.error) {
|
|
75
79
|
case "UnauthorizedError":
|
|
76
80
|
case "OrganizationNotFoundError":
|
|
77
81
|
return {
|
|
@@ -102,7 +106,7 @@ export class ApiKeys {
|
|
|
102
106
|
}
|
|
103
107
|
/**
|
|
104
108
|
* @param {FernVenusApi.GetTokenMetadataRequest} request
|
|
105
|
-
* @param {
|
|
109
|
+
* @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
106
110
|
*
|
|
107
111
|
* @example
|
|
108
112
|
* await client.apiKeys.getTokenMetadata({
|
|
@@ -119,8 +123,9 @@ export class ApiKeys {
|
|
|
119
123
|
}
|
|
120
124
|
__getTokenMetadata(request, requestOptions) {
|
|
121
125
|
return __awaiter(this, void 0, void 0, function* () {
|
|
122
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
123
|
-
const
|
|
126
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
127
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
128
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
124
129
|
const _response = yield core.fetcher({
|
|
125
130
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FernVenusApiEnvironment.Prod, "/api-keys/metadata"),
|
|
126
131
|
method: "POST",
|
|
@@ -135,6 +140,8 @@ export class ApiKeys {
|
|
|
135
140
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
136
141
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
137
142
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
143
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
144
|
+
logging: this._options.logging,
|
|
138
145
|
});
|
|
139
146
|
if (_response.ok) {
|
|
140
147
|
return {
|
|
@@ -154,7 +161,7 @@ export class ApiKeys {
|
|
|
154
161
|
};
|
|
155
162
|
}
|
|
156
163
|
if (_response.error.reason === "status-code") {
|
|
157
|
-
switch ((
|
|
164
|
+
switch ((_k = _response.error.body) === null || _k === void 0 ? void 0 : _k.error) {
|
|
158
165
|
case "UnauthorizedError":
|
|
159
166
|
case "TokenNotFoundError":
|
|
160
167
|
return {
|
|
@@ -185,7 +192,7 @@ export class ApiKeys {
|
|
|
185
192
|
}
|
|
186
193
|
/**
|
|
187
194
|
* @param {FernVenusApi.OrganizationId} organizationId
|
|
188
|
-
* @param {
|
|
195
|
+
* @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
189
196
|
*
|
|
190
197
|
* @example
|
|
191
198
|
* await client.apiKeys.getTokensForOrganization("some-org-id")
|
|
@@ -198,8 +205,9 @@ export class ApiKeys {
|
|
|
198
205
|
}
|
|
199
206
|
__getTokensForOrganization(organizationId, requestOptions) {
|
|
200
207
|
return __awaiter(this, void 0, void 0, function* () {
|
|
201
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
202
|
-
const
|
|
208
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
209
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
210
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
203
211
|
const _response = yield core.fetcher({
|
|
204
212
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FernVenusApiEnvironment.Prod, `/api-keys/organization/${core.url.encodePathParam(serializers.OrganizationId.jsonOrThrow(organizationId, { omitUndefined: true }))}`),
|
|
205
213
|
method: "GET",
|
|
@@ -208,6 +216,8 @@ export class ApiKeys {
|
|
|
208
216
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
209
217
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
210
218
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
219
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
220
|
+
logging: this._options.logging,
|
|
211
221
|
});
|
|
212
222
|
if (_response.ok) {
|
|
213
223
|
return {
|
|
@@ -227,7 +237,7 @@ export class ApiKeys {
|
|
|
227
237
|
};
|
|
228
238
|
}
|
|
229
239
|
if (_response.error.reason === "status-code") {
|
|
230
|
-
switch ((
|
|
240
|
+
switch ((_k = _response.error.body) === null || _k === void 0 ? void 0 : _k.error) {
|
|
231
241
|
case "UnauthorizedError":
|
|
232
242
|
case "OrganizationNotFoundError":
|
|
233
243
|
return {
|
|
@@ -258,7 +268,7 @@ export class ApiKeys {
|
|
|
258
268
|
}
|
|
259
269
|
/**
|
|
260
270
|
* @param {FernVenusApi.TokenId} tokenId
|
|
261
|
-
* @param {
|
|
271
|
+
* @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
262
272
|
*
|
|
263
273
|
* @example
|
|
264
274
|
* await client.apiKeys.revokeTokenById("some-token-id")
|
|
@@ -271,8 +281,9 @@ export class ApiKeys {
|
|
|
271
281
|
}
|
|
272
282
|
__revokeTokenById(tokenId, requestOptions) {
|
|
273
283
|
return __awaiter(this, void 0, void 0, function* () {
|
|
274
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
275
|
-
const
|
|
284
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
285
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
286
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
276
287
|
const _response = yield core.fetcher({
|
|
277
288
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FernVenusApiEnvironment.Prod, `/api-keys/revoke/${core.url.encodePathParam(serializers.TokenId.jsonOrThrow(tokenId, { omitUndefined: true }))}`),
|
|
278
289
|
method: "POST",
|
|
@@ -281,6 +292,8 @@ export class ApiKeys {
|
|
|
281
292
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
282
293
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
283
294
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
295
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
296
|
+
logging: this._options.logging,
|
|
284
297
|
});
|
|
285
298
|
if (_response.ok) {
|
|
286
299
|
return {
|
|
@@ -294,7 +307,7 @@ export class ApiKeys {
|
|
|
294
307
|
};
|
|
295
308
|
}
|
|
296
309
|
if (_response.error.reason === "status-code") {
|
|
297
|
-
switch ((
|
|
310
|
+
switch ((_k = _response.error.body) === null || _k === void 0 ? void 0 : _k.error) {
|
|
298
311
|
case "UnauthorizedError":
|
|
299
312
|
case "TokenNotFoundError":
|
|
300
313
|
return {
|
|
@@ -325,7 +338,7 @@ export class ApiKeys {
|
|
|
325
338
|
}
|
|
326
339
|
/**
|
|
327
340
|
* @param {FernVenusApi.RevokeApiKeyRequest} request
|
|
328
|
-
* @param {
|
|
341
|
+
* @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
329
342
|
*
|
|
330
343
|
* @example
|
|
331
344
|
* await client.apiKeys.revokeToken({
|
|
@@ -342,8 +355,9 @@ export class ApiKeys {
|
|
|
342
355
|
}
|
|
343
356
|
__revokeToken(request, requestOptions) {
|
|
344
357
|
return __awaiter(this, void 0, void 0, function* () {
|
|
345
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
346
|
-
const
|
|
358
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
359
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
360
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
347
361
|
const _response = yield core.fetcher({
|
|
348
362
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FernVenusApiEnvironment.Prod, "/api-keys/revoke"),
|
|
349
363
|
method: "POST",
|
|
@@ -358,6 +372,8 @@ export class ApiKeys {
|
|
|
358
372
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
359
373
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
360
374
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
375
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
376
|
+
logging: this._options.logging,
|
|
361
377
|
});
|
|
362
378
|
if (_response.ok) {
|
|
363
379
|
return {
|
|
@@ -371,7 +387,7 @@ export class ApiKeys {
|
|
|
371
387
|
};
|
|
372
388
|
}
|
|
373
389
|
if (_response.error.reason === "status-code") {
|
|
374
|
-
switch ((
|
|
390
|
+
switch ((_k = _response.error.body) === null || _k === void 0 ? void 0 : _k.error) {
|
|
375
391
|
case "UnauthorizedError":
|
|
376
392
|
case "TokenNotFoundError":
|
|
377
393
|
return {
|
|
@@ -400,13 +416,4 @@ export class ApiKeys {
|
|
|
400
416
|
};
|
|
401
417
|
});
|
|
402
418
|
}
|
|
403
|
-
_getAuthorizationHeader() {
|
|
404
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
405
|
-
const bearer = yield core.Supplier.get(this._options.token);
|
|
406
|
-
if (bearer != null) {
|
|
407
|
-
return `Bearer ${bearer}`;
|
|
408
|
-
}
|
|
409
|
-
return undefined;
|
|
410
|
-
});
|
|
411
|
-
}
|
|
412
419
|
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
|
+
import * as core from "../../../../core/index.mjs";
|
|
4
|
+
import * as FernVenusApi from "../../../index.mjs";
|
|
5
|
+
export declare namespace AuthClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class AuthClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<AuthClient.Options>;
|
|
12
|
+
constructor(options?: AuthClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Look up the Fern organization ID for a GitHub owner.
|
|
15
|
+
* This endpoint is unauthenticated and used by Fiddle to look up the
|
|
16
|
+
* centralized protected GitHub orgs mapping.
|
|
17
|
+
*
|
|
18
|
+
* @param {string} githubOwner - The GitHub repo owner (case-insensitive)
|
|
19
|
+
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* await client.auth.getOrgForGithubOwner("protected-github-owner")
|
|
23
|
+
*/
|
|
24
|
+
getOrgForGithubOwner(githubOwner: string, requestOptions?: AuthClient.RequestOptions): core.HttpResponsePromise<core.APIResponse<FernVenusApi.OrganizationId | undefined, FernVenusApi.auth.getOrgForGithubOwner.Error>>;
|
|
25
|
+
private __getOrgForGithubOwner;
|
|
26
|
+
/**
|
|
27
|
+
* Exchange an autopilot token for a short-lived JWT scoped to an organization.
|
|
28
|
+
* This endpoint is used by automated systems (like Fiddle) to get org-scoped tokens.
|
|
29
|
+
* If a GitHub owner is provided and is in the protected GitHub orgs mapping,
|
|
30
|
+
* the organization ID must match the allowed org for that GitHub owner.
|
|
31
|
+
* The returned token is identical to tokens from getJwt and can be used the same way.
|
|
32
|
+
*
|
|
33
|
+
* @param {FernVenusApi.GetAutopilotTokenRequest} request
|
|
34
|
+
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* await client.auth.getAutopilotToken({
|
|
38
|
+
* organizationId: "my-org-id"
|
|
39
|
+
* })
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* await client.auth.getAutopilotToken({
|
|
43
|
+
* organizationId: "wrong-org",
|
|
44
|
+
* githubOwner: "protected-github-owner"
|
|
45
|
+
* })
|
|
46
|
+
*/
|
|
47
|
+
getAutopilotToken(request: FernVenusApi.GetAutopilotTokenRequest, requestOptions?: AuthClient.RequestOptions): core.HttpResponsePromise<core.APIResponse<FernVenusApi.JwtResponse, FernVenusApi.auth.getAutopilotToken.Error>>;
|
|
48
|
+
private __getAutopilotToken;
|
|
49
|
+
/**
|
|
50
|
+
* Exchange a user token for a short-lived JWT scoped to an organization.
|
|
51
|
+
* The user must be a member of the specified organization.
|
|
52
|
+
* The JWT can be used to authenticate requests to other services.
|
|
53
|
+
*
|
|
54
|
+
* @param {FernVenusApi.GetJwtRequest} request
|
|
55
|
+
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* await client.auth.getJwt({
|
|
59
|
+
* organizationId: "my-org-id"
|
|
60
|
+
* })
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* await client.auth.getJwt({
|
|
64
|
+
* organizationId: "org-user-not-member-of"
|
|
65
|
+
* })
|
|
66
|
+
*/
|
|
67
|
+
getJwt(request: FernVenusApi.GetJwtRequest, requestOptions?: AuthClient.RequestOptions): core.HttpResponsePromise<core.APIResponse<FernVenusApi.JwtResponse, FernVenusApi.auth.getJwt.Error>>;
|
|
68
|
+
private __getJwt;
|
|
69
|
+
}
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
12
|
+
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
13
|
+
import * as core from "../../../../core/index.mjs";
|
|
14
|
+
import * as environments from "../../../../environments.mjs";
|
|
15
|
+
import * as serializers from "../../../../serialization/index.mjs";
|
|
16
|
+
import * as FernVenusApi from "../../../index.mjs";
|
|
17
|
+
export class AuthClient {
|
|
18
|
+
constructor(options = {}) {
|
|
19
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Look up the Fern organization ID for a GitHub owner.
|
|
23
|
+
* This endpoint is unauthenticated and used by Fiddle to look up the
|
|
24
|
+
* centralized protected GitHub orgs mapping.
|
|
25
|
+
*
|
|
26
|
+
* @param {string} githubOwner - The GitHub repo owner (case-insensitive)
|
|
27
|
+
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* await client.auth.getOrgForGithubOwner("protected-github-owner")
|
|
31
|
+
*/
|
|
32
|
+
getOrgForGithubOwner(githubOwner, requestOptions) {
|
|
33
|
+
return core.HttpResponsePromise.fromPromise(this.__getOrgForGithubOwner(githubOwner, requestOptions));
|
|
34
|
+
}
|
|
35
|
+
__getOrgForGithubOwner(githubOwner, requestOptions) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
38
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
39
|
+
const _response = yield core.fetcher({
|
|
40
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FernVenusApiEnvironment.Prod, `/auth/github-owner/${core.url.encodePathParam(githubOwner)}/org`),
|
|
41
|
+
method: "GET",
|
|
42
|
+
headers: _headers,
|
|
43
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
44
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
45
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
46
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
47
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
48
|
+
logging: this._options.logging,
|
|
49
|
+
});
|
|
50
|
+
if (_response.ok) {
|
|
51
|
+
return {
|
|
52
|
+
data: {
|
|
53
|
+
ok: true,
|
|
54
|
+
body: serializers.auth.getOrgForGithubOwner.Response.parseOrThrow(_response.body, {
|
|
55
|
+
unrecognizedObjectKeys: "passthrough",
|
|
56
|
+
allowUnrecognizedUnionMembers: true,
|
|
57
|
+
allowUnrecognizedEnumValues: true,
|
|
58
|
+
skipValidation: true,
|
|
59
|
+
breadcrumbsPrefix: ["response"],
|
|
60
|
+
}),
|
|
61
|
+
headers: _response.headers,
|
|
62
|
+
rawResponse: _response.rawResponse,
|
|
63
|
+
},
|
|
64
|
+
rawResponse: _response.rawResponse,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
data: {
|
|
69
|
+
ok: false,
|
|
70
|
+
error: FernVenusApi.auth.getOrgForGithubOwner.Error._unknown(_response.error),
|
|
71
|
+
rawResponse: _response.rawResponse,
|
|
72
|
+
},
|
|
73
|
+
rawResponse: _response.rawResponse,
|
|
74
|
+
};
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Exchange an autopilot token for a short-lived JWT scoped to an organization.
|
|
79
|
+
* This endpoint is used by automated systems (like Fiddle) to get org-scoped tokens.
|
|
80
|
+
* If a GitHub owner is provided and is in the protected GitHub orgs mapping,
|
|
81
|
+
* the organization ID must match the allowed org for that GitHub owner.
|
|
82
|
+
* The returned token is identical to tokens from getJwt and can be used the same way.
|
|
83
|
+
*
|
|
84
|
+
* @param {FernVenusApi.GetAutopilotTokenRequest} request
|
|
85
|
+
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* await client.auth.getAutopilotToken({
|
|
89
|
+
* organizationId: "my-org-id"
|
|
90
|
+
* })
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* await client.auth.getAutopilotToken({
|
|
94
|
+
* organizationId: "wrong-org",
|
|
95
|
+
* githubOwner: "protected-github-owner"
|
|
96
|
+
* })
|
|
97
|
+
*/
|
|
98
|
+
getAutopilotToken(request, requestOptions) {
|
|
99
|
+
return core.HttpResponsePromise.fromPromise(this.__getAutopilotToken(request, requestOptions));
|
|
100
|
+
}
|
|
101
|
+
__getAutopilotToken(request, requestOptions) {
|
|
102
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
103
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
104
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
105
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
106
|
+
const _response = yield core.fetcher({
|
|
107
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FernVenusApiEnvironment.Prod, "/auth/autopilot-token"),
|
|
108
|
+
method: "POST",
|
|
109
|
+
headers: _headers,
|
|
110
|
+
contentType: "application/json",
|
|
111
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
112
|
+
requestType: "json",
|
|
113
|
+
body: serializers.GetAutopilotTokenRequest.jsonOrThrow(request, {
|
|
114
|
+
unrecognizedObjectKeys: "strip",
|
|
115
|
+
omitUndefined: true,
|
|
116
|
+
}),
|
|
117
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
118
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
119
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
120
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
121
|
+
logging: this._options.logging,
|
|
122
|
+
});
|
|
123
|
+
if (_response.ok) {
|
|
124
|
+
return {
|
|
125
|
+
data: {
|
|
126
|
+
ok: true,
|
|
127
|
+
body: serializers.JwtResponse.parseOrThrow(_response.body, {
|
|
128
|
+
unrecognizedObjectKeys: "passthrough",
|
|
129
|
+
allowUnrecognizedUnionMembers: true,
|
|
130
|
+
allowUnrecognizedEnumValues: true,
|
|
131
|
+
skipValidation: true,
|
|
132
|
+
breadcrumbsPrefix: ["response"],
|
|
133
|
+
}),
|
|
134
|
+
headers: _response.headers,
|
|
135
|
+
rawResponse: _response.rawResponse,
|
|
136
|
+
},
|
|
137
|
+
rawResponse: _response.rawResponse,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
if (_response.error.reason === "status-code") {
|
|
141
|
+
switch ((_k = _response.error.body) === null || _k === void 0 ? void 0 : _k.error) {
|
|
142
|
+
case "UnauthorizedError":
|
|
143
|
+
return {
|
|
144
|
+
data: {
|
|
145
|
+
ok: false,
|
|
146
|
+
error: serializers.auth.getAutopilotToken.Error.parseOrThrow(_response.error.body, {
|
|
147
|
+
unrecognizedObjectKeys: "passthrough",
|
|
148
|
+
allowUnrecognizedUnionMembers: true,
|
|
149
|
+
allowUnrecognizedEnumValues: true,
|
|
150
|
+
skipValidation: true,
|
|
151
|
+
breadcrumbsPrefix: ["response"],
|
|
152
|
+
}),
|
|
153
|
+
rawResponse: _response.rawResponse,
|
|
154
|
+
},
|
|
155
|
+
rawResponse: _response.rawResponse,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return {
|
|
160
|
+
data: {
|
|
161
|
+
ok: false,
|
|
162
|
+
error: FernVenusApi.auth.getAutopilotToken.Error._unknown(_response.error),
|
|
163
|
+
rawResponse: _response.rawResponse,
|
|
164
|
+
},
|
|
165
|
+
rawResponse: _response.rawResponse,
|
|
166
|
+
};
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Exchange a user token for a short-lived JWT scoped to an organization.
|
|
171
|
+
* The user must be a member of the specified organization.
|
|
172
|
+
* The JWT can be used to authenticate requests to other services.
|
|
173
|
+
*
|
|
174
|
+
* @param {FernVenusApi.GetJwtRequest} request
|
|
175
|
+
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
176
|
+
*
|
|
177
|
+
* @example
|
|
178
|
+
* await client.auth.getJwt({
|
|
179
|
+
* organizationId: "my-org-id"
|
|
180
|
+
* })
|
|
181
|
+
*
|
|
182
|
+
* @example
|
|
183
|
+
* await client.auth.getJwt({
|
|
184
|
+
* organizationId: "org-user-not-member-of"
|
|
185
|
+
* })
|
|
186
|
+
*/
|
|
187
|
+
getJwt(request, requestOptions) {
|
|
188
|
+
return core.HttpResponsePromise.fromPromise(this.__getJwt(request, requestOptions));
|
|
189
|
+
}
|
|
190
|
+
__getJwt(request, requestOptions) {
|
|
191
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
192
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
193
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
194
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
195
|
+
const _response = yield core.fetcher({
|
|
196
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FernVenusApiEnvironment.Prod, "/auth/jwt"),
|
|
197
|
+
method: "POST",
|
|
198
|
+
headers: _headers,
|
|
199
|
+
contentType: "application/json",
|
|
200
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
201
|
+
requestType: "json",
|
|
202
|
+
body: serializers.GetJwtRequest.jsonOrThrow(request, {
|
|
203
|
+
unrecognizedObjectKeys: "strip",
|
|
204
|
+
omitUndefined: true,
|
|
205
|
+
}),
|
|
206
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
207
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
208
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
209
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
210
|
+
logging: this._options.logging,
|
|
211
|
+
});
|
|
212
|
+
if (_response.ok) {
|
|
213
|
+
return {
|
|
214
|
+
data: {
|
|
215
|
+
ok: true,
|
|
216
|
+
body: serializers.JwtResponse.parseOrThrow(_response.body, {
|
|
217
|
+
unrecognizedObjectKeys: "passthrough",
|
|
218
|
+
allowUnrecognizedUnionMembers: true,
|
|
219
|
+
allowUnrecognizedEnumValues: true,
|
|
220
|
+
skipValidation: true,
|
|
221
|
+
breadcrumbsPrefix: ["response"],
|
|
222
|
+
}),
|
|
223
|
+
headers: _response.headers,
|
|
224
|
+
rawResponse: _response.rawResponse,
|
|
225
|
+
},
|
|
226
|
+
rawResponse: _response.rawResponse,
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
if (_response.error.reason === "status-code") {
|
|
230
|
+
switch ((_k = _response.error.body) === null || _k === void 0 ? void 0 : _k.error) {
|
|
231
|
+
case "UnauthorizedError":
|
|
232
|
+
return {
|
|
233
|
+
data: {
|
|
234
|
+
ok: false,
|
|
235
|
+
error: serializers.auth.getJwt.Error.parseOrThrow(_response.error.body, {
|
|
236
|
+
unrecognizedObjectKeys: "passthrough",
|
|
237
|
+
allowUnrecognizedUnionMembers: true,
|
|
238
|
+
allowUnrecognizedEnumValues: true,
|
|
239
|
+
skipValidation: true,
|
|
240
|
+
breadcrumbsPrefix: ["response"],
|
|
241
|
+
}),
|
|
242
|
+
rawResponse: _response.rawResponse,
|
|
243
|
+
},
|
|
244
|
+
rawResponse: _response.rawResponse,
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return {
|
|
249
|
+
data: {
|
|
250
|
+
ok: false,
|
|
251
|
+
error: FernVenusApi.auth.getJwt.Error._unknown(_response.error),
|
|
252
|
+
rawResponse: _response.rawResponse,
|
|
253
|
+
},
|
|
254
|
+
rawResponse: _response.rawResponse,
|
|
255
|
+
};
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type * as core from "../../../../core/index.mjs";
|
|
2
|
+
import * as FernVenusApi from "../../../index.mjs";
|
|
3
|
+
export type Error = FernVenusApi.auth.getAutopilotToken.Error.UnauthorizedError | FernVenusApi.auth.getAutopilotToken.Error._Unknown;
|
|
4
|
+
export declare namespace Error {
|
|
5
|
+
interface UnauthorizedError extends _Utils {
|
|
6
|
+
error: "UnauthorizedError";
|
|
7
|
+
}
|
|
8
|
+
interface _Unknown extends _Utils {
|
|
9
|
+
error: void;
|
|
10
|
+
content: core.Fetcher.Error;
|
|
11
|
+
}
|
|
12
|
+
interface _Utils {
|
|
13
|
+
_visit: <_Result>(visitor: FernVenusApi.auth.getAutopilotToken.Error._Visitor<_Result>) => _Result;
|
|
14
|
+
}
|
|
15
|
+
interface _Visitor<_Result> {
|
|
16
|
+
unauthorizedError: () => _Result;
|
|
17
|
+
_other: (value: core.Fetcher.Error) => _Result;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export declare const Error: {
|
|
21
|
+
readonly unauthorizedError: () => FernVenusApi.auth.getAutopilotToken.Error.UnauthorizedError;
|
|
22
|
+
readonly _unknown: (fetcherError: core.Fetcher.Error) => FernVenusApi.auth.getAutopilotToken.Error._Unknown;
|
|
23
|
+
readonly _visit: <_Result>(value: FernVenusApi.auth.getAutopilotToken.Error, visitor: FernVenusApi.auth.getAutopilotToken.Error._Visitor<_Result>) => _Result;
|
|
24
|
+
};
|