@greensecurity/javascript-sdk 0.43.1-beta.119 → 0.43.1-beta.122

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 (229) hide show
  1. package/README.md +9 -0
  2. package/dist/commonjs/__tests__/events.test.js +21 -0
  3. package/dist/commonjs/__tests__/events.test.js.map +1 -1
  4. package/dist/commonjs/__tests__/fhirconfigs.test.js +4 -0
  5. package/dist/commonjs/__tests__/fhirconfigs.test.js.map +1 -1
  6. package/dist/commonjs/__tests__/vendorscans.test.js +49 -0
  7. package/dist/commonjs/__tests__/vendorscans.test.js.map +1 -1
  8. package/dist/commonjs/__tests__/zones.test.js +3 -29
  9. package/dist/commonjs/__tests__/zones.test.js.map +1 -1
  10. package/dist/commonjs/funcs/eventsGetEvent.d.ts +26 -0
  11. package/dist/commonjs/funcs/eventsGetEvent.d.ts.map +1 -0
  12. package/dist/commonjs/funcs/eventsGetEvent.js +136 -0
  13. package/dist/commonjs/funcs/eventsGetEvent.js.map +1 -0
  14. package/dist/commonjs/funcs/systemsListSystems.js +2 -0
  15. package/dist/commonjs/funcs/systemsListSystems.js.map +1 -1
  16. package/dist/commonjs/funcs/vendorScansGetVendorScan.d.ts +28 -0
  17. package/dist/commonjs/funcs/vendorScansGetVendorScan.d.ts.map +1 -0
  18. package/dist/commonjs/funcs/vendorScansGetVendorScan.js +138 -0
  19. package/dist/commonjs/funcs/vendorScansGetVendorScan.js.map +1 -0
  20. package/dist/commonjs/funcs/vendorScansListVendorScans.d.ts +23 -0
  21. package/dist/commonjs/funcs/vendorScansListVendorScans.d.ts.map +1 -0
  22. package/dist/commonjs/funcs/vendorScansListVendorScans.js +165 -0
  23. package/dist/commonjs/funcs/vendorScansListVendorScans.js.map +1 -0
  24. package/dist/commonjs/lib/config.d.ts +3 -3
  25. package/dist/commonjs/lib/config.js +3 -3
  26. package/dist/commonjs/models/components/fhirconfig.d.ts +8 -0
  27. package/dist/commonjs/models/components/fhirconfig.d.ts.map +1 -1
  28. package/dist/commonjs/models/components/fhirconfig.js +4 -0
  29. package/dist/commonjs/models/components/fhirconfig.js.map +1 -1
  30. package/dist/commonjs/models/components/fhirconfigpartialupdate.d.ts +10 -0
  31. package/dist/commonjs/models/components/fhirconfigpartialupdate.d.ts.map +1 -1
  32. package/dist/commonjs/models/components/fhirconfigpartialupdate.js +4 -0
  33. package/dist/commonjs/models/components/fhirconfigpartialupdate.js.map +1 -1
  34. package/dist/commonjs/models/components/vendorscan.d.ts +5 -0
  35. package/dist/commonjs/models/components/vendorscan.d.ts.map +1 -1
  36. package/dist/commonjs/models/components/vendorscan.js +4 -0
  37. package/dist/commonjs/models/components/vendorscan.js.map +1 -1
  38. package/dist/commonjs/models/operations/getevent.d.ts +110 -0
  39. package/dist/commonjs/models/operations/getevent.d.ts.map +1 -0
  40. package/dist/commonjs/models/operations/getevent.js +128 -0
  41. package/dist/commonjs/models/operations/getevent.js.map +1 -0
  42. package/dist/commonjs/models/operations/getvendorscan.d.ts +21 -0
  43. package/dist/commonjs/models/operations/getvendorscan.d.ts.map +1 -0
  44. package/dist/commonjs/models/operations/getvendorscan.js +52 -0
  45. package/dist/commonjs/models/operations/getvendorscan.js.map +1 -0
  46. package/dist/commonjs/models/operations/index.d.ts +3 -0
  47. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  48. package/dist/commonjs/models/operations/index.js +3 -0
  49. package/dist/commonjs/models/operations/index.js.map +1 -1
  50. package/dist/commonjs/models/operations/listsystems.d.ts +10 -0
  51. package/dist/commonjs/models/operations/listsystems.d.ts.map +1 -1
  52. package/dist/commonjs/models/operations/listsystems.js +4 -0
  53. package/dist/commonjs/models/operations/listsystems.js.map +1 -1
  54. package/dist/commonjs/models/operations/listvendorscans.d.ts +92 -0
  55. package/dist/commonjs/models/operations/listvendorscans.d.ts.map +1 -0
  56. package/dist/commonjs/models/operations/listvendorscans.js +103 -0
  57. package/dist/commonjs/models/operations/listvendorscans.js.map +1 -0
  58. package/dist/commonjs/react-query/eventsGetEvent.core.d.ts +15 -0
  59. package/dist/commonjs/react-query/eventsGetEvent.core.d.ts.map +1 -0
  60. package/dist/commonjs/react-query/eventsGetEvent.core.js +41 -0
  61. package/dist/commonjs/react-query/eventsGetEvent.core.js.map +1 -0
  62. package/dist/commonjs/react-query/eventsGetEvent.d.ts +52 -0
  63. package/dist/commonjs/react-query/eventsGetEvent.d.ts.map +1 -0
  64. package/dist/commonjs/react-query/eventsGetEvent.js +78 -0
  65. package/dist/commonjs/react-query/eventsGetEvent.js.map +1 -0
  66. package/dist/commonjs/react-query/index.d.ts +3 -0
  67. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  68. package/dist/commonjs/react-query/index.js +3 -0
  69. package/dist/commonjs/react-query/index.js.map +1 -1
  70. package/dist/commonjs/react-query/systemsListSystems.core.d.ts +4 -0
  71. package/dist/commonjs/react-query/systemsListSystems.core.d.ts.map +1 -1
  72. package/dist/commonjs/react-query/systemsListSystems.core.js +4 -0
  73. package/dist/commonjs/react-query/systemsListSystems.core.js.map +1 -1
  74. package/dist/commonjs/react-query/systemsListSystems.d.ts +4 -0
  75. package/dist/commonjs/react-query/systemsListSystems.d.ts.map +1 -1
  76. package/dist/commonjs/react-query/systemsListSystems.js.map +1 -1
  77. package/dist/commonjs/react-query/vendorScansGetVendorScan.core.d.ts +15 -0
  78. package/dist/commonjs/react-query/vendorScansGetVendorScan.core.d.ts.map +1 -0
  79. package/dist/commonjs/react-query/vendorScansGetVendorScan.core.js +43 -0
  80. package/dist/commonjs/react-query/vendorScansGetVendorScan.core.js.map +1 -0
  81. package/dist/commonjs/react-query/vendorScansGetVendorScan.d.ts +54 -0
  82. package/dist/commonjs/react-query/vendorScansGetVendorScan.d.ts.map +1 -0
  83. package/dist/commonjs/react-query/vendorScansGetVendorScan.js +84 -0
  84. package/dist/commonjs/react-query/vendorScansGetVendorScan.js.map +1 -0
  85. package/dist/commonjs/react-query/vendorScansListVendorScans.core.d.ts +46 -0
  86. package/dist/commonjs/react-query/vendorScansListVendorScans.core.d.ts.map +1 -0
  87. package/dist/commonjs/react-query/vendorScansListVendorScans.core.js +102 -0
  88. package/dist/commonjs/react-query/vendorScansListVendorScans.core.js.map +1 -0
  89. package/dist/commonjs/react-query/vendorScansListVendorScans.d.ts +68 -0
  90. package/dist/commonjs/react-query/vendorScansListVendorScans.d.ts.map +1 -0
  91. package/dist/commonjs/react-query/vendorScansListVendorScans.js +105 -0
  92. package/dist/commonjs/react-query/vendorScansListVendorScans.js.map +1 -0
  93. package/dist/commonjs/sdk/events.d.ts +13 -0
  94. package/dist/commonjs/sdk/events.d.ts.map +1 -1
  95. package/dist/commonjs/sdk/events.js +16 -0
  96. package/dist/commonjs/sdk/events.js.map +1 -1
  97. package/dist/commonjs/sdk/vendorscans.d.ts +25 -0
  98. package/dist/commonjs/sdk/vendorscans.d.ts.map +1 -1
  99. package/dist/commonjs/sdk/vendorscans.js +28 -0
  100. package/dist/commonjs/sdk/vendorscans.js.map +1 -1
  101. package/dist/esm/__tests__/events.test.js +21 -0
  102. package/dist/esm/__tests__/events.test.js.map +1 -1
  103. package/dist/esm/__tests__/fhirconfigs.test.js +4 -0
  104. package/dist/esm/__tests__/fhirconfigs.test.js.map +1 -1
  105. package/dist/esm/__tests__/vendorscans.test.js +49 -0
  106. package/dist/esm/__tests__/vendorscans.test.js.map +1 -1
  107. package/dist/esm/__tests__/zones.test.js +3 -29
  108. package/dist/esm/__tests__/zones.test.js.map +1 -1
  109. package/dist/esm/funcs/eventsGetEvent.d.ts +26 -0
  110. package/dist/esm/funcs/eventsGetEvent.d.ts.map +1 -0
  111. package/dist/esm/funcs/eventsGetEvent.js +100 -0
  112. package/dist/esm/funcs/eventsGetEvent.js.map +1 -0
  113. package/dist/esm/funcs/systemsListSystems.js +2 -0
  114. package/dist/esm/funcs/systemsListSystems.js.map +1 -1
  115. package/dist/esm/funcs/vendorScansGetVendorScan.d.ts +28 -0
  116. package/dist/esm/funcs/vendorScansGetVendorScan.d.ts.map +1 -0
  117. package/dist/esm/funcs/vendorScansGetVendorScan.js +102 -0
  118. package/dist/esm/funcs/vendorScansGetVendorScan.js.map +1 -0
  119. package/dist/esm/funcs/vendorScansListVendorScans.d.ts +23 -0
  120. package/dist/esm/funcs/vendorScansListVendorScans.d.ts.map +1 -0
  121. package/dist/esm/funcs/vendorScansListVendorScans.js +129 -0
  122. package/dist/esm/funcs/vendorScansListVendorScans.js.map +1 -0
  123. package/dist/esm/lib/config.d.ts +3 -3
  124. package/dist/esm/lib/config.js +3 -3
  125. package/dist/esm/models/components/fhirconfig.d.ts +8 -0
  126. package/dist/esm/models/components/fhirconfig.d.ts.map +1 -1
  127. package/dist/esm/models/components/fhirconfig.js +4 -0
  128. package/dist/esm/models/components/fhirconfig.js.map +1 -1
  129. package/dist/esm/models/components/fhirconfigpartialupdate.d.ts +10 -0
  130. package/dist/esm/models/components/fhirconfigpartialupdate.d.ts.map +1 -1
  131. package/dist/esm/models/components/fhirconfigpartialupdate.js +4 -0
  132. package/dist/esm/models/components/fhirconfigpartialupdate.js.map +1 -1
  133. package/dist/esm/models/components/vendorscan.d.ts +5 -0
  134. package/dist/esm/models/components/vendorscan.d.ts.map +1 -1
  135. package/dist/esm/models/components/vendorscan.js +4 -0
  136. package/dist/esm/models/components/vendorscan.js.map +1 -1
  137. package/dist/esm/models/operations/getevent.d.ts +110 -0
  138. package/dist/esm/models/operations/getevent.d.ts.map +1 -0
  139. package/dist/esm/models/operations/getevent.js +85 -0
  140. package/dist/esm/models/operations/getevent.js.map +1 -0
  141. package/dist/esm/models/operations/getvendorscan.d.ts +21 -0
  142. package/dist/esm/models/operations/getvendorscan.d.ts.map +1 -0
  143. package/dist/esm/models/operations/getvendorscan.js +15 -0
  144. package/dist/esm/models/operations/getvendorscan.js.map +1 -0
  145. package/dist/esm/models/operations/index.d.ts +3 -0
  146. package/dist/esm/models/operations/index.d.ts.map +1 -1
  147. package/dist/esm/models/operations/index.js +3 -0
  148. package/dist/esm/models/operations/index.js.map +1 -1
  149. package/dist/esm/models/operations/listsystems.d.ts +10 -0
  150. package/dist/esm/models/operations/listsystems.d.ts.map +1 -1
  151. package/dist/esm/models/operations/listsystems.js +4 -0
  152. package/dist/esm/models/operations/listsystems.js.map +1 -1
  153. package/dist/esm/models/operations/listvendorscans.d.ts +92 -0
  154. package/dist/esm/models/operations/listvendorscans.d.ts.map +1 -0
  155. package/dist/esm/models/operations/listvendorscans.js +64 -0
  156. package/dist/esm/models/operations/listvendorscans.js.map +1 -0
  157. package/dist/esm/react-query/eventsGetEvent.core.d.ts +15 -0
  158. package/dist/esm/react-query/eventsGetEvent.core.d.ts.map +1 -0
  159. package/dist/esm/react-query/eventsGetEvent.core.js +36 -0
  160. package/dist/esm/react-query/eventsGetEvent.core.js.map +1 -0
  161. package/dist/esm/react-query/eventsGetEvent.d.ts +52 -0
  162. package/dist/esm/react-query/eventsGetEvent.d.ts.map +1 -0
  163. package/dist/esm/react-query/eventsGetEvent.js +68 -0
  164. package/dist/esm/react-query/eventsGetEvent.js.map +1 -0
  165. package/dist/esm/react-query/index.d.ts +3 -0
  166. package/dist/esm/react-query/index.d.ts.map +1 -1
  167. package/dist/esm/react-query/index.js +3 -0
  168. package/dist/esm/react-query/index.js.map +1 -1
  169. package/dist/esm/react-query/systemsListSystems.core.d.ts +4 -0
  170. package/dist/esm/react-query/systemsListSystems.core.d.ts.map +1 -1
  171. package/dist/esm/react-query/systemsListSystems.core.js +4 -0
  172. package/dist/esm/react-query/systemsListSystems.core.js.map +1 -1
  173. package/dist/esm/react-query/systemsListSystems.d.ts +4 -0
  174. package/dist/esm/react-query/systemsListSystems.d.ts.map +1 -1
  175. package/dist/esm/react-query/systemsListSystems.js.map +1 -1
  176. package/dist/esm/react-query/vendorScansGetVendorScan.core.d.ts +15 -0
  177. package/dist/esm/react-query/vendorScansGetVendorScan.core.d.ts.map +1 -0
  178. package/dist/esm/react-query/vendorScansGetVendorScan.core.js +38 -0
  179. package/dist/esm/react-query/vendorScansGetVendorScan.core.js.map +1 -0
  180. package/dist/esm/react-query/vendorScansGetVendorScan.d.ts +54 -0
  181. package/dist/esm/react-query/vendorScansGetVendorScan.d.ts.map +1 -0
  182. package/dist/esm/react-query/vendorScansGetVendorScan.js +74 -0
  183. package/dist/esm/react-query/vendorScansGetVendorScan.js.map +1 -0
  184. package/dist/esm/react-query/vendorScansListVendorScans.core.d.ts +46 -0
  185. package/dist/esm/react-query/vendorScansListVendorScans.core.d.ts.map +1 -0
  186. package/dist/esm/react-query/vendorScansListVendorScans.core.js +94 -0
  187. package/dist/esm/react-query/vendorScansListVendorScans.core.js.map +1 -0
  188. package/dist/esm/react-query/vendorScansListVendorScans.d.ts +68 -0
  189. package/dist/esm/react-query/vendorScansListVendorScans.d.ts.map +1 -0
  190. package/dist/esm/react-query/vendorScansListVendorScans.js +90 -0
  191. package/dist/esm/react-query/vendorScansListVendorScans.js.map +1 -0
  192. package/dist/esm/sdk/events.d.ts +13 -0
  193. package/dist/esm/sdk/events.d.ts.map +1 -1
  194. package/dist/esm/sdk/events.js +16 -0
  195. package/dist/esm/sdk/events.js.map +1 -1
  196. package/dist/esm/sdk/vendorscans.d.ts +25 -0
  197. package/dist/esm/sdk/vendorscans.d.ts.map +1 -1
  198. package/dist/esm/sdk/vendorscans.js +28 -0
  199. package/dist/esm/sdk/vendorscans.js.map +1 -1
  200. package/jsr.json +1 -1
  201. package/package.json +1 -1
  202. package/src/__tests__/events.test.ts +24 -0
  203. package/src/__tests__/fhirconfigs.test.ts +4 -0
  204. package/src/__tests__/vendorscans.test.ts +55 -0
  205. package/src/__tests__/zones.test.ts +3 -29
  206. package/src/funcs/eventsGetEvent.ts +189 -0
  207. package/src/funcs/systemsListSystems.ts +2 -0
  208. package/src/funcs/vendorScansGetVendorScan.ts +191 -0
  209. package/src/funcs/vendorScansListVendorScans.ts +256 -0
  210. package/src/lib/config.ts +3 -3
  211. package/src/models/components/fhirconfig.ts +12 -0
  212. package/src/models/components/fhirconfigpartialupdate.ts +14 -0
  213. package/src/models/components/vendorscan.ts +9 -0
  214. package/src/models/operations/getevent.ts +263 -0
  215. package/src/models/operations/getvendorscan.ts +42 -0
  216. package/src/models/operations/index.ts +3 -0
  217. package/src/models/operations/listsystems.ts +14 -0
  218. package/src/models/operations/listvendorscans.ts +174 -0
  219. package/src/react-query/eventsGetEvent.core.ts +79 -0
  220. package/src/react-query/eventsGetEvent.ts +153 -0
  221. package/src/react-query/index.ts +3 -0
  222. package/src/react-query/systemsListSystems.core.ts +8 -0
  223. package/src/react-query/systemsListSystems.ts +4 -0
  224. package/src/react-query/vendorScansGetVendorScan.core.ts +83 -0
  225. package/src/react-query/vendorScansGetVendorScan.ts +168 -0
  226. package/src/react-query/vendorScansListVendorScans.core.ts +210 -0
  227. package/src/react-query/vendorScansListVendorScans.ts +273 -0
  228. package/src/sdk/events.ts +24 -0
  229. package/src/sdk/vendorscans.ts +47 -0
