@aeriajs/types 0.0.88 → 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.
- package/dist/condition.d.ts +1 -1
- package/dist/config.d.ts +4 -1
- package/dist/functions.d.ts +1 -1
- package/dist/schema.d.ts +2 -2
- package/package.json +1 -1
package/dist/condition.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export type FinalOperator = 'equal' | 'in' | 'gt' | 'lt' | 'gte' | 'lte';
|
|
|
3
3
|
export type FinalCondition<TSchema extends JsonSchema> = {
|
|
4
4
|
operator: FinalOperator;
|
|
5
5
|
term1: PropertiesWithId<TSchema>;
|
|
6
|
-
term2:
|
|
6
|
+
term2: string | boolean | number | Condition;
|
|
7
7
|
fromState?: boolean;
|
|
8
8
|
};
|
|
9
9
|
export type RegexCondition<TSchema extends JsonSchema> = {
|
package/dist/config.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { RouteContext } from './context.js';
|
|
2
2
|
import type { RouteUri } from './http.js';
|
|
3
3
|
import type { RateLimitingParams } from './security.js';
|
|
4
|
+
import type { CollectionItem } from './collection.js';
|
|
4
5
|
export type ApiConfig = {
|
|
6
|
+
name?: string;
|
|
5
7
|
secret?: string;
|
|
6
8
|
baseUrl?: RouteUri;
|
|
7
9
|
publicUrl?: string;
|
|
@@ -21,6 +23,7 @@ export type ApiConfig = {
|
|
|
21
23
|
password: string;
|
|
22
24
|
};
|
|
23
25
|
security: {
|
|
26
|
+
tokenExpiration?: number;
|
|
24
27
|
logSuccessfulAuthentications?: boolean;
|
|
25
28
|
authenticationRateLimiting?: RateLimitingParams | null;
|
|
26
29
|
allowSignup?: boolean;
|
|
@@ -31,6 +34,6 @@ export type ApiConfig = {
|
|
|
31
34
|
paginationLimit?: number;
|
|
32
35
|
exposeFunctionsByDefault?: boolean | 'unauthenticated';
|
|
33
36
|
};
|
|
34
|
-
tokenUserProperties?:
|
|
37
|
+
tokenUserProperties?: (keyof CollectionItem<'user'>)[];
|
|
35
38
|
errorHandler?: <TError>(context: RouteContext, error: TError) => unknown | Promise<unknown>;
|
|
36
39
|
};
|
package/dist/functions.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ export type RemoveFilePayload = UploadAuxProps & {
|
|
|
69
69
|
_id: ObjectId | string;
|
|
70
70
|
};
|
|
71
71
|
};
|
|
72
|
-
export type InsertReturnType<TDocument> = Result.Either<StrictEndpointError<ACError.InsecureOperator | ACError.OwnershipError | ACError.ResourceNotFound | ACError.TargetImmutable | ValidationErrorCode | TraverseError.InvalidDocumentId | TraverseError.InvalidTempfile, unknown, HTTPStatus.Forbidden | HTTPStatus.NotFound | HTTPStatus.UnprocessableContent>, TDocument>;
|
|
72
|
+
export type InsertReturnType<TDocument> = Result.Either<StrictEndpointError<ACError.InsecureOperator | ACError.OwnershipError | ACError.ResourceNotFound | ACError.TargetImmutable | ACError.MalformedInput | ValidationErrorCode | TraverseError.InvalidDocumentId | TraverseError.InvalidTempfile, unknown, HTTPStatus.Forbidden | HTTPStatus.NotFound | HTTPStatus.UnprocessableContent | HTTPStatus.BadRequest>, TDocument>;
|
|
73
73
|
export type GetReturnType<TDocument> = Result.Either<StrictEndpointError<ACError.ResourceNotFound | ACError.OwnershipError | ACError.MalformedInput, unknown, HTTPStatus.Forbidden | HTTPStatus.NotFound | HTTPStatus.BadRequest>, TDocument>;
|
|
74
74
|
export type CountReturnType = Result.Either<EndpointError, number>;
|
|
75
75
|
export type GetAllReturnType<TDocument> = Result.Either<EndpointError, TDocument[]>;
|
package/dist/schema.d.ts
CHANGED
|
@@ -43,8 +43,8 @@ export type InferProperty<T> = T extends TestType<{
|
|
|
43
43
|
export type InferSchema<TSchema> = MergeReferences<TSchema> extends infer MappedTypes ? TSchema extends {
|
|
44
44
|
Required: readonly [];
|
|
45
45
|
} ? Partial<MappedTypes> : TSchema extends {
|
|
46
|
-
required: infer
|
|
47
|
-
} ?
|
|
46
|
+
required: infer InferredRequired;
|
|
47
|
+
} ? InferredRequired extends readonly (keyof MappedTypes)[] ? Pick<MappedTypes, InferredRequired[number]> extends infer RequiredProps ? RequiredProps & Partial<Exclude<MappedTypes, keyof RequiredProps>> : never : MappedTypes : MappedTypes : never;
|
|
48
48
|
export type Schema<TSchema> = CaseTimestamped<TSchema, CaseOwned<TSchema, InferSchema<TSchema>>>;
|
|
49
49
|
export type SchemaWithId<TSchema> = Schema<TSchema> & {
|
|
50
50
|
_id: ObjectId;
|