@greensecurity/javascript-sdk 0.43.1-beta.42 → 0.43.1-beta.46

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 (188) hide show
  1. package/README.md +3 -0
  2. package/dist/commonjs/__tests__/invoices.test.js +32 -0
  3. package/dist/commonjs/__tests__/invoices.test.js.map +1 -1
  4. package/dist/commonjs/__tests__/zones.test.js +1 -1
  5. package/dist/commonjs/funcs/alertsListAlerts.js +4 -2
  6. package/dist/commonjs/funcs/alertsListAlerts.js.map +1 -1
  7. package/dist/commonjs/funcs/invoicesListInvoices.d.ts +33 -0
  8. package/dist/commonjs/funcs/invoicesListInvoices.d.ts.map +1 -0
  9. package/dist/commonjs/funcs/invoicesListInvoices.js +177 -0
  10. package/dist/commonjs/funcs/invoicesListInvoices.js.map +1 -0
  11. package/dist/commonjs/lib/config.d.ts +2 -2
  12. package/dist/commonjs/lib/config.js +2 -2
  13. package/dist/commonjs/models/components/expand.d.ts +1 -0
  14. package/dist/commonjs/models/components/expand.d.ts.map +1 -1
  15. package/dist/commonjs/models/components/expand.js +1 -0
  16. package/dist/commonjs/models/components/expand.js.map +1 -1
  17. package/dist/commonjs/models/components/index.d.ts +1 -0
  18. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  19. package/dist/commonjs/models/components/index.js +1 -0
  20. package/dist/commonjs/models/components/index.js.map +1 -1
  21. package/dist/commonjs/models/components/invoice.d.ts +1 -0
  22. package/dist/commonjs/models/components/invoice.d.ts.map +1 -1
  23. package/dist/commonjs/models/components/invoice.js +1 -0
  24. package/dist/commonjs/models/components/invoice.js.map +1 -1
  25. package/dist/commonjs/models/components/invoicefinancialstatus.d.ts +10 -0
  26. package/dist/commonjs/models/components/invoicefinancialstatus.d.ts.map +1 -0
  27. package/dist/commonjs/models/components/invoicefinancialstatus.js +47 -0
  28. package/dist/commonjs/models/components/invoicefinancialstatus.js.map +1 -0
  29. package/dist/commonjs/models/components/supervisor.d.ts +2 -2
  30. package/dist/commonjs/models/components/supervisor.d.ts.map +1 -1
  31. package/dist/commonjs/models/components/supervisor.js +2 -2
  32. package/dist/commonjs/models/components/supervisor.js.map +1 -1
  33. package/dist/commonjs/models/components/vendor.d.ts +1 -1
  34. package/dist/commonjs/models/components/vendor.d.ts.map +1 -1
  35. package/dist/commonjs/models/components/vendor.js +1 -1
  36. package/dist/commonjs/models/components/vendor.js.map +1 -1
  37. package/dist/commonjs/models/operations/index.d.ts +1 -0
  38. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  39. package/dist/commonjs/models/operations/index.js +1 -0
  40. package/dist/commonjs/models/operations/index.js.map +1 -1
  41. package/dist/commonjs/models/operations/listalerts.d.ts +5 -0
  42. package/dist/commonjs/models/operations/listalerts.d.ts.map +1 -1
  43. package/dist/commonjs/models/operations/listalerts.js +2 -0
  44. package/dist/commonjs/models/operations/listalerts.js.map +1 -1
  45. package/dist/commonjs/models/operations/listinvoices.d.ts +92 -0
  46. package/dist/commonjs/models/operations/listinvoices.d.ts.map +1 -0
  47. package/dist/commonjs/models/operations/listinvoices.js +96 -0
  48. package/dist/commonjs/models/operations/listinvoices.js.map +1 -0
  49. package/dist/commonjs/models/operations/listvendorinvoices.d.ts +3 -17
  50. package/dist/commonjs/models/operations/listvendorinvoices.d.ts.map +1 -1
  51. package/dist/commonjs/models/operations/listvendorinvoices.js +3 -11
  52. package/dist/commonjs/models/operations/listvendorinvoices.js.map +1 -1
  53. package/dist/commonjs/models/operations/updateuseralerts.d.ts +7 -0
  54. package/dist/commonjs/models/operations/updateuseralerts.d.ts.map +1 -1
  55. package/dist/commonjs/models/operations/updateuseralerts.js +2 -0
  56. package/dist/commonjs/models/operations/updateuseralerts.js.map +1 -1
  57. package/dist/commonjs/react-query/alertsListAlerts.core.d.ts +2 -0
  58. package/dist/commonjs/react-query/alertsListAlerts.core.d.ts.map +1 -1
  59. package/dist/commonjs/react-query/alertsListAlerts.core.js +2 -0
  60. package/dist/commonjs/react-query/alertsListAlerts.core.js.map +1 -1
  61. package/dist/commonjs/react-query/alertsListAlerts.d.ts +2 -0
  62. package/dist/commonjs/react-query/alertsListAlerts.d.ts.map +1 -1
  63. package/dist/commonjs/react-query/alertsListAlerts.js.map +1 -1
  64. package/dist/commonjs/react-query/index.d.ts +1 -0
  65. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  66. package/dist/commonjs/react-query/index.js +1 -0
  67. package/dist/commonjs/react-query/index.js.map +1 -1
  68. package/dist/commonjs/react-query/invoicesListInvoices.core.d.ts +52 -0
  69. package/dist/commonjs/react-query/invoicesListInvoices.core.d.ts.map +1 -0
  70. package/dist/commonjs/react-query/invoicesListInvoices.core.js +107 -0
  71. package/dist/commonjs/react-query/invoicesListInvoices.core.js.map +1 -0
  72. package/dist/commonjs/react-query/invoicesListInvoices.d.ts +116 -0
  73. package/dist/commonjs/react-query/invoicesListInvoices.d.ts.map +1 -0
  74. package/dist/commonjs/react-query/invoicesListInvoices.js +148 -0
  75. package/dist/commonjs/react-query/invoicesListInvoices.js.map +1 -0
  76. package/dist/commonjs/react-query/vendorsListVendorInvoices.core.d.ts +2 -2
  77. package/dist/commonjs/react-query/vendorsListVendorInvoices.d.ts +2 -2
  78. package/dist/commonjs/sdk/invoices.d.ts +22 -0
  79. package/dist/commonjs/sdk/invoices.d.ts.map +1 -1
  80. package/dist/commonjs/sdk/invoices.js +23 -0
  81. package/dist/commonjs/sdk/invoices.js.map +1 -1
  82. package/dist/esm/__tests__/invoices.test.js +32 -0
  83. package/dist/esm/__tests__/invoices.test.js.map +1 -1
  84. package/dist/esm/__tests__/zones.test.js +1 -1
  85. package/dist/esm/funcs/alertsListAlerts.js +5 -3
  86. package/dist/esm/funcs/alertsListAlerts.js.map +1 -1
  87. package/dist/esm/funcs/invoicesListInvoices.d.ts +33 -0
  88. package/dist/esm/funcs/invoicesListInvoices.d.ts.map +1 -0
  89. package/dist/esm/funcs/invoicesListInvoices.js +141 -0
  90. package/dist/esm/funcs/invoicesListInvoices.js.map +1 -0
  91. package/dist/esm/lib/config.d.ts +2 -2
  92. package/dist/esm/lib/config.js +2 -2
  93. package/dist/esm/models/components/expand.d.ts +1 -0
  94. package/dist/esm/models/components/expand.d.ts.map +1 -1
  95. package/dist/esm/models/components/expand.js +1 -0
  96. package/dist/esm/models/components/expand.js.map +1 -1
  97. package/dist/esm/models/components/index.d.ts +1 -0
  98. package/dist/esm/models/components/index.d.ts.map +1 -1
  99. package/dist/esm/models/components/index.js +1 -0
  100. package/dist/esm/models/components/index.js.map +1 -1
  101. package/dist/esm/models/components/invoice.d.ts +1 -0
  102. package/dist/esm/models/components/invoice.d.ts.map +1 -1
  103. package/dist/esm/models/components/invoice.js +1 -0
  104. package/dist/esm/models/components/invoice.js.map +1 -1
  105. package/dist/esm/models/components/invoicefinancialstatus.d.ts +10 -0
  106. package/dist/esm/models/components/invoicefinancialstatus.d.ts.map +1 -0
  107. package/dist/esm/models/components/invoicefinancialstatus.js +11 -0
  108. package/dist/esm/models/components/invoicefinancialstatus.js.map +1 -0
  109. package/dist/esm/models/components/supervisor.d.ts +2 -2
  110. package/dist/esm/models/components/supervisor.d.ts.map +1 -1
  111. package/dist/esm/models/components/supervisor.js +2 -2
  112. package/dist/esm/models/components/supervisor.js.map +1 -1
  113. package/dist/esm/models/components/vendor.d.ts +1 -1
  114. package/dist/esm/models/components/vendor.d.ts.map +1 -1
  115. package/dist/esm/models/components/vendor.js +1 -1
  116. package/dist/esm/models/components/vendor.js.map +1 -1
  117. package/dist/esm/models/operations/index.d.ts +1 -0
  118. package/dist/esm/models/operations/index.d.ts.map +1 -1
  119. package/dist/esm/models/operations/index.js +1 -0
  120. package/dist/esm/models/operations/index.js.map +1 -1
  121. package/dist/esm/models/operations/listalerts.d.ts +5 -0
  122. package/dist/esm/models/operations/listalerts.d.ts.map +1 -1
  123. package/dist/esm/models/operations/listalerts.js +2 -0
  124. package/dist/esm/models/operations/listalerts.js.map +1 -1
  125. package/dist/esm/models/operations/listinvoices.d.ts +92 -0
  126. package/dist/esm/models/operations/listinvoices.d.ts.map +1 -0
  127. package/dist/esm/models/operations/listinvoices.js +57 -0
  128. package/dist/esm/models/operations/listinvoices.js.map +1 -0
  129. package/dist/esm/models/operations/listvendorinvoices.d.ts +3 -17
  130. package/dist/esm/models/operations/listvendorinvoices.d.ts.map +1 -1
  131. package/dist/esm/models/operations/listvendorinvoices.js +2 -10
  132. package/dist/esm/models/operations/listvendorinvoices.js.map +1 -1
  133. package/dist/esm/models/operations/updateuseralerts.d.ts +7 -0
  134. package/dist/esm/models/operations/updateuseralerts.d.ts.map +1 -1
  135. package/dist/esm/models/operations/updateuseralerts.js +2 -0
  136. package/dist/esm/models/operations/updateuseralerts.js.map +1 -1
  137. package/dist/esm/react-query/alertsListAlerts.core.d.ts +2 -0
  138. package/dist/esm/react-query/alertsListAlerts.core.d.ts.map +1 -1
  139. package/dist/esm/react-query/alertsListAlerts.core.js +2 -0
  140. package/dist/esm/react-query/alertsListAlerts.core.js.map +1 -1
  141. package/dist/esm/react-query/alertsListAlerts.d.ts +2 -0
  142. package/dist/esm/react-query/alertsListAlerts.d.ts.map +1 -1
  143. package/dist/esm/react-query/alertsListAlerts.js.map +1 -1
  144. package/dist/esm/react-query/index.d.ts +1 -0
  145. package/dist/esm/react-query/index.d.ts.map +1 -1
  146. package/dist/esm/react-query/index.js +1 -0
  147. package/dist/esm/react-query/index.js.map +1 -1
  148. package/dist/esm/react-query/invoicesListInvoices.core.d.ts +52 -0
  149. package/dist/esm/react-query/invoicesListInvoices.core.d.ts.map +1 -0
  150. package/dist/esm/react-query/invoicesListInvoices.core.js +99 -0
  151. package/dist/esm/react-query/invoicesListInvoices.core.js.map +1 -0
  152. package/dist/esm/react-query/invoicesListInvoices.d.ts +116 -0
  153. package/dist/esm/react-query/invoicesListInvoices.d.ts.map +1 -0
  154. package/dist/esm/react-query/invoicesListInvoices.js +133 -0
  155. package/dist/esm/react-query/invoicesListInvoices.js.map +1 -0
  156. package/dist/esm/react-query/vendorsListVendorInvoices.core.d.ts +2 -2
  157. package/dist/esm/react-query/vendorsListVendorInvoices.d.ts +2 -2
  158. package/dist/esm/sdk/invoices.d.ts +22 -0
  159. package/dist/esm/sdk/invoices.d.ts.map +1 -1
  160. package/dist/esm/sdk/invoices.js +23 -0
  161. package/dist/esm/sdk/invoices.js.map +1 -1
  162. package/examples/package-lock.json +1 -1
  163. package/jsr.json +1 -1
  164. package/package.json +1 -1
  165. package/src/__tests__/invoices.test.ts +35 -0
  166. package/src/__tests__/zones.test.ts +1 -1
  167. package/src/funcs/alertsListAlerts.ts +12 -7
  168. package/src/funcs/invoicesListInvoices.ts +270 -0
  169. package/src/lib/config.ts +2 -2
  170. package/src/models/components/expand.ts +1 -0
  171. package/src/models/components/index.ts +1 -0
  172. package/src/models/components/invoice.ts +2 -0
  173. package/src/models/components/invoicefinancialstatus.ts +17 -0
  174. package/src/models/components/supervisor.ts +4 -4
  175. package/src/models/components/vendor.ts +2 -2
  176. package/src/models/operations/index.ts +1 -0
  177. package/src/models/operations/listalerts.ts +7 -0
  178. package/src/models/operations/listinvoices.ts +181 -0
  179. package/src/models/operations/listvendorinvoices.ts +5 -22
  180. package/src/models/operations/updateuseralerts.ts +9 -0
  181. package/src/react-query/alertsListAlerts.core.ts +4 -0
  182. package/src/react-query/alertsListAlerts.ts +2 -0
  183. package/src/react-query/index.ts +1 -0
  184. package/src/react-query/invoicesListInvoices.core.ts +214 -0
  185. package/src/react-query/invoicesListInvoices.ts +284 -0
  186. package/src/react-query/vendorsListVendorInvoices.core.ts +2 -2
  187. package/src/react-query/vendorsListVendorInvoices.ts +2 -2
  188. package/src/sdk/invoices.ts +31 -0
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@greensecurity/javascript-sdk",
5
- "version": "0.43.1-beta.40",
5
+ "version": "0.43.1-beta.44",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greensecurity/javascript-sdk",
3
- "version": "0.43.1-beta.42",
3
+ "version": "0.43.1-beta.46",
4
4
  "author": "Green Security LLC",
