@greensecurity/javascript-sdk 0.44.0-beta.18 → 0.44.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 (176) hide show
  1. package/README.md +9 -0
  2. package/dist/commonjs/__tests__/organizations.test.js +57 -0
  3. package/dist/commonjs/__tests__/organizations.test.js.map +1 -1
  4. package/dist/commonjs/__tests__/webhooks.test.js +1 -1
  5. package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
  6. package/dist/commonjs/__tests__/zones.test.js +27 -6
  7. package/dist/commonjs/__tests__/zones.test.js.map +1 -1
  8. package/dist/commonjs/funcs/organizationsDownloadFacilityVendorsExport.d.ts +22 -0
  9. package/dist/commonjs/funcs/organizationsDownloadFacilityVendorsExport.d.ts.map +1 -0
  10. package/dist/commonjs/funcs/organizationsDownloadFacilityVendorsExport.js +132 -0
  11. package/dist/commonjs/funcs/organizationsDownloadFacilityVendorsExport.js.map +1 -0
  12. package/dist/commonjs/funcs/organizationsExportFacilityVendors.d.ts +34 -0
  13. package/dist/commonjs/funcs/organizationsExportFacilityVendors.d.ts.map +1 -0
  14. package/dist/commonjs/funcs/organizationsExportFacilityVendors.js +148 -0
  15. package/dist/commonjs/funcs/organizationsExportFacilityVendors.js.map +1 -0
  16. package/dist/commonjs/funcs/organizationsGetFacilityVendorsExportStatus.d.ts +22 -0
  17. package/dist/commonjs/funcs/organizationsGetFacilityVendorsExportStatus.d.ts.map +1 -0
  18. package/dist/commonjs/funcs/organizationsGetFacilityVendorsExportStatus.js +131 -0
  19. package/dist/commonjs/funcs/organizationsGetFacilityVendorsExportStatus.js.map +1 -0
  20. package/dist/commonjs/lib/config.d.ts +2 -2
  21. package/dist/commonjs/lib/config.js +2 -2
  22. package/dist/commonjs/models/components/csvexportstatusresponse.d.ts +43 -0
  23. package/dist/commonjs/models/components/csvexportstatusresponse.d.ts.map +1 -0
  24. package/dist/commonjs/models/components/csvexportstatusresponse.js +65 -0
  25. package/dist/commonjs/models/components/csvexportstatusresponse.js.map +1 -0
  26. package/dist/commonjs/models/components/index.d.ts +1 -0
  27. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  28. package/dist/commonjs/models/components/index.js +1 -0
  29. package/dist/commonjs/models/components/index.js.map +1 -1
  30. package/dist/commonjs/models/operations/downloadfacilityvendorsexport.d.ts +47 -0
  31. package/dist/commonjs/models/operations/downloadfacilityvendorsexport.d.ts.map +1 -0
  32. package/dist/commonjs/models/operations/downloadfacilityvendorsexport.js +80 -0
  33. package/dist/commonjs/models/operations/downloadfacilityvendorsexport.js.map +1 -0
  34. package/dist/commonjs/models/operations/exportfacilityvendors.d.ts +118 -0
  35. package/dist/commonjs/models/operations/exportfacilityvendors.d.ts.map +1 -0
  36. package/dist/commonjs/models/operations/exportfacilityvendors.js +115 -0
  37. package/dist/commonjs/models/operations/exportfacilityvendors.js.map +1 -0
  38. package/dist/commonjs/models/operations/getfacilityvendorsexportstatus.d.ts +20 -0
  39. package/dist/commonjs/models/operations/getfacilityvendorsexportstatus.d.ts.map +1 -0
  40. package/dist/commonjs/models/operations/getfacilityvendorsexportstatus.js +55 -0
  41. package/dist/commonjs/models/operations/getfacilityvendorsexportstatus.js.map +1 -0
  42. package/dist/commonjs/models/operations/index.d.ts +3 -0
  43. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  44. package/dist/commonjs/models/operations/index.js +3 -0
  45. package/dist/commonjs/models/operations/index.js.map +1 -1
  46. package/dist/commonjs/react-query/index.d.ts +3 -0
  47. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  48. package/dist/commonjs/react-query/index.js +3 -0
  49. package/dist/commonjs/react-query/index.js.map +1 -1
  50. package/dist/commonjs/react-query/organizationsDownloadFacilityVendorsExport.core.d.ts +12 -0
  51. package/dist/commonjs/react-query/organizationsDownloadFacilityVendorsExport.core.d.ts.map +1 -0
  52. package/dist/commonjs/react-query/organizationsDownloadFacilityVendorsExport.core.js +40 -0
  53. package/dist/commonjs/react-query/organizationsDownloadFacilityVendorsExport.core.js.map +1 -0
  54. package/dist/commonjs/react-query/organizationsDownloadFacilityVendorsExport.d.ts +33 -0
  55. package/dist/commonjs/react-query/organizationsDownloadFacilityVendorsExport.d.ts.map +1 -0
  56. package/dist/commonjs/react-query/organizationsDownloadFacilityVendorsExport.js +73 -0
  57. package/dist/commonjs/react-query/organizationsDownloadFacilityVendorsExport.js.map +1 -0
  58. package/dist/commonjs/react-query/organizationsExportFacilityVendors.core.d.ts +19 -0
  59. package/dist/commonjs/react-query/organizationsExportFacilityVendors.core.d.ts.map +1 -0
  60. package/dist/commonjs/react-query/organizationsExportFacilityVendors.core.js +47 -0
  61. package/dist/commonjs/react-query/organizationsExportFacilityVendors.core.js.map +1 -0
  62. package/dist/commonjs/react-query/organizationsExportFacilityVendors.d.ts +77 -0
  63. package/dist/commonjs/react-query/organizationsExportFacilityVendors.d.ts.map +1 -0
  64. package/dist/commonjs/react-query/organizationsExportFacilityVendors.js +97 -0
  65. package/dist/commonjs/react-query/organizationsExportFacilityVendors.js.map +1 -0
  66. package/dist/commonjs/react-query/organizationsGetFacilityVendorsExportStatus.core.d.ts +13 -0
  67. package/dist/commonjs/react-query/organizationsGetFacilityVendorsExportStatus.core.d.ts.map +1 -0
  68. package/dist/commonjs/react-query/organizationsGetFacilityVendorsExportStatus.core.js +40 -0
  69. package/dist/commonjs/react-query/organizationsGetFacilityVendorsExportStatus.core.js.map +1 -0
  70. package/dist/commonjs/react-query/organizationsGetFacilityVendorsExportStatus.d.ts +31 -0
  71. package/dist/commonjs/react-query/organizationsGetFacilityVendorsExportStatus.d.ts.map +1 -0
  72. package/dist/commonjs/react-query/organizationsGetFacilityVendorsExportStatus.js +71 -0
  73. package/dist/commonjs/react-query/organizationsGetFacilityVendorsExportStatus.js.map +1 -0
  74. package/dist/commonjs/sdk/organizations.d.ts +38 -0
  75. package/dist/commonjs/sdk/organizations.d.ts.map +1 -1
  76. package/dist/commonjs/sdk/organizations.js +47 -0
  77. package/dist/commonjs/sdk/organizations.js.map +1 -1
  78. package/dist/esm/__tests__/organizations.test.js +57 -0
  79. package/dist/esm/__tests__/organizations.test.js.map +1 -1
  80. package/dist/esm/__tests__/webhooks.test.js +1 -1
  81. package/dist/esm/__tests__/webhooks.test.js.map +1 -1
  82. package/dist/esm/__tests__/zones.test.js +27 -6
  83. package/dist/esm/__tests__/zones.test.js.map +1 -1
  84. package/dist/esm/funcs/organizationsDownloadFacilityVendorsExport.d.ts +22 -0
  85. package/dist/esm/funcs/organizationsDownloadFacilityVendorsExport.d.ts.map +1 -0
  86. package/dist/esm/funcs/organizationsDownloadFacilityVendorsExport.js +96 -0
  87. package/dist/esm/funcs/organizationsDownloadFacilityVendorsExport.js.map +1 -0
  88. package/dist/esm/funcs/organizationsExportFacilityVendors.d.ts +34 -0
  89. package/dist/esm/funcs/organizationsExportFacilityVendors.d.ts.map +1 -0
  90. package/dist/esm/funcs/organizationsExportFacilityVendors.js +112 -0
  91. package/dist/esm/funcs/organizationsExportFacilityVendors.js.map +1 -0
  92. package/dist/esm/funcs/organizationsGetFacilityVendorsExportStatus.d.ts +22 -0
  93. package/dist/esm/funcs/organizationsGetFacilityVendorsExportStatus.d.ts.map +1 -0
  94. package/dist/esm/funcs/organizationsGetFacilityVendorsExportStatus.js +95 -0
  95. package/dist/esm/funcs/organizationsGetFacilityVendorsExportStatus.js.map +1 -0
  96. package/dist/esm/lib/config.d.ts +2 -2
  97. package/dist/esm/lib/config.js +2 -2
  98. package/dist/esm/models/components/csvexportstatusresponse.d.ts +43 -0
  99. package/dist/esm/models/components/csvexportstatusresponse.d.ts.map +1 -0
  100. package/dist/esm/models/components/csvexportstatusresponse.js +28 -0
  101. package/dist/esm/models/components/csvexportstatusresponse.js.map +1 -0
  102. package/dist/esm/models/components/index.d.ts +1 -0
  103. package/dist/esm/models/components/index.d.ts.map +1 -1
  104. package/dist/esm/models/components/index.js +1 -0
  105. package/dist/esm/models/components/index.js.map +1 -1
  106. package/dist/esm/models/operations/downloadfacilityvendorsexport.d.ts +47 -0
  107. package/dist/esm/models/operations/downloadfacilityvendorsexport.d.ts.map +1 -0
  108. package/dist/esm/models/operations/downloadfacilityvendorsexport.js +41 -0
  109. package/dist/esm/models/operations/downloadfacilityvendorsexport.js.map +1 -0
  110. package/dist/esm/models/operations/exportfacilityvendors.d.ts +118 -0
  111. package/dist/esm/models/operations/exportfacilityvendors.d.ts.map +1 -0
  112. package/dist/esm/models/operations/exportfacilityvendors.js +76 -0
  113. package/dist/esm/models/operations/exportfacilityvendors.js.map +1 -0
  114. package/dist/esm/models/operations/getfacilityvendorsexportstatus.d.ts +20 -0
  115. package/dist/esm/models/operations/getfacilityvendorsexportstatus.d.ts.map +1 -0
  116. package/dist/esm/models/operations/getfacilityvendorsexportstatus.js +18 -0
  117. package/dist/esm/models/operations/getfacilityvendorsexportstatus.js.map +1 -0
  118. package/dist/esm/models/operations/index.d.ts +3 -0
  119. package/dist/esm/models/operations/index.d.ts.map +1 -1
  120. package/dist/esm/models/operations/index.js +3 -0
  121. package/dist/esm/models/operations/index.js.map +1 -1
  122. package/dist/esm/react-query/index.d.ts +3 -0
  123. package/dist/esm/react-query/index.d.ts.map +1 -1
  124. package/dist/esm/react-query/index.js +3 -0
  125. package/dist/esm/react-query/index.js.map +1 -1
  126. package/dist/esm/react-query/organizationsDownloadFacilityVendorsExport.core.d.ts +12 -0
  127. package/dist/esm/react-query/organizationsDownloadFacilityVendorsExport.core.d.ts.map +1 -0
  128. package/dist/esm/react-query/organizationsDownloadFacilityVendorsExport.core.js +35 -0
  129. package/dist/esm/react-query/organizationsDownloadFacilityVendorsExport.core.js.map +1 -0
  130. package/dist/esm/react-query/organizationsDownloadFacilityVendorsExport.d.ts +33 -0
  131. package/dist/esm/react-query/organizationsDownloadFacilityVendorsExport.d.ts.map +1 -0
  132. package/dist/esm/react-query/organizationsDownloadFacilityVendorsExport.js +63 -0
  133. package/dist/esm/react-query/organizationsDownloadFacilityVendorsExport.js.map +1 -0
  134. package/dist/esm/react-query/organizationsExportFacilityVendors.core.d.ts +19 -0
  135. package/dist/esm/react-query/organizationsExportFacilityVendors.core.d.ts.map +1 -0
  136. package/dist/esm/react-query/organizationsExportFacilityVendors.core.js +42 -0
  137. package/dist/esm/react-query/organizationsExportFacilityVendors.core.js.map +1 -0
  138. package/dist/esm/react-query/organizationsExportFacilityVendors.d.ts +77 -0
  139. package/dist/esm/react-query/organizationsExportFacilityVendors.d.ts.map +1 -0
  140. package/dist/esm/react-query/organizationsExportFacilityVendors.js +87 -0
  141. package/dist/esm/react-query/organizationsExportFacilityVendors.js.map +1 -0
  142. package/dist/esm/react-query/organizationsGetFacilityVendorsExportStatus.core.d.ts +13 -0
  143. package/dist/esm/react-query/organizationsGetFacilityVendorsExportStatus.core.d.ts.map +1 -0
  144. package/dist/esm/react-query/organizationsGetFacilityVendorsExportStatus.core.js +35 -0
  145. package/dist/esm/react-query/organizationsGetFacilityVendorsExportStatus.core.js.map +1 -0
  146. package/dist/esm/react-query/organizationsGetFacilityVendorsExportStatus.d.ts +31 -0
  147. package/dist/esm/react-query/organizationsGetFacilityVendorsExportStatus.d.ts.map +1 -0
  148. package/dist/esm/react-query/organizationsGetFacilityVendorsExportStatus.js +61 -0
  149. package/dist/esm/react-query/organizationsGetFacilityVendorsExportStatus.js.map +1 -0
  150. package/dist/esm/sdk/organizations.d.ts +38 -0
  151. package/dist/esm/sdk/organizations.d.ts.map +1 -1
  152. package/dist/esm/sdk/organizations.js +47 -0
  153. package/dist/esm/sdk/organizations.js.map +1 -1
  154. package/jsr.json +1 -1
  155. package/package.json +1 -1
  156. package/src/__tests__/organizations.test.ts +66 -0
  157. package/src/__tests__/webhooks.test.ts +1 -1
  158. package/src/__tests__/zones.test.ts +27 -6
  159. package/src/funcs/organizationsDownloadFacilityVendorsExport.ts +202 -0
  160. package/src/funcs/organizationsExportFacilityVendors.ts +202 -0
  161. package/src/funcs/organizationsGetFacilityVendorsExportStatus.ts +188 -0
  162. package/src/lib/config.ts +2 -2
  163. package/src/models/components/csvexportstatusresponse.ts +79 -0
  164. package/src/models/components/index.ts +1 -0
  165. package/src/models/operations/downloadfacilityvendorsexport.ts +124 -0
  166. package/src/models/operations/exportfacilityvendors.ts +206 -0
  167. package/src/models/operations/getfacilityvendorsexportstatus.ts +47 -0
  168. package/src/models/operations/index.ts +3 -0
  169. package/src/react-query/index.ts +3 -0
  170. package/src/react-query/organizationsDownloadFacilityVendorsExport.core.ts +84 -0
  171. package/src/react-query/organizationsDownloadFacilityVendorsExport.ts +155 -0
  172. package/src/react-query/organizationsExportFacilityVendors.core.ts +94 -0
  173. package/src/react-query/organizationsExportFacilityVendors.ts +200 -0
  174. package/src/react-query/organizationsGetFacilityVendorsExportStatus.core.ts +84 -0
  175. package/src/react-query/organizationsGetFacilityVendorsExportStatus.ts +153 -0
  176. package/src/sdk/organizations.ts +71 -0
