@aeriajs/core 0.0.203 → 0.0.205
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/collection/preload.js +1 -6
- package/dist/collection/preload.mjs +1 -6
- package/dist/collection/reference.js +10 -21
- package/dist/collection/reference.mjs +10 -19
- package/dist/collection/traverseDocument.js +35 -68
- package/dist/collection/traverseDocument.mjs +33 -66
- package/dist/functions/getAll.mjs +1 -1
- package/package.json +8 -8
|
@@ -101,14 +101,9 @@ const preloadDescription = async (originalDescription, options) => {
|
|
|
101
101
|
Object.assign(description, merge);
|
|
102
102
|
}
|
|
103
103
|
if (description.properties) {
|
|
104
|
-
const properties = [];
|
|
105
104
|
for (const [propName, property] of Object.entries(description.properties)) {
|
|
106
|
-
properties
|
|
107
|
-
propName,
|
|
108
|
-
await recurseProperty(property, propName, description),
|
|
109
|
-
]);
|
|
105
|
+
description.properties[propName] = await recurseProperty(property, propName, description);
|
|
110
106
|
}
|
|
111
|
-
description.properties = Object.fromEntries(properties);
|
|
112
107
|
}
|
|
113
108
|
if (memoize) {
|
|
114
109
|
preloadMemo[originalDescription.$id] = description;
|
|
@@ -77,14 +77,9 @@ export const preloadDescription = async (originalDescription, options) => {
|
|
|
77
77
|
Object.assign(description, merge);
|
|
78
78
|
}
|
|
79
79
|
if (description.properties) {
|
|
80
|
-
const properties = [];
|
|
81
80
|
for (const [propName, property] of Object.entries(description.properties)) {
|
|
82
|
-
properties
|
|
83
|
-
propName,
|
|
84
|
-
await recurseProperty(property, propName, description)
|
|
85
|
-
]);
|
|
81
|
+
description.properties[propName] = await recurseProperty(property, propName, description);
|
|
86
82
|
}
|
|
87
|
-
description.properties = Object.fromEntries(properties);
|
|
88
83
|
}
|
|
89
84
|
if (memoize) {
|
|
90
85
|
preloadMemo[originalDescription.$id] = description;
|
|
@@ -41,9 +41,7 @@ const getReferences = async (properties, options = {}) => {
|
|
|
41
41
|
reference.deepReferences = deepReferences;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
const indexes =
|
|
45
|
-
? refProperty.indexes
|
|
46
|
-
: description.indexes || [];
|
|
44
|
+
const { indexes = description.indexes || [] } = refProperty;
|
|
47
45
|
reference.populate = (refProperty.populate || []).concat(indexes.filter((index) => typeof index === 'string'));
|
|
48
46
|
}
|
|
49
47
|
else {
|
|
@@ -199,7 +197,7 @@ const recurseSetStage = (reference, path, parentElem, options = {
|
|
|
199
197
|
};
|
|
200
198
|
}
|
|
201
199
|
if (reference.deepReferences) {
|
|
202
|
-
const stages =
|
|
200
|
+
const stages = {};
|
|
203
201
|
for (const [subRefName, subReference] of Object.entries(reference.deepReferences)) {
|
|
204
202
|
let newElem;
|
|
205
203
|
if (shouldUseArrayIndex) {
|
|
@@ -231,10 +229,7 @@ const recurseSetStage = (reference, path, parentElem, options = {
|
|
|
231
229
|
'referencedCollection' in subReference,
|
|
232
230
|
],
|
|
233
231
|
]), newElem);
|
|
234
|
-
stages
|
|
235
|
-
subRefName,
|
|
236
|
-
result,
|
|
237
|
-
]);
|
|
232
|
+
stages[subRefName] = result;
|
|
238
233
|
}
|
|
239
234
|
if (reference.referencedCollection) {
|
|
240
235
|
return {
|
|
@@ -253,14 +248,14 @@ const recurseSetStage = (reference, path, parentElem, options = {
|
|
|
253
248
|
}, path, parentElem, {
|
|
254
249
|
noCond: true,
|
|
255
250
|
}),
|
|
256
|
-
|
|
251
|
+
stages,
|
|
257
252
|
],
|
|
258
253
|
},
|
|
259
254
|
null,
|
|
260
255
|
],
|
|
261
256
|
};
|
|
262
257
|
}
|
|
263
|
-
return
|
|
258
|
+
return stages;
|
|
264
259
|
}
|
|
265
260
|
const arrayElemAt = {
|
|
266
261
|
$arrayElemAt: [
|
|
@@ -296,7 +291,7 @@ const buildLookupPipeline = (refMap, options = {}) => {
|
|
|
296
291
|
}
|
|
297
292
|
}
|
|
298
293
|
const pipeline = [];
|
|
299
|
-
const setProperties =
|
|
294
|
+
const setProperties = {};
|
|
300
295
|
for (const [refName, reference] of Object.entries(refMap)) {
|
|
301
296
|
if (project) {
|
|
302
297
|
if (!project.includes(refName)) {
|
|
@@ -316,10 +311,7 @@ const buildLookupPipeline = (refMap, options = {}) => {
|
|
|
316
311
|
path: newPath,
|
|
317
312
|
});
|
|
318
313
|
const result = (0, exports.recurseSetStage)(reference, newPath, `$${refName}`);
|
|
319
|
-
setProperties
|
|
320
|
-
refName,
|
|
321
|
-
result,
|
|
322
|
-
]);
|
|
314
|
+
setProperties[refName] = result;
|
|
323
315
|
}
|
|
324
316
|
if (reference.referencedCollection) {
|
|
325
317
|
const tempName = getTempName(newPath);
|
|
@@ -354,17 +346,14 @@ const buildLookupPipeline = (refMap, options = {}) => {
|
|
|
354
346
|
});
|
|
355
347
|
if (!reference.deepReferences) {
|
|
356
348
|
const result = (0, exports.recurseSetStage)(reference, newPath, `$${refName}`);
|
|
357
|
-
setProperties
|
|
358
|
-
refName,
|
|
359
|
-
result,
|
|
360
|
-
]);
|
|
349
|
+
setProperties[refName] = result;
|
|
361
350
|
}
|
|
362
351
|
}
|
|
363
352
|
}
|
|
364
353
|
if (path.length === 0) {
|
|
365
|
-
if (setProperties.length > 0) {
|
|
354
|
+
if (Object.keys(setProperties).length > 0) {
|
|
366
355
|
pipeline.push({
|
|
367
|
-
$set:
|
|
356
|
+
$set: setProperties,
|
|
368
357
|
});
|
|
369
358
|
}
|
|
370
359
|
if (tempNames.length > 0) {
|
|
@@ -43,7 +43,7 @@ export const getReferences = async (properties, options = {}) => {
|
|
|
43
43
|
reference.deepReferences = deepReferences;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
const indexes =
|
|
46
|
+
const { indexes = description.indexes || [] } = refProperty;
|
|
47
47
|
reference.populate = (refProperty.populate || []).concat(indexes.filter((index) => typeof index === "string"));
|
|
48
48
|
} else {
|
|
49
49
|
const entrypoint = "items" in property ? property.items : property;
|
|
@@ -186,7 +186,7 @@ export const recurseSetStage = (reference, path, parentElem, options = {
|
|
|
186
186
|
};
|
|
187
187
|
}
|
|
188
188
|
if (reference.deepReferences) {
|
|
189
|
-
const stages =
|
|
189
|
+
const stages = {};
|
|
190
190
|
for (const [subRefName, subReference] of Object.entries(reference.deepReferences)) {
|
|
191
191
|
let newElem;
|
|
192
192
|
if (shouldUseArrayIndex) {
|
|
@@ -214,10 +214,7 @@ export const recurseSetStage = (reference, path, parentElem, options = {
|
|
|
214
214
|
"referencedCollection" in subReference
|
|
215
215
|
]
|
|
216
216
|
]), newElem);
|
|
217
|
-
stages
|
|
218
|
-
subRefName,
|
|
219
|
-
result
|
|
220
|
-
]);
|
|
217
|
+
stages[subRefName] = result;
|
|
221
218
|
}
|
|
222
219
|
if (reference.referencedCollection) {
|
|
223
220
|
return {
|
|
@@ -236,14 +233,14 @@ export const recurseSetStage = (reference, path, parentElem, options = {
|
|
|
236
233
|
}, path, parentElem, {
|
|
237
234
|
noCond: true
|
|
238
235
|
}),
|
|
239
|
-
|
|
236
|
+
stages
|
|
240
237
|
]
|
|
241
238
|
},
|
|
242
239
|
null
|
|
243
240
|
]
|
|
244
241
|
};
|
|
245
242
|
}
|
|
246
|
-
return
|
|
243
|
+
return stages;
|
|
247
244
|
}
|
|
248
245
|
const arrayElemAt = {
|
|
249
246
|
$arrayElemAt: [
|
|
@@ -282,7 +279,7 @@ export const buildLookupPipeline = (refMap, options = {}) => {
|
|
|
282
279
|
}
|
|
283
280
|
}
|
|
284
281
|
const pipeline = [];
|
|
285
|
-
const setProperties =
|
|
282
|
+
const setProperties = {};
|
|
286
283
|
for (const [refName, reference] of Object.entries(refMap)) {
|
|
287
284
|
if (project) {
|
|
288
285
|
if (!project.includes(refName)) {
|
|
@@ -302,10 +299,7 @@ export const buildLookupPipeline = (refMap, options = {}) => {
|
|
|
302
299
|
path: newPath
|
|
303
300
|
});
|
|
304
301
|
const result = recurseSetStage(reference, newPath, `$${refName}`);
|
|
305
|
-
setProperties
|
|
306
|
-
refName,
|
|
307
|
-
result
|
|
308
|
-
]);
|
|
302
|
+
setProperties[refName] = result;
|
|
309
303
|
}
|
|
310
304
|
if (reference.referencedCollection) {
|
|
311
305
|
const tempName = getTempName(newPath);
|
|
@@ -337,17 +331,14 @@ export const buildLookupPipeline = (refMap, options = {}) => {
|
|
|
337
331
|
});
|
|
338
332
|
if (!reference.deepReferences) {
|
|
339
333
|
const result = recurseSetStage(reference, newPath, `$${refName}`);
|
|
340
|
-
setProperties
|
|
341
|
-
refName,
|
|
342
|
-
result
|
|
343
|
-
]);
|
|
334
|
+
setProperties[refName] = result;
|
|
344
335
|
}
|
|
345
336
|
}
|
|
346
337
|
}
|
|
347
338
|
if (path.length === 0) {
|
|
348
|
-
if (setProperties.length > 0) {
|
|
339
|
+
if (Object.keys(setProperties).length > 0) {
|
|
349
340
|
pipeline.push({
|
|
350
|
-
$set:
|
|
341
|
+
$set: setProperties
|
|
351
342
|
});
|
|
352
343
|
}
|
|
353
344
|
if (tempNames.length > 0) {
|
|
@@ -139,7 +139,7 @@ const autoCast = (value, ctx) => {
|
|
|
139
139
|
return value.map((v) => autoCast(v, ctx));
|
|
140
140
|
}
|
|
141
141
|
if (Object.keys(value).length > 0) {
|
|
142
|
-
const entries =
|
|
142
|
+
const entries = {};
|
|
143
143
|
for (const [k, v] of Object.entries(value)) {
|
|
144
144
|
const subProperty = !k.startsWith('$')
|
|
145
145
|
? getProperty(k, ctx.property)
|
|
@@ -147,15 +147,12 @@ const autoCast = (value, ctx) => {
|
|
|
147
147
|
if (!subProperty) {
|
|
148
148
|
continue;
|
|
149
149
|
}
|
|
150
|
-
entries
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
property: subProperty,
|
|
155
|
-
}),
|
|
156
|
-
]);
|
|
150
|
+
entries[k] = autoCast(v, {
|
|
151
|
+
...ctx,
|
|
152
|
+
property: subProperty,
|
|
153
|
+
});
|
|
157
154
|
}
|
|
158
|
-
return
|
|
155
|
+
return entries;
|
|
159
156
|
}
|
|
160
157
|
}
|
|
161
158
|
}
|
|
@@ -266,7 +263,7 @@ const recurseDeep = async (value, ctx) => {
|
|
|
266
263
|
return value;
|
|
267
264
|
};
|
|
268
265
|
const recurse = async (target, ctx) => {
|
|
269
|
-
const entries =
|
|
266
|
+
const entries = {};
|
|
270
267
|
const entrypoint = ctx.options.fromProperties && 'properties' in ctx.property
|
|
271
268
|
? {
|
|
272
269
|
_id: null,
|
|
@@ -279,33 +276,24 @@ const recurse = async (target, ctx) => {
|
|
|
279
276
|
if (propName === '_id') {
|
|
280
277
|
if (value) {
|
|
281
278
|
if (ctx.options.autoCast) {
|
|
282
|
-
entries
|
|
279
|
+
entries[propName] = autoCast(value, {
|
|
280
|
+
...ctx,
|
|
281
|
+
target,
|
|
283
282
|
propName,
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
property: {
|
|
289
|
-
$ref: '',
|
|
290
|
-
},
|
|
291
|
-
}),
|
|
292
|
-
]);
|
|
283
|
+
property: {
|
|
284
|
+
$ref: '',
|
|
285
|
+
},
|
|
286
|
+
});
|
|
293
287
|
}
|
|
294
288
|
else {
|
|
295
|
-
entries
|
|
296
|
-
propName,
|
|
297
|
-
value,
|
|
298
|
-
]);
|
|
289
|
+
entries[propName] = value;
|
|
299
290
|
}
|
|
300
291
|
}
|
|
301
292
|
continue;
|
|
302
293
|
}
|
|
303
294
|
if (ctx.options.undefinedToNull) {
|
|
304
295
|
if (value === undefined) {
|
|
305
|
-
entries
|
|
306
|
-
propName,
|
|
307
|
-
null,
|
|
308
|
-
]);
|
|
296
|
+
entries[propName] = null;
|
|
309
297
|
continue;
|
|
310
298
|
}
|
|
311
299
|
}
|
|
@@ -317,13 +305,10 @@ const recurse = async (target, ctx) => {
|
|
|
317
305
|
}
|
|
318
306
|
if (key === '$regex' && typeof value[key] === 'string') {
|
|
319
307
|
if (!ctx.options.noRegExpEscaping) {
|
|
320
|
-
entries
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
$regex: escapeRegExp(value[key]),
|
|
325
|
-
},
|
|
326
|
-
]);
|
|
308
|
+
entries[propName] = {
|
|
309
|
+
...value,
|
|
310
|
+
$regex: escapeRegExp(value[key]),
|
|
311
|
+
};
|
|
327
312
|
continue entrypoint;
|
|
328
313
|
}
|
|
329
314
|
}
|
|
@@ -341,26 +326,17 @@ const recurse = async (target, ctx) => {
|
|
|
341
326
|
}
|
|
342
327
|
operations.push(result);
|
|
343
328
|
}
|
|
344
|
-
entries
|
|
345
|
-
propName,
|
|
346
|
-
operations,
|
|
347
|
-
]);
|
|
329
|
+
entries[propName] = operations;
|
|
348
330
|
continue;
|
|
349
331
|
}
|
|
350
332
|
const { error, result: operator } = await recurse(value, ctx);
|
|
351
333
|
if (error) {
|
|
352
334
|
return types_1.Result.error(error);
|
|
353
335
|
}
|
|
354
|
-
entries
|
|
355
|
-
propName,
|
|
356
|
-
operator,
|
|
357
|
-
]);
|
|
336
|
+
entries[propName] = operator;
|
|
358
337
|
continue;
|
|
359
338
|
}
|
|
360
|
-
entries
|
|
361
|
-
propName,
|
|
362
|
-
value,
|
|
363
|
-
]);
|
|
339
|
+
entries[propName] = value;
|
|
364
340
|
}
|
|
365
341
|
else {
|
|
366
342
|
if (!ctx.options.preserveHidden && property.hidden) {
|
|
@@ -397,38 +373,29 @@ const recurse = async (target, ctx) => {
|
|
|
397
373
|
}
|
|
398
374
|
documents.push(result);
|
|
399
375
|
}
|
|
400
|
-
entries
|
|
401
|
-
propName,
|
|
402
|
-
documents,
|
|
403
|
-
]);
|
|
376
|
+
entries[propName] = documents;
|
|
404
377
|
continue;
|
|
405
378
|
}
|
|
406
|
-
const { error, result:
|
|
379
|
+
const { error, result: doc } = await (0, exports.traverseDocument)(value, targetDescription, ctx.options);
|
|
407
380
|
if (error) {
|
|
408
381
|
return types_1.Result.error(error);
|
|
409
382
|
}
|
|
410
|
-
entries
|
|
411
|
-
propName,
|
|
412
|
-
document,
|
|
413
|
-
]);
|
|
383
|
+
entries[propName] = doc;
|
|
414
384
|
continue;
|
|
415
385
|
}
|
|
416
386
|
}
|
|
417
|
-
entries.
|
|
387
|
+
entries[propName] = await ctx.options.pipe(value, {
|
|
388
|
+
...ctx,
|
|
389
|
+
target,
|
|
418
390
|
propName,
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
? `${ctx.propPath}.${propName}`
|
|
425
|
-
: propName,
|
|
426
|
-
property,
|
|
427
|
-
}),
|
|
428
|
-
]);
|
|
391
|
+
propPath: ctx.propPath
|
|
392
|
+
? `${ctx.propPath}.${propName}`
|
|
393
|
+
: propName,
|
|
394
|
+
property,
|
|
395
|
+
});
|
|
429
396
|
}
|
|
430
397
|
}
|
|
431
|
-
return types_1.Result.result(
|
|
398
|
+
return types_1.Result.result(entries);
|
|
432
399
|
};
|
|
433
400
|
const traverseDocument = async (what, description, _options) => {
|
|
434
401
|
if (!what) {
|
|
@@ -109,21 +109,18 @@ const autoCast = (value, ctx) => {
|
|
|
109
109
|
return value.map((v) => autoCast(v, ctx));
|
|
110
110
|
}
|
|
111
111
|
if (Object.keys(value).length > 0) {
|
|
112
|
-
const entries =
|
|
112
|
+
const entries = {};
|
|
113
113
|
for (const [k, v] of Object.entries(value)) {
|
|
114
114
|
const subProperty = !k.startsWith("$") ? getProperty(k, ctx.property) : ctx.property;
|
|
115
115
|
if (!subProperty) {
|
|
116
116
|
continue;
|
|
117
117
|
}
|
|
118
|
-
entries
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
property: subProperty
|
|
123
|
-
})
|
|
124
|
-
]);
|
|
118
|
+
entries[k] = autoCast(v, {
|
|
119
|
+
...ctx,
|
|
120
|
+
property: subProperty
|
|
121
|
+
});
|
|
125
122
|
}
|
|
126
|
-
return
|
|
123
|
+
return entries;
|
|
127
124
|
}
|
|
128
125
|
}
|
|
129
126
|
}
|
|
@@ -233,7 +230,7 @@ const recurseDeep = async (value, ctx) => {
|
|
|
233
230
|
return value;
|
|
234
231
|
};
|
|
235
232
|
const recurse = async (target, ctx) => {
|
|
236
|
-
const entries =
|
|
233
|
+
const entries = {};
|
|
237
234
|
const entrypoint = ctx.options.fromProperties && "properties" in ctx.property ? {
|
|
238
235
|
_id: null,
|
|
239
236
|
...ctx.property.properties
|
|
@@ -244,32 +241,23 @@ const recurse = async (target, ctx) => {
|
|
|
244
241
|
if (propName === "_id") {
|
|
245
242
|
if (value) {
|
|
246
243
|
if (ctx.options.autoCast) {
|
|
247
|
-
entries
|
|
244
|
+
entries[propName] = autoCast(value, {
|
|
245
|
+
...ctx,
|
|
246
|
+
target,
|
|
248
247
|
propName,
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
property: {
|
|
254
|
-
$ref: ""
|
|
255
|
-
}
|
|
256
|
-
})
|
|
257
|
-
]);
|
|
248
|
+
property: {
|
|
249
|
+
$ref: ""
|
|
250
|
+
}
|
|
251
|
+
});
|
|
258
252
|
} else {
|
|
259
|
-
entries
|
|
260
|
-
propName,
|
|
261
|
-
value
|
|
262
|
-
]);
|
|
253
|
+
entries[propName] = value;
|
|
263
254
|
}
|
|
264
255
|
}
|
|
265
256
|
continue;
|
|
266
257
|
}
|
|
267
258
|
if (ctx.options.undefinedToNull) {
|
|
268
259
|
if (value === void 0) {
|
|
269
|
-
entries
|
|
270
|
-
propName,
|
|
271
|
-
null
|
|
272
|
-
]);
|
|
260
|
+
entries[propName] = null;
|
|
273
261
|
continue;
|
|
274
262
|
}
|
|
275
263
|
}
|
|
@@ -281,13 +269,10 @@ const recurse = async (target, ctx) => {
|
|
|
281
269
|
}
|
|
282
270
|
if (key === "$regex" && typeof value[key] === "string") {
|
|
283
271
|
if (!ctx.options.noRegExpEscaping) {
|
|
284
|
-
entries
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
$regex: escapeRegExp(value[key])
|
|
289
|
-
}
|
|
290
|
-
]);
|
|
272
|
+
entries[propName] = {
|
|
273
|
+
...value,
|
|
274
|
+
$regex: escapeRegExp(value[key])
|
|
275
|
+
};
|
|
291
276
|
continue entrypoint;
|
|
292
277
|
}
|
|
293
278
|
}
|
|
@@ -305,26 +290,17 @@ const recurse = async (target, ctx) => {
|
|
|
305
290
|
}
|
|
306
291
|
operations.push(result);
|
|
307
292
|
}
|
|
308
|
-
entries
|
|
309
|
-
propName,
|
|
310
|
-
operations
|
|
311
|
-
]);
|
|
293
|
+
entries[propName] = operations;
|
|
312
294
|
continue;
|
|
313
295
|
}
|
|
314
296
|
const { error, result: operator } = await recurse(value, ctx);
|
|
315
297
|
if (error) {
|
|
316
298
|
return Result.error(error);
|
|
317
299
|
}
|
|
318
|
-
entries
|
|
319
|
-
propName,
|
|
320
|
-
operator
|
|
321
|
-
]);
|
|
300
|
+
entries[propName] = operator;
|
|
322
301
|
continue;
|
|
323
302
|
}
|
|
324
|
-
entries
|
|
325
|
-
propName,
|
|
326
|
-
value
|
|
327
|
-
]);
|
|
303
|
+
entries[propName] = value;
|
|
328
304
|
} else {
|
|
329
305
|
if (!ctx.options.preserveHidden && property.hidden) {
|
|
330
306
|
continue;
|
|
@@ -358,36 +334,27 @@ const recurse = async (target, ctx) => {
|
|
|
358
334
|
}
|
|
359
335
|
documents.push(result);
|
|
360
336
|
}
|
|
361
|
-
entries
|
|
362
|
-
propName,
|
|
363
|
-
documents
|
|
364
|
-
]);
|
|
337
|
+
entries[propName] = documents;
|
|
365
338
|
continue;
|
|
366
339
|
}
|
|
367
|
-
const { error, result:
|
|
340
|
+
const { error, result: doc } = await traverseDocument(value, targetDescription, ctx.options);
|
|
368
341
|
if (error) {
|
|
369
342
|
return Result.error(error);
|
|
370
343
|
}
|
|
371
|
-
entries
|
|
372
|
-
propName,
|
|
373
|
-
document
|
|
374
|
-
]);
|
|
344
|
+
entries[propName] = doc;
|
|
375
345
|
continue;
|
|
376
346
|
}
|
|
377
347
|
}
|
|
378
|
-
entries.
|
|
348
|
+
entries[propName] = await ctx.options.pipe(value, {
|
|
349
|
+
...ctx,
|
|
350
|
+
target,
|
|
379
351
|
propName,
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
propName,
|
|
384
|
-
propPath: ctx.propPath ? `${ctx.propPath}.${propName}` : propName,
|
|
385
|
-
property
|
|
386
|
-
})
|
|
387
|
-
]);
|
|
352
|
+
propPath: ctx.propPath ? `${ctx.propPath}.${propName}` : propName,
|
|
353
|
+
property
|
|
354
|
+
});
|
|
388
355
|
}
|
|
389
356
|
}
|
|
390
|
-
return Result.result(
|
|
357
|
+
return Result.result(entries);
|
|
391
358
|
};
|
|
392
359
|
export const traverseDocument = async (what, description, _options) => {
|
|
393
360
|
if (!what) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { useSecurity, applyReadMiddlewares } from "@aeriajs/security";
|
|
3
|
-
import {
|
|
3
|
+
import { Result, HTTPStatus, ACError } from "@aeriajs/types";
|
|
4
4
|
import { throwIfError } from "@aeriajs/common";
|
|
5
5
|
import {
|
|
6
6
|
traverseDocument,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeriajs/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.205",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"aeriaMain": "tests/fixtures/aeriaMain.js",
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
"mongodb-memory-server": "^9.2.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@aeriajs/builtins": "^0.0.
|
|
46
|
-
"@aeriajs/common": "^0.0.
|
|
47
|
-
"@aeriajs/entrypoint": "^0.0.
|
|
48
|
-
"@aeriajs/http": "^0.0.
|
|
49
|
-
"@aeriajs/security": "^0.0.
|
|
50
|
-
"@aeriajs/types": "^0.0.
|
|
51
|
-
"@aeriajs/validation": "^0.0.
|
|
45
|
+
"@aeriajs/builtins": "^0.0.205",
|
|
46
|
+
"@aeriajs/common": "^0.0.125",
|
|
47
|
+
"@aeriajs/entrypoint": "^0.0.128",
|
|
48
|
+
"@aeriajs/http": "^0.0.145",
|
|
49
|
+
"@aeriajs/security": "^0.0.205",
|
|
50
|
+
"@aeriajs/types": "^0.0.107",
|
|
51
|
+
"@aeriajs/validation": "^0.0.134"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"mongodb": "^6.5.0",
|