@greensecurity/javascript-sdk 0.16.0 → 0.18.0
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/REACT_QUERY.md +68 -30
- package/README.md +43 -0
- package/bin/mcp-server.js +731 -52
- package/bin/mcp-server.js.map +29 -19
- package/funcs/organizationsListOrSearchFacilities.d.ts +4 -1
- package/funcs/organizationsListOrSearchFacilities.d.ts.map +1 -1
- package/funcs/organizationsListOrSearchFacilities.js +46 -9
- package/funcs/organizationsListOrSearchFacilities.js.map +1 -1
- package/funcs/supportArticlesGetSupportArticle.js +1 -1
- package/funcs/supportArticlesGetSupportArticle.js.map +1 -1
- package/funcs/supportArticlesListOrSearchSupportArticles.d.ts +4 -1
- package/funcs/supportArticlesListOrSearchSupportArticles.d.ts.map +1 -1
- package/funcs/supportArticlesListOrSearchSupportArticles.js +42 -7
- package/funcs/supportArticlesListOrSearchSupportArticles.js.map +1 -1
- package/funcs/vendorsExpediteTimeRemaining.d.ts +17 -0
- package/funcs/vendorsExpediteTimeRemaining.d.ts.map +1 -0
- package/funcs/vendorsExpediteTimeRemaining.js +120 -0
- package/funcs/vendorsExpediteTimeRemaining.js.map +1 -0
- package/funcs/vendorsListVendorInvoices.d.ts +24 -0
- package/funcs/vendorsListVendorInvoices.d.ts.map +1 -0
- package/funcs/vendorsListVendorInvoices.js +166 -0
- package/funcs/vendorsListVendorInvoices.js.map +1 -0
- package/funcs/vendorsListVendorJobTitles.d.ts +4 -1
- package/funcs/vendorsListVendorJobTitles.d.ts.map +1 -1
- package/funcs/vendorsListVendorJobTitles.js +39 -6
- package/funcs/vendorsListVendorJobTitles.js.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/mcp-server/extensions.d.ts +9 -0
- package/mcp-server/extensions.d.ts.map +1 -0
- package/mcp-server/extensions.js +6 -0
- package/mcp-server/extensions.js.map +1 -0
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/resources.d.ts +9 -4
- package/mcp-server/resources.d.ts.map +1 -1
- package/mcp-server/resources.js +36 -9
- package/mcp-server/resources.js.map +1 -1
- package/mcp-server/server.d.ts.map +1 -1
- package/mcp-server/server.js +10 -1
- package/mcp-server/server.js.map +1 -1
- package/mcp-server/tools/organizationsListOrSearchFacilities.js +1 -1
- package/mcp-server/tools/organizationsListOrSearchFacilities.js.map +1 -1
- package/mcp-server/tools/supportArticlesListOrSearchSupportArticles.js +1 -1
- package/mcp-server/tools/supportArticlesListOrSearchSupportArticles.js.map +1 -1
- package/mcp-server/tools/vendorsExpediteTimeRemaining.d.ts +8 -0
- package/mcp-server/tools/vendorsExpediteTimeRemaining.d.ts.map +1 -0
- package/mcp-server/tools/vendorsExpediteTimeRemaining.js +64 -0
- package/mcp-server/tools/vendorsExpediteTimeRemaining.js.map +1 -0
- package/mcp-server/tools/vendorsListVendorInvoices.d.ts +8 -0
- package/mcp-server/tools/vendorsListVendorInvoices.d.ts.map +1 -0
- package/mcp-server/tools/vendorsListVendorInvoices.js +68 -0
- package/mcp-server/tools/vendorsListVendorInvoices.js.map +1 -0
- package/mcp-server/tools/vendorsListVendorJobTitles.js +1 -1
- package/mcp-server/tools/vendorsListVendorJobTitles.js.map +1 -1
- package/models/components/expand.d.ts +3 -0
- package/models/components/expand.d.ts.map +1 -1
- package/models/components/expand.js +1 -0
- package/models/components/expand.js.map +1 -1
- package/models/components/index.d.ts +2 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +2 -0
- package/models/components/index.js.map +1 -1
- package/models/components/invoice.d.ts +43 -0
- package/models/components/invoice.d.ts.map +1 -0
- package/models/components/invoice.js +91 -0
- package/models/components/invoice.js.map +1 -0
- package/models/components/invoiceitem.d.ts +40 -0
- package/models/components/invoiceitem.d.ts.map +1 -0
- package/models/components/invoiceitem.js +94 -0
- package/models/components/invoiceitem.js.map +1 -0
- package/models/operations/expeditetimeremaining.d.ts +60 -0
- package/models/operations/expeditetimeremaining.d.ts.map +1 -0
- package/models/operations/expeditetimeremaining.js +113 -0
- package/models/operations/expeditetimeremaining.js.map +1 -0
- package/models/operations/index.d.ts +2 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +2 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/listorsearchfacilities.d.ts +25 -0
- package/models/operations/listorsearchfacilities.d.ts.map +1 -1
- package/models/operations/listorsearchfacilities.js +36 -1
- package/models/operations/listorsearchfacilities.js.map +1 -1
- package/models/operations/listorsearchsupportarticles.d.ts +25 -0
- package/models/operations/listorsearchsupportarticles.d.ts.map +1 -1
- package/models/operations/listorsearchsupportarticles.js +36 -1
- package/models/operations/listorsearchsupportarticles.js.map +1 -1
- package/models/operations/listvendorinvoices.d.ts +116 -0
- package/models/operations/listvendorinvoices.d.ts.map +1 -0
- package/models/operations/listvendorinvoices.js +155 -0
- package/models/operations/listvendorinvoices.js.map +1 -0
- package/models/operations/listvendorjobtitles.d.ts +25 -0
- package/models/operations/listvendorjobtitles.d.ts.map +1 -1
- package/models/operations/listvendorjobtitles.js +36 -1
- package/models/operations/listvendorjobtitles.js.map +1 -1
- package/package.json +1 -1
- package/react-query/index.d.ts +2 -0
- package/react-query/index.d.ts.map +1 -1
- package/react-query/index.js +2 -0
- package/react-query/index.js.map +1 -1
- package/react-query/organizationsListOrSearchFacilities.d.ts +54 -3
- package/react-query/organizationsListOrSearchFacilities.d.ts.map +1 -1
- package/react-query/organizationsListOrSearchFacilities.js +89 -0
- package/react-query/organizationsListOrSearchFacilities.js.map +1 -1
- package/react-query/supportArticlesListOrSearchSupportArticles.d.ts +28 -3
- package/react-query/supportArticlesListOrSearchSupportArticles.d.ts.map +1 -1
- package/react-query/supportArticlesListOrSearchSupportArticles.js +58 -0
- package/react-query/supportArticlesListOrSearchSupportArticles.js.map +1 -1
- package/react-query/vendorsExpediteTimeRemaining.d.ts +30 -0
- package/react-query/vendorsExpediteTimeRemaining.d.ts.map +1 -0
- package/react-query/vendorsExpediteTimeRemaining.js +96 -0
- package/react-query/vendorsExpediteTimeRemaining.js.map +1 -0
- package/react-query/vendorsListVendorInvoices.d.ts +96 -0
- package/react-query/vendorsListVendorInvoices.d.ts.map +1 -0
- package/react-query/vendorsListVendorInvoices.js +178 -0
- package/react-query/vendorsListVendorInvoices.js.map +1 -0
- package/react-query/vendorsListVendorJobTitles.d.ts +28 -3
- package/react-query/vendorsListVendorJobTitles.d.ts.map +1 -1
- package/react-query/vendorsListVendorJobTitles.js +59 -0
- package/react-query/vendorsListVendorJobTitles.js.map +1 -1
- package/sdk/organizations.d.ts +4 -1
- package/sdk/organizations.d.ts.map +1 -1
- package/sdk/organizations.js +2 -1
- package/sdk/organizations.js.map +1 -1
- package/sdk/supportarticles.d.ts +4 -1
- package/sdk/supportarticles.d.ts.map +1 -1
- package/sdk/supportarticles.js +2 -1
- package/sdk/supportarticles.js.map +1 -1
- package/sdk/vendors.d.ts +24 -1
- package/sdk/vendors.d.ts.map +1 -1
- package/sdk/vendors.js +26 -1
- package/sdk/vendors.js.map +1 -1
- package/src/__tests__/supportarticles.test.ts +2 -1
- package/src/__tests__/vendors.test.ts +58 -1
- package/src/funcs/organizationsListOrSearchFacilities.ts +116 -42
- package/src/funcs/supportArticlesGetSupportArticle.ts +1 -1
- package/src/funcs/supportArticlesListOrSearchSupportArticles.ts +100 -31
- package/src/funcs/vendorsExpediteTimeRemaining.ts +171 -0
- package/src/funcs/vendorsListVendorInvoices.ts +255 -0
- package/src/funcs/vendorsListVendorJobTitles.ts +101 -33
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/extensions.ts +13 -0
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/resources.ts +75 -14
- package/src/mcp-server/server.ts +20 -1
- package/src/mcp-server/tools/organizationsListOrSearchFacilities.ts +1 -1
- package/src/mcp-server/tools/supportArticlesListOrSearchSupportArticles.ts +1 -1
- package/src/mcp-server/tools/vendorsExpediteTimeRemaining.ts +37 -0
- package/src/mcp-server/tools/vendorsListVendorInvoices.ts +41 -0
- package/src/mcp-server/tools/vendorsListVendorJobTitles.ts +1 -1
- package/src/models/components/expand.ts +1 -0
- package/src/models/components/index.ts +2 -0
- package/src/models/components/invoice.ts +99 -0
- package/src/models/components/invoiceitem.ts +98 -0
- package/src/models/operations/expeditetimeremaining.ts +152 -0
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/listorsearchfacilities.ts +72 -0
- package/src/models/operations/listorsearchsupportarticles.ts +75 -0
- package/src/models/operations/listvendorinvoices.ts +252 -0
- package/src/models/operations/listvendorjobtitles.ts +68 -0
- package/src/react-query/index.ts +2 -0
- package/src/react-query/organizationsListOrSearchFacilities.ts +179 -1
- package/src/react-query/supportArticlesListOrSearchSupportArticles.ts +149 -1
- package/src/react-query/vendorsExpediteTimeRemaining.ts +165 -0
- package/src/react-query/vendorsListVendorInvoices.ts +364 -0
- package/src/react-query/vendorsListVendorJobTitles.ts +149 -1
- package/src/sdk/organizations.ts +5 -2
- package/src/sdk/supportarticles.ts +8 -2
- package/src/sdk/vendors.ts +47 -2
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
InfiniteData,
|
|
7
|
+
InvalidateQueryFilters,
|
|
8
|
+
QueryClient,
|
|
9
|
+
QueryFunctionContext,
|
|
10
|
+
QueryKey,
|
|
11
|
+
useInfiniteQuery,
|
|
12
|
+
UseInfiniteQueryResult,
|
|
13
|
+
useQuery,
|
|
14
|
+
UseQueryResult,
|
|
15
|
+
useSuspenseInfiniteQuery,
|
|
16
|
+
UseSuspenseInfiniteQueryResult,
|
|
17
|
+
useSuspenseQuery,
|
|
18
|
+
UseSuspenseQueryResult,
|
|
19
|
+
} from "@tanstack/react-query";
|
|
20
|
+
import { GreenSecurityCore } from "../core.js";
|
|
21
|
+
import { vendorsListVendorInvoices } from "../funcs/vendorsListVendorInvoices.js";
|
|
22
|
+
import { combineSignals } from "../lib/primitives.js";
|
|
23
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
24
|
+
import * as components from "../models/components/index.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
27
|
+
import { PageIterator, unwrapResultIterator } from "../types/operations.js";
|
|
28
|
+
import { useGreenSecurityContext } from "./_context.js";
|
|
29
|
+
import {
|
|
30
|
+
InfiniteQueryHookOptions,
|
|
31
|
+
QueryHookOptions,
|
|
32
|
+
SuspenseInfiniteQueryHookOptions,
|
|
33
|
+
SuspenseQueryHookOptions,
|
|
34
|
+
TupleToPrefixes,
|
|
35
|
+
} from "./_types.js";
|
|
36
|
+
|
|
37
|
+
export type VendorsListVendorInvoicesQueryData =
|
|
38
|
+
operations.ListVendorInvoicesResponse;
|
|
39
|
+
|
|
40
|
+
export type VendorsListVendorInvoicesInfiniteQueryData = PageIterator<
|
|
41
|
+
operations.ListVendorInvoicesResponse,
|
|
42
|
+
{ page: number }
|
|
43
|
+
>;
|
|
44
|
+
|
|
45
|
+
export type VendorsListVendorInvoicesPageParams = PageIterator<
|
|
46
|
+
operations.ListVendorInvoicesResponse,
|
|
47
|
+
{ page: number }
|
|
48
|
+
>["~next"];
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* List vendor invoices
|
|
52
|
+
*
|
|
53
|
+
* @remarks
|
|
54
|
+
* List invoices for Vendors
|
|
55
|
+
*
|
|
56
|
+
* Available `expand` scopes are:
|
|
57
|
+
*
|
|
58
|
+
* invoice.line_items
|
|
59
|
+
*/
|
|
60
|
+
export function useVendorsListVendorInvoices(
|
|
61
|
+
request: operations.ListVendorInvoicesRequest,
|
|
62
|
+
options?: QueryHookOptions<VendorsListVendorInvoicesQueryData>,
|
|
63
|
+
): UseQueryResult<VendorsListVendorInvoicesQueryData, Error> {
|
|
64
|
+
const client = useGreenSecurityContext();
|
|
65
|
+
return useQuery({
|
|
66
|
+
...buildVendorsListVendorInvoicesQuery(
|
|
67
|
+
client,
|
|
68
|
+
request,
|
|
69
|
+
options,
|
|
70
|
+
),
|
|
71
|
+
...options,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* List vendor invoices
|
|
77
|
+
*
|
|
78
|
+
* @remarks
|
|
79
|
+
* List invoices for Vendors
|
|
80
|
+
*
|
|
81
|
+
* Available `expand` scopes are:
|
|
82
|
+
*
|
|
83
|
+
* invoice.line_items
|
|
84
|
+
*/
|
|
85
|
+
export function useVendorsListVendorInvoicesSuspense(
|
|
86
|
+
request: operations.ListVendorInvoicesRequest,
|
|
87
|
+
options?: SuspenseQueryHookOptions<VendorsListVendorInvoicesQueryData>,
|
|
88
|
+
): UseSuspenseQueryResult<VendorsListVendorInvoicesQueryData, Error> {
|
|
89
|
+
const client = useGreenSecurityContext();
|
|
90
|
+
return useSuspenseQuery({
|
|
91
|
+
...buildVendorsListVendorInvoicesQuery(
|
|
92
|
+
client,
|
|
93
|
+
request,
|
|
94
|
+
options,
|
|
95
|
+
),
|
|
96
|
+
...options,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* List vendor invoices
|
|
102
|
+
*
|
|
103
|
+
* @remarks
|
|
104
|
+
* List invoices for Vendors
|
|
105
|
+
*
|
|
106
|
+
* Available `expand` scopes are:
|
|
107
|
+
*
|
|
108
|
+
* invoice.line_items
|
|
109
|
+
*/
|
|
110
|
+
export function useVendorsListVendorInvoicesInfinite(
|
|
111
|
+
request: operations.ListVendorInvoicesRequest,
|
|
112
|
+
options?: InfiniteQueryHookOptions<
|
|
113
|
+
VendorsListVendorInvoicesInfiniteQueryData
|
|
114
|
+
>,
|
|
115
|
+
): UseInfiniteQueryResult<
|
|
116
|
+
InfiniteData<
|
|
117
|
+
VendorsListVendorInvoicesInfiniteQueryData,
|
|
118
|
+
VendorsListVendorInvoicesPageParams
|
|
119
|
+
>,
|
|
120
|
+
Error
|
|
121
|
+
> {
|
|
122
|
+
const client = useGreenSecurityContext();
|
|
123
|
+
return useInfiniteQuery<
|
|
124
|
+
VendorsListVendorInvoicesInfiniteQueryData,
|
|
125
|
+
Error,
|
|
126
|
+
InfiniteData<
|
|
127
|
+
VendorsListVendorInvoicesInfiniteQueryData,
|
|
128
|
+
VendorsListVendorInvoicesPageParams
|
|
129
|
+
>,
|
|
130
|
+
QueryKey,
|
|
131
|
+
VendorsListVendorInvoicesPageParams
|
|
132
|
+
>({
|
|
133
|
+
...buildVendorsListVendorInvoicesInfiniteQuery(
|
|
134
|
+
client,
|
|
135
|
+
request,
|
|
136
|
+
options,
|
|
137
|
+
),
|
|
138
|
+
initialPageParam: options?.initialPageParam,
|
|
139
|
+
getNextPageParam: (previousPage) => previousPage["~next"],
|
|
140
|
+
...options,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* List vendor invoices
|
|
146
|
+
*
|
|
147
|
+
* @remarks
|
|
148
|
+
* List invoices for Vendors
|
|
149
|
+
*
|
|
150
|
+
* Available `expand` scopes are:
|
|
151
|
+
*
|
|
152
|
+
* invoice.line_items
|
|
153
|
+
*/
|
|
154
|
+
export function useVendorsListVendorInvoicesInfiniteSuspense(
|
|
155
|
+
request: operations.ListVendorInvoicesRequest,
|
|
156
|
+
options?: SuspenseInfiniteQueryHookOptions<
|
|
157
|
+
VendorsListVendorInvoicesInfiniteQueryData
|
|
158
|
+
>,
|
|
159
|
+
): UseSuspenseInfiniteQueryResult<
|
|
160
|
+
InfiniteData<
|
|
161
|
+
VendorsListVendorInvoicesInfiniteQueryData,
|
|
162
|
+
VendorsListVendorInvoicesPageParams
|
|
163
|
+
>,
|
|
164
|
+
Error
|
|
165
|
+
> {
|
|
166
|
+
const client = useGreenSecurityContext();
|
|
167
|
+
return useSuspenseInfiniteQuery<
|
|
168
|
+
VendorsListVendorInvoicesInfiniteQueryData,
|
|
169
|
+
Error,
|
|
170
|
+
InfiniteData<
|
|
171
|
+
VendorsListVendorInvoicesInfiniteQueryData,
|
|
172
|
+
VendorsListVendorInvoicesPageParams
|
|
173
|
+
>,
|
|
174
|
+
QueryKey,
|
|
175
|
+
VendorsListVendorInvoicesPageParams
|
|
176
|
+
>({
|
|
177
|
+
...buildVendorsListVendorInvoicesInfiniteQuery(
|
|
178
|
+
client,
|
|
179
|
+
request,
|
|
180
|
+
options,
|
|
181
|
+
),
|
|
182
|
+
initialPageParam: options?.initialPageParam,
|
|
183
|
+
getNextPageParam: (previousPage) => previousPage["~next"],
|
|
184
|
+
...options,
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export function prefetchVendorsListVendorInvoices(
|
|
189
|
+
queryClient: QueryClient,
|
|
190
|
+
client$: GreenSecurityCore,
|
|
191
|
+
request: operations.ListVendorInvoicesRequest,
|
|
192
|
+
): Promise<void> {
|
|
193
|
+
return queryClient.prefetchQuery({
|
|
194
|
+
...buildVendorsListVendorInvoicesQuery(
|
|
195
|
+
client$,
|
|
196
|
+
request,
|
|
197
|
+
),
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export function setVendorsListVendorInvoicesData(
|
|
202
|
+
client: QueryClient,
|
|
203
|
+
queryKeyBase: [
|
|
204
|
+
vendorIdOrMe: string,
|
|
205
|
+
parameters: {
|
|
206
|
+
sort?: string | null | undefined;
|
|
207
|
+
desc?: components.Desc | undefined;
|
|
208
|
+
page?: number | undefined;
|
|
209
|
+
itemsPerPage?: number | undefined;
|
|
210
|
+
expand?: Array<components.Expand> | undefined;
|
|
211
|
+
},
|
|
212
|
+
],
|
|
213
|
+
data: VendorsListVendorInvoicesQueryData,
|
|
214
|
+
): VendorsListVendorInvoicesQueryData | undefined {
|
|
215
|
+
const key = queryKeyVendorsListVendorInvoices(...queryKeyBase);
|
|
216
|
+
|
|
217
|
+
return client.setQueryData<VendorsListVendorInvoicesQueryData>(key, data);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export function invalidateVendorsListVendorInvoices(
|
|
221
|
+
client: QueryClient,
|
|
222
|
+
queryKeyBase: TupleToPrefixes<
|
|
223
|
+
[
|
|
224
|
+
vendorIdOrMe: string,
|
|
225
|
+
parameters: {
|
|
226
|
+
sort?: string | null | undefined;
|
|
227
|
+
desc?: components.Desc | undefined;
|
|
228
|
+
page?: number | undefined;
|
|
229
|
+
itemsPerPage?: number | undefined;
|
|
230
|
+
expand?: Array<components.Expand> | undefined;
|
|
231
|
+
},
|
|
232
|
+
]
|
|
233
|
+
>,
|
|
234
|
+
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
235
|
+
): Promise<void> {
|
|
236
|
+
return client.invalidateQueries({
|
|
237
|
+
...filters,
|
|
238
|
+
queryKey: [
|
|
239
|
+
"@greensecurity/javascript-sdk",
|
|
240
|
+
"vendors",
|
|
241
|
+
"listVendorInvoices",
|
|
242
|
+
...queryKeyBase,
|
|
243
|
+
],
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export function invalidateAllVendorsListVendorInvoices(
|
|
248
|
+
client: QueryClient,
|
|
249
|
+
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
250
|
+
): Promise<void> {
|
|
251
|
+
return client.invalidateQueries({
|
|
252
|
+
...filters,
|
|
253
|
+
queryKey: [
|
|
254
|
+
"@greensecurity/javascript-sdk",
|
|
255
|
+
"vendors",
|
|
256
|
+
"listVendorInvoices",
|
|
257
|
+
],
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export function buildVendorsListVendorInvoicesQuery(
|
|
262
|
+
client$: GreenSecurityCore,
|
|
263
|
+
request: operations.ListVendorInvoicesRequest,
|
|
264
|
+
options?: RequestOptions,
|
|
265
|
+
): {
|
|
266
|
+
queryKey: QueryKey;
|
|
267
|
+
queryFn: (
|
|
268
|
+
context: QueryFunctionContext,
|
|
269
|
+
) => Promise<VendorsListVendorInvoicesQueryData>;
|
|
270
|
+
} {
|
|
271
|
+
return {
|
|
272
|
+
queryKey: queryKeyVendorsListVendorInvoices(request.vendorIdOrMe, {
|
|
273
|
+
sort: request.sort,
|
|
274
|
+
desc: request.desc,
|
|
275
|
+
page: request.page,
|
|
276
|
+
itemsPerPage: request.itemsPerPage,
|
|
277
|
+
expand: request.expand,
|
|
278
|
+
}),
|
|
279
|
+
queryFn: async function vendorsListVendorInvoicesQueryFn(
|
|
280
|
+
ctx,
|
|
281
|
+
): Promise<VendorsListVendorInvoicesQueryData> {
|
|
282
|
+
const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
|
|
283
|
+
const mergedOptions = {
|
|
284
|
+
...options,
|
|
285
|
+
fetchOptions: { ...options?.fetchOptions, signal: sig },
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
return unwrapAsync(vendorsListVendorInvoices(
|
|
289
|
+
client$,
|
|
290
|
+
request,
|
|
291
|
+
mergedOptions,
|
|
292
|
+
));
|
|
293
|
+
},
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
export function buildVendorsListVendorInvoicesInfiniteQuery(
|
|
298
|
+
client$: GreenSecurityCore,
|
|
299
|
+
request: operations.ListVendorInvoicesRequest,
|
|
300
|
+
options?: RequestOptions,
|
|
301
|
+
): {
|
|
302
|
+
queryKey: QueryKey;
|
|
303
|
+
queryFn: (
|
|
304
|
+
context: QueryFunctionContext<
|
|
305
|
+
QueryKey,
|
|
306
|
+
VendorsListVendorInvoicesPageParams
|
|
307
|
+
>,
|
|
308
|
+
) => Promise<VendorsListVendorInvoicesInfiniteQueryData>;
|
|
309
|
+
} {
|
|
310
|
+
return {
|
|
311
|
+
queryKey: queryKeyVendorsListVendorInvoices(request.vendorIdOrMe, {
|
|
312
|
+
sort: request.sort,
|
|
313
|
+
desc: request.desc,
|
|
314
|
+
page: request.page,
|
|
315
|
+
itemsPerPage: request.itemsPerPage,
|
|
316
|
+
expand: request.expand,
|
|
317
|
+
}),
|
|
318
|
+
queryFn: async function vendorsListVendorInvoicesQuery(
|
|
319
|
+
ctx,
|
|
320
|
+
): Promise<VendorsListVendorInvoicesInfiniteQueryData> {
|
|
321
|
+
const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
|
|
322
|
+
const mergedOptions = {
|
|
323
|
+
...options,
|
|
324
|
+
fetchOptions: { ...options?.fetchOptions, signal: sig },
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
if (!ctx.pageParam) {
|
|
328
|
+
return unwrapResultIterator(vendorsListVendorInvoices(
|
|
329
|
+
client$,
|
|
330
|
+
request,
|
|
331
|
+
mergedOptions,
|
|
332
|
+
));
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
return unwrapResultIterator(vendorsListVendorInvoices(
|
|
336
|
+
client$,
|
|
337
|
+
{
|
|
338
|
+
...request,
|
|
339
|
+
page: ctx.pageParam.page,
|
|
340
|
+
},
|
|
341
|
+
mergedOptions,
|
|
342
|
+
));
|
|
343
|
+
},
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
export function queryKeyVendorsListVendorInvoices(
|
|
348
|
+
vendorIdOrMe: string,
|
|
349
|
+
parameters: {
|
|
350
|
+
sort?: string | null | undefined;
|
|
351
|
+
desc?: components.Desc | undefined;
|
|
352
|
+
page?: number | undefined;
|
|
353
|
+
itemsPerPage?: number | undefined;
|
|
354
|
+
expand?: Array<components.Expand> | undefined;
|
|
355
|
+
},
|
|
356
|
+
): QueryKey {
|
|
357
|
+
return [
|
|
358
|
+
"@greensecurity/javascript-sdk",
|
|
359
|
+
"vendors",
|
|
360
|
+
"listVendorInvoices",
|
|
361
|
+
vendorIdOrMe,
|
|
362
|
+
parameters,
|
|
363
|
+
];
|
|
364
|
+
}
|
|
@@ -3,12 +3,17 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
+
InfiniteData,
|
|
6
7
|
InvalidateQueryFilters,
|
|
7
8
|
QueryClient,
|
|
8
9
|
QueryFunctionContext,
|
|
9
10
|
QueryKey,
|
|
11
|
+
useInfiniteQuery,
|
|
12
|
+
UseInfiniteQueryResult,
|
|
10
13
|
useQuery,
|
|
11
14
|
UseQueryResult,
|
|
15
|
+
useSuspenseInfiniteQuery,
|
|
16
|
+
UseSuspenseInfiniteQueryResult,
|
|
12
17
|
useSuspenseQuery,
|
|
13
18
|
UseSuspenseQueryResult,
|
|
14
19
|
} from "@tanstack/react-query";
|
|
@@ -19,15 +24,28 @@ import { RequestOptions } from "../lib/sdks.js";
|
|
|
19
24
|
import * as components from "../models/components/index.js";
|
|
20
25
|
import * as operations from "../models/operations/index.js";
|
|
21
26
|
import { unwrapAsync } from "../types/fp.js";
|
|
27
|
+
import { PageIterator, unwrapResultIterator } from "../types/operations.js";
|
|
22
28
|
import { useGreenSecurityContext } from "./_context.js";
|
|
23
29
|
import {
|
|
30
|
+
InfiniteQueryHookOptions,
|
|
24
31
|
QueryHookOptions,
|
|
32
|
+
SuspenseInfiniteQueryHookOptions,
|
|
25
33
|
SuspenseQueryHookOptions,
|
|
26
34
|
TupleToPrefixes,
|
|
27
35
|
} from "./_types.js";
|
|
28
36
|
|
|
29
37
|
export type VendorsListVendorJobTitlesQueryData =
|
|
30
|
-
operations.
|
|
38
|
+
operations.ListVendorJobTitlesResponse;
|
|
39
|
+
|
|
40
|
+
export type VendorsListVendorJobTitlesInfiniteQueryData = PageIterator<
|
|
41
|
+
operations.ListVendorJobTitlesResponse,
|
|
42
|
+
{ page: number }
|
|
43
|
+
>;
|
|
44
|
+
|
|
45
|
+
export type VendorsListVendorJobTitlesPageParams = PageIterator<
|
|
46
|
+
operations.ListVendorJobTitlesResponse,
|
|
47
|
+
{ page: number }
|
|
48
|
+
>["~next"];
|
|
31
49
|
|
|
32
50
|
/**
|
|
33
51
|
* List vendor job titles
|
|
@@ -71,6 +89,86 @@ export function useVendorsListVendorJobTitlesSuspense(
|
|
|
71
89
|
});
|
|
72
90
|
}
|
|
73
91
|
|
|
92
|
+
/**
|
|
93
|
+
* List vendor job titles
|
|
94
|
+
*
|
|
95
|
+
* @remarks
|
|
96
|
+
* List valid job titles for Vendors. This can be used during sign up or in a filter.
|
|
97
|
+
*/
|
|
98
|
+
export function useVendorsListVendorJobTitlesInfinite(
|
|
99
|
+
request: operations.ListVendorJobTitlesRequest,
|
|
100
|
+
options?: InfiniteQueryHookOptions<
|
|
101
|
+
VendorsListVendorJobTitlesInfiniteQueryData
|
|
102
|
+
>,
|
|
103
|
+
): UseInfiniteQueryResult<
|
|
104
|
+
InfiniteData<
|
|
105
|
+
VendorsListVendorJobTitlesInfiniteQueryData,
|
|
106
|
+
VendorsListVendorJobTitlesPageParams
|
|
107
|
+
>,
|
|
108
|
+
Error
|
|
109
|
+
> {
|
|
110
|
+
const client = useGreenSecurityContext();
|
|
111
|
+
return useInfiniteQuery<
|
|
112
|
+
VendorsListVendorJobTitlesInfiniteQueryData,
|
|
113
|
+
Error,
|
|
114
|
+
InfiniteData<
|
|
115
|
+
VendorsListVendorJobTitlesInfiniteQueryData,
|
|
116
|
+
VendorsListVendorJobTitlesPageParams
|
|
117
|
+
>,
|
|
118
|
+
QueryKey,
|
|
119
|
+
VendorsListVendorJobTitlesPageParams
|
|
120
|
+
>({
|
|
121
|
+
...buildVendorsListVendorJobTitlesInfiniteQuery(
|
|
122
|
+
client,
|
|
123
|
+
request,
|
|
124
|
+
options,
|
|
125
|
+
),
|
|
126
|
+
initialPageParam: options?.initialPageParam,
|
|
127
|
+
getNextPageParam: (previousPage) => previousPage["~next"],
|
|
128
|
+
...options,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* List vendor job titles
|
|
134
|
+
*
|
|
135
|
+
* @remarks
|
|
136
|
+
* List valid job titles for Vendors. This can be used during sign up or in a filter.
|
|
137
|
+
*/
|
|
138
|
+
export function useVendorsListVendorJobTitlesInfiniteSuspense(
|
|
139
|
+
request: operations.ListVendorJobTitlesRequest,
|
|
140
|
+
options?: SuspenseInfiniteQueryHookOptions<
|
|
141
|
+
VendorsListVendorJobTitlesInfiniteQueryData
|
|
142
|
+
>,
|
|
143
|
+
): UseSuspenseInfiniteQueryResult<
|
|
144
|
+
InfiniteData<
|
|
145
|
+
VendorsListVendorJobTitlesInfiniteQueryData,
|
|
146
|
+
VendorsListVendorJobTitlesPageParams
|
|
147
|
+
>,
|
|
148
|
+
Error
|
|
149
|
+
> {
|
|
150
|
+
const client = useGreenSecurityContext();
|
|
151
|
+
return useSuspenseInfiniteQuery<
|
|
152
|
+
VendorsListVendorJobTitlesInfiniteQueryData,
|
|
153
|
+
Error,
|
|
154
|
+
InfiniteData<
|
|
155
|
+
VendorsListVendorJobTitlesInfiniteQueryData,
|
|
156
|
+
VendorsListVendorJobTitlesPageParams
|
|
157
|
+
>,
|
|
158
|
+
QueryKey,
|
|
159
|
+
VendorsListVendorJobTitlesPageParams
|
|
160
|
+
>({
|
|
161
|
+
...buildVendorsListVendorJobTitlesInfiniteQuery(
|
|
162
|
+
client,
|
|
163
|
+
request,
|
|
164
|
+
options,
|
|
165
|
+
),
|
|
166
|
+
initialPageParam: options?.initialPageParam,
|
|
167
|
+
getNextPageParam: (previousPage) => previousPage["~next"],
|
|
168
|
+
...options,
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
|
|
74
172
|
export function prefetchVendorsListVendorJobTitles(
|
|
75
173
|
queryClient: QueryClient,
|
|
76
174
|
client$: GreenSecurityCore,
|
|
@@ -176,6 +274,56 @@ export function buildVendorsListVendorJobTitlesQuery(
|
|
|
176
274
|
};
|
|
177
275
|
}
|
|
178
276
|
|
|
277
|
+
export function buildVendorsListVendorJobTitlesInfiniteQuery(
|
|
278
|
+
client$: GreenSecurityCore,
|
|
279
|
+
request: operations.ListVendorJobTitlesRequest,
|
|
280
|
+
options?: RequestOptions,
|
|
281
|
+
): {
|
|
282
|
+
queryKey: QueryKey;
|
|
283
|
+
queryFn: (
|
|
284
|
+
context: QueryFunctionContext<
|
|
285
|
+
QueryKey,
|
|
286
|
+
VendorsListVendorJobTitlesPageParams
|
|
287
|
+
>,
|
|
288
|
+
) => Promise<VendorsListVendorJobTitlesInfiniteQueryData>;
|
|
289
|
+
} {
|
|
290
|
+
return {
|
|
291
|
+
queryKey: queryKeyVendorsListVendorJobTitles({
|
|
292
|
+
sort: request.sort,
|
|
293
|
+
desc: request.desc,
|
|
294
|
+
page: request.page,
|
|
295
|
+
itemsPerPage: request.itemsPerPage,
|
|
296
|
+
jobLike: request.jobLike,
|
|
297
|
+
}),
|
|
298
|
+
queryFn: async function vendorsListVendorJobTitlesQuery(
|
|
299
|
+
ctx,
|
|
300
|
+
): Promise<VendorsListVendorJobTitlesInfiniteQueryData> {
|
|
301
|
+
const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
|
|
302
|
+
const mergedOptions = {
|
|
303
|
+
...options,
|
|
304
|
+
fetchOptions: { ...options?.fetchOptions, signal: sig },
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
if (!ctx.pageParam) {
|
|
308
|
+
return unwrapResultIterator(vendorsListVendorJobTitles(
|
|
309
|
+
client$,
|
|
310
|
+
request,
|
|
311
|
+
mergedOptions,
|
|
312
|
+
));
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
return unwrapResultIterator(vendorsListVendorJobTitles(
|
|
316
|
+
client$,
|
|
317
|
+
{
|
|
318
|
+
...request,
|
|
319
|
+
page: ctx.pageParam.page,
|
|
320
|
+
},
|
|
321
|
+
mergedOptions,
|
|
322
|
+
));
|
|
323
|
+
},
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
|
|
179
327
|
export function queryKeyVendorsListVendorJobTitles(
|
|
180
328
|
parameters: {
|
|
181
329
|
sort?: string | null | undefined;
|
package/src/sdk/organizations.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
|
8
8
|
import * as components from "../models/components/index.js";
|
|
9
9
|
import * as operations from "../models/operations/index.js";
|
|
10
10
|
import { unwrapAsync } from "../types/fp.js";
|
|
11
|
+
import { PageIterator, unwrapResultIterator } from "../types/operations.js";
|
|
11
12
|
|
|
12
13
|
export class Organizations extends ClientSDK {
|
|
13
14
|
/**
|
|
@@ -32,8 +33,10 @@ export class Organizations extends ClientSDK {
|
|
|
32
33
|
async listOrSearchFacilities(
|
|
33
34
|
request: operations.ListOrSearchFacilitiesRequest,
|
|
34
35
|
options?: RequestOptions,
|
|
35
|
-
): Promise<
|
|
36
|
-
|
|
36
|
+
): Promise<
|
|
37
|
+
PageIterator<operations.ListOrSearchFacilitiesResponse, { page: number }>
|
|
38
|
+
> {
|
|
39
|
+
return unwrapResultIterator(organizationsListOrSearchFacilities(
|
|
37
40
|
this,
|
|
38
41
|
request,
|
|
39
42
|
options,
|
|
@@ -8,6 +8,7 @@ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
|
8
8
|
import * as components from "../models/components/index.js";
|
|
9
9
|
import * as operations from "../models/operations/index.js";
|
|
10
10
|
import { unwrapAsync } from "../types/fp.js";
|
|
11
|
+
import { PageIterator, unwrapResultIterator } from "../types/operations.js";
|
|
11
12
|
|
|
12
13
|
export class SupportArticles extends ClientSDK {
|
|
13
14
|
/**
|
|
@@ -19,8 +20,13 @@ export class SupportArticles extends ClientSDK {
|
|
|
19
20
|
async listOrSearchSupportArticles(
|
|
20
21
|
request: operations.ListOrSearchSupportArticlesRequest,
|
|
21
22
|
options?: RequestOptions,
|
|
22
|
-
): Promise<
|
|
23
|
-
|
|
23
|
+
): Promise<
|
|
24
|
+
PageIterator<
|
|
25
|
+
operations.ListOrSearchSupportArticlesResponse,
|
|
26
|
+
{ page: number }
|
|
27
|
+
>
|
|
28
|
+
> {
|
|
29
|
+
return unwrapResultIterator(supportArticlesListOrSearchSupportArticles(
|
|
24
30
|
this,
|
|
25
31
|
request,
|
|
26
32
|
options,
|
package/src/sdk/vendors.ts
CHANGED
|
@@ -3,11 +3,14 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { vendorsCreateVendorRegistration } from "../funcs/vendorsCreateVendorRegistration.js";
|
|
6
|
+
import { vendorsExpediteTimeRemaining } from "../funcs/vendorsExpediteTimeRemaining.js";
|
|
6
7
|
import { vendorsListVendorCredentials } from "../funcs/vendorsListVendorCredentials.js";
|
|
8
|
+
import { vendorsListVendorInvoices } from "../funcs/vendorsListVendorInvoices.js";
|
|
7
9
|
import { vendorsListVendorJobTitles } from "../funcs/vendorsListVendorJobTitles.js";
|
|
8
10
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
9
11
|
import * as operations from "../models/operations/index.js";
|
|
10
12
|
import { unwrapAsync } from "../types/fp.js";
|
|
13
|
+
import { PageIterator, unwrapResultIterator } from "../types/operations.js";
|
|
11
14
|
|
|
12
15
|
export class Vendors extends ClientSDK {
|
|
13
16
|
/**
|
|
@@ -38,8 +41,10 @@ export class Vendors extends ClientSDK {
|
|
|
38
41
|
async listVendorJobTitles(
|
|
39
42
|
request: operations.ListVendorJobTitlesRequest,
|
|
40
43
|
options?: RequestOptions,
|
|
41
|
-
): Promise<
|
|
42
|
-
|
|
44
|
+
): Promise<
|
|
45
|
+
PageIterator<operations.ListVendorJobTitlesResponse, { page: number }>
|
|
46
|
+
> {
|
|
47
|
+
return unwrapResultIterator(vendorsListVendorJobTitles(
|
|
43
48
|
this,
|
|
44
49
|
request,
|
|
45
50
|
options,
|
|
@@ -62,4 +67,44 @@ export class Vendors extends ClientSDK {
|
|
|
62
67
|
options,
|
|
63
68
|
));
|
|
64
69
|
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Expedite time remaining
|
|
73
|
+
*
|
|
74
|
+
* @remarks
|
|
75
|
+
* For vendors who have a paid 24-hour expedite credentials invoice, get the remaining time (in seconds) for which submitted credentials will be expedited.
|
|
76
|
+
*/
|
|
77
|
+
async expediteTimeRemaining(
|
|
78
|
+
request: operations.ExpediteTimeRemainingRequest,
|
|
79
|
+
options?: RequestOptions,
|
|
80
|
+
): Promise<operations.ExpediteTimeRemainingResponseBody> {
|
|
81
|
+
return unwrapAsync(vendorsExpediteTimeRemaining(
|
|
82
|
+
this,
|
|
83
|
+
request,
|
|
84
|
+
options,
|
|
85
|
+
));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* List vendor invoices
|
|
90
|
+
*
|
|
91
|
+
* @remarks
|
|
92
|
+
* List invoices for Vendors
|
|
93
|
+
*
|
|
94
|
+
* Available `expand` scopes are:
|
|
95
|
+
*
|
|
96
|
+
* invoice.line_items
|
|
97
|
+
*/
|
|
98
|
+
async listVendorInvoices(
|
|
99
|
+
request: operations.ListVendorInvoicesRequest,
|
|
100
|
+
options?: RequestOptions,
|
|
101
|
+
): Promise<
|
|
102
|
+
PageIterator<operations.ListVendorInvoicesResponse, { page: number }>
|
|
103
|
+
> {
|
|
104
|
+
return unwrapResultIterator(vendorsListVendorInvoices(
|
|
105
|
+
this,
|
|
106
|
+
request,
|
|
107
|
+
options,
|
|
108
|
+
));
|
|
109
|
+
}
|
|
65
110
|
}
|