@greensecurity/javascript-sdk 0.45.0-beta.18 → 0.45.0-beta.19

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 (206) hide show
  1. package/README.md +4 -1
  2. package/dist/commonjs/__tests__/vendors.test.js +29 -1
  3. package/dist/commonjs/__tests__/vendors.test.js.map +1 -1
  4. package/dist/commonjs/__tests__/zones.test.js +9 -2
  5. package/dist/commonjs/__tests__/zones.test.js.map +1 -1
  6. package/dist/commonjs/funcs/organizationsExportCompanyTargetFacilities.js +4 -2
  7. package/dist/commonjs/funcs/organizationsExportCompanyTargetFacilities.js.map +1 -1
  8. package/dist/commonjs/funcs/organizationsListCompanyTargetFacilities.js +1 -0
  9. package/dist/commonjs/funcs/organizationsListCompanyTargetFacilities.js.map +1 -1
  10. package/dist/commonjs/funcs/vendorsGetVendorScreeningQuestions.d.ts +18 -0
  11. package/dist/commonjs/funcs/vendorsGetVendorScreeningQuestions.d.ts.map +1 -0
  12. package/dist/commonjs/funcs/vendorsGetVendorScreeningQuestions.js +128 -0
  13. package/dist/commonjs/funcs/vendorsGetVendorScreeningQuestions.js.map +1 -0
  14. package/dist/commonjs/lib/config.d.ts +3 -3
  15. package/dist/commonjs/lib/config.js +3 -3
  16. package/dist/commonjs/lib/config.js.map +1 -1
  17. package/dist/commonjs/models/components/contact.d.ts +6 -6
  18. package/dist/commonjs/models/components/contact.d.ts.map +1 -1
  19. package/dist/commonjs/models/components/contact.js +9 -9
  20. package/dist/commonjs/models/components/contact.js.map +1 -1
  21. package/dist/commonjs/models/components/expand.d.ts +1 -0
  22. package/dist/commonjs/models/components/expand.d.ts.map +1 -1
  23. package/dist/commonjs/models/components/expand.js +1 -0
  24. package/dist/commonjs/models/components/expand.js.map +1 -1
  25. package/dist/commonjs/models/components/index.d.ts +2 -0
  26. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  27. package/dist/commonjs/models/components/index.js +2 -0
  28. package/dist/commonjs/models/components/index.js.map +1 -1
  29. package/dist/commonjs/models/components/system.d.ts +18 -0
  30. package/dist/commonjs/models/components/system.d.ts.map +1 -0
  31. package/dist/commonjs/models/components/system.js +54 -0
  32. package/dist/commonjs/models/components/system.js.map +1 -0
  33. package/dist/commonjs/models/components/vendorcredentialsummary.d.ts +5 -2
  34. package/dist/commonjs/models/components/vendorcredentialsummary.d.ts.map +1 -1
  35. package/dist/commonjs/models/components/vendorcredentialsummary.js +2 -2
  36. package/dist/commonjs/models/components/vendorcredentialsummary.js.map +1 -1
  37. package/dist/commonjs/models/components/vendortargetfacility.d.ts +4 -0
  38. package/dist/commonjs/models/components/vendortargetfacility.d.ts.map +1 -1
  39. package/dist/commonjs/models/components/vendortargetfacility.js +2 -0
  40. package/dist/commonjs/models/components/vendortargetfacility.js.map +1 -1
  41. package/dist/commonjs/models/components/vendortargetfacilityscreeningresponse.d.ts +34 -0
  42. package/dist/commonjs/models/components/vendortargetfacilityscreeningresponse.d.ts.map +1 -0
  43. package/dist/commonjs/models/components/vendortargetfacilityscreeningresponse.js +64 -0
  44. package/dist/commonjs/models/components/vendortargetfacilityscreeningresponse.js.map +1 -0
  45. package/dist/commonjs/models/operations/exportcompanytargetfacilities.d.ts +5 -0
  46. package/dist/commonjs/models/operations/exportcompanytargetfacilities.d.ts.map +1 -1
  47. package/dist/commonjs/models/operations/exportcompanytargetfacilities.js +2 -0
  48. package/dist/commonjs/models/operations/exportcompanytargetfacilities.js.map +1 -1
  49. package/dist/commonjs/models/operations/getvendorscreeningquestions.d.ts +46 -0
  50. package/dist/commonjs/models/operations/getvendorscreeningquestions.d.ts.map +1 -0
  51. package/dist/commonjs/models/operations/getvendorscreeningquestions.js +74 -0
  52. package/dist/commonjs/models/operations/getvendorscreeningquestions.js.map +1 -0
  53. package/dist/commonjs/models/operations/index.d.ts +1 -0
  54. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  55. package/dist/commonjs/models/operations/index.js +1 -0
  56. package/dist/commonjs/models/operations/index.js.map +1 -1
  57. package/dist/commonjs/models/operations/listcompanytargetfacilities.d.ts +5 -0
  58. package/dist/commonjs/models/operations/listcompanytargetfacilities.d.ts.map +1 -1
  59. package/dist/commonjs/models/operations/listcompanytargetfacilities.js +2 -0
  60. package/dist/commonjs/models/operations/listcompanytargetfacilities.js.map +1 -1
  61. package/dist/commonjs/react-query/index.d.ts +1 -0
  62. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  63. package/dist/commonjs/react-query/index.js +1 -0
  64. package/dist/commonjs/react-query/index.js.map +1 -1
  65. package/dist/commonjs/react-query/organizationsExportCompanyTargetFacilities.core.d.ts +1 -0
  66. package/dist/commonjs/react-query/organizationsExportCompanyTargetFacilities.core.d.ts.map +1 -1
  67. package/dist/commonjs/react-query/organizationsExportCompanyTargetFacilities.core.js +1 -0
  68. package/dist/commonjs/react-query/organizationsExportCompanyTargetFacilities.core.js.map +1 -1
  69. package/dist/commonjs/react-query/organizationsExportCompanyTargetFacilities.d.ts +2 -0
  70. package/dist/commonjs/react-query/organizationsExportCompanyTargetFacilities.d.ts.map +1 -1
  71. package/dist/commonjs/react-query/organizationsExportCompanyTargetFacilities.js.map +1 -1
  72. package/dist/commonjs/react-query/organizationsListCompanyTargetFacilities.core.d.ts +2 -0
  73. package/dist/commonjs/react-query/organizationsListCompanyTargetFacilities.core.d.ts.map +1 -1
  74. package/dist/commonjs/react-query/organizationsListCompanyTargetFacilities.core.js +2 -0
  75. package/dist/commonjs/react-query/organizationsListCompanyTargetFacilities.core.js.map +1 -1
  76. package/dist/commonjs/react-query/organizationsListCompanyTargetFacilities.d.ts +2 -0
  77. package/dist/commonjs/react-query/organizationsListCompanyTargetFacilities.d.ts.map +1 -1
  78. package/dist/commonjs/react-query/organizationsListCompanyTargetFacilities.js.map +1 -1
  79. package/dist/commonjs/react-query/vendorsGetVendorScreeningQuestions.core.d.ts +14 -0
  80. package/dist/commonjs/react-query/vendorsGetVendorScreeningQuestions.core.d.ts.map +1 -0
  81. package/dist/commonjs/react-query/vendorsGetVendorScreeningQuestions.core.js +42 -0
  82. package/dist/commonjs/react-query/vendorsGetVendorScreeningQuestions.core.js.map +1 -0
  83. package/dist/commonjs/react-query/vendorsGetVendorScreeningQuestions.d.ts +36 -0
  84. package/dist/commonjs/react-query/vendorsGetVendorScreeningQuestions.d.ts.map +1 -0
  85. package/dist/commonjs/react-query/vendorsGetVendorScreeningQuestions.js +69 -0
  86. package/dist/commonjs/react-query/vendorsGetVendorScreeningQuestions.js.map +1 -0
  87. package/dist/commonjs/sdk/vendors.d.ts +7 -0
  88. package/dist/commonjs/sdk/vendors.d.ts.map +1 -1
  89. package/dist/commonjs/sdk/vendors.js +10 -0
  90. package/dist/commonjs/sdk/vendors.js.map +1 -1
  91. package/dist/esm/__tests__/vendors.test.js +29 -1
  92. package/dist/esm/__tests__/vendors.test.js.map +1 -1
  93. package/dist/esm/__tests__/zones.test.js +9 -2
  94. package/dist/esm/__tests__/zones.test.js.map +1 -1
  95. package/dist/esm/funcs/organizationsExportCompanyTargetFacilities.js +5 -3
  96. package/dist/esm/funcs/organizationsExportCompanyTargetFacilities.js.map +1 -1
  97. package/dist/esm/funcs/organizationsListCompanyTargetFacilities.js +1 -0
  98. package/dist/esm/funcs/organizationsListCompanyTargetFacilities.js.map +1 -1
  99. package/dist/esm/funcs/vendorsGetVendorScreeningQuestions.d.ts +18 -0
  100. package/dist/esm/funcs/vendorsGetVendorScreeningQuestions.d.ts.map +1 -0
  101. package/dist/esm/funcs/vendorsGetVendorScreeningQuestions.js +92 -0
  102. package/dist/esm/funcs/vendorsGetVendorScreeningQuestions.js.map +1 -0
  103. package/dist/esm/lib/config.d.ts +3 -3
  104. package/dist/esm/lib/config.js +3 -3
  105. package/dist/esm/lib/config.js.map +1 -1
  106. package/dist/esm/models/components/contact.d.ts +6 -6
  107. package/dist/esm/models/components/contact.d.ts.map +1 -1
  108. package/dist/esm/models/components/contact.js +6 -6
  109. package/dist/esm/models/components/contact.js.map +1 -1
  110. package/dist/esm/models/components/expand.d.ts +1 -0
  111. package/dist/esm/models/components/expand.d.ts.map +1 -1
  112. package/dist/esm/models/components/expand.js +1 -0
  113. package/dist/esm/models/components/expand.js.map +1 -1
  114. package/dist/esm/models/components/index.d.ts +2 -0
  115. package/dist/esm/models/components/index.d.ts.map +1 -1
  116. package/dist/esm/models/components/index.js +2 -0
  117. package/dist/esm/models/components/index.js.map +1 -1
  118. package/dist/esm/models/components/system.d.ts +18 -0
  119. package/dist/esm/models/components/system.d.ts.map +1 -0
  120. package/dist/esm/models/components/system.js +17 -0
  121. package/dist/esm/models/components/system.js.map +1 -0
  122. package/dist/esm/models/components/vendorcredentialsummary.d.ts +5 -2
  123. package/dist/esm/models/components/vendorcredentialsummary.d.ts.map +1 -1
  124. package/dist/esm/models/components/vendorcredentialsummary.js +2 -2
  125. package/dist/esm/models/components/vendorcredentialsummary.js.map +1 -1
  126. package/dist/esm/models/components/vendortargetfacility.d.ts +4 -0
  127. package/dist/esm/models/components/vendortargetfacility.d.ts.map +1 -1
  128. package/dist/esm/models/components/vendortargetfacility.js +2 -0
  129. package/dist/esm/models/components/vendortargetfacility.js.map +1 -1
  130. package/dist/esm/models/components/vendortargetfacilityscreeningresponse.d.ts +34 -0
  131. package/dist/esm/models/components/vendortargetfacilityscreeningresponse.d.ts.map +1 -0
  132. package/dist/esm/models/components/vendortargetfacilityscreeningresponse.js +27 -0
  133. package/dist/esm/models/components/vendortargetfacilityscreeningresponse.js.map +1 -0
  134. package/dist/esm/models/operations/exportcompanytargetfacilities.d.ts +5 -0
  135. package/dist/esm/models/operations/exportcompanytargetfacilities.d.ts.map +1 -1
  136. package/dist/esm/models/operations/exportcompanytargetfacilities.js +2 -0
  137. package/dist/esm/models/operations/exportcompanytargetfacilities.js.map +1 -1
  138. package/dist/esm/models/operations/getvendorscreeningquestions.d.ts +46 -0
  139. package/dist/esm/models/operations/getvendorscreeningquestions.d.ts.map +1 -0
  140. package/dist/esm/models/operations/getvendorscreeningquestions.js +36 -0
  141. package/dist/esm/models/operations/getvendorscreeningquestions.js.map +1 -0
  142. package/dist/esm/models/operations/index.d.ts +1 -0
  143. package/dist/esm/models/operations/index.d.ts.map +1 -1
  144. package/dist/esm/models/operations/index.js +1 -0
  145. package/dist/esm/models/operations/index.js.map +1 -1
  146. package/dist/esm/models/operations/listcompanytargetfacilities.d.ts +5 -0
  147. package/dist/esm/models/operations/listcompanytargetfacilities.d.ts.map +1 -1
  148. package/dist/esm/models/operations/listcompanytargetfacilities.js +2 -0
  149. package/dist/esm/models/operations/listcompanytargetfacilities.js.map +1 -1
  150. package/dist/esm/react-query/index.d.ts +1 -0
  151. package/dist/esm/react-query/index.d.ts.map +1 -1
  152. package/dist/esm/react-query/index.js +1 -0
  153. package/dist/esm/react-query/index.js.map +1 -1
  154. package/dist/esm/react-query/organizationsExportCompanyTargetFacilities.core.d.ts +1 -0
  155. package/dist/esm/react-query/organizationsExportCompanyTargetFacilities.core.d.ts.map +1 -1
  156. package/dist/esm/react-query/organizationsExportCompanyTargetFacilities.core.js +1 -0
  157. package/dist/esm/react-query/organizationsExportCompanyTargetFacilities.core.js.map +1 -1
  158. package/dist/esm/react-query/organizationsExportCompanyTargetFacilities.d.ts +2 -0
  159. package/dist/esm/react-query/organizationsExportCompanyTargetFacilities.d.ts.map +1 -1
  160. package/dist/esm/react-query/organizationsExportCompanyTargetFacilities.js.map +1 -1
  161. package/dist/esm/react-query/organizationsListCompanyTargetFacilities.core.d.ts +2 -0
  162. package/dist/esm/react-query/organizationsListCompanyTargetFacilities.core.d.ts.map +1 -1
  163. package/dist/esm/react-query/organizationsListCompanyTargetFacilities.core.js +2 -0
  164. package/dist/esm/react-query/organizationsListCompanyTargetFacilities.core.js.map +1 -1
  165. package/dist/esm/react-query/organizationsListCompanyTargetFacilities.d.ts +2 -0
  166. package/dist/esm/react-query/organizationsListCompanyTargetFacilities.d.ts.map +1 -1
  167. package/dist/esm/react-query/organizationsListCompanyTargetFacilities.js.map +1 -1
  168. package/dist/esm/react-query/vendorsGetVendorScreeningQuestions.core.d.ts +14 -0
  169. package/dist/esm/react-query/vendorsGetVendorScreeningQuestions.core.d.ts.map +1 -0
  170. package/dist/esm/react-query/vendorsGetVendorScreeningQuestions.core.js +37 -0
  171. package/dist/esm/react-query/vendorsGetVendorScreeningQuestions.core.js.map +1 -0
  172. package/dist/esm/react-query/vendorsGetVendorScreeningQuestions.d.ts +36 -0
  173. package/dist/esm/react-query/vendorsGetVendorScreeningQuestions.d.ts.map +1 -0
  174. package/dist/esm/react-query/vendorsGetVendorScreeningQuestions.js +59 -0
  175. package/dist/esm/react-query/vendorsGetVendorScreeningQuestions.js.map +1 -0
  176. package/dist/esm/sdk/vendors.d.ts +7 -0
  177. package/dist/esm/sdk/vendors.d.ts.map +1 -1
  178. package/dist/esm/sdk/vendors.js +10 -0
  179. package/dist/esm/sdk/vendors.js.map +1 -1
  180. package/jsr.json +1 -1
  181. package/package.json +1 -1
  182. package/src/__tests__/vendors.test.ts +32 -1
  183. package/src/__tests__/zones.test.ts +9 -2
  184. package/src/funcs/organizationsExportCompanyTargetFacilities.ts +20 -15
  185. package/src/funcs/organizationsListCompanyTargetFacilities.ts +1 -0
  186. package/src/funcs/vendorsGetVendorScreeningQuestions.ts +187 -0
  187. package/src/lib/config.ts +3 -3
  188. package/src/models/components/contact.ts +16 -13
  189. package/src/models/components/expand.ts +2 -0
  190. package/src/models/components/index.ts +2 -0
  191. package/src/models/components/system.ts +39 -0
  192. package/src/models/components/vendorcredentialsummary.ts +6 -3
  193. package/src/models/components/vendortargetfacility.ts +6 -0
  194. package/src/models/components/vendortargetfacilityscreeningresponse.ts +70 -0
  195. package/src/models/operations/exportcompanytargetfacilities.ts +7 -0
  196. package/src/models/operations/getvendorscreeningquestions.ts +107 -0
  197. package/src/models/operations/index.ts +1 -0
  198. package/src/models/operations/listcompanytargetfacilities.ts +7 -0
  199. package/src/react-query/index.ts +1 -0
  200. package/src/react-query/organizationsExportCompanyTargetFacilities.core.ts +2 -0
  201. package/src/react-query/organizationsExportCompanyTargetFacilities.ts +2 -0
  202. package/src/react-query/organizationsListCompanyTargetFacilities.core.ts +4 -0
  203. package/src/react-query/organizationsListCompanyTargetFacilities.ts +2 -0
  204. package/src/react-query/vendorsGetVendorScreeningQuestions.core.ts +82 -0
  205. package/src/react-query/vendorsGetVendorScreeningQuestions.ts +152 -0
  206. package/src/sdk/vendors.ts +20 -0
