@greensecurity/javascript-sdk 0.48.0 → 0.49.0-beta.1

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 (167) hide show
  1. package/dist/commonjs/__tests__/users.test.js +3 -0
  2. package/dist/commonjs/__tests__/users.test.js.map +1 -1
  3. package/dist/commonjs/__tests__/vendors.test.js +1 -1
  4. package/dist/commonjs/__tests__/webhooks.test.js +4 -5
  5. package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
  6. package/dist/commonjs/__tests__/zoneDevicesCreate.test.js +34 -0
  7. package/dist/commonjs/__tests__/zoneDevicesCreate.test.js.map +1 -1
  8. package/dist/commonjs/__tests__/zoneDevicesList.test.js +4 -0
  9. package/dist/commonjs/__tests__/zoneDevicesList.test.js.map +1 -1
  10. package/dist/commonjs/__tests__/zones.test.js +1 -1
  11. package/dist/commonjs/admin-funcs/zoneDevicesFactoryReset.d.ts +3 -0
  12. package/dist/commonjs/admin-funcs/zoneDevicesFactoryReset.d.ts.map +1 -0
  13. package/dist/commonjs/admin-funcs/zoneDevicesFactoryReset.js +14 -0
  14. package/dist/commonjs/admin-funcs/zoneDevicesFactoryReset.js.map +1 -0
  15. package/dist/commonjs/admin-funcs/zoneDevicesFirmwareUpdate.d.ts +3 -0
  16. package/dist/commonjs/admin-funcs/zoneDevicesFirmwareUpdate.d.ts.map +1 -0
  17. package/dist/commonjs/admin-funcs/zoneDevicesFirmwareUpdate.js +14 -0
  18. package/dist/commonjs/admin-funcs/zoneDevicesFirmwareUpdate.js.map +1 -0
  19. package/dist/commonjs/admin-funcs/zoneDevicesFirmwareVersions.d.ts +8 -0
  20. package/dist/commonjs/admin-funcs/zoneDevicesFirmwareVersions.d.ts.map +1 -0
  21. package/dist/commonjs/admin-funcs/zoneDevicesFirmwareVersions.js +13 -0
  22. package/dist/commonjs/admin-funcs/zoneDevicesFirmwareVersions.js.map +1 -0
  23. package/dist/commonjs/admin-funcs/zoneDevicesReboot.d.ts +3 -0
  24. package/dist/commonjs/admin-funcs/zoneDevicesReboot.d.ts.map +1 -0
  25. package/dist/commonjs/admin-funcs/zoneDevicesReboot.js +13 -0
  26. package/dist/commonjs/admin-funcs/zoneDevicesReboot.js.map +1 -0
  27. package/dist/commonjs/funcs/vendorsChangeSubscription.d.ts +3 -2
  28. package/dist/commonjs/funcs/vendorsChangeSubscription.d.ts.map +1 -1
  29. package/dist/commonjs/funcs/vendorsChangeSubscription.js +3 -2
  30. package/dist/commonjs/funcs/vendorsChangeSubscription.js.map +1 -1
  31. package/dist/commonjs/funcs/vendorsUpdateVendorDetails.d.ts +9 -1
  32. package/dist/commonjs/funcs/vendorsUpdateVendorDetails.d.ts.map +1 -1
  33. package/dist/commonjs/funcs/vendorsUpdateVendorDetails.js +9 -1
  34. package/dist/commonjs/funcs/vendorsUpdateVendorDetails.js.map +1 -1
  35. package/dist/commonjs/funcs/zonesSecurityZoneCheckin.d.ts +1 -1
  36. package/dist/commonjs/funcs/zonesSecurityZoneCheckin.js +1 -1
  37. package/dist/commonjs/index.extras.d.ts +8 -0
  38. package/dist/commonjs/index.extras.d.ts.map +1 -1
  39. package/dist/commonjs/index.extras.js +9 -1
  40. package/dist/commonjs/index.extras.js.map +1 -1
  41. package/dist/commonjs/lib/config.d.ts +3 -3
  42. package/dist/commonjs/lib/config.js +3 -3
  43. package/dist/commonjs/lib/config.js.map +1 -1
  44. package/dist/commonjs/models/components/userdetails.d.ts +22 -0
  45. package/dist/commonjs/models/components/userdetails.d.ts.map +1 -1
  46. package/dist/commonjs/models/components/userdetails.js +6 -0
  47. package/dist/commonjs/models/components/userdetails.js.map +1 -1
  48. package/dist/commonjs/models/components/userlocation.d.ts +10 -0
  49. package/dist/commonjs/models/components/userlocation.d.ts.map +1 -1
  50. package/dist/commonjs/models/components/userlocation.js +8 -0
  51. package/dist/commonjs/models/components/userlocation.js.map +1 -1
  52. package/dist/commonjs/models/operations/updateuser.d.ts +0 -2
  53. package/dist/commonjs/models/operations/updateuser.d.ts.map +1 -1
  54. package/dist/commonjs/models/operations/updateuser.js +0 -1
  55. package/dist/commonjs/models/operations/updateuser.js.map +1 -1
  56. package/dist/commonjs/react-query/vendorsChangeSubscription.d.ts +3 -2
  57. package/dist/commonjs/react-query/vendorsChangeSubscription.d.ts.map +1 -1
  58. package/dist/commonjs/react-query/vendorsChangeSubscription.js +3 -2
  59. package/dist/commonjs/react-query/vendorsChangeSubscription.js.map +1 -1
  60. package/dist/commonjs/react-query/vendorsUpdateVendorDetails.d.ts +9 -1
  61. package/dist/commonjs/react-query/vendorsUpdateVendorDetails.d.ts.map +1 -1
  62. package/dist/commonjs/react-query/vendorsUpdateVendorDetails.js +9 -1
  63. package/dist/commonjs/react-query/vendorsUpdateVendorDetails.js.map +1 -1
  64. package/dist/commonjs/react-query/zonesSecurityZoneCheckin.d.ts +1 -1
  65. package/dist/commonjs/react-query/zonesSecurityZoneCheckin.js +1 -1
  66. package/dist/commonjs/sdk/vendors.d.ts +12 -3
  67. package/dist/commonjs/sdk/vendors.d.ts.map +1 -1
  68. package/dist/commonjs/sdk/vendors.js +12 -3
  69. package/dist/commonjs/sdk/vendors.js.map +1 -1
  70. package/dist/commonjs/sdk/zones.d.ts +1 -1
  71. package/dist/commonjs/sdk/zones.js +1 -1
  72. package/dist/esm/__tests__/users.test.js +3 -0
  73. package/dist/esm/__tests__/users.test.js.map +1 -1
  74. package/dist/esm/__tests__/vendors.test.js +1 -1
  75. package/dist/esm/__tests__/webhooks.test.js +4 -5
  76. package/dist/esm/__tests__/webhooks.test.js.map +1 -1
  77. package/dist/esm/__tests__/zoneDevicesCreate.test.js +34 -0
  78. package/dist/esm/__tests__/zoneDevicesCreate.test.js.map +1 -1
  79. package/dist/esm/__tests__/zoneDevicesList.test.js +4 -0
  80. package/dist/esm/__tests__/zoneDevicesList.test.js.map +1 -1
  81. package/dist/esm/__tests__/zones.test.js +1 -1
  82. package/dist/esm/admin-funcs/zoneDevicesFactoryReset.d.ts +3 -0
  83. package/dist/esm/admin-funcs/zoneDevicesFactoryReset.d.ts.map +1 -0
  84. package/dist/esm/admin-funcs/zoneDevicesFactoryReset.js +11 -0
  85. package/dist/esm/admin-funcs/zoneDevicesFactoryReset.js.map +1 -0
  86. package/dist/esm/admin-funcs/zoneDevicesFirmwareUpdate.d.ts +3 -0
  87. package/dist/esm/admin-funcs/zoneDevicesFirmwareUpdate.d.ts.map +1 -0
  88. package/dist/esm/admin-funcs/zoneDevicesFirmwareUpdate.js +11 -0
  89. package/dist/esm/admin-funcs/zoneDevicesFirmwareUpdate.js.map +1 -0
  90. package/dist/esm/admin-funcs/zoneDevicesFirmwareVersions.d.ts +8 -0
  91. package/dist/esm/admin-funcs/zoneDevicesFirmwareVersions.d.ts.map +1 -0
  92. package/dist/esm/admin-funcs/zoneDevicesFirmwareVersions.js +10 -0
  93. package/dist/esm/admin-funcs/zoneDevicesFirmwareVersions.js.map +1 -0
  94. package/dist/esm/admin-funcs/zoneDevicesReboot.d.ts +3 -0
  95. package/dist/esm/admin-funcs/zoneDevicesReboot.d.ts.map +1 -0
  96. package/dist/esm/admin-funcs/zoneDevicesReboot.js +10 -0
  97. package/dist/esm/admin-funcs/zoneDevicesReboot.js.map +1 -0
  98. package/dist/esm/funcs/vendorsChangeSubscription.d.ts +3 -2
  99. package/dist/esm/funcs/vendorsChangeSubscription.d.ts.map +1 -1
  100. package/dist/esm/funcs/vendorsChangeSubscription.js +3 -2
  101. package/dist/esm/funcs/vendorsChangeSubscription.js.map +1 -1
  102. package/dist/esm/funcs/vendorsUpdateVendorDetails.d.ts +9 -1
  103. package/dist/esm/funcs/vendorsUpdateVendorDetails.d.ts.map +1 -1
  104. package/dist/esm/funcs/vendorsUpdateVendorDetails.js +9 -1
  105. package/dist/esm/funcs/vendorsUpdateVendorDetails.js.map +1 -1
  106. package/dist/esm/funcs/zonesSecurityZoneCheckin.d.ts +1 -1
  107. package/dist/esm/funcs/zonesSecurityZoneCheckin.js +1 -1
  108. package/dist/esm/index.extras.d.ts +8 -0
  109. package/dist/esm/index.extras.d.ts.map +1 -1
  110. package/dist/esm/index.extras.js +9 -1
  111. package/dist/esm/index.extras.js.map +1 -1
  112. package/dist/esm/lib/config.d.ts +3 -3
  113. package/dist/esm/lib/config.js +3 -3
  114. package/dist/esm/lib/config.js.map +1 -1
  115. package/dist/esm/models/components/userdetails.d.ts +22 -0
  116. package/dist/esm/models/components/userdetails.d.ts.map +1 -1
  117. package/dist/esm/models/components/userdetails.js +6 -0
  118. package/dist/esm/models/components/userdetails.js.map +1 -1
  119. package/dist/esm/models/components/userlocation.d.ts +10 -0
  120. package/dist/esm/models/components/userlocation.d.ts.map +1 -1
  121. package/dist/esm/models/components/userlocation.js +8 -0
  122. package/dist/esm/models/components/userlocation.js.map +1 -1
  123. package/dist/esm/models/operations/updateuser.d.ts +0 -2
  124. package/dist/esm/models/operations/updateuser.d.ts.map +1 -1
  125. package/dist/esm/models/operations/updateuser.js +0 -1
  126. package/dist/esm/models/operations/updateuser.js.map +1 -1
  127. package/dist/esm/react-query/vendorsChangeSubscription.d.ts +3 -2
  128. package/dist/esm/react-query/vendorsChangeSubscription.d.ts.map +1 -1
  129. package/dist/esm/react-query/vendorsChangeSubscription.js +3 -2
  130. package/dist/esm/react-query/vendorsChangeSubscription.js.map +1 -1
  131. package/dist/esm/react-query/vendorsUpdateVendorDetails.d.ts +9 -1
  132. package/dist/esm/react-query/vendorsUpdateVendorDetails.d.ts.map +1 -1
  133. package/dist/esm/react-query/vendorsUpdateVendorDetails.js +9 -1
  134. package/dist/esm/react-query/vendorsUpdateVendorDetails.js.map +1 -1
  135. package/dist/esm/react-query/zonesSecurityZoneCheckin.d.ts +1 -1
  136. package/dist/esm/react-query/zonesSecurityZoneCheckin.js +1 -1
  137. package/dist/esm/sdk/vendors.d.ts +12 -3
  138. package/dist/esm/sdk/vendors.d.ts.map +1 -1
  139. package/dist/esm/sdk/vendors.js +12 -3
  140. package/dist/esm/sdk/vendors.js.map +1 -1
  141. package/dist/esm/sdk/zones.d.ts +1 -1
  142. package/dist/esm/sdk/zones.js +1 -1
  143. package/jsr.json +1 -1
  144. package/package.json +1 -1
  145. package/src/__tests__/users.test.ts +3 -0
  146. package/src/__tests__/vendors.test.ts +1 -1
  147. package/src/__tests__/webhooks.test.ts +4 -5
  148. package/src/__tests__/zoneDevicesCreate.test.ts +48 -0
  149. package/src/__tests__/zoneDevicesList.test.ts +4 -0
  150. package/src/__tests__/zones.test.ts +1 -1
  151. package/src/admin-funcs/zoneDevicesFactoryReset.ts +11 -0
  152. package/src/admin-funcs/zoneDevicesFirmwareUpdate.ts +11 -0
  153. package/src/admin-funcs/zoneDevicesFirmwareVersions.ts +22 -0
  154. package/src/admin-funcs/zoneDevicesReboot.ts +10 -0
  155. package/src/funcs/vendorsChangeSubscription.ts +3 -2
  156. package/src/funcs/vendorsUpdateVendorDetails.ts +9 -1
  157. package/src/funcs/zonesSecurityZoneCheckin.ts +1 -1
  158. package/src/index.extras.ts +9 -1
  159. package/src/lib/config.ts +3 -3
  160. package/src/models/components/userdetails.ts +28 -0
  161. package/src/models/components/userlocation.ts +18 -0
  162. package/src/models/operations/updateuser.ts +0 -3
  163. package/src/react-query/vendorsChangeSubscription.ts +3 -2
  164. package/src/react-query/vendorsUpdateVendorDetails.ts +9 -1
  165. package/src/react-query/zonesSecurityZoneCheckin.ts +1 -1
  166. package/src/sdk/vendors.ts +12 -3
  167. package/src/sdk/zones.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greensecurity/javascript-sdk",
