@aeriajs/builtins 0.0.87 → 0.0.89

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.
Files changed (32) hide show
  1. package/dist/collections/file/download.d.ts +6 -5
  2. package/dist/collections/file/download.js +8 -9
  3. package/dist/collections/file/download.mjs +7 -8
  4. package/dist/collections/file/index.d.ts +14 -6
  5. package/dist/collections/file/insert.d.ts +1 -1
  6. package/dist/collections/log/index.d.ts +6 -6
  7. package/dist/collections/user/activate.d.ts +15 -2
  8. package/dist/collections/user/activate.js +21 -13
  9. package/dist/collections/user/activate.mjs +20 -12
  10. package/dist/collections/user/authenticate.d.ts +17 -5
  11. package/dist/collections/user/authenticate.js +26 -18
  12. package/dist/collections/user/authenticate.mjs +23 -15
  13. package/dist/collections/user/createAccount.d.ts +1 -1
  14. package/dist/collections/user/createAccount.js +2 -2
  15. package/dist/collections/user/createAccount.mjs +3 -3
  16. package/dist/collections/user/description.js +0 -7
  17. package/dist/collections/user/description.mjs +0 -7
  18. package/dist/collections/user/getCurrentUser.d.ts +4 -4
  19. package/dist/collections/user/getCurrentUser.js +10 -10
  20. package/dist/collections/user/getCurrentUser.mjs +10 -10
  21. package/dist/collections/user/getInfo.d.ts +18 -5
  22. package/dist/collections/user/getInfo.js +22 -14
  23. package/dist/collections/user/getInfo.mjs +21 -13
  24. package/dist/collections/user/index.d.ts +106 -62
  25. package/dist/collections/user/index.js +3 -10
  26. package/dist/collections/user/index.mjs +3 -10
  27. package/dist/collections/user/insert.d.ts +1 -1
  28. package/dist/functions/describe.d.ts +124 -113
  29. package/dist/functions/describe.js +3 -5
  30. package/dist/functions/describe.mjs +4 -6
  31. package/dist/index.d.ts +126 -74
  32. package/package.json +6 -6
package/dist/index.d.ts CHANGED
@@ -60,7 +60,7 @@ export declare const collections: {
60
60
  };
61
61
  };
62
62
  functions: {
63
- readonly get: (payload: import("@aeriajs/types").GetPayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetOptions | undefined) => Promise<import("@aeriajs/types").SchemaWithId<any> | null>;
63
+ readonly get: (payload: import("@aeriajs/types").GetPayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetOptions | undefined) => Promise<any>;
64
64
  readonly insert: (payload: {
65
65
  what: {
66
66
  content: string;
@@ -163,7 +163,7 @@ export declare const collections: {
163
163
  readonly ask: true;
164
164
  };
165
165
  };
166
- }>) => Promise<import("@aeriajs/types").Left<import("@aeriajs/types").ACError | import("@aeriajs/types").ValidationError> | import("@aeriajs/types").Right<import("@aeriajs/types").SchemaWithId<{
166
+ }>) => Promise<import("@aeriajs/types").InsertReturnType<import("@aeriajs/types").SchemaWithId<{
167
167
  readonly $id: "file";
168
168
  readonly owned: "always";
169
169
  readonly presets: readonly ["owned"];
@@ -266,7 +266,11 @@ export declare const collections: {
266
266
  readonly ask: true;
267
267
  };
268
268
  };
