@itleanchatbot/shared-models-js-postgres 2.8.21 → 2.8.23

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itleanchatbot/shared-models-js-postgres",
3
- "version": "2.8.21",
3
+ "version": "2.8.23",
4
4
  "description": "Shared Models JS Postgres",
5
5
  "main": "index.js",
6
6
  "license": "ISC",
@@ -1,66 +1,66 @@
1
- 'use strict';
2
-
3
- module.exports = {
4
- up: async (queryInterface, Sequelize) => {
5
- await queryInterface.createTable('ApiPreRequests', {
6
- id: {
7
- allowNull: false,
8
- defaultValue: Sequelize.literal('uuid_generate_v4()'),
9
- primaryKey: true,
10
- type: Sequelize.UUID,
11
- },
12
- ApiId: {
13
- allowNull: true,
14
- defaultValue: null,
15
- type: Sequelize.UUID,
16
- references: {
17
- model: 'Apis',
18
- key: 'id',
19
- },
20
- onDelete: 'SET NULL',
21
- onUpdate: 'CASCADE',
22
- },
23
- ApiResourceId: {
24
- allowNull: true,
25
- defaultValue: null,
26
- type: Sequelize.UUID,
27
- references: {
28
- model: 'ApiResources',
29
- key: 'id',
30
- },
31
- onDelete: 'SET NULL',
32
- onUpdate: 'CASCADE',
33
- },
34
- PreApiResourceId: {
35
- allowNull: false,
36
- type: Sequelize.UUID,
37
- references: {
38
- model: 'ApiResources',
39
- key: 'id',
40
- },
41
- onDelete: 'SET NULL',
42
- onUpdate: 'CASCADE',
43
- },
44
- result: {
45
- allowNull: false,
46
- type: Sequelize.STRING,
47
- },
48
- delayForNewRequest: {
49
- allowNull: false,
50
- type: Sequelize.STRING,
51
- },
52
- createdAt: {
53
- allowNull: false,
54
- type: Sequelize.DATE,
55
- },
56
- updatedAt: {
57
- allowNull: false,
58
- type: Sequelize.DATE,
59
- },
60
- })
61
- },
62
-
63
- down: async (queryInterface) => {
64
- await queryInterface.dropTable('ApiPreRequests')
65
- }
66
- };
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ up: async (queryInterface, Sequelize) => {
5
+ await queryInterface.createTable('ApiPreRequests', {
6
+ id: {
7
+ allowNull: false,
8
+ defaultValue: Sequelize.literal('uuid_generate_v4()'),
9
+ primaryKey: true,
10
+ type: Sequelize.UUID,
11
+ },
12
+ ApiId: {
13
+ allowNull: true,
14
+ defaultValue: null,
15
+ type: Sequelize.UUID,
16
+ references: {
17
+ model: 'Apis',
18
+ key: 'id',
19
+ },
20
+ onDelete: 'SET NULL',
21
+ onUpdate: 'CASCADE',
22
+ },
23
+ ApiResourceId: {
24
+ allowNull: true,
25
+ defaultValue: null,
26
+ type: Sequelize.UUID,
27
+ references: {
28
+ model: 'ApiResources',
29
+ key: 'id',
30
+ },
31
+ onDelete: 'SET NULL',
32
+ onUpdate: 'CASCADE',
33
+ },
34
+ PreApiResourceId: {
35
+ allowNull: false,
36
+ type: Sequelize.UUID,
37
+ references: {
38
+ model: 'ApiResources',
39
+ key: 'id',
40
+ },
41
+ onDelete: 'SET NULL',
42
+ onUpdate: 'CASCADE',
43
+ },
44
+ result: {
45
+ allowNull: false,
46
+ type: Sequelize.STRING,
47
+ },
48
+ delayForNewRequest: {
49
+ allowNull: false,
50
+ type: Sequelize.STRING,
51
+ },
52
+ createdAt: {
53
+ allowNull: false,
54
+ type: Sequelize.DATE,
55
+ },
56
+ updatedAt: {
57
+ allowNull: false,
58
+ type: Sequelize.DATE,
59
+ },
60
+ })
61
+ },
62
+
63
+ down: async (queryInterface) => {
64
+ await queryInterface.dropTable('ApiPreRequests')
65
+ }
66
+ };
@@ -1,20 +1,20 @@
1
- 'use strict';
2
-
3
- module.exports = {
4
- up: async (queryInterface, Sequelize) => {
5
- await queryInterface.addColumn('SystemUsers', 'isActive', {
6
- type: Sequelize.BOOLEAN,
7
- defaultValue: true,
8
- allowNull: false
9
- })
10
- await queryInterface.addColumn('SystemUsers', 'disabledAt', {
11
- type: Sequelize.DATE,
12
- allowNull: true
13
- })
14
- },
15
-
16
- down: async (queryInterface) => {
17
- await queryInterface.removeColumn('SystemUsers', 'isActive')
18
- await queryInterface.removeColumn('SystemUsers', 'disabledAt')
19
- }
20
- };
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ up: async (queryInterface, Sequelize) => {
5
+ await queryInterface.addColumn('SystemUsers', 'isActive', {
6
+ type: Sequelize.BOOLEAN,
7
+ defaultValue: true,
8
+ allowNull: false
9
+ })
10
+ await queryInterface.addColumn('SystemUsers', 'disabledAt', {
11
+ type: Sequelize.DATE,
12
+ allowNull: true
13
+ })
14
+ },
15
+
16
+ down: async (queryInterface) => {
17
+ await queryInterface.removeColumn('SystemUsers', 'isActive')
18
+ await queryInterface.removeColumn('SystemUsers', 'disabledAt')
19
+ }
20
+ };
@@ -1,28 +1,28 @@
1
- 'use strict';
2
-
3
- const datesColumns = [
4
- 'processedAt', 'enqueuedAt', 'failedAt', 'readAt', 'sentAt', 'deliveredAt'
5
- ]
6
- module.exports = {
7
- async up (queryInterface, Sequelize) {
8
-
9
- await queryInterface.addColumn('BotIterables', 'brokerMessageStatus', {
10
- type: Sequelize.STRING(100),
11
- allowNull: true
12
- })
13
-
14
- for (const columnName of datesColumns) {
15
- await queryInterface.addColumn('BotIterables', columnName, {
16
- type: Sequelize.DATE,
17
- allowNull: true
18
- })
19
- }
20
- },
21
-
22
- async down (queryInterface) {
23
- await queryInterface.removeColumn('BotIterables', 'brokerStatus')
24
- for(const columnName of datesColumns) {
25
- await queryInterface.removeColumn('BotIterables', columnName)
26
- }
27
- }
28
- };
1
+ 'use strict';
2
+
3
+ const datesColumns = [
4
+ 'processedAt', 'enqueuedAt', 'failedAt', 'readAt', 'sentAt', 'deliveredAt'
5
+ ]
6
+ module.exports = {
7
+ async up (queryInterface, Sequelize) {
8
+
9
+ await queryInterface.addColumn('BotIterables', 'brokerMessageStatus', {
10
+ type: Sequelize.STRING(100),
11
+ allowNull: true
12
+ })
13
+
14
+ for (const columnName of datesColumns) {
15
+ await queryInterface.addColumn('BotIterables', columnName, {
16
+ type: Sequelize.DATE,
17
+ allowNull: true
18
+ })
19
+ }
20
+ },
21
+
22
+ async down (queryInterface) {
23
+ await queryInterface.removeColumn('BotIterables', 'brokerStatus')
24
+ for(const columnName of datesColumns) {
25
+ await queryInterface.removeColumn('BotIterables', columnName)
26
+ }
27
+ }
28
+ };
@@ -1,14 +1,14 @@
1
- 'use strict';
2
-
3
- module.exports = {
4
- async up (queryInterface, Sequelize) {
5
- await queryInterface.addColumn('Sessions', 'startedSessionAt', {
6
- type: Sequelize.DATE,
7
- allowNull: true
8
- })
9
- },
10
-
11
- async down (queryInterface) {
12
- await queryInterface.removeColumn('Sessions', 'startedSessionAt')
13
- }
14
- };
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ async up (queryInterface, Sequelize) {
5
+ await queryInterface.addColumn('Sessions', 'startedSessionAt', {
6
+ type: Sequelize.DATE,
7
+ allowNull: true
8
+ })
9
+ },
10
+
11
+ async down (queryInterface) {
12
+ await queryInterface.removeColumn('Sessions', 'startedSessionAt')
13
+ }
14
+ };
@@ -1,15 +1,15 @@
1
- 'use strict';
2
-
3
- module.exports = {
4
- up: async (queryInterface, Sequelize) => {
5
- await queryInterface.addColumn('ConversationSessions', 'isHsm', {
6
- allowNull: false,
7
- defaultValue: false,
8
- type: Sequelize.BOOLEAN,
9
- })
10
- },
11
-
12
- down: async (queryInterface) => {
13
- await queryInterface.removeColumn('ConversationSessions', 'isHsm')
14
- }
15
- };
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ up: async (queryInterface, Sequelize) => {
5
+ await queryInterface.addColumn('ConversationSessions', 'isHsm', {
6
+ allowNull: false,
7
+ defaultValue: false,
8
+ type: Sequelize.BOOLEAN,
9
+ })
10
+ },
11
+
12
+ down: async (queryInterface) => {
13
+ await queryInterface.removeColumn('ConversationSessions', 'isHsm')
14
+ }
15
+ };
@@ -1,34 +1,34 @@
1
- 'use strict';
2
-
3
- const { DIALOG_NODE_TYPES } = require('./../models/dialogNodes')
4
- const { replaceEnum } = require('./../presenters/database/migrationHelpers')
5
-
6
- module.exports = {
7
- async up (queryInterface) {
8
- await replaceEnum(
9
- queryInterface,
10
- 'DialogNodes',
11
- 'type',
12
- DIALOG_NODE_TYPES.CALLBACK,
13
- DIALOG_NODE_TYPES.NODE,
14
- DIALOG_NODE_TYPES.FOLDER,
15
- DIALOG_NODE_TYPES.TRANSHIP,
16
- DIALOG_NODE_TYPES.FAQ,
17
- DIALOG_NODE_TYPES.END_SESSION
18
-
19
- )
20
- },
21
-
22
- async down (queryInterface) {
23
- await replaceEnum(
24
- queryInterface,
25
- 'DialogNodes',
26
- 'type',
27
- DIALOG_NODE_TYPES.NODE,
28
- DIALOG_NODE_TYPES.FOLDER,
29
- DIALOG_NODE_TYPES.TRANSHIP,
30
- DIALOG_NODE_TYPES.FAQ,
31
- DIALOG_NODE_TYPES.END_SESSION,
32
- )
33
- }
34
- };
1
+ 'use strict';
2
+
3
+ const { DIALOG_NODE_TYPES } = require('./../models/dialogNodes')
4
+ const { replaceEnum } = require('./../presenters/database/migrationHelpers')
5
+
6
+ module.exports = {
7
+ async up (queryInterface) {
8
+ await replaceEnum(
9
+ queryInterface,
10
+ 'DialogNodes',
11
+ 'type',
12
+ DIALOG_NODE_TYPES.CALLBACK,
13
+ DIALOG_NODE_TYPES.NODE,
14
+ DIALOG_NODE_TYPES.FOLDER,
15
+ DIALOG_NODE_TYPES.TRANSHIP,
16
+ DIALOG_NODE_TYPES.FAQ,
17
+ DIALOG_NODE_TYPES.END_SESSION
18
+
19
+ )
20
+ },
21
+
22
+ async down (queryInterface) {
23
+ await replaceEnum(
24
+ queryInterface,
25
+ 'DialogNodes',
26
+ 'type',
27
+ DIALOG_NODE_TYPES.NODE,
28
+ DIALOG_NODE_TYPES.FOLDER,
29
+ DIALOG_NODE_TYPES.TRANSHIP,
30
+ DIALOG_NODE_TYPES.FAQ,
31
+ DIALOG_NODE_TYPES.END_SESSION,
32
+ )
33
+ }
34
+ };
@@ -0,0 +1,24 @@
1
+ 'use strict';
2
+ const { replaceEnum } = require('./../presenters/database/migrationHelpers')
3
+ module.exports = {
4
+ async up (queryInterface) {
5
+ await replaceEnum(
6
+ queryInterface,
7
+ 'BotIterables',
8
+ 'action',
9
+ 'bot',
10
+ 'client',
11
+ 'callback',
12
+ )
13
+ },
14
+
15
+ async down (queryInterface) {
16
+ await replaceEnum(
17
+ queryInterface,
18
+ 'BotIterables',
19
+ 'action',
20
+ 'bot',
21
+ 'client'
22
+ )
23
+ }
24
+ };
@@ -10,7 +10,7 @@ exports.model = (sequelize, DataType) => {
10
10
  },
