@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,87 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ToolFixtureSchema = exports.ToolFixture = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
/**
|
|
15
|
+
* Local virtual ID plugin - transforms _id to id in JSON responses.
|
|
16
|
+
* Replaces the @chanl-ai/nestjs-common virtualIdPlugin for OSS usage.
|
|
17
|
+
*/
|
|
18
|
+
function virtualIdPlugin(schema) {
|
|
19
|
+
schema.set('toJSON', {
|
|
20
|
+
virtuals: true,
|
|
21
|
+
versionKey: false,
|
|
22
|
+
transform: (_doc, ret) => {
|
|
23
|
+
ret.id = ret._id?.toString();
|
|
24
|
+
delete ret._id;
|
|
25
|
+
return ret;
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
schema.set('toObject', { virtuals: true });
|
|
29
|
+
}
|
|
30
|
+
let ToolFixture = class ToolFixture {
|
|
31
|
+
};
|
|
32
|
+
exports.ToolFixture = ToolFixture;
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, mongoose_1.Prop)({ required: true, index: true }),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], ToolFixture.prototype, "name", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], ToolFixture.prototype, "description", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, mongoose_1.Prop)({ type: Object, default: { type: 'object', properties: {} } }),
|
|
43
|
+
__metadata("design:type", Object)
|
|
44
|
+
], ToolFixture.prototype, "parameters", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, mongoose_1.Prop)({ type: [Object], default: [] }),
|
|
47
|
+
__metadata("design:type", Array)
|
|
48
|
+
], ToolFixture.prototype, "mockResponses", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, mongoose_1.Prop)({ type: [String], default: [] }),
|
|
51
|
+
__metadata("design:type", Array)
|
|
52
|
+
], ToolFixture.prototype, "tags", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, mongoose_1.Prop)({ default: true, index: true }),
|
|
55
|
+
__metadata("design:type", Boolean)
|
|
56
|
+
], ToolFixture.prototype, "isActive", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, mongoose_1.Prop)({ default: 'local' }),
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], ToolFixture.prototype, "createdBy", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, mongoose_1.Prop)(),
|
|
63
|
+
__metadata("design:type", String)
|
|
64
|
+
], ToolFixture.prototype, "lastModifiedBy", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, mongoose_1.Prop)({ type: Date }),
|
|
67
|
+
__metadata("design:type", Date)
|
|
68
|
+
], ToolFixture.prototype, "createdAt", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, mongoose_1.Prop)({ type: Date }),
|
|
71
|
+
__metadata("design:type", Date)
|
|
72
|
+
], ToolFixture.prototype, "updatedAt", void 0);
|
|
73
|
+
exports.ToolFixture = ToolFixture = __decorate([
|
|
74
|
+
(0, mongoose_1.Schema)({
|
|
75
|
+
collection: 'tool_fixtures',
|
|
76
|
+
timestamps: true,
|
|
77
|
+
})
|
|
78
|
+
], ToolFixture);
|
|
79
|
+
exports.ToolFixtureSchema = mongoose_1.SchemaFactory.createForClass(ToolFixture);
|
|
80
|
+
// Add indexes for better query performance
|
|
81
|
+
exports.ToolFixtureSchema.index({ name: 1 });
|
|
82
|
+
exports.ToolFixtureSchema.index({ tags: 1 });
|
|
83
|
+
exports.ToolFixtureSchema.index({ isActive: 1 });
|
|
84
|
+
exports.ToolFixtureSchema.index({ createdBy: 1 });
|
|
85
|
+
// Apply virtual ID plugin to transform _id to id in responses
|
|
86
|
+
exports.ToolFixtureSchema.plugin(virtualIdPlugin);
|
|
87
|
+
//# sourceMappingURL=tool-fixture.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-fixture.schema.js","sourceRoot":"","sources":["../../../src/tool-fixtures/schemas/tool-fixture.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA+D;AAK/D;;;GAGG;AACH,SAAS,eAAe,CAAC,MAAW;IAClC,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE;QACnB,QAAQ,EAAE,IAAI;QACd,UAAU,EAAE,KAAK;QACjB,SAAS,EAAE,CAAC,IAAS,EAAE,GAAQ,EAAE,EAAE;YACjC,GAAG,CAAC,EAAE,GAAG,GAAG,CAAC,GAAG,EAAE,QAAQ,EAAE,CAAC;YAC7B,OAAO,GAAG,CAAC,GAAG,CAAC;YACf,OAAO,GAAG,CAAC;QACb,CAAC;KACF,CAAC,CAAC;IACH,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AA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AK,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;AACrC,yBAAiB,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;AACrC,yBAAiB,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC;AACzC,yBAAiB,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC;AAE1C,8DAA8D;AAC9D,yBAAiB,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ToolFixtureService } from './tool-fixture.service';
|
|
2
|
+
import { CreateToolFixtureDto } from './dto/create-tool-fixture.dto';
|
|
3
|
+
import { UpdateToolFixtureDto } from './dto/update-tool-fixture.dto';
|
|
4
|
+
export declare class ToolFixtureController {
|
|
5
|
+
private readonly toolFixtureService;
|
|
6
|
+
private readonly logger;
|
|
7
|
+
constructor(toolFixtureService: ToolFixtureService);
|
|
8
|
+
create(createDto: CreateToolFixtureDto): Promise<{
|
|
9
|
+
toolFixture: import(".").ToolFixture;
|
|
10
|
+
}>;
|
|
11
|
+
findAll(isActive?: string, tags?: string, search?: string, pageStr?: string, limitStr?: string, sortBy?: string, sortOrder?: 'asc' | 'desc'): Promise<{
|
|
12
|
+
toolFixtures: import(".").ToolFixture[];
|
|
13
|
+
total: number;
|
|
14
|
+
pagination: {
|
|
15
|
+
total: number;
|
|
16
|
+
page: number;
|
|
17
|
+
limit: number;
|
|
18
|
+
totalPages: number;
|
|
19
|
+
hasNextPage: boolean;
|
|
20
|
+
hasPrevPage: boolean;
|
|
21
|
+
};
|
|
22
|
+
}>;
|
|
23
|
+
getStats(): Promise<{
|
|
24
|
+
stats: {
|
|
25
|
+
total: number;
|
|
26
|
+
active: number;
|
|
27
|
+
inactive: number;
|
|
28
|
+
byTag: Array<{
|
|
29
|
+
tag: string;
|
|
30
|
+
count: number;
|
|
31
|
+
}>;
|
|
32
|
+
};
|
|
33
|
+
}>;
|
|
34
|
+
findOne(id: string): Promise<{
|
|
35
|
+
toolFixture: import(".").ToolFixture;
|
|
36
|
+
}>;
|
|
37
|
+
update(id: string, updateDto: UpdateToolFixtureDto): Promise<{
|
|
38
|
+
toolFixture: import(".").ToolFixture;
|
|
39
|
+
}>;
|
|
40
|
+
remove(id: string): Promise<{
|
|
41
|
+
deleted: boolean;
|
|
42
|
+
message: string;
|
|
43
|
+
}>;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=tool-fixture.controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-fixture.controller.d.ts","sourceRoot":"","sources":["../../src/tool-fixtures/tool-fixture.controller.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAkBrE,qBACa,qBAAqB;IAGpB,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IAF/C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0C;gBAEpC,kBAAkB,EAAE,kBAAkB;IAG7D,MAAM,CACF,SAAS,EAAE,oBAAoB;;;IAwBnC,OAAO,CACQ,QAAQ,CAAC,EAAE,MAAM,EACrB,IAAI,CAAC,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,MAAM,EACZ,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM;;;;;;;;;;;;IAqD1C,QAAQ;;;;;;;;;;;IAwBR,OAAO,CAAc,EAAE,EAAE,MAAM;;;IA2B/B,MAAM,CACG,EAAE,EAAE,MAAM,EACf,SAAS,EAAE,oBAAoB;;;IA4BnC,MAAM,CAAc,EAAE,EAAE,MAAM;;;;CA0BrC"}
|
|
@@ -0,0 +1,223 @@
|
|
|
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
|
+
var ToolFixtureController_1;
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.ToolFixtureController = void 0;
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const tool_fixture_service_1 = require("./tool-fixture.service");
|
|
19
|
+
const create_tool_fixture_dto_1 = require("./dto/create-tool-fixture.dto");
|
|
20
|
+
const update_tool_fixture_dto_1 = require("./dto/update-tool-fixture.dto");
|
|
21
|
+
/**
|
|
22
|
+
* Simple pagination response builder.
|
|
23
|
+
* Replaces the @chanl-ai/nestjs-common buildPaginationResponse for OSS usage.
|
|
24
|
+
*/
|
|
25
|
+
function buildPaginationResponse(total, page, limit) {
|
|
26
|
+
const totalPages = Math.ceil(total / limit);
|
|
27
|
+
return {
|
|
28
|
+
total,
|
|
29
|
+
page,
|
|
30
|
+
limit,
|
|
31
|
+
totalPages,
|
|
32
|
+
hasNextPage: page < totalPages,
|
|
33
|
+
hasPrevPage: page > 1,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
let ToolFixtureController = ToolFixtureController_1 = class ToolFixtureController {
|
|
37
|
+
constructor(toolFixtureService) {
|
|
38
|
+
this.toolFixtureService = toolFixtureService;
|
|
39
|
+
this.logger = new common_1.Logger(ToolFixtureController_1.name);
|
|
40
|
+
}
|
|
41
|
+
async create(createDto) {
|
|
42
|
+
try {
|
|
43
|
+
const toolFixture = await this.toolFixtureService.create(createDto);
|
|
44
|
+
return {
|
|
45
|
+
toolFixture,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
this.logger.error(`Failed to create tool fixture: ${error.message}`, error.stack);
|
|
50
|
+
throw new common_1.HttpException({
|
|
51
|
+
success: false,
|
|
52
|
+
message: error.message,
|
|
53
|
+
error: 'Tool fixture creation failed',
|
|
54
|
+
}, common_1.HttpStatus.BAD_REQUEST);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
async findAll(isActive, tags, search, pageStr, limitStr, sortBy, sortOrder) {
|
|
58
|
+
try {
|
|
59
|
+
const filters = {};
|
|
60
|
+
if (isActive !== undefined) {
|
|
61
|
+
filters.isActive = isActive === 'true';
|
|
62
|
+
}
|
|
63
|
+
if (tags) {
|
|
64
|
+
filters.tags = tags.split(',').map((tag) => tag.trim());
|
|
65
|
+
}
|
|
66
|
+
if (search) {
|
|
67
|
+
filters.search = search;
|
|
68
|
+
}
|
|
69
|
+
const page = pageStr ? parseInt(pageStr, 10) : 1;
|
|
70
|
+
const limit = limitStr ? parseInt(limitStr, 10) : 10;
|
|
71
|
+
const offset = (page - 1) * limit;
|
|
72
|
+
const pagination = {
|
|
73
|
+
page,
|
|
74
|
+
limit,
|
|
75
|
+
offset,
|
|
76
|
+
sortBy,
|
|
77
|
+
sortOrder,
|
|
78
|
+
};
|
|
79
|
+
const result = await this.toolFixtureService.findAll(filters, pagination);
|
|
80
|
+
return {
|
|
81
|
+
toolFixtures: result.toolFixtures,
|
|
82
|
+
total: result.total,
|
|
83
|
+
pagination: buildPaginationResponse(result.total, page, limit),
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
this.logger.error(`Failed to retrieve tool fixtures: ${error.message}`, error.stack);
|
|
88
|
+
throw new common_1.HttpException({
|
|
89
|
+
success: false,
|
|
90
|
+
message: error.message,
|
|
91
|
+
error: 'Failed to retrieve tool fixtures',
|
|
92
|
+
}, common_1.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
async getStats() {
|
|
96
|
+
try {
|
|
97
|
+
const stats = await this.toolFixtureService.getStats();
|
|
98
|
+
return {
|
|
99
|
+
stats,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
this.logger.error(`Failed to retrieve tool fixture stats: ${error.message}`, error.stack);
|
|
104
|
+
throw new common_1.HttpException({
|
|
105
|
+
success: false,
|
|
106
|
+
message: error.message,
|
|
107
|
+
error: 'Failed to retrieve tool fixture statistics',
|
|
108
|
+
}, common_1.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
async findOne(id) {
|
|
112
|
+
try {
|
|
113
|
+
const toolFixture = await this.toolFixtureService.findOne(id);
|
|
114
|
+
return {
|
|
115
|
+
toolFixture,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
this.logger.error(`Failed to retrieve tool fixture: ${error.message}`, error.stack);
|
|
120
|
+
const status = error.message.includes('not found')
|
|
121
|
+
? common_1.HttpStatus.NOT_FOUND
|
|
122
|
+
: common_1.HttpStatus.INTERNAL_SERVER_ERROR;
|
|
123
|
+
throw new common_1.HttpException({
|
|
124
|
+
success: false,
|
|
125
|
+
message: error.message,
|
|
126
|
+
error: 'Failed to retrieve tool fixture',
|
|
127
|
+
}, status);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
async update(id, updateDto) {
|
|
131
|
+
try {
|
|
132
|
+
const toolFixture = await this.toolFixtureService.update(id, updateDto);
|
|
133
|
+
return {
|
|
134
|
+
toolFixture,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
catch (error) {
|
|
138
|
+
this.logger.error(`Failed to update tool fixture: ${error.message}`, error.stack);
|
|
139
|
+
const status = error.message.includes('not found')
|
|
140
|
+
? common_1.HttpStatus.NOT_FOUND
|
|
141
|
+
: common_1.HttpStatus.BAD_REQUEST;
|
|
142
|
+
throw new common_1.HttpException({
|
|
143
|
+
success: false,
|
|
144
|
+
message: error.message,
|
|
145
|
+
error: 'Failed to update tool fixture',
|
|
146
|
+
}, status);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
async remove(id) {
|
|
150
|
+
try {
|
|
151
|
+
await this.toolFixtureService.remove(id);
|
|
152
|
+
return {
|
|
153
|
+
deleted: true,
|
|
154
|
+
message: 'Tool fixture deleted successfully',
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
catch (error) {
|
|
158
|
+
this.logger.error(`Failed to delete tool fixture: ${error.message}`, error.stack);
|
|
159
|
+
const status = error.message.includes('not found')
|
|
160
|
+
? common_1.HttpStatus.NOT_FOUND
|
|
161
|
+
: common_1.HttpStatus.INTERNAL_SERVER_ERROR;
|
|
162
|
+
throw new common_1.HttpException({
|
|
163
|
+
success: false,
|
|
164
|
+
message: error.message,
|
|
165
|
+
error: 'Failed to delete tool fixture',
|
|
166
|
+
}, status);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
exports.ToolFixtureController = ToolFixtureController;
|
|
171
|
+
__decorate([
|
|
172
|
+
(0, common_1.Post)(),
|
|
173
|
+
__param(0, (0, common_1.Body)()),
|
|
174
|
+
__metadata("design:type", Function),
|
|
175
|
+
__metadata("design:paramtypes", [create_tool_fixture_dto_1.CreateToolFixtureDto]),
|
|
176
|
+
__metadata("design:returntype", Promise)
|
|
177
|
+
], ToolFixtureController.prototype, "create", null);
|
|
178
|
+
__decorate([
|
|
179
|
+
(0, common_1.Get)(),
|
|
180
|
+
__param(0, (0, common_1.Query)('isActive')),
|
|
181
|
+
__param(1, (0, common_1.Query)('tags')),
|
|
182
|
+
__param(2, (0, common_1.Query)('search')),
|
|
183
|
+
__param(3, (0, common_1.Query)('page')),
|
|
184
|
+
__param(4, (0, common_1.Query)('limit')),
|
|
185
|
+
__param(5, (0, common_1.Query)('sortBy')),
|
|
186
|
+
__param(6, (0, common_1.Query)('sortOrder')),
|
|
187
|
+
__metadata("design:type", Function),
|
|
188
|
+
__metadata("design:paramtypes", [String, String, String, String, String, String, String]),
|
|
189
|
+
__metadata("design:returntype", Promise)
|
|
190
|
+
], ToolFixtureController.prototype, "findAll", null);
|
|
191
|
+
__decorate([
|
|
192
|
+
(0, common_1.Get)('stats'),
|
|
193
|
+
__metadata("design:type", Function),
|
|
194
|
+
__metadata("design:paramtypes", []),
|
|
195
|
+
__metadata("design:returntype", Promise)
|
|
196
|
+
], ToolFixtureController.prototype, "getStats", null);
|
|
197
|
+
__decorate([
|
|
198
|
+
(0, common_1.Get)(':id'),
|
|
199
|
+
__param(0, (0, common_1.Param)('id')),
|
|
200
|
+
__metadata("design:type", Function),
|
|
201
|
+
__metadata("design:paramtypes", [String]),
|
|
202
|
+
__metadata("design:returntype", Promise)
|
|
203
|
+
], ToolFixtureController.prototype, "findOne", null);
|
|
204
|
+
__decorate([
|
|
205
|
+
(0, common_1.Patch)(':id'),
|
|
206
|
+
__param(0, (0, common_1.Param)('id')),
|
|
207
|
+
__param(1, (0, common_1.Body)()),
|
|
208
|
+
__metadata("design:type", Function),
|
|
209
|
+
__metadata("design:paramtypes", [String, update_tool_fixture_dto_1.UpdateToolFixtureDto]),
|
|
210
|
+
__metadata("design:returntype", Promise)
|
|
211
|
+
], ToolFixtureController.prototype, "update", null);
|
|
212
|
+
__decorate([
|
|
213
|
+
(0, common_1.Delete)(':id'),
|
|
214
|
+
__param(0, (0, common_1.Param)('id')),
|
|
215
|
+
__metadata("design:type", Function),
|
|
216
|
+
__metadata("design:paramtypes", [String]),
|
|
217
|
+
__metadata("design:returntype", Promise)
|
|
218
|
+
], ToolFixtureController.prototype, "remove", null);
|
|
219
|
+
exports.ToolFixtureController = ToolFixtureController = ToolFixtureController_1 = __decorate([
|
|
220
|
+
(0, common_1.Controller)('tool-fixtures'),
|
|
221
|
+
__metadata("design:paramtypes", [tool_fixture_service_1.ToolFixtureService])
|
|
222
|
+
], ToolFixtureController);
|
|
223
|
+
//# sourceMappingURL=tool-fixture.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-fixture.controller.js","sourceRoot":"","sources":["../../src/tool-fixtures/tool-fixture.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAYwB;AACxB,iEAA4D;AAC5D,2EAAqE;AACrE,2EAAqE;AAErE;;;GAGG;AACH,SAAS,uBAAuB,CAAC,KAAa,EAAE,IAAY,EAAE,KAAa;IACzE,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC;IAC5C,OAAO;QACL,KAAK;QACL,IAAI;QACJ,KAAK;QACL,UAAU;QACV,WAAW,EAAE,IAAI,GAAG,UAAU;QAC9B,WAAW,EAAE,IAAI,GAAG,CAAC;KACtB,CAAC;AACJ,CAAC;AAGM,IAAM,qBAAqB,6BAA3B,MAAM,qBAAqB;IAGhC,YAA6B,kBAAsC;QAAtC,uBAAkB,GAAlB,kBAAkB,CAAoB;QAFlD,WAAM,GAAG,IAAI,eAAM,CAAC,uBAAqB,CAAC,IAAI,CAAC,CAAC;IAEK,CAAC;IAGjE,AAAN,KAAK,CAAC,MAAM,CACF,SAA+B;QAEvC,IAAI,CAAC;YACH,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,SAA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IACf,WAAA,IAAA,cAAK,EAAC,WAAW,CAAC,CAAA;;;;oDAkDpB;AAGK;IADL,IAAA,YAAG,EAAC,OAAO,CAAC;;;;qDAsBZ;AAGK;IADL,IAAA,YAAG,EAAC,KAAK,CAAC;IACI,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;oDAwBzB;AAGK;IADL,IAAA,cAAK,EAAC,KAAK,CAAC;IAEV,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IACX,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAY,8CAAoB;;mDAyBxC;AAGK;IADL,IAAA,eAAM,EAAC,KAAK,CAAC;IACA,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;mDAyBxB;gCArMU,qBAAqB;IADjC,IAAA,mBAAU,EAAC,eAAe,CAAC;qCAIuB,yCAAkB;GAHxD,qBAAqB,CAsMjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-fixture.module.d.ts","sourceRoot":"","sources":["../../src/tool-fixtures/tool-fixture.module.ts"],"names":[],"mappings":"AAOA,qBAUa,iBAAiB;CAAG"}
|
|
@@ -0,0 +1,31 @@
|
|
|
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.ToolFixtureModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
12
|
+
const tool_fixture_schema_1 = require("./schemas/tool-fixture.schema");
|
|
13
|
+
const tool_fixture_service_1 = require("./tool-fixture.service");
|
|
14
|
+
const tool_fixture_controller_1 = require("./tool-fixture.controller");
|
|
15
|
+
const mock_resolver_service_1 = require("./mock-resolver.service");
|
|
16
|
+
let ToolFixtureModule = class ToolFixtureModule {
|
|
17
|
+
};
|
|
18
|
+
exports.ToolFixtureModule = ToolFixtureModule;
|
|
19
|
+
exports.ToolFixtureModule = ToolFixtureModule = __decorate([
|
|
20
|
+
(0, common_1.Module)({
|
|
21
|
+
imports: [
|
|
22
|
+
mongoose_1.MongooseModule.forFeature([
|
|
23
|
+
{ name: tool_fixture_schema_1.ToolFixture.name, schema: tool_fixture_schema_1.ToolFixtureSchema },
|
|
24
|
+
]),
|
|
25
|
+
],
|
|
26
|
+
controllers: [tool_fixture_controller_1.ToolFixtureController],
|
|
27
|
+
providers: [tool_fixture_service_1.ToolFixtureService, mock_resolver_service_1.MockResolver],
|
|
28
|
+
exports: [tool_fixture_service_1.ToolFixtureService, mock_resolver_service_1.MockResolver],
|
|
29
|
+
})
|
|
30
|
+
], ToolFixtureModule);
|
|
31
|
+
//# sourceMappingURL=tool-fixture.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-fixture.module.js","sourceRoot":"","sources":["../../src/tool-fixtures/tool-fixture.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,+CAAkD;AAClD,uEAA+E;AAC/E,iEAA4D;AAC5D,uEAAkE;AAClE,mEAAuD;AAYhD,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAAG,CAAA;AAApB,8CAAiB;4BAAjB,iBAAiB;IAV7B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,yBAAc,CAAC,UAAU,CAAC;gBACxB,EAAE,IAAI,EAAE,iCAAW,CAAC,IAAI,EAAE,MAAM,EAAE,uCAAiB,EAAE;aACtD,CAAC;SACH;QACD,WAAW,EAAE,CAAC,+CAAqB,CAAC;QACpC,SAAS,EAAE,CAAC,yCAAkB,EAAE,oCAAY,CAAC;QAC7C,OAAO,EAAE,CAAC,yCAAkB,EAAE,oCAAY,CAAC;KAC5C,CAAC;GACW,iBAAiB,CAAG"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Model } from 'mongoose';
|
|
2
|
+
import { ToolFixture, ToolFixtureDocument } from './schemas/tool-fixture.schema';
|
|
3
|
+
import { CreateToolFixtureDto } from './dto/create-tool-fixture.dto';
|
|
4
|
+
import { UpdateToolFixtureDto } from './dto/update-tool-fixture.dto';
|
|
5
|
+
export declare class ToolFixtureService {
|
|
6
|
+
private toolFixtureModel;
|
|
7
|
+
private readonly logger;
|
|
8
|
+
constructor(toolFixtureModel: Model<ToolFixtureDocument>);
|
|
9
|
+
/**
|
|
10
|
+
* Create a new tool fixture.
|
|
11
|
+
*/
|
|
12
|
+
create(createDto: CreateToolFixtureDto, createdBy?: string): Promise<ToolFixture>;
|
|
13
|
+
/**
|
|
14
|
+
* Find all tool fixtures with optional filters and pagination.
|
|
15
|
+
*/
|
|
16
|
+
findAll(filters?: {
|
|
17
|
+
isActive?: boolean;
|
|
18
|
+
tags?: string[];
|
|
19
|
+
search?: string;
|
|
20
|
+
}, pagination?: {
|
|
21
|
+
limit?: number;
|
|
22
|
+
offset?: number;
|
|
23
|
+
sortBy?: string;
|
|
24
|
+
sortOrder?: 'asc' | 'desc';
|
|
25
|
+
}): Promise<{
|
|
26
|
+
toolFixtures: ToolFixture[];
|
|
27
|
+
total: number;
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* Find tool fixture by ID.
|
|
31
|
+
*/
|
|
32
|
+
findOne(id: string): Promise<ToolFixture>;
|
|
33
|
+
/**
|
|
34
|
+
* Bulk load tool fixtures by IDs.
|
|
35
|
+
* Returns found fixtures (silently skips missing IDs).
|
|
36
|
+
*/
|
|
37
|
+
findByIds(ids: string[]): Promise<ToolFixture[]>;
|
|
38
|
+
/**
|
|
39
|
+
* Update a tool fixture using findByIdAndUpdate.
|
|
40
|
+
*/
|
|
41
|
+
update(id: string, updateDto: UpdateToolFixtureDto): Promise<ToolFixture>;
|
|
42
|
+
/**
|
|
43
|
+
* Delete a tool fixture (hard delete, matching persona pattern).
|
|
44
|
+
*/
|
|
45
|
+
remove(id: string): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Get tool fixture statistics.
|
|
48
|
+
*/
|
|
49
|
+
getStats(): Promise<{
|
|
50
|
+
total: number;
|
|
51
|
+
active: number;
|
|
52
|
+
inactive: number;
|
|
53
|
+
byTag: Array<{
|
|
54
|
+
tag: string;
|
|
55
|
+
count: number;
|
|
56
|
+
}>;
|
|
57
|
+
}>;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=tool-fixture.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-fixture.service.d.ts","sourceRoot":"","sources":["../../src/tool-fixtures/tool-fixture.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE,qBACa,kBAAkB;IAK3B,OAAO,CAAC,gBAAgB;IAJ1B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuC;gBAIpD,gBAAgB,EAAE,KAAK,CAAC,mBAAmB,CAAC;IAGtD;;OAEG;IACG,MAAM,CACV,SAAS,EAAE,oBAAoB,EAC/B,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,WAAW,CAAC;IAkBvB;;OAEG;IACG,OAAO,CACX,OAAO,CAAC,EAAE;QAC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