@greensecurity/javascript-sdk 0.30.35 → 0.30.39

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 (197) hide show
  1. package/README.md +9 -0
  2. package/bin/mcp-server.js +1037 -16
  3. package/bin/mcp-server.js.map +18 -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 +64 -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/funcs/zonesSecurityZoneCheckin.d.ts +18 -0
  19. package/dist/commonjs/funcs/zonesSecurityZoneCheckin.d.ts.map +1 -0
  20. package/dist/commonjs/funcs/zonesSecurityZoneCheckin.js +116 -0
  21. package/dist/commonjs/funcs/zonesSecurityZoneCheckin.js.map +1 -0
  22. package/dist/commonjs/lib/config.d.ts +3 -3
  23. package/dist/commonjs/lib/config.js +3 -3
  24. package/dist/commonjs/lib/sdks.d.ts +3 -1
  25. package/dist/commonjs/lib/sdks.d.ts.map +1 -1
  26. package/dist/commonjs/lib/sdks.js +6 -11
  27. package/dist/commonjs/lib/sdks.js.map +1 -1
  28. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  29. package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
  30. package/dist/commonjs/mcp-server/server.js +5 -1
  31. package/dist/commonjs/mcp-server/server.js.map +1 -1
  32. package/dist/commonjs/mcp-server/tools/zonesListOrSearchSecurityZones.d.ts +8 -0
  33. package/dist/commonjs/mcp-server/tools/zonesListOrSearchSecurityZones.d.ts.map +1 -0
  34. package/dist/commonjs/mcp-server/tools/zonesListOrSearchSecurityZones.js +64 -0
  35. package/dist/commonjs/mcp-server/tools/zonesListOrSearchSecurityZones.js.map +1 -0
  36. package/dist/commonjs/mcp-server/tools/zonesSecurityZoneCheckin.d.ts +8 -0
  37. package/dist/commonjs/mcp-server/tools/zonesSecurityZoneCheckin.d.ts.map +1 -0
  38. package/dist/commonjs/mcp-server/tools/zonesSecurityZoneCheckin.js +64 -0
  39. package/dist/commonjs/mcp-server/tools/zonesSecurityZoneCheckin.js.map +1 -0
  40. package/dist/commonjs/models/components/handoff.d.ts +50 -0
  41. package/dist/commonjs/models/components/handoff.d.ts.map +1 -0
  42. package/dist/commonjs/models/components/handoff.js +101 -0
  43. package/dist/commonjs/models/components/handoff.js.map +1 -0
  44. package/dist/commonjs/models/components/index.d.ts +3 -0
  45. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  46. package/dist/commonjs/models/components/index.js +3 -0
  47. package/dist/commonjs/models/components/index.js.map +1 -1
  48. package/dist/commonjs/models/components/zone.d.ts +354 -0
  49. package/dist/commonjs/models/components/zone.d.ts.map +1 -0
  50. package/dist/commonjs/models/components/zone.js +538 -0
  51. package/dist/commonjs/models/components/zone.js.map +1 -0
  52. package/dist/commonjs/models/components/zoneconfig.d.ts +298 -0
  53. package/dist/commonjs/models/components/zoneconfig.d.ts.map +1 -0
  54. package/dist/commonjs/models/components/zoneconfig.js +454 -0
  55. package/dist/commonjs/models/components/zoneconfig.js.map +1 -0
  56. package/dist/commonjs/models/operations/index.d.ts +2 -0
  57. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  58. package/dist/commonjs/models/operations/index.js +2 -0
  59. package/dist/commonjs/models/operations/index.js.map +1 -1
  60. package/dist/commonjs/models/operations/listorsearchsecurityzones.d.ts +136 -0
  61. package/dist/commonjs/models/operations/listorsearchsecurityzones.d.ts.map +1 -0
  62. package/dist/commonjs/models/operations/listorsearchsecurityzones.js +169 -0
  63. package/dist/commonjs/models/operations/listorsearchsecurityzones.js.map +1 -0
  64. package/dist/commonjs/models/operations/securityzonecheckin.d.ts +85 -0
  65. package/dist/commonjs/models/operations/securityzonecheckin.d.ts.map +1 -0
  66. package/dist/commonjs/models/operations/securityzonecheckin.js +147 -0
  67. package/dist/commonjs/models/operations/securityzonecheckin.js.map +1 -0
  68. package/dist/commonjs/react-query/index.d.ts +2 -0
  69. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  70. package/dist/commonjs/react-query/index.js +2 -0
  71. package/dist/commonjs/react-query/index.js.map +1 -1
  72. package/dist/commonjs/react-query/zonesListOrSearchSecurityZones.d.ts +93 -0
  73. package/dist/commonjs/react-query/zonesListOrSearchSecurityZones.d.ts.map +1 -0
  74. package/dist/commonjs/react-query/zonesListOrSearchSecurityZones.js +171 -0
  75. package/dist/commonjs/react-query/zonesListOrSearchSecurityZones.js.map +1 -0
  76. package/dist/commonjs/react-query/zonesSecurityZoneCheckin.d.ts +24 -0
  77. package/dist/commonjs/react-query/zonesSecurityZoneCheckin.d.ts.map +1 -0
  78. package/dist/commonjs/react-query/zonesSecurityZoneCheckin.js +47 -0
  79. package/dist/commonjs/react-query/zonesSecurityZoneCheckin.js.map +1 -0
  80. package/dist/commonjs/sdk/sdk.d.ts +3 -0
  81. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  82. package/dist/commonjs/sdk/sdk.js +4 -0
  83. package/dist/commonjs/sdk/sdk.js.map +1 -1
  84. package/dist/commonjs/sdk/zones.d.ts +23 -0
  85. package/dist/commonjs/sdk/zones.d.ts.map +1 -0
  86. package/dist/commonjs/sdk/zones.js +33 -0
  87. package/dist/commonjs/sdk/zones.js.map +1 -0
  88. package/dist/esm/__tests__/vendormanagedbycompanies.test.js +1 -1
  89. package/dist/esm/__tests__/vendormanagedbycompanies.test.js.map +1 -1
  90. package/dist/esm/__tests__/vendors.test.js +1 -1
  91. package/dist/esm/__tests__/vendors.test.js.map +1 -1
  92. package/dist/esm/__tests__/webhooks.test.js +1 -1
  93. package/dist/esm/__tests__/webhooks.test.js.map +1 -1
  94. package/dist/esm/__tests__/zones.test.d.ts +2 -0
  95. package/dist/esm/__tests__/zones.test.d.ts.map +1 -0
  96. package/dist/esm/__tests__/zones.test.js +62 -0
  97. package/dist/esm/__tests__/zones.test.js.map +1 -0
  98. package/dist/esm/funcs/zonesListOrSearchSecurityZones.d.ts +20 -0
  99. package/dist/esm/funcs/zonesListOrSearchSecurityZones.d.ts.map +1 -0
  100. package/dist/esm/funcs/zonesListOrSearchSecurityZones.js +124 -0
  101. package/dist/esm/funcs/zonesListOrSearchSecurityZones.js.map +1 -0
  102. package/dist/esm/funcs/zonesSecurityZoneCheckin.d.ts +18 -0
  103. package/dist/esm/funcs/zonesSecurityZoneCheckin.d.ts.map +1 -0
  104. package/dist/esm/funcs/zonesSecurityZoneCheckin.js +80 -0
  105. package/dist/esm/funcs/zonesSecurityZoneCheckin.js.map +1 -0
  106. package/dist/esm/lib/config.d.ts +3 -3
  107. package/dist/esm/lib/config.js +3 -3
  108. package/dist/esm/lib/sdks.d.ts +3 -1
  109. package/dist/esm/lib/sdks.d.ts.map +1 -1
  110. package/dist/esm/lib/sdks.js +6 -11
  111. package/dist/esm/lib/sdks.js.map +1 -1
  112. package/dist/esm/mcp-server/mcp-server.js +1 -1
  113. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  114. package/dist/esm/mcp-server/server.js +5 -1
  115. package/dist/esm/mcp-server/server.js.map +1 -1
  116. package/dist/esm/mcp-server/tools/zonesListOrSearchSecurityZones.d.ts +8 -0
  117. package/dist/esm/mcp-server/tools/zonesListOrSearchSecurityZones.d.ts.map +1 -0
  118. package/dist/esm/mcp-server/tools/zonesListOrSearchSecurityZones.js +28 -0
  119. package/dist/esm/mcp-server/tools/zonesListOrSearchSecurityZones.js.map +1 -0
  120. package/dist/esm/mcp-server/tools/zonesSecurityZoneCheckin.d.ts +8 -0
  121. package/dist/esm/mcp-server/tools/zonesSecurityZoneCheckin.d.ts.map +1 -0
  122. package/dist/esm/mcp-server/tools/zonesSecurityZoneCheckin.js +28 -0
  123. package/dist/esm/mcp-server/tools/zonesSecurityZoneCheckin.js.map +1 -0
  124. package/dist/esm/models/components/handoff.d.ts +50 -0
  125. package/dist/esm/models/components/handoff.d.ts.map +1 -0
  126. package/dist/esm/models/components/handoff.js +63 -0
  127. package/dist/esm/models/components/handoff.js.map +1 -0
  128. package/dist/esm/models/components/index.d.ts +3 -0
  129. package/dist/esm/models/components/index.d.ts.map +1 -1
  130. package/dist/esm/models/components/index.js +3 -0
  131. package/dist/esm/models/components/index.js.map +1 -1
  132. package/dist/esm/models/components/zone.d.ts +354 -0
  133. package/dist/esm/models/components/zone.d.ts.map +1 -0
  134. package/dist/esm/models/components/zone.js +482 -0
  135. package/dist/esm/models/components/zone.js.map +1 -0
  136. package/dist/esm/models/components/zoneconfig.d.ts +298 -0
  137. package/dist/esm/models/components/zoneconfig.d.ts.map +1 -0
  138. package/dist/esm/models/components/zoneconfig.js +400 -0
  139. package/dist/esm/models/components/zoneconfig.js.map +1 -0
  140. package/dist/esm/models/operations/index.d.ts +2 -0
  141. package/dist/esm/models/operations/index.d.ts.map +1 -1
  142. package/dist/esm/models/operations/index.js +2 -0
  143. package/dist/esm/models/operations/index.js.map +1 -1
  144. package/dist/esm/models/operations/listorsearchsecurityzones.d.ts +136 -0
  145. package/dist/esm/models/operations/listorsearchsecurityzones.d.ts.map +1 -0
  146. package/dist/esm/models/operations/listorsearchsecurityzones.js +127 -0
  147. package/dist/esm/models/operations/listorsearchsecurityzones.js.map +1 -0
  148. package/dist/esm/models/operations/securityzonecheckin.d.ts +85 -0
  149. package/dist/esm/models/operations/securityzonecheckin.d.ts.map +1 -0
  150. package/dist/esm/models/operations/securityzonecheckin.js +105 -0
  151. package/dist/esm/models/operations/securityzonecheckin.js.map +1 -0
  152. package/dist/esm/react-query/index.d.ts +2 -0
  153. package/dist/esm/react-query/index.d.ts.map +1 -1
  154. package/dist/esm/react-query/index.js +2 -0
  155. package/dist/esm/react-query/index.js.map +1 -1
  156. package/dist/esm/react-query/zonesListOrSearchSecurityZones.d.ts +93 -0
  157. package/dist/esm/react-query/zonesListOrSearchSecurityZones.d.ts.map +1 -0
  158. package/dist/esm/react-query/zonesListOrSearchSecurityZones.js +158 -0
  159. package/dist/esm/react-query/zonesListOrSearchSecurityZones.js.map +1 -0
  160. package/dist/esm/react-query/zonesSecurityZoneCheckin.d.ts +24 -0
  161. package/dist/esm/react-query/zonesSecurityZoneCheckin.d.ts.map +1 -0
  162. package/dist/esm/react-query/zonesSecurityZoneCheckin.js +42 -0
  163. package/dist/esm/react-query/zonesSecurityZoneCheckin.js.map +1 -0
  164. package/dist/esm/sdk/sdk.d.ts +3 -0
  165. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  166. package/dist/esm/sdk/sdk.js +4 -0
  167. package/dist/esm/sdk/sdk.js.map +1 -1
  168. package/dist/esm/sdk/zones.d.ts +23 -0
  169. package/dist/esm/sdk/zones.d.ts.map +1 -0
  170. package/dist/esm/sdk/zones.js +29 -0
  171. package/dist/esm/sdk/zones.js.map +1 -0
  172. package/jsr.json +1 -1
  173. package/package.json +1 -1
  174. package/src/__tests__/vendormanagedbycompanies.test.ts +1 -1
  175. package/src/__tests__/vendors.test.ts +1 -1
  176. package/src/__tests__/webhooks.test.ts +1 -1
  177. package/src/__tests__/zones.test.ts +68 -0
  178. package/src/funcs/zonesListOrSearchSecurityZones.ts +246 -0
  179. package/src/funcs/zonesSecurityZoneCheckin.ts +168 -0
  180. package/src/lib/config.ts +3 -3
  181. package/src/lib/sdks.ts +11 -11
  182. package/src/mcp-server/mcp-server.ts +1 -1
  183. package/src/mcp-server/server.ts +5 -1
  184. package/src/mcp-server/tools/zonesListOrSearchSecurityZones.ts +38 -0
  185. package/src/mcp-server/tools/zonesSecurityZoneCheckin.ts +37 -0
  186. package/src/models/components/handoff.ts +116 -0
  187. package/src/models/components/index.ts +3 -0
  188. package/src/models/components/zone.ts +907 -0
  189. package/src/models/components/zoneconfig.ts +761 -0
  190. package/src/models/operations/index.ts +2 -0
  191. package/src/models/operations/listorsearchsecurityzones.ts +294 -0
  192. package/src/models/operations/securityzonecheckin.ts +192 -0
  193. package/src/react-query/index.ts +2 -0
  194. package/src/react-query/zonesListOrSearchSecurityZones.ts +370 -0
  195. package/src/react-query/zonesSecurityZoneCheckin.ts +89 -0
  196. package/src/sdk/sdk.ts +6 -0
  197. package/src/sdk/zones.ts +49 -0
