@kravc/schema 2.7.6 → 2.8.0-alpha.1

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 (176) hide show
  1. package/README.md +19 -14
  2. package/dist/CredentialFactory.d.ts +345 -0
  3. package/dist/CredentialFactory.d.ts.map +1 -0
  4. package/dist/CredentialFactory.js +381 -0
  5. package/dist/CredentialFactory.js.map +1 -0
  6. package/dist/Schema.d.ts +448 -0
  7. package/dist/Schema.d.ts.map +1 -0
  8. package/dist/Schema.js +506 -0
  9. package/dist/Schema.js.map +1 -0
  10. package/dist/ValidationError.d.ts +70 -0
  11. package/dist/ValidationError.d.ts.map +1 -0
  12. package/dist/ValidationError.js +78 -0
  13. package/dist/ValidationError.js.map +1 -0
  14. package/dist/Validator.d.ts +483 -0
  15. package/dist/Validator.d.ts.map +1 -0
  16. package/dist/Validator.js +570 -0
  17. package/dist/Validator.js.map +1 -0
  18. package/dist/helpers/JsonSchema.d.ts +99 -0
  19. package/dist/helpers/JsonSchema.d.ts.map +1 -0
  20. package/dist/helpers/JsonSchema.js +3 -0
  21. package/dist/helpers/JsonSchema.js.map +1 -0
  22. package/dist/helpers/cleanupAttributes.d.ts +34 -0
  23. package/dist/helpers/cleanupAttributes.d.ts.map +1 -0
  24. package/dist/helpers/cleanupAttributes.js +113 -0
  25. package/dist/helpers/cleanupAttributes.js.map +1 -0
  26. package/dist/helpers/cleanupNulls.d.ts +27 -0
  27. package/dist/helpers/cleanupNulls.d.ts.map +1 -0
  28. package/dist/helpers/cleanupNulls.js +96 -0
  29. package/dist/helpers/cleanupNulls.js.map +1 -0
  30. package/dist/helpers/createSchemasMap.d.ts +67 -0
  31. package/dist/helpers/createSchemasMap.d.ts.map +1 -0
  32. package/dist/helpers/createSchemasMap.js +200 -0
  33. package/dist/helpers/createSchemasMap.js.map +1 -0
  34. package/dist/helpers/getReferenceIds.d.ts +169 -0
  35. package/dist/helpers/getReferenceIds.d.ts.map +1 -0
  36. package/dist/helpers/getReferenceIds.js +241 -0
  37. package/dist/helpers/getReferenceIds.js.map +1 -0
  38. package/dist/helpers/got.d.ts +60 -0
  39. package/dist/helpers/got.d.ts.map +1 -0
  40. package/dist/helpers/got.js +72 -0
  41. package/dist/helpers/got.js.map +1 -0
  42. package/dist/helpers/mapObjectProperties.d.ts +150 -0
  43. package/dist/helpers/mapObjectProperties.d.ts.map +1 -0
  44. package/dist/helpers/mapObjectProperties.js +229 -0
  45. package/dist/helpers/mapObjectProperties.js.map +1 -0
  46. package/dist/helpers/normalizeAttributes.d.ts +213 -0
  47. package/dist/helpers/normalizeAttributes.d.ts.map +1 -0
  48. package/dist/helpers/normalizeAttributes.js +243 -0
  49. package/dist/helpers/normalizeAttributes.js.map +1 -0
  50. package/dist/helpers/normalizeProperties.d.ts +168 -0
  51. package/dist/helpers/normalizeProperties.d.ts.map +1 -0
  52. package/dist/helpers/normalizeProperties.js +223 -0
  53. package/dist/helpers/normalizeProperties.js.map +1 -0
  54. package/dist/helpers/normalizeRequired.d.ts +159 -0
  55. package/dist/helpers/normalizeRequired.d.ts.map +1 -0
  56. package/dist/helpers/normalizeRequired.js +206 -0
  57. package/dist/helpers/normalizeRequired.js.map +1 -0
  58. package/dist/helpers/normalizeType.d.ts +81 -0
  59. package/dist/helpers/normalizeType.d.ts.map +1 -0
  60. package/dist/helpers/normalizeType.js +210 -0
  61. package/dist/helpers/normalizeType.js.map +1 -0
  62. package/dist/helpers/nullifyEmptyValues.d.ts +139 -0
  63. package/dist/helpers/nullifyEmptyValues.d.ts.map +1 -0
  64. package/dist/helpers/nullifyEmptyValues.js +191 -0
  65. package/dist/helpers/nullifyEmptyValues.js.map +1 -0
  66. package/dist/helpers/removeRequiredAndDefault.d.ts +106 -0
  67. package/dist/helpers/removeRequiredAndDefault.d.ts.map +1 -0
  68. package/dist/helpers/removeRequiredAndDefault.js +138 -0
  69. package/dist/helpers/removeRequiredAndDefault.js.map +1 -0
  70. package/dist/helpers/validateId.d.ts +39 -0
  71. package/dist/helpers/validateId.d.ts.map +1 -0
  72. package/dist/helpers/validateId.js +51 -0
  73. package/dist/helpers/validateId.js.map +1 -0
  74. package/dist/index.d.ts +9 -0
  75. package/dist/index.d.ts.map +1 -0
  76. package/dist/index.js +21 -0
  77. package/dist/index.js.map +1 -0
  78. package/dist/ld/documentLoader.d.ts +8 -0
  79. package/dist/ld/documentLoader.d.ts.map +1 -0
  80. package/dist/ld/documentLoader.js +24 -0
  81. package/dist/ld/documentLoader.js.map +1 -0
  82. package/dist/ld/getLinkedDataAttributeType.d.ts +10 -0
  83. package/dist/ld/getLinkedDataAttributeType.d.ts.map +1 -0
  84. package/dist/ld/getLinkedDataAttributeType.js +32 -0
  85. package/dist/ld/getLinkedDataAttributeType.js.map +1 -0
  86. package/dist/ld/getLinkedDataContext.d.ts +19 -0
  87. package/dist/ld/getLinkedDataContext.d.ts.map +1 -0
  88. package/dist/ld/getLinkedDataContext.js +50 -0
  89. package/dist/ld/getLinkedDataContext.js.map +1 -0
  90. package/eslint.config.mjs +32 -52
  91. package/examples/credentials/createAccountCredential.ts +27 -0
  92. package/examples/credentials/createMineSweeperScoreCredential.ts +115 -0
  93. package/examples/index.ts +7 -0
  94. package/examples/schemas/FavoriteItemSchema.ts +27 -0
  95. package/examples/{Preferences.yaml → schemas/Preferences.yaml} +2 -0
  96. package/examples/schemas/PreferencesSchema.ts +29 -0
  97. package/examples/schemas/ProfileSchema.ts +91 -0
  98. package/examples/schemas/Status.yaml +3 -0
  99. package/examples/schemas/StatusSchema.ts +12 -0
  100. package/jest.config.mjs +5 -0
  101. package/package.json +27 -20
  102. package/src/CredentialFactory.ts +392 -0
  103. package/src/Schema.ts +583 -0
  104. package/src/ValidationError.ts +90 -0
  105. package/src/Validator.ts +603 -0
  106. package/src/__tests__/CredentialFactory.test.ts +588 -0
  107. package/src/__tests__/Schema.test.ts +371 -0
  108. package/src/__tests__/ValidationError.test.ts +235 -0
  109. package/src/__tests__/Validator.test.ts +787 -0
  110. package/src/helpers/JsonSchema.ts +119 -0
  111. package/src/helpers/__tests__/cleanupAttributes.test.ts +943 -0
  112. package/src/helpers/__tests__/cleanupNulls.test.ts +772 -0
  113. package/src/helpers/__tests__/createSchemasMap.test.ts +238 -0
  114. package/src/helpers/__tests__/getReferenceIds.test.ts +975 -0
  115. package/src/helpers/__tests__/got.test.ts +193 -0
  116. package/src/helpers/__tests__/mapObjectProperties.test.ts +1126 -0
  117. package/src/helpers/__tests__/normalizeAttributes.test.ts +1435 -0
  118. package/src/helpers/__tests__/normalizeProperties.test.ts +727 -0
  119. package/src/helpers/__tests__/normalizeRequired.test.ts +669 -0
  120. package/src/helpers/__tests__/normalizeType.test.ts +772 -0
  121. package/src/helpers/__tests__/nullifyEmptyValues.test.ts +735 -0
  122. package/src/helpers/__tests__/removeRequiredAndDefault.test.ts +734 -0
  123. package/src/helpers/__tests__/validateId.test.ts +118 -0
  124. package/src/helpers/cleanupAttributes.ts +151 -0
  125. package/src/helpers/cleanupNulls.ts +106 -0
  126. package/src/helpers/createSchemasMap.ts +212 -0
  127. package/src/helpers/getReferenceIds.ts +273 -0
  128. package/src/helpers/got.ts +73 -0
  129. package/src/helpers/mapObjectProperties.ts +272 -0
  130. package/src/helpers/normalizeAttributes.ts +247 -0
  131. package/src/helpers/normalizeProperties.ts +249 -0
  132. package/src/helpers/normalizeRequired.ts +233 -0
  133. package/src/helpers/normalizeType.ts +235 -0
  134. package/src/helpers/nullifyEmptyValues.ts +207 -0
  135. package/src/helpers/removeRequiredAndDefault.ts +151 -0
  136. package/src/helpers/validateId.ts +53 -0
  137. package/src/index.ts +17 -0
  138. package/src/ld/__tests__/documentLoader.test.ts +57 -0
  139. package/src/ld/__tests__/getLinkedDataAttributeType.test.ts +212 -0
  140. package/src/ld/__tests__/getLinkedDataContext.test.ts +378 -0
  141. package/src/ld/documentLoader.ts +28 -0
  142. package/src/ld/getLinkedDataAttributeType.ts +46 -0
  143. package/src/ld/getLinkedDataContext.ts +80 -0
  144. package/tsconfig.json +27 -0
  145. package/types/credentials-context.d.ts +14 -0
  146. package/types/security-context.d.ts +6 -0
  147. package/examples/Status.yaml +0 -3
  148. package/examples/createAccountCredential.js +0 -27
  149. package/examples/createMineSweeperScoreCredential.js +0 -63
  150. package/examples/index.js +0 -9
  151. package/src/CredentialFactory.js +0 -67
  152. package/src/CredentialFactory.spec.js +0 -131
  153. package/src/Schema.js +0 -104
  154. package/src/Schema.spec.js +0 -172
  155. package/src/ValidationError.js +0 -31
  156. package/src/Validator.js +0 -128
  157. package/src/Validator.spec.js +0 -355
  158. package/src/helpers/cleanupAttributes.js +0 -71
  159. package/src/helpers/cleanupNulls.js +0 -42
  160. package/src/helpers/getReferenceIds.js +0 -71
  161. package/src/helpers/mapObject.js +0 -65
  162. package/src/helpers/normalizeAttributes.js +0 -28
  163. package/src/helpers/normalizeProperties.js +0 -61
  164. package/src/helpers/normalizeRequired.js +0 -37
  165. package/src/helpers/normalizeType.js +0 -41
  166. package/src/helpers/nullifyEmptyValues.js +0 -57
  167. package/src/helpers/removeRequiredAndDefault.js +0 -30
  168. package/src/helpers/validateId.js +0 -19
  169. package/src/index.d.ts +0 -25
  170. package/src/index.js +0 -8
  171. package/src/ld/documentLoader.js +0 -25
  172. package/src/ld/documentLoader.spec.js +0 -12
  173. package/src/ld/getLinkedDataContext.js +0 -63
  174. package/src/ld/getLinkedDataType.js +0 -38
  175. /package/examples/{FavoriteItem.yaml → schemas/FavoriteItem.yaml} +0 -0
  176. /package/examples/{Profile.yaml → schemas/Profile.yaml} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JsonSchema.js","sourceRoot":"","sources":["../../src/helpers/JsonSchema.ts"],"names":[],"mappings":""}