@@ -0,0 +1,188 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { GreenSecurityCore } from "../core.js";
6
+ import { 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 * as components from "../models/components/index.js";
15
+ import { GreenSecurityError } from "../models/errors/greensecurityerror.js";
16
+ import {
17
+ ConnectionError,
18
+ InvalidRequestError,
19
+ RequestAbortedError,
20
+ RequestTimeoutError,
21
+ UnexpectedClientError,
22
+ } from "../models/errors/httpclienterrors.js";
23
+ import * as errors from "../models/errors/index.js";
24
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
25
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
26
+ import * as operations from "../models/operations/index.js";
27
+ import { APICall, APIPromise } from "../types/async.js";
28
+ import { Result } from "../types/fp.js";
29
+
30
+ /**
31
+ * Get facility vendors export status
32
+ *
33
+ * @remarks
34
+ * Poll the state of an asynchronous facility vendors export job. When `ready` is true,
35
+ * the export is complete and can be downloaded via the download endpoint.
36
+ *
37
+ * If set, this operation will use {@link Security.bearerJwt} from the global security.
38
+ */
39
+ export function organizationsGetFacilityVendorsExportStatus(
40
+ client: GreenSecurityCore,
41
+ request: operations.GetFacilityVendorsExportStatusRequest,
42
+ options?: RequestOptions,
43
+ ): APIPromise<
44
+ Result<
45
+ components.CsvExportStatusResponse,
46
+ | errors.ApiErrorResponse
47
+ | GreenSecurityError
48
+ | ResponseValidationError
49
+ | ConnectionError
50
+ | RequestAbortedError
51
+ | RequestTimeoutError
52
+ | InvalidRequestError
53
+ | UnexpectedClientError
54
+ | SDKValidationError
55
+ >
56
+ > {
57
+ return new APIPromise($do(
58
+ client,
59
+ request,
60
+ options,
61
+ ));
62
+ }
63
+
64
+ async function $do(
65
+ client: GreenSecurityCore,
66
+ request: operations.GetFacilityVendorsExportStatusRequest,
67
+ options?: RequestOptions,
68
+ ): Promise<
69
+ [
70
+ Result<
71
+ components.CsvExportStatusResponse,
72
+ | errors.ApiErrorResponse
73
+ | GreenSecurityError
74
+ | ResponseValidationError
75
+ | ConnectionError
76
+ | RequestAbortedError
77
+ | RequestTimeoutError
78
+ | InvalidRequestError
79
+ | UnexpectedClientError
80
+ | SDKValidationError
81
+ >,
82
+ APICall,
83
+ ]
84
+ > {
85
+ const parsed = safeParse(
86
+ request,
87
+ (value) =>
88
+ operations.GetFacilityVendorsExportStatusRequest$outboundSchema.parse(
89
+ value,
90
+ ),
91
+ "Input validation failed",
92
+ );
93
+ if (!parsed.ok) {
94
+ return [parsed, { status: "invalid" }];
95
+ }
96
+ const payload = parsed.value;
97
+ const body = null;
98
+
99
+ const pathParams = {
100
+ export_id: encodeSimple("export_id", payload.export_id, {
101
+ explode: false,
102
+ charEncoding: "percent",
103
+ }),
104
+ id: encodeSimple("id", payload.id, {
105
+ explode: false,
106
+ charEncoding: "percent",
107
+ }),
108
+ };
109
+ const path = pathToFunc("/facilities/{id}/vendors/export/status/{export_id}")(
110
+ pathParams,
111
+ );
112
+
113
+ const headers = new Headers(compactMap({
114
+ Accept: "application/json",
115
+ }));
116
+
117
+ const securityInput = await extractSecurity(client._options.security);
118
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1]);
119
+
120
+ const context = {
121
+ options: client._options,
122
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
123
+ operationID: "getFacilityVendorsExportStatus",
124
+ oAuth2Scopes: null,
125
+
126
+ resolvedSecurity: requestSecurity,
127
+
128
+ securitySource: client._options.security,
129
+ retryConfig: options?.retries
130
+ || client._options.retryConfig
131
+ || { strategy: "none" },
132
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
133
+ };
134
+
135
+ const requestRes = client._createRequest(context, {
136
+ security: requestSecurity,
137
+ method: "GET",
138
+ baseURL: options?.serverURL,
139
+ path: path,
140
+ headers: headers,
141
+ body: body,
142
+ userAgent: client._options.userAgent,
143
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
144
+ }, options);
145
+ if (!requestRes.ok) {
146
+ return [requestRes, { status: "invalid" }];
147
+ }
148
+ const req = requestRes.value;
149
+
150
+ const doResult = await client._do(req, {
151
+ context,
152
+ isErrorStatusCode: (statusCode: number) =>
153
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
154
+ retryConfig: context.retryConfig,
155
+ retryCodes: context.retryCodes,
156
+ });
157
+ if (!doResult.ok) {
158
+ return [doResult, { status: "request-error", request: req }];
159
+ }
160
+ const response = doResult.value;
161
+
162
+ const responseFields = {
163
+ HttpMeta: { Response: response, Request: req },
164
+ };
165
+
166
+ const [result] = await M.match<
167
+ components.CsvExportStatusResponse,
168
+ | errors.ApiErrorResponse
169
+ | GreenSecurityError
170
+ | ResponseValidationError
171
+ | ConnectionError
172
+ | RequestAbortedError
173
+ | RequestTimeoutError
174
+ | InvalidRequestError
175
+ | UnexpectedClientError
176
+ | SDKValidationError
177
+ >(
178
+ M.json(200, components.CsvExportStatusResponse$inboundSchema),
179
+ M.jsonErr([400, 401, 403, 404, 422], errors.ApiErrorResponse$inboundSchema),
180
+ M.fail("4XX"),
181
+ M.fail([500, "5XX"]),
182
+ )(response, req, { extraFields: responseFields });
183
+ if (!result.ok) {
184
+ return [result, { status: "complete", request: req, response }];
185
+ }
186
+
187
+ return [result, { status: "complete", request: req, response }];
188
+ }
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.43.5",
83
- sdkVersion: "0.44.0-beta.18",
83
+ sdkVersion: "0.44.0-beta.19",
84
84
  genVersion: "2.900.1",