@@ -0,0 +1,191 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 3d680fc5757f
4
+ */
5
+
6
+ import { GreenSecurityCore } from "../core.js";
7
+ import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
8
+ import { matchStatusCode } from "../lib/http.js";
9
+ import * as M from "../lib/matchers.js";
10
+ import { compactMap } from "../lib/primitives.js";
11
+ import { safeParse } from "../lib/schemas.js";
12
+ import { RequestOptions } from "../lib/sdks.js";
13
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
14
+ import { pathToFunc } from "../lib/url.js";
15
+ import * as components from "../models/components/index.js";
16
+ import { GreenSecurityError } from "../models/errors/greensecurityerror.js";
17
+ import {
18
+ ConnectionError,
19
+ InvalidRequestError,
20
+ RequestAbortedError,
21
+ RequestTimeoutError,
22
+ UnexpectedClientError,
23
+ } from "../models/errors/httpclienterrors.js";
24
+ import * as errors from "../models/errors/index.js";
25
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
26
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
27
+ import * as operations from "../models/operations/index.js";
28
+ import { APICall, APIPromise } from "../types/async.js";
29
+ import { Result } from "../types/fp.js";
30
+
31
+ /**
32
+ * Get a vendor scan by ID
33
+ *
34
+ * @remarks
35
+ * Retrieve a single vendor scan by ID.
36
+ *
37
+ * Available `expand` scopes are:
38
+ *
39
+ * - vendor_scan.vendor
40
+ * - vendor_scan.zone
41
+ * - vendor_scan.department
42
+ * - vendor_scan.badge_data
43
+ *
44
+ * If set, this operation will use {@link Security.bearerJwt} from the global security.
45
+ */
46
+ export function vendorScansGetVendorScan(
47
+ client: GreenSecurityCore,
48
+ request: operations.GetVendorScanRequest,
49
+ options?: RequestOptions,
50
+ ): APIPromise<
51
+ Result<
52
+ components.VendorScan,
53
+ | errors.ApiErrorResponse
54
+ | GreenSecurityError
55
+ | ResponseValidationError
56
+ | ConnectionError
57
+ | RequestAbortedError
58
+ | RequestTimeoutError
59
+ | InvalidRequestError
60
+ | UnexpectedClientError
61
+ | SDKValidationError
62
+ >
63
+ > {
64
+ return new APIPromise($do(
65
+ client,
66
+ request,
67
+ options,
68
+ ));
69
+ }
70
+
71
+ async function $do(
72
+ client: GreenSecurityCore,
73
+ request: operations.GetVendorScanRequest,
74
+ options?: RequestOptions,
75
+ ): Promise<
76
+ [
77
+ Result<
78
+ components.VendorScan,
79
+ | errors.ApiErrorResponse
80
+ | GreenSecurityError
81
+ | ResponseValidationError
82
+ | ConnectionError
83
+ | RequestAbortedError
84
+ | RequestTimeoutError
85
+ | InvalidRequestError
86
+ | UnexpectedClientError
87
+ | SDKValidationError
88
+ >,
89
+ APICall,
90
+ ]
91
+ > {
92
+ const parsed = safeParse(
93
+ request,
94
+ (value) => operations.GetVendorScanRequest$outboundSchema.parse(value),
95
+ "Input validation failed",
96
+ );
97
+ if (!parsed.ok) {
98
+ return [parsed, { status: "invalid" }];
99
+ }
100
+ const payload = parsed.value;
101
+ const body = null;
102
+
103
+ const pathParams = {
104
+ id: encodeSimple("id", payload.id, {
105
+ explode: false,
106
+ charEncoding: "percent",
107
+ }),
108
+ };
109
+ const path = pathToFunc("/vendor-scans/{id}")(pathParams);
110
+
111
+ const query = encodeFormQuery({
112
+ "expand": payload.expand,
113
+ }, { explode: false });
114
+
115
+ const headers = new Headers(compactMap({
116
+ Accept: "application/json",
117
+ }));
118
+
119
+ const securityInput = await extractSecurity(client._options.security);
120
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1]);
121
+
122
+ const context = {
123
+ options: client._options,
124
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
125
+ operationID: "getVendorScan",
126
+ oAuth2Scopes: null,
127
+
128
+ resolvedSecurity: requestSecurity,
129
+
130
+ securitySource: client._options.security,
131
+ retryConfig: options?.retries
132
+ || client._options.retryConfig
133
+ || { strategy: "none" },
134
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
135
+ };
136
+
137
+ const requestRes = client._createRequest(context, {
138
+ security: requestSecurity,
139
+ method: "GET",
140
+ baseURL: options?.serverURL,
141
+ path: path,
142
+ headers: headers,
143
+ query: query,
144
+ body: body,
145
+ userAgent: client._options.userAgent,
146
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
147
+ }, options);
148
+ if (!requestRes.ok) {
149
+ return [requestRes, { status: "invalid" }];
150
+ }
151
+ const req = requestRes.value;
152
+
153
+ const doResult = await client._do(req, {
154
+ context,
155
+ isErrorStatusCode: (statusCode: number) =>
156
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
157
+ retryConfig: context.retryConfig,
158
+ retryCodes: context.retryCodes,
159
+ });
160
+ if (!doResult.ok) {
161
+ return [doResult, { status: "request-error", request: req }];
162
+ }
163
+ const response = doResult.value;
164
+
165
+ const responseFields = {
166
+ HttpMeta: { Response: response, Request: req },
167
+ };
168
+
169
+ const [result] = await M.match<
170
+ components.VendorScan,
171
+ | errors.ApiErrorResponse
172
+ | GreenSecurityError
173
+ | ResponseValidationError
174
+ | ConnectionError
175
+ | RequestAbortedError
176
+ | RequestTimeoutError
177
+ | InvalidRequestError
178
+ | UnexpectedClientError
179
+ | SDKValidationError
180
+ >(
181
+ M.json(200, components.VendorScan$inboundSchema),
182
+ M.jsonErr([400, 401, 403, 404], errors.ApiErrorResponse$inboundSchema),
183
+ M.fail("4XX"),
184
+ M.fail([500, "5XX"]),
185
+ )(response, req, { extraFields: responseFields });
186
+ if (!result.ok) {
187
+ return [result, { status: "complete", request: req, response }];
188
+ }
189
+
190
+ return [result, { status: "complete", request: req, response }];
191
+ }
@@ -0,0 +1,256 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 05c7b69615fa
4
+ */
5
+
6
+ import { GreenSecurityCore } from "../core.js";
7
+ import { dlv } from "../lib/dlv.js";
8
+ import { encodeFormQuery } from "../lib/encodings.js";
9
+ import { matchStatusCode } from "../lib/http.js";
10
+ import * as M from "../lib/matchers.js";
11
+ import { compactMap } from "../lib/primitives.js";
12
+ import { safeParse } from "../lib/schemas.js";
13
+ import { RequestOptions } from "../lib/sdks.js";
14
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
15
+ import { pathToFunc } from "../lib/url.js";
16
+ import { GreenSecurityError } from "../models/errors/greensecurityerror.js";
17
+ import {
18
+ ConnectionError,
19
+ InvalidRequestError,
20
+ RequestAbortedError,
21
+ RequestTimeoutError,
22
+ UnexpectedClientError,
23
+ } from "../models/errors/httpclienterrors.js";
24
+ import * as errors from "../models/errors/index.js";
25
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
26
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
27
+ import * as operations from "../models/operations/index.js";
28
+ import { APICall, APIPromise } from "../types/async.js";
29
+ import { Result } from "../types/fp.js";
30
+ import {
31
+ createPageIterator,
32
+ haltIterator,
33
+ PageIterator,
34
+ Paginator,
35
+ } from "../types/operations.js";
36
+
37
+ /**
38
+ * List vendor scans
39
+ *
40
+ * @remarks
41
+ * List or search vendor scans.
42
+ *
43
+ * If set, this operation will use {@link Security.bearerJwt} from the global security.
44
+ */
45
+ export function vendorScansListVendorScans(
46
+ client: GreenSecurityCore,
47
+ request: operations.ListVendorScansRequest,
48
+ options?: RequestOptions,
49
+ ): APIPromise<
50
+ PageIterator<
51
+ Result<
52
+ operations.ListVendorScansResponse,
53
+ | errors.ApiErrorResponse
54
+ | GreenSecurityError
55
+ | ResponseValidationError
56
+ | ConnectionError
57
+ | RequestAbortedError
58
+ | RequestTimeoutError
59
+ | InvalidRequestError
60
+ | UnexpectedClientError
61
+ | SDKValidationError
62
+ >,
63
+ { page: number }
64
+ >
65
+ > {
66
+ return new APIPromise($do(
67
+ client,
68
+ request,
69
+ options,
70
+ ));
71
+ }
72
+
73
+ async function $do(
74
+ client: GreenSecurityCore,
75
+ request: operations.ListVendorScansRequest,
76
+ options?: RequestOptions,
77
+ ): Promise<
78
+ [
79
+ PageIterator<
80
+ Result<
81
+ operations.ListVendorScansResponse,
82
+ | errors.ApiErrorResponse
83
+ | GreenSecurityError
84
+ | ResponseValidationError
85
+ | ConnectionError
86
+ | RequestAbortedError
87
+ | RequestTimeoutError
88
+ | InvalidRequestError
89
+ | UnexpectedClientError
90
+ | SDKValidationError
91
+ >,
92
+ { page: number }
93
+ >,
94
+ APICall,
95
+ ]
96
+ > {
97
+ const parsed = safeParse(
98
+ request,
99
+ (value) => operations.ListVendorScansRequest$outboundSchema.parse(value),
100
+ "Input validation failed",
101
+ );
102
+ if (!parsed.ok) {
103
+ return [haltIterator(parsed), { status: "invalid" }];
104
+ }
105
+ const payload = parsed.value;
106
+ const body = null;
107
+
108
+ const path = pathToFunc("/vendor-scans")();
109
+
110
+ const query = encodeFormQuery({
111
+ "company_id": payload.company_id,
112
+ "desc": payload.desc,
113
+ "facility_id": payload.facility_id,
114
+ "items_per_page": payload.items_per_page,
115
+ "page": payload.page,
116
+ "scan_type": payload.scan_type,
117
+ "sort": payload.sort,
118
+ "system_id": payload.system_id,
119
+ "vendor_id": payload.vendor_id,
120
+ });
121
+
122
+ const headers = new Headers(compactMap({
123
+ Accept: "application/json",
124
+ }));
125
+
126
+ const securityInput = await extractSecurity(client._options.security);
127
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1]);
128
+
129
+ const context = {
130
+ options: client._options,
131
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
132
+ operationID: "listVendorScans",
133
+ oAuth2Scopes: null,
134
+
135
+ resolvedSecurity: requestSecurity,
136
+
137
+ securitySource: client._options.security,
138
+ retryConfig: options?.retries
139
+ || client._options.retryConfig
140
+ || { strategy: "none" },
141
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
142
+ };
143
+
144
+ const requestRes = client._createRequest(context, {
145
+ security: requestSecurity,
146
+ method: "GET",
147
+ baseURL: options?.serverURL,
148
+ path: path,
149
+ headers: headers,
150
+ query: query,
151
+ body: body,
152
+ userAgent: client._options.userAgent,
153
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
154
+ }, options);
155
+ if (!requestRes.ok) {
156
+ return [haltIterator(requestRes), { status: "invalid" }];
157
+ }
158
+ const req = requestRes.value;
159
+
160
+ const doResult = await client._do(req, {
161
+ context,
162
+ isErrorStatusCode: (statusCode: number) =>
163
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
164
+ retryConfig: context.retryConfig,
165
+ retryCodes: context.retryCodes,
166
+ });
167
+ if (!doResult.ok) {
168
+ return [haltIterator(doResult), { status: "request-error", request: req }];
169
+ }
170
+ const response = doResult.value;
171
+
172
+ const responseFields = {
173
+ HttpMeta: { Response: response, Request: req },
174
+ };
175
+
176
+ const [result, raw] = await M.match<
177
+ operations.ListVendorScansResponse,
178
+ | errors.ApiErrorResponse
179
+ | GreenSecurityError
180
+ | ResponseValidationError
181
+ | ConnectionError
182
+ | RequestAbortedError
183
+ | RequestTimeoutError
184
+ | InvalidRequestError
185
+ | UnexpectedClientError
186
+ | SDKValidationError
187
+ >(
188
+ M.json(200, operations.ListVendorScansResponse$inboundSchema, {
189
+ key: "Result",
190
+ }),
191
+ M.jsonErr([400, 401, 403], errors.ApiErrorResponse$inboundSchema),
192
+ M.fail("4XX"),
193
+ M.fail([500, "5XX"]),
194
+ )(response, req, { extraFields: responseFields });
195
+ if (!result.ok) {
196
+ return [haltIterator(result), {
197
+ status: "complete",
198
+ request: req,
199
+ response,
200
+ }];
201
+ }
202
+
203
+ const nextFunc = (
204
+ responseData: unknown,
205
+ ): {
206
+ next: Paginator<
207
+ Result<
208
+ operations.ListVendorScansResponse,
209
+ | errors.ApiErrorResponse
210
+ | GreenSecurityError
211
+ | ResponseValidationError
212
+ | ConnectionError
213
+ | RequestAbortedError
214
+ | RequestTimeoutError
215
+ | InvalidRequestError
216
+ | UnexpectedClientError
217
+ | SDKValidationError
218
+ >
219
+ >;
220
+ "~next"?: { page: number };
221
+ } => {
222
+ const page = request?.page ?? 1;
223
+ const nextPage = page + 1;
224
+
225
+ if (!responseData) {
226
+ return { next: () => null };
227
+ }
228
+ const results = dlv(responseData, "items");
229
+ if (!Array.isArray(results) || !results.length) {
230
+ return { next: () => null };
231
+ }
232
+ const limit = request?.itemsPerPage ?? 0;
233
+ if (results.length < limit) {
234
+ return { next: () => null };
235
+ }
236
+
237
+ const nextVal = () =>
238
+ vendorScansListVendorScans(
239
+ client,
240
+ {
241
+ ...request,
242
+ page: nextPage,
243
+ },
244
+ options,
245
+ );
246
+
247
+ return { next: nextVal, "~next": { page: nextPage } };
248
+ };
249
+
250
+ const page = { ...result, ...nextFunc(raw) };
251
+ return [{ ...page, ...createPageIterator(page, (v) => !v.ok) }, {
252
+ status: "complete",
253
+ request: req,
254
+ response,
255
+ }];
256
+ }
package/src/lib/config.ts CHANGED
@@ -81,8 +81,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
81
81
  export const SDK_METADATA = {
82
82
  language: "typescript",
83
83
  openapiDocVersion: "0.0.11",
84
- sdkVersion: "0.43.1-beta.116",
85
- genVersion: "2.881.2",
84
+ sdkVersion: "0.43.1-beta.121",
85
+ genVersion: "2.881.4",
86
86
  userAgent:
87
- "speakeasy-sdk/typescript 0.43.1-beta.116 2.881.2 0.0.11 @greensecurity/javascript-sdk",
87
+ "speakeasy-sdk/typescript 0.43.1-beta.121 2.881.4 0.0.11 @greensecurity/javascript-sdk",
88
88
  } as const;
