@aeriajs/builtins 0.0.230 → 0.0.232
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/authentication.d.ts +4 -4
- package/dist/authentication.js +4 -5
- package/dist/authentication.mjs +4 -5
- package/dist/collections/file/download.d.ts +7 -8
- package/dist/collections/file/download.js +4 -5
- package/dist/collections/file/download.mjs +4 -5
- package/dist/collections/file/index.d.ts +18 -18
- package/dist/collections/file/remove.d.ts +12 -12
- package/dist/collections/file/removeAll.d.ts +2 -2
- package/dist/collections/user/activate.d.ts +17 -17
- package/dist/collections/user/activate.js +10 -11
- package/dist/collections/user/activate.mjs +10 -11
- package/dist/collections/user/authenticate.d.ts +7 -8
- package/dist/collections/user/createAccount.d.ts +9 -10
- package/dist/collections/user/createAccount.js +5 -6
- package/dist/collections/user/createAccount.mjs +5 -6
- package/dist/collections/user/editProfile.d.ts +3 -3
- package/dist/collections/user/getActivationLink.d.ts +13 -14
- package/dist/collections/user/getCurrentUser.d.ts +5 -5
- package/dist/collections/user/getCurrentUser.js +5 -6
- package/dist/collections/user/getCurrentUser.mjs +5 -6
- package/dist/collections/user/getInfo.d.ts +13 -13
- package/dist/collections/user/getInfo.js +9 -10
- package/dist/collections/user/getInfo.mjs +9 -10
- package/dist/collections/user/getRedefinePasswordLink.d.ts +11 -12
- package/dist/collections/user/index.d.ts +79 -79
- package/dist/collections/user/insert.d.ts +9 -10
- package/dist/collections/user/insert.js +21 -19
- package/dist/collections/user/insert.mjs +21 -19
- package/dist/collections/user/redefinePassword.d.ts +17 -17
- package/dist/collections/user/redefinePassword.js +10 -11
- package/dist/collections/user/redefinePassword.mjs +10 -11
- package/dist/functions/describe.d.ts +9 -9
- package/dist/index.d.ts +97 -97
- package/package.json +17 -17
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
import { decodeToken, ObjectId } from "@aeriajs/core";
|
|
3
3
|
import { Result, ACError, HTTPStatus } from "@aeriajs/types";
|
|
4
4
|
import * as bcrypt from "bcrypt";
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
})(ActivationError || {});
|
|
5
|
+
export const ActivationError = {
|
|
6
|
+
UserNotFound: "USER_NOT_FOUND",
|
|
7
|
+
UserNotActive: "USER_NOT_ACTIVE",
|
|
8
|
+
InvalidLink: "INVALID_LINK",
|
|
9
|
+
InvalidToken: "INVALID_TOKEN"
|
|
10
|
+
};
|
|
12
11
|
export const redefinePassword = async (payload, context) => {
|
|
13
12
|
const {
|
|
14
13
|
userId,
|
|
@@ -20,7 +19,7 @@ export const redefinePassword = async (payload, context) => {
|
|
|
20
19
|
}
|
|
21
20
|
if (!userId || !token) {
|
|
22
21
|
return context.error(HTTPStatus.NotFound, {
|
|
23
|
-
code:
|
|
22
|
+
code: ActivationError.InvalidLink
|
|
24
23
|
});
|
|
25
24
|
}
|
|
26
25
|
const user = await context.collection.model.findOne({
|
|
@@ -33,18 +32,18 @@ export const redefinePassword = async (payload, context) => {
|
|
|
33
32
|
});
|
|
34
33
|
if (!user) {
|
|
35
34
|
return context.error(HTTPStatus.NotFound, {
|
|
36
|
-
code:
|
|
35
|
+
code: ActivationError.UserNotFound
|
|
37
36
|
});
|
|
38
37
|
}
|
|
39
38
|
if (!user.active) {
|
|
40
39
|
return context.error(HTTPStatus.Forbidden, {
|
|
41
|
-
code:
|
|
40
|
+
code: ActivationError.UserNotActive
|
|
42
41
|
});
|
|
43
42
|
}
|
|
44
43
|
const decoded = await decodeToken(token, context.config.secret);
|
|
45
44
|
if (!decoded) {
|
|
46
45
|
return context.error(HTTPStatus.Unauthorized, {
|
|
47
|
-
code:
|
|
46
|
+
code: ActivationError.InvalidToken
|
|
48
47
|
});
|
|
49
48
|
}
|
|
50
49
|
if (!password) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Description, RouteContext, RolesHierarchy, UserRole } from '@aeriajs/types';
|
|
2
|
-
import { Result
|
|
2
|
+
import { Result } from '@aeriajs/types';
|
|
3
3
|
import { authenticate } from '../collections/user/authenticate.js';
|
|
4
4
|
declare const Payload: Partial<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
5
5
|
readonly collections: {
|
|
@@ -30,25 +30,25 @@ declare const Payload: Partial<{} & Omit<Readonly<import("@aeriajs/types").Filte
|
|
|
30
30
|
export declare const describe: (contextOrPayload: RouteContext | typeof Payload) => Promise<import("@aeriajs/types").GenericResponse | {
|
|
31
31
|
readonly _tag: "Error";
|
|
32
32
|
readonly error: {
|
|
33
|
-
readonly httpStatus:
|
|
34
|
-
readonly code:
|
|
33
|
+
readonly httpStatus: 422;
|
|
34
|
+
readonly code: "MALFORMED_INPUT";
|
|
35
35
|
readonly details: import("@aeriajs/types").PropertyValidationError | import("@aeriajs/types").ValidationError;
|
|
36
36
|
};
|
|
37
37
|
readonly result: undefined;
|
|
38
38
|
} | {
|
|
39
39
|
readonly _tag: "Error";
|
|
40
40
|
readonly error: ({
|
|
41
|
-
readonly code:
|
|
41
|
+
readonly code: "AUTHORIZATION_ERROR";
|
|
42
42
|
} & {
|
|
43
|
-
httpStatus:
|
|
43
|
+
httpStatus: 401;
|
|
44
44
|
}) | ({
|
|
45
|
-
readonly code:
|
|
45
|
+
readonly code: "INVALID_CREDENTIALS";
|
|
46
46
|
} & {
|
|
47
|
-
httpStatus:
|
|
47
|
+
httpStatus: 401;
|
|
48
48
|
}) | ({
|
|
49
|
-
readonly code:
|
|
49
|
+
readonly code: "INACTIVE_USER";
|
|
50
50
|
} & {
|
|
51
|
-
httpStatus:
|
|
51
|
+
httpStatus: 401;
|
|
52
52
|
});
|
|
53
53
|
readonly result: undefined;
|
|
54
54
|
} | {
|
package/dist/index.d.ts
CHANGED
|
@@ -174,34 +174,34 @@ export declare const collections: {
|
|
|
174
174
|
options: readonly ("picture" | "download")[];
|
|
175
175
|
noHeaders?: boolean;
|
|
176
176
|
}, context: import("@aeriajs/types").Context<typeof import("./collections/file/description.js").description>) => Promise<import("@aeriajs/types").Result.Error<{
|
|
177
|
-
readonly code:
|
|
177
|
+
readonly code: "RESOURCE_NOT_FOUND";
|
|
178
178
|
} & {
|
|
179
|
-
httpStatus:
|
|
179
|
+
httpStatus: 404;
|
|
180
180
|
}> | import("@aeriajs/types").Result.Error<{
|
|
181
|
-
readonly code:
|
|
181
|
+
readonly code: "RANGE_NOT_SATISFIABLE";
|
|
182
182
|
} & {
|
|
183
|
-
httpStatus:
|
|
183
|
+
httpStatus: 416;
|
|
184
184
|
}> | import("fs").ReadStream>;
|
|
185
185
|
remove: (payload: import("@aeriajs/types").RemovePayload<import("@aeriajs/types").SchemaWithId<typeof import("./collections/file/description.js").description>>, context: import("@aeriajs/types").Context<typeof import("./collections/file/description.js").description>) => Promise<{
|
|
186
186
|
readonly _tag: "Result";
|
|
187
187
|
readonly error: undefined;
|
|
188
188
|
readonly result: import("mongodb").WithId<Omit<import("@aeriajs/types").PackReferences<import("@aeriajs/types").SchemaWithId<import("@aeriajs/types").Description>>, "_id">> | null;
|
|
189
189
|
} | import("@aeriajs/types").Result.Error<{
|
|
190
|
-
readonly code:
|
|
190
|
+
readonly code: "RESOURCE_NOT_FOUND";
|
|
191
191
|
} & {
|
|
192
|
-
httpStatus:
|
|
192
|
+
httpStatus: 404;
|
|
193
193
|
}> | import("@aeriajs/types").Result.Error<{
|
|
194
|
-
readonly code:
|
|
194
|
+
readonly code: "OWNERSHIP_ERROR";
|
|
195
195
|
} & {
|
|
196
|
-
httpStatus:
|
|
196
|
+
httpStatus: 403;
|
|
197
197
|
}> | {
|
|
198
198
|
readonly _tag: "Error";
|
|
199
199
|
readonly error: Pick<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
200
200
|
readonly httpStatus: {
|
|
201
|
-
readonly enum: [
|
|
201
|
+
readonly enum: [403, 404, 400];
|
|
202
202
|
};
|
|
203
203
|
readonly code: {
|
|
204
|
-
readonly enum: [
|
|
204
|
+
readonly enum: ["RESOURCE_NOT_FOUND", "OWNERSHIP_ERROR", "INSECURE_OPERATOR", "MALFORMED_INPUT"];
|
|
205
205
|
};
|
|
206
206
|
readonly message: {
|
|
207
207
|
readonly type: "string";
|
|
@@ -211,16 +211,16 @@ export declare const collections: {
|
|
|
211
211
|
readonly additionalProperties: true;
|
|
212
212
|
};
|
|
213
213
|
}>> & {
|
|
214
|
-
code:
|
|
215
|
-
httpStatus:
|
|
214
|
+
code: "RESOURCE_NOT_FOUND" | "INSECURE_OPERATOR" | "OWNERSHIP_ERROR" | "MALFORMED_INPUT";
|
|
215
|
+
httpStatus: 403 | 400 | 404;
|
|
216
216
|
message: string;
|
|
217
217
|
details: any;
|
|
218
218
|
}, never>, "code" | "httpStatus"> & Partial<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
219
219
|
readonly httpStatus: {
|
|
220
|
-
readonly enum: [
|
|
220
|
+
readonly enum: [403, 404, 400];
|
|
221
221
|
};
|
|
222
222
|
readonly code: {
|
|
223
|
-
readonly enum: [
|
|
223
|
+
readonly enum: ["RESOURCE_NOT_FOUND", "OWNERSHIP_ERROR", "INSECURE_OPERATOR", "MALFORMED_INPUT"];
|
|
224
224
|
};
|
|
225
225
|
readonly message: {
|
|
226
226
|
readonly type: "string";
|
|
@@ -230,8 +230,8 @@ export declare const collections: {
|
|
|
230
230
|
readonly additionalProperties: true;
|
|
231
231
|
};
|
|
232
232
|
}>> & {
|
|
233
|
-
code:
|
|
234
|
-
httpStatus:
|
|
233
|
+
code: "RESOURCE_NOT_FOUND" | "INSECURE_OPERATOR" | "OWNERSHIP_ERROR" | "MALFORMED_INPUT";
|
|
234
|
+
httpStatus: 403 | 400 | 404;
|
|
235
235
|
message: string;
|
|
236
236
|
details: any;
|
|
237
237
|
}, never>>;
|
|
@@ -242,9 +242,9 @@ export declare const collections: {
|
|
|
242
242
|
readonly error: undefined;
|
|
243
243
|
readonly result: import("mongodb").DeleteResult;
|
|
244
244
|
} | import("@aeriajs/types").Result.Error<{
|
|
245
|
-
readonly code:
|
|
245
|
+
readonly code: "OWNERSHIP_ERROR";
|
|
246
246
|
} & {
|
|
247
|
-
httpStatus:
|
|
247
|
+
httpStatus: 403;
|
|
248
248
|
}>>;
|
|
249
249
|
};
|
|
250
250
|
contracts: {
|
|
@@ -682,19 +682,19 @@ export declare const collections: {
|
|
|
682
682
|
readonly error: undefined;
|
|
683
683
|
readonly result: import("mongodb").WithId<Omit<import("@aeriajs/types").PackReferences<import("@aeriajs/types").SchemaWithId<import("@aeriajs/types").Description>>, "_id">> | null;
|
|
684
684
|
} | import("@aeriajs/types").Result.Error<{
|
|
685
|
-
readonly code:
|
|
685
|
+
readonly code: "RESOURCE_NOT_FOUND";
|
|
686
686
|
} & {
|
|
687
|
-
httpStatus:
|
|
687
|
+
httpStatus: 404;
|
|
688
688
|
}> | import("@aeriajs/types").Result.Error<{
|
|
689
|
-
readonly code:
|
|
689
|
+
readonly code: "OWNERSHIP_ERROR";
|
|
690
690
|
} & {
|
|
691
|
-
httpStatus:
|
|
691
|
+
httpStatus: 403;
|
|
692
692
|
}>>;
|
|
693
693
|
readonly upload: (payload: unknown, context: Omit<import("@aeriajs/types").Context, "token">) => Promise<import("@aeriajs/types").Result.Error<{
|
|
694
|
-
readonly code:
|
|
694
|
+
readonly code: "MALFORMED_INPUT";
|
|
695
695
|
readonly details: import("@aeriajs/types").ValidationError | import("@aeriajs/types").PropertyValidationError;
|
|
696
696
|
} & {
|
|
697
|
-
httpStatus:
|
|
697
|
+
httpStatus: 400;
|
|
698
698
|
}> | {
|
|
699
699
|
readonly _tag: "Result";
|
|
700
700
|
readonly error: undefined;
|
|
@@ -707,29 +707,29 @@ export declare const collections: {
|
|
|
707
707
|
readonly error: undefined;
|
|
708
708
|
readonly result: any;
|
|
709
709
|
} | import("@aeriajs/types").Result.Error<{
|
|
710
|
-
readonly code:
|
|
710
|
+
readonly code: "OWNERSHIP_ERROR";
|
|
711
711
|
} & {
|
|
712
|
-
httpStatus:
|
|
712
|
+
httpStatus: 403;
|
|
713
713
|
}>>;
|
|
714
714
|
readonly insert: (payload: NoInfer<import("@aeriajs/types").InsertPayload<import("@aeriajs/types").SchemaWithId<import("@aeriajs/types").Description>>>, context: Omit<import("@aeriajs/types").Context, "token">) => Promise<import("@aeriajs/types").Result.Error<{
|
|
715
|
-
readonly code:
|
|
715
|
+
readonly code: "AUTHORIZATION_ERROR";
|
|
716
716
|
readonly message: "user is not allowed to edit other users roles";
|
|
717
717
|
} & {
|
|
718
|
-
httpStatus:
|
|
718
|
+
httpStatus: 403;
|
|
719
719
|
}> | import("@aeriajs/types").Result.Error<{
|
|
720
|
-
readonly code:
|
|
720
|
+
readonly code: "AUTHORIZATION_ERROR";
|
|
721
721
|
readonly message: "tried to set unallowed roles";
|
|
722
722
|
} & {
|
|
723
|
-
httpStatus:
|
|
723
|
+
httpStatus: 403;
|
|
724
724
|
}> | import("@aeriajs/types").Result.Error<{
|
|
725
|
-
readonly code:
|
|
725
|
+
readonly code: "RESOURCE_NOT_FOUND";
|
|
726
726
|
} & {
|
|
727
|
-
httpStatus:
|
|
727
|
+
httpStatus: 404;
|
|
728
728
|
}> | import("@aeriajs/types").Result.Error<{
|
|
729
|
-
readonly code:
|
|
730
|
-
readonly message: "tried to edit an user with a
|
|
729
|
+
readonly code: "AUTHORIZATION_ERROR";
|
|
730
|
+
readonly message: "tried to edit an user with a role higher in the hierarchy";
|
|
731
731
|
} & {
|
|
732
|
-
httpStatus:
|
|
732
|
+
httpStatus: 403;
|
|
733
733
|
}> | import("@aeriajs/types").InsertReturnType<import("@aeriajs/types").SchemaWithId<import("@aeriajs/types").Description>>>;
|
|
734
734
|
readonly editProfile: (payload: Partial<import("@aeriajs/types").PackReferences<import("@aeriajs/types").SchemaWithId<{
|
|
735
735
|
readonly $id: "user";
|
|
@@ -940,9 +940,9 @@ export declare const collections: {
|
|
|
940
940
|
};
|
|
941
941
|
};
|
|
942
942
|
}>> | import("@aeriajs/types").Result.Error<{
|
|
943
|
-
readonly code:
|
|
943
|
+
readonly code: "TARGET_IMMUTABLE";
|
|
944
944
|
} & {
|
|
945
|
-
httpStatus:
|
|
945
|
+
httpStatus: 403;
|
|
946
946
|
}>>;
|
|
947
947
|
readonly authenticate: (payload: {
|
|
948
948
|
email: string;
|
|
@@ -951,9 +951,9 @@ export declare const collections: {
|
|
|
951
951
|
token?: import("@aeriajs/types").TokenRecipient;
|
|
952
952
|
revalidate: true;
|
|
953
953
|
}, context: Omit<import("@aeriajs/types").Context, "token">) => Promise<import("@aeriajs/types").Result.Error<{
|
|
954
|
-
readonly code:
|
|
954
|
+
readonly code: "AUTHORIZATION_ERROR";
|
|
955
955
|
} & {
|
|
956
|
-
httpStatus:
|
|
956
|
+
httpStatus: 401;
|
|
957
957
|
}> | {
|
|
958
958
|
readonly _tag: "Result";
|
|
959
959
|
readonly error: undefined;
|
|
@@ -975,38 +975,38 @@ export declare const collections: {
|
|
|
975
975
|
readonly error: undefined;
|
|
976
976
|
readonly result: import("./authentication.js").SuccessfulAuthentication;
|
|
977
977
|
} | import("@aeriajs/types").Result.Error<{
|
|
978
|
-
readonly code:
|
|
978
|
+
readonly code: "INVALID_CREDENTIALS";
|
|
979
979
|
} & {
|
|
980
|
-
httpStatus:
|
|
980
|
+
httpStatus: 401;
|
|
981
981
|
}> | import("@aeriajs/types").Result.Error<{
|
|
982
|
-
readonly code:
|
|
982
|
+
readonly code: "INACTIVE_USER";
|
|
983
983
|
} & {
|
|
984
|
-
httpStatus:
|
|
984
|
+
httpStatus: 401;
|
|
985
985
|
}>>;
|
|
986
986
|
readonly activate: (payload: {
|
|
987
987
|
password?: string;
|
|
988
988
|
userId?: string;
|
|
989
989
|
token?: string;
|
|
990
990
|
}, context: Omit<import("@aeriajs/types").Context, "token">) => Promise<import("@aeriajs/types").Result.Error<{
|
|
991
|
-
readonly code:
|
|
991
|
+
readonly code: "INVALID_LINK";
|
|
992
992
|
} & {
|
|
993
|
-
httpStatus:
|
|
993
|
+
httpStatus: 404;
|
|
994
994
|
}> | import("@aeriajs/types").Result.Error<{
|
|
995
|
-
readonly code:
|
|
995
|
+
readonly code: "USER_NOT_FOUND";
|
|
996
996
|
} & {
|
|
997
|
-
httpStatus:
|
|
997
|
+
httpStatus: 404;
|
|
998
998
|
}> | import("@aeriajs/types").Result.Error<{
|
|
999
|
-
readonly code:
|
|
999
|
+
readonly code: "ALREADY_ACTIVE_USER";
|
|
1000
1000
|
} & {
|
|
1001
|
-
httpStatus:
|
|
1001
|
+
httpStatus: 403;
|
|
1002
1002
|
}> | import("@aeriajs/types").Result.Error<{
|
|
1003
|
-
readonly code:
|
|
1003
|
+
readonly code: "INVALID_TOKEN";
|
|
1004
1004
|
} & {
|
|
1005
|
-
httpStatus:
|
|
1005
|
+
httpStatus: 401;
|
|
1006
1006
|
}> | import("@aeriajs/types").Result.Error<{
|
|
1007
|
-
readonly code:
|
|
1007
|
+
readonly code: "MALFORMED_INPUT";
|
|
1008
1008
|
} & {
|
|
1009
|
-
httpStatus:
|
|
1009
|
+
httpStatus: 422;
|
|
1010
1010
|
}> | {
|
|
1011
1011
|
readonly _tag: "Result";
|
|
1012
1012
|
readonly error: undefined;
|
|
@@ -1119,18 +1119,18 @@ export declare const collections: {
|
|
|
1119
1119
|
};
|
|
1120
1120
|
};
|
|
1121
1121
|
}>>> & Record<string, unknown>, context: Omit<import("@aeriajs/types").Context, "token">) => Promise<import("@aeriajs/types").Result.Error<{
|
|
1122
|
-
readonly code:
|
|
1122
|
+
readonly code: "SIGNUP_DISALLOWED";
|
|
1123
1123
|
} & {
|
|
1124
|
-
httpStatus:
|
|
1124
|
+
httpStatus: 403;
|
|
1125
1125
|
}> | import("@aeriajs/types").Result.Error<{
|
|
1126
|
-
readonly code:
|
|
1126
|
+
readonly code: "MALFORMED_INPUT";
|
|
1127
1127
|
readonly details: import("@aeriajs/types").PropertyValidationError | import("@aeriajs/types").ValidationError;
|
|
1128
1128
|
} & {
|
|
1129
|
-
httpStatus:
|
|
1129
|
+
httpStatus: 400;
|
|
1130
1130
|
}> | import("@aeriajs/types").Result.Error<{
|
|
1131
|
-
readonly code:
|
|
1131
|
+
readonly code: "OWNERSHIP_ERROR";
|
|
1132
1132
|
} & {
|
|
1133
|
-
httpStatus:
|
|
1133
|
+
httpStatus: 403;
|
|
1134
1134
|
}> | import("@aeriajs/types").InsertReturnType<import("@aeriajs/types").SchemaWithId<{
|
|
1135
1135
|
readonly $id: "user";
|
|
1136
1136
|
readonly icon: "users";
|
|
@@ -1240,17 +1240,17 @@ export declare const collections: {
|
|
|
1240
1240
|
userId: string;
|
|
1241
1241
|
token: string;
|
|
1242
1242
|
}, context: Omit<import("@aeriajs/types").Context, "token">) => Promise<import("@aeriajs/types").Result.Error<{
|
|
1243
|
-
readonly code:
|
|
1243
|
+
readonly code: "INVALID_LINK";
|
|
1244
1244
|
} & {
|
|
1245
|
-
httpStatus:
|
|
1245
|
+
httpStatus: 404;
|
|
1246
1246
|
}> | import("@aeriajs/types").Result.Error<{
|
|
1247
|
-
readonly code:
|
|
1247
|
+
readonly code: "USER_NOT_FOUND";
|
|
1248
1248
|
} & {
|
|
1249
|
-
httpStatus:
|
|
1249
|
+
httpStatus: 404;
|
|
1250
1250
|
}> | import("@aeriajs/types").Result.Error<{
|
|
1251
|
-
readonly code:
|
|
1251
|
+
readonly code: "INVALID_TOKEN";
|
|
1252
1252
|
} & {
|
|
1253
|
-
httpStatus:
|
|
1253
|
+
httpStatus: 401;
|
|
1254
1254
|
}> | {
|
|
1255
1255
|
readonly _tag: "Result";
|
|
1256
1256
|
readonly error: undefined;
|
|
@@ -1386,10 +1386,10 @@ export declare const collections: {
|
|
|
1386
1386
|
readonly _tag: "Error";
|
|
1387
1387
|
readonly error: Pick<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
1388
1388
|
readonly httpStatus: {
|
|
1389
|
-
readonly enum: [
|
|
1389
|
+
readonly enum: [403, 404, 400];
|
|
1390
1390
|
};
|
|
1391
1391
|
readonly code: {
|
|
1392
|
-
readonly enum: [
|
|
1392
|
+
readonly enum: ["RESOURCE_NOT_FOUND", "OWNERSHIP_ERROR", "INSECURE_OPERATOR", "MALFORMED_INPUT"];
|
|
1393
1393
|
};
|
|
1394
1394
|
readonly message: {
|
|
1395
1395
|
readonly type: "string";
|
|
@@ -1399,16 +1399,16 @@ export declare const collections: {
|
|
|
1399
1399
|
readonly additionalProperties: true;
|
|
1400
1400
|
};
|
|
1401
1401
|
}>> & {
|
|
1402
|
-
code:
|
|
1403
|
-
httpStatus:
|
|
1402
|
+
code: "RESOURCE_NOT_FOUND" | "INSECURE_OPERATOR" | "OWNERSHIP_ERROR" | "MALFORMED_INPUT";
|
|
1403
|
+
httpStatus: 403 | 400 | 404;
|
|
1404
1404
|
message: string;
|
|
1405
1405
|
details: any;
|
|
1406
1406
|
}, never>, "code" | "httpStatus"> & Partial<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
1407
1407
|
readonly httpStatus: {
|
|
1408
|
-
readonly enum: [
|
|
1408
|
+
readonly enum: [403, 404, 400];
|
|
1409
1409
|
};
|
|
1410
1410
|
readonly code: {
|
|
1411
|
-
readonly enum: [
|
|
1411
|
+
readonly enum: ["RESOURCE_NOT_FOUND", "OWNERSHIP_ERROR", "INSECURE_OPERATOR", "MALFORMED_INPUT"];
|
|
1412
1412
|
};
|
|
1413
1413
|
readonly message: {
|
|
1414
1414
|
readonly type: "string";
|
|
@@ -1418,20 +1418,20 @@ export declare const collections: {
|
|
|
1418
1418
|
readonly additionalProperties: true;
|
|
1419
1419
|
};
|
|
1420
1420
|
}>> & {
|
|
1421
|
-
code:
|
|
1422
|
-
httpStatus:
|
|
1421
|
+
code: "RESOURCE_NOT_FOUND" | "INSECURE_OPERATOR" | "OWNERSHIP_ERROR" | "MALFORMED_INPUT";
|
|
1422
|
+
httpStatus: 403 | 400 | 404;
|
|
1423
1423
|
message: string;
|
|
1424
1424
|
details: any;
|
|
1425
1425
|
}, never>>;
|
|
1426
1426
|
readonly result: undefined;
|
|
1427
1427
|
} | import("@aeriajs/types").Result.Error<{
|
|
1428
|
-
readonly code:
|
|
1428
|
+
readonly code: "INVALID_LINK";
|
|
1429
1429
|
} & {
|
|
1430
|
-
httpStatus:
|
|
1430
|
+
httpStatus: 400;
|
|
1431
1431
|
}> | import("@aeriajs/types").Result.Error<{
|
|
1432
|
-
readonly code:
|
|
1432
|
+
readonly code: "ALREADY_ACTIVE_USER";
|
|
1433
1433
|
} & {
|
|
1434
|
-
httpStatus:
|
|
1434
|
+
httpStatus: 403;
|
|
1435
1435
|
}> | {
|
|
1436
1436
|
readonly _tag: "Result";
|
|
1437
1437
|
readonly error: undefined;
|
|
@@ -1446,10 +1446,10 @@ export declare const collections: {
|
|
|
1446
1446
|
readonly _tag: "Error";
|
|
1447
1447
|
readonly error: Pick<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
1448
1448
|
readonly httpStatus: {
|
|
1449
|
-
readonly enum: [
|
|
1449
|
+
readonly enum: [403, 404, 400];
|
|
1450
1450
|
};
|
|
1451
1451
|
readonly code: {
|
|
1452
|
-
readonly enum: [
|
|
1452
|
+
readonly enum: ["RESOURCE_NOT_FOUND", "OWNERSHIP_ERROR", "INSECURE_OPERATOR", "MALFORMED_INPUT"];
|
|
1453
1453
|
};
|
|
1454
1454
|
readonly message: {
|
|
1455
1455
|
readonly type: "string";
|
|
@@ -1459,16 +1459,16 @@ export declare const collections: {
|
|
|
1459
1459
|
readonly additionalProperties: true;
|
|
1460
1460
|
};
|
|
1461
1461
|
}>> & {
|
|
1462
|
-
code:
|
|
1463
|
-
httpStatus:
|
|
1462
|
+
code: "RESOURCE_NOT_FOUND" | "INSECURE_OPERATOR" | "OWNERSHIP_ERROR" | "MALFORMED_INPUT";
|
|
1463
|
+
httpStatus: 403 | 400 | 404;
|
|
1464
1464
|
message: string;
|
|
1465
1465
|
details: any;
|
|
1466
1466
|
}, never>, "code" | "httpStatus"> & Partial<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
1467
1467
|
readonly httpStatus: {
|
|
1468
|
-
readonly enum: [
|
|
1468
|
+
readonly enum: [403, 404, 400];
|
|
1469
1469
|
};
|
|
1470
1470
|
readonly code: {
|
|
1471
|
-
readonly enum: [
|
|
1471
|
+
readonly enum: ["RESOURCE_NOT_FOUND", "OWNERSHIP_ERROR", "INSECURE_OPERATOR", "MALFORMED_INPUT"];
|
|
1472
1472
|
};
|
|
1473
1473
|
readonly message: {
|
|
1474
1474
|
readonly type: "string";
|
|
@@ -1478,16 +1478,16 @@ export declare const collections: {
|
|
|
1478
1478
|
readonly additionalProperties: true;
|
|
1479
1479
|
};
|
|
1480
1480
|
}>> & {
|
|
1481
|
-
code:
|
|
1482
|
-
httpStatus:
|
|
1481
|
+
code: "RESOURCE_NOT_FOUND" | "INSECURE_OPERATOR" | "OWNERSHIP_ERROR" | "MALFORMED_INPUT";
|
|
1482
|
+
httpStatus: 403 | 400 | 404;
|
|
1483
1483
|
message: string;
|
|
1484
1484
|
details: any;
|
|
1485
1485
|
}, never>>;
|
|
1486
1486
|
readonly result: undefined;
|
|
1487
1487
|
} | import("@aeriajs/types").Result.Error<{
|
|
1488
|
-
readonly code:
|
|
1488
|
+
readonly code: "USER_NOT_ACTIVE";
|
|
1489
1489
|
} & {
|
|
1490
|
-
httpStatus:
|
|
1490
|
+
httpStatus: 403;
|
|
1491
1491
|
}> | {
|
|
1492
1492
|
readonly _tag: "Result";
|
|
1493
1493
|
readonly error: undefined;
|
|
@@ -1500,25 +1500,25 @@ export declare const collections: {
|
|
|
1500
1500
|
userId?: string;
|
|
1501
1501
|
token?: string;
|
|
1502
1502
|
}, context: Omit<import("@aeriajs/types").Context, "token">) => Promise<import("@aeriajs/types").Result.Error<{
|
|
1503
|
-
readonly code:
|
|
1503
|
+
readonly code: "INVALID_LINK";
|
|
1504
1504
|
} & {
|
|
1505
|
-
httpStatus:
|
|
1505
|
+
httpStatus: 404;
|
|
1506
1506
|
}> | import("@aeriajs/types").Result.Error<{
|
|
1507
|
-
readonly code:
|
|
1507
|
+
readonly code: "USER_NOT_FOUND";
|
|
1508
1508
|
} & {
|
|
1509
|
-
httpStatus:
|
|
1509
|
+
httpStatus: 404;
|
|
1510
1510
|
}> | import("@aeriajs/types").Result.Error<{
|
|
1511
|
-
readonly code:
|
|
1511
|
+
readonly code: "USER_NOT_ACTIVE";
|
|
1512
1512
|
} & {
|
|
1513
|
-
httpStatus:
|
|
1513
|
+
httpStatus: 403;
|
|
1514
1514
|
}> | import("@aeriajs/types").Result.Error<{
|
|
1515
|
-
readonly code:
|
|
1515
|
+
readonly code: "INVALID_TOKEN";
|
|
1516
1516
|
} & {
|
|
1517
|
-
httpStatus:
|
|
1517
|
+
httpStatus: 401;
|
|
1518
1518
|
}> | import("@aeriajs/types").Result.Error<{
|
|
1519
|
-
readonly code:
|
|
1519
|
+
readonly code: "MALFORMED_INPUT";
|
|
1520
1520
|
} & {
|
|
1521
|
-
httpStatus:
|
|
1521
|
+
httpStatus: 422;
|
|
1522
1522
|
}> | {
|
|
1523
1523
|
readonly _tag: "Result";
|
|
1524
1524
|
readonly error: undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeriajs/builtins",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.232",
|
|
4
4
|
"description": "## Installation",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -8,16 +8,6 @@
|
|
|
8
8
|
"publishConfig": {
|
|
9
9
|
"access": "public"
|
|
10
10
|
},
|
|
11
|
-
"scripts": {
|
|
12
|
-
"test": "echo skipping",
|
|
13
|
-
"lint": "eslint .",
|
|
14
|
-
"lint:fix": "eslint . --fix",
|
|
15
|
-
"build": "pnpm build:cjs && pnpm build:esm",
|
|
16
|
-
"build:cjs": "tsc",
|
|
17
|
-
"build:esm": "esbuild './src/**/*.ts' --outdir=dist --out-extension:.js=.mjs && pnpm build:esm-transform",
|
|
18
|
-
"build:esm-transform": "pnpm -w esm-transform $PWD/dist",
|
|
19
|
-
"write-icons": "pnpm -w write-icons"
|
|
20
|
-
},
|
|
21
11
|
"keywords": [],
|
|
22
12
|
"author": "",
|
|
23
13
|
"license": "ISC",
|
|
@@ -55,10 +45,20 @@
|
|
|
55
45
|
"mongodb": "^6.5.0"
|
|
56
46
|
},
|
|
57
47
|
"peerDependencies": {
|
|
58
|
-
"@aeriajs/core": "^0.0.
|
|
59
|
-
"@aeriajs/common": "^0.0.
|
|
60
|
-
"@aeriajs/entrypoint": "^0.0.
|
|
61
|
-
"@aeriajs/types": "^0.0.
|
|
62
|
-
"@aeriajs/validation": "^0.0.
|
|
48
|
+
"@aeriajs/core": "^0.0.232",
|
|
49
|
+
"@aeriajs/common": "^0.0.132",
|
|
50
|
+
"@aeriajs/entrypoint": "^0.0.136",
|
|
51
|
+
"@aeriajs/types": "^0.0.114",
|
|
52
|
+
"@aeriajs/validation": "^0.0.148"
|
|
53
|
+
},
|
|
54
|
+
"scripts": {
|
|
55
|
+
"test": "echo skipping",
|
|
56
|
+
"lint": "eslint .",
|
|
57
|
+
"lint:fix": "eslint . --fix",
|
|
58
|
+
"build": "pnpm build:cjs && pnpm build:esm",
|
|
59
|
+
"build:cjs": "tsc",
|
|
60
|
+
"build:esm": "esbuild './src/**/*.ts' --outdir=dist --out-extension:.js=.mjs && pnpm build:esm-transform",
|
|
61
|
+
"build:esm-transform": "pnpm -w esm-transform $PWD/dist",
|
|
62
|
+
"write-icons": "pnpm -w write-icons"
|
|
63
63
|
}
|
|
64
|
-
}
|
|
64
|
+
}
|