clhq-postgres-module 1.1.0-alpha.147 → 1.1.0-alpha.149

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.
@@ -7,6 +7,9 @@ export declare class RemotionRenderRepository extends BaseRepository<RemotionRen
7
7
  createRender(data: Partial<RemotionRender>): Promise<RemotionRender>;
8
8
  findByRenderId(renderId: string): Promise<RemotionRender | null>;
9
9
  findByProjectId(projectId: string): Promise<RemotionRender[]>;
10
+ findByProjectIdAndUserId(projectId: string, userId: string): Promise<RemotionRender[]>;
11
+ findByIdAndUserId(id: string, userId: string): Promise<RemotionRender | null>;
12
+ findActiveByUserId(userId: string): Promise<RemotionRender[]>;
10
13
  findLatestByProjectId(projectId: string): Promise<RemotionRender | null>;
11
14
  updateStatus(id: string, status: RenderStatus, additionalData?: Partial<RemotionRender>): Promise<RemotionRender | null>;
12
15
  markCompleted(id: string, outputFileUrl: string): Promise<RemotionRender | null>;
@@ -36,6 +36,26 @@ let RemotionRenderRepository = class RemotionRenderRepository extends base_repos
36
36
  order: { createdAt: 'DESC' },
37
37
  });
38
38
  }
39
+ async findByProjectIdAndUserId(projectId, userId) {
40
+ return this.remotionRenderRepository.find({
41
+ where: { projectId, userId },
42
+ order: { createdAt: 'DESC' },
43
+ });
44
+ }
45
+ async findByIdAndUserId(id, userId) {
46
+ return this.remotionRenderRepository.findOne({
47
+ where: { id, userId },
48
+ });
49
+ }
50
+ async findActiveByUserId(userId) {
51
+ return this.remotionRenderRepository.find({
52
+ where: {
53
+ userId,
54
+ status: (0, typeorm_2.In)([RemotionRender_1.RenderStatus.QUEUED, RemotionRender_1.RenderStatus.PENDING, RemotionRender_1.RenderStatus.RENDERING]),
55
+ },
56
+ order: { createdAt: 'DESC' },
57
+ });
58
+ }
39
59
  async findLatestByProjectId(projectId) {
40
60
  return this.remotionRenderRepository.findOne({
41
61
  where: { projectId },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clhq-postgres-module",
3
- "version": "1.1.0-alpha.147",
3
+ "version": "1.1.0-alpha.149",
4
4
  "description": "PostgreSQL module using TypeORM for Clippy",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -47,6 +47,8 @@
47
47
  "db:migrate:scenes-format": "npx ts-node scripts/run-migrations.ts 032",
48
48
  "db:migrate:033": "npx ts-node scripts/run-migrations.ts 033",
49
49
  "db:migrate:fix-scenes-constraint": "npx ts-node scripts/run-migrations.ts 033",
50
+ "db:migrate:035": "npx ts-node scripts/run-migrations.ts 035",
51
+ "db:migrate:remotion-credits": "npx ts-node scripts/run-migrations.ts 035",
50
52
  "db:verify": "env-cmd -f ../../.env.dev npx ts-node scripts/verify-tables.ts",
51
53
  "db:test": "env-cmd -f ../../.env.dev npx ts-node scripts/test-connections.ts",
52
54
  "db:sync": "env-cmd -f ../../.env.dev npm run typeorm schema:sync -- -d src/config/data-source.ts",