@seamapi/http 0.23.0 → 0.25.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 (128) hide show
  1. package/README.md +15 -0
  2. package/dist/connect.cjs +847 -727
  3. package/dist/connect.cjs.map +1 -1
  4. package/dist/connect.d.cts +167 -126
  5. package/lib/seam/connect/routes/access-codes-unmanaged.d.ts +6 -5
  6. package/lib/seam/connect/routes/access-codes-unmanaged.js +26 -22
  7. package/lib/seam/connect/routes/access-codes-unmanaged.js.map +1 -1
  8. package/lib/seam/connect/routes/access-codes.d.ts +9 -8
  9. package/lib/seam/connect/routes/access-codes.js +41 -38
  10. package/lib/seam/connect/routes/access-codes.js.map +1 -1
  11. package/lib/seam/connect/routes/acs-access-groups.d.ts +6 -5
  12. package/lib/seam/connect/routes/acs-access-groups.js +26 -23
  13. package/lib/seam/connect/routes/acs-access-groups.js.map +1 -1
  14. package/lib/seam/connect/routes/acs-credential-pools.d.ts +2 -1
  15. package/lib/seam/connect/routes/acs-credential-pools.js +6 -5
  16. package/lib/seam/connect/routes/acs-credential-pools.js.map +1 -1
  17. package/lib/seam/connect/routes/acs-credential-provisioning-automations.d.ts +2 -1
  18. package/lib/seam/connect/routes/acs-credential-provisioning-automations.js +6 -5
  19. package/lib/seam/connect/routes/acs-credential-provisioning-automations.js.map +1 -1
  20. package/lib/seam/connect/routes/acs-credentials.d.ts +8 -7
  21. package/lib/seam/connect/routes/acs-credentials.js +36 -34
  22. package/lib/seam/connect/routes/acs-credentials.js.map +1 -1
  23. package/lib/seam/connect/routes/acs-entrances.d.ts +5 -4
  24. package/lib/seam/connect/routes/acs-entrances.js +21 -19
  25. package/lib/seam/connect/routes/acs-entrances.js.map +1 -1
  26. package/lib/seam/connect/routes/acs-systems.d.ts +3 -2
  27. package/lib/seam/connect/routes/acs-systems.js +11 -10
  28. package/lib/seam/connect/routes/acs-systems.js.map +1 -1
  29. package/lib/seam/connect/routes/acs-users.d.ts +12 -11
  30. package/lib/seam/connect/routes/acs-users.js +56 -48
  31. package/lib/seam/connect/routes/acs-users.js.map +1 -1
  32. package/lib/seam/connect/routes/action-attempts.d.ts +3 -2
  33. package/lib/seam/connect/routes/action-attempts.js +12 -18
  34. package/lib/seam/connect/routes/action-attempts.js.map +1 -1
  35. package/lib/seam/connect/routes/client-sessions.d.ts +8 -7
  36. package/lib/seam/connect/routes/client-sessions.js +36 -33
  37. package/lib/seam/connect/routes/client-sessions.js.map +1 -1
  38. package/lib/seam/connect/routes/connect-webviews.d.ts +6 -5
  39. package/lib/seam/connect/routes/connect-webviews.js +25 -22
  40. package/lib/seam/connect/routes/connect-webviews.js.map +1 -1
  41. package/lib/seam/connect/routes/connected-accounts.d.ts +5 -4
  42. package/lib/seam/connect/routes/connected-accounts.js +21 -19
  43. package/lib/seam/connect/routes/connected-accounts.js.map +1 -1
  44. package/lib/seam/connect/routes/devices-simulate.d.ts +21 -0
  45. package/lib/seam/connect/routes/devices-simulate.js +88 -0
  46. package/lib/seam/connect/routes/devices-simulate.js.map +1 -0
  47. package/lib/seam/connect/routes/devices-unmanaged.d.ts +4 -3
  48. package/lib/seam/connect/routes/devices-unmanaged.js +16 -14
  49. package/lib/seam/connect/routes/devices-unmanaged.js.map +1 -1
  50. package/lib/seam/connect/routes/devices.d.ts +8 -5
  51. package/lib/seam/connect/routes/devices.js +30 -23
  52. package/lib/seam/connect/routes/devices.js.map +1 -1
  53. package/lib/seam/connect/routes/events.d.ts +3 -2
  54. package/lib/seam/connect/routes/events.js +11 -10
  55. package/lib/seam/connect/routes/events.js.map +1 -1
  56. package/lib/seam/connect/routes/index.d.ts +1 -0
  57. package/lib/seam/connect/routes/index.js +1 -0
  58. package/lib/seam/connect/routes/index.js.map +1 -1
  59. package/lib/seam/connect/routes/locks.d.ts +5 -4
  60. package/lib/seam/connect/routes/locks.js +23 -36
  61. package/lib/seam/connect/routes/locks.js.map +1 -1
  62. package/lib/seam/connect/routes/networks.d.ts +3 -2
  63. package/lib/seam/connect/routes/networks.js +11 -10
  64. package/lib/seam/connect/routes/networks.js.map +1 -1
  65. package/lib/seam/connect/routes/noise-sensors-noise-thresholds.d.ts +6 -5
  66. package/lib/seam/connect/routes/noise-sensors-noise-thresholds.js +26 -23
  67. package/lib/seam/connect/routes/noise-sensors-noise-thresholds.js.map +1 -1
  68. package/lib/seam/connect/routes/phones-simulate.d.ts +2 -1
  69. package/lib/seam/connect/routes/phones-simulate.js +6 -5
  70. package/lib/seam/connect/routes/phones-simulate.js.map +1 -1
  71. package/lib/seam/connect/routes/phones.d.ts +3 -2
  72. package/lib/seam/connect/routes/phones.js +11 -9
  73. package/lib/seam/connect/routes/phones.js.map +1 -1
  74. package/lib/seam/connect/routes/thermostats-climate-setting-schedules.d.ts +6 -5
  75. package/lib/seam/connect/routes/thermostats-climate-setting-schedules.js +26 -23
  76. package/lib/seam/connect/routes/thermostats-climate-setting-schedules.js.map +1 -1
  77. package/lib/seam/connect/routes/thermostats.d.ts +9 -8
  78. package/lib/seam/connect/routes/thermostats.js +46 -76
  79. package/lib/seam/connect/routes/thermostats.js.map +1 -1
  80. package/lib/seam/connect/routes/user-identities-enrollment-automations.d.ts +5 -4
  81. package/lib/seam/connect/routes/user-identities-enrollment-automations.js +21 -19
  82. package/lib/seam/connect/routes/user-identities-enrollment-automations.js.map +1 -1
  83. package/lib/seam/connect/routes/user-identities.d.ts +13 -12
  84. package/lib/seam/connect/routes/user-identities.js +61 -54
  85. package/lib/seam/connect/routes/user-identities.js.map +1 -1
  86. package/lib/seam/connect/routes/webhooks.d.ts +6 -5
  87. package/lib/seam/connect/routes/webhooks.js +26 -23
  88. package/lib/seam/connect/routes/webhooks.js.map +1 -1
  89. package/lib/seam/connect/routes/workspaces.d.ts +5 -4
  90. package/lib/seam/connect/routes/workspaces.js +21 -19
  91. package/lib/seam/connect/routes/workspaces.js.map +1 -1
  92. package/lib/seam/connect/seam-http-request.d.ts +26 -0
  93. package/lib/seam/connect/seam-http-request.js +87 -0
  94. package/lib/seam/connect/seam-http-request.js.map +1 -0
  95. package/lib/version.d.ts +1 -1
  96. package/lib/version.js +1 -1
  97. package/package.json +4 -4
  98. package/src/lib/seam/connect/routes/access-codes-unmanaged.ts +37 -34
  99. package/src/lib/seam/connect/routes/access-codes.ts +56 -60
  100. package/src/lib/seam/connect/routes/acs-access-groups.ts +33 -32
  101. package/src/lib/seam/connect/routes/acs-credential-pools.ts +7 -7
  102. package/src/lib/seam/connect/routes/acs-credential-provisioning-automations.ts +11 -13
  103. package/src/lib/seam/connect/routes/acs-credentials.ts +42 -46
  104. package/src/lib/seam/connect/routes/acs-entrances.ts +31 -28
  105. package/src/lib/seam/connect/routes/acs-systems.ts +13 -14
  106. package/src/lib/seam/connect/routes/acs-users.ts +66 -61
  107. package/src/lib/seam/connect/routes/action-attempts.ts +14 -26
  108. package/src/lib/seam/connect/routes/client-sessions.ts +45 -49
  109. package/src/lib/seam/connect/routes/connect-webviews.ts +28 -28
  110. package/src/lib/seam/connect/routes/connected-accounts.ts +26 -29
  111. package/src/lib/seam/connect/routes/devices-simulate.ts +174 -0
  112. package/src/lib/seam/connect/routes/devices-unmanaged.ts +18 -18
  113. package/src/lib/seam/connect/routes/devices.ts +35 -31
  114. package/src/lib/seam/connect/routes/events.ts +11 -12
  115. package/src/lib/seam/connect/routes/index.ts +1 -0
  116. package/src/lib/seam/connect/routes/locks.ts +25 -50
  117. package/src/lib/seam/connect/routes/networks.ts +14 -13
  118. package/src/lib/seam/connect/routes/noise-sensors-noise-thresholds.ts +48 -38
  119. package/src/lib/seam/connect/routes/phones-simulate.ts +9 -10
  120. package/src/lib/seam/connect/routes/phones.ts +11 -10
  121. package/src/lib/seam/connect/routes/thermostats-climate-setting-schedules.ts +47 -55
  122. package/src/lib/seam/connect/routes/thermostats.ts +53 -110
  123. package/src/lib/seam/connect/routes/user-identities-enrollment-automations.ts +39 -48
  124. package/src/lib/seam/connect/routes/user-identities.ts +81 -78
  125. package/src/lib/seam/connect/routes/webhooks.ts +30 -28
  126. package/src/lib/seam/connect/routes/workspaces.ts +26 -25
  127. package/src/lib/seam/connect/seam-http-request.ts +144 -0
  128. package/src/lib/version.ts +1 -1
package/dist/connect.cjs CHANGED
@@ -11,6 +11,25 @@ var axios__default = /*#__PURE__*/_interopDefault(axios);
11
11
  var axiosBetterStacktrace__default = /*#__PURE__*/_interopDefault(axiosBetterStacktrace);
12
12
  var axiosRetry__default = /*#__PURE__*/_interopDefault(axiosRetry);
13
13
 
