@rocketmakers/orbit-storage-typeorm 1.2.0 → 2.0.0-beta.10

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.
Files changed (66) hide show
  1. package/README.md +35 -3
  2. package/lib/entities/bucketRegistration.d.ts +11 -0
  3. package/lib/entities/bucketRegistration.d.ts.map +1 -0
  4. package/lib/entities/bucketRegistration.js +37 -0
  5. package/lib/entities/bucketRegistration.js.map +1 -0
  6. package/lib/{src/entities → entities}/folder.d.ts +1 -0
  7. package/lib/entities/folder.d.ts.map +1 -0
  8. package/lib/{src/entities → entities}/folder.js +8 -8
  9. package/lib/entities/folder.js.map +1 -0
  10. package/lib/{src/entities → entities}/index.d.ts +1 -0
  11. package/lib/entities/index.d.ts.map +1 -0
  12. package/lib/{src/entities → entities}/index.js +0 -0
  13. package/lib/entities/index.js.map +1 -0
  14. package/lib/{src/entities → entities}/upload.d.ts +3 -2
  15. package/lib/entities/upload.d.ts.map +1 -0
  16. package/lib/{src/entities → entities}/upload.js +14 -14
  17. package/lib/entities/upload.js.map +1 -0
  18. package/lib/{src/index.d.ts → index.d.ts} +1 -0
  19. package/lib/index.d.ts.map +1 -0
  20. package/lib/{src/index.js → index.js} +0 -0
  21. package/lib/index.js.map +1 -0
  22. package/lib/ioc/index.d.ts +2 -0
  23. package/lib/ioc/index.d.ts.map +1 -0
  24. package/lib/{src/ioc → ioc}/index.js +0 -0
  25. package/lib/{src/ioc → ioc}/index.js.map +1 -1
  26. package/lib/ioc/register.d.ts +5 -0
  27. package/lib/ioc/register.d.ts.map +1 -0
  28. package/lib/ioc/register.js +14 -0
  29. package/lib/ioc/register.js.map +1 -0
  30. package/lib/repositories/bucketRegistrationRepository.d.ts +23 -0
  31. package/lib/repositories/bucketRegistrationRepository.d.ts.map +1 -0
  32. package/lib/{src/repositories → repositories}/bucketRegistrationRepository.js +19 -19
  33. package/lib/repositories/bucketRegistrationRepository.js.map +1 -0
  34. package/lib/{src/repositories → repositories}/folderRepository.d.ts +9 -6
  35. package/lib/repositories/folderRepository.d.ts.map +1 -0
  36. package/lib/{src/repositories → repositories}/folderRepository.js +20 -12
  37. package/lib/repositories/folderRepository.js.map +1 -0
  38. package/lib/{src/repositories → repositories}/index.d.ts +1 -0
  39. package/lib/repositories/index.d.ts.map +1 -0
  40. package/lib/{src/repositories → repositories}/index.js +0 -0
  41. package/lib/repositories/index.js.map +1 -0
  42. package/lib/{src/repositories → repositories}/uploadRepository.d.ts +8 -5
  43. package/lib/repositories/uploadRepository.d.ts.map +1 -0
  44. package/lib/{src/repositories → repositories}/uploadRepository.js +18 -14
  45. package/lib/repositories/uploadRepository.js.map +1 -0
  46. package/lib/tsconfig.tsbuildinfo +1 -0
  47. package/package.json +15 -15
  48. package/lib/src/entities/bucketRegistration.d.ts +0 -16
  49. package/lib/src/entities/bucketRegistration.js +0 -58
  50. package/lib/src/entities/bucketRegistration.js.map +0 -1
  51. package/lib/src/entities/folder.js.map +0 -1
  52. package/lib/src/entities/index.js.map +0 -1
  53. package/lib/src/entities/upload.js.map +0 -1
  54. package/lib/src/index.js.map +0 -1
  55. package/lib/src/ioc/container.d.ts +0 -13
  56. package/lib/src/ioc/container.js +0 -7
  57. package/lib/src/ioc/container.js.map +0 -1
  58. package/lib/src/ioc/index.d.ts +0 -1
  59. package/lib/src/ioc/register.d.ts +0 -1
  60. package/lib/src/ioc/register.js +0 -21
  61. package/lib/src/ioc/register.js.map +0 -1
  62. package/lib/src/repositories/bucketRegistrationRepository.d.ts +0 -20
  63. package/lib/src/repositories/bucketRegistrationRepository.js.map +0 -1
  64. package/lib/src/repositories/folderRepository.js.map +0 -1
  65. package/lib/src/repositories/index.js.map +0 -1
  66. package/lib/src/repositories/uploadRepository.js.map +0 -1
package/README.md CHANGED
@@ -1,9 +1,41 @@
1
- ## `@rocketmakers/orbit-storage-typeorm`
1
+ # `@rocketmakers/orbit-storage-typeorm`
2
2
 
3
- Set of repository-layer classes required in the orbit storage microservice.
3
+ ## Set of repository-layer classes required in the orbit storage microservice.
4
+
5
+ ### Environment config
6
+
7
+ Once installed as a dependency, any env vars required by this package will be listed as properties of the `@rocketmakers/environment` generated class found at `node_modules/@rocketmakers/orbit-storage-typeorm/lib/config/environment.generated.d.ts`.
8
+
9
+ ### Implementation
10
+
11
+ When using `@rocketmakers/orbit-storage-typeorm` there are two options to register service classes with your ioc framework.
12
+
13
+ Option #1:
14
+
15
+ If you only want to register individual classes as needed, you can bootstrap repositories as you would with any other class.
16
+
17
+ Option #2:
18
+
19
+ You can bootstrap storage repository classes using the exposed `registerStorageTypeormIoC()` function by following the steps below.
20
+
21
+ ```typescript
22
+ // Register core types and services from @rocketmakers/orbit-core
23
+ const coreContainer = registerCoreIoC(logger);
24
+
25
+ // Register types and repository classes from @rocketmakers/orbit-storage-typeorm
26
+ const repoContainer = registerStorageTypeormIoC(coreContainer);
27
+ ```
28
+
29
+ ### Docs
30
+
31
+ Hosted docs covering types, interfaces and all service class/method signatures within this package can be found using the link below:
4
32
 
