@latex-kit/schema 0.0.0-stage → 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.
package/types.js ADDED
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Localized = exports.Party = exports.Organization = exports.Person = exports.Signer = exports.Address = exports.Money = exports.ISODate = void 0;
4
+ const zod_1 = require("zod");
5
+ /** A calendar date, `2026-11-25`. Use with the `date` filter. */
6
+ exports.ISODate = zod_1.z.string().regex(/^\d{4}-\d{2}-\d{2}$/, 'expected a date like 2026-11-25');
7
+ /** An amount and an ISO 4217 currency code. Use with the `money` filter. */
8
+ exports.Money = zod_1.z.object({
9
+ amount: zod_1.z.number(),
10
+ currency: zod_1.z.string().regex(/^[A-Z]{3}$/, 'expected a currency code like USD'),
11
+ });
12
+ exports.Address = zod_1.z.object({
13
+ line1: zod_1.z.string(),
14
+ line2: zod_1.z.string().optional(),
15
+ city: zod_1.z.string(),
16
+ region: zod_1.z.string().optional(),
17
+ postalCode: zod_1.z.string().optional(),
18
+ country: zod_1.z.string().optional(),
19
+ });
20
+ /** Someone who signs: a name and, usually, a title. */
21
+ exports.Signer = zod_1.z.object({
22
+ name: zod_1.z.string(),
23
+ title: zod_1.z.string().optional(),
24
+ email: zod_1.z.string().optional(),
25
+ });
26
+ exports.Person = zod_1.z.object({
27
+ name: zod_1.z.string(),
28
+ title: zod_1.z.string().optional(),
29
+ email: zod_1.z.string().optional(),
30
+ address: exports.Address.optional(),
31
+ });
32
+ exports.Organization = zod_1.z.object({
33
+ name: zod_1.z.string(),
34
+ /** e.g. "Delaware corporation", "Kabushiki Kaisha" */
35
+ entityType: zod_1.z.string().optional(),
36
+ jurisdiction: zod_1.z.string().optional(),
37
+ address: exports.Address.optional(),
38
+ signer: exports.Signer.optional(),
39
+ });
40
+ /** One side of an agreement: a person or an organization. */
41
+ exports.Party = zod_1.z.object({
42
+ kind: zod_1.z.enum(['person', 'organization']).optional(),
43
+ name: zod_1.z.string(),
44
+ entityType: zod_1.z.string().optional(),
45
+ jurisdiction: zod_1.z.string().optional(),
46
+ title: zod_1.z.string().optional(),
47
+ email: zod_1.z.string().optional(),
48
+ address: exports.Address.optional(),
49
+ signer: exports.Signer.optional(),
50
+ });
51
+ /** Text in several languages, keyed by language tag: `{ en: "…", ja: "…" }`. */
52
+ exports.Localized = zod_1.z.record(zod_1.z.string(), zod_1.z.string());