14
+ var __accessCheck = (obj, member, msg) => {
15
+ if (!member.has(obj))
16
+ throw TypeError("Cannot " + msg);
17
+ };
18
+ var __privateGet = (obj, member, getter) => {
19
+ __accessCheck(obj, member, "read from private field");
20
+ return getter ? getter.call(obj) : member.get(obj);
21
+ };
22
+ var __privateAdd = (obj, member, value) => {
23
+ if (member.has(obj))
24
+ throw TypeError("Cannot add the same private member more than once");
25
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
26
+ };
27
+ var __privateSet = (obj, member, value, setter) => {
28
+ __accessCheck(obj, member, "write to private field");
29
+ setter ? setter.call(obj, value) : member.set(obj, value);
30
+ return value;
31
+ };
32
+
14
33
  // src/lib/lts-version.ts
15
34
  var seamApiLtsVersion = "1.0.0";
16
35
 
@@ -634,6 +653,80 @@ var SeamActionAttemptTimeoutError = class extends SeamActionAttemptError {
634
653
  };
635
654
  var isSuccessfulActionAttempt = (actionAttempt) => actionAttempt.status === "success";
636
655
  var isFailedActionAttempt = (actionAttempt) => actionAttempt.status === "error";
656
+ var _parent, _config;
657
+ var SeamHttpRequest = class {
658
+ constructor(parent, config) {
659
+ __privateAdd(this, _parent, void 0);
660
+ __privateAdd(this, _config, void 0);
661
+ __privateSet(this, _parent, parent);
662
+ __privateSet(this, _config, config);
663
+ }
664
+ get responseKey() {
665
+ return __privateGet(this, _config).responseKey;
666
+ }
667
+ get url() {
668
+ const { client } = __privateGet(this, _parent);
669
+ const { params } = __privateGet(this, _config);
670
+ const serializer = typeof client.defaults.paramsSerializer === "function" ? client.defaults.paramsSerializer : urlSearchParamsSerializer.serializeUrlSearchParams;
671
+ const origin = getUrlPrefix(client.defaults.baseURL ?? "");
672
+ const pathname = __privateGet(this, _config).path.startsWith("/") ? __privateGet(this, _config).path : `/${__privateGet(this, _config).path}`;
673
+ const path = params == null ? pathname : `${pathname}?${serializer(params)}`;
674
+ return new URL(`${origin}${path}`);
675
+ }
676
+ get method() {
677
+ return __privateGet(this, _config).method;
678
+ }
679
+ get body() {
680
+ return __privateGet(this, _config).body;
681
+ }
682
+ async execute() {
683
+ const { client } = __privateGet(this, _parent);
684
+ const response = await client.request({
685
+ url: __privateGet(this, _config).path,
686
+ method: __privateGet(this, _config).method,
687
+ data: __privateGet(this, _config).body,
688
+ params: __privateGet(this, _config).params
689
+ });
690
+ if (this.responseKey === void 0) {
691
+ return void 0;
692
+ }
693
+ const data = response.data[this.responseKey];
694
+ if (this.responseKey === "action_attempt") {
695
+ const waitForActionAttempt = __privateGet(this, _config).options?.waitForActionAttempt ?? __privateGet(this, _parent).defaults.waitForActionAttempt;
696
+ if (waitForActionAttempt !== false) {
697
+ return await resolveActionAttempt(
698
+ data,
699
+ SeamHttpActionAttempts.fromClient(client, {
700
+ ...__privateGet(this, _parent).defaults,
701
+ waitForActionAttempt: false
702
+ }),
703
+ typeof waitForActionAttempt === "boolean" ? {} : waitForActionAttempt
704
+ );
705
+ }
706
+ }
707
+ return data;
708
+ }
709
+ then(onfulfilled, onrejected) {
710
+ return this.execute().then(onfulfilled, onrejected);
711
+ }
712
+ };
713
+ _parent = new WeakMap();
714
+ _config = new WeakMap();
715
+ var getUrlPrefix = (input) => {
716
+ if (URL.canParse(input)) {
717
+ const url = new URL(input).toString();
718
+ if (url.endsWith("/"))
719
+ return url.slice(0, -1);
720
+ return url;
721
+ }
722
+ if (globalThis.location != null) {
723
+ const pathname = input.startsWith("/") ? input : `/${input}`;
724
+ return new URL(`${globalThis.location.origin}${pathname}`).toString();
725
+ }
726
+ throw new Error(
727
+ `Cannot resolve origin from ${input} in a non-browser environment`
728
+ );
729
+ };
637
730
 
638
731
  // src/lib/seam/connect/routes/client-sessions.ts
