@greensecurity/javascript-sdk 0.45.0-beta.27 → 0.45.0-beta.28

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 (80) hide show
  1. package/dist/commonjs/__tests__/vendors.test.js +1 -1
  2. package/dist/commonjs/__tests__/vendors.test.js.map +1 -1
  3. package/dist/commonjs/__tests__/zones.test.js +18 -11
  4. package/dist/commonjs/__tests__/zones.test.js.map +1 -1
  5. package/dist/commonjs/admin-funcs/doAdmin.d.ts +3 -1
  6. package/dist/commonjs/admin-funcs/doAdmin.d.ts.map +1 -1
  7. package/dist/commonjs/admin-funcs/doAdmin.js +22 -4
  8. package/dist/commonjs/admin-funcs/doAdmin.js.map +1 -1
  9. package/dist/commonjs/admin-funcs/networksCreate.d.ts +36 -0
  10. package/dist/commonjs/admin-funcs/networksCreate.d.ts.map +1 -0
  11. package/dist/commonjs/admin-funcs/networksCreate.js +51 -0
  12. package/dist/commonjs/admin-funcs/networksCreate.js.map +1 -0
  13. package/dist/commonjs/admin-funcs/networksGet.d.ts +3 -0
  14. package/dist/commonjs/admin-funcs/networksGet.d.ts.map +1 -0
  15. package/dist/commonjs/admin-funcs/networksGet.js +16 -0
  16. package/dist/commonjs/admin-funcs/networksGet.js.map +1 -0
  17. package/dist/commonjs/admin-funcs/networksList.d.ts +12 -0
  18. package/dist/commonjs/admin-funcs/networksList.d.ts.map +1 -0
  19. package/dist/commonjs/admin-funcs/networksList.js +40 -0
  20. package/dist/commonjs/admin-funcs/networksList.js.map +1 -0
  21. package/dist/commonjs/admin-funcs/zoneDevicesGet.d.ts +3 -0
  22. package/dist/commonjs/admin-funcs/zoneDevicesGet.d.ts.map +1 -0
  23. package/dist/commonjs/admin-funcs/zoneDevicesGet.js +16 -0
  24. package/dist/commonjs/admin-funcs/zoneDevicesGet.js.map +1 -0
  25. package/dist/commonjs/admin-funcs/zoneDevicesList.d.ts +11 -0
  26. package/dist/commonjs/admin-funcs/zoneDevicesList.d.ts.map +1 -0
  27. package/dist/commonjs/admin-funcs/zoneDevicesList.js +37 -0
  28. package/dist/commonjs/admin-funcs/zoneDevicesList.js.map +1 -0
  29. package/dist/commonjs/index.extras.d.ts +14 -0
  30. package/dist/commonjs/index.extras.d.ts.map +1 -1
  31. package/dist/commonjs/index.extras.js +16 -0
  32. package/dist/commonjs/index.extras.js.map +1 -1
  33. package/dist/commonjs/lib/config.d.ts +2 -2
  34. package/dist/commonjs/lib/config.js +2 -2
  35. package/dist/esm/__tests__/vendors.test.js +1 -1
  36. package/dist/esm/__tests__/vendors.test.js.map +1 -1
  37. package/dist/esm/__tests__/zones.test.js +18 -11
  38. package/dist/esm/__tests__/zones.test.js.map +1 -1
  39. package/dist/esm/admin-funcs/doAdmin.d.ts +3 -1
  40. package/dist/esm/admin-funcs/doAdmin.d.ts.map +1 -1
  41. package/dist/esm/admin-funcs/doAdmin.js +21 -4
  42. package/dist/esm/admin-funcs/doAdmin.js.map +1 -1
  43. package/dist/esm/admin-funcs/networksCreate.d.ts +36 -0
  44. package/dist/esm/admin-funcs/networksCreate.d.ts.map +1 -0
  45. package/dist/esm/admin-funcs/networksCreate.js +48 -0
  46. package/dist/esm/admin-funcs/networksCreate.js.map +1 -0
  47. package/dist/esm/admin-funcs/networksGet.d.ts +3 -0
  48. package/dist/esm/admin-funcs/networksGet.d.ts.map +1 -0
  49. package/dist/esm/admin-funcs/networksGet.js +13 -0
  50. package/dist/esm/admin-funcs/networksGet.js.map +1 -0
  51. package/dist/esm/admin-funcs/networksList.d.ts +12 -0
  52. package/dist/esm/admin-funcs/networksList.d.ts.map +1 -0
  53. package/dist/esm/admin-funcs/networksList.js +37 -0
  54. package/dist/esm/admin-funcs/networksList.js.map +1 -0
  55. package/dist/esm/admin-funcs/zoneDevicesGet.d.ts +3 -0
  56. package/dist/esm/admin-funcs/zoneDevicesGet.d.ts.map +1 -0
  57. package/dist/esm/admin-funcs/zoneDevicesGet.js +13 -0
  58. package/dist/esm/admin-funcs/zoneDevicesGet.js.map +1 -0
  59. package/dist/esm/admin-funcs/zoneDevicesList.d.ts +11 -0
  60. package/dist/esm/admin-funcs/zoneDevicesList.d.ts.map +1 -0
  61. package/dist/esm/admin-funcs/zoneDevicesList.js +34 -0
  62. package/dist/esm/admin-funcs/zoneDevicesList.js.map +1 -0
  63. package/dist/esm/index.extras.d.ts +14 -0
  64. package/dist/esm/index.extras.d.ts.map +1 -1
  65. package/dist/esm/index.extras.js +16 -0
  66. package/dist/esm/index.extras.js.map +1 -1
  67. package/dist/esm/lib/config.d.ts +2 -2
  68. package/dist/esm/lib/config.js +2 -2
  69. package/jsr.json +1 -1
  70. package/package.json +1 -1
  71. package/src/__tests__/vendors.test.ts +1 -1
  72. package/src/__tests__/zones.test.ts +18 -11
  73. package/src/admin-funcs/doAdmin.ts +43 -10
  74. package/src/admin-funcs/networksCreate.ts +101 -0
  75. package/src/admin-funcs/networksGet.ts +13 -0
  76. package/src/admin-funcs/networksList.ts +56 -0
  77. package/src/admin-funcs/zoneDevicesGet.ts +13 -0
  78. package/src/admin-funcs/zoneDevicesList.ts +47 -0
  79. package/src/index.extras.ts +19 -0
  80. package/src/lib/config.ts +2 -2