269
- }>) => Promise<import("@aeriajs/types").Left<import("./collections/file/download.js").FileReadError.DocumentNotFound> | import("@aeriajs/types").Left<import("./collections/file/download.js").FileReadError.FileNotFound> | import("fs").ReadStream>;
269
+ }>) => Promise<import("@aeriajs/types").EndpointError<{
270
+ readonly code: import("@aeriajs/types").ACError.ResourceNotFound;
271
+ } & {
272
+ httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
273
+ }> | import("fs").ReadStream>;
270
274
  readonly remove: (payload: import("@aeriajs/types").RemovePayload<import("@aeriajs/types").SchemaWithId<{
271
275
  readonly $id: "file";
272
276
  readonly owned: "always";
@@ -526,7 +530,7 @@ export declare const collections: {
526
530
  };
527
531
  };
528
532
  functions: {
529
- readonly get: (payload: import("@aeriajs/types").GetPayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetOptions | undefined) => Promise<import("@aeriajs/types").SchemaWithId<any> | null>;
533
+ readonly get: (payload: import("@aeriajs/types").GetPayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetOptions | undefined) => Promise<any>;
530
534
  readonly insert: (payload: {
531
535
  what: {
532
536
  content: string;
@@ -629,7 +633,7 @@ export declare const collections: {
629
633
  readonly ask: true;
630
634
  };
631
635
  };
632
- }>) => Promise<import("@aeriajs/types").Left<import("@aeriajs/types").ACError | import("@aeriajs/types").ValidationError> | import("@aeriajs/types").Right<import("@aeriajs/types").SchemaWithId<{
636
+ }>) => Promise<import("@aeriajs/types").InsertReturnType<import("@aeriajs/types").SchemaWithId<{
633
637
  readonly $id: "file";
634
638
  readonly owned: "always";
635
639
  readonly presets: readonly ["owned"];
@@ -732,7 +736,11 @@ export declare const collections: {
732
736
  readonly ask: true;
733
737
  };
734
738
  };
735
- }>) => Promise<import("@aeriajs/types").Left<import("./collections/file/download.js").FileReadError.DocumentNotFound> | import("@aeriajs/types").Left<import("./collections/file/download.js").FileReadError.FileNotFound> | import("fs").ReadStream>;
739
+ }>) => Promise<import("@aeriajs/types").EndpointError<{
740
+ readonly code: import("@aeriajs/types").ACError.ResourceNotFound;
741
+ } & {
742
+ httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
743
+ }> | import("fs").ReadStream>;
736
744
  readonly remove: (payload: import("@aeriajs/types").RemovePayload<import("@aeriajs/types").SchemaWithId<{
737
745
  readonly $id: "file";
738
746
  readonly owned: "always";
@@ -1011,9 +1019,9 @@ export declare const collections: {
1011
1019
  readonly filters: readonly ["context", "message", "owner"];
1012
1020
  };
1013
1021
  functions: {
1014
- readonly get: (payload: import("@aeriajs/types").GetPayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetOptions | undefined) => Promise<import("@aeriajs/types").SchemaWithId<any> | null>;
1015
- readonly getAll: (_payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<any>> | undefined, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetAllOptions | undefined) => Promise<import("@aeriajs/types").SchemaWithId<any>[]>;
1016
- readonly insert: (payload: import("@aeriajs/types").InsertPayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").InsertOptions | undefined) => Promise<import("@aeriajs/types").Left<import("@aeriajs/types").ACError | import("@aeriajs/types").ValidationError> | import("@aeriajs/types").Right<import("@aeriajs/types").SchemaWithId<any>>>;
1022
+ readonly get: (payload: import("@aeriajs/types").GetPayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetOptions | undefined) => Promise<any>;
1023
+ readonly getAll: (_payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<import("@aeriajs/types").Description>> | undefined, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetAllOptions | undefined) => Promise<import("@aeriajs/types").SchemaWithId<any>[]>;
1024
+ readonly insert: (payload: import("@aeriajs/types").InsertPayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").InsertOptions | undefined) => Promise<import("@aeriajs/types").InsertReturnType<import("@aeriajs/types").SchemaWithId<any>>>;
1017
1025
  };
1018
1026
  exposedFunctions: {
1019
1027
  readonly get: true;
@@ -1076,9 +1084,9 @@ export declare const collections: {
1076
1084
  readonly filters: readonly ["context", "message", "owner"];
1077
1085
  };
1078
1086
  functions: {
1079
- readonly get: (payload: import("@aeriajs/types").GetPayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetOptions | undefined) => Promise<import("@aeriajs/types").SchemaWithId<any> | null>;
1080
- readonly getAll: (_payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<any>> | undefined, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetAllOptions | undefined) => Promise<import("@aeriajs/types").SchemaWithId<any>[]>;
1081
- readonly insert: (payload: import("@aeriajs/types").InsertPayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").InsertOptions | undefined) => Promise<import("@aeriajs/types").Left<import("@aeriajs/types").ACError | import("@aeriajs/types").ValidationError> | import("@aeriajs/types").Right<import("@aeriajs/types").SchemaWithId<any>>>;
1087
+ readonly get: (payload: import("@aeriajs/types").GetPayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetOptions | undefined) => Promise<any>;
1088
+ readonly getAll: (_payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<import("@aeriajs/types").Description>> | undefined, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetAllOptions | undefined) => Promise<import("@aeriajs/types").SchemaWithId<any>[]>;
1089
+ readonly insert: (payload: import("@aeriajs/types").InsertPayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").InsertOptions | undefined) => Promise<import("@aeriajs/types").InsertReturnType<import("@aeriajs/types").SchemaWithId<any>>>;
1082
1090
  };
1083
1091
  contracts: {
1084
1092
  readonly get?: import("@aeriajs/types").Contract | undefined;
@@ -1297,8 +1305,8 @@ export declare const collections: {
1297
1305
  };
1298
1306
  };
1299
1307
  functions: {
1300
- readonly get: (payload: import("@aeriajs/types").GetPayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetOptions | undefined) => Promise<import("@aeriajs/types").SchemaWithId<any> | null>;
1301
- readonly getAll: (_payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<any>> | undefined, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetAllOptions | undefined) => Promise<import("@aeriajs/types").SchemaWithId<any>[]>;
1308
+ readonly get: (payload: import("@aeriajs/types").GetPayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetOptions | undefined) => Promise<any>;
1309
+ readonly getAll: (_payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<import("@aeriajs/types").Description>> | undefined, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetAllOptions | undefined) => Promise<import("@aeriajs/types").SchemaWithId<any>[]>;
1302
1310
  readonly remove: (payload: import("@aeriajs/types").RemovePayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>) => Promise<any>;
1303
1311
  readonly upload: (_props: unknown, context: import("@aeriajs/types").StrictContext<any>) => Promise<import("@aeriajs/types").Left<import("@aeriajs/types").ValidationError | import("@aeriajs/types").PropertyValidationError> | {
1304
1312
  tempId: any;
@@ -1504,7 +1512,7 @@ export declare const collections: {
1504
1512
  };
1505
1513
  };
1506
1514
  };
1507
- }>) => Promise<import("@aeriajs/types").Left<import("@aeriajs/types").ACError | import("@aeriajs/types").ValidationError> | import("@aeriajs/types").Right<import("@aeriajs/types").SchemaWithId<{
1515
+ }>) => Promise<import("@aeriajs/types").InsertReturnType<import("@aeriajs/types").SchemaWithId<{
1508
1516
  readonly $id: "user";
1509
1517
  readonly required: readonly ["name", "roles", "email"];
1510
1518
  readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
@@ -1709,7 +1717,7 @@ export declare const collections: {
1709
1717
  };
1710
1718
  };
1711
1719
  };
1712
- }>) => Promise<import("@aeriajs/types").Left<import("./collections/user/authenticate.js").AuthenticationErrors.Unauthenticated> | import("@aeriajs/types").Right<{
1720
+ }>) => Promise<{
1713
1721
  user: Pick<import("@aeriajs/types").SchemaWithId<{
1714
1722
  readonly $id: "user";
1715
1723
  readonly required: readonly ["name", "roles", "email"];
@@ -1813,7 +1821,11 @@ export declare const collections: {
1813
1821
  _id: import("mongodb").ObjectId | null;
1814
1822
  };
1815
1823
  token: import("@aeriajs/types").TokenRecipient;
1816
- } | {
1824
+ } | import("@aeriajs/types").EndpointError<{
1825
+ readonly code: import("@aeriajs/types").ACError.AuthorizationError;
1826
+ } & {
1827
+ httpStatus: import("@aeriajs/types").HTTPStatus.Unauthorized;
1828
+ }> | {
1817
1829
  user: {
1818
1830
  _id: null;
1819
1831
  name: string;
@@ -1825,7 +1837,15 @@ export declare const collections: {
1825
1837
  type: string;
1826
1838
  content: string;
1827
1839
  };
1828
- }> | import("@aeriajs/types").Left<import("./collections/user/authenticate.js").AuthenticationErrors.InvalidCredentials> | import("@aeriajs/types").Left<import("./collections/user/authenticate.js").AuthenticationErrors.InactiveUser>>;
1840
+ } | import("@aeriajs/types").EndpointError<{
1841
+ readonly code: import("./collections/user/authenticate.js").AuthenticationError.InvalidCredentials;
1842
+ } & {
1843
+ httpStatus: import("@aeriajs/types").HTTPStatus.Unauthorized;
1844
+ }> | import("@aeriajs/types").EndpointError<{
1845
+ readonly code: import("./collections/user/authenticate.js").AuthenticationError.InactiveUser;
1846
+ } & {
1847
+ httpStatus: import("@aeriajs/types").HTTPStatus.Unauthorized;
1848
+ }>>;
1829
1849
  readonly activate: (payload: {
1830
1850
  password: string;
1831
1851
  }, context: import("@aeriajs/types").Context<{
@@ -1927,7 +1947,19 @@ export declare const collections: {
1927
1947
  };
1928
1948
  };
1929
1949
  };
1930
- }>) => Promise<import("@aeriajs/types").GenericResponse | import("@aeriajs/types").Left<import("./collections/user/activate.js").ActivationErrors.InvalidLink> | import("@aeriajs/types").Left<import("./collections/user/activate.js").ActivationErrors.UserNotFound> | import("@aeriajs/types").Left<import("./collections/user/activate.js").ActivationErrors.AlreadyActiveUser> | import("@aeriajs/types").Right<true>>;
1950
+ }>) => Promise<import("@aeriajs/types").GenericResponse | import("@aeriajs/types").EndpointError<{
1951
+ readonly code: import("./collections/user/activate.js").ActivationError.InvalidLink;
1952
+ } & {
1953
+ httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
1954
+ }> | import("@aeriajs/types").EndpointError<{
1955
+ readonly code: import("./collections/user/activate.js").ActivationError.UserNotFound;
1956
+ } & {
1957
+ httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
1958
+ }> | import("@aeriajs/types").EndpointError<{
1959
+ readonly code: import("./collections/user/activate.js").ActivationError.AlreadyActiveUser;
1960
+ } & {
1961
+ httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
1962
+ }> | undefined>;
1931
1963
  readonly createAccount: (payload: Omit<Pick<{
1932
1964
  picture_file: import("@aeriajs/types").SchemaWithId<{
1933
1965
  readonly $id: "file";
@@ -2262,7 +2294,7 @@ export declare const collections: {
2262
2294
  };
2263
2295
  };
2264
2296
  };
2265
- }>) => Promise<import("@aeriajs/types").Left<import("@aeriajs/types").ValidationError | import("@aeriajs/types").PropertyValidationError> | import("@aeriajs/types").Right<any>>;
2297
+ }>) => Promise<any>;
2266
2298
  readonly getInfo: (payload: {
2267
2299
  userId: string;
2268
2300
  token: string;
@@ -2365,10 +2397,22 @@ export declare const collections: {
2365
2397
  };
2366
2398
  };
2367
2399
  };
