repoburg 1.2.10 → 1.2.12
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/CODEMAP.md +7 -6
- package/backend/dist/src/app.controller.d.ts +0 -1
- package/backend/dist/src/app.module.js +3 -0
- package/backend/dist/src/app.module.js.map +1 -1
- package/backend/dist/src/app.service.d.ts +0 -1
- package/backend/dist/src/app.service.js +0 -9
- package/backend/dist/src/app.service.js.map +1 -1
- package/backend/dist/src/context-snippets/context-snippets.module.js +2 -0
- package/backend/dist/src/context-snippets/context-snippets.module.js.map +1 -1
- package/backend/dist/src/context-snippets/context-snippets.service.d.ts +3 -1
- package/backend/dist/src/context-snippets/context-snippets.service.js +14 -3
- package/backend/dist/src/context-snippets/context-snippets.service.js.map +1 -1
- package/backend/dist/src/context-templates/context-templates.module.js +2 -0
- package/backend/dist/src/context-templates/context-templates.module.js.map +1 -1
- package/backend/dist/src/context-templates/context-templates.service.d.ts +3 -1
- package/backend/dist/src/context-templates/context-templates.service.js +11 -2
- package/backend/dist/src/context-templates/context-templates.service.js.map +1 -1
- package/backend/dist/src/core-entities/custom-variable.entity.d.ts +6 -0
- package/backend/dist/src/core-entities/custom-variable.entity.js +33 -0
- package/backend/dist/src/core-entities/custom-variable.entity.js.map +1 -0
- package/backend/dist/src/core-entities/index.d.ts +1 -0
- package/backend/dist/src/core-entities/index.js +1 -0
- package/backend/dist/src/core-entities/index.js.map +1 -1
- package/backend/dist/src/custom-variables/custom-variables.controller.d.ts +12 -0
- package/backend/dist/src/custom-variables/custom-variables.controller.js +80 -0
- package/backend/dist/src/custom-variables/custom-variables.controller.js.map +1 -0
- package/backend/dist/src/custom-variables/custom-variables.module.d.ts +2 -0
- package/backend/dist/src/custom-variables/custom-variables.module.js +26 -0
- package/backend/dist/src/custom-variables/custom-variables.module.js.map +1 -0
- package/backend/dist/src/custom-variables/custom-variables.service.d.ts +13 -0
- package/backend/dist/src/custom-variables/custom-variables.service.js +60 -0
- package/backend/dist/src/custom-variables/custom-variables.service.js.map +1 -0
- package/backend/dist/src/custom-variables/dto/custom-variable.dto.d.ts +10 -0
- package/backend/dist/src/custom-variables/dto/custom-variable.dto.js +52 -0
- package/backend/dist/src/custom-variables/dto/custom-variable.dto.js.map +1 -0
- package/backend/dist/src/seeding/custom-variable-seeding.service.d.ts +7 -0
- package/backend/dist/src/seeding/custom-variable-seeding.service.js +64 -0
- package/backend/dist/src/seeding/custom-variable-seeding.service.js.map +1 -0
- package/backend/dist/src/seeding/data/context-templates/default-followup_ad-hoc-focused-context.d.ts +1 -1
- package/backend/dist/src/seeding/data/context-templates/default-followup_ad-hoc-focused-context.js +7 -1
- package/backend/dist/src/seeding/data/context-templates/default-followup_ad-hoc-focused-context.js.map +1 -1
- package/backend/dist/src/seeding/data/custom-variables/default-plan-mode.d.ts +3 -0
- package/backend/dist/src/seeding/data/custom-variables/default-plan-mode.js +7 -0
- package/backend/dist/src/seeding/data/custom-variables/default-plan-mode.js.map +1 -0
- package/backend/dist/src/seeding/seeding.module.js +4 -0
- package/backend/dist/src/seeding/seeding.module.js.map +1 -1
- package/backend/dist/src/seeding/seeding.service.d.ts +3 -1
- package/backend/dist/src/seeding/seeding.service.js +6 -2
- package/backend/dist/src/seeding/seeding.service.js.map +1 -1
- package/backend/dist/src/session-inputs/session-input-context.service.d.ts +3 -1
- package/backend/dist/src/session-inputs/session-input-context.service.js +11 -2
- package/backend/dist/src/session-inputs/session-input-context.service.js.map +1 -1
- package/backend/dist/src/session-inputs/session-inputs.module.js +2 -0
- package/backend/dist/src/session-inputs/session-inputs.module.js.map +1 -1
- package/backend/dist/tsconfig.build.tsbuildinfo +1 -1
- package/daemon/dist/index.js +0 -2
- package/package.json +1 -1
- package/platform-cli.js +2 -65
package/CODEMAP.md
CHANGED
|
@@ -43,11 +43,12 @@ The local server that contains the core application logic.
|
|
|
43
43
|
- **`/interactive-chat`**: Orchestrates sending prompts to an LLM for both integrated and manual modes.
|
|
44
44
|
|
|
45
45
|
#### Context & Prompting
|
|
46
|
-
- **`/context-generation`**: Renders context strings from Eta.js templates using built-in helper functions.
|
|
46
|
+
- **`/context-generation`**: Renders context strings from Eta.js templates using built-in helper functions. Variables from `custom-variables` are injected here.
|
|
47
47
|
- **`/context-templates`**: CRUD module for managing the main context templates.
|
|
48
48
|
- **`/system-prompts`**: CRUD module for managing the system prompts that define the AI's behavior.
|
|
49
49
|
- **`/context-snippets`**: Manages dynamic, reusable context snippets callable with `!` in a prompt.
|
|
50
50
|
- **`/custom-snippets`**: Manages static, reusable code snippets for the template editor.
|
|
51
|
+
- **`/custom-variables`**: Manages a key-value store of user-defined variables (e.g., `PLAN_MODE`) that can be used in any template via `it.VAR`.
|
|
51
52
|
|
|
52
53
|
#### Core Services & Integrations
|
|
53
54
|
- **`/workspace`**: Provides APIs to interact with the local file system (file tree, search, file content).
|
|
@@ -57,7 +58,7 @@ The local server that contains the core application logic.
|
|
|
57
58
|
- **`/mcp`**: Manages connections and tools for the Model Context Protocol (MCP).
|
|
58
59
|
- **`/visual-editor`**: Provides an endpoint for the visual editor's injected client script to submit prompts and context, adapting them into standard session inputs.
|
|
59
60
|
- **`/projects`**: Manages project-specific information.
|
|
60
|
-
- **`/seeding`**: Seeds the database with default data (prompts, templates) on startup.
|
|
61
|
+
- **`/seeding`**: Seeds the database with default data (prompts, templates, variables) on startup.
|
|
61
62
|
- **`/core-entities`**: Contains all TypeORM entity definitions for the database schema.
|
|
62
63
|
- **`/utils`**: Shared utility functions and decorators (e.g., fuzzy search, tracing).
|
|
63
64
|
|
|
@@ -78,11 +79,11 @@ The main user interface for interacting with the Repoburg backend.
|
|
|
78
79
|
- **`/pages`**: Top-level components for each main view (e.g., `MainHomePage`, `SettingsPage`).
|
|
79
80
|
- **`/editors`**: Specialized editor components for templates, prompts, and snippets.
|
|
80
81
|
- **`/plan` & `/session`**: Components for displaying AI-generated plans and the conversation history.
|
|
81
|
-
- **`/common`**: Shared components like the command palette and
|
|
82
|
+
- **`/common`**: Shared components like the command palette, markdown renderers, and the new `VariableToggleModal`.
|
|
82
83
|
- **`/components/ui`**: The library of low-level, reusable UI components from shadcn/ui.
|
|
83
|
-
- **`/lib/api`**: A collection of strongly-typed functions that handle all HTTP communication with the `backend` API.
|
|
84
|
-
- **`/store`**: Contains all Zustand state management logic, divided into slices for different features (e.g., `session.slice.ts`, `ui.slice.ts`).
|
|
85
|
-
- **`/hooks`**: Custom React hooks, such as
|
|
84
|
+
- **`/lib/api`**: A collection of strongly-typed functions that handle all HTTP communication with the `backend` API, including the new `customVariable` client.
|
|
85
|
+
- **`/store`**: Contains all Zustand state management logic, divided into slices for different features (e.g., `session.slice.ts`, `ui.slice.ts`, `customVariableStore.ts`).
|
|
86
|
+
- **`/hooks`**: Custom React hooks, such as `useMonacoEtaSetup`, which now provides autocompletion for Repoburg Variables (`it.VAR`).
|
|
86
87
|
- **`/types`**: Contains all TypeScript type definitions for API payloads and other shared data structures.
|
|
87
88
|
|
|
88
89
|
---
|
|
@@ -36,6 +36,7 @@ const context_snippets_module_1 = require("./context-snippets/context-snippets.m
|
|
|
36
36
|
const chat_module_1 = require("./interactive-chat/chat.module");
|
|
37
37
|
const mcp_module_1 = require("./mcp/mcp.module");
|
|
38
38
|
const visual_editor_module_1 = require("./visual-editor/visual-editor.module");
|
|
39
|
+
const custom_variables_module_1 = require("./custom-variables/custom-variables.module");
|
|
39
40
|
let dbPath = ':memory:';
|
|
40
41
|
if (process.env.NODE_ENV === 'production') {
|
|
41
42
|
const projectPath = process.env.REPOBURG_PROJECT_PATH || process.cwd();
|
|
@@ -68,6 +69,7 @@ exports.AppModule = AppModule = __decorate([
|
|
|
68
69
|
core_entities_1.ContextSnippet,
|
|
69
70
|
core_entities_1.McpConfig,
|
|
70
71
|
core_entities_1.McpTool,
|
|
72
|
+
core_entities_1.CustomVariable,
|
|
71
73
|
],
|
|
72
74
|
synchronize: true,
|
|
73
75
|
autoLoadEntities: true,
|
|
@@ -94,6 +96,7 @@ exports.AppModule = AppModule = __decorate([
|
|
|
94
96
|
chat_module_1.InteractiveChatModule,
|
|
95
97
|
mcp_module_1.McpModule,
|
|
96
98
|
visual_editor_module_1.VisualEditorModule,
|
|
99
|
+
custom_variables_module_1.CustomVariablesModule,
|
|
97
100
|
],
|
|
98
101
|
controllers: [app_controller_1.AppController],
|
|
99
102
|
providers: [app_service_1.AppService],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,qDAAiD;AACjD,+CAA2C;AAC3C,6CAAgD;AAChD,
|
|
1
|
+
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,qDAAiD;AACjD,+CAA2C;AAC3C,6CAAgD;AAChD,mDAcyB;AACzB,gEAA4D;AAC5D,gEAA4D;AAC5D,kFAA6E;AAC7E,iGAA2F;AAC3F,sEAAiE;AACjE,kFAA6E;AAC7E,2FAAsF;AACtF,8FAAyF;AACzF,kFAA6E;AAC7E,6DAAyD;AACzD,mEAA+D;AAC/D,qFAAgF;AAChF,6BAA6B;AAC7B,yBAAyB;AACzB,wFAAmF;AACnF,wFAAmF;AACnF,wFAAmF;AACnF,2FAAsF;AACtF,+EAA0E;AAC1E,0DAAsD;AACtD,wFAAmF;AACnF,gEAAuE;AACvE,iDAA6C;AAC7C,+EAA0E;AAC1E,wFAAmF;AAEnF,IAAI,MAAM,GAAG,UAAU,CAAC;AAExB,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC;IAC1C,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IACvE,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAClD,IAAI,CAAC,EAAE,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19
|
this.port = port;
|
|
20
20
|
}
|
|
21
21
|
getInfo() {
|
|
22
|
-
let appVersion = 'unknown';
|
|
23
|
-
try {
|
|
24
|
-
const packageJson = require('../../package.json');
|
|
25
|
-
appVersion = packageJson.version;
|
|
26
|
-
}
|
|
27
|
-
catch (e) {
|
|
28
|
-
console.error('Could not load package.json to determine version.', e);
|
|
29
|
-
}
|
|
30
22
|
return {
|
|
31
23
|
project_path: process.env.REPOBURG_PROJECT_PATH || process.cwd(),
|
|
32
24
|
port: this.port,
|
|
33
25
|
is_development: process.env.NODE_ENV !== 'production',
|
|
34
|
-
version: appVersion,
|
|
35
26
|
};
|
|
36
27
|
}
|
|
37
28
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.service.js","sourceRoot":"","sources":["../../src/app.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAGrC,IAAM,UAAU,GAAhB,MAAM,UAAU;IAGrB,QAAQ;QACN,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,SAAS;QACP,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC1B,CAAC;IAED,OAAO,CAAC,IAAY;QAClB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,OAAO;QACL,
|
|
1
|
+
{"version":3,"file":"app.service.js","sourceRoot":"","sources":["../../src/app.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAGrC,IAAM,UAAU,GAAhB,MAAM,UAAU;IAGrB,QAAQ;QACN,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,SAAS;QACP,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC1B,CAAC;IAED,OAAO,CAAC,IAAY;QAClB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,OAAO;QACL,OAAO;YACL,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,OAAO,CAAC,GAAG,EAAE;YAChE,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,cAAc,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY;SACtD,CAAC;IACJ,CAAC;CACF,CAAA;AAtBY,gCAAU;qBAAV,UAAU;IADtB,IAAA,mBAAU,GAAE;GACA,UAAU,CAsBtB"}
|
|
@@ -13,6 +13,7 @@ const core_entities_1 = require("../core-entities");
|
|
|
13
13
|
const context_snippets_service_1 = require("./context-snippets.service");
|
|
14
14
|
const context_snippets_controller_1 = require("./context-snippets.controller");
|
|
15
15
|
const context_generation_module_1 = require("../context-generation/context-generation.module");
|
|
16
|
+
const custom_variables_module_1 = require("../custom-variables/custom-variables.module");
|
|
16
17
|
let ContextSnippetsModule = class ContextSnippetsModule {
|
|
17
18
|
};
|
|
18
19
|
exports.ContextSnippetsModule = ContextSnippetsModule;
|
|
@@ -21,6 +22,7 @@ exports.ContextSnippetsModule = ContextSnippetsModule = __decorate([
|
|
|
21
22
|
imports: [
|
|
22
23
|
typeorm_1.TypeOrmModule.forFeature([core_entities_1.ContextSnippet]),
|
|
23
24
|
context_generation_module_1.ContextGenerationModule,
|
|
25
|
+
custom_variables_module_1.CustomVariablesModule,
|
|
24
26
|
],
|
|
25
27
|
controllers: [context_snippets_controller_1.ContextSnippetsController],
|
|
26
28
|
providers: [context_snippets_service_1.ContextSnippetsService],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-snippets.module.js","sourceRoot":"","sources":["../../../src/context-snippets/context-snippets.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,oDAAkD;AAClD,yEAAoE;AACpE,+EAA0E;AAC1E,+FAA0F;
|
|
1
|
+
{"version":3,"file":"context-snippets.module.js","sourceRoot":"","sources":["../../../src/context-snippets/context-snippets.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,oDAAkD;AAClD,yEAAoE;AACpE,+EAA0E;AAC1E,+FAA0F;AAC1F,yFAAoF;AAY7E,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;CAAG,CAAA;AAAxB,sDAAqB;gCAArB,qBAAqB;IAVjC,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,UAAU,CAAC,CAAC,8BAAc,CAAC,CAAC;YAC1C,mDAAuB;YACvB,+CAAqB;SACtB;QACD,WAAW,EAAE,CAAC,uDAAyB,CAAC;QACxC,SAAS,EAAE,CAAC,iDAAsB,CAAC;QACnC,OAAO,EAAE,CAAC,iDAAsB,CAAC;KAClC,CAAC;GACW,qBAAqB,CAAG"}
|
|
@@ -2,11 +2,13 @@ import { Repository } from 'typeorm';
|
|
|
2
2
|
import { ContextSnippet } from '../core-entities';
|
|
3
3
|
import { CreateContextSnippetDto, PreviewContextSnippetDto, PreviewContextSnippetResponseDto, UpdateContextSnippetDto } from './dto/context-snippet.dto';
|
|
4
4
|
import { ContextGenerationService } from '../context-generation/context-generation.service';
|
|
5
|
+
import { CustomVariablesService } from '../custom-variables/custom-variables.service';
|
|
5
6
|
export declare class ContextSnippetsService {
|
|
6
7
|
private contextSnippetsRepository;
|
|
7
8
|
private readonly contextGenerationService;
|
|
9
|
+
private readonly customVariablesService;
|
|
8
10
|
private readonly logger;
|
|
9
|
-
constructor(contextSnippetsRepository: Repository<ContextSnippet>, contextGenerationService: ContextGenerationService);
|
|
11
|
+
constructor(contextSnippetsRepository: Repository<ContextSnippet>, contextGenerationService: ContextGenerationService, customVariablesService: CustomVariablesService);
|
|
10
12
|
create(createDto: CreateContextSnippetDto): Promise<ContextSnippet>;
|
|
11
13
|
findAll(): Promise<ContextSnippet[]>;
|
|
12
14
|
findOne(id: string): Promise<ContextSnippet>;
|
|
@@ -19,10 +19,12 @@ const typeorm_1 = require("@nestjs/typeorm");
|
|
|
19
19
|
const typeorm_2 = require("typeorm");
|
|
20
20
|
const core_entities_1 = require("../core-entities");
|
|
21
21
|
const context_generation_service_1 = require("../context-generation/context-generation.service");
|
|
22
|
+
const custom_variables_service_1 = require("../custom-variables/custom-variables.service");
|
|
22
23
|
let ContextSnippetsService = ContextSnippetsService_1 = class ContextSnippetsService {
|
|
23
|
-
constructor(contextSnippetsRepository, contextGenerationService) {
|
|
24
|
+
constructor(contextSnippetsRepository, contextGenerationService, customVariablesService) {
|
|
24
25
|
this.contextSnippetsRepository = contextSnippetsRepository;
|
|
25
26
|
this.contextGenerationService = contextGenerationService;
|
|
27
|
+
this.customVariablesService = customVariablesService;
|
|
26
28
|
this.logger = new common_1.Logger(ContextSnippetsService_1.name);
|
|
27
29
|
}
|
|
28
30
|
async create(createDto) {
|
|
@@ -71,7 +73,15 @@ let ContextSnippetsService = ContextSnippetsService_1 = class ContextSnippetsSer
|
|
|
71
73
|
}
|
|
72
74
|
async preview(dto) {
|
|
73
75
|
try {
|
|
74
|
-
const
|
|
76
|
+
const enabledVariables = await this.customVariablesService.findAllEnabled();
|
|
77
|
+
const variableMap = enabledVariables.reduce((acc, curr) => {
|
|
78
|
+
acc[curr.key] = curr.value;
|
|
79
|
+
return acc;
|
|
80
|
+
}, {});
|
|
81
|
+
const data = {
|
|
82
|
+
VAR: variableMap,
|
|
83
|
+
};
|
|
84
|
+
const rendered_text = await this.contextGenerationService.render(dto.template_content, data);
|
|
75
85
|
return { rendered_text };
|
|
76
86
|
}
|
|
77
87
|
catch (error) {
|
|
@@ -88,6 +98,7 @@ exports.ContextSnippetsService = ContextSnippetsService = ContextSnippetsService
|
|
|
88
98
|
(0, common_1.Injectable)(),
|
|
89
99
|
__param(0, (0, typeorm_1.InjectRepository)(core_entities_1.ContextSnippet)),
|
|
90
100
|
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
91
|
-
context_generation_service_1.ContextGenerationService
|
|
101
|
+
context_generation_service_1.ContextGenerationService,
|
|
102
|
+
custom_variables_service_1.CustomVariablesService])
|
|
92
103
|
], ContextSnippetsService);
|
|
93
104
|
//# sourceMappingURL=context-snippets.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-snippets.service.js","sourceRoot":"","sources":["../../../src/context-snippets/context-snippets.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAKwB;AACxB,6CAAmD;AACnD,qCAAqC;AACrC,oDAAkD;AAOlD,iGAA4F;
|
|
1
|
+
{"version":3,"file":"context-snippets.service.js","sourceRoot":"","sources":["../../../src/context-snippets/context-snippets.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAKwB;AACxB,6CAAmD;AACnD,qCAAqC;AACrC,oDAAkD;AAOlD,iGAA4F;AAC5F,2FAAsF;AAG/E,IAAM,sBAAsB,8BAA5B,MAAM,sBAAsB;IAGjC,YAEE,yBAA6D,EAC5C,wBAAkD,EAClD,sBAA8C;QAFvD,8BAAyB,GAAzB,yBAAyB,CAA4B;QAC5C,6BAAwB,GAAxB,wBAAwB,CAA0B;QAClD,2BAAsB,GAAtB,sBAAsB,CAAwB;QANhD,WAAM,GAAG,IAAI,eAAM,CAAC,wBAAsB,CAAC,IAAI,CAAC,CAAC;IAO/D,CAAC;IAEJ,KAAK,CAAC,MAAM,CAAC,SAAkC;QAC7C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,yBAAyB,CAAC,SAAS,CAAC;YAC9D,MAAM,EAAE,SAAS,CAAC,MAAM;SACzB,CAAC,CAAC;QACH,IAAI,QAAQ,EAAE,CAAC;YACb,MAAM,IAAI,4BAAmB,CAC3B,sCAAsC,SAAS,CAAC,MAAM,mBAAmB,CAC1E,CAAC;QACJ,CAAC;QACD,MAAM,OAAO,GAAG,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACjE,OAAO,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,OAAO;QACX,OAAO,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,EAAE,KAAK,EA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("../core-entities");
|
|
|
13
13
|
const context_templates_service_1 = require("./context-templates.service");
|
|
14
14
|
const context_templates_controller_1 = require("./context-templates.controller");
|
|
15
15
|
const context_generation_module_1 = require("../context-generation/context-generation.module");
|
|
16
|
+
const custom_variables_module_1 = require("../custom-variables/custom-variables.module");
|
|
16
17
|
let ContextTemplatesModule = class ContextTemplatesModule {
|
|
17
18
|
};
|
|
18
19
|
exports.ContextTemplatesModule = ContextTemplatesModule;
|
|
@@ -21,6 +22,7 @@ exports.ContextTemplatesModule = ContextTemplatesModule = __decorate([
|
|
|
21
22
|
imports: [
|
|
22
23
|
typeorm_1.TypeOrmModule.forFeature([core_entities_1.ContextTemplate]),
|
|
23
24
|
context_generation_module_1.ContextGenerationModule,
|
|
25
|
+
custom_variables_module_1.CustomVariablesModule,
|
|
24
26
|
],
|
|
25
27
|
controllers: [context_templates_controller_1.ContextTemplatesController],
|
|
26
28
|
providers: [context_templates_service_1.ContextTemplatesService],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-templates.module.js","sourceRoot":"","sources":["../../../src/context-templates/context-templates.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,oDAAmD;AACnD,2EAAsE;AACtE,iFAA4E;AAC5E,+FAA0F;
|
|
1
|
+
{"version":3,"file":"context-templates.module.js","sourceRoot":"","sources":["../../../src/context-templates/context-templates.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,oDAAmD;AACnD,2EAAsE;AACtE,iFAA4E;AAC5E,+FAA0F;AAC1F,yFAAoF;AAY7E,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;CAAG,CAAA;AAAzB,wDAAsB;iCAAtB,sBAAsB;IAVlC,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,UAAU,CAAC,CAAC,+BAAe,CAAC,CAAC;YAC3C,mDAAuB;YACvB,+CAAqB;SACtB;QACD,WAAW,EAAE,CAAC,yDAA0B,CAAC;QACzC,SAAS,EAAE,CAAC,mDAAuB,CAAC;QACpC,OAAO,EAAE,CAAC,mDAAuB,CAAC;KACnC,CAAC;GACW,sBAAsB,CAAG"}
|
|
@@ -2,12 +2,14 @@ import { Repository, DataSource } from 'typeorm';
|
|
|
2
2
|
import { ContextTemplate, TemplateType } from '../core-entities';
|
|
3
3
|
import { CreateContextTemplateDto, PreviewContextTemplateDto, PreviewContextTemplateResponseDto, UpdateContextTemplateDto } from './dto/context-template.dto';
|
|
4
4
|
import { ContextGenerationService } from '../context-generation/context-generation.service';
|
|
5
|
+
import { CustomVariablesService } from '../custom-variables/custom-variables.service';
|
|
5
6
|
export declare class ContextTemplatesService {
|
|
6
7
|
private contextTemplatesRepository;
|
|
7
8
|
private dataSource;
|
|
8
9
|
private readonly contextGenerationService;
|
|
10
|
+
private readonly customVariablesService;
|
|
9
11
|
private readonly logger;
|
|
10
|
-
constructor(contextTemplatesRepository: Repository<ContextTemplate>, dataSource: DataSource, contextGenerationService: ContextGenerationService);
|
|
12
|
+
constructor(contextTemplatesRepository: Repository<ContextTemplate>, dataSource: DataSource, contextGenerationService: ContextGenerationService, customVariablesService: CustomVariablesService);
|
|
11
13
|
create(createContextTemplateDto: CreateContextTemplateDto): Promise<ContextTemplate>;
|
|
12
14
|
findAll(type?: TemplateType): Promise<ContextTemplate[]>;
|
|
13
15
|
findOne(id: string): Promise<ContextTemplate>;
|
|
@@ -20,11 +20,13 @@ const typeorm_2 = require("typeorm");
|
|
|
20
20
|
const core_entities_1 = require("../core-entities");
|
|
21
21
|
const context_generation_service_1 = require("../context-generation/context-generation.service");
|
|
22
22
|
const gpt_tokenizer_1 = require("gpt-tokenizer");
|
|
23
|
+
const custom_variables_service_1 = require("../custom-variables/custom-variables.service");
|
|
23
24
|
let ContextTemplatesService = ContextTemplatesService_1 = class ContextTemplatesService {
|
|
24
|
-
constructor(contextTemplatesRepository, dataSource, contextGenerationService) {
|
|
25
|
+
constructor(contextTemplatesRepository, dataSource, contextGenerationService, customVariablesService) {
|
|
25
26
|
this.contextTemplatesRepository = contextTemplatesRepository;
|
|
26
27
|
this.dataSource = dataSource;
|
|
27
28
|
this.contextGenerationService = contextGenerationService;
|
|
29
|
+
this.customVariablesService = customVariablesService;
|
|
28
30
|
this.logger = new common_1.Logger(ContextTemplatesService_1.name);
|
|
29
31
|
}
|
|
30
32
|
async create(createContextTemplateDto) {
|
|
@@ -109,11 +111,17 @@ let ContextTemplatesService = ContextTemplatesService_1 = class ContextTemplates
|
|
|
109
111
|
adHocData.adhoc_folders_content = folderContexts.join('\n\n---\n\n');
|
|
110
112
|
}
|
|
111
113
|
}
|
|
114
|
+
const enabledVariables = await this.customVariablesService.findAllEnabled();
|
|
115
|
+
const variableMap = enabledVariables.reduce((acc, curr) => {
|
|
116
|
+
acc[curr.key] = curr.value;
|
|
117
|
+
return acc;
|
|
118
|
+
}, {});
|
|
112
119
|
const data = {
|
|
113
120
|
...adHocData,
|
|
114
121
|
user_input: '',
|
|
115
122
|
system_prompt: '',
|
|
116
123
|
ad_hoc_context_definition: JSON.stringify(dto.context_definition || {}),
|
|
124
|
+
VAR: variableMap,
|
|
117
125
|
};
|
|
118
126
|
const rendered_context = await this.contextGenerationService.render(dto.template_content, data);
|
|
119
127
|
const token_count = (0, gpt_tokenizer_1.countTokens)(rendered_context);
|
|
@@ -180,6 +188,7 @@ exports.ContextTemplatesService = ContextTemplatesService = ContextTemplatesServ
|
|
|
180
188
|
__param(0, (0, typeorm_1.InjectRepository)(core_entities_1.ContextTemplate)),
|
|
181
189
|
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
182
190
|
typeorm_2.DataSource,
|
|
183
|
-
context_generation_service_1.ContextGenerationService
|
|
191
|
+
context_generation_service_1.ContextGenerationService,
|
|
192
|
+
custom_variables_service_1.CustomVariablesService])
|
|
184
193
|
], ContextTemplatesService);
|
|
185
194
|
//# sourceMappingURL=context-templates.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-templates.service.js","sourceRoot":"","sources":["../../../src/context-templates/context-templates.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAuE;AACvE,6CAAmD;AACnD,qCAAmE;AACnE,oDAAiE;AAOjE,iGAA4F;AAC5F,iDAA4C;
|
|
1
|
+
{"version":3,"file":"context-templates.service.js","sourceRoot":"","sources":["../../../src/context-templates/context-templates.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAuE;AACvE,6CAAmD;AACnD,qCAAmE;AACnE,oDAAiE;AAOjE,iGAA4F;AAC5F,iDAA4C;AAC5C,2FAAsF;AAG/E,IAAM,uBAAuB,+BAA7B,MAAM,uBAAuB;IAGlC,YAEE,0BAA+D,EACvD,UAAsB,EACb,wBAAkD,EAClD,sBAA8C;QAHvD,+BAA0B,GAA1B,0BAA0B,CAA6B;QACvD,eAAU,GAAV,UAAU,CAAY;QACb,6BAAwB,GAAxB,wBAAwB,CAA0B;QAClD,2BAAsB,GAAtB,sBAAsB,CAAwB;QAPhD,WAAM,GAAG,IAAI,eAAM,CAAC,yBAAuB,CAAC,IAAI,CAAC,CAAC;IAQhE,CAAC;IAEJ,KAAK,CAAC,MAAM,CACV,wBAAkD;QAElD,MAAM,QAAQ,GAAG,IAAI,CAAC,0BAA0B,CAAC,MAAM,CACrD,wBAAwB,CACzB,CAAC;QACF,OAAO,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACxD,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,IAAmB;QAC/B,MAAM,KAAK,GAAsC,EAAE,CAAC;QACpD,IAAI,IAAI,EAAE,CAAC;YACT,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC;QAC7B,CAAC;QACD,OAAO,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC;YAC1C,KAAK;YACL,KAAK,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE;SAChC,CAAC,CAA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AKR,WAAA,IAAA,0BAAgB,EAAC,+BAAe,CAAC,CAAA;qCACE,oBAAU;QAC1B,oBAAU;QACa,qDAAwB;QAC1B,iDAAsB;GARtD,uBAAuB,CAmPnC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
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.CustomVariable = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const base_entity_1 = require("./base.entity");
|
|
15
|
+
let CustomVariable = class CustomVariable extends base_entity_1.BaseEntity {
|
|
16
|
+
};
|
|
17
|
+
exports.CustomVariable = CustomVariable;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, typeorm_1.Column)({ type: 'text', unique: true }),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], CustomVariable.prototype, "key", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.Column)({ type: 'text' }),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], CustomVariable.prototype, "value", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: true }),
|
|
28
|
+
__metadata("design:type", Boolean)
|
|
29
|
+
], CustomVariable.prototype, "enabled", void 0);
|
|
30
|
+
exports.CustomVariable = CustomVariable = __decorate([
|
|
31
|
+
(0, typeorm_1.Entity)('custom_variables')
|
|
32
|
+
], CustomVariable);
|
|
33
|
+
//# sourceMappingURL=custom-variable.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-variable.entity.js","sourceRoot":"","sources":["../../../src/core-entities/custom-variable.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAyC;AACzC,+CAA2C;AAGpC,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,wBAAU;CAS7C,CAAA;AATY,wCAAc;AAEzB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;2CAC3B;AAGZ;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6CACX;AAGd;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;+CAC1B;yBARN,cAAc;IAD1B,IAAA,gBAAM,EAAC,kBAAkB,CAAC;GACd,cAAc,CAS1B"}
|
|
@@ -27,4 +27,5 @@ __exportStar(require("./application-state.entity"), exports);
|
|
|
27
27
|
__exportStar(require("./context-snippet.entity"), exports);
|
|
28
28
|
__exportStar(require("./mcp-config.entity"), exports);
|
|
29
29
|
__exportStar(require("./mcp-tool.entity"), exports);
|
|
30
|
+
__exportStar(require("./custom-variable.entity"), exports);
|
|
30
31
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core-entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,mDAAiC;AACjC,mDAAiC;AACjC,4DAA0C;AAC1C,yDAAuC;AACvC,qDAAmC;AACnC,yDAAuC;AACvC,yDAAuC;AACvC,0DAAwC;AACxC,6DAA2C;AAC3C,2DAAyC;AACzC,sDAAoC;AACpC,oDAAkC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core-entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,mDAAiC;AACjC,mDAAiC;AACjC,4DAA0C;AAC1C,yDAAuC;AACvC,qDAAmC;AACnC,yDAAuC;AACvC,yDAAuC;AACvC,0DAAwC;AACxC,6DAA2C;AAC3C,2DAAyC;AACzC,sDAAoC;AACpC,oDAAkC;AAClC,2DAAyC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CustomVariablesService } from './custom-variables.service';
|
|
2
|
+
import { CreateCustomVariableDto, UpdateCustomVariableDto } from './dto/custom-variable.dto';
|
|
3
|
+
import { CustomVariable } from '../core-entities';
|
|
4
|
+
export declare class CustomVariablesController {
|
|
5
|
+
private readonly customVariablesService;
|
|
6
|
+
constructor(customVariablesService: CustomVariablesService);
|
|
7
|
+
create(createCustomVariableDto: CreateCustomVariableDto): Promise<CustomVariable>;
|
|
8
|
+
findAll(): Promise<CustomVariable[]>;
|
|
9
|
+
findOne(id: string): Promise<CustomVariable>;
|
|
10
|
+
update(id: string, updateCustomVariableDto: UpdateCustomVariableDto): Promise<CustomVariable>;
|
|
11
|
+
remove(id: string): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
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.CustomVariablesController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const custom_variables_service_1 = require("./custom-variables.service");
|
|
18
|
+
const custom_variable_dto_1 = require("./dto/custom-variable.dto");
|
|
19
|
+
let CustomVariablesController = class CustomVariablesController {
|
|
20
|
+
constructor(customVariablesService) {
|
|
21
|
+
this.customVariablesService = customVariablesService;
|
|
22
|
+
}
|
|
23
|
+
async create(createCustomVariableDto) {
|
|
24
|
+
return this.customVariablesService.create(createCustomVariableDto);
|
|
25
|
+
}
|
|
26
|
+
async findAll() {
|
|
27
|
+
return this.customVariablesService.findAll();
|
|
28
|
+
}
|
|
29
|
+
async findOne(id) {
|
|
30
|
+
return this.customVariablesService.findOne(id);
|
|
31
|
+
}
|
|
32
|
+
async update(id, updateCustomVariableDto) {
|
|
33
|
+
return this.customVariablesService.update(id, updateCustomVariableDto);
|
|
34
|
+
}
|
|
35
|
+
async remove(id) {
|
|
36
|
+
return this.customVariablesService.remove(id);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
exports.CustomVariablesController = CustomVariablesController;
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, common_1.Post)(),
|
|
42
|
+
__param(0, (0, common_1.Body)()),
|
|
43
|
+
__metadata("design:type", Function),
|
|
44
|
+
__metadata("design:paramtypes", [custom_variable_dto_1.CreateCustomVariableDto]),
|
|
45
|
+
__metadata("design:returntype", Promise)
|
|
46
|
+
], CustomVariablesController.prototype, "create", null);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, common_1.Get)(),
|
|
49
|
+
__metadata("design:type", Function),
|
|
50
|
+
__metadata("design:paramtypes", []),
|
|
51
|
+
__metadata("design:returntype", Promise)
|
|
52
|
+
], CustomVariablesController.prototype, "findAll", null);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, common_1.Get)(':id'),
|
|
55
|
+
__param(0, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
|
|
56
|
+
__metadata("design:type", Function),
|
|
57
|
+
__metadata("design:paramtypes", [String]),
|
|
58
|
+
__metadata("design:returntype", Promise)
|
|
59
|
+
], CustomVariablesController.prototype, "findOne", null);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, common_1.Put)(':id'),
|
|
62
|
+
__param(0, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
|
|
63
|
+
__param(1, (0, common_1.Body)()),
|
|
64
|
+
__metadata("design:type", Function),
|
|
65
|
+
__metadata("design:paramtypes", [String, custom_variable_dto_1.UpdateCustomVariableDto]),
|
|
66
|
+
__metadata("design:returntype", Promise)
|
|
67
|
+
], CustomVariablesController.prototype, "update", null);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, common_1.Delete)(':id'),
|
|
70
|
+
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
71
|
+
__param(0, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
|
|
72
|
+
__metadata("design:type", Function),
|
|
73
|
+
__metadata("design:paramtypes", [String]),
|
|
74
|
+
__metadata("design:returntype", Promise)
|
|
75
|
+
], CustomVariablesController.prototype, "remove", null);
|
|
76
|
+
exports.CustomVariablesController = CustomVariablesController = __decorate([
|
|
77
|
+
(0, common_1.Controller)('custom-variables'),
|
|
78
|
+
__metadata("design:paramtypes", [custom_variables_service_1.CustomVariablesService])
|
|
79
|
+
], CustomVariablesController);
|
|
80
|
+
//# sourceMappingURL=custom-variables.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-variables.controller.js","sourceRoot":"","sources":["../../../src/custom-variables/custom-variables.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAWwB;AACxB,yEAAoE;AACpE,mEAGmC;AAI5B,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;IACpC,YACmB,sBAA8C;QAA9C,2BAAsB,GAAtB,sBAAsB,CAAwB;IAC9D,CAAC;IAGE,AAAN,KAAK,CAAC,MAAM,CACF,uBAAgD;QAExD,OAAO,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC;IACrE,CAAC;IAGK,AAAN,KAAK,CAAC,OAAO;QACX,OAAO,IAAI,CAAC,sBAAsB,CAAC,OAAO,EAAE,CAAC;IAC/C,CAAC;IAGK,AAAN,KAAK,CAAC,OAAO,CACiB,EAAU;QAEtC,OAAO,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACjD,CAAC;IAGK,AAAN,KAAK,CAAC,MAAM,CACkB,EAAU,EAC9B,uBAAgD;QAExD,OAAO,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,EAAE,EAAE,uBAAuB,CAAC,CAAC;IACzE,CAAC;IAIK,AAAN,KAAK,CAAC,MAAM,CAA6B,EAAU;QACjD,OAAO,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAChD,CAAC;CACF,CAAA;AArCY,8DAAyB;AAM9B;IADL,IAAA,aAAI,GAAE;IAEJ,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAA0B,6CAAuB;;uDAGzD;AAGK;IADL,IAAA,YAAG,GAAE;;;;wDAGL;AAGK;IADL,IAAA,YAAG,EAAC,KAAK,CAAC;IAER,WAAA,IAAA,cAAK,EAAC,IAAI,EAAE,sBAAa,CAAC,CAAA;;;;wDAG5B;AAGK;IADL,IAAA,YAAG,EAAC,KAAK,CAAC;IAER,WAAA,IAAA,cAAK,EAAC,IAAI,EAAE,sBAAa,CAAC,CAAA;IAC1B,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAA0B,6CAAuB;;uDAGzD;AAIK;IAFL,IAAA,eAAM,EAAC,KAAK,CAAC;IACb,IAAA,iBAAQ,EAAC,mBAAU,CAAC,UAAU,CAAC;IAClB,WAAA,IAAA,cAAK,EAAC,IAAI,EAAE,sBAAa,CAAC,CAAA;;;;uDAEvC;oCApCU,yBAAyB;IADrC,IAAA,mBAAU,EAAC,kBAAkB,CAAC;qCAGc,iDAAsB;GAFtD,yBAAyB,CAqCrC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
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.CustomVariablesModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
12
|
+
const core_entities_1 = require("../core-entities");
|
|
13
|
+
const custom_variables_service_1 = require("./custom-variables.service");
|
|
14
|
+
const custom_variables_controller_1 = require("./custom-variables.controller");
|
|
15
|
+
let CustomVariablesModule = class CustomVariablesModule {
|
|
16
|
+
};
|
|
17
|
+
exports.CustomVariablesModule = CustomVariablesModule;
|
|
18
|
+
exports.CustomVariablesModule = CustomVariablesModule = __decorate([
|
|
19
|
+
(0, common_1.Module)({
|
|
20
|
+
imports: [typeorm_1.TypeOrmModule.forFeature([core_entities_1.CustomVariable])],
|
|
21
|
+
controllers: [custom_variables_controller_1.CustomVariablesController],
|
|
22
|
+
providers: [custom_variables_service_1.CustomVariablesService],
|
|
23
|
+
exports: [custom_variables_service_1.CustomVariablesService],
|
|
24
|
+
})
|
|
25
|
+
], CustomVariablesModule);
|
|
26
|
+
//# sourceMappingURL=custom-variables.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-variables.module.js","sourceRoot":"","sources":["../../../src/custom-variables/custom-variables.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,oDAAkD;AAClD,yEAAoE;AACpE,+EAA0E;AAQnE,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;CAAG,CAAA;AAAxB,sDAAqB;gCAArB,qBAAqB;IANjC,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,CAAC,8BAAc,CAAC,CAAC,CAAC;QACrD,WAAW,EAAE,CAAC,uDAAyB,CAAC;QACxC,SAAS,EAAE,CAAC,iDAAsB,CAAC;QACnC,OAAO,EAAE,CAAC,iDAAsB,CAAC;KAClC,CAAC;GACW,qBAAqB,CAAG"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Repository } from 'typeorm';
|
|
2
|
+
import { CustomVariable } from '../core-entities';
|
|
3
|
+
import { CreateCustomVariableDto, UpdateCustomVariableDto } from './dto/custom-variable.dto';
|
|
4
|
+
export declare class CustomVariablesService {
|
|
5
|
+
private customVariablesRepository;
|
|
6
|
+
constructor(customVariablesRepository: Repository<CustomVariable>);
|
|
7
|
+
create(createCustomVariableDto: CreateCustomVariableDto): Promise<CustomVariable>;
|
|
8
|
+
findAll(): Promise<CustomVariable[]>;
|
|
9
|
+
findAllEnabled(): Promise<CustomVariable[]>;
|
|
10
|
+
findOne(id: string): Promise<CustomVariable>;
|
|
11
|
+
update(id: string, updateCustomVariableDto: UpdateCustomVariableDto): Promise<CustomVariable>;
|
|
12
|
+
remove(id: string): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
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.CustomVariablesService = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
|
+
const typeorm_2 = require("typeorm");
|
|
19
|
+
const core_entities_1 = require("../core-entities");
|
|
20
|
+
let CustomVariablesService = class CustomVariablesService {
|
|
21
|
+
constructor(customVariablesRepository) {
|
|
22
|
+
this.customVariablesRepository = customVariablesRepository;
|
|
23
|
+
}
|
|
24
|
+
async create(createCustomVariableDto) {
|
|
25
|
+
const variable = this.customVariablesRepository.create(createCustomVariableDto);
|
|
26
|
+
return this.customVariablesRepository.save(variable);
|
|
27
|
+
}
|
|
28
|
+
async findAll() {
|
|
29
|
+
return this.customVariablesRepository.find({ order: { key: 'ASC' } });
|
|
30
|
+
}
|
|
31
|
+
async findAllEnabled() {
|
|
32
|
+
return this.customVariablesRepository.find({
|
|
33
|
+
where: { enabled: true },
|
|
34
|
+
order: { key: 'ASC' },
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
async findOne(id) {
|
|
38
|
+
const variable = await this.customVariablesRepository.findOneBy({ id });
|
|
39
|
+
if (!variable) {
|
|
40
|
+
throw new common_1.NotFoundException(`CustomVariable with ID "${id}" not found`);
|
|
41
|
+
}
|
|
42
|
+
return variable;
|
|
43
|
+
}
|
|
44
|
+
async update(id, updateCustomVariableDto) {
|
|
45
|
+
const variable = await this.findOne(id);
|
|
46
|
+
this.customVariablesRepository.merge(variable, updateCustomVariableDto);
|
|
47
|
+
return this.customVariablesRepository.save(variable);
|
|
48
|
+
}
|
|
49
|
+
async remove(id) {
|
|
50
|
+
const variable = await this.findOne(id);
|
|
51
|
+
await this.customVariablesRepository.remove(variable);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
exports.CustomVariablesService = CustomVariablesService;
|
|
55
|
+
exports.CustomVariablesService = CustomVariablesService = __decorate([
|
|
56
|
+
(0, common_1.Injectable)(),
|
|
57
|
+
__param(0, (0, typeorm_1.InjectRepository)(core_entities_1.CustomVariable)),
|
|
58
|
+
__metadata("design:paramtypes", [typeorm_2.Repository])
|
|
59
|
+
], CustomVariablesService);
|
|
60
|
+
//# sourceMappingURL=custom-variables.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-variables.service.js","sourceRoot":"","sources":["../../../src/custom-variables/custom-variables.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA+D;AAC/D,6CAAmD;AACnD,qCAAqC;AACrC,oDAAkD;AAO3C,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IACjC,YAEU,yBAAqD;QAArD,8BAAyB,GAAzB,yBAAyB,CAA4B;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