@timbro/invoices 0.9.0-next.1 → 0.9.0
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 +19 -0
- package/dist/admin.d.ts +2 -2
- package/dist/admin.d.ts.map +1 -1
- package/dist/admin.js +1 -1
- package/dist/generated/hosted/sdk.gen.js +1 -1
- package/dist/generated/hosted/types.gen.d.ts +2 -2
- package/dist/generated/hosted/types.gen.d.ts.map +1 -1
- package/dist/generated/hosted/zod-response.gen.d.ts +4007 -0
- package/dist/generated/hosted/zod-response.gen.d.ts.map +1 -0
- package/dist/generated/hosted/zod-response.gen.js +1967 -0
- package/dist/generated/hosted/zod.gen.d.ts +3 -0
- package/dist/generated/hosted/zod.gen.d.ts.map +1 -1
- package/dist/generated/hosted/zod.gen.js +3 -0
- package/dist/generated/sdk.gen.js +1 -1
- package/dist/generated/zod-response.gen.d.ts +87940 -0
- package/dist/generated/zod-response.gen.d.ts.map +1 -0
- package/dist/generated/zod-response.gen.js +4946 -0
- package/dist/generated-problem.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/invoice-receipt.d.ts.map +1 -1
- package/dist/invoice-receipt.js +2 -1
- package/dist/invoice.d.ts +2 -2
- package/dist/invoice.d.ts.map +1 -1
- package/dist/invoice.js +1 -1
- package/dist/source-connection-activation.d.ts.map +1 -1
- package/dist/source-connection-activation.js +2 -1
- package/dist/timbro-client.d.ts +2 -2
- package/dist/timbro-client.d.ts.map +1 -1
- package/dist/webhook-event.d.ts +4680 -1983
- package/dist/webhook-event.d.ts.map +1 -1
- package/dist/webhook-event.js +27 -1
- package/dist/webhook-verification.d.ts +4 -2
- package/dist/webhook-verification.d.ts.map +1 -1
- package/dist/webhook-verification.js +4 -2
- package/package.json +6 -2
|
@@ -0,0 +1,4946 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
// Response validators derived from zod.gen.ts by scripts/response-validators.mjs.
|
|
3
|
+
import * as z from "zod";
|
|
4
|
+
function propertyCount(value) {
|
|
5
|
+
return typeof value === "object" && value !== null ? Object.keys(value).length : 0;
|
|
6
|
+
}
|
|
7
|
+
function lenientUnion(options) {
|
|
8
|
+
return z.any().transform((value, context) => {
|
|
9
|
+
const matches = [];
|
|
10
|
+
const failures = [];
|
|
11
|
+
for (const option of options) {
|
|
12
|
+
const result = option.safeParse(value);
|
|
13
|
+
if (result.success) {
|
|
14
|
+
matches.push(result.data);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
failures.push(result.error.issues);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const [first, ...rest] = matches;
|
|
21
|
+
if (matches.length === 0) {
|
|
22
|
+
context.issues.push({ code: "invalid_union", errors: failures, input: value });
|
|
23
|
+
return z.NEVER;
|
|
24
|
+
}
|
|
25
|
+
return rest.reduce((best, match) => (propertyCount(match) > propertyCount(best) ? match : best), first);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
export const zActiveCertificateCustodyBindingResource = z.object({
|
|
29
|
+
binding_id: z.uuid(),
|
|
30
|
+
certificate_version: z.string().regex(/^[1-9][0-9]*$/),
|
|
31
|
+
expected_certificate_sha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
* Buyer identity alternatives admitted by official conditional Type 33 and Type 34 `Comprador`.
|
|
35
|
+
*/
|
|
36
|
+
export const zAffectedFiscalDocumentAttributionResource = lenientUnion([
|
|
37
|
+
z.object({
|
|
38
|
+
fiscal_operation_id: z.uuid(),
|
|
39
|
+
kind: z.enum(["internal_operation"]),
|
|
40
|
+
}),
|
|
41
|
+
z.object({
|
|
42
|
+
kind: z.enum(["external_document"]),
|
|
43
|
+
source_reference: z
|
|
44
|
+
.string()
|
|
45
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
46
|
+
.refine((text) => Array.from(text).length <= 250),
|
|
47
|
+
}),
|
|
48
|
+
]);
|
|
49
|
+
export const zAuditEventAction = z.enum([
|
|
50
|
+
"organization_created",
|
|
51
|
+
"legal_issuer_registered",
|
|
52
|
+
"member_invited",
|
|
53
|
+
"invitation_accepted",
|
|
54
|
+
"source_connection_created",
|
|
55
|
+
"source_connection_activation_retried",
|
|
56
|
+
"source_connection_rotated",
|
|
57
|
+
"source_connection_revoked",
|
|
58
|
+
"webhook_signing_secret_rotated",
|
|
59
|
+
"webhook_endpoint_registered",
|
|
60
|
+
"certificate_custody_binding_created",
|
|
61
|
+
"certificate_custody_certificate_version_registered",
|
|
62
|
+
"certificate_custody_certificate_version_revoked",
|
|
63
|
+
"reception_mount_declared",
|
|
64
|
+
"commercial_response_recorded",
|
|
65
|
+
]);
|
|
66
|
+
export const zAuditEventSubjectKind = z.enum([
|
|
67
|
+
"organization",
|
|
68
|
+
"legal_issuer",
|
|
69
|
+
"membership_invitation",
|
|
70
|
+
"organization_membership",
|
|
71
|
+
"source_connection",
|
|
72
|
+
"webhook_endpoint",
|
|
73
|
+
"certificate_custody_binding",
|
|
74
|
+
"reception_mount",
|
|
75
|
+
"fiscal_reception",
|
|
76
|
+
]);
|
|
77
|
+
export const zAuditEventResource = z.object({
|
|
78
|
+
action: zAuditEventAction,
|
|
79
|
+
actor: z.string(),
|
|
80
|
+
detail: z.object({}),
|
|
81
|
+
id: z.uuid(),
|
|
82
|
+
occurred_at: z.iso.datetime(),
|
|
83
|
+
subject_id: z.uuid().nullable(),
|
|
84
|
+
subject_kind: zAuditEventSubjectKind,
|
|
85
|
+
});
|
|
86
|
+
export const zAuthorityRejectedReplacementReason = z.enum(["numbering_history_gap"]);
|
|
87
|
+
export const zAuthorityRejectedReplacementAuthorizationResource = z.object({
|
|
88
|
+
authorized_by_actor: z.string(),
|
|
89
|
+
created_at: z.iso.datetime(),
|
|
90
|
+
fiscal_operation_id: z.uuid(),
|
|
91
|
+
id: z.uuid(),
|
|
92
|
+
reason: zAuthorityRejectedReplacementReason,
|
|
93
|
+
source_id: z.string(),
|
|
94
|
+
source_version: z
|
|
95
|
+
.string()
|
|
96
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
97
|
+
.refine((text) => Array.from(text).length <= 128)
|
|
98
|
+
.regex(/^[^\p{White_Space}](?:[\s\S]*[^\p{White_Space}])?$/u),
|
|
99
|
+
});
|
|
100
|
+
export const zBuyerDeliveryTerminalResultCode = z.enum([
|
|
101
|
+
"authority_status_accepted",
|
|
102
|
+
"authority_status_accepted_with_findings",
|
|
103
|
+
"authority_status_rejected",
|
|
104
|
+
"authority_submission_rejected",
|
|
105
|
+
"consumer_summary_accepted",
|
|
106
|
+
"consumer_summary_accepted_with_findings",
|
|
107
|
+
"consumer_summary_rejected",
|
|
108
|
+
]);
|
|
109
|
+
/**
|
|
110
|
+
* Exporter classification retained as a caller declaration, not authority confirmation.
|
|
111
|
+
*/
|
|
112
|
+
export const zCertificateCustodyCertificateResource = z.object({
|
|
113
|
+
certificate_expires_at: z.iso.datetime(),
|
|
114
|
+
certificate_sha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
115
|
+
certificate_subject_serial_number: z
|
|
116
|
+
.string()
|
|
117
|
+
.regex(/^(?:[0-9]{9}|[0-9]{11}|IDCDO-(?:[0-9]{9}|[0-9]{11})|PAS[A-Z]{2}-[A-Za-z0-9]{5,20})$/),
|
|
118
|
+
effect_replay_retention_seconds: z
|
|
119
|
+
.int()
|
|
120
|
+
.gte(1)
|
|
121
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
122
|
+
});
|
|
123
|
+
/**
|
|
124
|
+
* Signature algorithm pinned with a certificate-custody binding.
|
|
125
|
+
*/
|
|
126
|
+
export const zCertificateCustodySignatureAlgorithm = z.enum(["rsa_sha256"]);
|
|
127
|
+
/**
|
|
128
|
+
* The wire family a Collection page announces.
|
|
129
|
+
*/
|
|
130
|
+
export const zCollectionObject = z.enum(["list"]);
|
|
131
|
+
export const zAuditEventPage = z.object({
|
|
132
|
+
data: z.array(zAuditEventResource),
|
|
133
|
+
hasMore: z.boolean(),
|
|
134
|
+
nextCursor: z.string().nullable(),
|
|
135
|
+
object: zCollectionObject,
|
|
136
|
+
});
|
|
137
|
+
/**
|
|
138
|
+
* The receiver's commercial decision over one received e-CF.
|
|
139
|
+
*
|
|
140
|
+
* DGII's ACECF XSD requires `DetalleMotivoRechazo` exactly when `Estado` is 2 (rejected).
|
|
141
|
+
* Modeling the decision as a tagged enum makes an accepted response carrying a motive
|
|
142
|
+
* unrepresentable, instead of a nullable field every consumer re-checks.
|
|
143
|
+
*/
|
|
144
|
+
export const zCommercialResponse = lenientUnion([
|
|
145
|
+
z.object({
|
|
146
|
+
decision: z.enum(["accepted"]),
|
|
147
|
+
}),
|
|
148
|
+
z.object({
|
|
149
|
+
decision: z.enum(["rejected"]),
|
|
150
|
+
motive: z.string(),
|
|
151
|
+
}),
|
|
152
|
+
]);
|
|
153
|
+
/**
|
|
154
|
+
* The counterparty buyer's recorded commercial decision over one Fiscal operation, or its
|
|
155
|
+
* absence.
|
|
156
|
+
*/
|
|
157
|
+
export const zCommercialResponseProjection = lenientUnion([
|
|
158
|
+
z.object({
|
|
159
|
+
decision: z.enum(["accepted"]),
|
|
160
|
+
recorded_at: z.iso.datetime(),
|
|
161
|
+
responded_at: z.iso.datetime(),
|
|
162
|
+
}),
|
|
163
|
+
z.object({
|
|
164
|
+
decision: z.enum(["rejected"]),
|
|
165
|
+
motive: z.string().refine((text) => Array.from(text).length <= 250),
|
|
166
|
+
recorded_at: z.iso.datetime(),
|
|
167
|
+
responded_at: z.iso.datetime(),
|
|
168
|
+
}),
|
|
169
|
+
]);
|
|
170
|
+
/**
|
|
171
|
+
* The outbound ACECF submission's advisory state, shown to the workspace as context only.
|
|
172
|
+
*/
|
|
173
|
+
export const zCommercialResponseSubmissionStateResource = z.enum([
|
|
174
|
+
"pending",
|
|
175
|
+
"inFlight",
|
|
176
|
+
"submitted",
|
|
177
|
+
"dgiiRejected",
|
|
178
|
+
"submissionRefused",
|
|
179
|
+
"signingRefused",
|
|
180
|
+
"constructionRefused",
|
|
181
|
+
"authenticationFailed",
|
|
182
|
+
"unavailable",
|
|
183
|
+
"outcomeUnknown",
|
|
184
|
+
]);
|
|
185
|
+
export const zDirectConnectionConfirmationResource = z.object({
|
|
186
|
+
confirmed: z.boolean(),
|
|
187
|
+
source_connection_id: z.uuid(),
|
|
188
|
+
});
|
|
189
|
+
export const zDirectConnectionRequestResource = z.object({
|
|
190
|
+
expires_at: z.iso.datetime(),
|
|
191
|
+
polling_secret: z.string(),
|
|
192
|
+
request_id: z.uuid(),
|
|
193
|
+
user_code: z.string(),
|
|
194
|
+
verification_uri: z.url(),
|
|
195
|
+
});
|
|
196
|
+
export const zDirectConnectionRequestState = z.enum([
|
|
197
|
+
"pending",
|
|
198
|
+
"approved",
|
|
199
|
+
"confirmed",
|
|
200
|
+
"expired",
|
|
201
|
+
"cancelled",
|
|
202
|
+
"rejected",
|
|
203
|
+
"revoked",
|
|
204
|
+
]);
|
|
205
|
+
export const zDirectConnectionApprovalResource = z.object({
|
|
206
|
+
request_id: z.uuid(),
|
|
207
|
+
source_connection_id: z.uuid(),
|
|
208
|
+
state: zDirectConnectionRequestState,
|
|
209
|
+
});
|
|
210
|
+
export const zDirectConnectionPollResource = z.object({
|
|
211
|
+
expires_at: z.iso.datetime(),
|
|
212
|
+
request_id: z.uuid(),
|
|
213
|
+
source_connection_id: z.uuid().nullish(),
|
|
214
|
+
state: zDirectConnectionRequestState,
|
|
215
|
+
});
|
|
216
|
+
/**
|
|
217
|
+
* One global discount or surcharge that affects the taxable base.
|
|
218
|
+
*/
|
|
219
|
+
export const zDocumentSchemaArtifactKind = z.enum(["complete_document", "rfce"]);
|
|
220
|
+
export const zElectronicFiscalDocumentSeries = z.enum(["E"]);
|
|
221
|
+
/**
|
|
222
|
+
* One document type in the DGII-published electronic fiscal-document catalog.
|
|
223
|
+
*/
|
|
224
|
+
export const zElectronicFiscalDocumentType = z.enum([
|
|
225
|
+
"31",
|
|
226
|
+
"32",
|
|
227
|
+
"33",
|
|
228
|
+
"34",
|
|
229
|
+
"41",
|
|
230
|
+
"43",
|
|
231
|
+
"44",
|
|
232
|
+
"45",
|
|
233
|
+
"46",
|
|
234
|
+
"47",
|
|
235
|
+
]);
|
|
236
|
+
/**
|
|
237
|
+
* The Rust engine build identity carried by every response.
|
|
238
|
+
*/
|
|
239
|
+
export const zEngineIdentity = z.object({
|
|
240
|
+
name: z.string().refine((text) => Array.from(text).length >= 1),
|
|
241
|
+
version: z.string().refine((text) => Array.from(text).length >= 1),
|
|
242
|
+
});
|
|
243
|
+
export const zEngineProblem = z.object({
|
|
244
|
+
code: z.string(),
|
|
245
|
+
message: z.string(),
|
|
246
|
+
path: z.string(),
|
|
247
|
+
});
|
|
248
|
+
export const zEngineProtocol = z.enum(["timbro.fiscal-engine.v3"]);
|
|
249
|
+
export const zEnrolledCertificateCustodyBindingResource = z.object({
|
|
250
|
+
binding_id: z.uuid(),
|
|
251
|
+
});
|
|
252
|
+
/**
|
|
253
|
+
* One e-CF document type implemented by this engine protocol revision.
|
|
254
|
+
*/
|
|
255
|
+
export const zEvaluatedFiscalDocumentType = z.enum([
|
|
256
|
+
"31",
|
|
257
|
+
"32",
|
|
258
|
+
"33",
|
|
259
|
+
"34",
|
|
260
|
+
"41",
|
|
261
|
+
"43",
|
|
262
|
+
"44",
|
|
263
|
+
"45",
|
|
264
|
+
"46",
|
|
265
|
+
"47",
|
|
266
|
+
]);
|
|
267
|
+
export const zEvaluatedOutcome = z.enum(["evaluated"]);
|
|
268
|
+
export const zEvaluatedSourceDocumentOutcome = z.enum(["evaluated"]);
|
|
269
|
+
export const zEvidenceAccessPurpose = z.enum([
|
|
270
|
+
"source_connection_artifact",
|
|
271
|
+
"workspace_user_artifact",
|
|
272
|
+
"fiscal_delivery_link",
|
|
273
|
+
"fiscal_receipt",
|
|
274
|
+
]);
|
|
275
|
+
export const zEvidenceAccessResultCode = z.enum([
|
|
276
|
+
"artifact_retrieved",
|
|
277
|
+
"artifact_missing",
|
|
278
|
+
"hash_mismatch",
|
|
279
|
+
"write_failed",
|
|
280
|
+
"vault_unavailable",
|
|
281
|
+
]);
|
|
282
|
+
/**
|
|
283
|
+
* Foreign customer identity admitted by the Type 46 export profile.
|
|
284
|
+
*/
|
|
285
|
+
export const zExternalEffectKind = z.enum([
|
|
286
|
+
"sign_complete_document",
|
|
287
|
+
"submit_complete_ecf",
|
|
288
|
+
"poll_authority_by_track_id",
|
|
289
|
+
"reconcile_authority_by_fiscal_identity",
|
|
290
|
+
"sign_consumer_summary",
|
|
291
|
+
"submit_consumer_summary",
|
|
292
|
+
"inquire_consumer_summary",
|
|
293
|
+
]);
|
|
294
|
+
/**
|
|
295
|
+
* One stable public document problem retained for a rejected admission.
|
|
296
|
+
*/
|
|
297
|
+
export const zFiscalAdmissionProblem = z.object({
|
|
298
|
+
code: z.string(),
|
|
299
|
+
message: z.string(),
|
|
300
|
+
path: z.string(),
|
|
301
|
+
});
|
|
302
|
+
export const zFiscalArtifactBytes = z.instanceof(Uint8Array);
|
|
303
|
+
/**
|
|
304
|
+
* One retained fiscal artifact kind addressable on the artifact route.
|
|
305
|
+
*/
|
|
306
|
+
export const zFiscalArtifactKind = z.enum([
|
|
307
|
+
"unsigned_complete_document",
|
|
308
|
+
"signed_complete_document",
|
|
309
|
+
"unsigned_consumer_summary",
|
|
310
|
+
"signed_consumer_summary",
|
|
311
|
+
"printed_representation",
|
|
312
|
+
]);
|
|
313
|
+
export const zFiscalArtifactMediaType = z.enum(["application/xml", "application/pdf"]);
|
|
314
|
+
/**
|
|
315
|
+
* DGII authority protocol selected by the Rust decision core from admitted fiscal facts.
|
|
316
|
+
*/
|
|
317
|
+
export const zFiscalAuthorityRoute = z.enum([
|
|
318
|
+
"complete_ecf_reception",
|
|
319
|
+
"consumer_summary_reception",
|
|
320
|
+
]);
|
|
321
|
+
/**
|
|
322
|
+
* Actor-facing buyer-delivery milestone projected from the immutable lifecycle event ledger.
|
|
323
|
+
*/
|
|
324
|
+
export const zBuyerDeliveryReadinessResource = lenientUnion([
|
|
325
|
+
z.object({
|
|
326
|
+
status: z.enum(["not_applicable"]),
|
|
327
|
+
}),
|
|
328
|
+
z.object({
|
|
329
|
+
authority_route: zFiscalAuthorityRoute,
|
|
330
|
+
status: z.enum(["pending"]),
|
|
331
|
+
}),
|
|
332
|
+
z.object({
|
|
333
|
+
authority_route: zFiscalAuthorityRoute,
|
|
334
|
+
ready_at: z.iso.datetime(),
|
|
335
|
+
status: z.enum(["ready"]),
|
|
336
|
+
}),
|
|
337
|
+
z.object({
|
|
338
|
+
status: z.enum(["unavailable"]),
|
|
339
|
+
terminal_result_code: zBuyerDeliveryTerminalResultCode,
|
|
340
|
+
}),
|
|
341
|
+
]);
|
|
342
|
+
/**
|
|
343
|
+
* Counterparty class that selects the legal e-CF type set.
|
|
344
|
+
*/
|
|
345
|
+
export const zFiscalCounterpartyClass = z.enum([
|
|
346
|
+
"taxpayer",
|
|
347
|
+
"consumer",
|
|
348
|
+
"government",
|
|
349
|
+
"special_regime",
|
|
350
|
+
"foreign",
|
|
351
|
+
"unregistered",
|
|
352
|
+
"no_counterparty",
|
|
353
|
+
]);
|
|
354
|
+
export const zFiscalDeliveryState = z.enum([
|
|
355
|
+
"pending",
|
|
356
|
+
"submitted",
|
|
357
|
+
"delivered",
|
|
358
|
+
"bounced",
|
|
359
|
+
"failed",
|
|
360
|
+
"suppressed",
|
|
361
|
+
]);
|
|
362
|
+
/**
|
|
363
|
+
* Stable semantic kind for a cross-document fiscal relationship.
|
|
364
|
+
*/
|
|
365
|
+
export const zFiscalDocumentRelationshipKind = z.enum(["modification"]);
|
|
366
|
+
/**
|
|
367
|
+
* DGII execution environment selected before lifecycle admission.
|
|
368
|
+
*/
|
|
369
|
+
export const zFiscalEnvironment = z.enum(["sandbox", "certification", "production"]);
|
|
370
|
+
/**
|
|
371
|
+
* Attributable ownership of the affected document reference.
|
|
372
|
+
*/
|
|
373
|
+
export const zAffectedFiscalDocumentResource = z.object({
|
|
374
|
+
attribution: zAffectedFiscalDocumentAttributionResource,
|
|
375
|
+
environment: zFiscalEnvironment,
|
|
376
|
+
fiscal_number: z.string().regex(/^(B[0-9]{10}|E[0-9]{12}|[AP][0-9]{18})$/),
|
|
377
|
+
issued_on: z.string().regex(/^[0-9]{2}-[0-9]{2}-[0-9]{4}$/),
|
|
378
|
+
issuer_tax_id: z.string().regex(/^[0-9]{9}([0-9]{2})?$/),
|
|
379
|
+
});
|
|
380
|
+
export const zCertificateCustodyReadiness = lenientUnion([
|
|
381
|
+
z.object({
|
|
382
|
+
environment: zFiscalEnvironment,
|
|
383
|
+
legal_issuer_id: z.uuid(),
|
|
384
|
+
organization_id: z.uuid(),
|
|
385
|
+
status: z.enum(["not_configured"]),
|
|
386
|
+
}),
|
|
387
|
+
z.object({
|
|
388
|
+
binding: zEnrolledCertificateCustodyBindingResource,
|
|
389
|
+
environment: zFiscalEnvironment,
|
|
390
|
+
legal_issuer_id: z.uuid(),
|
|
391
|
+
organization_id: z.uuid(),
|
|
392
|
+
status: z.enum(["awaiting_certificate_registration"]),
|
|
393
|
+
}),
|
|
394
|
+
z.object({
|
|
395
|
+
binding: zActiveCertificateCustodyBindingResource,
|
|
396
|
+
certificate: zCertificateCustodyCertificateResource,
|
|
397
|
+
environment: zFiscalEnvironment,
|
|
398
|
+
legal_issuer_id: z.uuid(),
|
|
399
|
+
organization_id: z.uuid(),
|
|
400
|
+
status: z.enum(["ready"]),
|
|
401
|
+
}),
|
|
402
|
+
]);
|
|
403
|
+
export const zDirectConnectionPreviewResource = z.object({
|
|
404
|
+
company_id: z.string(),
|
|
405
|
+
company_name: z.string(),
|
|
406
|
+
company_tax_id: z.string(),
|
|
407
|
+
environment: zFiscalEnvironment,
|
|
408
|
+
expires_at: z.iso.datetime(),
|
|
409
|
+
installation_id: z.string(),
|
|
410
|
+
request_id: z.uuid(),
|
|
411
|
+
software_version: z.string(),
|
|
412
|
+
state: zDirectConnectionRequestState,
|
|
413
|
+
});
|
|
414
|
+
export const zFiscalDocumentRelationshipResource = z.object({
|
|
415
|
+
affected_document: zAffectedFiscalDocumentResource,
|
|
416
|
+
created_at: z.iso.datetime(),
|
|
417
|
+
modification_code: z.string().regex(/^[1-5]$/),
|
|
418
|
+
reason: z
|
|
419
|
+
.string()
|
|
420
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
421
|
+
.refine((text) => Array.from(text).length <= 90),
|
|
422
|
+
relationship_kind: zFiscalDocumentRelationshipKind,
|
|
423
|
+
});
|
|
424
|
+
export const zFiscalEnvironmentName = z.enum(["sandbox"]);
|
|
425
|
+
export const zFiscalIdentityResource = lenientUnion([
|
|
426
|
+
z.object({
|
|
427
|
+
document_type: z.enum(["31"]),
|
|
428
|
+
fiscal_number: z.string().regex(/^E31[0-9]{10}$/),
|
|
429
|
+
}),
|
|
430
|
+
z.object({
|
|
431
|
+
document_type: z.enum(["32"]),
|
|
432
|
+
fiscal_number: z.string().regex(/^E32[0-9]{10}$/),
|
|
433
|
+
}),
|
|
434
|
+
z.object({
|
|
435
|
+
document_type: z.enum(["33"]),
|
|
436
|
+
fiscal_number: z.string().regex(/^E33[0-9]{10}$/),
|
|
437
|
+
}),
|
|
438
|
+
z.object({
|
|
439
|
+
document_type: z.enum(["34"]),
|
|
440
|
+
fiscal_number: z.string().regex(/^E34[0-9]{10}$/),
|
|
441
|
+
}),
|
|
442
|
+
z.object({
|
|
443
|
+
document_type: z.enum(["41"]),
|
|
444
|
+
fiscal_number: z.string().regex(/^E41[0-9]{10}$/),
|
|
445
|
+
}),
|
|
446
|
+
z.object({
|
|
447
|
+
document_type: z.enum(["43"]),
|
|
448
|
+
fiscal_number: z.string().regex(/^E43[0-9]{10}$/),
|
|
449
|
+
}),
|
|
450
|
+
z.object({
|
|
451
|
+
document_type: z.enum(["44"]),
|
|
452
|
+
fiscal_number: z.string().regex(/^E44[0-9]{10}$/),
|
|
453
|
+
}),
|
|
454
|
+
z.object({
|
|
455
|
+
document_type: z.enum(["45"]),
|
|
456
|
+
fiscal_number: z.string().regex(/^E45[0-9]{10}$/),
|
|
457
|
+
}),
|
|
458
|
+
z.object({
|
|
459
|
+
document_type: z.enum(["46"]),
|
|
460
|
+
fiscal_number: z.string().regex(/^E46[0-9]{10}$/),
|
|
461
|
+
}),
|
|
462
|
+
z.object({
|
|
463
|
+
document_type: z.enum(["47"]),
|
|
464
|
+
fiscal_number: z.string().regex(/^E47[0-9]{10}$/),
|
|
465
|
+
}),
|
|
466
|
+
]);
|
|
467
|
+
/**
|
|
468
|
+
* Issued versus acquisition commercial direction.
|
|
469
|
+
*/
|
|
470
|
+
export const zFiscalIssuanceDirection = z.enum(["issued", "acquisition"]);
|
|
471
|
+
export const zElectronicFiscalDocumentEligibilityResource = z.object({
|
|
472
|
+
counterparty_class: zFiscalCounterpartyClass,
|
|
473
|
+
direction: zFiscalIssuanceDirection,
|
|
474
|
+
document_types: z.array(zElectronicFiscalDocumentType),
|
|
475
|
+
});
|
|
476
|
+
/**
|
|
477
|
+
* One typed item reference declared on a fiscal line.
|
|
478
|
+
*/
|
|
479
|
+
export const zFiscalLifecycleResultCode = z.enum([
|
|
480
|
+
"authority_fiscal_identity_not_found",
|
|
481
|
+
"authority_fiscal_identity_reconciliation_requested",
|
|
482
|
+
"authority_inquiry_inconclusive",
|
|
483
|
+
"authority_inquiry_retry_requested",
|
|
484
|
+
"authority_status_accepted",
|
|
485
|
+
"authority_status_accepted_with_findings",
|
|
486
|
+
"authority_status_processing",
|
|
487
|
+
"authority_status_rejected",
|
|
488
|
+
"authority_submission_outcome_unknown",
|
|
489
|
+
"authority_submission_recorded",
|
|
490
|
+
"authority_submission_rejected",
|
|
491
|
+
"authority_submission_requested",
|
|
492
|
+
"authority_submission_retry_requested",
|
|
493
|
+
"authority_track_poll_not_found",
|
|
494
|
+
"authority_track_poll_requested",
|
|
495
|
+
"commercially_accepted",
|
|
496
|
+
"commercially_rejected",
|
|
497
|
+
"consumer_summary_accepted",
|
|
498
|
+
"consumer_summary_accepted_with_findings",
|
|
499
|
+
"consumer_summary_inquiry_inconclusive",
|
|
500
|
+
"consumer_summary_inquiry_not_found",
|
|
501
|
+
"consumer_summary_inquiry_requested",
|
|
502
|
+
"consumer_summary_inquiry_retry_requested",
|
|
503
|
+
"consumer_summary_rejected",
|
|
504
|
+
"consumer_summary_signed",
|
|
505
|
+
"consumer_summary_signing_failed",
|
|
506
|
+
"consumer_summary_signing_replay_horizon_expired",
|
|
507
|
+
"consumer_summary_signing_requested",
|
|
508
|
+
"consumer_summary_signing_retry_requested",
|
|
509
|
+
"consumer_summary_submission_outcome_unknown",
|
|
510
|
+
"consumer_summary_submission_requested",
|
|
511
|
+
"consumer_summary_submission_retry_requested",
|
|
512
|
+
"custody_effect_replay_capability_unavailable",
|
|
513
|
+
"custody_effect_replay_horizon_expired",
|
|
514
|
+
"fiscal_attempt_budget_exhausted",
|
|
515
|
+
"fiscal_document_signed",
|
|
516
|
+
"fiscal_operation_admitted",
|
|
517
|
+
"fiscal_operation_delivery_ready",
|
|
518
|
+
"fiscal_operation_rejected",
|
|
519
|
+
"fiscal_signing_failed",
|
|
520
|
+
"fiscal_signing_replay_capability_unavailable",
|
|
521
|
+
"fiscal_signing_replay_horizon_expired",
|
|
522
|
+
"fiscal_signing_requested",
|
|
523
|
+
"fiscal_signing_retry_requested",
|
|
524
|
+
]);
|
|
525
|
+
/**
|
|
526
|
+
* One fiscal line admitted by sales and adjustment document profiles.
|
|
527
|
+
*/
|
|
528
|
+
export const zFiscalLineTotal = z.object({
|
|
529
|
+
net: z.string().regex(/^-?[0-9]+\.[0-9]{2}$/),
|
|
530
|
+
source_line_id: z.string().refine((text) => Array.from(text).length <= 128),
|
|
531
|
+
tax: z.string().regex(/^-?[0-9]+\.[0-9]{2}$/),
|
|
532
|
+
total: z.string().regex(/^-?[0-9]+\.[0-9]{2}$/),
|
|
533
|
+
});
|
|
534
|
+
/**
|
|
535
|
+
* One ordinary fiscal line whose profile admits only the legal-tip code.
|
|
536
|
+
*/
|
|
537
|
+
export const zFiscalNumberAuthorizationKnowledge = z.enum(["verified", "reported"]);
|
|
538
|
+
export const zFiscalNumberAuthorizationReadinessStatus = z.enum(["ready", "action_required"]);
|
|
539
|
+
/**
|
|
540
|
+
* Origin of a fiscal-number authorization fact.
|
|
541
|
+
*/
|
|
542
|
+
export const zFiscalNumberAuthorizationSourceKind = z.enum([
|
|
543
|
+
"official_source_manifest",
|
|
544
|
+
"operator_attested",
|
|
545
|
+
"caller_reported",
|
|
546
|
+
]);
|
|
547
|
+
/**
|
|
548
|
+
* Lifecycle state of a fiscal-number authorization fact.
|
|
549
|
+
*/
|
|
550
|
+
export const zFiscalNumberAuthorizationState = z.enum([
|
|
551
|
+
"active",
|
|
552
|
+
"suspended",
|
|
553
|
+
"cancelled",
|
|
554
|
+
"superseded",
|
|
555
|
+
"exhausted",
|
|
556
|
+
"conflicting",
|
|
557
|
+
]);
|
|
558
|
+
export const zFiscalNumberAuthorizationUnavailableReason = z.enum([
|
|
559
|
+
"authorization_missing",
|
|
560
|
+
"authorization_not_active",
|
|
561
|
+
"authorization_not_verified",
|
|
562
|
+
"authorization_not_observed",
|
|
563
|
+
"range_exhausted",
|
|
564
|
+
"authorization_expiration_invalid",
|
|
565
|
+
"authorization_expired",
|
|
566
|
+
"authorization_range_overlap",
|
|
567
|
+
]);
|
|
568
|
+
/**
|
|
569
|
+
* Caller instruction that selects how a Fiscal operation obtains its e-NCF.
|
|
570
|
+
*
|
|
571
|
+
* The instruction is independent from every commercial document variant. Both assignment
|
|
572
|
+
* strategies resolve to the same [`NumberedFiscalDocument`] value.
|
|
573
|
+
*/
|
|
574
|
+
export const zFiscalOperationAmountsResource = z.object({
|
|
575
|
+
net: z.string().regex(/^-?[0-9]+\.[0-9]{2}$/),
|
|
576
|
+
non_billable: z.string().regex(/^-?[0-9]+\.[0-9]{2}$/),
|
|
577
|
+
tax: z.string().regex(/^-?[0-9]+\.[0-9]{2}$/),
|
|
578
|
+
total: z.string().regex(/^-?[0-9]+\.[0-9]{2}$/),
|
|
579
|
+
});
|
|
580
|
+
export const zFiscalOperationDiagnosticResource = z.object({
|
|
581
|
+
code: z
|
|
582
|
+
.string()
|
|
583
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
584
|
+
.refine((text) => Array.from(text).length <= 100),
|
|
585
|
+
message: z
|
|
586
|
+
.string()
|
|
587
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
588
|
+
.refine((text) => Array.from(text).length <= 300),
|
|
589
|
+
path: z
|
|
590
|
+
.string()
|
|
591
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
592
|
+
.refine((text) => Array.from(text).length <= 512),
|
|
593
|
+
});
|
|
594
|
+
export const zFiscalOperationLatestEventResource = z.object({
|
|
595
|
+
event_id: z.uuid(),
|
|
596
|
+
occurred_at: z.iso.datetime(),
|
|
597
|
+
sequence: z.string().regex(/^[1-9][0-9]*$/),
|
|
598
|
+
});
|
|
599
|
+
export const zFiscalOperationOperatorRequiredTerminality = z.enum(["operator_required"]);
|
|
600
|
+
export const zFiscalOperationPendingTerminality = z.enum(["pending"]);
|
|
601
|
+
export const zFiscalOperationProcessingStage = z.enum([
|
|
602
|
+
"admitted",
|
|
603
|
+
"signed",
|
|
604
|
+
"consumer_summary_signed",
|
|
605
|
+
"submitted",
|
|
606
|
+
"authority_processing",
|
|
607
|
+
]);
|
|
608
|
+
export const zFiscalOperationSource = z.object({
|
|
609
|
+
content_sha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
610
|
+
id: z
|
|
611
|
+
.string()
|
|
612
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
613
|
+
.refine((text) => Array.from(text).length <= 128)
|
|
614
|
+
.regex(/^[^\p{White_Space}](?:[\s\S]*[^\p{White_Space}])?$/u),
|
|
615
|
+
version: z
|
|
616
|
+
.string()
|
|
617
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
618
|
+
.refine((text) => Array.from(text).length <= 128)
|
|
619
|
+
.regex(/^[^\p{White_Space}](?:[\s\S]*[^\p{White_Space}])?$/u),
|
|
620
|
+
});
|
|
621
|
+
export const zFiscalOperationTerminalTerminality = z.enum(["terminal"]);
|
|
622
|
+
export const zFiscalOperationOutcomeResource = lenientUnion([
|
|
623
|
+
z.object({
|
|
624
|
+
outcome: z.enum(["rejected"]),
|
|
625
|
+
terminality: zFiscalOperationTerminalTerminality,
|
|
626
|
+
}),
|
|
627
|
+
z.object({
|
|
628
|
+
fiscal_identity: zFiscalIdentityResource,
|
|
629
|
+
outcome: z.enum(["processing"]),
|
|
630
|
+
stage: zFiscalOperationProcessingStage,
|
|
631
|
+
terminality: zFiscalOperationPendingTerminality,
|
|
632
|
+
}),
|
|
633
|
+
z.object({
|
|
634
|
+
fiscal_identity: zFiscalIdentityResource,
|
|
635
|
+
outcome: z.enum(["outcome_unknown"]),
|
|
636
|
+
terminality: zFiscalOperationPendingTerminality,
|
|
637
|
+
}),
|
|
638
|
+
z.object({
|
|
639
|
+
fiscal_identity: zFiscalIdentityResource,
|
|
640
|
+
outcome: z.enum(["accepted"]),
|
|
641
|
+
terminality: zFiscalOperationTerminalTerminality,
|
|
642
|
+
}),
|
|
643
|
+
z.object({
|
|
644
|
+
fiscal_identity: zFiscalIdentityResource,
|
|
645
|
+
outcome: z.enum(["accepted_with_findings"]),
|
|
646
|
+
terminality: zFiscalOperationTerminalTerminality,
|
|
647
|
+
}),
|
|
648
|
+
z.object({
|
|
649
|
+
fiscal_identity: zFiscalIdentityResource,
|
|
650
|
+
outcome: z.enum(["authority_rejected"]),
|
|
651
|
+
terminality: zFiscalOperationOperatorRequiredTerminality,
|
|
652
|
+
}),
|
|
653
|
+
z.object({
|
|
654
|
+
fiscal_identity: zFiscalIdentityResource,
|
|
655
|
+
outcome: z.enum(["intervention_required"]),
|
|
656
|
+
terminality: zFiscalOperationOperatorRequiredTerminality,
|
|
657
|
+
}),
|
|
658
|
+
]);
|
|
659
|
+
/**
|
|
660
|
+
* Adds the pre-lifecycle rejection that no [`FiscalOperationStage`] represents.
|
|
661
|
+
*/
|
|
662
|
+
export const zFiscalOperationTransitionState = z.enum([
|
|
663
|
+
"rejected",
|
|
664
|
+
"admitted",
|
|
665
|
+
"signed",
|
|
666
|
+
"consumer_summary_signed",
|
|
667
|
+
"submitted",
|
|
668
|
+
"authority_processing",
|
|
669
|
+
"submission_outcome_unknown",
|
|
670
|
+
"authority_accepted",
|
|
671
|
+
"authority_accepted_with_findings",
|
|
672
|
+
"authority_rejected",
|
|
673
|
+
"intervention_required",
|
|
674
|
+
]);
|
|
675
|
+
/**
|
|
676
|
+
* Deterministic totals calculated for one fiscal document.
|
|
677
|
+
*
|
|
678
|
+
* `total` covers the billable lines only, so the line totals reconcile as
|
|
679
|
+
* `total + non_billable`.
|
|
680
|
+
*/
|
|
681
|
+
export const zFiscalTotals = z.object({
|
|
682
|
+
lines: z.array(zFiscalLineTotal).min(1),
|
|
683
|
+
net: z.string().regex(/^-?[0-9]+\.[0-9]{2}$/),
|
|
684
|
+
non_billable: z.string().regex(/^-?[0-9]+\.[0-9]{2}$/),
|
|
685
|
+
tax: z.string().regex(/^-?[0-9]+\.[0-9]{2}$/),
|
|
686
|
+
total: z.string().regex(/^-?[0-9]+\.[0-9]{2}$/),
|
|
687
|
+
});
|
|
688
|
+
/**
|
|
689
|
+
* Other-currency header: official currency code and conversion factor.
|
|
690
|
+
*/
|
|
691
|
+
export const zHealthStatus = z.enum(["ok", "unavailable"]);
|
|
692
|
+
export const zHealthLiveResponse = z.object({
|
|
693
|
+
commit: z.string(),
|
|
694
|
+
status: zHealthStatus,
|
|
695
|
+
});
|
|
696
|
+
export const zHealthReadyResponse = z.object({
|
|
697
|
+
commit: z.string(),
|
|
698
|
+
schema_version: z.int().gte(1).lte(2147483647).nullable(),
|
|
699
|
+
status: zHealthStatus,
|
|
700
|
+
});
|
|
701
|
+
export const zHostedImportResponse = z.object({
|
|
702
|
+
certificate_subject_common_name: z
|
|
703
|
+
.string()
|
|
704
|
+
.refine((text) => Array.from(text).length <= 256)
|
|
705
|
+
.nullable(),
|
|
706
|
+
object: z.string(),
|
|
707
|
+
signer_subject_serial_number: z.string(),
|
|
708
|
+
});
|
|
709
|
+
export const zHostedInvoiceCredentialEnvironment = z.enum(["sandbox", "production"]);
|
|
710
|
+
export const zHostedInvoiceCredentialResponse = z.object({
|
|
711
|
+
credential: z.string(),
|
|
712
|
+
environment: zHostedInvoiceCredentialEnvironment,
|
|
713
|
+
object: z.string(),
|
|
714
|
+
source_connection_id: z.uuid(),
|
|
715
|
+
});
|
|
716
|
+
export const zHostedTenantResource = z.object({
|
|
717
|
+
hosted_tenant_binding_id: z.uuid(),
|
|
718
|
+
legal_issuer_id: z.uuid(),
|
|
719
|
+
organization_id: z.uuid(),
|
|
720
|
+
source_connection_id: z.uuid(),
|
|
721
|
+
webhook_endpoint_id: z.uuid(),
|
|
722
|
+
webhook_signing_secret: z.string().nullable(),
|
|
723
|
+
});
|
|
724
|
+
export const zHostedWebhookSecretRotation = z.object({
|
|
725
|
+
previous_secret_expires_at: z.iso.datetime(),
|
|
726
|
+
webhook_endpoint_id: z.uuid(),
|
|
727
|
+
webhook_signing_secret: z.string(),
|
|
728
|
+
});
|
|
729
|
+
export const zIdentityEmailSchema = z
|
|
730
|
+
.email()
|
|
731
|
+
.refine((text) => Array.from(text).length <= 320)
|
|
732
|
+
.regex(/^(?=.{1,320}$)(?=[^@]{1,64}@)[A-Za-z0-9](?:[A-Za-z0-9_+-]*[A-Za-z0-9])?(?:\.[A-Za-z0-9](?:[A-Za-z0-9_+-]*[A-Za-z0-9])?)*@(?=[^@]{1,254}$)[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?(?:\.[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*\.[A-Za-z]{2,63}$/);
|
|
733
|
+
export const zInvitationStatus = z.enum(["pending", "accepted", "expired"]);
|
|
734
|
+
export const zInvoiceAffectedDocumentAttribution = lenientUnion([
|
|
735
|
+
z.object({
|
|
736
|
+
invoiceId: z.uuid(),
|
|
737
|
+
kind: z.enum(["internalOperation"]),
|
|
738
|
+
}),
|
|
739
|
+
z.object({
|
|
740
|
+
kind: z.enum(["externalDocument"]),
|
|
741
|
+
sourceReference: z.string(),
|
|
742
|
+
}),
|
|
743
|
+
]);
|
|
744
|
+
export const zInvoiceAffectedFiscalDocument = z.object({
|
|
745
|
+
attribution: zInvoiceAffectedDocumentAttribution,
|
|
746
|
+
environment: zFiscalEnvironment,
|
|
747
|
+
fiscalNumber: z.string(),
|
|
748
|
+
issuedOn: z.string(),
|
|
749
|
+
issuerTaxId: z.string(),
|
|
750
|
+
});
|
|
751
|
+
export const zInvoiceBuyerDeliveryReadiness = lenientUnion([
|
|
752
|
+
z.object({
|
|
753
|
+
status: z.enum(["notApplicable"]),
|
|
754
|
+
}),
|
|
755
|
+
z.object({
|
|
756
|
+
authorityRoute: zFiscalAuthorityRoute,
|
|
757
|
+
status: z.enum(["pending"]),
|
|
758
|
+
}),
|
|
759
|
+
z.object({
|
|
760
|
+
authorityRoute: zFiscalAuthorityRoute,
|
|
761
|
+
readyAt: z.iso.datetime(),
|
|
762
|
+
status: z.enum(["ready"]),
|
|
763
|
+
}),
|
|
764
|
+
z.object({
|
|
765
|
+
status: z.enum(["unavailable"]),
|
|
766
|
+
terminalResultCode: zBuyerDeliveryTerminalResultCode,
|
|
767
|
+
}),
|
|
768
|
+
]);
|
|
769
|
+
export const zInvoiceBuyerIdentity = lenientUnion([
|
|
770
|
+
z.object({
|
|
771
|
+
kind: z.enum(["anonymous"]),
|
|
772
|
+
}),
|
|
773
|
+
z.object({
|
|
774
|
+
kind: z.enum(["domestic"]),
|
|
775
|
+
legalName: z
|
|
776
|
+
.string()
|
|
777
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
778
|
+
.refine((text) => Array.from(text).length <= 150)
|
|
779
|
+
.regex(/^(?=.*[^\p{White_Space}])[\s\S]+$/u),
|
|
780
|
+
taxId: z.string().regex(/^[0-9]{9}([0-9]{2})?$/),
|
|
781
|
+
}),
|
|
782
|
+
z.object({
|
|
783
|
+
foreignId: z
|
|
784
|
+
.string()
|
|
785
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
786
|
+
.refine((text) => Array.from(text).length <= 20)
|
|
787
|
+
.regex(/^(?=.*[^\p{White_Space}])[\s\S]+$/u),
|
|
788
|
+
kind: z.enum(["foreign"]),
|
|
789
|
+
legalName: z
|
|
790
|
+
.string()
|
|
791
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
792
|
+
.refine((text) => Array.from(text).length <= 150)
|
|
793
|
+
.regex(/^(?=.*[^\p{White_Space}])[\s\S]+$/u),
|
|
794
|
+
}),
|
|
795
|
+
]);
|
|
796
|
+
export const zInvoiceCorrection = z.object({
|
|
797
|
+
affectedDocument: zInvoiceAffectedFiscalDocument,
|
|
798
|
+
createdAt: z.iso.datetime(),
|
|
799
|
+
modificationCode: z.string(),
|
|
800
|
+
reason: z.string(),
|
|
801
|
+
relationshipKind: zFiscalDocumentRelationshipKind,
|
|
802
|
+
});
|
|
803
|
+
export const zInvoiceDeliveryResource = z.object({
|
|
804
|
+
createdAt: z.iso.datetime(),
|
|
805
|
+
id: z.uuid(),
|
|
806
|
+
invoiceId: z.uuid(),
|
|
807
|
+
lastResultCode: z.string().nullable(),
|
|
808
|
+
link: z.string(),
|
|
809
|
+
providerDeliveryId: z.string().nullable(),
|
|
810
|
+
recipientEmail: z.string(),
|
|
811
|
+
state: zFiscalDeliveryState,
|
|
812
|
+
updatedAt: z.iso.datetime(),
|
|
813
|
+
});
|
|
814
|
+
export const zInvoiceDiagnostic = z.object({
|
|
815
|
+
code: z.string(),
|
|
816
|
+
message: z.string(),
|
|
817
|
+
path: z.string(),
|
|
818
|
+
});
|
|
819
|
+
export const zInvoiceForeignCurrencyResource = z.object({
|
|
820
|
+
currencyCode: z.enum([
|
|
821
|
+
"BRL",
|
|
822
|
+
"CAD",
|
|
823
|
+
"CHF",
|
|
824
|
+
"CHY",
|
|
825
|
+
"XDR",
|
|
826
|
+
"DKK",
|
|
827
|
+
"EUR",
|
|
828
|
+
"GBP",
|
|
829
|
+
"JPY",
|
|
830
|
+
"NOK",
|
|
831
|
+
"SCP",
|
|
832
|
+
"SEK",
|
|
833
|
+
"USD",
|
|
834
|
+
"VEF",
|
|
835
|
+
"HTG",
|
|
836
|
+
"MXN",
|
|
837
|
+
"COP",
|
|
838
|
+
]),
|
|
839
|
+
exchangeRate: z.string().regex(/^(?=[0-9.]*[1-9])[0-9]{1,3}(\.[0-9]{1,4})?$/),
|
|
840
|
+
});
|
|
841
|
+
export const zInvoiceForeignPayee = z.object({
|
|
842
|
+
foreignId: z
|
|
843
|
+
.string()
|
|
844
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
845
|
+
.refine((text) => Array.from(text).length <= 20)
|
|
846
|
+
.regex(/^(?=.*[^\p{White_Space}])[\s\S]+$/u),
|
|
847
|
+
legalName: z
|
|
848
|
+
.string()
|
|
849
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
850
|
+
.refine((text) => Array.from(text).length <= 150)
|
|
851
|
+
.regex(/^(?=.*[^\p{White_Space}])[\s\S]+$/u),
|
|
852
|
+
});
|
|
853
|
+
export const zInvoiceForeignPaymentWithholdingBasis = z.object({
|
|
854
|
+
authorityReference: z
|
|
855
|
+
.string()
|
|
856
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
857
|
+
.regex(/^(?=.*[^\p{White_Space}])[\s\S]+$/u),
|
|
858
|
+
kind: z.enum(["dominicanSourceIncome"]),
|
|
859
|
+
});
|
|
860
|
+
export const zInvoiceForeignPaymentResource = z.object({
|
|
861
|
+
payee: zInvoiceForeignPayee,
|
|
862
|
+
withholdingBasis: zInvoiceForeignPaymentWithholdingBasis,
|
|
863
|
+
});
|
|
864
|
+
export const zInvoiceGovernmentEligibility = lenientUnion([
|
|
865
|
+
z.object({
|
|
866
|
+
authorityReference: z
|
|
867
|
+
.string()
|
|
868
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
869
|
+
.regex(/^(?=.*[^\p{White_Space}])[\s\S]+$/u),
|
|
870
|
+
entityKind: z.enum(["central_government"]),
|
|
871
|
+
}),
|
|
872
|
+
z.object({
|
|
873
|
+
authorityReference: z
|
|
874
|
+
.string()
|
|
875
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
876
|
+
.regex(/^(?=.*[^\p{White_Space}])[\s\S]+$/u),
|
|
877
|
+
entityKind: z.enum(["decentralized_or_autonomous"]),
|
|
878
|
+
}),
|
|
879
|
+
z.object({
|
|
880
|
+
authorityReference: z
|
|
881
|
+
.string()
|
|
882
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
883
|
+
.regex(/^(?=.*[^\p{White_Space}])[\s\S]+$/u),
|
|
884
|
+
entityKind: z.enum(["social_security"]),
|
|
885
|
+
}),
|
|
886
|
+
z.object({
|
|
887
|
+
authorityReference: z
|
|
888
|
+
.string()
|
|
889
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
890
|
+
.regex(/^(?=.*[^\p{White_Space}])[\s\S]+$/u),
|
|
891
|
+
entityKind: z.enum(["other_noncommercial_government"]),
|
|
892
|
+
}),
|
|
893
|
+
]);
|
|
894
|
+
export const zInvoiceItemCodeResource = z.object({
|
|
895
|
+
code: z
|
|
896
|
+
.string()
|
|
897
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
898
|
+
.refine((text) => Array.from(text).length <= 35)
|
|
899
|
+
.refine((text) => Array.from(text).every((character) => character.length === 2 ||
|
|
900
|
+
character.charCodeAt(0) === 9 ||
|
|
901
|
+
character.charCodeAt(0) === 10 ||
|
|
902
|
+
character.charCodeAt(0) === 13 ||
|
|
903
|
+
(character.charCodeAt(0) >= 32 && character.charCodeAt(0) <= 55295) ||
|
|
904
|
+
(character.charCodeAt(0) >= 57344 && character.charCodeAt(0) <= 65533)) &&
|
|
905
|
+
Array.from(text).some((character) => character.length === 2 ||
|
|
906
|
+
(character.charCodeAt(0) >= 33 && character.charCodeAt(0) <= 126) ||
|
|
907
|
+
(character.charCodeAt(0) >= 127 && character.charCodeAt(0) <= 132) ||
|
|
908
|
+
(character.charCodeAt(0) >= 134 && character.charCodeAt(0) <= 159) ||
|
|
909
|
+
(character.charCodeAt(0) >= 161 && character.charCodeAt(0) <= 5759) ||
|
|
910
|
+
(character.charCodeAt(0) >= 5761 && character.charCodeAt(0) <= 8191) ||
|
|
911
|
+
(character.charCodeAt(0) >= 8203 && character.charCodeAt(0) <= 8231) ||
|
|
912
|
+
(character.charCodeAt(0) >= 8234 && character.charCodeAt(0) <= 8238) ||
|
|
913
|
+
(character.charCodeAt(0) >= 8240 && character.charCodeAt(0) <= 8286) ||
|
|
914
|
+
(character.charCodeAt(0) >= 8288 && character.charCodeAt(0) <= 12287) ||
|
|
915
|
+
(character.charCodeAt(0) >= 12289 && character.charCodeAt(0) <= 55295) ||
|
|
916
|
+
(character.charCodeAt(0) >= 57344 && character.charCodeAt(0) <= 65533))),
|
|
917
|
+
typeCode: z
|
|
918
|
+
.string()
|
|
919
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
920
|
+
.refine((text) => Array.from(text).length <= 14)
|
|
921
|
+
.refine((text) => Array.from(text).every((character) => character.length === 2 ||
|
|
922
|
+
character.charCodeAt(0) === 9 ||
|
|
923
|
+
character.charCodeAt(0) === 10 ||
|
|
924
|
+
character.charCodeAt(0) === 13 ||
|
|
925
|
+
(character.charCodeAt(0) >= 32 && character.charCodeAt(0) <= 55295) ||
|
|
926
|
+
(character.charCodeAt(0) >= 57344 && character.charCodeAt(0) <= 65533)) &&
|
|
927
|
+
Array.from(text).some((character) => character.length === 2 ||
|
|
928
|
+
(character.charCodeAt(0) >= 33 && character.charCodeAt(0) <= 126) ||
|
|
929
|
+
(character.charCodeAt(0) >= 127 && character.charCodeAt(0) <= 132) ||
|
|
930
|
+
(character.charCodeAt(0) >= 134 && character.charCodeAt(0) <= 159) ||
|
|
931
|
+
(character.charCodeAt(0) >= 161 && character.charCodeAt(0) <= 5759) ||
|
|
932
|
+
(character.charCodeAt(0) >= 5761 && character.charCodeAt(0) <= 8191) ||
|
|
933
|
+
(character.charCodeAt(0) >= 8203 && character.charCodeAt(0) <= 8231) ||
|
|
934
|
+
(character.charCodeAt(0) >= 8234 && character.charCodeAt(0) <= 8238) ||
|
|
935
|
+
(character.charCodeAt(0) >= 8240 && character.charCodeAt(0) <= 8286) ||
|
|
936
|
+
(character.charCodeAt(0) >= 8288 && character.charCodeAt(0) <= 12287) ||
|
|
937
|
+
(character.charCodeAt(0) >= 12289 && character.charCodeAt(0) <= 55295) ||
|
|
938
|
+
(character.charCodeAt(0) >= 57344 && character.charCodeAt(0) <= 65533))),
|
|
939
|
+
});
|
|
940
|
+
export const zInvoiceItemWithholding = lenientUnion([
|
|
941
|
+
z.object({
|
|
942
|
+
incomeTaxAmount: z
|
|
943
|
+
.string()
|
|
944
|
+
.regex(/^[0-9]{1,16}(\.[0-9]{1,2})?$/)
|
|
945
|
+
.nullable(),
|
|
946
|
+
itbisAmount: z
|
|
947
|
+
.string()
|
|
948
|
+
.regex(/^[0-9]{1,16}(\.[0-9]{1,2})?$/)
|
|
949
|
+
.nullable(),
|
|
950
|
+
kind: z.enum(["purchase"]),
|
|
951
|
+
}),
|
|
952
|
+
z.object({
|
|
953
|
+
incomeTaxWithheld: z.string().regex(/^[0-9]{1,16}(\.[0-9]{1,2})?$/),
|
|
954
|
+
kind: z.enum(["foreignPayment"]),
|
|
955
|
+
}),
|
|
956
|
+
]);
|
|
957
|
+
export const zInvoiceLatestEvent = z.object({
|
|
958
|
+
eventId: z.uuid(),
|
|
959
|
+
occurredAt: z.iso.datetime(),
|
|
960
|
+
sequence: z.string().regex(/^[1-9][0-9]*$/),
|
|
961
|
+
});
|
|
962
|
+
export const zInvoicePdfLayout = z.enum(["a4", "receipt80mm"]);
|
|
963
|
+
export const zInvoicePdfStage = z.enum([
|
|
964
|
+
"awaitingSignedSource",
|
|
965
|
+
"queued",
|
|
966
|
+
"rendering",
|
|
967
|
+
"retryScheduled",
|
|
968
|
+
]);
|
|
969
|
+
export const zInvoiceProcessingStage = z.enum([
|
|
970
|
+
"admitted",
|
|
971
|
+
"signed",
|
|
972
|
+
"consumerSummarySigned",
|
|
973
|
+
"submitted",
|
|
974
|
+
"authorityProcessing",
|
|
975
|
+
]);
|
|
976
|
+
export const zInvoiceReceiptAccess = z.object({
|
|
977
|
+
accessToken: z
|
|
978
|
+
.string()
|
|
979
|
+
.refine((text) => Array.from(text).length >= 43)
|
|
980
|
+
.refine((text) => Array.from(text).length <= 43)
|
|
981
|
+
.regex(/^[A-Za-z0-9_-]{43}$/),
|
|
982
|
+
id: z.uuid(),
|
|
983
|
+
invoiceId: z.uuid(),
|
|
984
|
+
});
|
|
985
|
+
export const zInvoiceReceiptCurrency = z.enum(["DOP"]);
|
|
986
|
+
export const zInvoiceReceiptStatus = z.enum(["accepted", "acceptedWithObservations"]);
|
|
987
|
+
export const zInvoiceSource = z.object({
|
|
988
|
+
contentSha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
989
|
+
id: z.string(),
|
|
990
|
+
version: z.string(),
|
|
991
|
+
});
|
|
992
|
+
export const zInvoiceSupplierResource = z.object({
|
|
993
|
+
address: z
|
|
994
|
+
.string()
|
|
995
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
996
|
+
.refine((text) => Array.from(text).length <= 100)
|
|
997
|
+
.regex(/^(?=.*[^\p{White_Space}])[\s\S]+$/u)
|
|
998
|
+
.nullable(),
|
|
999
|
+
contactName: z
|
|
1000
|
+
.string()
|
|
1001
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
1002
|
+
.refine((text) => Array.from(text).length <= 80)
|
|
1003
|
+
.regex(/^(?=.*[^\p{White_Space}])[\s\S]+$/u)
|
|
1004
|
+
.nullable(),
|
|
1005
|
+
email: z
|
|
1006
|
+
.string()
|
|
1007
|
+
.refine((text) => Array.from(text).length <= 80)
|
|
1008
|
+
.regex(/^[\p{L}\p{M}\p{N}\p{S}]+(?:[-.][\p{L}\p{M}\p{N}\p{S}]+)*@[\p{L}\p{M}\p{N}\p{S}]+(?:[-.][\p{L}\p{M}\p{N}\p{S}]+)*\.[\p{L}\p{M}\p{N}\p{S}]+(?:[-.][\p{L}\p{M}\p{N}\p{S}]+)*$/u)
|
|
1009
|
+
.nullable(),
|
|
1010
|
+
identityNumber: z.string().regex(/^[0-9]{9}([0-9]{2})?$/),
|
|
1011
|
+
internalCode: z
|
|
1012
|
+
.string()
|
|
1013
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
1014
|
+
.refine((text) => Array.from(text).length <= 20)
|
|
1015
|
+
.regex(/^(?=.*[^\p{White_Space}])[\s\S]+$/u)
|
|
1016
|
+
.nullable(),
|
|
1017
|
+
legalName: z
|
|
1018
|
+
.string()
|
|
1019
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
1020
|
+
.refine((text) => Array.from(text).length <= 150)
|
|
1021
|
+
.regex(/^(?=.*[^\p{White_Space}])[\s\S]+$/u),
|
|
1022
|
+
municipalityCode: lenientUnion([
|
|
1023
|
+
z.literal("010000"),
|
|
1024
|
+
z.literal("010100"),
|
|
1025
|
+
z.literal("010101"),
|
|
1026
|
+
z.literal("020000"),
|
|
1027
|
+
z.literal("020100"),
|
|
1028
|
+
z.literal("020101"),
|
|
1029
|
+
z.literal("020102"),
|
|
1030
|
+
z.literal("020103"),
|
|
1031
|
+
z.literal("020104"),
|
|
1032
|
+
z.literal("020105"),
|
|
1033
|
+
z.literal("020106"),
|
|
1034
|
+
z.literal("020107"),
|
|
1035
|
+
z.literal("020108"),
|
|
1036
|
+
z.literal("020109"),
|
|
1037
|
+
z.literal("020200"),
|
|
1038
|
+
z.literal("020201"),
|
|
1039
|
+
z.literal("020202"),
|
|
1040
|
+
z.literal("020300"),
|
|
1041
|
+
z.literal("020301"),
|
|
1042
|
+
z.literal("020302"),
|
|
1043
|
+
z.literal("020303"),
|
|
1044
|
+
z.literal("020400"),
|
|
1045
|
+
z.literal("020401"),
|
|
1046
|
+
z.literal("020402"),
|
|
1047
|
+
z.literal("020403"),
|
|
1048
|
+
z.literal("020404"),
|
|
1049
|
+
z.literal("020405"),
|
|
1050
|
+
z.literal("020500"),
|
|
1051
|
+
z.literal("020501"),
|
|
1052
|
+
z.literal("020600"),
|
|
1053
|
+
z.literal("020601"),
|
|
1054
|
+
z.literal("020602"),
|
|
1055
|
+
z.literal("020603"),
|
|
1056
|
+
z.literal("020604"),
|
|
1057
|
+
z.literal("020700"),
|
|
1058
|
+
z.literal("020701"),
|
|
1059
|
+
z.literal("020702"),
|
|
1060
|
+
z.literal("020800"),
|
|
1061
|
+
z.literal("020801"),
|
|
1062
|
+
z.literal("020802"),
|
|
1063
|
+
z.literal("020803"),
|
|
1064
|
+
z.literal("020804"),
|
|
1065
|
+
z.literal("020900"),
|
|
1066
|
+
z.literal("020901"),
|
|
1067
|
+
z.literal("021000"),
|
|
1068
|
+
z.literal("021001"),
|
|
1069
|
+
z.literal("030000"),
|
|
1070
|
+
z.literal("030001"),
|
|
1071
|
+
z.literal("030101"),
|
|
1072
|
+
z.literal("030102"),
|
|
1073
|
+
z.literal("030200"),
|
|
1074
|
+
z.literal("030201"),
|
|
1075
|
+
z.literal("030202"),
|
|
1076
|
+
z.literal("030300"),
|
|
1077
|
+
z.literal("030301"),
|
|
1078
|
+
z.literal("030302"),
|
|
1079
|
+
z.literal("030303"),
|
|
1080
|
+
z.literal("030304"),
|
|
1081
|
+
z.literal("030305"),
|
|
1082
|
+
z.literal("030306"),
|
|
1083
|
+
z.literal("030307"),
|
|
1084
|
+
z.literal("030400"),
|
|
1085
|
+
z.literal("030401"),
|
|
1086
|
+
z.literal("030500"),
|
|
1087
|
+
z.literal("030501"),
|
|
1088
|
+
z.literal("030502"),
|
|
1089
|
+
z.literal("040000"),
|
|
1090
|
+
z.literal("040100"),
|
|
1091
|
+
z.literal("040101"),
|
|
1092
|
+
z.literal("040102"),
|
|
1093
|
+
z.literal("040103"),
|
|
1094
|
+
z.literal("040104"),
|
|
1095
|
+
z.literal("040200"),
|
|
1096
|
+
z.literal("040201"),
|
|
1097
|
+
z.literal("040300"),
|
|
1098
|
+
z.literal("040301"),
|
|
1099
|
+
z.literal("040302"),
|
|
1100
|
+
z.literal("040400"),
|
|
1101
|
+
z.literal("040401"),
|
|
1102
|
+
z.literal("040402"),
|
|
1103
|
+
z.literal("040500"),
|
|
1104
|
+
z.literal("040501"),
|
|
1105
|
+
z.literal("040502"),
|
|
1106
|
+
z.literal("040503"),
|
|
1107
|
+
z.literal("040504"),
|
|
1108
|
+
z.literal("040600"),
|
|
1109
|
+
z.literal("040601"),
|
|
1110
|
+
z.literal("040700"),
|
|
1111
|
+
z.literal("040701"),
|
|
1112
|
+
z.literal("040702"),
|
|
1113
|
+
z.literal("040800"),
|
|
1114
|
+
z.literal("040801"),
|
|
1115
|
+
z.literal("040802"),
|
|
1116
|
+
z.literal("040900"),
|
|
1117
|
+
z.literal("040901"),
|
|
1118
|
+
z.literal("041000"),
|
|
1119
|
+
z.literal("041001"),
|
|
1120
|
+
z.literal("041100"),
|
|
1121
|
+
z.literal("041101"),
|
|
1122
|
+
z.literal("041102"),
|
|
1123
|
+
z.literal("050000"),
|
|
1124
|
+
z.literal("050100"),
|
|
1125
|
+
z.literal("050101"),
|
|
1126
|
+
z.literal("050102"),
|
|
1127
|
+
z.literal("050200"),
|
|
1128
|
+
z.literal("050201"),
|
|
1129
|
+
z.literal("050202"),
|
|
1130
|
+
z.literal("050203"),
|
|
1131
|
+
z.literal("050300"),
|
|
1132
|
+
z.literal("050301"),
|
|
1133
|
+
z.literal("050400"),
|
|
1134
|
+
z.literal("050401"),
|
|
1135
|
+
z.literal("050500"),
|
|
1136
|
+
z.literal("050501"),
|
|
1137
|
+
z.literal("050502"),
|
|
1138
|
+
z.literal("060000"),
|
|
1139
|
+
z.literal("060100"),
|
|
1140
|
+
z.literal("060101"),
|
|
1141
|
+
z.literal("060102"),
|
|
1142
|
+
z.literal("060103"),
|
|
1143
|
+
z.literal("060104"),
|
|
1144
|
+
z.literal("060105"),
|
|
1145
|
+
z.literal("060200"),
|
|
1146
|
+
z.literal("060201"),
|
|
1147
|
+
z.literal("060202"),
|
|
1148
|
+
z.literal("060203"),
|
|
1149
|
+
z.literal("060300"),
|
|
1150
|
+
z.literal("060301"),
|
|
1151
|
+
z.literal("060400"),
|
|
1152
|
+
z.literal("060401"),
|
|
1153
|
+
z.literal("060500"),
|
|
1154
|
+
z.literal("060501"),
|
|
1155
|
+
z.literal("060502"),
|
|
1156
|
+
z.literal("060503"),
|
|
1157
|
+
z.literal("060504"),
|
|
1158
|
+
z.literal("060505"),
|
|
1159
|
+
z.literal("060600"),
|
|
1160
|
+
z.literal("060601"),
|
|
1161
|
+
z.literal("060700"),
|
|
1162
|
+
z.literal("060701"),
|
|
1163
|
+
z.literal("060702"),
|
|
1164
|
+
z.literal("070000"),
|
|
1165
|
+
z.literal("070100"),
|
|
1166
|
+
z.literal("070101"),
|
|
1167
|
+
z.literal("070102"),
|
|
1168
|
+
z.literal("070103"),
|
|
1169
|
+
z.literal("070200"),
|
|
1170
|
+
z.literal("070201"),
|
|
1171
|
+
z.literal("070202"),
|
|
1172
|
+
z.literal("070203"),
|
|
1173
|
+
z.literal("070300"),
|
|
1174
|
+
z.literal("070301"),
|
|
1175
|
+
z.literal("070302"),
|
|
1176
|
+
z.literal("070400"),
|
|
1177
|
+
z.literal("070401"),
|
|
1178
|
+
z.literal("070402"),
|
|
1179
|
+
z.literal("070500"),
|
|
1180
|
+
z.literal("070501"),
|
|
1181
|
+
z.literal("070502"),
|
|
1182
|
+
z.literal("070600"),
|
|
1183
|
+
z.literal("070601"),
|
|
1184
|
+
z.literal("080000"),
|
|
1185
|
+
z.literal("080100"),
|
|
1186
|
+
z.literal("080101"),
|
|
1187
|
+
z.literal("080102"),
|
|
1188
|
+
z.literal("080103"),
|
|
1189
|
+
z.literal("080104"),
|
|
1190
|
+
z.literal("080200"),
|
|
1191
|
+
z.literal("080201"),
|
|
1192
|
+
z.literal("080202"),
|
|
1193
|
+
z.literal("080203"),
|
|
1194
|
+
z.literal("090000"),
|
|
1195
|
+
z.literal("090100"),
|
|
1196
|
+
z.literal("090101"),
|
|
1197
|
+
z.literal("090102"),
|
|
1198
|
+
z.literal("090103"),
|
|
1199
|
+
z.literal("090104"),
|
|
1200
|
+
z.literal("090105"),
|
|
1201
|
+
z.literal("090106"),
|
|
1202
|
+
z.literal("090107"),
|
|
1203
|
+
z.literal("090108"),
|
|
1204
|
+
z.literal("090109"),
|
|
1205
|
+
z.literal("090200"),
|
|
1206
|
+
z.literal("090201"),
|
|
1207
|
+
z.literal("090300"),
|
|
1208
|
+
z.literal("090301"),
|
|
1209
|
+
z.literal("090302"),
|
|
1210
|
+
z.literal("090303"),
|
|
1211
|
+
z.literal("090304"),
|
|
1212
|
+
z.literal("090400"),
|
|
1213
|
+
z.literal("090401"),
|
|
1214
|
+
z.literal("100000"),
|
|
1215
|
+
z.literal("100100"),
|
|
1216
|
+
z.literal("100101"),
|
|
1217
|
+
z.literal("100102"),
|
|
1218
|
+
z.literal("100103"),
|
|
1219
|
+
z.literal("100200"),
|
|
1220
|
+
z.literal("100201"),
|
|
1221
|
+
z.literal("100202"),
|
|
1222
|
+
z.literal("100300"),
|
|
1223
|
+
z.literal("100301"),
|
|
1224
|
+
z.literal("100400"),
|
|
1225
|
+
z.literal("100401"),
|
|
1226
|
+
z.literal("100402"),
|
|
1227
|
+
z.literal("100500"),
|
|
1228
|
+
z.literal("100501"),
|
|
1229
|
+
z.literal("100502"),
|
|
1230
|
+
z.literal("100600"),
|
|
1231
|
+
z.literal("100601"),
|
|
1232
|
+
z.literal("100602"),
|
|
1233
|
+
z.literal("110000"),
|
|
1234
|
+
z.literal("110100"),
|
|
1235
|
+
z.literal("110101"),
|
|
1236
|
+
z.literal("110102"),
|
|
1237
|
+
z.literal("110103"),
|
|
1238
|
+
z.literal("110104"),
|
|
1239
|
+
z.literal("110200"),
|
|
1240
|
+
z.literal("110201"),
|
|
1241
|
+
z.literal("110202"),
|
|
1242
|
+
z.literal("110203"),
|
|
1243
|
+
z.literal("120000"),
|
|
1244
|
+
z.literal("120100"),
|
|
1245
|
+
z.literal("120101"),
|
|
1246
|
+
z.literal("120102"),
|
|
1247
|
+
z.literal("120200"),
|
|
1248
|
+
z.literal("120201"),
|
|
1249
|
+
z.literal("120300"),
|
|
1250
|
+
z.literal("120301"),
|
|
1251
|
+
z.literal("120302"),
|
|
1252
|
+
z.literal("130000"),
|
|
1253
|
+
z.literal("130100"),
|
|
1254
|
+
z.literal("130101"),
|
|
1255
|
+
z.literal("130102"),
|
|
1256
|
+
z.literal("130103"),
|
|
1257
|
+
z.literal("130104"),
|
|
1258
|
+
z.literal("130105"),
|
|
1259
|
+
z.literal("130200"),
|
|
1260
|
+
z.literal("130201"),
|
|
1261
|
+
z.literal("130202"),
|
|
1262
|
+
z.literal("130203"),
|
|
1263
|
+
z.literal("130300"),
|
|
1264
|
+
z.literal("130301"),
|
|
1265
|
+
z.literal("130302"),
|
|
1266
|
+
z.literal("130303"),
|
|
1267
|
+
z.literal("130400"),
|
|
1268
|
+
z.literal("130401"),
|
|
1269
|
+
z.literal("130402"),
|
|
1270
|
+
z.literal("140000"),
|
|
1271
|
+
z.literal("140100"),
|
|
1272
|
+
z.literal("140101"),
|
|
1273
|
+
z.literal("140102"),
|
|
1274
|
+
z.literal("140103"),
|
|
1275
|
+
z.literal("140104"),
|
|
1276
|
+
z.literal("140200"),
|
|
1277
|
+
z.literal("140201"),
|
|
1278
|
+
z.literal("140202"),
|
|
1279
|
+
z.literal("140203"),
|
|
1280
|
+
z.literal("140300"),
|
|
1281
|
+
z.literal("140301"),
|
|
1282
|
+
z.literal("140302"),
|
|
1283
|
+
z.literal("140400"),
|
|
1284
|
+
z.literal("140401"),
|
|
1285
|
+
z.literal("150000"),
|
|
1286
|
+
z.literal("150100"),
|
|
1287
|
+
z.literal("150101"),
|
|
1288
|
+
z.literal("150200"),
|
|
1289
|
+
z.literal("150201"),
|
|
1290
|
+
z.literal("150202"),
|
|
1291
|
+
z.literal("150300"),
|
|
1292
|
+
z.literal("150301"),
|
|
1293
|
+
z.literal("150302"),
|
|
1294
|
+
z.literal("150303"),
|
|
1295
|
+
z.literal("150304"),
|
|
1296
|
+
z.literal("150400"),
|
|
1297
|
+
z.literal("150401"),
|
|
1298
|
+
z.literal("150500"),
|
|
1299
|
+
z.literal("150501"),
|
|
1300
|
+
z.literal("150502"),
|
|
1301
|
+
z.literal("150600"),
|
|
1302
|
+
z.literal("150601"),
|
|
1303
|
+
z.literal("160000"),
|
|
1304
|
+
z.literal("160100"),
|
|
1305
|
+
z.literal("160101"),
|
|
1306
|
+
z.literal("160102"),
|
|
1307
|
+
z.literal("160200"),
|
|
1308
|
+
z.literal("160201"),
|
|
1309
|
+
z.literal("160202"),
|
|
1310
|
+
z.literal("170000"),
|
|
1311
|
+
z.literal("170100"),
|
|
1312
|
+
z.literal("170101"),
|
|
1313
|
+
z.literal("170102"),
|
|
1314
|
+
z.literal("170103"),
|
|
1315
|
+
z.literal("170104"),
|
|
1316
|
+
z.literal("170105"),
|
|
1317
|
+
z.literal("170106"),
|
|
1318
|
+
z.literal("170107"),
|
|
1319
|
+
z.literal("170108"),
|
|
1320
|
+
z.literal("170109"),
|
|
1321
|
+
z.literal("170110"),
|
|
1322
|
+
z.literal("170200"),
|
|
1323
|
+
z.literal("170201"),
|
|
1324
|
+
z.literal("170202"),
|
|
1325
|
+
z.literal("170203"),
|
|
1326
|
+
z.literal("170300"),
|
|
1327
|
+
z.literal("170301"),
|
|
1328
|
+
z.literal("180000"),
|
|
1329
|
+
z.literal("180100"),
|
|
1330
|
+
z.literal("180101"),
|
|
1331
|
+
z.literal("180102"),
|
|
1332
|
+
z.literal("180103"),
|
|
1333
|
+
z.literal("180200"),
|
|
1334
|
+
z.literal("180201"),
|
|
1335
|
+
z.literal("180202"),
|
|
1336
|
+
z.literal("180300"),
|
|
1337
|
+
z.literal("180301"),
|
|
1338
|
+
z.literal("180400"),
|
|
1339
|
+
z.literal("180401"),
|
|
1340
|
+
z.literal("180500"),
|
|
1341
|
+
z.literal("180501"),
|
|
1342
|
+
z.literal("180502"),
|
|
1343
|
+
z.literal("180600"),
|
|
1344
|
+
z.literal("180601"),
|
|
1345
|
+
z.literal("180602"),
|
|
1346
|
+
z.literal("180603"),
|
|
1347
|
+
z.literal("180604"),
|
|
1348
|
+
z.literal("180700"),
|
|
1349
|
+
z.literal("180701"),
|
|
1350
|
+
z.literal("180702"),
|
|
1351
|
+
z.literal("180703"),
|
|
1352
|
+
z.literal("180800"),
|
|
1353
|
+
z.literal("180801"),
|
|
1354
|
+
z.literal("180802"),
|
|
1355
|
+
z.literal("180803"),
|
|
1356
|
+
z.literal("180804"),
|
|
1357
|
+
z.literal("180900"),
|
|
1358
|
+
z.literal("180901"),
|
|
1359
|
+
z.literal("190000"),
|
|
1360
|
+
z.literal("190100"),
|
|
1361
|
+
z.literal("190101"),
|
|
1362
|
+
z.literal("190102"),
|
|
1363
|
+
z.literal("190200"),
|
|
1364
|
+
z.literal("190201"),
|
|
1365
|
+
z.literal("190202"),
|
|
1366
|
+
z.literal("190300"),
|
|
1367
|
+
z.literal("190301"),
|
|
1368
|
+
z.literal("200000"),
|
|
1369
|
+
z.literal("200100"),
|
|
1370
|
+
z.literal("200101"),
|
|
1371
|
+
z.literal("200102"),
|
|
1372
|
+
z.literal("200103"),
|
|
1373
|
+
z.literal("200104"),
|
|
1374
|
+
z.literal("200200"),
|
|
1375
|
+
z.literal("200201"),
|
|
1376
|
+
z.literal("200300"),
|
|
1377
|
+
z.literal("200301"),
|
|
1378
|
+
z.literal("210000"),
|
|
1379
|
+
z.literal("210100"),
|
|
1380
|
+
z.literal("210101"),
|
|
1381
|
+
z.literal("210102"),
|
|
1382
|
+
z.literal("210103"),
|
|
1383
|
+
z.literal("210200"),
|
|
1384
|
+
z.literal("210201"),
|
|
1385
|
+
z.literal("210300"),
|
|
1386
|
+
z.literal("210301"),
|
|
1387
|
+
z.literal("210302"),
|
|
1388
|
+
z.literal("210303"),
|
|
1389
|
+
z.literal("210400"),
|
|
1390
|
+
z.literal("210401"),
|
|
1391
|
+
z.literal("210402"),
|
|
1392
|
+
z.literal("210500"),
|
|
1393
|
+
z.literal("210501"),
|
|
1394
|
+
z.literal("210502"),
|
|
1395
|
+
z.literal("210503"),
|
|
1396
|
+
z.literal("210504"),
|
|
1397
|
+
z.literal("210600"),
|
|
1398
|
+
z.literal("210601"),
|
|
1399
|
+
z.literal("210602"),
|
|
1400
|
+
z.literal("210700"),
|
|
1401
|
+
z.literal("210701"),
|
|
1402
|
+
z.literal("210800"),
|
|
1403
|
+
z.literal("210801"),
|
|
1404
|
+
z.literal("220000"),
|
|
1405
|
+
z.literal("220100"),
|
|
1406
|
+
z.literal("220101"),
|
|
1407
|
+
z.literal("220102"),
|
|
1408
|
+
z.literal("220103"),
|
|
1409
|
+
z.literal("220104"),
|
|
1410
|
+
z.literal("220105"),
|
|
1411
|
+
z.literal("220106"),
|
|
1412
|
+
z.literal("220107"),
|
|
1413
|
+
z.literal("220108"),
|
|
1414
|
+
z.literal("220109"),
|
|
1415
|
+
z.literal("220110"),
|
|
1416
|
+
z.literal("220111"),
|
|
1417
|
+
z.literal("220200"),
|
|
1418
|
+
z.literal("220201"),
|
|
1419
|
+
z.literal("220202"),
|
|
1420
|
+
z.literal("220203"),
|
|
1421
|
+
z.literal("220300"),
|
|
1422
|
+
z.literal("220301"),
|
|
1423
|
+
z.literal("220302"),
|
|
1424
|
+
z.literal("220303"),
|
|
1425
|
+
z.literal("220400"),
|
|
1426
|
+
z.literal("220401"),
|
|
1427
|
+
z.literal("220402"),
|
|
1428
|
+
z.literal("220500"),
|
|
1429
|
+
z.literal("220501"),
|
|
1430
|
+
z.literal("220502"),
|
|
1431
|
+
z.literal("220503"),
|
|
1432
|
+
z.literal("220600"),
|
|
1433
|
+
z.literal("220601"),
|
|
1434
|
+
z.literal("220602"),
|
|
1435
|
+
z.literal("230000"),
|
|
1436
|
+
z.literal("230100"),
|
|
1437
|
+
z.literal("230101"),
|
|
1438
|
+
z.literal("230200"),
|
|
1439
|
+
z.literal("230201"),
|
|
1440
|
+
z.literal("230202"),
|
|
1441
|
+
z.literal("230203"),
|
|
1442
|
+
z.literal("230300"),
|
|
1443
|
+
z.literal("230301"),
|
|
1444
|
+
z.literal("230400"),
|
|
1445
|
+
z.literal("230401"),
|
|
1446
|
+
z.literal("230500"),
|
|
1447
|
+
z.literal("230501"),
|
|
1448
|
+
z.literal("230600"),
|
|
1449
|
+
z.literal("230601"),
|
|
1450
|
+
z.literal("240000"),
|
|
1451
|
+
z.literal("240100"),
|
|
1452
|
+
z.literal("240101"),
|
|
1453
|
+
z.literal("240102"),
|
|
1454
|
+
z.literal("240103"),
|
|
1455
|
+
z.literal("240104"),
|
|
1456
|
+
z.literal("240105"),
|
|
1457
|
+
z.literal("240106"),
|
|
1458
|
+
z.literal("240200"),
|
|
1459
|
+
z.literal("240201"),
|
|
1460
|
+
z.literal("240202"),
|
|
1461
|
+
z.literal("240300"),
|
|
1462
|
+
z.literal("240301"),
|
|
1463
|
+
z.literal("240400"),
|
|
1464
|
+
z.literal("240401"),
|
|
1465
|
+
z.literal("240402"),
|
|
1466
|
+
z.literal("240403"),
|
|
1467
|
+
z.literal("240404"),
|
|
1468
|
+
z.literal("250000"),
|
|
1469
|
+
z.literal("250100"),
|
|
1470
|
+
z.literal("250101"),
|
|
1471
|
+
z.literal("250102"),
|
|
1472
|
+
z.literal("250104"),
|
|
1473
|
+
z.literal("250105"),
|
|
1474
|
+
z.literal("250106"),
|
|
1475
|
+
z.literal("250107"),
|
|
1476
|
+
z.literal("250200"),
|
|
1477
|
+
z.literal("250201"),
|
|
1478
|
+
z.literal("250300"),
|
|
1479
|
+
z.literal("250301"),
|
|
1480
|
+
z.literal("250302"),
|
|
1481
|
+
z.literal("250303"),
|
|
1482
|
+
z.literal("250400"),
|
|
1483
|
+
z.literal("250401"),
|
|
1484
|
+
z.literal("250402"),
|
|
1485
|
+
z.literal("250500"),
|
|
1486
|
+
z.literal("250501"),
|
|
1487
|
+
z.literal("250502"),
|
|
1488
|
+
z.literal("250503"),
|
|
1489
|
+
z.literal("250504"),
|
|
1490
|
+
z.literal("250600"),
|
|
1491
|
+
z.literal("250601"),
|
|
1492
|
+
z.literal("250602"),
|
|
1493
|
+
z.literal("250700"),
|
|
1494
|
+
z.literal("250701"),
|
|
1495
|
+
z.literal("250702"),
|
|
1496
|
+
z.literal("250703"),
|
|
1497
|
+
z.literal("250800"),
|
|
1498
|
+
z.literal("250801"),
|
|
1499
|
+
z.literal("250802"),
|
|
1500
|
+
z.literal("250803"),
|
|
1501
|
+
z.literal("250900"),
|
|
1502
|
+
z.literal("250901"),
|
|
1503
|
+
z.literal("251000"),
|
|
1504
|
+
z.literal("251001"),
|
|
1505
|
+
z.literal("260000"),
|
|
1506
|
+
z.literal("260100"),
|
|
1507
|
+
z.literal("260101"),
|
|
1508
|
+
z.literal("260200"),
|
|
1509
|
+
z.literal("260201"),
|
|
1510
|
+
z.literal("260300"),
|
|
1511
|
+
z.literal("260301"),
|
|
1512
|
+
z.literal("270000"),
|
|
1513
|
+
z.literal("270100"),
|
|
1514
|
+
z.literal("270101"),
|
|
1515
|
+
z.literal("270102"),
|
|
1516
|
+
z.literal("270103"),
|
|
1517
|
+
z.literal("270104"),
|
|
1518
|
+
z.literal("270200"),
|
|
1519
|
+
z.literal("270201"),
|
|
1520
|
+
z.literal("270202"),
|
|
1521
|
+
z.literal("270203"),
|
|
1522
|
+
z.literal("270204"),
|
|
1523
|
+
z.literal("270205"),
|
|
1524
|
+
z.literal("270300"),
|
|
1525
|
+
z.literal("270301"),
|
|
1526
|
+
z.literal("270302"),
|
|
1527
|
+
z.literal("270303"),
|
|
1528
|
+
z.literal("270304"),
|
|
1529
|
+
z.literal("280000"),
|
|
1530
|
+
z.literal("280100"),
|
|
1531
|
+
z.literal("280101"),
|
|
1532
|
+
z.literal("280102"),
|
|
1533
|
+
z.literal("280103"),
|
|
1534
|
+
z.literal("280104"),
|
|
1535
|
+
z.literal("280105"),
|
|
1536
|
+
z.literal("280106"),
|
|
1537
|
+
z.literal("280200"),
|
|
1538
|
+
z.literal("280201"),
|
|
1539
|
+
z.literal("280300"),
|
|
1540
|
+
z.literal("280301"),
|
|
1541
|
+
z.literal("280302"),
|
|
1542
|
+
z.literal("280303"),
|
|
1543
|
+
z.literal("290000"),
|
|
1544
|
+
z.literal("290100"),
|
|
1545
|
+
z.literal("290101"),
|
|
1546
|
+
z.literal("290102"),
|
|
1547
|
+
z.literal("290103"),
|
|
1548
|
+
z.literal("290104"),
|
|
1549
|
+
z.literal("290200"),
|
|
1550
|
+
z.literal("290201"),
|
|
1551
|
+
z.literal("290300"),
|
|
1552
|
+
z.literal("290301"),
|
|
1553
|
+
z.literal("290302"),
|
|
1554
|
+
z.literal("290303"),
|
|
1555
|
+
z.literal("290400"),
|
|
1556
|
+
z.literal("290402"),
|
|
1557
|
+
z.literal("290403"),
|
|
1558
|
+
z.literal("290500"),
|
|
1559
|
+
z.literal("290501"),
|
|
1560
|
+
z.literal("300000"),
|
|
1561
|
+
z.literal("300100"),
|
|
1562
|
+
z.literal("300101"),
|
|
1563
|
+
z.literal("300102"),
|
|
1564
|
+
z.literal("300103"),
|
|
1565
|
+
z.literal("300104"),
|
|
1566
|
+
z.literal("300200"),
|
|
1567
|
+
z.literal("300201"),
|
|
1568
|
+
z.literal("300202"),
|
|
1569
|
+
z.literal("300300"),
|
|
1570
|
+
z.literal("300301"),
|
|
1571
|
+
z.literal("310000"),
|
|
1572
|
+
z.literal("310100"),
|
|
1573
|
+
z.literal("310101"),
|
|
1574
|
+
z.literal("310102"),
|
|
1575
|
+
z.literal("310103"),
|
|
1576
|
+
z.literal("310104"),
|
|
1577
|
+
z.literal("310105"),
|
|
1578
|
+
z.literal("310200"),
|
|
1579
|
+
z.literal("310201"),
|
|
1580
|
+
z.literal("310300"),
|
|
1581
|
+
z.literal("310301"),
|
|
1582
|
+
z.literal("320000"),
|
|
1583
|
+
z.literal("320100"),
|
|
1584
|
+
z.literal("320101"),
|
|
1585
|
+
z.literal("320102"),
|
|
1586
|
+
z.literal("320200"),
|
|
1587
|
+
z.literal("320201"),
|
|
1588
|
+
z.literal("320300"),
|
|
1589
|
+
z.literal("320301"),
|
|
1590
|
+
z.literal("320302"),
|
|
1591
|
+
z.literal("320400"),
|
|
1592
|
+
z.literal("320401"),
|
|
1593
|
+
z.literal("320402"),
|
|
1594
|
+
z.literal("320500"),
|
|
1595
|
+
z.literal("320501"),
|
|
1596
|
+
z.literal("320502"),
|
|
1597
|
+
z.literal("320600"),
|
|
1598
|
+
z.literal("320601"),
|
|
1599
|
+
z.literal("320602"),
|
|
1600
|
+
z.literal("320603"),
|
|
1601
|
+
z.literal("320700"),
|
|
1602
|
+
z.literal("320701"),
|
|
1603
|
+
z.literal("320702"),
|
|
1604
|
+
z.literal("320703"),
|
|
1605
|
+
]).nullable(),
|
|
1606
|
+
provinceCode: lenientUnion([
|
|
1607
|
+
z.literal("010000"),
|
|
1608
|
+
z.literal("010100"),
|
|
1609
|
+
z.literal("010101"),
|
|
1610
|
+
z.literal("020000"),
|
|
1611
|
+
z.literal("020100"),
|
|
1612
|
+
z.literal("020101"),
|
|
1613
|
+
z.literal("020102"),
|
|
1614
|
+
z.literal("020103"),
|
|
1615
|
+
z.literal("020104"),
|
|
1616
|
+
z.literal("020105"),
|
|
1617
|
+
z.literal("020106"),
|
|
1618
|
+
z.literal("020107"),
|
|
1619
|
+
z.literal("020108"),
|
|
1620
|
+
z.literal("020109"),
|
|
1621
|
+
z.literal("020200"),
|
|
1622
|
+
z.literal("020201"),
|
|
1623
|
+
z.literal("020202"),
|
|
1624
|
+
z.literal("020300"),
|
|
1625
|
+
z.literal("020301"),
|
|
1626
|
+
z.literal("020302"),
|
|
1627
|
+
z.literal("020303"),
|
|
1628
|
+
z.literal("020400"),
|
|
1629
|
+
z.literal("020401"),
|
|
1630
|
+
z.literal("020402"),
|
|
1631
|
+
z.literal("020403"),
|
|
1632
|
+
z.literal("020404"),
|
|
1633
|
+
z.literal("020405"),
|
|
1634
|
+
z.literal("020500"),
|
|
1635
|
+
z.literal("020501"),
|
|
1636
|
+
z.literal("020600"),
|
|
1637
|
+
z.literal("020601"),
|
|
1638
|
+
z.literal("020602"),
|
|
1639
|
+
z.literal("020603"),
|
|
1640
|
+
z.literal("020604"),
|
|
1641
|
+
z.literal("020700"),
|
|
1642
|
+
z.literal("020701"),
|
|
1643
|
+
z.literal("020702"),
|
|
1644
|
+
z.literal("020800"),
|
|
1645
|
+
z.literal("020801"),
|
|
1646
|
+
z.literal("020802"),
|
|
1647
|
+
z.literal("020803"),
|
|
1648
|
+
z.literal("020804"),
|
|
1649
|
+
z.literal("020900"),
|
|
1650
|
+
z.literal("020901"),
|
|
1651
|
+
z.literal("021000"),
|
|
1652
|
+
z.literal("021001"),
|
|
1653
|
+
z.literal("030000"),
|
|
1654
|
+
z.literal("030001"),
|
|
1655
|
+
z.literal("030101"),
|
|
1656
|
+
z.literal("030102"),
|
|
1657
|
+
z.literal("030200"),
|
|
1658
|
+
z.literal("030201"),
|
|
1659
|
+
z.literal("030202"),
|
|
1660
|
+
z.literal("030300"),
|
|
1661
|
+
z.literal("030301"),
|
|
1662
|
+
z.literal("030302"),
|
|
1663
|
+
z.literal("030303"),
|
|
1664
|
+
z.literal("030304"),
|
|
1665
|
+
z.literal("030305"),
|
|
1666
|
+
z.literal("030306"),
|
|
1667
|
+
z.literal("030307"),
|
|
1668
|
+
z.literal("030400"),
|
|
1669
|
+
z.literal("030401"),
|
|
1670
|
+
z.literal("030500"),
|
|
1671
|
+
z.literal("030501"),
|
|
1672
|
+
z.literal("030502"),
|
|
1673
|
+
z.literal("040000"),
|
|
1674
|
+
z.literal("040100"),
|
|
1675
|
+
z.literal("040101"),
|
|
1676
|
+
z.literal("040102"),
|
|
1677
|
+
z.literal("040103"),
|
|
1678
|
+
z.literal("040104"),
|
|
1679
|
+
z.literal("040200"),
|
|
1680
|
+
z.literal("040201"),
|
|
1681
|
+
z.literal("040300"),
|
|
1682
|
+
z.literal("040301"),
|
|
1683
|
+
z.literal("040302"),
|
|
1684
|
+
z.literal("040400"),
|
|
1685
|
+
z.literal("040401"),
|
|
1686
|
+
z.literal("040402"),
|
|
1687
|
+
z.literal("040500"),
|
|
1688
|
+
z.literal("040501"),
|
|
1689
|
+
z.literal("040502"),
|
|
1690
|
+
z.literal("040503"),
|
|
1691
|
+
z.literal("040504"),
|
|
1692
|
+
z.literal("040600"),
|
|
1693
|
+
z.literal("040601"),
|
|
1694
|
+
z.literal("040700"),
|
|
1695
|
+
z.literal("040701"),
|
|
1696
|
+
z.literal("040702"),
|
|
1697
|
+
z.literal("040800"),
|
|
1698
|
+
z.literal("040801"),
|
|
1699
|
+
z.literal("040802"),
|
|
1700
|
+
z.literal("040900"),
|
|
1701
|
+
z.literal("040901"),
|
|
1702
|
+
z.literal("041000"),
|
|
1703
|
+
z.literal("041001"),
|
|
1704
|
+
z.literal("041100"),
|
|
1705
|
+
z.literal("041101"),
|
|
1706
|
+
z.literal("041102"),
|
|
1707
|
+
z.literal("050000"),
|
|
1708
|
+
z.literal("050100"),
|
|
1709
|
+
z.literal("050101"),
|
|
1710
|
+
z.literal("050102"),
|
|
1711
|
+
z.literal("050200"),
|
|
1712
|
+
z.literal("050201"),
|
|
1713
|
+
z.literal("050202"),
|
|
1714
|
+
z.literal("050203"),
|
|
1715
|
+
z.literal("050300"),
|
|
1716
|
+
z.literal("050301"),
|
|
1717
|
+
z.literal("050400"),
|
|
1718
|
+
z.literal("050401"),
|
|
1719
|
+
z.literal("050500"),
|
|
1720
|
+
z.literal("050501"),
|
|
1721
|
+
z.literal("050502"),
|
|
1722
|
+
z.literal("060000"),
|
|
1723
|
+
z.literal("060100"),
|
|
1724
|
+
z.literal("060101"),
|
|
1725
|
+
z.literal("060102"),
|
|
1726
|
+
z.literal("060103"),
|
|
1727
|
+
z.literal("060104"),
|
|
1728
|
+
z.literal("060105"),
|
|
1729
|
+
z.literal("060200"),
|
|
1730
|
+
z.literal("060201"),
|
|
1731
|
+
z.literal("060202"),
|
|
1732
|
+
z.literal("060203"),
|
|
1733
|
+
z.literal("060300"),
|
|
1734
|
+
z.literal("060301"),
|
|
1735
|
+
z.literal("060400"),
|
|
1736
|
+
z.literal("060401"),
|
|
1737
|
+
z.literal("060500"),
|
|
1738
|
+
z.literal("060501"),
|
|
1739
|
+
z.literal("060502"),
|
|
1740
|
+
z.literal("060503"),
|
|
1741
|
+
z.literal("060504"),
|
|
1742
|
+
z.literal("060505"),
|
|
1743
|
+
z.literal("060600"),
|
|
1744
|
+
z.literal("060601"),
|
|
1745
|
+
z.literal("060700"),
|
|
1746
|
+
z.literal("060701"),
|
|
1747
|
+
z.literal("060702"),
|
|
1748
|
+
z.literal("070000"),
|
|
1749
|
+
z.literal("070100"),
|
|
1750
|
+
z.literal("070101"),
|
|
1751
|
+
z.literal("070102"),
|
|
1752
|
+
z.literal("070103"),
|
|
1753
|
+
z.literal("070200"),
|
|
1754
|
+
z.literal("070201"),
|
|
1755
|
+
z.literal("070202"),
|
|
1756
|
+
z.literal("070203"),
|
|
1757
|
+
z.literal("070300"),
|
|
1758
|
+
z.literal("070301"),
|
|
1759
|
+
z.literal("070302"),
|
|
1760
|
+
z.literal("070400"),
|
|
1761
|
+
z.literal("070401"),
|
|
1762
|
+
z.literal("070402"),
|
|
1763
|
+
z.literal("070500"),
|
|
1764
|
+
z.literal("070501"),
|
|
1765
|
+
z.literal("070502"),
|
|
1766
|
+
z.literal("070600"),
|
|
1767
|
+
z.literal("070601"),
|
|
1768
|
+
z.literal("080000"),
|
|
1769
|
+
z.literal("080100"),
|
|
1770
|
+
z.literal("080101"),
|
|
1771
|
+
z.literal("080102"),
|
|
1772
|
+
z.literal("080103"),
|
|
1773
|
+
z.literal("080104"),
|
|
1774
|
+
z.literal("080200"),
|
|
1775
|
+
z.literal("080201"),
|
|
1776
|
+
z.literal("080202"),
|
|
1777
|
+
z.literal("080203"),
|
|
1778
|
+
z.literal("090000"),
|
|
1779
|
+
z.literal("090100"),
|
|
1780
|
+
z.literal("090101"),
|
|
1781
|
+
z.literal("090102"),
|
|
1782
|
+
z.literal("090103"),
|
|
1783
|
+
z.literal("090104"),
|
|
1784
|
+
z.literal("090105"),
|
|
1785
|
+
z.literal("090106"),
|
|
1786
|
+
z.literal("090107"),
|
|
1787
|
+
z.literal("090108"),
|
|
1788
|
+
z.literal("090109"),
|
|
1789
|
+
z.literal("090200"),
|
|
1790
|
+
z.literal("090201"),
|
|
1791
|
+
z.literal("090300"),
|
|
1792
|
+
z.literal("090301"),
|
|
1793
|
+
z.literal("090302"),
|
|
1794
|
+
z.literal("090303"),
|
|
1795
|
+
z.literal("090304"),
|
|
1796
|
+
z.literal("090400"),
|
|
1797
|
+
z.literal("090401"),
|
|
1798
|
+
z.literal("100000"),
|
|
1799
|
+
z.literal("100100"),
|
|
1800
|
+
z.literal("100101"),
|
|
1801
|
+
z.literal("100102"),
|
|
1802
|
+
z.literal("100103"),
|
|
1803
|
+
z.literal("100200"),
|
|
1804
|
+
z.literal("100201"),
|
|
1805
|
+
z.literal("100202"),
|
|
1806
|
+
z.literal("100300"),
|
|
1807
|
+
z.literal("100301"),
|
|
1808
|
+
z.literal("100400"),
|
|
1809
|
+
z.literal("100401"),
|
|
1810
|
+
z.literal("100402"),
|
|
1811
|
+
z.literal("100500"),
|
|
1812
|
+
z.literal("100501"),
|
|
1813
|
+
z.literal("100502"),
|
|
1814
|
+
z.literal("100600"),
|
|
1815
|
+
z.literal("100601"),
|
|
1816
|
+
z.literal("100602"),
|
|
1817
|
+
z.literal("110000"),
|
|
1818
|
+
z.literal("110100"),
|
|
1819
|
+
z.literal("110101"),
|
|
1820
|
+
z.literal("110102"),
|
|
1821
|
+
z.literal("110103"),
|
|
1822
|
+
z.literal("110104"),
|
|
1823
|
+
z.literal("110200"),
|
|
1824
|
+
z.literal("110201"),
|
|
1825
|
+
z.literal("110202"),
|
|
1826
|
+
z.literal("110203"),
|
|
1827
|
+
z.literal("120000"),
|
|
1828
|
+
z.literal("120100"),
|
|
1829
|
+
z.literal("120101"),
|
|
1830
|
+
z.literal("120102"),
|
|
1831
|
+
z.literal("120200"),
|
|
1832
|
+
z.literal("120201"),
|
|
1833
|
+
z.literal("120300"),
|
|
1834
|
+
z.literal("120301"),
|
|
1835
|
+
z.literal("120302"),
|
|
1836
|
+
z.literal("130000"),
|
|
1837
|
+
z.literal("130100"),
|
|
1838
|
+
z.literal("130101"),
|
|
1839
|
+
z.literal("130102"),
|
|
1840
|
+
z.literal("130103"),
|
|
1841
|
+
z.literal("130104"),
|
|
1842
|
+
z.literal("130105"),
|
|
1843
|
+
z.literal("130200"),
|
|
1844
|
+
z.literal("130201"),
|
|
1845
|
+
z.literal("130202"),
|
|
1846
|
+
z.literal("130203"),
|
|
1847
|
+
z.literal("130300"),
|
|
1848
|
+
z.literal("130301"),
|
|
1849
|
+
z.literal("130302"),
|
|
1850
|
+
z.literal("130303"),
|
|
1851
|
+
z.literal("130400"),
|
|
1852
|
+
z.literal("130401"),
|
|
1853
|
+
z.literal("130402"),
|
|
1854
|
+
z.literal("140000"),
|
|
1855
|
+
z.literal("140100"),
|
|
1856
|
+
z.literal("140101"),
|
|
1857
|
+
z.literal("140102"),
|
|
1858
|
+
z.literal("140103"),
|
|
1859
|
+
z.literal("140104"),
|
|
1860
|
+
z.literal("140200"),
|
|
1861
|
+
z.literal("140201"),
|
|
1862
|
+
z.literal("140202"),
|
|
1863
|
+
z.literal("140203"),
|
|
1864
|
+
z.literal("140300"),
|
|
1865
|
+
z.literal("140301"),
|
|
1866
|
+
z.literal("140302"),
|
|
1867
|
+
z.literal("140400"),
|
|
1868
|
+
z.literal("140401"),
|
|
1869
|
+
z.literal("150000"),
|
|
1870
|
+
z.literal("150100"),
|
|
1871
|
+
z.literal("150101"),
|
|
1872
|
+
z.literal("150200"),
|
|
1873
|
+
z.literal("150201"),
|
|
1874
|
+
z.literal("150202"),
|
|
1875
|
+
z.literal("150300"),
|
|
1876
|
+
z.literal("150301"),
|
|
1877
|
+
z.literal("150302"),
|
|
1878
|
+
z.literal("150303"),
|
|
1879
|
+
z.literal("150304"),
|
|
1880
|
+
z.literal("150400"),
|
|
1881
|
+
z.literal("150401"),
|
|
1882
|
+
z.literal("150500"),
|
|
1883
|
+
z.literal("150501"),
|
|
1884
|
+
z.literal("150502"),
|
|
1885
|
+
z.literal("150600"),
|
|
1886
|
+
z.literal("150601"),
|
|
1887
|
+
z.literal("160000"),
|
|
1888
|
+
z.literal("160100"),
|
|
1889
|
+
z.literal("160101"),
|
|
1890
|
+
z.literal("160102"),
|
|
1891
|
+
z.literal("160200"),
|
|
1892
|
+
z.literal("160201"),
|
|
1893
|
+
z.literal("160202"),
|
|
1894
|
+
z.literal("170000"),
|
|
1895
|
+
z.literal("170100"),
|
|
1896
|
+
z.literal("170101"),
|
|
1897
|
+
z.literal("170102"),
|
|
1898
|
+
z.literal("170103"),
|
|
1899
|
+
z.literal("170104"),
|
|
1900
|
+
z.literal("170105"),
|
|
1901
|
+
z.literal("170106"),
|
|
1902
|
+
z.literal("170107"),
|
|
1903
|
+
z.literal("170108"),
|
|
1904
|
+
z.literal("170109"),
|
|
1905
|
+
z.literal("170110"),
|
|
1906
|
+
z.literal("170200"),
|
|
1907
|
+
z.literal("170201"),
|
|
1908
|
+
z.literal("170202"),
|
|
1909
|
+
z.literal("170203"),
|
|
1910
|
+
z.literal("170300"),
|
|
1911
|
+
z.literal("170301"),
|
|
1912
|
+
z.literal("180000"),
|
|
1913
|
+
z.literal("180100"),
|
|
1914
|
+
z.literal("180101"),
|
|
1915
|
+
z.literal("180102"),
|
|
1916
|
+
z.literal("180103"),
|
|
1917
|
+
z.literal("180200"),
|
|
1918
|
+
z.literal("180201"),
|
|
1919
|
+
z.literal("180202"),
|
|
1920
|
+
z.literal("180300"),
|
|
1921
|
+
z.literal("180301"),
|
|
1922
|
+
z.literal("180400"),
|
|
1923
|
+
z.literal("180401"),
|
|
1924
|
+
z.literal("180500"),
|
|
1925
|
+
z.literal("180501"),
|
|
1926
|
+
z.literal("180502"),
|
|
1927
|
+
z.literal("180600"),
|
|
1928
|
+
z.literal("180601"),
|
|
1929
|
+
z.literal("180602"),
|
|
1930
|
+
z.literal("180603"),
|
|
1931
|
+
z.literal("180604"),
|
|
1932
|
+
z.literal("180700"),
|
|
1933
|
+
z.literal("180701"),
|
|
1934
|
+
z.literal("180702"),
|
|
1935
|
+
z.literal("180703"),
|
|
1936
|
+
z.literal("180800"),
|
|
1937
|
+
z.literal("180801"),
|
|
1938
|
+
z.literal("180802"),
|
|
1939
|
+
z.literal("180803"),
|
|
1940
|
+
z.literal("180804"),
|
|
1941
|
+
z.literal("180900"),
|
|
1942
|
+
z.literal("180901"),
|
|
1943
|
+
z.literal("190000"),
|
|
1944
|
+
z.literal("190100"),
|
|
1945
|
+
z.literal("190101"),
|
|
1946
|
+
z.literal("190102"),
|
|
1947
|
+
z.literal("190200"),
|
|
1948
|
+
z.literal("190201"),
|
|
1949
|
+
z.literal("190202"),
|
|
1950
|
+
z.literal("190300"),
|
|
1951
|
+
z.literal("190301"),
|
|
1952
|
+
z.literal("200000"),
|
|
1953
|
+
z.literal("200100"),
|
|
1954
|
+
z.literal("200101"),
|
|
1955
|
+
z.literal("200102"),
|
|
1956
|
+
z.literal("200103"),
|
|
1957
|
+
z.literal("200104"),
|
|
1958
|
+
z.literal("200200"),
|
|
1959
|
+
z.literal("200201"),
|
|
1960
|
+
z.literal("200300"),
|
|
1961
|
+
z.literal("200301"),
|
|
1962
|
+
z.literal("210000"),
|
|
1963
|
+
z.literal("210100"),
|
|
1964
|
+
z.literal("210101"),
|
|
1965
|
+
z.literal("210102"),
|
|
1966
|
+
z.literal("210103"),
|
|
1967
|
+
z.literal("210200"),
|
|
1968
|
+
z.literal("210201"),
|
|
1969
|
+
z.literal("210300"),
|
|
1970
|
+
z.literal("210301"),
|
|
1971
|
+
z.literal("210302"),
|
|
1972
|
+
z.literal("210303"),
|
|
1973
|
+
z.literal("210400"),
|
|
1974
|
+
z.literal("210401"),
|
|
1975
|
+
z.literal("210402"),
|
|
1976
|
+
z.literal("210500"),
|
|
1977
|
+
z.literal("210501"),
|
|
1978
|
+
z.literal("210502"),
|
|
1979
|
+
z.literal("210503"),
|
|
1980
|
+
z.literal("210504"),
|
|
1981
|
+
z.literal("210600"),
|
|
1982
|
+
z.literal("210601"),
|
|
1983
|
+
z.literal("210602"),
|
|
1984
|
+
z.literal("210700"),
|
|
1985
|
+
z.literal("210701"),
|
|
1986
|
+
z.literal("210800"),
|
|
1987
|
+
z.literal("210801"),
|
|
1988
|
+
z.literal("220000"),
|
|
1989
|
+
z.literal("220100"),
|
|
1990
|
+
z.literal("220101"),
|
|
1991
|
+
z.literal("220102"),
|
|
1992
|
+
z.literal("220103"),
|
|
1993
|
+
z.literal("220104"),
|
|
1994
|
+
z.literal("220105"),
|
|
1995
|
+
z.literal("220106"),
|
|
1996
|
+
z.literal("220107"),
|
|
1997
|
+
z.literal("220108"),
|
|
1998
|
+
z.literal("220109"),
|
|
1999
|
+
z.literal("220110"),
|
|
2000
|
+
z.literal("220111"),
|
|
2001
|
+
z.literal("220200"),
|
|
2002
|
+
z.literal("220201"),
|
|
2003
|
+
z.literal("220202"),
|
|
2004
|
+
z.literal("220203"),
|
|
2005
|
+
z.literal("220300"),
|
|
2006
|
+
z.literal("220301"),
|
|
2007
|
+
z.literal("220302"),
|
|
2008
|
+
z.literal("220303"),
|
|
2009
|
+
z.literal("220400"),
|
|
2010
|
+
z.literal("220401"),
|
|
2011
|
+
z.literal("220402"),
|
|
2012
|
+
z.literal("220500"),
|
|
2013
|
+
z.literal("220501"),
|
|
2014
|
+
z.literal("220502"),
|
|
2015
|
+
z.literal("220503"),
|
|
2016
|
+
z.literal("220600"),
|
|
2017
|
+
z.literal("220601"),
|
|
2018
|
+
z.literal("220602"),
|
|
2019
|
+
z.literal("230000"),
|
|
2020
|
+
z.literal("230100"),
|
|
2021
|
+
z.literal("230101"),
|
|
2022
|
+
z.literal("230200"),
|
|
2023
|
+
z.literal("230201"),
|
|
2024
|
+
z.literal("230202"),
|
|
2025
|
+
z.literal("230203"),
|
|
2026
|
+
z.literal("230300"),
|
|
2027
|
+
z.literal("230301"),
|
|
2028
|
+
z.literal("230400"),
|
|
2029
|
+
z.literal("230401"),
|
|
2030
|
+
z.literal("230500"),
|
|
2031
|
+
z.literal("230501"),
|
|
2032
|
+
z.literal("230600"),
|
|
2033
|
+
z.literal("230601"),
|
|
2034
|
+
z.literal("240000"),
|
|
2035
|
+
z.literal("240100"),
|
|
2036
|
+
z.literal("240101"),
|
|
2037
|
+
z.literal("240102"),
|
|
2038
|
+
z.literal("240103"),
|
|
2039
|
+
z.literal("240104"),
|
|
2040
|
+
z.literal("240105"),
|
|
2041
|
+
z.literal("240106"),
|
|
2042
|
+
z.literal("240200"),
|
|
2043
|
+
z.literal("240201"),
|
|
2044
|
+
z.literal("240202"),
|
|
2045
|
+
z.literal("240300"),
|
|
2046
|
+
z.literal("240301"),
|
|
2047
|
+
z.literal("240400"),
|
|
2048
|
+
z.literal("240401"),
|
|
2049
|
+
z.literal("240402"),
|
|
2050
|
+
z.literal("240403"),
|
|
2051
|
+
z.literal("240404"),
|
|
2052
|
+
z.literal("250000"),
|
|
2053
|
+
z.literal("250100"),
|
|
2054
|
+
z.literal("250101"),
|
|
2055
|
+
z.literal("250102"),
|
|
2056
|
+
z.literal("250104"),
|
|
2057
|
+
z.literal("250105"),
|
|
2058
|
+
z.literal("250106"),
|
|
2059
|
+
z.literal("250107"),
|
|
2060
|
+
z.literal("250200"),
|
|
2061
|
+
z.literal("250201"),
|
|
2062
|
+
z.literal("250300"),
|
|
2063
|
+
z.literal("250301"),
|
|
2064
|
+
z.literal("250302"),
|
|
2065
|
+
z.literal("250303"),
|
|
2066
|
+
z.literal("250400"),
|
|
2067
|
+
z.literal("250401"),
|
|
2068
|
+
z.literal("250402"),
|
|
2069
|
+
z.literal("250500"),
|
|
2070
|
+
z.literal("250501"),
|
|
2071
|
+
z.literal("250502"),
|
|
2072
|
+
z.literal("250503"),
|
|
2073
|
+
z.literal("250504"),
|
|
2074
|
+
z.literal("250600"),
|
|
2075
|
+
z.literal("250601"),
|
|
2076
|
+
z.literal("250602"),
|
|
2077
|
+
z.literal("250700"),
|
|
2078
|
+
z.literal("250701"),
|
|
2079
|
+
z.literal("250702"),
|
|
2080
|
+
z.literal("250703"),
|
|
2081
|
+
z.literal("250800"),
|
|
2082
|
+
z.literal("250801"),
|
|
2083
|
+
z.literal("250802"),
|
|
2084
|
+
z.literal("250803"),
|
|
2085
|
+
z.literal("250900"),
|
|
2086
|
+
z.literal("250901"),
|
|
2087
|
+
z.literal("251000"),
|
|
2088
|
+
z.literal("251001"),
|
|
2089
|
+
z.literal("260000"),
|
|
2090
|
+
z.literal("260100"),
|
|
2091
|
+
z.literal("260101"),
|
|
2092
|
+
z.literal("260200"),
|
|
2093
|
+
z.literal("260201"),
|
|
2094
|
+
z.literal("260300"),
|
|
2095
|
+
z.literal("260301"),
|
|
2096
|
+
z.literal("270000"),
|
|
2097
|
+
z.literal("270100"),
|
|
2098
|
+
z.literal("270101"),
|
|
2099
|
+
z.literal("270102"),
|
|
2100
|
+
z.literal("270103"),
|
|
2101
|
+
z.literal("270104"),
|
|
2102
|
+
z.literal("270200"),
|
|
2103
|
+
z.literal("270201"),
|
|
2104
|
+
z.literal("270202"),
|
|
2105
|
+
z.literal("270203"),
|
|
2106
|
+
z.literal("270204"),
|
|
2107
|
+
z.literal("270205"),
|
|
2108
|
+
z.literal("270300"),
|
|
2109
|
+
z.literal("270301"),
|
|
2110
|
+
z.literal("270302"),
|
|
2111
|
+
z.literal("270303"),
|
|
2112
|
+
z.literal("270304"),
|
|
2113
|
+
z.literal("280000"),
|
|
2114
|
+
z.literal("280100"),
|
|
2115
|
+
z.literal("280101"),
|
|
2116
|
+
z.literal("280102"),
|
|
2117
|
+
z.literal("280103"),
|
|
2118
|
+
z.literal("280104"),
|
|
2119
|
+
z.literal("280105"),
|
|
2120
|
+
z.literal("280106"),
|
|
2121
|
+
z.literal("280200"),
|
|
2122
|
+
z.literal("280201"),
|
|
2123
|
+
z.literal("280300"),
|
|
2124
|
+
z.literal("280301"),
|
|
2125
|
+
z.literal("280302"),
|
|
2126
|
+
z.literal("280303"),
|
|
2127
|
+
z.literal("290000"),
|
|
2128
|
+
z.literal("290100"),
|
|
2129
|
+
z.literal("290101"),
|
|
2130
|
+
z.literal("290102"),
|
|
2131
|
+
z.literal("290103"),
|
|
2132
|
+
z.literal("290104"),
|
|
2133
|
+
z.literal("290200"),
|
|
2134
|
+
z.literal("290201"),
|
|
2135
|
+
z.literal("290300"),
|
|
2136
|
+
z.literal("290301"),
|
|
2137
|
+
z.literal("290302"),
|
|
2138
|
+
z.literal("290303"),
|
|
2139
|
+
z.literal("290400"),
|
|
2140
|
+
z.literal("290402"),
|
|
2141
|
+
z.literal("290403"),
|
|
2142
|
+
z.literal("290500"),
|
|
2143
|
+
z.literal("290501"),
|
|
2144
|
+
z.literal("300000"),
|
|
2145
|
+
z.literal("300100"),
|
|
2146
|
+
z.literal("300101"),
|
|
2147
|
+
z.literal("300102"),
|
|
2148
|
+
z.literal("300103"),
|
|
2149
|
+
z.literal("300104"),
|
|
2150
|
+
z.literal("300200"),
|
|
2151
|
+
z.literal("300201"),
|
|
2152
|
+
z.literal("300202"),
|
|
2153
|
+
z.literal("300300"),
|
|
2154
|
+
z.literal("300301"),
|
|
2155
|
+
z.literal("310000"),
|
|
2156
|
+
z.literal("310100"),
|
|
2157
|
+
z.literal("310101"),
|
|
2158
|
+
z.literal("310102"),
|
|
2159
|
+
z.literal("310103"),
|
|
2160
|
+
z.literal("310104"),
|
|
2161
|
+
z.literal("310105"),
|
|
2162
|
+
z.literal("310200"),
|
|
2163
|
+
z.literal("310201"),
|
|
2164
|
+
z.literal("310300"),
|
|
2165
|
+
z.literal("310301"),
|
|
2166
|
+
z.literal("320000"),
|
|
2167
|
+
z.literal("320100"),
|
|
2168
|
+
z.literal("320101"),
|
|
2169
|
+
z.literal("320102"),
|
|
2170
|
+
z.literal("320200"),
|
|
2171
|
+
z.literal("320201"),
|
|
2172
|
+
z.literal("320300"),
|
|
2173
|
+
z.literal("320301"),
|
|
2174
|
+
z.literal("320302"),
|
|
2175
|
+
z.literal("320400"),
|
|
2176
|
+
z.literal("320401"),
|
|
2177
|
+
z.literal("320402"),
|
|
2178
|
+
z.literal("320500"),
|
|
2179
|
+
z.literal("320501"),
|
|
2180
|
+
z.literal("320502"),
|
|
2181
|
+
z.literal("320600"),
|
|
2182
|
+
z.literal("320601"),
|
|
2183
|
+
z.literal("320602"),
|
|
2184
|
+
z.literal("320603"),
|
|
2185
|
+
z.literal("320700"),
|
|
2186
|
+
z.literal("320701"),
|
|
2187
|
+
z.literal("320702"),
|
|
2188
|
+
z.literal("320703"),
|
|
2189
|
+
]).nullable(),
|
|
2190
|
+
});
|
|
2191
|
+
export const zInvoiceTax = lenientUnion([
|
|
2192
|
+
z.object({
|
|
2193
|
+
included: z.boolean(),
|
|
2194
|
+
kind: z.enum(["itbis_18"]),
|
|
2195
|
+
}),
|
|
2196
|
+
z.object({
|
|
2197
|
+
included: z.boolean(),
|
|
2198
|
+
kind: z.enum(["itbis_16"]),
|
|
2199
|
+
}),
|
|
2200
|
+
z.object({
|
|
2201
|
+
kind: z.enum(["zero_rated"]),
|
|
2202
|
+
}),
|
|
2203
|
+
z.object({
|
|
2204
|
+
kind: z.enum(["exempt"]),
|
|
2205
|
+
}),
|
|
2206
|
+
z.object({
|
|
2207
|
+
kind: z.enum(["non_billable"]),
|
|
2208
|
+
}),
|
|
2209
|
+
]);
|
|
2210
|
+
export const zInvoiceTotals = z.object({
|
|
2211
|
+
net: z.string(),
|
|
2212
|
+
nonBillable: z.string(),
|
|
2213
|
+
tax: z.string(),
|
|
2214
|
+
total: z.string(),
|
|
2215
|
+
});
|
|
2216
|
+
export const zInvoicePreview = lenientUnion([
|
|
2217
|
+
z.object({
|
|
2218
|
+
status: z.enum(["valid"]),
|
|
2219
|
+
totals: zInvoiceTotals,
|
|
2220
|
+
}),
|
|
2221
|
+
z.object({
|
|
2222
|
+
problems: z.array(zFiscalAdmissionProblem),
|
|
2223
|
+
status: z.enum(["invalid"]),
|
|
2224
|
+
totals: zInvoiceTotals.nullable(),
|
|
2225
|
+
}),
|
|
2226
|
+
]);
|
|
2227
|
+
export const zInvoiceType = z.enum([
|
|
2228
|
+
"E31",
|
|
2229
|
+
"E32",
|
|
2230
|
+
"E33",
|
|
2231
|
+
"E34",
|
|
2232
|
+
"E41",
|
|
2233
|
+
"E43",
|
|
2234
|
+
"E44",
|
|
2235
|
+
"E45",
|
|
2236
|
+
"E46",
|
|
2237
|
+
"E47",
|
|
2238
|
+
]);
|
|
2239
|
+
export const zInvoiceFiscalIdentity = z.object({
|
|
2240
|
+
eNcf: z.string().regex(/^E(31|32|33|34|41|43|44|45|46|47)[0-9]{10}$/),
|
|
2241
|
+
type: zInvoiceType,
|
|
2242
|
+
});
|
|
2243
|
+
export const zInvoiceWebhookEvent = lenientUnion([
|
|
2244
|
+
z.object({
|
|
2245
|
+
data: z.object({
|
|
2246
|
+
id: z.uuid(),
|
|
2247
|
+
sourceConnectionId: z.uuid(),
|
|
2248
|
+
}),
|
|
2249
|
+
type: z.enum(["invoice.accepted"]),
|
|
2250
|
+
}),
|
|
2251
|
+
z.object({
|
|
2252
|
+
data: z.object({
|
|
2253
|
+
id: z.uuid(),
|
|
2254
|
+
sourceConnectionId: z.uuid(),
|
|
2255
|
+
}),
|
|
2256
|
+
type: z.enum(["invoice.rejected"]),
|
|
2257
|
+
}),
|
|
2258
|
+
z.object({
|
|
2259
|
+
data: z.object({
|
|
2260
|
+
id: z.uuid(),
|
|
2261
|
+
sourceConnectionId: z.uuid(),
|
|
2262
|
+
}),
|
|
2263
|
+
type: z.enum(["invoice.operatorRequired"]),
|
|
2264
|
+
}),
|
|
2265
|
+
z.object({
|
|
2266
|
+
data: z.object({
|
|
2267
|
+
id: z.uuid(),
|
|
2268
|
+
sourceConnectionId: z.uuid(),
|
|
2269
|
+
}),
|
|
2270
|
+
type: z.enum(["invoice.ready"]),
|
|
2271
|
+
}),
|
|
2272
|
+
]);
|
|
2273
|
+
export const zInvoiceXmlReadiness = lenientUnion([
|
|
2274
|
+
z.object({
|
|
2275
|
+
status: z.enum(["notApplicable"]),
|
|
2276
|
+
}),
|
|
2277
|
+
z.object({
|
|
2278
|
+
status: z.enum(["pending"]),
|
|
2279
|
+
}),
|
|
2280
|
+
z.object({
|
|
2281
|
+
byteLength: z
|
|
2282
|
+
.int()
|
|
2283
|
+
.gte(0)
|
|
2284
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
2285
|
+
createdAt: z.iso.datetime(),
|
|
2286
|
+
mediaType: zFiscalArtifactMediaType,
|
|
2287
|
+
sha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
2288
|
+
status: z.enum(["ready"]),
|
|
2289
|
+
}),
|
|
2290
|
+
]);
|
|
2291
|
+
/**
|
|
2292
|
+
* One stable reason the authoritative rules refuse to issue.
|
|
2293
|
+
*/
|
|
2294
|
+
export const zIssuanceBlocker = z.enum([
|
|
2295
|
+
"invalid_request",
|
|
2296
|
+
"unsupported_protocol",
|
|
2297
|
+
"unsupported_rules_version",
|
|
2298
|
+
"invalid_resolved_facts",
|
|
2299
|
+
"numbering_verifier_missing",
|
|
2300
|
+
"numbering_mode_not_enabled",
|
|
2301
|
+
"document_type_not_recognized",
|
|
2302
|
+
"authorization_missing",
|
|
2303
|
+
"authorization_not_observed_on_effective_date",
|
|
2304
|
+
"authorization_suspended",
|
|
2305
|
+
"authorization_cancelled",
|
|
2306
|
+
"authorization_superseded",
|
|
2307
|
+
"authorization_exhausted",
|
|
2308
|
+
"authorization_conflicting",
|
|
2309
|
+
"authorization_document_type_mismatch",
|
|
2310
|
+
"central_assignment_requires_verified_authorization",
|
|
2311
|
+
"authorization_expired",
|
|
2312
|
+
"authorization_range_overlap",
|
|
2313
|
+
"fiscal_number_capacity_exhausted",
|
|
2314
|
+
"invalid_fiscal_number",
|
|
2315
|
+
"fiscal_number_outside_authorized_range",
|
|
2316
|
+
"fiscal_number_before_verified_floor",
|
|
2317
|
+
"sequence_expiration_mismatch",
|
|
2318
|
+
]);
|
|
2319
|
+
export const zLedgerCounter = z.string().regex(/^(0|[1-9][0-9]*)$/);
|
|
2320
|
+
export const zCertificateCustodyCertificateVersionResource = z.object({
|
|
2321
|
+
certificate_custody_certificate_version: zLedgerCounter,
|
|
2322
|
+
certificate_not_after: z.iso.datetime(),
|
|
2323
|
+
certificate_not_before: z.iso.datetime(),
|
|
2324
|
+
certificate_sha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
2325
|
+
certificate_subject_serial_number: z
|
|
2326
|
+
.string()
|
|
2327
|
+
.refine((text) => Array.from(text).length >= 9)
|
|
2328
|
+
.refine((text) => Array.from(text).length <= 26)
|
|
2329
|
+
.regex(/^([0-9]{9}|[0-9]{11}|IDCDO-([0-9]{9}|[0-9]{11})|PAS[A-Z]{2}-[A-Za-z0-9]{5,20})$/),
|
|
2330
|
+
effect_replay_retention_seconds: z.int().gte(1).lte(2147483647),
|
|
2331
|
+
signature_algorithm: zCertificateCustodySignatureAlgorithm,
|
|
2332
|
+
});
|
|
2333
|
+
export const zCertificateCustodyBindingResource = z.object({
|
|
2334
|
+
active_certificate_version: zCertificateCustodyCertificateVersionResource.nullable(),
|
|
2335
|
+
certificate_custody_binding_id: z.uuid(),
|
|
2336
|
+
created_at: z.iso.datetime(),
|
|
2337
|
+
environment: zFiscalEnvironment,
|
|
2338
|
+
expected_signer_subject_serial_number: z
|
|
2339
|
+
.string()
|
|
2340
|
+
.refine((text) => Array.from(text).length >= 9)
|
|
2341
|
+
.refine((text) => Array.from(text).length <= 26)
|
|
2342
|
+
.regex(/^([0-9]{9}|[0-9]{11}|IDCDO-([0-9]{9}|[0-9]{11})|PAS[A-Z]{2}-[A-Za-z0-9]{5,20})$/),
|
|
2343
|
+
legal_issuer_id: z.uuid(),
|
|
2344
|
+
organization_id: z.uuid(),
|
|
2345
|
+
});
|
|
2346
|
+
export const zCertificateCustodyBindingPage = z.object({
|
|
2347
|
+
data: z.array(zCertificateCustodyBindingResource),
|
|
2348
|
+
hasMore: z.boolean(),
|
|
2349
|
+
nextCursor: z.string().nullable(),
|
|
2350
|
+
object: zCollectionObject,
|
|
2351
|
+
});
|
|
2352
|
+
export const zFiscalNumberAuthorizationNextUnused = lenientUnion([
|
|
2353
|
+
z.object({
|
|
2354
|
+
kind: z.enum(["sequence"]),
|
|
2355
|
+
sequence: zLedgerCounter,
|
|
2356
|
+
}),
|
|
2357
|
+
z.object({
|
|
2358
|
+
kind: z.enum(["exhausted"]),
|
|
2359
|
+
}),
|
|
2360
|
+
]);
|
|
2361
|
+
export const zFiscalNumberAuthorizationResource = z.object({
|
|
2362
|
+
created_at: z.iso.datetime(),
|
|
2363
|
+
document_type: zElectronicFiscalDocumentType,
|
|
2364
|
+
ends_at: zLedgerCounter,
|
|
2365
|
+
environment: zFiscalEnvironment,
|
|
2366
|
+
expires_on: z
|
|
2367
|
+
.string()
|
|
2368
|
+
.regex(/^\d{2}-\d{2}-\d{4}$/)
|
|
2369
|
+
.nullable(),
|
|
2370
|
+
generation: zLedgerCounter,
|
|
2371
|
+
id: z.uuid(),
|
|
2372
|
+
knowledge: zFiscalNumberAuthorizationKnowledge,
|
|
2373
|
+
legal_issuer_id: z.uuid(),
|
|
2374
|
+
lineage_id: z.uuid(),
|
|
2375
|
+
observed_at: z.iso.datetime(),
|
|
2376
|
+
provenance_sha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
2377
|
+
series: zElectronicFiscalDocumentSeries,
|
|
2378
|
+
source_id: z
|
|
2379
|
+
.string()
|
|
2380
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
2381
|
+
.refine((text) => Array.from(text).length <= 128)
|
|
2382
|
+
.regex(/^[^\p{White_Space}](?:[\s\S]*[^\p{White_Space}])?$/u),
|
|
2383
|
+
source_kind: zFiscalNumberAuthorizationSourceKind,
|
|
2384
|
+
source_reference: z.string(),
|
|
2385
|
+
starts_at: zLedgerCounter,
|
|
2386
|
+
state: zFiscalNumberAuthorizationState,
|
|
2387
|
+
supersedes_id: z.uuid().nullable(),
|
|
2388
|
+
verified_next_unused: zFiscalNumberAuthorizationNextUnused,
|
|
2389
|
+
});
|
|
2390
|
+
export const zFiscalNumberAuthorizationLineage = z.object({
|
|
2391
|
+
current: zFiscalNumberAuthorizationResource,
|
|
2392
|
+
generations: z.array(zFiscalNumberAuthorizationResource).min(1),
|
|
2393
|
+
lineage_id: z.uuid(),
|
|
2394
|
+
});
|
|
2395
|
+
export const zFiscalNumberAuthorizationHistoryResource = z.object({
|
|
2396
|
+
authorizations: z.array(zFiscalNumberAuthorizationLineage),
|
|
2397
|
+
document_type: zElectronicFiscalDocumentType,
|
|
2398
|
+
environment: zFiscalEnvironment,
|
|
2399
|
+
legal_issuer_id: z.uuid(),
|
|
2400
|
+
});
|
|
2401
|
+
export const zFiscalNumberAuthorizationSelection = z.object({
|
|
2402
|
+
authorization_id: z.uuid(),
|
|
2403
|
+
ends_at: zLedgerCounter,
|
|
2404
|
+
expires_on: z
|
|
2405
|
+
.string()
|
|
2406
|
+
.regex(/^\d{2}-\d{2}-\d{4}$/)
|
|
2407
|
+
.nullable(),
|
|
2408
|
+
next_available_sequence: zLedgerCounter,
|
|
2409
|
+
remaining_capacity: z.number().gte(0),
|
|
2410
|
+
starts_at: zLedgerCounter,
|
|
2411
|
+
state: zFiscalNumberAuthorizationState,
|
|
2412
|
+
verified_next_unused: zFiscalNumberAuthorizationNextUnused,
|
|
2413
|
+
});
|
|
2414
|
+
export const zFiscalNumberAuthorizationTypeReadiness = z.object({
|
|
2415
|
+
document_type: zElectronicFiscalDocumentType,
|
|
2416
|
+
selected: zFiscalNumberAuthorizationSelection.nullable(),
|
|
2417
|
+
status: zFiscalNumberAuthorizationReadinessStatus,
|
|
2418
|
+
unavailable_reason: zFiscalNumberAuthorizationUnavailableReason.nullable(),
|
|
2419
|
+
});
|
|
2420
|
+
export const zFiscalNumberAuthorizationDocumentReadiness = z.object({
|
|
2421
|
+
e31: zFiscalNumberAuthorizationTypeReadiness,
|
|
2422
|
+
e32: zFiscalNumberAuthorizationTypeReadiness,
|
|
2423
|
+
e33: zFiscalNumberAuthorizationTypeReadiness,
|
|
2424
|
+
e34: zFiscalNumberAuthorizationTypeReadiness,
|
|
2425
|
+
e41: zFiscalNumberAuthorizationTypeReadiness,
|
|
2426
|
+
e43: zFiscalNumberAuthorizationTypeReadiness,
|
|
2427
|
+
e44: zFiscalNumberAuthorizationTypeReadiness,
|
|
2428
|
+
e45: zFiscalNumberAuthorizationTypeReadiness,
|
|
2429
|
+
e46: zFiscalNumberAuthorizationTypeReadiness,
|
|
2430
|
+
e47: zFiscalNumberAuthorizationTypeReadiness,
|
|
2431
|
+
});
|
|
2432
|
+
export const zFiscalNumberAuthorizationReadiness = z.object({
|
|
2433
|
+
documents: zFiscalNumberAuthorizationDocumentReadiness,
|
|
2434
|
+
effective_on: z.iso.date(),
|
|
2435
|
+
environment: zFiscalEnvironment,
|
|
2436
|
+
issuer_tax_id: z.string().regex(/^[0-9]{9}([0-9]{2})?$/),
|
|
2437
|
+
legal_issuer_id: z.uuid(),
|
|
2438
|
+
object: z.string(),
|
|
2439
|
+
source_connection_id: z.uuid(),
|
|
2440
|
+
});
|
|
2441
|
+
export const zLegalIssuerVerification = z.enum(["verified", "unverified"]);
|
|
2442
|
+
export const zLegalIssuer = z.object({
|
|
2443
|
+
address: z
|
|
2444
|
+
.string()
|
|
2445
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
2446
|
+
.refine((text) => Array.from(text).length <= 100)
|
|
2447
|
+
.nullable(),
|
|
2448
|
+
commercial_name: z
|
|
2449
|
+
.string()
|
|
2450
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
2451
|
+
.refine((text) => Array.from(text).length <= 150)
|
|
2452
|
+
.nullable(),
|
|
2453
|
+
created_at: z.iso.datetime(),
|
|
2454
|
+
default_income_type: z
|
|
2455
|
+
.string()
|
|
2456
|
+
.regex(/^0[1-6]$/)
|
|
2457
|
+
.nullable(),
|
|
2458
|
+
email: z
|
|
2459
|
+
.email()
|
|
2460
|
+
.refine((text) => Array.from(text).length >= 3)
|
|
2461
|
+
.refine((text) => Array.from(text).length <= 80)
|
|
2462
|
+
.nullable(),
|
|
2463
|
+
id: z.uuid(),
|
|
2464
|
+
legal_name: z
|
|
2465
|
+
.string()
|
|
2466
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
2467
|
+
.refine((text) => Array.from(text).length <= 150)
|
|
2468
|
+
.regex(/^(?=.*[^\p{White_Space}])[\s\S]+$/u),
|
|
2469
|
+
municipality_code: z
|
|
2470
|
+
.string()
|
|
2471
|
+
.regex(/^[0-9]{6}$/)
|
|
2472
|
+
.nullable(),
|
|
2473
|
+
phone: z
|
|
2474
|
+
.string()
|
|
2475
|
+
.regex(/^[0-9]{3}-[0-9]{3}-[0-9]{4}$/)
|
|
2476
|
+
.nullable(),
|
|
2477
|
+
province_code: z
|
|
2478
|
+
.string()
|
|
2479
|
+
.regex(/^[0-9]{6}$/)
|
|
2480
|
+
.nullable(),
|
|
2481
|
+
sales_zone: z
|
|
2482
|
+
.string()
|
|
2483
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
2484
|
+
.refine((text) => Array.from(text).length <= 20)
|
|
2485
|
+
.nullable(),
|
|
2486
|
+
seller_code: z
|
|
2487
|
+
.string()
|
|
2488
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
2489
|
+
.refine((text) => Array.from(text).length <= 60)
|
|
2490
|
+
.nullable(),
|
|
2491
|
+
tax_id: z.string().regex(/^[0-9]{9}([0-9]{2})?$/),
|
|
2492
|
+
verification: zLegalIssuerVerification,
|
|
2493
|
+
website: z
|
|
2494
|
+
.string()
|
|
2495
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
2496
|
+
.refine((text) => Array.from(text).length <= 50)
|
|
2497
|
+
.nullable(),
|
|
2498
|
+
});
|
|
2499
|
+
export const zLegalIssuerPage = z.object({
|
|
2500
|
+
data: z.array(zLegalIssuer),
|
|
2501
|
+
hasMore: z.boolean(),
|
|
2502
|
+
nextCursor: z.string().nullable(),
|
|
2503
|
+
object: zCollectionObject,
|
|
2504
|
+
});
|
|
2505
|
+
export const zLegalIssuerResource = z.object({
|
|
2506
|
+
legal_issuer: zLegalIssuer,
|
|
2507
|
+
});
|
|
2508
|
+
export const zMembershipRole = z.enum(["administrator", "operator"]);
|
|
2509
|
+
export const zAcceptedMembership = z.object({
|
|
2510
|
+
organization_id: z.uuid(),
|
|
2511
|
+
role: zMembershipRole,
|
|
2512
|
+
});
|
|
2513
|
+
export const zInvitationGrantResource = z.object({
|
|
2514
|
+
email: zIdentityEmailSchema,
|
|
2515
|
+
expires_at: z.iso.datetime(),
|
|
2516
|
+
id: z.uuid(),
|
|
2517
|
+
role: zMembershipRole,
|
|
2518
|
+
token: z
|
|
2519
|
+
.string()
|
|
2520
|
+
.refine((text) => Array.from(text).length >= 43)
|
|
2521
|
+
.refine((text) => Array.from(text).length <= 43)
|
|
2522
|
+
.regex(/^[A-Za-z0-9_-]{43}$/),
|
|
2523
|
+
});
|
|
2524
|
+
export const zInvitationGrant = z.object({
|
|
2525
|
+
invitation: zInvitationGrantResource,
|
|
2526
|
+
});
|
|
2527
|
+
export const zInvitationResource = z.object({
|
|
2528
|
+
created_at: z.iso.datetime(),
|
|
2529
|
+
email: zIdentityEmailSchema,
|
|
2530
|
+
expires_at: z.iso.datetime(),
|
|
2531
|
+
id: z.uuid(),
|
|
2532
|
+
role: zMembershipRole,
|
|
2533
|
+
status: zInvitationStatus,
|
|
2534
|
+
});
|
|
2535
|
+
export const zInvitationPage = z.object({
|
|
2536
|
+
data: z.array(zInvitationResource),
|
|
2537
|
+
hasMore: z.boolean(),
|
|
2538
|
+
nextCursor: z.string().nullable(),
|
|
2539
|
+
object: zCollectionObject,
|
|
2540
|
+
});
|
|
2541
|
+
export const zMembershipAcceptance = z.object({
|
|
2542
|
+
membership: zAcceptedMembership,
|
|
2543
|
+
});
|
|
2544
|
+
export const zMembershipResource = z.object({
|
|
2545
|
+
legal_name: z
|
|
2546
|
+
.string()
|
|
2547
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
2548
|
+
.refine((text) => Array.from(text).length <= 150)
|
|
2549
|
+
.regex(/^(?=.*[^\p{White_Space}])[\s\S]+$/u),
|
|
2550
|
+
organization_id: z.uuid(),
|
|
2551
|
+
role: zMembershipRole,
|
|
2552
|
+
slug: z.string().regex(/^[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$/),
|
|
2553
|
+
});
|
|
2554
|
+
/**
|
|
2555
|
+
* Closed `CodigoMotivoNoRecibido` vocabulary for a not-received e-CF.
|
|
2556
|
+
*/
|
|
2557
|
+
export const zNotReceivedReason = z.enum([
|
|
2558
|
+
"schema_error",
|
|
2559
|
+
"signature_error",
|
|
2560
|
+
"duplicate_submission",
|
|
2561
|
+
"buyer_rnc_mismatch",
|
|
2562
|
+
]);
|
|
2563
|
+
/**
|
|
2564
|
+
* Numbering values resolved before deterministic fiscal-document construction.
|
|
2565
|
+
*/
|
|
2566
|
+
export const zOnboardingLegalIssuerIdentityOutcome = lenientUnion([
|
|
2567
|
+
z.object({
|
|
2568
|
+
status: z.enum(["not_started"]),
|
|
2569
|
+
}),
|
|
2570
|
+
z.object({
|
|
2571
|
+
registered_name: z.string(),
|
|
2572
|
+
status: z.enum(["verified"]),
|
|
2573
|
+
tax_id: z.string().regex(/^[0-9]{9}$/),
|
|
2574
|
+
}),
|
|
2575
|
+
z.object({
|
|
2576
|
+
status: z.enum(["unverified"]),
|
|
2577
|
+
tax_id: z.string().regex(/^[0-9]{9}$/),
|
|
2578
|
+
}),
|
|
2579
|
+
]);
|
|
2580
|
+
export const zOnboardingLegalIssuerIdentityResourceObject = z.enum([
|
|
2581
|
+
"onboarding_legal_issuer_identity",
|
|
2582
|
+
]);
|
|
2583
|
+
export const zOnboardingLegalIssuerIdentity = z.object({
|
|
2584
|
+
object: zOnboardingLegalIssuerIdentityResourceObject,
|
|
2585
|
+
outcome: zOnboardingLegalIssuerIdentityOutcome,
|
|
2586
|
+
revision: z
|
|
2587
|
+
.string()
|
|
2588
|
+
.refine((text) => Array.from(text).length <= 18)
|
|
2589
|
+
.regex(/^[1-9][0-9]*$/)
|
|
2590
|
+
.nullable(),
|
|
2591
|
+
});
|
|
2592
|
+
export const zOnboardingServiceScopeResourceObject = z.enum(["onboarding_service_scope"]);
|
|
2593
|
+
export const zOnboardingServiceScopeValue = z.enum([
|
|
2594
|
+
"payments",
|
|
2595
|
+
"electronic_invoicing",
|
|
2596
|
+
"payments_and_electronic_invoicing",
|
|
2597
|
+
]);
|
|
2598
|
+
export const zOnboardingServiceScopeOutcome = lenientUnion([
|
|
2599
|
+
z.object({
|
|
2600
|
+
status: z.enum(["not_started"]),
|
|
2601
|
+
}),
|
|
2602
|
+
z.object({
|
|
2603
|
+
service_scope: zOnboardingServiceScopeValue,
|
|
2604
|
+
status: z.enum(["selected"]),
|
|
2605
|
+
}),
|
|
2606
|
+
]);
|
|
2607
|
+
export const zOnboardingServiceScopeResource = z.object({
|
|
2608
|
+
object: zOnboardingServiceScopeResourceObject,
|
|
2609
|
+
outcome: zOnboardingServiceScopeOutcome,
|
|
2610
|
+
revision: z
|
|
2611
|
+
.string()
|
|
2612
|
+
.refine((text) => Array.from(text).length <= 18)
|
|
2613
|
+
.regex(/^[1-9][0-9]*$/)
|
|
2614
|
+
.nullable(),
|
|
2615
|
+
});
|
|
2616
|
+
export const zOrganizationIdentity = z.object({
|
|
2617
|
+
created_at: z.iso.datetime(),
|
|
2618
|
+
id: z.uuid(),
|
|
2619
|
+
legal_name: z
|
|
2620
|
+
.string()
|
|
2621
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
2622
|
+
.refine((text) => Array.from(text).length <= 150)
|
|
2623
|
+
.regex(/^(?=.*[^\p{White_Space}])[\s\S]+$/u),
|
|
2624
|
+
slug: z.string().regex(/^[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$/),
|
|
2625
|
+
});
|
|
2626
|
+
export const zOrganizationResource = z.object({
|
|
2627
|
+
organization: zOrganizationIdentity,
|
|
2628
|
+
});
|
|
2629
|
+
/**
|
|
2630
|
+
* One authoritative payment-method and amount pair from `TablaFormasPago`.
|
|
2631
|
+
*/
|
|
2632
|
+
export const zPrintedRepresentationA4ProfileVersion = z.enum(["a4.v1"]);
|
|
2633
|
+
/**
|
|
2634
|
+
* Immutable line range and fiscal subtotals assigned to one printed page or receipt segment.
|
|
2635
|
+
*/
|
|
2636
|
+
export const zPrintedRepresentationPagePlan = z.object({
|
|
2637
|
+
additional_tax_subtotal: z.string(),
|
|
2638
|
+
detail_row_count: z
|
|
2639
|
+
.int()
|
|
2640
|
+
.gte(0)
|
|
2641
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
2642
|
+
exempt_subtotal: z.string(),
|
|
2643
|
+
first_line_number: z
|
|
2644
|
+
.int()
|
|
2645
|
+
.gte(0)
|
|
2646
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
2647
|
+
itbis_16_subtotal: z.string(),
|
|
2648
|
+
itbis_18_subtotal: z.string(),
|
|
2649
|
+
last_line_number: z
|
|
2650
|
+
.int()
|
|
2651
|
+
.gte(0)
|
|
2652
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
2653
|
+
non_billable_subtotal: z.string(),
|
|
2654
|
+
page_number: z
|
|
2655
|
+
.int()
|
|
2656
|
+
.gte(0)
|
|
2657
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
2658
|
+
page_total: z.string(),
|
|
2659
|
+
taxable_0_subtotal: z.string(),
|
|
2660
|
+
taxable_16_subtotal: z.string(),
|
|
2661
|
+
taxable_18_subtotal: z.string(),
|
|
2662
|
+
});
|
|
2663
|
+
export const zPrintedRepresentationPdfMediaType = z.enum(["application/pdf"]);
|
|
2664
|
+
export const zInvoicePdfReadiness = lenientUnion([
|
|
2665
|
+
z.object({
|
|
2666
|
+
status: z.enum(["notApplicable"]),
|
|
2667
|
+
}),
|
|
2668
|
+
z.object({
|
|
2669
|
+
stage: zInvoicePdfStage,
|
|
2670
|
+
status: z.enum(["pending"]),
|
|
2671
|
+
}),
|
|
2672
|
+
z.object({
|
|
2673
|
+
byteLength: z.int().gte(1).lte(2147483647),
|
|
2674
|
+
createdAt: z.iso.datetime(),
|
|
2675
|
+
layout: zInvoicePdfLayout,
|
|
2676
|
+
mediaType: zPrintedRepresentationPdfMediaType,
|
|
2677
|
+
pageCount: z.int().gte(1).lte(100),
|
|
2678
|
+
pdfSha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
2679
|
+
signedSourceSha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
2680
|
+
status: z.enum(["ready"]),
|
|
2681
|
+
}),
|
|
2682
|
+
z.object({
|
|
2683
|
+
layout: zInvoicePdfLayout,
|
|
2684
|
+
resultCode: z.string(),
|
|
2685
|
+
status: z.enum(["unavailable"]),
|
|
2686
|
+
}),
|
|
2687
|
+
]);
|
|
2688
|
+
export const zInvoiceFiles = z.object({
|
|
2689
|
+
pdf: zInvoicePdfReadiness,
|
|
2690
|
+
xml: zInvoiceXmlReadiness,
|
|
2691
|
+
});
|
|
2692
|
+
export const zInvoiceReceiptFiles = z.object({
|
|
2693
|
+
pdf: zInvoicePdfReadiness,
|
|
2694
|
+
});
|
|
2695
|
+
/**
|
|
2696
|
+
* Durable generation stage for a representation that is not ready yet.
|
|
2697
|
+
*/
|
|
2698
|
+
export const zPrintedRepresentationPendingStage = z.enum([
|
|
2699
|
+
"awaiting_signed_source",
|
|
2700
|
+
"queued",
|
|
2701
|
+
"rendering",
|
|
2702
|
+
"retry_scheduled",
|
|
2703
|
+
]);
|
|
2704
|
+
/**
|
|
2705
|
+
* Certification-candidate layout bound to a Fiscal operation before its XML is serialized.
|
|
2706
|
+
*/
|
|
2707
|
+
export const zPrintedRepresentationProfile = z.enum(["receipt_80mm", "a4"]);
|
|
2708
|
+
/**
|
|
2709
|
+
* Deterministic pagination facts used by both signed XML and native PDF rendering.
|
|
2710
|
+
*/
|
|
2711
|
+
export const zPrintedRepresentationPlan = z.object({
|
|
2712
|
+
page_count: z
|
|
2713
|
+
.int()
|
|
2714
|
+
.gte(0)
|
|
2715
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
2716
|
+
pages: z.array(zPrintedRepresentationPagePlan),
|
|
2717
|
+
profile: zPrintedRepresentationProfile,
|
|
2718
|
+
rendering_profile_version: z.string(),
|
|
2719
|
+
});
|
|
2720
|
+
/**
|
|
2721
|
+
* Retained plan and its canonical SHA-256 identity.
|
|
2722
|
+
*/
|
|
2723
|
+
export const zPlannedPrintedRepresentation = z.object({
|
|
2724
|
+
plan: zPrintedRepresentationPlan,
|
|
2725
|
+
plan_sha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
2726
|
+
});
|
|
2727
|
+
/**
|
|
2728
|
+
* A successful deterministic fiscal-document engine response.
|
|
2729
|
+
*/
|
|
2730
|
+
export const zEvaluatedEngineResponse = z.object({
|
|
2731
|
+
canonical_intent_sha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
2732
|
+
document_type: zEvaluatedFiscalDocumentType,
|
|
2733
|
+
engine: zEngineIdentity,
|
|
2734
|
+
outcome: zEvaluatedOutcome,
|
|
2735
|
+
printed_representation: zPlannedPrintedRepresentation,
|
|
2736
|
+
protocol: zEngineProtocol,
|
|
2737
|
+
request_id: z.string(),
|
|
2738
|
+
totals: zFiscalTotals,
|
|
2739
|
+
unsigned_xml_base64: z.string().refine((text) => Array.from(text).length >= 1),
|
|
2740
|
+
unsigned_xml_sha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
2741
|
+
});
|
|
2742
|
+
export const zPrintedRepresentationReceiptProfileVersion = z.enum(["receipt_80mm.v1"]);
|
|
2743
|
+
export const zPrintedRepresentationProfileIdentity = lenientUnion([
|
|
2744
|
+
z.object({
|
|
2745
|
+
profile: z.enum(["receipt_80mm"]),
|
|
2746
|
+
profile_version: zPrintedRepresentationReceiptProfileVersion,
|
|
2747
|
+
}),
|
|
2748
|
+
z.object({
|
|
2749
|
+
profile: z.enum(["a4"]),
|
|
2750
|
+
profile_version: zPrintedRepresentationA4ProfileVersion,
|
|
2751
|
+
}),
|
|
2752
|
+
]);
|
|
2753
|
+
/**
|
|
2754
|
+
* Presentation-artifact readiness, independent of DGII authority state and buyer delivery.
|
|
2755
|
+
*/
|
|
2756
|
+
export const zPrintedRepresentationResource = lenientUnion([
|
|
2757
|
+
z.object({
|
|
2758
|
+
status: z.enum(["not_applicable"]),
|
|
2759
|
+
}),
|
|
2760
|
+
z.object({
|
|
2761
|
+
stage: zPrintedRepresentationPendingStage,
|
|
2762
|
+
status: z.enum(["pending"]),
|
|
2763
|
+
}),
|
|
2764
|
+
z.object({
|
|
2765
|
+
artifact_id: z.uuid(),
|
|
2766
|
+
byte_length: z.int().gte(1).lte(2147483647),
|
|
2767
|
+
created_at: z.iso.datetime(),
|
|
2768
|
+
fiscal_identity: zFiscalIdentityResource,
|
|
2769
|
+
fiscal_operation_id: z.uuid(),
|
|
2770
|
+
media_type: zPrintedRepresentationPdfMediaType,
|
|
2771
|
+
page_count: z.int().gte(1).lte(100),
|
|
2772
|
+
pagination_plan_sha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
2773
|
+
pdf_sha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
2774
|
+
profile_identity: zPrintedRepresentationProfileIdentity,
|
|
2775
|
+
renderer_identity: z
|
|
2776
|
+
.string()
|
|
2777
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
2778
|
+
.refine((text) => Array.from(text).length <= 200)
|
|
2779
|
+
.regex(/^\S(?:.*\S)?$/),
|
|
2780
|
+
signed_source_sha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
2781
|
+
status: z.enum(["ready"]),
|
|
2782
|
+
}),
|
|
2783
|
+
z.object({
|
|
2784
|
+
profile: zPrintedRepresentationProfile,
|
|
2785
|
+
result_code: z.string(),
|
|
2786
|
+
status: z.enum(["unavailable"]),
|
|
2787
|
+
}),
|
|
2788
|
+
]);
|
|
2789
|
+
export const zProblemType = z.enum(["about:blank"]);
|
|
2790
|
+
/**
|
|
2791
|
+
* One RFC 9457 problem body returned on the `/v1` surface.
|
|
2792
|
+
*/
|
|
2793
|
+
export const zProblemBody = z.object({
|
|
2794
|
+
code: z.string().refine((text) => Array.from(text).length >= 1),
|
|
2795
|
+
detail: z.string().optional(),
|
|
2796
|
+
invoiceId: z.string().optional(),
|
|
2797
|
+
issuanceBlockers: z.array(zIssuanceBlocker).optional(),
|
|
2798
|
+
problems: z.array(zFiscalAdmissionProblem).optional(),
|
|
2799
|
+
requestId: z.string(),
|
|
2800
|
+
status: z.int().gte(400).lte(599),
|
|
2801
|
+
title: z.string(),
|
|
2802
|
+
type: zProblemType,
|
|
2803
|
+
});
|
|
2804
|
+
/**
|
|
2805
|
+
* One stable public problem code returned on the `/v1` surface.
|
|
2806
|
+
*/
|
|
2807
|
+
export const zQualifiedProductionOrigin = z.object({
|
|
2808
|
+
domain: z
|
|
2809
|
+
.string()
|
|
2810
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
2811
|
+
.refine((text) => Array.from(text).length <= 253)
|
|
2812
|
+
.regex(/^[^\p{White_Space}](?:[\s\S]*[^\p{White_Space}])?$/u),
|
|
2813
|
+
origin: z.url().regex(/^https:\/\/(?:[^\s/?#@:[\]]+|\[[0-9A-Fa-f:.]+\])$/),
|
|
2814
|
+
});
|
|
2815
|
+
/**
|
|
2816
|
+
* Actor-facing commercial-response state, projected from the receiver's own decision row.
|
|
2817
|
+
*/
|
|
2818
|
+
export const zReceivedDocumentCommercialResponseResource = lenientUnion([
|
|
2819
|
+
z.object({
|
|
2820
|
+
status: z.enum(["notReviewable"]),
|
|
2821
|
+
}),
|
|
2822
|
+
z.object({
|
|
2823
|
+
status: z.enum(["pending"]),
|
|
2824
|
+
}),
|
|
2825
|
+
z.object({
|
|
2826
|
+
recordedAt: z.iso.datetime(),
|
|
2827
|
+
status: z.enum(["accepted"]),
|
|
2828
|
+
submissionState: zCommercialResponseSubmissionStateResource,
|
|
2829
|
+
}),
|
|
2830
|
+
z.object({
|
|
2831
|
+
motive: z.string().refine((text) => Array.from(text).length <= 250),
|
|
2832
|
+
recordedAt: z.iso.datetime(),
|
|
2833
|
+
status: z.enum(["rejected"]),
|
|
2834
|
+
submissionState: zCommercialResponseSubmissionStateResource,
|
|
2835
|
+
}),
|
|
2836
|
+
]);
|
|
2837
|
+
export const zReceivedDocumentNotReceivedReasonResource = z.enum([
|
|
2838
|
+
"schemaError",
|
|
2839
|
+
"signatureError",
|
|
2840
|
+
"duplicateSubmission",
|
|
2841
|
+
"buyerRncMismatch",
|
|
2842
|
+
]);
|
|
2843
|
+
export const zReceivedDocumentStateResource = z.enum(["received", "notReceived"]);
|
|
2844
|
+
export const zReceivedDocumentResource = z.object({
|
|
2845
|
+
buyerTaxId: z.string(),
|
|
2846
|
+
commercialResponse: zReceivedDocumentCommercialResponseResource,
|
|
2847
|
+
eNcf: z.string(),
|
|
2848
|
+
environment: zFiscalEnvironment,
|
|
2849
|
+
id: z.uuid(),
|
|
2850
|
+
issuerTaxId: z.string(),
|
|
2851
|
+
notReceivedReason: zReceivedDocumentNotReceivedReasonResource.nullable(),
|
|
2852
|
+
receivedAt: z.iso.datetime(),
|
|
2853
|
+
receivedXmlSha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
2854
|
+
state: zReceivedDocumentStateResource,
|
|
2855
|
+
});
|
|
2856
|
+
export const zReceivedDocumentSummary = z.object({
|
|
2857
|
+
buyerTaxId: z.string(),
|
|
2858
|
+
commercialResponse: zReceivedDocumentCommercialResponseResource,
|
|
2859
|
+
eNcf: z.string(),
|
|
2860
|
+
environment: zFiscalEnvironment,
|
|
2861
|
+
id: z.uuid(),
|
|
2862
|
+
issuerTaxId: z.string(),
|
|
2863
|
+
receivedAt: z.iso.datetime(),
|
|
2864
|
+
state: zReceivedDocumentStateResource,
|
|
2865
|
+
});
|
|
2866
|
+
export const zReceivedDocumentPage = z.object({
|
|
2867
|
+
data: z.array(zReceivedDocumentSummary),
|
|
2868
|
+
hasMore: z.boolean(),
|
|
2869
|
+
nextCursor: z.string().nullable(),
|
|
2870
|
+
object: zCollectionObject,
|
|
2871
|
+
});
|
|
2872
|
+
export const zReceptionMountResource = z.object({
|
|
2873
|
+
declared_at: z.iso.datetime(),
|
|
2874
|
+
environment: zFiscalEnvironment,
|
|
2875
|
+
legal_issuer_id: z.uuid(),
|
|
2876
|
+
organization_id: z.uuid(),
|
|
2877
|
+
peer_authentication_declared: z.boolean(),
|
|
2878
|
+
reception_mount_id: z.uuid(),
|
|
2879
|
+
});
|
|
2880
|
+
/**
|
|
2881
|
+
* `InformacionReferencia` on a type whose official schema omits `RazonModificacion`.
|
|
2882
|
+
*/
|
|
2883
|
+
export const zRejectedOutcome = z.enum(["rejected"]);
|
|
2884
|
+
/**
|
|
2885
|
+
* A fiscal-document engine rejection carrying stable field problems.
|
|
2886
|
+
*/
|
|
2887
|
+
export const zRejectedEngineResponse = z.object({
|
|
2888
|
+
engine: zEngineIdentity,
|
|
2889
|
+
outcome: zRejectedOutcome,
|
|
2890
|
+
problems: z.array(zEngineProblem).min(1),
|
|
2891
|
+
protocol: zEngineProtocol,
|
|
2892
|
+
request_id: z.string(),
|
|
2893
|
+
});
|
|
2894
|
+
/**
|
|
2895
|
+
* One response emitted by the authoritative Rust fiscal-document engine.
|
|
2896
|
+
*/
|
|
2897
|
+
export const zFiscalEngineResponse = lenientUnion([
|
|
2898
|
+
zEvaluatedEngineResponse,
|
|
2899
|
+
zRejectedEngineResponse,
|
|
2900
|
+
]);
|
|
2901
|
+
export const zRejectedSourceDocumentOutcome = z.enum(["rejected"]);
|
|
2902
|
+
export const zRejectedSourceDocumentResponse = z.object({
|
|
2903
|
+
canonical_input_sha256: z
|
|
2904
|
+
.string()
|
|
2905
|
+
.regex(/^[0-9a-f]{64}$/)
|
|
2906
|
+
.optional(),
|
|
2907
|
+
engine: zEngineIdentity,
|
|
2908
|
+
outcome: zRejectedSourceDocumentOutcome,
|
|
2909
|
+
problems: z.array(zEngineProblem).min(1),
|
|
2910
|
+
protocol: z.string(),
|
|
2911
|
+
request_id: z.string(),
|
|
2912
|
+
rules_version: z.string(),
|
|
2913
|
+
});
|
|
2914
|
+
export const zReleasedHostedTenant = z.object({
|
|
2915
|
+
environment: zFiscalEnvironment,
|
|
2916
|
+
hosted_tenant_binding_id: z.uuid(),
|
|
2917
|
+
release_id: z.uuid(),
|
|
2918
|
+
state: z.string(),
|
|
2919
|
+
});
|
|
2920
|
+
export const zRequirementId = z.enum([
|
|
2921
|
+
"organization_identity",
|
|
2922
|
+
"legal_issuer_identity",
|
|
2923
|
+
"team_roles",
|
|
2924
|
+
"source_connection",
|
|
2925
|
+
"certificate_custody",
|
|
2926
|
+
"first_fiscal_operation",
|
|
2927
|
+
]);
|
|
2928
|
+
export const zRequirementStatus = z.enum(["complete", "pending", "blocked", "action_required"]);
|
|
2929
|
+
export const zSchemaValidationDiagnosticCode = z.enum([
|
|
2930
|
+
"document_xml_unreadable",
|
|
2931
|
+
"document_schema_rejected",
|
|
2932
|
+
]);
|
|
2933
|
+
/**
|
|
2934
|
+
* Whether schema validation succeeded or retained a safe diagnostic.
|
|
2935
|
+
*/
|
|
2936
|
+
export const zSchemaValidationOutcome = z.enum(["succeeded", "failed"]);
|
|
2937
|
+
/**
|
|
2938
|
+
* Stage at which a fiscal XML artifact was validated.
|
|
2939
|
+
*/
|
|
2940
|
+
export const zSchemaValidationStage = z.enum(["unsigned", "signed"]);
|
|
2941
|
+
export const zSignedDocumentReadinessResource = lenientUnion([
|
|
2942
|
+
z.object({
|
|
2943
|
+
status: z.enum(["not_applicable"]),
|
|
2944
|
+
}),
|
|
2945
|
+
z.object({
|
|
2946
|
+
status: z.enum(["pending"]),
|
|
2947
|
+
}),
|
|
2948
|
+
z.object({
|
|
2949
|
+
artifact_id: z.uuid(),
|
|
2950
|
+
artifact_kind: zFiscalArtifactKind,
|
|
2951
|
+
byte_length: z
|
|
2952
|
+
.int()
|
|
2953
|
+
.gte(0)
|
|
2954
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
2955
|
+
created_at: z.iso.datetime(),
|
|
2956
|
+
media_type: zFiscalArtifactMediaType,
|
|
2957
|
+
sha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
2958
|
+
status: z.enum(["ready"]),
|
|
2959
|
+
}),
|
|
2960
|
+
]);
|
|
2961
|
+
/**
|
|
2962
|
+
* Named additional taxes supported by the common Source contract.
|
|
2963
|
+
*/
|
|
2964
|
+
export const zSourceBuyerIdentityRequirement = z.enum(["required", "optional"]);
|
|
2965
|
+
export const zSourceConnectionActionReason = z.enum([
|
|
2966
|
+
"authorization_disabled",
|
|
2967
|
+
"authorization_scope_insufficient",
|
|
2968
|
+
"target_access_removed",
|
|
2969
|
+
"target_origin_unavailable",
|
|
2970
|
+
"target_configuration_rejected",
|
|
2971
|
+
"target_deployment_failed",
|
|
2972
|
+
"target_release_identity_unavailable",
|
|
2973
|
+
"target_verification_failed",
|
|
2974
|
+
"credential_reprovisioning_required",
|
|
2975
|
+
]);
|
|
2976
|
+
export const zSourceConnectionActivationPhase = z.enum([
|
|
2977
|
+
"credential_staging",
|
|
2978
|
+
"target_configuring",
|
|
2979
|
+
"deployment_requesting",
|
|
2980
|
+
"deployment_observing",
|
|
2981
|
+
"deployment_promotion_requesting",
|
|
2982
|
+
"deployment_promotion_observing",
|
|
2983
|
+
"verification_requesting",
|
|
2984
|
+
"verification_observing",
|
|
2985
|
+
]);
|
|
2986
|
+
export const zSourceConnectionAuthorizationReason = z.enum([
|
|
2987
|
+
"authorization_removed",
|
|
2988
|
+
"credential_rejected",
|
|
2989
|
+
]);
|
|
2990
|
+
export const zSourceConnectionLifecycle = lenientUnion([
|
|
2991
|
+
z.object({
|
|
2992
|
+
reason: zSourceConnectionAuthorizationReason,
|
|
2993
|
+
state: z.enum(["authorization_required"]),
|
|
2994
|
+
}),
|
|
2995
|
+
z.object({
|
|
2996
|
+
phase: zSourceConnectionActivationPhase,
|
|
2997
|
+
state: z.enum(["activating"]),
|
|
2998
|
+
}),
|
|
2999
|
+
z.object({
|
|
3000
|
+
connected_at: z.iso.datetime(),
|
|
3001
|
+
state: z.enum(["connected"]),
|
|
3002
|
+
}),
|
|
3003
|
+
z.object({
|
|
3004
|
+
reason: zSourceConnectionActionReason,
|
|
3005
|
+
state: z.enum(["action_required"]),
|
|
3006
|
+
}),
|
|
3007
|
+
z.object({
|
|
3008
|
+
revoked_at: z.iso.datetime(),
|
|
3009
|
+
state: z.enum(["revoked"]),
|
|
3010
|
+
}),
|
|
3011
|
+
]);
|
|
3012
|
+
export const zSourceConnectionProvider = z.enum(["vercel"]);
|
|
3013
|
+
/**
|
|
3014
|
+
* Supported credit-note purposes on the common Source path.
|
|
3015
|
+
*/
|
|
3016
|
+
export const zSourceDocumentType = z.enum(["31", "32", "45"]);
|
|
3017
|
+
/**
|
|
3018
|
+
* Fiscal document classification and buyer-identity requirement derived from a draft.
|
|
3019
|
+
*/
|
|
3020
|
+
export const zSourceDocumentEligibility = z.object({
|
|
3021
|
+
buyer_identity: zSourceBuyerIdentityRequirement,
|
|
3022
|
+
document_type: zSourceDocumentType,
|
|
3023
|
+
});
|
|
3024
|
+
export const zEvaluatedSourceDocumentResponse = z.object({
|
|
3025
|
+
canonical_input_sha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
3026
|
+
eligibility: zSourceDocumentEligibility,
|
|
3027
|
+
engine: zEngineIdentity,
|
|
3028
|
+
outcome: zEvaluatedSourceDocumentOutcome,
|
|
3029
|
+
protocol: z.string(),
|
|
3030
|
+
request_id: z.string(),
|
|
3031
|
+
rules_version: z.string(),
|
|
3032
|
+
totals: zFiscalTotals,
|
|
3033
|
+
});
|
|
3034
|
+
/**
|
|
3035
|
+
* A number-free Source document evaluation result.
|
|
3036
|
+
*/
|
|
3037
|
+
export const zSourceDocumentEvaluationResponse = lenientUnion([
|
|
3038
|
+
zEvaluatedSourceDocumentResponse,
|
|
3039
|
+
zRejectedSourceDocumentResponse,
|
|
3040
|
+
]);
|
|
3041
|
+
/**
|
|
3042
|
+
* Domestic buyer identity supported by taxpayer and government sales.
|
|
3043
|
+
*/
|
|
3044
|
+
export const zSourceFiscalAction = z.enum(["issue", "credit_note", "debit_note"]);
|
|
3045
|
+
export const zFiscalOperationResource = z.object({
|
|
3046
|
+
accepted_at: z.iso.datetime().nullable(),
|
|
3047
|
+
action: zSourceFiscalAction,
|
|
3048
|
+
buyer_delivery_readiness: zBuyerDeliveryReadinessResource,
|
|
3049
|
+
corrections: z.array(zFiscalDocumentRelationshipResource),
|
|
3050
|
+
created_at: z.iso.datetime(),
|
|
3051
|
+
diagnostics: z.array(zFiscalOperationDiagnosticResource).max(20),
|
|
3052
|
+
environment: zFiscalEnvironment,
|
|
3053
|
+
id: z.uuid(),
|
|
3054
|
+
latest_event: zFiscalOperationLatestEventResource.nullable(),
|
|
3055
|
+
outcome: zFiscalOperationOutcomeResource,
|
|
3056
|
+
printed_representation: zPrintedRepresentationResource,
|
|
3057
|
+
signed_document: zSignedDocumentReadinessResource,
|
|
3058
|
+
source: zFiscalOperationSource,
|
|
3059
|
+
totals: zFiscalOperationAmountsResource.nullable(),
|
|
3060
|
+
updated_at: z.iso.datetime(),
|
|
3061
|
+
});
|
|
3062
|
+
/**
|
|
3063
|
+
* Closed common-path Fiscal actions over one Source sales document.
|
|
3064
|
+
*/
|
|
3065
|
+
export const zSourceFiscalOperationPage = z.object({
|
|
3066
|
+
data: z.array(zFiscalOperationResource),
|
|
3067
|
+
hasMore: z.boolean(),
|
|
3068
|
+
nextCursor: z.string().nullable(),
|
|
3069
|
+
object: zCollectionObject,
|
|
3070
|
+
});
|
|
3071
|
+
/**
|
|
3072
|
+
* Government classification retained as caller-declared Source context.
|
|
3073
|
+
*/
|
|
3074
|
+
export const zSourceItemKind = z.enum(["good", "service"]);
|
|
3075
|
+
export const zInvoiceItemResource = z.object({
|
|
3076
|
+
additionalTaxCodes: z.array(z.string()),
|
|
3077
|
+
description: z.string(),
|
|
3078
|
+
id: z.string(),
|
|
3079
|
+
itemCodes: z.array(zInvoiceItemCodeResource),
|
|
3080
|
+
kind: zSourceItemKind,
|
|
3081
|
+
legalTip: z.boolean(),
|
|
3082
|
+
quantity: z.string().regex(/^(?=[0-9.]*[1-9])[0-9]{1,16}(\.[0-9]{1,2})?$/),
|
|
3083
|
+
tax: zInvoiceTax,
|
|
3084
|
+
unit: z.string(),
|
|
3085
|
+
unitPrice: z.string().regex(/^[0-9]{1,16}(\.[0-9]{1,4})?$/),
|
|
3086
|
+
withholding: zInvoiceItemWithholding.nullable(),
|
|
3087
|
+
});
|
|
3088
|
+
/**
|
|
3089
|
+
* Common semantic measurement units mapped to official DGII catalog codes by fiscal-document.
|
|
3090
|
+
*/
|
|
3091
|
+
export const zSourcePaymentMethod = z.enum([
|
|
3092
|
+
"cash",
|
|
3093
|
+
"bank_transfer",
|
|
3094
|
+
"card",
|
|
3095
|
+
"credit_sale",
|
|
3096
|
+
"gift_certificate",
|
|
3097
|
+
"barter",
|
|
3098
|
+
"credit_note",
|
|
3099
|
+
"other",
|
|
3100
|
+
]);
|
|
3101
|
+
export const zInvoicePaymentAllocation = z.object({
|
|
3102
|
+
amount: z.string().regex(/^(?=[0-9.]*[1-9])[0-9]{1,16}(\.[0-9]{1,2})?$/),
|
|
3103
|
+
method: zSourcePaymentMethod,
|
|
3104
|
+
});
|
|
3105
|
+
export const zInvoicePaymentTermsResource = lenientUnion([
|
|
3106
|
+
z.object({
|
|
3107
|
+
allocations: z.array(zInvoicePaymentAllocation).max(7),
|
|
3108
|
+
type: z.enum(["immediate"]),
|
|
3109
|
+
}),
|
|
3110
|
+
z.object({
|
|
3111
|
+
dueOn: z.iso.date().regex(/^(19|20)[0-9]{2}-[0-9]{2}-[0-9]{2}$/),
|
|
3112
|
+
type: z.enum(["credit"]),
|
|
3113
|
+
}),
|
|
3114
|
+
z.object({
|
|
3115
|
+
type: z.enum(["free"]),
|
|
3116
|
+
}),
|
|
3117
|
+
]);
|
|
3118
|
+
export const zInvoiceReceipt = z.object({
|
|
3119
|
+
acceptedAt: z.iso.datetime(),
|
|
3120
|
+
buyer: zInvoiceBuyerIdentity.nullable(),
|
|
3121
|
+
currency: zInvoiceReceiptCurrency,
|
|
3122
|
+
environment: zFiscalEnvironment,
|
|
3123
|
+
files: zInvoiceReceiptFiles,
|
|
3124
|
+
fiscalIdentity: zInvoiceFiscalIdentity,
|
|
3125
|
+
foreignCurrency: zInvoiceForeignCurrencyResource.nullable(),
|
|
3126
|
+
foreignPayment: zInvoiceForeignPaymentResource.nullable(),
|
|
3127
|
+
governmentEligibility: zInvoiceGovernmentEligibility.nullable(),
|
|
3128
|
+
id: z.uuid(),
|
|
3129
|
+
invoiceId: z.uuid(),
|
|
3130
|
+
issuerTaxId: z.string(),
|
|
3131
|
+
items: z.array(zInvoiceItemResource).nullable(),
|
|
3132
|
+
originalInvoiceId: z.uuid().nullable(),
|
|
3133
|
+
paymentTerms: zInvoicePaymentTermsResource.nullable(),
|
|
3134
|
+
replacesInvoiceId: z.uuid().nullable(),
|
|
3135
|
+
source: zInvoiceSource,
|
|
3136
|
+
status: zInvoiceReceiptStatus,
|
|
3137
|
+
supplier: zInvoiceSupplierResource.nullable(),
|
|
3138
|
+
totals: zInvoiceTotals,
|
|
3139
|
+
});
|
|
3140
|
+
export const zInvoiceResource = lenientUnion([
|
|
3141
|
+
z.object({
|
|
3142
|
+
acceptedAt: z.iso.datetime().nullable(),
|
|
3143
|
+
buyer: zInvoiceBuyerIdentity.nullable(),
|
|
3144
|
+
buyerDeliveryReadiness: zInvoiceBuyerDeliveryReadiness,
|
|
3145
|
+
corrections: z.array(zInvoiceCorrection),
|
|
3146
|
+
createdAt: z.iso.datetime(),
|
|
3147
|
+
currency: z.enum(["DOP"]),
|
|
3148
|
+
diagnostics: z.array(zInvoiceDiagnostic).max(20),
|
|
3149
|
+
environment: zFiscalEnvironment,
|
|
3150
|
+
files: zInvoiceFiles,
|
|
3151
|
+
foreignCurrency: zInvoiceForeignCurrencyResource.nullable(),
|
|
3152
|
+
foreignPayment: zInvoiceForeignPaymentResource.nullable(),
|
|
3153
|
+
governmentEligibility: zInvoiceGovernmentEligibility.nullable(),
|
|
3154
|
+
id: z.uuid(),
|
|
3155
|
+
invoiceReference: z.string(),
|
|
3156
|
+
issuerTaxId: z.string().regex(/^[0-9]{9}([0-9]{2})?$/),
|
|
3157
|
+
items: z.array(zInvoiceItemResource).nullable(),
|
|
3158
|
+
latestEvent: zInvoiceLatestEvent.nullable(),
|
|
3159
|
+
originalInvoiceId: z.uuid().nullable(),
|
|
3160
|
+
paymentTerms: zInvoicePaymentTermsResource.nullable(),
|
|
3161
|
+
replacesInvoiceId: z.uuid().nullable(),
|
|
3162
|
+
source: zInvoiceSource,
|
|
3163
|
+
status: z.enum(["rejected"]),
|
|
3164
|
+
supplier: zInvoiceSupplierResource.nullable(),
|
|
3165
|
+
totals: zInvoiceTotals.nullable(),
|
|
3166
|
+
type: zInvoiceType,
|
|
3167
|
+
updatedAt: z.iso.datetime(),
|
|
3168
|
+
}),
|
|
3169
|
+
z.object({
|
|
3170
|
+
acceptedAt: z.iso.datetime().nullable(),
|
|
3171
|
+
buyer: zInvoiceBuyerIdentity.nullable(),
|
|
3172
|
+
buyerDeliveryReadiness: zInvoiceBuyerDeliveryReadiness,
|
|
3173
|
+
corrections: z.array(zInvoiceCorrection),
|
|
3174
|
+
createdAt: z.iso.datetime(),
|
|
3175
|
+
currency: z.enum(["DOP"]),
|
|
3176
|
+
diagnostics: z.array(zInvoiceDiagnostic).max(20),
|
|
3177
|
+
environment: zFiscalEnvironment,
|
|
3178
|
+
files: zInvoiceFiles,
|
|
3179
|
+
fiscalIdentity: zInvoiceFiscalIdentity,
|
|
3180
|
+
foreignCurrency: zInvoiceForeignCurrencyResource.nullable(),
|
|
3181
|
+
foreignPayment: zInvoiceForeignPaymentResource.nullable(),
|
|
3182
|
+
governmentEligibility: zInvoiceGovernmentEligibility.nullable(),
|
|
3183
|
+
id: z.uuid(),
|
|
3184
|
+
invoiceReference: z.string(),
|
|
3185
|
+
issuerTaxId: z.string().regex(/^[0-9]{9}([0-9]{2})?$/),
|
|
3186
|
+
items: z.array(zInvoiceItemResource).nullable(),
|
|
3187
|
+
latestEvent: zInvoiceLatestEvent.nullable(),
|
|
3188
|
+
originalInvoiceId: z.uuid().nullable(),
|
|
3189
|
+
paymentTerms: zInvoicePaymentTermsResource.nullable(),
|
|
3190
|
+
replacesInvoiceId: z.uuid().nullable(),
|
|
3191
|
+
source: zInvoiceSource,
|
|
3192
|
+
stage: zInvoiceProcessingStage,
|
|
3193
|
+
status: z.enum(["processing"]),
|
|
3194
|
+
supplier: zInvoiceSupplierResource.nullable(),
|
|
3195
|
+
totals: zInvoiceTotals.nullable(),
|
|
3196
|
+
type: zInvoiceType,
|
|
3197
|
+
updatedAt: z.iso.datetime(),
|
|
3198
|
+
}),
|
|
3199
|
+
z.object({
|
|
3200
|
+
acceptedAt: z.iso.datetime().nullable(),
|
|
3201
|
+
buyer: zInvoiceBuyerIdentity.nullable(),
|
|
3202
|
+
buyerDeliveryReadiness: zInvoiceBuyerDeliveryReadiness,
|
|
3203
|
+
corrections: z.array(zInvoiceCorrection),
|
|
3204
|
+
createdAt: z.iso.datetime(),
|
|
3205
|
+
currency: z.enum(["DOP"]),
|
|
3206
|
+
diagnostics: z.array(zInvoiceDiagnostic).max(20),
|
|
3207
|
+
environment: zFiscalEnvironment,
|
|
3208
|
+
files: zInvoiceFiles,
|
|
3209
|
+
fiscalIdentity: zInvoiceFiscalIdentity,
|
|
3210
|
+
foreignCurrency: zInvoiceForeignCurrencyResource.nullable(),
|
|
3211
|
+
foreignPayment: zInvoiceForeignPaymentResource.nullable(),
|
|
3212
|
+
governmentEligibility: zInvoiceGovernmentEligibility.nullable(),
|
|
3213
|
+
id: z.uuid(),
|
|
3214
|
+
invoiceReference: z.string(),
|
|
3215
|
+
issuerTaxId: z.string().regex(/^[0-9]{9}([0-9]{2})?$/),
|
|
3216
|
+
items: z.array(zInvoiceItemResource).nullable(),
|
|
3217
|
+
latestEvent: zInvoiceLatestEvent.nullable(),
|
|
3218
|
+
originalInvoiceId: z.uuid().nullable(),
|
|
3219
|
+
paymentTerms: zInvoicePaymentTermsResource.nullable(),
|
|
3220
|
+
replacesInvoiceId: z.uuid().nullable(),
|
|
3221
|
+
source: zInvoiceSource,
|
|
3222
|
+
status: z.enum(["verifying"]),
|
|
3223
|
+
supplier: zInvoiceSupplierResource.nullable(),
|
|
3224
|
+
totals: zInvoiceTotals.nullable(),
|
|
3225
|
+
type: zInvoiceType,
|
|
3226
|
+
updatedAt: z.iso.datetime(),
|
|
3227
|
+
}),
|
|
3228
|
+
z.object({
|
|
3229
|
+
acceptedAt: z.iso.datetime().nullable(),
|
|
3230
|
+
buyer: zInvoiceBuyerIdentity.nullable(),
|
|
3231
|
+
buyerDeliveryReadiness: zInvoiceBuyerDeliveryReadiness,
|
|
3232
|
+
corrections: z.array(zInvoiceCorrection),
|
|
3233
|
+
createdAt: z.iso.datetime(),
|
|
3234
|
+
currency: z.enum(["DOP"]),
|
|
3235
|
+
diagnostics: z.array(zInvoiceDiagnostic).max(20),
|
|
3236
|
+
environment: zFiscalEnvironment,
|
|
3237
|
+
files: zInvoiceFiles,
|
|
3238
|
+
fiscalIdentity: zInvoiceFiscalIdentity,
|
|
3239
|
+
foreignCurrency: zInvoiceForeignCurrencyResource.nullable(),
|
|
3240
|
+
foreignPayment: zInvoiceForeignPaymentResource.nullable(),
|
|
3241
|
+
governmentEligibility: zInvoiceGovernmentEligibility.nullable(),
|
|
3242
|
+
id: z.uuid(),
|
|
3243
|
+
invoiceReference: z.string(),
|
|
3244
|
+
issuerTaxId: z.string().regex(/^[0-9]{9}([0-9]{2})?$/),
|
|
3245
|
+
items: z.array(zInvoiceItemResource).nullable(),
|
|
3246
|
+
latestEvent: zInvoiceLatestEvent.nullable(),
|
|
3247
|
+
originalInvoiceId: z.uuid().nullable(),
|
|
3248
|
+
paymentTerms: zInvoicePaymentTermsResource.nullable(),
|
|
3249
|
+
replacesInvoiceId: z.uuid().nullable(),
|
|
3250
|
+
source: zInvoiceSource,
|
|
3251
|
+
status: z.enum(["accepted"]),
|
|
3252
|
+
supplier: zInvoiceSupplierResource.nullable(),
|
|
3253
|
+
totals: zInvoiceTotals.nullable(),
|
|
3254
|
+
type: zInvoiceType,
|
|
3255
|
+
updatedAt: z.iso.datetime(),
|
|
3256
|
+
}),
|
|
3257
|
+
z.object({
|
|
3258
|
+
acceptedAt: z.iso.datetime().nullable(),
|
|
3259
|
+
buyer: zInvoiceBuyerIdentity.nullable(),
|
|
3260
|
+
buyerDeliveryReadiness: zInvoiceBuyerDeliveryReadiness,
|
|
3261
|
+
corrections: z.array(zInvoiceCorrection),
|
|
3262
|
+
createdAt: z.iso.datetime(),
|
|
3263
|
+
currency: z.enum(["DOP"]),
|
|
3264
|
+
diagnostics: z.array(zInvoiceDiagnostic).max(20),
|
|
3265
|
+
environment: zFiscalEnvironment,
|
|
3266
|
+
files: zInvoiceFiles,
|
|
3267
|
+
fiscalIdentity: zInvoiceFiscalIdentity,
|
|
3268
|
+
foreignCurrency: zInvoiceForeignCurrencyResource.nullable(),
|
|
3269
|
+
foreignPayment: zInvoiceForeignPaymentResource.nullable(),
|
|
3270
|
+
governmentEligibility: zInvoiceGovernmentEligibility.nullable(),
|
|
3271
|
+
id: z.uuid(),
|
|
3272
|
+
invoiceReference: z.string(),
|
|
3273
|
+
issuerTaxId: z.string().regex(/^[0-9]{9}([0-9]{2})?$/),
|
|
3274
|
+
items: z.array(zInvoiceItemResource).nullable(),
|
|
3275
|
+
latestEvent: zInvoiceLatestEvent.nullable(),
|
|
3276
|
+
originalInvoiceId: z.uuid().nullable(),
|
|
3277
|
+
paymentTerms: zInvoicePaymentTermsResource.nullable(),
|
|
3278
|
+
replacesInvoiceId: z.uuid().nullable(),
|
|
3279
|
+
source: zInvoiceSource,
|
|
3280
|
+
status: z.enum(["acceptedWithObservations"]),
|
|
3281
|
+
supplier: zInvoiceSupplierResource.nullable(),
|
|
3282
|
+
totals: zInvoiceTotals.nullable(),
|
|
3283
|
+
type: zInvoiceType,
|
|
3284
|
+
updatedAt: z.iso.datetime(),
|
|
3285
|
+
}),
|
|
3286
|
+
z.object({
|
|
3287
|
+
acceptedAt: z.iso.datetime().nullable(),
|
|
3288
|
+
buyer: zInvoiceBuyerIdentity.nullable(),
|
|
3289
|
+
buyerDeliveryReadiness: zInvoiceBuyerDeliveryReadiness,
|
|
3290
|
+
corrections: z.array(zInvoiceCorrection),
|
|
3291
|
+
createdAt: z.iso.datetime(),
|
|
3292
|
+
currency: z.enum(["DOP"]),
|
|
3293
|
+
diagnostics: z.array(zInvoiceDiagnostic).max(20),
|
|
3294
|
+
environment: zFiscalEnvironment,
|
|
3295
|
+
files: zInvoiceFiles,
|
|
3296
|
+
fiscalIdentity: zInvoiceFiscalIdentity,
|
|
3297
|
+
foreignCurrency: zInvoiceForeignCurrencyResource.nullable(),
|
|
3298
|
+
foreignPayment: zInvoiceForeignPaymentResource.nullable(),
|
|
3299
|
+
governmentEligibility: zInvoiceGovernmentEligibility.nullable(),
|
|
3300
|
+
id: z.uuid(),
|
|
3301
|
+
invoiceReference: z.string(),
|
|
3302
|
+
issuerTaxId: z.string().regex(/^[0-9]{9}([0-9]{2})?$/),
|
|
3303
|
+
items: z.array(zInvoiceItemResource).nullable(),
|
|
3304
|
+
latestEvent: zInvoiceLatestEvent.nullable(),
|
|
3305
|
+
originalInvoiceId: z.uuid().nullable(),
|
|
3306
|
+
paymentTerms: zInvoicePaymentTermsResource.nullable(),
|
|
3307
|
+
replacesInvoiceId: z.uuid().nullable(),
|
|
3308
|
+
source: zInvoiceSource,
|
|
3309
|
+
status: z.enum(["authorityRejected"]),
|
|
3310
|
+
supplier: zInvoiceSupplierResource.nullable(),
|
|
3311
|
+
totals: zInvoiceTotals.nullable(),
|
|
3312
|
+
type: zInvoiceType,
|
|
3313
|
+
updatedAt: z.iso.datetime(),
|
|
3314
|
+
}),
|
|
3315
|
+
z.object({
|
|
3316
|
+
acceptedAt: z.iso.datetime().nullable(),
|
|
3317
|
+
buyer: zInvoiceBuyerIdentity.nullable(),
|
|
3318
|
+
buyerDeliveryReadiness: zInvoiceBuyerDeliveryReadiness,
|
|
3319
|
+
corrections: z.array(zInvoiceCorrection),
|
|
3320
|
+
createdAt: z.iso.datetime(),
|
|
3321
|
+
currency: z.enum(["DOP"]),
|
|
3322
|
+
diagnostics: z.array(zInvoiceDiagnostic).max(20),
|
|
3323
|
+
environment: zFiscalEnvironment,
|
|
3324
|
+
files: zInvoiceFiles,
|
|
3325
|
+
fiscalIdentity: zInvoiceFiscalIdentity,
|
|
3326
|
+
foreignCurrency: zInvoiceForeignCurrencyResource.nullable(),
|
|
3327
|
+
foreignPayment: zInvoiceForeignPaymentResource.nullable(),
|
|
3328
|
+
governmentEligibility: zInvoiceGovernmentEligibility.nullable(),
|
|
3329
|
+
id: z.uuid(),
|
|
3330
|
+
invoiceReference: z.string(),
|
|
3331
|
+
issuerTaxId: z.string().regex(/^[0-9]{9}([0-9]{2})?$/),
|
|
3332
|
+
items: z.array(zInvoiceItemResource).nullable(),
|
|
3333
|
+
latestEvent: zInvoiceLatestEvent.nullable(),
|
|
3334
|
+
originalInvoiceId: z.uuid().nullable(),
|
|
3335
|
+
paymentTerms: zInvoicePaymentTermsResource.nullable(),
|
|
3336
|
+
replacesInvoiceId: z.uuid().nullable(),
|
|
3337
|
+
source: zInvoiceSource,
|
|
3338
|
+
status: z.enum(["operatorRequired"]),
|
|
3339
|
+
supplier: zInvoiceSupplierResource.nullable(),
|
|
3340
|
+
totals: zInvoiceTotals.nullable(),
|
|
3341
|
+
type: zInvoiceType,
|
|
3342
|
+
updatedAt: z.iso.datetime(),
|
|
3343
|
+
}),
|
|
3344
|
+
]);
|
|
3345
|
+
export const zInvoicePage = z.object({
|
|
3346
|
+
data: z.array(zInvoiceResource),
|
|
3347
|
+
hasMore: z.boolean(),
|
|
3348
|
+
nextCursor: z.string().nullable(),
|
|
3349
|
+
object: zCollectionObject,
|
|
3350
|
+
});
|
|
3351
|
+
/**
|
|
3352
|
+
* One exact decimal payment allocation declared by the Source system.
|
|
3353
|
+
*/
|
|
3354
|
+
export const zSourceProviderAccountKind = z.enum(["user", "team"]);
|
|
3355
|
+
export const zSourceProviderAccount = z.object({
|
|
3356
|
+
id: z
|
|
3357
|
+
.string()
|
|
3358
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
3359
|
+
.refine((text) => Array.from(text).length <= 256)
|
|
3360
|
+
.regex(/^[^\p{White_Space}](?:[\s\S]*[^\p{White_Space}])?$/u),
|
|
3361
|
+
kind: zSourceProviderAccountKind,
|
|
3362
|
+
});
|
|
3363
|
+
export const zSourceProviderAuthorizationActionReason = z.enum([
|
|
3364
|
+
"installation_disabled",
|
|
3365
|
+
"scope_insufficient",
|
|
3366
|
+
]);
|
|
3367
|
+
export const zSourceProviderAuthorizationRequiredReason = z.enum([
|
|
3368
|
+
"installation_removed",
|
|
3369
|
+
"credential_rejected",
|
|
3370
|
+
]);
|
|
3371
|
+
export const zSourceProviderAuthorizationLifecycle = lenientUnion([
|
|
3372
|
+
z.object({
|
|
3373
|
+
authorized_at: z.iso.datetime(),
|
|
3374
|
+
state: z.enum(["authorized"]),
|
|
3375
|
+
}),
|
|
3376
|
+
z.object({
|
|
3377
|
+
reason: zSourceProviderAuthorizationRequiredReason,
|
|
3378
|
+
state: z.enum(["authorization_required"]),
|
|
3379
|
+
}),
|
|
3380
|
+
z.object({
|
|
3381
|
+
reason: zSourceProviderAuthorizationActionReason,
|
|
3382
|
+
state: z.enum(["action_required"]),
|
|
3383
|
+
}),
|
|
3384
|
+
]);
|
|
3385
|
+
export const zSourceProviderAuthorization = z.object({
|
|
3386
|
+
created_at: z.iso.datetime(),
|
|
3387
|
+
id: z.uuid(),
|
|
3388
|
+
lifecycle: zSourceProviderAuthorizationLifecycle,
|
|
3389
|
+
provider: zSourceConnectionProvider,
|
|
3390
|
+
provider_account: zSourceProviderAccount,
|
|
3391
|
+
updated_at: z.iso.datetime(),
|
|
3392
|
+
});
|
|
3393
|
+
export const zSourceProviderAuthorizationPage = z.object({
|
|
3394
|
+
data: z.array(zSourceProviderAuthorization),
|
|
3395
|
+
hasMore: z.boolean(),
|
|
3396
|
+
nextCursor: z.string().nullable(),
|
|
3397
|
+
object: zCollectionObject,
|
|
3398
|
+
});
|
|
3399
|
+
export const zSourceProviderAuthorizationResource = z.object({
|
|
3400
|
+
source_provider_authorization: zSourceProviderAuthorization,
|
|
3401
|
+
});
|
|
3402
|
+
export const zSourceProviderTarget = z.object({
|
|
3403
|
+
id: z
|
|
3404
|
+
.string()
|
|
3405
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
3406
|
+
.refine((text) => Array.from(text).length <= 256)
|
|
3407
|
+
.regex(/^[^\p{White_Space}](?:[\s\S]*[^\p{White_Space}])?$/u),
|
|
3408
|
+
name: z
|
|
3409
|
+
.string()
|
|
3410
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
3411
|
+
.refine((text) => Array.from(text).length <= 128)
|
|
3412
|
+
.regex(/^[^\p{White_Space}](?:[\s\S]*[^\p{White_Space}])?$/u),
|
|
3413
|
+
});
|
|
3414
|
+
/**
|
|
3415
|
+
* How a stable `SourceConnection` obtained its current target identity.
|
|
3416
|
+
*/
|
|
3417
|
+
export const zSourceConnectionAdoption = lenientUnion([
|
|
3418
|
+
z.object({
|
|
3419
|
+
kind: z.enum(["hosted"]),
|
|
3420
|
+
}),
|
|
3421
|
+
z.object({
|
|
3422
|
+
kind: z.enum(["provider"]),
|
|
3423
|
+
production_origin: z.url().regex(/^https:\/\/(?:[^\s/?#@:[\]]+|\[[0-9A-Fa-f:.]+\])$/),
|
|
3424
|
+
provider: zSourceConnectionProvider,
|
|
3425
|
+
provider_account: zSourceProviderAccount,
|
|
3426
|
+
provider_target: zSourceProviderTarget,
|
|
3427
|
+
source_provider_authorization_id: z.uuid(),
|
|
3428
|
+
}),
|
|
3429
|
+
z.object({
|
|
3430
|
+
direct_connection_request_id: z.uuid(),
|
|
3431
|
+
kind: z.enum(["direct"]),
|
|
3432
|
+
}),
|
|
3433
|
+
]);
|
|
3434
|
+
export const zSourceConnection = z.object({
|
|
3435
|
+
adoption: zSourceConnectionAdoption,
|
|
3436
|
+
created_at: z.iso.datetime(),
|
|
3437
|
+
fiscal_environment: zFiscalEnvironment,
|
|
3438
|
+
id: z.uuid(),
|
|
3439
|
+
legal_issuer_id: z.uuid(),
|
|
3440
|
+
lifecycle: zSourceConnectionLifecycle,
|
|
3441
|
+
name: z
|
|
3442
|
+
.string()
|
|
3443
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
3444
|
+
.refine((text) => Array.from(text).length <= 150)
|
|
3445
|
+
.regex(/^[^\p{White_Space}](?:[\s\S]*[^\p{White_Space}])?$/u),
|
|
3446
|
+
updated_at: z.iso.datetime(),
|
|
3447
|
+
});
|
|
3448
|
+
export const zSourceConnectionPage = z.object({
|
|
3449
|
+
data: z.array(zSourceConnection),
|
|
3450
|
+
hasMore: z.boolean(),
|
|
3451
|
+
nextCursor: z.string().nullable(),
|
|
3452
|
+
object: zCollectionObject,
|
|
3453
|
+
});
|
|
3454
|
+
export const zSourceConnectionResource = z.object({
|
|
3455
|
+
source_connection: zSourceConnection,
|
|
3456
|
+
});
|
|
3457
|
+
/**
|
|
3458
|
+
* Payment terms with their valid due-date and allocation shapes closed in the wire type.
|
|
3459
|
+
*/
|
|
3460
|
+
export const zTimingAuthenticationReason = z.enum(["cached_process", "cached_row", "refreshed"]);
|
|
3461
|
+
export const zTimingAuthenticationTrigger = z.enum(["effect", "proactive"]);
|
|
3462
|
+
/**
|
|
3463
|
+
* `timbro.dgii.authenticate`: how the authorization was obtained, and the instants of each
|
|
3464
|
+
* exchange on the database clock.
|
|
3465
|
+
*/
|
|
3466
|
+
export const zTimingAuthenticationDetail = z.object({
|
|
3467
|
+
fiscal_request_started_at: z.iso.datetime().nullable(),
|
|
3468
|
+
reason: zTimingAuthenticationReason,
|
|
3469
|
+
seed_bound_at: z.iso.datetime().nullable(),
|
|
3470
|
+
seed_requested_at: z.iso.datetime().nullable(),
|
|
3471
|
+
seed_signed_at: z.iso.datetime().nullable(),
|
|
3472
|
+
session_expires_at: z.iso.datetime().nullable(),
|
|
3473
|
+
session_issued_at: z.iso.datetime().nullable(),
|
|
3474
|
+
trigger: zTimingAuthenticationTrigger,
|
|
3475
|
+
validated_at: z.iso.datetime().nullable(),
|
|
3476
|
+
validation_started_at: z.iso.datetime().nullable(),
|
|
3477
|
+
});
|
|
3478
|
+
export const zTimingAuthorizationKind = z.enum(["signed_seed", "cached_session"]);
|
|
3479
|
+
export const zTimingAuthorityAuthenticationAttempt = z.object({
|
|
3480
|
+
attempt_id: z.uuid(),
|
|
3481
|
+
authority_unauthorized_observed_at: z.iso.datetime().nullable(),
|
|
3482
|
+
authorization_kind: zTimingAuthorizationKind,
|
|
3483
|
+
bound_at: z.iso.datetime(),
|
|
3484
|
+
fiscal_authority_request_started_at: z.iso.datetime().nullable(),
|
|
3485
|
+
fiscal_effect_id: z.string().regex(/^[0-9a-f]{64}$/),
|
|
3486
|
+
fiscal_request_ordinal: z.int().gte(1).lte(2),
|
|
3487
|
+
seed_request_ms: z
|
|
3488
|
+
.int()
|
|
3489
|
+
.gte(0)
|
|
3490
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
3491
|
+
.nullable(),
|
|
3492
|
+
seed_signing_ms: z
|
|
3493
|
+
.int()
|
|
3494
|
+
.gte(0)
|
|
3495
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
3496
|
+
.nullable(),
|
|
3497
|
+
seed_validation_started_at: z.iso.datetime().nullable(),
|
|
3498
|
+
signed_seed_admission_ms: z
|
|
3499
|
+
.int()
|
|
3500
|
+
.gte(0)
|
|
3501
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
3502
|
+
.nullable(),
|
|
3503
|
+
signed_seed_pickup_ms: z
|
|
3504
|
+
.int()
|
|
3505
|
+
.gte(0)
|
|
3506
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
3507
|
+
.nullable(),
|
|
3508
|
+
signing_request_id: z
|
|
3509
|
+
.string()
|
|
3510
|
+
.regex(/^[0-9a-f]{64}$/)
|
|
3511
|
+
.nullable(),
|
|
3512
|
+
validation_to_request_ms: z
|
|
3513
|
+
.int()
|
|
3514
|
+
.gte(0)
|
|
3515
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
3516
|
+
.nullable(),
|
|
3517
|
+
work_id: z.string().regex(/^[0-9a-f]{64}$/),
|
|
3518
|
+
});
|
|
3519
|
+
export const zTimingClaimReleaseReason = z.enum(["settled", "handed_off", "released", "expired"]);
|
|
3520
|
+
/**
|
|
3521
|
+
* What made a work item claimable before the claim that picked it up.
|
|
3522
|
+
*/
|
|
3523
|
+
export const zTimingClaimableCause = z.enum([
|
|
3524
|
+
"due",
|
|
3525
|
+
"previous_claim_ended",
|
|
3526
|
+
"hand_off_lease_expired",
|
|
3527
|
+
]);
|
|
3528
|
+
export const zTimingClock = z.enum(["timbro_db", "monotonic"]);
|
|
3529
|
+
/**
|
|
3530
|
+
* How the platform activated a managed drain, each foreign instant on its own clock.
|
|
3531
|
+
*/
|
|
3532
|
+
export const zTimingDrainActivation = z.object({
|
|
3533
|
+
adapter_cold: z.boolean().nullable(),
|
|
3534
|
+
adapter_handed_off_at: z.iso.datetime().nullable(),
|
|
3535
|
+
adapter_instance_id: z.uuid().nullable(),
|
|
3536
|
+
group: z.string().nullable(),
|
|
3537
|
+
queue_delivery_count: z
|
|
3538
|
+
.int()
|
|
3539
|
+
.gte(0)
|
|
3540
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
3541
|
+
.nullable(),
|
|
3542
|
+
queue_message_created_at: z.iso.datetime().nullable(),
|
|
3543
|
+
source: z.string().nullable(),
|
|
3544
|
+
});
|
|
3545
|
+
/**
|
|
3546
|
+
* `timbro.inline_drain` and `timbro.activation_drain`: the run in `drain_runs`.
|
|
3547
|
+
*/
|
|
3548
|
+
export const zTimingDrainDetail = z.object({
|
|
3549
|
+
drain_run_id: z.uuid(),
|
|
3550
|
+
});
|
|
3551
|
+
export const zTimingDrainRunKind = z.enum(["inline", "activation"]);
|
|
3552
|
+
/**
|
|
3553
|
+
* One drain that made a claim on this operation's work, or the admission's inline drain.
|
|
3554
|
+
*/
|
|
3555
|
+
export const zTimingDrainRun = z.object({
|
|
3556
|
+
activation: zTimingDrainActivation.nullable(),
|
|
3557
|
+
bound_ms: z
|
|
3558
|
+
.int()
|
|
3559
|
+
.gte(0)
|
|
3560
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
3561
|
+
claim_count: z
|
|
3562
|
+
.int()
|
|
3563
|
+
.gte(0)
|
|
3564
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
3565
|
+
cold: z.boolean(),
|
|
3566
|
+
deployment_id: z.string(),
|
|
3567
|
+
drain_run_id: z.uuid(),
|
|
3568
|
+
kind: zTimingDrainRunKind,
|
|
3569
|
+
process_age_ms: z
|
|
3570
|
+
.int()
|
|
3571
|
+
.gte(0)
|
|
3572
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
3573
|
+
process_instance_id: z.uuid(),
|
|
3574
|
+
started_at: z.iso.datetime(),
|
|
3575
|
+
stop_reason: z.string().nullable(),
|
|
3576
|
+
stopped_at: z.iso.datetime().nullable(),
|
|
3577
|
+
});
|
|
3578
|
+
export const zTimingFiscalDeliveryAttempt = z.object({
|
|
3579
|
+
attempt_duration_ms: z
|
|
3580
|
+
.int()
|
|
3581
|
+
.gte(0)
|
|
3582
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
3583
|
+
.nullable(),
|
|
3584
|
+
attempt_id: z.uuid(),
|
|
3585
|
+
completed_at: z.iso.datetime().nullable(),
|
|
3586
|
+
fence_token: zLedgerCounter,
|
|
3587
|
+
fiscal_delivery_id: z.uuid(),
|
|
3588
|
+
result_code: z.string().nullable(),
|
|
3589
|
+
sequence: z
|
|
3590
|
+
.int()
|
|
3591
|
+
.gte(1)
|
|
3592
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
3593
|
+
started_at: z.iso.datetime(),
|
|
3594
|
+
});
|
|
3595
|
+
export const zTimingFiscalDeliveryProviderState = z.enum([
|
|
3596
|
+
"delivered",
|
|
3597
|
+
"bounced",
|
|
3598
|
+
"failed",
|
|
3599
|
+
"suppressed",
|
|
3600
|
+
]);
|
|
3601
|
+
export const zTimingFiscalDeliveryEvent = z.object({
|
|
3602
|
+
event_id: z.uuid(),
|
|
3603
|
+
fiscal_delivery_id: z.uuid(),
|
|
3604
|
+
provider_created_at: z.iso.datetime(),
|
|
3605
|
+
received_at: z.iso.datetime(),
|
|
3606
|
+
state: zTimingFiscalDeliveryProviderState,
|
|
3607
|
+
});
|
|
3608
|
+
export const zTimingFiscalDeliveryState = z.enum([
|
|
3609
|
+
"pending",
|
|
3610
|
+
"submitted",
|
|
3611
|
+
"delivered",
|
|
3612
|
+
"bounced",
|
|
3613
|
+
"failed",
|
|
3614
|
+
"suppressed",
|
|
3615
|
+
]);
|
|
3616
|
+
export const zTimingFiscalDelivery = z.object({
|
|
3617
|
+
attempt_count: z
|
|
3618
|
+
.int()
|
|
3619
|
+
.gte(0)
|
|
3620
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
3621
|
+
claim_expires_at: z.iso.datetime().nullable(),
|
|
3622
|
+
claimed_at: z.iso.datetime().nullable(),
|
|
3623
|
+
created_at: z.iso.datetime(),
|
|
3624
|
+
due_at: z.iso.datetime(),
|
|
3625
|
+
fence_token: zLedgerCounter,
|
|
3626
|
+
fiscal_delivery_id: z.uuid(),
|
|
3627
|
+
last_result_code: z.string().nullable(),
|
|
3628
|
+
provider_event_created_at: z.iso.datetime().nullable(),
|
|
3629
|
+
settled_at: z.iso.datetime().nullable(),
|
|
3630
|
+
state: zTimingFiscalDeliveryState,
|
|
3631
|
+
});
|
|
3632
|
+
export const zTimingLeaseWaitCause = z.enum([
|
|
3633
|
+
"refresh_lease",
|
|
3634
|
+
"process_flight",
|
|
3635
|
+
"process_capacity",
|
|
3636
|
+
"process_deadline",
|
|
3637
|
+
]);
|
|
3638
|
+
/**
|
|
3639
|
+
* `timbro.dgii.lease_wait`.
|
|
3640
|
+
*/
|
|
3641
|
+
export const zTimingLeaseWaitDetail = z.object({
|
|
3642
|
+
cause: zTimingLeaseWaitCause,
|
|
3643
|
+
lease_remaining_ms: z
|
|
3644
|
+
.int()
|
|
3645
|
+
.min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" })
|
|
3646
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
3647
|
+
.nullable(),
|
|
3648
|
+
retry_after_ms: z
|
|
3649
|
+
.int()
|
|
3650
|
+
.min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" })
|
|
3651
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
3652
|
+
work_claim_remaining_ms: z
|
|
3653
|
+
.int()
|
|
3654
|
+
.min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" })
|
|
3655
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
3656
|
+
});
|
|
3657
|
+
export const zTimingLifecycleEvent = z.object({
|
|
3658
|
+
decision_id: z.string().regex(/^[0-9a-f]{64}$/),
|
|
3659
|
+
event_id: z.string().regex(/^[0-9a-f]{64}$/),
|
|
3660
|
+
ordinal: z
|
|
3661
|
+
.int()
|
|
3662
|
+
.gte(1)
|
|
3663
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
3664
|
+
recorded_at: z.iso.datetime(),
|
|
3665
|
+
result_code: zFiscalLifecycleResultCode,
|
|
3666
|
+
});
|
|
3667
|
+
export const zTimingOperation = z.object({
|
|
3668
|
+
created_at: z.iso.datetime(),
|
|
3669
|
+
environment: zFiscalEnvironment,
|
|
3670
|
+
lifecycle_revision: z
|
|
3671
|
+
.int()
|
|
3672
|
+
.gte(0)
|
|
3673
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
3674
|
+
.nullable(),
|
|
3675
|
+
operation_id: z.uuid(),
|
|
3676
|
+
source_id: z.string(),
|
|
3677
|
+
source_version: z.string(),
|
|
3678
|
+
state: zFiscalOperationTransitionState,
|
|
3679
|
+
updated_at: z.iso.datetime(),
|
|
3680
|
+
});
|
|
3681
|
+
export const zTimingPrintedRepresentationState = z.enum([
|
|
3682
|
+
"pending",
|
|
3683
|
+
"claimed",
|
|
3684
|
+
"ready",
|
|
3685
|
+
"unavailable",
|
|
3686
|
+
]);
|
|
3687
|
+
export const zTimingPrintedRepresentationWork = z.object({
|
|
3688
|
+
attempt_count: z
|
|
3689
|
+
.int()
|
|
3690
|
+
.gte(0)
|
|
3691
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
3692
|
+
claim_expires_at: z.iso.datetime().nullable(),
|
|
3693
|
+
claimed_at: z.iso.datetime().nullable(),
|
|
3694
|
+
claimed_by: z.string().nullable(),
|
|
3695
|
+
created_at: z.iso.datetime(),
|
|
3696
|
+
due_at: z.iso.datetime(),
|
|
3697
|
+
fence_token: zLedgerCounter,
|
|
3698
|
+
pickup_ms: z
|
|
3699
|
+
.int()
|
|
3700
|
+
.gte(0)
|
|
3701
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
3702
|
+
.nullable(),
|
|
3703
|
+
scheduled_delay_ms: z
|
|
3704
|
+
.int()
|
|
3705
|
+
.gte(0)
|
|
3706
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
3707
|
+
.nullable(),
|
|
3708
|
+
state: zTimingPrintedRepresentationState,
|
|
3709
|
+
updated_at: z.iso.datetime(),
|
|
3710
|
+
work_id: z.uuid(),
|
|
3711
|
+
});
|
|
3712
|
+
export const zTimingRenderingEvidence = z.object({
|
|
3713
|
+
byte_length: z
|
|
3714
|
+
.int()
|
|
3715
|
+
.gte(0)
|
|
3716
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
3717
|
+
.nullable(),
|
|
3718
|
+
created_at: z.iso.datetime(),
|
|
3719
|
+
evidence_id: z.uuid(),
|
|
3720
|
+
fence_token: zLedgerCounter,
|
|
3721
|
+
outcome: zTimingPrintedRepresentationState,
|
|
3722
|
+
page_count: z
|
|
3723
|
+
.int()
|
|
3724
|
+
.gte(0)
|
|
3725
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
3726
|
+
.nullable(),
|
|
3727
|
+
render_duration_ms: z
|
|
3728
|
+
.int()
|
|
3729
|
+
.gte(0)
|
|
3730
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
3731
|
+
.nullable(),
|
|
3732
|
+
work_id: z.uuid(),
|
|
3733
|
+
});
|
|
3734
|
+
export const zTimingServedBy = z.object({
|
|
3735
|
+
database_identity: z.uuid().nullable(),
|
|
3736
|
+
deployment_id: z.string(),
|
|
3737
|
+
release_revision: z.string(),
|
|
3738
|
+
});
|
|
3739
|
+
/**
|
|
3740
|
+
* `timbro.signer.call`: the phases the hosted signer reported in `Server-Timing`.
|
|
3741
|
+
*/
|
|
3742
|
+
export const zTimingSignerCallDetail = z.object({
|
|
3743
|
+
init_ms: z.number().nullable(),
|
|
3744
|
+
sign_ms: z.number().nullable(),
|
|
3745
|
+
signer_cold: z.boolean().nullable(),
|
|
3746
|
+
signer_instance_id: z.uuid().nullable(),
|
|
3747
|
+
signing_attempt_id: z.uuid(),
|
|
3748
|
+
unwrap_ms: z.number().nullable(),
|
|
3749
|
+
});
|
|
3750
|
+
/**
|
|
3751
|
+
* `timbro.sign.<purpose>`: the signing request's instants on the database clock.
|
|
3752
|
+
*/
|
|
3753
|
+
export const zTimingSigningDetail = z.object({
|
|
3754
|
+
claimed_at: z.iso.datetime().nullable(),
|
|
3755
|
+
observed_at: z.iso.datetime().nullable(),
|
|
3756
|
+
requested_at: z.iso.datetime(),
|
|
3757
|
+
signer_call_ended_at: z.iso.datetime().nullable(),
|
|
3758
|
+
signer_call_started_at: z.iso.datetime().nullable(),
|
|
3759
|
+
signing_request_id: z.string().regex(/^[0-9a-f]{64}$/),
|
|
3760
|
+
});
|
|
3761
|
+
export const zTimingSigningObservationKind = z.enum(["signed", "refused"]);
|
|
3762
|
+
export const zTimingSigningAttempt = z.object({
|
|
3763
|
+
agent_observed_at: z.iso.datetime().nullable(),
|
|
3764
|
+
attempt_id: z.uuid(),
|
|
3765
|
+
claim_expires_at: z.iso.datetime(),
|
|
3766
|
+
claimed_at: z.iso.datetime(),
|
|
3767
|
+
fence_token: zLedgerCounter,
|
|
3768
|
+
observation_kind: zTimingSigningObservationKind.nullable(),
|
|
3769
|
+
observed_at: z.iso.datetime().nullable(),
|
|
3770
|
+
request_id: z.string().regex(/^[0-9a-f]{64}$/),
|
|
3771
|
+
sign_ms: z
|
|
3772
|
+
.int()
|
|
3773
|
+
.gte(0)
|
|
3774
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
3775
|
+
.nullable(),
|
|
3776
|
+
});
|
|
3777
|
+
export const zTimingSigningRequest = z.object({
|
|
3778
|
+
created_at: z.iso.datetime(),
|
|
3779
|
+
fiscal_effect_id: z.string().regex(/^[0-9a-f]{64}$/),
|
|
3780
|
+
fiscal_effect_kind: zExternalEffectKind,
|
|
3781
|
+
request_id: z.string().regex(/^[0-9a-f]{64}$/),
|
|
3782
|
+
work_id: z.string().regex(/^[0-9a-f]{64}$/),
|
|
3783
|
+
});
|
|
3784
|
+
export const zTimingSource = z.enum([
|
|
3785
|
+
"work",
|
|
3786
|
+
"effect_attempts",
|
|
3787
|
+
"signing_requests",
|
|
3788
|
+
"signing_attempts",
|
|
3789
|
+
"authority_authentication_attempts",
|
|
3790
|
+
"printed_representation_work",
|
|
3791
|
+
"rendering_evidence",
|
|
3792
|
+
"webhook_events",
|
|
3793
|
+
"webhook_deliveries",
|
|
3794
|
+
"webhook_delivery_attempts",
|
|
3795
|
+
"fiscal_deliveries",
|
|
3796
|
+
"fiscal_delivery_attempts",
|
|
3797
|
+
"fiscal_delivery_events",
|
|
3798
|
+
"transitions",
|
|
3799
|
+
"lifecycle_events",
|
|
3800
|
+
"stages",
|
|
3801
|
+
"work_claims",
|
|
3802
|
+
"drain_runs",
|
|
3803
|
+
"admission",
|
|
3804
|
+
"lease_waits",
|
|
3805
|
+
"vault_operations",
|
|
3806
|
+
"vault_retrievals",
|
|
3807
|
+
]);
|
|
3808
|
+
export const zTimingSourceCoverage = z.object({
|
|
3809
|
+
expired: z.boolean().optional(),
|
|
3810
|
+
rows: z
|
|
3811
|
+
.int()
|
|
3812
|
+
.gte(0)
|
|
3813
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
3814
|
+
source: zTimingSource,
|
|
3815
|
+
truncated: z.boolean(),
|
|
3816
|
+
});
|
|
3817
|
+
export const zTimingCoverage = z.object({
|
|
3818
|
+
row_bound: z
|
|
3819
|
+
.int()
|
|
3820
|
+
.gte(0)
|
|
3821
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
3822
|
+
sources: z.array(zTimingSourceCoverage),
|
|
3823
|
+
});
|
|
3824
|
+
/**
|
|
3825
|
+
* A named step of a Fiscal operation.
|
|
3826
|
+
*/
|
|
3827
|
+
export const zTimingStageId = z.enum([
|
|
3828
|
+
"timbro.admission_request",
|
|
3829
|
+
"timbro.admission.authenticate",
|
|
3830
|
+
"timbro.admission.prepare",
|
|
3831
|
+
"timbro.admission.evaluate",
|
|
3832
|
+
"timbro.admission.commit",
|
|
3833
|
+
"timbro.inline_drain",
|
|
3834
|
+
"timbro.activation_drain",
|
|
3835
|
+
"timbro.work.claim",
|
|
3836
|
+
"timbro.work.pickup",
|
|
3837
|
+
"timbro.sign.complete_document",
|
|
3838
|
+
"timbro.sign.consumer_summary",
|
|
3839
|
+
"timbro.sign.dgii_authentication_seed",
|
|
3840
|
+
"timbro.signer.call",
|
|
3841
|
+
"timbro.dgii.authenticate",
|
|
3842
|
+
"timbro.dgii.seed_request",
|
|
3843
|
+
"timbro.dgii.seed_validate",
|
|
3844
|
+
"timbro.dgii.lease_wait",
|
|
3845
|
+
"timbro.dgii.submit.complete_ecf",
|
|
3846
|
+
"timbro.dgii.submit.consumer_summary",
|
|
3847
|
+
"timbro.dgii.inquiry.track_id",
|
|
3848
|
+
"timbro.dgii.inquiry.fiscal_identity",
|
|
3849
|
+
"timbro.dgii.inquiry.consumer_summary",
|
|
3850
|
+
"timbro.vault.put.signed_complete_document",
|
|
3851
|
+
"timbro.vault.put.signed_consumer_summary",
|
|
3852
|
+
"timbro.vault.put.printed_representation",
|
|
3853
|
+
"timbro.vault.verify.signed_complete_document",
|
|
3854
|
+
"timbro.vault.verify.signed_consumer_summary",
|
|
3855
|
+
"timbro.vault.verify.printed_representation",
|
|
3856
|
+
"timbro.vault.get.signed_complete_document",
|
|
3857
|
+
"timbro.vault.get.signed_consumer_summary",
|
|
3858
|
+
"timbro.vault.get.printed_representation",
|
|
3859
|
+
"timbro.render.printed_representation",
|
|
3860
|
+
"timbro.operation_terminal",
|
|
3861
|
+
"timbro.webhook.fiscal_document.artifacts_updated",
|
|
3862
|
+
"timbro.webhook.fiscal_document.ready",
|
|
3863
|
+
"timbro.webhook.rejected",
|
|
3864
|
+
"timbro.webhook.processing",
|
|
3865
|
+
"timbro.webhook.submission_outcome_unknown",
|
|
3866
|
+
"timbro.webhook.authority_accepted",
|
|
3867
|
+
"timbro.webhook.authority_accepted_with_findings",
|
|
3868
|
+
"timbro.webhook.authority_rejected",
|
|
3869
|
+
"timbro.webhook.intervention_required",
|
|
3870
|
+
"timbro.webhook.commercially_accepted",
|
|
3871
|
+
"timbro.webhook.commercially_rejected",
|
|
3872
|
+
]);
|
|
3873
|
+
/**
|
|
3874
|
+
* `timbro.operation_terminal`.
|
|
3875
|
+
*/
|
|
3876
|
+
export const zTimingTerminalDetail = z.object({
|
|
3877
|
+
state: zFiscalOperationTransitionState,
|
|
3878
|
+
});
|
|
3879
|
+
export const zTimingTransition = z.object({
|
|
3880
|
+
attempt_sequence: z
|
|
3881
|
+
.int()
|
|
3882
|
+
.gte(1)
|
|
3883
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
3884
|
+
.nullable(),
|
|
3885
|
+
from_state: zFiscalOperationTransitionState.nullable(),
|
|
3886
|
+
occurred_at: z.iso.datetime(),
|
|
3887
|
+
result_code: zFiscalLifecycleResultCode,
|
|
3888
|
+
sequence: z
|
|
3889
|
+
.int()
|
|
3890
|
+
.gte(1)
|
|
3891
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
3892
|
+
to_state: zFiscalOperationTransitionState,
|
|
3893
|
+
transition_id: z.uuid(),
|
|
3894
|
+
});
|
|
3895
|
+
export const zTimingUnavailableFailure = z.enum([
|
|
3896
|
+
"timeout",
|
|
3897
|
+
"network",
|
|
3898
|
+
"interrupted_after_invocation_started",
|
|
3899
|
+
]);
|
|
3900
|
+
export const zTimingEffectOutcome = lenientUnion([
|
|
3901
|
+
z.object({
|
|
3902
|
+
authority_code: z
|
|
3903
|
+
.int()
|
|
3904
|
+
.min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" })
|
|
3905
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
3906
|
+
.nullable(),
|
|
3907
|
+
authority_status: z.string().nullable(),
|
|
3908
|
+
http_status: z
|
|
3909
|
+
.int()
|
|
3910
|
+
.gte(0)
|
|
3911
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
3912
|
+
outcome: z.enum(["authority_response"]),
|
|
3913
|
+
retry_after_ms: z
|
|
3914
|
+
.int()
|
|
3915
|
+
.gte(0)
|
|
3916
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
3917
|
+
.nullable(),
|
|
3918
|
+
}),
|
|
3919
|
+
z.object({
|
|
3920
|
+
outcome: z.enum(["authority_authentication_failed"]),
|
|
3921
|
+
}),
|
|
3922
|
+
z.object({
|
|
3923
|
+
failure: zTimingUnavailableFailure,
|
|
3924
|
+
outcome: z.enum(["authority_unavailable"]),
|
|
3925
|
+
}),
|
|
3926
|
+
z.object({
|
|
3927
|
+
outcome: z.enum(["signed"]),
|
|
3928
|
+
}),
|
|
3929
|
+
z.object({
|
|
3930
|
+
outcome: z.enum(["signing_failed"]),
|
|
3931
|
+
}),
|
|
3932
|
+
z.object({
|
|
3933
|
+
failure: zTimingUnavailableFailure,
|
|
3934
|
+
outcome: z.enum(["signing_unavailable"]),
|
|
3935
|
+
}),
|
|
3936
|
+
z.object({
|
|
3937
|
+
outcome: z.enum(["signing_replay_horizon_expired"]),
|
|
3938
|
+
}),
|
|
3939
|
+
]);
|
|
3940
|
+
export const zTimingEffectAttempt = z.object({
|
|
3941
|
+
attempt_id: z.uuid(),
|
|
3942
|
+
attempt_ms: z
|
|
3943
|
+
.int()
|
|
3944
|
+
.gte(0)
|
|
3945
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
3946
|
+
.nullable(),
|
|
3947
|
+
authority_request_started_at: z.iso.datetime().nullable(),
|
|
3948
|
+
authority_track_id: z.string().nullable(),
|
|
3949
|
+
effect_id: z.string().regex(/^[0-9a-f]{64}$/),
|
|
3950
|
+
effect_kind: zExternalEffectKind,
|
|
3951
|
+
fence_token: zLedgerCounter,
|
|
3952
|
+
observation: zTimingEffectOutcome.nullable(),
|
|
3953
|
+
observed_at: z.iso.datetime().nullable(),
|
|
3954
|
+
sequence: z
|
|
3955
|
+
.int()
|
|
3956
|
+
.gte(1)
|
|
3957
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
3958
|
+
started_at: z.iso.datetime(),
|
|
3959
|
+
work_id: z.string().regex(/^[0-9a-f]{64}$/),
|
|
3960
|
+
});
|
|
3961
|
+
/**
|
|
3962
|
+
* `timbro.vault.<action>.<artifact>`.
|
|
3963
|
+
*/
|
|
3964
|
+
export const zTimingVaultOperationDetail = z.object({
|
|
3965
|
+
result_code: z.string(),
|
|
3966
|
+
});
|
|
3967
|
+
export const zTimingWebhookDeliveryOutcome = z.enum([
|
|
3968
|
+
"in_flight",
|
|
3969
|
+
"delivered",
|
|
3970
|
+
"failed",
|
|
3971
|
+
"outcome_unknown",
|
|
3972
|
+
]);
|
|
3973
|
+
export const zTimingWebhookDeliveryAttempt = z.object({
|
|
3974
|
+
attempt_id: z.uuid(),
|
|
3975
|
+
attempt_ms: z
|
|
3976
|
+
.int()
|
|
3977
|
+
.gte(0)
|
|
3978
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
3979
|
+
.nullable(),
|
|
3980
|
+
completed_at: z.iso.datetime().nullable(),
|
|
3981
|
+
fence_token: zLedgerCounter,
|
|
3982
|
+
http_status: z
|
|
3983
|
+
.int()
|
|
3984
|
+
.gte(0)
|
|
3985
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
3986
|
+
.nullable(),
|
|
3987
|
+
outcome: zTimingWebhookDeliveryOutcome,
|
|
3988
|
+
sequence: z
|
|
3989
|
+
.int()
|
|
3990
|
+
.gte(1)
|
|
3991
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
3992
|
+
started_at: z.iso.datetime(),
|
|
3993
|
+
webhook_delivery_id: z.uuid(),
|
|
3994
|
+
});
|
|
3995
|
+
export const zTimingWebhookEventType = z.enum([
|
|
3996
|
+
"invoice.accepted",
|
|
3997
|
+
"invoice.rejected",
|
|
3998
|
+
"invoice.operatorRequired",
|
|
3999
|
+
"invoice.ready",
|
|
4000
|
+
"fiscal_document.artifacts_updated",
|
|
4001
|
+
"fiscal_document.ready",
|
|
4002
|
+
"fiscal_operation.rejected",
|
|
4003
|
+
"fiscal_operation.processing",
|
|
4004
|
+
"fiscal_operation.submission_outcome_unknown",
|
|
4005
|
+
"fiscal_operation.authority_accepted",
|
|
4006
|
+
"fiscal_operation.authority_accepted_with_findings",
|
|
4007
|
+
"fiscal_operation.authority_rejected",
|
|
4008
|
+
"fiscal_operation.intervention_required",
|
|
4009
|
+
"fiscal_operation.commercially_accepted",
|
|
4010
|
+
"fiscal_operation.commercially_rejected",
|
|
4011
|
+
]);
|
|
4012
|
+
export const zTimingWebhookEvent = z.object({
|
|
4013
|
+
event_id: z.uuid(),
|
|
4014
|
+
event_type: zTimingWebhookEventType,
|
|
4015
|
+
occurred_at: z.iso.datetime(),
|
|
4016
|
+
sequence: zLedgerCounter,
|
|
4017
|
+
});
|
|
4018
|
+
export const zTimingWorkKind = z.enum(["fiscal_lifecycle", "printed_representation"]);
|
|
4019
|
+
/**
|
|
4020
|
+
* `timbro.work.claim`.
|
|
4021
|
+
*/
|
|
4022
|
+
export const zTimingClaimDetail = z.object({
|
|
4023
|
+
claimed_by: z.string(),
|
|
4024
|
+
drain_run_id: z.uuid().nullable(),
|
|
4025
|
+
release_reason: zTimingClaimReleaseReason.nullable(),
|
|
4026
|
+
work_kind: zTimingWorkKind,
|
|
4027
|
+
});
|
|
4028
|
+
/**
|
|
4029
|
+
* `timbro.work.pickup`.
|
|
4030
|
+
*/
|
|
4031
|
+
export const zTimingPickupDetail = z.object({
|
|
4032
|
+
claimable_after: zTimingClaimableCause,
|
|
4033
|
+
work_kind: zTimingWorkKind,
|
|
4034
|
+
});
|
|
4035
|
+
/**
|
|
4036
|
+
* Facts that belong to one stage family.
|
|
4037
|
+
*/
|
|
4038
|
+
export const zTimingStageDetail = lenientUnion([
|
|
4039
|
+
zTimingDrainDetail,
|
|
4040
|
+
zTimingClaimDetail,
|
|
4041
|
+
zTimingPickupDetail,
|
|
4042
|
+
zTimingSigningDetail,
|
|
4043
|
+
zTimingSignerCallDetail,
|
|
4044
|
+
zTimingAuthenticationDetail,
|
|
4045
|
+
zTimingLeaseWaitDetail,
|
|
4046
|
+
zTimingVaultOperationDetail,
|
|
4047
|
+
zTimingTerminalDetail,
|
|
4048
|
+
]);
|
|
4049
|
+
export const zTimingStage = z.object({
|
|
4050
|
+
bound_ms: z
|
|
4051
|
+
.int()
|
|
4052
|
+
.gte(0)
|
|
4053
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
4054
|
+
clock: zTimingClock,
|
|
4055
|
+
detail: zTimingStageDetail.nullable(),
|
|
4056
|
+
duration_ms: z
|
|
4057
|
+
.int()
|
|
4058
|
+
.gte(0)
|
|
4059
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
4060
|
+
.nullable(),
|
|
4061
|
+
ended_at: z.iso.datetime().nullable(),
|
|
4062
|
+
exclusive_ms: z
|
|
4063
|
+
.int()
|
|
4064
|
+
.gte(0)
|
|
4065
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
4066
|
+
.nullable(),
|
|
4067
|
+
fence_token: zLedgerCounter.nullable(),
|
|
4068
|
+
occurrence_id: z.uuid(),
|
|
4069
|
+
parallel: z.boolean(),
|
|
4070
|
+
parent_occurrence_id: z.uuid().nullable(),
|
|
4071
|
+
stage: zTimingStageId,
|
|
4072
|
+
started_at: z.iso.datetime(),
|
|
4073
|
+
step_id: z.uuid(),
|
|
4074
|
+
work_id: z.string().nullable(),
|
|
4075
|
+
});
|
|
4076
|
+
/**
|
|
4077
|
+
* One executing claim of this operation's work, written by the claiming transaction.
|
|
4078
|
+
*/
|
|
4079
|
+
export const zTimingWorkClaim = z.object({
|
|
4080
|
+
claim_expires_at: z.iso.datetime(),
|
|
4081
|
+
claimed_at: z.iso.datetime(),
|
|
4082
|
+
claimed_by: z.string(),
|
|
4083
|
+
drain_run_id: z.uuid().nullable(),
|
|
4084
|
+
fence_token: zLedgerCounter,
|
|
4085
|
+
release_reason: zTimingClaimReleaseReason.nullable(),
|
|
4086
|
+
released_at: z.iso.datetime().nullable(),
|
|
4087
|
+
work_id: z.string(),
|
|
4088
|
+
work_kind: zTimingWorkKind,
|
|
4089
|
+
});
|
|
4090
|
+
export const zTimingWorkState = z.enum(["pending", "claimed", "settled"]);
|
|
4091
|
+
export const zTimingWork = z.object({
|
|
4092
|
+
claim_expires_at: z.iso.datetime().nullable(),
|
|
4093
|
+
claimed_at: z.iso.datetime().nullable(),
|
|
4094
|
+
claimed_by: z.string().nullable(),
|
|
4095
|
+
created_at: z.iso.datetime(),
|
|
4096
|
+
due_at: z.iso.datetime(),
|
|
4097
|
+
due_to_settlement_ms: z
|
|
4098
|
+
.int()
|
|
4099
|
+
.gte(0)
|
|
4100
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
4101
|
+
.nullable(),
|
|
4102
|
+
effect_id: z
|
|
4103
|
+
.string()
|
|
4104
|
+
.regex(/^[0-9a-f]{64}$/)
|
|
4105
|
+
.nullable(),
|
|
4106
|
+
expected_revision: z
|
|
4107
|
+
.int()
|
|
4108
|
+
.gte(0)
|
|
4109
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
4110
|
+
fence_token: zLedgerCounter,
|
|
4111
|
+
pickup_ms: z
|
|
4112
|
+
.int()
|
|
4113
|
+
.gte(0)
|
|
4114
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
4115
|
+
.nullable(),
|
|
4116
|
+
producer_traceparent: z
|
|
4117
|
+
.string()
|
|
4118
|
+
.regex(/^00-[0-9a-f]{32}-[0-9a-f]{16}-0[01]$/)
|
|
4119
|
+
.nullable(),
|
|
4120
|
+
scheduled_delay_ms: z
|
|
4121
|
+
.int()
|
|
4122
|
+
.gte(0)
|
|
4123
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
4124
|
+
.nullable(),
|
|
4125
|
+
settled_at: z.iso.datetime().nullable(),
|
|
4126
|
+
state: zTimingWorkState,
|
|
4127
|
+
work_id: z.string().regex(/^[0-9a-f]{64}$/),
|
|
4128
|
+
});
|
|
4129
|
+
/**
|
|
4130
|
+
* Factura de Crédito Fiscal Electrónica, code 31.
|
|
4131
|
+
*/
|
|
4132
|
+
export const zUserAccountIdentity = z.object({
|
|
4133
|
+
created_at: z.iso.datetime(),
|
|
4134
|
+
display_name: z
|
|
4135
|
+
.string()
|
|
4136
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
4137
|
+
.refine((text) => Array.from(text).length <= 150)
|
|
4138
|
+
.regex(/^(?=.*[^\p{White_Space}])[\s\S]+$/u),
|
|
4139
|
+
email: zIdentityEmailSchema,
|
|
4140
|
+
id: z.uuid(),
|
|
4141
|
+
});
|
|
4142
|
+
export const zUserAccountResource = z.object({
|
|
4143
|
+
memberships: z.array(zMembershipResource),
|
|
4144
|
+
user_account: zUserAccountIdentity,
|
|
4145
|
+
});
|
|
4146
|
+
export const zVercelInstallationCompletionResource = z.object({
|
|
4147
|
+
organization_id: z.uuid(),
|
|
4148
|
+
source_provider_authorization: zSourceProviderAuthorization,
|
|
4149
|
+
});
|
|
4150
|
+
export const zVercelInstallationRequest = z.object({
|
|
4151
|
+
authorization_url: z.url(),
|
|
4152
|
+
expires_at: z.iso.datetime(),
|
|
4153
|
+
id: z.uuid(),
|
|
4154
|
+
});
|
|
4155
|
+
export const zVercelInstallationRequestResource = z.object({
|
|
4156
|
+
installation_request: zVercelInstallationRequest,
|
|
4157
|
+
});
|
|
4158
|
+
export const zVercelProject = z.object({
|
|
4159
|
+
id: z
|
|
4160
|
+
.string()
|
|
4161
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
4162
|
+
.refine((text) => Array.from(text).length <= 256)
|
|
4163
|
+
.regex(/^[^\p{White_Space}](?:[\s\S]*[^\p{White_Space}])?$/u),
|
|
4164
|
+
name: z
|
|
4165
|
+
.string()
|
|
4166
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
4167
|
+
.refine((text) => Array.from(text).length <= 128)
|
|
4168
|
+
.regex(/^[^\p{White_Space}](?:[\s\S]*[^\p{White_Space}])?$/u),
|
|
4169
|
+
});
|
|
4170
|
+
export const zAuthorizedVercelProjectPage = z.object({
|
|
4171
|
+
data: z.array(zVercelProject),
|
|
4172
|
+
hasMore: z.boolean(),
|
|
4173
|
+
nextCursor: z.string().nullable(),
|
|
4174
|
+
object: zCollectionObject,
|
|
4175
|
+
});
|
|
4176
|
+
export const zVercelProjectQualification = z.object({
|
|
4177
|
+
id: z
|
|
4178
|
+
.string()
|
|
4179
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
4180
|
+
.refine((text) => Array.from(text).length <= 256)
|
|
4181
|
+
.regex(/^[^\p{White_Space}](?:[\s\S]*[^\p{White_Space}])?$/u),
|
|
4182
|
+
name: z
|
|
4183
|
+
.string()
|
|
4184
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
4185
|
+
.refine((text) => Array.from(text).length <= 128)
|
|
4186
|
+
.regex(/^[^\p{White_Space}](?:[\s\S]*[^\p{White_Space}])?$/u),
|
|
4187
|
+
qualified_production_origins: z.array(zQualifiedProductionOrigin),
|
|
4188
|
+
});
|
|
4189
|
+
export const zVercelProjectQualificationResource = z.object({
|
|
4190
|
+
project: zVercelProjectQualification,
|
|
4191
|
+
});
|
|
4192
|
+
export const zVerificationStatus = z.enum(["verified", "unverified"]);
|
|
4193
|
+
export const zOnboardingRequirement = z.object({
|
|
4194
|
+
blocked_by: z.array(zRequirementId),
|
|
4195
|
+
fiscal_operation_id: z.uuid().nullable(),
|
|
4196
|
+
id: zRequirementId,
|
|
4197
|
+
remediation: z.array(z.string()),
|
|
4198
|
+
status: zRequirementStatus,
|
|
4199
|
+
verification: zVerificationStatus.nullable(),
|
|
4200
|
+
});
|
|
4201
|
+
export const zOnboardingReadiness = z.object({
|
|
4202
|
+
complete: z.boolean(),
|
|
4203
|
+
environment: zFiscalEnvironmentName,
|
|
4204
|
+
requirements: z.array(zOnboardingRequirement),
|
|
4205
|
+
});
|
|
4206
|
+
export const zWebhookDeliveryFailureResultCode = z.enum([
|
|
4207
|
+
"delivery_timed_out",
|
|
4208
|
+
"destination_resolution_failed",
|
|
4209
|
+
"receiver_connection_failed",
|
|
4210
|
+
"receiver_redirected",
|
|
4211
|
+
"receiver_rejected",
|
|
4212
|
+
"receiver_unavailable",
|
|
4213
|
+
"endpoint_suspended",
|
|
4214
|
+
"endpoint_deleted",
|
|
4215
|
+
"attempt_budget_exhausted",
|
|
4216
|
+
"delivery_deadline_exceeded",
|
|
4217
|
+
]);
|
|
4218
|
+
export const zWebhookDeliveryAttempt = lenientUnion([
|
|
4219
|
+
z.object({
|
|
4220
|
+
fence_token: zLedgerCounter,
|
|
4221
|
+
outcome: z.enum(["in_flight"]),
|
|
4222
|
+
sequence: z
|
|
4223
|
+
.int()
|
|
4224
|
+
.gte(1)
|
|
4225
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
4226
|
+
started_at: z.iso.datetime(),
|
|
4227
|
+
}),
|
|
4228
|
+
z.object({
|
|
4229
|
+
completed_at: z.iso.datetime(),
|
|
4230
|
+
fence_token: zLedgerCounter,
|
|
4231
|
+
http_status: z
|
|
4232
|
+
.int()
|
|
4233
|
+
.gte(0)
|
|
4234
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
4235
|
+
outcome: z.enum(["delivered"]),
|
|
4236
|
+
sequence: z
|
|
4237
|
+
.int()
|
|
4238
|
+
.gte(1)
|
|
4239
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
4240
|
+
started_at: z.iso.datetime(),
|
|
4241
|
+
}),
|
|
4242
|
+
z.object({
|
|
4243
|
+
completed_at: z.iso.datetime(),
|
|
4244
|
+
fence_token: zLedgerCounter,
|
|
4245
|
+
http_status: z
|
|
4246
|
+
.int()
|
|
4247
|
+
.gte(0)
|
|
4248
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
4249
|
+
.nullable(),
|
|
4250
|
+
outcome: z.enum(["failed"]),
|
|
4251
|
+
result_code: zWebhookDeliveryFailureResultCode,
|
|
4252
|
+
sequence: z
|
|
4253
|
+
.int()
|
|
4254
|
+
.gte(1)
|
|
4255
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
4256
|
+
started_at: z.iso.datetime(),
|
|
4257
|
+
}),
|
|
4258
|
+
z.object({
|
|
4259
|
+
completed_at: z.iso.datetime(),
|
|
4260
|
+
fence_token: zLedgerCounter,
|
|
4261
|
+
outcome: z.enum(["outcome_unknown"]),
|
|
4262
|
+
sequence: z
|
|
4263
|
+
.int()
|
|
4264
|
+
.gte(1)
|
|
4265
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
4266
|
+
started_at: z.iso.datetime(),
|
|
4267
|
+
}),
|
|
4268
|
+
]);
|
|
4269
|
+
export const zWebhookDeliveryResultCode = z.enum([
|
|
4270
|
+
"delivered",
|
|
4271
|
+
"delivery_timed_out",
|
|
4272
|
+
"destination_resolution_failed",
|
|
4273
|
+
"receiver_connection_failed",
|
|
4274
|
+
"receiver_redirected",
|
|
4275
|
+
"receiver_rejected",
|
|
4276
|
+
"receiver_unavailable",
|
|
4277
|
+
"delivery_outcome_unknown",
|
|
4278
|
+
"endpoint_suspended",
|
|
4279
|
+
"endpoint_deleted",
|
|
4280
|
+
"attempt_budget_exhausted",
|
|
4281
|
+
"delivery_deadline_exceeded",
|
|
4282
|
+
]);
|
|
4283
|
+
export const zWebhookDeliveryState = z.enum(["pending", "in_flight", "delivered", "dead_lettered"]);
|
|
4284
|
+
export const zTimingWebhookDelivery = z.object({
|
|
4285
|
+
attempt_count: z
|
|
4286
|
+
.int()
|
|
4287
|
+
.gte(0)
|
|
4288
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
4289
|
+
claim_expires_at: z.iso.datetime().nullable(),
|
|
4290
|
+
delivery_id: z.uuid(),
|
|
4291
|
+
fence_token: zLedgerCounter,
|
|
4292
|
+
last_http_status: z
|
|
4293
|
+
.int()
|
|
4294
|
+
.gte(0)
|
|
4295
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
4296
|
+
.nullable(),
|
|
4297
|
+
last_result_code: zWebhookDeliveryResultCode.nullable(),
|
|
4298
|
+
next_attempt_at: z.iso.datetime(),
|
|
4299
|
+
occurred_at: z.iso.datetime(),
|
|
4300
|
+
producer_traceparent: z
|
|
4301
|
+
.string()
|
|
4302
|
+
.regex(/^00-[0-9a-f]{32}-[0-9a-f]{16}-0[01]$/)
|
|
4303
|
+
.nullable(),
|
|
4304
|
+
queued_to_settlement_ms: z
|
|
4305
|
+
.int()
|
|
4306
|
+
.gte(0)
|
|
4307
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
4308
|
+
.nullable(),
|
|
4309
|
+
settled_at: z.iso.datetime().nullable(),
|
|
4310
|
+
state: zWebhookDeliveryState,
|
|
4311
|
+
webhook_endpoint_id: z.uuid(),
|
|
4312
|
+
webhook_event_id: z.uuid(),
|
|
4313
|
+
});
|
|
4314
|
+
export const zFiscalOperationTimingReport = z.object({
|
|
4315
|
+
authority_authentication_attempts: z.array(zTimingAuthorityAuthenticationAttempt),
|
|
4316
|
+
coverage: zTimingCoverage,
|
|
4317
|
+
drain_runs: z.array(zTimingDrainRun).optional(),
|
|
4318
|
+
effect_attempts: z.array(zTimingEffectAttempt),
|
|
4319
|
+
fiscal_deliveries: z.array(zTimingFiscalDelivery),
|
|
4320
|
+
fiscal_delivery_attempts: z.array(zTimingFiscalDeliveryAttempt),
|
|
4321
|
+
fiscal_delivery_events: z.array(zTimingFiscalDeliveryEvent),
|
|
4322
|
+
lifecycle_events: z.array(zTimingLifecycleEvent),
|
|
4323
|
+
operation: zTimingOperation,
|
|
4324
|
+
printed_representation_work: z.array(zTimingPrintedRepresentationWork),
|
|
4325
|
+
read_at: z.iso.datetime().optional(),
|
|
4326
|
+
rendering_evidence: z.array(zTimingRenderingEvidence),
|
|
4327
|
+
served_by: zTimingServedBy,
|
|
4328
|
+
signing_attempts: z.array(zTimingSigningAttempt),
|
|
4329
|
+
signing_requests: z.array(zTimingSigningRequest),
|
|
4330
|
+
stages: z.array(zTimingStage).optional(),
|
|
4331
|
+
timing_contract_version: z
|
|
4332
|
+
.int()
|
|
4333
|
+
.gte(0)
|
|
4334
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
4335
|
+
transitions: z.array(zTimingTransition),
|
|
4336
|
+
webhook_deliveries: z.array(zTimingWebhookDelivery),
|
|
4337
|
+
webhook_delivery_attempts: z.array(zTimingWebhookDeliveryAttempt),
|
|
4338
|
+
webhook_events: z.array(zTimingWebhookEvent),
|
|
4339
|
+
work: z.array(zTimingWork),
|
|
4340
|
+
work_claims: z.array(zTimingWorkClaim).optional(),
|
|
4341
|
+
});
|
|
4342
|
+
export const zWebhookDelivery = z.object({
|
|
4343
|
+
attempt_count: z
|
|
4344
|
+
.int()
|
|
4345
|
+
.gte(0)
|
|
4346
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
4347
|
+
attempts: z.array(zWebhookDeliveryAttempt),
|
|
4348
|
+
event: z.record(z.string(), z.unknown()),
|
|
4349
|
+
id: z.uuid(),
|
|
4350
|
+
last_http_status: z
|
|
4351
|
+
.int()
|
|
4352
|
+
.gte(0)
|
|
4353
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
4354
|
+
.nullable(),
|
|
4355
|
+
last_result_code: zWebhookDeliveryResultCode.nullable(),
|
|
4356
|
+
next_attempt_at: z.iso.datetime(),
|
|
4357
|
+
occurred_at: z.iso.datetime(),
|
|
4358
|
+
settled_at: z.iso.datetime().nullable(),
|
|
4359
|
+
state: zWebhookDeliveryState,
|
|
4360
|
+
webhook_endpoint_id: z.uuid(),
|
|
4361
|
+
webhook_event_id: z.uuid(),
|
|
4362
|
+
webhook_replay_id: z.uuid().nullable(),
|
|
4363
|
+
});
|
|
4364
|
+
export const zWebhookDeliveryPage = z.object({
|
|
4365
|
+
data: z.array(zWebhookDelivery),
|
|
4366
|
+
hasMore: z.boolean(),
|
|
4367
|
+
nextCursor: z.string().nullable(),
|
|
4368
|
+
object: zCollectionObject,
|
|
4369
|
+
});
|
|
4370
|
+
export const zWebhookEndpointStatus = z.enum(["active", "suspended", "deleted"]);
|
|
4371
|
+
export const zRegisteredWebhookEndpoint = z.object({
|
|
4372
|
+
description: z.string().nullable(),
|
|
4373
|
+
environment: zFiscalEnvironment,
|
|
4374
|
+
id: z.uuid(),
|
|
4375
|
+
sourceConnectionId: z.uuid(),
|
|
4376
|
+
status: zWebhookEndpointStatus,
|
|
4377
|
+
url: z.url(),
|
|
4378
|
+
});
|
|
4379
|
+
export const zWebhookEndpointRegistration = z.object({
|
|
4380
|
+
signingSecret: z.string().nullable(),
|
|
4381
|
+
webhookEndpoint: zRegisteredWebhookEndpoint,
|
|
4382
|
+
});
|
|
4383
|
+
/**
|
|
4384
|
+
* The wire family a delivered Webhook body announces.
|
|
4385
|
+
*/
|
|
4386
|
+
export const zWebhookEventObject = z.enum(["event"]);
|
|
4387
|
+
export const zInvoiceWebhookEventEnvelope = lenientUnion([
|
|
4388
|
+
z.object({
|
|
4389
|
+
apiVersion: z.string().refine((text) => Array.from(text).length >= 1),
|
|
4390
|
+
data: z.object({
|
|
4391
|
+
id: z.uuid(),
|
|
4392
|
+
sourceConnectionId: z.uuid(),
|
|
4393
|
+
}),
|
|
4394
|
+
environment: zFiscalEnvironment,
|
|
4395
|
+
id: z.uuid(),
|
|
4396
|
+
object: zWebhookEventObject,
|
|
4397
|
+
occurredAt: z.iso.datetime(),
|
|
4398
|
+
organizationId: z.uuid(),
|
|
4399
|
+
sequence: z.string().regex(/^[1-9][0-9]*$/),
|
|
4400
|
+
type: z.enum(["invoice.accepted"]),
|
|
4401
|
+
}),
|
|
4402
|
+
z.object({
|
|
4403
|
+
apiVersion: z.string().refine((text) => Array.from(text).length >= 1),
|
|
4404
|
+
data: z.object({
|
|
4405
|
+
id: z.uuid(),
|
|
4406
|
+
sourceConnectionId: z.uuid(),
|
|
4407
|
+
}),
|
|
4408
|
+
environment: zFiscalEnvironment,
|
|
4409
|
+
id: z.uuid(),
|
|
4410
|
+
object: zWebhookEventObject,
|
|
4411
|
+
occurredAt: z.iso.datetime(),
|
|
4412
|
+
organizationId: z.uuid(),
|
|
4413
|
+
sequence: z.string().regex(/^[1-9][0-9]*$/),
|
|
4414
|
+
type: z.enum(["invoice.rejected"]),
|
|
4415
|
+
}),
|
|
4416
|
+
z.object({
|
|
4417
|
+
apiVersion: z.string().refine((text) => Array.from(text).length >= 1),
|
|
4418
|
+
data: z.object({
|
|
4419
|
+
id: z.uuid(),
|
|
4420
|
+
sourceConnectionId: z.uuid(),
|
|
4421
|
+
}),
|
|
4422
|
+
environment: zFiscalEnvironment,
|
|
4423
|
+
id: z.uuid(),
|
|
4424
|
+
object: zWebhookEventObject,
|
|
4425
|
+
occurredAt: z.iso.datetime(),
|
|
4426
|
+
organizationId: z.uuid(),
|
|
4427
|
+
sequence: z.string().regex(/^[1-9][0-9]*$/),
|
|
4428
|
+
type: z.enum(["invoice.operatorRequired"]),
|
|
4429
|
+
}),
|
|
4430
|
+
z.object({
|
|
4431
|
+
apiVersion: z.string().refine((text) => Array.from(text).length >= 1),
|
|
4432
|
+
data: z.object({
|
|
4433
|
+
id: z.uuid(),
|
|
4434
|
+
sourceConnectionId: z.uuid(),
|
|
4435
|
+
}),
|
|
4436
|
+
environment: zFiscalEnvironment,
|
|
4437
|
+
id: z.uuid(),
|
|
4438
|
+
object: zWebhookEventObject,
|
|
4439
|
+
occurredAt: z.iso.datetime(),
|
|
4440
|
+
organizationId: z.uuid(),
|
|
4441
|
+
sequence: z.string().regex(/^[1-9][0-9]*$/),
|
|
4442
|
+
type: z.enum(["invoice.ready"]),
|
|
4443
|
+
}),
|
|
4444
|
+
]);
|
|
4445
|
+
export const zReceptionWebhookEventEnvelope = lenientUnion([
|
|
4446
|
+
z.object({
|
|
4447
|
+
data: z.object({
|
|
4448
|
+
e_ncf: z.string().regex(/^([a-zA-Z0-9]{9}|[a-zA-Z0-9]{11}|[a-zA-Z0-9]{13})$/),
|
|
4449
|
+
fiscal_reception_id: z.uuid(),
|
|
4450
|
+
received_at: z.iso.datetime(),
|
|
4451
|
+
received_xml_sha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
4452
|
+
rnc_comprador: z.string().regex(/^[0-9]{9}([0-9]{2})?$/),
|
|
4453
|
+
rnc_emisor: z.string().regex(/^[0-9]{9}([0-9]{2})?$/),
|
|
4454
|
+
}),
|
|
4455
|
+
environment: zFiscalEnvironment,
|
|
4456
|
+
id: z.uuid(),
|
|
4457
|
+
object: zWebhookEventObject,
|
|
4458
|
+
occurred_at: z.iso.datetime(),
|
|
4459
|
+
organization_id: z.uuid(),
|
|
4460
|
+
sequence: z.string().regex(/^[1-9][0-9]*$/),
|
|
4461
|
+
type: z.enum(["fiscal_reception.received"]),
|
|
4462
|
+
}),
|
|
4463
|
+
z.object({
|
|
4464
|
+
data: z.object({
|
|
4465
|
+
e_ncf: z.string().regex(/^([a-zA-Z0-9]{9}|[a-zA-Z0-9]{11}|[a-zA-Z0-9]{13})$/),
|
|
4466
|
+
fiscal_reception_id: z.uuid(),
|
|
4467
|
+
not_received_reason: zNotReceivedReason,
|
|
4468
|
+
received_at: z.iso.datetime(),
|
|
4469
|
+
received_xml_sha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
4470
|
+
rnc_comprador: z.string().regex(/^[0-9]{9}([0-9]{2})?$/),
|
|
4471
|
+
rnc_emisor: z.string().regex(/^[0-9]{9}([0-9]{2})?$/),
|
|
4472
|
+
}),
|
|
4473
|
+
environment: zFiscalEnvironment,
|
|
4474
|
+
id: z.uuid(),
|
|
4475
|
+
object: zWebhookEventObject,
|
|
4476
|
+
occurred_at: z.iso.datetime(),
|
|
4477
|
+
organization_id: z.uuid(),
|
|
4478
|
+
sequence: z.string().regex(/^[1-9][0-9]*$/),
|
|
4479
|
+
type: z.enum(["fiscal_reception.not_received"]),
|
|
4480
|
+
}),
|
|
4481
|
+
]);
|
|
4482
|
+
export const zWebhookOutcomeUnknownTerminality = z.enum(["pending", "operator_required"]);
|
|
4483
|
+
export const zWebhookFiscalOperationOutcome = lenientUnion([
|
|
4484
|
+
z.object({
|
|
4485
|
+
outcome: z.enum(["rejected"]),
|
|
4486
|
+
terminality: zFiscalOperationTerminalTerminality,
|
|
4487
|
+
}),
|
|
4488
|
+
z.object({
|
|
4489
|
+
fiscal_identity: zFiscalIdentityResource,
|
|
4490
|
+
outcome: z.enum(["processing"]),
|
|
4491
|
+
stage: zFiscalOperationProcessingStage,
|
|
4492
|
+
terminality: zFiscalOperationPendingTerminality,
|
|
4493
|
+
}),
|
|
4494
|
+
z.object({
|
|
4495
|
+
fiscal_identity: zFiscalIdentityResource,
|
|
4496
|
+
outcome: z.enum(["outcome_unknown"]),
|
|
4497
|
+
terminality: zWebhookOutcomeUnknownTerminality,
|
|
4498
|
+
}),
|
|
4499
|
+
z.object({
|
|
4500
|
+
fiscal_identity: zFiscalIdentityResource,
|
|
4501
|
+
outcome: z.enum(["accepted"]),
|
|
4502
|
+
terminality: zFiscalOperationTerminalTerminality,
|
|
4503
|
+
}),
|
|
4504
|
+
z.object({
|
|
4505
|
+
fiscal_identity: zFiscalIdentityResource,
|
|
4506
|
+
outcome: z.enum(["accepted_with_findings"]),
|
|
4507
|
+
terminality: zFiscalOperationTerminalTerminality,
|
|
4508
|
+
}),
|
|
4509
|
+
z.object({
|
|
4510
|
+
fiscal_identity: zFiscalIdentityResource,
|
|
4511
|
+
outcome: z.enum(["authority_rejected"]),
|
|
4512
|
+
terminality: zFiscalOperationOperatorRequiredTerminality,
|
|
4513
|
+
}),
|
|
4514
|
+
z.object({
|
|
4515
|
+
fiscal_identity: zFiscalIdentityResource,
|
|
4516
|
+
outcome: z.enum(["intervention_required"]),
|
|
4517
|
+
terminality: zFiscalOperationOperatorRequiredTerminality,
|
|
4518
|
+
}),
|
|
4519
|
+
]);
|
|
4520
|
+
export const zWebhookEventEnvelope = lenientUnion([
|
|
4521
|
+
z.object({
|
|
4522
|
+
apiVersion: z.string().refine((text) => Array.from(text).length >= 1),
|
|
4523
|
+
data: z.object({
|
|
4524
|
+
id: z.uuid(),
|
|
4525
|
+
sourceConnectionId: z.uuid(),
|
|
4526
|
+
}),
|
|
4527
|
+
environment: zFiscalEnvironment,
|
|
4528
|
+
id: z.uuid(),
|
|
4529
|
+
object: zWebhookEventObject,
|
|
4530
|
+
occurredAt: z.iso.datetime(),
|
|
4531
|
+
organizationId: z.uuid(),
|
|
4532
|
+
sequence: z.string().regex(/^[1-9][0-9]*$/),
|
|
4533
|
+
type: z.enum(["invoice.accepted"]),
|
|
4534
|
+
}),
|
|
4535
|
+
z.object({
|
|
4536
|
+
apiVersion: z.string().refine((text) => Array.from(text).length >= 1),
|
|
4537
|
+
data: z.object({
|
|
4538
|
+
id: z.uuid(),
|
|
4539
|
+
sourceConnectionId: z.uuid(),
|
|
4540
|
+
}),
|
|
4541
|
+
environment: zFiscalEnvironment,
|
|
4542
|
+
id: z.uuid(),
|
|
4543
|
+
object: zWebhookEventObject,
|
|
4544
|
+
occurredAt: z.iso.datetime(),
|
|
4545
|
+
organizationId: z.uuid(),
|
|
4546
|
+
sequence: z.string().regex(/^[1-9][0-9]*$/),
|
|
4547
|
+
type: z.enum(["invoice.rejected"]),
|
|
4548
|
+
}),
|
|
4549
|
+
z.object({
|
|
4550
|
+
apiVersion: z.string().refine((text) => Array.from(text).length >= 1),
|
|
4551
|
+
data: z.object({
|
|
4552
|
+
id: z.uuid(),
|
|
4553
|
+
sourceConnectionId: z.uuid(),
|
|
4554
|
+
}),
|
|
4555
|
+
environment: zFiscalEnvironment,
|
|
4556
|
+
id: z.uuid(),
|
|
4557
|
+
object: zWebhookEventObject,
|
|
4558
|
+
occurredAt: z.iso.datetime(),
|
|
4559
|
+
organizationId: z.uuid(),
|
|
4560
|
+
sequence: z.string().regex(/^[1-9][0-9]*$/),
|
|
4561
|
+
type: z.enum(["invoice.operatorRequired"]),
|
|
4562
|
+
}),
|
|
4563
|
+
z.object({
|
|
4564
|
+
apiVersion: z.string().refine((text) => Array.from(text).length >= 1),
|
|
4565
|
+
data: z.object({
|
|
4566
|
+
id: z.uuid(),
|
|
4567
|
+
sourceConnectionId: z.uuid(),
|
|
4568
|
+
}),
|
|
4569
|
+
environment: zFiscalEnvironment,
|
|
4570
|
+
id: z.uuid(),
|
|
4571
|
+
object: zWebhookEventObject,
|
|
4572
|
+
occurredAt: z.iso.datetime(),
|
|
4573
|
+
organizationId: z.uuid(),
|
|
4574
|
+
sequence: z.string().regex(/^[1-9][0-9]*$/),
|
|
4575
|
+
type: z.enum(["invoice.ready"]),
|
|
4576
|
+
}),
|
|
4577
|
+
z.object({
|
|
4578
|
+
apiVersion: z.string().refine((text) => Array.from(text).length >= 1),
|
|
4579
|
+
data: z.object({
|
|
4580
|
+
fiscal_operation_id: z.uuid(),
|
|
4581
|
+
fiscal_operation_outcome: zWebhookFiscalOperationOutcome,
|
|
4582
|
+
}),
|
|
4583
|
+
environment: zFiscalEnvironment,
|
|
4584
|
+
id: z.uuid(),
|
|
4585
|
+
object: zWebhookEventObject,
|
|
4586
|
+
occurredAt: z.iso.datetime(),
|
|
4587
|
+
organizationId: z.uuid(),
|
|
4588
|
+
sequence: z.string().regex(/^[1-9][0-9]*$/),
|
|
4589
|
+
type: z.enum(["fiscal_operation.commercially_accepted"]),
|
|
4590
|
+
}),
|
|
4591
|
+
z.object({
|
|
4592
|
+
apiVersion: z.string().refine((text) => Array.from(text).length >= 1),
|
|
4593
|
+
data: z.object({
|
|
4594
|
+
fiscal_operation_id: z.uuid(),
|
|
4595
|
+
fiscal_operation_outcome: zWebhookFiscalOperationOutcome,
|
|
4596
|
+
}),
|
|
4597
|
+
environment: zFiscalEnvironment,
|
|
4598
|
+
id: z.uuid(),
|
|
4599
|
+
object: zWebhookEventObject,
|
|
4600
|
+
occurredAt: z.iso.datetime(),
|
|
4601
|
+
organizationId: z.uuid(),
|
|
4602
|
+
sequence: z.string().regex(/^[1-9][0-9]*$/),
|
|
4603
|
+
type: z.enum(["fiscal_operation.commercially_rejected"]),
|
|
4604
|
+
}),
|
|
4605
|
+
z.object({
|
|
4606
|
+
apiVersion: z.string().refine((text) => Array.from(text).length >= 1),
|
|
4607
|
+
data: z.object({
|
|
4608
|
+
activation_attempt_id: z.uuid(),
|
|
4609
|
+
challenge: z
|
|
4610
|
+
.string()
|
|
4611
|
+
.refine((text) => Array.from(text).length >= 43)
|
|
4612
|
+
.refine((text) => Array.from(text).length <= 43)
|
|
4613
|
+
.regex(/^[A-Za-z0-9_-]{43}$/),
|
|
4614
|
+
expires_at: z.iso.datetime(),
|
|
4615
|
+
provider_deployment_id: z
|
|
4616
|
+
.string()
|
|
4617
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
4618
|
+
.refine((text) => Array.from(text).length <= 256)
|
|
4619
|
+
.regex(/^[^\p{White_Space}](?:[\s\S]*[^\p{White_Space}])?$/u),
|
|
4620
|
+
provider_target_id: z
|
|
4621
|
+
.string()
|
|
4622
|
+
.refine((text) => Array.from(text).length >= 1)
|
|
4623
|
+
.refine((text) => Array.from(text).length <= 256)
|
|
4624
|
+
.regex(/^[^\p{White_Space}](?:[\s\S]*[^\p{White_Space}])?$/u),
|
|
4625
|
+
source_connection_id: z.uuid(),
|
|
4626
|
+
}),
|
|
4627
|
+
environment: zFiscalEnvironment,
|
|
4628
|
+
id: z.uuid(),
|
|
4629
|
+
object: zWebhookEventObject,
|
|
4630
|
+
occurredAt: z.iso.datetime(),
|
|
4631
|
+
organizationId: z.uuid(),
|
|
4632
|
+
sequence: z.string().regex(/^[1-9][0-9]*$/),
|
|
4633
|
+
type: z.enum(["source_connection.verification_requested"]),
|
|
4634
|
+
}),
|
|
4635
|
+
]);
|
|
4636
|
+
export const zWebhookReplayResource = z.object({
|
|
4637
|
+
eventCount: z
|
|
4638
|
+
.int()
|
|
4639
|
+
.gte(0)
|
|
4640
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
4641
|
+
eventIds: z.array(z.uuid()),
|
|
4642
|
+
id: z.uuid(),
|
|
4643
|
+
});
|
|
4644
|
+
export const zWorkspaceAttemptOutcome = z.enum([
|
|
4645
|
+
"signed",
|
|
4646
|
+
"failed",
|
|
4647
|
+
"unavailable",
|
|
4648
|
+
"automatic_replay_horizon_expired",
|
|
4649
|
+
"authority_response",
|
|
4650
|
+
"authentication_failed",
|
|
4651
|
+
]);
|
|
4652
|
+
export const zWorkspaceDecisionKind = z.enum(["admission", "lifecycle"]);
|
|
4653
|
+
export const zWorkspaceEvidenceAccessActor = lenientUnion([
|
|
4654
|
+
z.object({
|
|
4655
|
+
principal_kind: z.enum(["source_connection"]),
|
|
4656
|
+
source_connection_id: z.uuid(),
|
|
4657
|
+
}),
|
|
4658
|
+
z.object({
|
|
4659
|
+
actor: z.string(),
|
|
4660
|
+
principal_kind: z.enum(["principal"]),
|
|
4661
|
+
}),
|
|
4662
|
+
z.object({
|
|
4663
|
+
fiscal_delivery_id: z.uuid(),
|
|
4664
|
+
principal_kind: z.enum(["fiscal_delivery"]),
|
|
4665
|
+
}),
|
|
4666
|
+
]);
|
|
4667
|
+
export const zWorkspaceFiscalOperationSummary = z.object({
|
|
4668
|
+
action: zSourceFiscalAction,
|
|
4669
|
+
created_at: z.iso.datetime(),
|
|
4670
|
+
environment: zFiscalEnvironment,
|
|
4671
|
+
operation_id: z.uuid(),
|
|
4672
|
+
outcome: zFiscalOperationOutcomeResource,
|
|
4673
|
+
source: zFiscalOperationSource,
|
|
4674
|
+
updated_at: z.iso.datetime(),
|
|
4675
|
+
});
|
|
4676
|
+
export const zWorkspaceFiscalOperationPage = z.object({
|
|
4677
|
+
data: z.array(zWorkspaceFiscalOperationSummary),
|
|
4678
|
+
hasMore: z.boolean(),
|
|
4679
|
+
nextCursor: z.string().nullable(),
|
|
4680
|
+
object: zCollectionObject,
|
|
4681
|
+
});
|
|
4682
|
+
export const zWorkspaceLifecycleCapability = z.enum([
|
|
4683
|
+
"custody_sign",
|
|
4684
|
+
"authority_submission",
|
|
4685
|
+
"authority_inquiry",
|
|
4686
|
+
"authority_poll",
|
|
4687
|
+
]);
|
|
4688
|
+
export const zWorkspaceLifecycleWorkKind = z.enum(["advance", "external_effect"]);
|
|
4689
|
+
export const zWorkspaceLifecycleWorkState = z.enum(["pending", "claimed", "settled"]);
|
|
4690
|
+
export const zWorkspaceFiscalTimelineEntry = lenientUnion([
|
|
4691
|
+
z.object({
|
|
4692
|
+
attempt_sequence: z
|
|
4693
|
+
.int()
|
|
4694
|
+
.gte(0)
|
|
4695
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
4696
|
+
.nullable(),
|
|
4697
|
+
entry_id: z.uuid(),
|
|
4698
|
+
from_state: zFiscalOperationTransitionState.nullable(),
|
|
4699
|
+
kind: z.enum(["transition"]),
|
|
4700
|
+
occurred_at: z.iso.datetime(),
|
|
4701
|
+
result_code: zFiscalLifecycleResultCode,
|
|
4702
|
+
sequence: z
|
|
4703
|
+
.int()
|
|
4704
|
+
.gte(0)
|
|
4705
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
4706
|
+
to_state: zFiscalOperationTransitionState,
|
|
4707
|
+
}),
|
|
4708
|
+
z.object({
|
|
4709
|
+
decision_kind: zWorkspaceDecisionKind,
|
|
4710
|
+
entry_id: z.string(),
|
|
4711
|
+
kind: z.enum(["decision"]),
|
|
4712
|
+
protocol: z.string(),
|
|
4713
|
+
recorded_at: z.iso.datetime(),
|
|
4714
|
+
rules_version: z.string(),
|
|
4715
|
+
}),
|
|
4716
|
+
z.object({
|
|
4717
|
+
decision_id: z.string(),
|
|
4718
|
+
entry_id: z.string(),
|
|
4719
|
+
kind: z.enum(["lifecycle_event"]),
|
|
4720
|
+
ordinal: z
|
|
4721
|
+
.int()
|
|
4722
|
+
.gte(0)
|
|
4723
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
4724
|
+
recorded_at: z.iso.datetime(),
|
|
4725
|
+
result_code: zFiscalLifecycleResultCode,
|
|
4726
|
+
}),
|
|
4727
|
+
z.object({
|
|
4728
|
+
claim_expires_at: z.iso.datetime().nullable(),
|
|
4729
|
+
claimed_at: z.iso.datetime().nullable(),
|
|
4730
|
+
claimed_by: z.string().nullable(),
|
|
4731
|
+
created_at: z.iso.datetime(),
|
|
4732
|
+
due_at: z.iso.datetime(),
|
|
4733
|
+
effect_id: z.string().nullable(),
|
|
4734
|
+
effect_kind: zExternalEffectKind.nullable(),
|
|
4735
|
+
entry_id: z.string(),
|
|
4736
|
+
expected_revision: z
|
|
4737
|
+
.int()
|
|
4738
|
+
.gte(0)
|
|
4739
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
4740
|
+
fence_token: z.string().regex(/^[0-9]+$/),
|
|
4741
|
+
kind: z.enum(["work"]),
|
|
4742
|
+
settled_at: z.iso.datetime().nullable(),
|
|
4743
|
+
settled_by_decision_id: z.string().nullable(),
|
|
4744
|
+
state: zWorkspaceLifecycleWorkState,
|
|
4745
|
+
work_id: z.string(),
|
|
4746
|
+
work_kind: zWorkspaceLifecycleWorkKind,
|
|
4747
|
+
}),
|
|
4748
|
+
z.object({
|
|
4749
|
+
capability: zWorkspaceLifecycleCapability,
|
|
4750
|
+
effect_id: z.string(),
|
|
4751
|
+
effect_kind: zExternalEffectKind,
|
|
4752
|
+
effect_replay_retention_seconds: z
|
|
4753
|
+
.int()
|
|
4754
|
+
.gte(0)
|
|
4755
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
|
|
4756
|
+
.nullable(),
|
|
4757
|
+
entry_id: z.uuid(),
|
|
4758
|
+
fence_token: z.string().regex(/^[0-9]+$/),
|
|
4759
|
+
kind: z.enum(["attempt"]),
|
|
4760
|
+
observation_sha256: z
|
|
4761
|
+
.string()
|
|
4762
|
+
.regex(/^[0-9a-f]{64}$/)
|
|
4763
|
+
.nullable(),
|
|
4764
|
+
observed_at: z.iso.datetime().nullable(),
|
|
4765
|
+
outcome: zWorkspaceAttemptOutcome.nullable(),
|
|
4766
|
+
sequence: z
|
|
4767
|
+
.int()
|
|
4768
|
+
.gte(0)
|
|
4769
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
4770
|
+
started_at: z.iso.datetime(),
|
|
4771
|
+
work_id: z.string(),
|
|
4772
|
+
}),
|
|
4773
|
+
z.object({
|
|
4774
|
+
artifact_kind: zFiscalArtifactKind,
|
|
4775
|
+
byte_length: z
|
|
4776
|
+
.int()
|
|
4777
|
+
.gte(0)
|
|
4778
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
4779
|
+
certificate_sha256: z
|
|
4780
|
+
.string()
|
|
4781
|
+
.regex(/^[0-9a-f]{64}$/)
|
|
4782
|
+
.nullable(),
|
|
4783
|
+
content_sha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
4784
|
+
created_at: z.iso.datetime(),
|
|
4785
|
+
entry_id: z.uuid(),
|
|
4786
|
+
kind: z.enum(["artifact"]),
|
|
4787
|
+
media_type: zFiscalArtifactMediaType,
|
|
4788
|
+
}),
|
|
4789
|
+
z.object({
|
|
4790
|
+
artifact_byte_length: z
|
|
4791
|
+
.int()
|
|
4792
|
+
.gte(0)
|
|
4793
|
+
.max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
4794
|
+
artifact_kind: zDocumentSchemaArtifactKind,
|
|
4795
|
+
artifact_sha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
4796
|
+
diagnostic_code: zSchemaValidationDiagnosticCode.nullable(),
|
|
4797
|
+
diagnostic_path: z.string().nullable(),
|
|
4798
|
+
entry_id: z.uuid(),
|
|
4799
|
+
kind: z.enum(["evidence"]),
|
|
4800
|
+
outcome: zSchemaValidationOutcome,
|
|
4801
|
+
recorded_at: z.iso.datetime(),
|
|
4802
|
+
schema_manifest_sha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
4803
|
+
stage: zSchemaValidationStage,
|
|
4804
|
+
validation_root_sha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
4805
|
+
}),
|
|
4806
|
+
z.object({
|
|
4807
|
+
actor: zWorkspaceEvidenceAccessActor,
|
|
4808
|
+
artifact_id: z.uuid(),
|
|
4809
|
+
artifact_kind: zFiscalArtifactKind,
|
|
4810
|
+
content_sha256: z.string(),
|
|
4811
|
+
entry_id: z.uuid(),
|
|
4812
|
+
kind: z.enum(["evidence_access"]),
|
|
4813
|
+
occurred_at: z.iso.datetime(),
|
|
4814
|
+
purpose: zEvidenceAccessPurpose,
|
|
4815
|
+
result_code: zEvidenceAccessResultCode,
|
|
4816
|
+
}),
|
|
4817
|
+
]);
|
|
4818
|
+
export const zWorkspaceFiscalTimelinePage = z.object({
|
|
4819
|
+
data: z.array(zWorkspaceFiscalTimelineEntry),
|
|
4820
|
+
hasMore: z.boolean(),
|
|
4821
|
+
nextCursor: z.string().nullable(),
|
|
4822
|
+
object: zCollectionObject,
|
|
4823
|
+
});
|
|
4824
|
+
export const zWorkspaceFiscalOperationResource = z.object({
|
|
4825
|
+
commercial_response: zCommercialResponseProjection.nullable(),
|
|
4826
|
+
operation: zFiscalOperationResource,
|
|
4827
|
+
timeline: zWorkspaceFiscalTimelinePage,
|
|
4828
|
+
});
|
|
4829
|
+
/**
|
|
4830
|
+
* The stamp server process is live.
|
|
4831
|
+
*/
|
|
4832
|
+
export const zCreateHostedTenantResponse = zHostedTenantResource;
|
|
4833
|
+
export const zReleaseHostedTenantResponse = zReleasedHostedTenant;
|
|
4834
|
+
export const zCreateHostedTenantWebhookSecretRotationResponse = zHostedWebhookSecretRotation;
|
|
4835
|
+
export const zListHostedInvoicesResponse = zInvoicePage;
|
|
4836
|
+
export const zCreateHostedInvoiceResponse = zInvoiceResource;
|
|
4837
|
+
export const zPreviewHostedInvoiceResponse = zInvoicePreview;
|
|
4838
|
+
export const zRetrieveHostedInvoiceResponse = zInvoiceResource;
|
|
4839
|
+
export const zDownloadHostedInvoicePdfResponse = zFiscalArtifactBytes;
|
|
4840
|
+
export const zDownloadHostedInvoiceXmlResponse = zFiscalArtifactBytes;
|
|
4841
|
+
export const zShareHostedInvoiceReceiptResponse = zInvoiceReceiptAccess;
|
|
4842
|
+
export const zReplaceHostedInvoiceResponse = zInvoiceResource;
|
|
4843
|
+
export const zListFiscalOperationsResponse = zSourceFiscalOperationPage;
|
|
4844
|
+
/**
|
|
4845
|
+
* One immutable Source sales or correction command. A Source connection credential sends the command alone. A trusted first-party service sends it inside request beside checkout_tenant_id and environment, which name the hosted binding selecting the Source connection.
|
|
4846
|
+
*/
|
|
4847
|
+
export const zCreateFiscalOperationResponse = zFiscalOperationResource;
|
|
4848
|
+
export const zFindFiscalOperationBySourceResponse = zFiscalOperationResource;
|
|
4849
|
+
export const zFindFiscalOperationResponse = zFiscalOperationResource;
|
|
4850
|
+
export const zFindFiscalArtifactResponse = zFiscalArtifactBytes;
|
|
4851
|
+
export const zReadFiscalOperationTimingResponse = zFiscalOperationTimingReport;
|
|
4852
|
+
/**
|
|
4853
|
+
* The authenticated tenant's certificate-custody readiness resource.
|
|
4854
|
+
*/
|
|
4855
|
+
export const zReadCertificateCustodyReadinessResponse = zCertificateCustodyReadiness;
|
|
4856
|
+
export const zCreateDirectConnectionRequestResponse = zDirectConnectionRequestResource;
|
|
4857
|
+
export const zCancelDirectConnectionRequestResponse = z.void();
|
|
4858
|
+
export const zPollDirectConnectionRequestResponse = zDirectConnectionPollResource;
|
|
4859
|
+
export const zReadElectronicFiscalDocumentEligibilityResponse = zElectronicFiscalDocumentEligibilityResource;
|
|
4860
|
+
export const zRetrieveFiscalDeliveryPrintedRepresentationResponse = z.instanceof(Uint8Array);
|
|
4861
|
+
/**
|
|
4862
|
+
* Current central fiscal-number ranges and actionable availability for the authenticated Source connection's issuer and environment.
|
|
4863
|
+
*/
|
|
4864
|
+
export const zReadFiscalNumberAuthorizationReadinessResponse = zFiscalNumberAuthorizationReadiness;
|
|
4865
|
+
export const zImportHostedCertificateCustodyResponse = zHostedImportResponse;
|
|
4866
|
+
export const zIssueHostedInvoiceCredentialResponse = zHostedInvoiceCredentialResponse;
|
|
4867
|
+
export const zAcceptInvitationResponse = zMembershipAcceptance;
|
|
4868
|
+
export const zRetrieveInvoiceReceiptResponse = zInvoiceReceipt;
|
|
4869
|
+
export const zDownloadInvoiceReceiptPdfResponse = zFiscalArtifactBytes;
|
|
4870
|
+
export const zListInvoicesResponse = zInvoicePage;
|
|
4871
|
+
export const zCreateInvoiceResponse = zInvoiceResource;
|
|
4872
|
+
export const zPreviewInvoiceResponse = zInvoicePreview;
|
|
4873
|
+
export const zRetrieveInvoiceResponse = zInvoiceResource;
|
|
4874
|
+
export const zCreateInvoiceDeliveryResponse = zInvoiceDeliveryResource;
|
|
4875
|
+
export const zRetrieveInvoiceDeliveryResponse = zInvoiceDeliveryResource;
|
|
4876
|
+
export const zDownloadInvoicePdfResponse = zFiscalArtifactBytes;
|
|
4877
|
+
export const zDownloadInvoiceXmlResponse = zFiscalArtifactBytes;
|
|
4878
|
+
export const zShareInvoiceReceiptResponse = zInvoiceReceiptAccess;
|
|
4879
|
+
export const zReplaceInvoiceResponse = zInvoiceResource;
|
|
4880
|
+
export const zCreateOrganizationResponse = zOrganizationResource;
|
|
4881
|
+
export const zReadAuditEventsResponse = zAuditEventPage;
|
|
4882
|
+
export const zListCertificateCustodyBindingsResponse = zCertificateCustodyBindingPage;
|
|
4883
|
+
export const zCreateCertificateCustodyBindingResponse = zCertificateCustodyBindingResource;
|
|
4884
|
+
export const zReadCertificateCustodyBindingResponse = zCertificateCustodyBindingResource;
|
|
4885
|
+
export const zRevokeCertificateCustodyCertificateVersionResponse = zCertificateCustodyBindingResource;
|
|
4886
|
+
export const zPreviewDirectConnectionRequestResponse = zDirectConnectionPreviewResource;
|
|
4887
|
+
export const zApproveDirectConnectionRequestResponse = zDirectConnectionApprovalResource;
|
|
4888
|
+
export const zInspectFiscalNumberAuthorizationHistoryResponse = zFiscalNumberAuthorizationHistoryResource;
|
|
4889
|
+
export const zRegisterFiscalNumberAuthorizationResponse = zFiscalNumberAuthorizationResource;
|
|
4890
|
+
export const zListOrganizationFiscalOperationsResponse = zWorkspaceFiscalOperationPage;
|
|
4891
|
+
export const zReadOrganizationFiscalOperationResponse = zWorkspaceFiscalOperationResource;
|
|
4892
|
+
export const zRetrieveWorkspaceFiscalArtifactResponse = zFiscalArtifactBytes;
|
|
4893
|
+
export const zAuthorizeAuthorityRejectedReplacementResponse = zAuthorityRejectedReplacementAuthorizationResource;
|
|
4894
|
+
export const zListInvitationsResponse = zInvitationPage;
|
|
4895
|
+
export const zInviteMemberResponse = zInvitationGrant;
|
|
4896
|
+
export const zListLegalIssuersResponse = zLegalIssuerPage;
|
|
4897
|
+
export const zRegisterLegalIssuerResponse = zLegalIssuerResource;
|
|
4898
|
+
export const zCompleteLegalIssuerProfileResponse = zLegalIssuerResource;
|
|
4899
|
+
export const zReadOnboardingReadinessResponse = zOnboardingReadiness;
|
|
4900
|
+
export const zReadOnboardingLegalIssuerIdentityResponse = zOnboardingLegalIssuerIdentity;
|
|
4901
|
+
export const zUpdateOnboardingLegalIssuerIdentityResponse = zOnboardingLegalIssuerIdentity;
|
|
4902
|
+
export const zReadOnboardingServiceScopeResponse = zOnboardingServiceScopeResource;
|
|
4903
|
+
export const zUpdateOnboardingServiceScopeResponse = zOnboardingServiceScopeResource;
|
|
4904
|
+
export const zListReceivedDocumentsResponse = zReceivedDocumentPage;
|
|
4905
|
+
export const zReadReceivedDocumentResponse = zReceivedDocumentResource;
|
|
4906
|
+
export const zRecordCommercialResponseResponse = zReceivedDocumentResource;
|
|
4907
|
+
export const zDeclareReceptionMountResponse = zReceptionMountResource;
|
|
4908
|
+
export const zListSourceConnectionsResponse = zSourceConnectionPage;
|
|
4909
|
+
export const zCreateSourceConnectionResponse = zSourceConnectionResource;
|
|
4910
|
+
export const zReadSourceConnectionResponse = zSourceConnectionResource;
|
|
4911
|
+
export const zRecoverSourceConnectionActivationResponse = zSourceConnectionResource;
|
|
4912
|
+
export const zListSourceProviderAuthorizationsResponse = zSourceProviderAuthorizationPage;
|
|
4913
|
+
export const zBeginVercelSourceProviderInstallationResponse = zVercelInstallationRequestResource;
|
|
4914
|
+
export const zReadSourceProviderAuthorizationResponse = zSourceProviderAuthorizationResource;
|
|
4915
|
+
export const zListAuthorizedVercelProjectsResponse = zAuthorizedVercelProjectPage;
|
|
4916
|
+
export const zReadAuthorizedVercelProjectQualificationResponse = zVercelProjectQualificationResource;
|
|
4917
|
+
export const zListSourceReceivedDocumentsResponse = zReceivedDocumentPage;
|
|
4918
|
+
export const zGetSourceReceivedDocumentResponse = zReceivedDocumentResource;
|
|
4919
|
+
export const zRespondToReceivedDocumentResponse = zReceivedDocumentResource;
|
|
4920
|
+
export const zCompleteSourceConnectionActivationVerificationResponse = z.void();
|
|
4921
|
+
export const zConfirmDirectConnectionResponse = zDirectConnectionConfirmationResource;
|
|
4922
|
+
export const zCompleteVercelSourceProviderInstallationResponse = zVercelInstallationCompletionResource;
|
|
4923
|
+
export const zRegisterUserAccountResponse = zUserAccountResource;
|
|
4924
|
+
/**
|
|
4925
|
+
* The account and every membership it holds.
|
|
4926
|
+
*/
|
|
4927
|
+
export const zReadCurrentUserAccountResponse = zUserAccountResource;
|
|
4928
|
+
export const zRegisterWebhookEndpointResponse = zWebhookEndpointRegistration;
|
|
4929
|
+
export const zListWebhookDeliveriesResponse = zWebhookDeliveryPage;
|
|
4930
|
+
export const zReplayWebhookEventsResponse = zWebhookReplayResource;
|
|
4931
|
+
export const zOpenWorkspaceSessionResponse = zUserAccountResource;
|
|
4932
|
+
/**
|
|
4933
|
+
* The session no longer exists and the cookie is cleared.
|
|
4934
|
+
*/
|
|
4935
|
+
export const zCloseWorkspaceSessionResponse = z.void();
|
|
4936
|
+
export const recognizedWebhookEventTypes = [
|
|
4937
|
+
"fiscal_operation.commercially_accepted",
|
|
4938
|
+
"fiscal_operation.commercially_rejected",
|
|
4939
|
+
"fiscal_reception.not_received",
|
|
4940
|
+
"fiscal_reception.received",
|
|
4941
|
+
"invoice.accepted",
|
|
4942
|
+
"invoice.operatorRequired",
|
|
4943
|
+
"invoice.ready",
|
|
4944
|
+
"invoice.rejected",
|
|
4945
|
+
"source_connection.verification_requested",
|
|
4946
|
+
];
|