claudeship 0.2.12 → 0.2.15
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/README.md +18 -0
- package/apps/server/dist/app.module.js +10 -0
- package/apps/server/dist/app.module.js.map +1 -1
- package/apps/server/dist/chat/prompts/fullstack-express-prompt.d.ts +1 -1
- package/apps/server/dist/chat/prompts/fullstack-express-prompt.js +109 -1
- package/apps/server/dist/chat/prompts/fullstack-express-prompt.js.map +1 -1
- package/apps/server/dist/chat/prompts/fullstack-fastapi-prompt.d.ts +1 -1
- package/apps/server/dist/chat/prompts/fullstack-fastapi-prompt.js +109 -1
- package/apps/server/dist/chat/prompts/fullstack-fastapi-prompt.js.map +1 -1
- package/apps/server/dist/chat/prompts/web-system-prompt.d.ts +1 -1
- package/apps/server/dist/chat/prompts/web-system-prompt.js +156 -0
- package/apps/server/dist/chat/prompts/web-system-prompt.js.map +1 -1
- package/apps/server/dist/checkpoint/checkpoint.controller.d.ts +19 -0
- package/apps/server/dist/checkpoint/checkpoint.controller.js +93 -0
- package/apps/server/dist/checkpoint/checkpoint.controller.js.map +1 -0
- package/apps/server/dist/checkpoint/checkpoint.module.d.ts +2 -0
- package/apps/server/dist/checkpoint/checkpoint.module.js +25 -0
- package/apps/server/dist/checkpoint/checkpoint.module.js.map +1 -0
- package/apps/server/dist/checkpoint/checkpoint.service.d.ts +41 -0
- package/apps/server/dist/checkpoint/checkpoint.service.js +261 -0
- package/apps/server/dist/checkpoint/checkpoint.service.js.map +1 -0
- package/apps/server/dist/database/database.controller.d.ts +23 -0
- package/apps/server/dist/database/database.controller.js +109 -0
- package/apps/server/dist/database/database.controller.js.map +1 -0
- package/apps/server/dist/database/database.module.d.ts +2 -0
- package/apps/server/dist/database/database.module.js +25 -0
- package/apps/server/dist/database/database.module.js.map +1 -0
- package/apps/server/dist/database/database.service.d.ts +32 -0
- package/apps/server/dist/database/database.service.js +238 -0
- package/apps/server/dist/database/database.service.js.map +1 -0
- package/apps/server/dist/env/env.controller.d.ts +14 -0
- package/apps/server/dist/env/env.controller.js +84 -0
- package/apps/server/dist/env/env.controller.js.map +1 -0
- package/apps/server/dist/env/env.module.d.ts +2 -0
- package/apps/server/dist/env/env.module.js +25 -0
- package/apps/server/dist/env/env.module.js.map +1 -0
- package/apps/server/dist/env/env.service.d.ts +21 -0
- package/apps/server/dist/env/env.service.js +194 -0
- package/apps/server/dist/env/env.service.js.map +1 -0
- package/apps/server/dist/preview/preview.controller.d.ts +5 -0
- package/apps/server/dist/preview/preview.controller.js +41 -0
- package/apps/server/dist/preview/preview.controller.js.map +1 -1
- package/apps/server/dist/preview/preview.service.d.ts +20 -0
- package/apps/server/dist/preview/preview.service.js +51 -2
- package/apps/server/dist/preview/preview.service.js.map +1 -1
- package/apps/server/dist/project/project.controller.d.ts +10 -1
- package/apps/server/dist/project/project.controller.js +57 -0
- package/apps/server/dist/project/project.controller.js.map +1 -1
- package/apps/server/dist/project/project.service.d.ts +15 -0
- package/apps/server/dist/project/project.service.js +111 -0
- package/apps/server/dist/project/project.service.js.map +1 -1
- package/apps/server/dist/project-context/project-context.controller.d.ts +42 -0
- package/apps/server/dist/project-context/project-context.controller.js +127 -0
- package/apps/server/dist/project-context/project-context.controller.js.map +1 -0
- package/apps/server/dist/project-context/project-context.module.d.ts +2 -0
- package/apps/server/dist/project-context/project-context.module.js +25 -0
- package/apps/server/dist/project-context/project-context.module.js.map +1 -0
- package/apps/server/dist/project-context/project-context.service.d.ts +36 -0
- package/apps/server/dist/project-context/project-context.service.js +260 -0
- package/apps/server/dist/project-context/project-context.service.js.map +1 -0
- package/apps/server/dist/testing/testing.controller.d.ts +24 -0
- package/apps/server/dist/testing/testing.controller.js +126 -0
- package/apps/server/dist/testing/testing.controller.js.map +1 -0
- package/apps/server/dist/testing/testing.module.d.ts +2 -0
- package/apps/server/dist/testing/testing.module.js +26 -0
- package/apps/server/dist/testing/testing.module.js.map +1 -0
- package/apps/server/dist/testing/testing.service.d.ts +62 -0
- package/apps/server/dist/testing/testing.service.js +269 -0
- package/apps/server/dist/testing/testing.service.js.map +1 -0
- package/apps/server/dist/tsconfig.tsbuildinfo +1 -1
- package/apps/server/package.json +1 -1
- package/apps/web/.next/BUILD_ID +1 -1
- package/apps/web/.next/app-build-manifest.json +5 -5
- package/apps/web/.next/build-manifest.json +2 -2
- package/apps/web/.next/cache/.previewinfo +1 -1
- package/apps/web/.next/cache/.rscinfo +1 -1
- package/apps/web/.next/cache/.tsbuildinfo +1 -1
- package/apps/web/.next/cache/config.json +3 -3
- package/apps/web/.next/cache/eslint/.cache_j3uhuz +1 -1
- package/apps/web/.next/cache/webpack/client-production/0.pack +0 -0
- package/apps/web/.next/cache/webpack/client-production/index.pack +0 -0
- package/apps/web/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/apps/web/.next/cache/webpack/server-production/0.pack +0 -0
- package/apps/web/.next/cache/webpack/server-production/index.pack +0 -0
- package/apps/web/.next/prerender-manifest.json +10 -10
- package/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/apps/web/.next/server/app/_not-found.html +1 -1
- package/apps/web/.next/server/app/_not-found.rsc +2 -2
- package/apps/web/.next/server/app/index.html +1 -1
- package/apps/web/.next/server/app/index.rsc +3 -3
- package/apps/web/.next/server/app/page.js +2 -2
- package/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/apps/web/.next/server/app/project/[id]/page.js +2 -2
- package/apps/web/.next/server/app/project/[id]/page_client-reference-manifest.js +1 -1
- package/apps/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/apps/web/.next/server/app/settings.html +1 -1
- package/apps/web/.next/server/app/settings.rsc +3 -3
- package/apps/web/.next/server/chunks/392.js +1 -1
- package/apps/web/.next/server/pages/404.html +1 -1
- package/apps/web/.next/server/pages/500.html +1 -1
- package/apps/web/.next/server/server-reference-manifest.json +1 -1
- package/apps/web/.next/static/chunks/574-1fe2bcd6cfb41646.js +1 -0
- package/apps/web/.next/static/chunks/app/page-f19cfa58541ca83d.js +1 -0
- package/apps/web/.next/static/chunks/app/project/[id]/page-dffaa1d02f012216.js +1 -0
- package/apps/web/.next/static/chunks/app/settings/page-d1318c2fd58729a5.js +1 -0
- package/apps/web/.next/static/css/0a24552d9794f8c8.css +3 -0
- package/apps/web/.next/trace +18 -17
- package/apps/web/node_modules/.bin/eslint +2 -2
- package/apps/web/package.json +2 -1
- package/apps/web/src/components/checkpoint/CheckpointPanel.tsx +384 -0
- package/apps/web/src/components/database/DatabasePanel.tsx +405 -0
- package/apps/web/src/components/env/EnvPanel.tsx +356 -0
- package/apps/web/src/components/preview/ConsoleViewer.tsx +270 -0
- package/apps/web/src/components/preview/ErrorOverlay.tsx +189 -0
- package/apps/web/src/components/preview/PreviewPanel.tsx +148 -6
- package/apps/web/src/components/testing/TestRunner.tsx +481 -0
- package/apps/web/src/components/ui/tabs.tsx +55 -0
- package/apps/web/src/components/visual-editor/VisualEditor.tsx +382 -0
- package/apps/web/src/components/workspace/WorkspaceLayout.tsx +66 -4
- package/apps/web/src/lib/api.ts +5 -2
- package/package.json +1 -1
- package/apps/web/.next/static/chunks/298-6f3d6b321c288cd3.js +0 -1
- package/apps/web/.next/static/chunks/app/page-3d093f7f480a8599.js +0 -1
- package/apps/web/.next/static/chunks/app/project/[id]/page-e5cda6f9050b0a52.js +0 -1
- package/apps/web/.next/static/chunks/app/settings/page-92d28565c3d8c755.js +0 -1
- package/apps/web/.next/static/css/8f946046a2047594.css +0 -3
- /package/apps/web/.next/static/{aXT20mSdxaem1-z8VH2F1 → mkY_TTl_ho_ehDKiX10AN}/_buildManifest.js +0 -0
- /package/apps/web/.next/static/{aXT20mSdxaem1-z8VH2F1 → mkY_TTl_ho_ehDKiX10AN}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DatabaseService } from "./database.service";
|
|
2
|
+
export declare class DatabaseController {
|
|
3
|
+
private readonly databaseService;
|
|
4
|
+
constructor(databaseService: DatabaseService);
|
|
5
|
+
getTables(projectId: string): Promise<import("./database.service").TableInfo[]>;
|
|
6
|
+
getTableSchema(projectId: string, tableName: string): Promise<import("./database.service").ColumnInfo[]>;
|
|
7
|
+
getTableData(projectId: string, tableName: string, page?: string, pageSize?: string): Promise<import("./database.service").TableData>;
|
|
8
|
+
executeQuery(projectId: string, body: {
|
|
9
|
+
query: string;
|
|
10
|
+
}): Promise<Record<string, unknown>[]>;
|
|
11
|
+
insertRow(projectId: string, tableName: string, body: {
|
|
12
|
+
data: Record<string, unknown>;
|
|
13
|
+
}): Promise<void>;
|
|
14
|
+
updateRow(projectId: string, tableName: string, body: {
|
|
15
|
+
primaryKey: string;
|
|
16
|
+
primaryKeyValue: unknown;
|
|
17
|
+
data: Record<string, unknown>;
|
|
18
|
+
}): Promise<void>;
|
|
19
|
+
deleteRow(projectId: string, tableName: string, body: {
|
|
20
|
+
primaryKey: string;
|
|
21
|
+
primaryKeyValue: unknown;
|
|
22
|
+
}): Promise<void>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
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.DatabaseController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const database_service_1 = require("./database.service");
|
|
18
|
+
let DatabaseController = class DatabaseController {
|
|
19
|
+
constructor(databaseService) {
|
|
20
|
+
this.databaseService = databaseService;
|
|
21
|
+
}
|
|
22
|
+
getTables(projectId) {
|
|
23
|
+
return this.databaseService.getTables(projectId);
|
|
24
|
+
}
|
|
25
|
+
getTableSchema(projectId, tableName) {
|
|
26
|
+
return this.databaseService.getTableSchema(projectId, tableName);
|
|
27
|
+
}
|
|
28
|
+
getTableData(projectId, tableName, page, pageSize) {
|
|
29
|
+
return this.databaseService.getTableData(projectId, tableName, page ? parseInt(page, 10) : 1, pageSize ? parseInt(pageSize, 10) : 50);
|
|
30
|
+
}
|
|
31
|
+
executeQuery(projectId, body) {
|
|
32
|
+
return this.databaseService.executeQuery(projectId, body.query);
|
|
33
|
+
}
|
|
34
|
+
insertRow(projectId, tableName, body) {
|
|
35
|
+
return this.databaseService.insertRow(projectId, tableName, body.data);
|
|
36
|
+
}
|
|
37
|
+
updateRow(projectId, tableName, body) {
|
|
38
|
+
return this.databaseService.updateRow(projectId, tableName, body.primaryKey, body.primaryKeyValue, body.data);
|
|
39
|
+
}
|
|
40
|
+
deleteRow(projectId, tableName, body) {
|
|
41
|
+
return this.databaseService.deleteRow(projectId, tableName, body.primaryKey, body.primaryKeyValue);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
exports.DatabaseController = DatabaseController;
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, common_1.Get)("tables"),
|
|
47
|
+
__param(0, (0, common_1.Param)("projectId")),
|
|
48
|
+
__metadata("design:type", Function),
|
|
49
|
+
__metadata("design:paramtypes", [String]),
|
|
50
|
+
__metadata("design:returntype", void 0)
|
|
51
|
+
], DatabaseController.prototype, "getTables", null);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, common_1.Get)("tables/:tableName/schema"),
|
|
54
|
+
__param(0, (0, common_1.Param)("projectId")),
|
|
55
|
+
__param(1, (0, common_1.Param)("tableName")),
|
|
56
|
+
__metadata("design:type", Function),
|
|
57
|
+
__metadata("design:paramtypes", [String, String]),
|
|
58
|
+
__metadata("design:returntype", void 0)
|
|
59
|
+
], DatabaseController.prototype, "getTableSchema", null);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, common_1.Get)("tables/:tableName/data"),
|
|
62
|
+
__param(0, (0, common_1.Param)("projectId")),
|
|
63
|
+
__param(1, (0, common_1.Param)("tableName")),
|
|
64
|
+
__param(2, (0, common_1.Query)("page")),
|
|
65
|
+
__param(3, (0, common_1.Query)("pageSize")),
|
|
66
|
+
__metadata("design:type", Function),
|
|
67
|
+
__metadata("design:paramtypes", [String, String, String, String]),
|
|
68
|
+
__metadata("design:returntype", void 0)
|
|
69
|
+
], DatabaseController.prototype, "getTableData", null);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, common_1.Post)("query"),
|
|
72
|
+
__param(0, (0, common_1.Param)("projectId")),
|
|
73
|
+
__param(1, (0, common_1.Body)()),
|
|
74
|
+
__metadata("design:type", Function),
|
|
75
|
+
__metadata("design:paramtypes", [String, Object]),
|
|
76
|
+
__metadata("design:returntype", void 0)
|
|
77
|
+
], DatabaseController.prototype, "executeQuery", null);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, common_1.Post)("tables/:tableName/rows"),
|
|
80
|
+
__param(0, (0, common_1.Param)("projectId")),
|
|
81
|
+
__param(1, (0, common_1.Param)("tableName")),
|
|
82
|
+
__param(2, (0, common_1.Body)()),
|
|
83
|
+
__metadata("design:type", Function),
|
|
84
|
+
__metadata("design:paramtypes", [String, String, Object]),
|
|
85
|
+
__metadata("design:returntype", void 0)
|
|
86
|
+
], DatabaseController.prototype, "insertRow", null);
|
|
87
|
+
__decorate([
|
|
88
|
+
(0, common_1.Put)("tables/:tableName/rows"),
|
|
89
|
+
__param(0, (0, common_1.Param)("projectId")),
|
|
90
|
+
__param(1, (0, common_1.Param)("tableName")),
|
|
91
|
+
__param(2, (0, common_1.Body)()),
|
|
92
|
+
__metadata("design:type", Function),
|
|
93
|
+
__metadata("design:paramtypes", [String, String, Object]),
|
|
94
|
+
__metadata("design:returntype", void 0)
|
|
95
|
+
], DatabaseController.prototype, "updateRow", null);
|
|
96
|
+
__decorate([
|
|
97
|
+
(0, common_1.Delete)("tables/:tableName/rows"),
|
|
98
|
+
__param(0, (0, common_1.Param)("projectId")),
|
|
99
|
+
__param(1, (0, common_1.Param)("tableName")),
|
|
100
|
+
__param(2, (0, common_1.Body)()),
|
|
101
|
+
__metadata("design:type", Function),
|
|
102
|
+
__metadata("design:paramtypes", [String, String, Object]),
|
|
103
|
+
__metadata("design:returntype", void 0)
|
|
104
|
+
], DatabaseController.prototype, "deleteRow", null);
|
|
105
|
+
exports.DatabaseController = DatabaseController = __decorate([
|
|
106
|
+
(0, common_1.Controller)("projects/:projectId/database"),
|
|
107
|
+
__metadata("design:paramtypes", [database_service_1.DatabaseService])
|
|
108
|
+
], DatabaseController);
|
|
109
|
+
//# sourceMappingURL=database.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database.controller.js","sourceRoot":"","sources":["../../src/database/database.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CASwB;AACxB,yDAAqD;AAG9C,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC7B,YAA6B,eAAgC;QAAhC,oBAAe,GAAf,eAAe,CAAiB;IAAG,CAAC;IAGjE,SAAS,CAAqB,SAAiB;QAC7C,OAAO,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IACnD,CAAC;IAGD,cAAc,CACQ,SAAiB,EACjB,SAAiB;QAErC,OAAO,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;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, 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.DatabaseModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const database_controller_1 = require("./database.controller");
|
|
12
|
+
const database_service_1 = require("./database.service");
|
|
13
|
+
const project_module_1 = require("../project/project.module");
|
|
14
|
+
let DatabaseModule = class DatabaseModule {
|
|
15
|
+
};
|
|
16
|
+
exports.DatabaseModule = DatabaseModule;
|
|
17
|
+
exports.DatabaseModule = DatabaseModule = __decorate([
|
|
18
|
+
(0, common_1.Module)({
|
|
19
|
+
imports: [project_module_1.ProjectModule],
|
|
20
|
+
controllers: [database_controller_1.DatabaseController],
|
|
21
|
+
providers: [database_service_1.DatabaseService],
|
|
22
|
+
exports: [database_service_1.DatabaseService],
|
|
23
|
+
})
|
|
24
|
+
], DatabaseModule);
|
|
25
|
+
//# sourceMappingURL=database.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database.module.js","sourceRoot":"","sources":["../../src/database/database.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,+DAA2D;AAC3D,yDAAqD;AACrD,8DAA0D;AAQnD,IAAM,cAAc,GAApB,MAAM,cAAc;CAAG,CAAA;AAAjB,wCAAc;yBAAd,cAAc;IAN1B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,8BAAa,CAAC;QACxB,WAAW,EAAE,CAAC,wCAAkB,CAAC;QACjC,SAAS,EAAE,CAAC,kCAAe,CAAC;QAC5B,OAAO,EAAE,CAAC,kCAAe,CAAC;KAC3B,CAAC;GACW,cAAc,CAAG"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ProjectService } from "../project/project.service";
|
|
2
|
+
export interface TableInfo {
|
|
3
|
+
name: string;
|
|
4
|
+
rowCount: number;
|
|
5
|
+
}
|
|
6
|
+
export interface ColumnInfo {
|
|
7
|
+
name: string;
|
|
8
|
+
type: string;
|
|
9
|
+
nullable: boolean;
|
|
10
|
+
primaryKey: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface TableData {
|
|
13
|
+
columns: ColumnInfo[];
|
|
14
|
+
rows: Record<string, unknown>[];
|
|
15
|
+
total: number;
|
|
16
|
+
page: number;
|
|
17
|
+
pageSize: number;
|
|
18
|
+
}
|
|
19
|
+
export declare class DatabaseService {
|
|
20
|
+
private projectService;
|
|
21
|
+
private readonly logger;
|
|
22
|
+
constructor(projectService: ProjectService);
|
|
23
|
+
private findDatabasePath;
|
|
24
|
+
private executeSqlite;
|
|
25
|
+
getTables(projectId: string): Promise<TableInfo[]>;
|
|
26
|
+
getTableSchema(projectId: string, tableName: string): Promise<ColumnInfo[]>;
|
|
27
|
+
getTableData(projectId: string, tableName: string, page?: number, pageSize?: number): Promise<TableData>;
|
|
28
|
+
executeQuery(projectId: string, query: string): Promise<Record<string, unknown>[]>;
|
|
29
|
+
insertRow(projectId: string, tableName: string, data: Record<string, unknown>): Promise<void>;
|
|
30
|
+
updateRow(projectId: string, tableName: string, primaryKey: string, primaryKeyValue: unknown, data: Record<string, unknown>): Promise<void>;
|
|
31
|
+
deleteRow(projectId: string, tableName: string, primaryKey: string, primaryKeyValue: unknown): Promise<void>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,238 @@
|
|
|
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 DatabaseService_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.DatabaseService = void 0;
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const project_service_1 = require("../project/project.service");
|
|
16
|
+
const child_process_1 = require("child_process");
|
|
17
|
+
const path = require("path");
|
|
18
|
+
const fs = require("fs");
|
|
19
|
+
let DatabaseService = DatabaseService_1 = class DatabaseService {
|
|
20
|
+
constructor(projectService) {
|
|
21
|
+
this.projectService = projectService;
|
|
22
|
+
this.logger = new common_1.Logger(DatabaseService_1.name);
|
|
23
|
+
}
|
|
24
|
+
async findDatabasePath(projectId) {
|
|
25
|
+
const projectPath = await this.projectService.getProjectPath(projectId);
|
|
26
|
+
const possiblePaths = [
|
|
27
|
+
path.join(projectPath, "prisma", "dev.db"),
|
|
28
|
+
path.join(projectPath, "dev.db"),
|
|
29
|
+
path.join(projectPath, "database.db"),
|
|
30
|
+
path.join(projectPath, "data.db"),
|
|
31
|
+
path.join(projectPath, "backend", "prisma", "dev.db"),
|
|
32
|
+
path.join(projectPath, "backend", "dev.db"),
|
|
33
|
+
];
|
|
34
|
+
for (const dbPath of possiblePaths) {
|
|
35
|
+
if (fs.existsSync(dbPath)) {
|
|
36
|
+
return dbPath;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
executeSqlite(dbPath, query) {
|
|
42
|
+
return new Promise((resolve, reject) => {
|
|
43
|
+
const proc = (0, child_process_1.spawn)("sqlite3", ["-json", "-header", dbPath, query], {
|
|
44
|
+
shell: true,
|
|
45
|
+
});
|
|
46
|
+
let stdout = "";
|
|
47
|
+
let stderr = "";
|
|
48
|
+
proc.stdout?.on("data", (data) => {
|
|
49
|
+
stdout += data.toString();
|
|
50
|
+
});
|
|
51
|
+
proc.stderr?.on("data", (data) => {
|
|
52
|
+
stderr += data.toString();
|
|
53
|
+
});
|
|
54
|
+
proc.on("close", (code) => {
|
|
55
|
+
if (code === 0) {
|
|
56
|
+
resolve(stdout);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
reject(new Error(stderr || `sqlite3 exited with code ${code}`));
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
proc.on("error", (err) => {
|
|
63
|
+
reject(err);
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
async getTables(projectId) {
|
|
68
|
+
const dbPath = await this.findDatabasePath(projectId);
|
|
69
|
+
if (!dbPath) {
|
|
70
|
+
throw new common_1.NotFoundException("No SQLite database found in project");
|
|
71
|
+
}
|
|
72
|
+
try {
|
|
73
|
+
const tablesQuery = `SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%' AND name NOT LIKE '_prisma_%';`;
|
|
74
|
+
const result = await this.executeSqlite(dbPath, tablesQuery);
|
|
75
|
+
if (!result.trim()) {
|
|
76
|
+
return [];
|
|
77
|
+
}
|
|
78
|
+
const tables = JSON.parse(result);
|
|
79
|
+
const tableInfos = [];
|
|
80
|
+
for (const table of tables) {
|
|
81
|
+
try {
|
|
82
|
+
const countResult = await this.executeSqlite(dbPath, `SELECT COUNT(*) as count FROM "${table.name}";`);
|
|
83
|
+
const countData = JSON.parse(countResult);
|
|
84
|
+
tableInfos.push({
|
|
85
|
+
name: table.name,
|
|
86
|
+
rowCount: countData[0]?.count || 0,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
tableInfos.push({ name: table.name, rowCount: 0 });
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return tableInfos;
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
this.logger.error(`Failed to get tables: ${error}`);
|
|
97
|
+
throw new common_1.BadRequestException("Failed to read database");
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
async getTableSchema(projectId, tableName) {
|
|
101
|
+
const dbPath = await this.findDatabasePath(projectId);
|
|
102
|
+
if (!dbPath) {
|
|
103
|
+
throw new common_1.NotFoundException("No SQLite database found in project");
|
|
104
|
+
}
|
|
105
|
+
try {
|
|
106
|
+
const result = await this.executeSqlite(dbPath, `PRAGMA table_info("${tableName}");`);
|
|
107
|
+
if (!result.trim()) {
|
|
108
|
+
return [];
|
|
109
|
+
}
|
|
110
|
+
const columns = JSON.parse(result);
|
|
111
|
+
return columns.map((col) => ({
|
|
112
|
+
name: col.name,
|
|
113
|
+
type: col.type,
|
|
114
|
+
nullable: col.notnull === 0,
|
|
115
|
+
primaryKey: col.pk === 1,
|
|
116
|
+
}));
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
this.logger.error(`Failed to get table schema: ${error}`);
|
|
120
|
+
throw new common_1.BadRequestException("Failed to read table schema");
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
async getTableData(projectId, tableName, page = 1, pageSize = 50) {
|
|
124
|
+
const dbPath = await this.findDatabasePath(projectId);
|
|
125
|
+
if (!dbPath) {
|
|
126
|
+
throw new common_1.NotFoundException("No SQLite database found in project");
|
|
127
|
+
}
|
|
128
|
+
const offset = (page - 1) * pageSize;
|
|
129
|
+
try {
|
|
130
|
+
const columns = await this.getTableSchema(projectId, tableName);
|
|
131
|
+
const countResult = await this.executeSqlite(dbPath, `SELECT COUNT(*) as count FROM "${tableName}";`);
|
|
132
|
+
const total = JSON.parse(countResult)[0]?.count || 0;
|
|
133
|
+
const dataResult = await this.executeSqlite(dbPath, `SELECT * FROM "${tableName}" LIMIT ${pageSize} OFFSET ${offset};`);
|
|
134
|
+
let rows = [];
|
|
135
|
+
if (dataResult.trim()) {
|
|
136
|
+
rows = JSON.parse(dataResult);
|
|
137
|
+
}
|
|
138
|
+
return {
|
|
139
|
+
columns,
|
|
140
|
+
rows,
|
|
141
|
+
total,
|
|
142
|
+
page,
|
|
143
|
+
pageSize,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
this.logger.error(`Failed to get table data: ${error}`);
|
|
148
|
+
throw new common_1.BadRequestException("Failed to read table data");
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
async executeQuery(projectId, query) {
|
|
152
|
+
const dbPath = await this.findDatabasePath(projectId);
|
|
153
|
+
if (!dbPath) {
|
|
154
|
+
throw new common_1.NotFoundException("No SQLite database found in project");
|
|
155
|
+
}
|
|
156
|
+
const normalizedQuery = query.trim().toUpperCase();
|
|
157
|
+
if (normalizedQuery.includes("DROP TABLE") ||
|
|
158
|
+
normalizedQuery.includes("DROP DATABASE") ||
|
|
159
|
+
normalizedQuery.includes("TRUNCATE")) {
|
|
160
|
+
throw new common_1.BadRequestException("Destructive queries are not allowed");
|
|
161
|
+
}
|
|
162
|
+
try {
|
|
163
|
+
const result = await this.executeSqlite(dbPath, query);
|
|
164
|
+
if (!result.trim()) {
|
|
165
|
+
return [];
|
|
166
|
+
}
|
|
167
|
+
return JSON.parse(result);
|
|
168
|
+
}
|
|
169
|
+
catch (error) {
|
|
170
|
+
this.logger.error(`Query execution failed: ${error}`);
|
|
171
|
+
throw new common_1.BadRequestException(`Query failed: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
async insertRow(projectId, tableName, data) {
|
|
175
|
+
const dbPath = await this.findDatabasePath(projectId);
|
|
176
|
+
if (!dbPath) {
|
|
177
|
+
throw new common_1.NotFoundException("No SQLite database found in project");
|
|
178
|
+
}
|
|
179
|
+
const columns = Object.keys(data).join('", "');
|
|
180
|
+
const values = Object.values(data)
|
|
181
|
+
.map((v) => (typeof v === "string" ? `'${v.replace(/'/g, "''")}'` : v))
|
|
182
|
+
.join(", ");
|
|
183
|
+
const query = `INSERT INTO "${tableName}" ("${columns}") VALUES (${values});`;
|
|
184
|
+
try {
|
|
185
|
+
await this.executeSqlite(dbPath, query);
|
|
186
|
+
}
|
|
187
|
+
catch (error) {
|
|
188
|
+
this.logger.error(`Insert failed: ${error}`);
|
|
189
|
+
throw new common_1.BadRequestException("Failed to insert row");
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
async updateRow(projectId, tableName, primaryKey, primaryKeyValue, data) {
|
|
193
|
+
const dbPath = await this.findDatabasePath(projectId);
|
|
194
|
+
if (!dbPath) {
|
|
195
|
+
throw new common_1.NotFoundException("No SQLite database found in project");
|
|
196
|
+
}
|
|
197
|
+
const setClause = Object.entries(data)
|
|
198
|
+
.map(([key, value]) => {
|
|
199
|
+
const formattedValue = typeof value === "string" ? `'${value.replace(/'/g, "''")}'` : value;
|
|
200
|
+
return `"${key}" = ${formattedValue}`;
|
|
201
|
+
})
|
|
202
|
+
.join(", ");
|
|
203
|
+
const pkValue = typeof primaryKeyValue === "string"
|
|
204
|
+
? `'${primaryKeyValue.replace(/'/g, "''")}'`
|
|
205
|
+
: primaryKeyValue;
|
|
206
|
+
const query = `UPDATE "${tableName}" SET ${setClause} WHERE "${primaryKey}" = ${pkValue};`;
|
|
207
|
+
try {
|
|
208
|
+
await this.executeSqlite(dbPath, query);
|
|
209
|
+
}
|
|
210
|
+
catch (error) {
|
|
211
|
+
this.logger.error(`Update failed: ${error}`);
|
|
212
|
+
throw new common_1.BadRequestException("Failed to update row");
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
async deleteRow(projectId, tableName, primaryKey, primaryKeyValue) {
|
|
216
|
+
const dbPath = await this.findDatabasePath(projectId);
|
|
217
|
+
if (!dbPath) {
|
|
218
|
+
throw new common_1.NotFoundException("No SQLite database found in project");
|
|
219
|
+
}
|
|
220
|
+
const pkValue = typeof primaryKeyValue === "string"
|
|
221
|
+
? `'${primaryKeyValue.replace(/'/g, "''")}'`
|
|
222
|
+
: primaryKeyValue;
|
|
223
|
+
const query = `DELETE FROM "${tableName}" WHERE "${primaryKey}" = ${pkValue};`;
|
|
224
|
+
try {
|
|
225
|
+
await this.executeSqlite(dbPath, query);
|
|
226
|
+
}
|
|
227
|
+
catch (error) {
|
|
228
|
+
this.logger.error(`Delete failed: ${error}`);
|
|
229
|
+
throw new common_1.BadRequestException("Failed to delete row");
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
exports.DatabaseService = DatabaseService;
|
|
234
|
+
exports.DatabaseService = DatabaseService = DatabaseService_1 = __decorate([
|
|
235
|
+
(0, common_1.Injectable)(),
|
|
236
|
+
__metadata("design:paramtypes", [project_service_1.ProjectService])
|
|
237
|
+
], DatabaseService);
|
|
238
|
+
//# sourceMappingURL=database.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database.service.js","sourceRoot":"","sources":["../../src/database/database.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAA4F;AAC5F,gEAA4D;AAC5D,iDAAsC;AACtC,6BAA6B;AAC7B,yBAAyB;AAuBlB,IAAM,eAAe,uBAArB,MAAM,eAAe;IAG1B,YAAoB,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;QAFjC,WAAM,GAAG,IAAI,eAAM,CAAC,iBAAe,CAAC,IAAI,CAAC,CAAC;IAEN,CAAC;IAK9C,KAAK,CAAC,gBAAgB,CAAC,SAAiB;QAC9C,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;QAGx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AC;QACrE,CAAC;QAED,MAAM,OAAO,GACX,OAAO,eAAe,KAAK,QAAQ;YACjC,CAAC,CAAC,IAAI,eAAe,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG;YAC5C,CAAC,CAAC,eAAe,CAAC;QAEtB,MAAM,KAAK,GAAG,gBAAgB,SAAS,YAAY,UAAU,OAAO,OAAO,GAAG,CAAC;QAE/E,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QAC1C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,KAAK,EAAE,CAAC,CAAC;YAC7C,MAAM,IAAI,4BAAmB,CAAC,sBAAsB,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;CACF,CAAA;AAjUY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;qCAIyB,gCAAc;GAHvC,eAAe,CAiU3B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EnvService, EnvVariable } from "./env.service";
|
|
2
|
+
export declare class EnvController {
|
|
3
|
+
private readonly envService;
|
|
4
|
+
constructor(envService: EnvService);
|
|
5
|
+
getEnvFiles(projectId: string): Promise<import("./env.service").EnvFile[]>;
|
|
6
|
+
getEnvFile(projectId: string, filePath: string): Promise<import("./env.service").EnvFile>;
|
|
7
|
+
updateEnvFile(projectId: string, filePath: string, body: {
|
|
8
|
+
variables: EnvVariable[];
|
|
9
|
+
}): Promise<import("./env.service").EnvFile>;
|
|
10
|
+
createEnvFile(projectId: string, filePath: string, body: {
|
|
11
|
+
variables: EnvVariable[];
|
|
12
|
+
}): Promise<import("./env.service").EnvFile>;
|
|
13
|
+
deleteEnvFile(projectId: string, filePath: string): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
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.EnvController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const env_service_1 = require("./env.service");
|
|
18
|
+
let EnvController = class EnvController {
|
|
19
|
+
constructor(envService) {
|
|
20
|
+
this.envService = envService;
|
|
21
|
+
}
|
|
22
|
+
getEnvFiles(projectId) {
|
|
23
|
+
return this.envService.getEnvFiles(projectId);
|
|
24
|
+
}
|
|
25
|
+
getEnvFile(projectId, filePath) {
|
|
26
|
+
return this.envService.getEnvFile(projectId, filePath);
|
|
27
|
+
}
|
|
28
|
+
updateEnvFile(projectId, filePath, body) {
|
|
29
|
+
return this.envService.updateEnvFile(projectId, filePath, body.variables);
|
|
30
|
+
}
|
|
31
|
+
createEnvFile(projectId, filePath, body) {
|
|
32
|
+
return this.envService.createEnvFile(projectId, filePath, body.variables);
|
|
33
|
+
}
|
|
34
|
+
deleteEnvFile(projectId, filePath) {
|
|
35
|
+
return this.envService.deleteEnvFile(projectId, filePath);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
exports.EnvController = EnvController;
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, common_1.Get)(),
|
|
41
|
+
__param(0, (0, common_1.Param)("projectId")),
|
|
42
|
+
__metadata("design:type", Function),
|
|
43
|
+
__metadata("design:paramtypes", [String]),
|
|
44
|
+
__metadata("design:returntype", void 0)
|
|
45
|
+
], EnvController.prototype, "getEnvFiles", null);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, common_1.Get)("file"),
|
|
48
|
+
__param(0, (0, common_1.Param)("projectId")),
|
|
49
|
+
__param(1, (0, common_1.Query)("path")),
|
|
50
|
+
__metadata("design:type", Function),
|
|
51
|
+
__metadata("design:paramtypes", [String, String]),
|
|
52
|
+
__metadata("design:returntype", void 0)
|
|
53
|
+
], EnvController.prototype, "getEnvFile", null);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, common_1.Put)("file"),
|
|
56
|
+
__param(0, (0, common_1.Param)("projectId")),
|
|
57
|
+
__param(1, (0, common_1.Query)("path")),
|
|
58
|
+
__param(2, (0, common_1.Body)()),
|
|
59
|
+
__metadata("design:type", Function),
|
|
60
|
+
__metadata("design:paramtypes", [String, String, Object]),
|
|
61
|
+
__metadata("design:returntype", void 0)
|
|
62
|
+
], EnvController.prototype, "updateEnvFile", null);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, common_1.Post)("file"),
|
|
65
|
+
__param(0, (0, common_1.Param)("projectId")),
|
|
66
|
+
__param(1, (0, common_1.Query)("path")),
|
|
67
|
+
__param(2, (0, common_1.Body)()),
|
|
68
|
+
__metadata("design:type", Function),
|
|
69
|
+
__metadata("design:paramtypes", [String, String, Object]),
|
|
70
|
+
__metadata("design:returntype", void 0)
|
|
71
|
+
], EnvController.prototype, "createEnvFile", null);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, common_1.Delete)("file"),
|
|
74
|
+
__param(0, (0, common_1.Param)("projectId")),
|
|
75
|
+
__param(1, (0, common_1.Query)("path")),
|
|
76
|
+
__metadata("design:type", Function),
|
|
77
|
+
__metadata("design:paramtypes", [String, String]),
|
|
78
|
+
__metadata("design:returntype", void 0)
|
|
79
|
+
], EnvController.prototype, "deleteEnvFile", null);
|
|
80
|
+
exports.EnvController = EnvController = __decorate([
|
|
81
|
+
(0, common_1.Controller)("projects/:projectId/env"),
|
|
82
|
+
__metadata("design:paramtypes", [env_service_1.EnvService])
|
|
83
|
+
], EnvController);
|
|
84
|
+
//# sourceMappingURL=env.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.controller.js","sourceRoot":"","sources":["../../src/env/env.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CASwB;AACxB,+CAAwD;AAGjD,IAAM,aAAa,GAAnB,MAAM,aAAa;IACxB,YAA6B,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAG,CAAC;IAGvD,WAAW,CAAqB,SAAiB;QAC/C,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IAChD,CAAC;IAGD,UAAU,CACY,SAAiB,EACtB,QAAgB;QAE/B,OAAO,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACzD,CAAC;IAGD,aAAa,CACS,SAAiB,EACtB,QAAgB,EACvB,IAAkC;QAE1C,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,SAAS,EAAE,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IAC5E,CAAC;IAGD,aAAa,CACS,SAAiB,EACtB,QAAgB,EACvB,IAAkC;QAE1C,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,SAAS,EAAE,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IAC5E,CAAC;IAGD,aAAa,CACS,SAAiB,EACtB,QAAgB;QAE/B,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAC5D,CAAC;CACF,CAAA;AAzCY,sCAAa;AAIxB;IADC,IAAA,YAAG,GAAE;IACO,WAAA,IAAA,cAAK,EAAC,WAAW,CAAC,CAAA;;;;gDAE9B;AAGD;IADC,IAAA,YAAG,EAAC,MAAM,CAAC;IAET,WAAA,IAAA,cAAK,EAAC,WAAW,CAAC,CAAA;IAClB,WAAA,IAAA,cAAK,EAAC,MAAM,CAAC,CAAA;;;;+CAGf;AAGD;IADC,IAAA,YAAG,EAAC,MAAM,CAAC;IAET,WAAA,IAAA,cAAK,EAAC,WAAW,CAAC,CAAA;IAClB,WAAA,IAAA,cAAK,EAAC,MAAM,CAAC,CAAA;IACb,WAAA,IAAA,aAAI,GAAE,CAAA;;;;kDAGR;AAGD;IADC,IAAA,aAAI,EAAC,MAAM,CAAC;IAEV,WAAA,IAAA,cAAK,EAAC,WAAW,CAAC,CAAA;IAClB,WAAA,IAAA,cAAK,EAAC,MAAM,CAAC,CAAA;IACb,WAAA,IAAA,aAAI,GAAE,CAAA;;;;kDAGR;AAGD;IADC,IAAA,eAAM,EAAC,MAAM,CAAC;IAEZ,WAAA,IAAA,cAAK,EAAC,WAAW,CAAC,CAAA;IAClB,WAAA,IAAA,cAAK,EAAC,MAAM,CAAC,CAAA;;;;kDAGf;wBAxCU,aAAa;IADzB,IAAA,mBAAU,EAAC,yBAAyB,CAAC;qCAEK,wBAAU;GADxC,aAAa,CAyCzB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
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.EnvModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const env_controller_1 = require("./env.controller");
|
|
12
|
+
const env_service_1 = require("./env.service");
|
|
13
|
+
const project_module_1 = require("../project/project.module");
|
|
14
|
+
let EnvModule = class EnvModule {
|
|
15
|
+
};
|
|
16
|
+
exports.EnvModule = EnvModule;
|
|
17
|
+
exports.EnvModule = EnvModule = __decorate([
|
|
18
|
+
(0, common_1.Module)({
|
|
19
|
+
imports: [project_module_1.ProjectModule],
|
|
20
|
+
controllers: [env_controller_1.EnvController],
|
|
21
|
+
providers: [env_service_1.EnvService],
|
|
22
|
+
exports: [env_service_1.EnvService],
|
|
23
|
+
})
|
|
24
|
+
], EnvModule);
|
|
25
|
+
//# sourceMappingURL=env.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.module.js","sourceRoot":"","sources":["../../src/env/env.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,qDAAiD;AACjD,+CAA2C;AAC3C,8DAA0D;AAQnD,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAAS;IANrB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,8BAAa,CAAC;QACxB,WAAW,EAAE,CAAC,8BAAa,CAAC;QAC5B,SAAS,EAAE,CAAC,wBAAU,CAAC;QACvB,OAAO,EAAE,CAAC,wBAAU,CAAC;KACtB,CAAC;GACW,SAAS,CAAG"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ProjectService } from "../project/project.service";
|
|
2
|
+
export interface EnvVariable {
|
|
3
|
+
key: string;
|
|
4
|
+
value: string;
|
|
5
|
+
}
|
|
6
|
+
export interface EnvFile {
|
|
7
|
+
path: string;
|
|
8
|
+
variables: EnvVariable[];
|
|
9
|
+
}
|
|
10
|
+
export declare class EnvService {
|
|
11
|
+
private projectService;
|
|
12
|
+
private readonly logger;
|
|
13
|
+
constructor(projectService: ProjectService);
|
|
14
|
+
private parseEnvContent;
|
|
15
|
+
private formatEnvContent;
|
|
16
|
+
getEnvFiles(projectId: string): Promise<EnvFile[]>;
|
|
17
|
+
getEnvFile(projectId: string, filePath: string): Promise<EnvFile>;
|
|
18
|
+
updateEnvFile(projectId: string, filePath: string, variables: EnvVariable[]): Promise<EnvFile>;
|
|
19
|
+
createEnvFile(projectId: string, filePath: string, variables?: EnvVariable[]): Promise<EnvFile>;
|
|
20
|
+
deleteEnvFile(projectId: string, filePath: string): Promise<void>;
|
|
21
|
+
}
|