@@ -0,0 +1,168 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { GreenSecurityCore } from "../core.js";
6
+ import { encodeJSON } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { RequestOptions } from "../lib/sdks.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import * as components from "../models/components/index.js";
14
+ import { APIError } from "../models/errors/apierror.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/httpclienterrors.js";
22
+ import * as errors from "../models/errors/index.js";
23
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
24
+ import * as operations from "../models/operations/index.js";
25
+ import { APICall, APIPromise } from "../types/async.js";
26
+ import { Result } from "../types/fp.js";
27
+
28
+ /**
29
+ * Security zone checkin request
30
+ *
31
+ * @remarks
32
+ * It will create a handoff record in the db for security zone check in request
33
+ */
34
+ export function zonesSecurityZoneCheckin(
35
+ client: GreenSecurityCore,
36
+ request: operations.SecurityZoneCheckinRequestBody,
37
+ options?: RequestOptions,
38
+ ): APIPromise<
39
+ Result<
40
+ components.Handoff,
41
+ | errors.ApiErrorResponse
42
+ | errors.ApiErrorResponse
43
+ | APIError
44
+ | SDKValidationError
45
+ | UnexpectedClientError
46
+ | InvalidRequestError
47
+ | RequestAbortedError
48
+ | RequestTimeoutError
49
+ | ConnectionError
50
+ >
51
+ > {
52
+ return new APIPromise($do(
53
+ client,
54
+ request,
55
+ options,
56
+ ));
57
+ }
58
+
59
+ async function $do(
60
+ client: GreenSecurityCore,
61
+ request: operations.SecurityZoneCheckinRequestBody,
62
+ options?: RequestOptions,
63
+ ): Promise<
64
+ [
65
+ Result<
66
+ components.Handoff,
67
+ | errors.ApiErrorResponse
68
+ | errors.ApiErrorResponse
69
+ | APIError
70
+ | SDKValidationError
71
+ | UnexpectedClientError
72
+ | InvalidRequestError
73
+ | RequestAbortedError
74
+ | RequestTimeoutError
75
+ | ConnectionError
76
+ >,
77
+ APICall,
78
+ ]
79
+ > {
80
+ const parsed = safeParse(
81
+ request,
82
+ (value) =>
83
+ operations.SecurityZoneCheckinRequestBody$outboundSchema.parse(value),
84
+ "Input validation failed",
85
+ );
86
+ if (!parsed.ok) {
87
+ return [parsed, { status: "invalid" }];
88
+ }
89
+ const payload = parsed.value;
90
+ const body = encodeJSON("body", payload, { explode: true });
91
+
92
+ const path = pathToFunc("/security_zones/checkin_request")();
93
+
94
+ const headers = new Headers(compactMap({
95
+ "Content-Type": "application/json",
96
+ Accept: "application/json",
97
+ }));
98
+
99
+ const securityInput = await extractSecurity(client._options.security);
100
+ const requestSecurity = resolveGlobalSecurity(securityInput);
101
+
102
+ const context = {
103
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
104
+ operationID: "securityZoneCheckin",
105
+ oAuth2Scopes: [],
106
+
107
+ resolvedSecurity: requestSecurity,
108
+
109
+ securitySource: client._options.security,
110
+ retryConfig: options?.retries
111
+ || client._options.retryConfig
112
+ || { strategy: "none" },
113
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
114
+ };
115
+
116
+ const requestRes = client._createRequest(context, {
117
+ security: requestSecurity,
118
+ method: "POST",
119
+ baseURL: options?.serverURL,
120
+ path: path,
121
+ headers: headers,
122
+ body: body,
123
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
124
+ }, options);
125
+ if (!requestRes.ok) {
126
+ return [requestRes, { status: "invalid" }];
127
+ }
128
+ const req = requestRes.value;
129
+
130
+ const doResult = await client._do(req, {
131
+ context,
132
+ errorCodes: ["400", "401", "403", "404", "4XX", "500", "5XX"],
133
+ retryConfig: context.retryConfig,
134
+ retryCodes: context.retryCodes,
135
+ });
136
+ if (!doResult.ok) {
137
+ return [doResult, { status: "request-error", request: req }];
138
+ }
139
+ const response = doResult.value;
140
+
141
+ const responseFields = {
142
+ HttpMeta: { Response: response, Request: req },
143
+ };
144
+
145
+ const [result] = await M.match<
146
+ components.Handoff,
147
+ | errors.ApiErrorResponse
148
+ | errors.ApiErrorResponse
149
+ | APIError
150
+ | SDKValidationError
151
+ | UnexpectedClientError
152
+ | InvalidRequestError
153
+ | RequestAbortedError
154
+ | RequestTimeoutError
155
+ | ConnectionError
156
+ >(
157
+ M.json(200, components.Handoff$inboundSchema),
158
+ M.jsonErr([400, 401, 403, 404], errors.ApiErrorResponse$inboundSchema),
159
+ M.jsonErr(500, errors.ApiErrorResponse$inboundSchema),
160
+ M.fail("4XX"),
161
+ M.fail("5XX"),
162
+ )(response, { extraFields: responseFields });
163
+ if (!result.ok) {
164
+ return [result, { status: "complete", request: req, response }];
165
+ }
166
+
167
+ return [result, { status: "complete", request: req, response }];
168
+ }
package/src/lib/config.ts CHANGED
@@ -72,8 +72,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
72
72
  export const SDK_METADATA = {
73
73
  language: "typescript",
74
74
  openapiDocVersion: "0.0.3",
75
- sdkVersion: "0.30.35",
76
- genVersion: "2.593.3",
75
+ sdkVersion: "0.30.39",
76
+ genVersion: "2.597.9",
77
77
  userAgent:
78
- "speakeasy-sdk/typescript 0.30.35 2.593.3 0.0.3 @greensecurity/javascript-sdk",
78
+ "speakeasy-sdk/typescript 0.30.39 2.597.9 0.0.3 @greensecurity/javascript-sdk",
79
79
  } as const;
