@seamapi/http 1.100.0 → 1.102.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 (50) hide show
  1. package/dist/connect.cjs +323 -0
  2. package/dist/connect.cjs.map +1 -1
  3. package/dist/connect.d.cts +81 -3
  4. package/dist/index.cjs +329 -0
  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/connector-customers/connector-customers.d.ts +34 -0
  8. package/lib/seam/connect/routes/seam/customer/v1/connector-customers/connector-customers.js +104 -0
  9. package/lib/seam/connect/routes/seam/customer/v1/connector-customers/connector-customers.js.map +1 -0
  10. package/lib/seam/connect/routes/seam/customer/v1/connector-customers/index.d.ts +1 -0
  11. package/lib/seam/connect/routes/seam/customer/v1/connector-customers/index.js +6 -0
  12. package/lib/seam/connect/routes/seam/customer/v1/connector-customers/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/v1.d.ts +2 -0
  17. package/lib/seam/connect/routes/seam/customer/v1/v1.js +4 -0
  18. package/lib/seam/connect/routes/seam/customer/v1/v1.js.map +1 -1
  19. package/lib/seam/connect/routes/seam/index.d.ts +1 -0
  20. package/lib/seam/connect/routes/seam/index.js +1 -0
  21. package/lib/seam/connect/routes/seam/index.js.map +1 -1
  22. package/lib/seam/connect/routes/seam/v1/customers/customers.d.ts +34 -0
  23. package/lib/seam/connect/routes/seam/v1/customers/customers.js +98 -0
  24. package/lib/seam/connect/routes/seam/v1/customers/customers.js.map +1 -0
  25. package/lib/seam/connect/routes/seam/v1/customers/index.d.ts +1 -0
  26. package/lib/seam/connect/routes/seam/v1/customers/index.js +6 -0
  27. package/lib/seam/connect/routes/seam/v1/customers/index.js.map +1 -0
  28. package/lib/seam/connect/routes/seam/v1/index.d.ts +2 -0
  29. package/lib/seam/connect/routes/seam/v1/index.js +7 -0
  30. package/lib/seam/connect/routes/seam/v1/index.js.map +1 -0
  31. package/lib/seam/connect/routes/seam/v1/v1.d.ts +21 -0
  32. package/lib/seam/connect/routes/seam/v1/v1.js +92 -0
  33. package/lib/seam/connect/routes/seam/v1/v1.js.map +1 -0
  34. package/lib/seam/connect/routes/seam-http-endpoints.d.ts +6 -2
  35. package/lib/seam/connect/routes/seam-http-endpoints.js +19 -0
  36. package/lib/seam/connect/routes/seam-http-endpoints.js.map +1 -1
  37. package/lib/version.d.ts +1 -1
  38. package/lib/version.js +1 -1
  39. package/package.json +3 -3
  40. package/src/lib/seam/connect/routes/seam/customer/v1/connector-customers/connector-customers.ts +214 -0
  41. package/src/lib/seam/connect/routes/seam/customer/v1/connector-customers/index.ts +6 -0
  42. package/src/lib/seam/connect/routes/seam/customer/v1/index.ts +1 -0
  43. package/src/lib/seam/connect/routes/seam/customer/v1/v1.ts +8 -0
  44. package/src/lib/seam/connect/routes/seam/index.ts +1 -0
  45. package/src/lib/seam/connect/routes/seam/v1/customers/customers.ts +197 -0
  46. package/src/lib/seam/connect/routes/seam/v1/customers/index.ts +6 -0
  47. package/src/lib/seam/connect/routes/seam/v1/index.ts +7 -0
  48. package/src/lib/seam/connect/routes/seam/v1/v1.ts +168 -0
  49. package/src/lib/seam/connect/routes/seam-http-endpoints.ts +48 -0
  50. package/src/lib/version.ts +1 -1
package/dist/connect.cjs CHANGED
@@ -6342,6 +6342,114 @@ var SeamHttpSeamCustomerV1Automations = class _SeamHttpSeamCustomerV1Automations
6342
6342
  }
6343
6343
  };
6344
6344
 
