mblabs-roccato-backend-commons 1.0.81 → 1.0.83

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.
@@ -68,7 +68,7 @@ __decorate([
68
68
  __metadata("design:type", Object)
69
69
  ], AccountEntity.prototype, "metadata", void 0);
70
70
  __decorate([
71
- (0, typeorm_1.Column)({ type: 'boolean', nullable: true }),
71
+ (0, typeorm_1.Column)({ type: 'boolean', nullable: true, default: false }),
72
72
  __metadata("design:type", Boolean)
73
73
  ], AccountEntity.prototype, "isDefault", void 0);
74
74
  __decorate([
@@ -60,6 +60,7 @@ class CreateAccountsTable1748448589934 {
60
60
  name: 'isDefault',
61
61
  type: 'boolean',
62
62
  isNullable: true,
63
+ default: false,
63
64
  },
64
65
  {
65
66
  name: 'metadata',
@@ -94,6 +94,9 @@ export declare namespace AmazonS3 {
94
94
  isUpload?: boolean;
95
95
  expiresInHours?: number;
96
96
  contentType?: string;
97
+ options?: {
98
+ isPrivate?: boolean;
99
+ };
97
100
  };
98
101
  credentials: Credentials;
99
102
  }
@@ -122,6 +122,7 @@ class AmazonS3Service {
122
122
  ...(data.isUpload && data?.contentType && ({
123
123
  ContentType: data.contentType,
124
124
  })),
125
+ ACL: data.options?.isPrivate ? 'private' : 'public-read',
125
126
  };
126
127
  const method = data.isUpload
127
128
  ? new client_s3_1.PutObjectCommand(payload)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mblabs-roccato-backend-commons",
3
- "version": "1.0.81",
3
+ "version": "1.0.83",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -39,7 +39,7 @@ export default class AccountEntity extends BaseEntity {
39
39
  @Column({ type: 'jsonb', nullable: true })
40
40
  public metadata?: unknown;
41
41
 
42
- @Column({ type: 'boolean', nullable: true })
42
+ @Column({ type: 'boolean', nullable: true, default: false })
43
43
  public isDefault?: boolean;
44
44
 
45
45
  @OneToMany(() => AccountModuleEntity, am => am.account)
@@ -59,6 +59,7 @@ export class CreateAccountsTable1748448589934 implements MigrationInterface {
59
59
  name: 'isDefault',
60
60
  type: 'boolean',
61
61
  isNullable: true,
62
+ default: false,
62
63
  },
63
64
  {
64
65
  name: 'metadata',
@@ -102,6 +102,9 @@ export namespace AmazonS3 {
102
102
  isUpload?: boolean;
103
103
  expiresInHours?: number;
104
104
  contentType?: string;
105
+ options?: {
106
+ isPrivate?: boolean;
107
+ };
105
108
  };
106
109
  credentials: Credentials;
107
110
  }
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  DeleteObjectCommandInput,
3
3
  GetObjectCommand,
4
+ GetObjectCommandInput,
4
5
  PutObjectCommand,
5
6
  PutObjectCommandInput,
6
7
  S3,
@@ -140,12 +141,13 @@ class AmazonS3Service implements IAmazonS3Service {
140
141
  region: credentials.region,
141
142
  });
142
143
 
143
- const payload = {
144
+ const payload: PutObjectCommandInput | GetObjectCommandInput = {
144
145
  Bucket: data.bucket,
145
146
  Key: this.getBucketPath(data.filename, data.folder),
146
147
  ...(data.isUpload && data?.contentType && ({
147
148
  ContentType: data.contentType,
148
149
  })),
150
+ ACL: data.options?.isPrivate ? 'private' : 'public-read',
149
151
  };
150
152
 
151
153
  const method = data.isUpload