@greensecurity/javascript-sdk 0.30.35 → 0.30.37

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 (152) hide show
  1. package/README.md +6 -0
  2. package/bin/mcp-server.js +828 -16
  3. package/bin/mcp-server.js.map +14 -9
  4. package/dist/commonjs/__tests__/vendormanagedbycompanies.test.js +1 -1
  5. package/dist/commonjs/__tests__/vendormanagedbycompanies.test.js.map +1 -1
  6. package/dist/commonjs/__tests__/vendors.test.js +1 -1
  7. package/dist/commonjs/__tests__/vendors.test.js.map +1 -1
  8. package/dist/commonjs/__tests__/webhooks.test.js +1 -1
  9. package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
  10. package/dist/commonjs/__tests__/zones.test.d.ts +2 -0
  11. package/dist/commonjs/__tests__/zones.test.d.ts.map +1 -0
  12. package/dist/commonjs/__tests__/zones.test.js +45 -0
  13. package/dist/commonjs/__tests__/zones.test.js.map +1 -0
  14. package/dist/commonjs/funcs/zonesListOrSearchSecurityZones.d.ts +20 -0
  15. package/dist/commonjs/funcs/zonesListOrSearchSecurityZones.d.ts.map +1 -0
  16. package/dist/commonjs/funcs/zonesListOrSearchSecurityZones.js +160 -0
  17. package/dist/commonjs/funcs/zonesListOrSearchSecurityZones.js.map +1 -0
  18. package/dist/commonjs/lib/config.d.ts +3 -3
  19. package/dist/commonjs/lib/config.js +3 -3
  20. package/dist/commonjs/lib/sdks.d.ts +3 -1
  21. package/dist/commonjs/lib/sdks.d.ts.map +1 -1
  22. package/dist/commonjs/lib/sdks.js +6 -11
  23. package/dist/commonjs/lib/sdks.js.map +1 -1
  24. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  25. package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
  26. package/dist/commonjs/mcp-server/server.js +3 -1
  27. package/dist/commonjs/mcp-server/server.js.map +1 -1
  28. package/dist/commonjs/mcp-server/tools/zonesListOrSearchSecurityZones.d.ts +8 -0
  29. package/dist/commonjs/mcp-server/tools/zonesListOrSearchSecurityZones.d.ts.map +1 -0
  30. package/dist/commonjs/mcp-server/tools/zonesListOrSearchSecurityZones.js +64 -0
  31. package/dist/commonjs/mcp-server/tools/zonesListOrSearchSecurityZones.js.map +1 -0
  32. package/dist/commonjs/models/components/index.d.ts +2 -0
  33. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  34. package/dist/commonjs/models/components/index.js +2 -0
  35. package/dist/commonjs/models/components/index.js.map +1 -1
  36. package/dist/commonjs/models/components/zone.d.ts +354 -0
  37. package/dist/commonjs/models/components/zone.d.ts.map +1 -0
  38. package/dist/commonjs/models/components/zone.js +538 -0
  39. package/dist/commonjs/models/components/zone.js.map +1 -0
  40. package/dist/commonjs/models/components/zoneconfig.d.ts +298 -0
  41. package/dist/commonjs/models/components/zoneconfig.d.ts.map +1 -0
  42. package/dist/commonjs/models/components/zoneconfig.js +454 -0
  43. package/dist/commonjs/models/components/zoneconfig.js.map +1 -0
  44. package/dist/commonjs/models/operations/index.d.ts +1 -0
  45. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  46. package/dist/commonjs/models/operations/index.js +1 -0
  47. package/dist/commonjs/models/operations/index.js.map +1 -1
  48. package/dist/commonjs/models/operations/listorsearchsecurityzones.d.ts +136 -0
  49. package/dist/commonjs/models/operations/listorsearchsecurityzones.d.ts.map +1 -0
  50. package/dist/commonjs/models/operations/listorsearchsecurityzones.js +169 -0
  51. package/dist/commonjs/models/operations/listorsearchsecurityzones.js.map +1 -0
  52. package/dist/commonjs/react-query/index.d.ts +1 -0
  53. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  54. package/dist/commonjs/react-query/index.js +1 -0
  55. package/dist/commonjs/react-query/index.js.map +1 -1
  56. package/dist/commonjs/react-query/zonesListOrSearchSecurityZones.d.ts +93 -0
  57. package/dist/commonjs/react-query/zonesListOrSearchSecurityZones.d.ts.map +1 -0
  58. package/dist/commonjs/react-query/zonesListOrSearchSecurityZones.js +171 -0
  59. package/dist/commonjs/react-query/zonesListOrSearchSecurityZones.js.map +1 -0
  60. package/dist/commonjs/sdk/sdk.d.ts +3 -0
  61. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  62. package/dist/commonjs/sdk/sdk.js +4 -0
  63. package/dist/commonjs/sdk/sdk.js.map +1 -1
  64. package/dist/commonjs/sdk/zones.d.ts +15 -0
  65. package/dist/commonjs/sdk/zones.d.ts.map +1 -0
  66. package/dist/commonjs/sdk/zones.js +22 -0
  67. package/dist/commonjs/sdk/zones.js.map +1 -0
  68. package/dist/esm/__tests__/vendormanagedbycompanies.test.js +1 -1
  69. package/dist/esm/__tests__/vendormanagedbycompanies.test.js.map +1 -1
  70. package/dist/esm/__tests__/vendors.test.js +1 -1
  71. package/dist/esm/__tests__/vendors.test.js.map +1 -1
  72. package/dist/esm/__tests__/webhooks.test.js +1 -1
  73. package/dist/esm/__tests__/webhooks.test.js.map +1 -1
  74. package/dist/esm/__tests__/zones.test.d.ts +2 -0
  75. package/dist/esm/__tests__/zones.test.d.ts.map +1 -0
  76. package/dist/esm/__tests__/zones.test.js +43 -0
  77. package/dist/esm/__tests__/zones.test.js.map +1 -0
  78. package/dist/esm/funcs/zonesListOrSearchSecurityZones.d.ts +20 -0
  79. package/dist/esm/funcs/zonesListOrSearchSecurityZones.d.ts.map +1 -0
  80. package/dist/esm/funcs/zonesListOrSearchSecurityZones.js +124 -0
  81. package/dist/esm/funcs/zonesListOrSearchSecurityZones.js.map +1 -0
  82. package/dist/esm/lib/config.d.ts +3 -3
  83. package/dist/esm/lib/config.js +3 -3
  84. package/dist/esm/lib/sdks.d.ts +3 -1
  85. package/dist/esm/lib/sdks.d.ts.map +1 -1
  86. package/dist/esm/lib/sdks.js +6 -11
  87. package/dist/esm/lib/sdks.js.map +1 -1
  88. package/dist/esm/mcp-server/mcp-server.js +1 -1
  89. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  90. package/dist/esm/mcp-server/server.js +3 -1
  91. package/dist/esm/mcp-server/server.js.map +1 -1
  92. package/dist/esm/mcp-server/tools/zonesListOrSearchSecurityZones.d.ts +8 -0
  93. package/dist/esm/mcp-server/tools/zonesListOrSearchSecurityZones.d.ts.map +1 -0
  94. package/dist/esm/mcp-server/tools/zonesListOrSearchSecurityZones.js +28 -0
  95. package/dist/esm/mcp-server/tools/zonesListOrSearchSecurityZones.js.map +1 -0
  96. package/dist/esm/models/components/index.d.ts +2 -0
  97. package/dist/esm/models/components/index.d.ts.map +1 -1
  98. package/dist/esm/models/components/index.js +2 -0
  99. package/dist/esm/models/components/index.js.map +1 -1
  100. package/dist/esm/models/components/zone.d.ts +354 -0
  101. package/dist/esm/models/components/zone.d.ts.map +1 -0
  102. package/dist/esm/models/components/zone.js +482 -0
  103. package/dist/esm/models/components/zone.js.map +1 -0
  104. package/dist/esm/models/components/zoneconfig.d.ts +298 -0
  105. package/dist/esm/models/components/zoneconfig.d.ts.map +1 -0
  106. package/dist/esm/models/components/zoneconfig.js +400 -0
  107. package/dist/esm/models/components/zoneconfig.js.map +1 -0
  108. package/dist/esm/models/operations/index.d.ts +1 -0
  109. package/dist/esm/models/operations/index.d.ts.map +1 -1
  110. package/dist/esm/models/operations/index.js +1 -0
  111. package/dist/esm/models/operations/index.js.map +1 -1
  112. package/dist/esm/models/operations/listorsearchsecurityzones.d.ts +136 -0
  113. package/dist/esm/models/operations/listorsearchsecurityzones.d.ts.map +1 -0
  114. package/dist/esm/models/operations/listorsearchsecurityzones.js +127 -0
  115. package/dist/esm/models/operations/listorsearchsecurityzones.js.map +1 -0
  116. package/dist/esm/react-query/index.d.ts +1 -0
  117. package/dist/esm/react-query/index.d.ts.map +1 -1
  118. package/dist/esm/react-query/index.js +1 -0
  119. package/dist/esm/react-query/index.js.map +1 -1
  120. package/dist/esm/react-query/zonesListOrSearchSecurityZones.d.ts +93 -0
  121. package/dist/esm/react-query/zonesListOrSearchSecurityZones.d.ts.map +1 -0
  122. package/dist/esm/react-query/zonesListOrSearchSecurityZones.js +158 -0
  123. package/dist/esm/react-query/zonesListOrSearchSecurityZones.js.map +1 -0
  124. package/dist/esm/sdk/sdk.d.ts +3 -0
  125. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  126. package/dist/esm/sdk/sdk.js +4 -0
  127. package/dist/esm/sdk/sdk.js.map +1 -1
  128. package/dist/esm/sdk/zones.d.ts +15 -0
  129. package/dist/esm/sdk/zones.d.ts.map +1 -0
  130. package/dist/esm/sdk/zones.js +18 -0
  131. package/dist/esm/sdk/zones.js.map +1 -0
  132. package/jsr.json +1 -1
  133. package/package.json +1 -1
  134. package/src/__tests__/vendormanagedbycompanies.test.ts +1 -1
  135. package/src/__tests__/vendors.test.ts +1 -1
  136. package/src/__tests__/webhooks.test.ts +1 -1
  137. package/src/__tests__/zones.test.ts +46 -0
  138. package/src/funcs/zonesListOrSearchSecurityZones.ts +246 -0
  139. package/src/lib/config.ts +3 -3
  140. package/src/lib/sdks.ts +11 -11
  141. package/src/mcp-server/mcp-server.ts +1 -1
  142. package/src/mcp-server/server.ts +3 -1
  143. package/src/mcp-server/tools/zonesListOrSearchSecurityZones.ts +38 -0
  144. package/src/models/components/index.ts +2 -0
  145. package/src/models/components/zone.ts +907 -0
  146. package/src/models/components/zoneconfig.ts +761 -0
  147. package/src/models/operations/index.ts +1 -0
  148. package/src/models/operations/listorsearchsecurityzones.ts +294 -0
  149. package/src/react-query/index.ts +1 -0
  150. package/src/react-query/zonesListOrSearchSecurityZones.ts +370 -0
  151. package/src/sdk/sdk.ts +6 -0
  152. package/src/sdk/zones.ts +29 -0
