mblabs-roccato-backend-commons 0.0.2 → 0.0.4
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/account-group.d.ts +10 -0
- package/dist/database/entities/account-group.js +47 -0
- package/dist/database/entities/account-module.d.ts +10 -0
- package/dist/database/entities/account-module.js +49 -0
- package/dist/database/entities/account.d.ts +2 -2
- package/dist/database/entities/account.js +2 -2
- package/dist/database/entities/group-module.d.ts +11 -0
- package/dist/database/entities/group-module.js +53 -0
- package/dist/database/entities/group.d.ts +6 -0
- package/dist/database/entities/group.js +35 -0
- package/dist/database/entities/index.d.ts +2 -2
- package/dist/database/entities/index.js +2 -2
- package/dist/database/migrations/1748448589743-CreateProfilesTable.js +1 -1
- package/dist/database/migrations/1748448589934-CreateAccountsTable.js +1 -1
- package/dist/database/migrations/1748448590133-CreateLeadsTable.js +1 -1
- package/dist/database/migrations/1748448590361-CreateLeadResponsiblesTable.js +1 -1
- package/dist/database/migrations/1749142281608-CreateGroupTable.d.ts +5 -0
- package/dist/database/migrations/1749142281608-CreateGroupTable.js +56 -0
- package/dist/database/migrations/1749142314101-CreateAccountGroupTable.d.ts +5 -0
- package/dist/database/migrations/1749142314101-CreateAccountGroupTable.js +61 -0
- package/dist/database/migrations/1749142329095-CreateGroupModuleTable.d.ts +5 -0
- package/dist/database/migrations/1749142329095-CreateGroupModuleTable.js +62 -0
- package/dist/database/migrations/1749142343254-CreateAccountModuleTable.d.ts +5 -0
- package/dist/database/migrations/1749142343254-CreateAccountModuleTable.js +62 -0
- package/dist/database/migrations/index.d.ts +2 -5
- package/dist/database/migrations/index.js +21 -19
- package/dist/services/aws/cloudwatch.d.ts +1 -1
- package/dist/services/aws/index.d.ts +4 -4
- package/dist/services/aws/index.js +4 -4
- package/dist/services/aws/pinpoint.d.ts +1 -1
- package/dist/services/aws/s3.d.ts +1 -1
- package/dist/services/aws/s3.js +1 -1
- package/dist/services/aws/secret-manager.d.ts +1 -1
- package/dist/services/aws/secret-manager.js +1 -1
- package/dist/services/azure/application-insights.d.ts +1 -1
- package/dist/services/azure/communication.d.ts +1 -1
- package/dist/services/azure/index.d.ts +4 -4
- package/dist/services/azure/index.js +4 -4
- package/dist/services/azure/keyvault.d.ts +1 -1
- package/dist/services/azure/keyvault.js +1 -1
- package/dist/services/azure/storage-blob.d.ts +1 -1
- package/dist/services/azure/storage-blob.js +2 -2
- package/dist/services/file.js +1 -1
- package/dist/services/firebase.d.ts +1 -1
- package/dist/services/gcp/drive.d.ts +1 -1
- package/dist/services/gcp/index.d.ts +3 -3
- package/dist/services/gcp/index.js +3 -3
- package/dist/services/gcp/secrets.d.ts +1 -1
- package/dist/services/gcp/secrets.js +1 -1
- package/dist/services/gcp/sheets.d.ts +1 -1
- package/dist/services/grafana.d.ts +1 -1
- package/dist/services/grafana.js +1 -1
- package/dist/services/http.d.ts +1 -1
- package/dist/services/index.d.ts +11 -11
- package/dist/services/index.js +11 -11
- package/dist/services/keycloak.d.ts +1 -1
- package/dist/services/keycloak.js +1 -1
- package/dist/services/rabbit.d.ts +1 -1
- package/dist/services/redis.d.ts +1 -2
- package/dist/services/sendgrid.d.ts +1 -1
- package/package.json +2 -2
- package/src/database/entities/account-group.ts +33 -0
- package/src/database/entities/account-module.ts +34 -0
- package/src/database/entities/account.ts +2 -2
- package/src/database/entities/group-module.ts +37 -0
- package/src/database/entities/group.ts +20 -0
- package/src/database/entities/index.ts +2 -2
- package/src/database/migrations/1748448589743-CreateProfilesTable.ts +1 -1
- package/src/database/migrations/1748448589934-CreateAccountsTable.ts +1 -1
- package/src/database/migrations/1748448590133-CreateLeadsTable.ts +1 -1
- package/src/database/migrations/1748448590361-CreateLeadResponsiblesTable.ts +1 -1
- package/src/database/migrations/1749142281608-CreateGroupTable.ts +43 -0
- package/src/database/migrations/1749142314101-CreateAccountGroupTable.ts +48 -0
- package/src/database/migrations/1749142329095-CreateGroupModuleTable.ts +49 -0
- package/src/database/migrations/1749142343254-CreateAccountModuleTable.ts +49 -0
- package/src/database/migrations/index.ts +21 -5
- package/src/services/aws/cloudwatch.ts +1 -1
- package/src/services/aws/index.ts +4 -4
- package/src/services/aws/pinpoint.ts +1 -1
- package/src/services/aws/s3.ts +2 -3
- package/src/services/aws/secret-manager.ts +2 -3
- package/src/services/azure/application-insights.ts +1 -1
- package/src/services/azure/communication.ts +1 -1
- package/src/services/azure/index.ts +4 -4
- package/src/services/azure/keyvault.ts +2 -3
- package/src/services/azure/storage-blob.ts +3 -4
- package/src/services/file.ts +1 -1
- package/src/services/firebase.ts +1 -1
- package/src/services/gcp/drive.ts +1 -1
- package/src/services/gcp/index.ts +3 -3
- package/src/services/gcp/secrets.ts +2 -3
- package/src/services/gcp/sheets.ts +1 -1
- package/src/services/grafana.ts +2 -3
- package/src/services/http.ts +1 -1
- package/src/services/index.ts +11 -11
- package/src/services/keycloak.ts +2 -3
- package/src/services/rabbit.ts +1 -1
- package/src/services/redis.ts +1 -2
- package/src/services/sendgrid.ts +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import AccountEntity from './account';
|
|
2
|
+
import BaseEntity from './base';
|
|
3
|
+
import GroupEntity from './group';
|
|
4
|
+
export default class AccountGroupEntity extends BaseEntity {
|
|
5
|
+
accountId: string;
|
|
6
|
+
groupId: string;
|
|
7
|
+
account?: AccountEntity;
|
|
8
|
+
group?: GroupEntity;
|
|
9
|
+
constructor(partial: Partial<AccountGroupEntity>);
|
|
10
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const typeorm_1 = require("typeorm");
|
|
16
|
+
const account_1 = __importDefault(require("./account"));
|
|
17
|
+
const base_1 = __importDefault(require("./base"));
|
|
18
|
+
const group_1 = __importDefault(require("./group"));
|
|
19
|
+
let AccountGroupEntity = class AccountGroupEntity extends base_1.default {
|
|
20
|
+
constructor(partial) {
|
|
21
|
+
super();
|
|
22
|
+
Object.assign(this, partial);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.Column)({ type: 'uuid', nullable: false }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], AccountGroupEntity.prototype, "accountId", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)({ type: 'uuid', nullable: false }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], AccountGroupEntity.prototype, "groupId", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.ManyToOne)(() => account_1.default),
|
|
35
|
+
(0, typeorm_1.JoinColumn)({ name: 'accountId', referencedColumnName: 'id' }),
|
|
36
|
+
__metadata("design:type", account_1.default)
|
|
37
|
+
], AccountGroupEntity.prototype, "account", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.ManyToOne)(() => group_1.default),
|
|
40
|
+
(0, typeorm_1.JoinColumn)({ name: 'groupId', referencedColumnName: 'id' }),
|
|
41
|
+
__metadata("design:type", group_1.default)
|
|
42
|
+
], AccountGroupEntity.prototype, "group", void 0);
|
|
43
|
+
AccountGroupEntity = __decorate([
|
|
44
|
+
(0, typeorm_1.Entity)('account_group'),
|
|
45
|
+
__metadata("design:paramtypes", [Object])
|
|
46
|
+
], AccountGroupEntity);
|
|
47
|
+
exports.default = AccountGroupEntity;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import AccountEntity from './account';
|
|
2
|
+
import BaseEntity from './base';
|
|
3
|
+
export default class AccountModuleEntity extends BaseEntity {
|
|
4
|
+
accountId: string;
|
|
5
|
+
account?: AccountEntity;
|
|
6
|
+
canView?: boolean;
|
|
7
|
+
canEdit?: boolean;
|
|
8
|
+
canDelete?: boolean;
|
|
9
|
+
constructor(partial: Partial<AccountModuleEntity>);
|
|
10
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const typeorm_1 = require("typeorm");
|
|
16
|
+
const account_1 = __importDefault(require("./account"));
|
|
17
|
+
const base_1 = __importDefault(require("./base"));
|
|
18
|
+
let AccountModuleEntity = class AccountModuleEntity extends base_1.default {
|
|
19
|
+
constructor(partial) {
|
|
20
|
+
super();
|
|
21
|
+
Object.assign(this, partial);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.Column)({ type: 'uuid', nullable: false }),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], AccountModuleEntity.prototype, "accountId", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.ManyToOne)(() => account_1.default),
|
|
30
|
+
(0, typeorm_1.JoinColumn)({ name: 'accountId', referencedColumnName: 'id' }),
|
|
31
|
+
__metadata("design:type", account_1.default)
|
|
32
|
+
], AccountModuleEntity.prototype, "account", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({ type: 'boolean', nullable: true }),
|
|
35
|
+
__metadata("design:type", Boolean)
|
|
36
|
+
], AccountModuleEntity.prototype, "canView", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({ type: 'boolean', nullable: true }),
|
|
39
|
+
__metadata("design:type", Boolean)
|
|
40
|
+
], AccountModuleEntity.prototype, "canEdit", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({ type: 'boolean', nullable: true }),
|
|
43
|
+
__metadata("design:type", Boolean)
|
|
44
|
+
], AccountModuleEntity.prototype, "canDelete", void 0);
|
|
45
|
+
AccountModuleEntity = __decorate([
|
|
46
|
+
(0, typeorm_1.Entity)('account_module'),
|
|
47
|
+
__metadata("design:paramtypes", [Object])
|
|
48
|
+
], AccountModuleEntity);
|
|
49
|
+
exports.default = AccountModuleEntity;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import BaseEntity from '
|
|
2
|
-
import ProfileEntity from '
|
|
1
|
+
import BaseEntity from './base';
|
|
2
|
+
import ProfileEntity from './profile';
|
|
3
3
|
export default class AccountEntity extends BaseEntity {
|
|
4
4
|
tenantId?: string;
|
|
5
5
|
name?: string;
|
|
@@ -13,8 +13,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const typeorm_1 = require("typeorm");
|
|
16
|
-
const base_1 = __importDefault(require("
|
|
17
|
-
const profile_1 = __importDefault(require("
|
|
16
|
+
const base_1 = __importDefault(require("./base"));
|
|
17
|
+
const profile_1 = __importDefault(require("./profile"));
|
|
18
18
|
let AccountEntity = class AccountEntity extends base_1.default {
|
|
19
19
|
constructor(partial) {
|
|
20
20
|
super();
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import BaseEntity from './base';
|
|
2
|
+
import GroupEntity from './group';
|
|
3
|
+
export default class GroupModuleEntity extends BaseEntity {
|
|
4
|
+
groupId: string;
|
|
5
|
+
tenantModuleId: string;
|
|
6
|
+
group?: GroupEntity;
|
|
7
|
+
canView?: boolean;
|
|
8
|
+
canEdit?: boolean;
|
|
9
|
+
canDelete?: boolean;
|
|
10
|
+
constructor(partial: Partial<GroupModuleEntity>);
|
|
11
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const typeorm_1 = require("typeorm");
|
|
16
|
+
const base_1 = __importDefault(require("./base"));
|
|
17
|
+
const group_1 = __importDefault(require("./group"));
|
|
18
|
+
let GroupModuleEntity = class GroupModuleEntity extends base_1.default {
|
|
19
|
+
constructor(partial) {
|
|
20
|
+
super();
|
|
21
|
+
Object.assign(this, partial);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.Column)({ type: 'uuid', nullable: false }),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], GroupModuleEntity.prototype, "groupId", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.Column)({ type: 'uuid', nullable: false }),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], GroupModuleEntity.prototype, "tenantModuleId", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, typeorm_1.ManyToOne)(() => group_1.default),
|
|
34
|
+
(0, typeorm_1.JoinColumn)({ name: 'groupId', referencedColumnName: 'id' }),
|
|
35
|
+
__metadata("design:type", group_1.default)
|
|
36
|
+
], GroupModuleEntity.prototype, "group", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({ type: 'boolean', nullable: true }),
|
|
39
|
+
__metadata("design:type", Boolean)
|
|
40
|
+
], GroupModuleEntity.prototype, "canView", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({ type: 'boolean', nullable: true }),
|
|
43
|
+
__metadata("design:type", Boolean)
|
|
44
|
+
], GroupModuleEntity.prototype, "canEdit", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.Column)({ type: 'boolean', nullable: true }),
|
|
47
|
+
__metadata("design:type", Boolean)
|
|
48
|
+
], GroupModuleEntity.prototype, "canDelete", void 0);
|
|
49
|
+
GroupModuleEntity = __decorate([
|
|
50
|
+
(0, typeorm_1.Entity)('group_module'),
|
|
51
|
+
__metadata("design:paramtypes", [Object])
|
|
52
|
+
], GroupModuleEntity);
|
|
53
|
+
exports.default = GroupModuleEntity;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const typeorm_1 = require("typeorm");
|
|
16
|
+
const base_1 = __importDefault(require("./base"));
|
|
17
|
+
let GroupEntity = class GroupEntity extends base_1.default {
|
|
18
|
+
constructor(partial) {
|
|
19
|
+
super();
|
|
20
|
+
Object.assign(this, partial);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, typeorm_1.Column)({ type: 'varchar', nullable: false, unique: true }),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], GroupEntity.prototype, "name", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], GroupEntity.prototype, "description", void 0);
|
|
31
|
+
GroupEntity = __decorate([
|
|
32
|
+
(0, typeorm_1.Entity)('group'),
|
|
33
|
+
__metadata("design:paramtypes", [Object])
|
|
34
|
+
], GroupEntity);
|
|
35
|
+
exports.default = GroupEntity;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import AccountEntity from '
|
|
2
|
-
import ProfileEntity from '
|
|
1
|
+
import AccountEntity from './account';
|
|
2
|
+
import ProfileEntity from './profile';
|
|
3
3
|
export { AccountEntity, ProfileEntity, };
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ProfileEntity = exports.AccountEntity = void 0;
|
|
7
|
-
const account_1 = __importDefault(require("
|
|
7
|
+
const account_1 = __importDefault(require("./account"));
|
|
8
8
|
exports.AccountEntity = account_1.default;
|
|
9
|
-
const profile_1 = __importDefault(require("
|
|
9
|
+
const profile_1 = __importDefault(require("./profile"));
|
|
10
10
|
exports.ProfileEntity = profile_1.default;
|
|
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.CreateProfilesTable1748448589743 = void 0;
|
|
16
16
|
const typeorm_1 = require("typeorm");
|
|
17
|
-
const utils_1 = __importDefault(require("
|
|
17
|
+
const utils_1 = __importDefault(require("../utils"));
|
|
18
18
|
class CreateProfilesTable1748448589743 {
|
|
19
19
|
up(queryRunner) {
|
|
20
20
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.CreateAccountsTable1748448589934 = void 0;
|
|
16
16
|
const typeorm_1 = require("typeorm");
|
|
17
|
-
const utils_1 = __importDefault(require("
|
|
17
|
+
const utils_1 = __importDefault(require("../utils"));
|
|
18
18
|
class CreateAccountsTable1748448589934 {
|
|
19
19
|
up(queryRunner) {
|
|
20
20
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.CreateLeadsTable1748448590133 = void 0;
|
|
16
16
|
const typeorm_1 = require("typeorm");
|
|
17
|
-
const utils_1 = __importDefault(require("
|
|
17
|
+
const utils_1 = __importDefault(require("../utils"));
|
|
18
18
|
class CreateLeadsTable1748448590133 {
|
|
19
19
|
up(queryRunner) {
|
|
20
20
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.CreateLeadResponsiblesTable1748448590361 = void 0;
|
|
16
16
|
const typeorm_1 = require("typeorm");
|
|
17
|
-
const utils_1 = __importDefault(require("
|
|
17
|
+
const utils_1 = __importDefault(require("../utils"));
|
|
18
18
|
class CreateLeadResponsiblesTable1748448590361 {
|
|
19
19
|
up(queryRunner) {
|
|
20
20
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.CreateGroupTable1748449000000 = void 0;
|
|
16
|
+
const typeorm_1 = require("typeorm");
|
|
17
|
+
const utils_1 = __importDefault(require("../utils"));
|
|
18
|
+
class CreateGroupTable1748449000000 {
|
|
19
|
+
up(queryRunner) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
const hasTable = yield utils_1.default.checkHasTable('group', queryRunner);
|
|
22
|
+
if (hasTable)
|
|
23
|
+
return;
|
|
24
|
+
yield queryRunner.createTable(new typeorm_1.Table({
|
|
25
|
+
name: 'group',
|
|
26
|
+
columns: [
|
|
27
|
+
{ name: 'id', type: 'uuid', isPrimary: true, generationStrategy: 'uuid', default: 'uuid_generate_v4()' },
|
|
28
|
+
{ name: 'name', type: 'varchar', isNullable: false, isUnique: true },
|
|
29
|
+
{ name: 'description', type: 'text', isNullable: true },
|
|
30
|
+
{ name: 'createdBy', type: 'varchar', isNullable: true },
|
|
31
|
+
{ name: 'createdAt', type: 'timestamptz', default: 'now()' },
|
|
32
|
+
{ name: 'updatedBy', type: 'varchar', isNullable: true },
|
|
33
|
+
{ name: 'updatedAt', type: 'timestamptz', default: 'now()' },
|
|
34
|
+
{ name: 'deletedBy', type: 'varchar', isNullable: true },
|
|
35
|
+
{ name: 'deletedAt', type: 'timestamptz', isNullable: true },
|
|
36
|
+
],
|
|
37
|
+
indices: [
|
|
38
|
+
new typeorm_1.TableIndex({
|
|
39
|
+
name: 'IDX_GROUP',
|
|
40
|
+
columnNames: ['id', 'name'],
|
|
41
|
+
}),
|
|
42
|
+
],
|
|
43
|
+
}));
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
down(queryRunner) {
|
|
47
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
const hasTable = yield utils_1.default.checkHasTable('group', queryRunner);
|
|
49
|
+
if (!hasTable)
|
|
50
|
+
return;
|
|
51
|
+
yield utils_1.default.dropIndex('group', 'IDX_GROUP', queryRunner);
|
|
52
|
+
yield queryRunner.dropTable('group');
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.CreateGroupTable1748449000000 = CreateGroupTable1748449000000;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.CreateAccountGroupTable1748449000100 = void 0;
|
|
16
|
+
const typeorm_1 = require("typeorm");
|
|
17
|
+
const utils_1 = __importDefault(require("../utils"));
|
|
18
|
+
class CreateAccountGroupTable1748449000100 {
|
|
19
|
+
up(queryRunner) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
const hasTable = yield utils_1.default.checkHasTable('account_group', queryRunner);
|
|
22
|
+
if (hasTable)
|
|
23
|
+
return;
|
|
24
|
+
yield queryRunner.createTable(new typeorm_1.Table({
|
|
25
|
+
name: 'account_group',
|
|
26
|
+
columns: [
|
|
27
|
+
{ name: 'id', type: 'uuid', isPrimary: true, generationStrategy: 'uuid', default: 'uuid_generate_v4()' },
|
|
28
|
+
{ name: 'accountId', type: 'uuid', isNullable: false },
|
|
29
|
+
{ name: 'groupId', type: 'uuid', isNullable: false },
|
|
30
|
+
{ name: 'createdBy', type: 'varchar', isNullable: true },
|
|
31
|
+
{ name: 'createdAt', type: 'timestamptz', default: 'now()' },
|
|
32
|
+
{ name: 'updatedBy', type: 'varchar', isNullable: true },
|
|
33
|
+
{ name: 'updatedAt', type: 'timestamptz', default: 'now()' },
|
|
34
|
+
{ name: 'deletedBy', type: 'varchar', isNullable: true },
|
|
35
|
+
{ name: 'deletedAt', type: 'timestamptz', isNullable: true },
|
|
36
|
+
],
|
|
37
|
+
foreignKeys: [
|
|
38
|
+
{ columnNames: ['accountId'], referencedColumnNames: ['id'], referencedTableName: 'account' },
|
|
39
|
+
{ columnNames: ['groupId'], referencedColumnNames: ['id'], referencedTableName: 'group' },
|
|
40
|
+
],
|
|
41
|
+
indices: [
|
|
42
|
+
new typeorm_1.TableIndex({
|
|
43
|
+
name: 'IDX_ACCOUNT_GROUP',
|
|
44
|
+
columnNames: ['id', 'accountId', 'groupId'],
|
|
45
|
+
}),
|
|
46
|
+
],
|
|
47
|
+
}));
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
down(queryRunner) {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
const hasTable = yield utils_1.default.checkHasTable('account_group', queryRunner);
|
|
53
|
+
if (!hasTable)
|
|
54
|
+
return;
|
|
55
|
+
yield utils_1.default.dropTableForeignKeys('account_group', ['accountId', 'groupId'], queryRunner);
|
|
56
|
+
yield utils_1.default.dropIndex('account_group', 'IDX_ACCOUNT_GROUP', queryRunner);
|
|
57
|
+
yield queryRunner.dropTable('account_group');
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.CreateAccountGroupTable1748449000100 = CreateAccountGroupTable1748449000100;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.CreateGroupModuleTable1748449000200 = void 0;
|
|
16
|
+
const typeorm_1 = require("typeorm");
|
|
17
|
+
const utils_1 = __importDefault(require("../utils"));
|
|
18
|
+
class CreateGroupModuleTable1748449000200 {
|
|
19
|
+
up(queryRunner) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
const hasTable = yield utils_1.default.checkHasTable('group_module', queryRunner);
|
|
22
|
+
if (hasTable)
|
|
23
|
+
return;
|
|
24
|
+
yield queryRunner.createTable(new typeorm_1.Table({
|
|
25
|
+
name: 'group_module',
|
|
26
|
+
columns: [
|
|
27
|
+
{ name: 'id', type: 'uuid', isPrimary: true, generationStrategy: 'uuid', default: 'uuid_generate_v4()' },
|
|
28
|
+
{ name: 'groupId', type: 'uuid', isNullable: false },
|
|
29
|
+
{ name: 'canView', type: 'boolean', isNullable: true },
|
|
30
|
+
{ name: 'canEdit', type: 'boolean', isNullable: true },
|
|
31
|
+
{ name: 'canDelete', type: 'boolean', isNullable: true },
|
|
32
|
+
{ name: 'createdBy', type: 'varchar', isNullable: true },
|
|
33
|
+
{ name: 'createdAt', type: 'timestamptz', default: 'now()' },
|
|
34
|
+
{ name: 'updatedBy', type: 'varchar', isNullable: true },
|
|
35
|
+
{ name: 'updatedAt', type: 'timestamptz', default: 'now()' },
|
|
36
|
+
{ name: 'deletedBy', type: 'varchar', isNullable: true },
|
|
37
|
+
{ name: 'deletedAt', type: 'timestamptz', isNullable: true },
|
|
38
|
+
],
|
|
39
|
+
foreignKeys: [
|
|
40
|
+
{ columnNames: ['groupId'], referencedColumnNames: ['id'], referencedTableName: 'group' },
|
|
41
|
+
],
|
|
42
|
+
indices: [
|
|
43
|
+
new typeorm_1.TableIndex({
|
|
44
|
+
name: 'IDX_GROUP_MODULE',
|
|
45
|
+
columnNames: ['id', 'groupId'],
|
|
46
|
+
}),
|
|
47
|
+
],
|
|
48
|
+
}));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
down(queryRunner) {
|
|
52
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
const hasTable = yield utils_1.default.checkHasTable('group_module', queryRunner);
|
|
54
|
+
if (!hasTable)
|
|
55
|
+
return;
|
|
56
|
+
yield utils_1.default.dropTableForeignKeys('group_module', ['groupId'], queryRunner);
|
|
57
|
+
yield utils_1.default.dropIndex('group_module', 'IDX_GROUP_MODULE', queryRunner);
|
|
58
|
+
yield queryRunner.dropTable('group_module');
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.CreateGroupModuleTable1748449000200 = CreateGroupModuleTable1748449000200;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.CreateAccountModuleTable1748449000300 = void 0;
|
|
16
|
+
const typeorm_1 = require("typeorm");
|
|
17
|
+
const utils_1 = __importDefault(require("../utils"));
|
|
18
|
+
class CreateAccountModuleTable1748449000300 {
|
|
19
|
+
up(queryRunner) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
const hasTable = yield utils_1.default.checkHasTable('account_module', queryRunner);
|
|
22
|
+
if (hasTable)
|
|
23
|
+
return;
|
|
24
|
+
yield queryRunner.createTable(new typeorm_1.Table({
|
|
25
|
+
name: 'account_module',
|
|
26
|
+
columns: [
|
|
27
|
+
{ name: 'id', type: 'uuid', isPrimary: true, generationStrategy: 'uuid', default: 'uuid_generate_v4()' },
|
|
28
|
+
{ name: 'accountId', type: 'uuid', isNullable: false },
|
|
29
|
+
{ name: 'canView', type: 'boolean', isNullable: true },
|
|
30
|
+
{ name: 'canEdit', type: 'boolean', isNullable: true },
|
|
31
|
+
{ name: 'canDelete', type: 'boolean', isNullable: true },
|
|
32
|
+
{ name: 'createdBy', type: 'varchar', isNullable: true },
|
|
33
|
+
{ name: 'createdAt', type: 'timestamptz', default: 'now()' },
|
|
34
|
+
{ name: 'updatedBy', type: 'varchar', isNullable: true },
|
|
35
|
+
{ name: 'updatedAt', type: 'timestamptz', default: 'now()' },
|
|
36
|
+
{ name: 'deletedBy', type: 'varchar', isNullable: true },
|
|
37
|
+
{ name: 'deletedAt', type: 'timestamptz', isNullable: true },
|
|
38
|
+
],
|
|
39
|
+
foreignKeys: [
|
|
40
|
+
{ columnNames: ['accountId'], referencedColumnNames: ['id'], referencedTableName: 'account' },
|
|
41
|
+
],
|
|
42
|
+
indices: [
|
|
43
|
+
new typeorm_1.TableIndex({
|
|
44
|
+
name: 'IDX_ACCOUNT_MODULE',
|
|
45
|
+
columnNames: ['id', 'accountId'],
|
|
46
|
+
}),
|
|
47
|
+
],
|
|
48
|
+
}));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
down(queryRunner) {
|
|
52
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
const hasTable = yield utils_1.default.checkHasTable('account_module', queryRunner);
|
|
54
|
+
if (!hasTable)
|
|
55
|
+
return;
|
|
56
|
+
yield utils_1.default.dropTableForeignKeys('account_module', ['accountId'], queryRunner);
|
|
57
|
+
yield utils_1.default.dropIndex('account_module', 'IDX_ACCOUNT_MODULE', queryRunner);
|
|
58
|
+
yield queryRunner.dropTable('account_module');
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.CreateAccountModuleTable1748449000300 = CreateAccountModuleTable1748449000300;
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export * from './1748448589934-CreateAccountsTable';
|
|
4
|
-
export * from './1748448590133-CreateLeadsTable';
|
|
5
|
-
export * from './1748448590361-CreateLeadResponsiblesTable';
|
|
1
|
+
import { Init1748448461165 } from './1748448461165-Init';
|
|
2
|
+
export declare const Migrations: (typeof Init1748448461165)[];
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
3
|
+
exports.Migrations = void 0;
|
|
4
|
+
const _1748448461165_Init_1 = require("./1748448461165-Init");
|
|
5
|
+
const _1748448589743_CreateProfilesTable_1 = require("./1748448589743-CreateProfilesTable");
|
|
6
|
+
const _1748448589934_CreateAccountsTable_1 = require("./1748448589934-CreateAccountsTable");
|
|
7
|
+
const _1748448590133_CreateLeadsTable_1 = require("./1748448590133-CreateLeadsTable");
|
|
8
|
+
const _1748448590361_CreateLeadResponsiblesTable_1 = require("./1748448590361-CreateLeadResponsiblesTable");
|
|
9
|
+
const _1749142281608_CreateGroupTable_1 = require("./1749142281608-CreateGroupTable");
|
|
10
|
+
const _1749142314101_CreateAccountGroupTable_1 = require("./1749142314101-CreateAccountGroupTable");
|
|
11
|
+
const _1749142329095_CreateGroupModuleTable_1 = require("./1749142329095-CreateGroupModuleTable");
|
|
12
|
+
const _1749142343254_CreateAccountModuleTable_1 = require("./1749142343254-CreateAccountModuleTable");
|
|
13
|
+
exports.Migrations = [
|
|
14
|
+
_1748448461165_Init_1.Init1748448461165,
|
|
15
|
+
_1748448589743_CreateProfilesTable_1.CreateProfilesTable1748448589743,
|
|
16
|
+
_1748448589934_CreateAccountsTable_1.CreateAccountsTable1748448589934,
|
|
17
|
+
_1748448590133_CreateLeadsTable_1.CreateLeadsTable1748448590133,
|
|
18
|
+
_1748448590361_CreateLeadResponsiblesTable_1.CreateLeadResponsiblesTable1748448590361,
|
|
19
|
+
_1749142281608_CreateGroupTable_1.CreateGroupTable1748449000000,
|
|
20
|
+
_1749142314101_CreateAccountGroupTable_1.CreateAccountGroupTable1748449000100,
|
|
21
|
+
_1749142329095_CreateGroupModuleTable_1.CreateGroupModuleTable1748449000200,
|
|
22
|
+
_1749142343254_CreateAccountModuleTable_1.CreateAccountModuleTable1748449000300,
|
|
23
|
+
];
|