definition-generator-framework 1.10.6 → 1.11.0
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/.eslintrc.js +2 -2
- package/dist/decorators/definition-generator.js +10 -1
- package/dist/decorators/definition-generator.js.map +1 -1
- package/dist/framework/kernel.js +1 -1
- package/dist/framework/kernel.js.map +1 -1
- package/dist/helpers/validator/custom-validators/reference.custom-validator.js +3 -3
- package/dist/helpers/validator/custom-validators/reference.custom-validator.js.map +1 -1
- package/dist/helpers/validator/custom-validators/unique.custom-validator.d.ts +8 -0
- package/dist/helpers/validator/custom-validators/unique.custom-validator.js +19 -0
- package/dist/helpers/validator/custom-validators/unique.custom-validator.js.map +1 -0
- package/dist/helpers/validator/joi-custom-validators.d.ts +1 -0
- package/dist/helpers/validator/joi-custom-validators.js +6 -0
- package/dist/helpers/validator/joi-custom-validators.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.js +11 -7
- package/dist/index.js.map +1 -1
- package/dist/pre-made-components/events/1-event.d.ts +3 -3
- package/dist/pre-made-components/events/1-event.js +9 -9
- package/dist/pre-made-components/events/1-event.js.map +1 -1
- package/dist/pre-made-components/events/1-script.d.ts +6 -0
- package/dist/pre-made-components/events/1-script.js +101 -0
- package/dist/pre-made-components/events/1-script.js.map +1 -0
- package/dist/pre-made-components/events/2-event-test.d.ts +2 -6
- package/dist/pre-made-components/events/2-event-test.js +12 -12
- package/dist/pre-made-components/events/2-event-test.js.map +1 -1
- package/dist/pre-made-components/events/2-script-test.d.ts +12 -0
- package/dist/pre-made-components/events/2-script-test.js +85 -0
- package/dist/pre-made-components/events/2-script-test.js.map +1 -0
- package/dist/pre-made-components/events/3-event.d.ts +6 -0
- package/dist/pre-made-components/events/3-event.js +99 -0
- package/dist/pre-made-components/events/3-event.js.map +1 -0
- package/dist/pre-made-components/events/4-event-test.d.ts +12 -0
- package/dist/pre-made-components/events/4-event-test.js +85 -0
- package/dist/pre-made-components/events/4-event-test.js.map +1 -0
- package/dist/pre-made-components/events/event-setup.d.ts +3 -3
- package/dist/pre-made-components/events/event-setup.js.map +1 -1
- package/dist/pre-made-components/events/helpers/quotes-to-tags.helper.js +3 -3
- package/dist/pre-made-components/events/helpers/quotes-to-tags.helper.js.map +1 -1
- package/dist/pre-made-components/events/helpers/script-testing.helper.d.ts +24 -0
- package/dist/pre-made-components/events/helpers/script-testing.helper.js +76 -0
- package/dist/pre-made-components/events/helpers/script-testing.helper.js.map +1 -0
- package/dist/pre-made-components/events/script-setup.d.ts +6 -0
- package/dist/pre-made-components/events/script-setup.js +16 -0
- package/dist/pre-made-components/events/script-setup.js.map +1 -0
- package/dist/pre-made-components/events/scripting-setup.d.ts +22 -0
- package/dist/pre-made-components/events/scripting-setup.js +63 -0
- package/dist/pre-made-components/events/scripting-setup.js.map +1 -0
- package/dist/pre-made-components/events/validators.d.ts +6 -0
- package/dist/pre-made-components/events/validators.js +96 -0
- package/dist/pre-made-components/events/validators.js.map +1 -0
- package/package.json +3 -3
- package/package.json.bak +3 -3
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DefinitionComponent } from '../../decorators/definition-component';
|
|
2
|
+
import { Output } from '../../framework/interfaces';
|
|
3
|
+
import { ScriptTestCasesDefinition } from './helpers/script-testing.helper';
|
|
4
|
+
interface ScriptTestDefinition {
|
|
5
|
+
readonly script: string;
|
|
6
|
+
readonly cases: readonly ScriptTestCasesDefinition[];
|
|
7
|
+
}
|
|
8
|
+
export declare class ScriptTestComponent extends DefinitionComponent<ScriptTestDefinition> {
|
|
9
|
+
process(definitions: ScriptTestDefinition[], output: Output): Promise<void>;
|
|
10
|
+
private getLocationFinder;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
var ScriptTestComponent_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.ScriptTestComponent = void 0;
|
|
14
|
+
const joi_1 = __importDefault(require("joi"));
|
|
15
|
+
const definition_component_1 = require("../../decorators/definition-component");
|
|
16
|
+
const definition_store_1 = require("../../framework/definition-store");
|
|
17
|
+
const _1_script_1 = require("./1-script");
|
|
18
|
+
const script_testing_helper_1 = require("./helpers/script-testing.helper");
|
|
19
|
+
const scripting_setup_1 = require("./scripting-setup");
|
|
20
|
+
const CommandEventSchema = joi_1.default.string().custom(value => ({
|
|
21
|
+
type: 'command',
|
|
22
|
+
value: value
|
|
23
|
+
}));
|
|
24
|
+
const RunScriptSchema = joi_1.default.object()
|
|
25
|
+
.keys({
|
|
26
|
+
runScript: joi_1.default.string().reference(_1_script_1.ScriptComponent).required()
|
|
27
|
+
})
|
|
28
|
+
.custom(value => ({
|
|
29
|
+
type: 'runScript',
|
|
30
|
+
value: value.runScript
|
|
31
|
+
}));
|
|
32
|
+
const EventTestActionSchema = () => joi_1.default.array()
|
|
33
|
+
.items(joi_1.default.alternatives()
|
|
34
|
+
.conditional(joi_1.default.string(), {
|
|
35
|
+
then: CommandEventSchema
|
|
36
|
+
})
|
|
37
|
+
.conditional(joi_1.default.object({ runScript: joi_1.default.exist() }).unknown(), {
|
|
38
|
+
then: RunScriptSchema
|
|
39
|
+
})
|
|
40
|
+
.error(errors => errors.map(error => {
|
|
41
|
+
if (error.code === 'alternatives.any') {
|
|
42
|
+
let allowedTypes = 'command, runScript';
|
|
43
|
+
error.message = `${error.local.label} does not match any of the allowed types: ${allowedTypes}`;
|
|
44
|
+
}
|
|
45
|
+
return error;
|
|
46
|
+
})))
|
|
47
|
+
.min(1);
|
|
48
|
+
let ScriptTestComponent = ScriptTestComponent_1 = class ScriptTestComponent extends definition_component_1.DefinitionComponent {
|
|
49
|
+
async process(definitions, output) {
|
|
50
|
+
let allScripts = definition_store_1.DefinitionStore.getDefinitions(_1_script_1.ScriptComponent);
|
|
51
|
+
let scriptTestingHelper = new script_testing_helper_1.ScriptTestingHelper(allScripts, scripting_setup_1.ScriptTestingInternal.scriptSimulatorFunctionsConstructor, this.getLocationFinder());
|
|
52
|
+
let runtimeErrors = scriptTestingHelper.runTests(definitions.map(definition => ({
|
|
53
|
+
cases: definition.cases,
|
|
54
|
+
script: definition_store_1.DefinitionStore.getDefinitionOrFail(_1_script_1.ScriptComponent, definition.script),
|
|
55
|
+
scriptInput: scripting_setup_1.ScriptTestingInternal.getScriptInput(definition.script),
|
|
56
|
+
testDefinitionRef: definition
|
|
57
|
+
})), output);
|
|
58
|
+
scriptTestingHelper.printErrors(runtimeErrors, output);
|
|
59
|
+
}
|
|
60
|
+
getLocationFinder() {
|
|
61
|
+
return {
|
|
62
|
+
getLocationOfDefinition: (key, path) => definition_store_1.DefinitionStore.getLocationInFileById(_1_script_1.ScriptComponent, key, path),
|
|
63
|
+
getLocationOfTestDefinition: (definition, path) => definition_store_1.DefinitionStore.getLocationInFile(ScriptTestComponent_1, definition, path)
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
exports.ScriptTestComponent = ScriptTestComponent;
|
|
68
|
+
exports.ScriptTestComponent = ScriptTestComponent = ScriptTestComponent_1 = __decorate([
|
|
69
|
+
(0, definition_component_1.DefinitionComponentDecorator)({
|
|
70
|
+
componentName: 'SCRIPT-TEST',
|
|
71
|
+
validationSchema: joi_1.default.object()
|
|
72
|
+
.keys({
|
|
73
|
+
script: joi_1.default.string().reference(_1_script_1.ScriptComponent).required(),
|
|
74
|
+
cases: joi_1.default.array()
|
|
75
|
+
.items(joi_1.default.object()
|
|
76
|
+
.keys({
|
|
77
|
+
actionsBeforeTesting: EventTestActionSchema().default([]).optional()
|
|
78
|
+
})
|
|
79
|
+
.required())
|
|
80
|
+
.required()
|
|
81
|
+
})
|
|
82
|
+
.required()
|
|
83
|
+
})
|
|
84
|
+
], ScriptTestComponent);
|
|
85
|
+
//# sourceMappingURL=2-script-test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"2-script-test.js","sourceRoot":"","sources":["../../../src/pre-made-components/events/2-script-test.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,8CAAsB;AAEtB,gFAA0G;AAC1G,uEAAmE;AAEnE,0CAA6C;AAC7C,2EAA8H;AAC9H,uDAA0D;AAO1D,MAAM,kBAAkB,GAAG,aAAG,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACvD,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,KAAK;CACb,CAAC,CAAC,CAAC;AAEJ,MAAM,eAAe,GAAG,aAAG,CAAC,MAAM,EAAE;KACjC,IAAI,CAAC;IACJ,SAAS,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,2BAAe,CAAC,CAAC,QAAQ,EAAE;CAC9D,CAAC;KACD,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAChB,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,KAAK,CAAC,SAAS;CACvB,CAAC,CAAC,CAAC;AAEN,MAAM,qBAAqB,GAAG,GAAoB,EAAE,CAClD,aAAG,CAAC,KAAK,EAAE;KACR,KAAK,CACJ,aAAG,CAAC,YAAY,EAAE;KACf,WAAW,CAAC,aAAG,CAAC,MAAM,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M,CACP,CAAC;QAEF,mBAAmB,CAAC,WAAW,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IACzD,CAAC;IAEO,iBAAiB;QACvB,OAAO;YACL,uBAAuB,EAAE,CAAC,GAAW,EAAE,IAAuB,EAAE,EAAE,CAChE,kCAAe,CAAC,qBAAqB,CAAC,2BAAe,EAAE,GAAG,EAAE,IAAI,CAAC;YACnE,2BAA2B,EAAE,CAAC,UAAgC,EAAE,IAAuB,EAAE,EAAE,CACzF,kCAAe,CAAC,iBAAiB,CAAC,qBAAmB,EAAE,UAAU,EAAE,IAAI,CAAC;SAC3E,CAAC;IACJ,CAAC;CACF,CAAA;AA/BY,kDAAmB;8BAAnB,mBAAmB;IAjB/B,IAAA,mDAA4B,EAAC;QAC5B,aAAa,EAAE,aAAa;QAC5B,gBAAgB,EAAE,aAAG,CAAC,MAAM,EAAE;aAC3B,IAAI,CAAC;YACJ,MAAM,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,2BAAe,CAAC,CAAC,QAAQ,EAAE;YAC1D,KAAK,EAAE,aAAG,CAAC,KAAK,EAAE;iBACf,KAAK,CACJ,aAAG,CAAC,MAAM,EAAE;iBACT,IAAI,CAAC;gBACJ,oBAAoB,EAAE,qBAAqB,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;aACrE,CAAC;iBACD,QAAQ,EAAE,CACd;iBACA,QAAQ,EAAE;SACd,CAAC;aACD,QAAQ,EAAE;KACd,CAAC;GACW,mBAAmB,CA+B/B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ScriptDefinition } from 'script-engine-lib';
|
|
2
|
+
import { DefinitionComponent } from '../../decorators/definition-component';
|
|
3
|
+
import { Output } from '../../framework/interfaces';
|
|
4
|
+
export declare class EventComponent extends DefinitionComponent<ScriptDefinition> {
|
|
5
|
+
process(definitions: ScriptDefinition[], output: Output): Promise<void>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.EventComponent = void 0;
|
|
13
|
+
const helpers_lib_1 = require("helpers-lib");
|
|
14
|
+
const joi_1 = __importDefault(require("joi"));
|
|
15
|
+
const definition_component_1 = require("../../decorators/definition-component");
|
|
16
|
+
const validators_1 = require("./validators");
|
|
17
|
+
const JumpToEventSchema = joi_1.default.object()
|
|
18
|
+
.keys({
|
|
19
|
+
jumpTo: joi_1.default.string().lazyReference('EVENT').required()
|
|
20
|
+
})
|
|
21
|
+
.custom(value => ({
|
|
22
|
+
type: 'jumpTo',
|
|
23
|
+
value: value.jumpTo
|
|
24
|
+
}));
|
|
25
|
+
// ---- Main Schema ----
|
|
26
|
+
const EventActionId = 'EventActionsSchema';
|
|
27
|
+
const ActionsSchema = () => joi_1.default.array()
|
|
28
|
+
.items(joi_1.default.alternatives()
|
|
29
|
+
.conditional(joi_1.default.string(), {
|
|
30
|
+
then: (0, validators_1.ActionCommandSchema)()
|
|
31
|
+
})
|
|
32
|
+
.conditional(joi_1.default.object({ jumpTo: joi_1.default.exist() }).unknown(), {
|
|
33
|
+
then: JumpToEventSchema
|
|
34
|
+
})
|
|
35
|
+
.conditional(joi_1.default.object({ branchByChance: joi_1.default.exist() }).unknown(), {
|
|
36
|
+
then: (0, validators_1.BranchByChanceSchema)(EventActionId)
|
|
37
|
+
})
|
|
38
|
+
.conditional(joi_1.default.object({ branchByCondition: joi_1.default.exist() }).unknown(), {
|
|
39
|
+
then: (0, validators_1.BranchByConditionSchema)(EventActionId)
|
|
40
|
+
})
|
|
41
|
+
.conditional(joi_1.default.object({ branchByPlayerChoice: joi_1.default.exist() }).unknown(), {
|
|
42
|
+
then: (0, validators_1.BranchByPlayerChoiceSchema)(EventActionId)
|
|
43
|
+
})
|
|
44
|
+
.conditional(joi_1.default.object().min(1).max(1).unknown(), {
|
|
45
|
+
then: (0, validators_1.DialogSchema)()
|
|
46
|
+
})
|
|
47
|
+
.error(errors => errors.map(error => {
|
|
48
|
+
if (error.code === 'alternatives.any') {
|
|
49
|
+
let allowedTypes = 'command, jumpTo, branchByCondition, branchByPlayerChoice, branchByChance';
|
|
50
|
+
error.message = `${error.local.label} does not match any of the allowed types: ${allowedTypes}`;
|
|
51
|
+
}
|
|
52
|
+
return error;
|
|
53
|
+
})))
|
|
54
|
+
.custom((array) => {
|
|
55
|
+
let commandFoundAfterBranching = false;
|
|
56
|
+
let emptyStackRequiresBranchingFound = false;
|
|
57
|
+
array.forEach(action => {
|
|
58
|
+
if (emptyStackRequiresBranchingFound) {
|
|
59
|
+
commandFoundAfterBranching = true;
|
|
60
|
+
}
|
|
61
|
+
else if (action.type === 'branchByCondition' ||
|
|
62
|
+
action.type === 'branchByPlayerChoice' ||
|
|
63
|
+
action.type === 'branchByChance') {
|
|
64
|
+
emptyStackRequiresBranchingFound = true;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
if (commandFoundAfterBranching) {
|
|
68
|
+
throw new Error('There should not be any command after branching.');
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
return array;
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
.id(EventActionId);
|
|
75
|
+
let EventComponent = class EventComponent extends definition_component_1.DefinitionComponent {
|
|
76
|
+
async process(definitions, output) {
|
|
77
|
+
await output.addFile({
|
|
78
|
+
path: '/_premade/script-engine-definitions/events.ts',
|
|
79
|
+
preText: `import { ScriptDefinition } from "script-engine-lib";`,
|
|
80
|
+
variableName: 'EventDefinitions',
|
|
81
|
+
variableType: 'Readonly<Record<string, ScriptDefinition>>',
|
|
82
|
+
variable: helpers_lib_1.JsonHelper.arrayToObject(definitions, 'id')
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
exports.EventComponent = EventComponent;
|
|
87
|
+
exports.EventComponent = EventComponent = __decorate([
|
|
88
|
+
(0, definition_component_1.DefinitionComponentDecorator)({
|
|
89
|
+
componentName: 'EVENT',
|
|
90
|
+
keyName: 'id',
|
|
91
|
+
validationSchema: joi_1.default.object()
|
|
92
|
+
.keys({
|
|
93
|
+
id: joi_1.default.string().required(),
|
|
94
|
+
actions: ActionsSchema().min(1).required()
|
|
95
|
+
})
|
|
96
|
+
.required()
|
|
97
|
+
})
|
|
98
|
+
], EventComponent);
|
|
99
|
+
//# sourceMappingURL=3-event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"3-event.js","sourceRoot":"","sources":["../../../src/pre-made-components/events/3-event.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAyC;AACzC,8CAAsB;AAGtB,gFAA0G;AAE1G,6CAMsB;AAEtB,MAAM,iBAAiB,GAAG,aAAG,CAAC,MAAM,EAAE;KACnC,IAAI,CAAC;IACJ,MAAM,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE;CACvD,CAAC;KACD,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAChB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,KAAK,CAAC,MAAM;CACpB,CAAC,CAAC,CAAC;AAEN,wBAAwB;AACxB,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Ac;yBAAd,cAAc;IAV1B,IAAA,mDAA4B,EAAC;QAC5B,aAAa,EAAE,OAAO;QACtB,OAAO,EAAE,IAAI;QACb,gBAAgB,EAAE,aAAG,CAAC,MAAM,EAAE;aAC3B,IAAI,CAAC;YACJ,EAAE,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAC3B,OAAO,EAAE,aAAa,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;SAC3C,CAAC;aACD,QAAQ,EAAE;KACd,CAAC;GACW,cAAc,CAU1B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DefinitionComponent } from '../../decorators/definition-component';
|
|
2
|
+
import { Output } from '../../framework/interfaces';
|
|
3
|
+
import { ScriptTestCasesDefinition } from './helpers/script-testing.helper';
|
|
4
|
+
interface EventTestDefinition {
|
|
5
|
+
readonly event: string;
|
|
6
|
+
readonly cases: readonly ScriptTestCasesDefinition[];
|
|
7
|
+
}
|
|
8
|
+
export declare class EventTestComponent extends DefinitionComponent<EventTestDefinition> {
|
|
9
|
+
process(definitions: EventTestDefinition[], output: Output): Promise<void>;
|
|
10
|
+
private getLocationFinder;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
var EventTestComponent_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.EventTestComponent = void 0;
|
|
14
|
+
const joi_1 = __importDefault(require("joi"));
|
|
15
|
+
const definition_component_1 = require("../../decorators/definition-component");
|
|
16
|
+
const definition_store_1 = require("../../framework/definition-store");
|
|
17
|
+
const _3_event_1 = require("./3-event");
|
|
18
|
+
const script_testing_helper_1 = require("./helpers/script-testing.helper");
|
|
19
|
+
const scripting_setup_1 = require("./scripting-setup");
|
|
20
|
+
const CommandEventSchema = joi_1.default.string().custom(value => ({
|
|
21
|
+
type: 'command',
|
|
22
|
+
value: value
|
|
23
|
+
}));
|
|
24
|
+
const RunEventSchema = joi_1.default.object()
|
|
25
|
+
.keys({
|
|
26
|
+
runEvent: joi_1.default.string().reference(_3_event_1.EventComponent).required()
|
|
27
|
+
})
|
|
28
|
+
.custom(value => ({
|
|
29
|
+
type: 'runScript',
|
|
30
|
+
value: value.runEvent
|
|
31
|
+
}));
|
|
32
|
+
const EventTestActionSchema = () => joi_1.default.array()
|
|
33
|
+
.items(joi_1.default.alternatives()
|
|
34
|
+
.conditional(joi_1.default.string(), {
|
|
35
|
+
then: CommandEventSchema
|
|
36
|
+
})
|
|
37
|
+
.conditional(joi_1.default.object({ runEvent: joi_1.default.exist() }).unknown(), {
|
|
38
|
+
then: RunEventSchema
|
|
39
|
+
})
|
|
40
|
+
.error(errors => errors.map(error => {
|
|
41
|
+
if (error.code === 'alternatives.any') {
|
|
42
|
+
let allowedTypes = 'command, runEvent';
|
|
43
|
+
error.message = `${error.local.label} does not match any of the allowed types: ${allowedTypes}`;
|
|
44
|
+
}
|
|
45
|
+
return error;
|
|
46
|
+
})))
|
|
47
|
+
.min(1);
|
|
48
|
+
let EventTestComponent = EventTestComponent_1 = class EventTestComponent extends definition_component_1.DefinitionComponent {
|
|
49
|
+
async process(definitions, output) {
|
|
50
|
+
let allScripts = definition_store_1.DefinitionStore.getDefinitions(_3_event_1.EventComponent);
|
|
51
|
+
let scriptTestingHelper = new script_testing_helper_1.ScriptTestingHelper(allScripts, scripting_setup_1.ScriptTestingInternal.eventSimulatorFunctionsConstructor, this.getLocationFinder());
|
|
52
|
+
let runtimeErrors = scriptTestingHelper.runTests(definitions.map(definition => ({
|
|
53
|
+
cases: definition.cases,
|
|
54
|
+
script: definition_store_1.DefinitionStore.getDefinitionOrFail(_3_event_1.EventComponent, definition.event),
|
|
55
|
+
scriptInput: scripting_setup_1.ScriptTestingInternal.getEventInput(definition.event),
|
|
56
|
+
testDefinitionRef: definition
|
|
57
|
+
})), output);
|
|
58
|
+
scriptTestingHelper.printErrors(runtimeErrors, output);
|
|
59
|
+
}
|
|
60
|
+
getLocationFinder() {
|
|
61
|
+
return {
|
|
62
|
+
getLocationOfDefinition: (key, path) => definition_store_1.DefinitionStore.getLocationInFileById(_3_event_1.EventComponent, key, path),
|
|
63
|
+
getLocationOfTestDefinition: (definition, path) => definition_store_1.DefinitionStore.getLocationInFile(EventTestComponent_1, definition, path)
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
exports.EventTestComponent = EventTestComponent;
|
|
68
|
+
exports.EventTestComponent = EventTestComponent = EventTestComponent_1 = __decorate([
|
|
69
|
+
(0, definition_component_1.DefinitionComponentDecorator)({
|
|
70
|
+
componentName: 'EVENT-TEST',
|
|
71
|
+
validationSchema: joi_1.default.object()
|
|
72
|
+
.keys({
|
|
73
|
+
event: joi_1.default.string().reference(_3_event_1.EventComponent).required(),
|
|
74
|
+
cases: joi_1.default.array()
|
|
75
|
+
.items(joi_1.default.object()
|
|
76
|
+
.keys({
|
|
77
|
+
actionsBeforeTesting: EventTestActionSchema().default([]).optional()
|
|
78
|
+
})
|
|
79
|
+
.required())
|
|
80
|
+
.required()
|
|
81
|
+
})
|
|
82
|
+
.required()
|
|
83
|
+
})
|
|
84
|
+
], EventTestComponent);
|
|
85
|
+
//# sourceMappingURL=4-event-test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"4-event-test.js","sourceRoot":"","sources":["../../../src/pre-made-components/events/4-event-test.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,8CAAsB;AAEtB,gFAA0G;AAC1G,uEAAmE;AAEnE,wCAA2C;AAC3C,2EAA8H;AAC9H,uDAA0D;AAO1D,MAAM,kBAAkB,GAAG,aAAG,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACvD,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,KAAK;CACb,CAAC,CAAC,CAAC;AAEJ,MAAM,cAAc,GAAG,aAAG,CAAC,MAAM,EAAE;KAChC,IAAI,CAAC;IACJ,QAAQ,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,yBAAc,CAAC,CAAC,QAAQ,EAAE;CAC5D,CAAC;KACD,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAChB,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,KAAK,CAAC,QAAQ;CACtB,CAAC,CAAC,CAAC;AAEN,MAAM,qBAAqB,GAAG,GAAoB,EAAE,CAClD,aAAG,CAAC,KAAK,EAAE;KACR,KAAK,CACJ,aAAG,CAAC,YAAY,EAAE;KACf,WAAW,CAAC,aAAG,CAAC,MAAM,EAAE,EAAE;IACzB,IAAI,EAAE,kBAAkB;CACzB,CAAC;KACD,WAAW,CAAC,aAAG,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,aAAG,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE;IAC5D,IAAI,EAAE,cAAc;CACrB,CAAC;KACD,KAAK,CAAC,MAAM,CAAC,EAAE,CACd,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;IACjB,IAAI,KAAK,CAAC,IAAI,KAAK,kBAAkB,EAAE,C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kB,EAAE,UAAU,EAAE,IAAI,CAAC;SAC1E,CAAC;IACJ,CAAC;CACF,CAAA;AA/BY,gDAAkB;6BAAlB,kBAAkB;IAjB9B,IAAA,mDAA4B,EAAC;QAC5B,aAAa,EAAE,YAAY;QAC3B,gBAAgB,EAAE,aAAG,CAAC,MAAM,EAAE;aAC3B,IAAI,CAAC;YACJ,KAAK,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,yBAAc,CAAC,CAAC,QAAQ,EAAE;YACxD,KAAK,EAAE,aAAG,CAAC,KAAK,EAAE;iBACf,KAAK,CACJ,aAAG,CAAC,MAAM,EAAE;iBACT,IAAI,CAAC;gBACJ,oBAAoB,EAAE,qBAAqB,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;aACrE,CAAC;iBACD,QAAQ,EAAE,CACd;iBACA,QAAQ,EAAE;SACd,CAAC;aACD,QAAQ,EAAE;KACd,CAAC;GACW,kBAAkB,CA+B9B"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ScriptEngineSimulatorFunctions } from 'script-engine-lib';
|
|
2
2
|
export declare class EventSetup {
|
|
3
3
|
private static _eventSimulatorFunctionsConstructor;
|
|
4
4
|
private static _richTextTags;
|
|
5
|
-
static get EventSimulatorFunctionsConstructor(): new (...args: any[]) =>
|
|
5
|
+
static get EventSimulatorFunctionsConstructor(): new (...args: any[]) => ScriptEngineSimulatorFunctions;
|
|
6
6
|
static get RichTextTags(): Set<string> | undefined;
|
|
7
|
-
static set(eventSimulatorFunctionsConstructor: new (...args: any[]) =>
|
|
7
|
+
static set(eventSimulatorFunctionsConstructor: new (...args: any[]) => ScriptEngineSimulatorFunctions, richTextTags: Set<string> | undefined): void;
|
|
8
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-setup.js","sourceRoot":"","sources":["../../../src/pre-made-components/events/event-setup.ts"],"names":[],"mappings":";;;AAEA,MAAa,UAAU;IAIrB,MAAM,KAAK,kCAAkC;QAC3C,IAAI,CAAC,IAAI,CAAC,mCAAmC,EAAE,CAAC;YAC9C,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;QACnE,CAAC;QACD,OAAO,IAAI,CAAC,mCAAmC,CAAC;IAClD,CAAC;IAED,MAAM,KAAK,YAAY;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,MAAM,CAAC,GAAG,CACR,
|
|
1
|
+
{"version":3,"file":"event-setup.js","sourceRoot":"","sources":["../../../src/pre-made-components/events/event-setup.ts"],"names":[],"mappings":";;;AAEA,MAAa,UAAU;IAIrB,MAAM,KAAK,kCAAkC;QAC3C,IAAI,CAAC,IAAI,CAAC,mCAAmC,EAAE,CAAC;YAC9C,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;QACnE,CAAC;QACD,OAAO,IAAI,CAAC,mCAAmC,CAAC;IAClD,CAAC;IAED,MAAM,KAAK,YAAY;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,MAAM,CAAC,GAAG,CACR,kCAA0F,EAC1F,YAAqC;QAErC,IAAI,CAAC,mCAAmC,GAAG,kCAAkC,CAAC;QAC9E,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;IACpC,CAAC;CACF;AAtBD,gCAsBC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.QuotesToTagsHelper = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const script_engine_lib_1 = require("script-engine-lib");
|
|
5
|
+
const scripting_setup_1 = require("../scripting-setup");
|
|
6
6
|
class QuotesToTagsHelper {
|
|
7
7
|
static convert(text) {
|
|
8
8
|
let isInsideQuote = false;
|
|
@@ -16,7 +16,7 @@ class QuotesToTagsHelper {
|
|
|
16
16
|
if (isInsideQuote) {
|
|
17
17
|
throw new Error('Quote is not closed.');
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
script_engine_lib_1.RichTextValidator.validate(text, scripting_setup_1.ScriptTestingInternal.richTextTags);
|
|
20
20
|
return text;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quotes-to-tags.helper.js","sourceRoot":"","sources":["../../../../src/pre-made-components/events/helpers/quotes-to-tags.helper.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"quotes-to-tags.helper.js","sourceRoot":"","sources":["../../../../src/pre-made-components/events/helpers/quotes-to-tags.helper.ts"],"names":[],"mappings":";;;AAAA,yDAAsD;AACtD,wDAA2D;AAE3D,MAAa,kBAAkB;IAC7B,MAAM,CAAC,OAAO,CAAC,IAAY;QACzB,IAAI,aAAa,GAAG,KAAK,CAAC;QAE1B,IAAI,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACnC,OAAO,UAAU,IAAI,CAAC,EAAE,CAAC;YACvB,IAAI,GAAG,GAAG,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;YAC3C,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,UAAU,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;YAC5E,aAAa,GAAG,CAAC,aAAa,CAAC;YAC/B,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC;QAC1D,CAAC;QAED,IAAI,aAAa,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAC1C,CAAC;QAED,qCAAiB,CAAC,QAAQ,CAAC,IAAI,EAAE,uCAAqB,CAAC,YAAY,CAAC,CAAC;QAErE,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AApBD,gDAoBC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ScriptDefinition, ScriptEngineSimulatorFunctions, ScriptTestActionDefinition } from 'script-engine-lib';
|
|
2
|
+
import { ErrorLog, LocationInFile, Output } from '../../../framework/interfaces';
|
|
3
|
+
export interface ScriptTestCasesDefinition {
|
|
4
|
+
readonly actionsBeforeTesting: readonly ScriptTestActionDefinition[];
|
|
5
|
+
}
|
|
6
|
+
export interface ScriptTestDefinition<T> {
|
|
7
|
+
readonly script: ScriptDefinition;
|
|
8
|
+
readonly testDefinitionRef: T;
|
|
9
|
+
readonly scriptInput: any;
|
|
10
|
+
readonly cases: readonly ScriptTestCasesDefinition[];
|
|
11
|
+
}
|
|
12
|
+
export interface ScriptTestingLocationFinder<T> {
|
|
13
|
+
getLocationOfDefinition(key: string, path: readonly string[]): LocationInFile;
|
|
14
|
+
getLocationOfTestDefinition(definition: T, path: readonly string[]): LocationInFile;
|
|
15
|
+
}
|
|
16
|
+
export declare class ScriptTestingHelper<T> {
|
|
17
|
+
private functionsConstructor;
|
|
18
|
+
private locationFinder;
|
|
19
|
+
private scriptTestSimulator;
|
|
20
|
+
constructor(allScripts: ScriptDefinition[], functionsConstructor: new (input: any) => ScriptEngineSimulatorFunctions, locationFinder: ScriptTestingLocationFinder<T>);
|
|
21
|
+
runTests(testDefinitions: ScriptTestDefinition<T>[], output: Output): ErrorLog[];
|
|
22
|
+
printErrors(runtimeErrors: ErrorLog[], output: Output): void;
|
|
23
|
+
private prepareErrorLog;
|
|
24
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ScriptTestingHelper = void 0;
|
|
4
|
+
const helpers_lib_1 = require("helpers-lib");
|
|
5
|
+
const script_engine_lib_1 = require("script-engine-lib");
|
|
6
|
+
class ScriptTestingHelper {
|
|
7
|
+
constructor(allScripts, functionsConstructor, locationFinder) {
|
|
8
|
+
this.functionsConstructor = functionsConstructor;
|
|
9
|
+
this.locationFinder = locationFinder;
|
|
10
|
+
this.scriptTestSimulator = new script_engine_lib_1.ScriptTestSimulator(allScripts);
|
|
11
|
+
}
|
|
12
|
+
runTests(testDefinitions, output) {
|
|
13
|
+
let errorLogs = [];
|
|
14
|
+
testDefinitions.forEach(testDefinition => {
|
|
15
|
+
let errorEncountered = false;
|
|
16
|
+
testDefinition.cases.forEach((testCase, testCaseIndex) => {
|
|
17
|
+
if (!errorEncountered) {
|
|
18
|
+
let jsEngine = new helpers_lib_1.JSEngine(new this.functionsConstructor(testDefinition.scriptInput), {});
|
|
19
|
+
try {
|
|
20
|
+
this.scriptTestSimulator.simulateScript(testDefinition.script, jsEngine, testCase.actionsBeforeTesting);
|
|
21
|
+
}
|
|
22
|
+
catch (e) {
|
|
23
|
+
let errorLog = this.prepareErrorLog(e, testDefinition, testCaseIndex, output);
|
|
24
|
+
errorLogs.push(errorLog);
|
|
25
|
+
errorEncountered = true;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
return errorLogs;
|
|
31
|
+
}
|
|
32
|
+
printErrors(runtimeErrors, output) {
|
|
33
|
+
if (runtimeErrors.length === 0) {
|
|
34
|
+
this.scriptTestSimulator.getUnvisitedBranchLocations().forEach(location => output.addError({
|
|
35
|
+
description: `Event branch is not reaced by any of the combinations during the tests.`,
|
|
36
|
+
location: this.locationFinder.getLocationOfDefinition(location.scriptId, location.path)
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
39
|
+
runtimeErrors.forEach(error => output.addError(error));
|
|
40
|
+
}
|
|
41
|
+
prepareErrorLog(e, testDefinition, testCaseIndex, output) {
|
|
42
|
+
if (e instanceof script_engine_lib_1.SimulationError) {
|
|
43
|
+
return {
|
|
44
|
+
description: e.message,
|
|
45
|
+
location: this.locationFinder.getLocationOfDefinition(e.location.scriptId, e.location.path)
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
else if (e instanceof script_engine_lib_1.ActionsBeforeTestingError) {
|
|
49
|
+
let executedActionLocation = this.locationFinder.getLocationOfTestDefinition(testDefinition.testDefinitionRef, [
|
|
50
|
+
'cases',
|
|
51
|
+
`${testCaseIndex}`,
|
|
52
|
+
'actionsBeforeTesting',
|
|
53
|
+
`${e.actionIndex}`
|
|
54
|
+
]);
|
|
55
|
+
return {
|
|
56
|
+
description: e.message,
|
|
57
|
+
location: executedActionLocation
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
else if (e instanceof script_engine_lib_1.BranchingBeforeTestingError) {
|
|
61
|
+
let testLocation = this.locationFinder.getLocationOfTestDefinition(testDefinition.testDefinitionRef, []);
|
|
62
|
+
let executionHistoryAddition = `Running the test: ${output.convertLocationInFileToLink(testLocation)}\n\n`;
|
|
63
|
+
let executionHistoryStart = e.message.indexOf('\n', e.message.indexOf('Execution history')) + 1;
|
|
64
|
+
let fullMessage = e.message.slice(0, executionHistoryStart) + executionHistoryAddition + e.message.slice(executionHistoryStart);
|
|
65
|
+
return {
|
|
66
|
+
description: fullMessage,
|
|
67
|
+
location: this.locationFinder.getLocationOfDefinition(e.location.scriptId, e.location.path)
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
throw e;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
exports.ScriptTestingHelper = ScriptTestingHelper;
|
|
76
|
+
//# sourceMappingURL=script-testing.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"script-testing.helper.js","sourceRoot":"","sources":["../../../../src/pre-made-components/events/helpers/script-testing.helper.ts"],"names":[],"mappings":";;;AAAA,6CAAuC;AACvC,yDAQ2B;AAoB3B,MAAa,mBAAmB;IAG9B,YACE,UAA8B,EACtB,oBAAwE,EACxE,cAA8C;QAD9C,yBAAoB,GAApB,oBAAoB,CAAoD;QACxE,mBAAc,GAAd,cAA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CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,GAAG,CAAC,CAAC;YAChG,IAAI,WAAW,GACb,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,qBAAqB,CAAC,GAAG,wBAAwB,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;YAEhH,OAAO;gBACL,WAAW,EAAE,WAAW;gBACxB,QAAQ,EAAE,IAAI,CAAC,cAAc,CAAC,uBAAuB,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;aAC5F,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,CAAC;QACV,CAAC;IACH,CAAC;CACF;AArFD,kDAqFC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ScriptEngineSimulatorFunctions } from 'script-engine-lib';
|
|
2
|
+
export declare class ScriptSetup {
|
|
3
|
+
private static _scriptSimulatorFunctionsConstructor;
|
|
4
|
+
static get ScriptSimulatorFunctionsConstructor(): new (...args: any[]) => ScriptEngineSimulatorFunctions;
|
|
5
|
+
static set(scriptSimulatorFunctionsConstructor: new (...args: any[]) => ScriptEngineSimulatorFunctions): void;
|
|
6
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ScriptSetup = void 0;
|
|
4
|
+
class ScriptSetup {
|
|
5
|
+
static get ScriptSimulatorFunctionsConstructor() {
|
|
6
|
+
if (!this._scriptSimulatorFunctionsConstructor) {
|
|
7
|
+
throw new Error('ScriptSimulatorFunctionsConstructor is not set');
|
|
8
|
+
}
|
|
9
|
+
return this._scriptSimulatorFunctionsConstructor;
|
|
10
|
+
}
|
|
11
|
+
static set(scriptSimulatorFunctionsConstructor) {
|
|
12
|
+
this._scriptSimulatorFunctionsConstructor = scriptSimulatorFunctionsConstructor;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.ScriptSetup = ScriptSetup;
|
|
16
|
+
//# sourceMappingURL=script-setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"script-setup.js","sourceRoot":"","sources":["../../../src/pre-made-components/events/script-setup.ts"],"names":[],"mappings":";;;AAEA,MAAa,WAAW;IAGtB,MAAM,KAAK,mCAAmC;QAC5C,IAAI,CAAC,IAAI,CAAC,oCAAoC,EAAE,CAAC;YAC/C,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;QACpE,CAAC;QACD,OAAO,IAAI,CAAC,oCAAoC,CAAC;IACnD,CAAC;IAED,MAAM,CAAC,GAAG,CAAC,mCAA2F;QACpG,IAAI,CAAC,oCAAoC,GAAG,mCAAmC,CAAC;IAClF,CAAC;CACF;AAbD,kCAaC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ScriptEngineSimulatorFunctions } from 'script-engine-lib';
|
|
2
|
+
export declare class ScriptTesting<ScriptInputType, EventInputType> {
|
|
3
|
+
constructor(scriptSimulatorFunctionsConstructor: new (input: ScriptInputType) => ScriptEngineSimulatorFunctions, eventSimulatorFunctionsConstructor: new (input: EventInputType) => ScriptEngineSimulatorFunctions, richTextTags: Set<string> | undefined);
|
|
4
|
+
setScriptInput(scriptId: string, input: ScriptInputType): void;
|
|
5
|
+
setEventInput(eventId: string, input: EventInputType): void;
|
|
6
|
+
}
|
|
7
|
+
export declare class ScriptTestingInternal {
|
|
8
|
+
private static _scriptSimulatorFunctionsConstructor;
|
|
9
|
+
private static _eventSimulatorFunctionsConstructor;
|
|
10
|
+
private static _scriptInputs;
|
|
11
|
+
private static _eventInputs;
|
|
12
|
+
private static _richTextTags;
|
|
13
|
+
static get scriptSimulatorFunctionsConstructor(): new (...args: any[]) => ScriptEngineSimulatorFunctions;
|
|
14
|
+
static get eventSimulatorFunctionsConstructor(): new (...args: any[]) => ScriptEngineSimulatorFunctions;
|
|
15
|
+
static get richTextTags(): Set<string> | undefined;
|
|
16
|
+
static get isInitialized(): boolean;
|
|
17
|
+
static setup(scriptSimulatorFunctionsConstructor: new (...args: any[]) => ScriptEngineSimulatorFunctions, eventSimulatorFunctionsConstructor: new (...args: any[]) => ScriptEngineSimulatorFunctions, richTextTags: Set<string> | undefined): void;
|
|
18
|
+
static getScriptInput(scriptId: string): any;
|
|
19
|
+
static getEventInput(eventId: string): any;
|
|
20
|
+
static setScriptInput(scriptId: string, input: any): void;
|
|
21
|
+
static setEventInput(eventId: string, input: any): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ScriptTestingInternal = exports.ScriptTesting = void 0;
|
|
4
|
+
// Exposed to the user
|
|
5
|
+
class ScriptTesting {
|
|
6
|
+
constructor(scriptSimulatorFunctionsConstructor, eventSimulatorFunctionsConstructor, richTextTags) {
|
|
7
|
+
ScriptTestingInternal.setup(scriptSimulatorFunctionsConstructor, eventSimulatorFunctionsConstructor, richTextTags);
|
|
8
|
+
}
|
|
9
|
+
setScriptInput(scriptId, input) {
|
|
10
|
+
ScriptTestingInternal.setScriptInput(scriptId, input);
|
|
11
|
+
}
|
|
12
|
+
setEventInput(eventId, input) {
|
|
13
|
+
ScriptTestingInternal.setEventInput(eventId, input);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.ScriptTesting = ScriptTesting;
|
|
17
|
+
class ScriptTestingInternal {
|
|
18
|
+
static { this._scriptInputs = new Map(); }
|
|
19
|
+
static { this._eventInputs = new Map(); }
|
|
20
|
+
static get scriptSimulatorFunctionsConstructor() {
|
|
21
|
+
if (!this._scriptSimulatorFunctionsConstructor) {
|
|
22
|
+
throw new Error('ScriptSimulatorFunctionsConstructor is not set');
|
|
23
|
+
}
|
|
24
|
+
return this._scriptSimulatorFunctionsConstructor;
|
|
25
|
+
}
|
|
26
|
+
static get eventSimulatorFunctionsConstructor() {
|
|
27
|
+
if (!this._eventSimulatorFunctionsConstructor) {
|
|
28
|
+
throw new Error('ScriptSimulatorFunctionsConstructor is not set');
|
|
29
|
+
}
|
|
30
|
+
return this._eventSimulatorFunctionsConstructor;
|
|
31
|
+
}
|
|
32
|
+
static get richTextTags() {
|
|
33
|
+
return this._richTextTags;
|
|
34
|
+
}
|
|
35
|
+
static get isInitialized() {
|
|
36
|
+
return (this._scriptSimulatorFunctionsConstructor && this._eventSimulatorFunctionsConstructor && this._richTextTags !== undefined);
|
|
37
|
+
}
|
|
38
|
+
static setup(scriptSimulatorFunctionsConstructor, eventSimulatorFunctionsConstructor, richTextTags) {
|
|
39
|
+
this._scriptSimulatorFunctionsConstructor = scriptSimulatorFunctionsConstructor;
|
|
40
|
+
this._eventSimulatorFunctionsConstructor = eventSimulatorFunctionsConstructor;
|
|
41
|
+
this._richTextTags = richTextTags;
|
|
42
|
+
}
|
|
43
|
+
static getScriptInput(scriptId) {
|
|
44
|
+
return this._scriptInputs.get(scriptId);
|
|
45
|
+
}
|
|
46
|
+
static getEventInput(eventId) {
|
|
47
|
+
return this._eventInputs.get(eventId);
|
|
48
|
+
}
|
|
49
|
+
static setScriptInput(scriptId, input) {
|
|
50
|
+
if (this._scriptInputs.has(scriptId)) {
|
|
51
|
+
throw new Error(`Script input for ${scriptId} already set`);
|
|
52
|
+
}
|
|
53
|
+
this._scriptInputs.set(scriptId, input);
|
|
54
|
+
}
|
|
55
|
+
static setEventInput(eventId, input) {
|
|
56
|
+
if (this._eventInputs.has(eventId)) {
|
|
57
|
+
throw new Error(`Event input for ${eventId} already set`);
|
|
58
|
+
}
|
|
59
|
+
this._eventInputs.set(eventId, input);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.ScriptTestingInternal = ScriptTestingInternal;
|
|
63
|
+
//# sourceMappingURL=scripting-setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scripting-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EAC3F,kCAA0F,EAC1F,YAAqC;QAErC,IAAI,CAAC,oCAAoC,GAAG,mCAAmC,CAAC;QAChF,IAAI,CAAC,mCAAmC,GAAG,kCAAkC,CAAC;QAC9E,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;IACpC,CAAC;IAED,MAAM,CAAC,cAAc,CAAC,QAAgB;QACpC,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAED,MAAM,CAAC,aAAa,CAAC,OAAe;QAClC,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC;IAED,MAAM,CAAC,cAAc,CAAC,QAAgB,EAAE,KAAU;QAChD,IAAI,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YACrC,MAAM,IAAI,KAAK,CAAC,oBAAoB,QAAQ,cAAc,CAAC,CAAC;QAC9D,CAAC;QACD,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;IAED,MAAM,CAAC,aAAa,CAAC,OAAe,EAAE,KAAU;QAC9C,IAAI,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;YACnC,MAAM,IAAI,KAAK,CAAC,mBAAmB,OAAO,cAAc,CAAC,CAAC;QAC5D,CAAC;QACD,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACxC,CAAC;;AA/DH,sDAgEC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import Joi from 'joi';
|
|
2
|
+
export declare const ActionCommandSchema: () => Joi.Schema;
|
|
3
|
+
export declare const BranchByConditionSchema: (scriptLinkName: string) => Joi.Schema;
|
|
4
|
+
export declare const BranchByPlayerChoiceSchema: (scriptLinkName: string) => Joi.Schema;
|
|
5
|
+
export declare const BranchByChanceSchema: (scriptLinkName: string) => Joi.Schema;
|
|
6
|
+
export declare const DialogSchema: () => Joi.Schema;
|