From 9201258046dda484deabbae01f9d708388ddae0c Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Thu, 12 Jun 2025 19:12:34 -0700 Subject: [PATCH 1/2] Generate routes with blueprint and smith --- .gitignore | 3 + .prettierignore | 223 ++++ codegen/content/CODEGEN.md | 1 + codegen/index.ts | 1 + codegen/layouts/default.hbs | 1 + .../partials/route-class-endpoint-export.hbs | 7 + .../layouts/partials/route-class-endpoint.hbs | 13 + .../layouts/partials/route-class-methods.hbs | 125 ++ .../layouts/partials/route-class-subroute.hbs | 3 + codegen/layouts/partials/route-imports.hbs | 47 + codegen/layouts/route-index.hbs | 8 + codegen/layouts/route.hbs | 25 + codegen/lib/connect.ts | 84 ++ codegen/lib/handlebars-helpers.ts | 1 + codegen/lib/index.ts | 7 + codegen/lib/layouts/route.ts | 153 +++ codegen/smith.ts | 36 + generate-routes.ts | 637 --------- package-lock.json | 1150 ++++++++++++----- package.json | 16 +- src/lib/seam/connect/index.ts | 1 - src/lib/seam/connect/seam-http.ts | 246 ---- tsconfig.json | 5 +- 23 files changed, 1586 insertions(+), 1207 deletions(-) create mode 100644 .prettierignore create mode 100644 codegen/content/CODEGEN.md create mode 100644 codegen/index.ts create mode 100644 codegen/layouts/default.hbs create mode 100644 codegen/layouts/partials/route-class-endpoint-export.hbs create mode 100644 codegen/layouts/partials/route-class-endpoint.hbs create mode 100644 codegen/layouts/partials/route-class-methods.hbs create mode 100644 codegen/layouts/partials/route-class-subroute.hbs create mode 100644 codegen/layouts/partials/route-imports.hbs create mode 100644 codegen/layouts/route-index.hbs create mode 100644 codegen/layouts/route.hbs create mode 100644 codegen/lib/connect.ts create mode 100644 codegen/lib/handlebars-helpers.ts create mode 100644 codegen/lib/index.ts create mode 100644 codegen/lib/layouts/route.ts create mode 100644 codegen/smith.ts delete mode 100644 generate-routes.ts delete mode 100644 src/lib/seam/connect/seam-http.ts diff --git a/.gitignore b/.gitignore index 58a8d22f..f3404660 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,9 @@ !src/**/*.d.ts !ava.config.js +# Codegen +CODEGEN.md + # Build directories docs package diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..0322888e --- /dev/null +++ b/.prettierignore @@ -0,0 +1,223 @@ +# Parts of this file were adapted from +# GitHub’s collection of .gitignore file templates +# which are Copyright (c) 2023 GitHub, Inc. +# and released under the MIT License. +# For more details, visit the project page: +# https://github.com/github/gitignore + +# TypeScript build output +*.d.ts +*.js +*.js.map +!src/**/*.d.ts +!ava.config.js + +# Build directories +docs +package + +# Environment versions file +.versions + +# Tern +.tern-project +.tern-port + +# npm config +.npmrc + +# Temporary development files +tmp + +# Yarn lockfile (only package-lock.json supported) +yarn.lock + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional stylelint cache +.stylelintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variable files +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# vuepress v2.x temp and cache directory +.temp +.cache + +# Docusaurus cache and generated files +.docusaurus + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* + +# Windows + +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# macOS + +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# Prettier exceptions +*.hbs diff --git a/codegen/content/CODEGEN.md b/codegen/content/CODEGEN.md new file mode 100644 index 00000000..793bd4e9 --- /dev/null +++ b/codegen/content/CODEGEN.md @@ -0,0 +1 @@ +# Codegen diff --git a/codegen/index.ts b/codegen/index.ts new file mode 100644 index 00000000..7b859548 --- /dev/null +++ b/codegen/index.ts @@ -0,0 +1 @@ +export default null diff --git a/codegen/layouts/default.hbs b/codegen/layouts/default.hbs new file mode 100644 index 00000000..8dee2304 --- /dev/null +++ b/codegen/layouts/default.hbs @@ -0,0 +1 @@ +{{contents}} diff --git a/codegen/layouts/partials/route-class-endpoint-export.hbs b/codegen/layouts/partials/route-class-endpoint-export.hbs new file mode 100644 index 00000000..70091356 --- /dev/null +++ b/codegen/layouts/partials/route-class-endpoint-export.hbs @@ -0,0 +1,7 @@ +export type {{requestTypeName}} = RouteRequest{{requestFormatSuffix}}<'{{path}}'> + +export type {{responseTypeName}} = SetNonNullable< + Required> +> + +export type {{optionsTypeName}} = {{#if returnsActionAttempt}}Pick{{else}}never{{/if}} diff --git a/codegen/layouts/partials/route-class-endpoint.hbs b/codegen/layouts/partials/route-class-endpoint.hbs new file mode 100644 index 00000000..37dd3508 --- /dev/null +++ b/codegen/layouts/partials/route-class-endpoint.hbs @@ -0,0 +1,13 @@ +{{methodName}}( + {{methodParamName}}{{#if isOptionalParamsOk}}?{{/if}}: {{requestTypeName}}, + {{#if hasOptions}}options: {{optionsTypeName}} = {},{{/if}} + ): SeamHttpRequest<{{#if returnsVoid}}void, undefined{{else}}{{responseTypeName}}, '{{responseKey}}'{{/if}}> +{ + return new SeamHttpRequest(this, { + pathname: '{{path}}', + method: '{{method}}', + {{requestFormat}}: {{methodParamName}}, + responseKey: {{#if returnsVoid}}undefined{{else}}'{{responseKey}}'{{/if}}, + {{#if hasOptions}}options,{{/if}} + }) +} diff --git a/codegen/layouts/partials/route-class-methods.hbs b/codegen/layouts/partials/route-class-methods.hbs new file mode 100644 index 00000000..f67a9208 --- /dev/null +++ b/codegen/layouts/partials/route-class-methods.hbs @@ -0,0 +1,125 @@ +client: Client +readonly defaults: Required +readonly ltsVersion = seamApiLtsVersion +static ltsVersion = seamApiLtsVersion + +constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { + const options = parseOptions(apiKeyOrOptions) + this.client = 'client' in options ? options.client : createClient(options) + this.defaults = limitToSeamHttpRequestOptions(options) +} + +static fromClient( + client: SeamHttpOptionsWithClient['client'], + options: Omit = {}, +): {{className}} { + const constructorOptions = { ...options, client } + if (!isSeamHttpOptionsWithClient(constructorOptions)) { + throw new SeamHttpInvalidOptionsError('Missing client') + } + return new {{className}}(constructorOptions) +} + +static fromApiKey( + apiKey: SeamHttpOptionsWithApiKey['apiKey'], + options: Omit = {}, +): {{className}} { + const constructorOptions = { ...options, apiKey } + if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { + throw new SeamHttpInvalidOptionsError('Missing apiKey') + } + return new {{className}}(constructorOptions) +} + +static fromClientSessionToken( + clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], + options: Omit< + SeamHttpOptionsWithClientSessionToken, + 'clientSessionToken' + > = {}, +): {{className}} { + const constructorOptions = { ...options, clientSessionToken } + if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { + throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') + } + return new {{className}}(constructorOptions) +} + +static async fromPublishableKey( + publishableKey: string, + userIdentifierKey: string, + options: SeamHttpFromPublishableKeyOptions = {}, +): Promise<{{className}}> { + warnOnInsecureuserIdentifierKey(userIdentifierKey) + const clientOptions = parseOptions({ ...options, publishableKey }) + if (isSeamHttpOptionsWithClient(clientOptions)) { + throw new SeamHttpInvalidOptionsError( + 'The client option cannot be used with {{className}}.fromPublishableKey', + ) + } + const client = createClient(clientOptions) + const clientSessions = SeamHttpClientSessions.fromClient(client) + const { token } = await clientSessions.getOrCreate({ + user_identifier_key: userIdentifierKey, + }) + return {{className}}.fromClientSessionToken(token, options) +} + +static fromConsoleSessionToken( + consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], + workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], + options: Omit< + SeamHttpOptionsWithConsoleSessionToken, + 'consoleSessionToken' | 'workspaceId' + > = {}, +): {{className}} { + const constructorOptions = { ...options, consoleSessionToken, workspaceId } + if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { + throw new SeamHttpInvalidOptionsError( + 'Missing consoleSessionToken or workspaceId', + ) + } + return new {{className}}(constructorOptions) +} + +static fromPersonalAccessToken( + personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], + workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], + options: Omit< + SeamHttpOptionsWithPersonalAccessToken, + 'personalAccessToken' | 'workspaceId' + > = {}, +): {{className}} { + const constructorOptions = { ...options, personalAccessToken, workspaceId } + if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { + throw new SeamHttpInvalidOptionsError( + 'Missing personalAccessToken or workspaceId', + ) + } + return new {{className}}(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() +} diff --git a/codegen/layouts/partials/route-class-subroute.hbs b/codegen/layouts/partials/route-class-subroute.hbs new file mode 100644 index 00000000..5220f635 --- /dev/null +++ b/codegen/layouts/partials/route-class-subroute.hbs @@ -0,0 +1,3 @@ +get {{ methodName }}(): {{ className }} { + return {{ className }}.fromClient(this.client, this.defaults) +} diff --git a/codegen/layouts/partials/route-imports.hbs b/codegen/layouts/partials/route-imports.hbs new file mode 100644 index 00000000..0525af34 --- /dev/null +++ b/codegen/layouts/partials/route-imports.hbs @@ -0,0 +1,47 @@ +import { seamApiLtsVersion } from 'lib/lts-version.js' +import type { + RouteRequestBody, + RouteRequestParams, + RouteResponse, +} from '@seamapi/types/connect' +import type { SetNonNullable } from 'lib/types.js' + +import { + getAuthHeadersForClientSessionToken, + warnOnInsecureuserIdentifierKey, +} from 'lib/seam/connect/auth.js' +import { + type Client, + type ClientOptions, + 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 { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' +import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' + +{{#unless skipClientSessionImport}} +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' +{{/unless}} + +{{#each subroutes}} +import { {{className}} } from './{{fileName}}' +{{/each}} diff --git a/codegen/layouts/route-index.hbs b/codegen/layouts/route-index.hbs new file mode 100644 index 00000000..01991870 --- /dev/null +++ b/codegen/layouts/route-index.hbs @@ -0,0 +1,8 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +{{#each routes}} +export * from './{{.}}' +{{/each}} diff --git a/codegen/layouts/route.hbs b/codegen/layouts/route.hbs new file mode 100644 index 00000000..98a6d2ab --- /dev/null +++ b/codegen/layouts/route.hbs @@ -0,0 +1,25 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +{{> route-imports }} + +export class {{className}} { + {{> route-class-methods }} + + {{#each subroutes}} + {{> route-class-subroute }} + + {{/each}} + + {{#each endpoints}} + {{> route-class-endpoint }} + + {{/each}} +} + +{{#each endpoints}} +{{> route-class-endpoint-export }} + +{{/each}} diff --git a/codegen/lib/connect.ts b/codegen/lib/connect.ts new file mode 100644 index 00000000..0bbc7ca5 --- /dev/null +++ b/codegen/lib/connect.ts @@ -0,0 +1,84 @@ +import type { Blueprint } from '@seamapi/blueprint' +import { kebabCase } from 'change-case' +import type Metalsmith from 'metalsmith' + +import { + type RouteIndexLayoutContext, + type RouteLayoutContext, + setRouteLayoutContext, +} from './layouts/route.js' + +interface Metadata { + blueprint: Blueprint +} + +type File = RouteLayoutContext & RouteIndexLayoutContext & { layout: string } + +const rootPath = 'src/lib/seam/connect/routes' + +export const connect = ( + files: Metalsmith.Files, + metalsmith: Metalsmith, +): void => { + const metadata = metalsmith.metadata() as Metadata + const { blueprint } = metadata + + const namespaces = blueprint.namespaces.filter( + ({ isUndocumented }) => !isUndocumented, + ) + const routes = blueprint.routes.filter( + ({ isUndocumented }) => !isUndocumented, + ) + + const nodes = [...namespaces, ...routes] + + const routeIndexes: Record> = {} + + const rootRouteKey = `${rootPath}/seam-http.ts` + files[rootRouteKey] = { contents: Buffer.from('\n') } + const file = files[rootRouteKey] as unknown as File + file.layout = 'route.hbs' + setRouteLayoutContext(file, null, nodes) + + routeIndexes[''] ??= new Set() + routeIndexes['']?.add('seam-http.js') + + for (const node of nodes) { + const path = toFilePath(node.path) + const name = kebabCase(node.name) + + const k = `${rootPath}/${path}/${name}.ts` + files[k] = { contents: Buffer.from('\n') } + const file = files[k] as unknown as File + file.layout = 'route.hbs' + setRouteLayoutContext(file, node, nodes) + + routeIndexes[path] ??= new Set() + routeIndexes[path]?.add(`${name}.js`) + + const pathParts = path.split('/') + while (pathParts.length > 0) { + const name = pathParts.pop() + if (name == null) throw new Error('Unexpected null') + const path = toFilePath(`/${pathParts.join('/')}`) + routeIndexes[path] ??= new Set() + routeIndexes[path]?.add(`${kebabCase(name)}/index.js`) + } + } + + for (const [path, routes] of Object.entries(routeIndexes)) { + const k = + path === '' ? `${rootPath}/index.ts` : `${rootPath}/${path}/index.ts` + files[k] = { contents: Buffer.from('\n') } + const file = files[k] as unknown as File + file.layout = 'route-index.hbs' + file.routes = [...routes] + } +} + +const toFilePath = (path: string): string => + path + .slice(1) + .split('/') + .map((p) => kebabCase(p)) + .join('/') diff --git a/codegen/lib/handlebars-helpers.ts b/codegen/lib/handlebars-helpers.ts new file mode 100644 index 00000000..dac2bee2 --- /dev/null +++ b/codegen/lib/handlebars-helpers.ts @@ -0,0 +1 @@ +export const identity = (x: unknown): unknown => x diff --git a/codegen/lib/index.ts b/codegen/lib/index.ts new file mode 100644 index 00000000..b99c46e6 --- /dev/null +++ b/codegen/lib/index.ts @@ -0,0 +1,7 @@ +import { handlebarsHelpers } from '@seamapi/smith' + +import * as customHelpers from './handlebars-helpers.js' + +export const helpers = { ...handlebarsHelpers, ...customHelpers } + +export * from './connect.js' diff --git a/codegen/lib/layouts/route.ts b/codegen/lib/layouts/route.ts new file mode 100644 index 00000000..0edc34ad --- /dev/null +++ b/codegen/lib/layouts/route.ts @@ -0,0 +1,153 @@ +import type { Endpoint, Namespace, Route } from '@seamapi/blueprint' +import type { Method } from 'axios' +import { camelCase, kebabCase, pascalCase } from 'change-case' + +export interface RouteLayoutContext { + className: string + endpoints: EndpointLayoutContext[] + subroutes: SubrouteLayoutContext[] + skipClientSessionImport: boolean +} + +export interface RouteIndexLayoutContext { + routes: string[] +} + +interface EndpointLayoutContext { + path: string + methodName: string + method: Method + hasOptions: boolean + responseKey: string + methodParamName: 'params' | 'body' + requestFormat: 'params' | 'body' + requestTypeName: string + responseTypeName: string + requestFormatSuffix: string + optionsTypeName: string + returnsActionAttempt: boolean + returnsVoid: boolean + isOptionalParamsOk: boolean +} + +interface SubrouteLayoutContext { + methodName: string + className: string + fileName: string +} + +export const setRouteLayoutContext = ( + file: Partial, + node: Route | Namespace | null, + nodes: Array, +): void => { + file.className = getClassName(node?.path ?? null) + file.skipClientSessionImport = + node == null || node?.path === '/client_sessions' + + file.endpoints = [] + if (node != null && 'endpoints' in node) { + const endpoints = node.endpoints.filter( + ({ isUndocumented }) => !isUndocumented, + ) + file.endpoints = endpoints.map((endpoint) => + getEndpointLayoutContext(endpoint, node), + ) + } + + file.subroutes = nodes + .sort((n1, n2) => n1.name.localeCompare(n2.name)) + .filter(({ parentPath }) => parentPath === (node?.path ?? null)) + .map((r) => getSubrouteLayoutContext(r)) +} + +const getSubrouteLayoutContext = ( + route: Pick, +): SubrouteLayoutContext => { + return { + fileName: `${kebabCase(route.name)}/index.js`, + methodName: camelCase(route.name), + className: getClassName(route.path), + } +} + +const getEndpointLayoutContext = ( + endpoint: Endpoint, + route: Pick, +): EndpointLayoutContext => { + const prefix = pascalCase([route.path.split('/'), endpoint.name].join('_')) + + const methodParamName = getMethodParamName(endpoint.name, route.name) + + const requestFormat = ['GET', 'DELETE'].includes( + endpoint.request.preferredMethod, + ) + ? 'params' + : 'body' + + const requestFormatSuffix = pascalCase(requestFormat) + + const returnsActionAttempt = + endpoint.response.responseType === 'resource' && + endpoint.response.resourceType === 'action_attempt' + + return { + path: endpoint.path, + methodName: camelCase(endpoint.name), + method: endpoint.request.preferredMethod, + hasOptions: returnsActionAttempt, + methodParamName, + requestFormat, + requestFormatSuffix, + returnsActionAttempt, + requestTypeName: `${prefix}${pascalCase(methodParamName)}`, + responseTypeName: `${prefix}Response`, + optionsTypeName: `${prefix}Options`, + // UPSTREAM: Needs support in blueprint, fallback to true for now. + // https://github.com/seamapi/blueprint/issues/205 + isOptionalParamsOk: true, + ...getResponseContext(endpoint), + } +} + +const getResponseContext = ( + endpoint: Endpoint, +): Pick => { + if (endpoint.response.responseType === 'void') + return { + returnsVoid: true, + responseKey: '', + } + const { responseKey } = endpoint.response + return { + returnsVoid: false, + responseKey, + } +} + +const getClassName = (name: string | null): string => + `SeamHttp${pascalCase(name ?? '')}` + +const getMethodParamName = ( + endpointName: string, + routeName: string, +): 'params' | 'body' => { + // UPSTREAM: This function implements a workaround, as the request format should always follow the semantic method. + // Blocked on https://github.com/seamapi/nextlove/issues/117 + // and https://github.com/seamapi/javascript-http/issues/43 + // + // The desired implementation: + // + // return ['GET', 'DELETE'].includes(endpoint.request.semanticMethod) + // ? 'params' + // : 'body' + + if (routeName.includes('simulate')) return 'body' + if (['get', 'list', 'view'].includes(endpointName)) return 'params' + if (['delete'].includes(endpointName)) return 'params' + if (endpointName.includes('revoke')) return 'params' + if (endpointName.includes('remove')) return 'params' + if (endpointName.includes('deactivate')) return 'params' + if (endpointName.startsWith('list')) return 'params' + return 'body' +} diff --git a/codegen/smith.ts b/codegen/smith.ts new file mode 100644 index 00000000..0b575bfd --- /dev/null +++ b/codegen/smith.ts @@ -0,0 +1,36 @@ +import { dirname } from 'node:path' +import { fileURLToPath } from 'node:url' + +import layouts from '@metalsmith/layouts' +import { blueprint, getHandlebarsPartials } from '@seamapi/smith' +import * as types from '@seamapi/types/connect' +import { deleteAsync } from 'del' +import Metalsmith from 'metalsmith' + +import { connect, helpers } from './lib/index.js' + +const rootDir = dirname(fileURLToPath(import.meta.url)) + +await Promise.all([deleteAsync('./src/lib/seam/connect/routes')]) + +const partials = await getHandlebarsPartials(`${rootDir}/layouts/partials`) + +Metalsmith(rootDir) + .source('./content') + .destination('../') + .clean(false) + .use(blueprint({ types })) + .use(connect) + .use( + layouts({ + default: 'default.hbs', + engineOptions: { + noEscape: true, + helpers, + partials, + }, + }), + ) + .build((err) => { + if (err != null) throw err + }) diff --git a/generate-routes.ts b/generate-routes.ts deleted file mode 100644 index 651f842e..00000000 --- a/generate-routes.ts +++ /dev/null @@ -1,637 +0,0 @@ -import { readFile, writeFile } from 'node:fs/promises' -import { dirname, posix, resolve } from 'node:path' -import { fileURLToPath } from 'node:url' - -import { openapi } from '@seamapi/types/connect' -import { camelCase, kebabCase, pascalCase, snakeCase } from 'change-case' -import { deleteAsync } from 'del' -import { ESLint } from 'eslint' -import { format, resolveConfig } from 'prettier' - -const rootPathParts = ['src', 'lib', 'seam', 'connect'] - -const routeOutputPathParts = ['routes'] - -const rootPath = resolve( - dirname(fileURLToPath(import.meta.url)), - ...rootPathParts, -) -const rootClassPath = resolve(rootPath, 'seam-http.ts') -const routeOutputPath = resolve(rootPath, ...routeOutputPathParts) - -async function main(): Promise { - const routes = createRoutes() - const routeNames = await Promise.all(routes.map(writeRoute)) - const routeIndexName = await writeRoutesIndex(routes) - const outputPathParts = [...rootPathParts, ...routeOutputPathParts] - await deleteAsync([ - posix.join(...outputPathParts, '*'), - `!${posix.join(...outputPathParts, routeIndexName)}`, - ...routeNames.map((name) => `!${posix.join(...outputPathParts, name)}`), - ]) -} - -const openapiResponseKeyProp = 'x-response-key' - -const routePaths = [ - '/access_codes', - '/access_codes/simulate', - '/access_codes/unmanaged', - '/acs', - '/acs/access_groups', - '/acs/credential_pools', - '/acs/credential_provisioning_automations', - '/acs/credentials', - '/acs/entrances', - '/acs/systems', - '/acs/users', - '/acs/users/unmanaged', - '/acs/access_groups/unmanaged', - '/acs/credentials/unmanaged', - '/acs/encoders', - '/acs/encoders/simulate', - '/action_attempts', - '/client_sessions', - '/connect_webviews', - '/connected_accounts', - '/devices', - '/devices/unmanaged', - '/devices/simulate', - '/bridges', - '/events', - '/locks', - '/locks/simulate', - '/noise_sensors', - '/noise_sensors/noise_thresholds', - '/noise_sensors/simulate', - '/phones', - '/phones/simulate', - '/thermostats', - '/thermostats/schedules', - '/thermostats/simulate', - '/thermostats/daily_programs', - '/unstable_locations', - '/unstable_access_grants', - '/unstable_access_methods', - '/spaces', - '/access_grants', - '/access_methods', - '/unstable_partner', - '/unstable_partner/resources', - '/unstable_partner/building_blocks', - '/user_identities', - '/user_identities/enrollment_automations', - '/webhooks', - '/workspaces', -] as const - -const routePathSubresources: Partial< - Record<(typeof routePaths)[number], string[]> -> = { - '/access_codes': ['unmanaged', 'simulate'], - '/acs': [ - 'access_groups', - 'credential_pools', - 'credential_provisioning_automations', - 'credentials', - 'entrances', - 'encoders', - 'systems', - 'users', - ], - '/locks': ['simulate'], - '/acs/users': ['unmanaged'], - '/acs/access_groups': ['unmanaged'], - '/acs/credentials': ['unmanaged'], - '/acs/encoders': ['simulate'], - '/phones': ['simulate'], - '/devices': ['unmanaged', 'simulate'], - '/noise_sensors': ['noise_thresholds', 'simulate'], - '/thermostats': ['schedules', 'simulate', 'daily_programs'], - '/user_identities': ['enrollment_automations'], - '/unstable_partner': ['building_blocks', 'resources'], -} - -interface Route { - namespace: string - endpoints: Endpoint[] - subresources: string[] -} - -interface Endpoint { - name: string - path: string - namespace: string - resource: string | null - method: Method - requestFormat: 'params' | 'body' - isRequestParamOptional: boolean -} - -type Method = 'GET' | 'POST' - -interface ClassMeta { - constructors: string -} - -const createRoutes = (): Route[] => { - const allOpenapiPaths = Object.keys(openapi.paths) - - const unmatchedEndpointPaths = allOpenapiPaths - .filter( - (path) => - !routePaths.some((routePath) => isEndpointUnderRoute(path, routePath)), - ) - .filter((path) => !path.startsWith('/seam')) - .filter((path) => !path.startsWith('/networks')) - - if (unmatchedEndpointPaths.length > 0) { - throw new Error( - `The following endpoints will not be generated (add them to routePaths in generate-routes.ts):\n\n${unmatchedEndpointPaths.join( - '\n', - )}\n`, - ) - } - - const routesToGenerate = routePaths.filter( - (routePath) => - hasAtLeastOneDocumentedEndpoint(routePath) || isNamespaceRoute(routePath), - ) - - return routesToGenerate.map((routePath) => - createRoute(routePath, routesToGenerate), - ) -} - -const createRoute = ( - routePath: (typeof routePaths)[number], - documentedRoutePaths: ReadonlyArray<(typeof routePaths)[number]>, -): Route => { - const endpointPaths = Object.entries(openapi.paths) - .filter(([path, pathSchema]) => { - if (!isEndpointUnderRoute(path, routePath)) { - return false - } - - return 'post' in pathSchema && !('x-undocumented' in pathSchema.post) - }) - .map(([path]) => path) - - const namespace = routePath.split('/').join('_').slice(1) - - const subresources = (routePathSubresources[routePath] ?? []).filter( - (subresource) => { - const subresourcePath = `${routePath}/${subresource}` - return documentedRoutePaths.some((path) => path === subresourcePath) - }, - ) - - return { - namespace, - subresources, - endpoints: endpointPaths.map((endpointPath) => - createEndpoint(namespace, routePath, endpointPath), - ), - } -} - -const createEndpoint = ( - namespace: string, - routePath: string, - endpointPath: string, -): Endpoint => { - if (!isOpenapiPath(endpointPath)) { - throw new Error(`Did not find ${endpointPath} in OpenAPI spec`) - } - const spec = openapi.paths[endpointPath] - const method = deriveSemanticMethod(Object.keys(spec)) - const name = endpointPath.split(routePath)[1]?.slice(1) - if (name == null) { - throw new Error(`Could not parse name from ${endpointPath}`) - } - return { - name, - namespace, - path: endpointPath, - method, - resource: deriveResource(endpointPath, method), - requestFormat: ['GET', 'DELETE'].includes(method) ? 'params' : 'body', - // UPSTREAM: This could be derived from the OpenAPI spec, however some endpoints require at least one param, - // and in the spec this currently looks as if params are optional. - isRequestParamOptional: true, - } -} - -const deriveResource = ( - endpointPath: string, - method: Method, -): string | null => { - if (isOpenapiPath(endpointPath)) { - const spec = openapi.paths[endpointPath] - const methodKey = method.toLowerCase() - - if (methodKey === 'post' && 'post' in spec) { - const postSpec = spec.post - const openapiEndpointResource = - openapiResponseKeyProp in postSpec - ? postSpec[openapiResponseKeyProp] - : null - - return openapiEndpointResource - } - - if (methodKey === 'get' && 'get' in spec) { - const response = spec.get.responses[200] - - if (!('content' in response)) { - throw new Error(`Missing resource for ${method} ${endpointPath}`) - } - - return deriveResourceFromSchemaForGetRequest( - response.content['application/json']?.schema?.properties ?? {}, - ) - } - } - - throw new Error(`Could not derive resource for ${method} ${endpointPath}`) -} - -const deriveResourceFromSchemaForGetRequest = ( - properties: object, -): string | null => - Object.keys(properties).filter((key) => key !== 'ok')[0] ?? null - -const deriveSemanticMethod = (methods: string[]): Method => { - // UPSTREAM: This should return GET before POST. - // Blocked on https://github.com/seamapi/nextlove/issues/117 - // and https://github.com/seamapi/javascript-http/issues/43 - if (methods.includes('post')) return 'POST' - if (methods.includes('get')) return 'GET' - throw new Error(`Could not find valid method in ${methods.join(', ')}`) -} - -const isOpenapiPath = (key: string): key is keyof typeof openapi.paths => - key in openapi.paths - -const isEndpointUnderRoute = ( - endpointPath: string, - routePath: string, -): boolean => - endpointPath.startsWith(routePath) && - endpointPath.split('/').length - 1 === routePath.split('/').length - -const hasAtLeastOneDocumentedEndpoint = ( - routePath: (typeof routePaths)[number], -): boolean => { - const endpointsUnderRoute = Object.keys(openapi.paths).filter((path) => - isEndpointUnderRoute(path, routePath), - ) - - if (endpointsUnderRoute.length === 0) { - return false - } - - return endpointsUnderRoute.some((path) => { - if (!isOpenapiPath(path)) return false - - const pathSchema = openapi.paths[path] - if (!('post' in pathSchema)) return false - - return !('x-undocumented' in pathSchema.post) - }) -} - -/** - * Determines if a route is a namespace route by checking if it has defined subresources - * and if any of those subresources have corresponding route paths. - * (e.g., "/acs" which contains "/acs/users", "/acs/systems", etc.) - * These routes should be generated even if they don't have direct endpoints themselves. - */ -function isNamespaceRoute(routePath: (typeof routePaths)[number]): boolean { - const subresources = routePathSubresources[routePath] ?? [] - if (subresources.length === 0) { - return false - } - - return subresources.some((subresource) => { - const subresourcePath = - `${routePath}/${subresource}` as (typeof routePaths)[number] - return routePaths.includes(subresourcePath) - }) -} - -const renderRoute = (route: Route, { constructors }: ClassMeta): string => ` -/* -* Automatically generated by generate-routes.ts. -* Do not edit this file or add other files to this directory. -*/ - -${renderImports(route)} - -${renderClass(route, { constructors })} - -${renderExports(route)} -` - -const renderImports = ({ namespace, subresources }: Route): string => - ` -import type { - RouteRequestBody, - RouteRequestParams, - RouteResponse, -} from '@seamapi/types/connect' -import type { SetNonNullable } from 'lib/types.js' - -import { - getAuthHeadersForClientSessionToken, - warnOnInsecureuserIdentifierKey, -} from 'lib/seam/connect/auth.js' -import { - type Client, - type ClientOptions, - 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 { - resolveActionAttempt, -} from 'lib/seam/connect/resolve-action-attempt.js' -import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' -import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' - -${ - namespace === 'client_sessions' - ? '' - : "import { SeamHttpClientSessions } from './client-sessions.js'" -} -${ - namespace === 'action_attempts' - ? '' - : "import { SeamHttpActionAttempts } from './action-attempts.js'" -} -${subresources - .map((subresource) => renderSubresourceImport(subresource, namespace)) - .join('\n')} -` -const renderSubresourceImport = ( - subresource: string, - namespace: string, -): string => ` - import { - SeamHttp${pascalCase(namespace)}${pascalCase(subresource)} - } from './${kebabCase(namespace)}-${kebabCase(subresource)}.js' -` - -const renderClass = ( - { namespace, endpoints, subresources }: Route, - { constructors }: ClassMeta, -): string => - ` -export class SeamHttp${pascalCase(namespace)} { - client: Client - readonly defaults: Required - - ${constructors - .replaceAll(': SeamHttp ', `: SeamHttp${pascalCase(namespace)} `) - .replaceAll('', ``) - .replaceAll( - 'SeamHttp.fromClientSessionToken', - `SeamHttp${pascalCase(namespace)}.fromClientSessionToken`, - ) - .replaceAll('new SeamHttp(', `new SeamHttp${pascalCase(namespace)}(`)} - - ${subresources - .map((subresource) => renderSubresourceMethod(subresource, namespace)) - .join('\n')} - - ${endpoints.map(renderClassMethod).join('\n')} -} -` - -const renderClassMethod = ({ - name, - requestFormat, - method, - namespace, - resource, - path, - isRequestParamOptional, -}: Endpoint): string => ` - ${camelCase(name)}( - ${requestFormat}${isRequestParamOptional ? '?' : ''}: ${renderRequestType({ - name, - namespace, - })}, - ${renderClassMethodOptions({ resource })} - ): SeamHttpRequest<${ - resource === null - ? 'void, undefined' - : `${renderResponseType({ name, namespace })}, '${resource}'` - }> { - return new SeamHttpRequest(this, { - pathname: '${path}', - method: '${snakeCase(method)}', ${ - requestFormat === 'params' ? 'params,' : '' - } ${requestFormat === 'body' ? 'body,' : ''} - responseKey: ${resource === null ? 'undefined' : `'${resource}'`}, - ${resource === 'action_attempt' ? 'options' : ''} - }) - } - ` - -const renderClassMethodOptions = ({ - resource, -}: Pick): string => { - if (resource === 'action_attempt') { - return `options: ${renderClassMethodOptionsTypeDef({ resource })} = {},` - } - return '' -} - -const renderClassMethodOptionsType = ({ - name, - namespace, -}: Pick): string => - [pascalCase(namespace), pascalCase(name), 'Options'].join('') - -const renderClassMethodOptionsTypeDef = ({ - resource, -}: Pick): string => { - if (resource === 'action_attempt') { - return "Pick" - } - return 'never' -} - -const renderSubresourceMethod = ( - subresource: string, - namespace: string, -): string => ` - get ${camelCase(subresource)} (): SeamHttp${pascalCase( - namespace, - )}${pascalCase(subresource)} { - return SeamHttp${pascalCase(namespace)}${pascalCase( - subresource, - )}.fromClient(this.client, this.defaults) - } -` - -const renderExports = (route: Route): string => - route.endpoints.map(renderEndpointExports).join('\n') - -const renderEndpointExports = ({ - name, - path, - namespace, - resource, - requestFormat, -}: Endpoint): string => ` -export type ${renderRequestType({ - name, - namespace, -})} = RouteRequest${pascalCase(requestFormat)}<'${path}'> - -export type ${renderResponseType({ name, namespace })}= SetNonNullable< - Required> -> - -export type ${renderClassMethodOptionsType({ - name, - namespace, -})} = ${renderClassMethodOptionsTypeDef({ resource })} - ` - -const renderRequestType = ({ - name, - namespace, -}: Pick): string => - [ - pascalCase(namespace), - pascalCase(name), - pascalCase(requestFormatToRequestType(name, namespace)), - ].join('') - -// UPSTREAM: This function is a workaround, as the request type should always match the request format. -// Blocked on https://github.com/seamapi/nextlove/issues/117 -// and https://github.com/seamapi/javascript-http/issues/43 -const requestFormatToRequestType = ( - name: string, - namespace: string, -): 'params' | 'body' => { - if (namespace.includes('simulate')) return 'body' - if (['get', 'list', 'view'].includes(name)) return 'params' - if (['delete'].includes(name)) return 'params' - if (name.includes('revoke')) return 'params' - if (name.includes('remove')) return 'params' - if (name.includes('deactivate')) return 'params' - if (name.startsWith('list')) return 'params' - return 'body' -} - -const renderResponseType = ({ - name, - namespace, -}: Pick): string => - [pascalCase(namespace), pascalCase(name), 'Response'].join('') - -const getClassConstructors = (data: string): string => { - const lines = data.split('\n') - - const startIdx = lines.findIndex((line) => - line.trim().startsWith('constructor('), - ) - if (startIdx === -1) { - throw new Error('Could not find start of class constructors') - } - - const endIdx = lines.findIndex((line) => line.trim().startsWith('get ')) - if (endIdx === -1) { - throw new Error('Could not find end of class constructors') - } - - return lines.slice(startIdx, endIdx).join('\n') -} - -const writeRoute = async (route: Route): Promise => { - const rootClass = await readFile(rootClassPath) - const constructors = getClassConstructors(rootClass.toString()) - const name = `${kebabCase(route.namespace)}.ts` - await write(renderRoute(route, { constructors }), routeOutputPath, name) - return name -} - -const writeRoutesIndex = async (routes: Route[]): Promise => { - const exports = routes.map( - (route) => `export * from './${kebabCase(route.namespace)}.js'`, - ) - const name = 'index.ts' - await write(exports.join('\n'), routeOutputPath, name) - return name -} - -const write = async (data: string, ...path: string[]): Promise => { - const filePath = resolve(...path) - await writeFile( - filePath, - '// Generated empty file to allow ESLint parsing by filename', - ) - const fixedOutput = await eslintFixOutput(data, filePath) - const prettyOutput = await prettierOutput(fixedOutput, filePath) - await writeFile(filePath, prettyOutput) -} - -const prettierOutput = async ( - data: string, - filepath: string, -): Promise => { - const config = await resolveConfig(filepath) - if (config == null) { - throw new Error('Failed to resolve Prettier config') - } - return await format(data, { ...config, filepath }) -} - -const eslintFixOutput = async ( - data: string, - filePath: string, -): Promise => { - const eslint = new ESLint({ fix: true }) - - const [linted] = await eslint.lintText(data, { filePath }) - - if (linted == null) { - throw new Error('ESLint returned empty results') - } - - if (linted.fatalErrorCount > 0) { - throw new Error( - `ESLint returned fatal errors:\n${JSON.stringify( - linted.messages, - null, - 2, - )}`, - ) - } - - return linted.output ?? linted.source ?? data -} - -await main() diff --git a/package-lock.json b/package-lock.json index 21a2f993..db76e141 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@seamapi/http", - "version": "1.34.0", + "version": "1.33.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@seamapi/http", - "version": "1.34.0", + "version": "1.33.0", "license": "MIT", "dependencies": { "@seamapi/url-search-params-serializer": "^2.0.0-beta.2", @@ -14,8 +14,10 @@ "axios-retry": "^4.4.2" }, "devDependencies": { + "@seamapi/blueprint": "^0.48.1", "@seamapi/fake-seam-connect": "^1.77.0", - "@seamapi/types": "1.410.1", + "@seamapi/smith": "^0.4.4", + "@seamapi/types": "1.413.0", "@swc/core": "^1.11.29", "@types/eslint": "^8.44.2", "@types/jsonwebtoken": "^9.0.6", @@ -24,7 +26,6 @@ "c8": "^10.1.2", "change-case": "^5.0.2", "concurrently": "^9.1.0", - "del": "^8.0.0", "del-cli": "^6.0.0", "eslint": "^8.9.0", "eslint-config-prettier": "^9.0.0", @@ -49,7 +50,7 @@ "npm": ">=10.1.0" }, "peerDependencies": { - "@seamapi/types": "^1.410.1" + "@seamapi/types": "^1.413.0" }, "peerDependenciesMeta": { "@seamapi/types": { @@ -546,9 +547,9 @@ } }, "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, "license": "MIT", "dependencies": { @@ -596,9 +597,9 @@ } }, "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, "license": "MIT", "dependencies": { @@ -659,24 +660,6 @@ "node": ">=12" } }, - "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, "node_modules/@istanbuljs/schema": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", @@ -740,6 +723,25 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@metalsmith/layouts": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@metalsmith/layouts/-/layouts-2.7.0.tgz", + "integrity": "sha512-VG5ldPSsTxUvHqFQo0u5mjWtS2IUUOqYKHvWnEHKol1UhaXhhYBYSnG0D8kjk+XzGw+mWxNfv/JoAhg94filXA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "inputformat-to-jstransformer": "^1.4.0", + "is-utf8": "^0.2.1", + "jstransformer": "^1.0.0" + }, + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "metalsmith": "^2.4.1" + } + }, "node_modules/@mswjs/interceptors": { "version": "0.38.7", "resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.38.7.tgz", @@ -833,9 +835,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.41.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.41.1.tgz", - "integrity": "sha512-NELNvyEWZ6R9QMkiytB4/L4zSEaBC03KIXEghptLGLZWJ6VPrL63ooZQCOnlx36aQPGhzuOMwDerC1Eb2VmrLw==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.43.0.tgz", + "integrity": "sha512-Krjy9awJl6rKbruhQDgivNbD1WuLb8xAclM4IR4cN5pHGAs2oIMMQJEiC3IC/9TZJ+QZkmZhlMO/6MBGxPidpw==", "cpu": [ "arm" ], @@ -847,9 +849,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.41.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.41.1.tgz", - "integrity": "sha512-DXdQe1BJ6TK47ukAoZLehRHhfKnKg9BjnQYUu9gzhI8Mwa1d2fzxA1aw2JixHVl403bwp1+/o/NhhHtxWJBgEA==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.43.0.tgz", + "integrity": "sha512-ss4YJwRt5I63454Rpj+mXCXicakdFmKnUNxr1dLK+5rv5FJgAxnN7s31a5VchRYxCFWdmnDWKd0wbAdTr0J5EA==", "cpu": [ "arm64" ], @@ -861,9 +863,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.41.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.41.1.tgz", - "integrity": "sha512-5afxvwszzdulsU2w8JKWwY8/sJOLPzf0e1bFuvcW5h9zsEg+RQAojdW0ux2zyYAz7R8HvvzKCjLNJhVq965U7w==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.43.0.tgz", + "integrity": "sha512-eKoL8ykZ7zz8MjgBenEF2OoTNFAPFz1/lyJ5UmmFSz5jW+7XbH1+MAgCVHy72aG59rbuQLcJeiMrP8qP5d/N0A==", "cpu": [ "arm64" ], @@ -875,9 +877,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.41.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.41.1.tgz", - "integrity": "sha512-egpJACny8QOdHNNMZKf8xY0Is6gIMz+tuqXlusxquWu3F833DcMwmGM7WlvCO9sB3OsPjdC4U0wHw5FabzCGZg==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.43.0.tgz", + "integrity": "sha512-SYwXJgaBYW33Wi/q4ubN+ldWC4DzQY62S4Ll2dgfr/dbPoF50dlQwEaEHSKrQdSjC6oIe1WgzosoaNoHCdNuMg==", "cpu": [ "x64" ], @@ -889,9 +891,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.41.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.41.1.tgz", - "integrity": "sha512-DBVMZH5vbjgRk3r0OzgjS38z+atlupJ7xfKIDJdZZL6sM6wjfDNo64aowcLPKIx7LMQi8vybB56uh1Ftck/Atg==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.43.0.tgz", + "integrity": "sha512-SV+U5sSo0yujrjzBF7/YidieK2iF6E7MdF6EbYxNz94lA+R0wKl3SiixGyG/9Klab6uNBIqsN7j4Y/Fya7wAjQ==", "cpu": [ "arm64" ], @@ -903,9 +905,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.41.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.41.1.tgz", - "integrity": "sha512-3FkydeohozEskBxNWEIbPfOE0aqQgB6ttTkJ159uWOFn42VLyfAiyD9UK5mhu+ItWzft60DycIN1Xdgiy8o/SA==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.43.0.tgz", + "integrity": "sha512-J7uCsiV13L/VOeHJBo5SjasKiGxJ0g+nQTrBkAsmQBIdil3KhPnSE9GnRon4ejX1XDdsmK/l30IYLiAaQEO0Cg==", "cpu": [ "x64" ], @@ -917,9 +919,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.41.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.41.1.tgz", - "integrity": "sha512-wC53ZNDgt0pqx5xCAgNunkTzFE8GTgdZ9EwYGVcg+jEjJdZGtq9xPjDnFgfFozQI/Xm1mh+D9YlYtl+ueswNEg==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.43.0.tgz", + "integrity": "sha512-gTJ/JnnjCMc15uwB10TTATBEhK9meBIY+gXP4s0sHD1zHOaIh4Dmy1X9wup18IiY9tTNk5gJc4yx9ctj/fjrIw==", "cpu": [ "arm" ], @@ -931,9 +933,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.41.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.41.1.tgz", - "integrity": "sha512-jwKCca1gbZkZLhLRtsrka5N8sFAaxrGz/7wRJ8Wwvq3jug7toO21vWlViihG85ei7uJTpzbXZRcORotE+xyrLA==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.43.0.tgz", + "integrity": "sha512-ZJ3gZynL1LDSIvRfz0qXtTNs56n5DI2Mq+WACWZ7yGHFUEirHBRt7fyIk0NsCKhmRhn7WAcjgSkSVVxKlPNFFw==", "cpu": [ "arm" ], @@ -945,9 +947,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.41.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.41.1.tgz", - "integrity": "sha512-g0UBcNknsmmNQ8V2d/zD2P7WWfJKU0F1nu0k5pW4rvdb+BIqMm8ToluW/eeRmxCared5dD76lS04uL4UaNgpNA==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.43.0.tgz", + "integrity": "sha512-8FnkipasmOOSSlfucGYEu58U8cxEdhziKjPD2FIa0ONVMxvl/hmONtX/7y4vGjdUhjcTHlKlDhw3H9t98fPvyA==", "cpu": [ "arm64" ], @@ -959,9 +961,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.41.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.41.1.tgz", - "integrity": "sha512-XZpeGB5TKEZWzIrj7sXr+BEaSgo/ma/kCgrZgL0oo5qdB1JlTzIYQKel/RmhT6vMAvOdM2teYlAaOGJpJ9lahg==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.43.0.tgz", + "integrity": "sha512-KPPyAdlcIZ6S9C3S2cndXDkV0Bb1OSMsX0Eelr2Bay4EsF9yi9u9uzc9RniK3mcUGCLhWY9oLr6er80P5DE6XA==", "cpu": [ "arm64" ], @@ -973,9 +975,9 @@ ] }, "node_modules/@rollup/rollup-linux-loongarch64-gnu": { - "version": "4.41.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.41.1.tgz", - "integrity": "sha512-bkCfDJ4qzWfFRCNt5RVV4DOw6KEgFTUZi2r2RuYhGWC8WhCA8lCAJhDeAmrM/fdiAH54m0mA0Vk2FGRPyzI+tw==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.43.0.tgz", + "integrity": "sha512-HPGDIH0/ZzAZjvtlXj6g+KDQ9ZMHfSP553za7o2Odegb/BEfwJcR0Sw0RLNpQ9nC6Gy8s+3mSS9xjZ0n3rhcYg==", "cpu": [ "loong64" ], @@ -987,9 +989,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.41.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.41.1.tgz", - "integrity": "sha512-3mr3Xm+gvMX+/8EKogIZSIEF0WUu0HL9di+YWlJpO8CQBnoLAEL/roTCxuLncEdgcfJcvA4UMOf+2dnjl4Ut1A==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.43.0.tgz", + "integrity": "sha512-gEmwbOws4U4GLAJDhhtSPWPXUzDfMRedT3hFMyRAvM9Mrnj+dJIFIeL7otsv2WF3D7GrV0GIewW0y28dOYWkmw==", "cpu": [ "ppc64" ], @@ -1001,9 +1003,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.41.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.41.1.tgz", - "integrity": "sha512-3rwCIh6MQ1LGrvKJitQjZFuQnT2wxfU+ivhNBzmxXTXPllewOF7JR1s2vMX/tWtUYFgphygxjqMl76q4aMotGw==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.43.0.tgz", + "integrity": "sha512-XXKvo2e+wFtXZF/9xoWohHg+MuRnvO29TI5Hqe9xwN5uN8NKUYy7tXUG3EZAlfchufNCTHNGjEx7uN78KsBo0g==", "cpu": [ "riscv64" ], @@ -1015,9 +1017,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.41.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.41.1.tgz", - "integrity": "sha512-LdIUOb3gvfmpkgFZuccNa2uYiqtgZAz3PTzjuM5bH3nvuy9ty6RGc/Q0+HDFrHrizJGVpjnTZ1yS5TNNjFlklw==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.43.0.tgz", + "integrity": "sha512-ruf3hPWhjw6uDFsOAzmbNIvlXFXlBQ4nk57Sec8E8rUxs/AI4HD6xmiiasOOx/3QxS2f5eQMKTAwk7KHwpzr/Q==", "cpu": [ "riscv64" ], @@ -1029,9 +1031,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.41.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.41.1.tgz", - "integrity": "sha512-oIE6M8WC9ma6xYqjvPhzZYk6NbobIURvP/lEbh7FWplcMO6gn7MM2yHKA1eC/GvYwzNKK/1LYgqzdkZ8YFxR8g==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.43.0.tgz", + "integrity": "sha512-QmNIAqDiEMEvFV15rsSnjoSmO0+eJLoKRD9EAa9rrYNwO/XRCtOGM3A5A0X+wmG+XRrw9Fxdsw+LnyYiZWWcVw==", "cpu": [ "s390x" ], @@ -1043,9 +1045,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.41.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.41.1.tgz", - "integrity": "sha512-cWBOvayNvA+SyeQMp79BHPK8ws6sHSsYnK5zDcsC3Hsxr1dgTABKjMnMslPq1DvZIp6uO7kIWhiGwaTdR4Og9A==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.43.0.tgz", + "integrity": "sha512-jAHr/S0iiBtFyzjhOkAics/2SrXE092qyqEg96e90L3t9Op8OTzS6+IX0Fy5wCt2+KqeHAkti+eitV0wvblEoQ==", "cpu": [ "x64" ], @@ -1057,9 +1059,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.41.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.41.1.tgz", - "integrity": "sha512-y5CbN44M+pUCdGDlZFzGGBSKCA4A/J2ZH4edTYSSxFg7ce1Xt3GtydbVKWLlzL+INfFIZAEg1ZV6hh9+QQf9YQ==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.43.0.tgz", + "integrity": "sha512-3yATWgdeXyuHtBhrLt98w+5fKurdqvs8B53LaoKD7P7H7FKOONLsBVMNl9ghPQZQuYcceV5CDyPfyfGpMWD9mQ==", "cpu": [ "x64" ], @@ -1071,9 +1073,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.41.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.41.1.tgz", - "integrity": "sha512-lZkCxIrjlJlMt1dLO/FbpZbzt6J/A8p4DnqzSa4PWqPEUUUnzXLeki/iyPLfV0BmHItlYgHUqJe+3KiyydmiNQ==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.43.0.tgz", + "integrity": "sha512-wVzXp2qDSCOpcBCT5WRWLmpJRIzv23valvcTwMHEobkjippNf+C3ys/+wf07poPkeNix0paTNemB2XrHr2TnGw==", "cpu": [ "arm64" ], @@ -1085,9 +1087,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.41.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.41.1.tgz", - "integrity": "sha512-+psFT9+pIh2iuGsxFYYa/LhS5MFKmuivRsx9iPJWNSGbh2XVEjk90fmpUEjCnILPEPJnikAU6SFDiEUyOv90Pg==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.43.0.tgz", + "integrity": "sha512-fYCTEyzf8d+7diCw8b+asvWDCLMjsCEA8alvtAutqJOJp/wL5hs1rWSqJ1vkjgW0L2NB4bsYJrpKkiIPRR9dvw==", "cpu": [ "ia32" ], @@ -1099,9 +1101,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.41.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.41.1.tgz", - "integrity": "sha512-Wq2zpapRYLfi4aKxf2Xff0tN+7slj2d4R87WEzqw7ZLsVvO5zwYCIuEGSZYiK41+GlwUo1HiR+GdkLEJnCKTCw==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.43.0.tgz", + "integrity": "sha512-SnGhLiE5rlK0ofq8kzuDkM0g7FN1s5VYY+YSMTibP7CqShxCQvqtNxTARS4xX4PFJfHjG0ZQYX9iGzI3FQh5Aw==", "cpu": [ "x64" ], @@ -1120,6 +1122,21 @@ "license": "MIT", "peer": true }, + "node_modules/@seamapi/blueprint": { + "version": "0.48.1", + "resolved": "https://registry.npmjs.org/@seamapi/blueprint/-/blueprint-0.48.1.tgz", + "integrity": "sha512-daw8hxImyPHKDBVEH8SFbQMXTVhPXqrKZQRd6GNHiM/q0L6dmmhGaoQ1OrDtO6kwf3XcSZTQkYAYz1i8LEAK3w==", + "dev": true, + "license": "MIT", + "dependencies": { + "change-case": "^5.4.4", + "zod": "^3.23.8" + }, + "engines": { + "node": ">=18.12.0", + "npm": ">= 9.0.0" + } + }, "node_modules/@seamapi/fake-devicedb": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/@seamapi/fake-devicedb/-/fake-devicedb-1.6.1.tgz", @@ -1156,10 +1173,43 @@ "zustand-hoist": "^2.0.0" } }, + "node_modules/@seamapi/smith": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@seamapi/smith/-/smith-0.4.4.tgz", + "integrity": "sha512-0gI3fv/PV1RYw9kHlXjQpkZucxmvAJR8rThJ1aIO1wQbsaGLxWa84NF2+gtlOelBP565RK8WQjXCANl63JysDw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "^22.15.21", + "change-case": "^5.4.4", + "eslint-config-prettier": "^9.0.0", + "eslint-config-standard": "^17.1.0", + "eslint-config-standard-with-typescript": "^43.0.0", + "eslint-plugin-simple-import-sort": "^12.0.0", + "eslint-plugin-unused-imports": "^3.0.0", + "glob": "^11.0.2" + }, + "engines": { + "node": ">=22.11.0", + "npm": ">= 10.9.0" + }, + "peerDependencies": { + "@metalsmith/layouts": "^2.7.0", + "@seamapi/blueprint": ">=0.43.1", + "del": "^8.0.0", + "eslint": "^8.9.0", + "jstransformer-handlebars": "^1.2.0", + "metalsmith": "^2.6.3", + "mkdirp": "^3.0.1", + "prettier": "^3.0.0", + "tsx": "^4.6.2", + "typescript": "~5.3.3" + } + }, "node_modules/@seamapi/types": { - "version": "1.410.1", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.410.1.tgz", - "integrity": "sha512-PmPBVbx2B7sRirjJYMx4DMoHWJwZT0cZTkM0NioUa6AfCzcRUi3uT1ZG/efy2SeTTSm1NqMf90mNoQ8EaNrdjQ==", + "version": "1.413.0", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.413.0.tgz", + "integrity": "sha512-oNesrHvS1zuxd89YNGhqWG76W2KWl0S9jDfDiVtvWxbyB91PUK3rVpntoK3P0l0HBFMV8E9Vghhmmvo/FLV70Q==", "dev": true, "license": "MIT", "engines": { @@ -1277,15 +1327,15 @@ } }, "node_modules/@swc/core": { - "version": "1.11.31", - "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.11.31.tgz", - "integrity": "sha512-mAby9aUnKRjMEA7v8cVZS9Ah4duoRBnX7X6r5qrhTxErx+68MoY1TPrVwj/66/SWN3Bl+jijqAqoB8Qx0QE34A==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.12.0.tgz", + "integrity": "sha512-/C0kiMHPY/HnLfqXYGMGxGck3A5Y3mqwxfv+EwHTPHGjAVRfHpWAEEBTSTF5C88vVY6CvwBEkhR2TX7t8Mahcw==", "dev": true, "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { "@swc/counter": "^0.1.3", - "@swc/types": "^0.1.21" + "@swc/types": "^0.1.22" }, "engines": { "node": ">=10" @@ -1295,16 +1345,16 @@ "url": "https://opencollective.com/swc" }, "optionalDependencies": { - "@swc/core-darwin-arm64": "1.11.31", - "@swc/core-darwin-x64": "1.11.31", - "@swc/core-linux-arm-gnueabihf": "1.11.31", - "@swc/core-linux-arm64-gnu": "1.11.31", - "@swc/core-linux-arm64-musl": "1.11.31", - "@swc/core-linux-x64-gnu": "1.11.31", - "@swc/core-linux-x64-musl": "1.11.31", - "@swc/core-win32-arm64-msvc": "1.11.31", - "@swc/core-win32-ia32-msvc": "1.11.31", - "@swc/core-win32-x64-msvc": "1.11.31" + "@swc/core-darwin-arm64": "1.12.0", + "@swc/core-darwin-x64": "1.12.0", + "@swc/core-linux-arm-gnueabihf": "1.12.0", + "@swc/core-linux-arm64-gnu": "1.12.0", + "@swc/core-linux-arm64-musl": "1.12.0", + "@swc/core-linux-x64-gnu": "1.12.0", + "@swc/core-linux-x64-musl": "1.12.0", + "@swc/core-win32-arm64-msvc": "1.12.0", + "@swc/core-win32-ia32-msvc": "1.12.0", + "@swc/core-win32-x64-msvc": "1.12.0" }, "peerDependencies": { "@swc/helpers": ">=0.5.17" @@ -1316,9 +1366,9 @@ } }, "node_modules/@swc/core-darwin-arm64": { - "version": "1.11.31", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.11.31.tgz", - "integrity": "sha512-NTEaYOts0OGSbJZc0O74xsji+64JrF1stmBii6D5EevWEtrY4wlZhm8SiP/qPrOB+HqtAihxWIukWkP2aSdGSQ==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.12.0.tgz", + "integrity": "sha512-usLr8kC80GDv3pwH2zoEaS279kxtWY0MY3blbMFw7zA8fAjqxa8IDxm3WcgyNLNWckWn4asFfguEwz/Weem3nA==", "cpu": [ "arm64" ], @@ -1333,9 +1383,9 @@ } }, "node_modules/@swc/core-darwin-x64": { - "version": "1.11.31", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.11.31.tgz", - "integrity": "sha512-THSGaSwT96JwXDwuXQ6yFBbn+xDMdyw7OmBpnweAWsh5DhZmQkALEm1DgdQO3+rrE99MkmzwAfclc0UmYro/OA==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.12.0.tgz", + "integrity": "sha512-Cvv4sqDcTY7QF2Dh1vn2Xbt/1ENYQcpmrGHzITJrXzxA2aBopsz/n4yQDiyRxTR0t802m4xu0CzMoZIHvVruWQ==", "cpu": [ "x64" ], @@ -1350,9 +1400,9 @@ } }, "node_modules/@swc/core-linux-arm-gnueabihf": { - "version": "1.11.31", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.11.31.tgz", - "integrity": "sha512-laKtQFnW7KHgE57Hx32os2SNAogcuIDxYE+3DYIOmDMqD7/1DCfJe6Rln2N9WcOw6HuDbDpyQavIwZNfSAa8vQ==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.12.0.tgz", + "integrity": "sha512-seM4/XMJMOupkzfLfHl8sRa3NdhsVZp+XgwA/vVeYZYJE4wuWUxVzhCYzwmNftVY32eF2IiRaWnhG6ho6jusnQ==", "cpu": [ "arm" ], @@ -1367,9 +1417,9 @@ } }, "node_modules/@swc/core-linux-arm64-gnu": { - "version": "1.11.31", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.11.31.tgz", - "integrity": "sha512-T+vGw9aPE1YVyRxRr1n7NAdkbgzBzrXCCJ95xAZc/0+WUwmL77Z+js0J5v1KKTRxw4FvrslNCOXzMWrSLdwPSA==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.12.0.tgz", + "integrity": "sha512-Al0x33gUVxNY5tutEYpSyv7mze6qQS1ONa0HEwoRxcK9WXsX0NHLTiOSGZoCUS1SsXM37ONlbA6/Bsp1MQyP+g==", "cpu": [ "arm64" ], @@ -1384,9 +1434,9 @@ } }, "node_modules/@swc/core-linux-arm64-musl": { - "version": "1.11.31", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.11.31.tgz", - "integrity": "sha512-Mztp5NZkyd5MrOAG+kl+QSn0lL4Uawd4CK4J7wm97Hs44N9DHGIG5nOz7Qve1KZo407Y25lTxi/PqzPKHo61zQ==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.12.0.tgz", + "integrity": "sha512-OeFHz/5Hl9v75J9TYA5jQxNIYAZMqaiPpd9dYSTK2Xyqa/ZGgTtNyPhIwVfxx+9mHBf6+9c1mTlXUtACMtHmaQ==", "cpu": [ "arm64" ], @@ -1401,9 +1451,9 @@ } }, "node_modules/@swc/core-linux-x64-gnu": { - "version": "1.11.31", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.11.31.tgz", - "integrity": "sha512-DDVE0LZcXOWwOqFU1Xi7gdtiUg3FHA0vbGb3trjWCuI1ZtDZHEQYL4M3/2FjqKZtIwASrDvO96w91okZbXhvMg==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.12.0.tgz", + "integrity": "sha512-ltIvqNi7H0c5pRawyqjeYSKEIfZP4vv/datT3mwT6BW7muJtd1+KIDCPFLMIQ4wm/h76YQwPocsin3fzmnFdNA==", "cpu": [ "x64" ], @@ -1418,9 +1468,9 @@ } }, "node_modules/@swc/core-linux-x64-musl": { - "version": "1.11.31", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.11.31.tgz", - "integrity": "sha512-mJA1MzPPRIfaBUHZi0xJQ4vwL09MNWDeFtxXb0r4Yzpf0v5Lue9ymumcBPmw/h6TKWms+Non4+TDquAsweuKSw==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.12.0.tgz", + "integrity": "sha512-Z/DhpjehaTK0uf+MhNB7mV9SuewpGs3P/q9/8+UsJeYoFr7yuOoPbAvrD6AqZkf6Bh7MRZ5OtG+KQgG5L+goiA==", "cpu": [ "x64" ], @@ -1435,9 +1485,9 @@ } }, "node_modules/@swc/core-win32-arm64-msvc": { - "version": "1.11.31", - "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.11.31.tgz", - "integrity": "sha512-RdtakUkNVAb/FFIMw3LnfNdlH1/ep6KgiPDRlmyUfd0WdIQ3OACmeBegEFNFTzi7gEuzy2Yxg4LWf4IUVk8/bg==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.12.0.tgz", + "integrity": "sha512-wHnvbfHIh2gfSbvuFT7qP97YCMUDh+fuiso+pcC6ug8IsMxuViNapHET4o0ZdFNWHhXJ7/s0e6w7mkOalsqQiQ==", "cpu": [ "arm64" ], @@ -1452,9 +1502,9 @@ } }, "node_modules/@swc/core-win32-ia32-msvc": { - "version": "1.11.31", - "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.11.31.tgz", - "integrity": "sha512-hErXdCGsg7swWdG1fossuL8542I59xV+all751mYlBoZ8kOghLSKObGQTkBbuNvc0sUKWfWg1X0iBuIhAYar+w==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.12.0.tgz", + "integrity": "sha512-88umlXwK+7J2p4DjfWHXQpmlZgCf1ayt6Ssj+PYlAfMCR0aBiJoAMwHWrvDXEozyOrsyP1j2X6WxbmA861vL5Q==", "cpu": [ "ia32" ], @@ -1469,9 +1519,9 @@ } }, "node_modules/@swc/core-win32-x64-msvc": { - "version": "1.11.31", - "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.11.31.tgz", - "integrity": "sha512-5t7SGjUBMMhF9b5j17ml/f/498kiBJNf4vZFNM421UGUEETdtjPN9jZIuQrowBkoFGJTCVL/ECM4YRtTH30u/A==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.12.0.tgz", + "integrity": "sha512-KR9TSRp+FEVOhbgTU6c94p/AYpsyBk7dIvlKQiDp8oKScUoyHG5yjmMBFN/BqUyTq4kj6zlgsY2rFE4R8/yqWg==", "cpu": [ "x64" ], @@ -1493,9 +1543,9 @@ "license": "Apache-2.0" }, "node_modules/@swc/types": { - "version": "0.1.22", - "resolved": "https://registry.npmjs.org/@swc/types/-/types-0.1.22.tgz", - "integrity": "sha512-D13mY/ZA4PPEFSy6acki9eBT/3WgjMoRqNcdpIvjaYLQ44Xk5BdaL7UkDxAh6Z9UOe7tCCp67BVmZCojYp9owg==", + "version": "0.1.23", + "resolved": "https://registry.npmjs.org/@swc/types/-/types-0.1.23.tgz", + "integrity": "sha512-u1iIVZV9Q0jxY+yM2vw/hZGDNudsN85bBpTqzAQ9rzkxW9D+e3aEM4Han+ow518gSewkXgjmEK0BD79ZcNVgPw==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -1514,9 +1564,9 @@ } }, "node_modules/@types/estree": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz", - "integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", "dev": true, "license": "MIT" }, @@ -1581,9 +1631,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.15.30", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.30.tgz", - "integrity": "sha512-6Q7lr06bEHdlfplU6YRbgG1SFBdlsfNC4/lX+SkhiTs0cpJkOElmWls8PxDFv4yY/xKb8Y6SO0OmSX4wgqTZbA==", + "version": "22.15.31", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.31.tgz", + "integrity": "sha512-jnVe5ULKl6tijxUhvQeNbQG/84fHfg+yMak02cT8QVhBx/F05rAVxCGBYYTh2EKz22D6JF5ktXuNwdx7b9iEGw==", "dev": true, "license": "MIT", "dependencies": { @@ -1844,9 +1894,9 @@ } }, "node_modules/acorn": { - "version": "8.14.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", - "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", "bin": { @@ -2138,6 +2188,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/async-function": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz", @@ -2353,9 +2411,9 @@ "license": "MIT" }, "node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "dev": true, "license": "MIT", "dependencies": { @@ -2758,6 +2816,22 @@ "node": ">=8" } }, + "node_modules/cliui/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/cliui/node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -2803,6 +2877,32 @@ "node": ">=8" } }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/co": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/co/-/co-3.1.0.tgz", + "integrity": "sha512-CQsjCRiNObI8AtTsNIBDRMQ4oMR83CzEswHYahClvul7gKk+lDQiOKv+5qh7LQWf5sh6jkZNispz/QlsZxyNgA==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/code-excerpt": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/code-excerpt/-/code-excerpt-4.0.0.tgz", @@ -2867,13 +2967,14 @@ } }, "node_modules/commander": { - "version": "9.5.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", - "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", "dev": true, "license": "MIT", + "peer": true, "engines": { - "node": "^12.20.0 || >=14" + "node": ">=14" } }, "node_modules/common-path-prefix": { @@ -3911,9 +4012,9 @@ } }, "node_modules/eslint-plugin-import/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, "license": "MIT", "peer": true, @@ -4003,9 +4104,9 @@ } }, "node_modules/eslint-plugin-n/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, "license": "MIT", "peer": true, @@ -4144,9 +4245,9 @@ } }, "node_modules/eslint/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, "license": "MIT", "dependencies": { @@ -4416,6 +4517,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/fast-copy": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/fast-copy/-/fast-copy-3.0.2.tgz", @@ -4870,21 +4985,24 @@ } }, "node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", - "deprecated": "Glob versions prior to v9 are no longer supported", + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.2.tgz", + "integrity": "sha512-YT7U7Vye+t5fZ/QMkBFrTJ7ZQxInIUjwyAjVj84CYXqgBdv30MFUPGnBR6sQaVq6Is15wYJUsnzTuWaGRBhBAQ==", "dev": true, "license": "ISC", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" + "foreground-child": "^3.1.0", + "jackspeak": "^4.0.1", + "minimatch": "^10.0.0", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^2.0.0" + }, + "bin": { + "glob": "dist/esm/bin.mjs" }, "engines": { - "node": ">=12" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -4903,17 +5021,43 @@ "node": ">= 6" } }, + "node_modules/glob/node_modules/balanced-match": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-3.0.1.tgz", + "integrity": "sha512-vjtV3hiLqYDNRoiAv0zC4QaGAMPomEoq83PRmYIofPswwZurCeWR5LByXm7SyoL0Zh5+2z0+HC7jG8gSZJUh0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 16" + } + }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-4.0.1.tgz", + "integrity": "sha512-YClrbvTCXGe70pU2JiEiPLYXO9gQkyxYeKpJIQHVS/gOs6EWMQP2RYBwjFLNT322Ji8TOC3IMPfsYCedNpzKfA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^3.0.0" + }, + "engines": { + "node": ">= 18" + } + }, "node_modules/glob/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.2.tgz", + "integrity": "sha512-+9TJCIYXgZ2Dm5LxVCFsa8jOm+evMwXHFI0JM1XROmkfkpz8/iLLDh+TwSmyIBrs6C6Xu9294/fq8cBA+P6AqA==", "dev": true, "license": "ISC", "dependencies": { - "brace-expansion": "^2.0.1" + "brace-expansion": "^4.0.1" }, "engines": { - "node": ">=10" + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/globals": { @@ -5000,6 +5144,72 @@ "dev": true, "license": "MIT" }, + "node_modules/gray-matter": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/gray-matter/-/gray-matter-4.0.3.tgz", + "integrity": "sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "js-yaml": "^3.13.1", + "kind-of": "^6.0.2", + "section-matter": "^1.0.0", + "strip-bom-string": "^1.0.0" + }, + "engines": { + "node": ">=6.0" + } + }, + "node_modules/gray-matter/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/gray-matter/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/handlebars": { + "version": "4.7.8", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", + "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "minimist": "^1.2.5", + "neo-async": "^2.6.2", + "source-map": "^0.6.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" + }, + "engines": { + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" + } + }, "node_modules/has-bigints": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", @@ -5143,6 +5353,40 @@ "readable-stream": "^3.6.0" } }, + "node_modules/help-me/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/help-me/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/help-me/node_modules/readable-stream": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", @@ -5286,6 +5530,20 @@ "dev": true, "license": "ISC" }, + "node_modules/inputformat-to-jstransformer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/inputformat-to-jstransformer/-/inputformat-to-jstransformer-1.4.0.tgz", + "integrity": "sha512-Ub+Wjb0mjaND4IS/GDvQ+TEyd1i9U4OdrF58mBY7QTYu8CK5K34DPV7mrvo/WQBJLj7UJWQc7QAmFb7CbQ5lLw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "require-one": "^1.0.3" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/internal-slot": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", @@ -5492,10 +5750,21 @@ "dev": true, "license": "MIT" }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, "license": "MIT", "engines": { @@ -5827,6 +6096,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/is-weakmap": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", @@ -5944,19 +6221,19 @@ } }, "node_modules/jackspeak": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", - "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.1.1.tgz", + "integrity": "sha512-zptv57P3GpL+O0I7VdMJNBZCu+BPHVQUk55Ft8/QCJjTVxrnJHuVuX/0Bl2A6/+2oyR/ZMEuFKwmzqqZ/U5nPQ==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/cliui": "^8.0.2" }, + "engines": { + "node": "20 || >=22" + }, "funding": { "url": "https://github.com/sponsors/isaacs" - }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" } }, "node_modules/joycon": { @@ -6057,6 +6334,40 @@ "npm": ">=6" } }, + "node_modules/jstransformer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/jstransformer/-/jstransformer-1.0.0.tgz", + "integrity": "sha512-C9YK3Rf8q6VAPDCCU9fnqo3mAfOH6vUGnMcP4AQAYIEpWtfGLpwOTmZ+igtdK5y+VvI2n3CyYSzy4Qh34eq24A==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "is-promise": "^2.0.0", + "promise": "^7.0.1" + } + }, + "node_modules/jstransformer-handlebars": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/jstransformer-handlebars/-/jstransformer-handlebars-1.2.0.tgz", + "integrity": "sha512-XqdE9hKMwyVxdMg52MmJOf6zmrXn2JJMvymHulUQxtkxeipVuxh5xJ1UVNcc06ioC61WG5B+XAnaEJY7efmFxQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "handlebars": "^4.7.7" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/jstransformer/node_modules/is-promise": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz", + "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/jwa": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.2.tgz", @@ -6090,6 +6401,17 @@ "json-buffer": "3.0.1" } }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/landlubber": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/landlubber/-/landlubber-2.0.0.tgz", @@ -6197,6 +6519,14 @@ "dev": true, "license": "MIT" }, + "node_modules/lodash.clonedeepwith": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeepwith/-/lodash.clonedeepwith-4.5.0.tgz", + "integrity": "sha512-QRBRSxhbtsX1nc0baxSkkK5WlVTTm/s48DSukcGcWZwIyI8Zz+lB+kFiELJXtzfH4Aj6kMWQ1VWW4U5uUDgZMA==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/lodash.includes": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", @@ -6261,11 +6591,14 @@ "license": "MIT" }, "node_modules/lru-cache": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", - "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.1.0.tgz", + "integrity": "sha512-QIXZUBJUx+2zHUdQujWejBkcD9+cs94tLn0+YL8UrCh+D5sCXZ4c7LaEH48pNwRY3MLDgqUFyhlCyjJPf1WP0A==", "dev": true, - "license": "ISC" + "license": "ISC", + "engines": { + "node": "20 || >=22" + } }, "node_modules/lunr": { "version": "2.3.9", @@ -6451,6 +6784,32 @@ "node": ">= 8" } }, + "node_modules/metalsmith": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/metalsmith/-/metalsmith-2.6.3.tgz", + "integrity": "sha512-nql0eDbeDdYY3cz0uDVmwQ/E9XDBAHBf5p3lz+IwZAlUvz72DAd5+F+vl7Fot7I+yQDVK59uB0CL9S+Ts7ELsw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "peer": true, + "dependencies": { + "chokidar": "^3.6.0", + "commander": "^10.0.1", + "debug": "^4.3.4", + "gray-matter": "^4.0.3", + "is-utf8": "~0.2.0", + "lodash.clonedeepwith": "^4.5.0", + "micromatch": "^4.0.5", + "stat-mode": "^1.0.0", + "ware": "^1.3.0" + }, + "bin": { + "metalsmith": "bin/metalsmith" + }, + "engines": { + "node": ">=14.18.0" + } + }, "node_modules/micromark-util-character": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz", @@ -6629,6 +6988,23 @@ "node": ">=16 || 14 >=14.17" } }, + "node_modules/mkdirp": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/mlly": { "version": "1.7.4", "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.4.tgz", @@ -6682,6 +7058,14 @@ "dev": true, "license": "MIT" }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/nock": { "version": "14.0.5", "resolved": "https://registry.npmjs.org/nock/-/nock-14.0.5.tgz", @@ -7145,17 +7529,17 @@ "peer": true }, "node_modules/path-scurry": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", - "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", + "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { - "lru-cache": "^10.2.0", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" }, "engines": { - "node": ">=16 || 14 >=14.18" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -7534,6 +7918,17 @@ "dev": true, "license": "MIT" }, + "node_modules/promise": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", + "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "asap": "~2.0.3" + } + }, "node_modules/propagate": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/propagate/-/propagate-2.0.1.tgz", @@ -7766,6 +8161,14 @@ "node": ">=0.10.0" } }, + "node_modules/require-one": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/require-one/-/require-one-1.0.3.tgz", + "integrity": "sha512-5nXixwgbAZfQ65g7fXv5fDXYRiKByOT1NT3EffS+0W/1MoF+Lkbsly3MXIlPIAgEtspX5fWAbXnp6d4BNMx+xQ==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/resolve": { "version": "1.22.10", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", @@ -7860,9 +8263,9 @@ } }, "node_modules/rimraf/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, "license": "MIT", "dependencies": { @@ -7906,9 +8309,9 @@ } }, "node_modules/rollup": { - "version": "4.41.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.41.1.tgz", - "integrity": "sha512-cPmwD3FnFv8rKMBc1MxWCwVQFxwf1JEmSX3iQXrRVVG15zerAIXRjMFVWnd5Q5QvgKF7Aj+5ykXFhUl+QGnyOw==", + "version": "4.43.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.43.0.tgz", + "integrity": "sha512-wdN2Kd3Twh8MAEOEJZsuxuLKCsBEo4PVNLK6tQWAn10VhsVewQLzcucMgLolRlhFybGxfclbPeEYBaP6RvUFGg==", "dev": true, "license": "MIT", "dependencies": { @@ -7922,29 +8325,36 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.41.1", - "@rollup/rollup-android-arm64": "4.41.1", - "@rollup/rollup-darwin-arm64": "4.41.1", - "@rollup/rollup-darwin-x64": "4.41.1", - "@rollup/rollup-freebsd-arm64": "4.41.1", - "@rollup/rollup-freebsd-x64": "4.41.1", - "@rollup/rollup-linux-arm-gnueabihf": "4.41.1", - "@rollup/rollup-linux-arm-musleabihf": "4.41.1", - "@rollup/rollup-linux-arm64-gnu": "4.41.1", - "@rollup/rollup-linux-arm64-musl": "4.41.1", - "@rollup/rollup-linux-loongarch64-gnu": "4.41.1", - "@rollup/rollup-linux-powerpc64le-gnu": "4.41.1", - "@rollup/rollup-linux-riscv64-gnu": "4.41.1", - "@rollup/rollup-linux-riscv64-musl": "4.41.1", - "@rollup/rollup-linux-s390x-gnu": "4.41.1", - "@rollup/rollup-linux-x64-gnu": "4.41.1", - "@rollup/rollup-linux-x64-musl": "4.41.1", - "@rollup/rollup-win32-arm64-msvc": "4.41.1", - "@rollup/rollup-win32-ia32-msvc": "4.41.1", - "@rollup/rollup-win32-x64-msvc": "4.41.1", + "@rollup/rollup-android-arm-eabi": "4.43.0", + "@rollup/rollup-android-arm64": "4.43.0", + "@rollup/rollup-darwin-arm64": "4.43.0", + "@rollup/rollup-darwin-x64": "4.43.0", + "@rollup/rollup-freebsd-arm64": "4.43.0", + "@rollup/rollup-freebsd-x64": "4.43.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.43.0", + "@rollup/rollup-linux-arm-musleabihf": "4.43.0", + "@rollup/rollup-linux-arm64-gnu": "4.43.0", + "@rollup/rollup-linux-arm64-musl": "4.43.0", + "@rollup/rollup-linux-loongarch64-gnu": "4.43.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.43.0", + "@rollup/rollup-linux-riscv64-gnu": "4.43.0", + "@rollup/rollup-linux-riscv64-musl": "4.43.0", + "@rollup/rollup-linux-s390x-gnu": "4.43.0", + "@rollup/rollup-linux-x64-gnu": "4.43.0", + "@rollup/rollup-linux-x64-musl": "4.43.0", + "@rollup/rollup-win32-arm64-msvc": "4.43.0", + "@rollup/rollup-win32-ia32-msvc": "4.43.0", + "@rollup/rollup-win32-x64-msvc": "4.43.0", "fsevents": "~2.3.2" } }, + "node_modules/rollup/node_modules/@types/estree": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz", + "integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==", + "dev": true, + "license": "MIT" + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -8068,6 +8478,21 @@ "node": ">=10" } }, + "node_modules/section-matter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/section-matter/-/section-matter-1.0.0.tgz", + "integrity": "sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "extend-shallow": "^2.0.1", + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/secure-json-parse": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.7.0.tgz", @@ -8356,16 +8781,14 @@ } }, "node_modules/source-map": { - "version": "0.8.0-beta.0", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz", - "integrity": "sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==", + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, "license": "BSD-3-Clause", - "dependencies": { - "whatwg-url": "^7.0.0" - }, + "peer": true, "engines": { - "node": ">= 8" + "node": ">=0.10.0" } }, "node_modules/space-separated-tokens": { @@ -8419,6 +8842,17 @@ "node": ">=8" } }, + "node_modules/stat-mode": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stat-mode/-/stat-mode-1.0.0.tgz", + "integrity": "sha512-jH9EhtKIjuXZ2cWxmXS8ZP80XyC3iasQxMDV8jzhNJpfDb7VbQLVW4Wvsxz9QZvzV+G4YoSfBUVKDOyxLzi/sg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 6" + } + }, "node_modules/stop-iteration-iterator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", @@ -8653,6 +9087,17 @@ "node": ">=4" } }, + "node_modules/strip-bom-string": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz", + "integrity": "sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/strip-final-newline": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-4.0.0.tgz", @@ -8733,6 +9178,29 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/sucrase/node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/sucrase/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, "node_modules/sucrase/node_modules/minimatch": { "version": "9.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", @@ -8749,6 +9217,23 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/sucrase/node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/supertap": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/supertap/-/supertap-3.0.1.tgz", @@ -8865,6 +9350,29 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/test-exclude/node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/test-exclude/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, "node_modules/test-exclude/node_modules/minimatch": { "version": "9.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", @@ -8881,6 +9389,23 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/test-exclude/node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -8956,9 +9481,9 @@ } }, "node_modules/tinyglobby/node_modules/fdir": { - "version": "6.4.5", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.5.tgz", - "integrity": "sha512-4BG7puHpVsIYxZUbiUE3RqGloLaSSwzYie5jvasC4LWuBWzZawynvYouhjbQKw2JuIGYdm0DzIxl8iVidKlUEw==", + "version": "6.4.6", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.6.tgz", + "integrity": "sha512-hiFoqpyZcfNm1yc4u8oWCf9A2c4D3QjCrks3zmoVKVxpQRzmPNar1hUJcBG2RQHvEVGDN+Jm81ZheVLAQMK6+w==", "dev": true, "license": "MIT", "peerDependencies": { @@ -9069,6 +9594,16 @@ "node": ">=16.20.2" } }, + "node_modules/tsc-alias/node_modules/commander": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", + "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || >=14" + } + }, "node_modules/tsconfig-paths": { "version": "3.15.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", @@ -9183,10 +9718,23 @@ "node": ">=8" } }, + "node_modules/tsup/node_modules/source-map": { + "version": "0.8.0-beta.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz", + "integrity": "sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "whatwg-url": "^7.0.0" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/tsx": { - "version": "4.19.4", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.19.4.tgz", - "integrity": "sha512-gK5GVzDkJK1SI1zwHf32Mqxf2tSJkNx+eYcNly5+nHvWqXUJYUkWBQtKauoESz3ymezAI++ZwT855x5p5eop+Q==", + "version": "4.20.1", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.20.1.tgz", + "integrity": "sha512-JsFUnMHIE+g8KllOvWTrSOwCKM10xLcsesvUQR61znsbrcwZ4U/QaqdymmvTqG5GMD7k2VFv9UG35C4dRy34Ag==", "dev": true, "license": "MIT", "dependencies": { @@ -9378,6 +9926,21 @@ "dev": true, "license": "MIT" }, + "node_modules/uglify-js": { + "version": "3.19.3", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", + "integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==", + "dev": true, + "license": "BSD-2-Clause", + "optional": true, + "peer": true, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/unbox-primitive": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz", @@ -9564,6 +10127,17 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/ware": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/ware/-/ware-1.3.0.tgz", + "integrity": "sha512-Y2HUDMktriUm+SR2gZWxlrszcgtXExlhQYZ8QJNYbl22jum00KIUcHJ/h/sdAXhWTJcbSkiMYN9Z2tWbWYSrrw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "wrap-fn": "^0.1.0" + } + }, "node_modules/web-streams-polyfill": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", @@ -9722,19 +10296,27 @@ "node": ">=0.10.0" } }, + "node_modules/wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dev": true, "license": "MIT", "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" }, "engines": { - "node": ">=10" + "node": ">=12" }, "funding": { "url": "https://github.com/chalk/wrap-ansi?sponsor=1" @@ -9830,75 +10412,15 @@ "node": ">=8" } }, - "node_modules/wrap-ansi/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" - }, - "node_modules/wrap-ansi/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "node_modules/wrap-fn": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/wrap-fn/-/wrap-fn-0.1.5.tgz", + "integrity": "sha512-xDLdGx0M8JQw9QDAC9s5NUxtg9MI09F6Vbxa2LYoSoCvzJnx2n81YMIfykmXEGsUvuLaxnblJTzhSOjUOX37ag==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" + "co": "3.1.0" } }, "node_modules/wrappy": { @@ -10056,9 +10578,9 @@ } }, "node_modules/zod": { - "version": "3.25.51", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.51.tgz", - "integrity": "sha512-TQSnBldh+XSGL+opiSIq0575wvDPqu09AqWe1F7JhUMKY+M91/aGlK4MhpVNO7MgYfHcVCB1ffwAUTJzllKJqg==", + "version": "3.25.62", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.62.tgz", + "integrity": "sha512-YCxsr4DmhPcrKPC9R1oBHQNlQzlJEyPAId//qTau/vBee9uO8K6prmRq4eMkOyxvBfH4wDPIPdLx9HVMWIY3xA==", "dev": true, "license": "MIT", "funding": { diff --git a/package.json b/package.json index 7d5d59ad..82e7ff1a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@seamapi/http", - "version": "1.34.0", + "version": "1.33.0", "description": "JavaScript HTTP client for the Seam API written in TypeScript.", "type": "module", "main": "index.js", @@ -69,14 +69,15 @@ "test:watch": "ava --watch", "test:debug": "ava debug --break", "lint": "eslint --ignore-path .gitignore .", - "prelint": "prettier --check --ignore-path .gitignore .", + "prelint": "prettier --check --ignore-path .prettierignore .", "prepack": "tsx ./prepack.ts", "postversion": "git push --follow-tags", "example": "tsx examples", "example:inspect": "tsx --inspect examples", - "generate": "tsx generate-routes.ts", + "generate": "tsx codegen/smith.ts", + "postgenerate": "npm run format", "format": "eslint --ignore-path .gitignore --fix .", - "preformat": "prettier --write --ignore-path .gitignore .", + "postformat": "prettier --write --ignore-path .prettierignore .", "report": "c8 report" }, "engines": { @@ -84,7 +85,7 @@ "npm": ">=10.1.0" }, "peerDependencies": { - "@seamapi/types": "^1.410.1" + "@seamapi/types": "^1.413.0" }, "peerDependenciesMeta": { "@seamapi/types": { @@ -97,8 +98,10 @@ "axios-retry": "^4.4.2" }, "devDependencies": { + "@seamapi/blueprint": "^0.48.1", "@seamapi/fake-seam-connect": "^1.77.0", - "@seamapi/types": "1.410.1", + "@seamapi/smith": "^0.4.4", + "@seamapi/types": "1.413.0", "@swc/core": "^1.11.29", "@types/eslint": "^8.44.2", "@types/jsonwebtoken": "^9.0.6", @@ -107,7 +110,6 @@ "c8": "^10.1.2", "change-case": "^5.0.2", "concurrently": "^9.1.0", - "del": "^8.0.0", "del-cli": "^6.0.0", "eslint": "^8.9.0", "eslint-config-prettier": "^9.0.0", diff --git a/src/lib/seam/connect/index.ts b/src/lib/seam/connect/index.ts index 1f0abca1..818b2fab 100644 --- a/src/lib/seam/connect/index.ts +++ b/src/lib/seam/connect/index.ts @@ -11,7 +11,6 @@ export { SeamActionAttemptTimeoutError, } from './resolve-action-attempt.js' export * from './routes/index.js' -export * from './seam-http.js' export * from './seam-http-error.js' export * from './seam-http-multi-workspace.js' export * from './seam-http-request.js' diff --git a/src/lib/seam/connect/seam-http.ts b/src/lib/seam/connect/seam-http.ts deleted file mode 100644 index 9eae2165..00000000 --- a/src/lib/seam/connect/seam-http.ts +++ /dev/null @@ -1,246 +0,0 @@ -import { seamApiLtsVersion } from 'lib/lts-version.js' - -import { - getAuthHeadersForClientSessionToken, - warnOnInsecureuserIdentifierKey, -} from './auth.js' -import { type Client, createClient } from './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 './options.js' -import { limitToSeamHttpRequestOptions, parseOptions } from './parse-options.js' -import { - SeamHttpAccessCodes, - SeamHttpAccessGrants, - SeamHttpAccessMethods, - SeamHttpAcs, - SeamHttpActionAttempts, - SeamHttpClientSessions, - SeamHttpConnectedAccounts, - SeamHttpConnectWebviews, - SeamHttpDevices, - SeamHttpEvents, - SeamHttpLocks, - SeamHttpNoiseSensors, - SeamHttpPhones, - SeamHttpSpaces, - SeamHttpThermostats, - SeamHttpUserIdentities, - SeamHttpWebhooks, - SeamHttpWorkspaces, -} from './routes/index.js' -import type { SeamHttpRequest } from './seam-http-request.js' -import { SeamPaginator } from './seam-paginator.js' - -export class SeamHttp { - client: Client - readonly defaults: Required - readonly ltsVersion = seamApiLtsVersion - static ltsVersion = seamApiLtsVersion - - constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { - const options = parseOptions(apiKeyOrOptions) - this.client = 'client' in options ? options.client : createClient(options) - this.defaults = limitToSeamHttpRequestOptions(options) - } - - static fromClient( - client: SeamHttpOptionsWithClient['client'], - options: Omit = {}, - ): SeamHttp { - const constructorOptions = { ...options, client } - if (!isSeamHttpOptionsWithClient(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing client') - } - return new SeamHttp(constructorOptions) - } - - static fromApiKey( - apiKey: SeamHttpOptionsWithApiKey['apiKey'], - options: Omit = {}, - ): SeamHttp { - const constructorOptions = { ...options, apiKey } - if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing apiKey') - } - return new SeamHttp(constructorOptions) - } - - static fromClientSessionToken( - clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], - options: Omit< - SeamHttpOptionsWithClientSessionToken, - 'clientSessionToken' - > = {}, - ): SeamHttp { - const constructorOptions = { ...options, clientSessionToken } - if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') - } - return new SeamHttp(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 SeamHttp.fromPublishableKey', - ) - } - const client = createClient(clientOptions) - const clientSessions = SeamHttpClientSessions.fromClient(client) - const { token } = await clientSessions.getOrCreate({ - user_identifier_key: userIdentifierKey, - }) - return SeamHttp.fromClientSessionToken(token, options) - } - - static fromConsoleSessionToken( - consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], - workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithConsoleSessionToken, - 'consoleSessionToken' | 'workspaceId' - > = {}, - ): SeamHttp { - const constructorOptions = { ...options, consoleSessionToken, workspaceId } - if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing consoleSessionToken or workspaceId', - ) - } - return new SeamHttp(constructorOptions) - } - - static fromPersonalAccessToken( - personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], - workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], - options: Omit< - SeamHttpOptionsWithPersonalAccessToken, - 'personalAccessToken' | 'workspaceId' - > = {}, - ): SeamHttp { - const constructorOptions = { ...options, personalAccessToken, workspaceId } - if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { - throw new SeamHttpInvalidOptionsError( - 'Missing personalAccessToken or workspaceId', - ) - } - return new SeamHttp(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 accessCodes(): SeamHttpAccessCodes { - return SeamHttpAccessCodes.fromClient(this.client, this.defaults) - } - - get accessGrants(): SeamHttpAccessGrants { - return SeamHttpAccessGrants.fromClient(this.client, this.defaults) - } - - get accessMethods(): SeamHttpAccessMethods { - return SeamHttpAccessMethods.fromClient(this.client, this.defaults) - } - - get acs(): SeamHttpAcs { - return SeamHttpAcs.fromClient(this.client, this.defaults) - } - - get actionAttempts(): SeamHttpActionAttempts { - return SeamHttpActionAttempts.fromClient(this.client, this.defaults) - } - - get clientSessions(): SeamHttpClientSessions { - return SeamHttpClientSessions.fromClient(this.client, this.defaults) - } - - get connectedAccounts(): SeamHttpConnectedAccounts { - return SeamHttpConnectedAccounts.fromClient(this.client, this.defaults) - } - - get connectWebviews(): SeamHttpConnectWebviews { - return SeamHttpConnectWebviews.fromClient(this.client, this.defaults) - } - - get devices(): SeamHttpDevices { - return SeamHttpDevices.fromClient(this.client, this.defaults) - } - - get events(): SeamHttpEvents { - return SeamHttpEvents.fromClient(this.client, this.defaults) - } - - get locks(): SeamHttpLocks { - return SeamHttpLocks.fromClient(this.client, this.defaults) - } - - get noiseSensors(): SeamHttpNoiseSensors { - return SeamHttpNoiseSensors.fromClient(this.client, this.defaults) - } - - get phones(): SeamHttpPhones { - return SeamHttpPhones.fromClient(this.client, this.defaults) - } - - get spaces(): SeamHttpSpaces { - return SeamHttpSpaces.fromClient(this.client, this.defaults) - } - - get thermostats(): SeamHttpThermostats { - return SeamHttpThermostats.fromClient(this.client, this.defaults) - } - - get userIdentities(): SeamHttpUserIdentities { - return SeamHttpUserIdentities.fromClient(this.client, this.defaults) - } - - get webhooks(): SeamHttpWebhooks { - return SeamHttpWebhooks.fromClient(this.client, this.defaults) - } - - get workspaces(): Omit { - return SeamHttpWorkspaces.fromClient(this.client, this.defaults) - } -} diff --git a/tsconfig.json b/tsconfig.json index a39b5e87..86f35eac 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,6 +10,7 @@ "jsx": "react-jsx", "sourceMap": true, "newLine": "lf", + "skipLibCheck": true, "verbatimModuleSyntax": true, "allowUnreachableCode": false, "allowUnusedLabels": false, @@ -35,8 +36,8 @@ "src/**/*", "test/**/*", "examples/**/*", + "codegen/**/*", "tsup.config.ts", - "prepack.ts", - "generate-routes.ts" + "prepack.ts" ] } From f52f89760f99c5035058cb5eeda2b0db9fe1f5ea Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Fri, 13 Jun 2025 02:18:14 +0000 Subject: [PATCH 2/2] ci: Generate code --- .../routes/{ => access-codes}/access-codes.ts | 53 ++++---- .../seam/connect/routes/access-codes/index.ts | 8 ++ .../routes/access-codes/simulate/index.ts | 6 + .../simulate/simulate.ts} | 12 +- .../routes/access-codes/unmanaged/index.ts | 6 + .../unmanaged/unmanaged.ts} | 32 ++--- .../{ => access-grants}/access-grants.ts | 30 +++-- .../connect/routes/access-grants/index.ts | 6 + .../{ => access-methods}/access-methods.ts | 28 ++-- .../connect/routes/access-methods/index.ts | 6 + .../access-groups/access-groups.ts} | 42 +++--- .../connect/routes/acs/access-groups/index.ts | 6 + src/lib/seam/connect/routes/{ => acs}/acs.ts | 29 +++-- .../credentials/credentials.ts} | 44 ++++--- .../connect/routes/acs/credentials/index.ts | 6 + .../encoders/encoders.ts} | 35 ++--- .../seam/connect/routes/acs/encoders/index.ts | 7 + .../routes/acs/encoders/simulate/index.ts | 6 + .../encoders/simulate/simulate.ts} | 18 +-- .../entrances/entrances.ts} | 30 +++-- .../connect/routes/acs/entrances/index.ts | 6 + src/lib/seam/connect/routes/acs/index.ts | 12 ++ .../seam/connect/routes/acs/systems/index.ts | 6 + .../systems/systems.ts} | 28 ++-- .../seam/connect/routes/acs/users/index.ts | 6 + .../{acs-users.ts => acs/users/users.ts} | 56 ++++---- .../{ => action-attempts}/action-attempts.ts | 24 ++-- .../connect/routes/action-attempts/index.ts | 6 + .../{ => client-sessions}/client-sessions.ts | 41 +++--- .../connect/routes/client-sessions/index.ts | 6 + .../connect-webviews.ts | 32 +++-- .../connect/routes/connect-webviews/index.ts | 6 + .../connected-accounts.ts | 32 ++--- .../routes/connected-accounts/index.ts | 6 + .../connect/routes/{ => devices}/devices.ts | 43 +++--- src/lib/seam/connect/routes/devices/index.ts | 8 ++ .../connect/routes/devices/simulate/index.ts | 6 + .../simulate/simulate.ts} | 16 ++- .../connect/routes/devices/unmanaged/index.ts | 6 + .../unmanaged/unmanaged.ts} | 24 ++-- .../connect/routes/{ => events}/events.ts | 24 ++-- src/lib/seam/connect/routes/events/index.ts | 6 + src/lib/seam/connect/routes/index.ts | 61 ++++----- src/lib/seam/connect/routes/locks/index.ts | 6 + .../seam/connect/routes/{ => locks}/locks.ts | 32 +++-- .../connect/routes/noise-sensors/index.ts | 8 ++ .../{ => noise-sensors}/noise-sensors.ts | 19 +-- .../noise-sensors/noise-thresholds/index.ts | 6 + .../noise-thresholds/noise-thresholds.ts} | 32 ++--- .../routes/noise-sensors/simulate/index.ts | 6 + .../simulate/simulate.ts} | 12 +- src/lib/seam/connect/routes/phones/index.ts | 7 + .../connect/routes/{ => phones}/phones.ts | 33 +++-- .../connect/routes/phones/simulate/index.ts | 6 + .../simulate/simulate.ts} | 12 +- .../{unstable-partner.ts => seam-http.ts} | 122 +++++++++++++++--- src/lib/seam/connect/routes/spaces/index.ts | 6 + .../connect/routes/{ => spaces}/spaces.ts | 58 +++++---- .../daily-programs/daily-programs.ts} | 22 ++-- .../thermostats/daily-programs/index.ts | 6 + .../seam/connect/routes/thermostats/index.ts | 9 ++ .../routes/thermostats/schedules/index.ts | 6 + .../schedules/schedules.ts} | 32 ++--- .../routes/thermostats/simulate/index.ts | 6 + .../simulate/simulate.ts} | 14 +- .../routes/{ => thermostats}/thermostats.ts | 77 +++++------ .../enrollment-automations.ts} | 30 +++-- .../enrollment-automations/index.ts | 6 + .../connect/routes/user-identities/index.ts | 7 + .../{ => user-identities}/user-identities.ts | 71 +++++----- src/lib/seam/connect/routes/webhooks/index.ts | 6 + .../connect/routes/{ => webhooks}/webhooks.ts | 40 +++--- .../seam/connect/routes/workspaces/index.ts | 6 + .../routes/{ => workspaces}/workspaces.ts | 40 +++--- 74 files changed, 1021 insertions(+), 593 deletions(-) rename src/lib/seam/connect/routes/{ => access-codes}/access-codes.ts (92%) create mode 100644 src/lib/seam/connect/routes/access-codes/index.ts create mode 100644 src/lib/seam/connect/routes/access-codes/simulate/index.ts rename src/lib/seam/connect/routes/{access-codes-simulate.ts => access-codes/simulate/simulate.ts} (94%) create mode 100644 src/lib/seam/connect/routes/access-codes/unmanaged/index.ts rename src/lib/seam/connect/routes/{access-codes-unmanaged.ts => access-codes/unmanaged/unmanaged.ts} (92%) rename src/lib/seam/connect/routes/{ => access-grants}/access-grants.ts (91%) create mode 100644 src/lib/seam/connect/routes/access-grants/index.ts rename src/lib/seam/connect/routes/{ => access-methods}/access-methods.ts (91%) create mode 100644 src/lib/seam/connect/routes/access-methods/index.ts rename src/lib/seam/connect/routes/{acs-access-groups.ts => acs/access-groups/access-groups.ts} (91%) create mode 100644 src/lib/seam/connect/routes/acs/access-groups/index.ts rename src/lib/seam/connect/routes/{ => acs}/acs.ts (89%) rename src/lib/seam/connect/routes/{acs-credentials.ts => acs/credentials/credentials.ts} (91%) create mode 100644 src/lib/seam/connect/routes/acs/credentials/index.ts rename src/lib/seam/connect/routes/{acs-encoders.ts => acs/encoders/encoders.ts} (91%) create mode 100644 src/lib/seam/connect/routes/acs/encoders/index.ts create mode 100644 src/lib/seam/connect/routes/acs/encoders/simulate/index.ts rename src/lib/seam/connect/routes/{acs-encoders-simulate.ts => acs/encoders/simulate/simulate.ts} (95%) rename src/lib/seam/connect/routes/{acs-entrances.ts => acs/entrances/entrances.ts} (92%) create mode 100644 src/lib/seam/connect/routes/acs/entrances/index.ts create mode 100644 src/lib/seam/connect/routes/acs/index.ts create mode 100644 src/lib/seam/connect/routes/acs/systems/index.ts rename src/lib/seam/connect/routes/{acs-systems.ts => acs/systems/systems.ts} (92%) create mode 100644 src/lib/seam/connect/routes/acs/users/index.ts rename src/lib/seam/connect/routes/{acs-users.ts => acs/users/users.ts} (91%) rename src/lib/seam/connect/routes/{ => action-attempts}/action-attempts.ts (92%) create mode 100644 src/lib/seam/connect/routes/action-attempts/index.ts rename src/lib/seam/connect/routes/{ => client-sessions}/client-sessions.ts (92%) create mode 100644 src/lib/seam/connect/routes/client-sessions/index.ts rename src/lib/seam/connect/routes/{ => connect-webviews}/connect-webviews.ts (91%) create mode 100644 src/lib/seam/connect/routes/connect-webviews/index.ts rename src/lib/seam/connect/routes/{ => connected-accounts}/connected-accounts.ts (92%) create mode 100644 src/lib/seam/connect/routes/connected-accounts/index.ts rename src/lib/seam/connect/routes/{ => devices}/devices.ts (90%) create mode 100644 src/lib/seam/connect/routes/devices/index.ts create mode 100644 src/lib/seam/connect/routes/devices/simulate/index.ts rename src/lib/seam/connect/routes/{devices-simulate.ts => devices/simulate/simulate.ts} (94%) create mode 100644 src/lib/seam/connect/routes/devices/unmanaged/index.ts rename src/lib/seam/connect/routes/{devices-unmanaged.ts => devices/unmanaged/unmanaged.ts} (92%) rename src/lib/seam/connect/routes/{ => events}/events.ts (91%) create mode 100644 src/lib/seam/connect/routes/events/index.ts create mode 100644 src/lib/seam/connect/routes/locks/index.ts rename src/lib/seam/connect/routes/{ => locks}/locks.ts (91%) create mode 100644 src/lib/seam/connect/routes/noise-sensors/index.ts rename src/lib/seam/connect/routes/{ => noise-sensors}/noise-sensors.ts (91%) create mode 100644 src/lib/seam/connect/routes/noise-sensors/noise-thresholds/index.ts rename src/lib/seam/connect/routes/{noise-sensors-noise-thresholds.ts => noise-sensors/noise-thresholds/noise-thresholds.ts} (92%) create mode 100644 src/lib/seam/connect/routes/noise-sensors/simulate/index.ts rename src/lib/seam/connect/routes/{noise-sensors-simulate.ts => noise-sensors/simulate/simulate.ts} (94%) create mode 100644 src/lib/seam/connect/routes/phones/index.ts rename src/lib/seam/connect/routes/{ => phones}/phones.ts (89%) create mode 100644 src/lib/seam/connect/routes/phones/simulate/index.ts rename src/lib/seam/connect/routes/{phones-simulate.ts => phones/simulate/simulate.ts} (94%) rename src/lib/seam/connect/routes/{unstable-partner.ts => seam-http.ts} (58%) create mode 100644 src/lib/seam/connect/routes/spaces/index.ts rename src/lib/seam/connect/routes/{ => spaces}/spaces.ts (88%) rename src/lib/seam/connect/routes/{thermostats-daily-programs.ts => thermostats/daily-programs/daily-programs.ts} (93%) create mode 100644 src/lib/seam/connect/routes/thermostats/daily-programs/index.ts create mode 100644 src/lib/seam/connect/routes/thermostats/index.ts create mode 100644 src/lib/seam/connect/routes/thermostats/schedules/index.ts rename src/lib/seam/connect/routes/{thermostats-schedules.ts => thermostats/schedules/schedules.ts} (92%) create mode 100644 src/lib/seam/connect/routes/thermostats/simulate/index.ts rename src/lib/seam/connect/routes/{thermostats-simulate.ts => thermostats/simulate/simulate.ts} (94%) rename src/lib/seam/connect/routes/{ => thermostats}/thermostats.ts (91%) rename src/lib/seam/connect/routes/{user-identities-enrollment-automations.ts => user-identities/enrollment-automations/enrollment-automations.ts} (92%) create mode 100644 src/lib/seam/connect/routes/user-identities/enrollment-automations/index.ts create mode 100644 src/lib/seam/connect/routes/user-identities/index.ts rename src/lib/seam/connect/routes/{ => user-identities}/user-identities.ts (90%) create mode 100644 src/lib/seam/connect/routes/webhooks/index.ts rename src/lib/seam/connect/routes/{ => webhooks}/webhooks.ts (90%) create mode 100644 src/lib/seam/connect/routes/workspaces/index.ts rename src/lib/seam/connect/routes/{ => workspaces}/workspaces.ts (90%) diff --git a/src/lib/seam/connect/routes/access-codes.ts b/src/lib/seam/connect/routes/access-codes/access-codes.ts similarity index 92% rename from src/lib/seam/connect/routes/access-codes.ts rename to src/lib/seam/connect/routes/access-codes/access-codes.ts index 5ce281a6..c637ab9c 100644 --- a/src/lib/seam/connect/routes/access-codes.ts +++ b/src/lib/seam/connect/routes/access-codes/access-codes.ts @@ -1,10 +1,11 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -30,17 +31,19 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpAccessCodesSimulate } from './access-codes-simulate.js' -import { SeamHttpAccessCodesUnmanaged } from './access-codes-unmanaged.js' -import { SeamHttpClientSessions } from './client-sessions.js' +import { SeamHttpAccessCodesSimulate } from './simulate/index.js' +import { SeamHttpAccessCodesUnmanaged } from './unmanaged/index.js' export class SeamHttpAccessCodes { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -93,7 +96,7 @@ export class SeamHttpAccessCodes { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpAccessCodes.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -163,20 +166,20 @@ export class SeamHttpAccessCodes { await clientSessions.get() } - get unmanaged(): SeamHttpAccessCodesUnmanaged { - return SeamHttpAccessCodesUnmanaged.fromClient(this.client, this.defaults) - } - get simulate(): SeamHttpAccessCodesSimulate { return SeamHttpAccessCodesSimulate.fromClient(this.client, this.defaults) } + get unmanaged(): SeamHttpAccessCodesUnmanaged { + return SeamHttpAccessCodesUnmanaged.fromClient(this.client, this.defaults) + } + create( body?: AccessCodesCreateBody, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/access_codes/create', - method: 'post', + method: 'POST', body, responseKey: 'access_code', }) @@ -187,17 +190,17 @@ export class SeamHttpAccessCodes { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/access_codes/create_multiple', - method: 'post', + method: 'PUT', body, responseKey: 'access_codes', }) } - delete(body?: AccessCodesDeleteParams): SeamHttpRequest { + delete(params?: AccessCodesDeleteParams): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/access_codes/delete', - method: 'post', - body, + method: 'POST', + body: params, responseKey: undefined, }) } @@ -207,30 +210,30 @@ export class SeamHttpAccessCodes { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/access_codes/generate_code', - method: 'post', + method: 'POST', body, responseKey: 'generated_code', }) } get( - body?: AccessCodesGetParams, + params?: AccessCodesGetParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/access_codes/get', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'access_code', }) } list( - body?: AccessCodesListParams, + params?: AccessCodesListParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/access_codes/list', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'access_codes', }) } @@ -240,7 +243,7 @@ export class SeamHttpAccessCodes { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/access_codes/pull_backup_access_code', - method: 'post', + method: 'POST', body, responseKey: 'access_code', }) @@ -251,7 +254,7 @@ export class SeamHttpAccessCodes { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/access_codes/report_device_constraints', - method: 'post', + method: 'POST', body, responseKey: undefined, }) @@ -260,7 +263,7 @@ export class SeamHttpAccessCodes { update(body?: AccessCodesUpdateBody): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/access_codes/update', - method: 'post', + method: 'PUT', body, responseKey: undefined, }) @@ -271,7 +274,7 @@ export class SeamHttpAccessCodes { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/access_codes/update_multiple', - method: 'post', + method: 'PATCH', body, responseKey: undefined, }) diff --git a/src/lib/seam/connect/routes/access-codes/index.ts b/src/lib/seam/connect/routes/access-codes/index.ts new file mode 100644 index 00000000..5209baf8 --- /dev/null +++ b/src/lib/seam/connect/routes/access-codes/index.ts @@ -0,0 +1,8 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './access-codes.js' +export * from './simulate/index.js' +export * from './unmanaged/index.js' diff --git a/src/lib/seam/connect/routes/access-codes/simulate/index.ts b/src/lib/seam/connect/routes/access-codes/simulate/index.ts new file mode 100644 index 00000000..dd5b7769 --- /dev/null +++ b/src/lib/seam/connect/routes/access-codes/simulate/index.ts @@ -0,0 +1,6 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './simulate.js' diff --git a/src/lib/seam/connect/routes/access-codes-simulate.ts b/src/lib/seam/connect/routes/access-codes/simulate/simulate.ts similarity index 94% rename from src/lib/seam/connect/routes/access-codes-simulate.ts rename to src/lib/seam/connect/routes/access-codes/simulate/simulate.ts index 2d0f2b49..4e8c455b 100644 --- a/src/lib/seam/connect/routes/access-codes-simulate.ts +++ b/src/lib/seam/connect/routes/access-codes/simulate/simulate.ts @@ -1,10 +1,11 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -30,15 +31,16 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpClientSessions } from './client-sessions.js' - export class SeamHttpAccessCodesSimulate { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -91,7 +93,7 @@ export class SeamHttpAccessCodesSimulate { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpAccessCodesSimulate.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -169,7 +171,7 @@ export class SeamHttpAccessCodesSimulate { > { return new SeamHttpRequest(this, { pathname: '/access_codes/simulate/create_unmanaged_access_code', - method: 'post', + method: 'POST', body, responseKey: 'access_code', }) diff --git a/src/lib/seam/connect/routes/access-codes/unmanaged/index.ts b/src/lib/seam/connect/routes/access-codes/unmanaged/index.ts new file mode 100644 index 00000000..bab8a37e --- /dev/null +++ b/src/lib/seam/connect/routes/access-codes/unmanaged/index.ts @@ -0,0 +1,6 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './unmanaged.js' diff --git a/src/lib/seam/connect/routes/access-codes-unmanaged.ts b/src/lib/seam/connect/routes/access-codes/unmanaged/unmanaged.ts similarity index 92% rename from src/lib/seam/connect/routes/access-codes-unmanaged.ts rename to src/lib/seam/connect/routes/access-codes/unmanaged/unmanaged.ts index 138a7cbf..c6d2984a 100644 --- a/src/lib/seam/connect/routes/access-codes-unmanaged.ts +++ b/src/lib/seam/connect/routes/access-codes/unmanaged/unmanaged.ts @@ -1,10 +1,11 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -30,15 +31,16 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpClientSessions } from './client-sessions.js' - export class SeamHttpAccessCodesUnmanaged { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -91,7 +93,7 @@ export class SeamHttpAccessCodesUnmanaged { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpAccessCodesUnmanaged.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -166,41 +168,41 @@ export class SeamHttpAccessCodesUnmanaged { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/access_codes/unmanaged/convert_to_managed', - method: 'post', + method: 'PATCH', body, responseKey: undefined, }) } delete( - body?: AccessCodesUnmanagedDeleteParams, + params?: AccessCodesUnmanagedDeleteParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/access_codes/unmanaged/delete', - method: 'post', - body, + method: 'POST', + body: params, responseKey: undefined, }) } get( - body?: AccessCodesUnmanagedGetParams, + params?: AccessCodesUnmanagedGetParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/access_codes/unmanaged/get', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'access_code', }) } list( - body?: AccessCodesUnmanagedListParams, + params?: AccessCodesUnmanagedListParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/access_codes/unmanaged/list', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'access_codes', }) } @@ -210,7 +212,7 @@ export class SeamHttpAccessCodesUnmanaged { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/access_codes/unmanaged/update', - method: 'post', + method: 'PATCH', body, responseKey: undefined, }) diff --git a/src/lib/seam/connect/routes/access-grants.ts b/src/lib/seam/connect/routes/access-grants/access-grants.ts similarity index 91% rename from src/lib/seam/connect/routes/access-grants.ts rename to src/lib/seam/connect/routes/access-grants/access-grants.ts index b470e039..62f9d80b 100644 --- a/src/lib/seam/connect/routes/access-grants.ts +++ b/src/lib/seam/connect/routes/access-grants/access-grants.ts @@ -1,10 +1,11 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -30,15 +31,16 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpClientSessions } from './client-sessions.js' - export class SeamHttpAccessGrants { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -91,7 +93,7 @@ export class SeamHttpAccessGrants { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpAccessGrants.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -166,39 +168,39 @@ export class SeamHttpAccessGrants { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/access_grants/create', - method: 'post', + method: 'POST', body, responseKey: 'access_grant', }) } - delete(body?: AccessGrantsDeleteParams): SeamHttpRequest { + delete(params?: AccessGrantsDeleteParams): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/access_grants/delete', - method: 'post', - body, + method: 'POST', + body: params, responseKey: undefined, }) } get( - body?: AccessGrantsGetParams, + params?: AccessGrantsGetParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/access_grants/get', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'access_grant', }) } list( - body?: AccessGrantsListParams, + params?: AccessGrantsListParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/access_grants/list', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'access_grants', }) } diff --git a/src/lib/seam/connect/routes/access-grants/index.ts b/src/lib/seam/connect/routes/access-grants/index.ts new file mode 100644 index 00000000..afe09729 --- /dev/null +++ b/src/lib/seam/connect/routes/access-grants/index.ts @@ -0,0 +1,6 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './access-grants.js' diff --git a/src/lib/seam/connect/routes/access-methods.ts b/src/lib/seam/connect/routes/access-methods/access-methods.ts similarity index 91% rename from src/lib/seam/connect/routes/access-methods.ts rename to src/lib/seam/connect/routes/access-methods/access-methods.ts index cb0193d3..24cc8222 100644 --- a/src/lib/seam/connect/routes/access-methods.ts +++ b/src/lib/seam/connect/routes/access-methods/access-methods.ts @@ -1,10 +1,11 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -30,15 +31,16 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpClientSessions } from './client-sessions.js' - export class SeamHttpAccessMethods { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -91,7 +93,7 @@ export class SeamHttpAccessMethods { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpAccessMethods.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -161,33 +163,33 @@ export class SeamHttpAccessMethods { await clientSessions.get() } - delete(body?: AccessMethodsDeleteParams): SeamHttpRequest { + delete(params?: AccessMethodsDeleteParams): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/access_methods/delete', - method: 'post', - body, + method: 'POST', + body: params, responseKey: undefined, }) } get( - body?: AccessMethodsGetParams, + params?: AccessMethodsGetParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/access_methods/get', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'access_method', }) } list( - body?: AccessMethodsListParams, + params?: AccessMethodsListParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/access_methods/list', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'access_methods', }) } diff --git a/src/lib/seam/connect/routes/access-methods/index.ts b/src/lib/seam/connect/routes/access-methods/index.ts new file mode 100644 index 00000000..f339d498 --- /dev/null +++ b/src/lib/seam/connect/routes/access-methods/index.ts @@ -0,0 +1,6 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './access-methods.js' diff --git a/src/lib/seam/connect/routes/acs-access-groups.ts b/src/lib/seam/connect/routes/acs/access-groups/access-groups.ts similarity index 91% rename from src/lib/seam/connect/routes/acs-access-groups.ts rename to src/lib/seam/connect/routes/acs/access-groups/access-groups.ts index 940cbd7b..b4404154 100644 --- a/src/lib/seam/connect/routes/acs-access-groups.ts +++ b/src/lib/seam/connect/routes/acs/access-groups/access-groups.ts @@ -1,10 +1,11 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -30,15 +31,16 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpClientSessions } from './client-sessions.js' - export class SeamHttpAcsAccessGroups { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -91,7 +93,7 @@ export class SeamHttpAcsAccessGroups { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpAcsAccessGroups.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -164,66 +166,66 @@ export class SeamHttpAcsAccessGroups { addUser(body?: AcsAccessGroupsAddUserBody): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/access_groups/add_user', - method: 'post', + method: 'PUT', body, responseKey: undefined, }) } get( - body?: AcsAccessGroupsGetParams, + params?: AcsAccessGroupsGetParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/access_groups/get', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'acs_access_group', }) } list( - body?: AcsAccessGroupsListParams, + params?: AcsAccessGroupsListParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/access_groups/list', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'acs_access_groups', }) } listAccessibleEntrances( - body?: AcsAccessGroupsListAccessibleEntrancesParams, + params?: AcsAccessGroupsListAccessibleEntrancesParams, ): SeamHttpRequest< AcsAccessGroupsListAccessibleEntrancesResponse, 'acs_entrances' > { return new SeamHttpRequest(this, { pathname: '/acs/access_groups/list_accessible_entrances', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'acs_entrances', }) } listUsers( - body?: AcsAccessGroupsListUsersParams, + params?: AcsAccessGroupsListUsersParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/access_groups/list_users', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'acs_users', }) } removeUser( - body?: AcsAccessGroupsRemoveUserParams, + params?: AcsAccessGroupsRemoveUserParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/access_groups/remove_user', - method: 'post', - body, + method: 'POST', + body: params, responseKey: undefined, }) } diff --git a/src/lib/seam/connect/routes/acs/access-groups/index.ts b/src/lib/seam/connect/routes/acs/access-groups/index.ts new file mode 100644 index 00000000..bed34230 --- /dev/null +++ b/src/lib/seam/connect/routes/acs/access-groups/index.ts @@ -0,0 +1,6 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './access-groups.js' diff --git a/src/lib/seam/connect/routes/acs.ts b/src/lib/seam/connect/routes/acs/acs.ts similarity index 89% rename from src/lib/seam/connect/routes/acs.ts rename to src/lib/seam/connect/routes/acs/acs.ts index c16fc82d..51413396 100644 --- a/src/lib/seam/connect/routes/acs.ts +++ b/src/lib/seam/connect/routes/acs/acs.ts @@ -1,8 +1,9 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -28,20 +29,22 @@ 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 { SeamHttpAcsAccessGroups } from './acs-access-groups.js' -import { SeamHttpAcsCredentials } from './acs-credentials.js' -import { SeamHttpAcsEncoders } from './acs-encoders.js' -import { SeamHttpAcsEntrances } from './acs-entrances.js' -import { SeamHttpAcsSystems } from './acs-systems.js' -import { SeamHttpAcsUsers } from './acs-users.js' -import { SeamHttpClientSessions } from './client-sessions.js' +import { SeamHttpAcsAccessGroups } from './access-groups/index.js' +import { SeamHttpAcsCredentials } from './credentials/index.js' +import { SeamHttpAcsEncoders } from './encoders/index.js' +import { SeamHttpAcsEntrances } from './entrances/index.js' +import { SeamHttpAcsSystems } from './systems/index.js' +import { SeamHttpAcsUsers } from './users/index.js' export class SeamHttpAcs { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -94,7 +97,7 @@ export class SeamHttpAcs { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpAcs.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -172,14 +175,14 @@ export class SeamHttpAcs { return SeamHttpAcsCredentials.fromClient(this.client, this.defaults) } - get entrances(): SeamHttpAcsEntrances { - return SeamHttpAcsEntrances.fromClient(this.client, this.defaults) - } - get encoders(): SeamHttpAcsEncoders { return SeamHttpAcsEncoders.fromClient(this.client, this.defaults) } + get entrances(): SeamHttpAcsEntrances { + return SeamHttpAcsEntrances.fromClient(this.client, this.defaults) + } + get systems(): SeamHttpAcsSystems { return SeamHttpAcsSystems.fromClient(this.client, this.defaults) } diff --git a/src/lib/seam/connect/routes/acs-credentials.ts b/src/lib/seam/connect/routes/acs/credentials/credentials.ts similarity index 91% rename from src/lib/seam/connect/routes/acs-credentials.ts rename to src/lib/seam/connect/routes/acs/credentials/credentials.ts index 11f43d52..feef167d 100644 --- a/src/lib/seam/connect/routes/acs-credentials.ts +++ b/src/lib/seam/connect/routes/acs/credentials/credentials.ts @@ -1,10 +1,11 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -30,15 +31,16 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpClientSessions } from './client-sessions.js' - export class SeamHttpAcsCredentials { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -91,7 +93,7 @@ export class SeamHttpAcsCredentials { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpAcsCredentials.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -164,7 +166,7 @@ export class SeamHttpAcsCredentials { assign(body?: AcsCredentialsAssignBody): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/credentials/assign', - method: 'post', + method: 'PATCH', body, responseKey: undefined, }) @@ -175,53 +177,55 @@ export class SeamHttpAcsCredentials { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/credentials/create', - method: 'post', + method: 'POST', body, responseKey: 'acs_credential', }) } - delete(body?: AcsCredentialsDeleteParams): SeamHttpRequest { + delete( + params?: AcsCredentialsDeleteParams, + ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/credentials/delete', - method: 'post', - body, + method: 'POST', + body: params, responseKey: undefined, }) } get( - body?: AcsCredentialsGetParams, + params?: AcsCredentialsGetParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/credentials/get', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'acs_credential', }) } list( - body?: AcsCredentialsListParams, + params?: AcsCredentialsListParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/credentials/list', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'acs_credentials', }) } listAccessibleEntrances( - body?: AcsCredentialsListAccessibleEntrancesParams, + params?: AcsCredentialsListAccessibleEntrancesParams, ): SeamHttpRequest< AcsCredentialsListAccessibleEntrancesResponse, 'acs_entrances' > { return new SeamHttpRequest(this, { pathname: '/acs/credentials/list_accessible_entrances', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'acs_entrances', }) } @@ -231,7 +235,7 @@ export class SeamHttpAcsCredentials { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/credentials/unassign', - method: 'post', + method: 'PATCH', body, responseKey: undefined, }) @@ -240,7 +244,7 @@ export class SeamHttpAcsCredentials { update(body?: AcsCredentialsUpdateBody): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/credentials/update', - method: 'post', + method: 'PATCH', body, responseKey: undefined, }) diff --git a/src/lib/seam/connect/routes/acs/credentials/index.ts b/src/lib/seam/connect/routes/acs/credentials/index.ts new file mode 100644 index 00000000..2d9bacd3 --- /dev/null +++ b/src/lib/seam/connect/routes/acs/credentials/index.ts @@ -0,0 +1,6 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './credentials.js' diff --git a/src/lib/seam/connect/routes/acs-encoders.ts b/src/lib/seam/connect/routes/acs/encoders/encoders.ts similarity index 91% rename from src/lib/seam/connect/routes/acs-encoders.ts rename to src/lib/seam/connect/routes/acs/encoders/encoders.ts index 652c2121..a61b79f1 100644 --- a/src/lib/seam/connect/routes/acs-encoders.ts +++ b/src/lib/seam/connect/routes/acs/encoders/encoders.ts @@ -1,10 +1,11 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -30,16 +31,18 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpAcsEncodersSimulate } from './acs-encoders-simulate.js' -import { SeamHttpClientSessions } from './client-sessions.js' +import { SeamHttpAcsEncodersSimulate } from './simulate/index.js' export class SeamHttpAcsEncoders { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -92,7 +95,7 @@ export class SeamHttpAcsEncoders { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpAcsEncoders.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -168,11 +171,11 @@ export class SeamHttpAcsEncoders { encodeAccessMethod( body?: AcsEncodersEncodeAccessMethodBody, - options: Pick = {}, + options: AcsEncodersEncodeAccessMethodOptions = {}, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/encoders/encode_access_method', - method: 'post', + method: 'POST', body, responseKey: 'action_attempt', options, @@ -181,11 +184,11 @@ export class SeamHttpAcsEncoders { encodeCredential( body?: AcsEncodersEncodeCredentialBody, - options: Pick = {}, + options: AcsEncodersEncodeCredentialOptions = {}, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/encoders/encode_credential', - method: 'post', + method: 'POST', body, responseKey: 'action_attempt', options, @@ -193,34 +196,34 @@ export class SeamHttpAcsEncoders { } get( - body?: AcsEncodersGetParams, + params?: AcsEncodersGetParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/encoders/get', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'acs_encoder', }) } list( - body?: AcsEncodersListParams, + params?: AcsEncodersListParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/encoders/list', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'acs_encoders', }) } scanCredential( body?: AcsEncodersScanCredentialBody, - options: Pick = {}, + options: AcsEncodersScanCredentialOptions = {}, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/encoders/scan_credential', - method: 'post', + method: 'POST', body, responseKey: 'action_attempt', options, diff --git a/src/lib/seam/connect/routes/acs/encoders/index.ts b/src/lib/seam/connect/routes/acs/encoders/index.ts new file mode 100644 index 00000000..44aa7906 --- /dev/null +++ b/src/lib/seam/connect/routes/acs/encoders/index.ts @@ -0,0 +1,7 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './encoders.js' +export * from './simulate/index.js' diff --git a/src/lib/seam/connect/routes/acs/encoders/simulate/index.ts b/src/lib/seam/connect/routes/acs/encoders/simulate/index.ts new file mode 100644 index 00000000..dd5b7769 --- /dev/null +++ b/src/lib/seam/connect/routes/acs/encoders/simulate/index.ts @@ -0,0 +1,6 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './simulate.js' diff --git a/src/lib/seam/connect/routes/acs-encoders-simulate.ts b/src/lib/seam/connect/routes/acs/encoders/simulate/simulate.ts similarity index 95% rename from src/lib/seam/connect/routes/acs-encoders-simulate.ts rename to src/lib/seam/connect/routes/acs/encoders/simulate/simulate.ts index 4f15cde9..75e22507 100644 --- a/src/lib/seam/connect/routes/acs-encoders-simulate.ts +++ b/src/lib/seam/connect/routes/acs/encoders/simulate/simulate.ts @@ -1,10 +1,11 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -30,15 +31,16 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpClientSessions } from './client-sessions.js' - export class SeamHttpAcsEncodersSimulate { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -91,7 +93,7 @@ export class SeamHttpAcsEncodersSimulate { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpAcsEncodersSimulate.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -166,7 +168,7 @@ export class SeamHttpAcsEncodersSimulate { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/encoders/simulate/next_credential_encode_will_fail', - method: 'post', + method: 'POST', body, responseKey: undefined, }) @@ -177,7 +179,7 @@ export class SeamHttpAcsEncodersSimulate { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/encoders/simulate/next_credential_encode_will_succeed', - method: 'post', + method: 'POST', body, responseKey: undefined, }) @@ -188,7 +190,7 @@ export class SeamHttpAcsEncodersSimulate { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/encoders/simulate/next_credential_scan_will_fail', - method: 'post', + method: 'POST', body, responseKey: undefined, }) @@ -199,7 +201,7 @@ export class SeamHttpAcsEncodersSimulate { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/encoders/simulate/next_credential_scan_will_succeed', - method: 'post', + method: 'POST', body, responseKey: undefined, }) diff --git a/src/lib/seam/connect/routes/acs-entrances.ts b/src/lib/seam/connect/routes/acs/entrances/entrances.ts similarity index 92% rename from src/lib/seam/connect/routes/acs-entrances.ts rename to src/lib/seam/connect/routes/acs/entrances/entrances.ts index 60cc5545..2ec57f07 100644 --- a/src/lib/seam/connect/routes/acs-entrances.ts +++ b/src/lib/seam/connect/routes/acs/entrances/entrances.ts @@ -1,10 +1,11 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -30,15 +31,16 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpClientSessions } from './client-sessions.js' - export class SeamHttpAcsEntrances { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -91,7 +93,7 @@ export class SeamHttpAcsEntrances { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpAcsEntrances.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -162,12 +164,12 @@ export class SeamHttpAcsEntrances { } get( - body?: AcsEntrancesGetParams, + params?: AcsEntrancesGetParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/entrances/get', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'acs_entrance', }) } @@ -177,33 +179,33 @@ export class SeamHttpAcsEntrances { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/entrances/grant_access', - method: 'post', + method: 'POST', body, responseKey: undefined, }) } list( - body?: AcsEntrancesListParams, + params?: AcsEntrancesListParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/entrances/list', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'acs_entrances', }) } listCredentialsWithAccess( - body?: AcsEntrancesListCredentialsWithAccessParams, + params?: AcsEntrancesListCredentialsWithAccessParams, ): SeamHttpRequest< AcsEntrancesListCredentialsWithAccessResponse, 'acs_credentials' > { return new SeamHttpRequest(this, { pathname: '/acs/entrances/list_credentials_with_access', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'acs_credentials', }) } diff --git a/src/lib/seam/connect/routes/acs/entrances/index.ts b/src/lib/seam/connect/routes/acs/entrances/index.ts new file mode 100644 index 00000000..3d055f8e --- /dev/null +++ b/src/lib/seam/connect/routes/acs/entrances/index.ts @@ -0,0 +1,6 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './entrances.js' diff --git a/src/lib/seam/connect/routes/acs/index.ts b/src/lib/seam/connect/routes/acs/index.ts new file mode 100644 index 00000000..26399aa6 --- /dev/null +++ b/src/lib/seam/connect/routes/acs/index.ts @@ -0,0 +1,12 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './access-groups/index.js' +export * from './acs.js' +export * from './credentials/index.js' +export * from './encoders/index.js' +export * from './entrances/index.js' +export * from './systems/index.js' +export * from './users/index.js' diff --git a/src/lib/seam/connect/routes/acs/systems/index.ts b/src/lib/seam/connect/routes/acs/systems/index.ts new file mode 100644 index 00000000..bda98574 --- /dev/null +++ b/src/lib/seam/connect/routes/acs/systems/index.ts @@ -0,0 +1,6 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './systems.js' diff --git a/src/lib/seam/connect/routes/acs-systems.ts b/src/lib/seam/connect/routes/acs/systems/systems.ts similarity index 92% rename from src/lib/seam/connect/routes/acs-systems.ts rename to src/lib/seam/connect/routes/acs/systems/systems.ts index c5534c7c..5e3d9bde 100644 --- a/src/lib/seam/connect/routes/acs-systems.ts +++ b/src/lib/seam/connect/routes/acs/systems/systems.ts @@ -1,10 +1,11 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -30,15 +31,16 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpClientSessions } from './client-sessions.js' - export class SeamHttpAcsSystems { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -91,7 +93,7 @@ export class SeamHttpAcsSystems { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpAcsSystems.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -162,37 +164,37 @@ export class SeamHttpAcsSystems { } get( - body?: AcsSystemsGetParams, + params?: AcsSystemsGetParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/systems/get', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'acs_system', }) } list( - body?: AcsSystemsListParams, + params?: AcsSystemsListParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/systems/list', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'acs_systems', }) } listCompatibleCredentialManagerAcsSystems( - body?: AcsSystemsListCompatibleCredentialManagerAcsSystemsParams, + params?: AcsSystemsListCompatibleCredentialManagerAcsSystemsParams, ): SeamHttpRequest< AcsSystemsListCompatibleCredentialManagerAcsSystemsResponse, 'acs_systems' > { return new SeamHttpRequest(this, { pathname: '/acs/systems/list_compatible_credential_manager_acs_systems', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'acs_systems', }) } diff --git a/src/lib/seam/connect/routes/acs/users/index.ts b/src/lib/seam/connect/routes/acs/users/index.ts new file mode 100644 index 00000000..7c31b60d --- /dev/null +++ b/src/lib/seam/connect/routes/acs/users/index.ts @@ -0,0 +1,6 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './users.js' diff --git a/src/lib/seam/connect/routes/acs-users.ts b/src/lib/seam/connect/routes/acs/users/users.ts similarity index 91% rename from src/lib/seam/connect/routes/acs-users.ts rename to src/lib/seam/connect/routes/acs/users/users.ts index eaf12df0..e7f97e2b 100644 --- a/src/lib/seam/connect/routes/acs-users.ts +++ b/src/lib/seam/connect/routes/acs/users/users.ts @@ -1,10 +1,11 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -30,15 +31,16 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpClientSessions } from './client-sessions.js' - export class SeamHttpAcsUsers { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -91,7 +93,7 @@ export class SeamHttpAcsUsers { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpAcsUsers.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -166,7 +168,7 @@ export class SeamHttpAcsUsers { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/users/add_to_access_group', - method: 'post', + method: 'PUT', body, responseKey: undefined, }) @@ -177,72 +179,72 @@ export class SeamHttpAcsUsers { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/users/create', - method: 'post', + method: 'POST', body, responseKey: 'acs_user', }) } - delete(body?: AcsUsersDeleteParams): SeamHttpRequest { + delete(params?: AcsUsersDeleteParams): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/users/delete', - method: 'post', - body, + method: 'POST', + body: params, responseKey: undefined, }) } get( - body?: AcsUsersGetParams, + params?: AcsUsersGetParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/users/get', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'acs_user', }) } list( - body?: AcsUsersListParams, + params?: AcsUsersListParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/users/list', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'acs_users', }) } listAccessibleEntrances( - body?: AcsUsersListAccessibleEntrancesParams, + params?: AcsUsersListAccessibleEntrancesParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/users/list_accessible_entrances', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'acs_entrances', }) } removeFromAccessGroup( - body?: AcsUsersRemoveFromAccessGroupParams, + params?: AcsUsersRemoveFromAccessGroupParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/users/remove_from_access_group', - method: 'post', - body, + method: 'POST', + body: params, responseKey: undefined, }) } revokeAccessToAllEntrances( - body?: AcsUsersRevokeAccessToAllEntrancesParams, + params?: AcsUsersRevokeAccessToAllEntrancesParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/users/revoke_access_to_all_entrances', - method: 'post', - body, + method: 'POST', + body: params, responseKey: undefined, }) } @@ -250,7 +252,7 @@ export class SeamHttpAcsUsers { suspend(body?: AcsUsersSuspendBody): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/users/suspend', - method: 'post', + method: 'POST', body, responseKey: undefined, }) @@ -259,7 +261,7 @@ export class SeamHttpAcsUsers { unsuspend(body?: AcsUsersUnsuspendBody): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/users/unsuspend', - method: 'post', + method: 'POST', body, responseKey: undefined, }) @@ -268,7 +270,7 @@ export class SeamHttpAcsUsers { update(body?: AcsUsersUpdateBody): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/acs/users/update', - method: 'post', + method: 'PATCH', body, responseKey: undefined, }) diff --git a/src/lib/seam/connect/routes/action-attempts.ts b/src/lib/seam/connect/routes/action-attempts/action-attempts.ts similarity index 92% rename from src/lib/seam/connect/routes/action-attempts.ts rename to src/lib/seam/connect/routes/action-attempts/action-attempts.ts index 00a9ba72..4337bc2d 100644 --- a/src/lib/seam/connect/routes/action-attempts.ts +++ b/src/lib/seam/connect/routes/action-attempts/action-attempts.ts @@ -1,10 +1,11 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -30,15 +31,16 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpClientSessions } from './client-sessions.js' - export class SeamHttpActionAttempts { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -91,7 +93,7 @@ export class SeamHttpActionAttempts { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpActionAttempts.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -162,25 +164,25 @@ export class SeamHttpActionAttempts { } get( - body?: ActionAttemptsGetParams, - options: Pick = {}, + params?: ActionAttemptsGetParams, + options: ActionAttemptsGetOptions = {}, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/action_attempts/get', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'action_attempt', options, }) } list( - body?: ActionAttemptsListParams, + params?: ActionAttemptsListParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/action_attempts/list', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'action_attempts', }) } diff --git a/src/lib/seam/connect/routes/action-attempts/index.ts b/src/lib/seam/connect/routes/action-attempts/index.ts new file mode 100644 index 00000000..60b4a1fb --- /dev/null +++ b/src/lib/seam/connect/routes/action-attempts/index.ts @@ -0,0 +1,6 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './action-attempts.js' diff --git a/src/lib/seam/connect/routes/client-sessions.ts b/src/lib/seam/connect/routes/client-sessions/client-sessions.ts similarity index 92% rename from src/lib/seam/connect/routes/client-sessions.ts rename to src/lib/seam/connect/routes/client-sessions/client-sessions.ts index 1d43d389..4bbe39ac 100644 --- a/src/lib/seam/connect/routes/client-sessions.ts +++ b/src/lib/seam/connect/routes/client-sessions/client-sessions.ts @@ -1,10 +1,11 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -37,6 +38,8 @@ import type { SetNonNullable } from 'lib/types.js' export class SeamHttpClientSessions { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -89,7 +92,7 @@ export class SeamHttpClientSessions { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpClientSessions.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -164,28 +167,30 @@ export class SeamHttpClientSessions { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/client_sessions/create', - method: 'post', + method: 'PUT', body, responseKey: 'client_session', }) } - delete(body?: ClientSessionsDeleteParams): SeamHttpRequest { + delete( + params?: ClientSessionsDeleteParams, + ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/client_sessions/delete', - method: 'post', - body, + method: 'POST', + body: params, responseKey: undefined, }) } get( - body?: ClientSessionsGetParams, + params?: ClientSessionsGetParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/client_sessions/get', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'client_session', }) } @@ -195,7 +200,7 @@ export class SeamHttpClientSessions { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/client_sessions/get_or_create', - method: 'post', + method: 'POST', body, responseKey: 'client_session', }) @@ -206,28 +211,30 @@ export class SeamHttpClientSessions { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/client_sessions/grant_access', - method: 'post', + method: 'PATCH', body, responseKey: undefined, }) } list( - body?: ClientSessionsListParams, + params?: ClientSessionsListParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/client_sessions/list', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'client_sessions', }) } - revoke(body?: ClientSessionsRevokeParams): SeamHttpRequest { + revoke( + params?: ClientSessionsRevokeParams, + ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/client_sessions/revoke', - method: 'post', - body, + method: 'POST', + body: params, responseKey: undefined, }) } diff --git a/src/lib/seam/connect/routes/client-sessions/index.ts b/src/lib/seam/connect/routes/client-sessions/index.ts new file mode 100644 index 00000000..83896398 --- /dev/null +++ b/src/lib/seam/connect/routes/client-sessions/index.ts @@ -0,0 +1,6 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './client-sessions.js' diff --git a/src/lib/seam/connect/routes/connect-webviews.ts b/src/lib/seam/connect/routes/connect-webviews/connect-webviews.ts similarity index 91% rename from src/lib/seam/connect/routes/connect-webviews.ts rename to src/lib/seam/connect/routes/connect-webviews/connect-webviews.ts index 3fb4f893..3a127b55 100644 --- a/src/lib/seam/connect/routes/connect-webviews.ts +++ b/src/lib/seam/connect/routes/connect-webviews/connect-webviews.ts @@ -1,10 +1,11 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -30,15 +31,16 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpClientSessions } from './client-sessions.js' - export class SeamHttpConnectWebviews { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -91,7 +93,7 @@ export class SeamHttpConnectWebviews { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpConnectWebviews.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -166,39 +168,41 @@ export class SeamHttpConnectWebviews { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/connect_webviews/create', - method: 'post', + method: 'POST', body, responseKey: 'connect_webview', }) } - delete(body?: ConnectWebviewsDeleteParams): SeamHttpRequest { + delete( + params?: ConnectWebviewsDeleteParams, + ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/connect_webviews/delete', - method: 'post', - body, + method: 'POST', + body: params, responseKey: undefined, }) } get( - body?: ConnectWebviewsGetParams, + params?: ConnectWebviewsGetParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/connect_webviews/get', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'connect_webview', }) } list( - body?: ConnectWebviewsListParams, + params?: ConnectWebviewsListParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/connect_webviews/list', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'connect_webviews', }) } diff --git a/src/lib/seam/connect/routes/connect-webviews/index.ts b/src/lib/seam/connect/routes/connect-webviews/index.ts new file mode 100644 index 00000000..542503b3 --- /dev/null +++ b/src/lib/seam/connect/routes/connect-webviews/index.ts @@ -0,0 +1,6 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './connect-webviews.js' diff --git a/src/lib/seam/connect/routes/connected-accounts.ts b/src/lib/seam/connect/routes/connected-accounts/connected-accounts.ts similarity index 92% rename from src/lib/seam/connect/routes/connected-accounts.ts rename to src/lib/seam/connect/routes/connected-accounts/connected-accounts.ts index e7fa621d..bdf09383 100644 --- a/src/lib/seam/connect/routes/connected-accounts.ts +++ b/src/lib/seam/connect/routes/connected-accounts/connected-accounts.ts @@ -1,10 +1,11 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -30,15 +31,16 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpClientSessions } from './client-sessions.js' - export class SeamHttpConnectedAccounts { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -91,7 +93,7 @@ export class SeamHttpConnectedAccounts { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpConnectedAccounts.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -162,34 +164,34 @@ export class SeamHttpConnectedAccounts { } delete( - body?: ConnectedAccountsDeleteParams, + params?: ConnectedAccountsDeleteParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/connected_accounts/delete', - method: 'post', - body, + method: 'POST', + body: params, responseKey: undefined, }) } get( - body?: ConnectedAccountsGetParams, + params?: ConnectedAccountsGetParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/connected_accounts/get', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'connected_account', }) } list( - body?: ConnectedAccountsListParams, + params?: ConnectedAccountsListParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/connected_accounts/list', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'connected_accounts', }) } @@ -197,7 +199,7 @@ export class SeamHttpConnectedAccounts { sync(body?: ConnectedAccountsSyncBody): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/connected_accounts/sync', - method: 'post', + method: 'POST', body, responseKey: undefined, }) @@ -206,7 +208,7 @@ export class SeamHttpConnectedAccounts { update(body?: ConnectedAccountsUpdateBody): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/connected_accounts/update', - method: 'post', + method: 'POST', body, responseKey: undefined, }) diff --git a/src/lib/seam/connect/routes/connected-accounts/index.ts b/src/lib/seam/connect/routes/connected-accounts/index.ts new file mode 100644 index 00000000..6a0b4608 --- /dev/null +++ b/src/lib/seam/connect/routes/connected-accounts/index.ts @@ -0,0 +1,6 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './connected-accounts.js' diff --git a/src/lib/seam/connect/routes/devices.ts b/src/lib/seam/connect/routes/devices/devices.ts similarity index 90% rename from src/lib/seam/connect/routes/devices.ts rename to src/lib/seam/connect/routes/devices/devices.ts index 679ee392..d8251caa 100644 --- a/src/lib/seam/connect/routes/devices.ts +++ b/src/lib/seam/connect/routes/devices/devices.ts @@ -1,10 +1,11 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -30,17 +31,19 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpClientSessions } from './client-sessions.js' -import { SeamHttpDevicesSimulate } from './devices-simulate.js' -import { SeamHttpDevicesUnmanaged } from './devices-unmanaged.js' +import { SeamHttpDevicesSimulate } from './simulate/index.js' +import { SeamHttpDevicesUnmanaged } from './unmanaged/index.js' export class SeamHttpDevices { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -93,7 +96,7 @@ export class SeamHttpDevices { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpDevices.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -163,41 +166,43 @@ export class SeamHttpDevices { await clientSessions.get() } - get unmanaged(): SeamHttpDevicesUnmanaged { - return SeamHttpDevicesUnmanaged.fromClient(this.client, this.defaults) - } - get simulate(): SeamHttpDevicesSimulate { return SeamHttpDevicesSimulate.fromClient(this.client, this.defaults) } - get(body?: DevicesGetParams): SeamHttpRequest { + get unmanaged(): SeamHttpDevicesUnmanaged { + return SeamHttpDevicesUnmanaged.fromClient(this.client, this.defaults) + } + + get( + params?: DevicesGetParams, + ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/devices/get', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'device', }) } list( - body?: DevicesListParams, + params?: DevicesListParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/devices/list', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'devices', }) } listDeviceProviders( - body?: DevicesListDeviceProvidersParams, + params?: DevicesListDeviceProvidersParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/devices/list_device_providers', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'device_providers', }) } @@ -205,7 +210,7 @@ export class SeamHttpDevices { update(body?: DevicesUpdateBody): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/devices/update', - method: 'post', + method: 'PATCH', body, responseKey: undefined, }) diff --git a/src/lib/seam/connect/routes/devices/index.ts b/src/lib/seam/connect/routes/devices/index.ts new file mode 100644 index 00000000..766c761b --- /dev/null +++ b/src/lib/seam/connect/routes/devices/index.ts @@ -0,0 +1,8 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './devices.js' +export * from './simulate/index.js' +export * from './unmanaged/index.js' diff --git a/src/lib/seam/connect/routes/devices/simulate/index.ts b/src/lib/seam/connect/routes/devices/simulate/index.ts new file mode 100644 index 00000000..dd5b7769 --- /dev/null +++ b/src/lib/seam/connect/routes/devices/simulate/index.ts @@ -0,0 +1,6 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './simulate.js' diff --git a/src/lib/seam/connect/routes/devices-simulate.ts b/src/lib/seam/connect/routes/devices/simulate/simulate.ts similarity index 94% rename from src/lib/seam/connect/routes/devices-simulate.ts rename to src/lib/seam/connect/routes/devices/simulate/simulate.ts index 321ec37b..49a4e063 100644 --- a/src/lib/seam/connect/routes/devices-simulate.ts +++ b/src/lib/seam/connect/routes/devices/simulate/simulate.ts @@ -1,10 +1,11 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -30,15 +31,16 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpClientSessions } from './client-sessions.js' - export class SeamHttpDevicesSimulate { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -91,7 +93,7 @@ export class SeamHttpDevicesSimulate { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpDevicesSimulate.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -164,7 +166,7 @@ export class SeamHttpDevicesSimulate { connect(body?: DevicesSimulateConnectBody): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/devices/simulate/connect', - method: 'post', + method: 'POST', body, responseKey: undefined, }) @@ -175,7 +177,7 @@ export class SeamHttpDevicesSimulate { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/devices/simulate/disconnect', - method: 'post', + method: 'POST', body, responseKey: undefined, }) @@ -184,7 +186,7 @@ export class SeamHttpDevicesSimulate { remove(body?: DevicesSimulateRemoveBody): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/devices/simulate/remove', - method: 'post', + method: 'POST', body, responseKey: undefined, }) diff --git a/src/lib/seam/connect/routes/devices/unmanaged/index.ts b/src/lib/seam/connect/routes/devices/unmanaged/index.ts new file mode 100644 index 00000000..bab8a37e --- /dev/null +++ b/src/lib/seam/connect/routes/devices/unmanaged/index.ts @@ -0,0 +1,6 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './unmanaged.js' diff --git a/src/lib/seam/connect/routes/devices-unmanaged.ts b/src/lib/seam/connect/routes/devices/unmanaged/unmanaged.ts similarity index 92% rename from src/lib/seam/connect/routes/devices-unmanaged.ts rename to src/lib/seam/connect/routes/devices/unmanaged/unmanaged.ts index a4ad532d..0d4027b2 100644 --- a/src/lib/seam/connect/routes/devices-unmanaged.ts +++ b/src/lib/seam/connect/routes/devices/unmanaged/unmanaged.ts @@ -1,10 +1,11 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -30,15 +31,16 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpClientSessions } from './client-sessions.js' - export class SeamHttpDevicesUnmanaged { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -91,7 +93,7 @@ export class SeamHttpDevicesUnmanaged { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpDevicesUnmanaged.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -162,23 +164,23 @@ export class SeamHttpDevicesUnmanaged { } get( - body?: DevicesUnmanagedGetParams, + params?: DevicesUnmanagedGetParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/devices/unmanaged/get', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'device', }) } list( - body?: DevicesUnmanagedListParams, + params?: DevicesUnmanagedListParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/devices/unmanaged/list', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'devices', }) } @@ -186,7 +188,7 @@ export class SeamHttpDevicesUnmanaged { update(body?: DevicesUnmanagedUpdateBody): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/devices/unmanaged/update', - method: 'post', + method: 'PATCH', body, responseKey: undefined, }) diff --git a/src/lib/seam/connect/routes/events.ts b/src/lib/seam/connect/routes/events/events.ts similarity index 91% rename from src/lib/seam/connect/routes/events.ts rename to src/lib/seam/connect/routes/events/events.ts index c062ba7a..2fe7cc60 100644 --- a/src/lib/seam/connect/routes/events.ts +++ b/src/lib/seam/connect/routes/events/events.ts @@ -1,10 +1,11 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -30,15 +31,16 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpClientSessions } from './client-sessions.js' - export class SeamHttpEvents { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -91,7 +93,7 @@ export class SeamHttpEvents { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpEvents.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -161,20 +163,22 @@ export class SeamHttpEvents { await clientSessions.get() } - get(body?: EventsGetParams): SeamHttpRequest { + get(params?: EventsGetParams): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/events/get', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'event', }) } - list(body?: EventsListParams): SeamHttpRequest { + list( + params?: EventsListParams, + ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/events/list', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'events', }) } diff --git a/src/lib/seam/connect/routes/events/index.ts b/src/lib/seam/connect/routes/events/index.ts new file mode 100644 index 00000000..80914354 --- /dev/null +++ b/src/lib/seam/connect/routes/events/index.ts @@ -0,0 +1,6 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './events.js' diff --git a/src/lib/seam/connect/routes/index.ts b/src/lib/seam/connect/routes/index.ts index a67c977f..2a33b3e8 100644 --- a/src/lib/seam/connect/routes/index.ts +++ b/src/lib/seam/connect/routes/index.ts @@ -1,37 +1,24 @@ -export * from './access-codes.js' -export * from './access-codes-simulate.js' -export * from './access-codes-unmanaged.js' -export * from './access-grants.js' -export * from './access-methods.js' -export * from './acs.js' -export * from './acs-access-groups.js' -export * from './acs-credentials.js' -export * from './acs-encoders.js' -export * from './acs-encoders-simulate.js' -export * from './acs-entrances.js' -export * from './acs-systems.js' -export * from './acs-users.js' -export * from './action-attempts.js' -export * from './client-sessions.js' -export * from './connect-webviews.js' -export * from './connected-accounts.js' -export * from './devices.js' -export * from './devices-simulate.js' -export * from './devices-unmanaged.js' -export * from './events.js' -export * from './locks.js' -export * from './noise-sensors.js' -export * from './noise-sensors-noise-thresholds.js' -export * from './noise-sensors-simulate.js' -export * from './phones.js' -export * from './phones-simulate.js' -export * from './spaces.js' -export * from './thermostats.js' -export * from './thermostats-daily-programs.js' -export * from './thermostats-schedules.js' -export * from './thermostats-simulate.js' -export * from './unstable-partner.js' -export * from './user-identities.js' -export * from './user-identities-enrollment-automations.js' -export * from './webhooks.js' -export * from './workspaces.js' +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './access-codes/index.js' +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 './client-sessions/index.js' +export * from './connect-webviews/index.js' +export * from './connected-accounts/index.js' +export * from './devices/index.js' +export * from './events/index.js' +export * from './locks/index.js' +export * from './noise-sensors/index.js' +export * from './phones/index.js' +export * from './seam-http.js' +export * from './spaces/index.js' +export * from './thermostats/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/locks/index.ts b/src/lib/seam/connect/routes/locks/index.ts new file mode 100644 index 00000000..7a3d8440 --- /dev/null +++ b/src/lib/seam/connect/routes/locks/index.ts @@ -0,0 +1,6 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './locks.js' diff --git a/src/lib/seam/connect/routes/locks.ts b/src/lib/seam/connect/routes/locks/locks.ts similarity index 91% rename from src/lib/seam/connect/routes/locks.ts rename to src/lib/seam/connect/routes/locks/locks.ts index b7cb78e7..515e14e8 100644 --- a/src/lib/seam/connect/routes/locks.ts +++ b/src/lib/seam/connect/routes/locks/locks.ts @@ -1,10 +1,11 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -30,15 +31,16 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpClientSessions } from './client-sessions.js' - export class SeamHttpLocks { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -91,7 +93,7 @@ export class SeamHttpLocks { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpLocks.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -161,31 +163,33 @@ export class SeamHttpLocks { await clientSessions.get() } - get(body?: LocksGetParams): SeamHttpRequest { + get(params?: LocksGetParams): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/locks/get', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'device', }) } - list(body?: LocksListParams): SeamHttpRequest { + list( + params?: LocksListParams, + ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/locks/list', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'devices', }) } lockDoor( body?: LocksLockDoorBody, - options: Pick = {}, + options: LocksLockDoorOptions = {}, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/locks/lock_door', - method: 'post', + method: 'POST', body, responseKey: 'action_attempt', options, @@ -194,11 +198,11 @@ export class SeamHttpLocks { unlockDoor( body?: LocksUnlockDoorBody, - options: Pick = {}, + options: LocksUnlockDoorOptions = {}, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/locks/unlock_door', - method: 'post', + method: 'POST', body, responseKey: 'action_attempt', options, diff --git a/src/lib/seam/connect/routes/noise-sensors/index.ts b/src/lib/seam/connect/routes/noise-sensors/index.ts new file mode 100644 index 00000000..f6e81ad6 --- /dev/null +++ b/src/lib/seam/connect/routes/noise-sensors/index.ts @@ -0,0 +1,8 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './noise-sensors.js' +export * from './noise-thresholds/index.js' +export * from './simulate/index.js' diff --git a/src/lib/seam/connect/routes/noise-sensors.ts b/src/lib/seam/connect/routes/noise-sensors/noise-sensors.ts similarity index 91% rename from src/lib/seam/connect/routes/noise-sensors.ts rename to src/lib/seam/connect/routes/noise-sensors/noise-sensors.ts index 8a621391..43135cc2 100644 --- a/src/lib/seam/connect/routes/noise-sensors.ts +++ b/src/lib/seam/connect/routes/noise-sensors/noise-sensors.ts @@ -1,10 +1,11 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -30,17 +31,19 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpClientSessions } from './client-sessions.js' -import { SeamHttpNoiseSensorsNoiseThresholds } from './noise-sensors-noise-thresholds.js' -import { SeamHttpNoiseSensorsSimulate } from './noise-sensors-simulate.js' +import { SeamHttpNoiseSensorsNoiseThresholds } from './noise-thresholds/index.js' +import { SeamHttpNoiseSensorsSimulate } from './simulate/index.js' export class SeamHttpNoiseSensors { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -93,7 +96,7 @@ export class SeamHttpNoiseSensors { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpNoiseSensors.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -175,12 +178,12 @@ export class SeamHttpNoiseSensors { } list( - body?: NoiseSensorsListParams, + params?: NoiseSensorsListParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/noise_sensors/list', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'devices', }) } diff --git a/src/lib/seam/connect/routes/noise-sensors/noise-thresholds/index.ts b/src/lib/seam/connect/routes/noise-sensors/noise-thresholds/index.ts new file mode 100644 index 00000000..aae9e939 --- /dev/null +++ b/src/lib/seam/connect/routes/noise-sensors/noise-thresholds/index.ts @@ -0,0 +1,6 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './noise-thresholds.js' diff --git a/src/lib/seam/connect/routes/noise-sensors-noise-thresholds.ts b/src/lib/seam/connect/routes/noise-sensors/noise-thresholds/noise-thresholds.ts similarity index 92% rename from src/lib/seam/connect/routes/noise-sensors-noise-thresholds.ts rename to src/lib/seam/connect/routes/noise-sensors/noise-thresholds/noise-thresholds.ts index 35026676..9ee28ad3 100644 --- a/src/lib/seam/connect/routes/noise-sensors-noise-thresholds.ts +++ b/src/lib/seam/connect/routes/noise-sensors/noise-thresholds/noise-thresholds.ts @@ -1,10 +1,11 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -30,15 +31,16 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpClientSessions } from './client-sessions.js' - export class SeamHttpNoiseSensorsNoiseThresholds { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -91,7 +93,7 @@ export class SeamHttpNoiseSensorsNoiseThresholds { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpNoiseSensorsNoiseThresholds.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -172,47 +174,47 @@ export class SeamHttpNoiseSensorsNoiseThresholds { > { return new SeamHttpRequest(this, { pathname: '/noise_sensors/noise_thresholds/create', - method: 'post', + method: 'POST', body, responseKey: 'noise_threshold', }) } delete( - body?: NoiseSensorsNoiseThresholdsDeleteParams, + params?: NoiseSensorsNoiseThresholdsDeleteParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/noise_sensors/noise_thresholds/delete', - method: 'post', - body, + method: 'POST', + body: params, responseKey: undefined, }) } get( - body?: NoiseSensorsNoiseThresholdsGetParams, + params?: NoiseSensorsNoiseThresholdsGetParams, ): SeamHttpRequest< NoiseSensorsNoiseThresholdsGetResponse, 'noise_threshold' > { return new SeamHttpRequest(this, { pathname: '/noise_sensors/noise_thresholds/get', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'noise_threshold', }) } list( - body?: NoiseSensorsNoiseThresholdsListParams, + params?: NoiseSensorsNoiseThresholdsListParams, ): SeamHttpRequest< NoiseSensorsNoiseThresholdsListResponse, 'noise_thresholds' > { return new SeamHttpRequest(this, { pathname: '/noise_sensors/noise_thresholds/list', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'noise_thresholds', }) } @@ -222,7 +224,7 @@ export class SeamHttpNoiseSensorsNoiseThresholds { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/noise_sensors/noise_thresholds/update', - method: 'post', + method: 'PUT', body, responseKey: undefined, }) diff --git a/src/lib/seam/connect/routes/noise-sensors/simulate/index.ts b/src/lib/seam/connect/routes/noise-sensors/simulate/index.ts new file mode 100644 index 00000000..dd5b7769 --- /dev/null +++ b/src/lib/seam/connect/routes/noise-sensors/simulate/index.ts @@ -0,0 +1,6 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './simulate.js' diff --git a/src/lib/seam/connect/routes/noise-sensors-simulate.ts b/src/lib/seam/connect/routes/noise-sensors/simulate/simulate.ts similarity index 94% rename from src/lib/seam/connect/routes/noise-sensors-simulate.ts rename to src/lib/seam/connect/routes/noise-sensors/simulate/simulate.ts index c008db50..c090e8e2 100644 --- a/src/lib/seam/connect/routes/noise-sensors-simulate.ts +++ b/src/lib/seam/connect/routes/noise-sensors/simulate/simulate.ts @@ -1,10 +1,11 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -30,15 +31,16 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpClientSessions } from './client-sessions.js' - export class SeamHttpNoiseSensorsSimulate { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -91,7 +93,7 @@ export class SeamHttpNoiseSensorsSimulate { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpNoiseSensorsSimulate.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -166,7 +168,7 @@ export class SeamHttpNoiseSensorsSimulate { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/noise_sensors/simulate/trigger_noise_threshold', - method: 'post', + method: 'POST', body, responseKey: undefined, }) diff --git a/src/lib/seam/connect/routes/phones/index.ts b/src/lib/seam/connect/routes/phones/index.ts new file mode 100644 index 00000000..9d9f4b93 --- /dev/null +++ b/src/lib/seam/connect/routes/phones/index.ts @@ -0,0 +1,7 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './phones.js' +export * from './simulate/index.js' diff --git a/src/lib/seam/connect/routes/phones.ts b/src/lib/seam/connect/routes/phones/phones.ts similarity index 89% rename from src/lib/seam/connect/routes/phones.ts rename to src/lib/seam/connect/routes/phones/phones.ts index accf6bd5..e6de45c5 100644 --- a/src/lib/seam/connect/routes/phones.ts +++ b/src/lib/seam/connect/routes/phones/phones.ts @@ -1,10 +1,11 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -30,16 +31,18 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpClientSessions } from './client-sessions.js' -import { SeamHttpPhonesSimulate } from './phones-simulate.js' +import { SeamHttpPhonesSimulate } from './simulate/index.js' export class SeamHttpPhones { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -92,7 +95,7 @@ export class SeamHttpPhones { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpPhones.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -166,29 +169,33 @@ export class SeamHttpPhones { return SeamHttpPhonesSimulate.fromClient(this.client, this.defaults) } - deactivate(body?: PhonesDeactivateParams): SeamHttpRequest { + deactivate( + params?: PhonesDeactivateParams, + ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/phones/deactivate', - method: 'post', - body, + method: 'POST', + body: params, responseKey: undefined, }) } - get(body?: PhonesGetParams): SeamHttpRequest { + get(params?: PhonesGetParams): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/phones/get', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'phone', }) } - list(body?: PhonesListParams): SeamHttpRequest { + list( + params?: PhonesListParams, + ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/phones/list', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'phones', }) } diff --git a/src/lib/seam/connect/routes/phones/simulate/index.ts b/src/lib/seam/connect/routes/phones/simulate/index.ts new file mode 100644 index 00000000..dd5b7769 --- /dev/null +++ b/src/lib/seam/connect/routes/phones/simulate/index.ts @@ -0,0 +1,6 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './simulate.js' diff --git a/src/lib/seam/connect/routes/phones-simulate.ts b/src/lib/seam/connect/routes/phones/simulate/simulate.ts similarity index 94% rename from src/lib/seam/connect/routes/phones-simulate.ts rename to src/lib/seam/connect/routes/phones/simulate/simulate.ts index 11f51ab0..2e6c4b3d 100644 --- a/src/lib/seam/connect/routes/phones-simulate.ts +++ b/src/lib/seam/connect/routes/phones/simulate/simulate.ts @@ -1,10 +1,11 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -30,15 +31,16 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpClientSessions } from './client-sessions.js' - export class SeamHttpPhonesSimulate { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -91,7 +93,7 @@ export class SeamHttpPhonesSimulate { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpPhonesSimulate.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -166,7 +168,7 @@ export class SeamHttpPhonesSimulate { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/phones/simulate/create_sandbox_phone', - method: 'post', + method: 'POST', body, responseKey: 'phone', }) diff --git a/src/lib/seam/connect/routes/unstable-partner.ts b/src/lib/seam/connect/routes/seam-http.ts similarity index 58% rename from src/lib/seam/connect/routes/unstable-partner.ts rename to src/lib/seam/connect/routes/seam-http.ts index 5c1e4908..b303ff61 100644 --- a/src/lib/seam/connect/routes/unstable-partner.ts +++ b/src/lib/seam/connect/routes/seam-http.ts @@ -1,8 +1,9 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -31,11 +32,30 @@ import { import type { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' -import { SeamHttpClientSessions } from './client-sessions.js' +import { SeamHttpAccessCodes } from './access-codes/index.js' +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 { SeamHttpClientSessions } from './client-sessions/index.js' +import { SeamHttpConnectWebviews } from './connect-webviews/index.js' +import { SeamHttpConnectedAccounts } from './connected-accounts/index.js' +import { SeamHttpDevices } from './devices/index.js' +import { SeamHttpEvents } from './events/index.js' +import { SeamHttpLocks } from './locks/index.js' +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 { SeamHttpUserIdentities } from './user-identities/index.js' +import { SeamHttpWebhooks } from './webhooks/index.js' +import { SeamHttpWorkspaces } from './workspaces/index.js' -export class SeamHttpUnstablePartner { +export class SeamHttp { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -46,23 +66,23 @@ export class SeamHttpUnstablePartner { static fromClient( client: SeamHttpOptionsWithClient['client'], options: Omit = {}, - ): SeamHttpUnstablePartner { + ): SeamHttp { const constructorOptions = { ...options, client } if (!isSeamHttpOptionsWithClient(constructorOptions)) { throw new SeamHttpInvalidOptionsError('Missing client') } - return new SeamHttpUnstablePartner(constructorOptions) + return new SeamHttp(constructorOptions) } static fromApiKey( apiKey: SeamHttpOptionsWithApiKey['apiKey'], options: Omit = {}, - ): SeamHttpUnstablePartner { + ): SeamHttp { const constructorOptions = { ...options, apiKey } if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { throw new SeamHttpInvalidOptionsError('Missing apiKey') } - return new SeamHttpUnstablePartner(constructorOptions) + return new SeamHttp(constructorOptions) } static fromClientSessionToken( @@ -71,19 +91,19 @@ export class SeamHttpUnstablePartner { SeamHttpOptionsWithClientSessionToken, 'clientSessionToken' > = {}, - ): SeamHttpUnstablePartner { + ): SeamHttp { const constructorOptions = { ...options, clientSessionToken } if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') } - return new SeamHttpUnstablePartner(constructorOptions) + return new SeamHttp(constructorOptions) } static async fromPublishableKey( publishableKey: string, userIdentifierKey: string, options: SeamHttpFromPublishableKeyOptions = {}, - ): Promise { + ): Promise { warnOnInsecureuserIdentifierKey(userIdentifierKey) const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { @@ -96,7 +116,7 @@ export class SeamHttpUnstablePartner { const { token } = await clientSessions.getOrCreate({ user_identifier_key: userIdentifierKey, }) - return SeamHttpUnstablePartner.fromClientSessionToken(token, options) + return SeamHttp.fromClientSessionToken(token, options) } static fromConsoleSessionToken( @@ -106,14 +126,14 @@ export class SeamHttpUnstablePartner { SeamHttpOptionsWithConsoleSessionToken, 'consoleSessionToken' | 'workspaceId' > = {}, - ): SeamHttpUnstablePartner { + ): SeamHttp { const constructorOptions = { ...options, consoleSessionToken, workspaceId } if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { throw new SeamHttpInvalidOptionsError( 'Missing consoleSessionToken or workspaceId', ) } - return new SeamHttpUnstablePartner(constructorOptions) + return new SeamHttp(constructorOptions) } static fromPersonalAccessToken( @@ -123,14 +143,14 @@ export class SeamHttpUnstablePartner { SeamHttpOptionsWithPersonalAccessToken, 'personalAccessToken' | 'workspaceId' > = {}, - ): SeamHttpUnstablePartner { + ): SeamHttp { const constructorOptions = { ...options, personalAccessToken, workspaceId } if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { throw new SeamHttpInvalidOptionsError( 'Missing personalAccessToken or workspaceId', ) } - return new SeamHttpUnstablePartner(constructorOptions) + return new SeamHttp(constructorOptions) } createPaginator( @@ -157,4 +177,76 @@ export class SeamHttpUnstablePartner { const clientSessions = SeamHttpClientSessions.fromClient(this.client) await clientSessions.get() } + + get accessCodes(): SeamHttpAccessCodes { + return SeamHttpAccessCodes.fromClient(this.client, this.defaults) + } + + get accessGrants(): SeamHttpAccessGrants { + return SeamHttpAccessGrants.fromClient(this.client, this.defaults) + } + + get accessMethods(): SeamHttpAccessMethods { + return SeamHttpAccessMethods.fromClient(this.client, this.defaults) + } + + get acs(): SeamHttpAcs { + return SeamHttpAcs.fromClient(this.client, this.defaults) + } + + get actionAttempts(): SeamHttpActionAttempts { + return SeamHttpActionAttempts.fromClient(this.client, this.defaults) + } + + get clientSessions(): SeamHttpClientSessions { + return SeamHttpClientSessions.fromClient(this.client, this.defaults) + } + + get connectWebviews(): SeamHttpConnectWebviews { + return SeamHttpConnectWebviews.fromClient(this.client, this.defaults) + } + + get connectedAccounts(): SeamHttpConnectedAccounts { + return SeamHttpConnectedAccounts.fromClient(this.client, this.defaults) + } + + get devices(): SeamHttpDevices { + return SeamHttpDevices.fromClient(this.client, this.defaults) + } + + get events(): SeamHttpEvents { + return SeamHttpEvents.fromClient(this.client, this.defaults) + } + + get locks(): SeamHttpLocks { + return SeamHttpLocks.fromClient(this.client, this.defaults) + } + + get noiseSensors(): SeamHttpNoiseSensors { + return SeamHttpNoiseSensors.fromClient(this.client, this.defaults) + } + + get phones(): SeamHttpPhones { + return SeamHttpPhones.fromClient(this.client, this.defaults) + } + + get spaces(): SeamHttpSpaces { + return SeamHttpSpaces.fromClient(this.client, this.defaults) + } + + get thermostats(): SeamHttpThermostats { + return SeamHttpThermostats.fromClient(this.client, this.defaults) + } + + get userIdentities(): SeamHttpUserIdentities { + return SeamHttpUserIdentities.fromClient(this.client, this.defaults) + } + + get webhooks(): SeamHttpWebhooks { + return SeamHttpWebhooks.fromClient(this.client, this.defaults) + } + + get workspaces(): SeamHttpWorkspaces { + return SeamHttpWorkspaces.fromClient(this.client, this.defaults) + } } diff --git a/src/lib/seam/connect/routes/spaces/index.ts b/src/lib/seam/connect/routes/spaces/index.ts new file mode 100644 index 00000000..af3f0bb2 --- /dev/null +++ b/src/lib/seam/connect/routes/spaces/index.ts @@ -0,0 +1,6 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './spaces.js' diff --git a/src/lib/seam/connect/routes/spaces.ts b/src/lib/seam/connect/routes/spaces/spaces.ts similarity index 88% rename from src/lib/seam/connect/routes/spaces.ts rename to src/lib/seam/connect/routes/spaces/spaces.ts index b204bfc6..73804fa3 100644 --- a/src/lib/seam/connect/routes/spaces.ts +++ b/src/lib/seam/connect/routes/spaces/spaces.ts @@ -1,10 +1,15 @@ /* - * Automatically generated by generate-routes.ts. + * 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 type { + RouteRequestBody, + RouteRequestParams, + RouteResponse, +} from '@seamapi/types/connect' +import { seamApiLtsVersion } from 'lib/lts-version.js' import { getAuthHeadersForClientSessionToken, warnOnInsecureuserIdentifierKey, @@ -30,15 +35,16 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpClientSessions } from './client-sessions.js' - export class SeamHttpSpaces { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -91,7 +97,7 @@ export class SeamHttpSpaces { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpSpaces.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -166,7 +172,7 @@ export class SeamHttpSpaces { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/spaces/add_acs_entrances', - method: 'post', + method: 'PUT', body, responseKey: undefined, }) @@ -175,7 +181,7 @@ export class SeamHttpSpaces { addDevices(body?: SpacesAddDevicesBody): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/spaces/add_devices', - method: 'post', + method: 'PUT', body, responseKey: undefined, }) @@ -186,57 +192,59 @@ export class SeamHttpSpaces { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/spaces/create', - method: 'post', + method: 'POST', body, responseKey: 'space', }) } - delete(body?: SpacesDeleteParams): SeamHttpRequest { + delete(params?: SpacesDeleteParams): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/spaces/delete', - method: 'post', - body, + method: 'POST', + body: params, responseKey: undefined, }) } - get(body?: SpacesGetParams): SeamHttpRequest { + get(params?: SpacesGetParams): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/spaces/get', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'space', }) } - list(body?: SpacesListParams): SeamHttpRequest { + list( + params?: SpacesListParams, + ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/spaces/list', - method: 'post', - body, + method: 'GET', + params, responseKey: 'spaces', }) } removeAcsEntrances( - body?: SpacesRemoveAcsEntrancesParams, + params?: SpacesRemoveAcsEntrancesParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/spaces/remove_acs_entrances', - method: 'post', - body, + method: 'POST', + body: params, responseKey: undefined, }) } removeDevices( - body?: SpacesRemoveDevicesParams, + params?: SpacesRemoveDevicesParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/spaces/remove_devices', - method: 'post', - body, + method: 'POST', + body: params, responseKey: undefined, }) } @@ -246,7 +254,7 @@ export class SeamHttpSpaces { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/spaces/update', - method: 'post', + method: 'PATCH', body, responseKey: 'space', }) @@ -294,7 +302,7 @@ export type SpacesGetResponse = SetNonNullable< export type SpacesGetOptions = never -export type SpacesListParams = RouteRequestBody<'/spaces/list'> +export type SpacesListParams = RouteRequestParams<'/spaces/list'> export type SpacesListResponse = SetNonNullable< Required> diff --git a/src/lib/seam/connect/routes/thermostats-daily-programs.ts b/src/lib/seam/connect/routes/thermostats/daily-programs/daily-programs.ts similarity index 93% rename from src/lib/seam/connect/routes/thermostats-daily-programs.ts rename to src/lib/seam/connect/routes/thermostats/daily-programs/daily-programs.ts index fb45cc4c..90d0a821 100644 --- a/src/lib/seam/connect/routes/thermostats-daily-programs.ts +++ b/src/lib/seam/connect/routes/thermostats/daily-programs/daily-programs.ts @@ -1,10 +1,11 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -30,15 +31,16 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpClientSessions } from './client-sessions.js' - export class SeamHttpThermostatsDailyPrograms { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -91,7 +93,7 @@ export class SeamHttpThermostatsDailyPrograms { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpThermostatsDailyPrograms.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -172,30 +174,30 @@ export class SeamHttpThermostatsDailyPrograms { > { return new SeamHttpRequest(this, { pathname: '/thermostats/daily_programs/create', - method: 'post', + method: 'POST', body, responseKey: 'thermostat_daily_program', }) } delete( - body?: ThermostatsDailyProgramsDeleteParams, + params?: ThermostatsDailyProgramsDeleteParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/thermostats/daily_programs/delete', - method: 'post', - body, + method: 'POST', + body: params, responseKey: undefined, }) } update( body?: ThermostatsDailyProgramsUpdateBody, - options: Pick = {}, + options: ThermostatsDailyProgramsUpdateOptions = {}, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/thermostats/daily_programs/update', - method: 'post', + method: 'PATCH', body, responseKey: 'action_attempt', options, diff --git a/src/lib/seam/connect/routes/thermostats/daily-programs/index.ts b/src/lib/seam/connect/routes/thermostats/daily-programs/index.ts new file mode 100644 index 00000000..8951b6b1 --- /dev/null +++ b/src/lib/seam/connect/routes/thermostats/daily-programs/index.ts @@ -0,0 +1,6 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './daily-programs.js' diff --git a/src/lib/seam/connect/routes/thermostats/index.ts b/src/lib/seam/connect/routes/thermostats/index.ts new file mode 100644 index 00000000..aba8f6cb --- /dev/null +++ b/src/lib/seam/connect/routes/thermostats/index.ts @@ -0,0 +1,9 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './daily-programs/index.js' +export * from './schedules/index.js' +export * from './simulate/index.js' +export * from './thermostats.js' diff --git a/src/lib/seam/connect/routes/thermostats/schedules/index.ts b/src/lib/seam/connect/routes/thermostats/schedules/index.ts new file mode 100644 index 00000000..7206cce7 --- /dev/null +++ b/src/lib/seam/connect/routes/thermostats/schedules/index.ts @@ -0,0 +1,6 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './schedules.js' diff --git a/src/lib/seam/connect/routes/thermostats-schedules.ts b/src/lib/seam/connect/routes/thermostats/schedules/schedules.ts similarity index 92% rename from src/lib/seam/connect/routes/thermostats-schedules.ts rename to src/lib/seam/connect/routes/thermostats/schedules/schedules.ts index 35797f7f..692e7b96 100644 --- a/src/lib/seam/connect/routes/thermostats-schedules.ts +++ b/src/lib/seam/connect/routes/thermostats/schedules/schedules.ts @@ -1,10 +1,11 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -30,15 +31,16 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpClientSessions } from './client-sessions.js' - export class SeamHttpThermostatsSchedules { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -91,7 +93,7 @@ export class SeamHttpThermostatsSchedules { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpThermostatsSchedules.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -169,41 +171,41 @@ export class SeamHttpThermostatsSchedules { > { return new SeamHttpRequest(this, { pathname: '/thermostats/schedules/create', - method: 'post', + method: 'POST', body, responseKey: 'thermostat_schedule', }) } delete( - body?: ThermostatsSchedulesDeleteParams, + params?: ThermostatsSchedulesDeleteParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/thermostats/schedules/delete', - method: 'post', - body, + method: 'POST', + body: params, responseKey: undefined, }) } get( - body?: ThermostatsSchedulesGetParams, + params?: ThermostatsSchedulesGetParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/thermostats/schedules/get', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'thermostat_schedule', }) } list( - body?: ThermostatsSchedulesListParams, + params?: ThermostatsSchedulesListParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/thermostats/schedules/list', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'thermostat_schedules', }) } @@ -213,7 +215,7 @@ export class SeamHttpThermostatsSchedules { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/thermostats/schedules/update', - method: 'post', + method: 'PATCH', body, responseKey: undefined, }) diff --git a/src/lib/seam/connect/routes/thermostats/simulate/index.ts b/src/lib/seam/connect/routes/thermostats/simulate/index.ts new file mode 100644 index 00000000..dd5b7769 --- /dev/null +++ b/src/lib/seam/connect/routes/thermostats/simulate/index.ts @@ -0,0 +1,6 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './simulate.js' diff --git a/src/lib/seam/connect/routes/thermostats-simulate.ts b/src/lib/seam/connect/routes/thermostats/simulate/simulate.ts similarity index 94% rename from src/lib/seam/connect/routes/thermostats-simulate.ts rename to src/lib/seam/connect/routes/thermostats/simulate/simulate.ts index e46d1a61..0506ab28 100644 --- a/src/lib/seam/connect/routes/thermostats-simulate.ts +++ b/src/lib/seam/connect/routes/thermostats/simulate/simulate.ts @@ -1,10 +1,11 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -30,15 +31,16 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpClientSessions } from './client-sessions.js' - export class SeamHttpThermostatsSimulate { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -91,7 +93,7 @@ export class SeamHttpThermostatsSimulate { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpThermostatsSimulate.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -166,7 +168,7 @@ export class SeamHttpThermostatsSimulate { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/thermostats/simulate/hvac_mode_adjusted', - method: 'post', + method: 'POST', body, responseKey: undefined, }) @@ -177,7 +179,7 @@ export class SeamHttpThermostatsSimulate { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/thermostats/simulate/temperature_reached', - method: 'post', + method: 'POST', body, responseKey: undefined, }) diff --git a/src/lib/seam/connect/routes/thermostats.ts b/src/lib/seam/connect/routes/thermostats/thermostats.ts similarity index 91% rename from src/lib/seam/connect/routes/thermostats.ts rename to src/lib/seam/connect/routes/thermostats/thermostats.ts index 5e9fe205..8188243d 100644 --- a/src/lib/seam/connect/routes/thermostats.ts +++ b/src/lib/seam/connect/routes/thermostats/thermostats.ts @@ -1,10 +1,11 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -30,18 +31,20 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpClientSessions } from './client-sessions.js' -import { SeamHttpThermostatsDailyPrograms } from './thermostats-daily-programs.js' -import { SeamHttpThermostatsSchedules } from './thermostats-schedules.js' -import { SeamHttpThermostatsSimulate } from './thermostats-simulate.js' +import { SeamHttpThermostatsDailyPrograms } from './daily-programs/index.js' +import { SeamHttpThermostatsSchedules } from './schedules/index.js' +import { SeamHttpThermostatsSimulate } from './simulate/index.js' export class SeamHttpThermostats { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -94,7 +97,7 @@ export class SeamHttpThermostats { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpThermostats.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -164,6 +167,13 @@ export class SeamHttpThermostats { await clientSessions.get() } + get dailyPrograms(): SeamHttpThermostatsDailyPrograms { + return SeamHttpThermostatsDailyPrograms.fromClient( + this.client, + this.defaults, + ) + } + get schedules(): SeamHttpThermostatsSchedules { return SeamHttpThermostatsSchedules.fromClient(this.client, this.defaults) } @@ -172,23 +182,16 @@ export class SeamHttpThermostats { return SeamHttpThermostatsSimulate.fromClient(this.client, this.defaults) } - get dailyPrograms(): SeamHttpThermostatsDailyPrograms { - return SeamHttpThermostatsDailyPrograms.fromClient( - this.client, - this.defaults, - ) - } - activateClimatePreset( body?: ThermostatsActivateClimatePresetBody, - options: Pick = {}, + options: ThermostatsActivateClimatePresetOptions = {}, ): SeamHttpRequest< ThermostatsActivateClimatePresetResponse, 'action_attempt' > { return new SeamHttpRequest(this, { pathname: '/thermostats/activate_climate_preset', - method: 'post', + method: 'POST', body, responseKey: 'action_attempt', options, @@ -197,11 +200,11 @@ export class SeamHttpThermostats { cool( body?: ThermostatsCoolBody, - options: Pick = {}, + options: ThermostatsCoolOptions = {}, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/thermostats/cool', - method: 'post', + method: 'POST', body, responseKey: 'action_attempt', options, @@ -213,7 +216,7 @@ export class SeamHttpThermostats { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/thermostats/create_climate_preset', - method: 'post', + method: 'POST', body, responseKey: undefined, }) @@ -224,7 +227,7 @@ export class SeamHttpThermostats { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/thermostats/delete_climate_preset', - method: 'post', + method: 'POST', body, responseKey: undefined, }) @@ -232,11 +235,11 @@ export class SeamHttpThermostats { heat( body?: ThermostatsHeatBody, - options: Pick = {}, + options: ThermostatsHeatOptions = {}, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/thermostats/heat', - method: 'post', + method: 'POST', body, responseKey: 'action_attempt', options, @@ -245,11 +248,11 @@ export class SeamHttpThermostats { heatCool( body?: ThermostatsHeatCoolBody, - options: Pick = {}, + options: ThermostatsHeatCoolOptions = {}, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/thermostats/heat_cool', - method: 'post', + method: 'POST', body, responseKey: 'action_attempt', options, @@ -257,23 +260,23 @@ export class SeamHttpThermostats { } list( - body?: ThermostatsListParams, + params?: ThermostatsListParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/thermostats/list', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'devices', }) } off( body?: ThermostatsOffBody, - options: Pick = {}, + options: ThermostatsOffOptions = {}, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/thermostats/off', - method: 'post', + method: 'POST', body, responseKey: 'action_attempt', options, @@ -285,7 +288,7 @@ export class SeamHttpThermostats { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/thermostats/set_fallback_climate_preset', - method: 'post', + method: 'POST', body, responseKey: undefined, }) @@ -293,11 +296,11 @@ export class SeamHttpThermostats { setFanMode( body?: ThermostatsSetFanModeBody, - options: Pick = {}, + options: ThermostatsSetFanModeOptions = {}, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/thermostats/set_fan_mode', - method: 'post', + method: 'POST', body, responseKey: 'action_attempt', options, @@ -306,11 +309,11 @@ export class SeamHttpThermostats { setHvacMode( body?: ThermostatsSetHvacModeBody, - options: Pick = {}, + options: ThermostatsSetHvacModeOptions = {}, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/thermostats/set_hvac_mode', - method: 'post', + method: 'POST', body, responseKey: 'action_attempt', options, @@ -322,7 +325,7 @@ export class SeamHttpThermostats { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/thermostats/set_temperature_threshold', - method: 'post', + method: 'PATCH', body, responseKey: undefined, }) @@ -333,7 +336,7 @@ export class SeamHttpThermostats { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/thermostats/update_climate_preset', - method: 'post', + method: 'PATCH', body, responseKey: undefined, }) @@ -341,11 +344,11 @@ export class SeamHttpThermostats { updateWeeklyProgram( body?: ThermostatsUpdateWeeklyProgramBody, - options: Pick = {}, + options: ThermostatsUpdateWeeklyProgramOptions = {}, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/thermostats/update_weekly_program', - method: 'post', + method: 'POST', body, responseKey: 'action_attempt', options, diff --git a/src/lib/seam/connect/routes/user-identities-enrollment-automations.ts b/src/lib/seam/connect/routes/user-identities/enrollment-automations/enrollment-automations.ts similarity index 92% rename from src/lib/seam/connect/routes/user-identities-enrollment-automations.ts rename to src/lib/seam/connect/routes/user-identities/enrollment-automations/enrollment-automations.ts index 8570c1d1..3151259c 100644 --- a/src/lib/seam/connect/routes/user-identities-enrollment-automations.ts +++ b/src/lib/seam/connect/routes/user-identities/enrollment-automations/enrollment-automations.ts @@ -1,10 +1,11 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -30,15 +31,16 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpClientSessions } from './client-sessions.js' - export class SeamHttpUserIdentitiesEnrollmentAutomations { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -91,7 +93,7 @@ export class SeamHttpUserIdentitiesEnrollmentAutomations { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpUserIdentitiesEnrollmentAutomations.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -165,26 +167,26 @@ export class SeamHttpUserIdentitiesEnrollmentAutomations { } delete( - body?: UserIdentitiesEnrollmentAutomationsDeleteParams, + params?: UserIdentitiesEnrollmentAutomationsDeleteParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/user_identities/enrollment_automations/delete', - method: 'post', - body, + method: 'POST', + body: params, responseKey: undefined, }) } get( - body?: UserIdentitiesEnrollmentAutomationsGetParams, + params?: UserIdentitiesEnrollmentAutomationsGetParams, ): SeamHttpRequest< UserIdentitiesEnrollmentAutomationsGetResponse, 'enrollment_automation' > { return new SeamHttpRequest(this, { pathname: '/user_identities/enrollment_automations/get', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'enrollment_automation', }) } @@ -197,22 +199,22 @@ export class SeamHttpUserIdentitiesEnrollmentAutomations { > { return new SeamHttpRequest(this, { pathname: '/user_identities/enrollment_automations/launch', - method: 'post', + method: 'POST', body, responseKey: 'enrollment_automation', }) } list( - body?: UserIdentitiesEnrollmentAutomationsListParams, + params?: UserIdentitiesEnrollmentAutomationsListParams, ): SeamHttpRequest< UserIdentitiesEnrollmentAutomationsListResponse, 'enrollment_automations' > { return new SeamHttpRequest(this, { pathname: '/user_identities/enrollment_automations/list', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'enrollment_automations', }) } 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 new file mode 100644 index 00000000..a5cf36fd --- /dev/null +++ b/src/lib/seam/connect/routes/user-identities/enrollment-automations/index.ts @@ -0,0 +1,6 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './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 new file mode 100644 index 00000000..9712abfa --- /dev/null +++ b/src/lib/seam/connect/routes/user-identities/index.ts @@ -0,0 +1,7 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './enrollment-automations/index.js' +export * from './user-identities.js' diff --git a/src/lib/seam/connect/routes/user-identities.ts b/src/lib/seam/connect/routes/user-identities/user-identities.ts similarity index 90% rename from src/lib/seam/connect/routes/user-identities.ts rename to src/lib/seam/connect/routes/user-identities/user-identities.ts index acbfd54f..0711d5d9 100644 --- a/src/lib/seam/connect/routes/user-identities.ts +++ b/src/lib/seam/connect/routes/user-identities/user-identities.ts @@ -1,10 +1,11 @@ /* - * Automatically generated by generate-routes.ts. + * 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, @@ -30,16 +31,18 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpClientSessions } from './client-sessions.js' -import { SeamHttpUserIdentitiesEnrollmentAutomations } from './user-identities-enrollment-automations.js' +import { SeamHttpUserIdentitiesEnrollmentAutomations } from './enrollment-automations/index.js' export class SeamHttpUserIdentities { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -92,7 +95,7 @@ export class SeamHttpUserIdentities { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpUserIdentities.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -174,7 +177,7 @@ export class SeamHttpUserIdentities { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/user_identities/add_acs_user', - method: 'post', + method: 'PUT', body, responseKey: undefined, }) @@ -185,17 +188,19 @@ export class SeamHttpUserIdentities { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/user_identities/create', - method: 'post', + method: 'POST', body, responseKey: 'user_identity', }) } - delete(body?: UserIdentitiesDeleteParams): SeamHttpRequest { + delete( + params?: UserIdentitiesDeleteParams, + ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/user_identities/delete', - method: 'post', - body, + method: 'POST', + body: params, responseKey: undefined, }) } @@ -205,19 +210,19 @@ export class SeamHttpUserIdentities { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/user_identities/generate_instant_key', - method: 'post', + method: 'POST', body, responseKey: 'instant_key', }) } get( - body?: UserIdentitiesGetParams, + params?: UserIdentitiesGetParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/user_identities/get', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'user_identity', }) } @@ -227,74 +232,74 @@ export class SeamHttpUserIdentities { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/user_identities/grant_access_to_device', - method: 'post', + method: 'PUT', body, responseKey: undefined, }) } list( - body?: UserIdentitiesListParams, + params?: UserIdentitiesListParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/user_identities/list', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'user_identities', }) } listAccessibleDevices( - body?: UserIdentitiesListAccessibleDevicesParams, + params?: UserIdentitiesListAccessibleDevicesParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/user_identities/list_accessible_devices', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'devices', }) } listAcsSystems( - body?: UserIdentitiesListAcsSystemsParams, + params?: UserIdentitiesListAcsSystemsParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/user_identities/list_acs_systems', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'acs_systems', }) } listAcsUsers( - body?: UserIdentitiesListAcsUsersParams, + params?: UserIdentitiesListAcsUsersParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/user_identities/list_acs_users', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'acs_users', }) } removeAcsUser( - body?: UserIdentitiesRemoveAcsUserParams, + params?: UserIdentitiesRemoveAcsUserParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/user_identities/remove_acs_user', - method: 'post', - body, + method: 'POST', + body: params, responseKey: undefined, }) } revokeAccessToDevice( - body?: UserIdentitiesRevokeAccessToDeviceParams, + params?: UserIdentitiesRevokeAccessToDeviceParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/user_identities/revoke_access_to_device', - method: 'post', - body, + method: 'POST', + body: params, responseKey: undefined, }) } @@ -302,7 +307,7 @@ export class SeamHttpUserIdentities { update(body?: UserIdentitiesUpdateBody): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/user_identities/update', - method: 'post', + method: 'PATCH', body, responseKey: undefined, }) diff --git a/src/lib/seam/connect/routes/webhooks/index.ts b/src/lib/seam/connect/routes/webhooks/index.ts new file mode 100644 index 00000000..11ea28e2 --- /dev/null +++ b/src/lib/seam/connect/routes/webhooks/index.ts @@ -0,0 +1,6 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './webhooks.js' diff --git a/src/lib/seam/connect/routes/webhooks.ts b/src/lib/seam/connect/routes/webhooks/webhooks.ts similarity index 90% rename from src/lib/seam/connect/routes/webhooks.ts rename to src/lib/seam/connect/routes/webhooks/webhooks.ts index 1678be1f..1ebf38fc 100644 --- a/src/lib/seam/connect/routes/webhooks.ts +++ b/src/lib/seam/connect/routes/webhooks/webhooks.ts @@ -1,10 +1,15 @@ /* - * Automatically generated by generate-routes.ts. + * 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 type { + RouteRequestBody, + RouteRequestParams, + RouteResponse, +} from '@seamapi/types/connect' +import { seamApiLtsVersion } from 'lib/lts-version.js' import { getAuthHeadersForClientSessionToken, warnOnInsecureuserIdentifierKey, @@ -30,15 +35,16 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpClientSessions } from './client-sessions.js' - export class SeamHttpWebhooks { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -91,7 +97,7 @@ export class SeamHttpWebhooks { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpWebhooks.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -166,39 +172,39 @@ export class SeamHttpWebhooks { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/webhooks/create', - method: 'post', + method: 'POST', body, responseKey: 'webhook', }) } - delete(body?: WebhooksDeleteParams): SeamHttpRequest { + delete(params?: WebhooksDeleteParams): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/webhooks/delete', - method: 'post', - body, + method: 'POST', + body: params, responseKey: undefined, }) } get( - body?: WebhooksGetParams, + params?: WebhooksGetParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/webhooks/get', - method: 'post', - body, + method: 'POST', + body: params, responseKey: 'webhook', }) } list( - body?: WebhooksListParams, + params?: WebhooksListParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/webhooks/list', - method: 'post', - body, + method: 'GET', + params, responseKey: 'webhooks', }) } @@ -206,7 +212,7 @@ export class SeamHttpWebhooks { update(body?: WebhooksUpdateBody): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/webhooks/update', - method: 'post', + method: 'PUT', body, responseKey: undefined, }) @@ -237,7 +243,7 @@ export type WebhooksGetResponse = SetNonNullable< export type WebhooksGetOptions = never -export type WebhooksListParams = RouteRequestBody<'/webhooks/list'> +export type WebhooksListParams = RouteRequestParams<'/webhooks/list'> export type WebhooksListResponse = SetNonNullable< Required> diff --git a/src/lib/seam/connect/routes/workspaces/index.ts b/src/lib/seam/connect/routes/workspaces/index.ts new file mode 100644 index 00000000..b420eebf --- /dev/null +++ b/src/lib/seam/connect/routes/workspaces/index.ts @@ -0,0 +1,6 @@ +/* + * Automatically generated by codegen/smith.ts. + * Do not edit this file or add other files to this directory. + */ + +export * from './workspaces.js' diff --git a/src/lib/seam/connect/routes/workspaces.ts b/src/lib/seam/connect/routes/workspaces/workspaces.ts similarity index 90% rename from src/lib/seam/connect/routes/workspaces.ts rename to src/lib/seam/connect/routes/workspaces/workspaces.ts index f89e2e4c..1a2c667f 100644 --- a/src/lib/seam/connect/routes/workspaces.ts +++ b/src/lib/seam/connect/routes/workspaces/workspaces.ts @@ -1,10 +1,15 @@ /* - * Automatically generated by generate-routes.ts. + * 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 type { + RouteRequestBody, + RouteRequestParams, + RouteResponse, +} from '@seamapi/types/connect' +import { seamApiLtsVersion } from 'lib/lts-version.js' import { getAuthHeadersForClientSessionToken, warnOnInsecureuserIdentifierKey, @@ -30,15 +35,16 @@ import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' +import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import type { SetNonNullable } from 'lib/types.js' -import { SeamHttpClientSessions } from './client-sessions.js' - export class SeamHttpWorkspaces { client: Client readonly defaults: Required + readonly ltsVersion = seamApiLtsVersion + static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) @@ -91,7 +97,7 @@ export class SeamHttpWorkspaces { const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( - 'The client option cannot be used with SeamHttp.fromPublishableKey', + 'The client option cannot be used with SeamHttpWorkspaces.fromPublishableKey', ) } const client = createClient(clientOptions) @@ -166,41 +172,41 @@ export class SeamHttpWorkspaces { ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/workspaces/create', - method: 'post', + method: 'POST', body, responseKey: 'workspace', }) } get( - body?: WorkspacesGetParams, + params?: WorkspacesGetParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/workspaces/get', - method: 'post', - body, + method: 'GET', + params, responseKey: 'workspace', }) } list( - body?: WorkspacesListParams, + params?: WorkspacesListParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/workspaces/list', - method: 'post', - body, + method: 'GET', + params, responseKey: 'workspaces', }) } resetSandbox( body?: WorkspacesResetSandboxBody, - options: Pick = {}, + options: WorkspacesResetSandboxOptions = {}, ): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/workspaces/reset_sandbox', - method: 'post', + method: 'POST', body, responseKey: 'action_attempt', options, @@ -210,7 +216,7 @@ export class SeamHttpWorkspaces { update(body?: WorkspacesUpdateBody): SeamHttpRequest { return new SeamHttpRequest(this, { pathname: '/workspaces/update', - method: 'post', + method: 'PATCH', body, responseKey: undefined, }) @@ -225,7 +231,7 @@ export type WorkspacesCreateResponse = SetNonNullable< export type WorkspacesCreateOptions = never -export type WorkspacesGetParams = RouteRequestBody<'/workspaces/get'> +export type WorkspacesGetParams = RouteRequestParams<'/workspaces/get'> export type WorkspacesGetResponse = SetNonNullable< Required> @@ -233,7 +239,7 @@ export type WorkspacesGetResponse = SetNonNullable< export type WorkspacesGetOptions = never -export type WorkspacesListParams = RouteRequestBody<'/workspaces/list'> +export type WorkspacesListParams = RouteRequestParams<'/workspaces/list'> export type WorkspacesListResponse = SetNonNullable< Required>