@itleanchatbot/shared-models-js-postgres 2.8.28 → 2.8.30

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.
@@ -1,98 +1,98 @@
1
-
2
-
3
- module.exports = {
4
- up: async (queryInterface) => {
5
- const departmentPermissionId = await queryInterface.rawSelect(
6
- 'Permissions',
7
- { where: { permissionCode: 'crud_departments' } },
8
- ['id']
9
- )
10
-
11
- const subDepartmentPermissionId = await queryInterface.rawSelect(
12
- 'Permissions',
13
- { where: { permissionCode: 'crud_subDepartments' } },
14
- ['id']
15
- )
16
-
17
- const linePermissionId = await queryInterface.rawSelect(
18
- 'Permissions',
19
- { where: { permissionCode: 'crud_lines' } },
20
- ['id']
21
- )
22
-
23
- const branchPermissionId = await queryInterface.rawSelect(
24
- 'Permissions',
25
- { where: { permissionCode: 'crud_branches' } },
26
- ['id']
27
- )
28
-
29
- const adminProfileId = await queryInterface.rawSelect(
30
- 'Profiles',
31
- { where: { name: 'Administrador' } },
32
- ['id']
33
- )
34
-
35
-
36
- return queryInterface.bulkInsert('Profiles_Permissions', [
37
- {
38
- ProfileId: adminProfileId,
39
- PermissionId: departmentPermissionId,
40
- createdAt: new Date(),
41
- updatedAt: new Date(),
42
- },
43
- {
44
- ProfileId: adminProfileId,
45
- PermissionId: subDepartmentPermissionId,
46
- createdAt: new Date(),
47
- updatedAt: new Date(),
48
- },
49
- {
50
- ProfileId: adminProfileId,
51
- PermissionId: linePermissionId,
52
- createdAt: new Date(),
53
- updatedAt: new Date(),
54
- },
55
- {
56
- ProfileId: adminProfileId,
57
- PermissionId: branchPermissionId,
58
- createdAt: new Date(),
59
- updatedAt: new Date(),
60
- },
61
- ])
62
- },
63
- down: async (queryInterface) => {
64
- const departmentPermissionId = await queryInterface.rawSelect(
65
- 'Permissions',
66
- { where: { permissionCode: 'crud_departments' } },
67
- ['id']
68
- )
69
-
70
- const subDepartmentPermissionId = await queryInterface.rawSelect(
71
- 'Permissions',
72
- { where: { permissionCode: 'crud_subDepartments' } },
73
- ['id']
74
- )
75
-
76
- const linePermissionId = await queryInterface.rawSelect(
77
- 'Permissions',
78
- { where: { permissionCode: 'crud_lines' } },
79
- ['id']
80
- )
81
-
82
- const branchPermissionId = await queryInterface.rawSelect(
83
- 'Permissions',
84
- { where: { permissionCode: 'crud_branches' } },
85
- ['id']
86
- )
87
-
88
- const adminProfileId = await queryInterface.rawSelect(
89
- 'Profiles',
90
- { where: { name: 'Administrador' } },
91
- ['id']
92
- )
93
- await queryInterface.bulkDelete('Profiles_Permissions', { ProfileId: adminProfileId, PermissionId: departmentPermissionId }, {})
94
- await queryInterface.bulkDelete('Profiles_Permissions', { ProfileId: adminProfileId, PermissionId: subDepartmentPermissionId }, {})
95
- await queryInterface.bulkDelete('Profiles_Permissions', { ProfileId: adminProfileId, PermissionId: linePermissionId }, {})
96
- await queryInterface.bulkDelete('Profiles_Permissions', { ProfileId: adminProfileId, PermissionId: branchPermissionId }, {})
97
- },
98
- }
1
+
2
+
3
+ module.exports = {
4
+ up: async (queryInterface) => {
5
+ const departmentPermissionId = await queryInterface.rawSelect(
6
+ 'Permissions',
7
+ { where: { permissionCode: 'crud_departments' } },
8
+ ['id']
9
+ )
10
+
11
+ const subDepartmentPermissionId = await queryInterface.rawSelect(
12
+ 'Permissions',
13
+ { where: { permissionCode: 'crud_subDepartments' } },
14
+ ['id']
15
+ )
16
+
17
+ const linePermissionId = await queryInterface.rawSelect(
18
+ 'Permissions',
19
+ { where: { permissionCode: 'crud_lines' } },
20
+ ['id']
21
+ )
22
+
23
+ const branchPermissionId = await queryInterface.rawSelect(
24
+ 'Permissions',
25
+ { where: { permissionCode: 'crud_branches' } },
26
+ ['id']
27
+ )
28
+
29
+ const adminProfileId = await queryInterface.rawSelect(
30
+ 'Profiles',
31
+ { where: { name: 'Administrador' } },
32
+ ['id']
33
+ )
34
+
35
+
36
+ return queryInterface.bulkInsert('Profiles_Permissions', [
37
+ {
38
+ ProfileId: adminProfileId,
39
+ PermissionId: departmentPermissionId,
40
+ createdAt: new Date(),
41
+ updatedAt: new Date(),
42
+ },
43
+ {
44
+ ProfileId: adminProfileId,
45
+ PermissionId: subDepartmentPermissionId,
46
+ createdAt: new Date(),
47
+ updatedAt: new Date(),
48
+ },
49
+ {
50
+ ProfileId: adminProfileId,
51
+ PermissionId: linePermissionId,
52
+ createdAt: new Date(),
53
+ updatedAt: new Date(),
54
+ },
55
+ {
56
+ ProfileId: adminProfileId,
57
+ PermissionId: branchPermissionId,
58
+ createdAt: new Date(),
59
+ updatedAt: new Date(),
60
+ },
61
+ ])
62
+ },
63
+ down: async (queryInterface) => {
64
+ const departmentPermissionId = await queryInterface.rawSelect(
65
+ 'Permissions',
66
+ { where: { permissionCode: 'crud_departments' } },
67
+ ['id']
68
+ )
69
+
70
+ const subDepartmentPermissionId = await queryInterface.rawSelect(
71
+ 'Permissions',
72
+ { where: { permissionCode: 'crud_subDepartments' } },
73
+ ['id']
74
+ )
75
+
76
+ const linePermissionId = await queryInterface.rawSelect(
77
+ 'Permissions',
78
+ { where: { permissionCode: 'crud_lines' } },
79
+ ['id']
80
+ )
81
+
82
+ const branchPermissionId = await queryInterface.rawSelect(
83
+ 'Permissions',
84
+ { where: { permissionCode: 'crud_branches' } },
85
+ ['id']
86
+ )
87
+
88
+ const adminProfileId = await queryInterface.rawSelect(
89
+ 'Profiles',
90
+ { where: { name: 'Administrador' } },
91
+ ['id']
92
+ )
93
+ await queryInterface.bulkDelete('Profiles_Permissions', { ProfileId: adminProfileId, PermissionId: departmentPermissionId }, {})
94
+ await queryInterface.bulkDelete('Profiles_Permissions', { ProfileId: adminProfileId, PermissionId: subDepartmentPermissionId }, {})
95
+ await queryInterface.bulkDelete('Profiles_Permissions', { ProfileId: adminProfileId, PermissionId: linePermissionId }, {})
96
+ await queryInterface.bulkDelete('Profiles_Permissions', { ProfileId: adminProfileId, PermissionId: branchPermissionId }, {})
97
+ },
98
+ }
@@ -1,41 +1,41 @@
1
- 'use strict'
2
-
3
- module.exports = {
4
- up: async (queryInterface, Sequelize) => {
5
- const ibmIntelligenceId = await queryInterface.rawSelect(
6
- 'Intelligences',
7
- {
8
- where: {
9
- providerType: 'ibm',
10
- },
11
- },
12
- ['id']
13
- )
14
-
15
- const ibmProviderId = '473da11f-79c5-49a9-bce6-2f7d8ec76daf'
16
-
17
- if (ibmIntelligenceId) {
18
- await queryInterface.bulkInsert('Skills', [
19
- {
20
- id: '148d1182-9f28-4b30-8fc3-70b650672f73',
21
- IntelligenceId: ibmIntelligenceId,
22
- AwsProviderId: null,
23
- ItleanProviderId: null,
24
- IbmProviderId: ibmProviderId,
25
- name: 'Skill Seed',
26
- description: 'skill created by seeders',
27
- lang: 'pt-br',
28
- externalIbmId: '1c6e2489-6675-4c08-aa89-fdac4bc50de3',
29
- createdAt: Sequelize.literal('now()'),
30
- updatedAt: Sequelize.literal('now()'),
31
- },
32
- ])
33
- }
34
- },
35
-
36
- down: async (queryInterface) => {
37
- await queryInterface.bulkDelete('Skills', null, {
38
- id: '148d1182-9f28-4b30-8fc3-70b650672f73',
39
- })
40
- },
41
- }
1
+ 'use strict'
2
+
3
+ module.exports = {
4
+ up: async (queryInterface, Sequelize) => {
5
+ const ibmIntelligenceId = await queryInterface.rawSelect(
6
+ 'Intelligences',
7
+ {
8
+ where: {
9
+ providerType: 'ibm',
10
+ },
11
+ },
12
+ ['id']
13
+ )
14
+
15
+ const ibmProviderId = '473da11f-79c5-49a9-bce6-2f7d8ec76daf'
16
+
17
+ if (ibmIntelligenceId) {
18
+ await queryInterface.bulkInsert('Skills', [
19
+ {
20
+ id: '148d1182-9f28-4b30-8fc3-70b650672f73',
21
+ IntelligenceId: ibmIntelligenceId,
22
+ AwsProviderId: null,
23
+ ItleanProviderId: null,
24
+ IbmProviderId: ibmProviderId,
25
+ name: 'Skill Seed',
26
+ description: 'skill created by seeders',
27
+ lang: 'pt-br',
28
+ externalIbmId: '1c6e2489-6675-4c08-aa89-fdac4bc50de3',
29
+ createdAt: Sequelize.literal('now()'),
30
+ updatedAt: Sequelize.literal('now()'),
31
+ },
32
+ ])
33
+ }
34
+ },
35
+
36
+ down: async (queryInterface) => {
37
+ await queryInterface.bulkDelete('Skills', null, {
38
+ id: '148d1182-9f28-4b30-8fc3-70b650672f73',
39
+ })
40
+ },
41
+ }
@@ -1,43 +1,43 @@
1
- 'use strict'
2
-
3
- const skillId = '148d1182-9f28-4b30-8fc3-70b650672f73'
4
- const dialogNodeId = '9f023259-fd70-4724-9ab2-e11ce5555d77'
5
- const apiResourceId = '7756e862-61bc-41ee-b8ce-0b8a646c7de0'
6
- module.exports = {
7
- up: async (queryInterface, Sequelize) => {
8
- await queryInterface.bulkInsert('DialogNodes', [
9
- {
10
- id: dialogNodeId,
11
- contexts: '[]',
12
- name: 'Seeder Dialog Node',
13
- condition: 'test || test',
14
- step: '1',
15
- replayWait: true,
16
- type: 'node',
17
- isMultipleResponse: false,
18
- SkillId: skillId,
19
- JumpToDialogNodeId: null,
20
- JumpToSkillId: null,
21
- DialogNodeFolderId: null,
22
- createdAt: Sequelize.literal('now()'),
23
- updatedAt: Sequelize.literal('now()'),
24
- },
25
- ])
26
-
27
- await queryInterface.bulkInsert('DialogNodes_ApiResources', [
28
- {
29
- id: '395b05f4-e91f-445a-8be1-2ab199ea4824',
30
- DialogNodeId: dialogNodeId,
31
- ApiResourceId: apiResourceId,
32
- response: 'apiTest',
33
- createdAt: Sequelize.literal('now()'),
34
- updatedAt: Sequelize.literal('now()'),
35
- },
36
- ])
37
- },
38
-
39
- down: async (queryInterface) => {
40
- await queryInterface.bulkDelete('DialogNodes_ApiResources', null, {})
41
- await queryInterface.bulkDelete('DialogNodes', null, {})
42
- },
43
- }
1
+ 'use strict'
2
+
3
+ const skillId = '148d1182-9f28-4b30-8fc3-70b650672f73'
4
+ const dialogNodeId = '9f023259-fd70-4724-9ab2-e11ce5555d77'
5
+ const apiResourceId = '7756e862-61bc-41ee-b8ce-0b8a646c7de0'
6
+ module.exports = {
7
+ up: async (queryInterface, Sequelize) => {
8
+ await queryInterface.bulkInsert('DialogNodes', [
9
+ {
10
+ id: dialogNodeId,
11
+ contexts: '[]',
12
+ name: 'Seeder Dialog Node',
13
+ condition: 'test || test',
14
+ step: '1',
15
+ replayWait: true,
16
+ type: 'node',
17
+ isMultipleResponse: false,
18
+ SkillId: skillId,
19
+ JumpToDialogNodeId: null,
20
+ JumpToSkillId: null,
21
+ DialogNodeFolderId: null,
22
+ createdAt: Sequelize.literal('now()'),
23
+ updatedAt: Sequelize.literal('now()'),
24
+ },
25
+ ])
26
+
27
+ await queryInterface.bulkInsert('DialogNodes_ApiResources', [
28
+ {
29
+ id: '395b05f4-e91f-445a-8be1-2ab199ea4824',
30
+ DialogNodeId: dialogNodeId,
31
+ ApiResourceId: apiResourceId,
32
+ response: 'apiTest',
33
+ createdAt: Sequelize.literal('now()'),
34
+ updatedAt: Sequelize.literal('now()'),
35
+ },
36
+ ])
37
+ },
38
+
39
+ down: async (queryInterface) => {
40
+ await queryInterface.bulkDelete('DialogNodes_ApiResources', null, {})
41
+ await queryInterface.bulkDelete('DialogNodes', null, {})
42
+ },
43
+ }