@chanl/scenarios-core 0.4.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/LICENSE +21 -0
- package/dist/__tests__/e2e/test-helpers.d.ts +79 -0
- package/dist/__tests__/e2e/test-helpers.d.ts.map +1 -0
- package/dist/__tests__/e2e/test-helpers.js +162 -0
- package/dist/__tests__/e2e/test-helpers.js.map +1 -0
- package/dist/adapters/adapter-registry.d.ts +14 -0
- package/dist/adapters/adapter-registry.d.ts.map +1 -0
- package/dist/adapters/adapter-registry.js +53 -0
- package/dist/adapters/adapter-registry.js.map +1 -0
- package/dist/adapters/agent-adapter.interface.d.ts +70 -0
- package/dist/adapters/agent-adapter.interface.d.ts.map +1 -0
- package/dist/adapters/agent-adapter.interface.js +3 -0
- package/dist/adapters/agent-adapter.interface.js.map +1 -0
- package/dist/adapters/anthropic.adapter.d.ts +17 -0
- package/dist/adapters/anthropic.adapter.d.ts.map +1 -0
- package/dist/adapters/anthropic.adapter.js +145 -0
- package/dist/adapters/anthropic.adapter.js.map +1 -0
- package/dist/adapters/http.adapter.d.ts +17 -0
- package/dist/adapters/http.adapter.d.ts.map +1 -0
- package/dist/adapters/http.adapter.js +95 -0
- package/dist/adapters/http.adapter.js.map +1 -0
- package/dist/adapters/index.d.ts +6 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +22 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/openai.adapter.d.ts +17 -0
- package/dist/adapters/openai.adapter.d.ts.map +1 -0
- package/dist/adapters/openai.adapter.js +133 -0
- package/dist/adapters/openai.adapter.js.map +1 -0
- package/dist/dataset/convert.d.ts +28 -0
- package/dist/dataset/convert.d.ts.map +1 -0
- package/dist/dataset/convert.js +94 -0
- package/dist/dataset/convert.js.map +1 -0
- package/dist/dataset/formats/dpo.d.ts +41 -0
- package/dist/dataset/formats/dpo.d.ts.map +1 -0
- package/dist/dataset/formats/dpo.js +79 -0
- package/dist/dataset/formats/dpo.js.map +1 -0
- package/dist/dataset/formats/index.d.ts +4 -0
- package/dist/dataset/formats/index.d.ts.map +1 -0
- package/dist/dataset/formats/index.js +13 -0
- package/dist/dataset/formats/index.js.map +1 -0
- package/dist/dataset/formats/openai.d.ts +29 -0
- package/dist/dataset/formats/openai.d.ts.map +1 -0
- package/dist/dataset/formats/openai.js +98 -0
- package/dist/dataset/formats/openai.js.map +1 -0
- package/dist/dataset/formats/sharegpt.d.ts +31 -0
- package/dist/dataset/formats/sharegpt.d.ts.map +1 -0
- package/dist/dataset/formats/sharegpt.js +76 -0
- package/dist/dataset/formats/sharegpt.js.map +1 -0
- package/dist/dataset/index.d.ts +4 -0
- package/dist/dataset/index.d.ts.map +1 -0
- package/dist/dataset/index.js +20 -0
- package/dist/dataset/index.js.map +1 -0
- package/dist/dataset/types.d.ts +108 -0
- package/dist/dataset/types.d.ts.map +1 -0
- package/dist/dataset/types.js +7 -0
- package/dist/dataset/types.js.map +1 -0
- package/dist/execution/agent-config-resolver.d.ts +44 -0
- package/dist/execution/agent-config-resolver.d.ts.map +1 -0
- package/dist/execution/agent-config-resolver.js +76 -0
- package/dist/execution/agent-config-resolver.js.map +1 -0
- package/dist/execution/execution-processor.d.ts +75 -0
- package/dist/execution/execution-processor.d.ts.map +1 -0
- package/dist/execution/execution-processor.js +569 -0
- package/dist/execution/execution-processor.js.map +1 -0
- package/dist/execution/execution.module.d.ts +3 -0
- package/dist/execution/execution.module.d.ts.map +1 -0
- package/dist/execution/execution.module.js +56 -0
- package/dist/execution/execution.module.js.map +1 -0
- package/dist/execution/execution.service.d.ts +52 -0
- package/dist/execution/execution.service.d.ts.map +1 -0
- package/dist/execution/execution.service.js +182 -0
- package/dist/execution/execution.service.js.map +1 -0
- package/dist/execution/index.d.ts +11 -0
- package/dist/execution/index.d.ts.map +1 -0
- package/dist/execution/index.js +30 -0
- package/dist/execution/index.js.map +1 -0
- package/dist/execution/interfaces/job-data.interface.d.ts +38 -0
- package/dist/execution/interfaces/job-data.interface.d.ts.map +1 -0
- package/dist/execution/interfaces/job-data.interface.js +3 -0
- package/dist/execution/interfaces/job-data.interface.js.map +1 -0
- package/dist/execution/judge-llm.d.ts +35 -0
- package/dist/execution/judge-llm.d.ts.map +1 -0
- package/dist/execution/judge-llm.js +129 -0
- package/dist/execution/judge-llm.js.map +1 -0
- package/dist/execution/llm-config-resolver.d.ts +26 -0
- package/dist/execution/llm-config-resolver.d.ts.map +1 -0
- package/dist/execution/llm-config-resolver.js +99 -0
- package/dist/execution/llm-config-resolver.js.map +1 -0
- package/dist/execution/persona-llm.d.ts +29 -0
- package/dist/execution/persona-llm.d.ts.map +1 -0
- package/dist/execution/persona-llm.js +98 -0
- package/dist/execution/persona-llm.js.map +1 -0
- package/dist/execution/persona-strategy-registry.d.ts +14 -0
- package/dist/execution/persona-strategy-registry.d.ts.map +1 -0
- package/dist/execution/persona-strategy-registry.js +51 -0
- package/dist/execution/persona-strategy-registry.js.map +1 -0
- package/dist/execution/persona-strategy.interface.d.ts +88 -0
- package/dist/execution/persona-strategy.interface.d.ts.map +1 -0
- package/dist/execution/persona-strategy.interface.js +3 -0
- package/dist/execution/persona-strategy.interface.js.map +1 -0
- package/dist/execution/queue-producer.service.d.ts +21 -0
- package/dist/execution/queue-producer.service.d.ts.map +1 -0
- package/dist/execution/queue-producer.service.js +60 -0
- package/dist/execution/queue-producer.service.js.map +1 -0
- package/dist/execution/queues.config.d.ts +39 -0
- package/dist/execution/queues.config.d.ts.map +1 -0
- package/dist/execution/queues.config.js +43 -0
- package/dist/execution/queues.config.js.map +1 -0
- package/dist/execution/strategies/default.strategy.d.ts +11 -0
- package/dist/execution/strategies/default.strategy.d.ts.map +1 -0
- package/dist/execution/strategies/default.strategy.js +31 -0
- package/dist/execution/strategies/default.strategy.js.map +1 -0
- package/dist/execution/strategies/reactive.strategy.d.ts +28 -0
- package/dist/execution/strategies/reactive.strategy.d.ts.map +1 -0
- package/dist/execution/strategies/reactive.strategy.js +220 -0
- package/dist/execution/strategies/reactive.strategy.js.map +1 -0
- package/dist/execution/template-renderer.d.ts +52 -0
- package/dist/execution/template-renderer.d.ts.map +1 -0
- package/dist/execution/template-renderer.js +90 -0
- package/dist/execution/template-renderer.js.map +1 -0
- package/dist/generation/index.d.ts +2 -0
- package/dist/generation/index.d.ts.map +1 -0
- package/dist/generation/index.js +6 -0
- package/dist/generation/index.js.map +1 -0
- package/dist/generation/scenario-generator.service.d.ts +77 -0
- package/dist/generation/scenario-generator.service.d.ts.map +1 -0
- package/dist/generation/scenario-generator.service.js +272 -0
- package/dist/generation/scenario-generator.service.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/personas/dto/create-persona.dto.d.ts +61 -0
- package/dist/personas/dto/create-persona.dto.d.ts.map +1 -0
- package/dist/personas/dto/create-persona.dto.js +146 -0
- package/dist/personas/dto/create-persona.dto.js.map +1 -0
- package/dist/personas/dto/index.d.ts +3 -0
- package/dist/personas/dto/index.d.ts.map +1 -0
- package/dist/personas/dto/index.js +19 -0
- package/dist/personas/dto/index.js.map +1 -0
- package/dist/personas/dto/update-persona.dto.d.ts +8 -0
- package/dist/personas/dto/update-persona.dto.d.ts.map +1 -0
- package/dist/personas/dto/update-persona.dto.js +29 -0
- package/dist/personas/dto/update-persona.dto.js.map +1 -0
- package/dist/personas/index.d.ts +6 -0
- package/dist/personas/index.d.ts.map +1 -0
- package/dist/personas/index.js +22 -0
- package/dist/personas/index.js.map +1 -0
- package/dist/personas/persona.controller.d.ts +69 -0
- package/dist/personas/persona.controller.d.ts.map +1 -0
- package/dist/personas/persona.controller.js +282 -0
- package/dist/personas/persona.controller.js.map +1 -0
- package/dist/personas/persona.module.d.ts +3 -0
- package/dist/personas/persona.module.d.ts.map +1 -0
- package/dist/personas/persona.module.js +28 -0
- package/dist/personas/persona.module.js.map +1 -0
- package/dist/personas/persona.service.d.ts +85 -0
- package/dist/personas/persona.service.d.ts.map +1 -0
- package/dist/personas/persona.service.js +382 -0
- package/dist/personas/persona.service.js.map +1 -0
- package/dist/personas/schemas/persona.schema.d.ts +90 -0
- package/dist/personas/schemas/persona.schema.d.ts.map +1 -0
- package/dist/personas/schemas/persona.schema.js +321 -0
- package/dist/personas/schemas/persona.schema.js.map +1 -0
- package/dist/scenarios/controllers/scenario-execution.controller.d.ts +48 -0
- package/dist/scenarios/controllers/scenario-execution.controller.d.ts.map +1 -0
- package/dist/scenarios/controllers/scenario-execution.controller.js +260 -0
- package/dist/scenarios/controllers/scenario-execution.controller.js.map +1 -0
- package/dist/scenarios/controllers/scenario.controller.d.ts +81 -0
- package/dist/scenarios/controllers/scenario.controller.d.ts.map +1 -0
- package/dist/scenarios/controllers/scenario.controller.js +345 -0
- package/dist/scenarios/controllers/scenario.controller.js.map +1 -0
- package/dist/scenarios/dto/create-scenario.dto.d.ts +31 -0
- package/dist/scenarios/dto/create-scenario.dto.d.ts.map +1 -0
- package/dist/scenarios/dto/create-scenario.dto.js +102 -0
- package/dist/scenarios/dto/create-scenario.dto.js.map +1 -0
- package/dist/scenarios/dto/execute-scenario.dto.d.ts +34 -0
- package/dist/scenarios/dto/execute-scenario.dto.d.ts.map +1 -0
- package/dist/scenarios/dto/execute-scenario.dto.js +150 -0
- package/dist/scenarios/dto/execute-scenario.dto.js.map +1 -0
- package/dist/scenarios/dto/index.d.ts +4 -0
- package/dist/scenarios/dto/index.d.ts.map +1 -0
- package/dist/scenarios/dto/index.js +20 -0
- package/dist/scenarios/dto/index.js.map +1 -0
- package/dist/scenarios/dto/update-scenario.dto.d.ts +6 -0
- package/dist/scenarios/dto/update-scenario.dto.d.ts.map +1 -0
- package/dist/scenarios/dto/update-scenario.dto.js +9 -0
- package/dist/scenarios/dto/update-scenario.dto.js.map +1 -0
- package/dist/scenarios/index.d.ts +9 -0
- package/dist/scenarios/index.d.ts.map +1 -0
- package/dist/scenarios/index.js +25 -0
- package/dist/scenarios/index.js.map +1 -0
- package/dist/scenarios/scenario.module.d.ts +3 -0
- package/dist/scenarios/scenario.module.d.ts.map +1 -0
- package/dist/scenarios/scenario.module.js +42 -0
- package/dist/scenarios/scenario.module.js.map +1 -0
- package/dist/scenarios/schemas/scenario-execution.schema.d.ts +133 -0
- package/dist/scenarios/schemas/scenario-execution.schema.d.ts.map +1 -0
- package/dist/scenarios/schemas/scenario-execution.schema.js +292 -0
- package/dist/scenarios/schemas/scenario-execution.schema.js.map +1 -0
- package/dist/scenarios/schemas/scenario.schema.d.ts +106 -0
- package/dist/scenarios/schemas/scenario.schema.d.ts.map +1 -0
- package/dist/scenarios/schemas/scenario.schema.js +205 -0
- package/dist/scenarios/schemas/scenario.schema.js.map +1 -0
- package/dist/scenarios/services/scenario-execution.service.d.ts +73 -0
- package/dist/scenarios/services/scenario-execution.service.d.ts.map +1 -0
- package/dist/scenarios/services/scenario-execution.service.js +505 -0
- package/dist/scenarios/services/scenario-execution.service.js.map +1 -0
- package/dist/scenarios/services/scenario.service.d.ts +110 -0
- package/dist/scenarios/services/scenario.service.d.ts.map +1 -0
- package/dist/scenarios/services/scenario.service.js +608 -0
- package/dist/scenarios/services/scenario.service.js.map +1 -0
- package/dist/simulator/index.d.ts +2 -0
- package/dist/simulator/index.d.ts.map +1 -0
- package/dist/simulator/index.js +18 -0
- package/dist/simulator/index.js.map +1 -0
- package/dist/simulator/persona-simulator.service.d.ts +81 -0
- package/dist/simulator/persona-simulator.service.d.ts.map +1 -0
- package/dist/simulator/persona-simulator.service.js +358 -0
- package/dist/simulator/persona-simulator.service.js.map +1 -0
- package/dist/templates/dto/create-template.dto.d.ts +16 -0
- package/dist/templates/dto/create-template.dto.d.ts.map +1 -0
- package/dist/templates/dto/create-template.dto.js +75 -0
- package/dist/templates/dto/create-template.dto.js.map +1 -0
- package/dist/templates/dto/index.d.ts +4 -0
- package/dist/templates/dto/index.d.ts.map +1 -0
- package/dist/templates/dto/index.js +10 -0
- package/dist/templates/dto/index.js.map +1 -0
- package/dist/templates/dto/instantiate-template.dto.d.ts +7 -0
- package/dist/templates/dto/instantiate-template.dto.d.ts.map +1 -0
- package/dist/templates/dto/instantiate-template.dto.js +38 -0
- package/dist/templates/dto/instantiate-template.dto.js.map +1 -0
- package/dist/templates/dto/update-template.dto.d.ts +6 -0
- package/dist/templates/dto/update-template.dto.d.ts.map +1 -0
- package/dist/templates/dto/update-template.dto.js +9 -0
- package/dist/templates/dto/update-template.dto.js.map +1 -0
- package/dist/templates/index.d.ts +6 -0
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/templates/index.js +22 -0
- package/dist/templates/index.js.map +1 -0
- package/dist/templates/scenario-template.controller.d.ts +42 -0
- package/dist/templates/scenario-template.controller.d.ts.map +1 -0
- package/dist/templates/scenario-template.controller.js +148 -0
- package/dist/templates/scenario-template.controller.js.map +1 -0
- package/dist/templates/scenario-template.module.d.ts +3 -0
- package/dist/templates/scenario-template.module.d.ts.map +1 -0
- package/dist/templates/scenario-template.module.js +30 -0
- package/dist/templates/scenario-template.module.js.map +1 -0
- package/dist/templates/scenario-template.service.d.ts +50 -0
- package/dist/templates/scenario-template.service.d.ts.map +1 -0
- package/dist/templates/scenario-template.service.js +497 -0
- package/dist/templates/scenario-template.service.js.map +1 -0
- package/dist/templates/schemas/scenario-template.schema.d.ts +59 -0
- package/dist/templates/schemas/scenario-template.schema.d.ts.map +1 -0
- package/dist/templates/schemas/scenario-template.schema.js +132 -0
- package/dist/templates/schemas/scenario-template.schema.js.map +1 -0
- package/dist/tool-fixtures/dto/create-tool-fixture.dto.d.ts +18 -0
- package/dist/tool-fixtures/dto/create-tool-fixture.dto.d.ts.map +1 -0
- package/dist/tool-fixtures/dto/create-tool-fixture.dto.js +46 -0
- package/dist/tool-fixtures/dto/create-tool-fixture.dto.js.map +1 -0
- package/dist/tool-fixtures/dto/index.d.ts +4 -0
- package/dist/tool-fixtures/dto/index.d.ts.map +1 -0
- package/dist/tool-fixtures/dto/index.js +20 -0
- package/dist/tool-fixtures/dto/index.js.map +1 -0
- package/dist/tool-fixtures/dto/tool-fixture-filter.dto.d.ts +6 -0
- package/dist/tool-fixtures/dto/tool-fixture-filter.dto.d.ts.map +1 -0
- package/dist/tool-fixtures/dto/tool-fixture-filter.dto.js +33 -0
- package/dist/tool-fixtures/dto/tool-fixture-filter.dto.js.map +1 -0
- package/dist/tool-fixtures/dto/update-tool-fixture.dto.d.ts +6 -0
- package/dist/tool-fixtures/dto/update-tool-fixture.dto.d.ts.map +1 -0
- package/dist/tool-fixtures/dto/update-tool-fixture.dto.js +9 -0
- package/dist/tool-fixtures/dto/update-tool-fixture.dto.js.map +1 -0
- package/dist/tool-fixtures/index.d.ts +7 -0
- package/dist/tool-fixtures/index.d.ts.map +1 -0
- package/dist/tool-fixtures/index.js +23 -0
- package/dist/tool-fixtures/index.js.map +1 -0
- package/dist/tool-fixtures/mock-resolver.service.d.ts +48 -0
- package/dist/tool-fixtures/mock-resolver.service.d.ts.map +1 -0
- package/dist/tool-fixtures/mock-resolver.service.js +99 -0
- package/dist/tool-fixtures/mock-resolver.service.js.map +1 -0
- package/dist/tool-fixtures/schemas/tool-fixture.schema.d.ts +35 -0
- package/dist/tool-fixtures/schemas/tool-fixture.schema.d.ts.map +1 -0
- package/dist/tool-fixtures/schemas/tool-fixture.schema.js +87 -0
- package/dist/tool-fixtures/schemas/tool-fixture.schema.js.map +1 -0
- package/dist/tool-fixtures/tool-fixture.controller.d.ts +45 -0
- package/dist/tool-fixtures/tool-fixture.controller.d.ts.map +1 -0
- package/dist/tool-fixtures/tool-fixture.controller.js +223 -0
- package/dist/tool-fixtures/tool-fixture.controller.js.map +1 -0
- package/dist/tool-fixtures/tool-fixture.module.d.ts +3 -0
- package/dist/tool-fixtures/tool-fixture.module.d.ts.map +1 -0
- package/dist/tool-fixtures/tool-fixture.module.js +31 -0
- package/dist/tool-fixtures/tool-fixture.module.js.map +1 -0
- package/dist/tool-fixtures/tool-fixture.service.d.ts +59 -0
- package/dist/tool-fixtures/tool-fixture.service.d.ts.map +1 -0
- package/dist/tool-fixtures/tool-fixture.service.js +198 -0
- package/dist/tool-fixtures/tool-fixture.service.js.map +1 -0
- package/package.json +47 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CreateTemplateDto } from './create-template.dto';
|
|
2
|
+
declare const UpdateTemplateDto_base: import("@nestjs/mapped-types").MappedType<Partial<CreateTemplateDto>>;
|
|
3
|
+
export declare class UpdateTemplateDto extends UpdateTemplateDto_base {
|
|
4
|
+
}
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=update-template.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-template.dto.d.ts","sourceRoot":"","sources":["../../../src/templates/dto/update-template.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;;AAE1D,qBAAa,iBAAkB,SAAQ,sBAA8B;CAAG"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateTemplateDto = void 0;
|
|
4
|
+
const mapped_types_1 = require("@nestjs/mapped-types");
|
|
5
|
+
const create_template_dto_1 = require("./create-template.dto");
|
|
6
|
+
class UpdateTemplateDto extends (0, mapped_types_1.PartialType)(create_template_dto_1.CreateTemplateDto) {
|
|
7
|
+
}
|
|
8
|
+
exports.UpdateTemplateDto = UpdateTemplateDto;
|
|
9
|
+
//# sourceMappingURL=update-template.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-template.dto.js","sourceRoot":"","sources":["../../../src/templates/dto/update-template.dto.ts"],"names":[],"mappings":";;;AAAA,uDAAmD;AACnD,+DAA0D;AAE1D,MAAa,iBAAkB,SAAQ,IAAA,0BAAW,EAAC,uCAAiB,CAAC;CAAG;AAAxE,8CAAwE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./schemas/scenario-template.schema"), exports);
|
|
18
|
+
__exportStar(require("./scenario-template.service"), exports);
|
|
19
|
+
__exportStar(require("./scenario-template.controller"), exports);
|
|
20
|
+
__exportStar(require("./scenario-template.module"), exports);
|
|
21
|
+
__exportStar(require("./dto"), exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qEAAmD;AACnD,8DAA4C;AAC5C,iEAA+C;AAC/C,6DAA2C;AAC3C,wCAAsB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ScenarioTemplateService } from './scenario-template.service';
|
|
2
|
+
import { CreateTemplateDto } from './dto/create-template.dto';
|
|
3
|
+
import { UpdateTemplateDto } from './dto/update-template.dto';
|
|
4
|
+
import { InstantiateTemplateDto } from './dto/instantiate-template.dto';
|
|
5
|
+
export declare class ScenarioTemplateController {
|
|
6
|
+
private readonly templateService;
|
|
7
|
+
constructor(templateService: ScenarioTemplateService);
|
|
8
|
+
create(dto: CreateTemplateDto): Promise<{
|
|
9
|
+
template: import(".").ScenarioTemplateDocument;
|
|
10
|
+
}>;
|
|
11
|
+
findAll(category?: string, status?: string, search?: string, page?: string, limit?: string): Promise<{
|
|
12
|
+
templates: import(".").ScenarioTemplateDocument[];
|
|
13
|
+
total: number;
|
|
14
|
+
}>;
|
|
15
|
+
seed(): Promise<{
|
|
16
|
+
message: string;
|
|
17
|
+
templates: import(".").ScenarioTemplateDocument[];
|
|
18
|
+
}>;
|
|
19
|
+
findOne(id: string): Promise<{
|
|
20
|
+
template: import(".").ScenarioTemplateDocument;
|
|
21
|
+
}>;
|
|
22
|
+
update(id: string, dto: UpdateTemplateDto): Promise<{
|
|
23
|
+
template: import(".").ScenarioTemplateDocument;
|
|
24
|
+
}>;
|
|
25
|
+
remove(id: string): Promise<{
|
|
26
|
+
deleted: boolean;
|
|
27
|
+
}>;
|
|
28
|
+
instantiate(id: string, dto: InstantiateTemplateDto): Promise<{
|
|
29
|
+
scenario: Record<string, any>;
|
|
30
|
+
}>;
|
|
31
|
+
validate(id: string): Promise<{
|
|
32
|
+
valid: boolean;
|
|
33
|
+
errors: string[];
|
|
34
|
+
warnings: string[];
|
|
35
|
+
}>;
|
|
36
|
+
clone(id: string, body: {
|
|
37
|
+
name?: string;
|
|
38
|
+
}): Promise<{
|
|
39
|
+
template: import(".").ScenarioTemplateDocument;
|
|
40
|
+
}>;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=scenario-template.controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenario-template.controller.d.ts","sourceRoot":"","sources":["../../src/templates/scenario-template.controller.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAExE,qBACa,0BAA0B;IAEnC,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAAf,eAAe,EAAE,uBAAuB;IAKrD,MAAM,CAAS,GAAG,EAAE,iBAAiB;;;IAMrC,OAAO,CACQ,QAAQ,CAAC,EAAE,MAAM,EACnB,MAAM,CAAC,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,EACjB,IAAI,CAAC,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,MAAM;;;;IAiB1B,IAAI;;;;IASJ,OAAO,CAAc,EAAE,EAAE,MAAM;;;IAM/B,MAAM,CACG,EAAE,EAAE,MAAM,EACf,GAAG,EAAE,iBAAiB;;;IAO1B,MAAM,CAAc,EAAE,EAAE,MAAM;;;IAM9B,WAAW,CACF,EAAE,EAAE,MAAM,EACf,GAAG,EAAE,sBAAsB;;;IAO/B,QAAQ,CAAc,EAAE,EAAE,MAAM;;;;;IAOhC,KAAK,CACI,EAAE,EAAE,MAAM,EACf,IAAI,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE;;;CAKlC"}
|
|
@@ -0,0 +1,148 @@
|
|
|
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 __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.ScenarioTemplateController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const scenario_template_service_1 = require("./scenario-template.service");
|
|
18
|
+
const create_template_dto_1 = require("./dto/create-template.dto");
|
|
19
|
+
const update_template_dto_1 = require("./dto/update-template.dto");
|
|
20
|
+
const instantiate_template_dto_1 = require("./dto/instantiate-template.dto");
|
|
21
|
+
let ScenarioTemplateController = class ScenarioTemplateController {
|
|
22
|
+
constructor(templateService) {
|
|
23
|
+
this.templateService = templateService;
|
|
24
|
+
}
|
|
25
|
+
async create(dto) {
|
|
26
|
+
const template = await this.templateService.create(dto);
|
|
27
|
+
return { template };
|
|
28
|
+
}
|
|
29
|
+
async findAll(category, status, search, page, limit) {
|
|
30
|
+
const result = await this.templateService.findAll({ category, status, search }, {
|
|
31
|
+
page: page ? parseInt(page, 10) : undefined,
|
|
32
|
+
limit: limit ? parseInt(limit, 10) : undefined,
|
|
33
|
+
});
|
|
34
|
+
return {
|
|
35
|
+
templates: result.templates,
|
|
36
|
+
total: result.total,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
async seed() {
|
|
40
|
+
const created = await this.templateService.seedBuiltInTemplates();
|
|
41
|
+
return {
|
|
42
|
+
message: `Seeded ${created.length} templates`,
|
|
43
|
+
templates: created,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
async findOne(id) {
|
|
47
|
+
const template = await this.templateService.findOne(id);
|
|
48
|
+
return { template };
|
|
49
|
+
}
|
|
50
|
+
async update(id, dto) {
|
|
51
|
+
const template = await this.templateService.update(id, dto);
|
|
52
|
+
return { template };
|
|
53
|
+
}
|
|
54
|
+
async remove(id) {
|
|
55
|
+
await this.templateService.remove(id);
|
|
56
|
+
return { deleted: true };
|
|
57
|
+
}
|
|
58
|
+
async instantiate(id, dto) {
|
|
59
|
+
const scenarioData = await this.templateService.instantiate(id, dto);
|
|
60
|
+
return { scenario: scenarioData };
|
|
61
|
+
}
|
|
62
|
+
async validate(id) {
|
|
63
|
+
const template = await this.templateService.findOne(id);
|
|
64
|
+
const result = this.templateService.validate(template);
|
|
65
|
+
return result;
|
|
66
|
+
}
|
|
67
|
+
async clone(id, body) {
|
|
68
|
+
const template = await this.templateService.clone(id, body.name);
|
|
69
|
+
return { template };
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
exports.ScenarioTemplateController = ScenarioTemplateController;
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, common_1.Post)(),
|
|
75
|
+
(0, common_1.HttpCode)(common_1.HttpStatus.CREATED),
|
|
76
|
+
__param(0, (0, common_1.Body)()),
|
|
77
|
+
__metadata("design:type", Function),
|
|
78
|
+
__metadata("design:paramtypes", [create_template_dto_1.CreateTemplateDto]),
|
|
79
|
+
__metadata("design:returntype", Promise)
|
|
80
|
+
], ScenarioTemplateController.prototype, "create", null);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, common_1.Get)(),
|
|
83
|
+
__param(0, (0, common_1.Query)('category')),
|
|
84
|
+
__param(1, (0, common_1.Query)('status')),
|
|
85
|
+
__param(2, (0, common_1.Query)('search')),
|
|
86
|
+
__param(3, (0, common_1.Query)('page')),
|
|
87
|
+
__param(4, (0, common_1.Query)('limit')),
|
|
88
|
+
__metadata("design:type", Function),
|
|
89
|
+
__metadata("design:paramtypes", [String, String, String, String, String]),
|
|
90
|
+
__metadata("design:returntype", Promise)
|
|
91
|
+
], ScenarioTemplateController.prototype, "findAll", null);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, common_1.Post)('seed'),
|
|
94
|
+
(0, common_1.HttpCode)(common_1.HttpStatus.CREATED),
|
|
95
|
+
__metadata("design:type", Function),
|
|
96
|
+
__metadata("design:paramtypes", []),
|
|
97
|
+
__metadata("design:returntype", Promise)
|
|
98
|
+
], ScenarioTemplateController.prototype, "seed", null);
|
|
99
|
+
__decorate([
|
|
100
|
+
(0, common_1.Get)(':id'),
|
|
101
|
+
__param(0, (0, common_1.Param)('id')),
|
|
102
|
+
__metadata("design:type", Function),
|
|
103
|
+
__metadata("design:paramtypes", [String]),
|
|
104
|
+
__metadata("design:returntype", Promise)
|
|
105
|
+
], ScenarioTemplateController.prototype, "findOne", null);
|
|
106
|
+
__decorate([
|
|
107
|
+
(0, common_1.Put)(':id'),
|
|
108
|
+
__param(0, (0, common_1.Param)('id')),
|
|
109
|
+
__param(1, (0, common_1.Body)()),
|
|
110
|
+
__metadata("design:type", Function),
|
|
111
|
+
__metadata("design:paramtypes", [String, update_template_dto_1.UpdateTemplateDto]),
|
|
112
|
+
__metadata("design:returntype", Promise)
|
|
113
|
+
], ScenarioTemplateController.prototype, "update", null);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, common_1.Delete)(':id'),
|
|
116
|
+
__param(0, (0, common_1.Param)('id')),
|
|
117
|
+
__metadata("design:type", Function),
|
|
118
|
+
__metadata("design:paramtypes", [String]),
|
|
119
|
+
__metadata("design:returntype", Promise)
|
|
120
|
+
], ScenarioTemplateController.prototype, "remove", null);
|
|
121
|
+
__decorate([
|
|
122
|
+
(0, common_1.Post)(':id/instantiate'),
|
|
123
|
+
__param(0, (0, common_1.Param)('id')),
|
|
124
|
+
__param(1, (0, common_1.Body)()),
|
|
125
|
+
__metadata("design:type", Function),
|
|
126
|
+
__metadata("design:paramtypes", [String, instantiate_template_dto_1.InstantiateTemplateDto]),
|
|
127
|
+
__metadata("design:returntype", Promise)
|
|
128
|
+
], ScenarioTemplateController.prototype, "instantiate", null);
|
|
129
|
+
__decorate([
|
|
130
|
+
(0, common_1.Post)(':id/validate'),
|
|
131
|
+
__param(0, (0, common_1.Param)('id')),
|
|
132
|
+
__metadata("design:type", Function),
|
|
133
|
+
__metadata("design:paramtypes", [String]),
|
|
134
|
+
__metadata("design:returntype", Promise)
|
|
135
|
+
], ScenarioTemplateController.prototype, "validate", null);
|
|
136
|
+
__decorate([
|
|
137
|
+
(0, common_1.Post)(':id/clone'),
|
|
138
|
+
__param(0, (0, common_1.Param)('id')),
|
|
139
|
+
__param(1, (0, common_1.Body)()),
|
|
140
|
+
__metadata("design:type", Function),
|
|
141
|
+
__metadata("design:paramtypes", [String, Object]),
|
|
142
|
+
__metadata("design:returntype", Promise)
|
|
143
|
+
], ScenarioTemplateController.prototype, "clone", null);
|
|
144
|
+
exports.ScenarioTemplateController = ScenarioTemplateController = __decorate([
|
|
145
|
+
(0, common_1.Controller)('templates'),
|
|
146
|
+
__metadata("design:paramtypes", [scenario_template_service_1.ScenarioTemplateService])
|
|
147
|
+
], ScenarioTemplateController);
|
|
148
|
+
//# sourceMappingURL=scenario-template.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenario-template.controller.js","sourceRoot":"","sources":["../../src/templates/scenario-template.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAWwB;AACxB,2EAAsE;AACtE,mEAA8D;AAC9D,mEAA8D;AAC9D,6EAAwE;AAGjE,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IACrC,YACmB,eAAwC;QAAxC,oBAAe,GAAf,eAAe,CAAyB;IACxD,CAAC;IAIE,AAAN,KAAK,CAAC,MAAM,CAAS,GAAsB;QACzC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,MA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AAC,OAAO,CAAC,CAAA;;;;yDAahB;AAIK;IAFL,IAAA,aAAI,EAAC,MAAM,CAAC;IACZ,IAAA,iBAAQ,EAAC,mBAAU,CAAC,OAAO,CAAC;;;;sDAO5B;AAGK;IADL,IAAA,YAAG,EAAC,KAAK,CAAC;IACI,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;yDAGzB;AAGK;IADL,IAAA,YAAG,EAAC,KAAK,CAAC;IAER,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IACX,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAM,uCAAiB;;wDAI/B;AAGK;IADL,IAAA,eAAM,EAAC,KAAK,CAAC;IACA,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;wDAGxB;AAGK;IADL,IAAA,aAAI,EAAC,iBAAiB,CAAC;IAErB,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IACX,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAM,iDAAsB;;6DAIpC;AAGK;IADL,IAAA,aAAI,EAAC,cAAc,CAAC;IACL,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;0DAI1B;AAGK;IADL,IAAA,aAAI,EAAC,WAAW,CAAC;IAEf,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IACX,WAAA,IAAA,aAAI,GAAE,CAAA;;;;uDAIR;qCAvFU,0BAA0B;IADtC,IAAA,mBAAU,EAAC,WAAW,CAAC;qCAGc,mDAAuB;GAFhD,0BAA0B,CAwFtC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenario-template.module.d.ts","sourceRoot":"","sources":["../../src/templates/scenario-template.module.ts"],"names":[],"mappings":"AASA,qBAUa,sBAAsB;CAAG"}
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.ScenarioTemplateModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
12
|
+
const scenario_template_controller_1 = require("./scenario-template.controller");
|
|
13
|
+
const scenario_template_service_1 = require("./scenario-template.service");
|
|
14
|
+
const scenario_template_schema_1 = require("./schemas/scenario-template.schema");
|
|
15
|
+
let ScenarioTemplateModule = class ScenarioTemplateModule {
|
|
16
|
+
};
|
|
17
|
+
exports.ScenarioTemplateModule = ScenarioTemplateModule;
|
|
18
|
+
exports.ScenarioTemplateModule = ScenarioTemplateModule = __decorate([
|
|
19
|
+
(0, common_1.Module)({
|
|
20
|
+
imports: [
|
|
21
|
+
mongoose_1.MongooseModule.forFeature([
|
|
22
|
+
{ name: scenario_template_schema_1.ScenarioTemplate.name, schema: scenario_template_schema_1.ScenarioTemplateSchema },
|
|
23
|
+
]),
|
|
24
|
+
],
|
|
25
|
+
controllers: [scenario_template_controller_1.ScenarioTemplateController],
|
|
26
|
+
providers: [scenario_template_service_1.ScenarioTemplateService],
|
|
27
|
+
exports: [scenario_template_service_1.ScenarioTemplateService],
|
|
28
|
+
})
|
|
29
|
+
], ScenarioTemplateModule);
|
|
30
|
+
//# sourceMappingURL=scenario-template.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenario-template.module.js","sourceRoot":"","sources":["../../src/templates/scenario-template.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,+CAAkD;AAClD,iFAA4E;AAC5E,2EAAsE;AACtE,iFAG4C;AAYrC,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;CAAG,CAAA;AAAzB,wDAAsB;iCAAtB,sBAAsB;IAVlC,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,yBAAc,CAAC,UAAU,CAAC;gBACxB,EAAE,IAAI,EAAE,2CAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,iDAAsB,EAAE;aAChE,CAAC;SACH;QACD,WAAW,EAAE,CAAC,yDAA0B,CAAC;QACzC,SAAS,EAAE,CAAC,mDAAuB,CAAC;QACpC,OAAO,EAAE,CAAC,mDAAuB,CAAC;KACnC,CAAC;GACW,sBAAsB,CAAG"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Model } from 'mongoose';
|
|
2
|
+
import { ScenarioTemplateDocument } from './schemas/scenario-template.schema';
|
|
3
|
+
import { CreateTemplateDto } from './dto/create-template.dto';
|
|
4
|
+
import { UpdateTemplateDto } from './dto/update-template.dto';
|
|
5
|
+
import { InstantiateTemplateDto } from './dto/instantiate-template.dto';
|
|
6
|
+
export interface PaginatedTemplates {
|
|
7
|
+
templates: ScenarioTemplateDocument[];
|
|
8
|
+
total: number;
|
|
9
|
+
}
|
|
10
|
+
export declare class ScenarioTemplateService {
|
|
11
|
+
private readonly templateModel;
|
|
12
|
+
private readonly logger;
|
|
13
|
+
constructor(templateModel: Model<ScenarioTemplateDocument>);
|
|
14
|
+
create(dto: CreateTemplateDto, createdBy?: string): Promise<ScenarioTemplateDocument>;
|
|
15
|
+
findAll(filters?: {
|
|
16
|
+
category?: string;
|
|
17
|
+
status?: string;
|
|
18
|
+
search?: string;
|
|
19
|
+
}, pagination?: {
|
|
20
|
+
page?: number;
|
|
21
|
+
limit?: number;
|
|
22
|
+
}): Promise<PaginatedTemplates>;
|
|
23
|
+
findOne(id: string): Promise<ScenarioTemplateDocument>;
|
|
24
|
+
update(id: string, dto: UpdateTemplateDto): Promise<ScenarioTemplateDocument>;
|
|
25
|
+
remove(id: string): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Instantiate a scenario from a template by substituting variables.
|
|
28
|
+
* Returns the scenario data ready to be created via ScenarioService.
|
|
29
|
+
*/
|
|
30
|
+
instantiate(id: string, dto: InstantiateTemplateDto): Promise<Record<string, any>>;
|
|
31
|
+
/**
|
|
32
|
+
* Validate a template's structure and variable references.
|
|
33
|
+
*/
|
|
34
|
+
validate(template: ScenarioTemplateDocument): {
|
|
35
|
+
valid: boolean;
|
|
36
|
+
errors: string[];
|
|
37
|
+
warnings: string[];
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Clone a template.
|
|
41
|
+
*/
|
|
42
|
+
clone(id: string, name?: string): Promise<ScenarioTemplateDocument>;
|
|
43
|
+
/**
|
|
44
|
+
* Seed built-in templates into the database.
|
|
45
|
+
* Returns templates created (skips duplicates by name).
|
|
46
|
+
*/
|
|
47
|
+
seedBuiltInTemplates(): Promise<ScenarioTemplateDocument[]>;
|
|
48
|
+
}
|
|
49
|
+
export declare function getBuiltInTemplates(): CreateTemplateDto[];
|
|
50
|
+
//# sourceMappingURL=scenario-template.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenario-template.service.d.ts","sourceRoot":"","sources":["../../src/templates/scenario-template.service.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAEL,wBAAwB,EAEzB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAExE,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,wBAAwB,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