5
5
  "type": "module",
6
6
  "tshy": {
@@ -63,3 +63,38 @@ test("Invoices Create Invoice", async () => {
63
63
  expect(result).toBeDefined();
64
64
  expect(result).toEqual({});
65
65
  });
66
+
67
+ test("Invoices List Invoices", async () => {
68
+ const testHttpClient = createTestHTTPClient("listInvoices");
69
+
70
+ const greenSecurity = new GreenSecurity({
71
+ serverURL: process.env["TEST_SERVER_URL"] ?? "https://localhost:3000/api",
72
+ httpClient: testHttpClient,
73
+ security: {
74
+ token: process.env["GREEN_SECURITY_TOKEN"] ?? "value",
75
+ },
76
+ });
77
+
78
+ const result = await greenSecurity.invoices.listInvoices({
79
+ sort: "job",
80
+ desc: true,
81
+ itemsPerPage: 25,
82
+ expand: [
83
+ "facility.system",
84
+ ],
85
+ });
86
+ expect(result).toBeDefined();
87
+ expect(result.result).toBeDefined();
88
+ expect(result.result).toEqual({
89
+ items: [],
90
+ pager: {
91
+ baseUrl: "api/vendors/job_titles",
92
+ sort: "job,title",
93
+ desc: 0,
94
+ itemCount: 228,
95
+ itemsPerPage: 80477,
96
+ page: 1,
97
+ useUrlParams: true,
98
+ },
99
+ });
100
+ });
@@ -58,7 +58,7 @@ test("Zones Security Zone Checkin", async () => {
58
58
 
59
59
  const result = await greenSecurity.zones.securityZoneCheckin({
60
60
  qrCode: "<value>",
61
- zoneId: 423655,
61
+ zoneId: 544883,
62
62
  });
63
63
  expect(result).toBeDefined();
64
64
  expect(result).toEqual({});
@@ -4,7 +4,7 @@
4
4
 
5
5
  import { GreenSecurityCore } from "../core.js";
6
6
  import { dlv } from "../lib/dlv.js";
7
- import { encodeFormQuery } from "../lib/encodings.js";
7
+ import { encodeFormQuery, queryJoin } from "../lib/encodings.js";
8
8
  import * as M from "../lib/matchers.js";
9
9
  import { compactMap } from "../lib/primitives.js";
10
10
  import { safeParse } from "../lib/schemas.js";
@@ -103,12 +103,17 @@ async function $do(
103
103
 
104
104
  const path = pathToFunc("/alerts")();
105
105
 
106
- const query = encodeFormQuery({
107
- "desc": payload.desc,
108
- "items_per_page": payload.items_per_page,
109
- "page": payload.page,
110
- "sort": payload.sort,
111
- });
106
+ const query = queryJoin(
107
+ encodeFormQuery({
108
+ "user_id_or_me": payload.user_id_or_me,
109
+ }, { explode: false }),
110
+ encodeFormQuery({
111
+ "desc": payload.desc,
112
+ "items_per_page": payload.items_per_page,
113
+ "page": payload.page,
114
+ "sort": payload.sort,
115
+ }),
116
+ );
112
117
 
113
118
  const headers = new Headers(compactMap({
114
119
  Accept: "application/json",
@@ -0,0 +1,270 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { GreenSecurityCore } from "../core.js";
6
+ import { dlv } from "../lib/dlv.js";
7
+ import { encodeFormQuery, queryJoin } from "../lib/encodings.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
+ import {
29
+ createPageIterator,
30
+ haltIterator,
31
+ PageIterator,
32
+ Paginator,
33
+ } from "../types/operations.js";
34
+
35
+ /**
36
+ * List invoices
37
+ *
38
+ * @remarks
39
+ * List invoices. The result set is automatically scoped based on the authenticated user's role.
40
+ * API users may filter results by **only one** of the following query parameters:
41
+ * - vendor_id
42
+ * - company_id
43
+ * - facility_id
44
+ * - system_id
45
+ * Supplying more than one will return `400 Bad Request`.
46
+ * If none are provided, the request falls back to all authorized resources.
47
+ *
48
+ * Available `expand` scopes are:
49
+ * - invoice.line_items
50
+ * - invoice.invoice_transactions
51
+ * - invoice.representative
52
+ */
53
+ export function invoicesListInvoices(
54
+ client: GreenSecurityCore,
55
+ request: operations.ListInvoicesRequest,
56
+ options?: RequestOptions,
57
+ ): APIPromise<
58
+ PageIterator<
59
+ Result<
60
+ operations.ListInvoicesResponse,
61
+ | errors.ApiErrorResponse
62
+ | GreenSecurityError
63
+ | ResponseValidationError
64
+ | ConnectionError
65
+ | RequestAbortedError
66
+ | RequestTimeoutError
67
+ | InvalidRequestError
68
+ | UnexpectedClientError
69
+ | SDKValidationError
70
+ >,
71
+ { page: number }
72
+ >
73
+ > {
74
+ return new APIPromise($do(
75
+ client,
76
+ request,
77
+ options,
78
+ ));
79
+ }
80
+
81
+ async function $do(
82
+ client: GreenSecurityCore,
83
+ request: operations.ListInvoicesRequest,
84
+ options?: RequestOptions,
85
+ ): Promise<
86
+ [
87
+ PageIterator<
88
+ Result<
89
+ operations.ListInvoicesResponse,
90
+ | errors.ApiErrorResponse
91
+ | GreenSecurityError
92
+ | ResponseValidationError
93
+ | ConnectionError
94
+ | RequestAbortedError
95
+ | RequestTimeoutError
96
+ | InvalidRequestError
97
+ | UnexpectedClientError
98
+ | SDKValidationError
99
+ >,
100
+ { page: number }
101
+ >,
102
+ APICall,
103
+ ]
104
+ > {
105
+ const parsed = safeParse(
106
+ request,
107
+ (value) => operations.ListInvoicesRequest$outboundSchema.parse(value),
108
+ "Input validation failed",
109
+ );
110
+ if (!parsed.ok) {
111
+ return [haltIterator(parsed), { status: "invalid" }];
112
+ }
113
+ const payload = parsed.value;
114
+ const body = null;
115
+
116
+ const path = pathToFunc("/invoices")();
117
+
118
+ const query = queryJoin(
119
+ encodeFormQuery({
120
+ "expand": payload.expand,
121
+ }, { explode: false }),
122
+ encodeFormQuery({
123
+ "company_id": payload.company_id,
124
+ "desc": payload.desc,
125
+ "facility_id": payload.facility_id,
126
+ "invoice_financial_status": payload.invoice_financial_status,
127
+ "invoice_number": payload.invoice_number,
128
+ "items_per_page": payload.items_per_page,
129
+ "page": payload.page,
130
+ "representative": payload.representative,
131
+ "sort": payload.sort,
132
+ "system_id": payload.system_id,
133
+ "vendor_id": payload.vendor_id,
134
+ }),
135
+ );
136
+
137
+ const headers = new Headers(compactMap({
138
+ Accept: "application/json",
139
+ }));
140
+
141
+ const securityInput = await extractSecurity(client._options.security);
142
+ const requestSecurity = resolveGlobalSecurity(securityInput);
143
+
144
+ const context = {
145
+ options: client._options,
146
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
147
+ operationID: "listInvoices",
148
+ oAuth2Scopes: null,
149
+
150
+ resolvedSecurity: requestSecurity,
151
+
152
+ securitySource: client._options.security,
153
+ retryConfig: options?.retries
154
+ || client._options.retryConfig
155
+ || { strategy: "none" },
156
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
157
+ };
158
+
159
+ const requestRes = client._createRequest(context, {
160
+ security: requestSecurity,
161
+ method: "GET",
162
+ baseURL: options?.serverURL,
163
+ path: path,
164
+ headers: headers,
165
+ query: query,
166
+ body: body,
167
+ userAgent: client._options.userAgent,
168
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
169
+ }, options);
170
+ if (!requestRes.ok) {
171
+ return [haltIterator(requestRes), { status: "invalid" }];
172
+ }
173
+ const req = requestRes.value;
174
+
175
+ const doResult = await client._do(req, {
176
+ context,
177
+ errorCodes: ["400", "401", "403", "4XX", "500", "5XX"],
178
+ retryConfig: context.retryConfig,
179
+ retryCodes: context.retryCodes,
180
+ });
181
+ if (!doResult.ok) {
182
+ return [haltIterator(doResult), { status: "request-error", request: req }];
183
+ }
184
+ const response = doResult.value;
185
+
186
+ const responseFields = {
187
+ HttpMeta: { Response: response, Request: req },
188
+ };
189
+
190
+ const [result, raw] = await M.match<
191
+ operations.ListInvoicesResponse,
192
+ | errors.ApiErrorResponse
193
+ | GreenSecurityError
194
+ | ResponseValidationError
195
+ | ConnectionError
196
+ | RequestAbortedError
197
+ | RequestTimeoutError
198
+ | InvalidRequestError
199
+ | UnexpectedClientError
200
+ | SDKValidationError
201
+ >(
202
+ M.json(200, operations.ListInvoicesResponse$inboundSchema, {
203
+ key: "Result",
204
+ }),
205
+ M.jsonErr([400, 401, 403], errors.ApiErrorResponse$inboundSchema),
206
+ M.fail("4XX"),
207
+ M.fail([500, "5XX"]),
208
+ )(response, req, { extraFields: responseFields });
209
+ if (!result.ok) {
210
+ return [haltIterator(result), {
211
+ status: "complete",
212
+ request: req,
213
+ response,
214
+ }];
215
+ }
216
+
217
+ const nextFunc = (
218
+ responseData: unknown,
219
+ ): {
220
+ next: Paginator<
221
+ Result<
222
+ operations.ListInvoicesResponse,
223
+ | errors.ApiErrorResponse
224
+ | GreenSecurityError
225
+ | ResponseValidationError
226
+ | ConnectionError
227
+ | RequestAbortedError
228
+ | RequestTimeoutError
229
+ | InvalidRequestError
230
+ | UnexpectedClientError
231
+ | SDKValidationError
232
+ >
233
+ >;
234
+ "~next"?: { page: number };
235
+ } => {
236
+ const page = request?.page ?? 1;
237
+ const nextPage = page + 1;
238
+
239
+ if (!responseData) {
240
+ return { next: () => null };
241
+ }
242
+ const results = dlv(responseData, "items");
243
+ if (!Array.isArray(results) || !results.length) {
244
+ return { next: () => null };
245
+ }
246
+ const limit = request?.itemsPerPage ?? 0;
247
+ if (results.length < limit) {
248
+ return { next: () => null };
249
+ }
250
+
251
+ const nextVal = () =>
252
+ invoicesListInvoices(
253
+ client,
254
+ {
255
+ ...request,
256
+ page: nextPage,
257
+ },
258
+ options,
259
+ );
260
+
261
+ return { next: nextVal, "~next": { page: nextPage } };
262
+ };
263
+
264
+ const page = { ...result, ...nextFunc(raw) };
265
+ return [{ ...page, ...createPageIterator(page, (v) => !v.ok) }, {
266
+ status: "complete",
267
+ request: req,
268
+ response,
269
+ }];
270
+ }
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.0.11",
83
- sdkVersion: "0.43.1-beta.40",
83
+ sdkVersion: "0.43.1-beta.44",
84
84
  genVersion: "2.794.1",
85
85
  userAgent:
86
- "speakeasy-sdk/typescript 0.43.1-beta.40 2.794.1 0.0.11 @greensecurity/javascript-sdk",
86
+ "speakeasy-sdk/typescript 0.43.1-beta.44 2.794.1 0.0.11 @greensecurity/javascript-sdk",
87
87
  } as const;
@@ -52,6 +52,7 @@ export const Expand = {
52
52
  SupportArticleSupportCategory: "support_article.support_category",
53
53
  InvoiceLineItems: "invoice.line_items",
54
54
  InvoiceInvoiceTransactions: "invoice.invoice_transactions",
55
+ InvoiceRepresentative: "invoice.representative",
55
56
  VendorCredentialCredential: "vendor_credential.credential",
56
57
  VendorCredentialVendor: "vendor_credential.vendor",
57
58
  VendorCredentialInvoice: "vendor_credential.invoice",
@@ -34,6 +34,7 @@ export * from "./financialstatus.js";
34
34
  export * from "./imageset.js";
35
35
  export * from "./invitee.js";
36
36
  export * from "./invoice.js";
37
+ export * from "./invoicefinancialstatus.js";
37
38
  export * from "./invoiceitem.js";
38
39
  export * from "./invoicetransaction.js";
39
40
  export * from "./loginemailandpassword.js";
@@ -33,6 +33,7 @@ export type Invoice = {
33
33
  discount?: number | undefined;
34
34
  lines?: Array<InvoiceItem | null> | null | undefined;
35
35
  transactions?: Array<InvoiceTransaction> | null | undefined;
36
+ representative?: string | null | undefined;
36
37
  };
37
38
 
38
39
  /** @internal */
@@ -55,6 +56,7 @@ export const Invoice$inboundSchema: z.ZodType<Invoice, z.ZodTypeDef, unknown> =
55
56
  .optional(),
56
57
  transactions: z.nullable(z.array(InvoiceTransaction$inboundSchema))
57
58
  .optional(),
59
+ representative: z.nullable(types.string()).optional(),
58
60
  }).transform((v) => {
59
61
  return remap$(v, {
60
62
  "invoice_number": "invoiceNumber",
@@ -0,0 +1,17 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { ClosedEnum } from "../../types/enums.js";
7
+
8
+ export const InvoiceFinancialStatus = {
9
+ Paid: "paid",
10
+ Unpaid: "unpaid",
11
+ } as const;
12
+ export type InvoiceFinancialStatus = ClosedEnum<typeof InvoiceFinancialStatus>;
13
+
14
+ /** @internal */
15
+ export const InvoiceFinancialStatus$outboundSchema: z.ZodNativeEnum<
16
+ typeof InvoiceFinancialStatus
17
+ > = z.nativeEnum(InvoiceFinancialStatus);
@@ -13,7 +13,7 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
13
13
  */
14
14
  export type Supervisor = {
15
15
  name?: string | null | undefined;
16
- email?: any | undefined;
16
+ email?: string | null | undefined;
17
17
  phone?: string | null | undefined;
18
18
  };
19
19
 
@@ -24,13 +24,13 @@ export const Supervisor$inboundSchema: z.ZodType<
24
24
  unknown
25
25
  > = z.object({
26
26
  name: z.nullable(types.string()).optional(),
27
- email: types.optional(z.any()),
27
+ email: z.nullable(types.string()).optional(),
28
28
  phone: z.nullable(types.string()).optional(),
29
29
  });
30
30
  /** @internal */
31
31
  export type Supervisor$Outbound = {
32
32
  name?: string | null | undefined;
33
- email?: any | undefined;
33
+ email?: string | null | undefined;
34
34
  phone?: string | null | undefined;
35
35
  };
36
36
 
@@ -41,7 +41,7 @@ export const Supervisor$outboundSchema: z.ZodType<
41
41
  Supervisor
42
42
  > = z.object({
43
43
  name: z.nullable(z.string()).optional(),
44
- email: z.any().optional(),
44
+ email: z.nullable(z.string()).optional(),
45
45
  phone: z.nullable(z.string()).optional(),
46
46
  });
47
47
 
@@ -35,7 +35,7 @@ import { VendorType, VendorType$inboundSchema } from "./vendortype.js";
35
35
  export type One = {
36
36
  id?: number | undefined;
37
37
  firstName?: string | null | undefined;
38
- lastName?: any | undefined;
38
+ lastName?: string | null | undefined;
39
39
  email?: string | null | undefined;
40
40
  phone?: string | null | undefined;
41
41
  mobilePhone?: string | null | undefined;
@@ -188,7 +188,7 @@ export const One$inboundSchema: z.ZodType<One, z.ZodTypeDef, unknown> = z
188
188
  .object({
189
189
  id: types.optional(types.number()),
190
190
  first_name: z.nullable(types.string()).optional(),
191
- last_name: types.optional(z.any()),
191
+ last_name: z.nullable(types.string()).optional(),
192
192
  email: z.nullable(types.string()).optional(),
193
193
  phone: z.nullable(types.string()).optional(),
194
194
  mobile_phone: z.nullable(types.string()).optional(),
@@ -44,6 +44,7 @@ export * from "./getwebhookendpoint.js";
44
44
  export * from "./listalerts.js";
45
45
  export * from "./listallwebhookendpoints.js";
46
46
  export * from "./listfeed.js";
47
+ export * from "./listinvoices.js";
47
48
  export * from "./listlocations.js";
48
49
  export * from "./listoffhirconfigurations.js";
49
50
  export * from "./listorsearchcompanies.js";
@@ -26,6 +26,10 @@ export type ListAlertsRequest = {
26
26
  * Number of items to show in a given page
27
27
  */
28
28
  itemsPerPage?: number | undefined;
29
+ /**
30
+ * Either the ID of the user rep or the keyword "me" to represent the current user.
31
+ */
32
+ userIdOrMe?: string | undefined;
29
33
  };
30
34
 
31
35
  /**
@@ -49,6 +53,7 @@ export type ListAlertsRequest$Outbound = {
49
53
  desc?: components.Desc$Outbound | undefined;
50
54
  page?: number | undefined;
51
55
  items_per_page?: number | undefined;
56
+ user_id_or_me?: string | undefined;
52
57
  };
53
58
 
54
59
  /** @internal */
@@ -61,9 +66,11 @@ export const ListAlertsRequest$outboundSchema: z.ZodType<
61
66
  desc: components.Desc$outboundSchema.optional(),
62
67
  page: z.number().int().optional(),
63
68
  itemsPerPage: z.number().int().optional(),
69
+ userIdOrMe: z.string().optional(),
64
70
  }).transform((v) => {
65
71
  return remap$(v, {
66
72
  itemsPerPage: "items_per_page",
73
+ userIdOrMe: "user_id_or_me",
67
74
  });
68
75
  });
69
76