@kravc/schema 2.8.0-alpha.7 → 2.8.0-alpha.8

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 (118) hide show
  1. package/dist/CredentialFactory.d.ts +5 -318
  2. package/dist/CredentialFactory.d.ts.map +1 -1
  3. package/dist/CredentialFactory.js +5 -317
  4. package/dist/CredentialFactory.js.map +1 -1
  5. package/dist/Schema.d.ts +15 -420
  6. package/dist/Schema.d.ts.map +1 -1
  7. package/dist/Schema.js +13 -384
  8. package/dist/Schema.js.map +1 -1
  9. package/dist/ValidationError.d.ts +3 -49
  10. package/dist/ValidationError.d.ts.map +1 -1
  11. package/dist/ValidationError.js +3 -48
  12. package/dist/ValidationError.js.map +1 -1
  13. package/dist/Validator.d.ts +6 -470
  14. package/dist/Validator.d.ts.map +1 -1
  15. package/dist/Validator.js +50 -478
  16. package/dist/Validator.js.map +1 -1
  17. package/dist/helpers/cleanupAttributes.d.ts +3 -32
  18. package/dist/helpers/cleanupAttributes.d.ts.map +1 -1
  19. package/dist/helpers/cleanupAttributes.js +1 -30
  20. package/dist/helpers/cleanupAttributes.js.map +1 -1
  21. package/dist/helpers/cleanupNulls.d.ts +1 -25
  22. package/dist/helpers/cleanupNulls.d.ts.map +1 -1
  23. package/dist/helpers/cleanupNulls.js +2 -61
  24. package/dist/helpers/cleanupNulls.js.map +1 -1
  25. package/dist/helpers/createSchemasMap.d.ts +2 -93
  26. package/dist/helpers/createSchemasMap.d.ts.map +1 -1
  27. package/dist/helpers/createSchemasMap.js +4 -162
  28. package/dist/helpers/createSchemasMap.js.map +1 -1
  29. package/dist/helpers/getReferenceIds.d.ts +1 -165
  30. package/dist/helpers/getReferenceIds.d.ts.map +1 -1
  31. package/dist/helpers/getReferenceIds.js +2 -166
  32. package/dist/helpers/getReferenceIds.js.map +1 -1
  33. package/dist/helpers/got.d.ts +1 -57
  34. package/dist/helpers/got.d.ts.map +1 -1
  35. package/dist/helpers/got.js +1 -57
  36. package/dist/helpers/got.js.map +1 -1
  37. package/dist/helpers/mapObjectProperties.d.ts +2 -144
  38. package/dist/helpers/mapObjectProperties.d.ts.map +1 -1
  39. package/dist/helpers/mapObjectProperties.js +1 -142
  40. package/dist/helpers/mapObjectProperties.js.map +1 -1
  41. package/dist/helpers/normalizeAttributes.d.ts +3 -211
  42. package/dist/helpers/normalizeAttributes.d.ts.map +1 -1
  43. package/dist/helpers/normalizeAttributes.js +1 -209
  44. package/dist/helpers/normalizeAttributes.js.map +1 -1
  45. package/dist/helpers/normalizeProperties.d.ts +1 -165
  46. package/dist/helpers/normalizeProperties.d.ts.map +1 -1
  47. package/dist/helpers/normalizeProperties.js +1 -164
  48. package/dist/helpers/normalizeProperties.js.map +1 -1
  49. package/dist/helpers/normalizeRequired.d.ts +1 -153
  50. package/dist/helpers/normalizeRequired.d.ts.map +1 -1
  51. package/dist/helpers/normalizeRequired.js +0 -151
  52. package/dist/helpers/normalizeRequired.js.map +1 -1
  53. package/dist/helpers/normalizeType.d.ts +1 -77
  54. package/dist/helpers/normalizeType.d.ts.map +1 -1
  55. package/dist/helpers/normalizeType.js +11 -139
  56. package/dist/helpers/normalizeType.js.map +1 -1
  57. package/dist/helpers/nullifyEmptyValues.d.ts +1 -135
  58. package/dist/helpers/nullifyEmptyValues.d.ts.map +1 -1
  59. package/dist/helpers/nullifyEmptyValues.js +13 -143
  60. package/dist/helpers/nullifyEmptyValues.js.map +1 -1
  61. package/dist/helpers/removeRequiredAndDefault.d.ts +2 -102
  62. package/dist/helpers/removeRequiredAndDefault.d.ts.map +1 -1
  63. package/dist/helpers/removeRequiredAndDefault.js +1 -100
  64. package/dist/helpers/removeRequiredAndDefault.js.map +1 -1
  65. package/dist/helpers/validateId.d.ts +1 -36
  66. package/dist/helpers/validateId.d.ts.map +1 -1
  67. package/dist/helpers/validateId.js +1 -36
  68. package/dist/helpers/validateId.js.map +1 -1
  69. package/dist/ld/documentLoader.d.ts +1 -1
  70. package/dist/ld/documentLoader.d.ts.map +1 -1
  71. package/dist/ld/documentLoader.js +1 -1
  72. package/dist/ld/documentLoader.js.map +1 -1
  73. package/dist/ld/getLinkedDataAttributeType.d.ts +1 -1
  74. package/dist/ld/getLinkedDataAttributeType.d.ts.map +1 -1
  75. package/dist/ld/getLinkedDataAttributeType.js +1 -1
  76. package/dist/ld/getLinkedDataAttributeType.js.map +1 -1
  77. package/dist/ld/getLinkedDataContext.d.ts +1 -1
  78. package/dist/ld/getLinkedDataContext.d.ts.map +1 -1
  79. package/dist/ld/getLinkedDataContext.js +1 -1
  80. package/dist/ld/getLinkedDataContext.js.map +1 -1
  81. package/package.json +2 -2
  82. package/src/CredentialFactory.ts +5 -318
  83. package/src/Schema.ts +17 -427
  84. package/src/ValidationError.ts +5 -52
  85. package/src/Validator.ts +19 -483
  86. package/src/__tests__/CredentialFactory.test.ts +1 -1
  87. package/src/__tests__/Schema.test.ts +3 -8
  88. package/src/__tests__/ValidationError.test.ts +4 -2
  89. package/src/__tests__/Validator.test.ts +21 -4
  90. package/src/helpers/__tests__/cleanupAttributes.test.ts +3 -1
  91. package/src/helpers/__tests__/createSchemasMap.test.ts +1 -1
  92. package/src/helpers/__tests__/mapObjectProperties.test.ts +2 -1
  93. package/src/helpers/__tests__/normalizeAttributes.test.ts +4 -2
  94. package/src/helpers/__tests__/normalizeProperties.test.ts +3 -1
  95. package/src/helpers/__tests__/normalizeRequired.test.ts +4 -9
  96. package/src/helpers/__tests__/nullifyEmptyValues.test.ts +43 -12
  97. package/src/helpers/__tests__/removeRequiredAndDefault.test.ts +3 -10
  98. package/src/helpers/cleanupAttributes.ts +6 -44
  99. package/src/helpers/cleanupNulls.ts +2 -63
  100. package/src/helpers/createSchemasMap.ts +4 -163
  101. package/src/helpers/getReferenceIds.ts +2 -173
  102. package/src/helpers/got.ts +1 -57
  103. package/src/helpers/mapObjectProperties.ts +4 -156
  104. package/src/helpers/normalizeAttributes.ts +7 -211
  105. package/src/helpers/normalizeProperties.ts +1 -172
  106. package/src/helpers/normalizeRequired.ts +1 -161
  107. package/src/helpers/normalizeType.ts +11 -139
  108. package/src/helpers/nullifyEmptyValues.ts +10 -145
  109. package/src/helpers/removeRequiredAndDefault.ts +1 -106
  110. package/src/helpers/validateId.ts +1 -36
  111. package/src/ld/documentLoader.ts +1 -1
  112. package/src/ld/getLinkedDataAttributeType.ts +1 -1
  113. package/src/ld/getLinkedDataContext.ts +1 -1
  114. package/src/{helpers/JsonSchema.ts → types.d.ts} +12 -16
  115. package/dist/helpers/JsonSchema.d.ts +0 -99
  116. package/dist/helpers/JsonSchema.d.ts.map +0 -1
  117. package/dist/helpers/JsonSchema.js +0 -3
  118. package/dist/helpers/JsonSchema.js.map +0 -1