2368
- }>) => Promise<import("@aeriajs/types").Left<import("./collections/user/getInfo.js").ActivationErrors.InvalidLink> | import("@aeriajs/types").Left<import("./collections/user/getInfo.js").ActivationErrors.UserNotFound> | import("@aeriajs/types").Left<import("./collections/user/getInfo.js").ActivationErrors.AlreadyActiveUser> | import("@aeriajs/types").Right<{
2369
- readonly name: any;
2370
- readonly email: any;
2371
- }>>;
2400
+ }>) => Promise<import("@aeriajs/types").EndpointError<{
2401
+ readonly code: import("./collections/user/getInfo.js").ActivationError.InvalidLink;
2402
+ } & {
2403
+ httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
2404
+ }> | import("@aeriajs/types").EndpointError<{
2405
+ readonly code: import("./collections/user/getInfo.js").ActivationError.UserNotFound;
2406
+ } & {
2407
+ httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
2408
+ }> | import("@aeriajs/types").EndpointError<{
2409
+ readonly code: import("./collections/user/getInfo.js").ActivationError.AlreadyActiveUser;
2410
+ } & {
2411
+ httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
2412
+ }> | {
2413
+ name: any;
2414
+ email: any;
2415
+ }>;
2372
2416
  readonly getCurrentUser: (_payload: undefined, context: import("@aeriajs/types").Context<{
2373
2417
  readonly $id: "user";
2374
2418
  readonly required: readonly ["name", "roles", "email"];
@@ -2468,7 +2512,7 @@ export declare const collections: {
2468
2512
  };
2469
2513
  };
2470
2514
  };
