clhq-postgres-module 1.1.0-alpha.127 → 1.1.0-alpha.129
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.
|
@@ -16,14 +16,14 @@ export declare class Scene {
|
|
|
16
16
|
projectId: string;
|
|
17
17
|
name: string;
|
|
18
18
|
description: string;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
start: number;
|
|
20
|
+
end: number;
|
|
21
|
+
duration: number;
|
|
22
22
|
thumbnailUrl: string;
|
|
23
23
|
thumbnailStatus: SceneThumbnailStatus;
|
|
24
24
|
color: string;
|
|
25
25
|
transitionType: TransitionType;
|
|
26
|
-
|
|
26
|
+
transitionDuration: number;
|
|
27
27
|
transitionToSceneId: string;
|
|
28
28
|
locked: boolean;
|
|
29
29
|
collapsed: boolean;
|
|
@@ -46,17 +46,17 @@ __decorate([
|
|
|
46
46
|
__metadata("design:type", String)
|
|
47
47
|
], Scene.prototype, "description", void 0);
|
|
48
48
|
__decorate([
|
|
49
|
-
(0, typeorm_1.Column)({ name: '
|
|
49
|
+
(0, typeorm_1.Column)({ name: 'start', type: 'decimal', precision: 10, scale: 3 }),
|
|
50
50
|
__metadata("design:type", Number)
|
|
51
|
-
], Scene.prototype, "
|
|
51
|
+
], Scene.prototype, "start", void 0);
|
|
52
52
|
__decorate([
|
|
53
|
-
(0, typeorm_1.Column)({ name: '
|
|
53
|
+
(0, typeorm_1.Column)({ name: 'end', type: 'decimal', precision: 10, scale: 3 }),
|
|
54
54
|
__metadata("design:type", Number)
|
|
55
|
-
], Scene.prototype, "
|
|
55
|
+
], Scene.prototype, "end", void 0);
|
|
56
56
|
__decorate([
|
|
57
|
-
(0, typeorm_1.Column)({ name: '
|
|
57
|
+
(0, typeorm_1.Column)({ name: 'duration', type: 'decimal', precision: 10, scale: 3, insert: false, update: false }),
|
|
58
58
|
__metadata("design:type", Number)
|
|
59
|
-
], Scene.prototype, "
|
|
59
|
+
], Scene.prototype, "duration", void 0);
|
|
60
60
|
__decorate([
|
|
61
61
|
(0, typeorm_1.Column)({ name: 'thumbnail_url', type: 'text', nullable: true }),
|
|
62
62
|
__metadata("design:type", String)
|
|
@@ -84,9 +84,9 @@ __decorate([
|
|
|
84
84
|
__metadata("design:type", String)
|
|
85
85
|
], Scene.prototype, "transitionType", void 0);
|
|
86
86
|
__decorate([
|
|
87
|
-
(0, typeorm_1.Column)({ name: '
|
|
87
|
+
(0, typeorm_1.Column)({ name: 'transition_duration', type: 'decimal', precision: 10, scale: 3, nullable: true }),
|
|
88
88
|
__metadata("design:type", Number)
|
|
89
|
-
], Scene.prototype, "
|
|
89
|
+
], Scene.prototype, "transitionDuration", void 0);
|
|
90
90
|
__decorate([
|
|
91
91
|
(0, typeorm_1.Column)({ name: 'transition_to_scene_id', type: 'varchar', length: 36, nullable: true }),
|
|
92
92
|
__metadata("design:type", String)
|
|
@@ -115,5 +115,5 @@ exports.Scene = Scene = __decorate([
|
|
|
115
115
|
(0, typeorm_1.Entity)('scenes'),
|
|
116
116
|
(0, typeorm_1.Index)(['projectId']),
|
|
117
117
|
(0, typeorm_1.Index)(['projectId', 'sortOrder']),
|
|
118
|
-
(0, typeorm_1.Index)(['projectId', '
|
|
118
|
+
(0, typeorm_1.Index)(['projectId', 'start', 'end'])
|
|
119
119
|
], Scene);
|
package/dist/postgres.module.js
CHANGED
|
@@ -7,14 +7,14 @@ export declare class SceneRepository extends BaseRepository<Scene> {
|
|
|
7
7
|
findByProject(projectId: string): Promise<Scene[]>;
|
|
8
8
|
findByProjectWithItems(projectId: string): Promise<Scene[]>;
|
|
9
9
|
findByIdWithProject(id: string): Promise<Scene | null>;
|
|
10
|
-
findInTimeRange(projectId: string,
|
|
10
|
+
findInTimeRange(projectId: string, start: number, end: number): Promise<Scene[]>;
|
|
11
11
|
updateSortOrders(updates: {
|
|
12
12
|
id: string;
|
|
13
13
|
sortOrder: number;
|
|
14
14
|
}[]): Promise<void>;
|
|
15
15
|
deleteByProject(projectId: string): Promise<number>;
|
|
16
16
|
countByProject(projectId: string): Promise<number>;
|
|
17
|
-
findOverlapping(projectId: string,
|
|
17
|
+
findOverlapping(projectId: string, start: number, end: number, excludeId?: string): Promise<Scene[]>;
|
|
18
18
|
findByThumbnailStatus(status: string, limit?: number): Promise<Scene[]>;
|
|
19
19
|
updateThumbnailStatus(ids: string[], status: string): Promise<void>;
|
|
20
20
|
getNextSortOrder(projectId: string): Promise<number>;
|
|
@@ -42,12 +42,12 @@ let SceneRepository = class SceneRepository extends base_repository_1.BaseReposi
|
|
|
42
42
|
relations: ['project'],
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
-
async findInTimeRange(projectId,
|
|
45
|
+
async findInTimeRange(projectId, start, end) {
|
|
46
46
|
return this.sceneRepository
|
|
47
47
|
.createQueryBuilder('scene')
|
|
48
48
|
.where('scene.projectId = :projectId', { projectId })
|
|
49
|
-
.andWhere('scene.
|
|
50
|
-
.andWhere('scene.
|
|
49
|
+
.andWhere('scene.start < :end', { end })
|
|
50
|
+
.andWhere('scene.end > :start', { start })
|
|
51
51
|
.orderBy('scene.sortOrder', 'ASC')
|
|
52
52
|
.getMany();
|
|
53
53
|
}
|
|
@@ -62,12 +62,12 @@ let SceneRepository = class SceneRepository extends base_repository_1.BaseReposi
|
|
|
62
62
|
async countByProject(projectId) {
|
|
63
63
|
return this.sceneRepository.count({ where: { projectId } });
|
|
64
64
|
}
|
|
65
|
-
async findOverlapping(projectId,
|
|
65
|
+
async findOverlapping(projectId, start, end, excludeId) {
|
|
66
66
|
const query = this.sceneRepository
|
|
67
67
|
.createQueryBuilder('scene')
|
|
68
68
|
.where('scene.projectId = :projectId', { projectId })
|
|
69
|
-
.andWhere('scene.
|
|
70
|
-
.andWhere('scene.
|
|
69
|
+
.andWhere('scene.start < :end', { end })
|
|
70
|
+
.andWhere('scene.end > :start', { start });
|
|
71
71
|
if (excludeId) {
|
|
72
72
|
query.andWhere('scene.id != :excludeId', { excludeId });
|
|
73
73
|
}
|
|
@@ -81,12 +81,7 @@ let SceneRepository = class SceneRepository extends base_repository_1.BaseReposi
|
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
83
|
async updateThumbnailStatus(ids, status) {
|
|
84
|
-
await this.sceneRepository
|
|
85
|
-
.createQueryBuilder()
|
|
86
|
-
.update()
|
|
87
|
-
.set({ thumbnailStatus: status })
|
|
88
|
-
.where('id IN (:...ids)', { ids })
|
|
89
|
-
.execute();
|
|
84
|
+
await this.sceneRepository.update(ids, { thumbnailStatus: status });
|
|
90
85
|
}
|
|
91
86
|
async getNextSortOrder(projectId) {
|
|
92
87
|
const result = await this.sceneRepository
|