@mailwoman/geographic-model 0.0.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.
Files changed (51) hide show
  1. package/README.md +155 -0
  2. package/artifact.ts +198 -0
  3. package/compile.ts +350 -0
  4. package/data/geographic-model.json +172 -0
  5. package/data/model/concepts.json +114 -0
  6. package/data/model/mappings.json +18 -0
  7. package/data/model/model.json +3 -0
  8. package/data/model/relations.json +14 -0
  9. package/index.ts +51 -0
  10. package/load.ts +396 -0
  11. package/lookup.ts +129 -0
  12. package/out/artifact.d.ts +106 -0
  13. package/out/artifact.d.ts.map +1 -0
  14. package/out/artifact.js +135 -0
  15. package/out/artifact.js.map +1 -0
  16. package/out/compile.d.ts +84 -0
  17. package/out/compile.d.ts.map +1 -0
  18. package/out/compile.js +259 -0
  19. package/out/compile.js.map +1 -0
  20. package/out/index.d.ts +51 -0
  21. package/out/index.d.ts.map +1 -0
  22. package/out/index.js +51 -0
  23. package/out/index.js.map +1 -0
  24. package/out/load.d.ts +122 -0
  25. package/out/load.d.ts.map +1 -0
  26. package/out/load.js +269 -0
  27. package/out/load.js.map +1 -0
  28. package/out/lookup.d.ts +64 -0
  29. package/out/lookup.d.ts.map +1 -0
  30. package/out/lookup.js +68 -0
  31. package/out/lookup.js.map +1 -0
  32. package/out/schema.d.ts +366 -0
  33. package/out/schema.d.ts.map +1 -0
  34. package/out/schema.js +166 -0
  35. package/out/schema.js.map +1 -0
  36. package/out/scripts/build-artifact.d.ts +51 -0
  37. package/out/scripts/build-artifact.d.ts.map +1 -0
  38. package/out/scripts/build-artifact.js +78 -0
  39. package/out/scripts/build-artifact.js.map +1 -0
  40. package/out/validate.d.ts +67 -0
  41. package/out/validate.d.ts.map +1 -0
  42. package/out/validate.js +465 -0
  43. package/out/validate.js.map +1 -0
  44. package/out/validation-issues.d.ts +84 -0
  45. package/out/validation-issues.d.ts.map +1 -0
  46. package/out/validation-issues.js +190 -0
  47. package/out/validation-issues.js.map +1 -0
  48. package/package.json +120 -0
  49. package/schema.ts +399 -0
  50. package/validate.ts +845 -0
  51. package/validation-issues.ts +305 -0