2471
- }>) => Promise<import("@aeriajs/types").Right<import("@aeriajs/types").SchemaWithId<{
2515
+ }>) => Promise<import("@aeriajs/types").SchemaWithId<{
2472
2516
  readonly $id: "user";
2473
2517
  readonly required: readonly ["name", "roles", "email"];
2474
2518
  readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
@@ -2567,28 +2611,14 @@ export declare const collections: {
2567
2611
  };
2568
2612
  };
2569
2613
  };
2570
- }>> | import("@aeriajs/types").Left<{}>>;
2614
+ }>>;
2571
2615
  readonly getActivationLink: (userId: import("mongodb").ObjectId) => Promise<string>;
2572
2616
  };
2573
2617
  contracts: {
2574
2618
  readonly getCurrentUser: {
2575
- readonly response: [{
2576
- readonly type: "object";
2577
- readonly properties: {
2578
- readonly _tag: {
2579
- readonly const: "Left";
2580
- };
2581
- readonly value: import("@aeriajs/types").Property;
2582
- };
2583
- }, {
2584
- readonly type: "object";
2585
- readonly properties: {
2586
- readonly _tag: {
2587
- readonly const: "Right";
2588
- };
2589
- readonly value: import("@aeriajs/types").Property;
2590
- };
2591
- }];
2619
+ readonly response: {
2620
+ readonly $ref: "user";
2621
+ };
2592
2622
  };
2593
2623
  };
