@greensecurity/javascript-sdk 0.30.13 → 0.30.15
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 +456 -39
- package/bin/mcp-server.js.map +11 -8
- 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 +18 -2
- package/dist/commonjs/__tests__/vendors.test.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/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/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/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/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/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 +18 -2
- package/dist/esm/__tests__/vendors.test.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/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/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/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/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/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 +21 -2
- 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/server.ts +3 -1
- package/src/mcp-server/tools/vendorsUpdateVendorDetails.ts +37 -0
- package/src/models/components/userlocation.ts +278 -3
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/updatevendordetails.ts +224 -0
- package/src/react-query/index.ts +1 -0
- package/src/react-query/vendorsUpdateVendorDetails.ts +88 -0
- package/src/sdk/vendors.ts +18 -0
|
@@ -3,10 +3,222 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
6
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
7
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
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>;
|
|
66
|
+
|
|
67
|
+
export const Timezone = {
|
|
68
|
+
InternationalDateLineWest: "International Date Line West",
|
|
69
|
+
MidwayIsland: "Midway Island",
|
|
70
|
+
AmericanSamoa: "American Samoa",
|
|
71
|
+
Hawaii: "Hawaii",
|
|
72
|
+
Alaska: "Alaska",
|
|
73
|
+
PacificTimeUSAndCanada: "Pacific Time (US & Canada)",
|
|
74
|
+
Tijuana: "Tijuana",
|
|
75
|
+
MountainTimeUSAndCanada: "Mountain Time (US & Canada)",
|
|
76
|
+
Arizona: "Arizona",
|
|
77
|
+
Chihuahua: "Chihuahua",
|
|
78
|
+
Mazatlan: "Mazatlan",
|
|
79
|
+
CentralTimeUSAndCanada: "Central Time (US & Canada)",
|
|
80
|
+
Saskatchewan: "Saskatchewan",
|
|
81
|
+
Guadalajara: "Guadalajara",
|
|
82
|
+
MexicoCity: "Mexico City",
|
|
83
|
+
Monterrey: "Monterrey",
|
|
84
|
+
CentralAmerica: "Central America",
|
|
85
|
+
EasternTimeUSAndCanada: "Eastern Time (US & Canada)",
|
|
86
|
+
IndianaEast: "Indiana (East)",
|
|
87
|
+
Bogota: "Bogota",
|
|
88
|
+
Lima: "Lima",
|
|
89
|
+
Quito: "Quito",
|
|
90
|
+
AtlanticTimeCanada: "Atlantic Time (Canada)",
|
|
91
|
+
Caracas: "Caracas",
|
|
92
|
+
LaPaz: "La Paz",
|
|
93
|
+
Santiago: "Santiago",
|
|
94
|
+
Newfoundland: "Newfoundland",
|
|
95
|
+
Brasilia: "Brasilia",
|
|
96
|
+
BuenosAires: "Buenos Aires",
|
|
97
|
+
Montevideo: "Montevideo",
|
|
98
|
+
Georgetown: "Georgetown",
|
|
99
|
+
PuertoRico: "Puerto Rico",
|
|
100
|
+
Greenland: "Greenland",
|
|
101
|
+
MidAtlantic: "Mid-Atlantic",
|
|
102
|
+
Azores: "Azores",
|
|
103
|
+
CapeVerdeIs: "Cape Verde Is.",
|
|
104
|
+
Dublin: "Dublin",
|
|
105
|
+
Edinburgh: "Edinburgh",
|
|
106
|
+
Lisbon: "Lisbon",
|
|
107
|
+
London: "London",
|
|
108
|
+
Casablanca: "Casablanca",
|
|
109
|
+
Monrovia: "Monrovia",
|
|
110
|
+
Utc: "UTC",
|
|
111
|
+
Belgrade: "Belgrade",
|
|
112
|
+
Bratislava: "Bratislava",
|
|
113
|
+
Budapest: "Budapest",
|
|
114
|
+
Ljubljana: "Ljubljana",
|
|
115
|
+
Prague: "Prague",
|
|
116
|
+
Sarajevo: "Sarajevo",
|
|
117
|
+
Skopje: "Skopje",
|
|
118
|
+
Warsaw: "Warsaw",
|
|
119
|
+
Zagreb: "Zagreb",
|
|
120
|
+
Brussels: "Brussels",
|
|
121
|
+
Copenhagen: "Copenhagen",
|
|
122
|
+
Madrid: "Madrid",
|
|
123
|
+
Paris: "Paris",
|
|
124
|
+
Amsterdam: "Amsterdam",
|
|
125
|
+
Berlin: "Berlin",
|
|
126
|
+
Bern: "Bern",
|
|
127
|
+
Zurich: "Zurich",
|
|
128
|
+
Rome: "Rome",
|
|
129
|
+
Stockholm: "Stockholm",
|
|
130
|
+
Vienna: "Vienna",
|
|
131
|
+
WestCentralAfrica: "West Central Africa",
|
|
132
|
+
Bucharest: "Bucharest",
|
|
133
|
+
Cairo: "Cairo",
|
|
134
|
+
Helsinki: "Helsinki",
|
|
135
|
+
Kyiv: "Kyiv",
|
|
136
|
+
Riga: "Riga",
|
|
137
|
+
Sofia: "Sofia",
|
|
138
|
+
Tallinn: "Tallinn",
|
|
139
|
+
Vilnius: "Vilnius",
|
|
140
|
+
Athens: "Athens",
|
|
141
|
+
Istanbul: "Istanbul",
|
|
142
|
+
Minsk: "Minsk",
|
|
143
|
+
Jerusalem: "Jerusalem",
|
|
144
|
+
Harare: "Harare",
|
|
145
|
+
Pretoria: "Pretoria",
|
|
146
|
+
Kaliningrad: "Kaliningrad",
|
|
147
|
+
Moscow: "Moscow",
|
|
148
|
+
StPetersburg: "St. Petersburg",
|
|
149
|
+
Volgograd: "Volgograd",
|
|
150
|
+
Samara: "Samara",
|
|
151
|
+
Kuwait: "Kuwait",
|
|
152
|
+
Riyadh: "Riyadh",
|
|
153
|
+
Nairobi: "Nairobi",
|
|
154
|
+
Baghdad: "Baghdad",
|
|
155
|
+
Tehran: "Tehran",
|
|
156
|
+
AbuDhabi: "Abu Dhabi",
|
|
157
|
+
Muscat: "Muscat",
|
|
158
|
+
Baku: "Baku",
|
|
159
|
+
Tbilisi: "Tbilisi",
|
|
160
|
+
Yerevan: "Yerevan",
|
|
161
|
+
Kabul: "Kabul",
|
|
162
|
+
Ekaterinburg: "Ekaterinburg",
|
|
163
|
+
Islamabad: "Islamabad",
|
|
164
|
+
Karachi: "Karachi",
|
|
165
|
+
Tashkent: "Tashkent",
|
|
166
|
+
Chennai: "Chennai",
|
|
167
|
+
Kolkata: "Kolkata",
|
|
168
|
+
Mumbai: "Mumbai",
|
|
169
|
+
NewDelhi: "New Delhi",
|
|
170
|
+
Kathmandu: "Kathmandu",
|
|
171
|
+
Astana: "Astana",
|
|
172
|
+
Dhaka: "Dhaka",
|
|
173
|
+
SriJayawardenepura: "Sri Jayawardenepura",
|
|
174
|
+
Almaty: "Almaty",
|
|
175
|
+
Novosibirsk: "Novosibirsk",
|
|
176
|
+
Rangoon: "Rangoon",
|
|
177
|
+
Bangkok: "Bangkok",
|
|
178
|
+
Hanoi: "Hanoi",
|
|
179
|
+
Jakarta: "Jakarta",
|
|
180
|
+
Krasnoyarsk: "Krasnoyarsk",
|
|
181
|
+
Beijing: "Beijing",
|
|
182
|
+
Chongqing: "Chongqing",
|
|
183
|
+
HongKong: "Hong Kong",
|
|
184
|
+
Urumqi: "Urumqi",
|
|
185
|
+
KualaLumpur: "Kuala Lumpur",
|
|
186
|
+
Singapore: "Singapore",
|
|
187
|
+
Taipei: "Taipei",
|
|
188
|
+
Perth: "Perth",
|
|
189
|
+
Irkutsk: "Irkutsk",
|
|
190
|
+
Ulaanbaatar: "Ulaanbaatar",
|
|
191
|
+
Seoul: "Seoul",
|
|
192
|
+
Osaka: "Osaka",
|
|
193
|
+
Sapporo: "Sapporo",
|
|
194
|
+
Tokyo: "Tokyo",
|
|
195
|
+
Yakutsk: "Yakutsk",
|
|
196
|
+
Darwin: "Darwin",
|
|
197
|
+
Adelaide: "Adelaide",
|
|
198
|
+
Canberra: "Canberra",
|
|
199
|
+
Melbourne: "Melbourne",
|
|
200
|
+
Sydney: "Sydney",
|
|
201
|
+
Brisbane: "Brisbane",
|
|
202
|
+
Hobart: "Hobart",
|
|
203
|
+
Vladivostok: "Vladivostok",
|
|
204
|
+
Guam: "Guam",
|
|
205
|
+
PortMoresby: "Port Moresby",
|
|
206
|
+
Magadan: "Magadan",
|
|
207
|
+
Srednekolymsk: "Srednekolymsk",
|
|
208
|
+
SolomonIs: "Solomon Is.",
|
|
209
|
+
NewCaledonia: "New Caledonia",
|
|
210
|
+
Fiji: "Fiji",
|
|
211
|
+
Kamchatka: "Kamchatka",
|
|
212
|
+
MarshallIs: "Marshall Is.",
|
|
213
|
+
Auckland: "Auckland",
|
|
214
|
+
Wellington: "Wellington",
|
|
215
|
+
NukuAlofa: "Nuku'alofa",
|
|
216
|
+
TokelauIs: "Tokelau Is.",
|
|
217
|
+
ChathamIs: "Chatham Is.",
|
|
218
|
+
Samoa: "Samoa",
|
|
219
|
+
} as const;
|
|
220
|
+
export type Timezone = ClosedEnum<typeof Timezone>;
|
|
221
|
+
|
|
10
222
|
/**
|
|
11
223
|
* Reduced list of attributes of the User Location
|
|
12
224
|
*/
|
|
@@ -15,11 +227,54 @@ export type UserLocation = {
|
|
|
15
227
|
address1?: string | null | undefined;
|
|
16
228
|
address2?: string | null | undefined;
|
|
17
229
|
city?: string | null | undefined;
|
|
18
|
-
state?:
|
|
230
|
+
state?: State | null | undefined;
|
|
19
231
|
zip?: string | null | undefined;
|
|
232
|
+
phone?: string | null | undefined;
|
|
233
|
+
mobilePhone?: string | null | undefined;
|
|
234
|
+
fax?: string | null | undefined;
|
|
20
235
|
country?: string | null | undefined;
|
|
236
|
+
timezone?: Timezone | null | undefined;
|
|
21
237
|
};
|
|
22
238
|
|
|
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
|
+
/** @internal */
|
|
260
|
+
export const Timezone$inboundSchema: z.ZodNativeEnum<typeof Timezone> = z
|
|
261
|
+
.nativeEnum(Timezone);
|
|
262
|
+
|
|
263
|
+
/** @internal */
|
|
264
|
+
export const Timezone$outboundSchema: z.ZodNativeEnum<typeof Timezone> =
|
|
265
|
+
Timezone$inboundSchema;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* @internal
|
|
269
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
270
|
+
*/
|
|
271
|
+
export namespace Timezone$ {
|
|
272
|
+
/** @deprecated use `Timezone$inboundSchema` instead. */
|
|
273
|
+
export const inboundSchema = Timezone$inboundSchema;
|
|
274
|
+
/** @deprecated use `Timezone$outboundSchema` instead. */
|
|
275
|
+
export const outboundSchema = Timezone$outboundSchema;
|
|
276
|
+
}
|
|
277
|
+
|
|
23
278
|
/** @internal */
|
|
24
279
|
export const UserLocation$inboundSchema: z.ZodType<
|
|
25
280
|
UserLocation,
|
|
@@ -30,9 +285,17 @@ export const UserLocation$inboundSchema: z.ZodType<
|
|
|
30
285
|
address1: z.nullable(z.string()).optional(),
|
|
31
286
|
address2: z.nullable(z.string()).optional(),
|
|
32
287
|
city: z.nullable(z.string()).optional(),
|
|
33
|
-
state: z.nullable(
|
|
288
|
+
state: z.nullable(State$inboundSchema).optional(),
|
|
34
289
|
zip: z.nullable(z.string()).optional(),
|
|
290
|
+
phone: z.nullable(z.string()).optional(),
|
|
291
|
+
mobile_phone: z.nullable(z.string()).optional(),
|
|
292
|
+
fax: z.nullable(z.string()).optional(),
|
|
35
293
|
country: z.nullable(z.string()).optional(),
|
|
294
|
+
timezone: z.nullable(Timezone$inboundSchema).optional(),
|
|
295
|
+
}).transform((v) => {
|
|
296
|
+
return remap$(v, {
|
|
297
|
+
"mobile_phone": "mobilePhone",
|
|
298
|
+
});
|
|
36
299
|
});
|
|
37
300
|
|
|
38
301
|
/** @internal */
|
|
@@ -43,7 +306,11 @@ export type UserLocation$Outbound = {
|
|
|
43
306
|
city?: string | null | undefined;
|
|
44
307
|
state?: string | null | undefined;
|
|
45
308
|
zip?: string | null | undefined;
|
|
309
|
+
phone?: string | null | undefined;
|
|
310
|
+
mobile_phone?: string | null | undefined;
|
|
311
|
+
fax?: string | null | undefined;
|
|
46
312
|
country?: string | null | undefined;
|
|
313
|
+
timezone?: string | null | undefined;
|
|
47
314
|
};
|
|
48
315
|
|
|
49
316
|
/** @internal */
|
|
@@ -56,9 +323,17 @@ export const UserLocation$outboundSchema: z.ZodType<
|
|
|
56
323
|
address1: z.nullable(z.string()).optional(),
|
|
57
324
|
address2: z.nullable(z.string()).optional(),
|
|
58
325
|
city: z.nullable(z.string()).optional(),
|
|
59
|
-
state: z.nullable(
|
|
326
|
+
state: z.nullable(State$outboundSchema).optional(),
|
|
60
327
|
zip: z.nullable(z.string()).optional(),
|
|
328
|
+
phone: z.nullable(z.string()).optional(),
|
|
329
|
+
mobilePhone: z.nullable(z.string()).optional(),
|
|
330
|
+
fax: z.nullable(z.string()).optional(),
|
|
61
331
|
country: z.nullable(z.string()).optional(),
|
|
332
|
+
timezone: z.nullable(Timezone$outboundSchema).optional(),
|
|
333
|
+
}).transform((v) => {
|
|
334
|
+
return remap$(v, {
|
|
335
|
+
mobilePhone: "mobile_phone",
|
|
336
|
+
});
|
|
62
337
|
});
|
|
63
338
|
|
|
64
339
|
/**
|
|
@@ -30,6 +30,7 @@ export * from "./logsuserintothesystem.js";
|
|
|
30
30
|
export * from "./magiclink.js";
|
|
31
31
|
export * from "./password.js";
|
|
32
32
|
export * from "./passwordresetrequest.js";
|
|
33
|
+
export * from "./updatevendordetails.js";
|
|
33
34
|
export * from "./updatevendormanagedbycompany.js";
|
|
34
35
|
export * from "./updatevendorscrubdetails.js";
|
|
35
36
|
export * from "./vendorscanout.js";
|
|
@@ -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";
|
|
@@ -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
|
*
|