@media-quest/builder 0.0.7 → 0.0.9
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/public-api.d.mts +67 -40
- package/dist/public-api.d.ts +67 -40
- package/dist/public-api.js +154 -47
- package/dist/public-api.mjs +151 -47
- package/package.json +3 -3
- package/src/Builder-page.spec.ts +21 -15
- package/src/Builder-page.ts +21 -18
- package/src/Builder-schema.spec.ts +270 -268
- package/src/Builder-schema.ts +32 -31
- package/src/BuilderObject.ts +0 -8
- package/src/prefix.spec.ts +5 -0
- package/src/prefix.ts +107 -0
- package/src/public-api.ts +1 -1
- package/src/rulebuilder/Builder-rule.spec.ts +64 -35
- package/src/rulebuilder/Builder-rule.ts +3 -3
- package/src/rulebuilder/RuleAction.ts +7 -5
- package/src/rulebuilder/RuleBuilder-test-utils.ts +61 -30
- package/src/rulebuilder/RuleVariable.ts +6 -2
- package/src/rulebuilder/condition/Builder-condition-group.ts +2 -2
- package/src/rulebuilder/condition/Builder-condition.spec.ts +38 -29
- package/src/rulebuilder/condition/Builder-condition.ts +2 -2
- package/src/theme/default-theme-compiler.ts +2 -3
package/dist/public-api.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DStyle, Condition, PageQueRules, SchemaDto } from '@media-quest/engine';
|
|
1
|
+
import { DStyle, PageID, Condition, PageQueRules, SchemaID, SchemaDto } from '@media-quest/engine';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Builder objects are complex objects that are embedded inside
|
|
@@ -13,24 +13,12 @@ declare namespace BuilderObjectId {
|
|
|
13
13
|
type QuestionID = string & {
|
|
14
14
|
__QUESTION__ID__: true;
|
|
15
15
|
};
|
|
16
|
-
type VideoFileID = string & {
|
|
17
|
-
__VIDEO__ID__: true;
|
|
18
|
-
};
|
|
19
|
-
type AudioFileID = string & {
|
|
20
|
-
__AUDIO__ID__: true;
|
|
21
|
-
};
|
|
22
|
-
type ImageID = string & {
|
|
23
|
-
__IMAGE__ID__: true;
|
|
24
|
-
};
|
|
25
16
|
type TextID = string & {
|
|
26
17
|
__TEXT__ID__: true;
|
|
27
18
|
};
|
|
28
19
|
type MainTextID = string & {
|
|
29
20
|
__MAIN__TEXT__ID__: true;
|
|
30
21
|
};
|
|
31
|
-
type PageID = string & {
|
|
32
|
-
__PAGE__ID__: true;
|
|
33
|
-
};
|
|
34
22
|
type TagId = string & {
|
|
35
23
|
__TAG__ID__: true;
|
|
36
24
|
};
|
|
@@ -39,7 +27,6 @@ declare namespace BuilderObjectId {
|
|
|
39
27
|
const textId: () => TextID;
|
|
40
28
|
const questionOptionId: () => QuestionOptionID;
|
|
41
29
|
const questionId: () => QuestionID;
|
|
42
|
-
const pageId: () => PageID;
|
|
43
30
|
}
|
|
44
31
|
declare abstract class BuilderObject<T extends BuilderObjectType, Dto extends {}> {
|
|
45
32
|
abstract readonly objectType: T;
|
|
@@ -180,6 +167,46 @@ declare class BuilderMainText extends BuilderObject<"builder-main-text", Builder
|
|
|
180
167
|
set audioFile(audioFile: AudioFile | false);
|
|
181
168
|
}
|
|
182
169
|
|
|
170
|
+
type SchemaPrefixValue = string & {
|
|
171
|
+
__SCHEMA_PREFIX__: true;
|
|
172
|
+
};
|
|
173
|
+
type PagePrefixValue = string & {
|
|
174
|
+
__PAGE_PREFIX__: true;
|
|
175
|
+
};
|
|
176
|
+
type VarID = `${SchemaPrefixValue}_${PagePrefixValue}`;
|
|
177
|
+
declare const VarID: {
|
|
178
|
+
create: (schemaPrefix: SchemaPrefixValue, pagePrefix: PagePrefixValue) => VarID;
|
|
179
|
+
};
|
|
180
|
+
declare class SchemaPrefix {
|
|
181
|
+
private _value;
|
|
182
|
+
static readonly MIN_LENGTH = 1;
|
|
183
|
+
private static randomLen;
|
|
184
|
+
static readonly MAX_LENGTH = 16;
|
|
185
|
+
static fromValue: (value: SchemaPrefixValue) => SchemaPrefix;
|
|
186
|
+
static fromValueOrThrow: (value: string) => SchemaPrefix;
|
|
187
|
+
static fromString: (value: string) => SchemaPrefix | false;
|
|
188
|
+
static castOrCreateRandom: (value: string) => SchemaPrefix;
|
|
189
|
+
static isValid: (prefix: string | 999) => prefix is SchemaPrefixValue;
|
|
190
|
+
get value(): SchemaPrefixValue;
|
|
191
|
+
set value(value: string);
|
|
192
|
+
private constructor();
|
|
193
|
+
}
|
|
194
|
+
declare class PagePrefix {
|
|
195
|
+
private _value;
|
|
196
|
+
static readonly MIN_LENGTH = 1;
|
|
197
|
+
private static randomLen;
|
|
198
|
+
static readonly MAX_LENGTH = 16;
|
|
199
|
+
static fromValue: (value: PagePrefixValue) => PagePrefix;
|
|
200
|
+
static create: () => PagePrefix;
|
|
201
|
+
static fromString: (value: string) => PagePrefix | false;
|
|
202
|
+
static fromStringOrThrow: (value: string) => PagePrefixValue;
|
|
203
|
+
static castOrCreateRandom: (value: string) => PagePrefix;
|
|
204
|
+
static isValid: (prefix: string | 999) => prefix is PagePrefixValue;
|
|
205
|
+
get value(): PagePrefixValue;
|
|
206
|
+
set value(value: string);
|
|
207
|
+
private constructor();
|
|
208
|
+
}
|
|
209
|
+
|
|
183
210
|
declare const BuilderVariableType: {
|
|
184
211
|
readonly numericWithOptions: true;
|
|
185
212
|
readonly numeric: true;
|
|
@@ -198,28 +225,28 @@ declare class BuilderVariableOption {
|
|
|
198
225
|
constructor(label: string, value: number);
|
|
199
226
|
}
|
|
200
227
|
declare class QuestionVariable {
|
|
201
|
-
readonly varId:
|
|
228
|
+
readonly varId: VarID;
|
|
202
229
|
readonly label: string;
|
|
203
230
|
readonly options: ReadonlyArray<BuilderVariableOption>;
|
|
204
231
|
readonly pageNumber: number;
|
|
205
232
|
readonly kind: "question-variable";
|
|
206
233
|
readonly dataType: BuilderVariableType;
|
|
207
|
-
constructor(varId:
|
|
234
|
+
constructor(varId: VarID, label: string, options: ReadonlyArray<BuilderVariableOption>, pageNumber: number);
|
|
208
235
|
}
|
|
209
236
|
declare class CustomVariable {
|
|
210
|
-
readonly varId:
|
|
237
|
+
readonly varId: VarID;
|
|
211
238
|
readonly label: string;
|
|
212
239
|
readonly options: ReadonlyArray<BuilderVariableOption>;
|
|
213
240
|
readonly kind: "configuration-variable";
|
|
214
241
|
readonly dataType: BuilderVariableType;
|
|
215
|
-
constructor(varId:
|
|
242
|
+
constructor(varId: VarID, label: string, options: ReadonlyArray<BuilderVariableOption>);
|
|
216
243
|
}
|
|
217
244
|
type BuilderVariable = QuestionVariable | CustomVariable;
|
|
218
245
|
|
|
219
246
|
type BuilderPageType = "info-page" | "question" | "multi-select" | "form";
|
|
220
247
|
interface BuilderPageDto {
|
|
221
|
-
readonly id:
|
|
222
|
-
prefix:
|
|
248
|
+
readonly id: PageID;
|
|
249
|
+
readonly prefix: PagePrefixValue;
|
|
223
250
|
_type: BuilderPageType;
|
|
224
251
|
mainText: BuilderMainTextDto;
|
|
225
252
|
nextButton: BuilderOptionDto;
|
|
@@ -231,7 +258,7 @@ interface BuilderPageDto {
|
|
|
231
258
|
}
|
|
232
259
|
declare class BuilderPage extends BuilderObject<"builder-page", BuilderPageDto> {
|
|
233
260
|
readonly objectType: "builder-page";
|
|
234
|
-
readonly id:
|
|
261
|
+
readonly id: PageID;
|
|
235
262
|
private _pageType;
|
|
236
263
|
private _prefix;
|
|
237
264
|
private _questions;
|
|
@@ -241,7 +268,7 @@ declare class BuilderPage extends BuilderObject<"builder-page", BuilderPageDto>
|
|
|
241
268
|
defaultQuestion: BuilderQuestion;
|
|
242
269
|
mainText: BuilderMainText;
|
|
243
270
|
nextButton: BuilderOption;
|
|
244
|
-
static create(type: BuilderPageType, _prefix:
|
|
271
|
+
static create(type: BuilderPageType, _prefix: PagePrefixValue): BuilderPage;
|
|
245
272
|
static fromJson(dto: BuilderPageDto): BuilderPage;
|
|
246
273
|
private constructor();
|
|
247
274
|
insertQuestion(question: BuilderQuestion, atIndex: number): boolean;
|
|
@@ -257,11 +284,11 @@ declare class BuilderPage extends BuilderObject<"builder-page", BuilderPageDto>
|
|
|
257
284
|
addTag(tag: string): void;
|
|
258
285
|
deleteTag(tag: string): void;
|
|
259
286
|
set pageType(value: BuilderPageType);
|
|
260
|
-
getQuestionVariables(modulePrefix:
|
|
287
|
+
getQuestionVariables(modulePrefix: SchemaPrefix, pageNumber: number): ReadonlyArray<QuestionVariable>;
|
|
261
288
|
get tags(): ReadonlyArray<string>;
|
|
262
289
|
get pageType(): BuilderPageType;
|
|
263
|
-
get prefix():
|
|
264
|
-
set prefix(value:
|
|
290
|
+
get prefix(): PagePrefixValue;
|
|
291
|
+
set prefix(value: PagePrefixValue);
|
|
265
292
|
toJson(): BuilderPageDto;
|
|
266
293
|
clone(): BuilderPageDto;
|
|
267
294
|
get backgroundColor(): string;
|
|
@@ -270,19 +297,19 @@ declare class BuilderPage extends BuilderObject<"builder-page", BuilderPageDto>
|
|
|
270
297
|
}
|
|
271
298
|
|
|
272
299
|
interface ExcludeByPageAction {
|
|
273
|
-
readonly kind:
|
|
274
|
-
readonly pageId:
|
|
300
|
+
readonly kind: "exclude-by-pageId";
|
|
301
|
+
readonly pageId: PageID;
|
|
275
302
|
readonly mainText: string;
|
|
276
303
|
readonly pageNumber: number;
|
|
277
304
|
}
|
|
278
305
|
interface JumpToPageAction {
|
|
279
|
-
readonly kind:
|
|
280
|
-
readonly pageId:
|
|
306
|
+
readonly kind: "jump-to-page";
|
|
307
|
+
readonly pageId: PageID;
|
|
281
308
|
readonly mainText: string;
|
|
282
309
|
readonly pageNumber: number;
|
|
283
310
|
}
|
|
284
311
|
interface ExcludeByTagAction {
|
|
285
|
-
readonly kind:
|
|
312
|
+
readonly kind: "exclude-by-tag";
|
|
286
313
|
readonly tag: string;
|
|
287
314
|
readonly description: string;
|
|
288
315
|
readonly pageCount: number;
|
|
@@ -445,7 +472,7 @@ declare class BuilderCondition extends BuilderObject<"builder-condition", Builde
|
|
|
445
472
|
isValid: false;
|
|
446
473
|
message: string;
|
|
447
474
|
};
|
|
448
|
-
toEngineCondition(
|
|
475
|
+
toEngineCondition(): Condition.Simple | false;
|
|
449
476
|
private findVariableInUniverse;
|
|
450
477
|
set operator(operator: BuilderOperator | "");
|
|
451
478
|
get operator(): BuilderOperator | "";
|
|
@@ -486,7 +513,7 @@ declare class BuilderConditionGroup extends BuilderObject<"builder-condition-gro
|
|
|
486
513
|
removeCondition(condition: BuilderCondition): boolean;
|
|
487
514
|
clone(): BuilderConditionGroupDto;
|
|
488
515
|
toJson(): BuilderConditionGroupDto;
|
|
489
|
-
toEngineConditionComplex(
|
|
516
|
+
toEngineConditionComplex(): Condition.Complex | false;
|
|
490
517
|
get type(): ConditionGroupType;
|
|
491
518
|
set type(conditionGroupType: ConditionGroupType);
|
|
492
519
|
}
|
|
@@ -564,7 +591,7 @@ declare class BuilderRule extends BuilderObject<"builder-rule", BuilderRuleDto>
|
|
|
564
591
|
addConditionGroup(): BuilderConditionGroup;
|
|
565
592
|
clone(): BuilderRuleDto;
|
|
566
593
|
toJson(): BuilderRuleDto;
|
|
567
|
-
toEngineRule(
|
|
594
|
+
toEngineRule(): PageQueRules;
|
|
568
595
|
}
|
|
569
596
|
|
|
570
597
|
declare class PageActionManager {
|
|
@@ -588,8 +615,8 @@ declare class TagActionManager {
|
|
|
588
615
|
}
|
|
589
616
|
|
|
590
617
|
interface BuilderSchemaDto {
|
|
591
|
-
readonly id:
|
|
592
|
-
readonly prefix:
|
|
618
|
+
readonly id: SchemaID;
|
|
619
|
+
readonly prefix: SchemaPrefixValue;
|
|
593
620
|
readonly mainImage: ImageFile | false;
|
|
594
621
|
readonly backgroundColor: string;
|
|
595
622
|
readonly name: string;
|
|
@@ -605,9 +632,9 @@ interface SchemaBuildOutput {
|
|
|
605
632
|
schemaConfig: Record<string, string>;
|
|
606
633
|
}
|
|
607
634
|
declare class BuilderSchema {
|
|
608
|
-
readonly id:
|
|
635
|
+
readonly id: SchemaID;
|
|
609
636
|
name: string;
|
|
610
|
-
|
|
637
|
+
private readonly _prefix;
|
|
611
638
|
baseHeight: number;
|
|
612
639
|
baseWidth: number;
|
|
613
640
|
backgroundColor: string;
|
|
@@ -615,9 +642,10 @@ declare class BuilderSchema {
|
|
|
615
642
|
mainImage: ImageFile | false;
|
|
616
643
|
private _rules;
|
|
617
644
|
get rules(): ReadonlyArray<BuilderRule>;
|
|
645
|
+
get prefix(): SchemaPrefixValue;
|
|
618
646
|
private readonly _tagCollection;
|
|
619
647
|
get tags(): ReadonlyArray<BuilderTag>;
|
|
620
|
-
static create(id:
|
|
648
|
+
static create(id: SchemaID, name: string, prefix: SchemaPrefixValue): BuilderSchema;
|
|
621
649
|
static fromJson(dto: BuilderSchemaDto): BuilderSchema;
|
|
622
650
|
toJson(): BuilderSchemaDto;
|
|
623
651
|
private constructor();
|
|
@@ -632,7 +660,6 @@ declare class BuilderSchema {
|
|
|
632
660
|
getRuleInput(): RuleInput;
|
|
633
661
|
deleteTags(tags: ReadonlyArray<BuilderTag>): void;
|
|
634
662
|
addTag(builderTag: BuilderTag): void;
|
|
635
|
-
private getQuestionVariables;
|
|
636
663
|
compile(): SchemaBuildOutput;
|
|
637
664
|
}
|
|
638
665
|
|
|
@@ -655,4 +682,4 @@ declare class BuilderText extends BuilderObject<'builder-text', BuilderTextDto>
|
|
|
655
682
|
toJson(): BuilderTextDto;
|
|
656
683
|
}
|
|
657
684
|
|
|
658
|
-
export { AudioFile, BuilderCondition, BuilderConditionDto, BuilderConditionGroup, BuilderConditionGroupDto, BuilderMainImageDto, BuilderMainText, BuilderMainTextDto, BuilderMainVideoDto, BuilderOperator, BuilderOption, BuilderOptionDto, BuilderPage, BuilderPageDto, BuilderPageType, BuilderQuestion, BuilderQuestionDto, BuilderQuestionType, BuilderRule, BuilderRuleDto, BuilderSchema, BuilderSchemaDto, BuilderTag, BuilderTagDto, BuilderText, BuilderTextDto, BuilderVariable, BuilderVariableOption, ConditionGroupType, CustomVariable, ExcludeByPageAction, ExcludeByPageIdSelectItem, ExcludeByTagAction, ExcludeByTagSelectItem, ImageFile, JumpToActionManager, JumpToPageAction, JumpToPageSelectItem, MultiSelectItem, OperatorSelectItem, PageActionManager, QuestionVariable, RuleInput, RuleOptionSelectItem, RuleVariableSelectItem, SingleSelectItem, TagActionManager, TagCollection, VideoFile };
|
|
685
|
+
export { AudioFile, BuilderCondition, BuilderConditionDto, BuilderConditionGroup, BuilderConditionGroupDto, BuilderMainImageDto, BuilderMainText, BuilderMainTextDto, BuilderMainVideoDto, BuilderOperator, BuilderOption, BuilderOptionDto, BuilderPage, BuilderPageDto, BuilderPageType, BuilderQuestion, BuilderQuestionDto, BuilderQuestionType, BuilderRule, BuilderRuleDto, BuilderSchema, BuilderSchemaDto, BuilderTag, BuilderTagDto, BuilderText, BuilderTextDto, BuilderVariable, BuilderVariableOption, ConditionGroupType, CustomVariable, ExcludeByPageAction, ExcludeByPageIdSelectItem, ExcludeByTagAction, ExcludeByTagSelectItem, ImageFile, JumpToActionManager, JumpToPageAction, JumpToPageSelectItem, MultiSelectItem, OperatorSelectItem, PageActionManager, PagePrefix, PagePrefixValue, QuestionVariable, RuleInput, RuleOptionSelectItem, RuleVariableSelectItem, SchemaPrefix, SchemaPrefixValue, SingleSelectItem, TagActionManager, TagCollection, VarID, VideoFile };
|
package/dist/public-api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DStyle, Condition, PageQueRules, SchemaDto } from '@media-quest/engine';
|
|
1
|
+
import { DStyle, PageID, Condition, PageQueRules, SchemaID, SchemaDto } from '@media-quest/engine';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Builder objects are complex objects that are embedded inside
|
|
@@ -13,24 +13,12 @@ declare namespace BuilderObjectId {
|
|
|
13
13
|
type QuestionID = string & {
|
|
14
14
|
__QUESTION__ID__: true;
|
|
15
15
|
};
|
|
16
|
-
type VideoFileID = string & {
|
|
17
|
-
__VIDEO__ID__: true;
|
|
18
|
-
};
|
|
19
|
-
type AudioFileID = string & {
|
|
20
|
-
__AUDIO__ID__: true;
|
|
21
|
-
};
|
|
22
|
-
type ImageID = string & {
|
|
23
|
-
__IMAGE__ID__: true;
|
|
24
|
-
};
|
|
25
16
|
type TextID = string & {
|
|
26
17
|
__TEXT__ID__: true;
|
|
27
18
|
};
|
|
28
19
|
type MainTextID = string & {
|
|
29
20
|
__MAIN__TEXT__ID__: true;
|
|
30
21
|
};
|
|
31
|
-
type PageID = string & {
|
|
32
|
-
__PAGE__ID__: true;
|
|
33
|
-
};
|
|
34
22
|
type TagId = string & {
|
|
35
23
|
__TAG__ID__: true;
|
|
36
24
|
};
|
|
@@ -39,7 +27,6 @@ declare namespace BuilderObjectId {
|
|
|
39
27
|
const textId: () => TextID;
|
|
40
28
|
const questionOptionId: () => QuestionOptionID;
|
|
41
29
|
const questionId: () => QuestionID;
|
|
42
|
-
const pageId: () => PageID;
|
|
43
30
|
}
|
|
44
31
|
declare abstract class BuilderObject<T extends BuilderObjectType, Dto extends {}> {
|
|
45
32
|
abstract readonly objectType: T;
|
|
@@ -180,6 +167,46 @@ declare class BuilderMainText extends BuilderObject<"builder-main-text", Builder
|
|
|
180
167
|
set audioFile(audioFile: AudioFile | false);
|
|
181
168
|
}
|
|
182
169
|
|
|
170
|
+
type SchemaPrefixValue = string & {
|
|
171
|
+
__SCHEMA_PREFIX__: true;
|
|
172
|
+
};
|
|
173
|
+
type PagePrefixValue = string & {
|
|
174
|
+
__PAGE_PREFIX__: true;
|
|
175
|
+
};
|
|
176
|
+
type VarID = `${SchemaPrefixValue}_${PagePrefixValue}`;
|
|
177
|
+
declare const VarID: {
|
|
178
|
+
create: (schemaPrefix: SchemaPrefixValue, pagePrefix: PagePrefixValue) => VarID;
|
|
179
|
+
};
|
|
180
|
+
declare class SchemaPrefix {
|
|
181
|
+
private _value;
|
|
182
|
+
static readonly MIN_LENGTH = 1;
|
|
183
|
+
private static randomLen;
|
|
184
|
+
static readonly MAX_LENGTH = 16;
|
|
185
|
+
static fromValue: (value: SchemaPrefixValue) => SchemaPrefix;
|
|
186
|
+
static fromValueOrThrow: (value: string) => SchemaPrefix;
|
|
187
|
+
static fromString: (value: string) => SchemaPrefix | false;
|
|
188
|
+
static castOrCreateRandom: (value: string) => SchemaPrefix;
|
|
189
|
+
static isValid: (prefix: string | 999) => prefix is SchemaPrefixValue;
|
|
190
|
+
get value(): SchemaPrefixValue;
|
|
191
|
+
set value(value: string);
|
|
192
|
+
private constructor();
|
|
193
|
+
}
|
|
194
|
+
declare class PagePrefix {
|
|
195
|
+
private _value;
|
|
196
|
+
static readonly MIN_LENGTH = 1;
|
|
197
|
+
private static randomLen;
|
|
198
|
+
static readonly MAX_LENGTH = 16;
|
|
199
|
+
static fromValue: (value: PagePrefixValue) => PagePrefix;
|
|
200
|
+
static create: () => PagePrefix;
|
|
201
|
+
static fromString: (value: string) => PagePrefix | false;
|
|
202
|
+
static fromStringOrThrow: (value: string) => PagePrefixValue;
|
|
203
|
+
static castOrCreateRandom: (value: string) => PagePrefix;
|
|
204
|
+
static isValid: (prefix: string | 999) => prefix is PagePrefixValue;
|
|
205
|
+
get value(): PagePrefixValue;
|
|
206
|
+
set value(value: string);
|
|
207
|
+
private constructor();
|
|
208
|
+
}
|
|
209
|
+
|
|
183
210
|
declare const BuilderVariableType: {
|
|
184
211
|
readonly numericWithOptions: true;
|
|
185
212
|
readonly numeric: true;
|
|
@@ -198,28 +225,28 @@ declare class BuilderVariableOption {
|
|
|
198
225
|
constructor(label: string, value: number);
|
|
199
226
|
}
|
|
200
227
|
declare class QuestionVariable {
|
|
201
|
-
readonly varId:
|
|
228
|
+
readonly varId: VarID;
|
|
202
229
|
readonly label: string;
|
|
203
230
|
readonly options: ReadonlyArray<BuilderVariableOption>;
|
|
204
231
|
readonly pageNumber: number;
|
|
205
232
|
readonly kind: "question-variable";
|
|
206
233
|
readonly dataType: BuilderVariableType;
|
|
207
|
-
constructor(varId:
|
|
234
|
+
constructor(varId: VarID, label: string, options: ReadonlyArray<BuilderVariableOption>, pageNumber: number);
|
|
208
235
|
}
|
|
209
236
|
declare class CustomVariable {
|
|
210
|
-
readonly varId:
|
|
237
|
+
readonly varId: VarID;
|
|
211
238
|
readonly label: string;
|
|
212
239
|
readonly options: ReadonlyArray<BuilderVariableOption>;
|
|
213
240
|
readonly kind: "configuration-variable";
|
|
214
241
|
readonly dataType: BuilderVariableType;
|
|
215
|
-
constructor(varId:
|
|
242
|
+
constructor(varId: VarID, label: string, options: ReadonlyArray<BuilderVariableOption>);
|
|
216
243
|
}
|
|
217
244
|
type BuilderVariable = QuestionVariable | CustomVariable;
|
|
218
245
|
|
|
219
246
|
type BuilderPageType = "info-page" | "question" | "multi-select" | "form";
|
|
220
247
|
interface BuilderPageDto {
|
|
221
|
-
readonly id:
|
|
222
|
-
prefix:
|
|
248
|
+
readonly id: PageID;
|
|
249
|
+
readonly prefix: PagePrefixValue;
|
|
223
250
|
_type: BuilderPageType;
|
|
224
251
|
mainText: BuilderMainTextDto;
|
|
225
252
|
nextButton: BuilderOptionDto;
|
|
@@ -231,7 +258,7 @@ interface BuilderPageDto {
|
|
|
231
258
|
}
|
|
232
259
|
declare class BuilderPage extends BuilderObject<"builder-page", BuilderPageDto> {
|
|
233
260
|
readonly objectType: "builder-page";
|
|
234
|
-
readonly id:
|
|
261
|
+
readonly id: PageID;
|
|
235
262
|
private _pageType;
|
|
236
263
|
private _prefix;
|
|
237
264
|
private _questions;
|
|
@@ -241,7 +268,7 @@ declare class BuilderPage extends BuilderObject<"builder-page", BuilderPageDto>
|
|
|
241
268
|
defaultQuestion: BuilderQuestion;
|
|
242
269
|
mainText: BuilderMainText;
|
|
243
270
|
nextButton: BuilderOption;
|
|
244
|
-
static create(type: BuilderPageType, _prefix:
|
|
271
|
+
static create(type: BuilderPageType, _prefix: PagePrefixValue): BuilderPage;
|
|
245
272
|
static fromJson(dto: BuilderPageDto): BuilderPage;
|
|
246
273
|
private constructor();
|
|
247
274
|
insertQuestion(question: BuilderQuestion, atIndex: number): boolean;
|
|
@@ -257,11 +284,11 @@ declare class BuilderPage extends BuilderObject<"builder-page", BuilderPageDto>
|
|
|
257
284
|
addTag(tag: string): void;
|
|
258
285
|
deleteTag(tag: string): void;
|
|
259
286
|
set pageType(value: BuilderPageType);
|
|
260
|
-
getQuestionVariables(modulePrefix:
|
|
287
|
+
getQuestionVariables(modulePrefix: SchemaPrefix, pageNumber: number): ReadonlyArray<QuestionVariable>;
|
|
261
288
|
get tags(): ReadonlyArray<string>;
|
|
262
289
|
get pageType(): BuilderPageType;
|
|
263
|
-
get prefix():
|
|
264
|
-
set prefix(value:
|
|
290
|
+
get prefix(): PagePrefixValue;
|
|
291
|
+
set prefix(value: PagePrefixValue);
|
|
265
292
|
toJson(): BuilderPageDto;
|
|
266
293
|
clone(): BuilderPageDto;
|
|
267
294
|
get backgroundColor(): string;
|
|
@@ -270,19 +297,19 @@ declare class BuilderPage extends BuilderObject<"builder-page", BuilderPageDto>
|
|
|
270
297
|
}
|
|
271
298
|
|
|
272
299
|
interface ExcludeByPageAction {
|
|
273
|
-
readonly kind:
|
|
274
|
-
readonly pageId:
|
|
300
|
+
readonly kind: "exclude-by-pageId";
|
|
301
|
+
readonly pageId: PageID;
|
|
275
302
|
readonly mainText: string;
|
|
276
303
|
readonly pageNumber: number;
|
|
277
304
|
}
|
|
278
305
|
interface JumpToPageAction {
|
|
279
|
-
readonly kind:
|
|
280
|
-
readonly pageId:
|
|
306
|
+
readonly kind: "jump-to-page";
|
|
307
|
+
readonly pageId: PageID;
|
|
281
308
|
readonly mainText: string;
|
|
282
309
|
readonly pageNumber: number;
|
|
283
310
|
}
|
|
284
311
|
interface ExcludeByTagAction {
|
|
285
|
-
readonly kind:
|
|
312
|
+
readonly kind: "exclude-by-tag";
|
|
286
313
|
readonly tag: string;
|
|
287
314
|
readonly description: string;
|
|
288
315
|
readonly pageCount: number;
|
|
@@ -445,7 +472,7 @@ declare class BuilderCondition extends BuilderObject<"builder-condition", Builde
|
|
|
445
472
|
isValid: false;
|
|
446
473
|
message: string;
|
|
447
474
|
};
|
|
448
|
-
toEngineCondition(
|
|
475
|
+
toEngineCondition(): Condition.Simple | false;
|
|
449
476
|
private findVariableInUniverse;
|
|
450
477
|
set operator(operator: BuilderOperator | "");
|
|
451
478
|
get operator(): BuilderOperator | "";
|
|
@@ -486,7 +513,7 @@ declare class BuilderConditionGroup extends BuilderObject<"builder-condition-gro
|
|
|
486
513
|
removeCondition(condition: BuilderCondition): boolean;
|
|
487
514
|
clone(): BuilderConditionGroupDto;
|
|
488
515
|
toJson(): BuilderConditionGroupDto;
|
|
489
|
-
toEngineConditionComplex(
|
|
516
|
+
toEngineConditionComplex(): Condition.Complex | false;
|
|
490
517
|
get type(): ConditionGroupType;
|
|
491
518
|
set type(conditionGroupType: ConditionGroupType);
|
|
492
519
|
}
|
|
@@ -564,7 +591,7 @@ declare class BuilderRule extends BuilderObject<"builder-rule", BuilderRuleDto>
|
|
|
564
591
|
addConditionGroup(): BuilderConditionGroup;
|
|
565
592
|
clone(): BuilderRuleDto;
|
|
566
593
|
toJson(): BuilderRuleDto;
|
|
567
|
-
toEngineRule(
|
|
594
|
+
toEngineRule(): PageQueRules;
|
|
568
595
|
}
|
|
569
596
|
|
|
570
597
|
declare class PageActionManager {
|
|
@@ -588,8 +615,8 @@ declare class TagActionManager {
|
|
|
588
615
|
}
|
|
589
616
|
|
|
590
617
|
interface BuilderSchemaDto {
|
|
591
|
-
readonly id:
|
|
592
|
-
readonly prefix:
|
|
618
|
+
readonly id: SchemaID;
|
|
619
|
+
readonly prefix: SchemaPrefixValue;
|
|
593
620
|
readonly mainImage: ImageFile | false;
|
|
594
621
|
readonly backgroundColor: string;
|
|
595
622
|
readonly name: string;
|
|
@@ -605,9 +632,9 @@ interface SchemaBuildOutput {
|
|
|
605
632
|
schemaConfig: Record<string, string>;
|
|
606
633
|
}
|
|
607
634
|
declare class BuilderSchema {
|
|
608
|
-
readonly id:
|
|
635
|
+
readonly id: SchemaID;
|
|
609
636
|
name: string;
|
|
610
|
-
|
|
637
|
+
private readonly _prefix;
|
|
611
638
|
baseHeight: number;
|
|
612
639
|
baseWidth: number;
|
|
613
640
|
backgroundColor: string;
|
|
@@ -615,9 +642,10 @@ declare class BuilderSchema {
|
|
|
615
642
|
mainImage: ImageFile | false;
|
|
616
643
|
private _rules;
|
|
617
644
|
get rules(): ReadonlyArray<BuilderRule>;
|
|
645
|
+
get prefix(): SchemaPrefixValue;
|
|
618
646
|
private readonly _tagCollection;
|
|
619
647
|
get tags(): ReadonlyArray<BuilderTag>;
|
|
620
|
-
static create(id:
|
|
648
|
+
static create(id: SchemaID, name: string, prefix: SchemaPrefixValue): BuilderSchema;
|
|
621
649
|
static fromJson(dto: BuilderSchemaDto): BuilderSchema;
|
|
622
650
|
toJson(): BuilderSchemaDto;
|
|
623
651
|
private constructor();
|
|
@@ -632,7 +660,6 @@ declare class BuilderSchema {
|
|
|
632
660
|
getRuleInput(): RuleInput;
|
|
633
661
|
deleteTags(tags: ReadonlyArray<BuilderTag>): void;
|
|
634
662
|
addTag(builderTag: BuilderTag): void;
|
|
635
|
-
private getQuestionVariables;
|
|
636
663
|
compile(): SchemaBuildOutput;
|
|
637
664
|
}
|
|
638
665
|
|
|
@@ -655,4 +682,4 @@ declare class BuilderText extends BuilderObject<'builder-text', BuilderTextDto>
|
|
|
655
682
|
toJson(): BuilderTextDto;
|
|
656
683
|
}
|
|
657
684
|
|
|
658
|
-
export { AudioFile, BuilderCondition, BuilderConditionDto, BuilderConditionGroup, BuilderConditionGroupDto, BuilderMainImageDto, BuilderMainText, BuilderMainTextDto, BuilderMainVideoDto, BuilderOperator, BuilderOption, BuilderOptionDto, BuilderPage, BuilderPageDto, BuilderPageType, BuilderQuestion, BuilderQuestionDto, BuilderQuestionType, BuilderRule, BuilderRuleDto, BuilderSchema, BuilderSchemaDto, BuilderTag, BuilderTagDto, BuilderText, BuilderTextDto, BuilderVariable, BuilderVariableOption, ConditionGroupType, CustomVariable, ExcludeByPageAction, ExcludeByPageIdSelectItem, ExcludeByTagAction, ExcludeByTagSelectItem, ImageFile, JumpToActionManager, JumpToPageAction, JumpToPageSelectItem, MultiSelectItem, OperatorSelectItem, PageActionManager, QuestionVariable, RuleInput, RuleOptionSelectItem, RuleVariableSelectItem, SingleSelectItem, TagActionManager, TagCollection, VideoFile };
|
|
685
|
+
export { AudioFile, BuilderCondition, BuilderConditionDto, BuilderConditionGroup, BuilderConditionGroupDto, BuilderMainImageDto, BuilderMainText, BuilderMainTextDto, BuilderMainVideoDto, BuilderOperator, BuilderOption, BuilderOptionDto, BuilderPage, BuilderPageDto, BuilderPageType, BuilderQuestion, BuilderQuestionDto, BuilderQuestionType, BuilderRule, BuilderRuleDto, BuilderSchema, BuilderSchemaDto, BuilderTag, BuilderTagDto, BuilderText, BuilderTextDto, BuilderVariable, BuilderVariableOption, ConditionGroupType, CustomVariable, ExcludeByPageAction, ExcludeByPageIdSelectItem, ExcludeByTagAction, ExcludeByTagSelectItem, ImageFile, JumpToActionManager, JumpToPageAction, JumpToPageSelectItem, MultiSelectItem, OperatorSelectItem, PageActionManager, PagePrefix, PagePrefixValue, QuestionVariable, RuleInput, RuleOptionSelectItem, RuleVariableSelectItem, SchemaPrefix, SchemaPrefixValue, SingleSelectItem, TagActionManager, TagCollection, VarID, VideoFile };
|