5
33
  [Documentation](https://rocketmakers.gitlab.io/microservices/orbit-packages/docs/modules/orbit_storage_typeorm.html)
6
34
 
35
+ ### Source code
36
+
37
+ Source code for this package can be found using the link below:
38
+
7
39
  [Source code](https://gitlab.com/rocketmakers/microservices/orbit-packages/-/tree/develop/packages/storage/orbit-storage-typeorm)
8
40
 
9
- Links to contributing docs can be found in the [README.md](https://gitlab.com/rocketmakers/microservices/orbit-packages/-/blob/develop/README.md)
41
+ Contributing docs can be found in the [README.md](https://gitlab.com/rocketmakers/microservices/orbit-packages/-/blob/develop/README.md)
@@ -0,0 +1,11 @@
1
+ import { BucketName, BucketRegistrationId, DeleteMode } from '@rocketmakers/orbit-storage-core';
2
+ import { UpdatableCreatableEntity } from '@rocketmakers/orbit-db-typeorm';
3
+ export declare class BucketRegistrationEntity extends UpdatableCreatableEntity {
4
+ id: BucketRegistrationId;
5
+ name: BucketName;
6
+ pathPrefix?: string;
7
+ deleteMode: DeleteMode;
8
+ config: string;
9
+ maxFileSizeBytes?: number;
10
+ }
11
+ //# sourceMappingURL=bucketRegistration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bucketRegistration.d.ts","sourceRoot":"","sources":["../../src/entities/bucketRegistration.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAChG,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,qBACa,wBAAyB,SAAQ,wBAAwB;IAEpE,EAAE,EAAG,oBAAoB,CAAC;IAG1B,IAAI,EAAG,UAAU,CAAC;IAGlB,UAAU,CAAC,EAAE,MAAM,CAAC;IAGpB,UAAU,EAAG,UAAU,CAAC;IAGxB,MAAM,EAAG,MAAM,CAAC;IAGhB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BucketRegistrationEntity = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const typeorm_1 = require("typeorm");
6
+ const orbit_db_typeorm_1 = require("@rocketmakers/orbit-db-typeorm");
7
+ let BucketRegistrationEntity = class BucketRegistrationEntity extends orbit_db_typeorm_1.UpdatableCreatableEntity {
8
+ };
9
+ tslib_1.__decorate([
10
+ (0, typeorm_1.PrimaryColumn)({ type: 'uuid' }),
11
+ tslib_1.__metadata("design:type", String)
12
+ ], BucketRegistrationEntity.prototype, "id", void 0);
13
+ tslib_1.__decorate([
14
+ (0, typeorm_1.Column)({ name: 'bucket_name', type: 'text' }),
15
+ tslib_1.__metadata("design:type", String)
16
+ ], BucketRegistrationEntity.prototype, "name", void 0);
17
+ tslib_1.__decorate([
18
+ (0, typeorm_1.Column)({ name: 'path_prefix', type: 'text' }),
19
+ tslib_1.__metadata("design:type", String)
20
+ ], BucketRegistrationEntity.prototype, "pathPrefix", void 0);
21
+ tslib_1.__decorate([
22
+ (0, typeorm_1.Column)({ name: 'delete_mode', type: 'text' }),
23
+ tslib_1.__metadata("design:type", String)
24
+ ], BucketRegistrationEntity.prototype, "deleteMode", void 0);
25
+ tslib_1.__decorate([
26
+ (0, typeorm_1.Column)({ type: 'text' }),
27
+ tslib_1.__metadata("design:type", String)
28
+ ], BucketRegistrationEntity.prototype, "config", void 0);
29
+ tslib_1.__decorate([
30
+ (0, typeorm_1.Column)({ name: 'max_file_size_bytes', type: 'int', nullable: true }),
31
+ tslib_1.__metadata("design:type", Number)
32
+ ], BucketRegistrationEntity.prototype, "maxFileSizeBytes", void 0);
33
+ BucketRegistrationEntity = tslib_1.__decorate([
34
+ (0, typeorm_1.Entity)('bucket_registration', { schema: 'orbit_storage' })
35
+ ], BucketRegistrationEntity);
36
+ exports.BucketRegistrationEntity = BucketRegistrationEntity;
37
+ //# sourceMappingURL=bucketRegistration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bucketRegistration.js","sourceRoot":"","sources":["../../src/entities/bucketRegistration.ts"],"names":[],"mappings":";;;;AAAA,qCAAwD;AAExD,qEAA0E;AAG1E,IAAa,wBAAwB,GAArC,MAAa,wBAAyB,SAAQ,2CAAwB;CAkBrE,CAAA;AAhBC;IADC,IAAA,uBAAa,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oDACN;AAG1B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sDAC5B;AAGlB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;4DAC1B;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;4DACtB;AAGxB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;wDACT;AAGhB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kEAC3C;AAjBf,wBAAwB;IADpC,IAAA,gBAAM,EAAC,qBAAqB,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC;GAC9C,wBAAwB,CAkBpC;AAlBY,4DAAwB"}
@@ -10,3 +10,4 @@ export declare class Folder extends UpdatableCreatableEntity {
10
10
  deletedBy: string;
11
11
  deletedOn: DateTimeString;
12
12
  }
13
+ //# sourceMappingURL=folder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"folder.d.ts","sourceRoot":"","sources":["../../src/entities/folder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAgB,MAAM,gCAAgC,CAAC;AACxF,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAEpF,qBACa,MAAO,SAAQ,wBAAwB;IAElD,EAAE,EAAG,QAAQ,CAAC;IAGd,UAAU,EAAG,UAAU,CAAC;IAGxB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAGpB,UAAU,EAAG,MAAM,CAAC;IAGpB,UAAU,EAAG,UAAU,CAAC;IAGxB,SAAS,EAAG,MAAM,CAAC;IAGnB,SAAS,EAAG,cAAc,CAAC;CAC5B"}
@@ -7,35 +7,35 @@ const orbit_db_typeorm_1 = require("@rocketmakers/orbit-db-typeorm");
7
7
  let Folder = class Folder extends orbit_db_typeorm_1.UpdatableCreatableEntity {
8
8
  };
9
9
  tslib_1.__decorate([
10
- typeorm_1.PrimaryColumn({ type: 'uuid' }),
10
+ (0, typeorm_1.PrimaryColumn)({ type: 'uuid' }),
11
11
  tslib_1.__metadata("design:type", String)
12
12
  ], Folder.prototype, "id", void 0);
13
13
  tslib_1.__decorate([
14
- typeorm_1.Column({ name: 'bucket_name', type: 'text' }),
14
+ (0, typeorm_1.Column)({ name: 'bucket_name', type: 'text' }),
15
15
  tslib_1.__metadata("design:type", String)
16
16
  ], Folder.prototype, "bucketName", void 0);
17
17
  tslib_1.__decorate([
18
- typeorm_1.Column({ name: 'parent_id', type: 'uuid' }),
18
+ (0, typeorm_1.Column)({ name: 'parent_id', type: 'uuid' }),
19
19
  tslib_1.__metadata("design:type", String)
20
20
  ], Folder.prototype, "parentId", void 0);
21
21
  tslib_1.__decorate([
22
- typeorm_1.Column({ name: 'folder_name', type: 'text' }),
22
+ (0, typeorm_1.Column)({ name: 'folder_name', type: 'text' }),
23
23
  tslib_1.__metadata("design:type", String)
24
24
  ], Folder.prototype, "folderName", void 0);
25
25
  tslib_1.__decorate([
26
- typeorm_1.Column({ name: 'folder_type', type: 'text' }),
26
+ (0, typeorm_1.Column)({ name: 'folder_type', type: 'text' }),
27
27
  tslib_1.__metadata("design:type", String)
28
28
  ], Folder.prototype, "folderType", void 0);
29
29
  tslib_1.__decorate([
30
- typeorm_1.Column({ name: 'deleted_by', type: 'text' }),
30
+ (0, typeorm_1.Column)({ name: 'deleted_by', type: 'text' }),
31
31
  tslib_1.__metadata("design:type", String)
32
32
  ], Folder.prototype, "deletedBy", void 0);
33
33
  tslib_1.__decorate([
34
- typeorm_1.Column({ name: 'deleted_on', type: 'timestamp', transformer: orbit_db_typeorm_1.Transformers.dateTime }),
34
+ (0, typeorm_1.Column)({ name: 'deleted_on', type: 'timestamp', transformer: orbit_db_typeorm_1.Transformers.dateTime }),
35
35
  tslib_1.__metadata("design:type", String)
36
36
  ], Folder.prototype, "deletedOn", void 0);
37
37
  Folder = tslib_1.__decorate([
38
- typeorm_1.Entity({ name: 'folder' })
38
+ (0, typeorm_1.Entity)('folder', { schema: 'orbit_storage' })
39
39
  ], Folder);
40
40
  exports.Folder = Folder;
41
41
  //# sourceMappingURL=folder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"folder.js","sourceRoot":"","sources":["../../src/entities/folder.ts"],"names":[],"mappings":";;;;AAAA,qCAAwD;AAExD,qEAAwF;AAIxF,IAAa,MAAM,GAAnB,MAAa,MAAO,SAAQ,2CAAwB;CAqBnD,CAAA;AAnBC;IADC,IAAA,uBAAa,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;kCAClB;AAGd;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;0CACtB;AAGxB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;wCACxB;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;0CAC1B;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;0CACtB;AAGxB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yCAC1B;AAGnB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,+BAAY,CAAC,QAAQ,EAAE,CAAC;;yCAC3D;AApBhB,MAAM;IADlB,IAAA,gBAAM,EAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC;GACjC,MAAM,CAqBlB;AArBY,wBAAM"}
@@ -1,3 +1,4 @@
1
1
  export * from './bucketRegistration';
2
2
  export * from './folder';
3
3
  export * from './upload';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":";;;AAAA,+DAAqC;AACrC,mDAAyB;AACzB,mDAAyB"}
@@ -1,5 +1,5 @@
1
1
  import { MetadataMap } from '@rocketmakers/storage';
2
- import { DateTimeString, UserId, IByWho } from '@rocketmakers/orbit-core';
2
+ import { DateTimeString, UserId, IRequestor } from '@rocketmakers/orbit-core';
3
3
  import { UploadId, FolderId, BucketName, UploadTicket } from '@rocketmakers/orbit-storage-core';
4
4
  import { CreatableEntity } from '@rocketmakers/orbit-db-typeorm';
5
5
  export declare class Upload extends CreatableEntity {
@@ -14,6 +14,7 @@ export declare class Upload extends CreatableEntity {
14
14
  userId: UserId;
15
15
  additionalMetadata?: MetadataMap;
16
16
  completedOn: DateTimeString;
17
- deletedBy: IByWho;
17
+ deletedBy: IRequestor;
18
18
  deletedOn: DateTimeString;
19
19
  }
20
+ //# sourceMappingURL=upload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../src/entities/upload.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChG,OAAO,EAAE,eAAe,EAAgB,MAAM,gCAAgC,CAAC;AAE/E,qBACa,MAAO,SAAQ,eAAe;IAEzC,EAAE,EAAG,QAAQ,CAAC;IAGd,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAGpB,UAAU,EAAG,UAAU,CAAC;IAGxB,MAAM,EAAG,YAAY,CAAC;IAGtB,QAAQ,EAAG,MAAM,CAAC;IAGlB,QAAQ,EAAG,MAAM,CAAC;IAGlB,QAAQ,EAAG,MAAM,CAAC;IAGlB,WAAW,EAAG,MAAM,CAAC;IAGrB,MAAM,EAAG,MAAM,CAAC;IAGhB,kBAAkB,CAAC,EAAE,WAAW,CAAC;IAGjC,WAAW,EAAG,cAAc,CAAC;IAG7B,SAAS,EAAG,UAAU,CAAC;IAGvB,SAAS,EAAG,cAAc,CAAC;CAC5B"}
@@ -7,59 +7,59 @@ const orbit_db_typeorm_1 = require("@rocketmakers/orbit-db-typeorm");
7
7
  let Upload = class Upload extends orbit_db_typeorm_1.CreatableEntity {
8
8
  };
9
9
  tslib_1.__decorate([
10
- typeorm_1.PrimaryColumn({ type: 'uuid' }),
10
+ (0, typeorm_1.PrimaryColumn)({ type: 'uuid' }),
11
11
  tslib_1.__metadata("design:type", String)
12
12
  ], Upload.prototype, "id", void 0);
13
13
  tslib_1.__decorate([
14
- typeorm_1.Column({ name: 'folder_id', type: 'uuid' }),
14
+ (0, typeorm_1.Column)({ name: 'folder_id', type: 'uuid' }),
15
15
  tslib_1.__metadata("design:type", String)
16
16
  ], Upload.prototype, "folderId", void 0);
17
17
  tslib_1.__decorate([
18
- typeorm_1.Column({ name: 'bucket_name', type: 'text' }),
18
+ (0, typeorm_1.Column)({ name: 'bucket_name', type: 'text' }),
19
19
  tslib_1.__metadata("design:type", String)
20
20
  ], Upload.prototype, "bucketName", void 0);
21
21
  tslib_1.__decorate([
22
- typeorm_1.Column({ type: 'text' }),
22
+ (0, typeorm_1.Column)({ type: 'text' }),
23
23
  tslib_1.__metadata("design:type", String)
24
24
  ], Upload.prototype, "ticket", void 0);
25
25
  tslib_1.__decorate([
26
- typeorm_1.Column({ name: 'file_path', type: 'text' }),
26
+ (0, typeorm_1.Column)({ name: 'file_path', type: 'text' }),
27
27
  tslib_1.__metadata("design:type", String)
28
28
  ], Upload.prototype, "filePath", void 0);
29
29
  tslib_1.__decorate([
30
- typeorm_1.Column({ name: 'file_name', type: 'text' }),
30
+ (0, typeorm_1.Column)({ name: 'file_name', type: 'text' }),
31
31
  tslib_1.__metadata("design:type", String)
32
32
  ], Upload.prototype, "fileName", void 0);
33
33
  tslib_1.__decorate([
34
- typeorm_1.Column({ name: 'file_size', type: 'int' }),
34
+ (0, typeorm_1.Column)({ name: 'file_size', type: 'int' }),
35
35
  tslib_1.__metadata("design:type", Number)
36
36
  ], Upload.prototype, "fileSize", void 0);
37
37
  tslib_1.__decorate([
38
- typeorm_1.Column({ name: 'content_type', type: 'text' }),
38
+ (0, typeorm_1.Column)({ name: 'content_type', type: 'text' }),
39
39
  tslib_1.__metadata("design:type", String)
40
40
  ], Upload.prototype, "contentType", void 0);
41
41
  tslib_1.__decorate([
42
- typeorm_1.Column({ name: 'user_id', type: 'text' }),
42
+ (0, typeorm_1.Column)({ name: 'user_id', type: 'text' }),
43
43
  tslib_1.__metadata("design:type", String)
44
44
  ], Upload.prototype, "userId", void 0);
45
45
  tslib_1.__decorate([
46
- typeorm_1.Column({ name: 'additional_metadata', type: 'text', transformer: orbit_db_typeorm_1.Transformers.json }),
46
+ (0, typeorm_1.Column)({ name: 'additional_metadata', type: 'text', transformer: orbit_db_typeorm_1.Transformers.json }),
47
47
  tslib_1.__metadata("design:type", Object)
48
48
  ], Upload.prototype, "additionalMetadata", void 0);
49
49
  tslib_1.__decorate([
50
- typeorm_1.Column({ name: 'completed_on', type: 'timestamp', transformer: orbit_db_typeorm_1.Transformers.dateTime }),
50
+ (0, typeorm_1.Column)({ name: 'completed_on', type: 'timestamp', transformer: orbit_db_typeorm_1.Transformers.dateTime }),
51
51
  tslib_1.__metadata("design:type", String)
52
52
  ], Upload.prototype, "completedOn", void 0);
53
53
  tslib_1.__decorate([
54
- typeorm_1.Column({ name: 'deleted_by', type: 'text', transformer: orbit_db_typeorm_1.Transformers.json }),
54
+ (0, typeorm_1.Column)({ name: 'deleted_by', type: 'text', transformer: orbit_db_typeorm_1.Transformers.json }),
55
55
  tslib_1.__metadata("design:type", Object)
56
56
  ], Upload.prototype, "deletedBy", void 0);
57
57
  tslib_1.__decorate([
58
- typeorm_1.Column({ name: 'deleted_on', type: 'timestamp', transformer: orbit_db_typeorm_1.Transformers.dateTime }),
58
+ (0, typeorm_1.Column)({ name: 'deleted_on', type: 'timestamp', transformer: orbit_db_typeorm_1.Transformers.dateTime }),
59
59
  tslib_1.__metadata("design:type", String)
60
60
  ], Upload.prototype, "deletedOn", void 0);
61
61
  Upload = tslib_1.__decorate([
62
- typeorm_1.Entity({ name: 'upload' })
62
+ (0, typeorm_1.Entity)('upload', { schema: 'orbit_storage' })
63
63
  ], Upload);
64
64
  exports.Upload = Upload;
65
65
  //# sourceMappingURL=upload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload.js","sourceRoot":"","sources":["../../src/entities/upload.ts"],"names":[],"mappings":";;;;AAAA,qCAAwD;AAIxD,qEAA+E;AAG/E,IAAa,MAAM,GAAnB,MAAa,MAAO,SAAQ,kCAAe;CAuC1C,CAAA;AArCC;IADC,IAAA,uBAAa,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;kCAClB;AAGd;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;wCACxB;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;0CACtB;AAGxB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sCACH;AAGtB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;wCAC1B;AAGlB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;wCAC1B;AAGlB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;wCACzB;AAGlB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2CAC1B;AAGrB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sCAC1B;AAGhB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,+BAAY,CAAC,IAAI,EAAE,CAAC;;kDACrD;AAGjC;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,+BAAY,CAAC,QAAQ,EAAE,CAAC;;2CAC3D;AAG7B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,+BAAY,CAAC,IAAI,EAAE,CAAC;;yCACtD;AAGvB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,+BAAY,CAAC,QAAQ,EAAE,CAAC;;yCAC3D;AAtChB,MAAM;IADlB,IAAA,gBAAM,EAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC;GACjC,MAAM,CAuClB;AAvCY,wBAAM"}
@@ -1,3 +1,4 @@
1
1
  export * from './entities';
2
2
  export * from './ioc';
3
3
  export * from './repositories';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,gBAAgB,CAAC"}
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAIA,qDAA2B;AAC3B,gDAAsB;AACtB,yDAA+B"}
@@ -0,0 +1,2 @@
1
+ export * from './register';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ioc/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
File without changes
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ioc/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ioc/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B"}
@@ -0,0 +1,5 @@
1
+ import { IContainer } from '@rocketmakers/ioc';
2
+ import { ICoreContainerTypes } from '@rocketmakers/orbit-core';
3
+ import { IRepositoryContainerTypes } from '@rocketmakers/orbit-storage-core';
4
+ export declare function registerStorageTypeormIoC(container: IContainer<ICoreContainerTypes>): IContainer<ICoreContainerTypes & IRepositoryContainerTypes>;
5
+ //# sourceMappingURL=register.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../src/ioc/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAY,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAiC7E,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,UAAU,CAAC,mBAAmB,CAAC,GACzC,UAAU,CAAC,mBAAmB,GAAG,yBAAyB,CAAC,CAY7D"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerStorageTypeormIoC = void 0;
4
+ const ioc_1 = require("@rocketmakers/ioc");
5
+ const repositories_1 = require("../repositories");
6
+ function registerStorageTypeormIoC(container) {
7
+ return (0, ioc_1.register)({
8
+ bucketRegistrationRepository: builder => builder.class(repositories_1.BucketRegistrationRepository, ['timeService', 'uuidGeneratorService']).inSingletonScope(),
9
+ uploadRepository: builder => builder.class(repositories_1.UploadRepository, ['timeService', 'uuidGeneratorService']).inSingletonScope(),
10
+ folderRepository: builder => builder.class(repositories_1.FolderRepository, ['timeService', 'uuidGeneratorService']).inSingletonScope(),
11
+ }, container);
12
+ }
13
+ exports.registerStorageTypeormIoC = registerStorageTypeormIoC;
14
+ //# sourceMappingURL=register.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.js","sourceRoot":"","sources":["../../src/ioc/register.ts"],"names":[],"mappings":";;;AAAA,2CAAyD;AAGzD,kDAAmG;AAgCnG,SAAgB,yBAAyB,CACvC,SAA0C;IAE1C,OAAO,IAAA,cAAQ,EACb;QACE,4BAA4B,EAAE,OAAO,CAAC,EAAE,CACtC,OAAO,CAAC,KAAK,CAAC,2CAA4B,EAAE,CAAC,aAAa,EAAE,sBAAsB,CAAC,CAAC,CAAC,gBAAgB,EAAE;QACzG,gBAAgB,EAAE,OAAO,CAAC,EAAE,CAC1B,OAAO,CAAC,KAAK,CAAC,+BAAgB,EAAE,CAAC,aAAa,EAAE,sBAAsB,CAAC,CAAC,CAAC,gBAAgB,EAAE;QAC7F,gBAAgB,EAAE,OAAO,CAAC,EAAE,CAC1B,OAAO,CAAC,KAAK,CAAC,+BAAgB,EAAE,CAAC,aAAa,EAAE,sBAAsB,CAAC,CAAC,CAAC,gBAAgB,EAAE;KAC9F,EACD,SAAS,CACV,CAAC;AACJ,CAAC;AAdD,8DAcC"}
@@ -0,0 +1,23 @@
1
+ import { EntityManager, Repository } from 'typeorm';
2
+ import { DateTimeString, IQuery, IQueryResponse, ITimeService, IUuidGeneratorService } from '@rocketmakers/orbit-core';
3
+ import { IBucketRegistrationUpdateRaw, BucketRegistrationRaw, BucketRegistrationId, BucketName, IBucketRegistrationRepository, BucketRegistration } from '@rocketmakers/orbit-storage-core';
4
+ import { IDataContext, OrbitTransaction } from '@rocketmakers/orbit-db-core';
5
+ import { BucketRegistrationEntity } from '../entities';
6
+ export declare class BucketRegistrationRepository implements IBucketRegistrationRepository {
7
+ private timeService;
8
+ private uuidGenerator;
9
+ constructor(timeService: ITimeService, uuidGenerator: IUuidGeneratorService);
10
+ txCast(tx: OrbitTransaction): EntityManager;
11
+ protected getRepository(context: IDataContext): Repository<BucketRegistrationEntity>;
12
+ exists(context: IDataContext, name: BucketName): Promise<boolean>;
13
+ getRawByName(context: IDataContext, name: BucketName): Promise<BucketRegistrationRaw | undefined>;
14
+ getUpdatedOn(context: IDataContext, name: BucketName): Promise<DateTimeString | undefined>;
15
+ deleteByName(context: IDataContext, name: BucketName): Promise<boolean>;
16
+ getAll(context: IDataContext, query: IQuery<BucketRegistration>): Promise<IQueryResponse<BucketRegistrationRaw>>;
17
+ getById(context: IDataContext, id: BucketRegistrationId): Promise<BucketRegistrationRaw | undefined>;
18
+ private findById;
19
+ create(context: IDataContext, reg: BucketRegistrationRaw): Promise<BucketRegistrationRaw>;
20
+ update(context: IDataContext, reg: IBucketRegistrationUpdateRaw): Promise<import("@rocketmakers/orbit-core").UpdateStatus>;
21
+ private map;
22
+ }
23
+ //# sourceMappingURL=bucketRegistrationRepository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bucketRegistrationRepository.d.ts","sourceRoot":"","sources":["../../src/repositories/bucketRegistrationRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EACL,cAAc,EACd,MAAM,EACN,cAAc,EACd,YAAY,EACZ,qBAAqB,EAEtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,4BAA4B,EAC5B,qBAAqB,EACrB,oBAAoB,EACpB,UAAU,EACV,6BAA6B,EAC7B,kBAAkB,EACnB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE7E,OAAO,EAAE,wBAAwB,EAAE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= require("@rocketmakers/orbit-db-typeorm");
7
7
  const entities_1 = require("../entities");
8
- class BucketRegistrationRepository extends orbit_db_typeorm_1.CustomRepositoryBase {
8
+ class BucketRegistrationRepository {
9
9
  constructor(timeService, uuidGenerator) {
10
- super(entities_1.BucketRegistrationEntity);
11
10
  this.timeService = timeService;
12
11
  this.uuidGenerator = uuidGenerator;
13
12
  }
14
- exists(context, bucketName) {
13
+ txCast(tx) {
14
+ return tx;
15
+ }
16
+ getRepository(context) {
17
+ return this.txCast(context.tx).getRepository(entities_1.BucketRegistrationEntity);
18
+ }
19
+ exists(context, name) {
15
20
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
16
- const value = yield this.getRepository(context).count({ bucketName });
21
+ const value = yield this.getRepository(context).count({ name });
17
22
  return value > 0;
18
23
  });
19
24
  }
20
- getRawByName(context, bucketName) {
25
+ getRawByName(context, name) {
21
26
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
22
- const row = yield this.getRepository(context).findOne({ bucketName });
27
+ const row = yield this.getRepository(context).findOne({ name });
23
28
  if (!row) {
24
29
  return undefined;
25
30
  }
26
31
  return this.map(row);
27
32
  });
28
33
  }
29
- getUpdatedOn(context, bucketName) {
34
+ getUpdatedOn(context, name) {
30
35
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
31
- const bucket = yield this.getRepository(context).findOne({ bucketName }, { select: ['updatedOn'] });
36
+ const bucket = yield this.getRepository(context).findOne({ where: { name }, select: ['updatedOn'] });
32
37
  if (!bucket) {
33
38
  return undefined;
34
39
  }
35
40
  return bucket.updatedOn;
36
41
  });
37
42
  }
38
- deleteByName(context, bucketName) {
43
+ deleteByName(context, name) {
39
44
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
40
- return orbit_db_typeorm_1.RepositoryExtensions.deleteEntity(this.getRepository(context), { bucketName });
45
+ return orbit_db_typeorm_1.RepositoryExtensions.deleteEntity(this.getRepository(context), { name });
41
46
  });
42
47
  }
43
- getAll(context) {
48
+ getAll(context, query) {
44
49
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
45
- const registrations = yield this.getRepository(context).find();
46
- return registrations.map(this.map);
50
+ return orbit_db_typeorm_1.RepositoryExtensions.paginatedSearchWithMap(this.getRepository(context), query, {}, (b) => this.map(b));
47
51
  });
48
52
  }
49
53
  getById(context, id) {
@@ -80,7 +84,7 @@ class BucketRegistrationRepository extends orbit_db_typeorm_1.CustomRepositoryBa
80
84
  friendly: 'Bucket name already used',
81
85
  developer: 'Bucket name exists in the database',
82
86
  },
83
- value: reg.bucketName,
87
+ value: reg.name,
84
88
  },
85
89
  ]);
