@itleanchatbot/shared-models-js-postgres 2.1.0 → 2.1.2
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 +1 -1
- package/src/seeders/test/20200924195050-create-ibmprovider.js +38 -0
- package/src/seeders/test/20200924195050-create-itlean-provider.js +40 -0
- package/src/seeders/test/20200924195050-seed-enterprises.js +24 -0
- package/src/seeders/test/20200925184253-seed-skils-itlean-provider.js +37 -0
- package/src/seeders/test/20200925184253-seed-skils.js +41 -0
- package/src/seeders/test/20200925184254-seed-Intention.js +39 -0
- package/src/seeders/test/20200925184258-seed-Intention-values.js +41 -0
- package/src/seeders/test/20200925191642-seed-entity-skill-itlean.js +23 -0
- package/src/seeders/test/20200925191642-seed-entity.js +23 -0
- package/src/seeders/test/20200925191643-seed-entity-values-skill-itlean.js +32 -0
- package/src/seeders/test/20200925191643-seed-entity-values.js +33 -0
- package/src/seeders/test/20200929132705-seed-dialog-node.js +128 -0
- package/src/seeders/test/20201016200600-seed-responses.js +563 -0
- package/src/seeders/test/20201104183653-seed-create-ype-skill.js +42 -0
- package/src/seeders/test/20201104183700-seed-create-ype-intention.js +26 -0
- package/src/seeders/test/20201104183706-seed-create-ype-intention-values.js +70 -0
- package/src/seeders/test/20201104183714-seed-create-ype-entity.js +38 -0
- package/src/seeders/test/20201104183723-seed-create-ype-entity-values.js +243 -0
- package/src/seeders/test/20201104183727-seed-create-ype-synonyms.js +253 -0
- package/src/seeders/test/20201104202534-seed-create-ype-node-saudacao.js +124 -0
- package/src/seeders/test/20210224171409-create-apiResource.js +114 -0
- package/src/seeders/test/20210422144458-seed-context-test.js +175 -0
- package/src/seeders/test/20210422181114-seed-jump-node.js +123 -0
- package/src/seeders/test/20210422182413-seed-jump-skill.js +123 -0
- package/src/seeders/test/20210426100156-seed-api-test.js +138 -0
- package/src/seeders/test/20210426103704-seed-multiple-response-test.js +272 -0
- package/src/seeders/test/20210426190844-seed-entity-search-test.js +160 -0
- package/src/seeders/test/20210427172150-seed-test-with-input-test-fisrt.js +160 -0
- package/src/seeders/test/20210428105402-seed-test-condition-1.js +190 -0
- package/src/seeders/test/20210430181906-seed-test-input-text-zero.js +120 -0
- package/src/seeders/test/20210430183204-seed-ype-test-condition.js +557 -0
- package/src/seeders/test/20210503172321-seed-invalid-condition.js +119 -0
- package/src/seeders/test/20210505140225-insert-skills.js +41 -0
- package/src/seeders/test/20210505183810-seed-chain-with-context.js +147 -0
- package/src/seeders/test/20210506125701-seed-with-intention-and-entity-same-name.js +188 -0
- package/src/seeders/test/20210507204437-seed-condition-igual-true.js +119 -0
- package/src/seeders/test/20210511181006-seed-using-internal-functions.js +274 -0
- package/src/seeders/test/20210512140152-seed-ype-real-bot.js +2578 -0
- package/src/seeders/test/20210519162746-seed-response-with-context.js +186 -0
- package/src/seeders/test/20210524141819-seed-dialog-node-faq.js +244 -0
- package/src/seeders/test/20210525180523-seed-regex.js +173 -0
- package/src/seeders/test/20210602111930-insert-dialogNodes.js +200 -0
- package/src/seeders/test/20210610152534-seed-test-internal-function-in-context.js +216 -0
- package/src/seeders/test/20210610181308-seed-test-find-in-array-internal-function.js +147 -0
- package/src/seeders/test/20210611101042-bot-example-internal-functions.js +985 -0
- package/src/seeders/test/20210613111900-bot-example-api.js +420 -0
- package/src/seeders/test/20210614113654-miltiple-response-with-research.js +387 -0
- package/src/seeders/test/20210616212102-api-authentication-and-list.js +422 -0
- package/src/seeders/test/20210624172310-seed-api-duble-request.js +424 -0
- package/src/seeders/test/20210628135630-test-branches.js +224 -0
- package/src/seeders/test/20210629141030-test-departments.js +225 -0
- package/src/seeders/test/20210630105430-test-subDepartments.js +223 -0
- package/src/seeders/test/20210630114011-test-contact.js +178 -0
- package/src/seeders/test/20210701130630-test-channels.js +381 -0
- package/src/seeders/test/20210702191230-seed-test-counter-in-context.js +122 -0
- package/src/seeders/test/20210705061313-test-fields.js +152 -0
- package/src/seeders/test/20210705080813-test-groups.js +122 -0
- package/src/seeders/test/20210705105918-seed-test-function-slice.js +161 -0
- package/src/seeders/test/20210706105508-seed-node-without-condition.js +254 -0
- package/src/seeders/test/20210706112906-seed-1.0-on-response.js +172 -0
- package/src/seeders/test/20210706145547-seed-clean-context.js +132 -0
- package/src/seeders/test/20210707151538-seed-test-response-break-line.js +161 -0
- package/src/seeders/test/20210713155530-seed-test-itl0079-875.js +129 -0
- package/src/seeders/test/20210715125619-seed-multiple-response-with-several-jumps.js +764 -0
- package/src/seeders/test/20210715163606-seed-test-multiple-response-with-jump.js +250 -0
- package/src/seeders/test/20210719154025-seed-2-contexts-together.js +133 -0
- package/src/seeders/test/20210802144227-seed-end-session-trigger.js +163 -0
- package/src/seeders/test/20210803103030-tests-dialogNodes.js +406 -0
- package/src/seeders/test/20210804094630-tests-lines.js +487 -0
- package/src/seeders/test/20210805104130-tests-lineConfigurations.js +106 -0
- package/src/seeders/test/20210805133330-tests-systemUsers.js +507 -0
- package/src/seeders/test/20210813124630-tests-getMessagesBySession.js +333 -0
- package/src/seeders/test/20210816151830-testes-inactivityTriggers.js +196 -0
- package/src/seeders/test/20210830134230-tests-sessionReports.js +254 -0
- package/src/seeders/test/20210830165830-tests-attendancesHistory.js +181 -0
- package/src/seeders/test/20210927115821-skill-test-open-faq.js +37 -0
- package/src/seeders/test/20211004131813-true-and-context-with-parent.js +190 -0
- package/src/seeders/test/20211006210203-context-concat-with-text.js +193 -0
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const skillId_01 = '60d86c04-6c2d-49bc-9181-def99ff3b80b'
|
|
4
|
+
|
|
5
|
+
const channelId_01 = 'e54a1c4e-5e2e-4c49-b9a9-975480a430ff'
|
|
6
|
+
const channelId_02 = '21d1e2a4-0f21-4896-8560-c68a79352f9c'
|
|
7
|
+
const channelId_03 = 'b552c165-3dfb-47bd-b9b7-87213683dce4'
|
|
8
|
+
const channelId_04 = 'ac682d1c-39af-4fb4-a59a-eef105382291'
|
|
9
|
+
const channelId_05 = '9961e4a1-c8fd-4b8f-95dd-8734de9e7eb6'
|
|
10
|
+
const channelId_06 = '88cd15e0-e0a2-4a64-92fb-42554158b0da'
|
|
11
|
+
const channelId_07 = 'bbd73c56-39bb-48df-a410-b00ee3fd61ea'
|
|
12
|
+
const channelId_08 = '0f39b2da-d665-41e5-86f7-cf5b4a6a13dd'
|
|
13
|
+
const channelId_09 = '6dfe8401-81bd-4a08-8d41-2f64b8975515'
|
|
14
|
+
const channelId_10 = '3a41a856-2198-4bf5-90e3-3dafc28e8d66'
|
|
15
|
+
const channelId_11 = 'a856db44-5782-48a6-a675-e9010e700873'
|
|
16
|
+
const channelId_12 = '02fdb899-e16e-49b5-b421-cca3352bc124'
|
|
17
|
+
const channelId_13 = 'ea070872-07fc-4e66-9654-afc599f7ac02'
|
|
18
|
+
const channelId_14 = '3b734f61-3eca-42ca-b993-c937c9f86d8a'
|
|
19
|
+
const channelId_15 = '7b4fd84f-10ae-4dbc-85f0-19192345c162'
|
|
20
|
+
const channelId_16 = '08e9021b-db64-4e96-a09f-c0e1a90ccb71'
|
|
21
|
+
|
|
22
|
+
module.exports = {
|
|
23
|
+
up: async (queryInterface, Sequelize) => {
|
|
24
|
+
const EnterpriseId = await queryInterface.rawSelect(
|
|
25
|
+
'Enterprises',
|
|
26
|
+
{ where: { cnpj: process.env.ENTERPRISE_CNPJ } },
|
|
27
|
+
['id']
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
const IntelligenceId = await queryInterface.rawSelect(
|
|
31
|
+
'Intelligences',
|
|
32
|
+
{
|
|
33
|
+
where: {
|
|
34
|
+
providerType: 'itlean',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
['id']
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
const ItleanProviderId = await queryInterface.rawSelect(
|
|
41
|
+
'ItleanProviders',
|
|
42
|
+
{
|
|
43
|
+
where: {
|
|
44
|
+
EnterpriseId,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
['id']
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
const webchatChannelTypeId = await queryInterface.rawSelect(
|
|
51
|
+
'ChannelTypes',
|
|
52
|
+
{ where: { channelName: 'webchat' } },
|
|
53
|
+
['id']
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
const interaxaChannelTypeId = await queryInterface.rawSelect(
|
|
57
|
+
'ChannelTypes',
|
|
58
|
+
{ where: { channelName: 'whatsapp_interaxa' } },
|
|
59
|
+
['id']
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
const gupshupChannelTypeId = await queryInterface.rawSelect(
|
|
63
|
+
'ChannelTypes',
|
|
64
|
+
{ where: { channelName: 'whatsapp_gupshup' } },
|
|
65
|
+
['id']
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
await queryInterface.bulkInsert('Skills', [
|
|
69
|
+
{
|
|
70
|
+
id: skillId_01,
|
|
71
|
+
IntelligenceId,
|
|
72
|
+
AwsProviderId: null,
|
|
73
|
+
ItleanProviderId,
|
|
74
|
+
IbmProviderId: null,
|
|
75
|
+
name: 'Skill de Testes',
|
|
76
|
+
description: 'Skill de Testes de Canais',
|
|
77
|
+
lang: 'pt-br',
|
|
78
|
+
createdAt: Sequelize.literal('now()'),
|
|
79
|
+
updatedAt: Sequelize.literal('now()'),
|
|
80
|
+
},
|
|
81
|
+
])
|
|
82
|
+
|
|
83
|
+
await queryInterface.bulkInsert('Channels', [
|
|
84
|
+
{
|
|
85
|
+
id: channelId_01,
|
|
86
|
+
ChannelTypeId: webchatChannelTypeId,
|
|
87
|
+
SkillId: skillId_01,
|
|
88
|
+
FileId: null,
|
|
89
|
+
name: '20210701133930',
|
|
90
|
+
configurations: JSON.stringify({
|
|
91
|
+
domainName: '20210701133930',
|
|
92
|
+
displayName: '20210701133930',
|
|
93
|
+
sendAttachments: false,
|
|
94
|
+
componentsColor: '#ffffff',
|
|
95
|
+
backgroundColor: '#000000',
|
|
96
|
+
fontColor: '#444444',
|
|
97
|
+
}),
|
|
98
|
+
createdAt: Sequelize.literal('now()'),
|
|
99
|
+
updatedAt: Sequelize.literal('now()'),
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
id: channelId_02,
|
|
103
|
+
ChannelTypeId: interaxaChannelTypeId,
|
|
104
|
+
SkillId: skillId_01,
|
|
105
|
+
FileId: null,
|
|
106
|
+
name: '20210701160030',
|
|
107
|
+
configurations: JSON.stringify({
|
|
108
|
+
phoneNumber: '5511900000001',
|
|
109
|
+
mediaId: '124894e0-d459-4e28-8a6a-c940ecb3c085',
|
|
110
|
+
namespace: 'ee988fce-f07e-4c11-b287-a31149e7dcc7',
|
|
111
|
+
urlApi: 'https://test.com/api',
|
|
112
|
+
apiUser: 'teste',
|
|
113
|
+
apiPassword: 'teste',
|
|
114
|
+
}),
|
|
115
|
+
createdAt: Sequelize.literal('now()'),
|
|
116
|
+
updatedAt: Sequelize.literal('now()'),
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
id: channelId_03,
|
|
120
|
+
ChannelTypeId: gupshupChannelTypeId,
|
|
121
|
+
SkillId: skillId_01,
|
|
122
|
+
FileId: null,
|
|
123
|
+
name: '20210701165930',
|
|
124
|
+
configurations: JSON.stringify({
|
|
125
|
+
source: '5511900000002',
|
|
126
|
+
wabaid: '20210701165930',
|
|
127
|
+
'src.name': '20210701165930',
|
|
128
|
+
apikey: '20210701165930',
|
|
129
|
+
urlApi: 'https://teste.com/api',
|
|
130
|
+
}),
|
|
131
|
+
createdAt: Sequelize.literal('now()'),
|
|
132
|
+
updatedAt: Sequelize.literal('now()'),
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
id: channelId_04,
|
|
136
|
+
ChannelTypeId: webchatChannelTypeId,
|
|
137
|
+
SkillId: skillId_01,
|
|
138
|
+
FileId: null,
|
|
139
|
+
name: '20210702114630',
|
|
140
|
+
configurations: JSON.stringify({
|
|
141
|
+
domainName: '202107021146',
|
|
142
|
+
displayName: '202107021146',
|
|
143
|
+
sendAttachments: false,
|
|
144
|
+
componentsColor: '#ffffff',
|
|
145
|
+
backgroundColor: '#000000',
|
|
146
|
+
fontColor: '#444444',
|
|
147
|
+
}),
|
|
148
|
+
createdAt: Sequelize.literal('now()'),
|
|
149
|
+
updatedAt: Sequelize.literal('now()'),
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
id: channelId_05,
|
|
153
|
+
ChannelTypeId: interaxaChannelTypeId,
|
|
154
|
+
SkillId: skillId_01,
|
|
155
|
+
FileId: null,
|
|
156
|
+
name: '20210702123130',
|
|
157
|
+
configurations: JSON.stringify({
|
|
158
|
+
phoneNumber: '5511920210702',
|
|
159
|
+
mediaId: '7ca66347-5262-406e-8453-81ac5c01c4ac',
|
|
160
|
+
namespace: '873f40a7-a23f-4237-9a1a-3b6a7c4bdf4d',
|
|
161
|
+
urlApi: 'https://test.com/api',
|
|
162
|
+
apiUser: 'teste',
|
|
163
|
+
apiPassword: 'teste',
|
|
164
|
+
}),
|
|
165
|
+
createdAt: Sequelize.literal('now()'),
|
|
166
|
+
updatedAt: Sequelize.literal('now()'),
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
id: channelId_06,
|
|
170
|
+
ChannelTypeId: webchatChannelTypeId,
|
|
171
|
+
SkillId: skillId_01,
|
|
172
|
+
FileId: null,
|
|
173
|
+
name: '20210702123930',
|
|
174
|
+
configurations: JSON.stringify({
|
|
175
|
+
domainName: '20210702123930',
|
|
176
|
+
displayName: '20210702123930',
|
|
177
|
+
sendAttachments: false,
|
|
178
|
+
componentsColor: '#ffffff',
|
|
179
|
+
backgroundColor: '#000000',
|
|
180
|
+
fontColor: '#444444',
|
|
181
|
+
}),
|
|
182
|
+
createdAt: Sequelize.literal('now()'),
|
|
183
|
+
updatedAt: Sequelize.literal('now()'),
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
id: channelId_07,
|
|
187
|
+
ChannelTypeId: gupshupChannelTypeId,
|
|
188
|
+
SkillId: skillId_01,
|
|
189
|
+
FileId: null,
|
|
190
|
+
name: '20210702130830',
|
|
191
|
+
configurations: JSON.stringify({
|
|
192
|
+
source: '5511920210702',
|
|
193
|
+
wabaid: '20210702130830',
|
|
194
|
+
'src.name': '20210702130830',
|
|
195
|
+
apikey: '20210702130830',
|
|
196
|
+
urlApi: 'https://teste.com/api',
|
|
197
|
+
}),
|
|
198
|
+
createdAt: Sequelize.literal('now()'),
|
|
199
|
+
updatedAt: Sequelize.literal('now()'),
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
id: channelId_08,
|
|
203
|
+
ChannelTypeId: gupshupChannelTypeId,
|
|
204
|
+
SkillId: skillId_01,
|
|
205
|
+
FileId: null,
|
|
206
|
+
name: '20210702130831',
|
|
207
|
+
configurations: JSON.stringify({
|
|
208
|
+
source: '5511920210703',
|
|
209
|
+
wabaid: '20210702130831',
|
|
210
|
+
'src.name': '20210702130831',
|
|
211
|
+
apikey: '20210702130831',
|
|
212
|
+
urlApi: 'https://teste.com/api',
|
|
213
|
+
}),
|
|
214
|
+
createdAt: Sequelize.literal('now()'),
|
|
215
|
+
updatedAt: Sequelize.literal('now()'),
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
id: channelId_09,
|
|
219
|
+
ChannelTypeId: webchatChannelTypeId,
|
|
220
|
+
SkillId: skillId_01,
|
|
221
|
+
FileId: null,
|
|
222
|
+
name: '20210702133430',
|
|
223
|
+
configurations: JSON.stringify({
|
|
224
|
+
domainName: '202107021334',
|
|
225
|
+
displayName: '202107021334',
|
|
226
|
+
sendAttachments: false,
|
|
227
|
+
componentsColor: '#ffffff',
|
|
228
|
+
backgroundColor: '#000000',
|
|
229
|
+
fontColor: '#444444',
|
|
230
|
+
}),
|
|
231
|
+
createdAt: Sequelize.literal('now()'),
|
|
232
|
+
updatedAt: Sequelize.literal('now()'),
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
id: channelId_10,
|
|
236
|
+
ChannelTypeId: webchatChannelTypeId,
|
|
237
|
+
SkillId: skillId_01,
|
|
238
|
+
FileId: null,
|
|
239
|
+
name: '20210702135330',
|
|
240
|
+
configurations: JSON.stringify({
|
|
241
|
+
domainName: '202107021353',
|
|
242
|
+
displayName: '202107021353',
|
|
243
|
+
sendAttachments: false,
|
|
244
|
+
componentsColor: '#ffffff',
|
|
245
|
+
backgroundColor: '#000000',
|
|
246
|
+
fontColor: '#444444',
|
|
247
|
+
}),
|
|
248
|
+
createdAt: Sequelize.literal('now()'),
|
|
249
|
+
updatedAt: Sequelize.literal('now()'),
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
id: channelId_11,
|
|
253
|
+
ChannelTypeId: gupshupChannelTypeId,
|
|
254
|
+
SkillId: skillId_01,
|
|
255
|
+
FileId: null,
|
|
256
|
+
name: '20210702140330',
|
|
257
|
+
configurations: JSON.stringify({
|
|
258
|
+
source: '5511920210704',
|
|
259
|
+
wabaid: '202107021403',
|
|
260
|
+
'src.name': '202107021403',
|
|
261
|
+
apikey: '202107021403',
|
|
262
|
+
urlApi: 'https://teste.com/api',
|
|
263
|
+
}),
|
|
264
|
+
createdAt: Sequelize.literal('now()'),
|
|
265
|
+
updatedAt: Sequelize.literal('now()'),
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
id: channelId_12,
|
|
269
|
+
ChannelTypeId: webchatChannelTypeId,
|
|
270
|
+
SkillId: skillId_01,
|
|
271
|
+
FileId: null,
|
|
272
|
+
name: '20210702143530',
|
|
273
|
+
configurations: JSON.stringify({
|
|
274
|
+
domainName: '202107021435',
|
|
275
|
+
displayName: '202107021435',
|
|
276
|
+
sendAttachments: false,
|
|
277
|
+
componentsColor: '#ffffff',
|
|
278
|
+
backgroundColor: '#000000',
|
|
279
|
+
fontColor: '#444444',
|
|
280
|
+
serverId: 'd6b1b9f7-4d58-4de4-afed-7aef7dfc7a4e',
|
|
281
|
+
}),
|
|
282
|
+
createdAt: Sequelize.literal('now()'),
|
|
283
|
+
updatedAt: Sequelize.literal('now()'),
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
id: channelId_13,
|
|
287
|
+
ChannelTypeId: webchatChannelTypeId,
|
|
288
|
+
SkillId: skillId_01,
|
|
289
|
+
FileId: null,
|
|
290
|
+
name: '20210702150730',
|
|
291
|
+
configurations: JSON.stringify({
|
|
292
|
+
domainName: '202107021507',
|
|
293
|
+
displayName: '202107021507',
|
|
294
|
+
sendAttachments: false,
|
|
295
|
+
componentsColor: '#ffffff',
|
|
296
|
+
backgroundColor: '#000000',
|
|
297
|
+
fontColor: '#444444',
|
|
298
|
+
}),
|
|
299
|
+
createdAt: Sequelize.literal('now()'),
|
|
300
|
+
updatedAt: Sequelize.literal('now()'),
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
id: channelId_14,
|
|
304
|
+
ChannelTypeId: webchatChannelTypeId,
|
|
305
|
+
SkillId: skillId_01,
|
|
306
|
+
FileId: null,
|
|
307
|
+
name: '20210702150731',
|
|
308
|
+
configurations: JSON.stringify({
|
|
309
|
+
domainName: '202107021508',
|
|
310
|
+
displayName: '202107021508',
|
|
311
|
+
sendAttachments: false,
|
|
312
|
+
componentsColor: '#ffffff',
|
|
313
|
+
backgroundColor: '#000000',
|
|
314
|
+
fontColor: '#444444',
|
|
315
|
+
}),
|
|
316
|
+
createdAt: Sequelize.literal('now()'),
|
|
317
|
+
updatedAt: Sequelize.literal('now()'),
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
id: channelId_15,
|
|
321
|
+
ChannelTypeId: webchatChannelTypeId,
|
|
322
|
+
SkillId: skillId_01,
|
|
323
|
+
FileId: null,
|
|
324
|
+
name: '20210702150732',
|
|
325
|
+
configurations: JSON.stringify({
|
|
326
|
+
domainName: '202107021509',
|
|
327
|
+
displayName: '202107021509',
|
|
328
|
+
sendAttachments: false,
|
|
329
|
+
componentsColor: '#ffffff',
|
|
330
|
+
backgroundColor: '#000000',
|
|
331
|
+
fontColor: '#444444',
|
|
332
|
+
}),
|
|
333
|
+
createdAt: Sequelize.literal('now()'),
|
|
334
|
+
updatedAt: Sequelize.literal('now()'),
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
id: channelId_16,
|
|
338
|
+
ChannelTypeId: webchatChannelTypeId,
|
|
339
|
+
SkillId: skillId_01,
|
|
340
|
+
FileId: null,
|
|
341
|
+
name: '20210702150733',
|
|
342
|
+
configurations: JSON.stringify({
|
|
343
|
+
domainName: '202107021510',
|
|
344
|
+
displayName: '202107021510',
|
|
345
|
+
sendAttachments: false,
|
|
346
|
+
componentsColor: '#ffffff',
|
|
347
|
+
backgroundColor: '#000000',
|
|
348
|
+
fontColor: '#444444',
|
|
349
|
+
}),
|
|
350
|
+
createdAt: Sequelize.literal('now()'),
|
|
351
|
+
updatedAt: Sequelize.literal('now()'),
|
|
352
|
+
},
|
|
353
|
+
])
|
|
354
|
+
},
|
|
355
|
+
|
|
356
|
+
down: async (queryInterface) => {
|
|
357
|
+
await queryInterface.bulkDelete('Channels', [
|
|
358
|
+
{
|
|
359
|
+
id: [
|
|
360
|
+
channelId_01,
|
|
361
|
+
channelId_02,
|
|
362
|
+
channelId_03,
|
|
363
|
+
channelId_04,
|
|
364
|
+
channelId_05,
|
|
365
|
+
channelId_06,
|
|
366
|
+
channelId_07,
|
|
367
|
+
channelId_08,
|
|
368
|
+
channelId_09,
|
|
369
|
+
channelId_10,
|
|
370
|
+
channelId_11,
|
|
371
|
+
channelId_12,
|
|
372
|
+
channelId_13,
|
|
373
|
+
channelId_14,
|
|
374
|
+
channelId_15,
|
|
375
|
+
channelId_16,
|
|
376
|
+
],
|
|
377
|
+
},
|
|
378
|
+
])
|
|
379
|
+
await queryInterface.bulkDelete('Skills', [{ id: skillId_01 }])
|
|
380
|
+
},
|
|
381
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
const SkillId = '5f3f8aa6-3c6c-43fb-aba0-e406c6214c7f'
|
|
3
|
+
|
|
4
|
+
const dialogNode1Id = '97653c1e-bbda-44e8-96d8-e90d11e294c6'
|
|
5
|
+
|
|
6
|
+
const responseId1 = '76e4c6ca-4d82-4ffb-8ee0-5ee57bba421f'
|
|
7
|
+
|
|
8
|
+
module.exports = {
|
|
9
|
+
up: async (queryInterface, Sequelize) => {
|
|
10
|
+
const ibmIntelligenceId = await queryInterface.rawSelect(
|
|
11
|
+
'Intelligences',
|
|
12
|
+
{
|
|
13
|
+
where: {
|
|
14
|
+
providerType: 'ibm',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
['id']
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
const ibmProviderId = 'f5cc3829-e441-452f-9bea-70581bde9eff'
|
|
21
|
+
await queryInterface.bulkInsert(
|
|
22
|
+
'Skills',
|
|
23
|
+
[
|
|
24
|
+
{
|
|
25
|
+
id: SkillId,
|
|
26
|
+
IntelligenceId: ibmIntelligenceId,
|
|
27
|
+
AwsProviderId: null,
|
|
28
|
+
ItleanProviderId: null,
|
|
29
|
+
IbmProviderId: ibmProviderId,
|
|
30
|
+
name: 'Skill counter in context',
|
|
31
|
+
description: 'using counter in context',
|
|
32
|
+
lang: 'pt-br',
|
|
33
|
+
createdAt: Sequelize.literal('now()'),
|
|
34
|
+
updatedAt: Sequelize.literal('now()'),
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
{}
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
await queryInterface.bulkInsert(
|
|
41
|
+
'DialogNodes',
|
|
42
|
+
[
|
|
43
|
+
{
|
|
44
|
+
id: dialogNode1Id,
|
|
45
|
+
name: 'counter',
|
|
46
|
+
condition: 'true',
|
|
47
|
+
SkillId,
|
|
48
|
+
contexts: JSON.stringify({
|
|
49
|
+
counter: 'sum($counter,1)',
|
|
50
|
+
}),
|
|
51
|
+
step: 1,
|
|
52
|
+
replayWait: true,
|
|
53
|
+
type: 'node',
|
|
54
|
+
isMultipleResponse: false,
|
|
55
|
+
JumpToDialogNodeId: null,
|
|
56
|
+
JumpToSkillId: null,
|
|
57
|
+
DialogNodeFolderId: null,
|
|
58
|
+
createdAt: Sequelize.literal('now()'),
|
|
59
|
+
updatedAt: Sequelize.literal('now()'),
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
{}
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
await queryInterface.bulkInsert(
|
|
66
|
+
'Responses',
|
|
67
|
+
[
|
|
68
|
+
{
|
|
69
|
+
id: responseId1,
|
|
70
|
+
name: 'Oi! tenho um regex',
|
|
71
|
+
SkillId,
|
|
72
|
+
createdAt: Sequelize.literal('now()'),
|
|
73
|
+
updatedAt: Sequelize.literal('now()'),
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
{}
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
await queryInterface.bulkInsert(
|
|
80
|
+
'ResponsesBoxes',
|
|
81
|
+
[
|
|
82
|
+
{
|
|
83
|
+
ResponseId: responseId1,
|
|
84
|
+
ChannelTypeId: null,
|
|
85
|
+
type: 'flow',
|
|
86
|
+
payload: JSON.stringify([
|
|
87
|
+
{
|
|
88
|
+
id: '',
|
|
89
|
+
type: 'text',
|
|
90
|
+
messages: [{ message: 'Passou por aqui <:$counter:> vezes' }],
|
|
91
|
+
},
|
|
92
|
+
]),
|
|
93
|
+
createdAt: Sequelize.literal('now()'),
|
|
94
|
+
updatedAt: Sequelize.literal('now()'),
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
{}
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
await queryInterface.bulkInsert('Response_DialogNodes', [
|
|
101
|
+
{
|
|
102
|
+
DialogNodeId: dialogNode1Id,
|
|
103
|
+
ResponseId: responseId1,
|
|
104
|
+
createdAt: Sequelize.literal('now()'),
|
|
105
|
+
updatedAt: Sequelize.literal('now()'),
|
|
106
|
+
},
|
|
107
|
+
])
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
down: async (queryInterface) => {
|
|
111
|
+
await queryInterface.bulkDelete('Response_DialogNodes', [
|
|
112
|
+
{ ResponseId: responseId1 },
|
|
113
|
+
])
|
|
114
|
+
await queryInterface.bulkDelete('ResponsesBoxes', [
|
|
115
|
+
{ ResponseId: responseId1 },
|
|
116
|
+
])
|
|
117
|
+
|
|
118
|
+
await queryInterface.bulkDelete('Responses', [{ id: responseId1 }])
|
|
119
|
+
await queryInterface.bulkDelete('DialogNodes', [{ SkillId }])
|
|
120
|
+
await queryInterface.bulkDelete('Skills', [{ id: SkillId }])
|
|
121
|
+
},
|
|
122
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
const fieldId_01 = '5922f551-bae1-4b68-9620-a6528d0ae5df'
|
|
2
|
+
const fieldId_02 = 'a7d4575b-7e87-47ba-8ff6-875ed52d9096'
|
|
3
|
+
const fieldId_03 = 'ced54171-485d-48f8-9d70-84c00e18e217'
|
|
4
|
+
const fieldId_04 = '43876185-284c-49e1-adda-041172941581'
|
|
5
|
+
const fieldId_05 = '034ac4fd-613c-41ff-b49c-ab14002df736'
|
|
6
|
+
const fieldId_06 = 'f2168bd7-10da-4461-8405-4feab0106d40'
|
|
7
|
+
const fieldId_07 = '97c51b4e-9a11-42ec-b1da-a90230b1f5a3'
|
|
8
|
+
const fieldId_08 = '84205460-b19a-4cdd-a002-fdb4685f5b4f'
|
|
9
|
+
const fieldId_09 = '01dc5344-8180-4597-8d51-4dc3d5624147'
|
|
10
|
+
const fieldId_10 = '1a4855f4-5098-40db-aa87-c6970f871da5'
|
|
11
|
+
|
|
12
|
+
module.exports = {
|
|
13
|
+
up: async (queryInterface, Sequelize) => {
|
|
14
|
+
const EnterpriseId = await queryInterface.rawSelect(
|
|
15
|
+
'Enterprises',
|
|
16
|
+
{ where: { cnpj: process.env.ENTERPRISE_CNPJ } },
|
|
17
|
+
['id']
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
await queryInterface.bulkInsert('Fields', [
|
|
21
|
+
{
|
|
22
|
+
id: fieldId_01,
|
|
23
|
+
fields: JSON.stringify({
|
|
24
|
+
code: 'nome_teste_01',
|
|
25
|
+
name: 'Nome Teste 01',
|
|
26
|
+
type: 'string',
|
|
27
|
+
}),
|
|
28
|
+
EnterpriseId,
|
|
29
|
+
createdAt: Sequelize.literal('now()'),
|
|
30
|
+
updatedAt: Sequelize.literal('now()'),
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: fieldId_02,
|
|
34
|
+
fields: JSON.stringify({
|
|
35
|
+
code: 'nome_teste_02',
|
|
36
|
+
name: 'Nome Teste 02',
|
|
37
|
+
type: 'string',
|
|
38
|
+
}),
|
|
39
|
+
EnterpriseId,
|
|
40
|
+
createdAt: Sequelize.literal('now()'),
|
|
41
|
+
updatedAt: Sequelize.literal('now()'),
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: fieldId_03,
|
|
45
|
+
fields: JSON.stringify({
|
|
46
|
+
code: 'nome_teste_03',
|
|
47
|
+
name: 'Nome Teste 03',
|
|
48
|
+
type: 'string',
|
|
49
|
+
}),
|
|
50
|
+
EnterpriseId,
|
|
51
|
+
createdAt: Sequelize.literal('now()'),
|
|
52
|
+
updatedAt: Sequelize.literal('now()'),
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: fieldId_04,
|
|
56
|
+
fields: JSON.stringify({
|
|
57
|
+
code: 'nome_teste_04',
|
|
58
|
+
name: 'Nome Teste 04',
|
|
59
|
+
type: 'string',
|
|
60
|
+
}),
|
|
61
|
+
EnterpriseId,
|
|
62
|
+
createdAt: Sequelize.literal('now()'),
|
|
63
|
+
updatedAt: Sequelize.literal('now()'),
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: fieldId_05,
|
|
67
|
+
fields: JSON.stringify({
|
|
68
|
+
code: 'nome_teste_05',
|
|
69
|
+
name: 'Nome Teste 05',
|
|
70
|
+
type: 'string',
|
|
71
|
+
}),
|
|
72
|
+
EnterpriseId,
|
|
73
|
+
createdAt: Sequelize.literal('now()'),
|
|
74
|
+
updatedAt: Sequelize.literal('now()'),
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: fieldId_06,
|
|
78
|
+
fields: JSON.stringify({
|
|
79
|
+
code: 'nome_teste_06',
|
|
80
|
+
name: 'Nome Teste 06',
|
|
81
|
+
type: 'string',
|
|
82
|
+
}),
|
|
83
|
+
EnterpriseId,
|
|
84
|
+
createdAt: Sequelize.literal('now()'),
|
|
85
|
+
updatedAt: Sequelize.literal('now()'),
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: fieldId_07,
|
|
89
|
+
fields: JSON.stringify({
|
|
90
|
+
code: 'nome_teste_07',
|
|
91
|
+
name: 'Nome Teste 07',
|
|
92
|
+
type: 'string',
|
|
93
|
+
}),
|
|
94
|
+
EnterpriseId,
|
|
95
|
+
createdAt: Sequelize.literal('now()'),
|
|
96
|
+
updatedAt: Sequelize.literal('now()'),
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
id: fieldId_08,
|
|
100
|
+
fields: JSON.stringify({
|
|
101
|
+
code: 'nome_teste_08',
|
|
102
|
+
name: 'Nome Teste 08',
|
|
103
|
+
type: 'string',
|
|
104
|
+
}),
|
|
105
|
+
EnterpriseId,
|
|
106
|
+
createdAt: Sequelize.literal('now()'),
|
|
107
|
+
updatedAt: Sequelize.literal('now()'),
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
id: fieldId_09,
|
|
111
|
+
fields: JSON.stringify({
|
|
112
|
+
code: 'nome_teste_09',
|
|
113
|
+
name: 'Nome Teste 09',
|
|
114
|
+
type: 'string',
|
|
115
|
+
}),
|
|
116
|
+
EnterpriseId,
|
|
117
|
+
createdAt: Sequelize.literal('now()'),
|
|
118
|
+
updatedAt: Sequelize.literal('now()'),
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
id: fieldId_10,
|
|
122
|
+
fields: JSON.stringify({
|
|
123
|
+
code: 'nome_teste_10',
|
|
124
|
+
name: 'Nome Teste 10',
|
|
125
|
+
type: 'string',
|
|
126
|
+
}),
|
|
127
|
+
EnterpriseId,
|
|
128
|
+
createdAt: Sequelize.literal('now()'),
|
|
129
|
+
updatedAt: Sequelize.literal('now()'),
|
|
130
|
+
},
|
|
131
|
+
])
|
|
132
|
+
},
|
|
133
|
+
|
|
134
|
+
down: async (queryInterface) => {
|
|
135
|
+
await queryInterface.bulkDelete('Fields', [
|
|
136
|
+
{
|
|
137
|
+
id: [
|
|
138
|
+
fieldId_01,
|
|
139
|
+
fieldId_02,
|
|
140
|
+
fieldId_03,
|
|
141
|
+
fieldId_04,
|
|
142
|
+
fieldId_05,
|
|
143
|
+
fieldId_06,
|
|
144
|
+
fieldId_07,
|
|
145
|
+
fieldId_08,
|
|
146
|
+
fieldId_09,
|
|
147
|
+
fieldId_10,
|
|
148
|
+
],
|
|
149
|
+
},
|
|
150
|
+
])
|
|
151
|
+
},
|
|
152
|
+
}
|