@aeriajs/builtins 0.0.295 → 0.0.297
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/user/activate.d.ts +1 -1
- package/dist/collections/user/activate.js +6 -2
- package/dist/collections/user/createAccount.d.ts +4 -0
- package/dist/collections/user/description.d.ts +4 -0
- package/dist/collections/user/description.js +4 -0
- package/dist/collections/user/editProfile.d.ts +4 -0
- package/dist/collections/user/getActivationLink.d.ts +2 -3
- package/dist/collections/user/getActivationLink.js +26 -24
- package/dist/collections/user/getActivationToken.d.ts +6 -0
- package/dist/collections/user/getActivationToken.js +13 -0
- package/dist/collections/user/getRedefinePasswordLink.d.ts +2 -2
- package/dist/collections/user/getRedefinePasswordLink.js +33 -11
- package/dist/collections/user/index.d.ts +110 -60
- package/dist/collections/user/redefinePassword.d.ts +1 -1
- package/dist/collections/user/redefinePassword.js +5 -2
- package/dist/index.d.ts +110 -60
- package/package.json +5 -5
|
@@ -61,6 +61,10 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
61
61
|
readonly type: "string";
|
|
62
62
|
readonly format: "date-time";
|
|
63
63
|
};
|
|
64
|
+
readonly activation_timestamp: {
|
|
65
|
+
readonly type: "string";
|
|
66
|
+
readonly format: "date-time";
|
|
67
|
+
};
|
|
64
68
|
};
|
|
65
69
|
readonly presets: readonly ["crud", "duplicate"];
|
|
66
70
|
readonly layout: {
|
|
@@ -170,6 +174,10 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
170
174
|
readonly type: "string";
|
|
171
175
|
readonly format: "date-time";
|
|
172
176
|
};
|
|
177
|
+
readonly activation_timestamp: {
|
|
178
|
+
readonly type: "string";
|
|
179
|
+
readonly format: "date-time";
|
|
180
|
+
};
|
|
173
181
|
};
|
|
174
182
|
readonly presets: readonly ["crud", "duplicate"];
|
|
175
183
|
readonly layout: {
|
|
@@ -329,6 +337,10 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
329
337
|
readonly type: "string";
|
|
330
338
|
readonly format: "date-time";
|
|
331
339
|
};
|
|
340
|
+
readonly activation_timestamp: {
|
|
341
|
+
readonly type: "string";
|
|
342
|
+
readonly format: "date-time";
|
|
343
|
+
};
|
|
332
344
|
}, {}>> & {
|
|
333
345
|
name: string;
|
|
334
346
|
password: string;
|
|
@@ -341,6 +353,7 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
341
353
|
picture_file: import("bson").ObjectId;
|
|
342
354
|
given_name: never;
|
|
343
355
|
family_name: never;
|
|
356
|
+
activation_timestamp: Date;
|
|
344
357
|
}, never>>, context: Omit<Context, "token">) => ({} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
345
358
|
readonly _tag: {
|
|
346
359
|
readonly const: "Error";
|
|
@@ -472,6 +485,10 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
472
485
|
readonly type: "string";
|
|
473
486
|
readonly format: "date-time";
|
|
474
487
|
};
|
|
488
|
+
readonly activation_timestamp: {
|
|
489
|
+
readonly type: "string";
|
|
490
|
+
readonly format: "date-time";
|
|
491
|
+
};
|
|
475
492
|
};
|
|
476
493
|
readonly presets: readonly ["crud", "duplicate"];
|
|
477
494
|
readonly layout: {
|
|
@@ -666,6 +683,10 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
666
683
|
readonly type: "string";
|
|
667
684
|
readonly format: "date-time";
|
|
668
685
|
};
|
|
686
|
+
readonly activation_timestamp: {
|
|
687
|
+
readonly type: "string";
|
|
688
|
+
readonly format: "date-time";
|
|
689
|
+
};
|
|
669
690
|
};
|
|
670
691
|
readonly presets: readonly ["crud", "duplicate"];
|
|
671
692
|
readonly layout: {
|
|
@@ -926,6 +947,10 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
926
947
|
readonly type: "string";
|
|
927
948
|
readonly format: "date-time";
|
|
928
949
|
};
|
|
950
|
+
readonly activation_timestamp: {
|
|
951
|
+
readonly type: "string";
|
|
952
|
+
readonly format: "date-time";
|
|
953
|
+
};
|
|
929
954
|
};
|
|
930
955
|
readonly presets: readonly ["crud", "duplicate"];
|
|
931
956
|
readonly layout: {
|
|
@@ -1288,6 +1313,10 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
1288
1313
|
readonly type: "string";
|
|
1289
1314
|
readonly format: "date-time";
|
|
1290
1315
|
};
|
|
1316
|
+
readonly activation_timestamp: {
|
|
1317
|
+
readonly type: "string";
|
|
1318
|
+
readonly format: "date-time";
|
|
1319
|
+
};
|
|
1291
1320
|
};
|
|
1292
1321
|
readonly presets: readonly ["crud", "duplicate"];
|
|
1293
1322
|
readonly layout: {
|
|
@@ -1518,7 +1547,7 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
1518
1547
|
readonly required: readonly ["httpStatus", "code"];
|
|
1519
1548
|
readonly properties: {
|
|
1520
1549
|
readonly httpStatus: {
|
|
1521
|
-
readonly enum: [404, 403, 401, 422];
|
|
1550
|
+
readonly enum: [400, 404, 403, 401, 422];
|
|
1522
1551
|
};
|
|
1523
1552
|
readonly code: {
|
|
1524
1553
|
readonly enum: ["RESOURCE_NOT_FOUND", "MALFORMED_INPUT", "ALREADY_ACTIVE_USER", "INVALID_LINK", "INVALID_TOKEN", "USER_NOT_FOUND"];
|
|
@@ -1537,7 +1566,7 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
1537
1566
|
result: undefined;
|
|
1538
1567
|
error: Pick<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
1539
1568
|
readonly httpStatus: {
|
|
1540
|
-
readonly enum: [404, 403, 401, 422];
|
|
1569
|
+
readonly enum: [400, 404, 403, 401, 422];
|
|
1541
1570
|
};
|
|
1542
1571
|
readonly code: {
|
|
1543
1572
|
readonly enum: ["RESOURCE_NOT_FOUND", "MALFORMED_INPUT", "ALREADY_ACTIVE_USER", "INVALID_LINK", "INVALID_TOKEN", "USER_NOT_FOUND"];
|
|
@@ -1551,12 +1580,12 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
1551
1580
|
};
|
|
1552
1581
|
}, {}>> & {
|
|
1553
1582
|
code: "RESOURCE_NOT_FOUND" | "MALFORMED_INPUT" | "USER_NOT_FOUND" | "ALREADY_ACTIVE_USER" | "INVALID_LINK" | "INVALID_TOKEN";
|
|
1554
|
-
httpStatus: 401 | 403 | 404 | 422;
|
|
1583
|
+
httpStatus: 400 | 401 | 403 | 404 | 422;
|
|
1555
1584
|
message: string;
|
|
1556
1585
|
details: any;
|
|
1557
1586
|
}, never>, "code" | "httpStatus"> & Partial<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
1558
1587
|
readonly httpStatus: {
|
|
1559
|
-
readonly enum: [404, 403, 401, 422];
|
|
1588
|
+
readonly enum: [400, 404, 403, 401, 422];
|
|
1560
1589
|
};
|
|
1561
1590
|
readonly code: {
|
|
1562
1591
|
readonly enum: ["RESOURCE_NOT_FOUND", "MALFORMED_INPUT", "ALREADY_ACTIVE_USER", "INVALID_LINK", "INVALID_TOKEN", "USER_NOT_FOUND"];
|
|
@@ -1570,7 +1599,7 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
1570
1599
|
};
|
|
1571
1600
|
}, {}>> & {
|
|
1572
1601
|
code: "RESOURCE_NOT_FOUND" | "MALFORMED_INPUT" | "USER_NOT_FOUND" | "ALREADY_ACTIVE_USER" | "INVALID_LINK" | "INVALID_TOKEN";
|
|
1573
|
-
httpStatus: 401 | 403 | 404 | 422;
|
|
1602
|
+
httpStatus: 400 | 401 | 403 | 404 | 422;
|
|
1574
1603
|
message: string;
|
|
1575
1604
|
details: any;
|
|
1576
1605
|
}, never>>;
|
|
@@ -1615,7 +1644,7 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
1615
1644
|
readonly required: readonly ["httpStatus", "code"];
|
|
1616
1645
|
readonly properties: {
|
|
1617
1646
|
readonly httpStatus: {
|
|
1618
|
-
readonly enum: [404, 403, 401, 422];
|
|
1647
|
+
readonly enum: [400, 404, 403, 401, 422];
|
|
1619
1648
|
};
|
|
1620
1649
|
readonly code: {
|
|
1621
1650
|
readonly enum: ["RESOURCE_NOT_FOUND", "MALFORMED_INPUT", "ALREADY_ACTIVE_USER", "INVALID_LINK", "INVALID_TOKEN", "USER_NOT_FOUND"];
|
|
@@ -1634,7 +1663,7 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
1634
1663
|
result: undefined;
|
|
1635
1664
|
error: Pick<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
1636
1665
|
readonly httpStatus: {
|
|
1637
|
-
readonly enum: [404, 403, 401, 422];
|
|
1666
|
+
readonly enum: [400, 404, 403, 401, 422];
|
|
1638
1667
|
};
|
|
1639
1668
|
readonly code: {
|
|
1640
1669
|
readonly enum: ["RESOURCE_NOT_FOUND", "MALFORMED_INPUT", "ALREADY_ACTIVE_USER", "INVALID_LINK", "INVALID_TOKEN", "USER_NOT_FOUND"];
|
|
@@ -1648,12 +1677,12 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
1648
1677
|
};
|
|
1649
1678
|
}, {}>> & {
|
|
1650
1679
|
code: "RESOURCE_NOT_FOUND" | "MALFORMED_INPUT" | "USER_NOT_FOUND" | "ALREADY_ACTIVE_USER" | "INVALID_LINK" | "INVALID_TOKEN";
|
|
1651
|
-
httpStatus: 401 | 403 | 404 | 422;
|
|
1680
|
+
httpStatus: 400 | 401 | 403 | 404 | 422;
|
|
1652
1681
|
message: string;
|
|
1653
1682
|
details: any;
|
|
1654
1683
|
}, never>, "code" | "httpStatus"> & Partial<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
1655
1684
|
readonly httpStatus: {
|
|
1656
|
-
readonly enum: [404, 403, 401, 422];
|
|
1685
|
+
readonly enum: [400, 404, 403, 401, 422];
|
|
1657
1686
|
};
|
|
1658
1687
|
readonly code: {
|
|
1659
1688
|
readonly enum: ["RESOURCE_NOT_FOUND", "MALFORMED_INPUT", "ALREADY_ACTIVE_USER", "INVALID_LINK", "INVALID_TOKEN", "USER_NOT_FOUND"];
|
|
@@ -1667,7 +1696,7 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
1667
1696
|
};
|
|
1668
1697
|
}, {}>> & {
|
|
1669
1698
|
code: "RESOURCE_NOT_FOUND" | "MALFORMED_INPUT" | "USER_NOT_FOUND" | "ALREADY_ACTIVE_USER" | "INVALID_LINK" | "INVALID_TOKEN";
|
|
1670
|
-
httpStatus: 401 | 403 | 404 | 422;
|
|
1699
|
+
httpStatus: 400 | 401 | 403 | 404 | 422;
|
|
1671
1700
|
message: string;
|
|
1672
1701
|
details: any;
|
|
1673
1702
|
}, never>>;
|
|
@@ -1808,6 +1837,10 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
1808
1837
|
readonly type: "string";
|
|
1809
1838
|
readonly format: "date-time";
|
|
1810
1839
|
};
|
|
1840
|
+
readonly activation_timestamp: {
|
|
1841
|
+
readonly type: "string";
|
|
1842
|
+
readonly format: "date-time";
|
|
1843
|
+
};
|
|
1811
1844
|
}, {}>> & {
|
|
1812
1845
|
name: string;
|
|
1813
1846
|
password: string;
|
|
@@ -1820,6 +1853,7 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
1820
1853
|
picture_file: never;
|
|
1821
1854
|
given_name: never;
|
|
1822
1855
|
family_name: never;
|
|
1856
|
+
activation_timestamp: Date;
|
|
1823
1857
|
}, "picture_file">>, context: Omit<Context, "token">) => ({} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
1824
1858
|
readonly _tag: {
|
|
1825
1859
|
readonly const: "Error";
|
|
@@ -2020,6 +2054,10 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
2020
2054
|
readonly type: "string";
|
|
2021
2055
|
readonly format: "date-time";
|
|
2022
2056
|
};
|
|
2057
|
+
readonly activation_timestamp: {
|
|
2058
|
+
readonly type: "string";
|
|
2059
|
+
readonly format: "date-time";
|
|
2060
|
+
};
|
|
2023
2061
|
};
|
|
2024
2062
|
readonly presets: readonly ["crud", "duplicate"];
|
|
2025
2063
|
readonly layout: {
|
|
@@ -2283,6 +2321,10 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
2283
2321
|
readonly type: "string";
|
|
2284
2322
|
readonly format: "date-time";
|
|
2285
2323
|
};
|
|
2324
|
+
readonly activation_timestamp: {
|
|
2325
|
+
readonly type: "string";
|
|
2326
|
+
readonly format: "date-time";
|
|
2327
|
+
};
|
|
2286
2328
|
};
|
|
2287
2329
|
readonly presets: readonly ["crud", "duplicate"];
|
|
2288
2330
|
readonly layout: {
|
|
@@ -2668,6 +2710,10 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
2668
2710
|
readonly type: "string";
|
|
2669
2711
|
readonly format: "date-time";
|
|
2670
2712
|
};
|
|
2713
|
+
readonly activation_timestamp: {
|
|
2714
|
+
readonly type: "string";
|
|
2715
|
+
readonly format: "date-time";
|
|
2716
|
+
};
|
|
2671
2717
|
};
|
|
2672
2718
|
readonly presets: readonly ["crud", "duplicate"];
|
|
2673
2719
|
readonly layout: {
|
|
@@ -2853,6 +2899,10 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
2853
2899
|
readonly type: "string";
|
|
2854
2900
|
readonly format: "date-time";
|
|
2855
2901
|
};
|
|
2902
|
+
readonly activation_timestamp: {
|
|
2903
|
+
readonly type: "string";
|
|
2904
|
+
readonly format: "date-time";
|
|
2905
|
+
};
|
|
2856
2906
|
};
|
|
2857
2907
|
readonly presets: readonly ["crud", "duplicate"];
|
|
2858
2908
|
readonly layout: {
|
|
@@ -3081,10 +3131,10 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
3081
3131
|
readonly required: readonly ["httpStatus", "code"];
|
|
3082
3132
|
readonly properties: {
|
|
3083
3133
|
readonly httpStatus: {
|
|
3084
|
-
readonly enum: [400, 403];
|
|
3134
|
+
readonly enum: [400, 403, 404];
|
|
3085
3135
|
};
|
|
3086
3136
|
readonly code: {
|
|
3087
|
-
readonly enum: ["INVALID_LINK", "ALREADY_ACTIVE_USER"];
|
|
3137
|
+
readonly enum: ["INVALID_LINK", "USER_NOT_FOUND", "ALREADY_ACTIVE_USER"];
|
|
3088
3138
|
};
|
|
3089
3139
|
readonly message: {
|
|
3090
3140
|
readonly type: "string";
|
|
@@ -3100,10 +3150,10 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
3100
3150
|
result: undefined;
|
|
3101
3151
|
error: Pick<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
3102
3152
|
readonly httpStatus: {
|
|
3103
|
-
readonly enum: [400, 403];
|
|
3153
|
+
readonly enum: [400, 403, 404];
|
|
3104
3154
|
};
|
|
3105
3155
|
readonly code: {
|
|
3106
|
-
readonly enum: ["INVALID_LINK", "ALREADY_ACTIVE_USER"];
|
|
3156
|
+
readonly enum: ["INVALID_LINK", "USER_NOT_FOUND", "ALREADY_ACTIVE_USER"];
|
|
3107
3157
|
};
|
|
3108
3158
|
readonly message: {
|
|
3109
3159
|
readonly type: "string";
|
|
@@ -3113,16 +3163,16 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
3113
3163
|
readonly additionalProperties: true;
|
|
3114
3164
|
};
|
|
3115
3165
|
}, {}>> & {
|
|
3116
|
-
code: "ALREADY_ACTIVE_USER" | "INVALID_LINK";
|
|
3117
|
-
httpStatus: 400 | 403;
|
|
3166
|
+
code: "USER_NOT_FOUND" | "ALREADY_ACTIVE_USER" | "INVALID_LINK";
|
|
3167
|
+
httpStatus: 400 | 403 | 404;
|
|
3118
3168
|
message: string;
|
|
3119
3169
|
details: any;
|
|
3120
3170
|
}, never>, "code" | "httpStatus"> & Partial<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
3121
3171
|
readonly httpStatus: {
|
|
3122
|
-
readonly enum: [400, 403];
|
|
3172
|
+
readonly enum: [400, 403, 404];
|
|
3123
3173
|
};
|
|
3124
3174
|
readonly code: {
|
|
3125
|
-
readonly enum: ["INVALID_LINK", "ALREADY_ACTIVE_USER"];
|
|
3175
|
+
readonly enum: ["INVALID_LINK", "USER_NOT_FOUND", "ALREADY_ACTIVE_USER"];
|
|
3126
3176
|
};
|
|
3127
3177
|
readonly message: {
|
|
3128
3178
|
readonly type: "string";
|
|
@@ -3132,8 +3182,8 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
3132
3182
|
readonly additionalProperties: true;
|
|
3133
3183
|
};
|
|
3134
3184
|
}, {}>> & {
|
|
3135
|
-
code: "ALREADY_ACTIVE_USER" | "INVALID_LINK";
|
|
3136
|
-
httpStatus: 400 | 403;
|
|
3185
|
+
code: "USER_NOT_FOUND" | "ALREADY_ACTIVE_USER" | "INVALID_LINK";
|
|
3186
|
+
httpStatus: 400 | 403 | 404;
|
|
3137
3187
|
message: string;
|
|
3138
3188
|
details: any;
|
|
3139
3189
|
}, never>>;
|
|
@@ -3245,10 +3295,10 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
3245
3295
|
readonly required: readonly ["httpStatus", "code"];
|
|
3246
3296
|
readonly properties: {
|
|
3247
3297
|
readonly httpStatus: {
|
|
3248
|
-
readonly enum: [400, 403];
|
|
3298
|
+
readonly enum: [400, 403, 404];
|
|
3249
3299
|
};
|
|
3250
3300
|
readonly code: {
|
|
3251
|
-
readonly enum: ["INVALID_LINK", "ALREADY_ACTIVE_USER"];
|
|
3301
|
+
readonly enum: ["INVALID_LINK", "USER_NOT_FOUND", "ALREADY_ACTIVE_USER"];
|
|
3252
3302
|
};
|
|
3253
3303
|
readonly message: {
|
|
3254
3304
|
readonly type: "string";
|
|
@@ -3264,10 +3314,10 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
3264
3314
|
result: undefined;
|
|
3265
3315
|
error: Pick<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
3266
3316
|
readonly httpStatus: {
|
|
3267
|
-
readonly enum: [400, 403];
|
|
3317
|
+
readonly enum: [400, 403, 404];
|
|
3268
3318
|
};
|
|
3269
3319
|
readonly code: {
|
|
3270
|
-
readonly enum: ["INVALID_LINK", "ALREADY_ACTIVE_USER"];
|
|
3320
|
+
readonly enum: ["INVALID_LINK", "USER_NOT_FOUND", "ALREADY_ACTIVE_USER"];
|
|
3271
3321
|
};
|
|
3272
3322
|
readonly message: {
|
|
3273
3323
|
readonly type: "string";
|
|
@@ -3277,16 +3327,16 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
3277
3327
|
readonly additionalProperties: true;
|
|
3278
3328
|
};
|
|
3279
3329
|
}, {}>> & {
|
|
3280
|
-
code: "ALREADY_ACTIVE_USER" | "INVALID_LINK";
|
|
3281
|
-
httpStatus: 400 | 403;
|
|
3330
|
+
code: "USER_NOT_FOUND" | "ALREADY_ACTIVE_USER" | "INVALID_LINK";
|
|
3331
|
+
httpStatus: 400 | 403 | 404;
|
|
3282
3332
|
message: string;
|
|
3283
3333
|
details: any;
|
|
3284
3334
|
}, never>, "code" | "httpStatus"> & Partial<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
3285
3335
|
readonly httpStatus: {
|
|
3286
|
-
readonly enum: [400, 403];
|
|
3336
|
+
readonly enum: [400, 403, 404];
|
|
3287
3337
|
};
|
|
3288
3338
|
readonly code: {
|
|
3289
|
-
readonly enum: ["INVALID_LINK", "ALREADY_ACTIVE_USER"];
|
|
3339
|
+
readonly enum: ["INVALID_LINK", "USER_NOT_FOUND", "ALREADY_ACTIVE_USER"];
|
|
3290
3340
|
};
|
|
3291
3341
|
readonly message: {
|
|
3292
3342
|
readonly type: "string";
|
|
@@ -3296,8 +3346,8 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
3296
3346
|
readonly additionalProperties: true;
|
|
3297
3347
|
};
|
|
3298
3348
|
}, {}>> & {
|
|
3299
|
-
code: "ALREADY_ACTIVE_USER" | "INVALID_LINK";
|
|
3300
|
-
httpStatus: 400 | 403;
|
|
3349
|
+
code: "USER_NOT_FOUND" | "ALREADY_ACTIVE_USER" | "INVALID_LINK";
|
|
3350
|
+
httpStatus: 400 | 403 | 404;
|
|
3301
3351
|
message: string;
|
|
3302
3352
|
details: any;
|
|
3303
3353
|
}, never>>;
|
|
@@ -3432,10 +3482,10 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
3432
3482
|
readonly required: readonly ["httpStatus", "code"];
|
|
3433
3483
|
readonly properties: {
|
|
3434
3484
|
readonly httpStatus: {
|
|
3435
|
-
readonly enum: [403];
|
|
3485
|
+
readonly enum: [403, 404];
|
|
3436
3486
|
};
|
|
3437
3487
|
readonly code: {
|
|
3438
|
-
readonly enum: ["USER_NOT_ACTIVE"];
|
|
3488
|
+
readonly enum: ["USER_NOT_ACTIVE", "USER_NOT_FOUND"];
|
|
3439
3489
|
};
|
|
3440
3490
|
readonly message: {
|
|
3441
3491
|
readonly type: "string";
|
|
@@ -3451,10 +3501,10 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
3451
3501
|
result: undefined;
|
|
3452
3502
|
error: Pick<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
3453
3503
|
readonly httpStatus: {
|
|
3454
|
-
readonly enum: [403];
|
|
3504
|
+
readonly enum: [403, 404];
|
|
3455
3505
|
};
|
|
3456
3506
|
readonly code: {
|
|
3457
|
-
readonly enum: ["USER_NOT_ACTIVE"];
|
|
3507
|
+
readonly enum: ["USER_NOT_ACTIVE", "USER_NOT_FOUND"];
|
|
3458
3508
|
};
|
|
3459
3509
|
readonly message: {
|
|
3460
3510
|
readonly type: "string";
|
|
@@ -3464,16 +3514,16 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
3464
3514
|
readonly additionalProperties: true;
|
|
3465
3515
|
};
|
|
3466
3516
|
}, {}>> & {
|
|
3467
|
-
code: "USER_NOT_ACTIVE";
|
|
3468
|
-
httpStatus: 403;
|
|
3517
|
+
code: "USER_NOT_FOUND" | "USER_NOT_ACTIVE";
|
|
3518
|
+
httpStatus: 403 | 404;
|
|
3469
3519
|
message: string;
|
|
3470
3520
|
details: any;
|
|
3471
3521
|
}, never>, "code" | "httpStatus"> & Partial<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
3472
3522
|
readonly httpStatus: {
|
|
3473
|
-
readonly enum: [403];
|
|
3523
|
+
readonly enum: [403, 404];
|
|
3474
3524
|
};
|
|
3475
3525
|
readonly code: {
|
|
3476
|
-
readonly enum: ["USER_NOT_ACTIVE"];
|
|
3526
|
+
readonly enum: ["USER_NOT_ACTIVE", "USER_NOT_FOUND"];
|
|
3477
3527
|
};
|
|
3478
3528
|
readonly message: {
|
|
3479
3529
|
readonly type: "string";
|
|
@@ -3483,8 +3533,8 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
3483
3533
|
readonly additionalProperties: true;
|
|
3484
3534
|
};
|
|
3485
3535
|
}, {}>> & {
|
|
3486
|
-
code: "USER_NOT_ACTIVE";
|
|
3487
|
-
httpStatus: 403;
|
|
3536
|
+
code: "USER_NOT_FOUND" | "USER_NOT_ACTIVE";
|
|
3537
|
+
httpStatus: 403 | 404;
|
|
3488
3538
|
message: string;
|
|
3489
3539
|
details: any;
|
|
3490
3540
|
}, never>>;
|
|
@@ -3596,10 +3646,10 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
3596
3646
|
readonly required: readonly ["httpStatus", "code"];
|
|
3597
3647
|
readonly properties: {
|
|
3598
3648
|
readonly httpStatus: {
|
|
3599
|
-
readonly enum: [403];
|
|
3649
|
+
readonly enum: [403, 404];
|
|
3600
3650
|
};
|
|
3601
3651
|
readonly code: {
|
|
3602
|
-
readonly enum: ["USER_NOT_ACTIVE"];
|
|
3652
|
+
readonly enum: ["USER_NOT_ACTIVE", "USER_NOT_FOUND"];
|
|
3603
3653
|
};
|
|
3604
3654
|
readonly message: {
|
|
3605
3655
|
readonly type: "string";
|
|
@@ -3615,10 +3665,10 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
3615
3665
|
result: undefined;
|
|
3616
3666
|
error: Pick<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
3617
3667
|
readonly httpStatus: {
|
|
3618
|
-
readonly enum: [403];
|
|
3668
|
+
readonly enum: [403, 404];
|
|
3619
3669
|
};
|
|
3620
3670
|
readonly code: {
|
|
3621
|
-
readonly enum: ["USER_NOT_ACTIVE"];
|
|
3671
|
+
readonly enum: ["USER_NOT_ACTIVE", "USER_NOT_FOUND"];
|
|
3622
3672
|
};
|
|
3623
3673
|
readonly message: {
|
|
3624
3674
|
readonly type: "string";
|
|
@@ -3628,16 +3678,16 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
3628
3678
|
readonly additionalProperties: true;
|
|
3629
3679
|
};
|
|
3630
3680
|
}, {}>> & {
|
|
3631
|
-
code: "USER_NOT_ACTIVE";
|
|
3632
|
-
httpStatus: 403;
|
|
3681
|
+
code: "USER_NOT_FOUND" | "USER_NOT_ACTIVE";
|
|
3682
|
+
httpStatus: 403 | 404;
|
|
3633
3683
|
message: string;
|
|
3634
3684
|
details: any;
|
|
3635
3685
|
}, never>, "code" | "httpStatus"> & Partial<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
3636
3686
|
readonly httpStatus: {
|
|
3637
|
-
readonly enum: [403];
|
|
3687
|
+
readonly enum: [403, 404];
|
|
3638
3688
|
};
|
|
3639
3689
|
readonly code: {
|
|
3640
|
-
readonly enum: ["USER_NOT_ACTIVE"];
|
|
3690
|
+
readonly enum: ["USER_NOT_ACTIVE", "USER_NOT_FOUND"];
|
|
3641
3691
|
};
|
|
3642
3692
|
readonly message: {
|
|
3643
3693
|
readonly type: "string";
|
|
@@ -3647,8 +3697,8 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
3647
3697
|
readonly additionalProperties: true;
|
|
3648
3698
|
};
|
|
3649
3699
|
}, {}>> & {
|
|
3650
|
-
code: "USER_NOT_ACTIVE";
|
|
3651
|
-
httpStatus: 403;
|
|
3700
|
+
code: "USER_NOT_FOUND" | "USER_NOT_ACTIVE";
|
|
3701
|
+
httpStatus: 403 | 404;
|
|
3652
3702
|
message: string;
|
|
3653
3703
|
details: any;
|
|
3654
3704
|
}, never>>;
|
|
@@ -3776,7 +3826,7 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
3776
3826
|
readonly required: readonly ["httpStatus", "code"];
|
|
3777
3827
|
readonly properties: {
|
|
3778
3828
|
readonly httpStatus: {
|
|
3779
|
-
readonly enum: [404, 403, 401, 422];
|
|
3829
|
+
readonly enum: [400, 404, 403, 401, 422];
|
|
3780
3830
|
};
|
|
3781
3831
|
readonly code: {
|
|
3782
3832
|
readonly enum: ["MALFORMED_INPUT", "INVALID_LINK", "INVALID_TOKEN", "USER_NOT_FOUND", "USER_NOT_ACTIVE"];
|
|
@@ -3795,7 +3845,7 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
3795
3845
|
result: undefined;
|
|
3796
3846
|
error: Pick<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
3797
3847
|
readonly httpStatus: {
|
|
3798
|
-
readonly enum: [404, 403, 401, 422];
|
|
3848
|
+
readonly enum: [400, 404, 403, 401, 422];
|
|
3799
3849
|
};
|
|
3800
3850
|
readonly code: {
|
|
3801
3851
|
readonly enum: ["MALFORMED_INPUT", "INVALID_LINK", "INVALID_TOKEN", "USER_NOT_FOUND", "USER_NOT_ACTIVE"];
|
|
@@ -3809,12 +3859,12 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
3809
3859
|
};
|
|
3810
3860
|
}, {}>> & {
|
|
3811
3861
|
code: "MALFORMED_INPUT" | "USER_NOT_FOUND" | "INVALID_LINK" | "INVALID_TOKEN" | "USER_NOT_ACTIVE";
|
|
3812
|
-
httpStatus: 401 | 403 | 404 | 422;
|
|
3862
|
+
httpStatus: 400 | 401 | 403 | 404 | 422;
|
|
3813
3863
|
message: string;
|
|
3814
3864
|
details: any;
|
|
3815
3865
|
}, never>, "code" | "httpStatus"> & Partial<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
3816
3866
|
readonly httpStatus: {
|
|
3817
|
-
readonly enum: [404, 403, 401, 422];
|
|
3867
|
+
readonly enum: [400, 404, 403, 401, 422];
|
|
3818
3868
|
};
|
|
3819
3869
|
readonly code: {
|
|
3820
3870
|
readonly enum: ["MALFORMED_INPUT", "INVALID_LINK", "INVALID_TOKEN", "USER_NOT_FOUND", "USER_NOT_ACTIVE"];
|
|
@@ -3828,7 +3878,7 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
3828
3878
|
};
|
|
3829
3879
|
}, {}>> & {
|
|
3830
3880
|
code: "MALFORMED_INPUT" | "USER_NOT_FOUND" | "INVALID_LINK" | "INVALID_TOKEN" | "USER_NOT_ACTIVE";
|
|
3831
|
-
httpStatus: 401 | 403 | 404 | 422;
|
|
3881
|
+
httpStatus: 400 | 401 | 403 | 404 | 422;
|
|
3832
3882
|
message: string;
|
|
3833
3883
|
details: any;
|
|
3834
3884
|
}, never>>;
|
|
@@ -3942,7 +3992,7 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
3942
3992
|
readonly required: readonly ["httpStatus", "code"];
|
|
3943
3993
|
readonly properties: {
|
|
3944
3994
|
readonly httpStatus: {
|
|
3945
|
-
readonly enum: [404, 403, 401, 422];
|
|
3995
|
+
readonly enum: [400, 404, 403, 401, 422];
|
|
3946
3996
|
};
|
|
3947
3997
|
readonly code: {
|
|
3948
3998
|
readonly enum: ["MALFORMED_INPUT", "INVALID_LINK", "INVALID_TOKEN", "USER_NOT_FOUND", "USER_NOT_ACTIVE"];
|
|
@@ -3961,7 +4011,7 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
3961
4011
|
result: undefined;
|
|
3962
4012
|
error: Pick<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
3963
4013
|
readonly httpStatus: {
|
|
3964
|
-
readonly enum: [404, 403, 401, 422];
|
|
4014
|
+
readonly enum: [400, 404, 403, 401, 422];
|
|
3965
4015
|
};
|
|
3966
4016
|
readonly code: {
|
|
3967
4017
|
readonly enum: ["MALFORMED_INPUT", "INVALID_LINK", "INVALID_TOKEN", "USER_NOT_FOUND", "USER_NOT_ACTIVE"];
|
|
@@ -3975,12 +4025,12 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
3975
4025
|
};
|
|
3976
4026
|
}, {}>> & {
|
|
3977
4027
|
code: "MALFORMED_INPUT" | "USER_NOT_FOUND" | "INVALID_LINK" | "INVALID_TOKEN" | "USER_NOT_ACTIVE";
|
|
3978
|
-
httpStatus: 401 | 403 | 404 | 422;
|
|
4028
|
+
httpStatus: 400 | 401 | 403 | 404 | 422;
|
|
3979
4029
|
message: string;
|
|
3980
4030
|
details: any;
|
|
3981
4031
|
}, never>, "code" | "httpStatus"> & Partial<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
3982
4032
|
readonly httpStatus: {
|
|
3983
|
-
readonly enum: [404, 403, 401, 422];
|
|
4033
|
+
readonly enum: [400, 404, 403, 401, 422];
|
|
3984
4034
|
};
|
|
3985
4035
|
readonly code: {
|
|
3986
4036
|
readonly enum: ["MALFORMED_INPUT", "INVALID_LINK", "INVALID_TOKEN", "USER_NOT_FOUND", "USER_NOT_ACTIVE"];
|
|
@@ -3994,7 +4044,7 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
3994
4044
|
};
|
|
3995
4045
|
}, {}>> & {
|
|
3996
4046
|
code: "MALFORMED_INPUT" | "USER_NOT_FOUND" | "INVALID_LINK" | "INVALID_TOKEN" | "USER_NOT_ACTIVE";
|
|
3997
|
-
httpStatus: 401 | 403 | 404 | 422;
|
|
4047
|
+
httpStatus: 400 | 401 | 403 | 404 | 422;
|
|
3998
4048
|
message: string;
|
|
3999
4049
|
details: any;
|
|
4000
4050
|
}, never>>;
|
|
@@ -68,7 +68,7 @@ export declare const redefinePasswordContract: {
|
|
|
68
68
|
readonly required: readonly ["httpStatus", "code"];
|
|
69
69
|
readonly properties: {
|
|
70
70
|
readonly httpStatus: {
|
|
71
|
-
readonly enum: [404, 403, 401, 422];
|
|
71
|
+
readonly enum: [400, 404, 403, 401, 422];
|
|
72
72
|
};
|
|
73
73
|
readonly code: {
|
|
74
74
|
readonly enum: ["MALFORMED_INPUT", "INVALID_LINK", "INVALID_TOKEN", "USER_NOT_FOUND", "USER_NOT_ACTIVE"];
|
|
@@ -28,6 +28,7 @@ export const redefinePasswordContract = defineContract({
|
|
|
28
28
|
functionSchemas.getError(),
|
|
29
29
|
endpointErrorSchema({
|
|
30
30
|
httpStatus: [
|
|
31
|
+
HTTPStatus.BadRequest,
|
|
31
32
|
HTTPStatus.NotFound,
|
|
32
33
|
HTTPStatus.Forbidden,
|
|
33
34
|
HTTPStatus.Unauthorized,
|
|
@@ -58,7 +59,7 @@ export const redefinePassword = async (payload, context) => {
|
|
|
58
59
|
throw new Error('config.secret is not set');
|
|
59
60
|
}
|
|
60
61
|
if (!userId || !token) {
|
|
61
|
-
return context.error(HTTPStatus.
|
|
62
|
+
return context.error(HTTPStatus.BadRequest, {
|
|
62
63
|
code: RedefinePasswordError.InvalidLink,
|
|
63
64
|
});
|
|
64
65
|
}
|
|
@@ -68,6 +69,7 @@ export const redefinePassword = async (payload, context) => {
|
|
|
68
69
|
projection: {
|
|
69
70
|
password: 1,
|
|
70
71
|
active: 1,
|
|
72
|
+
activation_timestamp: 1,
|
|
71
73
|
},
|
|
72
74
|
});
|
|
73
75
|
if (!user) {
|
|
@@ -80,7 +82,7 @@ export const redefinePassword = async (payload, context) => {
|
|
|
80
82
|
code: RedefinePasswordError.UserNotActive,
|
|
81
83
|
});
|
|
82
84
|
}
|
|
83
|
-
const { error } = await decodeToken(token, context.config.secret);
|
|
85
|
+
const { error } = await decodeToken(token, `${context.config.secret}:${user.activation_timestamp?.getTime() || ''}`);
|
|
84
86
|
if (error) {
|
|
85
87
|
return context.error(HTTPStatus.Unauthorized, {
|
|
86
88
|
code: RedefinePasswordError.InvalidToken,
|
|
@@ -97,6 +99,7 @@ export const redefinePassword = async (payload, context) => {
|
|
|
97
99
|
$set: {
|
|
98
100
|
active: true,
|
|
99
101
|
password: await bcrypt.hash(password, 10),
|
|
102
|
+
activation_timestamp: undefined,
|
|
100
103
|
},
|
|
101
104
|
});
|
|
102
105
|
return Result.result({
|