2594
2624
  exposedFunctions: any;
@@ -2794,8 +2824,8 @@ export declare const collections: {
2794
2824
  };
2795
2825
  };
2796
2826
  functions: {
2797
- readonly get: (payload: import("@aeriajs/types").GetPayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetOptions | undefined) => Promise<import("@aeriajs/types").SchemaWithId<any> | null>;
2798
- readonly getAll: (_payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<any>> | undefined, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetAllOptions | undefined) => Promise<import("@aeriajs/types").SchemaWithId<any>[]>;
2827
+ readonly get: (payload: import("@aeriajs/types").GetPayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetOptions | undefined) => Promise<any>;
2828
+ readonly getAll: (_payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<import("@aeriajs/types").Description>> | undefined, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetAllOptions | undefined) => Promise<import("@aeriajs/types").SchemaWithId<any>[]>;
2799
2829
  readonly remove: (payload: import("@aeriajs/types").RemovePayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>) => Promise<any>;
2800
2830
  readonly upload: (_props: unknown, context: import("@aeriajs/types").StrictContext<any>) => Promise<import("@aeriajs/types").Left<import("@aeriajs/types").ValidationError | import("@aeriajs/types").PropertyValidationError> | {
2801
2831
  tempId: any;
@@ -3001,7 +3031,7 @@ export declare const collections: {
3001
3031
  };
3002
3032
  };
3003
3033
  };
3004
- }>) => Promise<import("@aeriajs/types").Left<import("@aeriajs/types").ACError | import("@aeriajs/types").ValidationError> | import("@aeriajs/types").Right<import("@aeriajs/types").SchemaWithId<{
3034
+ }>) => Promise<import("@aeriajs/types").InsertReturnType<import("@aeriajs/types").SchemaWithId<{
3005
3035
  readonly $id: "user";
3006
3036
  readonly required: readonly ["name", "roles", "email"];
3007
3037
  readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
@@ -3206,7 +3236,7 @@ export declare const collections: {
3206
3236
  };
3207
3237
  };
