@seamapi/http 1.39.0 → 1.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -8
- package/dist/connect.cjs +86 -1153
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +43 -298
- package/dist/index.cjs.map +1 -1
- package/lib/seam/connect/auth.js +3 -3
- package/lib/seam/connect/auth.js.map +1 -1
- package/lib/seam/connect/index.d.ts +0 -1
- package/lib/seam/connect/index.js +0 -1
- package/lib/seam/connect/index.js.map +1 -1
- package/lib/seam/connect/options.d.ts +9 -9
- package/lib/seam/connect/options.js +7 -7
- package/lib/seam/connect/options.js.map +1 -1
- package/lib/seam/connect/parse-options.d.ts +2 -2
- package/lib/seam/connect/parse-options.js +2 -2
- package/lib/seam/connect/parse-options.js.map +1 -1
- package/lib/seam/connect/routes/index.d.ts +2 -0
- package/lib/seam/connect/routes/index.js +2 -0
- package/lib/seam/connect/routes/index.js.map +1 -1
- package/lib/seam/connect/routes/seam/index.d.ts +0 -3
- package/lib/seam/connect/routes/seam/index.js +0 -3
- package/lib/seam/connect/routes/seam/index.js.map +1 -1
- package/lib/seam/connect/routes/seam-http-endpoints-without-workspace.d.ts +17 -0
- package/lib/seam/connect/routes/seam-http-endpoints-without-workspace.js +54 -0
- package/lib/seam/connect/routes/seam-http-endpoints-without-workspace.js.map +1 -0
- package/lib/seam/connect/routes/seam-http-endpoints.d.ts +2 -16
- package/lib/seam/connect/routes/seam-http-endpoints.js +0 -95
- package/lib/seam/connect/routes/seam-http-endpoints.js.map +1 -1
- package/lib/seam/connect/routes/seam-http-without-workspace.d.ts +18 -0
- package/lib/seam/connect/routes/seam-http-without-workspace.js +47 -0
- package/lib/seam/connect/routes/seam-http-without-workspace.js.map +1 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +3 -3
- package/src/lib/seam/connect/auth.ts +8 -8
- package/src/lib/seam/connect/index.ts +0 -1
- package/src/lib/seam/connect/options.ts +19 -19
- package/src/lib/seam/connect/parse-options.ts +4 -4
- package/src/lib/seam/connect/routes/index.ts +2 -0
- package/src/lib/seam/connect/routes/seam/index.ts +0 -3
- package/src/lib/seam/connect/routes/seam-http-endpoints-without-workspace.ts +126 -0
- package/src/lib/seam/connect/routes/seam-http-endpoints.ts +0 -252
- package/src/lib/seam/connect/routes/seam-http-without-workspace.ts +96 -0
- package/src/lib/version.ts +1 -1
- package/lib/seam/connect/routes/seam/bridge/index.d.ts +0 -1
- package/lib/seam/connect/routes/seam/bridge/index.js +0 -6
- package/lib/seam/connect/routes/seam/bridge/index.js.map +0 -1
- package/lib/seam/connect/routes/seam/bridge/v1/bridge-client-sessions/bridge-client-sessions.d.ts +0 -86
- package/lib/seam/connect/routes/seam/bridge/v1/bridge-client-sessions/bridge-client-sessions.js +0 -150
- package/lib/seam/connect/routes/seam/bridge/v1/bridge-client-sessions/bridge-client-sessions.js.map +0 -1
- package/lib/seam/connect/routes/seam/bridge/v1/bridge-client-sessions/index.d.ts +0 -1
- package/lib/seam/connect/routes/seam/bridge/v1/bridge-client-sessions/index.js +0 -6
- package/lib/seam/connect/routes/seam/bridge/v1/bridge-client-sessions/index.js.map +0 -1
- package/lib/seam/connect/routes/seam/bridge/v1/bridge-connected-systems/bridge-connected-systems.d.ts +0 -34
- package/lib/seam/connect/routes/seam/bridge/v1/bridge-connected-systems/bridge-connected-systems.js +0 -102
- package/lib/seam/connect/routes/seam/bridge/v1/bridge-connected-systems/bridge-connected-systems.js.map +0 -1
- package/lib/seam/connect/routes/seam/bridge/v1/bridge-connected-systems/index.d.ts +0 -1
- package/lib/seam/connect/routes/seam/bridge/v1/bridge-connected-systems/index.js +0 -6
- package/lib/seam/connect/routes/seam/bridge/v1/bridge-connected-systems/index.js.map +0 -1
- package/lib/seam/connect/routes/seam/bridge/v1/index.d.ts +0 -3
- package/lib/seam/connect/routes/seam/bridge/v1/index.js +0 -8
- package/lib/seam/connect/routes/seam/bridge/v1/index.js.map +0 -1
- package/lib/seam/connect/routes/seam/bridge/v1/v1.d.ts +0 -23
- package/lib/seam/connect/routes/seam/bridge/v1/v1.js +0 -97
- package/lib/seam/connect/routes/seam/bridge/v1/v1.js.map +0 -1
- package/lib/seam/connect/routes/seam/instant-key/index.d.ts +0 -1
- package/lib/seam/connect/routes/seam/instant-key/index.js +0 -6
- package/lib/seam/connect/routes/seam/instant-key/index.js.map +0 -1
- package/lib/seam/connect/routes/seam/instant-key/v1/client-sessions/client-sessions.d.ts +0 -34
- package/lib/seam/connect/routes/seam/instant-key/v1/client-sessions/client-sessions.js +0 -102
- package/lib/seam/connect/routes/seam/instant-key/v1/client-sessions/client-sessions.js.map +0 -1
- package/lib/seam/connect/routes/seam/instant-key/v1/client-sessions/index.d.ts +0 -1
- package/lib/seam/connect/routes/seam/instant-key/v1/client-sessions/index.js +0 -6
- package/lib/seam/connect/routes/seam/instant-key/v1/client-sessions/index.js.map +0 -1
- package/lib/seam/connect/routes/seam/instant-key/v1/index.d.ts +0 -2
- package/lib/seam/connect/routes/seam/instant-key/v1/index.js +0 -7
- package/lib/seam/connect/routes/seam/instant-key/v1/index.js.map +0 -1
- package/lib/seam/connect/routes/seam/instant-key/v1/v1.d.ts +0 -21
- package/lib/seam/connect/routes/seam/instant-key/v1/v1.js +0 -93
- package/lib/seam/connect/routes/seam/instant-key/v1/v1.js.map +0 -1
- package/lib/seam/connect/routes/seam/mobile-sdk/index.d.ts +0 -1
- package/lib/seam/connect/routes/seam/mobile-sdk/index.js +0 -6
- package/lib/seam/connect/routes/seam/mobile-sdk/index.js.map +0 -1
- package/lib/seam/connect/routes/seam/mobile-sdk/v1/acs/acs.d.ts +0 -21
- package/lib/seam/connect/routes/seam/mobile-sdk/v1/acs/acs.js +0 -93
- package/lib/seam/connect/routes/seam/mobile-sdk/v1/acs/acs.js.map +0 -1
- package/lib/seam/connect/routes/seam/mobile-sdk/v1/acs/credentials/credentials.d.ts +0 -34
- package/lib/seam/connect/routes/seam/mobile-sdk/v1/acs/credentials/credentials.js +0 -102
- package/lib/seam/connect/routes/seam/mobile-sdk/v1/acs/credentials/credentials.js.map +0 -1
- package/lib/seam/connect/routes/seam/mobile-sdk/v1/acs/credentials/index.d.ts +0 -1
- package/lib/seam/connect/routes/seam/mobile-sdk/v1/acs/credentials/index.js +0 -6
- package/lib/seam/connect/routes/seam/mobile-sdk/v1/acs/credentials/index.js.map +0 -1
- package/lib/seam/connect/routes/seam/mobile-sdk/v1/acs/index.d.ts +0 -2
- package/lib/seam/connect/routes/seam/mobile-sdk/v1/acs/index.js +0 -7
- package/lib/seam/connect/routes/seam/mobile-sdk/v1/acs/index.js.map +0 -1
- package/lib/seam/connect/routes/seam/mobile-sdk/v1/index.d.ts +0 -3
- package/lib/seam/connect/routes/seam/mobile-sdk/v1/index.js +0 -8
- package/lib/seam/connect/routes/seam/mobile-sdk/v1/index.js.map +0 -1
- package/lib/seam/connect/routes/seam/mobile-sdk/v1/phone-sessions/index.d.ts +0 -1
- package/lib/seam/connect/routes/seam/mobile-sdk/v1/phone-sessions/index.js +0 -6
- package/lib/seam/connect/routes/seam/mobile-sdk/v1/phone-sessions/index.js.map +0 -1
- package/lib/seam/connect/routes/seam/mobile-sdk/v1/phone-sessions/phone-sessions.d.ts +0 -34
- package/lib/seam/connect/routes/seam/mobile-sdk/v1/phone-sessions/phone-sessions.js +0 -102
- package/lib/seam/connect/routes/seam/mobile-sdk/v1/phone-sessions/phone-sessions.js.map +0 -1
- package/lib/seam/connect/routes/seam/mobile-sdk/v1/v1.d.ts +0 -23
- package/lib/seam/connect/routes/seam/mobile-sdk/v1/v1.js +0 -97
- package/lib/seam/connect/routes/seam/mobile-sdk/v1/v1.js.map +0 -1
- package/lib/seam/connect/seam-http-multi-workspace.d.ts +0 -12
- package/lib/seam/connect/seam-http-multi-workspace.js +0 -36
- package/lib/seam/connect/seam-http-multi-workspace.js.map +0 -1
- package/src/lib/seam/connect/routes/seam/bridge/index.ts +0 -6
- package/src/lib/seam/connect/routes/seam/bridge/v1/bridge-client-sessions/bridge-client-sessions.ts +0 -398
- package/src/lib/seam/connect/routes/seam/bridge/v1/bridge-client-sessions/index.ts +0 -6
- package/src/lib/seam/connect/routes/seam/bridge/v1/bridge-connected-systems/bridge-connected-systems.ts +0 -215
- package/src/lib/seam/connect/routes/seam/bridge/v1/bridge-connected-systems/index.ts +0 -6
- package/src/lib/seam/connect/routes/seam/bridge/v1/index.ts +0 -8
- package/src/lib/seam/connect/routes/seam/bridge/v1/v1.ts +0 -184
- package/src/lib/seam/connect/routes/seam/instant-key/index.ts +0 -6
- package/src/lib/seam/connect/routes/seam/instant-key/v1/client-sessions/client-sessions.ts +0 -219
- package/src/lib/seam/connect/routes/seam/instant-key/v1/client-sessions/index.ts +0 -6
- package/src/lib/seam/connect/routes/seam/instant-key/v1/index.ts +0 -7
- package/src/lib/seam/connect/routes/seam/instant-key/v1/v1.ts +0 -176
- package/src/lib/seam/connect/routes/seam/mobile-sdk/index.ts +0 -6
- package/src/lib/seam/connect/routes/seam/mobile-sdk/v1/acs/acs.ts +0 -176
- package/src/lib/seam/connect/routes/seam/mobile-sdk/v1/acs/credentials/credentials.ts +0 -215
- package/src/lib/seam/connect/routes/seam/mobile-sdk/v1/acs/credentials/index.ts +0 -6
- package/src/lib/seam/connect/routes/seam/mobile-sdk/v1/acs/index.ts +0 -7
- package/src/lib/seam/connect/routes/seam/mobile-sdk/v1/index.ts +0 -8
- package/src/lib/seam/connect/routes/seam/mobile-sdk/v1/phone-sessions/index.ts +0 -6
- package/src/lib/seam/connect/routes/seam/mobile-sdk/v1/phone-sessions/phone-sessions.ts +0 -215
- package/src/lib/seam/connect/routes/seam/mobile-sdk/v1/v1.ts +0 -181
- package/src/lib/seam/connect/seam-http-multi-workspace.ts +0 -80
|
@@ -2,11 +2,11 @@ import type { Client, ClientOptions } from './client.js'
|
|
|
2
2
|
import { isSeamHttpRequestOption } from './parse-options.js'
|
|
3
3
|
import type { ResolveActionAttemptOptions } from './resolve-action-attempt.js'
|
|
4
4
|
|
|
5
|
-
export type
|
|
6
|
-
|
|
|
7
|
-
|
|
|
8
|
-
|
|
|
9
|
-
|
|
|
5
|
+
export type SeamHttpWithoutWorkspaceOptions =
|
|
6
|
+
| SeamHttpWithoutWorkspaceOptionsFromEnv
|
|
7
|
+
| SeamHttpWithoutWorkspaceOptionsWithClient
|
|
8
|
+
| SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken
|
|
9
|
+
| SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken
|
|
10
10
|
|
|
11
11
|
export type SeamHttpOptions =
|
|
12
12
|
| SeamHttpOptionsFromEnv
|
|
@@ -30,17 +30,17 @@ export interface SeamHttpFromPublishableKeyOptions
|
|
|
30
30
|
|
|
31
31
|
export interface SeamHttpOptionsFromEnv extends SeamHttpCommonOptions {}
|
|
32
32
|
|
|
33
|
-
export interface
|
|
33
|
+
export interface SeamHttpWithoutWorkspaceOptionsFromEnv
|
|
34
34
|
extends SeamHttpCommonOptions {}
|
|
35
35
|
|
|
36
|
-
export interface
|
|
36
|
+
export interface SeamHttpWithoutWorkspaceOptionsWithClient
|
|
37
37
|
extends SeamHttpCommonOptions {
|
|
38
38
|
client: Client
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
export const
|
|
41
|
+
export const isSeamHttpWithoutWorkspaceOptionsWithClient = (
|
|
42
42
|
options: SeamHttpOptions,
|
|
43
|
-
): options is
|
|
43
|
+
): options is SeamHttpWithoutWorkspaceOptionsWithClient =>
|
|
44
44
|
isSeamHttpOptionsWithClient(options)
|
|
45
45
|
|
|
46
46
|
export interface SeamHttpOptionsWithClient extends SeamHttpRequestOptions {
|
|
@@ -128,14 +128,14 @@ export const isSeamHttpOptionsWithClientSessionToken = (
|
|
|
128
128
|
return true
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
export interface
|
|
131
|
+
export interface SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken
|
|
132
132
|
extends SeamHttpCommonOptions {
|
|
133
133
|
consoleSessionToken: string
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
export const
|
|
136
|
+
export const isSeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken = (
|
|
137
137
|
options: SeamHttpOptions,
|
|
138
|
-
): options is
|
|
138
|
+
): options is SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken => {
|
|
139
139
|
if (!('consoleSessionToken' in options)) return false
|
|
140
140
|
if (options.consoleSessionToken == null) return false
|
|
141
141
|
|
|
@@ -169,7 +169,7 @@ export interface SeamHttpOptionsWithConsoleSessionToken
|
|
|
169
169
|
export const isSeamHttpOptionsWithConsoleSessionToken = (
|
|
170
170
|
options: SeamHttpOptions,
|
|
171
171
|
): options is SeamHttpOptionsWithConsoleSessionToken => {
|
|
172
|
-
if (!
|
|
172
|
+
if (!isSeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken(options)) {
|
|
173
173
|
return false
|
|
174
174
|
}
|
|
175
175
|
|
|
@@ -182,14 +182,14 @@ export const isSeamHttpOptionsWithConsoleSessionToken = (
|
|
|
182
182
|
return true
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
export interface
|
|
185
|
+
export interface SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken
|
|
186
186
|
extends SeamHttpCommonOptions {
|
|
187
187
|
personalAccessToken: string
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
export const
|
|
190
|
+
export const isSeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken = (
|
|
191
191
|
options: SeamHttpOptions,
|
|
192
|
-
): options is
|
|
192
|
+
): options is SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken => {
|
|
193
193
|
if (!('personalAccessToken' in options)) return false
|
|
194
194
|
if (options.personalAccessToken == null) return false
|
|
195
195
|
|
|
@@ -223,7 +223,7 @@ export interface SeamHttpOptionsWithPersonalAccessToken
|
|
|
223
223
|
export const isSeamHttpOptionsWithPersonalAccessToken = (
|
|
224
224
|
options: SeamHttpOptions,
|
|
225
225
|
): options is SeamHttpOptionsWithPersonalAccessToken => {
|
|
226
|
-
if (!
|
|
226
|
+
if (!isSeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken(options)) {
|
|
227
227
|
return false
|
|
228
228
|
}
|
|
229
229
|
|
|
@@ -243,9 +243,9 @@ export class SeamHttpInvalidOptionsError extends Error {
|
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
-
export class
|
|
246
|
+
export class SeamHttpWithoutWorkspaceInvalidOptionsError extends Error {
|
|
247
247
|
constructor(message: string) {
|
|
248
|
-
super(`
|
|
248
|
+
super(`SeamHttpWithoutWorkspace received invalid options: ${message}`)
|
|
249
249
|
this.name = this.constructor.name
|
|
250
250
|
}
|
|
251
251
|
}
|
|
@@ -4,13 +4,13 @@ import version from 'lib/version.js'
|
|
|
4
4
|
import { getAuthHeaders } from './auth.js'
|
|
5
5
|
import type { Client, ClientOptions } from './client.js'
|
|
6
6
|
import {
|
|
7
|
-
isSeamHttpMultiWorkspaceOptionsWithClient,
|
|
8
7
|
isSeamHttpOptionsWithClient,
|
|
9
8
|
isSeamHttpOptionsWithClientSessionToken,
|
|
9
|
+
isSeamHttpWithoutWorkspaceOptionsWithClient,
|
|
10
10
|
SeamHttpInvalidOptionsError,
|
|
11
|
-
type SeamHttpMultiWorkspaceOptions,
|
|
12
11
|
type SeamHttpOptions,
|
|
13
12
|
type SeamHttpRequestOptions,
|
|
13
|
+
type SeamHttpWithoutWorkspaceOptions,
|
|
14
14
|
} from './options.js'
|
|
15
15
|
|
|
16
16
|
export const defaultEndpoint = 'https://connect.getseam.com'
|
|
@@ -22,7 +22,7 @@ export const sdkHeaders = {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export type Options =
|
|
25
|
-
|
|
|
25
|
+
| SeamHttpWithoutWorkspaceOptions
|
|
26
26
|
| (SeamHttpOptions & { publishableKey?: string })
|
|
27
27
|
|
|
28
28
|
type ParsedOptions = Required<
|
|
@@ -35,7 +35,7 @@ export const parseOptions = (
|
|
|
35
35
|
const options = getNormalizedOptions(apiKeyOrOptions)
|
|
36
36
|
|
|
37
37
|
if (isSeamHttpOptionsWithClient(options)) return options
|
|
38
|
-
if (
|
|
38
|
+
if (isSeamHttpWithoutWorkspaceOptionsWithClient(options)) return options
|
|
39
39
|
|
|
40
40
|
return {
|
|
41
41
|
...options,
|
|
@@ -21,6 +21,8 @@ export * from './phones/index.js'
|
|
|
21
21
|
export * from './seam/index.js'
|
|
22
22
|
export * from './seam-http.js'
|
|
23
23
|
export * from './seam-http-endpoints.js'
|
|
24
|
+
export * from './seam-http-endpoints-without-workspace.js'
|
|
25
|
+
export * from './seam-http-without-workspace.js'
|
|
24
26
|
export * from './spaces/index.js'
|
|
25
27
|
export * from './thermostats/index.js'
|
|
26
28
|
export * from './unstable-access-grants/index.js'
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Automatically generated by codegen/smith.ts.
|
|
3
|
+
* Do not edit this file or add other files to this directory.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { seamApiLtsVersion } from 'lib/lts-version.js'
|
|
7
|
+
import { type Client, createClient } from 'lib/seam/connect/client.js'
|
|
8
|
+
import {
|
|
9
|
+
isSeamHttpWithoutWorkspaceOptionsWithClient,
|
|
10
|
+
isSeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken,
|
|
11
|
+
isSeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken,
|
|
12
|
+
type SeamHttpRequestOptions,
|
|
13
|
+
SeamHttpWithoutWorkspaceInvalidOptionsError,
|
|
14
|
+
type SeamHttpWithoutWorkspaceOptions,
|
|
15
|
+
type SeamHttpWithoutWorkspaceOptionsWithClient,
|
|
16
|
+
type SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken,
|
|
17
|
+
type SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken,
|
|
18
|
+
} from 'lib/seam/connect/options.js'
|
|
19
|
+
import {
|
|
20
|
+
limitToSeamHttpRequestOptions,
|
|
21
|
+
parseOptions,
|
|
22
|
+
} from 'lib/seam/connect/parse-options.js'
|
|
23
|
+
|
|
24
|
+
import {
|
|
25
|
+
SeamHttpWorkspaces,
|
|
26
|
+
type WorkspacesCreateOptions,
|
|
27
|
+
type WorkspacesCreateParameters,
|
|
28
|
+
type WorkspacesCreateRequest,
|
|
29
|
+
type WorkspacesListOptions,
|
|
30
|
+
type WorkspacesListParameters,
|
|
31
|
+
type WorkspacesListRequest,
|
|
32
|
+
} from './workspaces/index.js'
|
|
33
|
+
|
|
34
|
+
export class SeamHttpEndpointsWithoutWorkspace {
|
|
35
|
+
client: Client
|
|
36
|
+
readonly defaults: Required<SeamHttpRequestOptions>
|
|
37
|
+
readonly ltsVersion = seamApiLtsVersion
|
|
38
|
+
static ltsVersion = seamApiLtsVersion
|
|
39
|
+
|
|
40
|
+
constructor(options: SeamHttpWithoutWorkspaceOptions = {}) {
|
|
41
|
+
const opts = parseOptions(options)
|
|
42
|
+
this.client = 'client' in opts ? opts.client : createClient(opts)
|
|
43
|
+
this.defaults = limitToSeamHttpRequestOptions(opts)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
static fromClient(
|
|
47
|
+
client: SeamHttpWithoutWorkspaceOptionsWithClient['client'],
|
|
48
|
+
options: Omit<SeamHttpWithoutWorkspaceOptionsWithClient, 'client'> = {},
|
|
49
|
+
): SeamHttpEndpointsWithoutWorkspace {
|
|
50
|
+
const constructorOptions = { ...options, client }
|
|
51
|
+
if (!isSeamHttpWithoutWorkspaceOptionsWithClient(constructorOptions)) {
|
|
52
|
+
throw new SeamHttpWithoutWorkspaceInvalidOptionsError('Missing client')
|
|
53
|
+
}
|
|
54
|
+
return new SeamHttpEndpointsWithoutWorkspace(constructorOptions)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
static fromConsoleSessionToken(
|
|
58
|
+
consoleSessionToken: SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken['consoleSessionToken'],
|
|
59
|
+
options: Omit<
|
|
60
|
+
SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken,
|
|
61
|
+
'consoleSessionToken'
|
|
62
|
+
> = {},
|
|
63
|
+
): SeamHttpEndpointsWithoutWorkspace {
|
|
64
|
+
const constructorOptions = { ...options, consoleSessionToken }
|
|
65
|
+
if (
|
|
66
|
+
!isSeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken(
|
|
67
|
+
constructorOptions,
|
|
68
|
+
)
|
|
69
|
+
) {
|
|
70
|
+
throw new SeamHttpWithoutWorkspaceInvalidOptionsError(
|
|
71
|
+
'Missing consoleSessionToken',
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
return new SeamHttpEndpointsWithoutWorkspace(constructorOptions)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
static fromPersonalAccessToken(
|
|
78
|
+
personalAccessToken: SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken['personalAccessToken'],
|
|
79
|
+
options: Omit<
|
|
80
|
+
SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken,
|
|
81
|
+
'personalAccessToken'
|
|
82
|
+
> = {},
|
|
83
|
+
): SeamHttpEndpointsWithoutWorkspace {
|
|
84
|
+
const constructorOptions = { ...options, personalAccessToken }
|
|
85
|
+
if (
|
|
86
|
+
!isSeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken(
|
|
87
|
+
constructorOptions,
|
|
88
|
+
)
|
|
89
|
+
) {
|
|
90
|
+
throw new SeamHttpWithoutWorkspaceInvalidOptionsError(
|
|
91
|
+
'Missing personalAccessToken',
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
return new SeamHttpEndpointsWithoutWorkspace(constructorOptions)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
get ['/workspaces/create'](): (
|
|
98
|
+
parameters?: WorkspacesCreateParameters,
|
|
99
|
+
options?: WorkspacesCreateOptions,
|
|
100
|
+
) => WorkspacesCreateRequest {
|
|
101
|
+
const { client, defaults } = this
|
|
102
|
+
return function workspacesCreate(
|
|
103
|
+
...args: Parameters<SeamHttpWorkspaces['create']>
|
|
104
|
+
): ReturnType<SeamHttpWorkspaces['create']> {
|
|
105
|
+
const seam = SeamHttpWorkspaces.fromClient(client, defaults)
|
|
106
|
+
return seam.create(...args)
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
get ['/workspaces/list'](): (
|
|
111
|
+
parameters?: WorkspacesListParameters,
|
|
112
|
+
options?: WorkspacesListOptions,
|
|
113
|
+
) => WorkspacesListRequest {
|
|
114
|
+
const { client, defaults } = this
|
|
115
|
+
return function workspacesList(
|
|
116
|
+
...args: Parameters<SeamHttpWorkspaces['list']>
|
|
117
|
+
): ReturnType<SeamHttpWorkspaces['list']> {
|
|
118
|
+
const seam = SeamHttpWorkspaces.fromClient(client, defaults)
|
|
119
|
+
return seam.list(...args)
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export type SeamHttpEndpointWithoutWorkspaceQueryPaths = '/workspaces/list'
|
|
125
|
+
|
|
126
|
+
export type SeamHttpEndpointWithoutWorkspaceMutationPaths = '/workspaces/create'
|
|
@@ -512,48 +512,6 @@ import {
|
|
|
512
512
|
type PhonesSimulateCreateSandboxPhoneRequest,
|
|
513
513
|
SeamHttpPhonesSimulate,
|
|
514
514
|
} from './phones/simulate/index.js'
|
|
515
|
-
import {
|
|
516
|
-
type SeamBridgeV1BridgeClientSessionsCreateOptions,
|
|
517
|
-
type SeamBridgeV1BridgeClientSessionsCreateParameters,
|
|
518
|
-
type SeamBridgeV1BridgeClientSessionsCreateRequest,
|
|
519
|
-
type SeamBridgeV1BridgeClientSessionsGetOptions,
|
|
520
|
-
type SeamBridgeV1BridgeClientSessionsGetParameters,
|
|
521
|
-
type SeamBridgeV1BridgeClientSessionsGetRequest,
|
|
522
|
-
type SeamBridgeV1BridgeClientSessionsRefreshTelemetryTokenOptions,
|
|
523
|
-
type SeamBridgeV1BridgeClientSessionsRefreshTelemetryTokenParameters,
|
|
524
|
-
type SeamBridgeV1BridgeClientSessionsRefreshTelemetryTokenRequest,
|
|
525
|
-
type SeamBridgeV1BridgeClientSessionsRegeneratePairingCodeOptions,
|
|
526
|
-
type SeamBridgeV1BridgeClientSessionsRegeneratePairingCodeParameters,
|
|
527
|
-
type SeamBridgeV1BridgeClientSessionsRegeneratePairingCodeRequest,
|
|
528
|
-
type SeamBridgeV1BridgeClientSessionsReportStatusOptions,
|
|
529
|
-
type SeamBridgeV1BridgeClientSessionsReportStatusParameters,
|
|
530
|
-
type SeamBridgeV1BridgeClientSessionsReportStatusRequest,
|
|
531
|
-
SeamHttpSeamBridgeV1BridgeClientSessions,
|
|
532
|
-
} from './seam/bridge/v1/bridge-client-sessions/index.js'
|
|
533
|
-
import {
|
|
534
|
-
type SeamBridgeV1BridgeConnectedSystemsListOptions,
|
|
535
|
-
type SeamBridgeV1BridgeConnectedSystemsListParameters,
|
|
536
|
-
type SeamBridgeV1BridgeConnectedSystemsListRequest,
|
|
537
|
-
SeamHttpSeamBridgeV1BridgeConnectedSystems,
|
|
538
|
-
} from './seam/bridge/v1/bridge-connected-systems/index.js'
|
|
539
|
-
import {
|
|
540
|
-
SeamHttpSeamInstantKeyV1ClientSessions,
|
|
541
|
-
type SeamInstantKeyV1ClientSessionsExchangeShortCodeOptions,
|
|
542
|
-
type SeamInstantKeyV1ClientSessionsExchangeShortCodeParameters,
|
|
543
|
-
type SeamInstantKeyV1ClientSessionsExchangeShortCodeRequest,
|
|
544
|
-
} from './seam/instant-key/v1/client-sessions/index.js'
|
|
545
|
-
import {
|
|
546
|
-
SeamHttpSeamMobileSdkV1AcsCredentials,
|
|
547
|
-
type SeamMobileSdkV1AcsCredentialsListOptions,
|
|
548
|
-
type SeamMobileSdkV1AcsCredentialsListParameters,
|
|
549
|
-
type SeamMobileSdkV1AcsCredentialsListRequest,
|
|
550
|
-
} from './seam/mobile-sdk/v1/acs/credentials/index.js'
|
|
551
|
-
import {
|
|
552
|
-
SeamHttpSeamMobileSdkV1PhoneSessions,
|
|
553
|
-
type SeamMobileSdkV1PhoneSessionsGetOrCreateOptions,
|
|
554
|
-
type SeamMobileSdkV1PhoneSessionsGetOrCreateParameters,
|
|
555
|
-
type SeamMobileSdkV1PhoneSessionsGetOrCreateRequest,
|
|
556
|
-
} from './seam/mobile-sdk/v1/phone-sessions/index.js'
|
|
557
515
|
import {
|
|
558
516
|
SeamHttpSeamPartnerV1BuildingBlocksSpaces,
|
|
559
517
|
type SeamPartnerV1BuildingBlocksSpacesAutoMapOptions,
|
|
@@ -2738,207 +2696,6 @@ export class SeamHttpEndpoints {
|
|
|
2738
2696
|
}
|
|
2739
2697
|
}
|
|
2740
2698
|
|
|
2741
|
-
get ['/seam/bridge/v1/bridge_client_sessions/create'](): (
|
|
2742
|
-
parameters?: SeamBridgeV1BridgeClientSessionsCreateParameters,
|
|
2743
|
-
options?: SeamBridgeV1BridgeClientSessionsCreateOptions,
|
|
2744
|
-
) => SeamBridgeV1BridgeClientSessionsCreateRequest {
|
|
2745
|
-
const { client, defaults } = this
|
|
2746
|
-
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
2747
|
-
throw new Error(
|
|
2748
|
-
'Cannot use undocumented API without isUndocumentedApiEnabled',
|
|
2749
|
-
)
|
|
2750
|
-
}
|
|
2751
|
-
return function seamBridgeV1BridgeClientSessionsCreate(
|
|
2752
|
-
...args: Parameters<SeamHttpSeamBridgeV1BridgeClientSessions['create']>
|
|
2753
|
-
): ReturnType<SeamHttpSeamBridgeV1BridgeClientSessions['create']> {
|
|
2754
|
-
const seam = SeamHttpSeamBridgeV1BridgeClientSessions.fromClient(
|
|
2755
|
-
client,
|
|
2756
|
-
defaults,
|
|
2757
|
-
)
|
|
2758
|
-
return seam.create(...args)
|
|
2759
|
-
}
|
|
2760
|
-
}
|
|
2761
|
-
|
|
2762
|
-
get ['/seam/bridge/v1/bridge_client_sessions/get'](): (
|
|
2763
|
-
parameters?: SeamBridgeV1BridgeClientSessionsGetParameters,
|
|
2764
|
-
options?: SeamBridgeV1BridgeClientSessionsGetOptions,
|
|
2765
|
-
) => SeamBridgeV1BridgeClientSessionsGetRequest {
|
|
2766
|
-
const { client, defaults } = this
|
|
2767
|
-
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
2768
|
-
throw new Error(
|
|
2769
|
-
'Cannot use undocumented API without isUndocumentedApiEnabled',
|
|
2770
|
-
)
|
|
2771
|
-
}
|
|
2772
|
-
return function seamBridgeV1BridgeClientSessionsGet(
|
|
2773
|
-
...args: Parameters<SeamHttpSeamBridgeV1BridgeClientSessions['get']>
|
|
2774
|
-
): ReturnType<SeamHttpSeamBridgeV1BridgeClientSessions['get']> {
|
|
2775
|
-
const seam = SeamHttpSeamBridgeV1BridgeClientSessions.fromClient(
|
|
2776
|
-
client,
|
|
2777
|
-
defaults,
|
|
2778
|
-
)
|
|
2779
|
-
return seam.get(...args)
|
|
2780
|
-
}
|
|
2781
|
-
}
|
|
2782
|
-
|
|
2783
|
-
get ['/seam/bridge/v1/bridge_client_sessions/refresh_telemetry_token'](): (
|
|
2784
|
-
parameters?: SeamBridgeV1BridgeClientSessionsRefreshTelemetryTokenParameters,
|
|
2785
|
-
options?: SeamBridgeV1BridgeClientSessionsRefreshTelemetryTokenOptions,
|
|
2786
|
-
) => SeamBridgeV1BridgeClientSessionsRefreshTelemetryTokenRequest {
|
|
2787
|
-
const { client, defaults } = this
|
|
2788
|
-
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
2789
|
-
throw new Error(
|
|
2790
|
-
'Cannot use undocumented API without isUndocumentedApiEnabled',
|
|
2791
|
-
)
|
|
2792
|
-
}
|
|
2793
|
-
return function seamBridgeV1BridgeClientSessionsRefreshTelemetryToken(
|
|
2794
|
-
...args: Parameters<
|
|
2795
|
-
SeamHttpSeamBridgeV1BridgeClientSessions['refreshTelemetryToken']
|
|
2796
|
-
>
|
|
2797
|
-
): ReturnType<
|
|
2798
|
-
SeamHttpSeamBridgeV1BridgeClientSessions['refreshTelemetryToken']
|
|
2799
|
-
> {
|
|
2800
|
-
const seam = SeamHttpSeamBridgeV1BridgeClientSessions.fromClient(
|
|
2801
|
-
client,
|
|
2802
|
-
defaults,
|
|
2803
|
-
)
|
|
2804
|
-
return seam.refreshTelemetryToken(...args)
|
|
2805
|
-
}
|
|
2806
|
-
}
|
|
2807
|
-
|
|
2808
|
-
get ['/seam/bridge/v1/bridge_client_sessions/regenerate_pairing_code'](): (
|
|
2809
|
-
parameters?: SeamBridgeV1BridgeClientSessionsRegeneratePairingCodeParameters,
|
|
2810
|
-
options?: SeamBridgeV1BridgeClientSessionsRegeneratePairingCodeOptions,
|
|
2811
|
-
) => SeamBridgeV1BridgeClientSessionsRegeneratePairingCodeRequest {
|
|
2812
|
-
const { client, defaults } = this
|
|
2813
|
-
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
2814
|
-
throw new Error(
|
|
2815
|
-
'Cannot use undocumented API without isUndocumentedApiEnabled',
|
|
2816
|
-
)
|
|
2817
|
-
}
|
|
2818
|
-
return function seamBridgeV1BridgeClientSessionsRegeneratePairingCode(
|
|
2819
|
-
...args: Parameters<
|
|
2820
|
-
SeamHttpSeamBridgeV1BridgeClientSessions['regeneratePairingCode']
|
|
2821
|
-
>
|
|
2822
|
-
): ReturnType<
|
|
2823
|
-
SeamHttpSeamBridgeV1BridgeClientSessions['regeneratePairingCode']
|
|
2824
|
-
> {
|
|
2825
|
-
const seam = SeamHttpSeamBridgeV1BridgeClientSessions.fromClient(
|
|
2826
|
-
client,
|
|
2827
|
-
defaults,
|
|
2828
|
-
)
|
|
2829
|
-
return seam.regeneratePairingCode(...args)
|
|
2830
|
-
}
|
|
2831
|
-
}
|
|
2832
|
-
|
|
2833
|
-
get ['/seam/bridge/v1/bridge_client_sessions/report_status'](): (
|
|
2834
|
-
parameters?: SeamBridgeV1BridgeClientSessionsReportStatusParameters,
|
|
2835
|
-
options?: SeamBridgeV1BridgeClientSessionsReportStatusOptions,
|
|
2836
|
-
) => SeamBridgeV1BridgeClientSessionsReportStatusRequest {
|
|
2837
|
-
const { client, defaults } = this
|
|
2838
|
-
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
2839
|
-
throw new Error(
|
|
2840
|
-
'Cannot use undocumented API without isUndocumentedApiEnabled',
|
|
2841
|
-
)
|
|
2842
|
-
}
|
|
2843
|
-
return function seamBridgeV1BridgeClientSessionsReportStatus(
|
|
2844
|
-
...args: Parameters<
|
|
2845
|
-
SeamHttpSeamBridgeV1BridgeClientSessions['reportStatus']
|
|
2846
|
-
>
|
|
2847
|
-
): ReturnType<SeamHttpSeamBridgeV1BridgeClientSessions['reportStatus']> {
|
|
2848
|
-
const seam = SeamHttpSeamBridgeV1BridgeClientSessions.fromClient(
|
|
2849
|
-
client,
|
|
2850
|
-
defaults,
|
|
2851
|
-
)
|
|
2852
|
-
return seam.reportStatus(...args)
|
|
2853
|
-
}
|
|
2854
|
-
}
|
|
2855
|
-
|
|
2856
|
-
get ['/seam/bridge/v1/bridge_connected_systems/list'](): (
|
|
2857
|
-
parameters?: SeamBridgeV1BridgeConnectedSystemsListParameters,
|
|
2858
|
-
options?: SeamBridgeV1BridgeConnectedSystemsListOptions,
|
|
2859
|
-
) => SeamBridgeV1BridgeConnectedSystemsListRequest {
|
|
2860
|
-
const { client, defaults } = this
|
|
2861
|
-
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
2862
|
-
throw new Error(
|
|
2863
|
-
'Cannot use undocumented API without isUndocumentedApiEnabled',
|
|
2864
|
-
)
|
|
2865
|
-
}
|
|
2866
|
-
return function seamBridgeV1BridgeConnectedSystemsList(
|
|
2867
|
-
...args: Parameters<SeamHttpSeamBridgeV1BridgeConnectedSystems['list']>
|
|
2868
|
-
): ReturnType<SeamHttpSeamBridgeV1BridgeConnectedSystems['list']> {
|
|
2869
|
-
const seam = SeamHttpSeamBridgeV1BridgeConnectedSystems.fromClient(
|
|
2870
|
-
client,
|
|
2871
|
-
defaults,
|
|
2872
|
-
)
|
|
2873
|
-
return seam.list(...args)
|
|
2874
|
-
}
|
|
2875
|
-
}
|
|
2876
|
-
|
|
2877
|
-
get ['/seam/instant_key/v1/client_sessions/exchange_short_code'](): (
|
|
2878
|
-
parameters?: SeamInstantKeyV1ClientSessionsExchangeShortCodeParameters,
|
|
2879
|
-
options?: SeamInstantKeyV1ClientSessionsExchangeShortCodeOptions,
|
|
2880
|
-
) => SeamInstantKeyV1ClientSessionsExchangeShortCodeRequest {
|
|
2881
|
-
const { client, defaults } = this
|
|
2882
|
-
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
2883
|
-
throw new Error(
|
|
2884
|
-
'Cannot use undocumented API without isUndocumentedApiEnabled',
|
|
2885
|
-
)
|
|
2886
|
-
}
|
|
2887
|
-
return function seamInstantKeyV1ClientSessionsExchangeShortCode(
|
|
2888
|
-
...args: Parameters<
|
|
2889
|
-
SeamHttpSeamInstantKeyV1ClientSessions['exchangeShortCode']
|
|
2890
|
-
>
|
|
2891
|
-
): ReturnType<SeamHttpSeamInstantKeyV1ClientSessions['exchangeShortCode']> {
|
|
2892
|
-
const seam = SeamHttpSeamInstantKeyV1ClientSessions.fromClient(
|
|
2893
|
-
client,
|
|
2894
|
-
defaults,
|
|
2895
|
-
)
|
|
2896
|
-
return seam.exchangeShortCode(...args)
|
|
2897
|
-
}
|
|
2898
|
-
}
|
|
2899
|
-
|
|
2900
|
-
get ['/seam/mobile_sdk/v1/acs/credentials/list'](): (
|
|
2901
|
-
parameters?: SeamMobileSdkV1AcsCredentialsListParameters,
|
|
2902
|
-
options?: SeamMobileSdkV1AcsCredentialsListOptions,
|
|
2903
|
-
) => SeamMobileSdkV1AcsCredentialsListRequest {
|
|
2904
|
-
const { client, defaults } = this
|
|
2905
|
-
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
2906
|
-
throw new Error(
|
|
2907
|
-
'Cannot use undocumented API without isUndocumentedApiEnabled',
|
|
2908
|
-
)
|
|
2909
|
-
}
|
|
2910
|
-
return function seamMobileSdkV1AcsCredentialsList(
|
|
2911
|
-
...args: Parameters<SeamHttpSeamMobileSdkV1AcsCredentials['list']>
|
|
2912
|
-
): ReturnType<SeamHttpSeamMobileSdkV1AcsCredentials['list']> {
|
|
2913
|
-
const seam = SeamHttpSeamMobileSdkV1AcsCredentials.fromClient(
|
|
2914
|
-
client,
|
|
2915
|
-
defaults,
|
|
2916
|
-
)
|
|
2917
|
-
return seam.list(...args)
|
|
2918
|
-
}
|
|
2919
|
-
}
|
|
2920
|
-
|
|
2921
|
-
get ['/seam/mobile_sdk/v1/phone_sessions/get_or_create'](): (
|
|
2922
|
-
parameters?: SeamMobileSdkV1PhoneSessionsGetOrCreateParameters,
|
|
2923
|
-
options?: SeamMobileSdkV1PhoneSessionsGetOrCreateOptions,
|
|
2924
|
-
) => SeamMobileSdkV1PhoneSessionsGetOrCreateRequest {
|
|
2925
|
-
const { client, defaults } = this
|
|
2926
|
-
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
2927
|
-
throw new Error(
|
|
2928
|
-
'Cannot use undocumented API without isUndocumentedApiEnabled',
|
|
2929
|
-
)
|
|
2930
|
-
}
|
|
2931
|
-
return function seamMobileSdkV1PhoneSessionsGetOrCreate(
|
|
2932
|
-
...args: Parameters<SeamHttpSeamMobileSdkV1PhoneSessions['getOrCreate']>
|
|
2933
|
-
): ReturnType<SeamHttpSeamMobileSdkV1PhoneSessions['getOrCreate']> {
|
|
2934
|
-
const seam = SeamHttpSeamMobileSdkV1PhoneSessions.fromClient(
|
|
2935
|
-
client,
|
|
2936
|
-
defaults,
|
|
2937
|
-
)
|
|
2938
|
-
return seam.getOrCreate(...args)
|
|
2939
|
-
}
|
|
2940
|
-
}
|
|
2941
|
-
|
|
2942
2699
|
get ['/seam/partner/v1/building_blocks/spaces/auto_map'](): (
|
|
2943
2700
|
parameters?: SeamPartnerV1BuildingBlocksSpacesAutoMapParameters,
|
|
2944
2701
|
options?: SeamPartnerV1BuildingBlocksSpacesAutoMapOptions,
|
|
@@ -4251,9 +4008,6 @@ export type SeamHttpEndpointQueryPaths =
|
|
|
4251
4008
|
| '/phones/get'
|
|
4252
4009
|
| '/phones/list'
|
|
4253
4010
|
| '/phones/simulate/create_sandbox_phone'
|
|
4254
|
-
| '/seam/bridge/v1/bridge_client_sessions/get'
|
|
4255
|
-
| '/seam/bridge/v1/bridge_connected_systems/list'
|
|
4256
|
-
| '/seam/mobile_sdk/v1/acs/credentials/list'
|
|
4257
4011
|
| '/seam/partner/v1/building_blocks/spaces/auto_map'
|
|
4258
4012
|
| '/seam/partner/v1/resources/list'
|
|
4259
4013
|
| '/spaces/get'
|
|
@@ -4354,12 +4108,6 @@ export type SeamHttpEndpointMutationPaths =
|
|
|
4354
4108
|
| '/noise_sensors/noise_thresholds/update'
|
|
4355
4109
|
| '/noise_sensors/simulate/trigger_noise_threshold'
|
|
4356
4110
|
| '/phones/deactivate'
|
|
4357
|
-
| '/seam/bridge/v1/bridge_client_sessions/create'
|
|
4358
|
-
| '/seam/bridge/v1/bridge_client_sessions/refresh_telemetry_token'
|
|
4359
|
-
| '/seam/bridge/v1/bridge_client_sessions/regenerate_pairing_code'
|
|
4360
|
-
| '/seam/bridge/v1/bridge_client_sessions/report_status'
|
|
4361
|
-
| '/seam/instant_key/v1/client_sessions/exchange_short_code'
|
|
4362
|
-
| '/seam/mobile_sdk/v1/phone_sessions/get_or_create'
|
|
4363
4111
|
| '/spaces/add_acs_entrances'
|
|
4364
4112
|
| '/spaces/add_devices'
|
|
4365
4113
|
| '/spaces/create'
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Automatically generated by codegen/smith.ts.
|
|
3
|
+
* Do not edit this file or add other files to this directory.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { seamApiLtsVersion } from 'lib/lts-version.js'
|
|
7
|
+
import { type Client, createClient } from 'lib/seam/connect/client.js'
|
|
8
|
+
import {
|
|
9
|
+
isSeamHttpWithoutWorkspaceOptionsWithClient,
|
|
10
|
+
isSeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken,
|
|
11
|
+
isSeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken,
|
|
12
|
+
type SeamHttpRequestOptions,
|
|
13
|
+
SeamHttpWithoutWorkspaceInvalidOptionsError,
|
|
14
|
+
type SeamHttpWithoutWorkspaceOptions,
|
|
15
|
+
type SeamHttpWithoutWorkspaceOptionsWithClient,
|
|
16
|
+
type SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken,
|
|
17
|
+
type SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken,
|
|
18
|
+
} from 'lib/seam/connect/options.js'
|
|
19
|
+
import {
|
|
20
|
+
limitToSeamHttpRequestOptions,
|
|
21
|
+
parseOptions,
|
|
22
|
+
} from 'lib/seam/connect/parse-options.js'
|
|
23
|
+
import { SeamHttpWorkspaces } from 'lib/seam/connect/routes/workspaces/index.js'
|
|
24
|
+
|
|
25
|
+
export class SeamHttpWithoutWorkspace {
|
|
26
|
+
client: Client
|
|
27
|
+
readonly defaults: Required<SeamHttpRequestOptions>
|
|
28
|
+
readonly ltsVersion = seamApiLtsVersion
|
|
29
|
+
static ltsVersion = seamApiLtsVersion
|
|
30
|
+
|
|
31
|
+
constructor(options: SeamHttpWithoutWorkspaceOptions = {}) {
|
|
32
|
+
const opts = parseOptions(options)
|
|
33
|
+
this.client = 'client' in opts ? opts.client : createClient(opts)
|
|
34
|
+
this.defaults = limitToSeamHttpRequestOptions(opts)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
static fromClient(
|
|
38
|
+
client: SeamHttpWithoutWorkspaceOptionsWithClient['client'],
|
|
39
|
+
options: Omit<SeamHttpWithoutWorkspaceOptionsWithClient, 'client'> = {},
|
|
40
|
+
): SeamHttpWithoutWorkspace {
|
|
41
|
+
const constructorOptions = { ...options, client }
|
|
42
|
+
if (!isSeamHttpWithoutWorkspaceOptionsWithClient(constructorOptions)) {
|
|
43
|
+
throw new SeamHttpWithoutWorkspaceInvalidOptionsError('Missing client')
|
|
44
|
+
}
|
|
45
|
+
return new SeamHttpWithoutWorkspace(constructorOptions)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
static fromConsoleSessionToken(
|
|
49
|
+
consoleSessionToken: SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken['consoleSessionToken'],
|
|
50
|
+
options: Omit<
|
|
51
|
+
SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken,
|
|
52
|
+
'consoleSessionToken'
|
|
53
|
+
> = {},
|
|
54
|
+
): SeamHttpWithoutWorkspace {
|
|
55
|
+
const constructorOptions = { ...options, consoleSessionToken }
|
|
56
|
+
if (
|
|
57
|
+
!isSeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken(
|
|
58
|
+
constructorOptions,
|
|
59
|
+
)
|
|
60
|
+
) {
|
|
61
|
+
throw new SeamHttpWithoutWorkspaceInvalidOptionsError(
|
|
62
|
+
'Missing consoleSessionToken',
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
return new SeamHttpWithoutWorkspace(constructorOptions)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
static fromPersonalAccessToken(
|
|
69
|
+
personalAccessToken: SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken['personalAccessToken'],
|
|
70
|
+
options: Omit<
|
|
71
|
+
SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken,
|
|
72
|
+
'personalAccessToken'
|
|
73
|
+
> = {},
|
|
74
|
+
): SeamHttpWithoutWorkspace {
|
|
75
|
+
const constructorOptions = { ...options, personalAccessToken }
|
|
76
|
+
if (
|
|
77
|
+
!isSeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken(
|
|
78
|
+
constructorOptions,
|
|
79
|
+
)
|
|
80
|
+
) {
|
|
81
|
+
throw new SeamHttpWithoutWorkspaceInvalidOptionsError(
|
|
82
|
+
'Missing personalAccessToken',
|
|
83
|
+
)
|
|
84
|
+
}
|
|
85
|
+
return new SeamHttpWithoutWorkspace(constructorOptions)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
get workspaces(): Pick<SeamHttpWorkspaces, 'create' | 'list'> {
|
|
89
|
+
return SeamHttpWorkspaces.fromClient(this.client, this.defaults)
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* @deprecated Use SeamHttpWithoutWorkspace instead.
|
|
95
|
+
*/
|
|
96
|
+
export const SeamHttpMultiWorkspace = SeamHttpWithoutWorkspace
|
package/src/lib/version.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './v1/index.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/lib/seam/connect/routes/seam/bridge/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,eAAe,CAAA"}
|