@bentonow/bento-node-sdk 0.1.13 → 0.2.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/README.md +39 -2
- package/dist/bento-node-sdk.cjs.development.js +321 -332
- package/dist/bento-node-sdk.cjs.development.js.map +1 -1
- package/dist/bento-node-sdk.cjs.production.min.js +1 -1
- package/dist/bento-node-sdk.cjs.production.min.js.map +1 -1
- package/dist/bento-node-sdk.esm.js +321 -332
- package/dist/bento-node-sdk.esm.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/sdk/batch/errors.d.ts +10 -0
- package/dist/sdk/batch/events.d.ts +71 -0
- package/dist/sdk/batch/index.d.ts +19 -3
- package/dist/sdk/batch/types.d.ts +37 -0
- package/dist/sdk/client/errors.d.ts +2 -0
- package/dist/sdk/client/index.d.ts +3 -3
- package/dist/sdk/client/types.d.ts +3 -0
- package/dist/sdk/commands/index.d.ts +3 -3
- package/dist/sdk/commands/types.d.ts +32 -0
- package/dist/sdk/experimental/index.d.ts +3 -3
- package/dist/sdk/experimental/types.d.ts +41 -0
- package/dist/sdk/fields/index.d.ts +2 -2
- package/dist/sdk/fields/types.d.ts +17 -0
- package/dist/sdk/forms/index.d.ts +2 -2
- package/dist/sdk/forms/types.d.ts +28 -0
- package/dist/sdk/interfaces.d.ts +13 -0
- package/dist/sdk/subscribers/index.d.ts +2 -2
- package/dist/sdk/subscribers/types.d.ts +25 -0
- package/dist/sdk/tags/index.d.ts +2 -2
- package/dist/sdk/tags/types.d.ts +17 -0
- package/dist/sdk/types.d.ts +41 -0
- package/dist/versions/v1/index.d.ts +4 -4
- package/dist/versions/v1/types.d.ts +31 -0
- package/package.json +5 -9
- package/src/index.ts +2 -2
- package/src/sdk/batch/errors.ts +41 -4
- package/src/sdk/batch/{events.d.ts → events.ts} +4 -5
- package/src/sdk/batch/index.ts +75 -46
- package/src/sdk/batch/types.ts +44 -0
- package/src/sdk/client/errors.ts +13 -2
- package/src/sdk/client/index.ts +21 -15
- package/src/sdk/client/{types.d.ts → types.ts} +0 -0
- package/src/sdk/commands/index.ts +93 -121
- package/src/sdk/commands/{types.d.ts → types.ts} +1 -1
- package/src/sdk/experimental/index.ts +29 -45
- package/src/sdk/experimental/{types.d.ts → types.ts} +1 -1
- package/src/sdk/fields/index.ts +11 -19
- package/src/sdk/fields/{types.d.ts → types.ts} +1 -1
- package/src/sdk/forms/index.ts +11 -15
- package/src/sdk/forms/{types.d.ts → types.ts} +3 -3
- package/src/sdk/{interfaces.d.ts → interfaces.ts} +0 -0
- package/src/sdk/subscribers/index.ts +17 -25
- package/src/sdk/subscribers/{types.d.ts → types.ts} +1 -1
- package/src/sdk/tags/index.ts +11 -19
- package/src/sdk/tags/{types.d.ts → types.ts} +1 -1
- package/src/sdk/{types.d.ts → types.ts} +2 -0
- package/src/versions/v1/index.ts +65 -86
- package/src/versions/v1/{types.d.ts → types.ts} +4 -2
- package/src/sdk/batch/types.d.ts +0 -25
|
@@ -908,8 +908,16 @@ try {
|
|
|
908
908
|
var TooFewSubscribersError = /*#__PURE__*/function (_Error) {
|
|
909
909
|
_inheritsLoose(TooFewSubscribersError, _Error);
|
|
910
910
|
|
|
911
|
-
function TooFewSubscribersError() {
|
|
912
|
-
|
|
911
|
+
function TooFewSubscribersError(message) {
|
|
912
|
+
var _this;
|
|
913
|
+
|
|
914
|
+
if (message === void 0) {
|
|
915
|
+
message = 'Too few subscribers';
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
_this = _Error.call(this, message) || this;
|
|
919
|
+
_this.name = 'TooFewSubscribersError';
|
|
920
|
+
return _this;
|
|
913
921
|
}
|
|
914
922
|
|
|
915
923
|
return TooFewSubscribersError;
|
|
@@ -917,8 +925,16 @@ var TooFewSubscribersError = /*#__PURE__*/function (_Error) {
|
|
|
917
925
|
var TooManySubscribersError = /*#__PURE__*/function (_Error2) {
|
|
918
926
|
_inheritsLoose(TooManySubscribersError, _Error2);
|
|
919
927
|
|
|
920
|
-
function TooManySubscribersError() {
|
|
921
|
-
|
|
928
|
+
function TooManySubscribersError(message) {
|
|
929
|
+
var _this2;
|
|
930
|
+
|
|
931
|
+
if (message === void 0) {
|
|
932
|
+
message = 'Too many subscribers';
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
_this2 = _Error2.call(this, message) || this;
|
|
936
|
+
_this2.name = 'TooManySubscribersError';
|
|
937
|
+
return _this2;
|
|
922
938
|
}
|
|
923
939
|
|
|
924
940
|
return TooManySubscribersError;
|
|
@@ -926,8 +942,16 @@ var TooManySubscribersError = /*#__PURE__*/function (_Error2) {
|
|
|
926
942
|
var TooFewEventsError = /*#__PURE__*/function (_Error3) {
|
|
927
943
|
_inheritsLoose(TooFewEventsError, _Error3);
|
|
928
944
|
|
|
929
|
-
function TooFewEventsError() {
|
|
930
|
-
|
|
945
|
+
function TooFewEventsError(message) {
|
|
946
|
+
var _this3;
|
|
947
|
+
|
|
948
|
+
if (message === void 0) {
|
|
949
|
+
message = 'Too few events';
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
_this3 = _Error3.call(this, message) || this;
|
|
953
|
+
_this3.name = 'TooFewEventsError';
|
|
954
|
+
return _this3;
|
|
931
955
|
}
|
|
932
956
|
|
|
933
957
|
return TooFewEventsError;
|
|
@@ -935,16 +959,59 @@ var TooFewEventsError = /*#__PURE__*/function (_Error3) {
|
|
|
935
959
|
var TooManyEventsError = /*#__PURE__*/function (_Error4) {
|
|
936
960
|
_inheritsLoose(TooManyEventsError, _Error4);
|
|
937
961
|
|
|
938
|
-
function TooManyEventsError() {
|
|
939
|
-
|
|
962
|
+
function TooManyEventsError(message) {
|
|
963
|
+
var _this4;
|
|
964
|
+
|
|
965
|
+
if (message === void 0) {
|
|
966
|
+
message = 'Too many events';
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
_this4 = _Error4.call(this, message) || this;
|
|
970
|
+
_this4.name = 'TooManyEventsError';
|
|
971
|
+
return _this4;
|
|
940
972
|
}
|
|
941
973
|
|
|
942
974
|
return TooManyEventsError;
|
|
943
975
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
976
|
+
var TooFewEmailsError = /*#__PURE__*/function (_Error5) {
|
|
977
|
+
_inheritsLoose(TooFewEmailsError, _Error5);
|
|
978
|
+
|
|
979
|
+
function TooFewEmailsError(message) {
|
|
980
|
+
var _this5;
|
|
981
|
+
|
|
982
|
+
if (message === void 0) {
|
|
983
|
+
message = 'Too few emails';
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
_this5 = _Error5.call(this, message) || this;
|
|
987
|
+
_this5.name = 'TooFewEmailsError';
|
|
988
|
+
return _this5;
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
return TooFewEmailsError;
|
|
992
|
+
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
993
|
+
var TooManyEmailsError = /*#__PURE__*/function (_Error6) {
|
|
994
|
+
_inheritsLoose(TooManyEmailsError, _Error6);
|
|
995
|
+
|
|
996
|
+
function TooManyEmailsError(message) {
|
|
997
|
+
var _this6;
|
|
998
|
+
|
|
999
|
+
if (message === void 0) {
|
|
1000
|
+
message = 'Too many emails';
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
_this6 = _Error6.call(this, message) || this;
|
|
1004
|
+
_this6.name = 'TooManyEmailsError';
|
|
1005
|
+
return _this6;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
return TooManyEmailsError;
|
|
1009
|
+
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
944
1010
|
|
|
945
1011
|
var BentoBatch = /*#__PURE__*/function () {
|
|
946
1012
|
function BentoBatch(_client) {
|
|
947
1013
|
this._client = void 0;
|
|
1014
|
+
this._maxEmailBatchSize = 100;
|
|
948
1015
|
this._maxBatchSize = 1000;
|
|
949
1016
|
this._url = '/batch';
|
|
950
1017
|
this._client = _client;
|
|
@@ -980,44 +1047,37 @@ var BentoBatch = /*#__PURE__*/function () {
|
|
|
980
1047
|
while (1) {
|
|
981
1048
|
switch (_context.prev = _context.next) {
|
|
982
1049
|
case 0:
|
|
983
|
-
_context.prev = 0;
|
|
984
|
-
|
|
985
1050
|
if (!(parameters.subscribers.length === 0)) {
|
|
986
|
-
_context.next =
|
|
1051
|
+
_context.next = 2;
|
|
987
1052
|
break;
|
|
988
1053
|
}
|
|
989
1054
|
|
|
990
1055
|
throw new TooFewSubscribersError("You must send between 1 and 1,000 subscribers.");
|
|
991
1056
|
|
|
992
|
-
case
|
|
1057
|
+
case 2:
|
|
993
1058
|
if (!(parameters.subscribers.length > this._maxBatchSize)) {
|
|
994
|
-
_context.next =
|
|
1059
|
+
_context.next = 4;
|
|
995
1060
|
break;
|
|
996
1061
|
}
|
|
997
1062
|
|
|
998
1063
|
throw new TooManySubscribersError("You must send between 1 and 1,000 subscribers.");
|
|
999
1064
|
|
|
1000
|
-
case
|
|
1001
|
-
_context.next =
|
|
1065
|
+
case 4:
|
|
1066
|
+
_context.next = 6;
|
|
1002
1067
|
return this._client.post(this._url + "/subscribers", {
|
|
1003
1068
|
subscribers: parameters.subscribers
|
|
1004
1069
|
});
|
|
1005
1070
|
|
|
1006
|
-
case
|
|
1071
|
+
case 6:
|
|
1007
1072
|
result = _context.sent;
|
|
1008
1073
|
return _context.abrupt("return", result.results);
|
|
1009
1074
|
|
|
1010
|
-
case
|
|
1011
|
-
_context.prev = 11;
|
|
1012
|
-
_context.t0 = _context["catch"](0);
|
|
1013
|
-
throw _context.t0;
|
|
1014
|
-
|
|
1015
|
-
case 14:
|
|
1075
|
+
case 8:
|
|
1016
1076
|
case "end":
|
|
1017
1077
|
return _context.stop();
|
|
1018
1078
|
}
|
|
1019
1079
|
}
|
|
1020
|
-
}, _callee, this
|
|
1080
|
+
}, _callee, this);
|
|
1021
1081
|
}));
|
|
1022
1082
|
|
|
1023
1083
|
function importSubscribers(_x) {
|
|
@@ -1048,44 +1108,37 @@ var BentoBatch = /*#__PURE__*/function () {
|
|
|
1048
1108
|
while (1) {
|
|
1049
1109
|
switch (_context2.prev = _context2.next) {
|
|
1050
1110
|
case 0:
|
|
1051
|
-
_context2.prev = 0;
|
|
1052
|
-
|
|
1053
1111
|
if (!(parameters.events.length === 0)) {
|
|
1054
|
-
_context2.next =
|
|
1112
|
+
_context2.next = 2;
|
|
1055
1113
|
break;
|
|
1056
1114
|
}
|
|
1057
1115
|
|
|
1058
1116
|
throw new TooFewEventsError("You must send between 1 and 1,000 events.");
|
|
1059
1117
|
|
|
1060
|
-
case
|
|
1118
|
+
case 2:
|
|
1061
1119
|
if (!(parameters.events.length > this._maxBatchSize)) {
|
|
1062
|
-
_context2.next =
|
|
1120
|
+
_context2.next = 4;
|
|
1063
1121
|
break;
|
|
1064
1122
|
}
|
|
1065
1123
|
|
|
1066
1124
|
throw new TooManyEventsError("You must send between 1 and 1,000 events.");
|
|
1067
1125
|
|
|
1068
|
-
case
|
|
1069
|
-
_context2.next =
|
|
1126
|
+
case 4:
|
|
1127
|
+
_context2.next = 6;
|
|
1070
1128
|
return this._client.post(this._url + "/events", {
|
|
1071
1129
|
events: parameters.events
|
|
1072
1130
|
});
|
|
1073
1131
|
|
|
1074
|
-
case
|
|
1132
|
+
case 6:
|
|
1075
1133
|
result = _context2.sent;
|
|
1076
1134
|
return _context2.abrupt("return", result.results);
|
|
1077
1135
|
|
|
1078
|
-
case
|
|
1079
|
-
_context2.prev = 11;
|
|
1080
|
-
_context2.t0 = _context2["catch"](0);
|
|
1081
|
-
throw _context2.t0;
|
|
1082
|
-
|
|
1083
|
-
case 14:
|
|
1136
|
+
case 8:
|
|
1084
1137
|
case "end":
|
|
1085
1138
|
return _context2.stop();
|
|
1086
1139
|
}
|
|
1087
1140
|
}
|
|
1088
|
-
}, _callee2, this
|
|
1141
|
+
}, _callee2, this);
|
|
1089
1142
|
}));
|
|
1090
1143
|
|
|
1091
1144
|
function importEvents(_x2) {
|
|
@@ -1093,6 +1146,70 @@ var BentoBatch = /*#__PURE__*/function () {
|
|
|
1093
1146
|
}
|
|
1094
1147
|
|
|
1095
1148
|
return importEvents;
|
|
1149
|
+
}()
|
|
1150
|
+
/**
|
|
1151
|
+
* Creates a batch job to send transactional emails from Bento's infrastructure. You can pass in
|
|
1152
|
+
* between 1 and 100 emails to send.
|
|
1153
|
+
*
|
|
1154
|
+
* Each email must have a `to` address, a `from` address, a `subject`, an `html_body`
|
|
1155
|
+
* and `transactional: true`.
|
|
1156
|
+
* In addition you can add a `personalizations` object to provide
|
|
1157
|
+
* liquid tsags that will be injected into the email.
|
|
1158
|
+
*
|
|
1159
|
+
* Returns the number of events that were imported.
|
|
1160
|
+
*
|
|
1161
|
+
* @param parameters
|
|
1162
|
+
* @returns Promise\<number\>
|
|
1163
|
+
*/
|
|
1164
|
+
;
|
|
1165
|
+
|
|
1166
|
+
_proto.sendTransactionalEmails =
|
|
1167
|
+
/*#__PURE__*/
|
|
1168
|
+
function () {
|
|
1169
|
+
var _sendTransactionalEmails = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(parameters) {
|
|
1170
|
+
var result;
|
|
1171
|
+
return runtime_1.wrap(function _callee3$(_context3) {
|
|
1172
|
+
while (1) {
|
|
1173
|
+
switch (_context3.prev = _context3.next) {
|
|
1174
|
+
case 0:
|
|
1175
|
+
if (!(parameters.emails.length === 0)) {
|
|
1176
|
+
_context3.next = 2;
|
|
1177
|
+
break;
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
throw new TooFewEmailsError("You must send between 1 and 100 emails.");
|
|
1181
|
+
|
|
1182
|
+
case 2:
|
|
1183
|
+
if (!(parameters.emails.length > this._maxEmailBatchSize)) {
|
|
1184
|
+
_context3.next = 4;
|
|
1185
|
+
break;
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
throw new TooManyEmailsError("You must send between 1 and 100 emails.");
|
|
1189
|
+
|
|
1190
|
+
case 4:
|
|
1191
|
+
_context3.next = 6;
|
|
1192
|
+
return this._client.post(this._url + "/emails", {
|
|
1193
|
+
emails: parameters.emails
|
|
1194
|
+
});
|
|
1195
|
+
|
|
1196
|
+
case 6:
|
|
1197
|
+
result = _context3.sent;
|
|
1198
|
+
return _context3.abrupt("return", result.results);
|
|
1199
|
+
|
|
1200
|
+
case 8:
|
|
1201
|
+
case "end":
|
|
1202
|
+
return _context3.stop();
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
}, _callee3, this);
|
|
1206
|
+
}));
|
|
1207
|
+
|
|
1208
|
+
function sendTransactionalEmails(_x3) {
|
|
1209
|
+
return _sendTransactionalEmails.apply(this, arguments);
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
return sendTransactionalEmails;
|
|
1096
1213
|
}();
|
|
1097
1214
|
|
|
1098
1215
|
return BentoBatch;
|
|
@@ -1101,8 +1218,16 @@ var BentoBatch = /*#__PURE__*/function () {
|
|
|
1101
1218
|
var NotAuthorizedError = /*#__PURE__*/function (_Error) {
|
|
1102
1219
|
_inheritsLoose(NotAuthorizedError, _Error);
|
|
1103
1220
|
|
|
1104
|
-
function NotAuthorizedError() {
|
|
1105
|
-
|
|
1221
|
+
function NotAuthorizedError(message) {
|
|
1222
|
+
var _this;
|
|
1223
|
+
|
|
1224
|
+
if (message === void 0) {
|
|
1225
|
+
message = 'Not authorized';
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
_this = _Error.call(this, message) || this;
|
|
1229
|
+
_this.name = 'NotAuthorizedError';
|
|
1230
|
+
return _this;
|
|
1106
1231
|
}
|
|
1107
1232
|
|
|
1108
1233
|
return NotAuthorizedError;
|
|
@@ -1110,8 +1235,16 @@ var NotAuthorizedError = /*#__PURE__*/function (_Error) {
|
|
|
1110
1235
|
var RateLimitedError = /*#__PURE__*/function (_Error2) {
|
|
1111
1236
|
_inheritsLoose(RateLimitedError, _Error2);
|
|
1112
1237
|
|
|
1113
|
-
function RateLimitedError() {
|
|
1114
|
-
|
|
1238
|
+
function RateLimitedError(message) {
|
|
1239
|
+
var _this2;
|
|
1240
|
+
|
|
1241
|
+
if (message === void 0) {
|
|
1242
|
+
message = 'You are being rate limited';
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
_this2 = _Error2.call(this, message) || this;
|
|
1246
|
+
_this2.name = 'RateLimitedError';
|
|
1247
|
+
return _this2;
|
|
1115
1248
|
}
|
|
1116
1249
|
|
|
1117
1250
|
return RateLimitedError;
|
|
@@ -1340,55 +1473,55 @@ var BentoClient = /*#__PURE__*/function () {
|
|
|
1340
1473
|
while (1) {
|
|
1341
1474
|
switch (_context3.prev = _context3.next) {
|
|
1342
1475
|
case 0:
|
|
1476
|
+
if (this._logErrors) {
|
|
1477
|
+
console.error(response);
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1343
1480
|
if (!(response.status === 401)) {
|
|
1344
|
-
_context3.next =
|
|
1481
|
+
_context3.next = 3;
|
|
1345
1482
|
break;
|
|
1346
1483
|
}
|
|
1347
1484
|
|
|
1348
1485
|
return _context3.abrupt("return", new NotAuthorizedError());
|
|
1349
1486
|
|
|
1350
|
-
case
|
|
1487
|
+
case 3:
|
|
1351
1488
|
if (!(response.status === 429)) {
|
|
1352
|
-
_context3.next =
|
|
1489
|
+
_context3.next = 5;
|
|
1353
1490
|
break;
|
|
1354
1491
|
}
|
|
1355
1492
|
|
|
1356
1493
|
return _context3.abrupt("return", new RateLimitedError());
|
|
1357
1494
|
|
|
1358
|
-
case
|
|
1495
|
+
case 5:
|
|
1359
1496
|
contentType = response.headers.get('Content-Type');
|
|
1360
1497
|
responseMessage = '';
|
|
1361
1498
|
_context3.t0 = contentType == null ? void 0 : contentType.toLocaleLowerCase();
|
|
1362
|
-
_context3.next = _context3.t0 === 'text/plain' ?
|
|
1499
|
+
_context3.next = _context3.t0 === 'text/plain' ? 10 : _context3.t0 === 'application/json' ? 14 : 20;
|
|
1363
1500
|
break;
|
|
1364
1501
|
|
|
1365
|
-
case
|
|
1366
|
-
_context3.next =
|
|
1502
|
+
case 10:
|
|
1503
|
+
_context3.next = 12;
|
|
1367
1504
|
return response.text();
|
|
1368
1505
|
|
|
1369
|
-
case
|
|
1506
|
+
case 12:
|
|
1370
1507
|
responseMessage = _context3.sent;
|
|
1371
|
-
return _context3.abrupt("break",
|
|
1508
|
+
return _context3.abrupt("break", 22);
|
|
1372
1509
|
|
|
1373
|
-
case
|
|
1510
|
+
case 14:
|
|
1374
1511
|
_context3.t1 = JSON;
|
|
1375
|
-
_context3.next =
|
|
1512
|
+
_context3.next = 17;
|
|
1376
1513
|
return response.json();
|
|
1377
1514
|
|
|
1378
|
-
case
|
|
1515
|
+
case 17:
|
|
1379
1516
|
_context3.t2 = _context3.sent;
|
|
1380
1517
|
responseMessage = _context3.t1.stringify.call(_context3.t1, _context3.t2);
|
|
1381
|
-
return _context3.abrupt("break",
|
|
1518
|
+
return _context3.abrupt("break", 22);
|
|
1382
1519
|
|
|
1383
|
-
case
|
|
1520
|
+
case 20:
|
|
1384
1521
|
responseMessage = 'Unknown response from the Bento API.';
|
|
1385
|
-
return _context3.abrupt("break",
|
|
1386
|
-
|
|
1387
|
-
case 21:
|
|
1388
|
-
if (this._logErrors) {
|
|
1389
|
-
console.error(response);
|
|
1390
|
-
}
|
|
1522
|
+
return _context3.abrupt("break", 22);
|
|
1391
1523
|
|
|
1524
|
+
case 22:
|
|
1392
1525
|
return _context3.abrupt("return", new Error("[" + response.status + "] - " + responseMessage));
|
|
1393
1526
|
|
|
1394
1527
|
case 23:
|
|
@@ -1456,8 +1589,7 @@ var BentoCommands = /*#__PURE__*/function () {
|
|
|
1456
1589
|
while (1) {
|
|
1457
1590
|
switch (_context.prev = _context.next) {
|
|
1458
1591
|
case 0:
|
|
1459
|
-
_context.
|
|
1460
|
-
_context.next = 3;
|
|
1592
|
+
_context.next = 2;
|
|
1461
1593
|
return this._client.post(this._url, {
|
|
1462
1594
|
command: {
|
|
1463
1595
|
command: CommandTypes.ADD_TAG,
|
|
@@ -1466,30 +1598,25 @@ var BentoCommands = /*#__PURE__*/function () {
|
|
|
1466
1598
|
}
|
|
1467
1599
|
});
|
|
1468
1600
|
|
|
1469
|
-
case
|
|
1601
|
+
case 2:
|
|
1470
1602
|
result = _context.sent;
|
|
1471
1603
|
|
|
1472
1604
|
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
1473
|
-
_context.next =
|
|
1605
|
+
_context.next = 5;
|
|
1474
1606
|
break;
|
|
1475
1607
|
}
|
|
1476
1608
|
|
|
1477
1609
|
return _context.abrupt("return", null);
|
|
1478
1610
|
|
|
1479
|
-
case
|
|
1611
|
+
case 5:
|
|
1480
1612
|
return _context.abrupt("return", result.data);
|
|
1481
1613
|
|
|
1482
|
-
case
|
|
1483
|
-
_context.prev = 9;
|
|
1484
|
-
_context.t0 = _context["catch"](0);
|
|
1485
|
-
throw _context.t0;
|
|
1486
|
-
|
|
1487
|
-
case 12:
|
|
1614
|
+
case 6:
|
|
1488
1615
|
case "end":
|
|
1489
1616
|
return _context.stop();
|
|
1490
1617
|
}
|
|
1491
1618
|
}
|
|
1492
|
-
}, _callee, this
|
|
1619
|
+
}, _callee, this);
|
|
1493
1620
|
}));
|
|
1494
1621
|
|
|
1495
1622
|
function addTag(_x) {
|
|
@@ -1515,8 +1642,7 @@ var BentoCommands = /*#__PURE__*/function () {
|
|
|
1515
1642
|
while (1) {
|
|
1516
1643
|
switch (_context2.prev = _context2.next) {
|
|
1517
1644
|
case 0:
|
|
1518
|
-
_context2.
|
|
1519
|
-
_context2.next = 3;
|
|
1645
|
+
_context2.next = 2;
|
|
1520
1646
|
return this._client.post(this._url, {
|
|
1521
1647
|
command: {
|
|
1522
1648
|
command: CommandTypes.REMOVE_TAG,
|
|
@@ -1525,30 +1651,25 @@ var BentoCommands = /*#__PURE__*/function () {
|
|
|
1525
1651
|
}
|
|
1526
1652
|
});
|
|
1527
1653
|
|
|
1528
|
-
case
|
|
1654
|
+
case 2:
|
|
1529
1655
|
result = _context2.sent;
|
|
1530
1656
|
|
|
1531
1657
|
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
1532
|
-
_context2.next =
|
|
1658
|
+
_context2.next = 5;
|
|
1533
1659
|
break;
|
|
1534
1660
|
}
|
|
1535
1661
|
|
|
1536
1662
|
return _context2.abrupt("return", null);
|
|
1537
1663
|
|
|
1538
|
-
case
|
|
1664
|
+
case 5:
|
|
1539
1665
|
return _context2.abrupt("return", result.data);
|
|
1540
1666
|
|
|
1541
|
-
case
|
|
1542
|
-
_context2.prev = 9;
|
|
1543
|
-
_context2.t0 = _context2["catch"](0);
|
|
1544
|
-
throw _context2.t0;
|
|
1545
|
-
|
|
1546
|
-
case 12:
|
|
1667
|
+
case 6:
|
|
1547
1668
|
case "end":
|
|
1548
1669
|
return _context2.stop();
|
|
1549
1670
|
}
|
|
1550
1671
|
}
|
|
1551
|
-
}, _callee2, this
|
|
1672
|
+
}, _callee2, this);
|
|
1552
1673
|
}));
|
|
1553
1674
|
|
|
1554
1675
|
function removeTag(_x2) {
|
|
@@ -1580,8 +1701,7 @@ var BentoCommands = /*#__PURE__*/function () {
|
|
|
1580
1701
|
while (1) {
|
|
1581
1702
|
switch (_context3.prev = _context3.next) {
|
|
1582
1703
|
case 0:
|
|
1583
|
-
_context3.
|
|
1584
|
-
_context3.next = 3;
|
|
1704
|
+
_context3.next = 2;
|
|
1585
1705
|
return this._client.post(this._url, {
|
|
1586
1706
|
command: {
|
|
1587
1707
|
command: CommandTypes.ADD_FIELD,
|
|
@@ -1590,30 +1710,25 @@ var BentoCommands = /*#__PURE__*/function () {
|
|
|
1590
1710
|
}
|
|
1591
1711
|
});
|
|
1592
1712
|
|
|
1593
|
-
case
|
|
1713
|
+
case 2:
|
|
1594
1714
|
result = _context3.sent;
|
|
1595
1715
|
|
|
1596
1716
|
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
1597
|
-
_context3.next =
|
|
1717
|
+
_context3.next = 5;
|
|
1598
1718
|
break;
|
|
1599
1719
|
}
|
|
1600
1720
|
|
|
1601
1721
|
return _context3.abrupt("return", null);
|
|
1602
1722
|
|
|
1603
|
-
case
|
|
1723
|
+
case 5:
|
|
1604
1724
|
return _context3.abrupt("return", result.data);
|
|
1605
1725
|
|
|
1606
|
-
case
|
|
1607
|
-
_context3.prev = 9;
|
|
1608
|
-
_context3.t0 = _context3["catch"](0);
|
|
1609
|
-
throw _context3.t0;
|
|
1610
|
-
|
|
1611
|
-
case 12:
|
|
1726
|
+
case 6:
|
|
1612
1727
|
case "end":
|
|
1613
1728
|
return _context3.stop();
|
|
1614
1729
|
}
|
|
1615
1730
|
}
|
|
1616
|
-
}, _callee3, this
|
|
1731
|
+
}, _callee3, this);
|
|
1617
1732
|
}));
|
|
1618
1733
|
|
|
1619
1734
|
function addField(_x3) {
|
|
@@ -1639,8 +1754,7 @@ var BentoCommands = /*#__PURE__*/function () {
|
|
|
1639
1754
|
while (1) {
|
|
1640
1755
|
switch (_context4.prev = _context4.next) {
|
|
1641
1756
|
case 0:
|
|
1642
|
-
_context4.
|
|
1643
|
-
_context4.next = 3;
|
|
1757
|
+
_context4.next = 2;
|
|
1644
1758
|
return this._client.post(this._url, {
|
|
1645
1759
|
command: {
|
|
1646
1760
|
command: CommandTypes.REMOVE_FIELD,
|
|
@@ -1649,30 +1763,25 @@ var BentoCommands = /*#__PURE__*/function () {
|
|
|
1649
1763
|
}
|
|
1650
1764
|
});
|
|
1651
1765
|
|
|
1652
|
-
case
|
|
1766
|
+
case 2:
|
|
1653
1767
|
result = _context4.sent;
|
|
1654
1768
|
|
|
1655
1769
|
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
1656
|
-
_context4.next =
|
|
1770
|
+
_context4.next = 5;
|
|
1657
1771
|
break;
|
|
1658
1772
|
}
|
|
1659
1773
|
|
|
1660
1774
|
return _context4.abrupt("return", null);
|
|
1661
1775
|
|
|
1662
|
-
case
|
|
1776
|
+
case 5:
|
|
1663
1777
|
return _context4.abrupt("return", result.data);
|
|
1664
1778
|
|
|
1665
|
-
case
|
|
1666
|
-
_context4.prev = 9;
|
|
1667
|
-
_context4.t0 = _context4["catch"](0);
|
|
1668
|
-
throw _context4.t0;
|
|
1669
|
-
|
|
1670
|
-
case 12:
|
|
1779
|
+
case 6:
|
|
1671
1780
|
case "end":
|
|
1672
1781
|
return _context4.stop();
|
|
1673
1782
|
}
|
|
1674
1783
|
}
|
|
1675
|
-
}, _callee4, this
|
|
1784
|
+
}, _callee4, this);
|
|
1676
1785
|
}));
|
|
1677
1786
|
|
|
1678
1787
|
function removeField(_x4) {
|
|
@@ -1702,8 +1811,7 @@ var BentoCommands = /*#__PURE__*/function () {
|
|
|
1702
1811
|
while (1) {
|
|
1703
1812
|
switch (_context5.prev = _context5.next) {
|
|
1704
1813
|
case 0:
|
|
1705
|
-
_context5.
|
|
1706
|
-
_context5.next = 3;
|
|
1814
|
+
_context5.next = 2;
|
|
1707
1815
|
return this._client.post(this._url, {
|
|
1708
1816
|
command: {
|
|
1709
1817
|
command: CommandTypes.SUBSCRIBE,
|
|
@@ -1711,30 +1819,25 @@ var BentoCommands = /*#__PURE__*/function () {
|
|
|
1711
1819
|
}
|
|
1712
1820
|
});
|
|
1713
1821
|
|
|
1714
|
-
case
|
|
1822
|
+
case 2:
|
|
1715
1823
|
result = _context5.sent;
|
|
1716
1824
|
|
|
1717
1825
|
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
1718
|
-
_context5.next =
|
|
1826
|
+
_context5.next = 5;
|
|
1719
1827
|
break;
|
|
1720
1828
|
}
|
|
1721
1829
|
|
|
1722
1830
|
return _context5.abrupt("return", null);
|
|
1723
1831
|
|
|
1724
|
-
case
|
|
1832
|
+
case 5:
|
|
1725
1833
|
return _context5.abrupt("return", result.data);
|
|
1726
1834
|
|
|
1727
|
-
case
|
|
1728
|
-
_context5.prev = 9;
|
|
1729
|
-
_context5.t0 = _context5["catch"](0);
|
|
1730
|
-
throw _context5.t0;
|
|
1731
|
-
|
|
1732
|
-
case 12:
|
|
1835
|
+
case 6:
|
|
1733
1836
|
case "end":
|
|
1734
1837
|
return _context5.stop();
|
|
1735
1838
|
}
|
|
1736
1839
|
}
|
|
1737
|
-
}, _callee5, this
|
|
1840
|
+
}, _callee5, this);
|
|
1738
1841
|
}));
|
|
1739
1842
|
|
|
1740
1843
|
function subscribe(_x5) {
|
|
@@ -1765,8 +1868,7 @@ var BentoCommands = /*#__PURE__*/function () {
|
|
|
1765
1868
|
while (1) {
|
|
1766
1869
|
switch (_context6.prev = _context6.next) {
|
|
1767
1870
|
case 0:
|
|
1768
|
-
_context6.
|
|
1769
|
-
_context6.next = 3;
|
|
1871
|
+
_context6.next = 2;
|
|
1770
1872
|
return this._client.post(this._url, {
|
|
1771
1873
|
command: {
|
|
1772
1874
|
command: CommandTypes.UNSUBSCRIBE,
|
|
@@ -1774,30 +1876,25 @@ var BentoCommands = /*#__PURE__*/function () {
|
|
|
1774
1876
|
}
|
|
1775
1877
|
});
|
|
1776
1878
|
|
|
1777
|
-
case
|
|
1879
|
+
case 2:
|
|
1778
1880
|
result = _context6.sent;
|
|
1779
1881
|
|
|
1780
1882
|
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
1781
|
-
_context6.next =
|
|
1883
|
+
_context6.next = 5;
|
|
1782
1884
|
break;
|
|
1783
1885
|
}
|
|
1784
1886
|
|
|
1785
1887
|
return _context6.abrupt("return", null);
|
|
1786
1888
|
|
|
1787
|
-
case
|
|
1889
|
+
case 5:
|
|
1788
1890
|
return _context6.abrupt("return", result.data);
|
|
1789
1891
|
|
|
1790
|
-
case
|
|
1791
|
-
_context6.prev = 9;
|
|
1792
|
-
_context6.t0 = _context6["catch"](0);
|
|
1793
|
-
throw _context6.t0;
|
|
1794
|
-
|
|
1795
|
-
case 12:
|
|
1892
|
+
case 6:
|
|
1796
1893
|
case "end":
|
|
1797
1894
|
return _context6.stop();
|
|
1798
1895
|
}
|
|
1799
1896
|
}
|
|
1800
|
-
}, _callee6, this
|
|
1897
|
+
}, _callee6, this);
|
|
1801
1898
|
}));
|
|
1802
1899
|
|
|
1803
1900
|
function unsubscribe(_x6) {
|
|
@@ -1823,8 +1920,7 @@ var BentoCommands = /*#__PURE__*/function () {
|
|
|
1823
1920
|
while (1) {
|
|
1824
1921
|
switch (_context7.prev = _context7.next) {
|
|
1825
1922
|
case 0:
|
|
1826
|
-
_context7.
|
|
1827
|
-
_context7.next = 3;
|
|
1923
|
+
_context7.next = 2;
|
|
1828
1924
|
return this._client.post(this._url, {
|
|
1829
1925
|
command: {
|
|
1830
1926
|
command: CommandTypes.CHANGE_EMAIL,
|
|
@@ -1833,30 +1929,25 @@ var BentoCommands = /*#__PURE__*/function () {
|
|
|
1833
1929
|
}
|
|
1834
1930
|
});
|
|
1835
1931
|
|
|
1836
|
-
case
|
|
1932
|
+
case 2:
|
|
1837
1933
|
result = _context7.sent;
|
|
1838
1934
|
|
|
1839
1935
|
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
1840
|
-
_context7.next =
|
|
1936
|
+
_context7.next = 5;
|
|
1841
1937
|
break;
|
|
1842
1938
|
}
|
|
1843
1939
|
|
|
1844
1940
|
return _context7.abrupt("return", null);
|
|
1845
1941
|
|
|
1846
|
-
case
|
|
1942
|
+
case 5:
|
|
1847
1943
|
return _context7.abrupt("return", result.data);
|
|
1848
1944
|
|
|
1849
|
-
case
|
|
1850
|
-
_context7.prev = 9;
|
|
1851
|
-
_context7.t0 = _context7["catch"](0);
|
|
1852
|
-
throw _context7.t0;
|
|
1853
|
-
|
|
1854
|
-
case 12:
|
|
1945
|
+
case 6:
|
|
1855
1946
|
case "end":
|
|
1856
1947
|
return _context7.stop();
|
|
1857
1948
|
}
|
|
1858
1949
|
}
|
|
1859
|
-
}, _callee7, this
|
|
1950
|
+
}, _callee7, this);
|
|
1860
1951
|
}));
|
|
1861
1952
|
|
|
1862
1953
|
function changeEmail(_x7) {
|
|
@@ -1901,8 +1992,7 @@ var BentoExperimental = /*#__PURE__*/function () {
|
|
|
1901
1992
|
while (1) {
|
|
1902
1993
|
switch (_context.prev = _context.next) {
|
|
1903
1994
|
case 0:
|
|
1904
|
-
_context.
|
|
1905
|
-
_context.next = 3;
|
|
1995
|
+
_context.next = 2;
|
|
1906
1996
|
return this._client.post(this._url + "/validation", {
|
|
1907
1997
|
email: parameters.email,
|
|
1908
1998
|
ip: parameters.ip,
|
|
@@ -1910,21 +2000,16 @@ var BentoExperimental = /*#__PURE__*/function () {
|
|
|
1910
2000
|
user_agent: parameters.userAgent
|
|
1911
2001
|
});
|
|
1912
2002
|
|
|
1913
|
-
case
|
|
2003
|
+
case 2:
|
|
1914
2004
|
result = _context.sent;
|
|
1915
2005
|
return _context.abrupt("return", result.valid);
|
|
1916
2006
|
|
|
1917
|
-
case
|
|
1918
|
-
_context.prev = 7;
|
|
1919
|
-
_context.t0 = _context["catch"](0);
|
|
1920
|
-
throw _context.t0;
|
|
1921
|
-
|
|
1922
|
-
case 10:
|
|
2007
|
+
case 4:
|
|
1923
2008
|
case "end":
|
|
1924
2009
|
return _context.stop();
|
|
1925
2010
|
}
|
|
1926
2011
|
}
|
|
1927
|
-
}, _callee, this
|
|
2012
|
+
}, _callee, this);
|
|
1928
2013
|
}));
|
|
1929
2014
|
|
|
1930
2015
|
function validateEmail(_x) {
|
|
@@ -1957,25 +2042,19 @@ var BentoExperimental = /*#__PURE__*/function () {
|
|
|
1957
2042
|
while (1) {
|
|
1958
2043
|
switch (_context2.prev = _context2.next) {
|
|
1959
2044
|
case 0:
|
|
1960
|
-
_context2.
|
|
1961
|
-
_context2.next = 3;
|
|
2045
|
+
_context2.next = 2;
|
|
1962
2046
|
return this._client.post(this._url + "/gender", parameters);
|
|
1963
2047
|
|
|
1964
|
-
case
|
|
2048
|
+
case 2:
|
|
1965
2049
|
result = _context2.sent;
|
|
1966
2050
|
return _context2.abrupt("return", result);
|
|
1967
2051
|
|
|
1968
|
-
case
|
|
1969
|
-
_context2.prev = 7;
|
|
1970
|
-
_context2.t0 = _context2["catch"](0);
|
|
1971
|
-
throw _context2.t0;
|
|
1972
|
-
|
|
1973
|
-
case 10:
|
|
2052
|
+
case 4:
|
|
1974
2053
|
case "end":
|
|
1975
2054
|
return _context2.stop();
|
|
1976
2055
|
}
|
|
1977
2056
|
}
|
|
1978
|
-
}, _callee2, this
|
|
2057
|
+
}, _callee2, this);
|
|
1979
2058
|
}));
|
|
1980
2059
|
|
|
1981
2060
|
function guessGender(_x2) {
|
|
@@ -2004,34 +2083,28 @@ var BentoExperimental = /*#__PURE__*/function () {
|
|
|
2004
2083
|
while (1) {
|
|
2005
2084
|
switch (_context3.prev = _context3.next) {
|
|
2006
2085
|
case 0:
|
|
2007
|
-
_context3.
|
|
2008
|
-
_context3.next = 3;
|
|
2086
|
+
_context3.next = 2;
|
|
2009
2087
|
return this._client.get(this._url + "/geolocation", parameters);
|
|
2010
2088
|
|
|
2011
|
-
case
|
|
2089
|
+
case 2:
|
|
2012
2090
|
result = _context3.sent;
|
|
2013
2091
|
|
|
2014
2092
|
if (!(Object.keys(result).length === 0)) {
|
|
2015
|
-
_context3.next =
|
|
2093
|
+
_context3.next = 5;
|
|
2016
2094
|
break;
|
|
2017
2095
|
}
|
|
2018
2096
|
|
|
2019
2097
|
return _context3.abrupt("return", null);
|
|
2020
2098
|
|
|
2021
|
-
case
|
|
2099
|
+
case 5:
|
|
2022
2100
|
return _context3.abrupt("return", result);
|
|
2023
2101
|
|
|
2024
|
-
case
|
|
2025
|
-
_context3.prev = 9;
|
|
2026
|
-
_context3.t0 = _context3["catch"](0);
|
|
2027
|
-
throw _context3.t0;
|
|
2028
|
-
|
|
2029
|
-
case 12:
|
|
2102
|
+
case 6:
|
|
2030
2103
|
case "end":
|
|
2031
2104
|
return _context3.stop();
|
|
2032
2105
|
}
|
|
2033
2106
|
}
|
|
2034
|
-
}, _callee3, this
|
|
2107
|
+
}, _callee3, this);
|
|
2035
2108
|
}));
|
|
2036
2109
|
|
|
2037
2110
|
function geolocate(_x3) {
|
|
@@ -2061,25 +2134,19 @@ var BentoExperimental = /*#__PURE__*/function () {
|
|
|
2061
2134
|
while (1) {
|
|
2062
2135
|
switch (_context4.prev = _context4.next) {
|
|
2063
2136
|
case 0:
|
|
2064
|
-
_context4.
|
|
2065
|
-
_context4.next = 3;
|
|
2137
|
+
_context4.next = 2;
|
|
2066
2138
|
return this._client.get(this._url + "/blacklist.json", parameters);
|
|
2067
2139
|
|
|
2068
|
-
case
|
|
2140
|
+
case 2:
|
|
2069
2141
|
result = _context4.sent;
|
|
2070
2142
|
return _context4.abrupt("return", result);
|
|
2071
2143
|
|
|
2072
|
-
case
|
|
2073
|
-
_context4.prev = 7;
|
|
2074
|
-
_context4.t0 = _context4["catch"](0);
|
|
2075
|
-
throw _context4.t0;
|
|
2076
|
-
|
|
2077
|
-
case 10:
|
|
2144
|
+
case 4:
|
|
2078
2145
|
case "end":
|
|
2079
2146
|
return _context4.stop();
|
|
2080
2147
|
}
|
|
2081
2148
|
}
|
|
2082
|
-
}, _callee4, this
|
|
2149
|
+
}, _callee4, this);
|
|
2083
2150
|
}));
|
|
2084
2151
|
|
|
2085
2152
|
function checkBlacklist(_x4) {
|
|
@@ -2116,34 +2183,28 @@ var BentoFields = /*#__PURE__*/function () {
|
|
|
2116
2183
|
while (1) {
|
|
2117
2184
|
switch (_context.prev = _context.next) {
|
|
2118
2185
|
case 0:
|
|
2119
|
-
_context.
|
|
2120
|
-
_context.next = 3;
|
|
2186
|
+
_context.next = 2;
|
|
2121
2187
|
return this._client.get(this._url);
|
|
2122
2188
|
|
|
2123
|
-
case
|
|
2189
|
+
case 2:
|
|
2124
2190
|
result = _context.sent;
|
|
2125
2191
|
|
|
2126
2192
|
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
2127
|
-
_context.next =
|
|
2193
|
+
_context.next = 5;
|
|
2128
2194
|
break;
|
|
2129
2195
|
}
|
|
2130
2196
|
|
|
2131
2197
|
return _context.abrupt("return", null);
|
|
2132
2198
|
|
|
2133
|
-
case
|
|
2199
|
+
case 5:
|
|
2134
2200
|
return _context.abrupt("return", result.data);
|
|
2135
2201
|
|
|
2136
|
-
case
|
|
2137
|
-
_context.prev = 9;
|
|
2138
|
-
_context.t0 = _context["catch"](0);
|
|
2139
|
-
throw _context.t0;
|
|
2140
|
-
|
|
2141
|
-
case 12:
|
|
2202
|
+
case 6:
|
|
2142
2203
|
case "end":
|
|
2143
2204
|
return _context.stop();
|
|
2144
2205
|
}
|
|
2145
2206
|
}
|
|
2146
|
-
}, _callee, this
|
|
2207
|
+
}, _callee, this);
|
|
2147
2208
|
}));
|
|
2148
2209
|
|
|
2149
2210
|
function getFields() {
|
|
@@ -2178,36 +2239,30 @@ var BentoFields = /*#__PURE__*/function () {
|
|
|
2178
2239
|
while (1) {
|
|
2179
2240
|
switch (_context2.prev = _context2.next) {
|
|
2180
2241
|
case 0:
|
|
2181
|
-
_context2.
|
|
2182
|
-
_context2.next = 3;
|
|
2242
|
+
_context2.next = 2;
|
|
2183
2243
|
return this._client.post(this._url, {
|
|
2184
2244
|
field: parameters
|
|
2185
2245
|
});
|
|
2186
2246
|
|
|
2187
|
-
case
|
|
2247
|
+
case 2:
|
|
2188
2248
|
result = _context2.sent;
|
|
2189
2249
|
|
|
2190
2250
|
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
2191
|
-
_context2.next =
|
|
2251
|
+
_context2.next = 5;
|
|
2192
2252
|
break;
|
|
2193
2253
|
}
|
|
2194
2254
|
|
|
2195
2255
|
return _context2.abrupt("return", null);
|
|
2196
2256
|
|
|
2197
|
-
case
|
|
2257
|
+
case 5:
|
|
2198
2258
|
return _context2.abrupt("return", result.data);
|
|
2199
2259
|
|
|
2200
|
-
case
|
|
2201
|
-
_context2.prev = 9;
|
|
2202
|
-
_context2.t0 = _context2["catch"](0);
|
|
2203
|
-
throw _context2.t0;
|
|
2204
|
-
|
|
2205
|
-
case 12:
|
|
2260
|
+
case 6:
|
|
2206
2261
|
case "end":
|
|
2207
2262
|
return _context2.stop();
|
|
2208
2263
|
}
|
|
2209
2264
|
}
|
|
2210
|
-
}, _callee2, this
|
|
2265
|
+
}, _callee2, this);
|
|
2211
2266
|
}));
|
|
2212
2267
|
|
|
2213
2268
|
function createField(_x) {
|
|
@@ -2245,36 +2300,30 @@ var BentoForms = /*#__PURE__*/function () {
|
|
|
2245
2300
|
while (1) {
|
|
2246
2301
|
switch (_context.prev = _context.next) {
|
|
2247
2302
|
case 0:
|
|
2248
|
-
_context.
|
|
2249
|
-
_context.next = 3;
|
|
2303
|
+
_context.next = 2;
|
|
2250
2304
|
return this._client.get(this._url, {
|
|
2251
2305
|
id: formIdentifier
|
|
2252
2306
|
});
|
|
2253
2307
|
|
|
2254
|
-
case
|
|
2308
|
+
case 2:
|
|
2255
2309
|
result = _context.sent;
|
|
2256
2310
|
|
|
2257
2311
|
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
2258
|
-
_context.next =
|
|
2312
|
+
_context.next = 5;
|
|
2259
2313
|
break;
|
|
2260
2314
|
}
|
|
2261
2315
|
|
|
2262
2316
|
return _context.abrupt("return", null);
|
|
2263
2317
|
|
|
2264
|
-
case
|
|
2318
|
+
case 5:
|
|
2265
2319
|
return _context.abrupt("return", result.data);
|
|
2266
2320
|
|
|
2267
|
-
case
|
|
2268
|
-
_context.prev = 9;
|
|
2269
|
-
_context.t0 = _context["catch"](0);
|
|
2270
|
-
throw _context.t0;
|
|
2271
|
-
|
|
2272
|
-
case 12:
|
|
2321
|
+
case 6:
|
|
2273
2322
|
case "end":
|
|
2274
2323
|
return _context.stop();
|
|
2275
2324
|
}
|
|
2276
2325
|
}
|
|
2277
|
-
}, _callee, this
|
|
2326
|
+
}, _callee, this);
|
|
2278
2327
|
}));
|
|
2279
2328
|
|
|
2280
2329
|
function getResponses(_x) {
|
|
@@ -2311,34 +2360,28 @@ var BentoSubscribers = /*#__PURE__*/function () {
|
|
|
2311
2360
|
while (1) {
|
|
2312
2361
|
switch (_context.prev = _context.next) {
|
|
2313
2362
|
case 0:
|
|
2314
|
-
_context.
|
|
2315
|
-
_context.next = 3;
|
|
2363
|
+
_context.next = 2;
|
|
2316
2364
|
return this._client.get(this._url, parameters);
|
|
2317
2365
|
|
|
2318
|
-
case
|
|
2366
|
+
case 2:
|
|
2319
2367
|
result = _context.sent;
|
|
2320
2368
|
|
|
2321
2369
|
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
2322
|
-
_context.next =
|
|
2370
|
+
_context.next = 5;
|
|
2323
2371
|
break;
|
|
2324
2372
|
}
|
|
2325
2373
|
|
|
2326
2374
|
return _context.abrupt("return", null);
|
|
2327
2375
|
|
|
2328
|
-
case
|
|
2376
|
+
case 5:
|
|
2329
2377
|
return _context.abrupt("return", result.data);
|
|
2330
2378
|
|
|
2331
|
-
case
|
|
2332
|
-
_context.prev = 9;
|
|
2333
|
-
_context.t0 = _context["catch"](0);
|
|
2334
|
-
throw _context.t0;
|
|
2335
|
-
|
|
2336
|
-
case 12:
|
|
2379
|
+
case 6:
|
|
2337
2380
|
case "end":
|
|
2338
2381
|
return _context.stop();
|
|
2339
2382
|
}
|
|
2340
2383
|
}
|
|
2341
|
-
}, _callee, this
|
|
2384
|
+
}, _callee, this);
|
|
2342
2385
|
}));
|
|
2343
2386
|
|
|
2344
2387
|
function getSubscribers(_x) {
|
|
@@ -2364,36 +2407,30 @@ var BentoSubscribers = /*#__PURE__*/function () {
|
|
|
2364
2407
|
while (1) {
|
|
2365
2408
|
switch (_context2.prev = _context2.next) {
|
|
2366
2409
|
case 0:
|
|
2367
|
-
_context2.
|
|
2368
|
-
_context2.next = 3;
|
|
2410
|
+
_context2.next = 2;
|
|
2369
2411
|
return this._client.post(this._url, {
|
|
2370
2412
|
subscriber: parameters
|
|
2371
2413
|
});
|
|
2372
2414
|
|
|
2373
|
-
case
|
|
2415
|
+
case 2:
|
|
2374
2416
|
result = _context2.sent;
|
|
2375
2417
|
|
|
2376
2418
|
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
2377
|
-
_context2.next =
|
|
2419
|
+
_context2.next = 5;
|
|
2378
2420
|
break;
|
|
2379
2421
|
}
|
|
2380
2422
|
|
|
2381
2423
|
return _context2.abrupt("return", null);
|
|
2382
2424
|
|
|
2383
|
-
case
|
|
2425
|
+
case 5:
|
|
2384
2426
|
return _context2.abrupt("return", result.data);
|
|
2385
2427
|
|
|
2386
|
-
case
|
|
2387
|
-
_context2.prev = 9;
|
|
2388
|
-
_context2.t0 = _context2["catch"](0);
|
|
2389
|
-
throw _context2.t0;
|
|
2390
|
-
|
|
2391
|
-
case 12:
|
|
2428
|
+
case 6:
|
|
2392
2429
|
case "end":
|
|
2393
2430
|
return _context2.stop();
|
|
2394
2431
|
}
|
|
2395
2432
|
}
|
|
2396
|
-
}, _callee2, this
|
|
2433
|
+
}, _callee2, this);
|
|
2397
2434
|
}));
|
|
2398
2435
|
|
|
2399
2436
|
function createSubscriber(_x2) {
|
|
@@ -2430,34 +2467,28 @@ var BentoTags = /*#__PURE__*/function () {
|
|
|
2430
2467
|
while (1) {
|
|
2431
2468
|
switch (_context.prev = _context.next) {
|
|
2432
2469
|
case 0:
|
|
2433
|
-
_context.
|
|
2434
|
-
_context.next = 3;
|
|
2470
|
+
_context.next = 2;
|
|
2435
2471
|
return this._client.get(this._url);
|
|
2436
2472
|
|
|
2437
|
-
case
|
|
2473
|
+
case 2:
|
|
2438
2474
|
result = _context.sent;
|
|
2439
2475
|
|
|
2440
2476
|
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
2441
|
-
_context.next =
|
|
2477
|
+
_context.next = 5;
|
|
2442
2478
|
break;
|
|
2443
2479
|
}
|
|
2444
2480
|
|
|
2445
2481
|
return _context.abrupt("return", null);
|
|
2446
2482
|
|
|
2447
|
-
case
|
|
2483
|
+
case 5:
|
|
2448
2484
|
return _context.abrupt("return", result.data);
|
|
2449
2485
|
|
|
2450
|
-
case
|
|
2451
|
-
_context.prev = 9;
|
|
2452
|
-
_context.t0 = _context["catch"](0);
|
|
2453
|
-
throw _context.t0;
|
|
2454
|
-
|
|
2455
|
-
case 12:
|
|
2486
|
+
case 6:
|
|
2456
2487
|
case "end":
|
|
2457
2488
|
return _context.stop();
|
|
2458
2489
|
}
|
|
2459
2490
|
}
|
|
2460
|
-
}, _callee, this
|
|
2491
|
+
}, _callee, this);
|
|
2461
2492
|
}));
|
|
2462
2493
|
|
|
2463
2494
|
function getTags() {
|
|
@@ -2483,36 +2514,30 @@ var BentoTags = /*#__PURE__*/function () {
|
|
|
2483
2514
|
while (1) {
|
|
2484
2515
|
switch (_context2.prev = _context2.next) {
|
|
2485
2516
|
case 0:
|
|
2486
|
-
_context2.
|
|
2487
|
-
_context2.next = 3;
|
|
2517
|
+
_context2.next = 2;
|
|
2488
2518
|
return this._client.post(this._url, {
|
|
2489
2519
|
tag: parameters
|
|
2490
2520
|
});
|
|
2491
2521
|
|
|
2492
|
-
case
|
|
2522
|
+
case 2:
|
|
2493
2523
|
result = _context2.sent;
|
|
2494
2524
|
|
|
2495
2525
|
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
2496
|
-
_context2.next =
|
|
2526
|
+
_context2.next = 5;
|
|
2497
2527
|
break;
|
|
2498
2528
|
}
|
|
2499
2529
|
|
|
2500
2530
|
return _context2.abrupt("return", null);
|
|
2501
2531
|
|
|
2502
|
-
case
|
|
2532
|
+
case 5:
|
|
2503
2533
|
return _context2.abrupt("return", result.data);
|
|
2504
2534
|
|
|
2505
|
-
case
|
|
2506
|
-
_context2.prev = 9;
|
|
2507
|
-
_context2.t0 = _context2["catch"](0);
|
|
2508
|
-
throw _context2.t0;
|
|
2509
|
-
|
|
2510
|
-
case 12:
|
|
2535
|
+
case 6:
|
|
2511
2536
|
case "end":
|
|
2512
2537
|
return _context2.stop();
|
|
2513
2538
|
}
|
|
2514
2539
|
}
|
|
2515
|
-
}, _callee2, this
|
|
2540
|
+
}, _callee2, this);
|
|
2516
2541
|
}));
|
|
2517
2542
|
|
|
2518
2543
|
function createTag(_x) {
|
|
@@ -2585,8 +2610,7 @@ var BentoAPIV1 = /*#__PURE__*/function () {
|
|
|
2585
2610
|
while (1) {
|
|
2586
2611
|
switch (_context.prev = _context.next) {
|
|
2587
2612
|
case 0:
|
|
2588
|
-
_context.
|
|
2589
|
-
_context.next = 3;
|
|
2613
|
+
_context.next = 2;
|
|
2590
2614
|
return this.Batch.importEvents({
|
|
2591
2615
|
events: [{
|
|
2592
2616
|
date: parameters.date,
|
|
@@ -2598,21 +2622,16 @@ var BentoAPIV1 = /*#__PURE__*/function () {
|
|
|
2598
2622
|
}]
|
|
2599
2623
|
});
|
|
2600
2624
|
|
|
2601
|
-
case
|
|
2625
|
+
case 2:
|
|
2602
2626
|
result = _context.sent;
|
|
2603
2627
|
return _context.abrupt("return", result === 1);
|
|
2604
2628
|
|
|
2605
|
-
case
|
|
2606
|
-
_context.prev = 7;
|
|
2607
|
-
_context.t0 = _context["catch"](0);
|
|
2608
|
-
throw _context.t0;
|
|
2609
|
-
|
|
2610
|
-
case 10:
|
|
2629
|
+
case 4:
|
|
2611
2630
|
case "end":
|
|
2612
2631
|
return _context.stop();
|
|
2613
2632
|
}
|
|
2614
2633
|
}
|
|
2615
|
-
}, _callee, this
|
|
2634
|
+
}, _callee, this);
|
|
2616
2635
|
}));
|
|
2617
2636
|
|
|
2618
2637
|
function tagSubscriber(_x) {
|
|
@@ -2652,8 +2671,7 @@ var BentoAPIV1 = /*#__PURE__*/function () {
|
|
|
2652
2671
|
while (1) {
|
|
2653
2672
|
switch (_context2.prev = _context2.next) {
|
|
2654
2673
|
case 0:
|
|
2655
|
-
_context2.
|
|
2656
|
-
_context2.next = 3;
|
|
2674
|
+
_context2.next = 2;
|
|
2657
2675
|
return this.Batch.importEvents({
|
|
2658
2676
|
events: [{
|
|
2659
2677
|
date: parameters.date,
|
|
@@ -2663,21 +2681,16 @@ var BentoAPIV1 = /*#__PURE__*/function () {
|
|
|
2663
2681
|
}]
|
|
2664
2682
|
});
|
|
2665
2683
|
|
|
2666
|
-
case
|
|
2684
|
+
case 2:
|
|
2667
2685
|
result = _context2.sent;
|
|
2668
2686
|
return _context2.abrupt("return", result === 1);
|
|
2669
2687
|
|
|
2670
|
-
case
|
|
2671
|
-
_context2.prev = 7;
|
|
2672
|
-
_context2.t0 = _context2["catch"](0);
|
|
2673
|
-
throw _context2.t0;
|
|
2674
|
-
|
|
2675
|
-
case 10:
|
|
2688
|
+
case 4:
|
|
2676
2689
|
case "end":
|
|
2677
2690
|
return _context2.stop();
|
|
2678
2691
|
}
|
|
2679
2692
|
}
|
|
2680
|
-
}, _callee2, this
|
|
2693
|
+
}, _callee2, this);
|
|
2681
2694
|
}));
|
|
2682
2695
|
|
|
2683
2696
|
function addSubscriber(_x2) {
|
|
@@ -2716,8 +2729,7 @@ var BentoAPIV1 = /*#__PURE__*/function () {
|
|
|
2716
2729
|
while (1) {
|
|
2717
2730
|
switch (_context3.prev = _context3.next) {
|
|
2718
2731
|
case 0:
|
|
2719
|
-
_context3.
|
|
2720
|
-
_context3.next = 3;
|
|
2732
|
+
_context3.next = 2;
|
|
2721
2733
|
return this.Batch.importEvents({
|
|
2722
2734
|
events: [{
|
|
2723
2735
|
date: parameters.date,
|
|
@@ -2726,21 +2738,16 @@ var BentoAPIV1 = /*#__PURE__*/function () {
|
|
|
2726
2738
|
}]
|
|
2727
2739
|
});
|
|
2728
2740
|
|
|
2729
|
-
case
|
|
2741
|
+
case 2:
|
|
2730
2742
|
result = _context3.sent;
|
|
2731
2743
|
return _context3.abrupt("return", result === 1);
|
|
2732
2744
|
|
|
2733
|
-
case
|
|
2734
|
-
_context3.prev = 7;
|
|
2735
|
-
_context3.t0 = _context3["catch"](0);
|
|
2736
|
-
throw _context3.t0;
|
|
2737
|
-
|
|
2738
|
-
case 10:
|
|
2745
|
+
case 4:
|
|
2739
2746
|
case "end":
|
|
2740
2747
|
return _context3.stop();
|
|
2741
2748
|
}
|
|
2742
2749
|
}
|
|
2743
|
-
}, _callee3, this
|
|
2750
|
+
}, _callee3, this);
|
|
2744
2751
|
}));
|
|
2745
2752
|
|
|
2746
2753
|
function removeSubscriber(_x3) {
|
|
@@ -2779,8 +2786,7 @@ var BentoAPIV1 = /*#__PURE__*/function () {
|
|
|
2779
2786
|
while (1) {
|
|
2780
2787
|
switch (_context4.prev = _context4.next) {
|
|
2781
2788
|
case 0:
|
|
2782
|
-
_context4.
|
|
2783
|
-
_context4.next = 3;
|
|
2789
|
+
_context4.next = 2;
|
|
2784
2790
|
return this.Batch.importEvents({
|
|
2785
2791
|
events: [{
|
|
2786
2792
|
date: parameters.date,
|
|
@@ -2790,21 +2796,16 @@ var BentoAPIV1 = /*#__PURE__*/function () {
|
|
|
2790
2796
|
}]
|
|
2791
2797
|
});
|
|
2792
2798
|
|
|
2793
|
-
case
|
|
2799
|
+
case 2:
|
|
2794
2800
|
result = _context4.sent;
|
|
2795
2801
|
return _context4.abrupt("return", result === 1);
|
|
2796
2802
|
|
|
2797
|
-
case
|
|
2798
|
-
_context4.prev = 7;
|
|
2799
|
-
_context4.t0 = _context4["catch"](0);
|
|
2800
|
-
throw _context4.t0;
|
|
2801
|
-
|
|
2802
|
-
case 10:
|
|
2803
|
+
case 4:
|
|
2803
2804
|
case "end":
|
|
2804
2805
|
return _context4.stop();
|
|
2805
2806
|
}
|
|
2806
2807
|
}
|
|
2807
|
-
}, _callee4, this
|
|
2808
|
+
}, _callee4, this);
|
|
2808
2809
|
}));
|
|
2809
2810
|
|
|
2810
2811
|
function updateFields(_x4) {
|
|
@@ -2842,8 +2843,7 @@ var BentoAPIV1 = /*#__PURE__*/function () {
|
|
|
2842
2843
|
while (1) {
|
|
2843
2844
|
switch (_context5.prev = _context5.next) {
|
|
2844
2845
|
case 0:
|
|
2845
|
-
_context5.
|
|
2846
|
-
_context5.next = 3;
|
|
2846
|
+
_context5.next = 2;
|
|
2847
2847
|
return this.Batch.importEvents({
|
|
2848
2848
|
events: [{
|
|
2849
2849
|
date: parameters.date,
|
|
@@ -2853,21 +2853,16 @@ var BentoAPIV1 = /*#__PURE__*/function () {
|
|
|
2853
2853
|
}]
|
|
2854
2854
|
});
|
|
2855
2855
|
|
|
2856
|
-
case
|
|
2856
|
+
case 2:
|
|
2857
2857
|
result = _context5.sent;
|
|
2858
2858
|
return _context5.abrupt("return", result === 1);
|
|
2859
2859
|
|
|
2860
|
-
case
|
|
2861
|
-
_context5.prev = 7;
|
|
2862
|
-
_context5.t0 = _context5["catch"](0);
|
|
2863
|
-
throw _context5.t0;
|
|
2864
|
-
|
|
2865
|
-
case 10:
|
|
2860
|
+
case 4:
|
|
2866
2861
|
case "end":
|
|
2867
2862
|
return _context5.stop();
|
|
2868
2863
|
}
|
|
2869
2864
|
}
|
|
2870
|
-
}, _callee5, this
|
|
2865
|
+
}, _callee5, this);
|
|
2871
2866
|
}));
|
|
2872
2867
|
|
|
2873
2868
|
function trackPurchase(_x5) {
|
|
@@ -2904,27 +2899,21 @@ var BentoAPIV1 = /*#__PURE__*/function () {
|
|
|
2904
2899
|
while (1) {
|
|
2905
2900
|
switch (_context6.prev = _context6.next) {
|
|
2906
2901
|
case 0:
|
|
2907
|
-
_context6.
|
|
2908
|
-
_context6.next = 3;
|
|
2902
|
+
_context6.next = 2;
|
|
2909
2903
|
return this.Batch.importEvents({
|
|
2910
2904
|
events: [parameters]
|
|
2911
2905
|
});
|
|
2912
2906
|
|
|
2913
|
-
case
|
|
2907
|
+
case 2:
|
|
2914
2908
|
result = _context6.sent;
|
|
2915
2909
|
return _context6.abrupt("return", result === 1);
|
|
2916
2910
|
|
|
2917
|
-
case
|
|
2918
|
-
_context6.prev = 7;
|
|
2919
|
-
_context6.t0 = _context6["catch"](0);
|
|
2920
|
-
throw _context6.t0;
|
|
2921
|
-
|
|
2922
|
-
case 10:
|
|
2911
|
+
case 4:
|
|
2923
2912
|
case "end":
|
|
2924
2913
|
return _context6.stop();
|
|
2925
2914
|
}
|
|
2926
2915
|
}
|
|
2927
|
-
}, _callee6, this
|
|
2916
|
+
}, _callee6, this);
|
|
2928
2917
|
}));
|
|
2929
2918
|
|
|
2930
2919
|
function track(_x6) {
|