6345
+ // src/lib/seam/connect/routes/seam/customer/v1/connector-customers/connector-customers.ts
6346
+ var SeamHttpSeamCustomerV1ConnectorCustomers = class _SeamHttpSeamCustomerV1ConnectorCustomers {
6347
+ client;
6348
+ defaults;
6349
+ ltsVersion = seamApiLtsVersion;
6350
+ static ltsVersion = seamApiLtsVersion;
6351
+ constructor(apiKeyOrOptions = {}) {
6352
+ const options = parseOptions(apiKeyOrOptions);
6353
+ if (!options.isUndocumentedApiEnabled) {
6354
+ throw new Error(
6355
+ "Cannot use undocumented API without isUndocumentedApiEnabled"
6356
+ );
6357
+ }
6358
+ this.client = "client" in options ? options.client : createClient(options);
6359
+ this.defaults = limitToSeamHttpRequestOptions(options);
6360
+ }
6361
+ static fromClient(client, options = {}) {
6362
+ const constructorOptions = { ...options, client };
6363
+ if (!isSeamHttpOptionsWithClient(constructorOptions)) {
6364
+ throw new SeamHttpInvalidOptionsError("Missing client");
6365
+ }
6366
+ return new _SeamHttpSeamCustomerV1ConnectorCustomers(constructorOptions);
6367
+ }
6368
+ static fromApiKey(apiKey, options = {}) {
6369
+ const constructorOptions = { ...options, apiKey };
6370
+ if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
6371
+ throw new SeamHttpInvalidOptionsError("Missing apiKey");
6372
+ }
6373
+ return new _SeamHttpSeamCustomerV1ConnectorCustomers(constructorOptions);
6374
+ }
6375
+ static fromClientSessionToken(clientSessionToken, options = {}) {
6376
+ const constructorOptions = { ...options, clientSessionToken };
6377
+ if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
6378
+ throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
6379
+ }
6380
+ return new _SeamHttpSeamCustomerV1ConnectorCustomers(constructorOptions);
6381
+ }
6382
+ static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
6383
+ warnOnInsecureuserIdentifierKey(userIdentifierKey);
6384
+ const clientOptions = parseOptions({ ...options, publishableKey });
6385
+ if (isSeamHttpOptionsWithClient(clientOptions)) {
6386
+ throw new SeamHttpInvalidOptionsError(
6387
+ "The client option cannot be used with SeamHttpSeamCustomerV1ConnectorCustomers.fromPublishableKey"
6388
+ );
6389
+ }
6390
+ const client = createClient(clientOptions);
6391
+ const clientSessions = SeamHttpClientSessions.fromClient(client);
6392
+ const { token } = await clientSessions.getOrCreate({
6393
+ user_identifier_key: userIdentifierKey
6394
+ });
6395
+ return _SeamHttpSeamCustomerV1ConnectorCustomers.fromClientSessionToken(
6396
+ token,
6397
+ options
6398
+ );
6399
+ }
6400
+ static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
6401
+ const constructorOptions = { ...options, consoleSessionToken, workspaceId };
6402
+ if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
6403
+ throw new SeamHttpInvalidOptionsError(
6404
+ "Missing consoleSessionToken or workspaceId"
6405
+ );
6406
+ }
6407
+ return new _SeamHttpSeamCustomerV1ConnectorCustomers(constructorOptions);
6408
+ }
6409
+ static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
6410
+ const constructorOptions = { ...options, personalAccessToken, workspaceId };
6411
+ if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
6412
+ throw new SeamHttpInvalidOptionsError(
6413
+ "Missing personalAccessToken or workspaceId"
6414
+ );
6415
+ }
6416
+ return new _SeamHttpSeamCustomerV1ConnectorCustomers(constructorOptions);
6417
+ }
6418
+ createPaginator(request) {
6419
+ return new SeamPaginator(this, request);
6420
+ }
6421
+ async updateClientSessionToken(clientSessionToken) {
6422
+ const { headers } = this.client.defaults;
6423
+ const authHeaders = getAuthHeadersForClientSessionToken({
6424
+ clientSessionToken
6425
+ });
6426
+ for (const key of Object.keys(authHeaders)) {
6427
+ if (headers[key] == null) {
6428
+ throw new Error(
6429
+ "Cannot update a clientSessionToken on a client created without a clientSessionToken"
6430
+ );
6431
+ }
6432
+ }
6433
+ this.client.defaults.headers = { ...headers, ...authHeaders };
6434
+ const clientSessions = SeamHttpClientSessions.fromClient(this.client);
6435
+ await clientSessions.get();
6436
+ }
6437
+ list(parameters, options = {}) {
6438
+ if (!this.defaults.isUndocumentedApiEnabled) {
6439
+ throw new Error(
6440
+ "Cannot use undocumented API without isUndocumentedApiEnabled"
6441
+ );
6442
+ }
6443
+ return new SeamHttpRequest(this, {
6444
+ pathname: "/seam/customer/v1/connector_customers/list",
6445
+ method: "POST",
6446
+ body: parameters,
6447
+ responseKey: "connector_customers",
6448
+ options
6449
+ });
6450
+ }
6451
+ };
6452
+
6345
6453
  // src/lib/seam/connect/routes/seam/customer/v1/connectors/connectors.ts
