From f237877cdaad4171c0d568a7b95914678fafc73c Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Wed, 8 Oct 2025 20:14:24 +0000 Subject: [PATCH 1/2] feat: Update to @seamapi/types@1.606.0 --- package-lock.json | 8 +- package.json | 2 +- .../connect/routes/seam-http-endpoints.ts | 29 +++ .../connect/routes/seam/customer/v1/index.ts | 1 + .../seam/customer/v1/staff-members/index.ts | 6 + .../v1/staff-members/staff-members.ts | 214 ++++++++++++++++++ .../connect/routes/seam/customer/v1/v1.ts | 8 + 7 files changed, 263 insertions(+), 5 deletions(-) create mode 100644 src/lib/seam/connect/routes/seam/customer/v1/staff-members/index.ts create mode 100644 src/lib/seam/connect/routes/seam/customer/v1/staff-members/staff-members.ts diff --git a/package-lock.json b/package-lock.json index aa5cf561..ede83527 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.605.0", + "@seamapi/types": "1.606.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.605.0", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.605.0.tgz", - "integrity": "sha512-zHYVoSa51EbGYsZ1TJbMjqX2yOn/xAkOzkbIhosy+bvblg9Qx5QZvmFI9ohhGSlR3y7q/3kwLxcg0lXl32nhdw==", + "version": "1.606.0", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.606.0.tgz", + "integrity": "sha512-7u/N9aoEMGBfEssuDgalzLuj7dlDji19nWDwjKohtJnJ94waRNxede3AjH1Zhfc524pJoB+blwsFQg5UOEDSRA==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index cf18607e..a902f937 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.605.0", + "@seamapi/types": "1.606.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 11f32f50..0d62a0fe 100644 --- a/src/lib/seam/connect/routes/seam-http-endpoints.ts +++ b/src/lib/seam/connect/routes/seam-http-endpoints.ts @@ -647,6 +647,12 @@ import { type SeamCustomerV1SpacesListRequest, SeamHttpSeamCustomerV1Spaces, } from './seam/customer/v1/spaces/index.js' +import { + type SeamCustomerV1StaffMembersListOptions, + type SeamCustomerV1StaffMembersListParameters, + type SeamCustomerV1StaffMembersListRequest, + SeamHttpSeamCustomerV1StaffMembers, +} from './seam/customer/v1/staff-members/index.js' import { type SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdOptions, type SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdParameters, @@ -3278,6 +3284,27 @@ export class SeamHttpEndpoints { } } + get '/seam/customer/v1/staff_members/list'(): ( + parameters?: SeamCustomerV1StaffMembersListParameters, + options?: SeamCustomerV1StaffMembersListOptions, + ) => SeamCustomerV1StaffMembersListRequest { + const { client, defaults } = this + if (!this.defaults.isUndocumentedApiEnabled) { + throw new Error( + 'Cannot use undocumented API without isUndocumentedApiEnabled', + ) + } + return function seamCustomerV1StaffMembersList( + ...args: Parameters + ): ReturnType { + const seam = SeamHttpSeamCustomerV1StaffMembers.fromClient( + client, + defaults, + ) + return seam.list(...args) + } + } + get '/seam/customer/v1/webhooks/connectors/[workspace_id]/[connector_id]'(): ( parameters?: SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdParameters, options?: SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdOptions, @@ -4497,6 +4524,7 @@ export type SeamHttpEndpointQueryPaths = | '/seam/customer/v1/reservations/list' | '/seam/customer/v1/settings/get' | '/seam/customer/v1/spaces/list' + | '/seam/customer/v1/staff_members/list' | '/seam/partner/v1/building_blocks/spaces/auto_map' | '/spaces/get' | '/spaces/get_related' @@ -4537,6 +4565,7 @@ export type SeamHttpEndpointPaginatedQueryPaths = | '/seam/console/v1/timelines/get' | '/seam/customer/v1/automation_runs/list' | '/seam/customer/v1/reservations/list' + | '/seam/customer/v1/staff_members/list' | '/user_identities/list' | '/user_identities/unmanaged/list' 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 146c5b93..3892f9f4 100644 --- a/src/lib/seam/connect/routes/seam/customer/v1/index.ts +++ b/src/lib/seam/connect/routes/seam/customer/v1/index.ts @@ -11,5 +11,6 @@ export * from './portals/index.js' export * from './reservations/index.js' export * from './settings/index.js' export * from './spaces/index.js' +export * from './staff-members/index.js' export * from './v1.js' export * from './webhooks/index.js' diff --git a/src/lib/seam/connect/routes/seam/customer/v1/staff-members/index.ts b/src/lib/seam/connect/routes/seam/customer/v1/staff-members/index.ts new file mode 100644 index 00000000..152bf865 --- /dev/null +++ b/src/lib/seam/connect/routes/seam/customer/v1/staff-members/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 './staff-members.js' diff --git a/src/lib/seam/connect/routes/seam/customer/v1/staff-members/staff-members.ts b/src/lib/seam/connect/routes/seam/customer/v1/staff-members/staff-members.ts new file mode 100644 index 00000000..d32e013b --- /dev/null +++ b/src/lib/seam/connect/routes/seam/customer/v1/staff-members/staff-members.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 SeamHttpSeamCustomerV1StaffMembers { + 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 = {}, + ): SeamHttpSeamCustomerV1StaffMembers { + const constructorOptions = { ...options, client } + if (!isSeamHttpOptionsWithClient(constructorOptions)) { + throw new SeamHttpInvalidOptionsError('Missing client') + } + return new SeamHttpSeamCustomerV1StaffMembers(constructorOptions) + } + + static fromApiKey( + apiKey: SeamHttpOptionsWithApiKey['apiKey'], + options: Omit = {}, + ): SeamHttpSeamCustomerV1StaffMembers { + const constructorOptions = { ...options, apiKey } + if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { + throw new SeamHttpInvalidOptionsError('Missing apiKey') + } + return new SeamHttpSeamCustomerV1StaffMembers(constructorOptions) + } + + static fromClientSessionToken( + clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], + options: Omit< + SeamHttpOptionsWithClientSessionToken, + 'clientSessionToken' + > = {}, + ): SeamHttpSeamCustomerV1StaffMembers { + const constructorOptions = { ...options, clientSessionToken } + if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { + throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') + } + return new SeamHttpSeamCustomerV1StaffMembers(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 SeamHttpSeamCustomerV1StaffMembers.fromPublishableKey', + ) + } + const client = createClient(clientOptions) + const clientSessions = SeamHttpClientSessions.fromClient(client) + const { token } = await clientSessions.getOrCreate({ + user_identifier_key: userIdentifierKey, + }) + return SeamHttpSeamCustomerV1StaffMembers.fromClientSessionToken( + token, + options, + ) + } + + static fromConsoleSessionToken( + consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], + workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], + options: Omit< + SeamHttpOptionsWithConsoleSessionToken, + 'consoleSessionToken' | 'workspaceId' + > = {}, + ): SeamHttpSeamCustomerV1StaffMembers { + const constructorOptions = { ...options, consoleSessionToken, workspaceId } + if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { + throw new SeamHttpInvalidOptionsError( + 'Missing consoleSessionToken or workspaceId', + ) + } + return new SeamHttpSeamCustomerV1StaffMembers(constructorOptions) + } + + static fromPersonalAccessToken( + personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], + workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], + options: Omit< + SeamHttpOptionsWithPersonalAccessToken, + 'personalAccessToken' | 'workspaceId' + > = {}, + ): SeamHttpSeamCustomerV1StaffMembers { + const constructorOptions = { ...options, personalAccessToken, workspaceId } + if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { + throw new SeamHttpInvalidOptionsError( + 'Missing personalAccessToken or workspaceId', + ) + } + return new SeamHttpSeamCustomerV1StaffMembers(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?: SeamCustomerV1StaffMembersListParameters, + options: SeamCustomerV1StaffMembersListOptions = {}, + ): SeamCustomerV1StaffMembersListRequest { + if (!this.defaults.isUndocumentedApiEnabled) { + throw new Error( + 'Cannot use undocumented API without isUndocumentedApiEnabled', + ) + } + return new SeamHttpRequest(this, { + pathname: '/seam/customer/v1/staff_members/list', + method: 'POST', + body: parameters, + responseKey: 'staff_members', + options, + }) + } +} + +export type SeamCustomerV1StaffMembersListParameters = + RouteRequestBody<'/seam/customer/v1/staff_members/list'> + +/** + * @deprecated Use SeamCustomerV1StaffMembersListParameters instead. + */ +export type SeamCustomerV1StaffMembersListParams = + SeamCustomerV1StaffMembersListParameters + +/** + * @deprecated Use SeamCustomerV1StaffMembersListRequest instead. + */ +export type SeamCustomerV1StaffMembersListResponse = SetNonNullable< + Required> +> + +export type SeamCustomerV1StaffMembersListRequest = SeamHttpRequest< + SeamCustomerV1StaffMembersListResponse, + 'staff_members' +> + +export interface SeamCustomerV1StaffMembersListOptions {} 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 9e3a832e..7eee0453 100644 --- a/src/lib/seam/connect/routes/seam/customer/v1/v1.ts +++ b/src/lib/seam/connect/routes/seam/customer/v1/v1.ts @@ -41,6 +41,7 @@ import { SeamHttpSeamCustomerV1Portals } from './portals/index.js' import { SeamHttpSeamCustomerV1Reservations } from './reservations/index.js' import { SeamHttpSeamCustomerV1Settings } from './settings/index.js' import { SeamHttpSeamCustomerV1Spaces } from './spaces/index.js' +import { SeamHttpSeamCustomerV1StaffMembers } from './staff-members/index.js' export class SeamHttpSeamCustomerV1 { client: Client @@ -212,4 +213,11 @@ export class SeamHttpSeamCustomerV1 { get spaces(): SeamHttpSeamCustomerV1Spaces { return SeamHttpSeamCustomerV1Spaces.fromClient(this.client, this.defaults) } + + get staffMembers(): SeamHttpSeamCustomerV1StaffMembers { + return SeamHttpSeamCustomerV1StaffMembers.fromClient( + this.client, + this.defaults, + ) + } } From 803f75ac34b6cb2cd4f979d119407ff742400a2b Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Wed, 8 Oct 2025 20:16:36 +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 ede83527..278b8f23 100644 --- a/package-lock.json +++ b/package-lock.json @@ -49,7 +49,7 @@ "npm": ">=10.1.0" }, "peerDependencies": { - "@seamapi/types": "^1.605.0" + "@seamapi/types": "^1.606.0" }, "peerDependenciesMeta": { "@seamapi/types": { diff --git a/package.json b/package.json index a902f937..1d5051fe 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "npm": ">=10.1.0" }, "peerDependencies": { - "@seamapi/types": "^1.605.0" + "@seamapi/types": "^1.606.0" }, "peerDependenciesMeta": { "@seamapi/types": {