@aeriajs/types 0.0.76 → 0.0.77
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/functions.d.ts +2 -2
- package/dist/http.d.ts +1 -1
- package/dist/schema.d.ts +0 -33
- package/package.json +1 -1
package/dist/functions.d.ts
CHANGED
|
@@ -70,8 +70,8 @@ export type RemoveFilePayload = UploadAuxProps & {
|
|
|
70
70
|
_id: any;
|
|
71
71
|
};
|
|
72
72
|
};
|
|
73
|
-
export type InsertReturnType<TDocument> = Result.Either<StrictEndpointError<ACError.InsecureOperator | ACError.OwnershipError | ACError.ResourceNotFound | ACError.TargetImmutable | ValidationErrorCode | TraverseError.InvalidDocumentId | TraverseError.InvalidTempfile, unknown, HTTPStatus.NotFound | HTTPStatus.UnprocessableContent>, TDocument>;
|
|
74
|
-
export type GetReturnType<TDocument> = Result.Either<StrictEndpointError<ACError.ResourceNotFound | ACError.MalformedInput, unknown, HTTPStatus.NotFound | HTTPStatus.BadRequest>, TDocument>;
|
|
73
|
+
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>;
|
|
74
|
+
export type GetReturnType<TDocument> = Result.Either<StrictEndpointError<ACError.ResourceNotFound | ACError.OwnershipError | ACError.MalformedInput, unknown, HTTPStatus.Forbidden | HTTPStatus.NotFound | HTTPStatus.BadRequest>, TDocument>;
|
|
75
75
|
export type CountReturnType = Result.Either<EndpointError, number>;
|
|
76
76
|
export type GetAllReturnType<TDocument> = Result.Either<EndpointError, TDocument[]>;
|
|
77
77
|
export type RemoveReturnType<TDocument> = Result.Either<EndpointError, TDocument>;
|
package/dist/http.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare enum HTTPStatus {
|
|
|
15
15
|
InternalServerError = 500
|
|
16
16
|
}
|
|
17
17
|
export type RouteUri = `/${string}`;
|
|
18
|
-
export type RequestMethod =
|
|
18
|
+
export type RequestMethod = string;
|
|
19
19
|
export type GenericRequest = Omit<IncomingMessage, 'url' | 'method'> & {
|
|
20
20
|
readonly url: string;
|
|
21
21
|
readonly method: RequestMethod;
|
package/dist/schema.d.ts
CHANGED
|
@@ -56,18 +56,6 @@ export type InferProperties<TSchema> = TSchema extends readonly any[] ? TSchema
|
|
|
56
56
|
$ref: infer K;
|
|
57
57
|
};
|
|
58
58
|
} ? K extends keyof Collections ? 'items' extends keyof SchemaOption ? Collections[K]['item'][] : Collections[K]['item'] : never : InferProperty<SchemaOption> : never : never : InferProperty<TSchema>;
|
|
59
|
-
export type ObjectToSchema<TObject, TRequired extends string[] | null = null> = TObject extends readonly [infer K] ? ValueToProperty<[K]> : keyof TObject extends never ? {
|
|
60
|
-
type: 'object';
|
|
61
|
-
} : {
|
|
62
|
-
[P in keyof TObject]: TObject[P] extends infer Value ? ValueToProperty<Value> : never;
|
|
63
|
-
} extends infer Properties ? TRequired extends null ? {
|
|
64
|
-
type: 'object';
|
|
65
|
-
properties: Properties;
|
|
66
|
-
} : {
|
|
67
|
-
type: 'object';
|
|
68
|
-
required: TRequired;
|
|
69
|
-
properties: Properties;
|
|
70
|
-
} : never;
|
|
71
59
|
export type PackReferences<T> = {
|
|
72
60
|
[P in keyof T]: PackReferencesAux<T[P]>;
|
|
73
61
|
};
|
|
@@ -102,25 +90,4 @@ type CombineProperties<TSchema> = TSchema extends {
|
|
|
102
90
|
[P in Exclude<keyof Properties, keyof ReadonlyProperties>]: InferProperty<Properties[P]>;
|
|
103
91
|
} : never : never;
|
|
104
92
|
type MergeReferences<TSchema> = CombineProperties<TSchema> extends infer CombinedProperties ? MapReferences<TSchema> extends infer MappedReferences ? MappedReferences & Omit<CombinedProperties, keyof MappedReferences> : never : never;
|
|
105
|
-
type ValueToProperty<TValue> = TValue extends `$${infer Ref}` ? {
|
|
106
|
-
$ref: Ref;
|
|
107
|
-
} : TValue extends string ? {
|
|
108
|
-
type: 'string';
|
|
109
|
-
} : TValue extends number ? {
|
|
110
|
-
type: 'number';
|
|
111
|
-
} : TValue extends boolean ? {
|
|
112
|
-
type: 'boolean';
|
|
113
|
-
} : TValue extends new () => Date ? {
|
|
114
|
-
type: 'string';
|
|
115
|
-
format: 'date';
|
|
116
|
-
} : TValue extends readonly [infer K] ? {
|
|
117
|
-
type: 'array';
|
|
118
|
-
items: ValueToProperty<K>;
|
|
119
|
-
} : TValue extends (infer K)[] ? {
|
|
120
|
-
enum: K;
|
|
121
|
-
} : TValue extends Record<string, any> ? keyof TValue extends never ? {
|
|
122
|
-
type: 'object';
|
|
123
|
-
} : {
|
|
124
|
-
type: 'object';
|
|
125
|
-
} & ObjectToSchema<TValue> : never;
|
|
126
93
|
export {};
|