@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,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
+ }