@engage_so/core 1.4.0 → 1.4.1
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 +6 -6
- package/package.json +2 -2
package/index.js
CHANGED
@@ -77,12 +77,12 @@ const identify = async (o) => {
|
|
77
77
|
if (o.email && !/^\S+@\S+$/.test(o.email)) {
|
78
78
|
throw new EngageError('Email invalid.')
|
79
79
|
}
|
80
|
-
const allowed = ['id', 'email', 'number', 'created_at', 'device_token', 'device_platform', 'first_name', 'last_name']
|
80
|
+
const allowed = ['id', 'is_group', 'email', 'number', 'created_at', 'device_token', 'device_platform', 'first_name', 'last_name']
|
81
81
|
const params = {
|
82
82
|
meta: {}
|
83
83
|
}
|
84
84
|
for (const k in o) {
|
85
|
-
if (allowed.
|
85
|
+
if (allowed.includes(k)) {
|
86
86
|
params[k] = o[k]
|
87
87
|
} else {
|
88
88
|
params.meta[k] = o[k]
|
@@ -102,13 +102,13 @@ const addAttribute = async (uid, data) => {
|
|
102
102
|
if (!Object.keys(data).length) {
|
103
103
|
throw new EngageError('Attributes missing.')
|
104
104
|
}
|
105
|
-
const notMeta = ['created_at', 'number', 'device_token', 'device_platform', 'email', 'first_name', 'last_name']
|
105
|
+
const notMeta = ['created_at', 'is_group', 'number', 'device_token', 'device_platform', 'email', 'first_name', 'last_name']
|
106
106
|
const params = { meta: {} }
|
107
107
|
for (const k in data) {
|
108
|
-
if (notMeta.
|
109
|
-
params.meta[k] = data[k]
|
110
|
-
} else {
|
108
|
+
if (notMeta.includes(k)) {
|
111
109
|
params[k] = data[k]
|
110
|
+
} else {
|
111
|
+
params.meta[k] = data[k]
|
112
112
|
}
|
113
113
|
}
|
114
114
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@engage_so/core",
|
3
|
-
"version": "1.4.
|
3
|
+
"version": "1.4.1",
|
4
4
|
"description": "Event driven customer segmentation and targeted engagement.",
|
5
5
|
"main": "index.js",
|
6
6
|
"scripts": {
|
@@ -18,5 +18,5 @@
|
|
18
18
|
"devDependencies": {
|
19
19
|
"jest": "^26.4.2"
|
20
20
|
},
|
21
|
-
"gitHead": "
|
21
|
+
"gitHead": "7fc22abf94ef02987964ecfb6c3871314e42f922"
|
22
22
|
}
|