@@ -0,0 +1,56 @@
1
+ import { APIPromise } from "../types/async.js";
2
+ import { $doGetSingle, internalApiResult } from "./doAdmin.js";
3
+
4
+ export type networksListSortField =
5
+ | "id"
6
+ | "name"
7
+ | "setup_complete"
8
+ | "created_at"
9
+ | "updated_at";
10
+
11
+ export type networksListRequest = {
12
+ facilityId?: number;
13
+ setupComplete?: boolean;
14
+ page?: number;
15
+ itemsPerPage?: number;
16
+ sort?: networksListSortField;
17
+ desc?: boolean;
18
+ };
19
+
20
+ // The Wi-Fi/Ethernet configurations a facility hands to its Gatekeeper devices.
21
+ //
22
+ // Internal rather than part of the public spec: a network only means anything to the admin
23
+ // surfaces that provision our own hardware, and it carries the shape of credentials we hold on
24
+ // the operator's behalf — not something a third-party SDK consumer has any use for. See the
25
+ // public/app-only split in AGENTS.md.
26
+ //
27
+ // Every filter is optional and the server answers with the caller's own scope when none is
28
+ // given, so the no-argument call is the safe default rather than a request for everything.
29
+ //
30
+ // setupComplete is checked against undefined rather than for truthiness: `false` is a filter a
31
+ // caller genuinely wants (the networks still being provisioned), not an absent one.
32
+ export function networksList(
33
+ request: networksListRequest = {},
34
+ ): internalApiResult {
35
+ const query: Record<string, string | number | boolean> = {};
36
+ if (request.facilityId !== undefined) {
37
+ query["facility_id"] = request.facilityId;
38
+ }
39
+ if (request.setupComplete !== undefined) {
40
+ query["setup_complete"] = request.setupComplete;
41
+ }
42
+ if (request.page !== undefined) {
43
+ query["page"] = request.page;
44
+ }
45
+ if (request.itemsPerPage !== undefined) {
46
+ query["items_per_page"] = request.itemsPerPage;
47
+ }
48
+ if (request.sort !== undefined) {
49
+ query["sort"] = request.sort;
50
+ }
51
+ if (request.desc !== undefined) {
52
+ query["desc"] = request.desc;
53
+ }
54
+
55
+ return new APIPromise($doGetSingle("/networks", query));
56
+ }
@@ -0,0 +1,13 @@
1
+ import { APIPromise } from "../types/async.js";
2
+ import { $doGetSingle, internalApiResult } from "./doAdmin.js";
3
+
4
+ // One zone device (a gateway), for the detail screen zoneDevicesList leads to.
5
+ //
6
+ // Internal for the same reason as zoneDevicesList: our own device inventory. See the
7
+ // public/app-only split in AGENTS.md.
8
+ //
9
+ // Gateways only. The kiosks that zoneDevicesList folds into the same list live in a different
10
+ // table and are not addressable here, so their ids do not belong in this call.
11
+ export function zoneDevicesGet(zoneDeviceId: number): internalApiResult {
12
+ return new APIPromise($doGetSingle(`/zone-devices/${zoneDeviceId}`, {}));
13
+ }
@@ -0,0 +1,47 @@
1
+ import { APIPromise } from "../types/async.js";
2
+ import { $doGetSingle, internalApiResult } from "./doAdmin.js";
3
+
4
+ export type zoneDevicesListSortField = "id" | "name";
5
+
6
+ export type zoneDevicesListRequest = {
7
+ facilityId?: number;
8
+ page?: number;
9
+ itemsPerPage?: number;
10
+ sort?: zoneDevicesListSortField;
11
+ desc?: boolean;
12
+ };
13
+
14
+ // The caller's devices — kiosks and zone gateways alike — grouped by facility.
15
+ //
16
+ // Internal rather than part of the public spec: this is the device inventory behind our own
17
+ // admin surfaces, and it merges two unrelated tables into a shape only those screens read. See
18
+ // the public/app-only split in AGENTS.md.
19
+ //
20
+ // The page is a page of FACILITIES, not of devices: paging the devices would cut a facility in
21
+ // half, so `itemsPerPage` counts facilities and the nested device arrays come back whole. A
22
+ // facility holds a handful of devices, so those arrays stay bounded.
23
+ //
24
+ // Facilities holding no device at all are left out, so an empty response means the caller
25
+ // reaches no device rather than that the filter matched nothing.
26
+ export function zoneDevicesList(
27
+ request: zoneDevicesListRequest = {},
28
+ ): internalApiResult {
29
+ const query: Record<string, string | number | boolean> = {};
30
+ if (request.facilityId !== undefined) {
31
+ query["facility_id"] = request.facilityId;
32
+ }
33
+ if (request.page !== undefined) {
34
+ query["page"] = request.page;
35
+ }
36
+ if (request.itemsPerPage !== undefined) {
37
+ query["items_per_page"] = request.itemsPerPage;
38
+ }
39
+ if (request.sort !== undefined) {
40
+ query["sort"] = request.sort;
41
+ }
42
+ if (request.desc !== undefined) {
43
+ query["desc"] = request.desc;
44
+ }
45
+
46
+ return new APIPromise($doGetSingle("/zone-devices", query));
47
+ }
@@ -55,6 +55,12 @@ import { kioskHeartbeat } from "./admin-funcs/kioskHeartbeat.js";
55
55
  import { listCommunications } from "./admin-funcs/listCommunications.js";
