@greensecurity/javascript-sdk 0.44.0-beta.13 → 0.44.0-beta.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/commonjs/__tests__/organizations.test.js +29 -0
- package/dist/commonjs/__tests__/organizations.test.js.map +1 -1
- package/dist/commonjs/__tests__/webhooks.test.js +1 -1
- package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
- package/dist/commonjs/__tests__/zones.test.js +7 -8
- package/dist/commonjs/__tests__/zones.test.js.map +1 -1
- package/dist/commonjs/admin-funcs/companyManagerGetPaymentForm.d.ts +3 -0
- package/dist/commonjs/admin-funcs/companyManagerGetPaymentForm.d.ts.map +1 -0
- package/dist/commonjs/admin-funcs/companyManagerGetPaymentForm.js +9 -0
- package/dist/commonjs/admin-funcs/companyManagerGetPaymentForm.js.map +1 -0
- package/dist/commonjs/admin-funcs/vendorGetPaymentForm.d.ts +3 -0
- package/dist/commonjs/admin-funcs/vendorGetPaymentForm.d.ts.map +1 -0
- package/dist/commonjs/admin-funcs/vendorGetPaymentForm.js +9 -0
- package/dist/commonjs/admin-funcs/vendorGetPaymentForm.js.map +1 -0
- package/dist/commonjs/funcs/organizationsListFacilityVendors.d.ts +42 -0
- package/dist/commonjs/funcs/organizationsListFacilityVendors.d.ts.map +1 -0
- package/dist/commonjs/funcs/organizationsListFacilityVendors.js +187 -0
- package/dist/commonjs/funcs/organizationsListFacilityVendors.js.map +1 -0
- package/dist/commonjs/index.extras.d.ts +8 -0
- package/dist/commonjs/index.extras.d.ts.map +1 -1
- package/dist/commonjs/index.extras.js +8 -0
- package/dist/commonjs/index.extras.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/operations/exportcompanytargetfacilities.d.ts +4 -4
- package/dist/commonjs/models/operations/exportcompanytargetfacilities.d.ts.map +1 -1
- package/dist/commonjs/models/operations/exportcompanytargetfacilities.js +6 -4
- package/dist/commonjs/models/operations/exportcompanytargetfacilities.js.map +1 -1
- package/dist/commonjs/models/operations/index.d.ts +1 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +1 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/listfacilityvendors.d.ts +162 -0
- package/dist/commonjs/models/operations/listfacilityvendors.d.ts.map +1 -0
- package/dist/commonjs/models/operations/listfacilityvendors.js +150 -0
- package/dist/commonjs/models/operations/listfacilityvendors.js.map +1 -0
- package/dist/commonjs/models/operations/listvendoradditionalfacilityfields.d.ts +4 -4
- package/dist/commonjs/models/operations/listvendoradditionalfacilityfields.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listvendoradditionalfacilityfields.js +6 -7
- package/dist/commonjs/models/operations/listvendoradditionalfacilityfields.js.map +1 -1
- package/dist/commonjs/react-query/index.d.ts +1 -0
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +1 -0
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/react-query/organizationsExportCompanyTargetFacilities.core.d.ts +1 -1
- package/dist/commonjs/react-query/organizationsExportCompanyTargetFacilities.core.d.ts.map +1 -1
- package/dist/commonjs/react-query/organizationsExportCompanyTargetFacilities.core.js.map +1 -1
- package/dist/commonjs/react-query/organizationsExportCompanyTargetFacilities.d.ts +2 -2
- package/dist/commonjs/react-query/organizationsExportCompanyTargetFacilities.d.ts.map +1 -1
- package/dist/commonjs/react-query/organizationsExportCompanyTargetFacilities.js.map +1 -1
- package/dist/commonjs/react-query/organizationsListFacilityVendors.core.d.ts +42 -0
- package/dist/commonjs/react-query/organizationsListFacilityVendors.core.d.ts.map +1 -0
- package/dist/commonjs/react-query/organizationsListFacilityVendors.core.js +99 -0
- package/dist/commonjs/react-query/organizationsListFacilityVendors.core.js.map +1 -0
- package/dist/commonjs/react-query/organizationsListFacilityVendors.d.ts +142 -0
- package/dist/commonjs/react-query/organizationsListFacilityVendors.d.ts.map +1 -0
- package/dist/commonjs/react-query/organizationsListFacilityVendors.js +180 -0
- package/dist/commonjs/react-query/organizationsListFacilityVendors.js.map +1 -0
- package/dist/commonjs/sdk/organizations.d.ts +28 -0
- package/dist/commonjs/sdk/organizations.d.ts.map +1 -1
- package/dist/commonjs/sdk/organizations.js +29 -0
- package/dist/commonjs/sdk/organizations.js.map +1 -1
- package/dist/esm/__tests__/organizations.test.js +29 -0
- package/dist/esm/__tests__/organizations.test.js.map +1 -1
- package/dist/esm/__tests__/webhooks.test.js +1 -1
- package/dist/esm/__tests__/webhooks.test.js.map +1 -1
- package/dist/esm/__tests__/zones.test.js +7 -8
- package/dist/esm/__tests__/zones.test.js.map +1 -1
- package/dist/esm/admin-funcs/companyManagerGetPaymentForm.d.ts +3 -0
- package/dist/esm/admin-funcs/companyManagerGetPaymentForm.d.ts.map +1 -0
- package/dist/esm/admin-funcs/companyManagerGetPaymentForm.js +6 -0
- package/dist/esm/admin-funcs/companyManagerGetPaymentForm.js.map +1 -0
- package/dist/esm/admin-funcs/vendorGetPaymentForm.d.ts +3 -0
- package/dist/esm/admin-funcs/vendorGetPaymentForm.d.ts.map +1 -0
- package/dist/esm/admin-funcs/vendorGetPaymentForm.js +6 -0
- package/dist/esm/admin-funcs/vendorGetPaymentForm.js.map +1 -0
- package/dist/esm/funcs/organizationsListFacilityVendors.d.ts +42 -0
- package/dist/esm/funcs/organizationsListFacilityVendors.d.ts.map +1 -0
- package/dist/esm/funcs/organizationsListFacilityVendors.js +151 -0
- package/dist/esm/funcs/organizationsListFacilityVendors.js.map +1 -0
- package/dist/esm/index.extras.d.ts +8 -0
- package/dist/esm/index.extras.d.ts.map +1 -1
- package/dist/esm/index.extras.js +8 -0
- package/dist/esm/index.extras.js.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/operations/exportcompanytargetfacilities.d.ts +4 -4
- package/dist/esm/models/operations/exportcompanytargetfacilities.d.ts.map +1 -1
- package/dist/esm/models/operations/exportcompanytargetfacilities.js +5 -3
- package/dist/esm/models/operations/exportcompanytargetfacilities.js.map +1 -1
- package/dist/esm/models/operations/index.d.ts +1 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +1 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/listfacilityvendors.d.ts +162 -0
- package/dist/esm/models/operations/listfacilityvendors.d.ts.map +1 -0
- package/dist/esm/models/operations/listfacilityvendors.js +109 -0
- package/dist/esm/models/operations/listfacilityvendors.js.map +1 -0
- package/dist/esm/models/operations/listvendoradditionalfacilityfields.d.ts +4 -4
- package/dist/esm/models/operations/listvendoradditionalfacilityfields.d.ts.map +1 -1
- package/dist/esm/models/operations/listvendoradditionalfacilityfields.js +4 -5
- package/dist/esm/models/operations/listvendoradditionalfacilityfields.js.map +1 -1
- package/dist/esm/react-query/index.d.ts +1 -0
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +1 -0
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/react-query/organizationsExportCompanyTargetFacilities.core.d.ts +1 -1
- package/dist/esm/react-query/organizationsExportCompanyTargetFacilities.core.d.ts.map +1 -1
- package/dist/esm/react-query/organizationsExportCompanyTargetFacilities.core.js.map +1 -1
- package/dist/esm/react-query/organizationsExportCompanyTargetFacilities.d.ts +2 -2
- package/dist/esm/react-query/organizationsExportCompanyTargetFacilities.d.ts.map +1 -1
- package/dist/esm/react-query/organizationsExportCompanyTargetFacilities.js.map +1 -1
- package/dist/esm/react-query/organizationsListFacilityVendors.core.d.ts +42 -0
- package/dist/esm/react-query/organizationsListFacilityVendors.core.d.ts.map +1 -0
- package/dist/esm/react-query/organizationsListFacilityVendors.core.js +91 -0
- package/dist/esm/react-query/organizationsListFacilityVendors.core.js.map +1 -0
- package/dist/esm/react-query/organizationsListFacilityVendors.d.ts +142 -0
- package/dist/esm/react-query/organizationsListFacilityVendors.d.ts.map +1 -0
- package/dist/esm/react-query/organizationsListFacilityVendors.js +165 -0
- package/dist/esm/react-query/organizationsListFacilityVendors.js.map +1 -0
- package/dist/esm/sdk/organizations.d.ts +28 -0
- package/dist/esm/sdk/organizations.d.ts.map +1 -1
- package/dist/esm/sdk/organizations.js +29 -0
- package/dist/esm/sdk/organizations.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/organizations.test.ts +32 -0
- package/src/__tests__/webhooks.test.ts +1 -1
- package/src/__tests__/zones.test.ts +7 -8
- package/src/admin-funcs/companyManagerGetPaymentForm.ts +6 -0
- package/src/admin-funcs/vendorGetPaymentForm.ts +6 -0
- package/src/funcs/organizationsListFacilityVendors.ts +279 -0
- package/src/index.extras.ts +13 -3
- package/src/lib/config.ts +2 -2
- package/src/models/operations/exportcompanytargetfacilities.ts +10 -7
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/listfacilityvendors.ts +307 -0
- package/src/models/operations/listvendoradditionalfacilityfields.ts +26 -15
- package/src/react-query/index.ts +1 -0
- package/src/react-query/organizationsExportCompanyTargetFacilities.core.ts +3 -1
- package/src/react-query/organizationsExportCompanyTargetFacilities.ts +6 -2
- package/src/react-query/organizationsListFacilityVendors.core.ts +207 -0
- package/src/react-query/organizationsListFacilityVendors.ts +351 -0
- package/src/sdk/organizations.ts +39 -0
|
@@ -42,7 +42,7 @@ export type ListVendorAdditionalFacilityFieldsRequest = {
|
|
|
42
42
|
/**
|
|
43
43
|
* Legacy VendorFieldValue row (deprecated shape).
|
|
44
44
|
*/
|
|
45
|
-
export type
|
|
45
|
+
export type ListVendorAdditionalFacilityFieldsItems = {
|
|
46
46
|
/**
|
|
47
47
|
* VendorFieldValue id
|
|
48
48
|
*/
|
|
@@ -61,7 +61,7 @@ export type Items = {
|
|
|
61
61
|
*/
|
|
62
62
|
export type ListVendorAdditionalFacilityFieldsListVendorAdditionalFacilityFieldsOk =
|
|
63
63
|
{
|
|
64
|
-
items: Array<
|
|
64
|
+
items: Array<ListVendorAdditionalFacilityFieldsItems>;
|
|
65
65
|
/**
|
|
66
66
|
* Pagination information for a pageable list
|
|
67
67
|
*/
|
|
@@ -113,22 +113,31 @@ export function listVendorAdditionalFacilityFieldsRequestToJSON(
|
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
/** @internal */
|
|
116
|
-
export const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
116
|
+
export const ListVendorAdditionalFacilityFieldsItems$inboundSchema: z.ZodType<
|
|
117
|
+
ListVendorAdditionalFacilityFieldsItems,
|
|
118
|
+
z.ZodTypeDef,
|
|
119
|
+
unknown
|
|
120
|
+
> = z.object({
|
|
121
|
+
id: types.optional(types.number()),
|
|
122
|
+
system: z.nullable(types.string()).optional(),
|
|
123
|
+
facility: z.nullable(types.string()).optional(),
|
|
124
|
+
field: z.nullable(types.string()).optional(),
|
|
125
|
+
value: z.nullable(types.string()).optional(),
|
|
126
|
+
});
|
|
124
127
|
|
|
125
|
-
export function
|
|
128
|
+
export function listVendorAdditionalFacilityFieldsItemsFromJSON(
|
|
126
129
|
jsonString: string,
|
|
127
|
-
): SafeParseResult<
|
|
130
|
+
): SafeParseResult<
|
|
131
|
+
ListVendorAdditionalFacilityFieldsItems,
|
|
132
|
+
SDKValidationError
|
|
133
|
+
> {
|
|
128
134
|
return safeParse(
|
|
129
135
|
jsonString,
|
|
130
|
-
(x) =>
|
|
131
|
-
|
|
136
|
+
(x) =>
|
|
137
|
+
ListVendorAdditionalFacilityFieldsItems$inboundSchema.parse(
|
|
138
|
+
JSON.parse(x),
|
|
139
|
+
),
|
|
140
|
+
`Failed to parse 'ListVendorAdditionalFacilityFieldsItems' from JSON`,
|
|
132
141
|
);
|
|
133
142
|
}
|
|
134
143
|
|
|
@@ -139,7 +148,9 @@ export const ListVendorAdditionalFacilityFieldsListVendorAdditionalFacilityField
|
|
|
139
148
|
z.ZodTypeDef,
|
|
140
149
|
unknown
|
|
141
150
|
> = z.object({
|
|
142
|
-
items: z.array(
|
|
151
|
+
items: z.array(
|
|
152
|
+
z.lazy(() => ListVendorAdditionalFacilityFieldsItems$inboundSchema),
|
|
153
|
+
),
|
|
143
154
|
pager: components.Pager$inboundSchema,
|
|
144
155
|
});
|
|
145
156
|
|
package/src/react-query/index.ts
CHANGED
|
@@ -47,6 +47,7 @@ export * from "./organizationsDownloadCompanyTargetFacilitiesExport.js";
|
|
|
47
47
|
export * from "./organizationsExportCompanyTargetFacilities.js";
|
|
48
48
|
export * from "./organizationsGetCompanyTargetFacilitiesExportStatus.js";
|
|
49
49
|
export * from "./organizationsGetFacility.js";
|
|
50
|
+
export * from "./organizationsListFacilityVendors.js";
|
|
50
51
|
export * from "./organizationsListOrSearchDepartmentContacts.js";
|
|
51
52
|
export * from "./organizationsListOrSearchDepartments.js";
|
|
52
53
|
export * from "./organizationsListOrSearchFacilities.js";
|
|
@@ -80,7 +80,9 @@ export function buildOrganizationsExportCompanyTargetFacilitiesQuery(
|
|
|
80
80
|
export function queryKeyOrganizationsExportCompanyTargetFacilities(
|
|
81
81
|
companyId: number,
|
|
82
82
|
parameters: {
|
|
83
|
-
status?:
|
|
83
|
+
status?:
|
|
84
|
+
| operations.ExportCompanyTargetFacilitiesQueryParamStatus
|
|
85
|
+
| undefined;
|
|
84
86
|
hasIndividual?: operations.HasIndividual | undefined;
|
|
85
87
|
hasActiveIndividual?: operations.HasActiveIndividual | undefined;
|
|
86
88
|
facilityNameLike?: string | undefined;
|
|
@@ -125,7 +125,9 @@ export function setOrganizationsExportCompanyTargetFacilitiesData(
|
|
|
125
125
|
queryKeyBase: [
|
|
126
126
|
companyId: number,
|
|
127
127
|
parameters: {
|
|
128
|
-
status?:
|
|
128
|
+
status?:
|
|
129
|
+
| operations.ExportCompanyTargetFacilitiesQueryParamStatus
|
|
130
|
+
| undefined;
|
|
129
131
|
hasIndividual?: operations.HasIndividual | undefined;
|
|
130
132
|
hasActiveIndividual?: operations.HasActiveIndividual | undefined;
|
|
131
133
|
facilityNameLike?: string | undefined;
|
|
@@ -151,7 +153,9 @@ export function invalidateOrganizationsExportCompanyTargetFacilities(
|
|
|
151
153
|
[
|
|
152
154
|
companyId: number,
|
|
153
155
|
parameters: {
|
|
154
|
-
status?:
|
|
156
|
+
status?:
|
|
157
|
+
| operations.ExportCompanyTargetFacilitiesQueryParamStatus
|
|
158
|
+
| undefined;
|
|
155
159
|
hasIndividual?: operations.HasIndividual | undefined;
|
|
156
160
|
hasActiveIndividual?: operations.HasActiveIndividual | undefined;
|
|
157
161
|
facilityNameLike?: string | undefined;
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
QueryClient,
|
|
7
|
+
QueryFunctionContext,
|
|
8
|
+
QueryKey,
|
|
9
|
+
} from "@tanstack/react-query";
|
|
10
|
+
import { GreenSecurityCore } from "../core.js";
|
|
11
|
+
import { organizationsListFacilityVendors } from "../funcs/organizationsListFacilityVendors.js";
|
|
12
|
+
import { combineSignals } from "../lib/primitives.js";
|
|
13
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
14
|
+
import * as components from "../models/components/index.js";
|
|
15
|
+
import * as operations from "../models/operations/index.js";
|
|
16
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
17
|
+
import { PageIterator, unwrapResultIterator } from "../types/operations.js";
|
|
18
|
+
import { pageIteratorToJSON } from "./_types.js";
|
|
19
|
+
export type OrganizationsListFacilityVendorsQueryData =
|
|
20
|
+
operations.ListFacilityVendorsResponse;
|
|
21
|
+
|
|
22
|
+
export type OrganizationsListFacilityVendorsInfiniteQueryData = PageIterator<
|
|
23
|
+
operations.ListFacilityVendorsResponse,
|
|
24
|
+
{ page: number }
|
|
25
|
+
>;
|
|
26
|
+
|
|
27
|
+
export type OrganizationsListFacilityVendorsPageParams = PageIterator<
|
|
28
|
+
operations.ListFacilityVendorsResponse,
|
|
29
|
+
{ page: number }
|
|
30
|
+
>["~next"];
|
|
31
|
+
|
|
32
|
+
export function prefetchOrganizationsListFacilityVendors(
|
|
33
|
+
queryClient: QueryClient,
|
|
34
|
+
client$: GreenSecurityCore,
|
|
35
|
+
request: operations.ListFacilityVendorsRequest,
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): Promise<void> {
|
|
38
|
+
return queryClient.prefetchQuery({
|
|
39
|
+
...buildOrganizationsListFacilityVendorsQuery(
|
|
40
|
+
client$,
|
|
41
|
+
request,
|
|
42
|
+
options,
|
|
43
|
+
),
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function prefetchOrganizationsListFacilityVendorsInfinite(
|
|
48
|
+
queryClient: QueryClient,
|
|
49
|
+
client$: GreenSecurityCore,
|
|
50
|
+
request: operations.ListFacilityVendorsRequest,
|
|
51
|
+
options?: RequestOptions,
|
|
52
|
+
): Promise<void> {
|
|
53
|
+
return queryClient.prefetchInfiniteQuery({
|
|
54
|
+
...buildOrganizationsListFacilityVendorsInfiniteQuery(
|
|
55
|
+
client$,
|
|
56
|
+
request,
|
|
57
|
+
options,
|
|
58
|
+
),
|
|
59
|
+
initialPageParam: undefined as OrganizationsListFacilityVendorsPageParams,
|
|
60
|
+
getNextPageParam: (
|
|
61
|
+
previousPage: OrganizationsListFacilityVendorsInfiniteQueryData,
|
|
62
|
+
) => previousPage["~next"],
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function buildOrganizationsListFacilityVendorsQuery(
|
|
67
|
+
client$: GreenSecurityCore,
|
|
68
|
+
request: operations.ListFacilityVendorsRequest,
|
|
69
|
+
options?: RequestOptions,
|
|
70
|
+
): {
|
|
71
|
+
queryKey: QueryKey;
|
|
72
|
+
queryFn: (
|
|
73
|
+
context: QueryFunctionContext,
|
|
74
|
+
) => Promise<OrganizationsListFacilityVendorsQueryData>;
|
|
75
|
+
} {
|
|
76
|
+
return {
|
|
77
|
+
queryKey: queryKeyOrganizationsListFacilityVendors(request.id, {
|
|
78
|
+
companyId: request.companyId,
|
|
79
|
+
status: request.status,
|
|
80
|
+
search: request.search,
|
|
81
|
+
page: request.page,
|
|
82
|
+
itemsPerPage: request.itemsPerPage,
|
|
83
|
+
sort: request.sort,
|
|
84
|
+
desc: request.desc,
|
|
85
|
+
}),
|
|
86
|
+
queryFn: async function organizationsListFacilityVendorsQueryFn(
|
|
87
|
+
ctx,
|
|
88
|
+
): Promise<OrganizationsListFacilityVendorsQueryData> {
|
|
89
|
+
const sig = combineSignals(
|
|
90
|
+
ctx.signal,
|
|
91
|
+
options?.signal,
|
|
92
|
+
options?.fetchOptions?.signal,
|
|
93
|
+
);
|
|
94
|
+
const mergedOptions = {
|
|
95
|
+
...options?.fetchOptions,
|
|
96
|
+
...options,
|
|
97
|
+
signal: sig,
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
return unwrapAsync(organizationsListFacilityVendors(
|
|
101
|
+
client$,
|
|
102
|
+
request,
|
|
103
|
+
mergedOptions,
|
|
104
|
+
));
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function buildOrganizationsListFacilityVendorsInfiniteQuery(
|
|
110
|
+
client$: GreenSecurityCore,
|
|
111
|
+
request: operations.ListFacilityVendorsRequest,
|
|
112
|
+
options?: RequestOptions,
|
|
113
|
+
): {
|
|
114
|
+
queryKey: QueryKey;
|
|
115
|
+
queryFn: (
|
|
116
|
+
context: QueryFunctionContext<
|
|
117
|
+
QueryKey,
|
|
118
|
+
OrganizationsListFacilityVendorsPageParams
|
|
119
|
+
>,
|
|
120
|
+
) => Promise<OrganizationsListFacilityVendorsInfiniteQueryData>;
|
|
121
|
+
} {
|
|
122
|
+
return {
|
|
123
|
+
queryKey: queryKeyOrganizationsListFacilityVendorsInfinite(request.id, {
|
|
124
|
+
companyId: request.companyId,
|
|
125
|
+
status: request.status,
|
|
126
|
+
search: request.search,
|
|
127
|
+
page: request.page,
|
|
128
|
+
itemsPerPage: request.itemsPerPage,
|
|
129
|
+
sort: request.sort,
|
|
130
|
+
desc: request.desc,
|
|
131
|
+
}),
|
|
132
|
+
queryFn: async function organizationsListFacilityVendorsQuery(
|
|
133
|
+
ctx,
|
|
134
|
+
): Promise<OrganizationsListFacilityVendorsInfiniteQueryData> {
|
|
135
|
+
const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
|
|
136
|
+
const mergedOptions = {
|
|
137
|
+
...options,
|
|
138
|
+
fetchOptions: { ...options?.fetchOptions, signal: sig },
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
if (!ctx.pageParam) {
|
|
142
|
+
const pageResult = await unwrapResultIterator(
|
|
143
|
+
organizationsListFacilityVendors(
|
|
144
|
+
client$,
|
|
145
|
+
request,
|
|
146
|
+
mergedOptions,
|
|
147
|
+
),
|
|
148
|
+
);
|
|
149
|
+
return pageIteratorToJSON(pageResult);
|
|
150
|
+
}
|
|
151
|
+
const pageResult = await unwrapResultIterator(
|
|
152
|
+
organizationsListFacilityVendors(
|
|
153
|
+
client$,
|
|
154
|
+
{
|
|
155
|
+
...request,
|
|
156
|
+
page: ctx.pageParam.page,
|
|
157
|
+
},
|
|
158
|
+
mergedOptions,
|
|
159
|
+
),
|
|
160
|
+
);
|
|
161
|
+
return pageIteratorToJSON(pageResult);
|
|
162
|
+
},
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export function queryKeyOrganizationsListFacilityVendors(
|
|
167
|
+
id: number,
|
|
168
|
+
parameters: {
|
|
169
|
+
companyId?: number | undefined;
|
|
170
|
+
status?: operations.QueryParamStatus | undefined;
|
|
171
|
+
search?: string | undefined;
|
|
172
|
+
page?: number | undefined;
|
|
173
|
+
itemsPerPage?: number | undefined;
|
|
174
|
+
sort?: operations.ListFacilityVendorsQueryParamSort | undefined;
|
|
175
|
+
desc?: components.Desc | undefined;
|
|
176
|
+
},
|
|
177
|
+
): QueryKey {
|
|
178
|
+
return [
|
|
179
|
+
"@greensecurity/javascript-sdk",
|
|
180
|
+
"organizations",
|
|
181
|
+
"listFacilityVendors",
|
|
182
|
+
id,
|
|
183
|
+
parameters,
|
|
184
|
+
];
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export function queryKeyOrganizationsListFacilityVendorsInfinite(
|
|
188
|
+
id: number,
|
|
189
|
+
parameters: {
|
|
190
|
+
companyId?: number | undefined;
|
|
191
|
+
status?: operations.QueryParamStatus | undefined;
|
|
192
|
+
search?: string | undefined;
|
|
193
|
+
page?: number | undefined;
|
|
194
|
+
itemsPerPage?: number | undefined;
|
|
195
|
+
sort?: operations.ListFacilityVendorsQueryParamSort | undefined;
|
|
196
|
+
desc?: components.Desc | undefined;
|
|
197
|
+
},
|
|
198
|
+
): QueryKey {
|
|
199
|
+
return [
|
|
200
|
+
"@greensecurity/javascript-sdk",
|
|
201
|
+
"organizations",
|
|
202
|
+
"listFacilityVendors",
|
|
203
|
+
"infinite",
|
|
204
|
+
id,
|
|
205
|
+
parameters,
|
|
206
|
+
];
|
|
207
|
+
}
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
InfiniteData,
|
|
7
|
+
InvalidateQueryFilters,
|
|
8
|
+
QueryClient,
|
|
9
|
+
QueryKey,
|
|
10
|
+
useInfiniteQuery,
|
|
11
|
+
UseInfiniteQueryResult,
|
|
12
|
+
useQuery,
|
|
13
|
+
UseQueryResult,
|
|
14
|
+
useSuspenseInfiniteQuery,
|
|
15
|
+
UseSuspenseInfiniteQueryResult,
|
|
16
|
+
useSuspenseQuery,
|
|
17
|
+
UseSuspenseQueryResult,
|
|
18
|
+
} from "@tanstack/react-query";
|
|
19
|
+
import * as components from "../models/components/index.js";
|
|
20
|
+
import { GreenSecurityError } from "../models/errors/greensecurityerror.js";
|
|
21
|
+
import {
|
|
22
|
+
ConnectionError,
|
|
23
|
+
InvalidRequestError,
|
|
24
|
+
RequestAbortedError,
|
|
25
|
+
RequestTimeoutError,
|
|
26
|
+
UnexpectedClientError,
|
|
27
|
+
} from "../models/errors/httpclienterrors.js";
|
|
28
|
+
import * as errors from "../models/errors/index.js";
|
|
29
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
30
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
31
|
+
import * as operations from "../models/operations/index.js";
|
|
32
|
+
import { useGreenSecurityContext } from "./_context.js";
|
|
33
|
+
import {
|
|
34
|
+
InfiniteQueryHookOptions,
|
|
35
|
+
QueryHookOptions,
|
|
36
|
+
SuspenseInfiniteQueryHookOptions,
|
|
37
|
+
SuspenseQueryHookOptions,
|
|
38
|
+
TupleToPrefixes,
|
|
39
|
+
} from "./_types.js";
|
|
40
|
+
import {
|
|
41
|
+
buildOrganizationsListFacilityVendorsInfiniteQuery,
|
|
42
|
+
buildOrganizationsListFacilityVendorsQuery,
|
|
43
|
+
OrganizationsListFacilityVendorsInfiniteQueryData,
|
|
44
|
+
OrganizationsListFacilityVendorsPageParams,
|
|
45
|
+
OrganizationsListFacilityVendorsQueryData,
|
|
46
|
+
prefetchOrganizationsListFacilityVendors,
|
|
47
|
+
prefetchOrganizationsListFacilityVendorsInfinite,
|
|
48
|
+
queryKeyOrganizationsListFacilityVendors,
|
|
49
|
+
queryKeyOrganizationsListFacilityVendorsInfinite,
|
|
50
|
+
} from "./organizationsListFacilityVendors.core.js";
|
|
51
|
+
export {
|
|
52
|
+
buildOrganizationsListFacilityVendorsInfiniteQuery,
|
|
53
|
+
buildOrganizationsListFacilityVendorsQuery,
|
|
54
|
+
type OrganizationsListFacilityVendorsInfiniteQueryData,
|
|
55
|
+
type OrganizationsListFacilityVendorsPageParams,
|
|
56
|
+
type OrganizationsListFacilityVendorsQueryData,
|
|
57
|
+
prefetchOrganizationsListFacilityVendors,
|
|
58
|
+
prefetchOrganizationsListFacilityVendorsInfinite,
|
|
59
|
+
queryKeyOrganizationsListFacilityVendors,
|
|
60
|
+
queryKeyOrganizationsListFacilityVendorsInfinite,
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export type OrganizationsListFacilityVendorsQueryError =
|
|
64
|
+
| errors.ApiErrorResponse
|
|
65
|
+
| GreenSecurityError
|
|
66
|
+
| ResponseValidationError
|
|
67
|
+
| ConnectionError
|
|
68
|
+
| RequestAbortedError
|
|
69
|
+
| RequestTimeoutError
|
|
70
|
+
| InvalidRequestError
|
|
71
|
+
| UnexpectedClientError
|
|
72
|
+
| SDKValidationError;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* List vendors targeting a facility
|
|
76
|
+
*
|
|
77
|
+
* @remarks
|
|
78
|
+
* Powers the Company Portal → Facility Details page. Returns the
|
|
79
|
+
* paginated list of company-scoped vendor reps that are targeting the
|
|
80
|
+
* given facility, with each row carrying the rep's name + email, their
|
|
81
|
+
* last visit to this facility, their facility access status, and any
|
|
82
|
+
* company custom fields the company has flagged `show_to_vendor` (which
|
|
83
|
+
* is where the "Employee ID" column on the UI lives).
|
|
84
|
+
*
|
|
85
|
+
* Filtering: pass `status=approved|pending|denied` to scope the rows to a
|
|
86
|
+
* single status tab. Pass `search=<term>` for a single search box that
|
|
87
|
+
* matches first name, last name, full name, email, OR any visible custom
|
|
88
|
+
* field value (covering the "search by name / email / Employee ID"
|
|
89
|
+
* requirement).
|
|
90
|
+
*
|
|
91
|
+
* Access control:
|
|
92
|
+
* * Regular users: the URL's `:id` must be in the caller's read scope for
|
|
93
|
+
* Facility (resolved via `has_facility_access_policy`). Out-of-scope or
|
|
94
|
+
* soft-deleted facilities return `404 Facility not found`.
|
|
95
|
+
* * API users: must pass `company_id`. Both the company and the facility
|
|
96
|
+
* must be activated for the caller's marketplace app
|
|
97
|
+
* (`MarketplaceAppActivation`).
|
|
98
|
+
*/
|
|
99
|
+
export function useOrganizationsListFacilityVendors(
|
|
100
|
+
request: operations.ListFacilityVendorsRequest,
|
|
101
|
+
options?: QueryHookOptions<
|
|
102
|
+
OrganizationsListFacilityVendorsQueryData,
|
|
103
|
+
OrganizationsListFacilityVendorsQueryError
|
|
104
|
+
>,
|
|
105
|
+
): UseQueryResult<
|
|
106
|
+
OrganizationsListFacilityVendorsQueryData,
|
|
107
|
+
OrganizationsListFacilityVendorsQueryError
|
|
108
|
+
> {
|
|
109
|
+
const client = useGreenSecurityContext();
|
|
110
|
+
return useQuery({
|
|
111
|
+
...buildOrganizationsListFacilityVendorsQuery(
|
|
112
|
+
client,
|
|
113
|
+
request,
|
|
114
|
+
options,
|
|
115
|
+
),
|
|
116
|
+
...options,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* List vendors targeting a facility
|
|
122
|
+
*
|
|
123
|
+
* @remarks
|
|
124
|
+
* Powers the Company Portal → Facility Details page. Returns the
|
|
125
|
+
* paginated list of company-scoped vendor reps that are targeting the
|
|
126
|
+
* given facility, with each row carrying the rep's name + email, their
|
|
127
|
+
* last visit to this facility, their facility access status, and any
|
|
128
|
+
* company custom fields the company has flagged `show_to_vendor` (which
|
|
129
|
+
* is where the "Employee ID" column on the UI lives).
|
|
130
|
+
*
|
|
131
|
+
* Filtering: pass `status=approved|pending|denied` to scope the rows to a
|
|
132
|
+
* single status tab. Pass `search=<term>` for a single search box that
|
|
133
|
+
* matches first name, last name, full name, email, OR any visible custom
|
|
134
|
+
* field value (covering the "search by name / email / Employee ID"
|
|
135
|
+
* requirement).
|
|
136
|
+
*
|
|
137
|
+
* Access control:
|
|
138
|
+
* * Regular users: the URL's `:id` must be in the caller's read scope for
|
|
139
|
+
* Facility (resolved via `has_facility_access_policy`). Out-of-scope or
|
|
140
|
+
* soft-deleted facilities return `404 Facility not found`.
|
|
141
|
+
* * API users: must pass `company_id`. Both the company and the facility
|
|
142
|
+
* must be activated for the caller's marketplace app
|
|
143
|
+
* (`MarketplaceAppActivation`).
|
|
144
|
+
*/
|
|
145
|
+
export function useOrganizationsListFacilityVendorsSuspense(
|
|
146
|
+
request: operations.ListFacilityVendorsRequest,
|
|
147
|
+
options?: SuspenseQueryHookOptions<
|
|
148
|
+
OrganizationsListFacilityVendorsQueryData,
|
|
149
|
+
OrganizationsListFacilityVendorsQueryError
|
|
150
|
+
>,
|
|
151
|
+
): UseSuspenseQueryResult<
|
|
152
|
+
OrganizationsListFacilityVendorsQueryData,
|
|
153
|
+
OrganizationsListFacilityVendorsQueryError
|
|
154
|
+
> {
|
|
155
|
+
const client = useGreenSecurityContext();
|
|
156
|
+
return useSuspenseQuery({
|
|
157
|
+
...buildOrganizationsListFacilityVendorsQuery(
|
|
158
|
+
client,
|
|
159
|
+
request,
|
|
160
|
+
options,
|
|
161
|
+
),
|
|
162
|
+
...options,
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* List vendors targeting a facility
|
|
168
|
+
*
|
|
169
|
+
* @remarks
|
|
170
|
+
* Powers the Company Portal → Facility Details page. Returns the
|
|
171
|
+
* paginated list of company-scoped vendor reps that are targeting the
|
|
172
|
+
* given facility, with each row carrying the rep's name + email, their
|
|
173
|
+
* last visit to this facility, their facility access status, and any
|
|
174
|
+
* company custom fields the company has flagged `show_to_vendor` (which
|
|
175
|
+
* is where the "Employee ID" column on the UI lives).
|
|
176
|
+
*
|
|
177
|
+
* Filtering: pass `status=approved|pending|denied` to scope the rows to a
|
|
178
|
+
* single status tab. Pass `search=<term>` for a single search box that
|
|
179
|
+
* matches first name, last name, full name, email, OR any visible custom
|
|
180
|
+
* field value (covering the "search by name / email / Employee ID"
|
|
181
|
+
* requirement).
|
|
182
|
+
*
|
|
183
|
+
* Access control:
|
|
184
|
+
* * Regular users: the URL's `:id` must be in the caller's read scope for
|
|
185
|
+
* Facility (resolved via `has_facility_access_policy`). Out-of-scope or
|
|
186
|
+
* soft-deleted facilities return `404 Facility not found`.
|
|
187
|
+
* * API users: must pass `company_id`. Both the company and the facility
|
|
188
|
+
* must be activated for the caller's marketplace app
|
|
189
|
+
* (`MarketplaceAppActivation`).
|
|
190
|
+
*/
|
|
191
|
+
export function useOrganizationsListFacilityVendorsInfinite(
|
|
192
|
+
request: operations.ListFacilityVendorsRequest,
|
|
193
|
+
options?: InfiniteQueryHookOptions<
|
|
194
|
+
OrganizationsListFacilityVendorsInfiniteQueryData,
|
|
195
|
+
OrganizationsListFacilityVendorsQueryError
|
|
196
|
+
>,
|
|
197
|
+
): UseInfiniteQueryResult<
|
|
198
|
+
InfiniteData<
|
|
199
|
+
OrganizationsListFacilityVendorsInfiniteQueryData,
|
|
200
|
+
OrganizationsListFacilityVendorsPageParams
|
|
201
|
+
>,
|
|
202
|
+
OrganizationsListFacilityVendorsQueryError
|
|
203
|
+
> {
|
|
204
|
+
const client = useGreenSecurityContext();
|
|
205
|
+
return useInfiniteQuery<
|
|
206
|
+
OrganizationsListFacilityVendorsInfiniteQueryData,
|
|
207
|
+
OrganizationsListFacilityVendorsQueryError,
|
|
208
|
+
InfiniteData<
|
|
209
|
+
OrganizationsListFacilityVendorsInfiniteQueryData,
|
|
210
|
+
OrganizationsListFacilityVendorsPageParams
|
|
211
|
+
>,
|
|
212
|
+
QueryKey,
|
|
213
|
+
OrganizationsListFacilityVendorsPageParams
|
|
214
|
+
>({
|
|
215
|
+
...buildOrganizationsListFacilityVendorsInfiniteQuery(
|
|
216
|
+
client,
|
|
217
|
+
request,
|
|
218
|
+
options,
|
|
219
|
+
),
|
|
220
|
+
initialPageParam: options?.initialPageParam,
|
|
221
|
+
getNextPageParam: (previousPage) => previousPage["~next"],
|
|
222
|
+
...options,
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* List vendors targeting a facility
|
|
228
|
+
*
|
|
229
|
+
* @remarks
|
|
230
|
+
* Powers the Company Portal → Facility Details page. Returns the
|
|
231
|
+
* paginated list of company-scoped vendor reps that are targeting the
|
|
232
|
+
* given facility, with each row carrying the rep's name + email, their
|
|
233
|
+
* last visit to this facility, their facility access status, and any
|
|
234
|
+
* company custom fields the company has flagged `show_to_vendor` (which
|
|
235
|
+
* is where the "Employee ID" column on the UI lives).
|
|
236
|
+
*
|
|
237
|
+
* Filtering: pass `status=approved|pending|denied` to scope the rows to a
|
|
238
|
+
* single status tab. Pass `search=<term>` for a single search box that
|
|
239
|
+
* matches first name, last name, full name, email, OR any visible custom
|
|
240
|
+
* field value (covering the "search by name / email / Employee ID"
|
|
241
|
+
* requirement).
|
|
242
|
+
*
|
|
243
|
+
* Access control:
|
|
244
|
+
* * Regular users: the URL's `:id` must be in the caller's read scope for
|
|
245
|
+
* Facility (resolved via `has_facility_access_policy`). Out-of-scope or
|
|
246
|
+
* soft-deleted facilities return `404 Facility not found`.
|
|
247
|
+
* * API users: must pass `company_id`. Both the company and the facility
|
|
248
|
+
* must be activated for the caller's marketplace app
|
|
249
|
+
* (`MarketplaceAppActivation`).
|
|
250
|
+
*/
|
|
251
|
+
export function useOrganizationsListFacilityVendorsInfiniteSuspense(
|
|
252
|
+
request: operations.ListFacilityVendorsRequest,
|
|
253
|
+
options?: SuspenseInfiniteQueryHookOptions<
|
|
254
|
+
OrganizationsListFacilityVendorsInfiniteQueryData,
|
|
255
|
+
OrganizationsListFacilityVendorsQueryError
|
|
256
|
+
>,
|
|
257
|
+
): UseSuspenseInfiniteQueryResult<
|
|
258
|
+
InfiniteData<
|
|
259
|
+
OrganizationsListFacilityVendorsInfiniteQueryData,
|
|
260
|
+
OrganizationsListFacilityVendorsPageParams
|
|
261
|
+
>,
|
|
262
|
+
OrganizationsListFacilityVendorsQueryError
|
|
263
|
+
> {
|
|
264
|
+
const client = useGreenSecurityContext();
|
|
265
|
+
return useSuspenseInfiniteQuery<
|
|
266
|
+
OrganizationsListFacilityVendorsInfiniteQueryData,
|
|
267
|
+
OrganizationsListFacilityVendorsQueryError,
|
|
268
|
+
InfiniteData<
|
|
269
|
+
OrganizationsListFacilityVendorsInfiniteQueryData,
|
|
270
|
+
OrganizationsListFacilityVendorsPageParams
|
|
271
|
+
>,
|
|
272
|
+
QueryKey,
|
|
273
|
+
OrganizationsListFacilityVendorsPageParams
|
|
274
|
+
>({
|
|
275
|
+
...buildOrganizationsListFacilityVendorsInfiniteQuery(
|
|
276
|
+
client,
|
|
277
|
+
request,
|
|
278
|
+
options,
|
|
279
|
+
),
|
|
280
|
+
initialPageParam: options?.initialPageParam,
|
|
281
|
+
getNextPageParam: (previousPage) => previousPage["~next"],
|
|
282
|
+
...options,
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export function setOrganizationsListFacilityVendorsData(
|
|
287
|
+
client: QueryClient,
|
|
288
|
+
queryKeyBase: [
|
|
289
|
+
id: number,
|
|
290
|
+
parameters: {
|
|
291
|
+
companyId?: number | undefined;
|
|
292
|
+
status?: operations.QueryParamStatus | undefined;
|
|
293
|
+
search?: string | undefined;
|
|
294
|
+
page?: number | undefined;
|
|
295
|
+
itemsPerPage?: number | undefined;
|
|
296
|
+
sort?: operations.ListFacilityVendorsQueryParamSort | undefined;
|
|
297
|
+
desc?: components.Desc | undefined;
|
|
298
|
+
},
|
|
299
|
+
],
|
|
300
|
+
data: OrganizationsListFacilityVendorsQueryData,
|
|
301
|
+
): OrganizationsListFacilityVendorsQueryData | undefined {
|
|
302
|
+
const key = queryKeyOrganizationsListFacilityVendors(...queryKeyBase);
|
|
303
|
+
|
|
304
|
+
return client.setQueryData<OrganizationsListFacilityVendorsQueryData>(
|
|
305
|
+
key,
|
|
306
|
+
data,
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
export function invalidateOrganizationsListFacilityVendors(
|
|
311
|
+
client: QueryClient,
|
|
312
|
+
queryKeyBase: TupleToPrefixes<
|
|
313
|
+
[
|
|
314
|
+
id: number,
|
|
315
|
+
parameters: {
|
|
316
|
+
companyId?: number | undefined;
|
|
317
|
+
status?: operations.QueryParamStatus | undefined;
|
|
318
|
+
search?: string | undefined;
|
|
319
|
+
page?: number | undefined;
|
|
320
|
+
itemsPerPage?: number | undefined;
|
|
321
|
+
sort?: operations.ListFacilityVendorsQueryParamSort | undefined;
|
|
322
|
+
desc?: components.Desc | undefined;
|
|
323
|
+
},
|
|
324
|
+
]
|
|
325
|
+
>,
|
|
326
|
+
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
327
|
+
): Promise<void> {
|
|
328
|
+
return client.invalidateQueries({
|
|
329
|
+
...filters,
|
|
330
|
+
queryKey: [
|
|
331
|
+
"@greensecurity/javascript-sdk",
|
|
332
|
+
"organizations",
|
|
333
|
+
"listFacilityVendors",
|
|
334
|
+
...queryKeyBase,
|
|
335
|
+
],
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
export function invalidateAllOrganizationsListFacilityVendors(
|
|
340
|
+
client: QueryClient,
|
|
341
|
+
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
342
|
+
): Promise<void> {
|
|
343
|
+
return client.invalidateQueries({
|
|
344
|
+
...filters,
|
|
345
|
+
queryKey: [
|
|
346
|
+
"@greensecurity/javascript-sdk",
|
|
347
|
+
"organizations",
|
|
348
|
+
"listFacilityVendors",
|
|
349
|
+
],
|
|
350
|
+
});
|
|
351
|
+
}
|