diff --git a/README.md b/README.md index a7218b3d..85b15692 100644 --- a/README.md +++ b/README.md @@ -524,19 +524,6 @@ const seam = new SeamHttpEndpoints() const devices = await seam['/devices/list']() ``` -#### Enable undocumented API - -Pass the `isUndocumentedApiEnabled` option to allow using the undocumented API. -This API is used internally and is not directly supported. -Do not use the undocumented API in production environments. -Seam is not responsible for any issues you may encounter with the undocumented API. - -```ts -import { SeamHttp } from '@seamapi/http' - -const seam = new SeamHttp({ isUndocumentedApiEnabled: true }) -``` - #### Inspecting the Request All client methods return an instance of `SeamHttpRequest`. diff --git a/codegen/layouts/endpoints.hbs b/codegen/layouts/endpoints.hbs index 0dfb08f6..55c24bf8 100644 --- a/codegen/layouts/endpoints.hbs +++ b/codegen/layouts/endpoints.hbs @@ -26,11 +26,6 @@ export class {{className}} { get['{{path}}'](): {{> endpont-method-signature isFnType=true }} { const { client, defaults } = this - {{#if isUndocumented}} - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error('Cannot use undocumented API without isUndocumentedApiEnabled') - } - {{/if}} return function {{functionName}} (...args: Parameters<{{className}}['{{methodName}}']>): ReturnType<{{className}}['{{methodName}}']> { const seam = {{className}}.fromClient(client, defaults) diff --git a/codegen/layouts/partials/route-class-endpoint-export.hbs b/codegen/layouts/partials/route-class-endpoint-export.hbs index c03e1f1d..cf0f766a 100644 --- a/codegen/layouts/partials/route-class-endpoint-export.hbs +++ b/codegen/layouts/partials/route-class-endpoint-export.hbs @@ -1,14 +1,9 @@ -export type {{parametersTypeName}} = {{#if isUndocumented}}RouteRequest{{requestFormatSuffix}}<'{{path}}'>{{else}}{{> request-object parameters=parameters}}{{/if}} - -/** - * @deprecated Use {{parametersTypeName}} instead. - */ -export type {{legacyRequestTypeName}} = {{parametersTypeName}} +export type {{parametersTypeName}} = {{> request-object parameters=parameters}} /** * @deprecated Use {{requestTypeName}} instead. */ -export type {{responseTypeName}} = {{#if usesLegacyResponseType}}RouteResponse<'{{path}}'>{{else if returnsVoid}}void{{else}}{ {{json responseKey}}: {{#if responseIsList}}Array<{{responseResourceTypeName}}>{{else}}{{responseResourceTypeName}}{{/if}} }{{/if}} +export type {{responseTypeName}} = {{#if returnsVoid}}void{{else}}{ {{json responseKey}}: {{#if responseIsList}}Array<{{responseResourceTypeName}}>{{else}}{{responseResourceTypeName}}{{/if}} }{{/if}} export type {{requestTypeName}} = SeamHttpRequest<{{#if returnsVoid}}void, undefined{{else}}{{responseTypeName}}, '{{responseKey}}'{{/if}}> diff --git a/codegen/layouts/partials/route-class-endpoint.hbs b/codegen/layouts/partials/route-class-endpoint.hbs index b21e05c8..f0c7bd28 100644 --- a/codegen/layouts/partials/route-class-endpoint.hbs +++ b/codegen/layouts/partials/route-class-endpoint.hbs @@ -1,11 +1,6 @@ {{methodName}} {{> endpont-method-signature }} { - {{#if isUndocumented}} - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error('Cannot use undocumented API without isUndocumentedApiEnabled') - } - {{/if}} return new SeamHttpRequest(this, { pathname: '{{path}}', method: '{{method}}', diff --git a/codegen/layouts/partials/route-class-methods.hbs b/codegen/layouts/partials/route-class-methods.hbs index 9a03faaa..f67a9208 100644 --- a/codegen/layouts/partials/route-class-methods.hbs +++ b/codegen/layouts/partials/route-class-methods.hbs @@ -5,11 +5,6 @@ static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) - {{#if isUndocumented}} - if (!options.isUndocumentedApiEnabled) { - throw new Error('Cannot use undocumented API without isUndocumentedApiEnabled') - } - {{/if}} this.client = 'client' in options ? options.client : createClient(options) this.defaults = limitToSeamHttpRequestOptions(options) } diff --git a/codegen/layouts/partials/route-imports.hbs b/codegen/layouts/partials/route-imports.hbs index c5547b13..9eab82c0 100644 --- a/codegen/layouts/partials/route-imports.hbs +++ b/codegen/layouts/partials/route-imports.hbs @@ -1,11 +1,4 @@ import { seamApiLtsVersion } from 'lib/lts-version.js' -{{#if hasLegacyTypes}} -import type { - RouteRequestBody, - RouteRequestParams, - RouteResponse, -} from '@seamapi/types/connect' -{{/if}} {{#each resourceTypeImports}} import type { {{typeName}} } from 'lib/seam/connect/resources/{{fileName}}' {{/each}} diff --git a/codegen/layouts/resource.hbs b/codegen/layouts/resource.hbs index 1113c78b..855cbaec 100644 --- a/codegen/layouts/resource.hbs +++ b/codegen/layouts/resource.hbs @@ -3,4 +3,20 @@ * Do not edit this file. */ -export type {{typeName}} = {{#if isUnknown}}Record{{else}}{{#each resources}}{{#unless @first}} | {{/unless}}{{> resource-object properties=properties}}{{/each}}{{/if}} +{{#if isBatch}} +{{#each batchResources}} +import type { {{typeName}} } from './{{fileName}}' +{{/each}} + +interface BatchResourceMap { +{{#each batchResources}} + {{json batchKey}}: {{typeName}} +{{/each}} +} + +export type {{typeName}} = { + [K in TKey]?: Array | undefined +} +{{else}} +export type {{typeName}} = {{#each resources}}{{#unless @first}} | {{/unless}}{{> resource-object properties=properties}}{{/each}} +{{/if}} diff --git a/codegen/lib/layouts/resources.ts b/codegen/lib/layouts/resources.ts index 98c9f76a..02326a62 100644 --- a/codegen/lib/layouts/resources.ts +++ b/codegen/lib/layouts/resources.ts @@ -5,15 +5,22 @@ export interface ResourceLayoutContext { fileName: string typeName: string resources: Resource[] - isUnknown: boolean + isBatch: boolean + batchResources: BatchResourceLayoutContext[] } export interface ResourceIndexLayoutContext { resources: Array> } +interface BatchResourceLayoutContext { + batchKey: string + fileName: string + typeName: string +} + export const getResourceTypeName = (resourceType: string): string => - `${pascalCase(resourceType)}Resource` + resourceType === 'event' ? 'SeamEvent' : pascalCase(resourceType) export const getResourceLayoutContexts = ( blueprint: Blueprint, @@ -26,21 +33,33 @@ export const getResourceLayoutContexts = ( const resourceTypes = [ ...new Set(resources.map(({ resourceType }) => resourceType)), ] + const batchResources = getBatchResourceLayoutContexts(resources) - return [ - { - fileName: 'unknown.ts', - typeName: 'UnknownResource', - resources: [], - isUnknown: true, - }, - ...resourceTypes.map((resourceType) => ({ - fileName: `${kebabCase(resourceType)}.ts`, - typeName: getResourceTypeName(resourceType), - resources: resources.filter( - (resource) => resource.resourceType === resourceType, - ), - isUnknown: false, - })), - ] + return resourceTypes.map((resourceType) => ({ + fileName: `${kebabCase(resourceType)}.ts`, + typeName: getResourceTypeName(resourceType), + resources: resources.filter( + (resource) => resource.resourceType === resourceType, + ), + isBatch: resourceType === 'batch', + batchResources: resourceType === 'batch' ? batchResources : [], + })) +} + +const getBatchResourceLayoutContexts = ( + resources: Resource[], +): BatchResourceLayoutContext[] => { + const batch = resources.find(({ resourceType }) => resourceType === 'batch') + if (batch == null) return [] + + return batch.properties.flatMap((property) => { + if (!('resourceType' in property)) return [] + return [ + { + batchKey: property.name, + fileName: `${kebabCase(property.resourceType)}.js`, + typeName: getResourceTypeName(property.resourceType), + }, + ] + }) } diff --git a/codegen/lib/layouts/route.ts b/codegen/lib/layouts/route.ts index 36fa4755..f7e656fe 100644 --- a/codegen/lib/layouts/route.ts +++ b/codegen/lib/layouts/route.ts @@ -6,11 +6,9 @@ import { getResourceTypeName } from './resources.js' export interface RouteLayoutContext { className: string - isUndocumented: boolean endpoints: EndpointLayoutContext[] subroutes: SubrouteLayoutContext[] skipClientSessionImport: boolean - hasLegacyTypes: boolean resourceTypeImports: ResourceTypeImport[] } @@ -27,16 +25,12 @@ export interface EndpointLayoutContext { responseKey: string requestFormat: 'params' | 'body' parametersTypeName: string - legacyRequestTypeName: string responseTypeName: string - requestFormatSuffix: string optionsTypeName: string requestTypeName: string returnsActionAttempt: boolean returnsVoid: boolean isOptionalParamsOk: boolean - isUndocumented: boolean - usesLegacyResponseType: boolean parameters: Parameter[] responseIsList: boolean responseResourceTypeName: string @@ -59,34 +53,12 @@ export const setRouteLayoutContext = ( nodes: Array, ): void => { file.className = getClassName(node?.path ?? null) - file.isUndocumented = node?.isUndocumented ?? false file.skipClientSessionImport = node == null || node?.path === '/client_sessions' - file.hasLegacyTypes = - node != null && 'endpoints' in node - ? node.endpoints.some( - (endpoint) => - endpoint.isUndocumented || - (endpoint.response.responseType === 'resource' && - endpoint.response.resourceType === 'action_attempt'), - ) - : false file.resourceTypeImports = node != null && 'endpoints' in node ? [ - ...new Set( - node.endpoints.flatMap((endpoint) => { - if ( - endpoint.isUndocumented || - endpoint.response.responseType === 'void' || - (endpoint.response.responseType === 'resource' && - endpoint.response.resourceType === 'action_attempt') - ) { - return [] - } - return [endpoint.response.resourceType] - }), - ), + ...new Set(node.endpoints.flatMap(getEndpointResponseResourceTypes)), ].map((resourceType) => ({ fileName: `${kebabCase(resourceType)}.js`, typeName: getResourceTypeName(resourceType), @@ -107,7 +79,7 @@ export const setRouteLayoutContext = ( } const getSubrouteLayoutContext = ( - route: Pick, + route: Pick, ): SubrouteLayoutContext => { return { fileName: `${kebabCase(route.name)}/index.js`, @@ -122,11 +94,17 @@ export const getEndpointLayoutContext = ( ): EndpointLayoutContext => { const prefix = pascalCase([route.path.split('/'), endpoint.name].join('_')) - const legacyMethodParamName = ['GET', 'DELETE'].includes( - endpoint.request.semanticMethod, - ) - ? 'params' - : 'body' + const batchResourceKeys = getBatchResourceKeys(endpoint) + + if ( + endpoint.response.responseType !== 'void' && + endpoint.response.resourceType === 'unknown' && + batchResourceKeys.length === 0 + ) { + throw new Error( + `Cannot generate ${endpoint.path}: response resource type is unknown`, + ) + } const requestFormat = ['GET', 'DELETE'].includes( endpoint.request.preferredMethod, @@ -134,8 +112,6 @@ export const getEndpointLayoutContext = ( ? 'params' : 'body' - const requestFormatSuffix = pascalCase(requestFormat) - const returnsActionAttempt = endpoint.response.responseType === 'resource' && endpoint.response.resourceType === 'action_attempt' @@ -149,28 +125,42 @@ export const getEndpointLayoutContext = ( method: endpoint.request.preferredMethod, className: getClassName(route.path), requestFormat, - requestFormatSuffix, returnsActionAttempt, parametersTypeName: `${prefix}Parameters`, - legacyRequestTypeName: `${prefix}${pascalCase(legacyMethodParamName)}`, responseTypeName: `${prefix}Response`, optionsTypeName: `${prefix}Options`, requestTypeName: `${prefix}Request`, isOptionalParamsOk: endpoint.request.parameters.every( (parameter) => !parameter.isRequired, ), - isUndocumented: endpoint.isUndocumented, - usesLegacyResponseType: endpoint.isUndocumented || returnsActionAttempt, parameters: endpoint.request.parameters, responseIsList: endpoint.response.responseType === 'resource_list', responseResourceTypeName: endpoint.response.responseType === 'void' ? '' - : getResourceTypeName(endpoint.response.resourceType), + : batchResourceKeys.length > 0 + ? `Batch<${batchResourceKeys.map((key) => `'${key}'`).join(' | ')}>` + : getResourceTypeName(endpoint.response.resourceType), ...getResponseContext(endpoint), } } +const getEndpointResponseResourceTypes = (endpoint: Endpoint): string[] => { + if (endpoint.response.responseType === 'void') return [] + if (endpoint.response.responseType === 'resource') { + const { batchResourceTypes } = endpoint.response + if (batchResourceTypes != null) return ['batch'] + } + return [endpoint.response.resourceType] +} + +const getBatchResourceKeys = (endpoint: Endpoint): string[] => { + if (endpoint.response.responseType !== 'resource') return [] + return ( + endpoint.response.batchResourceTypes?.map(({ batchKey }) => batchKey) ?? [] + ) +} + const getResponseContext = ( endpoint: Endpoint, ): Pick => { diff --git a/codegen/smith.ts b/codegen/smith.ts index bf8950bb..3bda151b 100644 --- a/codegen/smith.ts +++ b/codegen/smith.ts @@ -22,7 +22,7 @@ Metalsmith(rootDir) .source('./content') .destination('../') .clean(false) - .use(blueprint({ types })) + .use(blueprint({ types, omitUndocumented: true })) .use(connect) .use( layouts({ diff --git a/package-lock.json b/package-lock.json index 30a51bd9..249b1b3e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,10 +14,10 @@ "axios-retry": "^4.4.2" }, "devDependencies": { - "@seamapi/blueprint": "^1.0.0", + "@seamapi/blueprint": "^1.1.0", "@seamapi/fake-seam-connect": "^1.77.0", "@seamapi/smith": "^1.1.0", - "@seamapi/types": "1.982.0", + "@seamapi/types": "1.983.0", "@types/jsonwebtoken": "^9.0.6", "@types/node": "^24.10.9", "ava": "^8.0.1", @@ -47,7 +47,7 @@ "npm": ">=10.9.4" }, "peerDependencies": { - "@seamapi/types": "^1.982.0" + "@seamapi/types": "^1.983.0" }, "peerDependenciesMeta": { "@seamapi/types": { @@ -977,9 +977,9 @@ "license": "MIT" }, "node_modules/@seamapi/blueprint": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@seamapi/blueprint/-/blueprint-1.0.0.tgz", - "integrity": "sha512-tQLylewWRJL1PWNxt9fXH/NWKIY0oA4NaQnRtRul0Dewy5yFqQy1fdi5IRPa7G3v+D9rrEiCwVA/omWrfrPZ+Q==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@seamapi/blueprint/-/blueprint-1.1.0.tgz", + "integrity": "sha512-wX1HZkA/IK9hDQ6Qdxw5Mo+Ysfh82p9IEXQJafakO9VMbszW6n1U02eEhZHVY3CfzN/duk6t9h1veX0zRlhWBQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1061,9 +1061,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.982.0", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.982.0.tgz", - "integrity": "sha512-u8jRqmsFwDEMAxtKBulXJQj1ZDHsqgJclxL/McLpS7si4eFnb5r2YJ3LObLMbVO1G5N/mPzpahZQi5bbrlAApw==", + "version": "1.983.0", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.983.0.tgz", + "integrity": "sha512-SMkfn1SVC70x67mtRAvLMJtpFh/0zaStLatb6LA+kz9n/rV1gBS/UlH8SzBFg7iStE22f/VPjkdltHTIY1paoA==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index 98e14ffc..27a8a64f 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,7 @@ } }, "peerDependencies": { - "@seamapi/types": "^1.982.0" + "@seamapi/types": "^1.983.0" }, "peerDependenciesMeta": { "@seamapi/types": { @@ -95,10 +95,10 @@ "axios-retry": "^4.4.2" }, "devDependencies": { - "@seamapi/blueprint": "^1.0.0", + "@seamapi/blueprint": "^1.1.0", "@seamapi/fake-seam-connect": "^1.77.0", "@seamapi/smith": "^1.1.0", - "@seamapi/types": "1.982.0", + "@seamapi/types": "1.983.0", "@types/jsonwebtoken": "^9.0.6", "@types/node": "^24.10.9", "ava": "^8.0.1", diff --git a/src/lib/seam/connect/index.ts b/src/lib/seam/connect/index.ts index 48d44d5c..210bbaf1 100644 --- a/src/lib/seam/connect/index.ts +++ b/src/lib/seam/connect/index.ts @@ -10,6 +10,7 @@ export { SeamActionAttemptFailedError, SeamActionAttemptTimeoutError, } from './resolve-action-attempt.js' +export * from './resources/index.js' export * from './routes/index.js' export * from './seam-http-error.js' export * from './seam-http-request.js' diff --git a/src/lib/seam/connect/options.ts b/src/lib/seam/connect/options.ts index 7b1104d2..2594ceca 100644 --- a/src/lib/seam/connect/options.ts +++ b/src/lib/seam/connect/options.ts @@ -22,7 +22,6 @@ interface SeamHttpCommonOptions extends ClientOptions, SeamHttpRequestOptions { export interface SeamHttpRequestOptions { waitForActionAttempt?: boolean | ResolveActionAttemptOptions - isUndocumentedApiEnabled?: boolean } export interface SeamHttpFromPublishableKeyOptions extends SeamHttpCommonOptions {} diff --git a/src/lib/seam/connect/parse-options.ts b/src/lib/seam/connect/parse-options.ts index 65c4755d..4c94b620 100644 --- a/src/lib/seam/connect/parse-options.ts +++ b/src/lib/seam/connect/parse-options.ts @@ -64,7 +64,6 @@ const getNormalizedOptions = ( : apiKeyOrOptions const requestOptions = { - isUndocumentedApiEnabled: options.isUndocumentedApiEnabled ?? false, waitForActionAttempt: options.waitForActionAttempt ?? true, } @@ -182,7 +181,6 @@ export const isSeamHttpRequestOption = ( key: string, ): key is keyof SeamHttpRequestOptions => { const keys: Record = { - isUndocumentedApiEnabled: true, waitForActionAttempt: true, } return Object.keys(keys).includes(key) diff --git a/src/lib/seam/connect/resolve-action-attempt.ts b/src/lib/seam/connect/resolve-action-attempt.ts index 1801f6b5..49d1ae9e 100644 --- a/src/lib/seam/connect/resolve-action-attempt.ts +++ b/src/lib/seam/connect/resolve-action-attempt.ts @@ -1,5 +1,4 @@ -import type { ActionAttempt } from '@seamapi/types/connect' - +import type { ActionAttempt } from './resources/action-attempt.js' import type { SeamHttpActionAttempts } from './routes/index.js' export interface ResolveActionAttemptOptions { @@ -118,12 +117,10 @@ const isFailedActionAttempt = ( actionAttempt: T, ): actionAttempt is FailedActionAttempt => actionAttempt.status === 'error' -export type SucceededActionAttempt = Extract< - T, - { status: 'success' } -> +export type SucceededActionAttempt = T & { + status: 'success' +} -export type FailedActionAttempt = Extract< - T, - { status: 'error' } -> +export type FailedActionAttempt = T & { + status: 'error' +} diff --git a/src/lib/seam/connect/resources/access-code.ts b/src/lib/seam/connect/resources/access-code.ts index 8d65b47f..c9ce853c 100644 --- a/src/lib/seam/connect/resources/access-code.ts +++ b/src/lib/seam/connect/resources/access-code.ts @@ -3,7 +3,7 @@ * Do not edit this file. */ -export type AccessCodeResource = { +export type AccessCode = { access_code_id: string code: string | null diff --git a/src/lib/seam/connect/resources/access-grant.ts b/src/lib/seam/connect/resources/access-grant.ts index 834210b7..04e4fd24 100644 --- a/src/lib/seam/connect/resources/access-grant.ts +++ b/src/lib/seam/connect/resources/access-grant.ts @@ -3,7 +3,7 @@ * Do not edit this file. */ -export type AccessGrantResource = { +export type AccessGrant = { access_grant_id: string access_grant_key?: string | undefined diff --git a/src/lib/seam/connect/resources/access-method.ts b/src/lib/seam/connect/resources/access-method.ts index 58252281..b897a8dc 100644 --- a/src/lib/seam/connect/resources/access-method.ts +++ b/src/lib/seam/connect/resources/access-method.ts @@ -3,7 +3,7 @@ * Do not edit this file. */ -export type AccessMethodResource = { +export type AccessMethod = { access_method_id: string client_session_token?: string | undefined diff --git a/src/lib/seam/connect/resources/acs-access-group.ts b/src/lib/seam/connect/resources/acs-access-group.ts index e8f9f0f1..c3ea9236 100644 --- a/src/lib/seam/connect/resources/acs-access-group.ts +++ b/src/lib/seam/connect/resources/acs-access-group.ts @@ -3,7 +3,7 @@ * Do not edit this file. */ -export type AcsAccessGroupResource = { +export type AcsAccessGroup = { access_group_type: | 'pti_unit' | 'pti_access_level' diff --git a/src/lib/seam/connect/resources/acs-credential-pool.ts b/src/lib/seam/connect/resources/acs-credential-pool.ts deleted file mode 100644 index 55422d7d..00000000 --- a/src/lib/seam/connect/resources/acs-credential-pool.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file. - */ - -export type AcsCredentialPoolResource = { - acs_credential_pool_id: string - - acs_system_id: string - - created_at: string - - display_name: string - - external_type: 'hid_part_number' - - external_type_display_name: string - - workspace_id: string -} diff --git a/src/lib/seam/connect/resources/acs-credential-provisioning-automation.ts b/src/lib/seam/connect/resources/acs-credential-provisioning-automation.ts deleted file mode 100644 index d692f0c0..00000000 --- a/src/lib/seam/connect/resources/acs-credential-provisioning-automation.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file. - */ - -export type AcsCredentialProvisioningAutomationResource = { - acs_credential_provisioning_automation_id: string - - created_at: string - - credential_manager_acs_system_id: string - - user_identity_id: string - - workspace_id: string -} diff --git a/src/lib/seam/connect/resources/acs-credential.ts b/src/lib/seam/connect/resources/acs-credential.ts index e5411cab..98ce99fc 100644 --- a/src/lib/seam/connect/resources/acs-credential.ts +++ b/src/lib/seam/connect/resources/acs-credential.ts @@ -3,7 +3,7 @@ * Do not edit this file. */ -export type AcsCredentialResource = { +export type AcsCredential = { access_method: 'code' | 'card' | 'mobile_key' | 'cloud_key' acs_credential_id: string diff --git a/src/lib/seam/connect/resources/acs-encoder.ts b/src/lib/seam/connect/resources/acs-encoder.ts index 5335bd8d..a64a8b44 100644 --- a/src/lib/seam/connect/resources/acs-encoder.ts +++ b/src/lib/seam/connect/resources/acs-encoder.ts @@ -3,7 +3,7 @@ * Do not edit this file. */ -export type AcsEncoderResource = { +export type AcsEncoder = { acs_encoder_id: string acs_system_id: string diff --git a/src/lib/seam/connect/resources/acs-entrance.ts b/src/lib/seam/connect/resources/acs-entrance.ts index 8fb02d51..aaf554a7 100644 --- a/src/lib/seam/connect/resources/acs-entrance.ts +++ b/src/lib/seam/connect/resources/acs-entrance.ts @@ -3,7 +3,7 @@ * Do not edit this file. */ -export type AcsEntranceResource = { +export type AcsEntrance = { acs_entrance_id: string acs_system_id: string diff --git a/src/lib/seam/connect/resources/acs-system.ts b/src/lib/seam/connect/resources/acs-system.ts index 9696390b..62adbf58 100644 --- a/src/lib/seam/connect/resources/acs-system.ts +++ b/src/lib/seam/connect/resources/acs-system.ts @@ -3,7 +3,7 @@ * Do not edit this file. */ -export type AcsSystemResource = { +export type AcsSystem = { acs_access_group_count?: number | undefined acs_system_id: string diff --git a/src/lib/seam/connect/resources/acs-user.ts b/src/lib/seam/connect/resources/acs-user.ts index fb0d8ec1..f2feaef2 100644 --- a/src/lib/seam/connect/resources/acs-user.ts +++ b/src/lib/seam/connect/resources/acs-user.ts @@ -3,7 +3,7 @@ * Do not edit this file. */ -export type AcsUserResource = { +export type AcsUser = { access_schedule?: | { ends_at: string | null @@ -84,7 +84,6 @@ export type AcsUserResource = { is_managed: boolean is_suspended?: boolean | undefined - last_successful_sync_at: string | null pending_mutations?: | Array< | { diff --git a/src/lib/seam/connect/resources/action-attempt.ts b/src/lib/seam/connect/resources/action-attempt.ts index 2b601b7c..5fd6cc77 100644 --- a/src/lib/seam/connect/resources/action-attempt.ts +++ b/src/lib/seam/connect/resources/action-attempt.ts @@ -3,7 +3,7 @@ * Do not edit this file. */ -export type ActionAttemptResource = +export type ActionAttempt = | { action_attempt_id: string diff --git a/src/lib/seam/connect/resources/batch.ts b/src/lib/seam/connect/resources/batch.ts index 6ae4bed3..22cd4768 100644 --- a/src/lib/seam/connect/resources/batch.ts +++ b/src/lib/seam/connect/resources/batch.ts @@ -3,33 +3,60 @@ * Do not edit this file. */ -export type BatchResource = { - access_codes?: Record | undefined - access_grants?: Record | undefined - access_methods?: Record | undefined - acs_access_groups?: Record | undefined - acs_credentials?: Record | undefined - acs_encoders?: Record | undefined - acs_entrances?: Record | undefined - acs_systems?: Record | undefined - acs_users?: Record | undefined - action_attempts?: Record | undefined - client_sessions?: Record | undefined - connect_webviews?: Record | undefined - connected_accounts?: Record | undefined - customization_profiles?: Record | undefined - devices?: Record | undefined - events?: Record | undefined - instant_keys?: Record | undefined - noise_thresholds?: Record | undefined - spaces?: Record | undefined - thermostat_daily_programs?: Record | undefined - thermostat_schedules?: Record | undefined - unmanaged_access_codes?: Record | undefined - unmanaged_acs_access_groups?: Record | undefined - unmanaged_acs_credentials?: Record | undefined - unmanaged_acs_users?: Record | undefined - unmanaged_devices?: Record | undefined - user_identities?: Record | undefined - workspaces?: Record | undefined +import type { AccessCode } from './access-code.js' +import type { AccessGrant } from './access-grant.js' +import type { AccessMethod } from './access-method.js' +import type { AcsAccessGroup } from './acs-access-group.js' +import type { AcsCredential } from './acs-credential.js' +import type { AcsEncoder } from './acs-encoder.js' +import type { AcsEntrance } from './acs-entrance.js' +import type { AcsSystem } from './acs-system.js' +import type { AcsUser } from './acs-user.js' +import type { ActionAttempt } from './action-attempt.js' +import type { ClientSession } from './client-session.js' +import type { ConnectWebview } from './connect-webview.js' +import type { ConnectedAccount } from './connected-account.js' +import type { Device } from './device.js' +import type { SeamEvent } from './event.js' +import type { InstantKey } from './instant-key.js' +import type { NoiseThreshold } from './noise-threshold.js' +import type { Space } from './space.js' +import type { ThermostatDailyProgram } from './thermostat-daily-program.js' +import type { ThermostatSchedule } from './thermostat-schedule.js' +import type { UnmanagedAccessCode } from './unmanaged-access-code.js' +import type { UnmanagedDevice } from './unmanaged-device.js' +import type { UserIdentity } from './user-identity.js' +import type { Workspace } from './workspace.js' + +interface BatchResourceMap { + access_codes: AccessCode + access_grants: AccessGrant + access_methods: AccessMethod + acs_access_groups: AcsAccessGroup + acs_credentials: AcsCredential + acs_encoders: AcsEncoder + acs_entrances: AcsEntrance + acs_systems: AcsSystem + acs_users: AcsUser + action_attempts: ActionAttempt + client_sessions: ClientSession + connect_webviews: ConnectWebview + connected_accounts: ConnectedAccount + devices: Device + events: SeamEvent + instant_keys: InstantKey + noise_thresholds: NoiseThreshold + spaces: Space + thermostat_daily_programs: ThermostatDailyProgram + thermostat_schedules: ThermostatSchedule + unmanaged_access_codes: UnmanagedAccessCode + unmanaged_devices: UnmanagedDevice + user_identities: UserIdentity + workspaces: Workspace +} + +export type Batch< + TKey extends keyof BatchResourceMap = keyof BatchResourceMap, +> = { + [K in TKey]?: Array | undefined } diff --git a/src/lib/seam/connect/resources/bridge-client-session.ts b/src/lib/seam/connect/resources/bridge-client-session.ts deleted file mode 100644 index af0f467b..00000000 --- a/src/lib/seam/connect/resources/bridge-client-session.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file. - */ - -export type BridgeClientSessionResource = { - bridge_client_machine_identifier_key: string - - bridge_client_name: string - - bridge_client_session_id: string - - bridge_client_session_token: string - - bridge_client_time_zone: string - - created_at: string - - errors: Array< - | { - can_tailscale_proxy_reach_bridge: boolean | null - can_tailscale_proxy_reach_tailscale_network: boolean | null - created_at: string - - error_code: 'bridge_lan_unreachable' - - is_bridge_socks_server_healthy: boolean | null - is_tailscale_proxy_reachable: boolean | null - is_tailscale_proxy_socks_server_healthy: boolean | null - message: string - } - | { - created_at: string - - error_code: 'no_communication_from_bridge' - - message: string - } - > - - pairing_code: string - - pairing_code_expires_at: string - - tailscale_auth_key: string | null - tailscale_hostname: string - - telemetry_token: string | null - telemetry_token_expires_at: string | null - telemetry_url: string | null -} diff --git a/src/lib/seam/connect/resources/bridge-connected-systems.ts b/src/lib/seam/connect/resources/bridge-connected-systems.ts deleted file mode 100644 index dd04ca60..00000000 --- a/src/lib/seam/connect/resources/bridge-connected-systems.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file. - */ - -export type BridgeConnectedSystemsResource = { - acs_system_display_name: string - - acs_system_id: string - - bridge_created_at: string - - bridge_id: string - - connected_account_created_at: string - - connected_account_id: string - - workspace_display_name: string - - workspace_id: string -} diff --git a/src/lib/seam/connect/resources/client-session.ts b/src/lib/seam/connect/resources/client-session.ts index 04f71532..49e65468 100644 --- a/src/lib/seam/connect/resources/client-session.ts +++ b/src/lib/seam/connect/resources/client-session.ts @@ -3,7 +3,7 @@ * Do not edit this file. */ -export type ClientSessionResource = { +export type ClientSession = { client_session_id: string connect_webview_ids: Array diff --git a/src/lib/seam/connect/resources/connect-webview.ts b/src/lib/seam/connect/resources/connect-webview.ts index c36118a7..d06145c4 100644 --- a/src/lib/seam/connect/resources/connect-webview.ts +++ b/src/lib/seam/connect/resources/connect-webview.ts @@ -3,17 +3,13 @@ * Do not edit this file. */ -export type ConnectWebviewResource = { +export type ConnectWebview = { accepted_capabilities: Array< 'lock' | 'thermostat' | 'noise_sensor' | 'access_control' | 'camera' > - accepted_devices: Array - accepted_providers: Array - any_device_allowed: boolean - any_provider_allowed: boolean authorized_at: string | null diff --git a/src/lib/seam/connect/resources/connected-account.ts b/src/lib/seam/connect/resources/connected-account.ts index f92f0326..eb870756 100644 --- a/src/lib/seam/connect/resources/connected-account.ts +++ b/src/lib/seam/connect/resources/connected-account.ts @@ -3,7 +3,7 @@ * Do not edit this file. */ -export type ConnectedAccountResource = { +export type ConnectedAccount = { accepted_capabilities: Array< 'lock' | 'thermostat' | 'noise_sensor' | 'access_control' | 'camera' > diff --git a/src/lib/seam/connect/resources/customer-portal.ts b/src/lib/seam/connect/resources/customer-portal.ts index fde57bc2..722c6380 100644 --- a/src/lib/seam/connect/resources/customer-portal.ts +++ b/src/lib/seam/connect/resources/customer-portal.ts @@ -3,7 +3,7 @@ * Do not edit this file. */ -export type CustomerPortalResource = { +export type CustomerPortal = { created_at: string customer_key: string diff --git a/src/lib/seam/connect/resources/customer.ts b/src/lib/seam/connect/resources/customer.ts deleted file mode 100644 index 2c0783cf..00000000 --- a/src/lib/seam/connect/resources/customer.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file. - */ - -export type CustomerResource = { - created_at: string - - customer_key: string - - workspace_id: string -} diff --git a/src/lib/seam/connect/resources/customization-profile.ts b/src/lib/seam/connect/resources/customization-profile.ts deleted file mode 100644 index 3f4322ca..00000000 --- a/src/lib/seam/connect/resources/customization-profile.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file. - */ - -export type CustomizationProfileResource = { - created_at: string - - customer_portal_theme?: - | { - font_family?: string | undefined - mono_font_family?: string | undefined - primary_color?: string | undefined - primary_foreground_color?: string | undefined - secondary_color?: string | undefined - secondary_foreground_color?: string | undefined - } - | undefined - customization_profile_id: string - - logo_url?: string | undefined - message_overrides?: Record | undefined - name: string | null - primary_color?: string | undefined - secondary_color?: string | undefined - workspace_id: string -} diff --git a/src/lib/seam/connect/resources/device-provider.ts b/src/lib/seam/connect/resources/device-provider.ts index 67056ff9..1f17fe43 100644 --- a/src/lib/seam/connect/resources/device-provider.ts +++ b/src/lib/seam/connect/resources/device-provider.ts @@ -3,7 +3,7 @@ * Do not edit this file. */ -export type DeviceProviderResource = { +export type DeviceProvider = { can_configure_auto_lock?: boolean | undefined can_hvac_cool?: boolean | undefined can_hvac_heat?: boolean | undefined diff --git a/src/lib/seam/connect/resources/device.ts b/src/lib/seam/connect/resources/device.ts index 95eaa3d8..47c6cb80 100644 --- a/src/lib/seam/connect/resources/device.ts +++ b/src/lib/seam/connect/resources/device.ts @@ -3,7 +3,7 @@ * Do not edit this file. */ -export type DeviceResource = { +export type Device = { can_configure_auto_lock?: boolean | undefined can_hvac_cool?: boolean | undefined can_hvac_heat?: boolean | undefined @@ -704,8 +704,6 @@ export type DeviceResource = { product_type?: string | undefined } | undefined - _experimental_supported_code_from_access_codes_lengths?: - Array | undefined auto_lock_delay_seconds?: number | undefined auto_lock_enabled?: boolean | undefined backup_access_code_pool_enabled?: boolean | undefined diff --git a/src/lib/seam/connect/resources/enrollment-automation.ts b/src/lib/seam/connect/resources/enrollment-automation.ts deleted file mode 100644 index 57c01f80..00000000 --- a/src/lib/seam/connect/resources/enrollment-automation.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file. - */ - -export type EnrollmentAutomationResource = { - created_at: string - - credential_manager_acs_system_id: string - - enrollment_automation_id: string - - user_identity_id: string - - workspace_id: string -} diff --git a/src/lib/seam/connect/resources/event.ts b/src/lib/seam/connect/resources/event.ts index 8689893e..f9678f53 100644 --- a/src/lib/seam/connect/resources/event.ts +++ b/src/lib/seam/connect/resources/event.ts @@ -3,7 +3,7 @@ * Do not edit this file. */ -export type EventResource = +export type SeamEvent = | { created_at?: string | undefined event_description?: string | undefined @@ -2657,20 +2657,6 @@ export type EventResource = | { created_at: string - enrollment_automation_id: string - - event_description?: string | undefined - event_id: string - - event_type: 'enrollment_automation.deleted' - - occurred_at: string - - workspace_id: string - } - | { - created_at: string - device_custom_metadata?: Record | undefined device_id: string diff --git a/src/lib/seam/connect/resources/index.ts b/src/lib/seam/connect/resources/index.ts index 1ce61559..1570f8b1 100644 --- a/src/lib/seam/connect/resources/index.ts +++ b/src/lib/seam/connect/resources/index.ts @@ -3,46 +3,35 @@ * Do not edit this file. */ -export type { AccessCodeResource } from './access-code.js' -export type { AccessGrantResource } from './access-grant.js' -export type { AccessMethodResource } from './access-method.js' -export type { AcsAccessGroupResource } from './acs-access-group.js' -export type { AcsCredentialResource } from './acs-credential.js' -export type { AcsCredentialPoolResource } from './acs-credential-pool.js' -export type { AcsCredentialProvisioningAutomationResource } from './acs-credential-provisioning-automation.js' -export type { AcsEncoderResource } from './acs-encoder.js' -export type { AcsEntranceResource } from './acs-entrance.js' -export type { AcsSystemResource } from './acs-system.js' -export type { AcsUserResource } from './acs-user.js' -export type { ActionAttemptResource } from './action-attempt.js' -export type { BatchResource } from './batch.js' -export type { BridgeClientSessionResource } from './bridge-client-session.js' -export type { BridgeConnectedSystemsResource } from './bridge-connected-systems.js' -export type { ClientSessionResource } from './client-session.js' -export type { ConnectWebviewResource } from './connect-webview.js' -export type { ConnectedAccountResource } from './connected-account.js' -export type { CustomerResource } from './customer.js' -export type { CustomerPortalResource } from './customer-portal.js' -export type { CustomizationProfileResource } from './customization-profile.js' -export type { DeviceResource } from './device.js' -export type { DeviceProviderResource } from './device-provider.js' -export type { EnrollmentAutomationResource } from './enrollment-automation.js' -export type { EventResource } from './event.js' -export type { InstantKeyResource } from './instant-key.js' -export type { MagicLinkResource } from './magic-link.js' -export type { NoiseThresholdResource } from './noise-threshold.js' -export type { PhoneResource } from './phone.js' -export type { PhoneSessionResource } from './phone-session.js' -export type { SpaceResource } from './space.js' -export type { StaffMemberResource } from './staff-member.js' -export type { ThermostatDailyProgramResource } from './thermostat-daily-program.js' -export type { ThermostatScheduleResource } from './thermostat-schedule.js' -export type { UnknownResource } from './unknown.js' -export type { UnmanagedAccessCodeResource } from './unmanaged-access-code.js' -export type { UnmanagedAcsAccessGroupResource } from './unmanaged-acs-access-group.js' -export type { UnmanagedAcsCredentialResource } from './unmanaged-acs-credential.js' -export type { UnmanagedAcsUserResource } from './unmanaged-acs-user.js' -export type { UnmanagedDeviceResource } from './unmanaged-device.js' -export type { UserIdentityResource } from './user-identity.js' -export type { WebhookResource } from './webhook.js' -export type { WorkspaceResource } from './workspace.js' +export type { AccessCode } from './access-code.js' +export type { AccessGrant } from './access-grant.js' +export type { AccessMethod } from './access-method.js' +export type { AcsAccessGroup } from './acs-access-group.js' +export type { AcsCredential } from './acs-credential.js' +export type { AcsEncoder } from './acs-encoder.js' +export type { AcsEntrance } from './acs-entrance.js' +export type { AcsSystem } from './acs-system.js' +export type { AcsUser } from './acs-user.js' +export type { ActionAttempt } from './action-attempt.js' +export type { Batch } from './batch.js' +export type { ClientSession } from './client-session.js' +export type { ConnectWebview } from './connect-webview.js' +export type { ConnectedAccount } from './connected-account.js' +export type { CustomerPortal } from './customer-portal.js' +export type { Device } from './device.js' +export type { DeviceProvider } from './device-provider.js' +export type { SeamEvent } from './event.js' +export type { InstantKey } from './instant-key.js' +export type { NoiseThreshold } from './noise-threshold.js' +export type { Phone } from './phone.js' +export type { Space } from './space.js' +export type { ThermostatDailyProgram } from './thermostat-daily-program.js' +export type { ThermostatSchedule } from './thermostat-schedule.js' +export type { UnmanagedAccessCode } from './unmanaged-access-code.js' +export type { UnmanagedAccessGrant } from './unmanaged-access-grant.js' +export type { UnmanagedAccessMethod } from './unmanaged-access-method.js' +export type { UnmanagedDevice } from './unmanaged-device.js' +export type { UnmanagedUserIdentity } from './unmanaged-user-identity.js' +export type { UserIdentity } from './user-identity.js' +export type { Webhook } from './webhook.js' +export type { Workspace } from './workspace.js' diff --git a/src/lib/seam/connect/resources/instant-key.ts b/src/lib/seam/connect/resources/instant-key.ts index 25773d4b..917f15e6 100644 --- a/src/lib/seam/connect/resources/instant-key.ts +++ b/src/lib/seam/connect/resources/instant-key.ts @@ -3,7 +3,7 @@ * Do not edit this file. */ -export type InstantKeyResource = { +export type InstantKey = { client_session_id: string created_at: string diff --git a/src/lib/seam/connect/resources/magic-link.ts b/src/lib/seam/connect/resources/magic-link.ts deleted file mode 100644 index 1f785ba3..00000000 --- a/src/lib/seam/connect/resources/magic-link.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file. - */ - -export type MagicLinkResource = { - created_at: string - - customer_key: string - - expires_at: string - - url: string - - workspace_id: string -} diff --git a/src/lib/seam/connect/resources/noise-threshold.ts b/src/lib/seam/connect/resources/noise-threshold.ts index dd398aed..ba6b6b5b 100644 --- a/src/lib/seam/connect/resources/noise-threshold.ts +++ b/src/lib/seam/connect/resources/noise-threshold.ts @@ -3,7 +3,7 @@ * Do not edit this file. */ -export type NoiseThresholdResource = { +export type NoiseThreshold = { device_id: string ends_daily_at: string diff --git a/src/lib/seam/connect/resources/phone-session.ts b/src/lib/seam/connect/resources/phone-session.ts deleted file mode 100644 index 88e17a9b..00000000 --- a/src/lib/seam/connect/resources/phone-session.ts +++ /dev/null @@ -1,300 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file. - */ - -export type PhoneSessionResource = { - is_sandbox_workspace: boolean - - provider_sessions: Array<{ - acs_credentials: Array<{ - access_method: 'code' | 'card' | 'mobile_key' | 'cloud_key' - - acs_credential_id: string | null - acs_credential_pool_id?: string | undefined - acs_entrances: Array<{ - acs_entrance_id: string - - acs_system_id: string - - akiles_metadata?: - | { - actions?: - | Array<{ - id?: string | undefined - name?: string | undefined - }> - | undefined - gadget_id?: string | undefined - site_id?: string | undefined - site_name?: string | undefined - } - | undefined - assa_abloy_vostio_metadata?: - | { - door_name?: string | undefined - door_number?: number | undefined - door_type?: - | 'CommonDoor' - | 'EntranceDoor' - | 'GuestDoor' - | 'Elevator' - | undefined - pms_id?: string | undefined - stand_open?: boolean | undefined - } - | undefined - avigilon_alta_metadata?: - | { - entry_name?: string | undefined - entry_relays_total_count?: number | undefined - org_name?: string | undefined - site_id?: number | undefined - site_name?: string | undefined - zone_id?: number | undefined - zone_name?: string | undefined - } - | undefined - brivo_metadata?: - | { - access_point_id?: string | undefined - site_id?: number | undefined - site_name?: string | undefined - } - | undefined - can_belong_to_reservation?: boolean | undefined - can_unlock_with_card?: boolean | undefined - can_unlock_with_cloud_key?: boolean | undefined - can_unlock_with_code?: boolean | undefined - can_unlock_with_mobile_key?: boolean | undefined - connected_account_id: string - - created_at: string - - display_name: string - - dormakaba_ambiance_metadata?: - | { - access_point_name?: string | undefined - } - | undefined - dormakaba_community_metadata?: - | { - access_point_profile?: string | undefined - } - | undefined - errors: Array<{ - created_at: string - - error_code: string - - message: string - }> - - hotek_metadata?: - | { - common_area_name?: string | undefined - common_area_number?: string | undefined - room_number?: string | undefined - } - | undefined - is_locked?: boolean | undefined - latch_metadata?: - | { - accessibility_type?: string | undefined - door_name?: string | undefined - door_type?: string | undefined - is_connected?: boolean | undefined - } - | undefined - salto_ks_metadata?: - | { - battery_level?: string | undefined - door_name?: string | undefined - intrusion_alarm?: boolean | undefined - left_open_alarm?: boolean | undefined - lock_type?: string | undefined - locked_state?: string | undefined - online?: boolean | undefined - privacy_mode?: boolean | undefined - } - | undefined - salto_space_metadata?: - | { - audit_on_keys?: boolean | undefined - door_description?: string | undefined - door_id?: string | undefined - door_name?: string | undefined - room_description?: string | undefined - room_name?: string | undefined - } - | undefined - space_ids: Array - - visionline_metadata?: - | { - door_category?: - | 'entrance' - | 'guest' - | 'elevator reader' - | 'common' - | 'common (PMS)' - | undefined - door_name?: string | undefined - profiles?: - | Array<{ - visionline_door_profile_id?: string | undefined - visionline_door_profile_type?: - 'BLE' | 'commonDoor' | 'touch' | undefined - }> - | undefined - } - | undefined - warnings: Array<{ - created_at: string - - message: string - - warning_code: - | 'salto_ks_entrance_access_code_support_removed' - | 'entrance_shares_zone' - | 'entrance_setup_required' - | 'salto_ks_privacy_mode' - | 'privacy_mode' - }> - }> - - acs_system_id: string - - acs_user_id?: string | undefined - assa_abloy_vostio_metadata?: - | { - auto_join?: boolean | undefined - door_names?: Array | undefined - endpoint_id?: string | undefined - key_id?: string | undefined - key_issuing_request_id?: string | undefined - override_guest_acs_entrance_ids?: Array | undefined - } - | undefined - card_number?: string | null | undefined - code?: string | null | undefined - connected_account_id: string - - created_at: string - - display_name: string - - ends_at?: string | undefined - errors: Array<{ - created_at: string - - error_code: string - - message: string - }> - - external_type?: - | 'pti_card' - | 'brivo_credential' - | 'hid_credential' - | 'visionline_card' - | 'salto_ks_credential' - | 'assa_abloy_vostio_key' - | 'salto_space_key' - | 'latch_access' - | 'dormakaba_ambiance_credential' - | 'hotek_card' - | 'salto_ks_tag' - | 'avigilon_alta_credential' - | 'kisi_credential' - | undefined - external_type_display_name?: string | undefined - is_issued?: boolean | undefined - is_latest_desired_state_synced_with_provider?: boolean | null | undefined - is_managed: boolean - - is_multi_phone_sync_credential?: boolean | undefined - is_one_time_use?: boolean | undefined - issued_at?: string | null | undefined - latest_desired_state_synced_with_provider_at?: string | null | undefined - parent_acs_credential_id?: string | undefined - starts_at?: string | undefined - user_identity_id?: string | undefined - visionline_metadata?: - | { - auto_join?: boolean | undefined - card_function_type?: 'guest' | 'staff' | undefined - card_id?: string | undefined - common_acs_entrance_ids?: Array | undefined - credential_id?: string | undefined - guest_acs_entrance_ids?: Array | undefined - is_valid?: boolean | undefined - joiner_acs_credential_ids?: Array | undefined - } - | undefined - warnings: Array<{ - created_at: string - - message: string - - warning_code: - | 'waiting_to_be_issued' - | 'schedule_externally_modified' - | 'schedule_modified' - | 'being_deleted' - | 'unknown_issue_with_acs_credential' - | 'needs_to_be_reissued' - }> - - workspace_id: string - }> - - phone_registration: { - is_being_activated: boolean - - phone_registration_id: string - - provider_name: string | null - } - }> - - user_identity: { - acs_user_ids: Array - - created_at: string - - display_name: string - - email_address: string | null - errors: Array<{ - acs_system_id: string - - acs_user_id: string - - created_at: string - - error_code: 'issue_with_acs_user' - - message: string - }> - - full_name: string | null - phone_number: string | null - user_identity_id: string - - user_identity_key: string | null - warnings: Array<{ - created_at: string - - message: string - - warning_code: - 'being_deleted' | 'acs_user_profile_does_not_match_user_identity' - }> - - workspace_id: string - } - - workspace_id: string -} diff --git a/src/lib/seam/connect/resources/phone.ts b/src/lib/seam/connect/resources/phone.ts index 02224d24..8ea83190 100644 --- a/src/lib/seam/connect/resources/phone.ts +++ b/src/lib/seam/connect/resources/phone.ts @@ -3,7 +3,7 @@ * Do not edit this file. */ -export type PhoneResource = { +export type Phone = { created_at: string custom_metadata: Record diff --git a/src/lib/seam/connect/resources/space.ts b/src/lib/seam/connect/resources/space.ts index a7c5bfeb..1c3f3c8c 100644 --- a/src/lib/seam/connect/resources/space.ts +++ b/src/lib/seam/connect/resources/space.ts @@ -3,7 +3,7 @@ * Do not edit this file. */ -export type SpaceResource = { +export type Space = { acs_entrance_count: number created_at: string @@ -31,8 +31,6 @@ export type SpaceResource = { | undefined name: string - parent_space_id?: string | undefined - parent_space_key?: string | undefined space_id: string space_key?: string | undefined diff --git a/src/lib/seam/connect/resources/staff-member.ts b/src/lib/seam/connect/resources/staff-member.ts deleted file mode 100644 index a0edc7ab..00000000 --- a/src/lib/seam/connect/resources/staff-member.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file. - */ - -export type StaffMemberResource = { - building_keys?: Array | undefined - common_area_keys?: Array | undefined - email_address?: string | undefined - facility_keys?: Array | undefined - listing_keys?: Array | undefined - name: string - - phone_number?: string | undefined - property_keys?: Array | undefined - property_listing_keys?: Array | undefined - room_keys?: Array | undefined - site_keys?: Array | undefined - space_keys?: Array | undefined - staff_member_key: string - - unit_keys?: Array | undefined -} diff --git a/src/lib/seam/connect/resources/thermostat-daily-program.ts b/src/lib/seam/connect/resources/thermostat-daily-program.ts index 9f4f9eec..28092a2c 100644 --- a/src/lib/seam/connect/resources/thermostat-daily-program.ts +++ b/src/lib/seam/connect/resources/thermostat-daily-program.ts @@ -3,7 +3,7 @@ * Do not edit this file. */ -export type ThermostatDailyProgramResource = { +export type ThermostatDailyProgram = { created_at: string device_id: string diff --git a/src/lib/seam/connect/resources/thermostat-schedule.ts b/src/lib/seam/connect/resources/thermostat-schedule.ts index 5a249354..18469c12 100644 --- a/src/lib/seam/connect/resources/thermostat-schedule.ts +++ b/src/lib/seam/connect/resources/thermostat-schedule.ts @@ -3,7 +3,7 @@ * Do not edit this file. */ -export type ThermostatScheduleResource = { +export type ThermostatSchedule = { climate_preset_key: string created_at: string diff --git a/src/lib/seam/connect/resources/unknown.ts b/src/lib/seam/connect/resources/unknown.ts deleted file mode 100644 index 47d0b791..00000000 --- a/src/lib/seam/connect/resources/unknown.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file. - */ - -export type UnknownResource = Record diff --git a/src/lib/seam/connect/resources/unmanaged-access-code.ts b/src/lib/seam/connect/resources/unmanaged-access-code.ts index 283e03ce..2e65576f 100644 --- a/src/lib/seam/connect/resources/unmanaged-access-code.ts +++ b/src/lib/seam/connect/resources/unmanaged-access-code.ts @@ -3,7 +3,7 @@ * Do not edit this file. */ -export type UnmanagedAccessCodeResource = { +export type UnmanagedAccessCode = { access_code_id: string cannot_be_managed?: boolean | undefined diff --git a/src/lib/seam/connect/resources/unmanaged-access-grant.ts b/src/lib/seam/connect/resources/unmanaged-access-grant.ts new file mode 100644 index 00000000..21751075 --- /dev/null +++ b/src/lib/seam/connect/resources/unmanaged-access-grant.ts @@ -0,0 +1,164 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file. + */ + +export type UnmanagedAccessGrant = { + access_grant_id: string + + access_method_ids: Array + + created_at: string + + display_name: string + + ends_at: string | null + errors: Array<{ + created_at: string + + error_code: 'cannot_create_requested_access_methods' + + message: string + + missing_device_ids?: Array | undefined + }> + + location_ids: Array + + name: string | null + pending_mutations: Array< + | { + created_at: string + + from: { + device_ids: Array + } + + message: string + + mutation_code: 'updating_spaces' + + to: { + common_code_key?: string | null | undefined + device_ids: Array + } + } + | { + access_method_ids: Array + + created_at: string + + from: { + ends_at: string | null + starts_at: string | null + } + + message: string + + mutation_code: 'updating_access_times' + + to: { + ends_at: string | null + starts_at: string | null + } + } + > + + requested_access_methods: Array<{ + code?: string | undefined + created_access_method_ids: Array + + created_at: string + + display_name: string + + instant_key_max_use_count?: number | undefined + mode: 'code' | 'card' | 'mobile_key' | 'cloud_key' + }> + + reservation_key?: string | undefined + space_ids: Array + + starts_at: string + + user_identity_id?: string | undefined + warnings: Array< + | { + created_at: string + + message: string + + warning_code: 'being_deleted' + } + | { + created_at: string + + message: string + + warning_code: 'underprovisioned_access' + } + | { + created_at: string + + failed_devices?: + | Array<{ + device_id: string + + error_code: string + + message: string + }> + | undefined + message: string + + warning_code: 'overprovisioned_access' + } + | { + access_method_ids: Array + + created_at: string + + message: string + + warning_code: 'updating_access_times' + } + | { + created_at: string + + device_id: string + + message: string + + new_code: string + + original_code: string + + warning_code: 'requested_code_unavailable' + } + | { + created_at: string + + device_id: string + + message: string + + warning_code: 'device_does_not_support_access_codes' + } + | { + created_at: string + + device_id: string + + message: string + + reason: + | 'duration_exceeds_max' + | 'times_do_not_match_slots' + | 'ongoing_not_supported' + + warning_code: 'device_time_constraints_violated' + } + > + + workspace_id: string +} diff --git a/src/lib/seam/connect/resources/unmanaged-access-method.ts b/src/lib/seam/connect/resources/unmanaged-access-method.ts new file mode 100644 index 00000000..7fc93d8c --- /dev/null +++ b/src/lib/seam/connect/resources/unmanaged-access-method.ts @@ -0,0 +1,114 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file. + */ + +export type UnmanagedAccessMethod = { + access_method_id: string + + code?: string | null | undefined + created_at: string + + display_name: string + + errors: Array<{ + created_at: string + + error_code: 'failed_to_issue' + + message: string + }> + + is_assignment_required?: boolean | undefined + is_encoding_required?: boolean | undefined + is_issued: boolean + + is_ready_for_assignment?: boolean | undefined + is_ready_for_encoding?: boolean | undefined + issued_at: string | null + mode: 'code' | 'card' | 'mobile_key' | 'cloud_key' + + pending_mutations: Array< + | { + created_at: string + + from: { + device_ids: Array + } + + message: string + + mutation_code: 'provisioning_access' + + to: { + device_ids: Array + } + } + | { + created_at: string + + from: { + device_ids: Array + } + + message: string + + mutation_code: 'revoking_access' + + to: { + device_ids: Array + } + } + | { + created_at: string + + from: { + ends_at: string | null + starts_at: string | null + } + + message: string + + mutation_code: 'updating_access_times' + + to: { + ends_at: string | null + starts_at: string | null + } + } + > + + warnings: Array< + | { + created_at: string + + message: string + + warning_code: 'being_deleted' + } + | { + created_at: string + + message: string + + warning_code: 'updating_access_times' + } + | { + created_at: string + + message: string + + original_access_method_id?: string | undefined + warning_code: 'pulled_backup_access_code' + } + | { + created_at: string + + message: string + + warning_code: 'delay_in_issuing' + } + > + + workspace_id: string +} diff --git a/src/lib/seam/connect/resources/unmanaged-acs-access-group.ts b/src/lib/seam/connect/resources/unmanaged-acs-access-group.ts deleted file mode 100644 index 646ed692..00000000 --- a/src/lib/seam/connect/resources/unmanaged-acs-access-group.ts +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file. - */ - -export type UnmanagedAcsAccessGroupResource = { - access_group_type: - | 'pti_unit' - | 'pti_access_level' - | 'salto_ks_access_group' - | 'brivo_group' - | 'salto_space_group' - | 'dormakaba_community_access_group' - | 'dormakaba_ambiance_access_group' - | 'avigilon_alta_group' - | 'kisi_access_group' - | 'akiles_member_group' - - access_group_type_display_name: string - - access_schedule?: - | { - ends_at: string | null - starts_at: string - } - | undefined - acs_access_group_id: string - - acs_system_id: string - - connected_account_id: string - - created_at: string - - display_name: string - - errors: Array<{ - created_at: string - - error_code: 'failed_to_create_on_acs_system' - - message: string - }> - - external_type: - | 'pti_unit' - | 'pti_access_level' - | 'salto_ks_access_group' - | 'brivo_group' - | 'salto_space_group' - | 'dormakaba_community_access_group' - | 'dormakaba_ambiance_access_group' - | 'avigilon_alta_group' - | 'kisi_access_group' - | 'akiles_member_group' - - external_type_display_name: string - - is_managed: boolean - - name: string - - pending_mutations: Array< - | { - created_at: string - - message: string - - mutation_code: 'creating' - } - | { - created_at: string - - message: string - - mutation_code: 'deleting' - } - | { - created_at: string - - message: string - - mutation_code: 'deferring_deletion' - } - | { - created_at: string - - from: { - name?: string | null | undefined - } - - message: string - - mutation_code: 'updating_group_information' - - to: { - name?: string | null | undefined - } - } - | { - created_at: string - - from: { - ends_at: string | null - starts_at: string | null - } - - message: string - - mutation_code: 'updating_access_schedule' - - to: { - ends_at: string | null - starts_at: string | null - } - } - | { - created_at: string - - from: { - acs_user_id: string | null - } - - message: string - - mutation_code: 'updating_user_membership' - - to: { - acs_user_id: string | null - } - } - | { - created_at: string - - from: { - acs_entrance_id: string | null - } - - message: string - - mutation_code: 'updating_entrance_membership' - - to: { - acs_entrance_id: string | null - } - } - | { - acs_user_id: string - - created_at: string - - message: string - - mutation_code: 'deferring_user_membership_update' - - variant: 'adding' | 'removing' - } - > - - warnings: Array<{ - created_at: string - - message: string - - warning_code: 'unknown_issue_with_acs_access_group' | 'being_deleted' - }> - - workspace_id: string -} diff --git a/src/lib/seam/connect/resources/unmanaged-acs-credential.ts b/src/lib/seam/connect/resources/unmanaged-acs-credential.ts deleted file mode 100644 index e5e2a629..00000000 --- a/src/lib/seam/connect/resources/unmanaged-acs-credential.ts +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file. - */ - -export type UnmanagedAcsCredentialResource = { - access_method: 'code' | 'card' | 'mobile_key' | 'cloud_key' - - acs_credential_id: string - - acs_credential_pool_id?: string | undefined - acs_system_id: string - - acs_user_id?: string | undefined - assa_abloy_vostio_metadata?: - | { - auto_join?: boolean | undefined - door_names?: Array | undefined - endpoint_id?: string | undefined - key_id?: string | undefined - key_issuing_request_id?: string | undefined - override_guest_acs_entrance_ids?: Array | undefined - } - | undefined - card_number?: string | null | undefined - code?: string | null | undefined - connected_account_id: string - - created_at: string - - display_name: string - - ends_at?: string | undefined - errors: Array<{ - created_at: string - - error_code: string - - message: string - }> - - external_type?: - | 'pti_card' - | 'brivo_credential' - | 'hid_credential' - | 'visionline_card' - | 'salto_ks_credential' - | 'assa_abloy_vostio_key' - | 'salto_space_key' - | 'latch_access' - | 'dormakaba_ambiance_credential' - | 'hotek_card' - | 'salto_ks_tag' - | 'avigilon_alta_credential' - | 'kisi_credential' - | undefined - external_type_display_name?: string | undefined - is_issued?: boolean | undefined - is_latest_desired_state_synced_with_provider?: boolean | null | undefined - is_managed: boolean - - is_multi_phone_sync_credential?: boolean | undefined - is_one_time_use?: boolean | undefined - issued_at?: string | null | undefined - latest_desired_state_synced_with_provider_at?: string | null | undefined - parent_acs_credential_id?: string | undefined - starts_at?: string | undefined - user_identity_id?: string | undefined - visionline_metadata?: - | { - auto_join?: boolean | undefined - card_function_type?: 'guest' | 'staff' | undefined - card_id?: string | undefined - common_acs_entrance_ids?: Array | undefined - credential_id?: string | undefined - guest_acs_entrance_ids?: Array | undefined - is_valid?: boolean | undefined - joiner_acs_credential_ids?: Array | undefined - } - | undefined - warnings: Array< - | { - created_at: string - - message: string - - warning_code: 'waiting_to_be_issued' - } - | { - created_at: string - - message: string - - warning_code: 'schedule_externally_modified' - } - | { - created_at: string - - message: string - - warning_code: 'schedule_modified' - } - | { - created_at: string - - message: string - - warning_code: 'being_deleted' - } - | { - created_at: string - - message: string - - warning_code: 'unknown_issue_with_acs_credential' - } - | { - created_at: string - - message: string - - warning_code: 'needs_to_be_reissued' - } - > - - workspace_id: string -} diff --git a/src/lib/seam/connect/resources/unmanaged-acs-user.ts b/src/lib/seam/connect/resources/unmanaged-acs-user.ts deleted file mode 100644 index 0ae56d27..00000000 --- a/src/lib/seam/connect/resources/unmanaged-acs-user.ts +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file. - */ - -export type UnmanagedAcsUserResource = { - access_schedule?: - | { - ends_at: string | null - starts_at: string - } - | undefined - acs_system_id: string - - acs_user_id: string - - connected_account_id: string - - created_at: string - - display_name: string - - email?: string | undefined - email_address?: string | undefined - errors: Array< - | { - created_at: string - - error_code: 'deleted_externally' - - message: string - } - | { - created_at: string - - error_code: 'salto_ks_subscription_limit_exceeded' - - message: string - } - | { - created_at: string - - error_code: 'failed_to_create_on_acs_system' - - message: string - } - | { - created_at: string - - error_code: 'failed_to_update_on_acs_system' - - message: string - } - | { - created_at: string - - error_code: 'failed_to_delete_on_acs_system' - - message: string - } - | { - created_at: string - - error_code: 'latch_conflict_with_resident_user' - - message: string - } - > - - external_type?: - | 'pti_user' - | 'brivo_user' - | 'hid_credential_manager_user' - | 'salto_site_user' - | 'latch_user' - | 'dormakaba_community_user' - | 'salto_space_user' - | 'avigilon_alta_user' - | 'kisi_user' - | undefined - external_type_display_name?: string | undefined - full_name?: string | undefined - hid_acs_system_id?: string | undefined - is_managed: boolean - - is_suspended?: boolean | undefined - last_successful_sync_at: string | null - pending_mutations?: - | Array< - | { - created_at: string - - message: string - - mutation_code: 'creating' - } - | { - created_at: string - - message: string - - mutation_code: 'deleting' - } - | { - created_at: string - - message: string - - mutation_code: 'deferring_creation' - - scheduled_at?: string | null | undefined - } - | { - created_at: string - - from: { - email_address?: string | null | undefined - full_name?: string | null | undefined - phone_number?: string | null | undefined - } - - message: string - - mutation_code: 'updating_user_information' - - to: { - email_address?: string | null | undefined - full_name?: string | null | undefined - phone_number?: string | null | undefined - } - } - | { - created_at: string - - from: { - ends_at: string | null - starts_at: string | null - } - - message: string - - mutation_code: 'updating_access_schedule' - - to: { - ends_at: string | null - starts_at: string | null - } - } - | { - created_at: string - - from: { - is_suspended: boolean - } - - message: string - - mutation_code: 'updating_suspension_state' - - to: { - is_suspended: boolean - } - } - | { - created_at: string - - from: { - acs_access_group_id: string | null - } - - message: string - - mutation_code: 'updating_group_membership' - - to: { - acs_access_group_id: string | null - } - } - | { - acs_access_group_id: string - - created_at: string - - message: string - - mutation_code: 'deferring_group_membership_update' - - variant: 'adding' | 'removing' - } - | { - created_at: string - - from: { - acs_credential_id: string | null - } - - message: string - - mutation_code: 'updating_credential_assignment' - - to: { - acs_credential_id: string | null - } - } - > - | undefined - phone_number?: string | undefined - salto_ks_metadata?: - | { - is_subscribed?: boolean | undefined - } - | undefined - salto_space_metadata?: - | { - audit_openings?: boolean | undefined - user_id?: string | undefined - } - | undefined - user_identity_email_address?: string | null | undefined - user_identity_full_name?: string | null | undefined - user_identity_id?: string | undefined - user_identity_phone_number?: string | null | undefined - warnings: Array< - | { - created_at: string - - message: string - - warning_code: 'being_deleted' - } - | { - created_at: string - - message: string - - warning_code: 'salto_ks_user_not_subscribed' - } - | { - created_at: string - - message: string - - warning_code: 'acs_user_inactive' - } - | { - created_at: string - - message: string - - warning_code: 'unknown_issue_with_acs_user' - } - | { - created_at: string - - message: string - - warning_code: 'latch_resident_user' - } - > - - workspace_id: string -} diff --git a/src/lib/seam/connect/resources/unmanaged-device.ts b/src/lib/seam/connect/resources/unmanaged-device.ts index e94e16f4..0f81a78a 100644 --- a/src/lib/seam/connect/resources/unmanaged-device.ts +++ b/src/lib/seam/connect/resources/unmanaged-device.ts @@ -3,7 +3,7 @@ * Do not edit this file. */ -export type UnmanagedDeviceResource = { +export type UnmanagedDevice = { can_configure_auto_lock?: boolean | undefined can_hvac_cool?: boolean | undefined can_hvac_heat?: boolean | undefined diff --git a/src/lib/seam/connect/resources/unmanaged-user-identity.ts b/src/lib/seam/connect/resources/unmanaged-user-identity.ts new file mode 100644 index 00000000..d79c80e2 --- /dev/null +++ b/src/lib/seam/connect/resources/unmanaged-user-identity.ts @@ -0,0 +1,48 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file. + */ + +export type UnmanagedUserIdentity = { + acs_user_ids: Array + + created_at: string + + display_name: string + + email_address: string | null + errors: Array<{ + acs_system_id: string + + acs_user_id: string + + created_at: string + + error_code: 'issue_with_acs_user' + + message: string + }> + + full_name: string | null + phone_number: string | null + user_identity_id: string + + warnings: Array< + | { + created_at: string + + message: string + + warning_code: 'being_deleted' + } + | { + created_at: string + + message: string + + warning_code: 'acs_user_profile_does_not_match_user_identity' + } + > + + workspace_id: string +} diff --git a/src/lib/seam/connect/resources/user-identity.ts b/src/lib/seam/connect/resources/user-identity.ts index e8f6b302..84e47704 100644 --- a/src/lib/seam/connect/resources/user-identity.ts +++ b/src/lib/seam/connect/resources/user-identity.ts @@ -3,7 +3,7 @@ * Do not edit this file. */ -export type UserIdentityResource = { +export type UserIdentity = { acs_user_ids: Array created_at: string diff --git a/src/lib/seam/connect/resources/webhook.ts b/src/lib/seam/connect/resources/webhook.ts index e64b9d88..b1d90b5b 100644 --- a/src/lib/seam/connect/resources/webhook.ts +++ b/src/lib/seam/connect/resources/webhook.ts @@ -3,7 +3,7 @@ * Do not edit this file. */ -export type WebhookResource = { +export type Webhook = { event_types?: Array | undefined secret?: string | undefined url: string diff --git a/src/lib/seam/connect/resources/workspace.ts b/src/lib/seam/connect/resources/workspace.ts index df5e9203..c8a58452 100644 --- a/src/lib/seam/connect/resources/workspace.ts +++ b/src/lib/seam/connect/resources/workspace.ts @@ -3,7 +3,7 @@ * Do not edit this file. */ -export type WorkspaceResource = { +export type Workspace = { company_name: string connect_partner_name: string | null diff --git a/src/lib/seam/connect/routes/access-codes/access-codes.ts b/src/lib/seam/connect/routes/access-codes/access-codes.ts index 43cd74d4..310d1729 100644 --- a/src/lib/seam/connect/routes/access-codes/access-codes.ts +++ b/src/lib/seam/connect/routes/access-codes/access-codes.ts @@ -3,8 +3,6 @@ * 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, @@ -31,7 +29,7 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { AccessCodeResource } from 'lib/seam/connect/resources/access-code.js' +import type { AccessCode } from 'lib/seam/connect/resources/access-code.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' @@ -239,24 +237,6 @@ export class SeamHttpAccessCodes { }) } - getTimeline( - parameters: AccessCodesGetTimelineParameters, - options: AccessCodesGetTimelineOptions = {}, - ): AccessCodesGetTimelineRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/access_codes/get_timeline', - method: 'POST', - body: parameters, - responseKey: 'timeline_events', - options, - }) - } - list( parameters?: AccessCodesListParameters, options: AccessCodesListOptions = {}, @@ -339,20 +319,14 @@ export type AccessCodesCreateParameters = { prefer_native_scheduling?: boolean | undefined preferred_code_length?: number | undefined starts_at?: string | undefined - sync?: boolean | undefined use_backup_access_code_pool?: boolean | undefined use_offline_access_code?: boolean | undefined } -/** - * @deprecated Use AccessCodesCreateParameters instead. - */ -export type AccessCodesCreateBody = AccessCodesCreateParameters - /** * @deprecated Use AccessCodesCreateRequest instead. */ -export type AccessCodesCreateResponse = { access_code: AccessCodeResource } +export type AccessCodesCreateResponse = { access_code: AccessCode } export type AccessCodesCreateRequest = SeamHttpRequest< AccessCodesCreateResponse, @@ -378,16 +352,11 @@ export type AccessCodesCreateMultipleParameters = { use_backup_access_code_pool?: boolean | undefined } -/** - * @deprecated Use AccessCodesCreateMultipleParameters instead. - */ -export type AccessCodesCreateMultipleBody = AccessCodesCreateMultipleParameters - /** * @deprecated Use AccessCodesCreateMultipleRequest instead. */ export type AccessCodesCreateMultipleResponse = { - access_codes: Array + access_codes: Array } export type AccessCodesCreateMultipleRequest = SeamHttpRequest< @@ -401,14 +370,8 @@ export type AccessCodesDeleteParameters = { access_code_id: string device_id?: string | undefined - sync?: boolean | undefined } -/** - * @deprecated Use AccessCodesDeleteParameters instead. - */ -export type AccessCodesDeleteParams = AccessCodesDeleteParameters - /** * @deprecated Use AccessCodesDeleteRequest instead. */ @@ -422,17 +385,10 @@ export type AccessCodesGenerateCodeParameters = { device_id: string } -/** - * @deprecated Use AccessCodesGenerateCodeParameters instead. - */ -export type AccessCodesGenerateCodeParams = AccessCodesGenerateCodeParameters - /** * @deprecated Use AccessCodesGenerateCodeRequest instead. */ -export type AccessCodesGenerateCodeResponse = { - generated_code: AccessCodeResource -} +export type AccessCodesGenerateCodeResponse = { generated_code: AccessCode } export type AccessCodesGenerateCodeRequest = SeamHttpRequest< AccessCodesGenerateCodeResponse, @@ -447,15 +403,10 @@ export type AccessCodesGetParameters = { device_id?: string | undefined } -/** - * @deprecated Use AccessCodesGetParameters instead. - */ -export type AccessCodesGetParams = AccessCodesGetParameters - /** * @deprecated Use AccessCodesGetRequest instead. */ -export type AccessCodesGetResponse = { access_code: AccessCodeResource } +export type AccessCodesGetResponse = { access_code: AccessCode } export type AccessCodesGetRequest = SeamHttpRequest< AccessCodesGetResponse, @@ -464,27 +415,6 @@ export type AccessCodesGetRequest = SeamHttpRequest< export interface AccessCodesGetOptions {} -export type AccessCodesGetTimelineParameters = - RouteRequestBody<'/access_codes/get_timeline'> - -/** - * @deprecated Use AccessCodesGetTimelineParameters instead. - */ -export type AccessCodesGetTimelineParams = AccessCodesGetTimelineParameters - -/** - * @deprecated Use AccessCodesGetTimelineRequest instead. - */ -export type AccessCodesGetTimelineResponse = - RouteResponse<'/access_codes/get_timeline'> - -export type AccessCodesGetTimelineRequest = SeamHttpRequest< - AccessCodesGetTimelineResponse, - 'timeline_events' -> - -export interface AccessCodesGetTimelineOptions {} - export type AccessCodesListParameters = { access_code_ids?: Array | undefined access_grant_id?: string | undefined @@ -498,17 +428,10 @@ export type AccessCodesListParameters = { user_identifier_key?: string | undefined } -/** - * @deprecated Use AccessCodesListParameters instead. - */ -export type AccessCodesListParams = AccessCodesListParameters - /** * @deprecated Use AccessCodesListRequest instead. */ -export type AccessCodesListResponse = { - access_codes: Array -} +export type AccessCodesListResponse = { access_codes: Array } export type AccessCodesListRequest = SeamHttpRequest< AccessCodesListResponse, @@ -521,17 +444,11 @@ export type AccessCodesPullBackupAccessCodeParameters = { access_code_id: string } -/** - * @deprecated Use AccessCodesPullBackupAccessCodeParameters instead. - */ -export type AccessCodesPullBackupAccessCodeBody = - AccessCodesPullBackupAccessCodeParameters - /** * @deprecated Use AccessCodesPullBackupAccessCodeRequest instead. */ export type AccessCodesPullBackupAccessCodeResponse = { - access_code: AccessCodeResource + access_code: AccessCode } export type AccessCodesPullBackupAccessCodeRequest = SeamHttpRequest< @@ -549,12 +466,6 @@ export type AccessCodesReportDeviceConstraintsParameters = { supported_code_lengths?: Array | undefined } -/** - * @deprecated Use AccessCodesReportDeviceConstraintsParameters instead. - */ -export type AccessCodesReportDeviceConstraintsBody = - AccessCodesReportDeviceConstraintsParameters - /** * @deprecated Use AccessCodesReportDeviceConstraintsRequest instead. */ @@ -584,17 +495,11 @@ export type AccessCodesUpdateParameters = { prefer_native_scheduling?: boolean | undefined preferred_code_length?: number | undefined starts_at?: string | undefined - sync?: boolean | undefined type?: 'ongoing' | 'time_bound' | undefined use_backup_access_code_pool?: boolean | undefined use_offline_access_code?: boolean | undefined } -/** - * @deprecated Use AccessCodesUpdateParameters instead. - */ -export type AccessCodesUpdateBody = AccessCodesUpdateParameters - /** * @deprecated Use AccessCodesUpdateRequest instead. */ @@ -612,11 +517,6 @@ export type AccessCodesUpdateMultipleParameters = { starts_at?: string | undefined } -/** - * @deprecated Use AccessCodesUpdateMultipleParameters instead. - */ -export type AccessCodesUpdateMultipleBody = AccessCodesUpdateMultipleParameters - /** * @deprecated Use AccessCodesUpdateMultipleRequest instead. */ diff --git a/src/lib/seam/connect/routes/access-codes/simulate/simulate.ts b/src/lib/seam/connect/routes/access-codes/simulate/simulate.ts index 4a24f48d..511ce87e 100644 --- a/src/lib/seam/connect/routes/access-codes/simulate/simulate.ts +++ b/src/lib/seam/connect/routes/access-codes/simulate/simulate.ts @@ -29,7 +29,7 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { UnmanagedAccessCodeResource } from 'lib/seam/connect/resources/unmanaged-access-code.js' +import type { UnmanagedAccessCode } from 'lib/seam/connect/resources/unmanaged-access-code.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' @@ -183,17 +183,11 @@ export type AccessCodesSimulateCreateUnmanagedAccessCodeParameters = { name: string } -/** - * @deprecated Use AccessCodesSimulateCreateUnmanagedAccessCodeParameters instead. - */ -export type AccessCodesSimulateCreateUnmanagedAccessCodeBody = - AccessCodesSimulateCreateUnmanagedAccessCodeParameters - /** * @deprecated Use AccessCodesSimulateCreateUnmanagedAccessCodeRequest instead. */ export type AccessCodesSimulateCreateUnmanagedAccessCodeResponse = { - access_code: UnmanagedAccessCodeResource + access_code: UnmanagedAccessCode } export type AccessCodesSimulateCreateUnmanagedAccessCodeRequest = diff --git a/src/lib/seam/connect/routes/access-codes/unmanaged/unmanaged.ts b/src/lib/seam/connect/routes/access-codes/unmanaged/unmanaged.ts index c1252d49..30b3d932 100644 --- a/src/lib/seam/connect/routes/access-codes/unmanaged/unmanaged.ts +++ b/src/lib/seam/connect/routes/access-codes/unmanaged/unmanaged.ts @@ -29,7 +29,7 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { UnmanagedAccessCodeResource } from 'lib/seam/connect/resources/unmanaged-access-code.js' +import type { UnmanagedAccessCode } from 'lib/seam/connect/resources/unmanaged-access-code.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' @@ -233,15 +233,8 @@ export type AccessCodesUnmanagedConvertToManagedParameters = { allow_external_modification?: boolean | undefined force?: boolean | undefined is_external_modification_allowed?: boolean | undefined - sync?: boolean | undefined } -/** - * @deprecated Use AccessCodesUnmanagedConvertToManagedParameters instead. - */ -export type AccessCodesUnmanagedConvertToManagedBody = - AccessCodesUnmanagedConvertToManagedParameters - /** * @deprecated Use AccessCodesUnmanagedConvertToManagedRequest instead. */ @@ -256,16 +249,8 @@ export interface AccessCodesUnmanagedConvertToManagedOptions {} export type AccessCodesUnmanagedDeleteParameters = { access_code_id: string - - sync?: boolean | undefined } -/** - * @deprecated Use AccessCodesUnmanagedDeleteParameters instead. - */ -export type AccessCodesUnmanagedDeleteParams = - AccessCodesUnmanagedDeleteParameters - /** * @deprecated Use AccessCodesUnmanagedDeleteRequest instead. */ @@ -281,16 +266,11 @@ export type AccessCodesUnmanagedGetParameters = { device_id?: string | undefined } -/** - * @deprecated Use AccessCodesUnmanagedGetParameters instead. - */ -export type AccessCodesUnmanagedGetParams = AccessCodesUnmanagedGetParameters - /** * @deprecated Use AccessCodesUnmanagedGetRequest instead. */ export type AccessCodesUnmanagedGetResponse = { - access_code: UnmanagedAccessCodeResource + access_code: UnmanagedAccessCode } export type AccessCodesUnmanagedGetRequest = SeamHttpRequest< @@ -309,16 +289,11 @@ export type AccessCodesUnmanagedListParameters = { user_identifier_key?: string | undefined } -/** - * @deprecated Use AccessCodesUnmanagedListParameters instead. - */ -export type AccessCodesUnmanagedListParams = AccessCodesUnmanagedListParameters - /** * @deprecated Use AccessCodesUnmanagedListRequest instead. */ export type AccessCodesUnmanagedListResponse = { - access_codes: Array + access_codes: Array } export type AccessCodesUnmanagedListRequest = SeamHttpRequest< @@ -337,12 +312,6 @@ export type AccessCodesUnmanagedUpdateParameters = { is_managed: boolean } -/** - * @deprecated Use AccessCodesUnmanagedUpdateParameters instead. - */ -export type AccessCodesUnmanagedUpdateBody = - AccessCodesUnmanagedUpdateParameters - /** * @deprecated Use AccessCodesUnmanagedUpdateRequest instead. */ diff --git a/src/lib/seam/connect/routes/access-grants/access-grants.ts b/src/lib/seam/connect/routes/access-grants/access-grants.ts index 39a03419..2afab059 100644 --- a/src/lib/seam/connect/routes/access-grants/access-grants.ts +++ b/src/lib/seam/connect/routes/access-grants/access-grants.ts @@ -29,8 +29,8 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { AccessGrantResource } from 'lib/seam/connect/resources/access-grant.js' -import type { UnknownResource } from 'lib/seam/connect/resources/unknown.js' +import type { AccessGrant } from 'lib/seam/connect/resources/access-grant.js' +import type { Batch } from 'lib/seam/connect/resources/batch.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' @@ -296,15 +296,10 @@ export type AccessGrantsCreateParameters = { starts_at?: string | undefined } -/** - * @deprecated Use AccessGrantsCreateParameters instead. - */ -export type AccessGrantsCreateBody = AccessGrantsCreateParameters - /** * @deprecated Use AccessGrantsCreateRequest instead. */ -export type AccessGrantsCreateResponse = { access_grant: AccessGrantResource } +export type AccessGrantsCreateResponse = { access_grant: AccessGrant } export type AccessGrantsCreateRequest = SeamHttpRequest< AccessGrantsCreateResponse, @@ -317,11 +312,6 @@ export type AccessGrantsDeleteParameters = { access_grant_id: string } -/** - * @deprecated Use AccessGrantsDeleteParameters instead. - */ -export type AccessGrantsDeleteParams = AccessGrantsDeleteParameters - /** * @deprecated Use AccessGrantsDeleteRequest instead. */ @@ -336,15 +326,10 @@ export type AccessGrantsGetParameters = { access_grant_key?: string | undefined } -/** - * @deprecated Use AccessGrantsGetParameters instead. - */ -export type AccessGrantsGetParams = AccessGrantsGetParameters - /** * @deprecated Use AccessGrantsGetRequest instead. */ -export type AccessGrantsGetResponse = { access_grant: AccessGrantResource } +export type AccessGrantsGetResponse = { access_grant: AccessGrant } export type AccessGrantsGetRequest = SeamHttpRequest< AccessGrantsGetResponse, @@ -382,15 +367,21 @@ export type AccessGrantsGetRelatedParameters = { | undefined } -/** - * @deprecated Use AccessGrantsGetRelatedParameters instead. - */ -export type AccessGrantsGetRelatedParams = AccessGrantsGetRelatedParameters - /** * @deprecated Use AccessGrantsGetRelatedRequest instead. */ -export type AccessGrantsGetRelatedResponse = { batch: UnknownResource } +export type AccessGrantsGetRelatedResponse = { + batch: Batch< + | 'spaces' + | 'devices' + | 'acs_entrances' + | 'connected_accounts' + | 'acs_systems' + | 'user_identities' + | 'acs_access_groups' + | 'access_methods' + > +} export type AccessGrantsGetRelatedRequest = SeamHttpRequest< AccessGrantsGetRelatedResponse, @@ -415,17 +406,10 @@ export type AccessGrantsListParameters = { user_identity_id?: string | undefined } -/** - * @deprecated Use AccessGrantsListParameters instead. - */ -export type AccessGrantsListParams = AccessGrantsListParameters - /** * @deprecated Use AccessGrantsListRequest instead. */ -export type AccessGrantsListResponse = { - access_grants: Array -} +export type AccessGrantsListResponse = { access_grants: Array } export type AccessGrantsListRequest = SeamHttpRequest< AccessGrantsListResponse, @@ -444,17 +428,11 @@ export type AccessGrantsRequestAccessMethodsParameters = { }> } -/** - * @deprecated Use AccessGrantsRequestAccessMethodsParameters instead. - */ -export type AccessGrantsRequestAccessMethodsBody = - AccessGrantsRequestAccessMethodsParameters - /** * @deprecated Use AccessGrantsRequestAccessMethodsRequest instead. */ export type AccessGrantsRequestAccessMethodsResponse = { - access_grant: AccessGrantResource + access_grant: AccessGrant } export type AccessGrantsRequestAccessMethodsRequest = SeamHttpRequest< @@ -472,11 +450,6 @@ export type AccessGrantsUpdateParameters = { starts_at?: string | undefined } -/** - * @deprecated Use AccessGrantsUpdateParameters instead. - */ -export type AccessGrantsUpdateBody = AccessGrantsUpdateParameters - /** * @deprecated Use AccessGrantsUpdateRequest instead. */ diff --git a/src/lib/seam/connect/routes/access-grants/unmanaged/unmanaged.ts b/src/lib/seam/connect/routes/access-grants/unmanaged/unmanaged.ts index 06b870aa..b2f36f91 100644 --- a/src/lib/seam/connect/routes/access-grants/unmanaged/unmanaged.ts +++ b/src/lib/seam/connect/routes/access-grants/unmanaged/unmanaged.ts @@ -29,7 +29,7 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { UnknownResource } from 'lib/seam/connect/resources/unknown.js' +import type { UnmanagedAccessGrant } from 'lib/seam/connect/resources/unmanaged-access-grant.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' @@ -205,15 +205,12 @@ export type AccessGrantsUnmanagedGetParameters = { access_grant_id: string } -/** - * @deprecated Use AccessGrantsUnmanagedGetParameters instead. - */ -export type AccessGrantsUnmanagedGetParams = AccessGrantsUnmanagedGetParameters - /** * @deprecated Use AccessGrantsUnmanagedGetRequest instead. */ -export type AccessGrantsUnmanagedGetResponse = { access_grant: UnknownResource } +export type AccessGrantsUnmanagedGetResponse = { + access_grant: UnmanagedAccessGrant +} export type AccessGrantsUnmanagedGetRequest = SeamHttpRequest< AccessGrantsUnmanagedGetResponse, @@ -231,17 +228,11 @@ export type AccessGrantsUnmanagedListParameters = { user_identity_id?: string | undefined } -/** - * @deprecated Use AccessGrantsUnmanagedListParameters instead. - */ -export type AccessGrantsUnmanagedListParams = - AccessGrantsUnmanagedListParameters - /** * @deprecated Use AccessGrantsUnmanagedListRequest instead. */ export type AccessGrantsUnmanagedListResponse = { - access_grants: Array + access_grants: Array } export type AccessGrantsUnmanagedListRequest = SeamHttpRequest< @@ -258,12 +249,6 @@ export type AccessGrantsUnmanagedUpdateParameters = { is_managed: boolean } -/** - * @deprecated Use AccessGrantsUnmanagedUpdateParameters instead. - */ -export type AccessGrantsUnmanagedUpdateBody = - AccessGrantsUnmanagedUpdateParameters - /** * @deprecated Use AccessGrantsUnmanagedUpdateRequest instead. */ diff --git a/src/lib/seam/connect/routes/access-methods/access-methods.ts b/src/lib/seam/connect/routes/access-methods/access-methods.ts index e326acfc..61a32fbe 100644 --- a/src/lib/seam/connect/routes/access-methods/access-methods.ts +++ b/src/lib/seam/connect/routes/access-methods/access-methods.ts @@ -3,8 +3,6 @@ * Do not edit this file or add other files to this directory. */ -import type { RouteResponse } from '@seamapi/types/connect' - import { seamApiLtsVersion } from 'lib/lts-version.js' import { getAuthHeadersForClientSessionToken, @@ -31,8 +29,9 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { AccessMethodResource } from 'lib/seam/connect/resources/access-method.js' -import type { UnknownResource } from 'lib/seam/connect/resources/unknown.js' +import type { AccessMethod } from 'lib/seam/connect/resources/access-method.js' +import type { ActionAttempt } from 'lib/seam/connect/resources/action-attempt.js' +import type { Batch } from 'lib/seam/connect/resources/batch.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' @@ -268,16 +267,10 @@ export type AccessMethodsAssignCardParameters = { card_number: string } -/** - * @deprecated Use AccessMethodsAssignCardParameters instead. - */ -export type AccessMethodsAssignCardBody = AccessMethodsAssignCardParameters - /** * @deprecated Use AccessMethodsAssignCardRequest instead. */ -export type AccessMethodsAssignCardResponse = - RouteResponse<'/access_methods/assign_card'> +export type AccessMethodsAssignCardResponse = { action_attempt: ActionAttempt } export type AccessMethodsAssignCardRequest = SeamHttpRequest< AccessMethodsAssignCardResponse, @@ -295,11 +288,6 @@ export type AccessMethodsDeleteParameters = { reservation_key?: string | undefined } -/** - * @deprecated Use AccessMethodsDeleteParameters instead. - */ -export type AccessMethodsDeleteParams = AccessMethodsDeleteParameters - /** * @deprecated Use AccessMethodsDeleteRequest instead. */ @@ -315,16 +303,10 @@ export type AccessMethodsEncodeParameters = { acs_encoder_id: string } -/** - * @deprecated Use AccessMethodsEncodeParameters instead. - */ -export type AccessMethodsEncodeBody = AccessMethodsEncodeParameters - /** * @deprecated Use AccessMethodsEncodeRequest instead. */ -export type AccessMethodsEncodeResponse = - RouteResponse<'/access_methods/encode'> +export type AccessMethodsEncodeResponse = { action_attempt: ActionAttempt } export type AccessMethodsEncodeRequest = SeamHttpRequest< AccessMethodsEncodeResponse, @@ -340,15 +322,10 @@ export type AccessMethodsGetParameters = { access_method_id: string } -/** - * @deprecated Use AccessMethodsGetParameters instead. - */ -export type AccessMethodsGetParams = AccessMethodsGetParameters - /** * @deprecated Use AccessMethodsGetRequest instead. */ -export type AccessMethodsGetResponse = { access_method: AccessMethodResource } +export type AccessMethodsGetResponse = { access_method: AccessMethod } export type AccessMethodsGetRequest = SeamHttpRequest< AccessMethodsGetResponse, @@ -386,15 +363,21 @@ export type AccessMethodsGetRelatedParameters = { | undefined } -/** - * @deprecated Use AccessMethodsGetRelatedParameters instead. - */ -export type AccessMethodsGetRelatedParams = AccessMethodsGetRelatedParameters - /** * @deprecated Use AccessMethodsGetRelatedRequest instead. */ -export type AccessMethodsGetRelatedResponse = { batch: UnknownResource } +export type AccessMethodsGetRelatedResponse = { + batch: Batch< + | 'spaces' + | 'devices' + | 'acs_entrances' + | 'access_grants' + | 'access_methods' + | 'instant_keys' + | 'client_sessions' + | 'acs_credentials' + > +} export type AccessMethodsGetRelatedRequest = SeamHttpRequest< AccessMethodsGetRelatedResponse, @@ -414,17 +397,10 @@ export type AccessMethodsListParameters = { space_id?: string | undefined } -/** - * @deprecated Use AccessMethodsListParameters instead. - */ -export type AccessMethodsListParams = AccessMethodsListParameters - /** * @deprecated Use AccessMethodsListRequest instead. */ -export type AccessMethodsListResponse = { - access_methods: Array -} +export type AccessMethodsListResponse = { access_methods: Array } export type AccessMethodsListRequest = SeamHttpRequest< AccessMethodsListResponse, @@ -439,16 +415,10 @@ export type AccessMethodsUnlockDoorParameters = { acs_entrance_id: string } -/** - * @deprecated Use AccessMethodsUnlockDoorParameters instead. - */ -export type AccessMethodsUnlockDoorBody = AccessMethodsUnlockDoorParameters - /** * @deprecated Use AccessMethodsUnlockDoorRequest instead. */ -export type AccessMethodsUnlockDoorResponse = - RouteResponse<'/access_methods/unlock_door'> +export type AccessMethodsUnlockDoorResponse = { action_attempt: ActionAttempt } export type AccessMethodsUnlockDoorRequest = SeamHttpRequest< AccessMethodsUnlockDoorResponse, diff --git a/src/lib/seam/connect/routes/access-methods/unmanaged/unmanaged.ts b/src/lib/seam/connect/routes/access-methods/unmanaged/unmanaged.ts index 3fbe1b72..7c24da51 100644 --- a/src/lib/seam/connect/routes/access-methods/unmanaged/unmanaged.ts +++ b/src/lib/seam/connect/routes/access-methods/unmanaged/unmanaged.ts @@ -29,7 +29,7 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { UnknownResource } from 'lib/seam/connect/resources/unknown.js' +import type { UnmanagedAccessMethod } from 'lib/seam/connect/resources/unmanaged-access-method.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' @@ -192,17 +192,11 @@ export type AccessMethodsUnmanagedGetParameters = { access_method_id: string } -/** - * @deprecated Use AccessMethodsUnmanagedGetParameters instead. - */ -export type AccessMethodsUnmanagedGetParams = - AccessMethodsUnmanagedGetParameters - /** * @deprecated Use AccessMethodsUnmanagedGetRequest instead. */ export type AccessMethodsUnmanagedGetResponse = { - access_method: UnknownResource + access_method: UnmanagedAccessMethod } export type AccessMethodsUnmanagedGetRequest = SeamHttpRequest< @@ -220,17 +214,11 @@ export type AccessMethodsUnmanagedListParameters = { space_id?: string | undefined } -/** - * @deprecated Use AccessMethodsUnmanagedListParameters instead. - */ -export type AccessMethodsUnmanagedListParams = - AccessMethodsUnmanagedListParameters - /** * @deprecated Use AccessMethodsUnmanagedListRequest instead. */ export type AccessMethodsUnmanagedListResponse = { - access_methods: Array + access_methods: Array } export type AccessMethodsUnmanagedListRequest = SeamHttpRequest< diff --git a/src/lib/seam/connect/routes/acs/access-groups/access-groups.ts b/src/lib/seam/connect/routes/acs/access-groups/access-groups.ts index bec15c0f..2205435e 100644 --- a/src/lib/seam/connect/routes/acs/access-groups/access-groups.ts +++ b/src/lib/seam/connect/routes/acs/access-groups/access-groups.ts @@ -29,15 +29,13 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { AcsAccessGroupResource } from 'lib/seam/connect/resources/acs-access-group.js' -import type { AcsEntranceResource } from 'lib/seam/connect/resources/acs-entrance.js' -import type { AcsUserResource } from 'lib/seam/connect/resources/acs-user.js' +import type { AcsAccessGroup } from 'lib/seam/connect/resources/acs-access-group.js' +import type { AcsEntrance } from 'lib/seam/connect/resources/acs-entrance.js' +import type { AcsUser } from 'lib/seam/connect/resources/acs-user.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 { SeamHttpAcsAccessGroupsUnmanaged } from './unmanaged/index.js' - export class SeamHttpAcsAccessGroups { client: Client readonly defaults: Required @@ -165,13 +163,6 @@ export class SeamHttpAcsAccessGroups { await clientSessions.get() } - get unmanaged(): SeamHttpAcsAccessGroupsUnmanaged { - return SeamHttpAcsAccessGroupsUnmanaged.fromClient( - this.client, - this.defaults, - ) - } - addUser( parameters: AcsAccessGroupsAddUserParameters, options: AcsAccessGroupsAddUserOptions = {}, @@ -271,11 +262,6 @@ export type AcsAccessGroupsAddUserParameters = { user_identity_id?: string | undefined } -/** - * @deprecated Use AcsAccessGroupsAddUserParameters instead. - */ -export type AcsAccessGroupsAddUserBody = AcsAccessGroupsAddUserParameters - /** * @deprecated Use AcsAccessGroupsAddUserRequest instead. */ @@ -289,11 +275,6 @@ export type AcsAccessGroupsDeleteParameters = { acs_access_group_id: string } -/** - * @deprecated Use AcsAccessGroupsDeleteParameters instead. - */ -export type AcsAccessGroupsDeleteParams = AcsAccessGroupsDeleteParameters - /** * @deprecated Use AcsAccessGroupsDeleteRequest instead. */ @@ -307,17 +288,10 @@ export type AcsAccessGroupsGetParameters = { acs_access_group_id: string } -/** - * @deprecated Use AcsAccessGroupsGetParameters instead. - */ -export type AcsAccessGroupsGetParams = AcsAccessGroupsGetParameters - /** * @deprecated Use AcsAccessGroupsGetRequest instead. */ -export type AcsAccessGroupsGetResponse = { - acs_access_group: AcsAccessGroupResource -} +export type AcsAccessGroupsGetResponse = { acs_access_group: AcsAccessGroup } export type AcsAccessGroupsGetRequest = SeamHttpRequest< AcsAccessGroupsGetResponse, @@ -333,16 +307,11 @@ export type AcsAccessGroupsListParameters = { user_identity_id?: string | undefined } -/** - * @deprecated Use AcsAccessGroupsListParameters instead. - */ -export type AcsAccessGroupsListParams = AcsAccessGroupsListParameters - /** * @deprecated Use AcsAccessGroupsListRequest instead. */ export type AcsAccessGroupsListResponse = { - acs_access_groups: Array + acs_access_groups: Array } export type AcsAccessGroupsListRequest = SeamHttpRequest< @@ -356,17 +325,11 @@ export type AcsAccessGroupsListAccessibleEntrancesParameters = { acs_access_group_id: string } -/** - * @deprecated Use AcsAccessGroupsListAccessibleEntrancesParameters instead. - */ -export type AcsAccessGroupsListAccessibleEntrancesParams = - AcsAccessGroupsListAccessibleEntrancesParameters - /** * @deprecated Use AcsAccessGroupsListAccessibleEntrancesRequest instead. */ export type AcsAccessGroupsListAccessibleEntrancesResponse = { - acs_entrances: Array + acs_entrances: Array } export type AcsAccessGroupsListAccessibleEntrancesRequest = SeamHttpRequest< @@ -380,17 +343,10 @@ export type AcsAccessGroupsListUsersParameters = { acs_access_group_id: string } -/** - * @deprecated Use AcsAccessGroupsListUsersParameters instead. - */ -export type AcsAccessGroupsListUsersParams = AcsAccessGroupsListUsersParameters - /** * @deprecated Use AcsAccessGroupsListUsersRequest instead. */ -export type AcsAccessGroupsListUsersResponse = { - acs_users: Array -} +export type AcsAccessGroupsListUsersResponse = { acs_users: Array } export type AcsAccessGroupsListUsersRequest = SeamHttpRequest< AcsAccessGroupsListUsersResponse, @@ -406,12 +362,6 @@ export type AcsAccessGroupsRemoveUserParameters = { user_identity_id?: string | undefined } -/** - * @deprecated Use AcsAccessGroupsRemoveUserParameters instead. - */ -export type AcsAccessGroupsRemoveUserParams = - AcsAccessGroupsRemoveUserParameters - /** * @deprecated Use AcsAccessGroupsRemoveUserRequest instead. */ diff --git a/src/lib/seam/connect/routes/acs/access-groups/index.ts b/src/lib/seam/connect/routes/acs/access-groups/index.ts index 102271a5..bed34230 100644 --- a/src/lib/seam/connect/routes/acs/access-groups/index.ts +++ b/src/lib/seam/connect/routes/acs/access-groups/index.ts @@ -4,4 +4,3 @@ */ export * from './access-groups.js' -export * from './unmanaged/index.js' diff --git a/src/lib/seam/connect/routes/acs/access-groups/unmanaged/index.ts b/src/lib/seam/connect/routes/acs/access-groups/unmanaged/index.ts deleted file mode 100644 index bab8a37e..00000000 --- a/src/lib/seam/connect/routes/acs/access-groups/unmanaged/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './unmanaged.js' diff --git a/src/lib/seam/connect/routes/acs/access-groups/unmanaged/unmanaged.ts b/src/lib/seam/connect/routes/acs/access-groups/unmanaged/unmanaged.ts deleted file mode 100644 index 8c346e94..00000000 --- a/src/lib/seam/connect/routes/acs/access-groups/unmanaged/unmanaged.ts +++ /dev/null @@ -1,252 +0,0 @@ -/* - * 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' - -export class SeamHttpAcsAccessGroupsUnmanaged { - 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 = {}, - ): SeamHttpAcsAccessGroupsUnmanaged { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpAcsAccessGroupsUnmanaged(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpAcsAccessGroupsUnmanaged { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpAcsAccessGroupsUnmanaged(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpAcsAccessGroupsUnmanaged { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpAcsAccessGroupsUnmanaged(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 SeamHttpAcsAccessGroupsUnmanaged.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpAcsAccessGroupsUnmanaged.fromClientSessionToken( - token, - options, - ) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpAcsAccessGroupsUnmanaged { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpAcsAccessGroupsUnmanaged(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpAcsAccessGroupsUnmanaged { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpAcsAccessGroupsUnmanaged(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() - } - - get( - parameters: AcsAccessGroupsUnmanagedGetParameters, - options: AcsAccessGroupsUnmanagedGetOptions = {}, - ): AcsAccessGroupsUnmanagedGetRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/acs/access_groups/unmanaged/get', - method: 'POST', - body: parameters, - responseKey: 'acs_access_group', - options, - }) - } - - list( - parameters?: AcsAccessGroupsUnmanagedListParameters, - options: AcsAccessGroupsUnmanagedListOptions = {}, - ): AcsAccessGroupsUnmanagedListRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/acs/access_groups/unmanaged/list', - method: 'POST', - body: parameters, - responseKey: 'acs_access_groups', - options, - }) - } -} - -export type AcsAccessGroupsUnmanagedGetParameters = - RouteRequestBody<'/acs/access_groups/unmanaged/get'> - -/** - * @deprecated Use AcsAccessGroupsUnmanagedGetParameters instead. - */ -export type AcsAccessGroupsUnmanagedGetParams = - AcsAccessGroupsUnmanagedGetParameters - -/** - * @deprecated Use AcsAccessGroupsUnmanagedGetRequest instead. - */ -export type AcsAccessGroupsUnmanagedGetResponse = - RouteResponse<'/acs/access_groups/unmanaged/get'> - -export type AcsAccessGroupsUnmanagedGetRequest = SeamHttpRequest< - AcsAccessGroupsUnmanagedGetResponse, - 'acs_access_group' -> - -export interface AcsAccessGroupsUnmanagedGetOptions {} - -export type AcsAccessGroupsUnmanagedListParameters = - RouteRequestBody<'/acs/access_groups/unmanaged/list'> - -/** - * @deprecated Use AcsAccessGroupsUnmanagedListParameters instead. - */ -export type AcsAccessGroupsUnmanagedListParams = - AcsAccessGroupsUnmanagedListParameters - -/** - * @deprecated Use AcsAccessGroupsUnmanagedListRequest instead. - */ -export type AcsAccessGroupsUnmanagedListResponse = - RouteResponse<'/acs/access_groups/unmanaged/list'> - -export type AcsAccessGroupsUnmanagedListRequest = SeamHttpRequest< - AcsAccessGroupsUnmanagedListResponse, - 'acs_access_groups' -> - -export interface AcsAccessGroupsUnmanagedListOptions {} diff --git a/src/lib/seam/connect/routes/acs/acs.ts b/src/lib/seam/connect/routes/acs/acs.ts index 3b244e41..51413396 100644 --- a/src/lib/seam/connect/routes/acs/acs.ts +++ b/src/lib/seam/connect/routes/acs/acs.ts @@ -34,8 +34,6 @@ import type { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import { SeamHttpAcsAccessGroups } from './access-groups/index.js' -import { SeamHttpAcsCredentialPools } from './credential-pools/index.js' -import { SeamHttpAcsCredentialProvisioningAutomations } from './credential-provisioning-automations/index.js' import { SeamHttpAcsCredentials } from './credentials/index.js' import { SeamHttpAcsEncoders } from './encoders/index.js' import { SeamHttpAcsEntrances } from './entrances/index.js' @@ -173,17 +171,6 @@ export class SeamHttpAcs { return SeamHttpAcsAccessGroups.fromClient(this.client, this.defaults) } - get credentialPools(): SeamHttpAcsCredentialPools { - return SeamHttpAcsCredentialPools.fromClient(this.client, this.defaults) - } - - get credentialProvisioningAutomations(): SeamHttpAcsCredentialProvisioningAutomations { - return SeamHttpAcsCredentialProvisioningAutomations.fromClient( - this.client, - this.defaults, - ) - } - get credentials(): SeamHttpAcsCredentials { return SeamHttpAcsCredentials.fromClient(this.client, this.defaults) } diff --git a/src/lib/seam/connect/routes/acs/credential-pools/credential-pools.ts b/src/lib/seam/connect/routes/acs/credential-pools/credential-pools.ts deleted file mode 100644 index b1f93f51..00000000 --- a/src/lib/seam/connect/routes/acs/credential-pools/credential-pools.ts +++ /dev/null @@ -1,208 +0,0 @@ -/* - * 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' - -export class SeamHttpAcsCredentialPools { - 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 = {}, - ): SeamHttpAcsCredentialPools { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpAcsCredentialPools(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpAcsCredentialPools { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpAcsCredentialPools(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpAcsCredentialPools { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpAcsCredentialPools(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 SeamHttpAcsCredentialPools.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpAcsCredentialPools.fromClientSessionToken(token, options) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpAcsCredentialPools { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpAcsCredentialPools(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpAcsCredentialPools { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpAcsCredentialPools(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: AcsCredentialPoolsListParameters, - options: AcsCredentialPoolsListOptions = {}, - ): AcsCredentialPoolsListRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/acs/credential_pools/list', - method: 'POST', - body: parameters, - responseKey: 'acs_credential_pools', - options, - }) - } -} - -export type AcsCredentialPoolsListParameters = - RouteRequestBody<'/acs/credential_pools/list'> - -/** - * @deprecated Use AcsCredentialPoolsListParameters instead. - */ -export type AcsCredentialPoolsListParams = AcsCredentialPoolsListParameters - -/** - * @deprecated Use AcsCredentialPoolsListRequest instead. - */ -export type AcsCredentialPoolsListResponse = - RouteResponse<'/acs/credential_pools/list'> - -export type AcsCredentialPoolsListRequest = SeamHttpRequest< - AcsCredentialPoolsListResponse, - 'acs_credential_pools' -> - -export interface AcsCredentialPoolsListOptions {} diff --git a/src/lib/seam/connect/routes/acs/credential-pools/index.ts b/src/lib/seam/connect/routes/acs/credential-pools/index.ts deleted file mode 100644 index 359efb81..00000000 --- a/src/lib/seam/connect/routes/acs/credential-pools/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './credential-pools.js' diff --git a/src/lib/seam/connect/routes/acs/credential-provisioning-automations/credential-provisioning-automations.ts b/src/lib/seam/connect/routes/acs/credential-provisioning-automations/credential-provisioning-automations.ts deleted file mode 100644 index 0f545919..00000000 --- a/src/lib/seam/connect/routes/acs/credential-provisioning-automations/credential-provisioning-automations.ts +++ /dev/null @@ -1,212 +0,0 @@ -/* - * 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' - -export class SeamHttpAcsCredentialProvisioningAutomations { - 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 = {}, - ): SeamHttpAcsCredentialProvisioningAutomations { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpAcsCredentialProvisioningAutomations(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpAcsCredentialProvisioningAutomations { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpAcsCredentialProvisioningAutomations(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpAcsCredentialProvisioningAutomations { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpAcsCredentialProvisioningAutomations(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 SeamHttpAcsCredentialProvisioningAutomations.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpAcsCredentialProvisioningAutomations.fromClientSessionToken( - token, - options, - ) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpAcsCredentialProvisioningAutomations { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpAcsCredentialProvisioningAutomations(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpAcsCredentialProvisioningAutomations { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpAcsCredentialProvisioningAutomations(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() - } - - launch( - parameters: AcsCredentialProvisioningAutomationsLaunchParameters, - options: AcsCredentialProvisioningAutomationsLaunchOptions = {}, - ): AcsCredentialProvisioningAutomationsLaunchRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/acs/credential_provisioning_automations/launch', - method: 'POST', - body: parameters, - responseKey: 'acs_credential_provisioning_automation', - options, - }) - } -} - -export type AcsCredentialProvisioningAutomationsLaunchParameters = - RouteRequestBody<'/acs/credential_provisioning_automations/launch'> - -/** - * @deprecated Use AcsCredentialProvisioningAutomationsLaunchParameters instead. - */ -export type AcsCredentialProvisioningAutomationsLaunchBody = - AcsCredentialProvisioningAutomationsLaunchParameters - -/** - * @deprecated Use AcsCredentialProvisioningAutomationsLaunchRequest instead. - */ -export type AcsCredentialProvisioningAutomationsLaunchResponse = - RouteResponse<'/acs/credential_provisioning_automations/launch'> - -export type AcsCredentialProvisioningAutomationsLaunchRequest = SeamHttpRequest< - AcsCredentialProvisioningAutomationsLaunchResponse, - 'acs_credential_provisioning_automation' -> - -export interface AcsCredentialProvisioningAutomationsLaunchOptions {} diff --git a/src/lib/seam/connect/routes/acs/credential-provisioning-automations/index.ts b/src/lib/seam/connect/routes/acs/credential-provisioning-automations/index.ts deleted file mode 100644 index 9f5a3c67..00000000 --- a/src/lib/seam/connect/routes/acs/credential-provisioning-automations/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './credential-provisioning-automations.js' diff --git a/src/lib/seam/connect/routes/acs/credentials/credentials.ts b/src/lib/seam/connect/routes/acs/credentials/credentials.ts index 866b653a..55703158 100644 --- a/src/lib/seam/connect/routes/acs/credentials/credentials.ts +++ b/src/lib/seam/connect/routes/acs/credentials/credentials.ts @@ -3,8 +3,6 @@ * 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, @@ -31,14 +29,12 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { AcsCredentialResource } from 'lib/seam/connect/resources/acs-credential.js' -import type { AcsEntranceResource } from 'lib/seam/connect/resources/acs-entrance.js' +import type { AcsCredential } from 'lib/seam/connect/resources/acs-credential.js' +import type { AcsEntrance } from 'lib/seam/connect/resources/acs-entrance.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 { SeamHttpAcsCredentialsUnmanaged } from './unmanaged/index.js' - export class SeamHttpAcsCredentials { client: Client readonly defaults: Required @@ -166,13 +162,6 @@ export class SeamHttpAcsCredentials { await clientSessions.get() } - get unmanaged(): SeamHttpAcsCredentialsUnmanaged { - return SeamHttpAcsCredentialsUnmanaged.fromClient( - this.client, - this.defaults, - ) - } - assign( parameters: AcsCredentialsAssignParameters, options: AcsCredentialsAssignOptions = {}, @@ -199,24 +188,6 @@ export class SeamHttpAcsCredentials { }) } - createOfflineCode( - parameters: AcsCredentialsCreateOfflineCodeParameters, - options: AcsCredentialsCreateOfflineCodeOptions = {}, - ): AcsCredentialsCreateOfflineCodeRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/acs/credentials/create_offline_code', - method: 'POST', - body: parameters, - responseKey: 'acs_credential', - options, - }) - } - delete( parameters: AcsCredentialsDeleteParameters, options: AcsCredentialsDeleteOptions = {}, @@ -303,11 +274,6 @@ export type AcsCredentialsAssignParameters = { user_identity_id?: string | undefined } -/** - * @deprecated Use AcsCredentialsAssignParameters instead. - */ -export type AcsCredentialsAssignBody = AcsCredentialsAssignParameters - /** * @deprecated Use AcsCredentialsAssignRequest instead. */ @@ -334,45 +300,29 @@ export type AcsCredentialsCreateParameters = { code?: string | undefined credential_manager_acs_system_id?: string | undefined ends_at?: string | undefined - hotek_metadata?: - | { - auto_join?: boolean | undefined - override?: boolean | undefined - } - | undefined is_multi_phone_sync_credential?: boolean | undefined salto_space_metadata?: | { assign_new_key?: boolean | undefined - update_current_key?: boolean | undefined } | undefined starts_at?: string | undefined user_identity_id?: string | undefined visionline_metadata?: | { - assa_abloy_credential_service_mobile_endpoint_id?: string | undefined auto_join?: boolean | undefined card_format?: 'TLCode' | 'rfid48' | undefined card_function_type?: 'guest' | 'staff' | undefined - is_override_key?: boolean | undefined joiner_acs_credential_ids?: Array | undefined override?: boolean | undefined } | undefined } -/** - * @deprecated Use AcsCredentialsCreateParameters instead. - */ -export type AcsCredentialsCreateBody = AcsCredentialsCreateParameters - /** * @deprecated Use AcsCredentialsCreateRequest instead. */ -export type AcsCredentialsCreateResponse = { - acs_credential: AcsCredentialResource -} +export type AcsCredentialsCreateResponse = { acs_credential: AcsCredential } export type AcsCredentialsCreateRequest = SeamHttpRequest< AcsCredentialsCreateResponse, @@ -381,37 +331,10 @@ export type AcsCredentialsCreateRequest = SeamHttpRequest< export interface AcsCredentialsCreateOptions {} -export type AcsCredentialsCreateOfflineCodeParameters = - RouteRequestBody<'/acs/credentials/create_offline_code'> - -/** - * @deprecated Use AcsCredentialsCreateOfflineCodeParameters instead. - */ -export type AcsCredentialsCreateOfflineCodeBody = - AcsCredentialsCreateOfflineCodeParameters - -/** - * @deprecated Use AcsCredentialsCreateOfflineCodeRequest instead. - */ -export type AcsCredentialsCreateOfflineCodeResponse = - RouteResponse<'/acs/credentials/create_offline_code'> - -export type AcsCredentialsCreateOfflineCodeRequest = SeamHttpRequest< - AcsCredentialsCreateOfflineCodeResponse, - 'acs_credential' -> - -export interface AcsCredentialsCreateOfflineCodeOptions {} - export type AcsCredentialsDeleteParameters = { acs_credential_id: string } -/** - * @deprecated Use AcsCredentialsDeleteParameters instead. - */ -export type AcsCredentialsDeleteParams = AcsCredentialsDeleteParameters - /** * @deprecated Use AcsCredentialsDeleteRequest instead. */ @@ -425,17 +348,10 @@ export type AcsCredentialsGetParameters = { acs_credential_id: string } -/** - * @deprecated Use AcsCredentialsGetParameters instead. - */ -export type AcsCredentialsGetParams = AcsCredentialsGetParameters - /** * @deprecated Use AcsCredentialsGetRequest instead. */ -export type AcsCredentialsGetResponse = { - acs_credential: AcsCredentialResource -} +export type AcsCredentialsGetResponse = { acs_credential: AcsCredential } export type AcsCredentialsGetRequest = SeamHttpRequest< AcsCredentialsGetResponse, @@ -455,16 +371,11 @@ export type AcsCredentialsListParameters = { search?: string | undefined } -/** - * @deprecated Use AcsCredentialsListParameters instead. - */ -export type AcsCredentialsListParams = AcsCredentialsListParameters - /** * @deprecated Use AcsCredentialsListRequest instead. */ export type AcsCredentialsListResponse = { - acs_credentials: Array + acs_credentials: Array } export type AcsCredentialsListRequest = SeamHttpRequest< @@ -478,17 +389,11 @@ export type AcsCredentialsListAccessibleEntrancesParameters = { acs_credential_id: string } -/** - * @deprecated Use AcsCredentialsListAccessibleEntrancesParameters instead. - */ -export type AcsCredentialsListAccessibleEntrancesParams = - AcsCredentialsListAccessibleEntrancesParameters - /** * @deprecated Use AcsCredentialsListAccessibleEntrancesRequest instead. */ export type AcsCredentialsListAccessibleEntrancesResponse = { - acs_entrances: Array + acs_entrances: Array } export type AcsCredentialsListAccessibleEntrancesRequest = SeamHttpRequest< @@ -505,11 +410,6 @@ export type AcsCredentialsUnassignParameters = { user_identity_id?: string | undefined } -/** - * @deprecated Use AcsCredentialsUnassignParameters instead. - */ -export type AcsCredentialsUnassignBody = AcsCredentialsUnassignParameters - /** * @deprecated Use AcsCredentialsUnassignRequest instead. */ @@ -526,11 +426,6 @@ export type AcsCredentialsUpdateParameters = { ends_at?: string | undefined } -/** - * @deprecated Use AcsCredentialsUpdateParameters instead. - */ -export type AcsCredentialsUpdateBody = AcsCredentialsUpdateParameters - /** * @deprecated Use AcsCredentialsUpdateRequest instead. */ diff --git a/src/lib/seam/connect/routes/acs/credentials/index.ts b/src/lib/seam/connect/routes/acs/credentials/index.ts index 62dedd6f..2d9bacd3 100644 --- a/src/lib/seam/connect/routes/acs/credentials/index.ts +++ b/src/lib/seam/connect/routes/acs/credentials/index.ts @@ -4,4 +4,3 @@ */ export * from './credentials.js' -export * from './unmanaged/index.js' diff --git a/src/lib/seam/connect/routes/acs/credentials/unmanaged/index.ts b/src/lib/seam/connect/routes/acs/credentials/unmanaged/index.ts deleted file mode 100644 index bab8a37e..00000000 --- a/src/lib/seam/connect/routes/acs/credentials/unmanaged/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './unmanaged.js' diff --git a/src/lib/seam/connect/routes/acs/credentials/unmanaged/unmanaged.ts b/src/lib/seam/connect/routes/acs/credentials/unmanaged/unmanaged.ts deleted file mode 100644 index 0c1c71ce..00000000 --- a/src/lib/seam/connect/routes/acs/credentials/unmanaged/unmanaged.ts +++ /dev/null @@ -1,256 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -import type { - RouteRequestBody, - RouteRequestParams, - 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' - -export class SeamHttpAcsCredentialsUnmanaged { - 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 = {}, - ): SeamHttpAcsCredentialsUnmanaged { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpAcsCredentialsUnmanaged(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpAcsCredentialsUnmanaged { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpAcsCredentialsUnmanaged(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpAcsCredentialsUnmanaged { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpAcsCredentialsUnmanaged(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 SeamHttpAcsCredentialsUnmanaged.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpAcsCredentialsUnmanaged.fromClientSessionToken( - token, - options, - ) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpAcsCredentialsUnmanaged { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpAcsCredentialsUnmanaged(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpAcsCredentialsUnmanaged { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpAcsCredentialsUnmanaged(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() - } - - get( - parameters: AcsCredentialsUnmanagedGetParameters, - options: AcsCredentialsUnmanagedGetOptions = {}, - ): AcsCredentialsUnmanagedGetRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/acs/credentials/unmanaged/get', - method: 'POST', - body: parameters, - responseKey: 'acs_credential', - options, - }) - } - - list( - parameters?: AcsCredentialsUnmanagedListParameters, - options: AcsCredentialsUnmanagedListOptions = {}, - ): AcsCredentialsUnmanagedListRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/acs/credentials/unmanaged/list', - method: 'GET', - params: parameters, - responseKey: 'acs_credentials', - options, - }) - } -} - -export type AcsCredentialsUnmanagedGetParameters = - RouteRequestBody<'/acs/credentials/unmanaged/get'> - -/** - * @deprecated Use AcsCredentialsUnmanagedGetParameters instead. - */ -export type AcsCredentialsUnmanagedGetParams = - AcsCredentialsUnmanagedGetParameters - -/** - * @deprecated Use AcsCredentialsUnmanagedGetRequest instead. - */ -export type AcsCredentialsUnmanagedGetResponse = - RouteResponse<'/acs/credentials/unmanaged/get'> - -export type AcsCredentialsUnmanagedGetRequest = SeamHttpRequest< - AcsCredentialsUnmanagedGetResponse, - 'acs_credential' -> - -export interface AcsCredentialsUnmanagedGetOptions {} - -export type AcsCredentialsUnmanagedListParameters = - RouteRequestParams<'/acs/credentials/unmanaged/list'> - -/** - * @deprecated Use AcsCredentialsUnmanagedListParameters instead. - */ -export type AcsCredentialsUnmanagedListParams = - AcsCredentialsUnmanagedListParameters - -/** - * @deprecated Use AcsCredentialsUnmanagedListRequest instead. - */ -export type AcsCredentialsUnmanagedListResponse = - RouteResponse<'/acs/credentials/unmanaged/list'> - -export type AcsCredentialsUnmanagedListRequest = SeamHttpRequest< - AcsCredentialsUnmanagedListResponse, - 'acs_credentials' -> - -export interface AcsCredentialsUnmanagedListOptions {} diff --git a/src/lib/seam/connect/routes/acs/encoders/encoders.ts b/src/lib/seam/connect/routes/acs/encoders/encoders.ts index 6ae6ecc9..7281f19d 100644 --- a/src/lib/seam/connect/routes/acs/encoders/encoders.ts +++ b/src/lib/seam/connect/routes/acs/encoders/encoders.ts @@ -3,8 +3,6 @@ * Do not edit this file or add other files to this directory. */ -import type { RouteResponse } from '@seamapi/types/connect' - import { seamApiLtsVersion } from 'lib/lts-version.js' import { getAuthHeadersForClientSessionToken, @@ -31,7 +29,8 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { AcsEncoderResource } from 'lib/seam/connect/resources/acs-encoder.js' +import type { AcsEncoder } from 'lib/seam/connect/resources/acs-encoder.js' +import type { ActionAttempt } from 'lib/seam/connect/resources/action-attempt.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' @@ -241,17 +240,12 @@ export type AcsEncodersEncodeCredentialParameters = { acs_encoder_id: string } -/** - * @deprecated Use AcsEncodersEncodeCredentialParameters instead. - */ -export type AcsEncodersEncodeCredentialBody = - AcsEncodersEncodeCredentialParameters - /** * @deprecated Use AcsEncodersEncodeCredentialRequest instead. */ -export type AcsEncodersEncodeCredentialResponse = - RouteResponse<'/acs/encoders/encode_credential'> +export type AcsEncodersEncodeCredentialResponse = { + action_attempt: ActionAttempt +} export type AcsEncodersEncodeCredentialRequest = SeamHttpRequest< AcsEncodersEncodeCredentialResponse, @@ -267,15 +261,10 @@ export type AcsEncodersGetParameters = { acs_encoder_id: string } -/** - * @deprecated Use AcsEncodersGetParameters instead. - */ -export type AcsEncodersGetParams = AcsEncodersGetParameters - /** * @deprecated Use AcsEncodersGetRequest instead. */ -export type AcsEncodersGetResponse = { acs_encoder: AcsEncoderResource } +export type AcsEncodersGetResponse = { acs_encoder: AcsEncoder } export type AcsEncodersGetRequest = SeamHttpRequest< AcsEncodersGetResponse, @@ -292,17 +281,10 @@ export type AcsEncodersListParameters = { page_cursor?: string | undefined } -/** - * @deprecated Use AcsEncodersListParameters instead. - */ -export type AcsEncodersListParams = AcsEncodersListParameters - /** * @deprecated Use AcsEncodersListRequest instead. */ -export type AcsEncodersListResponse = { - acs_encoders: Array -} +export type AcsEncodersListResponse = { acs_encoders: Array } export type AcsEncodersListRequest = SeamHttpRequest< AcsEncodersListResponse, @@ -321,16 +303,12 @@ export type AcsEncodersScanCredentialParameters = { | undefined } -/** - * @deprecated Use AcsEncodersScanCredentialParameters instead. - */ -export type AcsEncodersScanCredentialBody = AcsEncodersScanCredentialParameters - /** * @deprecated Use AcsEncodersScanCredentialRequest instead. */ -export type AcsEncodersScanCredentialResponse = - RouteResponse<'/acs/encoders/scan_credential'> +export type AcsEncodersScanCredentialResponse = { + action_attempt: ActionAttempt +} export type AcsEncodersScanCredentialRequest = SeamHttpRequest< AcsEncodersScanCredentialResponse, @@ -354,17 +332,12 @@ export type AcsEncodersScanToAssignCredentialParameters = { user_identity_id?: string | undefined } -/** - * @deprecated Use AcsEncodersScanToAssignCredentialParameters instead. - */ -export type AcsEncodersScanToAssignCredentialBody = - AcsEncodersScanToAssignCredentialParameters - /** * @deprecated Use AcsEncodersScanToAssignCredentialRequest instead. */ -export type AcsEncodersScanToAssignCredentialResponse = - RouteResponse<'/acs/encoders/scan_to_assign_credential'> +export type AcsEncodersScanToAssignCredentialResponse = { + action_attempt: ActionAttempt +} export type AcsEncodersScanToAssignCredentialRequest = SeamHttpRequest< AcsEncodersScanToAssignCredentialResponse, diff --git a/src/lib/seam/connect/routes/acs/encoders/simulate/simulate.ts b/src/lib/seam/connect/routes/acs/encoders/simulate/simulate.ts index 64210a5f..8b3c44de 100644 --- a/src/lib/seam/connect/routes/acs/encoders/simulate/simulate.ts +++ b/src/lib/seam/connect/routes/acs/encoders/simulate/simulate.ts @@ -225,12 +225,6 @@ export type AcsEncodersSimulateNextCredentialEncodeWillFailParameters = { acs_credential_id?: string | undefined } -/** - * @deprecated Use AcsEncodersSimulateNextCredentialEncodeWillFailParameters instead. - */ -export type AcsEncodersSimulateNextCredentialEncodeWillFailBody = - AcsEncodersSimulateNextCredentialEncodeWillFailParameters - /** * @deprecated Use AcsEncodersSimulateNextCredentialEncodeWillFailRequest instead. */ @@ -247,12 +241,6 @@ export type AcsEncodersSimulateNextCredentialEncodeWillSucceedParameters = { scenario?: 'credential_is_issued' | undefined } -/** - * @deprecated Use AcsEncodersSimulateNextCredentialEncodeWillSucceedParameters instead. - */ -export type AcsEncodersSimulateNextCredentialEncodeWillSucceedBody = - AcsEncodersSimulateNextCredentialEncodeWillSucceedParameters - /** * @deprecated Use AcsEncodersSimulateNextCredentialEncodeWillSucceedRequest instead. */ @@ -274,12 +262,6 @@ export type AcsEncodersSimulateNextCredentialScanWillFailParameters = { acs_credential_id_on_seam?: string | undefined } -/** - * @deprecated Use AcsEncodersSimulateNextCredentialScanWillFailParameters instead. - */ -export type AcsEncodersSimulateNextCredentialScanWillFailBody = - AcsEncodersSimulateNextCredentialScanWillFailParameters - /** * @deprecated Use AcsEncodersSimulateNextCredentialScanWillFailRequest instead. */ @@ -302,12 +284,6 @@ export type AcsEncodersSimulateNextCredentialScanWillSucceedParameters = { | undefined } -/** - * @deprecated Use AcsEncodersSimulateNextCredentialScanWillSucceedParameters instead. - */ -export type AcsEncodersSimulateNextCredentialScanWillSucceedBody = - AcsEncodersSimulateNextCredentialScanWillSucceedParameters - /** * @deprecated Use AcsEncodersSimulateNextCredentialScanWillSucceedRequest instead. */ diff --git a/src/lib/seam/connect/routes/acs/entrances/entrances.ts b/src/lib/seam/connect/routes/acs/entrances/entrances.ts index f50179ec..84f0b00c 100644 --- a/src/lib/seam/connect/routes/acs/entrances/entrances.ts +++ b/src/lib/seam/connect/routes/acs/entrances/entrances.ts @@ -3,8 +3,6 @@ * Do not edit this file or add other files to this directory. */ -import type { RouteResponse } from '@seamapi/types/connect' - import { seamApiLtsVersion } from 'lib/lts-version.js' import { getAuthHeadersForClientSessionToken, @@ -31,8 +29,9 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { AcsCredentialResource } from 'lib/seam/connect/resources/acs-credential.js' -import type { AcsEntranceResource } from 'lib/seam/connect/resources/acs-entrance.js' +import type { AcsCredential } from 'lib/seam/connect/resources/acs-credential.js' +import type { AcsEntrance } from 'lib/seam/connect/resources/acs-entrance.js' +import type { ActionAttempt } from 'lib/seam/connect/resources/action-attempt.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' @@ -234,15 +233,10 @@ export type AcsEntrancesGetParameters = { acs_entrance_id: string } -/** - * @deprecated Use AcsEntrancesGetParameters instead. - */ -export type AcsEntrancesGetParams = AcsEntrancesGetParameters - /** * @deprecated Use AcsEntrancesGetRequest instead. */ -export type AcsEntrancesGetResponse = { acs_entrance: AcsEntranceResource } +export type AcsEntrancesGetResponse = { acs_entrance: AcsEntrance } export type AcsEntrancesGetRequest = SeamHttpRequest< AcsEntrancesGetResponse, @@ -258,11 +252,6 @@ export type AcsEntrancesGrantAccessParameters = { user_identity_id?: string | undefined } -/** - * @deprecated Use AcsEntrancesGrantAccessParameters instead. - */ -export type AcsEntrancesGrantAccessBody = AcsEntrancesGrantAccessParameters - /** * @deprecated Use AcsEntrancesGrantAccessRequest instead. */ @@ -286,17 +275,10 @@ export type AcsEntrancesListParameters = { space_id?: string | undefined } -/** - * @deprecated Use AcsEntrancesListParameters instead. - */ -export type AcsEntrancesListParams = AcsEntrancesListParameters - /** * @deprecated Use AcsEntrancesListRequest instead. */ -export type AcsEntrancesListResponse = { - acs_entrances: Array -} +export type AcsEntrancesListResponse = { acs_entrances: Array } export type AcsEntrancesListRequest = SeamHttpRequest< AcsEntrancesListResponse, @@ -311,17 +293,11 @@ export type AcsEntrancesListCredentialsWithAccessParameters = { include_if?: Array<'visionline_metadata.is_valid'> | undefined } -/** - * @deprecated Use AcsEntrancesListCredentialsWithAccessParameters instead. - */ -export type AcsEntrancesListCredentialsWithAccessParams = - AcsEntrancesListCredentialsWithAccessParameters - /** * @deprecated Use AcsEntrancesListCredentialsWithAccessRequest instead. */ export type AcsEntrancesListCredentialsWithAccessResponse = { - acs_credentials: Array + acs_credentials: Array } export type AcsEntrancesListCredentialsWithAccessRequest = SeamHttpRequest< @@ -337,15 +313,10 @@ export type AcsEntrancesUnlockParameters = { acs_entrance_id: string } -/** - * @deprecated Use AcsEntrancesUnlockParameters instead. - */ -export type AcsEntrancesUnlockBody = AcsEntrancesUnlockParameters - /** * @deprecated Use AcsEntrancesUnlockRequest instead. */ -export type AcsEntrancesUnlockResponse = RouteResponse<'/acs/entrances/unlock'> +export type AcsEntrancesUnlockResponse = { action_attempt: ActionAttempt } export type AcsEntrancesUnlockRequest = SeamHttpRequest< AcsEntrancesUnlockResponse, diff --git a/src/lib/seam/connect/routes/acs/index.ts b/src/lib/seam/connect/routes/acs/index.ts index b8b8f5bf..26399aa6 100644 --- a/src/lib/seam/connect/routes/acs/index.ts +++ b/src/lib/seam/connect/routes/acs/index.ts @@ -5,8 +5,6 @@ export * from './access-groups/index.js' export * from './acs.js' -export * from './credential-pools/index.js' -export * from './credential-provisioning-automations/index.js' export * from './credentials/index.js' export * from './encoders/index.js' export * from './entrances/index.js' diff --git a/src/lib/seam/connect/routes/acs/systems/systems.ts b/src/lib/seam/connect/routes/acs/systems/systems.ts index 36cfbaea..0c407cbf 100644 --- a/src/lib/seam/connect/routes/acs/systems/systems.ts +++ b/src/lib/seam/connect/routes/acs/systems/systems.ts @@ -29,7 +29,7 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { AcsSystemResource } from 'lib/seam/connect/resources/acs-system.js' +import type { AcsSystem } from 'lib/seam/connect/resources/acs-system.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' @@ -218,15 +218,10 @@ export type AcsSystemsGetParameters = { acs_system_id: string } -/** - * @deprecated Use AcsSystemsGetParameters instead. - */ -export type AcsSystemsGetParams = AcsSystemsGetParameters - /** * @deprecated Use AcsSystemsGetRequest instead. */ -export type AcsSystemsGetResponse = { acs_system: AcsSystemResource } +export type AcsSystemsGetResponse = { acs_system: AcsSystem } export type AcsSystemsGetRequest = SeamHttpRequest< AcsSystemsGetResponse, @@ -241,15 +236,10 @@ export type AcsSystemsListParameters = { search?: string | undefined } -/** - * @deprecated Use AcsSystemsListParameters instead. - */ -export type AcsSystemsListParams = AcsSystemsListParameters - /** * @deprecated Use AcsSystemsListRequest instead. */ -export type AcsSystemsListResponse = { acs_systems: Array } +export type AcsSystemsListResponse = { acs_systems: Array } export type AcsSystemsListRequest = SeamHttpRequest< AcsSystemsListResponse, @@ -262,17 +252,11 @@ export type AcsSystemsListCompatibleCredentialManagerAcsSystemsParameters = { acs_system_id: string } -/** - * @deprecated Use AcsSystemsListCompatibleCredentialManagerAcsSystemsParameters instead. - */ -export type AcsSystemsListCompatibleCredentialManagerAcsSystemsParams = - AcsSystemsListCompatibleCredentialManagerAcsSystemsParameters - /** * @deprecated Use AcsSystemsListCompatibleCredentialManagerAcsSystemsRequest instead. */ export type AcsSystemsListCompatibleCredentialManagerAcsSystemsResponse = { - acs_systems: Array + acs_systems: Array } export type AcsSystemsListCompatibleCredentialManagerAcsSystemsRequest = @@ -309,11 +293,6 @@ export type AcsSystemsReportDevicesParameters = { acs_system_id: string } -/** - * @deprecated Use AcsSystemsReportDevicesParameters instead. - */ -export type AcsSystemsReportDevicesBody = AcsSystemsReportDevicesParameters - /** * @deprecated Use AcsSystemsReportDevicesRequest instead. */ diff --git a/src/lib/seam/connect/routes/acs/users/index.ts b/src/lib/seam/connect/routes/acs/users/index.ts index 747b84d5..7c31b60d 100644 --- a/src/lib/seam/connect/routes/acs/users/index.ts +++ b/src/lib/seam/connect/routes/acs/users/index.ts @@ -3,5 +3,4 @@ * Do not edit this file or add other files to this directory. */ -export * from './unmanaged/index.js' export * from './users.js' diff --git a/src/lib/seam/connect/routes/acs/users/unmanaged/index.ts b/src/lib/seam/connect/routes/acs/users/unmanaged/index.ts deleted file mode 100644 index bab8a37e..00000000 --- a/src/lib/seam/connect/routes/acs/users/unmanaged/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './unmanaged.js' diff --git a/src/lib/seam/connect/routes/acs/users/unmanaged/unmanaged.ts b/src/lib/seam/connect/routes/acs/users/unmanaged/unmanaged.ts deleted file mode 100644 index ba282848..00000000 --- a/src/lib/seam/connect/routes/acs/users/unmanaged/unmanaged.ts +++ /dev/null @@ -1,247 +0,0 @@ -/* - * 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' - -export class SeamHttpAcsUsersUnmanaged { - 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 = {}, - ): SeamHttpAcsUsersUnmanaged { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpAcsUsersUnmanaged(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpAcsUsersUnmanaged { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpAcsUsersUnmanaged(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpAcsUsersUnmanaged { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpAcsUsersUnmanaged(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 SeamHttpAcsUsersUnmanaged.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpAcsUsersUnmanaged.fromClientSessionToken(token, options) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpAcsUsersUnmanaged { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpAcsUsersUnmanaged(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpAcsUsersUnmanaged { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpAcsUsersUnmanaged(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() - } - - get( - parameters: AcsUsersUnmanagedGetParameters, - options: AcsUsersUnmanagedGetOptions = {}, - ): AcsUsersUnmanagedGetRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/acs/users/unmanaged/get', - method: 'POST', - body: parameters, - responseKey: 'acs_user', - options, - }) - } - - list( - parameters?: AcsUsersUnmanagedListParameters, - options: AcsUsersUnmanagedListOptions = {}, - ): AcsUsersUnmanagedListRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/acs/users/unmanaged/list', - method: 'POST', - body: parameters, - responseKey: 'acs_users', - options, - }) - } -} - -export type AcsUsersUnmanagedGetParameters = - RouteRequestBody<'/acs/users/unmanaged/get'> - -/** - * @deprecated Use AcsUsersUnmanagedGetParameters instead. - */ -export type AcsUsersUnmanagedGetParams = AcsUsersUnmanagedGetParameters - -/** - * @deprecated Use AcsUsersUnmanagedGetRequest instead. - */ -export type AcsUsersUnmanagedGetResponse = - RouteResponse<'/acs/users/unmanaged/get'> - -export type AcsUsersUnmanagedGetRequest = SeamHttpRequest< - AcsUsersUnmanagedGetResponse, - 'acs_user' -> - -export interface AcsUsersUnmanagedGetOptions {} - -export type AcsUsersUnmanagedListParameters = - RouteRequestBody<'/acs/users/unmanaged/list'> - -/** - * @deprecated Use AcsUsersUnmanagedListParameters instead. - */ -export type AcsUsersUnmanagedListParams = AcsUsersUnmanagedListParameters - -/** - * @deprecated Use AcsUsersUnmanagedListRequest instead. - */ -export type AcsUsersUnmanagedListResponse = - RouteResponse<'/acs/users/unmanaged/list'> - -export type AcsUsersUnmanagedListRequest = SeamHttpRequest< - AcsUsersUnmanagedListResponse, - 'acs_users' -> - -export interface AcsUsersUnmanagedListOptions {} diff --git a/src/lib/seam/connect/routes/acs/users/users.ts b/src/lib/seam/connect/routes/acs/users/users.ts index d4a147e8..c9d490e4 100644 --- a/src/lib/seam/connect/routes/acs/users/users.ts +++ b/src/lib/seam/connect/routes/acs/users/users.ts @@ -29,14 +29,12 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { AcsEntranceResource } from 'lib/seam/connect/resources/acs-entrance.js' -import type { AcsUserResource } from 'lib/seam/connect/resources/acs-user.js' +import type { AcsEntrance } from 'lib/seam/connect/resources/acs-entrance.js' +import type { AcsUser } from 'lib/seam/connect/resources/acs-user.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 { SeamHttpAcsUsersUnmanaged } from './unmanaged/index.js' - export class SeamHttpAcsUsers { client: Client readonly defaults: Required @@ -164,10 +162,6 @@ export class SeamHttpAcsUsers { await clientSessions.get() } - get unmanaged(): SeamHttpAcsUsersUnmanaged { - return SeamHttpAcsUsersUnmanaged.fromClient(this.client, this.defaults) - } - addToAccessGroup( parameters: AcsUsersAddToAccessGroupParameters, options: AcsUsersAddToAccessGroupOptions = {}, @@ -318,11 +312,6 @@ export type AcsUsersAddToAccessGroupParameters = { acs_user_id: string } -/** - * @deprecated Use AcsUsersAddToAccessGroupParameters instead. - */ -export type AcsUsersAddToAccessGroupBody = AcsUsersAddToAccessGroupParameters - /** * @deprecated Use AcsUsersAddToAccessGroupRequest instead. */ @@ -350,15 +339,10 @@ export type AcsUsersCreateParameters = { user_identity_id?: string | undefined } -/** - * @deprecated Use AcsUsersCreateParameters instead. - */ -export type AcsUsersCreateBody = AcsUsersCreateParameters - /** * @deprecated Use AcsUsersCreateRequest instead. */ -export type AcsUsersCreateResponse = { acs_user: AcsUserResource } +export type AcsUsersCreateResponse = { acs_user: AcsUser } export type AcsUsersCreateRequest = SeamHttpRequest< AcsUsersCreateResponse, @@ -373,11 +357,6 @@ export type AcsUsersDeleteParameters = { user_identity_id?: string | undefined } -/** - * @deprecated Use AcsUsersDeleteParameters instead. - */ -export type AcsUsersDeleteParams = AcsUsersDeleteParameters - /** * @deprecated Use AcsUsersDeleteRequest instead. */ @@ -393,15 +372,10 @@ export type AcsUsersGetParameters = { user_identity_id?: string | undefined } -/** - * @deprecated Use AcsUsersGetParameters instead. - */ -export type AcsUsersGetParams = AcsUsersGetParameters - /** * @deprecated Use AcsUsersGetRequest instead. */ -export type AcsUsersGetResponse = { acs_user: AcsUserResource } +export type AcsUsersGetResponse = { acs_user: AcsUser } export type AcsUsersGetRequest = SeamHttpRequest< AcsUsersGetResponse, @@ -421,15 +395,10 @@ export type AcsUsersListParameters = { user_identity_phone_number?: string | undefined } -/** - * @deprecated Use AcsUsersListParameters instead. - */ -export type AcsUsersListParams = AcsUsersListParameters - /** * @deprecated Use AcsUsersListRequest instead. */ -export type AcsUsersListResponse = { acs_users: Array } +export type AcsUsersListResponse = { acs_users: Array } export type AcsUsersListRequest = SeamHttpRequest< AcsUsersListResponse, @@ -444,17 +413,11 @@ export type AcsUsersListAccessibleEntrancesParameters = { user_identity_id?: string | undefined } -/** - * @deprecated Use AcsUsersListAccessibleEntrancesParameters instead. - */ -export type AcsUsersListAccessibleEntrancesParams = - AcsUsersListAccessibleEntrancesParameters - /** * @deprecated Use AcsUsersListAccessibleEntrancesRequest instead. */ export type AcsUsersListAccessibleEntrancesResponse = { - acs_entrances: Array + acs_entrances: Array } export type AcsUsersListAccessibleEntrancesRequest = SeamHttpRequest< @@ -471,12 +434,6 @@ export type AcsUsersRemoveFromAccessGroupParameters = { user_identity_id?: string | undefined } -/** - * @deprecated Use AcsUsersRemoveFromAccessGroupParameters instead. - */ -export type AcsUsersRemoveFromAccessGroupParams = - AcsUsersRemoveFromAccessGroupParameters - /** * @deprecated Use AcsUsersRemoveFromAccessGroupRequest instead. */ @@ -495,12 +452,6 @@ export type AcsUsersRevokeAccessToAllEntrancesParameters = { user_identity_id?: string | undefined } -/** - * @deprecated Use AcsUsersRevokeAccessToAllEntrancesParameters instead. - */ -export type AcsUsersRevokeAccessToAllEntrancesBody = - AcsUsersRevokeAccessToAllEntrancesParameters - /** * @deprecated Use AcsUsersRevokeAccessToAllEntrancesRequest instead. */ @@ -519,11 +470,6 @@ export type AcsUsersSuspendParameters = { user_identity_id?: string | undefined } -/** - * @deprecated Use AcsUsersSuspendParameters instead. - */ -export type AcsUsersSuspendBody = AcsUsersSuspendParameters - /** * @deprecated Use AcsUsersSuspendRequest instead. */ @@ -539,11 +485,6 @@ export type AcsUsersUnsuspendParameters = { user_identity_id?: string | undefined } -/** - * @deprecated Use AcsUsersUnsuspendParameters instead. - */ -export type AcsUsersUnsuspendBody = AcsUsersUnsuspendParameters - /** * @deprecated Use AcsUsersUnsuspendRequest instead. */ @@ -570,11 +511,6 @@ export type AcsUsersUpdateParameters = { user_identity_id?: string | undefined } -/** - * @deprecated Use AcsUsersUpdateParameters instead. - */ -export type AcsUsersUpdateBody = AcsUsersUpdateParameters - /** * @deprecated Use AcsUsersUpdateRequest instead. */ diff --git a/src/lib/seam/connect/routes/action-attempts/action-attempts.ts b/src/lib/seam/connect/routes/action-attempts/action-attempts.ts index f329ed11..5658884b 100644 --- a/src/lib/seam/connect/routes/action-attempts/action-attempts.ts +++ b/src/lib/seam/connect/routes/action-attempts/action-attempts.ts @@ -3,8 +3,6 @@ * Do not edit this file or add other files to this directory. */ -import type { RouteResponse } from '@seamapi/types/connect' - import { seamApiLtsVersion } from 'lib/lts-version.js' import { getAuthHeadersForClientSessionToken, @@ -31,7 +29,7 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { ActionAttemptResource } from 'lib/seam/connect/resources/action-attempt.js' +import type { ActionAttempt } from 'lib/seam/connect/resources/action-attempt.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' @@ -194,15 +192,10 @@ export type ActionAttemptsGetParameters = { action_attempt_id: string } -/** - * @deprecated Use ActionAttemptsGetParameters instead. - */ -export type ActionAttemptsGetParams = ActionAttemptsGetParameters - /** * @deprecated Use ActionAttemptsGetRequest instead. */ -export type ActionAttemptsGetResponse = RouteResponse<'/action_attempts/get'> +export type ActionAttemptsGetResponse = { action_attempt: ActionAttempt } export type ActionAttemptsGetRequest = SeamHttpRequest< ActionAttemptsGetResponse, @@ -221,16 +214,11 @@ export type ActionAttemptsListParameters = { page_cursor?: string | undefined } -/** - * @deprecated Use ActionAttemptsListParameters instead. - */ -export type ActionAttemptsListParams = ActionAttemptsListParameters - /** * @deprecated Use ActionAttemptsListRequest instead. */ export type ActionAttemptsListResponse = { - action_attempts: Array + action_attempts: Array } export type ActionAttemptsListRequest = SeamHttpRequest< diff --git a/src/lib/seam/connect/routes/bridges/bridges.ts b/src/lib/seam/connect/routes/bridges/bridges.ts deleted file mode 100644 index b04bf044..00000000 --- a/src/lib/seam/connect/routes/bridges/bridges.ts +++ /dev/null @@ -1,237 +0,0 @@ -/* - * 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' - -export class SeamHttpBridges { - 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 = {}, - ): SeamHttpBridges { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpBridges(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpBridges { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpBridges(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpBridges { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpBridges(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 SeamHttpBridges.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpBridges.fromClientSessionToken(token, options) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpBridges { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpBridges(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpBridges { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpBridges(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() - } - - get( - parameters: BridgesGetParameters, - options: BridgesGetOptions = {}, - ): BridgesGetRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/bridges/get', - method: 'POST', - body: parameters, - responseKey: 'bridge', - options, - }) - } - - list( - parameters?: BridgesListParameters, - options: BridgesListOptions = {}, - ): BridgesListRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/bridges/list', - method: 'POST', - body: parameters, - responseKey: 'bridges', - options, - }) - } -} - -export type BridgesGetParameters = RouteRequestBody<'/bridges/get'> - -/** - * @deprecated Use BridgesGetParameters instead. - */ -export type BridgesGetParams = BridgesGetParameters - -/** - * @deprecated Use BridgesGetRequest instead. - */ -export type BridgesGetResponse = RouteResponse<'/bridges/get'> - -export type BridgesGetRequest = SeamHttpRequest - -export interface BridgesGetOptions {} - -export type BridgesListParameters = RouteRequestBody<'/bridges/list'> - -/** - * @deprecated Use BridgesListParameters instead. - */ -export type BridgesListParams = BridgesListParameters - -/** - * @deprecated Use BridgesListRequest instead. - */ -export type BridgesListResponse = RouteResponse<'/bridges/list'> - -export type BridgesListRequest = SeamHttpRequest - -export interface BridgesListOptions {} diff --git a/src/lib/seam/connect/routes/bridges/index.ts b/src/lib/seam/connect/routes/bridges/index.ts deleted file mode 100644 index 17b80312..00000000 --- a/src/lib/seam/connect/routes/bridges/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './bridges.js' diff --git a/src/lib/seam/connect/routes/client-sessions/client-sessions.ts b/src/lib/seam/connect/routes/client-sessions/client-sessions.ts index a2c23557..96a8b964 100644 --- a/src/lib/seam/connect/routes/client-sessions/client-sessions.ts +++ b/src/lib/seam/connect/routes/client-sessions/client-sessions.ts @@ -29,7 +29,7 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { ClientSessionResource } from 'lib/seam/connect/resources/client-session.js' +import type { ClientSession } from 'lib/seam/connect/resources/client-session.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' @@ -263,17 +263,10 @@ export type ClientSessionsCreateParameters = { user_identity_ids?: Array | undefined } -/** - * @deprecated Use ClientSessionsCreateParameters instead. - */ -export type ClientSessionsCreateBody = ClientSessionsCreateParameters - /** * @deprecated Use ClientSessionsCreateRequest instead. */ -export type ClientSessionsCreateResponse = { - client_session: ClientSessionResource -} +export type ClientSessionsCreateResponse = { client_session: ClientSession } export type ClientSessionsCreateRequest = SeamHttpRequest< ClientSessionsCreateResponse, @@ -286,11 +279,6 @@ export type ClientSessionsDeleteParameters = { client_session_id: string } -/** - * @deprecated Use ClientSessionsDeleteParameters instead. - */ -export type ClientSessionsDeleteParams = ClientSessionsDeleteParameters - /** * @deprecated Use ClientSessionsDeleteRequest instead. */ @@ -305,17 +293,10 @@ export type ClientSessionsGetParameters = { user_identifier_key?: string | undefined } -/** - * @deprecated Use ClientSessionsGetParameters instead. - */ -export type ClientSessionsGetParams = ClientSessionsGetParameters - /** * @deprecated Use ClientSessionsGetRequest instead. */ -export type ClientSessionsGetResponse = { - client_session: ClientSessionResource -} +export type ClientSessionsGetResponse = { client_session: ClientSession } export type ClientSessionsGetRequest = SeamHttpRequest< ClientSessionsGetResponse, @@ -333,16 +314,11 @@ export type ClientSessionsGetOrCreateParameters = { user_identity_ids?: Array | undefined } -/** - * @deprecated Use ClientSessionsGetOrCreateParameters instead. - */ -export type ClientSessionsGetOrCreateBody = ClientSessionsGetOrCreateParameters - /** * @deprecated Use ClientSessionsGetOrCreateRequest instead. */ export type ClientSessionsGetOrCreateResponse = { - client_session: ClientSessionResource + client_session: ClientSession } export type ClientSessionsGetOrCreateRequest = SeamHttpRequest< @@ -361,11 +337,6 @@ export type ClientSessionsGrantAccessParameters = { user_identity_ids?: Array | undefined } -/** - * @deprecated Use ClientSessionsGrantAccessParameters instead. - */ -export type ClientSessionsGrantAccessBody = ClientSessionsGrantAccessParameters - /** * @deprecated Use ClientSessionsGrantAccessRequest instead. */ @@ -383,16 +354,11 @@ export type ClientSessionsListParameters = { without_user_identifier_key?: boolean | undefined } -/** - * @deprecated Use ClientSessionsListParameters instead. - */ -export type ClientSessionsListParams = ClientSessionsListParameters - /** * @deprecated Use ClientSessionsListRequest instead. */ export type ClientSessionsListResponse = { - client_sessions: Array + client_sessions: Array } export type ClientSessionsListRequest = SeamHttpRequest< @@ -406,11 +372,6 @@ export type ClientSessionsRevokeParameters = { client_session_id: string } -/** - * @deprecated Use ClientSessionsRevokeParameters instead. - */ -export type ClientSessionsRevokeBody = ClientSessionsRevokeParameters - /** * @deprecated Use ClientSessionsRevokeRequest instead. */ diff --git a/src/lib/seam/connect/routes/connect-webviews/connect-webviews.ts b/src/lib/seam/connect/routes/connect-webviews/connect-webviews.ts index 949053ab..f7c0ec56 100644 --- a/src/lib/seam/connect/routes/connect-webviews/connect-webviews.ts +++ b/src/lib/seam/connect/routes/connect-webviews/connect-webviews.ts @@ -29,7 +29,7 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { ConnectWebviewResource } from 'lib/seam/connect/resources/connect-webview.js' +import type { ConnectWebview } from 'lib/seam/connect/resources/connect-webview.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' @@ -296,7 +296,6 @@ export type ConnectWebviewsCreateParameters = { custom_redirect_failure_url?: string | undefined custom_redirect_url?: string | undefined customer_key?: string | undefined - device_selection_mode?: 'none' | 'single' | 'multiple' | undefined excluded_providers?: Array | undefined provider_category?: | 'stable' @@ -312,17 +311,10 @@ export type ConnectWebviewsCreateParameters = { wait_for_device_creation?: boolean | undefined } -/** - * @deprecated Use ConnectWebviewsCreateParameters instead. - */ -export type ConnectWebviewsCreateBody = ConnectWebviewsCreateParameters - /** * @deprecated Use ConnectWebviewsCreateRequest instead. */ -export type ConnectWebviewsCreateResponse = { - connect_webview: ConnectWebviewResource -} +export type ConnectWebviewsCreateResponse = { connect_webview: ConnectWebview } export type ConnectWebviewsCreateRequest = SeamHttpRequest< ConnectWebviewsCreateResponse, @@ -335,11 +327,6 @@ export type ConnectWebviewsDeleteParameters = { connect_webview_id: string } -/** - * @deprecated Use ConnectWebviewsDeleteParameters instead. - */ -export type ConnectWebviewsDeleteParams = ConnectWebviewsDeleteParameters - /** * @deprecated Use ConnectWebviewsDeleteRequest instead. */ @@ -353,17 +340,10 @@ export type ConnectWebviewsGetParameters = { connect_webview_id: string } -/** - * @deprecated Use ConnectWebviewsGetParameters instead. - */ -export type ConnectWebviewsGetParams = ConnectWebviewsGetParameters - /** * @deprecated Use ConnectWebviewsGetRequest instead. */ -export type ConnectWebviewsGetResponse = { - connect_webview: ConnectWebviewResource -} +export type ConnectWebviewsGetResponse = { connect_webview: ConnectWebview } export type ConnectWebviewsGetRequest = SeamHttpRequest< ConnectWebviewsGetResponse, @@ -381,16 +361,11 @@ export type ConnectWebviewsListParameters = { user_identifier_key?: string | undefined } -/** - * @deprecated Use ConnectWebviewsListParameters instead. - */ -export type ConnectWebviewsListParams = ConnectWebviewsListParameters - /** * @deprecated Use ConnectWebviewsListRequest instead. */ export type ConnectWebviewsListResponse = { - connect_webviews: Array + connect_webviews: Array } export type ConnectWebviewsListRequest = SeamHttpRequest< diff --git a/src/lib/seam/connect/routes/connected-accounts/connected-accounts.ts b/src/lib/seam/connect/routes/connected-accounts/connected-accounts.ts index 9939d41d..f8583724 100644 --- a/src/lib/seam/connect/routes/connected-accounts/connected-accounts.ts +++ b/src/lib/seam/connect/routes/connected-accounts/connected-accounts.ts @@ -29,7 +29,7 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { ConnectedAccountResource } from 'lib/seam/connect/resources/connected-account.js' +import type { ConnectedAccount } from 'lib/seam/connect/resources/connected-account.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' @@ -238,15 +238,8 @@ export class SeamHttpConnectedAccounts { export type ConnectedAccountsDeleteParameters = { connected_account_id: string - - sync?: boolean | undefined } -/** - * @deprecated Use ConnectedAccountsDeleteParameters instead. - */ -export type ConnectedAccountsDeleteParams = ConnectedAccountsDeleteParameters - /** * @deprecated Use ConnectedAccountsDeleteRequest instead. */ @@ -261,16 +254,11 @@ export type ConnectedAccountsGetParameters = { email?: string | undefined } -/** - * @deprecated Use ConnectedAccountsGetParameters instead. - */ -export type ConnectedAccountsGetParams = ConnectedAccountsGetParameters - /** * @deprecated Use ConnectedAccountsGetRequest instead. */ export type ConnectedAccountsGetResponse = { - connected_account: ConnectedAccountResource + connected_account: ConnectedAccount } export type ConnectedAccountsGetRequest = SeamHttpRequest< @@ -290,16 +278,11 @@ export type ConnectedAccountsListParameters = { user_identifier_key?: string | undefined } -/** - * @deprecated Use ConnectedAccountsListParameters instead. - */ -export type ConnectedAccountsListParams = ConnectedAccountsListParameters - /** * @deprecated Use ConnectedAccountsListRequest instead. */ export type ConnectedAccountsListResponse = { - connected_accounts: Array + connected_accounts: Array } export type ConnectedAccountsListRequest = SeamHttpRequest< @@ -313,11 +296,6 @@ export type ConnectedAccountsSyncParameters = { connected_account_id: string } -/** - * @deprecated Use ConnectedAccountsSyncParameters instead. - */ -export type ConnectedAccountsSyncBody = ConnectedAccountsSyncParameters - /** * @deprecated Use ConnectedAccountsSyncRequest instead. */ @@ -341,11 +319,6 @@ export type ConnectedAccountsUpdateParameters = { display_name?: string | undefined } -/** - * @deprecated Use ConnectedAccountsUpdateParameters instead. - */ -export type ConnectedAccountsUpdateBody = ConnectedAccountsUpdateParameters - /** * @deprecated Use ConnectedAccountsUpdateRequest instead. */ diff --git a/src/lib/seam/connect/routes/connected-accounts/simulate/simulate.ts b/src/lib/seam/connect/routes/connected-accounts/simulate/simulate.ts index 7b89096b..86d0ed32 100644 --- a/src/lib/seam/connect/routes/connected-accounts/simulate/simulate.ts +++ b/src/lib/seam/connect/routes/connected-accounts/simulate/simulate.ts @@ -181,12 +181,6 @@ export type ConnectedAccountsSimulateDisconnectParameters = { connected_account_id: string } -/** - * @deprecated Use ConnectedAccountsSimulateDisconnectParameters instead. - */ -export type ConnectedAccountsSimulateDisconnectBody = - ConnectedAccountsSimulateDisconnectParameters - /** * @deprecated Use ConnectedAccountsSimulateDisconnectRequest instead. */ diff --git a/src/lib/seam/connect/routes/customers/customers.ts b/src/lib/seam/connect/routes/customers/customers.ts index fcaa3255..f077eaca 100644 --- a/src/lib/seam/connect/routes/customers/customers.ts +++ b/src/lib/seam/connect/routes/customers/customers.ts @@ -29,13 +29,11 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { CustomerPortalResource } from 'lib/seam/connect/resources/customer-portal.js' +import type { CustomerPortal } from 'lib/seam/connect/resources/customer-portal.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 { SeamHttpCustomersReservations } from './reservations/index.js' - export class SeamHttpCustomers { client: Client readonly defaults: Required @@ -163,10 +161,6 @@ export class SeamHttpCustomers { await clientSessions.get() } - get reservations(): SeamHttpCustomersReservations { - return SeamHttpCustomersReservations.fromClient(this.client, this.defaults) - } - createPortal( parameters?: CustomersCreatePortalParameters, options: CustomersCreatePortalOptions = {}, @@ -208,7 +202,6 @@ export class SeamHttpCustomers { } export type CustomersCreatePortalParameters = { - _dev?: boolean | undefined customer_resources_filters?: | Array<{ field?: string | undefined @@ -524,17 +517,10 @@ export type CustomersCreatePortalParameters = { | undefined } -/** - * @deprecated Use CustomersCreatePortalParameters instead. - */ -export type CustomersCreatePortalBody = CustomersCreatePortalParameters - /** * @deprecated Use CustomersCreatePortalRequest instead. */ -export type CustomersCreatePortalResponse = { - customer_portal: CustomerPortalResource -} +export type CustomersCreatePortalResponse = { customer_portal: CustomerPortal } export type CustomersCreatePortalRequest = SeamHttpRequest< CustomersCreatePortalResponse, @@ -565,11 +551,6 @@ export type CustomersDeleteDataParameters = { user_keys?: Array | undefined } -/** - * @deprecated Use CustomersDeleteDataParameters instead. - */ -export type CustomersDeleteDataParams = CustomersDeleteDataParameters - /** * @deprecated Use CustomersDeleteDataRequest instead. */ @@ -789,11 +770,6 @@ export type CustomersPushDataParameters = { | undefined } -/** - * @deprecated Use CustomersPushDataParameters instead. - */ -export type CustomersPushDataBody = CustomersPushDataParameters - /** * @deprecated Use CustomersPushDataRequest instead. */ diff --git a/src/lib/seam/connect/routes/customers/index.ts b/src/lib/seam/connect/routes/customers/index.ts index 5dfe6520..9126f05d 100644 --- a/src/lib/seam/connect/routes/customers/index.ts +++ b/src/lib/seam/connect/routes/customers/index.ts @@ -4,4 +4,3 @@ */ export * from './customers.js' -export * from './reservations/index.js' diff --git a/src/lib/seam/connect/routes/customers/reservations/index.ts b/src/lib/seam/connect/routes/customers/reservations/index.ts deleted file mode 100644 index 72e7f4fc..00000000 --- a/src/lib/seam/connect/routes/customers/reservations/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './reservations.js' diff --git a/src/lib/seam/connect/routes/customers/reservations/reservations.ts b/src/lib/seam/connect/routes/customers/reservations/reservations.ts deleted file mode 100644 index 313156cc..00000000 --- a/src/lib/seam/connect/routes/customers/reservations/reservations.ts +++ /dev/null @@ -1,209 +0,0 @@ -/* - * 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' - -export class SeamHttpCustomersReservations { - 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 = {}, - ): SeamHttpCustomersReservations { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpCustomersReservations(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpCustomersReservations { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpCustomersReservations(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpCustomersReservations { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpCustomersReservations(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 SeamHttpCustomersReservations.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpCustomersReservations.fromClientSessionToken(token, options) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpCustomersReservations { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpCustomersReservations(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpCustomersReservations { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpCustomersReservations(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() - } - - createDeepLink( - parameters: CustomersReservationsCreateDeepLinkParameters, - options: CustomersReservationsCreateDeepLinkOptions = {}, - ): CustomersReservationsCreateDeepLinkRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/customers/reservations/create_deep_link', - method: 'POST', - body: parameters, - responseKey: 'deep_link', - options, - }) - } -} - -export type CustomersReservationsCreateDeepLinkParameters = - RouteRequestBody<'/customers/reservations/create_deep_link'> - -/** - * @deprecated Use CustomersReservationsCreateDeepLinkParameters instead. - */ -export type CustomersReservationsCreateDeepLinkBody = - CustomersReservationsCreateDeepLinkParameters - -/** - * @deprecated Use CustomersReservationsCreateDeepLinkRequest instead. - */ -export type CustomersReservationsCreateDeepLinkResponse = - RouteResponse<'/customers/reservations/create_deep_link'> - -export type CustomersReservationsCreateDeepLinkRequest = SeamHttpRequest< - CustomersReservationsCreateDeepLinkResponse, - 'deep_link' -> - -export interface CustomersReservationsCreateDeepLinkOptions {} diff --git a/src/lib/seam/connect/routes/devices/devices.ts b/src/lib/seam/connect/routes/devices/devices.ts index f79b108b..ae8e001e 100644 --- a/src/lib/seam/connect/routes/devices/devices.ts +++ b/src/lib/seam/connect/routes/devices/devices.ts @@ -3,8 +3,6 @@ * 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, @@ -31,8 +29,8 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { DeviceResource } from 'lib/seam/connect/resources/device.js' -import type { DeviceProviderResource } from 'lib/seam/connect/resources/device-provider.js' +import type { Device } from 'lib/seam/connect/resources/device.js' +import type { DeviceProvider } from 'lib/seam/connect/resources/device-provider.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' @@ -175,24 +173,6 @@ export class SeamHttpDevices { return SeamHttpDevicesUnmanaged.fromClient(this.client, this.defaults) } - delete( - parameters: DevicesDeleteParameters, - options: DevicesDeleteOptions = {}, - ): DevicesDeleteRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/devices/delete', - method: 'POST', - body: parameters, - responseKey: undefined, - options, - }) - } - get( parameters?: DevicesGetParameters, options: DevicesGetOptions = {}, @@ -259,36 +239,15 @@ export class SeamHttpDevices { } } -export type DevicesDeleteParameters = RouteRequestBody<'/devices/delete'> - -/** - * @deprecated Use DevicesDeleteParameters instead. - */ -export type DevicesDeleteParams = DevicesDeleteParameters - -/** - * @deprecated Use DevicesDeleteRequest instead. - */ -export type DevicesDeleteResponse = RouteResponse<'/devices/delete'> - -export type DevicesDeleteRequest = SeamHttpRequest - -export interface DevicesDeleteOptions {} - export type DevicesGetParameters = { device_id?: string | undefined name?: string | undefined } -/** - * @deprecated Use DevicesGetParameters instead. - */ -export type DevicesGetParams = DevicesGetParameters - /** * @deprecated Use DevicesGetRequest instead. */ -export type DevicesGetResponse = { device: DeviceResource } +export type DevicesGetResponse = { device: Device } export type DevicesGetRequest = SeamHttpRequest @@ -392,54 +351,6 @@ export type DevicesListParameters = { | 'ring_camera' > | undefined - exclude_if?: - | Array< - | 'can_remotely_unlock' - | 'can_remotely_lock' - | 'can_program_offline_access_codes' - | 'can_program_online_access_codes' - | 'can_hvac_heat' - | 'can_hvac_cool' - | 'can_hvac_heat_cool' - | 'can_turn_off_hvac' - | 'can_simulate_removal' - | 'can_simulate_connection' - | 'can_simulate_disconnection' - | 'can_unlock_with_code' - | 'can_run_thermostat_programs' - | 'can_program_thermostat_programs_as_weekday_weekend' - | 'can_program_thermostat_programs_as_different_each_day' - | 'can_program_thermostat_programs_as_same_each_day' - | 'can_simulate_hub_connection' - | 'can_simulate_hub_disconnection' - | 'can_simulate_paid_subscription' - | 'can_configure_auto_lock' - > - | undefined - include_if?: - | Array< - | 'can_remotely_unlock' - | 'can_remotely_lock' - | 'can_program_offline_access_codes' - | 'can_program_online_access_codes' - | 'can_hvac_heat' - | 'can_hvac_cool' - | 'can_hvac_heat_cool' - | 'can_turn_off_hvac' - | 'can_simulate_removal' - | 'can_simulate_connection' - | 'can_simulate_disconnection' - | 'can_unlock_with_code' - | 'can_run_thermostat_programs' - | 'can_program_thermostat_programs_as_weekday_weekend' - | 'can_program_thermostat_programs_as_different_each_day' - | 'can_program_thermostat_programs_as_same_each_day' - | 'can_simulate_hub_connection' - | 'can_simulate_hub_disconnection' - | 'can_simulate_paid_subscription' - | 'can_configure_auto_lock' - > - | undefined limit?: number | undefined manufacturer?: | 'akuvox' @@ -501,15 +412,10 @@ export type DevicesListParameters = { user_identifier_key?: string | undefined } -/** - * @deprecated Use DevicesListParameters instead. - */ -export type DevicesListParams = DevicesListParameters - /** * @deprecated Use DevicesListRequest instead. */ -export type DevicesListResponse = { devices: Array } +export type DevicesListResponse = { devices: Array } export type DevicesListRequest = SeamHttpRequest @@ -528,17 +434,11 @@ export type DevicesListDeviceProvidersParameters = { | undefined } -/** - * @deprecated Use DevicesListDeviceProvidersParameters instead. - */ -export type DevicesListDeviceProvidersParams = - DevicesListDeviceProvidersParameters - /** * @deprecated Use DevicesListDeviceProvidersRequest instead. */ export type DevicesListDeviceProvidersResponse = { - device_providers: Array + device_providers: Array } export type DevicesListDeviceProvidersRequest = SeamHttpRequest< @@ -1859,12 +1759,6 @@ export type DevicesReportProviderMetadataParameters = { }> } -/** - * @deprecated Use DevicesReportProviderMetadataParameters instead. - */ -export type DevicesReportProviderMetadataBody = - DevicesReportProviderMetadataParameters - /** * @deprecated Use DevicesReportProviderMetadataRequest instead. */ @@ -1891,11 +1785,6 @@ export type DevicesUpdateParameters = { | undefined } -/** - * @deprecated Use DevicesUpdateParameters instead. - */ -export type DevicesUpdateBody = DevicesUpdateParameters - /** * @deprecated Use DevicesUpdateRequest instead. */ diff --git a/src/lib/seam/connect/routes/devices/simulate/simulate.ts b/src/lib/seam/connect/routes/devices/simulate/simulate.ts index eb28f0e4..30845447 100644 --- a/src/lib/seam/connect/routes/devices/simulate/simulate.ts +++ b/src/lib/seam/connect/routes/devices/simulate/simulate.ts @@ -243,11 +243,6 @@ export type DevicesSimulateConnectParameters = { device_id: string } -/** - * @deprecated Use DevicesSimulateConnectParameters instead. - */ -export type DevicesSimulateConnectBody = DevicesSimulateConnectParameters - /** * @deprecated Use DevicesSimulateConnectRequest instead. */ @@ -261,12 +256,6 @@ export type DevicesSimulateConnectToHubParameters = { device_id: string } -/** - * @deprecated Use DevicesSimulateConnectToHubParameters instead. - */ -export type DevicesSimulateConnectToHubBody = - DevicesSimulateConnectToHubParameters - /** * @deprecated Use DevicesSimulateConnectToHubRequest instead. */ @@ -283,11 +272,6 @@ export type DevicesSimulateDisconnectParameters = { device_id: string } -/** - * @deprecated Use DevicesSimulateDisconnectParameters instead. - */ -export type DevicesSimulateDisconnectBody = DevicesSimulateDisconnectParameters - /** * @deprecated Use DevicesSimulateDisconnectRequest instead. */ @@ -301,12 +285,6 @@ export type DevicesSimulateDisconnectFromHubParameters = { device_id: string } -/** - * @deprecated Use DevicesSimulateDisconnectFromHubParameters instead. - */ -export type DevicesSimulateDisconnectFromHubBody = - DevicesSimulateDisconnectFromHubParameters - /** * @deprecated Use DevicesSimulateDisconnectFromHubRequest instead. */ @@ -325,12 +303,6 @@ export type DevicesSimulatePaidSubscriptionParameters = { is_expired: boolean } -/** - * @deprecated Use DevicesSimulatePaidSubscriptionParameters instead. - */ -export type DevicesSimulatePaidSubscriptionBody = - DevicesSimulatePaidSubscriptionParameters - /** * @deprecated Use DevicesSimulatePaidSubscriptionRequest instead. */ @@ -347,11 +319,6 @@ export type DevicesSimulateRemoveParameters = { device_id: string } -/** - * @deprecated Use DevicesSimulateRemoveParameters instead. - */ -export type DevicesSimulateRemoveBody = DevicesSimulateRemoveParameters - /** * @deprecated Use DevicesSimulateRemoveRequest instead. */ diff --git a/src/lib/seam/connect/routes/devices/unmanaged/unmanaged.ts b/src/lib/seam/connect/routes/devices/unmanaged/unmanaged.ts index ddb2d287..de5c6341 100644 --- a/src/lib/seam/connect/routes/devices/unmanaged/unmanaged.ts +++ b/src/lib/seam/connect/routes/devices/unmanaged/unmanaged.ts @@ -29,7 +29,7 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { UnmanagedDeviceResource } from 'lib/seam/connect/resources/unmanaged-device.js' +import type { UnmanagedDevice } from 'lib/seam/connect/resources/unmanaged-device.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' @@ -206,15 +206,10 @@ export type DevicesUnmanagedGetParameters = { name?: string | undefined } -/** - * @deprecated Use DevicesUnmanagedGetParameters instead. - */ -export type DevicesUnmanagedGetParams = DevicesUnmanagedGetParameters - /** * @deprecated Use DevicesUnmanagedGetRequest instead. */ -export type DevicesUnmanagedGetResponse = { device: UnmanagedDeviceResource } +export type DevicesUnmanagedGetResponse = { device: UnmanagedDevice } export type DevicesUnmanagedGetRequest = SeamHttpRequest< DevicesUnmanagedGetResponse, @@ -321,54 +316,6 @@ export type DevicesUnmanagedListParameters = { | 'ring_camera' > | undefined - exclude_if?: - | Array< - | 'can_remotely_unlock' - | 'can_remotely_lock' - | 'can_program_offline_access_codes' - | 'can_program_online_access_codes' - | 'can_hvac_heat' - | 'can_hvac_cool' - | 'can_hvac_heat_cool' - | 'can_turn_off_hvac' - | 'can_simulate_removal' - | 'can_simulate_connection' - | 'can_simulate_disconnection' - | 'can_unlock_with_code' - | 'can_run_thermostat_programs' - | 'can_program_thermostat_programs_as_weekday_weekend' - | 'can_program_thermostat_programs_as_different_each_day' - | 'can_program_thermostat_programs_as_same_each_day' - | 'can_simulate_hub_connection' - | 'can_simulate_hub_disconnection' - | 'can_simulate_paid_subscription' - | 'can_configure_auto_lock' - > - | undefined - include_if?: - | Array< - | 'can_remotely_unlock' - | 'can_remotely_lock' - | 'can_program_offline_access_codes' - | 'can_program_online_access_codes' - | 'can_hvac_heat' - | 'can_hvac_cool' - | 'can_hvac_heat_cool' - | 'can_turn_off_hvac' - | 'can_simulate_removal' - | 'can_simulate_connection' - | 'can_simulate_disconnection' - | 'can_unlock_with_code' - | 'can_run_thermostat_programs' - | 'can_program_thermostat_programs_as_weekday_weekend' - | 'can_program_thermostat_programs_as_different_each_day' - | 'can_program_thermostat_programs_as_same_each_day' - | 'can_simulate_hub_connection' - | 'can_simulate_hub_disconnection' - | 'can_simulate_paid_subscription' - | 'can_configure_auto_lock' - > - | undefined limit?: number | undefined manufacturer?: | 'akuvox' @@ -430,17 +377,10 @@ export type DevicesUnmanagedListParameters = { user_identifier_key?: string | undefined } -/** - * @deprecated Use DevicesUnmanagedListParameters instead. - */ -export type DevicesUnmanagedListParams = DevicesUnmanagedListParameters - /** * @deprecated Use DevicesUnmanagedListRequest instead. */ -export type DevicesUnmanagedListResponse = { - devices: Array -} +export type DevicesUnmanagedListResponse = { devices: Array } export type DevicesUnmanagedListRequest = SeamHttpRequest< DevicesUnmanagedListResponse, @@ -456,11 +396,6 @@ export type DevicesUnmanagedUpdateParameters = { is_managed?: boolean | undefined } -/** - * @deprecated Use DevicesUnmanagedUpdateParameters instead. - */ -export type DevicesUnmanagedUpdateBody = DevicesUnmanagedUpdateParameters - /** * @deprecated Use DevicesUnmanagedUpdateRequest instead. */ diff --git a/src/lib/seam/connect/routes/events/events.ts b/src/lib/seam/connect/routes/events/events.ts index 15d8fb83..1e7be7e5 100644 --- a/src/lib/seam/connect/routes/events/events.ts +++ b/src/lib/seam/connect/routes/events/events.ts @@ -29,7 +29,7 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { EventResource } from 'lib/seam/connect/resources/event.js' +import type { SeamEvent } from 'lib/seam/connect/resources/event.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' @@ -194,15 +194,10 @@ export type EventsGetParameters = { event_type?: string | undefined } -/** - * @deprecated Use EventsGetParameters instead. - */ -export type EventsGetParams = EventsGetParameters - /** * @deprecated Use EventsGetRequest instead. */ -export type EventsGetResponse = { event: EventResource } +export type EventsGetResponse = { event: SeamEvent } export type EventsGetRequest = SeamHttpRequest @@ -461,15 +456,10 @@ export type EventsListParameters = { user_identity_id?: string | undefined } -/** - * @deprecated Use EventsListParameters instead. - */ -export type EventsListParams = EventsListParameters - /** * @deprecated Use EventsListRequest instead. */ -export type EventsListResponse = { events: Array } +export type EventsListResponse = { events: Array } export type EventsListRequest = SeamHttpRequest diff --git a/src/lib/seam/connect/routes/index.ts b/src/lib/seam/connect/routes/index.ts index 7c121db5..4bf03881 100644 --- a/src/lib/seam/connect/routes/index.ts +++ b/src/lib/seam/connect/routes/index.ts @@ -8,7 +8,6 @@ export * from './access-grants/index.js' export * from './access-methods/index.js' export * from './acs/index.js' export * from './action-attempts/index.js' -export * from './bridges/index.js' export * from './client-sessions/index.js' export * from './connect-webviews/index.js' export * from './connected-accounts/index.js' @@ -19,14 +18,12 @@ export * from './instant-keys/index.js' export * from './locks/index.js' export * from './noise-sensors/index.js' export * from './phones/index.js' -export * from './seam/index.js' export * from './seam-http.js' export * from './seam-http-endpoints.js' export * from './seam-http-endpoints-without-workspace.js' export * from './seam-http-without-workspace.js' export * from './spaces/index.js' export * from './thermostats/index.js' -export * from './unstable-partner/index.js' export * from './user-identities/index.js' export * from './webhooks/index.js' export * from './workspaces/index.js' diff --git a/src/lib/seam/connect/routes/instant-keys/instant-keys.ts b/src/lib/seam/connect/routes/instant-keys/instant-keys.ts index 6ad20946..8b11fbd1 100644 --- a/src/lib/seam/connect/routes/instant-keys/instant-keys.ts +++ b/src/lib/seam/connect/routes/instant-keys/instant-keys.ts @@ -29,7 +29,7 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { InstantKeyResource } from 'lib/seam/connect/resources/instant-key.js' +import type { InstantKey } from 'lib/seam/connect/resources/instant-key.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' @@ -205,11 +205,6 @@ export type InstantKeysDeleteParameters = { instant_key_id: string } -/** - * @deprecated Use InstantKeysDeleteParameters instead. - */ -export type InstantKeysDeleteParams = InstantKeysDeleteParameters - /** * @deprecated Use InstantKeysDeleteRequest instead. */ @@ -224,15 +219,10 @@ export type InstantKeysGetParameters = { instant_key_url?: string | undefined } -/** - * @deprecated Use InstantKeysGetParameters instead. - */ -export type InstantKeysGetParams = InstantKeysGetParameters - /** * @deprecated Use InstantKeysGetRequest instead. */ -export type InstantKeysGetResponse = { instant_key: InstantKeyResource } +export type InstantKeysGetResponse = { instant_key: InstantKey } export type InstantKeysGetRequest = SeamHttpRequest< InstantKeysGetResponse, @@ -245,17 +235,10 @@ export type InstantKeysListParameters = { user_identity_id?: string | undefined } -/** - * @deprecated Use InstantKeysListParameters instead. - */ -export type InstantKeysListParams = InstantKeysListParameters - /** * @deprecated Use InstantKeysListRequest instead. */ -export type InstantKeysListResponse = { - instant_keys: Array -} +export type InstantKeysListResponse = { instant_keys: Array } export type InstantKeysListRequest = SeamHttpRequest< InstantKeysListResponse, diff --git a/src/lib/seam/connect/routes/locks/locks.ts b/src/lib/seam/connect/routes/locks/locks.ts index b9a657d0..2cdc07b6 100644 --- a/src/lib/seam/connect/routes/locks/locks.ts +++ b/src/lib/seam/connect/routes/locks/locks.ts @@ -3,8 +3,6 @@ * Do not edit this file or add other files to this directory. */ -import type { RouteResponse } from '@seamapi/types/connect' - import { seamApiLtsVersion } from 'lib/lts-version.js' import { getAuthHeadersForClientSessionToken, @@ -31,7 +29,8 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { DeviceResource } from 'lib/seam/connect/resources/device.js' +import type { ActionAttempt } from 'lib/seam/connect/resources/action-attempt.js' +import type { Device } from 'lib/seam/connect/resources/device.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' @@ -242,16 +241,10 @@ export type LocksConfigureAutoLockParameters = { device_id: string } -/** - * @deprecated Use LocksConfigureAutoLockParameters instead. - */ -export type LocksConfigureAutoLockBody = LocksConfigureAutoLockParameters - /** * @deprecated Use LocksConfigureAutoLockRequest instead. */ -export type LocksConfigureAutoLockResponse = - RouteResponse<'/locks/configure_auto_lock'> +export type LocksConfigureAutoLockResponse = { action_attempt: ActionAttempt } export type LocksConfigureAutoLockRequest = SeamHttpRequest< LocksConfigureAutoLockResponse, @@ -268,15 +261,10 @@ export type LocksGetParameters = { name?: string | undefined } -/** - * @deprecated Use LocksGetParameters instead. - */ -export type LocksGetParams = LocksGetParameters - /** * @deprecated Use LocksGetRequest instead. */ -export type LocksGetResponse = { device: DeviceResource } +export type LocksGetResponse = { device: Device } export type LocksGetRequest = SeamHttpRequest @@ -356,54 +344,6 @@ export type LocksListParameters = { | 'aqara_lock' > | undefined - exclude_if?: - | Array< - | 'can_remotely_unlock' - | 'can_remotely_lock' - | 'can_program_offline_access_codes' - | 'can_program_online_access_codes' - | 'can_hvac_heat' - | 'can_hvac_cool' - | 'can_hvac_heat_cool' - | 'can_turn_off_hvac' - | 'can_simulate_removal' - | 'can_simulate_connection' - | 'can_simulate_disconnection' - | 'can_unlock_with_code' - | 'can_run_thermostat_programs' - | 'can_program_thermostat_programs_as_weekday_weekend' - | 'can_program_thermostat_programs_as_different_each_day' - | 'can_program_thermostat_programs_as_same_each_day' - | 'can_simulate_hub_connection' - | 'can_simulate_hub_disconnection' - | 'can_simulate_paid_subscription' - | 'can_configure_auto_lock' - > - | undefined - include_if?: - | Array< - | 'can_remotely_unlock' - | 'can_remotely_lock' - | 'can_program_offline_access_codes' - | 'can_program_online_access_codes' - | 'can_hvac_heat' - | 'can_hvac_cool' - | 'can_hvac_heat_cool' - | 'can_turn_off_hvac' - | 'can_simulate_removal' - | 'can_simulate_connection' - | 'can_simulate_disconnection' - | 'can_unlock_with_code' - | 'can_run_thermostat_programs' - | 'can_program_thermostat_programs_as_weekday_weekend' - | 'can_program_thermostat_programs_as_different_each_day' - | 'can_program_thermostat_programs_as_same_each_day' - | 'can_simulate_hub_connection' - | 'can_simulate_hub_disconnection' - | 'can_simulate_paid_subscription' - | 'can_configure_auto_lock' - > - | undefined limit?: number | undefined manufacturer?: | 'akuvox' @@ -446,15 +386,10 @@ export type LocksListParameters = { user_identifier_key?: string | undefined } -/** - * @deprecated Use LocksListParameters instead. - */ -export type LocksListParams = LocksListParameters - /** * @deprecated Use LocksListRequest instead. */ -export type LocksListResponse = { devices: Array } +export type LocksListResponse = { devices: Array } export type LocksListRequest = SeamHttpRequest @@ -462,19 +397,12 @@ export interface LocksListOptions {} export type LocksLockDoorParameters = { device_id: string - - sync?: boolean | undefined } -/** - * @deprecated Use LocksLockDoorParameters instead. - */ -export type LocksLockDoorBody = LocksLockDoorParameters - /** * @deprecated Use LocksLockDoorRequest instead. */ -export type LocksLockDoorResponse = RouteResponse<'/locks/lock_door'> +export type LocksLockDoorResponse = { action_attempt: ActionAttempt } export type LocksLockDoorRequest = SeamHttpRequest< LocksLockDoorResponse, @@ -488,19 +416,12 @@ export type LocksLockDoorOptions = Pick< export type LocksUnlockDoorParameters = { device_id: string - - sync?: boolean | undefined } -/** - * @deprecated Use LocksUnlockDoorParameters instead. - */ -export type LocksUnlockDoorBody = LocksUnlockDoorParameters - /** * @deprecated Use LocksUnlockDoorRequest instead. */ -export type LocksUnlockDoorResponse = RouteResponse<'/locks/unlock_door'> +export type LocksUnlockDoorResponse = { action_attempt: ActionAttempt } export type LocksUnlockDoorRequest = SeamHttpRequest< LocksUnlockDoorResponse, diff --git a/src/lib/seam/connect/routes/locks/simulate/simulate.ts b/src/lib/seam/connect/routes/locks/simulate/simulate.ts index 95a16948..ced2a8f4 100644 --- a/src/lib/seam/connect/routes/locks/simulate/simulate.ts +++ b/src/lib/seam/connect/routes/locks/simulate/simulate.ts @@ -3,8 +3,6 @@ * Do not edit this file or add other files to this directory. */ -import type { RouteResponse } from '@seamapi/types/connect' - import { seamApiLtsVersion } from 'lib/lts-version.js' import { getAuthHeadersForClientSessionToken, @@ -31,6 +29,7 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import type { ActionAttempt } from 'lib/seam/connect/resources/action-attempt.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' @@ -195,17 +194,12 @@ export type LocksSimulateKeypadCodeEntryParameters = { device_id: string } -/** - * @deprecated Use LocksSimulateKeypadCodeEntryParameters instead. - */ -export type LocksSimulateKeypadCodeEntryBody = - LocksSimulateKeypadCodeEntryParameters - /** * @deprecated Use LocksSimulateKeypadCodeEntryRequest instead. */ -export type LocksSimulateKeypadCodeEntryResponse = - RouteResponse<'/locks/simulate/keypad_code_entry'> +export type LocksSimulateKeypadCodeEntryResponse = { + action_attempt: ActionAttempt +} export type LocksSimulateKeypadCodeEntryRequest = SeamHttpRequest< LocksSimulateKeypadCodeEntryResponse, @@ -221,17 +215,12 @@ export type LocksSimulateManualLockViaKeypadParameters = { device_id: string } -/** - * @deprecated Use LocksSimulateManualLockViaKeypadParameters instead. - */ -export type LocksSimulateManualLockViaKeypadBody = - LocksSimulateManualLockViaKeypadParameters - /** * @deprecated Use LocksSimulateManualLockViaKeypadRequest instead. */ -export type LocksSimulateManualLockViaKeypadResponse = - RouteResponse<'/locks/simulate/manual_lock_via_keypad'> +export type LocksSimulateManualLockViaKeypadResponse = { + action_attempt: ActionAttempt +} export type LocksSimulateManualLockViaKeypadRequest = SeamHttpRequest< LocksSimulateManualLockViaKeypadResponse, diff --git a/src/lib/seam/connect/routes/noise-sensors/noise-sensors.ts b/src/lib/seam/connect/routes/noise-sensors/noise-sensors.ts index db138728..e0db3dff 100644 --- a/src/lib/seam/connect/routes/noise-sensors/noise-sensors.ts +++ b/src/lib/seam/connect/routes/noise-sensors/noise-sensors.ts @@ -29,7 +29,7 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { DeviceResource } from 'lib/seam/connect/resources/device.js' +import type { Device } from 'lib/seam/connect/resources/device.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' @@ -199,54 +199,6 @@ export type NoiseSensorsListParameters = { device_ids?: Array | undefined device_type?: 'noiseaware_activity_zone' | 'minut_sensor' | undefined device_types?: Array<'noiseaware_activity_zone' | 'minut_sensor'> | undefined - exclude_if?: - | Array< - | 'can_remotely_unlock' - | 'can_remotely_lock' - | 'can_program_offline_access_codes' - | 'can_program_online_access_codes' - | 'can_hvac_heat' - | 'can_hvac_cool' - | 'can_hvac_heat_cool' - | 'can_turn_off_hvac' - | 'can_simulate_removal' - | 'can_simulate_connection' - | 'can_simulate_disconnection' - | 'can_unlock_with_code' - | 'can_run_thermostat_programs' - | 'can_program_thermostat_programs_as_weekday_weekend' - | 'can_program_thermostat_programs_as_different_each_day' - | 'can_program_thermostat_programs_as_same_each_day' - | 'can_simulate_hub_connection' - | 'can_simulate_hub_disconnection' - | 'can_simulate_paid_subscription' - | 'can_configure_auto_lock' - > - | undefined - include_if?: - | Array< - | 'can_remotely_unlock' - | 'can_remotely_lock' - | 'can_program_offline_access_codes' - | 'can_program_online_access_codes' - | 'can_hvac_heat' - | 'can_hvac_cool' - | 'can_hvac_heat_cool' - | 'can_turn_off_hvac' - | 'can_simulate_removal' - | 'can_simulate_connection' - | 'can_simulate_disconnection' - | 'can_unlock_with_code' - | 'can_run_thermostat_programs' - | 'can_program_thermostat_programs_as_weekday_weekend' - | 'can_program_thermostat_programs_as_different_each_day' - | 'can_program_thermostat_programs_as_same_each_day' - | 'can_simulate_hub_connection' - | 'can_simulate_hub_disconnection' - | 'can_simulate_paid_subscription' - | 'can_configure_auto_lock' - > - | undefined limit?: number | undefined manufacturer?: 'minut' | 'noiseaware' | undefined page_cursor?: string | undefined @@ -256,15 +208,10 @@ export type NoiseSensorsListParameters = { user_identifier_key?: string | undefined } -/** - * @deprecated Use NoiseSensorsListParameters instead. - */ -export type NoiseSensorsListParams = NoiseSensorsListParameters - /** * @deprecated Use NoiseSensorsListRequest instead. */ -export type NoiseSensorsListResponse = { devices: Array } +export type NoiseSensorsListResponse = { devices: Array } export type NoiseSensorsListRequest = SeamHttpRequest< NoiseSensorsListResponse, diff --git a/src/lib/seam/connect/routes/noise-sensors/noise-thresholds/noise-thresholds.ts b/src/lib/seam/connect/routes/noise-sensors/noise-thresholds/noise-thresholds.ts index feaf6eac..843151c3 100644 --- a/src/lib/seam/connect/routes/noise-sensors/noise-thresholds/noise-thresholds.ts +++ b/src/lib/seam/connect/routes/noise-sensors/noise-thresholds/noise-thresholds.ts @@ -29,7 +29,7 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { NoiseThresholdResource } from 'lib/seam/connect/resources/noise-threshold.js' +import type { NoiseThreshold } from 'lib/seam/connect/resources/noise-threshold.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' @@ -239,21 +239,13 @@ export type NoiseSensorsNoiseThresholdsCreateParameters = { noise_threshold_decibels?: number | undefined noise_threshold_nrs?: number | undefined starts_daily_at: string - - sync?: boolean | undefined } -/** - * @deprecated Use NoiseSensorsNoiseThresholdsCreateParameters instead. - */ -export type NoiseSensorsNoiseThresholdsCreateBody = - NoiseSensorsNoiseThresholdsCreateParameters - /** * @deprecated Use NoiseSensorsNoiseThresholdsCreateRequest instead. */ export type NoiseSensorsNoiseThresholdsCreateResponse = { - noise_threshold: NoiseThresholdResource + noise_threshold: NoiseThreshold } export type NoiseSensorsNoiseThresholdsCreateRequest = SeamHttpRequest< @@ -267,16 +259,8 @@ export type NoiseSensorsNoiseThresholdsDeleteParameters = { device_id: string noise_threshold_id: string - - sync?: boolean | undefined } -/** - * @deprecated Use NoiseSensorsNoiseThresholdsDeleteParameters instead. - */ -export type NoiseSensorsNoiseThresholdsDeleteParams = - NoiseSensorsNoiseThresholdsDeleteParameters - /** * @deprecated Use NoiseSensorsNoiseThresholdsDeleteRequest instead. */ @@ -293,17 +277,11 @@ export type NoiseSensorsNoiseThresholdsGetParameters = { noise_threshold_id: string } -/** - * @deprecated Use NoiseSensorsNoiseThresholdsGetParameters instead. - */ -export type NoiseSensorsNoiseThresholdsGetParams = - NoiseSensorsNoiseThresholdsGetParameters - /** * @deprecated Use NoiseSensorsNoiseThresholdsGetRequest instead. */ export type NoiseSensorsNoiseThresholdsGetResponse = { - noise_threshold: NoiseThresholdResource + noise_threshold: NoiseThreshold } export type NoiseSensorsNoiseThresholdsGetRequest = SeamHttpRequest< @@ -315,21 +293,13 @@ export interface NoiseSensorsNoiseThresholdsGetOptions {} export type NoiseSensorsNoiseThresholdsListParameters = { device_id: string - - is_programmed?: boolean | undefined } -/** - * @deprecated Use NoiseSensorsNoiseThresholdsListParameters instead. - */ -export type NoiseSensorsNoiseThresholdsListParams = - NoiseSensorsNoiseThresholdsListParameters - /** * @deprecated Use NoiseSensorsNoiseThresholdsListRequest instead. */ export type NoiseSensorsNoiseThresholdsListResponse = { - noise_thresholds: Array + noise_thresholds: Array } export type NoiseSensorsNoiseThresholdsListRequest = SeamHttpRequest< @@ -349,15 +319,8 @@ export type NoiseSensorsNoiseThresholdsUpdateParameters = { noise_threshold_nrs?: number | undefined starts_daily_at?: string | undefined - sync?: boolean | undefined } -/** - * @deprecated Use NoiseSensorsNoiseThresholdsUpdateParameters instead. - */ -export type NoiseSensorsNoiseThresholdsUpdateBody = - NoiseSensorsNoiseThresholdsUpdateParameters - /** * @deprecated Use NoiseSensorsNoiseThresholdsUpdateRequest instead. */ diff --git a/src/lib/seam/connect/routes/noise-sensors/simulate/simulate.ts b/src/lib/seam/connect/routes/noise-sensors/simulate/simulate.ts index c4af1933..26fd8c68 100644 --- a/src/lib/seam/connect/routes/noise-sensors/simulate/simulate.ts +++ b/src/lib/seam/connect/routes/noise-sensors/simulate/simulate.ts @@ -178,12 +178,6 @@ export type NoiseSensorsSimulateTriggerNoiseThresholdParameters = { device_id: string } -/** - * @deprecated Use NoiseSensorsSimulateTriggerNoiseThresholdParameters instead. - */ -export type NoiseSensorsSimulateTriggerNoiseThresholdBody = - NoiseSensorsSimulateTriggerNoiseThresholdParameters - /** * @deprecated Use NoiseSensorsSimulateTriggerNoiseThresholdRequest instead. */ diff --git a/src/lib/seam/connect/routes/phones/phones.ts b/src/lib/seam/connect/routes/phones/phones.ts index 5ed19115..875e8552 100644 --- a/src/lib/seam/connect/routes/phones/phones.ts +++ b/src/lib/seam/connect/routes/phones/phones.ts @@ -29,7 +29,7 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { PhoneResource } from 'lib/seam/connect/resources/phone.js' +import type { Phone } from 'lib/seam/connect/resources/phone.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' @@ -211,11 +211,6 @@ export type PhonesDeactivateParameters = { device_id: string } -/** - * @deprecated Use PhonesDeactivateParameters instead. - */ -export type PhonesDeactivateParams = PhonesDeactivateParameters - /** * @deprecated Use PhonesDeactivateRequest instead. */ @@ -229,15 +224,10 @@ export type PhonesGetParameters = { device_id: string } -/** - * @deprecated Use PhonesGetParameters instead. - */ -export type PhonesGetParams = PhonesGetParameters - /** * @deprecated Use PhonesGetRequest instead. */ -export type PhonesGetResponse = { phone: PhoneResource } +export type PhonesGetResponse = { phone: Phone } export type PhonesGetRequest = SeamHttpRequest @@ -248,15 +238,10 @@ export type PhonesListParameters = { owner_user_identity_id?: string | undefined } -/** - * @deprecated Use PhonesListParameters instead. - */ -export type PhonesListParams = PhonesListParameters - /** * @deprecated Use PhonesListRequest instead. */ -export type PhonesListResponse = { phones: Array } +export type PhonesListResponse = { phones: Array } export type PhonesListRequest = SeamHttpRequest diff --git a/src/lib/seam/connect/routes/phones/simulate/simulate.ts b/src/lib/seam/connect/routes/phones/simulate/simulate.ts index 37d4c38b..dff90df2 100644 --- a/src/lib/seam/connect/routes/phones/simulate/simulate.ts +++ b/src/lib/seam/connect/routes/phones/simulate/simulate.ts @@ -29,7 +29,7 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { PhoneResource } from 'lib/seam/connect/resources/phone.js' +import type { Phone } from 'lib/seam/connect/resources/phone.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' @@ -198,16 +198,10 @@ export type PhonesSimulateCreateSandboxPhoneParameters = { user_identity_id: string } -/** - * @deprecated Use PhonesSimulateCreateSandboxPhoneParameters instead. - */ -export type PhonesSimulateCreateSandboxPhoneBody = - PhonesSimulateCreateSandboxPhoneParameters - /** * @deprecated Use PhonesSimulateCreateSandboxPhoneRequest instead. */ -export type PhonesSimulateCreateSandboxPhoneResponse = { phone: PhoneResource } +export type PhonesSimulateCreateSandboxPhoneResponse = { phone: Phone } export type PhonesSimulateCreateSandboxPhoneRequest = SeamHttpRequest< PhonesSimulateCreateSandboxPhoneResponse, diff --git a/src/lib/seam/connect/routes/seam-http-endpoints-without-workspace.ts b/src/lib/seam/connect/routes/seam-http-endpoints-without-workspace.ts index 95992b18..051026c6 100644 --- a/src/lib/seam/connect/routes/seam-http-endpoints-without-workspace.ts +++ b/src/lib/seam/connect/routes/seam-http-endpoints-without-workspace.ts @@ -21,18 +21,6 @@ import { parseOptions, } from 'lib/seam/connect/parse-options.js' -import { - type SeamConsoleV1WorkspaceFeatureFlagsListOptions, - type SeamConsoleV1WorkspaceFeatureFlagsListParameters, - type SeamConsoleV1WorkspaceFeatureFlagsListRequest, - SeamHttpSeamConsoleV1WorkspaceFeatureFlags, -} from './seam/console/v1/workspace/feature-flags/index.js' -import { - type SeamCustomerV1ConnectorsAuthorizeOptions, - type SeamCustomerV1ConnectorsAuthorizeParameters, - type SeamCustomerV1ConnectorsAuthorizeRequest, - SeamHttpSeamCustomerV1Connectors, -} from './seam/customer/v1/connectors/index.js' import { SeamHttpWorkspaces, type WorkspacesCreateOptions, @@ -106,45 +94,6 @@ export class SeamHttpEndpointsWithoutWorkspace { return new SeamHttpEndpointsWithoutWorkspace(constructorOptions) } - get '/seam/console/v1/workspace/feature_flags/list'(): ( - parameters?: SeamConsoleV1WorkspaceFeatureFlagsListParameters, - options?: SeamConsoleV1WorkspaceFeatureFlagsListOptions, - ) => SeamConsoleV1WorkspaceFeatureFlagsListRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamConsoleV1WorkspaceFeatureFlagsList( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamConsoleV1WorkspaceFeatureFlags.fromClient( - client, - defaults, - ) - return seam.list(...args) - } - } - - get '/seam/customer/v1/connectors/authorize'(): ( - parameters: SeamCustomerV1ConnectorsAuthorizeParameters, - options?: SeamCustomerV1ConnectorsAuthorizeOptions, - ) => SeamCustomerV1ConnectorsAuthorizeRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1ConnectorsAuthorize( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamCustomerV1Connectors.fromClient(client, defaults) - return seam.authorize(...args) - } - } - get '/workspaces/create'(): ( parameters: WorkspacesCreateParameters, options?: WorkspacesCreateOptions, @@ -172,9 +121,6 @@ export class SeamHttpEndpointsWithoutWorkspace { } } -export type SeamHttpEndpointWithoutWorkspaceQueryPaths = - | '/seam/console/v1/workspace/feature_flags/list' - | '/seam/customer/v1/connectors/authorize' - | '/workspaces/list' +export type SeamHttpEndpointWithoutWorkspaceQueryPaths = '/workspaces/list' export type SeamHttpEndpointWithoutWorkspaceMutationPaths = '/workspaces/create' diff --git a/src/lib/seam/connect/routes/seam-http-endpoints.ts b/src/lib/seam/connect/routes/seam-http-endpoints.ts index f309a7d2..748e476b 100644 --- a/src/lib/seam/connect/routes/seam-http-endpoints.ts +++ b/src/lib/seam/connect/routes/seam-http-endpoints.ts @@ -48,9 +48,6 @@ import { type AccessCodesGetOptions, type AccessCodesGetParameters, type AccessCodesGetRequest, - type AccessCodesGetTimelineOptions, - type AccessCodesGetTimelineParameters, - type AccessCodesGetTimelineRequest, type AccessCodesListOptions, type AccessCodesListParameters, type AccessCodesListRequest, @@ -185,34 +182,10 @@ import { type AcsAccessGroupsRemoveUserRequest, SeamHttpAcsAccessGroups, } from './acs/access-groups/index.js' -import { - type AcsAccessGroupsUnmanagedGetOptions, - type AcsAccessGroupsUnmanagedGetParameters, - type AcsAccessGroupsUnmanagedGetRequest, - type AcsAccessGroupsUnmanagedListOptions, - type AcsAccessGroupsUnmanagedListParameters, - type AcsAccessGroupsUnmanagedListRequest, - SeamHttpAcsAccessGroupsUnmanaged, -} from './acs/access-groups/unmanaged/index.js' -import { - type AcsCredentialPoolsListOptions, - type AcsCredentialPoolsListParameters, - type AcsCredentialPoolsListRequest, - SeamHttpAcsCredentialPools, -} from './acs/credential-pools/index.js' -import { - type AcsCredentialProvisioningAutomationsLaunchOptions, - type AcsCredentialProvisioningAutomationsLaunchParameters, - type AcsCredentialProvisioningAutomationsLaunchRequest, - SeamHttpAcsCredentialProvisioningAutomations, -} from './acs/credential-provisioning-automations/index.js' import { type AcsCredentialsAssignOptions, type AcsCredentialsAssignParameters, type AcsCredentialsAssignRequest, - type AcsCredentialsCreateOfflineCodeOptions, - type AcsCredentialsCreateOfflineCodeParameters, - type AcsCredentialsCreateOfflineCodeRequest, type AcsCredentialsCreateOptions, type AcsCredentialsCreateParameters, type AcsCredentialsCreateRequest, @@ -236,15 +209,6 @@ import { type AcsCredentialsUpdateRequest, SeamHttpAcsCredentials, } from './acs/credentials/index.js' -import { - type AcsCredentialsUnmanagedGetOptions, - type AcsCredentialsUnmanagedGetParameters, - type AcsCredentialsUnmanagedGetRequest, - type AcsCredentialsUnmanagedListOptions, - type AcsCredentialsUnmanagedListParameters, - type AcsCredentialsUnmanagedListRequest, - SeamHttpAcsCredentialsUnmanaged, -} from './acs/credentials/unmanaged/index.js' import { type AcsEncodersEncodeCredentialOptions, type AcsEncodersEncodeCredentialParameters, @@ -347,15 +311,6 @@ import { type AcsUsersUpdateRequest, SeamHttpAcsUsers, } from './acs/users/index.js' -import { - type AcsUsersUnmanagedGetOptions, - type AcsUsersUnmanagedGetParameters, - type AcsUsersUnmanagedGetRequest, - type AcsUsersUnmanagedListOptions, - type AcsUsersUnmanagedListParameters, - type AcsUsersUnmanagedListRequest, - SeamHttpAcsUsersUnmanaged, -} from './acs/users/unmanaged/index.js' import { type ActionAttemptsGetOptions, type ActionAttemptsGetParameters, @@ -365,15 +320,6 @@ import { type ActionAttemptsListRequest, SeamHttpActionAttempts, } from './action-attempts/index.js' -import { - type BridgesGetOptions, - type BridgesGetParameters, - type BridgesGetRequest, - type BridgesListOptions, - type BridgesListParameters, - type BridgesListRequest, - SeamHttpBridges, -} from './bridges/index.js' import { type ClientSessionsCreateOptions, type ClientSessionsCreateParameters, @@ -450,15 +396,6 @@ import { SeamHttpCustomers, } from './customers/index.js' import { - type CustomersReservationsCreateDeepLinkOptions, - type CustomersReservationsCreateDeepLinkParameters, - type CustomersReservationsCreateDeepLinkRequest, - SeamHttpCustomersReservations, -} from './customers/reservations/index.js' -import { - type DevicesDeleteOptions, - type DevicesDeleteParameters, - type DevicesDeleteRequest, type DevicesGetOptions, type DevicesGetParameters, type DevicesGetRequest, @@ -605,231 +542,6 @@ import { type PhonesSimulateCreateSandboxPhoneRequest, SeamHttpPhonesSimulate, } from './phones/simulate/index.js' -import { - type SeamConsoleV1GetResourceLocatorOptions, - type SeamConsoleV1GetResourceLocatorParameters, - type SeamConsoleV1GetResourceLocatorRequest, - SeamHttpSeamConsoleV1, -} from './seam/console/v1/index.js' -import { - type SeamConsoleV1LynxMigrationGetPropertyMigrationStatusOptions, - type SeamConsoleV1LynxMigrationGetPropertyMigrationStatusParameters, - type SeamConsoleV1LynxMigrationGetPropertyMigrationStatusRequest, - type SeamConsoleV1LynxMigrationGetReservationMigrationStatusOptions, - type SeamConsoleV1LynxMigrationGetReservationMigrationStatusParameters, - type SeamConsoleV1LynxMigrationGetReservationMigrationStatusRequest, - type SeamConsoleV1LynxMigrationListPropertyReservationsOptions, - type SeamConsoleV1LynxMigrationListPropertyReservationsParameters, - type SeamConsoleV1LynxMigrationListPropertyReservationsRequest, - type SeamConsoleV1LynxMigrationMigratePropertyOptions, - type SeamConsoleV1LynxMigrationMigratePropertyParameters, - type SeamConsoleV1LynxMigrationMigratePropertyRequest, - SeamHttpSeamConsoleV1LynxMigration, -} from './seam/console/v1/lynx-migration/index.js' -import { - type SeamConsoleV1SitesCreateOptions, - type SeamConsoleV1SitesCreateParameters, - type SeamConsoleV1SitesCreateRequest, - type SeamConsoleV1SitesDeleteOptions, - type SeamConsoleV1SitesDeleteParameters, - type SeamConsoleV1SitesDeleteRequest, - type SeamConsoleV1SitesListOptions, - type SeamConsoleV1SitesListParameters, - type SeamConsoleV1SitesListRequest, - type SeamConsoleV1SitesUpdateOptions, - type SeamConsoleV1SitesUpdateParameters, - type SeamConsoleV1SitesUpdateRequest, - SeamHttpSeamConsoleV1Sites, -} from './seam/console/v1/sites/index.js' -import { - type SeamConsoleV1TimelinesGetOptions, - type SeamConsoleV1TimelinesGetParameters, - type SeamConsoleV1TimelinesGetRequest, - SeamHttpSeamConsoleV1Timelines, -} from './seam/console/v1/timelines/index.js' -import { - type SeamConsoleV1WorkspaceFeatureFlagsListOptions, - type SeamConsoleV1WorkspaceFeatureFlagsListParameters, - type SeamConsoleV1WorkspaceFeatureFlagsListRequest, - type SeamConsoleV1WorkspaceFeatureFlagsUpdateOptions, - type SeamConsoleV1WorkspaceFeatureFlagsUpdateParameters, - type SeamConsoleV1WorkspaceFeatureFlagsUpdateRequest, - SeamHttpSeamConsoleV1WorkspaceFeatureFlags, -} from './seam/console/v1/workspace/feature-flags/index.js' -import { - type SeamCustomerV1AccessGrantsListOptions, - type SeamCustomerV1AccessGrantsListParameters, - type SeamCustomerV1AccessGrantsListRequest, - type SeamCustomerV1AccessGrantsUpdateOptions, - type SeamCustomerV1AccessGrantsUpdateParameters, - type SeamCustomerV1AccessGrantsUpdateRequest, - SeamHttpSeamCustomerV1AccessGrants, -} from './seam/customer/v1/access-grants/index.js' -import { - type SeamCustomerV1AccessMethodsEncodeOptions, - type SeamCustomerV1AccessMethodsEncodeParameters, - type SeamCustomerV1AccessMethodsEncodeRequest, - SeamHttpSeamCustomerV1AccessMethods, -} from './seam/customer/v1/access-methods/index.js' -import { - type SeamCustomerV1AutomationRunsListOptions, - type SeamCustomerV1AutomationRunsListParameters, - type SeamCustomerV1AutomationRunsListRequest, - SeamHttpSeamCustomerV1AutomationRuns, -} from './seam/customer/v1/automation-runs/index.js' -import { - type SeamCustomerV1AutomationsDeleteOptions, - type SeamCustomerV1AutomationsDeleteParameters, - type SeamCustomerV1AutomationsDeleteRequest, - type SeamCustomerV1AutomationsGetOptions, - type SeamCustomerV1AutomationsGetParameters, - type SeamCustomerV1AutomationsGetRequest, - type SeamCustomerV1AutomationsUpdateOptions, - type SeamCustomerV1AutomationsUpdateParameters, - 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 SeamCustomerV1ConnectorsExternalSitesListOptions, - type SeamCustomerV1ConnectorsExternalSitesListParameters, - type SeamCustomerV1ConnectorsExternalSitesListRequest, - SeamHttpSeamCustomerV1ConnectorsExternalSites, -} from './seam/customer/v1/connectors/external-sites/index.js' -import { - type SeamCustomerV1ConnectorsIcalValidateConfigOptions, - type SeamCustomerV1ConnectorsIcalValidateConfigParameters, - type SeamCustomerV1ConnectorsIcalValidateConfigRequest, - SeamHttpSeamCustomerV1ConnectorsIcal, -} from './seam/customer/v1/connectors/ical/index.js' -import { - type SeamCustomerV1ConnectorsAuthorizeOptions, - type SeamCustomerV1ConnectorsAuthorizeParameters, - type SeamCustomerV1ConnectorsAuthorizeRequest, - type SeamCustomerV1ConnectorsConnectorTypesOptions, - type SeamCustomerV1ConnectorsConnectorTypesParameters, - type SeamCustomerV1ConnectorsConnectorTypesRequest, - type SeamCustomerV1ConnectorsCreateOptions, - type SeamCustomerV1ConnectorsCreateParameters, - type SeamCustomerV1ConnectorsCreateRequest, - type SeamCustomerV1ConnectorsDeleteOptions, - type SeamCustomerV1ConnectorsDeleteParameters, - type SeamCustomerV1ConnectorsDeleteRequest, - type SeamCustomerV1ConnectorsListOptions, - type SeamCustomerV1ConnectorsListParameters, - type SeamCustomerV1ConnectorsListRequest, - type SeamCustomerV1ConnectorsSyncOptions, - type SeamCustomerV1ConnectorsSyncParameters, - type SeamCustomerV1ConnectorsSyncRequest, - type SeamCustomerV1ConnectorsUpdateOptions, - type SeamCustomerV1ConnectorsUpdateParameters, - type SeamCustomerV1ConnectorsUpdateRequest, - SeamHttpSeamCustomerV1Connectors, -} from './seam/customer/v1/connectors/index.js' -import { - type SeamCustomerV1CustomersAutomationsGetOptions, - type SeamCustomerV1CustomersAutomationsGetParameters, - type SeamCustomerV1CustomersAutomationsGetRequest, - type SeamCustomerV1CustomersAutomationsUpdateOptions, - type SeamCustomerV1CustomersAutomationsUpdateParameters, - type SeamCustomerV1CustomersAutomationsUpdateRequest, - SeamHttpSeamCustomerV1CustomersAutomations, -} from './seam/customer/v1/customers/automations/index.js' -import { - type SeamCustomerV1CustomersListOptions, - type SeamCustomerV1CustomersListParameters, - type SeamCustomerV1CustomersListRequest, - type SeamCustomerV1CustomersMeOptions, - type SeamCustomerV1CustomersMeParameters, - type SeamCustomerV1CustomersMeRequest, - type SeamCustomerV1CustomersOpenPortalOptions, - type SeamCustomerV1CustomersOpenPortalParameters, - type SeamCustomerV1CustomersOpenPortalRequest, - SeamHttpSeamCustomerV1Customers, -} from './seam/customer/v1/customers/index.js' -import { - type SeamCustomerV1EncodersListOptions, - type SeamCustomerV1EncodersListParameters, - type SeamCustomerV1EncodersListRequest, - SeamHttpSeamCustomerV1Encoders, -} from './seam/customer/v1/encoders/index.js' -import { - type SeamCustomerV1EventsListOptions, - type SeamCustomerV1EventsListParameters, - type SeamCustomerV1EventsListRequest, - SeamHttpSeamCustomerV1Events, -} from './seam/customer/v1/events/index.js' -import { - type SeamCustomerV1PortalsGetOptions, - type SeamCustomerV1PortalsGetParameters, - type SeamCustomerV1PortalsGetRequest, - type SeamCustomerV1PortalsUpdateOptions, - type SeamCustomerV1PortalsUpdateParameters, - type SeamCustomerV1PortalsUpdateRequest, - SeamHttpSeamCustomerV1Portals, -} from './seam/customer/v1/portals/index.js' -import { - type SeamCustomerV1ReservationsGetOptions, - type SeamCustomerV1ReservationsGetParameters, - type SeamCustomerV1ReservationsGetRequest, - type SeamCustomerV1ReservationsListAccessGrantsOptions, - type SeamCustomerV1ReservationsListAccessGrantsParameters, - type SeamCustomerV1ReservationsListAccessGrantsRequest, - type SeamCustomerV1ReservationsListOptions, - type SeamCustomerV1ReservationsListParameters, - type SeamCustomerV1ReservationsListRequest, - SeamHttpSeamCustomerV1Reservations, -} from './seam/customer/v1/reservations/index.js' -import { - type SeamCustomerV1SettingsGetOptions, - type SeamCustomerV1SettingsGetParameters, - type SeamCustomerV1SettingsGetRequest, - type SeamCustomerV1SettingsUpdateOptions, - type SeamCustomerV1SettingsUpdateParameters, - type SeamCustomerV1SettingsUpdateRequest, - SeamHttpSeamCustomerV1Settings, -} from './seam/customer/v1/settings/index.js' -import { - type SeamCustomerV1SettingsVerticalResourceAliasesGetOptions, - type SeamCustomerV1SettingsVerticalResourceAliasesGetParameters, - type SeamCustomerV1SettingsVerticalResourceAliasesGetRequest, - SeamHttpSeamCustomerV1SettingsVerticalResourceAliases, -} from './seam/customer/v1/settings/vertical-resource-aliases/index.js' -import { - type SeamCustomerV1SpacesCreateOptions, - type SeamCustomerV1SpacesCreateParameters, - type SeamCustomerV1SpacesCreateRequest, - type SeamCustomerV1SpacesListOptions, - type SeamCustomerV1SpacesListParameters, - type SeamCustomerV1SpacesListRequest, - type SeamCustomerV1SpacesListReservationsOptions, - type SeamCustomerV1SpacesListReservationsParameters, - type SeamCustomerV1SpacesListReservationsRequest, - type SeamCustomerV1SpacesPushCommonAreasOptions, - type SeamCustomerV1SpacesPushCommonAreasParameters, - type SeamCustomerV1SpacesPushCommonAreasRequest, - SeamHttpSeamCustomerV1Spaces, -} from './seam/customer/v1/spaces/index.js' -import { - type SeamCustomerV1StaffMembersGetOptions, - type SeamCustomerV1StaffMembersGetParameters, - type SeamCustomerV1StaffMembersGetRequest, - type SeamCustomerV1StaffMembersListOptions, - type SeamCustomerV1StaffMembersListParameters, - type SeamCustomerV1StaffMembersListRequest, - SeamHttpSeamCustomerV1StaffMembers, -} from './seam/customer/v1/staff-members/index.js' -import { - SeamHttpSeamPartnerV1BuildingBlocksSpaces, - type SeamPartnerV1BuildingBlocksSpacesAutoMapOptions, - type SeamPartnerV1BuildingBlocksSpacesAutoMapParameters, - type SeamPartnerV1BuildingBlocksSpacesAutoMapRequest, -} from './seam/partner/v1/building-blocks/spaces/index.js' import { SeamHttpSpaces, type SpacesAddAcsEntrancesOptions, @@ -895,9 +607,6 @@ import { type ThermostatsDeleteClimatePresetOptions, type ThermostatsDeleteClimatePresetParameters, type ThermostatsDeleteClimatePresetRequest, - type ThermostatsGetOptions, - type ThermostatsGetParameters, - type ThermostatsGetRequest, type ThermostatsHeatCoolOptions, type ThermostatsHeatCoolParameters, type ThermostatsHeatCoolRequest, @@ -956,36 +665,6 @@ import { type ThermostatsSimulateTemperatureReachedParameters, type ThermostatsSimulateTemperatureReachedRequest, } from './thermostats/simulate/index.js' -import { - SeamHttpUnstablePartnerBuildingBlocks, - type UnstablePartnerBuildingBlocksConnectAccountsOptions, - type UnstablePartnerBuildingBlocksConnectAccountsParameters, - type UnstablePartnerBuildingBlocksConnectAccountsRequest, - type UnstablePartnerBuildingBlocksGenerateMagicLinkOptions, - type UnstablePartnerBuildingBlocksGenerateMagicLinkParameters, - type UnstablePartnerBuildingBlocksGenerateMagicLinkRequest, - type UnstablePartnerBuildingBlocksManageDevicesOptions, - type UnstablePartnerBuildingBlocksManageDevicesParameters, - type UnstablePartnerBuildingBlocksManageDevicesRequest, - type UnstablePartnerBuildingBlocksOrganizeSpacesOptions, - type UnstablePartnerBuildingBlocksOrganizeSpacesParameters, - type UnstablePartnerBuildingBlocksOrganizeSpacesRequest, -} from './unstable-partner/building-blocks/index.js' -import { - SeamHttpUserIdentitiesEnrollmentAutomations, - type UserIdentitiesEnrollmentAutomationsDeleteOptions, - type UserIdentitiesEnrollmentAutomationsDeleteParameters, - type UserIdentitiesEnrollmentAutomationsDeleteRequest, - type UserIdentitiesEnrollmentAutomationsGetOptions, - type UserIdentitiesEnrollmentAutomationsGetParameters, - type UserIdentitiesEnrollmentAutomationsGetRequest, - type UserIdentitiesEnrollmentAutomationsLaunchOptions, - type UserIdentitiesEnrollmentAutomationsLaunchParameters, - type UserIdentitiesEnrollmentAutomationsLaunchRequest, - type UserIdentitiesEnrollmentAutomationsListOptions, - type UserIdentitiesEnrollmentAutomationsListParameters, - type UserIdentitiesEnrollmentAutomationsListRequest, -} from './user-identities/enrollment-automations/index.js' import { SeamHttpUserIdentities, type UserIdentitiesAddAcsUserOptions, @@ -1061,32 +740,11 @@ import { type WebhooksUpdateParameters, type WebhooksUpdateRequest, } from './webhooks/index.js' -import { - SeamHttpWorkspacesCustomizationProfiles, - type WorkspacesCustomizationProfilesCreateOptions, - type WorkspacesCustomizationProfilesCreateParameters, - type WorkspacesCustomizationProfilesCreateRequest, - type WorkspacesCustomizationProfilesGetOptions, - type WorkspacesCustomizationProfilesGetParameters, - type WorkspacesCustomizationProfilesGetRequest, - type WorkspacesCustomizationProfilesListOptions, - type WorkspacesCustomizationProfilesListParameters, - type WorkspacesCustomizationProfilesListRequest, - type WorkspacesCustomizationProfilesUpdateOptions, - type WorkspacesCustomizationProfilesUpdateParameters, - type WorkspacesCustomizationProfilesUpdateRequest, - type WorkspacesCustomizationProfilesUploadImagesOptions, - type WorkspacesCustomizationProfilesUploadImagesParameters, - type WorkspacesCustomizationProfilesUploadImagesRequest, -} from './workspaces/customization-profiles/index.js' import { SeamHttpWorkspaces, type WorkspacesCreateOptions, type WorkspacesCreateParameters, type WorkspacesCreateRequest, - type WorkspacesFindAnythingOptions, - type WorkspacesFindAnythingParameters, - type WorkspacesFindAnythingRequest, type WorkspacesGetOptions, type WorkspacesGetParameters, type WorkspacesGetRequest, @@ -1293,24 +951,6 @@ export class SeamHttpEndpoints { } } - get '/access_codes/get_timeline'(): ( - parameters: AccessCodesGetTimelineParameters, - options?: AccessCodesGetTimelineOptions, - ) => AccessCodesGetTimelineRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function accessCodesGetTimeline( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpAccessCodes.fromClient(client, defaults) - return seam.getTimeline(...args) - } - } - get '/access_codes/list'(): ( parameters?: AccessCodesListParameters, options?: AccessCodesListOptions, @@ -1794,83 +1434,6 @@ export class SeamHttpEndpoints { } } - get '/acs/access_groups/unmanaged/get'(): ( - parameters: AcsAccessGroupsUnmanagedGetParameters, - options?: AcsAccessGroupsUnmanagedGetOptions, - ) => AcsAccessGroupsUnmanagedGetRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function acsAccessGroupsUnmanagedGet( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpAcsAccessGroupsUnmanaged.fromClient(client, defaults) - return seam.get(...args) - } - } - - get '/acs/access_groups/unmanaged/list'(): ( - parameters?: AcsAccessGroupsUnmanagedListParameters, - options?: AcsAccessGroupsUnmanagedListOptions, - ) => AcsAccessGroupsUnmanagedListRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function acsAccessGroupsUnmanagedList( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpAcsAccessGroupsUnmanaged.fromClient(client, defaults) - return seam.list(...args) - } - } - - get '/acs/credential_pools/list'(): ( - parameters: AcsCredentialPoolsListParameters, - options?: AcsCredentialPoolsListOptions, - ) => AcsCredentialPoolsListRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function acsCredentialPoolsList( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpAcsCredentialPools.fromClient(client, defaults) - return seam.list(...args) - } - } - - get '/acs/credential_provisioning_automations/launch'(): ( - parameters: AcsCredentialProvisioningAutomationsLaunchParameters, - options?: AcsCredentialProvisioningAutomationsLaunchOptions, - ) => AcsCredentialProvisioningAutomationsLaunchRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function acsCredentialProvisioningAutomationsLaunch( - ...args: Parameters< - SeamHttpAcsCredentialProvisioningAutomations['launch'] - > - ): ReturnType { - const seam = SeamHttpAcsCredentialProvisioningAutomations.fromClient( - client, - defaults, - ) - return seam.launch(...args) - } - } - get '/acs/credentials/assign'(): ( parameters: AcsCredentialsAssignParameters, options?: AcsCredentialsAssignOptions, @@ -1897,24 +1460,6 @@ export class SeamHttpEndpoints { } } - get '/acs/credentials/create_offline_code'(): ( - parameters: AcsCredentialsCreateOfflineCodeParameters, - options?: AcsCredentialsCreateOfflineCodeOptions, - ) => AcsCredentialsCreateOfflineCodeRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function acsCredentialsCreateOfflineCode( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpAcsCredentials.fromClient(client, defaults) - return seam.createOfflineCode(...args) - } - } - get '/acs/credentials/delete'(): ( parameters: AcsCredentialsDeleteParameters, options?: AcsCredentialsDeleteOptions, @@ -1993,42 +1538,6 @@ export class SeamHttpEndpoints { } } - get '/acs/credentials/unmanaged/get'(): ( - parameters: AcsCredentialsUnmanagedGetParameters, - options?: AcsCredentialsUnmanagedGetOptions, - ) => AcsCredentialsUnmanagedGetRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function acsCredentialsUnmanagedGet( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpAcsCredentialsUnmanaged.fromClient(client, defaults) - return seam.get(...args) - } - } - - get '/acs/credentials/unmanaged/list'(): ( - parameters?: AcsCredentialsUnmanagedListParameters, - options?: AcsCredentialsUnmanagedListOptions, - ) => AcsCredentialsUnmanagedListRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function acsCredentialsUnmanagedList( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpAcsCredentialsUnmanaged.fromClient(client, defaults) - return seam.list(...args) - } - } - get '/acs/encoders/encode_credential'(): ( parameters: AcsEncodersEncodeCredentialParameters, options?: AcsEncodersEncodeCredentialOptions, @@ -2422,42 +1931,6 @@ export class SeamHttpEndpoints { } } - get '/acs/users/unmanaged/get'(): ( - parameters: AcsUsersUnmanagedGetParameters, - options?: AcsUsersUnmanagedGetOptions, - ) => AcsUsersUnmanagedGetRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function acsUsersUnmanagedGet( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpAcsUsersUnmanaged.fromClient(client, defaults) - return seam.get(...args) - } - } - - get '/acs/users/unmanaged/list'(): ( - parameters?: AcsUsersUnmanagedListParameters, - options?: AcsUsersUnmanagedListOptions, - ) => AcsUsersUnmanagedListRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function acsUsersUnmanagedList( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpAcsUsersUnmanaged.fromClient(client, defaults) - return seam.list(...args) - } - } - get '/action_attempts/get'(): ( parameters: ActionAttemptsGetParameters, options?: ActionAttemptsGetOptions, @@ -2484,42 +1957,6 @@ export class SeamHttpEndpoints { } } - get '/bridges/get'(): ( - parameters: BridgesGetParameters, - options?: BridgesGetOptions, - ) => BridgesGetRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function bridgesGet( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpBridges.fromClient(client, defaults) - return seam.get(...args) - } - } - - get '/bridges/list'(): ( - parameters?: BridgesListParameters, - options?: BridgesListOptions, - ) => BridgesListRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function bridgesList( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpBridges.fromClient(client, defaults) - return seam.list(...args) - } - } - get '/client_sessions/create'(): ( parameters?: ClientSessionsCreateParameters, options?: ClientSessionsCreateOptions, @@ -2783,42 +2220,6 @@ export class SeamHttpEndpoints { } } - get '/customers/reservations/create_deep_link'(): ( - parameters: CustomersReservationsCreateDeepLinkParameters, - options?: CustomersReservationsCreateDeepLinkOptions, - ) => CustomersReservationsCreateDeepLinkRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function customersReservationsCreateDeepLink( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpCustomersReservations.fromClient(client, defaults) - return seam.createDeepLink(...args) - } - } - - get '/devices/delete'(): ( - parameters: DevicesDeleteParameters, - options?: DevicesDeleteOptions, - ) => DevicesDeleteRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function devicesDelete( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpDevices.fromClient(client, defaults) - return seam.delete(...args) - } - } - get '/devices/get'(): ( parameters?: DevicesGetParameters, options?: DevicesGetOptions, @@ -3315,1128 +2716,114 @@ export class SeamHttpEndpoints { } } - get '/seam/console/v1/get_resource_locator'(): ( - parameters?: SeamConsoleV1GetResourceLocatorParameters, - options?: SeamConsoleV1GetResourceLocatorOptions, - ) => SeamConsoleV1GetResourceLocatorRequest { + get '/spaces/add_acs_entrances'(): ( + parameters: SpacesAddAcsEntrancesParameters, + options?: SpacesAddAcsEntrancesOptions, + ) => SpacesAddAcsEntrancesRequest { const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamConsoleV1GetResourceLocator( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamConsoleV1.fromClient(client, defaults) - return seam.getResourceLocator(...args) + return function spacesAddAcsEntrances( + ...args: Parameters + ): ReturnType { + const seam = SeamHttpSpaces.fromClient(client, defaults) + return seam.addAcsEntrances(...args) } } - get '/seam/console/v1/lynx_migration/get_property_migration_status'(): ( - parameters: SeamConsoleV1LynxMigrationGetPropertyMigrationStatusParameters, - options?: SeamConsoleV1LynxMigrationGetPropertyMigrationStatusOptions, - ) => SeamConsoleV1LynxMigrationGetPropertyMigrationStatusRequest { + get '/spaces/add_connected_account'(): ( + parameters: SpacesAddConnectedAccountParameters, + options?: SpacesAddConnectedAccountOptions, + ) => SpacesAddConnectedAccountRequest { const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamConsoleV1LynxMigrationGetPropertyMigrationStatus( - ...args: Parameters< - SeamHttpSeamConsoleV1LynxMigration['getPropertyMigrationStatus'] - > - ): ReturnType< - SeamHttpSeamConsoleV1LynxMigration['getPropertyMigrationStatus'] - > { - const seam = SeamHttpSeamConsoleV1LynxMigration.fromClient( - client, - defaults, - ) - return seam.getPropertyMigrationStatus(...args) + return function spacesAddConnectedAccount( + ...args: Parameters + ): ReturnType { + const seam = SeamHttpSpaces.fromClient(client, defaults) + return seam.addConnectedAccount(...args) } } - get '/seam/console/v1/lynx_migration/get_reservation_migration_status'(): ( - parameters: SeamConsoleV1LynxMigrationGetReservationMigrationStatusParameters, - options?: SeamConsoleV1LynxMigrationGetReservationMigrationStatusOptions, - ) => SeamConsoleV1LynxMigrationGetReservationMigrationStatusRequest { + get '/spaces/add_devices'(): ( + parameters: SpacesAddDevicesParameters, + options?: SpacesAddDevicesOptions, + ) => SpacesAddDevicesRequest { const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamConsoleV1LynxMigrationGetReservationMigrationStatus( - ...args: Parameters< - SeamHttpSeamConsoleV1LynxMigration['getReservationMigrationStatus'] - > - ): ReturnType< - SeamHttpSeamConsoleV1LynxMigration['getReservationMigrationStatus'] - > { - const seam = SeamHttpSeamConsoleV1LynxMigration.fromClient( - client, - defaults, - ) - return seam.getReservationMigrationStatus(...args) + return function spacesAddDevices( + ...args: Parameters + ): ReturnType { + const seam = SeamHttpSpaces.fromClient(client, defaults) + return seam.addDevices(...args) } } - get '/seam/console/v1/lynx_migration/list_property_reservations'(): ( - parameters: SeamConsoleV1LynxMigrationListPropertyReservationsParameters, - options?: SeamConsoleV1LynxMigrationListPropertyReservationsOptions, - ) => SeamConsoleV1LynxMigrationListPropertyReservationsRequest { + get '/spaces/create'(): ( + parameters: SpacesCreateParameters, + options?: SpacesCreateOptions, + ) => SpacesCreateRequest { const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamConsoleV1LynxMigrationListPropertyReservations( - ...args: Parameters< - SeamHttpSeamConsoleV1LynxMigration['listPropertyReservations'] - > - ): ReturnType< - SeamHttpSeamConsoleV1LynxMigration['listPropertyReservations'] - > { - const seam = SeamHttpSeamConsoleV1LynxMigration.fromClient( - client, - defaults, - ) - return seam.listPropertyReservations(...args) + return function spacesCreate( + ...args: Parameters + ): ReturnType { + const seam = SeamHttpSpaces.fromClient(client, defaults) + return seam.create(...args) } } - get '/seam/console/v1/lynx_migration/migrate_property'(): ( - parameters: SeamConsoleV1LynxMigrationMigratePropertyParameters, - options?: SeamConsoleV1LynxMigrationMigratePropertyOptions, - ) => SeamConsoleV1LynxMigrationMigratePropertyRequest { + get '/spaces/delete'(): ( + parameters: SpacesDeleteParameters, + options?: SpacesDeleteOptions, + ) => SpacesDeleteRequest { const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamConsoleV1LynxMigrationMigrateProperty( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamConsoleV1LynxMigration.fromClient( - client, - defaults, - ) - return seam.migrateProperty(...args) + return function spacesDelete( + ...args: Parameters + ): ReturnType { + const seam = SeamHttpSpaces.fromClient(client, defaults) + return seam.delete(...args) } } - get '/seam/console/v1/sites/create'(): ( - parameters: SeamConsoleV1SitesCreateParameters, - options?: SeamConsoleV1SitesCreateOptions, - ) => SeamConsoleV1SitesCreateRequest { + get '/spaces/get'(): ( + parameters?: SpacesGetParameters, + options?: SpacesGetOptions, + ) => SpacesGetRequest { const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamConsoleV1SitesCreate( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamConsoleV1Sites.fromClient(client, defaults) - return seam.create(...args) + return function spacesGet( + ...args: Parameters + ): ReturnType { + const seam = SeamHttpSpaces.fromClient(client, defaults) + return seam.get(...args) } } - get '/seam/console/v1/sites/delete'(): ( - parameters: SeamConsoleV1SitesDeleteParameters, - options?: SeamConsoleV1SitesDeleteOptions, - ) => SeamConsoleV1SitesDeleteRequest { + get '/spaces/get_related'(): ( + parameters?: SpacesGetRelatedParameters, + options?: SpacesGetRelatedOptions, + ) => SpacesGetRelatedRequest { const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamConsoleV1SitesDelete( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamConsoleV1Sites.fromClient(client, defaults) - return seam.delete(...args) + return function spacesGetRelated( + ...args: Parameters + ): ReturnType { + const seam = SeamHttpSpaces.fromClient(client, defaults) + return seam.getRelated(...args) } } - get '/seam/console/v1/sites/list'(): ( - parameters?: SeamConsoleV1SitesListParameters, - options?: SeamConsoleV1SitesListOptions, - ) => SeamConsoleV1SitesListRequest { + get '/spaces/list'(): ( + parameters?: SpacesListParameters, + options?: SpacesListOptions, + ) => SpacesListRequest { const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamConsoleV1SitesList( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamConsoleV1Sites.fromClient(client, defaults) + return function spacesList( + ...args: Parameters + ): ReturnType { + const seam = SeamHttpSpaces.fromClient(client, defaults) return seam.list(...args) } } - get '/seam/console/v1/sites/update'(): ( - parameters: SeamConsoleV1SitesUpdateParameters, - options?: SeamConsoleV1SitesUpdateOptions, - ) => SeamConsoleV1SitesUpdateRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamConsoleV1SitesUpdate( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamConsoleV1Sites.fromClient(client, defaults) - return seam.update(...args) - } - } - - get '/seam/console/v1/timelines/get'(): ( - parameters: SeamConsoleV1TimelinesGetParameters, - options?: SeamConsoleV1TimelinesGetOptions, - ) => SeamConsoleV1TimelinesGetRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamConsoleV1TimelinesGet( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamConsoleV1Timelines.fromClient(client, defaults) - return seam.get(...args) - } - } - - get '/seam/console/v1/workspace/feature_flags/list'(): ( - parameters?: SeamConsoleV1WorkspaceFeatureFlagsListParameters, - options?: SeamConsoleV1WorkspaceFeatureFlagsListOptions, - ) => SeamConsoleV1WorkspaceFeatureFlagsListRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamConsoleV1WorkspaceFeatureFlagsList( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamConsoleV1WorkspaceFeatureFlags.fromClient( - client, - defaults, - ) - return seam.list(...args) - } - } - - get '/seam/console/v1/workspace/feature_flags/update'(): ( - parameters: SeamConsoleV1WorkspaceFeatureFlagsUpdateParameters, - options?: SeamConsoleV1WorkspaceFeatureFlagsUpdateOptions, - ) => SeamConsoleV1WorkspaceFeatureFlagsUpdateRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamConsoleV1WorkspaceFeatureFlagsUpdate( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamConsoleV1WorkspaceFeatureFlags.fromClient( - client, - defaults, - ) - return seam.update(...args) - } - } - - get '/seam/customer/v1/access_grants/list'(): ( - parameters?: SeamCustomerV1AccessGrantsListParameters, - options?: SeamCustomerV1AccessGrantsListOptions, - ) => SeamCustomerV1AccessGrantsListRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1AccessGrantsList( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamCustomerV1AccessGrants.fromClient( - client, - defaults, - ) - return seam.list(...args) - } - } - - get '/seam/customer/v1/access_grants/update'(): ( - parameters: SeamCustomerV1AccessGrantsUpdateParameters, - options?: SeamCustomerV1AccessGrantsUpdateOptions, - ) => SeamCustomerV1AccessGrantsUpdateRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1AccessGrantsUpdate( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamCustomerV1AccessGrants.fromClient( - client, - defaults, - ) - return seam.update(...args) - } - } - - get '/seam/customer/v1/access_methods/encode'(): ( - parameters: SeamCustomerV1AccessMethodsEncodeParameters, - options?: SeamCustomerV1AccessMethodsEncodeOptions, - ) => SeamCustomerV1AccessMethodsEncodeRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1AccessMethodsEncode( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamCustomerV1AccessMethods.fromClient( - client, - defaults, - ) - return seam.encode(...args) - } - } - - get '/seam/customer/v1/automation_runs/list'(): ( - parameters?: SeamCustomerV1AutomationRunsListParameters, - options?: SeamCustomerV1AutomationRunsListOptions, - ) => SeamCustomerV1AutomationRunsListRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1AutomationRunsList( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamCustomerV1AutomationRuns.fromClient( - client, - defaults, - ) - return seam.list(...args) - } - } - - get '/seam/customer/v1/automations/delete'(): ( - parameters?: SeamCustomerV1AutomationsDeleteParameters, - options?: SeamCustomerV1AutomationsDeleteOptions, - ) => SeamCustomerV1AutomationsDeleteRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1AutomationsDelete( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamCustomerV1Automations.fromClient( - client, - defaults, - ) - return seam.delete(...args) - } - } - - get '/seam/customer/v1/automations/get'(): ( - parameters?: SeamCustomerV1AutomationsGetParameters, - options?: SeamCustomerV1AutomationsGetOptions, - ) => SeamCustomerV1AutomationsGetRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1AutomationsGet( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamCustomerV1Automations.fromClient( - client, - defaults, - ) - return seam.get(...args) - } - } - - get '/seam/customer/v1/automations/update'(): ( - parameters?: SeamCustomerV1AutomationsUpdateParameters, - options?: SeamCustomerV1AutomationsUpdateOptions, - ) => SeamCustomerV1AutomationsUpdateRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1AutomationsUpdate( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamCustomerV1Automations.fromClient( - client, - defaults, - ) - return seam.update(...args) - } - } - - 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, - ) => SeamCustomerV1ConnectorsAuthorizeRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1ConnectorsAuthorize( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamCustomerV1Connectors.fromClient(client, defaults) - return seam.authorize(...args) - } - } - - get '/seam/customer/v1/connectors/connector_types'(): ( - parameters?: SeamCustomerV1ConnectorsConnectorTypesParameters, - options?: SeamCustomerV1ConnectorsConnectorTypesOptions, - ) => SeamCustomerV1ConnectorsConnectorTypesRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1ConnectorsConnectorTypes( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamCustomerV1Connectors.fromClient(client, defaults) - return seam.connectorTypes(...args) - } - } - - get '/seam/customer/v1/connectors/create'(): ( - parameters: SeamCustomerV1ConnectorsCreateParameters, - options?: SeamCustomerV1ConnectorsCreateOptions, - ) => SeamCustomerV1ConnectorsCreateRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1ConnectorsCreate( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamCustomerV1Connectors.fromClient(client, defaults) - return seam.create(...args) - } - } - - get '/seam/customer/v1/connectors/delete'(): ( - parameters: SeamCustomerV1ConnectorsDeleteParameters, - options?: SeamCustomerV1ConnectorsDeleteOptions, - ) => SeamCustomerV1ConnectorsDeleteRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1ConnectorsDelete( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamCustomerV1Connectors.fromClient(client, defaults) - return seam.delete(...args) - } - } - - get '/seam/customer/v1/connectors/list'(): ( - parameters?: SeamCustomerV1ConnectorsListParameters, - options?: SeamCustomerV1ConnectorsListOptions, - ) => SeamCustomerV1ConnectorsListRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1ConnectorsList( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamCustomerV1Connectors.fromClient(client, defaults) - return seam.list(...args) - } - } - - get '/seam/customer/v1/connectors/sync'(): ( - parameters: SeamCustomerV1ConnectorsSyncParameters, - options?: SeamCustomerV1ConnectorsSyncOptions, - ) => SeamCustomerV1ConnectorsSyncRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1ConnectorsSync( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamCustomerV1Connectors.fromClient(client, defaults) - return seam.sync(...args) - } - } - - get '/seam/customer/v1/connectors/update'(): ( - parameters: SeamCustomerV1ConnectorsUpdateParameters, - options?: SeamCustomerV1ConnectorsUpdateOptions, - ) => SeamCustomerV1ConnectorsUpdateRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1ConnectorsUpdate( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamCustomerV1Connectors.fromClient(client, defaults) - return seam.update(...args) - } - } - - get '/seam/customer/v1/connectors/external_sites/list'(): ( - parameters: SeamCustomerV1ConnectorsExternalSitesListParameters, - options?: SeamCustomerV1ConnectorsExternalSitesListOptions, - ) => SeamCustomerV1ConnectorsExternalSitesListRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1ConnectorsExternalSitesList( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamCustomerV1ConnectorsExternalSites.fromClient( - client, - defaults, - ) - return seam.list(...args) - } - } - - get '/seam/customer/v1/connectors/ical/validate-config'(): ( - parameters: SeamCustomerV1ConnectorsIcalValidateConfigParameters, - options?: SeamCustomerV1ConnectorsIcalValidateConfigOptions, - ) => SeamCustomerV1ConnectorsIcalValidateConfigRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1ConnectorsIcalValidateConfig( - ...args: Parameters< - SeamHttpSeamCustomerV1ConnectorsIcal['validateConfig'] - > - ): ReturnType { - const seam = SeamHttpSeamCustomerV1ConnectorsIcal.fromClient( - client, - defaults, - ) - return seam.validateConfig(...args) - } - } - - get '/seam/customer/v1/customers/automations/get'(): ( - parameters?: SeamCustomerV1CustomersAutomationsGetParameters, - options?: SeamCustomerV1CustomersAutomationsGetOptions, - ) => SeamCustomerV1CustomersAutomationsGetRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1CustomersAutomationsGet( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamCustomerV1CustomersAutomations.fromClient( - client, - defaults, - ) - return seam.get(...args) - } - } - - get '/seam/customer/v1/customers/automations/update'(): ( - parameters?: SeamCustomerV1CustomersAutomationsUpdateParameters, - options?: SeamCustomerV1CustomersAutomationsUpdateOptions, - ) => SeamCustomerV1CustomersAutomationsUpdateRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1CustomersAutomationsUpdate( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamCustomerV1CustomersAutomations.fromClient( - client, - defaults, - ) - return seam.update(...args) - } - } - - get '/seam/customer/v1/customers/list'(): ( - parameters?: SeamCustomerV1CustomersListParameters, - options?: SeamCustomerV1CustomersListOptions, - ) => SeamCustomerV1CustomersListRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1CustomersList( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamCustomerV1Customers.fromClient(client, defaults) - return seam.list(...args) - } - } - - get '/seam/customer/v1/customers/me'(): ( - parameters?: SeamCustomerV1CustomersMeParameters, - options?: SeamCustomerV1CustomersMeOptions, - ) => SeamCustomerV1CustomersMeRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1CustomersMe( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamCustomerV1Customers.fromClient(client, defaults) - return seam.me(...args) - } - } - - get '/seam/customer/v1/customers/open_portal'(): ( - parameters: SeamCustomerV1CustomersOpenPortalParameters, - options?: SeamCustomerV1CustomersOpenPortalOptions, - ) => SeamCustomerV1CustomersOpenPortalRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1CustomersOpenPortal( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamCustomerV1Customers.fromClient(client, defaults) - return seam.openPortal(...args) - } - } - - get '/seam/customer/v1/encoders/list'(): ( - parameters?: SeamCustomerV1EncodersListParameters, - options?: SeamCustomerV1EncodersListOptions, - ) => SeamCustomerV1EncodersListRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1EncodersList( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamCustomerV1Encoders.fromClient(client, defaults) - return seam.list(...args) - } - } - - get '/seam/customer/v1/events/list'(): ( - parameters: SeamCustomerV1EventsListParameters, - options?: SeamCustomerV1EventsListOptions, - ) => SeamCustomerV1EventsListRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1EventsList( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamCustomerV1Events.fromClient(client, defaults) - return seam.list(...args) - } - } - - 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/portals/update'(): ( - parameters: SeamCustomerV1PortalsUpdateParameters, - options?: SeamCustomerV1PortalsUpdateOptions, - ) => SeamCustomerV1PortalsUpdateRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1PortalsUpdate( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamCustomerV1Portals.fromClient(client, defaults) - return seam.update(...args) - } - } - - get '/seam/customer/v1/reservations/get'(): ( - parameters?: SeamCustomerV1ReservationsGetParameters, - options?: SeamCustomerV1ReservationsGetOptions, - ) => SeamCustomerV1ReservationsGetRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1ReservationsGet( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamCustomerV1Reservations.fromClient( - client, - defaults, - ) - return seam.get(...args) - } - } - - get '/seam/customer/v1/reservations/list'(): ( - parameters?: SeamCustomerV1ReservationsListParameters, - options?: SeamCustomerV1ReservationsListOptions, - ) => SeamCustomerV1ReservationsListRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1ReservationsList( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamCustomerV1Reservations.fromClient( - client, - defaults, - ) - return seam.list(...args) - } - } - - get '/seam/customer/v1/reservations/list_access_grants'(): ( - parameters: SeamCustomerV1ReservationsListAccessGrantsParameters, - options?: SeamCustomerV1ReservationsListAccessGrantsOptions, - ) => SeamCustomerV1ReservationsListAccessGrantsRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1ReservationsListAccessGrants( - ...args: Parameters< - SeamHttpSeamCustomerV1Reservations['listAccessGrants'] - > - ): ReturnType { - const seam = SeamHttpSeamCustomerV1Reservations.fromClient( - client, - defaults, - ) - return seam.listAccessGrants(...args) - } - } - - get '/seam/customer/v1/settings/get'(): ( - parameters?: SeamCustomerV1SettingsGetParameters, - options?: SeamCustomerV1SettingsGetOptions, - ) => SeamCustomerV1SettingsGetRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1SettingsGet( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamCustomerV1Settings.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/customer/v1/settings/vertical_resource_aliases/get'(): ( - parameters?: SeamCustomerV1SettingsVerticalResourceAliasesGetParameters, - options?: SeamCustomerV1SettingsVerticalResourceAliasesGetOptions, - ) => SeamCustomerV1SettingsVerticalResourceAliasesGetRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1SettingsVerticalResourceAliasesGet( - ...args: Parameters< - SeamHttpSeamCustomerV1SettingsVerticalResourceAliases['get'] - > - ): ReturnType< - SeamHttpSeamCustomerV1SettingsVerticalResourceAliases['get'] - > { - const seam = - SeamHttpSeamCustomerV1SettingsVerticalResourceAliases.fromClient( - client, - defaults, - ) - return seam.get(...args) - } - } - - get '/seam/customer/v1/spaces/create'(): ( - parameters: SeamCustomerV1SpacesCreateParameters, - options?: SeamCustomerV1SpacesCreateOptions, - ) => SeamCustomerV1SpacesCreateRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1SpacesCreate( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamCustomerV1Spaces.fromClient(client, defaults) - return seam.create(...args) - } - } - - get '/seam/customer/v1/spaces/list'(): ( - parameters?: SeamCustomerV1SpacesListParameters, - options?: SeamCustomerV1SpacesListOptions, - ) => SeamCustomerV1SpacesListRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1SpacesList( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamCustomerV1Spaces.fromClient(client, defaults) - return seam.list(...args) - } - } - - get '/seam/customer/v1/spaces/list_reservations'(): ( - parameters: SeamCustomerV1SpacesListReservationsParameters, - options?: SeamCustomerV1SpacesListReservationsOptions, - ) => SeamCustomerV1SpacesListReservationsRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1SpacesListReservations( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamCustomerV1Spaces.fromClient(client, defaults) - return seam.listReservations(...args) - } - } - - get '/seam/customer/v1/spaces/push_common_areas'(): ( - parameters?: SeamCustomerV1SpacesPushCommonAreasParameters, - options?: SeamCustomerV1SpacesPushCommonAreasOptions, - ) => SeamCustomerV1SpacesPushCommonAreasRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1SpacesPushCommonAreas( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamCustomerV1Spaces.fromClient(client, defaults) - return seam.pushCommonAreas(...args) - } - } - - get '/seam/customer/v1/staff_members/get'(): ( - parameters: SeamCustomerV1StaffMembersGetParameters, - options?: SeamCustomerV1StaffMembersGetOptions, - ) => SeamCustomerV1StaffMembersGetRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamCustomerV1StaffMembersGet( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamCustomerV1StaffMembers.fromClient( - client, - defaults, - ) - return seam.get(...args) - } - } - - 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/partner/v1/building_blocks/spaces/auto_map'(): ( - parameters?: SeamPartnerV1BuildingBlocksSpacesAutoMapParameters, - options?: SeamPartnerV1BuildingBlocksSpacesAutoMapOptions, - ) => SeamPartnerV1BuildingBlocksSpacesAutoMapRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function seamPartnerV1BuildingBlocksSpacesAutoMap( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSeamPartnerV1BuildingBlocksSpaces.fromClient( - client, - defaults, - ) - return seam.autoMap(...args) - } - } - - get '/spaces/add_acs_entrances'(): ( - parameters: SpacesAddAcsEntrancesParameters, - options?: SpacesAddAcsEntrancesOptions, - ) => SpacesAddAcsEntrancesRequest { - const { client, defaults } = this - return function spacesAddAcsEntrances( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSpaces.fromClient(client, defaults) - return seam.addAcsEntrances(...args) - } - } - - get '/spaces/add_connected_account'(): ( - parameters: SpacesAddConnectedAccountParameters, - options?: SpacesAddConnectedAccountOptions, - ) => SpacesAddConnectedAccountRequest { - const { client, defaults } = this - return function spacesAddConnectedAccount( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSpaces.fromClient(client, defaults) - return seam.addConnectedAccount(...args) - } - } - - get '/spaces/add_devices'(): ( - parameters: SpacesAddDevicesParameters, - options?: SpacesAddDevicesOptions, - ) => SpacesAddDevicesRequest { - const { client, defaults } = this - return function spacesAddDevices( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSpaces.fromClient(client, defaults) - return seam.addDevices(...args) - } - } - - get '/spaces/create'(): ( - parameters: SpacesCreateParameters, - options?: SpacesCreateOptions, - ) => SpacesCreateRequest { - const { client, defaults } = this - return function spacesCreate( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSpaces.fromClient(client, defaults) - return seam.create(...args) - } - } - - get '/spaces/delete'(): ( - parameters: SpacesDeleteParameters, - options?: SpacesDeleteOptions, - ) => SpacesDeleteRequest { - const { client, defaults } = this - return function spacesDelete( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSpaces.fromClient(client, defaults) - return seam.delete(...args) - } - } - - get '/spaces/get'(): ( - parameters?: SpacesGetParameters, - options?: SpacesGetOptions, - ) => SpacesGetRequest { - const { client, defaults } = this - return function spacesGet( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSpaces.fromClient(client, defaults) - return seam.get(...args) - } - } - - get '/spaces/get_related'(): ( - parameters?: SpacesGetRelatedParameters, - options?: SpacesGetRelatedOptions, - ) => SpacesGetRelatedRequest { - const { client, defaults } = this - return function spacesGetRelated( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSpaces.fromClient(client, defaults) - return seam.getRelated(...args) - } - } - - get '/spaces/list'(): ( - parameters?: SpacesListParameters, - options?: SpacesListOptions, - ) => SpacesListRequest { - const { client, defaults } = this - return function spacesList( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpSpaces.fromClient(client, defaults) - return seam.list(...args) - } - } - - get '/spaces/remove_acs_entrances'(): ( - parameters: SpacesRemoveAcsEntrancesParameters, - options?: SpacesRemoveAcsEntrancesOptions, - ) => SpacesRemoveAcsEntrancesRequest { + get '/spaces/remove_acs_entrances'(): ( + parameters: SpacesRemoveAcsEntrancesParameters, + options?: SpacesRemoveAcsEntrancesOptions, + ) => SpacesRemoveAcsEntrancesRequest { const { client, defaults } = this return function spacesRemoveAcsEntrances( ...args: Parameters @@ -4537,24 +2924,6 @@ export class SeamHttpEndpoints { } } - get '/thermostats/get'(): ( - parameters?: ThermostatsGetParameters, - options?: ThermostatsGetOptions, - ) => ThermostatsGetRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function thermostatsGet( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpThermostats.fromClient(client, defaults) - return seam.get(...args) - } - } - get '/thermostats/heat'(): ( parameters: ThermostatsHeatParameters, options?: ThermostatsHeatOptions, @@ -4815,98 +3184,6 @@ export class SeamHttpEndpoints { } } - get '/unstable_partner/building_blocks/connect_accounts'(): ( - parameters: UnstablePartnerBuildingBlocksConnectAccountsParameters, - options?: UnstablePartnerBuildingBlocksConnectAccountsOptions, - ) => UnstablePartnerBuildingBlocksConnectAccountsRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function unstablePartnerBuildingBlocksConnectAccounts( - ...args: Parameters< - SeamHttpUnstablePartnerBuildingBlocks['connectAccounts'] - > - ): ReturnType { - const seam = SeamHttpUnstablePartnerBuildingBlocks.fromClient( - client, - defaults, - ) - return seam.connectAccounts(...args) - } - } - - get '/unstable_partner/building_blocks/generate_magic_link'(): ( - parameters: UnstablePartnerBuildingBlocksGenerateMagicLinkParameters, - options?: UnstablePartnerBuildingBlocksGenerateMagicLinkOptions, - ) => UnstablePartnerBuildingBlocksGenerateMagicLinkRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function unstablePartnerBuildingBlocksGenerateMagicLink( - ...args: Parameters< - SeamHttpUnstablePartnerBuildingBlocks['generateMagicLink'] - > - ): ReturnType { - const seam = SeamHttpUnstablePartnerBuildingBlocks.fromClient( - client, - defaults, - ) - return seam.generateMagicLink(...args) - } - } - - get '/unstable_partner/building_blocks/manage_devices'(): ( - parameters: UnstablePartnerBuildingBlocksManageDevicesParameters, - options?: UnstablePartnerBuildingBlocksManageDevicesOptions, - ) => UnstablePartnerBuildingBlocksManageDevicesRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function unstablePartnerBuildingBlocksManageDevices( - ...args: Parameters< - SeamHttpUnstablePartnerBuildingBlocks['manageDevices'] - > - ): ReturnType { - const seam = SeamHttpUnstablePartnerBuildingBlocks.fromClient( - client, - defaults, - ) - return seam.manageDevices(...args) - } - } - - get '/unstable_partner/building_blocks/organize_spaces'(): ( - parameters: UnstablePartnerBuildingBlocksOrganizeSpacesParameters, - options?: UnstablePartnerBuildingBlocksOrganizeSpacesOptions, - ) => UnstablePartnerBuildingBlocksOrganizeSpacesRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function unstablePartnerBuildingBlocksOrganizeSpaces( - ...args: Parameters< - SeamHttpUnstablePartnerBuildingBlocks['organizeSpaces'] - > - ): ReturnType { - const seam = SeamHttpUnstablePartnerBuildingBlocks.fromClient( - client, - defaults, - ) - return seam.organizeSpaces(...args) - } - } - get '/user_identities/add_acs_user'(): ( parameters: UserIdentitiesAddAcsUserParameters, options?: UserIdentitiesAddAcsUserOptions, @@ -5089,90 +3366,6 @@ export class SeamHttpEndpoints { } } - get '/user_identities/enrollment_automations/delete'(): ( - parameters: UserIdentitiesEnrollmentAutomationsDeleteParameters, - options?: UserIdentitiesEnrollmentAutomationsDeleteOptions, - ) => UserIdentitiesEnrollmentAutomationsDeleteRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function userIdentitiesEnrollmentAutomationsDelete( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpUserIdentitiesEnrollmentAutomations.fromClient( - client, - defaults, - ) - return seam.delete(...args) - } - } - - get '/user_identities/enrollment_automations/get'(): ( - parameters: UserIdentitiesEnrollmentAutomationsGetParameters, - options?: UserIdentitiesEnrollmentAutomationsGetOptions, - ) => UserIdentitiesEnrollmentAutomationsGetRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function userIdentitiesEnrollmentAutomationsGet( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpUserIdentitiesEnrollmentAutomations.fromClient( - client, - defaults, - ) - return seam.get(...args) - } - } - - get '/user_identities/enrollment_automations/launch'(): ( - parameters: UserIdentitiesEnrollmentAutomationsLaunchParameters, - options?: UserIdentitiesEnrollmentAutomationsLaunchOptions, - ) => UserIdentitiesEnrollmentAutomationsLaunchRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function userIdentitiesEnrollmentAutomationsLaunch( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpUserIdentitiesEnrollmentAutomations.fromClient( - client, - defaults, - ) - return seam.launch(...args) - } - } - - get '/user_identities/enrollment_automations/list'(): ( - parameters: UserIdentitiesEnrollmentAutomationsListParameters, - options?: UserIdentitiesEnrollmentAutomationsListOptions, - ) => UserIdentitiesEnrollmentAutomationsListRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function userIdentitiesEnrollmentAutomationsList( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpUserIdentitiesEnrollmentAutomations.fromClient( - client, - defaults, - ) - return seam.list(...args) - } - } - get '/user_identities/unmanaged/get'(): ( parameters: UserIdentitiesUnmanagedGetParameters, options?: UserIdentitiesUnmanagedGetOptions, @@ -5290,24 +3483,6 @@ export class SeamHttpEndpoints { } } - get '/workspaces/find_anything'(): ( - parameters: WorkspacesFindAnythingParameters, - options?: WorkspacesFindAnythingOptions, - ) => WorkspacesFindAnythingRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function workspacesFindAnything( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpWorkspaces.fromClient(client, defaults) - return seam.findAnything(...args) - } - } - get '/workspaces/get'(): ( parameters?: WorkspacesGetParameters, options?: WorkspacesGetOptions, @@ -5359,119 +3534,11 @@ export class SeamHttpEndpoints { return seam.update(...args) } } - - get '/workspaces/customization_profiles/create'(): ( - parameters?: WorkspacesCustomizationProfilesCreateParameters, - options?: WorkspacesCustomizationProfilesCreateOptions, - ) => WorkspacesCustomizationProfilesCreateRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function workspacesCustomizationProfilesCreate( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpWorkspacesCustomizationProfiles.fromClient( - client, - defaults, - ) - return seam.create(...args) - } - } - - get '/workspaces/customization_profiles/get'(): ( - parameters: WorkspacesCustomizationProfilesGetParameters, - options?: WorkspacesCustomizationProfilesGetOptions, - ) => WorkspacesCustomizationProfilesGetRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function workspacesCustomizationProfilesGet( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpWorkspacesCustomizationProfiles.fromClient( - client, - defaults, - ) - return seam.get(...args) - } - } - - get '/workspaces/customization_profiles/list'(): ( - parameters?: WorkspacesCustomizationProfilesListParameters, - options?: WorkspacesCustomizationProfilesListOptions, - ) => WorkspacesCustomizationProfilesListRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function workspacesCustomizationProfilesList( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpWorkspacesCustomizationProfiles.fromClient( - client, - defaults, - ) - return seam.list(...args) - } - } - - get '/workspaces/customization_profiles/update'(): ( - parameters: WorkspacesCustomizationProfilesUpdateParameters, - options?: WorkspacesCustomizationProfilesUpdateOptions, - ) => WorkspacesCustomizationProfilesUpdateRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function workspacesCustomizationProfilesUpdate( - ...args: Parameters - ): ReturnType { - const seam = SeamHttpWorkspacesCustomizationProfiles.fromClient( - client, - defaults, - ) - return seam.update(...args) - } - } - - get '/workspaces/customization_profiles/upload_images'(): ( - parameters?: WorkspacesCustomizationProfilesUploadImagesParameters, - options?: WorkspacesCustomizationProfilesUploadImagesOptions, - ) => WorkspacesCustomizationProfilesUploadImagesRequest { - const { client, defaults } = this - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return function workspacesCustomizationProfilesUploadImages( - ...args: Parameters< - SeamHttpWorkspacesCustomizationProfiles['uploadImages'] - > - ): ReturnType { - const seam = SeamHttpWorkspacesCustomizationProfiles.fromClient( - client, - defaults, - ) - return seam.uploadImages(...args) - } - } } export type SeamHttpEndpointQueryPaths = | '/access_codes/generate_code' | '/access_codes/get' - | '/access_codes/get_timeline' | '/access_codes/list' | '/access_codes/unmanaged/get' | '/access_codes/unmanaged/list' @@ -5489,14 +3556,9 @@ export type SeamHttpEndpointQueryPaths = | '/acs/access_groups/list' | '/acs/access_groups/list_accessible_entrances' | '/acs/access_groups/list_users' - | '/acs/access_groups/unmanaged/get' - | '/acs/access_groups/unmanaged/list' - | '/acs/credential_pools/list' | '/acs/credentials/get' | '/acs/credentials/list' | '/acs/credentials/list_accessible_entrances' - | '/acs/credentials/unmanaged/get' - | '/acs/credentials/unmanaged/list' | '/acs/encoders/get' | '/acs/encoders/list' | '/acs/entrances/get' @@ -5508,12 +3570,8 @@ export type SeamHttpEndpointQueryPaths = | '/acs/users/get' | '/acs/users/list' | '/acs/users/list_accessible_entrances' - | '/acs/users/unmanaged/get' - | '/acs/users/unmanaged/list' | '/action_attempts/get' | '/action_attempts/list' - | '/bridges/get' - | '/bridges/list' | '/client_sessions/get' | '/client_sessions/list' | '/connect_webviews/get' @@ -5536,62 +3594,24 @@ export type SeamHttpEndpointQueryPaths = | '/noise_sensors/noise_thresholds/list' | '/phones/get' | '/phones/list' - | '/seam/console/v1/get_resource_locator' - | '/seam/console/v1/lynx_migration/get_property_migration_status' - | '/seam/console/v1/lynx_migration/get_reservation_migration_status' - | '/seam/console/v1/lynx_migration/list_property_reservations' - | '/seam/console/v1/sites/list' - | '/seam/console/v1/timelines/get' - | '/seam/console/v1/workspace/feature_flags/list' - | '/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' - | '/seam/customer/v1/connectors/external_sites/list' - | '/seam/customer/v1/customers/automations/get' - | '/seam/customer/v1/customers/list' - | '/seam/customer/v1/customers/me' - | '/seam/customer/v1/encoders/list' - | '/seam/customer/v1/events/list' - | '/seam/customer/v1/portals/get' - | '/seam/customer/v1/reservations/get' - | '/seam/customer/v1/reservations/list' - | '/seam/customer/v1/reservations/list_access_grants' - | '/seam/customer/v1/settings/get' - | '/seam/customer/v1/settings/vertical_resource_aliases/get' - | '/seam/customer/v1/spaces/list' - | '/seam/customer/v1/spaces/list_reservations' - | '/seam/customer/v1/staff_members/get' - | '/seam/customer/v1/staff_members/list' - | '/seam/partner/v1/building_blocks/spaces/auto_map' | '/spaces/get' | '/spaces/get_related' | '/spaces/list' - | '/thermostats/get' | '/thermostats/list' | '/thermostats/schedules/get' | '/thermostats/schedules/list' - | '/unstable_partner/building_blocks/generate_magic_link' | '/user_identities/get' | '/user_identities/list' | '/user_identities/list_accessible_devices' | '/user_identities/list_accessible_entrances' | '/user_identities/list_acs_systems' | '/user_identities/list_acs_users' - | '/user_identities/enrollment_automations/get' - | '/user_identities/enrollment_automations/list' | '/user_identities/unmanaged/get' | '/user_identities/unmanaged/list' | '/webhooks/get' | '/webhooks/list' - | '/workspaces/find_anything' | '/workspaces/get' | '/workspaces/list' - | '/workspaces/customization_profiles/get' - | '/workspaces/customization_profiles/list' export type SeamHttpEndpointPaginatedQueryPaths = | '/access_codes/list' @@ -5608,10 +3628,6 @@ export type SeamHttpEndpointPaginatedQueryPaths = | '/connected_accounts/list' | '/devices/list' | '/devices/unmanaged/list' - | '/seam/customer/v1/automation_runs/list' - | '/seam/customer/v1/customers/list' - | '/seam/customer/v1/reservations/list' - | '/seam/customer/v1/staff_members/list' | '/spaces/list' | '/user_identities/list' | '/user_identities/unmanaged/list' @@ -5640,10 +3656,8 @@ export type SeamHttpEndpointMutationPaths = | '/acs/access_groups/add_user' | '/acs/access_groups/delete' | '/acs/access_groups/remove_user' - | '/acs/credential_provisioning_automations/launch' | '/acs/credentials/assign' | '/acs/credentials/create' - | '/acs/credentials/create_offline_code' | '/acs/credentials/delete' | '/acs/credentials/unassign' | '/acs/credentials/update' @@ -5679,8 +3693,6 @@ export type SeamHttpEndpointMutationPaths = | '/customers/create_portal' | '/customers/delete_data' | '/customers/push_data' - | '/customers/reservations/create_deep_link' - | '/devices/delete' | '/devices/report_provider_metadata' | '/devices/update' | '/devices/simulate/connect' @@ -5702,26 +3714,6 @@ export type SeamHttpEndpointMutationPaths = | '/noise_sensors/simulate/trigger_noise_threshold' | '/phones/deactivate' | '/phones/simulate/create_sandbox_phone' - | '/seam/console/v1/lynx_migration/migrate_property' - | '/seam/console/v1/sites/create' - | '/seam/console/v1/sites/delete' - | '/seam/console/v1/sites/update' - | '/seam/console/v1/workspace/feature_flags/update' - | '/seam/customer/v1/access_grants/update' - | '/seam/customer/v1/access_methods/encode' - | '/seam/customer/v1/automations/delete' - | '/seam/customer/v1/automations/update' - | '/seam/customer/v1/connectors/create' - | '/seam/customer/v1/connectors/delete' - | '/seam/customer/v1/connectors/sync' - | '/seam/customer/v1/connectors/update' - | '/seam/customer/v1/connectors/ical/validate-config' - | '/seam/customer/v1/customers/automations/update' - | '/seam/customer/v1/customers/open_portal' - | '/seam/customer/v1/portals/update' - | '/seam/customer/v1/settings/update' - | '/seam/customer/v1/spaces/create' - | '/seam/customer/v1/spaces/push_common_areas' | '/spaces/add_acs_entrances' | '/spaces/add_connected_account' | '/spaces/add_devices' @@ -5752,9 +3744,6 @@ export type SeamHttpEndpointMutationPaths = | '/thermostats/schedules/update' | '/thermostats/simulate/hvac_mode_adjusted' | '/thermostats/simulate/temperature_reached' - | '/unstable_partner/building_blocks/connect_accounts' - | '/unstable_partner/building_blocks/manage_devices' - | '/unstable_partner/building_blocks/organize_spaces' | '/user_identities/add_acs_user' | '/user_identities/create' | '/user_identities/delete' @@ -5763,8 +3752,6 @@ export type SeamHttpEndpointMutationPaths = | '/user_identities/remove_acs_user' | '/user_identities/revoke_access_to_device' | '/user_identities/update' - | '/user_identities/enrollment_automations/delete' - | '/user_identities/enrollment_automations/launch' | '/user_identities/unmanaged/update' | '/webhooks/create' | '/webhooks/delete' @@ -5772,6 +3759,3 @@ export type SeamHttpEndpointMutationPaths = | '/workspaces/create' | '/workspaces/reset_sandbox' | '/workspaces/update' - | '/workspaces/customization_profiles/create' - | '/workspaces/customization_profiles/update' - | '/workspaces/customization_profiles/upload_images' diff --git a/src/lib/seam/connect/routes/seam-http.ts b/src/lib/seam/connect/routes/seam-http.ts index c5c4e5fb..528bf4ae 100644 --- a/src/lib/seam/connect/routes/seam-http.ts +++ b/src/lib/seam/connect/routes/seam-http.ts @@ -37,7 +37,6 @@ import { SeamHttpAccessGrants } from './access-grants/index.js' import { SeamHttpAccessMethods } from './access-methods/index.js' import { SeamHttpAcs } from './acs/index.js' import { SeamHttpActionAttempts } from './action-attempts/index.js' -import { SeamHttpBridges } from './bridges/index.js' import { SeamHttpClientSessions } from './client-sessions/index.js' import { SeamHttpConnectWebviews } from './connect-webviews/index.js' import { SeamHttpConnectedAccounts } from './connected-accounts/index.js' @@ -50,7 +49,6 @@ import { SeamHttpNoiseSensors } from './noise-sensors/index.js' import { SeamHttpPhones } from './phones/index.js' import { SeamHttpSpaces } from './spaces/index.js' import { SeamHttpThermostats } from './thermostats/index.js' -import { SeamHttpUnstablePartner } from './unstable-partner/index.js' import { SeamHttpUserIdentities } from './user-identities/index.js' import { SeamHttpWebhooks } from './webhooks/index.js' import { SeamHttpWorkspaces } from './workspaces/index.js' @@ -202,10 +200,6 @@ export class SeamHttp { return SeamHttpActionAttempts.fromClient(this.client, this.defaults) } - get bridges(): SeamHttpBridges { - return SeamHttpBridges.fromClient(this.client, this.defaults) - } - get clientSessions(): SeamHttpClientSessions { return SeamHttpClientSessions.fromClient(this.client, this.defaults) } @@ -254,10 +248,6 @@ export class SeamHttp { return SeamHttpThermostats.fromClient(this.client, this.defaults) } - get unstablePartner(): SeamHttpUnstablePartner { - return SeamHttpUnstablePartner.fromClient(this.client, this.defaults) - } - get userIdentities(): SeamHttpUserIdentities { return SeamHttpUserIdentities.fromClient(this.client, this.defaults) } diff --git a/src/lib/seam/connect/routes/seam/console/console.ts b/src/lib/seam/connect/routes/seam/console/console.ts deleted file mode 100644 index 22980699..00000000 --- a/src/lib/seam/connect/routes/seam/console/console.ts +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -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 type { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' -import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' - -import { SeamHttpSeamConsoleV1 } from './v1/index.js' - -export class SeamHttpSeamConsole { - 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 = {}, - ): SeamHttpSeamConsole { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpSeamConsole(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpSeamConsole { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpSeamConsole(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpSeamConsole { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpSeamConsole(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 SeamHttpSeamConsole.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpSeamConsole.fromClientSessionToken(token, options) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamConsole { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpSeamConsole(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamConsole { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpSeamConsole(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() - } - - get v1(): SeamHttpSeamConsoleV1 { - return SeamHttpSeamConsoleV1.fromClient(this.client, this.defaults) - } -} diff --git a/src/lib/seam/connect/routes/seam/console/index.ts b/src/lib/seam/connect/routes/seam/console/index.ts deleted file mode 100644 index 646f450f..00000000 --- a/src/lib/seam/connect/routes/seam/console/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './console.js' -export * from './v1/index.js' diff --git a/src/lib/seam/connect/routes/seam/console/v1/index.ts b/src/lib/seam/connect/routes/seam/console/v1/index.ts deleted file mode 100644 index 76a262f3..00000000 --- a/src/lib/seam/connect/routes/seam/console/v1/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './lynx-migration/index.js' -export * from './sites/index.js' -export * from './timelines/index.js' -export * from './v1.js' -export * from './workspace/index.js' diff --git a/src/lib/seam/connect/routes/seam/console/v1/lynx-migration/index.ts b/src/lib/seam/connect/routes/seam/console/v1/lynx-migration/index.ts deleted file mode 100644 index 3d495e3b..00000000 --- a/src/lib/seam/connect/routes/seam/console/v1/lynx-migration/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './lynx-migration.js' diff --git a/src/lib/seam/connect/routes/seam/console/v1/lynx-migration/lynx-migration.ts b/src/lib/seam/connect/routes/seam/console/v1/lynx-migration/lynx-migration.ts deleted file mode 100644 index 3b7277dc..00000000 --- a/src/lib/seam/connect/routes/seam/console/v1/lynx-migration/lynx-migration.ts +++ /dev/null @@ -1,336 +0,0 @@ -/* - * 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' - -export class SeamHttpSeamConsoleV1LynxMigration { - 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 = {}, - ): SeamHttpSeamConsoleV1LynxMigration { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpSeamConsoleV1LynxMigration(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpSeamConsoleV1LynxMigration { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpSeamConsoleV1LynxMigration(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpSeamConsoleV1LynxMigration { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpSeamConsoleV1LynxMigration(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 SeamHttpSeamConsoleV1LynxMigration.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpSeamConsoleV1LynxMigration.fromClientSessionToken( - token, - options, - ) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamConsoleV1LynxMigration { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpSeamConsoleV1LynxMigration(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamConsoleV1LynxMigration { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpSeamConsoleV1LynxMigration(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() - } - - getPropertyMigrationStatus( - parameters: SeamConsoleV1LynxMigrationGetPropertyMigrationStatusParameters, - options: SeamConsoleV1LynxMigrationGetPropertyMigrationStatusOptions = {}, - ): SeamConsoleV1LynxMigrationGetPropertyMigrationStatusRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/console/v1/lynx_migration/get_property_migration_status', - method: 'POST', - body: parameters, - responseKey: 'lynx_migration_property_run', - options, - }) - } - - getReservationMigrationStatus( - parameters: SeamConsoleV1LynxMigrationGetReservationMigrationStatusParameters, - options: SeamConsoleV1LynxMigrationGetReservationMigrationStatusOptions = {}, - ): SeamConsoleV1LynxMigrationGetReservationMigrationStatusRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: - '/seam/console/v1/lynx_migration/get_reservation_migration_status', - method: 'POST', - body: parameters, - responseKey: 'lynx_migration_reservation_run', - options, - }) - } - - listPropertyReservations( - parameters: SeamConsoleV1LynxMigrationListPropertyReservationsParameters, - options: SeamConsoleV1LynxMigrationListPropertyReservationsOptions = {}, - ): SeamConsoleV1LynxMigrationListPropertyReservationsRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/console/v1/lynx_migration/list_property_reservations', - method: 'POST', - body: parameters, - responseKey: 'lynx_migration_property_plan', - options, - }) - } - - migrateProperty( - parameters: SeamConsoleV1LynxMigrationMigratePropertyParameters, - options: SeamConsoleV1LynxMigrationMigratePropertyOptions = {}, - ): SeamConsoleV1LynxMigrationMigratePropertyRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/console/v1/lynx_migration/migrate_property', - method: 'POST', - body: parameters, - responseKey: 'lynx_migration_property_run', - options, - }) - } -} - -export type SeamConsoleV1LynxMigrationGetPropertyMigrationStatusParameters = - RouteRequestBody<'/seam/console/v1/lynx_migration/get_property_migration_status'> - -/** - * @deprecated Use SeamConsoleV1LynxMigrationGetPropertyMigrationStatusParameters instead. - */ -export type SeamConsoleV1LynxMigrationGetPropertyMigrationStatusParams = - SeamConsoleV1LynxMigrationGetPropertyMigrationStatusParameters - -/** - * @deprecated Use SeamConsoleV1LynxMigrationGetPropertyMigrationStatusRequest instead. - */ -export type SeamConsoleV1LynxMigrationGetPropertyMigrationStatusResponse = - RouteResponse<'/seam/console/v1/lynx_migration/get_property_migration_status'> - -export type SeamConsoleV1LynxMigrationGetPropertyMigrationStatusRequest = - SeamHttpRequest< - SeamConsoleV1LynxMigrationGetPropertyMigrationStatusResponse, - 'lynx_migration_property_run' - > - -export interface SeamConsoleV1LynxMigrationGetPropertyMigrationStatusOptions {} - -export type SeamConsoleV1LynxMigrationGetReservationMigrationStatusParameters = - RouteRequestBody<'/seam/console/v1/lynx_migration/get_reservation_migration_status'> - -/** - * @deprecated Use SeamConsoleV1LynxMigrationGetReservationMigrationStatusParameters instead. - */ -export type SeamConsoleV1LynxMigrationGetReservationMigrationStatusParams = - SeamConsoleV1LynxMigrationGetReservationMigrationStatusParameters - -/** - * @deprecated Use SeamConsoleV1LynxMigrationGetReservationMigrationStatusRequest instead. - */ -export type SeamConsoleV1LynxMigrationGetReservationMigrationStatusResponse = - RouteResponse<'/seam/console/v1/lynx_migration/get_reservation_migration_status'> - -export type SeamConsoleV1LynxMigrationGetReservationMigrationStatusRequest = - SeamHttpRequest< - SeamConsoleV1LynxMigrationGetReservationMigrationStatusResponse, - 'lynx_migration_reservation_run' - > - -export interface SeamConsoleV1LynxMigrationGetReservationMigrationStatusOptions {} - -export type SeamConsoleV1LynxMigrationListPropertyReservationsParameters = - RouteRequestBody<'/seam/console/v1/lynx_migration/list_property_reservations'> - -/** - * @deprecated Use SeamConsoleV1LynxMigrationListPropertyReservationsParameters instead. - */ -export type SeamConsoleV1LynxMigrationListPropertyReservationsParams = - SeamConsoleV1LynxMigrationListPropertyReservationsParameters - -/** - * @deprecated Use SeamConsoleV1LynxMigrationListPropertyReservationsRequest instead. - */ -export type SeamConsoleV1LynxMigrationListPropertyReservationsResponse = - RouteResponse<'/seam/console/v1/lynx_migration/list_property_reservations'> - -export type SeamConsoleV1LynxMigrationListPropertyReservationsRequest = - SeamHttpRequest< - SeamConsoleV1LynxMigrationListPropertyReservationsResponse, - 'lynx_migration_property_plan' - > - -export interface SeamConsoleV1LynxMigrationListPropertyReservationsOptions {} - -export type SeamConsoleV1LynxMigrationMigratePropertyParameters = - RouteRequestBody<'/seam/console/v1/lynx_migration/migrate_property'> - -/** - * @deprecated Use SeamConsoleV1LynxMigrationMigratePropertyParameters instead. - */ -export type SeamConsoleV1LynxMigrationMigratePropertyBody = - SeamConsoleV1LynxMigrationMigratePropertyParameters - -/** - * @deprecated Use SeamConsoleV1LynxMigrationMigratePropertyRequest instead. - */ -export type SeamConsoleV1LynxMigrationMigratePropertyResponse = - RouteResponse<'/seam/console/v1/lynx_migration/migrate_property'> - -export type SeamConsoleV1LynxMigrationMigratePropertyRequest = SeamHttpRequest< - SeamConsoleV1LynxMigrationMigratePropertyResponse, - 'lynx_migration_property_run' -> - -export interface SeamConsoleV1LynxMigrationMigratePropertyOptions {} diff --git a/src/lib/seam/connect/routes/seam/console/v1/sites/index.ts b/src/lib/seam/connect/routes/seam/console/v1/sites/index.ts deleted file mode 100644 index 02d6dacc..00000000 --- a/src/lib/seam/connect/routes/seam/console/v1/sites/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './sites.js' diff --git a/src/lib/seam/connect/routes/seam/console/v1/sites/sites.ts b/src/lib/seam/connect/routes/seam/console/v1/sites/sites.ts deleted file mode 100644 index b85ac7af..00000000 --- a/src/lib/seam/connect/routes/seam/console/v1/sites/sites.ts +++ /dev/null @@ -1,322 +0,0 @@ -/* - * 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' - -export class SeamHttpSeamConsoleV1Sites { - 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 = {}, - ): SeamHttpSeamConsoleV1Sites { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpSeamConsoleV1Sites(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpSeamConsoleV1Sites { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpSeamConsoleV1Sites(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpSeamConsoleV1Sites { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpSeamConsoleV1Sites(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 SeamHttpSeamConsoleV1Sites.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpSeamConsoleV1Sites.fromClientSessionToken(token, options) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamConsoleV1Sites { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpSeamConsoleV1Sites(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamConsoleV1Sites { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpSeamConsoleV1Sites(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: SeamConsoleV1SitesCreateParameters, - options: SeamConsoleV1SitesCreateOptions = {}, - ): SeamConsoleV1SitesCreateRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/console/v1/sites/create', - method: 'POST', - body: parameters, - responseKey: 'site', - options, - }) - } - - delete( - parameters: SeamConsoleV1SitesDeleteParameters, - options: SeamConsoleV1SitesDeleteOptions = {}, - ): SeamConsoleV1SitesDeleteRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/console/v1/sites/delete', - method: 'POST', - body: parameters, - responseKey: undefined, - options, - }) - } - - list( - parameters?: SeamConsoleV1SitesListParameters, - options: SeamConsoleV1SitesListOptions = {}, - ): SeamConsoleV1SitesListRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/console/v1/sites/list', - method: 'POST', - body: parameters, - responseKey: 'sites', - options, - }) - } - - update( - parameters: SeamConsoleV1SitesUpdateParameters, - options: SeamConsoleV1SitesUpdateOptions = {}, - ): SeamConsoleV1SitesUpdateRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/console/v1/sites/update', - method: 'PATCH', - body: parameters, - responseKey: 'site', - options, - }) - } -} - -export type SeamConsoleV1SitesCreateParameters = - RouteRequestBody<'/seam/console/v1/sites/create'> - -/** - * @deprecated Use SeamConsoleV1SitesCreateParameters instead. - */ -export type SeamConsoleV1SitesCreateBody = SeamConsoleV1SitesCreateParameters - -/** - * @deprecated Use SeamConsoleV1SitesCreateRequest instead. - */ -export type SeamConsoleV1SitesCreateResponse = - RouteResponse<'/seam/console/v1/sites/create'> - -export type SeamConsoleV1SitesCreateRequest = SeamHttpRequest< - SeamConsoleV1SitesCreateResponse, - 'site' -> - -export interface SeamConsoleV1SitesCreateOptions {} - -export type SeamConsoleV1SitesDeleteParameters = - RouteRequestBody<'/seam/console/v1/sites/delete'> - -/** - * @deprecated Use SeamConsoleV1SitesDeleteParameters instead. - */ -export type SeamConsoleV1SitesDeleteParams = SeamConsoleV1SitesDeleteParameters - -/** - * @deprecated Use SeamConsoleV1SitesDeleteRequest instead. - */ -export type SeamConsoleV1SitesDeleteResponse = - RouteResponse<'/seam/console/v1/sites/delete'> - -export type SeamConsoleV1SitesDeleteRequest = SeamHttpRequest - -export interface SeamConsoleV1SitesDeleteOptions {} - -export type SeamConsoleV1SitesListParameters = - RouteRequestBody<'/seam/console/v1/sites/list'> - -/** - * @deprecated Use SeamConsoleV1SitesListParameters instead. - */ -export type SeamConsoleV1SitesListParams = SeamConsoleV1SitesListParameters - -/** - * @deprecated Use SeamConsoleV1SitesListRequest instead. - */ -export type SeamConsoleV1SitesListResponse = - RouteResponse<'/seam/console/v1/sites/list'> - -export type SeamConsoleV1SitesListRequest = SeamHttpRequest< - SeamConsoleV1SitesListResponse, - 'sites' -> - -export interface SeamConsoleV1SitesListOptions {} - -export type SeamConsoleV1SitesUpdateParameters = - RouteRequestBody<'/seam/console/v1/sites/update'> - -/** - * @deprecated Use SeamConsoleV1SitesUpdateParameters instead. - */ -export type SeamConsoleV1SitesUpdateBody = SeamConsoleV1SitesUpdateParameters - -/** - * @deprecated Use SeamConsoleV1SitesUpdateRequest instead. - */ -export type SeamConsoleV1SitesUpdateResponse = - RouteResponse<'/seam/console/v1/sites/update'> - -export type SeamConsoleV1SitesUpdateRequest = SeamHttpRequest< - SeamConsoleV1SitesUpdateResponse, - 'site' -> - -export interface SeamConsoleV1SitesUpdateOptions {} diff --git a/src/lib/seam/connect/routes/seam/console/v1/timelines/index.ts b/src/lib/seam/connect/routes/seam/console/v1/timelines/index.ts deleted file mode 100644 index a4aa5669..00000000 --- a/src/lib/seam/connect/routes/seam/console/v1/timelines/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './timelines.js' diff --git a/src/lib/seam/connect/routes/seam/console/v1/timelines/timelines.ts b/src/lib/seam/connect/routes/seam/console/v1/timelines/timelines.ts deleted file mode 100644 index 42ba4189..00000000 --- a/src/lib/seam/connect/routes/seam/console/v1/timelines/timelines.ts +++ /dev/null @@ -1,209 +0,0 @@ -/* - * 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' - -export class SeamHttpSeamConsoleV1Timelines { - 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 = {}, - ): SeamHttpSeamConsoleV1Timelines { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpSeamConsoleV1Timelines(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpSeamConsoleV1Timelines { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpSeamConsoleV1Timelines(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpSeamConsoleV1Timelines { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpSeamConsoleV1Timelines(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 SeamHttpSeamConsoleV1Timelines.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpSeamConsoleV1Timelines.fromClientSessionToken(token, options) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamConsoleV1Timelines { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpSeamConsoleV1Timelines(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamConsoleV1Timelines { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpSeamConsoleV1Timelines(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() - } - - get( - parameters: SeamConsoleV1TimelinesGetParameters, - options: SeamConsoleV1TimelinesGetOptions = {}, - ): SeamConsoleV1TimelinesGetRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/console/v1/timelines/get', - method: 'POST', - body: parameters, - responseKey: 'timeline', - options, - }) - } -} - -export type SeamConsoleV1TimelinesGetParameters = - RouteRequestBody<'/seam/console/v1/timelines/get'> - -/** - * @deprecated Use SeamConsoleV1TimelinesGetParameters instead. - */ -export type SeamConsoleV1TimelinesGetParams = - SeamConsoleV1TimelinesGetParameters - -/** - * @deprecated Use SeamConsoleV1TimelinesGetRequest instead. - */ -export type SeamConsoleV1TimelinesGetResponse = - RouteResponse<'/seam/console/v1/timelines/get'> - -export type SeamConsoleV1TimelinesGetRequest = SeamHttpRequest< - SeamConsoleV1TimelinesGetResponse, - 'timeline' -> - -export interface SeamConsoleV1TimelinesGetOptions {} diff --git a/src/lib/seam/connect/routes/seam/console/v1/v1.ts b/src/lib/seam/connect/routes/seam/console/v1/v1.ts deleted file mode 100644 index 9bbcb8b5..00000000 --- a/src/lib/seam/connect/routes/seam/console/v1/v1.ts +++ /dev/null @@ -1,228 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -import type { RouteRequestParams, 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 { SeamHttpSeamConsoleV1LynxMigration } from './lynx-migration/index.js' -import { SeamHttpSeamConsoleV1Sites } from './sites/index.js' -import { SeamHttpSeamConsoleV1Timelines } from './timelines/index.js' - -export class SeamHttpSeamConsoleV1 { - 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 = {}, - ): SeamHttpSeamConsoleV1 { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpSeamConsoleV1(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpSeamConsoleV1 { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpSeamConsoleV1(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpSeamConsoleV1 { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpSeamConsoleV1(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 SeamHttpSeamConsoleV1.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpSeamConsoleV1.fromClientSessionToken(token, options) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamConsoleV1 { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpSeamConsoleV1(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamConsoleV1 { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpSeamConsoleV1(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() - } - - get lynxMigration(): SeamHttpSeamConsoleV1LynxMigration { - return SeamHttpSeamConsoleV1LynxMigration.fromClient( - this.client, - this.defaults, - ) - } - - get sites(): SeamHttpSeamConsoleV1Sites { - return SeamHttpSeamConsoleV1Sites.fromClient(this.client, this.defaults) - } - - get timelines(): SeamHttpSeamConsoleV1Timelines { - return SeamHttpSeamConsoleV1Timelines.fromClient(this.client, this.defaults) - } - - getResourceLocator( - parameters?: SeamConsoleV1GetResourceLocatorParameters, - options: SeamConsoleV1GetResourceLocatorOptions = {}, - ): SeamConsoleV1GetResourceLocatorRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/console/v1/get_resource_locator', - method: 'GET', - params: parameters, - responseKey: 'resource_locator', - options, - }) - } -} - -export type SeamConsoleV1GetResourceLocatorParameters = - RouteRequestParams<'/seam/console/v1/get_resource_locator'> - -/** - * @deprecated Use SeamConsoleV1GetResourceLocatorParameters instead. - */ -export type SeamConsoleV1GetResourceLocatorParams = - SeamConsoleV1GetResourceLocatorParameters - -/** - * @deprecated Use SeamConsoleV1GetResourceLocatorRequest instead. - */ -export type SeamConsoleV1GetResourceLocatorResponse = - RouteResponse<'/seam/console/v1/get_resource_locator'> - -export type SeamConsoleV1GetResourceLocatorRequest = SeamHttpRequest< - SeamConsoleV1GetResourceLocatorResponse, - 'resource_locator' -> - -export interface SeamConsoleV1GetResourceLocatorOptions {} diff --git a/src/lib/seam/connect/routes/seam/console/v1/workspace/feature-flags/feature-flags.ts b/src/lib/seam/connect/routes/seam/console/v1/workspace/feature-flags/feature-flags.ts deleted file mode 100644 index 984033c2..00000000 --- a/src/lib/seam/connect/routes/seam/console/v1/workspace/feature-flags/feature-flags.ts +++ /dev/null @@ -1,256 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -import type { - RouteRequestBody, - RouteRequestParams, - 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' - -export class SeamHttpSeamConsoleV1WorkspaceFeatureFlags { - 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 = {}, - ): SeamHttpSeamConsoleV1WorkspaceFeatureFlags { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpSeamConsoleV1WorkspaceFeatureFlags(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpSeamConsoleV1WorkspaceFeatureFlags { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpSeamConsoleV1WorkspaceFeatureFlags(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpSeamConsoleV1WorkspaceFeatureFlags { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpSeamConsoleV1WorkspaceFeatureFlags(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 SeamHttpSeamConsoleV1WorkspaceFeatureFlags.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpSeamConsoleV1WorkspaceFeatureFlags.fromClientSessionToken( - token, - options, - ) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamConsoleV1WorkspaceFeatureFlags { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpSeamConsoleV1WorkspaceFeatureFlags(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamConsoleV1WorkspaceFeatureFlags { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpSeamConsoleV1WorkspaceFeatureFlags(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?: SeamConsoleV1WorkspaceFeatureFlagsListParameters, - options: SeamConsoleV1WorkspaceFeatureFlagsListOptions = {}, - ): SeamConsoleV1WorkspaceFeatureFlagsListRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/console/v1/workspace/feature_flags/list', - method: 'GET', - params: parameters, - responseKey: 'feature_flags', - options, - }) - } - - update( - parameters: SeamConsoleV1WorkspaceFeatureFlagsUpdateParameters, - options: SeamConsoleV1WorkspaceFeatureFlagsUpdateOptions = {}, - ): SeamConsoleV1WorkspaceFeatureFlagsUpdateRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/console/v1/workspace/feature_flags/update', - method: 'POST', - body: parameters, - responseKey: 'feature_flag', - options, - }) - } -} - -export type SeamConsoleV1WorkspaceFeatureFlagsListParameters = - RouteRequestParams<'/seam/console/v1/workspace/feature_flags/list'> - -/** - * @deprecated Use SeamConsoleV1WorkspaceFeatureFlagsListParameters instead. - */ -export type SeamConsoleV1WorkspaceFeatureFlagsListParams = - SeamConsoleV1WorkspaceFeatureFlagsListParameters - -/** - * @deprecated Use SeamConsoleV1WorkspaceFeatureFlagsListRequest instead. - */ -export type SeamConsoleV1WorkspaceFeatureFlagsListResponse = - RouteResponse<'/seam/console/v1/workspace/feature_flags/list'> - -export type SeamConsoleV1WorkspaceFeatureFlagsListRequest = SeamHttpRequest< - SeamConsoleV1WorkspaceFeatureFlagsListResponse, - 'feature_flags' -> - -export interface SeamConsoleV1WorkspaceFeatureFlagsListOptions {} - -export type SeamConsoleV1WorkspaceFeatureFlagsUpdateParameters = - RouteRequestBody<'/seam/console/v1/workspace/feature_flags/update'> - -/** - * @deprecated Use SeamConsoleV1WorkspaceFeatureFlagsUpdateParameters instead. - */ -export type SeamConsoleV1WorkspaceFeatureFlagsUpdateBody = - SeamConsoleV1WorkspaceFeatureFlagsUpdateParameters - -/** - * @deprecated Use SeamConsoleV1WorkspaceFeatureFlagsUpdateRequest instead. - */ -export type SeamConsoleV1WorkspaceFeatureFlagsUpdateResponse = - RouteResponse<'/seam/console/v1/workspace/feature_flags/update'> - -export type SeamConsoleV1WorkspaceFeatureFlagsUpdateRequest = SeamHttpRequest< - SeamConsoleV1WorkspaceFeatureFlagsUpdateResponse, - 'feature_flag' -> - -export interface SeamConsoleV1WorkspaceFeatureFlagsUpdateOptions {} diff --git a/src/lib/seam/connect/routes/seam/console/v1/workspace/feature-flags/index.ts b/src/lib/seam/connect/routes/seam/console/v1/workspace/feature-flags/index.ts deleted file mode 100644 index 3ac63360..00000000 --- a/src/lib/seam/connect/routes/seam/console/v1/workspace/feature-flags/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './feature-flags.js' diff --git a/src/lib/seam/connect/routes/seam/console/v1/workspace/index.ts b/src/lib/seam/connect/routes/seam/console/v1/workspace/index.ts deleted file mode 100644 index 3a97c552..00000000 --- a/src/lib/seam/connect/routes/seam/console/v1/workspace/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './feature-flags/index.js' diff --git a/src/lib/seam/connect/routes/seam/customer/index.ts b/src/lib/seam/connect/routes/seam/customer/index.ts deleted file mode 100644 index 2e9499e7..00000000 --- a/src/lib/seam/connect/routes/seam/customer/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './v1/index.js' diff --git a/src/lib/seam/connect/routes/seam/customer/v1/access-grants/access-grants.ts b/src/lib/seam/connect/routes/seam/customer/v1/access-grants/access-grants.ts deleted file mode 100644 index a6899c38..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/access-grants/access-grants.ts +++ /dev/null @@ -1,252 +0,0 @@ -/* - * 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' - -export class SeamHttpSeamCustomerV1AccessGrants { - 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 = {}, - ): SeamHttpSeamCustomerV1AccessGrants { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpSeamCustomerV1AccessGrants(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpSeamCustomerV1AccessGrants { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpSeamCustomerV1AccessGrants(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpSeamCustomerV1AccessGrants { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpSeamCustomerV1AccessGrants(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 SeamHttpSeamCustomerV1AccessGrants.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpSeamCustomerV1AccessGrants.fromClientSessionToken( - token, - options, - ) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamCustomerV1AccessGrants { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpSeamCustomerV1AccessGrants(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamCustomerV1AccessGrants { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpSeamCustomerV1AccessGrants(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?: SeamCustomerV1AccessGrantsListParameters, - options: SeamCustomerV1AccessGrantsListOptions = {}, - ): SeamCustomerV1AccessGrantsListRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/access_grants/list', - method: 'POST', - body: parameters, - responseKey: 'access_grants', - options, - }) - } - - update( - parameters: SeamCustomerV1AccessGrantsUpdateParameters, - options: SeamCustomerV1AccessGrantsUpdateOptions = {}, - ): SeamCustomerV1AccessGrantsUpdateRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/access_grants/update', - method: 'PATCH', - body: parameters, - responseKey: undefined, - options, - }) - } -} - -export type SeamCustomerV1AccessGrantsListParameters = - RouteRequestBody<'/seam/customer/v1/access_grants/list'> - -/** - * @deprecated Use SeamCustomerV1AccessGrantsListParameters instead. - */ -export type SeamCustomerV1AccessGrantsListParams = - SeamCustomerV1AccessGrantsListParameters - -/** - * @deprecated Use SeamCustomerV1AccessGrantsListRequest instead. - */ -export type SeamCustomerV1AccessGrantsListResponse = - RouteResponse<'/seam/customer/v1/access_grants/list'> - -export type SeamCustomerV1AccessGrantsListRequest = SeamHttpRequest< - SeamCustomerV1AccessGrantsListResponse, - 'access_grants' -> - -export interface SeamCustomerV1AccessGrantsListOptions {} - -export type SeamCustomerV1AccessGrantsUpdateParameters = - RouteRequestBody<'/seam/customer/v1/access_grants/update'> - -/** - * @deprecated Use SeamCustomerV1AccessGrantsUpdateParameters instead. - */ -export type SeamCustomerV1AccessGrantsUpdateBody = - SeamCustomerV1AccessGrantsUpdateParameters - -/** - * @deprecated Use SeamCustomerV1AccessGrantsUpdateRequest instead. - */ -export type SeamCustomerV1AccessGrantsUpdateResponse = - RouteResponse<'/seam/customer/v1/access_grants/update'> - -export type SeamCustomerV1AccessGrantsUpdateRequest = SeamHttpRequest< - void, - undefined -> - -export interface SeamCustomerV1AccessGrantsUpdateOptions {} diff --git a/src/lib/seam/connect/routes/seam/customer/v1/access-grants/index.ts b/src/lib/seam/connect/routes/seam/customer/v1/access-grants/index.ts deleted file mode 100644 index afe09729..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/access-grants/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './access-grants.js' diff --git a/src/lib/seam/connect/routes/seam/customer/v1/access-methods/access-methods.ts b/src/lib/seam/connect/routes/seam/customer/v1/access-methods/access-methods.ts deleted file mode 100644 index 8c8f1fa7..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/access-methods/access-methods.ts +++ /dev/null @@ -1,215 +0,0 @@ -/* - * 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' - -export class SeamHttpSeamCustomerV1AccessMethods { - 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 = {}, - ): SeamHttpSeamCustomerV1AccessMethods { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpSeamCustomerV1AccessMethods(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpSeamCustomerV1AccessMethods { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpSeamCustomerV1AccessMethods(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpSeamCustomerV1AccessMethods { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpSeamCustomerV1AccessMethods(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 SeamHttpSeamCustomerV1AccessMethods.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpSeamCustomerV1AccessMethods.fromClientSessionToken( - token, - options, - ) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamCustomerV1AccessMethods { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpSeamCustomerV1AccessMethods(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamCustomerV1AccessMethods { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpSeamCustomerV1AccessMethods(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() - } - - encode( - parameters: SeamCustomerV1AccessMethodsEncodeParameters, - options: SeamCustomerV1AccessMethodsEncodeOptions = {}, - ): SeamCustomerV1AccessMethodsEncodeRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/access_methods/encode', - method: 'POST', - body: parameters, - responseKey: 'action_attempt', - options, - }) - } -} - -export type SeamCustomerV1AccessMethodsEncodeParameters = - RouteRequestBody<'/seam/customer/v1/access_methods/encode'> - -/** - * @deprecated Use SeamCustomerV1AccessMethodsEncodeParameters instead. - */ -export type SeamCustomerV1AccessMethodsEncodeBody = - SeamCustomerV1AccessMethodsEncodeParameters - -/** - * @deprecated Use SeamCustomerV1AccessMethodsEncodeRequest instead. - */ -export type SeamCustomerV1AccessMethodsEncodeResponse = - RouteResponse<'/seam/customer/v1/access_methods/encode'> - -export type SeamCustomerV1AccessMethodsEncodeRequest = SeamHttpRequest< - SeamCustomerV1AccessMethodsEncodeResponse, - 'action_attempt' -> - -export type SeamCustomerV1AccessMethodsEncodeOptions = Pick< - SeamHttpRequestOptions, - 'waitForActionAttempt' -> diff --git a/src/lib/seam/connect/routes/seam/customer/v1/access-methods/index.ts b/src/lib/seam/connect/routes/seam/customer/v1/access-methods/index.ts deleted file mode 100644 index f339d498..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/access-methods/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './access-methods.js' diff --git a/src/lib/seam/connect/routes/seam/customer/v1/automation-runs/automation-runs.ts b/src/lib/seam/connect/routes/seam/customer/v1/automation-runs/automation-runs.ts deleted file mode 100644 index 6d972cc4..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/automation-runs/automation-runs.ts +++ /dev/null @@ -1,212 +0,0 @@ -/* - * 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' - -export class SeamHttpSeamCustomerV1AutomationRuns { - 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 = {}, - ): SeamHttpSeamCustomerV1AutomationRuns { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpSeamCustomerV1AutomationRuns(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpSeamCustomerV1AutomationRuns { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpSeamCustomerV1AutomationRuns(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpSeamCustomerV1AutomationRuns { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpSeamCustomerV1AutomationRuns(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 SeamHttpSeamCustomerV1AutomationRuns.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpSeamCustomerV1AutomationRuns.fromClientSessionToken( - token, - options, - ) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamCustomerV1AutomationRuns { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpSeamCustomerV1AutomationRuns(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamCustomerV1AutomationRuns { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpSeamCustomerV1AutomationRuns(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?: SeamCustomerV1AutomationRunsListParameters, - options: SeamCustomerV1AutomationRunsListOptions = {}, - ): SeamCustomerV1AutomationRunsListRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/automation_runs/list', - method: 'POST', - body: parameters, - responseKey: 'automation_runs', - options, - }) - } -} - -export type SeamCustomerV1AutomationRunsListParameters = - RouteRequestBody<'/seam/customer/v1/automation_runs/list'> - -/** - * @deprecated Use SeamCustomerV1AutomationRunsListParameters instead. - */ -export type SeamCustomerV1AutomationRunsListParams = - SeamCustomerV1AutomationRunsListParameters - -/** - * @deprecated Use SeamCustomerV1AutomationRunsListRequest instead. - */ -export type SeamCustomerV1AutomationRunsListResponse = - RouteResponse<'/seam/customer/v1/automation_runs/list'> - -export type SeamCustomerV1AutomationRunsListRequest = SeamHttpRequest< - SeamCustomerV1AutomationRunsListResponse, - 'automation_runs' -> - -export interface SeamCustomerV1AutomationRunsListOptions {} diff --git a/src/lib/seam/connect/routes/seam/customer/v1/automation-runs/index.ts b/src/lib/seam/connect/routes/seam/customer/v1/automation-runs/index.ts deleted file mode 100644 index e2ea2ec6..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/automation-runs/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './automation-runs.js' diff --git a/src/lib/seam/connect/routes/seam/customer/v1/automations/automations.ts b/src/lib/seam/connect/routes/seam/customer/v1/automations/automations.ts deleted file mode 100644 index 09c54902..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/automations/automations.ts +++ /dev/null @@ -1,292 +0,0 @@ -/* - * 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' - -export class SeamHttpSeamCustomerV1Automations { - 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 = {}, - ): SeamHttpSeamCustomerV1Automations { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpSeamCustomerV1Automations(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpSeamCustomerV1Automations { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpSeamCustomerV1Automations(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpSeamCustomerV1Automations { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpSeamCustomerV1Automations(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 SeamHttpSeamCustomerV1Automations.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpSeamCustomerV1Automations.fromClientSessionToken( - token, - options, - ) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamCustomerV1Automations { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpSeamCustomerV1Automations(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamCustomerV1Automations { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpSeamCustomerV1Automations(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() - } - - delete( - parameters?: SeamCustomerV1AutomationsDeleteParameters, - options: SeamCustomerV1AutomationsDeleteOptions = {}, - ): SeamCustomerV1AutomationsDeleteRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/automations/delete', - method: 'POST', - body: parameters, - responseKey: undefined, - options, - }) - } - - get( - parameters?: SeamCustomerV1AutomationsGetParameters, - options: SeamCustomerV1AutomationsGetOptions = {}, - ): SeamCustomerV1AutomationsGetRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/automations/get', - method: 'POST', - body: parameters, - responseKey: undefined, - options, - }) - } - - update( - parameters?: SeamCustomerV1AutomationsUpdateParameters, - options: SeamCustomerV1AutomationsUpdateOptions = {}, - ): SeamCustomerV1AutomationsUpdateRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/automations/update', - method: 'PATCH', - body: parameters, - responseKey: undefined, - options, - }) - } -} - -export type SeamCustomerV1AutomationsDeleteParameters = - RouteRequestBody<'/seam/customer/v1/automations/delete'> - -/** - * @deprecated Use SeamCustomerV1AutomationsDeleteParameters instead. - */ -export type SeamCustomerV1AutomationsDeleteParams = - SeamCustomerV1AutomationsDeleteParameters - -/** - * @deprecated Use SeamCustomerV1AutomationsDeleteRequest instead. - */ -export type SeamCustomerV1AutomationsDeleteResponse = - RouteResponse<'/seam/customer/v1/automations/delete'> - -export type SeamCustomerV1AutomationsDeleteRequest = SeamHttpRequest< - void, - undefined -> - -export interface SeamCustomerV1AutomationsDeleteOptions {} - -export type SeamCustomerV1AutomationsGetParameters = - RouteRequestBody<'/seam/customer/v1/automations/get'> - -/** - * @deprecated Use SeamCustomerV1AutomationsGetParameters instead. - */ -export type SeamCustomerV1AutomationsGetParams = - SeamCustomerV1AutomationsGetParameters - -/** - * @deprecated Use SeamCustomerV1AutomationsGetRequest instead. - */ -export type SeamCustomerV1AutomationsGetResponse = - RouteResponse<'/seam/customer/v1/automations/get'> - -export type SeamCustomerV1AutomationsGetRequest = SeamHttpRequest< - void, - undefined -> - -export interface SeamCustomerV1AutomationsGetOptions {} - -export type SeamCustomerV1AutomationsUpdateParameters = - RouteRequestBody<'/seam/customer/v1/automations/update'> - -/** - * @deprecated Use SeamCustomerV1AutomationsUpdateParameters instead. - */ -export type SeamCustomerV1AutomationsUpdateBody = - SeamCustomerV1AutomationsUpdateParameters - -/** - * @deprecated Use SeamCustomerV1AutomationsUpdateRequest instead. - */ -export type SeamCustomerV1AutomationsUpdateResponse = - RouteResponse<'/seam/customer/v1/automations/update'> - -export type SeamCustomerV1AutomationsUpdateRequest = SeamHttpRequest< - void, - undefined -> - -export interface SeamCustomerV1AutomationsUpdateOptions {} diff --git a/src/lib/seam/connect/routes/seam/customer/v1/automations/index.ts b/src/lib/seam/connect/routes/seam/customer/v1/automations/index.ts deleted file mode 100644 index 49fd0137..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/automations/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './automations.js' 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 deleted file mode 100644 index 69ea88be..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/connector-customers/connector-customers.ts +++ /dev/null @@ -1,212 +0,0 @@ -/* - * 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' - -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 = - RouteResponse<'/seam/customer/v1/connector_customers/list'> - -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 deleted file mode 100644 index 2ad2130e..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/connector-customers/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * 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/connectors/connectors.ts b/src/lib/seam/connect/routes/seam/customer/v1/connectors/connectors.ts deleted file mode 100644 index a63d361e..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/connectors/connectors.ts +++ /dev/null @@ -1,473 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -import type { - RouteRequestBody, - RouteRequestParams, - 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 { SeamHttpSeamCustomerV1ConnectorsExternalSites } from './external-sites/index.js' -import { SeamHttpSeamCustomerV1ConnectorsIcal } from './ical/index.js' - -export class SeamHttpSeamCustomerV1Connectors { - 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 = {}, - ): 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() - } - - get externalSites(): SeamHttpSeamCustomerV1ConnectorsExternalSites { - return SeamHttpSeamCustomerV1ConnectorsExternalSites.fromClient( - this.client, - this.defaults, - ) - } - - get ical(): SeamHttpSeamCustomerV1ConnectorsIcal { - return SeamHttpSeamCustomerV1ConnectorsIcal.fromClient( - this.client, - this.defaults, - ) - } - - authorize( - parameters: SeamCustomerV1ConnectorsAuthorizeParameters, - options: SeamCustomerV1ConnectorsAuthorizeOptions = {}, - ): SeamCustomerV1ConnectorsAuthorizeRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/connectors/authorize', - method: 'POST', - body: parameters, - responseKey: 'connector_authorize', - options, - }) - } - - connectorTypes( - parameters?: SeamCustomerV1ConnectorsConnectorTypesParameters, - options: SeamCustomerV1ConnectorsConnectorTypesOptions = {}, - ): SeamCustomerV1ConnectorsConnectorTypesRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/connectors/connector_types', - method: 'GET', - params: parameters, - responseKey: 'connector_types', - options, - }) - } - - create( - parameters: SeamCustomerV1ConnectorsCreateParameters, - options: SeamCustomerV1ConnectorsCreateOptions = {}, - ): SeamCustomerV1ConnectorsCreateRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/connectors/create', - method: 'POST', - body: parameters, - responseKey: 'connector', - options, - }) - } - - delete( - parameters: SeamCustomerV1ConnectorsDeleteParameters, - options: SeamCustomerV1ConnectorsDeleteOptions = {}, - ): SeamCustomerV1ConnectorsDeleteRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/connectors/delete', - method: 'POST', - body: parameters, - responseKey: 'connector', - options, - }) - } - - list( - parameters?: SeamCustomerV1ConnectorsListParameters, - options: SeamCustomerV1ConnectorsListOptions = {}, - ): SeamCustomerV1ConnectorsListRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/connectors/list', - method: 'GET', - params: parameters, - responseKey: 'connectors', - options, - }) - } - - sync( - parameters: SeamCustomerV1ConnectorsSyncParameters, - options: SeamCustomerV1ConnectorsSyncOptions = {}, - ): SeamCustomerV1ConnectorsSyncRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/connectors/sync', - method: 'POST', - body: parameters, - responseKey: 'connector_sync', - options, - }) - } - - update( - parameters: SeamCustomerV1ConnectorsUpdateParameters, - options: SeamCustomerV1ConnectorsUpdateOptions = {}, - ): SeamCustomerV1ConnectorsUpdateRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/connectors/update', - method: 'POST', - body: parameters, - responseKey: 'connector', - options, - }) - } -} - -export type SeamCustomerV1ConnectorsAuthorizeParameters = - RouteRequestBody<'/seam/customer/v1/connectors/authorize'> - -/** - * @deprecated Use SeamCustomerV1ConnectorsAuthorizeParameters instead. - */ -export type SeamCustomerV1ConnectorsAuthorizeParams = - SeamCustomerV1ConnectorsAuthorizeParameters - -/** - * @deprecated Use SeamCustomerV1ConnectorsAuthorizeRequest instead. - */ -export type SeamCustomerV1ConnectorsAuthorizeResponse = - RouteResponse<'/seam/customer/v1/connectors/authorize'> - -export type SeamCustomerV1ConnectorsAuthorizeRequest = SeamHttpRequest< - SeamCustomerV1ConnectorsAuthorizeResponse, - 'connector_authorize' -> - -export interface SeamCustomerV1ConnectorsAuthorizeOptions {} - -export type SeamCustomerV1ConnectorsConnectorTypesParameters = - RouteRequestParams<'/seam/customer/v1/connectors/connector_types'> - -/** - * @deprecated Use SeamCustomerV1ConnectorsConnectorTypesParameters instead. - */ -export type SeamCustomerV1ConnectorsConnectorTypesParams = - SeamCustomerV1ConnectorsConnectorTypesParameters - -/** - * @deprecated Use SeamCustomerV1ConnectorsConnectorTypesRequest instead. - */ -export type SeamCustomerV1ConnectorsConnectorTypesResponse = - RouteResponse<'/seam/customer/v1/connectors/connector_types'> - -export type SeamCustomerV1ConnectorsConnectorTypesRequest = SeamHttpRequest< - SeamCustomerV1ConnectorsConnectorTypesResponse, - 'connector_types' -> - -export interface SeamCustomerV1ConnectorsConnectorTypesOptions {} - -export type SeamCustomerV1ConnectorsCreateParameters = - RouteRequestBody<'/seam/customer/v1/connectors/create'> - -/** - * @deprecated Use SeamCustomerV1ConnectorsCreateParameters instead. - */ -export type SeamCustomerV1ConnectorsCreateBody = - SeamCustomerV1ConnectorsCreateParameters - -/** - * @deprecated Use SeamCustomerV1ConnectorsCreateRequest instead. - */ -export type SeamCustomerV1ConnectorsCreateResponse = - RouteResponse<'/seam/customer/v1/connectors/create'> - -export type SeamCustomerV1ConnectorsCreateRequest = SeamHttpRequest< - SeamCustomerV1ConnectorsCreateResponse, - 'connector' -> - -export interface SeamCustomerV1ConnectorsCreateOptions {} - -export type SeamCustomerV1ConnectorsDeleteParameters = - RouteRequestBody<'/seam/customer/v1/connectors/delete'> - -/** - * @deprecated Use SeamCustomerV1ConnectorsDeleteParameters instead. - */ -export type SeamCustomerV1ConnectorsDeleteBody = - SeamCustomerV1ConnectorsDeleteParameters - -/** - * @deprecated Use SeamCustomerV1ConnectorsDeleteRequest instead. - */ -export type SeamCustomerV1ConnectorsDeleteResponse = - RouteResponse<'/seam/customer/v1/connectors/delete'> - -export type SeamCustomerV1ConnectorsDeleteRequest = SeamHttpRequest< - SeamCustomerV1ConnectorsDeleteResponse, - 'connector' -> - -export interface SeamCustomerV1ConnectorsDeleteOptions {} - -export type SeamCustomerV1ConnectorsListParameters = - RouteRequestParams<'/seam/customer/v1/connectors/list'> - -/** - * @deprecated Use SeamCustomerV1ConnectorsListParameters instead. - */ -export type SeamCustomerV1ConnectorsListParams = - SeamCustomerV1ConnectorsListParameters - -/** - * @deprecated Use SeamCustomerV1ConnectorsListRequest instead. - */ -export type SeamCustomerV1ConnectorsListResponse = - RouteResponse<'/seam/customer/v1/connectors/list'> - -export type SeamCustomerV1ConnectorsListRequest = SeamHttpRequest< - SeamCustomerV1ConnectorsListResponse, - 'connectors' -> - -export interface SeamCustomerV1ConnectorsListOptions {} - -export type SeamCustomerV1ConnectorsSyncParameters = - RouteRequestBody<'/seam/customer/v1/connectors/sync'> - -/** - * @deprecated Use SeamCustomerV1ConnectorsSyncParameters instead. - */ -export type SeamCustomerV1ConnectorsSyncBody = - SeamCustomerV1ConnectorsSyncParameters - -/** - * @deprecated Use SeamCustomerV1ConnectorsSyncRequest instead. - */ -export type SeamCustomerV1ConnectorsSyncResponse = - RouteResponse<'/seam/customer/v1/connectors/sync'> - -export type SeamCustomerV1ConnectorsSyncRequest = SeamHttpRequest< - SeamCustomerV1ConnectorsSyncResponse, - 'connector_sync' -> - -export interface SeamCustomerV1ConnectorsSyncOptions {} - -export type SeamCustomerV1ConnectorsUpdateParameters = - RouteRequestBody<'/seam/customer/v1/connectors/update'> - -/** - * @deprecated Use SeamCustomerV1ConnectorsUpdateParameters instead. - */ -export type SeamCustomerV1ConnectorsUpdateBody = - SeamCustomerV1ConnectorsUpdateParameters - -/** - * @deprecated Use SeamCustomerV1ConnectorsUpdateRequest instead. - */ -export type SeamCustomerV1ConnectorsUpdateResponse = - RouteResponse<'/seam/customer/v1/connectors/update'> - -export type SeamCustomerV1ConnectorsUpdateRequest = SeamHttpRequest< - SeamCustomerV1ConnectorsUpdateResponse, - 'connector' -> - -export interface SeamCustomerV1ConnectorsUpdateOptions {} diff --git a/src/lib/seam/connect/routes/seam/customer/v1/connectors/external-sites/external-sites.ts b/src/lib/seam/connect/routes/seam/customer/v1/connectors/external-sites/external-sites.ts deleted file mode 100644 index 810b2ba0..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/connectors/external-sites/external-sites.ts +++ /dev/null @@ -1,212 +0,0 @@ -/* - * 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' - -export class SeamHttpSeamCustomerV1ConnectorsExternalSites { - 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 = {}, - ): SeamHttpSeamCustomerV1ConnectorsExternalSites { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpSeamCustomerV1ConnectorsExternalSites(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpSeamCustomerV1ConnectorsExternalSites { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpSeamCustomerV1ConnectorsExternalSites(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpSeamCustomerV1ConnectorsExternalSites { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpSeamCustomerV1ConnectorsExternalSites(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 SeamHttpSeamCustomerV1ConnectorsExternalSites.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpSeamCustomerV1ConnectorsExternalSites.fromClientSessionToken( - token, - options, - ) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamCustomerV1ConnectorsExternalSites { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpSeamCustomerV1ConnectorsExternalSites(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamCustomerV1ConnectorsExternalSites { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpSeamCustomerV1ConnectorsExternalSites(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: SeamCustomerV1ConnectorsExternalSitesListParameters, - options: SeamCustomerV1ConnectorsExternalSitesListOptions = {}, - ): SeamCustomerV1ConnectorsExternalSitesListRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/connectors/external_sites/list', - method: 'POST', - body: parameters, - responseKey: 'external_sites', - options, - }) - } -} - -export type SeamCustomerV1ConnectorsExternalSitesListParameters = - RouteRequestBody<'/seam/customer/v1/connectors/external_sites/list'> - -/** - * @deprecated Use SeamCustomerV1ConnectorsExternalSitesListParameters instead. - */ -export type SeamCustomerV1ConnectorsExternalSitesListParams = - SeamCustomerV1ConnectorsExternalSitesListParameters - -/** - * @deprecated Use SeamCustomerV1ConnectorsExternalSitesListRequest instead. - */ -export type SeamCustomerV1ConnectorsExternalSitesListResponse = - RouteResponse<'/seam/customer/v1/connectors/external_sites/list'> - -export type SeamCustomerV1ConnectorsExternalSitesListRequest = SeamHttpRequest< - SeamCustomerV1ConnectorsExternalSitesListResponse, - 'external_sites' -> - -export interface SeamCustomerV1ConnectorsExternalSitesListOptions {} diff --git a/src/lib/seam/connect/routes/seam/customer/v1/connectors/external-sites/index.ts b/src/lib/seam/connect/routes/seam/customer/v1/connectors/external-sites/index.ts deleted file mode 100644 index 82756159..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/connectors/external-sites/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './external-sites.js' diff --git a/src/lib/seam/connect/routes/seam/customer/v1/connectors/ical/ical.ts b/src/lib/seam/connect/routes/seam/customer/v1/connectors/ical/ical.ts deleted file mode 100644 index a4462353..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/connectors/ical/ical.ts +++ /dev/null @@ -1,212 +0,0 @@ -/* - * 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' - -export class SeamHttpSeamCustomerV1ConnectorsIcal { - 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 = {}, - ): SeamHttpSeamCustomerV1ConnectorsIcal { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpSeamCustomerV1ConnectorsIcal(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpSeamCustomerV1ConnectorsIcal { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpSeamCustomerV1ConnectorsIcal(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpSeamCustomerV1ConnectorsIcal { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpSeamCustomerV1ConnectorsIcal(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 SeamHttpSeamCustomerV1ConnectorsIcal.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpSeamCustomerV1ConnectorsIcal.fromClientSessionToken( - token, - options, - ) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamCustomerV1ConnectorsIcal { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpSeamCustomerV1ConnectorsIcal(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamCustomerV1ConnectorsIcal { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpSeamCustomerV1ConnectorsIcal(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() - } - - validateConfig( - parameters: SeamCustomerV1ConnectorsIcalValidateConfigParameters, - options: SeamCustomerV1ConnectorsIcalValidateConfigOptions = {}, - ): SeamCustomerV1ConnectorsIcalValidateConfigRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/connectors/ical/validate-config', - method: 'POST', - body: parameters, - responseKey: 'validation_result', - options, - }) - } -} - -export type SeamCustomerV1ConnectorsIcalValidateConfigParameters = - RouteRequestBody<'/seam/customer/v1/connectors/ical/validate-config'> - -/** - * @deprecated Use SeamCustomerV1ConnectorsIcalValidateConfigParameters instead. - */ -export type SeamCustomerV1ConnectorsIcalValidateConfigBody = - SeamCustomerV1ConnectorsIcalValidateConfigParameters - -/** - * @deprecated Use SeamCustomerV1ConnectorsIcalValidateConfigRequest instead. - */ -export type SeamCustomerV1ConnectorsIcalValidateConfigResponse = - RouteResponse<'/seam/customer/v1/connectors/ical/validate-config'> - -export type SeamCustomerV1ConnectorsIcalValidateConfigRequest = SeamHttpRequest< - SeamCustomerV1ConnectorsIcalValidateConfigResponse, - 'validation_result' -> - -export interface SeamCustomerV1ConnectorsIcalValidateConfigOptions {} diff --git a/src/lib/seam/connect/routes/seam/customer/v1/connectors/ical/index.ts b/src/lib/seam/connect/routes/seam/customer/v1/connectors/ical/index.ts deleted file mode 100644 index 1d8f8cd6..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/connectors/ical/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './ical.js' 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 deleted file mode 100644 index 5c96db36..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/connectors/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './connectors.js' -export * from './external-sites/index.js' -export * from './ical/index.js' diff --git a/src/lib/seam/connect/routes/seam/customer/v1/customers/automations/automations.ts b/src/lib/seam/connect/routes/seam/customer/v1/customers/automations/automations.ts deleted file mode 100644 index f41e91a7..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/customers/automations/automations.ts +++ /dev/null @@ -1,256 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -import type { - RouteRequestBody, - RouteRequestParams, - 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' - -export class SeamHttpSeamCustomerV1CustomersAutomations { - 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 = {}, - ): SeamHttpSeamCustomerV1CustomersAutomations { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpSeamCustomerV1CustomersAutomations(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpSeamCustomerV1CustomersAutomations { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpSeamCustomerV1CustomersAutomations(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpSeamCustomerV1CustomersAutomations { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpSeamCustomerV1CustomersAutomations(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 SeamHttpSeamCustomerV1CustomersAutomations.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpSeamCustomerV1CustomersAutomations.fromClientSessionToken( - token, - options, - ) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamCustomerV1CustomersAutomations { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpSeamCustomerV1CustomersAutomations(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamCustomerV1CustomersAutomations { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpSeamCustomerV1CustomersAutomations(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() - } - - get( - parameters?: SeamCustomerV1CustomersAutomationsGetParameters, - options: SeamCustomerV1CustomersAutomationsGetOptions = {}, - ): SeamCustomerV1CustomersAutomationsGetRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/customers/automations/get', - method: 'GET', - params: parameters, - responseKey: 'automation', - options, - }) - } - - update( - parameters?: SeamCustomerV1CustomersAutomationsUpdateParameters, - options: SeamCustomerV1CustomersAutomationsUpdateOptions = {}, - ): SeamCustomerV1CustomersAutomationsUpdateRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/customers/automations/update', - method: 'PATCH', - body: parameters, - responseKey: undefined, - options, - }) - } -} - -export type SeamCustomerV1CustomersAutomationsGetParameters = - RouteRequestParams<'/seam/customer/v1/customers/automations/get'> - -/** - * @deprecated Use SeamCustomerV1CustomersAutomationsGetParameters instead. - */ -export type SeamCustomerV1CustomersAutomationsGetParams = - SeamCustomerV1CustomersAutomationsGetParameters - -/** - * @deprecated Use SeamCustomerV1CustomersAutomationsGetRequest instead. - */ -export type SeamCustomerV1CustomersAutomationsGetResponse = - RouteResponse<'/seam/customer/v1/customers/automations/get'> - -export type SeamCustomerV1CustomersAutomationsGetRequest = SeamHttpRequest< - SeamCustomerV1CustomersAutomationsGetResponse, - 'automation' -> - -export interface SeamCustomerV1CustomersAutomationsGetOptions {} - -export type SeamCustomerV1CustomersAutomationsUpdateParameters = - RouteRequestBody<'/seam/customer/v1/customers/automations/update'> - -/** - * @deprecated Use SeamCustomerV1CustomersAutomationsUpdateParameters instead. - */ -export type SeamCustomerV1CustomersAutomationsUpdateBody = - SeamCustomerV1CustomersAutomationsUpdateParameters - -/** - * @deprecated Use SeamCustomerV1CustomersAutomationsUpdateRequest instead. - */ -export type SeamCustomerV1CustomersAutomationsUpdateResponse = - RouteResponse<'/seam/customer/v1/customers/automations/update'> - -export type SeamCustomerV1CustomersAutomationsUpdateRequest = SeamHttpRequest< - void, - undefined -> - -export interface SeamCustomerV1CustomersAutomationsUpdateOptions {} diff --git a/src/lib/seam/connect/routes/seam/customer/v1/customers/automations/index.ts b/src/lib/seam/connect/routes/seam/customer/v1/customers/automations/index.ts deleted file mode 100644 index 49fd0137..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/customers/automations/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './automations.js' diff --git a/src/lib/seam/connect/routes/seam/customer/v1/customers/customers.ts b/src/lib/seam/connect/routes/seam/customer/v1/customers/customers.ts deleted file mode 100644 index 891ad219..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/customers/customers.ts +++ /dev/null @@ -1,302 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -import type { - RouteRequestBody, - RouteRequestParams, - 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 { SeamHttpSeamCustomerV1CustomersAutomations } from './automations/index.js' - -export class SeamHttpSeamCustomerV1Customers { - 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 = {}, - ): SeamHttpSeamCustomerV1Customers { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpSeamCustomerV1Customers(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpSeamCustomerV1Customers { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpSeamCustomerV1Customers(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpSeamCustomerV1Customers { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpSeamCustomerV1Customers(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 SeamHttpSeamCustomerV1Customers.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpSeamCustomerV1Customers.fromClientSessionToken( - token, - options, - ) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamCustomerV1Customers { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpSeamCustomerV1Customers(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamCustomerV1Customers { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpSeamCustomerV1Customers(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() - } - - get automations(): SeamHttpSeamCustomerV1CustomersAutomations { - return SeamHttpSeamCustomerV1CustomersAutomations.fromClient( - this.client, - this.defaults, - ) - } - - list( - parameters?: SeamCustomerV1CustomersListParameters, - options: SeamCustomerV1CustomersListOptions = {}, - ): SeamCustomerV1CustomersListRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/customers/list', - method: 'POST', - body: parameters, - responseKey: 'customers', - options, - }) - } - - me( - parameters?: SeamCustomerV1CustomersMeParameters, - options: SeamCustomerV1CustomersMeOptions = {}, - ): SeamCustomerV1CustomersMeRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/customers/me', - method: 'GET', - params: parameters, - responseKey: undefined, - options, - }) - } - - openPortal( - parameters: SeamCustomerV1CustomersOpenPortalParameters, - options: SeamCustomerV1CustomersOpenPortalOptions = {}, - ): SeamCustomerV1CustomersOpenPortalRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/customers/open_portal', - method: 'POST', - body: parameters, - responseKey: 'magic_link', - options, - }) - } -} - -export type SeamCustomerV1CustomersListParameters = - RouteRequestBody<'/seam/customer/v1/customers/list'> - -/** - * @deprecated Use SeamCustomerV1CustomersListParameters instead. - */ -export type SeamCustomerV1CustomersListParams = - SeamCustomerV1CustomersListParameters - -/** - * @deprecated Use SeamCustomerV1CustomersListRequest instead. - */ -export type SeamCustomerV1CustomersListResponse = - RouteResponse<'/seam/customer/v1/customers/list'> - -export type SeamCustomerV1CustomersListRequest = SeamHttpRequest< - SeamCustomerV1CustomersListResponse, - 'customers' -> - -export interface SeamCustomerV1CustomersListOptions {} - -export type SeamCustomerV1CustomersMeParameters = - RouteRequestParams<'/seam/customer/v1/customers/me'> - -/** - * @deprecated Use SeamCustomerV1CustomersMeParameters instead. - */ -export type SeamCustomerV1CustomersMeParams = - SeamCustomerV1CustomersMeParameters - -/** - * @deprecated Use SeamCustomerV1CustomersMeRequest instead. - */ -export type SeamCustomerV1CustomersMeResponse = - RouteResponse<'/seam/customer/v1/customers/me'> - -export type SeamCustomerV1CustomersMeRequest = SeamHttpRequest - -export interface SeamCustomerV1CustomersMeOptions {} - -export type SeamCustomerV1CustomersOpenPortalParameters = - RouteRequestBody<'/seam/customer/v1/customers/open_portal'> - -/** - * @deprecated Use SeamCustomerV1CustomersOpenPortalParameters instead. - */ -export type SeamCustomerV1CustomersOpenPortalBody = - SeamCustomerV1CustomersOpenPortalParameters - -/** - * @deprecated Use SeamCustomerV1CustomersOpenPortalRequest instead. - */ -export type SeamCustomerV1CustomersOpenPortalResponse = - RouteResponse<'/seam/customer/v1/customers/open_portal'> - -export type SeamCustomerV1CustomersOpenPortalRequest = SeamHttpRequest< - SeamCustomerV1CustomersOpenPortalResponse, - 'magic_link' -> - -export interface SeamCustomerV1CustomersOpenPortalOptions {} diff --git a/src/lib/seam/connect/routes/seam/customer/v1/customers/index.ts b/src/lib/seam/connect/routes/seam/customer/v1/customers/index.ts deleted file mode 100644 index 78de25f4..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/customers/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './automations/index.js' -export * from './customers.js' diff --git a/src/lib/seam/connect/routes/seam/customer/v1/encoders/encoders.ts b/src/lib/seam/connect/routes/seam/customer/v1/encoders/encoders.ts deleted file mode 100644 index dac83679..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/encoders/encoders.ts +++ /dev/null @@ -1,209 +0,0 @@ -/* - * 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' - -export class SeamHttpSeamCustomerV1Encoders { - 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 = {}, - ): SeamHttpSeamCustomerV1Encoders { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpSeamCustomerV1Encoders(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpSeamCustomerV1Encoders { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpSeamCustomerV1Encoders(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpSeamCustomerV1Encoders { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpSeamCustomerV1Encoders(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 SeamHttpSeamCustomerV1Encoders.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpSeamCustomerV1Encoders.fromClientSessionToken(token, options) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamCustomerV1Encoders { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpSeamCustomerV1Encoders(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamCustomerV1Encoders { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpSeamCustomerV1Encoders(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?: SeamCustomerV1EncodersListParameters, - options: SeamCustomerV1EncodersListOptions = {}, - ): SeamCustomerV1EncodersListRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/encoders/list', - method: 'POST', - body: parameters, - responseKey: 'encoders', - options, - }) - } -} - -export type SeamCustomerV1EncodersListParameters = - RouteRequestBody<'/seam/customer/v1/encoders/list'> - -/** - * @deprecated Use SeamCustomerV1EncodersListParameters instead. - */ -export type SeamCustomerV1EncodersListParams = - SeamCustomerV1EncodersListParameters - -/** - * @deprecated Use SeamCustomerV1EncodersListRequest instead. - */ -export type SeamCustomerV1EncodersListResponse = - RouteResponse<'/seam/customer/v1/encoders/list'> - -export type SeamCustomerV1EncodersListRequest = SeamHttpRequest< - SeamCustomerV1EncodersListResponse, - 'encoders' -> - -export interface SeamCustomerV1EncodersListOptions {} diff --git a/src/lib/seam/connect/routes/seam/customer/v1/encoders/index.ts b/src/lib/seam/connect/routes/seam/customer/v1/encoders/index.ts deleted file mode 100644 index e4fa625b..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/encoders/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './encoders.js' diff --git a/src/lib/seam/connect/routes/seam/customer/v1/events/events.ts b/src/lib/seam/connect/routes/seam/customer/v1/events/events.ts deleted file mode 100644 index a73ae8d1..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/events/events.ts +++ /dev/null @@ -1,208 +0,0 @@ -/* - * 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' - -export class SeamHttpSeamCustomerV1Events { - 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 = {}, - ): SeamHttpSeamCustomerV1Events { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpSeamCustomerV1Events(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpSeamCustomerV1Events { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpSeamCustomerV1Events(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpSeamCustomerV1Events { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpSeamCustomerV1Events(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 SeamHttpSeamCustomerV1Events.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpSeamCustomerV1Events.fromClientSessionToken(token, options) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamCustomerV1Events { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpSeamCustomerV1Events(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamCustomerV1Events { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpSeamCustomerV1Events(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: SeamCustomerV1EventsListParameters, - options: SeamCustomerV1EventsListOptions = {}, - ): SeamCustomerV1EventsListRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/events/list', - method: 'POST', - body: parameters, - responseKey: 'events', - options, - }) - } -} - -export type SeamCustomerV1EventsListParameters = - RouteRequestBody<'/seam/customer/v1/events/list'> - -/** - * @deprecated Use SeamCustomerV1EventsListParameters instead. - */ -export type SeamCustomerV1EventsListParams = SeamCustomerV1EventsListParameters - -/** - * @deprecated Use SeamCustomerV1EventsListRequest instead. - */ -export type SeamCustomerV1EventsListResponse = - RouteResponse<'/seam/customer/v1/events/list'> - -export type SeamCustomerV1EventsListRequest = SeamHttpRequest< - SeamCustomerV1EventsListResponse, - 'events' -> - -export interface SeamCustomerV1EventsListOptions {} diff --git a/src/lib/seam/connect/routes/seam/customer/v1/events/index.ts b/src/lib/seam/connect/routes/seam/customer/v1/events/index.ts deleted file mode 100644 index 80914354..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/events/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './events.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 deleted file mode 100644 index 06d5e025..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/index.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './access-grants/index.js' -export * from './access-methods/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 './encoders/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 './staff-members/index.js' -export * from './v1.js' diff --git a/src/lib/seam/connect/routes/seam/customer/v1/portals/index.ts b/src/lib/seam/connect/routes/seam/customer/v1/portals/index.ts deleted file mode 100644 index 31aa3aa4..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/portals/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './portals.js' diff --git a/src/lib/seam/connect/routes/seam/customer/v1/portals/portals.ts b/src/lib/seam/connect/routes/seam/customer/v1/portals/portals.ts deleted file mode 100644 index e8fe8d10..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/portals/portals.ts +++ /dev/null @@ -1,248 +0,0 @@ -/* - * 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' - -export class SeamHttpSeamCustomerV1Portals { - 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 = {}, - ): SeamHttpSeamCustomerV1Portals { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpSeamCustomerV1Portals(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpSeamCustomerV1Portals { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpSeamCustomerV1Portals(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpSeamCustomerV1Portals { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpSeamCustomerV1Portals(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 SeamHttpSeamCustomerV1Portals.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpSeamCustomerV1Portals.fromClientSessionToken(token, options) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamCustomerV1Portals { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpSeamCustomerV1Portals(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamCustomerV1Portals { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpSeamCustomerV1Portals(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() - } - - 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/customer/v1/portals/get', - method: 'POST', - body: parameters, - responseKey: 'customer_portal', - options, - }) - } - - update( - parameters: SeamCustomerV1PortalsUpdateParameters, - options: SeamCustomerV1PortalsUpdateOptions = {}, - ): SeamCustomerV1PortalsUpdateRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/portals/update', - method: 'PATCH', - body: parameters, - responseKey: undefined, - options, - }) - } -} - -export type SeamCustomerV1PortalsGetParameters = - RouteRequestBody<'/seam/customer/v1/portals/get'> - -/** - * @deprecated Use SeamCustomerV1PortalsGetParameters instead. - */ -export type SeamCustomerV1PortalsGetParams = SeamCustomerV1PortalsGetParameters - -/** - * @deprecated Use SeamCustomerV1PortalsGetRequest instead. - */ -export type SeamCustomerV1PortalsGetResponse = - RouteResponse<'/seam/customer/v1/portals/get'> - -export type SeamCustomerV1PortalsGetRequest = SeamHttpRequest< - SeamCustomerV1PortalsGetResponse, - 'customer_portal' -> - -export interface SeamCustomerV1PortalsGetOptions {} - -export type SeamCustomerV1PortalsUpdateParameters = - RouteRequestBody<'/seam/customer/v1/portals/update'> - -/** - * @deprecated Use SeamCustomerV1PortalsUpdateParameters instead. - */ -export type SeamCustomerV1PortalsUpdateBody = - SeamCustomerV1PortalsUpdateParameters - -/** - * @deprecated Use SeamCustomerV1PortalsUpdateRequest instead. - */ -export type SeamCustomerV1PortalsUpdateResponse = - RouteResponse<'/seam/customer/v1/portals/update'> - -export type SeamCustomerV1PortalsUpdateRequest = SeamHttpRequest< - void, - undefined -> - -export interface SeamCustomerV1PortalsUpdateOptions {} diff --git a/src/lib/seam/connect/routes/seam/customer/v1/reservations/index.ts b/src/lib/seam/connect/routes/seam/customer/v1/reservations/index.ts deleted file mode 100644 index 72e7f4fc..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/reservations/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './reservations.js' diff --git a/src/lib/seam/connect/routes/seam/customer/v1/reservations/reservations.ts b/src/lib/seam/connect/routes/seam/customer/v1/reservations/reservations.ts deleted file mode 100644 index 86aaae05..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/reservations/reservations.ts +++ /dev/null @@ -1,292 +0,0 @@ -/* - * 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' - -export class SeamHttpSeamCustomerV1Reservations { - 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 = {}, - ): SeamHttpSeamCustomerV1Reservations { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpSeamCustomerV1Reservations(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpSeamCustomerV1Reservations { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpSeamCustomerV1Reservations(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpSeamCustomerV1Reservations { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpSeamCustomerV1Reservations(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 SeamHttpSeamCustomerV1Reservations.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpSeamCustomerV1Reservations.fromClientSessionToken( - token, - options, - ) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamCustomerV1Reservations { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpSeamCustomerV1Reservations(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamCustomerV1Reservations { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpSeamCustomerV1Reservations(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() - } - - get( - parameters?: SeamCustomerV1ReservationsGetParameters, - options: SeamCustomerV1ReservationsGetOptions = {}, - ): SeamCustomerV1ReservationsGetRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/reservations/get', - method: 'POST', - body: parameters, - responseKey: 'reservation', - options, - }) - } - - list( - parameters?: SeamCustomerV1ReservationsListParameters, - options: SeamCustomerV1ReservationsListOptions = {}, - ): SeamCustomerV1ReservationsListRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/reservations/list', - method: 'POST', - body: parameters, - responseKey: 'reservations', - options, - }) - } - - listAccessGrants( - parameters: SeamCustomerV1ReservationsListAccessGrantsParameters, - options: SeamCustomerV1ReservationsListAccessGrantsOptions = {}, - ): SeamCustomerV1ReservationsListAccessGrantsRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/reservations/list_access_grants', - method: 'POST', - body: parameters, - responseKey: 'access_grants', - options, - }) - } -} - -export type SeamCustomerV1ReservationsGetParameters = - RouteRequestBody<'/seam/customer/v1/reservations/get'> - -/** - * @deprecated Use SeamCustomerV1ReservationsGetParameters instead. - */ -export type SeamCustomerV1ReservationsGetParams = - SeamCustomerV1ReservationsGetParameters - -/** - * @deprecated Use SeamCustomerV1ReservationsGetRequest instead. - */ -export type SeamCustomerV1ReservationsGetResponse = - RouteResponse<'/seam/customer/v1/reservations/get'> - -export type SeamCustomerV1ReservationsGetRequest = SeamHttpRequest< - SeamCustomerV1ReservationsGetResponse, - 'reservation' -> - -export interface SeamCustomerV1ReservationsGetOptions {} - -export type SeamCustomerV1ReservationsListParameters = - RouteRequestBody<'/seam/customer/v1/reservations/list'> - -/** - * @deprecated Use SeamCustomerV1ReservationsListParameters instead. - */ -export type SeamCustomerV1ReservationsListParams = - SeamCustomerV1ReservationsListParameters - -/** - * @deprecated Use SeamCustomerV1ReservationsListRequest instead. - */ -export type SeamCustomerV1ReservationsListResponse = - RouteResponse<'/seam/customer/v1/reservations/list'> - -export type SeamCustomerV1ReservationsListRequest = SeamHttpRequest< - SeamCustomerV1ReservationsListResponse, - 'reservations' -> - -export interface SeamCustomerV1ReservationsListOptions {} - -export type SeamCustomerV1ReservationsListAccessGrantsParameters = - RouteRequestBody<'/seam/customer/v1/reservations/list_access_grants'> - -/** - * @deprecated Use SeamCustomerV1ReservationsListAccessGrantsParameters instead. - */ -export type SeamCustomerV1ReservationsListAccessGrantsParams = - SeamCustomerV1ReservationsListAccessGrantsParameters - -/** - * @deprecated Use SeamCustomerV1ReservationsListAccessGrantsRequest instead. - */ -export type SeamCustomerV1ReservationsListAccessGrantsResponse = - RouteResponse<'/seam/customer/v1/reservations/list_access_grants'> - -export type SeamCustomerV1ReservationsListAccessGrantsRequest = SeamHttpRequest< - SeamCustomerV1ReservationsListAccessGrantsResponse, - 'access_grants' -> - -export interface SeamCustomerV1ReservationsListAccessGrantsOptions {} 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 deleted file mode 100644 index 2d2ca6e4..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/settings/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './settings.js' -export * from './vertical-resource-aliases/index.js' diff --git a/src/lib/seam/connect/routes/seam/customer/v1/settings/settings.ts b/src/lib/seam/connect/routes/seam/customer/v1/settings/settings.ts deleted file mode 100644 index 744c599d..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/settings/settings.ts +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -import type { - RouteRequestBody, - RouteRequestParams, - 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 { SeamHttpSeamCustomerV1SettingsVerticalResourceAliases } from './vertical-resource-aliases/index.js' - -export class SeamHttpSeamCustomerV1Settings { - 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 = {}, - ): SeamHttpSeamCustomerV1Settings { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpSeamCustomerV1Settings(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpSeamCustomerV1Settings { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpSeamCustomerV1Settings(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpSeamCustomerV1Settings { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpSeamCustomerV1Settings(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 SeamHttpSeamCustomerV1Settings.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpSeamCustomerV1Settings.fromClientSessionToken(token, options) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamCustomerV1Settings { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpSeamCustomerV1Settings(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamCustomerV1Settings { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpSeamCustomerV1Settings(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() - } - - get verticalResourceAliases(): SeamHttpSeamCustomerV1SettingsVerticalResourceAliases { - return SeamHttpSeamCustomerV1SettingsVerticalResourceAliases.fromClient( - this.client, - this.defaults, - ) - } - - get( - parameters?: SeamCustomerV1SettingsGetParameters, - options: SeamCustomerV1SettingsGetOptions = {}, - ): SeamCustomerV1SettingsGetRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/settings/get', - method: 'GET', - params: parameters, - responseKey: 'business_vertical', - options, - }) - } - - update( - parameters?: SeamCustomerV1SettingsUpdateParameters, - options: SeamCustomerV1SettingsUpdateOptions = {}, - ): SeamCustomerV1SettingsUpdateRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/settings/update', - method: 'PATCH', - body: parameters, - responseKey: undefined, - options, - }) - } -} - -export type SeamCustomerV1SettingsGetParameters = - RouteRequestParams<'/seam/customer/v1/settings/get'> - -/** - * @deprecated Use SeamCustomerV1SettingsGetParameters instead. - */ -export type SeamCustomerV1SettingsGetParams = - SeamCustomerV1SettingsGetParameters - -/** - * @deprecated Use SeamCustomerV1SettingsGetRequest instead. - */ -export type SeamCustomerV1SettingsGetResponse = - RouteResponse<'/seam/customer/v1/settings/get'> - -export type SeamCustomerV1SettingsGetRequest = SeamHttpRequest< - SeamCustomerV1SettingsGetResponse, - 'business_vertical' -> - -export interface SeamCustomerV1SettingsGetOptions {} - -export type SeamCustomerV1SettingsUpdateParameters = - RouteRequestBody<'/seam/customer/v1/settings/update'> - -/** - * @deprecated Use SeamCustomerV1SettingsUpdateParameters instead. - */ -export type SeamCustomerV1SettingsUpdateBody = - SeamCustomerV1SettingsUpdateParameters - -/** - * @deprecated Use SeamCustomerV1SettingsUpdateRequest instead. - */ -export type SeamCustomerV1SettingsUpdateResponse = - RouteResponse<'/seam/customer/v1/settings/update'> - -export type SeamCustomerV1SettingsUpdateRequest = SeamHttpRequest< - void, - undefined -> - -export interface SeamCustomerV1SettingsUpdateOptions {} diff --git a/src/lib/seam/connect/routes/seam/customer/v1/settings/vertical-resource-aliases/index.ts b/src/lib/seam/connect/routes/seam/customer/v1/settings/vertical-resource-aliases/index.ts deleted file mode 100644 index dbbd1af2..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/settings/vertical-resource-aliases/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './vertical-resource-aliases.js' diff --git a/src/lib/seam/connect/routes/seam/customer/v1/settings/vertical-resource-aliases/vertical-resource-aliases.ts b/src/lib/seam/connect/routes/seam/customer/v1/settings/vertical-resource-aliases/vertical-resource-aliases.ts deleted file mode 100644 index 8982cf3b..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/settings/vertical-resource-aliases/vertical-resource-aliases.ts +++ /dev/null @@ -1,223 +0,0 @@ -/* - * 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' - -export class SeamHttpSeamCustomerV1SettingsVerticalResourceAliases { - 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 = {}, - ): SeamHttpSeamCustomerV1SettingsVerticalResourceAliases { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpSeamCustomerV1SettingsVerticalResourceAliases( - constructorOptions, - ) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpSeamCustomerV1SettingsVerticalResourceAliases { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpSeamCustomerV1SettingsVerticalResourceAliases( - constructorOptions, - ) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpSeamCustomerV1SettingsVerticalResourceAliases { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpSeamCustomerV1SettingsVerticalResourceAliases( - 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 SeamHttpSeamCustomerV1SettingsVerticalResourceAliases.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpSeamCustomerV1SettingsVerticalResourceAliases.fromClientSessionToken( - token, - options, - ) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamCustomerV1SettingsVerticalResourceAliases { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpSeamCustomerV1SettingsVerticalResourceAliases( - constructorOptions, - ) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamCustomerV1SettingsVerticalResourceAliases { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpSeamCustomerV1SettingsVerticalResourceAliases( - 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() - } - - get( - parameters?: SeamCustomerV1SettingsVerticalResourceAliasesGetParameters, - options: SeamCustomerV1SettingsVerticalResourceAliasesGetOptions = {}, - ): SeamCustomerV1SettingsVerticalResourceAliasesGetRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/settings/vertical_resource_aliases/get', - method: 'POST', - body: parameters, - responseKey: 'vertical_resource_aliases', - options, - }) - } -} - -export type SeamCustomerV1SettingsVerticalResourceAliasesGetParameters = - RouteRequestBody<'/seam/customer/v1/settings/vertical_resource_aliases/get'> - -/** - * @deprecated Use SeamCustomerV1SettingsVerticalResourceAliasesGetParameters instead. - */ -export type SeamCustomerV1SettingsVerticalResourceAliasesGetParams = - SeamCustomerV1SettingsVerticalResourceAliasesGetParameters - -/** - * @deprecated Use SeamCustomerV1SettingsVerticalResourceAliasesGetRequest instead. - */ -export type SeamCustomerV1SettingsVerticalResourceAliasesGetResponse = - RouteResponse<'/seam/customer/v1/settings/vertical_resource_aliases/get'> - -export type SeamCustomerV1SettingsVerticalResourceAliasesGetRequest = - SeamHttpRequest< - SeamCustomerV1SettingsVerticalResourceAliasesGetResponse, - 'vertical_resource_aliases' - > - -export interface SeamCustomerV1SettingsVerticalResourceAliasesGetOptions {} diff --git a/src/lib/seam/connect/routes/seam/customer/v1/spaces/index.ts b/src/lib/seam/connect/routes/seam/customer/v1/spaces/index.ts deleted file mode 100644 index af3f0bb2..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/spaces/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './spaces.js' diff --git a/src/lib/seam/connect/routes/seam/customer/v1/spaces/spaces.ts b/src/lib/seam/connect/routes/seam/customer/v1/spaces/spaces.ts deleted file mode 100644 index c9415db6..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/spaces/spaces.ts +++ /dev/null @@ -1,328 +0,0 @@ -/* - * 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' - -export class SeamHttpSeamCustomerV1Spaces { - 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 = {}, - ): SeamHttpSeamCustomerV1Spaces { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpSeamCustomerV1Spaces(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpSeamCustomerV1Spaces { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpSeamCustomerV1Spaces(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpSeamCustomerV1Spaces { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpSeamCustomerV1Spaces(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 SeamHttpSeamCustomerV1Spaces.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpSeamCustomerV1Spaces.fromClientSessionToken(token, options) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamCustomerV1Spaces { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpSeamCustomerV1Spaces(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamCustomerV1Spaces { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpSeamCustomerV1Spaces(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: SeamCustomerV1SpacesCreateParameters, - options: SeamCustomerV1SpacesCreateOptions = {}, - ): SeamCustomerV1SpacesCreateRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/spaces/create', - method: 'POST', - body: parameters, - responseKey: 'space', - options, - }) - } - - list( - parameters?: SeamCustomerV1SpacesListParameters, - options: SeamCustomerV1SpacesListOptions = {}, - ): SeamCustomerV1SpacesListRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/spaces/list', - method: 'POST', - body: parameters, - responseKey: 'spaces', - options, - }) - } - - listReservations( - parameters: SeamCustomerV1SpacesListReservationsParameters, - options: SeamCustomerV1SpacesListReservationsOptions = {}, - ): SeamCustomerV1SpacesListReservationsRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/spaces/list_reservations', - method: 'POST', - body: parameters, - responseKey: 'reservations', - options, - }) - } - - pushCommonAreas( - parameters?: SeamCustomerV1SpacesPushCommonAreasParameters, - options: SeamCustomerV1SpacesPushCommonAreasOptions = {}, - ): SeamCustomerV1SpacesPushCommonAreasRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/spaces/push_common_areas', - method: 'POST', - body: parameters, - responseKey: undefined, - options, - }) - } -} - -export type SeamCustomerV1SpacesCreateParameters = - RouteRequestBody<'/seam/customer/v1/spaces/create'> - -/** - * @deprecated Use SeamCustomerV1SpacesCreateParameters instead. - */ -export type SeamCustomerV1SpacesCreateBody = - SeamCustomerV1SpacesCreateParameters - -/** - * @deprecated Use SeamCustomerV1SpacesCreateRequest instead. - */ -export type SeamCustomerV1SpacesCreateResponse = - RouteResponse<'/seam/customer/v1/spaces/create'> - -export type SeamCustomerV1SpacesCreateRequest = SeamHttpRequest< - SeamCustomerV1SpacesCreateResponse, - 'space' -> - -export interface SeamCustomerV1SpacesCreateOptions {} - -export type SeamCustomerV1SpacesListParameters = - RouteRequestBody<'/seam/customer/v1/spaces/list'> - -/** - * @deprecated Use SeamCustomerV1SpacesListParameters instead. - */ -export type SeamCustomerV1SpacesListParams = SeamCustomerV1SpacesListParameters - -/** - * @deprecated Use SeamCustomerV1SpacesListRequest instead. - */ -export type SeamCustomerV1SpacesListResponse = - RouteResponse<'/seam/customer/v1/spaces/list'> - -export type SeamCustomerV1SpacesListRequest = SeamHttpRequest< - SeamCustomerV1SpacesListResponse, - 'spaces' -> - -export interface SeamCustomerV1SpacesListOptions {} - -export type SeamCustomerV1SpacesListReservationsParameters = - RouteRequestBody<'/seam/customer/v1/spaces/list_reservations'> - -/** - * @deprecated Use SeamCustomerV1SpacesListReservationsParameters instead. - */ -export type SeamCustomerV1SpacesListReservationsParams = - SeamCustomerV1SpacesListReservationsParameters - -/** - * @deprecated Use SeamCustomerV1SpacesListReservationsRequest instead. - */ -export type SeamCustomerV1SpacesListReservationsResponse = - RouteResponse<'/seam/customer/v1/spaces/list_reservations'> - -export type SeamCustomerV1SpacesListReservationsRequest = SeamHttpRequest< - SeamCustomerV1SpacesListReservationsResponse, - 'reservations' -> - -export interface SeamCustomerV1SpacesListReservationsOptions {} - -export type SeamCustomerV1SpacesPushCommonAreasParameters = - RouteRequestBody<'/seam/customer/v1/spaces/push_common_areas'> - -/** - * @deprecated Use SeamCustomerV1SpacesPushCommonAreasParameters instead. - */ -export type SeamCustomerV1SpacesPushCommonAreasBody = - SeamCustomerV1SpacesPushCommonAreasParameters - -/** - * @deprecated Use SeamCustomerV1SpacesPushCommonAreasRequest instead. - */ -export type SeamCustomerV1SpacesPushCommonAreasResponse = - RouteResponse<'/seam/customer/v1/spaces/push_common_areas'> - -export type SeamCustomerV1SpacesPushCommonAreasRequest = SeamHttpRequest< - void, - undefined -> - -export interface SeamCustomerV1SpacesPushCommonAreasOptions {} 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 deleted file mode 100644 index 152bf865..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/staff-members/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * 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 deleted file mode 100644 index 3084da33..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/staff-members/staff-members.ts +++ /dev/null @@ -1,252 +0,0 @@ -/* - * 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' - -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() - } - - get( - parameters: SeamCustomerV1StaffMembersGetParameters, - options: SeamCustomerV1StaffMembersGetOptions = {}, - ): SeamCustomerV1StaffMembersGetRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/customer/v1/staff_members/get', - method: 'POST', - body: parameters, - responseKey: 'staff_member', - options, - }) - } - - 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 SeamCustomerV1StaffMembersGetParameters = - RouteRequestBody<'/seam/customer/v1/staff_members/get'> - -/** - * @deprecated Use SeamCustomerV1StaffMembersGetParameters instead. - */ -export type SeamCustomerV1StaffMembersGetParams = - SeamCustomerV1StaffMembersGetParameters - -/** - * @deprecated Use SeamCustomerV1StaffMembersGetRequest instead. - */ -export type SeamCustomerV1StaffMembersGetResponse = - RouteResponse<'/seam/customer/v1/staff_members/get'> - -export type SeamCustomerV1StaffMembersGetRequest = SeamHttpRequest< - SeamCustomerV1StaffMembersGetResponse, - 'staff_member' -> - -export interface SeamCustomerV1StaffMembersGetOptions {} - -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 = - RouteResponse<'/seam/customer/v1/staff_members/list'> - -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 deleted file mode 100644 index 1ae1f396..00000000 --- a/src/lib/seam/connect/routes/seam/customer/v1/v1.ts +++ /dev/null @@ -1,265 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -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 type { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' -import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' - -import { SeamHttpSeamCustomerV1AccessGrants } from './access-grants/index.js' -import { SeamHttpSeamCustomerV1AccessMethods } from './access-methods/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 { SeamHttpSeamCustomerV1Encoders } from './encoders/index.js' -import { SeamHttpSeamCustomerV1Events } from './events/index.js' -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 - 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 = {}, - ): SeamHttpSeamCustomerV1 { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpSeamCustomerV1(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpSeamCustomerV1 { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpSeamCustomerV1(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpSeamCustomerV1 { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpSeamCustomerV1(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 SeamHttpSeamCustomerV1.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpSeamCustomerV1.fromClientSessionToken(token, options) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamCustomerV1 { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpSeamCustomerV1(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamCustomerV1 { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpSeamCustomerV1(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() - } - - get accessGrants(): SeamHttpSeamCustomerV1AccessGrants { - return SeamHttpSeamCustomerV1AccessGrants.fromClient( - this.client, - this.defaults, - ) - } - - get accessMethods(): SeamHttpSeamCustomerV1AccessMethods { - return SeamHttpSeamCustomerV1AccessMethods.fromClient( - this.client, - this.defaults, - ) - } - - get automationRuns(): SeamHttpSeamCustomerV1AutomationRuns { - return SeamHttpSeamCustomerV1AutomationRuns.fromClient( - this.client, - this.defaults, - ) - } - - get automations(): SeamHttpSeamCustomerV1Automations { - return SeamHttpSeamCustomerV1Automations.fromClient( - this.client, - this.defaults, - ) - } - - get connectorCustomers(): SeamHttpSeamCustomerV1ConnectorCustomers { - return SeamHttpSeamCustomerV1ConnectorCustomers.fromClient( - this.client, - this.defaults, - ) - } - - get connectors(): SeamHttpSeamCustomerV1Connectors { - return SeamHttpSeamCustomerV1Connectors.fromClient( - this.client, - this.defaults, - ) - } - - get customers(): SeamHttpSeamCustomerV1Customers { - return SeamHttpSeamCustomerV1Customers.fromClient( - this.client, - this.defaults, - ) - } - - get encoders(): SeamHttpSeamCustomerV1Encoders { - return SeamHttpSeamCustomerV1Encoders.fromClient(this.client, this.defaults) - } - - get events(): SeamHttpSeamCustomerV1Events { - return SeamHttpSeamCustomerV1Events.fromClient(this.client, this.defaults) - } - - get portals(): SeamHttpSeamCustomerV1Portals { - return SeamHttpSeamCustomerV1Portals.fromClient(this.client, this.defaults) - } - - get reservations(): SeamHttpSeamCustomerV1Reservations { - return SeamHttpSeamCustomerV1Reservations.fromClient( - this.client, - this.defaults, - ) - } - - get settings(): SeamHttpSeamCustomerV1Settings { - return SeamHttpSeamCustomerV1Settings.fromClient(this.client, this.defaults) - } - - get spaces(): SeamHttpSeamCustomerV1Spaces { - return SeamHttpSeamCustomerV1Spaces.fromClient(this.client, this.defaults) - } - - get staffMembers(): SeamHttpSeamCustomerV1StaffMembers { - return SeamHttpSeamCustomerV1StaffMembers.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 deleted file mode 100644 index 2ed07d2c..00000000 --- a/src/lib/seam/connect/routes/seam/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './console/index.js' -export * from './customer/index.js' -export * from './partner/index.js' diff --git a/src/lib/seam/connect/routes/seam/partner/index.ts b/src/lib/seam/connect/routes/seam/partner/index.ts deleted file mode 100644 index 2e9499e7..00000000 --- a/src/lib/seam/connect/routes/seam/partner/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './v1/index.js' diff --git a/src/lib/seam/connect/routes/seam/partner/v1/building-blocks/building-blocks.ts b/src/lib/seam/connect/routes/seam/partner/v1/building-blocks/building-blocks.ts deleted file mode 100644 index bacf84da..00000000 --- a/src/lib/seam/connect/routes/seam/partner/v1/building-blocks/building-blocks.ts +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -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 type { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' -import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' - -import { SeamHttpSeamPartnerV1BuildingBlocksSpaces } from './spaces/index.js' - -export class SeamHttpSeamPartnerV1BuildingBlocks { - 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 = {}, - ): SeamHttpSeamPartnerV1BuildingBlocks { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpSeamPartnerV1BuildingBlocks(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpSeamPartnerV1BuildingBlocks { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpSeamPartnerV1BuildingBlocks(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpSeamPartnerV1BuildingBlocks { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpSeamPartnerV1BuildingBlocks(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 SeamHttpSeamPartnerV1BuildingBlocks.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpSeamPartnerV1BuildingBlocks.fromClientSessionToken( - token, - options, - ) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamPartnerV1BuildingBlocks { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpSeamPartnerV1BuildingBlocks(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamPartnerV1BuildingBlocks { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpSeamPartnerV1BuildingBlocks(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() - } - - get spaces(): SeamHttpSeamPartnerV1BuildingBlocksSpaces { - return SeamHttpSeamPartnerV1BuildingBlocksSpaces.fromClient( - this.client, - this.defaults, - ) - } -} diff --git a/src/lib/seam/connect/routes/seam/partner/v1/building-blocks/index.ts b/src/lib/seam/connect/routes/seam/partner/v1/building-blocks/index.ts deleted file mode 100644 index 234457d5..00000000 --- a/src/lib/seam/connect/routes/seam/partner/v1/building-blocks/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './building-blocks.js' -export * from './spaces/index.js' diff --git a/src/lib/seam/connect/routes/seam/partner/v1/building-blocks/spaces/index.ts b/src/lib/seam/connect/routes/seam/partner/v1/building-blocks/spaces/index.ts deleted file mode 100644 index af3f0bb2..00000000 --- a/src/lib/seam/connect/routes/seam/partner/v1/building-blocks/spaces/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './spaces.js' diff --git a/src/lib/seam/connect/routes/seam/partner/v1/building-blocks/spaces/spaces.ts b/src/lib/seam/connect/routes/seam/partner/v1/building-blocks/spaces/spaces.ts deleted file mode 100644 index 927399be..00000000 --- a/src/lib/seam/connect/routes/seam/partner/v1/building-blocks/spaces/spaces.ts +++ /dev/null @@ -1,212 +0,0 @@ -/* - * 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' - -export class SeamHttpSeamPartnerV1BuildingBlocksSpaces { - 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 = {}, - ): SeamHttpSeamPartnerV1BuildingBlocksSpaces { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpSeamPartnerV1BuildingBlocksSpaces(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpSeamPartnerV1BuildingBlocksSpaces { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpSeamPartnerV1BuildingBlocksSpaces(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpSeamPartnerV1BuildingBlocksSpaces { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpSeamPartnerV1BuildingBlocksSpaces(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 SeamHttpSeamPartnerV1BuildingBlocksSpaces.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpSeamPartnerV1BuildingBlocksSpaces.fromClientSessionToken( - token, - options, - ) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamPartnerV1BuildingBlocksSpaces { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpSeamPartnerV1BuildingBlocksSpaces(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpSeamPartnerV1BuildingBlocksSpaces { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpSeamPartnerV1BuildingBlocksSpaces(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() - } - - autoMap( - parameters?: SeamPartnerV1BuildingBlocksSpacesAutoMapParameters, - options: SeamPartnerV1BuildingBlocksSpacesAutoMapOptions = {}, - ): SeamPartnerV1BuildingBlocksSpacesAutoMapRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/seam/partner/v1/building_blocks/spaces/auto_map', - method: 'POST', - body: parameters, - responseKey: 'spaces', - options, - }) - } -} - -export type SeamPartnerV1BuildingBlocksSpacesAutoMapParameters = - RouteRequestBody<'/seam/partner/v1/building_blocks/spaces/auto_map'> - -/** - * @deprecated Use SeamPartnerV1BuildingBlocksSpacesAutoMapParameters instead. - */ -export type SeamPartnerV1BuildingBlocksSpacesAutoMapParams = - SeamPartnerV1BuildingBlocksSpacesAutoMapParameters - -/** - * @deprecated Use SeamPartnerV1BuildingBlocksSpacesAutoMapRequest instead. - */ -export type SeamPartnerV1BuildingBlocksSpacesAutoMapResponse = - RouteResponse<'/seam/partner/v1/building_blocks/spaces/auto_map'> - -export type SeamPartnerV1BuildingBlocksSpacesAutoMapRequest = SeamHttpRequest< - SeamPartnerV1BuildingBlocksSpacesAutoMapResponse, - 'spaces' -> - -export interface SeamPartnerV1BuildingBlocksSpacesAutoMapOptions {} diff --git a/src/lib/seam/connect/routes/seam/partner/v1/index.ts b/src/lib/seam/connect/routes/seam/partner/v1/index.ts deleted file mode 100644 index ee41d3d1..00000000 --- a/src/lib/seam/connect/routes/seam/partner/v1/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './building-blocks/index.js' diff --git a/src/lib/seam/connect/routes/spaces/spaces.ts b/src/lib/seam/connect/routes/spaces/spaces.ts index 90da18d9..a1a7d624 100644 --- a/src/lib/seam/connect/routes/spaces/spaces.ts +++ b/src/lib/seam/connect/routes/spaces/spaces.ts @@ -29,8 +29,8 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { SpaceResource } from 'lib/seam/connect/resources/space.js' -import type { UnknownResource } from 'lib/seam/connect/resources/unknown.js' +import type { Batch } from 'lib/seam/connect/resources/batch.js' +import type { Space } from 'lib/seam/connect/resources/space.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' @@ -325,11 +325,6 @@ export type SpacesAddAcsEntrancesParameters = { space_id: string } -/** - * @deprecated Use SpacesAddAcsEntrancesParameters instead. - */ -export type SpacesAddAcsEntrancesBody = SpacesAddAcsEntrancesParameters - /** * @deprecated Use SpacesAddAcsEntrancesRequest instead. */ @@ -345,11 +340,6 @@ export type SpacesAddConnectedAccountParameters = { space_id: string } -/** - * @deprecated Use SpacesAddConnectedAccountParameters instead. - */ -export type SpacesAddConnectedAccountBody = SpacesAddConnectedAccountParameters - /** * @deprecated Use SpacesAddConnectedAccountRequest instead. */ @@ -365,11 +355,6 @@ export type SpacesAddDevicesParameters = { space_id: string } -/** - * @deprecated Use SpacesAddDevicesParameters instead. - */ -export type SpacesAddDevicesBody = SpacesAddDevicesParameters - /** * @deprecated Use SpacesAddDevicesRequest instead. */ @@ -397,15 +382,10 @@ export type SpacesCreateParameters = { space_key?: string | undefined } -/** - * @deprecated Use SpacesCreateParameters instead. - */ -export type SpacesCreateBody = SpacesCreateParameters - /** * @deprecated Use SpacesCreateRequest instead. */ -export type SpacesCreateResponse = { space: SpaceResource } +export type SpacesCreateResponse = { space: Space } export type SpacesCreateRequest = SeamHttpRequest @@ -415,11 +395,6 @@ export type SpacesDeleteParameters = { space_id: string } -/** - * @deprecated Use SpacesDeleteParameters instead. - */ -export type SpacesDeleteParams = SpacesDeleteParameters - /** * @deprecated Use SpacesDeleteRequest instead. */ @@ -434,15 +409,10 @@ export type SpacesGetParameters = { space_key?: string | undefined } -/** - * @deprecated Use SpacesGetParameters instead. - */ -export type SpacesGetParams = SpacesGetParameters - /** * @deprecated Use SpacesGetRequest instead. */ -export type SpacesGetResponse = { space: SpaceResource } +export type SpacesGetResponse = { space: Space } export type SpacesGetRequest = SeamHttpRequest @@ -473,15 +443,19 @@ export type SpacesGetRelatedParameters = { space_keys?: Array | undefined } -/** - * @deprecated Use SpacesGetRelatedParameters instead. - */ -export type SpacesGetRelatedParams = SpacesGetRelatedParameters - /** * @deprecated Use SpacesGetRelatedRequest instead. */ -export type SpacesGetRelatedResponse = { batch: UnknownResource } +export type SpacesGetRelatedResponse = { + batch: Batch< + | 'spaces' + | 'devices' + | 'acs_entrances' + | 'connected_accounts' + | 'acs_systems' + | 'access_methods' + > +} export type SpacesGetRelatedRequest = SeamHttpRequest< SpacesGetRelatedResponse, @@ -491,25 +465,17 @@ export type SpacesGetRelatedRequest = SeamHttpRequest< export interface SpacesGetRelatedOptions {} export type SpacesListParameters = { - connected_account_id?: string | undefined customer_key?: string | undefined limit?: number | undefined page_cursor?: string | undefined - parent_space_id?: string | undefined - parent_space_key?: string | undefined search?: string | undefined space_key?: string | undefined } -/** - * @deprecated Use SpacesListParameters instead. - */ -export type SpacesListParams = SpacesListParameters - /** * @deprecated Use SpacesListRequest instead. */ -export type SpacesListResponse = { spaces: Array } +export type SpacesListResponse = { spaces: Array } export type SpacesListRequest = SeamHttpRequest @@ -521,11 +487,6 @@ export type SpacesRemoveAcsEntrancesParameters = { space_id: string } -/** - * @deprecated Use SpacesRemoveAcsEntrancesParameters instead. - */ -export type SpacesRemoveAcsEntrancesParams = SpacesRemoveAcsEntrancesParameters - /** * @deprecated Use SpacesRemoveAcsEntrancesRequest instead. */ @@ -541,12 +502,6 @@ export type SpacesRemoveConnectedAccountParameters = { space_id: string } -/** - * @deprecated Use SpacesRemoveConnectedAccountParameters instead. - */ -export type SpacesRemoveConnectedAccountParams = - SpacesRemoveConnectedAccountParameters - /** * @deprecated Use SpacesRemoveConnectedAccountRequest instead. */ @@ -565,11 +520,6 @@ export type SpacesRemoveDevicesParameters = { space_id: string } -/** - * @deprecated Use SpacesRemoveDevicesParameters instead. - */ -export type SpacesRemoveDevicesParams = SpacesRemoveDevicesParameters - /** * @deprecated Use SpacesRemoveDevicesRequest instead. */ @@ -591,21 +541,14 @@ export type SpacesUpdateParameters = { | undefined device_ids?: Array | undefined name?: string | undefined - parent_space_id?: string | undefined - parent_space_key?: string | undefined space_id?: string | undefined space_key?: string | undefined } -/** - * @deprecated Use SpacesUpdateParameters instead. - */ -export type SpacesUpdateBody = SpacesUpdateParameters - /** * @deprecated Use SpacesUpdateRequest instead. */ -export type SpacesUpdateResponse = { space: SpaceResource } +export type SpacesUpdateResponse = { space: Space } export type SpacesUpdateRequest = SeamHttpRequest diff --git a/src/lib/seam/connect/routes/thermostats/daily-programs/daily-programs.ts b/src/lib/seam/connect/routes/thermostats/daily-programs/daily-programs.ts index 2ee6048e..847adbe7 100644 --- a/src/lib/seam/connect/routes/thermostats/daily-programs/daily-programs.ts +++ b/src/lib/seam/connect/routes/thermostats/daily-programs/daily-programs.ts @@ -3,8 +3,6 @@ * Do not edit this file or add other files to this directory. */ -import type { RouteResponse } from '@seamapi/types/connect' - import { seamApiLtsVersion } from 'lib/lts-version.js' import { getAuthHeadersForClientSessionToken, @@ -31,7 +29,8 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { ThermostatDailyProgramResource } from 'lib/seam/connect/resources/thermostat-daily-program.js' +import type { ActionAttempt } from 'lib/seam/connect/resources/action-attempt.js' +import type { ThermostatDailyProgram } from 'lib/seam/connect/resources/thermostat-daily-program.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' @@ -217,17 +216,11 @@ export type ThermostatsDailyProgramsCreateParameters = { }> } -/** - * @deprecated Use ThermostatsDailyProgramsCreateParameters instead. - */ -export type ThermostatsDailyProgramsCreateBody = - ThermostatsDailyProgramsCreateParameters - /** * @deprecated Use ThermostatsDailyProgramsCreateRequest instead. */ export type ThermostatsDailyProgramsCreateResponse = { - thermostat_daily_program: ThermostatDailyProgramResource + thermostat_daily_program: ThermostatDailyProgram } export type ThermostatsDailyProgramsCreateRequest = SeamHttpRequest< @@ -241,12 +234,6 @@ export type ThermostatsDailyProgramsDeleteParameters = { thermostat_daily_program_id: string } -/** - * @deprecated Use ThermostatsDailyProgramsDeleteParameters instead. - */ -export type ThermostatsDailyProgramsDeleteParams = - ThermostatsDailyProgramsDeleteParameters - /** * @deprecated Use ThermostatsDailyProgramsDeleteRequest instead. */ @@ -270,17 +257,12 @@ export type ThermostatsDailyProgramsUpdateParameters = { thermostat_daily_program_id: string } -/** - * @deprecated Use ThermostatsDailyProgramsUpdateParameters instead. - */ -export type ThermostatsDailyProgramsUpdateBody = - ThermostatsDailyProgramsUpdateParameters - /** * @deprecated Use ThermostatsDailyProgramsUpdateRequest instead. */ -export type ThermostatsDailyProgramsUpdateResponse = - RouteResponse<'/thermostats/daily_programs/update'> +export type ThermostatsDailyProgramsUpdateResponse = { + action_attempt: ActionAttempt +} export type ThermostatsDailyProgramsUpdateRequest = SeamHttpRequest< ThermostatsDailyProgramsUpdateResponse, diff --git a/src/lib/seam/connect/routes/thermostats/schedules/schedules.ts b/src/lib/seam/connect/routes/thermostats/schedules/schedules.ts index b331a29d..feda5b7d 100644 --- a/src/lib/seam/connect/routes/thermostats/schedules/schedules.ts +++ b/src/lib/seam/connect/routes/thermostats/schedules/schedules.ts @@ -29,7 +29,7 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { ThermostatScheduleResource } from 'lib/seam/connect/resources/thermostat-schedule.js' +import type { ThermostatSchedule } from 'lib/seam/connect/resources/thermostat-schedule.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' @@ -240,17 +240,11 @@ export type ThermostatsSchedulesCreateParameters = { starts_at: string } -/** - * @deprecated Use ThermostatsSchedulesCreateParameters instead. - */ -export type ThermostatsSchedulesCreateBody = - ThermostatsSchedulesCreateParameters - /** * @deprecated Use ThermostatsSchedulesCreateRequest instead. */ export type ThermostatsSchedulesCreateResponse = { - thermostat_schedule: ThermostatScheduleResource + thermostat_schedule: ThermostatSchedule } export type ThermostatsSchedulesCreateRequest = SeamHttpRequest< @@ -264,12 +258,6 @@ export type ThermostatsSchedulesDeleteParameters = { thermostat_schedule_id: string } -/** - * @deprecated Use ThermostatsSchedulesDeleteParameters instead. - */ -export type ThermostatsSchedulesDeleteParams = - ThermostatsSchedulesDeleteParameters - /** * @deprecated Use ThermostatsSchedulesDeleteRequest instead. */ @@ -283,16 +271,11 @@ export type ThermostatsSchedulesGetParameters = { thermostat_schedule_id: string } -/** - * @deprecated Use ThermostatsSchedulesGetParameters instead. - */ -export type ThermostatsSchedulesGetParams = ThermostatsSchedulesGetParameters - /** * @deprecated Use ThermostatsSchedulesGetRequest instead. */ export type ThermostatsSchedulesGetResponse = { - thermostat_schedule: ThermostatScheduleResource + thermostat_schedule: ThermostatSchedule } export type ThermostatsSchedulesGetRequest = SeamHttpRequest< @@ -308,16 +291,11 @@ export type ThermostatsSchedulesListParameters = { user_identifier_key?: string | undefined } -/** - * @deprecated Use ThermostatsSchedulesListParameters instead. - */ -export type ThermostatsSchedulesListParams = ThermostatsSchedulesListParameters - /** * @deprecated Use ThermostatsSchedulesListRequest instead. */ export type ThermostatsSchedulesListResponse = { - thermostat_schedules: Array + thermostat_schedules: Array } export type ThermostatsSchedulesListRequest = SeamHttpRequest< @@ -337,12 +315,6 @@ export type ThermostatsSchedulesUpdateParameters = { thermostat_schedule_id: string } -/** - * @deprecated Use ThermostatsSchedulesUpdateParameters instead. - */ -export type ThermostatsSchedulesUpdateBody = - ThermostatsSchedulesUpdateParameters - /** * @deprecated Use ThermostatsSchedulesUpdateRequest instead. */ diff --git a/src/lib/seam/connect/routes/thermostats/simulate/simulate.ts b/src/lib/seam/connect/routes/thermostats/simulate/simulate.ts index 08c6c5a6..48f6e491 100644 --- a/src/lib/seam/connect/routes/thermostats/simulate/simulate.ts +++ b/src/lib/seam/connect/routes/thermostats/simulate/simulate.ts @@ -198,12 +198,6 @@ export type ThermostatsSimulateHvacModeAdjustedParameters = { heating_set_point_fahrenheit?: number | undefined } -/** - * @deprecated Use ThermostatsSimulateHvacModeAdjustedParameters instead. - */ -export type ThermostatsSimulateHvacModeAdjustedBody = - ThermostatsSimulateHvacModeAdjustedParameters - /** * @deprecated Use ThermostatsSimulateHvacModeAdjustedRequest instead. */ @@ -223,12 +217,6 @@ export type ThermostatsSimulateTemperatureReachedParameters = { temperature_fahrenheit?: number | undefined } -/** - * @deprecated Use ThermostatsSimulateTemperatureReachedParameters instead. - */ -export type ThermostatsSimulateTemperatureReachedBody = - ThermostatsSimulateTemperatureReachedParameters - /** * @deprecated Use ThermostatsSimulateTemperatureReachedRequest instead. */ diff --git a/src/lib/seam/connect/routes/thermostats/thermostats.ts b/src/lib/seam/connect/routes/thermostats/thermostats.ts index 7a94d994..0124be30 100644 --- a/src/lib/seam/connect/routes/thermostats/thermostats.ts +++ b/src/lib/seam/connect/routes/thermostats/thermostats.ts @@ -3,8 +3,6 @@ * 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, @@ -31,7 +29,8 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { DeviceResource } from 'lib/seam/connect/resources/device.js' +import type { ActionAttempt } from 'lib/seam/connect/resources/action-attempt.js' +import type { Device } from 'lib/seam/connect/resources/device.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' @@ -234,24 +233,6 @@ export class SeamHttpThermostats { }) } - get( - parameters?: ThermostatsGetParameters, - options: ThermostatsGetOptions = {}, - ): ThermostatsGetRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/thermostats/get', - method: 'POST', - body: parameters, - responseKey: 'thermostat', - options, - }) - } - heat( parameters: ThermostatsHeatParameters, options: ThermostatsHeatOptions = {}, @@ -389,17 +370,12 @@ export type ThermostatsActivateClimatePresetParameters = { device_id: string } -/** - * @deprecated Use ThermostatsActivateClimatePresetParameters instead. - */ -export type ThermostatsActivateClimatePresetBody = - ThermostatsActivateClimatePresetParameters - /** * @deprecated Use ThermostatsActivateClimatePresetRequest instead. */ -export type ThermostatsActivateClimatePresetResponse = - RouteResponse<'/thermostats/activate_climate_preset'> +export type ThermostatsActivateClimatePresetResponse = { + action_attempt: ActionAttempt +} export type ThermostatsActivateClimatePresetRequest = SeamHttpRequest< ThermostatsActivateClimatePresetResponse, @@ -415,19 +391,12 @@ export type ThermostatsCoolParameters = { cooling_set_point_celsius?: number | undefined cooling_set_point_fahrenheit?: number | undefined device_id: string - - sync?: boolean | undefined } -/** - * @deprecated Use ThermostatsCoolParameters instead. - */ -export type ThermostatsCoolBody = ThermostatsCoolParameters - /** * @deprecated Use ThermostatsCoolRequest instead. */ -export type ThermostatsCoolResponse = RouteResponse<'/thermostats/cool'> +export type ThermostatsCoolResponse = { action_attempt: ActionAttempt } export type ThermostatsCoolRequest = SeamHttpRequest< ThermostatsCoolResponse, @@ -463,12 +432,6 @@ export type ThermostatsCreateClimatePresetParameters = { name?: string | undefined } -/** - * @deprecated Use ThermostatsCreateClimatePresetParameters instead. - */ -export type ThermostatsCreateClimatePresetBody = - ThermostatsCreateClimatePresetParameters - /** * @deprecated Use ThermostatsCreateClimatePresetRequest instead. */ @@ -487,12 +450,6 @@ export type ThermostatsDeleteClimatePresetParameters = { device_id: string } -/** - * @deprecated Use ThermostatsDeleteClimatePresetParameters instead. - */ -export type ThermostatsDeleteClimatePresetParams = - ThermostatsDeleteClimatePresetParameters - /** * @deprecated Use ThermostatsDeleteClimatePresetRequest instead. */ @@ -505,42 +462,17 @@ export type ThermostatsDeleteClimatePresetRequest = SeamHttpRequest< export interface ThermostatsDeleteClimatePresetOptions {} -export type ThermostatsGetParameters = RouteRequestBody<'/thermostats/get'> - -/** - * @deprecated Use ThermostatsGetParameters instead. - */ -export type ThermostatsGetParams = ThermostatsGetParameters - -/** - * @deprecated Use ThermostatsGetRequest instead. - */ -export type ThermostatsGetResponse = RouteResponse<'/thermostats/get'> - -export type ThermostatsGetRequest = SeamHttpRequest< - ThermostatsGetResponse, - 'thermostat' -> - -export interface ThermostatsGetOptions {} - export type ThermostatsHeatParameters = { device_id: string heating_set_point_celsius?: number | undefined heating_set_point_fahrenheit?: number | undefined - sync?: boolean | undefined } -/** - * @deprecated Use ThermostatsHeatParameters instead. - */ -export type ThermostatsHeatBody = ThermostatsHeatParameters - /** * @deprecated Use ThermostatsHeatRequest instead. */ -export type ThermostatsHeatResponse = RouteResponse<'/thermostats/heat'> +export type ThermostatsHeatResponse = { action_attempt: ActionAttempt } export type ThermostatsHeatRequest = SeamHttpRequest< ThermostatsHeatResponse, @@ -559,19 +491,12 @@ export type ThermostatsHeatCoolParameters = { heating_set_point_celsius?: number | undefined heating_set_point_fahrenheit?: number | undefined - sync?: boolean | undefined } -/** - * @deprecated Use ThermostatsHeatCoolParameters instead. - */ -export type ThermostatsHeatCoolBody = ThermostatsHeatCoolParameters - /** * @deprecated Use ThermostatsHeatCoolRequest instead. */ -export type ThermostatsHeatCoolResponse = - RouteResponse<'/thermostats/heat_cool'> +export type ThermostatsHeatCoolResponse = { action_attempt: ActionAttempt } export type ThermostatsHeatCoolRequest = SeamHttpRequest< ThermostatsHeatCoolResponse, @@ -609,54 +534,6 @@ export type ThermostatsListParameters = { | 'smartthings_thermostat' > | undefined - exclude_if?: - | Array< - | 'can_remotely_unlock' - | 'can_remotely_lock' - | 'can_program_offline_access_codes' - | 'can_program_online_access_codes' - | 'can_hvac_heat' - | 'can_hvac_cool' - | 'can_hvac_heat_cool' - | 'can_turn_off_hvac' - | 'can_simulate_removal' - | 'can_simulate_connection' - | 'can_simulate_disconnection' - | 'can_unlock_with_code' - | 'can_run_thermostat_programs' - | 'can_program_thermostat_programs_as_weekday_weekend' - | 'can_program_thermostat_programs_as_different_each_day' - | 'can_program_thermostat_programs_as_same_each_day' - | 'can_simulate_hub_connection' - | 'can_simulate_hub_disconnection' - | 'can_simulate_paid_subscription' - | 'can_configure_auto_lock' - > - | undefined - include_if?: - | Array< - | 'can_remotely_unlock' - | 'can_remotely_lock' - | 'can_program_offline_access_codes' - | 'can_program_online_access_codes' - | 'can_hvac_heat' - | 'can_hvac_cool' - | 'can_hvac_heat_cool' - | 'can_turn_off_hvac' - | 'can_simulate_removal' - | 'can_simulate_connection' - | 'can_simulate_disconnection' - | 'can_unlock_with_code' - | 'can_run_thermostat_programs' - | 'can_program_thermostat_programs_as_weekday_weekend' - | 'can_program_thermostat_programs_as_different_each_day' - | 'can_program_thermostat_programs_as_same_each_day' - | 'can_simulate_hub_connection' - | 'can_simulate_hub_disconnection' - | 'can_simulate_paid_subscription' - | 'can_configure_auto_lock' - > - | undefined limit?: number | undefined manufacturer?: | 'ecobee' @@ -673,15 +550,10 @@ export type ThermostatsListParameters = { user_identifier_key?: string | undefined } -/** - * @deprecated Use ThermostatsListParameters instead. - */ -export type ThermostatsListParams = ThermostatsListParameters - /** * @deprecated Use ThermostatsListRequest instead. */ -export type ThermostatsListResponse = { devices: Array } +export type ThermostatsListResponse = { devices: Array } export type ThermostatsListRequest = SeamHttpRequest< ThermostatsListResponse, @@ -692,19 +564,12 @@ export interface ThermostatsListOptions {} export type ThermostatsOffParameters = { device_id: string - - sync?: boolean | undefined } -/** - * @deprecated Use ThermostatsOffParameters instead. - */ -export type ThermostatsOffBody = ThermostatsOffParameters - /** * @deprecated Use ThermostatsOffRequest instead. */ -export type ThermostatsOffResponse = RouteResponse<'/thermostats/off'> +export type ThermostatsOffResponse = { action_attempt: ActionAttempt } export type ThermostatsOffRequest = SeamHttpRequest< ThermostatsOffResponse, @@ -722,12 +587,6 @@ export type ThermostatsSetFallbackClimatePresetParameters = { device_id: string } -/** - * @deprecated Use ThermostatsSetFallbackClimatePresetParameters instead. - */ -export type ThermostatsSetFallbackClimatePresetBody = - ThermostatsSetFallbackClimatePresetParameters - /** * @deprecated Use ThermostatsSetFallbackClimatePresetRequest instead. */ @@ -745,19 +604,12 @@ export type ThermostatsSetFanModeParameters = { fan_mode?: 'auto' | 'on' | 'circulate' | undefined fan_mode_setting?: 'auto' | 'on' | 'circulate' | undefined - sync?: boolean | undefined } -/** - * @deprecated Use ThermostatsSetFanModeParameters instead. - */ -export type ThermostatsSetFanModeBody = ThermostatsSetFanModeParameters - /** * @deprecated Use ThermostatsSetFanModeRequest instead. */ -export type ThermostatsSetFanModeResponse = - RouteResponse<'/thermostats/set_fan_mode'> +export type ThermostatsSetFanModeResponse = { action_attempt: ActionAttempt } export type ThermostatsSetFanModeRequest = SeamHttpRequest< ThermostatsSetFanModeResponse, @@ -780,16 +632,10 @@ export type ThermostatsSetHvacModeParameters = { heating_set_point_fahrenheit?: number | undefined } -/** - * @deprecated Use ThermostatsSetHvacModeParameters instead. - */ -export type ThermostatsSetHvacModeBody = ThermostatsSetHvacModeParameters - /** * @deprecated Use ThermostatsSetHvacModeRequest instead. */ -export type ThermostatsSetHvacModeResponse = - RouteResponse<'/thermostats/set_hvac_mode'> +export type ThermostatsSetHvacModeResponse = { action_attempt: ActionAttempt } export type ThermostatsSetHvacModeRequest = SeamHttpRequest< ThermostatsSetHvacModeResponse, @@ -810,12 +656,6 @@ export type ThermostatsSetTemperatureThresholdParameters = { upper_limit_fahrenheit?: number | undefined } -/** - * @deprecated Use ThermostatsSetTemperatureThresholdParameters instead. - */ -export type ThermostatsSetTemperatureThresholdBody = - ThermostatsSetTemperatureThresholdParameters - /** * @deprecated Use ThermostatsSetTemperatureThresholdRequest instead. */ @@ -852,12 +692,6 @@ export type ThermostatsUpdateClimatePresetParameters = { name?: string | undefined } -/** - * @deprecated Use ThermostatsUpdateClimatePresetParameters instead. - */ -export type ThermostatsUpdateClimatePresetBody = - ThermostatsUpdateClimatePresetParameters - /** * @deprecated Use ThermostatsUpdateClimatePresetRequest instead. */ @@ -882,17 +716,12 @@ export type ThermostatsUpdateWeeklyProgramParameters = { wednesday_program_id?: string | undefined } -/** - * @deprecated Use ThermostatsUpdateWeeklyProgramParameters instead. - */ -export type ThermostatsUpdateWeeklyProgramBody = - ThermostatsUpdateWeeklyProgramParameters - /** * @deprecated Use ThermostatsUpdateWeeklyProgramRequest instead. */ -export type ThermostatsUpdateWeeklyProgramResponse = - RouteResponse<'/thermostats/update_weekly_program'> +export type ThermostatsUpdateWeeklyProgramResponse = { + action_attempt: ActionAttempt +} export type ThermostatsUpdateWeeklyProgramRequest = SeamHttpRequest< ThermostatsUpdateWeeklyProgramResponse, diff --git a/src/lib/seam/connect/routes/unstable-partner/building-blocks/building-blocks.ts b/src/lib/seam/connect/routes/unstable-partner/building-blocks/building-blocks.ts deleted file mode 100644 index 9b290367..00000000 --- a/src/lib/seam/connect/routes/unstable-partner/building-blocks/building-blocks.ts +++ /dev/null @@ -1,335 +0,0 @@ -/* - * 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' - -export class SeamHttpUnstablePartnerBuildingBlocks { - 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 = {}, - ): SeamHttpUnstablePartnerBuildingBlocks { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpUnstablePartnerBuildingBlocks(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpUnstablePartnerBuildingBlocks { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpUnstablePartnerBuildingBlocks(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpUnstablePartnerBuildingBlocks { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpUnstablePartnerBuildingBlocks(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 SeamHttpUnstablePartnerBuildingBlocks.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpUnstablePartnerBuildingBlocks.fromClientSessionToken( - token, - options, - ) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpUnstablePartnerBuildingBlocks { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpUnstablePartnerBuildingBlocks(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpUnstablePartnerBuildingBlocks { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpUnstablePartnerBuildingBlocks(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() - } - - connectAccounts( - parameters: UnstablePartnerBuildingBlocksConnectAccountsParameters, - options: UnstablePartnerBuildingBlocksConnectAccountsOptions = {}, - ): UnstablePartnerBuildingBlocksConnectAccountsRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/unstable_partner/building_blocks/connect_accounts', - method: 'POST', - body: parameters, - responseKey: 'magic_link', - options, - }) - } - - generateMagicLink( - parameters: UnstablePartnerBuildingBlocksGenerateMagicLinkParameters, - options: UnstablePartnerBuildingBlocksGenerateMagicLinkOptions = {}, - ): UnstablePartnerBuildingBlocksGenerateMagicLinkRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/unstable_partner/building_blocks/generate_magic_link', - method: 'POST', - body: parameters, - responseKey: 'magic_link', - options, - }) - } - - manageDevices( - parameters: UnstablePartnerBuildingBlocksManageDevicesParameters, - options: UnstablePartnerBuildingBlocksManageDevicesOptions = {}, - ): UnstablePartnerBuildingBlocksManageDevicesRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/unstable_partner/building_blocks/manage_devices', - method: 'POST', - body: parameters, - responseKey: 'magic_link', - options, - }) - } - - organizeSpaces( - parameters: UnstablePartnerBuildingBlocksOrganizeSpacesParameters, - options: UnstablePartnerBuildingBlocksOrganizeSpacesOptions = {}, - ): UnstablePartnerBuildingBlocksOrganizeSpacesRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/unstable_partner/building_blocks/organize_spaces', - method: 'POST', - body: parameters, - responseKey: 'magic_link', - options, - }) - } -} - -export type UnstablePartnerBuildingBlocksConnectAccountsParameters = - RouteRequestBody<'/unstable_partner/building_blocks/connect_accounts'> - -/** - * @deprecated Use UnstablePartnerBuildingBlocksConnectAccountsParameters instead. - */ -export type UnstablePartnerBuildingBlocksConnectAccountsBody = - UnstablePartnerBuildingBlocksConnectAccountsParameters - -/** - * @deprecated Use UnstablePartnerBuildingBlocksConnectAccountsRequest instead. - */ -export type UnstablePartnerBuildingBlocksConnectAccountsResponse = - RouteResponse<'/unstable_partner/building_blocks/connect_accounts'> - -export type UnstablePartnerBuildingBlocksConnectAccountsRequest = - SeamHttpRequest< - UnstablePartnerBuildingBlocksConnectAccountsResponse, - 'magic_link' - > - -export interface UnstablePartnerBuildingBlocksConnectAccountsOptions {} - -export type UnstablePartnerBuildingBlocksGenerateMagicLinkParameters = - RouteRequestBody<'/unstable_partner/building_blocks/generate_magic_link'> - -/** - * @deprecated Use UnstablePartnerBuildingBlocksGenerateMagicLinkParameters instead. - */ -export type UnstablePartnerBuildingBlocksGenerateMagicLinkParams = - UnstablePartnerBuildingBlocksGenerateMagicLinkParameters - -/** - * @deprecated Use UnstablePartnerBuildingBlocksGenerateMagicLinkRequest instead. - */ -export type UnstablePartnerBuildingBlocksGenerateMagicLinkResponse = - RouteResponse<'/unstable_partner/building_blocks/generate_magic_link'> - -export type UnstablePartnerBuildingBlocksGenerateMagicLinkRequest = - SeamHttpRequest< - UnstablePartnerBuildingBlocksGenerateMagicLinkResponse, - 'magic_link' - > - -export interface UnstablePartnerBuildingBlocksGenerateMagicLinkOptions {} - -export type UnstablePartnerBuildingBlocksManageDevicesParameters = - RouteRequestBody<'/unstable_partner/building_blocks/manage_devices'> - -/** - * @deprecated Use UnstablePartnerBuildingBlocksManageDevicesParameters instead. - */ -export type UnstablePartnerBuildingBlocksManageDevicesBody = - UnstablePartnerBuildingBlocksManageDevicesParameters - -/** - * @deprecated Use UnstablePartnerBuildingBlocksManageDevicesRequest instead. - */ -export type UnstablePartnerBuildingBlocksManageDevicesResponse = - RouteResponse<'/unstable_partner/building_blocks/manage_devices'> - -export type UnstablePartnerBuildingBlocksManageDevicesRequest = SeamHttpRequest< - UnstablePartnerBuildingBlocksManageDevicesResponse, - 'magic_link' -> - -export interface UnstablePartnerBuildingBlocksManageDevicesOptions {} - -export type UnstablePartnerBuildingBlocksOrganizeSpacesParameters = - RouteRequestBody<'/unstable_partner/building_blocks/organize_spaces'> - -/** - * @deprecated Use UnstablePartnerBuildingBlocksOrganizeSpacesParameters instead. - */ -export type UnstablePartnerBuildingBlocksOrganizeSpacesBody = - UnstablePartnerBuildingBlocksOrganizeSpacesParameters - -/** - * @deprecated Use UnstablePartnerBuildingBlocksOrganizeSpacesRequest instead. - */ -export type UnstablePartnerBuildingBlocksOrganizeSpacesResponse = - RouteResponse<'/unstable_partner/building_blocks/organize_spaces'> - -export type UnstablePartnerBuildingBlocksOrganizeSpacesRequest = - SeamHttpRequest< - UnstablePartnerBuildingBlocksOrganizeSpacesResponse, - 'magic_link' - > - -export interface UnstablePartnerBuildingBlocksOrganizeSpacesOptions {} diff --git a/src/lib/seam/connect/routes/unstable-partner/building-blocks/index.ts b/src/lib/seam/connect/routes/unstable-partner/building-blocks/index.ts deleted file mode 100644 index fccad75d..00000000 --- a/src/lib/seam/connect/routes/unstable-partner/building-blocks/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './building-blocks.js' diff --git a/src/lib/seam/connect/routes/unstable-partner/index.ts b/src/lib/seam/connect/routes/unstable-partner/index.ts deleted file mode 100644 index 85ca7e0f..00000000 --- a/src/lib/seam/connect/routes/unstable-partner/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './building-blocks/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 deleted file mode 100644 index 403ff0ba..00000000 --- a/src/lib/seam/connect/routes/unstable-partner/unstable-partner.ts +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -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 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' - -export class SeamHttpUnstablePartner { - 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 = {}, - ): SeamHttpUnstablePartner { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpUnstablePartner(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpUnstablePartner { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpUnstablePartner(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpUnstablePartner { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpUnstablePartner(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 SeamHttpUnstablePartner.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpUnstablePartner.fromClientSessionToken(token, options) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpUnstablePartner { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpUnstablePartner(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpUnstablePartner { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpUnstablePartner(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() - } - - get buildingBlocks(): SeamHttpUnstablePartnerBuildingBlocks { - return SeamHttpUnstablePartnerBuildingBlocks.fromClient( - this.client, - this.defaults, - ) - } -} diff --git a/src/lib/seam/connect/routes/user-identities/enrollment-automations/enrollment-automations.ts b/src/lib/seam/connect/routes/user-identities/enrollment-automations/enrollment-automations.ts deleted file mode 100644 index 443f8643..00000000 --- a/src/lib/seam/connect/routes/user-identities/enrollment-automations/enrollment-automations.ts +++ /dev/null @@ -1,332 +0,0 @@ -/* - * 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' - -export class SeamHttpUserIdentitiesEnrollmentAutomations { - 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 = {}, - ): SeamHttpUserIdentitiesEnrollmentAutomations { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpUserIdentitiesEnrollmentAutomations(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpUserIdentitiesEnrollmentAutomations { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpUserIdentitiesEnrollmentAutomations(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpUserIdentitiesEnrollmentAutomations { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpUserIdentitiesEnrollmentAutomations(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 SeamHttpUserIdentitiesEnrollmentAutomations.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpUserIdentitiesEnrollmentAutomations.fromClientSessionToken( - token, - options, - ) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpUserIdentitiesEnrollmentAutomations { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpUserIdentitiesEnrollmentAutomations(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpUserIdentitiesEnrollmentAutomations { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpUserIdentitiesEnrollmentAutomations(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() - } - - delete( - parameters: UserIdentitiesEnrollmentAutomationsDeleteParameters, - options: UserIdentitiesEnrollmentAutomationsDeleteOptions = {}, - ): UserIdentitiesEnrollmentAutomationsDeleteRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/user_identities/enrollment_automations/delete', - method: 'POST', - body: parameters, - responseKey: undefined, - options, - }) - } - - get( - parameters: UserIdentitiesEnrollmentAutomationsGetParameters, - options: UserIdentitiesEnrollmentAutomationsGetOptions = {}, - ): UserIdentitiesEnrollmentAutomationsGetRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/user_identities/enrollment_automations/get', - method: 'POST', - body: parameters, - responseKey: 'enrollment_automation', - options, - }) - } - - launch( - parameters: UserIdentitiesEnrollmentAutomationsLaunchParameters, - options: UserIdentitiesEnrollmentAutomationsLaunchOptions = {}, - ): UserIdentitiesEnrollmentAutomationsLaunchRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/user_identities/enrollment_automations/launch', - method: 'POST', - body: parameters, - responseKey: 'enrollment_automation', - options, - }) - } - - list( - parameters: UserIdentitiesEnrollmentAutomationsListParameters, - options: UserIdentitiesEnrollmentAutomationsListOptions = {}, - ): UserIdentitiesEnrollmentAutomationsListRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/user_identities/enrollment_automations/list', - method: 'POST', - body: parameters, - responseKey: 'enrollment_automations', - options, - }) - } -} - -export type UserIdentitiesEnrollmentAutomationsDeleteParameters = - RouteRequestBody<'/user_identities/enrollment_automations/delete'> - -/** - * @deprecated Use UserIdentitiesEnrollmentAutomationsDeleteParameters instead. - */ -export type UserIdentitiesEnrollmentAutomationsDeleteParams = - UserIdentitiesEnrollmentAutomationsDeleteParameters - -/** - * @deprecated Use UserIdentitiesEnrollmentAutomationsDeleteRequest instead. - */ -export type UserIdentitiesEnrollmentAutomationsDeleteResponse = - RouteResponse<'/user_identities/enrollment_automations/delete'> - -export type UserIdentitiesEnrollmentAutomationsDeleteRequest = SeamHttpRequest< - void, - undefined -> - -export interface UserIdentitiesEnrollmentAutomationsDeleteOptions {} - -export type UserIdentitiesEnrollmentAutomationsGetParameters = - RouteRequestBody<'/user_identities/enrollment_automations/get'> - -/** - * @deprecated Use UserIdentitiesEnrollmentAutomationsGetParameters instead. - */ -export type UserIdentitiesEnrollmentAutomationsGetParams = - UserIdentitiesEnrollmentAutomationsGetParameters - -/** - * @deprecated Use UserIdentitiesEnrollmentAutomationsGetRequest instead. - */ -export type UserIdentitiesEnrollmentAutomationsGetResponse = - RouteResponse<'/user_identities/enrollment_automations/get'> - -export type UserIdentitiesEnrollmentAutomationsGetRequest = SeamHttpRequest< - UserIdentitiesEnrollmentAutomationsGetResponse, - 'enrollment_automation' -> - -export interface UserIdentitiesEnrollmentAutomationsGetOptions {} - -export type UserIdentitiesEnrollmentAutomationsLaunchParameters = - RouteRequestBody<'/user_identities/enrollment_automations/launch'> - -/** - * @deprecated Use UserIdentitiesEnrollmentAutomationsLaunchParameters instead. - */ -export type UserIdentitiesEnrollmentAutomationsLaunchBody = - UserIdentitiesEnrollmentAutomationsLaunchParameters - -/** - * @deprecated Use UserIdentitiesEnrollmentAutomationsLaunchRequest instead. - */ -export type UserIdentitiesEnrollmentAutomationsLaunchResponse = - RouteResponse<'/user_identities/enrollment_automations/launch'> - -export type UserIdentitiesEnrollmentAutomationsLaunchRequest = SeamHttpRequest< - UserIdentitiesEnrollmentAutomationsLaunchResponse, - 'enrollment_automation' -> - -export interface UserIdentitiesEnrollmentAutomationsLaunchOptions {} - -export type UserIdentitiesEnrollmentAutomationsListParameters = - RouteRequestBody<'/user_identities/enrollment_automations/list'> - -/** - * @deprecated Use UserIdentitiesEnrollmentAutomationsListParameters instead. - */ -export type UserIdentitiesEnrollmentAutomationsListParams = - UserIdentitiesEnrollmentAutomationsListParameters - -/** - * @deprecated Use UserIdentitiesEnrollmentAutomationsListRequest instead. - */ -export type UserIdentitiesEnrollmentAutomationsListResponse = - RouteResponse<'/user_identities/enrollment_automations/list'> - -export type UserIdentitiesEnrollmentAutomationsListRequest = SeamHttpRequest< - UserIdentitiesEnrollmentAutomationsListResponse, - 'enrollment_automations' -> - -export interface UserIdentitiesEnrollmentAutomationsListOptions {} diff --git a/src/lib/seam/connect/routes/user-identities/enrollment-automations/index.ts b/src/lib/seam/connect/routes/user-identities/enrollment-automations/index.ts deleted file mode 100644 index a5cf36fd..00000000 --- a/src/lib/seam/connect/routes/user-identities/enrollment-automations/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './enrollment-automations.js' diff --git a/src/lib/seam/connect/routes/user-identities/index.ts b/src/lib/seam/connect/routes/user-identities/index.ts index cd8f04b7..ba7de1d2 100644 --- a/src/lib/seam/connect/routes/user-identities/index.ts +++ b/src/lib/seam/connect/routes/user-identities/index.ts @@ -3,6 +3,5 @@ * Do not edit this file or add other files to this directory. */ -export * from './enrollment-automations/index.js' export * from './unmanaged/index.js' export * from './user-identities.js' diff --git a/src/lib/seam/connect/routes/user-identities/unmanaged/unmanaged.ts b/src/lib/seam/connect/routes/user-identities/unmanaged/unmanaged.ts index 307cb064..052726ed 100644 --- a/src/lib/seam/connect/routes/user-identities/unmanaged/unmanaged.ts +++ b/src/lib/seam/connect/routes/user-identities/unmanaged/unmanaged.ts @@ -29,7 +29,7 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { UnknownResource } from 'lib/seam/connect/resources/unknown.js' +import type { UnmanagedUserIdentity } from 'lib/seam/connect/resources/unmanaged-user-identity.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' @@ -208,17 +208,11 @@ export type UserIdentitiesUnmanagedGetParameters = { user_identity_id: string } -/** - * @deprecated Use UserIdentitiesUnmanagedGetParameters instead. - */ -export type UserIdentitiesUnmanagedGetParams = - UserIdentitiesUnmanagedGetParameters - /** * @deprecated Use UserIdentitiesUnmanagedGetRequest instead. */ export type UserIdentitiesUnmanagedGetResponse = { - user_identity: UnknownResource + user_identity: UnmanagedUserIdentity } export type UserIdentitiesUnmanagedGetRequest = SeamHttpRequest< @@ -235,17 +229,11 @@ export type UserIdentitiesUnmanagedListParameters = { search?: string | undefined } -/** - * @deprecated Use UserIdentitiesUnmanagedListParameters instead. - */ -export type UserIdentitiesUnmanagedListParams = - UserIdentitiesUnmanagedListParameters - /** * @deprecated Use UserIdentitiesUnmanagedListRequest instead. */ export type UserIdentitiesUnmanagedListResponse = { - user_identities: Array + user_identities: Array } export type UserIdentitiesUnmanagedListRequest = SeamHttpRequest< @@ -263,12 +251,6 @@ export type UserIdentitiesUnmanagedUpdateParameters = { user_identity_key?: string | undefined } -/** - * @deprecated Use UserIdentitiesUnmanagedUpdateParameters instead. - */ -export type UserIdentitiesUnmanagedUpdateBody = - UserIdentitiesUnmanagedUpdateParameters - /** * @deprecated Use UserIdentitiesUnmanagedUpdateRequest instead. */ diff --git a/src/lib/seam/connect/routes/user-identities/user-identities.ts b/src/lib/seam/connect/routes/user-identities/user-identities.ts index 78ebed85..c243c03d 100644 --- a/src/lib/seam/connect/routes/user-identities/user-identities.ts +++ b/src/lib/seam/connect/routes/user-identities/user-identities.ts @@ -29,17 +29,16 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { AcsEntranceResource } from 'lib/seam/connect/resources/acs-entrance.js' -import type { AcsSystemResource } from 'lib/seam/connect/resources/acs-system.js' -import type { AcsUserResource } from 'lib/seam/connect/resources/acs-user.js' -import type { DeviceResource } from 'lib/seam/connect/resources/device.js' -import type { InstantKeyResource } from 'lib/seam/connect/resources/instant-key.js' -import type { UserIdentityResource } from 'lib/seam/connect/resources/user-identity.js' +import type { AcsEntrance } from 'lib/seam/connect/resources/acs-entrance.js' +import type { AcsSystem } from 'lib/seam/connect/resources/acs-system.js' +import type { AcsUser } from 'lib/seam/connect/resources/acs-user.js' +import type { Device } from 'lib/seam/connect/resources/device.js' +import type { InstantKey } from 'lib/seam/connect/resources/instant-key.js' +import type { UserIdentity } from 'lib/seam/connect/resources/user-identity.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 { SeamHttpUserIdentitiesEnrollmentAutomations } from './enrollment-automations/index.js' import { SeamHttpUserIdentitiesUnmanaged } from './unmanaged/index.js' export class SeamHttpUserIdentities { @@ -169,13 +168,6 @@ export class SeamHttpUserIdentities { await clientSessions.get() } - get enrollmentAutomations(): SeamHttpUserIdentitiesEnrollmentAutomations { - return SeamHttpUserIdentitiesEnrollmentAutomations.fromClient( - this.client, - this.defaults, - ) - } - get unmanaged(): SeamHttpUserIdentitiesUnmanaged { return SeamHttpUserIdentitiesUnmanaged.fromClient( this.client, @@ -373,11 +365,6 @@ export type UserIdentitiesAddAcsUserParameters = { user_identity_key?: string | undefined } -/** - * @deprecated Use UserIdentitiesAddAcsUserParameters instead. - */ -export type UserIdentitiesAddAcsUserBody = UserIdentitiesAddAcsUserParameters - /** * @deprecated Use UserIdentitiesAddAcsUserRequest instead. */ @@ -395,17 +382,10 @@ export type UserIdentitiesCreateParameters = { user_identity_key?: string | undefined } -/** - * @deprecated Use UserIdentitiesCreateParameters instead. - */ -export type UserIdentitiesCreateBody = UserIdentitiesCreateParameters - /** * @deprecated Use UserIdentitiesCreateRequest instead. */ -export type UserIdentitiesCreateResponse = { - user_identity: UserIdentityResource -} +export type UserIdentitiesCreateResponse = { user_identity: UserIdentity } export type UserIdentitiesCreateRequest = SeamHttpRequest< UserIdentitiesCreateResponse, @@ -418,11 +398,6 @@ export type UserIdentitiesDeleteParameters = { user_identity_id: string } -/** - * @deprecated Use UserIdentitiesDeleteParameters instead. - */ -export type UserIdentitiesDeleteParams = UserIdentitiesDeleteParameters - /** * @deprecated Use UserIdentitiesDeleteRequest instead. */ @@ -438,17 +413,11 @@ export type UserIdentitiesGenerateInstantKeyParameters = { user_identity_id: string } -/** - * @deprecated Use UserIdentitiesGenerateInstantKeyParameters instead. - */ -export type UserIdentitiesGenerateInstantKeyBody = - UserIdentitiesGenerateInstantKeyParameters - /** * @deprecated Use UserIdentitiesGenerateInstantKeyRequest instead. */ export type UserIdentitiesGenerateInstantKeyResponse = { - instant_key: InstantKeyResource + instant_key: InstantKey } export type UserIdentitiesGenerateInstantKeyRequest = SeamHttpRequest< @@ -463,15 +432,10 @@ export type UserIdentitiesGetParameters = { user_identity_key?: string | undefined } -/** - * @deprecated Use UserIdentitiesGetParameters instead. - */ -export type UserIdentitiesGetParams = UserIdentitiesGetParameters - /** * @deprecated Use UserIdentitiesGetRequest instead. */ -export type UserIdentitiesGetResponse = { user_identity: UserIdentityResource } +export type UserIdentitiesGetResponse = { user_identity: UserIdentity } export type UserIdentitiesGetRequest = SeamHttpRequest< UserIdentitiesGetResponse, @@ -486,12 +450,6 @@ export type UserIdentitiesGrantAccessToDeviceParameters = { user_identity_id: string } -/** - * @deprecated Use UserIdentitiesGrantAccessToDeviceParameters instead. - */ -export type UserIdentitiesGrantAccessToDeviceBody = - UserIdentitiesGrantAccessToDeviceParameters - /** * @deprecated Use UserIdentitiesGrantAccessToDeviceRequest instead. */ @@ -513,16 +471,11 @@ export type UserIdentitiesListParameters = { user_identity_ids?: Array | undefined } -/** - * @deprecated Use UserIdentitiesListParameters instead. - */ -export type UserIdentitiesListParams = UserIdentitiesListParameters - /** * @deprecated Use UserIdentitiesListRequest instead. */ export type UserIdentitiesListResponse = { - user_identities: Array + user_identities: Array } export type UserIdentitiesListRequest = SeamHttpRequest< @@ -536,17 +489,11 @@ export type UserIdentitiesListAccessibleDevicesParameters = { user_identity_id: string } -/** - * @deprecated Use UserIdentitiesListAccessibleDevicesParameters instead. - */ -export type UserIdentitiesListAccessibleDevicesParams = - UserIdentitiesListAccessibleDevicesParameters - /** * @deprecated Use UserIdentitiesListAccessibleDevicesRequest instead. */ export type UserIdentitiesListAccessibleDevicesResponse = { - devices: Array + devices: Array } export type UserIdentitiesListAccessibleDevicesRequest = SeamHttpRequest< @@ -560,17 +507,11 @@ export type UserIdentitiesListAccessibleEntrancesParameters = { user_identity_id: string } -/** - * @deprecated Use UserIdentitiesListAccessibleEntrancesParameters instead. - */ -export type UserIdentitiesListAccessibleEntrancesParams = - UserIdentitiesListAccessibleEntrancesParameters - /** * @deprecated Use UserIdentitiesListAccessibleEntrancesRequest instead. */ export type UserIdentitiesListAccessibleEntrancesResponse = { - acs_entrances: Array + acs_entrances: Array } export type UserIdentitiesListAccessibleEntrancesRequest = SeamHttpRequest< @@ -584,17 +525,11 @@ export type UserIdentitiesListAcsSystemsParameters = { user_identity_id: string } -/** - * @deprecated Use UserIdentitiesListAcsSystemsParameters instead. - */ -export type UserIdentitiesListAcsSystemsParams = - UserIdentitiesListAcsSystemsParameters - /** * @deprecated Use UserIdentitiesListAcsSystemsRequest instead. */ export type UserIdentitiesListAcsSystemsResponse = { - acs_systems: Array + acs_systems: Array } export type UserIdentitiesListAcsSystemsRequest = SeamHttpRequest< @@ -608,18 +543,10 @@ export type UserIdentitiesListAcsUsersParameters = { user_identity_id: string } -/** - * @deprecated Use UserIdentitiesListAcsUsersParameters instead. - */ -export type UserIdentitiesListAcsUsersParams = - UserIdentitiesListAcsUsersParameters - /** * @deprecated Use UserIdentitiesListAcsUsersRequest instead. */ -export type UserIdentitiesListAcsUsersResponse = { - acs_users: Array -} +export type UserIdentitiesListAcsUsersResponse = { acs_users: Array } export type UserIdentitiesListAcsUsersRequest = SeamHttpRequest< UserIdentitiesListAcsUsersResponse, @@ -634,12 +561,6 @@ export type UserIdentitiesRemoveAcsUserParameters = { user_identity_id: string } -/** - * @deprecated Use UserIdentitiesRemoveAcsUserParameters instead. - */ -export type UserIdentitiesRemoveAcsUserParams = - UserIdentitiesRemoveAcsUserParameters - /** * @deprecated Use UserIdentitiesRemoveAcsUserRequest instead. */ @@ -658,12 +579,6 @@ export type UserIdentitiesRevokeAccessToDeviceParameters = { user_identity_id: string } -/** - * @deprecated Use UserIdentitiesRevokeAccessToDeviceParameters instead. - */ -export type UserIdentitiesRevokeAccessToDeviceParams = - UserIdentitiesRevokeAccessToDeviceParameters - /** * @deprecated Use UserIdentitiesRevokeAccessToDeviceRequest instead. */ @@ -685,11 +600,6 @@ export type UserIdentitiesUpdateParameters = { user_identity_key?: string | undefined } -/** - * @deprecated Use UserIdentitiesUpdateParameters instead. - */ -export type UserIdentitiesUpdateBody = UserIdentitiesUpdateParameters - /** * @deprecated Use UserIdentitiesUpdateRequest instead. */ diff --git a/src/lib/seam/connect/routes/webhooks/webhooks.ts b/src/lib/seam/connect/routes/webhooks/webhooks.ts index 1bb33cf0..f3a63d09 100644 --- a/src/lib/seam/connect/routes/webhooks/webhooks.ts +++ b/src/lib/seam/connect/routes/webhooks/webhooks.ts @@ -29,7 +29,7 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { WebhookResource } from 'lib/seam/connect/resources/webhook.js' +import type { Webhook } from 'lib/seam/connect/resources/webhook.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' @@ -232,15 +232,10 @@ export type WebhooksCreateParameters = { url: string } -/** - * @deprecated Use WebhooksCreateParameters instead. - */ -export type WebhooksCreateBody = WebhooksCreateParameters - /** * @deprecated Use WebhooksCreateRequest instead. */ -export type WebhooksCreateResponse = { webhook: WebhookResource } +export type WebhooksCreateResponse = { webhook: Webhook } export type WebhooksCreateRequest = SeamHttpRequest< WebhooksCreateResponse, @@ -253,11 +248,6 @@ export type WebhooksDeleteParameters = { webhook_id: string } -/** - * @deprecated Use WebhooksDeleteParameters instead. - */ -export type WebhooksDeleteParams = WebhooksDeleteParameters - /** * @deprecated Use WebhooksDeleteRequest instead. */ @@ -271,15 +261,10 @@ export type WebhooksGetParameters = { webhook_id: string } -/** - * @deprecated Use WebhooksGetParameters instead. - */ -export type WebhooksGetParams = WebhooksGetParameters - /** * @deprecated Use WebhooksGetRequest instead. */ -export type WebhooksGetResponse = { webhook: WebhookResource } +export type WebhooksGetResponse = { webhook: Webhook } export type WebhooksGetRequest = SeamHttpRequest @@ -287,15 +272,10 @@ export interface WebhooksGetOptions {} export type WebhooksListParameters = {} -/** - * @deprecated Use WebhooksListParameters instead. - */ -export type WebhooksListParams = WebhooksListParameters - /** * @deprecated Use WebhooksListRequest instead. */ -export type WebhooksListResponse = { webhooks: Array } +export type WebhooksListResponse = { webhooks: Array } export type WebhooksListRequest = SeamHttpRequest< WebhooksListResponse, @@ -310,11 +290,6 @@ export type WebhooksUpdateParameters = { webhook_id: string } -/** - * @deprecated Use WebhooksUpdateParameters instead. - */ -export type WebhooksUpdateBody = WebhooksUpdateParameters - /** * @deprecated Use WebhooksUpdateRequest instead. */ diff --git a/src/lib/seam/connect/routes/workspaces/customization-profiles/customization-profiles.ts b/src/lib/seam/connect/routes/workspaces/customization-profiles/customization-profiles.ts deleted file mode 100644 index 3413ab90..00000000 --- a/src/lib/seam/connect/routes/workspaces/customization-profiles/customization-profiles.ts +++ /dev/null @@ -1,370 +0,0 @@ -/* - * 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' - -export class SeamHttpWorkspacesCustomizationProfiles { - 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 = {}, - ): SeamHttpWorkspacesCustomizationProfiles { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttpWorkspacesCustomizationProfiles(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttpWorkspacesCustomizationProfiles { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttpWorkspacesCustomizationProfiles(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttpWorkspacesCustomizationProfiles { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttpWorkspacesCustomizationProfiles(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 SeamHttpWorkspacesCustomizationProfiles.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttpWorkspacesCustomizationProfiles.fromClientSessionToken( - token, - options, - ) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttpWorkspacesCustomizationProfiles { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttpWorkspacesCustomizationProfiles(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttpWorkspacesCustomizationProfiles { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttpWorkspacesCustomizationProfiles(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?: WorkspacesCustomizationProfilesCreateParameters, - options: WorkspacesCustomizationProfilesCreateOptions = {}, - ): WorkspacesCustomizationProfilesCreateRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/workspaces/customization_profiles/create', - method: 'POST', - body: parameters, - responseKey: 'customization_profile', - options, - }) - } - - get( - parameters: WorkspacesCustomizationProfilesGetParameters, - options: WorkspacesCustomizationProfilesGetOptions = {}, - ): WorkspacesCustomizationProfilesGetRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/workspaces/customization_profiles/get', - method: 'POST', - body: parameters, - responseKey: 'customization_profile', - options, - }) - } - - list( - parameters?: WorkspacesCustomizationProfilesListParameters, - options: WorkspacesCustomizationProfilesListOptions = {}, - ): WorkspacesCustomizationProfilesListRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/workspaces/customization_profiles/list', - method: 'POST', - body: parameters, - responseKey: 'customization_profiles', - options, - }) - } - - update( - parameters: WorkspacesCustomizationProfilesUpdateParameters, - options: WorkspacesCustomizationProfilesUpdateOptions = {}, - ): WorkspacesCustomizationProfilesUpdateRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/workspaces/customization_profiles/update', - method: 'PATCH', - body: parameters, - responseKey: undefined, - options, - }) - } - - uploadImages( - parameters?: WorkspacesCustomizationProfilesUploadImagesParameters, - options: WorkspacesCustomizationProfilesUploadImagesOptions = {}, - ): WorkspacesCustomizationProfilesUploadImagesRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/workspaces/customization_profiles/upload_images', - method: 'POST', - body: parameters, - responseKey: undefined, - options, - }) - } -} - -export type WorkspacesCustomizationProfilesCreateParameters = - RouteRequestBody<'/workspaces/customization_profiles/create'> - -/** - * @deprecated Use WorkspacesCustomizationProfilesCreateParameters instead. - */ -export type WorkspacesCustomizationProfilesCreateBody = - WorkspacesCustomizationProfilesCreateParameters - -/** - * @deprecated Use WorkspacesCustomizationProfilesCreateRequest instead. - */ -export type WorkspacesCustomizationProfilesCreateResponse = - RouteResponse<'/workspaces/customization_profiles/create'> - -export type WorkspacesCustomizationProfilesCreateRequest = SeamHttpRequest< - WorkspacesCustomizationProfilesCreateResponse, - 'customization_profile' -> - -export interface WorkspacesCustomizationProfilesCreateOptions {} - -export type WorkspacesCustomizationProfilesGetParameters = - RouteRequestBody<'/workspaces/customization_profiles/get'> - -/** - * @deprecated Use WorkspacesCustomizationProfilesGetParameters instead. - */ -export type WorkspacesCustomizationProfilesGetParams = - WorkspacesCustomizationProfilesGetParameters - -/** - * @deprecated Use WorkspacesCustomizationProfilesGetRequest instead. - */ -export type WorkspacesCustomizationProfilesGetResponse = - RouteResponse<'/workspaces/customization_profiles/get'> - -export type WorkspacesCustomizationProfilesGetRequest = SeamHttpRequest< - WorkspacesCustomizationProfilesGetResponse, - 'customization_profile' -> - -export interface WorkspacesCustomizationProfilesGetOptions {} - -export type WorkspacesCustomizationProfilesListParameters = - RouteRequestBody<'/workspaces/customization_profiles/list'> - -/** - * @deprecated Use WorkspacesCustomizationProfilesListParameters instead. - */ -export type WorkspacesCustomizationProfilesListParams = - WorkspacesCustomizationProfilesListParameters - -/** - * @deprecated Use WorkspacesCustomizationProfilesListRequest instead. - */ -export type WorkspacesCustomizationProfilesListResponse = - RouteResponse<'/workspaces/customization_profiles/list'> - -export type WorkspacesCustomizationProfilesListRequest = SeamHttpRequest< - WorkspacesCustomizationProfilesListResponse, - 'customization_profiles' -> - -export interface WorkspacesCustomizationProfilesListOptions {} - -export type WorkspacesCustomizationProfilesUpdateParameters = - RouteRequestBody<'/workspaces/customization_profiles/update'> - -/** - * @deprecated Use WorkspacesCustomizationProfilesUpdateParameters instead. - */ -export type WorkspacesCustomizationProfilesUpdateBody = - WorkspacesCustomizationProfilesUpdateParameters - -/** - * @deprecated Use WorkspacesCustomizationProfilesUpdateRequest instead. - */ -export type WorkspacesCustomizationProfilesUpdateResponse = - RouteResponse<'/workspaces/customization_profiles/update'> - -export type WorkspacesCustomizationProfilesUpdateRequest = SeamHttpRequest< - void, - undefined -> - -export interface WorkspacesCustomizationProfilesUpdateOptions {} - -export type WorkspacesCustomizationProfilesUploadImagesParameters = - RouteRequestBody<'/workspaces/customization_profiles/upload_images'> - -/** - * @deprecated Use WorkspacesCustomizationProfilesUploadImagesParameters instead. - */ -export type WorkspacesCustomizationProfilesUploadImagesBody = - WorkspacesCustomizationProfilesUploadImagesParameters - -/** - * @deprecated Use WorkspacesCustomizationProfilesUploadImagesRequest instead. - */ -export type WorkspacesCustomizationProfilesUploadImagesResponse = - RouteResponse<'/workspaces/customization_profiles/upload_images'> - -export type WorkspacesCustomizationProfilesUploadImagesRequest = - SeamHttpRequest - -export interface WorkspacesCustomizationProfilesUploadImagesOptions {} diff --git a/src/lib/seam/connect/routes/workspaces/customization-profiles/index.ts b/src/lib/seam/connect/routes/workspaces/customization-profiles/index.ts deleted file mode 100644 index b66419e4..00000000 --- a/src/lib/seam/connect/routes/workspaces/customization-profiles/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Automatically generated by codegen/smith.ts. - * Do not edit this file or add other files to this directory. - */ - -export * from './customization-profiles.js' diff --git a/src/lib/seam/connect/routes/workspaces/index.ts b/src/lib/seam/connect/routes/workspaces/index.ts index 3c0fdf26..b420eebf 100644 --- a/src/lib/seam/connect/routes/workspaces/index.ts +++ b/src/lib/seam/connect/routes/workspaces/index.ts @@ -3,5 +3,4 @@ * Do not edit this file or add other files to this directory. */ -export * from './customization-profiles/index.js' export * from './workspaces.js' diff --git a/src/lib/seam/connect/routes/workspaces/workspaces.ts b/src/lib/seam/connect/routes/workspaces/workspaces.ts index 72182eef..a8145330 100644 --- a/src/lib/seam/connect/routes/workspaces/workspaces.ts +++ b/src/lib/seam/connect/routes/workspaces/workspaces.ts @@ -3,8 +3,6 @@ * 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, @@ -31,13 +29,12 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' -import type { WorkspaceResource } from 'lib/seam/connect/resources/workspace.js' +import type { ActionAttempt } from 'lib/seam/connect/resources/action-attempt.js' +import type { Workspace } from 'lib/seam/connect/resources/workspace.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 { SeamHttpWorkspacesCustomizationProfiles } from './customization-profiles/index.js' - export class SeamHttpWorkspaces { client: Client readonly defaults: Required @@ -165,13 +162,6 @@ export class SeamHttpWorkspaces { await clientSessions.get() } - get customizationProfiles(): SeamHttpWorkspacesCustomizationProfiles { - return SeamHttpWorkspacesCustomizationProfiles.fromClient( - this.client, - this.defaults, - ) - } - create( parameters: WorkspacesCreateParameters, options: WorkspacesCreateOptions = {}, @@ -185,24 +175,6 @@ export class SeamHttpWorkspaces { }) } - findAnything( - parameters: WorkspacesFindAnythingParameters, - options: WorkspacesFindAnythingOptions = {}, - ): WorkspacesFindAnythingRequest { - if (!this.defaults.isUndocumentedApiEnabled) { - throw new Error( - 'Cannot use undocumented API without isUndocumentedApiEnabled', - ) - } - return new SeamHttpRequest(this, { - pathname: '/workspaces/find_anything', - method: 'POST', - body: parameters, - responseKey: 'batch', - options, - }) - } - get( parameters?: WorkspacesGetParameters, options: WorkspacesGetOptions = {}, @@ -277,15 +249,10 @@ export type WorkspacesCreateParameters = { webview_success_message?: string | undefined } -/** - * @deprecated Use WorkspacesCreateParameters instead. - */ -export type WorkspacesCreateBody = WorkspacesCreateParameters - /** * @deprecated Use WorkspacesCreateRequest instead. */ -export type WorkspacesCreateResponse = { workspace: WorkspaceResource } +export type WorkspacesCreateResponse = { workspace: Workspace } export type WorkspacesCreateRequest = SeamHttpRequest< WorkspacesCreateResponse, @@ -294,38 +261,12 @@ export type WorkspacesCreateRequest = SeamHttpRequest< export interface WorkspacesCreateOptions {} -export type WorkspacesFindAnythingParameters = - RouteRequestBody<'/workspaces/find_anything'> - -/** - * @deprecated Use WorkspacesFindAnythingParameters instead. - */ -export type WorkspacesFindAnythingParams = WorkspacesFindAnythingParameters - -/** - * @deprecated Use WorkspacesFindAnythingRequest instead. - */ -export type WorkspacesFindAnythingResponse = - RouteResponse<'/workspaces/find_anything'> - -export type WorkspacesFindAnythingRequest = SeamHttpRequest< - WorkspacesFindAnythingResponse, - 'batch' -> - -export interface WorkspacesFindAnythingOptions {} - export type WorkspacesGetParameters = {} -/** - * @deprecated Use WorkspacesGetParameters instead. - */ -export type WorkspacesGetParams = WorkspacesGetParameters - /** * @deprecated Use WorkspacesGetRequest instead. */ -export type WorkspacesGetResponse = { workspace: WorkspaceResource } +export type WorkspacesGetResponse = { workspace: Workspace } export type WorkspacesGetRequest = SeamHttpRequest< WorkspacesGetResponse, @@ -336,15 +277,10 @@ export interface WorkspacesGetOptions {} export type WorkspacesListParameters = {} -/** - * @deprecated Use WorkspacesListParameters instead. - */ -export type WorkspacesListParams = WorkspacesListParameters - /** * @deprecated Use WorkspacesListRequest instead. */ -export type WorkspacesListResponse = { workspaces: Array } +export type WorkspacesListResponse = { workspaces: Array } export type WorkspacesListRequest = SeamHttpRequest< WorkspacesListResponse, @@ -355,16 +291,10 @@ export interface WorkspacesListOptions {} export type WorkspacesResetSandboxParameters = {} -/** - * @deprecated Use WorkspacesResetSandboxParameters instead. - */ -export type WorkspacesResetSandboxBody = WorkspacesResetSandboxParameters - /** * @deprecated Use WorkspacesResetSandboxRequest instead. */ -export type WorkspacesResetSandboxResponse = - RouteResponse<'/workspaces/reset_sandbox'> +export type WorkspacesResetSandboxResponse = { action_attempt: ActionAttempt } export type WorkspacesResetSandboxRequest = SeamHttpRequest< WorkspacesResetSandboxResponse, @@ -392,11 +322,6 @@ export type WorkspacesUpdateParameters = { organization_id?: string | undefined } -/** - * @deprecated Use WorkspacesUpdateParameters instead. - */ -export type WorkspacesUpdateBody = WorkspacesUpdateParameters - /** * @deprecated Use WorkspacesUpdateRequest instead. */ diff --git a/src/lib/seam/connect/seam-http-request.ts b/src/lib/seam/connect/seam-http-request.ts index 5c959762..f83190af 100644 --- a/src/lib/seam/connect/seam-http-request.ts +++ b/src/lib/seam/connect/seam-http-request.ts @@ -1,10 +1,10 @@ -import type { ActionAttempt } from '@seamapi/types/connect' import { serializeUrlSearchParams } from '@seamapi/url-search-params-serializer' import type { Method } from 'axios' import type { Client } from './client.js' import type { SeamHttpRequestOptions } from './options.js' import { resolveActionAttempt } from './resolve-action-attempt.js' +import type { ActionAttempt } from './resources/action-attempt.js' import { SeamHttpActionAttempts } from './routes/index.js' interface SeamHttpRequestParent { diff --git a/test/seam/connect/client.test.ts b/test/seam/connect/client.test.ts index c94d54df..8c19818c 100644 --- a/test/seam/connect/client.test.ts +++ b/test/seam/connect/client.test.ts @@ -3,7 +3,7 @@ import { getTestServer } from 'fixtures/seam/connect/api.js' import { type DevicesGetResponse, - type DevicesListParams, + type DevicesListParameters, type DevicesListResponse, SeamHttp, SeamHttpWithoutWorkspace, @@ -55,7 +55,7 @@ test('SeamHttp: client serializes array params', async (t) => { const seam = new SeamHttp({ client: SeamHttp.fromApiKey(seed.seam_apikey1_token, { endpoint }).client, }) - const params: DevicesListParams = { + const params: DevicesListParameters = { device_ids: [seed.august_device_1], } const { diff --git a/test/seam/connect/undocumented.test.ts b/test/seam/connect/undocumented.test.ts deleted file mode 100644 index 7c6b0cfb..00000000 --- a/test/seam/connect/undocumented.test.ts +++ /dev/null @@ -1,96 +0,0 @@ -import test from 'ava' -import { AxiosError } from 'axios' -import { getTestServer } from 'fixtures/seam/connect/api.js' - -import { - SeamHttp, - SeamHttpAcsAccessGroupsUnmanaged, - SeamHttpEndpoints, -} from '@seamapi/http/connect' - -test('SeamHttp: must use isUndocumentedApiEnabled to use undocumented route', async (t) => { - const { seed, endpoint } = await getTestServer(t) - const seam = SeamHttp.fromApiKey(seed.seam_apikey1_token, { endpoint }) - t.throws(() => seam.acs.accessGroups.unmanaged, { - message: /Cannot use undocumented/, - }) - const seamUndocumented = SeamHttp.fromApiKey(seed.seam_apikey1_token, { - endpoint, - isUndocumentedApiEnabled: true, - }) - t.truthy(seamUndocumented.acs.accessGroups.unmanaged) -}) - -test('SeamHttp: must use isUndocumentedApiEnabled to use undocumented endpoint', async (t) => { - const { seed, endpoint } = await getTestServer(t) - const seam = SeamHttp.fromApiKey(seed.seam_apikey1_token, { endpoint }) - t.truthy(seam.devices) - await t.throwsAsync( - async () => { - await seam.devices.delete({ device_id: seed.august_device_1 }) - }, - { - message: /Cannot use undocumented/, - }, - ) - const seamUndocumented = SeamHttp.fromApiKey(seed.seam_apikey1_token, { - endpoint, - isUndocumentedApiEnabled: true, - }) - t.truthy(seamUndocumented.devices) - await seamUndocumented.devices.delete({ device_id: seed.august_device_1 }) - t.pass() -}) - -test('SeamHttpAcsAccessGroupsUnmanaged: must use isUndocumentedApiEnabled', async (t) => { - const { seed, endpoint } = await getTestServer(t) - t.throws( - () => { - SeamHttpAcsAccessGroupsUnmanaged.fromApiKey(seed.seam_apikey1_token, { - endpoint, - }) - }, - { message: /Cannot use undocumented/ }, - ) - t.truthy( - SeamHttpAcsAccessGroupsUnmanaged.fromApiKey(seed.seam_apikey1_token, { - endpoint, - isUndocumentedApiEnabled: true, - }), - ) -}) - -test('SeamHttpEndpoints: cannot use undocumented endpoint', async (t) => { - const { seed, endpoint } = await getTestServer(t) - const seam = SeamHttpEndpoints.fromApiKey(seed.seam_apikey1_token, { - endpoint, - }) - await t.throwsAsync( - async () => { - await seam['/acs/access_groups/unmanaged/list']() - }, - { message: /Cannot use undocumented/ }, - ) - const seamUndocumented = SeamHttpEndpoints.fromApiKey( - seed.seam_apikey1_token, - { - endpoint, - isUndocumentedApiEnabled: true, - }, - ) - await t.throwsAsync( - async () => { - await seamUndocumented['/acs/access_groups/unmanaged/list']() - }, - { - instanceOf: AxiosError, - }, - ) -}) - -test.todo( - 'SeamHttpWithoutWorkspace: must use isUndocumentedApiEnabled to use undocumented route', -) -test.todo( - 'SeamHttpWithoutWorkspace: must use isUndocumentedApiEnabled to use undocumented endpoint', -)