From a89c32717f5e44f4c8609c3ef942c4f3e3dcf53d Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Thu, 2 Oct 2025 19:59:40 +0000 Subject: [PATCH 1/2] feat: Update to @seamapi/types@1.600.0 --- package-lock.json | 8 +- package.json | 2 +- .../connect/routes/seam-http-endpoints.ts | 65 +++++ .../seam/customer/v1/connectors/connectors.ts | 240 ++++++++++++++++++ .../seam/customer/v1/connectors/index.ts | 6 + .../connect/routes/seam/customer/v1/index.ts | 2 + .../connect/routes/seam/customer/v1/v1.ts | 8 + .../customer/v1/webhooks/connectors/index.ts | 6 + .../webhooks/connectors/workspace-id/index.ts | 6 + .../connectors/workspace-id/workspace-id.ts | 216 ++++++++++++++++ .../routes/seam/customer/v1/webhooks/index.ts | 6 + 11 files changed, 560 insertions(+), 5 deletions(-) create mode 100644 src/lib/seam/connect/routes/seam/customer/v1/connectors/connectors.ts create mode 100644 src/lib/seam/connect/routes/seam/customer/v1/connectors/index.ts create mode 100644 src/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/index.ts create mode 100644 src/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/index.ts create mode 100644 src/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/workspace-id.ts create mode 100644 src/lib/seam/connect/routes/seam/customer/v1/webhooks/index.ts diff --git a/package-lock.json b/package-lock.json index ceb6b53a..2dd2ec29 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "@seamapi/blueprint": "^0.51.1", "@seamapi/fake-seam-connect": "^1.77.0", "@seamapi/smith": "^0.5.2", - "@seamapi/types": "1.595.0", + "@seamapi/types": "1.600.0", "@swc/core": "^1.11.29", "@types/jsonwebtoken": "^9.0.6", "@types/node": "^22.15.21", @@ -1371,9 +1371,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.595.0", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.595.0.tgz", - "integrity": "sha512-A4+4kV0H09iIq8sQOXnxTrVOeyhaVZlWL+tLLauEA5K6ldSu81s3/i8WRw1PYxWDeoX1uvDurnbNGlAll3FSEQ==", + "version": "1.600.0", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.600.0.tgz", + "integrity": "sha512-nysW3rzjk0CH9/1dX9wVXFEwm2m2wSp6YJzn9X9uPm6pTI9ccT01H6Tp7oBPrap7PIShrE9m43LGFbKyjBd/6w==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index cd68b0f8..72971f1e 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,7 @@ "@seamapi/blueprint": "^0.51.1", "@seamapi/fake-seam-connect": "^1.77.0", "@seamapi/smith": "^0.5.2", - "@seamapi/types": "1.595.0", + "@seamapi/types": "1.600.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 6c40c453..7249e7a3 100644 --- a/src/lib/seam/connect/routes/seam-http-endpoints.ts +++ b/src/lib/seam/connect/routes/seam-http-endpoints.ts @@ -596,6 +596,15 @@ import { type SeamCustomerV1AutomationsUpdateRequest, SeamHttpSeamCustomerV1Automations, } from './seam/customer/v1/automations/index.js' +import { + type SeamCustomerV1ConnectorsCreateOptions, + type SeamCustomerV1ConnectorsCreateParameters, + type SeamCustomerV1ConnectorsCreateRequest, + type SeamCustomerV1ConnectorsSyncOptions, + type SeamCustomerV1ConnectorsSyncParameters, + type SeamCustomerV1ConnectorsSyncRequest, + SeamHttpSeamCustomerV1Connectors, +} from './seam/customer/v1/connectors/index.js' import { type SeamCustomerV1EventsListOptions, type SeamCustomerV1EventsListParameters, @@ -635,6 +644,12 @@ import { type SeamCustomerV1SpacesListRequest, SeamHttpSeamCustomerV1Spaces, } from './seam/customer/v1/spaces/index.js' +import { + type SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdOptions, + type SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdParameters, + type SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdRequest, + SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId, +} from './seam/customer/v1/webhooks/connectors/workspace-id/index.js' import { SeamHttpSeamPartnerV1BuildingBlocksSpaces, type SeamPartnerV1BuildingBlocksSpacesAutoMapOptions, @@ -3081,6 +3096,32 @@ export class SeamHttpEndpoints { } } + get '/seam/customer/v1/connectors/create'(): ( + parameters?: SeamCustomerV1ConnectorsCreateParameters, + options?: SeamCustomerV1ConnectorsCreateOptions, + ) => SeamCustomerV1ConnectorsCreateRequest { + const { client, defaults } = this + return function seamCustomerV1ConnectorsCreate( + ...args: Parameters + ): ReturnType { + const seam = SeamHttpSeamCustomerV1Connectors.fromClient(client, defaults) + return seam.create(...args) + } + } + + get '/seam/customer/v1/connectors/sync'(): ( + parameters?: SeamCustomerV1ConnectorsSyncParameters, + options?: SeamCustomerV1ConnectorsSyncOptions, + ) => SeamCustomerV1ConnectorsSyncRequest { + const { client, defaults } = this + return function seamCustomerV1ConnectorsSync( + ...args: Parameters + ): ReturnType { + const seam = SeamHttpSeamCustomerV1Connectors.fromClient(client, defaults) + return seam.sync(...args) + } + } + get '/seam/customer/v1/events/list'(): ( parameters?: SeamCustomerV1EventsListParameters, options?: SeamCustomerV1EventsListOptions, @@ -3221,6 +3262,27 @@ export class SeamHttpEndpoints { } } + get '/seam/customer/v1/webhooks/connectors/[workspace_id]/[connector_id]'(): ( + parameters?: SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdParameters, + options?: SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdOptions, + ) => SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdRequest { + const { client, defaults } = this + return function seamCustomerV1WebhooksConnectorsWorkspaceIdConnectorId( + ...args: Parameters< + SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId['connectorId'] + > + ): ReturnType< + SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId['connectorId'] + > { + const seam = + SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId.fromClient( + client, + defaults, + ) + return seam.connectorId(...args) + } + } + get '/seam/partner/v1/building_blocks/spaces/auto_map'(): ( parameters?: SeamPartnerV1BuildingBlocksSpacesAutoMapParameters, options?: SeamPartnerV1BuildingBlocksSpacesAutoMapOptions, @@ -4538,8 +4600,11 @@ export type SeamHttpEndpointMutationPaths = | '/phones/simulate/create_sandbox_phone' | '/seam/customer/v1/automations/delete' | '/seam/customer/v1/automations/update' + | '/seam/customer/v1/connectors/create' + | '/seam/customer/v1/connectors/sync' | '/seam/customer/v1/settings/update' | '/seam/customer/v1/spaces/create' + | '/seam/customer/v1/webhooks/connectors/[workspace_id]/[connector_id]' | '/spaces/add_acs_entrances' | '/spaces/add_devices' | '/spaces/create' diff --git a/src/lib/seam/connect/routes/seam/customer/v1/connectors/connectors.ts b/src/lib/seam/connect/routes/seam/customer/v1/connectors/connectors.ts new file mode 100644 index 00000000..863bb5a3 --- /dev/null +++ b/src/lib/seam/connect/routes/seam/customer/v1/connectors/connectors.ts @@ -0,0 +1,240 @@ +/* + * 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 SeamHttpSeamCustomerV1Connectors { + client: Client + readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion + + constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { + const options = parseOptions(apiKeyOrOptions) + this.client = 'client' in options ? options.client : createClient(options) + this.defaults = limitToSeamHttpRequestOptions(options) + } + + static fromClient( + client: SeamHttpOptionsWithClient['client'], + options: Omit = {}, + ): SeamHttpSeamCustomerV1Connectors { + const constructorOptions = { ...options, client } + if (!isSeamHttpOptionsWithClient(constructorOptions)) { + throw new SeamHttpInvalidOptionsError('Missing client') + } + return new SeamHttpSeamCustomerV1Connectors(constructorOptions) + } + + static fromApiKey( + apiKey: SeamHttpOptionsWithApiKey['apiKey'], + options: Omit = {}, + ): SeamHttpSeamCustomerV1Connectors { + const constructorOptions = { ...options, apiKey } + if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { + throw new SeamHttpInvalidOptionsError('Missing apiKey') + } + return new SeamHttpSeamCustomerV1Connectors(constructorOptions) + } + + static fromClientSessionToken( + clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], + options: Omit< + SeamHttpOptionsWithClientSessionToken, + 'clientSessionToken' + > = {}, + ): SeamHttpSeamCustomerV1Connectors { + const constructorOptions = { ...options, clientSessionToken } + if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { + throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') + } + return new SeamHttpSeamCustomerV1Connectors(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 SeamHttpSeamCustomerV1Connectors.fromPublishableKey', + ) + } + const client = createClient(clientOptions) + const clientSessions = SeamHttpClientSessions.fromClient(client) + const { token } = await clientSessions.getOrCreate({ + user_identifier_key: userIdentifierKey, + }) + return SeamHttpSeamCustomerV1Connectors.fromClientSessionToken( + token, + options, + ) + } + + static fromConsoleSessionToken( + consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], + workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], + options: Omit< + SeamHttpOptionsWithConsoleSessionToken, + 'consoleSessionToken' | 'workspaceId' + > = {}, + ): SeamHttpSeamCustomerV1Connectors { + const constructorOptions = { ...options, consoleSessionToken, workspaceId } + if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { + throw new SeamHttpInvalidOptionsError( + 'Missing consoleSessionToken or workspaceId', + ) + } + return new SeamHttpSeamCustomerV1Connectors(constructorOptions) + } + + static fromPersonalAccessToken( + personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], + workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], + options: Omit< + SeamHttpOptionsWithPersonalAccessToken, + 'personalAccessToken' | 'workspaceId' + > = {}, + ): SeamHttpSeamCustomerV1Connectors { + const constructorOptions = { ...options, personalAccessToken, workspaceId } + if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { + throw new SeamHttpInvalidOptionsError( + 'Missing personalAccessToken or workspaceId', + ) + } + return new SeamHttpSeamCustomerV1Connectors(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() + } + + create( + parameters?: SeamCustomerV1ConnectorsCreateParameters, + options: SeamCustomerV1ConnectorsCreateOptions = {}, + ): SeamCustomerV1ConnectorsCreateRequest { + return new SeamHttpRequest(this, { + pathname: '/seam/customer/v1/connectors/create', + method: 'POST', + body: parameters, + responseKey: 'connector', + options, + }) + } + + sync( + parameters?: SeamCustomerV1ConnectorsSyncParameters, + options: SeamCustomerV1ConnectorsSyncOptions = {}, + ): SeamCustomerV1ConnectorsSyncRequest { + return new SeamHttpRequest(this, { + pathname: '/seam/customer/v1/connectors/sync', + method: 'POST', + body: parameters, + responseKey: 'connector_sync', + options, + }) + } +} + +export type SeamCustomerV1ConnectorsCreateParameters = + RouteRequestBody<'/seam/customer/v1/connectors/create'> + +/** + * @deprecated Use SeamCustomerV1ConnectorsCreateParameters instead. + */ +export type SeamCustomerV1ConnectorsCreateBody = + SeamCustomerV1ConnectorsCreateParameters + +/** + * @deprecated Use SeamCustomerV1ConnectorsCreateRequest instead. + */ +export type SeamCustomerV1ConnectorsCreateResponse = SetNonNullable< + Required> +> + +export type SeamCustomerV1ConnectorsCreateRequest = SeamHttpRequest< + SeamCustomerV1ConnectorsCreateResponse, + 'connector' +> + +export interface SeamCustomerV1ConnectorsCreateOptions {} + +export type SeamCustomerV1ConnectorsSyncParameters = + RouteRequestBody<'/seam/customer/v1/connectors/sync'> + +/** + * @deprecated Use SeamCustomerV1ConnectorsSyncParameters instead. + */ +export type SeamCustomerV1ConnectorsSyncBody = + SeamCustomerV1ConnectorsSyncParameters + +/** + * @deprecated Use SeamCustomerV1ConnectorsSyncRequest instead. + */ +export type SeamCustomerV1ConnectorsSyncResponse = SetNonNullable< + Required> +> + +export type SeamCustomerV1ConnectorsSyncRequest = SeamHttpRequest< + SeamCustomerV1ConnectorsSyncResponse, + 'connector_sync' +> + +export interface SeamCustomerV1ConnectorsSyncOptions {} diff --git a/src/lib/seam/connect/routes/seam/customer/v1/connectors/index.ts b/src/lib/seam/connect/routes/seam/customer/v1/connectors/index.ts new file mode 100644 index 00000000..9ed7924e --- /dev/null +++ b/src/lib/seam/connect/routes/seam/customer/v1/connectors/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 './connectors.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 4bc4f3bf..146c5b93 100644 --- a/src/lib/seam/connect/routes/seam/customer/v1/index.ts +++ b/src/lib/seam/connect/routes/seam/customer/v1/index.ts @@ -5,9 +5,11 @@ export * from './automation-runs/index.js' export * from './automations/index.js' +export * from './connectors/index.js' export * from './events/index.js' export * from './portals/index.js' export * from './reservations/index.js' export * from './settings/index.js' export * from './spaces/index.js' export * from './v1.js' +export * from './webhooks/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 5da95044..9e3a832e 100644 --- a/src/lib/seam/connect/routes/seam/customer/v1/v1.ts +++ b/src/lib/seam/connect/routes/seam/customer/v1/v1.ts @@ -35,6 +35,7 @@ import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import { SeamHttpSeamCustomerV1AutomationRuns } from './automation-runs/index.js' import { SeamHttpSeamCustomerV1Automations } from './automations/index.js' +import { SeamHttpSeamCustomerV1Connectors } from './connectors/index.js' import { SeamHttpSeamCustomerV1Events } from './events/index.js' import { SeamHttpSeamCustomerV1Portals } from './portals/index.js' import { SeamHttpSeamCustomerV1Reservations } from './reservations/index.js' @@ -182,6 +183,13 @@ export class SeamHttpSeamCustomerV1 { ) } + get connectors(): SeamHttpSeamCustomerV1Connectors { + return SeamHttpSeamCustomerV1Connectors.fromClient( + this.client, + this.defaults, + ) + } + get events(): SeamHttpSeamCustomerV1Events { return SeamHttpSeamCustomerV1Events.fromClient(this.client, this.defaults) } diff --git a/src/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/index.ts b/src/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/index.ts new file mode 100644 index 00000000..66a55bee --- /dev/null +++ b/src/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/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 './workspace-id/index.js' diff --git a/src/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/index.ts b/src/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/index.ts new file mode 100644 index 00000000..5c921df2 --- /dev/null +++ b/src/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/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 './workspace-id.js' diff --git a/src/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/workspace-id.ts b/src/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/workspace-id.ts new file mode 100644 index 00000000..2ee44abc --- /dev/null +++ b/src/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/workspace-id.ts @@ -0,0 +1,216 @@ +/* + * 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 SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId { + client: Client + readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion + + constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { + const options = parseOptions(apiKeyOrOptions) + this.client = 'client' in options ? options.client : createClient(options) + this.defaults = limitToSeamHttpRequestOptions(options) + } + + static fromClient( + client: SeamHttpOptionsWithClient['client'], + options: Omit = {}, + ): SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId { + const constructorOptions = { ...options, client } + if (!isSeamHttpOptionsWithClient(constructorOptions)) { + throw new SeamHttpInvalidOptionsError('Missing client') + } + return new SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId( + constructorOptions, + ) + } + + static fromApiKey( + apiKey: SeamHttpOptionsWithApiKey['apiKey'], + options: Omit = {}, + ): SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId { + const constructorOptions = { ...options, apiKey } + if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { + throw new SeamHttpInvalidOptionsError('Missing apiKey') + } + return new SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId( + constructorOptions, + ) + } + + static fromClientSessionToken( + clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], + options: Omit< + SeamHttpOptionsWithClientSessionToken, + 'clientSessionToken' + > = {}, + ): SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId { + const constructorOptions = { ...options, clientSessionToken } + if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { + throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') + } + return new SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId( + 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 SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId.fromPublishableKey', + ) + } + const client = createClient(clientOptions) + const clientSessions = SeamHttpClientSessions.fromClient(client) + const { token } = await clientSessions.getOrCreate({ + user_identifier_key: userIdentifierKey, + }) + return SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId.fromClientSessionToken( + token, + options, + ) + } + + static fromConsoleSessionToken( + consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], + workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], + options: Omit< + SeamHttpOptionsWithConsoleSessionToken, + 'consoleSessionToken' | 'workspaceId' + > = {}, + ): SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId { + const constructorOptions = { ...options, consoleSessionToken, workspaceId } + if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { + throw new SeamHttpInvalidOptionsError( + 'Missing consoleSessionToken or workspaceId', + ) + } + return new SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId( + constructorOptions, + ) + } + + static fromPersonalAccessToken( + personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], + workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], + options: Omit< + SeamHttpOptionsWithPersonalAccessToken, + 'personalAccessToken' | 'workspaceId' + > = {}, + ): SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId { + const constructorOptions = { ...options, personalAccessToken, workspaceId } + if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { + throw new SeamHttpInvalidOptionsError( + 'Missing personalAccessToken or workspaceId', + ) + } + return new SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId( + 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() + } + + connectorId( + parameters?: SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdParameters, + options: SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdOptions = {}, + ): SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdRequest { + return new SeamHttpRequest(this, { + pathname: + '/seam/customer/v1/webhooks/connectors/[workspace_id]/[connector_id]', + method: 'POST', + body: parameters, + responseKey: undefined, + options, + }) + } +} + +export type SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdParameters = + RouteRequestBody<'/seam/customer/v1/webhooks/connectors/[workspace_id]/[connector_id]'> + +/** + * @deprecated Use SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdParameters instead. + */ +export type SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdBody = + SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdParameters + +/** + * @deprecated Use SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdRequest instead. + */ +export type SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdResponse = + SetNonNullable< + Required< + RouteResponse<'/seam/customer/v1/webhooks/connectors/[workspace_id]/[connector_id]'> + > + > + +export type SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdRequest = + SeamHttpRequest + +export interface SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdOptions {} diff --git a/src/lib/seam/connect/routes/seam/customer/v1/webhooks/index.ts b/src/lib/seam/connect/routes/seam/customer/v1/webhooks/index.ts new file mode 100644 index 00000000..8163fa81 --- /dev/null +++ b/src/lib/seam/connect/routes/seam/customer/v1/webhooks/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 './connectors/index.js' From 80708961f6b2c3b869ba661e1b2e17fbf2f8c9e6 Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Thu, 2 Oct 2025 20:02:28 +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 2dd2ec29..28222019 100644 --- a/package-lock.json +++ b/package-lock.json @@ -49,7 +49,7 @@ "npm": ">=10.1.0" }, "peerDependencies": { - "@seamapi/types": "^1.595.0" + "@seamapi/types": "^1.600.0" }, "peerDependenciesMeta": { "@seamapi/types": { diff --git a/package.json b/package.json index 72971f1e..d86ae2b4 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "npm": ">=10.1.0" }, "peerDependencies": { - "@seamapi/types": "^1.595.0" + "@seamapi/types": "^1.600.0" }, "peerDependenciesMeta": { "@seamapi/types": {