From f7f8532e6d4529001587cce992b08ee8d1910008 Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Tue, 8 Jul 2025 16:07:01 -0700 Subject: [PATCH 1/3] Update to @seamapi/http 1.45.0 and @seamapi/types 1.441.1 --- README.md | 45 ++++++++++++++++++++++++++++++++++++--------- generate-readme.ts | 2 +- package-lock.json | 26 +++++++++++++------------- package.json | 4 ++-- src/index.ts | 6 +++--- 5 files changed, 55 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 0dda0ea..779350f 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ Instead, it re-exports from a core set of Seam modules: - [Iterate over all pages](#iterate-over-all-pages) - [Iterate over all resources](#iterate-over-all-resources) - [Return all resources across all pages as an array](#return-all-resources-across-all-pages-as-an-array) - - [Interacting with Multiple Workspaces](#interacting-with-multiple-workspaces) + - [Requests without a Workspace in scope](#requests-without-a-workspace-in-scope) - [Personal Access Token](#personal-access-token-1) - [Console Session Token](#console-session-token-1) - [Advanced Usage](#advanced-usage) @@ -58,6 +58,8 @@ Instead, it re-exports from a core set of Seam modules: - [Configuring the Axios Client](#configuring-the-axios-client) - [Using the Axios Client](#using-the-axios-client) - [Overriding the Client](#overriding-the-client) + - [Alternative endpoint path interface](#alternative-endpoint-path-interface) + - [Enable undocumented API](#enable-undocumented-api) - [Inspecting the Request](#inspecting-the-request) - [Receiving Webhooks](#receiving-webhooks) - [Development and Testing](#development-and-testing) @@ -408,10 +410,10 @@ const pages = seam.createPaginator( const devices = await pages.flattenToArray() ``` -### Interacting with Multiple Workspaces +### Requests without a Workspace in scope -Some Seam API endpoints interact with multiple workspaces. -The `SeamMultiWorkspace` client is not bound to a specific workspace +Some Seam API endpoints do not require a workspace in scope. +The `SeamWithoutWorkspace` client is not bound to a specific workspace and may use those endpoints with an appropriate authentication method. #### Personal Access Token @@ -421,15 +423,15 @@ Obtain one from the Seam Console. ```ts // Set the `SEAM_PERSONAL_ACCESS_TOKEN` environment variable -const seam = new SeamMultiWorkspace() +const seam = new SeamWithoutWorkspace() // Pass as an option to the constructor -const seam = new SeamMultiWorkspace({ +const seam = new SeamWithoutWorkspace({ personalAccessToken: 'your-personal-access-token', }) // Use the factory method -const seam = SeamMultiWorkspace.fromPersonalAccessToken( +const seam = SeamWithoutWorkspace.fromPersonalAccessToken( 'some-console-session-token', ) @@ -444,12 +446,12 @@ This authentication method is only used by internal Seam applications. ```ts // Pass as an option to the constructor -const seam = new SeamMultiWorkspace({ +const seam = new SeamWithoutWorkspace({ consoleSessionToken: 'some-console-session-token', }) // Use the factory method -const seam = SeamMultiWorkspace.fromConsoleSessionToken( +const seam = SeamWithoutWorkspace.fromConsoleSessionToken( 'some-console-session-token', ) @@ -523,6 +525,31 @@ const devices = await seam.client.get('/devices/list') An Axios compatible client may be provided to create a `Seam` instance. This API is used internally and is not directly supported. +#### Alternative endpoint path interface + +The `SeamEndpoints` class offers an alternative path-based interface to every API endpoint. +Each endpoint is exposed as simple property that returns the corresponding method from `Seam`. + +```ts +import { SeamEndpoints } from 'seam' + +const seam = new SeamEndpoints() +const devices = await seam['/devices/list']() +``` + +#### Enable undocumented API + +Pass the `isUndocumentedApiEnabled` option to allow using the undocumented API. +This API is used internally and is not directly supported. +Do not use the undocumented API in production environments. +Seam is not responsible for any issues you may encounter with the undocumented API. + +```ts +import { Seam } from 'seam' + +const seam = new Seam({ isUndocumentedApiEnabled: true }) +``` + #### Inspecting the Request All client methods return an instance of `SeamHttpRequest`. diff --git a/generate-readme.ts b/generate-readme.ts index 840404e..6f24639 100644 --- a/generate-readme.ts +++ b/generate-readme.ts @@ -61,9 +61,9 @@ async function writeReadmeUsage(content: string): Promise { const updatedContent = content .replaceAll('@seamapi/webhook', 'seam') .replaceAll('@seamapi/http', 'seam') + .replaceAll('@seamapi/types', 'seam') .replaceAll('SeamHttp', 'Seam') .replaceAll('SeamRequest', 'SeamHttpRequest') - .replaceAll('seam/connect', 'seam') const currentUsageSection = matches[1] diff --git a/package-lock.json b/package-lock.json index bb6a0a6..0c8655c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,8 +9,8 @@ "version": "1.80.0", "license": "MIT", "dependencies": { - "@seamapi/http": "1.35.1", - "@seamapi/types": "1.420.2", + "@seamapi/http": "1.45.0", + "@seamapi/types": "1.441.1", "@seamapi/webhook": "1.1.1", "zod": "^3.21.4" }, @@ -1115,12 +1115,12 @@ "peer": true }, "node_modules/@seamapi/http": { - "version": "1.35.1", - "resolved": "https://registry.npmjs.org/@seamapi/http/-/http-1.35.1.tgz", - "integrity": "sha512-oIwNfy42EIHY/hI7WTAq5kMfE3TzdZm7c7j6brr5fymPe8McrsIO2GpjoPIaQ6cIDF7bPxAQw37sVD7nJpi3sQ==", + "version": "1.45.0", + "resolved": "https://registry.npmjs.org/@seamapi/http/-/http-1.45.0.tgz", + "integrity": "sha512-ABLSJpMtVJh7euf+VLo5Z1yfGkv8v60vJgNv0dJhbDWtYz6fLsyyUI6h9OtlPlf89fNcr6DlwmtM0UkxEkiSzg==", "license": "MIT", "dependencies": { - "@seamapi/url-search-params-serializer": "^2.0.0-beta.2", + "@seamapi/url-search-params-serializer": "^2.0.0", "axios": "^1.9.0", "axios-retry": "^4.4.2" }, @@ -1129,7 +1129,7 @@ "npm": ">=10.1.0" }, "peerDependencies": { - "@seamapi/types": "1.420.2" + "@seamapi/types": "^1.439.0" }, "peerDependenciesMeta": { "@seamapi/types": { @@ -1138,9 +1138,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.420.2", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.420.2.tgz", - "integrity": "sha512-3W6YwDWIUsfwvEzzF6HuDNryqSqtywoGvi+zfLf9Js/wh88A3DKXYOmwamGWLus2L6vTp28F4aipcu5uNQndow==", + "version": "1.441.1", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.441.1.tgz", + "integrity": "sha512-r1j/SgsmQW+4vm7MTmnRJwGqNYvkAdlDnkVhL3jSA6QW3VQtv/EMzd/jaSeakpUH9jli+1lgN+fLxrM2n9fu5A==", "license": "MIT", "engines": { "node": ">=18.12.0", @@ -1151,9 +1151,9 @@ } }, "node_modules/@seamapi/url-search-params-serializer": { - "version": "2.0.0-beta.2", - "resolved": "https://registry.npmjs.org/@seamapi/url-search-params-serializer/-/url-search-params-serializer-2.0.0-beta.2.tgz", - "integrity": "sha512-ASHYo5/0IY7iB/cWcZA9b6meAa5b22NfEZyIuZQ2I90L7WeKzeWxEmusA4nfc26giQOeuEF1xAIGSdGrT+lGZg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@seamapi/url-search-params-serializer/-/url-search-params-serializer-2.0.0.tgz", + "integrity": "sha512-mXHTk9b4pVueFOKkpWyQG6yVK8YWPjr3ksdvBoKhSn8inrBM3Blp539BHuiT4GDfjYtgWq+/j3GN3JTDMuXxJQ==", "license": "MIT", "engines": { "node": ">=18.12.0", diff --git a/package.json b/package.json index 22b9925..98bf001 100644 --- a/package.json +++ b/package.json @@ -65,8 +65,8 @@ "npm": ">= 9.0.0" }, "dependencies": { - "@seamapi/http": "1.35.1", - "@seamapi/types": "1.420.2", + "@seamapi/http": "1.45.0", + "@seamapi/types": "1.441.1", "@seamapi/webhook": "1.1.1", "zod": "^3.21.4" }, diff --git a/src/index.ts b/src/index.ts index 1b07e48..7ae320c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,10 +3,10 @@ import { SeamHttpMultiWorkspace as SeamMultiWorkspace, type SeamHttpMultiWorkspaceOptions as SeamMultiWorkspaceOptions, type SeamHttpOptions as SeamOptions, -} from '@seamapi/http/connect' +} from '@seamapi/http' -export * from '@seamapi/http/connect' -export type * from '@seamapi/types/connect' +export * from '@seamapi/http' +export type * from '@seamapi/types' export * from '@seamapi/webhook' export { Seam, SeamMultiWorkspace } export type { SeamMultiWorkspaceOptions, SeamOptions } From cacbd2f020d86bdd346c402a4333a0c656d5bc52 Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Tue, 8 Jul 2025 16:15:05 -0700 Subject: [PATCH 2/3] Export new classes --- src/index.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 7ae320c..4253cdc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,12 +1,19 @@ import { SeamHttp as Seam, + SeamHttpEndpoints as SeamEndpoints, SeamHttpMultiWorkspace as SeamMultiWorkspace, - type SeamHttpMultiWorkspaceOptions as SeamMultiWorkspaceOptions, type SeamHttpOptions as SeamOptions, + SeamHttpWithoutWorkspace as SeamWithoutWorkspace, + type SeamHttpWithoutWorkspace as SeamWithoutWorkspaceOptions, + type SeamHttpWithoutWorkspaceOptions as SeamMultiWorkspaceOptions, } from '@seamapi/http' export * from '@seamapi/http' export type * from '@seamapi/types' export * from '@seamapi/webhook' -export { Seam, SeamMultiWorkspace } -export type { SeamMultiWorkspaceOptions, SeamOptions } +export { Seam, SeamEndpoints,SeamMultiWorkspace, SeamWithoutWorkspace } +export type { + SeamMultiWorkspaceOptions, + SeamOptions, + SeamWithoutWorkspaceOptions, +} From 844e49bc5001ef7761cdf71ad2956cc1d1b395c2 Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Tue, 8 Jul 2025 23:15:42 +0000 Subject: [PATCH 3/3] ci: Format code --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 4253cdc..52e85ae 100644 --- a/src/index.ts +++ b/src/index.ts @@ -11,7 +11,7 @@ import { export * from '@seamapi/http' export type * from '@seamapi/types' export * from '@seamapi/webhook' -export { Seam, SeamEndpoints,SeamMultiWorkspace, SeamWithoutWorkspace } +export { Seam, SeamEndpoints, SeamMultiWorkspace, SeamWithoutWorkspace } export type { SeamMultiWorkspaceOptions, SeamOptions,