@seamapi/http 1.95.1 → 1.97.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.
Files changed (34) hide show
  1. package/dist/connect.cjs +143 -0
  2. package/dist/connect.cjs.map +1 -1
  3. package/dist/connect.d.cts +49 -4
  4. package/dist/index.cjs +145 -0
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.d.cts +1 -1
  7. package/lib/seam/connect/routes/devices/devices.d.ts +13 -0
  8. package/lib/seam/connect/routes/devices/devices.js +9 -0
  9. package/lib/seam/connect/routes/devices/devices.js.map +1 -1
  10. package/lib/seam/connect/routes/seam/customer/v1/customers/customers.d.ts +34 -0
  11. package/lib/seam/connect/routes/seam/customer/v1/customers/customers.js +104 -0
  12. package/lib/seam/connect/routes/seam/customer/v1/customers/customers.js.map +1 -0
  13. package/lib/seam/connect/routes/seam/customer/v1/customers/index.d.ts +1 -0
  14. package/lib/seam/connect/routes/seam/customer/v1/customers/index.js +6 -0
  15. package/lib/seam/connect/routes/seam/customer/v1/customers/index.js.map +1 -0
  16. package/lib/seam/connect/routes/seam/customer/v1/index.d.ts +1 -0
  17. package/lib/seam/connect/routes/seam/customer/v1/index.js +1 -0
  18. package/lib/seam/connect/routes/seam/customer/v1/index.js.map +1 -1
  19. package/lib/seam/connect/routes/seam/customer/v1/v1.d.ts +2 -0
  20. package/lib/seam/connect/routes/seam/customer/v1/v1.js +4 -0
  21. package/lib/seam/connect/routes/seam/customer/v1/v1.js.map +1 -1
  22. package/lib/seam/connect/routes/seam-http-endpoints.d.ts +7 -4
  23. package/lib/seam/connect/routes/seam-http-endpoints.js +18 -0
  24. package/lib/seam/connect/routes/seam-http-endpoints.js.map +1 -1
  25. package/lib/version.d.ts +1 -1
  26. package/lib/version.js +1 -1
  27. package/package.json +3 -3
  28. package/src/lib/seam/connect/routes/devices/devices.ts +36 -0
  29. package/src/lib/seam/connect/routes/seam/customer/v1/customers/customers.ts +214 -0
  30. package/src/lib/seam/connect/routes/seam/customer/v1/customers/index.ts +6 -0
  31. package/src/lib/seam/connect/routes/seam/customer/v1/index.ts +1 -0
  32. package/src/lib/seam/connect/routes/seam/customer/v1/v1.ts +8 -0
  33. package/src/lib/seam/connect/routes/seam-http-endpoints.ts +43 -0
  34. package/src/lib/version.ts +1 -1
package/dist/connect.cjs CHANGED
@@ -4664,6 +4664,15 @@ var SeamHttpDevices = class _SeamHttpDevices {
4664
4664
  options
4665
4665
  });
4666
4666
  }
