@hellotext/hellotext 2.3.0 → 2.3.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/dist/hellotext.js +1 -1
- package/lib/hellotext.cjs +7 -0
- package/lib/hellotext.js +13 -0
- package/package.json +1 -1
- package/src/hellotext.js +8 -0
package/lib/hellotext.cjs
CHANGED
|
@@ -89,6 +89,13 @@ let Hellotext = /*#__PURE__*/function () {
|
|
|
89
89
|
}, {
|
|
90
90
|
key: "identify",
|
|
91
91
|
value: async function identify(externalId, options = {}) {
|
|
92
|
+
if (_models.User.id === externalId) {
|
|
93
|
+
return new _api.Response(true, {
|
|
94
|
+
json: async () => {
|
|
95
|
+
already_identified: true;
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
92
99
|
const response = await _api.default.identifications.create({
|
|
93
100
|
user_id: externalId,
|
|
94
101
|
...options
|
package/lib/hellotext.js
CHANGED
|
@@ -94,6 +94,19 @@ var Hellotext = /*#__PURE__*/function () {
|
|
|
94
94
|
value: function () {
|
|
95
95
|
var _identify = _asyncToGenerator(function* (externalId) {
|
|
96
96
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
97
|
+
if (User.id === externalId) {
|
|
98
|
+
return new Response(true, {
|
|
99
|
+
json: function () {
|
|
100
|
+
var _json = _asyncToGenerator(function* () {
|
|
101
|
+
already_identified: true;
|
|
102
|
+
});
|
|
103
|
+
function json() {
|
|
104
|
+
return _json.apply(this, arguments);
|
|
105
|
+
}
|
|
106
|
+
return json;
|
|
107
|
+
}()
|
|
108
|
+
});
|
|
109
|
+
}
|
|
97
110
|
var response = yield API.identifications.create(_objectSpread({
|
|
98
111
|
user_id: externalId
|
|
99
112
|
}, options));
|
package/package.json
CHANGED
package/src/hellotext.js
CHANGED
|
@@ -83,6 +83,14 @@ class Hellotext {
|
|
|
83
83
|
* @returns {Promise<Response>}
|
|
84
84
|
*/
|
|
85
85
|
static async identify(externalId, options = {}) {
|
|
86
|
+
if (User.id === externalId) {
|
|
87
|
+
return new Response(true, {
|
|
88
|
+
json: async () => {
|
|
89
|
+
already_identified: true
|
|
90
|
+
},
|
|
91
|
+
})
|
|
92
|
+
}
|
|
93
|
+
|
|
86
94
|
const response = await API.identifications.create({
|
|
87
95
|
user_id: externalId,
|
|
88
96
|
...options,
|