@@ -0,0 +1,187 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { GreenSecurityCore } from "../core.js";
6
+ import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
7
+ import { matchStatusCode } from "../lib/http.js";
8
+ import * as M from "../lib/matchers.js";
9
+ import { compactMap } from "../lib/primitives.js";
10
+ import { safeParse } from "../lib/schemas.js";
11
+ import { RequestOptions } from "../lib/sdks.js";
12
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
13
+ import { pathToFunc } from "../lib/url.js";
14
+ import { GreenSecurityError } from "../models/errors/greensecurityerror.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
25
+ import * as operations from "../models/operations/index.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * List a vendor's target-facility screening questions and answers
31
+ *
32
+ * @remarks
33
+ * Returns every active target-facility screening question that currently applies to the vendor at the given facility, each paired with the vendor's answer when one has been given. Questions that have not been answered are included with a null answer. Read-only; used to review a rep's screening answers.
34
+ */
35
+ export function vendorsGetVendorScreeningQuestions(
36
+ client: GreenSecurityCore,
37
+ request: operations.GetVendorScreeningQuestionsRequest,
38
+ options?: RequestOptions,
39
+ ): APIPromise<
40
+ Result<
41
+ operations.GetVendorScreeningQuestionsGetVendorScreeningQuestionsOk,
42
+ | errors.ApiErrorResponse
43
+ | GreenSecurityError
44
+ | ResponseValidationError
45
+ | ConnectionError
46
+ | RequestAbortedError
47
+ | RequestTimeoutError
48
+ | InvalidRequestError
49
+ | UnexpectedClientError
50
+ | SDKValidationError
51
+ >
52
+ > {
53
+ return new APIPromise($do(
54
+ client,
55
+ request,
56
+ options,
57
+ ));
58
+ }
59
+
60
+ async function $do(
61
+ client: GreenSecurityCore,
62
+ request: operations.GetVendorScreeningQuestionsRequest,
63
+ options?: RequestOptions,
64
+ ): Promise<
65
+ [
66
+ Result<
67
+ operations.GetVendorScreeningQuestionsGetVendorScreeningQuestionsOk,
68
+ | errors.ApiErrorResponse
69
+ | GreenSecurityError
70
+ | ResponseValidationError
71
+ | ConnectionError
72
+ | RequestAbortedError
73
+ | RequestTimeoutError
74
+ | InvalidRequestError
75
+ | UnexpectedClientError
76
+ | SDKValidationError
77
+ >,
78
+ APICall,
79
+ ]
80
+ > {
81
+ const parsed = safeParse(
82
+ request,
83
+ (value) =>
84
+ operations.GetVendorScreeningQuestionsRequest$outboundSchema.parse(value),
85
+ "Input validation failed",
86
+ );
87
+ if (!parsed.ok) {
88
+ return [parsed, { status: "invalid" }];
89
+ }
90
+ const payload = parsed.value;
91
+ const body = null;
92
+
93
+ const pathParams = {
94
+ vendor_id_or_me: encodeSimple("vendor_id_or_me", payload.vendor_id_or_me, {
95
+ explode: false,
96
+ charEncoding: "percent",
97
+ }),
98
+ };
99
+ const path = pathToFunc("/vendors/{vendor_id_or_me}/screening-questions")(
100
+ pathParams,
101
+ );
102
+
103
+ const query = encodeFormQuery({
104
+ "facility_id": payload.facility_id,
105
+ });
106
+
107
+ const headers = new Headers(compactMap({
108
+ Accept: "application/json",
109
+ }));
110
+
111
+ const securityInput = await extractSecurity(client._options.security);
112
+ const requestSecurity = resolveGlobalSecurity(securityInput);
113
+
114
+ const context = {
115
+ options: client._options,
116
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
117
+ operationID: "getVendorScreeningQuestions",
118
+ oAuth2Scopes: null,
119
+
120
+ resolvedSecurity: requestSecurity,
121
+
122
+ securitySource: client._options.security,
123
+ retryConfig: options?.retries
124
+ || client._options.retryConfig
125
+ || { strategy: "none" },
126
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
127
+ };
128
+
129
+ const requestRes = client._createRequest(context, {
130
+ security: requestSecurity,
131
+ method: "GET",
132
+ baseURL: options?.serverURL,
133
+ path: path,
134
+ headers: headers,
135
+ query: query,
136
+ body: body,
137
+ userAgent: client._options.userAgent,
138
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
139
+ }, options);
140
+ if (!requestRes.ok) {
141
+ return [requestRes, { status: "invalid" }];
142
+ }
143
+ const req = requestRes.value;
144
+
145
+ const doResult = await client._do(req, {
146
+ context,
147
+ isErrorStatusCode: (statusCode: number) =>
148
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
149
+ retryConfig: context.retryConfig,
150
+ retryCodes: context.retryCodes,
151
+ });
152
+ if (!doResult.ok) {
153
+ return [doResult, { status: "request-error", request: req }];
154
+ }
155
+ const response = doResult.value;
156
+
157
+ const responseFields = {
158
+ HttpMeta: { Response: response, Request: req },
159
+ };
160
+
161
+ const [result] = await M.match<
162
+ operations.GetVendorScreeningQuestionsGetVendorScreeningQuestionsOk,
163
+ | errors.ApiErrorResponse
164
+ | GreenSecurityError
165
+ | ResponseValidationError
166
+ | ConnectionError
167
+ | RequestAbortedError
168
+ | RequestTimeoutError
169
+ | InvalidRequestError
170
+ | UnexpectedClientError
171
+ | SDKValidationError
172
+ >(
173
+ M.json(
174
+ 200,
175
+ operations
176
+ .GetVendorScreeningQuestionsGetVendorScreeningQuestionsOk$inboundSchema,
177
+ ),
178
+ M.jsonErr([403, 404, 422], errors.ApiErrorResponse$inboundSchema),
179
+ M.fail("4XX"),
180
+ M.fail([500, "5XX"]),
181
+ )(response, req, { extraFields: responseFields });
182
+ if (!result.ok) {
183
+ return [result, { status: "complete", request: req, response }];
184
+ }
185
+
186
+ return [result, { status: "complete", request: req, response }];
187
+ }
package/src/lib/config.ts CHANGED
@@ -80,8 +80,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
80
80
  export const SDK_METADATA = {
81
81
  language: "typescript",
82
82
  openapiDocVersion: "0.45.0",
83
- sdkVersion: "0.45.0-beta.18",
84
- genVersion: "2.935.1",
83
+ sdkVersion: "0.45.0-beta.19",
84
+ genVersion: "2.937.18",
85
85
  userAgent:
86
- "speakeasy-sdk/typescript 0.45.0-beta.18 2.935.1 0.45.0 @greensecurity/javascript-sdk",
86
+ "speakeasy-sdk/typescript 0.45.0-beta.19 2.937.18 0.45.0 @greensecurity/javascript-sdk",
87
87
  } as const;