56
56
  import { dismissCommunication } from "./admin-funcs/dismissCommunication.js";
57
57
 
58
+ import { networksList } from "./admin-funcs/networksList.js";
59
+ import { networksGet } from "./admin-funcs/networksGet.js";
60
+ import { networksCreate } from "./admin-funcs/networksCreate.js";
61
+ import { zoneDevicesList } from "./admin-funcs/zoneDevicesList.js";
62
+ import { zoneDevicesGet } from "./admin-funcs/zoneDevicesGet.js";
63
+
58
64
  export const __internal = {
59
65
  getInternalCore,
60
66
  initializeInternalCore,
@@ -139,5 +145,18 @@ export const __internal = {
139
145
  createZoneDevice: kioskCreateZoneDevice,
140
146
  createEvent: kioskCreateEvent,
141
147
  heartbeat: kioskHeartbeat
148
+ },
149
+
150
+ // Gatekeeper provisioning: the network a facility's devices join, and the
151
+ // inventory of the devices themselves.
152
+ networks: {
153
+ list: networksList,
154
+ get: networksGet,
155
+ create: networksCreate
156
+ },
157
+
158
+ zoneDevices: {
159
+ list: zoneDevicesList,
160
+ get: zoneDevicesGet
142
161
  }
143
162
  };
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.45.0",
83
- sdkVersion: "0.45.0-beta.27",
83
+ sdkVersion: "0.45.0-beta.28",
84
84
  genVersion: "2.938.0",
85
85
  userAgent:
86
- "speakeasy-sdk/typescript 0.45.0-beta.27 2.938.0 0.45.0 @greensecurity/javascript-sdk",
86
+ "speakeasy-sdk/typescript 0.45.0-beta.28 2.938.0 0.45.0 @greensecurity/javascript-sdk",
87
87
  } as const;