85
85
  userAgent:
86
- "speakeasy-sdk/typescript 0.44.0-beta.18 2.900.1 0.43.5 @greensecurity/javascript-sdk",
86
+ "speakeasy-sdk/typescript 0.44.0-beta.19 2.900.1 0.43.5 @greensecurity/javascript-sdk",
87
87
  } as const;
@@ -0,0 +1,79 @@
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
+ * Returned when polling the status of an asynchronous CSV export job. When `ready` is true,
14
+ *
15
+ * @remarks
16
+ * the export is complete and can be downloaded via the URL in `download_url`.
17
+ */
18
+ export type CsvExportStatusResponse = {
19
+ /**
20
+ * When true, the export is ready for download.
21
+ */
22
+ ready: boolean;
23
+ /**
24
+ * The export job identifier.
25
+ */
26
+ statusId: string;
27
+ /**
28
+ * URL to download the CSV (present only when `ready` is true).
29
+ */
30
+ downloadUrl?: string | undefined;
31
+ /**
32
+ * When the export job completed.
33
+ */
34
+ finishedAt?: string | undefined;
35
+ /**
36
+ * When the export job started.
37
+ */
38
+ startedAt?: string | undefined;
39
+ /**
40
+ * Timestamp of the last progress heartbeat from the background job. Updated on each pagination loop while the job is running; on completion or failure it equals `finished_at`.
41
+ */
42
+ heartbeat?: string | undefined;
43
+ /**
44
+ * Error message if the export failed.
45
+ */
46
+ error?: string | undefined;
47
+ };
48
+
49
+ /** @internal */
50
+ export const CsvExportStatusResponse$inboundSchema: z.ZodType<
51
+ CsvExportStatusResponse,
52
+ z.ZodTypeDef,
53
+ unknown
54
+ > = z.object({
55
+ ready: types.boolean(),
56
+ status_id: types.string(),
57
+ download_url: types.optional(types.string()),
58
+ finished_at: types.optional(types.string()),
59
+ started_at: types.optional(types.string()),
60
+ heartbeat: types.optional(types.string()),
61
+ error: types.optional(types.string()),
62
+ }).transform((v) => {
63
+ return remap$(v, {
64
+ "status_id": "statusId",
65
+ "download_url": "downloadUrl",
66
+ "finished_at": "finishedAt",
67
+ "started_at": "startedAt",
68
+ });
69
+ });
70
+
71
+ export function csvExportStatusResponseFromJSON(
72
+ jsonString: string,
73
+ ): SafeParseResult<CsvExportStatusResponse, SDKValidationError> {
74
+ return safeParse(
75
+ jsonString,
76
+ (x) => CsvExportStatusResponse$inboundSchema.parse(JSON.parse(x)),
77
+ `Failed to parse 'CsvExportStatusResponse' from JSON`,
78
+ );
79
+ }
@@ -20,6 +20,7 @@ export * from "./credentialdocument.js";
20
20
  export * from "./credentialstatus.js";