11
11
  action:{
12
12
  type: DataType.ENUM({
13
- values: ['bot', 'client'],
13
+ values: ['bot', 'client', 'callback'],
14
14
  }),
15
15
  allowNull: false,
16
16
  },
@@ -1,31 +1,31 @@
1
- exports.model = (sequelize, Sequelize) => {
2
- const OpenFAQs = sequelize.define('FaqQuestions', {
3
- name: {
4
- type: Sequelize.STRING(255),
5
- allowNull: false,
6
- validate: {
7
- notEmpty: true,
8
- },
9
- },
10
- OpenFAQId: {
11
- type: Sequelize.UUID,
12
- allowNull: false,
13
- references: {
14
- model: 'OpenFAQs',
15
- key: 'id',
16
- },
17
- onDelete: 'CASCADE',
18
- onUpdate: 'CASCADE',
19
- foreignKeyConstraint: true,
20
- validate: {
21
- notEmpty: true,
22
- },
23
- },
24
- })
25
-
26
- OpenFAQs.associate = (models) => {
27
- OpenFAQs.belongsTo(models.OpenFAQs)
28
- }
29
-
30
- return OpenFAQs
31
- }
1
+ exports.model = (sequelize, Sequelize) => {
2
+ const OpenFAQs = sequelize.define('FaqQuestions', {
3
+ name: {
4
+ type: Sequelize.STRING(255),
5
+ allowNull: false,
6
+ validate: {
7
+ notEmpty: true,
8
+ },
9
+ },
10
+ OpenFAQId: {
11
+ type: Sequelize.UUID,
12
+ allowNull: false,
13
+ references: {
14
+ model: 'OpenFAQs',
15
+ key: 'id',
16
+ },
17
+ onDelete: 'CASCADE',
18
+ onUpdate: 'CASCADE',
19
+ foreignKeyConstraint: true,
20
+ validate: {
21
+ notEmpty: true,
22
+ },
23
+ },
24
+ })
25
+
26
+ OpenFAQs.associate = (models) => {
27
+ OpenFAQs.belongsTo(models.OpenFAQs)
28
+ }
29
+
30
+ return OpenFAQs
31
+ }
@@ -1,33 +1,33 @@
1
- exports.model = (sequelize, Sequelize) => {
2
- const OpenFAQs = sequelize.define('OpenFAQs', {
3
- name: {
4
- allowNull: false,
5
- type: Sequelize.TEXT,
6
- unique: false,
7
- },
8
- SkillId: {
9
- allowNull: false,
10
- type: Sequelize.UUID,
11
- references: {
12
- model: 'Skill',
13
- key: 'id',
14
- },
15
- onDelete: 'RESTRICT',
16
- onUpdate: 'CASCADE',
17
- },
18
- answers: {
19
- allowNull: false,
20
- type: Sequelize.JSON,
21
- validate: {
22
- notEmpty: true,
23
- },
24
- },
25
- })
26
-
27
- OpenFAQs.associate = (models) => {
28
- OpenFAQs.belongsTo(models.Skill)
29
- OpenFAQs.hasMany(models.FaqQuestions)
30
- }
31
-
32
- return OpenFAQs
33
- }
1
+ exports.model = (sequelize, Sequelize) => {
2
+ const OpenFAQs = sequelize.define('OpenFAQs', {
3
+ name: {
4
+ allowNull: false,
5
+ type: Sequelize.TEXT,
6
+ unique: false,
7
+ },
8
+ SkillId: {
9
+ allowNull: false,
10
+ type: Sequelize.UUID,
11
+ references: {
12
+ model: 'Skill',
13
+ key: 'id',
14
+ },
15
+ onDelete: 'RESTRICT',
16
+ onUpdate: 'CASCADE',
17
+ },
18
+ answers: {
19
+ allowNull: false,
20
+ type: Sequelize.JSON,
21
+ validate: {
22
+ notEmpty: true,
23
+ },
24
+ },
25
+ })
26
+
27
+ OpenFAQs.associate = (models) => {
28
+ OpenFAQs.belongsTo(models.Skill)
29
+ OpenFAQs.hasMany(models.FaqQuestions)
30
+ }
31
+
32
+ return OpenFAQs
33
+ }
@@ -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
+ }
@@ -6,7 +6,7 @@ module.exports = {
6
6
  {"action":"text","display":"Texto"},
7
7
  {"action":"image","display":"Imagem"},
8
8
  {"action":"video","display":"Vídeo"},
9
- {"action":"audio","display":"Audio"},
9
+ {"action":"audio","display":"Áudio"},
10
10
  {"action":"file","display":"Arquivo"},
11
11
  {"action":"list_messenger","display":"Lista"},
12
12
  {"action":"quick_replay_messenger","display":"Resposta rápida"},
@@ -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
+ }
@@ -1,201 +1,201 @@
1
- 'use strict'
2
-
3
- const apiId = 'f4f8f65e-565d-424e-9235-a17fcf019836'
4
-
5
- const apiBodyId = '45f353da-db0d-4928-8b59-5b649f9c0349'
6
-
7
- const apiResourceId = '618a7422-9d86-4ced-a0ca-8968474978d4'
8
-
9
- const dialogNodeId = '3cc49a93-e327-48b9-b001-b859fcc840fb'
10
-
11
- const SkillId = 'baee4f99-9966-4adb-a8de-596d5d4dd823'
12
-
13
- module.exports = {
14
- up: async (queryInterface, Sequelize) => {
15
- await queryInterface.bulkInsert('Apis', [
16
- {
17
- id: apiId,
18
- baseUrl: JSON.stringify([
19
- {
20
- url: 'https://leanbot.api.dev.itlean.com.br',
21
- type: 'apiKey',
22
- auth: {
23
- key: 'x-api-key',
24
- value: 'key',
25
- addTo: 'header',
26
- },
27
- environment: 'test',
28
- },
29
- ]),
30
- type: 'json',
31
- name: 'Api Seeder',
32
- description: 'Created by seeder to test pre-request',
33
- EnterpriseId: null,
34
- createdAt: Sequelize.literal('now()'),
35
- updatedAt: Sequelize.literal('now()'),
36
- },
37
- ])
38
-
39
- await queryInterface.bulkInsert('ApiResourcesBodies', [
40
- {
41
- id: apiBodyId,
42
- content: JSON.stringify({
43
- getContext: '$email',
44
- notInContext: '$notInContext',
45
- noReplace: 'noReplace',
46
- }),
47
- type: 'json',
48
- createdAt: Sequelize.literal('now()'),
49
- updatedAt: Sequelize.literal('now()'),
50
- },
51
- ])
52
-
53
- const resourcePathParamToReplaceKey = '$lang'
54
-
55
- await queryInterface.bulkInsert('ApiResources', [
56
- {
57
- id: apiResourceId,
58
- uri: `/api/framework/${resourcePathParamToReplaceKey}`,
59
- method: 'POST',
60
- name: 'Api Resource Seeder',
61
- description: 'Api Resource Seeder',
62
- ApiId: apiId,
63
- ApiResourcesBodyId: apiBodyId,
64
- createdAt: Sequelize.literal('now()'),
65
- updatedAt: Sequelize.literal('now()'),
66
- },
67
- ])
68
-
69
- await queryInterface.bulkInsert('ApiResourcesHeaders', [
70
- {
71
- id: 'a9f0008a-84bb-4fd4-a2ae-1b76f1093422',
72
- ApiResourceId: apiResourceId,
73
- value: 'en',
74
- type: 'Accept-Language',
75
- createdAt: Sequelize.literal('now()'),
76
- updatedAt: Sequelize.literal('now()'),
77
- },
78
- ])
79
-
80
- await queryInterface.bulkInsert('ApiResourcesPathParams', [
81
- {
82
- id: 'c264f31d-f8fc-4a1a-ad21-f29c66e24ab4',
83
- ApiResourceId: apiResourceId,
84
- key: resourcePathParamToReplaceKey,
85
- value: 'en',
86
- createdAt: Sequelize.literal('now()'),
87
- updatedAt: Sequelize.literal('now()'),
88
- },
89
- ])
90
-
91
- await queryInterface.bulkInsert('ApiResourcesQueryStringParams', [
92
- {
93
- id: '0ea48ff6-914b-46dc-9c61-5179fcddbc7c',
94
- ApiResourceId: apiResourceId,
95
- key: 'lang',
96
- type: 'string',
97
- value: 'en',
98
- createdAt: Sequelize.literal('now()'),
99
- updatedAt: Sequelize.literal('now()'),
100
- },
101
- ])
102
-
103
- await queryInterface.bulkInsert('ApiPreRequests', [
104
- {
105
- id: '2ab884ba-53f0-47d4-b4cb-376e5254ede2',
106
- ApiResourceId: apiResourceId,
107
- result: 'pre-result',
108
- delayForNewRequest: '600000',
109
- PreApiResourceId: '2ea2a347-bfdf-4209-b51f-7cacfa511299',
110
- createdAt: Sequelize.literal('now()'),
111
- updatedAt: Sequelize.literal('now()'),
112
- }
113
- ])
114
-
115
- const ibmIntelligenceId = await queryInterface.rawSelect(
116
- 'Intelligences',
117
- {
118
- where: {
119
- providerType: 'ibm',
120
- },
121
- },
122
- ['id']
123
- )
124
-
125
- const ibmProviderId = 'f5cc3829-e441-452f-9bea-70581bde9eff'
126
-
127
- await queryInterface.bulkInsert('Skills', [
128
- {
129
- id: SkillId,
130
- IntelligenceId: ibmIntelligenceId,
131
- AwsProviderId: null,
132
- ItleanProviderId: null,
133
- IbmProviderId: ibmProviderId,
134
- name: 'Skill Nlp Seed',
135
- description: 'skill created by seeders',
136
- lang: 'pt-br',
137
- externalIbmId: '1c6e2489-6675-4c08-aa89-fdac4bc50de3',
138
- createdAt: Sequelize.literal('now()'),
139
- updatedAt: Sequelize.literal('now()'),
140
- },
141
- ])
142
-
143
- await queryInterface.bulkInsert(
144
- 'DialogNodes',
145
- [
146
- {
147
- id: dialogNodeId,
148
- name: 'api_pre_request',
149
- SkillId,
150
- condition: 'true',
151
- contexts: '[]',
152
- step: 1,
153
- replayWait: true,
154
- type: 'node',
155
- isMultipleResponse: false,
156
- JumpToDialogNodeId: null,
157
- JumpToSkillId: null,
158
- DialogNodeFolderId: null,
159
- createdAt: Sequelize.literal('now()'),
160
- updatedAt: Sequelize.literal('now()'),
161
- },
162
- ],
163
- {}
164
- )
165
-
166
- await queryInterface.bulkInsert('DialogNodes_ApiResources', [
167
- {
168
- DialogNodeId: dialogNodeId,
169
- ApiResourceId: apiResourceId,
170
- response: 'api',
171
- environment: 'auth',
172
- createdAt: new Date(),
173
- updatedAt: new Date(),
174
- },
175
- ])
176
- },
177
-
178
- down: async (queryInterface) => {
179
- await queryInterface.bulkDelete('ApiResourcesQueryStringParams', [
180
- { ApiResourceId: apiResourceId },
181
- ])
182
- await queryInterface.bulkDelete('ApiResourcesPathParams', [
183
- { ApiResourceId: apiResourceId },
184
- ])
185
- await queryInterface.bulkDelete('ApiPreRequests', [
186
- { ApiResourceId: apiResourceId },
187
- ])
188
- await queryInterface.bulkDelete('ApiResourcesHeaders', [
189
- { ApiResourceId: apiResourceId },
190
- ])
191
- await queryInterface.bulkDelete('DialogNodes_ApiResources', [
192
- { ApiResourceId: apiResourceId },
193
- ])
194
- await queryInterface.bulkDelete('ApiResources', [{ id: apiResourceId }])
195
- await queryInterface.bulkDelete('ApiResourcesBodies', [{ id: apiBodyId }])
196
- await queryInterface.bulkDelete('Apis', [{ id: apiId }])
197
-
198
- await queryInterface.bulkDelete('Skills', [{ id: SkillId }])
199
- await queryInterface.bulkDelete('DialogNodes', [{ id: dialogNodeId }])
200
- },
201
- }
1
+ 'use strict'
2
+
3
+ const apiId = 'f4f8f65e-565d-424e-9235-a17fcf019836'
4
+
5
+ const apiBodyId = '45f353da-db0d-4928-8b59-5b649f9c0349'
6
+
7
+ const apiResourceId = '618a7422-9d86-4ced-a0ca-8968474978d4'
8
+
9
+ const dialogNodeId = '3cc49a93-e327-48b9-b001-b859fcc840fb'
10
+
11
+ const SkillId = 'baee4f99-9966-4adb-a8de-596d5d4dd823'
12
+
13
+ module.exports = {
14
+ up: async (queryInterface, Sequelize) => {
15
+ await queryInterface.bulkInsert('Apis', [
16
+ {
17
+ id: apiId,
18
+ baseUrl: JSON.stringify([
19
+ {
20
+ url: 'https://leanbot.api.dev.itlean.com.br',
21
+ type: 'apiKey',
22
+ auth: {
23
+ key: 'x-api-key',
24
+ value: 'key',
25
+ addTo: 'header',
26
+ },
27
+ environment: 'test',
28
+ },
29
+ ]),
30
+ type: 'json',
31
+ name: 'Api Seeder',
32
+ description: 'Created by seeder to test pre-request',
33
+ EnterpriseId: null,
34
+ createdAt: Sequelize.literal('now()'),
35
+ updatedAt: Sequelize.literal('now()'),
36
+ },
37
+ ])
38
+
39
+ await queryInterface.bulkInsert('ApiResourcesBodies', [
40
+ {
41
+ id: apiBodyId,
42
+ content: JSON.stringify({
43
+ getContext: '$email',
44
+ notInContext: '$notInContext',
45
+ noReplace: 'noReplace',
46
+ }),
47
+ type: 'json',
48
+ createdAt: Sequelize.literal('now()'),
49
+ updatedAt: Sequelize.literal('now()'),
50
+ },
51
+ ])
52
+
53
+ const resourcePathParamToReplaceKey = '$lang'
54
+
55
+ await queryInterface.bulkInsert('ApiResources', [
56
+ {
57
+ id: apiResourceId,
58
+ uri: `/api/framework/${resourcePathParamToReplaceKey}`,
59
+ method: 'POST',
60
+ name: 'Api Resource Seeder',
61
+ description: 'Api Resource Seeder',
62
+ ApiId: apiId,
63
+ ApiResourcesBodyId: apiBodyId,
64
+ createdAt: Sequelize.literal('now()'),
65
+ updatedAt: Sequelize.literal('now()'),
66
+ },
67
+ ])
68
+
69
+ await queryInterface.bulkInsert('ApiResourcesHeaders', [
70
+ {
71
+ id: 'a9f0008a-84bb-4fd4-a2ae-1b76f1093422',
72
+ ApiResourceId: apiResourceId,
73
+ value: 'en',
74
+ type: 'Accept-Language',
75
+ createdAt: Sequelize.literal('now()'),
76
+ updatedAt: Sequelize.literal('now()'),
77
+ },
78
+ ])
79
+
80
+ await queryInterface.bulkInsert('ApiResourcesPathParams', [
81
+ {
82
+ id: 'c264f31d-f8fc-4a1a-ad21-f29c66e24ab4',
83
+ ApiResourceId: apiResourceId,
84
+ key: resourcePathParamToReplaceKey,
85
+ value: 'en',
86
+ createdAt: Sequelize.literal('now()'),
87
+ updatedAt: Sequelize.literal('now()'),
88
+ },
89
+ ])
90
+
91
+ await queryInterface.bulkInsert('ApiResourcesQueryStringParams', [
92
+ {
93
+ id: '0ea48ff6-914b-46dc-9c61-5179fcddbc7c',
94
+ ApiResourceId: apiResourceId,
95
+ key: 'lang',
96
+ type: 'string',
97
+ value: 'en',
98
+ createdAt: Sequelize.literal('now()'),
99
+ updatedAt: Sequelize.literal('now()'),
100
+ },
101
+ ])
102
+
103
+ await queryInterface.bulkInsert('ApiPreRequests', [
104
+ {
105
+ id: '2ab884ba-53f0-47d4-b4cb-376e5254ede2',
106
+ ApiResourceId: apiResourceId,
107
+ result: 'pre-result',
108
+ delayForNewRequest: '600000',
109
+ PreApiResourceId: '2ea2a347-bfdf-4209-b51f-7cacfa511299',
110
+ createdAt: Sequelize.literal('now()'),
111
+ updatedAt: Sequelize.literal('now()'),
112
+ }
113
+ ])
114
+
115
+ const ibmIntelligenceId = await queryInterface.rawSelect(
116
+ 'Intelligences',
117
+ {
118
+ where: {
119
+ providerType: 'ibm',
120
+ },
121
+ },
122
+ ['id']
123
+ )
124
+
125
+ const ibmProviderId = 'f5cc3829-e441-452f-9bea-70581bde9eff'
126
+
127
+ await queryInterface.bulkInsert('Skills', [
128
+ {
129
+ id: SkillId,
130
+ IntelligenceId: ibmIntelligenceId,
131
+ AwsProviderId: null,
132
+ ItleanProviderId: null,
133
+ IbmProviderId: ibmProviderId,
134
+ name: 'Skill Nlp Seed',
135
+ description: 'skill created by seeders',
136
+ lang: 'pt-br',
137
+ externalIbmId: '1c6e2489-6675-4c08-aa89-fdac4bc50de3',
138
+ createdAt: Sequelize.literal('now()'),
139
+ updatedAt: Sequelize.literal('now()'),
140
+ },
141
+ ])
142
+
143
+ await queryInterface.bulkInsert(
144
+ 'DialogNodes',
145
+ [
146
+ {
147
+ id: dialogNodeId,
148
+ name: 'api_pre_request',
149
+ SkillId,
150
+ condition: 'true',
151
+ contexts: '[]',
152
+ step: 1,
153
+ replayWait: true,
154
+ type: 'node',
155
+ isMultipleResponse: false,
156
+ JumpToDialogNodeId: null,
157
+ JumpToSkillId: null,
158
+ DialogNodeFolderId: null,
159
+ createdAt: Sequelize.literal('now()'),
160
+ updatedAt: Sequelize.literal('now()'),
161
+ },
162
+ ],
163
+ {}
164
+ )
165
+
166
+ await queryInterface.bulkInsert('DialogNodes_ApiResources', [
167
+ {
168
+ DialogNodeId: dialogNodeId,
169
+ ApiResourceId: apiResourceId,
170
+ response: 'api',
171
+ environment: 'auth',
172
+ createdAt: new Date(),
173
+ updatedAt: new Date(),
174
+ },
175
+ ])
176
+ },
177
+
178
+ down: async (queryInterface) => {
179
+ await queryInterface.bulkDelete('ApiResourcesQueryStringParams', [
180
+ { ApiResourceId: apiResourceId },
181
+ ])
182
+ await queryInterface.bulkDelete('ApiResourcesPathParams', [
183
+ { ApiResourceId: apiResourceId },
184
+ ])
185
+ await queryInterface.bulkDelete('ApiPreRequests', [
186
+ { ApiResourceId: apiResourceId },
187
+ ])
188
+ await queryInterface.bulkDelete('ApiResourcesHeaders', [
189
+ { ApiResourceId: apiResourceId },
190
+ ])
191
+ await queryInterface.bulkDelete('DialogNodes_ApiResources', [
192
+ { ApiResourceId: apiResourceId },
193
+ ])
194
+ await queryInterface.bulkDelete('ApiResources', [{ id: apiResourceId }])
195
+ await queryInterface.bulkDelete('ApiResourcesBodies', [{ id: apiBodyId }])
196
+ await queryInterface.bulkDelete('Apis', [{ id: apiId }])
197
+
198
+ await queryInterface.bulkDelete('Skills', [{ id: SkillId }])
199
+ await queryInterface.bulkDelete('DialogNodes', [{ id: dialogNodeId }])
200
+ },
201
+ }