@aeriajs/builtins 0.0.88 → 0.0.90

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/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,10 +1305,15 @@ 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
- readonly upload: (_props: unknown, context: import("@aeriajs/types").StrictContext<any>) => Promise<import("@aeriajs/types").Left<import("@aeriajs/types").ValidationError | import("@aeriajs/types").PropertyValidationError> | {
1311
+ readonly upload: (_props: unknown, context: import("@aeriajs/types").StrictContext<any>) => Promise<import("@aeriajs/types").EndpointError<{
1312
+ readonly code: import("@aeriajs/types").ACError.MalformedInput;
1313
+ readonly details: import("@aeriajs/types").ValidationError | import("@aeriajs/types").PropertyValidationError;
1314
+ } & {
1315
+ httpStatus: import("@aeriajs/types").HTTPStatus.BadRequest;
1316
+ }> | {
1304
1317
  tempId: any;
1305
1318
  }>;
1306
1319
  readonly removeFile: (payload: import("@aeriajs/types").RemoveFilePayload, context: import("@aeriajs/types").StrictContext<any>) => Promise<any>;
@@ -1504,7 +1517,7 @@ export declare const collections: {
1504
1517
  };
1505
1518
  };
1506
1519
  };
1507
- }>) => Promise<import("@aeriajs/types").Left<import("@aeriajs/types").ACError | import("@aeriajs/types").ValidationError> | import("@aeriajs/types").Right<import("@aeriajs/types").SchemaWithId<{
1520
+ }>) => Promise<import("@aeriajs/types").InsertReturnType<import("@aeriajs/types").SchemaWithId<{
1508
1521
  readonly $id: "user";
1509
1522
  readonly required: readonly ["name", "roles", "email"];
1510
1523
  readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
@@ -1709,7 +1722,7 @@ export declare const collections: {
1709
1722
  };
1710
1723
  };
1711
1724
  };