@@ -100,6 +100,14 @@ export type FhirConfig = {
100
100
  * See [JMESPath](https://jmespath.org/)
101
101
  */
102
102
  projection: string;
103
+ /**
104
+ * Whether to automatically create Room records for unmapped FHIR encounter locations
105
+ */
106
+ autoCreateRooms: boolean;
107
+ /**
108
+ * JMESPath template to transform FHIR location object to Room attributes. Used when auto_create_rooms is enabled.
109
+ */
110
+ roomCreationJmespath?: string | undefined;
103
111
  };
104
112
 
105
113
  /** @internal */
@@ -218,12 +226,16 @@ export const FhirConfig$inboundSchema: z.ZodType<
218
226
  notes: types.optional(types.string()),
219
227
  entities: FhirExtraEntities$inboundSchema,
220
228
  projection: types.string(),
229
+ auto_create_rooms: types.boolean().default(false),
230
+ room_creation_jmespath: types.optional(types.string()),
221
231
  }).transform((v) => {
222
232
  return remap$(v, {
223
233
  "production_profile": "productionProfile",
224
234
  "non_production_profile": "nonProductionProfile",
225
235
  "applies_to": "appliesTo",
226
236
  "active_profile": "activeProfile",
237
+ "auto_create_rooms": "autoCreateRooms",
238
+ "room_creation_jmespath": "roomCreationJmespath",
227
239
  });
228
240
  });
