@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.
- package/dist/commonjs/__tests__/vendors.test.js +1 -1
- package/dist/commonjs/__tests__/vendors.test.js.map +1 -1
- package/dist/commonjs/__tests__/zones.test.js +18 -11
- package/dist/commonjs/__tests__/zones.test.js.map +1 -1
- package/dist/commonjs/admin-funcs/doAdmin.d.ts +3 -1
- package/dist/commonjs/admin-funcs/doAdmin.d.ts.map +1 -1
- package/dist/commonjs/admin-funcs/doAdmin.js +22 -4
- package/dist/commonjs/admin-funcs/doAdmin.js.map +1 -1
- package/dist/commonjs/admin-funcs/networksCreate.d.ts +36 -0
- package/dist/commonjs/admin-funcs/networksCreate.d.ts.map +1 -0
- package/dist/commonjs/admin-funcs/networksCreate.js +51 -0
- package/dist/commonjs/admin-funcs/networksCreate.js.map +1 -0
- package/dist/commonjs/admin-funcs/networksGet.d.ts +3 -0
- package/dist/commonjs/admin-funcs/networksGet.d.ts.map +1 -0
- package/dist/commonjs/admin-funcs/networksGet.js +16 -0
- package/dist/commonjs/admin-funcs/networksGet.js.map +1 -0
- package/dist/commonjs/admin-funcs/networksList.d.ts +12 -0
- package/dist/commonjs/admin-funcs/networksList.d.ts.map +1 -0
- package/dist/commonjs/admin-funcs/networksList.js +40 -0
- package/dist/commonjs/admin-funcs/networksList.js.map +1 -0
- package/dist/commonjs/admin-funcs/zoneDevicesGet.d.ts +3 -0
- package/dist/commonjs/admin-funcs/zoneDevicesGet.d.ts.map +1 -0
- package/dist/commonjs/admin-funcs/zoneDevicesGet.js +16 -0
- package/dist/commonjs/admin-funcs/zoneDevicesGet.js.map +1 -0
- package/dist/commonjs/admin-funcs/zoneDevicesList.d.ts +11 -0
- package/dist/commonjs/admin-funcs/zoneDevicesList.d.ts.map +1 -0
- package/dist/commonjs/admin-funcs/zoneDevicesList.js +37 -0
- package/dist/commonjs/admin-funcs/zoneDevicesList.js.map +1 -0
- package/dist/commonjs/index.extras.d.ts +14 -0
- package/dist/commonjs/index.extras.d.ts.map +1 -1
- package/dist/commonjs/index.extras.js +16 -0
- package/dist/commonjs/index.extras.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/esm/__tests__/vendors.test.js +1 -1
- package/dist/esm/__tests__/vendors.test.js.map +1 -1
- package/dist/esm/__tests__/zones.test.js +18 -11
- package/dist/esm/__tests__/zones.test.js.map +1 -1
- package/dist/esm/admin-funcs/doAdmin.d.ts +3 -1
- package/dist/esm/admin-funcs/doAdmin.d.ts.map +1 -1
- package/dist/esm/admin-funcs/doAdmin.js +21 -4
- package/dist/esm/admin-funcs/doAdmin.js.map +1 -1
- package/dist/esm/admin-funcs/networksCreate.d.ts +36 -0
- package/dist/esm/admin-funcs/networksCreate.d.ts.map +1 -0
- package/dist/esm/admin-funcs/networksCreate.js +48 -0
- package/dist/esm/admin-funcs/networksCreate.js.map +1 -0
- package/dist/esm/admin-funcs/networksGet.d.ts +3 -0
- package/dist/esm/admin-funcs/networksGet.d.ts.map +1 -0
- package/dist/esm/admin-funcs/networksGet.js +13 -0
- package/dist/esm/admin-funcs/networksGet.js.map +1 -0
- package/dist/esm/admin-funcs/networksList.d.ts +12 -0
- package/dist/esm/admin-funcs/networksList.d.ts.map +1 -0
- package/dist/esm/admin-funcs/networksList.js +37 -0
- package/dist/esm/admin-funcs/networksList.js.map +1 -0
- package/dist/esm/admin-funcs/zoneDevicesGet.d.ts +3 -0
- package/dist/esm/admin-funcs/zoneDevicesGet.d.ts.map +1 -0
- package/dist/esm/admin-funcs/zoneDevicesGet.js +13 -0
- package/dist/esm/admin-funcs/zoneDevicesGet.js.map +1 -0
- package/dist/esm/admin-funcs/zoneDevicesList.d.ts +11 -0
- package/dist/esm/admin-funcs/zoneDevicesList.d.ts.map +1 -0
- package/dist/esm/admin-funcs/zoneDevicesList.js +34 -0
- package/dist/esm/admin-funcs/zoneDevicesList.js.map +1 -0
- package/dist/esm/index.extras.d.ts +14 -0
- package/dist/esm/index.extras.d.ts.map +1 -1
- package/dist/esm/index.extras.js +16 -0
- package/dist/esm/index.extras.js.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/vendors.test.ts +1 -1
- package/src/__tests__/zones.test.ts +18 -11
- package/src/admin-funcs/doAdmin.ts +43 -10
- package/src/admin-funcs/networksCreate.ts +101 -0
- package/src/admin-funcs/networksGet.ts +13 -0
- package/src/admin-funcs/networksList.ts +56 -0
- package/src/admin-funcs/zoneDevicesGet.ts +13 -0
- package/src/admin-funcs/zoneDevicesList.ts +47 -0
- package/src/index.extras.ts +19 -0
- 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
|
+
}
|
package/src/index.extras.ts
CHANGED
|
@@ -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.
|
|
83
|
+
sdkVersion: "0.45.0-beta.28",
|
|
84
84
|
genVersion: "2.938.0",
|
|
85
85
|
userAgent:
|
|
86
|
-
"speakeasy-sdk/typescript 0.45.0-beta.
|
|
86
|
+
"speakeasy-sdk/typescript 0.45.0-beta.28 2.938.0 0.45.0 @greensecurity/javascript-sdk",
|
|
87
87
|
} as const;
|