1712
- }>) => Promise<import("@aeriajs/types").Left<import("./collections/user/authenticate.js").AuthenticationErrors.Unauthenticated> | import("@aeriajs/types").Right<{
1725
+ }>) => Promise<{
1713
1726
  user: Pick<import("@aeriajs/types").SchemaWithId<{
1714
1727
  readonly $id: "user";
1715
1728
  readonly required: readonly ["name", "roles", "email"];
@@ -1813,7 +1826,11 @@ export declare const collections: {
1813
1826
  _id: import("mongodb").ObjectId | null;
1814
1827
  };
1815
1828
  token: import("@aeriajs/types").TokenRecipient;
1816
- } | {
1829
+ } | import("@aeriajs/types").EndpointError<{
1830
+ readonly code: import("@aeriajs/types").ACError.AuthorizationError;
1831
+ } & {
1832
+ httpStatus: import("@aeriajs/types").HTTPStatus.Unauthorized;
1833
+ }> | {
1817
1834
  user: {
1818
1835
  _id: null;
1819
1836
  name: string;
@@ -1825,7 +1842,15 @@ export declare const collections: {
1825
1842
  type: string;
1826
1843
  content: string;
1827
1844
  };
1828
- }> | import("@aeriajs/types").Left<import("./collections/user/authenticate.js").AuthenticationErrors.InvalidCredentials> | import("@aeriajs/types").Left<import("./collections/user/authenticate.js").AuthenticationErrors.InactiveUser>>;
1845
+ } | import("@aeriajs/types").EndpointError<{
1846
+ readonly code: import("./collections/user/authenticate.js").AuthenticationError.InvalidCredentials;
1847
+ } & {
1848
+ httpStatus: import("@aeriajs/types").HTTPStatus.Unauthorized;
1849
+ }> | import("@aeriajs/types").EndpointError<{
1850
+ readonly code: import("./collections/user/authenticate.js").AuthenticationError.InactiveUser;
1851
+ } & {
1852
+ httpStatus: import("@aeriajs/types").HTTPStatus.Unauthorized;
1853
+ }>>;
1829
1854
  readonly activate: (payload: {
1830
1855
  password: string;
1831
1856
  }, context: import("@aeriajs/types").Context<{
@@ -1927,7 +1952,19 @@ export declare const collections: {
1927
1952
  };
1928
1953
  };
1929
1954
  };
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>>;
1955
+ }>) => Promise<import("@aeriajs/types").GenericResponse | import("@aeriajs/types").EndpointError<{
1956
+ readonly code: import("./collections/user/activate.js").ActivationError.InvalidLink;
1957
+ } & {
1958
+ httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
1959
+ }> | import("@aeriajs/types").EndpointError<{
1960
+ readonly code: import("./collections/user/activate.js").ActivationError.UserNotFound;
1961
+ } & {
1962
+ httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
1963
+ }> | import("@aeriajs/types").EndpointError<{
1964
+ readonly code: import("./collections/user/activate.js").ActivationError.AlreadyActiveUser;
1965
+ } & {
1966
+ httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
1967
+ }> | undefined>;
1931
1968
  readonly createAccount: (payload: Omit<Pick<{
1932
1969
  picture_file: import("@aeriajs/types").SchemaWithId<{
1933
1970
  readonly $id: "file";
@@ -2262,7 +2299,7 @@ export declare const collections: {
2262
2299
  };
2263
2300
  };
2264
2301
  };
2265
- }>) => Promise<import("@aeriajs/types").Left<import("@aeriajs/types").ValidationError | import("@aeriajs/types").PropertyValidationError> | import("@aeriajs/types").Right<any>>;
2302
+ }>) => Promise<any>;
2266
2303
  readonly getInfo: (payload: {
2267
2304
  userId: string;
2268
2305
  token: string;
@@ -2365,10 +2402,22 @@ export declare const collections: {
2365
2402
  };
2366
2403
  };
2367
2404
  };
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
- }>>;
2405
+ }>) => Promise<import("@aeriajs/types").EndpointError<{
2406
+ readonly code: import("./collections/user/getInfo.js").ActivationError.InvalidLink;
2407
+ } & {
2408
+ httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
2409
+ }> | import("@aeriajs/types").EndpointError<{
2410
+ readonly code: import("./collections/user/getInfo.js").ActivationError.UserNotFound;
2411
+ } & {
2412
+ httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
2413
+ }> | import("@aeriajs/types").EndpointError<{
2414
+ readonly code: import("./collections/user/getInfo.js").ActivationError.AlreadyActiveUser;
2415
+ } & {
2416
+ httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
2417
+ }> | {
2418
+ name: any;
2419
+ email: any;
2420
+ }>;
2372
2421
  readonly getCurrentUser: (_payload: undefined, context: import("@aeriajs/types").Context<{
2373
2422
  readonly $id: "user";
2374
2423
  readonly required: readonly ["name", "roles", "email"];
@@ -2468,7 +2517,7 @@ export declare const collections: {
2468
2517
  };
2469
2518
  };
2470
2519
  };
2471
- }>) => Promise<import("@aeriajs/types").Right<import("@aeriajs/types").SchemaWithId<{
2520
+ }>) => Promise<import("@aeriajs/types").SchemaWithId<{
2472
2521
  readonly $id: "user";
2473
2522
  readonly required: readonly ["name", "roles", "email"];
2474
2523
  readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
@@ -2567,28 +2616,14 @@ export declare const collections: {
2567
2616
  };
2568
2617
  };
2569
2618
  };
2570
- }>> | import("@aeriajs/types").Left<{}>>;
2619
+ }>>;
2571
2620
  readonly getActivationLink: (userId: import("mongodb").ObjectId) => Promise<string>;
2572
2621
  };
2573
2622
  contracts: {
2574
2623
  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
- }];
2624
+ readonly response: {
2625
+ readonly $ref: "user";
2626
+ };
2592
2627
  };
2593
2628
  };
2594
2629
  exposedFunctions: any;
@@ -2794,10 +2829,15 @@ export declare const collections: {
2794
2829
  };
2795
2830
  };
2796
2831
  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>[]>;
2832
+ 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>;
2833
+ 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
2834
  readonly remove: (payload: import("@aeriajs/types").RemovePayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>) => Promise<any>;
