@aeriajs/builtins 0.0.108 → 0.0.110
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/collections/file/download.d.ts +1 -1
- package/dist/collections/file/index.d.ts +38 -6
- package/dist/collections/file/remove.d.ts +9 -1
- package/dist/collections/file/removeAll.d.ts +9 -1
- package/dist/collections/user/activate.d.ts +3 -3
- package/dist/collections/user/authenticate.d.ts +4 -4
- package/dist/collections/user/authenticate.js +3 -4
- package/dist/collections/user/authenticate.mjs +1 -2
- package/dist/collections/user/createAccount.d.ts +3 -3
- package/dist/collections/user/createAccount.js +1 -2
- package/dist/collections/user/createAccount.mjs +1 -2
- package/dist/collections/user/getActivationLink.js +2 -2
- package/dist/collections/user/getActivationLink.mjs +1 -1
- package/dist/collections/user/getCurrentUser.js +2 -2
- package/dist/collections/user/getCurrentUser.mjs +1 -1
- package/dist/collections/user/getInfo.d.ts +4 -4
- package/dist/collections/user/getInfo.js +1 -2
- package/dist/collections/user/getInfo.mjs +1 -2
- package/dist/collections/user/index.d.ts +64 -26
- package/dist/functions/describe.d.ts +117 -1
- package/dist/functions/describe.js +3 -2
- package/dist/functions/describe.mjs +2 -1
- package/dist/index.d.ts +102 -32
- package/package.json +6 -6
|
@@ -7,7 +7,7 @@ export declare const download: (payload: {
|
|
|
7
7
|
fileId: string;
|
|
8
8
|
options: readonly ('picture' | 'download')[];
|
|
9
9
|
noHeaders?: boolean;
|
|
10
|
-
}, context: Context<typeof description>) => Promise<import("
|
|
10
|
+
}, context: Context<typeof description>) => Promise<import("@aeriajs/types").Result.Error<{
|
|
11
11
|
readonly code: ACError.ResourceNotFound;
|
|
12
12
|
} & {
|
|
13
13
|
httpStatus: HTTPStatus.NotFound;
|
|
@@ -348,7 +348,7 @@ export declare const file: Omit<import("@aeriajs/types").Collection<{
|
|
|
348
348
|
readonly ask: true;
|
|
349
349
|
};
|
|
350
350
|
};
|
|
351
|
-
}>) => Promise<import("
|
|
351
|
+
}>) => Promise<import("@aeriajs/types").Result.Error<{
|
|
352
352
|
readonly code: import("@aeriajs/types").ACError.ResourceNotFound;
|
|
353
353
|
} & {
|
|
354
354
|
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
@@ -451,7 +451,15 @@ export declare const file: Omit<import("@aeriajs/types").Collection<{
|
|
|
451
451
|
readonly ask: true;
|
|
452
452
|
};
|
|
453
453
|
};
|
|
454
|
-
}>) => Promise<
|
|
454
|
+
}>) => Promise<{
|
|
455
|
+
readonly _tag: "Result";
|
|
456
|
+
readonly error: undefined;
|
|
457
|
+
readonly result: any;
|
|
458
|
+
} | import("@aeriajs/types").Result.Error<{
|
|
459
|
+
readonly code: import("@aeriajs/types").ACError.ResourceNotFound;
|
|
460
|
+
} & {
|
|
461
|
+
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
462
|
+
}>>;
|
|
455
463
|
readonly removeAll: (payload: import("@aeriajs/types").RemoveAllPayload, context: import("@aeriajs/types").Context<{
|
|
456
464
|
readonly $id: "file";
|
|
457
465
|
readonly owned: "always";
|
|
@@ -501,7 +509,15 @@ export declare const file: Omit<import("@aeriajs/types").Collection<{
|
|
|
501
509
|
readonly ask: true;
|
|
502
510
|
};
|
|
503
511
|
};
|
|
504
|
-
}>) => Promise<
|
|
512
|
+
}>) => Promise<{
|
|
513
|
+
readonly _tag: "Result";
|
|
514
|
+
readonly error: undefined;
|
|
515
|
+
readonly result: any;
|
|
516
|
+
} | import("@aeriajs/types").Result.Error<{
|
|
517
|
+
readonly code: import("@aeriajs/types").ACError.ResourceNotFound;
|
|
518
|
+
} & {
|
|
519
|
+
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
520
|
+
}>>;
|
|
505
521
|
};
|
|
506
522
|
exposedFunctions: {
|
|
507
523
|
readonly get: "unauthenticated";
|
|
@@ -818,7 +834,7 @@ export declare const file: Omit<import("@aeriajs/types").Collection<{
|
|
|
818
834
|
readonly ask: true;
|
|
819
835
|
};
|
|
820
836
|
};
|
|
821
|
-
}>) => Promise<import("
|
|
837
|
+
}>) => Promise<import("@aeriajs/types").Result.Error<{
|
|
822
838
|
readonly code: import("@aeriajs/types").ACError.ResourceNotFound;
|
|
823
839
|
} & {
|
|
824
840
|
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
@@ -921,7 +937,15 @@ export declare const file: Omit<import("@aeriajs/types").Collection<{
|
|
|
921
937
|
readonly ask: true;
|
|
922
938
|
};
|
|
923
939
|
};
|
|
924
|
-
}>) => Promise<
|
|
940
|
+
}>) => Promise<{
|
|
941
|
+
readonly _tag: "Result";
|
|
942
|
+
readonly error: undefined;
|
|
943
|
+
readonly result: any;
|
|
944
|
+
} | import("@aeriajs/types").Result.Error<{
|
|
945
|
+
readonly code: import("@aeriajs/types").ACError.ResourceNotFound;
|
|
946
|
+
} & {
|
|
947
|
+
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
948
|
+
}>>;
|
|
925
949
|
readonly removeAll: (payload: import("@aeriajs/types").RemoveAllPayload, context: import("@aeriajs/types").Context<{
|
|
926
950
|
readonly $id: "file";
|
|
927
951
|
readonly owned: "always";
|
|
@@ -971,7 +995,15 @@ export declare const file: Omit<import("@aeriajs/types").Collection<{
|
|
|
971
995
|
readonly ask: true;
|
|
972
996
|
};
|
|
973
997
|
};
|
|
974
|
-
}>) => Promise<
|
|
998
|
+
}>) => Promise<{
|
|
999
|
+
readonly _tag: "Result";
|
|
1000
|
+
readonly error: undefined;
|
|
1001
|
+
readonly result: any;
|
|
1002
|
+
} | import("@aeriajs/types").Result.Error<{
|
|
1003
|
+
readonly code: import("@aeriajs/types").ACError.ResourceNotFound;
|
|
1004
|
+
} & {
|
|
1005
|
+
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
1006
|
+
}>>;
|
|
975
1007
|
};
|
|
976
1008
|
contracts: {
|
|
977
1009
|
readonly get?: import("@aeriajs/types").Contract | undefined;
|
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
import type { Context, SchemaWithId, RemovePayload } from '@aeriajs/types';
|
|
2
2
|
import type { description } from './description.js';
|
|
3
|
-
export declare const remove: (payload: RemovePayload<SchemaWithId<typeof description>>, context: Context<typeof description>) => Promise<
|
|
3
|
+
export declare const remove: (payload: RemovePayload<SchemaWithId<typeof description>>, context: Context<typeof description>) => Promise<{
|
|
4
|
+
readonly _tag: "Result";
|
|
5
|
+
readonly error: undefined;
|
|
6
|
+
readonly result: any;
|
|
7
|
+
} | import("@aeriajs/types").Result.Error<{
|
|
8
|
+
readonly code: import("@aeriajs/types").ACError.ResourceNotFound;
|
|
9
|
+
} & {
|
|
10
|
+
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
11
|
+
}>>;
|
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
import type { Context, RemoveAllPayload } from '@aeriajs/types';
|
|
2
2
|
import type { description } from './description.js';
|
|
3
|
-
export declare const removeAll: (payload: RemoveAllPayload, context: Context<typeof description>) => Promise<
|
|
3
|
+
export declare const removeAll: (payload: RemoveAllPayload, context: Context<typeof description>) => Promise<{
|
|
4
|
+
readonly _tag: "Result";
|
|
5
|
+
readonly error: undefined;
|
|
6
|
+
readonly result: any;
|
|
7
|
+
} | import("@aeriajs/types").Result.Error<{
|
|
8
|
+
readonly code: import("@aeriajs/types").ACError.ResourceNotFound;
|
|
9
|
+
} & {
|
|
10
|
+
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
11
|
+
}>>;
|
|
@@ -8,15 +8,15 @@ export declare enum ActivationError {
|
|
|
8
8
|
}
|
|
9
9
|
export declare const activate: (payload: {
|
|
10
10
|
password: string;
|
|
11
|
-
}, context: Context<typeof description>) => Promise<import("@aeriajs/types").GenericResponse | import("
|
|
11
|
+
}, context: Context<typeof description>) => Promise<import("@aeriajs/types").GenericResponse | import("@aeriajs/types").Result.Error<{
|
|
12
12
|
readonly code: ActivationError.InvalidLink;
|
|
13
13
|
} & {
|
|
14
14
|
httpStatus: HTTPStatus.NotFound;
|
|
15
|
-
}> | import("
|
|
15
|
+
}> | import("@aeriajs/types").Result.Error<{
|
|
16
16
|
readonly code: ActivationError.UserNotFound;
|
|
17
17
|
} & {
|
|
18
18
|
httpStatus: HTTPStatus.NotFound;
|
|
19
|
-
}> | import("
|
|
19
|
+
}> | import("@aeriajs/types").Result.Error<{
|
|
20
20
|
readonly code: ActivationError.AlreadyActiveUser;
|
|
21
21
|
} & {
|
|
22
22
|
httpStatus: HTTPStatus.Forbidden;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Context, SchemaWithId, TokenRecipient } from '@aeriajs/types';
|
|
2
2
|
import type { description } from './description.js';
|
|
3
3
|
import type { ObjectId } from '@aeriajs/core';
|
|
4
|
-
import { HTTPStatus, ACError } from '@aeriajs/types';
|
|
4
|
+
import { Result, HTTPStatus, ACError } from '@aeriajs/types';
|
|
5
5
|
type Props = {
|
|
6
6
|
email: string;
|
|
7
7
|
password: string;
|
|
@@ -32,7 +32,7 @@ export declare const getDefaultUser: () => Promise<{
|
|
|
32
32
|
content: string;
|
|
33
33
|
};
|
|
34
34
|
}>;
|
|
35
|
-
export declare const authenticate: (props: Props, context: Context<typeof description>) => Promise<
|
|
35
|
+
export declare const authenticate: (props: Props, context: Context<typeof description>) => Promise<Result.Error<{
|
|
36
36
|
readonly code: ACError.AuthorizationError;
|
|
37
37
|
} & {
|
|
38
38
|
httpStatus: HTTPStatus.Unauthorized;
|
|
@@ -52,11 +52,11 @@ export declare const authenticate: (props: Props, context: Context<typeof descri
|
|
|
52
52
|
content: string;
|
|
53
53
|
};
|
|
54
54
|
};
|
|
55
|
-
} |
|
|
55
|
+
} | Result.Error<{
|
|
56
56
|
readonly code: AuthenticationError.InvalidCredentials;
|
|
57
57
|
} & {
|
|
58
58
|
httpStatus: HTTPStatus.Unauthorized;
|
|
59
|
-
}> |
|
|
59
|
+
}> | Result.Error<{
|
|
60
60
|
readonly code: AuthenticationError.InactiveUser;
|
|
61
61
|
} & {
|
|
62
62
|
httpStatus: HTTPStatus.Unauthorized;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.authenticate = exports.getDefaultUser = exports.AuthenticationError = void 0;
|
|
4
4
|
const types_1 = require("@aeriajs/types");
|
|
5
|
-
const common_1 = require("@aeriajs/common");
|
|
6
5
|
const bcrypt_1 = require("bcrypt");
|
|
7
6
|
const core_1 = require("@aeriajs/core");
|
|
8
7
|
var AuthenticationError;
|
|
@@ -88,7 +87,7 @@ const authenticate = async (props, context) => {
|
|
|
88
87
|
const decodedToken = token
|
|
89
88
|
? await (0, core_1.decodeToken)(token.content)
|
|
90
89
|
: context.token;
|
|
91
|
-
return
|
|
90
|
+
return types_1.Result.result(decodedToken.sub
|
|
92
91
|
? await getUser(decodedToken.sub, context)
|
|
93
92
|
: await (0, exports.getDefaultUser)());
|
|
94
93
|
}
|
|
@@ -99,7 +98,7 @@ const authenticate = async (props, context) => {
|
|
|
99
98
|
}
|
|
100
99
|
if (context.config.defaultUser) {
|
|
101
100
|
if (props.email === context.config.defaultUser.username && props.password === context.config.defaultUser.password) {
|
|
102
|
-
return
|
|
101
|
+
return types_1.Result.result(await (0, exports.getDefaultUser)());
|
|
103
102
|
}
|
|
104
103
|
}
|
|
105
104
|
const user = await context.collection.model.findOne({
|
|
@@ -121,6 +120,6 @@ const authenticate = async (props, context) => {
|
|
|
121
120
|
code: AuthenticationError.InactiveUser,
|
|
122
121
|
});
|
|
123
122
|
}
|
|
124
|
-
return
|
|
123
|
+
return types_1.Result.result(await getUser(user._id, context));
|
|
125
124
|
};
|
|
126
125
|
exports.authenticate = authenticate;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
import { HTTPStatus, ACError } from "@aeriajs/types";
|
|
3
|
-
import { Result } from "@aeriajs/common";
|
|
2
|
+
import { Result, HTTPStatus, ACError } from "@aeriajs/types";
|
|
4
3
|
import { compare as bcryptCompare } from "bcrypt";
|
|
5
4
|
import { signToken, decodeToken } from "@aeriajs/core";
|
|
6
5
|
export var AuthenticationError = /* @__PURE__ */ ((AuthenticationError2) => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Context, Schema } from '@aeriajs/types';
|
|
2
2
|
import type { description } from './description.js';
|
|
3
|
-
import { HTTPStatus, ACError } from '@aeriajs/types';
|
|
4
|
-
export declare const createAccount: (payload: Omit<Schema<typeof description>, 'roles'>, context: Context<typeof description>) => Promise<
|
|
3
|
+
import { Result, HTTPStatus, ACError } from '@aeriajs/types';
|
|
4
|
+
export declare const createAccount: (payload: Omit<Schema<typeof description>, 'roles'>, context: Context<typeof description>) => Promise<Result.Error<{
|
|
5
5
|
readonly code: ACError.MalformedInput;
|
|
6
|
-
readonly details: import("@aeriajs/types").
|
|
6
|
+
readonly details: import("@aeriajs/types").ValidationError | import("@aeriajs/types").PropertyValidationError;
|
|
7
7
|
} & {
|
|
8
8
|
httpStatus: HTTPStatus.BadRequest;
|
|
9
9
|
}> | {
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createAccount = void 0;
|
|
4
4
|
const types_1 = require("@aeriajs/types");
|
|
5
|
-
const common_1 = require("@aeriajs/common");
|
|
6
5
|
const validation_1 = require("@aeriajs/validation");
|
|
7
6
|
const bcrypt = require("bcrypt");
|
|
8
7
|
const createAccount = async (payload, context) => {
|
|
@@ -62,6 +61,6 @@ const createAccount = async (payload, context) => {
|
|
|
62
61
|
if (!newUser) {
|
|
63
62
|
throw new Error();
|
|
64
63
|
}
|
|
65
|
-
return
|
|
64
|
+
return types_1.Result.result(newUser);
|
|
66
65
|
};
|
|
67
66
|
exports.createAccount = createAccount;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
import { HTTPStatus, ACError } from "@aeriajs/types";
|
|
3
|
-
import { Result } from "@aeriajs/common";
|
|
2
|
+
import { Result, HTTPStatus, ACError } from "@aeriajs/types";
|
|
4
3
|
import { validate } from "@aeriajs/validation";
|
|
5
4
|
import * as bcrypt from "bcrypt";
|
|
6
5
|
export const createAccount = async (payload, context) => {
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getActivationLink = void 0;
|
|
4
4
|
const entrypoint_1 = require("@aeriajs/entrypoint");
|
|
5
|
-
const
|
|
5
|
+
const types_1 = require("@aeriajs/types");
|
|
6
6
|
const bcrypt = require("bcrypt");
|
|
7
7
|
const getActivationLink = async (userId) => {
|
|
8
8
|
const config = await (0, entrypoint_1.getConfig)();
|
|
9
9
|
const activationToken = await bcrypt.hash(userId.toString(), 10);
|
|
10
10
|
const link = `${config.publicUrl}/user/activate?u=${userId.toString()}&t=${activationToken}`;
|
|
11
|
-
return
|
|
11
|
+
return types_1.Result.result(link);
|
|
12
12
|
};
|
|
13
13
|
exports.getActivationLink = getActivationLink;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { getConfig } from "@aeriajs/entrypoint";
|
|
3
|
-
import { Result } from "@aeriajs/
|
|
3
|
+
import { Result } from "@aeriajs/types";
|
|
4
4
|
import * as bcrypt from "bcrypt";
|
|
5
5
|
export const getActivationLink = async (userId) => {
|
|
6
6
|
const config = await getConfig();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getCurrentUser = exports.ActivationError = void 0;
|
|
4
|
-
const
|
|
4
|
+
const types_1 = require("@aeriajs/types");
|
|
5
5
|
var ActivationError;
|
|
6
6
|
(function (ActivationError) {
|
|
7
7
|
ActivationError["UserNotFound"] = "USER_NOT_FOUND";
|
|
@@ -20,6 +20,6 @@ const getCurrentUser = async (_payload, context) => {
|
|
|
20
20
|
if (error) {
|
|
21
21
|
throw new Error();
|
|
22
22
|
}
|
|
23
|
-
return
|
|
23
|
+
return types_1.Result.result(user);
|
|
24
24
|
};
|
|
25
25
|
exports.getCurrentUser = getCurrentUser;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
import { Result } from "@aeriajs/
|
|
2
|
+
import { Result } from "@aeriajs/types";
|
|
3
3
|
export var ActivationError = /* @__PURE__ */ ((ActivationError2) => {
|
|
4
4
|
ActivationError2["UserNotFound"] = "USER_NOT_FOUND";
|
|
5
5
|
ActivationError2["AlreadyActiveUser"] = "ALREADY_ACTIVE_USER";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Context } from '@aeriajs/types';
|
|
2
2
|
import type { description } from './description';
|
|
3
|
-
import { HTTPStatus } from '@aeriajs/types';
|
|
3
|
+
import { Result, HTTPStatus } from '@aeriajs/types';
|
|
4
4
|
export declare enum ActivationError {
|
|
5
5
|
UserNotFound = "USER_NOT_FOUND",
|
|
6
6
|
AlreadyActiveUser = "ALREADY_ACTIVE_USER",
|
|
@@ -9,15 +9,15 @@ export declare enum ActivationError {
|
|
|
9
9
|
export declare const getInfo: (payload: {
|
|
10
10
|
userId: string;
|
|
11
11
|
token: string;
|
|
12
|
-
}, context: Context<typeof description>) => Promise<
|
|
12
|
+
}, context: Context<typeof description>) => Promise<Result.Error<{
|
|
13
13
|
readonly code: ActivationError.InvalidLink;
|
|
14
14
|
} & {
|
|
15
15
|
httpStatus: HTTPStatus.NotFound;
|
|
16
|
-
}> |
|
|
16
|
+
}> | Result.Error<{
|
|
17
17
|
readonly code: ActivationError.UserNotFound;
|
|
18
18
|
} & {
|
|
19
19
|
httpStatus: HTTPStatus.NotFound;
|
|
20
|
-
}> |
|
|
20
|
+
}> | Result.Error<{
|
|
21
21
|
readonly code: ActivationError.AlreadyActiveUser;
|
|
22
22
|
} & {
|
|
23
23
|
httpStatus: HTTPStatus.Forbidden;
|
|
@@ -4,7 +4,6 @@ exports.getInfo = exports.ActivationError = void 0;
|
|
|
4
4
|
const bcrypt = require("bcrypt");
|
|
5
5
|
const types_1 = require("@aeriajs/types");
|
|
6
6
|
const core_1 = require("@aeriajs/core");
|
|
7
|
-
const common_1 = require("@aeriajs/common");
|
|
8
7
|
var ActivationError;
|
|
9
8
|
(function (ActivationError) {
|
|
10
9
|
ActivationError["UserNotFound"] = "USER_NOT_FOUND";
|
|
@@ -37,7 +36,7 @@ const getInfo = async (payload, context) => {
|
|
|
37
36
|
code: ActivationError.InvalidLink,
|
|
38
37
|
});
|
|
39
38
|
}
|
|
40
|
-
return
|
|
39
|
+
return types_1.Result.result({
|
|
41
40
|
name: user.name,
|
|
42
41
|
email: user.email,
|
|
43
42
|
});
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import * as bcrypt from "bcrypt";
|
|
3
|
-
import { HTTPStatus } from "@aeriajs/types";
|
|
3
|
+
import { Result, HTTPStatus } from "@aeriajs/types";
|
|
4
4
|
import { ObjectId } from "@aeriajs/core";
|
|
5
|
-
import { Result } from "@aeriajs/common";
|
|
6
5
|
export var ActivationError = /* @__PURE__ */ ((ActivationError2) => {
|
|
7
6
|
ActivationError2["UserNotFound"] = "USER_NOT_FOUND";
|
|
8
7
|
ActivationError2["AlreadyActiveUser"] = "ALREADY_ACTIVE_USER";
|
|
@@ -106,8 +106,27 @@ export declare const user: {
|
|
|
106
106
|
readonly error: undefined;
|
|
107
107
|
readonly result: import("@aeriajs/types").SchemaWithId<any>[];
|
|
108
108
|
}>;
|
|
109
|
-
readonly remove: (payload: import("@aeriajs/types").RemovePayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>) => Promise<
|
|
110
|
-
|
|
109
|
+
readonly remove: (payload: import("@aeriajs/types").RemovePayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>) => Promise<{
|
|
110
|
+
readonly _tag: "Result";
|
|
111
|
+
readonly error: undefined;
|
|
112
|
+
readonly result: any;
|
|
113
|
+
} | import("@aeriajs/types").Result.Error<{
|
|
114
|
+
readonly code: import("@aeriajs/types").ACError.ResourceNotFound;
|
|
115
|
+
} & {
|
|
116
|
+
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
117
|
+
}>>;
|
|
118
|
+
readonly upload: (_props: unknown, context: import("@aeriajs/types").StrictContext<any>) => Promise<import("@aeriajs/types").Result.Error<{
|
|
119
|
+
readonly code: import("@aeriajs/types").ACError.MalformedInput;
|
|
120
|
+
readonly details: import("@aeriajs/types").ValidationError | import("@aeriajs/types").PropertyValidationError;
|
|
121
|
+
} & {
|
|
122
|
+
httpStatus: import("@aeriajs/types").HTTPStatus.BadRequest;
|
|
123
|
+
}> | {
|
|
124
|
+
readonly _tag: "Result";
|
|
125
|
+
readonly error: undefined;
|
|
126
|
+
readonly result: {
|
|
127
|
+
readonly tempId: any;
|
|
128
|
+
};
|
|
129
|
+
}>;
|
|
111
130
|
readonly removeFile: (payload: import("@aeriajs/types").RemoveFilePayload, context: import("@aeriajs/types").StrictContext<any>) => Promise<{
|
|
112
131
|
readonly _tag: "Result";
|
|
113
132
|
readonly error: undefined;
|
|
@@ -518,7 +537,7 @@ export declare const user: {
|
|
|
518
537
|
};
|
|
519
538
|
};
|
|
520
539
|
};
|
|
521
|
-
}>) => Promise<import("
|
|
540
|
+
}>) => Promise<import("@aeriajs/types").Result.Error<{
|
|
522
541
|
readonly code: import("@aeriajs/types").ACError.AuthorizationError;
|
|
523
542
|
} & {
|
|
524
543
|
httpStatus: import("@aeriajs/types").HTTPStatus.Unauthorized;
|
|
@@ -642,11 +661,11 @@ export declare const user: {
|
|
|
642
661
|
content: string;
|
|
643
662
|
};
|
|
644
663
|
};
|
|
645
|
-
} | import("
|
|
664
|
+
} | import("@aeriajs/types").Result.Error<{
|
|
646
665
|
readonly code: import("./authenticate.js").AuthenticationError.InvalidCredentials;
|
|
647
666
|
} & {
|
|
648
667
|
httpStatus: import("@aeriajs/types").HTTPStatus.Unauthorized;
|
|
649
|
-
}> | import("
|
|
668
|
+
}> | import("@aeriajs/types").Result.Error<{
|
|
650
669
|
readonly code: import("./authenticate.js").AuthenticationError.InactiveUser;
|
|
651
670
|
} & {
|
|
652
671
|
httpStatus: import("@aeriajs/types").HTTPStatus.Unauthorized;
|
|
@@ -752,15 +771,15 @@ export declare const user: {
|
|
|
752
771
|
};
|
|
753
772
|
};
|
|
754
773
|
};
|
|
755
|
-
}>) => Promise<import("@aeriajs/types").GenericResponse | import("
|
|
774
|
+
}>) => Promise<import("@aeriajs/types").GenericResponse | import("@aeriajs/types").Result.Error<{
|
|
756
775
|
readonly code: import("./activate.js").ActivationError.InvalidLink;
|
|
757
776
|
} & {
|
|
758
777
|
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
759
|
-
}> | import("
|
|
778
|
+
}> | import("@aeriajs/types").Result.Error<{
|
|
760
779
|
readonly code: import("./activate.js").ActivationError.UserNotFound;
|
|
761
780
|
} & {
|
|
762
781
|
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
763
|
-
}> | import("
|
|
782
|
+
}> | import("@aeriajs/types").Result.Error<{
|
|
764
783
|
readonly code: import("./activate.js").ActivationError.AlreadyActiveUser;
|
|
765
784
|
} & {
|
|
766
785
|
httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
|
|
@@ -1099,9 +1118,9 @@ export declare const user: {
|
|
|
1099
1118
|
};
|
|
1100
1119
|
};
|
|
1101
1120
|
};
|
|
1102
|
-
}>) => Promise<import("
|
|
1121
|
+
}>) => Promise<import("@aeriajs/types").Result.Error<{
|
|
1103
1122
|
readonly code: import("@aeriajs/types").ACError.MalformedInput;
|
|
1104
|
-
readonly details: import("@aeriajs/types").
|
|
1123
|
+
readonly details: import("@aeriajs/types").ValidationError | import("@aeriajs/types").PropertyValidationError;
|
|
1105
1124
|
} & {
|
|
1106
1125
|
httpStatus: import("@aeriajs/types").HTTPStatus.BadRequest;
|
|
1107
1126
|
}> | {
|
|
@@ -1211,15 +1230,15 @@ export declare const user: {
|
|
|
1211
1230
|
};
|
|
1212
1231
|
};
|
|
1213
1232
|
};
|
|
1214
|
-
}>) => Promise<import("
|
|
1233
|
+
}>) => Promise<import("@aeriajs/types").Result.Error<{
|
|
1215
1234
|
readonly code: import("./getInfo.js").ActivationError.InvalidLink;
|
|
1216
1235
|
} & {
|
|
1217
1236
|
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
1218
|
-
}> | import("
|
|
1237
|
+
}> | import("@aeriajs/types").Result.Error<{
|
|
1219
1238
|
readonly code: import("./getInfo.js").ActivationError.UserNotFound;
|
|
1220
1239
|
} & {
|
|
1221
1240
|
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
1222
|
-
}> | import("
|
|
1241
|
+
}> | import("@aeriajs/types").Result.Error<{
|
|
1223
1242
|
readonly code: import("./getInfo.js").ActivationError.AlreadyActiveUser;
|
|
1224
1243
|
} & {
|
|
1225
1244
|
httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
|
|
@@ -1656,8 +1675,27 @@ export declare const user: {
|
|
|
1656
1675
|
readonly error: undefined;
|
|
1657
1676
|
readonly result: import("@aeriajs/types").SchemaWithId<any>[];
|
|
1658
1677
|
}>;
|
|
1659
|
-
readonly remove: (payload: import("@aeriajs/types").RemovePayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>) => Promise<
|
|
1660
|
-
|
|
1678
|
+
readonly remove: (payload: import("@aeriajs/types").RemovePayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>) => Promise<{
|
|
1679
|
+
readonly _tag: "Result";
|
|
1680
|
+
readonly error: undefined;
|
|
1681
|
+
readonly result: any;
|
|
1682
|
+
} | import("@aeriajs/types").Result.Error<{
|
|
1683
|
+
readonly code: import("@aeriajs/types").ACError.ResourceNotFound;
|
|
1684
|
+
} & {
|
|
1685
|
+
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
1686
|
+
}>>;
|
|
1687
|
+
readonly upload: (_props: unknown, context: import("@aeriajs/types").StrictContext<any>) => Promise<import("@aeriajs/types").Result.Error<{
|
|
1688
|
+
readonly code: import("@aeriajs/types").ACError.MalformedInput;
|
|
1689
|
+
readonly details: import("@aeriajs/types").ValidationError | import("@aeriajs/types").PropertyValidationError;
|
|
1690
|
+
} & {
|
|
1691
|
+
httpStatus: import("@aeriajs/types").HTTPStatus.BadRequest;
|
|
1692
|
+
}> | {
|
|
1693
|
+
readonly _tag: "Result";
|
|
1694
|
+
readonly error: undefined;
|
|
1695
|
+
readonly result: {
|
|
1696
|
+
readonly tempId: any;
|
|
1697
|
+
};
|
|
1698
|
+
}>;
|
|
1661
1699
|
readonly removeFile: (payload: import("@aeriajs/types").RemoveFilePayload, context: import("@aeriajs/types").StrictContext<any>) => Promise<{
|
|
1662
1700
|
readonly _tag: "Result";
|
|
1663
1701
|
readonly error: undefined;
|
|
@@ -2068,7 +2106,7 @@ export declare const user: {
|
|
|
2068
2106
|
};
|
|
2069
2107
|
};
|
|
2070
2108
|
};
|
|
2071
|
-
}>) => Promise<import("
|
|
2109
|
+
}>) => Promise<import("@aeriajs/types").Result.Error<{
|
|
2072
2110
|
readonly code: import("@aeriajs/types").ACError.AuthorizationError;
|
|
2073
2111
|
} & {
|
|
2074
2112
|
httpStatus: import("@aeriajs/types").HTTPStatus.Unauthorized;
|
|
@@ -2192,11 +2230,11 @@ export declare const user: {
|
|
|
2192
2230
|
content: string;
|
|
2193
2231
|
};
|
|
2194
2232
|
};
|
|
2195
|
-
} | import("
|
|
2233
|
+
} | import("@aeriajs/types").Result.Error<{
|
|
2196
2234
|
readonly code: import("./authenticate.js").AuthenticationError.InvalidCredentials;
|
|
2197
2235
|
} & {
|
|
2198
2236
|
httpStatus: import("@aeriajs/types").HTTPStatus.Unauthorized;
|
|
2199
|
-
}> | import("
|
|
2237
|
+
}> | import("@aeriajs/types").Result.Error<{
|
|
2200
2238
|
readonly code: import("./authenticate.js").AuthenticationError.InactiveUser;
|
|
2201
2239
|
} & {
|
|
2202
2240
|
httpStatus: import("@aeriajs/types").HTTPStatus.Unauthorized;
|
|
@@ -2302,15 +2340,15 @@ export declare const user: {
|
|
|
2302
2340
|
};
|
|
2303
2341
|
};
|
|
2304
2342
|
};
|
|
2305
|
-
}>) => Promise<import("@aeriajs/types").GenericResponse | import("
|
|
2343
|
+
}>) => Promise<import("@aeriajs/types").GenericResponse | import("@aeriajs/types").Result.Error<{
|
|
2306
2344
|
readonly code: import("./activate.js").ActivationError.InvalidLink;
|
|
2307
2345
|
} & {
|
|
2308
2346
|
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
2309
|
-
}> | import("
|
|
2347
|
+
}> | import("@aeriajs/types").Result.Error<{
|
|
2310
2348
|
readonly code: import("./activate.js").ActivationError.UserNotFound;
|
|
2311
2349
|
} & {
|
|
2312
2350
|
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
2313
|
-
}> | import("
|
|
2351
|
+
}> | import("@aeriajs/types").Result.Error<{
|
|
2314
2352
|
readonly code: import("./activate.js").ActivationError.AlreadyActiveUser;
|
|
2315
2353
|
} & {
|
|
2316
2354
|
httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
|
|
@@ -2649,9 +2687,9 @@ export declare const user: {
|
|
|
2649
2687
|
};
|
|
2650
2688
|
};
|
|
2651
2689
|
};
|
|
2652
|
-
}>) => Promise<import("
|
|
2690
|
+
}>) => Promise<import("@aeriajs/types").Result.Error<{
|
|
2653
2691
|
readonly code: import("@aeriajs/types").ACError.MalformedInput;
|
|
2654
|
-
readonly details: import("@aeriajs/types").
|
|
2692
|
+
readonly details: import("@aeriajs/types").ValidationError | import("@aeriajs/types").PropertyValidationError;
|
|
2655
2693
|
} & {
|
|
2656
2694
|
httpStatus: import("@aeriajs/types").HTTPStatus.BadRequest;
|
|
2657
2695
|
}> | {
|
|
@@ -2761,15 +2799,15 @@ export declare const user: {
|
|
|
2761
2799
|
};
|
|
2762
2800
|
};
|
|
2763
2801
|
};
|
|
2764
|
-
}>) => Promise<import("
|
|
2802
|
+
}>) => Promise<import("@aeriajs/types").Result.Error<{
|
|
2765
2803
|
readonly code: import("./getInfo.js").ActivationError.InvalidLink;
|
|
2766
2804
|
} & {
|
|
2767
2805
|
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
2768
|
-
}> | import("
|
|
2806
|
+
}> | import("@aeriajs/types").Result.Error<{
|
|
2769
2807
|
readonly code: import("./getInfo.js").ActivationError.UserNotFound;
|
|
2770
2808
|
} & {
|
|
2771
2809
|
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
2772
|
-
}> | import("
|
|
2810
|
+
}> | import("@aeriajs/types").Result.Error<{
|
|
2773
2811
|
readonly code: import("./getInfo.js").ActivationError.AlreadyActiveUser;
|
|
2774
2812
|
} & {
|
|
2775
2813
|
httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
|
|
@@ -28,7 +28,123 @@ export declare const describe: (contextOrPayload: RouteContext | Payload) => Pro
|
|
|
28
28
|
readonly result: {
|
|
29
29
|
descriptions: Record<string, Description>;
|
|
30
30
|
roles?: string[] | undefined;
|
|
31
|
-
auth?: Partial<
|
|
31
|
+
auth?: Partial<{
|
|
32
|
+
user: Pick<import("@aeriajs/types").SchemaWithId<{
|
|
33
|
+
readonly $id: "user";
|
|
34
|
+
readonly required: readonly ["name", "roles", "email"];
|
|
35
|
+
readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
|
|
36
|
+
readonly indexes: readonly ["name"];
|
|
37
|
+
readonly freshItem: {
|
|
38
|
+
readonly active: true;
|
|
39
|
+
};
|
|
40
|
+
readonly properties: {
|
|
41
|
+
readonly name: {
|
|
42
|
+
readonly type: "string";
|
|
43
|
+
};
|
|
44
|
+
readonly given_name: {
|
|
45
|
+
readonly getter: (document: any) => string;
|
|
46
|
+
};
|
|
47
|
+
readonly family_name: {
|
|
48
|
+
readonly getter: (document: any) => string;
|
|
49
|
+
};
|
|
50
|
+
readonly active: {
|
|
51
|
+
readonly type: "boolean";
|
|
52
|
+
};
|
|
53
|
+
readonly roles: {
|
|
54
|
+
readonly type: "array";
|
|
55
|
+
readonly items: {
|
|
56
|
+
readonly type: "string";
|
|
57
|
+
};
|
|
58
|
+
readonly uniqueItems: true;
|
|
59
|
+
};
|
|
60
|
+
readonly email: {
|
|
61
|
+
readonly type: "string";
|
|
62
|
+
readonly inputType: "email";
|
|
63
|
+
readonly unique: true;
|
|
64
|
+
};
|
|
65
|
+
readonly password: {
|
|
66
|
+
readonly type: "string";
|
|
67
|
+
readonly inputType: "password";
|
|
68
|
+
readonly hidden: true;
|
|
69
|
+
};
|
|
70
|
+
readonly phone_number: {
|
|
71
|
+
readonly type: "string";
|
|
72
|
+
readonly mask: "(##) #####-####";
|
|
73
|
+
};
|
|
74
|
+
readonly picture_file: {
|
|
75
|
+
readonly $ref: "file";
|
|
76
|
+
readonly accept: readonly ["image/*"];
|
|
77
|
+
};
|
|
78
|
+
readonly picture: {
|
|
79
|
+
readonly getter: (value: any) => any;
|
|
80
|
+
};
|
|
81
|
+
readonly group: {
|
|
82
|
+
readonly type: "string";
|
|
83
|
+
};
|
|
84
|
+
readonly self_registered: {
|
|
85
|
+
readonly type: "boolean";
|
|
86
|
+
readonly readOnly: true;
|
|
87
|
+
};
|
|
88
|
+
readonly updated_at: {
|
|
89
|
+
readonly type: "string";
|
|
90
|
+
readonly format: "date-time";
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
readonly presets: readonly ["crud", "view", "duplicate"];
|
|
94
|
+
readonly layout: {
|
|
95
|
+
readonly name: "grid";
|
|
96
|
+
readonly options: {
|
|
97
|
+
readonly title: "name";
|
|
98
|
+
readonly badge: "roles";
|
|
99
|
+
readonly picture: "picture_file";
|
|
100
|
+
readonly information: "email";
|
|
101
|
+
readonly active: "active";
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
readonly individualActions: {
|
|
105
|
+
readonly 'ui:spawnEdit': {
|
|
106
|
+
readonly label: "action.edit";
|
|
107
|
+
readonly icon: "pencil";
|
|
108
|
+
readonly translate: true;
|
|
109
|
+
};
|
|
110
|
+
readonly 'route:/dashboard/user/changepass': {
|
|
111
|
+
readonly label: "change_password";
|
|
112
|
+
readonly icon: "key";
|
|
113
|
+
readonly fetchItem: true;
|
|
114
|
+
readonly translate: true;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
readonly icon: "users";
|
|
118
|
+
readonly filters: readonly ["name", "roles", "email", "phone_number"];
|
|
119
|
+
readonly table: readonly ["name", "roles", "picture_file", "active", "updated_at"];
|
|
120
|
+
readonly tableMeta: readonly ["email"];
|
|
121
|
+
readonly formLayout: {
|
|
122
|
+
readonly fields: {
|
|
123
|
+
readonly given_name: {
|
|
124
|
+
readonly span: 3;
|
|
125
|
+
};
|
|
126
|
+
readonly family_name: {
|
|
127
|
+
readonly span: 3;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
}>, "name" | "roles" | "email" | "active"> & {
|
|
132
|
+
_id: import("@aeriajs/core").ObjectId | null;
|
|
133
|
+
};
|
|
134
|
+
token: import("@aeriajs/types").TokenRecipient;
|
|
135
|
+
} | {
|
|
136
|
+
user: {
|
|
137
|
+
_id: null;
|
|
138
|
+
name: string;
|
|
139
|
+
email: string;
|
|
140
|
+
roles: string[];
|
|
141
|
+
active: boolean;
|
|
142
|
+
};
|
|
143
|
+
token: {
|
|
144
|
+
type: string;
|
|
145
|
+
content: string;
|
|
146
|
+
};
|
|
147
|
+
}> | undefined;
|
|
32
148
|
router?: any;
|
|
33
149
|
};
|
|
34
150
|
}>;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.describe = void 0;
|
|
4
4
|
const core_1 = require("@aeriajs/core");
|
|
5
5
|
const entrypoint_1 = require("@aeriajs/entrypoint");
|
|
6
|
+
const types_1 = require("@aeriajs/types");
|
|
6
7
|
const common_1 = require("@aeriajs/common");
|
|
7
8
|
const authenticate_js_1 = require("../collections/user/authenticate.js");
|
|
8
9
|
const describe = async (contextOrPayload) => {
|
|
@@ -18,7 +19,7 @@ const describe = async (contextOrPayload) => {
|
|
|
18
19
|
parentContext: contextOrPayload,
|
|
19
20
|
}));
|
|
20
21
|
if (error) {
|
|
21
|
-
return
|
|
22
|
+
return types_1.Result.error(error);
|
|
22
23
|
}
|
|
23
24
|
result.auth = JSON.parse(JSON.stringify(auth));
|
|
24
25
|
}
|
|
@@ -52,7 +53,7 @@ const describe = async (contextOrPayload) => {
|
|
|
52
53
|
result.router = await (0, core_1.getEndpoints)();
|
|
53
54
|
}
|
|
54
55
|
if (props.noSerialize || !('response' in contextOrPayload)) {
|
|
55
|
-
return
|
|
56
|
+
return types_1.Result.result(result);
|
|
56
57
|
}
|
|
57
58
|
contextOrPayload.response.setHeader('content-type', 'application/bson');
|
|
58
59
|
return contextOrPayload.response.end((0, common_1.serialize)(result));
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { createContext, preloadDescription, getEndpoints } from "@aeriajs/core";
|
|
3
3
|
import { getCollections, getAvailableRoles } from "@aeriajs/entrypoint";
|
|
4
|
-
import {
|
|
4
|
+
import { Result } from "@aeriajs/types";
|
|
5
|
+
import { serialize } from "@aeriajs/common";
|
|
5
6
|
import { authenticate } from "../collections/user/authenticate.mjs";
|
|
6
7
|
export const describe = async (contextOrPayload) => {
|
|
7
8
|
const result = {};
|
package/dist/index.d.ts
CHANGED
|
@@ -266,7 +266,7 @@ export declare const collections: {
|
|
|
266
266
|
readonly ask: true;
|
|
267
267
|
};
|
|
268
268
|
};
|
|
269
|
-
}>) => Promise<import("
|
|
269
|
+
}>) => Promise<import("@aeriajs/types").Result.Error<{
|
|
270
270
|
readonly code: import("@aeriajs/types").ACError.ResourceNotFound;
|
|
271
271
|
} & {
|
|
272
272
|
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
@@ -369,7 +369,15 @@ export declare const collections: {
|
|
|
369
369
|
readonly ask: true;
|
|
370
370
|
};
|
|
371
371
|
};
|
|
372
|
-
}>) => Promise<
|
|
372
|
+
}>) => Promise<{
|
|
373
|
+
readonly _tag: "Result";
|
|
374
|
+
readonly error: undefined;
|
|
375
|
+
readonly result: any;
|
|
376
|
+
} | import("@aeriajs/types").Result.Error<{
|
|
377
|
+
readonly code: import("@aeriajs/types").ACError.ResourceNotFound;
|
|
378
|
+
} & {
|
|
379
|
+
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
380
|
+
}>>;
|
|
373
381
|
readonly removeAll: (payload: import("@aeriajs/types").RemoveAllPayload, context: import("@aeriajs/types").Context<{
|
|
374
382
|
readonly $id: "file";
|
|
375
383
|
readonly owned: "always";
|
|
@@ -419,7 +427,15 @@ export declare const collections: {
|
|
|
419
427
|
readonly ask: true;
|
|
420
428
|
};
|
|
421
429
|
};
|
|
422
|
-
}>) => Promise<
|
|
430
|
+
}>) => Promise<{
|
|
431
|
+
readonly _tag: "Result";
|
|
432
|
+
readonly error: undefined;
|
|
433
|
+
readonly result: any;
|
|
434
|
+
} | import("@aeriajs/types").Result.Error<{
|
|
435
|
+
readonly code: import("@aeriajs/types").ACError.ResourceNotFound;
|
|
436
|
+
} & {
|
|
437
|
+
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
438
|
+
}>>;
|
|
423
439
|
};
|
|
424
440
|
exposedFunctions: {
|
|
425
441
|
readonly get: "unauthenticated";
|
|
@@ -736,7 +752,7 @@ export declare const collections: {
|
|
|
736
752
|
readonly ask: true;
|
|
737
753
|
};
|
|
738
754
|
};
|
|
739
|
-
}>) => Promise<import("
|
|
755
|
+
}>) => Promise<import("@aeriajs/types").Result.Error<{
|
|
740
756
|
readonly code: import("@aeriajs/types").ACError.ResourceNotFound;
|
|
741
757
|
} & {
|
|
742
758
|
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
@@ -839,7 +855,15 @@ export declare const collections: {
|
|
|
839
855
|
readonly ask: true;
|
|
840
856
|
};
|
|
841
857
|
};
|
|
842
|
-
}>) => Promise<
|
|
858
|
+
}>) => Promise<{
|
|
859
|
+
readonly _tag: "Result";
|
|
860
|
+
readonly error: undefined;
|
|
861
|
+
readonly result: any;
|
|
862
|
+
} | import("@aeriajs/types").Result.Error<{
|
|
863
|
+
readonly code: import("@aeriajs/types").ACError.ResourceNotFound;
|
|
864
|
+
} & {
|
|
865
|
+
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
866
|
+
}>>;
|
|
843
867
|
readonly removeAll: (payload: import("@aeriajs/types").RemoveAllPayload, context: import("@aeriajs/types").Context<{
|
|
844
868
|
readonly $id: "file";
|
|
845
869
|
readonly owned: "always";
|
|
@@ -889,7 +913,15 @@ export declare const collections: {
|
|
|
889
913
|
readonly ask: true;
|
|
890
914
|
};
|
|
891
915
|
};
|
|
892
|
-
}>) => Promise<
|
|
916
|
+
}>) => Promise<{
|
|
917
|
+
readonly _tag: "Result";
|
|
918
|
+
readonly error: undefined;
|
|
919
|
+
readonly result: any;
|
|
920
|
+
} | import("@aeriajs/types").Result.Error<{
|
|
921
|
+
readonly code: import("@aeriajs/types").ACError.ResourceNotFound;
|
|
922
|
+
} & {
|
|
923
|
+
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
924
|
+
}>>;
|
|
893
925
|
};
|
|
894
926
|
contracts: {
|
|
895
927
|
readonly get?: import("@aeriajs/types").Contract | undefined;
|
|
@@ -1319,8 +1351,27 @@ export declare const collections: {
|
|
|
1319
1351
|
readonly error: undefined;
|
|
1320
1352
|
readonly result: import("@aeriajs/types").SchemaWithId<any>[];
|
|
1321
1353
|
}>;
|
|
1322
|
-
readonly remove: (payload: import("@aeriajs/types").RemovePayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>) => Promise<
|
|
1323
|
-
|
|
1354
|
+
readonly remove: (payload: import("@aeriajs/types").RemovePayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>) => Promise<{
|
|
1355
|
+
readonly _tag: "Result";
|
|
1356
|
+
readonly error: undefined;
|
|
1357
|
+
readonly result: any;
|
|
1358
|
+
} | import("@aeriajs/types").Result.Error<{
|
|
1359
|
+
readonly code: import("@aeriajs/types").ACError.ResourceNotFound;
|
|
1360
|
+
} & {
|
|
1361
|
+
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
1362
|
+
}>>;
|
|
1363
|
+
readonly upload: (_props: unknown, context: import("@aeriajs/types").StrictContext<any>) => Promise<import("@aeriajs/types").Result.Error<{
|
|
1364
|
+
readonly code: import("@aeriajs/types").ACError.MalformedInput;
|
|
1365
|
+
readonly details: import("@aeriajs/types").ValidationError | import("@aeriajs/types").PropertyValidationError;
|
|
1366
|
+
} & {
|
|
1367
|
+
httpStatus: import("@aeriajs/types").HTTPStatus.BadRequest;
|
|
1368
|
+
}> | {
|
|
1369
|
+
readonly _tag: "Result";
|
|
1370
|
+
readonly error: undefined;
|
|
1371
|
+
readonly result: {
|
|
1372
|
+
readonly tempId: any;
|
|
1373
|
+
};
|
|
1374
|
+
}>;
|
|
1324
1375
|
readonly removeFile: (payload: import("@aeriajs/types").RemoveFilePayload, context: import("@aeriajs/types").StrictContext<any>) => Promise<{
|
|
1325
1376
|
readonly _tag: "Result";
|
|
1326
1377
|
readonly error: undefined;
|
|
@@ -1731,7 +1782,7 @@ export declare const collections: {
|
|
|
1731
1782
|
};
|
|
1732
1783
|
};
|
|
1733
1784
|
};
|
|
1734
|
-
}>) => Promise<import("
|
|
1785
|
+
}>) => Promise<import("@aeriajs/types").Result.Error<{
|
|
1735
1786
|
readonly code: import("@aeriajs/types").ACError.AuthorizationError;
|
|
1736
1787
|
} & {
|
|
1737
1788
|
httpStatus: import("@aeriajs/types").HTTPStatus.Unauthorized;
|
|
@@ -1855,11 +1906,11 @@ export declare const collections: {
|
|
|
1855
1906
|
content: string;
|
|
1856
1907
|
};
|
|
1857
1908
|
};
|
|
1858
|
-
} | import("
|
|
1909
|
+
} | import("@aeriajs/types").Result.Error<{
|
|
1859
1910
|
readonly code: import("./collections/user/authenticate.js").AuthenticationError.InvalidCredentials;
|
|
1860
1911
|
} & {
|
|
1861
1912
|
httpStatus: import("@aeriajs/types").HTTPStatus.Unauthorized;
|
|
1862
|
-
}> | import("
|
|
1913
|
+
}> | import("@aeriajs/types").Result.Error<{
|
|
1863
1914
|
readonly code: import("./collections/user/authenticate.js").AuthenticationError.InactiveUser;
|
|
1864
1915
|
} & {
|
|
1865
1916
|
httpStatus: import("@aeriajs/types").HTTPStatus.Unauthorized;
|
|
@@ -1965,15 +2016,15 @@ export declare const collections: {
|
|
|
1965
2016
|
};
|
|
1966
2017
|
};
|
|
1967
2018
|
};
|
|
1968
|
-
}>) => Promise<import("@aeriajs/types").GenericResponse | import("
|
|
2019
|
+
}>) => Promise<import("@aeriajs/types").GenericResponse | import("@aeriajs/types").Result.Error<{
|
|
1969
2020
|
readonly code: import("./collections/user/activate.js").ActivationError.InvalidLink;
|
|
1970
2021
|
} & {
|
|
1971
2022
|
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
1972
|
-
}> | import("
|
|
2023
|
+
}> | import("@aeriajs/types").Result.Error<{
|
|
1973
2024
|
readonly code: import("./collections/user/activate.js").ActivationError.UserNotFound;
|
|
1974
2025
|
} & {
|
|
1975
2026
|
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
1976
|
-
}> | import("
|
|
2027
|
+
}> | import("@aeriajs/types").Result.Error<{
|
|
1977
2028
|
readonly code: import("./collections/user/activate.js").ActivationError.AlreadyActiveUser;
|
|
1978
2029
|
} & {
|
|
1979
2030
|
httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
|
|
@@ -2312,9 +2363,9 @@ export declare const collections: {
|
|
|
2312
2363
|
};
|
|
2313
2364
|
};
|
|
2314
2365
|
};
|
|
2315
|
-
}>) => Promise<import("
|
|
2366
|
+
}>) => Promise<import("@aeriajs/types").Result.Error<{
|
|
2316
2367
|
readonly code: import("@aeriajs/types").ACError.MalformedInput;
|
|
2317
|
-
readonly details: import("@aeriajs/types").
|
|
2368
|
+
readonly details: import("@aeriajs/types").ValidationError | import("@aeriajs/types").PropertyValidationError;
|
|
2318
2369
|
} & {
|
|
2319
2370
|
httpStatus: import("@aeriajs/types").HTTPStatus.BadRequest;
|
|
2320
2371
|
}> | {
|
|
@@ -2424,15 +2475,15 @@ export declare const collections: {
|
|
|
2424
2475
|
};
|
|
2425
2476
|
};
|
|
2426
2477
|
};
|
|
2427
|
-
}>) => Promise<import("
|
|
2478
|
+
}>) => Promise<import("@aeriajs/types").Result.Error<{
|
|
2428
2479
|
readonly code: import("./collections/user/getInfo.js").ActivationError.InvalidLink;
|
|
2429
2480
|
} & {
|
|
2430
2481
|
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
2431
|
-
}> | import("
|
|
2482
|
+
}> | import("@aeriajs/types").Result.Error<{
|
|
2432
2483
|
readonly code: import("./collections/user/getInfo.js").ActivationError.UserNotFound;
|
|
2433
2484
|
} & {
|
|
2434
2485
|
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
2435
|
-
}> | import("
|
|
2486
|
+
}> | import("@aeriajs/types").Result.Error<{
|
|
2436
2487
|
readonly code: import("./collections/user/getInfo.js").ActivationError.AlreadyActiveUser;
|
|
2437
2488
|
} & {
|
|
2438
2489
|
httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
|
|
@@ -2869,8 +2920,27 @@ export declare const collections: {
|
|
|
2869
2920
|
readonly error: undefined;
|
|
2870
2921
|
readonly result: import("@aeriajs/types").SchemaWithId<any>[];
|
|
2871
2922
|
}>;
|
|
2872
|
-
readonly remove: (payload: import("@aeriajs/types").RemovePayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>) => Promise<
|
|
2873
|
-
|
|
2923
|
+
readonly remove: (payload: import("@aeriajs/types").RemovePayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>) => Promise<{
|
|
2924
|
+
readonly _tag: "Result";
|
|
2925
|
+
readonly error: undefined;
|
|
2926
|
+
readonly result: any;
|
|
2927
|
+
} | import("@aeriajs/types").Result.Error<{
|
|
2928
|
+
readonly code: import("@aeriajs/types").ACError.ResourceNotFound;
|
|
2929
|
+
} & {
|
|
2930
|
+
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
2931
|
+
}>>;
|
|
2932
|
+
readonly upload: (_props: unknown, context: import("@aeriajs/types").StrictContext<any>) => Promise<import("@aeriajs/types").Result.Error<{
|
|
2933
|
+
readonly code: import("@aeriajs/types").ACError.MalformedInput;
|
|
2934
|
+
readonly details: import("@aeriajs/types").ValidationError | import("@aeriajs/types").PropertyValidationError;
|
|
2935
|
+
} & {
|
|
2936
|
+
httpStatus: import("@aeriajs/types").HTTPStatus.BadRequest;
|
|
2937
|
+
}> | {
|
|
2938
|
+
readonly _tag: "Result";
|
|
2939
|
+
readonly error: undefined;
|
|
2940
|
+
readonly result: {
|
|
2941
|
+
readonly tempId: any;
|
|
2942
|
+
};
|
|
2943
|
+
}>;
|
|
2874
2944
|
readonly removeFile: (payload: import("@aeriajs/types").RemoveFilePayload, context: import("@aeriajs/types").StrictContext<any>) => Promise<{
|
|
2875
2945
|
readonly _tag: "Result";
|
|
2876
2946
|
readonly error: undefined;
|
|
@@ -3281,7 +3351,7 @@ export declare const collections: {
|
|
|
3281
3351
|
};
|
|
3282
3352
|
};
|
|
3283
3353
|
};
|
|
3284
|
-
}>) => Promise<import("
|
|
3354
|
+
}>) => Promise<import("@aeriajs/types").Result.Error<{
|
|
3285
3355
|
readonly code: import("@aeriajs/types").ACError.AuthorizationError;
|
|
3286
3356
|
} & {
|
|
3287
3357
|
httpStatus: import("@aeriajs/types").HTTPStatus.Unauthorized;
|
|
@@ -3405,11 +3475,11 @@ export declare const collections: {
|
|
|
3405
3475
|
content: string;
|
|
3406
3476
|
};
|
|
3407
3477
|
};
|
|
3408
|
-
} | import("
|
|
3478
|
+
} | import("@aeriajs/types").Result.Error<{
|
|
3409
3479
|
readonly code: import("./collections/user/authenticate.js").AuthenticationError.InvalidCredentials;
|
|
3410
3480
|
} & {
|
|
3411
3481
|
httpStatus: import("@aeriajs/types").HTTPStatus.Unauthorized;
|
|
3412
|
-
}> | import("
|
|
3482
|
+
}> | import("@aeriajs/types").Result.Error<{
|
|
3413
3483
|
readonly code: import("./collections/user/authenticate.js").AuthenticationError.InactiveUser;
|
|
3414
3484
|
} & {
|
|
3415
3485
|
httpStatus: import("@aeriajs/types").HTTPStatus.Unauthorized;
|
|
@@ -3515,15 +3585,15 @@ export declare const collections: {
|
|
|
3515
3585
|
};
|
|
3516
3586
|
};
|
|
3517
3587
|
};
|
|
3518
|
-
}>) => Promise<import("@aeriajs/types").GenericResponse | import("
|
|
3588
|
+
}>) => Promise<import("@aeriajs/types").GenericResponse | import("@aeriajs/types").Result.Error<{
|
|
3519
3589
|
readonly code: import("./collections/user/activate.js").ActivationError.InvalidLink;
|
|
3520
3590
|
} & {
|
|
3521
3591
|
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
3522
|
-
}> | import("
|
|
3592
|
+
}> | import("@aeriajs/types").Result.Error<{
|
|
3523
3593
|
readonly code: import("./collections/user/activate.js").ActivationError.UserNotFound;
|
|
3524
3594
|
} & {
|
|
3525
3595
|
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
3526
|
-
}> | import("
|
|
3596
|
+
}> | import("@aeriajs/types").Result.Error<{
|
|
3527
3597
|
readonly code: import("./collections/user/activate.js").ActivationError.AlreadyActiveUser;
|
|
3528
3598
|
} & {
|
|
3529
3599
|
httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
|
|
@@ -3862,9 +3932,9 @@ export declare const collections: {
|
|
|
3862
3932
|
};
|
|
3863
3933
|
};
|
|
3864
3934
|
};
|
|
3865
|
-
}>) => Promise<import("
|
|
3935
|
+
}>) => Promise<import("@aeriajs/types").Result.Error<{
|
|
3866
3936
|
readonly code: import("@aeriajs/types").ACError.MalformedInput;
|
|
3867
|
-
readonly details: import("@aeriajs/types").
|
|
3937
|
+
readonly details: import("@aeriajs/types").ValidationError | import("@aeriajs/types").PropertyValidationError;
|
|
3868
3938
|
} & {
|
|
3869
3939
|
httpStatus: import("@aeriajs/types").HTTPStatus.BadRequest;
|
|
3870
3940
|
}> | {
|
|
@@ -3974,15 +4044,15 @@ export declare const collections: {
|
|
|
3974
4044
|
};
|
|
3975
4045
|
};
|
|
3976
4046
|
};
|
|
3977
|
-
}>) => Promise<import("
|
|
4047
|
+
}>) => Promise<import("@aeriajs/types").Result.Error<{
|
|
3978
4048
|
readonly code: import("./collections/user/getInfo.js").ActivationError.InvalidLink;
|
|
3979
4049
|
} & {
|
|
3980
4050
|
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
3981
|
-
}> | import("
|
|
4051
|
+
}> | import("@aeriajs/types").Result.Error<{
|
|
3982
4052
|
readonly code: import("./collections/user/getInfo.js").ActivationError.UserNotFound;
|
|
3983
4053
|
} & {
|
|
3984
4054
|
httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
|
|
3985
|
-
}> | import("
|
|
4055
|
+
}> | import("@aeriajs/types").Result.Error<{
|
|
3986
4056
|
readonly code: import("./collections/user/getInfo.js").ActivationError.AlreadyActiveUser;
|
|
3987
4057
|
} & {
|
|
3988
4058
|
httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeriajs/builtins",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.110",
|
|
4
4
|
"description": "## Installation",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -45,11 +45,11 @@
|
|
|
45
45
|
"mongodb": "^6.5.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@aeriajs/core": "^0.0.
|
|
49
|
-
"@aeriajs/common": "^0.0.
|
|
50
|
-
"@aeriajs/entrypoint": "^0.0.
|
|
51
|
-
"@aeriajs/types": "^0.0.
|
|
52
|
-
"@aeriajs/validation": "^0.0.
|
|
48
|
+
"@aeriajs/core": "^0.0.110",
|
|
49
|
+
"@aeriajs/common": "^0.0.69",
|
|
50
|
+
"@aeriajs/entrypoint": "^0.0.71",
|
|
51
|
+
"@aeriajs/types": "^0.0.61",
|
|
52
|
+
"@aeriajs/validation": "^0.0.72"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"test": "echo skipping",
|