@seamapi/http 0.14.0 → 0.15.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 +3 -3
- package/dist/connect.cjs +35 -16
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +16 -12
- package/lib/seam/connect/parse-options.js +9 -0
- package/lib/seam/connect/parse-options.js.map +1 -1
- package/lib/seam/connect/routes/acs-users.d.ts +4 -0
- package/lib/seam/connect/routes/acs-users.js +8 -0
- package/lib/seam/connect/routes/acs-users.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 +3 -3
- package/src/lib/seam/connect/parse-options.ts +17 -0
- package/src/lib/seam/connect/routes/acs-users.ts +22 -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) => {
|
|
@@ -1608,6 +1618,14 @@ var SeamHttpAcsUsers = class _SeamHttpAcsUsers {
|
|
|
1608
1618
|
});
|
|
1609
1619
|
return data.acs_users;
|
|
1610
1620
|
}
|
|
1621
|
+
async listAccessibleEntrances(body) {
|
|
1622
|
+
const { data } = await this.client.request({
|
|
1623
|
+
url: "/acs/users/list_accessible_entrances",
|
|
1624
|
+
method: "post",
|
|
1625
|
+
data: body
|
|
1626
|
+
});
|
|
1627
|
+
return data.acs_entrances;
|
|
1628
|
+
}
|
|
1611
1629
|
async removeFromAccessGroup(body) {
|
|
1612
1630
|
await this.client.request({
|
|
1613
1631
|
url: "/acs/users/remove_from_access_group",
|
|
@@ -1992,11 +2010,11 @@ var SeamHttpConnectedAccounts = class _SeamHttpConnectedAccounts {
|
|
|
1992
2010
|
});
|
|
1993
2011
|
return data.connected_account;
|
|
1994
2012
|
}
|
|
1995
|
-
async list(
|
|
2013
|
+
async list(body) {
|
|
1996
2014
|
const { data } = await this.client.request({
|
|
1997
2015
|
url: "/connected_accounts/list",
|
|
1998
|
-
method: "
|
|
1999
|
-
|
|
2016
|
+
method: "post",
|
|
2017
|
+
data: body
|
|
2000
2018
|
});
|
|
2001
2019
|
return data.connected_accounts;
|
|
2002
2020
|
}
|
|
@@ -2542,11 +2560,12 @@ var SeamHttpNoiseSensorsNoiseThresholds = class _SeamHttpNoiseSensorsNoiseThresh
|
|
|
2542
2560
|
return new _SeamHttpNoiseSensorsNoiseThresholds(constructorOptions);
|
|
2543
2561
|
}
|
|
2544
2562
|
async create(body) {
|
|
2545
|
-
await this.client.request({
|
|
2563
|
+
const { data } = await this.client.request({
|
|
2546
2564
|
url: "/noise_sensors/noise_thresholds/create",
|
|
2547
2565
|
method: "post",
|
|
2548
2566
|
data: body
|
|
2549
2567
|
});
|
|
2568
|
+
return data.noise_threshold;
|
|
2550
2569
|
}
|
|
2551
2570
|
async delete(body) {
|
|
2552
2571
|
await this.client.request({
|
|
@@ -3152,11 +3171,11 @@ var SeamHttpUserIdentities = class _SeamHttpUserIdentities {
|
|
|
3152
3171
|
data: body
|
|
3153
3172
|
});
|
|
3154
3173
|
}
|
|
3155
|
-
async list(
|
|
3174
|
+
async list(body) {
|
|
3156
3175
|
const { data } = await this.client.request({
|
|
3157
3176
|
url: "/user_identities/list",
|
|
3158
|
-
method: "
|
|
3159
|
-
|
|
3177
|
+
method: "post",
|
|
3178
|
+
data: body
|
|
3160
3179
|
});
|
|
3161
3180
|
return data.user_identities;
|
|
3162
3181
|
}
|
|
@@ -3284,11 +3303,11 @@ var SeamHttpWebhooks = class _SeamHttpWebhooks {
|
|
|
3284
3303
|
});
|
|
3285
3304
|
return data.webhook;
|
|
3286
3305
|
}
|
|
3287
|
-
async list(
|
|
3306
|
+
async list(body) {
|
|
3288
3307
|
const { data } = await this.client.request({
|
|
3289
3308
|
url: "/webhooks/list",
|
|
3290
|
-
method: "
|
|
3291
|
-
|
|
3309
|
+
method: "post",
|
|
3310
|
+
data: body
|
|
3292
3311
|
});
|
|
3293
3312
|
return data.webhooks;
|
|
3294
3313
|
}
|
|
@@ -3363,19 +3382,19 @@ var SeamHttpWorkspaces = class _SeamHttpWorkspaces {
|
|
|
3363
3382
|
});
|
|
3364
3383
|
return data.workspace;
|
|
3365
3384
|
}
|
|
3366
|
-
async get(
|
|
3385
|
+
async get(body) {
|
|
3367
3386
|
const { data } = await this.client.request({
|
|
3368
3387
|
url: "/workspaces/get",
|
|
3369
|
-
method: "
|
|
3370
|
-
|
|
3388
|
+
method: "post",
|
|
3389
|
+
data: body
|
|
3371
3390
|
});
|
|
3372
3391
|
return data.workspace;
|
|
3373
3392
|
}
|
|
3374
|
-
async list(
|
|
3393
|
+
async list(body) {
|
|
3375
3394
|
const { data } = await this.client.request({
|
|
3376
3395
|
url: "/workspaces/list",
|
|
3377
|
-
method: "
|
|
3378
|
-
|
|
3396
|
+
method: "post",
|
|
3397
|
+
data: body
|
|
3379
3398
|
});
|
|
3380
3399
|
return data.workspaces;
|
|
3381
3400
|
}
|