mblabs-roccato-backend-commons 1.0.82 → 1.0.84

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,5 +7,6 @@ export default class AddressEntity extends BaseEntity {
7
7
  city?: string;
8
8
  neighborhood?: string;
9
9
  state?: string;
10
+ locale?: string;
10
11
  constructor(partial: Partial<AddressEntity>);
11
12
  }
@@ -22,6 +22,7 @@ let AddressEntity = class AddressEntity extends base_1.default {
22
22
  city;
23
23
  neighborhood;
24
24
  state;
25
+ locale;
25
26
  constructor(partial) {
26
27
  super();
27
28
  Object.assign(this, partial);
@@ -55,6 +56,10 @@ __decorate([
55
56
  (0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
56
57
  __metadata("design:type", String)
57
58
  ], AddressEntity.prototype, "state", void 0);
59
+ __decorate([
60
+ (0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
61
+ __metadata("design:type", String)
62
+ ], AddressEntity.prototype, "locale", void 0);
58
63
  AddressEntity = __decorate([
59
64
  (0, typeorm_1.Entity)('address'),
60
65
  __metadata("design:paramtypes", [Object])
@@ -9,6 +9,7 @@ export default class GroupEntity extends BaseEntity {
9
9
  initials?: string;
10
10
  description?: string;
11
11
  isDefault?: boolean;
12
+ locale?: string;
12
13
  accountGroups?: Relation<AccountGroupEntity>[];
13
14
  groupModules?: Relation<GroupModuleEntity>[];
14
15
  constructor(partial: Partial<GroupEntity>);
@@ -23,6 +23,7 @@ let GroupEntity = class GroupEntity extends base_1.default {
23
23
  initials;
24
24
  description;
25
25
  isDefault;
26
+ locale;
26
27
  accountGroups;
27
28
  groupModules;
28
29
  constructor(partial) {
@@ -54,6 +55,10 @@ __decorate([
54
55
  (0, typeorm_1.Column)({ type: 'boolean', nullable: true }),
55
56
  __metadata("design:type", Boolean)
56
57
  ], GroupEntity.prototype, "isDefault", void 0);
58
+ __decorate([
59
+ (0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
60
+ __metadata("design:type", String)
61
+ ], GroupEntity.prototype, "locale", void 0);
57
62
  __decorate([
58
63
  (0, typeorm_1.OneToMany)(() => account_group_1.default, ag => ag.group),
59
64
  __metadata("design:type", Array)
@@ -8,6 +8,7 @@ export default class ProfileEntity extends BaseEntity {
8
8
  description?: string;
9
9
  slug?: string;
10
10
  isDefault?: boolean;
11
+ locale?: string;
11
12
  profileModules?: Relation<ProfileModuleEntity>[];
12
13
  constructor(partial: Partial<ProfileEntity>);
13
14
  }
@@ -22,6 +22,7 @@ let ProfileEntity = class ProfileEntity extends base_1.default {
22
22
  description;
23
23
  slug;
24
24
  isDefault;
25
+ locale;
25
26
  profileModules;
26
27
  constructor(partial) {
27
28
  super();
@@ -52,6 +53,10 @@ __decorate([
52
53
  (0, typeorm_1.Column)({ type: 'boolean', nullable: true }),
53
54
  __metadata("design:type", Boolean)
54
55
  ], ProfileEntity.prototype, "isDefault", void 0);
56
+ __decorate([
57
+ (0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
58
+ __metadata("design:type", String)
59
+ ], ProfileEntity.prototype, "locale", void 0);
55
60
  __decorate([
56
61
  (0, typeorm_1.OneToMany)(() => profile_module_1.default, pm => pm.profile),
57
62
  __metadata("design:type", Array)
@@ -51,6 +51,12 @@ class CreateProfilesTable1748448589743 {
51
51
  type: 'boolean',
52
52
  isNullable: true,
53
53
  },
54
+ {
55
+ name: 'locale',
56
+ type: 'varchar',
57
+ isNullable: true,
58
+ default: '\'pt-BR\'',
59
+ },
54
60
  {
55
61
  name: 'createdBy',
56
62
  type: 'varchar',
@@ -21,6 +21,7 @@ class CreateGroupTable1748449000000 {
21
21
  { name: 'initials', type: 'varchar', isNullable: true },
22
22
  { name: 'description', type: 'text', isNullable: true },
23
23
  { name: 'isDefault', type: 'boolean', isNullable: true },
24
+ { name: 'locale', type: 'varchar', isNullable: true, default: '\'pt-BR\'' },
24
25
  { name: 'createdBy', type: 'varchar', isNullable: true },
25
26
  { name: 'createdAt', type: 'timestamptz', default: 'now()' },
26
27
  { name: 'updatedBy', type: 'varchar', isNullable: true },
@@ -56,6 +56,12 @@ class CreateAddressTable1750432386920 {
56
56
  type: 'varchar',
57
57
  isNullable: true,
58
58
  },
59
+ {
60
+ name: 'locale',
61
+ type: 'varchar',
62
+ isNullable: true,
63
+ default: '\'pt-BR\'',
64
+ },
59
65
  {
60
66
  name: 'createdBy',
61
67
  type: 'varchar',
@@ -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.82",
3
+ "version": "1.0.84",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -28,8 +28,11 @@ export default class AddressEntity extends BaseEntity {
28
28
  @Column({ type: 'varchar', nullable: true })
29
29
  public state?: string;
30
30
 
31
+ @Column({ type: 'varchar', nullable: true })
32
+ public locale?: string;
33
+
31
34
  constructor (partial: Partial<AddressEntity>) {
32
35
  super();
33
36
  Object.assign(this, partial);
34
37
  }
35
- }
38
+ }
@@ -29,6 +29,9 @@ export default class GroupEntity extends BaseEntity {
29
29
  @Column({ type: 'boolean', nullable: true })
30
30
  public isDefault?: boolean;
31
31
 
32
+ @Column({ type: 'varchar', nullable: true })
33
+ public locale?: string;
34
+
32
35
  @OneToMany(() => AccountGroupEntity, ag => ag.group)
33
36
  public accountGroups?: Relation<AccountGroupEntity>[];
34
37
 
@@ -28,6 +28,9 @@ export default class ProfileEntity extends BaseEntity {
28
28
  @Column({ type: 'boolean', nullable: true })
29
29
  public isDefault?: boolean;
30
30
 
31
+ @Column({ type: 'varchar', nullable: true })
32
+ public locale?: string;
33
+
31
34
  @OneToMany(() => ProfileModuleEntity, pm => pm.profile)
32
35
  public profileModules?: Relation<ProfileModuleEntity>[];
33
36
 
@@ -50,6 +50,12 @@ export class CreateProfilesTable1748448589743 implements MigrationInterface {
50
50
  type: 'boolean',
51
51
  isNullable: true,
52
52
  },
53
+ {
54
+ name: 'locale',
55
+ type: 'varchar',
56
+ isNullable: true,
57
+ default: '\'pt-BR\'',
58
+ },
53
59
  {
54
60
  name: 'createdBy',
55
61
  type: 'varchar',
@@ -19,6 +19,7 @@ export class CreateGroupTable1748449000000 implements MigrationInterface {
19
19
  { name: 'initials', type: 'varchar', isNullable: true },
20
20
  { name: 'description', type: 'text', isNullable: true },
21
21
  { name: 'isDefault', type: 'boolean', isNullable: true },
22
+ { name: 'locale', type: 'varchar', isNullable: true, default: '\'pt-BR\'' },
22
23
  { name: 'createdBy', type: 'varchar', isNullable: true },
23
24
  { name: 'createdAt', type: 'timestamptz', default: 'now()' },
24
25
  { name: 'updatedBy', type: 'varchar', isNullable: true },
@@ -55,6 +55,12 @@ export class CreateAddressTable1750432386920 implements MigrationInterface {
55
55
  type: 'varchar',
56
56
  isNullable: true,
57
57
  },
58
+ {
59
+ name: 'locale',
60
+ type: 'varchar',
61
+ isNullable: true,
62
+ default: '\'pt-BR\'',
63
+ },
58
64
  {
59
65
  name: 'createdBy',
60
66
  type: 'varchar',
@@ -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