From fb328fbaba414e6fe04cc7ee35fe2ce109be2eb4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Jun 2025 06:34:06 +0000 Subject: [PATCH 1/3] feat(deps-dev): bump @seamapi/types in the seam group Bumps the seam group with 1 update: [@seamapi/types](https://github.com/seamapi/types). Updates `@seamapi/types` from 1.420.2 to 1.423.2 - [Release notes](https://github.com/seamapi/types/releases) - [Changelog](https://github.com/seamapi/types/blob/main/.releaserc.json) - [Commits](https://github.com/seamapi/types/compare/v1.420.2...v1.423.2) --- updated-dependencies: - dependency-name: "@seamapi/types" dependency-version: 1.423.2 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: seam ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index e786b0a2..c97d0447 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "@seamapi/blueprint": "^0.50.1", "@seamapi/fake-seam-connect": "^1.77.0", "@seamapi/smith": "^0.4.4", - "@seamapi/types": "1.420.2", + "@seamapi/types": "1.423.2", "@swc/core": "^1.11.29", "@types/eslint": "^8.44.2", "@types/jsonwebtoken": "^9.0.6", @@ -1207,9 +1207,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.420.2", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.420.2.tgz", - "integrity": "sha512-3W6YwDWIUsfwvEzzF6HuDNryqSqtywoGvi+zfLf9Js/wh88A3DKXYOmwamGWLus2L6vTp28F4aipcu5uNQndow==", + "version": "1.423.2", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.423.2.tgz", + "integrity": "sha512-EfMNHNE0k3Mp+AgjEDzzmnjsvOf7yrt9qG5ZZkjVqaTGsOAYTRjrRMLFz37s8My+evXn8i0Ry4wijhoXKhFviw==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index ae2801a3..826dd445 100644 --- a/package.json +++ b/package.json @@ -101,7 +101,7 @@ "@seamapi/blueprint": "^0.50.1", "@seamapi/fake-seam-connect": "^1.77.0", "@seamapi/smith": "^0.4.4", - "@seamapi/types": "1.420.2", + "@seamapi/types": "1.423.2", "@swc/core": "^1.11.29", "@types/eslint": "^8.44.2", "@types/jsonwebtoken": "^9.0.6", From 1fb43d134aabd8e357cc3c8b02510cc2b7395d31 Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Tue, 24 Jun 2025 06:35:01 +0000 Subject: [PATCH 2/3] ci: Generate code --- package-lock.json | 2 +- package.json | 2 +- .../connect/routes/customers/customers.ts | 202 ++++++++++++++++++ .../seam/connect/routes/customers/index.ts | 6 + .../routes/devices/simulate/simulate.ts | 8 +- src/lib/seam/connect/routes/index.ts | 1 + .../routes/phones/simulate/simulate.ts | 6 +- src/lib/seam/connect/routes/seam-http.ts | 5 + 8 files changed, 222 insertions(+), 10 deletions(-) create mode 100644 src/lib/seam/connect/routes/customers/customers.ts create mode 100644 src/lib/seam/connect/routes/customers/index.ts diff --git a/package-lock.json b/package-lock.json index c97d0447..9d1f7752 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,7 +50,7 @@ "npm": ">=10.1.0" }, "peerDependencies": { - "@seamapi/types": "^1.420.2" + "@seamapi/types": "^1.423.2" }, "peerDependenciesMeta": { "@seamapi/types": { diff --git a/package.json b/package.json index 826dd445..7e8f87cd 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ "npm": ">=10.1.0" }, "peerDependencies": { - "@seamapi/types": "^1.420.2" + "@seamapi/types": "^1.423.2" }, "peerDependenciesMeta": { "@seamapi/types": { diff --git a/src/lib/seam/connect/routes/customers/customers.ts b/src/lib/seam/connect/routes/customers/customers.ts new file mode 100644 index 00000000..e56458ff --- /dev/null +++ b/src/lib/seam/connect/routes/customers/customers.ts @@ -0,0 +1,202 @@ +/* + * 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 SeamHttpCustomers { + 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 = {}, + ): SeamHttpCustomers { + const constructorOptions = { ...options, client } + if (!isSeamHttpOptionsWithClient(constructorOptions)) { + throw new SeamHttpInvalidOptionsError('Missing client') + } + return new SeamHttpCustomers(constructorOptions) + } + + static fromApiKey( + apiKey: SeamHttpOptionsWithApiKey['apiKey'], + options: Omit = {}, + ): SeamHttpCustomers { + const constructorOptions = { ...options, apiKey } + if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { + throw new SeamHttpInvalidOptionsError('Missing apiKey') + } + return new SeamHttpCustomers(constructorOptions) + } + + static fromClientSessionToken( + clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], + options: Omit< + SeamHttpOptionsWithClientSessionToken, + 'clientSessionToken' + > = {}, + ): SeamHttpCustomers { + const constructorOptions = { ...options, clientSessionToken } + if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { + throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') + } + return new SeamHttpCustomers(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 SeamHttpCustomers.fromPublishableKey', + ) + } + const client = createClient(clientOptions) + const clientSessions = SeamHttpClientSessions.fromClient(client) + const { token } = await clientSessions.getOrCreate({ + user_identifier_key: userIdentifierKey, + }) + return SeamHttpCustomers.fromClientSessionToken(token, options) + } + + static fromConsoleSessionToken( + consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], + workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], + options: Omit< + SeamHttpOptionsWithConsoleSessionToken, + 'consoleSessionToken' | 'workspaceId' + > = {}, + ): SeamHttpCustomers { + const constructorOptions = { ...options, consoleSessionToken, workspaceId } + if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { + throw new SeamHttpInvalidOptionsError( + 'Missing consoleSessionToken or workspaceId', + ) + } + return new SeamHttpCustomers(constructorOptions) + } + + static fromPersonalAccessToken( + personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], + workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], + options: Omit< + SeamHttpOptionsWithPersonalAccessToken, + 'personalAccessToken' | 'workspaceId' + > = {}, + ): SeamHttpCustomers { + const constructorOptions = { ...options, personalAccessToken, workspaceId } + if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { + throw new SeamHttpInvalidOptionsError( + 'Missing personalAccessToken or workspaceId', + ) + } + return new SeamHttpCustomers(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() + } + + createPortal( + body?: CustomersCreatePortalBody, + ): SeamHttpRequest { + return new SeamHttpRequest(this, { + pathname: '/customers/create_portal', + method: 'POST', + body, + responseKey: 'magic_link', + }) + } + + pushData(body?: CustomersPushDataBody): SeamHttpRequest { + return new SeamHttpRequest(this, { + pathname: '/customers/push_data', + method: 'POST', + body, + responseKey: undefined, + }) + } +} + +export type CustomersCreatePortalBody = + RouteRequestBody<'/customers/create_portal'> + +export type CustomersCreatePortalResponse = SetNonNullable< + Required> +> + +export type CustomersCreatePortalOptions = never + +export type CustomersPushDataBody = RouteRequestBody<'/customers/push_data'> + +export type CustomersPushDataResponse = SetNonNullable< + Required> +> + +export type CustomersPushDataOptions = never diff --git a/src/lib/seam/connect/routes/customers/index.ts b/src/lib/seam/connect/routes/customers/index.ts new file mode 100644 index 00000000..9126f05d --- /dev/null +++ b/src/lib/seam/connect/routes/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 './customers.js' diff --git a/src/lib/seam/connect/routes/devices/simulate/simulate.ts b/src/lib/seam/connect/routes/devices/simulate/simulate.ts index 2824ac77..49a4e063 100644 --- a/src/lib/seam/connect/routes/devices/simulate/simulate.ts +++ b/src/lib/seam/connect/routes/devices/simulate/simulate.ts @@ -183,13 +183,11 @@ export class SeamHttpDevicesSimulate { }) } - remove( - params?: DevicesSimulateRemoveParams, - ): SeamHttpRequest { + remove(body?: DevicesSimulateRemoveBody): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/devices/simulate/remove', method: 'POST', - body: params, + body, responseKey: undefined, }) } @@ -213,7 +211,7 @@ export type DevicesSimulateDisconnectResponse = SetNonNullable< export type DevicesSimulateDisconnectOptions = never -export type DevicesSimulateRemoveParams = +export type DevicesSimulateRemoveBody = RouteRequestBody<'/devices/simulate/remove'> export type DevicesSimulateRemoveResponse = SetNonNullable< diff --git a/src/lib/seam/connect/routes/index.ts b/src/lib/seam/connect/routes/index.ts index 2a33b3e8..8e576336 100644 --- a/src/lib/seam/connect/routes/index.ts +++ b/src/lib/seam/connect/routes/index.ts @@ -11,6 +11,7 @@ export * from './action-attempts/index.js' export * from './client-sessions/index.js' export * from './connect-webviews/index.js' export * from './connected-accounts/index.js' +export * from './customers/index.js' export * from './devices/index.js' export * from './events/index.js' export * from './locks/index.js' diff --git a/src/lib/seam/connect/routes/phones/simulate/simulate.ts b/src/lib/seam/connect/routes/phones/simulate/simulate.ts index 1b114c53..2e6c4b3d 100644 --- a/src/lib/seam/connect/routes/phones/simulate/simulate.ts +++ b/src/lib/seam/connect/routes/phones/simulate/simulate.ts @@ -164,18 +164,18 @@ export class SeamHttpPhonesSimulate { } createSandboxPhone( - params?: PhonesSimulateCreateSandboxPhoneParams, + body?: PhonesSimulateCreateSandboxPhoneBody, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/phones/simulate/create_sandbox_phone', method: 'POST', - body: params, + body, responseKey: 'phone', }) } } -export type PhonesSimulateCreateSandboxPhoneParams = +export type PhonesSimulateCreateSandboxPhoneBody = RouteRequestBody<'/phones/simulate/create_sandbox_phone'> export type PhonesSimulateCreateSandboxPhoneResponse = SetNonNullable< diff --git a/src/lib/seam/connect/routes/seam-http.ts b/src/lib/seam/connect/routes/seam-http.ts index b303ff61..40aeefee 100644 --- a/src/lib/seam/connect/routes/seam-http.ts +++ b/src/lib/seam/connect/routes/seam-http.ts @@ -40,6 +40,7 @@ import { SeamHttpActionAttempts } from './action-attempts/index.js' import { SeamHttpClientSessions } from './client-sessions/index.js' import { SeamHttpConnectWebviews } from './connect-webviews/index.js' import { SeamHttpConnectedAccounts } from './connected-accounts/index.js' +import { SeamHttpCustomers } from './customers/index.js' import { SeamHttpDevices } from './devices/index.js' import { SeamHttpEvents } from './events/index.js' import { SeamHttpLocks } from './locks/index.js' @@ -210,6 +211,10 @@ export class SeamHttp { return SeamHttpConnectedAccounts.fromClient(this.client, this.defaults) } + get customers(): SeamHttpCustomers { + return SeamHttpCustomers.fromClient(this.client, this.defaults) + } + get devices(): SeamHttpDevices { return SeamHttpDevices.fromClient(this.client, this.defaults) } From 0a25d1346408e42f4128ea30dc1bf3d5e023aaa5 Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Wed, 2 Jul 2025 02:24:16 +0000 Subject: [PATCH 3/3] ci: Generate code --- .../connect/routes/customers/customers.ts | 50 +++++-- .../routes/devices/simulate/simulate.ts | 2 +- .../routes/phones/simulate/simulate.ts | 2 +- .../connect/routes/seam-http-endpoints.ts | 139 +++++++++++------- .../v1/resources => customer}/index.ts | 2 +- .../connect/routes/seam/customer/v1/index.ts | 8 + .../customer/v1/portals}/index.ts | 2 +- .../v1/portals/portals.ts} | 63 ++++---- .../routes/seam/customer/v1/settings/index.ts | 6 + .../customer/v1/settings/settings.ts} | 63 ++++---- .../seam/{partner => customer}/v1/v1.ts | 43 +++--- src/lib/seam/connect/routes/seam/index.ts | 1 + .../connect/routes/seam/partner/v1/index.ts | 2 - .../connect/routes/unstable-partner/index.ts | 1 - .../unstable-partner/unstable-partner.ts | 8 - 15 files changed, 229 insertions(+), 163 deletions(-) rename src/lib/seam/connect/routes/seam/{partner/v1/resources => customer}/index.ts (79%) create mode 100644 src/lib/seam/connect/routes/seam/customer/v1/index.ts rename src/lib/seam/connect/routes/{unstable-partner/resources => seam/customer/v1/portals}/index.ts (79%) rename src/lib/seam/connect/routes/seam/{partner/v1/resources/resources.ts => customer/v1/portals/portals.ts} (78%) create mode 100644 src/lib/seam/connect/routes/seam/customer/v1/settings/index.ts rename src/lib/seam/connect/routes/{unstable-partner/resources/resources.ts => seam/customer/v1/settings/settings.ts} (78%) rename src/lib/seam/connect/routes/seam/{partner => customer}/v1/v1.ts (83%) diff --git a/src/lib/seam/connect/routes/customers/customers.ts b/src/lib/seam/connect/routes/customers/customers.ts index e56458ff..a4f44723 100644 --- a/src/lib/seam/connect/routes/customers/customers.ts +++ b/src/lib/seam/connect/routes/customers/customers.ts @@ -164,39 +164,71 @@ export class SeamHttpCustomers { } createPortal( - body?: CustomersCreatePortalBody, - ): SeamHttpRequest { + parameters?: CustomersCreatePortalParameters, + options: CustomersCreatePortalOptions = {}, + ): CustomersCreatePortalRequest { return new SeamHttpRequest(this, { pathname: '/customers/create_portal', method: 'POST', - body, + body: parameters, responseKey: 'magic_link', + options, }) } - pushData(body?: CustomersPushDataBody): SeamHttpRequest { + pushData( + parameters?: CustomersPushDataParameters, + options: CustomersPushDataOptions = {}, + ): CustomersPushDataRequest { return new SeamHttpRequest(this, { pathname: '/customers/push_data', method: 'POST', - body, + body: parameters, responseKey: undefined, + options, }) } } -export type CustomersCreatePortalBody = +export type CustomersCreatePortalParameters = RouteRequestBody<'/customers/create_portal'> +/** + * @deprecated Use CustomersCreatePortalParameters instead. + */ +export type CustomersCreatePortalBody = CustomersCreatePortalParameters + +/** + * @deprecated Use CustomersCreatePortalRequest instead. + */ export type CustomersCreatePortalResponse = SetNonNullable< Required> > -export type CustomersCreatePortalOptions = never +export type CustomersCreatePortalRequest = SeamHttpRequest< + CustomersCreatePortalResponse, + 'magic_link' +> + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface CustomersCreatePortalOptions {} -export type CustomersPushDataBody = RouteRequestBody<'/customers/push_data'> +export type CustomersPushDataParameters = + RouteRequestBody<'/customers/push_data'> +/** + * @deprecated Use CustomersPushDataParameters instead. + */ +export type CustomersPushDataBody = CustomersPushDataParameters + +/** + * @deprecated Use CustomersPushDataRequest instead. + */ export type CustomersPushDataResponse = SetNonNullable< Required> > -export type CustomersPushDataOptions = never +export type CustomersPushDataRequest = SeamHttpRequest + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface CustomersPushDataOptions {} diff --git a/src/lib/seam/connect/routes/devices/simulate/simulate.ts b/src/lib/seam/connect/routes/devices/simulate/simulate.ts index 55c8edd5..c5bbb6f3 100644 --- a/src/lib/seam/connect/routes/devices/simulate/simulate.ts +++ b/src/lib/seam/connect/routes/devices/simulate/simulate.ts @@ -249,7 +249,7 @@ export type DevicesSimulateRemoveParameters = /** * @deprecated Use DevicesSimulateRemoveParameters instead. */ -export type DevicesSimulateRemoveParams = DevicesSimulateRemoveParameters +export type DevicesSimulateRemoveBody = DevicesSimulateRemoveParameters /** * @deprecated Use DevicesSimulateRemoveRequest instead. diff --git a/src/lib/seam/connect/routes/phones/simulate/simulate.ts b/src/lib/seam/connect/routes/phones/simulate/simulate.ts index d72aff69..b588084a 100644 --- a/src/lib/seam/connect/routes/phones/simulate/simulate.ts +++ b/src/lib/seam/connect/routes/phones/simulate/simulate.ts @@ -183,7 +183,7 @@ export type PhonesSimulateCreateSandboxPhoneParameters = /** * @deprecated Use PhonesSimulateCreateSandboxPhoneParameters instead. */ -export type PhonesSimulateCreateSandboxPhoneParams = +export type PhonesSimulateCreateSandboxPhoneBody = PhonesSimulateCreateSandboxPhoneParameters /** diff --git a/src/lib/seam/connect/routes/seam-http-endpoints.ts b/src/lib/seam/connect/routes/seam-http-endpoints.ts index 08fd122b..0482b268 100644 --- a/src/lib/seam/connect/routes/seam-http-endpoints.ts +++ b/src/lib/seam/connect/routes/seam-http-endpoints.ts @@ -380,6 +380,15 @@ import { type ConnectedAccountsUpdateRequest, SeamHttpConnectedAccounts, } from './connected-accounts/index.js' +import { + type CustomersCreatePortalOptions, + type CustomersCreatePortalParameters, + type CustomersCreatePortalRequest, + type CustomersPushDataOptions, + type CustomersPushDataParameters, + type CustomersPushDataRequest, + SeamHttpCustomers, +} from './customers/index.js' import { type DevicesDeleteOptions, type DevicesDeleteParameters, @@ -512,18 +521,24 @@ import { type PhonesSimulateCreateSandboxPhoneRequest, SeamHttpPhonesSimulate, } from './phones/simulate/index.js' +import { + type SeamCustomerV1PortalsGetOptions, + type SeamCustomerV1PortalsGetParameters, + type SeamCustomerV1PortalsGetRequest, + SeamHttpSeamCustomerV1Portals, +} from './seam/customer/v1/portals/index.js' +import { + type SeamCustomerV1SettingsUpdateOptions, + type SeamCustomerV1SettingsUpdateParameters, + type SeamCustomerV1SettingsUpdateRequest, + SeamHttpSeamCustomerV1Settings, +} from './seam/customer/v1/settings/index.js' import { SeamHttpSeamPartnerV1BuildingBlocksSpaces, type SeamPartnerV1BuildingBlocksSpacesAutoMapOptions, type SeamPartnerV1BuildingBlocksSpacesAutoMapParameters, type SeamPartnerV1BuildingBlocksSpacesAutoMapRequest, } from './seam/partner/v1/building-blocks/spaces/index.js' -import { - SeamHttpSeamPartnerV1Resources, - type SeamPartnerV1ResourcesListOptions, - type SeamPartnerV1ResourcesListParameters, - type SeamPartnerV1ResourcesListRequest, -} from './seam/partner/v1/resources/index.js' import { SeamHttpSpaces, type SpacesAddAcsEntrancesOptions, @@ -713,12 +728,6 @@ import { type UnstablePartnerBuildingBlocksOrganizeSpacesParameters, type UnstablePartnerBuildingBlocksOrganizeSpacesRequest, } from './unstable-partner/building-blocks/index.js' -import { - SeamHttpUnstablePartnerResources, - type UnstablePartnerResourcesPushOptions, - type UnstablePartnerResourcesPushParameters, - type UnstablePartnerResourcesPushRequest, -} from './unstable-partner/resources/index.js' import { SeamHttpUserIdentitiesEnrollmentAutomations, type UserIdentitiesEnrollmentAutomationsDeleteOptions, @@ -2240,6 +2249,32 @@ export class SeamHttpEndpoints { } } + get ['/customers/create_portal'](): ( + parameters?: CustomersCreatePortalParameters, + options?: CustomersCreatePortalOptions, + ) => CustomersCreatePortalRequest { + const { client, defaults } = this + return function customersCreatePortal( + ...args: Parameters + ): ReturnType { + const seam = SeamHttpCustomers.fromClient(client, defaults) + return seam.createPortal(...args) + } + } + + get ['/customers/push_data'](): ( + parameters?: CustomersPushDataParameters, + options?: CustomersPushDataOptions, + ) => CustomersPushDataRequest { + const { client, defaults } = this + return function customersPushData( + ...args: Parameters + ): ReturnType { + const seam = SeamHttpCustomers.fromClient(client, defaults) + return seam.pushData(...args) + } + } + get ['/devices/delete'](): ( parameters?: DevicesDeleteParameters, options?: DevicesDeleteOptions, @@ -2696,6 +2731,42 @@ export class SeamHttpEndpoints { } } + get ['/seam/customer/v1/portals/get'](): ( + parameters?: SeamCustomerV1PortalsGetParameters, + options?: SeamCustomerV1PortalsGetOptions, + ) => SeamCustomerV1PortalsGetRequest { + const { client, defaults } = this + if (!this.defaults.isUndocumentedApiEnabled) { + throw new Error( + 'Cannot use undocumented API without isUndocumentedApiEnabled', + ) + } + return function seamCustomerV1PortalsGet( + ...args: Parameters + ): ReturnType { + const seam = SeamHttpSeamCustomerV1Portals.fromClient(client, defaults) + return seam.get(...args) + } + } + + get ['/seam/customer/v1/settings/update'](): ( + parameters?: SeamCustomerV1SettingsUpdateParameters, + options?: SeamCustomerV1SettingsUpdateOptions, + ) => SeamCustomerV1SettingsUpdateRequest { + const { client, defaults } = this + if (!this.defaults.isUndocumentedApiEnabled) { + throw new Error( + 'Cannot use undocumented API without isUndocumentedApiEnabled', + ) + } + return function seamCustomerV1SettingsUpdate( + ...args: Parameters + ): ReturnType { + const seam = SeamHttpSeamCustomerV1Settings.fromClient(client, defaults) + return seam.update(...args) + } + } + get ['/seam/partner/v1/building_blocks/spaces/auto_map'](): ( parameters?: SeamPartnerV1BuildingBlocksSpacesAutoMapParameters, options?: SeamPartnerV1BuildingBlocksSpacesAutoMapOptions, @@ -2717,24 +2788,6 @@ export class SeamHttpEndpoints { } } - get ['/seam/partner/v1/resources/list'](): ( - parameters?: SeamPartnerV1ResourcesListParameters, - options?: SeamPartnerV1ResourcesListOptions, - ) => SeamPartnerV1ResourcesListRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamPartnerV1ResourcesList( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamPartnerV1Resources.fromClient(client, defaults) - return seam.list(...args) - } - } - get ['/spaces/add_acs_entrances'](): ( parameters?: SpacesAddAcsEntrancesParameters, options?: SpacesAddAcsEntrancesOptions, @@ -3562,24 +3615,6 @@ export class SeamHttpEndpoints { } } - get ['/unstable_partner/resources/push'](): ( - parameters?: UnstablePartnerResourcesPushParameters, - options?: UnstablePartnerResourcesPushOptions, - ) => UnstablePartnerResourcesPushRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function unstablePartnerResourcesPush( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpUnstablePartnerResources.fromClient(client, defaults) - return seam.push(...args) - } - } - get ['/user_identities/add_acs_user'](): ( parameters?: UserIdentitiesAddAcsUserParameters, options?: UserIdentitiesAddAcsUserOptions, @@ -4007,9 +4042,8 @@ export type SeamHttpEndpointQueryPaths = | '/noise_sensors/noise_thresholds/list' | '/phones/get' | '/phones/list' - | '/phones/simulate/create_sandbox_phone' + | '/seam/customer/v1/portals/get' | '/seam/partner/v1/building_blocks/spaces/auto_map' - | '/seam/partner/v1/resources/list' | '/spaces/get' | '/spaces/list' | '/thermostats/get' @@ -4093,6 +4127,8 @@ export type SeamHttpEndpointMutationPaths = | '/connected_accounts/delete' | '/connected_accounts/sync' | '/connected_accounts/update' + | '/customers/create_portal' + | '/customers/push_data' | '/devices/delete' | '/devices/update' | '/devices/simulate/connect' @@ -4108,6 +4144,8 @@ export type SeamHttpEndpointMutationPaths = | '/noise_sensors/noise_thresholds/update' | '/noise_sensors/simulate/trigger_noise_threshold' | '/phones/deactivate' + | '/phones/simulate/create_sandbox_phone' + | '/seam/customer/v1/settings/update' | '/spaces/add_acs_entrances' | '/spaces/add_devices' | '/spaces/create' @@ -4147,7 +4185,6 @@ export type SeamHttpEndpointMutationPaths = | '/unstable_partner/building_blocks/connect_accounts' | '/unstable_partner/building_blocks/manage_devices' | '/unstable_partner/building_blocks/organize_spaces' - | '/unstable_partner/resources/push' | '/user_identities/add_acs_user' | '/user_identities/create' | '/user_identities/delete' diff --git a/src/lib/seam/connect/routes/seam/partner/v1/resources/index.ts b/src/lib/seam/connect/routes/seam/customer/index.ts similarity index 79% rename from src/lib/seam/connect/routes/seam/partner/v1/resources/index.ts rename to src/lib/seam/connect/routes/seam/customer/index.ts index 60e5e587..2e9499e7 100644 --- a/src/lib/seam/connect/routes/seam/partner/v1/resources/index.ts +++ b/src/lib/seam/connect/routes/seam/customer/index.ts @@ -3,4 +3,4 @@ * Do not edit this file or add other files to this directory. */ -export * from './resources.js' +export * from './v1/index.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 new file mode 100644 index 00000000..e19e87ec --- /dev/null +++ b/src/lib/seam/connect/routes/seam/customer/v1/index.ts @@ -0,0 +1,8 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './portals/index.js' +export * from './settings/index.js' +export * from './v1.js' diff --git a/src/lib/seam/connect/routes/unstable-partner/resources/index.ts b/src/lib/seam/connect/routes/seam/customer/v1/portals/index.ts similarity index 79% rename from src/lib/seam/connect/routes/unstable-partner/resources/index.ts rename to src/lib/seam/connect/routes/seam/customer/v1/portals/index.ts index 60e5e587..31aa3aa4 100644 --- a/src/lib/seam/connect/routes/unstable-partner/resources/index.ts +++ b/src/lib/seam/connect/routes/seam/customer/v1/portals/index.ts @@ -3,4 +3,4 @@ * Do not edit this file or add other files to this directory. */ -export * from './resources.js' +export * from './portals.js' diff --git a/src/lib/seam/connect/routes/seam/partner/v1/resources/resources.ts b/src/lib/seam/connect/routes/seam/customer/v1/portals/portals.ts similarity index 78% rename from src/lib/seam/connect/routes/seam/partner/v1/resources/resources.ts rename to src/lib/seam/connect/routes/seam/customer/v1/portals/portals.ts index f5b21a2c..870b2131 100644 --- a/src/lib/seam/connect/routes/seam/partner/v1/resources/resources.ts +++ b/src/lib/seam/connect/routes/seam/customer/v1/portals/portals.ts @@ -36,7 +36,7 @@ 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 SeamHttpSeamPartnerV1Resources { +export class SeamHttpSeamCustomerV1Portals { client: Client readonly defaults: Required readonly ltsVersion = seamApiLtsVersion @@ -56,23 +56,23 @@ export class SeamHttpSeamPartnerV1Resources { static fromClient( client: SeamHttpOptionsWithClient['client'], options: Omit = {}, - ): SeamHttpSeamPartnerV1Resources { + ): SeamHttpSeamCustomerV1Portals { const constructorOptions = { ...options, client } if (!isSeamHttpOptionsWithClient(constructorOptions)) { throw new SeamHttpInvalidOptionsError('Missing client') } - return new SeamHttpSeamPartnerV1Resources(constructorOptions) + return new SeamHttpSeamCustomerV1Portals(constructorOptions) } static fromApiKey( apiKey: SeamHttpOptionsWithApiKey['apiKey'], options: Omit = {}, - ): SeamHttpSeamPartnerV1Resources { + ): SeamHttpSeamCustomerV1Portals { const constructorOptions = { ...options, apiKey } if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { throw new SeamHttpInvalidOptionsError('Missing apiKey') } - return new SeamHttpSeamPartnerV1Resources(constructorOptions) + return new SeamHttpSeamCustomerV1Portals(constructorOptions) } static fromClientSessionToken( @@ -81,24 +81,24 @@ export class SeamHttpSeamPartnerV1Resources { SeamHttpOptionsWithClientSessionToken, 'clientSessionToken' > = {}, - ): SeamHttpSeamPartnerV1Resources { + ): SeamHttpSeamCustomerV1Portals { const constructorOptions = { ...options, clientSessionToken } if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') } - return new SeamHttpSeamPartnerV1Resources(constructorOptions) + return new SeamHttpSeamCustomerV1Portals(constructorOptions) } static async fromPublishableKey( publishableKey: string, userIdentifierKey: string, options: SeamHttpFromPublishableKeyOptions = {}, - ): Promise { + ): Promise { warnOnInsecureuserIdentifierKey(userIdentifierKey) const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttpSeamPartnerV1Resources.fromPublishableKey', + 'The client option cannot be used with SeamHttpSeamCustomerV1Portals.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -106,7 +106,7 @@ export class SeamHttpSeamPartnerV1Resources { const { token } = await clientSessions.getOrCreate({ user_identifier_key: userIdentifierKey, }) - return SeamHttpSeamPartnerV1Resources.fromClientSessionToken(token, options) + return SeamHttpSeamCustomerV1Portals.fromClientSessionToken(token, options) } static fromConsoleSessionToken( @@ -116,14 +116,14 @@ export class SeamHttpSeamPartnerV1Resources { SeamHttpOptionsWithConsoleSessionToken, 'consoleSessionToken' | 'workspaceId' > = {}, - ): SeamHttpSeamPartnerV1Resources { + ): SeamHttpSeamCustomerV1Portals { const constructorOptions = { ...options, consoleSessionToken, workspaceId } if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { throw new SeamHttpInvalidOptionsError( 'Missing consoleSessionToken or workspaceId', ) } - return new SeamHttpSeamPartnerV1Resources(constructorOptions) + return new SeamHttpSeamCustomerV1Portals(constructorOptions) } static fromPersonalAccessToken( @@ -133,14 +133,14 @@ export class SeamHttpSeamPartnerV1Resources { SeamHttpOptionsWithPersonalAccessToken, 'personalAccessToken' | 'workspaceId' > = {}, - ): SeamHttpSeamPartnerV1Resources { + ): SeamHttpSeamCustomerV1Portals { const constructorOptions = { ...options, personalAccessToken, workspaceId } if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { throw new SeamHttpInvalidOptionsError( 'Missing personalAccessToken or workspaceId', ) } - return new SeamHttpSeamPartnerV1Resources(constructorOptions) + return new SeamHttpSeamCustomerV1Portals(constructorOptions) } createPaginator( @@ -168,45 +168,44 @@ export class SeamHttpSeamPartnerV1Resources { await clientSessions.get() } - list( - parameters?: SeamPartnerV1ResourcesListParameters, - options: SeamPartnerV1ResourcesListOptions = {}, - ): SeamPartnerV1ResourcesListRequest { + get( + parameters?: SeamCustomerV1PortalsGetParameters, + options: SeamCustomerV1PortalsGetOptions = {}, + ): SeamCustomerV1PortalsGetRequest { if (!this.defaults.isUndocumentedApiEnabled) { throw new Error( 'Cannot use undocumented API without isUndocumentedApiEnabled', ) } return new SeamHttpRequest(this, { - pathname: '/seam/partner/v1/resources/list', + pathname: '/seam/customer/v1/portals/get', method: 'POST', body: parameters, - responseKey: 'partner_resources', + responseKey: 'customer_portal', options, }) } } -export type SeamPartnerV1ResourcesListParameters = - RouteRequestBody<'/seam/partner/v1/resources/list'> +export type SeamCustomerV1PortalsGetParameters = + RouteRequestBody<'/seam/customer/v1/portals/get'> /** - * @deprecated Use SeamPartnerV1ResourcesListParameters instead. + * @deprecated Use SeamCustomerV1PortalsGetParameters instead. */ -export type SeamPartnerV1ResourcesListParams = - SeamPartnerV1ResourcesListParameters +export type SeamCustomerV1PortalsGetParams = SeamCustomerV1PortalsGetParameters /** - * @deprecated Use SeamPartnerV1ResourcesListRequest instead. + * @deprecated Use SeamCustomerV1PortalsGetRequest instead. */ -export type SeamPartnerV1ResourcesListResponse = SetNonNullable< - Required> +export type SeamCustomerV1PortalsGetResponse = SetNonNullable< + Required> > -export type SeamPartnerV1ResourcesListRequest = SeamHttpRequest< - SeamPartnerV1ResourcesListResponse, - 'partner_resources' +export type SeamCustomerV1PortalsGetRequest = SeamHttpRequest< + SeamCustomerV1PortalsGetResponse, + 'customer_portal' > // eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface SeamPartnerV1ResourcesListOptions {} +export interface SeamCustomerV1PortalsGetOptions {} diff --git a/src/lib/seam/connect/routes/seam/customer/v1/settings/index.ts b/src/lib/seam/connect/routes/seam/customer/v1/settings/index.ts new file mode 100644 index 00000000..8671c36c --- /dev/null +++ b/src/lib/seam/connect/routes/seam/customer/v1/settings/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 './settings.js' diff --git a/src/lib/seam/connect/routes/unstable-partner/resources/resources.ts b/src/lib/seam/connect/routes/seam/customer/v1/settings/settings.ts similarity index 78% rename from src/lib/seam/connect/routes/unstable-partner/resources/resources.ts rename to src/lib/seam/connect/routes/seam/customer/v1/settings/settings.ts index 092fa9f4..f407eaa1 100644 --- a/src/lib/seam/connect/routes/unstable-partner/resources/resources.ts +++ b/src/lib/seam/connect/routes/seam/customer/v1/settings/settings.ts @@ -36,7 +36,7 @@ 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 SeamHttpUnstablePartnerResources { +export class SeamHttpSeamCustomerV1Settings { client: Client readonly defaults: Required readonly ltsVersion = seamApiLtsVersion @@ -56,23 +56,23 @@ export class SeamHttpUnstablePartnerResources { static fromClient( client: SeamHttpOptionsWithClient['client'], options: Omit = {}, - ): SeamHttpUnstablePartnerResources { + ): SeamHttpSeamCustomerV1Settings { const constructorOptions = { ...options, client } if (!isSeamHttpOptionsWithClient(constructorOptions)) { throw new SeamHttpInvalidOptionsError('Missing client') } - return new SeamHttpUnstablePartnerResources(constructorOptions) + return new SeamHttpSeamCustomerV1Settings(constructorOptions) } static fromApiKey( apiKey: SeamHttpOptionsWithApiKey['apiKey'], options: Omit = {}, - ): SeamHttpUnstablePartnerResources { + ): SeamHttpSeamCustomerV1Settings { const constructorOptions = { ...options, apiKey } if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { throw new SeamHttpInvalidOptionsError('Missing apiKey') } - return new SeamHttpUnstablePartnerResources(constructorOptions) + return new SeamHttpSeamCustomerV1Settings(constructorOptions) } static fromClientSessionToken( @@ -81,24 +81,24 @@ export class SeamHttpUnstablePartnerResources { SeamHttpOptionsWithClientSessionToken, 'clientSessionToken' > = {}, - ): SeamHttpUnstablePartnerResources { + ): SeamHttpSeamCustomerV1Settings { const constructorOptions = { ...options, clientSessionToken } if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') } - return new SeamHttpUnstablePartnerResources(constructorOptions) + return new SeamHttpSeamCustomerV1Settings(constructorOptions) } static async fromPublishableKey( publishableKey: string, userIdentifierKey: string, options: SeamHttpFromPublishableKeyOptions = {}, - ): Promise { + ): Promise { warnOnInsecureuserIdentifierKey(userIdentifierKey) const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttpUnstablePartnerResources.fromPublishableKey', + 'The client option cannot be used with SeamHttpSeamCustomerV1Settings.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -106,10 +106,7 @@ export class SeamHttpUnstablePartnerResources { const { token } = await clientSessions.getOrCreate({ user_identifier_key: userIdentifierKey, }) - return SeamHttpUnstablePartnerResources.fromClientSessionToken( - token, - options, - ) + return SeamHttpSeamCustomerV1Settings.fromClientSessionToken(token, options) } static fromConsoleSessionToken( @@ -119,14 +116,14 @@ export class SeamHttpUnstablePartnerResources { SeamHttpOptionsWithConsoleSessionToken, 'consoleSessionToken' | 'workspaceId' > = {}, - ): SeamHttpUnstablePartnerResources { + ): SeamHttpSeamCustomerV1Settings { const constructorOptions = { ...options, consoleSessionToken, workspaceId } if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { throw new SeamHttpInvalidOptionsError( 'Missing consoleSessionToken or workspaceId', ) } - return new SeamHttpUnstablePartnerResources(constructorOptions) + return new SeamHttpSeamCustomerV1Settings(constructorOptions) } static fromPersonalAccessToken( @@ -136,14 +133,14 @@ export class SeamHttpUnstablePartnerResources { SeamHttpOptionsWithPersonalAccessToken, 'personalAccessToken' | 'workspaceId' > = {}, - ): SeamHttpUnstablePartnerResources { + ): SeamHttpSeamCustomerV1Settings { const constructorOptions = { ...options, personalAccessToken, workspaceId } if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { throw new SeamHttpInvalidOptionsError( 'Missing personalAccessToken or workspaceId', ) } - return new SeamHttpUnstablePartnerResources(constructorOptions) + return new SeamHttpSeamCustomerV1Settings(constructorOptions) } createPaginator( @@ -171,18 +168,18 @@ export class SeamHttpUnstablePartnerResources { await clientSessions.get() } - push( - parameters?: UnstablePartnerResourcesPushParameters, - options: UnstablePartnerResourcesPushOptions = {}, - ): UnstablePartnerResourcesPushRequest { + update( + parameters?: SeamCustomerV1SettingsUpdateParameters, + options: SeamCustomerV1SettingsUpdateOptions = {}, + ): SeamCustomerV1SettingsUpdateRequest { if (!this.defaults.isUndocumentedApiEnabled) { throw new Error( 'Cannot use undocumented API without isUndocumentedApiEnabled', ) } return new SeamHttpRequest(this, { - pathname: '/unstable_partner/resources/push', - method: 'POST', + pathname: '/seam/customer/v1/settings/update', + method: 'PATCH', body: parameters, responseKey: undefined, options, @@ -190,26 +187,26 @@ export class SeamHttpUnstablePartnerResources { } } -export type UnstablePartnerResourcesPushParameters = - RouteRequestBody<'/unstable_partner/resources/push'> +export type SeamCustomerV1SettingsUpdateParameters = + RouteRequestBody<'/seam/customer/v1/settings/update'> /** - * @deprecated Use UnstablePartnerResourcesPushParameters instead. + * @deprecated Use SeamCustomerV1SettingsUpdateParameters instead. */ -export type UnstablePartnerResourcesPushBody = - UnstablePartnerResourcesPushParameters +export type SeamCustomerV1SettingsUpdateBody = + SeamCustomerV1SettingsUpdateParameters /** - * @deprecated Use UnstablePartnerResourcesPushRequest instead. + * @deprecated Use SeamCustomerV1SettingsUpdateRequest instead. */ -export type UnstablePartnerResourcesPushResponse = SetNonNullable< - Required> +export type SeamCustomerV1SettingsUpdateResponse = SetNonNullable< + Required> > -export type UnstablePartnerResourcesPushRequest = SeamHttpRequest< +export type SeamCustomerV1SettingsUpdateRequest = SeamHttpRequest< void, undefined > // eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface UnstablePartnerResourcesPushOptions {} +export interface SeamCustomerV1SettingsUpdateOptions {} diff --git a/src/lib/seam/connect/routes/seam/partner/v1/v1.ts b/src/lib/seam/connect/routes/seam/customer/v1/v1.ts similarity index 83% rename from src/lib/seam/connect/routes/seam/partner/v1/v1.ts rename to src/lib/seam/connect/routes/seam/customer/v1/v1.ts index 0e293c57..7227d2c3 100644 --- a/src/lib/seam/connect/routes/seam/partner/v1/v1.ts +++ b/src/lib/seam/connect/routes/seam/customer/v1/v1.ts @@ -33,10 +33,10 @@ import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/ import type { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' -import { SeamHttpSeamPartnerV1BuildingBlocks } from './building-blocks/index.js' -import { SeamHttpSeamPartnerV1Resources } from './resources/index.js' +import { SeamHttpSeamCustomerV1Portals } from './portals/index.js' +import { SeamHttpSeamCustomerV1Settings } from './settings/index.js' -export class SeamHttpSeamPartnerV1 { +export class SeamHttpSeamCustomerV1 { client: Client readonly defaults: Required readonly ltsVersion = seamApiLtsVersion @@ -56,23 +56,23 @@ export class SeamHttpSeamPartnerV1 { static fromClient( client: SeamHttpOptionsWithClient['client'], options: Omit = {}, - ): SeamHttpSeamPartnerV1 { + ): SeamHttpSeamCustomerV1 { const constructorOptions = { ...options, client } if (!isSeamHttpOptionsWithClient(constructorOptions)) { throw new SeamHttpInvalidOptionsError('Missing client') } - return new SeamHttpSeamPartnerV1(constructorOptions) + return new SeamHttpSeamCustomerV1(constructorOptions) } static fromApiKey( apiKey: SeamHttpOptionsWithApiKey['apiKey'], options: Omit = {}, - ): SeamHttpSeamPartnerV1 { + ): SeamHttpSeamCustomerV1 { const constructorOptions = { ...options, apiKey } if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { throw new SeamHttpInvalidOptionsError('Missing apiKey') } - return new SeamHttpSeamPartnerV1(constructorOptions) + return new SeamHttpSeamCustomerV1(constructorOptions) } static fromClientSessionToken( @@ -81,24 +81,24 @@ export class SeamHttpSeamPartnerV1 { SeamHttpOptionsWithClientSessionToken, 'clientSessionToken' > = {}, - ): SeamHttpSeamPartnerV1 { + ): SeamHttpSeamCustomerV1 { const constructorOptions = { ...options, clientSessionToken } if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') } - return new SeamHttpSeamPartnerV1(constructorOptions) + return new SeamHttpSeamCustomerV1(constructorOptions) } static async fromPublishableKey( publishableKey: string, userIdentifierKey: string, options: SeamHttpFromPublishableKeyOptions = {}, - ): Promise { + ): Promise { warnOnInsecureuserIdentifierKey(userIdentifierKey) const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttpSeamPartnerV1.fromPublishableKey', + 'The client option cannot be used with SeamHttpSeamCustomerV1.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -106,7 +106,7 @@ export class SeamHttpSeamPartnerV1 { const { token } = await clientSessions.getOrCreate({ user_identifier_key: userIdentifierKey, }) - return SeamHttpSeamPartnerV1.fromClientSessionToken(token, options) + return SeamHttpSeamCustomerV1.fromClientSessionToken(token, options) } static fromConsoleSessionToken( @@ -116,14 +116,14 @@ export class SeamHttpSeamPartnerV1 { SeamHttpOptionsWithConsoleSessionToken, 'consoleSessionToken' | 'workspaceId' > = {}, - ): SeamHttpSeamPartnerV1 { + ): SeamHttpSeamCustomerV1 { const constructorOptions = { ...options, consoleSessionToken, workspaceId } if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { throw new SeamHttpInvalidOptionsError( 'Missing consoleSessionToken or workspaceId', ) } - return new SeamHttpSeamPartnerV1(constructorOptions) + return new SeamHttpSeamCustomerV1(constructorOptions) } static fromPersonalAccessToken( @@ -133,14 +133,14 @@ export class SeamHttpSeamPartnerV1 { SeamHttpOptionsWithPersonalAccessToken, 'personalAccessToken' | 'workspaceId' > = {}, - ): SeamHttpSeamPartnerV1 { + ): SeamHttpSeamCustomerV1 { const constructorOptions = { ...options, personalAccessToken, workspaceId } if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { throw new SeamHttpInvalidOptionsError( 'Missing personalAccessToken or workspaceId', ) } - return new SeamHttpSeamPartnerV1(constructorOptions) + return new SeamHttpSeamCustomerV1(constructorOptions) } createPaginator( @@ -168,14 +168,11 @@ export class SeamHttpSeamPartnerV1 { await clientSessions.get() } - get buildingBlocks(): SeamHttpSeamPartnerV1BuildingBlocks { - return SeamHttpSeamPartnerV1BuildingBlocks.fromClient( - this.client, - this.defaults, - ) + get portals(): SeamHttpSeamCustomerV1Portals { + return SeamHttpSeamCustomerV1Portals.fromClient(this.client, this.defaults) } - get resources(): SeamHttpSeamPartnerV1Resources { - return SeamHttpSeamPartnerV1Resources.fromClient(this.client, this.defaults) + get settings(): SeamHttpSeamCustomerV1Settings { + return SeamHttpSeamCustomerV1Settings.fromClient(this.client, this.defaults) } } diff --git a/src/lib/seam/connect/routes/seam/index.ts b/src/lib/seam/connect/routes/seam/index.ts index 6e74aa88..d8d31f24 100644 --- a/src/lib/seam/connect/routes/seam/index.ts +++ b/src/lib/seam/connect/routes/seam/index.ts @@ -3,4 +3,5 @@ * Do not edit this file or add other files to this directory. */ +export * from './customer/index.js' export * from './partner/index.js' diff --git a/src/lib/seam/connect/routes/seam/partner/v1/index.ts b/src/lib/seam/connect/routes/seam/partner/v1/index.ts index 7d67e232..ee41d3d1 100644 --- a/src/lib/seam/connect/routes/seam/partner/v1/index.ts +++ b/src/lib/seam/connect/routes/seam/partner/v1/index.ts @@ -4,5 +4,3 @@ */ export * from './building-blocks/index.js' -export * from './resources/index.js' -export * from './v1.js' diff --git a/src/lib/seam/connect/routes/unstable-partner/index.ts b/src/lib/seam/connect/routes/unstable-partner/index.ts index 751f59ff..85ca7e0f 100644 --- a/src/lib/seam/connect/routes/unstable-partner/index.ts +++ b/src/lib/seam/connect/routes/unstable-partner/index.ts @@ -4,5 +4,4 @@ */ export * from './building-blocks/index.js' -export * from './resources/index.js' export * from './unstable-partner.js' diff --git a/src/lib/seam/connect/routes/unstable-partner/unstable-partner.ts b/src/lib/seam/connect/routes/unstable-partner/unstable-partner.ts index 8f57e45f..403ff0ba 100644 --- a/src/lib/seam/connect/routes/unstable-partner/unstable-partner.ts +++ b/src/lib/seam/connect/routes/unstable-partner/unstable-partner.ts @@ -34,7 +34,6 @@ import type { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import { SeamHttpUnstablePartnerBuildingBlocks } from './building-blocks/index.js' -import { SeamHttpUnstablePartnerResources } from './resources/index.js' export class SeamHttpUnstablePartner { client: Client @@ -174,11 +173,4 @@ export class SeamHttpUnstablePartner { this.defaults, ) } - - get resources(): SeamHttpUnstablePartnerResources { - return SeamHttpUnstablePartnerResources.fromClient( - this.client, - this.defaults, - ) - } }