@greensecurity/javascript-sdk 0.30.27 → 0.30.31
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 +713 -534
- package/bin/mcp-server.js.map +18 -14
- package/dist/commonjs/__tests__/vendors.test.js +25 -2
- 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/vendorsCreateVendorCompany.d.ts +17 -0
- package/dist/commonjs/funcs/vendorsCreateVendorCompany.d.ts.map +1 -0
- package/dist/commonjs/funcs/vendorsCreateVendorCompany.js +121 -0
- package/dist/commonjs/funcs/vendorsCreateVendorCompany.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/server.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/server.js +3 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/vendorsCreateVendorCompany.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/vendorsCreateVendorCompany.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/vendorsCreateVendorCompany.js +64 -0
- package/dist/commonjs/mcp-server/tools/vendorsCreateVendorCompany.js.map +1 -0
- 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/state.d.ts +181 -0
- package/dist/commonjs/models/components/state.d.ts.map +1 -0
- package/dist/commonjs/models/components/state.js +112 -0
- package/dist/commonjs/models/components/state.js.map +1 -0
- package/dist/commonjs/models/components/userlocation.d.ts +4 -172
- package/dist/commonjs/models/components/userlocation.d.ts.map +1 -1
- package/dist/commonjs/models/components/userlocation.js +4 -71
- package/dist/commonjs/models/components/userlocation.js.map +1 -1
- package/dist/commonjs/models/operations/createvendorcompany.d.ts +116 -0
- package/dist/commonjs/models/operations/createvendorcompany.d.ts.map +1 -0
- package/dist/commonjs/models/operations/createvendorcompany.js +163 -0
- package/dist/commonjs/models/operations/createvendorcompany.js.map +1 -0
- 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 +3 -45
- package/dist/commonjs/models/operations/listvendorinvoices.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listvendorinvoices.js +1 -15
- package/dist/commonjs/models/operations/listvendorinvoices.js.map +1 -1
- package/dist/commonjs/react-query/index.d.ts +1 -0
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +1 -0
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/react-query/vendorsCreateVendorCompany.d.ts +23 -0
- package/dist/commonjs/react-query/vendorsCreateVendorCompany.d.ts.map +1 -0
- package/dist/commonjs/react-query/vendorsCreateVendorCompany.js +47 -0
- package/dist/commonjs/react-query/vendorsCreateVendorCompany.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__/vendors.test.js +25 -2
- 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/vendorsCreateVendorCompany.d.ts +17 -0
- package/dist/esm/funcs/vendorsCreateVendorCompany.d.ts.map +1 -0
- package/dist/esm/funcs/vendorsCreateVendorCompany.js +85 -0
- package/dist/esm/funcs/vendorsCreateVendorCompany.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/server.d.ts.map +1 -1
- package/dist/esm/mcp-server/server.js +3 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/vendorsCreateVendorCompany.d.ts +8 -0
- package/dist/esm/mcp-server/tools/vendorsCreateVendorCompany.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/vendorsCreateVendorCompany.js +28 -0
- package/dist/esm/mcp-server/tools/vendorsCreateVendorCompany.js.map +1 -0
- 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/state.d.ts +181 -0
- package/dist/esm/models/components/state.d.ts.map +1 -0
- package/dist/esm/models/components/state.js +76 -0
- package/dist/esm/models/components/state.js.map +1 -0
- package/dist/esm/models/components/userlocation.d.ts +4 -172
- package/dist/esm/models/components/userlocation.d.ts.map +1 -1
- package/dist/esm/models/components/userlocation.js +1 -68
- package/dist/esm/models/components/userlocation.js.map +1 -1
- package/dist/esm/models/operations/createvendorcompany.d.ts +116 -0
- package/dist/esm/models/operations/createvendorcompany.d.ts.map +1 -0
- package/dist/esm/models/operations/createvendorcompany.js +121 -0
- package/dist/esm/models/operations/createvendorcompany.js.map +1 -0
- 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 +3 -45
- package/dist/esm/models/operations/listvendorinvoices.d.ts.map +1 -1
- package/dist/esm/models/operations/listvendorinvoices.js +1 -15
- package/dist/esm/models/operations/listvendorinvoices.js.map +1 -1
- package/dist/esm/react-query/index.d.ts +1 -0
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +1 -0
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/react-query/vendorsCreateVendorCompany.d.ts +23 -0
- package/dist/esm/react-query/vendorsCreateVendorCompany.d.ts.map +1 -0
- package/dist/esm/react-query/vendorsCreateVendorCompany.js +42 -0
- package/dist/esm/react-query/vendorsCreateVendorCompany.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 +3 -3
- package/src/__tests__/vendors.test.ts +28 -2
- package/src/__tests__/webhooks.test.ts +1 -1
- package/src/funcs/vendorsCreateVendorCompany.ts +174 -0
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +3 -1
- package/src/mcp-server/tools/vendorsCreateVendorCompany.ts +37 -0
- package/src/models/components/index.ts +1 -0
- package/src/models/components/state.ts +87 -0
- package/src/models/components/userlocation.ts +4 -75
- package/src/models/operations/createvendorcompany.ts +262 -0
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/listvendorinvoices.ts +1 -15
- package/src/react-query/index.ts +1 -0
- package/src/react-query/vendorsCreateVendorCompany.ts +89 -0
- package/src/sdk/vendors.ts +18 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { vendorsCreateVendorCompany } from "../../funcs/vendorsCreateVendorCompany.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.CreateVendorCompanyRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$vendorsCreateVendorCompany: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "vendors-create-vendor-company",
|
|
15
|
+
description: `Create vendor company
|
|
16
|
+
|
|
17
|
+
Create vendor company`,
|
|
18
|
+
args,
|
|
19
|
+
tool: async (client, args, ctx) => {
|
|
20
|
+
const [result, apiCall] = await vendorsCreateVendorCompany(
|
|
21
|
+
client,
|
|
22
|
+
args.request,
|
|
23
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
24
|
+
).$inspect();
|
|
25
|
+
|
|
26
|
+
if (!result.ok) {
|
|
27
|
+
return {
|
|
28
|
+
content: [{ type: "text", text: result.error.message }],
|
|
29
|
+
isError: true,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const value = result.value;
|
|
34
|
+
|
|
35
|
+
return formatResult(value, apiCall);
|
|
36
|
+
},
|
|
37
|
+
};
|
|
@@ -26,6 +26,7 @@ export * from "./productvariant.js";
|
|
|
26
26
|
export * from "./samlloginrequiredresponse.js";
|
|
27
27
|
export * from "./scantype.js";
|
|
28
28
|
export * from "./security.js";
|
|
29
|
+
export * from "./state.js";
|
|
29
30
|
export * from "./subscription.js";
|
|
30
31
|
export * from "./supervisor.js";
|
|
31
32
|
export * from "./supportarticle.js";
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The list of states
|
|
10
|
+
*/
|
|
11
|
+
export const State = {
|
|
12
|
+
Al: "AL",
|
|
13
|
+
Ak: "AK",
|
|
14
|
+
Az: "AZ",
|
|
15
|
+
Ar: "AR",
|
|
16
|
+
Ca: "CA",
|
|
17
|
+
Co: "CO",
|
|
18
|
+
Ct: "CT",
|
|
19
|
+
De: "DE",
|
|
20
|
+
Dc: "DC",
|
|
21
|
+
Fl: "FL",
|
|
22
|
+
Ga: "GA",
|
|
23
|
+
Hi: "HI",
|
|
24
|
+
Id: "ID",
|
|
25
|
+
Il: "IL",
|
|
26
|
+
In: "IN",
|
|
27
|
+
Ia: "IA",
|
|
28
|
+
Ks: "KS",
|
|
29
|
+
Ky: "KY",
|
|
30
|
+
La: "LA",
|
|
31
|
+
Me: "ME",
|
|
32
|
+
Md: "MD",
|
|
33
|
+
Ma: "MA",
|
|
34
|
+
Mi: "MI",
|
|
35
|
+
Mn: "MN",
|
|
36
|
+
Ms: "MS",
|
|
37
|
+
Mo: "MO",
|
|
38
|
+
Mt: "MT",
|
|
39
|
+
Ne: "NE",
|
|
40
|
+
Nv: "NV",
|
|
41
|
+
Nh: "NH",
|
|
42
|
+
Nj: "NJ",
|
|
43
|
+
Nm: "NM",
|
|
44
|
+
Ny: "NY",
|
|
45
|
+
Nc: "NC",
|
|
46
|
+
Nd: "ND",
|
|
47
|
+
Oh: "OH",
|
|
48
|
+
Ok: "OK",
|
|
49
|
+
Or: "OR",
|
|
50
|
+
Pa: "PA",
|
|
51
|
+
Ri: "RI",
|
|
52
|
+
Sc: "SC",
|
|
53
|
+
Sd: "SD",
|
|
54
|
+
Tn: "TN",
|
|
55
|
+
Tx: "TX",
|
|
56
|
+
Ut: "UT",
|
|
57
|
+
Vt: "VT",
|
|
58
|
+
Va: "VA",
|
|
59
|
+
Wa: "WA",
|
|
60
|
+
Wv: "WV",
|
|
61
|
+
Wi: "WI",
|
|
62
|
+
Wy: "WY",
|
|
63
|
+
} as const;
|
|
64
|
+
/**
|
|
65
|
+
* The list of states
|
|
66
|
+
*/
|
|
67
|
+
export type State = ClosedEnum<typeof State>;
|
|
68
|
+
|
|
69
|
+
/** @internal */
|
|
70
|
+
export const State$inboundSchema: z.ZodNativeEnum<typeof State> = z.nativeEnum(
|
|
71
|
+
State,
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
/** @internal */
|
|
75
|
+
export const State$outboundSchema: z.ZodNativeEnum<typeof State> =
|
|
76
|
+
State$inboundSchema;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* @internal
|
|
80
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
81
|
+
*/
|
|
82
|
+
export namespace State$ {
|
|
83
|
+
/** @deprecated use `State$inboundSchema` instead. */
|
|
84
|
+
export const inboundSchema = State$inboundSchema;
|
|
85
|
+
/** @deprecated use `State$outboundSchema` instead. */
|
|
86
|
+
export const outboundSchema = State$outboundSchema;
|
|
87
|
+
}
|
|
@@ -8,61 +8,7 @@ import { safeParse } from "../../lib/schemas.js";
|
|
|
8
8
|
import { ClosedEnum } from "../../types/enums.js";
|
|
9
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
-
|
|
12
|
-
export const State = {
|
|
13
|
-
Al: "AL",
|
|
14
|
-
Ak: "AK",
|
|
15
|
-
Az: "AZ",
|
|
16
|
-
Ar: "AR",
|
|
17
|
-
Ca: "CA",
|
|
18
|
-
Co: "CO",
|
|
19
|
-
Ct: "CT",
|
|
20
|
-
De: "DE",
|
|
21
|
-
Dc: "DC",
|
|
22
|
-
Fl: "FL",
|
|
23
|
-
Ga: "GA",
|
|
24
|
-
Hi: "HI",
|
|
25
|
-
Id: "ID",
|
|
26
|
-
Il: "IL",
|
|
27
|
-
In: "IN",
|
|
28
|
-
Ia: "IA",
|
|
29
|
-
Ks: "KS",
|
|
30
|
-
Ky: "KY",
|
|
31
|
-
La: "LA",
|
|
32
|
-
Me: "ME",
|
|
33
|
-
Md: "MD",
|
|
34
|
-
Ma: "MA",
|
|
35
|
-
Mi: "MI",
|
|
36
|
-
Mn: "MN",
|
|
37
|
-
Ms: "MS",
|
|
38
|
-
Mo: "MO",
|
|
39
|
-
Mt: "MT",
|
|
40
|
-
Ne: "NE",
|
|
41
|
-
Nv: "NV",
|
|
42
|
-
Nh: "NH",
|
|
43
|
-
Nj: "NJ",
|
|
44
|
-
Nm: "NM",
|
|
45
|
-
Ny: "NY",
|
|
46
|
-
Nc: "NC",
|
|
47
|
-
Nd: "ND",
|
|
48
|
-
Oh: "OH",
|
|
49
|
-
Ok: "OK",
|
|
50
|
-
Or: "OR",
|
|
51
|
-
Pa: "PA",
|
|
52
|
-
Ri: "RI",
|
|
53
|
-
Sc: "SC",
|
|
54
|
-
Sd: "SD",
|
|
55
|
-
Tn: "TN",
|
|
56
|
-
Tx: "TX",
|
|
57
|
-
Ut: "UT",
|
|
58
|
-
Vt: "VT",
|
|
59
|
-
Va: "VA",
|
|
60
|
-
Wa: "WA",
|
|
61
|
-
Wv: "WV",
|
|
62
|
-
Wi: "WI",
|
|
63
|
-
Wy: "WY",
|
|
64
|
-
} as const;
|
|
65
|
-
export type State = ClosedEnum<typeof State>;
|
|
11
|
+
import { State, State$inboundSchema, State$outboundSchema } from "./state.js";
|
|
66
12
|
|
|
67
13
|
export const Timezone = {
|
|
68
14
|
InternationalDateLineWest: "International Date Line West",
|
|
@@ -227,6 +173,9 @@ export type UserLocation = {
|
|
|
227
173
|
address1?: string | null | undefined;
|
|
228
174
|
address2?: string | null | undefined;
|
|
229
175
|
city?: string | null | undefined;
|
|
176
|
+
/**
|
|
177
|
+
* The list of states
|
|
178
|
+
*/
|
|
230
179
|
state?: State | null | undefined;
|
|
231
180
|
zip?: string | null | undefined;
|
|
232
181
|
phone?: string | null | undefined;
|
|
@@ -236,26 +185,6 @@ export type UserLocation = {
|
|
|
236
185
|
timezone?: Timezone | null | undefined;
|
|
237
186
|
};
|
|
238
187
|
|
|
239
|
-
/** @internal */
|
|
240
|
-
export const State$inboundSchema: z.ZodNativeEnum<typeof State> = z.nativeEnum(
|
|
241
|
-
State,
|
|
242
|
-
);
|
|
243
|
-
|
|
244
|
-
/** @internal */
|
|
245
|
-
export const State$outboundSchema: z.ZodNativeEnum<typeof State> =
|
|
246
|
-
State$inboundSchema;
|
|
247
|
-
|
|
248
|
-
/**
|
|
249
|
-
* @internal
|
|
250
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
251
|
-
*/
|
|
252
|
-
export namespace State$ {
|
|
253
|
-
/** @deprecated use `State$inboundSchema` instead. */
|
|
254
|
-
export const inboundSchema = State$inboundSchema;
|
|
255
|
-
/** @deprecated use `State$outboundSchema` instead. */
|
|
256
|
-
export const outboundSchema = State$outboundSchema;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
188
|
/** @internal */
|
|
260
189
|
export const Timezone$inboundSchema: z.ZodNativeEnum<typeof Timezone> = z
|
|
261
190
|
.nativeEnum(Timezone);
|
|
@@ -0,0 +1,262 @@
|
|
|
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 { 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 CreateVendorCompanyRequestBody = {
|
|
13
|
+
/**
|
|
14
|
+
* The vendor company name
|
|
15
|
+
*/
|
|
16
|
+
name: string;
|
|
17
|
+
/**
|
|
18
|
+
* The vendor company address
|
|
19
|
+
*/
|
|
20
|
+
address: string;
|
|
21
|
+
/**
|
|
22
|
+
* The vendor company city
|
|
23
|
+
*/
|
|
24
|
+
city: string;
|
|
25
|
+
/**
|
|
26
|
+
* The list of states
|
|
27
|
+
*/
|
|
28
|
+
state: components.State | null;
|
|
29
|
+
/**
|
|
30
|
+
* The vendor company zip
|
|
31
|
+
*/
|
|
32
|
+
zip: string;
|
|
33
|
+
/**
|
|
34
|
+
* The vendor company tax_id
|
|
35
|
+
*/
|
|
36
|
+
taxId: string;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export type CreateVendorCompanyRequest = {
|
|
40
|
+
/**
|
|
41
|
+
* Either the ID of the vendor rep or the keyword "me" to represent the current vendor.
|
|
42
|
+
*/
|
|
43
|
+
vendorIdOrMe: string;
|
|
44
|
+
requestBody: CreateVendorCompanyRequestBody;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The request was successful, and the server has returned the requested resource in the response body.
|
|
49
|
+
*/
|
|
50
|
+
export type CreateVendorCompanyResponseBody = {
|
|
51
|
+
companyId?: number | undefined;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/** @internal */
|
|
55
|
+
export const CreateVendorCompanyRequestBody$inboundSchema: z.ZodType<
|
|
56
|
+
CreateVendorCompanyRequestBody,
|
|
57
|
+
z.ZodTypeDef,
|
|
58
|
+
unknown
|
|
59
|
+
> = z.object({
|
|
60
|
+
name: z.string(),
|
|
61
|
+
address: z.string(),
|
|
62
|
+
city: z.string(),
|
|
63
|
+
state: z.nullable(components.State$inboundSchema),
|
|
64
|
+
zip: z.string(),
|
|
65
|
+
tax_id: z.string(),
|
|
66
|
+
}).transform((v) => {
|
|
67
|
+
return remap$(v, {
|
|
68
|
+
"tax_id": "taxId",
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
/** @internal */
|
|
73
|
+
export type CreateVendorCompanyRequestBody$Outbound = {
|
|
74
|
+
name: string;
|
|
75
|
+
address: string;
|
|
76
|
+
city: string;
|
|
77
|
+
state: string | null;
|
|
78
|
+
zip: string;
|
|
79
|
+
tax_id: string;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/** @internal */
|
|
83
|
+
export const CreateVendorCompanyRequestBody$outboundSchema: z.ZodType<
|
|
84
|
+
CreateVendorCompanyRequestBody$Outbound,
|
|
85
|
+
z.ZodTypeDef,
|
|
86
|
+
CreateVendorCompanyRequestBody
|
|
87
|
+
> = z.object({
|
|
88
|
+
name: z.string(),
|
|
89
|
+
address: z.string(),
|
|
90
|
+
city: z.string(),
|
|
91
|
+
state: z.nullable(components.State$outboundSchema),
|
|
92
|
+
zip: z.string(),
|
|
93
|
+
taxId: z.string(),
|
|
94
|
+
}).transform((v) => {
|
|
95
|
+
return remap$(v, {
|
|
96
|
+
taxId: "tax_id",
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* @internal
|
|
102
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
103
|
+
*/
|
|
104
|
+
export namespace CreateVendorCompanyRequestBody$ {
|
|
105
|
+
/** @deprecated use `CreateVendorCompanyRequestBody$inboundSchema` instead. */
|
|
106
|
+
export const inboundSchema = CreateVendorCompanyRequestBody$inboundSchema;
|
|
107
|
+
/** @deprecated use `CreateVendorCompanyRequestBody$outboundSchema` instead. */
|
|
108
|
+
export const outboundSchema = CreateVendorCompanyRequestBody$outboundSchema;
|
|
109
|
+
/** @deprecated use `CreateVendorCompanyRequestBody$Outbound` instead. */
|
|
110
|
+
export type Outbound = CreateVendorCompanyRequestBody$Outbound;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function createVendorCompanyRequestBodyToJSON(
|
|
114
|
+
createVendorCompanyRequestBody: CreateVendorCompanyRequestBody,
|
|
115
|
+
): string {
|
|
116
|
+
return JSON.stringify(
|
|
117
|
+
CreateVendorCompanyRequestBody$outboundSchema.parse(
|
|
118
|
+
createVendorCompanyRequestBody,
|
|
119
|
+
),
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export function createVendorCompanyRequestBodyFromJSON(
|
|
124
|
+
jsonString: string,
|
|
125
|
+
): SafeParseResult<CreateVendorCompanyRequestBody, SDKValidationError> {
|
|
126
|
+
return safeParse(
|
|
127
|
+
jsonString,
|
|
128
|
+
(x) => CreateVendorCompanyRequestBody$inboundSchema.parse(JSON.parse(x)),
|
|
129
|
+
`Failed to parse 'CreateVendorCompanyRequestBody' from JSON`,
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** @internal */
|
|
134
|
+
export const CreateVendorCompanyRequest$inboundSchema: z.ZodType<
|
|
135
|
+
CreateVendorCompanyRequest,
|
|
136
|
+
z.ZodTypeDef,
|
|
137
|
+
unknown
|
|
138
|
+
> = z.object({
|
|
139
|
+
vendor_id_or_me: z.string(),
|
|
140
|
+
RequestBody: z.lazy(() => CreateVendorCompanyRequestBody$inboundSchema),
|
|
141
|
+
}).transform((v) => {
|
|
142
|
+
return remap$(v, {
|
|
143
|
+
"vendor_id_or_me": "vendorIdOrMe",
|
|
144
|
+
"RequestBody": "requestBody",
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
/** @internal */
|
|
149
|
+
export type CreateVendorCompanyRequest$Outbound = {
|
|
150
|
+
vendor_id_or_me: string;
|
|
151
|
+
RequestBody: CreateVendorCompanyRequestBody$Outbound;
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
/** @internal */
|
|
155
|
+
export const CreateVendorCompanyRequest$outboundSchema: z.ZodType<
|
|
156
|
+
CreateVendorCompanyRequest$Outbound,
|
|
157
|
+
z.ZodTypeDef,
|
|
158
|
+
CreateVendorCompanyRequest
|
|
159
|
+
> = z.object({
|
|
160
|
+
vendorIdOrMe: z.string(),
|
|
161
|
+
requestBody: z.lazy(() => CreateVendorCompanyRequestBody$outboundSchema),
|
|
162
|
+
}).transform((v) => {
|
|
163
|
+
return remap$(v, {
|
|
164
|
+
vendorIdOrMe: "vendor_id_or_me",
|
|
165
|
+
requestBody: "RequestBody",
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* @internal
|
|
171
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
172
|
+
*/
|
|
173
|
+
export namespace CreateVendorCompanyRequest$ {
|
|
174
|
+
/** @deprecated use `CreateVendorCompanyRequest$inboundSchema` instead. */
|
|
175
|
+
export const inboundSchema = CreateVendorCompanyRequest$inboundSchema;
|
|
176
|
+
/** @deprecated use `CreateVendorCompanyRequest$outboundSchema` instead. */
|
|
177
|
+
export const outboundSchema = CreateVendorCompanyRequest$outboundSchema;
|
|
178
|
+
/** @deprecated use `CreateVendorCompanyRequest$Outbound` instead. */
|
|
179
|
+
export type Outbound = CreateVendorCompanyRequest$Outbound;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export function createVendorCompanyRequestToJSON(
|
|
183
|
+
createVendorCompanyRequest: CreateVendorCompanyRequest,
|
|
184
|
+
): string {
|
|
185
|
+
return JSON.stringify(
|
|
186
|
+
CreateVendorCompanyRequest$outboundSchema.parse(createVendorCompanyRequest),
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export function createVendorCompanyRequestFromJSON(
|
|
191
|
+
jsonString: string,
|
|
192
|
+
): SafeParseResult<CreateVendorCompanyRequest, SDKValidationError> {
|
|
193
|
+
return safeParse(
|
|
194
|
+
jsonString,
|
|
195
|
+
(x) => CreateVendorCompanyRequest$inboundSchema.parse(JSON.parse(x)),
|
|
196
|
+
`Failed to parse 'CreateVendorCompanyRequest' from JSON`,
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/** @internal */
|
|
201
|
+
export const CreateVendorCompanyResponseBody$inboundSchema: z.ZodType<
|
|
202
|
+
CreateVendorCompanyResponseBody,
|
|
203
|
+
z.ZodTypeDef,
|
|
204
|
+
unknown
|
|
205
|
+
> = z.object({
|
|
206
|
+
company_id: z.number().int().optional(),
|
|
207
|
+
}).transform((v) => {
|
|
208
|
+
return remap$(v, {
|
|
209
|
+
"company_id": "companyId",
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
/** @internal */
|
|
214
|
+
export type CreateVendorCompanyResponseBody$Outbound = {
|
|
215
|
+
company_id?: number | undefined;
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
/** @internal */
|
|
219
|
+
export const CreateVendorCompanyResponseBody$outboundSchema: z.ZodType<
|
|
220
|
+
CreateVendorCompanyResponseBody$Outbound,
|
|
221
|
+
z.ZodTypeDef,
|
|
222
|
+
CreateVendorCompanyResponseBody
|
|
223
|
+
> = z.object({
|
|
224
|
+
companyId: z.number().int().optional(),
|
|
225
|
+
}).transform((v) => {
|
|
226
|
+
return remap$(v, {
|
|
227
|
+
companyId: "company_id",
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* @internal
|
|
233
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
234
|
+
*/
|
|
235
|
+
export namespace CreateVendorCompanyResponseBody$ {
|
|
236
|
+
/** @deprecated use `CreateVendorCompanyResponseBody$inboundSchema` instead. */
|
|
237
|
+
export const inboundSchema = CreateVendorCompanyResponseBody$inboundSchema;
|
|
238
|
+
/** @deprecated use `CreateVendorCompanyResponseBody$outboundSchema` instead. */
|
|
239
|
+
export const outboundSchema = CreateVendorCompanyResponseBody$outboundSchema;
|
|
240
|
+
/** @deprecated use `CreateVendorCompanyResponseBody$Outbound` instead. */
|
|
241
|
+
export type Outbound = CreateVendorCompanyResponseBody$Outbound;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export function createVendorCompanyResponseBodyToJSON(
|
|
245
|
+
createVendorCompanyResponseBody: CreateVendorCompanyResponseBody,
|
|
246
|
+
): string {
|
|
247
|
+
return JSON.stringify(
|
|
248
|
+
CreateVendorCompanyResponseBody$outboundSchema.parse(
|
|
249
|
+
createVendorCompanyResponseBody,
|
|
250
|
+
),
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export function createVendorCompanyResponseBodyFromJSON(
|
|
255
|
+
jsonString: string,
|
|
256
|
+
): SafeParseResult<CreateVendorCompanyResponseBody, SDKValidationError> {
|
|
257
|
+
return safeParse(
|
|
258
|
+
jsonString,
|
|
259
|
+
(x) => CreateVendorCompanyResponseBody$inboundSchema.parse(JSON.parse(x)),
|
|
260
|
+
`Failed to parse 'CreateVendorCompanyResponseBody' from JSON`,
|
|
261
|
+
);
|
|
262
|
+
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
export * from "./addvendormanagedbycompany.js";
|
|
6
6
|
export * from "./changepassword.js";
|
|
7
|
+
export * from "./createvendorcompany.js";
|
|
7
8
|
export * from "./createvendorregistration.js";
|
|
8
9
|
export * from "./deletevendormanagedbycompany.js";
|
|
9
10
|
export * from "./expeditetimeremaining.js";
|
|
@@ -14,22 +14,8 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
|
14
14
|
* Filter invoices by financial_status
|
|
15
15
|
*/
|
|
16
16
|
export const InvoiceFinancialStatus = {
|
|
17
|
-
Pending: "pending",
|
|
18
|
-
Authorized: "authorized",
|
|
19
|
-
Captured: "captured",
|
|
20
|
-
Refunded: "refunded",
|
|
21
|
-
RefundedToCredits: "refunded to credits",
|
|
22
|
-
Voided: "voided",
|
|
23
|
-
Waived: "waived",
|
|
24
|
-
Overdue: "overdue",
|
|
25
17
|
Paid: "paid",
|
|
26
|
-
|
|
27
|
-
PaidByCreditCard: "paid by credit card",
|
|
28
|
-
PaidByCheck: "paid by check",
|
|
29
|
-
PaidByShareback: "paid by shareback",
|
|
30
|
-
PaidByPo: "paid by po",
|
|
31
|
-
PaidByOtherMeans: "paid by other means",
|
|
32
|
-
Credited: "credited",
|
|
18
|
+
Unpaid: "unpaid",
|
|
33
19
|
} as const;
|
|
34
20
|
/**
|
|
35
21
|
* Filter invoices by financial_status
|
package/src/react-query/index.ts
CHANGED
|
@@ -19,6 +19,7 @@ export * from "./usersPassword.js";
|
|
|
19
19
|
export * from "./usersPasswordResetRequest.js";
|
|
20
20
|
export * from "./vendorsAddVendorManagedByCompany.js";
|
|
21
21
|
export * from "./vendorScansVendorScanOut.js";
|
|
22
|
+
export * from "./vendorsCreateVendorCompany.js";
|
|
22
23
|
export * from "./vendorsCreateVendorRegistration.js";
|
|
23
24
|
export * from "./vendorsDeleteVendorManagedByCompany.js";
|
|
24
25
|
export * from "./vendorsExpediteTimeRemaining.js";
|
|
@@ -0,0 +1,89 @@
|
|
|
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 { vendorsCreateVendorCompany } from "../funcs/vendorsCreateVendorCompany.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 VendorsCreateVendorCompanyMutationVariables = {
|
|
20
|
+
request: operations.CreateVendorCompanyRequest;
|
|
21
|
+
options?: RequestOptions;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type VendorsCreateVendorCompanyMutationData =
|
|
25
|
+
operations.CreateVendorCompanyResponseBody;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Create vendor company
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* Create vendor company
|
|
32
|
+
*/
|
|
33
|
+
export function useVendorsCreateVendorCompanyMutation(
|
|
34
|
+
options?: MutationHookOptions<
|
|
35
|
+
VendorsCreateVendorCompanyMutationData,
|
|
36
|
+
Error,
|
|
37
|
+
VendorsCreateVendorCompanyMutationVariables
|
|
38
|
+
>,
|
|
39
|
+
): UseMutationResult<
|
|
40
|
+
VendorsCreateVendorCompanyMutationData,
|
|
41
|
+
Error,
|
|
42
|
+
VendorsCreateVendorCompanyMutationVariables
|
|
43
|
+
> {
|
|
44
|
+
const client = useGreenSecurityContext();
|
|
45
|
+
return useMutation({
|
|
46
|
+
...buildVendorsCreateVendorCompanyMutation(client, options),
|
|
47
|
+
...options,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function mutationKeyVendorsCreateVendorCompany(): MutationKey {
|
|
52
|
+
return ["@greensecurity/javascript-sdk", "vendors", "createVendorCompany"];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function buildVendorsCreateVendorCompanyMutation(
|
|
56
|
+
client$: GreenSecurityCore,
|
|
57
|
+
hookOptions?: RequestOptions,
|
|
58
|
+
): {
|
|
59
|
+
mutationKey: MutationKey;
|
|
60
|
+
mutationFn: (
|
|
61
|
+
variables: VendorsCreateVendorCompanyMutationVariables,
|
|
62
|
+
) => Promise<VendorsCreateVendorCompanyMutationData>;
|
|
63
|
+
} {
|
|
64
|
+
return {
|
|
65
|
+
mutationKey: mutationKeyVendorsCreateVendorCompany(),
|
|
66
|
+
mutationFn: function vendorsCreateVendorCompanyMutationFn({
|
|
67
|
+
request,
|
|
68
|
+
options,
|
|
69
|
+
}): Promise<VendorsCreateVendorCompanyMutationData> {
|
|
70
|
+
const mergedOptions = {
|
|
71
|
+
...hookOptions,
|
|
72
|
+
...options,
|
|
73
|
+
fetchOptions: {
|
|
74
|
+
...hookOptions?.fetchOptions,
|
|
75
|
+
...options?.fetchOptions,
|
|
76
|
+
signal: combineSignals(
|
|
77
|
+
hookOptions?.fetchOptions?.signal,
|
|
78
|
+
options?.fetchOptions?.signal,
|
|
79
|
+
),
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
return unwrapAsync(vendorsCreateVendorCompany(
|
|
83
|
+
client$,
|
|
84
|
+
request,
|
|
85
|
+
mergedOptions,
|
|
86
|
+
));
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
}
|
package/src/sdk/vendors.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { vendorsAddVendorManagedByCompany } from "../funcs/vendorsAddVendorManagedByCompany.js";
|
|
6
|
+
import { vendorsCreateVendorCompany } from "../funcs/vendorsCreateVendorCompany.js";
|
|
6
7
|
import { vendorsCreateVendorRegistration } from "../funcs/vendorsCreateVendorRegistration.js";
|
|
7
8
|
import { vendorsDeleteVendorManagedByCompany } from "../funcs/vendorsDeleteVendorManagedByCompany.js";
|
|
8
9
|
import { vendorsExpediteTimeRemaining } from "../funcs/vendorsExpediteTimeRemaining.js";
|
|
@@ -422,4 +423,21 @@ export class Vendors extends ClientSDK {
|
|
|
422
423
|
options,
|
|
423
424
|
));
|
|
424
425
|
}
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* Create vendor company
|
|
429
|
+
*
|
|
430
|
+
* @remarks
|
|
431
|
+
* Create vendor company
|
|
432
|
+
*/
|
|
433
|
+
async createVendorCompany(
|
|
434
|
+
request: operations.CreateVendorCompanyRequest,
|
|
435
|
+
options?: RequestOptions,
|
|
436
|
+
): Promise<operations.CreateVendorCompanyResponseBody> {
|
|
437
|
+
return unwrapAsync(vendorsCreateVendorCompany(
|
|
438
|
+
this,
|
|
439
|
+
request,
|
|
440
|
+
options,
|
|
441
|
+
));
|
|
442
|
+
}
|
|
425
443
|
}
|