@@ -0,0 +1,34 @@
1
+ import type { JsonSchema, TargetObject, JsonSchemasMap } from './JsonSchema';
2
+ /**
3
+ * Removes properties from an object that are not defined in the JSON schema.
4
+ *
5
+ * **Intent:**
6
+ * This function ensures that objects conform to their schema definition by removing
7
+ * any properties that are not explicitly defined in the schema. It performs a deep
8
+ * cleanup, recursively processing nested objects, arrays, and schema references.
9
+ *
10
+ * **Use Cases:**
11
+ * - **Third-party API integrations**: When integrating with external services (e.g., Telegram)
12
+ * that may send additional fields you don't want to process, this function allows you
13
+ * to define a minimal schema and automatically strip unwanted properties.
14
+ * - **Data sanitization**: Clean up objects received from external sources or user input
15
+ * before validation or processing, ensuring only expected fields are present.
16
+ * - **Schema enforcement**: Enforce strict schema compliance by removing any properties
17
+ * that don't match the defined schema structure.
18
+ * - **Pre-validation cleanup**: Remove extraneous properties before schema validation to
19
+ * prevent validation errors from unexpected fields.
20
+ *
21
+ * **Behavior:**
22
+ * - Mutates the input object in-place (does not return a new object)
23
+ * - Recursively processes nested objects, arrays, and schema references ($ref)
24
+ * - Skips enum schemas (returns early without modification)
25
+ * - Only processes object values (skips null, undefined, and primitive values)
26
+ * - Handles array items by cleaning each object item according to the array's item schema
27
+ *
28
+ * @param object - The target object to clean up (mutated in-place)
29
+ * @param jsonSchema - The JSON schema defining allowed properties
30
+ * @param schemasMap - Optional map of schema IDs to schema definitions for resolving $ref references
31
+ */
32
+ declare const cleanupAttributes: (object: TargetObject, jsonSchema: JsonSchema, schemasMap?: JsonSchemasMap) => void;
33
+ export default cleanupAttributes;
34
+ //# sourceMappingURL=cleanupAttributes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cleanupAttributes.d.ts","sourceRoot":"","sources":["../../src/helpers/cleanupAttributes.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,UAAU,EAEV,YAAY,EAEZ,cAAc,EAIf,MAAM,cAAc,CAAC;AAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,QAAA,MAAM,iBAAiB,GACrB,QAAQ,YAAY,EACpB,YAAY,UAAU,EACtB,aAAY,cAAmB,SAqGhC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const lodash_1 = require("lodash");
7
+ const got_1 = __importDefault(require("./got"));
8
+ /**
9
+ * Removes properties from an object that are not defined in the JSON schema.
10
+ *
11
+ * **Intent:**
12
+ * This function ensures that objects conform to their schema definition by removing
13
+ * any properties that are not explicitly defined in the schema. It performs a deep
14
+ * cleanup, recursively processing nested objects, arrays, and schema references.
15
+ *
16
+ * **Use Cases:**
17
+ * - **Third-party API integrations**: When integrating with external services (e.g., Telegram)
18
+ * that may send additional fields you don't want to process, this function allows you
19
+ * to define a minimal schema and automatically strip unwanted properties.
20
+ * - **Data sanitization**: Clean up objects received from external sources or user input
21
+ * before validation or processing, ensuring only expected fields are present.
22
+ * - **Schema enforcement**: Enforce strict schema compliance by removing any properties
23
+ * that don't match the defined schema structure.
24
+ * - **Pre-validation cleanup**: Remove extraneous properties before schema validation to
25
+ * prevent validation errors from unexpected fields.
26
+ *
27
+ * **Behavior:**
28
+ * - Mutates the input object in-place (does not return a new object)
29
+ * - Recursively processes nested objects, arrays, and schema references ($ref)
30
+ * - Skips enum schemas (returns early without modification)
31
+ * - Only processes object values (skips null, undefined, and primitive values)
32
+ * - Handles array items by cleaning each object item according to the array's item schema
33
+ *
34
+ * @param object - The target object to clean up (mutated in-place)
35
+ * @param jsonSchema - The JSON schema defining allowed properties
36
+ * @param schemasMap - Optional map of schema IDs to schema definitions for resolving $ref references
37
+ */
38
+ const cleanupAttributes = (object, jsonSchema, schemasMap = {}) => {
39
+ const { enum: enumItems } = jsonSchema;
40
+ const isEnum = !!enumItems;
41
+ if (isEnum) {
42
+ return;
43
+ }
44
+ const objectSchema = jsonSchema;
45
+ // Guard against malformed schemas without properties
46
+ if (!objectSchema.properties) {
47
+ return;
48
+ }
49
+ for (const fieldName in object) {
50
+ const property = objectSchema.properties[fieldName];
51
+ const isPropertyUndefined = (0, lodash_1.isUndefined)(property);
52
+ if (isPropertyUndefined) {
53
+ // NOTE: Delete object property if it's not defined in the object schema:
54
+ delete object[fieldName];
55
+ continue;
56
+ }
57
+ const { $ref: refSchemaId } = property;
58
+ const isReference = !(0, lodash_1.isUndefined)(refSchemaId);
59
+ if (isReference) {
60
+ const referenceSchema = (0, got_1.default)(schemasMap, refSchemaId, 'Schema "$PATH" not found');
61
+ const fieldValue = object[fieldName];
62
+ // Only recursively cleanup if the value is an object (not null, undefined, or primitive)
63
+ if (fieldValue && typeof fieldValue === 'object' && !Array.isArray(fieldValue)) {
64
+ cleanupAttributes(fieldValue, referenceSchema, schemasMap);
65
+ }
66
+ continue;
67
+ }
68
+ const { type } = property;
69
+ const isObject = type === 'object';
70
+ if (isObject) {
71
+ const { properties = {} } = property;
72
+ const fieldValue = object[fieldName];
73
+ const isObjectValue = fieldValue &&
74
+ typeof fieldValue === 'object' &&
75
+ !Array.isArray(fieldValue);
76
+ if (isObjectValue) {
77
+ const nestedJsonSchema = {
78
+ id: `${objectSchema.id}.${fieldName}.properties`,
79
+ properties
80
+ };
81
+ cleanupAttributes(fieldValue, nestedJsonSchema, schemasMap);
82
+ }
83
+ continue;
84
+ }
85
+ const isArray = type === 'array';
86
+ if (isArray) {
87
+ const { items } = property;
88
+ const fieldValue = object[fieldName];
89
+ const isArrayValue = Array.isArray(fieldValue);
90
+ if (isArrayValue && items) {
91
+ const { $ref: itemRefSchemaId } = items;
92
+ const { properties: itemObjectProperties = {} } = items;
93
+ const isItemReference = !(0, lodash_1.isUndefined)(itemRefSchemaId);
94
+ const itemSchema = isItemReference
95
+ ? (0, got_1.default)(schemasMap, itemRefSchemaId, 'Schema "$PATH" not found')
96
+ : {
97
+ id: `${objectSchema.id}.${fieldName}.items.properties`,
98
+ properties: itemObjectProperties
99
+ };
100
+ for (const item of fieldValue) {
101
+ const isObjectItem = item &&
102
+ typeof item === 'object' &&
103
+ !Array.isArray(item);
104
+ if (isObjectItem) {
105
+ cleanupAttributes(item, itemSchema, schemasMap);
106
+ }
107
+ }
108
+ }
109
+ }
110
+ }
111
+ };
112
+ exports.default = cleanupAttributes;
113
+ //# sourceMappingURL=cleanupAttributes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cleanupAttributes.js","sourceRoot":"","sources":["../../src/helpers/cleanupAttributes.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Returns a deep copy of the object with all null properties removed.
3
+ *
4
+ * This is the main exported function that creates a clone of the input object
5
+ * and removes all null properties recursively before returning it.
6
+ *
7
+ * @param object - The object to clean (will be cloned, original is not modified)
8
+ * @returns A new object with all null properties removed recursively
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * const dirty = {
13
+ * name: 'John',
14
+ * age: null,
15
+ * address: {
16
+ * street: 'Main St',
17
+ * zip: null
18
+ * }
19
+ * };
20
+ *
21
+ * const clean = cleanupNulls(dirty);
22
+ * // Result: { name: 'John', address: { street: 'Main St' } }
23
+ * // Original 'dirty' object is unchanged
24
+ * ```
25
+ */
26
+ export default function (object: Record<string, unknown>): Record<string, unknown>;
27
+ //# sourceMappingURL=cleanupNulls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cleanupNulls.d.ts","sourceRoot":"","sources":["../../src/helpers/cleanupNulls.ts"],"names":[],"mappings":"AA0EA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,2BAMvD"}
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = default_1;
4
+ const lodash_1 = require("lodash");
5
+ const { isArray } = Array;
6
+ /**
7
+ * Recursively removes null properties from an object.
8
+ *
9
+ * **Intent:**
10
+ * This function provides a deep cleanup of objects by removing all properties
11
+ * that have `null` values. It's designed to sanitize objects before validation,
12
+ * storage, or transmission by eliminating explicitly null fields.
13
+ *
14
+ * **Use Cases:**
15
+ * - **Pre-validation cleanup**: Remove null values before schema validation to
16
+ * prevent validation errors from optional fields that were explicitly set to null.
17
+ * This is particularly useful when `shouldCleanupNulls` is enabled in the Validator,
18
+ * allowing you to clean objects before `cleanupAttributes` removes undefined properties.
19
+ * - **Data sanitization**: Clean objects received from external sources (APIs, user input,
20
+ * databases) by removing null properties that may have been set during data transformation
21
+ * or migration processes.
22
+ * - **API response normalization**: Prepare objects for API responses by removing null fields,
23
+ * reducing payload size and ensuring consistent data structures across different endpoints.
24
+ * - **Database operations**: Clean objects before database storage or updates, removing
25
+ * null fields that might cause issues with database constraints or indexing.
26
+ * - **JSON serialization optimization**: Reduce JSON payload size by removing null properties
27
+ * before serialization, which is especially beneficial for large objects or high-frequency
28
+ * API calls.
29
+ * - **Optional field handling**: Remove explicitly null optional fields that weren't provided
30
+ * by the user, distinguishing between "field not provided" (undefined) and "field set to null".
31
+ *
32
+ * **Behavior:**
33
+ * - Returns a deep clone of the input object (does not mutate the original)
34
+ * - Recursively processes nested objects and arrays at all depth levels
35
+ * - Only removes properties with `null` values (preserves `undefined`, `0`, `false`, `''`, etc.)
36
+ * - Skips non-object values (returns early for primitives)
37
+ * - Handles arrays by recursively processing each item
38
+ * - Preserves object structure and non-null values exactly as they are
39
+ *
40
+ * @param target - The target object to clean (processed recursively, not mutated)
41
+ */
42
+ const cleanupNulls = (target) => {
43
+ const shouldSkip = !(0, lodash_1.isObject)(target);
44
+ if (shouldSkip) {
45
+ return;
46
+ }
47
+ for (const key in target) {
48
+ const value = target[key];
49
+ if (isArray(value)) {
50
+ for (const item of value) {
51
+ cleanupNulls(item);
52
+ }
53
+ continue;
54
+ }
55
+ if ((0, lodash_1.isObject)(value)) {
56
+ cleanupNulls(value);
57
+ continue;
58
+ }
59
+ const isNull = value === null;
60
+ if (isNull) {
61
+ delete target[key];
62
+ }
63
+ }
64
+ };
65
+ /**
66
+ * Returns a deep copy of the object with all null properties removed.
67
+ *
68
+ * This is the main exported function that creates a clone of the input object
69
+ * and removes all null properties recursively before returning it.
70
+ *
71
+ * @param object - The object to clean (will be cloned, original is not modified)
72
+ * @returns A new object with all null properties removed recursively
73
+ *
74
+ * @example
75
+ * ```typescript
76
+ * const dirty = {
77
+ * name: 'John',
78
+ * age: null,
79
+ * address: {
80
+ * street: 'Main St',
81
+ * zip: null
82
+ * }
83
+ * };
84
+ *
85
+ * const clean = cleanupNulls(dirty);
86
+ * // Result: { name: 'John', address: { street: 'Main St' } }
87
+ * // Original 'dirty' object is unchanged
88
+ * ```
89
+ */
90
+ function default_1(object) {
91
+ const clone = (0, lodash_1.cloneDeep)(object);
92
+ cleanupNulls(clone);
93
+ return clone;
94
+ }
95
+ ;
96
+ //# sourceMappingURL=cleanupNulls.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cleanupNulls.js","sourceRoot":"","sources":["../../src/helpers/cleanupNulls.ts"],"names":[],"mappings":";;AAmGA,4BAMC;AAzGD,mCAA6C;AAI7C,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;AAE1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,YAAY,GAAG,CAAC,MAAoB,EAAE,EAAE;IAC5C,MAAM,UAAU,GAAG,CAAC,IAAA,iBAAQ,EAAC,MAAM,CAAC,CAAC;IAErC,IAAI,UAAU,EAAE,CAAC;QACf,OAAO;IACT,CAAC;IAED,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;QACzB,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAE1B,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACnB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;gBACzB,YAAY,CAAC,IAAI,CAAC,CAAC;YACrB,CAAC;YAED,SAAS;QACX,CAAC;QAED,IAAI,IAAA,iBAAQ,EAAC,KAAK,CAAC,EAAE,CAAC;YACpB,YAAY,CAAC,KAAgC,CAAC,CAAC;YAE/C,SAAS;QACX,CAAC;QAED,MAAM,MAAM,GAAG,KAAK,KAAK,IAAI,CAAC;QAE9B,IAAI,MAAM,EAAE,CAAC;YACX,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC;IACH,CAAC;AACH,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,mBAAyB,MAA+B;IACtD,MAAM,KAAK,GAAG,IAAA,kBAAS,EAAC,MAAM,CAAC,CAAC;IAEhC,YAAY,CAAC,KAAK,CAAC,CAAC;IAEpB,OAAO,KAAK,CAAC;AACf,CAAC;AAAA,CAAC"}
@@ -0,0 +1,67 @@
1
+ import Schema from '../Schema';
2
+ /**
3
+ * Creates a map of schemas by ID, loading from YAML files and merging with programmatic schemas.
4
+ *
5
+ * **Intent:** Build a centralized schema registry that combines file-based YAML schemas
6
+ * with programmatically created Schema instances, providing a unified lookup mechanism
7
+ * by schema ID. This enables hybrid schema management where some schemas are defined
8
+ * in YAML files while others are created dynamically in code.
9
+ *
10
+ * **Use Cases:**
11
+ * - Initialize schema registries for validators from both files and code
12
+ * - Support schema composition where base schemas come from files and extended
13
+ * schemas are created programmatically
14
+ * - Enable schema overriding where programmatic schemas can replace file-based ones
15
+ * - Build schema maps for credential factories or API validation systems
16
+ * - Support development workflows where schemas evolve from YAML to code
17
+ *
18
+ * @param servicePath - Path to directory containing YAML schema files (searched recursively)
19
+ * @param modules - Array of Schema instances or other values (non-Schema values are filtered out)
20
+ * @returns Record mapping schema IDs to Schema instances, with modules schemas overriding YAML schemas
21
+ *
22
+ * **Example - Basic Usage:**
23
+ * ```typescript
24
+ * const schemasMap = createSchemasMap('/path/to/examples/schemas', []);
25
+ * // Returns: {
26
+ * // FavoriteItem: Schema { id: 'FavoriteItem', ... },
27
+ * // Profile: Schema { id: 'Profile', ... },
28
+ * // Status: Schema { id: 'Status', ... },
29
+ * // Preferences: Schema { id: 'Preferences', ... }
30
+ * // }
31
+ * ```
32
+ *
33
+ * **Example - Merging Programmatic Schemas:**
34
+ * ```typescript
35
+ * const customSchema = new Schema(
36
+ * { customField: { type: 'string' } },
37
+ * 'CustomSchema'
38
+ * );
39
+ * const schemasMap = createSchemasMap('/path/to/schemas', [customSchema]);
40
+ * // schemasMap contains both YAML schemas and CustomSchema
41
+ * ```
42
+ *
43
+ * **Example - Overriding YAML Schemas:**
44
+ * ```typescript
45
+ * const updatedProfile = new Schema(
46
+ * { name: { type: 'string' }, newField: { type: 'number' } },
47
+ * 'Profile'
48
+ * );
49
+ * const schemasMap = createSchemasMap('/path/to/schemas', [updatedProfile]);
50
+ * // schemasMap.Profile is the updatedProfile instance, not the YAML version
51
+ * ```
52
+ *
53
+ * **Example - Filtering Non-Schema Values:**
54
+ * ```typescript
55
+ * const schema = new Schema({ field: { type: 'string' } }, 'Test');
56
+ * const schemasMap = createSchemasMap('/path/to/schemas', [
57
+ * schema,
58
+ * 'not a schema',
59
+ * { id: 'fake' },
60
+ * null
61
+ * ]);
62
+ * // Only the Schema instance is included, other values are ignored
63
+ * ```
64
+ */
65
+ declare const createSchemasMap: (servicePath: string, modules: unknown[]) => Record<string, Schema>;
66
+ export default createSchemasMap;
67
+ //# sourceMappingURL=createSchemasMap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createSchemasMap.d.ts","sourceRoot":"","sources":["../../src/helpers/createSchemasMap.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,WAAW,CAAC;AAqI/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AACH,QAAA,MAAM,gBAAgB,GAAI,aAAa,MAAM,EAAE,SAAS,OAAO,EAAE,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAYxF,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,200 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const path_1 = __importDefault(require("path"));
7
+ const Schema_1 = __importDefault(require("../Schema"));
8
+ const js_yaml_1 = require("js-yaml");
9
+ const lodash_1 = require("lodash");
10
+ const fs_1 = require("fs");
11
+ /**
12
+ * Reads schema source from YAML file and returns a Schema instance.
13
+ *
14
+ * **Intent:** Load and parse a single YAML schema file, extracting the schema ID
15
+ * from the filename and creating a Schema instance for use in validation or
16
+ * schema composition.
17
+ *
18
+ * **Use Cases:**
19
+ * - Load individual schema files during application startup
20
+ * - Parse YAML schema definitions into Schema instances
21
+ * - Extract schema identifiers from file paths automatically
22
+ * - Support both enum and properties-based schemas from YAML files
23
+ *
24
+ * @param yamlPath - Absolute or relative path to the YAML schema file
25
+ * @returns A Schema instance with ID extracted from the filename (without .yaml extension)
26
+ *
27
+ * **Example:**
28
+ * ```typescript
29
+ * const schema = loadSync('/path/to/schemas/User.yaml');
30
+ * // schema.id === 'User'
31
+ * // schema.source contains the parsed YAML content
32
+ * ```
33
+ *
34
+ * **Example - Enum Schema:**
35
+ * ```typescript
36
+ * const statusSchema = loadSync('/path/to/schemas/Status.yaml');
37
+ * // If Status.yaml contains: { enum: ['PENDING', 'ACTIVE'] }
38
+ * // statusSchema.isEnum === true
39
+ * ```
40
+ */
41
+ const loadSync = (yamlPath) => {
42
+ const schemaId = yamlPath
43
+ .split('/')
44
+ .reverse()[0]
45
+ .split('.yaml')[0];
46
+ const file = (0, fs_1.readFileSync)(yamlPath);
47
+ const source = (0, js_yaml_1.load)(file.toString());
48
+ return new Schema_1.default(source, schemaId);
49
+ };
50
+ /**
51
+ * Recursively lists all files in a directory and its subdirectories.
52
+ *
53
+ * **Intent:** Traverse a directory tree and collect all file paths, enabling
54
+ * discovery of schema files nested in subdirectories without manual path specification.
55
+ *
56
+ * **Use Cases:**
57
+ * - Find all schema files in a directory structure
58
+ * - Support organized schema layouts with nested folders
59
+ * - Enable schema discovery without hardcoding file paths
60
+ * - Prepare file list for filtering and processing
61
+ *
62
+ * @param servicePath - Path to the directory to traverse
63
+ * @returns Array of absolute file paths found in the directory tree
64
+ *
65
+ * **Example:**
66
+ * ```typescript
67
+ * const files = listFilesSync('/path/to/schemas');
68
+ * // Returns: [
69
+ * // '/path/to/schemas/User.yaml',
70
+ * // '/path/to/schemas/nested/Profile.yaml',
71
+ * // '/path/to/schemas/nested/deep/Status.yaml'
72
+ * // ]
73
+ * ```
74
+ *
75
+ * **Example - Flat Directory:**
76
+ * ```typescript
77
+ * const files = listFilesSync('/path/to/schemas');
78
+ * // Returns: [
79
+ * // '/path/to/schemas/User.yaml',
80
+ * // '/path/to/schemas/Profile.yaml'
81
+ * // ]
82
+ * ```
83
+ */
84
+ const listFilesSync = (servicePath) => (0, fs_1.readdirSync)(servicePath)
85
+ .reduce((filePaths, fileName) => (0, fs_1.statSync)(path_1.default.join(servicePath, fileName)).isDirectory() ?
86
+ filePaths.concat(listFilesSync(path_1.default.join(servicePath, fileName))) :
87
+ filePaths.concat(path_1.default.join(servicePath, fileName)), []);
88
+ /**
89
+ * Reads all YAML schema files from a directory and creates Schema instances.
90
+ *
91
+ * **Intent:** Bulk load schema definitions from YAML files in a directory,
92
+ * automatically discovering and parsing all schema files for use in schema
93
+ * registries or validators.
94
+ *
95
+ * **Use Cases:**
96
+ * - Load all schemas from a schemas directory at application startup
97
+ * - Initialize schema registries from file-based definitions
98
+ * - Support schema-as-code workflows where schemas are stored as YAML files
99
+ * - Enable automatic schema discovery without manual registration
100
+ *
101
+ * @param servicePath - Path to the directory containing YAML schema files
102
+ * @returns Array of Schema instances, one for each YAML file found
103
+ *
104
+ * **Example:**
105
+ * ```typescript
106
+ * const schemas = readSchemasSync('/path/to/examples/schemas');
107
+ * // Returns: [
108
+ * // Schema { id: 'FavoriteItem', ... },
109
+ * // Schema { id: 'Profile', ... },
110
+ * // Schema { id: 'Status', ... },
111
+ * // Schema { id: 'Preferences', ... }
112
+ * // ]
113
+ * ```
114
+ *
115
+ * **Example - With Nested Directories:**
116
+ * ```typescript
117
+ * const schemas = readSchemasSync('/path/to/schemas');
118
+ * // Automatically finds schemas in subdirectories:
119
+ * // - /path/to/schemas/User.yaml
120
+ * // - /path/to/schemas/nested/Profile.yaml
121
+ * ```
122
+ */
123
+ const readSchemasSync = (servicePath) => listFilesSync(servicePath)
124
+ .filter((fileName) => fileName.endsWith('.yaml'))
125
+ .map((schemaPath) => loadSync(schemaPath));
126
+ /**
127
+ * Creates a map of schemas by ID, loading from YAML files and merging with programmatic schemas.
128
+ *
129
+ * **Intent:** Build a centralized schema registry that combines file-based YAML schemas
130
+ * with programmatically created Schema instances, providing a unified lookup mechanism
131
+ * by schema ID. This enables hybrid schema management where some schemas are defined
132
+ * in YAML files while others are created dynamically in code.
133
+ *
134
+ * **Use Cases:**
135
+ * - Initialize schema registries for validators from both files and code
136
+ * - Support schema composition where base schemas come from files and extended
137
+ * schemas are created programmatically
138
+ * - Enable schema overriding where programmatic schemas can replace file-based ones
139
+ * - Build schema maps for credential factories or API validation systems
140
+ * - Support development workflows where schemas evolve from YAML to code
141
+ *
142
+ * @param servicePath - Path to directory containing YAML schema files (searched recursively)
143
+ * @param modules - Array of Schema instances or other values (non-Schema values are filtered out)
144
+ * @returns Record mapping schema IDs to Schema instances, with modules schemas overriding YAML schemas
145
+ *
146
+ * **Example - Basic Usage:**
147
+ * ```typescript
148
+ * const schemasMap = createSchemasMap('/path/to/examples/schemas', []);
149
+ * // Returns: {
150
+ * // FavoriteItem: Schema { id: 'FavoriteItem', ... },
151
+ * // Profile: Schema { id: 'Profile', ... },
152
+ * // Status: Schema { id: 'Status', ... },
153
+ * // Preferences: Schema { id: 'Preferences', ... }
154
+ * // }
155
+ * ```
156
+ *
157
+ * **Example - Merging Programmatic Schemas:**
158
+ * ```typescript
159
+ * const customSchema = new Schema(
160
+ * { customField: { type: 'string' } },
161
+ * 'CustomSchema'
162
+ * );
163
+ * const schemasMap = createSchemasMap('/path/to/schemas', [customSchema]);
164
+ * // schemasMap contains both YAML schemas and CustomSchema
165
+ * ```
166
+ *
167
+ * **Example - Overriding YAML Schemas:**
168
+ * ```typescript
169
+ * const updatedProfile = new Schema(
170
+ * { name: { type: 'string' }, newField: { type: 'number' } },
171
+ * 'Profile'
172
+ * );
173
+ * const schemasMap = createSchemasMap('/path/to/schemas', [updatedProfile]);
174
+ * // schemasMap.Profile is the updatedProfile instance, not the YAML version
175
+ * ```
176
+ *
177
+ * **Example - Filtering Non-Schema Values:**
178
+ * ```typescript
179
+ * const schema = new Schema({ field: { type: 'string' } }, 'Test');
180
+ * const schemasMap = createSchemasMap('/path/to/schemas', [
181
+ * schema,
182
+ * 'not a schema',
183
+ * { id: 'fake' },
184
+ * null
185
+ * ]);
186
+ * // Only the Schema instance is included, other values are ignored
187
+ * ```
188
+ */
189
+ const createSchemasMap = (servicePath, modules) => {
190
+ const yamlSchemas = readSchemasSync(servicePath);
191
+ const schemasMap = (0, lodash_1.keyBy)(yamlSchemas, 'id');
192
+ const schemas = modules
193
+ .filter(schema => schema instanceof Schema_1.default);
194
+ for (const schema of schemas) {
195
+ schemasMap[schema.id] = schema;
196
+ }
197
+ return schemasMap;
198
+ };
199
+ exports.default = createSchemasMap;
200
+ //# sourceMappingURL=createSchemasMap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createSchemasMap.js","sourceRoot":"","sources":["../../src/helpers/createSchemasMap.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AACxB,uDAA+B;AAC/B,qCAA+B;AAC/B,mCAA+B;AAE/B,2BAAyD;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,QAAQ,GAAG,CAAC,QAAgB,EAAE,EAAE;IACpC,MAAM,QAAQ,GAAG,QAAQ;SACtB,KAAK,CAAC,GAAG,CAAC;SACV,OAAO,EAAE,CAAC,CAAC,CAAC;SACZ,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAErB,MAAM,IAAI,GAAG,IAAA,iBAAY,EAAC,QAAQ,CAAC,CAAC;IACpC,MAAM,MAAM,GAAG,IAAA,cAAI,EAAC,IAAI,CAAC,QAAQ,EAAE,CAAkC,CAAC;IAEtE,OAAO,IAAI,gBAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AACtC,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,aAAa,GAAG,CAAC,WAAmB,EAAY,EAAE,CACtD,IAAA,gBAAW,EAAC,WAAW,CAAC;KACrB,MAAM,CACL,CAAC,SAAmB,EAAE,QAAgB,EAAE,EAAE,CACxC,IAAA,aAAQ,EACN,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;IAC/C,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IACnE,SAAS,CAAC,MAAM,CAAC,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CACpD,EACH,EAAE,CAAC,CAAC;AAEV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,eAAe,GAAG,CAAC,WAAmB,EAAE,EAAE,CAC9C,aAAa,CAAC,WAAW,CAAC;KACvB,MAAM,CAAC,CAAC,QAAgB,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;KACxD,GAAG,CAAC,CAAC,UAAkB,EAAE,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AACH,MAAM,gBAAgB,GAAG,CAAC,WAAmB,EAAE,OAAkB,EAA0B,EAAE;IAC3F,MAAM,WAAW,GAAG,eAAe,CAAC,WAAW,CAAC,CAAC;IACjD,MAAM,UAAU,GAAG,IAAA,cAAK,EAAC,WAAW,EAAE,IAAI,CAAC,CAAC;IAE5C,MAAM,OAAO,GAAG,OAAO;SACpB,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,YAAY,gBAAM,CAAC,CAAC;IAE9C,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC;IACjC,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAEF,kBAAe,gBAAgB,CAAC"}