6346
6454
  var SeamHttpSeamCustomerV1Connectors = class _SeamHttpSeamCustomerV1Connectors {
6347
6455
  client;
@@ -7469,6 +7577,12 @@ var SeamHttpSeamCustomerV1 = class _SeamHttpSeamCustomerV1 {
7469
7577
  this.defaults
7470
7578
  );
7471
7579
  }
7580
+ get connectorCustomers() {
7581
+ return SeamHttpSeamCustomerV1ConnectorCustomers.fromClient(
7582
+ this.client,
7583
+ this.defaults
7584
+ );
7585
+ }
7472
7586
  get connectors() {
7473
7587
  return SeamHttpSeamCustomerV1Connectors.fromClient(
7474
7588
  this.client,
@@ -7715,6 +7829,190 @@ var SeamHttpSeamPartnerV1BuildingBlocks = class _SeamHttpSeamPartnerV1BuildingBl
7715
7829
  }
7716
7830
  };
7717
7831
 
7832
+ // src/lib/seam/connect/routes/seam/v1/customers/customers.ts
7833
+ var SeamHttpSeamV1Customers = class _SeamHttpSeamV1Customers {
7834
+ client;
7835
+ defaults;
7836
+ ltsVersion = seamApiLtsVersion;
7837
+ static ltsVersion = seamApiLtsVersion;
7838
+ constructor(apiKeyOrOptions = {}) {
7839
+ const options = parseOptions(apiKeyOrOptions);
7840
+ this.client = "client" in options ? options.client : createClient(options);
7841
+ this.defaults = limitToSeamHttpRequestOptions(options);
7842
+ }
7843
+ static fromClient(client, options = {}) {
7844
+ const constructorOptions = { ...options, client };
7845
+ if (!isSeamHttpOptionsWithClient(constructorOptions)) {
7846
+ throw new SeamHttpInvalidOptionsError("Missing client");
7847
+ }
7848
+ return new _SeamHttpSeamV1Customers(constructorOptions);
7849
+ }
7850
+ static fromApiKey(apiKey, options = {}) {
7851
+ const constructorOptions = { ...options, apiKey };
7852
+ if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
7853
+ throw new SeamHttpInvalidOptionsError("Missing apiKey");
7854
+ }
7855
+ return new _SeamHttpSeamV1Customers(constructorOptions);
7856
+ }
7857
+ static fromClientSessionToken(clientSessionToken, options = {}) {
7858
+ const constructorOptions = { ...options, clientSessionToken };
7859
+ if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
7860
+ throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
7861
+ }
7862
+ return new _SeamHttpSeamV1Customers(constructorOptions);
7863
+ }
7864
+ static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
7865
+ warnOnInsecureuserIdentifierKey(userIdentifierKey);
7866
+ const clientOptions = parseOptions({ ...options, publishableKey });
7867
+ if (isSeamHttpOptionsWithClient(clientOptions)) {
7868
+ throw new SeamHttpInvalidOptionsError(
7869
+ "The client option cannot be used with SeamHttpSeamV1Customers.fromPublishableKey"
7870
+ );
7871
+ }
7872
+ const client = createClient(clientOptions);
7873
+ const clientSessions = SeamHttpClientSessions.fromClient(client);
7874
+ const { token } = await clientSessions.getOrCreate({
7875
+ user_identifier_key: userIdentifierKey
7876
+ });
7877
+ return _SeamHttpSeamV1Customers.fromClientSessionToken(token, options);
7878
+ }
7879
+ static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
7880
+ const constructorOptions = { ...options, consoleSessionToken, workspaceId };
7881
+ if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
7882
+ throw new SeamHttpInvalidOptionsError(
7883
+ "Missing consoleSessionToken or workspaceId"
7884
+ );
7885
+ }
7886
+ return new _SeamHttpSeamV1Customers(constructorOptions);
7887
+ }
7888
+ static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
7889
+ const constructorOptions = { ...options, personalAccessToken, workspaceId };
7890
+ if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
7891
+ throw new SeamHttpInvalidOptionsError(
7892
+ "Missing personalAccessToken or workspaceId"
7893
+ );
7894
+ }
7895
+ return new _SeamHttpSeamV1Customers(constructorOptions);
7896
+ }
7897
+ createPaginator(request) {
7898
+ return new SeamPaginator(this, request);
7899
+ }
7900
+ async updateClientSessionToken(clientSessionToken) {
7901
+ const { headers } = this.client.defaults;
7902
+ const authHeaders = getAuthHeadersForClientSessionToken({
7903
+ clientSessionToken
7904
+ });
7905
+ for (const key of Object.keys(authHeaders)) {
7906
+ if (headers[key] == null) {
7907
+ throw new Error(
7908
+ "Cannot update a clientSessionToken on a client created without a clientSessionToken"
7909
+ );
7910
+ }
7911
+ }
7912
+ this.client.defaults.headers = { ...headers, ...authHeaders };
7913
+ const clientSessions = SeamHttpClientSessions.fromClient(this.client);
7914
+ await clientSessions.get();
7915
+ }
7916
+ pushData(parameters, options = {}) {
7917
+ return new SeamHttpRequest(this, {
7918
+ pathname: "/seam/v1/customers/push_data",
7919
+ method: "POST",
7920
+ body: parameters,
7921
+ responseKey: void 0,
7922
+ options
7923
+ });
7924
+ }
7925
+ };
7926
+
7927
+ // src/lib/seam/connect/routes/seam/v1/v1.ts
7928
+ var SeamHttpSeamV1 = class _SeamHttpSeamV1 {
7929
+ client;
7930
+ defaults;
7931
+ ltsVersion = seamApiLtsVersion;
7932
+ static ltsVersion = seamApiLtsVersion;
7933
+ constructor(apiKeyOrOptions = {}) {
7934
+ const options = parseOptions(apiKeyOrOptions);
7935
+ this.client = "client" in options ? options.client : createClient(options);
7936
+ this.defaults = limitToSeamHttpRequestOptions(options);
7937
+ }
7938
+ static fromClient(client, options = {}) {
7939
+ const constructorOptions = { ...options, client };
7940
+ if (!isSeamHttpOptionsWithClient(constructorOptions)) {
7941
+ throw new SeamHttpInvalidOptionsError("Missing client");
7942
+ }
7943
+ return new _SeamHttpSeamV1(constructorOptions);
7944
+ }
7945
+ static fromApiKey(apiKey, options = {}) {
7946
+ const constructorOptions = { ...options, apiKey };
7947
+ if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
7948
+ throw new SeamHttpInvalidOptionsError("Missing apiKey");
7949
+ }
7950
+ return new _SeamHttpSeamV1(constructorOptions);
7951
+ }
7952
+ static fromClientSessionToken(clientSessionToken, options = {}) {
7953
+ const constructorOptions = { ...options, clientSessionToken };
7954
+ if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
7955
+ throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
7956
+ }
7957
+ return new _SeamHttpSeamV1(constructorOptions);
7958
+ }
7959
+ static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
7960
+ warnOnInsecureuserIdentifierKey(userIdentifierKey);
7961
+ const clientOptions = parseOptions({ ...options, publishableKey });
7962
+ if (isSeamHttpOptionsWithClient(clientOptions)) {
7963
+ throw new SeamHttpInvalidOptionsError(
7964
+ "The client option cannot be used with SeamHttpSeamV1.fromPublishableKey"
7965
+ );
7966
+ }
7967
+ const client = createClient(clientOptions);
7968
+ const clientSessions = SeamHttpClientSessions.fromClient(client);
7969
+ const { token } = await clientSessions.getOrCreate({
7970
+ user_identifier_key: userIdentifierKey
7971
+ });
7972
+ return _SeamHttpSeamV1.fromClientSessionToken(token, options);
7973
+ }
7974
+ static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
7975
+ const constructorOptions = { ...options, consoleSessionToken, workspaceId };
7976
+ if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
7977
+ throw new SeamHttpInvalidOptionsError(
7978
+ "Missing consoleSessionToken or workspaceId"
7979
+ );
7980
+ }
7981
+ return new _SeamHttpSeamV1(constructorOptions);
7982
+ }
7983
+ static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
7984
+ const constructorOptions = { ...options, personalAccessToken, workspaceId };
7985
+ if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
7986
+ throw new SeamHttpInvalidOptionsError(
7987
+ "Missing personalAccessToken or workspaceId"
7988
+ );
7989
+ }
7990
+ return new _SeamHttpSeamV1(constructorOptions);
7991
+ }
7992
+ createPaginator(request) {
7993
+ return new SeamPaginator(this, request);
7994
+ }
7995
+ async updateClientSessionToken(clientSessionToken) {
7996
+ const { headers } = this.client.defaults;
7997
+ const authHeaders = getAuthHeadersForClientSessionToken({
7998
+ clientSessionToken
7999
+ });
8000
+ for (const key of Object.keys(authHeaders)) {
8001
+ if (headers[key] == null) {
8002
+ throw new Error(
8003
+ "Cannot update a clientSessionToken on a client created without a clientSessionToken"
8004
+ );
8005
+ }
8006
+ }
8007
+ this.client.defaults.headers = { ...headers, ...authHeaders };
8008
+ const clientSessions = SeamHttpClientSessions.fromClient(this.client);
8009
+ await clientSessions.get();
8010
+ }
8011
+ get customers() {
8012
+ return SeamHttpSeamV1Customers.fromClient(this.client, this.defaults);
8013
+ }
8014
+ };
8015
+
7718
8016
  // src/lib/seam/connect/routes/spaces/spaces.ts
