script-engine-lib 0.4.2 → 1.0.0-rc0
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/index.d.mts +191 -0
- package/dist/index.d.ts +191 -5
- package/dist/index.js +21 -29
- package/dist/index.mjs +21 -0
- package/package.json +56 -47
- package/src/index.ts +10 -0
- package/.eslintrc.js +0 -212
- package/.vscode/launch.json +0 -15
- package/.vscode/settings.json +0 -15
- package/dist/decorators/action-before-testing.d.ts +0 -2
- package/dist/decorators/action-before-testing.js +0 -23
- package/dist/decorators/action-before-testing.js.map +0 -1
- package/dist/decorators/action-before-testing.test.d.ts +0 -1
- package/dist/decorators/action-before-testing.test.js +0 -82
- package/dist/decorators/action-before-testing.test.js.map +0 -1
- package/dist/engine/script-engine.d.ts +0 -35
- package/dist/engine/script-engine.js +0 -175
- package/dist/engine/script-engine.js.map +0 -1
- package/dist/engine/script-engine.test.d.ts +0 -1
- package/dist/engine/script-engine.test.js +0 -1277
- package/dist/engine/script-engine.test.js.map +0 -1
- package/dist/engine/story-engine.d.ts +0 -35
- package/dist/engine/story-engine.js +0 -175
- package/dist/engine/story-engine.js.map +0 -1
- package/dist/engine/story-engine.test.d.ts +0 -1
- package/dist/engine/story-engine.test.js +0 -1277
- package/dist/engine/story-engine.test.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/interfaces.d.ts +0 -51
- package/dist/interfaces.js +0 -27
- package/dist/interfaces.js.map +0 -1
- package/dist/simulator/decorators.d.ts +0 -2
- package/dist/simulator/decorators.js +0 -23
- package/dist/simulator/decorators.js.map +0 -1
- package/dist/simulator/decorators.test.d.ts +0 -1
- package/dist/simulator/decorators.test.js +0 -81
- package/dist/simulator/decorators.test.js.map +0 -1
- package/dist/simulator/event-branches-map.d.ts +0 -16
- package/dist/simulator/event-branches-map.js +0 -114
- package/dist/simulator/event-branches-map.js.map +0 -1
- package/dist/simulator/event-branches-map.test.d.ts +0 -1
- package/dist/simulator/event-branches-map.test.js +0 -120
- package/dist/simulator/event-branches-map.test.js.map +0 -1
- package/dist/simulator/event-test-simulator.d.ts +0 -42
- package/dist/simulator/event-test-simulator.js +0 -373
- package/dist/simulator/event-test-simulator.js.map +0 -1
- package/dist/simulator/event-test-simulator.test.d.ts +0 -1
- package/dist/simulator/event-test-simulator.test.js +0 -1960
- package/dist/simulator/event-test-simulator.test.js.map +0 -1
- package/dist/simulator/execution-history.d.ts +0 -6
- package/dist/simulator/execution-history.js +0 -22
- package/dist/simulator/execution-history.js.map +0 -1
- package/dist/simulator/helpers/event-branches-map.d.ts +0 -16
- package/dist/simulator/helpers/event-branches-map.js +0 -114
- package/dist/simulator/helpers/event-branches-map.js.map +0 -1
- package/dist/simulator/helpers/event-branches-map.test.d.ts +0 -1
- package/dist/simulator/helpers/event-branches-map.test.js +0 -120
- package/dist/simulator/helpers/event-branches-map.test.js.map +0 -1
- package/dist/simulator/helpers/execution-history.d.ts +0 -6
- package/dist/simulator/helpers/execution-history.js +0 -22
- package/dist/simulator/helpers/execution-history.js.map +0 -1
- package/dist/simulator/helpers/script-branches-map.d.ts +0 -16
- package/dist/simulator/helpers/script-branches-map.js +0 -114
- package/dist/simulator/helpers/script-branches-map.js.map +0 -1
- package/dist/simulator/helpers/script-branches-map.test.d.ts +0 -1
- package/dist/simulator/helpers/script-branches-map.test.js +0 -120
- package/dist/simulator/helpers/script-branches-map.test.js.map +0 -1
- package/dist/simulator/script-test-simulator.d.ts +0 -42
- package/dist/simulator/script-test-simulator.js +0 -373
- package/dist/simulator/script-test-simulator.js.map +0 -1
- package/dist/simulator/script-test-simulator.test.d.ts +0 -1
- package/dist/simulator/script-test-simulator.test.js +0 -2013
- package/dist/simulator/script-test-simulator.test.js.map +0 -1
- package/dist/structured-text/index.d.ts +0 -9
- package/dist/structured-text/index.js +0 -8
- package/dist/structured-text/index.js.map +0 -1
- package/dist/structured-text/rich-text-separator.d.ts +0 -48
- package/dist/structured-text/rich-text-separator.js +0 -146
- package/dist/structured-text/rich-text-separator.js.map +0 -1
- package/dist/structured-text/rich-text-separator.test.d.ts +0 -1
- package/dist/structured-text/rich-text-separator.test.js +0 -166
- package/dist/structured-text/rich-text-separator.test.js.map +0 -1
- package/dist/structured-text/rich-text-validator.d.ts +0 -19
- package/dist/structured-text/rich-text-validator.js +0 -73
- package/dist/structured-text/rich-text-validator.js.map +0 -1
- package/dist/structured-text/rich-text-validator.test.d.ts +0 -1
- package/dist/structured-text/rich-text-validator.test.js +0 -59
- package/dist/structured-text/rich-text-validator.test.js.map +0 -1
- package/dist/test.spec.js.map +0 -1
- package/dist/test.test.d.ts +0 -1
- package/dist/test.test.js +0 -9
- package/dist/test.test.js.map +0 -1
- package/tsconfig.json +0 -24
- package/vitest.config.ts +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const vitest_1 = require("vitest");
|
|
4
|
-
const rich_text_validator_1 = require("./rich-text-validator");
|
|
5
|
-
(0, vitest_1.describe)('RichTextValidator', () => {
|
|
6
|
-
(0, vitest_1.describe)('validate method', () => {
|
|
7
|
-
(0, vitest_1.test)('should not throw error for valid tag structure', () => {
|
|
8
|
-
let validInputs = [
|
|
9
|
-
'Simple text without any tags',
|
|
10
|
-
'<b>Bold text</b>',
|
|
11
|
-
'some text <b>with tags</b>',
|
|
12
|
-
'<h1>Header</h1> with <p>paragraph</p>',
|
|
13
|
-
'<outer>with <inner>nested</inner> content</outer>',
|
|
14
|
-
'some text <b>with tags</b> with <b>multiple<i>nested<n>tags</n></i></b>',
|
|
15
|
-
'' // empty string is valid
|
|
16
|
-
];
|
|
17
|
-
validInputs.forEach(input => {
|
|
18
|
-
(0, vitest_1.expect)(() => rich_text_validator_1.RichTextValidator.validate(input)).not.toThrow();
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
(0, vitest_1.test)('should throw errors with specific messages for invalid tag structures', () => {
|
|
22
|
-
// Unclosed tag
|
|
23
|
-
(0, vitest_1.expect)(() => rich_text_validator_1.RichTextValidator.validate('<div>unclosed tag')).toThrow('Unclosed tag: div');
|
|
24
|
-
// Tag with no closing bracket
|
|
25
|
-
(0, vitest_1.expect)(() => rich_text_validator_1.RichTextValidator.validate('<div unclosed')).toThrow(`Malformed tag at position 0: missing closing bracket '>'`);
|
|
26
|
-
// Mismatched tags
|
|
27
|
-
(0, vitest_1.expect)(() => rich_text_validator_1.RichTextValidator.validate('<div>text</span>')).toThrow(`Mismatched tags: expected closing tag for 'div', but found 'span' at position 9`);
|
|
28
|
-
// Improperly nested tags
|
|
29
|
-
(0, vitest_1.expect)(() => rich_text_validator_1.RichTextValidator.validate('<a><b></a></b>')).toThrow(`Mismatched tags: expected closing tag for 'b', but found 'a' at position 6`);
|
|
30
|
-
// Empty tag
|
|
31
|
-
(0, vitest_1.expect)(() => rich_text_validator_1.RichTextValidator.validate('<>')).toThrow(`Empty tag name found at position 0`);
|
|
32
|
-
// Invalid tag name with whitespace
|
|
33
|
-
(0, vitest_1.expect)(() => rich_text_validator_1.RichTextValidator.validate('< invalid>')).toThrow(`Invalid tag name ' invalid' at position 0: contains whitespace`);
|
|
34
|
-
// Closing tag without opening tag
|
|
35
|
-
(0, vitest_1.expect)(() => rich_text_validator_1.RichTextValidator.validate('</p>text')).toThrow(`Closing tag 'p' at position 0 has no matching opening tag`);
|
|
36
|
-
});
|
|
37
|
-
(0, vitest_1.test)('should validate tags against provided allowed tags set', () => {
|
|
38
|
-
let allowedTags = new Set(['b', 'i', 'p']);
|
|
39
|
-
// Valid input with allowed tags
|
|
40
|
-
(0, vitest_1.expect)(() => rich_text_validator_1.RichTextValidator.validate('<b>Bold</b> and <i>italic</i>', allowedTags)).not.toThrow();
|
|
41
|
-
// Invalid input with disallowed tag
|
|
42
|
-
(0, vitest_1.expect)(() => rich_text_validator_1.RichTextValidator.validate('<div>Not allowed</div>', allowedTags)).toThrow(`Unknown tag 'div' at position 0. Only these tags are allowed: b, i, p`);
|
|
43
|
-
// Mixed valid and invalid tags
|
|
44
|
-
(0, vitest_1.expect)(() => rich_text_validator_1.RichTextValidator.validate('<p>Paragraph</p> with <h1>header</h1>', allowedTags)).toThrow(`Unknown tag 'h1' at position 22. Only these tags are allowed: b, i, p`);
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
(0, vitest_1.describe)('isValid method', () => {
|
|
48
|
-
(0, vitest_1.test)('should return boolean value instead of throwing errors', () => {
|
|
49
|
-
(0, vitest_1.expect)(rich_text_validator_1.RichTextValidator.isValid('<b>valid</b>')).toBe(true);
|
|
50
|
-
(0, vitest_1.expect)(rich_text_validator_1.RichTextValidator.isValid('<div>invalid')).toBe(false);
|
|
51
|
-
});
|
|
52
|
-
(0, vitest_1.test)('should validate against allowed tags set and return boolean', () => {
|
|
53
|
-
let allowedTags = new Set(['b', 'i']);
|
|
54
|
-
(0, vitest_1.expect)(rich_text_validator_1.RichTextValidator.isValid('<b>valid</b>', allowedTags)).toBe(true);
|
|
55
|
-
(0, vitest_1.expect)(rich_text_validator_1.RichTextValidator.isValid('<span>invalid</span>', allowedTags)).toBe(false);
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
//# sourceMappingURL=rich-text-validator.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rich-text-validator.test.js","sourceRoot":"","sources":["../../src/structured-text/rich-text-validator.test.ts"],"names":[],"mappings":";;AAAA,mCAAgD;AAEhD,+DAA0D;AAE1D,IAAA,iBAAQ,EAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,IAAA,iBAAQ,EAAC,iBAAiB,EAAE,GAAG,EAAE;QAC/B,IAAA,aAAI,EAAC,gDAAgD,EAAE,GAAG,EAAE;YAC1D,IAAI,WAAW,GAAG;gBAChB,8BAA8B;gBAC9B,kBAAkB;gBAClB,4BAA4B;gBAC5B,uCAAuC;gBAC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,EAAE,GAAG,CAAC,CAAC,CAAC;YAEtC,IAAA,eAAM,EAAC,uCAAiB,CAAC,OAAO,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC1E,IAAA,eAAM,EAAC,uCAAiB,CAAC,OAAO,CAAC,sBAAsB,EAAE,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrF,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/test.spec.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test.spec.js","sourceRoot":"","sources":["../src/test.spec.ts"],"names":[],"mappings":";AAAA,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,EAAE,CAAC,gBAAgB,EAAE,GAAG,EAAE;QACxB,MAAM,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;IAC5B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/test.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/test.test.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const vitest_1 = require("vitest");
|
|
4
|
-
(0, vitest_1.describe)('Test Sample', () => {
|
|
5
|
-
(0, vitest_1.test)('should success', () => {
|
|
6
|
-
(0, vitest_1.expect)(true).toBeTruthy();
|
|
7
|
-
});
|
|
8
|
-
});
|
|
9
|
-
//# sourceMappingURL=test.test.js.map
|
package/dist/test.test.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test.test.js","sourceRoot":"","sources":["../src/test.test.ts"],"names":[],"mappings":";;AAAA,mCAAgD;AAEhD,IAAA,iBAAQ,EAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,IAAA,aAAI,EAAC,gBAAgB,EAAE,GAAG,EAAE;QAC1B,IAAA,eAAM,EAAC,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;IAC5B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/tsconfig.json
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"include": ["src"],
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"target": "ESNext",
|
|
5
|
-
"module": "commonjs",
|
|
6
|
-
"allowJs": true,
|
|
7
|
-
"skipLibCheck": true,
|
|
8
|
-
"esModuleInterop": true,
|
|
9
|
-
"noImplicitAny": true,
|
|
10
|
-
"noImplicitThis": true,
|
|
11
|
-
"strict": true,
|
|
12
|
-
"sourceMap": true,
|
|
13
|
-
"baseUrl": ".",
|
|
14
|
-
"outDir": "dist",
|
|
15
|
-
"moduleResolution": "node",
|
|
16
|
-
"resolveJsonModule": true,
|
|
17
|
-
"strictFunctionTypes": false,
|
|
18
|
-
"allowSyntheticDefaultImports": true,
|
|
19
|
-
"experimentalDecorators": true,
|
|
20
|
-
"declaration": true,
|
|
21
|
-
"emitDecoratorMetadata": true,
|
|
22
|
-
"useDefineForClassFields": false
|
|
23
|
-
}
|
|
24
|
-
}
|
package/vitest.config.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default {};
|