@aeriajs/types 0.0.99 → 0.0.101
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/config.d.ts +0 -1
- package/dist/functionSchemas.d.ts +4 -4
- package/dist/functionSchemas.js +9 -9
- package/dist/functionSchemas.mjs +4 -4
- package/dist/functions.d.ts +5 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/index.mjs +1 -1
- package/dist/resultSchemas.d.ts +2 -2
- package/dist/resultSchemas.js +4 -4
- package/dist/resultSchemas.mjs +4 -4
- package/package.json +1 -1
package/dist/config.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ACError } from './accessControl.js';
|
|
2
2
|
import { HTTPStatus } from './http.js';
|
|
3
3
|
import { ValidationErrorCode, TraverseError } from './validation.js';
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const insertError: () => {
|
|
5
5
|
readonly type: "object";
|
|
6
6
|
readonly properties: {
|
|
7
7
|
readonly _tag: {
|
|
@@ -31,7 +31,7 @@ export declare const insertErrorSchema: () => {
|
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
|
-
export declare const
|
|
34
|
+
export declare const getError: () => {
|
|
35
35
|
readonly type: "object";
|
|
36
36
|
readonly properties: {
|
|
37
37
|
readonly _tag: {
|
|
@@ -61,7 +61,7 @@ export declare const getErrorSchema: () => {
|
|
|
61
61
|
};
|
|
62
62
|
};
|
|
63
63
|
};
|
|
64
|
-
export declare const
|
|
64
|
+
export declare const getAllError: () => {
|
|
65
65
|
readonly type: "object";
|
|
66
66
|
readonly properties: {
|
|
67
67
|
readonly _tag: {
|
|
@@ -91,7 +91,7 @@ export declare const getAllErrorSchema: () => {
|
|
|
91
91
|
};
|
|
92
92
|
};
|
|
93
93
|
};
|
|
94
|
-
export declare const
|
|
94
|
+
export declare const countError: () => {
|
|
95
95
|
readonly type: "object";
|
|
96
96
|
readonly properties: {
|
|
97
97
|
readonly _tag: {
|
package/dist/functionSchemas.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.countError = exports.getAllError = exports.getError = exports.insertError = void 0;
|
|
4
4
|
const accessControl_js_1 = require("./accessControl.js");
|
|
5
5
|
const http_js_1 = require("./http.js");
|
|
6
6
|
const resultSchemas_js_1 = require("./resultSchemas.js");
|
|
7
7
|
const validation_js_1 = require("./validation.js");
|
|
8
|
-
const
|
|
8
|
+
const insertError = () => (0, resultSchemas_js_1.endpointErrorSchema)({
|
|
9
9
|
httpStatus: [
|
|
10
10
|
http_js_1.HTTPStatus.Forbidden,
|
|
11
11
|
http_js_1.HTTPStatus.NotFound,
|
|
@@ -25,8 +25,8 @@ const insertErrorSchema = () => (0, resultSchemas_js_1.endpointErrorSchema)({
|
|
|
25
25
|
validation_js_1.TraverseError.InvalidTempfile,
|
|
26
26
|
],
|
|
27
27
|
});
|
|
28
|
-
exports.
|
|
29
|
-
const
|
|
28
|
+
exports.insertError = insertError;
|
|
29
|
+
const getError = () => (0, resultSchemas_js_1.endpointErrorSchema)({
|
|
30
30
|
httpStatus: [
|
|
31
31
|
http_js_1.HTTPStatus.Forbidden,
|
|
32
32
|
http_js_1.HTTPStatus.NotFound,
|
|
@@ -39,8 +39,8 @@ const getErrorSchema = () => (0, resultSchemas_js_1.endpointErrorSchema)({
|
|
|
39
39
|
accessControl_js_1.ACError.MalformedInput,
|
|
40
40
|
],
|
|
41
41
|
});
|
|
42
|
-
exports.
|
|
43
|
-
const
|
|
42
|
+
exports.getError = getError;
|
|
43
|
+
const getAllError = () => (0, resultSchemas_js_1.endpointErrorSchema)({
|
|
44
44
|
httpStatus: [http_js_1.HTTPStatus.Forbidden],
|
|
45
45
|
code: [
|
|
46
46
|
accessControl_js_1.ACError.OwnershipError,
|
|
@@ -48,12 +48,12 @@ const getAllErrorSchema = () => (0, resultSchemas_js_1.endpointErrorSchema)({
|
|
|
48
48
|
accessControl_js_1.ACError.InvalidLimit,
|
|
49
49
|
],
|
|
50
50
|
});
|
|
51
|
-
exports.
|
|
52
|
-
const
|
|
51
|
+
exports.getAllError = getAllError;
|
|
52
|
+
const countError = () => (0, resultSchemas_js_1.endpointErrorSchema)({
|
|
53
53
|
httpStatus: [http_js_1.HTTPStatus.Forbidden],
|
|
54
54
|
code: [
|
|
55
55
|
accessControl_js_1.ACError.OwnershipError,
|
|
56
56
|
accessControl_js_1.ACError.InvalidLimit,
|
|
57
57
|
],
|
|
58
58
|
});
|
|
59
|
-
exports.
|
|
59
|
+
exports.countError = countError;
|
package/dist/functionSchemas.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { ACError } from "./accessControl.mjs";
|
|
|
3
3
|
import { HTTPStatus } from "./http.mjs";
|
|
4
4
|
import { endpointErrorSchema } from "./resultSchemas.mjs";
|
|
5
5
|
import { ValidationErrorCode, TraverseError } from "./validation.mjs";
|
|
6
|
-
export const
|
|
6
|
+
export const insertError = () => endpointErrorSchema({
|
|
7
7
|
httpStatus: [
|
|
8
8
|
HTTPStatus.Forbidden,
|
|
9
9
|
HTTPStatus.NotFound,
|
|
@@ -23,7 +23,7 @@ export const insertErrorSchema = () => endpointErrorSchema({
|
|
|
23
23
|
TraverseError.InvalidTempfile
|
|
24
24
|
]
|
|
25
25
|
});
|
|
26
|
-
export const
|
|
26
|
+
export const getError = () => endpointErrorSchema({
|
|
27
27
|
httpStatus: [
|
|
28
28
|
HTTPStatus.Forbidden,
|
|
29
29
|
HTTPStatus.NotFound,
|
|
@@ -36,7 +36,7 @@ export const getErrorSchema = () => endpointErrorSchema({
|
|
|
36
36
|
ACError.MalformedInput
|
|
37
37
|
]
|
|
38
38
|
});
|
|
39
|
-
export const
|
|
39
|
+
export const getAllError = () => endpointErrorSchema({
|
|
40
40
|
httpStatus: [HTTPStatus.Forbidden],
|
|
41
41
|
code: [
|
|
42
42
|
ACError.OwnershipError,
|
|
@@ -44,7 +44,7 @@ export const getAllErrorSchema = () => endpointErrorSchema({
|
|
|
44
44
|
ACError.InvalidLimit
|
|
45
45
|
]
|
|
46
46
|
});
|
|
47
|
-
export const
|
|
47
|
+
export const countError = () => endpointErrorSchema({
|
|
48
48
|
httpStatus: [HTTPStatus.Forbidden],
|
|
49
49
|
code: [
|
|
50
50
|
ACError.OwnershipError,
|
package/dist/functions.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { EndpointError } from './endpointError.js';
|
|
|
4
4
|
import type { SchemaWithId, InferSchema, PackReferences } from './schema.js';
|
|
5
5
|
import type { JsonSchema } from './property.js';
|
|
6
6
|
import type { WithACErrors } from './http.js';
|
|
7
|
-
import type
|
|
7
|
+
import type * as functionSchemas from './functionSchemas.js';
|
|
8
8
|
export type UploadAuxProps = {
|
|
9
9
|
parentId: string;
|
|
10
10
|
propName: string;
|
|
@@ -69,10 +69,10 @@ export type RemoveFilePayload = UploadAuxProps & {
|
|
|
69
69
|
_id: ObjectId | string;
|
|
70
70
|
};
|
|
71
71
|
};
|
|
72
|
-
export type InsertReturnType<TDocument> = Result.Either<ExtractError<InferSchema<ReturnType<typeof
|
|
73
|
-
export type GetReturnType<TDocument> = Result.Either<ExtractError<InferSchema<ReturnType<typeof
|
|
74
|
-
export type GetAllReturnType<TDocument> = Result.Either<ExtractError<InferSchema<ReturnType<typeof
|
|
75
|
-
export type CountReturnType = Result.Either<ExtractError<InferSchema<ReturnType<typeof
|
|
72
|
+
export type InsertReturnType<TDocument> = Result.Either<ExtractError<InferSchema<ReturnType<typeof functionSchemas.insertError>>>, TDocument>;
|
|
73
|
+
export type GetReturnType<TDocument> = Result.Either<ExtractError<InferSchema<ReturnType<typeof functionSchemas.getError>>>, TDocument>;
|
|
74
|
+
export type GetAllReturnType<TDocument> = Result.Either<ExtractError<InferSchema<ReturnType<typeof functionSchemas.getAllError>>>, TDocument[]>;
|
|
75
|
+
export type CountReturnType = Result.Either<ExtractError<InferSchema<ReturnType<typeof functionSchemas.countError>>>, number>;
|
|
76
76
|
export type RemoveReturnType<TDocument> = Result.Either<EndpointError, TDocument>;
|
|
77
77
|
export type PaginatedGetAllReturnType<TDocument> = Result.Either<ExtractError<GetAllReturnType<TDocument>>, {
|
|
78
78
|
data: TDocument[];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * as functionSchemas from './functionSchemas.js';
|
|
1
2
|
export * from './accessControl.js';
|
|
2
3
|
export * from './collection.js';
|
|
3
4
|
export * from './condition.js';
|
|
@@ -7,7 +8,6 @@ export * from './contract.js';
|
|
|
7
8
|
export * from './description.js';
|
|
8
9
|
export * from './endpointError.js';
|
|
9
10
|
export * from './functions.js';
|
|
10
|
-
export * from './functionSchemas.js';
|
|
11
11
|
export * from './http.js';
|
|
12
12
|
export * from './property.js';
|
|
13
13
|
export * from './result.js';
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.functionSchemas = void 0;
|
|
18
|
+
exports.functionSchemas = require("./functionSchemas.js");
|
|
17
19
|
__exportStar(require("./accessControl.js"), exports);
|
|
18
20
|
__exportStar(require("./collection.js"), exports);
|
|
19
21
|
__exportStar(require("./condition.js"), exports);
|
|
@@ -23,7 +25,6 @@ __exportStar(require("./contract.js"), exports);
|
|
|
23
25
|
__exportStar(require("./description.js"), exports);
|
|
24
26
|
__exportStar(require("./endpointError.js"), exports);
|
|
25
27
|
__exportStar(require("./functions.js"), exports);
|
|
26
|
-
__exportStar(require("./functionSchemas.js"), exports);
|
|
27
28
|
__exportStar(require("./http.js"), exports);
|
|
28
29
|
__exportStar(require("./property.js"), exports);
|
|
29
30
|
__exportStar(require("./result.js"), exports);
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
export * as functionSchemas from "./functionSchemas.mjs";
|
|
2
3
|
export * from "./accessControl.mjs";
|
|
3
4
|
export * from "./collection.mjs";
|
|
4
5
|
export * from "./condition.mjs";
|
|
@@ -8,7 +9,6 @@ export * from "./contract.mjs";
|
|
|
8
9
|
export * from "./description.mjs";
|
|
9
10
|
export * from "./endpointError.mjs";
|
|
10
11
|
export * from "./functions.mjs";
|
|
11
|
-
export * from "./functionSchemas.mjs";
|
|
12
12
|
export * from "./http.mjs";
|
|
13
13
|
export * from "./property.mjs";
|
|
14
14
|
export * from "./result.mjs";
|
package/dist/resultSchemas.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Property } from './property.js';
|
|
2
2
|
import type { HTTPStatus } from './http.js';
|
|
3
|
-
export declare const errorSchema: <const
|
|
3
|
+
export declare const errorSchema: <const TError extends Property>(error: TError) => {
|
|
4
4
|
readonly type: "object";
|
|
5
5
|
readonly properties: {
|
|
6
6
|
readonly _tag: {
|
|
@@ -12,7 +12,7 @@ export declare const errorSchema: <const TObject extends Property>(object: TObje
|
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
|
-
export declare const resultSchema: <const
|
|
15
|
+
export declare const resultSchema: <const TResult extends Property>(result: TResult) => {
|
|
16
16
|
readonly type: "object";
|
|
17
17
|
readonly properties: {
|
|
18
18
|
readonly _tag: {
|
package/dist/resultSchemas.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.genericEndpointErrorSchema = exports.endpointErrorSchema = exports.resultSchema = exports.errorSchema = void 0;
|
|
4
|
-
const errorSchema = (
|
|
4
|
+
const errorSchema = (error) => {
|
|
5
5
|
return {
|
|
6
6
|
type: 'object',
|
|
7
7
|
properties: {
|
|
8
8
|
_tag: {
|
|
9
9
|
const: 'Error',
|
|
10
10
|
},
|
|
11
|
-
error
|
|
11
|
+
error,
|
|
12
12
|
result: {
|
|
13
13
|
const: undefined,
|
|
14
14
|
},
|
|
@@ -16,7 +16,7 @@ const errorSchema = (object) => {
|
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
18
|
exports.errorSchema = errorSchema;
|
|
19
|
-
const resultSchema = (
|
|
19
|
+
const resultSchema = (result) => {
|
|
20
20
|
return {
|
|
21
21
|
type: 'object',
|
|
22
22
|
properties: {
|
|
@@ -26,7 +26,7 @@ const resultSchema = (object) => {
|
|
|
26
26
|
error: {
|
|
27
27
|
const: undefined,
|
|
28
28
|
},
|
|
29
|
-
result
|
|
29
|
+
result,
|
|
30
30
|
},
|
|
31
31
|
};
|
|
32
32
|
};
|
package/dist/resultSchemas.mjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
export const errorSchema = (
|
|
2
|
+
export const errorSchema = (error) => {
|
|
3
3
|
return {
|
|
4
4
|
type: "object",
|
|
5
5
|
properties: {
|
|
6
6
|
_tag: {
|
|
7
7
|
const: "Error"
|
|
8
8
|
},
|
|
9
|
-
error
|
|
9
|
+
error,
|
|
10
10
|
result: {
|
|
11
11
|
const: void 0
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
|
-
export const resultSchema = (
|
|
16
|
+
export const resultSchema = (result) => {
|
|
17
17
|
return {
|
|
18
18
|
type: "object",
|
|
19
19
|
properties: {
|
|
@@ -23,7 +23,7 @@ export const resultSchema = (object) => {
|
|
|
23
23
|
error: {
|
|
24
24
|
const: void 0
|
|
25
25
|
},
|
|
26
|
-
result
|
|
26
|
+
result
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
};
|