7719
8017
  var SeamHttpSpaces = class _SeamHttpSpaces {
7720
8018
  client;
@@ -11085,6 +11383,21 @@ var SeamHttpEndpoints = class _SeamHttpEndpoints {
11085
11383
  return seam.update(...args);
11086
11384
  };
11087
11385
  }
11386
+ get "/seam/customer/v1/connector_customers/list"() {
11387
+ const { client, defaults } = this;
11388
+ if (!this.defaults.isUndocumentedApiEnabled) {
11389
+ throw new Error(
11390
+ "Cannot use undocumented API without isUndocumentedApiEnabled"
11391
+ );
11392
+ }
11393
+ return function seamCustomerV1ConnectorCustomersList(...args) {
11394
+ const seam = SeamHttpSeamCustomerV1ConnectorCustomers.fromClient(
11395
+ client,
11396
+ defaults
11397
+ );
11398
+ return seam.list(...args);
11399
+ };
11400
+ }
11088
11401
  get "/seam/customer/v1/connectors/authorize"() {
11089
11402
  const { client, defaults } = this;
11090
11403
  if (!this.defaults.isUndocumentedApiEnabled) {
@@ -11352,6 +11665,13 @@ var SeamHttpEndpoints = class _SeamHttpEndpoints {
11352
11665
  return seam.autoMap(...args);
11353
11666
  };
11354
11667
  }
11668
+ get "/seam/v1/customers/push_data"() {
11669
+ const { client, defaults } = this;
11670
+ return function seamV1CustomersPushData(...args) {
11671
+ const seam = SeamHttpSeamV1Customers.fromClient(client, defaults);
11672
+ return seam.pushData(...args);
11673
+ };
11674
+ }
11355
11675
  get "/spaces/add_acs_entrances"() {
11356
11676
  const { client, defaults } = this;
11357
11677
  return function spacesAddAcsEntrances(...args) {
@@ -12165,6 +12485,7 @@ exports.SeamHttpSeamCustomerV1 = SeamHttpSeamCustomerV1;
12165
12485
  exports.SeamHttpSeamCustomerV1AccessGrants = SeamHttpSeamCustomerV1AccessGrants;
12166
12486
  exports.SeamHttpSeamCustomerV1AutomationRuns = SeamHttpSeamCustomerV1AutomationRuns;
12167
12487
  exports.SeamHttpSeamCustomerV1Automations = SeamHttpSeamCustomerV1Automations;
12488
+ exports.SeamHttpSeamCustomerV1ConnectorCustomers = SeamHttpSeamCustomerV1ConnectorCustomers;
12168
12489
  exports.SeamHttpSeamCustomerV1Connectors = SeamHttpSeamCustomerV1Connectors;
12169
12490
  exports.SeamHttpSeamCustomerV1Customers = SeamHttpSeamCustomerV1Customers;
12170
12491
  exports.SeamHttpSeamCustomerV1Events = SeamHttpSeamCustomerV1Events;
@@ -12175,6 +12496,8 @@ exports.SeamHttpSeamCustomerV1Spaces = SeamHttpSeamCustomerV1Spaces;
12175
12496
  exports.SeamHttpSeamCustomerV1StaffMembers = SeamHttpSeamCustomerV1StaffMembers;
12176
12497
  exports.SeamHttpSeamPartnerV1BuildingBlocks = SeamHttpSeamPartnerV1BuildingBlocks;
12177
12498
  exports.SeamHttpSeamPartnerV1BuildingBlocksSpaces = SeamHttpSeamPartnerV1BuildingBlocksSpaces;
12499
+ exports.SeamHttpSeamV1 = SeamHttpSeamV1;
12500
+ exports.SeamHttpSeamV1Customers = SeamHttpSeamV1Customers;
12178
12501
  exports.SeamHttpSpaces = SeamHttpSpaces;
12179
12502
  exports.SeamHttpThermostats = SeamHttpThermostats;
12180
12503
  exports.SeamHttpThermostatsDailyPrograms = SeamHttpThermostatsDailyPrograms;