jourycms-sdk 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/typings/v1/services/auth/api/auth.d.ts +2 -0
- package/typings/v1/services/content/entities/article-type.d.ts +2 -4
- package/typings/v1/services/content/entities/custom-fieds/custom-field.d.ts +34 -0
- package/typings/v1/services/system/entities/config.d.ts +1 -0
- package/typings/v1/utils/entities/snapshots.d.ts +1 -1
package/package.json
CHANGED
@@ -7,9 +7,7 @@ declare module Levelup {
|
|
7
7
|
field_key: string;
|
8
8
|
field_label: string;
|
9
9
|
field_type: CustomFields.CustomFieldType;
|
10
|
-
field_options:
|
11
|
-
[Key: string]: any;
|
12
|
-
};
|
10
|
+
field_options: CustomFields.MetaField<CustomFields.CustomFieldType, boolean>['field_options'];
|
13
11
|
};
|
14
12
|
|
15
13
|
export interface IArticleTypeSnapshots {
|
@@ -22,7 +20,7 @@ declare module Levelup {
|
|
22
20
|
|
23
21
|
export interface ArticleType
|
24
22
|
extends Utils.Entity.General.ICreatable,
|
25
|
-
|
23
|
+
Utils.Entity.General.IHasSearchMeta {
|
26
24
|
_id: Utils.Common.ID;
|
27
25
|
slug: string;
|
28
26
|
name: string;
|
@@ -11,10 +11,29 @@ declare module Levelup {
|
|
11
11
|
Partial<{
|
12
12
|
}>;
|
13
13
|
|
14
|
+
type TOperator = 'eq' | 'ne' | 'gt' | 'lt' | 'gte' | 'lte' | 'in' | 'nin' | 'exists' | 'not_empty';
|
15
|
+
type TConstraint<Operator extends TOperator> =
|
16
|
+
Operator extends 'eq' | 'ne' | 'gt' | 'lt' | 'gte' | 'lte' ? {
|
17
|
+
field: string;
|
18
|
+
operator: Operator;
|
19
|
+
value: any;
|
20
|
+
} :
|
21
|
+
Operator extends 'in' | 'nin' ? {
|
22
|
+
field: string;
|
23
|
+
operator: Operator;
|
24
|
+
value: any[];
|
25
|
+
} :
|
26
|
+
Operator extends 'exists' | 'not_empty' ? {
|
27
|
+
field: string;
|
28
|
+
operator: Operator;
|
29
|
+
} :
|
30
|
+
never;
|
31
|
+
|
14
32
|
type BaseFieldOption<Input, IsMulti extends boolean = false> = {
|
15
33
|
label?: string;
|
16
34
|
required?: boolean;
|
17
35
|
default_value?: IsMulti extends true ? Utils.Common.MultiValue<Input> : Utils.Common.SingleValue<Input>;
|
36
|
+
constraints?: TConstraint<TOperator>[];
|
18
37
|
}
|
19
38
|
|
20
39
|
type CustomFieldType =
|
@@ -28,6 +47,9 @@ declare module Levelup {
|
|
28
47
|
| 'number'
|
29
48
|
| 'radiobox'
|
30
49
|
| 'select'
|
50
|
+
| 'algerian_state'
|
51
|
+
| 'algerian_city'
|
52
|
+
| 'ksa_city'
|
31
53
|
| 'text'
|
32
54
|
| 'time';
|
33
55
|
|
@@ -44,6 +66,9 @@ declare module Levelup {
|
|
44
66
|
T extends 'number' ? NumberField.Input :
|
45
67
|
T extends 'radiobox' ? RadioboxField.Input :
|
46
68
|
T extends 'select' ? SelectField.Input<IsMulti> :
|
69
|
+
T extends 'algerian_state' ? SelectField.Intput<IsMulti> :
|
70
|
+
T extends 'algerian_city' ? SelectField.Intput<IsMulti> :
|
71
|
+
T extends 'ksa_city' ? SelectField.Intput<IsMulti> :
|
47
72
|
T extends 'text' ? TextField.Input :
|
48
73
|
T extends 'time' ? TimeField.Input :
|
49
74
|
never;
|
@@ -59,6 +84,9 @@ declare module Levelup {
|
|
59
84
|
T extends 'number' ? NumberField.Output :
|
60
85
|
T extends 'radiobox' ? RadioboxField.Output :
|
61
86
|
T extends 'select' ? SelectField.Output<IsMulti> :
|
87
|
+
T extends 'algerian_state' ? SelectField.Output<IsMulti> :
|
88
|
+
T extends 'algerian_city' ? SelectField.Output<IsMulti> :
|
89
|
+
T extends 'ksa_city' ? SelectField.Output<IsMulti> :
|
62
90
|
T extends 'text' ? TextField.Output :
|
63
91
|
T extends 'time' ? TimeField.Output :
|
64
92
|
never;
|
@@ -77,6 +105,9 @@ declare module Levelup {
|
|
77
105
|
T extends 'number' ? NumberField.Options :
|
78
106
|
T extends 'radiobox' ? RadioboxField.Options :
|
79
107
|
T extends 'select' ? SelectField.Options<IsMulti> :
|
108
|
+
T extends 'algerian_state' ? SelectField.Options<IsMulti> :
|
109
|
+
T extends 'algerian_city' ? SelectField.Options<IsMulti> :
|
110
|
+
T extends 'ksa_city' ? SelectField.Options<IsMulti> :
|
80
111
|
T extends 'text' ? TextField.Options :
|
81
112
|
T extends 'time' ? TimeField.Options :
|
82
113
|
never;
|
@@ -150,6 +181,9 @@ declare module Levelup {
|
|
150
181
|
options: MetaField<T, IsMulti>['field_options'];
|
151
182
|
value: MetaFieldInput<T, IsMulti>;
|
152
183
|
onChange: (value: MetaFieldInput<T, IsMulti>) => void | PromiseLike<void>;
|
184
|
+
metaData: {
|
185
|
+
[key: string]: any;
|
186
|
+
};
|
153
187
|
}
|
154
188
|
}
|
155
189
|
}
|