@greensecurity/javascript-sdk 0.30.13 → 0.30.17
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/bin/mcp-server.js +506 -59
- package/bin/mcp-server.js.map +18 -15
- package/dist/commonjs/__tests__/vendormanagedbycompanies.test.js +1 -1
- package/dist/commonjs/__tests__/vendormanagedbycompanies.test.js.map +1 -1
- package/dist/commonjs/__tests__/vendors.test.js +17 -1
- 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/funcs/vendorsListVendorInvoices.js +2 -0
- package/dist/commonjs/funcs/vendorsListVendorInvoices.js.map +1 -1
- package/dist/commonjs/funcs/vendorsListVendorJobTitles.js +1 -1
- package/dist/commonjs/funcs/vendorsListVendorJobTitles.js.map +1 -1
- package/dist/commonjs/funcs/vendorsUpdateVendorDetails.d.ts +17 -0
- package/dist/commonjs/funcs/vendorsUpdateVendorDetails.d.ts.map +1 -0
- package/dist/commonjs/funcs/vendorsUpdateVendorDetails.js +122 -0
- package/dist/commonjs/funcs/vendorsUpdateVendorDetails.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/prompts.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/prompts.js +5 -1
- package/dist/commonjs/mcp-server/prompts.js.map +1 -1
- package/dist/commonjs/mcp-server/resources.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/resources.js +10 -2
- package/dist/commonjs/mcp-server/resources.js.map +1 -1
- package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/server.js +4 -3
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/vendorsUpdateVendorDetails.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/vendorsUpdateVendorDetails.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/vendorsUpdateVendorDetails.js +64 -0
- package/dist/commonjs/mcp-server/tools/vendorsUpdateVendorDetails.js.map +1 -0
- package/dist/commonjs/mcp-server/tools.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/tools.js +4 -3
- package/dist/commonjs/mcp-server/tools.js.map +1 -1
- package/dist/commonjs/models/components/userlocation.d.ts +654 -1
- package/dist/commonjs/models/components/userlocation.d.ts.map +1 -1
- package/dist/commonjs/models/components/userlocation.js +257 -3
- package/dist/commonjs/models/components/userlocation.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/listvendorinvoices.d.ts +54 -0
- package/dist/commonjs/models/operations/listvendorinvoices.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listvendorinvoices.js +35 -1
- package/dist/commonjs/models/operations/listvendorinvoices.js.map +1 -1
- package/dist/commonjs/models/operations/updatevendordetails.d.ts +121 -0
- package/dist/commonjs/models/operations/updatevendordetails.d.ts.map +1 -0
- package/dist/commonjs/models/operations/updatevendordetails.js +154 -0
- package/dist/commonjs/models/operations/updatevendordetails.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/vendorsListVendorInvoices.d.ts +6 -0
- package/dist/commonjs/react-query/vendorsListVendorInvoices.d.ts.map +1 -1
- package/dist/commonjs/react-query/vendorsListVendorInvoices.js +4 -0
- package/dist/commonjs/react-query/vendorsListVendorInvoices.js.map +1 -1
- package/dist/commonjs/react-query/vendorsUpdateVendorDetails.d.ts +23 -0
- package/dist/commonjs/react-query/vendorsUpdateVendorDetails.d.ts.map +1 -0
- package/dist/commonjs/react-query/vendorsUpdateVendorDetails.js +47 -0
- package/dist/commonjs/react-query/vendorsUpdateVendorDetails.js.map +1 -0
- package/dist/commonjs/sdk/vendors.d.ts +7 -0
- package/dist/commonjs/sdk/vendors.d.ts.map +1 -1
- package/dist/commonjs/sdk/vendors.js +10 -0
- package/dist/commonjs/sdk/vendors.js.map +1 -1
- package/dist/esm/__tests__/vendormanagedbycompanies.test.js +1 -1
- package/dist/esm/__tests__/vendormanagedbycompanies.test.js.map +1 -1
- package/dist/esm/__tests__/vendors.test.js +17 -1
- 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/funcs/vendorsListVendorInvoices.js +2 -0
- package/dist/esm/funcs/vendorsListVendorInvoices.js.map +1 -1
- package/dist/esm/funcs/vendorsListVendorJobTitles.js +1 -1
- package/dist/esm/funcs/vendorsListVendorJobTitles.js.map +1 -1
- package/dist/esm/funcs/vendorsUpdateVendorDetails.d.ts +17 -0
- package/dist/esm/funcs/vendorsUpdateVendorDetails.d.ts.map +1 -0
- package/dist/esm/funcs/vendorsUpdateVendorDetails.js +86 -0
- package/dist/esm/funcs/vendorsUpdateVendorDetails.js.map +1 -0
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/prompts.d.ts.map +1 -1
- package/dist/esm/mcp-server/prompts.js +5 -1
- package/dist/esm/mcp-server/prompts.js.map +1 -1
- package/dist/esm/mcp-server/resources.d.ts.map +1 -1
- package/dist/esm/mcp-server/resources.js +10 -2
- package/dist/esm/mcp-server/resources.js.map +1 -1
- package/dist/esm/mcp-server/server.d.ts.map +1 -1
- package/dist/esm/mcp-server/server.js +4 -3
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/vendorsUpdateVendorDetails.d.ts +8 -0
- package/dist/esm/mcp-server/tools/vendorsUpdateVendorDetails.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/vendorsUpdateVendorDetails.js +28 -0
- package/dist/esm/mcp-server/tools/vendorsUpdateVendorDetails.js.map +1 -0
- package/dist/esm/mcp-server/tools.d.ts.map +1 -1
- package/dist/esm/mcp-server/tools.js +4 -3
- package/dist/esm/mcp-server/tools.js.map +1 -1
- package/dist/esm/models/components/userlocation.d.ts +654 -1
- package/dist/esm/models/components/userlocation.d.ts.map +1 -1
- package/dist/esm/models/components/userlocation.js +256 -2
- package/dist/esm/models/components/userlocation.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/listvendorinvoices.d.ts +54 -0
- package/dist/esm/models/operations/listvendorinvoices.d.ts.map +1 -1
- package/dist/esm/models/operations/listvendorinvoices.js +34 -0
- package/dist/esm/models/operations/listvendorinvoices.js.map +1 -1
- package/dist/esm/models/operations/updatevendordetails.d.ts +121 -0
- package/dist/esm/models/operations/updatevendordetails.d.ts.map +1 -0
- package/dist/esm/models/operations/updatevendordetails.js +114 -0
- package/dist/esm/models/operations/updatevendordetails.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/vendorsListVendorInvoices.d.ts +6 -0
- package/dist/esm/react-query/vendorsListVendorInvoices.d.ts.map +1 -1
- package/dist/esm/react-query/vendorsListVendorInvoices.js +4 -0
- package/dist/esm/react-query/vendorsListVendorInvoices.js.map +1 -1
- package/dist/esm/react-query/vendorsUpdateVendorDetails.d.ts +23 -0
- package/dist/esm/react-query/vendorsUpdateVendorDetails.d.ts.map +1 -0
- package/dist/esm/react-query/vendorsUpdateVendorDetails.js +42 -0
- package/dist/esm/react-query/vendorsUpdateVendorDetails.js.map +1 -0
- package/dist/esm/sdk/vendors.d.ts +7 -0
- package/dist/esm/sdk/vendors.d.ts.map +1 -1
- package/dist/esm/sdk/vendors.js +10 -0
- package/dist/esm/sdk/vendors.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/vendormanagedbycompanies.test.ts +1 -1
- package/src/__tests__/vendors.test.ts +20 -1
- package/src/__tests__/webhooks.test.ts +1 -1
- package/src/funcs/vendorsListVendorInvoices.ts +2 -0
- package/src/funcs/vendorsListVendorJobTitles.ts +1 -1
- package/src/funcs/vendorsUpdateVendorDetails.ts +175 -0
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/prompts.ts +8 -1
- package/src/mcp-server/resources.ts +16 -2
- package/src/mcp-server/server.ts +5 -3
- package/src/mcp-server/tools/vendorsUpdateVendorDetails.ts +37 -0
- package/src/mcp-server/tools.ts +6 -3
- package/src/models/components/userlocation.ts +278 -3
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/listvendorinvoices.ts +56 -0
- package/src/models/operations/updatevendordetails.ts +224 -0
- package/src/react-query/index.ts +1 -0
- package/src/react-query/vendorsListVendorInvoices.ts +10 -0
- package/src/react-query/vendorsUpdateVendorDetails.ts +88 -0
- package/src/sdk/vendors.ts +18 -0
|
@@ -5,10 +5,27 @@
|
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
10
|
import * as components from "../components/index.js";
|
|
10
11
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Filter invoices by status
|
|
15
|
+
*/
|
|
16
|
+
export const InvoiceStatus = {
|
|
17
|
+
Cart: "cart",
|
|
18
|
+
Pending: "pending",
|
|
19
|
+
Canceled: "canceled",
|
|
20
|
+
ReadyToShip: "ready to ship",
|
|
21
|
+
Processed: "processed",
|
|
22
|
+
UnderReview: "under review",
|
|
23
|
+
} as const;
|
|
24
|
+
/**
|
|
25
|
+
* Filter invoices by status
|
|
26
|
+
*/
|
|
27
|
+
export type InvoiceStatus = ClosedEnum<typeof InvoiceStatus>;
|
|
28
|
+
|
|
12
29
|
export type ListVendorInvoicesRequest = {
|
|
13
30
|
/**
|
|
14
31
|
* A comma-separated list of object attributes to sort on.
|
|
@@ -34,6 +51,14 @@ export type ListVendorInvoicesRequest = {
|
|
|
34
51
|
* Either the ID of the vendor rep or the keyword "me" to represent the current vendor.
|
|
35
52
|
*/
|
|
36
53
|
vendorIdOrMe: string;
|
|
54
|
+
/**
|
|
55
|
+
* Filter invoices by invoice number
|
|
56
|
+
*/
|
|
57
|
+
invoiceNumber?: string | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Filter invoices by status
|
|
60
|
+
*/
|
|
61
|
+
invoiceStatus?: InvoiceStatus | undefined;
|
|
37
62
|
};
|
|
38
63
|
|
|
39
64
|
/**
|
|
@@ -51,6 +76,27 @@ export type ListVendorInvoicesResponse = {
|
|
|
51
76
|
result: ListVendorInvoicesResponseBody;
|
|
52
77
|
};
|
|
53
78
|
|
|
79
|
+
/** @internal */
|
|
80
|
+
export const InvoiceStatus$inboundSchema: z.ZodNativeEnum<
|
|
81
|
+
typeof InvoiceStatus
|
|
82
|
+
> = z.nativeEnum(InvoiceStatus);
|
|
83
|
+
|
|
84
|
+
/** @internal */
|
|
85
|
+
export const InvoiceStatus$outboundSchema: z.ZodNativeEnum<
|
|
86
|
+
typeof InvoiceStatus
|
|
87
|
+
> = InvoiceStatus$inboundSchema;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @internal
|
|
91
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
92
|
+
*/
|
|
93
|
+
export namespace InvoiceStatus$ {
|
|
94
|
+
/** @deprecated use `InvoiceStatus$inboundSchema` instead. */
|
|
95
|
+
export const inboundSchema = InvoiceStatus$inboundSchema;
|
|
96
|
+
/** @deprecated use `InvoiceStatus$outboundSchema` instead. */
|
|
97
|
+
export const outboundSchema = InvoiceStatus$outboundSchema;
|
|
98
|
+
}
|
|
99
|
+
|
|
54
100
|
/** @internal */
|
|
55
101
|
export const ListVendorInvoicesRequest$inboundSchema: z.ZodType<
|
|
56
102
|
ListVendorInvoicesRequest,
|
|
@@ -63,10 +109,14 @@ export const ListVendorInvoicesRequest$inboundSchema: z.ZodType<
|
|
|
63
109
|
items_per_page: z.number().int().optional(),
|
|
64
110
|
expand: z.array(components.Expand$inboundSchema).optional(),
|
|
65
111
|
vendor_id_or_me: z.string(),
|
|
112
|
+
invoice_number: z.string().optional(),
|
|
113
|
+
invoice_status: InvoiceStatus$inboundSchema.optional(),
|
|
66
114
|
}).transform((v) => {
|
|
67
115
|
return remap$(v, {
|
|
68
116
|
"items_per_page": "itemsPerPage",
|
|
69
117
|
"vendor_id_or_me": "vendorIdOrMe",
|
|
118
|
+
"invoice_number": "invoiceNumber",
|
|
119
|
+
"invoice_status": "invoiceStatus",
|
|
70
120
|
});
|
|
71
121
|
});
|
|
72
122
|
|
|
@@ -78,6 +128,8 @@ export type ListVendorInvoicesRequest$Outbound = {
|
|
|
78
128
|
items_per_page?: number | undefined;
|
|
79
129
|
expand?: Array<string> | undefined;
|
|
80
130
|
vendor_id_or_me: string;
|
|
131
|
+
invoice_number?: string | undefined;
|
|
132
|
+
invoice_status?: string | undefined;
|
|
81
133
|
};
|
|
82
134
|
|
|
83
135
|
/** @internal */
|
|
@@ -92,10 +144,14 @@ export const ListVendorInvoicesRequest$outboundSchema: z.ZodType<
|
|
|
92
144
|
itemsPerPage: z.number().int().optional(),
|
|
93
145
|
expand: z.array(components.Expand$outboundSchema).optional(),
|
|
94
146
|
vendorIdOrMe: z.string(),
|
|
147
|
+
invoiceNumber: z.string().optional(),
|
|
148
|
+
invoiceStatus: InvoiceStatus$outboundSchema.optional(),
|
|
95
149
|
}).transform((v) => {
|
|
96
150
|
return remap$(v, {
|
|
97
151
|
itemsPerPage: "items_per_page",
|
|
98
152
|
vendorIdOrMe: "vendor_id_or_me",
|
|
153
|
+
invoiceNumber: "invoice_number",
|
|
154
|
+
invoiceStatus: "invoice_status",
|
|
99
155
|
});
|
|
100
156
|
});
|
|
101
157
|
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import * as components from "../components/index.js";
|
|
11
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The vendor's email_recepient value to update
|
|
15
|
+
*/
|
|
16
|
+
export const EmailRecepient = {
|
|
17
|
+
NoEmail: "No email",
|
|
18
|
+
Vendor: "Vendor",
|
|
19
|
+
CompanyManager: "Company manager",
|
|
20
|
+
VendorAndCompanyManager: "Vendor and company manager",
|
|
21
|
+
} as const;
|
|
22
|
+
/**
|
|
23
|
+
* The vendor's email_recepient value to update
|
|
24
|
+
*/
|
|
25
|
+
export type EmailRecepient = ClosedEnum<typeof EmailRecepient>;
|
|
26
|
+
|
|
27
|
+
export type UpdateVendorDetailsRequestBody = {
|
|
28
|
+
/**
|
|
29
|
+
* The QR code value
|
|
30
|
+
*/
|
|
31
|
+
qrCode?: string | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* The vendor's email_recepient value to update
|
|
34
|
+
*/
|
|
35
|
+
emailRecepient?: EmailRecepient | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* The vendor's send_weekly_summary_email value to update
|
|
38
|
+
*/
|
|
39
|
+
sendWeeklySummaryEmail?: boolean | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* The vendor's title value to update
|
|
42
|
+
*/
|
|
43
|
+
title?: string | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Reduced list of attributes of the User Location
|
|
46
|
+
*/
|
|
47
|
+
location?: components.UserLocation | null | undefined;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export type UpdateVendorDetailsRequest = {
|
|
51
|
+
/**
|
|
52
|
+
* Either the ID of the vendor rep or the keyword "me" to represent the current vendor.
|
|
53
|
+
*/
|
|
54
|
+
vendorIdOrMe: string;
|
|
55
|
+
requestBody: UpdateVendorDetailsRequestBody;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/** @internal */
|
|
59
|
+
export const EmailRecepient$inboundSchema: z.ZodNativeEnum<
|
|
60
|
+
typeof EmailRecepient
|
|
61
|
+
> = z.nativeEnum(EmailRecepient);
|
|
62
|
+
|
|
63
|
+
/** @internal */
|
|
64
|
+
export const EmailRecepient$outboundSchema: z.ZodNativeEnum<
|
|
65
|
+
typeof EmailRecepient
|
|
66
|
+
> = EmailRecepient$inboundSchema;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @internal
|
|
70
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
71
|
+
*/
|
|
72
|
+
export namespace EmailRecepient$ {
|
|
73
|
+
/** @deprecated use `EmailRecepient$inboundSchema` instead. */
|
|
74
|
+
export const inboundSchema = EmailRecepient$inboundSchema;
|
|
75
|
+
/** @deprecated use `EmailRecepient$outboundSchema` instead. */
|
|
76
|
+
export const outboundSchema = EmailRecepient$outboundSchema;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** @internal */
|
|
80
|
+
export const UpdateVendorDetailsRequestBody$inboundSchema: z.ZodType<
|
|
81
|
+
UpdateVendorDetailsRequestBody,
|
|
82
|
+
z.ZodTypeDef,
|
|
83
|
+
unknown
|
|
84
|
+
> = z.object({
|
|
85
|
+
qr_code: z.string().optional(),
|
|
86
|
+
email_recepient: EmailRecepient$inboundSchema.optional(),
|
|
87
|
+
send_weekly_summary_email: z.boolean().optional(),
|
|
88
|
+
title: z.string().optional(),
|
|
89
|
+
location: z.nullable(components.UserLocation$inboundSchema).optional(),
|
|
90
|
+
}).transform((v) => {
|
|
91
|
+
return remap$(v, {
|
|
92
|
+
"qr_code": "qrCode",
|
|
93
|
+
"email_recepient": "emailRecepient",
|
|
94
|
+
"send_weekly_summary_email": "sendWeeklySummaryEmail",
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
/** @internal */
|
|
99
|
+
export type UpdateVendorDetailsRequestBody$Outbound = {
|
|
100
|
+
qr_code?: string | undefined;
|
|
101
|
+
email_recepient?: string | undefined;
|
|
102
|
+
send_weekly_summary_email?: boolean | undefined;
|
|
103
|
+
title?: string | undefined;
|
|
104
|
+
location?: components.UserLocation$Outbound | null | undefined;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
/** @internal */
|
|
108
|
+
export const UpdateVendorDetailsRequestBody$outboundSchema: z.ZodType<
|
|
109
|
+
UpdateVendorDetailsRequestBody$Outbound,
|
|
110
|
+
z.ZodTypeDef,
|
|
111
|
+
UpdateVendorDetailsRequestBody
|
|
112
|
+
> = z.object({
|
|
113
|
+
qrCode: z.string().optional(),
|
|
114
|
+
emailRecepient: EmailRecepient$outboundSchema.optional(),
|
|
115
|
+
sendWeeklySummaryEmail: z.boolean().optional(),
|
|
116
|
+
title: z.string().optional(),
|
|
117
|
+
location: z.nullable(components.UserLocation$outboundSchema).optional(),
|
|
118
|
+
}).transform((v) => {
|
|
119
|
+
return remap$(v, {
|
|
120
|
+
qrCode: "qr_code",
|
|
121
|
+
emailRecepient: "email_recepient",
|
|
122
|
+
sendWeeklySummaryEmail: "send_weekly_summary_email",
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* @internal
|
|
128
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
129
|
+
*/
|
|
130
|
+
export namespace UpdateVendorDetailsRequestBody$ {
|
|
131
|
+
/** @deprecated use `UpdateVendorDetailsRequestBody$inboundSchema` instead. */
|
|
132
|
+
export const inboundSchema = UpdateVendorDetailsRequestBody$inboundSchema;
|
|
133
|
+
/** @deprecated use `UpdateVendorDetailsRequestBody$outboundSchema` instead. */
|
|
134
|
+
export const outboundSchema = UpdateVendorDetailsRequestBody$outboundSchema;
|
|
135
|
+
/** @deprecated use `UpdateVendorDetailsRequestBody$Outbound` instead. */
|
|
136
|
+
export type Outbound = UpdateVendorDetailsRequestBody$Outbound;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export function updateVendorDetailsRequestBodyToJSON(
|
|
140
|
+
updateVendorDetailsRequestBody: UpdateVendorDetailsRequestBody,
|
|
141
|
+
): string {
|
|
142
|
+
return JSON.stringify(
|
|
143
|
+
UpdateVendorDetailsRequestBody$outboundSchema.parse(
|
|
144
|
+
updateVendorDetailsRequestBody,
|
|
145
|
+
),
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export function updateVendorDetailsRequestBodyFromJSON(
|
|
150
|
+
jsonString: string,
|
|
151
|
+
): SafeParseResult<UpdateVendorDetailsRequestBody, SDKValidationError> {
|
|
152
|
+
return safeParse(
|
|
153
|
+
jsonString,
|
|
154
|
+
(x) => UpdateVendorDetailsRequestBody$inboundSchema.parse(JSON.parse(x)),
|
|
155
|
+
`Failed to parse 'UpdateVendorDetailsRequestBody' from JSON`,
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** @internal */
|
|
160
|
+
export const UpdateVendorDetailsRequest$inboundSchema: z.ZodType<
|
|
161
|
+
UpdateVendorDetailsRequest,
|
|
162
|
+
z.ZodTypeDef,
|
|
163
|
+
unknown
|
|
164
|
+
> = z.object({
|
|
165
|
+
vendor_id_or_me: z.string(),
|
|
166
|
+
RequestBody: z.lazy(() => UpdateVendorDetailsRequestBody$inboundSchema),
|
|
167
|
+
}).transform((v) => {
|
|
168
|
+
return remap$(v, {
|
|
169
|
+
"vendor_id_or_me": "vendorIdOrMe",
|
|
170
|
+
"RequestBody": "requestBody",
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
/** @internal */
|
|
175
|
+
export type UpdateVendorDetailsRequest$Outbound = {
|
|
176
|
+
vendor_id_or_me: string;
|
|
177
|
+
RequestBody: UpdateVendorDetailsRequestBody$Outbound;
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
/** @internal */
|
|
181
|
+
export const UpdateVendorDetailsRequest$outboundSchema: z.ZodType<
|
|
182
|
+
UpdateVendorDetailsRequest$Outbound,
|
|
183
|
+
z.ZodTypeDef,
|
|
184
|
+
UpdateVendorDetailsRequest
|
|
185
|
+
> = z.object({
|
|
186
|
+
vendorIdOrMe: z.string(),
|
|
187
|
+
requestBody: z.lazy(() => UpdateVendorDetailsRequestBody$outboundSchema),
|
|
188
|
+
}).transform((v) => {
|
|
189
|
+
return remap$(v, {
|
|
190
|
+
vendorIdOrMe: "vendor_id_or_me",
|
|
191
|
+
requestBody: "RequestBody",
|
|
192
|
+
});
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* @internal
|
|
197
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
198
|
+
*/
|
|
199
|
+
export namespace UpdateVendorDetailsRequest$ {
|
|
200
|
+
/** @deprecated use `UpdateVendorDetailsRequest$inboundSchema` instead. */
|
|
201
|
+
export const inboundSchema = UpdateVendorDetailsRequest$inboundSchema;
|
|
202
|
+
/** @deprecated use `UpdateVendorDetailsRequest$outboundSchema` instead. */
|
|
203
|
+
export const outboundSchema = UpdateVendorDetailsRequest$outboundSchema;
|
|
204
|
+
/** @deprecated use `UpdateVendorDetailsRequest$Outbound` instead. */
|
|
205
|
+
export type Outbound = UpdateVendorDetailsRequest$Outbound;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export function updateVendorDetailsRequestToJSON(
|
|
209
|
+
updateVendorDetailsRequest: UpdateVendorDetailsRequest,
|
|
210
|
+
): string {
|
|
211
|
+
return JSON.stringify(
|
|
212
|
+
UpdateVendorDetailsRequest$outboundSchema.parse(updateVendorDetailsRequest),
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export function updateVendorDetailsRequestFromJSON(
|
|
217
|
+
jsonString: string,
|
|
218
|
+
): SafeParseResult<UpdateVendorDetailsRequest, SDKValidationError> {
|
|
219
|
+
return safeParse(
|
|
220
|
+
jsonString,
|
|
221
|
+
(x) => UpdateVendorDetailsRequest$inboundSchema.parse(JSON.parse(x)),
|
|
222
|
+
`Failed to parse 'UpdateVendorDetailsRequest' from JSON`,
|
|
223
|
+
);
|
|
224
|
+
}
|
package/src/react-query/index.ts
CHANGED
|
@@ -33,6 +33,7 @@ export * from "./vendorsListVendorManagedByCompanies.js";
|
|
|
33
33
|
export * from "./vendorsListVendorScrubDetails.js";
|
|
34
34
|
export * from "./vendorsListVendorScrubPackages.js";
|
|
35
35
|
export * from "./vendorsListVendorScrubPurchases.js";
|
|
36
|
+
export * from "./vendorsUpdateVendorDetails.js";
|
|
36
37
|
export * from "./vendorsUpdateVendorManagedByCompany.js";
|
|
37
38
|
export * from "./vendorsUpdateVendorScrubDetails.js";
|
|
38
39
|
export * from "./webhooksGetWebhookEndpoint.js";
|
|
@@ -208,6 +208,8 @@ export function setVendorsListVendorInvoicesData(
|
|
|
208
208
|
page?: number | undefined;
|
|
209
209
|
itemsPerPage?: number | undefined;
|
|
210
210
|
expand?: Array<components.Expand> | undefined;
|
|
211
|
+
invoiceNumber?: string | undefined;
|
|
212
|
+
invoiceStatus?: operations.InvoiceStatus | undefined;
|
|
211
213
|
},
|
|
212
214
|
],
|
|
213
215
|
data: VendorsListVendorInvoicesQueryData,
|
|
@@ -228,6 +230,8 @@ export function invalidateVendorsListVendorInvoices(
|
|
|
228
230
|
page?: number | undefined;
|
|
229
231
|
itemsPerPage?: number | undefined;
|
|
230
232
|
expand?: Array<components.Expand> | undefined;
|
|
233
|
+
invoiceNumber?: string | undefined;
|
|
234
|
+
invoiceStatus?: operations.InvoiceStatus | undefined;
|
|
231
235
|
},
|
|
232
236
|
]
|
|
233
237
|
>,
|
|
@@ -275,6 +279,8 @@ export function buildVendorsListVendorInvoicesQuery(
|
|
|
275
279
|
page: request.page,
|
|
276
280
|
itemsPerPage: request.itemsPerPage,
|
|
277
281
|
expand: request.expand,
|
|
282
|
+
invoiceNumber: request.invoiceNumber,
|
|
283
|
+
invoiceStatus: request.invoiceStatus,
|
|
278
284
|
}),
|
|
279
285
|
queryFn: async function vendorsListVendorInvoicesQueryFn(
|
|
280
286
|
ctx,
|
|
@@ -314,6 +320,8 @@ export function buildVendorsListVendorInvoicesInfiniteQuery(
|
|
|
314
320
|
page: request.page,
|
|
315
321
|
itemsPerPage: request.itemsPerPage,
|
|
316
322
|
expand: request.expand,
|
|
323
|
+
invoiceNumber: request.invoiceNumber,
|
|
324
|
+
invoiceStatus: request.invoiceStatus,
|
|
317
325
|
}),
|
|
318
326
|
queryFn: async function vendorsListVendorInvoicesQuery(
|
|
319
327
|
ctx,
|
|
@@ -352,6 +360,8 @@ export function queryKeyVendorsListVendorInvoices(
|
|
|
352
360
|
page?: number | undefined;
|
|
353
361
|
itemsPerPage?: number | undefined;
|
|
354
362
|
expand?: Array<components.Expand> | undefined;
|
|
363
|
+
invoiceNumber?: string | undefined;
|
|
364
|
+
invoiceStatus?: operations.InvoiceStatus | undefined;
|
|
355
365
|
},
|
|
356
366
|
): QueryKey {
|
|
357
367
|
return [
|
|
@@ -0,0 +1,88 @@
|
|
|
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 { vendorsUpdateVendorDetails } from "../funcs/vendorsUpdateVendorDetails.js";
|
|
12
|
+
import { combineSignals } from "../lib/primitives.js";
|
|
13
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
14
|
+
import * as operations from "../models/operations/index.js";
|
|
15
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
16
|
+
import { useGreenSecurityContext } from "./_context.js";
|
|
17
|
+
import { MutationHookOptions } from "./_types.js";
|
|
18
|
+
|
|
19
|
+
export type VendorsUpdateVendorDetailsMutationVariables = {
|
|
20
|
+
request: operations.UpdateVendorDetailsRequest;
|
|
21
|
+
options?: RequestOptions;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type VendorsUpdateVendorDetailsMutationData = boolean;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Update vendor details
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* It will update the vendor details
|
|
31
|
+
*/
|
|
32
|
+
export function useVendorsUpdateVendorDetailsMutation(
|
|
33
|
+
options?: MutationHookOptions<
|
|
34
|
+
VendorsUpdateVendorDetailsMutationData,
|
|
35
|
+
Error,
|
|
36
|
+
VendorsUpdateVendorDetailsMutationVariables
|
|
37
|
+
>,
|
|
38
|
+
): UseMutationResult<
|
|
39
|
+
VendorsUpdateVendorDetailsMutationData,
|
|
40
|
+
Error,
|
|
41
|
+
VendorsUpdateVendorDetailsMutationVariables
|
|
42
|
+
> {
|
|
43
|
+
const client = useGreenSecurityContext();
|
|
44
|
+
return useMutation({
|
|
45
|
+
...buildVendorsUpdateVendorDetailsMutation(client, options),
|
|
46
|
+
...options,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function mutationKeyVendorsUpdateVendorDetails(): MutationKey {
|
|
51
|
+
return ["@greensecurity/javascript-sdk", "vendors", "updateVendorDetails"];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function buildVendorsUpdateVendorDetailsMutation(
|
|
55
|
+
client$: GreenSecurityCore,
|
|
56
|
+
hookOptions?: RequestOptions,
|
|
57
|
+
): {
|
|
58
|
+
mutationKey: MutationKey;
|
|
59
|
+
mutationFn: (
|
|
60
|
+
variables: VendorsUpdateVendorDetailsMutationVariables,
|
|
61
|
+
) => Promise<VendorsUpdateVendorDetailsMutationData>;
|
|
62
|
+
} {
|
|
63
|
+
return {
|
|
64
|
+
mutationKey: mutationKeyVendorsUpdateVendorDetails(),
|
|
65
|
+
mutationFn: function vendorsUpdateVendorDetailsMutationFn({
|
|
66
|
+
request,
|
|
67
|
+
options,
|
|
68
|
+
}): Promise<VendorsUpdateVendorDetailsMutationData> {
|
|
69
|
+
const mergedOptions = {
|
|
70
|
+
...hookOptions,
|
|
71
|
+
...options,
|
|
72
|
+
fetchOptions: {
|
|
73
|
+
...hookOptions?.fetchOptions,
|
|
74
|
+
...options?.fetchOptions,
|
|
75
|
+
signal: combineSignals(
|
|
76
|
+
hookOptions?.fetchOptions?.signal,
|
|
77
|
+
options?.fetchOptions?.signal,
|
|
78
|
+
),
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
return unwrapAsync(vendorsUpdateVendorDetails(
|
|
82
|
+
client$,
|
|
83
|
+
request,
|
|
84
|
+
mergedOptions,
|
|
85
|
+
));
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
}
|
package/src/sdk/vendors.ts
CHANGED
|
@@ -18,6 +18,7 @@ import { vendorsListVendorManagedByCompanies } from "../funcs/vendorsListVendorM
|
|
|
18
18
|
import { vendorsListVendorScrubDetails } from "../funcs/vendorsListVendorScrubDetails.js";
|
|
19
19
|
import { vendorsListVendorScrubPackages } from "../funcs/vendorsListVendorScrubPackages.js";
|
|
20
20
|
import { vendorsListVendorScrubPurchases } from "../funcs/vendorsListVendorScrubPurchases.js";
|
|
21
|
+
import { vendorsUpdateVendorDetails } from "../funcs/vendorsUpdateVendorDetails.js";
|
|
21
22
|
import { vendorsUpdateVendorManagedByCompany } from "../funcs/vendorsUpdateVendorManagedByCompany.js";
|
|
22
23
|
import { vendorsUpdateVendorScrubDetails } from "../funcs/vendorsUpdateVendorScrubDetails.js";
|
|
23
24
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
@@ -273,6 +274,23 @@ export class Vendors extends ClientSDK {
|
|
|
273
274
|
));
|
|
274
275
|
}
|
|
275
276
|
|
|
277
|
+
/**
|
|
278
|
+
* Update vendor details
|
|
279
|
+
*
|
|
280
|
+
* @remarks
|
|
281
|
+
* It will update the vendor details
|
|
282
|
+
*/
|
|
283
|
+
async updateVendorDetails(
|
|
284
|
+
request: operations.UpdateVendorDetailsRequest,
|
|
285
|
+
options?: RequestOptions,
|
|
286
|
+
): Promise<boolean> {
|
|
287
|
+
return unwrapAsync(vendorsUpdateVendorDetails(
|
|
288
|
+
this,
|
|
289
|
+
request,
|
|
290
|
+
options,
|
|
291
|
+
));
|
|
292
|
+
}
|
|
293
|
+
|
|
276
294
|
/**
|
|
277
295
|
* List vendor credits
|
|
278
296
|
*
|