@greensecurity/javascript-sdk 0.43.1-beta.52 → 0.43.1-beta.56
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 +9 -3
- package/dist/commonjs/__tests__/companies.test.js +21 -0
- package/dist/commonjs/__tests__/companies.test.js.map +1 -1
- package/dist/commonjs/__tests__/vendors.test.js +32 -0
- package/dist/commonjs/__tests__/vendors.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 +1 -1
- package/dist/commonjs/funcs/companiesGetCompany.d.ts +24 -0
- package/dist/commonjs/funcs/companiesGetCompany.d.ts.map +1 -0
- package/dist/commonjs/funcs/companiesGetCompany.js +132 -0
- package/dist/commonjs/funcs/companiesGetCompany.js.map +1 -0
- package/dist/commonjs/funcs/vendorsChangeSubscription.d.ts +4 -1
- package/dist/commonjs/funcs/vendorsChangeSubscription.d.ts.map +1 -1
- package/dist/commonjs/funcs/vendorsChangeSubscription.js +4 -1
- package/dist/commonjs/funcs/vendorsChangeSubscription.js.map +1 -1
- package/dist/commonjs/funcs/vendorsListVendorAdditionalFacilityFields.d.ts +3 -1
- package/dist/commonjs/funcs/vendorsListVendorAdditionalFacilityFields.d.ts.map +1 -1
- package/dist/commonjs/funcs/vendorsListVendorAdditionalFacilityFields.js +3 -1
- package/dist/commonjs/funcs/vendorsListVendorAdditionalFacilityFields.js.map +1 -1
- package/dist/commonjs/funcs/vendorsListVendorCustomFields.d.ts +21 -0
- package/dist/commonjs/funcs/vendorsListVendorCustomFields.d.ts.map +1 -0
- package/dist/commonjs/funcs/vendorsListVendorCustomFields.js +162 -0
- package/dist/commonjs/funcs/vendorsListVendorCustomFields.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/components/index.d.ts +1 -1
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +1 -1
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/invoice.d.ts +0 -1
- package/dist/commonjs/models/components/invoice.d.ts.map +1 -1
- package/dist/commonjs/models/components/invoice.js +0 -1
- package/dist/commonjs/models/components/invoice.js.map +1 -1
- package/dist/commonjs/models/components/invoiceitem.d.ts +1 -0
- package/dist/commonjs/models/components/invoiceitem.d.ts.map +1 -1
- package/dist/commonjs/models/components/invoiceitem.js +1 -0
- package/dist/commonjs/models/components/invoiceitem.js.map +1 -1
- package/dist/commonjs/models/components/vendorcustomfields.d.ts +14 -0
- package/dist/commonjs/models/components/vendorcustomfields.d.ts.map +1 -0
- package/dist/commonjs/models/components/{vendoradditionalfacilityfields.js → vendorcustomfields.js} +6 -6
- package/dist/commonjs/models/components/vendorcustomfields.js.map +1 -0
- package/dist/commonjs/models/operations/getcompany.d.ts +21 -0
- package/dist/commonjs/models/operations/getcompany.d.ts.map +1 -0
- package/dist/commonjs/models/operations/getcompany.js +51 -0
- package/dist/commonjs/models/operations/getcompany.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +2 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +2 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/listvendoradditionalfacilityfields.d.ts +1 -1
- package/dist/commonjs/models/operations/listvendoradditionalfacilityfields.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listvendoradditionalfacilityfields.js +1 -1
- package/dist/commonjs/models/operations/listvendoradditionalfacilityfields.js.map +1 -1
- package/dist/commonjs/models/operations/listvendorcustomfields.d.ts +57 -0
- package/dist/commonjs/models/operations/listvendorcustomfields.d.ts.map +1 -0
- package/dist/commonjs/models/operations/listvendorcustomfields.js +82 -0
- package/dist/commonjs/models/operations/listvendorcustomfields.js.map +1 -0
- package/dist/commonjs/react-query/companiesGetCompany.core.d.ts +15 -0
- package/dist/commonjs/react-query/companiesGetCompany.core.d.ts.map +1 -0
- package/dist/commonjs/react-query/companiesGetCompany.core.js +42 -0
- package/dist/commonjs/react-query/companiesGetCompany.core.js.map +1 -0
- package/dist/commonjs/react-query/companiesGetCompany.d.ts +44 -0
- package/dist/commonjs/react-query/companiesGetCompany.d.ts.map +1 -0
- package/dist/commonjs/react-query/companiesGetCompany.js +75 -0
- package/dist/commonjs/react-query/companiesGetCompany.js.map +1 -0
- package/dist/commonjs/react-query/index.d.ts +2 -0
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +2 -0
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/react-query/vendorsChangeSubscription.d.ts +4 -1
- package/dist/commonjs/react-query/vendorsChangeSubscription.d.ts.map +1 -1
- package/dist/commonjs/react-query/vendorsChangeSubscription.js +4 -1
- package/dist/commonjs/react-query/vendorsChangeSubscription.js.map +1 -1
- package/dist/commonjs/react-query/vendorsListVendorAdditionalFacilityFields.d.ts +12 -4
- package/dist/commonjs/react-query/vendorsListVendorAdditionalFacilityFields.d.ts.map +1 -1
- package/dist/commonjs/react-query/vendorsListVendorAdditionalFacilityFields.js +12 -4
- package/dist/commonjs/react-query/vendorsListVendorAdditionalFacilityFields.js.map +1 -1
- package/dist/commonjs/react-query/vendorsListVendorCustomFields.core.d.ts +36 -0
- package/dist/commonjs/react-query/vendorsListVendorCustomFields.core.d.ts.map +1 -0
- package/dist/commonjs/react-query/vendorsListVendorCustomFields.core.js +93 -0
- package/dist/commonjs/react-query/vendorsListVendorCustomFields.core.js.map +1 -0
- package/dist/commonjs/react-query/vendorsListVendorCustomFields.d.ts +54 -0
- package/dist/commonjs/react-query/vendorsListVendorCustomFields.d.ts.map +1 -0
- package/dist/commonjs/react-query/vendorsListVendorCustomFields.js +104 -0
- package/dist/commonjs/react-query/vendorsListVendorCustomFields.js.map +1 -0
- package/dist/commonjs/sdk/companies.d.ts +13 -0
- package/dist/commonjs/sdk/companies.d.ts.map +1 -1
- package/dist/commonjs/sdk/companies.js +16 -0
- package/dist/commonjs/sdk/companies.js.map +1 -1
- package/dist/commonjs/sdk/vendors.d.ts +16 -2
- package/dist/commonjs/sdk/vendors.d.ts.map +1 -1
- package/dist/commonjs/sdk/vendors.js +17 -2
- package/dist/commonjs/sdk/vendors.js.map +1 -1
- package/dist/esm/__tests__/companies.test.js +21 -0
- package/dist/esm/__tests__/companies.test.js.map +1 -1
- package/dist/esm/__tests__/vendors.test.js +32 -0
- package/dist/esm/__tests__/vendors.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 +1 -1
- package/dist/esm/funcs/companiesGetCompany.d.ts +24 -0
- package/dist/esm/funcs/companiesGetCompany.d.ts.map +1 -0
- package/dist/esm/funcs/companiesGetCompany.js +96 -0
- package/dist/esm/funcs/companiesGetCompany.js.map +1 -0
- package/dist/esm/funcs/vendorsChangeSubscription.d.ts +4 -1
- package/dist/esm/funcs/vendorsChangeSubscription.d.ts.map +1 -1
- package/dist/esm/funcs/vendorsChangeSubscription.js +4 -1
- package/dist/esm/funcs/vendorsChangeSubscription.js.map +1 -1
- package/dist/esm/funcs/vendorsListVendorAdditionalFacilityFields.d.ts +3 -1
- package/dist/esm/funcs/vendorsListVendorAdditionalFacilityFields.d.ts.map +1 -1
- package/dist/esm/funcs/vendorsListVendorAdditionalFacilityFields.js +3 -1
- package/dist/esm/funcs/vendorsListVendorAdditionalFacilityFields.js.map +1 -1
- package/dist/esm/funcs/vendorsListVendorCustomFields.d.ts +21 -0
- package/dist/esm/funcs/vendorsListVendorCustomFields.d.ts.map +1 -0
- package/dist/esm/funcs/vendorsListVendorCustomFields.js +126 -0
- package/dist/esm/funcs/vendorsListVendorCustomFields.js.map +1 -0
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/components/index.d.ts +1 -1
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +1 -1
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/invoice.d.ts +0 -1
- package/dist/esm/models/components/invoice.d.ts.map +1 -1
- package/dist/esm/models/components/invoice.js +0 -1
- package/dist/esm/models/components/invoice.js.map +1 -1
- package/dist/esm/models/components/invoiceitem.d.ts +1 -0
- package/dist/esm/models/components/invoiceitem.d.ts.map +1 -1
- package/dist/esm/models/components/invoiceitem.js +1 -0
- package/dist/esm/models/components/invoiceitem.js.map +1 -1
- package/dist/esm/models/components/vendorcustomfields.d.ts +14 -0
- package/dist/esm/models/components/vendorcustomfields.d.ts.map +1 -0
- package/dist/esm/models/components/{vendoradditionalfacilityfields.js → vendorcustomfields.js} +4 -4
- package/dist/esm/models/components/vendorcustomfields.js.map +1 -0
- package/dist/esm/models/operations/getcompany.d.ts +21 -0
- package/dist/esm/models/operations/getcompany.d.ts.map +1 -0
- package/dist/esm/models/operations/getcompany.js +14 -0
- package/dist/esm/models/operations/getcompany.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +2 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +2 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/listvendoradditionalfacilityfields.d.ts +1 -1
- package/dist/esm/models/operations/listvendoradditionalfacilityfields.d.ts.map +1 -1
- package/dist/esm/models/operations/listvendoradditionalfacilityfields.js +1 -1
- package/dist/esm/models/operations/listvendoradditionalfacilityfields.js.map +1 -1
- package/dist/esm/models/operations/listvendorcustomfields.d.ts +57 -0
- package/dist/esm/models/operations/listvendorcustomfields.d.ts.map +1 -0
- package/dist/esm/models/operations/listvendorcustomfields.js +43 -0
- package/dist/esm/models/operations/listvendorcustomfields.js.map +1 -0
- package/dist/esm/react-query/companiesGetCompany.core.d.ts +15 -0
- package/dist/esm/react-query/companiesGetCompany.core.d.ts.map +1 -0
- package/dist/esm/react-query/companiesGetCompany.core.js +37 -0
- package/dist/esm/react-query/companiesGetCompany.core.js.map +1 -0
- package/dist/esm/react-query/companiesGetCompany.d.ts +44 -0
- package/dist/esm/react-query/companiesGetCompany.d.ts.map +1 -0
- package/dist/esm/react-query/companiesGetCompany.js +65 -0
- package/dist/esm/react-query/companiesGetCompany.js.map +1 -0
- package/dist/esm/react-query/index.d.ts +2 -0
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +2 -0
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/react-query/vendorsChangeSubscription.d.ts +4 -1
- package/dist/esm/react-query/vendorsChangeSubscription.d.ts.map +1 -1
- package/dist/esm/react-query/vendorsChangeSubscription.js +4 -1
- package/dist/esm/react-query/vendorsChangeSubscription.js.map +1 -1
- package/dist/esm/react-query/vendorsListVendorAdditionalFacilityFields.d.ts +12 -4
- package/dist/esm/react-query/vendorsListVendorAdditionalFacilityFields.d.ts.map +1 -1
- package/dist/esm/react-query/vendorsListVendorAdditionalFacilityFields.js +12 -4
- package/dist/esm/react-query/vendorsListVendorAdditionalFacilityFields.js.map +1 -1
- package/dist/esm/react-query/vendorsListVendorCustomFields.core.d.ts +36 -0
- package/dist/esm/react-query/vendorsListVendorCustomFields.core.d.ts.map +1 -0
- package/dist/esm/react-query/vendorsListVendorCustomFields.core.js +85 -0
- package/dist/esm/react-query/vendorsListVendorCustomFields.core.js.map +1 -0
- package/dist/esm/react-query/vendorsListVendorCustomFields.d.ts +54 -0
- package/dist/esm/react-query/vendorsListVendorCustomFields.d.ts.map +1 -0
- package/dist/esm/react-query/vendorsListVendorCustomFields.js +89 -0
- package/dist/esm/react-query/vendorsListVendorCustomFields.js.map +1 -0
- package/dist/esm/sdk/companies.d.ts +13 -0
- package/dist/esm/sdk/companies.d.ts.map +1 -1
- package/dist/esm/sdk/companies.js +16 -0
- package/dist/esm/sdk/companies.js.map +1 -1
- package/dist/esm/sdk/vendors.d.ts +16 -2
- package/dist/esm/sdk/vendors.d.ts.map +1 -1
- package/dist/esm/sdk/vendors.js +17 -2
- 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 +24 -0
- package/src/__tests__/vendors.test.ts +35 -0
- package/src/__tests__/webhooks.test.ts +1 -1
- package/src/__tests__/zones.test.ts +1 -1
- package/src/funcs/companiesGetCompany.ts +185 -0
- package/src/funcs/vendorsChangeSubscription.ts +4 -1
- package/src/funcs/vendorsListVendorAdditionalFacilityFields.ts +3 -1
- package/src/funcs/vendorsListVendorCustomFields.ts +256 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/index.ts +1 -1
- package/src/models/components/invoice.ts +0 -2
- package/src/models/components/invoiceitem.ts +2 -0
- package/src/models/components/{vendoradditionalfacilityfields.ts → vendorcustomfields.ts} +7 -7
- package/src/models/operations/getcompany.ts +41 -0
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/listvendoradditionalfacilityfields.ts +2 -2
- package/src/models/operations/listvendorcustomfields.ts +137 -0
- package/src/react-query/companiesGetCompany.core.ts +82 -0
- package/src/react-query/companiesGetCompany.ts +125 -0
- package/src/react-query/index.ts +2 -0
- package/src/react-query/vendorsChangeSubscription.ts +4 -1
- package/src/react-query/vendorsListVendorAdditionalFacilityFields.ts +12 -4
- package/src/react-query/vendorsListVendorCustomFields.core.ts +198 -0
- package/src/react-query/vendorsListVendorCustomFields.ts +230 -0
- package/src/sdk/companies.ts +25 -0
- package/src/sdk/vendors.ts +27 -2
- package/dist/commonjs/models/components/vendoradditionalfacilityfields.d.ts +0 -14
- package/dist/commonjs/models/components/vendoradditionalfacilityfields.d.ts.map +0 -1
- package/dist/commonjs/models/components/vendoradditionalfacilityfields.js.map +0 -1
- package/dist/esm/models/components/vendoradditionalfacilityfields.d.ts +0 -14
- package/dist/esm/models/components/vendoradditionalfacilityfields.d.ts.map +0 -1
- package/dist/esm/models/components/vendoradditionalfacilityfields.js.map +0 -1
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { GreenSecurityCore } from "../core.js";
|
|
6
|
+
import { dlv } from "../lib/dlv.js";
|
|
7
|
+
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import { GreenSecurityError } from "../models/errors/greensecurityerror.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/httpclienterrors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
import {
|
|
29
|
+
createPageIterator,
|
|
30
|
+
haltIterator,
|
|
31
|
+
PageIterator,
|
|
32
|
+
Paginator,
|
|
33
|
+
} from "../types/operations.js";
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* List of vendor custom fields
|
|
37
|
+
*
|
|
38
|
+
* @remarks
|
|
39
|
+
* List of vendor custom fields
|
|
40
|
+
*/
|
|
41
|
+
export function vendorsListVendorCustomFields(
|
|
42
|
+
client: GreenSecurityCore,
|
|
43
|
+
request: operations.ListVendorCustomFieldsRequest,
|
|
44
|
+
options?: RequestOptions,
|
|
45
|
+
): APIPromise<
|
|
46
|
+
PageIterator<
|
|
47
|
+
Result<
|
|
48
|
+
operations.ListVendorCustomFieldsResponse,
|
|
49
|
+
| errors.ApiErrorResponse
|
|
50
|
+
| GreenSecurityError
|
|
51
|
+
| ResponseValidationError
|
|
52
|
+
| ConnectionError
|
|
53
|
+
| RequestAbortedError
|
|
54
|
+
| RequestTimeoutError
|
|
55
|
+
| InvalidRequestError
|
|
56
|
+
| UnexpectedClientError
|
|
57
|
+
| SDKValidationError
|
|
58
|
+
>,
|
|
59
|
+
{ page: number }
|
|
60
|
+
>
|
|
61
|
+
> {
|
|
62
|
+
return new APIPromise($do(
|
|
63
|
+
client,
|
|
64
|
+
request,
|
|
65
|
+
options,
|
|
66
|
+
));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async function $do(
|
|
70
|
+
client: GreenSecurityCore,
|
|
71
|
+
request: operations.ListVendorCustomFieldsRequest,
|
|
72
|
+
options?: RequestOptions,
|
|
73
|
+
): Promise<
|
|
74
|
+
[
|
|
75
|
+
PageIterator<
|
|
76
|
+
Result<
|
|
77
|
+
operations.ListVendorCustomFieldsResponse,
|
|
78
|
+
| errors.ApiErrorResponse
|
|
79
|
+
| GreenSecurityError
|
|
80
|
+
| ResponseValidationError
|
|
81
|
+
| ConnectionError
|
|
82
|
+
| RequestAbortedError
|
|
83
|
+
| RequestTimeoutError
|
|
84
|
+
| InvalidRequestError
|
|
85
|
+
| UnexpectedClientError
|
|
86
|
+
| SDKValidationError
|
|
87
|
+
>,
|
|
88
|
+
{ page: number }
|
|
89
|
+
>,
|
|
90
|
+
APICall,
|
|
91
|
+
]
|
|
92
|
+
> {
|
|
93
|
+
const parsed = safeParse(
|
|
94
|
+
request,
|
|
95
|
+
(value) =>
|
|
96
|
+
operations.ListVendorCustomFieldsRequest$outboundSchema.parse(value),
|
|
97
|
+
"Input validation failed",
|
|
98
|
+
);
|
|
99
|
+
if (!parsed.ok) {
|
|
100
|
+
return [haltIterator(parsed), { status: "invalid" }];
|
|
101
|
+
}
|
|
102
|
+
const payload = parsed.value;
|
|
103
|
+
const body = null;
|
|
104
|
+
|
|
105
|
+
const pathParams = {
|
|
106
|
+
vendor_id_or_me: encodeSimple("vendor_id_or_me", payload.vendor_id_or_me, {
|
|
107
|
+
explode: false,
|
|
108
|
+
charEncoding: "percent",
|
|
109
|
+
}),
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const path = pathToFunc("/vendors/{vendor_id_or_me}/custom-fields")(
|
|
113
|
+
pathParams,
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
const query = encodeFormQuery({
|
|
117
|
+
"desc": payload.desc,
|
|
118
|
+
"items_per_page": payload.items_per_page,
|
|
119
|
+
"page": payload.page,
|
|
120
|
+
"sort": payload.sort,
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
const headers = new Headers(compactMap({
|
|
124
|
+
Accept: "application/json",
|
|
125
|
+
}));
|
|
126
|
+
|
|
127
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
128
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
129
|
+
|
|
130
|
+
const context = {
|
|
131
|
+
options: client._options,
|
|
132
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
133
|
+
operationID: "listVendorCustomFields",
|
|
134
|
+
oAuth2Scopes: null,
|
|
135
|
+
|
|
136
|
+
resolvedSecurity: requestSecurity,
|
|
137
|
+
|
|
138
|
+
securitySource: client._options.security,
|
|
139
|
+
retryConfig: options?.retries
|
|
140
|
+
|| client._options.retryConfig
|
|
141
|
+
|| { strategy: "none" },
|
|
142
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
const requestRes = client._createRequest(context, {
|
|
146
|
+
security: requestSecurity,
|
|
147
|
+
method: "GET",
|
|
148
|
+
baseURL: options?.serverURL,
|
|
149
|
+
path: path,
|
|
150
|
+
headers: headers,
|
|
151
|
+
query: query,
|
|
152
|
+
body: body,
|
|
153
|
+
userAgent: client._options.userAgent,
|
|
154
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
155
|
+
}, options);
|
|
156
|
+
if (!requestRes.ok) {
|
|
157
|
+
return [haltIterator(requestRes), { status: "invalid" }];
|
|
158
|
+
}
|
|
159
|
+
const req = requestRes.value;
|
|
160
|
+
|
|
161
|
+
const doResult = await client._do(req, {
|
|
162
|
+
context,
|
|
163
|
+
errorCodes: ["400", "401", "403", "404", "4XX", "500", "5XX"],
|
|
164
|
+
retryConfig: context.retryConfig,
|
|
165
|
+
retryCodes: context.retryCodes,
|
|
166
|
+
});
|
|
167
|
+
if (!doResult.ok) {
|
|
168
|
+
return [haltIterator(doResult), { status: "request-error", request: req }];
|
|
169
|
+
}
|
|
170
|
+
const response = doResult.value;
|
|
171
|
+
|
|
172
|
+
const responseFields = {
|
|
173
|
+
HttpMeta: { Response: response, Request: req },
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
const [result, raw] = await M.match<
|
|
177
|
+
operations.ListVendorCustomFieldsResponse,
|
|
178
|
+
| errors.ApiErrorResponse
|
|
179
|
+
| GreenSecurityError
|
|
180
|
+
| ResponseValidationError
|
|
181
|
+
| ConnectionError
|
|
182
|
+
| RequestAbortedError
|
|
183
|
+
| RequestTimeoutError
|
|
184
|
+
| InvalidRequestError
|
|
185
|
+
| UnexpectedClientError
|
|
186
|
+
| SDKValidationError
|
|
187
|
+
>(
|
|
188
|
+
M.json(200, operations.ListVendorCustomFieldsResponse$inboundSchema, {
|
|
189
|
+
key: "Result",
|
|
190
|
+
}),
|
|
191
|
+
M.jsonErr([400, 401, 403, 404], errors.ApiErrorResponse$inboundSchema),
|
|
192
|
+
M.fail("4XX"),
|
|
193
|
+
M.fail([500, "5XX"]),
|
|
194
|
+
)(response, req, { extraFields: responseFields });
|
|
195
|
+
if (!result.ok) {
|
|
196
|
+
return [haltIterator(result), {
|
|
197
|
+
status: "complete",
|
|
198
|
+
request: req,
|
|
199
|
+
response,
|
|
200
|
+
}];
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
const nextFunc = (
|
|
204
|
+
responseData: unknown,
|
|
205
|
+
): {
|
|
206
|
+
next: Paginator<
|
|
207
|
+
Result<
|
|
208
|
+
operations.ListVendorCustomFieldsResponse,
|
|
209
|
+
| errors.ApiErrorResponse
|
|
210
|
+
| GreenSecurityError
|
|
211
|
+
| ResponseValidationError
|
|
212
|
+
| ConnectionError
|
|
213
|
+
| RequestAbortedError
|
|
214
|
+
| RequestTimeoutError
|
|
215
|
+
| InvalidRequestError
|
|
216
|
+
| UnexpectedClientError
|
|
217
|
+
| SDKValidationError
|
|
218
|
+
>
|
|
219
|
+
>;
|
|
220
|
+
"~next"?: { page: number };
|
|
221
|
+
} => {
|
|
222
|
+
const page = request?.page ?? 1;
|
|
223
|
+
const nextPage = page + 1;
|
|
224
|
+
|
|
225
|
+
if (!responseData) {
|
|
226
|
+
return { next: () => null };
|
|
227
|
+
}
|
|
228
|
+
const results = dlv(responseData, "items");
|
|
229
|
+
if (!Array.isArray(results) || !results.length) {
|
|
230
|
+
return { next: () => null };
|
|
231
|
+
}
|
|
232
|
+
const limit = request?.itemsPerPage ?? 0;
|
|
233
|
+
if (results.length < limit) {
|
|
234
|
+
return { next: () => null };
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
const nextVal = () =>
|
|
238
|
+
vendorsListVendorCustomFields(
|
|
239
|
+
client,
|
|
240
|
+
{
|
|
241
|
+
...request,
|
|
242
|
+
page: nextPage,
|
|
243
|
+
},
|
|
244
|
+
options,
|
|
245
|
+
);
|
|
246
|
+
|
|
247
|
+
return { next: nextVal, "~next": { page: nextPage } };
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
const page = { ...result, ...nextFunc(raw) };
|
|
251
|
+
return [{ ...page, ...createPageIterator(page, (v) => !v.ok) }, {
|
|
252
|
+
status: "complete",
|
|
253
|
+
request: req,
|
|
254
|
+
response,
|
|
255
|
+
}];
|
|
256
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -80,8 +80,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
80
80
|
export const SDK_METADATA = {
|
|
81
81
|
language: "typescript",
|
|
82
82
|
openapiDocVersion: "0.0.11",
|
|
83
|
-
sdkVersion: "0.43.1-beta.
|
|
83
|
+
sdkVersion: "0.43.1-beta.54",
|
|
84
84
|
genVersion: "2.794.1",
|
|
85
85
|
userAgent:
|
|
86
|
-
"speakeasy-sdk/typescript 0.43.1-beta.
|
|
86
|
+
"speakeasy-sdk/typescript 0.43.1-beta.54 2.794.1 0.0.11 @greensecurity/javascript-sdk",
|
|
87
87
|
} as const;
|
|
@@ -63,11 +63,11 @@ export * from "./user.js";
|
|
|
63
63
|
export * from "./userlocation.js";
|
|
64
64
|
export * from "./usersummary.js";
|
|
65
65
|
export * from "./vendor.js";
|
|
66
|
-
export * from "./vendoradditionalfacilityfields.js";
|
|
67
66
|
export * from "./vendorcredentialdatarequest.js";
|
|
68
67
|
export * from "./vendorcredentialfile.js";
|
|
69
68
|
export * from "./vendorcredentialscontainer.js";
|
|
70
69
|
export * from "./vendorcredentialsummary.js";
|
|
70
|
+
export * from "./vendorcustomfields.js";
|
|
71
71
|
export * from "./vendorfacilitystatusview.js";
|
|
72
72
|
export * from "./vendorgroup.js";
|
|
73
73
|
export * from "./vendorjobtitle.js";
|
|
@@ -30,7 +30,6 @@ export type Invoice = {
|
|
|
30
30
|
tax?: number | null | undefined;
|
|
31
31
|
convenienceFee?: number | null | undefined;
|
|
32
32
|
shipping?: number | null | undefined;
|
|
33
|
-
discount?: number | undefined;
|
|
34
33
|
lines?: Array<InvoiceItem | null> | null | undefined;
|
|
35
34
|
transactions?: Array<InvoiceTransaction> | null | undefined;
|
|
36
35
|
representative?: string | null | undefined;
|
|
@@ -51,7 +50,6 @@ export const Invoice$inboundSchema: z.ZodType<Invoice, z.ZodTypeDef, unknown> =
|
|
|
51
50
|
tax: z.nullable(types.number()).optional(),
|
|
52
51
|
convenience_fee: z.nullable(types.number()).optional(),
|
|
53
52
|
shipping: z.nullable(types.number()).optional(),
|
|
54
|
-
discount: types.optional(types.number()),
|
|
55
53
|
lines: z.nullable(z.array(types.nullable(InvoiceItem$inboundSchema)))
|
|
56
54
|
.optional(),
|
|
57
55
|
transactions: z.nullable(z.array(InvoiceTransaction$inboundSchema))
|
|
@@ -38,6 +38,7 @@ export type InvoiceItem = {
|
|
|
38
38
|
title?: string | null | undefined;
|
|
39
39
|
quantity?: number | null | undefined;
|
|
40
40
|
unitPrice?: number | null | undefined;
|
|
41
|
+
discount?: number | undefined;
|
|
41
42
|
subtotal?: number | null | undefined;
|
|
42
43
|
variant?: ProductVariant | number | null | undefined;
|
|
43
44
|
product?: Product | number | null | undefined;
|
|
@@ -114,6 +115,7 @@ export const InvoiceItem$inboundSchema: z.ZodType<
|
|
|
114
115
|
title: z.nullable(types.string()).optional(),
|
|
115
116
|
quantity: z.nullable(types.number()).optional(),
|
|
116
117
|
unit_price: z.nullable(types.number()).optional(),
|
|
118
|
+
discount: types.optional(types.number()),
|
|
117
119
|
subtotal: z.nullable(types.number()).optional(),
|
|
118
120
|
variant: z.nullable(
|
|
119
121
|
smartUnion([ProductVariant$inboundSchema, types.number()]),
|
|
@@ -8,7 +8,7 @@ import { Result as SafeParseResult } from "../../types/fp.js";
|
|
|
8
8
|
import * as types from "../../types/primitives.js";
|
|
9
9
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
10
|
|
|
11
|
-
export type
|
|
11
|
+
export type VendorCustomFields = {
|
|
12
12
|
id?: number | undefined;
|
|
13
13
|
system?: string | null | undefined;
|
|
14
14
|
facility?: string | null | undefined;
|
|
@@ -17,8 +17,8 @@ export type VendorAdditionalFacilityFields = {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
/** @internal */
|
|
20
|
-
export const
|
|
21
|
-
|
|
20
|
+
export const VendorCustomFields$inboundSchema: z.ZodType<
|
|
21
|
+
VendorCustomFields,
|
|
22
22
|
z.ZodTypeDef,
|
|
23
23
|
unknown
|
|
24
24
|
> = z.object({
|
|
@@ -29,12 +29,12 @@ export const VendorAdditionalFacilityFields$inboundSchema: z.ZodType<
|
|
|
29
29
|
value: z.nullable(types.string()).optional(),
|
|
30
30
|
});
|
|
31
31
|
|
|
32
|
-
export function
|
|
32
|
+
export function vendorCustomFieldsFromJSON(
|
|
33
33
|
jsonString: string,
|
|
34
|
-
): SafeParseResult<
|
|
34
|
+
): SafeParseResult<VendorCustomFields, SDKValidationError> {
|
|
35
35
|
return safeParse(
|
|
36
36
|
jsonString,
|
|
37
|
-
(x) =>
|
|
38
|
-
`Failed to parse '
|
|
37
|
+
(x) => VendorCustomFields$inboundSchema.parse(JSON.parse(x)),
|
|
38
|
+
`Failed to parse 'VendorCustomFields' from JSON`,
|
|
39
39
|
);
|
|
40
40
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import * as components from "../components/index.js";
|
|
7
|
+
|
|
8
|
+
export type GetCompanyRequest = {
|
|
9
|
+
/**
|
|
10
|
+
* The identifier of the object
|
|
11
|
+
*/
|
|
12
|
+
id: number;
|
|
13
|
+
/**
|
|
14
|
+
* An array-style parameter to identify which sections of an object to expand. See documentation for the endpoint for a list of valid expansion values.
|
|
15
|
+
*/
|
|
16
|
+
expand?: Array<components.Expand> | undefined;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export type GetCompanyRequest$Outbound = {
|
|
21
|
+
id: number;
|
|
22
|
+
expand?: Array<string> | undefined;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** @internal */
|
|
26
|
+
export const GetCompanyRequest$outboundSchema: z.ZodType<
|
|
27
|
+
GetCompanyRequest$Outbound,
|
|
28
|
+
z.ZodTypeDef,
|
|
29
|
+
GetCompanyRequest
|
|
30
|
+
> = z.object({
|
|
31
|
+
id: z.number().int(),
|
|
32
|
+
expand: z.array(components.Expand$outboundSchema).optional(),
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export function getCompanyRequestToJSON(
|
|
36
|
+
getCompanyRequest: GetCompanyRequest,
|
|
37
|
+
): string {
|
|
38
|
+
return JSON.stringify(
|
|
39
|
+
GetCompanyRequest$outboundSchema.parse(getCompanyRequest),
|
|
40
|
+
);
|
|
41
|
+
}
|
|
@@ -26,6 +26,7 @@ export * from "./deletefhirconfigbyid.js";
|
|
|
26
26
|
export * from "./deletevendorcredentialfile.js";
|
|
27
27
|
export * from "./deletevendormanagedbycompany.js";
|
|
28
28
|
export * from "./expeditetimeremaining.js";
|
|
29
|
+
export * from "./getcompany.js";
|
|
29
30
|
export * from "./getfacility.js";
|
|
30
31
|
export * from "./getfhirconfig.js";
|
|
31
32
|
export * from "./getnextscreeningquestion.js";
|
|
@@ -63,6 +64,7 @@ export * from "./listvendorcredentialfiles.js";
|
|
|
63
64
|
export * from "./listvendorcredentialhistory.js";
|
|
64
65
|
export * from "./listvendorcredentials.js";
|
|
65
66
|
export * from "./listvendorcredits.js";
|
|
67
|
+
export * from "./listvendorcustomfields.js";
|
|
66
68
|
export * from "./listvendorfacilitystatuses.js";
|
|
67
69
|
export * from "./listvendorinvoices.js";
|
|
68
70
|
export * from "./listvendorjobtitles.js";
|
|
@@ -37,7 +37,7 @@ export type ListVendorAdditionalFacilityFieldsRequest = {
|
|
|
37
37
|
*/
|
|
38
38
|
export type ListVendorAdditionalFacilityFieldsListVendorAdditionalFacilityFieldsOk =
|
|
39
39
|
{
|
|
40
|
-
items: Array<components.
|
|
40
|
+
items: Array<components.VendorCustomFields>;
|
|
41
41
|
/**
|
|
42
42
|
* Pagination information for a pageable list
|
|
43
43
|
*/
|
|
@@ -95,7 +95,7 @@ export const ListVendorAdditionalFacilityFieldsListVendorAdditionalFacilityField
|
|
|
95
95
|
z.ZodTypeDef,
|
|
96
96
|
unknown
|
|
97
97
|
> = z.object({
|
|
98
|
-
items: z.array(components.
|
|
98
|
+
items: z.array(components.VendorCustomFields$inboundSchema),
|
|
99
99
|
pager: components.Pager$inboundSchema,
|
|
100
100
|
});
|
|
101
101
|
|
|
@@ -0,0 +1,137 @@
|
|
|
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 components from "../components/index.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
export type ListVendorCustomFieldsRequest = {
|
|
13
|
+
/**
|
|
14
|
+
* A comma-separated list of object attributes to sort on.
|
|
15
|
+
*/
|
|
16
|
+
sort?: string | null | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Sort desc
|
|
19
|
+
*/
|
|
20
|
+
desc?: components.Desc | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* A 1-based offset for which page to request (defaults to 1)
|
|
23
|
+
*/
|
|
24
|
+
page?: number | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Number of items to show in a given page
|
|
27
|
+
*/
|
|
28
|
+
itemsPerPage?: number | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Either the ID of the vendor rep or the keyword "me" to represent the current vendor.
|
|
31
|
+
*/
|
|
32
|
+
vendorIdOrMe: string;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The request was successful, and the server has returned the requested resource in the response body.
|
|
37
|
+
*/
|
|
38
|
+
export type ListVendorCustomFieldsListVendorCustomFieldsOk = {
|
|
39
|
+
items: Array<components.VendorCustomFields>;
|
|
40
|
+
/**
|
|
41
|
+
* Pagination information for a pageable list
|
|
42
|
+
*/
|
|
43
|
+
pager: components.Pager;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export type ListVendorCustomFieldsResponse = {
|
|
47
|
+
result: ListVendorCustomFieldsListVendorCustomFieldsOk;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/** @internal */
|
|
51
|
+
export type ListVendorCustomFieldsRequest$Outbound = {
|
|
52
|
+
sort?: string | null | undefined;
|
|
53
|
+
desc?: components.Desc$Outbound | undefined;
|
|
54
|
+
page?: number | undefined;
|
|
55
|
+
items_per_page?: number | undefined;
|
|
56
|
+
vendor_id_or_me: string;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/** @internal */
|
|
60
|
+
export const ListVendorCustomFieldsRequest$outboundSchema: z.ZodType<
|
|
61
|
+
ListVendorCustomFieldsRequest$Outbound,
|
|
62
|
+
z.ZodTypeDef,
|
|
63
|
+
ListVendorCustomFieldsRequest
|
|
64
|
+
> = z.object({
|
|
65
|
+
sort: z.nullable(z.string()).optional(),
|
|
66
|
+
desc: components.Desc$outboundSchema.optional(),
|
|
67
|
+
page: z.number().int().optional(),
|
|
68
|
+
itemsPerPage: z.number().int().optional(),
|
|
69
|
+
vendorIdOrMe: z.string(),
|
|
70
|
+
}).transform((v) => {
|
|
71
|
+
return remap$(v, {
|
|
72
|
+
itemsPerPage: "items_per_page",
|
|
73
|
+
vendorIdOrMe: "vendor_id_or_me",
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
export function listVendorCustomFieldsRequestToJSON(
|
|
78
|
+
listVendorCustomFieldsRequest: ListVendorCustomFieldsRequest,
|
|
79
|
+
): string {
|
|
80
|
+
return JSON.stringify(
|
|
81
|
+
ListVendorCustomFieldsRequest$outboundSchema.parse(
|
|
82
|
+
listVendorCustomFieldsRequest,
|
|
83
|
+
),
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** @internal */
|
|
88
|
+
export const ListVendorCustomFieldsListVendorCustomFieldsOk$inboundSchema:
|
|
89
|
+
z.ZodType<
|
|
90
|
+
ListVendorCustomFieldsListVendorCustomFieldsOk,
|
|
91
|
+
z.ZodTypeDef,
|
|
92
|
+
unknown
|
|
93
|
+
> = z.object({
|
|
94
|
+
items: z.array(components.VendorCustomFields$inboundSchema),
|
|
95
|
+
pager: components.Pager$inboundSchema,
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
export function listVendorCustomFieldsListVendorCustomFieldsOkFromJSON(
|
|
99
|
+
jsonString: string,
|
|
100
|
+
): SafeParseResult<
|
|
101
|
+
ListVendorCustomFieldsListVendorCustomFieldsOk,
|
|
102
|
+
SDKValidationError
|
|
103
|
+
> {
|
|
104
|
+
return safeParse(
|
|
105
|
+
jsonString,
|
|
106
|
+
(x) =>
|
|
107
|
+
ListVendorCustomFieldsListVendorCustomFieldsOk$inboundSchema.parse(
|
|
108
|
+
JSON.parse(x),
|
|
109
|
+
),
|
|
110
|
+
`Failed to parse 'ListVendorCustomFieldsListVendorCustomFieldsOk' from JSON`,
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** @internal */
|
|
115
|
+
export const ListVendorCustomFieldsResponse$inboundSchema: z.ZodType<
|
|
116
|
+
ListVendorCustomFieldsResponse,
|
|
117
|
+
z.ZodTypeDef,
|
|
118
|
+
unknown
|
|
119
|
+
> = z.object({
|
|
120
|
+
Result: z.lazy(() =>
|
|
121
|
+
ListVendorCustomFieldsListVendorCustomFieldsOk$inboundSchema
|
|
122
|
+
),
|
|
123
|
+
}).transform((v) => {
|
|
124
|
+
return remap$(v, {
|
|
125
|
+
"Result": "result",
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
export function listVendorCustomFieldsResponseFromJSON(
|
|
130
|
+
jsonString: string,
|
|
131
|
+
): SafeParseResult<ListVendorCustomFieldsResponse, SDKValidationError> {
|
|
132
|
+
return safeParse(
|
|
133
|
+
jsonString,
|
|
134
|
+
(x) => ListVendorCustomFieldsResponse$inboundSchema.parse(JSON.parse(x)),
|
|
135
|
+
`Failed to parse 'ListVendorCustomFieldsResponse' from JSON`,
|
|
136
|
+
);
|
|
137
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
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 { companiesGetCompany } from "../funcs/companiesGetCompany.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
|
+
export type CompaniesGetCompanyQueryData = components.Company;
|
|
18
|
+
|
|
19
|
+
export function prefetchCompaniesGetCompany(
|
|
20
|
+
queryClient: QueryClient,
|
|
21
|
+
client$: GreenSecurityCore,
|
|
22
|
+
request: operations.GetCompanyRequest,
|
|
23
|
+
options?: RequestOptions,
|
|
24
|
+
): Promise<void> {
|
|
25
|
+
return queryClient.prefetchQuery({
|
|
26
|
+
...buildCompaniesGetCompanyQuery(
|
|
27
|
+
client$,
|
|
28
|
+
request,
|
|
29
|
+
options,
|
|
30
|
+
),
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function buildCompaniesGetCompanyQuery(
|
|
35
|
+
client$: GreenSecurityCore,
|
|
36
|
+
request: operations.GetCompanyRequest,
|
|
37
|
+
options?: RequestOptions,
|
|
38
|
+
): {
|
|
39
|
+
queryKey: QueryKey;
|
|
40
|
+
queryFn: (
|
|
41
|
+
context: QueryFunctionContext,
|
|
42
|
+
) => Promise<CompaniesGetCompanyQueryData>;
|
|
43
|
+
} {
|
|
44
|
+
return {
|
|
45
|
+
queryKey: queryKeyCompaniesGetCompany(request.id, {
|
|
46
|
+
expand: request.expand,
|
|
47
|
+
}),
|
|
48
|
+
queryFn: async function companiesGetCompanyQueryFn(
|
|
49
|
+
ctx,
|
|
50
|
+
): Promise<CompaniesGetCompanyQueryData> {
|
|
51
|
+
const sig = combineSignals(
|
|
52
|
+
ctx.signal,
|
|
53
|
+
options?.signal,
|
|
54
|
+
options?.fetchOptions?.signal,
|
|
55
|
+
);
|
|
56
|
+
const mergedOptions = {
|
|
57
|
+
...options?.fetchOptions,
|
|
58
|
+
...options,
|
|
59
|
+
signal: sig,
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
return unwrapAsync(companiesGetCompany(
|
|
63
|
+
client$,
|
|
64
|
+
request,
|
|
65
|
+
mergedOptions,
|
|
66
|
+
));
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function queryKeyCompaniesGetCompany(
|
|
72
|
+
id: number,
|
|
73
|
+
parameters: { expand?: Array<components.Expand> | undefined },
|
|
74
|
+
): QueryKey {
|
|
75
|
+
return [
|
|
76
|
+
"@greensecurity/javascript-sdk",
|
|
77
|
+
"companies",
|
|
78
|
+
"getCompany",
|
|
79
|
+
id,
|
|
80
|
+
parameters,
|
|
81
|
+
];
|
|
82
|
+
}
|