@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.
Files changed (31) hide show
  1. package/README.md +3 -3
  2. package/dist/connect.cjs +27 -16
  3. package/dist/connect.cjs.map +1 -1
  4. package/dist/connect.d.cts +11 -11
  5. package/lib/seam/connect/parse-options.js +9 -0
  6. package/lib/seam/connect/parse-options.js.map +1 -1
  7. package/lib/seam/connect/routes/connected-accounts.d.ts +3 -3
  8. package/lib/seam/connect/routes/connected-accounts.js +3 -3
  9. package/lib/seam/connect/routes/connected-accounts.js.map +1 -1
  10. package/lib/seam/connect/routes/noise-sensors-noise-thresholds.d.ts +1 -1
  11. package/lib/seam/connect/routes/noise-sensors-noise-thresholds.js +2 -1
  12. package/lib/seam/connect/routes/noise-sensors-noise-thresholds.js.map +1 -1
  13. package/lib/seam/connect/routes/user-identities.d.ts +3 -3
  14. package/lib/seam/connect/routes/user-identities.js +3 -3
  15. package/lib/seam/connect/routes/user-identities.js.map +1 -1
  16. package/lib/seam/connect/routes/webhooks.d.ts +3 -3
  17. package/lib/seam/connect/routes/webhooks.js +3 -3
  18. package/lib/seam/connect/routes/webhooks.js.map +1 -1
  19. package/lib/seam/connect/routes/workspaces.d.ts +5 -5
  20. package/lib/seam/connect/routes/workspaces.js +6 -6
  21. package/lib/seam/connect/routes/workspaces.js.map +1 -1
  22. package/lib/version.d.ts +1 -1
  23. package/lib/version.js +1 -1
  24. package/package.json +1 -1
  25. package/src/lib/seam/connect/parse-options.ts +17 -0
  26. package/src/lib/seam/connect/routes/connected-accounts.ts +5 -9
  27. package/src/lib/seam/connect/routes/noise-sensors-noise-thresholds.ts +11 -6
  28. package/src/lib/seam/connect/routes/user-identities.ts +5 -10
  29. package/src/lib/seam/connect/routes/webhooks.ts +5 -9
  30. package/src/lib/seam/connect/routes/workspaces.ts +9 -13
  31. 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 [seamapi] package. Seam recommends using that package instead
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/http@latest
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(params) {
2005
+ async list(body) {
1996
2006
  const { data } = await this.client.request({
1997
2007
  url: "/connected_accounts/list",
1998
- method: "get",
1999
- params
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(params) {
3166
+ async list(body) {
3156
3167
  const { data } = await this.client.request({
3157
3168
  url: "/user_identities/list",
3158
- method: "get",
3159
- params
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(params) {
3298
+ async list(body) {
3288
3299
  const { data } = await this.client.request({
3289
3300
  url: "/webhooks/list",
3290
- method: "get",
3291
- params
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(params) {
3377
+ async get(body) {
3367
3378
  const { data } = await this.client.request({
3368
3379
  url: "/workspaces/get",
3369
- method: "get",
3370
- params
3380
+ method: "post",
3381
+ data: body
3371
3382
  });
3372
3383
  return data.workspace;
3373
3384
  }
3374
- async list(params) {
3385
+ async list(body) {
3375
3386
  const { data } = await this.client.request({
3376
3387
  url: "/workspaces/list",
3377
- method: "get",
3378
- params
3388
+ method: "post",
3389
+ data: body
3379
3390
  });
3380
3391
  return data.workspaces;
3381
3392
  }