@aeriajs/core 0.0.229 → 0.0.231
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.
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { SchemaWithId, Collection, StrictContext, Contract, ContractToFunction, Description, CollectionSecurityPolicy, AccessCondition
|
|
1
|
+
import type { SchemaWithId, Collection, StrictContext, Contract, ContractToFunction, Description, CollectionSecurityPolicy, AccessCondition } from '@aeriajs/types';
|
|
2
2
|
export type ExtendCollection<TLeftCollection extends Omit<Collection, 'item'>, TRightCollection> = TLeftCollection & TRightCollection & {
|
|
3
3
|
item: SchemaWithId<(TLeftCollection & TRightCollection)['description']>;
|
|
4
4
|
};
|
|
5
|
-
export declare const defineCollection: <TCollection extends Collection<TCollection extends Collection ? TCollection : never> extends infer Coll ? Omit<Coll, "item" | "description" | "functions" | "exposedFunctions" | "security" | "middlewares"> : never, const TDescription extends Description<TDescription>, const TContracts extends { [P in keyof TFunctions]?: Contract; }, TExposedFunctions extends Partial<Record<keyof TFunctions, AccessCondition>>, TFunctions extends undefined | (Record<string, (payload: any, context: StrictContext<any>) => any> & { [P in keyof TContracts | keyof TExposedFunctions]: ContractToFunction<P extends keyof TContracts ? NonNullable<TContracts[P]> : any, StrictContext<P extends keyof TExposedFunctions ?
|
|
5
|
+
export declare const defineCollection: <TCollection extends Collection<TCollection extends Collection ? TCollection : never> extends infer Coll ? Omit<Coll, "item" | "description" | "functions" | "exposedFunctions" | "security" | "middlewares"> : never, const TDescription extends Description<TDescription>, const TContracts extends { [P in keyof TFunctions]?: Contract; }, TExposedFunctions extends Partial<Record<keyof TFunctions, AccessCondition>>, TFunctions extends undefined | (Record<string, (payload: any, context: StrictContext<any>) => any> & { [P in keyof TContracts | keyof TExposedFunctions]: ContractToFunction<P extends keyof TContracts ? NonNullable<TContracts[P]> : any, StrictContext<P extends keyof TExposedFunctions ? TExposedFunctions[P] : never, TDescription>>; })>(collection: TCollection & {
|
|
6
6
|
description: TDescription;
|
|
7
7
|
functions?: TFunctions;
|
|
8
8
|
contracts?: TContracts;
|
|
@@ -487,7 +487,7 @@ const traverseDocument = async (what, description, _options) => {
|
|
|
487
487
|
}
|
|
488
488
|
return types_1.Result.error((0, validation_1.makeValidationError)({
|
|
489
489
|
code: types_1.ValidationErrorCode.InvalidProperties,
|
|
490
|
-
|
|
490
|
+
details: validationError,
|
|
491
491
|
}));
|
|
492
492
|
}
|
|
493
493
|
return types_1.Result.result(result);
|
|
@@ -436,7 +436,7 @@ export const traverseDocument = async (what, description, _options) => {
|
|
|
436
436
|
}
|
|
437
437
|
return Result.error(makeValidationError({
|
|
438
438
|
code: ValidationErrorCode.InvalidProperties,
|
|
439
|
-
|
|
439
|
+
details: validationError
|
|
440
440
|
}));
|
|
441
441
|
}
|
|
442
442
|
return Result.result(result);
|
package/dist/functions/insert.js
CHANGED
|
@@ -38,7 +38,7 @@ const internalInsert = async (payload, context) => {
|
|
|
38
38
|
}
|
|
39
39
|
return context.error(types_1.HTTPStatus.UnprocessableContent, {
|
|
40
40
|
code: error.code,
|
|
41
|
-
details: error.
|
|
41
|
+
details: error.details,
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
const docId = '_id' in what && what._id instanceof mongodb_1.ObjectId
|
|
@@ -34,7 +34,7 @@ const internalInsert = async (payload, context) => {
|
|
|
34
34
|
}
|
|
35
35
|
return context.error(HTTPStatus.UnprocessableContent, {
|
|
36
36
|
code: error.code,
|
|
37
|
-
details: error.
|
|
37
|
+
details: error.details
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
const docId = "_id" in what && what._id instanceof ObjectId ? what._id : null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeriajs/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.231",
|
|
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.231",
|
|
46
|
+
"@aeriajs/common": "^0.0.132",
|
|
47
|
+
"@aeriajs/entrypoint": "^0.0.135",
|
|
48
|
+
"@aeriajs/http": "^0.0.159",
|
|
49
|
+
"@aeriajs/security": "^0.0.231",
|
|
50
|
+
"@aeriajs/types": "^0.0.114",
|
|
51
|
+
"@aeriajs/validation": "^0.0.147"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"mongodb": "^6.5.0",
|