4667
+ reportProviderMetadata(parameters, options = {}) {
4668
+ return new SeamHttpRequest(this, {
4669
+ pathname: "/devices/report_provider_metadata",
4670
+ method: "POST",
4671
+ body: parameters,
4672
+ responseKey: void 0,
4673
+ options
4674
+ });
4675
+ }
4667
4676
  update(parameters, options = {}) {
4668
4677
  return new SeamHttpRequest(this, {
4669
4678
  pathname: "/devices/update",
@@ -6516,6 +6525,114 @@ var SeamHttpSeamCustomerV1Connectors = class _SeamHttpSeamCustomerV1Connectors {
6516
6525
  }
6517
6526
  };
6518
6527
 
6528
+ // src/lib/seam/connect/routes/seam/customer/v1/customers/customers.ts
6529
+ var SeamHttpSeamCustomerV1Customers = class _SeamHttpSeamCustomerV1Customers {
6530
+ client;
6531
+ defaults;
6532
+ ltsVersion = seamApiLtsVersion;
6533
+ static ltsVersion = seamApiLtsVersion;
6534
+ constructor(apiKeyOrOptions = {}) {
6535
+ const options = parseOptions(apiKeyOrOptions);
6536
+ if (!options.isUndocumentedApiEnabled) {
6537
+ throw new Error(
6538
+ "Cannot use undocumented API without isUndocumentedApiEnabled"
6539
+ );
6540
+ }
6541
+ this.client = "client" in options ? options.client : createClient(options);
6542
+ this.defaults = limitToSeamHttpRequestOptions(options);
6543
+ }
6544
+ static fromClient(client, options = {}) {
6545
+ const constructorOptions = { ...options, client };
6546
+ if (!isSeamHttpOptionsWithClient(constructorOptions)) {
6547
+ throw new SeamHttpInvalidOptionsError("Missing client");
6548
+ }
6549
+ return new _SeamHttpSeamCustomerV1Customers(constructorOptions);
6550
+ }
6551
+ static fromApiKey(apiKey, options = {}) {
6552
+ const constructorOptions = { ...options, apiKey };
6553
+ if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
6554
+ throw new SeamHttpInvalidOptionsError("Missing apiKey");
6555
+ }
6556
+ return new _SeamHttpSeamCustomerV1Customers(constructorOptions);
6557
+ }
6558
+ static fromClientSessionToken(clientSessionToken, options = {}) {
6559
+ const constructorOptions = { ...options, clientSessionToken };
6560
+ if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
6561
+ throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
6562
+ }
6563
+ return new _SeamHttpSeamCustomerV1Customers(constructorOptions);
6564
+ }
6565
+ static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
6566
+ warnOnInsecureuserIdentifierKey(userIdentifierKey);
6567
+ const clientOptions = parseOptions({ ...options, publishableKey });
6568
+ if (isSeamHttpOptionsWithClient(clientOptions)) {
6569
+ throw new SeamHttpInvalidOptionsError(
6570
+ "The client option cannot be used with SeamHttpSeamCustomerV1Customers.fromPublishableKey"
6571
+ );
6572
+ }
6573
+ const client = createClient(clientOptions);
6574
+ const clientSessions = SeamHttpClientSessions.fromClient(client);
6575
+ const { token } = await clientSessions.getOrCreate({
6576
+ user_identifier_key: userIdentifierKey
6577
+ });
6578
+ return _SeamHttpSeamCustomerV1Customers.fromClientSessionToken(
6579
+ token,
6580
+ options
6581
+ );
6582
+ }
6583
+ static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
6584
+ const constructorOptions = { ...options, consoleSessionToken, workspaceId };
6585
+ if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
6586
+ throw new SeamHttpInvalidOptionsError(
6587
+ "Missing consoleSessionToken or workspaceId"
6588
+ );
6589
+ }
6590
+ return new _SeamHttpSeamCustomerV1Customers(constructorOptions);
6591
+ }
6592
+ static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
6593
+ const constructorOptions = { ...options, personalAccessToken, workspaceId };
6594
+ if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
6595
+ throw new SeamHttpInvalidOptionsError(
6596
+ "Missing personalAccessToken or workspaceId"
6597
+ );
6598
+ }
6599
+ return new _SeamHttpSeamCustomerV1Customers(constructorOptions);
6600
+ }
6601
+ createPaginator(request) {
6602
+ return new SeamPaginator(this, request);
6603
+ }
6604
+ async updateClientSessionToken(clientSessionToken) {
6605
+ const { headers } = this.client.defaults;
6606
+ const authHeaders = getAuthHeadersForClientSessionToken({
6607
+ clientSessionToken
6608
+ });
6609
+ for (const key of Object.keys(authHeaders)) {
6610
+ if (headers[key] == null) {
6611
+ throw new Error(
6612
+ "Cannot update a clientSessionToken on a client created without a clientSessionToken"
6613
+ );
6614
+ }
6615
+ }
6616
+ this.client.defaults.headers = { ...headers, ...authHeaders };
6617
+ const clientSessions = SeamHttpClientSessions.fromClient(this.client);
6618
+ await clientSessions.get();
6619
+ }
6620
+ list(parameters, options = {}) {
6621
+ if (!this.defaults.isUndocumentedApiEnabled) {
6622
+ throw new Error(
6623
+ "Cannot use undocumented API without isUndocumentedApiEnabled"
6624
+ );
6625
+ }
6626
+ return new SeamHttpRequest(this, {
6627
+ pathname: "/seam/customer/v1/customers/list",
6628
+ method: "POST",
6629
+ body: parameters,
6630
+ responseKey: "customers",
6631
+ options
6632
+ });
6633
+ }
6634
+ };
6635
+
6519
6636
  // src/lib/seam/connect/routes/seam/customer/v1/events/events.ts
