clhq-postgres-module 1.1.0-alpha.157 → 1.1.0-alpha.159

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.
@@ -8,6 +8,7 @@ export declare class AssetRepository extends BaseRepository<Asset> {
8
8
  findByFileType(workspaceId: string, fileType: string): Promise<Asset[]>;
9
9
  findByUser(userId: string): Promise<Asset[]>;
10
10
  findByUniqueId(uniqueId: string): Promise<Asset | null>;
11
+ findByUniqueIds(uniqueIds: string[]): Promise<Asset[]>;
11
12
  searchByName(workspaceId: string, searchTerm: string): Promise<Asset[]>;
12
13
  findByUploadedBy(userId: string): Promise<Asset[]>;
13
14
  findByWorkspaceId(workspaceId: string): Promise<Asset[]>;
@@ -49,6 +49,13 @@ let AssetRepository = class AssetRepository extends base_repository_1.BaseReposi
49
49
  where: { uniqueId },
50
50
  });
51
51
  }
52
+ async findByUniqueIds(uniqueIds) {
53
+ if (uniqueIds.length === 0)
54
+ return [];
55
+ return this.assetRepository.find({
56
+ where: { uniqueId: (0, typeorm_1.In)(uniqueIds) },
57
+ });
58
+ }
52
59
  async searchByName(workspaceId, searchTerm) {
53
60
  return this.assetRepository
54
61
  .createQueryBuilder('asset')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clhq-postgres-module",
3
- "version": "1.1.0-alpha.157",
3
+ "version": "1.1.0-alpha.159",
4
4
  "description": "PostgreSQL module using TypeORM for Clippy",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -49,6 +49,9 @@
49
49
  "db:migrate:fix-scenes-constraint": "npx ts-node scripts/run-migrations.ts 033",
50
50
  "db:migrate:035": "npx ts-node scripts/run-migrations.ts 035",
51
51
  "db:migrate:remotion-credits": "npx ts-node scripts/run-migrations.ts 035",
52
+ "db:migrate:036": "npx ts-node scripts/run-migrations.ts 036",
53
+ "db:migrate:037": "npx ts-node scripts/run-migrations.ts 037",
54
+ "db:migrate:rls": "npx ts-node scripts/run-migrations.ts 037",
52
55
  "db:verify": "env-cmd -f ../../.env.dev npx ts-node scripts/verify-tables.ts",
53
56
  "db:test": "env-cmd -f ../../.env.dev npx ts-node scripts/test-connections.ts",
54
57
  "db:sync": "env-cmd -f ../../.env.dev npm run typeorm schema:sync -- -d src/config/data-source.ts",