@seamapi/http 0.14.0 → 0.14.1
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 +3 -3
- package/dist/connect.cjs +27 -16
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +11 -11
- package/lib/seam/connect/parse-options.js +9 -0
- package/lib/seam/connect/parse-options.js.map +1 -1
- package/lib/seam/connect/routes/connected-accounts.d.ts +3 -3
- package/lib/seam/connect/routes/connected-accounts.js +3 -3
- package/lib/seam/connect/routes/connected-accounts.js.map +1 -1
- package/lib/seam/connect/routes/noise-sensors-noise-thresholds.d.ts +1 -1
- package/lib/seam/connect/routes/noise-sensors-noise-thresholds.js +2 -1
- package/lib/seam/connect/routes/noise-sensors-noise-thresholds.js.map +1 -1
- package/lib/seam/connect/routes/user-identities.d.ts +3 -3
- package/lib/seam/connect/routes/user-identities.js +3 -3
- package/lib/seam/connect/routes/user-identities.js.map +1 -1
- package/lib/seam/connect/routes/webhooks.d.ts +3 -3
- package/lib/seam/connect/routes/webhooks.js +3 -3
- package/lib/seam/connect/routes/webhooks.js.map +1 -1
- package/lib/seam/connect/routes/workspaces.d.ts +5 -5
- package/lib/seam/connect/routes/workspaces.js +6 -6
- package/lib/seam/connect/routes/workspaces.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/parse-options.ts +17 -0
- package/src/lib/seam/connect/routes/connected-accounts.ts +5 -9
- package/src/lib/seam/connect/routes/noise-sensors-noise-thresholds.ts +11 -6
- package/src/lib/seam/connect/routes/user-identities.ts +5 -10
- package/src/lib/seam/connect/routes/webhooks.ts +5 -9
- package/src/lib/seam/connect/routes/workspaces.ts +9 -13
- package/src/lib/version.ts +1 -1
package/README.md
CHANGED
|
@@ -22,7 +22,6 @@ The underlying HTTP client is [Axios].
|
|
|
22
22
|
|
|
23
23
|
[Seam]: https://www.seam.co/
|
|
24
24
|
[Seam Docs]: https://docs.seam.co/latest/
|
|
25
|
-
[seamapi]: https://www.npmjs.com/package/seamapi
|
|
26
25
|
[@seamapi/types]: https://github.com/seamapi/types/
|
|
27
26
|
[Axios]: https://axios-http.com/
|
|
28
27
|
|
|
@@ -30,7 +29,7 @@ The underlying HTTP client is [Axios].
|
|
|
30
29
|
|
|
31
30
|
_This is a low-level package meant for applications and libraries with particular dependency requirements.
|
|
32
31
|
Before using this package, ensure you understand the installation and updating instructions.
|
|
33
|
-
This SDK is entirely contained in the [
|
|
32
|
+
This SDK is entirely contained in the [seam package]. Seam recommends using that package instead
|
|
34
33
|
for simpler dependency management._
|
|
35
34
|
|
|
36
35
|
Add this as a dependency to your project using [npm] with
|
|
@@ -40,6 +39,7 @@ $ npm install @seamapi/http
|
|
|
40
39
|
```
|
|
41
40
|
|
|
42
41
|
[npm]: https://www.npmjs.com/
|
|
42
|
+
[seam package]: https://www.npmjs.com/package/seam
|
|
43
43
|
|
|
44
44
|
### Optional Peer Dependencies for TypeScript
|
|
45
45
|
|
|
@@ -68,7 +68,7 @@ $ npm install -D @seamapi/types
|
|
|
68
68
|
and update them when consuming new API features with
|
|
69
69
|
|
|
70
70
|
```
|
|
71
|
-
$ npm install -D @seamapi/
|
|
71
|
+
$ npm install -D @seamapi/types
|
|
72
72
|
```
|
|
73
73
|
|
|
74
74
|
## Usage
|
package/dist/connect.cjs
CHANGED
|
@@ -75,6 +75,16 @@ var getApiKeyFromEnv = (options) => {
|
|
|
75
75
|
return globalThis.process?.env?.SEAM_API_KEY;
|
|
76
76
|
};
|
|
77
77
|
var getEndpointFromEnv = () => {
|
|
78
|
+
if (globalThis.process?.env?.SEAM_API_URL != null) {
|
|
79
|
+
console.warn(
|
|
80
|
+
"Using the SEAM_API_URL environment variable is deprecated. Support will be remove in a later major version. Use SEAM_ENDPOINT instead."
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
if (globalThis.process?.env?.SEAM_API_URL != null && globalThis.process?.env?.SEAM_ENDPOINT != null) {
|
|
84
|
+
console.warn(
|
|
85
|
+
"Detected both the SEAM_API_URL and SEAM_ENDPOINT environment variables. Using SEAM_ENDPOINT."
|
|
86
|
+
);
|
|
87
|
+
}
|
|
78
88
|
return globalThis.process?.env?.SEAM_ENDPOINT ?? globalThis.process?.env?.SEAM_API_URL;
|
|
79
89
|
};
|
|
80
90
|
var limitToSeamHttpRequestOptions = (options) => {
|
|
@@ -1992,11 +2002,11 @@ var SeamHttpConnectedAccounts = class _SeamHttpConnectedAccounts {
|
|
|
1992
2002
|
});
|
|
1993
2003
|
return data.connected_account;
|
|
1994
2004
|
}
|
|
1995
|
-
async list(
|
|
2005
|
+
async list(body) {
|
|
1996
2006
|
const { data } = await this.client.request({
|
|
1997
2007
|
url: "/connected_accounts/list",
|
|
1998
|
-
method: "
|
|
1999
|
-
|
|
2008
|
+
method: "post",
|
|
2009
|
+
data: body
|
|
2000
2010
|
});
|
|
2001
2011
|
return data.connected_accounts;
|
|
2002
2012
|
}
|
|
@@ -2542,11 +2552,12 @@ var SeamHttpNoiseSensorsNoiseThresholds = class _SeamHttpNoiseSensorsNoiseThresh
|
|
|
2542
2552
|
return new _SeamHttpNoiseSensorsNoiseThresholds(constructorOptions);
|
|
2543
2553
|
}
|
|
2544
2554
|
async create(body) {
|
|
2545
|
-
await this.client.request({
|
|
2555
|
+
const { data } = await this.client.request({
|
|
2546
2556
|
url: "/noise_sensors/noise_thresholds/create",
|
|
2547
2557
|
method: "post",
|
|
2548
2558
|
data: body
|
|
2549
2559
|
});
|
|
2560
|
+
return data.noise_threshold;
|
|
2550
2561
|
}
|
|
2551
2562
|
async delete(body) {
|
|
2552
2563
|
await this.client.request({
|
|
@@ -3152,11 +3163,11 @@ var SeamHttpUserIdentities = class _SeamHttpUserIdentities {
|
|
|
3152
3163
|
data: body
|
|
3153
3164
|
});
|
|
3154
3165
|
}
|
|
3155
|
-
async list(
|
|
3166
|
+
async list(body) {
|
|
3156
3167
|
const { data } = await this.client.request({
|
|
3157
3168
|
url: "/user_identities/list",
|
|
3158
|
-
method: "
|
|
3159
|
-
|
|
3169
|
+
method: "post",
|
|
3170
|
+
data: body
|
|
3160
3171
|
});
|
|
3161
3172
|
return data.user_identities;
|
|
3162
3173
|
}
|
|
@@ -3284,11 +3295,11 @@ var SeamHttpWebhooks = class _SeamHttpWebhooks {
|
|
|
3284
3295
|
});
|
|
3285
3296
|
return data.webhook;
|
|
3286
3297
|
}
|
|
3287
|
-
async list(
|
|
3298
|
+
async list(body) {
|
|
3288
3299
|
const { data } = await this.client.request({
|
|
3289
3300
|
url: "/webhooks/list",
|
|
3290
|
-
method: "
|
|
3291
|
-
|
|
3301
|
+
method: "post",
|
|
3302
|
+
data: body
|
|
3292
3303
|
});
|
|
3293
3304
|
return data.webhooks;
|
|
3294
3305
|
}
|
|
@@ -3363,19 +3374,19 @@ var SeamHttpWorkspaces = class _SeamHttpWorkspaces {
|
|
|
3363
3374
|
});
|
|
3364
3375
|
return data.workspace;
|
|
3365
3376
|
}
|
|
3366
|
-
async get(
|
|
3377
|
+
async get(body) {
|
|
3367
3378
|
const { data } = await this.client.request({
|
|
3368
3379
|
url: "/workspaces/get",
|
|
3369
|
-
method: "
|
|
3370
|
-
|
|
3380
|
+
method: "post",
|
|
3381
|
+
data: body
|
|
3371
3382
|
});
|
|
3372
3383
|
return data.workspace;
|
|
3373
3384
|
}
|
|
3374
|
-
async list(
|
|
3385
|
+
async list(body) {
|
|
3375
3386
|
const { data } = await this.client.request({
|
|
3376
3387
|
url: "/workspaces/list",
|
|
3377
|
-
method: "
|
|
3378
|
-
|
|
3388
|
+
method: "post",
|
|
3389
|
+
data: body
|
|
3379
3390
|
});
|
|
3380
3391
|
return data.workspaces;
|
|
3381
3392
|
}
|