@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
|
@@ -43,6 +43,10 @@ export type ListVendorJobTitlesListVendorJobTitlesOk = {
|
|
|
43
43
|
items: Array<components.VendorJobTitle>;
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
+
export type ListVendorJobTitlesResponse = {
|
|
47
|
+
result: ListVendorJobTitlesListVendorJobTitlesOk;
|
|
48
|
+
};
|
|
49
|
+
|
|
46
50
|
/** @internal */
|
|
47
51
|
export const ListVendorJobTitlesRequest$inboundSchema: z.ZodType<
|
|
48
52
|
ListVendorJobTitlesRequest,
|
|
@@ -186,3 +190,67 @@ export function listVendorJobTitlesListVendorJobTitlesOkFromJSON(
|
|
|
186
190
|
`Failed to parse 'ListVendorJobTitlesListVendorJobTitlesOk' from JSON`,
|
|
187
191
|
);
|
|
188
192
|
}
|
|
193
|
+
|
|
194
|
+
/** @internal */
|
|
195
|
+
export const ListVendorJobTitlesResponse$inboundSchema: z.ZodType<
|
|
196
|
+
ListVendorJobTitlesResponse,
|
|
197
|
+
z.ZodTypeDef,
|
|
198
|
+
unknown
|
|
199
|
+
> = z.object({
|
|
200
|
+
Result: z.lazy(() => ListVendorJobTitlesListVendorJobTitlesOk$inboundSchema),
|
|
201
|
+
}).transform((v) => {
|
|
202
|
+
return remap$(v, {
|
|
203
|
+
"Result": "result",
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
/** @internal */
|
|
208
|
+
export type ListVendorJobTitlesResponse$Outbound = {
|
|
209
|
+
Result: ListVendorJobTitlesListVendorJobTitlesOk$Outbound;
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
/** @internal */
|
|
213
|
+
export const ListVendorJobTitlesResponse$outboundSchema: z.ZodType<
|
|
214
|
+
ListVendorJobTitlesResponse$Outbound,
|
|
215
|
+
z.ZodTypeDef,
|
|
216
|
+
ListVendorJobTitlesResponse
|
|
217
|
+
> = z.object({
|
|
218
|
+
result: z.lazy(() => ListVendorJobTitlesListVendorJobTitlesOk$outboundSchema),
|
|
219
|
+
}).transform((v) => {
|
|
220
|
+
return remap$(v, {
|
|
221
|
+
result: "Result",
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* @internal
|
|
227
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
228
|
+
*/
|
|
229
|
+
export namespace ListVendorJobTitlesResponse$ {
|
|
230
|
+
/** @deprecated use `ListVendorJobTitlesResponse$inboundSchema` instead. */
|
|
231
|
+
export const inboundSchema = ListVendorJobTitlesResponse$inboundSchema;
|
|
232
|
+
/** @deprecated use `ListVendorJobTitlesResponse$outboundSchema` instead. */
|
|
233
|
+
export const outboundSchema = ListVendorJobTitlesResponse$outboundSchema;
|
|
234
|
+
/** @deprecated use `ListVendorJobTitlesResponse$Outbound` instead. */
|
|
235
|
+
export type Outbound = ListVendorJobTitlesResponse$Outbound;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export function listVendorJobTitlesResponseToJSON(
|
|
239
|
+
listVendorJobTitlesResponse: ListVendorJobTitlesResponse,
|
|
240
|
+
): string {
|
|
241
|
+
return JSON.stringify(
|
|
242
|
+
ListVendorJobTitlesResponse$outboundSchema.parse(
|
|
243
|
+
listVendorJobTitlesResponse,
|
|
244
|
+
),
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export function listVendorJobTitlesResponseFromJSON(
|
|
249
|
+
jsonString: string,
|
|
250
|
+
): SafeParseResult<ListVendorJobTitlesResponse, SDKValidationError> {
|
|
251
|
+
return safeParse(
|
|
252
|
+
jsonString,
|
|
253
|
+
(x) => ListVendorJobTitlesResponse$inboundSchema.parse(JSON.parse(x)),
|
|
254
|
+
`Failed to parse 'ListVendorJobTitlesResponse' from JSON`,
|
|
255
|
+
);
|
|
256
|
+
}
|
package/src/react-query/index.ts
CHANGED
|
@@ -16,5 +16,7 @@ export * from "./usersMagiclink.js";
|
|
|
16
16
|
export * from "./usersPassword.js";
|
|
17
17
|
export * from "./usersPasswordResetRequest.js";
|
|
18
18
|
export * from "./vendorsCreateVendorRegistration.js";
|
|
19
|
+
export * from "./vendorsExpediteTimeRemaining.js";
|
|
19
20
|
export * from "./vendorsListVendorCredentials.js";
|
|
21
|
+
export * from "./vendorsListVendorInvoices.js";
|
|
20
22
|
export * from "./vendorsListVendorJobTitles.js";
|
|
@@ -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 OrganizationsListOrSearchFacilitiesQueryData =
|
|
30
|
-
operations.
|
|
38
|
+
operations.ListOrSearchFacilitiesResponse;
|
|
39
|
+
|
|
40
|
+
export type OrganizationsListOrSearchFacilitiesInfiniteQueryData = PageIterator<
|
|
41
|
+
operations.ListOrSearchFacilitiesResponse,
|
|
42
|
+
{ page: number }
|
|
43
|
+
>;
|
|
44
|
+
|
|
45
|
+
export type OrganizationsListOrSearchFacilitiesPageParams = PageIterator<
|
|
46
|
+
operations.ListOrSearchFacilitiesResponse,
|
|
47
|
+
{ page: number }
|
|
48
|
+
>["~next"];
|
|
31
49
|
|
|
32
50
|
/**
|
|
33
51
|
* List or search facilities
|
|
@@ -99,6 +117,112 @@ export function useOrganizationsListOrSearchFacilitiesSuspense(
|
|
|
99
117
|
});
|
|
100
118
|
}
|
|
101
119
|
|
|
120
|
+
/**
|
|
121
|
+
* List or search facilities
|
|
122
|
+
*
|
|
123
|
+
* @remarks
|
|
124
|
+
* List or search facilities.
|
|
125
|
+
*
|
|
126
|
+
* Available `expand` scopes are:
|
|
127
|
+
*
|
|
128
|
+
* - facility.appointment_policy
|
|
129
|
+
* - facility.contacts
|
|
130
|
+
* - facility.vendor_counts
|
|
131
|
+
* - facility.flu_credential
|
|
132
|
+
* - facility.scrubs_policy
|
|
133
|
+
* - facility.system
|
|
134
|
+
* - facility.vendor_guest_policy
|
|
135
|
+
* - facility.vendor_policy
|
|
136
|
+
* - facility.visitor_policy
|
|
137
|
+
* - facility.workflow
|
|
138
|
+
*/
|
|
139
|
+
export function useOrganizationsListOrSearchFacilitiesInfinite(
|
|
140
|
+
request: operations.ListOrSearchFacilitiesRequest,
|
|
141
|
+
options?: InfiniteQueryHookOptions<
|
|
142
|
+
OrganizationsListOrSearchFacilitiesInfiniteQueryData
|
|
143
|
+
>,
|
|
144
|
+
): UseInfiniteQueryResult<
|
|
145
|
+
InfiniteData<
|
|
146
|
+
OrganizationsListOrSearchFacilitiesInfiniteQueryData,
|
|
147
|
+
OrganizationsListOrSearchFacilitiesPageParams
|
|
148
|
+
>,
|
|
149
|
+
Error
|
|
150
|
+
> {
|
|
151
|
+
const client = useGreenSecurityContext();
|
|
152
|
+
return useInfiniteQuery<
|
|
153
|
+
OrganizationsListOrSearchFacilitiesInfiniteQueryData,
|
|
154
|
+
Error,
|
|
155
|
+
InfiniteData<
|
|
156
|
+
OrganizationsListOrSearchFacilitiesInfiniteQueryData,
|
|
157
|
+
OrganizationsListOrSearchFacilitiesPageParams
|
|
158
|
+
>,
|
|
159
|
+
QueryKey,
|
|
160
|
+
OrganizationsListOrSearchFacilitiesPageParams
|
|
161
|
+
>({
|
|
162
|
+
...buildOrganizationsListOrSearchFacilitiesInfiniteQuery(
|
|
163
|
+
client,
|
|
164
|
+
request,
|
|
165
|
+
options,
|
|
166
|
+
),
|
|
167
|
+
initialPageParam: options?.initialPageParam,
|
|
168
|
+
getNextPageParam: (previousPage) => previousPage["~next"],
|
|
169
|
+
...options,
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* List or search facilities
|
|
175
|
+
*
|
|
176
|
+
* @remarks
|
|
177
|
+
* List or search facilities.
|
|
178
|
+
*
|
|
179
|
+
* Available `expand` scopes are:
|
|
180
|
+
*
|
|
181
|
+
* - facility.appointment_policy
|
|
182
|
+
* - facility.contacts
|
|
183
|
+
* - facility.vendor_counts
|
|
184
|
+
* - facility.flu_credential
|
|
185
|
+
* - facility.scrubs_policy
|
|
186
|
+
* - facility.system
|
|
187
|
+
* - facility.vendor_guest_policy
|
|
188
|
+
* - facility.vendor_policy
|
|
189
|
+
* - facility.visitor_policy
|
|
190
|
+
* - facility.workflow
|
|
191
|
+
*/
|
|
192
|
+
export function useOrganizationsListOrSearchFacilitiesInfiniteSuspense(
|
|
193
|
+
request: operations.ListOrSearchFacilitiesRequest,
|
|
194
|
+
options?: SuspenseInfiniteQueryHookOptions<
|
|
195
|
+
OrganizationsListOrSearchFacilitiesInfiniteQueryData
|
|
196
|
+
>,
|
|
197
|
+
): UseSuspenseInfiniteQueryResult<
|
|
198
|
+
InfiniteData<
|
|
199
|
+
OrganizationsListOrSearchFacilitiesInfiniteQueryData,
|
|
200
|
+
OrganizationsListOrSearchFacilitiesPageParams
|
|
201
|
+
>,
|
|
202
|
+
Error
|
|
203
|
+
> {
|
|
204
|
+
const client = useGreenSecurityContext();
|
|
205
|
+
return useSuspenseInfiniteQuery<
|
|
206
|
+
OrganizationsListOrSearchFacilitiesInfiniteQueryData,
|
|
207
|
+
Error,
|
|
208
|
+
InfiniteData<
|
|
209
|
+
OrganizationsListOrSearchFacilitiesInfiniteQueryData,
|
|
210
|
+
OrganizationsListOrSearchFacilitiesPageParams
|
|
211
|
+
>,
|
|
212
|
+
QueryKey,
|
|
213
|
+
OrganizationsListOrSearchFacilitiesPageParams
|
|
214
|
+
>({
|
|
215
|
+
...buildOrganizationsListOrSearchFacilitiesInfiniteQuery(
|
|
216
|
+
client,
|
|
217
|
+
request,
|
|
218
|
+
options,
|
|
219
|
+
),
|
|
220
|
+
initialPageParam: options?.initialPageParam,
|
|
221
|
+
getNextPageParam: (previousPage) => previousPage["~next"],
|
|
222
|
+
...options,
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
|
|
102
226
|
export function prefetchOrganizationsListOrSearchFacilities(
|
|
103
227
|
queryClient: QueryClient,
|
|
104
228
|
client$: GreenSecurityCore,
|
|
@@ -219,6 +343,60 @@ export function buildOrganizationsListOrSearchFacilitiesQuery(
|
|
|
219
343
|
};
|
|
220
344
|
}
|
|
221
345
|
|
|
346
|
+
export function buildOrganizationsListOrSearchFacilitiesInfiniteQuery(
|
|
347
|
+
client$: GreenSecurityCore,
|
|
348
|
+
request: operations.ListOrSearchFacilitiesRequest,
|
|
349
|
+
options?: RequestOptions,
|
|
350
|
+
): {
|
|
351
|
+
queryKey: QueryKey;
|
|
352
|
+
queryFn: (
|
|
353
|
+
context: QueryFunctionContext<
|
|
354
|
+
QueryKey,
|
|
355
|
+
OrganizationsListOrSearchFacilitiesPageParams
|
|
356
|
+
>,
|
|
357
|
+
) => Promise<OrganizationsListOrSearchFacilitiesInfiniteQueryData>;
|
|
358
|
+
} {
|
|
359
|
+
return {
|
|
360
|
+
queryKey: queryKeyOrganizationsListOrSearchFacilities({
|
|
361
|
+
sort: request.sort,
|
|
362
|
+
desc: request.desc,
|
|
363
|
+
page: request.page,
|
|
364
|
+
itemsPerPage: request.itemsPerPage,
|
|
365
|
+
expand: request.expand,
|
|
366
|
+
systemId: request.systemId,
|
|
367
|
+
nameLike: request.nameLike,
|
|
368
|
+
stateLike: request.stateLike,
|
|
369
|
+
activeStatus: request.activeStatus,
|
|
370
|
+
}),
|
|
371
|
+
queryFn: async function organizationsListOrSearchFacilitiesQuery(
|
|
372
|
+
ctx,
|
|
373
|
+
): Promise<OrganizationsListOrSearchFacilitiesInfiniteQueryData> {
|
|
374
|
+
const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
|
|
375
|
+
const mergedOptions = {
|
|
376
|
+
...options,
|
|
377
|
+
fetchOptions: { ...options?.fetchOptions, signal: sig },
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
if (!ctx.pageParam) {
|
|
381
|
+
return unwrapResultIterator(organizationsListOrSearchFacilities(
|
|
382
|
+
client$,
|
|
383
|
+
request,
|
|
384
|
+
mergedOptions,
|
|
385
|
+
));
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
return unwrapResultIterator(organizationsListOrSearchFacilities(
|
|
389
|
+
client$,
|
|
390
|
+
{
|
|
391
|
+
...request,
|
|
392
|
+
page: ctx.pageParam.page,
|
|
393
|
+
},
|
|
394
|
+
mergedOptions,
|
|
395
|
+
));
|
|
396
|
+
},
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
|
|
222
400
|
export function queryKeyOrganizationsListOrSearchFacilities(
|
|
223
401
|
parameters: {
|
|
224
402
|
sort?: string | null | undefined;
|
|
@@ -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
|
+
}
|