@seamapi/http 1.100.0 → 1.101.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 +193 -0
  2. package/dist/connect.cjs.map +1 -1
  3. package/dist/connect.d.cts +49 -2
  4. package/dist/index.cjs +197 -0
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.d.cts +1 -1
  7. package/lib/seam/connect/routes/seam/index.d.ts +1 -0
  8. package/lib/seam/connect/routes/seam/index.js +1 -0
  9. package/lib/seam/connect/routes/seam/index.js.map +1 -1
  10. package/lib/seam/connect/routes/seam/v1/customers/customers.d.ts +34 -0
  11. package/lib/seam/connect/routes/seam/v1/customers/customers.js +98 -0
  12. package/lib/seam/connect/routes/seam/v1/customers/customers.js.map +1 -0
  13. package/lib/seam/connect/routes/seam/v1/customers/index.d.ts +1 -0
  14. package/lib/seam/connect/routes/seam/v1/customers/index.js +6 -0
  15. package/lib/seam/connect/routes/seam/v1/customers/index.js.map +1 -0
  16. package/lib/seam/connect/routes/seam/v1/index.d.ts +2 -0
  17. package/lib/seam/connect/routes/seam/v1/index.js +7 -0
  18. package/lib/seam/connect/routes/seam/v1/index.js.map +1 -0
  19. package/lib/seam/connect/routes/seam/v1/v1.d.ts +21 -0
  20. package/lib/seam/connect/routes/seam/v1/v1.js +92 -0
  21. package/lib/seam/connect/routes/seam/v1/v1.js.map +1 -0
  22. package/lib/seam/connect/routes/seam-http-endpoints.d.ts +3 -1
  23. package/lib/seam/connect/routes/seam-http-endpoints.js +8 -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/seam/index.ts +1 -0
  29. package/src/lib/seam/connect/routes/seam/v1/customers/customers.ts +197 -0
  30. package/src/lib/seam/connect/routes/seam/v1/customers/index.ts +6 -0
  31. package/src/lib/seam/connect/routes/seam/v1/index.ts +7 -0
  32. package/src/lib/seam/connect/routes/seam/v1/v1.ts +168 -0
  33. package/src/lib/seam/connect/routes/seam-http-endpoints.ts +20 -0
  34. package/src/lib/version.ts +1 -1
package/dist/connect.cjs CHANGED
@@ -7715,6 +7715,190 @@ var SeamHttpSeamPartnerV1BuildingBlocks = class _SeamHttpSeamPartnerV1BuildingBl
7715
7715
  }
7716
7716
  };
7717
7717
 