2800
- readonly upload: (_props: unknown, context: import("@aeriajs/types").StrictContext<any>) => Promise<import("@aeriajs/types").Left<import("@aeriajs/types").ValidationError | import("@aeriajs/types").PropertyValidationError> | {
2835
+ readonly upload: (_props: unknown, context: import("@aeriajs/types").StrictContext<any>) => Promise<import("@aeriajs/types").EndpointError<{
2836
+ readonly code: import("@aeriajs/types").ACError.MalformedInput;
2837
+ readonly details: import("@aeriajs/types").ValidationError | import("@aeriajs/types").PropertyValidationError;
2838
+ } & {
2839
+ httpStatus: import("@aeriajs/types").HTTPStatus.BadRequest;
2840
+ }> | {
2801
2841
  tempId: any;
2802
2842
  }>;
2803
2843
  readonly removeFile: (payload: import("@aeriajs/types").RemoveFilePayload, context: import("@aeriajs/types").StrictContext<any>) => Promise<any>;
@@ -3001,7 +3041,7 @@ export declare const collections: {
3001
3041
  };
3002
3042
  };
3003
3043
  };
3004
- }>) => Promise<import("@aeriajs/types").Left<import("@aeriajs/types").ACError | import("@aeriajs/types").ValidationError> | import("@aeriajs/types").Right<import("@aeriajs/types").SchemaWithId<{
3044
+ }>) => Promise<import("@aeriajs/types").InsertReturnType<import("@aeriajs/types").SchemaWithId<{
3005
3045
  readonly $id: "user";
3006
3046
  readonly required: readonly ["name", "roles", "email"];
3007
3047
  readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
@@ -3206,7 +3246,7 @@ export declare const collections: {
3206
3246
  };
3207
3247
  };
3208
3248
  };
3209
- }>) => Promise<import("@aeriajs/types").Left<import("./collections/user/authenticate.js").AuthenticationErrors.Unauthenticated> | import("@aeriajs/types").Right<{
3249
+ }>) => Promise<{
3210
3250
  user: Pick<import("@aeriajs/types").SchemaWithId<{
3211
3251
  readonly $id: "user";
3212
3252
  readonly required: readonly ["name", "roles", "email"];
@@ -3310,7 +3350,11 @@ export declare const collections: {
3310
3350
  _id: import("mongodb").ObjectId | null;
3311
3351
  };
3312
3352
  token: import("@aeriajs/types").TokenRecipient;
3313
- } | {
3353
+ } | import("@aeriajs/types").EndpointError<{
3354
+ readonly code: import("@aeriajs/types").ACError.AuthorizationError;
3355
+ } & {
3356
+ httpStatus: import("@aeriajs/types").HTTPStatus.Unauthorized;
3357
+ }> | {
3314
3358
  user: {
3315
3359
  _id: null;
3316
3360
  name: string;
@@ -3322,7 +3366,15 @@ export declare const collections: {
3322
3366
  type: string;
3323
3367
  content: string;
3324
3368
  };
3325
- }> | import("@aeriajs/types").Left<import("./collections/user/authenticate.js").AuthenticationErrors.InvalidCredentials> | import("@aeriajs/types").Left<import("./collections/user/authenticate.js").AuthenticationErrors.InactiveUser>>;
3369
+ } | import("@aeriajs/types").EndpointError<{
3370
+ readonly code: import("./collections/user/authenticate.js").AuthenticationError.InvalidCredentials;
3371
+ } & {
3372
+ httpStatus: import("@aeriajs/types").HTTPStatus.Unauthorized;
3373
+ }> | import("@aeriajs/types").EndpointError<{
3374
+ readonly code: import("./collections/user/authenticate.js").AuthenticationError.InactiveUser;
3375
+ } & {
3376
+ httpStatus: import("@aeriajs/types").HTTPStatus.Unauthorized;
3377
+ }>>;
3326
3378
  readonly activate: (payload: {
3327
3379
  password: string;
3328
3380
  }, context: import("@aeriajs/types").Context<{
@@ -3424,7 +3476,19 @@ export declare const collections: {
3424
3476
  };
3425
3477
  };
3426
3478
  };
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>>;
3479
+ }>) => Promise<import("@aeriajs/types").GenericResponse | import("@aeriajs/types").EndpointError<{
3480
+ readonly code: import("./collections/user/activate.js").ActivationError.InvalidLink;
3481
+ } & {
3482
+ httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
3483
+ }> | import("@aeriajs/types").EndpointError<{
3484
+ readonly code: import("./collections/user/activate.js").ActivationError.UserNotFound;
3485
+ } & {
3486
+ httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
3487
+ }> | import("@aeriajs/types").EndpointError<{
3488
+ readonly code: import("./collections/user/activate.js").ActivationError.AlreadyActiveUser;
3489
+ } & {
3490
+ httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
3491
+ }> | undefined>;
3428
3492
  readonly createAccount: (payload: Omit<Pick<{
3429
3493
  picture_file: import("@aeriajs/types").SchemaWithId<{
3430
3494
  readonly $id: "file";
@@ -3759,7 +3823,7 @@ export declare const collections: {
3759
3823
  };
3760
3824
  };
3761
3825
  };
3762
- }>) => Promise<import("@aeriajs/types").Left<import("@aeriajs/types").ValidationError | import("@aeriajs/types").PropertyValidationError> | import("@aeriajs/types").Right<any>>;
3826
+ }>) => Promise<any>;
3763
3827
  readonly getInfo: (payload: {
3764
3828
  userId: string;
3765
3829
  token: string;
@@ -3862,10 +3926,22 @@ export declare const collections: {
3862
3926
  };
3863
3927
  };
3864
3928
  };
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
- }>>;
3929
+ }>) => Promise<import("@aeriajs/types").EndpointError<{
3930
+ readonly code: import("./collections/user/getInfo.js").ActivationError.InvalidLink;
3931
+ } & {
3932
+ httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
3933
+ }> | import("@aeriajs/types").EndpointError<{
3934
+ readonly code: import("./collections/user/getInfo.js").ActivationError.UserNotFound;
3935
+ } & {
3936
+ httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
3937
+ }> | import("@aeriajs/types").EndpointError<{
3938
+ readonly code: import("./collections/user/getInfo.js").ActivationError.AlreadyActiveUser;
3939
+ } & {
3940
+ httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
3941
+ }> | {
3942
+ name: any;
3943
+ email: any;
3944
+ }>;
3869
3945
  readonly getCurrentUser: (_payload: undefined, context: import("@aeriajs/types").Context<{
3870
3946
  readonly $id: "user";
3871
3947
  readonly required: readonly ["name", "roles", "email"];
@@ -3965,7 +4041,7 @@ export declare const collections: {
3965
4041
  };
3966
4042
  };
3967
4043
  };