@@ -0,0 +1,84 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * The issue vocabulary and the primitive field readers `./validate.ts` is built from.
7
+ *
8
+ * Every reader takes the issue list it appends to and returns `undefined` when it could not read the
9
+ * field. That shape is deliberate: a reader that threw would end the pass at the first defect, and a
10
+ * reader that substituted a default would convert "I could not read this" into a value, which at a
11
+ * validation boundary is the same as inventing one. Returning nothing, having said why, lets the
12
+ * caller skip the checks that depended on the field and keep running the ones that did not.
13
+ *
14
+ * `./validate.ts` re-exports {@link ValidationIssueCode} and {@link ValidationIssue}; the readers
15
+ * stay internal to the package.
16
+ */
17
+ /**
18
+ * Every way a document can fail validation. Closed, so a consumer branches on the code rather than on message prose.
19
+ */
20
+ export declare const ValidationIssueCode: {
21
+ readonly MissingField: "missing_field";
22
+ readonly WrongType: "wrong_type";
23
+ /**
24
+ * A required string was present and blank.
25
+ */
26
+ readonly EmptyValue: "empty_value";
27
+ /**
28
+ * A list that must carry entries was empty.
29
+ */
30
+ readonly EmptyList: "empty_list";
31
+ readonly UnknownField: "unknown_field";
32
+ /**
33
+ * A field whose name announces ranking policy. Refused wherever it appears, at any depth.
34
+ */
35
+ readonly RankingField: "ranking_field";
36
+ readonly UnknownConceptKind: "unknown_concept_kind";
37
+ readonly UnknownModality: "unknown_modality";
38
+ readonly UnknownRelationSemantics: "unknown_relation_semantics";
39
+ readonly UnknownConceptStatus: "unknown_concept_status";
40
+ readonly UnknownExternalVocabulary: "unknown_external_vocabulary";
41
+ readonly UnknownDerivationInputKind: "unknown_derivation_input_kind";
42
+ readonly DuplicateID: "duplicate_id";
43
+ /**
44
+ * A record names itself where it may only name another record.
45
+ */
46
+ readonly SelfReference: "self_reference";
47
+ readonly CyclicIsA: "cyclic_isa";
48
+ readonly UnknownConcept: "unknown_concept";
49
+ readonly UnknownRelation: "unknown_relation";
50
+ readonly UnknownDerivationInput: "unknown_derivation_input";
51
+ readonly DomainKindMismatch: "domain_kind_mismatch";
52
+ readonly RangeKindMismatch: "range_kind_mismatch";
53
+ readonly InverseNotReciprocal: "inverse_not_reciprocal";
54
+ readonly InverseKindsMismatch: "inverse_kinds_mismatch";
55
+ readonly TransitiveKindsDisjoint: "transitive_kinds_disjoint";
56
+ readonly MalformedCountry: "malformed_country";
57
+ };
58
+ export type ValidationIssueCode = (typeof ValidationIssueCode)[keyof typeof ValidationIssueCode];
59
+ /**
60
+ * One violation, addressed by where it was found.
61
+ */
62
+ export interface ValidationIssue {
63
+ /**
64
+ * A JSONPath-style address into the validated input, e.g. `$.concepts[0].assertions[1].modality`. The document root
65
+ * is `$`.
66
+ */
67
+ path: string;
68
+ code: ValidationIssueCode;
69
+ message: string;
70
+ }
71
+ export declare function isPlainObject(value: unknown): value is Record<string, unknown>;
72
+ export declare function add(issues: ValidationIssue[], path: string, code: ValidationIssueCode, message: string): void;
73
+ export declare function listVocabulary(allowed: readonly string[]): string;
74
+ /**
75
+ * Refuse any field the schema does not declare, naming the ranking-policy ones under their own code.
76
+ */
77
+ export declare function checkFieldNames(issues: ValidationIssue[], path: string, value: Record<string, unknown>, allowed: readonly string[]): void;
78
+ export declare function readString(issues: ValidationIssue[], path: string, container: Record<string, unknown>, key: string, required: boolean): string | undefined;
79
+ export declare function readBoolean(issues: ValidationIssue[], path: string, container: Record<string, unknown>, key: string): boolean | undefined;
80
+ export declare function readArray(issues: ValidationIssue[], path: string, container: Record<string, unknown>, key: string, required: boolean): unknown[] | undefined;
81
+ export declare function readStringArray(issues: ValidationIssue[], path: string, container: Record<string, unknown>, key: string, required: boolean): string[] | undefined;
82
+ export declare function readVocabularyValue<T extends string>(issues: ValidationIssue[], path: string, container: Record<string, unknown>, key: string, allowed: readonly T[], code: ValidationIssueCode): T | undefined;
83
+ export declare function readVocabularyArray<T extends string>(issues: ValidationIssue[], path: string, container: Record<string, unknown>, key: string, allowed: readonly T[], code: ValidationIssueCode): T[] | undefined;
84
+ //# sourceMappingURL=validation-issues.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation-issues.d.ts","sourceRoot":"","sources":["../validation-issues.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;IAG/B;;OAEG;;IAEH;;OAEG;;;IAGH;;OAEG;;;;;;;;;IASH;;OAEG;;;;;;;;;;;;CAYM,CAAA;AAEV,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAA;AAEhG;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,mBAAmB,CAAA;IACzB,OAAO,EAAE,MAAM,CAAA;CACf;AAmBD,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAE9E;AAED,wBAAgB,GAAG,CAAC,MAAM,EAAE,eAAe,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAE7G;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAEjE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC9B,MAAM,EAAE,eAAe,EAAE,EACzB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,OAAO,EAAE,SAAS,MAAM,EAAE,GACxB,IAAI,CAyBN;AAED,wBAAgB,UAAU,CACzB,MAAM,EAAE,eAAe,EAAE,EACzB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,CAAC,MAAM,E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E,GAAG,SAAS,CAoBjB"}
@@ -0,0 +1,190 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * The issue vocabulary and the primitive field readers `./validate.ts` is built from.
7
+ *
8
+ * Every reader takes the issue list it appends to and returns `undefined` when it could not read the
9
+ * field. That shape is deliberate: a reader that threw would end the pass at the first defect, and a
10
+ * reader that substituted a default would convert "I could not read this" into a value, which at a
11
+ * validation boundary is the same as inventing one. Returning nothing, having said why, lets the
12
+ * caller skip the checks that depended on the field and keep running the ones that did not.
13
+ *
14
+ * `./validate.ts` re-exports {@link ValidationIssueCode} and {@link ValidationIssue}; the readers
15
+ * stay internal to the package.
16
+ */
17
+ /**
18
+ * Every way a document can fail validation. Closed, so a consumer branches on the code rather than on message prose.
19
+ */
20
+ export const ValidationIssueCode = {
21
+ MissingField: "missing_field",
22
+ WrongType: "wrong_type",
23
+ /**
24
+ * A required string was present and blank.
25
+ */
26
+ EmptyValue: "empty_value",
27
+ /**
28
+ * A list that must carry entries was empty.
29
+ */
30
+ EmptyList: "empty_list",
31
+ UnknownField: "unknown_field",
32
+ /**
33
+ * A field whose name announces ranking policy. Refused wherever it appears, at any depth.
34
+ */
35
+ RankingField: "ranking_field",
36
+ UnknownConceptKind: "unknown_concept_kind",
37
+ UnknownModality: "unknown_modality",
38
+ UnknownRelationSemantics: "unknown_relation_semantics",
39
+ UnknownConceptStatus: "unknown_concept_status",
40
+ UnknownExternalVocabulary: "unknown_external_vocabulary",
41
+ UnknownDerivationInputKind: "unknown_derivation_input_kind",
42
+ DuplicateID: "duplicate_id",
43
+ /**
44
+ * A record names itself where it may only name another record.
45
+ */
46
+ SelfReference: "self_reference",
47
+ CyclicIsA: "cyclic_isa",
48
+ UnknownConcept: "unknown_concept",
49
+ UnknownRelation: "unknown_relation",
50
+ UnknownDerivationInput: "unknown_derivation_input",
51
+ DomainKindMismatch: "domain_kind_mismatch",
52
+ RangeKindMismatch: "range_kind_mismatch",
53
+ InverseNotReciprocal: "inverse_not_reciprocal",
54
+ InverseKindsMismatch: "inverse_kinds_mismatch",
55
+ TransitiveKindsDisjoint: "transitive_kinds_disjoint",
56
+ MalformedCountry: "malformed_country",
57
+ };
58
+ /**
59
+ * Name fragments that announce ranking policy. Matched case-insensitively against every field name at every depth, so
60
+ * `score`, `boost`, `penalty`, `rankWeight`, `relevanceWeight`, and `affinityWeight` are refused by one rule rather
61
+ * than by an enumeration that a seventh spelling walks past.
62
+ */
63
+ const RANKING_FIELD_FRAGMENTS = [
64
+ "boost",
65
+ "penalt",
66
+ "weight",
67
+ "rank",
68
+ "score",
69
+ "relevance",
70
+ "affinity",
71
+ "priorit",
72
+ "ordering",
73
+ ];
74
+ export function isPlainObject(value) {
75
+ return typeof value === "object" && value !== null && !Array.isArray(value);
76
+ }
77
+ export function add(issues, path, code, message) {
78
+ issues.push({ path, code, message });
79
+ }
80
+ export function listVocabulary(allowed) {
81
+ return allowed.map((candidate) => `\`${candidate}\``).join(", ");
82
+ }
83
+ /**
84
+ * Refuse any field the schema does not declare, naming the ranking-policy ones under their own code.
85
+ */
86
+ export function checkFieldNames(issues, path, value, allowed) {
87
+ for (const key of Object.keys(value)) {
88
+ const lowered = key.toLowerCase();
89
+ const fragment = RANKING_FIELD_FRAGMENTS.find((candidate) => lowered.includes(candidate));
90
+ if (fragment) {
91
+ add(issues, `${path}.${key}`, ValidationIssueCode.RankingField, `field \`${key}\` names ranking policy (\`${fragment}\`) — authored records create observations, and ranking belongs to @mailwoman/resolver and @mailwoman/neural`);
92
+ continue;
93
+ }
94
+ if (!allowed.includes(key)) {
95
+ add(issues, `${path}.${key}`, ValidationIssueCode.UnknownField, `unknown field \`${key}\` — this record accepts ${listVocabulary(allowed)}`);
96
+ }
97
+ }
98
+ }
99
+ export function readString(issues, path, container, key, required) {
100
+ const value = container[key];
101
+ const fieldPath = `${path}.${key}`;
102
+ if (value === undefined) {
103
+ if (required) {
104
+ add(issues, fieldPath, ValidationIssueCode.MissingField, `\`${key}\` is required`);
105
+ }
106
+ return undefined;
107
+ }
108
+ if (typeof value !== "string") {
109
+ add(issues, fieldPath, ValidationIssueCode.WrongType, `\`${key}\` must be a string`);
110
+ return undefined;
111
+ }
112
+ if (!value.trim().length) {
113
+ add(issues, fieldPath, ValidationIssueCode.EmptyValue, `\`${key}\` must not be blank`);
114
+ return undefined;
115
+ }
116
+ return value;
117
+ }
118
+ export function readBoolean(issues, path, container, key) {
119
+ const value = container[key];
120
+ const fieldPath = `${path}.${key}`;
121
+ if (value === undefined) {
122
+ add(issues, fieldPath, ValidationIssueCode.MissingField, `\`${key}\` is required`);
123
+ return undefined;
124
+ }
125
+ if (typeof value !== "boolean") {
126
+ add(issues, fieldPath, ValidationIssueCode.WrongType, `\`${key}\` must be a boolean`);
127
+ return undefined;
128
+ }
129
+ return value;
130
+ }
131
+ export function readArray(issues, path, container, key, required) {
132
+ const value = container[key];
133
+ const fieldPath = `${path}.${key}`;
134
+ if (value === undefined) {
135
+ if (required) {
136
+ add(issues, fieldPath, ValidationIssueCode.MissingField, `\`${key}\` is required`);
137
+ }
138
+ return undefined;
139
+ }
140
+ if (!Array.isArray(value)) {
141
+ add(issues, fieldPath, ValidationIssueCode.WrongType, `\`${key}\` must be an array`);
142
+ return undefined;
143
+ }
144
+ return value;
145
+ }
146
+ export function readStringArray(issues, path, container, key, required) {
147
+ const entries = readArray(issues, path, container, key, required);
148
+ if (!entries)
149
+ return undefined;
150
+ const values = [];
151
+ for (const [index, entry] of entries.entries()) {
152
+ const entryPath = `${path}.${key}[${index}]`;
153
+ if (typeof entry !== "string") {
154
+ add(issues, entryPath, ValidationIssueCode.WrongType, "must be a string");
155
+ continue;
156
+ }
157
+ if (!entry.trim().length) {
158
+ add(issues, entryPath, ValidationIssueCode.EmptyValue, "must not be blank");
159
+ continue;
160
+ }
161
+ values.push(entry);
162
+ }
163
+ return values;
164
+ }
165
+ export function readVocabularyValue(issues, path, container, key, allowed, code) {
166
+ const value = readString(issues, path, container, key, true);
167
+ if (value === undefined)
168
+ return undefined;
169
+ const match = allowed.find((candidate) => candidate === value);
170
+ if (match === undefined) {
171
+ add(issues, `${path}.${key}`, code, `\`${value}\` is not one of ${listVocabulary(allowed)}`);
172
+ }
173
+ return match;
174
+ }
175
+ export function readVocabularyArray(issues, path, container, key, allowed, code) {
176
+ const values = readStringArray(issues, path, container, key, true);
177
+ if (!values)
178
+ return undefined;
179
+ const matched = [];
180
+ for (const [index, value] of values.entries()) {
181
+ const match = allowed.find((candidate) => candidate === value);
182
+ if (match === undefined) {
183
+ add(issues, `${path}.${key}[${index}]`, code, `\`${value}\` is not one of ${listVocabulary(allowed)}`);
184
+ continue;
185
+ }
186
+ matched.push(match);
187
+ }
188
+ return matched;
189
+ }
190
+ //# sourceMappingURL=validation-issues.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation-issues.js","sourceRoot":"","sources":["../validation-issues.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAClC,YAAY,EAAE,eAAe;IAC7B,SAAS,EAAE,YAAY;IACvB;;OAEG;IACH,UAAU,EAAE,aAAa;IACzB;;OAEG;IACH,SAAS,EAAE,YAAY;IACvB,YAAY,EAAE,eAAe;IAC7B;;OAEG;IACH,YAAY,EAAE,eAAe;IAC7B,kBAAkB,EAAE,sBAAsB;IAC1C,eAAe,EAAE,kBAAkB;IACnC,wBAAwB,EAAE,4BAA4B;IACtD,oBAAoB,EAAE,wBAAwB;IAC9C,yBAAyB,EAAE,6BAA6B;IACxD,0BAA0B,EAAE,+BAA+B;IAC3D,WAAW,EAAE,cAAc;IAC3B;;OAEG;IACH,aAAa,EAAE,gBAAgB;IAC/B,SAAS,EAAE,YAAY;IACvB,cAAc,EAAE,iBAAiB;IACjC,eAAe,EAAE,kBAAkB;IACnC,sBAAsB,EAAE,0BAA0B;IAClD,kBAAkB,EAAE,sBAAsB;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AAE,EAAE,CAAC,SAAS,KAAK,KAAK,CAAC,CAAA;IAE9D,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACzB,GAAG,CAAC,MAAM,EAAE,GAAG,IAAI,IAAI,GAAG,EAAE,EAAE,IAAI,EAAE,KAAK,KAAK,oBAAoB,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IAC7F,CAAC;IAED,OAAO,KAAK,CAAA;AACb,CAAC;AAED,MAAM,UAAU,mBAAmB,CAClC,MAAyB,EACzB,IAAY,EACZ,SAAkC,EAClC,GAAW,EACX,OAAqB,EACrB,IAAyB;IAEzB,MAAM,MAAM,GAAG,eAAe,CAAC,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;IAElE,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAA;IAE7B,MAAM,OAAO,GAAQ,EAAE,CAAA;IAEvB,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;QAC/C,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,KAAK,KAAK,CAAC,CAAA;QAE9D,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACzB,GAAG,CAAC,MAAM,EAAE,GAAG,IAAI,IAAI,GAAG,IAAI,KAAK,GAAG,EAAE,IAAI,EAAE,KAAK,KAAK,oBAAoB,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;YAEtG,SAAQ;QACT,CAAC;QAED,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACpB,CAAC;IAED,OAAO,OAAO,CAAA;AACf,CAAC"}
package/package.json ADDED
@@ -0,0 +1,120 @@
1
+ {
2
+ "name": "@mailwoman/geographic-model",
3
+ "version": "0.0.0",
4
+ "description": "Stable geographic concepts, relations, mappings, source observations, derived facts, and their provenance — authored records compiled deterministically into runtime artifacts.",
5
+ "keywords": [
6
+ "affordance",
7
+ "geographic",
8
+ "ontology",
9
+ "provenance"
10
+ ],
11
+ "license": "AGPL-3.0-only OR LicenseRef-Commercial",
12
+ "contributors": [
13
+ {
14
+ "name": "Teffen Ellis",
15
+ "email": "teffen@sister.software"
16
+ }
17
+ ],
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "https://github.com/sister-software/mailwoman.git",
21
+ "directory": "packages/geographic-model"
22
+ },
23
+ "files": [
24
+ "out/**/*.js",
25
+ "out/**/*.js.map",
26
+ "out/**/*.d.ts",
27
+ "out/**/*.d.ts.map",
28
+ "data/**/*.json",
29
+ "*.ts",
30
+ "**/*.ts",
31
+ "!*.test.ts",
32
+ "!**/*.test.ts",
33
+ "!scripts/**",
34
+ "!test/**"
35
+ ],
36
+ "type": "module",
37
+ "exports": {
38
+ "./package.json": "./package.json",
39
+ ".": {
40
+ "types": "./out/index.d.ts",
41
+ "default": "./out/index.js"
42
+ },
43
+ "./artifact": {
44
+ "types": "./out/artifact.d.ts",
45
+ "default": "./out/artifact.js"
46
+ },
47
+ "./compile": {
48
+ "types": "./out/compile.d.ts",
49
+ "default": "./out/compile.js"
50
+ },
51
+ "./load": {
52
+ "types": "./out/load.d.ts",
53
+ "default": "./out/load.js"
54
+ },
55
+ "./lookup": {
56
+ "types": "./out/lookup.d.ts",
57
+ "default": "./out/lookup.js"
58
+ },
59
+ "./scripts/build-artifact": {
60
+ "types": "./out/scripts/build-artifact.d.ts",
61
+ "default": "./out/scripts/build-artifact.js"
62
+ },
63
+ "./schema": {
64
+ "types": "./out/schema.d.ts",
65
+ "default": "./out/schema.js"
66
+ },
67
+ "./validate": {
68
+ "types": "./out/validate.d.ts",
69
+ "default": "./out/validate.js"
70
+ }
71
+ },
72
+ "publishConfig": {
73
+ "access": "public",
74
+ "exports": {
75
+ "./package.json": "./package.json",
76
+ ".": {
77
+ "types": "./out/index.d.ts",
78
+ "default": "./out/index.js"
79
+ },
80
+ "./artifact": {
81
+ "types": "./out/artifact.d.ts",
82
+ "default": "./out/artifact.js"
83
+ },
84
+ "./compile": {
85
+ "types": "./out/compile.d.ts",
86
+ "default": "./out/compile.js"
87
+ },
88
+ "./load": {
89
+ "types": "./out/load.d.ts",
90
+ "default": "./out/load.js"
91
+ },
92
+ "./lookup": {
93
+ "types": "./out/lookup.d.ts",
94
+ "default": "./out/lookup.js"
95
+ },
96
+ "./scripts/build-artifact": {
97
+ "types": "./out/scripts/build-artifact.d.ts",
98
+ "default": "./out/scripts/build-artifact.js"
99
+ },
100
+ "./schema": {
101
+ "types": "./out/schema.d.ts",
102
+ "default": "./out/schema.js"
103
+ },
104
+ "./validate": {
105
+ "types": "./out/validate.d.ts",
106
+ "default": "./out/validate.js"
107
+ }
108
+ }
109
+ },
110
+ "dependencies": {
111
+ "@mailwoman/poi-taxonomy": "9.2.0",
112
+ "type-fest": "^5.8.0"
113
+ },
114
+ "devDependencies": {
115
+ "@mailwoman/core": "9.2.0"
116
+ },
117
+ "engines": {
118
+ "node": ">=24.18.0"
119
+ }
120
+ }