3
- "version": "0.48.0",
3
+ "version": "0.49.0-beta.1",
4
4
  "author": "Green Security LLC",
5
5
  "type": "module",
6
6
  "tshy": {
@@ -116,8 +116,11 @@ test("Users Update User", async () => {
116
116
  user: {
117
117
  id: 123,
118
118
  firstName: "John",
119
+ middleName: "Marie",
119
120
  lastName: "Doe",
120
121
  email: "john@example.com",
122
+ workEmail: "john.doe@acme.com",
123
+ personalEmail: "john.doe@gmail.com",
121
124
  phone: "555-555-5555",
122
125
  userType: "Facility User",
123
126
  timezone: "America/Chicago",
@@ -121,7 +121,7 @@ test("Vendors List Vendor Credits", async () => {
121
121
  page: 1,
122
122
  useUrlParams: false,
123
123
  },
124
- creditBalance: 5488.14,
124
+ creditBalance: 3532.73,
125
125
  });
126
126
  });
127
127
 
@@ -62,11 +62,10 @@ test("Webhooks Updates The Webhook Endpoint With The Given Id", async () => {
62
62
  id: 220782,
63
63
  webhookEndpointUpdate: {
64
64
  webhookUrl: "https://example.com/webhook/incoming",
65
- subscriptions: {
66
- model: "Vendor",
67
- action: "updated",
68
- expands: "vendor.company,vendor.user",
69
- },
65
+ subscriptions: [
66
+ "Vendor.updated",
67
+ "Vendor.created",
68
+ ],
70
69
  consumers: {
71
70
  systemId: 1,
72
71
  facilityId: 1,
@@ -73,6 +73,54 @@ describe("__internal.zoneDevices", () => {
73
73
  });
74
74
  });
75
75
 
76
+ it("puts the Wi-Fi firmware version to /zone-devices/:id/firmware-versions", () => {
77
+ __internal.zoneDevices.firmwareVersions(42, { wifi_version: "v3.8.6" });
78
+
79
+ expect(doPutMock).toHaveBeenCalledWith("/zone-devices/42/firmware-versions", { wifi_version: "v3.8.6" });
80
+ });
81
+
82
+ it("puts the BLE firmware version to /zone-devices/:id/firmware-versions", () => {
83
+ __internal.zoneDevices.firmwareVersions(42, { ble_version: "v1.2.3" });
84
+
85
+ expect(doPutMock).toHaveBeenCalledWith("/zone-devices/42/firmware-versions", { ble_version: "v1.2.3" });
86
+ });
87
+
88
+ it("puts both firmware versions verbatim to /zone-devices/:id/firmware-versions", () => {
89
+ __internal.zoneDevices.firmwareVersions(42, { wifi_version: "v3.8.6", ble_version: "v1.2.3" });
90
+
91
+ expect(doPutMock).toHaveBeenCalledWith("/zone-devices/42/firmware-versions", {
92
+ wifi_version: "v3.8.6",
93
+ ble_version: "v1.2.3",
94
+ });
95
+ });
96
+
97
+ it("puts auto_update verbatim to /zone-devices/:id/firmware-versions", () => {
98
+ __internal.zoneDevices.firmwareVersions(42, { wifi_version: "v3.8.6", auto_update: true });
99
+
100
+ expect(doPutMock).toHaveBeenCalledWith("/zone-devices/42/firmware-versions", {
101
+ wifi_version: "v3.8.6",
102
+ auto_update: true,
103
+ });
104
+ });
105
+
106
+ it("posts an empty body to /zone-devices/:id/firmware-update", () => {
107
+ __internal.zoneDevices.firmwareUpdate(42);
108
+
109
+ expect(doPostMock).toHaveBeenCalledWith("/zone-devices/42/firmware-update", {});
110
+ });
111
+
112
+ it("posts an empty body to /zone-devices/:id/reboot", () => {
113
+ __internal.zoneDevices.reboot(42);
114
+
115
+ expect(doPostMock).toHaveBeenCalledWith("/zone-devices/42/reboot", {});
116
+ });
117
+
118
+ it("posts an empty body to /zone-devices/:id/factory-reset", () => {
119
+ __internal.zoneDevices.factoryReset(42);
120
+
121
+ expect(doPostMock).toHaveBeenCalledWith("/zone-devices/42/factory-reset", {});
122
+ });
123
+
76
124
  // a5d10295d4 once dropped these from __internal while gatekeeper-client still called them.
77
125
  it("keeps the gatekeeper networks and zone device calls exported", () => {
78
126
  expect(__internal.networks).toEqual({
@@ -47,6 +47,10 @@ describe("zoneDevicesList", () => {
47
47
  macAvailability: expect.any(Function),
48
48
  provisioning: expect.any(Function),
49
49
  delete: expect.any(Function),
50
+ firmwareVersions: expect.any(Function),
51
+ firmwareUpdate: expect.any(Function),
52
+ reboot: expect.any(Function),
53
+ factoryReset: expect.any(Function),
50
54
  });
51
55
  expect(__internal.networks).toEqual({
52
56
  list: networksList,
@@ -58,7 +58,7 @@ test("Zones Security Zone Checkin", async () => {
58
58
 
59
59
  const result = await greenSecurity.zones.securityZoneCheckin({
60
60
  qrCode: "<value>",
61
- zoneId: 544883,
61
+ zoneId: 440362,
62
62
  });
63
63
  expect(result).toBeDefined();
64
64
  expect(result).toEqual({});
@@ -0,0 +1,11 @@
1
+ import { APIPromise } from "../types/async.js";
2
+ import { $doPost, internalApiResult } from "./doAdmin.js";
3
+
4
+ // Factory-resets a gateway over MQTT. The server clears its stored firmware versions, since the
5
+ // gateway reverts to factory and stops reporting until it is set up again. Returns the device.
6
+ // 422 when the gateway is offline.
7
+ //
8
+ // Internal for the same reason as zoneDevicesUpdate.
9
+ export function zoneDevicesFactoryReset(zoneDeviceId: number): internalApiResult {
10
+ return new APIPromise($doPost(`/zone-devices/${zoneDeviceId}/factory-reset`, {}));
11
+ }
@@ -0,0 +1,11 @@
1
+ import { APIPromise } from "../types/async.js";
2
+ import { $doPost, internalApiResult } from "./doAdmin.js";
3
+
4
+ // Starts a gateway firmware update (the Update button on device details). The update runs over
5
+ // MQTT; follow it by polling zoneDevicesGet for `firmware_update_status`. Returns the device.
6
+ //
7
+ // Internal for the same reason as zoneDevicesUpdate. 409 when an update is already running, 422
8
+ // when the gateway is already on the target firmware.
9
+ export function zoneDevicesFirmwareUpdate(zoneDeviceId: number): internalApiResult {
10
+ return new APIPromise($doPost(`/zone-devices/${zoneDeviceId}/firmware-update`, {}));
11
+ }
@@ -0,0 +1,22 @@
1
+ import { APIPromise } from "../types/async.js";
2
+ import { $doPut, internalApiResult } from "./doAdmin.js";
3
+
4
+ // Wire names, posted verbatim. Versions look like `v3.8.6`; send whichever the gateway reported.
5
+ export type zoneDevicesFirmwareVersionsRequest = {
6
+ wifi_version?: string;
7
+ ble_version?: string;
8
+ // true only from provisioning's final step (a safe point): a gateway found behind target flashes
9
+ // now instead of waiting for the nightly sweep. Omitted/false for mid-connection reports.
10
+ auto_update?: boolean;
11
+ };
12
+
13
+ // Records the firmware the Gatekeeper app read off a gateway while connected to it. A gateway
14
+ // behind the target firmware is then updated automatically over MQTT. Returns the device.
15
+ //
16
+ // Internal for the same reason as zoneDevicesUpdate.
17
+ export function zoneDevicesFirmwareVersions(
18
+ zoneDeviceId: number,
19
+ request: zoneDevicesFirmwareVersionsRequest
20
+ ): internalApiResult {
21
+ return new APIPromise($doPut(`/zone-devices/${zoneDeviceId}/firmware-versions`, request));
22
+ }
@@ -0,0 +1,10 @@
1
+ import { APIPromise } from "../types/async.js";
2
+ import { $doPost, internalApiResult } from "./doAdmin.js";
3
+
4
+ // Reboots a gateway over MQTT (cgic-reboot). Fire-and-forget: the gateway drops the reply and
5
+ // reconnects on its own. Returns the device. 422 when the gateway is offline.
6
+ //
7
+ // Internal for the same reason as zoneDevicesUpdate.
8
+ export function zoneDevicesReboot(zoneDeviceId: number): internalApiResult {
9
+ return new APIPromise($doPost(`/zone-devices/${zoneDeviceId}/reboot`, {}));
10
+ }
@@ -32,8 +32,9 @@ import { Result } from "../types/fp.js";
32
32
  * @remarks
33
33
  * Changes a vendor's credentialing subscription by updating the vendor type,
34
34
  * the target facilities, or both. If the selection increases the subscription
35
- * price, the server creates an invoice and charges the payment profile; the
36
- * response includes the invoice id.
35
+ * price, the server creates an invoice and charges the payment profile for the
36
+ * invoice total, including any tax and convenience fee; the response includes
37
+ * the invoice id.
37
38
  *
38
39
  * **Permissions.** Requires the `vendor_transactions.add` permission.
39
40
  *
@@ -36,12 +36,20 @@ import * as types$ from "../types/primitives.js";
36
36
  * can also remove the vendor from their company by sending `company_id: null`.
37
37
  *
38
38
  * From `location` this endpoint reads only `timezone`, `address1`, `address2`,
39
- * `city`, `state`, `zip`, `phone`, `mobile_phone` and `fax`. The `address` and
39
+ * `city`, `state`, `zip`, `phone`, `mobile_phone`, `fax`, `work_email` and `personal_email`. The `address` and
40
40
  * `country` properties of the shared `UserLocation` schema have no effect here, and
41
41
  * updating them is not supported. `state` accepts a US state or a Canadian
42
42
  * province—the vendor's country, set only at registration, is not editable
43
43
  * through this endpoint.
44
44
  *
45
+ * `location.work_email` and `location.personal_email` are stored lowercased, and a
46
+ * value that is not a valid email address, or is longer than 255 characters, gets a
47
+ * `422` response. They are contact fields: the login stays `email`, which this
48
+ * endpoint does not change. When an update sets either of them, one must be the
49
+ * vendor's `email` and the other a different address or empty, or it gets a `422`.
50
+ * A vendor with neither one copying `email` yet can set just one and leave the
51
+ * other empty: the save puts `email` in the empty one (work, if both are).
52
+ *
45
53
  * Submitting `location.zip` or `location.state` cross-checks the postal code
46
54
  * against the resulting state (using the vendor's existing value for whichever
47
55
  * of the two you omit from the request). The server rejects a code that is not shaped like a real
@@ -32,7 +32,7 @@ import { Result } from "../types/fp.js";
32
32
  * @remarks
33
33
  * Requests a check-in to a security zone.
34
34
  *
35
- * **Permissions.** Requires a valid token. This endpoint is not gated on a named permission: the caller's role and their relationship to the record determine what the response contains.
35
+ * **Permissions.** Requires the `vendor_scans.add` permission, including for a vendor checking themselves in. App tokens (`gsu_`, `gsi_`) get `403`.
36
36
  *
37
37
  * If set, this operation will use {@link Security.bearerJwt} from the global security.
38
38
  */
@@ -80,6 +80,10 @@ import { zoneDevicesMacAvailability } from "./admin-funcs/zoneDevicesMacAvailabi
80
80
  import { zoneDevicesUpdate } from "./admin-funcs/zoneDevicesUpdate.js";
81
81
  import { zoneDevicesProvisioning } from "./admin-funcs/zoneDevicesProvisioning.js";
82
82
  import { zoneDevicesDelete } from "./admin-funcs/zoneDevicesDelete.js";
83
+ import { zoneDevicesFirmwareVersions } from "./admin-funcs/zoneDevicesFirmwareVersions.js";
84
+ import { zoneDevicesFirmwareUpdate } from "./admin-funcs/zoneDevicesFirmwareUpdate.js";
85
+ import { zoneDevicesReboot } from "./admin-funcs/zoneDevicesReboot.js";
86
+ import { zoneDevicesFactoryReset } from "./admin-funcs/zoneDevicesFactoryReset.js";
83
87
  import { lookupsAddressValidation } from "./admin-funcs/lookupsAddressValidation.js";
84
88
  import { lookupsAddressAutocomplete } from "./admin-funcs/lookupsAddressAutocomplete.js";
85
89
  import { lookupsAddressPlace } from "./admin-funcs/lookupsAddressPlace.js";
@@ -219,6 +223,10 @@ export const __internal = {
219
223
  update: zoneDevicesUpdate,
220
224
  provisioning: zoneDevicesProvisioning,
221
225
  delete: zoneDevicesDelete,
222
- macAvailability: zoneDevicesMacAvailability
226
+ macAvailability: zoneDevicesMacAvailability,
227
+ firmwareVersions: zoneDevicesFirmwareVersions,
228
+ firmwareUpdate: zoneDevicesFirmwareUpdate,
229
+ reboot: zoneDevicesReboot,
230
+ factoryReset: zoneDevicesFactoryReset
223
231
  }
224
232
  };
package/src/lib/config.ts CHANGED
@@ -80,8 +80,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
80
80
  export const SDK_METADATA = {
81
81
  language: "typescript",
82
82
  openapiDocVersion: "0.48.0",
83
- sdkVersion: "0.48.0",
84
- genVersion: "2.952.5",
83
+ sdkVersion: "0.49.0-beta.1",
84
+ genVersion: "2.956.1",
85
85
  userAgent:
86
- "speakeasy-sdk/typescript 0.48.0 2.952.5 0.48.0 @greensecurity/javascript-sdk",
86
+ "speakeasy-sdk/typescript 0.49.0-beta.1 2.956.1 0.48.0 @greensecurity/javascript-sdk",
87
87
  } as const;
@@ -85,6 +85,10 @@ export type UserDetails = {
85
85
  * First name of the user.
86
86
  */
87
87
  firstName?: string | null | undefined;
88
+ /**
89
+ * Middle name of the user, or `null` if not set. Returned only in the full user record (`expand=user`).
90
+ */
91
+ middleName?: string | null | undefined;
88
92
  /**
89
93
  * Last name of the user.
90
94
  */
@@ -93,6 +97,24 @@ export type UserDetails = {
93
97
  * Email address (not always valid)
94
98
  */
95
99
  email: string;
100
+ /**
101
+ * A vendor's work email address, a contact field kept apart from `email`,
102
+ *
103
+ * @remarks
104
+ * which stays the login. When it is the same address as `email`, it follows
105
+ * any change to the login. `null` if not set. Returned only in the full user
106
+ * record (`expand=user`).
107
+ */
108
+ workEmail?: string | null | undefined;
109
+ /**
110
+ * A vendor's personal email address, a contact field kept apart from `email`,
111
+ *
112
+ * @remarks
113
+ * which stays the login. When it is the same address as `email`, it follows
114
+ * any change to the login. `null` if not set. Returned only in the full user
115
+ * record (`expand=user`).
116
+ */
117
+ personalEmail?: string | null | undefined;
96
118
  /**
97
119
  * The user's landline phone number, or `null` if not set.
98
120
  */
@@ -253,8 +275,11 @@ export const UserDetails$inboundSchema: z.ZodType<
253
275
  > = z.object({
254
276
  id: types.number(),
255
277
  first_name: z.nullable(types.string()).optional(),
278
+ middle_name: z.nullable(types.string()).optional(),
256
279
  last_name: z.nullable(types.string()).optional(),
257
280
  email: types.string(),
281
+ work_email: z.nullable(types.string()).optional(),
282
+ personal_email: z.nullable(types.string()).optional(),
258
283
  phone: z.nullable(types.string()).optional(),
259
284
  mobile_phone: z.nullable(types.string()).optional(),
260
285
  fax: z.nullable(types.string()).optional(),
@@ -274,7 +299,10 @@ export const UserDetails$inboundSchema: z.ZodType<
274
299
  }).transform((v) => {
275
300
  return remap$(v, {
276
301
  "first_name": "firstName",
302
+ "middle_name": "middleName",
277
303
  "last_name": "lastName",
304
+ "work_email": "workEmail",
305
+ "personal_email": "personalEmail",
278
306
  "mobile_phone": "mobilePhone",
279
307
  "phone_confirmed": "phoneConfirmed",
280
308
  "email_confirmed": "emailConfirmed",
@@ -212,6 +212,14 @@ export type UserLocation = {
212
212
  * The fax number of the location. `null` if not set.
213
213
  */
214
214
  fax?: string | null | undefined;
215
+ /**
216
+ * The vendor's work email address. Only `PUT /vendors/{vendor_id_or_me}` reads it. `null` if not set.
217
+ */
218
+ workEmail?: string | null | undefined;
219
+ /**
220
+ * The vendor's personal email address. Only `PUT /vendors/{vendor_id_or_me}` reads it. `null` if not set.
221
+ */
222
+ personalEmail?: string | null | undefined;
215
223
  /**
216
224
  * The country of the location. `null` if not set.
217
225
  */
@@ -250,11 +258,15 @@ export const UserLocation$inboundSchema: z.ZodType<
250
258
  phone: z.nullable(types.string()).optional(),
251
259
  mobile_phone: z.nullable(types.string()).optional(),
252
260
  fax: z.nullable(types.string()).optional(),
261
+ work_email: z.nullable(types.string()).optional(),
262
+ personal_email: z.nullable(types.string()).optional(),
253
263
  country: z.nullable(types.string()).optional(),
254
264
  timezone: z.nullable(Timezone$inboundSchema).optional(),
255
265
  }).transform((v) => {
256
266
  return remap$(v, {
257
267
  "mobile_phone": "mobilePhone",
268
+ "work_email": "workEmail",
269
+ "personal_email": "personalEmail",
258
270
  });
259
271
  });
260
272
  /** @internal */
@@ -268,6 +280,8 @@ export type UserLocation$Outbound = {
268
280
  phone?: string | null | undefined;
269
281
  mobile_phone?: string | null | undefined;
270
282
  fax?: string | null | undefined;
283
+ work_email?: string | null | undefined;
284
+ personal_email?: string | null | undefined;
271
285
  country?: string | null | undefined;
272
286
  timezone?: string | null | undefined;
273
287
  };
@@ -287,11 +301,15 @@ export const UserLocation$outboundSchema: z.ZodType<
287
301
  phone: z.nullable(z.string()).optional(),
288
302
  mobilePhone: z.nullable(z.string()).optional(),
289
303
  fax: z.nullable(z.string()).optional(),
304
+ workEmail: z.nullable(z.string()).optional(),
305
+ personalEmail: z.nullable(z.string()).optional(),
290
306
  country: z.nullable(z.string()).optional(),
291
307
  timezone: z.nullable(Timezone$outboundSchema).optional(),
292
308
  }).transform((v) => {
293
309
  return remap$(v, {
294
310
  mobilePhone: "mobile_phone",
311
+ workEmail: "work_email",
312
+ personalEmail: "personal_email",
295
313
  });
296
314
  });
297
315
 
@@ -17,7 +17,6 @@ export type UpdateUserRequestBody = {
17
17
  lastName?: string | undefined;
18
18
  username?: string | undefined;
19
19
  email?: string | undefined;
20
- email2?: string | undefined;
21
20
  phone?: string | undefined;
22
21
  mobilePhone?: string | undefined;
23
22
  fax?: string | undefined;
@@ -80,7 +79,6 @@ export type UpdateUserRequestBody$Outbound = {
80
79
  last_name?: string | undefined;
81
80
  username?: string | undefined;
82
81
  email?: string | undefined;
83
- email2?: string | undefined;
84
82
  phone?: string | undefined;
85
83
  mobile_phone?: string | undefined;
86
84
  fax?: string | undefined;
@@ -106,7 +104,6 @@ export const UpdateUserRequestBody$outboundSchema: z.ZodType<
106
104
  lastName: z.string().optional(),
107
105
  username: z.string().optional(),
108
106
  email: z.string().optional(),
109
- email2: z.string().optional(),
110
107
  phone: z.string().optional(),
111
108
  mobilePhone: z.string().optional(),
112
109
  fax: z.string().optional(),
@@ -52,8 +52,9 @@ export type VendorsChangeSubscriptionMutationError =
52
52
  * @remarks
53
53
  * Changes a vendor's credentialing subscription by updating the vendor type,
54
54
  * the target facilities, or both. If the selection increases the subscription
55
- * price, the server creates an invoice and charges the payment profile; the
56
- * response includes the invoice id.
55
+ * price, the server creates an invoice and charges the payment profile for the
56
+ * invoice total, including any tax and convenience fee; the response includes
57
+ * the invoice id.
57
58
  *
58
59
  * **Permissions.** Requires the `vendor_transactions.add` permission.
59
60
  */
@@ -55,12 +55,20 @@ export type VendorsUpdateVendorDetailsMutationError =
55
55
  * can also remove the vendor from their company by sending `company_id: null`.
56
56
  *
57
57
  * From `location` this endpoint reads only `timezone`, `address1`, `address2`,
58
- * `city`, `state`, `zip`, `phone`, `mobile_phone` and `fax`. The `address` and
58
+ * `city`, `state`, `zip`, `phone`, `mobile_phone`, `fax`, `work_email` and `personal_email`. The `address` and
59
59
  * `country` properties of the shared `UserLocation` schema have no effect here, and
60
60
  * updating them is not supported. `state` accepts a US state or a Canadian
61
61
  * province—the vendor's country, set only at registration, is not editable
62
62
  * through this endpoint.
63
63
  *
64
+ * `location.work_email` and `location.personal_email` are stored lowercased, and a
65
+ * value that is not a valid email address, or is longer than 255 characters, gets a
66
+ * `422` response. They are contact fields: the login stays `email`, which this
67
+ * endpoint does not change. When an update sets either of them, one must be the
68
+ * vendor's `email` and the other a different address or empty, or it gets a `422`.
69
+ * A vendor with neither one copying `email` yet can set just one and leave the
70
+ * other empty: the save puts `email` in the empty one (work, if both are).
71
+ *
64
72
  * Submitting `location.zip` or `location.state` cross-checks the postal code
65
73
  * against the resulting state (using the vendor's existing value for whichever
66
74
  * of the two you omit from the request). The server rejects a code that is not shaped like a real
@@ -52,7 +52,7 @@ export type ZonesSecurityZoneCheckinMutationError =
52
52
  * @remarks
53
53
  * Requests a check-in to a security zone.
54
54
  *
55
- * **Permissions.** Requires a valid token. This endpoint is not gated on a named permission: the caller's role and their relationship to the record determine what the response contains.
55
+ * **Permissions.** Requires the `vendor_scans.add` permission, including for a vendor checking themselves in. App tokens (`gsu_`, `gsi_`) get `403`.
56
56
  */
57
57
  export function useZonesSecurityZoneCheckinMutation(
58
58
  options?: MutationHookOptions<
@@ -744,8 +744,9 @@ export class Vendors extends ClientSDK {
744
744
  * @remarks
745
745
  * Changes a vendor's credentialing subscription by updating the vendor type,
746
746
  * the target facilities, or both. If the selection increases the subscription
747
- * price, the server creates an invoice and charges the payment profile; the
748
- * response includes the invoice id.
747
+ * price, the server creates an invoice and charges the payment profile for the
748
+ * invoice total, including any tax and convenience fee; the response includes
749
+ * the invoice id.
749
750
  *
750
751
  * **Permissions.** Requires the `vendor_transactions.add` permission.
751
752
  */
@@ -1026,12 +1027,20 @@ export class Vendors extends ClientSDK {
1026
1027
  * can also remove the vendor from their company by sending `company_id: null`.
1027
1028
  *
1028
1029
  * From `location` this endpoint reads only `timezone`, `address1`, `address2`,
1029
- * `city`, `state`, `zip`, `phone`, `mobile_phone` and `fax`. The `address` and
1030
+ * `city`, `state`, `zip`, `phone`, `mobile_phone`, `fax`, `work_email` and `personal_email`. The `address` and
1030
1031
  * `country` properties of the shared `UserLocation` schema have no effect here, and
1031
1032
  * updating them is not supported. `state` accepts a US state or a Canadian
1032
1033
  * province—the vendor's country, set only at registration, is not editable
1033
1034
  * through this endpoint.
1034
1035
  *
1036
+ * `location.work_email` and `location.personal_email` are stored lowercased, and a
1037
+ * value that is not a valid email address, or is longer than 255 characters, gets a
1038
+ * `422` response. They are contact fields: the login stays `email`, which this
1039
+ * endpoint does not change. When an update sets either of them, one must be the
1040
+ * vendor's `email` and the other a different address or empty, or it gets a `422`.
1041
+ * A vendor with neither one copying `email` yet can set just one and leave the
1042
+ * other empty: the save puts `email` in the empty one (work, if both are).
1043
+ *
1035
1044
  * Submitting `location.zip` or `location.state` cross-checks the postal code
1036
1045
  * against the resulting state (using the vendor's existing value for whichever
1037
1046
  * of the two you omit from the request). The server rejects a code that is not shaped like a real
package/src/sdk/zones.ts CHANGED
@@ -69,7 +69,7 @@ export class Zones extends ClientSDK {
69
69
  * @remarks
70
70
  * Requests a check-in to a security zone.
71
71
  *
72
- * **Permissions.** Requires a valid token. This endpoint is not gated on a named permission: the caller's role and their relationship to the record determine what the response contains.
72
+ * **Permissions.** Requires the `vendor_scans.add` permission, including for a vendor checking themselves in. App tokens (`gsu_`, `gsi_`) get `403`.
73
73
  */
74
74
  async securityZoneCheckin(
75
75
  request: operations.SecurityZoneCheckinRequestBody,