@seamapi/http 1.54.0 → 1.56.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 (40) hide show
  1. package/dist/connect.cjs +146 -45
  2. package/dist/connect.cjs.map +1 -1
  3. package/dist/connect.d.cts +47 -2
  4. package/dist/index.cjs +148 -45
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.d.cts +1 -1
  7. package/lib/seam/connect/routes/seam/customer/v1/events/events.d.ts +34 -0
  8. package/lib/seam/connect/routes/seam/customer/v1/events/events.js +102 -0
  9. package/lib/seam/connect/routes/seam/customer/v1/events/events.js.map +1 -0
  10. package/lib/seam/connect/routes/seam/customer/v1/events/index.d.ts +1 -0
  11. package/lib/seam/connect/routes/seam/customer/v1/events/index.js +6 -0
  12. package/lib/seam/connect/routes/seam/customer/v1/events/index.js.map +1 -0
  13. package/lib/seam/connect/routes/seam/customer/v1/index.d.ts +1 -0
  14. package/lib/seam/connect/routes/seam/customer/v1/index.js +1 -0
  15. package/lib/seam/connect/routes/seam/customer/v1/index.js.map +1 -1
  16. package/lib/seam/connect/routes/seam/customer/v1/settings/settings.d.ts +14 -1
  17. package/lib/seam/connect/routes/seam/customer/v1/settings/settings.js +12 -0
  18. package/lib/seam/connect/routes/seam/customer/v1/settings/settings.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 +5 -2
  23. package/lib/seam/connect/routes/seam-http-endpoints.js +21 -12
  24. package/lib/seam/connect/routes/seam-http-endpoints.js.map +1 -1
  25. package/lib/seam/connect/routes/thermostats/daily-programs/daily-programs.js +0 -12
  26. package/lib/seam/connect/routes/thermostats/daily-programs/daily-programs.js.map +1 -1
  27. package/lib/seam/connect/routes/thermostats/thermostats.js +0 -3
  28. package/lib/seam/connect/routes/thermostats/thermostats.js.map +1 -1
  29. package/lib/version.d.ts +1 -1
  30. package/lib/version.js +1 -1
  31. package/package.json +3 -3
  32. package/src/lib/seam/connect/routes/seam/customer/v1/events/events.ts +211 -0
  33. package/src/lib/seam/connect/routes/seam/customer/v1/events/index.ts +6 -0
  34. package/src/lib/seam/connect/routes/seam/customer/v1/index.ts +1 -0
  35. package/src/lib/seam/connect/routes/seam/customer/v1/settings/settings.ts +47 -1
  36. package/src/lib/seam/connect/routes/seam/customer/v1/v1.ts +5 -0
  37. package/src/lib/seam/connect/routes/seam-http-endpoints.ts +47 -20
  38. package/src/lib/seam/connect/routes/thermostats/daily-programs/daily-programs.ts +0 -20
  39. package/src/lib/seam/connect/routes/thermostats/thermostats.ts +0 -5
  40. package/src/lib/version.ts +1 -1
package/dist/connect.cjs CHANGED
@@ -5716,6 +5716,110 @@ var _SeamHttpSeamCustomerV1Automations = class _SeamHttpSeamCustomerV1Automation
5716
5716
  _SeamHttpSeamCustomerV1Automations.ltsVersion = seamApiLtsVersion;
5717
5717
  var SeamHttpSeamCustomerV1Automations = _SeamHttpSeamCustomerV1Automations;
5718
5718
 
