@emitia/node 0.1.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/LICENSE +21 -0
- package/README.md +168 -0
- package/dist/index.d.ts +3587 -0
- package/dist/index.js +888 -0
- package/dist/index.js.map +1 -0
- package/package.json +66 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,3587 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/** Resolved, validated SDK configuration. All fields are present. */
|
|
4
|
+
interface EmitiaConfig {
|
|
5
|
+
apiKey: string;
|
|
6
|
+
baseURL: string;
|
|
7
|
+
timeout: number;
|
|
8
|
+
maxRetries: number;
|
|
9
|
+
/**
|
|
10
|
+
* Injectable fetch implementation (default: globalThis.fetch).
|
|
11
|
+
* Used in tests to inject a mock without patching globals.
|
|
12
|
+
* ADR-2: native fetch only — nothing is loaded at runtime. (The package's
|
|
13
|
+
* single dependency, zod, exists solely so the published .d.ts can derive
|
|
14
|
+
* types from its schemas; the compiled .js never imports it.)
|
|
15
|
+
*/
|
|
16
|
+
fetch?: typeof globalThis.fetch;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* AccountInfoSchema — Zod SSOT for GET /v1/account response.
|
|
21
|
+
*
|
|
22
|
+
* This schema is the SINGLE source of truth for the account response contract.
|
|
23
|
+
* The NestJS service imports `AccountInfo` (the inferred type) from here so
|
|
24
|
+
* the TS type and the OpenAPI schema can never drift from each other.
|
|
25
|
+
*
|
|
26
|
+
* Spec: openapi-spec / Response Contract Test (anti-drift).
|
|
27
|
+
* Design: ADR-1 registry pattern.
|
|
28
|
+
*/
|
|
29
|
+
declare const AccountInfoSchema: z.ZodObject<{
|
|
30
|
+
id: z.ZodString;
|
|
31
|
+
name: z.ZodString;
|
|
32
|
+
dian_environment: z.ZodString;
|
|
33
|
+
key_mode: z.ZodEnum<["test", "live"]>;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
dian_environment: string;
|
|
38
|
+
key_mode: "test" | "live";
|
|
39
|
+
}, {
|
|
40
|
+
id: string;
|
|
41
|
+
name: string;
|
|
42
|
+
dian_environment: string;
|
|
43
|
+
key_mode: "test" | "live";
|
|
44
|
+
}>;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* TriggerEventBodySchema — request body for POST /v1/test/trigger-event.
|
|
48
|
+
*
|
|
49
|
+
* Registered as a component so it appears under components.schemas
|
|
50
|
+
* and the contract test can assert on its properties.
|
|
51
|
+
*/
|
|
52
|
+
declare const TriggerEventBodySchema: z.ZodObject<{
|
|
53
|
+
type: z.ZodEnum<["invoice.accepted_by_dian", "invoice.rejected_by_dian", "invoice.accepted_contingency", "invoice.failed", "invoice.email.delivered", "invoice.email.bounced", "invoice.email.complained", "credit_note.email.delivered", "credit_note.email.bounced", "credit_note.email.complained", "debit_note.email.delivered", "debit_note.email.bounced", "debit_note.email.complained"]>;
|
|
54
|
+
object_id: z.ZodOptional<z.ZodString>;
|
|
55
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
56
|
+
}, "strip", z.ZodTypeAny, {
|
|
57
|
+
type: "invoice.accepted_by_dian" | "invoice.rejected_by_dian" | "invoice.accepted_contingency" | "invoice.failed" | "invoice.email.delivered" | "invoice.email.bounced" | "invoice.email.complained" | "credit_note.email.delivered" | "credit_note.email.bounced" | "credit_note.email.complained" | "debit_note.email.delivered" | "debit_note.email.bounced" | "debit_note.email.complained";
|
|
58
|
+
object_id?: string | undefined;
|
|
59
|
+
data?: Record<string, unknown> | undefined;
|
|
60
|
+
}, {
|
|
61
|
+
type: "invoice.accepted_by_dian" | "invoice.rejected_by_dian" | "invoice.accepted_contingency" | "invoice.failed" | "invoice.email.delivered" | "invoice.email.bounced" | "invoice.email.complained" | "credit_note.email.delivered" | "credit_note.email.bounced" | "credit_note.email.complained" | "debit_note.email.delivered" | "debit_note.email.bounced" | "debit_note.email.complained";
|
|
62
|
+
object_id?: string | undefined;
|
|
63
|
+
data?: Record<string, unknown> | undefined;
|
|
64
|
+
}>;
|
|
65
|
+
/**
|
|
66
|
+
* TriggerEventResponseSchema — 201 response for POST /v1/test/trigger-event.
|
|
67
|
+
*
|
|
68
|
+
* `livemode` is always `false` — this endpoint is only callable with sk_test_* keys.
|
|
69
|
+
*/
|
|
70
|
+
declare const TriggerEventResponseSchema: z.ZodObject<{
|
|
71
|
+
id: z.ZodString;
|
|
72
|
+
type: z.ZodString;
|
|
73
|
+
livemode: z.ZodLiteral<false>;
|
|
74
|
+
created: z.ZodString;
|
|
75
|
+
}, "strip", z.ZodTypeAny, {
|
|
76
|
+
type: string;
|
|
77
|
+
id: string;
|
|
78
|
+
livemode: false;
|
|
79
|
+
created: string;
|
|
80
|
+
}, {
|
|
81
|
+
type: string;
|
|
82
|
+
id: string;
|
|
83
|
+
livemode: false;
|
|
84
|
+
created: string;
|
|
85
|
+
}>;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* BalanceResponseSchema — SSOT for GET /v1/balance response shape.
|
|
89
|
+
*
|
|
90
|
+
* Explicitly EXCLUDES: plan_id, invoices_included, invoices_billable, estimated_cost.
|
|
91
|
+
* These are deferred to billing-pipeline SDD #9 (D1 gap).
|
|
92
|
+
*/
|
|
93
|
+
declare const BalanceResponseSchema: z.ZodObject<{
|
|
94
|
+
current_period: z.ZodObject<{
|
|
95
|
+
start: z.ZodString;
|
|
96
|
+
end: z.ZodString;
|
|
97
|
+
documents_used: z.ZodNumber;
|
|
98
|
+
}, "strip", z.ZodTypeAny, {
|
|
99
|
+
start: string;
|
|
100
|
+
end: string;
|
|
101
|
+
documents_used: number;
|
|
102
|
+
}, {
|
|
103
|
+
start: string;
|
|
104
|
+
end: string;
|
|
105
|
+
documents_used: number;
|
|
106
|
+
}>;
|
|
107
|
+
all_time: z.ZodObject<{
|
|
108
|
+
documents_processed: z.ZodNumber;
|
|
109
|
+
}, "strip", z.ZodTypeAny, {
|
|
110
|
+
documents_processed: number;
|
|
111
|
+
}, {
|
|
112
|
+
documents_processed: number;
|
|
113
|
+
}>;
|
|
114
|
+
}, "strip", z.ZodTypeAny, {
|
|
115
|
+
current_period: {
|
|
116
|
+
start: string;
|
|
117
|
+
end: string;
|
|
118
|
+
documents_used: number;
|
|
119
|
+
};
|
|
120
|
+
all_time: {
|
|
121
|
+
documents_processed: number;
|
|
122
|
+
};
|
|
123
|
+
}, {
|
|
124
|
+
current_period: {
|
|
125
|
+
start: string;
|
|
126
|
+
end: string;
|
|
127
|
+
documents_used: number;
|
|
128
|
+
};
|
|
129
|
+
all_time: {
|
|
130
|
+
documents_processed: number;
|
|
131
|
+
};
|
|
132
|
+
}>;
|
|
133
|
+
|
|
134
|
+
declare const CustomerResponseSchema: z.ZodObject<{
|
|
135
|
+
id: z.ZodString;
|
|
136
|
+
object: z.ZodLiteral<"customer">;
|
|
137
|
+
livemode: z.ZodBoolean;
|
|
138
|
+
identification: z.ZodObject<{
|
|
139
|
+
type: z.ZodString;
|
|
140
|
+
number: z.ZodString;
|
|
141
|
+
check_digit: z.ZodOptional<z.ZodString>;
|
|
142
|
+
}, "strip", z.ZodTypeAny, {
|
|
143
|
+
number: string;
|
|
144
|
+
type: string;
|
|
145
|
+
check_digit?: string | undefined;
|
|
146
|
+
}, {
|
|
147
|
+
number: string;
|
|
148
|
+
type: string;
|
|
149
|
+
check_digit?: string | undefined;
|
|
150
|
+
}>;
|
|
151
|
+
legal_name: z.ZodString;
|
|
152
|
+
trade_name: z.ZodNullable<z.ZodString>;
|
|
153
|
+
email: z.ZodNullable<z.ZodString>;
|
|
154
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
155
|
+
address: z.ZodNullable<z.ZodString>;
|
|
156
|
+
city_code: z.ZodNullable<z.ZodString>;
|
|
157
|
+
department_code: z.ZodNullable<z.ZodString>;
|
|
158
|
+
country_code: z.ZodString;
|
|
159
|
+
postal_code: z.ZodNullable<z.ZodString>;
|
|
160
|
+
fiscal_responsibility: z.ZodArray<z.ZodString, "many">;
|
|
161
|
+
organization_type: z.ZodNullable<z.ZodString>;
|
|
162
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
163
|
+
deleted: z.ZodBoolean;
|
|
164
|
+
deleted_at: z.ZodNullable<z.ZodString>;
|
|
165
|
+
created_at: z.ZodString;
|
|
166
|
+
updated_at: z.ZodString;
|
|
167
|
+
}, "strip", z.ZodTypeAny, {
|
|
168
|
+
object: "customer";
|
|
169
|
+
id: string;
|
|
170
|
+
livemode: boolean;
|
|
171
|
+
identification: {
|
|
172
|
+
number: string;
|
|
173
|
+
type: string;
|
|
174
|
+
check_digit?: string | undefined;
|
|
175
|
+
};
|
|
176
|
+
legal_name: string;
|
|
177
|
+
trade_name: string | null;
|
|
178
|
+
email: string | null;
|
|
179
|
+
phone: string | null;
|
|
180
|
+
address: string | null;
|
|
181
|
+
city_code: string | null;
|
|
182
|
+
department_code: string | null;
|
|
183
|
+
country_code: string;
|
|
184
|
+
postal_code: string | null;
|
|
185
|
+
fiscal_responsibility: string[];
|
|
186
|
+
organization_type: string | null;
|
|
187
|
+
metadata: Record<string, unknown>;
|
|
188
|
+
deleted: boolean;
|
|
189
|
+
deleted_at: string | null;
|
|
190
|
+
created_at: string;
|
|
191
|
+
updated_at: string;
|
|
192
|
+
}, {
|
|
193
|
+
object: "customer";
|
|
194
|
+
id: string;
|
|
195
|
+
livemode: boolean;
|
|
196
|
+
identification: {
|
|
197
|
+
number: string;
|
|
198
|
+
type: string;
|
|
199
|
+
check_digit?: string | undefined;
|
|
200
|
+
};
|
|
201
|
+
legal_name: string;
|
|
202
|
+
trade_name: string | null;
|
|
203
|
+
email: string | null;
|
|
204
|
+
phone: string | null;
|
|
205
|
+
address: string | null;
|
|
206
|
+
city_code: string | null;
|
|
207
|
+
department_code: string | null;
|
|
208
|
+
country_code: string;
|
|
209
|
+
postal_code: string | null;
|
|
210
|
+
fiscal_responsibility: string[];
|
|
211
|
+
organization_type: string | null;
|
|
212
|
+
metadata: Record<string, unknown>;
|
|
213
|
+
deleted: boolean;
|
|
214
|
+
deleted_at: string | null;
|
|
215
|
+
created_at: string;
|
|
216
|
+
updated_at: string;
|
|
217
|
+
}>;
|
|
218
|
+
declare const CreateCustomerRequestSchema: z.ZodObject<{
|
|
219
|
+
identification: z.ZodObject<{
|
|
220
|
+
type: z.ZodString;
|
|
221
|
+
number: z.ZodString;
|
|
222
|
+
check_digit: z.ZodOptional<z.ZodString>;
|
|
223
|
+
}, "strip", z.ZodTypeAny, {
|
|
224
|
+
number: string;
|
|
225
|
+
type: string;
|
|
226
|
+
check_digit?: string | undefined;
|
|
227
|
+
}, {
|
|
228
|
+
number: string;
|
|
229
|
+
type: string;
|
|
230
|
+
check_digit?: string | undefined;
|
|
231
|
+
}>;
|
|
232
|
+
legal_name: z.ZodString;
|
|
233
|
+
trade_name: z.ZodOptional<z.ZodString>;
|
|
234
|
+
email: z.ZodOptional<z.ZodString>;
|
|
235
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
236
|
+
address: z.ZodOptional<z.ZodString>;
|
|
237
|
+
city_code: z.ZodOptional<z.ZodString>;
|
|
238
|
+
department_code: z.ZodOptional<z.ZodString>;
|
|
239
|
+
country_code: z.ZodDefault<z.ZodString>;
|
|
240
|
+
postal_code: z.ZodOptional<z.ZodString>;
|
|
241
|
+
fiscal_responsibility: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
242
|
+
organization_type: z.ZodOptional<z.ZodEnum<["1", "2"]>>;
|
|
243
|
+
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
244
|
+
}, "strip", z.ZodTypeAny, {
|
|
245
|
+
identification: {
|
|
246
|
+
number: string;
|
|
247
|
+
type: string;
|
|
248
|
+
check_digit?: string | undefined;
|
|
249
|
+
};
|
|
250
|
+
legal_name: string;
|
|
251
|
+
country_code: string;
|
|
252
|
+
fiscal_responsibility: string[];
|
|
253
|
+
metadata: Record<string, unknown>;
|
|
254
|
+
trade_name?: string | undefined;
|
|
255
|
+
email?: string | undefined;
|
|
256
|
+
phone?: string | undefined;
|
|
257
|
+
address?: string | undefined;
|
|
258
|
+
city_code?: string | undefined;
|
|
259
|
+
department_code?: string | undefined;
|
|
260
|
+
postal_code?: string | undefined;
|
|
261
|
+
organization_type?: "1" | "2" | undefined;
|
|
262
|
+
}, {
|
|
263
|
+
identification: {
|
|
264
|
+
number: string;
|
|
265
|
+
type: string;
|
|
266
|
+
check_digit?: string | undefined;
|
|
267
|
+
};
|
|
268
|
+
legal_name: string;
|
|
269
|
+
trade_name?: string | undefined;
|
|
270
|
+
email?: string | undefined;
|
|
271
|
+
phone?: string | undefined;
|
|
272
|
+
address?: string | undefined;
|
|
273
|
+
city_code?: string | undefined;
|
|
274
|
+
department_code?: string | undefined;
|
|
275
|
+
country_code?: string | undefined;
|
|
276
|
+
postal_code?: string | undefined;
|
|
277
|
+
fiscal_responsibility?: string[] | undefined;
|
|
278
|
+
organization_type?: "1" | "2" | undefined;
|
|
279
|
+
metadata?: Record<string, unknown> | undefined;
|
|
280
|
+
}>;
|
|
281
|
+
declare const CustomerListResponseSchema: z.ZodObject<{
|
|
282
|
+
data: z.ZodArray<z.ZodObject<{
|
|
283
|
+
id: z.ZodString;
|
|
284
|
+
object: z.ZodLiteral<"customer">;
|
|
285
|
+
livemode: z.ZodBoolean;
|
|
286
|
+
identification: z.ZodObject<{
|
|
287
|
+
type: z.ZodString;
|
|
288
|
+
number: z.ZodString;
|
|
289
|
+
check_digit: z.ZodOptional<z.ZodString>;
|
|
290
|
+
}, "strip", z.ZodTypeAny, {
|
|
291
|
+
number: string;
|
|
292
|
+
type: string;
|
|
293
|
+
check_digit?: string | undefined;
|
|
294
|
+
}, {
|
|
295
|
+
number: string;
|
|
296
|
+
type: string;
|
|
297
|
+
check_digit?: string | undefined;
|
|
298
|
+
}>;
|
|
299
|
+
legal_name: z.ZodString;
|
|
300
|
+
trade_name: z.ZodNullable<z.ZodString>;
|
|
301
|
+
email: z.ZodNullable<z.ZodString>;
|
|
302
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
303
|
+
address: z.ZodNullable<z.ZodString>;
|
|
304
|
+
city_code: z.ZodNullable<z.ZodString>;
|
|
305
|
+
department_code: z.ZodNullable<z.ZodString>;
|
|
306
|
+
country_code: z.ZodString;
|
|
307
|
+
postal_code: z.ZodNullable<z.ZodString>;
|
|
308
|
+
fiscal_responsibility: z.ZodArray<z.ZodString, "many">;
|
|
309
|
+
organization_type: z.ZodNullable<z.ZodString>;
|
|
310
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
311
|
+
deleted: z.ZodBoolean;
|
|
312
|
+
deleted_at: z.ZodNullable<z.ZodString>;
|
|
313
|
+
created_at: z.ZodString;
|
|
314
|
+
updated_at: z.ZodString;
|
|
315
|
+
}, "strip", z.ZodTypeAny, {
|
|
316
|
+
object: "customer";
|
|
317
|
+
id: string;
|
|
318
|
+
livemode: boolean;
|
|
319
|
+
identification: {
|
|
320
|
+
number: string;
|
|
321
|
+
type: string;
|
|
322
|
+
check_digit?: string | undefined;
|
|
323
|
+
};
|
|
324
|
+
legal_name: string;
|
|
325
|
+
trade_name: string | null;
|
|
326
|
+
email: string | null;
|
|
327
|
+
phone: string | null;
|
|
328
|
+
address: string | null;
|
|
329
|
+
city_code: string | null;
|
|
330
|
+
department_code: string | null;
|
|
331
|
+
country_code: string;
|
|
332
|
+
postal_code: string | null;
|
|
333
|
+
fiscal_responsibility: string[];
|
|
334
|
+
organization_type: string | null;
|
|
335
|
+
metadata: Record<string, unknown>;
|
|
336
|
+
deleted: boolean;
|
|
337
|
+
deleted_at: string | null;
|
|
338
|
+
created_at: string;
|
|
339
|
+
updated_at: string;
|
|
340
|
+
}, {
|
|
341
|
+
object: "customer";
|
|
342
|
+
id: string;
|
|
343
|
+
livemode: boolean;
|
|
344
|
+
identification: {
|
|
345
|
+
number: string;
|
|
346
|
+
type: string;
|
|
347
|
+
check_digit?: string | undefined;
|
|
348
|
+
};
|
|
349
|
+
legal_name: string;
|
|
350
|
+
trade_name: string | null;
|
|
351
|
+
email: string | null;
|
|
352
|
+
phone: string | null;
|
|
353
|
+
address: string | null;
|
|
354
|
+
city_code: string | null;
|
|
355
|
+
department_code: string | null;
|
|
356
|
+
country_code: string;
|
|
357
|
+
postal_code: string | null;
|
|
358
|
+
fiscal_responsibility: string[];
|
|
359
|
+
organization_type: string | null;
|
|
360
|
+
metadata: Record<string, unknown>;
|
|
361
|
+
deleted: boolean;
|
|
362
|
+
deleted_at: string | null;
|
|
363
|
+
created_at: string;
|
|
364
|
+
updated_at: string;
|
|
365
|
+
}>, "many">;
|
|
366
|
+
has_more: z.ZodBoolean;
|
|
367
|
+
next_cursor: z.ZodNullable<z.ZodString>;
|
|
368
|
+
}, "strip", z.ZodTypeAny, {
|
|
369
|
+
data: {
|
|
370
|
+
object: "customer";
|
|
371
|
+
id: string;
|
|
372
|
+
livemode: boolean;
|
|
373
|
+
identification: {
|
|
374
|
+
number: string;
|
|
375
|
+
type: string;
|
|
376
|
+
check_digit?: string | undefined;
|
|
377
|
+
};
|
|
378
|
+
legal_name: string;
|
|
379
|
+
trade_name: string | null;
|
|
380
|
+
email: string | null;
|
|
381
|
+
phone: string | null;
|
|
382
|
+
address: string | null;
|
|
383
|
+
city_code: string | null;
|
|
384
|
+
department_code: string | null;
|
|
385
|
+
country_code: string;
|
|
386
|
+
postal_code: string | null;
|
|
387
|
+
fiscal_responsibility: string[];
|
|
388
|
+
organization_type: string | null;
|
|
389
|
+
metadata: Record<string, unknown>;
|
|
390
|
+
deleted: boolean;
|
|
391
|
+
deleted_at: string | null;
|
|
392
|
+
created_at: string;
|
|
393
|
+
updated_at: string;
|
|
394
|
+
}[];
|
|
395
|
+
has_more: boolean;
|
|
396
|
+
next_cursor: string | null;
|
|
397
|
+
}, {
|
|
398
|
+
data: {
|
|
399
|
+
object: "customer";
|
|
400
|
+
id: string;
|
|
401
|
+
livemode: boolean;
|
|
402
|
+
identification: {
|
|
403
|
+
number: string;
|
|
404
|
+
type: string;
|
|
405
|
+
check_digit?: string | undefined;
|
|
406
|
+
};
|
|
407
|
+
legal_name: string;
|
|
408
|
+
trade_name: string | null;
|
|
409
|
+
email: string | null;
|
|
410
|
+
phone: string | null;
|
|
411
|
+
address: string | null;
|
|
412
|
+
city_code: string | null;
|
|
413
|
+
department_code: string | null;
|
|
414
|
+
country_code: string;
|
|
415
|
+
postal_code: string | null;
|
|
416
|
+
fiscal_responsibility: string[];
|
|
417
|
+
organization_type: string | null;
|
|
418
|
+
metadata: Record<string, unknown>;
|
|
419
|
+
deleted: boolean;
|
|
420
|
+
deleted_at: string | null;
|
|
421
|
+
created_at: string;
|
|
422
|
+
updated_at: string;
|
|
423
|
+
}[];
|
|
424
|
+
has_more: boolean;
|
|
425
|
+
next_cursor: string | null;
|
|
426
|
+
}>;
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* catalogs.ts — OpenAPI path registrations for the catalogs resource.
|
|
430
|
+
*
|
|
431
|
+
* Spec: catalogs-resource/spec.md
|
|
432
|
+
* Design: STANDARDS §2 molde (read-only, unauthenticated @Public() endpoints).
|
|
433
|
+
*
|
|
434
|
+
* Side-effect: registers paths in the global registry when this module is imported.
|
|
435
|
+
*/
|
|
436
|
+
declare const CatalogItemSchema: z.ZodObject<{
|
|
437
|
+
code: z.ZodString;
|
|
438
|
+
name: z.ZodString;
|
|
439
|
+
}, "strip", z.ZodTypeAny, {
|
|
440
|
+
code: string;
|
|
441
|
+
name: string;
|
|
442
|
+
}, {
|
|
443
|
+
code: string;
|
|
444
|
+
name: string;
|
|
445
|
+
}>;
|
|
446
|
+
declare const CatalogListResponseSchema: z.ZodObject<{
|
|
447
|
+
data: z.ZodArray<z.ZodObject<{
|
|
448
|
+
code: z.ZodString;
|
|
449
|
+
name: z.ZodString;
|
|
450
|
+
}, "strip", z.ZodTypeAny, {
|
|
451
|
+
code: string;
|
|
452
|
+
name: string;
|
|
453
|
+
}, {
|
|
454
|
+
code: string;
|
|
455
|
+
name: string;
|
|
456
|
+
}>, "many">;
|
|
457
|
+
}, "strip", z.ZodTypeAny, {
|
|
458
|
+
data: {
|
|
459
|
+
code: string;
|
|
460
|
+
name: string;
|
|
461
|
+
}[];
|
|
462
|
+
}, {
|
|
463
|
+
data: {
|
|
464
|
+
code: string;
|
|
465
|
+
name: string;
|
|
466
|
+
}[];
|
|
467
|
+
}>;
|
|
468
|
+
declare const MunicipioItemSchema: z.ZodObject<{
|
|
469
|
+
code: z.ZodString;
|
|
470
|
+
name: z.ZodString;
|
|
471
|
+
department_code: z.ZodString;
|
|
472
|
+
}, "strip", z.ZodTypeAny, {
|
|
473
|
+
code: string;
|
|
474
|
+
name: string;
|
|
475
|
+
department_code: string;
|
|
476
|
+
}, {
|
|
477
|
+
code: string;
|
|
478
|
+
name: string;
|
|
479
|
+
department_code: string;
|
|
480
|
+
}>;
|
|
481
|
+
declare const MunicipioListResponseSchema: z.ZodObject<{
|
|
482
|
+
data: z.ZodArray<z.ZodObject<{
|
|
483
|
+
code: z.ZodString;
|
|
484
|
+
name: z.ZodString;
|
|
485
|
+
department_code: z.ZodString;
|
|
486
|
+
}, "strip", z.ZodTypeAny, {
|
|
487
|
+
code: string;
|
|
488
|
+
name: string;
|
|
489
|
+
department_code: string;
|
|
490
|
+
}, {
|
|
491
|
+
code: string;
|
|
492
|
+
name: string;
|
|
493
|
+
department_code: string;
|
|
494
|
+
}>, "many">;
|
|
495
|
+
}, "strip", z.ZodTypeAny, {
|
|
496
|
+
data: {
|
|
497
|
+
code: string;
|
|
498
|
+
name: string;
|
|
499
|
+
department_code: string;
|
|
500
|
+
}[];
|
|
501
|
+
}, {
|
|
502
|
+
data: {
|
|
503
|
+
code: string;
|
|
504
|
+
name: string;
|
|
505
|
+
department_code: string;
|
|
506
|
+
}[];
|
|
507
|
+
}>;
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* numbering-resolutions.ts — OpenAPI path registrations for the numbering-resolutions resource.
|
|
511
|
+
*
|
|
512
|
+
* Spec: numbering-resolutions-resource/spec.md
|
|
513
|
+
* Design: ADR-3 (ClTec write-only; never in response).
|
|
514
|
+
*
|
|
515
|
+
* Trust boundary:
|
|
516
|
+
* - technical_key is present in POST request body (write-only).
|
|
517
|
+
* - NumberingResolutionResponse DOES NOT include technical_key or technical_key_ciphertext.
|
|
518
|
+
*
|
|
519
|
+
* Side-effect: registers paths in the global registry when this module is imported.
|
|
520
|
+
*/
|
|
521
|
+
declare const NumberingResolutionResponseSchema: z.ZodObject<{
|
|
522
|
+
id: z.ZodString;
|
|
523
|
+
object: z.ZodLiteral<"numbering_resolution">;
|
|
524
|
+
livemode: z.ZodBoolean;
|
|
525
|
+
resolution_number: z.ZodString;
|
|
526
|
+
prefix: z.ZodString;
|
|
527
|
+
document_type: z.ZodString;
|
|
528
|
+
range_from: z.ZodNumber;
|
|
529
|
+
range_to: z.ZodNumber;
|
|
530
|
+
valid_from: z.ZodString;
|
|
531
|
+
valid_to: z.ZodString;
|
|
532
|
+
environment: z.ZodString;
|
|
533
|
+
is_active: z.ZodBoolean;
|
|
534
|
+
created_at: z.ZodString;
|
|
535
|
+
updated_at: z.ZodString;
|
|
536
|
+
}, "strip", z.ZodTypeAny, {
|
|
537
|
+
object: "numbering_resolution";
|
|
538
|
+
id: string;
|
|
539
|
+
livemode: boolean;
|
|
540
|
+
created_at: string;
|
|
541
|
+
updated_at: string;
|
|
542
|
+
resolution_number: string;
|
|
543
|
+
prefix: string;
|
|
544
|
+
document_type: string;
|
|
545
|
+
range_from: number;
|
|
546
|
+
range_to: number;
|
|
547
|
+
valid_from: string;
|
|
548
|
+
valid_to: string;
|
|
549
|
+
environment: string;
|
|
550
|
+
is_active: boolean;
|
|
551
|
+
}, {
|
|
552
|
+
object: "numbering_resolution";
|
|
553
|
+
id: string;
|
|
554
|
+
livemode: boolean;
|
|
555
|
+
created_at: string;
|
|
556
|
+
updated_at: string;
|
|
557
|
+
resolution_number: string;
|
|
558
|
+
prefix: string;
|
|
559
|
+
document_type: string;
|
|
560
|
+
range_from: number;
|
|
561
|
+
range_to: number;
|
|
562
|
+
valid_from: string;
|
|
563
|
+
valid_to: string;
|
|
564
|
+
environment: string;
|
|
565
|
+
is_active: boolean;
|
|
566
|
+
}>;
|
|
567
|
+
declare const CreateNumberingResolutionRequestSchema: z.ZodObject<{
|
|
568
|
+
resolution_number: z.ZodString;
|
|
569
|
+
prefix: z.ZodDefault<z.ZodString>;
|
|
570
|
+
document_type: z.ZodEnum<["01", "91", "92"]>;
|
|
571
|
+
technical_key: z.ZodString;
|
|
572
|
+
range_from: z.ZodNumber;
|
|
573
|
+
range_to: z.ZodNumber;
|
|
574
|
+
valid_from: z.ZodString;
|
|
575
|
+
valid_to: z.ZodString;
|
|
576
|
+
environment: z.ZodEnum<["production", "habilitacion"]>;
|
|
577
|
+
}, "strip", z.ZodTypeAny, {
|
|
578
|
+
resolution_number: string;
|
|
579
|
+
prefix: string;
|
|
580
|
+
document_type: "01" | "91" | "92";
|
|
581
|
+
range_from: number;
|
|
582
|
+
range_to: number;
|
|
583
|
+
valid_from: string;
|
|
584
|
+
valid_to: string;
|
|
585
|
+
environment: "habilitacion" | "production";
|
|
586
|
+
technical_key: string;
|
|
587
|
+
}, {
|
|
588
|
+
resolution_number: string;
|
|
589
|
+
document_type: "01" | "91" | "92";
|
|
590
|
+
range_from: number;
|
|
591
|
+
range_to: number;
|
|
592
|
+
valid_from: string;
|
|
593
|
+
valid_to: string;
|
|
594
|
+
environment: "habilitacion" | "production";
|
|
595
|
+
technical_key: string;
|
|
596
|
+
prefix?: string | undefined;
|
|
597
|
+
}>;
|
|
598
|
+
declare const NumberingResolutionListResponseSchema: z.ZodObject<{
|
|
599
|
+
data: z.ZodArray<z.ZodObject<{
|
|
600
|
+
id: z.ZodString;
|
|
601
|
+
object: z.ZodLiteral<"numbering_resolution">;
|
|
602
|
+
livemode: z.ZodBoolean;
|
|
603
|
+
resolution_number: z.ZodString;
|
|
604
|
+
prefix: z.ZodString;
|
|
605
|
+
document_type: z.ZodString;
|
|
606
|
+
range_from: z.ZodNumber;
|
|
607
|
+
range_to: z.ZodNumber;
|
|
608
|
+
valid_from: z.ZodString;
|
|
609
|
+
valid_to: z.ZodString;
|
|
610
|
+
environment: z.ZodString;
|
|
611
|
+
is_active: z.ZodBoolean;
|
|
612
|
+
created_at: z.ZodString;
|
|
613
|
+
updated_at: z.ZodString;
|
|
614
|
+
}, "strip", z.ZodTypeAny, {
|
|
615
|
+
object: "numbering_resolution";
|
|
616
|
+
id: string;
|
|
617
|
+
livemode: boolean;
|
|
618
|
+
created_at: string;
|
|
619
|
+
updated_at: string;
|
|
620
|
+
resolution_number: string;
|
|
621
|
+
prefix: string;
|
|
622
|
+
document_type: string;
|
|
623
|
+
range_from: number;
|
|
624
|
+
range_to: number;
|
|
625
|
+
valid_from: string;
|
|
626
|
+
valid_to: string;
|
|
627
|
+
environment: string;
|
|
628
|
+
is_active: boolean;
|
|
629
|
+
}, {
|
|
630
|
+
object: "numbering_resolution";
|
|
631
|
+
id: string;
|
|
632
|
+
livemode: boolean;
|
|
633
|
+
created_at: string;
|
|
634
|
+
updated_at: string;
|
|
635
|
+
resolution_number: string;
|
|
636
|
+
prefix: string;
|
|
637
|
+
document_type: string;
|
|
638
|
+
range_from: number;
|
|
639
|
+
range_to: number;
|
|
640
|
+
valid_from: string;
|
|
641
|
+
valid_to: string;
|
|
642
|
+
environment: string;
|
|
643
|
+
is_active: boolean;
|
|
644
|
+
}>, "many">;
|
|
645
|
+
has_more: z.ZodBoolean;
|
|
646
|
+
next_cursor: z.ZodNullable<z.ZodString>;
|
|
647
|
+
}, "strip", z.ZodTypeAny, {
|
|
648
|
+
data: {
|
|
649
|
+
object: "numbering_resolution";
|
|
650
|
+
id: string;
|
|
651
|
+
livemode: boolean;
|
|
652
|
+
created_at: string;
|
|
653
|
+
updated_at: string;
|
|
654
|
+
resolution_number: string;
|
|
655
|
+
prefix: string;
|
|
656
|
+
document_type: string;
|
|
657
|
+
range_from: number;
|
|
658
|
+
range_to: number;
|
|
659
|
+
valid_from: string;
|
|
660
|
+
valid_to: string;
|
|
661
|
+
environment: string;
|
|
662
|
+
is_active: boolean;
|
|
663
|
+
}[];
|
|
664
|
+
has_more: boolean;
|
|
665
|
+
next_cursor: string | null;
|
|
666
|
+
}, {
|
|
667
|
+
data: {
|
|
668
|
+
object: "numbering_resolution";
|
|
669
|
+
id: string;
|
|
670
|
+
livemode: boolean;
|
|
671
|
+
created_at: string;
|
|
672
|
+
updated_at: string;
|
|
673
|
+
resolution_number: string;
|
|
674
|
+
prefix: string;
|
|
675
|
+
document_type: string;
|
|
676
|
+
range_from: number;
|
|
677
|
+
range_to: number;
|
|
678
|
+
valid_from: string;
|
|
679
|
+
valid_to: string;
|
|
680
|
+
environment: string;
|
|
681
|
+
is_active: boolean;
|
|
682
|
+
}[];
|
|
683
|
+
has_more: boolean;
|
|
684
|
+
next_cursor: string | null;
|
|
685
|
+
}>;
|
|
686
|
+
|
|
687
|
+
/**
|
|
688
|
+
* certificates.ts — OpenAPI path registrations for the certificates resource.
|
|
689
|
+
*
|
|
690
|
+
* Spec: certificates-resource/spec.md
|
|
691
|
+
* Design: ADR-4 (base64 JSON body; parse-before-encrypt; zeroize; redact).
|
|
692
|
+
*
|
|
693
|
+
* Trust boundary:
|
|
694
|
+
* - content_base64 and password are WRITE-ONLY (present in POST request body).
|
|
695
|
+
* - CertificateResponse does NOT include content_base64, password, r2_key,
|
|
696
|
+
* vault_transit_key, p12_passphrase_ciphertext, or software_pin_ciphertext.
|
|
697
|
+
*
|
|
698
|
+
* Side-effect: registers paths in the global registry when this module is imported.
|
|
699
|
+
*
|
|
700
|
+
* Endpoints registered (PR3a + PR3b):
|
|
701
|
+
* POST /v1/certificates — upload
|
|
702
|
+
* GET /v1/certificates — list (paginated, excludes deleted)
|
|
703
|
+
* GET /v1/certificates/{id} — get by id
|
|
704
|
+
* POST /v1/certificates/{id}/activate — activate (200, last-activation-wins)
|
|
705
|
+
* DELETE /v1/certificates/{id} — soft-delete (200, inactive only)
|
|
706
|
+
*/
|
|
707
|
+
declare const CertificateResponseSchema: z.ZodObject<{
|
|
708
|
+
id: z.ZodString;
|
|
709
|
+
object: z.ZodLiteral<"certificate">;
|
|
710
|
+
livemode: z.ZodBoolean;
|
|
711
|
+
filename: z.ZodString;
|
|
712
|
+
subject_dn: z.ZodString;
|
|
713
|
+
issuer_dn: z.ZodString;
|
|
714
|
+
serial_number: z.ZodString;
|
|
715
|
+
fingerprint_sha256: z.ZodString;
|
|
716
|
+
valid_from: z.ZodString;
|
|
717
|
+
valid_until: z.ZodString;
|
|
718
|
+
is_active: z.ZodBoolean;
|
|
719
|
+
deleted: z.ZodBoolean;
|
|
720
|
+
deleted_at: z.ZodNullable<z.ZodString>;
|
|
721
|
+
created_at: z.ZodString;
|
|
722
|
+
updated_at: z.ZodString;
|
|
723
|
+
}, "strip", z.ZodTypeAny, {
|
|
724
|
+
object: "certificate";
|
|
725
|
+
id: string;
|
|
726
|
+
livemode: boolean;
|
|
727
|
+
deleted: boolean;
|
|
728
|
+
deleted_at: string | null;
|
|
729
|
+
created_at: string;
|
|
730
|
+
updated_at: string;
|
|
731
|
+
valid_from: string;
|
|
732
|
+
is_active: boolean;
|
|
733
|
+
filename: string;
|
|
734
|
+
subject_dn: string;
|
|
735
|
+
issuer_dn: string;
|
|
736
|
+
serial_number: string;
|
|
737
|
+
fingerprint_sha256: string;
|
|
738
|
+
valid_until: string;
|
|
739
|
+
}, {
|
|
740
|
+
object: "certificate";
|
|
741
|
+
id: string;
|
|
742
|
+
livemode: boolean;
|
|
743
|
+
deleted: boolean;
|
|
744
|
+
deleted_at: string | null;
|
|
745
|
+
created_at: string;
|
|
746
|
+
updated_at: string;
|
|
747
|
+
valid_from: string;
|
|
748
|
+
is_active: boolean;
|
|
749
|
+
filename: string;
|
|
750
|
+
subject_dn: string;
|
|
751
|
+
issuer_dn: string;
|
|
752
|
+
serial_number: string;
|
|
753
|
+
fingerprint_sha256: string;
|
|
754
|
+
valid_until: string;
|
|
755
|
+
}>;
|
|
756
|
+
declare const CreateCertificateRequestSchema: z.ZodObject<{
|
|
757
|
+
filename: z.ZodString;
|
|
758
|
+
content_base64: z.ZodString;
|
|
759
|
+
password: z.ZodString;
|
|
760
|
+
}, "strip", z.ZodTypeAny, {
|
|
761
|
+
password: string;
|
|
762
|
+
filename: string;
|
|
763
|
+
content_base64: string;
|
|
764
|
+
}, {
|
|
765
|
+
password: string;
|
|
766
|
+
filename: string;
|
|
767
|
+
content_base64: string;
|
|
768
|
+
}>;
|
|
769
|
+
declare const CertificateListResponseSchema: z.ZodObject<{
|
|
770
|
+
data: z.ZodArray<z.ZodObject<{
|
|
771
|
+
id: z.ZodString;
|
|
772
|
+
object: z.ZodLiteral<"certificate">;
|
|
773
|
+
livemode: z.ZodBoolean;
|
|
774
|
+
filename: z.ZodString;
|
|
775
|
+
subject_dn: z.ZodString;
|
|
776
|
+
issuer_dn: z.ZodString;
|
|
777
|
+
serial_number: z.ZodString;
|
|
778
|
+
fingerprint_sha256: z.ZodString;
|
|
779
|
+
valid_from: z.ZodString;
|
|
780
|
+
valid_until: z.ZodString;
|
|
781
|
+
is_active: z.ZodBoolean;
|
|
782
|
+
deleted: z.ZodBoolean;
|
|
783
|
+
deleted_at: z.ZodNullable<z.ZodString>;
|
|
784
|
+
created_at: z.ZodString;
|
|
785
|
+
updated_at: z.ZodString;
|
|
786
|
+
}, "strip", z.ZodTypeAny, {
|
|
787
|
+
object: "certificate";
|
|
788
|
+
id: string;
|
|
789
|
+
livemode: boolean;
|
|
790
|
+
deleted: boolean;
|
|
791
|
+
deleted_at: string | null;
|
|
792
|
+
created_at: string;
|
|
793
|
+
updated_at: string;
|
|
794
|
+
valid_from: string;
|
|
795
|
+
is_active: boolean;
|
|
796
|
+
filename: string;
|
|
797
|
+
subject_dn: string;
|
|
798
|
+
issuer_dn: string;
|
|
799
|
+
serial_number: string;
|
|
800
|
+
fingerprint_sha256: string;
|
|
801
|
+
valid_until: string;
|
|
802
|
+
}, {
|
|
803
|
+
object: "certificate";
|
|
804
|
+
id: string;
|
|
805
|
+
livemode: boolean;
|
|
806
|
+
deleted: boolean;
|
|
807
|
+
deleted_at: string | null;
|
|
808
|
+
created_at: string;
|
|
809
|
+
updated_at: string;
|
|
810
|
+
valid_from: string;
|
|
811
|
+
is_active: boolean;
|
|
812
|
+
filename: string;
|
|
813
|
+
subject_dn: string;
|
|
814
|
+
issuer_dn: string;
|
|
815
|
+
serial_number: string;
|
|
816
|
+
fingerprint_sha256: string;
|
|
817
|
+
valid_until: string;
|
|
818
|
+
}>, "many">;
|
|
819
|
+
has_more: z.ZodBoolean;
|
|
820
|
+
next_cursor: z.ZodNullable<z.ZodString>;
|
|
821
|
+
}, "strip", z.ZodTypeAny, {
|
|
822
|
+
data: {
|
|
823
|
+
object: "certificate";
|
|
824
|
+
id: string;
|
|
825
|
+
livemode: boolean;
|
|
826
|
+
deleted: boolean;
|
|
827
|
+
deleted_at: string | null;
|
|
828
|
+
created_at: string;
|
|
829
|
+
updated_at: string;
|
|
830
|
+
valid_from: string;
|
|
831
|
+
is_active: boolean;
|
|
832
|
+
filename: string;
|
|
833
|
+
subject_dn: string;
|
|
834
|
+
issuer_dn: string;
|
|
835
|
+
serial_number: string;
|
|
836
|
+
fingerprint_sha256: string;
|
|
837
|
+
valid_until: string;
|
|
838
|
+
}[];
|
|
839
|
+
has_more: boolean;
|
|
840
|
+
next_cursor: string | null;
|
|
841
|
+
}, {
|
|
842
|
+
data: {
|
|
843
|
+
object: "certificate";
|
|
844
|
+
id: string;
|
|
845
|
+
livemode: boolean;
|
|
846
|
+
deleted: boolean;
|
|
847
|
+
deleted_at: string | null;
|
|
848
|
+
created_at: string;
|
|
849
|
+
updated_at: string;
|
|
850
|
+
valid_from: string;
|
|
851
|
+
is_active: boolean;
|
|
852
|
+
filename: string;
|
|
853
|
+
subject_dn: string;
|
|
854
|
+
issuer_dn: string;
|
|
855
|
+
serial_number: string;
|
|
856
|
+
fingerprint_sha256: string;
|
|
857
|
+
valid_until: string;
|
|
858
|
+
}[];
|
|
859
|
+
has_more: boolean;
|
|
860
|
+
next_cursor: string | null;
|
|
861
|
+
}>;
|
|
862
|
+
|
|
863
|
+
declare const CreateCreditNoteRequestSchema: z.ZodObject<{
|
|
864
|
+
reference_invoice_id: z.ZodString;
|
|
865
|
+
customer_id: z.ZodString;
|
|
866
|
+
prefix: z.ZodDefault<z.ZodString>;
|
|
867
|
+
discrepancy_response_code: z.ZodEnum<["1", "2", "3", "4", "5"]>;
|
|
868
|
+
discrepancy_description: z.ZodOptional<z.ZodString>;
|
|
869
|
+
currency: z.ZodDefault<z.ZodEnum<["COP"]>>;
|
|
870
|
+
notes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
871
|
+
lines: z.ZodArray<z.ZodObject<{
|
|
872
|
+
description: z.ZodString;
|
|
873
|
+
sku: z.ZodOptional<z.ZodString>;
|
|
874
|
+
quantity: z.ZodString;
|
|
875
|
+
unit_code: z.ZodDefault<z.ZodString>;
|
|
876
|
+
unit_price: z.ZodString;
|
|
877
|
+
line_extension_amount: z.ZodString;
|
|
878
|
+
taxes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
879
|
+
code: z.ZodString;
|
|
880
|
+
rate: z.ZodString;
|
|
881
|
+
base: z.ZodString;
|
|
882
|
+
value: z.ZodString;
|
|
883
|
+
}, "strip", z.ZodTypeAny, {
|
|
884
|
+
code: string;
|
|
885
|
+
value: string;
|
|
886
|
+
rate: string;
|
|
887
|
+
base: string;
|
|
888
|
+
}, {
|
|
889
|
+
code: string;
|
|
890
|
+
value: string;
|
|
891
|
+
rate: string;
|
|
892
|
+
base: string;
|
|
893
|
+
}>, "many">>;
|
|
894
|
+
}, "strip", z.ZodTypeAny, {
|
|
895
|
+
description: string;
|
|
896
|
+
quantity: string;
|
|
897
|
+
unit_code: string;
|
|
898
|
+
unit_price: string;
|
|
899
|
+
line_extension_amount: string;
|
|
900
|
+
taxes: {
|
|
901
|
+
code: string;
|
|
902
|
+
value: string;
|
|
903
|
+
rate: string;
|
|
904
|
+
base: string;
|
|
905
|
+
}[];
|
|
906
|
+
sku?: string | undefined;
|
|
907
|
+
}, {
|
|
908
|
+
description: string;
|
|
909
|
+
quantity: string;
|
|
910
|
+
unit_price: string;
|
|
911
|
+
line_extension_amount: string;
|
|
912
|
+
sku?: string | undefined;
|
|
913
|
+
unit_code?: string | undefined;
|
|
914
|
+
taxes?: {
|
|
915
|
+
code: string;
|
|
916
|
+
value: string;
|
|
917
|
+
rate: string;
|
|
918
|
+
base: string;
|
|
919
|
+
}[] | undefined;
|
|
920
|
+
}>, "many">;
|
|
921
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
922
|
+
}, "strip", z.ZodTypeAny, {
|
|
923
|
+
prefix: string;
|
|
924
|
+
customer_id: string;
|
|
925
|
+
currency: "COP";
|
|
926
|
+
lines: {
|
|
927
|
+
description: string;
|
|
928
|
+
quantity: string;
|
|
929
|
+
unit_code: string;
|
|
930
|
+
unit_price: string;
|
|
931
|
+
line_extension_amount: string;
|
|
932
|
+
taxes: {
|
|
933
|
+
code: string;
|
|
934
|
+
value: string;
|
|
935
|
+
rate: string;
|
|
936
|
+
base: string;
|
|
937
|
+
}[];
|
|
938
|
+
sku?: string | undefined;
|
|
939
|
+
}[];
|
|
940
|
+
reference_invoice_id: string;
|
|
941
|
+
discrepancy_response_code: "1" | "2" | "3" | "4" | "5";
|
|
942
|
+
metadata?: Record<string, unknown> | undefined;
|
|
943
|
+
notes?: string[] | undefined;
|
|
944
|
+
discrepancy_description?: string | undefined;
|
|
945
|
+
}, {
|
|
946
|
+
customer_id: string;
|
|
947
|
+
lines: {
|
|
948
|
+
description: string;
|
|
949
|
+
quantity: string;
|
|
950
|
+
unit_price: string;
|
|
951
|
+
line_extension_amount: string;
|
|
952
|
+
sku?: string | undefined;
|
|
953
|
+
unit_code?: string | undefined;
|
|
954
|
+
taxes?: {
|
|
955
|
+
code: string;
|
|
956
|
+
value: string;
|
|
957
|
+
rate: string;
|
|
958
|
+
base: string;
|
|
959
|
+
}[] | undefined;
|
|
960
|
+
}[];
|
|
961
|
+
reference_invoice_id: string;
|
|
962
|
+
discrepancy_response_code: "1" | "2" | "3" | "4" | "5";
|
|
963
|
+
metadata?: Record<string, unknown> | undefined;
|
|
964
|
+
prefix?: string | undefined;
|
|
965
|
+
currency?: "COP" | undefined;
|
|
966
|
+
notes?: string[] | undefined;
|
|
967
|
+
discrepancy_description?: string | undefined;
|
|
968
|
+
}>;
|
|
969
|
+
declare const CreditNoteResponseSchema: z.ZodObject<{
|
|
970
|
+
id: z.ZodString;
|
|
971
|
+
object: z.ZodLiteral<"credit_note">;
|
|
972
|
+
livemode: z.ZodBoolean;
|
|
973
|
+
status: z.ZodEnum<["draft", "processing", "signed", "accepted_by_dian", "rejected_by_dian", "accepted_contingency", "failed"]>;
|
|
974
|
+
full_number: z.ZodString;
|
|
975
|
+
cude: z.ZodNullable<z.ZodString>;
|
|
976
|
+
reference_invoice_id: z.ZodString;
|
|
977
|
+
customer_id: z.ZodString;
|
|
978
|
+
prefix: z.ZodString;
|
|
979
|
+
numbering_resolution_id: z.ZodString;
|
|
980
|
+
discrepancy_response_code: z.ZodString;
|
|
981
|
+
discrepancy_description: z.ZodNullable<z.ZodString>;
|
|
982
|
+
issue_date: z.ZodString;
|
|
983
|
+
currency_code: z.ZodString;
|
|
984
|
+
environment: z.ZodString;
|
|
985
|
+
payable_amount: z.ZodString;
|
|
986
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
987
|
+
created_at: z.ZodString;
|
|
988
|
+
updated_at: z.ZodString;
|
|
989
|
+
}, "strip", z.ZodTypeAny, {
|
|
990
|
+
object: "credit_note";
|
|
991
|
+
id: string;
|
|
992
|
+
status: "draft" | "processing" | "signed" | "accepted_by_dian" | "rejected_by_dian" | "accepted_contingency" | "failed";
|
|
993
|
+
livemode: boolean;
|
|
994
|
+
metadata: Record<string, unknown>;
|
|
995
|
+
created_at: string;
|
|
996
|
+
updated_at: string;
|
|
997
|
+
prefix: string;
|
|
998
|
+
environment: string;
|
|
999
|
+
full_number: string;
|
|
1000
|
+
customer_id: string;
|
|
1001
|
+
numbering_resolution_id: string;
|
|
1002
|
+
issue_date: string;
|
|
1003
|
+
currency_code: string;
|
|
1004
|
+
payable_amount: string;
|
|
1005
|
+
reference_invoice_id: string;
|
|
1006
|
+
discrepancy_response_code: string;
|
|
1007
|
+
discrepancy_description: string | null;
|
|
1008
|
+
cude: string | null;
|
|
1009
|
+
}, {
|
|
1010
|
+
object: "credit_note";
|
|
1011
|
+
id: string;
|
|
1012
|
+
status: "draft" | "processing" | "signed" | "accepted_by_dian" | "rejected_by_dian" | "accepted_contingency" | "failed";
|
|
1013
|
+
livemode: boolean;
|
|
1014
|
+
metadata: Record<string, unknown>;
|
|
1015
|
+
created_at: string;
|
|
1016
|
+
updated_at: string;
|
|
1017
|
+
prefix: string;
|
|
1018
|
+
environment: string;
|
|
1019
|
+
full_number: string;
|
|
1020
|
+
customer_id: string;
|
|
1021
|
+
numbering_resolution_id: string;
|
|
1022
|
+
issue_date: string;
|
|
1023
|
+
currency_code: string;
|
|
1024
|
+
payable_amount: string;
|
|
1025
|
+
reference_invoice_id: string;
|
|
1026
|
+
discrepancy_response_code: string;
|
|
1027
|
+
discrepancy_description: string | null;
|
|
1028
|
+
cude: string | null;
|
|
1029
|
+
}>;
|
|
1030
|
+
declare const CreditNoteDetailResponseSchema: z.ZodObject<{
|
|
1031
|
+
id: z.ZodString;
|
|
1032
|
+
object: z.ZodLiteral<"credit_note">;
|
|
1033
|
+
livemode: z.ZodBoolean;
|
|
1034
|
+
status: z.ZodEnum<["draft", "processing", "signed", "accepted_by_dian", "rejected_by_dian", "accepted_contingency", "failed"]>;
|
|
1035
|
+
full_number: z.ZodString;
|
|
1036
|
+
cude: z.ZodNullable<z.ZodString>;
|
|
1037
|
+
reference_invoice_id: z.ZodString;
|
|
1038
|
+
customer_id: z.ZodString;
|
|
1039
|
+
prefix: z.ZodString;
|
|
1040
|
+
numbering_resolution_id: z.ZodString;
|
|
1041
|
+
discrepancy_response_code: z.ZodString;
|
|
1042
|
+
discrepancy_description: z.ZodNullable<z.ZodString>;
|
|
1043
|
+
issue_date: z.ZodString;
|
|
1044
|
+
currency_code: z.ZodString;
|
|
1045
|
+
environment: z.ZodString;
|
|
1046
|
+
payable_amount: z.ZodString;
|
|
1047
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1048
|
+
created_at: z.ZodString;
|
|
1049
|
+
updated_at: z.ZodString;
|
|
1050
|
+
} & {
|
|
1051
|
+
dian_response: z.ZodNullable<z.ZodObject<{
|
|
1052
|
+
track_id: z.ZodNullable<z.ZodString>;
|
|
1053
|
+
status_code: z.ZodNullable<z.ZodString>;
|
|
1054
|
+
status_description: z.ZodNullable<z.ZodString>;
|
|
1055
|
+
is_valid: z.ZodBoolean;
|
|
1056
|
+
validated_at: z.ZodNullable<z.ZodString>;
|
|
1057
|
+
errors: z.ZodArray<z.ZodObject<{
|
|
1058
|
+
code: z.ZodString;
|
|
1059
|
+
message: z.ZodString;
|
|
1060
|
+
}, "strip", z.ZodTypeAny, {
|
|
1061
|
+
code: string;
|
|
1062
|
+
message: string;
|
|
1063
|
+
}, {
|
|
1064
|
+
code: string;
|
|
1065
|
+
message: string;
|
|
1066
|
+
}>, "many">;
|
|
1067
|
+
warnings: z.ZodArray<z.ZodObject<{
|
|
1068
|
+
code: z.ZodString;
|
|
1069
|
+
message: z.ZodString;
|
|
1070
|
+
}, "strip", z.ZodTypeAny, {
|
|
1071
|
+
code: string;
|
|
1072
|
+
message: string;
|
|
1073
|
+
}, {
|
|
1074
|
+
code: string;
|
|
1075
|
+
message: string;
|
|
1076
|
+
}>, "many">;
|
|
1077
|
+
}, "strip", z.ZodTypeAny, {
|
|
1078
|
+
errors: {
|
|
1079
|
+
code: string;
|
|
1080
|
+
message: string;
|
|
1081
|
+
}[];
|
|
1082
|
+
track_id: string | null;
|
|
1083
|
+
status_code: string | null;
|
|
1084
|
+
status_description: string | null;
|
|
1085
|
+
is_valid: boolean;
|
|
1086
|
+
validated_at: string | null;
|
|
1087
|
+
warnings: {
|
|
1088
|
+
code: string;
|
|
1089
|
+
message: string;
|
|
1090
|
+
}[];
|
|
1091
|
+
}, {
|
|
1092
|
+
errors: {
|
|
1093
|
+
code: string;
|
|
1094
|
+
message: string;
|
|
1095
|
+
}[];
|
|
1096
|
+
track_id: string | null;
|
|
1097
|
+
status_code: string | null;
|
|
1098
|
+
status_description: string | null;
|
|
1099
|
+
is_valid: boolean;
|
|
1100
|
+
validated_at: string | null;
|
|
1101
|
+
warnings: {
|
|
1102
|
+
code: string;
|
|
1103
|
+
message: string;
|
|
1104
|
+
}[];
|
|
1105
|
+
}>>;
|
|
1106
|
+
has_xml: z.ZodBoolean;
|
|
1107
|
+
has_pdf: z.ZodBoolean;
|
|
1108
|
+
qr_url: z.ZodNullable<z.ZodString>;
|
|
1109
|
+
}, "strip", z.ZodTypeAny, {
|
|
1110
|
+
object: "credit_note";
|
|
1111
|
+
id: string;
|
|
1112
|
+
status: "draft" | "processing" | "signed" | "accepted_by_dian" | "rejected_by_dian" | "accepted_contingency" | "failed";
|
|
1113
|
+
livemode: boolean;
|
|
1114
|
+
metadata: Record<string, unknown>;
|
|
1115
|
+
created_at: string;
|
|
1116
|
+
updated_at: string;
|
|
1117
|
+
prefix: string;
|
|
1118
|
+
environment: string;
|
|
1119
|
+
full_number: string;
|
|
1120
|
+
customer_id: string;
|
|
1121
|
+
numbering_resolution_id: string;
|
|
1122
|
+
issue_date: string;
|
|
1123
|
+
currency_code: string;
|
|
1124
|
+
payable_amount: string;
|
|
1125
|
+
dian_response: {
|
|
1126
|
+
errors: {
|
|
1127
|
+
code: string;
|
|
1128
|
+
message: string;
|
|
1129
|
+
}[];
|
|
1130
|
+
track_id: string | null;
|
|
1131
|
+
status_code: string | null;
|
|
1132
|
+
status_description: string | null;
|
|
1133
|
+
is_valid: boolean;
|
|
1134
|
+
validated_at: string | null;
|
|
1135
|
+
warnings: {
|
|
1136
|
+
code: string;
|
|
1137
|
+
message: string;
|
|
1138
|
+
}[];
|
|
1139
|
+
} | null;
|
|
1140
|
+
has_xml: boolean;
|
|
1141
|
+
has_pdf: boolean;
|
|
1142
|
+
qr_url: string | null;
|
|
1143
|
+
reference_invoice_id: string;
|
|
1144
|
+
discrepancy_response_code: string;
|
|
1145
|
+
discrepancy_description: string | null;
|
|
1146
|
+
cude: string | null;
|
|
1147
|
+
}, {
|
|
1148
|
+
object: "credit_note";
|
|
1149
|
+
id: string;
|
|
1150
|
+
status: "draft" | "processing" | "signed" | "accepted_by_dian" | "rejected_by_dian" | "accepted_contingency" | "failed";
|
|
1151
|
+
livemode: boolean;
|
|
1152
|
+
metadata: Record<string, unknown>;
|
|
1153
|
+
created_at: string;
|
|
1154
|
+
updated_at: string;
|
|
1155
|
+
prefix: string;
|
|
1156
|
+
environment: string;
|
|
1157
|
+
full_number: string;
|
|
1158
|
+
customer_id: string;
|
|
1159
|
+
numbering_resolution_id: string;
|
|
1160
|
+
issue_date: string;
|
|
1161
|
+
currency_code: string;
|
|
1162
|
+
payable_amount: string;
|
|
1163
|
+
dian_response: {
|
|
1164
|
+
errors: {
|
|
1165
|
+
code: string;
|
|
1166
|
+
message: string;
|
|
1167
|
+
}[];
|
|
1168
|
+
track_id: string | null;
|
|
1169
|
+
status_code: string | null;
|
|
1170
|
+
status_description: string | null;
|
|
1171
|
+
is_valid: boolean;
|
|
1172
|
+
validated_at: string | null;
|
|
1173
|
+
warnings: {
|
|
1174
|
+
code: string;
|
|
1175
|
+
message: string;
|
|
1176
|
+
}[];
|
|
1177
|
+
} | null;
|
|
1178
|
+
has_xml: boolean;
|
|
1179
|
+
has_pdf: boolean;
|
|
1180
|
+
qr_url: string | null;
|
|
1181
|
+
reference_invoice_id: string;
|
|
1182
|
+
discrepancy_response_code: string;
|
|
1183
|
+
discrepancy_description: string | null;
|
|
1184
|
+
cude: string | null;
|
|
1185
|
+
}>;
|
|
1186
|
+
declare const CreditNoteListResponseSchema: z.ZodObject<{
|
|
1187
|
+
data: z.ZodArray<z.ZodObject<{
|
|
1188
|
+
id: z.ZodString;
|
|
1189
|
+
object: z.ZodLiteral<"credit_note">;
|
|
1190
|
+
livemode: z.ZodBoolean;
|
|
1191
|
+
status: z.ZodEnum<["draft", "processing", "signed", "accepted_by_dian", "rejected_by_dian", "accepted_contingency", "failed"]>;
|
|
1192
|
+
full_number: z.ZodString;
|
|
1193
|
+
cude: z.ZodNullable<z.ZodString>;
|
|
1194
|
+
reference_invoice_id: z.ZodString;
|
|
1195
|
+
customer_id: z.ZodString;
|
|
1196
|
+
prefix: z.ZodString;
|
|
1197
|
+
numbering_resolution_id: z.ZodString;
|
|
1198
|
+
discrepancy_response_code: z.ZodString;
|
|
1199
|
+
discrepancy_description: z.ZodNullable<z.ZodString>;
|
|
1200
|
+
issue_date: z.ZodString;
|
|
1201
|
+
currency_code: z.ZodString;
|
|
1202
|
+
environment: z.ZodString;
|
|
1203
|
+
payable_amount: z.ZodString;
|
|
1204
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1205
|
+
created_at: z.ZodString;
|
|
1206
|
+
updated_at: z.ZodString;
|
|
1207
|
+
} & {
|
|
1208
|
+
dian_response: z.ZodNullable<z.ZodObject<{
|
|
1209
|
+
track_id: z.ZodNullable<z.ZodString>;
|
|
1210
|
+
status_code: z.ZodNullable<z.ZodString>;
|
|
1211
|
+
status_description: z.ZodNullable<z.ZodString>;
|
|
1212
|
+
is_valid: z.ZodBoolean;
|
|
1213
|
+
validated_at: z.ZodNullable<z.ZodString>;
|
|
1214
|
+
errors: z.ZodArray<z.ZodObject<{
|
|
1215
|
+
code: z.ZodString;
|
|
1216
|
+
message: z.ZodString;
|
|
1217
|
+
}, "strip", z.ZodTypeAny, {
|
|
1218
|
+
code: string;
|
|
1219
|
+
message: string;
|
|
1220
|
+
}, {
|
|
1221
|
+
code: string;
|
|
1222
|
+
message: string;
|
|
1223
|
+
}>, "many">;
|
|
1224
|
+
warnings: z.ZodArray<z.ZodObject<{
|
|
1225
|
+
code: z.ZodString;
|
|
1226
|
+
message: z.ZodString;
|
|
1227
|
+
}, "strip", z.ZodTypeAny, {
|
|
1228
|
+
code: string;
|
|
1229
|
+
message: string;
|
|
1230
|
+
}, {
|
|
1231
|
+
code: string;
|
|
1232
|
+
message: string;
|
|
1233
|
+
}>, "many">;
|
|
1234
|
+
}, "strip", z.ZodTypeAny, {
|
|
1235
|
+
errors: {
|
|
1236
|
+
code: string;
|
|
1237
|
+
message: string;
|
|
1238
|
+
}[];
|
|
1239
|
+
track_id: string | null;
|
|
1240
|
+
status_code: string | null;
|
|
1241
|
+
status_description: string | null;
|
|
1242
|
+
is_valid: boolean;
|
|
1243
|
+
validated_at: string | null;
|
|
1244
|
+
warnings: {
|
|
1245
|
+
code: string;
|
|
1246
|
+
message: string;
|
|
1247
|
+
}[];
|
|
1248
|
+
}, {
|
|
1249
|
+
errors: {
|
|
1250
|
+
code: string;
|
|
1251
|
+
message: string;
|
|
1252
|
+
}[];
|
|
1253
|
+
track_id: string | null;
|
|
1254
|
+
status_code: string | null;
|
|
1255
|
+
status_description: string | null;
|
|
1256
|
+
is_valid: boolean;
|
|
1257
|
+
validated_at: string | null;
|
|
1258
|
+
warnings: {
|
|
1259
|
+
code: string;
|
|
1260
|
+
message: string;
|
|
1261
|
+
}[];
|
|
1262
|
+
}>>;
|
|
1263
|
+
has_xml: z.ZodBoolean;
|
|
1264
|
+
has_pdf: z.ZodBoolean;
|
|
1265
|
+
qr_url: z.ZodNullable<z.ZodString>;
|
|
1266
|
+
}, "strip", z.ZodTypeAny, {
|
|
1267
|
+
object: "credit_note";
|
|
1268
|
+
id: string;
|
|
1269
|
+
status: "draft" | "processing" | "signed" | "accepted_by_dian" | "rejected_by_dian" | "accepted_contingency" | "failed";
|
|
1270
|
+
livemode: boolean;
|
|
1271
|
+
metadata: Record<string, unknown>;
|
|
1272
|
+
created_at: string;
|
|
1273
|
+
updated_at: string;
|
|
1274
|
+
prefix: string;
|
|
1275
|
+
environment: string;
|
|
1276
|
+
full_number: string;
|
|
1277
|
+
customer_id: string;
|
|
1278
|
+
numbering_resolution_id: string;
|
|
1279
|
+
issue_date: string;
|
|
1280
|
+
currency_code: string;
|
|
1281
|
+
payable_amount: string;
|
|
1282
|
+
dian_response: {
|
|
1283
|
+
errors: {
|
|
1284
|
+
code: string;
|
|
1285
|
+
message: string;
|
|
1286
|
+
}[];
|
|
1287
|
+
track_id: string | null;
|
|
1288
|
+
status_code: string | null;
|
|
1289
|
+
status_description: string | null;
|
|
1290
|
+
is_valid: boolean;
|
|
1291
|
+
validated_at: string | null;
|
|
1292
|
+
warnings: {
|
|
1293
|
+
code: string;
|
|
1294
|
+
message: string;
|
|
1295
|
+
}[];
|
|
1296
|
+
} | null;
|
|
1297
|
+
has_xml: boolean;
|
|
1298
|
+
has_pdf: boolean;
|
|
1299
|
+
qr_url: string | null;
|
|
1300
|
+
reference_invoice_id: string;
|
|
1301
|
+
discrepancy_response_code: string;
|
|
1302
|
+
discrepancy_description: string | null;
|
|
1303
|
+
cude: string | null;
|
|
1304
|
+
}, {
|
|
1305
|
+
object: "credit_note";
|
|
1306
|
+
id: string;
|
|
1307
|
+
status: "draft" | "processing" | "signed" | "accepted_by_dian" | "rejected_by_dian" | "accepted_contingency" | "failed";
|
|
1308
|
+
livemode: boolean;
|
|
1309
|
+
metadata: Record<string, unknown>;
|
|
1310
|
+
created_at: string;
|
|
1311
|
+
updated_at: string;
|
|
1312
|
+
prefix: string;
|
|
1313
|
+
environment: string;
|
|
1314
|
+
full_number: string;
|
|
1315
|
+
customer_id: string;
|
|
1316
|
+
numbering_resolution_id: string;
|
|
1317
|
+
issue_date: string;
|
|
1318
|
+
currency_code: string;
|
|
1319
|
+
payable_amount: string;
|
|
1320
|
+
dian_response: {
|
|
1321
|
+
errors: {
|
|
1322
|
+
code: string;
|
|
1323
|
+
message: string;
|
|
1324
|
+
}[];
|
|
1325
|
+
track_id: string | null;
|
|
1326
|
+
status_code: string | null;
|
|
1327
|
+
status_description: string | null;
|
|
1328
|
+
is_valid: boolean;
|
|
1329
|
+
validated_at: string | null;
|
|
1330
|
+
warnings: {
|
|
1331
|
+
code: string;
|
|
1332
|
+
message: string;
|
|
1333
|
+
}[];
|
|
1334
|
+
} | null;
|
|
1335
|
+
has_xml: boolean;
|
|
1336
|
+
has_pdf: boolean;
|
|
1337
|
+
qr_url: string | null;
|
|
1338
|
+
reference_invoice_id: string;
|
|
1339
|
+
discrepancy_response_code: string;
|
|
1340
|
+
discrepancy_description: string | null;
|
|
1341
|
+
cude: string | null;
|
|
1342
|
+
}>, "many">;
|
|
1343
|
+
has_more: z.ZodBoolean;
|
|
1344
|
+
next_cursor: z.ZodNullable<z.ZodString>;
|
|
1345
|
+
}, "strip", z.ZodTypeAny, {
|
|
1346
|
+
data: {
|
|
1347
|
+
object: "credit_note";
|
|
1348
|
+
id: string;
|
|
1349
|
+
status: "draft" | "processing" | "signed" | "accepted_by_dian" | "rejected_by_dian" | "accepted_contingency" | "failed";
|
|
1350
|
+
livemode: boolean;
|
|
1351
|
+
metadata: Record<string, unknown>;
|
|
1352
|
+
created_at: string;
|
|
1353
|
+
updated_at: string;
|
|
1354
|
+
prefix: string;
|
|
1355
|
+
environment: string;
|
|
1356
|
+
full_number: string;
|
|
1357
|
+
customer_id: string;
|
|
1358
|
+
numbering_resolution_id: string;
|
|
1359
|
+
issue_date: string;
|
|
1360
|
+
currency_code: string;
|
|
1361
|
+
payable_amount: string;
|
|
1362
|
+
dian_response: {
|
|
1363
|
+
errors: {
|
|
1364
|
+
code: string;
|
|
1365
|
+
message: string;
|
|
1366
|
+
}[];
|
|
1367
|
+
track_id: string | null;
|
|
1368
|
+
status_code: string | null;
|
|
1369
|
+
status_description: string | null;
|
|
1370
|
+
is_valid: boolean;
|
|
1371
|
+
validated_at: string | null;
|
|
1372
|
+
warnings: {
|
|
1373
|
+
code: string;
|
|
1374
|
+
message: string;
|
|
1375
|
+
}[];
|
|
1376
|
+
} | null;
|
|
1377
|
+
has_xml: boolean;
|
|
1378
|
+
has_pdf: boolean;
|
|
1379
|
+
qr_url: string | null;
|
|
1380
|
+
reference_invoice_id: string;
|
|
1381
|
+
discrepancy_response_code: string;
|
|
1382
|
+
discrepancy_description: string | null;
|
|
1383
|
+
cude: string | null;
|
|
1384
|
+
}[];
|
|
1385
|
+
has_more: boolean;
|
|
1386
|
+
next_cursor: string | null;
|
|
1387
|
+
}, {
|
|
1388
|
+
data: {
|
|
1389
|
+
object: "credit_note";
|
|
1390
|
+
id: string;
|
|
1391
|
+
status: "draft" | "processing" | "signed" | "accepted_by_dian" | "rejected_by_dian" | "accepted_contingency" | "failed";
|
|
1392
|
+
livemode: boolean;
|
|
1393
|
+
metadata: Record<string, unknown>;
|
|
1394
|
+
created_at: string;
|
|
1395
|
+
updated_at: string;
|
|
1396
|
+
prefix: string;
|
|
1397
|
+
environment: string;
|
|
1398
|
+
full_number: string;
|
|
1399
|
+
customer_id: string;
|
|
1400
|
+
numbering_resolution_id: string;
|
|
1401
|
+
issue_date: string;
|
|
1402
|
+
currency_code: string;
|
|
1403
|
+
payable_amount: string;
|
|
1404
|
+
dian_response: {
|
|
1405
|
+
errors: {
|
|
1406
|
+
code: string;
|
|
1407
|
+
message: string;
|
|
1408
|
+
}[];
|
|
1409
|
+
track_id: string | null;
|
|
1410
|
+
status_code: string | null;
|
|
1411
|
+
status_description: string | null;
|
|
1412
|
+
is_valid: boolean;
|
|
1413
|
+
validated_at: string | null;
|
|
1414
|
+
warnings: {
|
|
1415
|
+
code: string;
|
|
1416
|
+
message: string;
|
|
1417
|
+
}[];
|
|
1418
|
+
} | null;
|
|
1419
|
+
has_xml: boolean;
|
|
1420
|
+
has_pdf: boolean;
|
|
1421
|
+
qr_url: string | null;
|
|
1422
|
+
reference_invoice_id: string;
|
|
1423
|
+
discrepancy_response_code: string;
|
|
1424
|
+
discrepancy_description: string | null;
|
|
1425
|
+
cude: string | null;
|
|
1426
|
+
}[];
|
|
1427
|
+
has_more: boolean;
|
|
1428
|
+
next_cursor: string | null;
|
|
1429
|
+
}>;
|
|
1430
|
+
|
|
1431
|
+
declare const CreateDebitNoteRequestSchema: z.ZodObject<{
|
|
1432
|
+
reference_invoice_id: z.ZodString;
|
|
1433
|
+
customer_id: z.ZodString;
|
|
1434
|
+
prefix: z.ZodDefault<z.ZodString>;
|
|
1435
|
+
discrepancy_response_code: z.ZodEnum<["1", "2", "3", "4"]>;
|
|
1436
|
+
discrepancy_description: z.ZodOptional<z.ZodString>;
|
|
1437
|
+
currency: z.ZodDefault<z.ZodEnum<["COP"]>>;
|
|
1438
|
+
notes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1439
|
+
lines: z.ZodArray<z.ZodObject<{
|
|
1440
|
+
description: z.ZodString;
|
|
1441
|
+
sku: z.ZodOptional<z.ZodString>;
|
|
1442
|
+
quantity: z.ZodString;
|
|
1443
|
+
unit_code: z.ZodDefault<z.ZodString>;
|
|
1444
|
+
unit_price: z.ZodString;
|
|
1445
|
+
line_extension_amount: z.ZodString;
|
|
1446
|
+
taxes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
1447
|
+
code: z.ZodString;
|
|
1448
|
+
rate: z.ZodString;
|
|
1449
|
+
base: z.ZodString;
|
|
1450
|
+
value: z.ZodString;
|
|
1451
|
+
}, "strip", z.ZodTypeAny, {
|
|
1452
|
+
code: string;
|
|
1453
|
+
value: string;
|
|
1454
|
+
rate: string;
|
|
1455
|
+
base: string;
|
|
1456
|
+
}, {
|
|
1457
|
+
code: string;
|
|
1458
|
+
value: string;
|
|
1459
|
+
rate: string;
|
|
1460
|
+
base: string;
|
|
1461
|
+
}>, "many">>;
|
|
1462
|
+
}, "strip", z.ZodTypeAny, {
|
|
1463
|
+
description: string;
|
|
1464
|
+
quantity: string;
|
|
1465
|
+
unit_code: string;
|
|
1466
|
+
unit_price: string;
|
|
1467
|
+
line_extension_amount: string;
|
|
1468
|
+
taxes: {
|
|
1469
|
+
code: string;
|
|
1470
|
+
value: string;
|
|
1471
|
+
rate: string;
|
|
1472
|
+
base: string;
|
|
1473
|
+
}[];
|
|
1474
|
+
sku?: string | undefined;
|
|
1475
|
+
}, {
|
|
1476
|
+
description: string;
|
|
1477
|
+
quantity: string;
|
|
1478
|
+
unit_price: string;
|
|
1479
|
+
line_extension_amount: string;
|
|
1480
|
+
sku?: string | undefined;
|
|
1481
|
+
unit_code?: string | undefined;
|
|
1482
|
+
taxes?: {
|
|
1483
|
+
code: string;
|
|
1484
|
+
value: string;
|
|
1485
|
+
rate: string;
|
|
1486
|
+
base: string;
|
|
1487
|
+
}[] | undefined;
|
|
1488
|
+
}>, "many">;
|
|
1489
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1490
|
+
}, "strip", z.ZodTypeAny, {
|
|
1491
|
+
prefix: string;
|
|
1492
|
+
customer_id: string;
|
|
1493
|
+
currency: "COP";
|
|
1494
|
+
lines: {
|
|
1495
|
+
description: string;
|
|
1496
|
+
quantity: string;
|
|
1497
|
+
unit_code: string;
|
|
1498
|
+
unit_price: string;
|
|
1499
|
+
line_extension_amount: string;
|
|
1500
|
+
taxes: {
|
|
1501
|
+
code: string;
|
|
1502
|
+
value: string;
|
|
1503
|
+
rate: string;
|
|
1504
|
+
base: string;
|
|
1505
|
+
}[];
|
|
1506
|
+
sku?: string | undefined;
|
|
1507
|
+
}[];
|
|
1508
|
+
reference_invoice_id: string;
|
|
1509
|
+
discrepancy_response_code: "1" | "2" | "3" | "4";
|
|
1510
|
+
metadata?: Record<string, unknown> | undefined;
|
|
1511
|
+
notes?: string[] | undefined;
|
|
1512
|
+
discrepancy_description?: string | undefined;
|
|
1513
|
+
}, {
|
|
1514
|
+
customer_id: string;
|
|
1515
|
+
lines: {
|
|
1516
|
+
description: string;
|
|
1517
|
+
quantity: string;
|
|
1518
|
+
unit_price: string;
|
|
1519
|
+
line_extension_amount: string;
|
|
1520
|
+
sku?: string | undefined;
|
|
1521
|
+
unit_code?: string | undefined;
|
|
1522
|
+
taxes?: {
|
|
1523
|
+
code: string;
|
|
1524
|
+
value: string;
|
|
1525
|
+
rate: string;
|
|
1526
|
+
base: string;
|
|
1527
|
+
}[] | undefined;
|
|
1528
|
+
}[];
|
|
1529
|
+
reference_invoice_id: string;
|
|
1530
|
+
discrepancy_response_code: "1" | "2" | "3" | "4";
|
|
1531
|
+
metadata?: Record<string, unknown> | undefined;
|
|
1532
|
+
prefix?: string | undefined;
|
|
1533
|
+
currency?: "COP" | undefined;
|
|
1534
|
+
notes?: string[] | undefined;
|
|
1535
|
+
discrepancy_description?: string | undefined;
|
|
1536
|
+
}>;
|
|
1537
|
+
declare const DebitNoteResponseSchema: z.ZodObject<{
|
|
1538
|
+
id: z.ZodString;
|
|
1539
|
+
object: z.ZodLiteral<"debit_note">;
|
|
1540
|
+
livemode: z.ZodBoolean;
|
|
1541
|
+
status: z.ZodEnum<["draft", "processing", "signed", "accepted_by_dian", "rejected_by_dian", "accepted_contingency", "failed"]>;
|
|
1542
|
+
full_number: z.ZodString;
|
|
1543
|
+
cude: z.ZodNullable<z.ZodString>;
|
|
1544
|
+
reference_invoice_id: z.ZodString;
|
|
1545
|
+
customer_id: z.ZodString;
|
|
1546
|
+
prefix: z.ZodString;
|
|
1547
|
+
numbering_resolution_id: z.ZodString;
|
|
1548
|
+
discrepancy_response_code: z.ZodString;
|
|
1549
|
+
discrepancy_description: z.ZodNullable<z.ZodString>;
|
|
1550
|
+
issue_date: z.ZodString;
|
|
1551
|
+
currency_code: z.ZodString;
|
|
1552
|
+
environment: z.ZodString;
|
|
1553
|
+
payable_amount: z.ZodString;
|
|
1554
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1555
|
+
created_at: z.ZodString;
|
|
1556
|
+
updated_at: z.ZodString;
|
|
1557
|
+
}, "strip", z.ZodTypeAny, {
|
|
1558
|
+
object: "debit_note";
|
|
1559
|
+
id: string;
|
|
1560
|
+
status: "draft" | "processing" | "signed" | "accepted_by_dian" | "rejected_by_dian" | "accepted_contingency" | "failed";
|
|
1561
|
+
livemode: boolean;
|
|
1562
|
+
metadata: Record<string, unknown>;
|
|
1563
|
+
created_at: string;
|
|
1564
|
+
updated_at: string;
|
|
1565
|
+
prefix: string;
|
|
1566
|
+
environment: string;
|
|
1567
|
+
full_number: string;
|
|
1568
|
+
customer_id: string;
|
|
1569
|
+
numbering_resolution_id: string;
|
|
1570
|
+
issue_date: string;
|
|
1571
|
+
currency_code: string;
|
|
1572
|
+
payable_amount: string;
|
|
1573
|
+
reference_invoice_id: string;
|
|
1574
|
+
discrepancy_response_code: string;
|
|
1575
|
+
discrepancy_description: string | null;
|
|
1576
|
+
cude: string | null;
|
|
1577
|
+
}, {
|
|
1578
|
+
object: "debit_note";
|
|
1579
|
+
id: string;
|
|
1580
|
+
status: "draft" | "processing" | "signed" | "accepted_by_dian" | "rejected_by_dian" | "accepted_contingency" | "failed";
|
|
1581
|
+
livemode: boolean;
|
|
1582
|
+
metadata: Record<string, unknown>;
|
|
1583
|
+
created_at: string;
|
|
1584
|
+
updated_at: string;
|
|
1585
|
+
prefix: string;
|
|
1586
|
+
environment: string;
|
|
1587
|
+
full_number: string;
|
|
1588
|
+
customer_id: string;
|
|
1589
|
+
numbering_resolution_id: string;
|
|
1590
|
+
issue_date: string;
|
|
1591
|
+
currency_code: string;
|
|
1592
|
+
payable_amount: string;
|
|
1593
|
+
reference_invoice_id: string;
|
|
1594
|
+
discrepancy_response_code: string;
|
|
1595
|
+
discrepancy_description: string | null;
|
|
1596
|
+
cude: string | null;
|
|
1597
|
+
}>;
|
|
1598
|
+
declare const DebitNoteDetailResponseSchema: z.ZodObject<{
|
|
1599
|
+
id: z.ZodString;
|
|
1600
|
+
object: z.ZodLiteral<"debit_note">;
|
|
1601
|
+
livemode: z.ZodBoolean;
|
|
1602
|
+
status: z.ZodEnum<["draft", "processing", "signed", "accepted_by_dian", "rejected_by_dian", "accepted_contingency", "failed"]>;
|
|
1603
|
+
full_number: z.ZodString;
|
|
1604
|
+
cude: z.ZodNullable<z.ZodString>;
|
|
1605
|
+
reference_invoice_id: z.ZodString;
|
|
1606
|
+
customer_id: z.ZodString;
|
|
1607
|
+
prefix: z.ZodString;
|
|
1608
|
+
numbering_resolution_id: z.ZodString;
|
|
1609
|
+
discrepancy_response_code: z.ZodString;
|
|
1610
|
+
discrepancy_description: z.ZodNullable<z.ZodString>;
|
|
1611
|
+
issue_date: z.ZodString;
|
|
1612
|
+
currency_code: z.ZodString;
|
|
1613
|
+
environment: z.ZodString;
|
|
1614
|
+
payable_amount: z.ZodString;
|
|
1615
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1616
|
+
created_at: z.ZodString;
|
|
1617
|
+
updated_at: z.ZodString;
|
|
1618
|
+
} & {
|
|
1619
|
+
dian_response: z.ZodNullable<z.ZodObject<{
|
|
1620
|
+
track_id: z.ZodNullable<z.ZodString>;
|
|
1621
|
+
status_code: z.ZodNullable<z.ZodString>;
|
|
1622
|
+
status_description: z.ZodNullable<z.ZodString>;
|
|
1623
|
+
is_valid: z.ZodBoolean;
|
|
1624
|
+
validated_at: z.ZodNullable<z.ZodString>;
|
|
1625
|
+
errors: z.ZodArray<z.ZodObject<{
|
|
1626
|
+
code: z.ZodString;
|
|
1627
|
+
message: z.ZodString;
|
|
1628
|
+
}, "strip", z.ZodTypeAny, {
|
|
1629
|
+
code: string;
|
|
1630
|
+
message: string;
|
|
1631
|
+
}, {
|
|
1632
|
+
code: string;
|
|
1633
|
+
message: string;
|
|
1634
|
+
}>, "many">;
|
|
1635
|
+
warnings: z.ZodArray<z.ZodObject<{
|
|
1636
|
+
code: z.ZodString;
|
|
1637
|
+
message: z.ZodString;
|
|
1638
|
+
}, "strip", z.ZodTypeAny, {
|
|
1639
|
+
code: string;
|
|
1640
|
+
message: string;
|
|
1641
|
+
}, {
|
|
1642
|
+
code: string;
|
|
1643
|
+
message: string;
|
|
1644
|
+
}>, "many">;
|
|
1645
|
+
}, "strip", z.ZodTypeAny, {
|
|
1646
|
+
errors: {
|
|
1647
|
+
code: string;
|
|
1648
|
+
message: string;
|
|
1649
|
+
}[];
|
|
1650
|
+
track_id: string | null;
|
|
1651
|
+
status_code: string | null;
|
|
1652
|
+
status_description: string | null;
|
|
1653
|
+
is_valid: boolean;
|
|
1654
|
+
validated_at: string | null;
|
|
1655
|
+
warnings: {
|
|
1656
|
+
code: string;
|
|
1657
|
+
message: string;
|
|
1658
|
+
}[];
|
|
1659
|
+
}, {
|
|
1660
|
+
errors: {
|
|
1661
|
+
code: string;
|
|
1662
|
+
message: string;
|
|
1663
|
+
}[];
|
|
1664
|
+
track_id: string | null;
|
|
1665
|
+
status_code: string | null;
|
|
1666
|
+
status_description: string | null;
|
|
1667
|
+
is_valid: boolean;
|
|
1668
|
+
validated_at: string | null;
|
|
1669
|
+
warnings: {
|
|
1670
|
+
code: string;
|
|
1671
|
+
message: string;
|
|
1672
|
+
}[];
|
|
1673
|
+
}>>;
|
|
1674
|
+
has_xml: z.ZodBoolean;
|
|
1675
|
+
has_pdf: z.ZodBoolean;
|
|
1676
|
+
qr_url: z.ZodNullable<z.ZodString>;
|
|
1677
|
+
}, "strip", z.ZodTypeAny, {
|
|
1678
|
+
object: "debit_note";
|
|
1679
|
+
id: string;
|
|
1680
|
+
status: "draft" | "processing" | "signed" | "accepted_by_dian" | "rejected_by_dian" | "accepted_contingency" | "failed";
|
|
1681
|
+
livemode: boolean;
|
|
1682
|
+
metadata: Record<string, unknown>;
|
|
1683
|
+
created_at: string;
|
|
1684
|
+
updated_at: string;
|
|
1685
|
+
prefix: string;
|
|
1686
|
+
environment: string;
|
|
1687
|
+
full_number: string;
|
|
1688
|
+
customer_id: string;
|
|
1689
|
+
numbering_resolution_id: string;
|
|
1690
|
+
issue_date: string;
|
|
1691
|
+
currency_code: string;
|
|
1692
|
+
payable_amount: string;
|
|
1693
|
+
dian_response: {
|
|
1694
|
+
errors: {
|
|
1695
|
+
code: string;
|
|
1696
|
+
message: string;
|
|
1697
|
+
}[];
|
|
1698
|
+
track_id: string | null;
|
|
1699
|
+
status_code: string | null;
|
|
1700
|
+
status_description: string | null;
|
|
1701
|
+
is_valid: boolean;
|
|
1702
|
+
validated_at: string | null;
|
|
1703
|
+
warnings: {
|
|
1704
|
+
code: string;
|
|
1705
|
+
message: string;
|
|
1706
|
+
}[];
|
|
1707
|
+
} | null;
|
|
1708
|
+
has_xml: boolean;
|
|
1709
|
+
has_pdf: boolean;
|
|
1710
|
+
qr_url: string | null;
|
|
1711
|
+
reference_invoice_id: string;
|
|
1712
|
+
discrepancy_response_code: string;
|
|
1713
|
+
discrepancy_description: string | null;
|
|
1714
|
+
cude: string | null;
|
|
1715
|
+
}, {
|
|
1716
|
+
object: "debit_note";
|
|
1717
|
+
id: string;
|
|
1718
|
+
status: "draft" | "processing" | "signed" | "accepted_by_dian" | "rejected_by_dian" | "accepted_contingency" | "failed";
|
|
1719
|
+
livemode: boolean;
|
|
1720
|
+
metadata: Record<string, unknown>;
|
|
1721
|
+
created_at: string;
|
|
1722
|
+
updated_at: string;
|
|
1723
|
+
prefix: string;
|
|
1724
|
+
environment: string;
|
|
1725
|
+
full_number: string;
|
|
1726
|
+
customer_id: string;
|
|
1727
|
+
numbering_resolution_id: string;
|
|
1728
|
+
issue_date: string;
|
|
1729
|
+
currency_code: string;
|
|
1730
|
+
payable_amount: string;
|
|
1731
|
+
dian_response: {
|
|
1732
|
+
errors: {
|
|
1733
|
+
code: string;
|
|
1734
|
+
message: string;
|
|
1735
|
+
}[];
|
|
1736
|
+
track_id: string | null;
|
|
1737
|
+
status_code: string | null;
|
|
1738
|
+
status_description: string | null;
|
|
1739
|
+
is_valid: boolean;
|
|
1740
|
+
validated_at: string | null;
|
|
1741
|
+
warnings: {
|
|
1742
|
+
code: string;
|
|
1743
|
+
message: string;
|
|
1744
|
+
}[];
|
|
1745
|
+
} | null;
|
|
1746
|
+
has_xml: boolean;
|
|
1747
|
+
has_pdf: boolean;
|
|
1748
|
+
qr_url: string | null;
|
|
1749
|
+
reference_invoice_id: string;
|
|
1750
|
+
discrepancy_response_code: string;
|
|
1751
|
+
discrepancy_description: string | null;
|
|
1752
|
+
cude: string | null;
|
|
1753
|
+
}>;
|
|
1754
|
+
declare const DebitNoteListResponseSchema: z.ZodObject<{
|
|
1755
|
+
data: z.ZodArray<z.ZodObject<{
|
|
1756
|
+
id: z.ZodString;
|
|
1757
|
+
object: z.ZodLiteral<"debit_note">;
|
|
1758
|
+
livemode: z.ZodBoolean;
|
|
1759
|
+
status: z.ZodEnum<["draft", "processing", "signed", "accepted_by_dian", "rejected_by_dian", "accepted_contingency", "failed"]>;
|
|
1760
|
+
full_number: z.ZodString;
|
|
1761
|
+
cude: z.ZodNullable<z.ZodString>;
|
|
1762
|
+
reference_invoice_id: z.ZodString;
|
|
1763
|
+
customer_id: z.ZodString;
|
|
1764
|
+
prefix: z.ZodString;
|
|
1765
|
+
numbering_resolution_id: z.ZodString;
|
|
1766
|
+
discrepancy_response_code: z.ZodString;
|
|
1767
|
+
discrepancy_description: z.ZodNullable<z.ZodString>;
|
|
1768
|
+
issue_date: z.ZodString;
|
|
1769
|
+
currency_code: z.ZodString;
|
|
1770
|
+
environment: z.ZodString;
|
|
1771
|
+
payable_amount: z.ZodString;
|
|
1772
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1773
|
+
created_at: z.ZodString;
|
|
1774
|
+
updated_at: z.ZodString;
|
|
1775
|
+
} & {
|
|
1776
|
+
dian_response: z.ZodNullable<z.ZodObject<{
|
|
1777
|
+
track_id: z.ZodNullable<z.ZodString>;
|
|
1778
|
+
status_code: z.ZodNullable<z.ZodString>;
|
|
1779
|
+
status_description: z.ZodNullable<z.ZodString>;
|
|
1780
|
+
is_valid: z.ZodBoolean;
|
|
1781
|
+
validated_at: z.ZodNullable<z.ZodString>;
|
|
1782
|
+
errors: z.ZodArray<z.ZodObject<{
|
|
1783
|
+
code: z.ZodString;
|
|
1784
|
+
message: z.ZodString;
|
|
1785
|
+
}, "strip", z.ZodTypeAny, {
|
|
1786
|
+
code: string;
|
|
1787
|
+
message: string;
|
|
1788
|
+
}, {
|
|
1789
|
+
code: string;
|
|
1790
|
+
message: string;
|
|
1791
|
+
}>, "many">;
|
|
1792
|
+
warnings: z.ZodArray<z.ZodObject<{
|
|
1793
|
+
code: z.ZodString;
|
|
1794
|
+
message: z.ZodString;
|
|
1795
|
+
}, "strip", z.ZodTypeAny, {
|
|
1796
|
+
code: string;
|
|
1797
|
+
message: string;
|
|
1798
|
+
}, {
|
|
1799
|
+
code: string;
|
|
1800
|
+
message: string;
|
|
1801
|
+
}>, "many">;
|
|
1802
|
+
}, "strip", z.ZodTypeAny, {
|
|
1803
|
+
errors: {
|
|
1804
|
+
code: string;
|
|
1805
|
+
message: string;
|
|
1806
|
+
}[];
|
|
1807
|
+
track_id: string | null;
|
|
1808
|
+
status_code: string | null;
|
|
1809
|
+
status_description: string | null;
|
|
1810
|
+
is_valid: boolean;
|
|
1811
|
+
validated_at: string | null;
|
|
1812
|
+
warnings: {
|
|
1813
|
+
code: string;
|
|
1814
|
+
message: string;
|
|
1815
|
+
}[];
|
|
1816
|
+
}, {
|
|
1817
|
+
errors: {
|
|
1818
|
+
code: string;
|
|
1819
|
+
message: string;
|
|
1820
|
+
}[];
|
|
1821
|
+
track_id: string | null;
|
|
1822
|
+
status_code: string | null;
|
|
1823
|
+
status_description: string | null;
|
|
1824
|
+
is_valid: boolean;
|
|
1825
|
+
validated_at: string | null;
|
|
1826
|
+
warnings: {
|
|
1827
|
+
code: string;
|
|
1828
|
+
message: string;
|
|
1829
|
+
}[];
|
|
1830
|
+
}>>;
|
|
1831
|
+
has_xml: z.ZodBoolean;
|
|
1832
|
+
has_pdf: z.ZodBoolean;
|
|
1833
|
+
qr_url: z.ZodNullable<z.ZodString>;
|
|
1834
|
+
}, "strip", z.ZodTypeAny, {
|
|
1835
|
+
object: "debit_note";
|
|
1836
|
+
id: string;
|
|
1837
|
+
status: "draft" | "processing" | "signed" | "accepted_by_dian" | "rejected_by_dian" | "accepted_contingency" | "failed";
|
|
1838
|
+
livemode: boolean;
|
|
1839
|
+
metadata: Record<string, unknown>;
|
|
1840
|
+
created_at: string;
|
|
1841
|
+
updated_at: string;
|
|
1842
|
+
prefix: string;
|
|
1843
|
+
environment: string;
|
|
1844
|
+
full_number: string;
|
|
1845
|
+
customer_id: string;
|
|
1846
|
+
numbering_resolution_id: string;
|
|
1847
|
+
issue_date: string;
|
|
1848
|
+
currency_code: string;
|
|
1849
|
+
payable_amount: string;
|
|
1850
|
+
dian_response: {
|
|
1851
|
+
errors: {
|
|
1852
|
+
code: string;
|
|
1853
|
+
message: string;
|
|
1854
|
+
}[];
|
|
1855
|
+
track_id: string | null;
|
|
1856
|
+
status_code: string | null;
|
|
1857
|
+
status_description: string | null;
|
|
1858
|
+
is_valid: boolean;
|
|
1859
|
+
validated_at: string | null;
|
|
1860
|
+
warnings: {
|
|
1861
|
+
code: string;
|
|
1862
|
+
message: string;
|
|
1863
|
+
}[];
|
|
1864
|
+
} | null;
|
|
1865
|
+
has_xml: boolean;
|
|
1866
|
+
has_pdf: boolean;
|
|
1867
|
+
qr_url: string | null;
|
|
1868
|
+
reference_invoice_id: string;
|
|
1869
|
+
discrepancy_response_code: string;
|
|
1870
|
+
discrepancy_description: string | null;
|
|
1871
|
+
cude: string | null;
|
|
1872
|
+
}, {
|
|
1873
|
+
object: "debit_note";
|
|
1874
|
+
id: string;
|
|
1875
|
+
status: "draft" | "processing" | "signed" | "accepted_by_dian" | "rejected_by_dian" | "accepted_contingency" | "failed";
|
|
1876
|
+
livemode: boolean;
|
|
1877
|
+
metadata: Record<string, unknown>;
|
|
1878
|
+
created_at: string;
|
|
1879
|
+
updated_at: string;
|
|
1880
|
+
prefix: string;
|
|
1881
|
+
environment: string;
|
|
1882
|
+
full_number: string;
|
|
1883
|
+
customer_id: string;
|
|
1884
|
+
numbering_resolution_id: string;
|
|
1885
|
+
issue_date: string;
|
|
1886
|
+
currency_code: string;
|
|
1887
|
+
payable_amount: string;
|
|
1888
|
+
dian_response: {
|
|
1889
|
+
errors: {
|
|
1890
|
+
code: string;
|
|
1891
|
+
message: string;
|
|
1892
|
+
}[];
|
|
1893
|
+
track_id: string | null;
|
|
1894
|
+
status_code: string | null;
|
|
1895
|
+
status_description: string | null;
|
|
1896
|
+
is_valid: boolean;
|
|
1897
|
+
validated_at: string | null;
|
|
1898
|
+
warnings: {
|
|
1899
|
+
code: string;
|
|
1900
|
+
message: string;
|
|
1901
|
+
}[];
|
|
1902
|
+
} | null;
|
|
1903
|
+
has_xml: boolean;
|
|
1904
|
+
has_pdf: boolean;
|
|
1905
|
+
qr_url: string | null;
|
|
1906
|
+
reference_invoice_id: string;
|
|
1907
|
+
discrepancy_response_code: string;
|
|
1908
|
+
discrepancy_description: string | null;
|
|
1909
|
+
cude: string | null;
|
|
1910
|
+
}>, "many">;
|
|
1911
|
+
has_more: z.ZodBoolean;
|
|
1912
|
+
next_cursor: z.ZodNullable<z.ZodString>;
|
|
1913
|
+
}, "strip", z.ZodTypeAny, {
|
|
1914
|
+
data: {
|
|
1915
|
+
object: "debit_note";
|
|
1916
|
+
id: string;
|
|
1917
|
+
status: "draft" | "processing" | "signed" | "accepted_by_dian" | "rejected_by_dian" | "accepted_contingency" | "failed";
|
|
1918
|
+
livemode: boolean;
|
|
1919
|
+
metadata: Record<string, unknown>;
|
|
1920
|
+
created_at: string;
|
|
1921
|
+
updated_at: string;
|
|
1922
|
+
prefix: string;
|
|
1923
|
+
environment: string;
|
|
1924
|
+
full_number: string;
|
|
1925
|
+
customer_id: string;
|
|
1926
|
+
numbering_resolution_id: string;
|
|
1927
|
+
issue_date: string;
|
|
1928
|
+
currency_code: string;
|
|
1929
|
+
payable_amount: string;
|
|
1930
|
+
dian_response: {
|
|
1931
|
+
errors: {
|
|
1932
|
+
code: string;
|
|
1933
|
+
message: string;
|
|
1934
|
+
}[];
|
|
1935
|
+
track_id: string | null;
|
|
1936
|
+
status_code: string | null;
|
|
1937
|
+
status_description: string | null;
|
|
1938
|
+
is_valid: boolean;
|
|
1939
|
+
validated_at: string | null;
|
|
1940
|
+
warnings: {
|
|
1941
|
+
code: string;
|
|
1942
|
+
message: string;
|
|
1943
|
+
}[];
|
|
1944
|
+
} | null;
|
|
1945
|
+
has_xml: boolean;
|
|
1946
|
+
has_pdf: boolean;
|
|
1947
|
+
qr_url: string | null;
|
|
1948
|
+
reference_invoice_id: string;
|
|
1949
|
+
discrepancy_response_code: string;
|
|
1950
|
+
discrepancy_description: string | null;
|
|
1951
|
+
cude: string | null;
|
|
1952
|
+
}[];
|
|
1953
|
+
has_more: boolean;
|
|
1954
|
+
next_cursor: string | null;
|
|
1955
|
+
}, {
|
|
1956
|
+
data: {
|
|
1957
|
+
object: "debit_note";
|
|
1958
|
+
id: string;
|
|
1959
|
+
status: "draft" | "processing" | "signed" | "accepted_by_dian" | "rejected_by_dian" | "accepted_contingency" | "failed";
|
|
1960
|
+
livemode: boolean;
|
|
1961
|
+
metadata: Record<string, unknown>;
|
|
1962
|
+
created_at: string;
|
|
1963
|
+
updated_at: string;
|
|
1964
|
+
prefix: string;
|
|
1965
|
+
environment: string;
|
|
1966
|
+
full_number: string;
|
|
1967
|
+
customer_id: string;
|
|
1968
|
+
numbering_resolution_id: string;
|
|
1969
|
+
issue_date: string;
|
|
1970
|
+
currency_code: string;
|
|
1971
|
+
payable_amount: string;
|
|
1972
|
+
dian_response: {
|
|
1973
|
+
errors: {
|
|
1974
|
+
code: string;
|
|
1975
|
+
message: string;
|
|
1976
|
+
}[];
|
|
1977
|
+
track_id: string | null;
|
|
1978
|
+
status_code: string | null;
|
|
1979
|
+
status_description: string | null;
|
|
1980
|
+
is_valid: boolean;
|
|
1981
|
+
validated_at: string | null;
|
|
1982
|
+
warnings: {
|
|
1983
|
+
code: string;
|
|
1984
|
+
message: string;
|
|
1985
|
+
}[];
|
|
1986
|
+
} | null;
|
|
1987
|
+
has_xml: boolean;
|
|
1988
|
+
has_pdf: boolean;
|
|
1989
|
+
qr_url: string | null;
|
|
1990
|
+
reference_invoice_id: string;
|
|
1991
|
+
discrepancy_response_code: string;
|
|
1992
|
+
discrepancy_description: string | null;
|
|
1993
|
+
cude: string | null;
|
|
1994
|
+
}[];
|
|
1995
|
+
has_more: boolean;
|
|
1996
|
+
next_cursor: string | null;
|
|
1997
|
+
}>;
|
|
1998
|
+
|
|
1999
|
+
/**
|
|
2000
|
+
* invoices.ts — OpenAPI path registrations for the invoices resource (PR4a + PR4b + PR4 emails).
|
|
2001
|
+
*
|
|
2002
|
+
* Spec: invoices-resource/spec.md, email-delivery PR4.
|
|
2003
|
+
* Design: ADR-1 (create-draft-and-enqueue; API NEVER numbers), ADR-5 (paginate).
|
|
2004
|
+
*
|
|
2005
|
+
* CRITICAL response contract:
|
|
2006
|
+
* - POST /v1/invoices returns 202 (accepted for async processing).
|
|
2007
|
+
* - Response includes status:'draft', full_number:'', cufe:null.
|
|
2008
|
+
* - The API NEVER assigns consecutive or full_number — the worker does.
|
|
2009
|
+
* - docs/API.md §6.2 example is being corrected in T-24/PR6 (shows status:'draft').
|
|
2010
|
+
*
|
|
2011
|
+
* Endpoints registered:
|
|
2012
|
+
* POST /v1/invoices — create draft + enqueue dian-submit (PR4a)
|
|
2013
|
+
* GET /v1/invoices — list (paginated, filterable) — items are SUMMARY (no lines) (PR4b)
|
|
2014
|
+
* GET /v1/invoices/{id} — get by id — DETAIL (includes all line items) (PR4b)
|
|
2015
|
+
* GET /v1/invoices/{id}/emails — list email deliveries (PR4 trazabilidad)
|
|
2016
|
+
*/
|
|
2017
|
+
declare const InvoiceResponseSchema: z.ZodObject<{
|
|
2018
|
+
id: z.ZodString;
|
|
2019
|
+
object: z.ZodLiteral<"invoice">;
|
|
2020
|
+
livemode: z.ZodBoolean;
|
|
2021
|
+
/**
|
|
2022
|
+
* status: 'draft' on 202 response (the worker transitions to 'processing' after
|
|
2023
|
+
* reserveNumber completes, and eventually to 'accepted_by_dian' or 'rejected_by_dian').
|
|
2024
|
+
*
|
|
2025
|
+
* Estados:
|
|
2026
|
+
* draft — creado, encolado pendiente de procesamiento
|
|
2027
|
+
* processing — worker asignó número, firmando
|
|
2028
|
+
* signed — firmado, enviando a DIAN
|
|
2029
|
+
* accepted_by_dian — DIAN aceptó
|
|
2030
|
+
* rejected_by_dian — DIAN rechazó
|
|
2031
|
+
* accepted_contingency — Tipo 04 emitido
|
|
2032
|
+
* failed — error interno
|
|
2033
|
+
*/
|
|
2034
|
+
status: z.ZodEnum<["draft", "processing", "signed", "accepted_by_dian", "rejected_by_dian", "accepted_contingency", "failed"]>;
|
|
2035
|
+
/**
|
|
2036
|
+
* full_number: '' in the 202 draft response. Filled by worker after reserveNumber.
|
|
2037
|
+
* Format: '{prefix}{consecutive}', e.g. 'FE0042'.
|
|
2038
|
+
*/
|
|
2039
|
+
full_number: z.ZodString;
|
|
2040
|
+
/**
|
|
2041
|
+
* cufe: null in the 202 draft response. Filled by worker after signing.
|
|
2042
|
+
*/
|
|
2043
|
+
cufe: z.ZodNullable<z.ZodString>;
|
|
2044
|
+
customer_id: z.ZodString;
|
|
2045
|
+
prefix: z.ZodString;
|
|
2046
|
+
numbering_resolution_id: z.ZodString;
|
|
2047
|
+
issue_date: z.ZodString;
|
|
2048
|
+
currency_code: z.ZodString;
|
|
2049
|
+
environment: z.ZodString;
|
|
2050
|
+
payable_amount: z.ZodString;
|
|
2051
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
2052
|
+
created_at: z.ZodString;
|
|
2053
|
+
updated_at: z.ZodString;
|
|
2054
|
+
}, "strip", z.ZodTypeAny, {
|
|
2055
|
+
object: "invoice";
|
|
2056
|
+
id: string;
|
|
2057
|
+
status: "draft" | "processing" | "signed" | "accepted_by_dian" | "rejected_by_dian" | "accepted_contingency" | "failed";
|
|
2058
|
+
livemode: boolean;
|
|
2059
|
+
metadata: Record<string, unknown>;
|
|
2060
|
+
created_at: string;
|
|
2061
|
+
updated_at: string;
|
|
2062
|
+
prefix: string;
|
|
2063
|
+
environment: string;
|
|
2064
|
+
full_number: string;
|
|
2065
|
+
cufe: string | null;
|
|
2066
|
+
customer_id: string;
|
|
2067
|
+
numbering_resolution_id: string;
|
|
2068
|
+
issue_date: string;
|
|
2069
|
+
currency_code: string;
|
|
2070
|
+
payable_amount: string;
|
|
2071
|
+
}, {
|
|
2072
|
+
object: "invoice";
|
|
2073
|
+
id: string;
|
|
2074
|
+
status: "draft" | "processing" | "signed" | "accepted_by_dian" | "rejected_by_dian" | "accepted_contingency" | "failed";
|
|
2075
|
+
livemode: boolean;
|
|
2076
|
+
metadata: Record<string, unknown>;
|
|
2077
|
+
created_at: string;
|
|
2078
|
+
updated_at: string;
|
|
2079
|
+
prefix: string;
|
|
2080
|
+
environment: string;
|
|
2081
|
+
full_number: string;
|
|
2082
|
+
cufe: string | null;
|
|
2083
|
+
customer_id: string;
|
|
2084
|
+
numbering_resolution_id: string;
|
|
2085
|
+
issue_date: string;
|
|
2086
|
+
currency_code: string;
|
|
2087
|
+
payable_amount: string;
|
|
2088
|
+
}>;
|
|
2089
|
+
declare const CreateInvoiceRequestSchema: z.ZodObject<{
|
|
2090
|
+
customer_id: z.ZodString;
|
|
2091
|
+
prefix: z.ZodDefault<z.ZodString>;
|
|
2092
|
+
issue_date: z.ZodOptional<z.ZodString>;
|
|
2093
|
+
due_date: z.ZodOptional<z.ZodString>;
|
|
2094
|
+
payment_means: z.ZodOptional<z.ZodObject<{
|
|
2095
|
+
code: z.ZodString;
|
|
2096
|
+
type: z.ZodEnum<["1", "2"]>;
|
|
2097
|
+
due_date: z.ZodOptional<z.ZodString>;
|
|
2098
|
+
}, "strip", z.ZodTypeAny, {
|
|
2099
|
+
type: "1" | "2";
|
|
2100
|
+
code: string;
|
|
2101
|
+
due_date?: string | undefined;
|
|
2102
|
+
}, {
|
|
2103
|
+
type: "1" | "2";
|
|
2104
|
+
code: string;
|
|
2105
|
+
due_date?: string | undefined;
|
|
2106
|
+
}>>;
|
|
2107
|
+
currency: z.ZodDefault<z.ZodEnum<["COP"]>>;
|
|
2108
|
+
operation_type: z.ZodDefault<z.ZodString>;
|
|
2109
|
+
lines: z.ZodArray<z.ZodObject<{
|
|
2110
|
+
description: z.ZodString;
|
|
2111
|
+
sku: z.ZodOptional<z.ZodString>;
|
|
2112
|
+
quantity: z.ZodString;
|
|
2113
|
+
unit_code: z.ZodDefault<z.ZodString>;
|
|
2114
|
+
unit_price: z.ZodString;
|
|
2115
|
+
line_extension_amount: z.ZodString;
|
|
2116
|
+
taxes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
2117
|
+
code: z.ZodString;
|
|
2118
|
+
rate: z.ZodString;
|
|
2119
|
+
base: z.ZodString;
|
|
2120
|
+
value: z.ZodString;
|
|
2121
|
+
}, "strip", z.ZodTypeAny, {
|
|
2122
|
+
code: string;
|
|
2123
|
+
value: string;
|
|
2124
|
+
rate: string;
|
|
2125
|
+
base: string;
|
|
2126
|
+
}, {
|
|
2127
|
+
code: string;
|
|
2128
|
+
value: string;
|
|
2129
|
+
rate: string;
|
|
2130
|
+
base: string;
|
|
2131
|
+
}>, "many">>;
|
|
2132
|
+
}, "strip", z.ZodTypeAny, {
|
|
2133
|
+
description: string;
|
|
2134
|
+
quantity: string;
|
|
2135
|
+
unit_code: string;
|
|
2136
|
+
unit_price: string;
|
|
2137
|
+
line_extension_amount: string;
|
|
2138
|
+
taxes: {
|
|
2139
|
+
code: string;
|
|
2140
|
+
value: string;
|
|
2141
|
+
rate: string;
|
|
2142
|
+
base: string;
|
|
2143
|
+
}[];
|
|
2144
|
+
sku?: string | undefined;
|
|
2145
|
+
}, {
|
|
2146
|
+
description: string;
|
|
2147
|
+
quantity: string;
|
|
2148
|
+
unit_price: string;
|
|
2149
|
+
line_extension_amount: string;
|
|
2150
|
+
sku?: string | undefined;
|
|
2151
|
+
unit_code?: string | undefined;
|
|
2152
|
+
taxes?: {
|
|
2153
|
+
code: string;
|
|
2154
|
+
value: string;
|
|
2155
|
+
rate: string;
|
|
2156
|
+
base: string;
|
|
2157
|
+
}[] | undefined;
|
|
2158
|
+
}>, "many">;
|
|
2159
|
+
notes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2160
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2161
|
+
}, "strip", z.ZodTypeAny, {
|
|
2162
|
+
prefix: string;
|
|
2163
|
+
customer_id: string;
|
|
2164
|
+
currency: "COP";
|
|
2165
|
+
operation_type: string;
|
|
2166
|
+
lines: {
|
|
2167
|
+
description: string;
|
|
2168
|
+
quantity: string;
|
|
2169
|
+
unit_code: string;
|
|
2170
|
+
unit_price: string;
|
|
2171
|
+
line_extension_amount: string;
|
|
2172
|
+
taxes: {
|
|
2173
|
+
code: string;
|
|
2174
|
+
value: string;
|
|
2175
|
+
rate: string;
|
|
2176
|
+
base: string;
|
|
2177
|
+
}[];
|
|
2178
|
+
sku?: string | undefined;
|
|
2179
|
+
}[];
|
|
2180
|
+
metadata?: Record<string, unknown> | undefined;
|
|
2181
|
+
issue_date?: string | undefined;
|
|
2182
|
+
due_date?: string | undefined;
|
|
2183
|
+
payment_means?: {
|
|
2184
|
+
type: "1" | "2";
|
|
2185
|
+
code: string;
|
|
2186
|
+
due_date?: string | undefined;
|
|
2187
|
+
} | undefined;
|
|
2188
|
+
notes?: string[] | undefined;
|
|
2189
|
+
}, {
|
|
2190
|
+
customer_id: string;
|
|
2191
|
+
lines: {
|
|
2192
|
+
description: string;
|
|
2193
|
+
quantity: string;
|
|
2194
|
+
unit_price: string;
|
|
2195
|
+
line_extension_amount: string;
|
|
2196
|
+
sku?: string | undefined;
|
|
2197
|
+
unit_code?: string | undefined;
|
|
2198
|
+
taxes?: {
|
|
2199
|
+
code: string;
|
|
2200
|
+
value: string;
|
|
2201
|
+
rate: string;
|
|
2202
|
+
base: string;
|
|
2203
|
+
}[] | undefined;
|
|
2204
|
+
}[];
|
|
2205
|
+
metadata?: Record<string, unknown> | undefined;
|
|
2206
|
+
prefix?: string | undefined;
|
|
2207
|
+
issue_date?: string | undefined;
|
|
2208
|
+
due_date?: string | undefined;
|
|
2209
|
+
payment_means?: {
|
|
2210
|
+
type: "1" | "2";
|
|
2211
|
+
code: string;
|
|
2212
|
+
due_date?: string | undefined;
|
|
2213
|
+
} | undefined;
|
|
2214
|
+
currency?: "COP" | undefined;
|
|
2215
|
+
operation_type?: string | undefined;
|
|
2216
|
+
notes?: string[] | undefined;
|
|
2217
|
+
}>;
|
|
2218
|
+
declare const InvoiceDetailResponseSchema: z.ZodObject<{
|
|
2219
|
+
id: z.ZodString;
|
|
2220
|
+
object: z.ZodLiteral<"invoice">;
|
|
2221
|
+
livemode: z.ZodBoolean;
|
|
2222
|
+
/**
|
|
2223
|
+
* status: 'draft' on 202 response (the worker transitions to 'processing' after
|
|
2224
|
+
* reserveNumber completes, and eventually to 'accepted_by_dian' or 'rejected_by_dian').
|
|
2225
|
+
*
|
|
2226
|
+
* Estados:
|
|
2227
|
+
* draft — creado, encolado pendiente de procesamiento
|
|
2228
|
+
* processing — worker asignó número, firmando
|
|
2229
|
+
* signed — firmado, enviando a DIAN
|
|
2230
|
+
* accepted_by_dian — DIAN aceptó
|
|
2231
|
+
* rejected_by_dian — DIAN rechazó
|
|
2232
|
+
* accepted_contingency — Tipo 04 emitido
|
|
2233
|
+
* failed — error interno
|
|
2234
|
+
*/
|
|
2235
|
+
status: z.ZodEnum<["draft", "processing", "signed", "accepted_by_dian", "rejected_by_dian", "accepted_contingency", "failed"]>;
|
|
2236
|
+
/**
|
|
2237
|
+
* full_number: '' in the 202 draft response. Filled by worker after reserveNumber.
|
|
2238
|
+
* Format: '{prefix}{consecutive}', e.g. 'FE0042'.
|
|
2239
|
+
*/
|
|
2240
|
+
full_number: z.ZodString;
|
|
2241
|
+
/**
|
|
2242
|
+
* cufe: null in the 202 draft response. Filled by worker after signing.
|
|
2243
|
+
*/
|
|
2244
|
+
cufe: z.ZodNullable<z.ZodString>;
|
|
2245
|
+
customer_id: z.ZodString;
|
|
2246
|
+
prefix: z.ZodString;
|
|
2247
|
+
numbering_resolution_id: z.ZodString;
|
|
2248
|
+
issue_date: z.ZodString;
|
|
2249
|
+
currency_code: z.ZodString;
|
|
2250
|
+
environment: z.ZodString;
|
|
2251
|
+
payable_amount: z.ZodString;
|
|
2252
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
2253
|
+
created_at: z.ZodString;
|
|
2254
|
+
updated_at: z.ZodString;
|
|
2255
|
+
} & {
|
|
2256
|
+
dian_response: z.ZodNullable<z.ZodObject<{
|
|
2257
|
+
track_id: z.ZodNullable<z.ZodString>;
|
|
2258
|
+
status_code: z.ZodNullable<z.ZodString>;
|
|
2259
|
+
status_description: z.ZodNullable<z.ZodString>;
|
|
2260
|
+
is_valid: z.ZodBoolean;
|
|
2261
|
+
validated_at: z.ZodNullable<z.ZodString>;
|
|
2262
|
+
errors: z.ZodArray<z.ZodObject<{
|
|
2263
|
+
code: z.ZodString;
|
|
2264
|
+
message: z.ZodString;
|
|
2265
|
+
}, "strip", z.ZodTypeAny, {
|
|
2266
|
+
code: string;
|
|
2267
|
+
message: string;
|
|
2268
|
+
}, {
|
|
2269
|
+
code: string;
|
|
2270
|
+
message: string;
|
|
2271
|
+
}>, "many">;
|
|
2272
|
+
warnings: z.ZodArray<z.ZodObject<{
|
|
2273
|
+
code: z.ZodString;
|
|
2274
|
+
message: z.ZodString;
|
|
2275
|
+
}, "strip", z.ZodTypeAny, {
|
|
2276
|
+
code: string;
|
|
2277
|
+
message: string;
|
|
2278
|
+
}, {
|
|
2279
|
+
code: string;
|
|
2280
|
+
message: string;
|
|
2281
|
+
}>, "many">;
|
|
2282
|
+
}, "strip", z.ZodTypeAny, {
|
|
2283
|
+
errors: {
|
|
2284
|
+
code: string;
|
|
2285
|
+
message: string;
|
|
2286
|
+
}[];
|
|
2287
|
+
track_id: string | null;
|
|
2288
|
+
status_code: string | null;
|
|
2289
|
+
status_description: string | null;
|
|
2290
|
+
is_valid: boolean;
|
|
2291
|
+
validated_at: string | null;
|
|
2292
|
+
warnings: {
|
|
2293
|
+
code: string;
|
|
2294
|
+
message: string;
|
|
2295
|
+
}[];
|
|
2296
|
+
}, {
|
|
2297
|
+
errors: {
|
|
2298
|
+
code: string;
|
|
2299
|
+
message: string;
|
|
2300
|
+
}[];
|
|
2301
|
+
track_id: string | null;
|
|
2302
|
+
status_code: string | null;
|
|
2303
|
+
status_description: string | null;
|
|
2304
|
+
is_valid: boolean;
|
|
2305
|
+
validated_at: string | null;
|
|
2306
|
+
warnings: {
|
|
2307
|
+
code: string;
|
|
2308
|
+
message: string;
|
|
2309
|
+
}[];
|
|
2310
|
+
}>>;
|
|
2311
|
+
has_xml: z.ZodBoolean;
|
|
2312
|
+
has_pdf: z.ZodBoolean;
|
|
2313
|
+
qr_url: z.ZodNullable<z.ZodString>;
|
|
2314
|
+
} & {
|
|
2315
|
+
lines: z.ZodArray<z.ZodObject<{
|
|
2316
|
+
id: z.ZodString;
|
|
2317
|
+
line_number: z.ZodNumber;
|
|
2318
|
+
description: z.ZodString;
|
|
2319
|
+
sku: z.ZodNullable<z.ZodString>;
|
|
2320
|
+
standard_item_id: z.ZodNullable<z.ZodString>;
|
|
2321
|
+
standard_item_schema: z.ZodNullable<z.ZodString>;
|
|
2322
|
+
quantity: z.ZodString;
|
|
2323
|
+
unit_code: z.ZodString;
|
|
2324
|
+
unit_price: z.ZodString;
|
|
2325
|
+
line_extension_amount: z.ZodString;
|
|
2326
|
+
allowance_amount: z.ZodString;
|
|
2327
|
+
charge_amount: z.ZodString;
|
|
2328
|
+
iva_rate: z.ZodString;
|
|
2329
|
+
iva_base: z.ZodString;
|
|
2330
|
+
iva_amount: z.ZodString;
|
|
2331
|
+
inc_rate: z.ZodString;
|
|
2332
|
+
inc_amount: z.ZodString;
|
|
2333
|
+
ica_rate: z.ZodString;
|
|
2334
|
+
ica_amount: z.ZodString;
|
|
2335
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
2336
|
+
}, "strip", z.ZodTypeAny, {
|
|
2337
|
+
description: string;
|
|
2338
|
+
id: string;
|
|
2339
|
+
metadata: Record<string, unknown>;
|
|
2340
|
+
sku: string | null;
|
|
2341
|
+
quantity: string;
|
|
2342
|
+
unit_code: string;
|
|
2343
|
+
unit_price: string;
|
|
2344
|
+
line_extension_amount: string;
|
|
2345
|
+
line_number: number;
|
|
2346
|
+
standard_item_id: string | null;
|
|
2347
|
+
standard_item_schema: string | null;
|
|
2348
|
+
allowance_amount: string;
|
|
2349
|
+
charge_amount: string;
|
|
2350
|
+
iva_rate: string;
|
|
2351
|
+
iva_base: string;
|
|
2352
|
+
iva_amount: string;
|
|
2353
|
+
inc_rate: string;
|
|
2354
|
+
inc_amount: string;
|
|
2355
|
+
ica_rate: string;
|
|
2356
|
+
ica_amount: string;
|
|
2357
|
+
}, {
|
|
2358
|
+
description: string;
|
|
2359
|
+
id: string;
|
|
2360
|
+
metadata: Record<string, unknown>;
|
|
2361
|
+
sku: string | null;
|
|
2362
|
+
quantity: string;
|
|
2363
|
+
unit_code: string;
|
|
2364
|
+
unit_price: string;
|
|
2365
|
+
line_extension_amount: string;
|
|
2366
|
+
line_number: number;
|
|
2367
|
+
standard_item_id: string | null;
|
|
2368
|
+
standard_item_schema: string | null;
|
|
2369
|
+
allowance_amount: string;
|
|
2370
|
+
charge_amount: string;
|
|
2371
|
+
iva_rate: string;
|
|
2372
|
+
iva_base: string;
|
|
2373
|
+
iva_amount: string;
|
|
2374
|
+
inc_rate: string;
|
|
2375
|
+
inc_amount: string;
|
|
2376
|
+
ica_rate: string;
|
|
2377
|
+
ica_amount: string;
|
|
2378
|
+
}>, "many">;
|
|
2379
|
+
}, "strip", z.ZodTypeAny, {
|
|
2380
|
+
object: "invoice";
|
|
2381
|
+
id: string;
|
|
2382
|
+
status: "draft" | "processing" | "signed" | "accepted_by_dian" | "rejected_by_dian" | "accepted_contingency" | "failed";
|
|
2383
|
+
livemode: boolean;
|
|
2384
|
+
metadata: Record<string, unknown>;
|
|
2385
|
+
created_at: string;
|
|
2386
|
+
updated_at: string;
|
|
2387
|
+
prefix: string;
|
|
2388
|
+
environment: string;
|
|
2389
|
+
full_number: string;
|
|
2390
|
+
cufe: string | null;
|
|
2391
|
+
customer_id: string;
|
|
2392
|
+
numbering_resolution_id: string;
|
|
2393
|
+
issue_date: string;
|
|
2394
|
+
currency_code: string;
|
|
2395
|
+
payable_amount: string;
|
|
2396
|
+
lines: {
|
|
2397
|
+
description: string;
|
|
2398
|
+
id: string;
|
|
2399
|
+
metadata: Record<string, unknown>;
|
|
2400
|
+
sku: string | null;
|
|
2401
|
+
quantity: string;
|
|
2402
|
+
unit_code: string;
|
|
2403
|
+
unit_price: string;
|
|
2404
|
+
line_extension_amount: string;
|
|
2405
|
+
line_number: number;
|
|
2406
|
+
standard_item_id: string | null;
|
|
2407
|
+
standard_item_schema: string | null;
|
|
2408
|
+
allowance_amount: string;
|
|
2409
|
+
charge_amount: string;
|
|
2410
|
+
iva_rate: string;
|
|
2411
|
+
iva_base: string;
|
|
2412
|
+
iva_amount: string;
|
|
2413
|
+
inc_rate: string;
|
|
2414
|
+
inc_amount: string;
|
|
2415
|
+
ica_rate: string;
|
|
2416
|
+
ica_amount: string;
|
|
2417
|
+
}[];
|
|
2418
|
+
dian_response: {
|
|
2419
|
+
errors: {
|
|
2420
|
+
code: string;
|
|
2421
|
+
message: string;
|
|
2422
|
+
}[];
|
|
2423
|
+
track_id: string | null;
|
|
2424
|
+
status_code: string | null;
|
|
2425
|
+
status_description: string | null;
|
|
2426
|
+
is_valid: boolean;
|
|
2427
|
+
validated_at: string | null;
|
|
2428
|
+
warnings: {
|
|
2429
|
+
code: string;
|
|
2430
|
+
message: string;
|
|
2431
|
+
}[];
|
|
2432
|
+
} | null;
|
|
2433
|
+
has_xml: boolean;
|
|
2434
|
+
has_pdf: boolean;
|
|
2435
|
+
qr_url: string | null;
|
|
2436
|
+
}, {
|
|
2437
|
+
object: "invoice";
|
|
2438
|
+
id: string;
|
|
2439
|
+
status: "draft" | "processing" | "signed" | "accepted_by_dian" | "rejected_by_dian" | "accepted_contingency" | "failed";
|
|
2440
|
+
livemode: boolean;
|
|
2441
|
+
metadata: Record<string, unknown>;
|
|
2442
|
+
created_at: string;
|
|
2443
|
+
updated_at: string;
|
|
2444
|
+
prefix: string;
|
|
2445
|
+
environment: string;
|
|
2446
|
+
full_number: string;
|
|
2447
|
+
cufe: string | null;
|
|
2448
|
+
customer_id: string;
|
|
2449
|
+
numbering_resolution_id: string;
|
|
2450
|
+
issue_date: string;
|
|
2451
|
+
currency_code: string;
|
|
2452
|
+
payable_amount: string;
|
|
2453
|
+
lines: {
|
|
2454
|
+
description: string;
|
|
2455
|
+
id: string;
|
|
2456
|
+
metadata: Record<string, unknown>;
|
|
2457
|
+
sku: string | null;
|
|
2458
|
+
quantity: string;
|
|
2459
|
+
unit_code: string;
|
|
2460
|
+
unit_price: string;
|
|
2461
|
+
line_extension_amount: string;
|
|
2462
|
+
line_number: number;
|
|
2463
|
+
standard_item_id: string | null;
|
|
2464
|
+
standard_item_schema: string | null;
|
|
2465
|
+
allowance_amount: string;
|
|
2466
|
+
charge_amount: string;
|
|
2467
|
+
iva_rate: string;
|
|
2468
|
+
iva_base: string;
|
|
2469
|
+
iva_amount: string;
|
|
2470
|
+
inc_rate: string;
|
|
2471
|
+
inc_amount: string;
|
|
2472
|
+
ica_rate: string;
|
|
2473
|
+
ica_amount: string;
|
|
2474
|
+
}[];
|
|
2475
|
+
dian_response: {
|
|
2476
|
+
errors: {
|
|
2477
|
+
code: string;
|
|
2478
|
+
message: string;
|
|
2479
|
+
}[];
|
|
2480
|
+
track_id: string | null;
|
|
2481
|
+
status_code: string | null;
|
|
2482
|
+
status_description: string | null;
|
|
2483
|
+
is_valid: boolean;
|
|
2484
|
+
validated_at: string | null;
|
|
2485
|
+
warnings: {
|
|
2486
|
+
code: string;
|
|
2487
|
+
message: string;
|
|
2488
|
+
}[];
|
|
2489
|
+
} | null;
|
|
2490
|
+
has_xml: boolean;
|
|
2491
|
+
has_pdf: boolean;
|
|
2492
|
+
qr_url: string | null;
|
|
2493
|
+
}>;
|
|
2494
|
+
declare const InvoiceListResponseSchema: z.ZodObject<{
|
|
2495
|
+
data: z.ZodArray<z.ZodObject<{
|
|
2496
|
+
id: z.ZodString;
|
|
2497
|
+
object: z.ZodLiteral<"invoice">;
|
|
2498
|
+
livemode: z.ZodBoolean;
|
|
2499
|
+
/**
|
|
2500
|
+
* status: 'draft' on 202 response (the worker transitions to 'processing' after
|
|
2501
|
+
* reserveNumber completes, and eventually to 'accepted_by_dian' or 'rejected_by_dian').
|
|
2502
|
+
*
|
|
2503
|
+
* Estados:
|
|
2504
|
+
* draft — creado, encolado pendiente de procesamiento
|
|
2505
|
+
* processing — worker asignó número, firmando
|
|
2506
|
+
* signed — firmado, enviando a DIAN
|
|
2507
|
+
* accepted_by_dian — DIAN aceptó
|
|
2508
|
+
* rejected_by_dian — DIAN rechazó
|
|
2509
|
+
* accepted_contingency — Tipo 04 emitido
|
|
2510
|
+
* failed — error interno
|
|
2511
|
+
*/
|
|
2512
|
+
status: z.ZodEnum<["draft", "processing", "signed", "accepted_by_dian", "rejected_by_dian", "accepted_contingency", "failed"]>;
|
|
2513
|
+
/**
|
|
2514
|
+
* full_number: '' in the 202 draft response. Filled by worker after reserveNumber.
|
|
2515
|
+
* Format: '{prefix}{consecutive}', e.g. 'FE0042'.
|
|
2516
|
+
*/
|
|
2517
|
+
full_number: z.ZodString;
|
|
2518
|
+
/**
|
|
2519
|
+
* cufe: null in the 202 draft response. Filled by worker after signing.
|
|
2520
|
+
*/
|
|
2521
|
+
cufe: z.ZodNullable<z.ZodString>;
|
|
2522
|
+
customer_id: z.ZodString;
|
|
2523
|
+
prefix: z.ZodString;
|
|
2524
|
+
numbering_resolution_id: z.ZodString;
|
|
2525
|
+
issue_date: z.ZodString;
|
|
2526
|
+
currency_code: z.ZodString;
|
|
2527
|
+
environment: z.ZodString;
|
|
2528
|
+
payable_amount: z.ZodString;
|
|
2529
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
2530
|
+
created_at: z.ZodString;
|
|
2531
|
+
updated_at: z.ZodString;
|
|
2532
|
+
} & {
|
|
2533
|
+
dian_response: z.ZodNullable<z.ZodObject<{
|
|
2534
|
+
track_id: z.ZodNullable<z.ZodString>;
|
|
2535
|
+
status_code: z.ZodNullable<z.ZodString>;
|
|
2536
|
+
status_description: z.ZodNullable<z.ZodString>;
|
|
2537
|
+
is_valid: z.ZodBoolean;
|
|
2538
|
+
validated_at: z.ZodNullable<z.ZodString>;
|
|
2539
|
+
errors: z.ZodArray<z.ZodObject<{
|
|
2540
|
+
code: z.ZodString;
|
|
2541
|
+
message: z.ZodString;
|
|
2542
|
+
}, "strip", z.ZodTypeAny, {
|
|
2543
|
+
code: string;
|
|
2544
|
+
message: string;
|
|
2545
|
+
}, {
|
|
2546
|
+
code: string;
|
|
2547
|
+
message: string;
|
|
2548
|
+
}>, "many">;
|
|
2549
|
+
warnings: z.ZodArray<z.ZodObject<{
|
|
2550
|
+
code: z.ZodString;
|
|
2551
|
+
message: z.ZodString;
|
|
2552
|
+
}, "strip", z.ZodTypeAny, {
|
|
2553
|
+
code: string;
|
|
2554
|
+
message: string;
|
|
2555
|
+
}, {
|
|
2556
|
+
code: string;
|
|
2557
|
+
message: string;
|
|
2558
|
+
}>, "many">;
|
|
2559
|
+
}, "strip", z.ZodTypeAny, {
|
|
2560
|
+
errors: {
|
|
2561
|
+
code: string;
|
|
2562
|
+
message: string;
|
|
2563
|
+
}[];
|
|
2564
|
+
track_id: string | null;
|
|
2565
|
+
status_code: string | null;
|
|
2566
|
+
status_description: string | null;
|
|
2567
|
+
is_valid: boolean;
|
|
2568
|
+
validated_at: string | null;
|
|
2569
|
+
warnings: {
|
|
2570
|
+
code: string;
|
|
2571
|
+
message: string;
|
|
2572
|
+
}[];
|
|
2573
|
+
}, {
|
|
2574
|
+
errors: {
|
|
2575
|
+
code: string;
|
|
2576
|
+
message: string;
|
|
2577
|
+
}[];
|
|
2578
|
+
track_id: string | null;
|
|
2579
|
+
status_code: string | null;
|
|
2580
|
+
status_description: string | null;
|
|
2581
|
+
is_valid: boolean;
|
|
2582
|
+
validated_at: string | null;
|
|
2583
|
+
warnings: {
|
|
2584
|
+
code: string;
|
|
2585
|
+
message: string;
|
|
2586
|
+
}[];
|
|
2587
|
+
}>>;
|
|
2588
|
+
has_xml: z.ZodBoolean;
|
|
2589
|
+
has_pdf: z.ZodBoolean;
|
|
2590
|
+
qr_url: z.ZodNullable<z.ZodString>;
|
|
2591
|
+
}, "strip", z.ZodTypeAny, {
|
|
2592
|
+
object: "invoice";
|
|
2593
|
+
id: string;
|
|
2594
|
+
status: "draft" | "processing" | "signed" | "accepted_by_dian" | "rejected_by_dian" | "accepted_contingency" | "failed";
|
|
2595
|
+
livemode: boolean;
|
|
2596
|
+
metadata: Record<string, unknown>;
|
|
2597
|
+
created_at: string;
|
|
2598
|
+
updated_at: string;
|
|
2599
|
+
prefix: string;
|
|
2600
|
+
environment: string;
|
|
2601
|
+
full_number: string;
|
|
2602
|
+
cufe: string | null;
|
|
2603
|
+
customer_id: string;
|
|
2604
|
+
numbering_resolution_id: string;
|
|
2605
|
+
issue_date: string;
|
|
2606
|
+
currency_code: string;
|
|
2607
|
+
payable_amount: string;
|
|
2608
|
+
dian_response: {
|
|
2609
|
+
errors: {
|
|
2610
|
+
code: string;
|
|
2611
|
+
message: string;
|
|
2612
|
+
}[];
|
|
2613
|
+
track_id: string | null;
|
|
2614
|
+
status_code: string | null;
|
|
2615
|
+
status_description: string | null;
|
|
2616
|
+
is_valid: boolean;
|
|
2617
|
+
validated_at: string | null;
|
|
2618
|
+
warnings: {
|
|
2619
|
+
code: string;
|
|
2620
|
+
message: string;
|
|
2621
|
+
}[];
|
|
2622
|
+
} | null;
|
|
2623
|
+
has_xml: boolean;
|
|
2624
|
+
has_pdf: boolean;
|
|
2625
|
+
qr_url: string | null;
|
|
2626
|
+
}, {
|
|
2627
|
+
object: "invoice";
|
|
2628
|
+
id: string;
|
|
2629
|
+
status: "draft" | "processing" | "signed" | "accepted_by_dian" | "rejected_by_dian" | "accepted_contingency" | "failed";
|
|
2630
|
+
livemode: boolean;
|
|
2631
|
+
metadata: Record<string, unknown>;
|
|
2632
|
+
created_at: string;
|
|
2633
|
+
updated_at: string;
|
|
2634
|
+
prefix: string;
|
|
2635
|
+
environment: string;
|
|
2636
|
+
full_number: string;
|
|
2637
|
+
cufe: string | null;
|
|
2638
|
+
customer_id: string;
|
|
2639
|
+
numbering_resolution_id: string;
|
|
2640
|
+
issue_date: string;
|
|
2641
|
+
currency_code: string;
|
|
2642
|
+
payable_amount: string;
|
|
2643
|
+
dian_response: {
|
|
2644
|
+
errors: {
|
|
2645
|
+
code: string;
|
|
2646
|
+
message: string;
|
|
2647
|
+
}[];
|
|
2648
|
+
track_id: string | null;
|
|
2649
|
+
status_code: string | null;
|
|
2650
|
+
status_description: string | null;
|
|
2651
|
+
is_valid: boolean;
|
|
2652
|
+
validated_at: string | null;
|
|
2653
|
+
warnings: {
|
|
2654
|
+
code: string;
|
|
2655
|
+
message: string;
|
|
2656
|
+
}[];
|
|
2657
|
+
} | null;
|
|
2658
|
+
has_xml: boolean;
|
|
2659
|
+
has_pdf: boolean;
|
|
2660
|
+
qr_url: string | null;
|
|
2661
|
+
}>, "many">;
|
|
2662
|
+
has_more: z.ZodBoolean;
|
|
2663
|
+
next_cursor: z.ZodNullable<z.ZodString>;
|
|
2664
|
+
}, "strip", z.ZodTypeAny, {
|
|
2665
|
+
data: {
|
|
2666
|
+
object: "invoice";
|
|
2667
|
+
id: string;
|
|
2668
|
+
status: "draft" | "processing" | "signed" | "accepted_by_dian" | "rejected_by_dian" | "accepted_contingency" | "failed";
|
|
2669
|
+
livemode: boolean;
|
|
2670
|
+
metadata: Record<string, unknown>;
|
|
2671
|
+
created_at: string;
|
|
2672
|
+
updated_at: string;
|
|
2673
|
+
prefix: string;
|
|
2674
|
+
environment: string;
|
|
2675
|
+
full_number: string;
|
|
2676
|
+
cufe: string | null;
|
|
2677
|
+
customer_id: string;
|
|
2678
|
+
numbering_resolution_id: string;
|
|
2679
|
+
issue_date: string;
|
|
2680
|
+
currency_code: string;
|
|
2681
|
+
payable_amount: string;
|
|
2682
|
+
dian_response: {
|
|
2683
|
+
errors: {
|
|
2684
|
+
code: string;
|
|
2685
|
+
message: string;
|
|
2686
|
+
}[];
|
|
2687
|
+
track_id: string | null;
|
|
2688
|
+
status_code: string | null;
|
|
2689
|
+
status_description: string | null;
|
|
2690
|
+
is_valid: boolean;
|
|
2691
|
+
validated_at: string | null;
|
|
2692
|
+
warnings: {
|
|
2693
|
+
code: string;
|
|
2694
|
+
message: string;
|
|
2695
|
+
}[];
|
|
2696
|
+
} | null;
|
|
2697
|
+
has_xml: boolean;
|
|
2698
|
+
has_pdf: boolean;
|
|
2699
|
+
qr_url: string | null;
|
|
2700
|
+
}[];
|
|
2701
|
+
has_more: boolean;
|
|
2702
|
+
next_cursor: string | null;
|
|
2703
|
+
}, {
|
|
2704
|
+
data: {
|
|
2705
|
+
object: "invoice";
|
|
2706
|
+
id: string;
|
|
2707
|
+
status: "draft" | "processing" | "signed" | "accepted_by_dian" | "rejected_by_dian" | "accepted_contingency" | "failed";
|
|
2708
|
+
livemode: boolean;
|
|
2709
|
+
metadata: Record<string, unknown>;
|
|
2710
|
+
created_at: string;
|
|
2711
|
+
updated_at: string;
|
|
2712
|
+
prefix: string;
|
|
2713
|
+
environment: string;
|
|
2714
|
+
full_number: string;
|
|
2715
|
+
cufe: string | null;
|
|
2716
|
+
customer_id: string;
|
|
2717
|
+
numbering_resolution_id: string;
|
|
2718
|
+
issue_date: string;
|
|
2719
|
+
currency_code: string;
|
|
2720
|
+
payable_amount: string;
|
|
2721
|
+
dian_response: {
|
|
2722
|
+
errors: {
|
|
2723
|
+
code: string;
|
|
2724
|
+
message: string;
|
|
2725
|
+
}[];
|
|
2726
|
+
track_id: string | null;
|
|
2727
|
+
status_code: string | null;
|
|
2728
|
+
status_description: string | null;
|
|
2729
|
+
is_valid: boolean;
|
|
2730
|
+
validated_at: string | null;
|
|
2731
|
+
warnings: {
|
|
2732
|
+
code: string;
|
|
2733
|
+
message: string;
|
|
2734
|
+
}[];
|
|
2735
|
+
} | null;
|
|
2736
|
+
has_xml: boolean;
|
|
2737
|
+
has_pdf: boolean;
|
|
2738
|
+
qr_url: string | null;
|
|
2739
|
+
}[];
|
|
2740
|
+
has_more: boolean;
|
|
2741
|
+
next_cursor: string | null;
|
|
2742
|
+
}>;
|
|
2743
|
+
/**
|
|
2744
|
+
* EmailDeliveryResponseSchema — shape of a single email delivery row (PR4 trazabilidad).
|
|
2745
|
+
*
|
|
2746
|
+
* Shared across all 3 document resources. Registered once here (openapi `'EmailDeliveryResponse'`
|
|
2747
|
+
* name), referenced in credit-notes.ts and debit-notes.ts.
|
|
2748
|
+
*/
|
|
2749
|
+
declare const EmailDeliveryResponseSchema: z.ZodObject<{
|
|
2750
|
+
id: z.ZodString;
|
|
2751
|
+
status: z.ZodEnum<["queued", "sent", "delivered", "bounced", "complained"]>;
|
|
2752
|
+
mode: z.ZodEnum<["test", "live"]>;
|
|
2753
|
+
recipient_email: z.ZodString;
|
|
2754
|
+
provider_message_id: z.ZodNullable<z.ZodString>;
|
|
2755
|
+
attempts: z.ZodNumber;
|
|
2756
|
+
last_error: z.ZodNullable<z.ZodString>;
|
|
2757
|
+
trigger_source: z.ZodEnum<["auto", "manual"]>;
|
|
2758
|
+
sent_at: z.ZodNullable<z.ZodString>;
|
|
2759
|
+
delivered_at: z.ZodNullable<z.ZodString>;
|
|
2760
|
+
bounced_at: z.ZodNullable<z.ZodString>;
|
|
2761
|
+
complained_at: z.ZodNullable<z.ZodString>;
|
|
2762
|
+
created_at: z.ZodString;
|
|
2763
|
+
}, "strip", z.ZodTypeAny, {
|
|
2764
|
+
id: string;
|
|
2765
|
+
status: "queued" | "sent" | "delivered" | "bounced" | "complained";
|
|
2766
|
+
created_at: string;
|
|
2767
|
+
mode: "test" | "live";
|
|
2768
|
+
recipient_email: string;
|
|
2769
|
+
provider_message_id: string | null;
|
|
2770
|
+
attempts: number;
|
|
2771
|
+
last_error: string | null;
|
|
2772
|
+
trigger_source: "auto" | "manual";
|
|
2773
|
+
sent_at: string | null;
|
|
2774
|
+
delivered_at: string | null;
|
|
2775
|
+
bounced_at: string | null;
|
|
2776
|
+
complained_at: string | null;
|
|
2777
|
+
}, {
|
|
2778
|
+
id: string;
|
|
2779
|
+
status: "queued" | "sent" | "delivered" | "bounced" | "complained";
|
|
2780
|
+
created_at: string;
|
|
2781
|
+
mode: "test" | "live";
|
|
2782
|
+
recipient_email: string;
|
|
2783
|
+
provider_message_id: string | null;
|
|
2784
|
+
attempts: number;
|
|
2785
|
+
last_error: string | null;
|
|
2786
|
+
trigger_source: "auto" | "manual";
|
|
2787
|
+
sent_at: string | null;
|
|
2788
|
+
delivered_at: string | null;
|
|
2789
|
+
bounced_at: string | null;
|
|
2790
|
+
complained_at: string | null;
|
|
2791
|
+
}>;
|
|
2792
|
+
declare const EmailDeliveryListResponseSchema: z.ZodObject<{
|
|
2793
|
+
data: z.ZodArray<z.ZodObject<{
|
|
2794
|
+
id: z.ZodString;
|
|
2795
|
+
status: z.ZodEnum<["queued", "sent", "delivered", "bounced", "complained"]>;
|
|
2796
|
+
mode: z.ZodEnum<["test", "live"]>;
|
|
2797
|
+
recipient_email: z.ZodString;
|
|
2798
|
+
provider_message_id: z.ZodNullable<z.ZodString>;
|
|
2799
|
+
attempts: z.ZodNumber;
|
|
2800
|
+
last_error: z.ZodNullable<z.ZodString>;
|
|
2801
|
+
trigger_source: z.ZodEnum<["auto", "manual"]>;
|
|
2802
|
+
sent_at: z.ZodNullable<z.ZodString>;
|
|
2803
|
+
delivered_at: z.ZodNullable<z.ZodString>;
|
|
2804
|
+
bounced_at: z.ZodNullable<z.ZodString>;
|
|
2805
|
+
complained_at: z.ZodNullable<z.ZodString>;
|
|
2806
|
+
created_at: z.ZodString;
|
|
2807
|
+
}, "strip", z.ZodTypeAny, {
|
|
2808
|
+
id: string;
|
|
2809
|
+
status: "queued" | "sent" | "delivered" | "bounced" | "complained";
|
|
2810
|
+
created_at: string;
|
|
2811
|
+
mode: "test" | "live";
|
|
2812
|
+
recipient_email: string;
|
|
2813
|
+
provider_message_id: string | null;
|
|
2814
|
+
attempts: number;
|
|
2815
|
+
last_error: string | null;
|
|
2816
|
+
trigger_source: "auto" | "manual";
|
|
2817
|
+
sent_at: string | null;
|
|
2818
|
+
delivered_at: string | null;
|
|
2819
|
+
bounced_at: string | null;
|
|
2820
|
+
complained_at: string | null;
|
|
2821
|
+
}, {
|
|
2822
|
+
id: string;
|
|
2823
|
+
status: "queued" | "sent" | "delivered" | "bounced" | "complained";
|
|
2824
|
+
created_at: string;
|
|
2825
|
+
mode: "test" | "live";
|
|
2826
|
+
recipient_email: string;
|
|
2827
|
+
provider_message_id: string | null;
|
|
2828
|
+
attempts: number;
|
|
2829
|
+
last_error: string | null;
|
|
2830
|
+
trigger_source: "auto" | "manual";
|
|
2831
|
+
sent_at: string | null;
|
|
2832
|
+
delivered_at: string | null;
|
|
2833
|
+
bounced_at: string | null;
|
|
2834
|
+
complained_at: string | null;
|
|
2835
|
+
}>, "many">;
|
|
2836
|
+
}, "strip", z.ZodTypeAny, {
|
|
2837
|
+
data: {
|
|
2838
|
+
id: string;
|
|
2839
|
+
status: "queued" | "sent" | "delivered" | "bounced" | "complained";
|
|
2840
|
+
created_at: string;
|
|
2841
|
+
mode: "test" | "live";
|
|
2842
|
+
recipient_email: string;
|
|
2843
|
+
provider_message_id: string | null;
|
|
2844
|
+
attempts: number;
|
|
2845
|
+
last_error: string | null;
|
|
2846
|
+
trigger_source: "auto" | "manual";
|
|
2847
|
+
sent_at: string | null;
|
|
2848
|
+
delivered_at: string | null;
|
|
2849
|
+
bounced_at: string | null;
|
|
2850
|
+
complained_at: string | null;
|
|
2851
|
+
}[];
|
|
2852
|
+
}, {
|
|
2853
|
+
data: {
|
|
2854
|
+
id: string;
|
|
2855
|
+
status: "queued" | "sent" | "delivered" | "bounced" | "complained";
|
|
2856
|
+
created_at: string;
|
|
2857
|
+
mode: "test" | "live";
|
|
2858
|
+
recipient_email: string;
|
|
2859
|
+
provider_message_id: string | null;
|
|
2860
|
+
attempts: number;
|
|
2861
|
+
last_error: string | null;
|
|
2862
|
+
trigger_source: "auto" | "manual";
|
|
2863
|
+
sent_at: string | null;
|
|
2864
|
+
delivered_at: string | null;
|
|
2865
|
+
bounced_at: string | null;
|
|
2866
|
+
complained_at: string | null;
|
|
2867
|
+
}[];
|
|
2868
|
+
}>;
|
|
2869
|
+
declare const SendEmailRequestSchema: z.ZodObject<{
|
|
2870
|
+
to: z.ZodOptional<z.ZodString>;
|
|
2871
|
+
}, "strip", z.ZodTypeAny, {
|
|
2872
|
+
to?: string | undefined;
|
|
2873
|
+
}, {
|
|
2874
|
+
to?: string | undefined;
|
|
2875
|
+
}>;
|
|
2876
|
+
declare const EmailContentResponseSchema: z.ZodObject<{
|
|
2877
|
+
recipient: z.ZodNullable<z.ZodString>;
|
|
2878
|
+
subject: z.ZodString;
|
|
2879
|
+
attached_document: z.ZodObject<{
|
|
2880
|
+
available: z.ZodBoolean;
|
|
2881
|
+
download_url: z.ZodNullable<z.ZodString>;
|
|
2882
|
+
expires_in: z.ZodNullable<z.ZodNumber>;
|
|
2883
|
+
}, "strip", z.ZodTypeAny, {
|
|
2884
|
+
available: boolean;
|
|
2885
|
+
download_url: string | null;
|
|
2886
|
+
expires_in: number | null;
|
|
2887
|
+
}, {
|
|
2888
|
+
available: boolean;
|
|
2889
|
+
download_url: string | null;
|
|
2890
|
+
expires_in: number | null;
|
|
2891
|
+
}>;
|
|
2892
|
+
}, "strip", z.ZodTypeAny, {
|
|
2893
|
+
recipient: string | null;
|
|
2894
|
+
subject: string;
|
|
2895
|
+
attached_document: {
|
|
2896
|
+
available: boolean;
|
|
2897
|
+
download_url: string | null;
|
|
2898
|
+
expires_in: number | null;
|
|
2899
|
+
};
|
|
2900
|
+
}, {
|
|
2901
|
+
recipient: string | null;
|
|
2902
|
+
subject: string;
|
|
2903
|
+
attached_document: {
|
|
2904
|
+
available: boolean;
|
|
2905
|
+
download_url: string | null;
|
|
2906
|
+
expires_in: number | null;
|
|
2907
|
+
};
|
|
2908
|
+
}>;
|
|
2909
|
+
|
|
2910
|
+
/**
|
|
2911
|
+
* Generated SDK types inferred from @emitia/openapi Zod schemas.
|
|
2912
|
+
*
|
|
2913
|
+
* ADR-1: z.infer types come from @emitia/openapi (devDependency, type-only).
|
|
2914
|
+
* @emitia/openapi is NEVER bundled into dist — types are erased at runtime.
|
|
2915
|
+
*
|
|
2916
|
+
* This file is purely a type alias re-export. No runtime code.
|
|
2917
|
+
*/
|
|
2918
|
+
|
|
2919
|
+
type AccountInfo = z.infer<typeof AccountInfoSchema>;
|
|
2920
|
+
type BalanceResponse = z.infer<typeof BalanceResponseSchema>;
|
|
2921
|
+
type CatalogItem = z.infer<typeof CatalogItemSchema>;
|
|
2922
|
+
type CatalogListResponse = z.infer<typeof CatalogListResponseSchema>;
|
|
2923
|
+
type MunicipioItem = z.infer<typeof MunicipioItemSchema>;
|
|
2924
|
+
type MunicipioListResponse = z.infer<typeof MunicipioListResponseSchema>;
|
|
2925
|
+
type CustomerResponse = z.infer<typeof CustomerResponseSchema>;
|
|
2926
|
+
type CreateCustomerRequest = z.infer<typeof CreateCustomerRequestSchema>;
|
|
2927
|
+
type CustomerListResponse = z.infer<typeof CustomerListResponseSchema>;
|
|
2928
|
+
type NumberingResolutionResponse = z.infer<typeof NumberingResolutionResponseSchema>;
|
|
2929
|
+
type CreateNumberingResolutionRequest = z.infer<typeof CreateNumberingResolutionRequestSchema>;
|
|
2930
|
+
type NumberingResolutionListResponse = z.infer<typeof NumberingResolutionListResponseSchema>;
|
|
2931
|
+
type InvoiceResponse = z.infer<typeof InvoiceResponseSchema>;
|
|
2932
|
+
type InvoiceDetailResponse = z.infer<typeof InvoiceDetailResponseSchema>;
|
|
2933
|
+
type InvoiceListResponse = z.infer<typeof InvoiceListResponseSchema>;
|
|
2934
|
+
type CreateInvoiceRequest = z.infer<typeof CreateInvoiceRequestSchema>;
|
|
2935
|
+
type EmailDeliveryResponse = z.infer<typeof EmailDeliveryResponseSchema>;
|
|
2936
|
+
type EmailDeliveryListResponse = z.infer<typeof EmailDeliveryListResponseSchema>;
|
|
2937
|
+
type SendEmailRequest = z.infer<typeof SendEmailRequestSchema>;
|
|
2938
|
+
type EmailContentResponse = z.infer<typeof EmailContentResponseSchema>;
|
|
2939
|
+
type CreditNoteResponse = z.infer<typeof CreditNoteResponseSchema>;
|
|
2940
|
+
type CreditNoteDetailResponse = z.infer<typeof CreditNoteDetailResponseSchema>;
|
|
2941
|
+
type CreditNoteListResponse = z.infer<typeof CreditNoteListResponseSchema>;
|
|
2942
|
+
type CreateCreditNoteRequest = z.infer<typeof CreateCreditNoteRequestSchema>;
|
|
2943
|
+
type DebitNoteResponse = z.infer<typeof DebitNoteResponseSchema>;
|
|
2944
|
+
type DebitNoteDetailResponse = z.infer<typeof DebitNoteDetailResponseSchema>;
|
|
2945
|
+
type DebitNoteListResponse = z.infer<typeof DebitNoteListResponseSchema>;
|
|
2946
|
+
type CreateDebitNoteRequest = z.infer<typeof CreateDebitNoteRequestSchema>;
|
|
2947
|
+
type CertificateResponse = z.infer<typeof CertificateResponseSchema>;
|
|
2948
|
+
type CreateCertificateRequest = z.infer<typeof CreateCertificateRequestSchema>;
|
|
2949
|
+
type CertificateListResponse = z.infer<typeof CertificateListResponseSchema>;
|
|
2950
|
+
type TriggerEventBody = z.infer<typeof TriggerEventBodySchema>;
|
|
2951
|
+
type TriggerEventResponse = z.infer<typeof TriggerEventResponseSchema>;
|
|
2952
|
+
|
|
2953
|
+
/**
|
|
2954
|
+
* HTTP transport for the @emitia/node SDK.
|
|
2955
|
+
*
|
|
2956
|
+
* R02: Authorization + User-Agent on every request.
|
|
2957
|
+
* R03: Idempotency-key auto-generation (UUID v4 via crypto.randomUUID) for flagged POSTs.
|
|
2958
|
+
* R04: Retry 429/5xx with exponential backoff + full jitter; Retry-After defensive.
|
|
2959
|
+
* AbortSignal respected. Same idempotency-key reused across retries.
|
|
2960
|
+
* No `!` non-null assertions in runtime code.
|
|
2961
|
+
*/
|
|
2962
|
+
|
|
2963
|
+
interface RequestOptions {
|
|
2964
|
+
method: 'GET' | 'POST' | 'PATCH' | 'DELETE';
|
|
2965
|
+
path: string;
|
|
2966
|
+
query?: Record<string, string | number | boolean>;
|
|
2967
|
+
body?: unknown;
|
|
2968
|
+
idempotencyKey?: string;
|
|
2969
|
+
/** When true, a UUID v4 idempotency-key is generated automatically. */
|
|
2970
|
+
autoIdempotency?: boolean;
|
|
2971
|
+
signal?: AbortSignal;
|
|
2972
|
+
}
|
|
2973
|
+
declare class HttpClient {
|
|
2974
|
+
private readonly config;
|
|
2975
|
+
constructor(config: EmitiaConfig);
|
|
2976
|
+
request<T>(opts: RequestOptions): Promise<T>;
|
|
2977
|
+
private buildUrl;
|
|
2978
|
+
}
|
|
2979
|
+
|
|
2980
|
+
/**
|
|
2981
|
+
* BaseResource — shared base class for all SDK resource namespaces.
|
|
2982
|
+
*
|
|
2983
|
+
* Holds a reference to the HttpClient so resource subclasses can call
|
|
2984
|
+
* this._http.request<T>(...) without re-wiring the transport.
|
|
2985
|
+
*/
|
|
2986
|
+
|
|
2987
|
+
declare abstract class BaseResource {
|
|
2988
|
+
protected readonly _http: HttpClient;
|
|
2989
|
+
constructor(http: HttpClient);
|
|
2990
|
+
}
|
|
2991
|
+
|
|
2992
|
+
/**
|
|
2993
|
+
* AccountResource — GET /v1/account
|
|
2994
|
+
*
|
|
2995
|
+
* R06: Read-only resource. Returns tenant info for the authenticated API key.
|
|
2996
|
+
*/
|
|
2997
|
+
|
|
2998
|
+
declare class AccountResource extends BaseResource {
|
|
2999
|
+
retrieve(): Promise<AccountInfo>;
|
|
3000
|
+
}
|
|
3001
|
+
|
|
3002
|
+
/**
|
|
3003
|
+
* BalanceResource — GET /v1/balance
|
|
3004
|
+
*
|
|
3005
|
+
* R06: Read-only resource. Returns document usage counts for the current period.
|
|
3006
|
+
*/
|
|
3007
|
+
|
|
3008
|
+
declare class BalanceResource extends BaseResource {
|
|
3009
|
+
retrieve(): Promise<BalanceResponse>;
|
|
3010
|
+
}
|
|
3011
|
+
|
|
3012
|
+
/**
|
|
3013
|
+
* CatalogsResource — GET /v1/catalogs/{slug} and GET /v1/catalogs/municipios
|
|
3014
|
+
*
|
|
3015
|
+
* R06: Read-only resource (public endpoints, no auth required by the API — but
|
|
3016
|
+
* the SDK sends Authorization anyway as it's always present).
|
|
3017
|
+
*
|
|
3018
|
+
* Response types are inferred via z.infer from the @emitia/openapi Zod SSOT
|
|
3019
|
+
* (CatalogListResponseSchema / MunicipioListResponseSchema) — zero drift with
|
|
3020
|
+
* the actual API contract.
|
|
3021
|
+
*/
|
|
3022
|
+
|
|
3023
|
+
interface MunicipiosQuery {
|
|
3024
|
+
/** 2-digit DANE department code (e.g. "11" for Bogotá D.C.). */
|
|
3025
|
+
department?: string;
|
|
3026
|
+
}
|
|
3027
|
+
declare class CatalogsResource extends BaseResource {
|
|
3028
|
+
/**
|
|
3029
|
+
* GET /v1/catalogs/{slug}
|
|
3030
|
+
* Returns all items in a named DIAN catalog.
|
|
3031
|
+
*/
|
|
3032
|
+
retrieve(slug: string): Promise<CatalogListResponse>;
|
|
3033
|
+
/**
|
|
3034
|
+
* GET /v1/catalogs/municipios
|
|
3035
|
+
* Returns Colombian municipalities. Optionally filtered by 2-digit department code.
|
|
3036
|
+
*/
|
|
3037
|
+
municipios(query?: MunicipiosQuery): Promise<MunicipioListResponse>;
|
|
3038
|
+
}
|
|
3039
|
+
|
|
3040
|
+
/**
|
|
3041
|
+
* CertificatesResource — read + write methods for /v1/certificates
|
|
3042
|
+
*
|
|
3043
|
+
* R06: retrieve(id), list(params?), create(body, opts?), del(id), activate(id).
|
|
3044
|
+
* R03: create() does NOT auto-generate idempotency-key (openapi.json: no Idempotency-Key header on POST /v1/certificates).
|
|
3045
|
+
* Override via opts.idempotencyKey is still accepted.
|
|
3046
|
+
* del() and activate() carry no idempotency-key.
|
|
3047
|
+
*/
|
|
3048
|
+
|
|
3049
|
+
interface CertificateListParams {
|
|
3050
|
+
/** Number of results per page (1–100, default 20). */
|
|
3051
|
+
limit?: number;
|
|
3052
|
+
/** Opaque cursor for pagination. */
|
|
3053
|
+
starting_after?: string;
|
|
3054
|
+
}
|
|
3055
|
+
interface CertificateCreateOpts {
|
|
3056
|
+
/** Optional explicit idempotency key (NOT auto-generated — openapi.json does not require it). */
|
|
3057
|
+
idempotencyKey?: string;
|
|
3058
|
+
}
|
|
3059
|
+
declare class CertificatesResource extends BaseResource {
|
|
3060
|
+
/**
|
|
3061
|
+
* GET /v1/certificates/{id}
|
|
3062
|
+
* Returns certificate metadata by ID. 404 if not found or cross-tenant.
|
|
3063
|
+
*/
|
|
3064
|
+
retrieve(id: string): Promise<CertificateResponse>;
|
|
3065
|
+
/**
|
|
3066
|
+
* GET /v1/certificates
|
|
3067
|
+
* Returns a cursor-paginated list of certificate metadata.
|
|
3068
|
+
* Soft-deleted certificates are excluded.
|
|
3069
|
+
*/
|
|
3070
|
+
list(params?: CertificateListParams): Promise<CertificateListResponse>;
|
|
3071
|
+
/**
|
|
3072
|
+
* POST /v1/certificates — Upload a new .p12 certificate.
|
|
3073
|
+
* Returns 201. No auto-idempotency (openapi.json: no Idempotency-Key header required).
|
|
3074
|
+
* Explicit override accepted via opts.idempotencyKey.
|
|
3075
|
+
*/
|
|
3076
|
+
create(body: CreateCertificateRequest, opts?: CertificateCreateOpts): Promise<CertificateResponse>;
|
|
3077
|
+
/**
|
|
3078
|
+
* DELETE /v1/certificates/{id} — Soft-delete a certificate.
|
|
3079
|
+
* Returns 200 with the deleted CertificateResponse (not 204). No idempotency-key.
|
|
3080
|
+
*/
|
|
3081
|
+
del(id: string): Promise<CertificateResponse>;
|
|
3082
|
+
/**
|
|
3083
|
+
* POST /v1/certificates/{id}/activate — Set this certificate as the active signing cert.
|
|
3084
|
+
* Returns 200 with updated CertificateResponse. No idempotency-key.
|
|
3085
|
+
*/
|
|
3086
|
+
activate(id: string): Promise<CertificateResponse>;
|
|
3087
|
+
}
|
|
3088
|
+
|
|
3089
|
+
/**
|
|
3090
|
+
* CreditNotesResource — full CRUD + email methods for /v1/credit-notes
|
|
3091
|
+
*
|
|
3092
|
+
* R03: create() and sendEmail() are POST cobrables — auto-generate idempotency-key.
|
|
3093
|
+
* R06: 6 methods: create, retrieve, list, sendEmail, emailContent, listEmails.
|
|
3094
|
+
* R07: Money fields (payable_amount) remain strings — no coercion.
|
|
3095
|
+
*/
|
|
3096
|
+
|
|
3097
|
+
type NoteStatus$1 = 'draft' | 'processing' | 'signed' | 'accepted_by_dian' | 'rejected_by_dian' | 'accepted_contingency' | 'failed';
|
|
3098
|
+
interface CreditNoteListParams {
|
|
3099
|
+
/** Max items to return (1–100). */
|
|
3100
|
+
limit?: number;
|
|
3101
|
+
/** Cursor from previous page. */
|
|
3102
|
+
starting_after?: string;
|
|
3103
|
+
/** Filter by credit note status. */
|
|
3104
|
+
status?: NoteStatus$1;
|
|
3105
|
+
/** ISO-8601 date/datetime — include notes created at or after. */
|
|
3106
|
+
'created[gte]'?: string;
|
|
3107
|
+
/** ISO-8601 date/datetime — include notes created before. */
|
|
3108
|
+
'created[lt]'?: string;
|
|
3109
|
+
}
|
|
3110
|
+
interface CreditNoteCreateOpts {
|
|
3111
|
+
/** Explicit idempotency key. When omitted a UUID v4 is auto-generated. */
|
|
3112
|
+
idempotencyKey?: string;
|
|
3113
|
+
}
|
|
3114
|
+
interface SendEmailOpts$2 {
|
|
3115
|
+
/** Explicit idempotency key. When omitted a UUID v4 is auto-generated. */
|
|
3116
|
+
idempotencyKey?: string;
|
|
3117
|
+
}
|
|
3118
|
+
declare class CreditNotesResource extends BaseResource {
|
|
3119
|
+
/**
|
|
3120
|
+
* POST /v1/credit-notes — Create a draft credit note.
|
|
3121
|
+
* Returns 202. Auto-generates idempotency-key (R03).
|
|
3122
|
+
*/
|
|
3123
|
+
create(body: CreateCreditNoteRequest, opts?: CreditNoteCreateOpts): Promise<CreditNoteResponse>;
|
|
3124
|
+
/**
|
|
3125
|
+
* GET /v1/credit-notes/{id} — Retrieve credit note by ID (detail including DIAN response).
|
|
3126
|
+
* No idempotency-key.
|
|
3127
|
+
*/
|
|
3128
|
+
retrieve(id: string): Promise<CreditNoteDetailResponse>;
|
|
3129
|
+
/**
|
|
3130
|
+
* GET /v1/credit-notes — List credit notes (cursor-paginated, filterable).
|
|
3131
|
+
* No idempotency-key.
|
|
3132
|
+
*/
|
|
3133
|
+
list(params?: CreditNoteListParams): Promise<CreditNoteListResponse>;
|
|
3134
|
+
/**
|
|
3135
|
+
* POST /v1/credit-notes/{id}/send-email — Manually resend the credit note email.
|
|
3136
|
+
* Returns 202. Auto-generates idempotency-key (R03).
|
|
3137
|
+
*/
|
|
3138
|
+
sendEmail(id: string, body?: SendEmailRequest, opts?: SendEmailOpts$2): Promise<EmailDeliveryResponse>;
|
|
3139
|
+
/**
|
|
3140
|
+
* GET /v1/credit-notes/{id}/email-content — Get email content.
|
|
3141
|
+
* No idempotency-key.
|
|
3142
|
+
*/
|
|
3143
|
+
emailContent(id: string): Promise<EmailContentResponse>;
|
|
3144
|
+
/**
|
|
3145
|
+
* GET /v1/credit-notes/{id}/emails — List email delivery attempts.
|
|
3146
|
+
* No idempotency-key.
|
|
3147
|
+
*/
|
|
3148
|
+
listEmails(id: string): Promise<EmailDeliveryListResponse>;
|
|
3149
|
+
}
|
|
3150
|
+
|
|
3151
|
+
/**
|
|
3152
|
+
* CustomersResource — read + write methods for /v1/customers
|
|
3153
|
+
*
|
|
3154
|
+
* R06: retrieve(id), list(params?), create(body, opts?), update(id, body), del(id).
|
|
3155
|
+
* R03: create() is a billable POST — auto-generates idempotency-key (Idempotency-Key required per openapi.json).
|
|
3156
|
+
* PATCH and DELETE do NOT carry idempotency-key.
|
|
3157
|
+
*/
|
|
3158
|
+
|
|
3159
|
+
interface CustomerListParams {
|
|
3160
|
+
/** Number of results per page (1–100, default 20). */
|
|
3161
|
+
limit?: number;
|
|
3162
|
+
/** Opaque cursor for pagination (ID of the last item from the previous page). */
|
|
3163
|
+
starting_after?: string;
|
|
3164
|
+
}
|
|
3165
|
+
interface CustomerCreateOpts {
|
|
3166
|
+
/** Explicit idempotency key. When omitted a UUID v4 is auto-generated (R03). */
|
|
3167
|
+
idempotencyKey?: string;
|
|
3168
|
+
}
|
|
3169
|
+
declare class CustomersResource extends BaseResource {
|
|
3170
|
+
/**
|
|
3171
|
+
* GET /v1/customers/{id}
|
|
3172
|
+
* Returns a customer by public ID. 404 if not found or soft-deleted.
|
|
3173
|
+
*/
|
|
3174
|
+
retrieve(id: string): Promise<CustomerResponse>;
|
|
3175
|
+
/**
|
|
3176
|
+
* GET /v1/customers
|
|
3177
|
+
* Returns a cursor-paginated list of customers.
|
|
3178
|
+
*/
|
|
3179
|
+
list(params?: CustomerListParams): Promise<CustomerListResponse>;
|
|
3180
|
+
/**
|
|
3181
|
+
* POST /v1/customers — Create a customer.
|
|
3182
|
+
* Returns 201. Auto-generates idempotency-key (R03 — openapi.json marks Idempotency-Key required).
|
|
3183
|
+
*/
|
|
3184
|
+
create(body: CreateCustomerRequest, opts?: CustomerCreateOpts): Promise<CustomerResponse>;
|
|
3185
|
+
/**
|
|
3186
|
+
* PATCH /v1/customers/{id} — Update a customer.
|
|
3187
|
+
* Returns 200 with updated CustomerResponse. No idempotency-key.
|
|
3188
|
+
*/
|
|
3189
|
+
update(id: string, body: Partial<CreateCustomerRequest>): Promise<CustomerResponse>;
|
|
3190
|
+
/**
|
|
3191
|
+
* DELETE /v1/customers/{id} — Soft-delete a customer.
|
|
3192
|
+
* Returns 200 with the deleted CustomerResponse (not 204). No idempotency-key.
|
|
3193
|
+
*/
|
|
3194
|
+
del(id: string): Promise<CustomerResponse>;
|
|
3195
|
+
}
|
|
3196
|
+
|
|
3197
|
+
/**
|
|
3198
|
+
* DebitNotesResource — full CRUD + email methods for /v1/debit-notes
|
|
3199
|
+
*
|
|
3200
|
+
* R03: create() and sendEmail() are POST cobrables — auto-generate idempotency-key.
|
|
3201
|
+
* R06: 6 methods: create, retrieve, list, sendEmail, emailContent, listEmails.
|
|
3202
|
+
* R07: Money fields (payable_amount) remain strings — no coercion.
|
|
3203
|
+
*/
|
|
3204
|
+
|
|
3205
|
+
type NoteStatus = 'draft' | 'processing' | 'signed' | 'accepted_by_dian' | 'rejected_by_dian' | 'accepted_contingency' | 'failed';
|
|
3206
|
+
interface DebitNoteListParams {
|
|
3207
|
+
/** Max items to return (1–100). */
|
|
3208
|
+
limit?: number;
|
|
3209
|
+
/** Cursor from previous page. */
|
|
3210
|
+
starting_after?: string;
|
|
3211
|
+
/** Filter by debit note status. */
|
|
3212
|
+
status?: NoteStatus;
|
|
3213
|
+
/** ISO-8601 date/datetime — include notes created at or after. */
|
|
3214
|
+
'created[gte]'?: string;
|
|
3215
|
+
/** ISO-8601 date/datetime — include notes created before. */
|
|
3216
|
+
'created[lt]'?: string;
|
|
3217
|
+
}
|
|
3218
|
+
interface DebitNoteCreateOpts {
|
|
3219
|
+
/** Explicit idempotency key. When omitted a UUID v4 is auto-generated. */
|
|
3220
|
+
idempotencyKey?: string;
|
|
3221
|
+
}
|
|
3222
|
+
interface SendEmailOpts$1 {
|
|
3223
|
+
/** Explicit idempotency key. When omitted a UUID v4 is auto-generated. */
|
|
3224
|
+
idempotencyKey?: string;
|
|
3225
|
+
}
|
|
3226
|
+
declare class DebitNotesResource extends BaseResource {
|
|
3227
|
+
/**
|
|
3228
|
+
* POST /v1/debit-notes — Create a draft debit note.
|
|
3229
|
+
* Returns 202. Auto-generates idempotency-key (R03).
|
|
3230
|
+
*/
|
|
3231
|
+
create(body: CreateDebitNoteRequest, opts?: DebitNoteCreateOpts): Promise<DebitNoteResponse>;
|
|
3232
|
+
/**
|
|
3233
|
+
* GET /v1/debit-notes/{id} — Retrieve debit note by ID (detail including DIAN response).
|
|
3234
|
+
* No idempotency-key.
|
|
3235
|
+
*/
|
|
3236
|
+
retrieve(id: string): Promise<DebitNoteDetailResponse>;
|
|
3237
|
+
/**
|
|
3238
|
+
* GET /v1/debit-notes — List debit notes (cursor-paginated, filterable).
|
|
3239
|
+
* No idempotency-key.
|
|
3240
|
+
*/
|
|
3241
|
+
list(params?: DebitNoteListParams): Promise<DebitNoteListResponse>;
|
|
3242
|
+
/**
|
|
3243
|
+
* POST /v1/debit-notes/{id}/send-email — Manually resend the debit note email.
|
|
3244
|
+
* Returns 202. Auto-generates idempotency-key (R03).
|
|
3245
|
+
*/
|
|
3246
|
+
sendEmail(id: string, body?: SendEmailRequest, opts?: SendEmailOpts$1): Promise<EmailDeliveryResponse>;
|
|
3247
|
+
/**
|
|
3248
|
+
* GET /v1/debit-notes/{id}/email-content — Get email content.
|
|
3249
|
+
* No idempotency-key.
|
|
3250
|
+
*/
|
|
3251
|
+
emailContent(id: string): Promise<EmailContentResponse>;
|
|
3252
|
+
/**
|
|
3253
|
+
* GET /v1/debit-notes/{id}/emails — List email delivery attempts.
|
|
3254
|
+
* No idempotency-key.
|
|
3255
|
+
*/
|
|
3256
|
+
listEmails(id: string): Promise<EmailDeliveryListResponse>;
|
|
3257
|
+
}
|
|
3258
|
+
|
|
3259
|
+
/**
|
|
3260
|
+
* InvoicesResource — full CRUD + email methods for /v1/invoices
|
|
3261
|
+
*
|
|
3262
|
+
* R03: create() and sendEmail() are POST cobrables — auto-generate idempotency-key.
|
|
3263
|
+
* R06: 6 methods: create, retrieve, list, sendEmail, emailContent, listEmails.
|
|
3264
|
+
* R07: Money fields (payable_amount) remain strings — no coercion.
|
|
3265
|
+
*/
|
|
3266
|
+
|
|
3267
|
+
/** Status values for the list filter. */
|
|
3268
|
+
type InvoiceStatus = 'draft' | 'processing' | 'signed' | 'accepted_by_dian' | 'rejected_by_dian' | 'accepted_contingency' | 'failed';
|
|
3269
|
+
interface InvoiceListParams {
|
|
3270
|
+
/** Max items to return (1–100, default 20). */
|
|
3271
|
+
limit?: number;
|
|
3272
|
+
/** Cursor from previous page (next_cursor field). */
|
|
3273
|
+
starting_after?: string;
|
|
3274
|
+
/** Filter by invoice status. */
|
|
3275
|
+
status?: InvoiceStatus;
|
|
3276
|
+
/** Filter by customer_id. */
|
|
3277
|
+
customer?: string;
|
|
3278
|
+
/** ISO-8601 date/datetime — include invoices created at or after. */
|
|
3279
|
+
'created[gte]'?: string;
|
|
3280
|
+
/** ISO-8601 date/datetime — include invoices created before. */
|
|
3281
|
+
'created[lt]'?: string;
|
|
3282
|
+
/** Filter by numbering prefix (e.g. "FE"). */
|
|
3283
|
+
number_prefix?: string;
|
|
3284
|
+
/** Filter by exact CUFE value. */
|
|
3285
|
+
cufe?: string;
|
|
3286
|
+
}
|
|
3287
|
+
interface InvoiceCreateOpts {
|
|
3288
|
+
/** Explicit idempotency key. When omitted a UUID v4 is auto-generated. */
|
|
3289
|
+
idempotencyKey?: string;
|
|
3290
|
+
}
|
|
3291
|
+
interface SendEmailOpts {
|
|
3292
|
+
/** Explicit idempotency key. When omitted a UUID v4 is auto-generated. */
|
|
3293
|
+
idempotencyKey?: string;
|
|
3294
|
+
}
|
|
3295
|
+
declare class InvoicesResource extends BaseResource {
|
|
3296
|
+
/**
|
|
3297
|
+
* POST /v1/invoices — Create a draft invoice.
|
|
3298
|
+
* Returns 202. Auto-generates idempotency-key (R03).
|
|
3299
|
+
*/
|
|
3300
|
+
create(body: CreateInvoiceRequest, opts?: InvoiceCreateOpts): Promise<InvoiceResponse>;
|
|
3301
|
+
/**
|
|
3302
|
+
* GET /v1/invoices/{id} — Retrieve invoice by ID (detail including lines).
|
|
3303
|
+
* No idempotency-key.
|
|
3304
|
+
*/
|
|
3305
|
+
retrieve(id: string): Promise<InvoiceDetailResponse>;
|
|
3306
|
+
/**
|
|
3307
|
+
* GET /v1/invoices — List invoices (cursor-paginated, filterable).
|
|
3308
|
+
* No idempotency-key.
|
|
3309
|
+
*/
|
|
3310
|
+
list(params?: InvoiceListParams): Promise<InvoiceListResponse>;
|
|
3311
|
+
/**
|
|
3312
|
+
* POST /v1/invoices/{id}/send-email — Manually resend the invoice email.
|
|
3313
|
+
* Returns 202. Auto-generates idempotency-key (R03).
|
|
3314
|
+
*/
|
|
3315
|
+
sendEmail(id: string, body?: SendEmailRequest, opts?: SendEmailOpts): Promise<EmailDeliveryResponse>;
|
|
3316
|
+
/**
|
|
3317
|
+
* GET /v1/invoices/{id}/email-content — Get email content (recipient, subject, AttachedDoc).
|
|
3318
|
+
* No idempotency-key.
|
|
3319
|
+
*/
|
|
3320
|
+
emailContent(id: string): Promise<EmailContentResponse>;
|
|
3321
|
+
/**
|
|
3322
|
+
* GET /v1/invoices/{id}/emails — List email delivery attempts.
|
|
3323
|
+
* No idempotency-key.
|
|
3324
|
+
*/
|
|
3325
|
+
listEmails(id: string): Promise<EmailDeliveryListResponse>;
|
|
3326
|
+
}
|
|
3327
|
+
|
|
3328
|
+
/**
|
|
3329
|
+
* NumberingResolutionsResource — read + write methods for /v1/numbering-resolutions
|
|
3330
|
+
*
|
|
3331
|
+
* R06: retrieve(id), list(params?), create(body, opts?), activate(id).
|
|
3332
|
+
* R03: create() auto-generates idempotency-key (openapi.json: Idempotency-Key required on POST /v1/numbering-resolutions).
|
|
3333
|
+
* activate() carries no idempotency-key (openapi.json: no header on POST /{id}/activate).
|
|
3334
|
+
*/
|
|
3335
|
+
|
|
3336
|
+
interface NumberingResolutionListParams {
|
|
3337
|
+
/** Number of results per page (1–100, default 20). */
|
|
3338
|
+
limit?: number;
|
|
3339
|
+
/** Opaque cursor for pagination. */
|
|
3340
|
+
starting_after?: string;
|
|
3341
|
+
}
|
|
3342
|
+
interface NumberingResolutionCreateOpts {
|
|
3343
|
+
/** Explicit idempotency key. When omitted a UUID v4 is auto-generated (R03). */
|
|
3344
|
+
idempotencyKey?: string;
|
|
3345
|
+
}
|
|
3346
|
+
declare class NumberingResolutionsResource extends BaseResource {
|
|
3347
|
+
/**
|
|
3348
|
+
* GET /v1/numbering-resolutions/{id}
|
|
3349
|
+
* Returns a numbering resolution by ID. 404 if not found or cross-tenant.
|
|
3350
|
+
*/
|
|
3351
|
+
retrieve(id: string): Promise<NumberingResolutionResponse>;
|
|
3352
|
+
/**
|
|
3353
|
+
* GET /v1/numbering-resolutions
|
|
3354
|
+
* Returns a cursor-paginated list of numbering resolutions.
|
|
3355
|
+
*/
|
|
3356
|
+
list(params?: NumberingResolutionListParams): Promise<NumberingResolutionListResponse>;
|
|
3357
|
+
/**
|
|
3358
|
+
* POST /v1/numbering-resolutions — Register a new DIAN resolution.
|
|
3359
|
+
* Returns 201. Auto-generates idempotency-key (R03 — openapi.json marks Idempotency-Key required).
|
|
3360
|
+
*/
|
|
3361
|
+
create(body: CreateNumberingResolutionRequest, opts?: NumberingResolutionCreateOpts): Promise<NumberingResolutionResponse>;
|
|
3362
|
+
/**
|
|
3363
|
+
* POST /v1/numbering-resolutions/{id}/activate — Mark this resolution as active.
|
|
3364
|
+
* Returns 200 with updated NumberingResolutionResponse. No idempotency-key.
|
|
3365
|
+
*/
|
|
3366
|
+
activate(id: string): Promise<NumberingResolutionResponse>;
|
|
3367
|
+
}
|
|
3368
|
+
|
|
3369
|
+
/**
|
|
3370
|
+
* TestResource — methods for /v1/test/* (test-mode only).
|
|
3371
|
+
*
|
|
3372
|
+
* R06: triggerEvent(body) → POST /v1/test/trigger-event.
|
|
3373
|
+
* R03: No auto-idempotency (openapi.json: no Idempotency-Key header on this endpoint).
|
|
3374
|
+
*
|
|
3375
|
+
* 403 PermissionError is thrown automatically by the HTTP transport when the API
|
|
3376
|
+
* key is a live key — no special handling needed here.
|
|
3377
|
+
*/
|
|
3378
|
+
|
|
3379
|
+
declare class TestResource extends BaseResource {
|
|
3380
|
+
/**
|
|
3381
|
+
* POST /v1/test/trigger-event — Manually fire a webhook event in test mode.
|
|
3382
|
+
* Returns 201 with TriggerEventResponse.
|
|
3383
|
+
* Throws PermissionError (403) if called with a live API key.
|
|
3384
|
+
* No idempotency-key.
|
|
3385
|
+
*/
|
|
3386
|
+
triggerEvent(body: TriggerEventBody): Promise<TriggerEventResponse>;
|
|
3387
|
+
}
|
|
3388
|
+
|
|
3389
|
+
/**
|
|
3390
|
+
* Emitia SDK client.
|
|
3391
|
+
*
|
|
3392
|
+
* R01: Constructor validates apiKey and merges opts. Throws synchronously on invalid key.
|
|
3393
|
+
* R02: HttpClient attaches Authorization + User-Agent to every request.
|
|
3394
|
+
*
|
|
3395
|
+
* Resource namespaces are readonly properties, instantiated in the constructor
|
|
3396
|
+
* with the private #http field. No getter stubs, no _transport leakage.
|
|
3397
|
+
*
|
|
3398
|
+
* PR2 auditor fix: removed _transport getter. #http is passed directly to each
|
|
3399
|
+
* resource in the constructor body — a class private field is accessible within
|
|
3400
|
+
* the class scope, so no public exposure is needed.
|
|
3401
|
+
*
|
|
3402
|
+
* PR3a: invoices, creditNotes, debitNotes wired as real readonly properties.
|
|
3403
|
+
* PR3b: customers write methods added; TestResource replaces test stub.
|
|
3404
|
+
*/
|
|
3405
|
+
|
|
3406
|
+
/** Options accepted by the Emitia constructor (all optional). */
|
|
3407
|
+
type EmitiaOptions = Partial<Omit<EmitiaConfig, 'apiKey'>>;
|
|
3408
|
+
declare class Emitia {
|
|
3409
|
+
#private;
|
|
3410
|
+
readonly account: AccountResource;
|
|
3411
|
+
readonly balance: BalanceResource;
|
|
3412
|
+
readonly catalogs: CatalogsResource;
|
|
3413
|
+
readonly certificates: CertificatesResource;
|
|
3414
|
+
readonly numberingResolutions: NumberingResolutionsResource;
|
|
3415
|
+
readonly customers: CustomersResource;
|
|
3416
|
+
readonly invoices: InvoicesResource;
|
|
3417
|
+
readonly creditNotes: CreditNotesResource;
|
|
3418
|
+
readonly debitNotes: DebitNotesResource;
|
|
3419
|
+
readonly test: TestResource;
|
|
3420
|
+
constructor(apiKey: string, opts?: EmitiaOptions);
|
|
3421
|
+
}
|
|
3422
|
+
|
|
3423
|
+
/**
|
|
3424
|
+
* Typed error hierarchy for the @emitia/node SDK.
|
|
3425
|
+
*
|
|
3426
|
+
* R05: Every non-2xx response → typed subclass of EmitiaError.
|
|
3427
|
+
*
|
|
3428
|
+
* Design: SDK redeclares its own hierarchy. Does NOT import @emitia/shared
|
|
3429
|
+
* at runtime — @emitia/shared is a backend-private package.
|
|
3430
|
+
*
|
|
3431
|
+
* Mapping:
|
|
3432
|
+
* 401 → AuthenticationError
|
|
3433
|
+
* 403 → PermissionError
|
|
3434
|
+
* 404 → NotFoundError
|
|
3435
|
+
* 422 → ValidationError
|
|
3436
|
+
* 429 → RateLimitError
|
|
3437
|
+
* 409 + type=idempotency_error → IdempotencyError
|
|
3438
|
+
* type=dian_rejected → DianRejectedError (any status)
|
|
3439
|
+
* all others → ApiError
|
|
3440
|
+
*/
|
|
3441
|
+
interface ErrorPayloadInner {
|
|
3442
|
+
type: string;
|
|
3443
|
+
code: string;
|
|
3444
|
+
message: string;
|
|
3445
|
+
doc_url?: string;
|
|
3446
|
+
request_id?: string;
|
|
3447
|
+
details?: unknown;
|
|
3448
|
+
}
|
|
3449
|
+
interface ErrorEnvelope {
|
|
3450
|
+
error: ErrorPayloadInner;
|
|
3451
|
+
}
|
|
3452
|
+
/** Narrows an unknown value to an ErrorEnvelope. No `!` usage. */
|
|
3453
|
+
declare function isErrorEnvelope(value: unknown): value is ErrorEnvelope;
|
|
3454
|
+
declare class EmitiaError extends Error {
|
|
3455
|
+
readonly type: string;
|
|
3456
|
+
readonly code: string;
|
|
3457
|
+
readonly requestId: string;
|
|
3458
|
+
readonly statusCode: number;
|
|
3459
|
+
readonly docUrl: string | undefined;
|
|
3460
|
+
readonly details: unknown;
|
|
3461
|
+
constructor(opts: {
|
|
3462
|
+
type: string;
|
|
3463
|
+
code: string;
|
|
3464
|
+
message: string;
|
|
3465
|
+
requestId: string;
|
|
3466
|
+
statusCode: number;
|
|
3467
|
+
docUrl?: string;
|
|
3468
|
+
details?: unknown;
|
|
3469
|
+
});
|
|
3470
|
+
}
|
|
3471
|
+
declare class AuthenticationError extends EmitiaError {
|
|
3472
|
+
}
|
|
3473
|
+
declare class PermissionError extends EmitiaError {
|
|
3474
|
+
}
|
|
3475
|
+
declare class NotFoundError extends EmitiaError {
|
|
3476
|
+
}
|
|
3477
|
+
declare class ValidationError extends EmitiaError {
|
|
3478
|
+
}
|
|
3479
|
+
declare class RateLimitError extends EmitiaError {
|
|
3480
|
+
}
|
|
3481
|
+
declare class IdempotencyError extends EmitiaError {
|
|
3482
|
+
}
|
|
3483
|
+
declare class DianRejectedError extends EmitiaError {
|
|
3484
|
+
}
|
|
3485
|
+
declare class DianUnavailableError extends EmitiaError {
|
|
3486
|
+
}
|
|
3487
|
+
declare class CertificateError extends EmitiaError {
|
|
3488
|
+
}
|
|
3489
|
+
declare class NumberingError extends EmitiaError {
|
|
3490
|
+
}
|
|
3491
|
+
/** Fallback for any type not explicitly mapped. */
|
|
3492
|
+
declare class ApiError extends EmitiaError {
|
|
3493
|
+
}
|
|
3494
|
+
/**
|
|
3495
|
+
* Build a typed error from an API error envelope + HTTP metadata.
|
|
3496
|
+
*
|
|
3497
|
+
* Resolution order:
|
|
3498
|
+
* 1. error.type in TYPE_TO_CLASS → use that class
|
|
3499
|
+
* 2. httpStatus in HTTP_STATUS_TO_CLASS → use that class
|
|
3500
|
+
* 3. fallback → ApiError
|
|
3501
|
+
*
|
|
3502
|
+
* requestId comes from the `X-Request-Id` response header (passed as parameter).
|
|
3503
|
+
*/
|
|
3504
|
+
declare function fromPayload(envelope: ErrorEnvelope, httpStatus: number, requestId: string): EmitiaError;
|
|
3505
|
+
|
|
3506
|
+
/**
|
|
3507
|
+
* Webhook signature verification for @emitia/node.
|
|
3508
|
+
*
|
|
3509
|
+
* R08: constructEvent() parses and validates the Emitia-Signature header,
|
|
3510
|
+
* verifies the HMAC-SHA256 signature timing-safely, checks timestamp freshness,
|
|
3511
|
+
* and returns the parsed event.
|
|
3512
|
+
*
|
|
3513
|
+
* Algorithm (source: apps/worker/src/processors/webhook-deliver.processor.ts L136–158):
|
|
3514
|
+
* t = Math.floor(Date.now() / 1000) — unix seconds
|
|
3515
|
+
* signed = `${t}.${rawBody}` — concatenate timestamp + raw body
|
|
3516
|
+
* v1 = HMAC-SHA256(secret, signed).digest('hex')
|
|
3517
|
+
* header = `t=${t},v1=${v1}` — Emitia-Signature header value
|
|
3518
|
+
*
|
|
3519
|
+
* Additional headers sent by worker (informational, NOT part of signature):
|
|
3520
|
+
* Emitia-Event-Id, Emitia-Event-Type
|
|
3521
|
+
*
|
|
3522
|
+
* Security notes:
|
|
3523
|
+
* - timingSafeEqual is used for HMAC comparison to prevent timing attacks.
|
|
3524
|
+
* - Length pre-check before timingSafeEqual: if lengths differ we reject
|
|
3525
|
+
* immediately (before calling timingSafeEqual which would throw on unequal
|
|
3526
|
+
* lengths) to prevent RangeError from leaking information.
|
|
3527
|
+
* - JSON.parse is called ONLY after signature verification — never on
|
|
3528
|
+
* unverified input first.
|
|
3529
|
+
*/
|
|
3530
|
+
/**
|
|
3531
|
+
* Emitia webhook event shape.
|
|
3532
|
+
*
|
|
3533
|
+
* Matches the canonical body built in webhook-deliver.processor.ts L137–143:
|
|
3534
|
+
* { id, type, api_version, created: tSeconds (number), data }
|
|
3535
|
+
*
|
|
3536
|
+
* NOTE: There is no shared schema in @emitia/openapi for the event envelope —
|
|
3537
|
+
* it is built inline in the worker. This type mirrors that shape exactly.
|
|
3538
|
+
*/
|
|
3539
|
+
interface EmitiaEvent {
|
|
3540
|
+
/** Event ID (e.g. "evt_01HX..."). */
|
|
3541
|
+
id: string;
|
|
3542
|
+
/** Event type (e.g. "invoice.accepted"). */
|
|
3543
|
+
type: string;
|
|
3544
|
+
/** API version that generated this event (e.g. "2024-01-01"). */
|
|
3545
|
+
api_version: string;
|
|
3546
|
+
/** Unix timestamp (seconds) when the event was created. */
|
|
3547
|
+
created: number;
|
|
3548
|
+
/** Event-specific payload. Shape depends on event.type. */
|
|
3549
|
+
data: unknown;
|
|
3550
|
+
}
|
|
3551
|
+
/** Reason codes for SignatureVerificationError. */
|
|
3552
|
+
type SignatureVerificationReason = 'no_signature' /** Header missing, empty, or unparseable. */ | 'timestamp_out_of_tolerance' /** |now - t| > toleranceSec. */ | 'signature_mismatch' /** HMAC does not match any v1 value in header. */ | 'invalid_payload'; /** Signature verified, but the body is not valid JSON. */
|
|
3553
|
+
/**
|
|
3554
|
+
* Thrown when constructEvent() cannot verify the webhook signature.
|
|
3555
|
+
*
|
|
3556
|
+
* Design: NOT a subclass of EmitiaError (which models HTTP API errors).
|
|
3557
|
+
* This error models a local crypto verification failure — no HTTP involved.
|
|
3558
|
+
*/
|
|
3559
|
+
declare class SignatureVerificationError extends Error {
|
|
3560
|
+
readonly reason: SignatureVerificationReason;
|
|
3561
|
+
constructor(reason: SignatureVerificationReason, message: string);
|
|
3562
|
+
}
|
|
3563
|
+
/**
|
|
3564
|
+
* Verify an Emitia webhook signature and return the parsed event.
|
|
3565
|
+
*
|
|
3566
|
+
* @param payload Raw request body — string or Buffer. Do NOT parse JSON first.
|
|
3567
|
+
* @param signatureHeader Value of the `Emitia-Signature` header (e.g. `t=...,v1=...`).
|
|
3568
|
+
* @param secret Webhook endpoint signing secret.
|
|
3569
|
+
* @param toleranceSec Maximum allowed age of the event in seconds (default: 300).
|
|
3570
|
+
* @param nowSec Injectable clock (returns current unix seconds). Defaults to
|
|
3571
|
+
* Math.floor(Date.now() / 1000). Exposed for deterministic tests.
|
|
3572
|
+
* @returns Parsed and verified {@link EmitiaEvent}.
|
|
3573
|
+
* @throws {SignatureVerificationError} When the header is invalid, the timestamp is
|
|
3574
|
+
* out of tolerance, or the signature does not match.
|
|
3575
|
+
*/
|
|
3576
|
+
declare function constructEvent(payload: string | Buffer, signatureHeader: string, secret: string, toleranceSec?: number, nowSec?: () => number): EmitiaEvent;
|
|
3577
|
+
|
|
3578
|
+
/**
|
|
3579
|
+
* SDK version constant.
|
|
3580
|
+
*
|
|
3581
|
+
* ADR-5: Declared as a plain string constant matching package.json#version.
|
|
3582
|
+
* Not imported via import JSON (fragile ESM) — kept in sync by a test guard
|
|
3583
|
+
* (src/__tests__/version.test.ts) that fails if they diverge.
|
|
3584
|
+
*/
|
|
3585
|
+
declare const SDK_VERSION = "0.1.0";
|
|
3586
|
+
|
|
3587
|
+
export { type AccountInfo, ApiError, AuthenticationError, type BalanceResponse, type CatalogItem, type CatalogListResponse, CertificateError, type CertificateListResponse, type CertificateResponse, type CreateCertificateRequest, type CreateCreditNoteRequest, type CreateCustomerRequest, type CreateDebitNoteRequest, type CreateInvoiceRequest, type CreateNumberingResolutionRequest, type CreditNoteDetailResponse, type CreditNoteListResponse, type CreditNoteResponse, type CustomerListResponse, type CustomerResponse, type DebitNoteDetailResponse, type DebitNoteListResponse, type DebitNoteResponse, DianRejectedError, DianUnavailableError, type EmailContentResponse, type EmailDeliveryListResponse, type EmailDeliveryResponse, Emitia, EmitiaError, type EmitiaEvent, type EmitiaOptions, IdempotencyError, type InvoiceDetailResponse, type InvoiceListResponse, type InvoiceResponse, type MunicipioItem, type MunicipioListResponse, NotFoundError, NumberingError, type NumberingResolutionListResponse, type NumberingResolutionResponse, PermissionError, RateLimitError, SDK_VERSION, type SendEmailRequest, SignatureVerificationError, type SignatureVerificationReason, type TriggerEventBody, type TriggerEventResponse, ValidationError, constructEvent, fromPayload, isErrorEnvelope };
|