@@ -17,6 +17,7 @@ export * from "./getwebhookendpoint.js";
17
17
  export * from "./listallwebhookendpoints.js";
18
18
  export * from "./listorsearchcompanies.js";
19
19
  export * from "./listorsearchfacilities.js";
20
+ export * from "./listorsearchsecurityzones.js";
20
21
  export * from "./listorsearchsupportarticles.js";
21
22
  export * from "./listvendoradditionalfacilityfields.js";
22
23
  export * from "./listvendorcredentials.js";
@@ -0,0 +1,294 @@
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 * as components from "../components/index.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export type ListOrSearchSecurityZonesRequest = {
13
+ /**
14
+ * A comma-separated list of object attributes to sort on.
15
+ */
16
+ sort?: string | null | undefined;
17
+ /**
18
+ * Sort desc
19
+ */
20
+ desc?: components.Desc | undefined;
21
+ /**
22
+ * A 1-based offset for which page to request (defaults to 1)
23
+ */
24
+ page?: number | undefined;
25
+ /**
26
+ * Number of items to show in a given page
27
+ */
28
+ itemsPerPage?: number | undefined;
29
+ /**
30
+ * The latitude of the current Geo coordinates
31
+ */
32
+ latitude?: number | undefined;
33
+ /**
34
+ * The longitude of the current Geo coordinates
35
+ */
36
+ longitude?: number | undefined;
37
+ /**
38
+ * A partial string to search in the object name. Do not include any wildcard characters. Searches are not case-sensitive by default.
39
+ */
40
+ nameLike?: string | undefined;
41
+ /**
42
+ * The contact_id value
43
+ */
44
+ contactId?: number | undefined;
45
+ /**
46
+ * The ID associated with a medical facility
47
+ */
48
+ facilityId?: number | undefined;
49
+ /**
50
+ * The green_location_id associated with a medical facility
51
+ */
52
+ greenLocationId?: number | undefined;
53
+ };
54
+
55
+ /**
56
+ * The request was successful, and the server has returned the requested resource in the response body.
57
+ */
58
+ export type ListOrSearchSecurityZonesResponseBody = {
59
+ /**
60
+ * Pagination information for a pageable list
61
+ */
62
+ pager: components.Pager;
63
+ items: Array<components.Zone>;
64
+ };
65
+
66
+ export type ListOrSearchSecurityZonesResponse = {
67
+ result: ListOrSearchSecurityZonesResponseBody;
68
+ };
69
+
70
+ /** @internal */
71
+ export const ListOrSearchSecurityZonesRequest$inboundSchema: z.ZodType<
72
+ ListOrSearchSecurityZonesRequest,
73
+ z.ZodTypeDef,
74
+ unknown
75
+ > = z.object({
76
+ sort: z.nullable(z.string()).optional(),
77
+ desc: components.Desc$inboundSchema.optional(),
78
+ page: z.number().int().optional(),
79
+ items_per_page: z.number().int().optional(),
80
+ latitude: z.number().optional(),
81
+ longitude: z.number().optional(),
82
+ name_like: z.string().optional(),
83
+ contact_id: z.number().optional(),
84
+ facility_id: z.number().optional(),
85
+ green_location_id: z.number().optional(),
86
+ }).transform((v) => {
87
+ return remap$(v, {
88
+ "items_per_page": "itemsPerPage",
89
+ "name_like": "nameLike",
90
+ "contact_id": "contactId",
91
+ "facility_id": "facilityId",
92
+ "green_location_id": "greenLocationId",
93
+ });
94
+ });
95
+
96
+ /** @internal */
97
+ export type ListOrSearchSecurityZonesRequest$Outbound = {
98
+ sort?: string | null | undefined;
99
+ desc?: components.Desc$Outbound | undefined;
100
+ page?: number | undefined;
101
+ items_per_page?: number | undefined;
102
+ latitude?: number | undefined;
103
+ longitude?: number | undefined;
104
+ name_like?: string | undefined;
105
+ contact_id?: number | undefined;
106
+ facility_id?: number | undefined;
107
+ green_location_id?: number | undefined;
108
+ };
109
+
110
+ /** @internal */
111
+ export const ListOrSearchSecurityZonesRequest$outboundSchema: z.ZodType<
112
+ ListOrSearchSecurityZonesRequest$Outbound,
113
+ z.ZodTypeDef,
114
+ ListOrSearchSecurityZonesRequest
115
+ > = z.object({
116
+ sort: z.nullable(z.string()).optional(),
117
+ desc: components.Desc$outboundSchema.optional(),
118
+ page: z.number().int().optional(),
119
+ itemsPerPage: z.number().int().optional(),
120
+ latitude: z.number().optional(),
121
+ longitude: z.number().optional(),
122
+ nameLike: z.string().optional(),
123
+ contactId: z.number().optional(),
124
+ facilityId: z.number().optional(),
125
+ greenLocationId: z.number().optional(),
126
+ }).transform((v) => {
127
+ return remap$(v, {
128
+ itemsPerPage: "items_per_page",
129
+ nameLike: "name_like",
130
+ contactId: "contact_id",
131
+ facilityId: "facility_id",
132
+ greenLocationId: "green_location_id",
133
+ });
134
+ });
135
+
136
+ /**
137
+ * @internal
138
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
139
+ */
140
+ export namespace ListOrSearchSecurityZonesRequest$ {
141
+ /** @deprecated use `ListOrSearchSecurityZonesRequest$inboundSchema` instead. */
142
+ export const inboundSchema = ListOrSearchSecurityZonesRequest$inboundSchema;
143
+ /** @deprecated use `ListOrSearchSecurityZonesRequest$outboundSchema` instead. */
144
+ export const outboundSchema = ListOrSearchSecurityZonesRequest$outboundSchema;
145
+ /** @deprecated use `ListOrSearchSecurityZonesRequest$Outbound` instead. */
146
+ export type Outbound = ListOrSearchSecurityZonesRequest$Outbound;
147
+ }
148
+
149
+ export function listOrSearchSecurityZonesRequestToJSON(
150
+ listOrSearchSecurityZonesRequest: ListOrSearchSecurityZonesRequest,
151
+ ): string {
152
+ return JSON.stringify(
153
+ ListOrSearchSecurityZonesRequest$outboundSchema.parse(
154
+ listOrSearchSecurityZonesRequest,
155
+ ),
156
+ );
157
+ }
158
+
159
+ export function listOrSearchSecurityZonesRequestFromJSON(
160
+ jsonString: string,
161
+ ): SafeParseResult<ListOrSearchSecurityZonesRequest, SDKValidationError> {
162
+ return safeParse(
163
+ jsonString,
164
+ (x) => ListOrSearchSecurityZonesRequest$inboundSchema.parse(JSON.parse(x)),
165
+ `Failed to parse 'ListOrSearchSecurityZonesRequest' from JSON`,
166
+ );
167
+ }
168
+
169
+ /** @internal */
170
+ export const ListOrSearchSecurityZonesResponseBody$inboundSchema: z.ZodType<
171
+ ListOrSearchSecurityZonesResponseBody,
172
+ z.ZodTypeDef,
173
+ unknown
174
+ > = z.object({
175
+ pager: components.Pager$inboundSchema,
176
+ items: z.array(components.Zone$inboundSchema),
177
+ });
178
+
179
+ /** @internal */
180
+ export type ListOrSearchSecurityZonesResponseBody$Outbound = {
181
+ pager: components.Pager$Outbound;
182
+ items: Array<components.Zone$Outbound>;
183
+ };
184
+
185
+ /** @internal */
186
+ export const ListOrSearchSecurityZonesResponseBody$outboundSchema: z.ZodType<
187
+ ListOrSearchSecurityZonesResponseBody$Outbound,
188
+ z.ZodTypeDef,
189
+ ListOrSearchSecurityZonesResponseBody
190
+ > = z.object({
191
+ pager: components.Pager$outboundSchema,
192
+ items: z.array(components.Zone$outboundSchema),
193
+ });
194
+
195
+ /**
196
+ * @internal
197
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
198
+ */
199
+ export namespace ListOrSearchSecurityZonesResponseBody$ {
200
+ /** @deprecated use `ListOrSearchSecurityZonesResponseBody$inboundSchema` instead. */
201
+ export const inboundSchema =
202
+ ListOrSearchSecurityZonesResponseBody$inboundSchema;
203
+ /** @deprecated use `ListOrSearchSecurityZonesResponseBody$outboundSchema` instead. */
204
+ export const outboundSchema =
205
+ ListOrSearchSecurityZonesResponseBody$outboundSchema;
206
+ /** @deprecated use `ListOrSearchSecurityZonesResponseBody$Outbound` instead. */
207
+ export type Outbound = ListOrSearchSecurityZonesResponseBody$Outbound;
208
+ }
209
+
210
+ export function listOrSearchSecurityZonesResponseBodyToJSON(
211
+ listOrSearchSecurityZonesResponseBody: ListOrSearchSecurityZonesResponseBody,
212
+ ): string {
213
+ return JSON.stringify(
214
+ ListOrSearchSecurityZonesResponseBody$outboundSchema.parse(
215
+ listOrSearchSecurityZonesResponseBody,
216
+ ),
217
+ );
218
+ }
219
+
220
+ export function listOrSearchSecurityZonesResponseBodyFromJSON(
221
+ jsonString: string,
222
+ ): SafeParseResult<ListOrSearchSecurityZonesResponseBody, SDKValidationError> {
223
+ return safeParse(
224
+ jsonString,
225
+ (x) =>
226
+ ListOrSearchSecurityZonesResponseBody$inboundSchema.parse(JSON.parse(x)),
227
+ `Failed to parse 'ListOrSearchSecurityZonesResponseBody' from JSON`,
228
+ );
229
+ }
230
+
231
+ /** @internal */
232
+ export const ListOrSearchSecurityZonesResponse$inboundSchema: z.ZodType<
233
+ ListOrSearchSecurityZonesResponse,
234
+ z.ZodTypeDef,
235
+ unknown
236
+ > = z.object({
237
+ Result: z.lazy(() => ListOrSearchSecurityZonesResponseBody$inboundSchema),
238
+ }).transform((v) => {
239
+ return remap$(v, {
240
+ "Result": "result",
241
+ });
242
+ });
243
+
244
+ /** @internal */
245
+ export type ListOrSearchSecurityZonesResponse$Outbound = {
246
+ Result: ListOrSearchSecurityZonesResponseBody$Outbound;
247
+ };
248
+
249
+ /** @internal */
250
+ export const ListOrSearchSecurityZonesResponse$outboundSchema: z.ZodType<
251
+ ListOrSearchSecurityZonesResponse$Outbound,
252
+ z.ZodTypeDef,
253
+ ListOrSearchSecurityZonesResponse
254
+ > = z.object({
255
+ result: z.lazy(() => ListOrSearchSecurityZonesResponseBody$outboundSchema),
256
+ }).transform((v) => {
257
+ return remap$(v, {
258
+ result: "Result",
259
+ });
260
+ });
261
+
262
+ /**
263
+ * @internal
264
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
265
+ */
266
+ export namespace ListOrSearchSecurityZonesResponse$ {
267
+ /** @deprecated use `ListOrSearchSecurityZonesResponse$inboundSchema` instead. */
268
+ export const inboundSchema = ListOrSearchSecurityZonesResponse$inboundSchema;
269
+ /** @deprecated use `ListOrSearchSecurityZonesResponse$outboundSchema` instead. */
270
+ export const outboundSchema =
271
+ ListOrSearchSecurityZonesResponse$outboundSchema;
272
+ /** @deprecated use `ListOrSearchSecurityZonesResponse$Outbound` instead. */
273
+ export type Outbound = ListOrSearchSecurityZonesResponse$Outbound;
274
+ }
275
+
276
+ export function listOrSearchSecurityZonesResponseToJSON(
277
+ listOrSearchSecurityZonesResponse: ListOrSearchSecurityZonesResponse,
278
+ ): string {
279
+ return JSON.stringify(
280
+ ListOrSearchSecurityZonesResponse$outboundSchema.parse(
281
+ listOrSearchSecurityZonesResponse,
282
+ ),
283
+ );
284
+ }
285
+
286
+ export function listOrSearchSecurityZonesResponseFromJSON(
287
+ jsonString: string,
288
+ ): SafeParseResult<ListOrSearchSecurityZonesResponse, SDKValidationError> {
289
+ return safeParse(
290
+ jsonString,
291
+ (x) => ListOrSearchSecurityZonesResponse$inboundSchema.parse(JSON.parse(x)),
292
+ `Failed to parse 'ListOrSearchSecurityZonesResponse' from JSON`,
293
+ );
294
+ }
@@ -41,3 +41,4 @@ export * from "./vendorsUpdateVendorManagedByCompany.js";
41
41
  export * from "./vendorsUpdateVendorScrubDetails.js";
