@hellotext/hellotext 1.8.7 → 2.0.0
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/api/businesses.cjs +37 -0
- package/lib/api/businesses.js +3 -9
- package/lib/api/events.cjs +45 -0
- package/lib/api/events.js +8 -14
- package/lib/api/forms.cjs +51 -0
- package/lib/api/forms.js +10 -17
- package/lib/api/index.cjs +51 -0
- package/lib/api/index.js +10 -23
- package/lib/api/response.cjs +76 -0
- package/lib/api/response.js +1 -7
- package/lib/api/submissions.cjs +47 -0
- package/lib/api/submissions.js +9 -17
- package/lib/api/webchat/messages.cjs +70 -0
- package/lib/api/webchat/messages.js +10 -18
- package/lib/api/webchats.cjs +44 -0
- package/lib/api/webchats.js +8 -16
- package/lib/builders/input_builder.cjs +61 -0
- package/lib/builders/input_builder.js +4 -11
- package/lib/builders/logo_builder.cjs +50 -0
- package/lib/builders/logo_builder.js +5 -12
- package/lib/channels/application_channel.cjs +67 -0
- package/lib/channels/application_channel.js +1 -8
- package/lib/channels/{web_chat_channel.js → webchat_channel.cjs} +35 -20
- package/lib/channels/webchat_channel.js +3 -11
- package/lib/controllers/form_controller.cjs +141 -0
- package/lib/controllers/form_controller.js +15 -22
- package/lib/controllers/mixins/usePopover.cjs +59 -0
- package/lib/controllers/mixins/usePopover.js +6 -14
- package/lib/controllers/{web_chat/pagination_controller.js → webchat/emoji_picker_controller.cjs} +74 -29
- package/lib/controllers/webchat/emoji_picker_controller.js +11 -17
- package/lib/controllers/webchat_controller.cjs +433 -0
- package/lib/controllers/webchat_controller.js +49 -51
- package/lib/core/configuration/forms.cjs +49 -0
- package/lib/core/configuration/forms.js +2 -8
- package/lib/core/configuration/{web_chat.js → webchat.cjs} +53 -38
- package/lib/core/configuration/webchat.js +2 -9
- package/lib/core/configuration.cjs +65 -0
- package/lib/core/configuration.js +8 -13
- package/lib/core/event.cjs +71 -0
- package/lib/core/event.js +5 -11
- package/lib/core/index.cjs +20 -0
- package/lib/core/index.js +2 -20
- package/lib/errors/index.cjs +19 -0
- package/lib/errors/index.js +2 -19
- package/lib/errors/invalid_event.cjs +34 -0
- package/lib/errors/invalid_event.js +1 -7
- package/lib/errors/not_initialized_error.cjs +34 -0
- package/lib/errors/not_initialized_error.js +1 -7
- package/lib/hellotext.cjs +152 -0
- package/lib/hellotext.js +18 -27
- package/lib/index.cjs +20 -0
- package/lib/index.js +12 -20
- package/lib/locales/en.cjs +22 -0
- package/lib/locales/en.js +2 -9
- package/lib/locales/es.cjs +22 -0
- package/lib/locales/es.js +2 -9
- package/lib/locales/index.cjs +14 -0
- package/lib/locales/index.js +6 -14
- package/lib/models/business.cjs +65 -0
- package/lib/models/business.js +5 -12
- package/lib/models/cookies.cjs +40 -0
- package/lib/models/cookies.js +3 -10
- package/lib/models/form.cjs +166 -0
- package/lib/models/form.js +10 -17
- package/lib/models/form_collection.cjs +119 -0
- package/lib/models/form_collection.js +15 -22
- package/lib/models/index.cjs +54 -0
- package/lib/models/index.js +7 -54
- package/lib/models/query.cjs +51 -0
- package/lib/models/query.js +3 -9
- package/lib/models/session.cjs +58 -0
- package/lib/models/session.js +12 -17
- package/lib/models/{web_chat.js → webchat.cjs} +14 -22
- package/lib/models/webchat.js +6 -13
- package/lib/vanilla.cjs +13 -0
- package/lib/vanilla.js +1 -13
- package/package.json +34 -7
- package/src/controllers/webchat_controller.js +72 -47
- package/src/hellotext.js +3 -4
- package/src/models/session.js +4 -3
- package/.babelrc +0 -24
- package/.github/workflows/ci.yml +0 -24
- package/.prettierignore +0 -3
- package/.prettierrc.json +0 -18
- package/MIT-LICENSE +0 -20
- package/__tests__/builders/input_builder_test.js +0 -117
- package/__tests__/core/configuration/forms_test.js +0 -30
- package/__tests__/core/configuration/webchat_test.js +0 -163
- package/__tests__/core/configuration_test.js +0 -28
- package/__tests__/core/event_test.js +0 -56
- package/__tests__/hellotext_test.js +0 -197
- package/__tests__/models/business_test.js +0 -26
- package/__tests__/models/cookies_test.js +0 -25
- package/__tests__/models/form_collection_test.js +0 -103
- package/__tests__/models/form_test.js +0 -131
- package/__tests__/models/query_test.js +0 -97
- package/docs/forms.md +0 -176
- package/docs/tracking.md +0 -203
- package/docs/webchat.md +0 -101
- package/jest.config.js +0 -4
- package/jest.setup.js +0 -16
- package/lib/api/web_chat/messages.js +0 -74
- package/lib/api/web_chats.js +0 -53
- package/styles/index.css +0 -38
- package/webpack.config.js +0 -24
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _core = require("../core");
|
|
8
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
9
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
10
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
11
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
12
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
13
|
+
let _default = /*#__PURE__*/function () {
|
|
14
|
+
function _default() {
|
|
15
|
+
_classCallCheck(this, _default);
|
|
16
|
+
}
|
|
17
|
+
_createClass(_default, null, [{
|
|
18
|
+
key: "endpoint",
|
|
19
|
+
get: function () {
|
|
20
|
+
return _core.Configuration.endpoint('public/businesses');
|
|
21
|
+
}
|
|
22
|
+
}, {
|
|
23
|
+
key: "get",
|
|
24
|
+
value: async function get(id) {
|
|
25
|
+
return fetch(`${this.endpoint}/${id}`, {
|
|
26
|
+
method: 'GET',
|
|
27
|
+
headers: {
|
|
28
|
+
Authorization: `Bearer ${id}`,
|
|
29
|
+
Accept: 'application/json',
|
|
30
|
+
'Content-Type': 'application/json'
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}]);
|
|
35
|
+
return _default;
|
|
36
|
+
}();
|
|
37
|
+
exports.default = _default;
|
package/lib/api/businesses.js
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _core = require("../core");
|
|
8
1
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
9
2
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
10
3
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -12,6 +5,7 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
12
5
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
13
6
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
14
7
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
+
import { Configuration } from '../core';
|
|
15
9
|
var _default = /*#__PURE__*/function () {
|
|
16
10
|
function _default() {
|
|
17
11
|
_classCallCheck(this, _default);
|
|
@@ -19,7 +13,7 @@ var _default = /*#__PURE__*/function () {
|
|
|
19
13
|
_createClass(_default, null, [{
|
|
20
14
|
key: "endpoint",
|
|
21
15
|
get: function get() {
|
|
22
|
-
return
|
|
16
|
+
return Configuration.endpoint('public/businesses');
|
|
23
17
|
}
|
|
24
18
|
}, {
|
|
25
19
|
key: "get",
|
|
@@ -42,4 +36,4 @@ var _default = /*#__PURE__*/function () {
|
|
|
42
36
|
}]);
|
|
43
37
|
return _default;
|
|
44
38
|
}();
|
|
45
|
-
|
|
39
|
+
export { _default as default };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _core = require("../core");
|
|
8
|
+
var _models = require("../models");
|
|
9
|
+
var _response = require("./response");
|
|
10
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
11
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
12
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
13
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
14
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
15
|
+
let EventsAPI = /*#__PURE__*/function () {
|
|
16
|
+
function EventsAPI() {
|
|
17
|
+
_classCallCheck(this, EventsAPI);
|
|
18
|
+
}
|
|
19
|
+
_createClass(EventsAPI, null, [{
|
|
20
|
+
key: "endpoint",
|
|
21
|
+
get: function () {
|
|
22
|
+
return _core.Configuration.endpoint('track/events');
|
|
23
|
+
}
|
|
24
|
+
}, {
|
|
25
|
+
key: "create",
|
|
26
|
+
value: async function create({
|
|
27
|
+
headers,
|
|
28
|
+
body
|
|
29
|
+
}) {
|
|
30
|
+
if (_models.Query.inPreviewMode) {
|
|
31
|
+
return new _response.Response(true, {
|
|
32
|
+
received: true
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
const response = await fetch(this.endpoint, {
|
|
36
|
+
method: 'POST',
|
|
37
|
+
headers,
|
|
38
|
+
body: JSON.stringify(body)
|
|
39
|
+
});
|
|
40
|
+
return new _response.Response(response.status === 200, await response.json());
|
|
41
|
+
}
|
|
42
|
+
}]);
|
|
43
|
+
return EventsAPI;
|
|
44
|
+
}();
|
|
45
|
+
exports.default = EventsAPI;
|
package/lib/api/events.js
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _core = require("../core");
|
|
8
|
-
var _models = require("../models");
|
|
9
|
-
var _response = require("./response");
|
|
10
1
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
11
2
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
12
3
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -14,6 +5,9 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
14
5
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
15
6
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
16
7
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
+
import { Configuration } from '../core';
|
|
9
|
+
import { Query } from '../models';
|
|
10
|
+
import { Response } from './response';
|
|
17
11
|
var EventsAPI = /*#__PURE__*/function () {
|
|
18
12
|
function EventsAPI() {
|
|
19
13
|
_classCallCheck(this, EventsAPI);
|
|
@@ -21,7 +15,7 @@ var EventsAPI = /*#__PURE__*/function () {
|
|
|
21
15
|
_createClass(EventsAPI, null, [{
|
|
22
16
|
key: "endpoint",
|
|
23
17
|
get: function get() {
|
|
24
|
-
return
|
|
18
|
+
return Configuration.endpoint('track/events');
|
|
25
19
|
}
|
|
26
20
|
}, {
|
|
27
21
|
key: "create",
|
|
@@ -31,8 +25,8 @@ var EventsAPI = /*#__PURE__*/function () {
|
|
|
31
25
|
headers,
|
|
32
26
|
body
|
|
33
27
|
} = _ref;
|
|
34
|
-
if (
|
|
35
|
-
return new
|
|
28
|
+
if (Query.inPreviewMode) {
|
|
29
|
+
return new Response(true, {
|
|
36
30
|
received: true
|
|
37
31
|
});
|
|
38
32
|
}
|
|
@@ -41,7 +35,7 @@ var EventsAPI = /*#__PURE__*/function () {
|
|
|
41
35
|
headers,
|
|
42
36
|
body: JSON.stringify(body)
|
|
43
37
|
});
|
|
44
|
-
return new
|
|
38
|
+
return new Response(response.status === 200, yield response.json());
|
|
45
39
|
});
|
|
46
40
|
function create(_x) {
|
|
47
41
|
return _create.apply(this, arguments);
|
|
@@ -51,4 +45,4 @@ var EventsAPI = /*#__PURE__*/function () {
|
|
|
51
45
|
}]);
|
|
52
46
|
return EventsAPI;
|
|
53
47
|
}();
|
|
54
|
-
|
|
48
|
+
export { EventsAPI as default };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _hellotext = _interopRequireDefault(require("../hellotext"));
|
|
8
|
+
var _core = require("../core");
|
|
9
|
+
var _response = require("./response");
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
12
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
13
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
14
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
15
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
16
|
+
let FormsAPI = /*#__PURE__*/function () {
|
|
17
|
+
function FormsAPI() {
|
|
18
|
+
_classCallCheck(this, FormsAPI);
|
|
19
|
+
}
|
|
20
|
+
_createClass(FormsAPI, null, [{
|
|
21
|
+
key: "endpoint",
|
|
22
|
+
get: function () {
|
|
23
|
+
return _core.Configuration.endpoint('public/forms');
|
|
24
|
+
}
|
|
25
|
+
}, {
|
|
26
|
+
key: "get",
|
|
27
|
+
value: async function get(id) {
|
|
28
|
+
const url = new URL(`${this.endpoint}/${id}`);
|
|
29
|
+
url.searchParams.append('session', _hellotext.default.session);
|
|
30
|
+
return fetch(url, {
|
|
31
|
+
method: 'GET',
|
|
32
|
+
headers: _hellotext.default.headers
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}, {
|
|
36
|
+
key: "submit",
|
|
37
|
+
value: async function submit(id, data) {
|
|
38
|
+
const response = await fetch(`${this.endpoint}/${id}/submissions`, {
|
|
39
|
+
method: 'POST',
|
|
40
|
+
headers: _hellotext.default.headers,
|
|
41
|
+
body: JSON.stringify({
|
|
42
|
+
session: _hellotext.default.session,
|
|
43
|
+
...data
|
|
44
|
+
})
|
|
45
|
+
});
|
|
46
|
+
return new _response.Response(response.ok, response);
|
|
47
|
+
}
|
|
48
|
+
}]);
|
|
49
|
+
return FormsAPI;
|
|
50
|
+
}();
|
|
51
|
+
exports.default = FormsAPI;
|
package/lib/api/forms.js
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _hellotext = _interopRequireDefault(require("../hellotext"));
|
|
8
|
-
var _core = require("../core");
|
|
9
|
-
var _response = require("./response");
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
1
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12
2
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
3
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -18,6 +8,9 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
18
8
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
19
9
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
20
10
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
11
|
+
import Hellotext from '../hellotext';
|
|
12
|
+
import { Configuration } from '../core';
|
|
13
|
+
import { Response } from './response';
|
|
21
14
|
var FormsAPI = /*#__PURE__*/function () {
|
|
22
15
|
function FormsAPI() {
|
|
23
16
|
_classCallCheck(this, FormsAPI);
|
|
@@ -25,17 +18,17 @@ var FormsAPI = /*#__PURE__*/function () {
|
|
|
25
18
|
_createClass(FormsAPI, null, [{
|
|
26
19
|
key: "endpoint",
|
|
27
20
|
get: function get() {
|
|
28
|
-
return
|
|
21
|
+
return Configuration.endpoint('public/forms');
|
|
29
22
|
}
|
|
30
23
|
}, {
|
|
31
24
|
key: "get",
|
|
32
25
|
value: function () {
|
|
33
26
|
var _get = _asyncToGenerator(function* (id) {
|
|
34
27
|
var url = new URL("".concat(this.endpoint, "/").concat(id));
|
|
35
|
-
url.searchParams.append('session',
|
|
28
|
+
url.searchParams.append('session', Hellotext.session);
|
|
36
29
|
return fetch(url, {
|
|
37
30
|
method: 'GET',
|
|
38
|
-
headers:
|
|
31
|
+
headers: Hellotext.headers
|
|
39
32
|
});
|
|
40
33
|
});
|
|
41
34
|
function get(_x) {
|
|
@@ -49,12 +42,12 @@ var FormsAPI = /*#__PURE__*/function () {
|
|
|
49
42
|
var _submit = _asyncToGenerator(function* (id, data) {
|
|
50
43
|
var response = yield fetch("".concat(this.endpoint, "/").concat(id, "/submissions"), {
|
|
51
44
|
method: 'POST',
|
|
52
|
-
headers:
|
|
45
|
+
headers: Hellotext.headers,
|
|
53
46
|
body: JSON.stringify(_objectSpread({
|
|
54
|
-
session:
|
|
47
|
+
session: Hellotext.session
|
|
55
48
|
}, data))
|
|
56
49
|
});
|
|
57
|
-
return new
|
|
50
|
+
return new Response(response.ok, response);
|
|
58
51
|
});
|
|
59
52
|
function submit(_x2, _x3) {
|
|
60
53
|
return _submit.apply(this, arguments);
|
|
@@ -64,4 +57,4 @@ var FormsAPI = /*#__PURE__*/function () {
|
|
|
64
57
|
}]);
|
|
65
58
|
return FormsAPI;
|
|
66
59
|
}();
|
|
67
|
-
|
|
60
|
+
export { FormsAPI as default };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Response", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _response.Response;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
exports.default = void 0;
|
|
13
|
+
var _businesses = _interopRequireDefault(require("./businesses"));
|
|
14
|
+
var _events = _interopRequireDefault(require("./events"));
|
|
15
|
+
var _forms = _interopRequireDefault(require("./forms"));
|
|
16
|
+
var _webchats = _interopRequireDefault(require("./webchats"));
|
|
17
|
+
var _response = require("./response");
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
20
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
21
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
22
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
23
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
24
|
+
let API = /*#__PURE__*/function () {
|
|
25
|
+
function API() {
|
|
26
|
+
_classCallCheck(this, API);
|
|
27
|
+
}
|
|
28
|
+
_createClass(API, null, [{
|
|
29
|
+
key: "businesses",
|
|
30
|
+
get: function () {
|
|
31
|
+
return _businesses.default;
|
|
32
|
+
}
|
|
33
|
+
}, {
|
|
34
|
+
key: "events",
|
|
35
|
+
get: function () {
|
|
36
|
+
return _events.default;
|
|
37
|
+
}
|
|
38
|
+
}, {
|
|
39
|
+
key: "forms",
|
|
40
|
+
get: function () {
|
|
41
|
+
return _forms.default;
|
|
42
|
+
}
|
|
43
|
+
}, {
|
|
44
|
+
key: "webchats",
|
|
45
|
+
get: function () {
|
|
46
|
+
return _webchats.default;
|
|
47
|
+
}
|
|
48
|
+
}]);
|
|
49
|
+
return API;
|
|
50
|
+
}();
|
|
51
|
+
exports.default = API;
|
package/lib/api/index.js
CHANGED
|
@@ -1,26 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "Response", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _response.Response;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
exports.default = void 0;
|
|
13
|
-
var _businesses = _interopRequireDefault(require("./businesses"));
|
|
14
|
-
var _events = _interopRequireDefault(require("./events"));
|
|
15
|
-
var _forms = _interopRequireDefault(require("./forms"));
|
|
16
|
-
var _webchats = _interopRequireDefault(require("./webchats"));
|
|
17
|
-
var _response = require("./response");
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
1
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
20
2
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
21
3
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
22
4
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
23
5
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
6
|
+
import BusinessesAPI from './businesses';
|
|
7
|
+
import EventsAPI from './events';
|
|
8
|
+
import FormsAPI from './forms';
|
|
9
|
+
import WebchatsAPI from './webchats';
|
|
24
10
|
var API = /*#__PURE__*/function () {
|
|
25
11
|
function API() {
|
|
26
12
|
_classCallCheck(this, API);
|
|
@@ -28,24 +14,25 @@ var API = /*#__PURE__*/function () {
|
|
|
28
14
|
_createClass(API, null, [{
|
|
29
15
|
key: "businesses",
|
|
30
16
|
get: function get() {
|
|
31
|
-
return
|
|
17
|
+
return BusinessesAPI;
|
|
32
18
|
}
|
|
33
19
|
}, {
|
|
34
20
|
key: "events",
|
|
35
21
|
get: function get() {
|
|
36
|
-
return
|
|
22
|
+
return EventsAPI;
|
|
37
23
|
}
|
|
38
24
|
}, {
|
|
39
25
|
key: "forms",
|
|
40
26
|
get: function get() {
|
|
41
|
-
return
|
|
27
|
+
return FormsAPI;
|
|
42
28
|
}
|
|
43
29
|
}, {
|
|
44
30
|
key: "webchats",
|
|
45
31
|
get: function get() {
|
|
46
|
-
return
|
|
32
|
+
return WebchatsAPI;
|
|
47
33
|
}
|
|
48
34
|
}]);
|
|
49
35
|
return API;
|
|
50
36
|
}();
|
|
51
|
-
|
|
37
|
+
export { API as default };
|
|
38
|
+
export { Response } from './response';
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Response = void 0;
|
|
7
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
9
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
10
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
11
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
12
|
+
function _classPrivateFieldLooseBase(receiver, privateKey) { if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { throw new TypeError("attempted to use private field on non-instance"); } return receiver; }
|
|
13
|
+
var id = 0;
|
|
14
|
+
function _classPrivateFieldLooseKey(name) { return "__private_" + id++ + "_" + name; }
|
|
15
|
+
var _success = /*#__PURE__*/_classPrivateFieldLooseKey("success");
|
|
16
|
+
/**
|
|
17
|
+
* Response class
|
|
18
|
+
* @class
|
|
19
|
+
* @classdesc Represents a response from the API
|
|
20
|
+
* @property {Boolean} succeeded
|
|
21
|
+
* @property {Object} data
|
|
22
|
+
*/
|
|
23
|
+
let Response = /*#__PURE__*/function () {
|
|
24
|
+
function Response(success, response) {
|
|
25
|
+
_classCallCheck(this, Response);
|
|
26
|
+
Object.defineProperty(this, _success, {
|
|
27
|
+
writable: true,
|
|
28
|
+
value: void 0
|
|
29
|
+
});
|
|
30
|
+
this.response = response;
|
|
31
|
+
_classPrivateFieldLooseBase(this, _success)[_success] = success;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Get the response data
|
|
36
|
+
* @returns {*}
|
|
37
|
+
*/
|
|
38
|
+
_createClass(Response, [{
|
|
39
|
+
key: "data",
|
|
40
|
+
get: function () {
|
|
41
|
+
return this.response;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Parse the response as JSON
|
|
46
|
+
* @returns {Promise<*>}
|
|
47
|
+
*/
|
|
48
|
+
}, {
|
|
49
|
+
key: "json",
|
|
50
|
+
value: async function json() {
|
|
51
|
+
return await this.response.json();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Has the request failed?
|
|
56
|
+
* @returns {boolean}
|
|
57
|
+
*/
|
|
58
|
+
}, {
|
|
59
|
+
key: "failed",
|
|
60
|
+
get: function () {
|
|
61
|
+
return _classPrivateFieldLooseBase(this, _success)[_success] === false;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Has the request succeeded?
|
|
66
|
+
* @returns {boolean}
|
|
67
|
+
*/
|
|
68
|
+
}, {
|
|
69
|
+
key: "succeeded",
|
|
70
|
+
get: function () {
|
|
71
|
+
return _classPrivateFieldLooseBase(this, _success)[_success] === true;
|
|
72
|
+
}
|
|
73
|
+
}]);
|
|
74
|
+
return Response;
|
|
75
|
+
}();
|
|
76
|
+
exports.Response = Response;
|
package/lib/api/response.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Response = void 0;
|
|
7
1
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
8
2
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
9
3
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -80,4 +74,4 @@ var Response = /*#__PURE__*/function () {
|
|
|
80
74
|
}]);
|
|
81
75
|
return Response;
|
|
82
76
|
}();
|
|
83
|
-
|
|
77
|
+
export { Response };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _hellotext = _interopRequireDefault(require("../hellotext"));
|
|
8
|
+
var _core = require("../core");
|
|
9
|
+
var _response = require("./response");
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
12
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
13
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
14
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
15
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
16
|
+
let SubmissionsAPI = /*#__PURE__*/function () {
|
|
17
|
+
function SubmissionsAPI() {
|
|
18
|
+
_classCallCheck(this, SubmissionsAPI);
|
|
19
|
+
}
|
|
20
|
+
_createClass(SubmissionsAPI, null, [{
|
|
21
|
+
key: "endpoint",
|
|
22
|
+
get: function () {
|
|
23
|
+
return _core.Configuration.endpoint('public/submissions');
|
|
24
|
+
}
|
|
25
|
+
}, {
|
|
26
|
+
key: "resendOTP",
|
|
27
|
+
value: async function resendOTP(id) {
|
|
28
|
+
const response = await fetch(`${this.endpoint}/${id}/otps`, {
|
|
29
|
+
method: 'POST',
|
|
30
|
+
headers: _hellotext.default.headers
|
|
31
|
+
});
|
|
32
|
+
return new _response.Response(response.ok, response);
|
|
33
|
+
}
|
|
34
|
+
}, {
|
|
35
|
+
key: "verifyOTP",
|
|
36
|
+
value: async function verifyOTP(id, otp) {
|
|
37
|
+
const response = await fetch(`${this.endpoint}/${id}/otps/${otp}/verify`, {
|
|
38
|
+
method: 'POST',
|
|
39
|
+
headers: _hellotext.default.headers
|
|
40
|
+
});
|
|
41
|
+
return new _response.Response(response.ok, response);
|
|
42
|
+
}
|
|
43
|
+
}]);
|
|
44
|
+
return SubmissionsAPI;
|
|
45
|
+
}();
|
|
46
|
+
var _default = SubmissionsAPI;
|
|
47
|
+
exports.default = _default;
|
package/lib/api/submissions.js
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _hellotext = _interopRequireDefault(require("../hellotext"));
|
|
8
|
-
var _core = require("../core");
|
|
9
|
-
var _response = require("./response");
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
1
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
12
2
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
13
3
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -15,6 +5,9 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
15
5
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
16
6
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
17
7
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
+
import Hellotext from '../hellotext';
|
|
9
|
+
import { Configuration } from '../core';
|
|
10
|
+
import { Response } from './response';
|
|
18
11
|
var SubmissionsAPI = /*#__PURE__*/function () {
|
|
19
12
|
function SubmissionsAPI() {
|
|
20
13
|
_classCallCheck(this, SubmissionsAPI);
|
|
@@ -22,7 +15,7 @@ var SubmissionsAPI = /*#__PURE__*/function () {
|
|
|
22
15
|
_createClass(SubmissionsAPI, null, [{
|
|
23
16
|
key: "endpoint",
|
|
24
17
|
get: function get() {
|
|
25
|
-
return
|
|
18
|
+
return Configuration.endpoint('public/submissions');
|
|
26
19
|
}
|
|
27
20
|
}, {
|
|
28
21
|
key: "resendOTP",
|
|
@@ -30,9 +23,9 @@ var SubmissionsAPI = /*#__PURE__*/function () {
|
|
|
30
23
|
var _resendOTP = _asyncToGenerator(function* (id) {
|
|
31
24
|
var response = yield fetch("".concat(this.endpoint, "/").concat(id, "/otps"), {
|
|
32
25
|
method: 'POST',
|
|
33
|
-
headers:
|
|
26
|
+
headers: Hellotext.headers
|
|
34
27
|
});
|
|
35
|
-
return new
|
|
28
|
+
return new Response(response.ok, response);
|
|
36
29
|
});
|
|
37
30
|
function resendOTP(_x) {
|
|
38
31
|
return _resendOTP.apply(this, arguments);
|
|
@@ -45,9 +38,9 @@ var SubmissionsAPI = /*#__PURE__*/function () {
|
|
|
45
38
|
var _verifyOTP = _asyncToGenerator(function* (id, otp) {
|
|
46
39
|
var response = yield fetch("".concat(this.endpoint, "/").concat(id, "/otps/").concat(otp, "/verify"), {
|
|
47
40
|
method: 'POST',
|
|
48
|
-
headers:
|
|
41
|
+
headers: Hellotext.headers
|
|
49
42
|
});
|
|
50
|
-
return new
|
|
43
|
+
return new Response(response.ok, response);
|
|
51
44
|
});
|
|
52
45
|
function verifyOTP(_x2, _x3) {
|
|
53
46
|
return _verifyOTP.apply(this, arguments);
|
|
@@ -57,5 +50,4 @@ var SubmissionsAPI = /*#__PURE__*/function () {
|
|
|
57
50
|
}]);
|
|
58
51
|
return SubmissionsAPI;
|
|
59
52
|
}();
|
|
60
|
-
|
|
61
|
-
exports.default = _default;
|
|
53
|
+
export default SubmissionsAPI;
|