Skip to content

Commit 70f6fa1

Browse files
razor-xseambot
andauthored
feat: Update to @seamapi/http 1.45.0 and @seamapi/types 1.441.1 (#271)
* Update to @seamapi/http 1.45.0 and @seamapi/types 1.441.1 * Export new classes * ci: Format code --------- Co-authored-by: Seam Bot <[email protected]>
1 parent f4c1213 commit 70f6fa1

File tree

5 files changed

+65
-31
lines changed

5 files changed

+65
-31
lines changed

README.md

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Instead, it re-exports from a core set of Seam modules:
4949
- [Iterate over all pages](#iterate-over-all-pages)
5050
- [Iterate over all resources](#iterate-over-all-resources)
5151
- [Return all resources across all pages as an array](#return-all-resources-across-all-pages-as-an-array)
52-
- [Interacting with Multiple Workspaces](#interacting-with-multiple-workspaces)
52+
- [Requests without a Workspace in scope](#requests-without-a-workspace-in-scope)
5353
- [Personal Access Token](#personal-access-token-1)
5454
- [Console Session Token](#console-session-token-1)
5555
- [Advanced Usage](#advanced-usage)
@@ -58,6 +58,8 @@ Instead, it re-exports from a core set of Seam modules:
5858
- [Configuring the Axios Client](#configuring-the-axios-client)
5959
- [Using the Axios Client](#using-the-axios-client)
6060
- [Overriding the Client](#overriding-the-client)
61+
- [Alternative endpoint path interface](#alternative-endpoint-path-interface)
62+
- [Enable undocumented API](#enable-undocumented-api)
6163
- [Inspecting the Request](#inspecting-the-request)
6264
- [Receiving Webhooks](#receiving-webhooks)
6365
- [Development and Testing](#development-and-testing)
@@ -408,10 +410,10 @@ const pages = seam.createPaginator(
408410
const devices = await pages.flattenToArray()
409411
```
410412

411-
### Interacting with Multiple Workspaces
413+
### Requests without a Workspace in scope
412414

413-
Some Seam API endpoints interact with multiple workspaces.
414-
The `SeamMultiWorkspace` client is not bound to a specific workspace
415+
Some Seam API endpoints do not require a workspace in scope.
416+
The `SeamWithoutWorkspace` client is not bound to a specific workspace
415417
and may use those endpoints with an appropriate authentication method.
416418

417419
#### Personal Access Token
@@ -421,15 +423,15 @@ Obtain one from the Seam Console.
421423

422424
```ts
423425
// Set the `SEAM_PERSONAL_ACCESS_TOKEN` environment variable
424-
const seam = new SeamMultiWorkspace()
426+
const seam = new SeamWithoutWorkspace()
425427

426428
// Pass as an option to the constructor
427-
const seam = new SeamMultiWorkspace({
429+
const seam = new SeamWithoutWorkspace({
428430
personalAccessToken: 'your-personal-access-token',
429431
})
430432

431433
// Use the factory method
432-
const seam = SeamMultiWorkspace.fromPersonalAccessToken(
434+
const seam = SeamWithoutWorkspace.fromPersonalAccessToken(
433435
'some-console-session-token',
434436
)
435437

@@ -444,12 +446,12 @@ This authentication method is only used by internal Seam applications.
444446

445447
```ts
446448
// Pass as an option to the constructor
447-
const seam = new SeamMultiWorkspace({
449+
const seam = new SeamWithoutWorkspace({
448450
consoleSessionToken: 'some-console-session-token',
449451
})
450452

451453
// Use the factory method
452-
const seam = SeamMultiWorkspace.fromConsoleSessionToken(
454+
const seam = SeamWithoutWorkspace.fromConsoleSessionToken(
453455
'some-console-session-token',
454456
)
455457

@@ -523,6 +525,31 @@ const devices = await seam.client.get<DevicesListResponse>('/devices/list')
523525
An Axios compatible client may be provided to create a `Seam` instance.
524526
This API is used internally and is not directly supported.
525527

528+
#### Alternative endpoint path interface
529+
530+
The `SeamEndpoints` class offers an alternative path-based interface to every API endpoint.
531+
Each endpoint is exposed as simple property that returns the corresponding method from `Seam`.
532+
533+
```ts
534+
import { SeamEndpoints } from 'seam'
535+
536+
const seam = new SeamEndpoints()
537+
const devices = await seam['/devices/list']()
538+
```
539+
540+
#### Enable undocumented API
541+
542+
Pass the `isUndocumentedApiEnabled` option to allow using the undocumented API.
543+
This API is used internally and is not directly supported.
544+
Do not use the undocumented API in production environments.
545+
Seam is not responsible for any issues you may encounter with the undocumented API.
546+
547+
```ts
548+
import { Seam } from 'seam'
549+
550+
const seam = new Seam({ isUndocumentedApiEnabled: true })
551+
```
552+
526553
#### Inspecting the Request
527554

528555
All client methods return an instance of `SeamHttpRequest`.

generate-readme.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ async function writeReadmeUsage(content: string): Promise<void> {
6161
const updatedContent = content
6262
.replaceAll('@seamapi/webhook', 'seam')
6363
.replaceAll('@seamapi/http', 'seam')
64+
.replaceAll('@seamapi/types', 'seam')
6465
.replaceAll('SeamHttp', 'Seam')
6566
.replaceAll('SeamRequest', 'SeamHttpRequest')
66-
.replaceAll('seam/connect', 'seam')
6767

6868
const currentUsageSection = matches[1]
6969

package-lock.json

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@
6565
"npm": ">= 9.0.0"
6666
},
6767
"dependencies": {
68-
"@seamapi/http": "1.35.1",
69-
"@seamapi/types": "1.420.2",
68+
"@seamapi/http": "1.45.0",
69+
"@seamapi/types": "1.441.1",
7070
"@seamapi/webhook": "1.1.1",
7171
"zod": "^3.21.4"
7272
},

src/index.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
import {
22
SeamHttp as Seam,
3+
SeamHttpEndpoints as SeamEndpoints,
34
SeamHttpMultiWorkspace as SeamMultiWorkspace,
4-
type SeamHttpMultiWorkspaceOptions as SeamMultiWorkspaceOptions,
55
type SeamHttpOptions as SeamOptions,
6-
} from '@seamapi/http/connect'
6+
SeamHttpWithoutWorkspace as SeamWithoutWorkspace,
7+
type SeamHttpWithoutWorkspace as SeamWithoutWorkspaceOptions,
8+
type SeamHttpWithoutWorkspaceOptions as SeamMultiWorkspaceOptions,
9+
} from '@seamapi/http'
710

8-
export * from '@seamapi/http/connect'
9-
export type * from '@seamapi/types/connect'
11+
export * from '@seamapi/http'
12+
export type * from '@seamapi/types'
1013
export * from '@seamapi/webhook'
11-
export { Seam, SeamMultiWorkspace }
12-
export type { SeamMultiWorkspaceOptions, SeamOptions }
14+
export { Seam, SeamEndpoints, SeamMultiWorkspace, SeamWithoutWorkspace }
15+
export type {
16+
SeamMultiWorkspaceOptions,
17+
SeamOptions,
18+
SeamWithoutWorkspaceOptions,
19+
}

0 commit comments

Comments
 (0)