5719
+ // src/lib/seam/connect/routes/seam/customer/v1/events/events.ts
5720
+ var _SeamHttpSeamCustomerV1Events = class _SeamHttpSeamCustomerV1Events {
5721
+ constructor(apiKeyOrOptions = {}) {
5722
+ this.ltsVersion = seamApiLtsVersion;
5723
+ const options = parseOptions(apiKeyOrOptions);
5724
+ if (!options.isUndocumentedApiEnabled) {
5725
+ throw new Error(
5726
+ "Cannot use undocumented API without isUndocumentedApiEnabled"
5727
+ );
5728
+ }
5729
+ this.client = "client" in options ? options.client : createClient(options);
5730
+ this.defaults = limitToSeamHttpRequestOptions(options);
5731
+ }
5732
+ static fromClient(client, options = {}) {
5733
+ const constructorOptions = { ...options, client };
5734
+ if (!isSeamHttpOptionsWithClient(constructorOptions)) {
5735
+ throw new SeamHttpInvalidOptionsError("Missing client");
5736
+ }
5737
+ return new _SeamHttpSeamCustomerV1Events(constructorOptions);
5738
+ }
5739
+ static fromApiKey(apiKey, options = {}) {
5740
+ const constructorOptions = { ...options, apiKey };
5741
+ if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
5742
+ throw new SeamHttpInvalidOptionsError("Missing apiKey");
5743
+ }
5744
+ return new _SeamHttpSeamCustomerV1Events(constructorOptions);
5745
+ }
5746
+ static fromClientSessionToken(clientSessionToken, options = {}) {
5747
+ const constructorOptions = { ...options, clientSessionToken };
5748
+ if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
5749
+ throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
5750
+ }
5751
+ return new _SeamHttpSeamCustomerV1Events(constructorOptions);
5752
+ }
5753
+ static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
5754
+ warnOnInsecureuserIdentifierKey(userIdentifierKey);
5755
+ const clientOptions = parseOptions({ ...options, publishableKey });
5756
+ if (isSeamHttpOptionsWithClient(clientOptions)) {
5757
+ throw new SeamHttpInvalidOptionsError(
5758
+ "The client option cannot be used with SeamHttpSeamCustomerV1Events.fromPublishableKey"
5759
+ );
5760
+ }
5761
+ const client = createClient(clientOptions);
5762
+ const clientSessions = SeamHttpClientSessions.fromClient(client);
5763
+ const { token } = await clientSessions.getOrCreate({
5764
+ user_identifier_key: userIdentifierKey
5765
+ });
5766
+ return _SeamHttpSeamCustomerV1Events.fromClientSessionToken(token, options);
5767
+ }
5768
+ static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
5769
+ const constructorOptions = { ...options, consoleSessionToken, workspaceId };
5770
+ if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
5771
+ throw new SeamHttpInvalidOptionsError(
5772
+ "Missing consoleSessionToken or workspaceId"
5773
+ );
5774
+ }
5775
+ return new _SeamHttpSeamCustomerV1Events(constructorOptions);
5776
+ }
5777
+ static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
5778
+ const constructorOptions = { ...options, personalAccessToken, workspaceId };
5779
+ if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
5780
+ throw new SeamHttpInvalidOptionsError(
5781
+ "Missing personalAccessToken or workspaceId"
5782
+ );
5783
+ }
5784
+ return new _SeamHttpSeamCustomerV1Events(constructorOptions);
5785
+ }
5786
+ createPaginator(request) {
5787
+ return new SeamPaginator(this, request);
5788
+ }
5789
+ async updateClientSessionToken(clientSessionToken) {
5790
+ const { headers } = this.client.defaults;
5791
+ const authHeaders = getAuthHeadersForClientSessionToken({
5792
+ clientSessionToken
5793
+ });
5794
+ for (const key of Object.keys(authHeaders)) {
5795
+ if (headers[key] == null) {
5796
+ throw new Error(
5797
+ "Cannot update a clientSessionToken on a client created without a clientSessionToken"
5798
+ );
5799
+ }
5800
+ }
5801
+ this.client.defaults.headers = { ...headers, ...authHeaders };
5802
+ const clientSessions = SeamHttpClientSessions.fromClient(this.client);
5803
+ await clientSessions.get();
5804
+ }
5805
+ list(parameters, options = {}) {
5806
+ if (!this.defaults.isUndocumentedApiEnabled) {
5807
+ throw new Error(
5808
+ "Cannot use undocumented API without isUndocumentedApiEnabled"
5809
+ );
5810
+ }
5811
+ return new SeamHttpRequest(this, {
5812
+ pathname: "/seam/customer/v1/events/list",
5813
+ method: "POST",
5814
+ body: parameters,
5815
+ responseKey: "events",
5816
+ options
5817
+ });
5818
+ }
5819
+ };
5820
+ _SeamHttpSeamCustomerV1Events.ltsVersion = seamApiLtsVersion;
5821
+ var SeamHttpSeamCustomerV1Events = _SeamHttpSeamCustomerV1Events;
5822
+
5719
5823
  // src/lib/seam/connect/routes/seam/customer/v1/portals/portals.ts
