@evoke-platform/context 1.0.0-dev.90 → 1.0.0-dev.92
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/README.md +1 -1
- package/dist/objects/objects.d.ts +175 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -337,7 +337,7 @@ const callback = (changes: DocumentChange[]) => {
|
|
|
337
337
|
console.log(changes);
|
|
338
338
|
};
|
|
339
339
|
|
|
340
|
-
documentChanges.subscribe('myObjectId'
|
|
340
|
+
documentChanges.subscribe('myObjectId', 'myInstanceId', callback);
|
|
341
341
|
|
|
342
342
|
documentChanges.unsubscribe('myObjectId', 'myInstanceId', callback);
|
|
343
343
|
```
|
|
@@ -4,32 +4,91 @@ export type BaseObjReference = {
|
|
|
4
4
|
objectId: string;
|
|
5
5
|
discriminatorValue: unknown;
|
|
6
6
|
};
|
|
7
|
+
export type ViewLayout = {
|
|
8
|
+
table?: TableViewLayout;
|
|
9
|
+
dropdown?: DropdownViewLayout;
|
|
10
|
+
};
|
|
11
|
+
export type DropdownViewLayout = {
|
|
12
|
+
secondaryTextExpression: string;
|
|
13
|
+
};
|
|
14
|
+
export type TableViewLayout = {
|
|
15
|
+
properties: PropertyReference[];
|
|
16
|
+
sort?: Sort;
|
|
17
|
+
};
|
|
18
|
+
export type PropertyReference = {
|
|
19
|
+
id: string;
|
|
20
|
+
format?: string;
|
|
21
|
+
};
|
|
22
|
+
export type Sort = {
|
|
23
|
+
colId: string;
|
|
24
|
+
sort?: 'asc' | 'desc';
|
|
25
|
+
};
|
|
7
26
|
export type Obj = {
|
|
8
27
|
id: string;
|
|
9
28
|
name: string;
|
|
10
29
|
typeDiscriminatorProperty?: string;
|
|
30
|
+
viewLayout?: ViewLayout;
|
|
11
31
|
baseObject?: BaseObjReference;
|
|
12
32
|
properties?: Property[];
|
|
13
33
|
actions?: Action[];
|
|
14
34
|
};
|
|
15
35
|
export type PropertyType = 'address' | 'array' | 'boolean' | 'collection' | 'date' | 'date-time' | 'image' | 'integer' | 'number' | 'object' | 'string' | 'time';
|
|
36
|
+
export type NumericValidation = {
|
|
37
|
+
errorMessage?: string;
|
|
38
|
+
minimum?: number;
|
|
39
|
+
maximum?: number;
|
|
40
|
+
};
|
|
41
|
+
export type DateValidation = {
|
|
42
|
+
errorMessage?: string;
|
|
43
|
+
to?: string;
|
|
44
|
+
from?: string;
|
|
45
|
+
};
|
|
46
|
+
export type CriteriaValidation = {
|
|
47
|
+
criteria?: Record<string, unknown>;
|
|
48
|
+
};
|
|
49
|
+
export type StringValidation = {
|
|
50
|
+
operator: 'any' | 'all';
|
|
51
|
+
rules?: {
|
|
52
|
+
regex: string;
|
|
53
|
+
errorMessage?: string;
|
|
54
|
+
}[];
|
|
55
|
+
};
|
|
56
|
+
export type PropertyValidation = StringValidation | NumericValidation | DateValidation | CriteriaValidation;
|
|
16
57
|
export type Property = {
|
|
17
58
|
id: string;
|
|
18
59
|
name: string;
|
|
19
60
|
type: PropertyType;
|
|
20
61
|
enum?: string[];
|
|
21
62
|
objectId?: string;
|
|
63
|
+
relatedPropertyId?: string;
|
|
22
64
|
required?: boolean;
|
|
23
65
|
searchable?: boolean;
|
|
24
66
|
formula?: string;
|
|
67
|
+
mask?: string;
|
|
68
|
+
validation?: PropertyValidation;
|
|
69
|
+
manyToManyPropertyId?: string;
|
|
25
70
|
};
|
|
26
71
|
export type ActionType = 'create' | 'update' | 'delete';
|
|
72
|
+
export type InputStringValidation = StringValidation & {
|
|
73
|
+
minLength?: number;
|
|
74
|
+
maxLength?: number;
|
|
75
|
+
mask?: string;
|
|
76
|
+
};
|
|
77
|
+
export type InputParameter = {
|
|
78
|
+
id: string;
|
|
79
|
+
type: PropertyType;
|
|
80
|
+
required?: boolean;
|
|
81
|
+
enum?: string[];
|
|
82
|
+
validation?: PropertyValidation | InputStringValidation;
|
|
83
|
+
};
|
|
27
84
|
export type Action = {
|
|
28
85
|
id: string;
|
|
29
86
|
name: string;
|
|
30
87
|
type: ActionType;
|
|
31
88
|
outputEvent: string;
|
|
32
89
|
inputProperties?: ActionInput[];
|
|
90
|
+
parameters?: InputParameter[];
|
|
91
|
+
form?: Form;
|
|
33
92
|
};
|
|
34
93
|
export type ObjectInstance = {
|
|
35
94
|
id: string;
|
|
@@ -45,38 +104,145 @@ export type SelectOption = {
|
|
|
45
104
|
label: string;
|
|
46
105
|
value: string;
|
|
47
106
|
};
|
|
107
|
+
export type VisibilityConfiguration = {
|
|
108
|
+
operator?: 'any' | 'all';
|
|
109
|
+
conditions?: {
|
|
110
|
+
property: string;
|
|
111
|
+
operator: 'eq' | 'neq';
|
|
112
|
+
value: string | number | boolean;
|
|
113
|
+
}[];
|
|
114
|
+
};
|
|
115
|
+
export type RelatedObjectDefaultValue = {
|
|
116
|
+
criteria: Record<string, unknown>;
|
|
117
|
+
sortBy?: string;
|
|
118
|
+
orderBy?: 'asc' | 'desc' | 'ASC' | 'DESC';
|
|
119
|
+
};
|
|
120
|
+
export type DisplayConfiguration = {
|
|
121
|
+
label?: string;
|
|
122
|
+
placeholder?: string;
|
|
123
|
+
required?: boolean;
|
|
124
|
+
description?: string;
|
|
125
|
+
defaultValue?: string | number | string[] | RelatedObjectDefaultValue;
|
|
126
|
+
readOnly?: boolean;
|
|
127
|
+
tooltip?: string;
|
|
128
|
+
prefix?: string;
|
|
129
|
+
suffix?: string;
|
|
130
|
+
placeholderChar?: string;
|
|
131
|
+
rowCount?: number;
|
|
132
|
+
charCount?: boolean;
|
|
133
|
+
mode?: 'default' | 'existingOnly';
|
|
134
|
+
relatedObjectDisplay?: 'dropdown' | 'dialogBox';
|
|
135
|
+
visibility?: VisibilityConfiguration | string;
|
|
136
|
+
};
|
|
137
|
+
export type InputParameterReference = {
|
|
138
|
+
type: 'input';
|
|
139
|
+
parameterId: string;
|
|
140
|
+
display?: DisplayConfiguration;
|
|
141
|
+
enumWithLabels?: SelectOption[];
|
|
142
|
+
};
|
|
143
|
+
export type Content = {
|
|
144
|
+
type: 'content';
|
|
145
|
+
html: string;
|
|
146
|
+
visibility?: VisibilityConfiguration | string;
|
|
147
|
+
};
|
|
148
|
+
export type Column = {
|
|
149
|
+
width: number;
|
|
150
|
+
entries?: FormEntry[];
|
|
151
|
+
};
|
|
152
|
+
export type Columns = {
|
|
153
|
+
type: 'columns';
|
|
154
|
+
columns: Column[];
|
|
155
|
+
visibility?: VisibilityConfiguration | string;
|
|
156
|
+
};
|
|
157
|
+
export type Section = {
|
|
158
|
+
label: string;
|
|
159
|
+
entries?: FormEntry[];
|
|
160
|
+
};
|
|
161
|
+
export type Sections = {
|
|
162
|
+
type: 'sections';
|
|
163
|
+
sections: Section[];
|
|
164
|
+
visibility?: VisibilityConfiguration | string;
|
|
165
|
+
};
|
|
166
|
+
export type FormEntry = InputParameterReference | Columns | Sections | Content;
|
|
167
|
+
export type Form = {
|
|
168
|
+
entries?: FormEntry[];
|
|
169
|
+
};
|
|
48
170
|
/**
|
|
49
171
|
* Represents an object action inputProperty object.
|
|
50
172
|
*/
|
|
51
173
|
export type ActionInput = {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
174
|
+
id?: string;
|
|
175
|
+
label?: string;
|
|
176
|
+
type?: 'button' | 'Section' | 'Columns' | 'Content' | 'Select' | 'TextField' | 'DateTime' | 'RepeatableField' | 'MultiSelect' | 'Decimal' | 'RichText' | 'Date' | 'Integer' | 'Image' | 'Object' | 'Time' | 'User';
|
|
177
|
+
key?: string;
|
|
178
|
+
initialValue?: string | number | SelectOption[] | SelectOption;
|
|
179
|
+
defaultToCurrentDate?: boolean;
|
|
180
|
+
defaultToCurrentTime?: boolean;
|
|
181
|
+
html?: string;
|
|
182
|
+
labelPosition?: string;
|
|
56
183
|
placeholder?: string;
|
|
57
184
|
description?: string;
|
|
58
185
|
tooltip?: string;
|
|
59
186
|
prefix?: string;
|
|
60
187
|
suffix?: string;
|
|
61
|
-
showCharCount?: boolean;
|
|
62
|
-
readOnly?: boolean;
|
|
63
|
-
isMultiLineText?: boolean;
|
|
64
188
|
data?: {
|
|
65
189
|
/**
|
|
66
190
|
* An array of values required for select options.
|
|
67
191
|
*/
|
|
68
192
|
values?: SelectOption[];
|
|
69
193
|
};
|
|
194
|
+
inputMask?: string;
|
|
195
|
+
inputMaskPlaceholderChar?: string;
|
|
196
|
+
tableView?: boolean;
|
|
197
|
+
mode?: 'default' | 'existingOnly';
|
|
198
|
+
displayOption?: 'dropdown' | 'dialogBox';
|
|
199
|
+
rows?: number;
|
|
200
|
+
showCharCount?: boolean;
|
|
201
|
+
readOnly?: boolean;
|
|
202
|
+
isMultiLineText?: boolean;
|
|
203
|
+
verticalLayout?: boolean;
|
|
204
|
+
input?: boolean;
|
|
205
|
+
widget?: string;
|
|
206
|
+
conditional?: {
|
|
207
|
+
json?: string;
|
|
208
|
+
show?: boolean;
|
|
209
|
+
when?: string;
|
|
210
|
+
eq?: string | number;
|
|
211
|
+
};
|
|
212
|
+
property?: {
|
|
213
|
+
id: string;
|
|
214
|
+
};
|
|
70
215
|
validate?: {
|
|
71
216
|
required?: boolean;
|
|
217
|
+
ciriteria?: object;
|
|
72
218
|
operator?: 'any' | 'all';
|
|
73
219
|
regexes?: RegexValidation[];
|
|
220
|
+
minLength?: number;
|
|
221
|
+
maxLength?: number;
|
|
222
|
+
minDate?: string;
|
|
223
|
+
maxDate?: string;
|
|
224
|
+
minTime?: string;
|
|
225
|
+
maxTime?: string;
|
|
226
|
+
min?: number;
|
|
227
|
+
max?: number;
|
|
228
|
+
customMessage?: string;
|
|
74
229
|
};
|
|
75
230
|
/**
|
|
76
231
|
* An array of sub-components to be rendered inside sections.
|
|
77
232
|
*/
|
|
78
|
-
components?:
|
|
79
|
-
|
|
233
|
+
components?: {
|
|
234
|
+
key: string;
|
|
235
|
+
label?: string;
|
|
236
|
+
components: ActionInput[];
|
|
237
|
+
};
|
|
238
|
+
/**
|
|
239
|
+
* An array of sub-components to be rendered inside columns.
|
|
240
|
+
*/
|
|
241
|
+
columns?: {
|
|
242
|
+
width: number;
|
|
243
|
+
currentWidth?: number;
|
|
244
|
+
components: ActionInput[];
|
|
245
|
+
};
|
|
80
246
|
};
|
|
81
247
|
export type ActionRequest = {
|
|
82
248
|
actionId: string;
|