3208
3238
  };
3209
- }>) => Promise<import("@aeriajs/types").Left<import("./collections/user/authenticate.js").AuthenticationErrors.Unauthenticated> | import("@aeriajs/types").Right<{
3239
+ }>) => Promise<{
3210
3240
  user: Pick<import("@aeriajs/types").SchemaWithId<{
3211
3241
  readonly $id: "user";
3212
3242
  readonly required: readonly ["name", "roles", "email"];
@@ -3310,7 +3340,11 @@ export declare const collections: {
3310
3340
  _id: import("mongodb").ObjectId | null;
3311
3341
  };
3312
3342
  token: import("@aeriajs/types").TokenRecipient;
3313
- } | {
3343
+ } | import("@aeriajs/types").EndpointError<{
3344
+ readonly code: import("@aeriajs/types").ACError.AuthorizationError;
3345
+ } & {
3346
+ httpStatus: import("@aeriajs/types").HTTPStatus.Unauthorized;
3347
+ }> | {
3314
3348
  user: {
3315
3349
  _id: null;
3316
3350
  name: string;
@@ -3322,7 +3356,15 @@ export declare const collections: {
3322
3356
  type: string;
3323
3357
  content: string;
3324
3358
  };
3325
- }> | import("@aeriajs/types").Left<import("./collections/user/authenticate.js").AuthenticationErrors.InvalidCredentials> | import("@aeriajs/types").Left<import("./collections/user/authenticate.js").AuthenticationErrors.InactiveUser>>;
3359
+ } | import("@aeriajs/types").EndpointError<{
3360
+ readonly code: import("./collections/user/authenticate.js").AuthenticationError.InvalidCredentials;
3361
+ } & {
3362
+ httpStatus: import("@aeriajs/types").HTTPStatus.Unauthorized;
3363
+ }> | import("@aeriajs/types").EndpointError<{
3364
+ readonly code: import("./collections/user/authenticate.js").AuthenticationError.InactiveUser;
3365
+ } & {
3366
+ httpStatus: import("@aeriajs/types").HTTPStatus.Unauthorized;
3367
+ }>>;
3326
3368
  readonly activate: (payload: {
3327
3369
  password: string;
3328
3370
  }, context: import("@aeriajs/types").Context<{
@@ -3424,7 +3466,19 @@ export declare const collections: {
3424
3466
  };
3425
3467
  };
3426
3468
  };
3427
- }>) => Promise<import("@aeriajs/types").GenericResponse | import("@aeriajs/types").Left<import("./collections/user/activate.js").ActivationErrors.InvalidLink> | import("@aeriajs/types").Left<import("./collections/user/activate.js").ActivationErrors.UserNotFound> | import("@aeriajs/types").Left<import("./collections/user/activate.js").ActivationErrors.AlreadyActiveUser> | import("@aeriajs/types").Right<true>>;
3469
+ }>) => Promise<import("@aeriajs/types").GenericResponse | import("@aeriajs/types").EndpointError<{
3470
+ readonly code: import("./collections/user/activate.js").ActivationError.InvalidLink;
3471
+ } & {
3472
+ httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
3473
+ }> | import("@aeriajs/types").EndpointError<{
3474
+ readonly code: import("./collections/user/activate.js").ActivationError.UserNotFound;
3475
+ } & {
3476
+ httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
3477
+ }> | import("@aeriajs/types").EndpointError<{
3478
+ readonly code: import("./collections/user/activate.js").ActivationError.AlreadyActiveUser;
3479
+ } & {
3480
+ httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
3481
+ }> | undefined>;
3428
3482
  readonly createAccount: (payload: Omit<Pick<{
3429
3483
  picture_file: import("@aeriajs/types").SchemaWithId<{
3430
3484
  readonly $id: "file";
@@ -3759,7 +3813,7 @@ export declare const collections: {
3759
3813
  };
3760
3814
  };
3761
3815
  };
3762
- }>) => Promise<import("@aeriajs/types").Left<import("@aeriajs/types").ValidationError | import("@aeriajs/types").PropertyValidationError> | import("@aeriajs/types").Right<any>>;
3816
+ }>) => Promise<any>;
3763
3817
  readonly getInfo: (payload: {
3764
3818
  userId: string;
3765
3819
  token: string;
@@ -3862,10 +3916,22 @@ export declare const collections: {
3862
3916
  };
3863
3917
  };
3864
3918
  };
