clhq-postgres-module 1.1.0-alpha.104 → 1.1.0-alpha.106
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/entities/ai-embedding.entity.d.ts +33 -0
- package/dist/entities/ai-embedding.entity.js +102 -0
- package/dist/entities/asset-metadata.entity.d.ts +72 -0
- package/dist/entities/asset-metadata.entity.js +140 -0
- package/dist/entities/index.d.ts +5 -0
- package/dist/entities/index.js +5 -0
- package/dist/entities/metadata-activity-log.entity.d.ts +50 -0
- package/dist/entities/metadata-activity-log.entity.js +123 -0
- package/dist/entities/project-metadata.entity.d.ts +70 -0
- package/dist/entities/project-metadata.entity.js +141 -0
- package/dist/entities/user-context.entity.d.ts +59 -0
- package/dist/entities/user-context.entity.js +162 -0
- package/package.json +4 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare enum EmbeddingEntityType {
|
|
2
|
+
ASSET = "asset",
|
|
3
|
+
PROJECT = "project",
|
|
4
|
+
USER = "user",
|
|
5
|
+
TEXT_SNIPPET = "text_snippet"
|
|
6
|
+
}
|
|
7
|
+
export declare enum EmbeddingType {
|
|
8
|
+
TEXT = "text",
|
|
9
|
+
VISUAL = "visual",
|
|
10
|
+
AUDIO = "audio",
|
|
11
|
+
COMBINED = "combined"
|
|
12
|
+
}
|
|
13
|
+
export declare class AiEmbedding {
|
|
14
|
+
id: string;
|
|
15
|
+
entityType: EmbeddingEntityType;
|
|
16
|
+
entityId: string;
|
|
17
|
+
userId: string;
|
|
18
|
+
workspaceId: string;
|
|
19
|
+
embeddingType: EmbeddingType;
|
|
20
|
+
embedding: number[];
|
|
21
|
+
dimension: number;
|
|
22
|
+
sourceText: string;
|
|
23
|
+
modelId: string;
|
|
24
|
+
modelVersion: string;
|
|
25
|
+
metadata: {
|
|
26
|
+
tokenCount?: number;
|
|
27
|
+
processingTimeMs?: number;
|
|
28
|
+
sourceFields?: string[];
|
|
29
|
+
truncated?: boolean;
|
|
30
|
+
};
|
|
31
|
+
createdAt: Date;
|
|
32
|
+
updatedAt: Date;
|
|
33
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
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.AiEmbedding = exports.EmbeddingType = exports.EmbeddingEntityType = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
var EmbeddingEntityType;
|
|
15
|
+
(function (EmbeddingEntityType) {
|
|
16
|
+
EmbeddingEntityType["ASSET"] = "asset";
|
|
17
|
+
EmbeddingEntityType["PROJECT"] = "project";
|
|
18
|
+
EmbeddingEntityType["USER"] = "user";
|
|
19
|
+
EmbeddingEntityType["TEXT_SNIPPET"] = "text_snippet";
|
|
20
|
+
})(EmbeddingEntityType || (exports.EmbeddingEntityType = EmbeddingEntityType = {}));
|
|
21
|
+
var EmbeddingType;
|
|
22
|
+
(function (EmbeddingType) {
|
|
23
|
+
EmbeddingType["TEXT"] = "text";
|
|
24
|
+
EmbeddingType["VISUAL"] = "visual";
|
|
25
|
+
EmbeddingType["AUDIO"] = "audio";
|
|
26
|
+
EmbeddingType["COMBINED"] = "combined";
|
|
27
|
+
})(EmbeddingType || (exports.EmbeddingType = EmbeddingType = {}));
|
|
28
|
+
let AiEmbedding = class AiEmbedding {
|
|
29
|
+
};
|
|
30
|
+
exports.AiEmbedding = AiEmbedding;
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], AiEmbedding.prototype, "id", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Column)({
|
|
37
|
+
name: 'entity_type',
|
|
38
|
+
type: 'enum',
|
|
39
|
+
enum: EmbeddingEntityType,
|
|
40
|
+
}),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], AiEmbedding.prototype, "entityType", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.Column)({ name: 'entity_id', type: 'varchar', length: 255 }),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], AiEmbedding.prototype, "entityId", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typeorm_1.Column)({ name: 'user_id', type: 'uuid', nullable: true }),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], AiEmbedding.prototype, "userId", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.Column)({ name: 'workspace_id', type: 'uuid', nullable: true }),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], AiEmbedding.prototype, "workspaceId", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, typeorm_1.Column)({
|
|
57
|
+
name: 'embedding_type',
|
|
58
|
+
type: 'enum',
|
|
59
|
+
enum: EmbeddingType,
|
|
60
|
+
default: EmbeddingType.TEXT,
|
|
61
|
+
}),
|
|
62
|
+
__metadata("design:type", String)
|
|
63
|
+
], AiEmbedding.prototype, "embeddingType", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, typeorm_1.Column)({ type: 'jsonb' }),
|
|
66
|
+
__metadata("design:type", Array)
|
|
67
|
+
], AiEmbedding.prototype, "embedding", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, typeorm_1.Column)({ type: 'integer' }),
|
|
70
|
+
__metadata("design:type", Number)
|
|
71
|
+
], AiEmbedding.prototype, "dimension", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, typeorm_1.Column)({ name: 'source_text', type: 'text', nullable: true }),
|
|
74
|
+
__metadata("design:type", String)
|
|
75
|
+
], AiEmbedding.prototype, "sourceText", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, typeorm_1.Column)({ name: 'model_id', type: 'varchar', length: 100 }),
|
|
78
|
+
__metadata("design:type", String)
|
|
79
|
+
], AiEmbedding.prototype, "modelId", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, typeorm_1.Column)({ name: 'model_version', type: 'varchar', length: 50, nullable: true }),
|
|
82
|
+
__metadata("design:type", String)
|
|
83
|
+
], AiEmbedding.prototype, "modelVersion", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
|
|
86
|
+
__metadata("design:type", Object)
|
|
87
|
+
], AiEmbedding.prototype, "metadata", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, typeorm_1.CreateDateColumn)({ name: 'created_at' }),
|
|
90
|
+
__metadata("design:type", Date)
|
|
91
|
+
], AiEmbedding.prototype, "createdAt", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, typeorm_1.UpdateDateColumn)({ name: 'updated_at' }),
|
|
94
|
+
__metadata("design:type", Date)
|
|
95
|
+
], AiEmbedding.prototype, "updatedAt", void 0);
|
|
96
|
+
exports.AiEmbedding = AiEmbedding = __decorate([
|
|
97
|
+
(0, typeorm_1.Entity)('ai_embeddings'),
|
|
98
|
+
(0, typeorm_1.Index)(['entityType', 'entityId'], { unique: true }),
|
|
99
|
+
(0, typeorm_1.Index)(['entityType']),
|
|
100
|
+
(0, typeorm_1.Index)(['userId']),
|
|
101
|
+
(0, typeorm_1.Index)(['workspaceId'])
|
|
102
|
+
], AiEmbedding);
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Asset } from './asset.entity';
|
|
2
|
+
import { User } from './user.entity';
|
|
3
|
+
import { Workspace } from './workspace.entity';
|
|
4
|
+
export declare enum AssetMetadataStatus {
|
|
5
|
+
PENDING = "pending",
|
|
6
|
+
PROCESSING = "processing",
|
|
7
|
+
COMPLETED = "completed",
|
|
8
|
+
FAILED = "failed"
|
|
9
|
+
}
|
|
10
|
+
export declare class AssetMetadata {
|
|
11
|
+
id: string;
|
|
12
|
+
assetId: string;
|
|
13
|
+
asset: Asset;
|
|
14
|
+
userId: string;
|
|
15
|
+
user: User;
|
|
16
|
+
workspaceId: string;
|
|
17
|
+
workspace: Workspace;
|
|
18
|
+
technical: {
|
|
19
|
+
duration?: number;
|
|
20
|
+
width?: number;
|
|
21
|
+
height?: number;
|
|
22
|
+
fps?: number;
|
|
23
|
+
codec?: string;
|
|
24
|
+
bitrate?: number;
|
|
25
|
+
hasAudio?: boolean;
|
|
26
|
+
hasAlpha?: boolean;
|
|
27
|
+
audioCodec?: string;
|
|
28
|
+
audioChannels?: number;
|
|
29
|
+
audioSampleRate?: number;
|
|
30
|
+
colorSpace?: string;
|
|
31
|
+
pixelFormat?: string;
|
|
32
|
+
};
|
|
33
|
+
content: {
|
|
34
|
+
transcription?: string;
|
|
35
|
+
transcriptionLanguage?: string;
|
|
36
|
+
detectedObjects?: string[];
|
|
37
|
+
detectedScenes?: Array<{
|
|
38
|
+
timestamp: number;
|
|
39
|
+
description: string;
|
|
40
|
+
confidence: number;
|
|
41
|
+
}>;
|
|
42
|
+
detectedFaces?: number;
|
|
43
|
+
dominantColors?: string[];
|
|
44
|
+
mood?: string;
|
|
45
|
+
sentiment?: string;
|
|
46
|
+
keywords?: string[];
|
|
47
|
+
summary?: string;
|
|
48
|
+
};
|
|
49
|
+
audioFeatures: {
|
|
50
|
+
bpm?: number;
|
|
51
|
+
energy?: number;
|
|
52
|
+
speechRatio?: number;
|
|
53
|
+
musicRatio?: number;
|
|
54
|
+
silenceRatio?: number;
|
|
55
|
+
loudnessLUFS?: number;
|
|
56
|
+
};
|
|
57
|
+
tags: string[];
|
|
58
|
+
description: string;
|
|
59
|
+
category: string;
|
|
60
|
+
usageCount: number;
|
|
61
|
+
lastUsedAt: Date;
|
|
62
|
+
projectsUsedIn: string[];
|
|
63
|
+
contentEmbedding: number[];
|
|
64
|
+
embeddingModel: string;
|
|
65
|
+
embeddingVersion: string;
|
|
66
|
+
status: AssetMetadataStatus;
|
|
67
|
+
processingError: string;
|
|
68
|
+
aiProcessedAt: Date;
|
|
69
|
+
embeddingGeneratedAt: Date;
|
|
70
|
+
createdAt: Date;
|
|
71
|
+
updatedAt: Date;
|
|
72
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
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.AssetMetadata = exports.AssetMetadataStatus = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const asset_entity_1 = require("./asset.entity");
|
|
15
|
+
const user_entity_1 = require("./user.entity");
|
|
16
|
+
const workspace_entity_1 = require("./workspace.entity");
|
|
17
|
+
var AssetMetadataStatus;
|
|
18
|
+
(function (AssetMetadataStatus) {
|
|
19
|
+
AssetMetadataStatus["PENDING"] = "pending";
|
|
20
|
+
AssetMetadataStatus["PROCESSING"] = "processing";
|
|
21
|
+
AssetMetadataStatus["COMPLETED"] = "completed";
|
|
22
|
+
AssetMetadataStatus["FAILED"] = "failed";
|
|
23
|
+
})(AssetMetadataStatus || (exports.AssetMetadataStatus = AssetMetadataStatus = {}));
|
|
24
|
+
let AssetMetadata = class AssetMetadata {
|
|
25
|
+
};
|
|
26
|
+
exports.AssetMetadata = AssetMetadata;
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], AssetMetadata.prototype, "id", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.Column)({ name: 'asset_id', type: 'uuid' }),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], AssetMetadata.prototype, "assetId", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.ManyToOne)(() => asset_entity_1.Asset),
|
|
37
|
+
(0, typeorm_1.JoinColumn)({ name: 'asset_id' }),
|
|
38
|
+
__metadata("design:type", asset_entity_1.Asset)
|
|
39
|
+
], AssetMetadata.prototype, "asset", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.Column)({ name: 'user_id', type: 'uuid' }),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], AssetMetadata.prototype, "userId", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User),
|
|
46
|
+
(0, typeorm_1.JoinColumn)({ name: 'user_id' }),
|
|
47
|
+
__metadata("design:type", user_entity_1.User)
|
|
48
|
+
], AssetMetadata.prototype, "user", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.Column)({ name: 'workspace_id', type: 'uuid' }),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], AssetMetadata.prototype, "workspaceId", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typeorm_1.ManyToOne)(() => workspace_entity_1.Workspace),
|
|
55
|
+
(0, typeorm_1.JoinColumn)({ name: 'workspace_id' }),
|
|
56
|
+
__metadata("design:type", workspace_entity_1.Workspace)
|
|
57
|
+
], AssetMetadata.prototype, "workspace", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
|
|
60
|
+
__metadata("design:type", Object)
|
|
61
|
+
], AssetMetadata.prototype, "technical", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
|
|
64
|
+
__metadata("design:type", Object)
|
|
65
|
+
], AssetMetadata.prototype, "content", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, typeorm_1.Column)({ name: 'audio_features', type: 'jsonb', nullable: true }),
|
|
68
|
+
__metadata("design:type", Object)
|
|
69
|
+
], AssetMetadata.prototype, "audioFeatures", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, typeorm_1.Column)({ type: 'text', array: true, nullable: true }),
|
|
72
|
+
__metadata("design:type", Array)
|
|
73
|
+
], AssetMetadata.prototype, "tags", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
76
|
+
__metadata("design:type", String)
|
|
77
|
+
], AssetMetadata.prototype, "description", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
80
|
+
__metadata("design:type", String)
|
|
81
|
+
], AssetMetadata.prototype, "category", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
(0, typeorm_1.Column)({ name: 'usage_count', type: 'integer', default: 0 }),
|
|
84
|
+
__metadata("design:type", Number)
|
|
85
|
+
], AssetMetadata.prototype, "usageCount", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, typeorm_1.Column)({ name: 'last_used_at', type: 'timestamp', nullable: true }),
|
|
88
|
+
__metadata("design:type", Date)
|
|
89
|
+
], AssetMetadata.prototype, "lastUsedAt", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
(0, typeorm_1.Column)({ name: 'projects_used_in', type: 'text', array: true, nullable: true }),
|
|
92
|
+
__metadata("design:type", Array)
|
|
93
|
+
], AssetMetadata.prototype, "projectsUsedIn", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
(0, typeorm_1.Column)({ name: 'content_embedding', type: 'jsonb', nullable: true }),
|
|
96
|
+
__metadata("design:type", Array)
|
|
97
|
+
], AssetMetadata.prototype, "contentEmbedding", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, typeorm_1.Column)({ name: 'embedding_model', type: 'varchar', length: 100, nullable: true }),
|
|
100
|
+
__metadata("design:type", String)
|
|
101
|
+
], AssetMetadata.prototype, "embeddingModel", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, typeorm_1.Column)({ name: 'embedding_version', type: 'varchar', length: 50, nullable: true }),
|
|
104
|
+
__metadata("design:type", String)
|
|
105
|
+
], AssetMetadata.prototype, "embeddingVersion", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
(0, typeorm_1.Column)({
|
|
108
|
+
type: 'enum',
|
|
109
|
+
enum: AssetMetadataStatus,
|
|
110
|
+
default: AssetMetadataStatus.PENDING,
|
|
111
|
+
}),
|
|
112
|
+
__metadata("design:type", String)
|
|
113
|
+
], AssetMetadata.prototype, "status", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, typeorm_1.Column)({ name: 'processing_error', type: 'text', nullable: true }),
|
|
116
|
+
__metadata("design:type", String)
|
|
117
|
+
], AssetMetadata.prototype, "processingError", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
(0, typeorm_1.Column)({ name: 'ai_processed_at', type: 'timestamp', nullable: true }),
|
|
120
|
+
__metadata("design:type", Date)
|
|
121
|
+
], AssetMetadata.prototype, "aiProcessedAt", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
(0, typeorm_1.Column)({ name: 'embedding_generated_at', type: 'timestamp', nullable: true }),
|
|
124
|
+
__metadata("design:type", Date)
|
|
125
|
+
], AssetMetadata.prototype, "embeddingGeneratedAt", void 0);
|
|
126
|
+
__decorate([
|
|
127
|
+
(0, typeorm_1.CreateDateColumn)({ name: 'created_at' }),
|
|
128
|
+
__metadata("design:type", Date)
|
|
129
|
+
], AssetMetadata.prototype, "createdAt", void 0);
|
|
130
|
+
__decorate([
|
|
131
|
+
(0, typeorm_1.UpdateDateColumn)({ name: 'updated_at' }),
|
|
132
|
+
__metadata("design:type", Date)
|
|
133
|
+
], AssetMetadata.prototype, "updatedAt", void 0);
|
|
134
|
+
exports.AssetMetadata = AssetMetadata = __decorate([
|
|
135
|
+
(0, typeorm_1.Entity)('asset_metadata'),
|
|
136
|
+
(0, typeorm_1.Index)(['assetId'], { unique: true }),
|
|
137
|
+
(0, typeorm_1.Index)(['userId']),
|
|
138
|
+
(0, typeorm_1.Index)(['workspaceId']),
|
|
139
|
+
(0, typeorm_1.Index)(['status'])
|
|
140
|
+
], AssetMetadata);
|
package/dist/entities/index.d.ts
CHANGED
|
@@ -26,3 +26,8 @@ export * from './video-render.entity';
|
|
|
26
26
|
export * from './video-subtitle.entity';
|
|
27
27
|
export * from './video-filmstrip.entity';
|
|
28
28
|
export * from './audio-waveform.entity';
|
|
29
|
+
export * from './asset-metadata.entity';
|
|
30
|
+
export * from './project-metadata.entity';
|
|
31
|
+
export * from './user-context.entity';
|
|
32
|
+
export * from './ai-embedding.entity';
|
|
33
|
+
export * from './metadata-activity-log.entity';
|
package/dist/entities/index.js
CHANGED
|
@@ -44,3 +44,8 @@ __exportStar(require("./video-render.entity"), exports);
|
|
|
44
44
|
__exportStar(require("./video-subtitle.entity"), exports);
|
|
45
45
|
__exportStar(require("./video-filmstrip.entity"), exports);
|
|
46
46
|
__exportStar(require("./audio-waveform.entity"), exports);
|
|
47
|
+
__exportStar(require("./asset-metadata.entity"), exports);
|
|
48
|
+
__exportStar(require("./project-metadata.entity"), exports);
|
|
49
|
+
__exportStar(require("./user-context.entity"), exports);
|
|
50
|
+
__exportStar(require("./ai-embedding.entity"), exports);
|
|
51
|
+
__exportStar(require("./metadata-activity-log.entity"), exports);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export declare enum MetadataActivityAction {
|
|
2
|
+
ASSET_UPLOADED = "asset_uploaded",
|
|
3
|
+
ASSET_METADATA_EXTRACTED = "asset_metadata_extracted",
|
|
4
|
+
ASSET_AI_ENRICHED = "asset_ai_enriched",
|
|
5
|
+
ASSET_EMBEDDING_GENERATED = "asset_embedding_generated",
|
|
6
|
+
ASSET_USED_IN_PROJECT = "asset_used_in_project",
|
|
7
|
+
ASSET_TAGGED = "asset_tagged",
|
|
8
|
+
ASSET_DELETED = "asset_deleted",
|
|
9
|
+
PROJECT_CREATED = "project_created",
|
|
10
|
+
PROJECT_UPDATED = "project_updated",
|
|
11
|
+
PROJECT_EXPORTED = "project_exported",
|
|
12
|
+
PROJECT_METADATA_UPDATED = "project_metadata_updated",
|
|
13
|
+
PROJECT_EMBEDDING_GENERATED = "project_embedding_generated",
|
|
14
|
+
EDIT_CLIP_ADDED = "edit_clip_added",
|
|
15
|
+
EDIT_TRANSITION_ADDED = "edit_transition_added",
|
|
16
|
+
EDIT_EFFECT_ADDED = "edit_effect_added",
|
|
17
|
+
EDIT_TEXT_ADDED = "edit_text_added",
|
|
18
|
+
EDIT_AUDIO_ADDED = "edit_audio_added",
|
|
19
|
+
EDIT_TRIM = "edit_trim",
|
|
20
|
+
EDIT_UNDO = "edit_undo",
|
|
21
|
+
EDIT_REDO = "edit_redo",
|
|
22
|
+
AI_CONTEXT_REQUESTED = "ai_context_requested",
|
|
23
|
+
AI_SUGGESTION_ACCEPTED = "ai_suggestion_accepted",
|
|
24
|
+
AI_SUGGESTION_REJECTED = "ai_suggestion_rejected",
|
|
25
|
+
AI_CONTENT_GENERATED = "ai_content_generated",
|
|
26
|
+
USER_CONTEXT_AGGREGATED = "user_context_aggregated",
|
|
27
|
+
USER_PREFERENCES_UPDATED = "user_preferences_updated"
|
|
28
|
+
}
|
|
29
|
+
export declare enum MetadataActivitySource {
|
|
30
|
+
USER = "user",
|
|
31
|
+
SYSTEM = "system",
|
|
32
|
+
AI_AUTO = "ai_auto",
|
|
33
|
+
AI_MANUAL = "ai_manual"
|
|
34
|
+
}
|
|
35
|
+
export declare class MetadataActivityLog {
|
|
36
|
+
id: string;
|
|
37
|
+
userId: string;
|
|
38
|
+
workspaceId: string;
|
|
39
|
+
sessionId: string;
|
|
40
|
+
entityType: string;
|
|
41
|
+
entityId: string;
|
|
42
|
+
action: MetadataActivityAction;
|
|
43
|
+
source: MetadataActivitySource;
|
|
44
|
+
metadataBefore: Record<string, any>;
|
|
45
|
+
metadataAfter: Record<string, any>;
|
|
46
|
+
details: Record<string, any>;
|
|
47
|
+
projectId: string;
|
|
48
|
+
durationMs: number;
|
|
49
|
+
createdAt: Date;
|
|
50
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
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.MetadataActivityLog = exports.MetadataActivitySource = exports.MetadataActivityAction = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
var MetadataActivityAction;
|
|
15
|
+
(function (MetadataActivityAction) {
|
|
16
|
+
MetadataActivityAction["ASSET_UPLOADED"] = "asset_uploaded";
|
|
17
|
+
MetadataActivityAction["ASSET_METADATA_EXTRACTED"] = "asset_metadata_extracted";
|
|
18
|
+
MetadataActivityAction["ASSET_AI_ENRICHED"] = "asset_ai_enriched";
|
|
19
|
+
MetadataActivityAction["ASSET_EMBEDDING_GENERATED"] = "asset_embedding_generated";
|
|
20
|
+
MetadataActivityAction["ASSET_USED_IN_PROJECT"] = "asset_used_in_project";
|
|
21
|
+
MetadataActivityAction["ASSET_TAGGED"] = "asset_tagged";
|
|
22
|
+
MetadataActivityAction["ASSET_DELETED"] = "asset_deleted";
|
|
23
|
+
MetadataActivityAction["PROJECT_CREATED"] = "project_created";
|
|
24
|
+
MetadataActivityAction["PROJECT_UPDATED"] = "project_updated";
|
|
25
|
+
MetadataActivityAction["PROJECT_EXPORTED"] = "project_exported";
|
|
26
|
+
MetadataActivityAction["PROJECT_METADATA_UPDATED"] = "project_metadata_updated";
|
|
27
|
+
MetadataActivityAction["PROJECT_EMBEDDING_GENERATED"] = "project_embedding_generated";
|
|
28
|
+
MetadataActivityAction["EDIT_CLIP_ADDED"] = "edit_clip_added";
|
|
29
|
+
MetadataActivityAction["EDIT_TRANSITION_ADDED"] = "edit_transition_added";
|
|
30
|
+
MetadataActivityAction["EDIT_EFFECT_ADDED"] = "edit_effect_added";
|
|
31
|
+
MetadataActivityAction["EDIT_TEXT_ADDED"] = "edit_text_added";
|
|
32
|
+
MetadataActivityAction["EDIT_AUDIO_ADDED"] = "edit_audio_added";
|
|
33
|
+
MetadataActivityAction["EDIT_TRIM"] = "edit_trim";
|
|
34
|
+
MetadataActivityAction["EDIT_UNDO"] = "edit_undo";
|
|
35
|
+
MetadataActivityAction["EDIT_REDO"] = "edit_redo";
|
|
36
|
+
MetadataActivityAction["AI_CONTEXT_REQUESTED"] = "ai_context_requested";
|
|
37
|
+
MetadataActivityAction["AI_SUGGESTION_ACCEPTED"] = "ai_suggestion_accepted";
|
|
38
|
+
MetadataActivityAction["AI_SUGGESTION_REJECTED"] = "ai_suggestion_rejected";
|
|
39
|
+
MetadataActivityAction["AI_CONTENT_GENERATED"] = "ai_content_generated";
|
|
40
|
+
MetadataActivityAction["USER_CONTEXT_AGGREGATED"] = "user_context_aggregated";
|
|
41
|
+
MetadataActivityAction["USER_PREFERENCES_UPDATED"] = "user_preferences_updated";
|
|
42
|
+
})(MetadataActivityAction || (exports.MetadataActivityAction = MetadataActivityAction = {}));
|
|
43
|
+
var MetadataActivitySource;
|
|
44
|
+
(function (MetadataActivitySource) {
|
|
45
|
+
MetadataActivitySource["USER"] = "user";
|
|
46
|
+
MetadataActivitySource["SYSTEM"] = "system";
|
|
47
|
+
MetadataActivitySource["AI_AUTO"] = "ai_auto";
|
|
48
|
+
MetadataActivitySource["AI_MANUAL"] = "ai_manual";
|
|
49
|
+
})(MetadataActivitySource || (exports.MetadataActivitySource = MetadataActivitySource = {}));
|
|
50
|
+
let MetadataActivityLog = class MetadataActivityLog {
|
|
51
|
+
};
|
|
52
|
+
exports.MetadataActivityLog = MetadataActivityLog;
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], MetadataActivityLog.prototype, "id", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, typeorm_1.Column)({ name: 'user_id', type: 'uuid' }),
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], MetadataActivityLog.prototype, "userId", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, typeorm_1.Column)({ name: 'workspace_id', type: 'uuid', nullable: true }),
|
|
63
|
+
__metadata("design:type", String)
|
|
64
|
+
], MetadataActivityLog.prototype, "workspaceId", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, typeorm_1.Column)({ name: 'session_id', type: 'varchar', length: 255, nullable: true }),
|
|
67
|
+
__metadata("design:type", String)
|
|
68
|
+
], MetadataActivityLog.prototype, "sessionId", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, typeorm_1.Column)({ name: 'entity_type', type: 'varchar', length: 50 }),
|
|
71
|
+
__metadata("design:type", String)
|
|
72
|
+
], MetadataActivityLog.prototype, "entityType", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, typeorm_1.Column)({ name: 'entity_id', type: 'varchar', length: 255 }),
|
|
75
|
+
__metadata("design:type", String)
|
|
76
|
+
], MetadataActivityLog.prototype, "entityId", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, typeorm_1.Column)({
|
|
79
|
+
type: 'enum',
|
|
80
|
+
enum: MetadataActivityAction,
|
|
81
|
+
}),
|
|
82
|
+
__metadata("design:type", String)
|
|
83
|
+
], MetadataActivityLog.prototype, "action", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, typeorm_1.Column)({
|
|
86
|
+
type: 'enum',
|
|
87
|
+
enum: MetadataActivitySource,
|
|
88
|
+
default: MetadataActivitySource.USER,
|
|
89
|
+
}),
|
|
90
|
+
__metadata("design:type", String)
|
|
91
|
+
], MetadataActivityLog.prototype, "source", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, typeorm_1.Column)({ name: 'metadata_before', type: 'jsonb', nullable: true }),
|
|
94
|
+
__metadata("design:type", Object)
|
|
95
|
+
], MetadataActivityLog.prototype, "metadataBefore", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
(0, typeorm_1.Column)({ name: 'metadata_after', type: 'jsonb', nullable: true }),
|
|
98
|
+
__metadata("design:type", Object)
|
|
99
|
+
], MetadataActivityLog.prototype, "metadataAfter", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
|
|
102
|
+
__metadata("design:type", Object)
|
|
103
|
+
], MetadataActivityLog.prototype, "details", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, typeorm_1.Column)({ name: 'project_id', type: 'varchar', length: 255, nullable: true }),
|
|
106
|
+
__metadata("design:type", String)
|
|
107
|
+
], MetadataActivityLog.prototype, "projectId", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, typeorm_1.Column)({ name: 'duration_ms', type: 'integer', nullable: true }),
|
|
110
|
+
__metadata("design:type", Number)
|
|
111
|
+
], MetadataActivityLog.prototype, "durationMs", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
(0, typeorm_1.CreateDateColumn)({ name: 'created_at' }),
|
|
114
|
+
__metadata("design:type", Date)
|
|
115
|
+
], MetadataActivityLog.prototype, "createdAt", void 0);
|
|
116
|
+
exports.MetadataActivityLog = MetadataActivityLog = __decorate([
|
|
117
|
+
(0, typeorm_1.Entity)('metadata_activity_log'),
|
|
118
|
+
(0, typeorm_1.Index)(['userId']),
|
|
119
|
+
(0, typeorm_1.Index)(['workspaceId']),
|
|
120
|
+
(0, typeorm_1.Index)(['entityType', 'entityId']),
|
|
121
|
+
(0, typeorm_1.Index)(['action']),
|
|
122
|
+
(0, typeorm_1.Index)(['createdAt'])
|
|
123
|
+
], MetadataActivityLog);
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { EditorProject } from './editor-project.entity';
|
|
2
|
+
import { User } from './user.entity';
|
|
3
|
+
import { Workspace } from './workspace.entity';
|
|
4
|
+
export declare class ProjectMetadata {
|
|
5
|
+
id: string;
|
|
6
|
+
projectId: string;
|
|
7
|
+
project: EditorProject;
|
|
8
|
+
userId: string;
|
|
9
|
+
user: User;
|
|
10
|
+
workspaceId: string;
|
|
11
|
+
workspace: Workspace;
|
|
12
|
+
projectType: string;
|
|
13
|
+
targetPlatform: string;
|
|
14
|
+
targetDurationMs: number;
|
|
15
|
+
mood: string;
|
|
16
|
+
style: string;
|
|
17
|
+
genre: string;
|
|
18
|
+
colorPalette: string[];
|
|
19
|
+
brandGuidelines: {
|
|
20
|
+
primaryColor?: string;
|
|
21
|
+
secondaryColors?: string[];
|
|
22
|
+
fonts?: string[];
|
|
23
|
+
logoAssetId?: string;
|
|
24
|
+
watermarkAssetId?: string;
|
|
25
|
+
};
|
|
26
|
+
composition: {
|
|
27
|
+
duration?: number;
|
|
28
|
+
clipCount?: number;
|
|
29
|
+
trackCount?: number;
|
|
30
|
+
hasAudio?: boolean;
|
|
31
|
+
hasMusic?: boolean;
|
|
32
|
+
hasVoiceover?: boolean;
|
|
33
|
+
hasCaptions?: boolean;
|
|
34
|
+
textElementCount?: number;
|
|
35
|
+
effectCount?: number;
|
|
36
|
+
transitionCount?: number;
|
|
37
|
+
};
|
|
38
|
+
styleFingerprint: {
|
|
39
|
+
transitions?: string[];
|
|
40
|
+
avgClipDuration?: number;
|
|
41
|
+
pacing?: 'fast' | 'medium' | 'slow';
|
|
42
|
+
fontFamilies?: string[];
|
|
43
|
+
effectTypes?: string[];
|
|
44
|
+
colorGrading?: string;
|
|
45
|
+
};
|
|
46
|
+
editSessionsCount: number;
|
|
47
|
+
totalEditTimeMs: number;
|
|
48
|
+
assetsUsed: string[];
|
|
49
|
+
effectsUsed: Record<string, number>;
|
|
50
|
+
exportHistory: Array<{
|
|
51
|
+
exportedAt: string;
|
|
52
|
+
format: string;
|
|
53
|
+
resolution: string;
|
|
54
|
+
fileSize?: number;
|
|
55
|
+
}>;
|
|
56
|
+
aiSuggestionsApplied: Array<{
|
|
57
|
+
suggestionType: string;
|
|
58
|
+
appliedAt: string;
|
|
59
|
+
accepted: boolean;
|
|
60
|
+
}>;
|
|
61
|
+
generatedContent: Array<{
|
|
62
|
+
contentType: string;
|
|
63
|
+
generatedAt: string;
|
|
64
|
+
prompt?: string;
|
|
65
|
+
}>;
|
|
66
|
+
projectEmbedding: number[];
|
|
67
|
+
embeddingGeneratedAt: Date;
|
|
68
|
+
createdAt: Date;
|
|
69
|
+
updatedAt: Date;
|
|
70
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
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.ProjectMetadata = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const editor_project_entity_1 = require("./editor-project.entity");
|
|
15
|
+
const user_entity_1 = require("./user.entity");
|
|
16
|
+
const workspace_entity_1 = require("./workspace.entity");
|
|
17
|
+
let ProjectMetadata = class ProjectMetadata {
|
|
18
|
+
};
|
|
19
|
+
exports.ProjectMetadata = ProjectMetadata;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], ProjectMetadata.prototype, "id", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.Column)({ name: 'project_id', type: 'varchar', length: 255 }),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], ProjectMetadata.prototype, "projectId", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.ManyToOne)(() => editor_project_entity_1.EditorProject),
|
|
30
|
+
(0, typeorm_1.JoinColumn)({ name: 'project_id' }),
|
|
31
|
+
__metadata("design:type", editor_project_entity_1.EditorProject)
|
|
32
|
+
], ProjectMetadata.prototype, "project", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({ name: 'user_id', type: 'uuid' }),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], ProjectMetadata.prototype, "userId", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User),
|
|
39
|
+
(0, typeorm_1.JoinColumn)({ name: 'user_id' }),
|
|
40
|
+
__metadata("design:type", user_entity_1.User)
|
|
41
|
+
], ProjectMetadata.prototype, "user", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({ name: 'workspace_id', type: 'uuid' }),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], ProjectMetadata.prototype, "workspaceId", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.ManyToOne)(() => workspace_entity_1.Workspace),
|
|
48
|
+
(0, typeorm_1.JoinColumn)({ name: 'workspace_id' }),
|
|
49
|
+
__metadata("design:type", workspace_entity_1.Workspace)
|
|
50
|
+
], ProjectMetadata.prototype, "workspace", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.Column)({ name: 'project_type', type: 'varchar', length: 100, nullable: true }),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], ProjectMetadata.prototype, "projectType", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, typeorm_1.Column)({ name: 'target_platform', type: 'varchar', length: 100, nullable: true }),
|
|
57
|
+
__metadata("design:type", String)
|
|
58
|
+
], ProjectMetadata.prototype, "targetPlatform", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, typeorm_1.Column)({ name: 'target_duration_ms', type: 'integer', nullable: true }),
|
|
61
|
+
__metadata("design:type", Number)
|
|
62
|
+
], ProjectMetadata.prototype, "targetDurationMs", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true }),
|
|
65
|
+
__metadata("design:type", String)
|
|
66
|
+
], ProjectMetadata.prototype, "mood", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true }),
|
|
69
|
+
__metadata("design:type", String)
|
|
70
|
+
], ProjectMetadata.prototype, "style", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true }),
|
|
73
|
+
__metadata("design:type", String)
|
|
74
|
+
], ProjectMetadata.prototype, "genre", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, typeorm_1.Column)({ name: 'color_palette', type: 'jsonb', nullable: true }),
|
|
77
|
+
__metadata("design:type", Array)
|
|
78
|
+
], ProjectMetadata.prototype, "colorPalette", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, typeorm_1.Column)({ name: 'brand_guidelines', type: 'jsonb', nullable: true }),
|
|
81
|
+
__metadata("design:type", Object)
|
|
82
|
+
], ProjectMetadata.prototype, "brandGuidelines", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
|
|
85
|
+
__metadata("design:type", Object)
|
|
86
|
+
], ProjectMetadata.prototype, "composition", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
(0, typeorm_1.Column)({ name: 'style_fingerprint', type: 'jsonb', nullable: true }),
|
|
89
|
+
__metadata("design:type", Object)
|
|
90
|
+
], ProjectMetadata.prototype, "styleFingerprint", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
(0, typeorm_1.Column)({ name: 'edit_sessions_count', type: 'integer', default: 0 }),
|
|
93
|
+
__metadata("design:type", Number)
|
|
94
|
+
], ProjectMetadata.prototype, "editSessionsCount", void 0);
|
|
95
|
+
__decorate([
|
|
96
|
+
(0, typeorm_1.Column)({ name: 'total_edit_time_ms', type: 'bigint', default: 0 }),
|
|
97
|
+
__metadata("design:type", Number)
|
|
98
|
+
], ProjectMetadata.prototype, "totalEditTimeMs", void 0);
|
|
99
|
+
__decorate([
|
|
100
|
+
(0, typeorm_1.Column)({ name: 'assets_used', type: 'text', array: true, nullable: true }),
|
|
101
|
+
__metadata("design:type", Array)
|
|
102
|
+
], ProjectMetadata.prototype, "assetsUsed", void 0);
|
|
103
|
+
__decorate([
|
|
104
|
+
(0, typeorm_1.Column)({ name: 'effects_used', type: 'jsonb', nullable: true }),
|
|
105
|
+
__metadata("design:type", Object)
|
|
106
|
+
], ProjectMetadata.prototype, "effectsUsed", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
(0, typeorm_1.Column)({ name: 'export_history', type: 'jsonb', nullable: true }),
|
|
109
|
+
__metadata("design:type", Array)
|
|
110
|
+
], ProjectMetadata.prototype, "exportHistory", void 0);
|
|
111
|
+
__decorate([
|
|
112
|
+
(0, typeorm_1.Column)({ name: 'ai_suggestions_applied', type: 'jsonb', nullable: true }),
|
|
113
|
+
__metadata("design:type", Array)
|
|
114
|
+
], ProjectMetadata.prototype, "aiSuggestionsApplied", void 0);
|
|
115
|
+
__decorate([
|
|
116
|
+
(0, typeorm_1.Column)({ name: 'generated_content', type: 'jsonb', nullable: true }),
|
|
117
|
+
__metadata("design:type", Array)
|
|
118
|
+
], ProjectMetadata.prototype, "generatedContent", void 0);
|
|
119
|
+
__decorate([
|
|
120
|
+
(0, typeorm_1.Column)({ name: 'project_embedding', type: 'jsonb', nullable: true }),
|
|
121
|
+
__metadata("design:type", Array)
|
|
122
|
+
], ProjectMetadata.prototype, "projectEmbedding", void 0);
|
|
123
|
+
__decorate([
|
|
124
|
+
(0, typeorm_1.Column)({ name: 'embedding_generated_at', type: 'timestamp', nullable: true }),
|
|
125
|
+
__metadata("design:type", Date)
|
|
126
|
+
], ProjectMetadata.prototype, "embeddingGeneratedAt", void 0);
|
|
127
|
+
__decorate([
|
|
128
|
+
(0, typeorm_1.CreateDateColumn)({ name: 'created_at' }),
|
|
129
|
+
__metadata("design:type", Date)
|
|
130
|
+
], ProjectMetadata.prototype, "createdAt", void 0);
|
|
131
|
+
__decorate([
|
|
132
|
+
(0, typeorm_1.UpdateDateColumn)({ name: 'updated_at' }),
|
|
133
|
+
__metadata("design:type", Date)
|
|
134
|
+
], ProjectMetadata.prototype, "updatedAt", void 0);
|
|
135
|
+
exports.ProjectMetadata = ProjectMetadata = __decorate([
|
|
136
|
+
(0, typeorm_1.Entity)('project_metadata'),
|
|
137
|
+
(0, typeorm_1.Index)(['projectId'], { unique: true }),
|
|
138
|
+
(0, typeorm_1.Index)(['userId']),
|
|
139
|
+
(0, typeorm_1.Index)(['workspaceId']),
|
|
140
|
+
(0, typeorm_1.Index)(['projectType'])
|
|
141
|
+
], ProjectMetadata);
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { User } from './user.entity';
|
|
2
|
+
export declare class UserContext {
|
|
3
|
+
id: string;
|
|
4
|
+
userId: string;
|
|
5
|
+
user: User;
|
|
6
|
+
preferredStyles: string[];
|
|
7
|
+
preferredGenres: string[];
|
|
8
|
+
preferredTransitions: string[];
|
|
9
|
+
preferredEffects: string[];
|
|
10
|
+
preferredFonts: string[];
|
|
11
|
+
defaultAspectRatio: string;
|
|
12
|
+
defaultResolution: string;
|
|
13
|
+
defaultFps: number;
|
|
14
|
+
brandColors: {
|
|
15
|
+
primary?: string;
|
|
16
|
+
secondary?: string[];
|
|
17
|
+
accent?: string;
|
|
18
|
+
};
|
|
19
|
+
brandFonts: {
|
|
20
|
+
heading?: string;
|
|
21
|
+
body?: string;
|
|
22
|
+
};
|
|
23
|
+
brandLogoAssetIds: string[];
|
|
24
|
+
brandWatermarkAssetId: string;
|
|
25
|
+
avgProjectDurationMs: number;
|
|
26
|
+
avgSessionLengthMs: number;
|
|
27
|
+
totalProjectsCount: number;
|
|
28
|
+
completedProjectsCount: number;
|
|
29
|
+
totalEditTimeMs: number;
|
|
30
|
+
mostUsedEffects: Record<string, number>;
|
|
31
|
+
mostUsedTransitions: Record<string, number>;
|
|
32
|
+
editingPatterns: {
|
|
33
|
+
avgClipDuration?: number;
|
|
34
|
+
avgTransitionsPerProject?: number;
|
|
35
|
+
avgTextElementsPerProject?: number;
|
|
36
|
+
preferredPacing?: 'fast' | 'medium' | 'slow';
|
|
37
|
+
musicUsageRate?: number;
|
|
38
|
+
captionUsageRate?: number;
|
|
39
|
+
};
|
|
40
|
+
skillLevel: 'beginner' | 'intermediate' | 'advanced' | 'expert';
|
|
41
|
+
activityHeatmap: {
|
|
42
|
+
peakHours?: number[];
|
|
43
|
+
peakDays?: number[];
|
|
44
|
+
};
|
|
45
|
+
aiPromptsCount: number;
|
|
46
|
+
aiSuggestionsAccepted: number;
|
|
47
|
+
aiSuggestionsRejected: number;
|
|
48
|
+
preferredAiModels: string[];
|
|
49
|
+
recentPrompts: Array<{
|
|
50
|
+
prompt: string;
|
|
51
|
+
timestamp: string;
|
|
52
|
+
successful: boolean;
|
|
53
|
+
}>;
|
|
54
|
+
userEmbedding: number[];
|
|
55
|
+
embeddingGeneratedAt: Date;
|
|
56
|
+
lastAggregatedAt: Date;
|
|
57
|
+
createdAt: Date;
|
|
58
|
+
updatedAt: Date;
|
|
59
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
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.UserContext = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const user_entity_1 = require("./user.entity");
|
|
15
|
+
let UserContext = class UserContext {
|
|
16
|
+
};
|
|
17
|
+
exports.UserContext = UserContext;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], UserContext.prototype, "id", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.Column)({ name: 'user_id', type: 'uuid' }),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], UserContext.prototype, "userId", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.OneToOne)(() => user_entity_1.User),
|
|
28
|
+
(0, typeorm_1.JoinColumn)({ name: 'user_id' }),
|
|
29
|
+
__metadata("design:type", user_entity_1.User)
|
|
30
|
+
], UserContext.prototype, "user", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.Column)({ name: 'preferred_styles', type: 'text', array: true, nullable: true }),
|
|
33
|
+
__metadata("design:type", Array)
|
|
34
|
+
], UserContext.prototype, "preferredStyles", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Column)({ name: 'preferred_genres', type: 'text', array: true, nullable: true }),
|
|
37
|
+
__metadata("design:type", Array)
|
|
38
|
+
], UserContext.prototype, "preferredGenres", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.Column)({ name: 'preferred_transitions', type: 'text', array: true, nullable: true }),
|
|
41
|
+
__metadata("design:type", Array)
|
|
42
|
+
], UserContext.prototype, "preferredTransitions", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.Column)({ name: 'preferred_effects', type: 'text', array: true, nullable: true }),
|
|
45
|
+
__metadata("design:type", Array)
|
|
46
|
+
], UserContext.prototype, "preferredEffects", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typeorm_1.Column)({ name: 'preferred_fonts', type: 'text', array: true, nullable: true }),
|
|
49
|
+
__metadata("design:type", Array)
|
|
50
|
+
], UserContext.prototype, "preferredFonts", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.Column)({ name: 'default_aspect_ratio', type: 'varchar', length: 20, nullable: true }),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], UserContext.prototype, "defaultAspectRatio", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, typeorm_1.Column)({ name: 'default_resolution', type: 'varchar', length: 20, nullable: true }),
|
|
57
|
+
__metadata("design:type", String)
|
|
58
|
+
], UserContext.prototype, "defaultResolution", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, typeorm_1.Column)({ name: 'default_fps', type: 'integer', nullable: true }),
|
|
61
|
+
__metadata("design:type", Number)
|
|
62
|
+
], UserContext.prototype, "defaultFps", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, typeorm_1.Column)({ name: 'brand_colors', type: 'jsonb', nullable: true }),
|
|
65
|
+
__metadata("design:type", Object)
|
|
66
|
+
], UserContext.prototype, "brandColors", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, typeorm_1.Column)({ name: 'brand_fonts', type: 'jsonb', nullable: true }),
|
|
69
|
+
__metadata("design:type", Object)
|
|
70
|
+
], UserContext.prototype, "brandFonts", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, typeorm_1.Column)({ name: 'brand_logo_asset_ids', type: 'text', array: true, nullable: true }),
|
|
73
|
+
__metadata("design:type", Array)
|
|
74
|
+
], UserContext.prototype, "brandLogoAssetIds", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, typeorm_1.Column)({ name: 'brand_watermark_asset_id', type: 'uuid', nullable: true }),
|
|
77
|
+
__metadata("design:type", String)
|
|
78
|
+
], UserContext.prototype, "brandWatermarkAssetId", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, typeorm_1.Column)({ name: 'avg_project_duration_ms', type: 'integer', nullable: true }),
|
|
81
|
+
__metadata("design:type", Number)
|
|
82
|
+
], UserContext.prototype, "avgProjectDurationMs", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, typeorm_1.Column)({ name: 'avg_session_length_ms', type: 'integer', nullable: true }),
|
|
85
|
+
__metadata("design:type", Number)
|
|
86
|
+
], UserContext.prototype, "avgSessionLengthMs", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
(0, typeorm_1.Column)({ name: 'total_projects_count', type: 'integer', default: 0 }),
|
|
89
|
+
__metadata("design:type", Number)
|
|
90
|
+
], UserContext.prototype, "totalProjectsCount", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
(0, typeorm_1.Column)({ name: 'completed_projects_count', type: 'integer', default: 0 }),
|
|
93
|
+
__metadata("design:type", Number)
|
|
94
|
+
], UserContext.prototype, "completedProjectsCount", void 0);
|
|
95
|
+
__decorate([
|
|
96
|
+
(0, typeorm_1.Column)({ name: 'total_edit_time_ms', type: 'bigint', default: 0 }),
|
|
97
|
+
__metadata("design:type", Number)
|
|
98
|
+
], UserContext.prototype, "totalEditTimeMs", void 0);
|
|
99
|
+
__decorate([
|
|
100
|
+
(0, typeorm_1.Column)({ name: 'most_used_effects', type: 'jsonb', nullable: true }),
|
|
101
|
+
__metadata("design:type", Object)
|
|
102
|
+
], UserContext.prototype, "mostUsedEffects", void 0);
|
|
103
|
+
__decorate([
|
|
104
|
+
(0, typeorm_1.Column)({ name: 'most_used_transitions', type: 'jsonb', nullable: true }),
|
|
105
|
+
__metadata("design:type", Object)
|
|
106
|
+
], UserContext.prototype, "mostUsedTransitions", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
(0, typeorm_1.Column)({ name: 'editing_patterns', type: 'jsonb', nullable: true }),
|
|
109
|
+
__metadata("design:type", Object)
|
|
110
|
+
], UserContext.prototype, "editingPatterns", void 0);
|
|
111
|
+
__decorate([
|
|
112
|
+
(0, typeorm_1.Column)({ name: 'skill_level', type: 'varchar', length: 50, nullable: true }),
|
|
113
|
+
__metadata("design:type", String)
|
|
114
|
+
], UserContext.prototype, "skillLevel", void 0);
|
|
115
|
+
__decorate([
|
|
116
|
+
(0, typeorm_1.Column)({ name: 'activity_heatmap', type: 'jsonb', nullable: true }),
|
|
117
|
+
__metadata("design:type", Object)
|
|
118
|
+
], UserContext.prototype, "activityHeatmap", void 0);
|
|
119
|
+
__decorate([
|
|
120
|
+
(0, typeorm_1.Column)({ name: 'ai_prompts_count', type: 'integer', default: 0 }),
|
|
121
|
+
__metadata("design:type", Number)
|
|
122
|
+
], UserContext.prototype, "aiPromptsCount", void 0);
|
|
123
|
+
__decorate([
|
|
124
|
+
(0, typeorm_1.Column)({ name: 'ai_suggestions_accepted', type: 'integer', default: 0 }),
|
|
125
|
+
__metadata("design:type", Number)
|
|
126
|
+
], UserContext.prototype, "aiSuggestionsAccepted", void 0);
|
|
127
|
+
__decorate([
|
|
128
|
+
(0, typeorm_1.Column)({ name: 'ai_suggestions_rejected', type: 'integer', default: 0 }),
|
|
129
|
+
__metadata("design:type", Number)
|
|
130
|
+
], UserContext.prototype, "aiSuggestionsRejected", void 0);
|
|
131
|
+
__decorate([
|
|
132
|
+
(0, typeorm_1.Column)({ name: 'preferred_ai_models', type: 'text', array: true, nullable: true }),
|
|
133
|
+
__metadata("design:type", Array)
|
|
134
|
+
], UserContext.prototype, "preferredAiModels", void 0);
|
|
135
|
+
__decorate([
|
|
136
|
+
(0, typeorm_1.Column)({ name: 'recent_prompts', type: 'jsonb', nullable: true }),
|
|
137
|
+
__metadata("design:type", Array)
|
|
138
|
+
], UserContext.prototype, "recentPrompts", void 0);
|
|
139
|
+
__decorate([
|
|
140
|
+
(0, typeorm_1.Column)({ name: 'user_embedding', type: 'jsonb', nullable: true }),
|
|
141
|
+
__metadata("design:type", Array)
|
|
142
|
+
], UserContext.prototype, "userEmbedding", void 0);
|
|
143
|
+
__decorate([
|
|
144
|
+
(0, typeorm_1.Column)({ name: 'embedding_generated_at', type: 'timestamp', nullable: true }),
|
|
145
|
+
__metadata("design:type", Date)
|
|
146
|
+
], UserContext.prototype, "embeddingGeneratedAt", void 0);
|
|
147
|
+
__decorate([
|
|
148
|
+
(0, typeorm_1.Column)({ name: 'last_aggregated_at', type: 'timestamp', nullable: true }),
|
|
149
|
+
__metadata("design:type", Date)
|
|
150
|
+
], UserContext.prototype, "lastAggregatedAt", void 0);
|
|
151
|
+
__decorate([
|
|
152
|
+
(0, typeorm_1.CreateDateColumn)({ name: 'created_at' }),
|
|
153
|
+
__metadata("design:type", Date)
|
|
154
|
+
], UserContext.prototype, "createdAt", void 0);
|
|
155
|
+
__decorate([
|
|
156
|
+
(0, typeorm_1.UpdateDateColumn)({ name: 'updated_at' }),
|
|
157
|
+
__metadata("design:type", Date)
|
|
158
|
+
], UserContext.prototype, "updatedAt", void 0);
|
|
159
|
+
exports.UserContext = UserContext = __decorate([
|
|
160
|
+
(0, typeorm_1.Entity)('user_context'),
|
|
161
|
+
(0, typeorm_1.Index)(['userId'], { unique: true })
|
|
162
|
+
], UserContext);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clhq-postgres-module",
|
|
3
|
-
"version": "1.1.0-alpha.
|
|
3
|
+
"version": "1.1.0-alpha.106",
|
|
4
4
|
"description": "PostgreSQL module using TypeORM for Clippy",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -38,6 +38,9 @@
|
|
|
38
38
|
"db:migrate:016": "npx ts-node scripts/run-migrations.ts 016",
|
|
39
39
|
"db:migrate:017": "npx ts-node scripts/run-migrations.ts 017",
|
|
40
40
|
"db:migrate:018": "npx ts-node scripts/run-migrations.ts 018",
|
|
41
|
+
"db:migrate:019": "npx ts-node scripts/run-migrations.ts 019",
|
|
42
|
+
"db:migrate:020": "npx ts-node scripts/run-migrations.ts 020",
|
|
43
|
+
"db:migrate:metadata": "npx ts-node scripts/run-migrations.ts 019 && npx ts-node scripts/run-migrations.ts 020",
|
|
41
44
|
"db:verify": "env-cmd -f ../../.env.dev npx ts-node scripts/verify-tables.ts",
|
|
42
45
|
"db:test": "env-cmd -f ../../.env.dev npx ts-node scripts/test-connections.ts",
|
|
43
46
|
"db:sync": "env-cmd -f ../../.env.dev npm run typeorm schema:sync -- -d src/config/data-source.ts",
|