@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/index.cjs CHANGED
@@ -110,6 +110,7 @@ __export(index_exports, {
110
110
  SeamHttpSeamCustomerV1: () => SeamHttpSeamCustomerV1,
111
111
  SeamHttpSeamCustomerV1AutomationRuns: () => SeamHttpSeamCustomerV1AutomationRuns,
112
112
  SeamHttpSeamCustomerV1Automations: () => SeamHttpSeamCustomerV1Automations,
113
+ SeamHttpSeamCustomerV1Events: () => SeamHttpSeamCustomerV1Events,
113
114
  SeamHttpSeamCustomerV1Portals: () => SeamHttpSeamCustomerV1Portals,
114
115
  SeamHttpSeamCustomerV1Settings: () => SeamHttpSeamCustomerV1Settings,
115
116
  SeamHttpSeamPartnerV1BuildingBlocks: () => SeamHttpSeamPartnerV1BuildingBlocks,
@@ -211,6 +212,7 @@ __export(connect_exports, {
211
212
  SeamHttpSeamCustomerV1: () => SeamHttpSeamCustomerV1,
212
213
  SeamHttpSeamCustomerV1AutomationRuns: () => SeamHttpSeamCustomerV1AutomationRuns,
213
214
  SeamHttpSeamCustomerV1Automations: () => SeamHttpSeamCustomerV1Automations,
215
+ SeamHttpSeamCustomerV1Events: () => SeamHttpSeamCustomerV1Events,
214
216
  SeamHttpSeamCustomerV1Portals: () => SeamHttpSeamCustomerV1Portals,
215
217
  SeamHttpSeamCustomerV1Settings: () => SeamHttpSeamCustomerV1Settings,
216
218
  SeamHttpSeamPartnerV1BuildingBlocks: () => SeamHttpSeamPartnerV1BuildingBlocks,
@@ -5954,6 +5956,110 @@ var _SeamHttpSeamCustomerV1Automations = class _SeamHttpSeamCustomerV1Automation
5954
5956
  _SeamHttpSeamCustomerV1Automations.ltsVersion = seamApiLtsVersion;
5955
5957
  var SeamHttpSeamCustomerV1Automations = _SeamHttpSeamCustomerV1Automations;
5956
5958
 
5959
+ // src/lib/seam/connect/routes/seam/customer/v1/events/events.ts
5960
+ var _SeamHttpSeamCustomerV1Events = class _SeamHttpSeamCustomerV1Events {
5961
+ constructor(apiKeyOrOptions = {}) {
5962
+ this.ltsVersion = seamApiLtsVersion;
5963
+ const options = parseOptions(apiKeyOrOptions);
5964
+ if (!options.isUndocumentedApiEnabled) {
5965
+ throw new Error(
5966
+ "Cannot use undocumented API without isUndocumentedApiEnabled"
5967
+ );
5968
+ }
5969
+ this.client = "client" in options ? options.client : createClient(options);
5970
+ this.defaults = limitToSeamHttpRequestOptions(options);
5971
+ }
5972
+ static fromClient(client, options = {}) {
5973
+ const constructorOptions = { ...options, client };
5974
+ if (!isSeamHttpOptionsWithClient(constructorOptions)) {
5975
+ throw new SeamHttpInvalidOptionsError("Missing client");
5976
+ }
5977
+ return new _SeamHttpSeamCustomerV1Events(constructorOptions);
5978
+ }
5979
+ static fromApiKey(apiKey, options = {}) {
5980
+ const constructorOptions = { ...options, apiKey };
5981
+ if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
5982
+ throw new SeamHttpInvalidOptionsError("Missing apiKey");
5983
+ }
5984
+ return new _SeamHttpSeamCustomerV1Events(constructorOptions);
5985
+ }
5986
+ static fromClientSessionToken(clientSessionToken, options = {}) {
5987
+ const constructorOptions = { ...options, clientSessionToken };
5988
+ if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
5989
+ throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
5990
+ }
5991
+ return new _SeamHttpSeamCustomerV1Events(constructorOptions);
5992
+ }
5993
+ static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
5994
+ warnOnInsecureuserIdentifierKey(userIdentifierKey);
5995
+ const clientOptions = parseOptions({ ...options, publishableKey });
5996
+ if (isSeamHttpOptionsWithClient(clientOptions)) {
5997
+ throw new SeamHttpInvalidOptionsError(
5998
+ "The client option cannot be used with SeamHttpSeamCustomerV1Events.fromPublishableKey"
5999
+ );
6000
+ }
6001
+ const client = createClient(clientOptions);
6002
+ const clientSessions = SeamHttpClientSessions.fromClient(client);
6003
+ const { token } = await clientSessions.getOrCreate({
6004
+ user_identifier_key: userIdentifierKey
6005
+ });
6006
+ return _SeamHttpSeamCustomerV1Events.fromClientSessionToken(token, options);
6007
+ }
6008
+ static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
6009
+ const constructorOptions = { ...options, consoleSessionToken, workspaceId };
6010
+ if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
6011
+ throw new SeamHttpInvalidOptionsError(
6012
+ "Missing consoleSessionToken or workspaceId"
6013
+ );
6014
+ }
6015
+ return new _SeamHttpSeamCustomerV1Events(constructorOptions);
6016
+ }
6017
+ static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
6018
+ const constructorOptions = { ...options, personalAccessToken, workspaceId };
6019
+ if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
6020
+ throw new SeamHttpInvalidOptionsError(
6021
+ "Missing personalAccessToken or workspaceId"
6022
+ );
6023
+ }
6024
+ return new _SeamHttpSeamCustomerV1Events(constructorOptions);
6025
+ }
6026
+ createPaginator(request) {
6027
+ return new SeamPaginator(this, request);
6028
+ }
6029
+ async updateClientSessionToken(clientSessionToken) {
6030
+ const { headers } = this.client.defaults;
6031
+ const authHeaders = getAuthHeadersForClientSessionToken({
6032
+ clientSessionToken
6033
+ });
6034
+ for (const key of Object.keys(authHeaders)) {
6035
+ if (headers[key] == null) {
6036
+ throw new Error(
6037
+ "Cannot update a clientSessionToken on a client created without a clientSessionToken"
6038
+ );
6039
+ }
6040
+ }
6041
+ this.client.defaults.headers = { ...headers, ...authHeaders };
6042
+ const clientSessions = SeamHttpClientSessions.fromClient(this.client);
6043
+ await clientSessions.get();
6044
+ }
6045
+ list(parameters, options = {}) {
6046
+ if (!this.defaults.isUndocumentedApiEnabled) {
6047
+ throw new Error(
6048
+ "Cannot use undocumented API without isUndocumentedApiEnabled"
6049
+ );
6050
+ }
6051
+ return new SeamHttpRequest(this, {
6052
+ pathname: "/seam/customer/v1/events/list",
6053
+ method: "POST",
6054
+ body: parameters,
6055
+ responseKey: "events",
6056
+ options
6057
+ });
6058
+ }
6059
+ };
6060
+ _SeamHttpSeamCustomerV1Events.ltsVersion = seamApiLtsVersion;
6061
+ var SeamHttpSeamCustomerV1Events = _SeamHttpSeamCustomerV1Events;
6062
+
5957
6063
  // src/lib/seam/connect/routes/seam/customer/v1/portals/portals.ts
