@seamapi/http 1.0.0-rc.1 → 1.0.0-rc.2
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/LICENSE.txt +1 -1
- package/README.md +39 -33
- package/dist/connect.cjs +33 -67
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +995 -59
- package/lib/seam/connect/parse-options.js +1 -1
- package/lib/seam/connect/parse-options.js.map +1 -1
- package/lib/seam/connect/resolve-action-attempt.d.ts +1273 -5
- package/lib/seam/connect/resolve-action-attempt.js.map +1 -1
- package/lib/seam/connect/routes/access-codes-unmanaged.d.ts +2 -2
- package/lib/seam/connect/routes/access-codes-unmanaged.js.map +1 -1
- package/lib/seam/connect/routes/access-codes.d.ts +2 -2
- package/lib/seam/connect/routes/access-codes.js.map +1 -1
- package/lib/seam/connect/routes/acs-access-groups.d.ts +2 -2
- package/lib/seam/connect/routes/acs-access-groups.js.map +1 -1
- package/lib/seam/connect/routes/acs-credentials.d.ts +2 -2
- package/lib/seam/connect/routes/acs-credentials.js.map +1 -1
- package/lib/seam/connect/routes/acs-users.d.ts +6 -6
- package/lib/seam/connect/routes/acs-users.js.map +1 -1
- package/lib/seam/connect/routes/client-sessions.d.ts +4 -4
- package/lib/seam/connect/routes/client-sessions.js.map +1 -1
- package/lib/seam/connect/routes/connect-webviews.d.ts +2 -2
- package/lib/seam/connect/routes/connect-webviews.js.map +1 -1
- package/lib/seam/connect/routes/connected-accounts.d.ts +2 -2
- package/lib/seam/connect/routes/connected-accounts.js.map +1 -1
- package/lib/seam/connect/routes/devices-simulate.d.ts +2 -2
- package/lib/seam/connect/routes/devices-simulate.js.map +1 -1
- package/lib/seam/connect/routes/devices.d.ts +2 -2
- package/lib/seam/connect/routes/devices.js.map +1 -1
- package/lib/seam/connect/routes/noise-sensors-noise-thresholds.d.ts +2 -2
- package/lib/seam/connect/routes/noise-sensors-noise-thresholds.js.map +1 -1
- package/lib/seam/connect/routes/phones.d.ts +2 -2
- package/lib/seam/connect/routes/phones.js.map +1 -1
- package/lib/seam/connect/routes/thermostats-climate-setting-schedules.d.ts +2 -2
- package/lib/seam/connect/routes/thermostats-climate-setting-schedules.js.map +1 -1
- package/lib/seam/connect/routes/user-identities-enrollment-automations.d.ts +2 -2
- package/lib/seam/connect/routes/user-identities-enrollment-automations.js.map +1 -1
- package/lib/seam/connect/routes/user-identities.d.ts +6 -6
- package/lib/seam/connect/routes/user-identities.js.map +1 -1
- package/lib/seam/connect/routes/webhooks.d.ts +2 -2
- package/lib/seam/connect/routes/webhooks.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +6 -6
- package/src/lib/seam/connect/parse-options.ts +1 -1
- package/src/lib/seam/connect/resolve-action-attempt.ts +16 -9
- package/src/lib/seam/connect/routes/access-codes-unmanaged.ts +2 -2
- package/src/lib/seam/connect/routes/access-codes.ts +2 -2
- package/src/lib/seam/connect/routes/acs-access-groups.ts +2 -2
- package/src/lib/seam/connect/routes/acs-credentials.ts +2 -2
- package/src/lib/seam/connect/routes/acs-users.ts +6 -6
- package/src/lib/seam/connect/routes/client-sessions.ts +4 -4
- package/src/lib/seam/connect/routes/connect-webviews.ts +2 -2
- package/src/lib/seam/connect/routes/connected-accounts.ts +4 -2
- package/src/lib/seam/connect/routes/devices-simulate.ts +2 -2
- package/src/lib/seam/connect/routes/devices.ts +2 -2
- package/src/lib/seam/connect/routes/noise-sensors-noise-thresholds.ts +2 -2
- package/src/lib/seam/connect/routes/phones.ts +2 -2
- package/src/lib/seam/connect/routes/thermostats-climate-setting-schedules.ts +2 -2
- package/src/lib/seam/connect/routes/user-identities-enrollment-automations.ts +2 -2
- package/src/lib/seam/connect/routes/user-identities.ts +6 -6
- package/src/lib/seam/connect/routes/webhooks.ts +2 -2
- package/src/lib/version.ts +1 -1
- package/lib/seam/connect/action-attempt-types.d.ts +0 -17
- package/lib/seam/connect/action-attempt-types.js +0 -3
- package/lib/seam/connect/action-attempt-types.js.map +0 -1
- package/src/lib/seam/connect/action-attempt-types.ts +0 -22
package/LICENSE.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2021-
|
|
3
|
+
Copyright (c) 2021-2024 Seam Labs, Inc.
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
6
|
this software and associated documentation files (the "Software"), to deal in
|
package/README.md
CHANGED
|
@@ -170,7 +170,7 @@ or create a new empty client session.
|
|
|
170
170
|
|
|
171
171
|
A Personal Access Token is scoped to a Seam Console user.
|
|
172
172
|
Obtain one from the Seam Console.
|
|
173
|
-
A workspace
|
|
173
|
+
A workspace ID must be provided when using this method
|
|
174
174
|
and all requests will be scoped to that workspace.
|
|
175
175
|
|
|
176
176
|
```ts
|
|
@@ -192,7 +192,7 @@ const seam = SeamHttp.fromPersonalAccessToken(
|
|
|
192
192
|
|
|
193
193
|
A Console Session Token is used by the Seam Console.
|
|
194
194
|
This authentication method is only used by internal Seam applications.
|
|
195
|
-
A workspace
|
|
195
|
+
A workspace ID must be provided when using this method
|
|
196
196
|
and all requests will be scoped to that workspace.
|
|
197
197
|
|
|
198
198
|
```ts
|
|
@@ -212,53 +212,62 @@ const seam = SeamHttp.fromConsoleSessionToken(
|
|
|
212
212
|
### Action Attempts
|
|
213
213
|
|
|
214
214
|
Some asynchronous operations, e.g., unlocking a door, return an [action attempt].
|
|
215
|
-
Seam tracks the progress of requested operation and updates the action attempt
|
|
215
|
+
Seam tracks the progress of the requested operation and updates the action attempt
|
|
216
|
+
when it succeeds or fails.
|
|
216
217
|
|
|
217
218
|
To make working with action attempts more convenient for applications,
|
|
218
|
-
this library provides the `waitForActionAttempt` option.
|
|
219
|
+
this library provides the `waitForActionAttempt` option and enables it by default.
|
|
219
220
|
|
|
220
|
-
|
|
221
|
+
When the `waitForActionAttempt` option is enabled, the SDK:
|
|
222
|
+
|
|
223
|
+
- Polls the action attempt up to the `timeout`
|
|
224
|
+
at the `pollingInterval` (both in milliseconds).
|
|
225
|
+
- Resolves with a fresh copy of the successful action attempt.
|
|
226
|
+
- Rejects with a `SeamActionAttemptFailedError` if the action attempt is unsuccessful.
|
|
227
|
+
- Rejects with a `SeamActionAttemptTimeoutError` if the action attempt is still pending when the `timeout` is reached.
|
|
228
|
+
- Both errors expose an `actionAttempt` property.
|
|
229
|
+
|
|
230
|
+
If you already have an action attempt ID
|
|
231
|
+
and want to wait for it to resolve, simply use
|
|
221
232
|
|
|
222
233
|
```ts
|
|
223
|
-
await seam.
|
|
224
|
-
|
|
234
|
+
await seam.actionAttempts.get({ action_attempt_id })
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Or, to get the current state of an action attempt by ID without waiting,
|
|
238
|
+
|
|
239
|
+
```ts
|
|
240
|
+
await seam.actionAttempts.get(
|
|
241
|
+
{ action_attempt_id },
|
|
225
242
|
{
|
|
226
|
-
waitForActionAttempt:
|
|
243
|
+
waitForActionAttempt: false,
|
|
227
244
|
},
|
|
228
245
|
)
|
|
229
246
|
```
|
|
230
247
|
|
|
231
|
-
|
|
248
|
+
To disable this behavior, set the default option for the client,
|
|
232
249
|
|
|
233
250
|
```ts
|
|
234
251
|
const seam = new SeamHttp({
|
|
235
252
|
apiKey: 'your-api-key',
|
|
236
|
-
waitForActionAttempt:
|
|
253
|
+
waitForActionAttempt: false,
|
|
237
254
|
})
|
|
238
255
|
|
|
239
256
|
await seam.locks.unlockDoor({ device_id })
|
|
240
257
|
```
|
|
241
258
|
|
|
242
|
-
|
|
243
|
-
and want to wait for it to resolve, simply use
|
|
259
|
+
or the behavior may be configured per-request,
|
|
244
260
|
|
|
245
261
|
```ts
|
|
246
|
-
await seam.
|
|
247
|
-
{
|
|
262
|
+
await seam.locks.unlockDoor(
|
|
263
|
+
{ device_id },
|
|
248
264
|
{
|
|
249
|
-
waitForActionAttempt:
|
|
265
|
+
waitForActionAttempt: false,
|
|
250
266
|
},
|
|
251
267
|
)
|
|
252
268
|
```
|
|
253
269
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
- Polls the action attempt up to the `timeout`
|
|
257
|
-
at the `pollingInterval` (both in milliseconds).
|
|
258
|
-
- Resolves with a fresh copy of the successful action attempt.
|
|
259
|
-
- Rejects with a `SeamActionAttemptFailedError` if the action attempt is unsuccessful.
|
|
260
|
-
- Rejects with a `SeamActionAttemptTimeoutError` if the action attempt is still pending when the `timeout` is reached.
|
|
261
|
-
- Both errors expose an `actionAttempt` property.
|
|
270
|
+
The `pollingInterval` and `timeout` may be configured for the client or per-request, for example
|
|
262
271
|
|
|
263
272
|
```ts
|
|
264
273
|
import {
|
|
@@ -267,22 +276,19 @@ import {
|
|
|
267
276
|
isSeamActionAttemptTimeoutError,
|
|
268
277
|
} from '@seamapi/http/connect'
|
|
269
278
|
|
|
270
|
-
const seam = new SeamHttp('your-api-key'
|
|
279
|
+
const seam = new SeamHttp('your-api-key', {
|
|
280
|
+
waitForActionAttempt: {
|
|
281
|
+
pollingInterval: 1000,
|
|
282
|
+
timeout: 5000,
|
|
283
|
+
},
|
|
284
|
+
})
|
|
271
285
|
|
|
272
286
|
const [lock] = await seam.locks.list()
|
|
273
287
|
|
|
274
288
|
if (lock == null) throw new Error('No locks in this workspace')
|
|
275
289
|
|
|
276
290
|
try {
|
|
277
|
-
await seam.locks.unlockDoor(
|
|
278
|
-
{ device_id: lock.device_id },
|
|
279
|
-
{
|
|
280
|
-
waitForActionAttempt: {
|
|
281
|
-
pollingInterval: 1000,
|
|
282
|
-
timeout: 5000,
|
|
283
|
-
},
|
|
284
|
-
},
|
|
285
|
-
)
|
|
291
|
+
await seam.locks.unlockDoor({ device_id: lock.device_id })
|
|
286
292
|
console.log('Door unlocked')
|
|
287
293
|
} catch (err: unknown) {
|
|
288
294
|
if (isSeamActionAttemptFailedError(err)) {
|
package/dist/connect.cjs
CHANGED
|
@@ -11,24 +11,13 @@ var axios__default = /*#__PURE__*/_interopDefault(axios);
|
|
|
11
11
|
var axiosBetterStacktrace__default = /*#__PURE__*/_interopDefault(axiosBetterStacktrace);
|
|
12
12
|
var axiosRetry__default = /*#__PURE__*/_interopDefault(axiosRetry);
|
|
13
13
|
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
throw TypeError("Cannot " + msg);
|
|
17
|
-
};
|
|
18
|
-
var __privateGet = (obj, member, getter) => {
|
|
19
|
-
__accessCheck(obj, member, "read from private field");
|
|
20
|
-
return getter ? getter.call(obj) : member.get(obj);
|
|
21
|
-
};
|
|
22
|
-
var __privateAdd = (obj, member, value) => {
|
|
23
|
-
if (member.has(obj))
|
|
24
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
25
|
-
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
26
|
-
};
|
|
27
|
-
var __privateSet = (obj, member, value, setter) => {
|
|
28
|
-
__accessCheck(obj, member, "write to private field");
|
|
29
|
-
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
30
|
-
return value;
|
|
14
|
+
var __typeError = (msg) => {
|
|
15
|
+
throw TypeError(msg);
|
|
31
16
|
};
|
|
17
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
18
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
19
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
20
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
|
|
32
21
|
|
|
33
22
|
// src/lib/lts-version.ts
|
|
34
23
|
var seamApiLtsVersion = "1.0.0";
|
|
@@ -46,10 +35,8 @@ var sdkHeaders = {
|
|
|
46
35
|
};
|
|
47
36
|
var parseOptions = (apiKeyOrOptions) => {
|
|
48
37
|
const options = getNormalizedOptions(apiKeyOrOptions);
|
|
49
|
-
if (isSeamHttpOptionsWithClient(options))
|
|
50
|
-
|
|
51
|
-
if (isSeamHttpMultiWorkspaceOptionsWithClient(options))
|
|
52
|
-
return options;
|
|
38
|
+
if (isSeamHttpOptionsWithClient(options)) return options;
|
|
39
|
+
if (isSeamHttpMultiWorkspaceOptionsWithClient(options)) return options;
|
|
53
40
|
return {
|
|
54
41
|
...options,
|
|
55
42
|
axiosOptions: {
|
|
@@ -70,7 +57,7 @@ var parseOptions = (apiKeyOrOptions) => {
|
|
|
70
57
|
var getNormalizedOptions = (apiKeyOrOptions) => {
|
|
71
58
|
const options = typeof apiKeyOrOptions === "string" ? { apiKey: apiKeyOrOptions } : apiKeyOrOptions;
|
|
72
59
|
const requestOptions = {
|
|
73
|
-
waitForActionAttempt: options.waitForActionAttempt ??
|
|
60
|
+
waitForActionAttempt: options.waitForActionAttempt ?? true
|
|
74
61
|
};
|
|
75
62
|
if (isSeamHttpOptionsWithClient(options)) {
|
|
76
63
|
return {
|
|
@@ -129,10 +116,8 @@ var isSeamHttpRequestOption = (key) => {
|
|
|
129
116
|
// src/lib/seam/connect/options.ts
|
|
130
117
|
var isSeamHttpMultiWorkspaceOptionsWithClient = (options) => isSeamHttpOptionsWithClient(options);
|
|
131
118
|
var isSeamHttpOptionsWithClient = (options) => {
|
|
132
|
-
if (!("client" in options))
|
|
133
|
-
|
|
134
|
-
if (options.client == null)
|
|
135
|
-
return false;
|
|
119
|
+
if (!("client" in options)) return false;
|
|
120
|
+
if (options.client == null) return false;
|
|
136
121
|
const keys = Object.keys(options).filter((k) => k !== "client");
|
|
137
122
|
if (keys.filter((k) => !isSeamHttpRequestOption(k)).length > 0) {
|
|
138
123
|
throw new SeamHttpInvalidOptionsError(
|
|
@@ -144,10 +129,8 @@ var isSeamHttpOptionsWithClient = (options) => {
|
|
|
144
129
|
return true;
|
|
145
130
|
};
|
|
146
131
|
var isSeamHttpOptionsWithApiKey = (options) => {
|
|
147
|
-
if (!("apiKey" in options))
|
|
148
|
-
|
|
149
|
-
if (options.apiKey == null)
|
|
150
|
-
return false;
|
|
132
|
+
if (!("apiKey" in options)) return false;
|
|
133
|
+
if (options.apiKey == null) return false;
|
|
151
134
|
if ("clientSessionToken" in options && options.clientSessionToken != null) {
|
|
152
135
|
throw new SeamHttpInvalidOptionsError(
|
|
153
136
|
"The clientSessionToken option cannot be used with the apiKey option"
|
|
@@ -166,10 +149,8 @@ var isSeamHttpOptionsWithApiKey = (options) => {
|
|
|
166
149
|
return true;
|
|
167
150
|
};
|
|
168
151
|
var isSeamHttpOptionsWithClientSessionToken = (options) => {
|
|
169
|
-
if (!("clientSessionToken" in options))
|
|
170
|
-
|
|
171
|
-
if (options.clientSessionToken == null)
|
|
172
|
-
return false;
|
|
152
|
+
if (!("clientSessionToken" in options)) return false;
|
|
153
|
+
if (options.clientSessionToken == null) return false;
|
|
173
154
|
if ("apiKey" in options && options.apiKey != null) {
|
|
174
155
|
throw new SeamHttpInvalidOptionsError(
|
|
175
156
|
"The apiKey option cannot be used with the clientSessionToken option"
|
|
@@ -188,10 +169,8 @@ var isSeamHttpOptionsWithClientSessionToken = (options) => {
|
|
|
188
169
|
return true;
|
|
189
170
|
};
|
|
190
171
|
var isSeamHttpMultiWorkspaceOptionsWithConsoleSessionToken = (options) => {
|
|
191
|
-
if (!("consoleSessionToken" in options))
|
|
192
|
-
|
|
193
|
-
if (options.consoleSessionToken == null)
|
|
194
|
-
return false;
|
|
172
|
+
if (!("consoleSessionToken" in options)) return false;
|
|
173
|
+
if (options.consoleSessionToken == null) return false;
|
|
195
174
|
if ("apiKey" in options && options.apiKey != null) {
|
|
196
175
|
throw new SeamHttpInvalidOptionsError(
|
|
197
176
|
"The apiKey option cannot be used with the consoleSessionToken option"
|
|
@@ -221,10 +200,8 @@ var isSeamHttpOptionsWithConsoleSessionToken = (options) => {
|
|
|
221
200
|
return true;
|
|
222
201
|
};
|
|
223
202
|
var isSeamHttpMultiWorkspaceOptionsWithPersonalAccessToken = (options) => {
|
|
224
|
-
if (!("personalAccessToken" in options))
|
|
225
|
-
|
|
226
|
-
if (options.personalAccessToken == null)
|
|
227
|
-
return false;
|
|
203
|
+
if (!("personalAccessToken" in options)) return false;
|
|
204
|
+
if (options.personalAccessToken == null) return false;
|
|
228
205
|
if ("apiKey" in options && options.apiKey != null) {
|
|
229
206
|
throw new SeamHttpInvalidOptionsError(
|
|
230
207
|
"The apiKey option cannot be used with the personalAccessToken option"
|
|
@@ -479,8 +456,7 @@ var SeamHttpApiError = class extends Error {
|
|
|
479
456
|
this.code = type;
|
|
480
457
|
this.statusCode = statusCode;
|
|
481
458
|
this.requestId = requestId;
|
|
482
|
-
if (data != null)
|
|
483
|
-
this.data = data;
|
|
459
|
+
if (data != null) this.data = data;
|
|
484
460
|
}
|
|
485
461
|
};
|
|
486
462
|
var isSeamHttpApiError = (error) => {
|
|
@@ -513,30 +489,24 @@ var isSeamHttpInvalidInputError = (error) => {
|
|
|
513
489
|
|
|
514
490
|
// src/lib/seam/connect/error-interceptor.ts
|
|
515
491
|
var errorInterceptor = async (err) => {
|
|
516
|
-
if (!axios.isAxiosError(err))
|
|
517
|
-
throw err;
|
|
492
|
+
if (!axios.isAxiosError(err)) throw err;
|
|
518
493
|
const { response } = err;
|
|
519
494
|
const status = response?.status;
|
|
520
495
|
const requestId = getRequestId(err);
|
|
521
|
-
if (status == null)
|
|
522
|
-
throw err;
|
|
496
|
+
if (status == null) throw err;
|
|
523
497
|
if (status === 401) {
|
|
524
498
|
throw new SeamHttpUnauthorizedError(requestId);
|
|
525
499
|
}
|
|
526
|
-
if (!isApiErrorResponse(response))
|
|
527
|
-
throw err;
|
|
500
|
+
if (!isApiErrorResponse(response)) throw err;
|
|
528
501
|
const { type } = response.data.error;
|
|
529
502
|
const args = [response.data.error, status, requestId];
|
|
530
|
-
if (type === "invalid_input")
|
|
531
|
-
throw new SeamHttpInvalidInputError(...args);
|
|
503
|
+
if (type === "invalid_input") throw new SeamHttpInvalidInputError(...args);
|
|
532
504
|
throw new SeamHttpApiError(...args);
|
|
533
505
|
};
|
|
534
506
|
var isApiErrorResponse = (response) => {
|
|
535
|
-
if (response == null)
|
|
536
|
-
return false;
|
|
507
|
+
if (response == null) return false;
|
|
537
508
|
const { headers, data } = response;
|
|
538
|
-
if (headers == null)
|
|
539
|
-
return false;
|
|
509
|
+
if (headers == null) return false;
|
|
540
510
|
const contentType = headers["Content-Type"];
|
|
541
511
|
if (typeof contentType === "string" && !contentType.startsWith("application/json")) {
|
|
542
512
|
return false;
|
|
@@ -548,11 +518,9 @@ var isApiErrorResponse = (response) => {
|
|
|
548
518
|
};
|
|
549
519
|
var getRequestId = (err) => {
|
|
550
520
|
const headers = err.response?.headers;
|
|
551
|
-
if (headers == null)
|
|
552
|
-
return "";
|
|
521
|
+
if (headers == null) return "";
|
|
553
522
|
const requestId = headers["seam-request-id"];
|
|
554
|
-
if (requestId == null)
|
|
555
|
-
return "";
|
|
523
|
+
if (requestId == null) return "";
|
|
556
524
|
return requestId;
|
|
557
525
|
};
|
|
558
526
|
var createClient = (options) => {
|
|
@@ -598,8 +566,7 @@ var resolveActionAttempt = async (actionAttempt, actionAttempts, { timeout = 5e3
|
|
|
598
566
|
timeoutPromise
|
|
599
567
|
]);
|
|
600
568
|
} finally {
|
|
601
|
-
if (timeoutRef != null)
|
|
602
|
-
globalThis.clearTimeout(timeoutRef);
|
|
569
|
+
if (timeoutRef != null) globalThis.clearTimeout(timeoutRef);
|
|
603
570
|
}
|
|
604
571
|
};
|
|
605
572
|
var pollActionAttempt = async (actionAttempt, actionAttempts, options) => {
|
|
@@ -654,11 +621,12 @@ var SeamActionAttemptTimeoutError = class extends SeamActionAttemptError {
|
|
|
654
621
|
var isSuccessfulActionAttempt = (actionAttempt) => actionAttempt.status === "success";
|
|
655
622
|
var isFailedActionAttempt = (actionAttempt) => actionAttempt.status === "error";
|
|
656
623
|
var _a, _parent, _config;
|
|
624
|
+
_a = Symbol.toStringTag;
|
|
657
625
|
var SeamHttpRequest = class {
|
|
658
626
|
constructor(parent, config) {
|
|
659
627
|
this[_a] = "SeamHttpRequest";
|
|
660
|
-
__privateAdd(this, _parent
|
|
661
|
-
__privateAdd(this, _config
|
|
628
|
+
__privateAdd(this, _parent);
|
|
629
|
+
__privateAdd(this, _config);
|
|
662
630
|
__privateSet(this, _parent, parent);
|
|
663
631
|
__privateSet(this, _config, config);
|
|
664
632
|
}
|
|
@@ -717,14 +685,12 @@ var SeamHttpRequest = class {
|
|
|
717
685
|
return await this.execute().finally(onfinally);
|
|
718
686
|
}
|
|
719
687
|
};
|
|
720
|
-
_a = Symbol.toStringTag;
|
|
721
688
|
_parent = new WeakMap();
|
|
722
689
|
_config = new WeakMap();
|
|
723
690
|
var getUrlPrefix = (input) => {
|
|
724
691
|
if (canParseUrl(input)) {
|
|
725
692
|
const url = new URL(input).toString();
|
|
726
|
-
if (url.endsWith("/"))
|
|
727
|
-
return url.slice(0, -1);
|
|
693
|
+
if (url.endsWith("/")) return url.slice(0, -1);
|
|
728
694
|
return url;
|
|
729
695
|
}
|
|
730
696
|
if (globalThis.location != null) {
|