@@ -37,7 +37,7 @@ import {
37
37
 
38
38
  export type ContactFacility = FacilitySummary | number;
39
39
 
40
- export type System = SystemSummary | number;
40
+ export type ContactSystem = SystemSummary | number;
41
41
 
42
42
  export type ContactUser = UserSummary | number;
43
43
 
@@ -95,28 +95,31 @@ export function contactFacilityFromJSON(
95
95
  }
96
96
 
97
97
  /** @internal */
98
- export const System$inboundSchema: z.ZodType<System, z.ZodTypeDef, unknown> =
99
- smartUnion([SystemSummary$inboundSchema, types.number()]);
98
+ export const ContactSystem$inboundSchema: z.ZodType<
99
+ ContactSystem,
100
+ z.ZodTypeDef,
101
+ unknown
102
+ > = smartUnion([SystemSummary$inboundSchema, types.number()]);
100
103
  /** @internal */
101
- export type System$Outbound = SystemSummary$Outbound | number;
104
+ export type ContactSystem$Outbound = SystemSummary$Outbound | number;
102
105
 
103
106
  /** @internal */
104
- export const System$outboundSchema: z.ZodType<
105
- System$Outbound,
107
+ export const ContactSystem$outboundSchema: z.ZodType<
108
+ ContactSystem$Outbound,
106
109
  z.ZodTypeDef,
107
- System
110
+ ContactSystem
108
111
  > = smartUnion([SystemSummary$outboundSchema, z.number().int()]);
109
112
 
110
- export function systemToJSON(system: System): string {
111
- return JSON.stringify(System$outboundSchema.parse(system));
113
+ export function contactSystemToJSON(contactSystem: ContactSystem): string {
114
+ return JSON.stringify(ContactSystem$outboundSchema.parse(contactSystem));
112
115
  }
113
- export function systemFromJSON(
116
+ export function contactSystemFromJSON(
114
117
  jsonString: string,
115
- ): SafeParseResult<System, SDKValidationError> {
118
+ ): SafeParseResult<ContactSystem, SDKValidationError> {
116
119
  return safeParse(
117
120
  jsonString,
118
- (x) => System$inboundSchema.parse(JSON.parse(x)),
119
- `Failed to parse 'System' from JSON`,
121
+ (x) => ContactSystem$inboundSchema.parse(JSON.parse(x)),
122
+ `Failed to parse 'ContactSystem' from JSON`,
120
123
  );
121
124
  }
122
125
 
@@ -17,6 +17,8 @@ export const Expand = {
17
17
  CompanyVendorTypeRestrictions: "company.vendor_type_restrictions",
18
18
  CompanyTargetFacilityFacility: "company_target_facility.facility",
19
19
  VendorTargetFacilityFacility: "vendor_target_facility.facility",
20
+ VendorTargetFacilityHasScreeningResponses:
21
+ "vendor_target_facility.has_screening_responses",
20
22
  ContactFacility: "contact.facility",
21
23
  ContactSystem: "contact.system",
22
24
  ContactDepartment: "contact.department",
@@ -96,6 +96,7 @@ export * from "./state.js";
96
96
  export * from "./subscription.js";
97
97
  export * from "./supervisor.js";
98
98
  export * from "./supportarticle.js";
99
+ export * from "./system.js";
99
100
  export * from "./systemsummary.js";
100
101
  export * from "./targetfacilitystatuschange.js";
101
102
  export * from "./uploadhistoryitem.js";
@@ -124,6 +125,7 @@ export * from "./vendorscanscreeningresponse.js";
124
125
  export * from "./vendorscrubdetails.js";
125
126
  export * from "./vendorscrubpurchase.js";
126
127
  export * from "./vendortargetfacility.js";
128
+ export * from "./vendortargetfacilityscreeningresponse.js";
127
129
  export * from "./vendortype.js";
128
130
  export * from "./visitorcheckin.js";
129
131
  export * from "./webhookconsumers.js";
@@ -0,0 +1,39 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import * as types from "../../types/primitives.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ /**
12
+ * A simplified representation of a System, typically used in list views.
13
+ */
14
+ export type System = {
15
+ id: number;
16
+ name: string;
17
+ /**
18
+ * URL of the system's logo (thumbnail size), or null if none has been uploaded.
19
+ */
20
+ image?: string | null | undefined;
21
+ };
22
+
23
+ /** @internal */
24
+ export const System$inboundSchema: z.ZodType<System, z.ZodTypeDef, unknown> = z
25
+ .object({
26
+ id: types.number(),
27
+ name: types.string(),
28
+ image: z.nullable(types.string()).optional(),
29
+ });
30
+
31
+ export function systemFromJSON(
32
+ jsonString: string,
33
+ ): SafeParseResult<System, SDKValidationError> {
34
+ return safeParse(
35
+ jsonString,
36
+ (x) => System$inboundSchema.parse(JSON.parse(x)),
37
+ `Failed to parse 'System' from JSON`,
38
+ );
39
+ }
@@ -14,9 +14,9 @@ import {
14
14
  BackgroundCheckResult$inboundSchema,
15
15
  } from "./backgroundcheckresult.js";
16
16
  import { Company, Company$inboundSchema } from "./company.js";
17
- import { CompanyLookup, CompanyLookup$inboundSchema } from "./companylookup.js";
18
17
  import { Credential, Credential$inboundSchema } from "./credential.js";
19
18
  import { Invoice, Invoice$inboundSchema } from "./invoice.js";
19
+ import { System, System$inboundSchema } from "./system.js";
20
20
  import { Vendor, Vendor$inboundSchema } from "./vendor.js";
21
21
  import {
22
22
  VendorCredentialDataRequest,
@@ -88,6 +88,10 @@ export type VendorCredentialSummary = {
88
88
  appliesToCompany?: boolean | null | undefined;
89
89
  credential?: Credential | number | null | undefined;
90
90
  vendor?: Vendor | number | null | undefined;
91
+ /**
92
+ * The systems, among the company's active target facilities, that require this credential. Only present when the `vendor_credential.systems` expand scope is requested.
93
+ */
94
+ systems?: Array<System> | null | undefined;
91
95
  invoice?: Invoice | number | null | undefined;
92
96
  quote?: Invoice | number | null | undefined;
93
97
  vendorCredentialFiles?: Array<VendorCredentialFile | null> | undefined;
@@ -113,7 +117,6 @@ export type VendorCredentialSummary = {
113
117
  totalPendingCredentials?: number | null | undefined;
114
118
  backgroundCheckProviderId?: number | null | undefined;
115
119
  requiresAdminReview?: boolean | null | undefined;
116
- systems?: Array<CompanyLookup> | null | undefined;
117
120
  };
118
121
 
119
122
  /** @internal */
@@ -311,6 +314,7 @@ export const VendorCredentialSummary$inboundSchema: z.ZodType<
311
314
  .optional(),
312
315
  vendor: z.nullable(smartUnion([Vendor$inboundSchema, types.number()]))
313
316
  .optional(),
317
+ systems: z.nullable(z.array(System$inboundSchema)).optional(),
314
318
  invoice: z.nullable(smartUnion([Invoice$inboundSchema, types.number()]))
315
319
  .optional(),
316
320
  quote: z.nullable(smartUnion([Invoice$inboundSchema, types.number()]))
@@ -347,7 +351,6 @@ export const VendorCredentialSummary$inboundSchema: z.ZodType<
347
351
  total_pending_credentials: z.nullable(types.number()).optional(),
348
352
  background_check_provider_id: z.nullable(types.number()).optional(),
349
353
  requires_admin_review: z.nullable(types.boolean()).optional(),
350
- systems: z.nullable(z.array(CompanyLookup$inboundSchema)).optional(),
351
354
  }).transform((v) => {
352
355
  return remap$(v, {
353
356
  "date_due": "dateDue",
@@ -36,6 +36,10 @@ export type VendorTargetFacility = {
36
36
  * Whether all TIP 1 screening questions for this facility have been answered by the vendor.
37
37
  */
38
38
  questionsAnswered: boolean | null;
39
+ /**
40
+ * Whether the vendor has answered at least one target-facility screening question for this facility. Only present when `vendor_target_facility.has_screening_responses` is passed to `expand`. Combined with `questions_answered` it distinguishes "View" (answered some) from "None" (no questions answered) in the individual's subscription view.
41
+ */
42
+ hasScreeningResponses?: boolean | undefined;
39
43
  dateCreated?: Date | null | undefined;
40
44
  };
41
45
 
@@ -68,10 +72,12 @@ export const VendorTargetFacility$inboundSchema: z.ZodType<
68
72
  ),
69
73
  status: types.nullable(types.string()),
70
74
  questions_answered: types.nullable(types.boolean()),
75
+ has_screening_responses: types.optional(types.boolean()),
71
76
  date_created: z.nullable(types.date()).optional(),
72
77
  }).transform((v) => {
73
78
  return remap$(v, {
74
79
  "questions_answered": "questionsAnswered",
80
+ "has_screening_responses": "hasScreeningResponses",
75
81
  "date_created": "dateCreated",
76
82
  });
77
83
  });
@@ -0,0 +1,70 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
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 types from "../../types/primitives.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ /**
13
+ * A target-facility screening question paired with the vendor's answer, for read-only review. Included for every question that currently applies to the vendor at the facility, whether or not it has been answered.
14
+ */
15
+ export type VendorTargetFacilityScreeningResponse = {
16
+ /**
17
+ * ScreeningResponse row ID, or null when the question has not been answered.
18
+ */
19
+ id?: number | null | undefined;
20
+ screeningQuestionId: number;
21
+ /**
22
+ * The text of the screening question.
23
+ */
24
+ question?: string | null | undefined;
25
+ screeningAnswerId?: number | null | undefined;
26
+ /**
27
+ * The vendor's answer: the free-text custom_answer when one was entered, otherwise the selected preset answer text (comma-joined for multi-select). Null when the question has not been answered.
28
+ */
29
+ answer?: string | null | undefined;
30
+ /**
31
+ * Free-text answer entered by the vendor, if applicable.
32
+ */
33
+ customAnswer?: string | null | undefined;
34
+ /**
35
+ * Whether the vendor has answered this question.
36
+ */
37
+ answered: boolean;
38
+ };
39
+
40
+ /** @internal */
41
+ export const VendorTargetFacilityScreeningResponse$inboundSchema: z.ZodType<
42
+ VendorTargetFacilityScreeningResponse,
43
+ z.ZodTypeDef,
44
+ unknown
45
+ > = z.object({
46
+ id: z.nullable(types.number()).optional(),
47
+ screening_question_id: types.number(),
48
+ question: z.nullable(types.string()).optional(),
49
+ screening_answer_id: z.nullable(types.number()).optional(),
50
+ answer: z.nullable(types.string()).optional(),
51
+ custom_answer: z.nullable(types.string()).optional(),
52
+ answered: types.boolean(),
53
+ }).transform((v) => {
54
+ return remap$(v, {
55
+ "screening_question_id": "screeningQuestionId",
56
+ "screening_answer_id": "screeningAnswerId",
57
+ "custom_answer": "customAnswer",
58
+ });
59
+ });
60
+
61
+ export function vendorTargetFacilityScreeningResponseFromJSON(
62
+ jsonString: string,
63
+ ): SafeParseResult<VendorTargetFacilityScreeningResponse, SDKValidationError> {
64
+ return safeParse(
65
+ jsonString,
66
+ (x) =>
67
+ VendorTargetFacilityScreeningResponse$inboundSchema.parse(JSON.parse(x)),
68
+ `Failed to parse 'VendorTargetFacilityScreeningResponse' from JSON`,
69
+ );
70
+ }
@@ -120,6 +120,10 @@ export type ExportCompanyTargetFacilitiesRequest = {
120
120
  * Case-insensitive partial match on the facility's parent system name.
121
121
  */
122
122
  systemNameLike?: string | undefined;
123
+ /**
124
+ * Exact match on the facility's parent system id. Returns only facilities whose `system.id` is one of the given values.
125
+ */
126
+ systemIds?: Array<number> | undefined;
123
127
  /**
124
128
  * Case-insensitive partial match across facility name, city, state, street address, and system name (OR logic). Use this for a single search-box query; use the field-specific `*_like` params for multi-field AND filtering.
125
129
  */
@@ -203,6 +207,7 @@ export type ExportCompanyTargetFacilitiesRequest$Outbound = {
203
207
  state_like?: string | undefined;
204
208
  address_like?: string | undefined;
205
209
  system_name_like?: string | undefined;
210
+ system_ids?: Array<number> | undefined;
206
211
  search_like?: string | undefined;
207
212
  sort?: string | undefined;
208
213
  desc?: boolean | number | undefined;
@@ -224,6 +229,7 @@ export const ExportCompanyTargetFacilitiesRequest$outboundSchema: z.ZodType<
224
229
  stateLike: z.string().optional(),
225
230
  addressLike: z.string().optional(),
226
231
  systemNameLike: z.string().optional(),
232
+ systemIds: z.array(z.number().int()).optional(),
227
233
  searchLike: z.string().optional(),
228
234
  sort: ExportCompanyTargetFacilitiesQueryParamSort$outboundSchema.optional(),
229
235
  desc: smartUnion([z.boolean(), Two$outboundSchema]).optional(),
@@ -238,6 +244,7 @@ export const ExportCompanyTargetFacilitiesRequest$outboundSchema: z.ZodType<
238
244
  stateLike: "state_like",
239
245
  addressLike: "address_like",
240
246
  systemNameLike: "system_name_like",
247
+ systemIds: "system_ids",
241
248
  searchLike: "search_like",
242
249
  itemsPerPage: "items_per_page",
243
250
  });
@@ -0,0 +1,107 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
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 types from "../../types/primitives.js";
10
+ import * as components from "../components/index.js";
11
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
12
+
13
+ export type GetVendorScreeningQuestionsRequest = {
14
+ /**
15
+ * Vendor identifier. Depending on the endpoint, accepts one or more of:
16
+ *
17
+ * @remarks
18
+ * - A numeric vendor ID (positive integer, e.g. `42`)
19
+ * - The keyword `me` to represent the authenticated vendor
20
+ * - An active QR code (alphanumeric, hyphen-separated, e.g. `ABC-123-DEF`) —
21
+ * supported only on endpoints that explicitly document QR-code lookup
22
+ */
23
+ vendorIdOrMe: string;
24
+ /**
25
+ * The targeted facility whose screening questions to return. Must be a facility the vendor targets.
26
+ */
27
+ facilityId: number;
28
+ };
29
+
30
+ /**
31
+ * The request was successful, and the server has returned the requested resource in the response body.
32
+ */
33
+ export type GetVendorScreeningQuestionsGetVendorScreeningQuestionsOk = {
34
+ /**
35
+ * Pagination information for a pageable list
36
+ */
37
+ pager: components.Pager;
38
+ items: Array<components.VendorTargetFacilityScreeningResponse>;
39
+ /**
40
+ * Name of the facility the questions are scoped to.
41
+ */
42
+ facilityName: string | null;
43
+ };
44
+
45
+ /** @internal */
46
+ export type GetVendorScreeningQuestionsRequest$Outbound = {
47
+ vendor_id_or_me: string;
48
+ facility_id: number;
49
+ };
50
+
51
+ /** @internal */
52
+ export const GetVendorScreeningQuestionsRequest$outboundSchema: z.ZodType<
53
+ GetVendorScreeningQuestionsRequest$Outbound,
54
+ z.ZodTypeDef,
55
+ GetVendorScreeningQuestionsRequest
56
+ > = z.object({
57
+ vendorIdOrMe: z.string(),
58
+ facilityId: z.number().int(),
59
+ }).transform((v) => {
60
+ return remap$(v, {
61
+ vendorIdOrMe: "vendor_id_or_me",
62
+ facilityId: "facility_id",
63
+ });
64
+ });
65
+
66
+ export function getVendorScreeningQuestionsRequestToJSON(
67
+ getVendorScreeningQuestionsRequest: GetVendorScreeningQuestionsRequest,
68
+ ): string {
69
+ return JSON.stringify(
70
+ GetVendorScreeningQuestionsRequest$outboundSchema.parse(
71
+ getVendorScreeningQuestionsRequest,
72
+ ),
73
+ );
74
+ }
75
+
76
+ /** @internal */
77
+ export const GetVendorScreeningQuestionsGetVendorScreeningQuestionsOk$inboundSchema:
78
+ z.ZodType<
79
+ GetVendorScreeningQuestionsGetVendorScreeningQuestionsOk,
80
+ z.ZodTypeDef,
81
+ unknown
82
+ > = z.object({
83
+ pager: components.Pager$inboundSchema,
84
+ items: z.array(
85
+ components.VendorTargetFacilityScreeningResponse$inboundSchema,
86
+ ),
87
+ facility_name: types.nullable(types.string()),
88
+ }).transform((v) => {
89
+ return remap$(v, {
90
+ "facility_name": "facilityName",
91
+ });
92
+ });
93
+
94
+ export function getVendorScreeningQuestionsGetVendorScreeningQuestionsOkFromJSON(
95
+ jsonString: string,
96
+ ): SafeParseResult<
97
+ GetVendorScreeningQuestionsGetVendorScreeningQuestionsOk,
98
+ SDKValidationError
99
+ > {
100
+ return safeParse(
101
+ jsonString,
102
+ (x) =>
103
+ GetVendorScreeningQuestionsGetVendorScreeningQuestionsOk$inboundSchema
104
+ .parse(JSON.parse(x)),
105
+ `Failed to parse 'GetVendorScreeningQuestionsGetVendorScreeningQuestionsOk' from JSON`,
106
+ );
107
+ }
@@ -79,6 +79,7 @@ export * from "./getvendorlegalname.js";
79
79
  export * from "./getvendorpaymentresponsibility.js";
80
80
  export * from "./getvendorscan.js";
81
81
  export * from "./getvendorscansexportstatus.js";
82
+ export * from "./getvendorscreeningquestions.js";
82
83
  export * from "./getvendorsdetails.js";
83
84
  export * from "./getvendorsexportstatus.js";
84
85
  export * from "./getvendortargetfacilities.js";
@@ -126,6 +126,10 @@ export type ListCompanyTargetFacilitiesRequest = {
126
126
  * Case-insensitive partial match on the facility's parent system name.
127
127
  */
128
128
  systemNameLike?: string | undefined;
129
+ /**
130
+ * Exact match on the facility's parent system id. Returns only facilities whose `system.id` is one of the given values.
131
+ */
132
+ systemIds?: Array<number> | undefined;
129
133
  /**
130
134
  * Case-insensitive partial match across facility name, city, state, street address, and system name (OR logic). Use this for a single search-box query; use the field-specific `*_like` params for multi-field AND filtering.
131
135
  */
@@ -201,6 +205,7 @@ export type ListCompanyTargetFacilitiesRequest$Outbound = {
201
205
  state_like?: string | undefined;
202
206
  address_like?: string | undefined;
203
207
  system_name_like?: string | undefined;
208
+ system_ids?: Array<number> | undefined;
204
209
  search_like?: string | undefined;
205
210
  sort?: string | undefined;
206
211
  desc?: components.Desc$Outbound | undefined;
@@ -225,6 +230,7 @@ export const ListCompanyTargetFacilitiesRequest$outboundSchema: z.ZodType<
225
230
  stateLike: z.string().optional(),
226
231
  addressLike: z.string().optional(),
227
232
  systemNameLike: z.string().optional(),
233
+ systemIds: z.array(z.number().int()).optional(),
228
234
  searchLike: z.string().optional(),
229
235
  sort: QueryParamSort$outboundSchema.optional(),
230
236
  desc: components.Desc$outboundSchema.optional(),
@@ -241,6 +247,7 @@ export const ListCompanyTargetFacilitiesRequest$outboundSchema: z.ZodType<
241
247
  stateLike: "state_like",
242
248
  addressLike: "address_like",
243
249
  systemNameLike: "system_name_like",
250
+ systemIds: "system_ids",
244
251
  searchLike: "search_like",
245
252
  itemsPerPage: "items_per_page",
246
253
  });
@@ -146,6 +146,7 @@ export * from "./vendorsGetVendorInvoiceDetails.js";
146
146
  export * from "./vendorsGetVendorInvoiceReceipt.js";
147
147
  export * from "./vendorsGetVendorLegalName.js";
148
148
  export * from "./vendorsGetVendorPaymentResponsibility.js";
149
+ export * from "./vendorsGetVendorScreeningQuestions.js";
149
150
  export * from "./vendorsGetVendorsDetails.js";
150
151
  export * from "./vendorsGetVendorsExportStatus.js";
151
152
  export * from "./vendorsGetVendorTargetFacilities.js";
@@ -53,6 +53,7 @@ export function buildOrganizationsExportCompanyTargetFacilitiesQuery(
53
53
  stateLike: request.stateLike,
54
54
  addressLike: request.addressLike,
55
55
  systemNameLike: request.systemNameLike,
56
+ systemIds: request.systemIds,
56
57
  searchLike: request.searchLike,
57
58
  sort: request.sort,
58
59
  desc: request.desc,
@@ -93,6 +94,7 @@ export function queryKeyOrganizationsExportCompanyTargetFacilities(
93
94
  stateLike?: string | undefined;
94
95
  addressLike?: string | undefined;
95
96
  systemNameLike?: string | undefined;
97
+ systemIds?: Array<number> | undefined;
96
98
  searchLike?: string | undefined;
97
99
  sort?: operations.ExportCompanyTargetFacilitiesQueryParamSort | undefined;
98
100
  desc?: operations.Desc | undefined;