5958
6064
  var _SeamHttpSeamCustomerV1Portals = class _SeamHttpSeamCustomerV1Portals {
5959
6065
  constructor(apiKeyOrOptions = {}) {
@@ -6144,6 +6250,20 @@ var _SeamHttpSeamCustomerV1Settings = class _SeamHttpSeamCustomerV1Settings {
6144
6250
  const clientSessions = SeamHttpClientSessions.fromClient(this.client);
6145
6251
  await clientSessions.get();
6146
6252
  }
6253
+ get(parameters, options = {}) {
6254
+ if (!this.defaults.isUndocumentedApiEnabled) {
6255
+ throw new Error(
6256
+ "Cannot use undocumented API without isUndocumentedApiEnabled"
6257
+ );
6258
+ }
6259
+ return new SeamHttpRequest(this, {
6260
+ pathname: "/seam/customer/v1/settings/get",
6261
+ method: "GET",
6262
+ params: parameters,
6263
+ responseKey: "business_vertical",
6264
+ options
6265
+ });
6266
+ }
6147
6267
  update(parameters, options = {}) {
6148
6268
  if (!this.defaults.isUndocumentedApiEnabled) {
6149
6269
  throw new Error(
@@ -6260,6 +6380,9 @@ var _SeamHttpSeamCustomerV1 = class _SeamHttpSeamCustomerV1 {
6260
6380
  this.defaults
6261
6381
  );
6262
6382
  }
6383
+ get events() {
6384
+ return SeamHttpSeamCustomerV1Events.fromClient(this.client, this.defaults);
6385
+ }
6263
6386
  get portals() {
6264
6387
  return SeamHttpSeamCustomerV1Portals.fromClient(this.client, this.defaults);
6265
6388
  }
@@ -6656,11 +6779,6 @@ var _SeamHttpThermostatsDailyPrograms = class _SeamHttpThermostatsDailyPrograms
6656
6779
  constructor(apiKeyOrOptions = {}) {
6657
6780
  this.ltsVersion = seamApiLtsVersion;
6658
6781
  const options = parseOptions(apiKeyOrOptions);
6659
- if (!options.isUndocumentedApiEnabled) {
6660
- throw new Error(
6661
- "Cannot use undocumented API without isUndocumentedApiEnabled"
6662
- );
6663
- }
6664
6782
  this.client = "client" in options ? options.client : createClient(options);
6665
6783
  this.defaults = limitToSeamHttpRequestOptions(options);
6666
6784
  }
@@ -6741,11 +6859,6 @@ var _SeamHttpThermostatsDailyPrograms = class _SeamHttpThermostatsDailyPrograms
6741
6859
  await clientSessions.get();
6742
6860
  }
6743
6861
  create(parameters, options = {}) {
6744
- if (!this.defaults.isUndocumentedApiEnabled) {
6745
- throw new Error(
6746
- "Cannot use undocumented API without isUndocumentedApiEnabled"
6747
- );
6748
- }
6749
6862
  return new SeamHttpRequest(this, {
6750
6863
  pathname: "/thermostats/daily_programs/create",
6751
6864
  method: "POST",
@@ -6755,11 +6868,6 @@ var _SeamHttpThermostatsDailyPrograms = class _SeamHttpThermostatsDailyPrograms
6755
6868
  });
6756
6869
  }
6757
6870
  delete(parameters, options = {}) {
6758
- if (!this.defaults.isUndocumentedApiEnabled) {
6759
- throw new Error(
6760
- "Cannot use undocumented API without isUndocumentedApiEnabled"
6761
- );
6762
- }
6763
6871
  return new SeamHttpRequest(this, {
6764
6872
  pathname: "/thermostats/daily_programs/delete",
6765
6873
  method: "POST",
@@ -6769,11 +6877,6 @@ var _SeamHttpThermostatsDailyPrograms = class _SeamHttpThermostatsDailyPrograms
6769
6877
  });
6770
6878
  }
6771
6879
  update(parameters, options = {}) {
6772
- if (!this.defaults.isUndocumentedApiEnabled) {
6773
- throw new Error(
6774
- "Cannot use undocumented API without isUndocumentedApiEnabled"
6775
- );
6776
- }
6777
6880
  return new SeamHttpRequest(this, {
6778
6881
  pathname: "/thermostats/daily_programs/update",
6779
6882
  method: "PATCH",
@@ -7244,11 +7347,6 @@ var _SeamHttpThermostats = class _SeamHttpThermostats {
7244
7347
  });
7245
7348
  }
7246
7349
  updateWeeklyProgram(parameters, options = {}) {
7247
- if (!this.defaults.isUndocumentedApiEnabled) {
7248
- throw new Error(
7249
- "Cannot use undocumented API without isUndocumentedApiEnabled"
7250
- );
7251
- }
7252
7350
  return new SeamHttpRequest(this, {
7253
7351
  pathname: "/thermostats/update_weekly_program",
7254
7352
  method: "POST",
@@ -9953,6 +10051,18 @@ var _SeamHttpEndpoints = class _SeamHttpEndpoints {
9953
10051
  return seam.update(...args);
9954
10052
  };
9955
10053
  }
10054
+ get ["/seam/customer/v1/events/list"]() {
10055
+ const { client, defaults } = this;
10056
+ if (!this.defaults.isUndocumentedApiEnabled) {
10057
+ throw new Error(
10058
+ "Cannot use undocumented API without isUndocumentedApiEnabled"
10059
+ );
10060
+ }
10061
+ return function seamCustomerV1EventsList(...args) {
10062
+ const seam = SeamHttpSeamCustomerV1Events.fromClient(client, defaults);
10063
+ return seam.list(...args);
10064
+ };
10065
+ }
9956
10066
  get ["/seam/customer/v1/portals/get"]() {
9957
10067
  const { client, defaults } = this;
9958
10068
  if (!this.defaults.isUndocumentedApiEnabled) {
@@ -9965,6 +10075,18 @@ var _SeamHttpEndpoints = class _SeamHttpEndpoints {
9965
10075
  return seam.get(...args);
9966
10076
  };
9967
10077
  }
10078
+ get ["/seam/customer/v1/settings/get"]() {
10079
+ const { client, defaults } = this;
10080
+ if (!this.defaults.isUndocumentedApiEnabled) {
10081
+ throw new Error(
10082
+ "Cannot use undocumented API without isUndocumentedApiEnabled"
10083
+ );
10084
+ }
10085
+ return function seamCustomerV1SettingsGet(...args) {
10086
+ const seam = SeamHttpSeamCustomerV1Settings.fromClient(client, defaults);
10087
+ return seam.get(...args);
10088
+ };
10089
+ }
9968
10090
  get ["/seam/customer/v1/settings/update"]() {
9969
10091
  const { client, defaults } = this;
9970
10092
  if (!this.defaults.isUndocumentedApiEnabled) {
@@ -10167,11 +10289,6 @@ var _SeamHttpEndpoints = class _SeamHttpEndpoints {
10167
10289
  }
10168
10290
  get ["/thermostats/update_weekly_program"]() {
10169
10291
  const { client, defaults } = this;
10170
- if (!this.defaults.isUndocumentedApiEnabled) {
10171
- throw new Error(
10172
- "Cannot use undocumented API without isUndocumentedApiEnabled"
10173
- );
10174
- }
10175
10292
  return function thermostatsUpdateWeeklyProgram(...args) {
10176
10293
  const seam = SeamHttpThermostats.fromClient(client, defaults);
10177
10294
  return seam.updateWeeklyProgram(...args);
@@ -10179,11 +10296,6 @@ var _SeamHttpEndpoints = class _SeamHttpEndpoints {
10179
10296
  }
10180
10297
  get ["/thermostats/daily_programs/create"]() {
10181
10298
  const { client, defaults } = this;
10182
- if (!this.defaults.isUndocumentedApiEnabled) {
10183
- throw new Error(
10184
- "Cannot use undocumented API without isUndocumentedApiEnabled"
10185
- );
10186
- }
10187
10299
  return function thermostatsDailyProgramsCreate(...args) {
10188
10300
  const seam = SeamHttpThermostatsDailyPrograms.fromClient(client, defaults);
10189
10301
  return seam.create(...args);
@@ -10191,11 +10303,6 @@ var _SeamHttpEndpoints = class _SeamHttpEndpoints {
10191
10303
  }
10192
10304
  get ["/thermostats/daily_programs/delete"]() {
10193
10305
  const { client, defaults } = this;
10194
- if (!this.defaults.isUndocumentedApiEnabled) {
10195
- throw new Error(
10196
- "Cannot use undocumented API without isUndocumentedApiEnabled"
10197
- );
10198
- }
10199
10306
  return function thermostatsDailyProgramsDelete(...args) {
10200
10307
  const seam = SeamHttpThermostatsDailyPrograms.fromClient(client, defaults);
10201
10308
  return seam.delete(...args);
@@ -10203,11 +10310,6 @@ var _SeamHttpEndpoints = class _SeamHttpEndpoints {
10203
10310
  }
10204
10311
  get ["/thermostats/daily_programs/update"]() {
10205
10312
  const { client, defaults } = this;
10206
- if (!this.defaults.isUndocumentedApiEnabled) {
10207
- throw new Error(
10208
- "Cannot use undocumented API without isUndocumentedApiEnabled"
10209
- );
10210
- }
10211
10313
  return function thermostatsDailyProgramsUpdate(...args) {
10212
10314
  const seam = SeamHttpThermostatsDailyPrograms.fromClient(client, defaults);
10213
10315
  return seam.update(...args);
@@ -10910,6 +11012,7 @@ exports.SeamHttpSeamConsoleV1 = SeamHttpSeamConsoleV1;
10910
11012
  exports.SeamHttpSeamCustomerV1 = SeamHttpSeamCustomerV1;
10911
11013
  exports.SeamHttpSeamCustomerV1AutomationRuns = SeamHttpSeamCustomerV1AutomationRuns;
10912
11014
  exports.SeamHttpSeamCustomerV1Automations = SeamHttpSeamCustomerV1Automations;
11015
+ exports.SeamHttpSeamCustomerV1Events = SeamHttpSeamCustomerV1Events;
10913
11016
  exports.SeamHttpSeamCustomerV1Portals = SeamHttpSeamCustomerV1Portals;
10914
11017
  exports.SeamHttpSeamCustomerV1Settings = SeamHttpSeamCustomerV1Settings;
10915
11018
  exports.SeamHttpSeamPartnerV1BuildingBlocks = SeamHttpSeamPartnerV1BuildingBlocks;