229
241
 
@@ -49,6 +49,14 @@ export type FhirConfigPartialUpdate = {
49
49
  * Flags indicating which FHIR entities should be queried for a visitor lookup. The default patient and encounter entities are always enabled. Extra entities should be enabled when additional data needs to be queried to decide whether a visitor should be allowed in.
50
50
  */
51
51
  entities?: FhirExtraEntities | undefined;
52
+ /**
53
+ * Whether to automatically create Room records for unmapped FHIR encounter locations
54
+ */
55
+ autoCreateRooms?: boolean | undefined;
56
+ /**
57
+ * JMESPath template to transform FHIR location object to Room attributes. Used when auto_create_rooms is enabled.
58
+ */
59
+ roomCreationJmespath?: string | undefined;
52
60
  };
53
61
 
54
62
  /** @internal */
@@ -183,6 +191,8 @@ export type FhirConfigPartialUpdate$Outbound = {
183
191
  active_profile?: string | undefined;
184
192
  notes?: string | undefined;
185
193
  entities?: FhirExtraEntities$Outbound | undefined;
194
+ auto_create_rooms: boolean;
195
+ room_creation_jmespath?: string | undefined;
186
196
  };
187
197
 
188
198
  /** @internal */
@@ -202,12 +212,16 @@ export const FhirConfigPartialUpdate$outboundSchema: z.ZodType<
202
212
  activeProfile: z.string().optional(),