package/src/lib/sdks.ts CHANGED
@@ -47,12 +47,14 @@ export type RequestOptions = {
47
47
  */
48
48
  serverURL?: string | URL;
49
49
  /**
50
+ * @deprecated `fetchOptions` has been flattened into `RequestOptions`.
51
+ *
50
52
  * Sets various request options on the `fetch` call made by an SDK method.
51
53
  *
52
54
  * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options|Request}
53
55
  */
54
56
  fetchOptions?: Omit<RequestInit, "method" | "body">;
55
- };
57
+ } & Omit<RequestInit, "method" | "body">;
56
58
 
57
59
  type RequestConfig = {
58
60
  method: string;
@@ -172,7 +174,9 @@ export class ClientSDK {
172
174
  cookie = cookie.startsWith("; ") ? cookie.slice(2) : cookie;
173
175
  headers.set("cookie", cookie);
174
176
 
175
- const userHeaders = new Headers(options?.fetchOptions?.headers);
177
+ const userHeaders = new Headers(
178
+ options?.headers ?? options?.fetchOptions?.headers,
179
+ );
176
180
  for (const [k, v] of userHeaders) {
177
181
  headers.set(k, v);
178
182
  }
@@ -183,20 +187,16 @@ export class ClientSDK {
183
187
  headers.set(conf.uaHeader ?? "user-agent", SDK_METADATA.userAgent);
184
188
  }
185
189
 
186
- let fetchOptions = options?.fetchOptions;
190
+ const fetchOptions: Omit<RequestInit, "method" | "body"> = {
191
+ ...options?.fetchOptions,
192
+ ...options,
193
+ };
187
194
  if (!fetchOptions?.signal && conf.timeoutMs && conf.timeoutMs > 0) {
188
195
  const timeoutSignal = AbortSignal.timeout(conf.timeoutMs);
189
- if (!fetchOptions) {
190
- fetchOptions = { signal: timeoutSignal };
191
- } else {
192
- fetchOptions.signal = timeoutSignal;
193
- }
196
+ fetchOptions.signal = timeoutSignal;
194
197
  }
195
198
 
196
199
  if (conf.body instanceof ReadableStream) {
197
- if (!fetchOptions) {
198
- fetchOptions = {};
199
- }
200
200
  Object.assign(fetchOptions, { duplex: "half" });
201
201
  }
202
202
 
@@ -19,7 +19,7 @@ const routes = buildRouteMap({
19
19
  export const app = buildApplication(routes, {
20
20
  name: "mcp",
21
21
  versionInfo: {
22
- currentVersion: "0.30.35",
22
+ currentVersion: "0.30.39",
23
23
  },
24
24
  });
25
25
 
@@ -48,6 +48,8 @@ import { tool$vendorsUpdateVendorManagedByCompany } from "./tools/vendorsUpdateV
48
48
  import { tool$vendorsUpdateVendorScrubDetails } from "./tools/vendorsUpdateVendorScrubDetails.js";
49
49
  import { tool$webhooksGetWebhookEndpoint } from "./tools/webhooksGetWebhookEndpoint.js";
50
50
  import { tool$webhooksListAllWebhookEndpoints } from "./tools/webhooksListAllWebhookEndpoints.js";
51
+ import { tool$zonesListOrSearchSecurityZones } from "./tools/zonesListOrSearchSecurityZones.js";
52
+ import { tool$zonesSecurityZoneCheckin } from "./tools/zonesSecurityZoneCheckin.js";
51
53
 
52
54
  export function createMCPServer(deps: {
53
55
  logger: ConsoleLogger;
@@ -59,7 +61,7 @@ export function createMCPServer(deps: {
59
61
  }) {
60
62
  const server = new McpServer({
61
63
  name: "GreenSecurity",
62
- version: "0.30.35",
64
+ version: "0.30.39",
63
65
  });
64
66
 
65
67
  const client = new GreenSecurityCore({
@@ -124,6 +126,8 @@ export function createMCPServer(deps: {
124
126
  tool(tool$webhooksGetWebhookEndpoint);
125
127
  tool(tool$vendorScansVendorScanOut);
126
128
  tool(tool$companiesListOrSearchCompanies);
129
+ tool(tool$zonesListOrSearchSecurityZones);
130
+ tool(tool$zonesSecurityZoneCheckin);
127
131
 
128
132
  return server;
129
133
  }
@@ -0,0 +1,38 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { zonesListOrSearchSecurityZones } from "../../funcs/zonesListOrSearchSecurityZones.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.ListOrSearchSecurityZonesRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$zonesListOrSearchSecurityZones: ToolDefinition<typeof args> =
14
+ {
15
+ name: "zones-list-or-search-security-zones",
16
+ description: `List or search security zones
17
+
18
+ List or search security zones`,
19
+ args,
20
+ tool: async (client, args, ctx) => {
21
+ const [result, apiCall] = await zonesListOrSearchSecurityZones(
22
+ client,
23
+ args.request,
24
+ { fetchOptions: { signal: ctx.signal } },
25
+ ).$inspect();
26
+
27
+ if (!result.ok) {
28
+ return {
29
+ content: [{ type: "text", text: result.error.message }],
30
+ isError: true,
31
+ };
32
+ }
33
+
34
+ const value = result.value.result;
35
+
36
+ return formatResult(value, apiCall);
37
+ },
38
+ };
@@ -0,0 +1,37 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { zonesSecurityZoneCheckin } from "../../funcs/zonesSecurityZoneCheckin.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.SecurityZoneCheckinRequestBody$inboundSchema,
11
+ };
12
+
13
+ export const tool$zonesSecurityZoneCheckin: ToolDefinition<typeof args> = {
14
+ name: "zones-security-zone-checkin",
15
+ description: `Security zone checkin request
16
+
17
+ It will create a handoff record in the db for security zone check in request`,
18
+ args,
19
+ tool: async (client, args, ctx) => {
20
+ const [result, apiCall] = await zonesSecurityZoneCheckin(
21
+ client,
22
+ args.request,
23
+ { fetchOptions: { signal: ctx.signal } },
24
+ ).$inspect();
25
+
26
+ if (!result.ok) {
27
+ return {
28
+ content: [{ type: "text", text: result.error.message }],
29
+ isError: true,
30
+ };
31
+ }
32
+
33
+ const value = result.value;
34
+
35
+ return formatResult(value, apiCall);
36
+ },
37
+ };
@@ -0,0 +1,116 @@
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
+ import {
11
+ Zone,
12
+ Zone$inboundSchema,
13
+ Zone$Outbound,
14
+ Zone$outboundSchema,
15
+ } from "./zone.js";
16
+
17
+ /**
18
+ * Reduced list of attributes of Handoff record
19
+ */
20
+ export type Handoff = {
21
+ id?: number | undefined;
22
+ /**
23
+ * Reduced list of attributes of Zone record
24
+ */
25
+ zone?: Zone | undefined;
26
+ qrCode?: string | null | undefined;
27
+ dateCreated?: string | null | undefined;
28
+ dateReceived?: string | null | undefined;
29
+ dateCompleted?: string | null | undefined;
30
+ status?: string | null | undefined;
31
+ gpsCheckin?: boolean | undefined;
32
+ };
33
+
34
+ /** @internal */
35
+ export const Handoff$inboundSchema: z.ZodType<Handoff, z.ZodTypeDef, unknown> =
36
+ z.object({
37
+ id: z.number().int().optional(),
38
+ zone: Zone$inboundSchema.optional(),
39
+ qr_code: z.nullable(z.string()).optional(),
40
+ date_created: z.nullable(z.string()).optional(),
41
+ date_received: z.nullable(z.string()).optional(),
42
+ date_completed: z.nullable(z.string()).optional(),
43
+ status: z.nullable(z.string()).optional(),
44
+ gps_checkin: z.boolean().optional(),
45
+ }).transform((v) => {
46
+ return remap$(v, {
47
+ "qr_code": "qrCode",
48
+ "date_created": "dateCreated",
49
+ "date_received": "dateReceived",
50
+ "date_completed": "dateCompleted",
51
+ "gps_checkin": "gpsCheckin",
52
+ });
53
+ });
54
+
55
+ /** @internal */
56
+ export type Handoff$Outbound = {
57
+ id?: number | undefined;
58
+ zone?: Zone$Outbound | undefined;
59
+ qr_code?: string | null | undefined;
60
+ date_created?: string | null | undefined;
61
+ date_received?: string | null | undefined;
62
+ date_completed?: string | null | undefined;
63
+ status?: string | null | undefined;
64
+ gps_checkin?: boolean | undefined;
65
+ };
66
+
67
+ /** @internal */
68
+ export const Handoff$outboundSchema: z.ZodType<
69
+ Handoff$Outbound,
70
+ z.ZodTypeDef,
71
+ Handoff
72
+ > = z.object({
73
+ id: z.number().int().optional(),
74
+ zone: Zone$outboundSchema.optional(),
75
+ qrCode: z.nullable(z.string()).optional(),
76
+ dateCreated: z.nullable(z.string()).optional(),
77
+ dateReceived: z.nullable(z.string()).optional(),
78
+ dateCompleted: z.nullable(z.string()).optional(),
79
+ status: z.nullable(z.string()).optional(),
80
+ gpsCheckin: z.boolean().optional(),
81
+ }).transform((v) => {
82
+ return remap$(v, {
83
+ qrCode: "qr_code",
84
+ dateCreated: "date_created",
85
+ dateReceived: "date_received",
86
+ dateCompleted: "date_completed",
87
+ gpsCheckin: "gps_checkin",
88
+ });
89
+ });
90
+
91
+ /**
92
+ * @internal
93
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
94
+ */
95
+ export namespace Handoff$ {
96
+ /** @deprecated use `Handoff$inboundSchema` instead. */
97
+ export const inboundSchema = Handoff$inboundSchema;
98
+ /** @deprecated use `Handoff$outboundSchema` instead. */
99
+ export const outboundSchema = Handoff$outboundSchema;
100
+ /** @deprecated use `Handoff$Outbound` instead. */
101
+ export type Outbound = Handoff$Outbound;
102
+ }
103
+
104
+ export function handoffToJSON(handoff: Handoff): string {
105
+ return JSON.stringify(Handoff$outboundSchema.parse(handoff));
106
+ }
107
+
108
+ export function handoffFromJSON(
109
+ jsonString: string,
110
+ ): SafeParseResult<Handoff, SDKValidationError> {
111
+ return safeParse(
112
+ jsonString,
113
+ (x) => Handoff$inboundSchema.parse(JSON.parse(x)),
114
+ `Failed to parse 'Handoff' from JSON`,
115
+ );
116
+ }
@@ -13,6 +13,7 @@ export * from "./desc.js";
13
13
  export * from "./expand.js";
14
14
  export * from "./facility.js";
15
15
  export * from "./facilitysummary.js";
16
+ export * from "./handoff.js";
16
17
  export * from "./imageset.js";
17
18
  export * from "./invoice.js";
18
19
  export * from "./invoiceitem.js";
@@ -45,3 +46,5 @@ export * from "./vendorscrubdetails.js";
45
46
  export * from "./vendorscrubpurchase.js";
46
47
  export * from "./vendortype.js";
47
48
  export * from "./webhookendpoint.js";
49
+ export * from "./zone.js";
50
+ export * from "./zoneconfig.js";