@@ -4,173 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const lodash_1 = require("lodash");
7
- const Schema_1 = __importDefault(require("../Schema"));
8
7
  const got_1 = __importDefault(require("./got"));
9
- /**
10
- * Recursively extracts all referenced schema IDs from a schema structure.
11
- *
12
- * **Intent:** Traverse a schema's entire structure (including nested objects and arrays)
13
- * to collect all schema IDs that are referenced via `$ref` properties. This enables
14
- * dependency resolution, schema bundling, and validation of schema completeness.
15
- *
16
- * **Use Cases:**
17
- * - **Dependency Resolution:** Identify all schemas that a given schema depends on,
18
- * ensuring they are loaded before validation
19
- * - **Schema Bundling:** Collect all related schemas into a single bundle for
20
- * distribution or storage
21
- * - **Validation Preparation:** Pre-load all referenced schemas to ensure complete
22
- * validation context
23
- * - **Dependency Graph Building:** Understand the relationships and dependencies
24
- * between schemas in a schema registry
25
- * - **Schema Analysis:** Analyze schema complexity by identifying all dependencies
26
- * - **Circular Reference Detection:** (Note: current implementation does not handle
27
- * circular references and will recurse infinitely)
28
- *
29
- * **Behavior:**
30
- * - Returns an empty array for enum schemas (they don't reference other schemas)
31
- * - Recursively traverses nested object properties
32
- * - Handles array items that reference schemas or contain object properties
33
- * - Follows nested references to collect transitive dependencies
34
- * - Returns unique schema IDs (deduplicates if same schema is referenced multiple times)
35
- * - Throws an error if a referenced schema is not found in the schemasMap
36
- *
37
- * **Example - Simple Reference:**
38
- * ```typescript
39
- * const userSchema = new Schema({
40
- * profile: { $ref: 'Profile' }
41
- * }, 'User');
42
- *
43
- * const profileSchema = new Schema({
44
- * name: { type: 'string' }
45
- * }, 'Profile');
46
- *
47
- * const schemasMap = { 'Profile': profileSchema };
48
- * const referenceIds = getReferenceIds(userSchema, schemasMap);
49
- * // Returns: ['Profile']
50
- * ```
51
- *
52
- * **Example - Multiple References:**
53
- * ```typescript
54
- * const orderSchema = new Schema({
55
- * customer: { $ref: 'Customer' },
56
- * product: { $ref: 'Product' },
57
- * shipping: { $ref: 'Address' }
58
- * }, 'Order');
59
- *
60
- * const schemasMap = {
61
- * 'Customer': customerSchema,
62
- * 'Product': productSchema,
63
- * 'Address': addressSchema
64
- * };
65
- * const referenceIds = getReferenceIds(orderSchema, schemasMap);
66
- * // Returns: ['Customer', 'Product', 'Address']
67
- * ```
68
- *
69
- * **Example - Nested References:**
70
- * ```typescript
71
- * const userSchema = new Schema({
72
- * profile: { $ref: 'Profile' }
73
- * }, 'User');
74
- *
75
- * const profileSchema = new Schema({
76
- * address: { $ref: 'Address' }
77
- * }, 'Profile');
78
- *
79
- * const addressSchema = new Schema({
80
- * street: { type: 'string' }
81
- * }, 'Address');
82
- *
83
- * const schemasMap = {
84
- * 'Profile': profileSchema,
85
- * 'Address': addressSchema
86
- * };
87
- * const referenceIds = getReferenceIds(userSchema, schemasMap);
88
- * // Returns: ['Profile', 'Address'] (includes transitive dependencies)
89
- * ```
90
- *
91
- * **Example - Array with Reference Items:**
92
- * ```typescript
93
- * const orderSchema = new Schema({
94
- * items: {
95
- * type: 'array',
96
- * items: { $ref: 'OrderItem' }
97
- * }
98
- * }, 'Order');
99
- *
100
- * const schemasMap = { 'OrderItem': orderItemSchema };
101
- * const referenceIds = getReferenceIds(orderSchema, schemasMap);
102
- * // Returns: ['OrderItem']
103
- * ```
104
- *
105
- * **Example - Nested Object Properties:**
106
- * ```typescript
107
- * const userSchema = new Schema({
108
- * contact: {
109
- * type: 'object',
110
- * properties: {
111
- * address: { $ref: 'Address' }
112
- * }
113
- * }
114
- * }, 'User');
115
- *
116
- * const schemasMap = { 'Address': addressSchema };
117
- * const referenceIds = getReferenceIds(userSchema, schemasMap);
118
- * // Returns: ['Address']
119
- * ```
120
- *
121
- * **Example - Complex Mixed Structure:**
122
- * ```typescript
123
- * const orderSchema = new Schema({
124
- * customer: { $ref: 'Customer' },
125
- * items: {
126
- * type: 'array',
127
- * items: {
128
- * type: 'object',
129
- * properties: {
130
- * product: { $ref: 'Product' }
131
- * }
132
- * }
133
- * },
134
- * shipping: {
135
- * type: 'object',
136
- * properties: {
137
- * address: { $ref: 'Address' }
138
- * }
139
- * }
140
- * }, 'Order');
141
- *
142
- * const schemasMap = {
143
- * 'Customer': customerSchema,
144
- * 'Product': productSchema,
145
- * 'Address': addressSchema
146
- * };
147
- * const referenceIds = getReferenceIds(orderSchema, schemasMap);
148
- * // Returns: ['Customer', 'Product', 'Address']
149
- * ```
150
- *
151
- * **Example - Duplicate References:**
152
- * ```typescript
153
- * const schema = new Schema({
154
- * field1: { $ref: 'SharedSchema' },
155
- * field2: { $ref: 'SharedSchema' }
156
- * }, 'Test');
157
- *
158
- * const schemasMap = { 'SharedSchema': sharedSchema };
159
- * const referenceIds = getReferenceIds(schema, schemasMap);
160
- * // Returns: ['SharedSchema'] (deduplicated)
161
- * ```
162
- *
163
- * @param schema - The schema to extract references from
164
- * @param schemasMap - A map of schema IDs to Schema instances, used to resolve
165
- * referenced schemas and traverse nested references
166
- * @returns An array of unique schema IDs that are referenced (directly or indirectly)
167
- * by the given schema
168
- * @throws Error if a referenced schema is not found in the schemasMap
169
- *
170
- * **Limitations:**
171
- * - Does not handle circular references (will cause infinite recursion)
172
- * - Requires all referenced schemas to be present in schemasMap
173
- */
8
+ const Schema_1 = __importDefault(require("../Schema"));
9
+ /** Recursively extracts all referenced schema IDs from a schema structure. */
174
10
  const getReferenceIds = (schema, schemasMap) => {
175
11
  /** Returns schema from the map by ID */
176
12
  const getSchema = (id) => (0, got_1.default)(schemasMap, id, 'Schema "$PATH" not found');
@@ -1 +1 @@
1
- {"version":3,"file":"getReferenceIds.js","sourceRoot":"","sources":["../../src/helpers/getReferenceIds.ts"],"names":[],"mappings":";;;;;AAAA,mCAA2C;AAE3C,uDAA+B;AAC/B,gDAAwB;AASxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoKG;AACH,MAAM,eAAe,GAAG,CAAC,MAAc,EAAE,UAAkC,EAAY,EAAE;IACvF,wCAAwC;IACxC,MAAM,SAAS,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,IAAA,aAAG,EAAC,UAAU,EAAE,EAAE,EAAE,0BAA0B,CAAC,CAAC;IAElF,IAAI,YAAY,GAAa,EAAE,CAAC;IAEhC,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;IAC9B,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAI,UAAyB,CAAC;IAEpD,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,YAAY,GAAI,UAA2B,CAAC;IAElD,KAAK,MAAM,YAAY,IAAI,YAAY,CAAC,UAAU,EAAE,CAAC;QACnD,MAAM,QAAQ,GAAG,YAAY,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;QAEvD,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,GAAI,QAAoC,CAAC;QAEpE,MAAM,WAAW,GAAG,CAAC,IAAA,oBAAW,EAAC,WAAW,CAAC,CAAC;QAE9C,IAAI,W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;QAED,MAAM,cAAc,GAAI,KAA8B,CAAC,UAAU,CAAC;QAElE,IAAI,cAAc,EAAE,CAAC;YACnB,MAAM,UAAU,GAAG,IAAI,gBAAM,CAAC,cAAc,EAAE,GAAG,YAAY,CAAC,EAAE,IAAI,YAAY,mBAAmB,CAAC,CAAC;YACrG,MAAM,gBAAgB,GAAG,eAAe,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;YAEjE,YAAY,GAAG;gBACb,GAAG,YAAY;gBACf,GAAG,gBAAgB;aACpB,CAAC;YAEF,SAAS;QACX,CAAC;IACH,CAAC;IAED,OAAO,IAAA,aAAI,EAAC,YAAY,CAAC,CAAC;AAC5B,CAAC,CAAC;AAEF,kBAAe,eAAe,CAAC"}
@@ -1,60 +1,4 @@
1
- /**
2
- * Safe required property access: returns a value at `path` or throws if it is `undefined`.
3
- *
4
- * **Intent:** Provide strict, fail-fast access to nested object properties. Unlike `lodash/get`,
5
- * which returns `undefined` for missing keys, `got` treats missing data as an error and throws
6
- * with a clear message including the path. Use it when the property is required and absence
7
- * indicates a bug or invalid input.
8
- *
9
- * **Use cases:**
10
- * - **Schema / config lookups:** Fetching a schema or config by ID from a map where absence
11
- * means invalid reference (e.g. `got(schemasMap, schemaId, 'Schema "$PATH" not found')`).
12
- * - **Validated config access:** Reading required config or options after validation, when
13
- * you want to avoid `undefined` checks downstream.
14
- * - **Strict data traversal:** Walking nested structures (APIs, parsed JSON) where missing
15
- * keys should fail immediately with a descriptive error instead of propagating `undefined`.
16
- *
17
- * **Behavior:** Only `undefined` triggers an error. Falsy but defined values (`null`, `0`,
18
- * `false`, `''`, `[]`, `{}`) are returned as-is. Uses lodash `get` path syntax: dot notation
19
- * (`a.b.c`), bracket notation (`items[0]`), or mixed (`data.items[0].id`).
20
- *
21
- * @param object - Root object to read from.
22
- * @param path - Lodash-style path (e.g. `'user.profile.name'`, `'items[0].id'`).
23
- * @param errorTemplate - Error message template; `$PATH` is replaced with `path`. Default:
24
- * `'Value is undefined for "$PATH"'`.
25
- * @returns The value at `path`.
26
- * @throws {Error} When the value at `path` is `undefined`.
27
- *
28
- * @example
29
- * // Simple property
30
- * got({ name: 'Jane' }, 'name');
31
- * // => 'Jane'
32
- *
33
- * @example
34
- * // Nested path
35
- * got({ user: { profile: { role: 'admin' } } }, 'user.profile.role');
36
- * // => 'admin'
37
- *
38
- * @example
39
- * // Array index
40
- * got({ items: ['a', 'b'] }, 'items[0]');
41
- * // => 'a'
42
- *
43
- * @example
44
- * // Falsy but defined values are returned
45
- * got({ count: 0, enabled: false }, 'count');
46
- * // => 0
47
- *
48
- * @example
49
- * // Custom error for schema lookups
50
- * got(schemasMap, schemaId, 'Schema "$PATH" not found');
51
- * // => schema for schemaId, or throws with that message
52
- *
53
- * @example
54
- * // Missing property throws
55
- * got({ name: 'Jane' }, 'age');
56
- * // throws Error('Value is undefined for "age"')
57
- */
1
+ /** Safe required property access: returns a value at `path` or throws if it is `undefined`. */
58
2
  declare function got<T>(object: T, path: string, errorTemplate?: string): T[keyof T];
59
3
  export default got;
60
4
  //# sourceMappingURL=got.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"got.d.ts","sourceRoot":"","sources":["../../src/helpers/got.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,iBAAS,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,GAAE,MAA+B,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CASnG;AAED,eAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"got.d.ts","sourceRoot":"","sources":["../../src/helpers/got.ts"],"names":[],"mappings":"AAIA,+FAA+F;AAC/F,iBAAS,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,GAAE,MAA+B,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CASnG;AAED,eAAe,GAAG,CAAC"}
@@ -2,63 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const lodash_1 = require("lodash");
4
4
  const DEFAULT_ERROR_TEMPLATE = 'Value is undefined for "$PATH"';
5
- /**
6
- * Safe required property access: returns a value at `path` or throws if it is `undefined`.
7
- *
8
- * **Intent:** Provide strict, fail-fast access to nested object properties. Unlike `lodash/get`,
9
- * which returns `undefined` for missing keys, `got` treats missing data as an error and throws
10
- * with a clear message including the path. Use it when the property is required and absence
11
- * indicates a bug or invalid input.
12
- *
13
- * **Use cases:**
14
- * - **Schema / config lookups:** Fetching a schema or config by ID from a map where absence
15
- * means invalid reference (e.g. `got(schemasMap, schemaId, 'Schema "$PATH" not found')`).
16
- * - **Validated config access:** Reading required config or options after validation, when
17
- * you want to avoid `undefined` checks downstream.
18
- * - **Strict data traversal:** Walking nested structures (APIs, parsed JSON) where missing
19
- * keys should fail immediately with a descriptive error instead of propagating `undefined`.
20
- *
21
- * **Behavior:** Only `undefined` triggers an error. Falsy but defined values (`null`, `0`,
22
- * `false`, `''`, `[]`, `{}`) are returned as-is. Uses lodash `get` path syntax: dot notation
23
- * (`a.b.c`), bracket notation (`items[0]`), or mixed (`data.items[0].id`).
24
- *
25
- * @param object - Root object to read from.
26
- * @param path - Lodash-style path (e.g. `'user.profile.name'`, `'items[0].id'`).
27
- * @param errorTemplate - Error message template; `$PATH` is replaced with `path`. Default:
28
- * `'Value is undefined for "$PATH"'`.
29
- * @returns The value at `path`.
30
- * @throws {Error} When the value at `path` is `undefined`.
31
- *
32
- * @example
33
- * // Simple property
34
- * got({ name: 'Jane' }, 'name');
35
- * // => 'Jane'
36
- *
37
- * @example
38
- * // Nested path
39
- * got({ user: { profile: { role: 'admin' } } }, 'user.profile.role');
40
- * // => 'admin'
41
- *
42
- * @example
43
- * // Array index
44
- * got({ items: ['a', 'b'] }, 'items[0]');
45
- * // => 'a'
46
- *
47
- * @example
48
- * // Falsy but defined values are returned
49
- * got({ count: 0, enabled: false }, 'count');
50
- * // => 0
51
- *
52
- * @example
53
- * // Custom error for schema lookups
54
- * got(schemasMap, schemaId, 'Schema "$PATH" not found');
55
- * // => schema for schemaId, or throws with that message
56
- *
57
- * @example
58
- * // Missing property throws
59
- * got({ name: 'Jane' }, 'age');
60
- * // throws Error('Value is undefined for "age"')
61
- */
5
+ /** Safe required property access: returns a value at `path` or throws if it is `undefined`. */
62
6
  function got(object, path, errorTemplate = DEFAULT_ERROR_TEMPLATE) {
63
7
  const value = (0, lodash_1.get)(object, path);
64
8
  const shouldThrow = (0, lodash_1.isUndefined)(value);
@@ -1 +1 @@
1
- {"version":3,"file":"got.js","sourceRoot":"","sources":["../../src/helpers/got.ts"],"names":[],"mappings":";;AAAA,mCAA0C;AAE1C,MAAM,sBAAsB,GAAG,gCAAgC,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,SAAS,GAAG,CAAI,MAAS,EAAE,IAAY,EAAE,gBAAwB,sBAAsB;IACrF,MAAM,KAAK,GAAG,IAAA,YAAG,EAAC,MAAM,EAAE,IAAI,CAAe,CAAC;IAC9C,MAAM,WAAW,GAAG,IAAA,oBAAW,EAAC,KAAK,CAAC,CAAC;IAEvC,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;AACpD,CAAC;AAAA,CAAC;AAEF,kBAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"got.js","sourceRoot":"","sources":["../../src/helpers/got.ts"],"names":[],"mappings":";;AAAA,mCAA0C;AAE1C,MAAM,sBAAsB,GAAG,gCAAgC,CAAC;AAEhE,+FAA+F;AAC/F,SAAS,GAAG,CAAI,MAAS,EAAE,IAAY,EAAE,gBAAwB,sBAAsB;IACrF,MAAM,KAAK,GAAG,IAAA,YAAG,EAAC,MAAM,EAAE,IAAI,CAAe,CAAC;IAC9C,MAAM,WAAW,GAAG,IAAA,oBAAW,EAAC,KAAK,CAAC,CAAC;IAEvC,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;AACpD,CAAC;AAAA,CAAC;AAEF,kBAAe,GAAG,CAAC"}
@@ -1,150 +1,8 @@
1
- import type { JsonSchema, TargetObject, PropertySchema, JsonSchemasMap } from './JsonSchema';
1
+ import { type JsonSchema } from 'z-schema';
2
2
  /**
3
3
  * Recursively traverses an object's properties based on a JSON schema and applies a callback
4
4
  * function to each property. Handles nested objects, arrays, and schema references ($ref).
5
- *
6
- * **Intent:**
7
- * This function provides a generic way to iterate over object properties in a schema-aware manner,
8
- * enabling operations like normalization, validation, transformation, or cleanup to be applied
9
- * consistently across complex nested data structures. It abstracts away the complexity of
10
- * traversing nested objects, arrays, and schema references, allowing callers to focus on
11
- * implementing their specific property-level logic.
12
- *
13
- * **Use Cases:**
14
- * - **Normalization**: Apply type conversions or default values to properties based on schema definitions
15
- * (see `normalizeAttributes.ts` for example)
16
- * - **Validation**: Check property values against schema constraints
17
- * - **Transformation**: Modify or transform property values based on schema metadata
18
- * - **Cleanup**: Remove invalid properties or sanitize data structures
19
- * - **Data Processing**: Extract, aggregate, or analyze properties across nested structures
20
- * - **Schema-driven Operations**: Any operation that needs to process object properties according
21
- * to their schema definitions
22
- *
23
- * **Behavior:**
24
- * - Skips enum schemas (returns immediately without calling callback)
25
- * - Calls callback for all properties defined in the schema, even if their values are null
26
- * - Skips recursion into undefined values (callback is still called, but nested traversal stops)
27
- * - Recursively processes nested objects by creating nested schema contexts
28
- * - Recursively processes array items, handling both inline object schemas and references
29
- * - Resolves schema references ($ref) using the provided schemasMap
30
- *
31
- * **Examples:**
32
- *
33
- * @example
34
- * // Example 1: Normalize property values based on schema types
35
- * const schema = new Schema({
36
- * name: { type: 'string' },
37
- * age: { type: 'number' },
38
- * active: { type: 'boolean' }
39
- * }, 'user-schema');
40
- *
41
- * const user = {
42
- * name: 'John',
43
- * age: '30', // string that should be number
44
- * active: 'true' // string that should be boolean
45
- * };
46
- *
47
- * mapObjectProperties(user, schema.jsonSchema, {}, (propName, propSchema, obj) => {
48
- * if (propSchema.type === 'number') {
49
- * obj[propName] = Number(obj[propName]);
50
- * } else if (propSchema.type === 'boolean') {
51
- * obj[propName] = obj[propName] === 'true' || obj[propName] === true;
52
- * }
53
- * });
54
- * // Result: { name: 'John', age: 30, active: true }
55
- *
56
- * @example
57
- * // Example 2: Process nested objects
58
- * const schema = new Schema({
59
- * profile: {
60
- * type: 'object',
61
- * properties: {
62
- * firstName: { type: 'string' },
63
- * lastName: { type: 'string' }
64
- * }
65
- * }
66
- * }, 'user-schema');
67
- *
68
- * const user = {
69
- * profile: {
70
- * firstName: 'John',
71
- * lastName: 'Doe'
72
- * }
73
- * };
74
- *
75
- * const processedProps: string[] = [];
76
- * mapObjectProperties(user, schema.jsonSchema, {}, (propName) => {
77
- * processedProps.push(propName);
78
- * });
79
- * // processedProps: ['profile', 'firstName', 'lastName']
80
- *
81
- * @example
82
- * // Example 3: Handle schema references ($ref)
83
- * const addressSchema = new Schema({
84
- * street: { type: 'string' },
85
- * city: { type: 'string' }
86
- * }, 'address-schema');
87
- *
88
- * const userSchema = new Schema({
89
- * name: { type: 'string' },
90
- * address: { $ref: 'address-schema' }
91
- * }, 'user-schema');
92
- *
93
- * const user = {
94
- * name: 'John',
95
- * address: {
96
- * street: '123 Main St',
97
- * city: 'New York'
98
- * }
99
- * };
100
- *
101
- * const schemasMap = {
102
- * 'address-schema': addressSchema.jsonSchema
103
- * };
104
- *
105
- * mapObjectProperties(user, userSchema.jsonSchema, schemasMap, (propName) => {
106
- * console.log(`Processing: ${propName}`);
107
- * });
108
- * // Output:
109
- * // Processing: name
110
- * // Processing: address
111
- * // Processing: street
112
- * // Processing: city
113
- *
114
- * @example
115
- * // Example 4: Process arrays with object items
116
- * const schema = new Schema({
117
- * tags: {
118
- * type: 'array',
119
- * items: {
120
- * type: 'object',
121
- * properties: {
122
- * name: { type: 'string' },
123
- * value: { type: 'string' }
124
- * }
125
- * }
126
- * }
127
- * }, 'item-schema');
128
- *
129
- * const item = {
130
- * tags: [
131
- * { name: 'tag1', value: 'value1' },
132
- * { name: 'tag2', value: 'value2' }
133
- * ]
134
- * };
135
- *
136
- * mapObjectProperties(item, schema.jsonSchema, {}, (propName, propSchema, obj) => {
137
- * if (propSchema.type === 'string') {
138
- * obj[propName] = String(obj[propName]).toUpperCase();
139
- * }
140
- * });
141
- * // Result: tags array items have uppercase name and value properties
142
- *
143
- * @param object - The target object to traverse
144
- * @param jsonSchema - The JSON schema defining the object structure
145
- * @param schemasMap - Map of schema IDs to schema objects for resolving $ref references
146
- * @param callback - Function called for each property with (propertyName, propertySchema, object)
147
5
  */
148
- declare const mapObjectProperties: (object: TargetObject, jsonSchema: JsonSchema, schemasMap: JsonSchemasMap, callback: (propertyName: string, propertySchema: PropertySchema, object: TargetObject) => void) => void;
6
+ declare const mapObjectProperties: (object: TargetObject, jsonSchema: JsonSchema, schemasMap: Record<string, JsonSchema>, callback: (propertyName: string, propertySchema: PropertySchema, object: TargetObject) => void) => void;
149
7
  export default mapObjectProperties;
150
8
  //# sourceMappingURL=mapObjectProperties.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mapObjectProperties.d.ts","sourceRoot":"","sources":["../../src/helpers/mapObjectProperties.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,UAAU,EAGV,YAAY,EACZ,cAAc,EACd,cAAc,EAIf,MAAM,cAAc,CAAC;AAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiJG;AACH,QAAA,MAAM,mBAAmB,GACvB,QAAQ,YAAY,EACpB,YAAY,UAAU,EACtB,YAAY,cAAc,EAC1B,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,KAAK,IAAI,SAwG/F,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"mapObjectProperties.d.ts","sourceRoot":"","sources":["../../src/helpers/mapObjectProperties.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAI3C;;;GAGG;AACH,QAAA,MAAM,mBAAmB,GACvB,QAAQ,YAAY,EACpB,YAAY,UAAU,EACtB,YAAY,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EACtC,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,KAAK,IAAI,SAwG/F,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -8,148 +8,6 @@ const got_1 = __importDefault(require("./got"));
8
8
  /**
9
9
  * Recursively traverses an object's properties based on a JSON schema and applies a callback
10
10
  * function to each property. Handles nested objects, arrays, and schema references ($ref).
11
- *
12
- * **Intent:**
13
- * This function provides a generic way to iterate over object properties in a schema-aware manner,
14
- * enabling operations like normalization, validation, transformation, or cleanup to be applied
15
- * consistently across complex nested data structures. It abstracts away the complexity of
16
- * traversing nested objects, arrays, and schema references, allowing callers to focus on
17
- * implementing their specific property-level logic.
18
- *
19
- * **Use Cases:**
20
- * - **Normalization**: Apply type conversions or default values to properties based on schema definitions
21
- * (see `normalizeAttributes.ts` for example)
22
- * - **Validation**: Check property values against schema constraints
23
- * - **Transformation**: Modify or transform property values based on schema metadata
24
- * - **Cleanup**: Remove invalid properties or sanitize data structures
25
- * - **Data Processing**: Extract, aggregate, or analyze properties across nested structures
26
- * - **Schema-driven Operations**: Any operation that needs to process object properties according
27
- * to their schema definitions
28
- *
29
- * **Behavior:**
30
- * - Skips enum schemas (returns immediately without calling callback)
31
- * - Calls callback for all properties defined in the schema, even if their values are null
32
- * - Skips recursion into undefined values (callback is still called, but nested traversal stops)
33
- * - Recursively processes nested objects by creating nested schema contexts
34
- * - Recursively processes array items, handling both inline object schemas and references
35
- * - Resolves schema references ($ref) using the provided schemasMap
36
- *
37
- * **Examples:**
38
- *
39
- * @example
40
- * // Example 1: Normalize property values based on schema types
41
- * const schema = new Schema({
42
- * name: { type: 'string' },
43
- * age: { type: 'number' },
44
- * active: { type: 'boolean' }
45
- * }, 'user-schema');
46
- *
47
- * const user = {
48
- * name: 'John',
49
- * age: '30', // string that should be number
50
- * active: 'true' // string that should be boolean
51
- * };
52
- *
53
- * mapObjectProperties(user, schema.jsonSchema, {}, (propName, propSchema, obj) => {
54
- * if (propSchema.type === 'number') {
55
- * obj[propName] = Number(obj[propName]);
56
- * } else if (propSchema.type === 'boolean') {
57
- * obj[propName] = obj[propName] === 'true' || obj[propName] === true;
58
- * }
59
- * });
60
- * // Result: { name: 'John', age: 30, active: true }
61
- *
62
- * @example
63
- * // Example 2: Process nested objects
64
- * const schema = new Schema({
65
- * profile: {
66
- * type: 'object',
67
- * properties: {
68
- * firstName: { type: 'string' },
69
- * lastName: { type: 'string' }
70
- * }
71
- * }
72
- * }, 'user-schema');
73
- *
74
- * const user = {
75
- * profile: {
76
- * firstName: 'John',
77
- * lastName: 'Doe'
78
- * }
79
- * };
80
- *
81
- * const processedProps: string[] = [];
82
- * mapObjectProperties(user, schema.jsonSchema, {}, (propName) => {
83
- * processedProps.push(propName);
84
- * });
85
- * // processedProps: ['profile', 'firstName', 'lastName']
86
- *
87
- * @example
88
- * // Example 3: Handle schema references ($ref)
89
- * const addressSchema = new Schema({
90
- * street: { type: 'string' },
91
- * city: { type: 'string' }
92
- * }, 'address-schema');
93
- *
94
- * const userSchema = new Schema({
95
- * name: { type: 'string' },
96
- * address: { $ref: 'address-schema' }
97
- * }, 'user-schema');
98
- *
99
- * const user = {
100
- * name: 'John',
101
- * address: {
102
- * street: '123 Main St',
103
- * city: 'New York'
104
- * }
105
- * };
106
- *
107
- * const schemasMap = {
108
- * 'address-schema': addressSchema.jsonSchema
109
- * };
110
- *
111
- * mapObjectProperties(user, userSchema.jsonSchema, schemasMap, (propName) => {
112
- * console.log(`Processing: ${propName}`);
113
- * });
114
- * // Output:
115
- * // Processing: name
116
- * // Processing: address
117
- * // Processing: street
118
- * // Processing: city
119
- *
120
- * @example
121
- * // Example 4: Process arrays with object items
122
- * const schema = new Schema({
123
- * tags: {
124
- * type: 'array',
125
- * items: {
126
- * type: 'object',
127
- * properties: {
128
- * name: { type: 'string' },
129
- * value: { type: 'string' }
130
- * }
131
- * }
132
- * }
133
- * }, 'item-schema');
134
- *
135
- * const item = {
136
- * tags: [
137
- * { name: 'tag1', value: 'value1' },
138
- * { name: 'tag2', value: 'value2' }
139
- * ]
140
- * };
141
- *
142
- * mapObjectProperties(item, schema.jsonSchema, {}, (propName, propSchema, obj) => {
143
- * if (propSchema.type === 'string') {
144
- * obj[propName] = String(obj[propName]).toUpperCase();
145
- * }
146
- * });
147
- * // Result: tags array items have uppercase name and value properties
148
- *
149
- * @param object - The target object to traverse
150
- * @param jsonSchema - The JSON schema defining the object structure
151
- * @param schemasMap - Map of schema IDs to schema objects for resolving $ref references
152
- * @param callback - Function called for each property with (propertyName, propertySchema, object)
153
11
  */
154
12
  const mapObjectProperties = (object, jsonSchema, schemasMap, callback) => {
155
13
  const { enum: enumItems } = jsonSchema;
@@ -214,6 +72,7 @@ const mapObjectProperties = (object, jsonSchema, schemasMap, callback) => {
214
72
  id: `${objectSchema.id}.${propertyName}.items.properties`,
215
73
  properties: itemObjectProperties
216
74
  };
75
+ ;
217
76
  for (const valueItem of value) {
218
77
  const isObjectItem = valueItem && typeof valueItem === 'object' && !Array.isArray(valueItem);
219
78
  // Only recursively process if the item is an object (not null, undefined, or primitive)
@@ -1 +1 @@
1
- {"version":3,"file":"mapObjectProperties.js","sourceRoot":"","sources":["../../src/helpers/mapObjectProperties.ts"],"names":[],"mappings":";;;;;AAAA,mCAAqC;AAErC,gDAAwB;AAaxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiJG;AACH,MAAM,mBAAmB,GAAG,CAC1B,MAAoB,EACpB,UAAsB,EACtB,UAA0B,EAC1B,QAA8F,EAC9F,EAAE;IACF,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,UAAwB,CAAC;IAErD,MAAM,MAAM,GAAG,CAAC,CAAC,SAAS,CAAC;IAE3B,IAAI,MAAM,EAAE,CAAC;QACX,OAAO;IACT,CAAC;IAED,MAAM,YAAY,GAAG,UAA0B,CAAC;IAEhD,MAAM,aAAa,GAAG,CAAC,CAAC,YAAY,CAAC,UAAU,CAAC;IAEhD,qDAAqD;IACrD,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO;IACT,CAAC;IAED,MAAM,EAAE,UAAU,EAAE,gBAAgB,EAAE,GAAG,YAAY,CAAC;IAEtD,KAAK,MAAM,YAAY,IAAI,gBAAgB,EAAE,CAAC;QAC5C,MAAM,QAAQ,GAAG,gBAAgB,CAAC,YAAY,CAAC,CAAC;QAEhD,QAAQ,CAAC,YAAY,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QAEzC,MAAM,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;QACnC,MAAM,gBAAgB,GAAG,IAAA,oBAAW,EAAC,KAAK,CAAC,CAAC;QAE5C,IAAI,gBAAgB,EAAE,CAAC;YACrB,SAAS;QACX,CAAC;QAED,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,QAAmC,CAAC;QA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