21
21
  export * from "./credit.js";
22
22
  export * from "./csvexportenqueuedresponse.js";
23
+ export * from "./csvexportstatusresponse.js";
23
24
  export * from "./datarequest.js";
24
25
  export * from "./deleteapiresponse.js";
25
26
  export * from "./department.js";
@@ -0,0 +1,124 @@
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
+ export type DownloadFacilityVendorsExportRequest = {
13
+ /**
14
+ * The facility whose export is being downloaded.
15
+ */
16
+ id: number;
17
+ /**
18
+ * Export id returned by the export endpoint (e.g. `fv_export_42`).
19
+ */
20
+ exportId: string;
21
+ };
22
+
23
+ /**
24
+ * Export is still being generated
25
+ */
26
+ export type DownloadFacilityVendorsExportResponseBody = {
27
+ /**
28
+ * Always `false` when returned by this endpoint.
29
+ */
30
+ ready?: boolean | undefined;
31
+ /**
32
+ * Human-readable message about the export status.
33
+ */
34
+ message?: string | undefined;
35
+ };
36
+
37
+ export type DownloadFacilityVendorsExportResponse = {
38
+ headers: { [k: string]: Array<string> };
39
+ result?: DownloadFacilityVendorsExportResponseBody | undefined;
40
+ };
41
+
42
+ /** @internal */
43
+ export type DownloadFacilityVendorsExportRequest$Outbound = {
44
+ id: number;
45
+ export_id: string;
46
+ };
47
+
48
+ /** @internal */
49
+ export const DownloadFacilityVendorsExportRequest$outboundSchema: z.ZodType<
50
+ DownloadFacilityVendorsExportRequest$Outbound,
51
+ z.ZodTypeDef,
52
+ DownloadFacilityVendorsExportRequest
53
+ > = z.object({
54
+ id: z.number().int(),
55
+ exportId: z.string(),
56
+ }).transform((v) => {
57
+ return remap$(v, {
58
+ exportId: "export_id",
59
+ });
60
+ });
61
+
62
+ export function downloadFacilityVendorsExportRequestToJSON(
63
+ downloadFacilityVendorsExportRequest: DownloadFacilityVendorsExportRequest,
64
+ ): string {
65
+ return JSON.stringify(
66
+ DownloadFacilityVendorsExportRequest$outboundSchema.parse(
67
+ downloadFacilityVendorsExportRequest,
68
+ ),
69
+ );
70
+ }
71
+
72
+ /** @internal */
73
+ export const DownloadFacilityVendorsExportResponseBody$inboundSchema: z.ZodType<
74
+ DownloadFacilityVendorsExportResponseBody,
75
+ z.ZodTypeDef,
76
+ unknown
77
+ > = z.object({
78
+ ready: types.optional(types.boolean()),
79
+ message: types.optional(types.string()),
80
+ });
81
+
82
+ export function downloadFacilityVendorsExportResponseBodyFromJSON(
83
+ jsonString: string,
84
+ ): SafeParseResult<
85
+ DownloadFacilityVendorsExportResponseBody,
86
+ SDKValidationError
87
+ > {
88
+ return safeParse(
89
+ jsonString,
90
+ (x) =>
91
+ DownloadFacilityVendorsExportResponseBody$inboundSchema.parse(
92
+ JSON.parse(x),
93
+ ),
94
+ `Failed to parse 'DownloadFacilityVendorsExportResponseBody' from JSON`,
95
+ );
96
+ }
97
+
98
+ /** @internal */
99
+ export const DownloadFacilityVendorsExportResponse$inboundSchema: z.ZodType<
100
+ DownloadFacilityVendorsExportResponse,
101
+ z.ZodTypeDef,
102
+ unknown
103
+ > = z.object({
104
+ Headers: z.record(z.array(z.string())).default({}),
105
+ Result: types.optional(
106
+ z.lazy(() => DownloadFacilityVendorsExportResponseBody$inboundSchema),
107
+ ),
108
+ }).transform((v) => {
109
+ return remap$(v, {
110
+ "Headers": "headers",
111
+ "Result": "result",
112
+ });
113
+ });
114
+
115
+ export function downloadFacilityVendorsExportResponseFromJSON(
116
+ jsonString: string,
117
+ ): SafeParseResult<DownloadFacilityVendorsExportResponse, SDKValidationError> {
118
+ return safeParse(
119
+ jsonString,
120
+ (x) =>
121
+ DownloadFacilityVendorsExportResponse$inboundSchema.parse(JSON.parse(x)),
122
+ `Failed to parse 'DownloadFacilityVendorsExportResponse' from JSON`,
123
+ );
124
+ }
@@ -0,0 +1,206 @@
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 { ClosedEnum } from "../../types/enums.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import * as types from "../../types/primitives.js";
11
+ import { smartUnion } from "../../types/smartUnion.js";
12
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
13
+
14
+ /**
15
+ * Filter rows to a single facility access status. Omit for "All".
16
+ */
17
+ export const ExportFacilityVendorsQueryParamStatus = {
18
+ Approved: "approved",
19
+ Pending: "pending",
20
+ Denied: "denied",
21
+ } as const;
22
+ /**
23
+ * Filter rows to a single facility access status. Omit for "All".
24
+ */
25
+ export type ExportFacilityVendorsQueryParamStatus = ClosedEnum<
26
+ typeof ExportFacilityVendorsQueryParamStatus
27
+ >;
28
+
29
+ /**
30
+ * Sort field used by the exporter when ordering rows in the CSV. Defaults to `name`.
31
+ */
32
+ export const ExportFacilityVendorsQueryParamSort = {
33
+ Id: "id",
34
+ Name: "name",
35
+ LastName: "last_name",
36
+ Email: "email",
37
+ Status: "status",
38
+ } as const;
39
+ /**
40
+ * Sort field used by the exporter when ordering rows in the CSV. Defaults to `name`.
41
+ */
42
+ export type ExportFacilityVendorsQueryParamSort = ClosedEnum<
43
+ typeof ExportFacilityVendorsQueryParamSort
44
+ >;
45
+
46
+ export const QueryParam2 = {
47
+ Zero: 0,
48
+ One: 1,
49
+ } as const;
50
+ export type QueryParam2 = ClosedEnum<typeof QueryParam2>;
51
+
52
+ /**
53
+ * Sort descending flag.
54
+ */
55
+ export type QueryParamDesc = boolean | QueryParam2;
56
+
57
+ export type ExportFacilityVendorsRequest = {
58
+ /**
59
+ * The facility whose vendors to export.
60
+ */
61
+ id: number;
62
+ /**
63
+ * API users only — the company whose vendors to export. Ignored for company managers / vendors (resolved from the session).
64
+ */
65
+ companyId?: number | undefined;
66
+ /**
67
+ * Filter rows to a single facility access status. Omit for "All".
68
+ */
69
+ status?: ExportFacilityVendorsQueryParamStatus | undefined;
70
+ /**
71
+ * Single search term applied case-insensitively across first name, last name, full
72
+ *
73
+ * @remarks
74
+ * name, email, and any company custom-field value the vendor has set for a field
75
+ * flagged `show_to_vendor`.
76
+ */
77
+ search?: string | undefined;
78
+ /**
79
+ * Sort field used by the exporter when ordering rows in the CSV. Defaults to `name`.
80
+ */
81
+ sort?: ExportFacilityVendorsQueryParamSort | undefined;
82
+ /**
83
+ * Sort descending flag.
84
+ */
85
+ desc?: boolean | QueryParam2 | undefined;
86
+ /**
87
+ * Page size used by the exporter while paginating results server-side. Does not affect the size of the CSV (all matching rows are included).
88
+ */
89
+ itemsPerPage?: number | undefined;
90
+ };
91
+
92
+ /**
93
+ * Export request accepted and job enqueued.
94
+ */
95
+ export type ExportFacilityVendorsResponseBody = {
96
+ /**
97
+ * URL to poll for export status.
98
+ */
99
+ statusUrl: string;
100
+ /**
101
+ * URL to download the exported file when ready.
102
+ */
103
+ downloadUrl: string;
104
+ /**
105
+ * Status token used to check the export status.
106
+ */
107
+ statusId: string;
108
+ };
109
+
110
+ /** @internal */
111
+ export const ExportFacilityVendorsQueryParamStatus$outboundSchema:
112
+ z.ZodNativeEnum<typeof ExportFacilityVendorsQueryParamStatus> = z.nativeEnum(
113
+ ExportFacilityVendorsQueryParamStatus,
114
+ );
115
+
116
+ /** @internal */
117
+ export const ExportFacilityVendorsQueryParamSort$outboundSchema:
118
+ z.ZodNativeEnum<typeof ExportFacilityVendorsQueryParamSort> = z.nativeEnum(
119
+ ExportFacilityVendorsQueryParamSort,
120
+ );
121
+
122
+ /** @internal */
123
+ export const QueryParam2$outboundSchema: z.ZodNativeEnum<typeof QueryParam2> = z
124
+ .nativeEnum(QueryParam2);
125
+
126
+ /** @internal */
127
+ export type QueryParamDesc$Outbound = boolean | number;
128
+
129
+ /** @internal */
130
+ export const QueryParamDesc$outboundSchema: z.ZodType<
131
+ QueryParamDesc$Outbound,
132
+ z.ZodTypeDef,
133
+ QueryParamDesc
134
+ > = smartUnion([z.boolean(), QueryParam2$outboundSchema]);
135
+
136
+ export function queryParamDescToJSON(queryParamDesc: QueryParamDesc): string {
137
+ return JSON.stringify(QueryParamDesc$outboundSchema.parse(queryParamDesc));
138
+ }
139
+
140
+ /** @internal */
141
+ export type ExportFacilityVendorsRequest$Outbound = {
142
+ id: number;
143
+ company_id?: number | undefined;
144
+ status?: string | undefined;
145
+ search?: string | undefined;
146
+ sort?: string | undefined;
147
+ desc?: boolean | number | undefined;
148
+ items_per_page?: number | undefined;
149
+ };
150
+
151
+ /** @internal */
152
+ export const ExportFacilityVendorsRequest$outboundSchema: z.ZodType<
153
+ ExportFacilityVendorsRequest$Outbound,
154
+ z.ZodTypeDef,
155
+ ExportFacilityVendorsRequest
156
+ > = z.object({
157
+ id: z.number().int(),
158
+ companyId: z.number().int().optional(),
159
+ status: ExportFacilityVendorsQueryParamStatus$outboundSchema.optional(),
160
+ search: z.string().optional(),
161
+ sort: ExportFacilityVendorsQueryParamSort$outboundSchema.optional(),
162
+ desc: smartUnion([z.boolean(), QueryParam2$outboundSchema]).optional(),
163
+ itemsPerPage: z.number().int().optional(),
164
+ }).transform((v) => {
165
+ return remap$(v, {
166
+ companyId: "company_id",
167
+ itemsPerPage: "items_per_page",
168
+ });
169
+ });
170
+
171
+ export function exportFacilityVendorsRequestToJSON(
172
+ exportFacilityVendorsRequest: ExportFacilityVendorsRequest,
173
+ ): string {
174
+ return JSON.stringify(
175
+ ExportFacilityVendorsRequest$outboundSchema.parse(
176
+ exportFacilityVendorsRequest,
177
+ ),
178
+ );
179
+ }
180
+
181
+ /** @internal */
182
+ export const ExportFacilityVendorsResponseBody$inboundSchema: z.ZodType<
183
+ ExportFacilityVendorsResponseBody,
184
+ z.ZodTypeDef,
185
+ unknown
186
+ > = z.object({
187
+ status_url: types.string(),
188
+ download_url: types.string(),
189
+ status_id: types.string(),
190
+ }).transform((v) => {
191
+ return remap$(v, {
192
+ "status_url": "statusUrl",
193
+ "download_url": "downloadUrl",
194
+ "status_id": "statusId",
195
+ });
196
+ });
197
+
198
+ export function exportFacilityVendorsResponseBodyFromJSON(
199
+ jsonString: string,
200
+ ): SafeParseResult<ExportFacilityVendorsResponseBody, SDKValidationError> {
201
+ return safeParse(
202
+ jsonString,
203
+ (x) => ExportFacilityVendorsResponseBody$inboundSchema.parse(JSON.parse(x)),
204
+ `Failed to parse 'ExportFacilityVendorsResponseBody' from JSON`,
205
+ );
206
+ }
@@ -0,0 +1,47 @@
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
+
8
+ export type GetFacilityVendorsExportStatusRequest = {
9
+ /**
10
+ * The facility whose export is being polled.
11
+ */
12
+ id: number;
13
+ /**
14
+ * Export status id returned by the export endpoint (e.g. `fv_export_42`).
15
+ */
16
+ exportId: string;
17
+ };
18
+
19
+ /** @internal */
20
+ export type GetFacilityVendorsExportStatusRequest$Outbound = {
21
+ id: number;
22
+ export_id: string;
23
+ };
24
+
25
+ /** @internal */
26
+ export const GetFacilityVendorsExportStatusRequest$outboundSchema: z.ZodType<
27
+ GetFacilityVendorsExportStatusRequest$Outbound,
28
+ z.ZodTypeDef,
29
+ GetFacilityVendorsExportStatusRequest
30
+ > = z.object({
31
+ id: z.number().int(),
32
+ exportId: z.string(),
33
+ }).transform((v) => {
34
+ return remap$(v, {
35
+ exportId: "export_id",
36
+ });
37
+ });
38
+
39
+ export function getFacilityVendorsExportStatusRequestToJSON(
40
+ getFacilityVendorsExportStatusRequest: GetFacilityVendorsExportStatusRequest,
41
+ ): string {
42
+ return JSON.stringify(
43
+ GetFacilityVendorsExportStatusRequest$outboundSchema.parse(
44
+ getFacilityVendorsExportStatusRequest,
45
+ ),
46
+ );
47
+ }
@@ -34,17 +34,20 @@ export * from "./deletepaymentprofile.js";
34
34
  export * from "./deletevendorcredentialfile.js";
