@itleanchatbot/shared-models-js-postgres 1.1.28 → 1.1.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.
- package/index.js +3 -1
- package/package.json +2 -1
- package/src/client.js +1 -1
- package/src/dialogNodes.js +17 -1
package/index.js
CHANGED
|
@@ -43,6 +43,7 @@ const dialogNodes_apiResources = require('./src/dialogNodes_apiResources')
|
|
|
43
43
|
const response_DialogNodes = require('./src/response_DialogNodes')
|
|
44
44
|
const responses = require('./src/responses')
|
|
45
45
|
const responsesBoxes = require('./src/responsesBoxes')
|
|
46
|
+
const client = require('./src/client')
|
|
46
47
|
|
|
47
48
|
module.exports = {
|
|
48
49
|
attendances,
|
|
@@ -89,5 +90,6 @@ module.exports = {
|
|
|
89
90
|
dialogNodes_apiResources,
|
|
90
91
|
response_DialogNodes,
|
|
91
92
|
responses,
|
|
92
|
-
responsesBoxes
|
|
93
|
+
responsesBoxes,
|
|
94
|
+
client
|
|
93
95
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itleanchatbot/shared-models-js-postgres",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.30",
|
|
4
4
|
"description": "Shared Models JS Postgres",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"license": "ISC",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"commitizen": {
|
|
21
21
|
"path": "./node_modules/cz-conventional-changelog"
|
|
22
22
|
}
|
|
23
|
+
|
|
23
24
|
},
|
|
24
25
|
"devDependencies": {
|
|
25
26
|
"@commitlint/cli": "^11.0.0",
|
package/src/client.js
CHANGED
package/src/dialogNodes.js
CHANGED
|
@@ -75,9 +75,25 @@ const DialogNodesModel = (sequelize, Sequelize) => {
|
|
|
75
75
|
defaultValue: true,
|
|
76
76
|
},
|
|
77
77
|
contexts: {
|
|
78
|
-
type: Sequelize.
|
|
78
|
+
type: Sequelize.TEXT,
|
|
79
79
|
allowNull: false,
|
|
80
80
|
defaultValue: [],
|
|
81
|
+
set(value, field) {
|
|
82
|
+
try {
|
|
83
|
+
const string = JSON.stringify(value.map(item => {
|
|
84
|
+
if(typeof string === 'object') {
|
|
85
|
+
return JSON.stringify(item)
|
|
86
|
+
} else {
|
|
87
|
+
return JSON.stringify({ error: 'Parse error' })
|
|
88
|
+
}
|
|
89
|
+
}))
|
|
90
|
+
|
|
91
|
+
this.setDataValue(field, string)
|
|
92
|
+
} catch (error) {
|
|
93
|
+
this.setDataValue(field, '')
|
|
94
|
+
console.error(error)
|
|
95
|
+
}
|
|
96
|
+
},
|
|
81
97
|
get(field) {
|
|
82
98
|
const value = this.getDataValue(field)
|
|
83
99
|
if (value.length) {
|