86
90
  }
@@ -97,16 +101,12 @@ class BucketRegistrationRepository extends orbit_db_typeorm_1.CustomRepositoryBa
97
101
  map(registration) {
98
102
  return {
99
103
  id: registration.id,
100
- readAccess: registration.readAccess,
101
- writeAccess: registration.writeAccess,
102
- deleteAccess: registration.deleteAccess,
103
104
  deleteMode: registration.deleteMode,
104
- convention: registration.convention,
105
105
  createdBy: registration.createdBy,
106
106
  createdOn: registration.createdOn,
107
107
  updatedBy: registration.updatedBy,
108
108
  updatedOn: registration.updatedOn,
109
- bucketName: registration.bucketName,
109
+ name: registration.name,
110
110
  pathPrefix: registration.pathPrefix,
111
111
  maxFileSizeBytes: registration.maxFileSizeBytes,
112
112
  config: registration.config,
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bucketRegistrationRepository.js","sourceRoot":"","sources":["../../src/repositories/bucketRegistrationRepository.ts"],"names":[],"mappings":";;;;AACA,yDAOkC;AAUlC,qEAAsE;AACtE,0CAAuD;AAEvD,MAAa,4BAA4B;IAEvC,YAAoB,WAAyB,EAAU,aAAoC;QAAvE,gBAAW,GAAX,WAAW,CAAc;QAAU,kBAAa,GAAb,aAAa,CAAuB;IAAG,CAAC;IAE/F,MAAM,CAAC,EAAoB;QACzB,OAAO,EAAmB,CAAC;IAC7B,CAAC;IAES,aAAa,CAAC,OAAqB;QAC3C,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,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YAAY;4BAClB,QAAQ,EAAE;gCACR,QAAQ,EAAE,0BAA0B;gCACpC,SAAS,EAAE,oCAAoC;6BAChD;4BACD,KAAK,EAAE,GAAG,CAAC,IAAI;yBAChB;qBACF,CAAC,CAAC;iBACJ;gBAED,MAAM,KAAK,CAAC;aACb;QACH,CAAC;KAAA;IAEK,MAAM,CAAC,OAAqB,EAAE,GAAiC;;YACnE,MAAM,EAAE,EAAE,EAAE,SAAS,KAAc,GAAG,EAAZ,IAAI,kBAAK,GAAG,EAAhC,mBAA0B,CAAM,CAAC;YACvC,OAAO,uCAAoB,CAAC,oCAAoC,CAC9D,OAAO,EACP,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAC3B,SAAS,EACT,EAAE,EACF,IAAI,EACJ,IAAI,CAAC,WAAW,CACjB,CAAC;QACJ,CAAC;KAAA;IAEO,GAAG,CAAC,YAAsC;QAChD,OAAO;YACL,EAAE,EAAE,YAAY,CAAC,EAAE;YACnB,UAAU,EAAE,YAAY,CAAC,UAAU;YACnC,SAAS,EAAE,YAAY,CAAC,SAAS;YACjC,SAAS,EAAE,YAAY,CAAC,SAAS;YACjC,SAAS,EAAE,YAAY,CAAC,SAAS;YACjC,SAAS,EAAE,YAAY,CAAC,SAAS;YACjC,IAAI,EAAE,YAAY,CAAC,IAAI;YACvB,UAAU,EAAE,YAAY,CAAC,UAAU;YACnC,gBAAgB,EAAE,YAAY,CAAC,gBAAgB;YAC/C,MAAM,EAAE,YAAY,CAAC,MAAM;SAC5B,CAAC;IACJ,CAAC;CACF;AAjID,oEAiIC"}
@@ -1,19 +1,22 @@
1
- import { ITimeService, IUuidGeneratorService } from '@rocketmakers/orbit-core';
2
- import { IDataContext } from '@rocketmakers/orbit-db-core';
3
- import { CustomRepositoryBase } from '@rocketmakers/orbit-db-typeorm';
1
+ import { EntityManager, Repository } from 'typeorm';
2
+ import { ITimeService, IUuidGeneratorService, IQueryResponse, IQuery } from '@rocketmakers/orbit-core';
3
+ import { IDataContext, OrbitTransaction } from '@rocketmakers/orbit-db-core';
4
4
  import { IFolder, FolderId, BucketName, IFolderRename, IFolderMove, IFolderCreate, FolderType, IFolderRepository } from '@rocketmakers/orbit-storage-core';
5
5
  import { Folder } from '../entities';
6
- export declare class FolderRepository extends CustomRepositoryBase<Folder> implements IFolderRepository {
6
+ export declare class FolderRepository implements IFolderRepository {
7
7
  private timeService;
8
8
  private uuidGenerator;
9
9
  constructor(timeService: ITimeService, uuidGenerator: IUuidGeneratorService);
10
+ txCast(tx: OrbitTransaction): EntityManager;
11
+ protected getRepository(context: IDataContext): Repository<Folder>;
10
12
  private getFolderIdsByParent;
11
13
  private getChildFolderIdsRecursive;
12
- getFolders(context: IDataContext, bucketName: BucketName): Promise<IFolder[]>;
13
- createFolder(context: IDataContext, creation: IFolderCreate, type: FolderType): Promise<import("@rocketmakers/orbit-core").OpaqueString<"FolderId">>;
14
+ getFolders(context: IDataContext, bucketName: BucketName, query: IQuery<IFolder>): Promise<IQueryResponse<IFolder>>;
15
+ createFolder(context: IDataContext, creation: IFolderCreate, type: FolderType): Promise<FolderId>;
14
16
  deleteFolder(context: IDataContext, id: FolderId): Promise<boolean>;
15
17
  renameFolder(context: IDataContext, update: IFolderRename): Promise<import("@rocketmakers/orbit-core").UpdateStatus>;
16
18
  moveFolder(context: IDataContext, update: IFolderMove): Promise<import("@rocketmakers/orbit-core").UpdateStatus>;
17
19
  private ensureParentIdInBucket;
18
20
  private ensureNotMovingToChild;
19
21
  }
22
+ //# sourceMappingURL=folderRepository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"folderRepository.d.ts","sourceRoot":"","sources":["../../src/repositories/folderRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAM,UAAU,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,cAAc,EACd,MAAM,EAEP,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE7E,OAAO,EACL,OAAO,EACP,QAAQ,EACR,UAAU,EACV,aAAa,EACb,WAAW,EACX,aAAa,EACb,UAAU,EACV,iBAAiB,EAClB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAMrC,qBAAa,gBAAiB,YAAW,iBAAiB;IAE5C,OAAO,CAAC,WAAW;IAAgB,OAAO,CAAC,aAAa;gBAAhD,WAAW,EAAE,YAAY,EAAU,aAAa,EAAE,qBAAqB;IAE3F,MAAM,CAAC,EAAE,EAAE,gBAAgB,GAAG,aAAa;IAI3C,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,YAAY,GAAG,UAAU,CAAC,MAAM,CAAC;YAIpD,oBAAoB;YAKpB,0BAA0B;IAWlC,UAAU,CACd,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,GACrB,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IAoC7B,YAAY,CAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,UAAU;IAoB7E,YAAY,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,QAAQ;IAQtD,YAAY,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa;IAWnD,UAAU,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW;YAqB7C,sBAAsB;YAUtB,sBAAsB;CASrC"}
@@ -6,15 +6,20 @@ const typeorm_1 = require("typeorm");
6
6
  const orbit_core_1 = require("@rocketmakers/orbit-core");
7
7
  const orbit_db_typeorm_1 = require("@rocketmakers/orbit-db-typeorm");
8
8
  const entities_1 = require("../entities");
9
- class FolderRepository extends orbit_db_typeorm_1.CustomRepositoryBase {
9
+ class FolderRepository {
10
10
  constructor(timeService, uuidGenerator) {
11
- super(entities_1.Folder);
12
11
  this.timeService = timeService;
13
12
  this.uuidGenerator = uuidGenerator;
14
13
  }
14
+ txCast(tx) {
15
+ return tx;
16
+ }
17
+ getRepository(context) {
18
+ return this.txCast(context.tx).getRepository(entities_1.Folder);
19
+ }
15
20
  getFolderIdsByParent(context, parentIds) {
16
21
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
17
- const f = yield this.getRepository(context).find({ where: { parentId: typeorm_1.In(parentIds) }, select: ['id'] });
22
+ const f = yield this.getRepository(context).find({ where: { parentId: (0, typeorm_1.In)(parentIds) }, select: ['id'] });
18
23
  return f ? f.map(g => g.id) : [];
19
24
  });
20
25
  }
@@ -29,10 +34,13 @@ class FolderRepository extends orbit_db_typeorm_1.CustomRepositoryBase {
29
34
  return folders;
30
35
  });
31
36
  }
32
- getFolders(context, bucketName) {
37
+ getFolders(context, bucketName, query) {
33
38
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
34
- const folders = yield this.getRepository(context).find({ where: { bucketName }, order: { parentId: 'ASC' } });
35
- const folderDict = folders.reduce((m, f) => {
39
+ const { items, itemCount, paging } = yield orbit_db_typeorm_1.RepositoryExtensions.paginatedSearch(this.getRepository(context), query, {
40
+ where: Object.assign({ bucketName }, query.where),
41
+ order: Object.assign({ parentId: 'ASC' }, query.order),
42
+ });
43
+ const folderDict = items.reduce((m, f) => {
36
44
  const folder = {
37
45
  name: f.folderName,
38
46
  id: f.id,
@@ -44,7 +52,7 @@ class FolderRepository extends orbit_db_typeorm_1.CustomRepositoryBase {
44
52
  return m;
45
53
  }, {});
46
54
  const returns = [];
47
- folders.forEach(f => {
55
+ items.forEach(f => {
48
56
  const current = folderDict[f.id];
49
57
  if (f.parentId) {
50
58
  folderDict[f.parentId].children.push(current);
@@ -53,7 +61,7 @@ class FolderRepository extends orbit_db_typeorm_1.CustomRepositoryBase {
53
61
  returns.push(current);
54
62
  }
55
63
  });
56
- return returns;
64
+ return { items: returns, itemCount, paging };
57
65
  });
58
66
  }
59
67
  createFolder(context, creation, type) {
@@ -86,7 +94,7 @@ class FolderRepository extends orbit_db_typeorm_1.CustomRepositoryBase {
86
94
  const repo = this.getRepository(context);
87
95
  const existing = yield orbit_db_typeorm_1.RepositoryExtensions.findById(repo, update.id, { select: ['bucketName'] });
88
96
  if (!existing) {
89
- throw new orbit_core_1.BadRequestError('Id is not a valid folder');
97
+ throw new orbit_core_1.ArgumentValidationError('Id is not a valid folder');
90
98
  }
91
99
  yield this.ensureParentIdInBucket(repo, update.parentId, existing.bucketName);
92
100
  yield this.ensureNotMovingToChild(repo, update.id, update.parentId);
@@ -97,10 +105,10 @@ class FolderRepository extends orbit_db_typeorm_1.CustomRepositoryBase {
97
105
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
98
106
  const parent = yield orbit_db_typeorm_1.RepositoryExtensions.findById(repo, parentId, { select: ['bucketName'] });
99
107
  if (!parent) {
100
- throw new orbit_core_1.BadRequestError('ParentId is not a valid folder');
108
+ throw new orbit_core_1.ArgumentValidationError('ParentId is not a valid folder');
101
109
  }
102
110
  if (parent.bucketName !== bucketName) {
103
- throw new orbit_core_1.BadRequestError('Parent Folder is from a different bucket');
111
+ throw new orbit_core_1.ArgumentValidationError('Parent Folder is from a different bucket');
104
112
  }
105
113
  });
106
114
  }
@@ -108,7 +116,7 @@ class FolderRepository extends orbit_db_typeorm_1.CustomRepositoryBase {
108
116
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
109
117
  const childrenOfFolder = yield repo.find({ where: { parentId: folder }, select: ['id'] });
110
118
  if (childrenOfFolder.some(f => f.id === find)) {
111
- throw new orbit_core_1.BadRequestError('You cannot move a folder into it own children');
119
+ throw new orbit_core_1.ArgumentValidationError('You cannot move a folder into it own children');
112
120
  }
113
121
  for (const childFolder of childrenOfFolder) {
114
122
  yield this.ensureNotMovingToChild(repo, childFolder.id, find);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"folderRepository.js","sourceRoot":"","sources":["../../src/repositories/folderRepository.ts"],"names":[],"mappings":";;;;AAAA,q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