6520
6637
  var SeamHttpSeamCustomerV1Events = class _SeamHttpSeamCustomerV1Events {
6521
6638
  client;
@@ -7335,6 +7452,12 @@ var SeamHttpSeamCustomerV1 = class _SeamHttpSeamCustomerV1 {
7335
7452
  this.defaults
7336
7453
  );
7337
7454
  }
7455
+ get customers() {
7456
+ return SeamHttpSeamCustomerV1Customers.fromClient(
7457
+ this.client,
7458
+ this.defaults
7459
+ );
7460
+ }
7338
7461
  get events() {
7339
7462
  return SeamHttpSeamCustomerV1Events.fromClient(this.client, this.defaults);
7340
7463
  }
@@ -10587,6 +10710,13 @@ var SeamHttpEndpoints = class _SeamHttpEndpoints {
10587
10710
  return seam.listDeviceProviders(...args);
10588
10711
  };
10589
10712
  }
10713
+ get "/devices/report_provider_metadata"() {
10714
+ const { client, defaults } = this;
10715
+ return function devicesReportProviderMetadata(...args) {
10716
+ const seam = SeamHttpDevices.fromClient(client, defaults);
10717
+ return seam.reportProviderMetadata(...args);
10718
+ };
10719
+ }
10590
10720
  get "/devices/update"() {
10591
10721
  const { client, defaults } = this;
10592
10722
  return function devicesUpdate(...args) {
@@ -11009,6 +11139,18 @@ var SeamHttpEndpoints = class _SeamHttpEndpoints {
11009
11139
  return seam.update(...args);
11010
11140
  };
11011
11141
  }
11142
+ get "/seam/customer/v1/customers/list"() {
11143
+ const { client, defaults } = this;
11144
+ if (!this.defaults.isUndocumentedApiEnabled) {
11145
+ throw new Error(
11146
+ "Cannot use undocumented API without isUndocumentedApiEnabled"
11147
+ );
11148
+ }
11149
+ return function seamCustomerV1CustomersList(...args) {
11150
+ const seam = SeamHttpSeamCustomerV1Customers.fromClient(client, defaults);
11151
+ return seam.list(...args);
11152
+ };
11153
+ }
11012
11154
  get "/seam/customer/v1/events/list"() {
11013
11155
  const { client, defaults } = this;
11014
11156
  if (!this.defaults.isUndocumentedApiEnabled) {
@@ -11982,6 +12124,7 @@ exports.SeamHttpSeamCustomerV1AccessGrants = SeamHttpSeamCustomerV1AccessGrants;
11982
12124
  exports.SeamHttpSeamCustomerV1AutomationRuns = SeamHttpSeamCustomerV1AutomationRuns;
11983
12125
  exports.SeamHttpSeamCustomerV1Automations = SeamHttpSeamCustomerV1Automations;
11984
12126
  exports.SeamHttpSeamCustomerV1Connectors = SeamHttpSeamCustomerV1Connectors;
12127
+ exports.SeamHttpSeamCustomerV1Customers = SeamHttpSeamCustomerV1Customers;
11985
12128
  exports.SeamHttpSeamCustomerV1Events = SeamHttpSeamCustomerV1Events;
11986
12129
  exports.SeamHttpSeamCustomerV1Portals = SeamHttpSeamCustomerV1Portals;
11987
12130
  exports.SeamHttpSeamCustomerV1Reservations = SeamHttpSeamCustomerV1Reservations;