@greensecurity/javascript-sdk 0.43.1-beta.88 → 0.43.1-beta.90
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__/companies.test.js +30 -0
- package/dist/commonjs/__tests__/companies.test.js.map +1 -1
- package/dist/commonjs/__tests__/zones.test.js +5 -19
- package/dist/commonjs/__tests__/zones.test.js.map +1 -1
- package/dist/commonjs/funcs/companiesListCompanyManagers.d.ts +21 -0
- package/dist/commonjs/funcs/companiesListCompanyManagers.d.ts.map +1 -0
- package/dist/commonjs/funcs/companiesListCompanyManagers.js +162 -0
- package/dist/commonjs/funcs/companiesListCompanyManagers.js.map +1 -0
- package/dist/commonjs/funcs/vendorsGetVendorsDetails.d.ts +0 -1
- package/dist/commonjs/funcs/vendorsGetVendorsDetails.d.ts.map +1 -1
- package/dist/commonjs/funcs/vendorsGetVendorsDetails.js +0 -1
- package/dist/commonjs/funcs/vendorsGetVendorsDetails.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/components/companymanager.d.ts +78 -0
- package/dist/commonjs/models/components/companymanager.d.ts.map +1 -0
- package/dist/commonjs/models/components/companymanager.js +172 -0
- package/dist/commonjs/models/components/companymanager.js.map +1 -0
- package/dist/commonjs/models/components/expand.d.ts +0 -1
- package/dist/commonjs/models/components/expand.d.ts.map +1 -1
- package/dist/commonjs/models/components/expand.js +0 -1
- package/dist/commonjs/models/components/expand.js.map +1 -1
- package/dist/commonjs/models/components/index.d.ts +1 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +1 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/vendor.d.ts +0 -7
- package/dist/commonjs/models/components/vendor.d.ts.map +1 -1
- package/dist/commonjs/models/components/vendor.js +1 -16
- package/dist/commonjs/models/components/vendor.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/listcompanymanagers.d.ts +57 -0
- package/dist/commonjs/models/operations/listcompanymanagers.d.ts.map +1 -0
- package/dist/commonjs/models/operations/listcompanymanagers.js +82 -0
- package/dist/commonjs/models/operations/listcompanymanagers.js.map +1 -0
- package/dist/commonjs/models/operations/updatevendordetails.d.ts +0 -15
- package/dist/commonjs/models/operations/updatevendordetails.d.ts.map +1 -1
- package/dist/commonjs/models/operations/updatevendordetails.js +1 -15
- package/dist/commonjs/models/operations/updatevendordetails.js.map +1 -1
- package/dist/commonjs/react-query/companiesListCompanyManagers.core.d.ts +36 -0
- package/dist/commonjs/react-query/companiesListCompanyManagers.core.d.ts.map +1 -0
- package/dist/commonjs/react-query/companiesListCompanyManagers.core.js +93 -0
- package/dist/commonjs/react-query/companiesListCompanyManagers.core.js.map +1 -0
- package/dist/commonjs/react-query/companiesListCompanyManagers.d.ts +54 -0
- package/dist/commonjs/react-query/companiesListCompanyManagers.d.ts.map +1 -0
- package/dist/commonjs/react-query/companiesListCompanyManagers.js +104 -0
- package/dist/commonjs/react-query/companiesListCompanyManagers.js.map +1 -0
- 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/vendorsGetVendorsDetails.d.ts +0 -2
- package/dist/commonjs/react-query/vendorsGetVendorsDetails.d.ts.map +1 -1
- package/dist/commonjs/react-query/vendorsGetVendorsDetails.js +0 -2
- package/dist/commonjs/react-query/vendorsGetVendorsDetails.js.map +1 -1
- package/dist/commonjs/sdk/companies.d.ts +9 -0
- package/dist/commonjs/sdk/companies.d.ts.map +1 -1
- package/dist/commonjs/sdk/companies.js +10 -0
- package/dist/commonjs/sdk/companies.js.map +1 -1
- package/dist/commonjs/sdk/vendors.d.ts +0 -1
- package/dist/commonjs/sdk/vendors.d.ts.map +1 -1
- package/dist/commonjs/sdk/vendors.js +0 -1
- package/dist/commonjs/sdk/vendors.js.map +1 -1
- package/dist/esm/__tests__/companies.test.js +30 -0
- package/dist/esm/__tests__/companies.test.js.map +1 -1
- package/dist/esm/__tests__/zones.test.js +5 -19
- package/dist/esm/__tests__/zones.test.js.map +1 -1
- package/dist/esm/funcs/companiesListCompanyManagers.d.ts +21 -0
- package/dist/esm/funcs/companiesListCompanyManagers.d.ts.map +1 -0
- package/dist/esm/funcs/companiesListCompanyManagers.js +126 -0
- package/dist/esm/funcs/companiesListCompanyManagers.js.map +1 -0
- package/dist/esm/funcs/vendorsGetVendorsDetails.d.ts +0 -1
- package/dist/esm/funcs/vendorsGetVendorsDetails.d.ts.map +1 -1
- package/dist/esm/funcs/vendorsGetVendorsDetails.js +0 -1
- package/dist/esm/funcs/vendorsGetVendorsDetails.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/components/companymanager.d.ts +78 -0
- package/dist/esm/models/components/companymanager.d.ts.map +1 -0
- package/dist/esm/models/components/companymanager.js +127 -0
- package/dist/esm/models/components/companymanager.js.map +1 -0
- package/dist/esm/models/components/expand.d.ts +0 -1
- package/dist/esm/models/components/expand.d.ts.map +1 -1
- package/dist/esm/models/components/expand.js +0 -1
- package/dist/esm/models/components/expand.js.map +1 -1
- package/dist/esm/models/components/index.d.ts +1 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +1 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/vendor.d.ts +0 -7
- package/dist/esm/models/components/vendor.d.ts.map +1 -1
- package/dist/esm/models/components/vendor.js +0 -14
- package/dist/esm/models/components/vendor.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/listcompanymanagers.d.ts +57 -0
- package/dist/esm/models/operations/listcompanymanagers.d.ts.map +1 -0
- package/dist/esm/models/operations/listcompanymanagers.js +43 -0
- package/dist/esm/models/operations/listcompanymanagers.js.map +1 -0
- package/dist/esm/models/operations/updatevendordetails.d.ts +0 -15
- package/dist/esm/models/operations/updatevendordetails.d.ts.map +1 -1
- package/dist/esm/models/operations/updatevendordetails.js +0 -13
- package/dist/esm/models/operations/updatevendordetails.js.map +1 -1
- package/dist/esm/react-query/companiesListCompanyManagers.core.d.ts +36 -0
- package/dist/esm/react-query/companiesListCompanyManagers.core.d.ts.map +1 -0
- package/dist/esm/react-query/companiesListCompanyManagers.core.js +85 -0
- package/dist/esm/react-query/companiesListCompanyManagers.core.js.map +1 -0
- package/dist/esm/react-query/companiesListCompanyManagers.d.ts +54 -0
- package/dist/esm/react-query/companiesListCompanyManagers.d.ts.map +1 -0
- package/dist/esm/react-query/companiesListCompanyManagers.js +89 -0
- package/dist/esm/react-query/companiesListCompanyManagers.js.map +1 -0
- 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/vendorsGetVendorsDetails.d.ts +0 -2
- package/dist/esm/react-query/vendorsGetVendorsDetails.d.ts.map +1 -1
- package/dist/esm/react-query/vendorsGetVendorsDetails.js +0 -2
- package/dist/esm/react-query/vendorsGetVendorsDetails.js.map +1 -1
- package/dist/esm/sdk/companies.d.ts +9 -0
- package/dist/esm/sdk/companies.d.ts.map +1 -1
- package/dist/esm/sdk/companies.js +10 -0
- package/dist/esm/sdk/companies.js.map +1 -1
- package/dist/esm/sdk/vendors.d.ts +0 -1
- package/dist/esm/sdk/vendors.d.ts.map +1 -1
- package/dist/esm/sdk/vendors.js +0 -1
- package/dist/esm/sdk/vendors.js.map +1 -1
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/companies.test.ts +33 -0
- package/src/__tests__/zones.test.ts +5 -19
- package/src/funcs/companiesListCompanyManagers.ts +254 -0
- package/src/funcs/vendorsGetVendorsDetails.ts +0 -1
- package/src/lib/config.ts +2 -2
- package/src/models/components/companymanager.ts +307 -0
- package/src/models/components/expand.ts +0 -1
- package/src/models/components/index.ts +1 -0
- package/src/models/components/vendor.ts +0 -31
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/listcompanymanagers.ts +132 -0
- package/src/models/operations/updatevendordetails.ts +0 -35
- package/src/react-query/companiesListCompanyManagers.core.ts +195 -0
- package/src/react-query/companiesListCompanyManagers.ts +230 -0
- package/src/react-query/index.ts +1 -0
- package/src/react-query/vendorsGetVendorsDetails.ts +0 -2
- package/src/sdk/companies.ts +20 -0
- package/src/sdk/vendors.ts +0 -1
|
@@ -60,10 +60,6 @@ export type One = {
|
|
|
60
60
|
|
|
61
61
|
export type VendorUser = One | number;
|
|
62
62
|
|
|
63
|
-
export type ClientAppConfig = {
|
|
64
|
-
showNewAppVersionDetails?: boolean | null | undefined;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
63
|
export type VendorJob = VendorJobTitle | number;
|
|
68
64
|
|
|
69
65
|
export type VendorVendorType = VendorType | number;
|
|
@@ -136,7 +132,6 @@ export type Vendor = {
|
|
|
136
132
|
user?: One | number | undefined;
|
|
137
133
|
registrationData?: { [k: string]: any } | null | undefined;
|
|
138
134
|
registrationFinished?: boolean | null | undefined;
|
|
139
|
-
clientAppConfig?: ClientAppConfig | null | undefined;
|
|
140
135
|
vendorJob?: VendorJobTitle | number | null | undefined;
|
|
141
136
|
vendorType?: VendorType | number | null | undefined;
|
|
142
137
|
/**
|
|
@@ -269,29 +264,6 @@ export function vendorUserFromJSON(
|
|
|
269
264
|
);
|
|
270
265
|
}
|
|
271
266
|
|
|
272
|
-
/** @internal */
|
|
273
|
-
export const ClientAppConfig$inboundSchema: z.ZodType<
|
|
274
|
-
ClientAppConfig,
|
|
275
|
-
z.ZodTypeDef,
|
|
276
|
-
unknown
|
|
277
|
-
> = z.object({
|
|
278
|
-
show_new_app_version_details: z.nullable(types.boolean()).optional(),
|
|
279
|
-
}).transform((v) => {
|
|
280
|
-
return remap$(v, {
|
|
281
|
-
"show_new_app_version_details": "showNewAppVersionDetails",
|
|
282
|
-
});
|
|
283
|
-
});
|
|
284
|
-
|
|
285
|
-
export function clientAppConfigFromJSON(
|
|
286
|
-
jsonString: string,
|
|
287
|
-
): SafeParseResult<ClientAppConfig, SDKValidationError> {
|
|
288
|
-
return safeParse(
|
|
289
|
-
jsonString,
|
|
290
|
-
(x) => ClientAppConfig$inboundSchema.parse(JSON.parse(x)),
|
|
291
|
-
`Failed to parse 'ClientAppConfig' from JSON`,
|
|
292
|
-
);
|
|
293
|
-
}
|
|
294
|
-
|
|
295
267
|
/** @internal */
|
|
296
268
|
export const VendorJob$inboundSchema: z.ZodType<
|
|
297
269
|
VendorJob,
|
|
@@ -558,8 +530,6 @@ export const Vendor$inboundSchema: z.ZodType<Vendor, z.ZodTypeDef, unknown> = z
|
|
|
558
530
|
),
|
|
559
531
|
registration_data: z.nullable(z.record(z.any())).optional(),
|
|
560
532
|
registration_finished: z.nullable(types.boolean()).optional(),
|
|
561
|
-
client_app_config: z.nullable(z.lazy(() => ClientAppConfig$inboundSchema))
|
|
562
|
-
.optional(),
|
|
563
533
|
vendor_job: z.nullable(
|
|
564
534
|
smartUnion([VendorJobTitle$inboundSchema, types.number()]),
|
|
565
535
|
).optional(),
|
|
@@ -619,7 +589,6 @@ export const Vendor$inboundSchema: z.ZodType<Vendor, z.ZodTypeDef, unknown> = z
|
|
|
619
589
|
"has_emerald_status": "hasEmeraldStatus",
|
|
620
590
|
"registration_data": "registrationData",
|
|
621
591
|
"registration_finished": "registrationFinished",
|
|
622
|
-
"client_app_config": "clientAppConfig",
|
|
623
592
|
"vendor_job": "vendorJob",
|
|
624
593
|
"vendor_type": "vendorType",
|
|
625
594
|
"qr_code": "qrCode",
|
|
@@ -45,6 +45,7 @@ export * from "./getvendorsdetails.js";
|
|
|
45
45
|
export * from "./getwebhookendpoint.js";
|
|
46
46
|
export * from "./listalerts.js";
|
|
47
47
|
export * from "./listallwebhookendpoints.js";
|
|
48
|
+
export * from "./listcompanymanagers.js";
|
|
48
49
|
export * from "./listfeed.js";
|
|
49
50
|
export * from "./listinvoices.js";
|
|
50
51
|
export * from "./listlocations.js";
|
|
@@ -0,0 +1,132 @@
|
|
|
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 { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import * as types from "../../types/primitives.js";
|
|
10
|
+
import * as components from "../components/index.js";
|
|
11
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
12
|
+
|
|
13
|
+
export type ListCompanyManagersRequest = {
|
|
14
|
+
/**
|
|
15
|
+
* The identifier of the object
|
|
16
|
+
*/
|
|
17
|
+
id: number;
|
|
18
|
+
/**
|
|
19
|
+
* A comma-separated list of object attributes to sort on.
|
|
20
|
+
*/
|
|
21
|
+
sort?: string | null | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Sort desc
|
|
24
|
+
*/
|
|
25
|
+
desc?: components.Desc | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* A 1-based offset for which page to request (defaults to 1)
|
|
28
|
+
*/
|
|
29
|
+
page?: number | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Number of items to show in a given page
|
|
32
|
+
*/
|
|
33
|
+
itemsPerPage?: number | undefined;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The request was successful, and the server has returned the requested resource in the response body.
|
|
38
|
+
*/
|
|
39
|
+
export type ListCompanyManagersListCompanyManagersOk = {
|
|
40
|
+
/**
|
|
41
|
+
* Pagination information for a pageable list
|
|
42
|
+
*/
|
|
43
|
+
pager: components.Pager;
|
|
44
|
+
items: Array<components.CompanyManager | null>;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export type ListCompanyManagersResponse = {
|
|
48
|
+
result: ListCompanyManagersListCompanyManagersOk;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/** @internal */
|
|
52
|
+
export type ListCompanyManagersRequest$Outbound = {
|
|
53
|
+
id: number;
|
|
54
|
+
sort?: string | null | undefined;
|
|
55
|
+
desc?: components.Desc$Outbound | undefined;
|
|
56
|
+
page?: number | undefined;
|
|
57
|
+
items_per_page?: number | undefined;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/** @internal */
|
|
61
|
+
export const ListCompanyManagersRequest$outboundSchema: z.ZodType<
|
|
62
|
+
ListCompanyManagersRequest$Outbound,
|
|
63
|
+
z.ZodTypeDef,
|
|
64
|
+
ListCompanyManagersRequest
|
|
65
|
+
> = z.object({
|
|
66
|
+
id: z.number().int(),
|
|
67
|
+
sort: z.nullable(z.string()).optional(),
|
|
68
|
+
desc: components.Desc$outboundSchema.optional(),
|
|
69
|
+
page: z.number().int().optional(),
|
|
70
|
+
itemsPerPage: z.number().int().optional(),
|
|
71
|
+
}).transform((v) => {
|
|
72
|
+
return remap$(v, {
|
|
73
|
+
itemsPerPage: "items_per_page",
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
export function listCompanyManagersRequestToJSON(
|
|
78
|
+
listCompanyManagersRequest: ListCompanyManagersRequest,
|
|
79
|
+
): string {
|
|
80
|
+
return JSON.stringify(
|
|
81
|
+
ListCompanyManagersRequest$outboundSchema.parse(listCompanyManagersRequest),
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** @internal */
|
|
86
|
+
export const ListCompanyManagersListCompanyManagersOk$inboundSchema: z.ZodType<
|
|
87
|
+
ListCompanyManagersListCompanyManagersOk,
|
|
88
|
+
z.ZodTypeDef,
|
|
89
|
+
unknown
|
|
90
|
+
> = z.object({
|
|
91
|
+
pager: components.Pager$inboundSchema,
|
|
92
|
+
items: z.array(types.nullable(components.CompanyManager$inboundSchema)),
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
export function listCompanyManagersListCompanyManagersOkFromJSON(
|
|
96
|
+
jsonString: string,
|
|
97
|
+
): SafeParseResult<
|
|
98
|
+
ListCompanyManagersListCompanyManagersOk,
|
|
99
|
+
SDKValidationError
|
|
100
|
+
> {
|
|
101
|
+
return safeParse(
|
|
102
|
+
jsonString,
|
|
103
|
+
(x) =>
|
|
104
|
+
ListCompanyManagersListCompanyManagersOk$inboundSchema.parse(
|
|
105
|
+
JSON.parse(x),
|
|
106
|
+
),
|
|
107
|
+
`Failed to parse 'ListCompanyManagersListCompanyManagersOk' from JSON`,
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** @internal */
|
|
112
|
+
export const ListCompanyManagersResponse$inboundSchema: z.ZodType<
|
|
113
|
+
ListCompanyManagersResponse,
|
|
114
|
+
z.ZodTypeDef,
|
|
115
|
+
unknown
|
|
116
|
+
> = z.object({
|
|
117
|
+
Result: z.lazy(() => ListCompanyManagersListCompanyManagersOk$inboundSchema),
|
|
118
|
+
}).transform((v) => {
|
|
119
|
+
return remap$(v, {
|
|
120
|
+
"Result": "result",
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
export function listCompanyManagersResponseFromJSON(
|
|
125
|
+
jsonString: string,
|
|
126
|
+
): SafeParseResult<ListCompanyManagersResponse, SDKValidationError> {
|
|
127
|
+
return safeParse(
|
|
128
|
+
jsonString,
|
|
129
|
+
(x) => ListCompanyManagersResponse$inboundSchema.parse(JSON.parse(x)),
|
|
130
|
+
`Failed to parse 'ListCompanyManagersResponse' from JSON`,
|
|
131
|
+
);
|
|
132
|
+
}
|
|
@@ -21,13 +21,6 @@ export const EmailRecepient = {
|
|
|
21
21
|
*/
|
|
22
22
|
export type EmailRecepient = ClosedEnum<typeof EmailRecepient>;
|
|
23
23
|
|
|
24
|
-
export type ClientAppConfig = {
|
|
25
|
-
/**
|
|
26
|
-
* The vendor's show_new_app_version_details value to update
|
|
27
|
-
*/
|
|
28
|
-
showNewAppVersionDetails?: boolean | undefined;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
24
|
export type UpdateVendorDetailsRequestBody = {
|
|
32
25
|
/**
|
|
33
26
|
* The QR code value
|
|
@@ -37,7 +30,6 @@ export type UpdateVendorDetailsRequestBody = {
|
|
|
37
30
|
* The vendor's email_recepient value to update
|
|
38
31
|
*/
|
|
39
32
|
emailRecepient?: EmailRecepient | undefined;
|
|
40
|
-
clientAppConfig?: ClientAppConfig | undefined;
|
|
41
33
|
/**
|
|
42
34
|
* The vendor's send_weekly_summary_email value to update
|
|
43
35
|
*/
|
|
@@ -73,35 +65,10 @@ export const EmailRecepient$outboundSchema: z.ZodNativeEnum<
|
|
|
73
65
|
typeof EmailRecepient
|
|
74
66
|
> = z.nativeEnum(EmailRecepient);
|
|
75
67
|
|
|
76
|
-
/** @internal */
|
|
77
|
-
export type ClientAppConfig$Outbound = {
|
|
78
|
-
show_new_app_version_details?: boolean | undefined;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
/** @internal */
|
|
82
|
-
export const ClientAppConfig$outboundSchema: z.ZodType<
|
|
83
|
-
ClientAppConfig$Outbound,
|
|
84
|
-
z.ZodTypeDef,
|
|
85
|
-
ClientAppConfig
|
|
86
|
-
> = z.object({
|
|
87
|
-
showNewAppVersionDetails: z.boolean().optional(),
|
|
88
|
-
}).transform((v) => {
|
|
89
|
-
return remap$(v, {
|
|
90
|
-
showNewAppVersionDetails: "show_new_app_version_details",
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
export function clientAppConfigToJSON(
|
|
95
|
-
clientAppConfig: ClientAppConfig,
|
|
96
|
-
): string {
|
|
97
|
-
return JSON.stringify(ClientAppConfig$outboundSchema.parse(clientAppConfig));
|
|
98
|
-
}
|
|
99
|
-
|
|
100
68
|
/** @internal */
|
|
101
69
|
export type UpdateVendorDetailsRequestBody$Outbound = {
|
|
102
70
|
qr_code?: string | undefined;
|
|
103
71
|
email_recepient?: string | undefined;
|
|
104
|
-
client_app_config?: ClientAppConfig$Outbound | undefined;
|
|
105
72
|
send_weekly_summary_email?: boolean | undefined;
|
|
106
73
|
title?: string | undefined;
|
|
107
74
|
location?: components.UserLocation$Outbound | null | undefined;
|
|
@@ -117,7 +84,6 @@ export const UpdateVendorDetailsRequestBody$outboundSchema: z.ZodType<
|
|
|
117
84
|
> = z.object({
|
|
118
85
|
qrCode: z.string().optional(),
|
|
119
86
|
emailRecepient: EmailRecepient$outboundSchema.optional(),
|
|
120
|
-
clientAppConfig: z.lazy(() => ClientAppConfig$outboundSchema).optional(),
|
|
121
87
|
sendWeeklySummaryEmail: z.boolean().optional(),
|
|
122
88
|
title: z.string().optional(),
|
|
123
89
|
location: z.nullable(components.UserLocation$outboundSchema).optional(),
|
|
@@ -127,7 +93,6 @@ export const UpdateVendorDetailsRequestBody$outboundSchema: z.ZodType<
|
|
|
127
93
|
return remap$(v, {
|
|
128
94
|
qrCode: "qr_code",
|
|
129
95
|
emailRecepient: "email_recepient",
|
|
130
|
-
clientAppConfig: "client_app_config",
|
|
131
96
|
sendWeeklySummaryEmail: "send_weekly_summary_email",
|
|
132
97
|
primaryDepartmentId: "primary_department_id",
|
|
133
98
|
});
|
|
@@ -0,0 +1,195 @@
|
|
|
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 { companiesListCompanyManagers } from "../funcs/companiesListCompanyManagers.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 CompaniesListCompanyManagersQueryData =
|
|
20
|
+
operations.ListCompanyManagersResponse;
|
|
21
|
+
|
|
22
|
+
export type CompaniesListCompanyManagersInfiniteQueryData = PageIterator<
|
|
23
|
+
operations.ListCompanyManagersResponse,
|
|
24
|
+
{ page: number }
|
|
25
|
+
>;
|
|
26
|
+
|
|
27
|
+
export type CompaniesListCompanyManagersPageParams = PageIterator<
|
|
28
|
+
operations.ListCompanyManagersResponse,
|
|
29
|
+
{ page: number }
|
|
30
|
+
>["~next"];
|
|
31
|
+
|
|
32
|
+
export function prefetchCompaniesListCompanyManagers(
|
|
33
|
+
queryClient: QueryClient,
|
|
34
|
+
client$: GreenSecurityCore,
|
|
35
|
+
request: operations.ListCompanyManagersRequest,
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): Promise<void> {
|
|
38
|
+
return queryClient.prefetchQuery({
|
|
39
|
+
...buildCompaniesListCompanyManagersQuery(
|
|
40
|
+
client$,
|
|
41
|
+
request,
|
|
42
|
+
options,
|
|
43
|
+
),
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function prefetchCompaniesListCompanyManagersInfinite(
|
|
48
|
+
queryClient: QueryClient,
|
|
49
|
+
client$: GreenSecurityCore,
|
|
50
|
+
request: operations.ListCompanyManagersRequest,
|
|
51
|
+
options?: RequestOptions,
|
|
52
|
+
): Promise<void> {
|
|
53
|
+
return queryClient.prefetchInfiniteQuery({
|
|
54
|
+
...buildCompaniesListCompanyManagersInfiniteQuery(
|
|
55
|
+
client$,
|
|
56
|
+
request,
|
|
57
|
+
options,
|
|
58
|
+
),
|
|
59
|
+
initialPageParam: undefined as CompaniesListCompanyManagersPageParams,
|
|
60
|
+
getNextPageParam: (
|
|
61
|
+
previousPage: CompaniesListCompanyManagersInfiniteQueryData,
|
|
62
|
+
) => previousPage["~next"],
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function buildCompaniesListCompanyManagersQuery(
|
|
67
|
+
client$: GreenSecurityCore,
|
|
68
|
+
request: operations.ListCompanyManagersRequest,
|
|
69
|
+
options?: RequestOptions,
|
|
70
|
+
): {
|
|
71
|
+
queryKey: QueryKey;
|
|
72
|
+
queryFn: (
|
|
73
|
+
context: QueryFunctionContext,
|
|
74
|
+
) => Promise<CompaniesListCompanyManagersQueryData>;
|
|
75
|
+
} {
|
|
76
|
+
return {
|
|
77
|
+
queryKey: queryKeyCompaniesListCompanyManagers(request.id, {
|
|
78
|
+
sort: request.sort,
|
|
79
|
+
desc: request.desc,
|
|
80
|
+
page: request.page,
|
|
81
|
+
itemsPerPage: request.itemsPerPage,
|
|
82
|
+
}),
|
|
83
|
+
queryFn: async function companiesListCompanyManagersQueryFn(
|
|
84
|
+
ctx,
|
|
85
|
+
): Promise<CompaniesListCompanyManagersQueryData> {
|
|
86
|
+
const sig = combineSignals(
|
|
87
|
+
ctx.signal,
|
|
88
|
+
options?.signal,
|
|
89
|
+
options?.fetchOptions?.signal,
|
|
90
|
+
);
|
|
91
|
+
const mergedOptions = {
|
|
92
|
+
...options?.fetchOptions,
|
|
93
|
+
...options,
|
|
94
|
+
signal: sig,
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
return unwrapAsync(companiesListCompanyManagers(
|
|
98
|
+
client$,
|
|
99
|
+
request,
|
|
100
|
+
mergedOptions,
|
|
101
|
+
));
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export function buildCompaniesListCompanyManagersInfiniteQuery(
|
|
107
|
+
client$: GreenSecurityCore,
|
|
108
|
+
request: operations.ListCompanyManagersRequest,
|
|
109
|
+
options?: RequestOptions,
|
|
110
|
+
): {
|
|
111
|
+
queryKey: QueryKey;
|
|
112
|
+
queryFn: (
|
|
113
|
+
context: QueryFunctionContext<
|
|
114
|
+
QueryKey,
|
|
115
|
+
CompaniesListCompanyManagersPageParams
|
|
116
|
+
>,
|
|
117
|
+
) => Promise<CompaniesListCompanyManagersInfiniteQueryData>;
|
|
118
|
+
} {
|
|
119
|
+
return {
|
|
120
|
+
queryKey: queryKeyCompaniesListCompanyManagersInfinite(request.id, {
|
|
121
|
+
sort: request.sort,
|
|
122
|
+
desc: request.desc,
|
|
123
|
+
page: request.page,
|
|
124
|
+
itemsPerPage: request.itemsPerPage,
|
|
125
|
+
}),
|
|
126
|
+
queryFn: async function companiesListCompanyManagersQuery(
|
|
127
|
+
ctx,
|
|
128
|
+
): Promise<CompaniesListCompanyManagersInfiniteQueryData> {
|
|
129
|
+
const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
|
|
130
|
+
const mergedOptions = {
|
|
131
|
+
...options,
|
|
132
|
+
fetchOptions: { ...options?.fetchOptions, signal: sig },
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
if (!ctx.pageParam) {
|
|
136
|
+
const pageResult = await unwrapResultIterator(
|
|
137
|
+
companiesListCompanyManagers(
|
|
138
|
+
client$,
|
|
139
|
+
request,
|
|
140
|
+
mergedOptions,
|
|
141
|
+
),
|
|
142
|
+
);
|
|
143
|
+
return pageIteratorToJSON(pageResult);
|
|
144
|
+
}
|
|
145
|
+
const pageResult = await unwrapResultIterator(
|
|
146
|
+
companiesListCompanyManagers(
|
|
147
|
+
client$,
|
|
148
|
+
{
|
|
149
|
+
...request,
|
|
150
|
+
page: ctx.pageParam.page,
|
|
151
|
+
},
|
|
152
|
+
mergedOptions,
|
|
153
|
+
),
|
|
154
|
+
);
|
|
155
|
+
return pageIteratorToJSON(pageResult);
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export function queryKeyCompaniesListCompanyManagers(
|
|
161
|
+
id: number,
|
|
162
|
+
parameters: {
|
|
163
|
+
sort?: string | null | undefined;
|
|
164
|
+
desc?: components.Desc | undefined;
|
|
165
|
+
page?: number | undefined;
|
|
166
|
+
itemsPerPage?: number | undefined;
|
|
167
|
+
},
|
|
168
|
+
): QueryKey {
|
|
169
|
+
return [
|
|
170
|
+
"@greensecurity/javascript-sdk",
|
|
171
|
+
"companies",
|
|
172
|
+
"listCompanyManagers",
|
|
173
|
+
id,
|
|
174
|
+
parameters,
|
|
175
|
+
];
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export function queryKeyCompaniesListCompanyManagersInfinite(
|
|
179
|
+
id: number,
|
|
180
|
+
parameters: {
|
|
181
|
+
sort?: string | null | undefined;
|
|
182
|
+
desc?: components.Desc | undefined;
|
|
183
|
+
page?: number | undefined;
|
|
184
|
+
itemsPerPage?: number | undefined;
|
|
185
|
+
},
|
|
186
|
+
): QueryKey {
|
|
187
|
+
return [
|
|
188
|
+
"@greensecurity/javascript-sdk",
|
|
189
|
+
"companies",
|
|
190
|
+
"listCompanyManagers",
|
|
191
|
+
"infinite",
|
|
192
|
+
id,
|
|
193
|
+
parameters,
|
|
194
|
+
];
|
|
195
|
+
}
|
|
@@ -0,0 +1,230 @@
|
|
|
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 * as operations from "../models/operations/index.js";
|
|
21
|
+
import { useGreenSecurityContext } from "./_context.js";
|
|
22
|
+
import {
|
|
23
|
+
InfiniteQueryHookOptions,
|
|
24
|
+
QueryHookOptions,
|
|
25
|
+
SuspenseInfiniteQueryHookOptions,
|
|
26
|
+
SuspenseQueryHookOptions,
|
|
27
|
+
TupleToPrefixes,
|
|
28
|
+
} from "./_types.js";
|
|
29
|
+
import {
|
|
30
|
+
buildCompaniesListCompanyManagersInfiniteQuery,
|
|
31
|
+
buildCompaniesListCompanyManagersQuery,
|
|
32
|
+
CompaniesListCompanyManagersInfiniteQueryData,
|
|
33
|
+
CompaniesListCompanyManagersPageParams,
|
|
34
|
+
CompaniesListCompanyManagersQueryData,
|
|
35
|
+
prefetchCompaniesListCompanyManagers,
|
|
36
|
+
prefetchCompaniesListCompanyManagersInfinite,
|
|
37
|
+
queryKeyCompaniesListCompanyManagers,
|
|
38
|
+
queryKeyCompaniesListCompanyManagersInfinite,
|
|
39
|
+
} from "./companiesListCompanyManagers.core.js";
|
|
40
|
+
export {
|
|
41
|
+
buildCompaniesListCompanyManagersInfiniteQuery,
|
|
42
|
+
buildCompaniesListCompanyManagersQuery,
|
|
43
|
+
type CompaniesListCompanyManagersInfiniteQueryData,
|
|
44
|
+
type CompaniesListCompanyManagersPageParams,
|
|
45
|
+
type CompaniesListCompanyManagersQueryData,
|
|
46
|
+
prefetchCompaniesListCompanyManagers,
|
|
47
|
+
prefetchCompaniesListCompanyManagersInfinite,
|
|
48
|
+
queryKeyCompaniesListCompanyManagers,
|
|
49
|
+
queryKeyCompaniesListCompanyManagersInfinite,
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* List or search company managers
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* List or search company managers.
|
|
57
|
+
*/
|
|
58
|
+
export function useCompaniesListCompanyManagers(
|
|
59
|
+
request: operations.ListCompanyManagersRequest,
|
|
60
|
+
options?: QueryHookOptions<CompaniesListCompanyManagersQueryData>,
|
|
61
|
+
): UseQueryResult<CompaniesListCompanyManagersQueryData, Error> {
|
|
62
|
+
const client = useGreenSecurityContext();
|
|
63
|
+
return useQuery({
|
|
64
|
+
...buildCompaniesListCompanyManagersQuery(
|
|
65
|
+
client,
|
|
66
|
+
request,
|
|
67
|
+
options,
|
|
68
|
+
),
|
|
69
|
+
...options,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* List or search company managers
|
|
75
|
+
*
|
|
76
|
+
* @remarks
|
|
77
|
+
* List or search company managers.
|
|
78
|
+
*/
|
|
79
|
+
export function useCompaniesListCompanyManagersSuspense(
|
|
80
|
+
request: operations.ListCompanyManagersRequest,
|
|
81
|
+
options?: SuspenseQueryHookOptions<CompaniesListCompanyManagersQueryData>,
|
|
82
|
+
): UseSuspenseQueryResult<CompaniesListCompanyManagersQueryData, Error> {
|
|
83
|
+
const client = useGreenSecurityContext();
|
|
84
|
+
return useSuspenseQuery({
|
|
85
|
+
...buildCompaniesListCompanyManagersQuery(
|
|
86
|
+
client,
|
|
87
|
+
request,
|
|
88
|
+
options,
|
|
89
|
+
),
|
|
90
|
+
...options,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* List or search company managers
|
|
96
|
+
*
|
|
97
|
+
* @remarks
|
|
98
|
+
* List or search company managers.
|
|
99
|
+
*/
|
|
100
|
+
export function useCompaniesListCompanyManagersInfinite(
|
|
101
|
+
request: operations.ListCompanyManagersRequest,
|
|
102
|
+
options?: InfiniteQueryHookOptions<
|
|
103
|
+
CompaniesListCompanyManagersInfiniteQueryData
|
|
104
|
+
>,
|
|
105
|
+
): UseInfiniteQueryResult<
|
|
106
|
+
InfiniteData<
|
|
107
|
+
CompaniesListCompanyManagersInfiniteQueryData,
|
|
108
|
+
CompaniesListCompanyManagersPageParams
|
|
109
|
+
>,
|
|
110
|
+
Error
|
|
111
|
+
> {
|
|
112
|
+
const client = useGreenSecurityContext();
|
|
113
|
+
return useInfiniteQuery<
|
|
114
|
+
CompaniesListCompanyManagersInfiniteQueryData,
|
|
115
|
+
Error,
|
|
116
|
+
InfiniteData<
|
|
117
|
+
CompaniesListCompanyManagersInfiniteQueryData,
|
|
118
|
+
CompaniesListCompanyManagersPageParams
|
|
119
|
+
>,
|
|
120
|
+
QueryKey,
|
|
121
|
+
CompaniesListCompanyManagersPageParams
|
|
122
|
+
>({
|
|
123
|
+
...buildCompaniesListCompanyManagersInfiniteQuery(
|
|
124
|
+
client,
|
|
125
|
+
request,
|
|
126
|
+
options,
|
|
127
|
+
),
|
|
128
|
+
initialPageParam: options?.initialPageParam,
|
|
129
|
+
getNextPageParam: (previousPage) => previousPage["~next"],
|
|
130
|
+
...options,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* List or search company managers
|
|
136
|
+
*
|
|
137
|
+
* @remarks
|
|
138
|
+
* List or search company managers.
|
|
139
|
+
*/
|
|
140
|
+
export function useCompaniesListCompanyManagersInfiniteSuspense(
|
|
141
|
+
request: operations.ListCompanyManagersRequest,
|
|
142
|
+
options?: SuspenseInfiniteQueryHookOptions<
|
|
143
|
+
CompaniesListCompanyManagersInfiniteQueryData
|
|
144
|
+
>,
|
|
145
|
+
): UseSuspenseInfiniteQueryResult<
|
|
146
|
+
InfiniteData<
|
|
147
|
+
CompaniesListCompanyManagersInfiniteQueryData,
|
|
148
|
+
CompaniesListCompanyManagersPageParams
|
|
149
|
+
>,
|
|
150
|
+
Error
|
|
151
|
+
> {
|
|
152
|
+
const client = useGreenSecurityContext();
|
|
153
|
+
return useSuspenseInfiniteQuery<
|
|
154
|
+
CompaniesListCompanyManagersInfiniteQueryData,
|
|
155
|
+
Error,
|
|
156
|
+
InfiniteData<
|
|
157
|
+
CompaniesListCompanyManagersInfiniteQueryData,
|
|
158
|
+
CompaniesListCompanyManagersPageParams
|
|
159
|
+
>,
|
|
160
|
+
QueryKey,
|
|
161
|
+
CompaniesListCompanyManagersPageParams
|
|
162
|
+
>({
|
|
163
|
+
...buildCompaniesListCompanyManagersInfiniteQuery(
|
|
164
|
+
client,
|
|
165
|
+
request,
|
|
166
|
+
options,
|
|
167
|
+
),
|
|
168
|
+
initialPageParam: options?.initialPageParam,
|
|
169
|
+
getNextPageParam: (previousPage) => previousPage["~next"],
|
|
170
|
+
...options,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export function setCompaniesListCompanyManagersData(
|
|
175
|
+
client: QueryClient,
|
|
176
|
+
queryKeyBase: [
|
|
177
|
+
id: number,
|
|
178
|
+
parameters: {
|
|
179
|
+
sort?: string | null | undefined;
|
|
180
|
+
desc?: components.Desc | undefined;
|
|
181
|
+
page?: number | undefined;
|
|
182
|
+
itemsPerPage?: number | undefined;
|
|
183
|
+
},
|
|
184
|
+
],
|
|
185
|
+
data: CompaniesListCompanyManagersQueryData,
|
|
186
|
+
): CompaniesListCompanyManagersQueryData | undefined {
|
|
187
|
+
const key = queryKeyCompaniesListCompanyManagers(...queryKeyBase);
|
|
188
|
+
|
|
189
|
+
return client.setQueryData<CompaniesListCompanyManagersQueryData>(key, data);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export function invalidateCompaniesListCompanyManagers(
|
|
193
|
+
client: QueryClient,
|
|
194
|
+
queryKeyBase: TupleToPrefixes<
|
|
195
|
+
[
|
|
196
|
+
id: number,
|
|
197
|
+
parameters: {
|
|
198
|
+
sort?: string | null | undefined;
|
|
199
|
+
desc?: components.Desc | undefined;
|
|
200
|
+
page?: number | undefined;
|
|
201
|
+
itemsPerPage?: number | undefined;
|
|
202
|
+
},
|
|
203
|
+
]
|
|
204
|
+
>,
|
|
205
|
+
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
206
|
+
): Promise<void> {
|
|
207
|
+
return client.invalidateQueries({
|
|
208
|
+
...filters,
|
|
209
|
+
queryKey: [
|
|
210
|
+
"@greensecurity/javascript-sdk",
|
|
211
|
+
"companies",
|
|
212
|
+
"listCompanyManagers",
|
|
213
|
+
...queryKeyBase,
|
|
214
|
+
],
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export function invalidateAllCompaniesListCompanyManagers(
|
|
219
|
+
client: QueryClient,
|
|
220
|
+
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
221
|
+
): Promise<void> {
|
|
222
|
+
return client.invalidateQueries({
|
|
223
|
+
...filters,
|
|
224
|
+
queryKey: [
|
|
225
|
+
"@greensecurity/javascript-sdk",
|
|
226
|
+
"companies",
|
|
227
|
+
"listCompanyManagers",
|
|
228
|
+
],
|
|
229
|
+
});
|
|
230
|
+
}
|
package/src/react-query/index.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from "./_types.js";
|
|
|
8
8
|
export * from "./alertsListAlerts.js";
|
|
9
9
|
export * from "./alertsUpdateUserAlerts.js";
|
|
10
10
|
export * from "./companiesGetCompany.js";
|
|
11
|
+
export * from "./companiesListCompanyManagers.js";
|
|
11
12
|
export * from "./companiesListOrSearchCompanies.js";
|
|
12
13
|
export * from "./dataRequestsAddDataRequestFile.js";
|
|
13
14
|
export * from "./dataRequestsDeleteDataRequestFile.js";
|