@aeriajs/core 0.0.91 → 0.0.93
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.
|
@@ -3,7 +3,7 @@ import { HTTPStatus, ACError, ValidationErrorCode } from '@aeriajs/types';
|
|
|
3
3
|
export type InsertOptions = {
|
|
4
4
|
bypassSecurity?: boolean;
|
|
5
5
|
};
|
|
6
|
-
export declare const insertErrorSchema: {
|
|
6
|
+
export declare const insertErrorSchema: () => {
|
|
7
7
|
readonly type: "object";
|
|
8
8
|
readonly properties: {
|
|
9
9
|
readonly _tag: {
|
|
@@ -5,7 +5,7 @@ const types_1 = require("@aeriajs/types");
|
|
|
5
5
|
const security_1 = require("@aeriajs/security");
|
|
6
6
|
const common_1 = require("@aeriajs/common");
|
|
7
7
|
const index_js_1 = require("../../collection/index.js");
|
|
8
|
-
|
|
8
|
+
const insertErrorSchema = () => (0, common_1.errorSchema)({
|
|
9
9
|
httpStatus: [
|
|
10
10
|
types_1.HTTPStatus.UnprocessableContent,
|
|
11
11
|
types_1.HTTPStatus.NotFound,
|
|
@@ -20,6 +20,7 @@ exports.insertErrorSchema = (0, common_1.endpointErrorSchema)({
|
|
|
20
20
|
types_1.ValidationErrorCode.MissingProperties,
|
|
21
21
|
],
|
|
22
22
|
});
|
|
23
|
+
exports.insertErrorSchema = insertErrorSchema;
|
|
23
24
|
const insert = async (payload, context, options) => {
|
|
24
25
|
const security = (0, security_1.useSecurity)(context);
|
|
25
26
|
const query = !options?.bypassSecurity
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { HTTPStatus, ACError, ValidationErrorCode } from "@aeriajs/types";
|
|
3
3
|
import { useSecurity } from "@aeriajs/security";
|
|
4
|
-
import { isLeft, unwrapEither, throwIfLeft,
|
|
4
|
+
import { isLeft, unwrapEither, throwIfLeft, errorSchema } from "@aeriajs/common";
|
|
5
5
|
import { traverseDocument, normalizeProjection, prepareInsert } from "../../collection/index.mjs";
|
|
6
|
-
export const insertErrorSchema =
|
|
6
|
+
export const insertErrorSchema = () => errorSchema({
|
|
7
7
|
httpStatus: [
|
|
8
8
|
HTTPStatus.UnprocessableContent,
|
|
9
9
|
HTTPStatus.NotFound
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeriajs/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.93",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"mongodb-memory-server": "^9.2.0"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@aeriajs/builtins": "^0.0.
|
|
45
|
-
"@aeriajs/common": "^0.0.
|
|
46
|
-
"@aeriajs/entrypoint": "^0.0.
|
|
47
|
-
"@aeriajs/http": "^0.0.
|
|
48
|
-
"@aeriajs/security": "^0.0.
|
|
49
|
-
"@aeriajs/types": "^0.0.
|
|
50
|
-
"@aeriajs/validation": "^0.0.
|
|
44
|
+
"@aeriajs/builtins": "^0.0.93",
|
|
45
|
+
"@aeriajs/common": "^0.0.59",
|
|
46
|
+
"@aeriajs/entrypoint": "^0.0.59",
|
|
47
|
+
"@aeriajs/http": "^0.0.67",
|
|
48
|
+
"@aeriajs/security": "^0.0.93",
|
|
49
|
+
"@aeriajs/types": "^0.0.55",
|
|
50
|
+
"@aeriajs/validation": "^0.0.62"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"mongodb": "^6.5.0",
|