7718
+ // src/lib/seam/connect/routes/seam/v1/customers/customers.ts
7719
+ var SeamHttpSeamV1Customers = class _SeamHttpSeamV1Customers {
7720
+ client;
7721
+ defaults;
7722
+ ltsVersion = seamApiLtsVersion;
7723
+ static ltsVersion = seamApiLtsVersion;
7724
+ constructor(apiKeyOrOptions = {}) {
7725
+ const options = parseOptions(apiKeyOrOptions);
7726
+ this.client = "client" in options ? options.client : createClient(options);
7727
+ this.defaults = limitToSeamHttpRequestOptions(options);
7728
+ }
7729
+ static fromClient(client, options = {}) {
7730
+ const constructorOptions = { ...options, client };
7731
+ if (!isSeamHttpOptionsWithClient(constructorOptions)) {
7732
+ throw new SeamHttpInvalidOptionsError("Missing client");
7733
+ }
7734
+ return new _SeamHttpSeamV1Customers(constructorOptions);
7735
+ }
7736
+ static fromApiKey(apiKey, options = {}) {
7737
+ const constructorOptions = { ...options, apiKey };
7738
+ if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
7739
+ throw new SeamHttpInvalidOptionsError("Missing apiKey");
7740
+ }
7741
+ return new _SeamHttpSeamV1Customers(constructorOptions);
7742
+ }
7743
+ static fromClientSessionToken(clientSessionToken, options = {}) {
7744
+ const constructorOptions = { ...options, clientSessionToken };
7745
+ if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
7746
+ throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
7747
+ }
7748
+ return new _SeamHttpSeamV1Customers(constructorOptions);
7749
+ }
7750
+ static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
7751
+ warnOnInsecureuserIdentifierKey(userIdentifierKey);
7752
+ const clientOptions = parseOptions({ ...options, publishableKey });
7753
+ if (isSeamHttpOptionsWithClient(clientOptions)) {
7754
+ throw new SeamHttpInvalidOptionsError(
7755
+ "The client option cannot be used with SeamHttpSeamV1Customers.fromPublishableKey"
7756
+ );
7757
+ }
7758
+ const client = createClient(clientOptions);
7759
+ const clientSessions = SeamHttpClientSessions.fromClient(client);
7760
+ const { token } = await clientSessions.getOrCreate({
7761
+ user_identifier_key: userIdentifierKey
7762
+ });
7763
+ return _SeamHttpSeamV1Customers.fromClientSessionToken(token, options);
7764
+ }
7765
+ static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
7766
+ const constructorOptions = { ...options, consoleSessionToken, workspaceId };
7767
+ if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
7768
+ throw new SeamHttpInvalidOptionsError(
7769
+ "Missing consoleSessionToken or workspaceId"
7770
+ );
7771
+ }
7772
+ return new _SeamHttpSeamV1Customers(constructorOptions);
7773
+ }
7774
+ static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
7775
+ const constructorOptions = { ...options, personalAccessToken, workspaceId };
7776
+ if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
7777
+ throw new SeamHttpInvalidOptionsError(
7778
+ "Missing personalAccessToken or workspaceId"
7779
+ );
7780
+ }
7781
+ return new _SeamHttpSeamV1Customers(constructorOptions);
7782
+ }
7783
+ createPaginator(request) {
7784
+ return new SeamPaginator(this, request);
7785
+ }
7786
+ async updateClientSessionToken(clientSessionToken) {
7787
+ const { headers } = this.client.defaults;
7788
+ const authHeaders = getAuthHeadersForClientSessionToken({
7789
+ clientSessionToken
7790
+ });
7791
+ for (const key of Object.keys(authHeaders)) {
7792
+ if (headers[key] == null) {
7793
+ throw new Error(
7794
+ "Cannot update a clientSessionToken on a client created without a clientSessionToken"
7795
+ );
7796
+ }
7797
+ }
7798
+ this.client.defaults.headers = { ...headers, ...authHeaders };
7799
+ const clientSessions = SeamHttpClientSessions.fromClient(this.client);
7800
+ await clientSessions.get();
7801
+ }
7802
+ pushData(parameters, options = {}) {
7803
+ return new SeamHttpRequest(this, {
7804
+ pathname: "/seam/v1/customers/push_data",
7805
+ method: "POST",
7806
+ body: parameters,
7807
+ responseKey: void 0,
7808
+ options
7809
+ });
7810
+ }
7811
+ };
7812
+
7813
+ // src/lib/seam/connect/routes/seam/v1/v1.ts
7814
+ var SeamHttpSeamV1 = class _SeamHttpSeamV1 {
7815
+ client;
7816
+ defaults;
7817
+ ltsVersion = seamApiLtsVersion;
7818
+ static ltsVersion = seamApiLtsVersion;
7819
+ constructor(apiKeyOrOptions = {}) {
7820
+ const options = parseOptions(apiKeyOrOptions);
7821
+ this.client = "client" in options ? options.client : createClient(options);
7822
+ this.defaults = limitToSeamHttpRequestOptions(options);
7823
+ }
7824
+ static fromClient(client, options = {}) {
7825
+ const constructorOptions = { ...options, client };
7826
+ if (!isSeamHttpOptionsWithClient(constructorOptions)) {
7827
+ throw new SeamHttpInvalidOptionsError("Missing client");
7828
+ }
7829
+ return new _SeamHttpSeamV1(constructorOptions);
7830
+ }
7831
+ static fromApiKey(apiKey, options = {}) {
7832
+ const constructorOptions = { ...options, apiKey };
7833
+ if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
7834
+ throw new SeamHttpInvalidOptionsError("Missing apiKey");
7835
+ }
7836
+ return new _SeamHttpSeamV1(constructorOptions);
7837
+ }
7838
+ static fromClientSessionToken(clientSessionToken, options = {}) {
7839
+ const constructorOptions = { ...options, clientSessionToken };
7840
+ if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
7841
+ throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
7842
+ }
7843
+ return new _SeamHttpSeamV1(constructorOptions);
7844
+ }
7845
+ static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
7846
+ warnOnInsecureuserIdentifierKey(userIdentifierKey);
7847
+ const clientOptions = parseOptions({ ...options, publishableKey });
7848
+ if (isSeamHttpOptionsWithClient(clientOptions)) {
7849
+ throw new SeamHttpInvalidOptionsError(
7850
+ "The client option cannot be used with SeamHttpSeamV1.fromPublishableKey"
7851
+ );
7852
+ }
7853
+ const client = createClient(clientOptions);
7854
+ const clientSessions = SeamHttpClientSessions.fromClient(client);
7855
+ const { token } = await clientSessions.getOrCreate({
7856
+ user_identifier_key: userIdentifierKey
7857
+ });
7858
+ return _SeamHttpSeamV1.fromClientSessionToken(token, options);
7859
+ }
7860
+ static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
7861
+ const constructorOptions = { ...options, consoleSessionToken, workspaceId };
7862
+ if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
7863
+ throw new SeamHttpInvalidOptionsError(
7864
+ "Missing consoleSessionToken or workspaceId"
7865
+ );
7866
+ }
7867
+ return new _SeamHttpSeamV1(constructorOptions);
7868
+ }
7869
+ static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
7870
+ const constructorOptions = { ...options, personalAccessToken, workspaceId };
7871
+ if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
7872
+ throw new SeamHttpInvalidOptionsError(
7873
+ "Missing personalAccessToken or workspaceId"
7874
+ );
7875
+ }
7876
+ return new _SeamHttpSeamV1(constructorOptions);
7877
+ }
7878
+ createPaginator(request) {
7879
+ return new SeamPaginator(this, request);
7880
+ }
7881
+ async updateClientSessionToken(clientSessionToken) {
7882
+ const { headers } = this.client.defaults;
7883
+ const authHeaders = getAuthHeadersForClientSessionToken({
7884
+ clientSessionToken
7885
+ });
7886
+ for (const key of Object.keys(authHeaders)) {
7887
+ if (headers[key] == null) {
7888
+ throw new Error(
7889
+ "Cannot update a clientSessionToken on a client created without a clientSessionToken"
7890
+ );
7891
+ }
7892
+ }
7893
+ this.client.defaults.headers = { ...headers, ...authHeaders };
7894
+ const clientSessions = SeamHttpClientSessions.fromClient(this.client);
7895
+ await clientSessions.get();
7896
+ }
7897
+ get customers() {
7898
+ return SeamHttpSeamV1Customers.fromClient(this.client, this.defaults);
7899
+ }
7900
+ };
7901
+
7718
7902
  // src/lib/seam/connect/routes/spaces/spaces.ts
