@seamapi/http 0.8.1 → 0.9.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 +14 -1
- package/dist/connect.cjs +314 -141
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +89 -75
- package/lib/seam/connect/client.d.ts +0 -1
- package/lib/seam/connect/client.js +0 -2
- package/lib/seam/connect/client.js.map +1 -1
- package/lib/seam/connect/options.d.ts +7 -3
- package/lib/seam/connect/options.js +2 -1
- package/lib/seam/connect/options.js.map +1 -1
- package/lib/seam/connect/parse-options.d.ts +9 -3
- package/lib/seam/connect/parse-options.js +25 -2
- package/lib/seam/connect/parse-options.js.map +1 -1
- package/lib/seam/connect/routes/access-codes-unmanaged.d.ts +2 -1
- package/lib/seam/connect/routes/access-codes-unmanaged.js +7 -3
- package/lib/seam/connect/routes/access-codes-unmanaged.js.map +1 -1
- package/lib/seam/connect/routes/access-codes.d.ts +2 -1
- package/lib/seam/connect/routes/access-codes.js +8 -4
- package/lib/seam/connect/routes/access-codes.js.map +1 -1
- package/lib/seam/connect/routes/acs-access-groups.d.ts +2 -1
- package/lib/seam/connect/routes/acs-access-groups.js +7 -3
- package/lib/seam/connect/routes/acs-access-groups.js.map +1 -1
- package/lib/seam/connect/routes/acs-credentials.d.ts +2 -1
- package/lib/seam/connect/routes/acs-credentials.js +7 -3
- package/lib/seam/connect/routes/acs-credentials.js.map +1 -1
- package/lib/seam/connect/routes/acs-systems.d.ts +2 -1
- package/lib/seam/connect/routes/acs-systems.js +7 -3
- package/lib/seam/connect/routes/acs-systems.js.map +1 -1
- package/lib/seam/connect/routes/acs-users.d.ts +2 -1
- package/lib/seam/connect/routes/acs-users.js +7 -3
- package/lib/seam/connect/routes/acs-users.js.map +1 -1
- package/lib/seam/connect/routes/acs.d.ts +2 -1
- package/lib/seam/connect/routes/acs.js +11 -7
- package/lib/seam/connect/routes/acs.js.map +1 -1
- package/lib/seam/connect/routes/action-attempts.d.ts +4 -8
- package/lib/seam/connect/routes/action-attempts.js +15 -7
- package/lib/seam/connect/routes/action-attempts.js.map +1 -1
- package/lib/seam/connect/routes/client-sessions.d.ts +2 -1
- package/lib/seam/connect/routes/client-sessions.js +7 -3
- package/lib/seam/connect/routes/client-sessions.js.map +1 -1
- package/lib/seam/connect/routes/connect-webviews.d.ts +2 -1
- package/lib/seam/connect/routes/connect-webviews.js +7 -3
- package/lib/seam/connect/routes/connect-webviews.js.map +1 -1
- package/lib/seam/connect/routes/connected-accounts.d.ts +2 -1
- package/lib/seam/connect/routes/connected-accounts.js +7 -3
- package/lib/seam/connect/routes/connected-accounts.js.map +1 -1
- package/lib/seam/connect/routes/devices-unmanaged.d.ts +2 -1
- package/lib/seam/connect/routes/devices-unmanaged.js +7 -3
- package/lib/seam/connect/routes/devices-unmanaged.js.map +1 -1
- package/lib/seam/connect/routes/devices.d.ts +2 -1
- package/lib/seam/connect/routes/devices.js +8 -4
- package/lib/seam/connect/routes/devices.js.map +1 -1
- package/lib/seam/connect/routes/events.d.ts +2 -1
- package/lib/seam/connect/routes/events.js +7 -3
- package/lib/seam/connect/routes/events.js.map +1 -1
- package/lib/seam/connect/routes/locks.d.ts +6 -14
- package/lib/seam/connect/routes/locks.js +22 -10
- package/lib/seam/connect/routes/locks.js.map +1 -1
- package/lib/seam/connect/routes/noise-sensors-noise-thresholds.d.ts +2 -1
- package/lib/seam/connect/routes/noise-sensors-noise-thresholds.js +7 -3
- package/lib/seam/connect/routes/noise-sensors-noise-thresholds.js.map +1 -1
- package/lib/seam/connect/routes/noise-sensors.d.ts +2 -1
- package/lib/seam/connect/routes/noise-sensors.js +8 -4
- package/lib/seam/connect/routes/noise-sensors.js.map +1 -1
- package/lib/seam/connect/routes/thermostats-climate-setting-schedules.d.ts +2 -1
- package/lib/seam/connect/routes/thermostats-climate-setting-schedules.js +7 -3
- package/lib/seam/connect/routes/thermostats-climate-setting-schedules.js.map +1 -1
- package/lib/seam/connect/routes/thermostats.d.ts +2 -1
- package/lib/seam/connect/routes/thermostats.js +8 -4
- package/lib/seam/connect/routes/thermostats.js.map +1 -1
- package/lib/seam/connect/routes/user-identities.d.ts +2 -1
- package/lib/seam/connect/routes/user-identities.js +7 -3
- package/lib/seam/connect/routes/user-identities.js.map +1 -1
- package/lib/seam/connect/routes/webhooks.d.ts +2 -1
- package/lib/seam/connect/routes/webhooks.js +7 -3
- package/lib/seam/connect/routes/webhooks.js.map +1 -1
- package/lib/seam/connect/routes/workspaces.d.ts +2 -1
- package/lib/seam/connect/routes/workspaces.js +7 -3
- package/lib/seam/connect/routes/workspaces.js.map +1 -1
- package/lib/seam/connect/seam-http-multi-workspace.d.ts +2 -1
- package/lib/seam/connect/seam-http-multi-workspace.js +5 -4
- package/lib/seam/connect/seam-http-multi-workspace.js.map +1 -1
- package/lib/seam/connect/seam-http.d.ts +2 -1
- package/lib/seam/connect/seam-http.js +21 -17
- package/lib/seam/connect/seam-http.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/src/lib/seam/connect/client.ts +0 -3
- package/src/lib/seam/connect/options.ts +11 -4
- package/src/lib/seam/connect/parse-options.ts +43 -4
- package/src/lib/seam/connect/routes/access-codes-unmanaged.ts +14 -3
- package/src/lib/seam/connect/routes/access-codes.ts +15 -4
- package/src/lib/seam/connect/routes/acs-access-groups.ts +14 -3
- package/src/lib/seam/connect/routes/acs-credentials.ts +14 -3
- package/src/lib/seam/connect/routes/acs-systems.ts +14 -3
- package/src/lib/seam/connect/routes/acs-users.ts +14 -3
- package/src/lib/seam/connect/routes/acs.ts +18 -7
- package/src/lib/seam/connect/routes/action-attempts.ts +26 -16
- package/src/lib/seam/connect/routes/client-sessions.ts +14 -3
- package/src/lib/seam/connect/routes/connect-webviews.ts +14 -3
- package/src/lib/seam/connect/routes/connected-accounts.ts +14 -3
- package/src/lib/seam/connect/routes/devices-unmanaged.ts +14 -3
- package/src/lib/seam/connect/routes/devices.ts +15 -4
- package/src/lib/seam/connect/routes/events.ts +14 -3
- package/src/lib/seam/connect/routes/locks.ts +38 -26
- package/src/lib/seam/connect/routes/noise-sensors-noise-thresholds.ts +14 -3
- package/src/lib/seam/connect/routes/noise-sensors.ts +18 -4
- package/src/lib/seam/connect/routes/thermostats-climate-setting-schedules.ts +14 -3
- package/src/lib/seam/connect/routes/thermostats.ts +18 -4
- package/src/lib/seam/connect/routes/user-identities.ts +14 -3
- package/src/lib/seam/connect/routes/webhooks.ts +14 -3
- package/src/lib/seam/connect/routes/workspaces.ts +14 -3
- package/src/lib/seam/connect/seam-http-multi-workspace.ts +7 -4
- package/src/lib/seam/connect/seam-http.ts +25 -17
- package/src/lib/version.ts +1 -1
package/dist/connect.d.cts
CHANGED
|
@@ -7,65 +7,9 @@ type Client = AxiosInstance;
|
|
|
7
7
|
interface ClientOptions {
|
|
8
8
|
axiosOptions?: AxiosRequestConfig;
|
|
9
9
|
axiosRetryOptions?: AxiosRetryConfig;
|
|
10
|
-
client?: Client;
|
|
11
10
|
}
|
|
12
11
|
type AxiosRetryConfig = Parameters<AxiosRetry>[1];
|
|
13
12
|
|
|
14
|
-
type SeamHttpMultiWorkspaceOptions = SeamHttpMultiWorkspaceOptionsWithClient | SeamHttpMultiWorkspaceOptionsWithConsoleSessionToken | SeamHttpMultiWorkspaceOptionsWithPersonalAccessToken;
|
|
15
|
-
type SeamHttpOptions = SeamHttpOptionsFromEnv | SeamHttpOptionsWithClient | SeamHttpOptionsWithApiKey | SeamHttpOptionsWithClientSessionToken | SeamHttpOptionsWithConsoleSessionToken | SeamHttpOptionsWithPersonalAccessToken;
|
|
16
|
-
interface SeamHttpCommonOptions extends ClientOptions {
|
|
17
|
-
endpoint?: string;
|
|
18
|
-
}
|
|
19
|
-
interface SeamHttpFromPublishableKeyOptions extends SeamHttpCommonOptions {
|
|
20
|
-
}
|
|
21
|
-
interface SeamHttpOptionsFromEnv extends SeamHttpCommonOptions {
|
|
22
|
-
}
|
|
23
|
-
interface SeamHttpMultiWorkspaceOptionsWithClient {
|
|
24
|
-
client: Client;
|
|
25
|
-
}
|
|
26
|
-
declare const isSeamHttpMultiWorkspaceOptionsWithClient: (options: SeamHttpOptions) => options is SeamHttpMultiWorkspaceOptionsWithClient;
|
|
27
|
-
interface SeamHttpOptionsWithClient {
|
|
28
|
-
client: Client;
|
|
29
|
-
}
|
|
30
|
-
declare const isSeamHttpOptionsWithClient: (options: SeamHttpOptions) => options is SeamHttpOptionsWithClient;
|
|
31
|
-
interface SeamHttpOptionsWithApiKey extends SeamHttpCommonOptions {
|
|
32
|
-
apiKey: string;
|
|
33
|
-
}
|
|
34
|
-
declare const isSeamHttpOptionsWithApiKey: (options: SeamHttpOptions) => options is SeamHttpOptionsWithApiKey;
|
|
35
|
-
interface SeamHttpOptionsWithClientSessionToken extends SeamHttpCommonOptions {
|
|
36
|
-
clientSessionToken: string;
|
|
37
|
-
}
|
|
38
|
-
declare const isSeamHttpOptionsWithClientSessionToken: (options: SeamHttpOptions) => options is SeamHttpOptionsWithClientSessionToken;
|
|
39
|
-
interface SeamHttpMultiWorkspaceOptionsWithConsoleSessionToken extends SeamHttpCommonOptions {
|
|
40
|
-
consoleSessionToken: string;
|
|
41
|
-
}
|
|
42
|
-
declare const isSeamHttpMultiWorkspaceOptionsWithConsoleSessionToken: (options: SeamHttpOptions) => options is SeamHttpMultiWorkspaceOptionsWithConsoleSessionToken;
|
|
43
|
-
interface SeamHttpOptionsWithConsoleSessionToken extends SeamHttpCommonOptions {
|
|
44
|
-
consoleSessionToken: string;
|
|
45
|
-
workspaceId: string;
|
|
46
|
-
}
|
|
47
|
-
declare const isSeamHttpOptionsWithConsoleSessionToken: (options: SeamHttpOptions) => options is SeamHttpOptionsWithConsoleSessionToken;
|
|
48
|
-
interface SeamHttpMultiWorkspaceOptionsWithPersonalAccessToken extends SeamHttpCommonOptions {
|
|
49
|
-
personalAccessToken: string;
|
|
50
|
-
}
|
|
51
|
-
declare const isSeamHttpMultiWorkspaceOptionsWithPersonalAccessToken: (options: SeamHttpOptions) => options is SeamHttpMultiWorkspaceOptionsWithPersonalAccessToken;
|
|
52
|
-
interface SeamHttpOptionsWithPersonalAccessToken extends SeamHttpCommonOptions {
|
|
53
|
-
personalAccessToken: string;
|
|
54
|
-
workspaceId: string;
|
|
55
|
-
}
|
|
56
|
-
declare const isSeamHttpOptionsWithPersonalAccessToken: (options: SeamHttpOptions) => options is SeamHttpOptionsWithPersonalAccessToken;
|
|
57
|
-
declare class SeamHttpInvalidOptionsError extends Error {
|
|
58
|
-
constructor(message: string);
|
|
59
|
-
}
|
|
60
|
-
declare class SeamHttpMultiWorkspaceInvalidOptionsError extends SeamHttpInvalidOptionsError {
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
declare class SeamHttpInvalidTokenError extends Error {
|
|
64
|
-
constructor(message: string);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
declare const errorInterceptor: (err: unknown) => Promise<void>;
|
|
68
|
-
|
|
69
13
|
interface ActionAttempt {
|
|
70
14
|
action_attempt_id: string;
|
|
71
15
|
status: 'pending' | 'error' | 'success';
|
|
@@ -80,6 +24,7 @@ type FailedActionAttempt<T extends ActionAttempt> = T & {
|
|
|
80
24
|
|
|
81
25
|
declare class SeamHttpAccessCodesUnmanaged {
|
|
82
26
|
client: Client;
|
|
27
|
+
readonly defaults: Required<SeamHttpRequestOptions>;
|
|
83
28
|
constructor(apiKeyOrOptions?: string | SeamHttpOptions);
|
|
84
29
|
static fromClient(client: SeamHttpOptionsWithClient['client'], options?: Omit<SeamHttpOptionsWithClient, 'client'>): SeamHttpAccessCodesUnmanaged;
|
|
85
30
|
static fromApiKey(apiKey: SeamHttpOptionsWithApiKey['apiKey'], options?: Omit<SeamHttpOptionsWithApiKey, 'apiKey'>): SeamHttpAccessCodesUnmanaged;
|
|
@@ -111,6 +56,7 @@ type AccessCodesUnmanagedUpdateOptions = never;
|
|
|
111
56
|
|
|
112
57
|
declare class SeamHttpAccessCodes {
|
|
113
58
|
client: Client;
|
|
59
|
+
readonly defaults: Required<SeamHttpRequestOptions>;
|
|
114
60
|
constructor(apiKeyOrOptions?: string | SeamHttpOptions);
|
|
115
61
|
static fromClient(client: SeamHttpOptionsWithClient['client'], options?: Omit<SeamHttpOptionsWithClient, 'client'>): SeamHttpAccessCodes;
|
|
116
62
|
static fromApiKey(apiKey: SeamHttpOptionsWithApiKey['apiKey'], options?: Omit<SeamHttpOptionsWithApiKey, 'apiKey'>): SeamHttpAccessCodes;
|
|
@@ -155,6 +101,7 @@ type AccessCodesUpdateOptions = never;
|
|
|
155
101
|
|
|
156
102
|
declare class SeamHttpAcsAccessGroups {
|
|
157
103
|
client: Client;
|
|
104
|
+
readonly defaults: Required<SeamHttpRequestOptions>;
|
|
158
105
|
constructor(apiKeyOrOptions?: string | SeamHttpOptions);
|
|
159
106
|
static fromClient(client: SeamHttpOptionsWithClient['client'], options?: Omit<SeamHttpOptionsWithClient, 'client'>): SeamHttpAcsAccessGroups;
|
|
160
107
|
static fromApiKey(apiKey: SeamHttpOptionsWithApiKey['apiKey'], options?: Omit<SeamHttpOptionsWithApiKey, 'apiKey'>): SeamHttpAcsAccessGroups;
|
|
@@ -186,6 +133,7 @@ type AcsAccessGroupsRemoveUserOptions = never;
|
|
|
186
133
|
|
|
187
134
|
declare class SeamHttpAcsCredentials {
|
|
188
135
|
client: Client;
|
|
136
|
+
readonly defaults: Required<SeamHttpRequestOptions>;
|
|
189
137
|
constructor(apiKeyOrOptions?: string | SeamHttpOptions);
|
|
190
138
|
static fromClient(client: SeamHttpOptionsWithClient['client'], options?: Omit<SeamHttpOptionsWithClient, 'client'>): SeamHttpAcsCredentials;
|
|
191
139
|
static fromApiKey(apiKey: SeamHttpOptionsWithApiKey['apiKey'], options?: Omit<SeamHttpOptionsWithApiKey, 'apiKey'>): SeamHttpAcsCredentials;
|
|
@@ -221,6 +169,7 @@ type AcsCredentialsUnassignOptions = never;
|
|
|
221
169
|
|
|
222
170
|
declare class SeamHttpAcsSystems {
|
|
223
171
|
client: Client;
|
|
172
|
+
readonly defaults: Required<SeamHttpRequestOptions>;
|
|
224
173
|
constructor(apiKeyOrOptions?: string | SeamHttpOptions);
|
|
225
174
|
static fromClient(client: SeamHttpOptionsWithClient['client'], options?: Omit<SeamHttpOptionsWithClient, 'client'>): SeamHttpAcsSystems;
|
|
226
175
|
static fromApiKey(apiKey: SeamHttpOptionsWithApiKey['apiKey'], options?: Omit<SeamHttpOptionsWithApiKey, 'apiKey'>): SeamHttpAcsSystems;
|
|
@@ -240,6 +189,7 @@ type AcsSystemsListOptions = never;
|
|
|
240
189
|
|
|
241
190
|
declare class SeamHttpAcsUsers {
|
|
242
191
|
client: Client;
|
|
192
|
+
readonly defaults: Required<SeamHttpRequestOptions>;
|
|
243
193
|
constructor(apiKeyOrOptions?: string | SeamHttpOptions);
|
|
244
194
|
static fromClient(client: SeamHttpOptionsWithClient['client'], options?: Omit<SeamHttpOptionsWithClient, 'client'>): SeamHttpAcsUsers;
|
|
245
195
|
static fromApiKey(apiKey: SeamHttpOptionsWithApiKey['apiKey'], options?: Omit<SeamHttpOptionsWithApiKey, 'apiKey'>): SeamHttpAcsUsers;
|
|
@@ -287,6 +237,7 @@ type AcsUsersUpdateOptions = never;
|
|
|
287
237
|
|
|
288
238
|
declare class SeamHttpAcs {
|
|
289
239
|
client: Client;
|
|
240
|
+
readonly defaults: Required<SeamHttpRequestOptions>;
|
|
290
241
|
constructor(apiKeyOrOptions?: string | SeamHttpOptions);
|
|
291
242
|
static fromClient(client: SeamHttpOptionsWithClient['client'], options?: Omit<SeamHttpOptionsWithClient, 'client'>): SeamHttpAcs;
|
|
292
243
|
static fromApiKey(apiKey: SeamHttpOptionsWithApiKey['apiKey'], options?: Omit<SeamHttpOptionsWithApiKey, 'apiKey'>): SeamHttpAcs;
|
|
@@ -302,6 +253,7 @@ declare class SeamHttpAcs {
|
|
|
302
253
|
|
|
303
254
|
declare class SeamHttpActionAttempts {
|
|
304
255
|
client: Client;
|
|
256
|
+
readonly defaults: Required<SeamHttpRequestOptions>;
|
|
305
257
|
constructor(apiKeyOrOptions?: string | SeamHttpOptions);
|
|
306
258
|
static fromClient(client: SeamHttpOptionsWithClient['client'], options?: Omit<SeamHttpOptionsWithClient, 'client'>): SeamHttpActionAttempts;
|
|
307
259
|
static fromApiKey(apiKey: SeamHttpOptionsWithApiKey['apiKey'], options?: Omit<SeamHttpOptionsWithApiKey, 'apiKey'>): SeamHttpActionAttempts;
|
|
@@ -309,22 +261,19 @@ declare class SeamHttpActionAttempts {
|
|
|
309
261
|
static fromPublishableKey(publishableKey: string, userIdentifierKey: string, options?: SeamHttpFromPublishableKeyOptions): Promise<SeamHttpActionAttempts>;
|
|
310
262
|
static fromConsoleSessionToken(consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], options?: Omit<SeamHttpOptionsWithConsoleSessionToken, 'consoleSessionToken' | 'workspaceId'>): SeamHttpActionAttempts;
|
|
311
263
|
static fromPersonalAccessToken(personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], options?: Omit<SeamHttpOptionsWithPersonalAccessToken, 'personalAccessToken' | 'workspaceId'>): SeamHttpActionAttempts;
|
|
312
|
-
get(body?: ActionAttemptsGetParams,
|
|
313
|
-
waitForActionAttempt?: boolean | Partial<ResolveActionAttemptOptions>;
|
|
314
|
-
}): Promise<ActionAttemptsGetResponse['action_attempt']>;
|
|
264
|
+
get(body?: ActionAttemptsGetParams, options?: Pick<SeamHttpRequestOptions, 'waitForActionAttempt'>): Promise<ActionAttemptsGetResponse['action_attempt']>;
|
|
315
265
|
list(body?: ActionAttemptsListParams): Promise<ActionAttemptsListResponse['action_attempts']>;
|
|
316
266
|
}
|
|
317
267
|
type ActionAttemptsGetParams = RouteRequestBody<'/action_attempts/get'>;
|
|
318
268
|
type ActionAttemptsGetResponse = SetNonNullable<Required<RouteResponse<'/action_attempts/get'>>>;
|
|
319
|
-
|
|
320
|
-
waitForActionAttempt?: boolean | Partial<ResolveActionAttemptOptions>;
|
|
321
|
-
}
|
|
269
|
+
type ActionAttemptsGetOptions = Pick<SeamHttpRequestOptions, 'waitForActionAttempt'>;
|
|
322
270
|
type ActionAttemptsListParams = RouteRequestBody<'/action_attempts/list'>;
|
|
323
271
|
type ActionAttemptsListResponse = SetNonNullable<Required<RouteResponse<'/action_attempts/list'>>>;
|
|
324
272
|
type ActionAttemptsListOptions = never;
|
|
325
273
|
|
|
326
274
|
declare class SeamHttpClientSessions {
|
|
327
275
|
client: Client;
|
|
276
|
+
readonly defaults: Required<SeamHttpRequestOptions>;
|
|
328
277
|
constructor(apiKeyOrOptions?: string | SeamHttpOptions);
|
|
329
278
|
static fromClient(client: SeamHttpOptionsWithClient['client'], options?: Omit<SeamHttpOptionsWithClient, 'client'>): SeamHttpClientSessions;
|
|
330
279
|
static fromApiKey(apiKey: SeamHttpOptionsWithApiKey['apiKey'], options?: Omit<SeamHttpOptionsWithApiKey, 'apiKey'>): SeamHttpClientSessions;
|
|
@@ -364,6 +313,7 @@ type ClientSessionsRevokeOptions = never;
|
|
|
364
313
|
|
|
365
314
|
declare class SeamHttpConnectWebviews {
|
|
366
315
|
client: Client;
|
|
316
|
+
readonly defaults: Required<SeamHttpRequestOptions>;
|
|
367
317
|
constructor(apiKeyOrOptions?: string | SeamHttpOptions);
|
|
368
318
|
static fromClient(client: SeamHttpOptionsWithClient['client'], options?: Omit<SeamHttpOptionsWithClient, 'client'>): SeamHttpConnectWebviews;
|
|
369
319
|
static fromApiKey(apiKey: SeamHttpOptionsWithApiKey['apiKey'], options?: Omit<SeamHttpOptionsWithApiKey, 'apiKey'>): SeamHttpConnectWebviews;
|
|
@@ -395,6 +345,7 @@ type ConnectWebviewsViewOptions = never;
|
|
|
395
345
|
|
|
396
346
|
declare class SeamHttpConnectedAccounts {
|
|
397
347
|
client: Client;
|
|
348
|
+
readonly defaults: Required<SeamHttpRequestOptions>;
|
|
398
349
|
constructor(apiKeyOrOptions?: string | SeamHttpOptions);
|
|
399
350
|
static fromClient(client: SeamHttpOptionsWithClient['client'], options?: Omit<SeamHttpOptionsWithClient, 'client'>): SeamHttpConnectedAccounts;
|
|
400
351
|
static fromApiKey(apiKey: SeamHttpOptionsWithApiKey['apiKey'], options?: Omit<SeamHttpOptionsWithApiKey, 'apiKey'>): SeamHttpConnectedAccounts;
|
|
@@ -418,6 +369,7 @@ type ConnectedAccountsListOptions = never;
|
|
|
418
369
|
|
|
419
370
|
declare class SeamHttpDevicesUnmanaged {
|
|
420
371
|
client: Client;
|
|
372
|
+
readonly defaults: Required<SeamHttpRequestOptions>;
|
|
421
373
|
constructor(apiKeyOrOptions?: string | SeamHttpOptions);
|
|
422
374
|
static fromClient(client: SeamHttpOptionsWithClient['client'], options?: Omit<SeamHttpOptionsWithClient, 'client'>): SeamHttpDevicesUnmanaged;
|
|
423
375
|
static fromApiKey(apiKey: SeamHttpOptionsWithApiKey['apiKey'], options?: Omit<SeamHttpOptionsWithApiKey, 'apiKey'>): SeamHttpDevicesUnmanaged;
|
|
@@ -441,6 +393,7 @@ type DevicesUnmanagedUpdateOptions = never;
|
|
|
441
393
|
|
|
442
394
|
declare class SeamHttpDevices {
|
|
443
395
|
client: Client;
|
|
396
|
+
readonly defaults: Required<SeamHttpRequestOptions>;
|
|
444
397
|
constructor(apiKeyOrOptions?: string | SeamHttpOptions);
|
|
445
398
|
static fromClient(client: SeamHttpOptionsWithClient['client'], options?: Omit<SeamHttpOptionsWithClient, 'client'>): SeamHttpDevices;
|
|
446
399
|
static fromApiKey(apiKey: SeamHttpOptionsWithApiKey['apiKey'], options?: Omit<SeamHttpOptionsWithApiKey, 'apiKey'>): SeamHttpDevices;
|
|
@@ -473,6 +426,7 @@ type DevicesUpdateOptions = never;
|
|
|
473
426
|
|
|
474
427
|
declare class SeamHttpEvents {
|
|
475
428
|
client: Client;
|
|
429
|
+
readonly defaults: Required<SeamHttpRequestOptions>;
|
|
476
430
|
constructor(apiKeyOrOptions?: string | SeamHttpOptions);
|
|
477
431
|
static fromClient(client: SeamHttpOptionsWithClient['client'], options?: Omit<SeamHttpOptionsWithClient, 'client'>): SeamHttpEvents;
|
|
478
432
|
static fromApiKey(apiKey: SeamHttpOptionsWithApiKey['apiKey'], options?: Omit<SeamHttpOptionsWithApiKey, 'apiKey'>): SeamHttpEvents;
|
|
@@ -492,6 +446,7 @@ type EventsListOptions = never;
|
|
|
492
446
|
|
|
493
447
|
declare class SeamHttpLocks {
|
|
494
448
|
client: Client;
|
|
449
|
+
readonly defaults: Required<SeamHttpRequestOptions>;
|
|
495
450
|
constructor(apiKeyOrOptions?: string | SeamHttpOptions);
|
|
496
451
|
static fromClient(client: SeamHttpOptionsWithClient['client'], options?: Omit<SeamHttpOptionsWithClient, 'client'>): SeamHttpLocks;
|
|
497
452
|
static fromApiKey(apiKey: SeamHttpOptionsWithApiKey['apiKey'], options?: Omit<SeamHttpOptionsWithApiKey, 'apiKey'>): SeamHttpLocks;
|
|
@@ -501,12 +456,8 @@ declare class SeamHttpLocks {
|
|
|
501
456
|
static fromPersonalAccessToken(personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], options?: Omit<SeamHttpOptionsWithPersonalAccessToken, 'personalAccessToken' | 'workspaceId'>): SeamHttpLocks;
|
|
502
457
|
get(body?: LocksGetParams): Promise<LocksGetResponse['device']>;
|
|
503
458
|
list(body?: LocksListParams): Promise<LocksListResponse['devices']>;
|
|
504
|
-
lockDoor(body?: LocksLockDoorBody,
|
|
505
|
-
|
|
506
|
-
}): Promise<LocksLockDoorResponse['action_attempt']>;
|
|
507
|
-
unlockDoor(body?: LocksUnlockDoorBody, { waitForActionAttempt, }?: {
|
|
508
|
-
waitForActionAttempt?: boolean | Partial<ResolveActionAttemptOptions>;
|
|
509
|
-
}): Promise<LocksUnlockDoorResponse['action_attempt']>;
|
|
459
|
+
lockDoor(body?: LocksLockDoorBody, options?: Pick<SeamHttpRequestOptions, 'waitForActionAttempt'>): Promise<LocksLockDoorResponse['action_attempt']>;
|
|
460
|
+
unlockDoor(body?: LocksUnlockDoorBody, options?: Pick<SeamHttpRequestOptions, 'waitForActionAttempt'>): Promise<LocksUnlockDoorResponse['action_attempt']>;
|
|
510
461
|
}
|
|
511
462
|
type LocksGetParams = RouteRequestBody<'/locks/get'>;
|
|
512
463
|
type LocksGetResponse = SetNonNullable<Required<RouteResponse<'/locks/get'>>>;
|
|
@@ -516,17 +467,14 @@ type LocksListResponse = SetNonNullable<Required<RouteResponse<'/locks/list'>>>;
|
|
|
516
467
|
type LocksListOptions = never;
|
|
517
468
|
type LocksLockDoorBody = RouteRequestBody<'/locks/lock_door'>;
|
|
518
469
|
type LocksLockDoorResponse = SetNonNullable<Required<RouteResponse<'/locks/lock_door'>>>;
|
|
519
|
-
|
|
520
|
-
waitForActionAttempt?: boolean | Partial<ResolveActionAttemptOptions>;
|
|
521
|
-
}
|
|
470
|
+
type LocksLockDoorOptions = Pick<SeamHttpRequestOptions, 'waitForActionAttempt'>;
|
|
522
471
|
type LocksUnlockDoorBody = RouteRequestBody<'/locks/unlock_door'>;
|
|
523
472
|
type LocksUnlockDoorResponse = SetNonNullable<Required<RouteResponse<'/locks/unlock_door'>>>;
|
|
524
|
-
|
|
525
|
-
waitForActionAttempt?: boolean | Partial<ResolveActionAttemptOptions>;
|
|
526
|
-
}
|
|
473
|
+
type LocksUnlockDoorOptions = Pick<SeamHttpRequestOptions, 'waitForActionAttempt'>;
|
|
527
474
|
|
|
528
475
|
declare class SeamHttpNoiseSensorsNoiseThresholds {
|
|
529
476
|
client: Client;
|
|
477
|
+
readonly defaults: Required<SeamHttpRequestOptions>;
|
|
530
478
|
constructor(apiKeyOrOptions?: string | SeamHttpOptions);
|
|
531
479
|
static fromClient(client: SeamHttpOptionsWithClient['client'], options?: Omit<SeamHttpOptionsWithClient, 'client'>): SeamHttpNoiseSensorsNoiseThresholds;
|
|
532
480
|
static fromApiKey(apiKey: SeamHttpOptionsWithApiKey['apiKey'], options?: Omit<SeamHttpOptionsWithApiKey, 'apiKey'>): SeamHttpNoiseSensorsNoiseThresholds;
|
|
@@ -558,6 +506,7 @@ type NoiseSensorsNoiseThresholdsUpdateOptions = never;
|
|
|
558
506
|
|
|
559
507
|
declare class SeamHttpNoiseSensors {
|
|
560
508
|
client: Client;
|
|
509
|
+
readonly defaults: Required<SeamHttpRequestOptions>;
|
|
561
510
|
constructor(apiKeyOrOptions?: string | SeamHttpOptions);
|
|
562
511
|
static fromClient(client: SeamHttpOptionsWithClient['client'], options?: Omit<SeamHttpOptionsWithClient, 'client'>): SeamHttpNoiseSensors;
|
|
563
512
|
static fromApiKey(apiKey: SeamHttpOptionsWithApiKey['apiKey'], options?: Omit<SeamHttpOptionsWithApiKey, 'apiKey'>): SeamHttpNoiseSensors;
|
|
@@ -570,6 +519,7 @@ declare class SeamHttpNoiseSensors {
|
|
|
570
519
|
|
|
571
520
|
declare class SeamHttpThermostatsClimateSettingSchedules {
|
|
572
521
|
client: Client;
|
|
522
|
+
readonly defaults: Required<SeamHttpRequestOptions>;
|
|
573
523
|
constructor(apiKeyOrOptions?: string | SeamHttpOptions);
|
|
574
524
|
static fromClient(client: SeamHttpOptionsWithClient['client'], options?: Omit<SeamHttpOptionsWithClient, 'client'>): SeamHttpThermostatsClimateSettingSchedules;
|
|
575
525
|
static fromApiKey(apiKey: SeamHttpOptionsWithApiKey['apiKey'], options?: Omit<SeamHttpOptionsWithApiKey, 'apiKey'>): SeamHttpThermostatsClimateSettingSchedules;
|
|
@@ -601,6 +551,7 @@ type ThermostatsClimateSettingSchedulesUpdateOptions = never;
|
|
|
601
551
|
|
|
602
552
|
declare class SeamHttpThermostats {
|
|
603
553
|
client: Client;
|
|
554
|
+
readonly defaults: Required<SeamHttpRequestOptions>;
|
|
604
555
|
constructor(apiKeyOrOptions?: string | SeamHttpOptions);
|
|
605
556
|
static fromClient(client: SeamHttpOptionsWithClient['client'], options?: Omit<SeamHttpOptionsWithClient, 'client'>): SeamHttpThermostats;
|
|
606
557
|
static fromApiKey(apiKey: SeamHttpOptionsWithApiKey['apiKey'], options?: Omit<SeamHttpOptionsWithApiKey, 'apiKey'>): SeamHttpThermostats;
|
|
@@ -645,6 +596,7 @@ type ThermostatsUpdateOptions = never;
|
|
|
645
596
|
|
|
646
597
|
declare class SeamHttpUserIdentities {
|
|
647
598
|
client: Client;
|
|
599
|
+
readonly defaults: Required<SeamHttpRequestOptions>;
|
|
648
600
|
constructor(apiKeyOrOptions?: string | SeamHttpOptions);
|
|
649
601
|
static fromClient(client: SeamHttpOptionsWithClient['client'], options?: Omit<SeamHttpOptionsWithClient, 'client'>): SeamHttpUserIdentities;
|
|
650
602
|
static fromApiKey(apiKey: SeamHttpOptionsWithApiKey['apiKey'], options?: Omit<SeamHttpOptionsWithApiKey, 'apiKey'>): SeamHttpUserIdentities;
|
|
@@ -688,6 +640,7 @@ type UserIdentitiesRevokeAccessToDeviceOptions = never;
|
|
|
688
640
|
|
|
689
641
|
declare class SeamHttpWebhooks {
|
|
690
642
|
client: Client;
|
|
643
|
+
readonly defaults: Required<SeamHttpRequestOptions>;
|
|
691
644
|
constructor(apiKeyOrOptions?: string | SeamHttpOptions);
|
|
692
645
|
static fromClient(client: SeamHttpOptionsWithClient['client'], options?: Omit<SeamHttpOptionsWithClient, 'client'>): SeamHttpWebhooks;
|
|
693
646
|
static fromApiKey(apiKey: SeamHttpOptionsWithApiKey['apiKey'], options?: Omit<SeamHttpOptionsWithApiKey, 'apiKey'>): SeamHttpWebhooks;
|
|
@@ -715,6 +668,7 @@ type WebhooksListOptions = never;
|
|
|
715
668
|
|
|
716
669
|
declare class SeamHttpWorkspaces {
|
|
717
670
|
client: Client;
|
|
671
|
+
readonly defaults: Required<SeamHttpRequestOptions>;
|
|
718
672
|
constructor(apiKeyOrOptions?: string | SeamHttpOptions);
|
|
719
673
|
static fromClient(client: SeamHttpOptionsWithClient['client'], options?: Omit<SeamHttpOptionsWithClient, 'client'>): SeamHttpWorkspaces;
|
|
720
674
|
static fromApiKey(apiKey: SeamHttpOptionsWithApiKey['apiKey'], options?: Omit<SeamHttpOptionsWithApiKey, 'apiKey'>): SeamHttpWorkspaces;
|
|
@@ -755,8 +709,67 @@ declare class SeamActionAttemptTimeoutError<T extends ActionAttempt> extends Sea
|
|
|
755
709
|
constructor(actionAttempt: T, timeout: number);
|
|
756
710
|
}
|
|
757
711
|
|
|
712
|
+
type SeamHttpMultiWorkspaceOptions = SeamHttpMultiWorkspaceOptionsWithClient | SeamHttpMultiWorkspaceOptionsWithConsoleSessionToken | SeamHttpMultiWorkspaceOptionsWithPersonalAccessToken;
|
|
713
|
+
type SeamHttpOptions = SeamHttpOptionsFromEnv | SeamHttpOptionsWithClient | SeamHttpOptionsWithApiKey | SeamHttpOptionsWithClientSessionToken | SeamHttpOptionsWithConsoleSessionToken | SeamHttpOptionsWithPersonalAccessToken;
|
|
714
|
+
interface SeamHttpCommonOptions extends ClientOptions, SeamHttpRequestOptions {
|
|
715
|
+
endpoint?: string;
|
|
716
|
+
}
|
|
717
|
+
interface SeamHttpRequestOptions {
|
|
718
|
+
waitForActionAttempt?: boolean | ResolveActionAttemptOptions;
|
|
719
|
+
}
|
|
720
|
+
interface SeamHttpFromPublishableKeyOptions extends SeamHttpCommonOptions {
|
|
721
|
+
}
|
|
722
|
+
interface SeamHttpOptionsFromEnv extends SeamHttpCommonOptions {
|
|
723
|
+
}
|
|
724
|
+
interface SeamHttpMultiWorkspaceOptionsWithClient extends SeamHttpRequestOptions {
|
|
725
|
+
client: Client;
|
|
726
|
+
}
|
|
727
|
+
declare const isSeamHttpMultiWorkspaceOptionsWithClient: (options: SeamHttpOptions) => options is SeamHttpMultiWorkspaceOptionsWithClient;
|
|
728
|
+
interface SeamHttpOptionsWithClient extends SeamHttpRequestOptions {
|
|
729
|
+
client: Client;
|
|
730
|
+
}
|
|
731
|
+
declare const isSeamHttpOptionsWithClient: (options: SeamHttpOptions) => options is SeamHttpOptionsWithClient;
|
|
732
|
+
interface SeamHttpOptionsWithApiKey extends SeamHttpCommonOptions {
|
|
733
|
+
apiKey: string;
|
|
734
|
+
}
|
|
735
|
+
declare const isSeamHttpOptionsWithApiKey: (options: SeamHttpOptions) => options is SeamHttpOptionsWithApiKey;
|
|
736
|
+
interface SeamHttpOptionsWithClientSessionToken extends SeamHttpCommonOptions {
|
|
737
|
+
clientSessionToken: string;
|
|
738
|
+
}
|
|
739
|
+
declare const isSeamHttpOptionsWithClientSessionToken: (options: SeamHttpOptions) => options is SeamHttpOptionsWithClientSessionToken;
|
|
740
|
+
interface SeamHttpMultiWorkspaceOptionsWithConsoleSessionToken extends SeamHttpCommonOptions {
|
|
741
|
+
consoleSessionToken: string;
|
|
742
|
+
}
|
|
743
|
+
declare const isSeamHttpMultiWorkspaceOptionsWithConsoleSessionToken: (options: SeamHttpOptions) => options is SeamHttpMultiWorkspaceOptionsWithConsoleSessionToken;
|
|
744
|
+
interface SeamHttpOptionsWithConsoleSessionToken extends SeamHttpCommonOptions {
|
|
745
|
+
consoleSessionToken: string;
|
|
746
|
+
workspaceId: string;
|
|
747
|
+
}
|
|
748
|
+
declare const isSeamHttpOptionsWithConsoleSessionToken: (options: SeamHttpOptions) => options is SeamHttpOptionsWithConsoleSessionToken;
|
|
749
|
+
interface SeamHttpMultiWorkspaceOptionsWithPersonalAccessToken extends SeamHttpCommonOptions {
|
|
750
|
+
personalAccessToken: string;
|
|
751
|
+
}
|
|
752
|
+
declare const isSeamHttpMultiWorkspaceOptionsWithPersonalAccessToken: (options: SeamHttpOptions) => options is SeamHttpMultiWorkspaceOptionsWithPersonalAccessToken;
|
|
753
|
+
interface SeamHttpOptionsWithPersonalAccessToken extends SeamHttpCommonOptions {
|
|
754
|
+
personalAccessToken: string;
|
|
755
|
+
workspaceId: string;
|
|
756
|
+
}
|
|
757
|
+
declare const isSeamHttpOptionsWithPersonalAccessToken: (options: SeamHttpOptions) => options is SeamHttpOptionsWithPersonalAccessToken;
|
|
758
|
+
declare class SeamHttpInvalidOptionsError extends Error {
|
|
759
|
+
constructor(message: string);
|
|
760
|
+
}
|
|
761
|
+
declare class SeamHttpMultiWorkspaceInvalidOptionsError extends SeamHttpInvalidOptionsError {
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
declare class SeamHttpInvalidTokenError extends Error {
|
|
765
|
+
constructor(message: string);
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
declare const errorInterceptor: (err: unknown) => Promise<void>;
|
|
769
|
+
|
|
758
770
|
declare class SeamHttp {
|
|
759
771
|
client: Client;
|
|
772
|
+
readonly defaults: Required<SeamHttpRequestOptions>;
|
|
760
773
|
constructor(apiKeyOrOptions?: string | SeamHttpOptions);
|
|
761
774
|
static fromClient(client: SeamHttpOptionsWithClient['client'], options?: Omit<SeamHttpOptionsWithClient, 'client'>): SeamHttp;
|
|
762
775
|
static fromApiKey(apiKey: SeamHttpOptionsWithApiKey['apiKey'], options?: Omit<SeamHttpOptionsWithApiKey, 'apiKey'>): SeamHttp;
|
|
@@ -808,6 +821,7 @@ declare const isSeamHttpInvalidInputError: (error: unknown) => error is SeamHttp
|
|
|
808
821
|
|
|
809
822
|
declare class SeamHttpMultiWorkspace {
|
|
810
823
|
client: Client;
|
|
824
|
+
readonly defaults: Required<SeamHttpRequestOptions>;
|
|
811
825
|
constructor(options: SeamHttpMultiWorkspaceOptions);
|
|
812
826
|
static fromClient(client: SeamHttpMultiWorkspaceOptionsWithClient['client'], options?: Omit<SeamHttpMultiWorkspaceOptionsWithClient, 'client'>): SeamHttpMultiWorkspace;
|
|
813
827
|
static fromConsoleSessionToken(consoleSessionToken: SeamHttpMultiWorkspaceOptionsWithConsoleSessionToken['consoleSessionToken'], options?: Omit<SeamHttpMultiWorkspaceOptionsWithConsoleSessionToken, 'consoleSessionToken'>): SeamHttpMultiWorkspace;
|
|
@@ -820,4 +834,4 @@ declare class UnserializableParamError extends Error {
|
|
|
820
834
|
constructor(name: string, message: string);
|
|
821
835
|
}
|
|
822
836
|
|
|
823
|
-
export { AccessCodesCreateBody, AccessCodesCreateMultipleBody, AccessCodesCreateMultipleOptions, AccessCodesCreateMultipleResponse, AccessCodesCreateOptions, AccessCodesCreateResponse, AccessCodesDeleteBody, AccessCodesDeleteOptions, AccessCodesDeleteResponse, AccessCodesGenerateCodeBody, AccessCodesGenerateCodeOptions, AccessCodesGenerateCodeResponse, AccessCodesGetOptions, AccessCodesGetParams, AccessCodesGetResponse, AccessCodesListOptions, AccessCodesListParams, AccessCodesListResponse, AccessCodesPullBackupAccessCodeBody, AccessCodesPullBackupAccessCodeOptions, AccessCodesPullBackupAccessCodeResponse, AccessCodesUnmanagedConvertToManagedBody, AccessCodesUnmanagedConvertToManagedOptions, AccessCodesUnmanagedConvertToManagedResponse, AccessCodesUnmanagedDeleteBody, AccessCodesUnmanagedDeleteOptions, AccessCodesUnmanagedDeleteResponse, AccessCodesUnmanagedGetOptions, AccessCodesUnmanagedGetParams, AccessCodesUnmanagedGetResponse, AccessCodesUnmanagedListOptions, AccessCodesUnmanagedListParams, AccessCodesUnmanagedListResponse, AccessCodesUnmanagedUpdateBody, AccessCodesUnmanagedUpdateOptions, AccessCodesUnmanagedUpdateResponse, AccessCodesUpdateBody, AccessCodesUpdateOptions, AccessCodesUpdateResponse, AcsAccessGroupsAddUserBody, AcsAccessGroupsAddUserOptions, AcsAccessGroupsAddUserResponse, AcsAccessGroupsGetOptions, AcsAccessGroupsGetParams, AcsAccessGroupsGetResponse, AcsAccessGroupsListOptions, AcsAccessGroupsListParams, AcsAccessGroupsListResponse, AcsAccessGroupsListUsersOptions, AcsAccessGroupsListUsersParams, AcsAccessGroupsListUsersResponse, AcsAccessGroupsRemoveUserBody, AcsAccessGroupsRemoveUserOptions, AcsAccessGroupsRemoveUserResponse, AcsCredentialsAssignBody, AcsCredentialsAssignOptions, AcsCredentialsAssignResponse, AcsCredentialsCreateBody, AcsCredentialsCreateOptions, AcsCredentialsCreateResponse, AcsCredentialsDeleteBody, AcsCredentialsDeleteOptions, AcsCredentialsDeleteResponse, AcsCredentialsGetOptions, AcsCredentialsGetParams, AcsCredentialsGetResponse, AcsCredentialsListOptions, AcsCredentialsListParams, AcsCredentialsListResponse, AcsCredentialsUnassignBody, AcsCredentialsUnassignOptions, AcsCredentialsUnassignResponse, AcsSystemsGetOptions, AcsSystemsGetParams, AcsSystemsGetResponse, AcsSystemsListOptions, AcsSystemsListParams, AcsSystemsListResponse, AcsUsersAddToAccessGroupBody, AcsUsersAddToAccessGroupOptions, AcsUsersAddToAccessGroupResponse, AcsUsersCreateBody, AcsUsersCreateOptions, AcsUsersCreateResponse, AcsUsersDeleteBody, AcsUsersDeleteOptions, AcsUsersDeleteResponse, AcsUsersGetOptions, AcsUsersGetParams, AcsUsersGetResponse, AcsUsersListOptions, AcsUsersListParams, AcsUsersListResponse, AcsUsersRemoveFromAccessGroupBody, AcsUsersRemoveFromAccessGroupOptions, AcsUsersRemoveFromAccessGroupResponse, AcsUsersSuspendBody, AcsUsersSuspendOptions, AcsUsersSuspendResponse, AcsUsersUnsuspendBody, AcsUsersUnsuspendOptions, AcsUsersUnsuspendResponse, AcsUsersUpdateBody, AcsUsersUpdateOptions, AcsUsersUpdateResponse, ActionAttemptsGetOptions, ActionAttemptsGetParams, ActionAttemptsGetResponse, ActionAttemptsListOptions, ActionAttemptsListParams, ActionAttemptsListResponse, ClientSessionsCreateBody, ClientSessionsCreateOptions, ClientSessionsCreateResponse, ClientSessionsDeleteBody, ClientSessionsDeleteOptions, ClientSessionsDeleteResponse, ClientSessionsGetOptions, ClientSessionsGetOrCreateBody, ClientSessionsGetOrCreateOptions, ClientSessionsGetOrCreateResponse, ClientSessionsGetParams, ClientSessionsGetResponse, ClientSessionsGrantAccessBody, ClientSessionsGrantAccessOptions, ClientSessionsGrantAccessResponse, ClientSessionsListOptions, ClientSessionsListParams, ClientSessionsListResponse, ClientSessionsRevokeBody, ClientSessionsRevokeOptions, ClientSessionsRevokeResponse, ConnectWebviewsCreateBody, ConnectWebviewsCreateOptions, ConnectWebviewsCreateResponse, ConnectWebviewsDeleteBody, ConnectWebviewsDeleteOptions, ConnectWebviewsDeleteResponse, ConnectWebviewsGetOptions, ConnectWebviewsGetParams, ConnectWebviewsGetResponse, ConnectWebviewsListOptions, ConnectWebviewsListParams, ConnectWebviewsListResponse, ConnectWebviewsViewOptions, ConnectWebviewsViewParams, ConnectWebviewsViewResponse, ConnectedAccountsDeleteBody, ConnectedAccountsDeleteOptions, ConnectedAccountsDeleteResponse, ConnectedAccountsGetOptions, ConnectedAccountsGetParams, ConnectedAccountsGetResponse, ConnectedAccountsListOptions, ConnectedAccountsListParams, ConnectedAccountsListResponse, DevicesDeleteBody, DevicesDeleteOptions, DevicesDeleteResponse, DevicesGetOptions, DevicesGetParams, DevicesGetResponse, DevicesListDeviceProvidersOptions, DevicesListDeviceProvidersParams, DevicesListDeviceProvidersResponse, DevicesListOptions, DevicesListParams, DevicesListResponse, DevicesUnmanagedGetOptions, DevicesUnmanagedGetParams, DevicesUnmanagedGetResponse, DevicesUnmanagedListOptions, DevicesUnmanagedListParams, DevicesUnmanagedListResponse, DevicesUnmanagedUpdateBody, DevicesUnmanagedUpdateOptions, DevicesUnmanagedUpdateResponse, DevicesUpdateBody, DevicesUpdateOptions, DevicesUpdateResponse, EventsGetOptions, EventsGetParams, EventsGetResponse, EventsListOptions, EventsListParams, EventsListResponse, LocksGetOptions, LocksGetParams, LocksGetResponse, LocksListOptions, LocksListParams, LocksListResponse, LocksLockDoorBody, LocksLockDoorOptions, LocksLockDoorResponse, LocksUnlockDoorBody, LocksUnlockDoorOptions, LocksUnlockDoorResponse, NoiseSensorsNoiseThresholdsCreateBody, NoiseSensorsNoiseThresholdsCreateOptions, NoiseSensorsNoiseThresholdsCreateResponse, NoiseSensorsNoiseThresholdsDeleteBody, NoiseSensorsNoiseThresholdsDeleteOptions, NoiseSensorsNoiseThresholdsDeleteResponse, NoiseSensorsNoiseThresholdsGetOptions, NoiseSensorsNoiseThresholdsGetParams, NoiseSensorsNoiseThresholdsGetResponse, NoiseSensorsNoiseThresholdsListOptions, NoiseSensorsNoiseThresholdsListParams, NoiseSensorsNoiseThresholdsListResponse, NoiseSensorsNoiseThresholdsUpdateBody, NoiseSensorsNoiseThresholdsUpdateOptions, NoiseSensorsNoiseThresholdsUpdateResponse, SeamActionAttemptError, SeamActionAttemptFailedError, SeamActionAttemptTimeoutError, SeamHttp, SeamHttpAccessCodes, SeamHttpAccessCodesUnmanaged, SeamHttpAcs, SeamHttpAcsAccessGroups, SeamHttpAcsCredentials, SeamHttpAcsSystems, SeamHttpAcsUsers, SeamHttpActionAttempts, SeamHttpApiError, SeamHttpClientSessions, SeamHttpConnectWebviews, SeamHttpConnectedAccounts, SeamHttpDevices, SeamHttpDevicesUnmanaged, SeamHttpEvents, SeamHttpFromPublishableKeyOptions, SeamHttpInvalidInputError, SeamHttpInvalidOptionsError, SeamHttpInvalidTokenError, SeamHttpLocks, SeamHttpMultiWorkspace, SeamHttpMultiWorkspaceInvalidOptionsError, SeamHttpMultiWorkspaceOptions, SeamHttpMultiWorkspaceOptionsWithClient, SeamHttpMultiWorkspaceOptionsWithConsoleSessionToken, SeamHttpMultiWorkspaceOptionsWithPersonalAccessToken, SeamHttpNoiseSensors, SeamHttpNoiseSensorsNoiseThresholds, SeamHttpOptions, SeamHttpOptionsFromEnv, SeamHttpOptionsWithApiKey, SeamHttpOptionsWithClient, SeamHttpOptionsWithClientSessionToken, SeamHttpOptionsWithConsoleSessionToken, SeamHttpOptionsWithPersonalAccessToken, SeamHttpThermostats, SeamHttpThermostatsClimateSettingSchedules, SeamHttpUnauthorizedError, SeamHttpUserIdentities, SeamHttpWebhooks, SeamHttpWorkspaces, ThermostatsClimateSettingSchedulesCreateBody, ThermostatsClimateSettingSchedulesCreateOptions, ThermostatsClimateSettingSchedulesCreateResponse, ThermostatsClimateSettingSchedulesDeleteBody, ThermostatsClimateSettingSchedulesDeleteOptions, ThermostatsClimateSettingSchedulesDeleteResponse, ThermostatsClimateSettingSchedulesGetOptions, ThermostatsClimateSettingSchedulesGetParams, ThermostatsClimateSettingSchedulesGetResponse, ThermostatsClimateSettingSchedulesListOptions, ThermostatsClimateSettingSchedulesListParams, ThermostatsClimateSettingSchedulesListResponse, ThermostatsClimateSettingSchedulesUpdateBody, ThermostatsClimateSettingSchedulesUpdateOptions, ThermostatsClimateSettingSchedulesUpdateResponse, ThermostatsCoolBody, ThermostatsCoolOptions, ThermostatsCoolResponse, ThermostatsGetOptions, ThermostatsGetParams, ThermostatsGetResponse, ThermostatsHeatBody, ThermostatsHeatCoolBody, ThermostatsHeatCoolOptions, ThermostatsHeatCoolResponse, ThermostatsHeatOptions, ThermostatsHeatResponse, ThermostatsListOptions, ThermostatsListParams, ThermostatsListResponse, ThermostatsOffBody, ThermostatsOffOptions, ThermostatsOffResponse, ThermostatsSetFanModeBody, ThermostatsSetFanModeOptions, ThermostatsSetFanModeResponse, ThermostatsUpdateBody, ThermostatsUpdateOptions, ThermostatsUpdateResponse, UnserializableParamError, UserIdentitiesAddAcsUserBody, UserIdentitiesAddAcsUserOptions, UserIdentitiesAddAcsUserResponse, UserIdentitiesCreateBody, UserIdentitiesCreateOptions, UserIdentitiesCreateResponse, UserIdentitiesGetOptions, UserIdentitiesGetParams, UserIdentitiesGetResponse, UserIdentitiesGrantAccessToDeviceBody, UserIdentitiesGrantAccessToDeviceOptions, UserIdentitiesGrantAccessToDeviceResponse, UserIdentitiesListAccessibleDevicesOptions, UserIdentitiesListAccessibleDevicesParams, UserIdentitiesListAccessibleDevicesResponse, UserIdentitiesListAcsUsersOptions, UserIdentitiesListAcsUsersParams, UserIdentitiesListAcsUsersResponse, UserIdentitiesRemoveAcsUserBody, UserIdentitiesRemoveAcsUserOptions, UserIdentitiesRemoveAcsUserResponse, UserIdentitiesRevokeAccessToDeviceBody, UserIdentitiesRevokeAccessToDeviceOptions, UserIdentitiesRevokeAccessToDeviceResponse, WebhooksCreateBody, WebhooksCreateOptions, WebhooksCreateResponse, WebhooksDeleteBody, WebhooksDeleteOptions, WebhooksDeleteResponse, WebhooksGetOptions, WebhooksGetParams, WebhooksGetResponse, WebhooksListOptions, WebhooksListParams, WebhooksListResponse, WorkspacesGetOptions, WorkspacesGetParams, WorkspacesGetResponse, WorkspacesListOptions, WorkspacesListParams, WorkspacesListResponse, WorkspacesResetSandboxBody, WorkspacesResetSandboxOptions, WorkspacesResetSandboxResponse, errorInterceptor, isSeamActionAttemptError, isSeamActionAttemptFailedError, isSeamActionAttemptTimeoutError, isSeamHttpApiError, isSeamHttpInvalidInputError, isSeamHttpMultiWorkspaceOptionsWithClient, isSeamHttpMultiWorkspaceOptionsWithConsoleSessionToken, isSeamHttpMultiWorkspaceOptionsWithPersonalAccessToken, isSeamHttpOptionsWithApiKey, isSeamHttpOptionsWithClient, isSeamHttpOptionsWithClientSessionToken, isSeamHttpOptionsWithConsoleSessionToken, isSeamHttpOptionsWithPersonalAccessToken, isSeamHttpUnauthorizedError, paramsSerializer };
|
|
837
|
+
export { AccessCodesCreateBody, AccessCodesCreateMultipleBody, AccessCodesCreateMultipleOptions, AccessCodesCreateMultipleResponse, AccessCodesCreateOptions, AccessCodesCreateResponse, AccessCodesDeleteBody, AccessCodesDeleteOptions, AccessCodesDeleteResponse, AccessCodesGenerateCodeBody, AccessCodesGenerateCodeOptions, AccessCodesGenerateCodeResponse, AccessCodesGetOptions, AccessCodesGetParams, AccessCodesGetResponse, AccessCodesListOptions, AccessCodesListParams, AccessCodesListResponse, AccessCodesPullBackupAccessCodeBody, AccessCodesPullBackupAccessCodeOptions, AccessCodesPullBackupAccessCodeResponse, AccessCodesUnmanagedConvertToManagedBody, AccessCodesUnmanagedConvertToManagedOptions, AccessCodesUnmanagedConvertToManagedResponse, AccessCodesUnmanagedDeleteBody, AccessCodesUnmanagedDeleteOptions, AccessCodesUnmanagedDeleteResponse, AccessCodesUnmanagedGetOptions, AccessCodesUnmanagedGetParams, AccessCodesUnmanagedGetResponse, AccessCodesUnmanagedListOptions, AccessCodesUnmanagedListParams, AccessCodesUnmanagedListResponse, AccessCodesUnmanagedUpdateBody, AccessCodesUnmanagedUpdateOptions, AccessCodesUnmanagedUpdateResponse, AccessCodesUpdateBody, AccessCodesUpdateOptions, AccessCodesUpdateResponse, AcsAccessGroupsAddUserBody, AcsAccessGroupsAddUserOptions, AcsAccessGroupsAddUserResponse, AcsAccessGroupsGetOptions, AcsAccessGroupsGetParams, AcsAccessGroupsGetResponse, AcsAccessGroupsListOptions, AcsAccessGroupsListParams, AcsAccessGroupsListResponse, AcsAccessGroupsListUsersOptions, AcsAccessGroupsListUsersParams, AcsAccessGroupsListUsersResponse, AcsAccessGroupsRemoveUserBody, AcsAccessGroupsRemoveUserOptions, AcsAccessGroupsRemoveUserResponse, AcsCredentialsAssignBody, AcsCredentialsAssignOptions, AcsCredentialsAssignResponse, AcsCredentialsCreateBody, AcsCredentialsCreateOptions, AcsCredentialsCreateResponse, AcsCredentialsDeleteBody, AcsCredentialsDeleteOptions, AcsCredentialsDeleteResponse, AcsCredentialsGetOptions, AcsCredentialsGetParams, AcsCredentialsGetResponse, AcsCredentialsListOptions, AcsCredentialsListParams, AcsCredentialsListResponse, AcsCredentialsUnassignBody, AcsCredentialsUnassignOptions, AcsCredentialsUnassignResponse, AcsSystemsGetOptions, AcsSystemsGetParams, AcsSystemsGetResponse, AcsSystemsListOptions, AcsSystemsListParams, AcsSystemsListResponse, AcsUsersAddToAccessGroupBody, AcsUsersAddToAccessGroupOptions, AcsUsersAddToAccessGroupResponse, AcsUsersCreateBody, AcsUsersCreateOptions, AcsUsersCreateResponse, AcsUsersDeleteBody, AcsUsersDeleteOptions, AcsUsersDeleteResponse, AcsUsersGetOptions, AcsUsersGetParams, AcsUsersGetResponse, AcsUsersListOptions, AcsUsersListParams, AcsUsersListResponse, AcsUsersRemoveFromAccessGroupBody, AcsUsersRemoveFromAccessGroupOptions, AcsUsersRemoveFromAccessGroupResponse, AcsUsersSuspendBody, AcsUsersSuspendOptions, AcsUsersSuspendResponse, AcsUsersUnsuspendBody, AcsUsersUnsuspendOptions, AcsUsersUnsuspendResponse, AcsUsersUpdateBody, AcsUsersUpdateOptions, AcsUsersUpdateResponse, ActionAttemptsGetOptions, ActionAttemptsGetParams, ActionAttemptsGetResponse, ActionAttemptsListOptions, ActionAttemptsListParams, ActionAttemptsListResponse, ClientSessionsCreateBody, ClientSessionsCreateOptions, ClientSessionsCreateResponse, ClientSessionsDeleteBody, ClientSessionsDeleteOptions, ClientSessionsDeleteResponse, ClientSessionsGetOptions, ClientSessionsGetOrCreateBody, ClientSessionsGetOrCreateOptions, ClientSessionsGetOrCreateResponse, ClientSessionsGetParams, ClientSessionsGetResponse, ClientSessionsGrantAccessBody, ClientSessionsGrantAccessOptions, ClientSessionsGrantAccessResponse, ClientSessionsListOptions, ClientSessionsListParams, ClientSessionsListResponse, ClientSessionsRevokeBody, ClientSessionsRevokeOptions, ClientSessionsRevokeResponse, ConnectWebviewsCreateBody, ConnectWebviewsCreateOptions, ConnectWebviewsCreateResponse, ConnectWebviewsDeleteBody, ConnectWebviewsDeleteOptions, ConnectWebviewsDeleteResponse, ConnectWebviewsGetOptions, ConnectWebviewsGetParams, ConnectWebviewsGetResponse, ConnectWebviewsListOptions, ConnectWebviewsListParams, ConnectWebviewsListResponse, ConnectWebviewsViewOptions, ConnectWebviewsViewParams, ConnectWebviewsViewResponse, ConnectedAccountsDeleteBody, ConnectedAccountsDeleteOptions, ConnectedAccountsDeleteResponse, ConnectedAccountsGetOptions, ConnectedAccountsGetParams, ConnectedAccountsGetResponse, ConnectedAccountsListOptions, ConnectedAccountsListParams, ConnectedAccountsListResponse, DevicesDeleteBody, DevicesDeleteOptions, DevicesDeleteResponse, DevicesGetOptions, DevicesGetParams, DevicesGetResponse, DevicesListDeviceProvidersOptions, DevicesListDeviceProvidersParams, DevicesListDeviceProvidersResponse, DevicesListOptions, DevicesListParams, DevicesListResponse, DevicesUnmanagedGetOptions, DevicesUnmanagedGetParams, DevicesUnmanagedGetResponse, DevicesUnmanagedListOptions, DevicesUnmanagedListParams, DevicesUnmanagedListResponse, DevicesUnmanagedUpdateBody, DevicesUnmanagedUpdateOptions, DevicesUnmanagedUpdateResponse, DevicesUpdateBody, DevicesUpdateOptions, DevicesUpdateResponse, EventsGetOptions, EventsGetParams, EventsGetResponse, EventsListOptions, EventsListParams, EventsListResponse, LocksGetOptions, LocksGetParams, LocksGetResponse, LocksListOptions, LocksListParams, LocksListResponse, LocksLockDoorBody, LocksLockDoorOptions, LocksLockDoorResponse, LocksUnlockDoorBody, LocksUnlockDoorOptions, LocksUnlockDoorResponse, NoiseSensorsNoiseThresholdsCreateBody, NoiseSensorsNoiseThresholdsCreateOptions, NoiseSensorsNoiseThresholdsCreateResponse, NoiseSensorsNoiseThresholdsDeleteBody, NoiseSensorsNoiseThresholdsDeleteOptions, NoiseSensorsNoiseThresholdsDeleteResponse, NoiseSensorsNoiseThresholdsGetOptions, NoiseSensorsNoiseThresholdsGetParams, NoiseSensorsNoiseThresholdsGetResponse, NoiseSensorsNoiseThresholdsListOptions, NoiseSensorsNoiseThresholdsListParams, NoiseSensorsNoiseThresholdsListResponse, NoiseSensorsNoiseThresholdsUpdateBody, NoiseSensorsNoiseThresholdsUpdateOptions, NoiseSensorsNoiseThresholdsUpdateResponse, SeamActionAttemptError, SeamActionAttemptFailedError, SeamActionAttemptTimeoutError, SeamHttp, SeamHttpAccessCodes, SeamHttpAccessCodesUnmanaged, SeamHttpAcs, SeamHttpAcsAccessGroups, SeamHttpAcsCredentials, SeamHttpAcsSystems, SeamHttpAcsUsers, SeamHttpActionAttempts, SeamHttpApiError, SeamHttpClientSessions, SeamHttpConnectWebviews, SeamHttpConnectedAccounts, SeamHttpDevices, SeamHttpDevicesUnmanaged, SeamHttpEvents, SeamHttpFromPublishableKeyOptions, SeamHttpInvalidInputError, SeamHttpInvalidOptionsError, SeamHttpInvalidTokenError, SeamHttpLocks, SeamHttpMultiWorkspace, SeamHttpMultiWorkspaceInvalidOptionsError, SeamHttpMultiWorkspaceOptions, SeamHttpMultiWorkspaceOptionsWithClient, SeamHttpMultiWorkspaceOptionsWithConsoleSessionToken, SeamHttpMultiWorkspaceOptionsWithPersonalAccessToken, SeamHttpNoiseSensors, SeamHttpNoiseSensorsNoiseThresholds, SeamHttpOptions, SeamHttpOptionsFromEnv, SeamHttpOptionsWithApiKey, SeamHttpOptionsWithClient, SeamHttpOptionsWithClientSessionToken, SeamHttpOptionsWithConsoleSessionToken, SeamHttpOptionsWithPersonalAccessToken, SeamHttpRequestOptions, SeamHttpThermostats, SeamHttpThermostatsClimateSettingSchedules, SeamHttpUnauthorizedError, SeamHttpUserIdentities, SeamHttpWebhooks, SeamHttpWorkspaces, ThermostatsClimateSettingSchedulesCreateBody, ThermostatsClimateSettingSchedulesCreateOptions, ThermostatsClimateSettingSchedulesCreateResponse, ThermostatsClimateSettingSchedulesDeleteBody, ThermostatsClimateSettingSchedulesDeleteOptions, ThermostatsClimateSettingSchedulesDeleteResponse, ThermostatsClimateSettingSchedulesGetOptions, ThermostatsClimateSettingSchedulesGetParams, ThermostatsClimateSettingSchedulesGetResponse, ThermostatsClimateSettingSchedulesListOptions, ThermostatsClimateSettingSchedulesListParams, ThermostatsClimateSettingSchedulesListResponse, ThermostatsClimateSettingSchedulesUpdateBody, ThermostatsClimateSettingSchedulesUpdateOptions, ThermostatsClimateSettingSchedulesUpdateResponse, ThermostatsCoolBody, ThermostatsCoolOptions, ThermostatsCoolResponse, ThermostatsGetOptions, ThermostatsGetParams, ThermostatsGetResponse, ThermostatsHeatBody, ThermostatsHeatCoolBody, ThermostatsHeatCoolOptions, ThermostatsHeatCoolResponse, ThermostatsHeatOptions, ThermostatsHeatResponse, ThermostatsListOptions, ThermostatsListParams, ThermostatsListResponse, ThermostatsOffBody, ThermostatsOffOptions, ThermostatsOffResponse, ThermostatsSetFanModeBody, ThermostatsSetFanModeOptions, ThermostatsSetFanModeResponse, ThermostatsUpdateBody, ThermostatsUpdateOptions, ThermostatsUpdateResponse, UnserializableParamError, UserIdentitiesAddAcsUserBody, UserIdentitiesAddAcsUserOptions, UserIdentitiesAddAcsUserResponse, UserIdentitiesCreateBody, UserIdentitiesCreateOptions, UserIdentitiesCreateResponse, UserIdentitiesGetOptions, UserIdentitiesGetParams, UserIdentitiesGetResponse, UserIdentitiesGrantAccessToDeviceBody, UserIdentitiesGrantAccessToDeviceOptions, UserIdentitiesGrantAccessToDeviceResponse, UserIdentitiesListAccessibleDevicesOptions, UserIdentitiesListAccessibleDevicesParams, UserIdentitiesListAccessibleDevicesResponse, UserIdentitiesListAcsUsersOptions, UserIdentitiesListAcsUsersParams, UserIdentitiesListAcsUsersResponse, UserIdentitiesRemoveAcsUserBody, UserIdentitiesRemoveAcsUserOptions, UserIdentitiesRemoveAcsUserResponse, UserIdentitiesRevokeAccessToDeviceBody, UserIdentitiesRevokeAccessToDeviceOptions, UserIdentitiesRevokeAccessToDeviceResponse, WebhooksCreateBody, WebhooksCreateOptions, WebhooksCreateResponse, WebhooksDeleteBody, WebhooksDeleteOptions, WebhooksDeleteResponse, WebhooksGetOptions, WebhooksGetParams, WebhooksGetResponse, WebhooksListOptions, WebhooksListParams, WebhooksListResponse, WorkspacesGetOptions, WorkspacesGetParams, WorkspacesGetResponse, WorkspacesListOptions, WorkspacesListParams, WorkspacesListResponse, WorkspacesResetSandboxBody, WorkspacesResetSandboxOptions, WorkspacesResetSandboxResponse, errorInterceptor, isSeamActionAttemptError, isSeamActionAttemptFailedError, isSeamActionAttemptTimeoutError, isSeamHttpApiError, isSeamHttpInvalidInputError, isSeamHttpMultiWorkspaceOptionsWithClient, isSeamHttpMultiWorkspaceOptionsWithConsoleSessionToken, isSeamHttpMultiWorkspaceOptionsWithPersonalAccessToken, isSeamHttpOptionsWithApiKey, isSeamHttpOptionsWithClient, isSeamHttpOptionsWithClientSessionToken, isSeamHttpOptionsWithConsoleSessionToken, isSeamHttpOptionsWithPersonalAccessToken, isSeamHttpUnauthorizedError, paramsSerializer };
|
|
@@ -4,7 +4,6 @@ export type Client = AxiosInstance;
|
|
|
4
4
|
export interface ClientOptions {
|
|
5
5
|
axiosOptions?: AxiosRequestConfig;
|
|
6
6
|
axiosRetryOptions?: AxiosRetryConfig;
|
|
7
|
-
client?: Client;
|
|
8
7
|
}
|
|
9
8
|
type AxiosRetryConfig = Parameters<AxiosRetry>[1];
|
|
10
9
|
export declare const createClient: (options: ClientOptions) => AxiosInstance;
|
|
@@ -5,8 +5,6 @@ import axiosRetry, { exponentialDelay } from 'axios-retry';
|
|
|
5
5
|
import { paramsSerializer } from '../../../lib/params-serializer.js';
|
|
6
6
|
import { errorInterceptor } from './error-interceptor.js';
|
|
7
7
|
export const createClient = (options) => {
|
|
8
|
-
if (options.client != null)
|
|
9
|
-
return options.client;
|
|
10
8
|
const client = axios.create({
|
|
11
9
|
paramsSerializer,
|
|
12
10
|
...options.axiosOptions,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/lib/seam/connect/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA+C,MAAM,OAAO,CAAA;AAC1E,+EAA+E;AAC/E,OAAO,qBAAqB,MAAM,yBAAyB,CAAA;AAC3D,OAAO,UAAU,EAAE,EAAmB,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAE3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAE3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/lib/seam/connect/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA+C,MAAM,OAAO,CAAA;AAC1E,+EAA+E;AAC/E,OAAO,qBAAqB,MAAM,yBAAyB,CAAA;AAC3D,OAAO,UAAU,EAAE,EAAmB,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAE3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAE3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAWzD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAsB,EAAiB,EAAE;IACpE,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAC1B,gBAAgB;QAChB,GAAG,OAAO,CAAC,YAAY;KACxB,CAAC,CAAA;IAEF,qBAAqB,CAAC,KAAK,CAAC,CAAA;IAE5B,sEAAsE;IACtE,UAAU,CAAC,MAAM,EAAE;QACjB,OAAO,EAAE,CAAC;QACV,UAAU,EAAE,gBAAgB;QAC5B,GAAG,OAAO,CAAC,iBAAiB;KAC7B,CAAC,CAAA;IAEF,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAA;IAE7D,OAAO,MAAM,CAAA;AACf,CAAC,CAAA"}
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import type { Client, ClientOptions } from './client.js';
|
|
2
|
+
import type { ResolveActionAttemptOptions } from './resolve-action-attempt.js';
|
|
2
3
|
export type SeamHttpMultiWorkspaceOptions = SeamHttpMultiWorkspaceOptionsWithClient | SeamHttpMultiWorkspaceOptionsWithConsoleSessionToken | SeamHttpMultiWorkspaceOptionsWithPersonalAccessToken;
|
|
3
4
|
export type SeamHttpOptions = SeamHttpOptionsFromEnv | SeamHttpOptionsWithClient | SeamHttpOptionsWithApiKey | SeamHttpOptionsWithClientSessionToken | SeamHttpOptionsWithConsoleSessionToken | SeamHttpOptionsWithPersonalAccessToken;
|
|
4
|
-
interface SeamHttpCommonOptions extends ClientOptions {
|
|
5
|
+
interface SeamHttpCommonOptions extends ClientOptions, SeamHttpRequestOptions {
|
|
5
6
|
endpoint?: string;
|
|
6
7
|
}
|
|
8
|
+
export interface SeamHttpRequestOptions {
|
|
9
|
+
waitForActionAttempt?: boolean | ResolveActionAttemptOptions;
|
|
10
|
+
}
|
|
7
11
|
export interface SeamHttpFromPublishableKeyOptions extends SeamHttpCommonOptions {
|
|
8
12
|
}
|
|
9
13
|
export interface SeamHttpOptionsFromEnv extends SeamHttpCommonOptions {
|
|
10
14
|
}
|
|
11
|
-
export interface SeamHttpMultiWorkspaceOptionsWithClient {
|
|
15
|
+
export interface SeamHttpMultiWorkspaceOptionsWithClient extends SeamHttpRequestOptions {
|
|
12
16
|
client: Client;
|
|
13
17
|
}
|
|
14
18
|
export declare const isSeamHttpMultiWorkspaceOptionsWithClient: (options: SeamHttpOptions) => options is SeamHttpMultiWorkspaceOptionsWithClient;
|
|
15
|
-
export interface SeamHttpOptionsWithClient {
|
|
19
|
+
export interface SeamHttpOptionsWithClient extends SeamHttpRequestOptions {
|
|
16
20
|
client: Client;
|
|
17
21
|
}
|
|
18
22
|
export declare const isSeamHttpOptionsWithClient: (options: SeamHttpOptions) => options is SeamHttpOptionsWithClient;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isSeamHttpRequestOption } from './parse-options.js';
|
|
1
2
|
export const isSeamHttpMultiWorkspaceOptionsWithClient = (options) => isSeamHttpOptionsWithClient(options);
|
|
2
3
|
export const isSeamHttpOptionsWithClient = (options) => {
|
|
3
4
|
if (!('client' in options))
|
|
@@ -5,7 +6,7 @@ export const isSeamHttpOptionsWithClient = (options) => {
|
|
|
5
6
|
if (options.client == null)
|
|
6
7
|
return false;
|
|
7
8
|
const keys = Object.keys(options).filter((k) => k !== 'client');
|
|
8
|
-
if (keys.length > 0) {
|
|
9
|
+
if (keys.filter((k) => !isSeamHttpRequestOption(k)).length > 0) {
|
|
9
10
|
throw new SeamHttpInvalidOptionsError(`The client option cannot be used with any other option, but received: ${keys.join(', ')}`);
|
|
10
11
|
}
|
|
11
12
|
return true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../src/lib/seam/connect/options.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../src/lib/seam/connect/options.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import type { ClientOptions } from './client.js';
|
|
2
|
-
import { type SeamHttpMultiWorkspaceOptions, type SeamHttpOptions } from './options.js';
|
|
1
|
+
import type { Client, ClientOptions } from './client.js';
|
|
2
|
+
import { type SeamHttpMultiWorkspaceOptions, type SeamHttpOptions, type SeamHttpRequestOptions } from './options.js';
|
|
3
3
|
export type Options = SeamHttpMultiWorkspaceOptions | (SeamHttpOptions & {
|
|
4
4
|
publishableKey?: string;
|
|
5
5
|
});
|
|
6
|
-
|
|
6
|
+
type ParsedOptions = Required<(ClientOptions | {
|
|
7
|
+
client: Client;
|
|
8
|
+
}) & SeamHttpRequestOptions>;
|
|
9
|
+
export declare const parseOptions: (apiKeyOrOptions: string | Options) => ParsedOptions;
|
|
10
|
+
export declare const limitToSeamHttpRequestOptions: (options: Required<SeamHttpRequestOptions>) => Required<SeamHttpRequestOptions>;
|
|
11
|
+
export declare const isSeamHttpRequestOption: (key: string) => key is "waitForActionAttempt";
|
|
12
|
+
export {};
|
|
@@ -13,6 +13,7 @@ export const parseOptions = (apiKeyOrOptions) => {
|
|
|
13
13
|
if (isSeamHttpMultiWorkspaceOptionsWithClient(options))
|
|
14
14
|
return options;
|
|
15
15
|
return {
|
|
16
|
+
...options,
|
|
16
17
|
axiosOptions: {
|
|
17
18
|
baseURL: options.endpoint ?? getEndpointFromEnv() ?? defaultEndpoint,
|
|
18
19
|
withCredentials: isSeamHttpOptionsWithClientSessionToken(options),
|
|
@@ -32,12 +33,20 @@ const getNormalizedOptions = (apiKeyOrOptions) => {
|
|
|
32
33
|
const options = typeof apiKeyOrOptions === 'string'
|
|
33
34
|
? { apiKey: apiKeyOrOptions }
|
|
34
35
|
: apiKeyOrOptions;
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
const requestOptions = {
|
|
37
|
+
waitForActionAttempt: options.waitForActionAttempt ?? false,
|
|
38
|
+
};
|
|
39
|
+
if (isSeamHttpOptionsWithClient(options)) {
|
|
40
|
+
return {
|
|
41
|
+
...options,
|
|
42
|
+
...requestOptions,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
37
45
|
const apiKey = 'apiKey' in options ? options.apiKey : getApiKeyFromEnv(options);
|
|
38
46
|
return {
|
|
39
47
|
...options,
|
|
40
48
|
...(apiKey != null ? { apiKey } : {}),
|
|
49
|
+
...requestOptions,
|
|
41
50
|
};
|
|
42
51
|
};
|
|
43
52
|
const getApiKeyFromEnv = (options) => {
|
|
@@ -50,4 +59,18 @@ const getEndpointFromEnv = () => {
|
|
|
50
59
|
return (globalThis.process?.env?.SEAM_ENDPOINT ??
|
|
51
60
|
globalThis.process?.env?.SEAM_API_URL);
|
|
52
61
|
};
|
|
62
|
+
export const limitToSeamHttpRequestOptions = (options) => {
|
|
63
|
+
return Object.keys(options)
|
|
64
|
+
.filter(isSeamHttpRequestOption)
|
|
65
|
+
.reduce((obj, key) => ({
|
|
66
|
+
...obj,
|
|
67
|
+
[key]: options[key],
|
|
68
|
+
}), {});
|
|
69
|
+
};
|
|
70
|
+
export const isSeamHttpRequestOption = (key) => {
|
|
71
|
+
const keys = {
|
|
72
|
+
waitForActionAttempt: true,
|
|
73
|
+
};
|
|
74
|
+
return Object.keys(keys).includes(key);
|
|
75
|
+
};
|
|
53
76
|
//# sourceMappingURL=parse-options.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-options.js","sourceRoot":"","sources":["../../../src/lib/seam/connect/parse-options.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,gBAAgB,CAAA;AAEpC,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAE1C,OAAO,EACL,yCAAyC,EACzC,2BAA2B,EAC3B,uCAAuC,
|
|
1
|
+
{"version":3,"file":"parse-options.js","sourceRoot":"","sources":["../../../src/lib/seam/connect/parse-options.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect';
|
|
2
2
|
import type { SetNonNullable } from 'type-fest';
|
|
3
3
|
import { type Client } from '../../../../lib/seam/connect/client.js';
|
|
4
|
-
import { type SeamHttpFromPublishableKeyOptions, type SeamHttpOptions, type SeamHttpOptionsWithApiKey, type SeamHttpOptionsWithClient, type SeamHttpOptionsWithClientSessionToken, type SeamHttpOptionsWithConsoleSessionToken, type SeamHttpOptionsWithPersonalAccessToken } from '../../../../lib/seam/connect/options.js';
|
|
4
|
+
import { type SeamHttpFromPublishableKeyOptions, type SeamHttpOptions, type SeamHttpOptionsWithApiKey, type SeamHttpOptionsWithClient, type SeamHttpOptionsWithClientSessionToken, type SeamHttpOptionsWithConsoleSessionToken, type SeamHttpOptionsWithPersonalAccessToken, type SeamHttpRequestOptions } from '../../../../lib/seam/connect/options.js';
|
|
5
5
|
export declare class SeamHttpAccessCodesUnmanaged {
|
|
6
6
|
client: Client;
|
|
7
|
+
readonly defaults: Required<SeamHttpRequestOptions>;
|
|
7
8
|
constructor(apiKeyOrOptions?: string | SeamHttpOptions);
|
|
8
9
|
static fromClient(client: SeamHttpOptionsWithClient['client'], options?: Omit<SeamHttpOptionsWithClient, 'client'>): SeamHttpAccessCodesUnmanaged;
|
|
9
10
|
static fromApiKey(apiKey: SeamHttpOptionsWithApiKey['apiKey'], options?: Omit<SeamHttpOptionsWithApiKey, 'apiKey'>): SeamHttpAccessCodesUnmanaged;
|
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
import { warnOnInsecureuserIdentifierKey } from '../../../../lib/seam/connect/auth.js';
|
|
6
6
|
import { createClient } from '../../../../lib/seam/connect/client.js';
|
|
7
7
|
import { isSeamHttpOptionsWithApiKey, isSeamHttpOptionsWithClient, isSeamHttpOptionsWithClientSessionToken, isSeamHttpOptionsWithConsoleSessionToken, isSeamHttpOptionsWithPersonalAccessToken, SeamHttpInvalidOptionsError, } from '../../../../lib/seam/connect/options.js';
|
|
8
|
-
import { parseOptions } from '../../../../lib/seam/connect/parse-options.js';
|
|
8
|
+
import { limitToSeamHttpRequestOptions, parseOptions, } from '../../../../lib/seam/connect/parse-options.js';
|
|
9
9
|
import { SeamHttpClientSessions } from './client-sessions.js';
|
|
10
10
|
export class SeamHttpAccessCodesUnmanaged {
|
|
11
11
|
constructor(apiKeyOrOptions = {}) {
|
|
12
|
-
const
|
|
13
|
-
this.client = createClient(
|
|
12
|
+
const options = parseOptions(apiKeyOrOptions);
|
|
13
|
+
this.client = 'client' in options ? options.client : createClient(options);
|
|
14
|
+
this.defaults = limitToSeamHttpRequestOptions(options);
|
|
14
15
|
}
|
|
15
16
|
static fromClient(client, options = {}) {
|
|
16
17
|
const constructorOptions = { ...options, client };
|
|
@@ -36,6 +37,9 @@ export class SeamHttpAccessCodesUnmanaged {
|
|
|
36
37
|
static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
|
|
37
38
|
warnOnInsecureuserIdentifierKey(userIdentifierKey);
|
|
38
39
|
const clientOptions = parseOptions({ ...options, publishableKey });
|
|
40
|
+
if (isSeamHttpOptionsWithClient(clientOptions)) {
|
|
41
|
+
throw new SeamHttpInvalidOptionsError('The client option cannot be used with SeamHttp.fromPublishableKey');
|
|
42
|
+
}
|
|
39
43
|
const client = createClient(clientOptions);
|
|
40
44
|
const clientSessions = SeamHttpClientSessions.fromClient(client);
|
|
41
45
|
const { token } = await clientSessions.getOrCreate({
|