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.
- package/dist/database/entities/address.d.ts +1 -0
- package/dist/database/entities/address.js +5 -0
- package/dist/database/entities/group.d.ts +1 -0
- package/dist/database/entities/group.js +5 -0
- package/dist/database/entities/profile.d.ts +1 -0
- package/dist/database/entities/profile.js +5 -0
- package/dist/database/migrations/1748448589743-CreateProfilesTable.js +6 -0
- package/dist/database/migrations/1749142281608-CreateGroupTable.js +1 -0
- package/dist/database/migrations/1750432386920-CreateAddressTable.js +6 -0
- package/dist/interfaces/aws.d.ts +3 -0
- package/dist/services/aws/s3.js +1 -0
- package/package.json +1 -1
- package/src/database/entities/address.ts +4 -1
- package/src/database/entities/group.ts +3 -0
- package/src/database/entities/profile.ts +3 -0
- package/src/database/migrations/1748448589743-CreateProfilesTable.ts +6 -0
- package/src/database/migrations/1749142281608-CreateGroupTable.ts +1 -0
- package/src/database/migrations/1750432386920-CreateAddressTable.ts +6 -0
- package/src/interfaces/aws.ts +3 -0
- package/src/services/aws/s3.ts +3 -1
|
@@ -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)
|
|
@@ -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)
|
|
@@ -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 },
|
package/dist/interfaces/aws.d.ts
CHANGED
package/dist/services/aws/s3.js
CHANGED
|
@@ -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
|
@@ -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',
|
package/src/interfaces/aws.ts
CHANGED
package/src/services/aws/s3.ts
CHANGED
|
@@ -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
|