7719
7903
  var SeamHttpSpaces = class _SeamHttpSpaces {
7720
7904
  client;
@@ -11352,6 +11536,13 @@ var SeamHttpEndpoints = class _SeamHttpEndpoints {
11352
11536
  return seam.autoMap(...args);
11353
11537
  };
11354
11538
  }
11539
+ get "/seam/v1/customers/push_data"() {
11540
+ const { client, defaults } = this;
11541
+ return function seamV1CustomersPushData(...args) {
11542
+ const seam = SeamHttpSeamV1Customers.fromClient(client, defaults);
11543
+ return seam.pushData(...args);
11544
+ };
11545
+ }
11355
11546
  get "/spaces/add_acs_entrances"() {
11356
11547
  const { client, defaults } = this;
11357
11548
  return function spacesAddAcsEntrances(...args) {
@@ -12175,6 +12366,8 @@ exports.SeamHttpSeamCustomerV1Spaces = SeamHttpSeamCustomerV1Spaces;
12175
12366
  exports.SeamHttpSeamCustomerV1StaffMembers = SeamHttpSeamCustomerV1StaffMembers;
12176
12367
  exports.SeamHttpSeamPartnerV1BuildingBlocks = SeamHttpSeamPartnerV1BuildingBlocks;
12177
12368
  exports.SeamHttpSeamPartnerV1BuildingBlocksSpaces = SeamHttpSeamPartnerV1BuildingBlocksSpaces;
12369
+ exports.SeamHttpSeamV1 = SeamHttpSeamV1;
12370
+ exports.SeamHttpSeamV1Customers = SeamHttpSeamV1Customers;
12178
12371
  exports.SeamHttpSpaces = SeamHttpSpaces;
12179
12372
  exports.SeamHttpThermostats = SeamHttpThermostats;
12180
12373
  exports.SeamHttpThermostatsDailyPrograms = SeamHttpThermostatsDailyPrograms;