@aeriajs/types 0.0.36 → 0.0.38
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/api.d.ts +1 -1
- package/dist/description.d.ts +4 -3
- package/dist/functions.d.ts +1 -4
- package/dist/property.d.ts +12 -11
- package/dist/schema.d.ts +7 -1
- package/package.json +5 -2
package/dist/api.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export type AuthenticatedToken<TAcceptedRole extends AcceptedRole = null> = {
|
|
|
18
18
|
sub: ObjectId;
|
|
19
19
|
roles: readonly (TAcceptedRole extends null ? string : TAcceptedRole)[];
|
|
20
20
|
allowed_functions?: readonly FunctionPath[];
|
|
21
|
-
userinfo: PackReferences<Collections['user']['item']>;
|
|
21
|
+
userinfo: Collections['user']['item'] | PackReferences<Collections['user']['item']>;
|
|
22
22
|
};
|
|
23
23
|
export type UnauthenticatedToken = {
|
|
24
24
|
authenticated: false;
|
package/dist/description.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { Condition } from './condition.js';
|
|
|
4
4
|
import type { OwnershipMode } from './security.js';
|
|
5
5
|
export type CollectionPresets = 'crud' | 'duplicate' | 'remove' | 'removeAll' | 'owned' | 'timestamped' | 'view';
|
|
6
6
|
export type Icon = PhosphorIcon['name'] | `${IconStyle}:${PhosphorIcon['name']}`;
|
|
7
|
-
export type CollectionAction<TDescription extends Description> =
|
|
7
|
+
export type CollectionAction<TDescription extends Description> = {
|
|
8
8
|
name: string;
|
|
9
9
|
icon?: Icon;
|
|
10
10
|
ask?: boolean;
|
|
@@ -18,7 +18,7 @@ export type CollectionAction<TDescription extends Description> = Readonly<{
|
|
|
18
18
|
params?: Record<string, any>;
|
|
19
19
|
query?: Record<string, any>;
|
|
20
20
|
requires?: readonly PropertiesWithId<TDescription>[];
|
|
21
|
-
}
|
|
21
|
+
};
|
|
22
22
|
export type CollectionActions<TDescription extends Description> = Record<string, null | CollectionAction<TDescription>>;
|
|
23
23
|
export type FormLayout<TDescription extends Description> = {
|
|
24
24
|
fields?: Partial<Record<PropertiesWithId<TDescription>, FormLayoutField<TDescription>>>;
|
|
@@ -70,12 +70,13 @@ export type SearchOptions<TDescription extends Description> = {
|
|
|
70
70
|
placeholder?: string;
|
|
71
71
|
indexes: readonly (keyof TDescription['properties'])[];
|
|
72
72
|
};
|
|
73
|
+
export type RuntimeDescription<TDescription extends Description = any> = Pick<TDescription, 'actions' | 'individualActions' | 'filters' | 'filtersPresets' | 'layout' | 'table' | 'tableMeta' | 'form' | 'tableLayout' | 'formLayout'>;
|
|
73
74
|
export type Description<TDescription extends Description = any> = JsonSchema<TDescription> & {
|
|
74
75
|
title?: string;
|
|
75
76
|
categories?: readonly string[];
|
|
76
77
|
system?: boolean;
|
|
77
78
|
inline?: boolean;
|
|
78
|
-
preferred?: Record<string,
|
|
79
|
+
preferred?: Record<string, RuntimeDescription<TDescription>>;
|
|
79
80
|
icon?: Icon;
|
|
80
81
|
options?: CollectionOptions<TDescription>;
|
|
81
82
|
indexes?: readonly (keyof TDescription['properties'])[];
|
package/dist/functions.d.ts
CHANGED
|
@@ -23,12 +23,9 @@ export type Filters<TDocument> = StrictFilter<any> & Partial<{
|
|
|
23
23
|
_id: infer Id;
|
|
24
24
|
} ? Id | string : Field : never) extends infer Field ? Field | StrictFilterOperators<Field> | null : never;
|
|
25
25
|
}>;
|
|
26
|
-
type DocumentUpdateFilter<Document> = {
|
|
27
|
-
[P in keyof Document]: Document[P] extends null ? null : Document[P] | StrictUpdateFilter<Document[P]>;
|
|
28
|
-
};
|
|
29
26
|
export type What<TDocument> = {
|
|
30
27
|
_id: ObjectId | string;
|
|
31
|
-
} & Partial<
|
|
28
|
+
} & Partial<PackReferences<TDocument>> & RemoveAny<StrictUpdateFilter<TDocument>> | {
|
|
32
29
|
_id?: null;
|
|
33
30
|
} & Omit<PackReferences<TDocument>, '_id'>;
|
|
34
31
|
export type Projection<TDocument> = keyof TDocument | '_id' extends infer DocumentProp ? TDocument extends string ? DocumentProp[] : string[] : never;
|
package/dist/property.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export type PropertyArrayElement = 'checkbox' | 'radio' | 'select';
|
|
|
4
4
|
export type PropertyInputType = 'text' | 'email' | 'password' | 'search' | 'time' | 'month';
|
|
5
5
|
export type PropertyFormat = 'date' | 'date-time';
|
|
6
6
|
export type PropertiesWithId<TSchema extends JsonSchema> = keyof TSchema['properties'] | '_id';
|
|
7
|
-
export type RequiredProperties<TSchema extends JsonSchema> =
|
|
7
|
+
export type RequiredProperties<TSchema extends JsonSchema> = readonly PropertiesWithId<TSchema>[] | Partial<Record<PropertiesWithId<TSchema>, Condition<TSchema> | boolean>>;
|
|
8
8
|
export type JsonSchema<TJsonSchema extends JsonSchema = any> = {
|
|
9
9
|
$id: string;
|
|
10
10
|
type?: 'object';
|
|
@@ -16,11 +16,11 @@ export type NonCircularJsonSchema<TJsonSchema extends NonCircularJsonSchema = an
|
|
|
16
16
|
};
|
|
17
17
|
export type RefProperty = {
|
|
18
18
|
$ref: Exclude<keyof Collections, 'file'> & string;
|
|
19
|
-
indexes?:
|
|
20
|
-
populate?:
|
|
21
|
-
select?:
|
|
19
|
+
indexes?: readonly string[];
|
|
20
|
+
populate?: readonly string[];
|
|
21
|
+
select?: readonly string[];
|
|
22
22
|
inline?: boolean;
|
|
23
|
-
form?:
|
|
23
|
+
form?: readonly string[];
|
|
24
24
|
purge?: boolean;
|
|
25
25
|
constraints?: Condition;
|
|
26
26
|
};
|
|
@@ -29,11 +29,11 @@ export type NonCircularRefProperty = Omit<RefProperty, '$ref'> & {
|
|
|
29
29
|
};
|
|
30
30
|
export type FileProperty = Omit<RefProperty, '$ref'> & {
|
|
31
31
|
$ref: 'file';
|
|
32
|
-
accept?:
|
|
33
|
-
extensions?:
|
|
32
|
+
accept?: readonly string[];
|
|
33
|
+
extensions?: readonly string[];
|
|
34
34
|
};
|
|
35
35
|
export type EnumProperty = {
|
|
36
|
-
enum:
|
|
36
|
+
enum: readonly any[];
|
|
37
37
|
default?: any;
|
|
38
38
|
element?: PropertyArrayElement;
|
|
39
39
|
};
|
|
@@ -47,8 +47,9 @@ export type ArrayProperty = {
|
|
|
47
47
|
};
|
|
48
48
|
export type FixedObjectProperty = {
|
|
49
49
|
properties: Record<string, Property>;
|
|
50
|
-
form?:
|
|
51
|
-
required?:
|
|
50
|
+
form?: readonly string[];
|
|
51
|
+
required?: readonly string[];
|
|
52
|
+
writable?: readonly string[];
|
|
52
53
|
};
|
|
53
54
|
export type VariableObjectProperty = {
|
|
54
55
|
variable: true;
|
|
@@ -65,7 +66,7 @@ export type StringProperty = {
|
|
|
65
66
|
maxLength?: number;
|
|
66
67
|
format?: PropertyFormat;
|
|
67
68
|
default?: string | Date;
|
|
68
|
-
mask?: string |
|
|
69
|
+
mask?: string | readonly string[];
|
|
69
70
|
maskedValue?: boolean;
|
|
70
71
|
placeholder?: string;
|
|
71
72
|
element?: 'textarea';
|
package/dist/schema.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeriajs/types",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.38",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -22,7 +22,10 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@phosphor-icons/core": "^2.
|
|
25
|
+
"@phosphor-icons/core": "^2.1.1"
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"mongodb": "^6.5.0"
|
|
26
29
|
},
|
|
27
30
|
"scripts": {
|
|
28
31
|
"test": "echo skipping",
|