3968
- }>) => Promise<import("@aeriajs/types").Right<import("@aeriajs/types").SchemaWithId<{
4044
+ }>) => Promise<import("@aeriajs/types").SchemaWithId<{
3969
4045
  readonly $id: "user";
3970
4046
  readonly required: readonly ["name", "roles", "email"];
3971
4047
  readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
@@ -4064,28 +4140,14 @@ export declare const collections: {
4064
4140
  };
4065
4141
  };
4066
4142
  };
4067
- }>> | import("@aeriajs/types").Left<{}>>;
4143
+ }>>;
4068
4144
  readonly getActivationLink: (userId: import("mongodb").ObjectId) => Promise<string>;
4069
4145
  };
4070
4146
  contracts: {
4071
4147
  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
- }];
4148
+ readonly response: {
4149
+ readonly $ref: "user";
4150
+ };
4089
4151
  };
4090
4152
  };
4091
4153
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeriajs/builtins",
3
- "version": "0.0.88",
3
+ "version": "0.0.90",
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.88",
49
- "@aeriajs/common": "^0.0.54",
50
- "@aeriajs/entrypoint": "^0.0.54",
51
- "@aeriajs/types": "^0.0.51",
52
- "@aeriajs/validation": "^0.0.57"
48
+ "@aeriajs/core": "^0.0.90",
49
+ "@aeriajs/common": "^0.0.56",
50
+ "@aeriajs/entrypoint": "^0.0.56",
51
+ "@aeriajs/types": "^0.0.53",
52
+ "@aeriajs/validation": "^0.0.59"
53
53
  },
54
54
  "scripts": {
55
55
  "test": "echo skipping",