@aeriajs/types 0.0.102 → 0.0.104
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/context.d.ts +3 -3
- package/dist/functionSchemas.d.ts +4 -4
- package/dist/functions.d.ts +3 -5
- package/dist/http.d.ts +1 -0
- package/dist/http.js +1 -0
- package/dist/http.mjs +1 -0
- package/dist/property.d.ts +1 -3
- package/dist/resultSchemas.d.ts +2 -2
- package/dist/resultSchemas.js +2 -2
- package/dist/resultSchemas.mjs +2 -2
- package/dist/schema.d.ts +2 -2
- package/dist/security.d.ts +1 -1
- package/package.json +1 -1
package/dist/context.d.ts
CHANGED
|
@@ -19,11 +19,11 @@ type UnionFunctions<TFunctions, TSchema extends JsonSchema> = {
|
|
|
19
19
|
};
|
|
20
20
|
export type IndepthCollection<TCollection> = TCollection extends {
|
|
21
21
|
description: infer InferredDescription;
|
|
22
|
-
functions?: infer
|
|
22
|
+
functions?: infer InferredFunctions;
|
|
23
23
|
} ? InferredDescription extends JsonSchema ? Omit<TCollection, 'functions'> & {
|
|
24
24
|
item: SchemaWithId<InferredDescription>;
|
|
25
|
-
functions: UnionFunctions<
|
|
26
|
-
originalFunctions:
|
|
25
|
+
functions: UnionFunctions<InferredFunctions, InferredDescription>;
|
|
26
|
+
originalFunctions: InferredFunctions;
|
|
27
27
|
model: InferredDescription extends Description ? CollectionModel<InferredDescription> : never;
|
|
28
28
|
middlewares?: Collection['middlewares'];
|
|
29
29
|
} : never : TCollection;
|
|
@@ -25,7 +25,7 @@ export declare const insertError: () => {
|
|
|
25
25
|
};
|
|
26
26
|
readonly details: {
|
|
27
27
|
readonly type: "object";
|
|
28
|
-
readonly
|
|
28
|
+
readonly additionalProperties: true;
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
31
|
};
|
|
@@ -55,7 +55,7 @@ export declare const getError: () => {
|
|
|
55
55
|
};
|
|
56
56
|
readonly details: {
|
|
57
57
|
readonly type: "object";
|
|
58
|
-
readonly
|
|
58
|
+
readonly additionalProperties: true;
|
|
59
59
|
};
|
|
60
60
|
};
|
|
61
61
|
};
|
|
@@ -85,7 +85,7 @@ export declare const getAllError: () => {
|
|
|
85
85
|
};
|
|
86
86
|
readonly details: {
|
|
87
87
|
readonly type: "object";
|
|
88
|
-
readonly
|
|
88
|
+
readonly additionalProperties: true;
|
|
89
89
|
};
|
|
90
90
|
};
|
|
91
91
|
};
|
|
@@ -115,7 +115,7 @@ export declare const countError: () => {
|
|
|
115
115
|
};
|
|
116
116
|
readonly details: {
|
|
117
117
|
readonly type: "object";
|
|
118
|
-
readonly
|
|
118
|
+
readonly additionalProperties: true;
|
|
119
119
|
};
|
|
120
120
|
};
|
|
121
121
|
};
|
package/dist/functions.d.ts
CHANGED
|
@@ -61,9 +61,7 @@ export type InsertPayload<TDocument extends WithId<unknown>> = {
|
|
|
61
61
|
export type RemovePayload<TDocument extends WithId<unknown>> = {
|
|
62
62
|
filters: Filters<TDocument>;
|
|
63
63
|
};
|
|
64
|
-
export type RemoveAllPayload =
|
|
65
|
-
filters: (ObjectId | string)[];
|
|
66
|
-
};
|
|
64
|
+
export type RemoveAllPayload<TDocument extends WithId<unknown>> = GetPayload<TDocument>;
|
|
67
65
|
export type RemoveFilePayload = UploadAuxProps & {
|
|
68
66
|
filters: {
|
|
69
67
|
_id: ObjectId | string;
|
|
@@ -86,7 +84,7 @@ export type CollectionFunctions<TSchema extends JsonSchema = JsonSchema> = Schem
|
|
|
86
84
|
keepTempIds: true;
|
|
87
85
|
}>>) => Promise<InsertReturnType<InferredDocument>>;
|
|
88
86
|
remove: (payload: RemovePayload<InferredDocument>) => Promise<RemoveReturnType<InferredDocument>>;
|
|
89
|
-
removeAll: (payload: RemoveAllPayload) => Promise<unknown>;
|
|
87
|
+
removeAll: (payload: RemoveAllPayload<InferredDocument>) => Promise<unknown>;
|
|
90
88
|
removeFile: (payload: RemoveFilePayload) => Promise<unknown>;
|
|
91
89
|
} : never : never;
|
|
92
90
|
export type CollectionFunctionsSDK<TSchema extends JsonSchema = JsonSchema> = SchemaWithId<TSchema> extends infer InferredDocument ? InferredDocument extends WithId<unknown> ? {
|
|
@@ -97,7 +95,7 @@ export type CollectionFunctionsSDK<TSchema extends JsonSchema = JsonSchema> = Sc
|
|
|
97
95
|
keepTempIds: true;
|
|
98
96
|
}>>) => Promise<WithACErrors<InsertReturnType<InferredDocument>>>;
|
|
99
97
|
remove: (payload: RemovePayload<InferredDocument>) => Promise<WithACErrors<RemoveReturnType<InferredDocument>>>;
|
|
100
|
-
removeAll: (payload: RemoveAllPayload) => Promise<unknown>;
|
|
98
|
+
removeAll: (payload: RemoveAllPayload<InferredDocument>) => Promise<unknown>;
|
|
101
99
|
removeFile: (payload: RemoveFilePayload) => Promise<unknown>;
|
|
102
100
|
} : never : never;
|
|
103
101
|
export {};
|
package/dist/http.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type { RateLimitingError } from './security.js';
|
|
|
6
6
|
export declare const REQUEST_METHODS: readonly ["GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS", "PATCH", "TRACE", "SEARCH"];
|
|
7
7
|
export declare enum HTTPStatus {
|
|
8
8
|
Ok = 200,
|
|
9
|
+
NoContent = 204,
|
|
9
10
|
BadRequest = 400,
|
|
10
11
|
Unauthorized = 401,
|
|
11
12
|
Forbidden = 403,
|
package/dist/http.js
CHANGED
|
@@ -15,6 +15,7 @@ exports.REQUEST_METHODS = [
|
|
|
15
15
|
var HTTPStatus;
|
|
16
16
|
(function (HTTPStatus) {
|
|
17
17
|
HTTPStatus[HTTPStatus["Ok"] = 200] = "Ok";
|
|
18
|
+
HTTPStatus[HTTPStatus["NoContent"] = 204] = "NoContent";
|
|
18
19
|
HTTPStatus[HTTPStatus["BadRequest"] = 400] = "BadRequest";
|
|
19
20
|
HTTPStatus[HTTPStatus["Unauthorized"] = 401] = "Unauthorized";
|
|
20
21
|
HTTPStatus[HTTPStatus["Forbidden"] = 403] = "Forbidden";
|
package/dist/http.mjs
CHANGED
|
@@ -12,6 +12,7 @@ export const REQUEST_METHODS = [
|
|
|
12
12
|
];
|
|
13
13
|
export var HTTPStatus = /* @__PURE__ */ ((HTTPStatus2) => {
|
|
14
14
|
HTTPStatus2[HTTPStatus2["Ok"] = 200] = "Ok";
|
|
15
|
+
HTTPStatus2[HTTPStatus2["NoContent"] = 204] = "NoContent";
|
|
15
16
|
HTTPStatus2[HTTPStatus2["BadRequest"] = 400] = "BadRequest";
|
|
16
17
|
HTTPStatus2[HTTPStatus2["Unauthorized"] = 401] = "Unauthorized";
|
|
17
18
|
HTTPStatus2[HTTPStatus2["Forbidden"] = 403] = "Forbidden";
|
package/dist/property.d.ts
CHANGED
|
@@ -57,9 +57,7 @@ export type FixedObjectProperty = {
|
|
|
57
57
|
writable?: readonly string[];
|
|
58
58
|
};
|
|
59
59
|
export type VariableObjectProperty = {
|
|
60
|
-
|
|
61
|
-
} | {
|
|
62
|
-
additionalProperties: boolean | Property;
|
|
60
|
+
additionalProperties: true | Property;
|
|
63
61
|
};
|
|
64
62
|
export type ObjectProperty = (FixedObjectProperty | VariableObjectProperty) & {
|
|
65
63
|
type: 'object';
|
package/dist/resultSchemas.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export declare const endpointErrorSchema: <const THTTPStatus extends HTTPStatus[
|
|
|
51
51
|
};
|
|
52
52
|
readonly details: {
|
|
53
53
|
readonly type: "object";
|
|
54
|
-
readonly
|
|
54
|
+
readonly additionalProperties: true;
|
|
55
55
|
};
|
|
56
56
|
};
|
|
57
57
|
};
|
|
@@ -81,7 +81,7 @@ export declare const genericEndpointErrorSchema: () => {
|
|
|
81
81
|
};
|
|
82
82
|
readonly details: {
|
|
83
83
|
readonly type: "object";
|
|
84
|
-
readonly
|
|
84
|
+
readonly additionalProperties: true;
|
|
85
85
|
};
|
|
86
86
|
};
|
|
87
87
|
};
|
package/dist/resultSchemas.js
CHANGED
|
@@ -59,7 +59,7 @@ const endpointErrorSchema = (error) => {
|
|
|
59
59
|
},
|
|
60
60
|
details: {
|
|
61
61
|
type: 'object',
|
|
62
|
-
|
|
62
|
+
additionalProperties: true,
|
|
63
63
|
},
|
|
64
64
|
},
|
|
65
65
|
},
|
|
@@ -95,7 +95,7 @@ const genericEndpointErrorSchema = () => {
|
|
|
95
95
|
},
|
|
96
96
|
details: {
|
|
97
97
|
type: 'object',
|
|
98
|
-
|
|
98
|
+
additionalProperties: true,
|
|
99
99
|
},
|
|
100
100
|
},
|
|
101
101
|
},
|
package/dist/resultSchemas.mjs
CHANGED
|
@@ -55,7 +55,7 @@ export const endpointErrorSchema = (error) => {
|
|
|
55
55
|
},
|
|
56
56
|
details: {
|
|
57
57
|
type: "object",
|
|
58
|
-
|
|
58
|
+
additionalProperties: true
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
}
|
|
@@ -90,7 +90,7 @@ export const genericEndpointErrorSchema = () => {
|
|
|
90
90
|
},
|
|
91
91
|
details: {
|
|
92
92
|
type: "object",
|
|
93
|
-
|
|
93
|
+
additionalProperties: true
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
}
|
package/dist/schema.d.ts
CHANGED
|
@@ -28,12 +28,12 @@ export type InferProperty<T> = T extends TestType<{
|
|
|
28
28
|
}> ? Schema<T & {
|
|
29
29
|
timestamps: false;
|
|
30
30
|
}> : T extends TestType<{
|
|
31
|
+
additionalProperties: true;
|
|
32
|
+
}> ? any : T extends TestType<{
|
|
31
33
|
additionalProperties: infer K;
|
|
32
34
|
}> ? {
|
|
33
35
|
[P: string]: InferProperty<K> | undefined;
|
|
34
36
|
} : T extends TestType<{
|
|
35
|
-
type: 'object';
|
|
36
|
-
}> ? any : T extends TestType<{
|
|
37
37
|
items: infer K;
|
|
38
38
|
}> ? InferProperty<K>[] : T extends TestType<{
|
|
39
39
|
getter: (doc: unknown) => infer K;
|
package/dist/security.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ export type CollectionProps<TPayload> = {
|
|
|
40
40
|
payload: TPayload;
|
|
41
41
|
};
|
|
42
42
|
export type CollectionReadPayload = {
|
|
43
|
-
filters: Record<string, unknown
|
|
43
|
+
filters: Record<string, unknown>;
|
|
44
44
|
sort?: QuerySort<unknown>;
|
|
45
45
|
limit?: number;
|
|
46
46
|
offset?: number;
|