@greensecurity/javascript-sdk 0.36.0 → 0.36.5
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/README.md +3 -0
- package/bin/mcp-server.js +261 -109
- package/bin/mcp-server.js.map +17 -14
- package/dist/commonjs/__tests__/users.test.js +15 -0
- package/dist/commonjs/__tests__/users.test.js.map +1 -1
- package/dist/commonjs/__tests__/webhooks.test.js +1 -1
- package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
- package/dist/commonjs/__tests__/zones.test.js +4 -57
- package/dist/commonjs/__tests__/zones.test.js.map +1 -1
- package/dist/commonjs/admin-funcs/doAdmin.d.ts +5 -4
- package/dist/commonjs/admin-funcs/doAdmin.d.ts.map +1 -1
- package/dist/commonjs/admin-funcs/doAdmin.js +1 -3
- package/dist/commonjs/admin-funcs/doAdmin.js.map +1 -1
- package/dist/commonjs/funcs/usersRotateApiKey.d.ts +18 -0
- package/dist/commonjs/funcs/usersRotateApiKey.d.ts.map +1 -0
- package/dist/commonjs/funcs/usersRotateApiKey.js +107 -0
- package/dist/commonjs/funcs/usersRotateApiKey.js.map +1 -0
- package/dist/commonjs/funcs/vendorsListVendorFacilityStatuses.js +8 -1
- package/dist/commonjs/funcs/vendorsListVendorFacilityStatuses.js.map +1 -1
- package/dist/commonjs/funcs/zonesGetSecurityZone.d.ts +6 -0
- package/dist/commonjs/funcs/zonesGetSecurityZone.d.ts.map +1 -1
- package/dist/commonjs/funcs/zonesGetSecurityZone.js +10 -0
- package/dist/commonjs/funcs/zonesGetSecurityZone.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/server.js +3 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/usersRotateApiKey.d.ts +3 -0
- package/dist/commonjs/mcp-server/tools/usersRotateApiKey.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/usersRotateApiKey.js +26 -0
- package/dist/commonjs/mcp-server/tools/usersRotateApiKey.js.map +1 -0
- package/dist/commonjs/mcp-server/tools/zonesGetSecurityZone.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/tools/zonesGetSecurityZone.js +7 -1
- package/dist/commonjs/mcp-server/tools/zonesGetSecurityZone.js.map +1 -1
- package/dist/commonjs/models/components/expand.d.ts +9 -0
- package/dist/commonjs/models/components/expand.d.ts.map +1 -1
- package/dist/commonjs/models/components/expand.js +3 -0
- package/dist/commonjs/models/components/expand.js.map +1 -1
- package/dist/commonjs/models/components/vendorfacilitystatusview.d.ts +2 -0
- package/dist/commonjs/models/components/vendorfacilitystatusview.d.ts.map +1 -1
- package/dist/commonjs/models/components/vendorfacilitystatusview.js +4 -0
- package/dist/commonjs/models/components/vendorfacilitystatusview.js.map +1 -1
- package/dist/commonjs/models/operations/getsecurityzone.d.ts +6 -0
- package/dist/commonjs/models/operations/getsecurityzone.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getsecurityzone.js +3 -0
- package/dist/commonjs/models/operations/getsecurityzone.js.map +1 -1
- package/dist/commonjs/models/operations/index.d.ts +1 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +1 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/listvendorfacilitystatuses.d.ts +10 -0
- package/dist/commonjs/models/operations/listvendorfacilitystatuses.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listvendorfacilitystatuses.js +8 -0
- package/dist/commonjs/models/operations/listvendorfacilitystatuses.js.map +1 -1
- package/dist/commonjs/models/operations/rotateapikey.d.ts +34 -0
- package/dist/commonjs/models/operations/rotateapikey.d.ts.map +1 -0
- package/dist/commonjs/models/operations/rotateapikey.js +80 -0
- package/dist/commonjs/models/operations/rotateapikey.js.map +1 -0
- package/dist/commonjs/react-query/index.d.ts +1 -0
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +1 -0
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/react-query/usersRotateApiKey.d.ts +22 -0
- package/dist/commonjs/react-query/usersRotateApiKey.d.ts.map +1 -0
- package/dist/commonjs/react-query/usersRotateApiKey.js +47 -0
- package/dist/commonjs/react-query/usersRotateApiKey.js.map +1 -0
- package/dist/commonjs/react-query/vendorsListVendorFacilityStatuses.d.ts +6 -1
- package/dist/commonjs/react-query/vendorsListVendorFacilityStatuses.d.ts.map +1 -1
- package/dist/commonjs/react-query/vendorsListVendorFacilityStatuses.js +6 -3
- package/dist/commonjs/react-query/vendorsListVendorFacilityStatuses.js.map +1 -1
- package/dist/commonjs/react-query/zonesGetSecurityZone.d.ts +27 -3
- package/dist/commonjs/react-query/zonesGetSecurityZone.d.ts.map +1 -1
- package/dist/commonjs/react-query/zonesGetSecurityZone.js +23 -3
- package/dist/commonjs/react-query/zonesGetSecurityZone.js.map +1 -1
- package/dist/commonjs/sdk/users.d.ts +7 -0
- package/dist/commonjs/sdk/users.d.ts.map +1 -1
- package/dist/commonjs/sdk/users.js +10 -0
- package/dist/commonjs/sdk/users.js.map +1 -1
- package/dist/commonjs/sdk/zones.d.ts +6 -0
- package/dist/commonjs/sdk/zones.d.ts.map +1 -1
- package/dist/commonjs/sdk/zones.js +6 -0
- package/dist/commonjs/sdk/zones.js.map +1 -1
- package/dist/esm/__tests__/users.test.js +15 -0
- package/dist/esm/__tests__/users.test.js.map +1 -1
- package/dist/esm/__tests__/webhooks.test.js +1 -1
- package/dist/esm/__tests__/webhooks.test.js.map +1 -1
- package/dist/esm/__tests__/zones.test.js +4 -57
- package/dist/esm/__tests__/zones.test.js.map +1 -1
- package/dist/esm/admin-funcs/doAdmin.d.ts +5 -4
- package/dist/esm/admin-funcs/doAdmin.d.ts.map +1 -1
- package/dist/esm/admin-funcs/doAdmin.js +1 -3
- package/dist/esm/admin-funcs/doAdmin.js.map +1 -1
- package/dist/esm/funcs/usersRotateApiKey.d.ts +18 -0
- package/dist/esm/funcs/usersRotateApiKey.d.ts.map +1 -0
- package/dist/esm/funcs/usersRotateApiKey.js +71 -0
- package/dist/esm/funcs/usersRotateApiKey.js.map +1 -0
- package/dist/esm/funcs/vendorsListVendorFacilityStatuses.js +9 -2
- package/dist/esm/funcs/vendorsListVendorFacilityStatuses.js.map +1 -1
- package/dist/esm/funcs/zonesGetSecurityZone.d.ts +6 -0
- package/dist/esm/funcs/zonesGetSecurityZone.d.ts.map +1 -1
- package/dist/esm/funcs/zonesGetSecurityZone.js +11 -1
- package/dist/esm/funcs/zonesGetSecurityZone.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.d.ts.map +1 -1
- package/dist/esm/mcp-server/server.js +3 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/usersRotateApiKey.d.ts +3 -0
- package/dist/esm/mcp-server/tools/usersRotateApiKey.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/usersRotateApiKey.js +23 -0
- package/dist/esm/mcp-server/tools/usersRotateApiKey.js.map +1 -0
- package/dist/esm/mcp-server/tools/zonesGetSecurityZone.d.ts.map +1 -1
- package/dist/esm/mcp-server/tools/zonesGetSecurityZone.js +7 -1
- package/dist/esm/mcp-server/tools/zonesGetSecurityZone.js.map +1 -1
- package/dist/esm/models/components/expand.d.ts +9 -0
- package/dist/esm/models/components/expand.d.ts.map +1 -1
- package/dist/esm/models/components/expand.js +3 -0
- package/dist/esm/models/components/expand.js.map +1 -1
- package/dist/esm/models/components/vendorfacilitystatusview.d.ts +2 -0
- package/dist/esm/models/components/vendorfacilitystatusview.d.ts.map +1 -1
- package/dist/esm/models/components/vendorfacilitystatusview.js +4 -0
- package/dist/esm/models/components/vendorfacilitystatusview.js.map +1 -1
- package/dist/esm/models/operations/getsecurityzone.d.ts +6 -0
- package/dist/esm/models/operations/getsecurityzone.d.ts.map +1 -1
- package/dist/esm/models/operations/getsecurityzone.js +3 -0
- package/dist/esm/models/operations/getsecurityzone.js.map +1 -1
- package/dist/esm/models/operations/index.d.ts +1 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +1 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/listvendorfacilitystatuses.d.ts +10 -0
- package/dist/esm/models/operations/listvendorfacilitystatuses.d.ts.map +1 -1
- package/dist/esm/models/operations/listvendorfacilitystatuses.js +8 -0
- package/dist/esm/models/operations/listvendorfacilitystatuses.js.map +1 -1
- package/dist/esm/models/operations/rotateapikey.d.ts +34 -0
- package/dist/esm/models/operations/rotateapikey.d.ts.map +1 -0
- package/dist/esm/models/operations/rotateapikey.js +42 -0
- package/dist/esm/models/operations/rotateapikey.js.map +1 -0
- package/dist/esm/react-query/index.d.ts +1 -0
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +1 -0
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/react-query/usersRotateApiKey.d.ts +22 -0
- package/dist/esm/react-query/usersRotateApiKey.d.ts.map +1 -0
- package/dist/esm/react-query/usersRotateApiKey.js +42 -0
- package/dist/esm/react-query/usersRotateApiKey.js.map +1 -0
- package/dist/esm/react-query/vendorsListVendorFacilityStatuses.d.ts +6 -1
- package/dist/esm/react-query/vendorsListVendorFacilityStatuses.d.ts.map +1 -1
- package/dist/esm/react-query/vendorsListVendorFacilityStatuses.js +6 -3
- package/dist/esm/react-query/vendorsListVendorFacilityStatuses.js.map +1 -1
- package/dist/esm/react-query/zonesGetSecurityZone.d.ts +27 -3
- package/dist/esm/react-query/zonesGetSecurityZone.d.ts.map +1 -1
- package/dist/esm/react-query/zonesGetSecurityZone.js +23 -3
- package/dist/esm/react-query/zonesGetSecurityZone.js.map +1 -1
- package/dist/esm/sdk/users.d.ts +7 -0
- package/dist/esm/sdk/users.d.ts.map +1 -1
- package/dist/esm/sdk/users.js +10 -0
- package/dist/esm/sdk/users.js.map +1 -1
- package/dist/esm/sdk/zones.d.ts +6 -0
- package/dist/esm/sdk/zones.d.ts.map +1 -1
- package/dist/esm/sdk/zones.js +6 -0
- package/dist/esm/sdk/zones.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/users.test.ts +18 -0
- package/src/__tests__/webhooks.test.ts +1 -1
- package/src/__tests__/zones.test.ts +4 -57
- package/src/admin-funcs/doAdmin.ts +9 -7
- package/src/funcs/usersRotateApiKey.ts +151 -0
- package/src/funcs/vendorsListVendorFacilityStatuses.ts +12 -2
- package/src/funcs/zonesGetSecurityZone.ts +12 -1
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +3 -1
- package/src/mcp-server/tools/usersRotateApiKey.ts +30 -0
- package/src/mcp-server/tools/zonesGetSecurityZone.ts +7 -1
- package/src/models/components/expand.ts +3 -0
- package/src/models/components/vendorfacilitystatusview.ts +6 -0
- package/src/models/operations/getsecurityzone.ts +8 -0
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/listvendorfacilitystatuses.ts +18 -0
- package/src/models/operations/rotateapikey.ts +82 -0
- package/src/react-query/index.ts +1 -0
- package/src/react-query/usersRotateApiKey.ts +86 -0
- package/src/react-query/vendorsListVendorFacilityStatuses.ts +21 -10
- package/src/react-query/zonesGetSecurityZone.ts +33 -5
- package/src/sdk/users.ts +16 -0
- package/src/sdk/zones.ts +6 -0
|
@@ -14,7 +14,13 @@ export const tool$zonesGetSecurityZone: ToolDefinition<typeof args> = {
|
|
|
14
14
|
name: "zones-get-security-zone",
|
|
15
15
|
description: `Get security zone details
|
|
16
16
|
|
|
17
|
-
Get security zone details
|
|
17
|
+
Get security zone details
|
|
18
|
+
|
|
19
|
+
Available \`expand\` scopes are:
|
|
20
|
+
|
|
21
|
+
- zone.facility
|
|
22
|
+
- zone.department
|
|
23
|
+
- zone.rules`,
|
|
18
24
|
args,
|
|
19
25
|
tool: async (client, args, ctx) => {
|
|
20
26
|
const [result, apiCall] = await zonesGetSecurityZone(
|
|
@@ -76,6 +76,9 @@ export const Expand = {
|
|
|
76
76
|
"vendor_credential_data_request.vendor_credential",
|
|
77
77
|
VendorCredentialDataRequestDataRequest:
|
|
78
78
|
"vendor_credential_data_request.data_request",
|
|
79
|
+
ZoneFacility: "zone.facility",
|
|
80
|
+
ZoneDepartment: "zone.department",
|
|
81
|
+
ZoneRules: "zone.rules",
|
|
79
82
|
} as const;
|
|
80
83
|
/**
|
|
81
84
|
* An expansion scope that is valid for the object being requested.
|
|
@@ -18,6 +18,7 @@ export type VendorFacilityStatusView = {
|
|
|
18
18
|
facilityStatus?: string | null | undefined;
|
|
19
19
|
vendorScanId?: number | null | undefined;
|
|
20
20
|
vendorScanType?: number | null | undefined;
|
|
21
|
+
dateScanned?: string | null | undefined;
|
|
21
22
|
};
|
|
22
23
|
|
|
23
24
|
/** @internal */
|
|
@@ -32,6 +33,7 @@ export const VendorFacilityStatusView$inboundSchema: z.ZodType<
|
|
|
32
33
|
facility_status: z.nullable(z.string()).optional(),
|
|
33
34
|
vendor_scan_id: z.nullable(z.number().int()).optional(),
|
|
34
35
|
vendor_scan_type: z.nullable(z.number().int()).optional(),
|
|
36
|
+
date_scanned: z.nullable(z.string()).optional(),
|
|
35
37
|
}).transform((v) => {
|
|
36
38
|
return remap$(v, {
|
|
37
39
|
"vendor_id": "vendorId",
|
|
@@ -40,6 +42,7 @@ export const VendorFacilityStatusView$inboundSchema: z.ZodType<
|
|
|
40
42
|
"facility_status": "facilityStatus",
|
|
41
43
|
"vendor_scan_id": "vendorScanId",
|
|
42
44
|
"vendor_scan_type": "vendorScanType",
|
|
45
|
+
"date_scanned": "dateScanned",
|
|
43
46
|
});
|
|
44
47
|
});
|
|
45
48
|
|
|
@@ -51,6 +54,7 @@ export type VendorFacilityStatusView$Outbound = {
|
|
|
51
54
|
facility_status?: string | null | undefined;
|
|
52
55
|
vendor_scan_id?: number | null | undefined;
|
|
53
56
|
vendor_scan_type?: number | null | undefined;
|
|
57
|
+
date_scanned?: string | null | undefined;
|
|
54
58
|
};
|
|
55
59
|
|
|
56
60
|
/** @internal */
|
|
@@ -65,6 +69,7 @@ export const VendorFacilityStatusView$outboundSchema: z.ZodType<
|
|
|
65
69
|
facilityStatus: z.nullable(z.string()).optional(),
|
|
66
70
|
vendorScanId: z.nullable(z.number().int()).optional(),
|
|
67
71
|
vendorScanType: z.nullable(z.number().int()).optional(),
|
|
72
|
+
dateScanned: z.nullable(z.string()).optional(),
|
|
68
73
|
}).transform((v) => {
|
|
69
74
|
return remap$(v, {
|
|
70
75
|
vendorId: "vendor_id",
|
|
@@ -73,6 +78,7 @@ export const VendorFacilityStatusView$outboundSchema: z.ZodType<
|
|
|
73
78
|
facilityStatus: "facility_status",
|
|
74
79
|
vendorScanId: "vendor_scan_id",
|
|
75
80
|
vendorScanType: "vendor_scan_type",
|
|
81
|
+
dateScanned: "date_scanned",
|
|
76
82
|
});
|
|
77
83
|
});
|
|
78
84
|
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
7
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import * as components from "../components/index.js";
|
|
8
9
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
10
|
|
|
10
11
|
export type GetSecurityZoneRequest = {
|
|
@@ -12,6 +13,10 @@ export type GetSecurityZoneRequest = {
|
|
|
12
13
|
* The identifier of the object
|
|
13
14
|
*/
|
|
14
15
|
id: number;
|
|
16
|
+
/**
|
|
17
|
+
* An array-style parameter to identify which sections of an object to expand. See documentation for the endpoint for a list of valid expansion values.
|
|
18
|
+
*/
|
|
19
|
+
expand?: Array<components.Expand> | undefined;
|
|
15
20
|
};
|
|
16
21
|
|
|
17
22
|
/** @internal */
|
|
@@ -21,11 +26,13 @@ export const GetSecurityZoneRequest$inboundSchema: z.ZodType<
|
|
|
21
26
|
unknown
|
|
22
27
|
> = z.object({
|
|
23
28
|
id: z.number().int(),
|
|
29
|
+
expand: z.array(components.Expand$inboundSchema).optional(),
|
|
24
30
|
});
|
|
25
31
|
|
|
26
32
|
/** @internal */
|
|
27
33
|
export type GetSecurityZoneRequest$Outbound = {
|
|
28
34
|
id: number;
|
|
35
|
+
expand?: Array<string> | undefined;
|
|
29
36
|
};
|
|
30
37
|
|
|
31
38
|
/** @internal */
|
|
@@ -35,6 +42,7 @@ export const GetSecurityZoneRequest$outboundSchema: z.ZodType<
|
|
|
35
42
|
GetSecurityZoneRequest
|
|
36
43
|
> = z.object({
|
|
37
44
|
id: z.number().int(),
|
|
45
|
+
expand: z.array(components.Expand$outboundSchema).optional(),
|
|
38
46
|
});
|
|
39
47
|
|
|
40
48
|
/**
|
|
@@ -52,6 +52,7 @@ export * from "./password.js";
|
|
|
52
52
|
export * from "./passwordresetrequest.js";
|
|
53
53
|
export * from "./postauthenticate.js";
|
|
54
54
|
export * from "./purchasescrubcredits.js";
|
|
55
|
+
export * from "./rotateapikey.js";
|
|
55
56
|
export * from "./securityzonecheckin.js";
|
|
56
57
|
export * from "./senddownloadcode.js";
|
|
57
58
|
export * from "./submitvendorcredential.js";
|
|
@@ -10,6 +10,10 @@ import * as components from "../components/index.js";
|
|
|
10
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
11
|
|
|
12
12
|
export type ListVendorFacilityStatusesRequest = {
|
|
13
|
+
/**
|
|
14
|
+
* Either the ID of the vendor rep or the keyword "me" to represent the current vendor.
|
|
15
|
+
*/
|
|
16
|
+
vendorIdOrMe: string;
|
|
13
17
|
/**
|
|
14
18
|
* A comma-separated list of object attributes to sort on.
|
|
15
19
|
*/
|
|
@@ -34,6 +38,10 @@ export type ListVendorFacilityStatusesRequest = {
|
|
|
34
38
|
* A partial string to search in the facility name. Do not include any wildcard characters. Searches are not case-sensitive by default.
|
|
35
39
|
*/
|
|
36
40
|
facilityNameLike?: string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* An ID representing a Hospital
|
|
43
|
+
*/
|
|
44
|
+
facilityId?: number | undefined;
|
|
37
45
|
};
|
|
38
46
|
|
|
39
47
|
/**
|
|
@@ -57,28 +65,34 @@ export const ListVendorFacilityStatusesRequest$inboundSchema: z.ZodType<
|
|
|
57
65
|
z.ZodTypeDef,
|
|
58
66
|
unknown
|
|
59
67
|
> = z.object({
|
|
68
|
+
vendor_id_or_me: z.string(),
|
|
60
69
|
sort: z.nullable(z.string()).optional(),
|
|
61
70
|
desc: components.Desc$inboundSchema.optional(),
|
|
62
71
|
page: z.number().int().optional(),
|
|
63
72
|
items_per_page: z.number().int().optional(),
|
|
64
73
|
scan_type: components.ScanType$inboundSchema.optional(),
|
|
65
74
|
facility_name_like: z.string().optional(),
|
|
75
|
+
facility_id: z.number().int().optional(),
|
|
66
76
|
}).transform((v) => {
|
|
67
77
|
return remap$(v, {
|
|
78
|
+
"vendor_id_or_me": "vendorIdOrMe",
|
|
68
79
|
"items_per_page": "itemsPerPage",
|
|
69
80
|
"scan_type": "scanType",
|
|
70
81
|
"facility_name_like": "facilityNameLike",
|
|
82
|
+
"facility_id": "facilityId",
|
|
71
83
|
});
|
|
72
84
|
});
|
|
73
85
|
|
|
74
86
|
/** @internal */
|
|
75
87
|
export type ListVendorFacilityStatusesRequest$Outbound = {
|
|
88
|
+
vendor_id_or_me: string;
|
|
76
89
|
sort?: string | null | undefined;
|
|
77
90
|
desc?: components.Desc$Outbound | undefined;
|
|
78
91
|
page?: number | undefined;
|
|
79
92
|
items_per_page?: number | undefined;
|
|
80
93
|
scan_type?: string | undefined;
|
|
81
94
|
facility_name_like?: string | undefined;
|
|
95
|
+
facility_id?: number | undefined;
|
|
82
96
|
};
|
|
83
97
|
|
|
84
98
|
/** @internal */
|
|
@@ -87,17 +101,21 @@ export const ListVendorFacilityStatusesRequest$outboundSchema: z.ZodType<
|
|
|
87
101
|
z.ZodTypeDef,
|
|
88
102
|
ListVendorFacilityStatusesRequest
|
|
89
103
|
> = z.object({
|
|
104
|
+
vendorIdOrMe: z.string(),
|
|
90
105
|
sort: z.nullable(z.string()).optional(),
|
|
91
106
|
desc: components.Desc$outboundSchema.optional(),
|
|
92
107
|
page: z.number().int().optional(),
|
|
93
108
|
itemsPerPage: z.number().int().optional(),
|
|
94
109
|
scanType: components.ScanType$outboundSchema.optional(),
|
|
95
110
|
facilityNameLike: z.string().optional(),
|
|
111
|
+
facilityId: z.number().int().optional(),
|
|
96
112
|
}).transform((v) => {
|
|
97
113
|
return remap$(v, {
|
|
114
|
+
vendorIdOrMe: "vendor_id_or_me",
|
|
98
115
|
itemsPerPage: "items_per_page",
|
|
99
116
|
scanType: "scan_type",
|
|
100
117
|
facilityNameLike: "facility_name_like",
|
|
118
|
+
facilityId: "facility_id",
|
|
101
119
|
});
|
|
102
120
|
});
|
|
103
121
|
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The request was successful, and the server has returned the requested resource in the response body.
|
|
13
|
+
*/
|
|
14
|
+
export type RotateApiKeyRotateApiKeyOk = {
|
|
15
|
+
success: boolean;
|
|
16
|
+
apiKey?: string | undefined;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const RotateApiKeyRotateApiKeyOk$inboundSchema: z.ZodType<
|
|
21
|
+
RotateApiKeyRotateApiKeyOk,
|
|
22
|
+
z.ZodTypeDef,
|
|
23
|
+
unknown
|
|
24
|
+
> = z.object({
|
|
25
|
+
success: z.boolean(),
|
|
26
|
+
api_key: z.string().optional(),
|
|
27
|
+
}).transform((v) => {
|
|
28
|
+
return remap$(v, {
|
|
29
|
+
"api_key": "apiKey",
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
/** @internal */
|
|
34
|
+
export type RotateApiKeyRotateApiKeyOk$Outbound = {
|
|
35
|
+
success: boolean;
|
|
36
|
+
api_key?: string | undefined;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/** @internal */
|
|
40
|
+
export const RotateApiKeyRotateApiKeyOk$outboundSchema: z.ZodType<
|
|
41
|
+
RotateApiKeyRotateApiKeyOk$Outbound,
|
|
42
|
+
z.ZodTypeDef,
|
|
43
|
+
RotateApiKeyRotateApiKeyOk
|
|
44
|
+
> = z.object({
|
|
45
|
+
success: z.boolean(),
|
|
46
|
+
apiKey: z.string().optional(),
|
|
47
|
+
}).transform((v) => {
|
|
48
|
+
return remap$(v, {
|
|
49
|
+
apiKey: "api_key",
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* @internal
|
|
55
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
56
|
+
*/
|
|
57
|
+
export namespace RotateApiKeyRotateApiKeyOk$ {
|
|
58
|
+
/** @deprecated use `RotateApiKeyRotateApiKeyOk$inboundSchema` instead. */
|
|
59
|
+
export const inboundSchema = RotateApiKeyRotateApiKeyOk$inboundSchema;
|
|
60
|
+
/** @deprecated use `RotateApiKeyRotateApiKeyOk$outboundSchema` instead. */
|
|
61
|
+
export const outboundSchema = RotateApiKeyRotateApiKeyOk$outboundSchema;
|
|
62
|
+
/** @deprecated use `RotateApiKeyRotateApiKeyOk$Outbound` instead. */
|
|
63
|
+
export type Outbound = RotateApiKeyRotateApiKeyOk$Outbound;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function rotateApiKeyRotateApiKeyOkToJSON(
|
|
67
|
+
rotateApiKeyRotateApiKeyOk: RotateApiKeyRotateApiKeyOk,
|
|
68
|
+
): string {
|
|
69
|
+
return JSON.stringify(
|
|
70
|
+
RotateApiKeyRotateApiKeyOk$outboundSchema.parse(rotateApiKeyRotateApiKeyOk),
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function rotateApiKeyRotateApiKeyOkFromJSON(
|
|
75
|
+
jsonString: string,
|
|
76
|
+
): SafeParseResult<RotateApiKeyRotateApiKeyOk, SDKValidationError> {
|
|
77
|
+
return safeParse(
|
|
78
|
+
jsonString,
|
|
79
|
+
(x) => RotateApiKeyRotateApiKeyOk$inboundSchema.parse(JSON.parse(x)),
|
|
80
|
+
`Failed to parse 'RotateApiKeyRotateApiKeyOk' from JSON`,
|
|
81
|
+
);
|
|
82
|
+
}
|
package/src/react-query/index.ts
CHANGED
|
@@ -23,6 +23,7 @@ export * from "./usersMagiclink.js";
|
|
|
23
23
|
export * from "./usersPassword.js";
|
|
24
24
|
export * from "./usersPasswordResetRequest.js";
|
|
25
25
|
export * from "./usersPostAuthenticate.js";
|
|
26
|
+
export * from "./usersRotateApiKey.js";
|
|
26
27
|
export * from "./vendorsAcceptVendorCredential.js";
|
|
27
28
|
export * from "./vendorsAddVendorCredentialFile.js";
|
|
28
29
|
export * from "./vendorsAddVendorManagedByCompany.js";
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
MutationKey,
|
|
7
|
+
useMutation,
|
|
8
|
+
UseMutationResult,
|
|
9
|
+
} from "@tanstack/react-query";
|
|
10
|
+
import { GreenSecurityCore } from "../core.js";
|
|
11
|
+
import { usersRotateApiKey } from "../funcs/usersRotateApiKey.js";
|
|
12
|
+
import { combineSignals } from "../lib/primitives.js";
|
|
13
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
14
|
+
import * as operations from "../models/operations/index.js";
|
|
15
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
16
|
+
import { useGreenSecurityContext } from "./_context.js";
|
|
17
|
+
import { MutationHookOptions } from "./_types.js";
|
|
18
|
+
|
|
19
|
+
export type UsersRotateApiKeyMutationVariables = {
|
|
20
|
+
options?: RequestOptions;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type UsersRotateApiKeyMutationData =
|
|
24
|
+
operations.RotateApiKeyRotateApiKeyOk;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Rotate API key
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* Allows an API user to rotate their own API key. Note, the key rotation happens immediately so the user should be prepared to update their API key in their application for all subsequent requests.
|
|
31
|
+
*/
|
|
32
|
+
export function useUsersRotateApiKeyMutation(
|
|
33
|
+
options?: MutationHookOptions<
|
|
34
|
+
UsersRotateApiKeyMutationData,
|
|
35
|
+
Error,
|
|
36
|
+
UsersRotateApiKeyMutationVariables
|
|
37
|
+
>,
|
|
38
|
+
): UseMutationResult<
|
|
39
|
+
UsersRotateApiKeyMutationData,
|
|
40
|
+
Error,
|
|
41
|
+
UsersRotateApiKeyMutationVariables
|
|
42
|
+
> {
|
|
43
|
+
const client = useGreenSecurityContext();
|
|
44
|
+
return useMutation({
|
|
45
|
+
...buildUsersRotateApiKeyMutation(client, options),
|
|
46
|
+
...options,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function mutationKeyUsersRotateApiKey(): MutationKey {
|
|
51
|
+
return ["@greensecurity/javascript-sdk", "users", "rotateApiKey"];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function buildUsersRotateApiKeyMutation(
|
|
55
|
+
client$: GreenSecurityCore,
|
|
56
|
+
hookOptions?: RequestOptions,
|
|
57
|
+
): {
|
|
58
|
+
mutationKey: MutationKey;
|
|
59
|
+
mutationFn: (
|
|
60
|
+
variables: UsersRotateApiKeyMutationVariables,
|
|
61
|
+
) => Promise<UsersRotateApiKeyMutationData>;
|
|
62
|
+
} {
|
|
63
|
+
return {
|
|
64
|
+
mutationKey: mutationKeyUsersRotateApiKey(),
|
|
65
|
+
mutationFn: function usersRotateApiKeyMutationFn({
|
|
66
|
+
options,
|
|
67
|
+
}): Promise<UsersRotateApiKeyMutationData> {
|
|
68
|
+
const mergedOptions = {
|
|
69
|
+
...hookOptions,
|
|
70
|
+
...options,
|
|
71
|
+
fetchOptions: {
|
|
72
|
+
...hookOptions?.fetchOptions,
|
|
73
|
+
...options?.fetchOptions,
|
|
74
|
+
signal: combineSignals(
|
|
75
|
+
hookOptions?.fetchOptions?.signal,
|
|
76
|
+
options?.fetchOptions?.signal,
|
|
77
|
+
),
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
return unwrapAsync(usersRotateApiKey(
|
|
81
|
+
client$,
|
|
82
|
+
mergedOptions,
|
|
83
|
+
));
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
}
|
|
@@ -187,6 +187,7 @@ export function prefetchVendorsListVendorFacilityStatuses(
|
|
|
187
187
|
export function setVendorsListVendorFacilityStatusesData(
|
|
188
188
|
client: QueryClient,
|
|
189
189
|
queryKeyBase: [
|
|
190
|
+
vendorIdOrMe: string,
|
|
190
191
|
parameters: {
|
|
191
192
|
sort?: string | null | undefined;
|
|
192
193
|
desc?: components.Desc | undefined;
|
|
@@ -194,6 +195,7 @@ export function setVendorsListVendorFacilityStatusesData(
|
|
|
194
195
|
itemsPerPage?: number | undefined;
|
|
195
196
|
scanType?: components.ScanType | undefined;
|
|
196
197
|
facilityNameLike?: string | undefined;
|
|
198
|
+
facilityId?: number | undefined;
|
|
197
199
|
},
|
|
198
200
|
],
|
|
199
201
|
data: VendorsListVendorFacilityStatusesQueryData,
|
|
@@ -209,14 +211,18 @@ export function setVendorsListVendorFacilityStatusesData(
|
|
|
209
211
|
export function invalidateVendorsListVendorFacilityStatuses(
|
|
210
212
|
client: QueryClient,
|
|
211
213
|
queryKeyBase: TupleToPrefixes<
|
|
212
|
-
[
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
214
|
+
[
|
|
215
|
+
vendorIdOrMe: string,
|
|
216
|
+
parameters: {
|
|
217
|
+
sort?: string | null | undefined;
|
|
218
|
+
desc?: components.Desc | undefined;
|
|
219
|
+
page?: number | undefined;
|
|
220
|
+
itemsPerPage?: number | undefined;
|
|
221
|
+
scanType?: components.ScanType | undefined;
|
|
222
|
+
facilityNameLike?: string | undefined;
|
|
223
|
+
facilityId?: number | undefined;
|
|
224
|
+
},
|
|
225
|
+
]
|
|
220
226
|
>,
|
|
221
227
|
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
222
228
|
): Promise<void> {
|
|
@@ -256,13 +262,14 @@ export function buildVendorsListVendorFacilityStatusesQuery(
|
|
|
256
262
|
) => Promise<VendorsListVendorFacilityStatusesQueryData>;
|
|
257
263
|
} {
|
|
258
264
|
return {
|
|
259
|
-
queryKey: queryKeyVendorsListVendorFacilityStatuses({
|
|
265
|
+
queryKey: queryKeyVendorsListVendorFacilityStatuses(request.vendorIdOrMe, {
|
|
260
266
|
sort: request.sort,
|
|
261
267
|
desc: request.desc,
|
|
262
268
|
page: request.page,
|
|
263
269
|
itemsPerPage: request.itemsPerPage,
|
|
264
270
|
scanType: request.scanType,
|
|
265
271
|
facilityNameLike: request.facilityNameLike,
|
|
272
|
+
facilityId: request.facilityId,
|
|
266
273
|
}),
|
|
267
274
|
queryFn: async function vendorsListVendorFacilityStatusesQueryFn(
|
|
268
275
|
ctx,
|
|
@@ -296,13 +303,14 @@ export function buildVendorsListVendorFacilityStatusesInfiniteQuery(
|
|
|
296
303
|
) => Promise<VendorsListVendorFacilityStatusesInfiniteQueryData>;
|
|
297
304
|
} {
|
|
298
305
|
return {
|
|
299
|
-
queryKey: queryKeyVendorsListVendorFacilityStatuses({
|
|
306
|
+
queryKey: queryKeyVendorsListVendorFacilityStatuses(request.vendorIdOrMe, {
|
|
300
307
|
sort: request.sort,
|
|
301
308
|
desc: request.desc,
|
|
302
309
|
page: request.page,
|
|
303
310
|
itemsPerPage: request.itemsPerPage,
|
|
304
311
|
scanType: request.scanType,
|
|
305
312
|
facilityNameLike: request.facilityNameLike,
|
|
313
|
+
facilityId: request.facilityId,
|
|
306
314
|
}),
|
|
307
315
|
queryFn: async function vendorsListVendorFacilityStatusesQuery(
|
|
308
316
|
ctx,
|
|
@@ -334,6 +342,7 @@ export function buildVendorsListVendorFacilityStatusesInfiniteQuery(
|
|
|
334
342
|
}
|
|
335
343
|
|
|
336
344
|
export function queryKeyVendorsListVendorFacilityStatuses(
|
|
345
|
+
vendorIdOrMe: string,
|
|
337
346
|
parameters: {
|
|
338
347
|
sort?: string | null | undefined;
|
|
339
348
|
desc?: components.Desc | undefined;
|
|
@@ -341,12 +350,14 @@ export function queryKeyVendorsListVendorFacilityStatuses(
|
|
|
341
350
|
itemsPerPage?: number | undefined;
|
|
342
351
|
scanType?: components.ScanType | undefined;
|
|
343
352
|
facilityNameLike?: string | undefined;
|
|
353
|
+
facilityId?: number | undefined;
|
|
344
354
|
},
|
|
345
355
|
): QueryKey {
|
|
346
356
|
return [
|
|
347
357
|
"@greensecurity/javascript-sdk",
|
|
348
358
|
"vendors",
|
|
349
359
|
"listVendorFacilityStatuses",
|
|
360
|
+
vendorIdOrMe,
|
|
350
361
|
parameters,
|
|
351
362
|
];
|
|
352
363
|
}
|
|
@@ -33,6 +33,12 @@ export type ZonesGetSecurityZoneQueryData = components.Zone;
|
|
|
33
33
|
*
|
|
34
34
|
* @remarks
|
|
35
35
|
* Get security zone details
|
|
36
|
+
*
|
|
37
|
+
* Available `expand` scopes are:
|
|
38
|
+
*
|
|
39
|
+
* - zone.facility
|
|
40
|
+
* - zone.department
|
|
41
|
+
* - zone.rules
|
|
36
42
|
*/
|
|
37
43
|
export function useZonesGetSecurityZone(
|
|
38
44
|
request: operations.GetSecurityZoneRequest,
|
|
@@ -54,6 +60,12 @@ export function useZonesGetSecurityZone(
|
|
|
54
60
|
*
|
|
55
61
|
* @remarks
|
|
56
62
|
* Get security zone details
|
|
63
|
+
*
|
|
64
|
+
* Available `expand` scopes are:
|
|
65
|
+
*
|
|
66
|
+
* - zone.facility
|
|
67
|
+
* - zone.department
|
|
68
|
+
* - zone.rules
|
|
57
69
|
*/
|
|
58
70
|
export function useZonesGetSecurityZoneSuspense(
|
|
59
71
|
request: operations.GetSecurityZoneRequest,
|
|
@@ -85,7 +97,10 @@ export function prefetchZonesGetSecurityZone(
|
|
|
85
97
|
|
|
86
98
|
export function setZonesGetSecurityZoneData(
|
|
87
99
|
client: QueryClient,
|
|
88
|
-
queryKeyBase: [
|
|
100
|
+
queryKeyBase: [
|
|
101
|
+
id: number,
|
|
102
|
+
parameters: { expand?: Array<components.Expand> | undefined },
|
|
103
|
+
],
|
|
89
104
|
data: ZonesGetSecurityZoneQueryData,
|
|
90
105
|
): ZonesGetSecurityZoneQueryData | undefined {
|
|
91
106
|
const key = queryKeyZonesGetSecurityZone(...queryKeyBase);
|
|
@@ -95,7 +110,9 @@ export function setZonesGetSecurityZoneData(
|
|
|
95
110
|
|
|
96
111
|
export function invalidateZonesGetSecurityZone(
|
|
97
112
|
client: QueryClient,
|
|
98
|
-
queryKeyBase: TupleToPrefixes<
|
|
113
|
+
queryKeyBase: TupleToPrefixes<
|
|
114
|
+
[id: number, parameters: { expand?: Array<components.Expand> | undefined }]
|
|
115
|
+
>,
|
|
99
116
|
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
100
117
|
): Promise<void> {
|
|
101
118
|
return client.invalidateQueries({
|
|
@@ -130,7 +147,9 @@ export function buildZonesGetSecurityZoneQuery(
|
|
|
130
147
|
) => Promise<ZonesGetSecurityZoneQueryData>;
|
|
131
148
|
} {
|
|
132
149
|
return {
|
|
133
|
-
queryKey: queryKeyZonesGetSecurityZone(request.id
|
|
150
|
+
queryKey: queryKeyZonesGetSecurityZone(request.id, {
|
|
151
|
+
expand: request.expand,
|
|
152
|
+
}),
|
|
134
153
|
queryFn: async function zonesGetSecurityZoneQueryFn(
|
|
135
154
|
ctx,
|
|
136
155
|
): Promise<ZonesGetSecurityZoneQueryData> {
|
|
@@ -149,6 +168,15 @@ export function buildZonesGetSecurityZoneQuery(
|
|
|
149
168
|
};
|
|
150
169
|
}
|
|
151
170
|
|
|
152
|
-
export function queryKeyZonesGetSecurityZone(
|
|
153
|
-
|
|
171
|
+
export function queryKeyZonesGetSecurityZone(
|
|
172
|
+
id: number,
|
|
173
|
+
parameters: { expand?: Array<components.Expand> | undefined },
|
|
174
|
+
): QueryKey {
|
|
175
|
+
return [
|
|
176
|
+
"@greensecurity/javascript-sdk",
|
|
177
|
+
"zones",
|
|
178
|
+
"getSecurityZone",
|
|
179
|
+
id,
|
|
180
|
+
parameters,
|
|
181
|
+
];
|
|
154
182
|
}
|
package/src/sdk/users.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { usersMagiclink } from "../funcs/usersMagiclink.js";
|
|
|
9
9
|
import { usersPassword } from "../funcs/usersPassword.js";
|
|
10
10
|
import { usersPasswordResetRequest } from "../funcs/usersPasswordResetRequest.js";
|
|
11
11
|
import { usersPostAuthenticate } from "../funcs/usersPostAuthenticate.js";
|
|
12
|
+
import { usersRotateApiKey } from "../funcs/usersRotateApiKey.js";
|
|
12
13
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
13
14
|
import * as components from "../models/components/index.js";
|
|
14
15
|
import * as operations from "../models/operations/index.js";
|
|
@@ -94,6 +95,21 @@ export class Users extends ClientSDK {
|
|
|
94
95
|
));
|
|
95
96
|
}
|
|
96
97
|
|
|
98
|
+
/**
|
|
99
|
+
* Rotate API key
|
|
100
|
+
*
|
|
101
|
+
* @remarks
|
|
102
|
+
* Allows an API user to rotate their own API key. Note, the key rotation happens immediately so the user should be prepared to update their API key in their application for all subsequent requests.
|
|
103
|
+
*/
|
|
104
|
+
async rotateApiKey(
|
|
105
|
+
options?: RequestOptions,
|
|
106
|
+
): Promise<operations.RotateApiKeyRotateApiKeyOk> {
|
|
107
|
+
return unwrapAsync(usersRotateApiKey(
|
|
108
|
+
this,
|
|
109
|
+
options,
|
|
110
|
+
));
|
|
111
|
+
}
|
|
112
|
+
|
|
97
113
|
/**
|
|
98
114
|
* Magic link
|
|
99
115
|
*
|
package/src/sdk/zones.ts
CHANGED
|
@@ -36,6 +36,12 @@ export class Zones extends ClientSDK {
|
|
|
36
36
|
*
|
|
37
37
|
* @remarks
|
|
38
38
|
* Get security zone details
|
|
39
|
+
*
|
|
40
|
+
* Available `expand` scopes are:
|
|
41
|
+
*
|
|
42
|
+
* - zone.facility
|
|
43
|
+
* - zone.department
|
|
44
|
+
* - zone.rules
|
|
39
45
|
*/
|
|
40
46
|
async getSecurityZone(
|
|
41
47
|
request: operations.GetSecurityZoneRequest,
|