@aeriajs/types 0.0.93 → 0.0.95
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/http.d.ts +1 -0
- package/dist/http.js +1 -0
- package/dist/http.mjs +1 -0
- package/dist/property.d.ts +3 -6
- package/dist/security.d.ts +1 -3
- package/package.json +1 -1
package/dist/http.d.ts
CHANGED
package/dist/http.js
CHANGED
|
@@ -19,6 +19,7 @@ var HTTPStatus;
|
|
|
19
19
|
HTTPStatus[HTTPStatus["Unauthorized"] = 401] = "Unauthorized";
|
|
20
20
|
HTTPStatus[HTTPStatus["Forbidden"] = 403] = "Forbidden";
|
|
21
21
|
HTTPStatus[HTTPStatus["NotFound"] = 404] = "NotFound";
|
|
22
|
+
HTTPStatus[HTTPStatus["RangeNotSatisfiable"] = 416] = "RangeNotSatisfiable";
|
|
22
23
|
HTTPStatus[HTTPStatus["UnprocessableContent"] = 422] = "UnprocessableContent";
|
|
23
24
|
HTTPStatus[HTTPStatus["TooManyRequests"] = 429] = "TooManyRequests";
|
|
24
25
|
HTTPStatus[HTTPStatus["InternalServerError"] = 500] = "InternalServerError";
|
package/dist/http.mjs
CHANGED
|
@@ -16,6 +16,7 @@ export var HTTPStatus = /* @__PURE__ */ ((HTTPStatus2) => {
|
|
|
16
16
|
HTTPStatus2[HTTPStatus2["Unauthorized"] = 401] = "Unauthorized";
|
|
17
17
|
HTTPStatus2[HTTPStatus2["Forbidden"] = 403] = "Forbidden";
|
|
18
18
|
HTTPStatus2[HTTPStatus2["NotFound"] = 404] = "NotFound";
|
|
19
|
+
HTTPStatus2[HTTPStatus2["RangeNotSatisfiable"] = 416] = "RangeNotSatisfiable";
|
|
19
20
|
HTTPStatus2[HTTPStatus2["UnprocessableContent"] = 422] = "UnprocessableContent";
|
|
20
21
|
HTTPStatus2[HTTPStatus2["TooManyRequests"] = 429] = "TooManyRequests";
|
|
21
22
|
HTTPStatus2[HTTPStatus2["InternalServerError"] = 500] = "InternalServerError";
|
package/dist/property.d.ts
CHANGED
|
@@ -20,11 +20,11 @@ export type NonCircularJsonSchema<TJsonSchema extends NonCircularJsonSchema = an
|
|
|
20
20
|
export type RefProperty = {
|
|
21
21
|
$ref: Exclude<keyof Collections, 'file'> & string;
|
|
22
22
|
indexes?: readonly string[];
|
|
23
|
-
populate?: readonly string[];
|
|
24
23
|
select?: readonly string[];
|
|
25
24
|
inline?: boolean;
|
|
26
25
|
form?: readonly string[];
|
|
27
26
|
purge?: boolean;
|
|
27
|
+
populate?: readonly string[];
|
|
28
28
|
populateDepth?: number;
|
|
29
29
|
constraints?: Condition;
|
|
30
30
|
};
|
|
@@ -41,9 +41,9 @@ export type EnumProperty = {
|
|
|
41
41
|
default?: unknown;
|
|
42
42
|
element?: PropertyArrayElement;
|
|
43
43
|
};
|
|
44
|
-
export type ArrayProperty = {
|
|
44
|
+
export type ArrayProperty<T = unknown> = {
|
|
45
45
|
type: 'array';
|
|
46
|
-
items: Property;
|
|
46
|
+
items: T extends Property ? T : Property;
|
|
47
47
|
uniqueItems?: boolean;
|
|
48
48
|
minItems?: number;
|
|
49
49
|
maxItems?: number;
|
|
@@ -91,9 +91,6 @@ export type BooleanProperty = {
|
|
|
91
91
|
default?: boolean;
|
|
92
92
|
element?: 'checkbox';
|
|
93
93
|
};
|
|
94
|
-
export type ArrayOfRefs = Omit<ArrayProperty, 'items'> & {
|
|
95
|
-
items: RefProperty;
|
|
96
|
-
};
|
|
97
94
|
export type GetterProperty = {
|
|
98
95
|
getter: (document: unknown & {
|
|
99
96
|
_id: ObjectId;
|
package/dist/security.d.ts
CHANGED
|
@@ -48,9 +48,7 @@ export type CollectionReadPayload = {
|
|
|
48
48
|
export type CollectionWritePayload = {
|
|
49
49
|
what: What<Record<string, unknown>>;
|
|
50
50
|
};
|
|
51
|
-
export type
|
|
52
|
-
export type MiddlewareNext = <TPayload, TReturn>(payload: TPayload, context: Context) => TReturn;
|
|
53
|
-
export type Middleware<TPayload = unknown, TReturn = unknown, TReturnNext extends GenericMiddlewareNext<TPayload, TReturn> = GenericMiddlewareNext<TPayload, TReturn>> = (payload: TPayload, context: Context, next: TReturnNext) => TReturn;
|
|
51
|
+
export type Middleware<TPayload = unknown, TReturn = unknown> = (payload: TPayload, context: Context, next: (payload: TPayload, context: Context) => any) => TReturn;
|
|
54
52
|
export type CollectionMiddleware<TDocument> = {
|
|
55
53
|
beforeRead?: Middleware<CollectionReadPayload, Promise<Result.Either<any, TDocument | TDocument[]>>>;
|
|
56
54
|
beforeWrite?: Middleware<CollectionWritePayload, Promise<Result.Either<any, TDocument>>>;
|