@factucat/public-api-contracts 0.2.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.
@@ -0,0 +1,62 @@
1
+ import { z } from 'zod';
2
+ export declare const customerCurrencySchema: z.ZodEnum<{
3
+ MXN: "MXN";
4
+ USD: "USD";
5
+ EUR: "EUR";
6
+ }>;
7
+ export declare const customerInvoiceLanguageSchema: z.ZodEnum<{
8
+ es: "es";
9
+ en: "en";
10
+ }>;
11
+ export declare const customerCreateInputSchema: z.ZodObject<{
12
+ legalName: z.ZodString;
13
+ rfc: z.ZodString;
14
+ postalCode: z.ZodString;
15
+ taxRegime: z.ZodString;
16
+ fiscalResidence: z.ZodOptional<z.ZodString>;
17
+ taxId: z.ZodOptional<z.ZodString>;
18
+ email: z.ZodOptional<z.ZodEmail>;
19
+ whatsappPhone: z.ZodOptional<z.ZodString>;
20
+ sendInvoices: z.ZodDefault<z.ZodBoolean>;
21
+ invoiceLanguage: z.ZodDefault<z.ZodEnum<{
22
+ es: "es";
23
+ en: "en";
24
+ }>>;
25
+ currency: z.ZodDefault<z.ZodEnum<{
26
+ MXN: "MXN";
27
+ USD: "USD";
28
+ EUR: "EUR";
29
+ }>>;
30
+ }, z.core.$strip>;
31
+ export declare const customerRecordSchema: z.ZodObject<{
32
+ id: z.ZodUUID;
33
+ userId: z.ZodString;
34
+ legalName: z.ZodString;
35
+ rfc: z.ZodString;
36
+ postalCode: z.ZodString;
37
+ taxRegime: z.ZodString;
38
+ fiscalResidence: z.ZodOptional<z.ZodString>;
39
+ taxId: z.ZodOptional<z.ZodString>;
40
+ email: z.ZodOptional<z.ZodEmail>;
41
+ whatsappPhone: z.ZodOptional<z.ZodString>;
42
+ sendInvoices: z.ZodBoolean;
43
+ invoiceLanguage: z.ZodEnum<{
44
+ es: "es";
45
+ en: "en";
46
+ }>;
47
+ currency: z.ZodEnum<{
48
+ MXN: "MXN";
49
+ USD: "USD";
50
+ EUR: "EUR";
51
+ }>;
52
+ createdAt: z.ZodISODateTime;
53
+ updatedAt: z.ZodISODateTime;
54
+ }, z.core.$strip>;
55
+ export declare const customerListQuerySchema: z.ZodObject<{
56
+ query: z.ZodOptional<z.ZodString>;
57
+ limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
58
+ }, z.core.$strip>;
59
+ export type CustomerCreateInput = z.infer<typeof customerCreateInputSchema>;
60
+ export type CustomerRecord = z.infer<typeof customerRecordSchema>;
61
+ export type CustomerListQuery = z.infer<typeof customerListQuerySchema>;
62
+ //# sourceMappingURL=customers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customers.d.ts","sourceRoot":"","sources":["../src/customers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,sBAAsB;;;;EAAgC,CAAA;AACnE,eAAO,MAAM,6BAA6B;;;EAAuB,CAAA;AAEjE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;iBAYpC,CAAA;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;iBAgB/B,CAAA;AAEF,eAAO,MAAM,uBAAuB;;;iBAGlC,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAC3E,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AACjE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA"}
@@ -0,0 +1,38 @@
1
+ import { z } from 'zod';
2
+ export const customerCurrencySchema = z.enum(['MXN', 'USD', 'EUR']);
3
+ export const customerInvoiceLanguageSchema = z.enum(['es', 'en']);
4
+ export const customerCreateInputSchema = z.object({
5
+ legalName: z.string().trim().min(2).max(200),
6
+ rfc: z.string().trim().min(12).max(13),
7
+ postalCode: z.string().trim().regex(/^\d{5}$/),
8
+ taxRegime: z.string().trim().min(1).max(10),
9
+ fiscalResidence: z.string().trim().min(3).max(3).optional(),
10
+ taxId: z.string().trim().max(80).optional(),
11
+ email: z.email().optional(),
12
+ whatsappPhone: z.string().trim().min(6).max(30).optional(),
13
+ sendInvoices: z.boolean().default(true),
14
+ invoiceLanguage: customerInvoiceLanguageSchema.default('es'),
15
+ currency: customerCurrencySchema.default('MXN'),
16
+ });
17
+ export const customerRecordSchema = z.object({
18
+ id: z.uuid(),
19
+ userId: z.string().trim().min(1),
20
+ legalName: z.string(),
21
+ rfc: z.string(),
22
+ postalCode: z.string(),
23
+ taxRegime: z.string(),
24
+ fiscalResidence: z.string().optional(),
25
+ taxId: z.string().optional(),
26
+ email: z.email().optional(),
27
+ whatsappPhone: z.string().optional(),
28
+ sendInvoices: z.boolean(),
29
+ invoiceLanguage: customerInvoiceLanguageSchema,
30
+ currency: customerCurrencySchema,
31
+ createdAt: z.iso.datetime(),
32
+ updatedAt: z.iso.datetime(),
33
+ });
34
+ export const customerListQuerySchema = z.object({
35
+ query: z.string().trim().min(1).max(120).optional(),
36
+ limit: z.coerce.number().int().min(1).max(100).optional(),
37
+ });
38
+ //# sourceMappingURL=customers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customers.js","sourceRoot":"","sources":["../src/customers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAA;AACnE,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAA;AAEjE,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI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C,GAAG,CAAC,CAAC,CAAC;IAChC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACtC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;IAC3B,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE;IACzB,eAAe,EAAE,6BAA6B;IAC9C,QAAQ,EAAE,sBAAsB;IAChC,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE;IAC3B,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE;CAC5B,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IACnD,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;CAC1D,CAAC,CAAA"}
@@ -0,0 +1,73 @@
1
+ import { z } from 'zod';
2
+ export declare const publicResponseMetaSchema: z.ZodObject<{
3
+ requestId: z.ZodString;
4
+ idempotencyKey: z.ZodOptional<z.ZodString>;
5
+ }, z.core.$strip>;
6
+ export declare const publicApiErrorCodeSchema: z.ZodEnum<{
7
+ bad_request: "bad_request";
8
+ conflict: "conflict";
9
+ internal_error: "internal_error";
10
+ invalid_api_key: "invalid_api_key";
11
+ invalid_json: "invalid_json";
12
+ method_not_allowed: "method_not_allowed";
13
+ missing_api_key: "missing_api_key";
14
+ missing_idempotency_key: "missing_idempotency_key";
15
+ missing_scope: "missing_scope";
16
+ not_found: "not_found";
17
+ validation_error: "validation_error";
18
+ idempotency_conflict: "idempotency_conflict";
19
+ idempotency_in_progress: "idempotency_in_progress";
20
+ }>;
21
+ export declare const publicErrorSchema: z.ZodObject<{
22
+ code: z.ZodEnum<{
23
+ bad_request: "bad_request";
24
+ conflict: "conflict";
25
+ internal_error: "internal_error";
26
+ invalid_api_key: "invalid_api_key";
27
+ invalid_json: "invalid_json";
28
+ method_not_allowed: "method_not_allowed";
29
+ missing_api_key: "missing_api_key";
30
+ missing_idempotency_key: "missing_idempotency_key";
31
+ missing_scope: "missing_scope";
32
+ not_found: "not_found";
33
+ validation_error: "validation_error";
34
+ idempotency_conflict: "idempotency_conflict";
35
+ idempotency_in_progress: "idempotency_in_progress";
36
+ }>;
37
+ message: z.ZodString;
38
+ requestId: z.ZodString;
39
+ retryable: z.ZodDefault<z.ZodBoolean>;
40
+ }, z.core.$strip>;
41
+ export declare const publicErrorEnvelopeSchema: z.ZodObject<{
42
+ error: z.ZodObject<{
43
+ code: z.ZodEnum<{
44
+ bad_request: "bad_request";
45
+ conflict: "conflict";
46
+ internal_error: "internal_error";
47
+ invalid_api_key: "invalid_api_key";
48
+ invalid_json: "invalid_json";
49
+ method_not_allowed: "method_not_allowed";
50
+ missing_api_key: "missing_api_key";
51
+ missing_idempotency_key: "missing_idempotency_key";
52
+ missing_scope: "missing_scope";
53
+ not_found: "not_found";
54
+ validation_error: "validation_error";
55
+ idempotency_conflict: "idempotency_conflict";
56
+ idempotency_in_progress: "idempotency_in_progress";
57
+ }>;
58
+ message: z.ZodString;
59
+ requestId: z.ZodString;
60
+ retryable: z.ZodDefault<z.ZodBoolean>;
61
+ }, z.core.$strip>;
62
+ }, z.core.$strip>;
63
+ export declare function createPublicSuccessEnvelopeSchema<TSchema extends z.ZodTypeAny>(dataSchema: TSchema): z.ZodObject<{
64
+ data: TSchema;
65
+ meta: z.ZodObject<{
66
+ requestId: z.ZodString;
67
+ idempotencyKey: z.ZodOptional<z.ZodString>;
68
+ }, z.core.$strip>;
69
+ }, z.core.$strip>;
70
+ export type PublicResponseMeta = z.infer<typeof publicResponseMetaSchema>;
71
+ export type PublicApiErrorCode = z.infer<typeof publicApiErrorCodeSchema>;
72
+ export type PublicErrorEnvelope = z.infer<typeof publicErrorEnvelopeSchema>;
73
+ //# sourceMappingURL=envelope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"envelope.d.ts","sourceRoot":"","sources":["../src/envelope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,wBAAwB;;;iBAGnC,CAAA;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;EAcnC,CAAA;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;iBAK5B,CAAA;AAEF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;iBAEpC,CAAA;AAEF,wBAAgB,iCAAiC,CAAC,OAAO,SAAS,CAAC,CAAC,UAAU,EAC5E,UAAU,EAAE,OAAO;;;;;;kBAMpB;AAED,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AACzE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AACzE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA"}
@@ -0,0 +1,36 @@
1
+ import { z } from 'zod';
2
+ export const publicResponseMetaSchema = z.object({
3
+ requestId: z.string().trim().min(1),
4
+ idempotencyKey: z.string().trim().min(1).optional(),
5
+ });
6
+ export const publicApiErrorCodeSchema = z.enum([
7
+ 'bad_request',
8
+ 'conflict',
9
+ 'internal_error',
10
+ 'invalid_api_key',
11
+ 'invalid_json',
12
+ 'method_not_allowed',
13
+ 'missing_api_key',
14
+ 'missing_idempotency_key',
15
+ 'missing_scope',
16
+ 'not_found',
17
+ 'validation_error',
18
+ 'idempotency_conflict',
19
+ 'idempotency_in_progress',
20
+ ]);
21
+ export const publicErrorSchema = z.object({
22
+ code: publicApiErrorCodeSchema,
23
+ message: z.string().trim().min(1),
24
+ requestId: z.string().trim().min(1),
25
+ retryable: z.boolean().default(false),
26
+ });
27
+ export const publicErrorEnvelopeSchema = z.object({
28
+ error: publicErrorSchema,
29
+ });
30
+ export function createPublicSuccessEnvelopeSchema(dataSchema) {
31
+ return z.object({
32
+ data: dataSchema,
33
+ meta: publicResponseMetaSchema,
34
+ });
35
+ }
36
+ //# sourceMappingURL=envelope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"envelope.js","sourceRoot":"","sources":["../src/envelope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACnC,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CACpD,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC7C,aAAa;IACb,UAAU;IACV,gBAAgB;IAChB,iBAAiB;IACjB,cAAc;IACd,oBAAoB;IACpB,iBAAiB;IACjB,yBAAyB;IACzB,eAAe;IACf,WAAW;IACX,kBAAkB;IAClB,sBAAsB;IACtB,yBAAyB;CAC1B,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,IAAI,EAAE,wBAAwB;IAC9B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACjC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACnC,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;CACtC,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,KAAK,EAAE,iBAAiB;CACzB,CAAC,CAAA;AAEF,MAAM,UAAU,iCAAiC,CAC/C,UAAmB;IAEnB,OAAO,CAAC,CAAC,MAAM,CAAC;QACd,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,wBAAwB;KAC/B,CAAC,CAAA;AACJ,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './customers';
2
+ export * from './envelope';
3
+ export * from './invoices';
4
+ export * from './me';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,MAAM,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ export * from './customers';
2
+ export * from './envelope';
3
+ export * from './invoices';
4
+ export * from './me';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,MAAM,CAAA"}
@@ -0,0 +1,415 @@
1
+ import { z } from 'zod';
2
+ export declare const invoiceStatusSchema: z.ZodEnum<{
3
+ error: "error";
4
+ draft: "draft";
5
+ issued: "issued";
6
+ cancelled: "cancelled";
7
+ }>;
8
+ export declare const invoiceVatRateSchema: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<0.1>, z.ZodLiteral<0.16>]>;
9
+ export declare const invoiceIsrWithholdingRateSchema: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<0.0125>, z.ZodLiteral<0.1>]>;
10
+ export declare const invoiceItemTaxSourceSchema: z.ZodEnum<{
11
+ default: "default";
12
+ manual: "manual";
13
+ inferred: "inferred";
14
+ }>;
15
+ export declare const invoiceSuggestionSourceSchema: z.ZodEnum<{
16
+ manual: "manual";
17
+ ai: "ai";
18
+ memory: "memory";
19
+ review: "review";
20
+ }>;
21
+ export declare const invoiceListQuerySchema: z.ZodObject<{
22
+ query: z.ZodOptional<z.ZodString>;
23
+ status: z.ZodOptional<z.ZodEnum<{
24
+ error: "error";
25
+ draft: "draft";
26
+ issued: "issued";
27
+ cancelled: "cancelled";
28
+ }>>;
29
+ limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
30
+ }, z.core.$strip>;
31
+ export declare const draftListQuerySchema: z.ZodObject<{
32
+ query: z.ZodOptional<z.ZodString>;
33
+ limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
34
+ }, z.core.$strip>;
35
+ export declare const invoiceItemRecordSchema: z.ZodObject<{
36
+ id: z.ZodUUID;
37
+ invoiceId: z.ZodUUID;
38
+ position: z.ZodNumber;
39
+ productCode: z.ZodOptional<z.ZodString>;
40
+ unitCode: z.ZodString;
41
+ description: z.ZodString;
42
+ quantity: z.ZodNumber;
43
+ unitPrice: z.ZodNumber;
44
+ amount: z.ZodNumber;
45
+ vatRate: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<0.1>, z.ZodLiteral<0.16>]>;
46
+ vatSource: z.ZodOptional<z.ZodEnum<{
47
+ default: "default";
48
+ manual: "manual";
49
+ inferred: "inferred";
50
+ }>>;
51
+ vatReason: z.ZodOptional<z.ZodString>;
52
+ isrWithholdingRate: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<0.0125>, z.ZodLiteral<0.1>]>;
53
+ isrWithholdingSource: z.ZodOptional<z.ZodEnum<{
54
+ default: "default";
55
+ manual: "manual";
56
+ inferred: "inferred";
57
+ }>>;
58
+ isrWithholdingReason: z.ZodOptional<z.ZodString>;
59
+ suggestedProductCode: z.ZodOptional<z.ZodString>;
60
+ suggestionConfidence: z.ZodOptional<z.ZodNumber>;
61
+ suggestionSource: z.ZodOptional<z.ZodEnum<{
62
+ manual: "manual";
63
+ ai: "ai";
64
+ memory: "memory";
65
+ review: "review";
66
+ }>>;
67
+ }, z.core.$strip>;
68
+ export declare const draftCreateInputSchema: z.ZodObject<{
69
+ customerId: z.ZodOptional<z.ZodUUID>;
70
+ receiverRfc: z.ZodOptional<z.ZodString>;
71
+ receiverLegalName: z.ZodOptional<z.ZodString>;
72
+ receiverPostalCode: z.ZodOptional<z.ZodString>;
73
+ receiverTaxRegime: z.ZodOptional<z.ZodString>;
74
+ receiverFiscalResidence: z.ZodOptional<z.ZodString>;
75
+ receiverTaxId: z.ZodOptional<z.ZodString>;
76
+ receiverEmail: z.ZodOptional<z.ZodEmail>;
77
+ receiverInvoiceLanguage: z.ZodOptional<z.ZodEnum<{
78
+ es: "es";
79
+ en: "en";
80
+ }>>;
81
+ currency: z.ZodOptional<z.ZodEnum<{
82
+ MXN: "MXN";
83
+ USD: "USD";
84
+ EUR: "EUR";
85
+ }>>;
86
+ cfdiUse: z.ZodOptional<z.ZodString>;
87
+ }, z.core.$strip>;
88
+ export declare const draftSetReceiverInputSchema: z.ZodObject<{
89
+ customerId: z.ZodNullable<z.ZodOptional<z.ZodUUID>>;
90
+ receiverRfc: z.ZodOptional<z.ZodString>;
91
+ receiverLegalName: z.ZodOptional<z.ZodString>;
92
+ receiverPostalCode: z.ZodOptional<z.ZodString>;
93
+ receiverTaxRegime: z.ZodOptional<z.ZodString>;
94
+ receiverFiscalResidence: z.ZodNullable<z.ZodOptional<z.ZodString>>;
95
+ receiverTaxId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
96
+ receiverEmail: z.ZodNullable<z.ZodOptional<z.ZodEmail>>;
97
+ receiverInvoiceLanguage: z.ZodOptional<z.ZodEnum<{
98
+ es: "es";
99
+ en: "en";
100
+ }>>;
101
+ }, z.core.$strip>;
102
+ export declare const draftSetMetaInputSchema: z.ZodObject<{
103
+ cfdiUse: z.ZodOptional<z.ZodString>;
104
+ paymentMethod: z.ZodOptional<z.ZodString>;
105
+ paymentForm: z.ZodOptional<z.ZodString>;
106
+ currency: z.ZodOptional<z.ZodEnum<{
107
+ MXN: "MXN";
108
+ USD: "USD";
109
+ EUR: "EUR";
110
+ }>>;
111
+ exchangeRate: z.ZodOptional<z.ZodNumber>;
112
+ exchangeRateDate: z.ZodOptional<z.ZodISODateTime>;
113
+ vatRate: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<0.1>, z.ZodLiteral<0.16>]>>;
114
+ customerNotes: z.ZodNullable<z.ZodOptional<z.ZodString>>;
115
+ pdfLanguage: z.ZodOptional<z.ZodEnum<{
116
+ es: "es";
117
+ en: "en";
118
+ }>>;
119
+ }, z.core.$strip>;
120
+ export declare const draftAddItemInputSchema: z.ZodObject<{
121
+ position: z.ZodOptional<z.ZodNumber>;
122
+ productCode: z.ZodOptional<z.ZodString>;
123
+ unitCode: z.ZodOptional<z.ZodString>;
124
+ description: z.ZodString;
125
+ quantity: z.ZodDefault<z.ZodNumber>;
126
+ unitPrice: z.ZodNumber;
127
+ vatRate: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<0.1>, z.ZodLiteral<0.16>]>>;
128
+ vatSource: z.ZodOptional<z.ZodEnum<{
129
+ default: "default";
130
+ manual: "manual";
131
+ inferred: "inferred";
132
+ }>>;
133
+ isrWithholdingRate: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<0.0125>, z.ZodLiteral<0.1>]>>;
134
+ isrWithholdingSource: z.ZodOptional<z.ZodEnum<{
135
+ default: "default";
136
+ manual: "manual";
137
+ inferred: "inferred";
138
+ }>>;
139
+ suggestedProductCode: z.ZodOptional<z.ZodString>;
140
+ suggestionConfidence: z.ZodOptional<z.ZodNumber>;
141
+ suggestionSource: z.ZodOptional<z.ZodEnum<{
142
+ manual: "manual";
143
+ ai: "ai";
144
+ memory: "memory";
145
+ review: "review";
146
+ }>>;
147
+ }, z.core.$strip>;
148
+ export declare const draftUpdateItemInputSchema: z.ZodObject<{
149
+ position: z.ZodOptional<z.ZodNumber>;
150
+ productCode: z.ZodOptional<z.ZodString>;
151
+ unitCode: z.ZodOptional<z.ZodString>;
152
+ description: z.ZodOptional<z.ZodString>;
153
+ quantity: z.ZodOptional<z.ZodNumber>;
154
+ unitPrice: z.ZodOptional<z.ZodNumber>;
155
+ vatRate: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<0.1>, z.ZodLiteral<0.16>]>>;
156
+ vatSource: z.ZodOptional<z.ZodEnum<{
157
+ default: "default";
158
+ manual: "manual";
159
+ inferred: "inferred";
160
+ }>>;
161
+ isrWithholdingRate: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<0.0125>, z.ZodLiteral<0.1>]>>;
162
+ isrWithholdingSource: z.ZodOptional<z.ZodEnum<{
163
+ default: "default";
164
+ manual: "manual";
165
+ inferred: "inferred";
166
+ }>>;
167
+ suggestedProductCode: z.ZodOptional<z.ZodString>;
168
+ suggestionConfidence: z.ZodOptional<z.ZodNumber>;
169
+ suggestionSource: z.ZodOptional<z.ZodEnum<{
170
+ manual: "manual";
171
+ ai: "ai";
172
+ memory: "memory";
173
+ review: "review";
174
+ }>>;
175
+ }, z.core.$strip>;
176
+ export declare const draftStampInputSchema: z.ZodObject<{
177
+ skipIssuedEmailSend: z.ZodOptional<z.ZodBoolean>;
178
+ sendToCustomerContacts: z.ZodOptional<z.ZodBoolean>;
179
+ sendCustomerEmail: z.ZodOptional<z.ZodBoolean>;
180
+ sendCustomerWhatsApp: z.ZodOptional<z.ZodBoolean>;
181
+ allowPaidStampOverdraft: z.ZodOptional<z.ZodBoolean>;
182
+ }, z.core.$strip>;
183
+ export declare const invoiceRecordSchema: z.ZodObject<{
184
+ id: z.ZodUUID;
185
+ userId: z.ZodString;
186
+ customerId: z.ZodOptional<z.ZodUUID>;
187
+ receiverRfc: z.ZodString;
188
+ receiverLegalName: z.ZodString;
189
+ receiverPostalCode: z.ZodString;
190
+ receiverTaxRegime: z.ZodString;
191
+ receiverFiscalResidence: z.ZodOptional<z.ZodString>;
192
+ receiverTaxId: z.ZodOptional<z.ZodString>;
193
+ receiverEmail: z.ZodOptional<z.ZodEmail>;
194
+ receiverInvoiceLanguage: z.ZodEnum<{
195
+ es: "es";
196
+ en: "en";
197
+ }>;
198
+ serie: z.ZodOptional<z.ZodString>;
199
+ folio: z.ZodOptional<z.ZodString>;
200
+ satUuid: z.ZodOptional<z.ZodString>;
201
+ status: z.ZodEnum<{
202
+ error: "error";
203
+ draft: "draft";
204
+ issued: "issued";
205
+ cancelled: "cancelled";
206
+ }>;
207
+ cfdiType: z.ZodString;
208
+ cfdiUse: z.ZodString;
209
+ paymentMethod: z.ZodOptional<z.ZodString>;
210
+ paymentForm: z.ZodOptional<z.ZodString>;
211
+ currency: z.ZodEnum<{
212
+ MXN: "MXN";
213
+ USD: "USD";
214
+ EUR: "EUR";
215
+ }>;
216
+ exchangeRate: z.ZodNumber;
217
+ exchangeRateDate: z.ZodOptional<z.ZodISODateTime>;
218
+ subtotal: z.ZodNumber;
219
+ vatRate: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<0.1>, z.ZodLiteral<0.16>]>;
220
+ taxTotal: z.ZodNumber;
221
+ total: z.ZodNumber;
222
+ customerNotes: z.ZodOptional<z.ZodString>;
223
+ pdfLanguage: z.ZodEnum<{
224
+ es: "es";
225
+ en: "en";
226
+ }>;
227
+ errorMessage: z.ZodOptional<z.ZodString>;
228
+ issuedAt: z.ZodOptional<z.ZodISODateTime>;
229
+ cancelledAt: z.ZodOptional<z.ZodISODateTime>;
230
+ createdAt: z.ZodISODateTime;
231
+ updatedAt: z.ZodISODateTime;
232
+ items: z.ZodArray<z.ZodObject<{
233
+ id: z.ZodUUID;
234
+ invoiceId: z.ZodUUID;
235
+ position: z.ZodNumber;
236
+ productCode: z.ZodOptional<z.ZodString>;
237
+ unitCode: z.ZodString;
238
+ description: z.ZodString;
239
+ quantity: z.ZodNumber;
240
+ unitPrice: z.ZodNumber;
241
+ amount: z.ZodNumber;
242
+ vatRate: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<0.1>, z.ZodLiteral<0.16>]>;
243
+ vatSource: z.ZodOptional<z.ZodEnum<{
244
+ default: "default";
245
+ manual: "manual";
246
+ inferred: "inferred";
247
+ }>>;
248
+ vatReason: z.ZodOptional<z.ZodString>;
249
+ isrWithholdingRate: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<0.0125>, z.ZodLiteral<0.1>]>;
250
+ isrWithholdingSource: z.ZodOptional<z.ZodEnum<{
251
+ default: "default";
252
+ manual: "manual";
253
+ inferred: "inferred";
254
+ }>>;
255
+ isrWithholdingReason: z.ZodOptional<z.ZodString>;
256
+ suggestedProductCode: z.ZodOptional<z.ZodString>;
257
+ suggestionConfidence: z.ZodOptional<z.ZodNumber>;
258
+ suggestionSource: z.ZodOptional<z.ZodEnum<{
259
+ manual: "manual";
260
+ ai: "ai";
261
+ memory: "memory";
262
+ review: "review";
263
+ }>>;
264
+ }, z.core.$strip>>;
265
+ }, z.core.$strip>;
266
+ export declare const draftRecordSchema: z.ZodObject<{
267
+ id: z.ZodUUID;
268
+ userId: z.ZodString;
269
+ customerId: z.ZodOptional<z.ZodUUID>;
270
+ receiverRfc: z.ZodString;
271
+ receiverLegalName: z.ZodString;
272
+ receiverPostalCode: z.ZodString;
273
+ receiverTaxRegime: z.ZodString;
274
+ receiverFiscalResidence: z.ZodOptional<z.ZodString>;
275
+ receiverTaxId: z.ZodOptional<z.ZodString>;
276
+ receiverEmail: z.ZodOptional<z.ZodEmail>;
277
+ receiverInvoiceLanguage: z.ZodEnum<{
278
+ es: "es";
279
+ en: "en";
280
+ }>;
281
+ serie: z.ZodOptional<z.ZodString>;
282
+ folio: z.ZodOptional<z.ZodString>;
283
+ satUuid: z.ZodOptional<z.ZodString>;
284
+ status: z.ZodEnum<{
285
+ error: "error";
286
+ draft: "draft";
287
+ issued: "issued";
288
+ cancelled: "cancelled";
289
+ }>;
290
+ cfdiType: z.ZodString;
291
+ cfdiUse: z.ZodString;
292
+ paymentMethod: z.ZodOptional<z.ZodString>;
293
+ paymentForm: z.ZodOptional<z.ZodString>;
294
+ currency: z.ZodEnum<{
295
+ MXN: "MXN";
296
+ USD: "USD";
297
+ EUR: "EUR";
298
+ }>;
299
+ exchangeRate: z.ZodNumber;
300
+ exchangeRateDate: z.ZodOptional<z.ZodISODateTime>;
301
+ subtotal: z.ZodNumber;
302
+ vatRate: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<0.1>, z.ZodLiteral<0.16>]>;
303
+ taxTotal: z.ZodNumber;
304
+ total: z.ZodNumber;
305
+ customerNotes: z.ZodOptional<z.ZodString>;
306
+ pdfLanguage: z.ZodEnum<{
307
+ es: "es";
308
+ en: "en";
309
+ }>;
310
+ errorMessage: z.ZodOptional<z.ZodString>;
311
+ issuedAt: z.ZodOptional<z.ZodISODateTime>;
312
+ cancelledAt: z.ZodOptional<z.ZodISODateTime>;
313
+ createdAt: z.ZodISODateTime;
314
+ updatedAt: z.ZodISODateTime;
315
+ items: z.ZodArray<z.ZodObject<{
316
+ id: z.ZodUUID;
317
+ invoiceId: z.ZodUUID;
318
+ position: z.ZodNumber;
319
+ productCode: z.ZodOptional<z.ZodString>;
320
+ unitCode: z.ZodString;
321
+ description: z.ZodString;
322
+ quantity: z.ZodNumber;
323
+ unitPrice: z.ZodNumber;
324
+ amount: z.ZodNumber;
325
+ vatRate: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<0.1>, z.ZodLiteral<0.16>]>;
326
+ vatSource: z.ZodOptional<z.ZodEnum<{
327
+ default: "default";
328
+ manual: "manual";
329
+ inferred: "inferred";
330
+ }>>;
331
+ vatReason: z.ZodOptional<z.ZodString>;
332
+ isrWithholdingRate: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<0.0125>, z.ZodLiteral<0.1>]>;
333
+ isrWithholdingSource: z.ZodOptional<z.ZodEnum<{
334
+ default: "default";
335
+ manual: "manual";
336
+ inferred: "inferred";
337
+ }>>;
338
+ isrWithholdingReason: z.ZodOptional<z.ZodString>;
339
+ suggestedProductCode: z.ZodOptional<z.ZodString>;
340
+ suggestionConfidence: z.ZodOptional<z.ZodNumber>;
341
+ suggestionSource: z.ZodOptional<z.ZodEnum<{
342
+ manual: "manual";
343
+ ai: "ai";
344
+ memory: "memory";
345
+ review: "review";
346
+ }>>;
347
+ }, z.core.$strip>>;
348
+ }, z.core.$strip>;
349
+ export declare const invoiceListItemSchema: z.ZodObject<{
350
+ id: z.ZodUUID;
351
+ folio: z.ZodString;
352
+ status: z.ZodEnum<{
353
+ error: "error";
354
+ draft: "draft";
355
+ issued: "issued";
356
+ cancelled: "cancelled";
357
+ }>;
358
+ receiverLegalName: z.ZodString;
359
+ receiverEmail: z.ZodOptional<z.ZodEmail>;
360
+ currency: z.ZodEnum<{
361
+ MXN: "MXN";
362
+ USD: "USD";
363
+ EUR: "EUR";
364
+ }>;
365
+ total: z.ZodNumber;
366
+ createdAt: z.ZodISODateTime;
367
+ updatedAt: z.ZodISODateTime;
368
+ issuedAt: z.ZodOptional<z.ZodISODateTime>;
369
+ errorMessage: z.ZodOptional<z.ZodString>;
370
+ }, z.core.$strip>;
371
+ export declare const draftListItemSchema: z.ZodObject<{
372
+ id: z.ZodUUID;
373
+ folio: z.ZodString;
374
+ receiverLegalName: z.ZodString;
375
+ receiverEmail: z.ZodOptional<z.ZodEmail>;
376
+ currency: z.ZodEnum<{
377
+ MXN: "MXN";
378
+ USD: "USD";
379
+ EUR: "EUR";
380
+ }>;
381
+ total: z.ZodNumber;
382
+ createdAt: z.ZodISODateTime;
383
+ updatedAt: z.ZodISODateTime;
384
+ issuedAt: z.ZodOptional<z.ZodISODateTime>;
385
+ errorMessage: z.ZodOptional<z.ZodString>;
386
+ status: z.ZodEnum<{
387
+ error: "error";
388
+ draft: "draft";
389
+ }>;
390
+ }, z.core.$strip>;
391
+ export declare const invoiceXmlOutputSchema: z.ZodObject<{
392
+ fileName: z.ZodString;
393
+ mimeType: z.ZodLiteral<"application/xml">;
394
+ base64: z.ZodString;
395
+ }, z.core.$strip>;
396
+ export declare const invoicePdfOutputSchema: z.ZodObject<{
397
+ fileName: z.ZodString;
398
+ mimeType: z.ZodLiteral<"application/pdf">;
399
+ base64: z.ZodString;
400
+ }, z.core.$strip>;
401
+ export type InvoiceListQuery = z.infer<typeof invoiceListQuerySchema>;
402
+ export type DraftListQuery = z.infer<typeof draftListQuerySchema>;
403
+ export type DraftCreateInput = z.infer<typeof draftCreateInputSchema>;
404
+ export type DraftSetReceiverInput = z.infer<typeof draftSetReceiverInputSchema>;
405
+ export type DraftSetMetaInput = z.infer<typeof draftSetMetaInputSchema>;
406
+ export type DraftAddItemInput = z.infer<typeof draftAddItemInputSchema>;
407
+ export type DraftUpdateItemInput = z.infer<typeof draftUpdateItemInputSchema>;
408
+ export type DraftStampInput = z.infer<typeof draftStampInputSchema>;
409
+ export type DraftRecord = z.infer<typeof draftRecordSchema>;
410
+ export type DraftListItem = z.infer<typeof draftListItemSchema>;
411
+ export type InvoiceRecord = z.infer<typeof invoiceRecordSchema>;
412
+ export type InvoiceListItem = z.infer<typeof invoiceListItemSchema>;
413
+ export type InvoiceXmlOutput = z.infer<typeof invoiceXmlOutputSchema>;
414
+ export type InvoicePdfOutput = z.infer<typeof invoicePdfOutputSchema>;
415
+ //# sourceMappingURL=invoices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invoices.d.ts","sourceRoot":"","sources":["../src/invoices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB,eAAO,MAAM,mBAAmB;;;;;EAK9B,CAAA;AAEF,eAAO,MAAM,oBAAoB,+EAI/B,CAAA;AAEF,eAAO,MAAM,+BAA+B,iFAI1C,CAAA;AAEF,eAAO,MAAM,0BAA0B;;;;EAIrC,CAAA;AAEF,eAAO,MAAM,6BAA6B;;;;;EAKxC,CAAA;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;iBAIjC,CAAA;AAEF,eAAO,MAAM,oBAAoB;;;iBAG/B,CAAA;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmBlC,CAAA;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;iBAYjC,CAAA;AAEF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;iBAUtC,CAAA;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;iBAUlC,CAAA;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAclC,CAAA;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAcrC,CAAA;AAEF,eAAO,MAAM,qBAAqB;;;;;;iBAMhC,CAAA;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmC9B,CAAA;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;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,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AACnE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AACrE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA"}
@@ -0,0 +1,194 @@
1
+ import { z } from 'zod';
2
+ import { customerCurrencySchema, customerInvoiceLanguageSchema, } from './customers';
3
+ export const invoiceStatusSchema = z.enum([
4
+ 'draft',
5
+ 'issued',
6
+ 'error',
7
+ 'cancelled',
8
+ ]);
9
+ export const invoiceVatRateSchema = z.union([
10
+ z.literal(0),
11
+ z.literal(0.1),
12
+ z.literal(0.16),
13
+ ]);
14
+ export const invoiceIsrWithholdingRateSchema = z.union([
15
+ z.literal(0),
16
+ z.literal(0.0125),
17
+ z.literal(0.1),
18
+ ]);
19
+ export const invoiceItemTaxSourceSchema = z.enum([
20
+ 'manual',
21
+ 'inferred',
22
+ 'default',
23
+ ]);
24
+ export const invoiceSuggestionSourceSchema = z.enum([
25
+ 'ai',
26
+ 'memory',
27
+ 'manual',
28
+ 'review',
29
+ ]);
30
+ export const invoiceListQuerySchema = z.object({
31
+ query: z.string().trim().min(1).max(120).optional(),
32
+ status: invoiceStatusSchema.optional(),
33
+ limit: z.coerce.number().int().min(1).max(100).optional(),
34
+ });
35
+ export const draftListQuerySchema = z.object({
36
+ query: z.string().trim().min(1).max(120).optional(),
37
+ limit: z.coerce.number().int().min(1).max(100).optional(),
38
+ });
39
+ export const invoiceItemRecordSchema = z.object({
40
+ id: z.uuid(),
41
+ invoiceId: z.uuid(),
42
+ position: z.number().int().nonnegative(),
43
+ productCode: z.string().optional(),
44
+ unitCode: z.string(),
45
+ description: z.string(),
46
+ quantity: z.number(),
47
+ unitPrice: z.number(),
48
+ amount: z.number(),
49
+ vatRate: invoiceVatRateSchema,
50
+ vatSource: invoiceItemTaxSourceSchema.optional(),
51
+ vatReason: z.string().optional(),
52
+ isrWithholdingRate: invoiceIsrWithholdingRateSchema,
53
+ isrWithholdingSource: invoiceItemTaxSourceSchema.optional(),
54
+ isrWithholdingReason: z.string().optional(),
55
+ suggestedProductCode: z.string().optional(),
56
+ suggestionConfidence: z.number().optional(),
57
+ suggestionSource: invoiceSuggestionSourceSchema.optional(),
58
+ });
59
+ export const draftCreateInputSchema = z.object({
60
+ customerId: z.uuid().optional(),
61
+ receiverRfc: z.string().trim().optional(),
62
+ receiverLegalName: z.string().trim().optional(),
63
+ receiverPostalCode: z.string().trim().optional(),
64
+ receiverTaxRegime: z.string().trim().optional(),
65
+ receiverFiscalResidence: z.string().trim().toUpperCase().optional(),
66
+ receiverTaxId: z.string().trim().optional(),
67
+ receiverEmail: z.email().optional(),
68
+ receiverInvoiceLanguage: customerInvoiceLanguageSchema.optional(),
69
+ currency: customerCurrencySchema.optional(),
70
+ cfdiUse: z.string().trim().optional(),
71
+ });
72
+ export const draftSetReceiverInputSchema = z.object({
73
+ customerId: z.uuid().optional().nullable(),
74
+ receiverRfc: z.string().trim().optional(),
75
+ receiverLegalName: z.string().trim().optional(),
76
+ receiverPostalCode: z.string().trim().optional(),
77
+ receiverTaxRegime: z.string().trim().optional(),
78
+ receiverFiscalResidence: z.string().trim().toUpperCase().optional().nullable(),
79
+ receiverTaxId: z.string().trim().optional().nullable(),
80
+ receiverEmail: z.email().optional().nullable(),
81
+ receiverInvoiceLanguage: customerInvoiceLanguageSchema.optional(),
82
+ });
83
+ export const draftSetMetaInputSchema = z.object({
84
+ cfdiUse: z.string().trim().optional(),
85
+ paymentMethod: z.string().trim().optional(),
86
+ paymentForm: z.string().trim().optional(),
87
+ currency: customerCurrencySchema.optional(),
88
+ exchangeRate: z.number().positive().optional(),
89
+ exchangeRateDate: z.iso.datetime().optional(),
90
+ vatRate: invoiceVatRateSchema.optional(),
91
+ customerNotes: z.string().trim().max(4000).optional().nullable(),
92
+ pdfLanguage: customerInvoiceLanguageSchema.optional(),
93
+ });
94
+ export const draftAddItemInputSchema = z.object({
95
+ position: z.number().int().nonnegative().optional(),
96
+ productCode: z.string().trim().optional(),
97
+ unitCode: z.string().trim().optional(),
98
+ description: z.string().trim().min(1),
99
+ quantity: z.number().positive().default(1),
100
+ unitPrice: z.number().nonnegative(),
101
+ vatRate: invoiceVatRateSchema.optional(),
102
+ vatSource: invoiceItemTaxSourceSchema.optional(),
103
+ isrWithholdingRate: invoiceIsrWithholdingRateSchema.optional(),
104
+ isrWithholdingSource: invoiceItemTaxSourceSchema.optional(),
105
+ suggestedProductCode: z.string().trim().optional(),
106
+ suggestionConfidence: z.number().min(0).max(1).optional(),
107
+ suggestionSource: invoiceSuggestionSourceSchema.optional(),
108
+ });
109
+ export const draftUpdateItemInputSchema = z.object({
110
+ position: z.number().int().nonnegative().optional(),
111
+ productCode: z.string().trim().optional(),
112
+ unitCode: z.string().trim().optional(),
113
+ description: z.string().trim().optional(),
114
+ quantity: z.number().positive().optional(),
115
+ unitPrice: z.number().nonnegative().optional(),
116
+ vatRate: invoiceVatRateSchema.optional(),
117
+ vatSource: invoiceItemTaxSourceSchema.optional(),
118
+ isrWithholdingRate: invoiceIsrWithholdingRateSchema.optional(),
119
+ isrWithholdingSource: invoiceItemTaxSourceSchema.optional(),
120
+ suggestedProductCode: z.string().trim().optional(),
121
+ suggestionConfidence: z.number().min(0).max(1).optional(),
122
+ suggestionSource: invoiceSuggestionSourceSchema.optional(),
123
+ });
124
+ export const draftStampInputSchema = z.object({
125
+ skipIssuedEmailSend: z.boolean().optional(),
126
+ sendToCustomerContacts: z.boolean().optional(),
127
+ sendCustomerEmail: z.boolean().optional(),
128
+ sendCustomerWhatsApp: z.boolean().optional(),
129
+ allowPaidStampOverdraft: z.boolean().optional(),
130
+ });
131
+ export const invoiceRecordSchema = z.object({
132
+ id: z.uuid(),
133
+ userId: z.string().trim().min(1),
134
+ customerId: z.uuid().optional(),
135
+ receiverRfc: z.string(),
136
+ receiverLegalName: z.string(),
137
+ receiverPostalCode: z.string(),
138
+ receiverTaxRegime: z.string(),
139
+ receiverFiscalResidence: z.string().optional(),
140
+ receiverTaxId: z.string().optional(),
141
+ receiverEmail: z.email().optional(),
142
+ receiverInvoiceLanguage: customerInvoiceLanguageSchema,
143
+ serie: z.string().optional(),
144
+ folio: z.string().optional(),
145
+ satUuid: z.string().optional(),
146
+ status: invoiceStatusSchema,
147
+ cfdiType: z.string(),
148
+ cfdiUse: z.string(),
149
+ paymentMethod: z.string().optional(),
150
+ paymentForm: z.string().optional(),
151
+ currency: customerCurrencySchema,
152
+ exchangeRate: z.number(),
153
+ exchangeRateDate: z.iso.datetime().optional(),
154
+ subtotal: z.number(),
155
+ vatRate: invoiceVatRateSchema,
156
+ taxTotal: z.number(),
157
+ total: z.number(),
158
+ customerNotes: z.string().optional(),
159
+ pdfLanguage: customerInvoiceLanguageSchema,
160
+ errorMessage: z.string().optional(),
161
+ issuedAt: z.iso.datetime().optional(),
162
+ cancelledAt: z.iso.datetime().optional(),
163
+ createdAt: z.iso.datetime(),
164
+ updatedAt: z.iso.datetime(),
165
+ items: z.array(invoiceItemRecordSchema),
166
+ });
167
+ export const draftRecordSchema = invoiceRecordSchema;
168
+ export const invoiceListItemSchema = z.object({
169
+ id: z.uuid(),
170
+ folio: z.string(),
171
+ status: invoiceStatusSchema,
172
+ receiverLegalName: z.string(),
173
+ receiverEmail: z.email().optional(),
174
+ currency: customerCurrencySchema,
175
+ total: z.number(),
176
+ createdAt: z.iso.datetime(),
177
+ updatedAt: z.iso.datetime(),
178
+ issuedAt: z.iso.datetime().optional(),
179
+ errorMessage: z.string().optional(),
180
+ });
181
+ export const draftListItemSchema = invoiceListItemSchema.extend({
182
+ status: z.enum(['draft', 'error']),
183
+ });
184
+ export const invoiceXmlOutputSchema = z.object({
185
+ fileName: z.string(),
186
+ mimeType: z.literal('application/xml'),
187
+ base64: z.string(),
188
+ });
189
+ export const invoicePdfOutputSchema = z.object({
190
+ fileName: z.string(),
191
+ mimeType: z.literal('application/pdf'),
192
+ base64: z.string(),
193
+ });
194
+ //# sourceMappingURL=invoices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invoices.js","sourceRoot":"","sources":["../src/invoices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EACL,sBAAsB,EACtB,6BAA6B,GAC9B,MAAM,aAAa,CAAA;AAEpB,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,IAAI,CAAC;IACxC,OAAO;IACP,QAAQ;IACR,OAAO;IACP,WAAW;CACZ,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC;IAC1C,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACZ,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC;IACd,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;CAChB,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC;IACrD,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACZ,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IACjB,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC;CACf,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,IAAI,CAAC;IAC/C,QAAQ;IACR,UAAU;IACV,SAAS;CACV,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,IAAI,CAAC;IAClD,IAAI;IACJ,QAAQ;IACR,QAAQ;IACR,QAAQ;CACT,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAA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ownerUserName: z.ZodOptional<z.ZodString>;
7
+ ownerUserEmail: z.ZodOptional<z.ZodEmail>;
8
+ scopes: z.ZodArray<z.ZodString>;
9
+ }, z.core.$strip>;
10
+ export type PublicMe = z.infer<typeof publicMeSchema>;
11
+ //# sourceMappingURL=me.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"me.d.ts","sourceRoot":"","sources":["../src/me.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,cAAc;;;;;;;iBAOzB,CAAA;AAEF,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA"}
package/dist/me.js ADDED
@@ -0,0 +1,10 @@
1
+ import { z } from 'zod';
2
+ export const publicMeSchema = z.object({
3
+ actorType: z.string().trim().min(1),
4
+ actorId: z.string().trim().min(1),
5
+ ownerUserId: z.string().trim().min(1),
6
+ ownerUserName: z.string().trim().min(1).optional(),
7
+ ownerUserEmail: z.email().optional(),
8
+ scopes: z.array(z.string().trim().min(1)),
9
+ });
10
+ //# sourceMappingURL=me.js.map
package/dist/me.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"me.js","sourceRoot":"","sources":["../src/me.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACnC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACjC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAClD,cAAc,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;IACpC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAC1C,CAAC,CAAA"}
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "@factucat/public-api-contracts",
3
+ "version": "0.2.0",
4
+ "private": false,
5
+ "type": "module",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "main": "./dist/index.js",
13
+ "types": "./dist/index.d.ts",
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "default": "./dist/index.js"
18
+ }
19
+ },
20
+ "dependencies": {
21
+ "zod": "^4.3.6"
22
+ },
23
+ "scripts": {
24
+ "build": "tsc -p tsconfig.build.json",
25
+ "lint": "eslint \"src/**/*.ts\" --ignore-pattern \"src/**/*.d.ts\""
26
+ }
27
+ }