3865
- }>) => Promise<import("@aeriajs/types").Left<import("./collections/user/getInfo.js").ActivationErrors.InvalidLink> | import("@aeriajs/types").Left<import("./collections/user/getInfo.js").ActivationErrors.UserNotFound> | import("@aeriajs/types").Left<import("./collections/user/getInfo.js").ActivationErrors.AlreadyActiveUser> | import("@aeriajs/types").Right<{
3866
- readonly name: any;
3867
- readonly email: any;
3868
- }>>;
3919
+ }>) => Promise<import("@aeriajs/types").EndpointError<{
3920
+ readonly code: import("./collections/user/getInfo.js").ActivationError.InvalidLink;
3921
+ } & {
3922
+ httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
3923
+ }> | import("@aeriajs/types").EndpointError<{
3924
+ readonly code: import("./collections/user/getInfo.js").ActivationError.UserNotFound;
3925
+ } & {
3926
+ httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
3927
+ }> | import("@aeriajs/types").EndpointError<{
3928
+ readonly code: import("./collections/user/getInfo.js").ActivationError.AlreadyActiveUser;
3929
+ } & {
3930
+ httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
3931
+ }> | {
3932
+ name: any;
3933
+ email: any;
3934
+ }>;
3869
3935
  readonly getCurrentUser: (_payload: undefined, context: import("@aeriajs/types").Context<{
3870
3936
  readonly $id: "user";
3871
3937
  readonly required: readonly ["name", "roles", "email"];
@@ -3965,7 +4031,7 @@ export declare const collections: {
3965
4031
  };
3966
4032
  };
3967
4033
  };
3968
- }>) => Promise<import("@aeriajs/types").Right<import("@aeriajs/types").SchemaWithId<{
4034
+ }>) => Promise<import("@aeriajs/types").SchemaWithId<{
3969
4035
  readonly $id: "user";
3970
4036
  readonly required: readonly ["name", "roles", "email"];
3971
4037
  readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
@@ -4064,28 +4130,14 @@ export declare const collections: {
4064
4130
  };
4065
4131
  };
4066
4132
  };
4067
- }>> | import("@aeriajs/types").Left<{}>>;
4133
+ }>>;
4068
4134
  readonly getActivationLink: (userId: import("mongodb").ObjectId) => Promise<string>;
4069
4135
  };
4070
4136
  contracts: {
4071
4137
  readonly getCurrentUser: {
4072
- readonly response: [{
4073
- readonly type: "object";
4074
- readonly properties: {
4075
- readonly _tag: {
4076
- readonly const: "Left";
4077
- };
4078
- readonly value: import("@aeriajs/types").Property;
4079
- };
4080
- }, {
4081
- readonly type: "object";
4082
- readonly properties: {
4083
- readonly _tag: {
4084
- readonly const: "Right";
4085
- };
4086
- readonly value: import("@aeriajs/types").Property;
4087
- };
4088
- }];
4138
+ readonly response: {
4139
+ readonly $ref: "user";
4140
+ };
4089
4141
  };
4090
4142
  };
4091
4143
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeriajs/builtins",
3
- "version": "0.0.87",
3
+ "version": "0.0.89",
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.87",
49
- "@aeriajs/common": "^0.0.53",
50
- "@aeriajs/entrypoint": "^0.0.53",
51
- "@aeriajs/types": "^0.0.50",
52
- "@aeriajs/validation": "^0.0.56"
48
+ "@aeriajs/core": "^0.0.89",
49
+ "@aeriajs/common": "^0.0.55",
50
+ "@aeriajs/entrypoint": "^0.0.55",
51
+ "@aeriajs/types": "^0.0.52",
52
+ "@aeriajs/validation": "^0.0.58"
53
53
  },
54
54
  "scripts": {
55
55
  "test": "echo skipping",