@greensecurity/javascript-sdk 0.44.0-beta.29 → 0.44.0-beta.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/REACT_QUERY.md +15 -31
- package/README.md +6 -0
- package/dist/commonjs/__tests__/vendors.test.js +31 -0
- package/dist/commonjs/__tests__/vendors.test.js.map +1 -1
- package/dist/commonjs/__tests__/zones.test.js +32 -3
- package/dist/commonjs/__tests__/zones.test.js.map +1 -1
- package/dist/commonjs/funcs/vendorsGetVendorPaymentResponsibility.d.ts +23 -0
- package/dist/commonjs/funcs/vendorsGetVendorPaymentResponsibility.d.ts.map +1 -0
- package/dist/commonjs/funcs/vendorsGetVendorPaymentResponsibility.js +129 -0
- package/dist/commonjs/funcs/vendorsGetVendorPaymentResponsibility.js.map +1 -0
- package/dist/commonjs/funcs/vendorsUpdateVendorDetails.d.ts +1 -1
- package/dist/commonjs/funcs/vendorsUpdateVendorDetails.js +1 -1
- package/dist/commonjs/funcs/vendorsUpdateVendorPaymentResponsibility.d.ts +24 -0
- package/dist/commonjs/funcs/vendorsUpdateVendorPaymentResponsibility.d.ts.map +1 -0
- package/dist/commonjs/funcs/vendorsUpdateVendorPaymentResponsibility.js +131 -0
- package/dist/commonjs/funcs/vendorsUpdateVendorPaymentResponsibility.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- 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/vendorpaymentresponsibilityassignments.d.ts +70 -0
- package/dist/commonjs/models/components/vendorpaymentresponsibilityassignments.d.ts.map +1 -0
- package/dist/commonjs/models/components/vendorpaymentresponsibilityassignments.js +71 -0
- package/dist/commonjs/models/components/vendorpaymentresponsibilityassignments.js.map +1 -0
- package/dist/commonjs/models/operations/getvendorpaymentresponsibility.d.ts +34 -0
- package/dist/commonjs/models/operations/getvendorpaymentresponsibility.d.ts.map +1 -0
- package/dist/commonjs/models/operations/getvendorpaymentresponsibility.js +70 -0
- package/dist/commonjs/models/operations/getvendorpaymentresponsibility.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/updatevendordetails.d.ts +10 -0
- package/dist/commonjs/models/operations/updatevendordetails.d.ts.map +1 -1
- package/dist/commonjs/models/operations/updatevendordetails.js +4 -0
- package/dist/commonjs/models/operations/updatevendordetails.js.map +1 -1
- package/dist/commonjs/models/operations/updatevendorpaymentresponsibility.d.ts +74 -0
- package/dist/commonjs/models/operations/updatevendorpaymentresponsibility.d.ts.map +1 -0
- package/dist/commonjs/models/operations/updatevendorpaymentresponsibility.js +94 -0
- package/dist/commonjs/models/operations/updatevendorpaymentresponsibility.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/vendorsGetVendorPaymentResponsibility.core.d.ts +12 -0
- package/dist/commonjs/react-query/vendorsGetVendorPaymentResponsibility.core.d.ts.map +1 -0
- package/dist/commonjs/react-query/vendorsGetVendorPaymentResponsibility.core.js +39 -0
- package/dist/commonjs/react-query/vendorsGetVendorPaymentResponsibility.core.js.map +1 -0
- package/dist/commonjs/react-query/vendorsGetVendorPaymentResponsibility.d.ts +35 -0
- package/dist/commonjs/react-query/vendorsGetVendorPaymentResponsibility.d.ts.map +1 -0
- package/dist/commonjs/react-query/vendorsGetVendorPaymentResponsibility.js +75 -0
- package/dist/commonjs/react-query/vendorsGetVendorPaymentResponsibility.js.map +1 -0
- package/dist/commonjs/react-query/vendorsUpdateVendorDetails.d.ts +1 -1
- package/dist/commonjs/react-query/vendorsUpdateVendorDetails.js +1 -1
- package/dist/commonjs/react-query/vendorsUpdateVendorPaymentResponsibility.d.ts +33 -0
- package/dist/commonjs/react-query/vendorsUpdateVendorPaymentResponsibility.d.ts.map +1 -0
- package/dist/commonjs/react-query/vendorsUpdateVendorPaymentResponsibility.js +55 -0
- package/dist/commonjs/react-query/vendorsUpdateVendorPaymentResponsibility.js.map +1 -0
- package/dist/commonjs/sdk/vendors.d.ts +22 -1
- package/dist/commonjs/sdk/vendors.d.ts.map +1 -1
- package/dist/commonjs/sdk/vendors.js +28 -1
- package/dist/commonjs/sdk/vendors.js.map +1 -1
- package/dist/esm/__tests__/vendors.test.js +31 -0
- package/dist/esm/__tests__/vendors.test.js.map +1 -1
- package/dist/esm/__tests__/zones.test.js +32 -3
- package/dist/esm/__tests__/zones.test.js.map +1 -1
- package/dist/esm/funcs/vendorsGetVendorPaymentResponsibility.d.ts +23 -0
- package/dist/esm/funcs/vendorsGetVendorPaymentResponsibility.d.ts.map +1 -0
- package/dist/esm/funcs/vendorsGetVendorPaymentResponsibility.js +93 -0
- package/dist/esm/funcs/vendorsGetVendorPaymentResponsibility.js.map +1 -0
- package/dist/esm/funcs/vendorsUpdateVendorDetails.d.ts +1 -1
- package/dist/esm/funcs/vendorsUpdateVendorDetails.js +1 -1
- package/dist/esm/funcs/vendorsUpdateVendorPaymentResponsibility.d.ts +24 -0
- package/dist/esm/funcs/vendorsUpdateVendorPaymentResponsibility.d.ts.map +1 -0
- package/dist/esm/funcs/vendorsUpdateVendorPaymentResponsibility.js +95 -0
- package/dist/esm/funcs/vendorsUpdateVendorPaymentResponsibility.js.map +1 -0
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- 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/vendorpaymentresponsibilityassignments.d.ts +70 -0
- package/dist/esm/models/components/vendorpaymentresponsibilityassignments.d.ts.map +1 -0
- package/dist/esm/models/components/vendorpaymentresponsibilityassignments.js +34 -0
- package/dist/esm/models/components/vendorpaymentresponsibilityassignments.js.map +1 -0
- package/dist/esm/models/operations/getvendorpaymentresponsibility.d.ts +34 -0
- package/dist/esm/models/operations/getvendorpaymentresponsibility.d.ts.map +1 -0
- package/dist/esm/models/operations/getvendorpaymentresponsibility.js +32 -0
- package/dist/esm/models/operations/getvendorpaymentresponsibility.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/updatevendordetails.d.ts +10 -0
- package/dist/esm/models/operations/updatevendordetails.d.ts.map +1 -1
- package/dist/esm/models/operations/updatevendordetails.js +4 -0
- package/dist/esm/models/operations/updatevendordetails.js.map +1 -1
- package/dist/esm/models/operations/updatevendorpaymentresponsibility.d.ts +74 -0
- package/dist/esm/models/operations/updatevendorpaymentresponsibility.d.ts.map +1 -0
- package/dist/esm/models/operations/updatevendorpaymentresponsibility.js +55 -0
- package/dist/esm/models/operations/updatevendorpaymentresponsibility.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/vendorsGetVendorPaymentResponsibility.core.d.ts +12 -0
- package/dist/esm/react-query/vendorsGetVendorPaymentResponsibility.core.d.ts.map +1 -0
- package/dist/esm/react-query/vendorsGetVendorPaymentResponsibility.core.js +34 -0
- package/dist/esm/react-query/vendorsGetVendorPaymentResponsibility.core.js.map +1 -0
- package/dist/esm/react-query/vendorsGetVendorPaymentResponsibility.d.ts +35 -0
- package/dist/esm/react-query/vendorsGetVendorPaymentResponsibility.d.ts.map +1 -0
- package/dist/esm/react-query/vendorsGetVendorPaymentResponsibility.js +65 -0
- package/dist/esm/react-query/vendorsGetVendorPaymentResponsibility.js.map +1 -0
- package/dist/esm/react-query/vendorsUpdateVendorDetails.d.ts +1 -1
- package/dist/esm/react-query/vendorsUpdateVendorDetails.js +1 -1
- package/dist/esm/react-query/vendorsUpdateVendorPaymentResponsibility.d.ts +33 -0
- package/dist/esm/react-query/vendorsUpdateVendorPaymentResponsibility.d.ts.map +1 -0
- package/dist/esm/react-query/vendorsUpdateVendorPaymentResponsibility.js +50 -0
- package/dist/esm/react-query/vendorsUpdateVendorPaymentResponsibility.js.map +1 -0
- package/dist/esm/sdk/vendors.d.ts +22 -1
- package/dist/esm/sdk/vendors.d.ts.map +1 -1
- package/dist/esm/sdk/vendors.js +28 -1
- package/dist/esm/sdk/vendors.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +2 -2
- package/src/__tests__/vendors.test.ts +39 -0
- package/src/__tests__/zones.test.ts +32 -3
- package/src/funcs/vendorsGetVendorPaymentResponsibility.ts +189 -0
- package/src/funcs/vendorsUpdateVendorDetails.ts +1 -1
- package/src/funcs/vendorsUpdateVendorPaymentResponsibility.ts +191 -0
- package/src/lib/config.ts +3 -3
- package/src/models/components/index.ts +1 -0
- package/src/models/components/vendorpaymentresponsibilityassignments.ts +113 -0
- package/src/models/operations/getvendorpaymentresponsibility.ts +93 -0
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/updatevendordetails.ts +14 -0
- package/src/models/operations/updatevendorpaymentresponsibility.ts +173 -0
- package/src/react-query/index.ts +2 -0
- package/src/react-query/vendorsGetVendorPaymentResponsibility.core.ts +78 -0
- package/src/react-query/vendorsGetVendorPaymentResponsibility.ts +156 -0
- package/src/react-query/vendorsUpdateVendorDetails.ts +1 -1
- package/src/react-query/vendorsUpdateVendorPaymentResponsibility.ts +119 -0
- package/src/sdk/vendors.ts +48 -1
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
MutationKey,
|
|
7
|
+
useMutation,
|
|
8
|
+
UseMutationResult,
|
|
9
|
+
} from "@tanstack/react-query";
|
|
10
|
+
import { GreenSecurityCore } from "../core.js";
|
|
11
|
+
import { vendorsUpdateVendorPaymentResponsibility } from "../funcs/vendorsUpdateVendorPaymentResponsibility.js";
|
|
12
|
+
import { combineSignals } from "../lib/primitives.js";
|
|
13
|
+
import { RequestOptions } from "../lib/sdks.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 { unwrapAsync } from "../types/fp.js";
|
|
27
|
+
import { useGreenSecurityContext } from "./_context.js";
|
|
28
|
+
import { MutationHookOptions } from "./_types.js";
|
|
29
|
+
|
|
30
|
+
export type VendorsUpdateVendorPaymentResponsibilityMutationVariables = {
|
|
31
|
+
request: operations.UpdateVendorPaymentResponsibilityRequest;
|
|
32
|
+
options?: RequestOptions;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type VendorsUpdateVendorPaymentResponsibilityMutationData =
|
|
36
|
+
operations.UpdateVendorPaymentResponsibilityUpdateVendorPaymentResponsibilityOk;
|
|
37
|
+
|
|
38
|
+
export type VendorsUpdateVendorPaymentResponsibilityMutationError =
|
|
39
|
+
| errors.ApiErrorResponse
|
|
40
|
+
| GreenSecurityError
|
|
41
|
+
| ResponseValidationError
|
|
42
|
+
| ConnectionError
|
|
43
|
+
| RequestAbortedError
|
|
44
|
+
| RequestTimeoutError
|
|
45
|
+
| InvalidRequestError
|
|
46
|
+
| UnexpectedClientError
|
|
47
|
+
| SDKValidationError;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Update vendor payment responsibility
|
|
51
|
+
*
|
|
52
|
+
* @remarks
|
|
53
|
+
* Partially updates the payment responsibility record for a vendor. Only company
|
|
54
|
+
* managers may call this endpoint. Each supplied `_user_id` must be either the
|
|
55
|
+
* vendor's user ID (to assign responsibility back to the vendor) or the
|
|
56
|
+
* authenticated manager's own user ID (to claim responsibility). Omitted fields
|
|
57
|
+
* are left unchanged.
|
|
58
|
+
*/
|
|
59
|
+
export function useVendorsUpdateVendorPaymentResponsibilityMutation(
|
|
60
|
+
options?: MutationHookOptions<
|
|
61
|
+
VendorsUpdateVendorPaymentResponsibilityMutationData,
|
|
62
|
+
VendorsUpdateVendorPaymentResponsibilityMutationError,
|
|
63
|
+
VendorsUpdateVendorPaymentResponsibilityMutationVariables
|
|
64
|
+
>,
|
|
65
|
+
): UseMutationResult<
|
|
66
|
+
VendorsUpdateVendorPaymentResponsibilityMutationData,
|
|
67
|
+
VendorsUpdateVendorPaymentResponsibilityMutationError,
|
|
68
|
+
VendorsUpdateVendorPaymentResponsibilityMutationVariables
|
|
69
|
+
> {
|
|
70
|
+
const client = useGreenSecurityContext();
|
|
71
|
+
return useMutation({
|
|
72
|
+
...buildVendorsUpdateVendorPaymentResponsibilityMutation(client, options),
|
|
73
|
+
...options,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function mutationKeyVendorsUpdateVendorPaymentResponsibility(): MutationKey {
|
|
78
|
+
return [
|
|
79
|
+
"@greensecurity/javascript-sdk",
|
|
80
|
+
"vendors",
|
|
81
|
+
"updateVendorPaymentResponsibility",
|
|
82
|
+
];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function buildVendorsUpdateVendorPaymentResponsibilityMutation(
|
|
86
|
+
client$: GreenSecurityCore,
|
|
87
|
+
hookOptions?: RequestOptions,
|
|
88
|
+
): {
|
|
89
|
+
mutationKey: MutationKey;
|
|
90
|
+
mutationFn: (
|
|
91
|
+
variables: VendorsUpdateVendorPaymentResponsibilityMutationVariables,
|
|
92
|
+
) => Promise<VendorsUpdateVendorPaymentResponsibilityMutationData>;
|
|
93
|
+
} {
|
|
94
|
+
return {
|
|
95
|
+
mutationKey: mutationKeyVendorsUpdateVendorPaymentResponsibility(),
|
|
96
|
+
mutationFn: function vendorsUpdateVendorPaymentResponsibilityMutationFn({
|
|
97
|
+
request,
|
|
98
|
+
options,
|
|
99
|
+
}): Promise<VendorsUpdateVendorPaymentResponsibilityMutationData> {
|
|
100
|
+
const mergedOptions = {
|
|
101
|
+
...hookOptions,
|
|
102
|
+
...options,
|
|
103
|
+
fetchOptions: {
|
|
104
|
+
...hookOptions?.fetchOptions,
|
|
105
|
+
...options?.fetchOptions,
|
|
106
|
+
signal: combineSignals(
|
|
107
|
+
hookOptions?.fetchOptions?.signal,
|
|
108
|
+
options?.fetchOptions?.signal,
|
|
109
|
+
),
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
return unwrapAsync(vendorsUpdateVendorPaymentResponsibility(
|
|
113
|
+
client$,
|
|
114
|
+
request,
|
|
115
|
+
mergedOptions,
|
|
116
|
+
));
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
}
|
package/src/sdk/vendors.ts
CHANGED
|
@@ -27,6 +27,7 @@ import { vendorsGetVendorCredentialFile } from "../funcs/vendorsGetVendorCredent
|
|
|
27
27
|
import { vendorsGetVendorInvoiceDetails } from "../funcs/vendorsGetVendorInvoiceDetails.js";
|
|
28
28
|
import { vendorsGetVendorInvoiceReceipt } from "../funcs/vendorsGetVendorInvoiceReceipt.js";
|
|
29
29
|
import { vendorsGetVendorLegalName } from "../funcs/vendorsGetVendorLegalName.js";
|
|
30
|
+
import { vendorsGetVendorPaymentResponsibility } from "../funcs/vendorsGetVendorPaymentResponsibility.js";
|
|
30
31
|
import { vendorsGetVendorsDetails } from "../funcs/vendorsGetVendorsDetails.js";
|
|
31
32
|
import { vendorsGetVendorsExportStatus } from "../funcs/vendorsGetVendorsExportStatus.js";
|
|
32
33
|
import { vendorsGetVendorUploadHistory } from "../funcs/vendorsGetVendorUploadHistory.js";
|
|
@@ -54,6 +55,7 @@ import { vendorsUpdateVendorCredentialFile } from "../funcs/vendorsUpdateVendorC
|
|
|
54
55
|
import { vendorsUpdateVendorCustomField } from "../funcs/vendorsUpdateVendorCustomField.js";
|
|
55
56
|
import { vendorsUpdateVendorDetails } from "../funcs/vendorsUpdateVendorDetails.js";
|
|
56
57
|
import { vendorsUpdateVendorManagedByCompany } from "../funcs/vendorsUpdateVendorManagedByCompany.js";
|
|
58
|
+
import { vendorsUpdateVendorPaymentResponsibility } from "../funcs/vendorsUpdateVendorPaymentResponsibility.js";
|
|
57
59
|
import { vendorsUpdateVendorScrubDetails } from "../funcs/vendorsUpdateVendorScrubDetails.js";
|
|
58
60
|
import { vendorsVendorsExport } from "../funcs/vendorsVendorsExport.js";
|
|
59
61
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
@@ -192,6 +194,51 @@ export class Vendors extends ClientSDK {
|
|
|
192
194
|
));
|
|
193
195
|
}
|
|
194
196
|
|
|
197
|
+
/**
|
|
198
|
+
* Get vendor payment responsibility
|
|
199
|
+
*
|
|
200
|
+
* @remarks
|
|
201
|
+
* Returns the payment responsibility record for a vendor managed by the authenticated
|
|
202
|
+
* company manager's company, or by the vendor themselves. Each `_user_id` field
|
|
203
|
+
* indicates which party is responsible for that payment category; `null` means
|
|
204
|
+
* responsibility defaults to the vendor.
|
|
205
|
+
*/
|
|
206
|
+
async getVendorPaymentResponsibility(
|
|
207
|
+
request: operations.GetVendorPaymentResponsibilityRequest,
|
|
208
|
+
options?: RequestOptions,
|
|
209
|
+
): Promise<
|
|
210
|
+
operations.GetVendorPaymentResponsibilityGetVendorPaymentResponsibilityOk
|
|
211
|
+
> {
|
|
212
|
+
return unwrapAsync(vendorsGetVendorPaymentResponsibility(
|
|
213
|
+
this,
|
|
214
|
+
request,
|
|
215
|
+
options,
|
|
216
|
+
));
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Update vendor payment responsibility
|
|
221
|
+
*
|
|
222
|
+
* @remarks
|
|
223
|
+
* Partially updates the payment responsibility record for a vendor. Only company
|
|
224
|
+
* managers may call this endpoint. Each supplied `_user_id` must be either the
|
|
225
|
+
* vendor's user ID (to assign responsibility back to the vendor) or the
|
|
226
|
+
* authenticated manager's own user ID (to claim responsibility). Omitted fields
|
|
227
|
+
* are left unchanged.
|
|
228
|
+
*/
|
|
229
|
+
async updateVendorPaymentResponsibility(
|
|
230
|
+
request: operations.UpdateVendorPaymentResponsibilityRequest,
|
|
231
|
+
options?: RequestOptions,
|
|
232
|
+
): Promise<
|
|
233
|
+
operations.UpdateVendorPaymentResponsibilityUpdateVendorPaymentResponsibilityOk
|
|
234
|
+
> {
|
|
235
|
+
return unwrapAsync(vendorsUpdateVendorPaymentResponsibility(
|
|
236
|
+
this,
|
|
237
|
+
request,
|
|
238
|
+
options,
|
|
239
|
+
));
|
|
240
|
+
}
|
|
241
|
+
|
|
195
242
|
/**
|
|
196
243
|
* List Vendor Credentials
|
|
197
244
|
*
|
|
@@ -819,7 +866,7 @@ export class Vendors extends ClientSDK {
|
|
|
819
866
|
* Update vendor details
|
|
820
867
|
*
|
|
821
868
|
* @remarks
|
|
822
|
-
*
|
|
869
|
+
* Update an individual vendor's profile — title, location, supervisor, email preferences, primary department, and primary sales state. A company manager can also remove the vendor from their company by sending `company_id: null`.
|
|
823
870
|
*/
|
|
824
871
|
async updateVendorDetails(
|
|
825
872
|
request: operations.UpdateVendorDetailsRequest,
|