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