203
213
  notes: z.string().optional(),
204
214
  entities: FhirExtraEntities$outboundSchema.optional(),
215
+ autoCreateRooms: z.boolean().default(false),
216
+ roomCreationJmespath: z.string().optional(),
205
217
  }).transform((v) => {
206
218
  return remap$(v, {
207
219
  productionProfile: "production_profile",
208
220
  nonProductionProfile: "non_production_profile",
209
221
  appliesTo: "applies_to",
210
222
  activeProfile: "active_profile",
223
+ autoCreateRooms: "auto_create_rooms",
224
+ roomCreationJmespath: "room_creation_jmespath",
211
225
  });
212
226
  });
213
227
 
@@ -29,12 +29,17 @@ export type VendorScan = {
29
29
  vendor?: any | undefined;
30
30
  zone?: any | undefined;
31
31
  department?: Department | number | null | undefined;
32
+ departmentEventId?: number | null | undefined;
33
+ facilityEventId?: number | null | undefined;
32
34
  scanInVendorScanId?: number | null | undefined;
33
35
  scanOutVendorScanId?: number | null | undefined;
34
36
  autoScanOut?: boolean | undefined;
35
37
  finishedScreeningQuestions?: boolean | undefined;
36
38
  requiresScreeningQuestions?: boolean | undefined;
37
39
  recheck?: boolean | undefined;
40
+ /**
41
+ * Smart badge LED payload data. Only present when requested via the `vendor_scan.badge_data` expand scope.
42
+ */
38
43
  badgeData?: string | null | undefined;
39
44
  };
40
45
 
@@ -73,6 +78,8 @@ export const VendorScan$inboundSchema: z.ZodType<
73
78
  zone: types.optional(z.any()),
74
79
  department: z.nullable(smartUnion([Department$inboundSchema, types.number()]))
75
80
  .optional(),
81
+ department_event_id: z.nullable(types.number()).optional(),
82
+ facility_event_id: z.nullable(types.number()).optional(),
76
83
  scan_in_vendor_scan_id: z.nullable(types.number()).optional(),
77
84
  scan_out_vendor_scan_id: z.nullable(types.number()).optional(),
78
85
  auto_scan_out: types.optional(types.boolean()),
@@ -87,6 +94,8 @@ export const VendorScan$inboundSchema: z.ZodType<
87
94
  "scan_error": "scanError",
88
95
  "scan_success": "scanSuccess",
89
96
  "scan_type": "scanType",
97
+ "department_event_id": "departmentEventId",
98
+ "facility_event_id": "facilityEventId",
90
99
  "scan_in_vendor_scan_id": "scanInVendorScanId",
91
100
  "scan_out_vendor_scan_id": "scanOutVendorScanId",
92
101
  "auto_scan_out": "autoScanOut",