clhq-postgres-module 1.1.0-alpha.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/data-source.d.ts +3 -0
- package/dist/config/data-source.js +27 -0
- package/dist/config/typeorm.config.d.ts +2 -0
- package/dist/config/typeorm.config.js +27 -0
- package/dist/entities/ai-usage.entity.d.ts +15 -0
- package/dist/entities/ai-usage.entity.js +67 -0
- package/dist/entities/asset.entity.d.ts +47 -0
- package/dist/entities/asset.entity.js +155 -0
- package/dist/entities/auth-session.entity.d.ts +13 -0
- package/dist/entities/auth-session.entity.js +61 -0
- package/dist/entities/comment.entity.d.ts +16 -0
- package/dist/entities/comment.entity.js +72 -0
- package/dist/entities/credit-transaction.entity.d.ts +13 -0
- package/dist/entities/credit-transaction.entity.js +61 -0
- package/dist/entities/editor-project.entity.d.ts +60 -0
- package/dist/entities/editor-project.entity.js +173 -0
- package/dist/entities/effect.entity.d.ts +20 -0
- package/dist/entities/effect.entity.js +74 -0
- package/dist/entities/index.d.ts +23 -0
- package/dist/entities/index.js +41 -0
- package/dist/entities/invite.entity.d.ts +20 -0
- package/dist/entities/invite.entity.js +85 -0
- package/dist/entities/payment-transaction.entity.d.ts +27 -0
- package/dist/entities/payment-transaction.entity.js +91 -0
- package/dist/entities/plan.entity.d.ts +19 -0
- package/dist/entities/plan.entity.js +79 -0
- package/dist/entities/reward-rule.entity.d.ts +13 -0
- package/dist/entities/reward-rule.entity.js +63 -0
- package/dist/entities/stripe-webhook.entity.d.ts +17 -0
- package/dist/entities/stripe-webhook.entity.js +67 -0
- package/dist/entities/subscription-plan.entity.d.ts +37 -0
- package/dist/entities/subscription-plan.entity.js +160 -0
- package/dist/entities/subscription-usage.entity.d.ts +14 -0
- package/dist/entities/subscription-usage.entity.js +65 -0
- package/dist/entities/user-onboarding.entity.d.ts +10 -0
- package/dist/entities/user-onboarding.entity.js +49 -0
- package/dist/entities/user-profile.entity.d.ts +39 -0
- package/dist/entities/user-profile.entity.js +165 -0
- package/dist/entities/user-subscription.entity.d.ts +46 -0
- package/dist/entities/user-subscription.entity.js +151 -0
- package/dist/entities/user.entity.d.ts +41 -0
- package/dist/entities/user.entity.js +163 -0
- package/dist/entities/video-render.entity.d.ts +21 -0
- package/dist/entities/video-render.entity.js +79 -0
- package/dist/entities/video-subtitle.entity.d.ts +28 -0
- package/dist/entities/video-subtitle.entity.js +68 -0
- package/dist/entities/video-transcode.entity.d.ts +16 -0
- package/dist/entities/video-transcode.entity.js +64 -0
- package/dist/entities/workspace-member.entity.d.ts +19 -0
- package/dist/entities/workspace-member.entity.js +70 -0
- package/dist/entities/workspace.entity.d.ts +14 -0
- package/dist/entities/workspace.entity.js +63 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +21 -0
- package/dist/postgres.module.d.ts +2 -0
- package/dist/postgres.module.js +62 -0
- package/dist/repositories/ai-usage.repository.d.ts +12 -0
- package/dist/repositories/ai-usage.repository.js +56 -0
- package/dist/repositories/asset.repository.d.ts +20 -0
- package/dist/repositories/asset.repository.js +108 -0
- package/dist/repositories/auth-session.repository.d.ts +10 -0
- package/dist/repositories/auth-session.repository.js +46 -0
- package/dist/repositories/base.repository.d.ts +18 -0
- package/dist/repositories/base.repository.js +53 -0
- package/dist/repositories/comment.repository.d.ts +14 -0
- package/dist/repositories/comment.repository.js +76 -0
- package/dist/repositories/credit-transaction.repository.d.ts +9 -0
- package/dist/repositories/credit-transaction.repository.js +49 -0
- package/dist/repositories/editor-project.repository.d.ts +31 -0
- package/dist/repositories/editor-project.repository.js +193 -0
- package/dist/repositories/effect.repository.d.ts +10 -0
- package/dist/repositories/effect.repository.js +47 -0
- package/dist/repositories/index.d.ts +23 -0
- package/dist/repositories/index.js +49 -0
- package/dist/repositories/invite.repository.d.ts +12 -0
- package/dist/repositories/invite.repository.js +60 -0
- package/dist/repositories/payment-transaction.repository.d.ts +10 -0
- package/dist/repositories/payment-transaction.repository.js +49 -0
- package/dist/repositories/plan.repository.d.ts +10 -0
- package/dist/repositories/plan.repository.js +48 -0
- package/dist/repositories/repository.module.d.ts +2 -0
- package/dist/repositories/repository.module.js +71 -0
- package/dist/repositories/reward-rule.repository.d.ts +10 -0
- package/dist/repositories/reward-rule.repository.js +48 -0
- package/dist/repositories/stripe-webhook.repository.d.ts +10 -0
- package/dist/repositories/stripe-webhook.repository.js +53 -0
- package/dist/repositories/subscription-plan.repository.d.ts +15 -0
- package/dist/repositories/subscription-plan.repository.js +77 -0
- package/dist/repositories/subscription-usage.repository.d.ts +9 -0
- package/dist/repositories/subscription-usage.repository.js +50 -0
- package/dist/repositories/user-onboarding.repository.d.ts +10 -0
- package/dist/repositories/user-onboarding.repository.js +56 -0
- package/dist/repositories/user-profile.repository.d.ts +9 -0
- package/dist/repositories/user-profile.repository.js +41 -0
- package/dist/repositories/user-subscription.repository.d.ts +16 -0
- package/dist/repositories/user-subscription.repository.js +90 -0
- package/dist/repositories/user.repository.d.ts +17 -0
- package/dist/repositories/user.repository.js +89 -0
- package/dist/repositories/video-render.repository.d.ts +28 -0
- package/dist/repositories/video-render.repository.js +63 -0
- package/dist/repositories/video-transcode.repository.d.ts +23 -0
- package/dist/repositories/video-transcode.repository.js +52 -0
- package/dist/repositories/workspace-member.repository.d.ts +13 -0
- package/dist/repositories/workspace-member.repository.js +79 -0
- package/dist/repositories/workspace.repository.d.ts +13 -0
- package/dist/repositories/workspace.repository.js +64 -0
- package/package.json +59 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const typeorm_1 = require("typeorm");
|
|
4
|
+
const user_entity_1 = require("../entities/user.entity");
|
|
5
|
+
const workspace_entity_1 = require("../entities/workspace.entity");
|
|
6
|
+
const editor_project_entity_1 = require("../entities/editor-project.entity");
|
|
7
|
+
const user_subscription_entity_1 = require("../entities/user-subscription.entity");
|
|
8
|
+
const connectionUrl = process.env.PG_SESSION_POOLER_URL || process.env.PG_POOLER_URL;
|
|
9
|
+
if (!connectionUrl) {
|
|
10
|
+
throw new Error('PostgreSQL connection URL not found. Set PG_SESSION_POOLER_URL or PG_POOLER_URL in environment.');
|
|
11
|
+
}
|
|
12
|
+
const dataSource = new typeorm_1.DataSource({
|
|
13
|
+
type: 'postgres',
|
|
14
|
+
url: connectionUrl,
|
|
15
|
+
synchronize: false,
|
|
16
|
+
logging: process.env.NODE_ENV === 'development',
|
|
17
|
+
entities: [user_entity_1.User, workspace_entity_1.Workspace, editor_project_entity_1.EditorProject, user_subscription_entity_1.UserSubscription],
|
|
18
|
+
migrations: [],
|
|
19
|
+
ssl: { rejectUnauthorized: false },
|
|
20
|
+
extra: {
|
|
21
|
+
max: 20,
|
|
22
|
+
min: 5,
|
|
23
|
+
idleTimeoutMillis: 30000,
|
|
24
|
+
connectionTimeoutMillis: 10000,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
exports.default = dataSource;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTypeOrmConfig = void 0;
|
|
4
|
+
const getTypeOrmConfig = () => {
|
|
5
|
+
const connectionUrl = process.env.PG_SESSION_POOLER_URL || process.env.PG_POOLER_URL;
|
|
6
|
+
if (!connectionUrl) {
|
|
7
|
+
throw new Error('PostgreSQL connection URL not found. ' +
|
|
8
|
+
'Set PG_SESSION_POOLER_URL or PG_POOLER_URL in environment.');
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
type: 'postgres',
|
|
12
|
+
url: connectionUrl,
|
|
13
|
+
entities: [__dirname + '/../**/*.entity{.ts,.js}'],
|
|
14
|
+
synchronize: false,
|
|
15
|
+
logging: process.env.NODE_ENV === 'development',
|
|
16
|
+
ssl: {
|
|
17
|
+
rejectUnauthorized: false,
|
|
18
|
+
},
|
|
19
|
+
extra: {
|
|
20
|
+
max: 20,
|
|
21
|
+
min: 5,
|
|
22
|
+
idleTimeoutMillis: 30000,
|
|
23
|
+
connectionTimeoutMillis: 10000,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
exports.getTypeOrmConfig = getTypeOrmConfig;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { User } from './user.entity';
|
|
2
|
+
import { EditorProject } from './editor-project.entity';
|
|
3
|
+
export declare class AiUsage {
|
|
4
|
+
id: string;
|
|
5
|
+
userId: string;
|
|
6
|
+
user: User;
|
|
7
|
+
projectId?: string;
|
|
8
|
+
project?: EditorProject;
|
|
9
|
+
featureType: string;
|
|
10
|
+
tokensUsed: number;
|
|
11
|
+
costCents: number;
|
|
12
|
+
model?: string;
|
|
13
|
+
metadata: Record<string, any>;
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
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.AiUsage = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const user_entity_1 = require("./user.entity");
|
|
15
|
+
const editor_project_entity_1 = require("./editor-project.entity");
|
|
16
|
+
let AiUsage = class AiUsage {
|
|
17
|
+
};
|
|
18
|
+
exports.AiUsage = AiUsage;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
21
|
+
__metadata("design:type", String)
|
|
22
|
+
], AiUsage.prototype, "id", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, typeorm_1.Column)({ name: 'user_id' }),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], AiUsage.prototype, "userId", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User),
|
|
29
|
+
(0, typeorm_1.JoinColumn)({ name: 'user_id' }),
|
|
30
|
+
__metadata("design:type", user_entity_1.User)
|
|
31
|
+
], AiUsage.prototype, "user", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, typeorm_1.Column)({ name: 'project_id', nullable: true }),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], AiUsage.prototype, "projectId", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.ManyToOne)(() => editor_project_entity_1.EditorProject),
|
|
38
|
+
(0, typeorm_1.JoinColumn)({ name: 'project_id' }),
|
|
39
|
+
__metadata("design:type", editor_project_entity_1.EditorProject)
|
|
40
|
+
], AiUsage.prototype, "project", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({ name: 'feature_type', length: 100 }),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], AiUsage.prototype, "featureType", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.Column)({ name: 'tokens_used', default: 0 }),
|
|
47
|
+
__metadata("design:type", Number)
|
|
48
|
+
], AiUsage.prototype, "tokensUsed", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.Column)({ name: 'cost_cents', default: 0 }),
|
|
51
|
+
__metadata("design:type", Number)
|
|
52
|
+
], AiUsage.prototype, "costCents", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typeorm_1.Column)({ length: 100, nullable: true }),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], AiUsage.prototype, "model", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, typeorm_1.Column)({ type: 'jsonb', default: {} }),
|
|
59
|
+
__metadata("design:type", Object)
|
|
60
|
+
], AiUsage.prototype, "metadata", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, typeorm_1.CreateDateColumn)({ name: 'created_at' }),
|
|
63
|
+
__metadata("design:type", Date)
|
|
64
|
+
], AiUsage.prototype, "createdAt", void 0);
|
|
65
|
+
exports.AiUsage = AiUsage = __decorate([
|
|
66
|
+
(0, typeorm_1.Entity)('ai_usage')
|
|
67
|
+
], AiUsage);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { User } from './user.entity';
|
|
2
|
+
import { Workspace } from './workspace.entity';
|
|
3
|
+
export declare enum AssetType {
|
|
4
|
+
IMAGE = "image",
|
|
5
|
+
VIDEO = "video",
|
|
6
|
+
AUDIO = "audio",
|
|
7
|
+
FONT = "font",
|
|
8
|
+
OTHER = "other"
|
|
9
|
+
}
|
|
10
|
+
export declare enum AssetStatus {
|
|
11
|
+
UPLOADING = "uploading",
|
|
12
|
+
PROCESSING = "processing",
|
|
13
|
+
READY = "ready",
|
|
14
|
+
FAILED = "failed",
|
|
15
|
+
DELETED = "deleted"
|
|
16
|
+
}
|
|
17
|
+
export declare class Asset {
|
|
18
|
+
id: string;
|
|
19
|
+
workspaceId: string;
|
|
20
|
+
workspace: Workspace;
|
|
21
|
+
uploadedBy: string;
|
|
22
|
+
user: User;
|
|
23
|
+
categoryId: string;
|
|
24
|
+
name: string;
|
|
25
|
+
originalFilename: string;
|
|
26
|
+
fileType: string;
|
|
27
|
+
mimeType: string;
|
|
28
|
+
fileSize: number;
|
|
29
|
+
fileUrl: string;
|
|
30
|
+
thumbnailUrl: string;
|
|
31
|
+
previewUrl: string;
|
|
32
|
+
durationMs: number;
|
|
33
|
+
width: number;
|
|
34
|
+
height: number;
|
|
35
|
+
frameRate: number;
|
|
36
|
+
codec: string;
|
|
37
|
+
bitrate: number;
|
|
38
|
+
metadata: Record<string, any>;
|
|
39
|
+
uploadStatus: string;
|
|
40
|
+
tags: string[];
|
|
41
|
+
isPublic: boolean;
|
|
42
|
+
isPremium: boolean;
|
|
43
|
+
usageCount: number;
|
|
44
|
+
lastUsedAt: Date;
|
|
45
|
+
createdAt: Date;
|
|
46
|
+
updatedAt: Date;
|
|
47
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
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.Asset = exports.AssetStatus = exports.AssetType = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const user_entity_1 = require("./user.entity");
|
|
15
|
+
const workspace_entity_1 = require("./workspace.entity");
|
|
16
|
+
var AssetType;
|
|
17
|
+
(function (AssetType) {
|
|
18
|
+
AssetType["IMAGE"] = "image";
|
|
19
|
+
AssetType["VIDEO"] = "video";
|
|
20
|
+
AssetType["AUDIO"] = "audio";
|
|
21
|
+
AssetType["FONT"] = "font";
|
|
22
|
+
AssetType["OTHER"] = "other";
|
|
23
|
+
})(AssetType || (exports.AssetType = AssetType = {}));
|
|
24
|
+
var AssetStatus;
|
|
25
|
+
(function (AssetStatus) {
|
|
26
|
+
AssetStatus["UPLOADING"] = "uploading";
|
|
27
|
+
AssetStatus["PROCESSING"] = "processing";
|
|
28
|
+
AssetStatus["READY"] = "ready";
|
|
29
|
+
AssetStatus["FAILED"] = "failed";
|
|
30
|
+
AssetStatus["DELETED"] = "deleted";
|
|
31
|
+
})(AssetStatus || (exports.AssetStatus = AssetStatus = {}));
|
|
32
|
+
let Asset = class Asset {
|
|
33
|
+
};
|
|
34
|
+
exports.Asset = Asset;
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], Asset.prototype, "id", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.Column)({ name: 'workspace_id', type: 'uuid' }),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], Asset.prototype, "workspaceId", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.ManyToOne)(() => workspace_entity_1.Workspace),
|
|
45
|
+
(0, typeorm_1.JoinColumn)({ name: 'workspace_id' }),
|
|
46
|
+
__metadata("design:type", workspace_entity_1.Workspace)
|
|
47
|
+
], Asset.prototype, "workspace", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({ name: 'uploaded_by', type: 'uuid' }),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], Asset.prototype, "uploadedBy", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User),
|
|
54
|
+
(0, typeorm_1.JoinColumn)({ name: 'uploaded_by' }),
|
|
55
|
+
__metadata("design:type", user_entity_1.User)
|
|
56
|
+
], Asset.prototype, "user", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, typeorm_1.Column)({ name: 'category_id', type: 'uuid', nullable: true }),
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], Asset.prototype, "categoryId", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255 }),
|
|
63
|
+
__metadata("design:type", String)
|
|
64
|
+
], Asset.prototype, "name", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, typeorm_1.Column)({ name: 'original_filename', type: 'varchar', length: 500, nullable: true }),
|
|
67
|
+
__metadata("design:type", String)
|
|
68
|
+
], Asset.prototype, "originalFilename", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, typeorm_1.Column)({ name: 'file_type', type: 'varchar', length: 50 }),
|
|
71
|
+
__metadata("design:type", String)
|
|
72
|
+
], Asset.prototype, "fileType", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, typeorm_1.Column)({ name: 'mime_type', type: 'varchar', length: 100, nullable: true }),
|
|
75
|
+
__metadata("design:type", String)
|
|
76
|
+
], Asset.prototype, "mimeType", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, typeorm_1.Column)({ name: 'file_size', type: 'bigint' }),
|
|
79
|
+
__metadata("design:type", Number)
|
|
80
|
+
], Asset.prototype, "fileSize", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, typeorm_1.Column)({ name: 'file_url', type: 'text' }),
|
|
83
|
+
__metadata("design:type", String)
|
|
84
|
+
], Asset.prototype, "fileUrl", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, typeorm_1.Column)({ name: 'thumbnail_url', type: 'text', nullable: true }),
|
|
87
|
+
__metadata("design:type", String)
|
|
88
|
+
], Asset.prototype, "thumbnailUrl", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, typeorm_1.Column)({ name: 'preview_url', type: 'text', nullable: true }),
|
|
91
|
+
__metadata("design:type", String)
|
|
92
|
+
], Asset.prototype, "previewUrl", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
(0, typeorm_1.Column)({ name: 'duration_ms', type: 'integer', nullable: true }),
|
|
95
|
+
__metadata("design:type", Number)
|
|
96
|
+
], Asset.prototype, "durationMs", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: true }),
|
|
99
|
+
__metadata("design:type", Number)
|
|
100
|
+
], Asset.prototype, "width", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: true }),
|
|
103
|
+
__metadata("design:type", Number)
|
|
104
|
+
], Asset.prototype, "height", void 0);
|
|
105
|
+
__decorate([
|
|
106
|
+
(0, typeorm_1.Column)({ name: 'frame_rate', type: 'decimal', precision: 10, scale: 2, nullable: true }),
|
|
107
|
+
__metadata("design:type", Number)
|
|
108
|
+
], Asset.prototype, "frameRate", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true }),
|
|
111
|
+
__metadata("design:type", String)
|
|
112
|
+
], Asset.prototype, "codec", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: true }),
|
|
115
|
+
__metadata("design:type", Number)
|
|
116
|
+
], Asset.prototype, "bitrate", void 0);
|
|
117
|
+
__decorate([
|
|
118
|
+
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
|
|
119
|
+
__metadata("design:type", Object)
|
|
120
|
+
], Asset.prototype, "metadata", void 0);
|
|
121
|
+
__decorate([
|
|
122
|
+
(0, typeorm_1.Column)({ name: 'upload_status', type: 'varchar', length: 50, default: 'uploading' }),
|
|
123
|
+
__metadata("design:type", String)
|
|
124
|
+
], Asset.prototype, "uploadStatus", void 0);
|
|
125
|
+
__decorate([
|
|
126
|
+
(0, typeorm_1.Column)({ type: 'text', array: true, nullable: true }),
|
|
127
|
+
__metadata("design:type", Array)
|
|
128
|
+
], Asset.prototype, "tags", void 0);
|
|
129
|
+
__decorate([
|
|
130
|
+
(0, typeorm_1.Column)({ name: 'is_public', type: 'boolean', default: false }),
|
|
131
|
+
__metadata("design:type", Boolean)
|
|
132
|
+
], Asset.prototype, "isPublic", void 0);
|
|
133
|
+
__decorate([
|
|
134
|
+
(0, typeorm_1.Column)({ name: 'is_premium', type: 'boolean', default: false }),
|
|
135
|
+
__metadata("design:type", Boolean)
|
|
136
|
+
], Asset.prototype, "isPremium", void 0);
|
|
137
|
+
__decorate([
|
|
138
|
+
(0, typeorm_1.Column)({ name: 'usage_count', type: 'integer', default: 0 }),
|
|
139
|
+
__metadata("design:type", Number)
|
|
140
|
+
], Asset.prototype, "usageCount", void 0);
|
|
141
|
+
__decorate([
|
|
142
|
+
(0, typeorm_1.Column)({ name: 'last_used_at', type: 'timestamp', nullable: true }),
|
|
143
|
+
__metadata("design:type", Date)
|
|
144
|
+
], Asset.prototype, "lastUsedAt", void 0);
|
|
145
|
+
__decorate([
|
|
146
|
+
(0, typeorm_1.CreateDateColumn)({ name: 'created_at' }),
|
|
147
|
+
__metadata("design:type", Date)
|
|
148
|
+
], Asset.prototype, "createdAt", void 0);
|
|
149
|
+
__decorate([
|
|
150
|
+
(0, typeorm_1.UpdateDateColumn)({ name: 'updated_at' }),
|
|
151
|
+
__metadata("design:type", Date)
|
|
152
|
+
], Asset.prototype, "updatedAt", void 0);
|
|
153
|
+
exports.Asset = Asset = __decorate([
|
|
154
|
+
(0, typeorm_1.Entity)('assets')
|
|
155
|
+
], Asset);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { User } from './user.entity';
|
|
2
|
+
export declare class AuthSession {
|
|
3
|
+
id: string;
|
|
4
|
+
userId: string;
|
|
5
|
+
user: User;
|
|
6
|
+
token: string;
|
|
7
|
+
userAgent: string;
|
|
8
|
+
ipAddress: string;
|
|
9
|
+
expiresAt: Date;
|
|
10
|
+
isActive: boolean;
|
|
11
|
+
createdAt: Date;
|
|
12
|
+
updatedAt: Date;
|
|
13
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
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.AuthSession = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const user_entity_1 = require("./user.entity");
|
|
15
|
+
let AuthSession = class AuthSession {
|
|
16
|
+
};
|
|
17
|
+
exports.AuthSession = AuthSession;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], AuthSession.prototype, "id", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.Column)({ name: 'user_id', type: 'uuid' }),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], AuthSession.prototype, "userId", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User),
|
|
28
|
+
(0, typeorm_1.JoinColumn)({ name: 'user_id' }),
|
|
29
|
+
__metadata("design:type", user_entity_1.User)
|
|
30
|
+
], AuthSession.prototype, "user", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 500, unique: true }),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], AuthSession.prototype, "token", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], AuthSession.prototype, "userAgent", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 45, nullable: true }),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], AuthSession.prototype, "ipAddress", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.Column)({ type: 'timestamp' }),
|
|
45
|
+
__metadata("design:type", Date)
|
|
46
|
+
], AuthSession.prototype, "expiresAt", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: true }),
|
|
49
|
+
__metadata("design:type", Boolean)
|
|
50
|
+
], AuthSession.prototype, "isActive", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.CreateDateColumn)({ name: 'created_at' }),
|
|
53
|
+
__metadata("design:type", Date)
|
|
54
|
+
], AuthSession.prototype, "createdAt", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, typeorm_1.UpdateDateColumn)({ name: 'updated_at' }),
|
|
57
|
+
__metadata("design:type", Date)
|
|
58
|
+
], AuthSession.prototype, "updatedAt", void 0);
|
|
59
|
+
exports.AuthSession = AuthSession = __decorate([
|
|
60
|
+
(0, typeorm_1.Entity)('auth_sessions')
|
|
61
|
+
], AuthSession);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { User } from './user.entity';
|
|
2
|
+
import { EditorProject } from './editor-project.entity';
|
|
3
|
+
export declare class Comment {
|
|
4
|
+
id: string;
|
|
5
|
+
projectId: string;
|
|
6
|
+
project: EditorProject;
|
|
7
|
+
userId: string;
|
|
8
|
+
user: User;
|
|
9
|
+
content: string;
|
|
10
|
+
parentId: string;
|
|
11
|
+
parent: Comment;
|
|
12
|
+
metadata: Record<string, any>;
|
|
13
|
+
isResolved: boolean;
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
updatedAt: Date;
|
|
16
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
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.Comment = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const user_entity_1 = require("./user.entity");
|
|
15
|
+
const editor_project_entity_1 = require("./editor-project.entity");
|
|
16
|
+
let Comment = class Comment {
|
|
17
|
+
};
|
|
18
|
+
exports.Comment = Comment;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
21
|
+
__metadata("design:type", String)
|
|
22
|
+
], Comment.prototype, "id", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, typeorm_1.Column)({ name: 'project_id', type: 'uuid' }),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], Comment.prototype, "projectId", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typeorm_1.ManyToOne)(() => editor_project_entity_1.EditorProject),
|
|
29
|
+
(0, typeorm_1.JoinColumn)({ name: 'project_id' }),
|
|
30
|
+
__metadata("design:type", editor_project_entity_1.EditorProject)
|
|
31
|
+
], Comment.prototype, "project", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, typeorm_1.Column)({ name: 'user_id', type: 'uuid' }),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], Comment.prototype, "userId", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User),
|
|
38
|
+
(0, typeorm_1.JoinColumn)({ name: 'user_id' }),
|
|
39
|
+
__metadata("design:type", user_entity_1.User)
|
|
40
|
+
], Comment.prototype, "user", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({ type: 'text' }),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], Comment.prototype, "content", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.Column)({ name: 'parent_id', type: 'uuid', nullable: true }),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], Comment.prototype, "parentId", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.ManyToOne)(() => Comment, { nullable: true }),
|
|
51
|
+
(0, typeorm_1.JoinColumn)({ name: 'parent_id' }),
|
|
52
|
+
__metadata("design:type", Comment)
|
|
53
|
+
], Comment.prototype, "parent", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
|
|
56
|
+
__metadata("design:type", Object)
|
|
57
|
+
], Comment.prototype, "metadata", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: false }),
|
|
60
|
+
__metadata("design:type", Boolean)
|
|
61
|
+
], Comment.prototype, "isResolved", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, typeorm_1.CreateDateColumn)({ name: 'created_at' }),
|
|
64
|
+
__metadata("design:type", Date)
|
|
65
|
+
], Comment.prototype, "createdAt", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, typeorm_1.UpdateDateColumn)({ name: 'updated_at' }),
|
|
68
|
+
__metadata("design:type", Date)
|
|
69
|
+
], Comment.prototype, "updatedAt", void 0);
|
|
70
|
+
exports.Comment = Comment = __decorate([
|
|
71
|
+
(0, typeorm_1.Entity)('comments')
|
|
72
|
+
], Comment);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { User } from './user.entity';
|
|
2
|
+
export declare class CreditTransaction {
|
|
3
|
+
id: string;
|
|
4
|
+
userId: string;
|
|
5
|
+
user: User;
|
|
6
|
+
amount: number;
|
|
7
|
+
type: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
stripePaymentIntentId?: string;
|
|
10
|
+
metadata: Record<string, any>;
|
|
11
|
+
createdAt: Date;
|
|
12
|
+
updatedAt: Date;
|
|
13
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
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.CreditTransaction = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const user_entity_1 = require("./user.entity");
|
|
15
|
+
let CreditTransaction = class CreditTransaction {
|
|
16
|
+
};
|
|
17
|
+
exports.CreditTransaction = CreditTransaction;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], CreditTransaction.prototype, "id", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.Column)({ name: 'user_id' }),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], CreditTransaction.prototype, "userId", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User),
|
|
28
|
+
(0, typeorm_1.JoinColumn)({ name: 'user_id' }),
|
|
29
|
+
__metadata("design:type", user_entity_1.User)
|
|
30
|
+
], CreditTransaction.prototype, "user", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.Column)({ type: 'decimal', precision: 10, scale: 2 }),
|
|
33
|
+
__metadata("design:type", Number)
|
|
34
|
+
], CreditTransaction.prototype, "amount", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Column)({ length: 50 }),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], CreditTransaction.prototype, "type", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], CreditTransaction.prototype, "description", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.Column)({ name: 'stripe_payment_intent_id', nullable: true }),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], CreditTransaction.prototype, "stripePaymentIntentId", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typeorm_1.Column)({ type: 'jsonb', default: {} }),
|
|
49
|
+
__metadata("design:type", Object)
|
|
50
|
+
], CreditTransaction.prototype, "metadata", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.CreateDateColumn)({ name: 'created_at' }),
|
|
53
|
+
__metadata("design:type", Date)
|
|
54
|
+
], CreditTransaction.prototype, "createdAt", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, typeorm_1.UpdateDateColumn)({ name: 'updated_at' }),
|
|
57
|
+
__metadata("design:type", Date)
|
|
58
|
+
], CreditTransaction.prototype, "updatedAt", void 0);
|
|
59
|
+
exports.CreditTransaction = CreditTransaction = __decorate([
|
|
60
|
+
(0, typeorm_1.Entity)('credit_transactions')
|
|
61
|
+
], CreditTransaction);
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { User } from './user.entity';
|
|
2
|
+
import { Workspace } from './workspace.entity';
|
|
3
|
+
export declare enum ProjectStatus {
|
|
4
|
+
DRAFT = "draft",
|
|
5
|
+
IN_PROGRESS = "in_progress",
|
|
6
|
+
COMPLETED = "completed",
|
|
7
|
+
ARCHIVED = "archived",
|
|
8
|
+
DELETED = "deleted"
|
|
9
|
+
}
|
|
10
|
+
export declare enum ProjectVisibility {
|
|
11
|
+
PRIVATE = "private",
|
|
12
|
+
PUBLIC = "public",
|
|
13
|
+
WORKSPACE = "workspace"
|
|
14
|
+
}
|
|
15
|
+
export declare class EditorProject {
|
|
16
|
+
id: string;
|
|
17
|
+
title: string;
|
|
18
|
+
description: string;
|
|
19
|
+
workspaceId: string;
|
|
20
|
+
ownerId: string;
|
|
21
|
+
timelineS3Key: string;
|
|
22
|
+
timelineCompressed: boolean;
|
|
23
|
+
durationMs: number;
|
|
24
|
+
fps: number;
|
|
25
|
+
resolutionWidth: number;
|
|
26
|
+
resolutionHeight: number;
|
|
27
|
+
backgroundColor: string;
|
|
28
|
+
aspectRatio: {
|
|
29
|
+
label: string;
|
|
30
|
+
width: number;
|
|
31
|
+
height: number;
|
|
32
|
+
resolutionWidth?: number;
|
|
33
|
+
resolutionHeight?: number;
|
|
34
|
+
isCustom?: boolean;
|
|
35
|
+
};
|
|
36
|
+
status: ProjectStatus;
|
|
37
|
+
visibility: ProjectVisibility;
|
|
38
|
+
isTemplate: boolean;
|
|
39
|
+
isFavorite: boolean;
|
|
40
|
+
thumbnailUrl: string;
|
|
41
|
+
collaboratorIds: string[];
|
|
42
|
+
tags: string[];
|
|
43
|
+
templateCategory: string;
|
|
44
|
+
isPremiumTemplate: boolean;
|
|
45
|
+
templateUsageCount: number;
|
|
46
|
+
settings: {
|
|
47
|
+
autoSave?: boolean;
|
|
48
|
+
gridSnap?: boolean;
|
|
49
|
+
showTimecode?: boolean;
|
|
50
|
+
previewQuality?: 'low' | 'medium' | 'high';
|
|
51
|
+
audioLevels?: boolean;
|
|
52
|
+
};
|
|
53
|
+
metadata: Record<string, unknown>;
|
|
54
|
+
lastOpenedAt: Date;
|
|
55
|
+
lastEditedBy: string;
|
|
56
|
+
createdAt: Date;
|
|
57
|
+
updatedAt: Date;
|
|
58
|
+
workspace: Workspace;
|
|
59
|
+
owner: User;
|
|
60
|
+
}
|