639
732
  var SeamHttpClientSessions = class _SeamHttpClientSessions {
@@ -712,58 +805,60 @@ var SeamHttpClientSessions = class _SeamHttpClientSessions {
712
805
  const clientSessions = _SeamHttpClientSessions.fromClient(this.client);
713
806
  await clientSessions.get();
714
807
  }
715
- async create(body) {
716
- const { data } = await this.client.request({
717
- url: "/client_sessions/create",
808
+ create(body) {
809
+ return new SeamHttpRequest(this, {
810
+ path: "/client_sessions/create",
718
811
  method: "post",
719
- data: body
812
+ body,
813
+ responseKey: "client_session"
720
814
  });
721
- return data.client_session;
722
815
  }
723
- async delete(body) {
724
- await this.client.request({
725
- url: "/client_sessions/delete",
816
+ delete(body) {
817
+ return new SeamHttpRequest(this, {
818
+ path: "/client_sessions/delete",
726
819
  method: "post",
727
- data: body
820
+ body,
821
+ responseKey: void 0
728
822
  });
729
823
  }
730
- async get(body) {
731
- const { data } = await this.client.request({
732
- url: "/client_sessions/get",
824
+ get(body) {
825
+ return new SeamHttpRequest(this, {
826
+ path: "/client_sessions/get",
733
827
  method: "post",
734
- data: body
828
+ body,
829
+ responseKey: "client_session"
735
830
  });
736
- return data.client_session;
737
831
  }
738
- async getOrCreate(body) {
739
- const { data } = await this.client.request({
740
- url: "/client_sessions/get_or_create",
832
+ getOrCreate(body) {
833
+ return new SeamHttpRequest(this, {
834
+ path: "/client_sessions/get_or_create",
741
835
  method: "post",
742
- data: body
836
+ body,
837
+ responseKey: "client_session"
743
838
  });
744
- return data.client_session;
745
839
  }
746
- async grantAccess(body) {
747
- const { data } = await this.client.request({
748
- url: "/client_sessions/grant_access",
840
+ grantAccess(body) {
841
+ return new SeamHttpRequest(this, {
842
+ path: "/client_sessions/grant_access",
749
843
  method: "post",
750
- data: body
844
+ body,
845
+ responseKey: "client_session"
751
846
  });
752
- return data.client_session;
753
847
  }
754
- async list(body) {
755
- const { data } = await this.client.request({
756
- url: "/client_sessions/list",
848
+ list(body) {
849
+ return new SeamHttpRequest(this, {
850
+ path: "/client_sessions/list",
757
851
  method: "post",
758
- data: body
852
+ body,
853
+ responseKey: "client_sessions"
759
854
  });
760
- return data.client_sessions;
761
855
  }
762
- async revoke(body) {
763
- await this.client.request({
764
- url: "/client_sessions/revoke",
856
+ revoke(body) {
857
+ return new SeamHttpRequest(this, {
858
+ path: "/client_sessions/revoke",
765
859
  method: "post",
766
- data: body
860
+ body,
861
+ responseKey: void 0
767
862
  });
768
863
  }
769
864
  };
@@ -845,43 +940,44 @@ var SeamHttpAccessCodesUnmanaged = class _SeamHttpAccessCodesUnmanaged {
845
940
  const clientSessions = SeamHttpClientSessions.fromClient(this.client);
846
941
  await clientSessions.get();
847
942
  }
848
- async convertToManaged(body) {
849
- await this.client.request({
850
- url: "/access_codes/unmanaged/convert_to_managed",
943
+ convertToManaged(body) {
944
+ return new SeamHttpRequest(this, {
945
+ path: "/access_codes/unmanaged/convert_to_managed",
851
946
  method: "post",
852
- data: body
947
+ body,
948
+ responseKey: void 0
853
949
  });
854
950
  }
855
- async delete(body) {
856
- await this.client.request({
857
- url: "/access_codes/unmanaged/delete",
951
+ delete(body) {
952
+ return new SeamHttpRequest(this, {
953
+ path: "/access_codes/unmanaged/delete",
858
954
  method: "post",
859
- data: body
955
+ body,
956
+ responseKey: void 0
860
957
  });
861
958
  }
862
- async get(body) {
863
- const { data } = await this.client.request(
864
- {
865
- url: "/access_codes/unmanaged/get",
866
- method: "post",
867
- data: body
868
- }
869
- );
870
- return data.access_code;
959
+ get(body) {
960
+ return new SeamHttpRequest(this, {
961
+ path: "/access_codes/unmanaged/get",
962
+ method: "post",
963
+ body,
964
+ responseKey: "access_code"
965
+ });
871
966
  }
872
- async list(body) {
873
- const { data } = await this.client.request({
874
- url: "/access_codes/unmanaged/list",
967
+ list(body) {
968
+ return new SeamHttpRequest(this, {
969
+ path: "/access_codes/unmanaged/list",
875
970
  method: "post",
876
- data: body
971
+ body,
972
+ responseKey: "access_codes"
877
973
  });
878
- return data.access_codes;
879
974
  }
880
- async update(body) {
881
- await this.client.request({
882
- url: "/access_codes/unmanaged/update",
975
+ update(body) {
976
+ return new SeamHttpRequest(this, {
977
+ path: "/access_codes/unmanaged/update",
883
978
  method: "post",
884
- data: body
979
+ body,
980
+ responseKey: void 0
885
981
  });
886
982
  }
887
983
  };
@@ -966,68 +1062,68 @@ var SeamHttpAccessCodes = class _SeamHttpAccessCodes {
966
1062
  get unmanaged() {
967
1063
  return SeamHttpAccessCodesUnmanaged.fromClient(this.client, this.defaults);
968
1064
  }
969
- async create(body) {
970
- const { data } = await this.client.request({
971
- url: "/access_codes/create",
1065
+ create(body) {
1066
+ return new SeamHttpRequest(this, {
1067
+ path: "/access_codes/create",
972
1068
  method: "post",
973
- data: body
1069
+ body,
1070
+ responseKey: "access_code"
974
1071
  });
975
- return data.access_code;
976
1072
  }
977
- async createMultiple(body) {
978
- const { data } = await this.client.request({
979
- url: "/access_codes/create_multiple",
1073
+ createMultiple(body) {
1074
+ return new SeamHttpRequest(this, {
1075
+ path: "/access_codes/create_multiple",
980
1076
  method: "post",
981
- data: body
1077
+ body,
1078
+ responseKey: "access_codes"
982
1079
  });
983
- return data.access_codes;
984
1080
  }
985
- async delete(body) {
986
- await this.client.request({
987
- url: "/access_codes/delete",
1081
+ delete(body) {
1082
+ return new SeamHttpRequest(this, {
1083
+ path: "/access_codes/delete",
988
1084
  method: "post",
989
- data: body
1085
+ body,
1086
+ responseKey: void 0
990
1087
  });
991
1088
  }
992
- async generateCode(body) {
993
- const { data } = await this.client.request(
994
- {
995
- url: "/access_codes/generate_code",
996
- method: "post",
997
- data: body
998
- }
999
- );
1000
- return data.generated_code;
1089
+ generateCode(body) {
1090
+ return new SeamHttpRequest(this, {
1091
+ path: "/access_codes/generate_code",
1092
+ method: "post",
1093
+ body,
1094
+ responseKey: "generated_code"
1095
+ });
1001
1096
  }
1002
- async get(body) {
1003
- const { data } = await this.client.request({
1004
- url: "/access_codes/get",
1097
+ get(body) {
1098
+ return new SeamHttpRequest(this, {
1099
+ path: "/access_codes/get",
1005
1100
  method: "post",
1006
- data: body
1101
+ body,
1102
+ responseKey: "access_code"
1007
1103
  });
1008
- return data.access_code;
1009
1104
  }
1010
- async list(body) {
1011
- const { data } = await this.client.request({
1012
- url: "/access_codes/list",
1105
+ list(body) {
1106
+ return new SeamHttpRequest(this, {
1107
+ path: "/access_codes/list",
1013
1108
  method: "post",
1014
- data: body
1109
+ body,
1110
+ responseKey: "access_codes"
1015
1111
  });
1016
- return data.access_codes;
1017
1112
  }
1018
- async pullBackupAccessCode(body) {
1019
- const { data } = await this.client.request({
1020
- url: "/access_codes/pull_backup_access_code",
1113
+ pullBackupAccessCode(body) {
1114
+ return new SeamHttpRequest(this, {
1115
+ path: "/access_codes/pull_backup_access_code",
1021
1116
  method: "post",
1022
- data: body
1117
+ body,
1118
+ responseKey: "backup_access_code"
1023
1119
  });
1024
- return data.backup_access_code;
1025
1120
  }
1026
- async update(body) {
1027
- await this.client.request({
1028
- url: "/access_codes/update",
1121
+ update(body) {
1122
+ return new SeamHttpRequest(this, {
1123
+ path: "/access_codes/update",
1029
1124
  method: "post",
1030
- data: body
1125
+ body,
1126
+ responseKey: void 0
1031
1127
  });
1032
1128
  }
1033
1129
  };
@@ -1109,42 +1205,44 @@ var SeamHttpAcsAccessGroups = class _SeamHttpAcsAccessGroups {
1109
1205
  const clientSessions = SeamHttpClientSessions.fromClient(this.client);
1110
1206
  await clientSessions.get();
1111
1207
  }
1112
- async addUser(body) {
1113
- await this.client.request({
1114
- url: "/acs/access_groups/add_user",
1208
+ addUser(body) {
1209
+ return new SeamHttpRequest(this, {
1210
+ path: "/acs/access_groups/add_user",
1115
1211
  method: "post",
1116
- data: body
1212
+ body,
1213
+ responseKey: void 0
1117
1214
  });
1118
1215
  }
1119
- async get(body) {
1120
- const { data } = await this.client.request({
1121
- url: "/acs/access_groups/get",
1216
+ get(body) {
1217
+ return new SeamHttpRequest(this, {
1218
+ path: "/acs/access_groups/get",
1122
1219
  method: "post",
1123
- data: body
1220
+ body,
1221
+ responseKey: "acs_access_group"
1124
1222
  });
1125
- return data.acs_access_group;
1126
1223
  }
1127
- async list(body) {
1128
- const { data } = await this.client.request({
1129
- url: "/acs/access_groups/list",
1224
+ list(body) {
1225
+ return new SeamHttpRequest(this, {
1226
+ path: "/acs/access_groups/list",
1130
1227
  method: "post",
1131
- data: body
1228
+ body,
1229
+ responseKey: "acs_access_groups"
1132
1230
  });
1133
- return data.acs_access_groups;
1134
1231
  }
1135
- async listUsers(body) {
1136
- const { data } = await this.client.request({
1137
- url: "/acs/access_groups/list_users",
1232
+ listUsers(body) {
1233
+ return new SeamHttpRequest(this, {
1234
+ path: "/acs/access_groups/list_users",
1138
1235
  method: "post",
1139
- data: body
1236
+ body,
1237
+ responseKey: "acs_users"
1140
1238
  });
1141
- return data.acs_users;
1142
1239
  }
1143
- async removeUser(body) {
1144
- await this.client.request({
1145
- url: "/acs/access_groups/remove_user",
1240
+ removeUser(body) {
1241
+ return new SeamHttpRequest(this, {
1242
+ path: "/acs/access_groups/remove_user",
1146
1243
  method: "post",
1147
- data: body
1244
+ body,
1245
+ responseKey: void 0
1148
1246
  });
1149
1247
  }
1150
1248
  };
@@ -1226,13 +1324,13 @@ var SeamHttpAcsCredentialPools = class _SeamHttpAcsCredentialPools {
1226
1324
  const clientSessions = SeamHttpClientSessions.fromClient(this.client);
1227
1325
  await clientSessions.get();
1228
1326
  }
1229
- async list(body) {
1230
- const { data } = await this.client.request({
1231
- url: "/acs/credential_pools/list",
1327
+ list(body) {
1328
+ return new SeamHttpRequest(this, {
1329
+ path: "/acs/credential_pools/list",
1232
1330
  method: "post",
1233
- data: body
1331
+ body,
1332
+ responseKey: "acs_credential_pools"
1234
1333
  });
1235
- return data.acs_credential_pools;
1236
1334
  }
1237
1335
  };
1238
1336
 
@@ -1316,15 +1414,13 @@ var SeamHttpAcsCredentialProvisioningAutomations = class _SeamHttpAcsCredentialP
1316
1414
  const clientSessions = SeamHttpClientSessions.fromClient(this.client);
1317
1415
  await clientSessions.get();
1318
1416
  }
1319
- async launch(body) {
1320
- const { data } = await this.client.request(
1321
- {
1322
- url: "/acs/credential_provisioning_automations/launch",
1323
- method: "post",
1324
- data: body
1325
- }
1326
- );
1327
- return data.acs_credential_provisioning_automation;
1417
+ launch(body) {
1418
+ return new SeamHttpRequest(this, {
1419
+ path: "/acs/credential_provisioning_automations/launch",
1420
+ method: "post",
1421
+ body,
1422
+ responseKey: "acs_credential_provisioning_automation"
1423
+ });
1328
1424
  }
1329
1425
  };
1330
1426
 
@@ -1405,60 +1501,61 @@ var SeamHttpAcsCredentials = class _SeamHttpAcsCredentials {
1405
1501
  const clientSessions = SeamHttpClientSessions.fromClient(this.client);
1406
1502
  await clientSessions.get();
1407
1503
  }
1408
- async assign(body) {
1409
- const { data } = await this.client.request({
1410
- url: "/acs/credentials/assign",
1504
+ assign(body) {
1505
+ return new SeamHttpRequest(this, {
1506
+ path: "/acs/credentials/assign",
1411
1507
  method: "post",
1412
- data: body
1508
+ body,
1509
+ responseKey: "acs_credential"
1413
1510
  });
1414
- return data.acs_credential;
1415
1511
  }
1416
- async create(body) {
1417
- const { data } = await this.client.request({
1418
- url: "/acs/credentials/create",
1512
+ create(body) {
1513
+ return new SeamHttpRequest(this, {
1514
+ path: "/acs/credentials/create",
1419
1515
  method: "post",
1420
- data: body
1516
+ body,
1517
+ responseKey: "acs_credential"
1421
1518
  });
1422
- return data.acs_credential;
1423
1519
  }
1424
- async delete(body) {
1425
- await this.client.request({
1426
- url: "/acs/credentials/delete",
1520
+ delete(body) {
1521
+ return new SeamHttpRequest(this, {
1522
+ path: "/acs/credentials/delete",
1427
1523
  method: "post",
1428
- data: body
1524
+ body,
1525
+ responseKey: void 0
1429
1526
  });
1430
1527
  }
1431
- async get(body) {
1432
- const { data } = await this.client.request({
1433
- url: "/acs/credentials/get",
1528
+ get(body) {
1529
+ return new SeamHttpRequest(this, {
1530
+ path: "/acs/credentials/get",
1434
1531
  method: "post",
1435
- data: body
1532
+ body,
1533
+ responseKey: "acs_credential"
1436
1534
  });
1437
- return data.acs_credential;
1438
1535
  }
1439
- async list(body) {
1440
- const { data } = await this.client.request({
1441
- url: "/acs/credentials/list",
1536
+ list(body) {
1537
+ return new SeamHttpRequest(this, {
1538
+ path: "/acs/credentials/list",
1442
1539
  method: "post",
1443
- data: body
1540
+ body,
1541
+ responseKey: "acs_credentials"
1444
1542
  });
1445
- return data.acs_credentials;
1446
1543
  }
1447
- async unassign(body) {
1448
- const { data } = await this.client.request({
1449
- url: "/acs/credentials/unassign",
1544
+ unassign(body) {
1545
+ return new SeamHttpRequest(this, {
1546
+ path: "/acs/credentials/unassign",
1450
1547
  method: "post",
1451
- data: body
1548
+ body,
1549
+ responseKey: "acs_credential"
1452
1550
  });
1453
- return data.acs_credential;
1454
1551
  }
1455
- async update(body) {
1456
- const { data } = await this.client.request({
1457
- url: "/acs/credentials/update",
1552
+ update(body) {
1553
+ return new SeamHttpRequest(this, {
1554
+ path: "/acs/credentials/update",
1458
1555
  method: "post",
1459
- data: body
1556
+ body,
1557
+ responseKey: "acs_credential"
1460
1558
  });
1461
- return data.acs_credential;
1462
1559
  }
1463
1560
  };
1464
1561
 
@@ -1539,36 +1636,37 @@ var SeamHttpAcsEntrances = class _SeamHttpAcsEntrances {
1539
1636
  const clientSessions = SeamHttpClientSessions.fromClient(this.client);
1540
1637
  await clientSessions.get();
1541
1638
  }
1542
- async get(body) {
1543
- const { data } = await this.client.request({
1544
- url: "/acs/entrances/get",
1639
+ get(body) {
1640
+ return new SeamHttpRequest(this, {
1641
+ path: "/acs/entrances/get",
1545
1642
  method: "post",
1546
- data: body
1643
+ body,
1644
+ responseKey: "acs_entrance"
1547
1645
  });
1548
- return data.acs_entrance;
1549
1646
  }
1550
- async grantAccess(body) {
1551
- await this.client.request({
1552
- url: "/acs/entrances/grant_access",
1647
+ grantAccess(body) {
1648
+ return new SeamHttpRequest(this, {
1649
+ path: "/acs/entrances/grant_access",
1553
1650
  method: "post",
1554
- data: body
1651
+ body,
1652
+ responseKey: void 0
1555
1653
  });
1556
1654
  }
1557
- async list(body) {
1558
- const { data } = await this.client.request({
1559
- url: "/acs/entrances/list",
1655
+ list(body) {
1656
+ return new SeamHttpRequest(this, {
1657
+ path: "/acs/entrances/list",
1560
1658
  method: "post",
1561
- data: body
1659
+ body,
1660
+ responseKey: "acs_entrances"
1562
1661
  });
1563
- return data.acs_entrances;
1564
1662
  }
1565
- async listCredentialsWithAccess(body) {
1566
- const { data } = await this.client.request({
1567
- url: "/acs/entrances/list_credentials_with_access",
1663
+ listCredentialsWithAccess(body) {
1664
+ return new SeamHttpRequest(this, {
1665
+ path: "/acs/entrances/list_credentials_with_access",
1568
1666
  method: "post",
1569
- data: body
1667
+ body,
1668
+ responseKey: "acs_credentials"
1570
1669
  });
1571
- return data.acs_credentials;
1572
1670
  }
1573
1671
  };
1574
1672
 
@@ -1649,21 +1747,21 @@ var SeamHttpAcsSystems = class _SeamHttpAcsSystems {
1649
1747
  const clientSessions = SeamHttpClientSessions.fromClient(this.client);
1650
1748
  await clientSessions.get();
1651
1749
  }
1652
- async get(body) {
1653
- const { data } = await this.client.request({
1654
- url: "/acs/systems/get",
1750
+ get(body) {
1751
+ return new SeamHttpRequest(this, {
1752
+ path: "/acs/systems/get",
1655
1753
  method: "post",
1656
- data: body
1754
+ body,
1755
+ responseKey: "acs_system"
1657
1756
  });
1658
- return data.acs_system;
1659
1757
  }
1660
- async list(body) {
1661
- const { data } = await this.client.request({
1662
- url: "/acs/systems/list",
1758
+ list(body) {
1759
+ return new SeamHttpRequest(this, {
1760
+ path: "/acs/systems/list",
1663
1761
  method: "post",
1664
- data: body
1762
+ body,
1763
+ responseKey: "acs_systems"
1665
1764
  });
1666
- return data.acs_systems;
1667
1765
  }
1668
1766
  };
1669
1767
 
@@ -1744,85 +1842,92 @@ var SeamHttpAcsUsers = class _SeamHttpAcsUsers {
1744
1842
  const clientSessions = SeamHttpClientSessions.fromClient(this.client);
1745
1843
  await clientSessions.get();
1746
1844
  }
1747
- async addToAccessGroup(body) {
1748
- await this.client.request({
1749
- url: "/acs/users/add_to_access_group",
1845
+ addToAccessGroup(body) {
1846
+ return new SeamHttpRequest(this, {
1847
+ path: "/acs/users/add_to_access_group",
1750
1848
  method: "post",
1751
- data: body
1849
+ body,
1850
+ responseKey: void 0
1752
1851
  });
1753
1852
  }
1754
- async create(body) {
1755
- const { data } = await this.client.request({
1756
- url: "/acs/users/create",
1853
+ create(body) {
1854
+ return new SeamHttpRequest(this, {
1855
+ path: "/acs/users/create",
1757
1856
  method: "post",
1758
- data: body
1857
+ body,
1858
+ responseKey: "acs_user"
1759
1859
  });
1760
- return data.acs_user;
1761
1860
  }
1762
- async delete(body) {
1763
- await this.client.request({
1764
- url: "/acs/users/delete",
1861
+ delete(body) {
1862
+ return new SeamHttpRequest(this, {
1863
+ path: "/acs/users/delete",
1765
1864
  method: "post",
1766
- data: body
1865
+ body,
1866
+ responseKey: void 0
1767
1867
  });
1768
1868
  }
1769
- async get(body) {
1770
- const { data } = await this.client.request({
1771
- url: "/acs/users/get",
1869
+ get(body) {
1870
+ return new SeamHttpRequest(this, {
1871
+ path: "/acs/users/get",
1772
1872
  method: "post",
1773
- data: body
1873
+ body,
1874
+ responseKey: "acs_user"
1774
1875
  });
1775
- return data.acs_user;
1776
1876
  }
1777
- async list(body) {
1778
- const { data } = await this.client.request({
1779
- url: "/acs/users/list",
1877
+ list(body) {
1878
+ return new SeamHttpRequest(this, {
1879
+ path: "/acs/users/list",
1780
1880
  method: "post",
1781
- data: body
1881
+ body,
1882
+ responseKey: "acs_users"
1782
1883
  });
1783
- return data.acs_users;
1784
1884
  }
1785
- async listAccessibleEntrances(body) {
1786
- const { data } = await this.client.request({
1787
- url: "/acs/users/list_accessible_entrances",
1885
+ listAccessibleEntrances(body) {
1886
+ return new SeamHttpRequest(this, {
1887
+ path: "/acs/users/list_accessible_entrances",
1788
1888
  method: "post",
1789
- data: body
1889
+ body,
1890
+ responseKey: "acs_entrances"
1790
1891
  });
1791
- return data.acs_entrances;
1792
1892
  }
1793
- async removeFromAccessGroup(body) {
1794
- await this.client.request({
1795
- url: "/acs/users/remove_from_access_group",
1893
+ removeFromAccessGroup(body) {
1894
+ return new SeamHttpRequest(this, {
1895
+ path: "/acs/users/remove_from_access_group",
1796
1896
  method: "post",
1797
- data: body
1897
+ body,
1898
+ responseKey: void 0
1798
1899
  });
1799
1900
  }
1800
- async revokeAccessToAllEntrances(body) {
1801
- await this.client.request({
1802
- url: "/acs/users/revoke_access_to_all_entrances",
1901
+ revokeAccessToAllEntrances(body) {
1902
+ return new SeamHttpRequest(this, {
1903
+ path: "/acs/users/revoke_access_to_all_entrances",
1803
1904
  method: "post",
1804
- data: body
1905
+ body,
1906
+ responseKey: void 0
1805
1907
  });
1806
1908
  }
1807
- async suspend(body) {
1808
- await this.client.request({
1809
- url: "/acs/users/suspend",
1909
+ suspend(body) {
1910
+ return new SeamHttpRequest(this, {
1911
+ path: "/acs/users/suspend",
1810
1912
  method: "post",
1811
- data: body
1913
+ body,
1914
+ responseKey: void 0
1812
1915
  });
1813
1916
  }
1814
- async unsuspend(body) {
1815
- await this.client.request({
1816
- url: "/acs/users/unsuspend",
1917
+ unsuspend(body) {
1918
+ return new SeamHttpRequest(this, {
1919
+ path: "/acs/users/unsuspend",
1817
1920
  method: "post",
1818
- data: body
1921
+ body,
1922
+ responseKey: void 0
1819
1923
  });
1820
1924
  }
1821
- async update(body) {
1822
- await this.client.request({
1823
- url: "/acs/users/update",
1925
+ update(body) {
1926
+ return new SeamHttpRequest(this, {
1927
+ path: "/acs/users/update",
1824
1928
  method: "post",
1825
- data: body
1929
+ body,
1930
+ responseKey: void 0
1826
1931
  });
1827
1932
  }
1828
1933
  };
@@ -2007,32 +2112,22 @@ var SeamHttpActionAttempts = class _SeamHttpActionAttempts {
2007
2112
  const clientSessions = SeamHttpClientSessions.fromClient(this.client);
2008
2113
  await clientSessions.get();
2009
2114
  }
2010
- async get(body, options = {}) {
2011
- const { data } = await this.client.request({
2012
- url: "/action_attempts/get",
2115
+ get(body, options = {}) {
2116
+ return new SeamHttpRequest(this, {
2117
+ path: "/action_attempts/get",
2013
2118
  method: "post",
2014
- data: body
2015
- });
2016
- const waitForActionAttempt = options.waitForActionAttempt ?? this.defaults.waitForActionAttempt;
2017
- if (waitForActionAttempt !== false) {
2018
- return await resolveActionAttempt(
2019
- data.action_attempt,
2020
- _SeamHttpActionAttempts.fromClient(this.client, {
2021
- ...this.defaults,
2022
- waitForActionAttempt: false
2023
- }),
2024
- typeof waitForActionAttempt === "boolean" ? {} : waitForActionAttempt
2025
- );
2026
- }
2027
- return data.action_attempt;
2119
+ body,
2120
+ responseKey: "action_attempt",
2121
+ options
2122
+ });
2028
2123
  }
2029
- async list(body) {
2030
- const { data } = await this.client.request({
2031
- url: "/action_attempts/list",
2124
+ list(body) {
2125
+ return new SeamHttpRequest(this, {
2126
+ path: "/action_attempts/list",
2032
2127
  method: "post",
2033
- data: body
2128
+ body,
2129
+ responseKey: "action_attempts"
2034
2130
  });
2035
- return data.action_attempts;
2036
2131
  }
2037
2132
  };
2038
2133
 
@@ -2113,42 +2208,44 @@ var SeamHttpConnectWebviews = class _SeamHttpConnectWebviews {
2113
2208
  const clientSessions = SeamHttpClientSessions.fromClient(this.client);
2114
2209
  await clientSessions.get();
2115
2210
  }
2116
- async create(body) {
2117
- const { data } = await this.client.request({
2118
- url: "/connect_webviews/create",
2211
+ create(body) {
2212
+ return new SeamHttpRequest(this, {
2213
+ path: "/connect_webviews/create",
2119
2214
  method: "post",
2120
- data: body
2215
+ body,
2216
+ responseKey: "connect_webview"
2121
2217
  });
2122
- return data.connect_webview;
2123
2218
  }
2124
- async delete(body) {
2125
- await this.client.request({
2126
- url: "/connect_webviews/delete",
2219
+ delete(body) {
2220
+ return new SeamHttpRequest(this, {
2221
+ path: "/connect_webviews/delete",
2127
2222
  method: "post",
2128
- data: body
2223
+ body,
2224
+ responseKey: void 0
2129
2225
  });
2130
2226
  }
2131
- async get(body) {
2132
- const { data } = await this.client.request({
2133
- url: "/connect_webviews/get",
2227
+ get(body) {
2228
+ return new SeamHttpRequest(this, {
2229
+ path: "/connect_webviews/get",
2134
2230
  method: "post",
2135
- data: body
2231
+ body,
2232
+ responseKey: "connect_webview"
2136
2233
  });
2137
- return data.connect_webview;
2138
2234
  }
2139
- async list(body) {
2140
- const { data } = await this.client.request({
2141
- url: "/connect_webviews/list",
2235
+ list(body) {
2236
+ return new SeamHttpRequest(this, {
2237
+ path: "/connect_webviews/list",
2142
2238
  method: "post",
2143
- data: body
2239
+ body,
2240
+ responseKey: "connect_webviews"
2144
2241
  });
2145
- return data.connect_webviews;
2146
2242
  }
2147
- async view(params) {
2148
- await this.client.request({
2149
- url: "/connect_webviews/view",
2243
+ view(params) {
2244
+ return new SeamHttpRequest(this, {
2245
+ path: "/connect_webviews/view",
2150
2246
  method: "get",
2151
- params
2247
+ params,
2248
+ responseKey: void 0
2152
2249
  });
2153
2250
  }
2154
2251
  };
@@ -2230,38 +2327,124 @@ var SeamHttpConnectedAccounts = class _SeamHttpConnectedAccounts {
2230
2327
  const clientSessions = SeamHttpClientSessions.fromClient(this.client);
2231
2328
  await clientSessions.get();
2232
2329
  }
2233
- async delete(body) {
2234
- await this.client.request({
2235
- url: "/connected_accounts/delete",
2330
+ delete(body) {
2331
+ return new SeamHttpRequest(this, {
2332
+ path: "/connected_accounts/delete",
2236
2333
  method: "post",
2237
- data: body
2334
+ body,
2335
+ responseKey: void 0
2238
2336
  });
2239
2337
  }
2240
- async get(body) {
2241
- const { data } = await this.client.request({
2242
- url: "/connected_accounts/get",
2338
+ get(body) {
2339
+ return new SeamHttpRequest(this, {
2340
+ path: "/connected_accounts/get",
2243
2341
  method: "post",
2244
- data: body
2342
+ body,
2343
+ responseKey: "connected_account"
2245
2344
  });
2246
- return data.connected_account;
2247
2345
  }
2248
- async list(body) {
2249
- const { data } = await this.client.request({
2250
- url: "/connected_accounts/list",
2346
+ list(body) {
2347
+ return new SeamHttpRequest(this, {
2348
+ path: "/connected_accounts/list",
2251
2349
  method: "post",
2252
- data: body
2350
+ body,
2351
+ responseKey: "connected_accounts"
2352
+ });
2353
+ }
2354
+ update(body) {
2355
+ return new SeamHttpRequest(this, {
2356
+ path: "/connected_accounts/update",
2357
+ method: "post",
2358
+ body,
2359
+ responseKey: "connected_account"
2360
+ });
2361
+ }
2362
+ };
2363
+
2364
+ // src/lib/seam/connect/routes/devices-simulate.ts
2365
+ var SeamHttpDevicesSimulate = class _SeamHttpDevicesSimulate {
2366
+ constructor(apiKeyOrOptions = {}) {
2367
+ const options = parseOptions(apiKeyOrOptions);
2368
+ this.client = "client" in options ? options.client : createClient(options);
2369
+ this.defaults = limitToSeamHttpRequestOptions(options);
2370
+ }
2371
+ static fromClient(client, options = {}) {
2372
+ const constructorOptions = { ...options, client };
2373
+ if (!isSeamHttpOptionsWithClient(constructorOptions)) {
2374
+ throw new SeamHttpInvalidOptionsError("Missing client");
2375
+ }
2376
+ return new _SeamHttpDevicesSimulate(constructorOptions);
2377
+ }
2378
+ static fromApiKey(apiKey, options = {}) {
2379
+ const constructorOptions = { ...options, apiKey };
2380
+ if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
2381
+ throw new SeamHttpInvalidOptionsError("Missing apiKey");
2382
+ }
2383
+ return new _SeamHttpDevicesSimulate(constructorOptions);
2384
+ }
2385
+ static fromClientSessionToken(clientSessionToken, options = {}) {
2386
+ const constructorOptions = { ...options, clientSessionToken };
2387
+ if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
2388
+ throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
2389
+ }
2390
+ return new _SeamHttpDevicesSimulate(constructorOptions);
2391
+ }
2392
+ static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
2393
+ warnOnInsecureuserIdentifierKey(userIdentifierKey);
2394
+ const clientOptions = parseOptions({ ...options, publishableKey });
2395
+ if (isSeamHttpOptionsWithClient(clientOptions)) {
2396
+ throw new SeamHttpInvalidOptionsError(
2397
+ "The client option cannot be used with SeamHttp.fromPublishableKey"
2398
+ );
2399
+ }
2400
+ const client = createClient(clientOptions);
2401
+ const clientSessions = SeamHttpClientSessions.fromClient(client);
2402
+ const { token } = await clientSessions.getOrCreate({
2403
+ user_identifier_key: userIdentifierKey
2253
2404
  });
2254
- return data.connected_accounts;
2405
+ return _SeamHttpDevicesSimulate.fromClientSessionToken(token, options);
2255
2406
  }
2256
- async update(body) {
2257
- const { data } = await this.client.request(
2258
- {
2259
- url: "/connected_accounts/update",
2260
- method: "post",
2261
- data: body
2407
+ static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
2408
+ const constructorOptions = { ...options, consoleSessionToken, workspaceId };
2409
+ if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
2410
+ throw new SeamHttpInvalidOptionsError(
2411
+ "Missing consoleSessionToken or workspaceId"
2412
+ );
2413
+ }
2414
+ return new _SeamHttpDevicesSimulate(constructorOptions);
2415
+ }
2416
+ static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
2417
+ const constructorOptions = { ...options, personalAccessToken, workspaceId };
2418
+ if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
2419
+ throw new SeamHttpInvalidOptionsError(
2420
+ "Missing personalAccessToken or workspaceId"
2421
+ );
2422
+ }
2423
+ return new _SeamHttpDevicesSimulate(constructorOptions);
2424
+ }
2425
+ async updateClientSessionToken(clientSessionToken) {
2426
+ const { headers } = this.client.defaults;
2427
+ const authHeaders = getAuthHeadersForClientSessionToken({
2428
+ clientSessionToken
2429
+ });
2430
+ for (const key of Object.keys(authHeaders)) {
2431
+ if (headers[key] == null) {
2432
+ throw new Error(
2433
+ "Cannot update a clientSessionToken on a client created without a clientSessionToken"
2434
+ );
2262
2435
  }
2263
- );
2264
- return data.connected_account;
2436
+ }
2437
+ this.client.defaults.headers = { ...headers, ...authHeaders };
2438
+ const clientSessions = SeamHttpClientSessions.fromClient(this.client);
2439
+ await clientSessions.get();
2440
+ }
2441
+ remove(body) {
2442
+ return new SeamHttpRequest(this, {
2443
+ path: "/devices/simulate/remove",
2444
+ method: "post",
2445
+ body,
2446
+ responseKey: void 0
2447
+ });
2265
2448
  }
2266
2449
  };
2267
2450
 
@@ -2342,27 +2525,28 @@ var SeamHttpDevicesUnmanaged = class _SeamHttpDevicesUnmanaged {
2342
2525
  const clientSessions = SeamHttpClientSessions.fromClient(this.client);
2343
2526
  await clientSessions.get();
2344
2527
  }
2345
- async get(body) {
2346
- const { data } = await this.client.request({
2347
- url: "/devices/unmanaged/get",
2528
+ get(body) {
2529
+ return new SeamHttpRequest(this, {
2530
+ path: "/devices/unmanaged/get",
2348
2531
  method: "post",
2349
- data: body
2532
+ body,
2533
+ responseKey: "device"
2350
2534
  });
2351
- return data.device;
2352
2535
  }
2353
- async list(body) {
2354
- const { data } = await this.client.request({
2355
- url: "/devices/unmanaged/list",
2536
+ list(body) {
2537
+ return new SeamHttpRequest(this, {
2538
+ path: "/devices/unmanaged/list",
2356
2539
  method: "post",
2357
- data: body
2540
+ body,
2541
+ responseKey: "devices"
2358
2542
  });
2359
- return data.devices;
2360
2543
  }
2361
- async update(body) {
2362
- await this.client.request({
2363
- url: "/devices/unmanaged/update",
2544
+ update(body) {
2545
+ return new SeamHttpRequest(this, {
2546
+ path: "/devices/unmanaged/update",
2364
2547
  method: "post",
2365
- data: body
2548
+ body,
2549
+ responseKey: void 0
2366
2550
  });
2367
2551
  }
2368
2552
  };
@@ -2447,42 +2631,47 @@ var SeamHttpDevices = class _SeamHttpDevices {
2447
2631
  get unmanaged() {
2448
2632
  return SeamHttpDevicesUnmanaged.fromClient(this.client, this.defaults);
2449
2633
  }
2450
- async delete(body) {
2451
- await this.client.request({
2452
- url: "/devices/delete",
2634
+ get simulate() {
2635
+ return SeamHttpDevicesSimulate.fromClient(this.client, this.defaults);
2636
+ }
2637
+ delete(body) {
2638
+ return new SeamHttpRequest(this, {
2639
+ path: "/devices/delete",
2453
2640
  method: "post",
2454
- data: body
2641
+ body,
2642
+ responseKey: void 0
2455
2643
  });
2456
2644
  }
2457
- async get(body) {
2458
- const { data } = await this.client.request({
2459
- url: "/devices/get",
2645
+ get(body) {
2646
+ return new SeamHttpRequest(this, {
2647
+ path: "/devices/get",
2460
2648
  method: "post",
2461
- data: body
2649
+ body,
2650
+ responseKey: "device"
2462
2651
  });
2463
- return data.device;
2464
2652
  }
2465
- async list(body) {
2466
- const { data } = await this.client.request({
2467
- url: "/devices/list",
2653
+ list(body) {
2654
+ return new SeamHttpRequest(this, {
2655
+ path: "/devices/list",
2468
2656
  method: "post",
2469
- data: body
2657
+ body,
2658
+ responseKey: "devices"
2470
2659
  });
2471
- return data.devices;
2472
2660
  }
2473
- async listDeviceProviders(body) {
2474
- const { data } = await this.client.request({
2475
- url: "/devices/list_device_providers",
2661
+ listDeviceProviders(body) {
2662
+ return new SeamHttpRequest(this, {
2663
+ path: "/devices/list_device_providers",
2476
2664
  method: "post",
2477
- data: body
2665
+ body,
2666
+ responseKey: "device_providers"
2478
2667
  });
2479
- return data.device_providers;
2480
2668
  }
2481
- async update(body) {
2482
- await this.client.request({
2483
- url: "/devices/update",
2669
+ update(body) {
2670
+ return new SeamHttpRequest(this, {
2671
+ path: "/devices/update",
2484
2672
  method: "post",
2485
- data: body
2673
+ body,
2674
+ responseKey: void 0
2486
2675
  });
2487
2676
  }
2488
2677
  };
@@ -2564,21 +2753,21 @@ var SeamHttpEvents = class _SeamHttpEvents {
2564
2753
  const clientSessions = SeamHttpClientSessions.fromClient(this.client);
2565
2754
  await clientSessions.get();
2566
2755
  }
2567
- async get(body) {
2568
- const { data } = await this.client.request({
2569
- url: "/events/get",
2756
+ get(body) {
2757
+ return new SeamHttpRequest(this, {
2758
+ path: "/events/get",
2570
2759
  method: "post",
2571
- data: body
2760
+ body,
2761
+ responseKey: "event"
2572
2762
  });
2573
- return data.event;
2574
2763
  }
2575
- async list(body) {
2576
- const { data } = await this.client.request({
2577
- url: "/events/list",
2764
+ list(body) {
2765
+ return new SeamHttpRequest(this, {
2766
+ path: "/events/list",
2578
2767
  method: "post",
2579
- data: body
2768
+ body,
2769
+ responseKey: "events"
2580
2770
  });
2581
- return data.events;
2582
2771
  }
2583
2772
  };
2584
2773
 
@@ -2659,59 +2848,39 @@ var SeamHttpLocks = class _SeamHttpLocks {
2659
2848
  const clientSessions = SeamHttpClientSessions.fromClient(this.client);
2660
2849
  await clientSessions.get();
2661
2850
  }
2662
- async get(body) {
2663
- const { data } = await this.client.request({
2664
- url: "/locks/get",
2851
+ get(body) {
2852
+ return new SeamHttpRequest(this, {
2853
+ path: "/locks/get",
2665
2854
  method: "post",
2666
- data: body
2855
+ body,
2856
+ responseKey: "device"
2667
2857
  });
2668
- return data.device;
2669
2858
  }
2670
- async list(body) {
2671
- const { data } = await this.client.request({
2672
- url: "/locks/list",
2859
+ list(body) {
2860
+ return new SeamHttpRequest(this, {
2861
+ path: "/locks/list",
2673
2862
  method: "post",
2674
- data: body
2863
+ body,
2864
+ responseKey: "devices"
2675
2865
  });
2676
- return data.devices;
2677
2866
  }
2678
- async lockDoor(body, options = {}) {
2679
- const { data } = await this.client.request({
2680
- url: "/locks/lock_door",
2867
+ lockDoor(body, options = {}) {
2868
+ return new SeamHttpRequest(this, {
2869
+ path: "/locks/lock_door",
2681
2870
  method: "post",
2682
- data: body
2683
- });
2684
- const waitForActionAttempt = options.waitForActionAttempt ?? this.defaults.waitForActionAttempt;
2685
- if (waitForActionAttempt !== false) {
2686
- return await resolveActionAttempt(
2687
- data.action_attempt,
2688
- SeamHttpActionAttempts.fromClient(this.client, {
2689
- ...this.defaults,
2690
- waitForActionAttempt: false
2691
- }),
2692
- typeof waitForActionAttempt === "boolean" ? {} : waitForActionAttempt
2693
- );
2694
- }
2695
- return data.action_attempt;
2871
+ body,
2872
+ responseKey: "action_attempt",
2873
+ options
2874
+ });
2696
2875
  }
2697
- async unlockDoor(body, options = {}) {
2698
- const { data } = await this.client.request({
2699
- url: "/locks/unlock_door",
2876
+ unlockDoor(body, options = {}) {
2877
+ return new SeamHttpRequest(this, {
2878
+ path: "/locks/unlock_door",
2700
2879
  method: "post",
2701
- data: body
2702
- });
2703
- const waitForActionAttempt = options.waitForActionAttempt ?? this.defaults.waitForActionAttempt;
2704
- if (waitForActionAttempt !== false) {
2705
- return await resolveActionAttempt(
2706
- data.action_attempt,
2707
- SeamHttpActionAttempts.fromClient(this.client, {
2708
- ...this.defaults,
2709
- waitForActionAttempt: false
2710
- }),
2711
- typeof waitForActionAttempt === "boolean" ? {} : waitForActionAttempt
2712
- );
2713
- }
2714
- return data.action_attempt;
2880
+ body,
2881
+ responseKey: "action_attempt",
2882
+ options
2883
+ });
2715
2884
  }
2716
2885
  };
2717
2886
 
@@ -2792,21 +2961,21 @@ var SeamHttpNetworks = class _SeamHttpNetworks {
2792
2961
  const clientSessions = SeamHttpClientSessions.fromClient(this.client);
2793
2962
  await clientSessions.get();
2794
2963
  }
2795
- async get(body) {
2796
- const { data } = await this.client.request({
2797
- url: "/networks/get",
2964
+ get(body) {
2965
+ return new SeamHttpRequest(this, {
2966
+ path: "/networks/get",
2798
2967
  method: "post",
2799
- data: body
2968
+ body,
2969
+ responseKey: "network"
2800
2970
  });
2801
- return data.network;
2802
2971
  }
2803
- async list(body) {
2804
- const { data } = await this.client.request({
2805
- url: "/networks/list",
2972
+ list(body) {
2973
+ return new SeamHttpRequest(this, {
2974
+ path: "/networks/list",
2806
2975
  method: "post",
2807
- data: body
2976
+ body,
2977
+ responseKey: "networks"
2808
2978
  });
2809
- return data.networks;
2810
2979
  }
2811
2980
  };
2812
2981
 
@@ -2890,42 +3059,44 @@ var SeamHttpNoiseSensorsNoiseThresholds = class _SeamHttpNoiseSensorsNoiseThresh
2890
3059
  const clientSessions = SeamHttpClientSessions.fromClient(this.client);
2891
3060
  await clientSessions.get();
2892
3061
  }
2893
- async create(body) {
2894
- const { data } = await this.client.request({
2895
- url: "/noise_sensors/noise_thresholds/create",
3062
+ create(body) {
3063
+ return new SeamHttpRequest(this, {
3064
+ path: "/noise_sensors/noise_thresholds/create",
2896
3065
  method: "post",
2897
- data: body
3066
+ body,
3067
+ responseKey: "noise_threshold"
2898
3068
  });
2899
- return data.noise_threshold;
2900
3069
  }
2901
- async delete(body) {
2902
- await this.client.request({
2903
- url: "/noise_sensors/noise_thresholds/delete",
3070
+ delete(body) {
3071
+ return new SeamHttpRequest(this, {
3072
+ path: "/noise_sensors/noise_thresholds/delete",
2904
3073
  method: "post",
2905
- data: body
3074
+ body,
3075
+ responseKey: void 0
2906
3076
  });
2907
3077
  }
2908
- async get(body) {
2909
- const { data } = await this.client.request({
2910
- url: "/noise_sensors/noise_thresholds/get",
3078
+ get(body) {
3079
+ return new SeamHttpRequest(this, {
3080
+ path: "/noise_sensors/noise_thresholds/get",
2911
3081
  method: "post",
2912
- data: body
3082
+ body,
3083
+ responseKey: "noise_threshold"
2913
3084
  });
2914
- return data.noise_threshold;
2915
3085
  }
2916
- async list(body) {
2917
- const { data } = await this.client.request({
2918
- url: "/noise_sensors/noise_thresholds/list",
3086
+ list(body) {
3087
+ return new SeamHttpRequest(this, {
3088
+ path: "/noise_sensors/noise_thresholds/list",
2919
3089
  method: "post",
2920
- data: body
3090
+ body,
3091
+ responseKey: "noise_thresholds"
2921
3092
  });
2922
- return data.noise_thresholds;
2923
3093
  }
2924
- async update(body) {
2925
- await this.client.request({
2926
- url: "/noise_sensors/noise_thresholds/update",
3094
+ update(body) {
3095
+ return new SeamHttpRequest(this, {
3096
+ path: "/noise_sensors/noise_thresholds/update",
2927
3097
  method: "post",
2928
- data: body
3098
+ body,
3099
+ responseKey: void 0
2929
3100
  });
2930
3101
  }
2931
3102
  };
@@ -3092,13 +3263,13 @@ var SeamHttpPhonesSimulate = class _SeamHttpPhonesSimulate {
3092
3263
  const clientSessions = SeamHttpClientSessions.fromClient(this.client);
3093
3264
  await clientSessions.get();
3094
3265
  }
3095
- async createSandboxPhone(body) {
3096
- const { data } = await this.client.request({
3097
- url: "/phones/simulate/create_sandbox_phone",
3266
+ createSandboxPhone(body) {
3267
+ return new SeamHttpRequest(this, {
3268
+ path: "/phones/simulate/create_sandbox_phone",
3098
3269
  method: "post",
3099
- data: body
3270
+ body,
3271
+ responseKey: "phone"
3100
3272
  });
3101
- return data.phone;
3102
3273
  }
3103
3274
  };
3104
3275
 
@@ -3182,20 +3353,21 @@ var SeamHttpPhones = class _SeamHttpPhones {
3182
3353
  get simulate() {
3183
3354
  return SeamHttpPhonesSimulate.fromClient(this.client, this.defaults);
3184
3355
  }
3185
- async deactivate(body) {
3186
- await this.client.request({
3187
- url: "/phones/deactivate",
3356
+ deactivate(body) {
3357
+ return new SeamHttpRequest(this, {
3358
+ path: "/phones/deactivate",
3188
3359
  method: "post",
3189
- data: body
3360
+ body,
3361
+ responseKey: void 0
3190
3362
  });
3191
3363
  }
3192
- async list(body) {
3193
- const { data } = await this.client.request({
3194
- url: "/phones/list",
3364
+ list(body) {
3365
+ return new SeamHttpRequest(this, {
3366
+ path: "/phones/list",
3195
3367
  method: "post",
3196
- data: body
3368
+ body,
3369
+ responseKey: "phones"
3197
3370
  });
3198
- return data.phones;
3199
3371
  }
3200
3372
  };
3201
3373
 
@@ -3279,51 +3451,45 @@ var SeamHttpThermostatsClimateSettingSchedules = class _SeamHttpThermostatsClima
3279
3451
  const clientSessions = SeamHttpClientSessions.fromClient(this.client);
3280
3452
  await clientSessions.get();
3281
3453
  }
3282
- async create(body) {
3283
- const { data } = await this.client.request(
3284
- {
3285
- url: "/thermostats/climate_setting_schedules/create",
3286
- method: "post",
3287
- data: body
3288
- }
3289
- );
3290
- return data.climate_setting_schedule;
3291
- }
3292
- async delete(body) {
3293
- await this.client.request(
3294
- {
3295
- url: "/thermostats/climate_setting_schedules/delete",
3296
- method: "post",
3297
- data: body
3298
- }
3299
- );
3454
+ create(body) {
3455
+ return new SeamHttpRequest(this, {
3456
+ path: "/thermostats/climate_setting_schedules/create",
3457
+ method: "post",
3458
+ body,
3459
+ responseKey: "climate_setting_schedule"
3460
+ });
3300
3461
  }
3301
- async get(body) {
3302
- const { data } = await this.client.request({
3303
- url: "/thermostats/climate_setting_schedules/get",
3462
+ delete(body) {
3463
+ return new SeamHttpRequest(this, {
3464
+ path: "/thermostats/climate_setting_schedules/delete",
3304
3465
  method: "post",
3305
- data: body
3466
+ body,
3467
+ responseKey: void 0
3306
3468
  });
3307
- return data.climate_setting_schedule;
3308
3469
  }
3309
- async list(body) {
3310
- const { data } = await this.client.request(
3311
- {
3312
- url: "/thermostats/climate_setting_schedules/list",
3313
- method: "post",
3314
- data: body
3315
- }
3316
- );
3317
- return data.climate_setting_schedules;
3318
- }
3319
- async update(body) {
3320
- await this.client.request(
3321
- {
3322
- url: "/thermostats/climate_setting_schedules/update",
3323
- method: "post",
3324
- data: body
3325
- }
3326
- );
3470
+ get(body) {
3471
+ return new SeamHttpRequest(this, {
3472
+ path: "/thermostats/climate_setting_schedules/get",
3473
+ method: "post",
3474
+ body,
3475
+ responseKey: "climate_setting_schedule"
3476
+ });
3477
+ }
3478
+ list(body) {
3479
+ return new SeamHttpRequest(this, {
3480
+ path: "/thermostats/climate_setting_schedules/list",
3481
+ method: "post",
3482
+ body,
3483
+ responseKey: "climate_setting_schedules"
3484
+ });
3485
+ }
3486
+ update(body) {
3487
+ return new SeamHttpRequest(this, {
3488
+ path: "/thermostats/climate_setting_schedules/update",
3489
+ method: "post",
3490
+ body,
3491
+ responseKey: void 0
3492
+ });
3327
3493
  }
3328
3494
  };
3329
3495
 
@@ -3410,122 +3576,73 @@ var SeamHttpThermostats = class _SeamHttpThermostats {
3410
3576
  this.defaults
3411
3577
  );
3412
3578
  }
3413
- async cool(body, options = {}) {
3414
- const { data } = await this.client.request({
3415
- url: "/thermostats/cool",
3579
+ cool(body, options = {}) {
3580
+ return new SeamHttpRequest(this, {
3581
+ path: "/thermostats/cool",
3416
3582
  method: "post",
3417
- data: body
3418
- });
3419
- const waitForActionAttempt = options.waitForActionAttempt ?? this.defaults.waitForActionAttempt;
3420
- if (waitForActionAttempt !== false) {
3421
- return await resolveActionAttempt(
3422
- data.action_attempt,
3423
- SeamHttpActionAttempts.fromClient(this.client, {
3424
- ...this.defaults,
3425
- waitForActionAttempt: false
3426
- }),
3427
- typeof waitForActionAttempt === "boolean" ? {} : waitForActionAttempt
3428
- );
3429
- }
3430
- return data.action_attempt;
3583
+ body,
3584
+ responseKey: "action_attempt",
3585
+ options
3586
+ });
3431
3587
  }
3432
- async get(body) {
3433
- const { data } = await this.client.request({
3434
- url: "/thermostats/get",
3588
+ get(body) {
3589
+ return new SeamHttpRequest(this, {
3590
+ path: "/thermostats/get",
3435
3591
  method: "post",
3436
- data: body
3592
+ body,
3593
+ responseKey: "thermostat"
3437
3594
  });
3438
- return data.thermostat;
3439
3595
  }
3440
- async heat(body, options = {}) {
3441
- const { data } = await this.client.request({
3442
- url: "/thermostats/heat",
3596
+ heat(body, options = {}) {
3597
+ return new SeamHttpRequest(this, {
3598
+ path: "/thermostats/heat",
3443
3599
  method: "post",
3444
- data: body
3445
- });
3446
- const waitForActionAttempt = options.waitForActionAttempt ?? this.defaults.waitForActionAttempt;
3447
- if (waitForActionAttempt !== false) {
3448
- return await resolveActionAttempt(
3449
- data.action_attempt,
3450
- SeamHttpActionAttempts.fromClient(this.client, {
3451
- ...this.defaults,
3452
- waitForActionAttempt: false
3453
- }),
3454
- typeof waitForActionAttempt === "boolean" ? {} : waitForActionAttempt
3455
- );
3456
- }
3457
- return data.action_attempt;
3600
+ body,
3601
+ responseKey: "action_attempt",
3602
+ options
3603
+ });
3458
3604
  }
3459
- async heatCool(body, options = {}) {
3460
- const { data } = await this.client.request({
3461
- url: "/thermostats/heat_cool",
3605
+ heatCool(body, options = {}) {
3606
+ return new SeamHttpRequest(this, {
3607
+ path: "/thermostats/heat_cool",
3462
3608
  method: "post",
3463
- data: body
3464
- });
3465
- const waitForActionAttempt = options.waitForActionAttempt ?? this.defaults.waitForActionAttempt;
3466
- if (waitForActionAttempt !== false) {
3467
- return await resolveActionAttempt(
3468
- data.action_attempt,
3469
- SeamHttpActionAttempts.fromClient(this.client, {
3470
- ...this.defaults,
3471
- waitForActionAttempt: false
3472
- }),
3473
- typeof waitForActionAttempt === "boolean" ? {} : waitForActionAttempt
3474
- );
3475
- }
3476
- return data.action_attempt;
3609
+ body,
3610
+ responseKey: "action_attempt",
3611
+ options
3612
+ });
3477
3613
  }
3478
- async list(body) {
3479
- const { data } = await this.client.request({
3480
- url: "/thermostats/list",
3614
+ list(body) {
3615
+ return new SeamHttpRequest(this, {
3616
+ path: "/thermostats/list",
3481
3617
  method: "post",
3482
- data: body
3618
+ body,
3619
+ responseKey: "thermostats"
3483
3620
  });
3484
- return data.thermostats;
3485
3621
  }
3486
- async off(body, options = {}) {
3487
- const { data } = await this.client.request({
3488
- url: "/thermostats/off",
3622
+ off(body, options = {}) {
3623
+ return new SeamHttpRequest(this, {
3624
+ path: "/thermostats/off",
3489
3625
  method: "post",
3490
- data: body
3491
- });
3492
- const waitForActionAttempt = options.waitForActionAttempt ?? this.defaults.waitForActionAttempt;
3493
- if (waitForActionAttempt !== false) {
3494
- return await resolveActionAttempt(
3495
- data.action_attempt,
3496
- SeamHttpActionAttempts.fromClient(this.client, {
3497
- ...this.defaults,
3498
- waitForActionAttempt: false
3499
- }),
3500
- typeof waitForActionAttempt === "boolean" ? {} : waitForActionAttempt
3501
- );
3502
- }
3503
- return data.action_attempt;
3626
+ body,
3627
+ responseKey: "action_attempt",
3628
+ options
3629
+ });
3504
3630
  }
3505
- async setFanMode(body, options = {}) {
3506
- const { data } = await this.client.request({
3507
- url: "/thermostats/set_fan_mode",
3631
+ setFanMode(body, options = {}) {
3632
+ return new SeamHttpRequest(this, {
3633
+ path: "/thermostats/set_fan_mode",
3508
3634
  method: "post",
3509
- data: body
3510
- });
3511
- const waitForActionAttempt = options.waitForActionAttempt ?? this.defaults.waitForActionAttempt;
3512
- if (waitForActionAttempt !== false) {
3513
- return await resolveActionAttempt(
3514
- data.action_attempt,
3515
- SeamHttpActionAttempts.fromClient(this.client, {
3516
- ...this.defaults,
3517
- waitForActionAttempt: false
3518
- }),
3519
- typeof waitForActionAttempt === "boolean" ? {} : waitForActionAttempt
3520
- );
3521
- }
3522
- return data.action_attempt;
3635
+ body,
3636
+ responseKey: "action_attempt",
3637
+ options
3638
+ });
3523
3639
  }
3524
- async update(body) {
3525
- await this.client.request({
3526
- url: "/thermostats/update",
3640
+ update(body) {
3641
+ return new SeamHttpRequest(this, {
3642
+ path: "/thermostats/update",
3527
3643
  method: "post",
3528
- data: body
3644
+ body,
3645
+ responseKey: void 0
3529
3646
  });
3530
3647
  }
3531
3648
  };
@@ -3610,44 +3727,37 @@ var SeamHttpUserIdentitiesEnrollmentAutomations = class _SeamHttpUserIdentitiesE
3610
3727
  const clientSessions = SeamHttpClientSessions.fromClient(this.client);
3611
3728
  await clientSessions.get();
3612
3729
  }
3613
- async delete(body) {
3614
- await this.client.request(
3615
- {
3616
- url: "/user_identities/enrollment_automations/delete",
3617
- method: "post",
3618
- data: body
3619
- }
3620
- );
3730
+ delete(body) {
3731
+ return new SeamHttpRequest(this, {
3732
+ path: "/user_identities/enrollment_automations/delete",
3733
+ method: "post",
3734
+ body,
3735
+ responseKey: void 0
3736
+ });
3621
3737
  }
3622
- async get(body) {
3623
- const { data } = await this.client.request(
3624
- {
3625
- url: "/user_identities/enrollment_automations/get",
3626
- method: "post",
3627
- data: body
3628
- }
3629
- );
3630
- return data.enrollment_automation;
3631
- }
3632
- async launch(body) {
3633
- const { data } = await this.client.request(
3634
- {
3635
- url: "/user_identities/enrollment_automations/launch",
3636
- method: "post",
3637
- data: body
3638
- }
3639
- );
3640
- return data.enrollment_automation;
3641
- }
3642
- async list(body) {
3643
- const { data } = await this.client.request(
3644
- {
3645
- url: "/user_identities/enrollment_automations/list",
3646
- method: "post",
3647
- data: body
3648
- }
3649
- );
3650
- return data.enrollment_automations;
3738
+ get(body) {
3739
+ return new SeamHttpRequest(this, {
3740
+ path: "/user_identities/enrollment_automations/get",
3741
+ method: "post",
3742
+ body,
3743
+ responseKey: "enrollment_automation"
3744
+ });
3745
+ }
3746
+ launch(body) {
3747
+ return new SeamHttpRequest(this, {
3748
+ path: "/user_identities/enrollment_automations/launch",
3749
+ method: "post",
3750
+ body,
3751
+ responseKey: "enrollment_automation"
3752
+ });
3753
+ }
3754
+ list(body) {
3755
+ return new SeamHttpRequest(this, {
3756
+ path: "/user_identities/enrollment_automations/list",
3757
+ method: "post",
3758
+ body,
3759
+ responseKey: "enrollment_automations"
3760
+ });
3651
3761
  }
3652
3762
  };
3653
3763
 
@@ -3734,94 +3844,100 @@ var SeamHttpUserIdentities = class _SeamHttpUserIdentities {
3734
3844
  this.defaults
3735
3845
  );
3736
3846
  }
3737
- async addAcsUser(body) {
3738
- await this.client.request({
3739
- url: "/user_identities/add_acs_user",
3847
+ addAcsUser(body) {
3848
+ return new SeamHttpRequest(this, {
3849
+ path: "/user_identities/add_acs_user",
3740
3850
  method: "post",
3741
- data: body
3851
+ body,
3852
+ responseKey: void 0
3742
3853
  });
3743
3854
  }
3744
- async create(body) {
3745
- const { data } = await this.client.request({
3746
- url: "/user_identities/create",
3855
+ create(body) {
3856
+ return new SeamHttpRequest(this, {
3857
+ path: "/user_identities/create",
3747
3858
  method: "post",
3748
- data: body
3859
+ body,
3860
+ responseKey: "user_identity"
3749
3861
  });
3750
- return data.user_identity;
3751
3862
  }
3752
- async delete(body) {
3753
- await this.client.request({
3754
- url: "/user_identities/delete",
3863
+ delete(body) {
3864
+ return new SeamHttpRequest(this, {
3865
+ path: "/user_identities/delete",
3755
3866
  method: "post",
3756
- data: body
3867
+ body,
3868
+ responseKey: void 0
3757
3869
  });
3758
3870
  }
3759
- async get(body) {
3760
- const { data } = await this.client.request({
3761
- url: "/user_identities/get",
3871
+ get(body) {
3872
+ return new SeamHttpRequest(this, {
3873
+ path: "/user_identities/get",
3762
3874
  method: "post",
3763
- data: body
3875
+ body,
3876
+ responseKey: "user_identity"
3764
3877
  });
3765
- return data.user_identity;
3766
3878
  }
3767
- async grantAccessToDevice(body) {
3768
- await this.client.request({
3769
- url: "/user_identities/grant_access_to_device",
3879
+ grantAccessToDevice(body) {
3880
+ return new SeamHttpRequest(this, {
3881
+ path: "/user_identities/grant_access_to_device",
3770
3882
  method: "post",
3771
- data: body
3883
+ body,
3884
+ responseKey: void 0
3772
3885
  });
3773
3886
  }
3774
- async list(body) {
3775
- const { data } = await this.client.request({
3776
- url: "/user_identities/list",
3887
+ list(body) {
3888
+ return new SeamHttpRequest(this, {
3889
+ path: "/user_identities/list",
3777
3890
  method: "post",
3778
- data: body
3891
+ body,
3892
+ responseKey: "user_identities"
3779
3893
  });
3780
- return data.user_identities;
3781
3894
  }
3782
- async listAccessibleDevices(body) {
3783
- const { data } = await this.client.request({
3784
- url: "/user_identities/list_accessible_devices",
3895
+ listAccessibleDevices(body) {
3896
+ return new SeamHttpRequest(this, {
3897
+ path: "/user_identities/list_accessible_devices",
3785
3898
  method: "post",
3786
- data: body
3899
+ body,
3900
+ responseKey: "accessible_devices"
3787
3901
  });
3788
- return data.accessible_devices;
3789
3902
  }
3790
- async listAcsSystems(body) {
3791
- const { data } = await this.client.request({
3792
- url: "/user_identities/list_acs_systems",
3903
+ listAcsSystems(body) {
3904
+ return new SeamHttpRequest(this, {
3905
+ path: "/user_identities/list_acs_systems",
3793
3906
  method: "post",
3794
- data: body
3907
+ body,
3908
+ responseKey: "acs_systems"
3795
3909
  });
3796
- return data.acs_systems;
3797
3910
  }
3798
- async listAcsUsers(body) {
3799
- const { data } = await this.client.request({
3800
- url: "/user_identities/list_acs_users",
3911
+ listAcsUsers(body) {
3912
+ return new SeamHttpRequest(this, {
3913
+ path: "/user_identities/list_acs_users",
3801
3914
  method: "post",
3802
- data: body
3915
+ body,
3916
+ responseKey: "acs_users"
3803
3917
  });
3804
- return data.acs_users;
3805
3918
  }
3806
- async removeAcsUser(body) {
3807
- await this.client.request({
3808
- url: "/user_identities/remove_acs_user",
3919
+ removeAcsUser(body) {
3920
+ return new SeamHttpRequest(this, {
3921
+ path: "/user_identities/remove_acs_user",
3809
3922
  method: "post",
3810
- data: body
3923
+ body,
3924
+ responseKey: void 0
3811
3925
  });
3812
3926
  }
3813
- async revokeAccessToDevice(body) {
3814
- await this.client.request({
3815
- url: "/user_identities/revoke_access_to_device",
3927
+ revokeAccessToDevice(body) {
3928
+ return new SeamHttpRequest(this, {
3929
+ path: "/user_identities/revoke_access_to_device",
3816
3930
  method: "post",
3817
- data: body
3931
+ body,
3932
+ responseKey: void 0
3818
3933
  });
3819
3934
  }
3820
- async update(body) {
3821
- await this.client.request({
3822
- url: "/user_identities/update",
3935
+ update(body) {
3936
+ return new SeamHttpRequest(this, {
3937
+ path: "/user_identities/update",
3823
3938
  method: "post",
3824
- data: body
3939
+ body,
3940
+ responseKey: void 0
3825
3941
  });
3826
3942
  }
3827
3943
  };
@@ -3903,42 +4019,44 @@ var SeamHttpWebhooks = class _SeamHttpWebhooks {
3903
4019
  const clientSessions = SeamHttpClientSessions.fromClient(this.client);
3904
4020
  await clientSessions.get();
3905
4021
  }
3906
- async create(body) {
3907
- const { data } = await this.client.request({
3908
- url: "/webhooks/create",
4022
+ create(body) {
4023
+ return new SeamHttpRequest(this, {
4024
+ path: "/webhooks/create",
3909
4025
  method: "post",
3910
- data: body
4026
+ body,
4027
+ responseKey: "webhook"
3911
4028
  });
3912
- return data.webhook;
3913
4029
  }
3914
- async delete(body) {
3915
- await this.client.request({
3916
- url: "/webhooks/delete",
4030
+ delete(body) {
4031
+ return new SeamHttpRequest(this, {
4032
+ path: "/webhooks/delete",
3917
4033
  method: "post",
3918
- data: body
4034
+ body,
4035
+ responseKey: void 0
3919
4036
  });
3920
4037
  }
3921
- async get(body) {
3922
- const { data } = await this.client.request({
3923
- url: "/webhooks/get",
4038
+ get(body) {
4039
+ return new SeamHttpRequest(this, {
4040
+ path: "/webhooks/get",
3924
4041
  method: "post",
3925
- data: body
4042
+ body,
4043
+ responseKey: "webhook"
3926
4044
  });
3927
- return data.webhook;
3928
4045
  }
3929
- async list(body) {
3930
- const { data } = await this.client.request({
3931
- url: "/webhooks/list",
4046
+ list(body) {
4047
+ return new SeamHttpRequest(this, {
4048
+ path: "/webhooks/list",
3932
4049
  method: "post",
3933
- data: body
4050
+ body,
4051
+ responseKey: "webhooks"
3934
4052
  });
3935
- return data.webhooks;
3936
4053
  }
3937
- async update(body) {
3938
- await this.client.request({
3939
- url: "/webhooks/update",
4054
+ update(body) {
4055
+ return new SeamHttpRequest(this, {
4056
+ path: "/webhooks/update",
3940
4057
  method: "post",
3941
- data: body
4058
+ body,
4059
+ responseKey: void 0
3942
4060
  });
3943
4061
  }
3944
4062
  };
@@ -4020,35 +4138,36 @@ var SeamHttpWorkspaces = class _SeamHttpWorkspaces {
4020
4138
  const clientSessions = SeamHttpClientSessions.fromClient(this.client);
4021
4139
  await clientSessions.get();
4022
4140
  }
4023
- async create(body) {
4024
- const { data } = await this.client.request({
4025
- url: "/workspaces/create",
4141
+ create(body) {
4142
+ return new SeamHttpRequest(this, {
4143
+ path: "/workspaces/create",
4026
4144
  method: "post",
4027
- data: body
4145
+ body,
4146
+ responseKey: "workspace"
4028
4147
  });
4029
- return data.workspace;
4030
4148
  }
4031
- async get(body) {
4032
- const { data } = await this.client.request({
4033
- url: "/workspaces/get",
4149
+ get(body) {
4150
+ return new SeamHttpRequest(this, {
4151
+ path: "/workspaces/get",
4034
4152
  method: "post",
4035
- data: body
4153
+ body,
4154
+ responseKey: "workspace"
4036
4155
  });
4037
- return data.workspace;
4038
4156
  }
4039
- async list(body) {
4040
- const { data } = await this.client.request({
4041
- url: "/workspaces/list",
4157
+ list(body) {
4158
+ return new SeamHttpRequest(this, {
4159
+ path: "/workspaces/list",
4042
4160
  method: "post",
4043
- data: body
4161
+ body,
4162
+ responseKey: "workspaces"
4044
4163
  });
4045
- return data.workspaces;
4046
4164
  }
4047
- async resetSandbox(body) {
4048
- await this.client.request({
4049
- url: "/workspaces/reset_sandbox",
4165
+ resetSandbox(body) {
4166
+ return new SeamHttpRequest(this, {
4167
+ path: "/workspaces/reset_sandbox",
4050
4168
  method: "post",
4051
- data: body
4169
+ body,
4170
+ responseKey: void 0
4052
4171
  });
4053
4172
  }
4054
4173
  };
@@ -4244,6 +4363,7 @@ exports.SeamHttpClientSessions = SeamHttpClientSessions;
4244
4363
  exports.SeamHttpConnectWebviews = SeamHttpConnectWebviews;
4245
4364
  exports.SeamHttpConnectedAccounts = SeamHttpConnectedAccounts;
4246
4365
  exports.SeamHttpDevices = SeamHttpDevices;
4366
+ exports.SeamHttpDevicesSimulate = SeamHttpDevicesSimulate;
4247
4367
  exports.SeamHttpDevicesUnmanaged = SeamHttpDevicesUnmanaged;
4248
4368
  exports.SeamHttpEvents = SeamHttpEvents;
4249
4369
  exports.SeamHttpInvalidInputError = SeamHttpInvalidInputError;