35
35
  export * from "./deletevendormanagedbycompany.js";
36
36
  export * from "./downloadcompanytargetfacilitiesexport.js";
37
+ export * from "./downloadfacilityvendorsexport.js";
37
38
  export * from "./downloadinvoicesexport.js";
38
39
  export * from "./downloadvendorscansexport.js";
39
40
  export * from "./downloadvendorsexport.js";
40
41
  export * from "./expeditetimeremaining.js";
41
42
  export * from "./exportcompanytargetfacilities.js";
43
+ export * from "./exportfacilityvendors.js";
42
44
  export * from "./exportvendorscans.js";
43
45
  export * from "./getcompany.js";
44
46
  export * from "./getcompanytargetfacilitiesexportstatus.js";
45
47
  export * from "./getcurrentuser.js";
46
48
  export * from "./getevent.js";
47
49
  export * from "./getfacility.js";
50
+ export * from "./getfacilityvendorsexportstatus.js";
48
51
  export * from "./getfhirconfig.js";
49
52
  export * from "./getinvoice.js";
50
53
  export * from "./getinvoicesexportstatus.js";
@@ -46,9 +46,12 @@ export * from "./mobileDevicesAddMobileDevice.js";
46
46
  export * from "./organizationsCreateCompanyTargetFacility.js";
47
47
  export * from "./organizationsDeleteCompanyTargetFacility.js";
48
48
  export * from "./organizationsDownloadCompanyTargetFacilitiesExport.js";
49
+ export * from "./organizationsDownloadFacilityVendorsExport.js";
49
50
  export * from "./organizationsExportCompanyTargetFacilities.js";
51
+ export * from "./organizationsExportFacilityVendors.js";
50
52
  export * from "./organizationsGetCompanyTargetFacilitiesExportStatus.js";
51
53
  export * from "./organizationsGetFacility.js";
54
+ export * from "./organizationsGetFacilityVendorsExportStatus.js";
52
55
  export * from "./organizationsListCompanyTargetFacilities.js";
53
56
  export * from "./organizationsListFacilityVendors.js";
54
57
  export * from "./organizationsListOrSearchDepartmentContacts.js";