From c83f8e763c829d1322c72ba6ba41b5b43cc5a45d Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Fri, 16 Jan 2026 17:37:30 +0000 Subject: [PATCH 1/2] feat: Update to @seamapi/types@1.710.0 --- package-lock.json | 8 +- package.json | 2 +- .../connect/routes/seam-http-endpoints.ts | 28 +++ .../connector-customers.ts | 214 ++++++++++++++++++ .../customer/v1/connector-customers/index.ts | 6 + .../connect/routes/seam/customer/v1/index.ts | 1 + .../connect/routes/seam/customer/v1/v1.ts | 8 + 7 files changed, 262 insertions(+), 5 deletions(-) create mode 100644 src/lib/seam/connect/routes/seam/customer/v1/connector-customers/connector-customers.ts create mode 100644 src/lib/seam/connect/routes/seam/customer/v1/connector-customers/index.ts diff --git a/package-lock.json b/package-lock.json index 19f98f98..3e1a4891 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "@seamapi/blueprint": "^0.52.2", "@seamapi/fake-seam-connect": "^1.77.0", "@seamapi/smith": "^0.5.2", - "@seamapi/types": "1.709.0", + "@seamapi/types": "1.710.0", "@swc/core": "^1.11.29", "@types/jsonwebtoken": "^9.0.6", "@types/node": "^22.15.21", @@ -1388,9 +1388,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.709.0", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.709.0.tgz", - "integrity": "sha512-t+TeNgvYcOl4IqV2EmQVP8CFQI3XbnPF3u+fC1ZmNMP6S2HWBCLw8EfxPJmnFhdF7rJI7D+zStLmqk1lB0R3fg==", + "version": "1.710.0", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.710.0.tgz", + "integrity": "sha512-sZU0h/PzE55v1ybC26H7OZobzCQHaU8ZMmIF4h85LbIPJJznuqGIT6/mBn+pUtQgiamMSGusW6hrBb1LIU47Pg==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index d96aaed1..fd32eefd 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,7 @@ "@seamapi/blueprint": "^0.52.2", "@seamapi/fake-seam-connect": "^1.77.0", "@seamapi/smith": "^0.5.2", - "@seamapi/types": "1.709.0", + "@seamapi/types": "1.710.0", "@swc/core": "^1.11.29", "@types/jsonwebtoken": "^9.0.6", "@types/node": "^22.15.21", diff --git a/src/lib/seam/connect/routes/seam-http-endpoints.ts b/src/lib/seam/connect/routes/seam-http-endpoints.ts index 1d915fc4..1a0530ff 100644 --- a/src/lib/seam/connect/routes/seam-http-endpoints.ts +++ b/src/lib/seam/connect/routes/seam-http-endpoints.ts @@ -617,6 +617,12 @@ import { type SeamCustomerV1AutomationsUpdateRequest, SeamHttpSeamCustomerV1Automations, } from './seam/customer/v1/automations/index.js' +import { + type SeamCustomerV1ConnectorCustomersListOptions, + type SeamCustomerV1ConnectorCustomersListParameters, + type SeamCustomerV1ConnectorCustomersListRequest, + SeamHttpSeamCustomerV1ConnectorCustomers, +} from './seam/customer/v1/connector-customers/index.js' import { type SeamCustomerV1ConnectorsAuthorizeOptions, type SeamCustomerV1ConnectorsAuthorizeParameters, @@ -3229,6 +3235,27 @@ export class SeamHttpEndpoints { } } + get '/seam/customer/v1/connector_customers/list'(): ( + parameters?: SeamCustomerV1ConnectorCustomersListParameters, + options?: SeamCustomerV1ConnectorCustomersListOptions, + ) => SeamCustomerV1ConnectorCustomersListRequest { + const { client, defaults } = this + if (!this.defaults.isUndocumentedApiEnabled) { + throw new Error( + 'Cannot use undocumented API without isUndocumentedApiEnabled', + ) + } + return function seamCustomerV1ConnectorCustomersList( + ...args: Parameters + ): ReturnType { + const seam = SeamHttpSeamCustomerV1ConnectorCustomers.fromClient( + client, + defaults, + ) + return seam.list(...args) + } + } + get '/seam/customer/v1/connectors/authorize'(): ( parameters?: SeamCustomerV1ConnectorsAuthorizeParameters, options?: SeamCustomerV1ConnectorsAuthorizeOptions, @@ -4807,6 +4834,7 @@ export type SeamHttpEndpointQueryPaths = | '/seam/customer/v1/access_grants/list' | '/seam/customer/v1/automation_runs/list' | '/seam/customer/v1/automations/get' + | '/seam/customer/v1/connector_customers/list' | '/seam/customer/v1/connectors/authorize' | '/seam/customer/v1/connectors/connector_types' | '/seam/customer/v1/connectors/list' diff --git a/src/lib/seam/connect/routes/seam/customer/v1/connector-customers/connector-customers.ts b/src/lib/seam/connect/routes/seam/customer/v1/connector-customers/connector-customers.ts new file mode 100644 index 00000000..45080c70 --- /dev/null +++ b/src/lib/seam/connect/routes/seam/customer/v1/connector-customers/connector-customers.ts @@ -0,0 +1,214 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect' + +import { seamApiLtsVersion } from 'lib/lts-version.js' +import { + getAuthHeadersForClientSessionToken, + warnOnInsecureuserIdentifierKey, +} from 'lib/seam/connect/auth.js' +import { type Client, createClient } from 'lib/seam/connect/client.js' +import { + isSeamHttpOptionsWithApiKey, + isSeamHttpOptionsWithClient, + isSeamHttpOptionsWithClientSessionToken, + isSeamHttpOptionsWithConsoleSessionToken, + isSeamHttpOptionsWithPersonalAccessToken, + type SeamHttpFromPublishableKeyOptions, + SeamHttpInvalidOptionsError, + type SeamHttpOptions, + type SeamHttpOptionsWithApiKey, + type SeamHttpOptionsWithClient, + type SeamHttpOptionsWithClientSessionToken, + type SeamHttpOptionsWithConsoleSessionToken, + type SeamHttpOptionsWithPersonalAccessToken, + type SeamHttpRequestOptions, +} from 'lib/seam/connect/options.js' +import { + limitToSeamHttpRequestOptions, + parseOptions, +} from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' +import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' +import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' +import type { SetNonNullable } from 'lib/types.js' + +export class SeamHttpSeamCustomerV1ConnectorCustomers { + client: Client + readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion + + constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { + const options = parseOptions(apiKeyOrOptions) + if (!options.isUndocumentedApiEnabled) { + throw new Error( + 'Cannot use undocumented API without isUndocumentedApiEnabled', + ) + } + this.client = 'client' in options ? options.client : createClient(options) + this.defaults = limitToSeamHttpRequestOptions(options) + } + + static fromClient( + client: SeamHttpOptionsWithClient['client'], + options: Omit = {}, + ): SeamHttpSeamCustomerV1ConnectorCustomers { + const constructorOptions = { ...options, client } + if (!isSeamHttpOptionsWithClient(constructorOptions)) { + throw new SeamHttpInvalidOptionsError('Missing client') + } + return new SeamHttpSeamCustomerV1ConnectorCustomers(constructorOptions) + } + + static fromApiKey( + apiKey: SeamHttpOptionsWithApiKey['apiKey'], + options: Omit = {}, + ): SeamHttpSeamCustomerV1ConnectorCustomers { + const constructorOptions = { ...options, apiKey } + if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { + throw new SeamHttpInvalidOptionsError('Missing apiKey') + } + return new SeamHttpSeamCustomerV1ConnectorCustomers(constructorOptions) + } + + static fromClientSessionToken( + clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], + options: Omit< + SeamHttpOptionsWithClientSessionToken, + 'clientSessionToken' + > = {}, + ): SeamHttpSeamCustomerV1ConnectorCustomers { + const constructorOptions = { ...options, clientSessionToken } + if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { + throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') + } + return new SeamHttpSeamCustomerV1ConnectorCustomers(constructorOptions) + } + + static async fromPublishableKey( + publishableKey: string, + userIdentifierKey: string, + options: SeamHttpFromPublishableKeyOptions = {}, + ): Promise { + warnOnInsecureuserIdentifierKey(userIdentifierKey) + const clientOptions = parseOptions({ ...options, publishableKey }) + if (isSeamHttpOptionsWithClient(clientOptions)) { + throw new SeamHttpInvalidOptionsError( + 'The client option cannot be used with SeamHttpSeamCustomerV1ConnectorCustomers.fromPublishableKey', + ) + } + const client = createClient(clientOptions) + const clientSessions = SeamHttpClientSessions.fromClient(client) + const { token } = await clientSessions.getOrCreate({ + user_identifier_key: userIdentifierKey, + }) + return SeamHttpSeamCustomerV1ConnectorCustomers.fromClientSessionToken( + token, + options, + ) + } + + static fromConsoleSessionToken( + consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], + workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], + options: Omit< + SeamHttpOptionsWithConsoleSessionToken, + 'consoleSessionToken' | 'workspaceId' + > = {}, + ): SeamHttpSeamCustomerV1ConnectorCustomers { + const constructorOptions = { ...options, consoleSessionToken, workspaceId } + if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { + throw new SeamHttpInvalidOptionsError( + 'Missing consoleSessionToken or workspaceId', + ) + } + return new SeamHttpSeamCustomerV1ConnectorCustomers(constructorOptions) + } + + static fromPersonalAccessToken( + personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], + workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], + options: Omit< + SeamHttpOptionsWithPersonalAccessToken, + 'personalAccessToken' | 'workspaceId' + > = {}, + ): SeamHttpSeamCustomerV1ConnectorCustomers { + const constructorOptions = { ...options, personalAccessToken, workspaceId } + if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { + throw new SeamHttpInvalidOptionsError( + 'Missing personalAccessToken or workspaceId', + ) + } + return new SeamHttpSeamCustomerV1ConnectorCustomers(constructorOptions) + } + + createPaginator( + request: SeamHttpRequest, + ): SeamPaginator { + return new SeamPaginator(this, request) + } + + async updateClientSessionToken( + clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], + ): Promise { + const { headers } = this.client.defaults + const authHeaders = getAuthHeadersForClientSessionToken({ + clientSessionToken, + }) + for (const key of Object.keys(authHeaders)) { + if (headers[key] == null) { + throw new Error( + 'Cannot update a clientSessionToken on a client created without a clientSessionToken', + ) + } + } + this.client.defaults.headers = { ...headers, ...authHeaders } + const clientSessions = SeamHttpClientSessions.fromClient(this.client) + await clientSessions.get() + } + + list( + parameters?: SeamCustomerV1ConnectorCustomersListParameters, + options: SeamCustomerV1ConnectorCustomersListOptions = {}, + ): SeamCustomerV1ConnectorCustomersListRequest { + if (!this.defaults.isUndocumentedApiEnabled) { + throw new Error( + 'Cannot use undocumented API without isUndocumentedApiEnabled', + ) + } + return new SeamHttpRequest(this, { + pathname: '/seam/customer/v1/connector_customers/list', + method: 'POST', + body: parameters, + responseKey: 'connector_customers', + options, + }) + } +} + +export type SeamCustomerV1ConnectorCustomersListParameters = + RouteRequestBody<'/seam/customer/v1/connector_customers/list'> + +/** + * @deprecated Use SeamCustomerV1ConnectorCustomersListParameters instead. + */ +export type SeamCustomerV1ConnectorCustomersListParams = + SeamCustomerV1ConnectorCustomersListParameters + +/** + * @deprecated Use SeamCustomerV1ConnectorCustomersListRequest instead. + */ +export type SeamCustomerV1ConnectorCustomersListResponse = SetNonNullable< + Required> +> + +export type SeamCustomerV1ConnectorCustomersListRequest = SeamHttpRequest< + SeamCustomerV1ConnectorCustomersListResponse, + 'connector_customers' +> + +export interface SeamCustomerV1ConnectorCustomersListOptions {} diff --git a/src/lib/seam/connect/routes/seam/customer/v1/connector-customers/index.ts b/src/lib/seam/connect/routes/seam/customer/v1/connector-customers/index.ts new file mode 100644 index 00000000..2ad2130e --- /dev/null +++ b/src/lib/seam/connect/routes/seam/customer/v1/connector-customers/index.ts @@ -0,0 +1,6 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './connector-customers.js' diff --git a/src/lib/seam/connect/routes/seam/customer/v1/index.ts b/src/lib/seam/connect/routes/seam/customer/v1/index.ts index 3dd32946..95888d8b 100644 --- a/src/lib/seam/connect/routes/seam/customer/v1/index.ts +++ b/src/lib/seam/connect/routes/seam/customer/v1/index.ts @@ -6,6 +6,7 @@ export * from './access-grants/index.js' export * from './automation-runs/index.js' export * from './automations/index.js' +export * from './connector-customers/index.js' export * from './connectors/index.js' export * from './customers/index.js' export * from './events/index.js' diff --git a/src/lib/seam/connect/routes/seam/customer/v1/v1.ts b/src/lib/seam/connect/routes/seam/customer/v1/v1.ts index d43fe837..7421a890 100644 --- a/src/lib/seam/connect/routes/seam/customer/v1/v1.ts +++ b/src/lib/seam/connect/routes/seam/customer/v1/v1.ts @@ -36,6 +36,7 @@ import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import { SeamHttpSeamCustomerV1AccessGrants } from './access-grants/index.js' import { SeamHttpSeamCustomerV1AutomationRuns } from './automation-runs/index.js' import { SeamHttpSeamCustomerV1Automations } from './automations/index.js' +import { SeamHttpSeamCustomerV1ConnectorCustomers } from './connector-customers/index.js' import { SeamHttpSeamCustomerV1Connectors } from './connectors/index.js' import { SeamHttpSeamCustomerV1Customers } from './customers/index.js' import { SeamHttpSeamCustomerV1Events } from './events/index.js' @@ -198,6 +199,13 @@ export class SeamHttpSeamCustomerV1 { ) } + get connectorCustomers(): SeamHttpSeamCustomerV1ConnectorCustomers { + return SeamHttpSeamCustomerV1ConnectorCustomers.fromClient( + this.client, + this.defaults, + ) + } + get connectors(): SeamHttpSeamCustomerV1Connectors { return SeamHttpSeamCustomerV1Connectors.fromClient( this.client, From 1709f1685d3bffe5841b7377f7044181f9649fef Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Fri, 16 Jan 2026 17:38:15 +0000 Subject: [PATCH 2/2] ci: Generate code --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3e1a4891..dc6e5fd2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -49,7 +49,7 @@ "npm": ">=10.1.0" }, "peerDependencies": { - "@seamapi/types": "^1.709.0" + "@seamapi/types": "^1.710.0" }, "peerDependenciesMeta": { "@seamapi/types": { diff --git a/package.json b/package.json index fd32eefd..b4d27e93 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "npm": ">=10.1.0" }, "peerDependencies": { - "@seamapi/types": "^1.709.0" + "@seamapi/types": "^1.710.0" }, "peerDependenciesMeta": { "@seamapi/types": {