clhq-postgres-module 1.1.0-alpha.94 → 1.1.0-alpha.96

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.
@@ -21,6 +21,7 @@ export declare class Asset {
21
21
  uploadedBy: string;
22
22
  user: User;
23
23
  categoryId: string;
24
+ uniqueId: string;
24
25
  name: string;
25
26
  originalFilename: string;
26
27
  fileType: string;
@@ -58,12 +58,27 @@ __decorate([
58
58
  (0, typeorm_1.Column)({ name: 'category_id', type: 'uuid', nullable: true }),
59
59
  __metadata("design:type", String)
60
60
  ], Asset.prototype, "categoryId", void 0);
61
+ __decorate([
62
+ (0, typeorm_1.Column)({
63
+ name: 'unique_id',
64
+ type: 'varchar',
65
+ length: 255,
66
+ nullable: true,
67
+ select: false
68
+ }),
69
+ __metadata("design:type", String)
70
+ ], Asset.prototype, "uniqueId", void 0);
61
71
  __decorate([
62
72
  (0, typeorm_1.Column)({ type: 'varchar', length: 255 }),
63
73
  __metadata("design:type", String)
64
74
  ], Asset.prototype, "name", void 0);
65
75
  __decorate([
66
- (0, typeorm_1.Column)({ name: 'original_filename', type: 'varchar', length: 500, nullable: true }),
76
+ (0, typeorm_1.Column)({
77
+ name: 'original_filename',
78
+ type: 'varchar',
79
+ length: 500,
80
+ nullable: true
81
+ }),
67
82
  __metadata("design:type", String)
68
83
  ], Asset.prototype, "originalFilename", void 0);
69
84
  __decorate([
@@ -103,7 +118,13 @@ __decorate([
103
118
  __metadata("design:type", Number)
104
119
  ], Asset.prototype, "height", void 0);
105
120
  __decorate([
106
- (0, typeorm_1.Column)({ name: 'frame_rate', type: 'decimal', precision: 10, scale: 2, nullable: true }),
121
+ (0, typeorm_1.Column)({
122
+ name: 'frame_rate',
123
+ type: 'decimal',
124
+ precision: 10,
125
+ scale: 2,
126
+ nullable: true
127
+ }),
107
128
  __metadata("design:type", Number)
108
129
  ], Asset.prototype, "frameRate", void 0);
109
130
  __decorate([
@@ -119,7 +140,12 @@ __decorate([
119
140
  __metadata("design:type", Object)
120
141
  ], Asset.prototype, "metadata", void 0);
121
142
  __decorate([
122
- (0, typeorm_1.Column)({ name: 'upload_status', type: 'varchar', length: 50, default: 'uploading' }),
143
+ (0, typeorm_1.Column)({
144
+ name: 'upload_status',
145
+ type: 'varchar',
146
+ length: 50,
147
+ default: 'uploading'
148
+ }),
123
149
  __metadata("design:type", String)
124
150
  ], Asset.prototype, "uploadStatus", void 0);
125
151
  __decorate([
@@ -7,6 +7,7 @@ export declare class AssetRepository extends BaseRepository<Asset> {
7
7
  findByWorkspace(workspaceId: string): Promise<Asset[]>;
8
8
  findByFileType(workspaceId: string, fileType: string): Promise<Asset[]>;
9
9
  findByUser(userId: string): Promise<Asset[]>;
10
+ findByUniqueId(uniqueId: string): Promise<Asset | null>;
10
11
  searchByName(workspaceId: string, searchTerm: string): Promise<Asset[]>;
11
12
  findByUploadedBy(userId: string): Promise<Asset[]>;
12
13
  findByWorkspaceId(workspaceId: string): Promise<Asset[]>;
@@ -14,6 +15,7 @@ export declare class AssetRepository extends BaseRepository<Asset> {
14
15
  updateUploadStatus(id: string, uploadStatus: string): Promise<Asset | null>;
15
16
  bulkUpdateUploadStatus(ids: string[], uploadStatus: string): Promise<void>;
16
17
  updateMetadata(id: string, metadata: Record<string, any>): Promise<Asset | null>;
18
+ updateProcessingMetadata(uniqueId: string, processingData: Record<string, any>): Promise<Asset | null>;
17
19
  getAll(): Promise<Asset[]>;
18
20
  findByUserOrLegacy(userId: string): Promise<Asset[]>;
19
21
  incrementUsageCount(id: string): Promise<void>;
@@ -44,6 +44,11 @@ let AssetRepository = class AssetRepository extends base_repository_1.BaseReposi
44
44
  order: { createdAt: 'DESC' }
45
45
  });
46
46
  }
47
+ async findByUniqueId(uniqueId) {
48
+ return this.assetRepository.findOne({
49
+ where: { uniqueId },
50
+ });
51
+ }
47
52
  async searchByName(workspaceId, searchTerm) {
48
53
  return this.assetRepository
49
54
  .createQueryBuilder('asset')
@@ -75,6 +80,21 @@ let AssetRepository = class AssetRepository extends base_repository_1.BaseReposi
75
80
  await this.assetRepository.update(id, { metadata });
76
81
  return this.findById(id);
77
82
  }
83
+ async updateProcessingMetadata(uniqueId, processingData) {
84
+ const asset = await this.findByUniqueId(uniqueId);
85
+ if (!asset)
86
+ return null;
87
+ const existingMetadata = asset.metadata || {};
88
+ const updatedMetadata = {
89
+ ...existingMetadata,
90
+ processing: {
91
+ ...existingMetadata.processing,
92
+ ...processingData,
93
+ },
94
+ };
95
+ await this.assetRepository.update(asset.id, { metadata: updatedMetadata });
96
+ return this.findById(asset.id);
97
+ }
78
98
  async getAll() {
79
99
  return this.assetRepository.find({
80
100
  order: { createdAt: 'DESC' },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clhq-postgres-module",
3
- "version": "1.1.0-alpha.94",
3
+ "version": "1.1.0-alpha.96",
4
4
  "description": "PostgreSQL module using TypeORM for Clippy",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",