@greensecurity/javascript-sdk 0.43.1-beta.42 → 0.43.1-beta.44
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.
- package/README.md +3 -0
- package/dist/commonjs/__tests__/invoices.test.js +32 -0
- package/dist/commonjs/__tests__/invoices.test.js.map +1 -1
- package/dist/commonjs/__tests__/zones.test.js +27 -2
- package/dist/commonjs/__tests__/zones.test.js.map +1 -1
- package/dist/commonjs/funcs/alertsListAlerts.js +4 -2
- package/dist/commonjs/funcs/alertsListAlerts.js.map +1 -1
- package/dist/commonjs/funcs/invoicesListInvoices.d.ts +33 -0
- package/dist/commonjs/funcs/invoicesListInvoices.d.ts.map +1 -0
- package/dist/commonjs/funcs/invoicesListInvoices.js +177 -0
- package/dist/commonjs/funcs/invoicesListInvoices.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/components/expand.d.ts +1 -0
- package/dist/commonjs/models/components/expand.d.ts.map +1 -1
- package/dist/commonjs/models/components/expand.js +1 -0
- package/dist/commonjs/models/components/expand.js.map +1 -1
- package/dist/commonjs/models/components/index.d.ts +1 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +1 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/invoice.d.ts +1 -0
- package/dist/commonjs/models/components/invoice.d.ts.map +1 -1
- package/dist/commonjs/models/components/invoice.js +1 -0
- package/dist/commonjs/models/components/invoice.js.map +1 -1
- package/dist/commonjs/models/components/invoicefinancialstatus.d.ts +10 -0
- package/dist/commonjs/models/components/invoicefinancialstatus.d.ts.map +1 -0
- package/dist/commonjs/models/components/invoicefinancialstatus.js +47 -0
- package/dist/commonjs/models/components/invoicefinancialstatus.js.map +1 -0
- package/dist/commonjs/models/components/supervisor.d.ts +2 -2
- package/dist/commonjs/models/components/supervisor.d.ts.map +1 -1
- package/dist/commonjs/models/components/supervisor.js +2 -2
- package/dist/commonjs/models/components/supervisor.js.map +1 -1
- package/dist/commonjs/models/components/vendor.d.ts +1 -1
- package/dist/commonjs/models/components/vendor.d.ts.map +1 -1
- package/dist/commonjs/models/components/vendor.js +1 -1
- package/dist/commonjs/models/components/vendor.js.map +1 -1
- package/dist/commonjs/models/operations/index.d.ts +1 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +1 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/listalerts.d.ts +5 -0
- package/dist/commonjs/models/operations/listalerts.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listalerts.js +2 -0
- package/dist/commonjs/models/operations/listalerts.js.map +1 -1
- package/dist/commonjs/models/operations/listinvoices.d.ts +92 -0
- package/dist/commonjs/models/operations/listinvoices.d.ts.map +1 -0
- package/dist/commonjs/models/operations/listinvoices.js +96 -0
- package/dist/commonjs/models/operations/listinvoices.js.map +1 -0
- package/dist/commonjs/models/operations/listvendorinvoices.d.ts +3 -17
- package/dist/commonjs/models/operations/listvendorinvoices.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listvendorinvoices.js +3 -11
- package/dist/commonjs/models/operations/listvendorinvoices.js.map +1 -1
- package/dist/commonjs/models/operations/updateuseralerts.d.ts +7 -0
- package/dist/commonjs/models/operations/updateuseralerts.d.ts.map +1 -1
- package/dist/commonjs/models/operations/updateuseralerts.js +2 -0
- package/dist/commonjs/models/operations/updateuseralerts.js.map +1 -1
- package/dist/commonjs/react-query/alertsListAlerts.core.d.ts +2 -0
- package/dist/commonjs/react-query/alertsListAlerts.core.d.ts.map +1 -1
- package/dist/commonjs/react-query/alertsListAlerts.core.js +2 -0
- package/dist/commonjs/react-query/alertsListAlerts.core.js.map +1 -1
- package/dist/commonjs/react-query/alertsListAlerts.d.ts +2 -0
- package/dist/commonjs/react-query/alertsListAlerts.d.ts.map +1 -1
- package/dist/commonjs/react-query/alertsListAlerts.js.map +1 -1
- package/dist/commonjs/react-query/index.d.ts +1 -0
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +1 -0
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/react-query/invoicesListInvoices.core.d.ts +52 -0
- package/dist/commonjs/react-query/invoicesListInvoices.core.d.ts.map +1 -0
- package/dist/commonjs/react-query/invoicesListInvoices.core.js +107 -0
- package/dist/commonjs/react-query/invoicesListInvoices.core.js.map +1 -0
- package/dist/commonjs/react-query/invoicesListInvoices.d.ts +116 -0
- package/dist/commonjs/react-query/invoicesListInvoices.d.ts.map +1 -0
- package/dist/commonjs/react-query/invoicesListInvoices.js +148 -0
- package/dist/commonjs/react-query/invoicesListInvoices.js.map +1 -0
- package/dist/commonjs/react-query/vendorsListVendorInvoices.core.d.ts +2 -2
- package/dist/commonjs/react-query/vendorsListVendorInvoices.d.ts +2 -2
- package/dist/commonjs/sdk/invoices.d.ts +22 -0
- package/dist/commonjs/sdk/invoices.d.ts.map +1 -1
- package/dist/commonjs/sdk/invoices.js +23 -0
- package/dist/commonjs/sdk/invoices.js.map +1 -1
- package/dist/esm/__tests__/invoices.test.js +32 -0
- package/dist/esm/__tests__/invoices.test.js.map +1 -1
- package/dist/esm/__tests__/zones.test.js +27 -2
- package/dist/esm/__tests__/zones.test.js.map +1 -1
- package/dist/esm/funcs/alertsListAlerts.js +5 -3
- package/dist/esm/funcs/alertsListAlerts.js.map +1 -1
- package/dist/esm/funcs/invoicesListInvoices.d.ts +33 -0
- package/dist/esm/funcs/invoicesListInvoices.d.ts.map +1 -0
- package/dist/esm/funcs/invoicesListInvoices.js +141 -0
- package/dist/esm/funcs/invoicesListInvoices.js.map +1 -0
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/components/expand.d.ts +1 -0
- package/dist/esm/models/components/expand.d.ts.map +1 -1
- package/dist/esm/models/components/expand.js +1 -0
- package/dist/esm/models/components/expand.js.map +1 -1
- package/dist/esm/models/components/index.d.ts +1 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +1 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/invoice.d.ts +1 -0
- package/dist/esm/models/components/invoice.d.ts.map +1 -1
- package/dist/esm/models/components/invoice.js +1 -0
- package/dist/esm/models/components/invoice.js.map +1 -1
- package/dist/esm/models/components/invoicefinancialstatus.d.ts +10 -0
- package/dist/esm/models/components/invoicefinancialstatus.d.ts.map +1 -0
- package/dist/esm/models/components/invoicefinancialstatus.js +11 -0
- package/dist/esm/models/components/invoicefinancialstatus.js.map +1 -0
- package/dist/esm/models/components/supervisor.d.ts +2 -2
- package/dist/esm/models/components/supervisor.d.ts.map +1 -1
- package/dist/esm/models/components/supervisor.js +2 -2
- package/dist/esm/models/components/supervisor.js.map +1 -1
- package/dist/esm/models/components/vendor.d.ts +1 -1
- package/dist/esm/models/components/vendor.d.ts.map +1 -1
- package/dist/esm/models/components/vendor.js +1 -1
- package/dist/esm/models/components/vendor.js.map +1 -1
- package/dist/esm/models/operations/index.d.ts +1 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +1 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/listalerts.d.ts +5 -0
- package/dist/esm/models/operations/listalerts.d.ts.map +1 -1
- package/dist/esm/models/operations/listalerts.js +2 -0
- package/dist/esm/models/operations/listalerts.js.map +1 -1
- package/dist/esm/models/operations/listinvoices.d.ts +92 -0
- package/dist/esm/models/operations/listinvoices.d.ts.map +1 -0
- package/dist/esm/models/operations/listinvoices.js +57 -0
- package/dist/esm/models/operations/listinvoices.js.map +1 -0
- package/dist/esm/models/operations/listvendorinvoices.d.ts +3 -17
- package/dist/esm/models/operations/listvendorinvoices.d.ts.map +1 -1
- package/dist/esm/models/operations/listvendorinvoices.js +2 -10
- package/dist/esm/models/operations/listvendorinvoices.js.map +1 -1
- package/dist/esm/models/operations/updateuseralerts.d.ts +7 -0
- package/dist/esm/models/operations/updateuseralerts.d.ts.map +1 -1
- package/dist/esm/models/operations/updateuseralerts.js +2 -0
- package/dist/esm/models/operations/updateuseralerts.js.map +1 -1
- package/dist/esm/react-query/alertsListAlerts.core.d.ts +2 -0
- package/dist/esm/react-query/alertsListAlerts.core.d.ts.map +1 -1
- package/dist/esm/react-query/alertsListAlerts.core.js +2 -0
- package/dist/esm/react-query/alertsListAlerts.core.js.map +1 -1
- package/dist/esm/react-query/alertsListAlerts.d.ts +2 -0
- package/dist/esm/react-query/alertsListAlerts.d.ts.map +1 -1
- package/dist/esm/react-query/alertsListAlerts.js.map +1 -1
- package/dist/esm/react-query/index.d.ts +1 -0
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +1 -0
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/react-query/invoicesListInvoices.core.d.ts +52 -0
- package/dist/esm/react-query/invoicesListInvoices.core.d.ts.map +1 -0
- package/dist/esm/react-query/invoicesListInvoices.core.js +99 -0
- package/dist/esm/react-query/invoicesListInvoices.core.js.map +1 -0
- package/dist/esm/react-query/invoicesListInvoices.d.ts +116 -0
- package/dist/esm/react-query/invoicesListInvoices.d.ts.map +1 -0
- package/dist/esm/react-query/invoicesListInvoices.js +133 -0
- package/dist/esm/react-query/invoicesListInvoices.js.map +1 -0
- package/dist/esm/react-query/vendorsListVendorInvoices.core.d.ts +2 -2
- package/dist/esm/react-query/vendorsListVendorInvoices.d.ts +2 -2
- package/dist/esm/sdk/invoices.d.ts +22 -0
- package/dist/esm/sdk/invoices.d.ts.map +1 -1
- package/dist/esm/sdk/invoices.js +23 -0
- package/dist/esm/sdk/invoices.js.map +1 -1
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/invoices.test.ts +35 -0
- package/src/__tests__/zones.test.ts +27 -2
- package/src/funcs/alertsListAlerts.ts +12 -7
- package/src/funcs/invoicesListInvoices.ts +270 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/expand.ts +1 -0
- package/src/models/components/index.ts +1 -0
- package/src/models/components/invoice.ts +2 -0
- package/src/models/components/invoicefinancialstatus.ts +17 -0
- package/src/models/components/supervisor.ts +4 -4
- package/src/models/components/vendor.ts +2 -2
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/listalerts.ts +7 -0
- package/src/models/operations/listinvoices.ts +181 -0
- package/src/models/operations/listvendorinvoices.ts +5 -22
- package/src/models/operations/updateuseralerts.ts +9 -0
- package/src/react-query/alertsListAlerts.core.ts +4 -0
- package/src/react-query/alertsListAlerts.ts +2 -0
- package/src/react-query/index.ts +1 -0
- package/src/react-query/invoicesListInvoices.core.ts +214 -0
- package/src/react-query/invoicesListInvoices.ts +284 -0
- package/src/react-query/vendorsListVendorInvoices.core.ts +2 -2
- package/src/react-query/vendorsListVendorInvoices.ts +2 -2
- package/src/sdk/invoices.ts +31 -0
|
@@ -0,0 +1,181 @@
|
|
|
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 ListInvoicesRequest = {
|
|
14
|
+
/**
|
|
15
|
+
* A comma-separated list of object attributes to sort on.
|
|
16
|
+
*/
|
|
17
|
+
sort?: string | null | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Sort desc
|
|
20
|
+
*/
|
|
21
|
+
desc?: components.Desc | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* A 1-based offset for which page to request (defaults to 1)
|
|
24
|
+
*/
|
|
25
|
+
page?: number | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Number of items to show in a given page
|
|
28
|
+
*/
|
|
29
|
+
itemsPerPage?: number | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* An array-style parameter to identify which sections of an object to expand. See documentation for the endpoint for a list of valid expansion values.
|
|
32
|
+
*/
|
|
33
|
+
expand?: Array<components.Expand> | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Filter invoices by invoice number (digits or digits-digits)
|
|
36
|
+
*/
|
|
37
|
+
invoiceNumber?: string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Filter invoices by financial status
|
|
40
|
+
*/
|
|
41
|
+
invoiceFinancialStatus?: components.InvoiceFinancialStatus | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Filter by the representative's name.
|
|
44
|
+
*/
|
|
45
|
+
representative?: string | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Filter by a specific authorized vendor ID.
|
|
48
|
+
*/
|
|
49
|
+
vendorId?: number | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Filter by a specific authorized company ID.
|
|
52
|
+
*/
|
|
53
|
+
companyId?: number | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Filter by a specific authorized facility ID.
|
|
56
|
+
*/
|
|
57
|
+
facilityId?: number | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Filter by a specific authorized system ID.
|
|
60
|
+
*/
|
|
61
|
+
systemId?: number | undefined;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The request was successful, and the server has returned the requested resource.
|
|
66
|
+
*/
|
|
67
|
+
export type ListInvoicesListCompanyManagerInvoicesOk = {
|
|
68
|
+
items: Array<components.Invoice | null>;
|
|
69
|
+
/**
|
|
70
|
+
* Pagination information for a pageable list
|
|
71
|
+
*/
|
|
72
|
+
pager: components.Pager;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export type ListInvoicesResponse = {
|
|
76
|
+
result: ListInvoicesListCompanyManagerInvoicesOk;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/** @internal */
|
|
80
|
+
export type ListInvoicesRequest$Outbound = {
|
|
81
|
+
sort?: string | null | undefined;
|
|
82
|
+
desc?: components.Desc$Outbound | undefined;
|
|
83
|
+
page?: number | undefined;
|
|
84
|
+
items_per_page?: number | undefined;
|
|
85
|
+
expand?: Array<string> | undefined;
|
|
86
|
+
invoice_number?: string | undefined;
|
|
87
|
+
invoice_financial_status?: string | undefined;
|
|
88
|
+
representative?: string | undefined;
|
|
89
|
+
vendor_id?: number | undefined;
|
|
90
|
+
company_id?: number | undefined;
|
|
91
|
+
facility_id?: number | undefined;
|
|
92
|
+
system_id?: number | undefined;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/** @internal */
|
|
96
|
+
export const ListInvoicesRequest$outboundSchema: z.ZodType<
|
|
97
|
+
ListInvoicesRequest$Outbound,
|
|
98
|
+
z.ZodTypeDef,
|
|
99
|
+
ListInvoicesRequest
|
|
100
|
+
> = z.object({
|
|
101
|
+
sort: z.nullable(z.string()).optional(),
|
|
102
|
+
desc: components.Desc$outboundSchema.optional(),
|
|
103
|
+
page: z.number().int().optional(),
|
|
104
|
+
itemsPerPage: z.number().int().optional(),
|
|
105
|
+
expand: z.array(components.Expand$outboundSchema).optional(),
|
|
106
|
+
invoiceNumber: z.string().optional(),
|
|
107
|
+
invoiceFinancialStatus: components.InvoiceFinancialStatus$outboundSchema
|
|
108
|
+
.optional(),
|
|
109
|
+
representative: z.string().optional(),
|
|
110
|
+
vendorId: z.number().int().optional(),
|
|
111
|
+
companyId: z.number().int().optional(),
|
|
112
|
+
facilityId: z.number().int().optional(),
|
|
113
|
+
systemId: z.number().int().optional(),
|
|
114
|
+
}).transform((v) => {
|
|
115
|
+
return remap$(v, {
|
|
116
|
+
itemsPerPage: "items_per_page",
|
|
117
|
+
invoiceNumber: "invoice_number",
|
|
118
|
+
invoiceFinancialStatus: "invoice_financial_status",
|
|
119
|
+
vendorId: "vendor_id",
|
|
120
|
+
companyId: "company_id",
|
|
121
|
+
facilityId: "facility_id",
|
|
122
|
+
systemId: "system_id",
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
export function listInvoicesRequestToJSON(
|
|
127
|
+
listInvoicesRequest: ListInvoicesRequest,
|
|
128
|
+
): string {
|
|
129
|
+
return JSON.stringify(
|
|
130
|
+
ListInvoicesRequest$outboundSchema.parse(listInvoicesRequest),
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/** @internal */
|
|
135
|
+
export const ListInvoicesListCompanyManagerInvoicesOk$inboundSchema: z.ZodType<
|
|
136
|
+
ListInvoicesListCompanyManagerInvoicesOk,
|
|
137
|
+
z.ZodTypeDef,
|
|
138
|
+
unknown
|
|
139
|
+
> = z.object({
|
|
140
|
+
items: z.array(types.nullable(components.Invoice$inboundSchema)),
|
|
141
|
+
pager: components.Pager$inboundSchema,
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
export function listInvoicesListCompanyManagerInvoicesOkFromJSON(
|
|
145
|
+
jsonString: string,
|
|
146
|
+
): SafeParseResult<
|
|
147
|
+
ListInvoicesListCompanyManagerInvoicesOk,
|
|
148
|
+
SDKValidationError
|
|
149
|
+
> {
|
|
150
|
+
return safeParse(
|
|
151
|
+
jsonString,
|
|
152
|
+
(x) =>
|
|
153
|
+
ListInvoicesListCompanyManagerInvoicesOk$inboundSchema.parse(
|
|
154
|
+
JSON.parse(x),
|
|
155
|
+
),
|
|
156
|
+
`Failed to parse 'ListInvoicesListCompanyManagerInvoicesOk' from JSON`,
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/** @internal */
|
|
161
|
+
export const ListInvoicesResponse$inboundSchema: z.ZodType<
|
|
162
|
+
ListInvoicesResponse,
|
|
163
|
+
z.ZodTypeDef,
|
|
164
|
+
unknown
|
|
165
|
+
> = z.object({
|
|
166
|
+
Result: z.lazy(() => ListInvoicesListCompanyManagerInvoicesOk$inboundSchema),
|
|
167
|
+
}).transform((v) => {
|
|
168
|
+
return remap$(v, {
|
|
169
|
+
"Result": "result",
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
export function listInvoicesResponseFromJSON(
|
|
174
|
+
jsonString: string,
|
|
175
|
+
): SafeParseResult<ListInvoicesResponse, SDKValidationError> {
|
|
176
|
+
return safeParse(
|
|
177
|
+
jsonString,
|
|
178
|
+
(x) => ListInvoicesResponse$inboundSchema.parse(JSON.parse(x)),
|
|
179
|
+
`Failed to parse 'ListInvoicesResponse' from JSON`,
|
|
180
|
+
);
|
|
181
|
+
}
|
|
@@ -5,24 +5,11 @@
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
-
import { ClosedEnum } from "../../types/enums.js";
|
|
9
8
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
9
|
import * as types from "../../types/primitives.js";
|
|
11
10
|
import * as components from "../components/index.js";
|
|
12
11
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
13
12
|
|
|
14
|
-
/**
|
|
15
|
-
* Filter invoices by financial_status
|
|
16
|
-
*/
|
|
17
|
-
export const InvoiceFinancialStatus = {
|
|
18
|
-
Paid: "paid",
|
|
19
|
-
Unpaid: "unpaid",
|
|
20
|
-
} as const;
|
|
21
|
-
/**
|
|
22
|
-
* Filter invoices by financial_status
|
|
23
|
-
*/
|
|
24
|
-
export type InvoiceFinancialStatus = ClosedEnum<typeof InvoiceFinancialStatus>;
|
|
25
|
-
|
|
26
13
|
export type ListVendorInvoicesRequest = {
|
|
27
14
|
/**
|
|
28
15
|
* A comma-separated list of object attributes to sort on.
|
|
@@ -49,13 +36,13 @@ export type ListVendorInvoicesRequest = {
|
|
|
49
36
|
*/
|
|
50
37
|
vendorIdOrMe: string;
|
|
51
38
|
/**
|
|
52
|
-
* Filter invoices by invoice number
|
|
39
|
+
* Filter invoices by invoice number (digits or digits-digits)
|
|
53
40
|
*/
|
|
54
41
|
invoiceNumber?: string | undefined;
|
|
55
42
|
/**
|
|
56
|
-
* Filter invoices by
|
|
43
|
+
* Filter invoices by financial status
|
|
57
44
|
*/
|
|
58
|
-
invoiceFinancialStatus?: InvoiceFinancialStatus | undefined;
|
|
45
|
+
invoiceFinancialStatus?: components.InvoiceFinancialStatus | undefined;
|
|
59
46
|
};
|
|
60
47
|
|
|
61
48
|
/**
|
|
@@ -73,11 +60,6 @@ export type ListVendorInvoicesResponse = {
|
|
|
73
60
|
result: ListVendorInvoicesListVendorInvoicesOk;
|
|
74
61
|
};
|
|
75
62
|
|
|
76
|
-
/** @internal */
|
|
77
|
-
export const InvoiceFinancialStatus$outboundSchema: z.ZodNativeEnum<
|
|
78
|
-
typeof InvoiceFinancialStatus
|
|
79
|
-
> = z.nativeEnum(InvoiceFinancialStatus);
|
|
80
|
-
|
|
81
63
|
/** @internal */
|
|
82
64
|
export type ListVendorInvoicesRequest$Outbound = {
|
|
83
65
|
sort?: string | null | undefined;
|
|
@@ -103,7 +85,8 @@ export const ListVendorInvoicesRequest$outboundSchema: z.ZodType<
|
|
|
103
85
|
expand: z.array(components.Expand$outboundSchema).optional(),
|
|
104
86
|
vendorIdOrMe: z.string(),
|
|
105
87
|
invoiceNumber: z.string().optional(),
|
|
106
|
-
invoiceFinancialStatus: InvoiceFinancialStatus$outboundSchema
|
|
88
|
+
invoiceFinancialStatus: components.InvoiceFinancialStatus$outboundSchema
|
|
89
|
+
.optional(),
|
|
107
90
|
}).transform((v) => {
|
|
108
91
|
return remap$(v, {
|
|
109
92
|
itemsPerPage: "items_per_page",
|
|
@@ -11,6 +11,12 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
|
11
11
|
|
|
12
12
|
export type UpdateUserAlertsRequestBody = {
|
|
13
13
|
alertIds?: Array<number> | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* The ID of the user to update alerts for. Only authorized API Users can specify a user other than themselves.
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
*/
|
|
19
|
+
userId?: number | undefined;
|
|
14
20
|
};
|
|
15
21
|
|
|
16
22
|
/**
|
|
@@ -23,6 +29,7 @@ export type UpdateUserAlertsUpdateUserAlertsOk = {
|
|
|
23
29
|
/** @internal */
|
|
24
30
|
export type UpdateUserAlertsRequestBody$Outbound = {
|
|
25
31
|
alert_ids?: Array<number> | undefined;
|
|
32
|
+
user_id?: number | undefined;
|
|
26
33
|
};
|
|
27
34
|
|
|
28
35
|
/** @internal */
|
|
@@ -32,9 +39,11 @@ export const UpdateUserAlertsRequestBody$outboundSchema: z.ZodType<
|
|
|
32
39
|
UpdateUserAlertsRequestBody
|
|
33
40
|
> = z.object({
|
|
34
41
|
alertIds: z.array(z.number().int()).optional(),
|
|
42
|
+
userId: z.number().int().optional(),
|
|
35
43
|
}).transform((v) => {
|
|
36
44
|
return remap$(v, {
|
|
37
45
|
alertIds: "alert_ids",
|
|
46
|
+
userId: "user_id",
|
|
38
47
|
});
|
|
39
48
|
});
|
|
40
49
|
|
|
@@ -77,6 +77,7 @@ export function buildAlertsListAlertsQuery(
|
|
|
77
77
|
desc: request.desc,
|
|
78
78
|
page: request.page,
|
|
79
79
|
itemsPerPage: request.itemsPerPage,
|
|
80
|
+
userIdOrMe: request.userIdOrMe,
|
|
80
81
|
}),
|
|
81
82
|
queryFn: async function alertsListAlertsQueryFn(
|
|
82
83
|
ctx,
|
|
@@ -117,6 +118,7 @@ export function buildAlertsListAlertsInfiniteQuery(
|
|
|
117
118
|
desc: request.desc,
|
|
118
119
|
page: request.page,
|
|
119
120
|
itemsPerPage: request.itemsPerPage,
|
|
121
|
+
userIdOrMe: request.userIdOrMe,
|
|
120
122
|
}),
|
|
121
123
|
queryFn: async function alertsListAlertsQuery(
|
|
122
124
|
ctx,
|
|
@@ -154,6 +156,7 @@ export function queryKeyAlertsListAlerts(
|
|
|
154
156
|
desc?: components.Desc | undefined;
|
|
155
157
|
page?: number | undefined;
|
|
156
158
|
itemsPerPage?: number | undefined;
|
|
159
|
+
userIdOrMe?: string | undefined;
|
|
157
160
|
},
|
|
158
161
|
): QueryKey {
|
|
159
162
|
return ["@greensecurity/javascript-sdk", "alerts", "listAlerts", parameters];
|
|
@@ -165,6 +168,7 @@ export function queryKeyAlertsListAlertsInfinite(
|
|
|
165
168
|
desc?: components.Desc | undefined;
|
|
166
169
|
page?: number | undefined;
|
|
167
170
|
itemsPerPage?: number | undefined;
|
|
171
|
+
userIdOrMe?: string | undefined;
|
|
168
172
|
},
|
|
169
173
|
): QueryKey {
|
|
170
174
|
return [
|
|
@@ -163,6 +163,7 @@ export function setAlertsListAlertsData(
|
|
|
163
163
|
desc?: components.Desc | undefined;
|
|
164
164
|
page?: number | undefined;
|
|
165
165
|
itemsPerPage?: number | undefined;
|
|
166
|
+
userIdOrMe?: string | undefined;
|
|
166
167
|
},
|
|
167
168
|
],
|
|
168
169
|
data: AlertsListAlertsQueryData,
|
|
@@ -180,6 +181,7 @@ export function invalidateAlertsListAlerts(
|
|
|
180
181
|
desc?: components.Desc | undefined;
|
|
181
182
|
page?: number | undefined;
|
|
182
183
|
itemsPerPage?: number | undefined;
|
|
184
|
+
userIdOrMe?: string | undefined;
|
|
183
185
|
}]
|
|
184
186
|
>,
|
|
185
187
|
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
package/src/react-query/index.ts
CHANGED
|
@@ -27,6 +27,7 @@ export * from "./fhirConfigsGetFhirConfig.js";
|
|
|
27
27
|
export * from "./fhirConfigsListOfFhirConfigurations.js";
|
|
28
28
|
export * from "./fhirConfigsUpdateFhirConfigById.js";
|
|
29
29
|
export * from "./invoicesCreateInvoice.js";
|
|
30
|
+
export * from "./invoicesListInvoices.js";
|
|
30
31
|
export * from "./invoicesMakePayment.js";
|
|
31
32
|
export * from "./invoicesUpdateInvoice.js";
|
|
32
33
|
export * from "./mobileDevicesAddMobileDevice.js";
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
QueryClient,
|
|
7
|
+
QueryFunctionContext,
|
|
8
|
+
QueryKey,
|
|
9
|
+
} from "@tanstack/react-query";
|
|
10
|
+
import { GreenSecurityCore } from "../core.js";
|
|
11
|
+
import { invoicesListInvoices } from "../funcs/invoicesListInvoices.js";
|
|
12
|
+
import { combineSignals } from "../lib/primitives.js";
|
|
13
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
14
|
+
import * as components from "../models/components/index.js";
|
|
15
|
+
import * as operations from "../models/operations/index.js";
|
|
16
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
17
|
+
import { PageIterator, unwrapResultIterator } from "../types/operations.js";
|
|
18
|
+
import { pageIteratorToJSON } from "./_types.js";
|
|
19
|
+
export type InvoicesListInvoicesQueryData = operations.ListInvoicesResponse;
|
|
20
|
+
|
|
21
|
+
export type InvoicesListInvoicesInfiniteQueryData = PageIterator<
|
|
22
|
+
operations.ListInvoicesResponse,
|
|
23
|
+
{ page: number }
|
|
24
|
+
>;
|
|
25
|
+
|
|
26
|
+
export type InvoicesListInvoicesPageParams = PageIterator<
|
|
27
|
+
operations.ListInvoicesResponse,
|
|
28
|
+
{ page: number }
|
|
29
|
+
>["~next"];
|
|
30
|
+
|
|
31
|
+
export function prefetchInvoicesListInvoices(
|
|
32
|
+
queryClient: QueryClient,
|
|
33
|
+
client$: GreenSecurityCore,
|
|
34
|
+
request: operations.ListInvoicesRequest,
|
|
35
|
+
options?: RequestOptions,
|
|
36
|
+
): Promise<void> {
|
|
37
|
+
return queryClient.prefetchQuery({
|
|
38
|
+
...buildInvoicesListInvoicesQuery(
|
|
39
|
+
client$,
|
|
40
|
+
request,
|
|
41
|
+
options,
|
|
42
|
+
),
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function prefetchInvoicesListInvoicesInfinite(
|
|
47
|
+
queryClient: QueryClient,
|
|
48
|
+
client$: GreenSecurityCore,
|
|
49
|
+
request: operations.ListInvoicesRequest,
|
|
50
|
+
options?: RequestOptions,
|
|
51
|
+
): Promise<void> {
|
|
52
|
+
return queryClient.prefetchInfiniteQuery({
|
|
53
|
+
...buildInvoicesListInvoicesInfiniteQuery(
|
|
54
|
+
client$,
|
|
55
|
+
request,
|
|
56
|
+
options,
|
|
57
|
+
),
|
|
58
|
+
initialPageParam: undefined as InvoicesListInvoicesPageParams,
|
|
59
|
+
getNextPageParam: (previousPage: InvoicesListInvoicesInfiniteQueryData) =>
|
|
60
|
+
previousPage["~next"],
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function buildInvoicesListInvoicesQuery(
|
|
65
|
+
client$: GreenSecurityCore,
|
|
66
|
+
request: operations.ListInvoicesRequest,
|
|
67
|
+
options?: RequestOptions,
|
|
68
|
+
): {
|
|
69
|
+
queryKey: QueryKey;
|
|
70
|
+
queryFn: (
|
|
71
|
+
context: QueryFunctionContext,
|
|
72
|
+
) => Promise<InvoicesListInvoicesQueryData>;
|
|
73
|
+
} {
|
|
74
|
+
return {
|
|
75
|
+
queryKey: queryKeyInvoicesListInvoices({
|
|
76
|
+
sort: request.sort,
|
|
77
|
+
desc: request.desc,
|
|
78
|
+
page: request.page,
|
|
79
|
+
itemsPerPage: request.itemsPerPage,
|
|
80
|
+
expand: request.expand,
|
|
81
|
+
invoiceNumber: request.invoiceNumber,
|
|
82
|
+
invoiceFinancialStatus: request.invoiceFinancialStatus,
|
|
83
|
+
representative: request.representative,
|
|
84
|
+
vendorId: request.vendorId,
|
|
85
|
+
companyId: request.companyId,
|
|
86
|
+
facilityId: request.facilityId,
|
|
87
|
+
systemId: request.systemId,
|
|
88
|
+
}),
|
|
89
|
+
queryFn: async function invoicesListInvoicesQueryFn(
|
|
90
|
+
ctx,
|
|
91
|
+
): Promise<InvoicesListInvoicesQueryData> {
|
|
92
|
+
const sig = combineSignals(
|
|
93
|
+
ctx.signal,
|
|
94
|
+
options?.signal,
|
|
95
|
+
options?.fetchOptions?.signal,
|
|
96
|
+
);
|
|
97
|
+
const mergedOptions = {
|
|
98
|
+
...options?.fetchOptions,
|
|
99
|
+
...options,
|
|
100
|
+
signal: sig,
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
return unwrapAsync(invoicesListInvoices(
|
|
104
|
+
client$,
|
|
105
|
+
request,
|
|
106
|
+
mergedOptions,
|
|
107
|
+
));
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function buildInvoicesListInvoicesInfiniteQuery(
|
|
113
|
+
client$: GreenSecurityCore,
|
|
114
|
+
request: operations.ListInvoicesRequest,
|
|
115
|
+
options?: RequestOptions,
|
|
116
|
+
): {
|
|
117
|
+
queryKey: QueryKey;
|
|
118
|
+
queryFn: (
|
|
119
|
+
context: QueryFunctionContext<QueryKey, InvoicesListInvoicesPageParams>,
|
|
120
|
+
) => Promise<InvoicesListInvoicesInfiniteQueryData>;
|
|
121
|
+
} {
|
|
122
|
+
return {
|
|
123
|
+
queryKey: queryKeyInvoicesListInvoicesInfinite({
|
|
124
|
+
sort: request.sort,
|
|
125
|
+
desc: request.desc,
|
|
126
|
+
page: request.page,
|
|
127
|
+
itemsPerPage: request.itemsPerPage,
|
|
128
|
+
expand: request.expand,
|
|
129
|
+
invoiceNumber: request.invoiceNumber,
|
|
130
|
+
invoiceFinancialStatus: request.invoiceFinancialStatus,
|
|
131
|
+
representative: request.representative,
|
|
132
|
+
vendorId: request.vendorId,
|
|
133
|
+
companyId: request.companyId,
|
|
134
|
+
facilityId: request.facilityId,
|
|
135
|
+
systemId: request.systemId,
|
|
136
|
+
}),
|
|
137
|
+
queryFn: async function invoicesListInvoicesQuery(
|
|
138
|
+
ctx,
|
|
139
|
+
): Promise<InvoicesListInvoicesInfiniteQueryData> {
|
|
140
|
+
const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
|
|
141
|
+
const mergedOptions = {
|
|
142
|
+
...options,
|
|
143
|
+
fetchOptions: { ...options?.fetchOptions, signal: sig },
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
if (!ctx.pageParam) {
|
|
147
|
+
const pageResult = await unwrapResultIterator(invoicesListInvoices(
|
|
148
|
+
client$,
|
|
149
|
+
request,
|
|
150
|
+
mergedOptions,
|
|
151
|
+
));
|
|
152
|
+
return pageIteratorToJSON(pageResult);
|
|
153
|
+
}
|
|
154
|
+
const pageResult = await unwrapResultIterator(invoicesListInvoices(
|
|
155
|
+
client$,
|
|
156
|
+
{
|
|
157
|
+
...request,
|
|
158
|
+
page: ctx.pageParam.page,
|
|
159
|
+
},
|
|
160
|
+
mergedOptions,
|
|
161
|
+
));
|
|
162
|
+
return pageIteratorToJSON(pageResult);
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export function queryKeyInvoicesListInvoices(
|
|
168
|
+
parameters: {
|
|
169
|
+
sort?: string | null | undefined;
|
|
170
|
+
desc?: components.Desc | undefined;
|
|
171
|
+
page?: number | undefined;
|
|
172
|
+
itemsPerPage?: number | undefined;
|
|
173
|
+
expand?: Array<components.Expand> | undefined;
|
|
174
|
+
invoiceNumber?: string | undefined;
|
|
175
|
+
invoiceFinancialStatus?: components.InvoiceFinancialStatus | undefined;
|
|
176
|
+
representative?: string | undefined;
|
|
177
|
+
vendorId?: number | undefined;
|
|
178
|
+
companyId?: number | undefined;
|
|
179
|
+
facilityId?: number | undefined;
|
|
180
|
+
systemId?: number | undefined;
|
|
181
|
+
},
|
|
182
|
+
): QueryKey {
|
|
183
|
+
return [
|
|
184
|
+
"@greensecurity/javascript-sdk",
|
|
185
|
+
"invoices",
|
|
186
|
+
"listInvoices",
|
|
187
|
+
parameters,
|
|
188
|
+
];
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export function queryKeyInvoicesListInvoicesInfinite(
|
|
192
|
+
parameters: {
|
|
193
|
+
sort?: string | null | undefined;
|
|
194
|
+
desc?: components.Desc | undefined;
|
|
195
|
+
page?: number | undefined;
|
|
196
|
+
itemsPerPage?: number | undefined;
|
|
197
|
+
expand?: Array<components.Expand> | undefined;
|
|
198
|
+
invoiceNumber?: string | undefined;
|
|
199
|
+
invoiceFinancialStatus?: components.InvoiceFinancialStatus | undefined;
|
|
200
|
+
representative?: string | undefined;
|
|
201
|
+
vendorId?: number | undefined;
|
|
202
|
+
companyId?: number | undefined;
|
|
203
|
+
facilityId?: number | undefined;
|
|
204
|
+
systemId?: number | undefined;
|
|
205
|
+
},
|
|
206
|
+
): QueryKey {
|
|
207
|
+
return [
|
|
208
|
+
"@greensecurity/javascript-sdk",
|
|
209
|
+
"invoices",
|
|
210
|
+
"listInvoices",
|
|
211
|
+
"infinite",
|
|
212
|
+
parameters,
|
|
213
|
+
];
|
|
214
|
+
}
|