@bentonow/bento-node-sdk 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -17
- package/dist/bento-node-sdk.cjs.development.js +948 -1820
- 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 +948 -1820
- package/dist/bento-node-sdk.esm.js.map +1 -1
- package/dist/sdk/batch/events.d.ts +12 -12
- package/dist/sdk/batch/types.d.ts +7 -7
- package/dist/sdk/client/types.d.ts +1 -1
- package/dist/sdk/commands/types.d.ts +7 -7
- package/dist/sdk/experimental/types.d.ts +8 -8
- package/dist/sdk/fields/types.d.ts +3 -3
- package/dist/sdk/forms/types.d.ts +3 -3
- package/dist/sdk/subscribers/types.d.ts +4 -4
- package/dist/sdk/tags/types.d.ts +3 -3
- package/dist/sdk/types.d.ts +5 -5
- package/dist/versions/v1/types.d.ts +6 -6
- package/package.json +3 -3
- package/src/sdk/client/index.ts +7 -7
|
@@ -4,1013 +4,477 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
6
6
|
|
|
7
|
-
var fetch = _interopDefault(require('
|
|
7
|
+
var fetch = _interopDefault(require('cross-fetch'));
|
|
8
8
|
|
|
9
|
-
function asyncGeneratorStep(
|
|
9
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
10
10
|
try {
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
} catch (
|
|
14
|
-
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
if (info.done) {
|
|
19
|
-
resolve(value);
|
|
20
|
-
} else {
|
|
21
|
-
Promise.resolve(value).then(_next, _throw);
|
|
11
|
+
var i = n[a](c),
|
|
12
|
+
u = i.value;
|
|
13
|
+
} catch (n) {
|
|
14
|
+
return void e(n);
|
|
22
15
|
}
|
|
16
|
+
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
23
17
|
}
|
|
24
|
-
|
|
25
|
-
function _asyncToGenerator(fn) {
|
|
18
|
+
function _asyncToGenerator(n) {
|
|
26
19
|
return function () {
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
return new Promise(function (
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
20
|
+
var t = this,
|
|
21
|
+
e = arguments;
|
|
22
|
+
return new Promise(function (r, o) {
|
|
23
|
+
var a = n.apply(t, e);
|
|
24
|
+
function _next(n) {
|
|
25
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
34
26
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
27
|
+
function _throw(n) {
|
|
28
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
38
29
|
}
|
|
39
|
-
|
|
40
|
-
_next(undefined);
|
|
30
|
+
_next(void 0);
|
|
41
31
|
});
|
|
42
32
|
};
|
|
43
33
|
}
|
|
44
|
-
|
|
34
|
+
function _construct(t, e, r) {
|
|
35
|
+
if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
|
|
36
|
+
var o = [null];
|
|
37
|
+
o.push.apply(o, e);
|
|
38
|
+
var p = new (t.bind.apply(t, o))();
|
|
39
|
+
return r && _setPrototypeOf(p, r.prototype), p;
|
|
40
|
+
}
|
|
45
41
|
function _extends() {
|
|
46
|
-
_extends = Object.assign
|
|
47
|
-
for (var
|
|
48
|
-
var
|
|
49
|
-
|
|
50
|
-
for (var key in source) {
|
|
51
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
52
|
-
target[key] = source[key];
|
|
53
|
-
}
|
|
54
|
-
}
|
|
42
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
43
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
44
|
+
var t = arguments[e];
|
|
45
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
55
46
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
return _extends.apply(this, arguments);
|
|
47
|
+
return n;
|
|
48
|
+
}, _extends.apply(null, arguments);
|
|
61
49
|
}
|
|
62
|
-
|
|
63
|
-
function
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
_setPrototypeOf(subClass, superClass);
|
|
50
|
+
function _getPrototypeOf(t) {
|
|
51
|
+
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
52
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
53
|
+
}, _getPrototypeOf(t);
|
|
68
54
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
72
|
-
return o.__proto__ || Object.getPrototypeOf(o);
|
|
73
|
-
};
|
|
74
|
-
return _getPrototypeOf(o);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function _setPrototypeOf(o, p) {
|
|
78
|
-
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
79
|
-
o.__proto__ = p;
|
|
80
|
-
return o;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
return _setPrototypeOf(o, p);
|
|
55
|
+
function _inheritsLoose(t, o) {
|
|
56
|
+
t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
|
|
84
57
|
}
|
|
85
|
-
|
|
86
|
-
function _isNativeReflectConstruct() {
|
|
87
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
88
|
-
if (Reflect.construct.sham) return false;
|
|
89
|
-
if (typeof Proxy === "function") return true;
|
|
90
|
-
|
|
58
|
+
function _isNativeFunction(t) {
|
|
91
59
|
try {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
return false;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
function _construct(Parent, args, Class) {
|
|
100
|
-
if (_isNativeReflectConstruct()) {
|
|
101
|
-
_construct = Reflect.construct;
|
|
102
|
-
} else {
|
|
103
|
-
_construct = function _construct(Parent, args, Class) {
|
|
104
|
-
var a = [null];
|
|
105
|
-
a.push.apply(a, args);
|
|
106
|
-
var Constructor = Function.bind.apply(Parent, a);
|
|
107
|
-
var instance = new Constructor();
|
|
108
|
-
if (Class) _setPrototypeOf(instance, Class.prototype);
|
|
109
|
-
return instance;
|
|
110
|
-
};
|
|
60
|
+
return -1 !== Function.toString.call(t).indexOf("[native code]");
|
|
61
|
+
} catch (n) {
|
|
62
|
+
return "function" == typeof t;
|
|
111
63
|
}
|
|
112
|
-
|
|
113
|
-
return _construct.apply(null, arguments);
|
|
114
64
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
65
|
+
function _isNativeReflectConstruct() {
|
|
66
|
+
try {
|
|
67
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
68
|
+
} catch (t) {}
|
|
69
|
+
return (_isNativeReflectConstruct = function () {
|
|
70
|
+
return !!t;
|
|
71
|
+
})();
|
|
118
72
|
}
|
|
119
|
-
|
|
120
|
-
function
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
_wrapNativeSuper = function _wrapNativeSuper(Class) {
|
|
124
|
-
if (Class === null || !_isNativeFunction(Class)) return Class;
|
|
125
|
-
|
|
126
|
-
if (typeof Class !== "function") {
|
|
127
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if (typeof _cache !== "undefined") {
|
|
131
|
-
if (_cache.has(Class)) return _cache.get(Class);
|
|
132
|
-
|
|
133
|
-
_cache.set(Class, Wrapper);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
function Wrapper() {
|
|
137
|
-
return _construct(Class, arguments, _getPrototypeOf(this).constructor);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
Wrapper.prototype = Object.create(Class.prototype, {
|
|
141
|
-
constructor: {
|
|
142
|
-
value: Wrapper,
|
|
143
|
-
enumerable: false,
|
|
144
|
-
writable: true,
|
|
145
|
-
configurable: true
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
return _setPrototypeOf(Wrapper, Class);
|
|
73
|
+
function _regeneratorRuntime() {
|
|
74
|
+
_regeneratorRuntime = function () {
|
|
75
|
+
return e;
|
|
149
76
|
};
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
function
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
var Op = Object.prototype;
|
|
169
|
-
var hasOwn = Op.hasOwnProperty;
|
|
170
|
-
var undefined$1; // More compressible than void 0.
|
|
171
|
-
var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
|
172
|
-
var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
|
173
|
-
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
|
174
|
-
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
175
|
-
|
|
176
|
-
function define(obj, key, value) {
|
|
177
|
-
Object.defineProperty(obj, key, {
|
|
178
|
-
value: value,
|
|
179
|
-
enumerable: true,
|
|
180
|
-
configurable: true,
|
|
181
|
-
writable: true
|
|
182
|
-
});
|
|
183
|
-
return obj[key];
|
|
77
|
+
var t,
|
|
78
|
+
e = {},
|
|
79
|
+
r = Object.prototype,
|
|
80
|
+
n = r.hasOwnProperty,
|
|
81
|
+
o = Object.defineProperty || function (t, e, r) {
|
|
82
|
+
t[e] = r.value;
|
|
83
|
+
},
|
|
84
|
+
i = "function" == typeof Symbol ? Symbol : {},
|
|
85
|
+
a = i.iterator || "@@iterator",
|
|
86
|
+
c = i.asyncIterator || "@@asyncIterator",
|
|
87
|
+
u = i.toStringTag || "@@toStringTag";
|
|
88
|
+
function define(t, e, r) {
|
|
89
|
+
return Object.defineProperty(t, e, {
|
|
90
|
+
value: r,
|
|
91
|
+
enumerable: !0,
|
|
92
|
+
configurable: !0,
|
|
93
|
+
writable: !0
|
|
94
|
+
}), t[e];
|
|
184
95
|
}
|
|
185
96
|
try {
|
|
186
|
-
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
|
|
187
97
|
define({}, "");
|
|
188
|
-
} catch (
|
|
189
|
-
define = function(
|
|
190
|
-
return
|
|
98
|
+
} catch (t) {
|
|
99
|
+
define = function (t, e, r) {
|
|
100
|
+
return t[e] = r;
|
|
191
101
|
};
|
|
192
102
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
// The ._invoke method unifies the implementations of the .next,
|
|
201
|
-
// .throw, and .return methods.
|
|
202
|
-
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
|
203
|
-
|
|
204
|
-
return generator;
|
|
103
|
+
function wrap(t, e, r, n) {
|
|
104
|
+
var i = e && e.prototype instanceof Generator ? e : Generator,
|
|
105
|
+
a = Object.create(i.prototype),
|
|
106
|
+
c = new Context(n || []);
|
|
107
|
+
return o(a, "_invoke", {
|
|
108
|
+
value: makeInvokeMethod(t, r, c)
|
|
109
|
+
}), a;
|
|
205
110
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
// Try/catch helper to minimize deoptimizations. Returns a completion
|
|
209
|
-
// record like context.tryEntries[i].completion. This interface could
|
|
210
|
-
// have been (and was previously) designed to take a closure to be
|
|
211
|
-
// invoked without arguments, but in all the cases we care about we
|
|
212
|
-
// already have an existing method we want to call, so there's no need
|
|
213
|
-
// to create a new function object. We can even get away with assuming
|
|
214
|
-
// the method takes exactly one argument, since that happens to be true
|
|
215
|
-
// in every case, so we don't have to touch the arguments object. The
|
|
216
|
-
// only additional allocation required is the completion record, which
|
|
217
|
-
// has a stable shape and so hopefully should be cheap to allocate.
|
|
218
|
-
function tryCatch(fn, obj, arg) {
|
|
111
|
+
function tryCatch(t, e, r) {
|
|
219
112
|
try {
|
|
220
|
-
return {
|
|
221
|
-
|
|
222
|
-
|
|
113
|
+
return {
|
|
114
|
+
type: "normal",
|
|
115
|
+
arg: t.call(e, r)
|
|
116
|
+
};
|
|
117
|
+
} catch (t) {
|
|
118
|
+
return {
|
|
119
|
+
type: "throw",
|
|
120
|
+
arg: t
|
|
121
|
+
};
|
|
223
122
|
}
|
|
224
123
|
}
|
|
225
|
-
|
|
226
|
-
var
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
// Returning this object from the innerFn has the same effect as
|
|
232
|
-
// breaking out of the dispatch switch statement.
|
|
233
|
-
var ContinueSentinel = {};
|
|
234
|
-
|
|
235
|
-
// Dummy constructor functions that we use as the .constructor and
|
|
236
|
-
// .constructor.prototype properties for functions that return Generator
|
|
237
|
-
// objects. For full spec compliance, you may wish to configure your
|
|
238
|
-
// minifier not to mangle the names of these two functions.
|
|
124
|
+
e.wrap = wrap;
|
|
125
|
+
var h = "suspendedStart",
|
|
126
|
+
l = "suspendedYield",
|
|
127
|
+
f = "executing",
|
|
128
|
+
s = "completed",
|
|
129
|
+
y = {};
|
|
239
130
|
function Generator() {}
|
|
240
131
|
function GeneratorFunction() {}
|
|
241
132
|
function GeneratorFunctionPrototype() {}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
// don't natively support it.
|
|
245
|
-
var IteratorPrototype = {};
|
|
246
|
-
define(IteratorPrototype, iteratorSymbol, function () {
|
|
133
|
+
var p = {};
|
|
134
|
+
define(p, a, function () {
|
|
247
135
|
return this;
|
|
248
136
|
});
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
IteratorPrototype = NativeIteratorPrototype;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
var Gp = GeneratorFunctionPrototype.prototype =
|
|
261
|
-
Generator.prototype = Object.create(IteratorPrototype);
|
|
262
|
-
GeneratorFunction.prototype = GeneratorFunctionPrototype;
|
|
263
|
-
define(Gp, "constructor", GeneratorFunctionPrototype);
|
|
264
|
-
define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
|
|
265
|
-
GeneratorFunction.displayName = define(
|
|
266
|
-
GeneratorFunctionPrototype,
|
|
267
|
-
toStringTagSymbol,
|
|
268
|
-
"GeneratorFunction"
|
|
269
|
-
);
|
|
270
|
-
|
|
271
|
-
// Helper for defining the .next, .throw, and .return methods of the
|
|
272
|
-
// Iterator interface in terms of a single ._invoke method.
|
|
273
|
-
function defineIteratorMethods(prototype) {
|
|
274
|
-
["next", "throw", "return"].forEach(function(method) {
|
|
275
|
-
define(prototype, method, function(arg) {
|
|
276
|
-
return this._invoke(method, arg);
|
|
137
|
+
var d = Object.getPrototypeOf,
|
|
138
|
+
v = d && d(d(values([])));
|
|
139
|
+
v && v !== r && n.call(v, a) && (p = v);
|
|
140
|
+
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
141
|
+
function defineIteratorMethods(t) {
|
|
142
|
+
["next", "throw", "return"].forEach(function (e) {
|
|
143
|
+
define(t, e, function (t) {
|
|
144
|
+
return this._invoke(e, t);
|
|
277
145
|
});
|
|
278
146
|
});
|
|
279
147
|
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
} else {
|
|
295
|
-
genFun.__proto__ = GeneratorFunctionPrototype;
|
|
296
|
-
define(genFun, toStringTagSymbol, "GeneratorFunction");
|
|
297
|
-
}
|
|
298
|
-
genFun.prototype = Object.create(Gp);
|
|
299
|
-
return genFun;
|
|
300
|
-
};
|
|
301
|
-
|
|
302
|
-
// Within the body of any async function, `await x` is transformed to
|
|
303
|
-
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
|
|
304
|
-
// `hasOwn.call(value, "__await")` to determine if the yielded value is
|
|
305
|
-
// meant to be awaited.
|
|
306
|
-
exports.awrap = function(arg) {
|
|
307
|
-
return { __await: arg };
|
|
308
|
-
};
|
|
309
|
-
|
|
310
|
-
function AsyncIterator(generator, PromiseImpl) {
|
|
311
|
-
function invoke(method, arg, resolve, reject) {
|
|
312
|
-
var record = tryCatch(generator[method], generator, arg);
|
|
313
|
-
if (record.type === "throw") {
|
|
314
|
-
reject(record.arg);
|
|
315
|
-
} else {
|
|
316
|
-
var result = record.arg;
|
|
317
|
-
var value = result.value;
|
|
318
|
-
if (value &&
|
|
319
|
-
typeof value === "object" &&
|
|
320
|
-
hasOwn.call(value, "__await")) {
|
|
321
|
-
return PromiseImpl.resolve(value.__await).then(function(value) {
|
|
322
|
-
invoke("next", value, resolve, reject);
|
|
323
|
-
}, function(err) {
|
|
324
|
-
invoke("throw", err, resolve, reject);
|
|
325
|
-
});
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
return PromiseImpl.resolve(value).then(function(unwrapped) {
|
|
329
|
-
// When a yielded Promise is resolved, its final value becomes
|
|
330
|
-
// the .value of the Promise<{value,done}> result for the
|
|
331
|
-
// current iteration.
|
|
332
|
-
result.value = unwrapped;
|
|
333
|
-
resolve(result);
|
|
334
|
-
}, function(error) {
|
|
335
|
-
// If a rejected Promise was yielded, throw the rejection back
|
|
336
|
-
// into the async generator function so it can be handled there.
|
|
337
|
-
return invoke("throw", error, resolve, reject);
|
|
148
|
+
function AsyncIterator(t, e) {
|
|
149
|
+
function invoke(r, o, i, a) {
|
|
150
|
+
var c = tryCatch(t[r], t, o);
|
|
151
|
+
if ("throw" !== c.type) {
|
|
152
|
+
var u = c.arg,
|
|
153
|
+
h = u.value;
|
|
154
|
+
return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
|
155
|
+
invoke("next", t, i, a);
|
|
156
|
+
}, function (t) {
|
|
157
|
+
invoke("throw", t, i, a);
|
|
158
|
+
}) : e.resolve(h).then(function (t) {
|
|
159
|
+
u.value = t, i(u);
|
|
160
|
+
}, function (t) {
|
|
161
|
+
return invoke("throw", t, i, a);
|
|
338
162
|
});
|
|
339
163
|
}
|
|
164
|
+
a(c.arg);
|
|
340
165
|
}
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
}
|
|
166
|
+
var r;
|
|
167
|
+
o(this, "_invoke", {
|
|
168
|
+
value: function (t, n) {
|
|
169
|
+
function callInvokeWithMethodAndArg() {
|
|
170
|
+
return new e(function (e, r) {
|
|
171
|
+
invoke(t, n, e, r);
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
349
175
|
}
|
|
350
|
-
|
|
351
|
-
return previousPromise =
|
|
352
|
-
// If enqueue has been called before, then we want to wait until
|
|
353
|
-
// all previous Promises have been resolved before calling invoke,
|
|
354
|
-
// so that results are always delivered in the correct order. If
|
|
355
|
-
// enqueue has not been called before, then it is important to
|
|
356
|
-
// call invoke immediately, without waiting on a callback to fire,
|
|
357
|
-
// so that the async generator function has the opportunity to do
|
|
358
|
-
// any necessary setup in a predictable way. This predictability
|
|
359
|
-
// is why the Promise constructor synchronously invokes its
|
|
360
|
-
// executor callback, and why async functions synchronously
|
|
361
|
-
// execute code before the first await. Since we implement simple
|
|
362
|
-
// async functions in terms of async generators, it is especially
|
|
363
|
-
// important to get this right, even though it requires care.
|
|
364
|
-
previousPromise ? previousPromise.then(
|
|
365
|
-
callInvokeWithMethodAndArg,
|
|
366
|
-
// Avoid propagating failures to Promises returned by later
|
|
367
|
-
// invocations of the iterator.
|
|
368
|
-
callInvokeWithMethodAndArg
|
|
369
|
-
) : callInvokeWithMethodAndArg();
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
// Define the unified helper method that is used to implement .next,
|
|
373
|
-
// .throw, and .return (see defineIteratorMethods).
|
|
374
|
-
this._invoke = enqueue;
|
|
176
|
+
});
|
|
375
177
|
}
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
387
|
-
if (PromiseImpl === void 0) PromiseImpl = Promise;
|
|
388
|
-
|
|
389
|
-
var iter = new AsyncIterator(
|
|
390
|
-
wrap(innerFn, outerFn, self, tryLocsList),
|
|
391
|
-
PromiseImpl
|
|
392
|
-
);
|
|
393
|
-
|
|
394
|
-
return exports.isGeneratorFunction(outerFn)
|
|
395
|
-
? iter // If outerFn is a generator, return the full iterator.
|
|
396
|
-
: iter.next().then(function(result) {
|
|
397
|
-
return result.done ? result.value : iter.next();
|
|
398
|
-
});
|
|
399
|
-
};
|
|
400
|
-
|
|
401
|
-
function makeInvokeMethod(innerFn, self, context) {
|
|
402
|
-
var state = GenStateSuspendedStart;
|
|
403
|
-
|
|
404
|
-
return function invoke(method, arg) {
|
|
405
|
-
if (state === GenStateExecuting) {
|
|
406
|
-
throw new Error("Generator is already running");
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
if (state === GenStateCompleted) {
|
|
410
|
-
if (method === "throw") {
|
|
411
|
-
throw arg;
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
// Be forgiving, per 25.3.3.3.3 of the spec:
|
|
415
|
-
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
|
416
|
-
return doneResult();
|
|
178
|
+
function makeInvokeMethod(e, r, n) {
|
|
179
|
+
var o = h;
|
|
180
|
+
return function (i, a) {
|
|
181
|
+
if (o === f) throw Error("Generator is already running");
|
|
182
|
+
if (o === s) {
|
|
183
|
+
if ("throw" === i) throw a;
|
|
184
|
+
return {
|
|
185
|
+
value: t,
|
|
186
|
+
done: !0
|
|
187
|
+
};
|
|
417
188
|
}
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
426
|
-
if (delegateResult) {
|
|
427
|
-
if (delegateResult === ContinueSentinel) continue;
|
|
428
|
-
return delegateResult;
|
|
189
|
+
for (n.method = i, n.arg = a;;) {
|
|
190
|
+
var c = n.delegate;
|
|
191
|
+
if (c) {
|
|
192
|
+
var u = maybeInvokeDelegate(c, n);
|
|
193
|
+
if (u) {
|
|
194
|
+
if (u === y) continue;
|
|
195
|
+
return u;
|
|
429
196
|
}
|
|
430
197
|
}
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
if (
|
|
439
|
-
state = GenStateCompleted;
|
|
440
|
-
throw context.arg;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
context.dispatchException(context.arg);
|
|
444
|
-
|
|
445
|
-
} else if (context.method === "return") {
|
|
446
|
-
context.abrupt("return", context.arg);
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
state = GenStateExecuting;
|
|
450
|
-
|
|
451
|
-
var record = tryCatch(innerFn, self, context);
|
|
452
|
-
if (record.type === "normal") {
|
|
453
|
-
// If an exception is thrown from innerFn, we leave state ===
|
|
454
|
-
// GenStateExecuting and loop back for another invocation.
|
|
455
|
-
state = context.done
|
|
456
|
-
? GenStateCompleted
|
|
457
|
-
: GenStateSuspendedYield;
|
|
458
|
-
|
|
459
|
-
if (record.arg === ContinueSentinel) {
|
|
460
|
-
continue;
|
|
461
|
-
}
|
|
462
|
-
|
|
198
|
+
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
199
|
+
if (o === h) throw o = s, n.arg;
|
|
200
|
+
n.dispatchException(n.arg);
|
|
201
|
+
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
202
|
+
o = f;
|
|
203
|
+
var p = tryCatch(e, r, n);
|
|
204
|
+
if ("normal" === p.type) {
|
|
205
|
+
if (o = n.done ? s : l, p.arg === y) continue;
|
|
463
206
|
return {
|
|
464
|
-
value:
|
|
465
|
-
done:
|
|
207
|
+
value: p.arg,
|
|
208
|
+
done: n.done
|
|
466
209
|
};
|
|
467
|
-
|
|
468
|
-
} else if (record.type === "throw") {
|
|
469
|
-
state = GenStateCompleted;
|
|
470
|
-
// Dispatch the exception by looping back around to the
|
|
471
|
-
// context.dispatchException(context.arg) call above.
|
|
472
|
-
context.method = "throw";
|
|
473
|
-
context.arg = record.arg;
|
|
474
210
|
}
|
|
211
|
+
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
475
212
|
}
|
|
476
213
|
};
|
|
477
214
|
}
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
var
|
|
485
|
-
|
|
486
|
-
// A .throw or .return when the delegate iterator has no .throw
|
|
487
|
-
// method always terminates the yield* loop.
|
|
488
|
-
context.delegate = null;
|
|
489
|
-
|
|
490
|
-
if (context.method === "throw") {
|
|
491
|
-
// Note: ["return"] must be used for ES3 parsing compatibility.
|
|
492
|
-
if (delegate.iterator["return"]) {
|
|
493
|
-
// If the delegate iterator has a return method, give it a
|
|
494
|
-
// chance to clean up.
|
|
495
|
-
context.method = "return";
|
|
496
|
-
context.arg = undefined$1;
|
|
497
|
-
maybeInvokeDelegate(delegate, context);
|
|
498
|
-
|
|
499
|
-
if (context.method === "throw") {
|
|
500
|
-
// If maybeInvokeDelegate(context) changed context.method from
|
|
501
|
-
// "return" to "throw", let that override the TypeError below.
|
|
502
|
-
return ContinueSentinel;
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
context.method = "throw";
|
|
507
|
-
context.arg = new TypeError(
|
|
508
|
-
"The iterator does not provide a 'throw' method");
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
return ContinueSentinel;
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
515
|
-
|
|
516
|
-
if (record.type === "throw") {
|
|
517
|
-
context.method = "throw";
|
|
518
|
-
context.arg = record.arg;
|
|
519
|
-
context.delegate = null;
|
|
520
|
-
return ContinueSentinel;
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
var info = record.arg;
|
|
524
|
-
|
|
525
|
-
if (! info) {
|
|
526
|
-
context.method = "throw";
|
|
527
|
-
context.arg = new TypeError("iterator result is not an object");
|
|
528
|
-
context.delegate = null;
|
|
529
|
-
return ContinueSentinel;
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
if (info.done) {
|
|
533
|
-
// Assign the result of the finished delegate to the temporary
|
|
534
|
-
// variable specified by delegate.resultName (see delegateYield).
|
|
535
|
-
context[delegate.resultName] = info.value;
|
|
536
|
-
|
|
537
|
-
// Resume execution at the desired location (see delegateYield).
|
|
538
|
-
context.next = delegate.nextLoc;
|
|
539
|
-
|
|
540
|
-
// If context.method was "throw" but the delegate handled the
|
|
541
|
-
// exception, let the outer generator proceed normally. If
|
|
542
|
-
// context.method was "next", forget context.arg since it has been
|
|
543
|
-
// "consumed" by the delegate iterator. If context.method was
|
|
544
|
-
// "return", allow the original .return call to continue in the
|
|
545
|
-
// outer generator.
|
|
546
|
-
if (context.method !== "return") {
|
|
547
|
-
context.method = "next";
|
|
548
|
-
context.arg = undefined$1;
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
} else {
|
|
552
|
-
// Re-yield the result returned by the delegate method.
|
|
553
|
-
return info;
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
// The delegate iterator is finished, so forget it and continue with
|
|
557
|
-
// the outer generator.
|
|
558
|
-
context.delegate = null;
|
|
559
|
-
return ContinueSentinel;
|
|
215
|
+
function maybeInvokeDelegate(e, r) {
|
|
216
|
+
var n = r.method,
|
|
217
|
+
o = e.iterator[n];
|
|
218
|
+
if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
|
|
219
|
+
var i = tryCatch(o, e.iterator, r.arg);
|
|
220
|
+
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
221
|
+
var a = i.arg;
|
|
222
|
+
return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
|
|
560
223
|
}
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
define(Gp, toStringTagSymbol, "Generator");
|
|
567
|
-
|
|
568
|
-
// A Generator should always return itself as the iterator object when the
|
|
569
|
-
// @@iterator function is called on it. Some browsers' implementations of the
|
|
570
|
-
// iterator prototype chain incorrectly implement this, causing the Generator
|
|
571
|
-
// object to not be returned from this call. This ensures that doesn't happen.
|
|
572
|
-
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
|
573
|
-
define(Gp, iteratorSymbol, function() {
|
|
574
|
-
return this;
|
|
575
|
-
});
|
|
576
|
-
|
|
577
|
-
define(Gp, "toString", function() {
|
|
578
|
-
return "[object Generator]";
|
|
579
|
-
});
|
|
580
|
-
|
|
581
|
-
function pushTryEntry(locs) {
|
|
582
|
-
var entry = { tryLoc: locs[0] };
|
|
583
|
-
|
|
584
|
-
if (1 in locs) {
|
|
585
|
-
entry.catchLoc = locs[1];
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
if (2 in locs) {
|
|
589
|
-
entry.finallyLoc = locs[2];
|
|
590
|
-
entry.afterLoc = locs[3];
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
this.tryEntries.push(entry);
|
|
224
|
+
function pushTryEntry(t) {
|
|
225
|
+
var e = {
|
|
226
|
+
tryLoc: t[0]
|
|
227
|
+
};
|
|
228
|
+
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
594
229
|
}
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
record.type = "normal";
|
|
599
|
-
delete record.arg;
|
|
600
|
-
entry.completion = record;
|
|
230
|
+
function resetTryEntry(t) {
|
|
231
|
+
var e = t.completion || {};
|
|
232
|
+
e.type = "normal", delete e.arg, t.completion = e;
|
|
601
233
|
}
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
// locations where there is no enclosing try statement.
|
|
607
|
-
this.tryEntries = [{ tryLoc: "root" }];
|
|
608
|
-
tryLocsList.forEach(pushTryEntry, this);
|
|
609
|
-
this.reset(true);
|
|
234
|
+
function Context(t) {
|
|
235
|
+
this.tryEntries = [{
|
|
236
|
+
tryLoc: "root"
|
|
237
|
+
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
610
238
|
}
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
var key = keys.pop();
|
|
624
|
-
if (key in object) {
|
|
625
|
-
next.value = key;
|
|
626
|
-
next.done = false;
|
|
627
|
-
return next;
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
// To avoid creating an additional object, we just hang the .value
|
|
632
|
-
// and .done properties off the next function object itself. This
|
|
633
|
-
// also ensures that the minifier will not anonymize the function.
|
|
634
|
-
next.done = true;
|
|
635
|
-
return next;
|
|
636
|
-
};
|
|
637
|
-
};
|
|
638
|
-
|
|
639
|
-
function values(iterable) {
|
|
640
|
-
if (iterable) {
|
|
641
|
-
var iteratorMethod = iterable[iteratorSymbol];
|
|
642
|
-
if (iteratorMethod) {
|
|
643
|
-
return iteratorMethod.call(iterable);
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
if (typeof iterable.next === "function") {
|
|
647
|
-
return iterable;
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
if (!isNaN(iterable.length)) {
|
|
651
|
-
var i = -1, next = function next() {
|
|
652
|
-
while (++i < iterable.length) {
|
|
653
|
-
if (hasOwn.call(iterable, i)) {
|
|
654
|
-
next.value = iterable[i];
|
|
655
|
-
next.done = false;
|
|
656
|
-
return next;
|
|
657
|
-
}
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
next.value = undefined$1;
|
|
661
|
-
next.done = true;
|
|
662
|
-
|
|
663
|
-
return next;
|
|
664
|
-
};
|
|
665
|
-
|
|
666
|
-
return next.next = next;
|
|
239
|
+
function values(e) {
|
|
240
|
+
if (e || "" === e) {
|
|
241
|
+
var r = e[a];
|
|
242
|
+
if (r) return r.call(e);
|
|
243
|
+
if ("function" == typeof e.next) return e;
|
|
244
|
+
if (!isNaN(e.length)) {
|
|
245
|
+
var o = -1,
|
|
246
|
+
i = function next() {
|
|
247
|
+
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
|
|
248
|
+
return next.value = t, next.done = !0, next;
|
|
249
|
+
};
|
|
250
|
+
return i.next = i;
|
|
667
251
|
}
|
|
668
252
|
}
|
|
669
|
-
|
|
670
|
-
// Return an iterator with no values.
|
|
671
|
-
return { next: doneResult };
|
|
253
|
+
throw new TypeError(typeof e + " is not iterable");
|
|
672
254
|
}
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
constructor
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
255
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
|
256
|
+
value: GeneratorFunctionPrototype,
|
|
257
|
+
configurable: !0
|
|
258
|
+
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
259
|
+
value: GeneratorFunction,
|
|
260
|
+
configurable: !0
|
|
261
|
+
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
262
|
+
var e = "function" == typeof t && t.constructor;
|
|
263
|
+
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
264
|
+
}, e.mark = function (t) {
|
|
265
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
266
|
+
}, e.awrap = function (t) {
|
|
267
|
+
return {
|
|
268
|
+
__await: t
|
|
269
|
+
};
|
|
270
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
271
|
+
return this;
|
|
272
|
+
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
|
273
|
+
void 0 === i && (i = Promise);
|
|
274
|
+
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
275
|
+
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
276
|
+
return t.done ? t.value : a.next();
|
|
277
|
+
});
|
|
278
|
+
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
279
|
+
return this;
|
|
280
|
+
}), define(g, "toString", function () {
|
|
281
|
+
return "[object Generator]";
|
|
282
|
+
}), e.keys = function (t) {
|
|
283
|
+
var e = Object(t),
|
|
284
|
+
r = [];
|
|
285
|
+
for (var n in e) r.push(n);
|
|
286
|
+
return r.reverse(), function next() {
|
|
287
|
+
for (; r.length;) {
|
|
288
|
+
var t = r.pop();
|
|
289
|
+
if (t in e) return next.value = t, next.done = !1, next;
|
|
705
290
|
}
|
|
291
|
+
return next.done = !0, next;
|
|
292
|
+
};
|
|
293
|
+
}, e.values = values, Context.prototype = {
|
|
294
|
+
constructor: Context,
|
|
295
|
+
reset: function (e) {
|
|
296
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
|
|
706
297
|
},
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
var rootEntry = this.tryEntries[0];
|
|
712
|
-
var rootRecord = rootEntry.completion;
|
|
713
|
-
if (rootRecord.type === "throw") {
|
|
714
|
-
throw rootRecord.arg;
|
|
715
|
-
}
|
|
716
|
-
|
|
298
|
+
stop: function () {
|
|
299
|
+
this.done = !0;
|
|
300
|
+
var t = this.tryEntries[0].completion;
|
|
301
|
+
if ("throw" === t.type) throw t.arg;
|
|
717
302
|
return this.rval;
|
|
718
303
|
},
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
var context = this;
|
|
726
|
-
function handle(loc, caught) {
|
|
727
|
-
record.type = "throw";
|
|
728
|
-
record.arg = exception;
|
|
729
|
-
context.next = loc;
|
|
730
|
-
|
|
731
|
-
if (caught) {
|
|
732
|
-
// If the dispatched exception was caught by a catch block,
|
|
733
|
-
// then let that catch block handle the exception normally.
|
|
734
|
-
context.method = "next";
|
|
735
|
-
context.arg = undefined$1;
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
return !! caught;
|
|
304
|
+
dispatchException: function (e) {
|
|
305
|
+
if (this.done) throw e;
|
|
306
|
+
var r = this;
|
|
307
|
+
function handle(n, o) {
|
|
308
|
+
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
739
309
|
}
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
if (entry.tryLoc <= this.prev) {
|
|
753
|
-
var hasCatch = hasOwn.call(entry, "catchLoc");
|
|
754
|
-
var hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
755
|
-
|
|
756
|
-
if (hasCatch && hasFinally) {
|
|
757
|
-
if (this.prev < entry.catchLoc) {
|
|
758
|
-
return handle(entry.catchLoc, true);
|
|
759
|
-
} else if (this.prev < entry.finallyLoc) {
|
|
760
|
-
return handle(entry.finallyLoc);
|
|
761
|
-
}
|
|
762
|
-
|
|
763
|
-
} else if (hasCatch) {
|
|
764
|
-
if (this.prev < entry.catchLoc) {
|
|
765
|
-
return handle(entry.catchLoc, true);
|
|
766
|
-
}
|
|
767
|
-
|
|
768
|
-
} else if (hasFinally) {
|
|
769
|
-
if (this.prev < entry.finallyLoc) {
|
|
770
|
-
return handle(entry.finallyLoc);
|
|
771
|
-
}
|
|
772
|
-
|
|
310
|
+
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
311
|
+
var i = this.tryEntries[o],
|
|
312
|
+
a = i.completion;
|
|
313
|
+
if ("root" === i.tryLoc) return handle("end");
|
|
314
|
+
if (i.tryLoc <= this.prev) {
|
|
315
|
+
var c = n.call(i, "catchLoc"),
|
|
316
|
+
u = n.call(i, "finallyLoc");
|
|
317
|
+
if (c && u) {
|
|
318
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
319
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
320
|
+
} else if (c) {
|
|
321
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
773
322
|
} else {
|
|
774
|
-
throw
|
|
323
|
+
if (!u) throw Error("try statement without catch or finally");
|
|
324
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
775
325
|
}
|
|
776
326
|
}
|
|
777
327
|
}
|
|
778
328
|
},
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
hasOwn.call(entry, "finallyLoc") &&
|
|
785
|
-
this.prev < entry.finallyLoc) {
|
|
786
|
-
var finallyEntry = entry;
|
|
329
|
+
abrupt: function (t, e) {
|
|
330
|
+
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
331
|
+
var o = this.tryEntries[r];
|
|
332
|
+
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
333
|
+
var i = o;
|
|
787
334
|
break;
|
|
788
335
|
}
|
|
789
336
|
}
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
type === "continue") &&
|
|
794
|
-
finallyEntry.tryLoc <= arg &&
|
|
795
|
-
arg <= finallyEntry.finallyLoc) {
|
|
796
|
-
// Ignore the finally entry if control is not jumping to a
|
|
797
|
-
// location outside the try/catch block.
|
|
798
|
-
finallyEntry = null;
|
|
799
|
-
}
|
|
800
|
-
|
|
801
|
-
var record = finallyEntry ? finallyEntry.completion : {};
|
|
802
|
-
record.type = type;
|
|
803
|
-
record.arg = arg;
|
|
804
|
-
|
|
805
|
-
if (finallyEntry) {
|
|
806
|
-
this.method = "next";
|
|
807
|
-
this.next = finallyEntry.finallyLoc;
|
|
808
|
-
return ContinueSentinel;
|
|
809
|
-
}
|
|
810
|
-
|
|
811
|
-
return this.complete(record);
|
|
337
|
+
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
338
|
+
var a = i ? i.completion : {};
|
|
339
|
+
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
812
340
|
},
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
throw record.arg;
|
|
817
|
-
}
|
|
818
|
-
|
|
819
|
-
if (record.type === "break" ||
|
|
820
|
-
record.type === "continue") {
|
|
821
|
-
this.next = record.arg;
|
|
822
|
-
} else if (record.type === "return") {
|
|
823
|
-
this.rval = this.arg = record.arg;
|
|
824
|
-
this.method = "return";
|
|
825
|
-
this.next = "end";
|
|
826
|
-
} else if (record.type === "normal" && afterLoc) {
|
|
827
|
-
this.next = afterLoc;
|
|
828
|
-
}
|
|
829
|
-
|
|
830
|
-
return ContinueSentinel;
|
|
341
|
+
complete: function (t, e) {
|
|
342
|
+
if ("throw" === t.type) throw t.arg;
|
|
343
|
+
return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
|
|
831
344
|
},
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
if (entry.finallyLoc === finallyLoc) {
|
|
837
|
-
this.complete(entry.completion, entry.afterLoc);
|
|
838
|
-
resetTryEntry(entry);
|
|
839
|
-
return ContinueSentinel;
|
|
840
|
-
}
|
|
345
|
+
finish: function (t) {
|
|
346
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
347
|
+
var r = this.tryEntries[e];
|
|
348
|
+
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
841
349
|
}
|
|
842
350
|
},
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
resetTryEntry(entry);
|
|
351
|
+
catch: function (t) {
|
|
352
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
353
|
+
var r = this.tryEntries[e];
|
|
354
|
+
if (r.tryLoc === t) {
|
|
355
|
+
var n = r.completion;
|
|
356
|
+
if ("throw" === n.type) {
|
|
357
|
+
var o = n.arg;
|
|
358
|
+
resetTryEntry(r);
|
|
852
359
|
}
|
|
853
|
-
return
|
|
360
|
+
return o;
|
|
854
361
|
}
|
|
855
362
|
}
|
|
856
|
-
|
|
857
|
-
// The context.catch method must only be called with a location
|
|
858
|
-
// argument that corresponds to a known catch block.
|
|
859
|
-
throw new Error("illegal catch attempt");
|
|
363
|
+
throw Error("illegal catch attempt");
|
|
860
364
|
},
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
};
|
|
868
|
-
|
|
869
|
-
if (this.method === "next") {
|
|
870
|
-
// Deliberately forget the last sent value so that we don't
|
|
871
|
-
// accidentally pass it on to the delegate.
|
|
872
|
-
this.arg = undefined$1;
|
|
873
|
-
}
|
|
874
|
-
|
|
875
|
-
return ContinueSentinel;
|
|
365
|
+
delegateYield: function (e, r, n) {
|
|
366
|
+
return this.delegate = {
|
|
367
|
+
iterator: values(e),
|
|
368
|
+
resultName: r,
|
|
369
|
+
nextLoc: n
|
|
370
|
+
}, "next" === this.method && (this.arg = t), y;
|
|
876
371
|
}
|
|
877
|
-
};
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
)
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
}
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
// problems, please detail your unique predicament in a GitHub issue.
|
|
906
|
-
if (typeof globalThis === "object") {
|
|
907
|
-
globalThis.regeneratorRuntime = runtime;
|
|
908
|
-
} else {
|
|
909
|
-
Function("r", "regeneratorRuntime = r")(runtime);
|
|
910
|
-
}
|
|
372
|
+
}, e;
|
|
373
|
+
}
|
|
374
|
+
function _setPrototypeOf(t, e) {
|
|
375
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
376
|
+
return t.__proto__ = e, t;
|
|
377
|
+
}, _setPrototypeOf(t, e);
|
|
378
|
+
}
|
|
379
|
+
function _wrapNativeSuper(t) {
|
|
380
|
+
var r = "function" == typeof Map ? new Map() : void 0;
|
|
381
|
+
return _wrapNativeSuper = function (t) {
|
|
382
|
+
if (null === t || !_isNativeFunction(t)) return t;
|
|
383
|
+
if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
|
|
384
|
+
if (void 0 !== r) {
|
|
385
|
+
if (r.has(t)) return r.get(t);
|
|
386
|
+
r.set(t, Wrapper);
|
|
387
|
+
}
|
|
388
|
+
function Wrapper() {
|
|
389
|
+
return _construct(t, arguments, _getPrototypeOf(this).constructor);
|
|
390
|
+
}
|
|
391
|
+
return Wrapper.prototype = Object.create(t.prototype, {
|
|
392
|
+
constructor: {
|
|
393
|
+
value: Wrapper,
|
|
394
|
+
enumerable: !1,
|
|
395
|
+
writable: !0,
|
|
396
|
+
configurable: !0
|
|
397
|
+
}
|
|
398
|
+
}), _setPrototypeOf(Wrapper, t);
|
|
399
|
+
}, _wrapNativeSuper(t);
|
|
911
400
|
}
|
|
912
|
-
});
|
|
913
401
|
|
|
914
402
|
var TooFewSubscribersError = /*#__PURE__*/function (_Error) {
|
|
915
|
-
_inheritsLoose(TooFewSubscribersError, _Error);
|
|
916
|
-
|
|
917
403
|
function TooFewSubscribersError(message) {
|
|
918
404
|
var _this;
|
|
919
|
-
|
|
920
405
|
if (message === void 0) {
|
|
921
406
|
message = 'Too few subscribers';
|
|
922
407
|
}
|
|
923
|
-
|
|
924
408
|
_this = _Error.call(this, message) || this;
|
|
925
409
|
_this.name = 'TooFewSubscribersError';
|
|
926
410
|
return _this;
|
|
927
411
|
}
|
|
928
|
-
|
|
412
|
+
_inheritsLoose(TooFewSubscribersError, _Error);
|
|
929
413
|
return TooFewSubscribersError;
|
|
930
414
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
931
415
|
var TooManySubscribersError = /*#__PURE__*/function (_Error2) {
|
|
932
|
-
_inheritsLoose(TooManySubscribersError, _Error2);
|
|
933
|
-
|
|
934
416
|
function TooManySubscribersError(message) {
|
|
935
417
|
var _this2;
|
|
936
|
-
|
|
937
418
|
if (message === void 0) {
|
|
938
419
|
message = 'Too many subscribers';
|
|
939
420
|
}
|
|
940
|
-
|
|
941
421
|
_this2 = _Error2.call(this, message) || this;
|
|
942
422
|
_this2.name = 'TooManySubscribersError';
|
|
943
423
|
return _this2;
|
|
944
424
|
}
|
|
945
|
-
|
|
425
|
+
_inheritsLoose(TooManySubscribersError, _Error2);
|
|
946
426
|
return TooManySubscribersError;
|
|
947
427
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
948
428
|
var TooFewEventsError = /*#__PURE__*/function (_Error3) {
|
|
949
|
-
_inheritsLoose(TooFewEventsError, _Error3);
|
|
950
|
-
|
|
951
429
|
function TooFewEventsError(message) {
|
|
952
430
|
var _this3;
|
|
953
|
-
|
|
954
431
|
if (message === void 0) {
|
|
955
432
|
message = 'Too few events';
|
|
956
433
|
}
|
|
957
|
-
|
|
958
434
|
_this3 = _Error3.call(this, message) || this;
|
|
959
435
|
_this3.name = 'TooFewEventsError';
|
|
960
436
|
return _this3;
|
|
961
437
|
}
|
|
962
|
-
|
|
438
|
+
_inheritsLoose(TooFewEventsError, _Error3);
|
|
963
439
|
return TooFewEventsError;
|
|
964
440
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
965
441
|
var TooManyEventsError = /*#__PURE__*/function (_Error4) {
|
|
966
|
-
_inheritsLoose(TooManyEventsError, _Error4);
|
|
967
|
-
|
|
968
442
|
function TooManyEventsError(message) {
|
|
969
443
|
var _this4;
|
|
970
|
-
|
|
971
444
|
if (message === void 0) {
|
|
972
445
|
message = 'Too many events';
|
|
973
446
|
}
|
|
974
|
-
|
|
975
447
|
_this4 = _Error4.call(this, message) || this;
|
|
976
448
|
_this4.name = 'TooManyEventsError';
|
|
977
449
|
return _this4;
|
|
978
450
|
}
|
|
979
|
-
|
|
451
|
+
_inheritsLoose(TooManyEventsError, _Error4);
|
|
980
452
|
return TooManyEventsError;
|
|
981
453
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
982
454
|
var TooFewEmailsError = /*#__PURE__*/function (_Error5) {
|
|
983
|
-
_inheritsLoose(TooFewEmailsError, _Error5);
|
|
984
|
-
|
|
985
455
|
function TooFewEmailsError(message) {
|
|
986
456
|
var _this5;
|
|
987
|
-
|
|
988
457
|
if (message === void 0) {
|
|
989
458
|
message = 'Too few emails';
|
|
990
459
|
}
|
|
991
|
-
|
|
992
460
|
_this5 = _Error5.call(this, message) || this;
|
|
993
461
|
_this5.name = 'TooFewEmailsError';
|
|
994
462
|
return _this5;
|
|
995
463
|
}
|
|
996
|
-
|
|
464
|
+
_inheritsLoose(TooFewEmailsError, _Error5);
|
|
997
465
|
return TooFewEmailsError;
|
|
998
466
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
999
467
|
var TooManyEmailsError = /*#__PURE__*/function (_Error6) {
|
|
1000
|
-
_inheritsLoose(TooManyEmailsError, _Error6);
|
|
1001
|
-
|
|
1002
468
|
function TooManyEmailsError(message) {
|
|
1003
469
|
var _this6;
|
|
1004
|
-
|
|
1005
470
|
if (message === void 0) {
|
|
1006
471
|
message = 'Too many emails';
|
|
1007
472
|
}
|
|
1008
|
-
|
|
1009
473
|
_this6 = _Error6.call(this, message) || this;
|
|
1010
474
|
_this6.name = 'TooManyEmailsError';
|
|
1011
475
|
return _this6;
|
|
1012
476
|
}
|
|
1013
|
-
|
|
477
|
+
_inheritsLoose(TooManyEmailsError, _Error6);
|
|
1014
478
|
return TooManyEmailsError;
|
|
1015
479
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
1016
480
|
|
|
@@ -1040,56 +504,43 @@ var BentoBatch = /*#__PURE__*/function () {
|
|
|
1040
504
|
* @param parameters
|
|
1041
505
|
* @returns Promise\<number\>
|
|
1042
506
|
*/
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
507
|
var _proto = BentoBatch.prototype;
|
|
1046
|
-
|
|
1047
508
|
_proto.importSubscribers =
|
|
1048
509
|
/*#__PURE__*/
|
|
1049
510
|
function () {
|
|
1050
|
-
var _importSubscribers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
511
|
+
var _importSubscribers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(parameters) {
|
|
1051
512
|
var result;
|
|
1052
|
-
return
|
|
1053
|
-
while (1) {
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
case 6:
|
|
1078
|
-
result = _context.sent;
|
|
1079
|
-
return _context.abrupt("return", result.results);
|
|
1080
|
-
|
|
1081
|
-
case 8:
|
|
1082
|
-
case "end":
|
|
1083
|
-
return _context.stop();
|
|
1084
|
-
}
|
|
513
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
514
|
+
while (1) switch (_context.prev = _context.next) {
|
|
515
|
+
case 0:
|
|
516
|
+
if (!(parameters.subscribers.length === 0)) {
|
|
517
|
+
_context.next = 2;
|
|
518
|
+
break;
|
|
519
|
+
}
|
|
520
|
+
throw new TooFewSubscribersError("You must send between 1 and 1,000 subscribers.");
|
|
521
|
+
case 2:
|
|
522
|
+
if (!(parameters.subscribers.length > this._maxBatchSize)) {
|
|
523
|
+
_context.next = 4;
|
|
524
|
+
break;
|
|
525
|
+
}
|
|
526
|
+
throw new TooManySubscribersError("You must send between 1 and 1,000 subscribers.");
|
|
527
|
+
case 4:
|
|
528
|
+
_context.next = 6;
|
|
529
|
+
return this._client.post(this._url + "/subscribers", {
|
|
530
|
+
subscribers: parameters.subscribers
|
|
531
|
+
});
|
|
532
|
+
case 6:
|
|
533
|
+
result = _context.sent;
|
|
534
|
+
return _context.abrupt("return", result.results);
|
|
535
|
+
case 8:
|
|
536
|
+
case "end":
|
|
537
|
+
return _context.stop();
|
|
1085
538
|
}
|
|
1086
539
|
}, _callee, this);
|
|
1087
540
|
}));
|
|
1088
|
-
|
|
1089
541
|
function importSubscribers(_x) {
|
|
1090
542
|
return _importSubscribers.apply(this, arguments);
|
|
1091
543
|
}
|
|
1092
|
-
|
|
1093
544
|
return importSubscribers;
|
|
1094
545
|
}()
|
|
1095
546
|
/**
|
|
@@ -1104,53 +555,42 @@ var BentoBatch = /*#__PURE__*/function () {
|
|
|
1104
555
|
* @returns Promise\<number\>
|
|
1105
556
|
*/
|
|
1106
557
|
;
|
|
1107
|
-
|
|
1108
558
|
_proto.importEvents =
|
|
1109
559
|
/*#__PURE__*/
|
|
1110
560
|
function () {
|
|
1111
|
-
var _importEvents = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
561
|
+
var _importEvents = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(parameters) {
|
|
1112
562
|
var result;
|
|
1113
|
-
return
|
|
1114
|
-
while (1) {
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
case 6:
|
|
1139
|
-
result = _context2.sent;
|
|
1140
|
-
return _context2.abrupt("return", result.results);
|
|
1141
|
-
|
|
1142
|
-
case 8:
|
|
1143
|
-
case "end":
|
|
1144
|
-
return _context2.stop();
|
|
1145
|
-
}
|
|
563
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
564
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
565
|
+
case 0:
|
|
566
|
+
if (!(parameters.events.length === 0)) {
|
|
567
|
+
_context2.next = 2;
|
|
568
|
+
break;
|
|
569
|
+
}
|
|
570
|
+
throw new TooFewEventsError("You must send between 1 and 1,000 events.");
|
|
571
|
+
case 2:
|
|
572
|
+
if (!(parameters.events.length > this._maxBatchSize)) {
|
|
573
|
+
_context2.next = 4;
|
|
574
|
+
break;
|
|
575
|
+
}
|
|
576
|
+
throw new TooManyEventsError("You must send between 1 and 1,000 events.");
|
|
577
|
+
case 4:
|
|
578
|
+
_context2.next = 6;
|
|
579
|
+
return this._client.post(this._url + "/events", {
|
|
580
|
+
events: parameters.events
|
|
581
|
+
});
|
|
582
|
+
case 6:
|
|
583
|
+
result = _context2.sent;
|
|
584
|
+
return _context2.abrupt("return", result.results);
|
|
585
|
+
case 8:
|
|
586
|
+
case "end":
|
|
587
|
+
return _context2.stop();
|
|
1146
588
|
}
|
|
1147
589
|
}, _callee2, this);
|
|
1148
590
|
}));
|
|
1149
|
-
|
|
1150
591
|
function importEvents(_x2) {
|
|
1151
592
|
return _importEvents.apply(this, arguments);
|
|
1152
593
|
}
|
|
1153
|
-
|
|
1154
594
|
return importEvents;
|
|
1155
595
|
}()
|
|
1156
596
|
/**
|
|
@@ -1168,98 +608,77 @@ var BentoBatch = /*#__PURE__*/function () {
|
|
|
1168
608
|
* @returns Promise\<number\>
|
|
1169
609
|
*/
|
|
1170
610
|
;
|
|
1171
|
-
|
|
1172
611
|
_proto.sendTransactionalEmails =
|
|
1173
612
|
/*#__PURE__*/
|
|
1174
613
|
function () {
|
|
1175
|
-
var _sendTransactionalEmails = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
614
|
+
var _sendTransactionalEmails = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(parameters) {
|
|
1176
615
|
var result;
|
|
1177
|
-
return
|
|
1178
|
-
while (1) {
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
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
|
-
}
|
|
616
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
617
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
618
|
+
case 0:
|
|
619
|
+
if (!(parameters.emails.length === 0)) {
|
|
620
|
+
_context3.next = 2;
|
|
621
|
+
break;
|
|
622
|
+
}
|
|
623
|
+
throw new TooFewEmailsError("You must send between 1 and 100 emails.");
|
|
624
|
+
case 2:
|
|
625
|
+
if (!(parameters.emails.length > this._maxEmailBatchSize)) {
|
|
626
|
+
_context3.next = 4;
|
|
627
|
+
break;
|
|
628
|
+
}
|
|
629
|
+
throw new TooManyEmailsError("You must send between 1 and 100 emails.");
|
|
630
|
+
case 4:
|
|
631
|
+
_context3.next = 6;
|
|
632
|
+
return this._client.post(this._url + "/emails", {
|
|
633
|
+
emails: parameters.emails
|
|
634
|
+
});
|
|
635
|
+
case 6:
|
|
636
|
+
result = _context3.sent;
|
|
637
|
+
return _context3.abrupt("return", result.results);
|
|
638
|
+
case 8:
|
|
639
|
+
case "end":
|
|
640
|
+
return _context3.stop();
|
|
1210
641
|
}
|
|
1211
642
|
}, _callee3, this);
|
|
1212
643
|
}));
|
|
1213
|
-
|
|
1214
644
|
function sendTransactionalEmails(_x3) {
|
|
1215
645
|
return _sendTransactionalEmails.apply(this, arguments);
|
|
1216
646
|
}
|
|
1217
|
-
|
|
1218
647
|
return sendTransactionalEmails;
|
|
1219
648
|
}();
|
|
1220
|
-
|
|
1221
649
|
return BentoBatch;
|
|
1222
650
|
}();
|
|
1223
651
|
|
|
1224
652
|
var NotAuthorizedError = /*#__PURE__*/function (_Error) {
|
|
1225
|
-
_inheritsLoose(NotAuthorizedError, _Error);
|
|
1226
|
-
|
|
1227
653
|
function NotAuthorizedError(message) {
|
|
1228
654
|
var _this;
|
|
1229
|
-
|
|
1230
655
|
if (message === void 0) {
|
|
1231
656
|
message = 'Not authorized';
|
|
1232
657
|
}
|
|
1233
|
-
|
|
1234
658
|
_this = _Error.call(this, message) || this;
|
|
1235
659
|
_this.name = 'NotAuthorizedError';
|
|
1236
660
|
return _this;
|
|
1237
661
|
}
|
|
1238
|
-
|
|
662
|
+
_inheritsLoose(NotAuthorizedError, _Error);
|
|
1239
663
|
return NotAuthorizedError;
|
|
1240
664
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
1241
665
|
var RateLimitedError = /*#__PURE__*/function (_Error2) {
|
|
1242
|
-
_inheritsLoose(RateLimitedError, _Error2);
|
|
1243
|
-
|
|
1244
666
|
function RateLimitedError(message) {
|
|
1245
667
|
var _this2;
|
|
1246
|
-
|
|
1247
668
|
if (message === void 0) {
|
|
1248
669
|
message = 'You are being rate limited';
|
|
1249
670
|
}
|
|
1250
|
-
|
|
1251
671
|
_this2 = _Error2.call(this, message) || this;
|
|
1252
672
|
_this2.name = 'RateLimitedError';
|
|
1253
673
|
return _this2;
|
|
1254
674
|
}
|
|
1255
|
-
|
|
675
|
+
_inheritsLoose(RateLimitedError, _Error2);
|
|
1256
676
|
return RateLimitedError;
|
|
1257
677
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
1258
678
|
|
|
1259
679
|
var BentoClient = /*#__PURE__*/function () {
|
|
1260
680
|
function BentoClient(options) {
|
|
1261
681
|
var _options$clientOption;
|
|
1262
|
-
|
|
1263
682
|
this._headers = {};
|
|
1264
683
|
this._baseUrl = 'https://app.bentonow.com/api/v1';
|
|
1265
684
|
this._siteUuid = '';
|
|
@@ -1277,51 +696,38 @@ var BentoClient = /*#__PURE__*/function () {
|
|
|
1277
696
|
* @param payload object
|
|
1278
697
|
* @returns Promise\<T\>
|
|
1279
698
|
* */
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
699
|
var _proto = BentoClient.prototype;
|
|
1283
|
-
|
|
1284
700
|
_proto.get = function get(endpoint, payload) {
|
|
1285
701
|
var _this = this;
|
|
1286
|
-
|
|
1287
702
|
if (payload === void 0) {
|
|
1288
703
|
payload = {};
|
|
1289
704
|
}
|
|
1290
|
-
|
|
1291
705
|
return new Promise(function (resolve, reject) {
|
|
1292
706
|
var queryParameters = _this._getQueryParameters(payload);
|
|
1293
|
-
|
|
1294
707
|
fetch("" + _this._baseUrl + endpoint + "?" + queryParameters, {
|
|
1295
708
|
method: 'GET',
|
|
1296
709
|
headers: _this._headers
|
|
1297
710
|
}).then( /*#__PURE__*/function () {
|
|
1298
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/
|
|
1299
|
-
return
|
|
1300
|
-
while (1) {
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
throw _context.sent;
|
|
1316
|
-
|
|
1317
|
-
case 5:
|
|
1318
|
-
case "end":
|
|
1319
|
-
return _context.stop();
|
|
1320
|
-
}
|
|
711
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(result) {
|
|
712
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
713
|
+
while (1) switch (_context.prev = _context.next) {
|
|
714
|
+
case 0:
|
|
715
|
+
if (!_this._isSuccessfulStatus(result.status)) {
|
|
716
|
+
_context.next = 2;
|
|
717
|
+
break;
|
|
718
|
+
}
|
|
719
|
+
return _context.abrupt("return", result.json());
|
|
720
|
+
case 2:
|
|
721
|
+
_context.next = 4;
|
|
722
|
+
return _this._getErrorForResponse(result);
|
|
723
|
+
case 4:
|
|
724
|
+
throw _context.sent;
|
|
725
|
+
case 5:
|
|
726
|
+
case "end":
|
|
727
|
+
return _context.stop();
|
|
1321
728
|
}
|
|
1322
729
|
}, _callee);
|
|
1323
730
|
}));
|
|
1324
|
-
|
|
1325
731
|
return function (_x) {
|
|
1326
732
|
return _ref.apply(this, arguments);
|
|
1327
733
|
};
|
|
@@ -1339,19 +745,14 @@ var BentoClient = /*#__PURE__*/function () {
|
|
|
1339
745
|
* @param endpoint string
|
|
1340
746
|
* @param payload object
|
|
1341
747
|
* @returns Promise\<T\>
|
|
1342
|
-
*
|
|
1343
|
-
;
|
|
1344
|
-
|
|
748
|
+
* */;
|
|
1345
749
|
_proto.post = function post(endpoint, payload) {
|
|
1346
750
|
var _this2 = this;
|
|
1347
|
-
|
|
1348
751
|
if (payload === void 0) {
|
|
1349
752
|
payload = {};
|
|
1350
753
|
}
|
|
1351
|
-
|
|
1352
754
|
return new Promise(function (resolve, reject) {
|
|
1353
755
|
var body = _this2._getBody(payload);
|
|
1354
|
-
|
|
1355
756
|
fetch("" + _this2._baseUrl + endpoint, {
|
|
1356
757
|
method: 'POST',
|
|
1357
758
|
headers: _extends({}, _this2._headers, {
|
|
@@ -1359,33 +760,26 @@ var BentoClient = /*#__PURE__*/function () {
|
|
|
1359
760
|
}),
|
|
1360
761
|
body: body
|
|
1361
762
|
}).then( /*#__PURE__*/function () {
|
|
1362
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/
|
|
1363
|
-
return
|
|
1364
|
-
while (1) {
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
throw _context2.sent;
|
|
1380
|
-
|
|
1381
|
-
case 5:
|
|
1382
|
-
case "end":
|
|
1383
|
-
return _context2.stop();
|
|
1384
|
-
}
|
|
763
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(result) {
|
|
764
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
765
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
766
|
+
case 0:
|
|
767
|
+
if (!_this2._isSuccessfulStatus(result.status)) {
|
|
768
|
+
_context2.next = 2;
|
|
769
|
+
break;
|
|
770
|
+
}
|
|
771
|
+
return _context2.abrupt("return", result.json());
|
|
772
|
+
case 2:
|
|
773
|
+
_context2.next = 4;
|
|
774
|
+
return _this2._getErrorForResponse(result);
|
|
775
|
+
case 4:
|
|
776
|
+
throw _context2.sent;
|
|
777
|
+
case 5:
|
|
778
|
+
case "end":
|
|
779
|
+
return _context2.stop();
|
|
1385
780
|
}
|
|
1386
781
|
}, _callee2);
|
|
1387
782
|
}));
|
|
1388
|
-
|
|
1389
783
|
return function (_x2) {
|
|
1390
784
|
return _ref2.apply(this, arguments);
|
|
1391
785
|
};
|
|
@@ -1402,9 +796,7 @@ var BentoClient = /*#__PURE__*/function () {
|
|
|
1402
796
|
*
|
|
1403
797
|
* @param authentication AuthenticationOptions
|
|
1404
798
|
* @returns HeadersInit
|
|
1405
|
-
|
|
1406
|
-
;
|
|
1407
|
-
|
|
799
|
+
*/;
|
|
1408
800
|
_proto._extractHeaders = function _extractHeaders(authentication) {
|
|
1409
801
|
var authenticationKey = Buffer.from(authentication.publishableKey + ":" + authentication.secretKey).toString('base64');
|
|
1410
802
|
return {
|
|
@@ -1417,9 +809,7 @@ var BentoClient = /*#__PURE__*/function () {
|
|
|
1417
809
|
*
|
|
1418
810
|
* @param payload object
|
|
1419
811
|
* @returns string
|
|
1420
|
-
|
|
1421
|
-
;
|
|
1422
|
-
|
|
812
|
+
*/;
|
|
1423
813
|
_proto._getBody = function _getBody(payload) {
|
|
1424
814
|
return JSON.stringify(_extends({}, payload, {
|
|
1425
815
|
site_uuid: this._siteUuid
|
|
@@ -1431,23 +821,18 @@ var BentoClient = /*#__PURE__*/function () {
|
|
|
1431
821
|
*
|
|
1432
822
|
* @param payload object
|
|
1433
823
|
* @returns string
|
|
1434
|
-
|
|
1435
|
-
;
|
|
1436
|
-
|
|
824
|
+
*/;
|
|
1437
825
|
_proto._getQueryParameters = function _getQueryParameters(payload) {
|
|
1438
826
|
var body = _extends({}, payload, {
|
|
1439
827
|
site_uuid: this._siteUuid
|
|
1440
828
|
});
|
|
1441
|
-
|
|
1442
829
|
var queryParameters = new URLSearchParams();
|
|
1443
|
-
|
|
1444
830
|
for (var _i = 0, _Object$entries = Object.entries(body); _i < _Object$entries.length; _i++) {
|
|
1445
831
|
var _Object$entries$_i = _Object$entries[_i],
|
|
1446
|
-
|
|
1447
|
-
|
|
832
|
+
key = _Object$entries$_i[0],
|
|
833
|
+
value = _Object$entries$_i[1];
|
|
1448
834
|
queryParameters.append(key, value);
|
|
1449
835
|
}
|
|
1450
|
-
|
|
1451
836
|
return queryParameters.toString();
|
|
1452
837
|
}
|
|
1453
838
|
/**
|
|
@@ -1455,9 +840,7 @@ var BentoClient = /*#__PURE__*/function () {
|
|
|
1455
840
|
*
|
|
1456
841
|
* @param statusCode number
|
|
1457
842
|
* @returns boolean
|
|
1458
|
-
|
|
1459
|
-
;
|
|
1460
|
-
|
|
843
|
+
*/;
|
|
1461
844
|
_proto._isSuccessfulStatus = function _isSuccessfulStatus(statusCode) {
|
|
1462
845
|
var validStatusCodes = [200, 201];
|
|
1463
846
|
return validStatusCodes.includes(statusCode);
|
|
@@ -1467,84 +850,65 @@ var BentoClient = /*#__PURE__*/function () {
|
|
|
1467
850
|
*
|
|
1468
851
|
* @param response Response
|
|
1469
852
|
* @returns Error
|
|
1470
|
-
|
|
1471
|
-
;
|
|
1472
|
-
|
|
853
|
+
*/;
|
|
1473
854
|
_proto._getErrorForResponse =
|
|
1474
855
|
/*#__PURE__*/
|
|
1475
856
|
function () {
|
|
1476
|
-
var _getErrorForResponse2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
857
|
+
var _getErrorForResponse2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(response) {
|
|
1477
858
|
var contentType, responseMessage;
|
|
1478
|
-
return
|
|
1479
|
-
while (1) {
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
if (!(response.status === 401)) {
|
|
1487
|
-
_context3.next = 3;
|
|
1488
|
-
break;
|
|
1489
|
-
}
|
|
1490
|
-
|
|
1491
|
-
return _context3.abrupt("return", new NotAuthorizedError());
|
|
1492
|
-
|
|
1493
|
-
case 3:
|
|
1494
|
-
if (!(response.status === 429)) {
|
|
1495
|
-
_context3.next = 5;
|
|
1496
|
-
break;
|
|
1497
|
-
}
|
|
1498
|
-
|
|
1499
|
-
return _context3.abrupt("return", new RateLimitedError());
|
|
1500
|
-
|
|
1501
|
-
case 5:
|
|
1502
|
-
contentType = response.headers.get('Content-Type');
|
|
1503
|
-
responseMessage = '';
|
|
1504
|
-
_context3.t0 = contentType == null ? void 0 : contentType.toLocaleLowerCase();
|
|
1505
|
-
_context3.next = _context3.t0 === 'text/plain' ? 10 : _context3.t0 === 'application/json' ? 14 : 20;
|
|
859
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
860
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
861
|
+
case 0:
|
|
862
|
+
if (this._logErrors) {
|
|
863
|
+
console.error(response);
|
|
864
|
+
}
|
|
865
|
+
if (!(response.status === 401)) {
|
|
866
|
+
_context3.next = 3;
|
|
1506
867
|
break;
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
868
|
+
}
|
|
869
|
+
return _context3.abrupt("return", new NotAuthorizedError());
|
|
870
|
+
case 3:
|
|
871
|
+
if (!(response.status === 429)) {
|
|
872
|
+
_context3.next = 5;
|
|
873
|
+
break;
|
|
874
|
+
}
|
|
875
|
+
return _context3.abrupt("return", new RateLimitedError());
|
|
876
|
+
case 5:
|
|
877
|
+
contentType = response.headers.get('Content-Type');
|
|
878
|
+
responseMessage = '';
|
|
879
|
+
_context3.t0 = contentType == null ? void 0 : contentType.toLocaleLowerCase();
|
|
880
|
+
_context3.next = _context3.t0 === 'text/plain' ? 10 : _context3.t0 === 'application/json' ? 14 : 20;
|
|
881
|
+
break;
|
|
882
|
+
case 10:
|
|
883
|
+
_context3.next = 12;
|
|
884
|
+
return response.text();
|
|
885
|
+
case 12:
|
|
886
|
+
responseMessage = _context3.sent;
|
|
887
|
+
return _context3.abrupt("break", 22);
|
|
888
|
+
case 14:
|
|
889
|
+
_context3.t1 = JSON;
|
|
890
|
+
_context3.next = 17;
|
|
891
|
+
return response.json();
|
|
892
|
+
case 17:
|
|
893
|
+
_context3.t2 = _context3.sent;
|
|
894
|
+
responseMessage = _context3.t1.stringify.call(_context3.t1, _context3.t2);
|
|
895
|
+
return _context3.abrupt("break", 22);
|
|
896
|
+
case 20:
|
|
897
|
+
responseMessage = 'Unknown response from the Bento API.';
|
|
898
|
+
return _context3.abrupt("break", 22);
|
|
899
|
+
case 22:
|
|
900
|
+
return _context3.abrupt("return", new Error("[" + response.status + "] - " + responseMessage));
|
|
901
|
+
case 23:
|
|
902
|
+
case "end":
|
|
903
|
+
return _context3.stop();
|
|
1537
904
|
}
|
|
1538
905
|
}, _callee3, this);
|
|
1539
906
|
}));
|
|
1540
|
-
|
|
1541
907
|
function _getErrorForResponse(_x3) {
|
|
1542
908
|
return _getErrorForResponse2.apply(this, arguments);
|
|
1543
909
|
}
|
|
1544
|
-
|
|
1545
910
|
return _getErrorForResponse;
|
|
1546
911
|
}();
|
|
1547
|
-
|
|
1548
912
|
return BentoClient;
|
|
1549
913
|
}();
|
|
1550
914
|
|
|
@@ -1552,7 +916,6 @@ var BentoClient = /*#__PURE__*/function () {
|
|
|
1552
916
|
* Command Enums
|
|
1553
917
|
*/
|
|
1554
918
|
var CommandTypes;
|
|
1555
|
-
|
|
1556
919
|
(function (CommandTypes) {
|
|
1557
920
|
CommandTypes["ADD_FIELD"] = "add_field";
|
|
1558
921
|
CommandTypes["ADD_TAG"] = "add_tag";
|
|
@@ -1582,53 +945,41 @@ var BentoCommands = /*#__PURE__*/function () {
|
|
|
1582
945
|
* @param parameters \{ email: string, tagName: string \}
|
|
1583
946
|
* @returns Promise\<Subscriber | null\>
|
|
1584
947
|
*/
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
948
|
var _proto = BentoCommands.prototype;
|
|
1588
|
-
|
|
1589
949
|
_proto.addTag =
|
|
1590
950
|
/*#__PURE__*/
|
|
1591
951
|
function () {
|
|
1592
|
-
var _addTag = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
952
|
+
var _addTag = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(parameters) {
|
|
1593
953
|
var result;
|
|
1594
|
-
return
|
|
1595
|
-
while (1) {
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
command:
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
query: parameters.tagName
|
|
1604
|
-
}
|
|
1605
|
-
});
|
|
1606
|
-
|
|
1607
|
-
case 2:
|
|
1608
|
-
result = _context.sent;
|
|
1609
|
-
|
|
1610
|
-
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
1611
|
-
_context.next = 5;
|
|
1612
|
-
break;
|
|
954
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
955
|
+
while (1) switch (_context.prev = _context.next) {
|
|
956
|
+
case 0:
|
|
957
|
+
_context.next = 2;
|
|
958
|
+
return this._client.post(this._url, {
|
|
959
|
+
command: {
|
|
960
|
+
command: CommandTypes.ADD_TAG,
|
|
961
|
+
email: parameters.email,
|
|
962
|
+
query: parameters.tagName
|
|
1613
963
|
}
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
964
|
+
});
|
|
965
|
+
case 2:
|
|
966
|
+
result = _context.sent;
|
|
967
|
+
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
968
|
+
_context.next = 5;
|
|
969
|
+
break;
|
|
970
|
+
}
|
|
971
|
+
return _context.abrupt("return", null);
|
|
972
|
+
case 5:
|
|
973
|
+
return _context.abrupt("return", result.data);
|
|
974
|
+
case 6:
|
|
975
|
+
case "end":
|
|
976
|
+
return _context.stop();
|
|
1624
977
|
}
|
|
1625
978
|
}, _callee, this);
|
|
1626
979
|
}));
|
|
1627
|
-
|
|
1628
980
|
function addTag(_x) {
|
|
1629
981
|
return _addTag.apply(this, arguments);
|
|
1630
982
|
}
|
|
1631
|
-
|
|
1632
983
|
return addTag;
|
|
1633
984
|
}()
|
|
1634
985
|
/**
|
|
@@ -1638,50 +989,40 @@ var BentoCommands = /*#__PURE__*/function () {
|
|
|
1638
989
|
* @returns Promise\<Subscriber | null\>
|
|
1639
990
|
*/
|
|
1640
991
|
;
|
|
1641
|
-
|
|
1642
992
|
_proto.removeTag =
|
|
1643
993
|
/*#__PURE__*/
|
|
1644
994
|
function () {
|
|
1645
|
-
var _removeTag = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
995
|
+
var _removeTag = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(parameters) {
|
|
1646
996
|
var result;
|
|
1647
|
-
return
|
|
1648
|
-
while (1) {
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
command:
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
query: parameters.tagName
|
|
1657
|
-
}
|
|
1658
|
-
});
|
|
1659
|
-
|
|
1660
|
-
case 2:
|
|
1661
|
-
result = _context2.sent;
|
|
1662
|
-
|
|
1663
|
-
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
1664
|
-
_context2.next = 5;
|
|
1665
|
-
break;
|
|
997
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
998
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
999
|
+
case 0:
|
|
1000
|
+
_context2.next = 2;
|
|
1001
|
+
return this._client.post(this._url, {
|
|
1002
|
+
command: {
|
|
1003
|
+
command: CommandTypes.REMOVE_TAG,
|
|
1004
|
+
email: parameters.email,
|
|
1005
|
+
query: parameters.tagName
|
|
1666
1006
|
}
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1007
|
+
});
|
|
1008
|
+
case 2:
|
|
1009
|
+
result = _context2.sent;
|
|
1010
|
+
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
1011
|
+
_context2.next = 5;
|
|
1012
|
+
break;
|
|
1013
|
+
}
|
|
1014
|
+
return _context2.abrupt("return", null);
|
|
1015
|
+
case 5:
|
|
1016
|
+
return _context2.abrupt("return", result.data);
|
|
1017
|
+
case 6:
|
|
1018
|
+
case "end":
|
|
1019
|
+
return _context2.stop();
|
|
1677
1020
|
}
|
|
1678
1021
|
}, _callee2, this);
|
|
1679
1022
|
}));
|
|
1680
|
-
|
|
1681
1023
|
function removeTag(_x2) {
|
|
1682
1024
|
return _removeTag.apply(this, arguments);
|
|
1683
1025
|
}
|
|
1684
|
-
|
|
1685
1026
|
return removeTag;
|
|
1686
1027
|
}()
|
|
1687
1028
|
/**
|
|
@@ -1697,50 +1038,40 @@ var BentoCommands = /*#__PURE__*/function () {
|
|
|
1697
1038
|
* @returns Promise\<Subscriber | null\>
|
|
1698
1039
|
*/
|
|
1699
1040
|
;
|
|
1700
|
-
|
|
1701
1041
|
_proto.addField =
|
|
1702
1042
|
/*#__PURE__*/
|
|
1703
1043
|
function () {
|
|
1704
|
-
var _addField = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
1044
|
+
var _addField = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(parameters) {
|
|
1705
1045
|
var result;
|
|
1706
|
-
return
|
|
1707
|
-
while (1) {
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
command:
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
query: parameters.field
|
|
1716
|
-
}
|
|
1717
|
-
});
|
|
1718
|
-
|
|
1719
|
-
case 2:
|
|
1720
|
-
result = _context3.sent;
|
|
1721
|
-
|
|
1722
|
-
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
1723
|
-
_context3.next = 5;
|
|
1724
|
-
break;
|
|
1046
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
1047
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
1048
|
+
case 0:
|
|
1049
|
+
_context3.next = 2;
|
|
1050
|
+
return this._client.post(this._url, {
|
|
1051
|
+
command: {
|
|
1052
|
+
command: CommandTypes.ADD_FIELD,
|
|
1053
|
+
email: parameters.email,
|
|
1054
|
+
query: parameters.field
|
|
1725
1055
|
}
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1056
|
+
});
|
|
1057
|
+
case 2:
|
|
1058
|
+
result = _context3.sent;
|
|
1059
|
+
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
1060
|
+
_context3.next = 5;
|
|
1061
|
+
break;
|
|
1062
|
+
}
|
|
1063
|
+
return _context3.abrupt("return", null);
|
|
1064
|
+
case 5:
|
|
1065
|
+
return _context3.abrupt("return", result.data);
|
|
1066
|
+
case 6:
|
|
1067
|
+
case "end":
|
|
1068
|
+
return _context3.stop();
|
|
1736
1069
|
}
|
|
1737
1070
|
}, _callee3, this);
|
|
1738
1071
|
}));
|
|
1739
|
-
|
|
1740
1072
|
function addField(_x3) {
|
|
1741
1073
|
return _addField.apply(this, arguments);
|
|
1742
1074
|
}
|
|
1743
|
-
|
|
1744
1075
|
return addField;
|
|
1745
1076
|
}()
|
|
1746
1077
|
/**
|
|
@@ -1750,50 +1081,40 @@ var BentoCommands = /*#__PURE__*/function () {
|
|
|
1750
1081
|
* @returns Promise\<Subscriber | null\>
|
|
1751
1082
|
*/
|
|
1752
1083
|
;
|
|
1753
|
-
|
|
1754
1084
|
_proto.removeField =
|
|
1755
1085
|
/*#__PURE__*/
|
|
1756
1086
|
function () {
|
|
1757
|
-
var _removeField = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
1087
|
+
var _removeField = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(parameters) {
|
|
1758
1088
|
var result;
|
|
1759
|
-
return
|
|
1760
|
-
while (1) {
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
command:
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
query: parameters.fieldName
|
|
1769
|
-
}
|
|
1770
|
-
});
|
|
1771
|
-
|
|
1772
|
-
case 2:
|
|
1773
|
-
result = _context4.sent;
|
|
1774
|
-
|
|
1775
|
-
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
1776
|
-
_context4.next = 5;
|
|
1777
|
-
break;
|
|
1089
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
1090
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
1091
|
+
case 0:
|
|
1092
|
+
_context4.next = 2;
|
|
1093
|
+
return this._client.post(this._url, {
|
|
1094
|
+
command: {
|
|
1095
|
+
command: CommandTypes.REMOVE_FIELD,
|
|
1096
|
+
email: parameters.email,
|
|
1097
|
+
query: parameters.fieldName
|
|
1778
1098
|
}
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1099
|
+
});
|
|
1100
|
+
case 2:
|
|
1101
|
+
result = _context4.sent;
|
|
1102
|
+
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
1103
|
+
_context4.next = 5;
|
|
1104
|
+
break;
|
|
1105
|
+
}
|
|
1106
|
+
return _context4.abrupt("return", null);
|
|
1107
|
+
case 5:
|
|
1108
|
+
return _context4.abrupt("return", result.data);
|
|
1109
|
+
case 6:
|
|
1110
|
+
case "end":
|
|
1111
|
+
return _context4.stop();
|
|
1789
1112
|
}
|
|
1790
1113
|
}, _callee4, this);
|
|
1791
1114
|
}));
|
|
1792
|
-
|
|
1793
1115
|
function removeField(_x4) {
|
|
1794
1116
|
return _removeField.apply(this, arguments);
|
|
1795
1117
|
}
|
|
1796
|
-
|
|
1797
1118
|
return removeField;
|
|
1798
1119
|
}()
|
|
1799
1120
|
/**
|
|
@@ -1807,49 +1128,39 @@ var BentoCommands = /*#__PURE__*/function () {
|
|
|
1807
1128
|
* @returns Promise\<Subscriber | null\>
|
|
1808
1129
|
*/
|
|
1809
1130
|
;
|
|
1810
|
-
|
|
1811
1131
|
_proto.subscribe =
|
|
1812
1132
|
/*#__PURE__*/
|
|
1813
1133
|
function () {
|
|
1814
|
-
var _subscribe = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
1134
|
+
var _subscribe = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(parameters) {
|
|
1815
1135
|
var result;
|
|
1816
|
-
return
|
|
1817
|
-
while (1) {
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
command:
|
|
1823
|
-
|
|
1824
|
-
email: parameters.email
|
|
1825
|
-
}
|
|
1826
|
-
});
|
|
1827
|
-
|
|
1828
|
-
case 2:
|
|
1829
|
-
result = _context5.sent;
|
|
1830
|
-
|
|
1831
|
-
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
1832
|
-
_context5.next = 5;
|
|
1833
|
-
break;
|
|
1136
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
1137
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
1138
|
+
case 0:
|
|
1139
|
+
_context5.next = 2;
|
|
1140
|
+
return this._client.post(this._url, {
|
|
1141
|
+
command: {
|
|
1142
|
+
command: CommandTypes.SUBSCRIBE,
|
|
1143
|
+
email: parameters.email
|
|
1834
1144
|
}
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1145
|
+
});
|
|
1146
|
+
case 2:
|
|
1147
|
+
result = _context5.sent;
|
|
1148
|
+
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
1149
|
+
_context5.next = 5;
|
|
1150
|
+
break;
|
|
1151
|
+
}
|
|
1152
|
+
return _context5.abrupt("return", null);
|
|
1153
|
+
case 5:
|
|
1154
|
+
return _context5.abrupt("return", result.data);
|
|
1155
|
+
case 6:
|
|
1156
|
+
case "end":
|
|
1157
|
+
return _context5.stop();
|
|
1845
1158
|
}
|
|
1846
1159
|
}, _callee5, this);
|
|
1847
1160
|
}));
|
|
1848
|
-
|
|
1849
1161
|
function subscribe(_x5) {
|
|
1850
1162
|
return _subscribe.apply(this, arguments);
|
|
1851
1163
|
}
|
|
1852
|
-
|
|
1853
1164
|
return subscribe;
|
|
1854
1165
|
}()
|
|
1855
1166
|
/**
|
|
@@ -1864,49 +1175,39 @@ var BentoCommands = /*#__PURE__*/function () {
|
|
|
1864
1175
|
* @returns Promise\<Subscriber | null\>
|
|
1865
1176
|
*/
|
|
1866
1177
|
;
|
|
1867
|
-
|
|
1868
1178
|
_proto.unsubscribe =
|
|
1869
1179
|
/*#__PURE__*/
|
|
1870
1180
|
function () {
|
|
1871
|
-
var _unsubscribe = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
1181
|
+
var _unsubscribe = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(parameters) {
|
|
1872
1182
|
var result;
|
|
1873
|
-
return
|
|
1874
|
-
while (1) {
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
command:
|
|
1880
|
-
|
|
1881
|
-
email: parameters.email
|
|
1882
|
-
}
|
|
1883
|
-
});
|
|
1884
|
-
|
|
1885
|
-
case 2:
|
|
1886
|
-
result = _context6.sent;
|
|
1887
|
-
|
|
1888
|
-
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
1889
|
-
_context6.next = 5;
|
|
1890
|
-
break;
|
|
1183
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
1184
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
1185
|
+
case 0:
|
|
1186
|
+
_context6.next = 2;
|
|
1187
|
+
return this._client.post(this._url, {
|
|
1188
|
+
command: {
|
|
1189
|
+
command: CommandTypes.UNSUBSCRIBE,
|
|
1190
|
+
email: parameters.email
|
|
1891
1191
|
}
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1192
|
+
});
|
|
1193
|
+
case 2:
|
|
1194
|
+
result = _context6.sent;
|
|
1195
|
+
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
1196
|
+
_context6.next = 5;
|
|
1197
|
+
break;
|
|
1198
|
+
}
|
|
1199
|
+
return _context6.abrupt("return", null);
|
|
1200
|
+
case 5:
|
|
1201
|
+
return _context6.abrupt("return", result.data);
|
|
1202
|
+
case 6:
|
|
1203
|
+
case "end":
|
|
1204
|
+
return _context6.stop();
|
|
1902
1205
|
}
|
|
1903
1206
|
}, _callee6, this);
|
|
1904
1207
|
}));
|
|
1905
|
-
|
|
1906
1208
|
function unsubscribe(_x6) {
|
|
1907
1209
|
return _unsubscribe.apply(this, arguments);
|
|
1908
1210
|
}
|
|
1909
|
-
|
|
1910
1211
|
return unsubscribe;
|
|
1911
1212
|
}()
|
|
1912
1213
|
/**
|
|
@@ -1916,53 +1217,42 @@ var BentoCommands = /*#__PURE__*/function () {
|
|
|
1916
1217
|
* @returns Promise\<Subscriber | null\>
|
|
1917
1218
|
*/
|
|
1918
1219
|
;
|
|
1919
|
-
|
|
1920
1220
|
_proto.changeEmail =
|
|
1921
1221
|
/*#__PURE__*/
|
|
1922
1222
|
function () {
|
|
1923
|
-
var _changeEmail = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
1223
|
+
var _changeEmail = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(parameters) {
|
|
1924
1224
|
var result;
|
|
1925
|
-
return
|
|
1926
|
-
while (1) {
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
command:
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
query: parameters.newEmail
|
|
1935
|
-
}
|
|
1936
|
-
});
|
|
1937
|
-
|
|
1938
|
-
case 2:
|
|
1939
|
-
result = _context7.sent;
|
|
1940
|
-
|
|
1941
|
-
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
1942
|
-
_context7.next = 5;
|
|
1943
|
-
break;
|
|
1225
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
1226
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
1227
|
+
case 0:
|
|
1228
|
+
_context7.next = 2;
|
|
1229
|
+
return this._client.post(this._url, {
|
|
1230
|
+
command: {
|
|
1231
|
+
command: CommandTypes.CHANGE_EMAIL,
|
|
1232
|
+
email: parameters.oldEmail,
|
|
1233
|
+
query: parameters.newEmail
|
|
1944
1234
|
}
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1235
|
+
});
|
|
1236
|
+
case 2:
|
|
1237
|
+
result = _context7.sent;
|
|
1238
|
+
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
1239
|
+
_context7.next = 5;
|
|
1240
|
+
break;
|
|
1241
|
+
}
|
|
1242
|
+
return _context7.abrupt("return", null);
|
|
1243
|
+
case 5:
|
|
1244
|
+
return _context7.abrupt("return", result.data);
|
|
1245
|
+
case 6:
|
|
1246
|
+
case "end":
|
|
1247
|
+
return _context7.stop();
|
|
1955
1248
|
}
|
|
1956
1249
|
}, _callee7, this);
|
|
1957
1250
|
}));
|
|
1958
|
-
|
|
1959
1251
|
function changeEmail(_x7) {
|
|
1960
1252
|
return _changeEmail.apply(this, arguments);
|
|
1961
1253
|
}
|
|
1962
|
-
|
|
1963
1254
|
return changeEmail;
|
|
1964
1255
|
}();
|
|
1965
|
-
|
|
1966
1256
|
return BentoCommands;
|
|
1967
1257
|
}();
|
|
1968
1258
|
|
|
@@ -1985,43 +1275,34 @@ var BentoExperimental = /*#__PURE__*/function () {
|
|
|
1985
1275
|
* @param parameters
|
|
1986
1276
|
* @returns Promise\<boolean\>
|
|
1987
1277
|
*/
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
1278
|
var _proto = BentoExperimental.prototype;
|
|
1991
|
-
|
|
1992
1279
|
_proto.validateEmail =
|
|
1993
1280
|
/*#__PURE__*/
|
|
1994
1281
|
function () {
|
|
1995
|
-
var _validateEmail = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
1282
|
+
var _validateEmail = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(parameters) {
|
|
1996
1283
|
var result;
|
|
1997
|
-
return
|
|
1998
|
-
while (1) {
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
case 4:
|
|
2014
|
-
case "end":
|
|
2015
|
-
return _context.stop();
|
|
2016
|
-
}
|
|
1284
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1285
|
+
while (1) switch (_context.prev = _context.next) {
|
|
1286
|
+
case 0:
|
|
1287
|
+
_context.next = 2;
|
|
1288
|
+
return this._client.post(this._url + "/validation", {
|
|
1289
|
+
email: parameters.email,
|
|
1290
|
+
ip: parameters.ip,
|
|
1291
|
+
name: parameters.name,
|
|
1292
|
+
user_agent: parameters.userAgent
|
|
1293
|
+
});
|
|
1294
|
+
case 2:
|
|
1295
|
+
result = _context.sent;
|
|
1296
|
+
return _context.abrupt("return", result.valid);
|
|
1297
|
+
case 4:
|
|
1298
|
+
case "end":
|
|
1299
|
+
return _context.stop();
|
|
2017
1300
|
}
|
|
2018
1301
|
}, _callee, this);
|
|
2019
1302
|
}));
|
|
2020
|
-
|
|
2021
1303
|
function validateEmail(_x) {
|
|
2022
1304
|
return _validateEmail.apply(this, arguments);
|
|
2023
1305
|
}
|
|
2024
|
-
|
|
2025
1306
|
return validateEmail;
|
|
2026
1307
|
}()
|
|
2027
1308
|
/**
|
|
@@ -2038,35 +1319,28 @@ var BentoExperimental = /*#__PURE__*/function () {
|
|
|
2038
1319
|
* @returns Promise\<GuessGenderResponse\>
|
|
2039
1320
|
*/
|
|
2040
1321
|
;
|
|
2041
|
-
|
|
2042
1322
|
_proto.guessGender =
|
|
2043
1323
|
/*#__PURE__*/
|
|
2044
1324
|
function () {
|
|
2045
|
-
var _guessGender = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
1325
|
+
var _guessGender = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(parameters) {
|
|
2046
1326
|
var result;
|
|
2047
|
-
return
|
|
2048
|
-
while (1) {
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
case 4:
|
|
2059
|
-
case "end":
|
|
2060
|
-
return _context2.stop();
|
|
2061
|
-
}
|
|
1327
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1328
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
1329
|
+
case 0:
|
|
1330
|
+
_context2.next = 2;
|
|
1331
|
+
return this._client.post(this._url + "/gender", parameters);
|
|
1332
|
+
case 2:
|
|
1333
|
+
result = _context2.sent;
|
|
1334
|
+
return _context2.abrupt("return", result);
|
|
1335
|
+
case 4:
|
|
1336
|
+
case "end":
|
|
1337
|
+
return _context2.stop();
|
|
2062
1338
|
}
|
|
2063
1339
|
}, _callee2, this);
|
|
2064
1340
|
}));
|
|
2065
|
-
|
|
2066
1341
|
function guessGender(_x2) {
|
|
2067
1342
|
return _guessGender.apply(this, arguments);
|
|
2068
1343
|
}
|
|
2069
|
-
|
|
2070
1344
|
return guessGender;
|
|
2071
1345
|
}()
|
|
2072
1346
|
/**
|
|
@@ -2079,44 +1353,34 @@ var BentoExperimental = /*#__PURE__*/function () {
|
|
|
2079
1353
|
* @returns Promise\<GeolocateResponse\>
|
|
2080
1354
|
*/
|
|
2081
1355
|
;
|
|
2082
|
-
|
|
2083
1356
|
_proto.geolocate =
|
|
2084
1357
|
/*#__PURE__*/
|
|
2085
1358
|
function () {
|
|
2086
|
-
var _geolocate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
1359
|
+
var _geolocate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(parameters) {
|
|
2087
1360
|
var result;
|
|
2088
|
-
return
|
|
2089
|
-
while (1) {
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
case 5:
|
|
2106
|
-
return _context3.abrupt("return", result);
|
|
2107
|
-
|
|
2108
|
-
case 6:
|
|
2109
|
-
case "end":
|
|
2110
|
-
return _context3.stop();
|
|
2111
|
-
}
|
|
1361
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
1362
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
1363
|
+
case 0:
|
|
1364
|
+
_context3.next = 2;
|
|
1365
|
+
return this._client.get(this._url + "/geolocation", parameters);
|
|
1366
|
+
case 2:
|
|
1367
|
+
result = _context3.sent;
|
|
1368
|
+
if (!(Object.keys(result).length === 0)) {
|
|
1369
|
+
_context3.next = 5;
|
|
1370
|
+
break;
|
|
1371
|
+
}
|
|
1372
|
+
return _context3.abrupt("return", null);
|
|
1373
|
+
case 5:
|
|
1374
|
+
return _context3.abrupt("return", result);
|
|
1375
|
+
case 6:
|
|
1376
|
+
case "end":
|
|
1377
|
+
return _context3.stop();
|
|
2112
1378
|
}
|
|
2113
1379
|
}, _callee3, this);
|
|
2114
1380
|
}));
|
|
2115
|
-
|
|
2116
1381
|
function geolocate(_x3) {
|
|
2117
1382
|
return _geolocate.apply(this, arguments);
|
|
2118
1383
|
}
|
|
2119
|
-
|
|
2120
1384
|
return geolocate;
|
|
2121
1385
|
}()
|
|
2122
1386
|
/**
|
|
@@ -2130,38 +1394,30 @@ var BentoExperimental = /*#__PURE__*/function () {
|
|
|
2130
1394
|
* @returns Promise\<BlacklistResponse\>
|
|
2131
1395
|
*/
|
|
2132
1396
|
;
|
|
2133
|
-
|
|
2134
1397
|
_proto.checkBlacklist =
|
|
2135
1398
|
/*#__PURE__*/
|
|
2136
1399
|
function () {
|
|
2137
|
-
var _checkBlacklist = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
1400
|
+
var _checkBlacklist = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(parameters) {
|
|
2138
1401
|
var result;
|
|
2139
|
-
return
|
|
2140
|
-
while (1) {
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
case 4:
|
|
2151
|
-
case "end":
|
|
2152
|
-
return _context4.stop();
|
|
2153
|
-
}
|
|
1402
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
1403
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
1404
|
+
case 0:
|
|
1405
|
+
_context4.next = 2;
|
|
1406
|
+
return this._client.get(this._url + "/blacklist.json", parameters);
|
|
1407
|
+
case 2:
|
|
1408
|
+
result = _context4.sent;
|
|
1409
|
+
return _context4.abrupt("return", result);
|
|
1410
|
+
case 4:
|
|
1411
|
+
case "end":
|
|
1412
|
+
return _context4.stop();
|
|
2154
1413
|
}
|
|
2155
1414
|
}, _callee4, this);
|
|
2156
1415
|
}));
|
|
2157
|
-
|
|
2158
1416
|
function checkBlacklist(_x4) {
|
|
2159
1417
|
return _checkBlacklist.apply(this, arguments);
|
|
2160
1418
|
}
|
|
2161
|
-
|
|
2162
1419
|
return checkBlacklist;
|
|
2163
1420
|
}();
|
|
2164
|
-
|
|
2165
1421
|
return BentoExperimental;
|
|
2166
1422
|
}();
|
|
2167
1423
|
|
|
@@ -2176,47 +1432,35 @@ var BentoFields = /*#__PURE__*/function () {
|
|
|
2176
1432
|
*
|
|
2177
1433
|
* @returns Promise<Field[]>
|
|
2178
1434
|
*/
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
1435
|
var _proto = BentoFields.prototype;
|
|
2182
|
-
|
|
2183
1436
|
_proto.getFields =
|
|
2184
1437
|
/*#__PURE__*/
|
|
2185
1438
|
function () {
|
|
2186
|
-
var _getFields = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
1439
|
+
var _getFields = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
2187
1440
|
var result;
|
|
2188
|
-
return
|
|
2189
|
-
while (1) {
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
case 5:
|
|
2206
|
-
return _context.abrupt("return", result.data);
|
|
2207
|
-
|
|
2208
|
-
case 6:
|
|
2209
|
-
case "end":
|
|
2210
|
-
return _context.stop();
|
|
2211
|
-
}
|
|
1441
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1442
|
+
while (1) switch (_context.prev = _context.next) {
|
|
1443
|
+
case 0:
|
|
1444
|
+
_context.next = 2;
|
|
1445
|
+
return this._client.get(this._url);
|
|
1446
|
+
case 2:
|
|
1447
|
+
result = _context.sent;
|
|
1448
|
+
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
1449
|
+
_context.next = 5;
|
|
1450
|
+
break;
|
|
1451
|
+
}
|
|
1452
|
+
return _context.abrupt("return", null);
|
|
1453
|
+
case 5:
|
|
1454
|
+
return _context.abrupt("return", result.data);
|
|
1455
|
+
case 6:
|
|
1456
|
+
case "end":
|
|
1457
|
+
return _context.stop();
|
|
2212
1458
|
}
|
|
2213
1459
|
}, _callee, this);
|
|
2214
1460
|
}));
|
|
2215
|
-
|
|
2216
1461
|
function getFields() {
|
|
2217
1462
|
return _getFields.apply(this, arguments);
|
|
2218
1463
|
}
|
|
2219
|
-
|
|
2220
1464
|
return getFields;
|
|
2221
1465
|
}()
|
|
2222
1466
|
/**
|
|
@@ -2235,49 +1479,38 @@ var BentoFields = /*#__PURE__*/function () {
|
|
|
2235
1479
|
* @returns Promise<Field[]>
|
|
2236
1480
|
*/
|
|
2237
1481
|
;
|
|
2238
|
-
|
|
2239
1482
|
_proto.createField =
|
|
2240
1483
|
/*#__PURE__*/
|
|
2241
1484
|
function () {
|
|
2242
|
-
var _createField = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
1485
|
+
var _createField = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(parameters) {
|
|
2243
1486
|
var result;
|
|
2244
|
-
return
|
|
2245
|
-
while (1) {
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
case 5:
|
|
2264
|
-
return _context2.abrupt("return", result.data);
|
|
2265
|
-
|
|
2266
|
-
case 6:
|
|
2267
|
-
case "end":
|
|
2268
|
-
return _context2.stop();
|
|
2269
|
-
}
|
|
1487
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1488
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
1489
|
+
case 0:
|
|
1490
|
+
_context2.next = 2;
|
|
1491
|
+
return this._client.post(this._url, {
|
|
1492
|
+
field: parameters
|
|
1493
|
+
});
|
|
1494
|
+
case 2:
|
|
1495
|
+
result = _context2.sent;
|
|
1496
|
+
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
1497
|
+
_context2.next = 5;
|
|
1498
|
+
break;
|
|
1499
|
+
}
|
|
1500
|
+
return _context2.abrupt("return", null);
|
|
1501
|
+
case 5:
|
|
1502
|
+
return _context2.abrupt("return", result.data);
|
|
1503
|
+
case 6:
|
|
1504
|
+
case "end":
|
|
1505
|
+
return _context2.stop();
|
|
2270
1506
|
}
|
|
2271
1507
|
}, _callee2, this);
|
|
2272
1508
|
}));
|
|
2273
|
-
|
|
2274
1509
|
function createField(_x) {
|
|
2275
1510
|
return _createField.apply(this, arguments);
|
|
2276
1511
|
}
|
|
2277
|
-
|
|
2278
1512
|
return createField;
|
|
2279
1513
|
}();
|
|
2280
|
-
|
|
2281
1514
|
return BentoFields;
|
|
2282
1515
|
}();
|
|
2283
1516
|
|
|
@@ -2293,52 +1526,39 @@ var BentoForms = /*#__PURE__*/function () {
|
|
|
2293
1526
|
* @param formIdentifier string
|
|
2294
1527
|
* @returns Promise\<FormResponse[] | null\>
|
|
2295
1528
|
*/
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
1529
|
var _proto = BentoForms.prototype;
|
|
2299
|
-
|
|
2300
1530
|
_proto.getResponses =
|
|
2301
1531
|
/*#__PURE__*/
|
|
2302
1532
|
function () {
|
|
2303
|
-
var _getResponses = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
1533
|
+
var _getResponses = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(formIdentifier) {
|
|
2304
1534
|
var result;
|
|
2305
|
-
return
|
|
2306
|
-
while (1) {
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
case 5:
|
|
2325
|
-
return _context.abrupt("return", result.data);
|
|
2326
|
-
|
|
2327
|
-
case 6:
|
|
2328
|
-
case "end":
|
|
2329
|
-
return _context.stop();
|
|
2330
|
-
}
|
|
1535
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1536
|
+
while (1) switch (_context.prev = _context.next) {
|
|
1537
|
+
case 0:
|
|
1538
|
+
_context.next = 2;
|
|
1539
|
+
return this._client.get(this._url, {
|
|
1540
|
+
id: formIdentifier
|
|
1541
|
+
});
|
|
1542
|
+
case 2:
|
|
1543
|
+
result = _context.sent;
|
|
1544
|
+
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
1545
|
+
_context.next = 5;
|
|
1546
|
+
break;
|
|
1547
|
+
}
|
|
1548
|
+
return _context.abrupt("return", null);
|
|
1549
|
+
case 5:
|
|
1550
|
+
return _context.abrupt("return", result.data);
|
|
1551
|
+
case 6:
|
|
1552
|
+
case "end":
|
|
1553
|
+
return _context.stop();
|
|
2331
1554
|
}
|
|
2332
1555
|
}, _callee, this);
|
|
2333
1556
|
}));
|
|
2334
|
-
|
|
2335
1557
|
function getResponses(_x) {
|
|
2336
1558
|
return _getResponses.apply(this, arguments);
|
|
2337
1559
|
}
|
|
2338
|
-
|
|
2339
1560
|
return getResponses;
|
|
2340
1561
|
}();
|
|
2341
|
-
|
|
2342
1562
|
return BentoForms;
|
|
2343
1563
|
}();
|
|
2344
1564
|
|
|
@@ -2353,47 +1573,35 @@ var BentoSubscribers = /*#__PURE__*/function () {
|
|
|
2353
1573
|
*
|
|
2354
1574
|
* @returns Promise\<Subscriber\<S\> | null\>
|
|
2355
1575
|
*/
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
1576
|
var _proto = BentoSubscribers.prototype;
|
|
2359
|
-
|
|
2360
1577
|
_proto.getSubscribers =
|
|
2361
1578
|
/*#__PURE__*/
|
|
2362
1579
|
function () {
|
|
2363
|
-
var _getSubscribers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
1580
|
+
var _getSubscribers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(parameters) {
|
|
2364
1581
|
var result;
|
|
2365
|
-
return
|
|
2366
|
-
while (1) {
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
case 5:
|
|
2383
|
-
return _context.abrupt("return", result.data);
|
|
2384
|
-
|
|
2385
|
-
case 6:
|
|
2386
|
-
case "end":
|
|
2387
|
-
return _context.stop();
|
|
2388
|
-
}
|
|
1582
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1583
|
+
while (1) switch (_context.prev = _context.next) {
|
|
1584
|
+
case 0:
|
|
1585
|
+
_context.next = 2;
|
|
1586
|
+
return this._client.get(this._url, parameters);
|
|
1587
|
+
case 2:
|
|
1588
|
+
result = _context.sent;
|
|
1589
|
+
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
1590
|
+
_context.next = 5;
|
|
1591
|
+
break;
|
|
1592
|
+
}
|
|
1593
|
+
return _context.abrupt("return", null);
|
|
1594
|
+
case 5:
|
|
1595
|
+
return _context.abrupt("return", result.data);
|
|
1596
|
+
case 6:
|
|
1597
|
+
case "end":
|
|
1598
|
+
return _context.stop();
|
|
2389
1599
|
}
|
|
2390
1600
|
}, _callee, this);
|
|
2391
1601
|
}));
|
|
2392
|
-
|
|
2393
1602
|
function getSubscribers(_x) {
|
|
2394
1603
|
return _getSubscribers.apply(this, arguments);
|
|
2395
1604
|
}
|
|
2396
|
-
|
|
2397
1605
|
return getSubscribers;
|
|
2398
1606
|
}()
|
|
2399
1607
|
/**
|
|
@@ -2403,49 +1611,38 @@ var BentoSubscribers = /*#__PURE__*/function () {
|
|
|
2403
1611
|
* @returns Promise\<Subscriber\<S\> | null\>
|
|
2404
1612
|
*/
|
|
2405
1613
|
;
|
|
2406
|
-
|
|
2407
1614
|
_proto.createSubscriber =
|
|
2408
1615
|
/*#__PURE__*/
|
|
2409
1616
|
function () {
|
|
2410
|
-
var _createSubscriber = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
1617
|
+
var _createSubscriber = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(parameters) {
|
|
2411
1618
|
var result;
|
|
2412
|
-
return
|
|
2413
|
-
while (1) {
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
case 5:
|
|
2432
|
-
return _context2.abrupt("return", result.data);
|
|
2433
|
-
|
|
2434
|
-
case 6:
|
|
2435
|
-
case "end":
|
|
2436
|
-
return _context2.stop();
|
|
2437
|
-
}
|
|
1619
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1620
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
1621
|
+
case 0:
|
|
1622
|
+
_context2.next = 2;
|
|
1623
|
+
return this._client.post(this._url, {
|
|
1624
|
+
subscriber: parameters
|
|
1625
|
+
});
|
|
1626
|
+
case 2:
|
|
1627
|
+
result = _context2.sent;
|
|
1628
|
+
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
1629
|
+
_context2.next = 5;
|
|
1630
|
+
break;
|
|
1631
|
+
}
|
|
1632
|
+
return _context2.abrupt("return", null);
|
|
1633
|
+
case 5:
|
|
1634
|
+
return _context2.abrupt("return", result.data);
|
|
1635
|
+
case 6:
|
|
1636
|
+
case "end":
|
|
1637
|
+
return _context2.stop();
|
|
2438
1638
|
}
|
|
2439
1639
|
}, _callee2, this);
|
|
2440
1640
|
}));
|
|
2441
|
-
|
|
2442
1641
|
function createSubscriber(_x2) {
|
|
2443
1642
|
return _createSubscriber.apply(this, arguments);
|
|
2444
1643
|
}
|
|
2445
|
-
|
|
2446
1644
|
return createSubscriber;
|
|
2447
1645
|
}();
|
|
2448
|
-
|
|
2449
1646
|
return BentoSubscribers;
|
|
2450
1647
|
}();
|
|
2451
1648
|
|
|
@@ -2460,47 +1657,35 @@ var BentoTags = /*#__PURE__*/function () {
|
|
|
2460
1657
|
*
|
|
2461
1658
|
* @returns Promise\<Tag[] | null\>
|
|
2462
1659
|
*/
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
1660
|
var _proto = BentoTags.prototype;
|
|
2466
|
-
|
|
2467
1661
|
_proto.getTags =
|
|
2468
1662
|
/*#__PURE__*/
|
|
2469
1663
|
function () {
|
|
2470
|
-
var _getTags = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
1664
|
+
var _getTags = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
2471
1665
|
var result;
|
|
2472
|
-
return
|
|
2473
|
-
while (1) {
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
case 5:
|
|
2490
|
-
return _context.abrupt("return", result.data);
|
|
2491
|
-
|
|
2492
|
-
case 6:
|
|
2493
|
-
case "end":
|
|
2494
|
-
return _context.stop();
|
|
2495
|
-
}
|
|
1666
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1667
|
+
while (1) switch (_context.prev = _context.next) {
|
|
1668
|
+
case 0:
|
|
1669
|
+
_context.next = 2;
|
|
1670
|
+
return this._client.get(this._url);
|
|
1671
|
+
case 2:
|
|
1672
|
+
result = _context.sent;
|
|
1673
|
+
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
1674
|
+
_context.next = 5;
|
|
1675
|
+
break;
|
|
1676
|
+
}
|
|
1677
|
+
return _context.abrupt("return", null);
|
|
1678
|
+
case 5:
|
|
1679
|
+
return _context.abrupt("return", result.data);
|
|
1680
|
+
case 6:
|
|
1681
|
+
case "end":
|
|
1682
|
+
return _context.stop();
|
|
2496
1683
|
}
|
|
2497
1684
|
}, _callee, this);
|
|
2498
1685
|
}));
|
|
2499
|
-
|
|
2500
1686
|
function getTags() {
|
|
2501
1687
|
return _getTags.apply(this, arguments);
|
|
2502
1688
|
}
|
|
2503
|
-
|
|
2504
1689
|
return getTags;
|
|
2505
1690
|
}()
|
|
2506
1691
|
/**
|
|
@@ -2510,54 +1695,42 @@ var BentoTags = /*#__PURE__*/function () {
|
|
|
2510
1695
|
* @returns Promise\<Tag[] | null\>
|
|
2511
1696
|
*/
|
|
2512
1697
|
;
|
|
2513
|
-
|
|
2514
1698
|
_proto.createTag =
|
|
2515
1699
|
/*#__PURE__*/
|
|
2516
1700
|
function () {
|
|
2517
|
-
var _createTag = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
1701
|
+
var _createTag = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(parameters) {
|
|
2518
1702
|
var result;
|
|
2519
|
-
return
|
|
2520
|
-
while (1) {
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
case 5:
|
|
2539
|
-
return _context2.abrupt("return", result.data);
|
|
2540
|
-
|
|
2541
|
-
case 6:
|
|
2542
|
-
case "end":
|
|
2543
|
-
return _context2.stop();
|
|
2544
|
-
}
|
|
1703
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1704
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
1705
|
+
case 0:
|
|
1706
|
+
_context2.next = 2;
|
|
1707
|
+
return this._client.post(this._url, {
|
|
1708
|
+
tag: parameters
|
|
1709
|
+
});
|
|
1710
|
+
case 2:
|
|
1711
|
+
result = _context2.sent;
|
|
1712
|
+
if (!(Object.keys(result).length === 0 || !result.data)) {
|
|
1713
|
+
_context2.next = 5;
|
|
1714
|
+
break;
|
|
1715
|
+
}
|
|
1716
|
+
return _context2.abrupt("return", null);
|
|
1717
|
+
case 5:
|
|
1718
|
+
return _context2.abrupt("return", result.data);
|
|
1719
|
+
case 6:
|
|
1720
|
+
case "end":
|
|
1721
|
+
return _context2.stop();
|
|
2545
1722
|
}
|
|
2546
1723
|
}, _callee2, this);
|
|
2547
1724
|
}));
|
|
2548
|
-
|
|
2549
1725
|
function createTag(_x) {
|
|
2550
1726
|
return _createTag.apply(this, arguments);
|
|
2551
1727
|
}
|
|
2552
|
-
|
|
2553
1728
|
return createTag;
|
|
2554
1729
|
}();
|
|
2555
|
-
|
|
2556
1730
|
return BentoTags;
|
|
2557
1731
|
}();
|
|
2558
1732
|
|
|
2559
1733
|
var BentoEvents;
|
|
2560
|
-
|
|
2561
1734
|
(function (BentoEvents) {
|
|
2562
1735
|
BentoEvents["PURCHASE"] = "$purchase";
|
|
2563
1736
|
BentoEvents["SUBSCRIBE"] = "$subscribe";
|
|
@@ -2603,47 +1776,38 @@ var BentoAPIV1 = /*#__PURE__*/function () {
|
|
|
2603
1776
|
* @param parameters TagSubscriberParameters
|
|
2604
1777
|
* @returns Promise\<boolean\>
|
|
2605
1778
|
*/
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
1779
|
var _proto = BentoAPIV1.prototype;
|
|
2609
|
-
|
|
2610
1780
|
_proto.tagSubscriber =
|
|
2611
1781
|
/*#__PURE__*/
|
|
2612
1782
|
function () {
|
|
2613
|
-
var _tagSubscriber = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
1783
|
+
var _tagSubscriber = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(parameters) {
|
|
2614
1784
|
var result;
|
|
2615
|
-
return
|
|
2616
|
-
while (1) {
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
case 4:
|
|
2636
|
-
case "end":
|
|
2637
|
-
return _context.stop();
|
|
2638
|
-
}
|
|
1785
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1786
|
+
while (1) switch (_context.prev = _context.next) {
|
|
1787
|
+
case 0:
|
|
1788
|
+
_context.next = 2;
|
|
1789
|
+
return this.Batch.importEvents({
|
|
1790
|
+
events: [{
|
|
1791
|
+
date: parameters.date,
|
|
1792
|
+
details: {
|
|
1793
|
+
tag: parameters.tagName
|
|
1794
|
+
},
|
|
1795
|
+
email: parameters.email,
|
|
1796
|
+
type: BentoEvents.TAG
|
|
1797
|
+
}]
|
|
1798
|
+
});
|
|
1799
|
+
case 2:
|
|
1800
|
+
result = _context.sent;
|
|
1801
|
+
return _context.abrupt("return", result === 1);
|
|
1802
|
+
case 4:
|
|
1803
|
+
case "end":
|
|
1804
|
+
return _context.stop();
|
|
2639
1805
|
}
|
|
2640
1806
|
}, _callee, this);
|
|
2641
1807
|
}));
|
|
2642
|
-
|
|
2643
1808
|
function tagSubscriber(_x) {
|
|
2644
1809
|
return _tagSubscriber.apply(this, arguments);
|
|
2645
1810
|
}
|
|
2646
|
-
|
|
2647
1811
|
return tagSubscriber;
|
|
2648
1812
|
}()
|
|
2649
1813
|
/**
|
|
@@ -2667,42 +1831,35 @@ var BentoAPIV1 = /*#__PURE__*/function () {
|
|
|
2667
1831
|
* @returns Promise\<boolean\>
|
|
2668
1832
|
*/
|
|
2669
1833
|
;
|
|
2670
|
-
|
|
2671
1834
|
_proto.addSubscriber =
|
|
2672
1835
|
/*#__PURE__*/
|
|
2673
1836
|
function () {
|
|
2674
|
-
var _addSubscriber = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
1837
|
+
var _addSubscriber = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(parameters) {
|
|
2675
1838
|
var result;
|
|
2676
|
-
return
|
|
2677
|
-
while (1) {
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
case 4:
|
|
2695
|
-
case "end":
|
|
2696
|
-
return _context2.stop();
|
|
2697
|
-
}
|
|
1839
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1840
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
1841
|
+
case 0:
|
|
1842
|
+
_context2.next = 2;
|
|
1843
|
+
return this.Batch.importEvents({
|
|
1844
|
+
events: [{
|
|
1845
|
+
date: parameters.date,
|
|
1846
|
+
email: parameters.email,
|
|
1847
|
+
type: BentoEvents.SUBSCRIBE,
|
|
1848
|
+
fields: parameters.fields || {}
|
|
1849
|
+
}]
|
|
1850
|
+
});
|
|
1851
|
+
case 2:
|
|
1852
|
+
result = _context2.sent;
|
|
1853
|
+
return _context2.abrupt("return", result === 1);
|
|
1854
|
+
case 4:
|
|
1855
|
+
case "end":
|
|
1856
|
+
return _context2.stop();
|
|
2698
1857
|
}
|
|
2699
1858
|
}, _callee2, this);
|
|
2700
1859
|
}));
|
|
2701
|
-
|
|
2702
1860
|
function addSubscriber(_x2) {
|
|
2703
1861
|
return _addSubscriber.apply(this, arguments);
|
|
2704
1862
|
}
|
|
2705
|
-
|
|
2706
1863
|
return addSubscriber;
|
|
2707
1864
|
}()
|
|
2708
1865
|
/**
|
|
@@ -2725,41 +1882,34 @@ var BentoAPIV1 = /*#__PURE__*/function () {
|
|
|
2725
1882
|
* @returns Promise\<boolean\>
|
|
2726
1883
|
*/
|
|
2727
1884
|
;
|
|
2728
|
-
|
|
2729
1885
|
_proto.removeSubscriber =
|
|
2730
1886
|
/*#__PURE__*/
|
|
2731
1887
|
function () {
|
|
2732
|
-
var _removeSubscriber = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
1888
|
+
var _removeSubscriber = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(parameters) {
|
|
2733
1889
|
var result;
|
|
2734
|
-
return
|
|
2735
|
-
while (1) {
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
case 4:
|
|
2752
|
-
case "end":
|
|
2753
|
-
return _context3.stop();
|
|
2754
|
-
}
|
|
1890
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
1891
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
1892
|
+
case 0:
|
|
1893
|
+
_context3.next = 2;
|
|
1894
|
+
return this.Batch.importEvents({
|
|
1895
|
+
events: [{
|
|
1896
|
+
date: parameters.date,
|
|
1897
|
+
email: parameters.email,
|
|
1898
|
+
type: BentoEvents.UNSUBSCRIBE
|
|
1899
|
+
}]
|
|
1900
|
+
});
|
|
1901
|
+
case 2:
|
|
1902
|
+
result = _context3.sent;
|
|
1903
|
+
return _context3.abrupt("return", result === 1);
|
|
1904
|
+
case 4:
|
|
1905
|
+
case "end":
|
|
1906
|
+
return _context3.stop();
|
|
2755
1907
|
}
|
|
2756
1908
|
}, _callee3, this);
|
|
2757
1909
|
}));
|
|
2758
|
-
|
|
2759
1910
|
function removeSubscriber(_x3) {
|
|
2760
1911
|
return _removeSubscriber.apply(this, arguments);
|
|
2761
1912
|
}
|
|
2762
|
-
|
|
2763
1913
|
return removeSubscriber;
|
|
2764
1914
|
}()
|
|
2765
1915
|
/**
|
|
@@ -2782,42 +1932,35 @@ var BentoAPIV1 = /*#__PURE__*/function () {
|
|
|
2782
1932
|
* @returns Promise\<boolean\>
|
|
2783
1933
|
*/
|
|
2784
1934
|
;
|
|
2785
|
-
|
|
2786
1935
|
_proto.updateFields =
|
|
2787
1936
|
/*#__PURE__*/
|
|
2788
1937
|
function () {
|
|
2789
|
-
var _updateFields = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
1938
|
+
var _updateFields = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(parameters) {
|
|
2790
1939
|
var result;
|
|
2791
|
-
return
|
|
2792
|
-
while (1) {
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
case 4:
|
|
2810
|
-
case "end":
|
|
2811
|
-
return _context4.stop();
|
|
2812
|
-
}
|
|
1940
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
1941
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
1942
|
+
case 0:
|
|
1943
|
+
_context4.next = 2;
|
|
1944
|
+
return this.Batch.importEvents({
|
|
1945
|
+
events: [{
|
|
1946
|
+
date: parameters.date,
|
|
1947
|
+
email: parameters.email,
|
|
1948
|
+
type: BentoEvents.UPDATE_FIELDS,
|
|
1949
|
+
fields: parameters.fields
|
|
1950
|
+
}]
|
|
1951
|
+
});
|
|
1952
|
+
case 2:
|
|
1953
|
+
result = _context4.sent;
|
|
1954
|
+
return _context4.abrupt("return", result === 1);
|
|
1955
|
+
case 4:
|
|
1956
|
+
case "end":
|
|
1957
|
+
return _context4.stop();
|
|
2813
1958
|
}
|
|
2814
1959
|
}, _callee4, this);
|
|
2815
1960
|
}));
|
|
2816
|
-
|
|
2817
1961
|
function updateFields(_x4) {
|
|
2818
1962
|
return _updateFields.apply(this, arguments);
|
|
2819
1963
|
}
|
|
2820
|
-
|
|
2821
1964
|
return updateFields;
|
|
2822
1965
|
}()
|
|
2823
1966
|
/**
|
|
@@ -2839,42 +1982,35 @@ var BentoAPIV1 = /*#__PURE__*/function () {
|
|
|
2839
1982
|
* @returns Promise\<boolean\>
|
|
2840
1983
|
*/
|
|
2841
1984
|
;
|
|
2842
|
-
|
|
2843
1985
|
_proto.trackPurchase =
|
|
2844
1986
|
/*#__PURE__*/
|
|
2845
1987
|
function () {
|
|
2846
|
-
var _trackPurchase = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
1988
|
+
var _trackPurchase = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(parameters) {
|
|
2847
1989
|
var result;
|
|
2848
|
-
return
|
|
2849
|
-
while (1) {
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
case 4:
|
|
2867
|
-
case "end":
|
|
2868
|
-
return _context5.stop();
|
|
2869
|
-
}
|
|
1990
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
1991
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
1992
|
+
case 0:
|
|
1993
|
+
_context5.next = 2;
|
|
1994
|
+
return this.Batch.importEvents({
|
|
1995
|
+
events: [{
|
|
1996
|
+
date: parameters.date,
|
|
1997
|
+
email: parameters.email,
|
|
1998
|
+
type: BentoEvents.PURCHASE,
|
|
1999
|
+
details: parameters.purchaseDetails
|
|
2000
|
+
}]
|
|
2001
|
+
});
|
|
2002
|
+
case 2:
|
|
2003
|
+
result = _context5.sent;
|
|
2004
|
+
return _context5.abrupt("return", result === 1);
|
|
2005
|
+
case 4:
|
|
2006
|
+
case "end":
|
|
2007
|
+
return _context5.stop();
|
|
2870
2008
|
}
|
|
2871
2009
|
}, _callee5, this);
|
|
2872
2010
|
}));
|
|
2873
|
-
|
|
2874
2011
|
function trackPurchase(_x5) {
|
|
2875
2012
|
return _trackPurchase.apply(this, arguments);
|
|
2876
2013
|
}
|
|
2877
|
-
|
|
2878
2014
|
return trackPurchase;
|
|
2879
2015
|
}()
|
|
2880
2016
|
/**
|
|
@@ -2895,40 +2031,32 @@ var BentoAPIV1 = /*#__PURE__*/function () {
|
|
|
2895
2031
|
* @returns Promise\<boolean\>
|
|
2896
2032
|
*/
|
|
2897
2033
|
;
|
|
2898
|
-
|
|
2899
2034
|
_proto.track =
|
|
2900
2035
|
/*#__PURE__*/
|
|
2901
2036
|
function () {
|
|
2902
|
-
var _track = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
2037
|
+
var _track = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(parameters) {
|
|
2903
2038
|
var result;
|
|
2904
|
-
return
|
|
2905
|
-
while (1) {
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
case 4:
|
|
2918
|
-
case "end":
|
|
2919
|
-
return _context6.stop();
|
|
2920
|
-
}
|
|
2039
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
2040
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
2041
|
+
case 0:
|
|
2042
|
+
_context6.next = 2;
|
|
2043
|
+
return this.Batch.importEvents({
|
|
2044
|
+
events: [parameters]
|
|
2045
|
+
});
|
|
2046
|
+
case 2:
|
|
2047
|
+
result = _context6.sent;
|
|
2048
|
+
return _context6.abrupt("return", result === 1);
|
|
2049
|
+
case 4:
|
|
2050
|
+
case "end":
|
|
2051
|
+
return _context6.stop();
|
|
2921
2052
|
}
|
|
2922
2053
|
}, _callee6, this);
|
|
2923
2054
|
}));
|
|
2924
|
-
|
|
2925
2055
|
function track(_x6) {
|
|
2926
2056
|
return _track.apply(this, arguments);
|
|
2927
2057
|
}
|
|
2928
|
-
|
|
2929
2058
|
return track;
|
|
2930
2059
|
}();
|
|
2931
|
-
|
|
2932
2060
|
return BentoAPIV1;
|
|
2933
2061
|
}();
|
|
2934
2062
|
|