@greensecurity/javascript-sdk 0.16.0 → 0.17.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 +694 -51
- package/bin/mcp-server.js.map +28 -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 +2 -2
- package/lib/config.js +2 -2
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.d.ts.map +1 -1
- package/mcp-server/server.js +5 -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 +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +5 -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
|
@@ -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,29 @@ 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 SupportArticlesListOrSearchSupportArticlesQueryData =
|
|
30
|
-
operations.
|
|
38
|
+
operations.ListOrSearchSupportArticlesResponse;
|
|
39
|
+
|
|
40
|
+
export type SupportArticlesListOrSearchSupportArticlesInfiniteQueryData =
|
|
41
|
+
PageIterator<
|
|
42
|
+
operations.ListOrSearchSupportArticlesResponse,
|
|
43
|
+
{ page: number }
|
|
44
|
+
>;
|
|
45
|
+
|
|
46
|
+
export type SupportArticlesListOrSearchSupportArticlesPageParams = PageIterator<
|
|
47
|
+
operations.ListOrSearchSupportArticlesResponse,
|
|
48
|
+
{ page: number }
|
|
49
|
+
>["~next"];
|
|
31
50
|
|
|
32
51
|
/**
|
|
33
52
|
* List or search support articles
|
|
@@ -78,6 +97,86 @@ export function useSupportArticlesListOrSearchSupportArticlesSuspense(
|
|
|
78
97
|
});
|
|
79
98
|
}
|
|
80
99
|
|
|
100
|
+
/**
|
|
101
|
+
* List or search support articles
|
|
102
|
+
*
|
|
103
|
+
* @remarks
|
|
104
|
+
* List or search support articles for FAQ.
|
|
105
|
+
*/
|
|
106
|
+
export function useSupportArticlesListOrSearchSupportArticlesInfinite(
|
|
107
|
+
request: operations.ListOrSearchSupportArticlesRequest,
|
|
108
|
+
options?: InfiniteQueryHookOptions<
|
|
109
|
+
SupportArticlesListOrSearchSupportArticlesInfiniteQueryData
|
|
110
|
+
>,
|
|
111
|
+
): UseInfiniteQueryResult<
|
|
112
|
+
InfiniteData<
|
|
113
|
+
SupportArticlesListOrSearchSupportArticlesInfiniteQueryData,
|
|
114
|
+
SupportArticlesListOrSearchSupportArticlesPageParams
|
|
115
|
+
>,
|
|
116
|
+
Error
|
|
117
|
+
> {
|
|
118
|
+
const client = useGreenSecurityContext();
|
|
119
|
+
return useInfiniteQuery<
|
|
120
|
+
SupportArticlesListOrSearchSupportArticlesInfiniteQueryData,
|
|
121
|
+
Error,
|
|
122
|
+
InfiniteData<
|
|
123
|
+
SupportArticlesListOrSearchSupportArticlesInfiniteQueryData,
|
|
124
|
+
SupportArticlesListOrSearchSupportArticlesPageParams
|
|
125
|
+
>,
|
|
126
|
+
QueryKey,
|
|
127
|
+
SupportArticlesListOrSearchSupportArticlesPageParams
|
|
128
|
+
>({
|
|
129
|
+
...buildSupportArticlesListOrSearchSupportArticlesInfiniteQuery(
|
|
130
|
+
client,
|
|
131
|
+
request,
|
|
132
|
+
options,
|
|
133
|
+
),
|
|
134
|
+
initialPageParam: options?.initialPageParam,
|
|
135
|
+
getNextPageParam: (previousPage) => previousPage["~next"],
|
|
136
|
+
...options,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* List or search support articles
|
|
142
|
+
*
|
|
143
|
+
* @remarks
|
|
144
|
+
* List or search support articles for FAQ.
|
|
145
|
+
*/
|
|
146
|
+
export function useSupportArticlesListOrSearchSupportArticlesInfiniteSuspense(
|
|
147
|
+
request: operations.ListOrSearchSupportArticlesRequest,
|
|
148
|
+
options?: SuspenseInfiniteQueryHookOptions<
|
|
149
|
+
SupportArticlesListOrSearchSupportArticlesInfiniteQueryData
|
|
150
|
+
>,
|
|
151
|
+
): UseSuspenseInfiniteQueryResult<
|
|
152
|
+
InfiniteData<
|
|
153
|
+
SupportArticlesListOrSearchSupportArticlesInfiniteQueryData,
|
|
154
|
+
SupportArticlesListOrSearchSupportArticlesPageParams
|
|
155
|
+
>,
|
|
156
|
+
Error
|
|
157
|
+
> {
|
|
158
|
+
const client = useGreenSecurityContext();
|
|
159
|
+
return useSuspenseInfiniteQuery<
|
|
160
|
+
SupportArticlesListOrSearchSupportArticlesInfiniteQueryData,
|
|
161
|
+
Error,
|
|
162
|
+
InfiniteData<
|
|
163
|
+
SupportArticlesListOrSearchSupportArticlesInfiniteQueryData,
|
|
164
|
+
SupportArticlesListOrSearchSupportArticlesPageParams
|
|
165
|
+
>,
|
|
166
|
+
QueryKey,
|
|
167
|
+
SupportArticlesListOrSearchSupportArticlesPageParams
|
|
168
|
+
>({
|
|
169
|
+
...buildSupportArticlesListOrSearchSupportArticlesInfiniteQuery(
|
|
170
|
+
client,
|
|
171
|
+
request,
|
|
172
|
+
options,
|
|
173
|
+
),
|
|
174
|
+
initialPageParam: options?.initialPageParam,
|
|
175
|
+
getNextPageParam: (previousPage) => previousPage["~next"],
|
|
176
|
+
...options,
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
|
|
81
180
|
export function prefetchSupportArticlesListOrSearchSupportArticles(
|
|
82
181
|
queryClient: QueryClient,
|
|
83
182
|
client$: GreenSecurityCore,
|
|
@@ -184,6 +283,55 @@ export function buildSupportArticlesListOrSearchSupportArticlesQuery(
|
|
|
184
283
|
};
|
|
185
284
|
}
|
|
186
285
|
|
|
286
|
+
export function buildSupportArticlesListOrSearchSupportArticlesInfiniteQuery(
|
|
287
|
+
client$: GreenSecurityCore,
|
|
288
|
+
request: operations.ListOrSearchSupportArticlesRequest,
|
|
289
|
+
options?: RequestOptions,
|
|
290
|
+
): {
|
|
291
|
+
queryKey: QueryKey;
|
|
292
|
+
queryFn: (
|
|
293
|
+
context: QueryFunctionContext<
|
|
294
|
+
QueryKey,
|
|
295
|
+
SupportArticlesListOrSearchSupportArticlesPageParams
|
|
296
|
+
>,
|
|
297
|
+
) => Promise<SupportArticlesListOrSearchSupportArticlesInfiniteQueryData>;
|
|
298
|
+
} {
|
|
299
|
+
return {
|
|
300
|
+
queryKey: queryKeySupportArticlesListOrSearchSupportArticles({
|
|
301
|
+
sort: request.sort,
|
|
302
|
+
desc: request.desc,
|
|
303
|
+
page: request.page,
|
|
304
|
+
itemsPerPage: request.itemsPerPage,
|
|
305
|
+
}),
|
|
306
|
+
queryFn: async function supportArticlesListOrSearchSupportArticlesQuery(
|
|
307
|
+
ctx,
|
|
308
|
+
): Promise<SupportArticlesListOrSearchSupportArticlesInfiniteQueryData> {
|
|
309
|
+
const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
|
|
310
|
+
const mergedOptions = {
|
|
311
|
+
...options,
|
|
312
|
+
fetchOptions: { ...options?.fetchOptions, signal: sig },
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
if (!ctx.pageParam) {
|
|
316
|
+
return unwrapResultIterator(supportArticlesListOrSearchSupportArticles(
|
|
317
|
+
client$,
|
|
318
|
+
request,
|
|
319
|
+
mergedOptions,
|
|
320
|
+
));
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
return unwrapResultIterator(supportArticlesListOrSearchSupportArticles(
|
|
324
|
+
client$,
|
|
325
|
+
{
|
|
326
|
+
...request,
|
|
327
|
+
page: ctx.pageParam.page,
|
|
328
|
+
},
|
|
329
|
+
mergedOptions,
|
|
330
|
+
));
|
|
331
|
+
},
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
|
|
187
335
|
export function queryKeySupportArticlesListOrSearchSupportArticles(
|
|
188
336
|
parameters: {
|
|
189
337
|
sort?: string | null | undefined;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
InvalidateQueryFilters,
|
|
7
|
+
QueryClient,
|
|
8
|
+
QueryFunctionContext,
|
|
9
|
+
QueryKey,
|
|
10
|
+
useQuery,
|
|
11
|
+
UseQueryResult,
|
|
12
|
+
useSuspenseQuery,
|
|
13
|
+
UseSuspenseQueryResult,
|
|
14
|
+
} from "@tanstack/react-query";
|
|
15
|
+
import { GreenSecurityCore } from "../core.js";
|
|
16
|
+
import { vendorsExpediteTimeRemaining } from "../funcs/vendorsExpediteTimeRemaining.js";
|
|
17
|
+
import { combineSignals } from "../lib/primitives.js";
|
|
18
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
19
|
+
import * as operations from "../models/operations/index.js";
|
|
20
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
21
|
+
import { useGreenSecurityContext } from "./_context.js";
|
|
22
|
+
import {
|
|
23
|
+
QueryHookOptions,
|
|
24
|
+
SuspenseQueryHookOptions,
|
|
25
|
+
TupleToPrefixes,
|
|
26
|
+
} from "./_types.js";
|
|
27
|
+
|
|
28
|
+
export type VendorsExpediteTimeRemainingQueryData =
|
|
29
|
+
operations.ExpediteTimeRemainingResponseBody;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Expedite time remaining
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* For vendors who have a paid 24-hour expedite credentials invoice, get the remaining time (in seconds) for which submitted credentials will be expedited.
|
|
36
|
+
*/
|
|
37
|
+
export function useVendorsExpediteTimeRemaining(
|
|
38
|
+
request: operations.ExpediteTimeRemainingRequest,
|
|
39
|
+
options?: QueryHookOptions<VendorsExpediteTimeRemainingQueryData>,
|
|
40
|
+
): UseQueryResult<VendorsExpediteTimeRemainingQueryData, Error> {
|
|
41
|
+
const client = useGreenSecurityContext();
|
|
42
|
+
return useQuery({
|
|
43
|
+
...buildVendorsExpediteTimeRemainingQuery(
|
|
44
|
+
client,
|
|
45
|
+
request,
|
|
46
|
+
options,
|
|
47
|
+
),
|
|
48
|
+
...options,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Expedite time remaining
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* For vendors who have a paid 24-hour expedite credentials invoice, get the remaining time (in seconds) for which submitted credentials will be expedited.
|
|
57
|
+
*/
|
|
58
|
+
export function useVendorsExpediteTimeRemainingSuspense(
|
|
59
|
+
request: operations.ExpediteTimeRemainingRequest,
|
|
60
|
+
options?: SuspenseQueryHookOptions<VendorsExpediteTimeRemainingQueryData>,
|
|
61
|
+
): UseSuspenseQueryResult<VendorsExpediteTimeRemainingQueryData, Error> {
|
|
62
|
+
const client = useGreenSecurityContext();
|
|
63
|
+
return useSuspenseQuery({
|
|
64
|
+
...buildVendorsExpediteTimeRemainingQuery(
|
|
65
|
+
client,
|
|
66
|
+
request,
|
|
67
|
+
options,
|
|
68
|
+
),
|
|
69
|
+
...options,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function prefetchVendorsExpediteTimeRemaining(
|
|
74
|
+
queryClient: QueryClient,
|
|
75
|
+
client$: GreenSecurityCore,
|
|
76
|
+
request: operations.ExpediteTimeRemainingRequest,
|
|
77
|
+
): Promise<void> {
|
|
78
|
+
return queryClient.prefetchQuery({
|
|
79
|
+
...buildVendorsExpediteTimeRemainingQuery(
|
|
80
|
+
client$,
|
|
81
|
+
request,
|
|
82
|
+
),
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function setVendorsExpediteTimeRemainingData(
|
|
87
|
+
client: QueryClient,
|
|
88
|
+
queryKeyBase: [vendorIdOrMe: string],
|
|
89
|
+
data: VendorsExpediteTimeRemainingQueryData,
|
|
90
|
+
): VendorsExpediteTimeRemainingQueryData | undefined {
|
|
91
|
+
const key = queryKeyVendorsExpediteTimeRemaining(...queryKeyBase);
|
|
92
|
+
|
|
93
|
+
return client.setQueryData<VendorsExpediteTimeRemainingQueryData>(key, data);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function invalidateVendorsExpediteTimeRemaining(
|
|
97
|
+
client: QueryClient,
|
|
98
|
+
queryKeyBase: TupleToPrefixes<[vendorIdOrMe: string]>,
|
|
99
|
+
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
100
|
+
): Promise<void> {
|
|
101
|
+
return client.invalidateQueries({
|
|
102
|
+
...filters,
|
|
103
|
+
queryKey: [
|
|
104
|
+
"@greensecurity/javascript-sdk",
|
|
105
|
+
"vendors",
|
|
106
|
+
"expediteTimeRemaining",
|
|
107
|
+
...queryKeyBase,
|
|
108
|
+
],
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function invalidateAllVendorsExpediteTimeRemaining(
|
|
113
|
+
client: QueryClient,
|
|
114
|
+
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
115
|
+
): Promise<void> {
|
|
116
|
+
return client.invalidateQueries({
|
|
117
|
+
...filters,
|
|
118
|
+
queryKey: [
|
|
119
|
+
"@greensecurity/javascript-sdk",
|
|
120
|
+
"vendors",
|
|
121
|
+
"expediteTimeRemaining",
|
|
122
|
+
],
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export function buildVendorsExpediteTimeRemainingQuery(
|
|
127
|
+
client$: GreenSecurityCore,
|
|
128
|
+
request: operations.ExpediteTimeRemainingRequest,
|
|
129
|
+
options?: RequestOptions,
|
|
130
|
+
): {
|
|
131
|
+
queryKey: QueryKey;
|
|
132
|
+
queryFn: (
|
|
133
|
+
context: QueryFunctionContext,
|
|
134
|
+
) => Promise<VendorsExpediteTimeRemainingQueryData>;
|
|
135
|
+
} {
|
|
136
|
+
return {
|
|
137
|
+
queryKey: queryKeyVendorsExpediteTimeRemaining(request.vendorIdOrMe),
|
|
138
|
+
queryFn: async function vendorsExpediteTimeRemainingQueryFn(
|
|
139
|
+
ctx,
|
|
140
|
+
): Promise<VendorsExpediteTimeRemainingQueryData> {
|
|
141
|
+
const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
|
|
142
|
+
const mergedOptions = {
|
|
143
|
+
...options,
|
|
144
|
+
fetchOptions: { ...options?.fetchOptions, signal: sig },
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
return unwrapAsync(vendorsExpediteTimeRemaining(
|
|
148
|
+
client$,
|
|
149
|
+
request,
|
|
150
|
+
mergedOptions,
|
|
151
|
+
));
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export function queryKeyVendorsExpediteTimeRemaining(
|
|
157
|
+
vendorIdOrMe: string,
|
|
158
|
+
): QueryKey {
|
|
159
|
+
return [
|
|
160
|
+
"@greensecurity/javascript-sdk",
|
|
161
|
+
"vendors",
|
|
162
|
+
"expediteTimeRemaining",
|
|
163
|
+
vendorIdOrMe,
|
|
164
|
+
];
|
|
165
|
+
}
|
|
@@ -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
|
+
}
|