42
42
  export * from "./webhooksGetWebhookEndpoint.js";
43
43
  export * from "./webhooksListAllWebhookEndpoints.js";
44
+ export * from "./zonesListOrSearchSecurityZones.js";
@@ -0,0 +1,370 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import {
6
+ InfiniteData,
7
+ InvalidateQueryFilters,
8
+ QueryClient,
9
+ QueryFunctionContext,
10
+ QueryKey,
11
+ useInfiniteQuery,
12
+ UseInfiniteQueryResult,
13
+ useQuery,
14
+ UseQueryResult,
15
+ useSuspenseInfiniteQuery,
16
+ UseSuspenseInfiniteQueryResult,
17
+ useSuspenseQuery,
18
+ UseSuspenseQueryResult,
19
+ } from "@tanstack/react-query";
20
+ import { GreenSecurityCore } from "../core.js";
21
+ import { zonesListOrSearchSecurityZones } from "../funcs/zonesListOrSearchSecurityZones.js";
22
+ import { combineSignals } from "../lib/primitives.js";
23
+ import { RequestOptions } from "../lib/sdks.js";
24
+ import * as components from "../models/components/index.js";
25
+ import * as operations from "../models/operations/index.js";
26
+ import { unwrapAsync } from "../types/fp.js";
27
+ import { PageIterator, unwrapResultIterator } from "../types/operations.js";
28
+ import { useGreenSecurityContext } from "./_context.js";
29
+ import {
30
+ InfiniteQueryHookOptions,
31
+ QueryHookOptions,
32
+ SuspenseInfiniteQueryHookOptions,
33
+ SuspenseQueryHookOptions,
34
+ TupleToPrefixes,
35
+ } from "./_types.js";
36
+
37
+ export type ZonesListOrSearchSecurityZonesQueryData =
38
+ operations.ListOrSearchSecurityZonesResponse;
39
+
40
+ export type ZonesListOrSearchSecurityZonesInfiniteQueryData = PageIterator<
41
+ operations.ListOrSearchSecurityZonesResponse,
42
+ { page: number }
43
+ >;
44
+
45
+ export type ZonesListOrSearchSecurityZonesPageParams = PageIterator<
46
+ operations.ListOrSearchSecurityZonesResponse,
47
+ { page: number }
48
+ >["~next"];
49
+
50
+ /**
51
+ * List or search security zones
52
+ *
53
+ * @remarks
54
+ * List or search security zones
55
+ */
56
+ export function useZonesListOrSearchSecurityZones(
57
+ request: operations.ListOrSearchSecurityZonesRequest,
58
+ options?: QueryHookOptions<ZonesListOrSearchSecurityZonesQueryData>,
59
+ ): UseQueryResult<ZonesListOrSearchSecurityZonesQueryData, Error> {
60
+ const client = useGreenSecurityContext();
61
+ return useQuery({
62
+ ...buildZonesListOrSearchSecurityZonesQuery(
63
+ client,
64
+ request,
65
+ options,
66
+ ),
67
+ ...options,
68
+ });
69
+ }
70
+
71
+ /**
72
+ * List or search security zones
73
+ *
74
+ * @remarks
75
+ * List or search security zones
76
+ */
77
+ export function useZonesListOrSearchSecurityZonesSuspense(
78
+ request: operations.ListOrSearchSecurityZonesRequest,
79
+ options?: SuspenseQueryHookOptions<ZonesListOrSearchSecurityZonesQueryData>,
80
+ ): UseSuspenseQueryResult<ZonesListOrSearchSecurityZonesQueryData, Error> {
81
+ const client = useGreenSecurityContext();
82
+ return useSuspenseQuery({
83
+ ...buildZonesListOrSearchSecurityZonesQuery(
84
+ client,
85
+ request,
86
+ options,
87
+ ),
88
+ ...options,
89
+ });
90
+ }
91
+
92
+ /**
93
+ * List or search security zones
94
+ *
95
+ * @remarks
96
+ * List or search security zones
97
+ */
98
+ export function useZonesListOrSearchSecurityZonesInfinite(
99
+ request: operations.ListOrSearchSecurityZonesRequest,
100
+ options?: InfiniteQueryHookOptions<
101
+ ZonesListOrSearchSecurityZonesInfiniteQueryData
102
+ >,
103
+ ): UseInfiniteQueryResult<
104
+ InfiniteData<
105
+ ZonesListOrSearchSecurityZonesInfiniteQueryData,
106
+ ZonesListOrSearchSecurityZonesPageParams
107
+ >,
108
+ Error
109
+ > {
110
+ const client = useGreenSecurityContext();
111
+ return useInfiniteQuery<
112
+ ZonesListOrSearchSecurityZonesInfiniteQueryData,
113
+ Error,
114
+ InfiniteData<
115
+ ZonesListOrSearchSecurityZonesInfiniteQueryData,
116
+ ZonesListOrSearchSecurityZonesPageParams
117
+ >,
118
+ QueryKey,
119
+ ZonesListOrSearchSecurityZonesPageParams
120
+ >({
121
+ ...buildZonesListOrSearchSecurityZonesInfiniteQuery(
122
+ client,
123
+ request,
124
+ options,
125
+ ),
126
+ initialPageParam: options?.initialPageParam,
127
+ getNextPageParam: (previousPage) => previousPage["~next"],
128
+ ...options,
129
+ });
130
+ }
131
+
132
+ /**
133
+ * List or search security zones
134
+ *
135
+ * @remarks
136
+ * List or search security zones
137
+ */
138
+ export function useZonesListOrSearchSecurityZonesInfiniteSuspense(
139
+ request: operations.ListOrSearchSecurityZonesRequest,
140
+ options?: SuspenseInfiniteQueryHookOptions<
141
+ ZonesListOrSearchSecurityZonesInfiniteQueryData
142
+ >,
143
+ ): UseSuspenseInfiniteQueryResult<
144
+ InfiniteData<
145
+ ZonesListOrSearchSecurityZonesInfiniteQueryData,
146
+ ZonesListOrSearchSecurityZonesPageParams
147
+ >,
148
+ Error
149
+ > {
150
+ const client = useGreenSecurityContext();
151
+ return useSuspenseInfiniteQuery<
152
+ ZonesListOrSearchSecurityZonesInfiniteQueryData,
153
+ Error,
154
+ InfiniteData<
155
+ ZonesListOrSearchSecurityZonesInfiniteQueryData,
156
+ ZonesListOrSearchSecurityZonesPageParams
157
+ >,
158
+ QueryKey,
159
+ ZonesListOrSearchSecurityZonesPageParams
160
+ >({
161
+ ...buildZonesListOrSearchSecurityZonesInfiniteQuery(
162
+ client,
163
+ request,
164
+ options,
165
+ ),
166
+ initialPageParam: options?.initialPageParam,
167
+ getNextPageParam: (previousPage) => previousPage["~next"],
168
+ ...options,
169
+ });
170
+ }
171
+
172
+ export function prefetchZonesListOrSearchSecurityZones(
173
+ queryClient: QueryClient,
174
+ client$: GreenSecurityCore,
175
+ request: operations.ListOrSearchSecurityZonesRequest,
176
+ ): Promise<void> {
177
+ return queryClient.prefetchQuery({
178
+ ...buildZonesListOrSearchSecurityZonesQuery(
179
+ client$,
180
+ request,
181
+ ),
182
+ });
183
+ }
184
+
185
+ export function setZonesListOrSearchSecurityZonesData(
186
+ client: QueryClient,
187
+ queryKeyBase: [
188
+ parameters: {
189
+ sort?: string | null | undefined;
190
+ desc?: components.Desc | undefined;
191
+ page?: number | undefined;
192
+ itemsPerPage?: number | undefined;
193
+ latitude?: number | undefined;
194
+ longitude?: number | undefined;
195
+ nameLike?: string | undefined;
196
+ contactId?: number | undefined;
197
+ facilityId?: number | undefined;
198
+ greenLocationId?: number | undefined;
199
+ },
200
+ ],
201
+ data: ZonesListOrSearchSecurityZonesQueryData,
202
+ ): ZonesListOrSearchSecurityZonesQueryData | undefined {
203
+ const key = queryKeyZonesListOrSearchSecurityZones(...queryKeyBase);
204
+
205
+ return client.setQueryData<ZonesListOrSearchSecurityZonesQueryData>(
206
+ key,
207
+ data,
208
+ );
209
+ }
210
+
211
+ export function invalidateZonesListOrSearchSecurityZones(
212
+ client: QueryClient,
213
+ queryKeyBase: TupleToPrefixes<
214
+ [parameters: {
215
+ sort?: string | null | undefined;
216
+ desc?: components.Desc | undefined;
217
+ page?: number | undefined;
218
+ itemsPerPage?: number | undefined;
219
+ latitude?: number | undefined;
220
+ longitude?: number | undefined;
221
+ nameLike?: string | undefined;
222
+ contactId?: number | undefined;
223
+ facilityId?: number | undefined;
224
+ greenLocationId?: number | undefined;
225
+ }]
226
+ >,
227
+ filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
228
+ ): Promise<void> {
229
+ return client.invalidateQueries({
230
+ ...filters,
231
+ queryKey: [
232
+ "@greensecurity/javascript-sdk",
233
+ "zones",
234
+ "listOrSearchSecurityZones",
235
+ ...queryKeyBase,
236
+ ],
237
+ });
238
+ }
239
+
240
+ export function invalidateAllZonesListOrSearchSecurityZones(
241
+ client: QueryClient,
242
+ filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
243
+ ): Promise<void> {
244
+ return client.invalidateQueries({
245
+ ...filters,
246
+ queryKey: [
247
+ "@greensecurity/javascript-sdk",
248
+ "zones",
249
+ "listOrSearchSecurityZones",
250
+ ],
251
+ });
252
+ }
253
+
254
+ export function buildZonesListOrSearchSecurityZonesQuery(
255
+ client$: GreenSecurityCore,
256
+ request: operations.ListOrSearchSecurityZonesRequest,
257
+ options?: RequestOptions,
258
+ ): {
259
+ queryKey: QueryKey;
260
+ queryFn: (
261
+ context: QueryFunctionContext,
262
+ ) => Promise<ZonesListOrSearchSecurityZonesQueryData>;
263
+ } {
264
+ return {
265
+ queryKey: queryKeyZonesListOrSearchSecurityZones({
266
+ sort: request.sort,
267
+ desc: request.desc,
268
+ page: request.page,
269
+ itemsPerPage: request.itemsPerPage,
270
+ latitude: request.latitude,
271
+ longitude: request.longitude,
272
+ nameLike: request.nameLike,
273
+ contactId: request.contactId,
274
+ facilityId: request.facilityId,
275
+ greenLocationId: request.greenLocationId,
276
+ }),
277
+ queryFn: async function zonesListOrSearchSecurityZonesQueryFn(
278
+ ctx,
279
+ ): Promise<ZonesListOrSearchSecurityZonesQueryData> {
280
+ const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
281
+ const mergedOptions = {
282
+ ...options,
283
+ fetchOptions: { ...options?.fetchOptions, signal: sig },
284
+ };
285
+
286
+ return unwrapAsync(zonesListOrSearchSecurityZones(
287
+ client$,
288
+ request,
289
+ mergedOptions,
290
+ ));
291
+ },
292
+ };
293
+ }
294
+
295
+ export function buildZonesListOrSearchSecurityZonesInfiniteQuery(
296
+ client$: GreenSecurityCore,
297
+ request: operations.ListOrSearchSecurityZonesRequest,
298
+ options?: RequestOptions,
299
+ ): {
300
+ queryKey: QueryKey;
301
+ queryFn: (
302
+ context: QueryFunctionContext<
303
+ QueryKey,
304
+ ZonesListOrSearchSecurityZonesPageParams
305
+ >,
306
+ ) => Promise<ZonesListOrSearchSecurityZonesInfiniteQueryData>;
307
+ } {
308
+ return {
309
+ queryKey: queryKeyZonesListOrSearchSecurityZones({
310
+ sort: request.sort,
311
+ desc: request.desc,
312
+ page: request.page,
313
+ itemsPerPage: request.itemsPerPage,
314
+ latitude: request.latitude,
315
+ longitude: request.longitude,
316
+ nameLike: request.nameLike,
317
+ contactId: request.contactId,
318
+ facilityId: request.facilityId,
319
+ greenLocationId: request.greenLocationId,
320
+ }),
321
+ queryFn: async function zonesListOrSearchSecurityZonesQuery(
322
+ ctx,
323
+ ): Promise<ZonesListOrSearchSecurityZonesInfiniteQueryData> {
324
+ const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
325
+ const mergedOptions = {
326
+ ...options,
327
+ fetchOptions: { ...options?.fetchOptions, signal: sig },
328
+ };
329
+
330
+ if (!ctx.pageParam) {
331
+ return unwrapResultIterator(zonesListOrSearchSecurityZones(
332
+ client$,
333
+ request,
334
+ mergedOptions,
335
+ ));
336
+ }
337
+
338
+ return unwrapResultIterator(zonesListOrSearchSecurityZones(
339
+ client$,
340
+ {
341
+ ...request,
342
+ page: ctx.pageParam.page,
343
+ },
344
+ mergedOptions,
345
+ ));
346
+ },
347
+ };
348
+ }
349
+
350
+ export function queryKeyZonesListOrSearchSecurityZones(
351
+ parameters: {
352
+ sort?: string | null | undefined;
353
+ desc?: components.Desc | undefined;
354
+ page?: number | undefined;
355
+ itemsPerPage?: number | undefined;
356
+ latitude?: number | undefined;
357
+ longitude?: number | undefined;
358
+ nameLike?: string | undefined;
359
+ contactId?: number | undefined;
360
+ facilityId?: number | undefined;
361
+ greenLocationId?: number | undefined;
362
+ },
363
+ ): QueryKey {
364
+ return [
365
+ "@greensecurity/javascript-sdk",
366
+ "zones",
367
+ "listOrSearchSecurityZones",
368
+ parameters,
369
+ ];
370
+ }
package/src/sdk/sdk.ts CHANGED
@@ -10,6 +10,7 @@ import { Users } from "./users.js";
10
10
  import { Vendors } from "./vendors.js";
11
11
  import { VendorScans } from "./vendorscans.js";
12
12
  import { Webhooks } from "./webhooks.js";
13
+ import { Zones } from "./zones.js";
13
14
 
14
15
  export class GreenSecurity extends ClientSDK {
15
16
  private _vendors?: Vendors;
@@ -46,4 +47,9 @@ export class GreenSecurity extends ClientSDK {
46
47
  get companies(): Companies {
47
48
  return (this._companies ??= new Companies(this._options));
48
49
  }
50
+
51
+ private _zones?: Zones;
52
+ get zones(): Zones {
53
+ return (this._zones ??= new Zones(this._options));
54
+ }
49
55
  }