@greensecurity/javascript-sdk 0.30.46 → 0.30.48
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/bin/mcp-server.js +86 -39
- package/bin/mcp-server.js.map +13 -12
- package/dist/commonjs/__tests__/vendormanagedbycompanies.test.js +1 -1
- package/dist/commonjs/__tests__/vendors.test.js +1 -1
- package/dist/commonjs/__tests__/vendors.test.js.map +1 -1
- package/dist/commonjs/__tests__/webhooks.test.js +1 -1
- package/dist/commonjs/__tests__/zones.test.js +3 -83
- package/dist/commonjs/__tests__/zones.test.js.map +1 -1
- 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.js +1 -1
- package/dist/commonjs/models/components/credential.d.ts +4 -0
- package/dist/commonjs/models/components/credential.d.ts.map +1 -1
- package/dist/commonjs/models/components/credential.js +8 -0
- package/dist/commonjs/models/components/credential.js.map +1 -1
- 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/invoice.d.ts +2 -2
- package/dist/commonjs/models/components/invoice.js +2 -2
- package/dist/commonjs/models/components/invoiceitem.d.ts +52 -4
- package/dist/commonjs/models/components/invoiceitem.d.ts.map +1 -1
- package/dist/commonjs/models/components/invoiceitem.js +60 -9
- package/dist/commonjs/models/components/invoiceitem.js.map +1 -1
- package/dist/commonjs/models/components/product.d.ts +36 -0
- package/dist/commonjs/models/components/product.d.ts.map +1 -0
- package/dist/commonjs/models/components/product.js +73 -0
- package/dist/commonjs/models/components/product.js.map +1 -0
- package/dist/commonjs/models/components/vendorcredentialsummary.d.ts +2 -0
- package/dist/commonjs/models/components/vendorcredentialsummary.d.ts.map +1 -1
- package/dist/commonjs/models/components/vendorcredentialsummary.js +4 -0
- package/dist/commonjs/models/components/vendorcredentialsummary.js.map +1 -1
- package/dist/esm/__tests__/vendormanagedbycompanies.test.js +1 -1
- package/dist/esm/__tests__/vendors.test.js +1 -1
- package/dist/esm/__tests__/vendors.test.js.map +1 -1
- package/dist/esm/__tests__/webhooks.test.js +1 -1
- package/dist/esm/__tests__/zones.test.js +3 -83
- package/dist/esm/__tests__/zones.test.js.map +1 -1
- 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.js +1 -1
- package/dist/esm/models/components/credential.d.ts +4 -0
- package/dist/esm/models/components/credential.d.ts.map +1 -1
- package/dist/esm/models/components/credential.js +8 -0
- package/dist/esm/models/components/credential.js.map +1 -1
- 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/invoice.d.ts +2 -2
- package/dist/esm/models/components/invoice.js +2 -2
- package/dist/esm/models/components/invoiceitem.d.ts +52 -4
- package/dist/esm/models/components/invoiceitem.d.ts.map +1 -1
- package/dist/esm/models/components/invoiceitem.js +55 -8
- package/dist/esm/models/components/invoiceitem.js.map +1 -1
- package/dist/esm/models/components/product.d.ts +36 -0
- package/dist/esm/models/components/product.d.ts.map +1 -0
- package/dist/esm/models/components/product.js +35 -0
- package/dist/esm/models/components/product.js.map +1 -0
- package/dist/esm/models/components/vendorcredentialsummary.d.ts +2 -0
- package/dist/esm/models/components/vendorcredentialsummary.d.ts.map +1 -1
- package/dist/esm/models/components/vendorcredentialsummary.js +4 -0
- package/dist/esm/models/components/vendorcredentialsummary.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 +1 -1
- package/src/__tests__/webhooks.test.ts +1 -1
- package/src/__tests__/zones.test.ts +3 -83
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/models/components/credential.ts +12 -0
- package/src/models/components/index.ts +1 -0
- package/src/models/components/invoice.ts +4 -4
- package/src/models/components/invoiceitem.ts +126 -12
- package/src/models/components/product.ts +70 -0
- package/src/models/components/vendorcredentialsummary.ts +6 -0
|
@@ -36,90 +36,10 @@ test("Zones List Or Search Security Zones", async () => {
|
|
|
36
36
|
},
|
|
37
37
|
items: [
|
|
38
38
|
{
|
|
39
|
-
facility: {
|
|
40
|
-
contacts: {
|
|
41
|
-
contact: {
|
|
42
|
-
status: "Inactive",
|
|
43
|
-
department: {
|
|
44
|
-
id: 228090,
|
|
45
|
-
name: "<value>",
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
adminContact: {
|
|
49
|
-
status: "Deleted",
|
|
50
|
-
department: {
|
|
51
|
-
id: 903717,
|
|
52
|
-
name: "<value>",
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
techContact: {
|
|
56
|
-
status: "Active",
|
|
57
|
-
department: {
|
|
58
|
-
id: 640172,
|
|
59
|
-
name: "<value>",
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
greenSecurityCsm: {
|
|
63
|
-
status: "Active",
|
|
64
|
-
department: {
|
|
65
|
-
id: 588866,
|
|
66
|
-
name: "<value>",
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
accountManager: {
|
|
70
|
-
status: "Inactive",
|
|
71
|
-
department: {
|
|
72
|
-
id: 562911,
|
|
73
|
-
name: "<value>",
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
vendorGuestPolicy: {
|
|
78
|
-
enabled: false,
|
|
79
|
-
vendorGuestLimitAndOr: "or",
|
|
80
|
-
vendorGuestRequireEmail: false,
|
|
81
|
-
},
|
|
82
|
-
},
|
|
39
|
+
facility: {},
|
|
83
40
|
},
|
|
84
41
|
{
|
|
85
|
-
facility: {
|
|
86
|
-
contacts: {
|
|
87
|
-
contact: {
|
|
88
|
-
status: "Deleted",
|
|
89
|
-
department: {
|
|
90
|
-
id: 249112,
|
|
91
|
-
name: "<value>",
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
adminContact: {
|
|
95
|
-
status: "Inactive",
|
|
96
|
-
department: 123,
|
|
97
|
-
},
|
|
98
|
-
techContact: {
|
|
99
|
-
status: "Inactive",
|
|
100
|
-
department: 123,
|
|
101
|
-
},
|
|
102
|
-
greenSecurityCsm: {
|
|
103
|
-
status: "Deleted",
|
|
104
|
-
department: {
|
|
105
|
-
id: 951404,
|
|
106
|
-
name: "<value>",
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
accountManager: {
|
|
110
|
-
status: "Inactive",
|
|
111
|
-
department: {
|
|
112
|
-
id: 545767,
|
|
113
|
-
name: "<value>",
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
vendorGuestPolicy: {
|
|
118
|
-
enabled: false,
|
|
119
|
-
vendorGuestLimitAndOr: "or",
|
|
120
|
-
vendorGuestRequireEmail: false,
|
|
121
|
-
},
|
|
122
|
-
},
|
|
42
|
+
facility: {},
|
|
123
43
|
},
|
|
124
44
|
],
|
|
125
45
|
});
|
|
@@ -137,7 +57,7 @@ test("Zones Security Zone Checkin", async () => {
|
|
|
137
57
|
});
|
|
138
58
|
|
|
139
59
|
const result = await greenSecurity.zones.securityZoneCheckin({
|
|
140
|
-
zoneId:
|
|
60
|
+
zoneId: 746367,
|
|
141
61
|
longitude: "<value>",
|
|
142
62
|
latitude: "<value>",
|
|
143
63
|
});
|
package/src/lib/config.ts
CHANGED
|
@@ -72,8 +72,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
72
72
|
export const SDK_METADATA = {
|
|
73
73
|
language: "typescript",
|
|
74
74
|
openapiDocVersion: "0.0.3",
|
|
75
|
-
sdkVersion: "0.30.
|
|
76
|
-
genVersion: "2.604.
|
|
75
|
+
sdkVersion: "0.30.48",
|
|
76
|
+
genVersion: "2.604.4",
|
|
77
77
|
userAgent:
|
|
78
|
-
"speakeasy-sdk/typescript 0.30.
|
|
78
|
+
"speakeasy-sdk/typescript 0.30.48 2.604.4 0.0.3 @greensecurity/javascript-sdk",
|
|
79
79
|
} as const;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -50,6 +50,8 @@ export type Credential = {
|
|
|
50
50
|
credentialType?: CredentialType | undefined;
|
|
51
51
|
validFor?: ValidFor | undefined;
|
|
52
52
|
status?: CredentialStatus1 | undefined;
|
|
53
|
+
hasPricing?: boolean | undefined;
|
|
54
|
+
allowDecline?: boolean | undefined;
|
|
53
55
|
jsSchema?: string | null | undefined;
|
|
54
56
|
uiSchema?: string | null | undefined;
|
|
55
57
|
behavior?: string | null | undefined;
|
|
@@ -131,6 +133,8 @@ export const Credential$inboundSchema: z.ZodType<
|
|
|
131
133
|
credential_type: CredentialType$inboundSchema.optional(),
|
|
132
134
|
valid_for: ValidFor$inboundSchema.optional(),
|
|
133
135
|
status: CredentialStatus1$inboundSchema.optional(),
|
|
136
|
+
has_pricing: z.boolean().optional(),
|
|
137
|
+
allow_decline: z.boolean().optional(),
|
|
134
138
|
js_schema: z.nullable(z.string()).optional(),
|
|
135
139
|
ui_schema: z.nullable(z.string()).optional(),
|
|
136
140
|
behavior: z.nullable(z.string()).optional(),
|
|
@@ -143,6 +147,8 @@ export const Credential$inboundSchema: z.ZodType<
|
|
|
143
147
|
return remap$(v, {
|
|
144
148
|
"credential_type": "credentialType",
|
|
145
149
|
"valid_for": "validFor",
|
|
150
|
+
"has_pricing": "hasPricing",
|
|
151
|
+
"allow_decline": "allowDecline",
|
|
146
152
|
"js_schema": "jsSchema",
|
|
147
153
|
"ui_schema": "uiSchema",
|
|
148
154
|
"credential_documents": "credentialDocuments",
|
|
@@ -159,6 +165,8 @@ export type Credential$Outbound = {
|
|
|
159
165
|
credential_type?: string | undefined;
|
|
160
166
|
valid_for?: string | undefined;
|
|
161
167
|
status?: string | undefined;
|
|
168
|
+
has_pricing?: boolean | undefined;
|
|
169
|
+
allow_decline?: boolean | undefined;
|
|
162
170
|
js_schema?: string | null | undefined;
|
|
163
171
|
ui_schema?: string | null | undefined;
|
|
164
172
|
behavior?: string | null | undefined;
|
|
@@ -179,6 +187,8 @@ export const Credential$outboundSchema: z.ZodType<
|
|
|
179
187
|
credentialType: CredentialType$outboundSchema.optional(),
|
|
180
188
|
validFor: ValidFor$outboundSchema.optional(),
|
|
181
189
|
status: CredentialStatus1$outboundSchema.optional(),
|
|
190
|
+
hasPricing: z.boolean().optional(),
|
|
191
|
+
allowDecline: z.boolean().optional(),
|
|
182
192
|
jsSchema: z.nullable(z.string()).optional(),
|
|
183
193
|
uiSchema: z.nullable(z.string()).optional(),
|
|
184
194
|
behavior: z.nullable(z.string()).optional(),
|
|
@@ -191,6 +201,8 @@ export const Credential$outboundSchema: z.ZodType<
|
|
|
191
201
|
return remap$(v, {
|
|
192
202
|
credentialType: "credential_type",
|
|
193
203
|
validFor: "valid_for",
|
|
204
|
+
hasPricing: "has_pricing",
|
|
205
|
+
allowDecline: "allow_decline",
|
|
194
206
|
jsSchema: "js_schema",
|
|
195
207
|
uiSchema: "ui_schema",
|
|
196
208
|
credentialDocuments: "credential_documents",
|
|
@@ -27,6 +27,7 @@ export * from "./loginrequirementsfromemail.js";
|
|
|
27
27
|
export * from "./mfarequiredresponse.js";
|
|
28
28
|
export * from "./pager.js";
|
|
29
29
|
export * from "./passwordrequiredresponse.js";
|
|
30
|
+
export * from "./product.js";
|
|
30
31
|
export * from "./productvariant.js";
|
|
31
32
|
export * from "./samlloginrequiredresponse.js";
|
|
32
33
|
export * from "./scantype.js";
|
|
@@ -35,7 +35,7 @@ export type Invoice = {
|
|
|
35
35
|
convenienceFee?: number | null | undefined;
|
|
36
36
|
shipping?: number | null | undefined;
|
|
37
37
|
discount?: number | undefined;
|
|
38
|
-
|
|
38
|
+
lines?: Array<InvoiceItem> | null | undefined;
|
|
39
39
|
transactions?: Array<InvoiceTransaction> | null | undefined;
|
|
40
40
|
};
|
|
41
41
|
|
|
@@ -53,7 +53,7 @@ export const Invoice$inboundSchema: z.ZodType<Invoice, z.ZodTypeDef, unknown> =
|
|
|
53
53
|
convenience_fee: z.nullable(z.number()).optional(),
|
|
54
54
|
shipping: z.nullable(z.number().int()).optional(),
|
|
55
55
|
discount: z.number().int().optional(),
|
|
56
|
-
|
|
56
|
+
lines: z.nullable(z.array(InvoiceItem$inboundSchema)).optional(),
|
|
57
57
|
transactions: z.nullable(z.array(InvoiceTransaction$inboundSchema))
|
|
58
58
|
.optional(),
|
|
59
59
|
}).transform((v) => {
|
|
@@ -79,7 +79,7 @@ export type Invoice$Outbound = {
|
|
|
79
79
|
convenience_fee?: number | null | undefined;
|
|
80
80
|
shipping?: number | null | undefined;
|
|
81
81
|
discount?: number | undefined;
|
|
82
|
-
|
|
82
|
+
lines?: Array<InvoiceItem$Outbound> | null | undefined;
|
|
83
83
|
transactions?: Array<InvoiceTransaction$Outbound> | null | undefined;
|
|
84
84
|
};
|
|
85
85
|
|
|
@@ -100,7 +100,7 @@ export const Invoice$outboundSchema: z.ZodType<
|
|
|
100
100
|
convenienceFee: z.nullable(z.number()).optional(),
|
|
101
101
|
shipping: z.nullable(z.number().int()).optional(),
|
|
102
102
|
discount: z.number().int().optional(),
|
|
103
|
-
|
|
103
|
+
lines: z.nullable(z.array(InvoiceItem$outboundSchema)).optional(),
|
|
104
104
|
transactions: z.nullable(z.array(InvoiceTransaction$outboundSchema))
|
|
105
105
|
.optional(),
|
|
106
106
|
}).transform((v) => {
|
|
@@ -7,60 +7,171 @@ import { remap as remap$ } from "../../lib/primitives.js";
|
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
8
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
9
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
Product,
|
|
12
|
+
Product$inboundSchema,
|
|
13
|
+
Product$Outbound,
|
|
14
|
+
Product$outboundSchema,
|
|
15
|
+
} from "./product.js";
|
|
16
|
+
import {
|
|
17
|
+
ProductVariant,
|
|
18
|
+
ProductVariant$inboundSchema,
|
|
19
|
+
ProductVariant$Outbound,
|
|
20
|
+
ProductVariant$outboundSchema,
|
|
21
|
+
} from "./productvariant.js";
|
|
22
|
+
|
|
23
|
+
export type Variant = ProductVariant | number;
|
|
24
|
+
|
|
25
|
+
export type InvoiceItemProduct = Product | number;
|
|
10
26
|
|
|
11
27
|
/**
|
|
12
28
|
* Reduced list of attributes of the Invoice line item record
|
|
13
29
|
*/
|
|
14
30
|
export type InvoiceItem = {
|
|
15
|
-
|
|
31
|
+
id?: number | undefined;
|
|
16
32
|
dateStarts?: string | null | undefined;
|
|
17
33
|
dateEnds?: string | null | undefined;
|
|
18
34
|
isSubscription?: boolean | null | undefined;
|
|
19
35
|
productTitle?: string | null | undefined;
|
|
20
|
-
|
|
36
|
+
title?: string | null | undefined;
|
|
21
37
|
quantity?: number | null | undefined;
|
|
22
38
|
unitPrice?: number | null | undefined;
|
|
23
39
|
subtotal?: number | null | undefined;
|
|
40
|
+
variant?: ProductVariant | number | null | undefined;
|
|
41
|
+
product?: Product | number | null | undefined;
|
|
24
42
|
};
|
|
25
43
|
|
|
44
|
+
/** @internal */
|
|
45
|
+
export const Variant$inboundSchema: z.ZodType<Variant, z.ZodTypeDef, unknown> =
|
|
46
|
+
z.union([ProductVariant$inboundSchema, z.number().int()]);
|
|
47
|
+
|
|
48
|
+
/** @internal */
|
|
49
|
+
export type Variant$Outbound = ProductVariant$Outbound | number;
|
|
50
|
+
|
|
51
|
+
/** @internal */
|
|
52
|
+
export const Variant$outboundSchema: z.ZodType<
|
|
53
|
+
Variant$Outbound,
|
|
54
|
+
z.ZodTypeDef,
|
|
55
|
+
Variant
|
|
56
|
+
> = z.union([ProductVariant$outboundSchema, z.number().int()]);
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @internal
|
|
60
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
61
|
+
*/
|
|
62
|
+
export namespace Variant$ {
|
|
63
|
+
/** @deprecated use `Variant$inboundSchema` instead. */
|
|
64
|
+
export const inboundSchema = Variant$inboundSchema;
|
|
65
|
+
/** @deprecated use `Variant$outboundSchema` instead. */
|
|
66
|
+
export const outboundSchema = Variant$outboundSchema;
|
|
67
|
+
/** @deprecated use `Variant$Outbound` instead. */
|
|
68
|
+
export type Outbound = Variant$Outbound;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function variantToJSON(variant: Variant): string {
|
|
72
|
+
return JSON.stringify(Variant$outboundSchema.parse(variant));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function variantFromJSON(
|
|
76
|
+
jsonString: string,
|
|
77
|
+
): SafeParseResult<Variant, SDKValidationError> {
|
|
78
|
+
return safeParse(
|
|
79
|
+
jsonString,
|
|
80
|
+
(x) => Variant$inboundSchema.parse(JSON.parse(x)),
|
|
81
|
+
`Failed to parse 'Variant' from JSON`,
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** @internal */
|
|
86
|
+
export const InvoiceItemProduct$inboundSchema: z.ZodType<
|
|
87
|
+
InvoiceItemProduct,
|
|
88
|
+
z.ZodTypeDef,
|
|
89
|
+
unknown
|
|
90
|
+
> = z.union([Product$inboundSchema, z.number().int()]);
|
|
91
|
+
|
|
92
|
+
/** @internal */
|
|
93
|
+
export type InvoiceItemProduct$Outbound = Product$Outbound | number;
|
|
94
|
+
|
|
95
|
+
/** @internal */
|
|
96
|
+
export const InvoiceItemProduct$outboundSchema: z.ZodType<
|
|
97
|
+
InvoiceItemProduct$Outbound,
|
|
98
|
+
z.ZodTypeDef,
|
|
99
|
+
InvoiceItemProduct
|
|
100
|
+
> = z.union([Product$outboundSchema, z.number().int()]);
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* @internal
|
|
104
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
105
|
+
*/
|
|
106
|
+
export namespace InvoiceItemProduct$ {
|
|
107
|
+
/** @deprecated use `InvoiceItemProduct$inboundSchema` instead. */
|
|
108
|
+
export const inboundSchema = InvoiceItemProduct$inboundSchema;
|
|
109
|
+
/** @deprecated use `InvoiceItemProduct$outboundSchema` instead. */
|
|
110
|
+
export const outboundSchema = InvoiceItemProduct$outboundSchema;
|
|
111
|
+
/** @deprecated use `InvoiceItemProduct$Outbound` instead. */
|
|
112
|
+
export type Outbound = InvoiceItemProduct$Outbound;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export function invoiceItemProductToJSON(
|
|
116
|
+
invoiceItemProduct: InvoiceItemProduct,
|
|
117
|
+
): string {
|
|
118
|
+
return JSON.stringify(
|
|
119
|
+
InvoiceItemProduct$outboundSchema.parse(invoiceItemProduct),
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export function invoiceItemProductFromJSON(
|
|
124
|
+
jsonString: string,
|
|
125
|
+
): SafeParseResult<InvoiceItemProduct, SDKValidationError> {
|
|
126
|
+
return safeParse(
|
|
127
|
+
jsonString,
|
|
128
|
+
(x) => InvoiceItemProduct$inboundSchema.parse(JSON.parse(x)),
|
|
129
|
+
`Failed to parse 'InvoiceItemProduct' from JSON`,
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
26
133
|
/** @internal */
|
|
27
134
|
export const InvoiceItem$inboundSchema: z.ZodType<
|
|
28
135
|
InvoiceItem,
|
|
29
136
|
z.ZodTypeDef,
|
|
30
137
|
unknown
|
|
31
138
|
> = z.object({
|
|
32
|
-
|
|
139
|
+
id: z.number().int().optional(),
|
|
33
140
|
date_starts: z.nullable(z.string()).optional(),
|
|
34
141
|
date_ends: z.nullable(z.string()).optional(),
|
|
35
142
|
is_subscription: z.nullable(z.boolean()).optional(),
|
|
36
143
|
product_title: z.nullable(z.string()).optional(),
|
|
37
|
-
|
|
144
|
+
title: z.nullable(z.string()).optional(),
|
|
38
145
|
quantity: z.nullable(z.number()).optional(),
|
|
39
146
|
unit_price: z.nullable(z.number().int()).optional(),
|
|
40
147
|
subtotal: z.nullable(z.number().int()).optional(),
|
|
148
|
+
variant: z.nullable(z.union([ProductVariant$inboundSchema, z.number().int()]))
|
|
149
|
+
.optional(),
|
|
150
|
+
product: z.nullable(z.union([Product$inboundSchema, z.number().int()]))
|
|
151
|
+
.optional(),
|
|
41
152
|
}).transform((v) => {
|
|
42
153
|
return remap$(v, {
|
|
43
|
-
"item_id": "itemId",
|
|
44
154
|
"date_starts": "dateStarts",
|
|
45
155
|
"date_ends": "dateEnds",
|
|
46
156
|
"is_subscription": "isSubscription",
|
|
47
157
|
"product_title": "productTitle",
|
|
48
|
-
"item_title": "itemTitle",
|
|
49
158
|
"unit_price": "unitPrice",
|
|
50
159
|
});
|
|
51
160
|
});
|
|
52
161
|
|
|
53
162
|
/** @internal */
|
|
54
163
|
export type InvoiceItem$Outbound = {
|
|
55
|
-
|
|
164
|
+
id?: number | undefined;
|
|
56
165
|
date_starts?: string | null | undefined;
|
|
57
166
|
date_ends?: string | null | undefined;
|
|
58
167
|
is_subscription?: boolean | null | undefined;
|
|
59
168
|
product_title?: string | null | undefined;
|
|
60
|
-
|
|
169
|
+
title?: string | null | undefined;
|
|
61
170
|
quantity?: number | null | undefined;
|
|
62
171
|
unit_price?: number | null | undefined;
|
|
63
172
|
subtotal?: number | null | undefined;
|
|
173
|
+
variant?: ProductVariant$Outbound | number | null | undefined;
|
|
174
|
+
product?: Product$Outbound | number | null | undefined;
|
|
64
175
|
};
|
|
65
176
|
|
|
66
177
|
/** @internal */
|
|
@@ -69,23 +180,26 @@ export const InvoiceItem$outboundSchema: z.ZodType<
|
|
|
69
180
|
z.ZodTypeDef,
|
|
70
181
|
InvoiceItem
|
|
71
182
|
> = z.object({
|
|
72
|
-
|
|
183
|
+
id: z.number().int().optional(),
|
|
73
184
|
dateStarts: z.nullable(z.string()).optional(),
|
|
74
185
|
dateEnds: z.nullable(z.string()).optional(),
|
|
75
186
|
isSubscription: z.nullable(z.boolean()).optional(),
|
|
76
187
|
productTitle: z.nullable(z.string()).optional(),
|
|
77
|
-
|
|
188
|
+
title: z.nullable(z.string()).optional(),
|
|
78
189
|
quantity: z.nullable(z.number()).optional(),
|
|
79
190
|
unitPrice: z.nullable(z.number().int()).optional(),
|
|
80
191
|
subtotal: z.nullable(z.number().int()).optional(),
|
|
192
|
+
variant: z.nullable(
|
|
193
|
+
z.union([ProductVariant$outboundSchema, z.number().int()]),
|
|
194
|
+
).optional(),
|
|
195
|
+
product: z.nullable(z.union([Product$outboundSchema, z.number().int()]))
|
|
196
|
+
.optional(),
|
|
81
197
|
}).transform((v) => {
|
|
82
198
|
return remap$(v, {
|
|
83
|
-
itemId: "item_id",
|
|
84
199
|
dateStarts: "date_starts",
|
|
85
200
|
dateEnds: "date_ends",
|
|
86
201
|
isSubscription: "is_subscription",
|
|
87
202
|
productTitle: "product_title",
|
|
88
|
-
itemTitle: "item_title",
|
|
89
203
|
unitPrice: "unit_price",
|
|
90
204
|
});
|
|
91
205
|
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Reduced list of attributes of Product record
|
|
12
|
+
*/
|
|
13
|
+
export type Product = {
|
|
14
|
+
id?: number | undefined;
|
|
15
|
+
title?: string | null | undefined;
|
|
16
|
+
description?: string | null | undefined;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const Product$inboundSchema: z.ZodType<Product, z.ZodTypeDef, unknown> =
|
|
21
|
+
z.object({
|
|
22
|
+
id: z.number().int().optional(),
|
|
23
|
+
title: z.nullable(z.string()).optional(),
|
|
24
|
+
description: z.nullable(z.string()).optional(),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
/** @internal */
|
|
28
|
+
export type Product$Outbound = {
|
|
29
|
+
id?: number | undefined;
|
|
30
|
+
title?: string | null | undefined;
|
|
31
|
+
description?: string | null | undefined;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const Product$outboundSchema: z.ZodType<
|
|
36
|
+
Product$Outbound,
|
|
37
|
+
z.ZodTypeDef,
|
|
38
|
+
Product
|
|
39
|
+
> = z.object({
|
|
40
|
+
id: z.number().int().optional(),
|
|
41
|
+
title: z.nullable(z.string()).optional(),
|
|
42
|
+
description: z.nullable(z.string()).optional(),
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @internal
|
|
47
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
48
|
+
*/
|
|
49
|
+
export namespace Product$ {
|
|
50
|
+
/** @deprecated use `Product$inboundSchema` instead. */
|
|
51
|
+
export const inboundSchema = Product$inboundSchema;
|
|
52
|
+
/** @deprecated use `Product$outboundSchema` instead. */
|
|
53
|
+
export const outboundSchema = Product$outboundSchema;
|
|
54
|
+
/** @deprecated use `Product$Outbound` instead. */
|
|
55
|
+
export type Outbound = Product$Outbound;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function productToJSON(product: Product): string {
|
|
59
|
+
return JSON.stringify(Product$outboundSchema.parse(product));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function productFromJSON(
|
|
63
|
+
jsonString: string,
|
|
64
|
+
): SafeParseResult<Product, SDKValidationError> {
|
|
65
|
+
return safeParse(
|
|
66
|
+
jsonString,
|
|
67
|
+
(x) => Product$inboundSchema.parse(JSON.parse(x)),
|
|
68
|
+
`Failed to parse 'Product' from JSON`,
|
|
69
|
+
);
|
|
70
|
+
}
|
|
@@ -87,6 +87,7 @@ export type VendorCredentialSummary = {
|
|
|
87
87
|
dateExpires?: string | null | undefined;
|
|
88
88
|
notes?: string | null | undefined;
|
|
89
89
|
expedited?: boolean | undefined;
|
|
90
|
+
jsonData?: string | null | undefined;
|
|
90
91
|
credential?: Credential | number | null | undefined;
|
|
91
92
|
vendor?: Vendor | number | null | undefined;
|
|
92
93
|
invoice?: Invoice | number | null | undefined;
|
|
@@ -433,6 +434,7 @@ export const VendorCredentialSummary$inboundSchema: z.ZodType<
|
|
|
433
434
|
date_expires: z.nullable(z.string()).optional(),
|
|
434
435
|
notes: z.nullable(z.string()).optional(),
|
|
435
436
|
expedited: z.boolean().optional(),
|
|
437
|
+
json_data: z.nullable(z.string()).optional(),
|
|
436
438
|
credential: z.nullable(z.union([Credential$inboundSchema, z.number().int()]))
|
|
437
439
|
.optional(),
|
|
438
440
|
vendor: z.nullable(z.union([Vendor$inboundSchema, z.number().int()]))
|
|
@@ -466,6 +468,7 @@ export const VendorCredentialSummary$inboundSchema: z.ZodType<
|
|
|
466
468
|
return remap$(v, {
|
|
467
469
|
"date_due": "dateDue",
|
|
468
470
|
"date_expires": "dateExpires",
|
|
471
|
+
"json_data": "jsonData",
|
|
469
472
|
"vendor_credential_files": "vendorCredentialFiles",
|
|
470
473
|
"latest_vendor_credential_id": "latestVendorCredentialId",
|
|
471
474
|
"previously_approved": "previouslyApproved",
|
|
@@ -490,6 +493,7 @@ export type VendorCredentialSummary$Outbound = {
|
|
|
490
493
|
date_expires?: string | null | undefined;
|
|
491
494
|
notes?: string | null | undefined;
|
|
492
495
|
expedited?: boolean | undefined;
|
|
496
|
+
json_data?: string | null | undefined;
|
|
493
497
|
credential?: Credential$Outbound | number | null | undefined;
|
|
494
498
|
vendor?: Vendor$Outbound | number | null | undefined;
|
|
495
499
|
invoice?: Invoice$Outbound | number | null | undefined;
|
|
@@ -528,6 +532,7 @@ export const VendorCredentialSummary$outboundSchema: z.ZodType<
|
|
|
528
532
|
dateExpires: z.nullable(z.string()).optional(),
|
|
529
533
|
notes: z.nullable(z.string()).optional(),
|
|
530
534
|
expedited: z.boolean().optional(),
|
|
535
|
+
jsonData: z.nullable(z.string()).optional(),
|
|
531
536
|
credential: z.nullable(z.union([Credential$outboundSchema, z.number().int()]))
|
|
532
537
|
.optional(),
|
|
533
538
|
vendor: z.nullable(z.union([Vendor$outboundSchema, z.number().int()]))
|
|
@@ -561,6 +566,7 @@ export const VendorCredentialSummary$outboundSchema: z.ZodType<
|
|
|
561
566
|
return remap$(v, {
|
|
562
567
|
dateDue: "date_due",
|
|
563
568
|
dateExpires: "date_expires",
|
|
569
|
+
jsonData: "json_data",
|
|
564
570
|
vendorCredentialFiles: "vendor_credential_files",
|
|
565
571
|
latestVendorCredentialId: "latest_vendor_credential_id",
|
|
566
572
|
previouslyApproved: "previously_approved",
|