@greensecurity/javascript-sdk 0.44.0-beta.12 → 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 +30 -2
- 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/hooks/types.d.ts +1 -0
- package/dist/commonjs/hooks/types.d.ts.map +1 -1
- 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 +4 -4
- package/dist/commonjs/lib/config.js +4 -4
- package/dist/commonjs/lib/sdks.d.ts.map +1 -1
- package/dist/commonjs/lib/sdks.js +13 -4
- package/dist/commonjs/lib/sdks.js.map +1 -1
- 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 +30 -2
- 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/hooks/types.d.ts +1 -0
- package/dist/esm/hooks/types.d.ts.map +1 -1
- 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 +4 -4
- package/dist/esm/lib/config.js +4 -4
- package/dist/esm/lib/sdks.d.ts.map +1 -1
- package/dist/esm/lib/sdks.js +13 -4
- package/dist/esm/lib/sdks.js.map +1 -1
- 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 +30 -2
- 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/hooks/types.ts +1 -0
- package/src/index.extras.ts +13 -3
- package/src/lib/config.ts +4 -4
- package/src/lib/sdks.ts +13 -4
- 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
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import * as openEnums from "../../types/enums.js";
|
|
9
|
+
import { ClosedEnum, OpenEnum } from "../../types/enums.js";
|
|
10
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
11
|
+
import * as types from "../../types/primitives.js";
|
|
12
|
+
import * as components from "../components/index.js";
|
|
13
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Filter rows to a single facility access status. Omit for "All".
|
|
17
|
+
*/
|
|
18
|
+
export const QueryParamStatus = {
|
|
19
|
+
Approved: "approved",
|
|
20
|
+
Pending: "pending",
|
|
21
|
+
Denied: "denied",
|
|
22
|
+
} as const;
|
|
23
|
+
/**
|
|
24
|
+
* Filter rows to a single facility access status. Omit for "All".
|
|
25
|
+
*/
|
|
26
|
+
export type QueryParamStatus = ClosedEnum<typeof QueryParamStatus>;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Sort field. Defaults to `name`.
|
|
30
|
+
*/
|
|
31
|
+
export const ListFacilityVendorsQueryParamSort = {
|
|
32
|
+
Id: "id",
|
|
33
|
+
Name: "name",
|
|
34
|
+
LastName: "last_name",
|
|
35
|
+
Email: "email",
|
|
36
|
+
Status: "status",
|
|
37
|
+
} as const;
|
|
38
|
+
/**
|
|
39
|
+
* Sort field. Defaults to `name`.
|
|
40
|
+
*/
|
|
41
|
+
export type ListFacilityVendorsQueryParamSort = ClosedEnum<
|
|
42
|
+
typeof ListFacilityVendorsQueryParamSort
|
|
43
|
+
>;
|
|
44
|
+
|
|
45
|
+
export type ListFacilityVendorsRequest = {
|
|
46
|
+
/**
|
|
47
|
+
* The facility whose vendor roster to list.
|
|
48
|
+
*/
|
|
49
|
+
id: number;
|
|
50
|
+
/**
|
|
51
|
+
* API users only — the company whose vendors to list. Ignored for company managers / vendors (resolved from the session).
|
|
52
|
+
*/
|
|
53
|
+
companyId?: number | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Filter rows to a single facility access status. Omit for "All".
|
|
56
|
+
*/
|
|
57
|
+
status?: QueryParamStatus | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Single search term applied case-insensitively across first name,
|
|
60
|
+
*
|
|
61
|
+
* @remarks
|
|
62
|
+
* last name, full name, email, and any company custom-field value the
|
|
63
|
+
* vendor has set for a field flagged `show_to_vendor`.
|
|
64
|
+
*/
|
|
65
|
+
search?: string | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* A 1-based offset for which page to request (defaults to 1)
|
|
68
|
+
*/
|
|
69
|
+
page?: number | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Number of items to show in a given page
|
|
72
|
+
*/
|
|
73
|
+
itemsPerPage?: number | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Sort field. Defaults to `name`.
|
|
76
|
+
*/
|
|
77
|
+
sort?: ListFacilityVendorsQueryParamSort | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Sort desc
|
|
80
|
+
*/
|
|
81
|
+
desc?: components.Desc | undefined;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Facility access status from `target_facilities.status`.
|
|
86
|
+
*/
|
|
87
|
+
export const ListFacilityVendorsStatus = {
|
|
88
|
+
Approved: "Approved",
|
|
89
|
+
Pending: "Pending",
|
|
90
|
+
Denied: "Denied",
|
|
91
|
+
} as const;
|
|
92
|
+
/**
|
|
93
|
+
* Facility access status from `target_facilities.status`.
|
|
94
|
+
*/
|
|
95
|
+
export type ListFacilityVendorsStatus = OpenEnum<
|
|
96
|
+
typeof ListFacilityVendorsStatus
|
|
97
|
+
>;
|
|
98
|
+
|
|
99
|
+
export type CustomFields = {
|
|
100
|
+
id?: number | undefined;
|
|
101
|
+
name?: string | undefined;
|
|
102
|
+
value?: string | null | undefined;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export type Items = {
|
|
106
|
+
/**
|
|
107
|
+
* Vendor ID.
|
|
108
|
+
*/
|
|
109
|
+
id?: number | undefined;
|
|
110
|
+
/**
|
|
111
|
+
* Vendor's full name (`first_name + last_name`).
|
|
112
|
+
*/
|
|
113
|
+
name?: string | null | undefined;
|
|
114
|
+
/**
|
|
115
|
+
* Vendor's email.
|
|
116
|
+
*/
|
|
117
|
+
email?: string | null | undefined;
|
|
118
|
+
/**
|
|
119
|
+
* Thumbnail URL for the vendor's head shot.
|
|
120
|
+
*/
|
|
121
|
+
imageUrl?: string | null | undefined;
|
|
122
|
+
/**
|
|
123
|
+
* ISO8601 timestamp of the vendor's most recent scan at this facility, or null if they have never visited.
|
|
124
|
+
*/
|
|
125
|
+
lastVisit?: string | null | undefined;
|
|
126
|
+
/**
|
|
127
|
+
* Facility access status from `target_facilities.status`.
|
|
128
|
+
*/
|
|
129
|
+
status?: ListFacilityVendorsStatus | null | undefined;
|
|
130
|
+
/**
|
|
131
|
+
* Company custom fields flagged `show_to_vendor`. One entry per enabled field; `value` is null when the vendor has no value set.
|
|
132
|
+
*/
|
|
133
|
+
customFields?: Array<CustomFields> | undefined;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* The request was successful, and the server has returned the requested resource in the response body.
|
|
138
|
+
*/
|
|
139
|
+
export type ListFacilityVendorsListFacilityVendorsOk = {
|
|
140
|
+
/**
|
|
141
|
+
* Pagination information for a pageable list
|
|
142
|
+
*/
|
|
143
|
+
pager: components.Pager;
|
|
144
|
+
items: Array<Items>;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
export type ListFacilityVendorsResponse = {
|
|
148
|
+
result: ListFacilityVendorsListFacilityVendorsOk;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
/** @internal */
|
|
152
|
+
export const QueryParamStatus$outboundSchema: z.ZodNativeEnum<
|
|
153
|
+
typeof QueryParamStatus
|
|
154
|
+
> = z.nativeEnum(QueryParamStatus);
|
|
155
|
+
|
|
156
|
+
/** @internal */
|
|
157
|
+
export const ListFacilityVendorsQueryParamSort$outboundSchema: z.ZodNativeEnum<
|
|
158
|
+
typeof ListFacilityVendorsQueryParamSort
|
|
159
|
+
> = z.nativeEnum(ListFacilityVendorsQueryParamSort);
|
|
160
|
+
|
|
161
|
+
/** @internal */
|
|
162
|
+
export type ListFacilityVendorsRequest$Outbound = {
|
|
163
|
+
id: number;
|
|
164
|
+
company_id?: number | undefined;
|
|
165
|
+
status?: string | undefined;
|
|
166
|
+
search?: string | undefined;
|
|
167
|
+
page?: number | undefined;
|
|
168
|
+
items_per_page?: number | undefined;
|
|
169
|
+
sort?: string | undefined;
|
|
170
|
+
desc?: components.Desc$Outbound | undefined;
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
/** @internal */
|
|
174
|
+
export const ListFacilityVendorsRequest$outboundSchema: z.ZodType<
|
|
175
|
+
ListFacilityVendorsRequest$Outbound,
|
|
176
|
+
z.ZodTypeDef,
|
|
177
|
+
ListFacilityVendorsRequest
|
|
178
|
+
> = z.object({
|
|
179
|
+
id: z.number().int(),
|
|
180
|
+
companyId: z.number().int().optional(),
|
|
181
|
+
status: QueryParamStatus$outboundSchema.optional(),
|
|
182
|
+
search: z.string().optional(),
|
|
183
|
+
page: z.number().int().optional(),
|
|
184
|
+
itemsPerPage: z.number().int().optional(),
|
|
185
|
+
sort: ListFacilityVendorsQueryParamSort$outboundSchema.optional(),
|
|
186
|
+
desc: components.Desc$outboundSchema.optional(),
|
|
187
|
+
}).transform((v) => {
|
|
188
|
+
return remap$(v, {
|
|
189
|
+
companyId: "company_id",
|
|
190
|
+
itemsPerPage: "items_per_page",
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
export function listFacilityVendorsRequestToJSON(
|
|
195
|
+
listFacilityVendorsRequest: ListFacilityVendorsRequest,
|
|
196
|
+
): string {
|
|
197
|
+
return JSON.stringify(
|
|
198
|
+
ListFacilityVendorsRequest$outboundSchema.parse(listFacilityVendorsRequest),
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/** @internal */
|
|
203
|
+
export const ListFacilityVendorsStatus$inboundSchema: z.ZodType<
|
|
204
|
+
ListFacilityVendorsStatus,
|
|
205
|
+
z.ZodTypeDef,
|
|
206
|
+
unknown
|
|
207
|
+
> = openEnums.inboundSchema(ListFacilityVendorsStatus);
|
|
208
|
+
|
|
209
|
+
/** @internal */
|
|
210
|
+
export const CustomFields$inboundSchema: z.ZodType<
|
|
211
|
+
CustomFields,
|
|
212
|
+
z.ZodTypeDef,
|
|
213
|
+
unknown
|
|
214
|
+
> = z.object({
|
|
215
|
+
id: types.optional(types.number()),
|
|
216
|
+
name: types.optional(types.string()),
|
|
217
|
+
value: z.nullable(types.string()).optional(),
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
export function customFieldsFromJSON(
|
|
221
|
+
jsonString: string,
|
|
222
|
+
): SafeParseResult<CustomFields, SDKValidationError> {
|
|
223
|
+
return safeParse(
|
|
224
|
+
jsonString,
|
|
225
|
+
(x) => CustomFields$inboundSchema.parse(JSON.parse(x)),
|
|
226
|
+
`Failed to parse 'CustomFields' from JSON`,
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/** @internal */
|
|
231
|
+
export const Items$inboundSchema: z.ZodType<Items, z.ZodTypeDef, unknown> = z
|
|
232
|
+
.object({
|
|
233
|
+
id: types.optional(types.number()),
|
|
234
|
+
name: z.nullable(types.string()).optional(),
|
|
235
|
+
email: z.nullable(types.string()).optional(),
|
|
236
|
+
image_url: z.nullable(types.string()).optional(),
|
|
237
|
+
last_visit: z.nullable(types.string()).optional(),
|
|
238
|
+
status: z.nullable(ListFacilityVendorsStatus$inboundSchema).optional(),
|
|
239
|
+
custom_fields: types.optional(
|
|
240
|
+
z.array(z.lazy(() => CustomFields$inboundSchema)),
|
|
241
|
+
),
|
|
242
|
+
}).transform((v) => {
|
|
243
|
+
return remap$(v, {
|
|
244
|
+
"image_url": "imageUrl",
|
|
245
|
+
"last_visit": "lastVisit",
|
|
246
|
+
"custom_fields": "customFields",
|
|
247
|
+
});
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
export function itemsFromJSON(
|
|
251
|
+
jsonString: string,
|
|
252
|
+
): SafeParseResult<Items, SDKValidationError> {
|
|
253
|
+
return safeParse(
|
|
254
|
+
jsonString,
|
|
255
|
+
(x) => Items$inboundSchema.parse(JSON.parse(x)),
|
|
256
|
+
`Failed to parse 'Items' from JSON`,
|
|
257
|
+
);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/** @internal */
|
|
261
|
+
export const ListFacilityVendorsListFacilityVendorsOk$inboundSchema: z.ZodType<
|
|
262
|
+
ListFacilityVendorsListFacilityVendorsOk,
|
|
263
|
+
z.ZodTypeDef,
|
|
264
|
+
unknown
|
|
265
|
+
> = z.object({
|
|
266
|
+
pager: components.Pager$inboundSchema,
|
|
267
|
+
items: z.array(z.lazy(() => Items$inboundSchema)),
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
export function listFacilityVendorsListFacilityVendorsOkFromJSON(
|
|
271
|
+
jsonString: string,
|
|
272
|
+
): SafeParseResult<
|
|
273
|
+
ListFacilityVendorsListFacilityVendorsOk,
|
|
274
|
+
SDKValidationError
|
|
275
|
+
> {
|
|
276
|
+
return safeParse(
|
|
277
|
+
jsonString,
|
|
278
|
+
(x) =>
|
|
279
|
+
ListFacilityVendorsListFacilityVendorsOk$inboundSchema.parse(
|
|
280
|
+
JSON.parse(x),
|
|
281
|
+
),
|
|
282
|
+
`Failed to parse 'ListFacilityVendorsListFacilityVendorsOk' from JSON`,
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/** @internal */
|
|
287
|
+
export const ListFacilityVendorsResponse$inboundSchema: z.ZodType<
|
|
288
|
+
ListFacilityVendorsResponse,
|
|
289
|
+
z.ZodTypeDef,
|
|
290
|
+
unknown
|
|
291
|
+
> = z.object({
|
|
292
|
+
Result: z.lazy(() => ListFacilityVendorsListFacilityVendorsOk$inboundSchema),
|
|
293
|
+
}).transform((v) => {
|
|
294
|
+
return remap$(v, {
|
|
295
|
+
"Result": "result",
|
|
296
|
+
});
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
export function listFacilityVendorsResponseFromJSON(
|
|
300
|
+
jsonString: string,
|
|
301
|
+
): SafeParseResult<ListFacilityVendorsResponse, SDKValidationError> {
|
|
302
|
+
return safeParse(
|
|
303
|
+
jsonString,
|
|
304
|
+
(x) => ListFacilityVendorsResponse$inboundSchema.parse(JSON.parse(x)),
|
|
305
|
+
`Failed to parse 'ListFacilityVendorsResponse' from JSON`,
|
|
306
|
+
);
|
|
307
|
+
}
|
|
@@ -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
|
+
}
|