5720
5824
  var _SeamHttpSeamCustomerV1Portals = class _SeamHttpSeamCustomerV1Portals {
5721
5825
  constructor(apiKeyOrOptions = {}) {
@@ -5906,6 +6010,20 @@ var _SeamHttpSeamCustomerV1Settings = class _SeamHttpSeamCustomerV1Settings {
5906
6010
  const clientSessions = SeamHttpClientSessions.fromClient(this.client);
5907
6011
  await clientSessions.get();
5908
6012
  }
6013
+ get(parameters, options = {}) {
6014
+ if (!this.defaults.isUndocumentedApiEnabled) {
6015
+ throw new Error(
6016
+ "Cannot use undocumented API without isUndocumentedApiEnabled"
6017
+ );
6018
+ }
6019
+ return new SeamHttpRequest(this, {
6020
+ pathname: "/seam/customer/v1/settings/get",
6021
+ method: "GET",
6022
+ params: parameters,
6023
+ responseKey: "business_vertical",
6024
+ options
6025
+ });
6026
+ }
5909
6027
  update(parameters, options = {}) {
5910
6028
  if (!this.defaults.isUndocumentedApiEnabled) {
5911
6029
  throw new Error(
@@ -6022,6 +6140,9 @@ var _SeamHttpSeamCustomerV1 = class _SeamHttpSeamCustomerV1 {
6022
6140
  this.defaults
6023
6141
  );
6024
6142
  }
6143
+ get events() {
6144
+ return SeamHttpSeamCustomerV1Events.fromClient(this.client, this.defaults);
6145
+ }
6025
6146
  get portals() {
6026
6147
  return SeamHttpSeamCustomerV1Portals.fromClient(this.client, this.defaults);
6027
6148
  }
@@ -6418,11 +6539,6 @@ var _SeamHttpThermostatsDailyPrograms = class _SeamHttpThermostatsDailyPrograms
6418
6539
  constructor(apiKeyOrOptions = {}) {
6419
6540
  this.ltsVersion = seamApiLtsVersion;
6420
6541
  const options = parseOptions(apiKeyOrOptions);
6421
- if (!options.isUndocumentedApiEnabled) {
6422
- throw new Error(
6423
- "Cannot use undocumented API without isUndocumentedApiEnabled"
6424
- );
6425
- }
6426
6542
  this.client = "client" in options ? options.client : createClient(options);
6427
6543
  this.defaults = limitToSeamHttpRequestOptions(options);
6428
6544
  }
@@ -6503,11 +6619,6 @@ var _SeamHttpThermostatsDailyPrograms = class _SeamHttpThermostatsDailyPrograms
6503
6619
  await clientSessions.get();
6504
6620
  }
6505
6621
  create(parameters, options = {}) {
6506
- if (!this.defaults.isUndocumentedApiEnabled) {
6507
- throw new Error(
6508
- "Cannot use undocumented API without isUndocumentedApiEnabled"
6509
- );
6510
- }
6511
6622
  return new SeamHttpRequest(this, {
6512
6623
  pathname: "/thermostats/daily_programs/create",
6513
6624
  method: "POST",
@@ -6517,11 +6628,6 @@ var _SeamHttpThermostatsDailyPrograms = class _SeamHttpThermostatsDailyPrograms
6517
6628
  });
6518
6629
  }
6519
6630
  delete(parameters, options = {}) {
6520
- if (!this.defaults.isUndocumentedApiEnabled) {
6521
- throw new Error(
6522
- "Cannot use undocumented API without isUndocumentedApiEnabled"
6523
- );
6524
- }
6525
6631
  return new SeamHttpRequest(this, {
6526
6632
  pathname: "/thermostats/daily_programs/delete",
6527
6633
  method: "POST",
@@ -6531,11 +6637,6 @@ var _SeamHttpThermostatsDailyPrograms = class _SeamHttpThermostatsDailyPrograms
6531
6637
  });
6532
6638
  }
6533
6639
  update(parameters, options = {}) {
6534
- if (!this.defaults.isUndocumentedApiEnabled) {
6535
- throw new Error(
6536
- "Cannot use undocumented API without isUndocumentedApiEnabled"
6537
- );
6538
- }
6539
6640
  return new SeamHttpRequest(this, {
6540
6641
  pathname: "/thermostats/daily_programs/update",
6541
6642
  method: "PATCH",
@@ -7006,11 +7107,6 @@ var _SeamHttpThermostats = class _SeamHttpThermostats {
7006
7107
  });
7007
7108
  }
7008
7109
  updateWeeklyProgram(parameters, options = {}) {
7009
- if (!this.defaults.isUndocumentedApiEnabled) {
7010
- throw new Error(
7011
- "Cannot use undocumented API without isUndocumentedApiEnabled"
7012
- );
7013
- }
7014
7110
  return new SeamHttpRequest(this, {
7015
7111
  pathname: "/thermostats/update_weekly_program",
7016
7112
  method: "POST",
@@ -9715,6 +9811,18 @@ var _SeamHttpEndpoints = class _SeamHttpEndpoints {
9715
9811
  return seam.update(...args);
9716
9812
  };
9717
9813
  }
9814
+ get ["/seam/customer/v1/events/list"]() {
9815
+ const { client, defaults } = this;
9816
+ if (!this.defaults.isUndocumentedApiEnabled) {
9817
+ throw new Error(
9818
+ "Cannot use undocumented API without isUndocumentedApiEnabled"
9819
+ );
9820
+ }
9821
+ return function seamCustomerV1EventsList(...args) {
9822
+ const seam = SeamHttpSeamCustomerV1Events.fromClient(client, defaults);
9823
+ return seam.list(...args);
9824
+ };
9825
+ }
9718
9826
  get ["/seam/customer/v1/portals/get"]() {
9719
9827
  const { client, defaults } = this;
9720
9828
  if (!this.defaults.isUndocumentedApiEnabled) {
@@ -9727,6 +9835,18 @@ var _SeamHttpEndpoints = class _SeamHttpEndpoints {
9727
9835
  return seam.get(...args);
9728
9836
  };
9729
9837
  }
9838
+ get ["/seam/customer/v1/settings/get"]() {
9839
+ const { client, defaults } = this;
9840
+ if (!this.defaults.isUndocumentedApiEnabled) {
9841
+ throw new Error(
9842
+ "Cannot use undocumented API without isUndocumentedApiEnabled"
9843
+ );
9844
+ }
9845
+ return function seamCustomerV1SettingsGet(...args) {
9846
+ const seam = SeamHttpSeamCustomerV1Settings.fromClient(client, defaults);
9847
+ return seam.get(...args);
9848
+ };
9849
+ }
9730
9850
  get ["/seam/customer/v1/settings/update"]() {
9731
9851
  const { client, defaults } = this;
9732
9852
  if (!this.defaults.isUndocumentedApiEnabled) {
@@ -9929,11 +10049,6 @@ var _SeamHttpEndpoints = class _SeamHttpEndpoints {
9929
10049
  }
9930
10050
  get ["/thermostats/update_weekly_program"]() {
9931
10051
  const { client, defaults } = this;
9932
- if (!this.defaults.isUndocumentedApiEnabled) {
9933
- throw new Error(
9934
- "Cannot use undocumented API without isUndocumentedApiEnabled"
9935
- );
9936
- }
9937
10052
  return function thermostatsUpdateWeeklyProgram(...args) {
9938
10053
  const seam = SeamHttpThermostats.fromClient(client, defaults);
9939
10054
  return seam.updateWeeklyProgram(...args);
@@ -9941,11 +10056,6 @@ var _SeamHttpEndpoints = class _SeamHttpEndpoints {
9941
10056
  }
9942
10057
  get ["/thermostats/daily_programs/create"]() {
9943
10058
  const { client, defaults } = this;
9944
- if (!this.defaults.isUndocumentedApiEnabled) {
9945
- throw new Error(
9946
- "Cannot use undocumented API without isUndocumentedApiEnabled"
9947
- );
9948
- }
9949
10059
  return function thermostatsDailyProgramsCreate(...args) {
9950
10060
  const seam = SeamHttpThermostatsDailyPrograms.fromClient(client, defaults);
9951
10061
  return seam.create(...args);
@@ -9953,11 +10063,6 @@ var _SeamHttpEndpoints = class _SeamHttpEndpoints {
9953
10063
  }
9954
10064
  get ["/thermostats/daily_programs/delete"]() {
9955
10065
  const { client, defaults } = this;
9956
- if (!this.defaults.isUndocumentedApiEnabled) {
9957
- throw new Error(
9958
- "Cannot use undocumented API without isUndocumentedApiEnabled"
9959
- );
9960
- }
9961
10066
  return function thermostatsDailyProgramsDelete(...args) {
9962
10067
  const seam = SeamHttpThermostatsDailyPrograms.fromClient(client, defaults);
9963
10068
  return seam.delete(...args);
@@ -9965,11 +10070,6 @@ var _SeamHttpEndpoints = class _SeamHttpEndpoints {
9965
10070
  }
9966
10071
  get ["/thermostats/daily_programs/update"]() {
9967
10072
  const { client, defaults } = this;
9968
- if (!this.defaults.isUndocumentedApiEnabled) {
9969
- throw new Error(
9970
- "Cannot use undocumented API without isUndocumentedApiEnabled"
9971
- );
9972
- }
9973
10073
  return function thermostatsDailyProgramsUpdate(...args) {
9974
10074
  const seam = SeamHttpThermostatsDailyPrograms.fromClient(client, defaults);
9975
10075
  return seam.update(...args);
@@ -10666,6 +10766,7 @@ exports.SeamHttpSeamConsoleV1 = SeamHttpSeamConsoleV1;
10666
10766
  exports.SeamHttpSeamCustomerV1 = SeamHttpSeamCustomerV1;
10667
10767
  exports.SeamHttpSeamCustomerV1AutomationRuns = SeamHttpSeamCustomerV1AutomationRuns;
10668
10768
  exports.SeamHttpSeamCustomerV1Automations = SeamHttpSeamCustomerV1Automations;
10769
+ exports.SeamHttpSeamCustomerV1Events = SeamHttpSeamCustomerV1Events;
10669
10770
  exports.SeamHttpSeamCustomerV1Portals = SeamHttpSeamCustomerV1Portals;
10670
10771
  exports.SeamHttpSeamCustomerV1Settings = SeamHttpSeamCustomerV1Settings;
10671
10772
  exports.SeamHttpSeamPartnerV1BuildingBlocks = SeamHttpSeamPartnerV1BuildingBlocks;