@greensecurity/javascript-sdk 0.43.1-beta.140 → 0.43.1-beta.141
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/dist/commonjs/__tests__/invoices.test.js +44 -0
- package/dist/commonjs/__tests__/invoices.test.js.map +1 -1
- package/dist/commonjs/__tests__/vendorscans.test.js +4 -1
- package/dist/commonjs/__tests__/vendorscans.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/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/models/components/companymanager.d.ts +3 -28
- package/dist/commonjs/models/components/companymanager.d.ts.map +1 -1
- package/dist/commonjs/models/components/companymanager.js +4 -63
- package/dist/commonjs/models/components/companymanager.js.map +1 -1
- package/dist/commonjs/models/components/handoff.d.ts +24 -0
- package/dist/commonjs/models/components/handoff.d.ts.map +1 -0
- package/dist/commonjs/models/components/handoff.js +69 -0
- package/dist/commonjs/models/components/handoff.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/paymentprofileinfo.d.ts +2 -27
- package/dist/commonjs/models/components/paymentprofileinfo.d.ts.map +1 -1
- package/dist/commonjs/models/components/paymentprofileinfo.js +3 -57
- package/dist/commonjs/models/components/paymentprofileinfo.js.map +1 -1
- package/dist/commonjs/models/components/vendor.d.ts +3 -28
- package/dist/commonjs/models/components/vendor.d.ts.map +1 -1
- package/dist/commonjs/models/components/vendor.js +4 -60
- package/dist/commonjs/models/components/vendor.js.map +1 -1
- package/dist/commonjs/models/components/vendorcredentialsummary.d.ts +10 -1
- package/dist/commonjs/models/components/vendorcredentialsummary.d.ts.map +1 -1
- package/dist/commonjs/models/components/vendorcredentialsummary.js +13 -2
- package/dist/commonjs/models/components/vendorcredentialsummary.js.map +1 -1
- package/dist/commonjs/models/components/vendorscan.d.ts +12 -2
- package/dist/commonjs/models/components/vendorscan.d.ts.map +1 -1
- package/dist/commonjs/models/components/vendorscan.js +17 -3
- package/dist/commonjs/models/components/vendorscan.js.map +1 -1
- package/dist/commonjs/models/operations/securityzonecheckin.d.ts +2 -21
- package/dist/commonjs/models/operations/securityzonecheckin.d.ts.map +1 -1
- package/dist/commonjs/models/operations/securityzonecheckin.js +3 -26
- package/dist/commonjs/models/operations/securityzonecheckin.js.map +1 -1
- package/dist/esm/__tests__/invoices.test.js +44 -0
- package/dist/esm/__tests__/invoices.test.js.map +1 -1
- package/dist/esm/__tests__/vendorscans.test.js +4 -1
- package/dist/esm/__tests__/vendorscans.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/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/models/components/companymanager.d.ts +3 -28
- package/dist/esm/models/components/companymanager.d.ts.map +1 -1
- package/dist/esm/models/components/companymanager.js +3 -58
- package/dist/esm/models/components/companymanager.js.map +1 -1
- package/dist/esm/models/components/handoff.d.ts +24 -0
- package/dist/esm/models/components/handoff.d.ts.map +1 -0
- package/dist/esm/models/components/handoff.js +32 -0
- package/dist/esm/models/components/handoff.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/paymentprofileinfo.d.ts +2 -27
- package/dist/esm/models/components/paymentprofileinfo.d.ts.map +1 -1
- package/dist/esm/models/components/paymentprofileinfo.js +2 -52
- package/dist/esm/models/components/paymentprofileinfo.js.map +1 -1
- package/dist/esm/models/components/vendor.d.ts +3 -28
- package/dist/esm/models/components/vendor.d.ts.map +1 -1
- package/dist/esm/models/components/vendor.js +3 -55
- package/dist/esm/models/components/vendor.js.map +1 -1
- package/dist/esm/models/components/vendorcredentialsummary.d.ts +10 -1
- package/dist/esm/models/components/vendorcredentialsummary.d.ts.map +1 -1
- package/dist/esm/models/components/vendorcredentialsummary.js +11 -1
- package/dist/esm/models/components/vendorcredentialsummary.js.map +1 -1
- package/dist/esm/models/components/vendorscan.d.ts +12 -2
- package/dist/esm/models/components/vendorscan.d.ts.map +1 -1
- package/dist/esm/models/components/vendorscan.js +14 -2
- package/dist/esm/models/components/vendorscan.js.map +1 -1
- package/dist/esm/models/operations/securityzonecheckin.d.ts +2 -21
- package/dist/esm/models/operations/securityzonecheckin.d.ts.map +1 -1
- package/dist/esm/models/operations/securityzonecheckin.js +2 -24
- package/dist/esm/models/operations/securityzonecheckin.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +5 -1
- package/scripts/split-openapi.mjs +167 -0
- package/src/__tests__/invoices.test.ts +50 -0
- package/src/__tests__/vendorscans.test.ts +4 -1
- package/src/__tests__/webhooks.test.ts +1 -1
- package/src/lib/config.ts +3 -3
- package/src/models/components/companymanager.ts +8 -143
- package/src/models/components/handoff.ts +60 -0
- package/src/models/components/index.ts +1 -0
- package/src/models/components/paymentprofileinfo.ts +6 -135
- package/src/models/components/vendor.ts +8 -136
- package/src/models/components/vendorcredentialsummary.ts +33 -2
- package/src/models/components/vendorscan.ts +44 -4
- package/src/models/operations/securityzonecheckin.ts +4 -55
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: df9c88f90764
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod/v3";
|
|
7
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
8
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import * as types from "../../types/primitives.js";
|
|
11
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
12
|
+
import { Zone, Zone$inboundSchema } from "./zone.js";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Reduced list of attributes of Handoff record
|
|
16
|
+
*/
|
|
17
|
+
export type Handoff = {
|
|
18
|
+
id?: number | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Reduced list of attributes of Zone record
|
|
21
|
+
*/
|
|
22
|
+
zone?: Zone | undefined;
|
|
23
|
+
qrCode?: string | null | undefined;
|
|
24
|
+
dateCreated?: string | null | undefined;
|
|
25
|
+
dateReceived?: string | null | undefined;
|
|
26
|
+
dateCompleted?: string | null | undefined;
|
|
27
|
+
status?: string | null | undefined;
|
|
28
|
+
gpsCheckin?: boolean | undefined;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/** @internal */
|
|
32
|
+
export const Handoff$inboundSchema: z.ZodType<Handoff, z.ZodTypeDef, unknown> =
|
|
33
|
+
z.object({
|
|
34
|
+
id: types.optional(types.number()),
|
|
35
|
+
zone: types.optional(Zone$inboundSchema),
|
|
36
|
+
qr_code: z.nullable(types.string()).optional(),
|
|
37
|
+
date_created: z.nullable(types.string()).optional(),
|
|
38
|
+
date_received: z.nullable(types.string()).optional(),
|
|
39
|
+
date_completed: z.nullable(types.string()).optional(),
|
|
40
|
+
status: z.nullable(types.string()).optional(),
|
|
41
|
+
gps_checkin: types.optional(types.boolean()),
|
|
42
|
+
}).transform((v) => {
|
|
43
|
+
return remap$(v, {
|
|
44
|
+
"qr_code": "qrCode",
|
|
45
|
+
"date_created": "dateCreated",
|
|
46
|
+
"date_received": "dateReceived",
|
|
47
|
+
"date_completed": "dateCompleted",
|
|
48
|
+
"gps_checkin": "gpsCheckin",
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export function handoffFromJSON(
|
|
53
|
+
jsonString: string,
|
|
54
|
+
): SafeParseResult<Handoff, SDKValidationError> {
|
|
55
|
+
return safeParse(
|
|
56
|
+
jsonString,
|
|
57
|
+
(x) => Handoff$inboundSchema.parse(JSON.parse(x)),
|
|
58
|
+
`Failed to parse 'Handoff' from JSON`,
|
|
59
|
+
);
|
|
60
|
+
}
|
|
@@ -36,6 +36,7 @@ export * from "./fhirconfigcreate.js";
|
|
|
36
36
|
export * from "./fhirconfigpartialupdate.js";
|
|
37
37
|
export * from "./fhirextraentities.js";
|
|
38
38
|
export * from "./financialstatus.js";
|
|
39
|
+
export * from "./handoff.js";
|
|
39
40
|
export * from "./imageset.js";
|
|
40
41
|
export * from "./invitee.js";
|
|
41
42
|
export * from "./invoice.js";
|
|
@@ -8,29 +8,11 @@ import { remap as remap$ } from "../../lib/primitives.js";
|
|
|
8
8
|
import { safeParse } from "../../lib/schemas.js";
|
|
9
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
10
|
import * as types from "../../types/primitives.js";
|
|
11
|
-
import { smartUnion } from "../../types/smartUnion.js";
|
|
12
11
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export type PaymentProfileInfoPaymentProfile1 = {
|
|
19
|
-
id?: number | undefined;
|
|
20
|
-
isValid?: boolean | null | undefined;
|
|
21
|
-
cardType?: string | null | undefined;
|
|
22
|
-
cardLast4?: string | null | undefined;
|
|
23
|
-
isDummy?: boolean | null | undefined;
|
|
24
|
-
profileType?: string | null | undefined;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Reduced list of attributes of the Payment Profile record
|
|
29
|
-
*/
|
|
30
|
-
export type PaymentProfileInfoPaymentProfilePaymentProfile =
|
|
31
|
-
| PaymentProfileInfoPaymentProfile1
|
|
32
|
-
| number
|
|
33
|
-
| PaymentProfileInfo22;
|
|
12
|
+
import {
|
|
13
|
+
PaymentProfile,
|
|
14
|
+
PaymentProfile$inboundSchema,
|
|
15
|
+
} from "./paymentprofile.js";
|
|
34
16
|
|
|
35
17
|
/**
|
|
36
18
|
* Payment profile information for the logged-in user. This is account-level data, not invoice-specific.
|
|
@@ -43,112 +25,9 @@ export type PaymentProfileInfo = {
|
|
|
43
25
|
/**
|
|
44
26
|
* Payment profile for the logged in user (vendor or company manager)
|
|
45
27
|
*/
|
|
46
|
-
paymentProfile:
|
|
47
|
-
| PaymentProfileInfoPaymentProfile1
|
|
48
|
-
| number
|
|
49
|
-
| PaymentProfileInfo22
|
|
50
|
-
| null;
|
|
28
|
+
paymentProfile: PaymentProfile | null;
|
|
51
29
|
};
|
|
52
30
|
|
|
53
|
-
/** @internal */
|
|
54
|
-
export const PaymentProfileInfo22$inboundSchema: z.ZodType<
|
|
55
|
-
PaymentProfileInfo22,
|
|
56
|
-
z.ZodTypeDef,
|
|
57
|
-
unknown
|
|
58
|
-
> = z.object({});
|
|
59
|
-
|
|
60
|
-
export function paymentProfileInfo22FromJSON(
|
|
61
|
-
jsonString: string,
|
|
62
|
-
): SafeParseResult<PaymentProfileInfo22, SDKValidationError> {
|
|
63
|
-
return safeParse(
|
|
64
|
-
jsonString,
|
|
65
|
-
(x) => PaymentProfileInfo22$inboundSchema.parse(JSON.parse(x)),
|
|
66
|
-
`Failed to parse 'PaymentProfileInfo22' from JSON`,
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/** @internal */
|
|
71
|
-
export const PaymentProfileInfoPaymentProfile2$inboundSchema: z.ZodType<
|
|
72
|
-
PaymentProfileInfoPaymentProfile2,
|
|
73
|
-
z.ZodTypeDef,
|
|
74
|
-
unknown
|
|
75
|
-
> = smartUnion([
|
|
76
|
-
types.number(),
|
|
77
|
-
z.lazy(() => PaymentProfileInfo22$inboundSchema),
|
|
78
|
-
]);
|
|
79
|
-
|
|
80
|
-
export function paymentProfileInfoPaymentProfile2FromJSON(
|
|
81
|
-
jsonString: string,
|
|
82
|
-
): SafeParseResult<PaymentProfileInfoPaymentProfile2, SDKValidationError> {
|
|
83
|
-
return safeParse(
|
|
84
|
-
jsonString,
|
|
85
|
-
(x) => PaymentProfileInfoPaymentProfile2$inboundSchema.parse(JSON.parse(x)),
|
|
86
|
-
`Failed to parse 'PaymentProfileInfoPaymentProfile2' from JSON`,
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/** @internal */
|
|
91
|
-
export const PaymentProfileInfoPaymentProfile1$inboundSchema: z.ZodType<
|
|
92
|
-
PaymentProfileInfoPaymentProfile1,
|
|
93
|
-
z.ZodTypeDef,
|
|
94
|
-
unknown
|
|
95
|
-
> = z.object({
|
|
96
|
-
id: types.optional(types.number()),
|
|
97
|
-
is_valid: z.nullable(types.boolean()).optional(),
|
|
98
|
-
card_type: z.nullable(types.string()).optional(),
|
|
99
|
-
card_last4: z.nullable(types.string()).optional(),
|
|
100
|
-
is_dummy: z.nullable(types.boolean()).optional(),
|
|
101
|
-
profile_type: z.nullable(types.string()).optional(),
|
|
102
|
-
}).transform((v) => {
|
|
103
|
-
return remap$(v, {
|
|
104
|
-
"is_valid": "isValid",
|
|
105
|
-
"card_type": "cardType",
|
|
106
|
-
"card_last4": "cardLast4",
|
|
107
|
-
"is_dummy": "isDummy",
|
|
108
|
-
"profile_type": "profileType",
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
export function paymentProfileInfoPaymentProfile1FromJSON(
|
|
113
|
-
jsonString: string,
|
|
114
|
-
): SafeParseResult<PaymentProfileInfoPaymentProfile1, SDKValidationError> {
|
|
115
|
-
return safeParse(
|
|
116
|
-
jsonString,
|
|
117
|
-
(x) => PaymentProfileInfoPaymentProfile1$inboundSchema.parse(JSON.parse(x)),
|
|
118
|
-
`Failed to parse 'PaymentProfileInfoPaymentProfile1' from JSON`,
|
|
119
|
-
);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/** @internal */
|
|
123
|
-
export const PaymentProfileInfoPaymentProfilePaymentProfile$inboundSchema:
|
|
124
|
-
z.ZodType<
|
|
125
|
-
PaymentProfileInfoPaymentProfilePaymentProfile,
|
|
126
|
-
z.ZodTypeDef,
|
|
127
|
-
unknown
|
|
128
|
-
> = smartUnion([
|
|
129
|
-
z.lazy(() => PaymentProfileInfoPaymentProfile1$inboundSchema),
|
|
130
|
-
smartUnion([
|
|
131
|
-
types.number(),
|
|
132
|
-
z.lazy(() => PaymentProfileInfo22$inboundSchema),
|
|
133
|
-
]),
|
|
134
|
-
]);
|
|
135
|
-
|
|
136
|
-
export function paymentProfileInfoPaymentProfilePaymentProfileFromJSON(
|
|
137
|
-
jsonString: string,
|
|
138
|
-
): SafeParseResult<
|
|
139
|
-
PaymentProfileInfoPaymentProfilePaymentProfile,
|
|
140
|
-
SDKValidationError
|
|
141
|
-
> {
|
|
142
|
-
return safeParse(
|
|
143
|
-
jsonString,
|
|
144
|
-
(x) =>
|
|
145
|
-
PaymentProfileInfoPaymentProfilePaymentProfile$inboundSchema.parse(
|
|
146
|
-
JSON.parse(x),
|
|
147
|
-
),
|
|
148
|
-
`Failed to parse 'PaymentProfileInfoPaymentProfilePaymentProfile' from JSON`,
|
|
149
|
-
);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
31
|
/** @internal */
|
|
153
32
|
export const PaymentProfileInfo$inboundSchema: z.ZodType<
|
|
154
33
|
PaymentProfileInfo,
|
|
@@ -156,15 +35,7 @@ export const PaymentProfileInfo$inboundSchema: z.ZodType<
|
|
|
156
35
|
unknown
|
|
157
36
|
> = z.object({
|
|
158
37
|
credit_balance: types.nullable(types.number()),
|
|
159
|
-
payment_profile: types.nullable(
|
|
160
|
-
smartUnion([
|
|
161
|
-
z.lazy(() => PaymentProfileInfoPaymentProfile1$inboundSchema),
|
|
162
|
-
smartUnion([
|
|
163
|
-
types.number(),
|
|
164
|
-
z.lazy(() => PaymentProfileInfo22$inboundSchema),
|
|
165
|
-
]),
|
|
166
|
-
]),
|
|
167
|
-
),
|
|
38
|
+
payment_profile: types.nullable(PaymentProfile$inboundSchema),
|
|
168
39
|
}).transform((v) => {
|
|
169
40
|
return remap$(v, {
|
|
170
41
|
"credit_balance": "creditBalance",
|
|
@@ -23,6 +23,10 @@ import {
|
|
|
23
23
|
} from "./facilitysummary.js";
|
|
24
24
|
import { ImageSet, ImageSet$inboundSchema } from "./imageset.js";
|
|
25
25
|
import { Invoice, Invoice$inboundSchema } from "./invoice.js";
|
|
26
|
+
import {
|
|
27
|
+
PaymentProfile,
|
|
28
|
+
PaymentProfile$inboundSchema,
|
|
29
|
+
} from "./paymentprofile.js";
|
|
26
30
|
import { Subscription, Subscription$inboundSchema } from "./subscription.js";
|
|
27
31
|
import { Supervisor, Supervisor$inboundSchema } from "./supervisor.js";
|
|
28
32
|
import { UserLocation, UserLocation$inboundSchema } from "./userlocation.js";
|
|
@@ -70,32 +74,7 @@ export type VendorJob = VendorJobTitle | number;
|
|
|
70
74
|
|
|
71
75
|
export type VendorVendorType = VendorType | number;
|
|
72
76
|
|
|
73
|
-
export type
|
|
74
|
-
|
|
75
|
-
export type VendorPaymentProfile2 = number | Vendor22;
|
|
76
|
-
|
|
77
|
-
export type VendorPaymentProfile1 = {
|
|
78
|
-
id?: number | undefined;
|
|
79
|
-
isValid?: boolean | null | undefined;
|
|
80
|
-
cardType?: string | null | undefined;
|
|
81
|
-
cardLast4?: string | null | undefined;
|
|
82
|
-
isDummy?: boolean | null | undefined;
|
|
83
|
-
profileType?: string | null | undefined;
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Reduced list of attributes of the Payment Profile record
|
|
88
|
-
*/
|
|
89
|
-
export type PaymentProfilePaymentProfile =
|
|
90
|
-
| VendorPaymentProfile1
|
|
91
|
-
| number
|
|
92
|
-
| Vendor22;
|
|
93
|
-
|
|
94
|
-
export type VendorPaymentProfile =
|
|
95
|
-
| VendorPaymentProfile1
|
|
96
|
-
| number
|
|
97
|
-
| Vendor22
|
|
98
|
-
| number;
|
|
77
|
+
export type VendorPaymentProfile = PaymentProfile | number;
|
|
99
78
|
|
|
100
79
|
export type CompanySummary = {
|
|
101
80
|
id: string;
|
|
@@ -176,13 +155,7 @@ export type Vendor = {
|
|
|
176
155
|
* A set of images in different sizes
|
|
177
156
|
*/
|
|
178
157
|
imageUrls?: ImageSet | null | undefined;
|
|
179
|
-
paymentProfile?:
|
|
180
|
-
| VendorPaymentProfile1
|
|
181
|
-
| number
|
|
182
|
-
| Vendor22
|
|
183
|
-
| number
|
|
184
|
-
| null
|
|
185
|
-
| undefined;
|
|
158
|
+
paymentProfile?: PaymentProfile | number | null | undefined;
|
|
186
159
|
/**
|
|
187
160
|
* Describes a facility which typically represents a physical building or logical grouping of offices which act as a single entity.
|
|
188
161
|
*/
|
|
@@ -334,104 +307,12 @@ export function vendorVendorTypeFromJSON(
|
|
|
334
307
|
);
|
|
335
308
|
}
|
|
336
309
|
|
|
337
|
-
/** @internal */
|
|
338
|
-
export const Vendor22$inboundSchema: z.ZodType<
|
|
339
|
-
Vendor22,
|
|
340
|
-
z.ZodTypeDef,
|
|
341
|
-
unknown
|
|
342
|
-
> = z.object({});
|
|
343
|
-
|
|
344
|
-
export function vendor22FromJSON(
|
|
345
|
-
jsonString: string,
|
|
346
|
-
): SafeParseResult<Vendor22, SDKValidationError> {
|
|
347
|
-
return safeParse(
|
|
348
|
-
jsonString,
|
|
349
|
-
(x) => Vendor22$inboundSchema.parse(JSON.parse(x)),
|
|
350
|
-
`Failed to parse 'Vendor22' from JSON`,
|
|
351
|
-
);
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
/** @internal */
|
|
355
|
-
export const VendorPaymentProfile2$inboundSchema: z.ZodType<
|
|
356
|
-
VendorPaymentProfile2,
|
|
357
|
-
z.ZodTypeDef,
|
|
358
|
-
unknown
|
|
359
|
-
> = smartUnion([types.number(), z.lazy(() => Vendor22$inboundSchema)]);
|
|
360
|
-
|
|
361
|
-
export function vendorPaymentProfile2FromJSON(
|
|
362
|
-
jsonString: string,
|
|
363
|
-
): SafeParseResult<VendorPaymentProfile2, SDKValidationError> {
|
|
364
|
-
return safeParse(
|
|
365
|
-
jsonString,
|
|
366
|
-
(x) => VendorPaymentProfile2$inboundSchema.parse(JSON.parse(x)),
|
|
367
|
-
`Failed to parse 'VendorPaymentProfile2' from JSON`,
|
|
368
|
-
);
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
/** @internal */
|
|
372
|
-
export const VendorPaymentProfile1$inboundSchema: z.ZodType<
|
|
373
|
-
VendorPaymentProfile1,
|
|
374
|
-
z.ZodTypeDef,
|
|
375
|
-
unknown
|
|
376
|
-
> = z.object({
|
|
377
|
-
id: types.optional(types.number()),
|
|
378
|
-
is_valid: z.nullable(types.boolean()).optional(),
|
|
379
|
-
card_type: z.nullable(types.string()).optional(),
|
|
380
|
-
card_last4: z.nullable(types.string()).optional(),
|
|
381
|
-
is_dummy: z.nullable(types.boolean()).optional(),
|
|
382
|
-
profile_type: z.nullable(types.string()).optional(),
|
|
383
|
-
}).transform((v) => {
|
|
384
|
-
return remap$(v, {
|
|
385
|
-
"is_valid": "isValid",
|
|
386
|
-
"card_type": "cardType",
|
|
387
|
-
"card_last4": "cardLast4",
|
|
388
|
-
"is_dummy": "isDummy",
|
|
389
|
-
"profile_type": "profileType",
|
|
390
|
-
});
|
|
391
|
-
});
|
|
392
|
-
|
|
393
|
-
export function vendorPaymentProfile1FromJSON(
|
|
394
|
-
jsonString: string,
|
|
395
|
-
): SafeParseResult<VendorPaymentProfile1, SDKValidationError> {
|
|
396
|
-
return safeParse(
|
|
397
|
-
jsonString,
|
|
398
|
-
(x) => VendorPaymentProfile1$inboundSchema.parse(JSON.parse(x)),
|
|
399
|
-
`Failed to parse 'VendorPaymentProfile1' from JSON`,
|
|
400
|
-
);
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
/** @internal */
|
|
404
|
-
export const PaymentProfilePaymentProfile$inboundSchema: z.ZodType<
|
|
405
|
-
PaymentProfilePaymentProfile,
|
|
406
|
-
z.ZodTypeDef,
|
|
407
|
-
unknown
|
|
408
|
-
> = smartUnion([
|
|
409
|
-
z.lazy(() => VendorPaymentProfile1$inboundSchema),
|
|
410
|
-
smartUnion([types.number(), z.lazy(() => Vendor22$inboundSchema)]),
|
|
411
|
-
]);
|
|
412
|
-
|
|
413
|
-
export function paymentProfilePaymentProfileFromJSON(
|
|
414
|
-
jsonString: string,
|
|
415
|
-
): SafeParseResult<PaymentProfilePaymentProfile, SDKValidationError> {
|
|
416
|
-
return safeParse(
|
|
417
|
-
jsonString,
|
|
418
|
-
(x) => PaymentProfilePaymentProfile$inboundSchema.parse(JSON.parse(x)),
|
|
419
|
-
`Failed to parse 'PaymentProfilePaymentProfile' from JSON`,
|
|
420
|
-
);
|
|
421
|
-
}
|
|
422
|
-
|
|
423
310
|
/** @internal */
|
|
424
311
|
export const VendorPaymentProfile$inboundSchema: z.ZodType<
|
|
425
312
|
VendorPaymentProfile,
|
|
426
313
|
z.ZodTypeDef,
|
|
427
314
|
unknown
|
|
428
|
-
> = smartUnion([
|
|
429
|
-
smartUnion([
|
|
430
|
-
z.lazy(() => VendorPaymentProfile1$inboundSchema),
|
|
431
|
-
smartUnion([types.number(), z.lazy(() => Vendor22$inboundSchema)]),
|
|
432
|
-
]),
|
|
433
|
-
types.number(),
|
|
434
|
-
]);
|
|
315
|
+
> = smartUnion([PaymentProfile$inboundSchema, types.number()]);
|
|
435
316
|
|
|
436
317
|
export function vendorPaymentProfileFromJSON(
|
|
437
318
|
jsonString: string,
|
|
@@ -578,16 +459,7 @@ export const Vendor$inboundSchema: z.ZodType<Vendor, z.ZodTypeDef, unknown> = z
|
|
|
578
459
|
drivers_license: z.nullable(ImageSet$inboundSchema).optional(),
|
|
579
460
|
image_urls: z.nullable(ImageSet$inboundSchema).optional(),
|
|
580
461
|
payment_profile: z.nullable(
|
|
581
|
-
smartUnion([
|
|
582
|
-
smartUnion([
|
|
583
|
-
z.lazy(() => VendorPaymentProfile1$inboundSchema),
|
|
584
|
-
smartUnion([
|
|
585
|
-
types.number(),
|
|
586
|
-
z.lazy(() => Vendor22$inboundSchema),
|
|
587
|
-
]),
|
|
588
|
-
]),
|
|
589
|
-
types.number(),
|
|
590
|
-
]),
|
|
462
|
+
smartUnion([PaymentProfile$inboundSchema, types.number()]),
|
|
591
463
|
).optional(),
|
|
592
464
|
primary_facility: z.nullable(Facility$inboundSchema).optional(),
|
|
593
465
|
primary_department: z.nullable(Department$inboundSchema).optional(),
|
|
@@ -57,6 +57,13 @@ export type CredentialPricingOptions = {
|
|
|
57
57
|
note?: string | null | undefined;
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
+
export type CredentialVariants = {
|
|
61
|
+
id?: number | undefined;
|
|
62
|
+
name?: string | null | undefined;
|
|
63
|
+
price?: number | null | undefined;
|
|
64
|
+
note?: string | null | undefined;
|
|
65
|
+
};
|
|
66
|
+
|
|
60
67
|
/**
|
|
61
68
|
* Reduced list of attributes of Vendor Credential record
|
|
62
69
|
*/
|
|
@@ -98,7 +105,7 @@ export type VendorCredentialSummary = {
|
|
|
98
105
|
| Array<VendorCredentialDataRequest | null>
|
|
99
106
|
| null
|
|
100
107
|
| undefined;
|
|
101
|
-
credentialVariants?: Array<
|
|
108
|
+
credentialVariants?: Array<CredentialVariants> | null | undefined;
|
|
102
109
|
targetsChop?: boolean | null | undefined;
|
|
103
110
|
totalPendingCredentials?: number | null | undefined;
|
|
104
111
|
backgroundCheckProviderId?: number | null | undefined;
|
|
@@ -241,6 +248,28 @@ export function credentialPricingOptionsFromJSON(
|
|
|
241
248
|
);
|
|
242
249
|
}
|
|
243
250
|
|
|
251
|
+
/** @internal */
|
|
252
|
+
export const CredentialVariants$inboundSchema: z.ZodType<
|
|
253
|
+
CredentialVariants,
|
|
254
|
+
z.ZodTypeDef,
|
|
255
|
+
unknown
|
|
256
|
+
> = z.object({
|
|
257
|
+
id: types.optional(types.number()),
|
|
258
|
+
name: z.nullable(types.string()).optional(),
|
|
259
|
+
price: z.nullable(types.number()).optional(),
|
|
260
|
+
note: z.nullable(types.string()).optional(),
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
export function credentialVariantsFromJSON(
|
|
264
|
+
jsonString: string,
|
|
265
|
+
): SafeParseResult<CredentialVariants, SDKValidationError> {
|
|
266
|
+
return safeParse(
|
|
267
|
+
jsonString,
|
|
268
|
+
(x) => CredentialVariants$inboundSchema.parse(JSON.parse(x)),
|
|
269
|
+
`Failed to parse 'CredentialVariants' from JSON`,
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
|
|
244
273
|
/** @internal */
|
|
245
274
|
export const VendorCredentialSummary$inboundSchema: z.ZodType<
|
|
246
275
|
VendorCredentialSummary,
|
|
@@ -291,7 +320,9 @@ export const VendorCredentialSummary$inboundSchema: z.ZodType<
|
|
|
291
320
|
VendorCredentialDataRequest$inboundSchema
|
|
292
321
|
))),
|
|
293
322
|
).optional(),
|
|
294
|
-
credential_variants: z.nullable(
|
|
323
|
+
credential_variants: z.nullable(
|
|
324
|
+
z.array(z.lazy(() => CredentialVariants$inboundSchema)),
|
|
325
|
+
).optional(),
|
|
295
326
|
targets_chop: z.nullable(types.boolean()).optional(),
|
|
296
327
|
total_pending_credentials: z.nullable(types.number()).optional(),
|
|
297
328
|
background_check_provider_id: z.nullable(types.number()).optional(),
|
|
@@ -11,6 +11,12 @@ import * as types from "../../types/primitives.js";
|
|
|
11
11
|
import { smartUnion } from "../../types/smartUnion.js";
|
|
12
12
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
13
13
|
import { Department, Department$inboundSchema } from "./department.js";
|
|
14
|
+
import { Vendor, Vendor$inboundSchema } from "./vendor.js";
|
|
15
|
+
import { Zone, Zone$inboundSchema } from "./zone.js";
|
|
16
|
+
|
|
17
|
+
export type VendorScanVendor = Vendor | number;
|
|
18
|
+
|
|
19
|
+
export type VendorScanZone = Zone | number;
|
|
14
20
|
|
|
15
21
|
export type VendorScanDepartment = Department | number;
|
|
16
22
|
|
|
@@ -26,8 +32,8 @@ export type VendorScan = {
|
|
|
26
32
|
scanSuccess?: boolean | undefined;
|
|
27
33
|
scanType?: number | null | undefined;
|
|
28
34
|
notes?: string | null | undefined;
|
|
29
|
-
vendor?:
|
|
30
|
-
zone?:
|
|
35
|
+
vendor?: Vendor | number | undefined;
|
|
36
|
+
zone?: Zone | number | undefined;
|
|
31
37
|
department?: Department | number | null | undefined;
|
|
32
38
|
departmentEventId?: number | null | undefined;
|
|
33
39
|
facilityEventId?: number | null | undefined;
|
|
@@ -43,6 +49,40 @@ export type VendorScan = {
|
|
|
43
49
|
badgeData?: string | null | undefined;
|
|
44
50
|
};
|
|
45
51
|
|
|
52
|
+
/** @internal */
|
|
53
|
+
export const VendorScanVendor$inboundSchema: z.ZodType<
|
|
54
|
+
VendorScanVendor,
|
|
55
|
+
z.ZodTypeDef,
|
|
56
|
+
unknown
|
|
57
|
+
> = smartUnion([Vendor$inboundSchema, types.number()]);
|
|
58
|
+
|
|
59
|
+
export function vendorScanVendorFromJSON(
|
|
60
|
+
jsonString: string,
|
|
61
|
+
): SafeParseResult<VendorScanVendor, SDKValidationError> {
|
|
62
|
+
return safeParse(
|
|
63
|
+
jsonString,
|
|
64
|
+
(x) => VendorScanVendor$inboundSchema.parse(JSON.parse(x)),
|
|
65
|
+
`Failed to parse 'VendorScanVendor' from JSON`,
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** @internal */
|
|
70
|
+
export const VendorScanZone$inboundSchema: z.ZodType<
|
|
71
|
+
VendorScanZone,
|
|
72
|
+
z.ZodTypeDef,
|
|
73
|
+
unknown
|
|
74
|
+
> = smartUnion([Zone$inboundSchema, types.number()]);
|
|
75
|
+
|
|
76
|
+
export function vendorScanZoneFromJSON(
|
|
77
|
+
jsonString: string,
|
|
78
|
+
): SafeParseResult<VendorScanZone, SDKValidationError> {
|
|
79
|
+
return safeParse(
|
|
80
|
+
jsonString,
|
|
81
|
+
(x) => VendorScanZone$inboundSchema.parse(JSON.parse(x)),
|
|
82
|
+
`Failed to parse 'VendorScanZone' from JSON`,
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
46
86
|
/** @internal */
|
|
47
87
|
export const VendorScanDepartment$inboundSchema: z.ZodType<
|
|
48
88
|
VendorScanDepartment,
|
|
@@ -74,8 +114,8 @@ export const VendorScan$inboundSchema: z.ZodType<
|
|
|
74
114
|
scan_success: types.optional(types.boolean()),
|
|
75
115
|
scan_type: z.nullable(types.number()).optional(),
|
|
76
116
|
notes: z.nullable(types.string()).optional(),
|
|
77
|
-
vendor: types.optional(
|
|
78
|
-
zone: types.optional(
|
|
117
|
+
vendor: types.optional(smartUnion([Vendor$inboundSchema, types.number()])),
|
|
118
|
+
zone: types.optional(smartUnion([Zone$inboundSchema, types.number()])),
|
|
79
119
|
department: z.nullable(smartUnion([Department$inboundSchema, types.number()]))
|
|
80
120
|
.optional(),
|
|
81
121
|
department_event_id: z.nullable(types.number()).optional(),
|
|
@@ -98,24 +98,7 @@ export const Requires = {
|
|
|
98
98
|
} as const;
|
|
99
99
|
export type Requires = ClosedEnum<typeof Requires>;
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
* Reduced list of attributes of Handoff record
|
|
103
|
-
*/
|
|
104
|
-
export type HandoffHandoff = {
|
|
105
|
-
id?: number | undefined;
|
|
106
|
-
/**
|
|
107
|
-
* Reduced list of attributes of Zone record
|
|
108
|
-
*/
|
|
109
|
-
zone?: components.Zone | undefined;
|
|
110
|
-
qrCode?: string | null | undefined;
|
|
111
|
-
dateCreated?: string | null | undefined;
|
|
112
|
-
dateReceived?: string | null | undefined;
|
|
113
|
-
dateCompleted?: string | null | undefined;
|
|
114
|
-
status?: string | null | undefined;
|
|
115
|
-
gpsCheckin?: boolean | undefined;
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
export type Handoff = HandoffHandoff | number;
|
|
101
|
+
export type Handoff = components.Handoff | number;
|
|
119
102
|
|
|
120
103
|
export type Results = {
|
|
121
104
|
hasValidPaymentProfile?: boolean | undefined;
|
|
@@ -146,7 +129,7 @@ export type Results = {
|
|
|
146
129
|
export type SecurityZoneCheckinSecurityZoneCheckinOk = {
|
|
147
130
|
success?: boolean | undefined;
|
|
148
131
|
requires?: Requires | undefined;
|
|
149
|
-
handoff?:
|
|
132
|
+
handoff?: components.Handoff | number | null | undefined;
|
|
150
133
|
results?: Results | undefined;
|
|
151
134
|
};
|
|
152
135
|
|
|
@@ -336,43 +319,9 @@ export function securityZoneCheckinRequestBodyToJSON(
|
|
|
336
319
|
export const Requires$inboundSchema: z.ZodNativeEnum<typeof Requires> = z
|
|
337
320
|
.nativeEnum(Requires);
|
|
338
321
|
|
|
339
|
-
/** @internal */
|
|
340
|
-
export const HandoffHandoff$inboundSchema: z.ZodType<
|
|
341
|
-
HandoffHandoff,
|
|
342
|
-
z.ZodTypeDef,
|
|
343
|
-
unknown
|
|
344
|
-
> = z.object({
|
|
345
|
-
id: types.optional(types.number()),
|
|
346
|
-
zone: types.optional(components.Zone$inboundSchema),
|
|
347
|
-
qr_code: z.nullable(types.string()).optional(),
|
|
348
|
-
date_created: z.nullable(types.string()).optional(),
|
|
349
|
-
date_received: z.nullable(types.string()).optional(),
|
|
350
|
-
date_completed: z.nullable(types.string()).optional(),
|
|
351
|
-
status: z.nullable(types.string()).optional(),
|
|
352
|
-
gps_checkin: types.optional(types.boolean()),
|
|
353
|
-
}).transform((v) => {
|
|
354
|
-
return remap$(v, {
|
|
355
|
-
"qr_code": "qrCode",
|
|
356
|
-
"date_created": "dateCreated",
|
|
357
|
-
"date_received": "dateReceived",
|
|
358
|
-
"date_completed": "dateCompleted",
|
|
359
|
-
"gps_checkin": "gpsCheckin",
|
|
360
|
-
});
|
|
361
|
-
});
|
|
362
|
-
|
|
363
|
-
export function handoffHandoffFromJSON(
|
|
364
|
-
jsonString: string,
|
|
365
|
-
): SafeParseResult<HandoffHandoff, SDKValidationError> {
|
|
366
|
-
return safeParse(
|
|
367
|
-
jsonString,
|
|
368
|
-
(x) => HandoffHandoff$inboundSchema.parse(JSON.parse(x)),
|
|
369
|
-
`Failed to parse 'HandoffHandoff' from JSON`,
|
|
370
|
-
);
|
|
371
|
-
}
|
|
372
|
-
|
|
373
322
|
/** @internal */
|
|
374
323
|
export const Handoff$inboundSchema: z.ZodType<Handoff, z.ZodTypeDef, unknown> =
|
|
375
|
-
smartUnion([
|
|
324
|
+
smartUnion([components.Handoff$inboundSchema, types.number()]);
|
|
376
325
|
|
|
377
326
|
export function handoffFromJSON(
|
|
378
327
|
jsonString: string,
|
|
@@ -441,7 +390,7 @@ export const SecurityZoneCheckinSecurityZoneCheckinOk$inboundSchema: z.ZodType<
|
|
|
441
390
|
success: types.optional(types.boolean()),
|
|
442
391
|
requires: types.optional(Requires$inboundSchema),
|
|
443
392
|
handoff: z.nullable(
|
|
444
|
-
smartUnion([
|
|
393
|
+
smartUnion([components.Handoff$inboundSchema, types.number()]),
|
|
445
394
|
).optional(),
|
|
446
395
|
results: types.optional(z.lazy(() => Results$inboundSchema)),
|
|
447
396
|
});
|