@bentonow/bento-node-sdk 0.1.14 → 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.
@@ -1 +1 @@
1
- {"version":3,"file":"bento-node-sdk.esm.js","sources":["../node_modules/regenerator-runtime/runtime.js","../src/sdk/batch/errors.ts","../src/sdk/batch/index.ts","../src/sdk/client/errors.ts","../src/sdk/client/index.ts","../src/sdk/commands/enums.ts","../src/sdk/commands/index.ts","../src/sdk/experimental/index.ts","../src/sdk/fields/index.ts","../src/sdk/forms/index.ts","../src/sdk/subscribers/index.ts","../src/sdk/tags/index.ts","../src/sdk/batch/enums.ts","../src/versions/v1/index.ts","../src/index.ts"],"sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","export class TooFewSubscribersError extends Error {\n constructor(message = 'Too few subscribers') {\n super(message);\n this.name = 'TooFewSubscribersError';\n }\n}\n\nexport class TooManySubscribersError extends Error {\n constructor(message = 'Too many subscribers') {\n super(message);\n this.name = 'TooManySubscribersError';\n }\n}\n\nexport class TooFewEventsError extends Error {\n constructor(message = 'Too few events') {\n super(message);\n this.name = 'TooFewEventsError';\n }\n}\n\nexport class TooManyEventsError extends Error {\n constructor(message = 'Too many events') {\n super(message);\n this.name = 'TooManyEventsError';\n }\n}\n","import type { BentoClient } from '../client';\nimport {\n TooFewEventsError,\n TooFewSubscribersError,\n TooManyEventsError,\n TooManySubscribersError,\n} from './errors';\nimport type {\n BatchImportEventsParameter,\n BatchImportEventsResponse,\n BatchImportSubscribersParameter,\n BatchImportSubscribersResponse,\n} from './types';\n\nexport class BentoBatch<S, E extends string> {\n private readonly _maxBatchSize = 1000;\n private readonly _url = '/batch';\n\n constructor(private readonly _client: BentoClient) {}\n\n /**\n * **This does not trigger automations!** - If you wish to trigger automations, please batch import\n * events with the type set to `BentoEvents.SUBSCRIBE`, or `$subscribe`. Note that the batch event import\n * cannot attach custom fields and will ignore everything except the email.\n *\n * Creates a batch job to import subscribers into the system. You can pass in\n * between 1 and 1,000 subscribers to import. Each subscriber must have an email,\n * and may optionally have any additional fields. The additional fields are added\n * as custom fields on the subscriber.\n *\n * This method is processed by the Bento import queues and it may take between 1 and\n * 5 minutes for the results to appear in your dashboard.\n *\n * Returns the number of subscribers that were imported.\n *\n * @param parameters\n * @returns Promise\\<number\\>\n */\n public async importSubscribers(\n parameters: BatchImportSubscribersParameter<S>\n ): Promise<number> {\n if (parameters.subscribers.length === 0) {\n throw new TooFewSubscribersError(\n `You must send between 1 and 1,000 subscribers.`\n );\n }\n\n if (parameters.subscribers.length > this._maxBatchSize) {\n throw new TooManySubscribersError(\n `You must send between 1 and 1,000 subscribers.`\n );\n }\n\n const result = await this._client.post<BatchImportSubscribersResponse>(\n `${this._url}/subscribers`,\n {\n subscribers: parameters.subscribers,\n }\n );\n\n return result.results;\n }\n\n /**\n * Creates a batch job to import events into the system. You can pass in\n * between 1 and 1,000 events to import. Each event must have an email and\n * a type. In addition to this, you my pass in additional data in the\n * `details` property.\n *\n * Returns the number of events that were imported.\n *\n * @param parameters\n * @returns Promise\\<number\\>\n */\n public async importEvents(\n parameters: BatchImportEventsParameter<S, E>\n ): Promise<number> {\n if (parameters.events.length === 0) {\n throw new TooFewEventsError(`You must send between 1 and 1,000 events.`);\n }\n\n if (parameters.events.length > this._maxBatchSize) {\n throw new TooManyEventsError(`You must send between 1 and 1,000 events.`);\n }\n\n const result = await this._client.post<BatchImportEventsResponse>(\n `${this._url}/events`,\n {\n events: parameters.events,\n }\n );\n\n return result.results;\n }\n}\n","export class NotAuthorizedError extends Error {\n constructor(message = 'Not authorized') {\n super(message);\n this.name = 'NotAuthorizedError';\n }\n}\n\nexport class RateLimitedError extends Error {\n constructor(message = 'You are being rate limited') {\n super(message);\n this.name = 'RateLimitedError';\n }\n}\n","import fetch from 'isomorphic-fetch';\nimport type { AnalyticsOptions, AuthenticationOptions } from '../interfaces';\nimport { NotAuthorizedError, RateLimitedError } from './errors';\n\nexport class BentoClient {\n private readonly _headers: HeadersInit = {};\n private readonly _baseUrl: string = 'https://app.bentonow.com/api/v1';\n private readonly _siteUuid: string = '';\n private readonly _logErrors: boolean = false;\n\n constructor(options: AnalyticsOptions) {\n this._baseUrl = options.clientOptions?.baseUrl || this._baseUrl;\n this._siteUuid = options.siteUuid;\n this._headers = this._extractHeaders(options.authentication);\n this._logErrors = options.logErrors || false;\n }\n\n /**\n * Wraps a GET request to the Bento API and automatically adds the required\n * headers.\n *\n * @param endpoint string\n * @param payload object\n * @returns Promise\\<T\\>\n * */\n public get<T>(\n endpoint: string,\n payload: Record<string, unknown> = {}\n ): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n const queryParameters = this._getQueryParameters(payload);\n\n fetch(`${this._baseUrl}${endpoint}?${queryParameters}`, {\n method: 'GET',\n headers: this._headers,\n })\n .then(async (result) => {\n if (this._isSuccessfulStatus(result.status)) {\n return result.json();\n }\n\n throw await this._getErrorForResponse(result);\n })\n .then((data) => resolve(data))\n .catch((error) => reject(error));\n });\n }\n\n /**\n * Wraps a POST request to the Bento API and automatically adds the required\n * headers.\n *\n * @param endpoint string\n * @param payload object\n * @returns Promise\\<T\\>\n * */\n public post<T>(\n endpoint: string,\n payload: Record<string, unknown> = {}\n ): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n const body = this._getBody(payload);\n\n fetch(`${this._baseUrl}${endpoint}`, {\n method: 'POST',\n headers: {\n ...this._headers,\n 'Content-Type': 'application/json',\n },\n body,\n })\n .then(async (result) => {\n if (this._isSuccessfulStatus(result.status)) {\n return result.json();\n }\n\n throw await this._getErrorForResponse(result);\n })\n .then((data) => resolve(data))\n .catch((error) => reject(error));\n });\n }\n\n /**\n * Extracts the `publishableKey` and `secretKey` from the `authentication` options and\n * adds the `Authorization` header.\n *\n * @param authentication AuthenticationOptions\n * @returns HeadersInit\n */\n private _extractHeaders(authentication: AuthenticationOptions): HeadersInit {\n const authenticationKey = Buffer.from(\n `${authentication.publishableKey}:${authentication.secretKey}`\n ).toString('base64');\n\n return {\n Authorization: `Basic ${authenticationKey}`,\n };\n }\n\n /**\n * Takes the existing payload and adds the `site_uuid` to it, then returns\n * it out as a JSON string so that it can be sent alongside the request.\n *\n * @param payload object\n * @returns string\n */\n private _getBody(payload: Record<string, unknown>): string {\n return JSON.stringify({\n ...payload,\n site_uuid: this._siteUuid,\n });\n }\n\n /**\n * Takes the existing payload and adds the `site_uuid` to it, converts the\n * object to a query string so that it can be sent alongside a GET request.\n *\n * @param payload object\n * @returns string\n */\n private _getQueryParameters(payload: Record<string, unknown>): string {\n const body = {\n ...payload,\n site_uuid: this._siteUuid,\n };\n\n const queryParameters = new URLSearchParams();\n for (const [key, value] of Object.entries(body)) {\n queryParameters.append(key, value);\n }\n\n return queryParameters.toString();\n }\n\n /**\n * Filters down the status codes to those that are considered a 'success'.\n *\n * @param statusCode number\n * @returns boolean\n */\n private _isSuccessfulStatus(statusCode: number): boolean {\n const validStatusCodes: number[] = [200, 201];\n\n return validStatusCodes.includes(statusCode);\n }\n\n /**\n * Returns an appropriate error to be thrown given the received response.\n *\n * @param response Response\n * @returns Error\n */\n private async _getErrorForResponse(response: Response): Promise<Error> {\n if (this._logErrors) {\n console.error(response);\n }\n\n if (response.status === 401) return new NotAuthorizedError();\n if (response.status === 429) return new RateLimitedError();\n\n const contentType = response.headers.get('Content-Type');\n let responseMessage = '';\n\n switch (contentType?.toLocaleLowerCase()) {\n case 'text/plain':\n responseMessage = await response.text();\n break;\n case 'application/json':\n responseMessage = JSON.stringify(await response.json());\n break;\n default:\n responseMessage = 'Unknown response from the Bento API.';\n break;\n }\n\n return new Error(`[${response.status}] - ${responseMessage}`);\n }\n}\n","/**\n * Command Enums\n */\nexport enum CommandTypes {\n ADD_FIELD = 'add_field',\n ADD_TAG = 'add_tag',\n CHANGE_EMAIL = 'change_email',\n REMOVE_FIELD = 'remove_field',\n REMOVE_TAG = 'remove_tag',\n SUBSCRIBE = 'subscribe',\n UNSUBSCRIBE = 'unsubscribe',\n}\n","import type { BentoClient } from '../client';\nimport type { DataResponse } from '../client/types';\nimport type { Subscriber } from '../subscribers/types';\nimport { CommandTypes } from './enums';\nimport type {\n AddFieldParameters,\n AddTagParameters,\n ChangeEmailParameters,\n RemoveFieldParameters,\n RemoveTagParameters,\n SubscribeParameters,\n UnsubscribeParameters,\n} from './types';\n\nexport class BentoCommands<S> {\n private readonly _url = '/fetch/commands';\n\n constructor(private readonly _client: BentoClient) {}\n\n /**\n * **This does not trigger automations!** - If you wish to trigger automations, please use the\n * core module's `tagSubscriber` method.\n *\n * Adds a tag to the subscriber with the matching email.\n *\n * Note that both the tag and the subscriber will be created if either is missing\n * from system.\n *\n *\n * @param parameters \\{ email: string, tagName: string \\}\n * @returns Promise\\<Subscriber | null\\>\n */\n public async addTag(\n parameters: AddTagParameters\n ): Promise<Subscriber<S> | null> {\n const result = await this._client.post<DataResponse<Subscriber<S>>>(\n this._url,\n {\n command: {\n command: CommandTypes.ADD_TAG,\n email: parameters.email,\n query: parameters.tagName,\n },\n }\n );\n\n if (Object.keys(result).length === 0 || !result.data) return null;\n return result.data;\n }\n\n /**\n * Removes the specified tag from the subscriber with the matching email.\n *\n * @param parameters \\{ email: string, tagName: string \\}\n * @returns Promise\\<Subscriber | null\\>\n */\n public async removeTag(\n parameters: RemoveTagParameters\n ): Promise<Subscriber<S> | null> {\n const result = await this._client.post<DataResponse<Subscriber<S>>>(\n this._url,\n {\n command: {\n command: CommandTypes.REMOVE_TAG,\n email: parameters.email,\n query: parameters.tagName,\n },\n }\n );\n\n if (Object.keys(result).length === 0 || !result.data) return null;\n return result.data;\n }\n\n /**\n * **This does not trigger automations!** - If you wish to trigger automations, please use the\n * core module's `updateFields` method.\n *\n * Adds a field to the subscriber with the matching email.\n *\n * Note that both the field and the subscriber will be created if either is missing\n * from system.\n *\n * @param parameters \\{ email: string, field: \\{ key: string; value: string; \\} \\}\n * @returns Promise\\<Subscriber | null\\>\n */\n public async addField(\n parameters: AddFieldParameters<S>\n ): Promise<Subscriber<S> | null> {\n const result = await this._client.post<DataResponse<Subscriber<S>>>(\n this._url,\n {\n command: {\n command: CommandTypes.ADD_FIELD,\n email: parameters.email,\n query: parameters.field,\n },\n }\n );\n\n if (Object.keys(result).length === 0 || !result.data) return null;\n return result.data;\n }\n\n /**\n * Removes a field to the subscriber with the matching email.\n *\n * @param parameters \\{ email: string, fieldName: string \\}\n * @returns Promise\\<Subscriber | null\\>\n */\n public async removeField(\n parameters: RemoveFieldParameters<S>\n ): Promise<Subscriber<S> | null> {\n const result = await this._client.post<DataResponse<Subscriber<S>>>(\n this._url,\n {\n command: {\n command: CommandTypes.REMOVE_FIELD,\n email: parameters.email,\n query: parameters.fieldName,\n },\n }\n );\n\n if (Object.keys(result).length === 0 || !result.data) return null;\n return result.data;\n }\n\n /**\n * **This does not trigger automations!** - If you wish to trigger automations, please use the\n * core module's `addSubscriber` method.\n *\n * Subscribes the supplied email to Bento. If the email does not exist, it is created.\n * If the subscriber had previously unsubscribed, they will be re-subscribed.\n *\n * @param parameters \\{ email: string \\}\n * @returns Promise\\<Subscriber | null\\>\n */\n public async subscribe(\n parameters: SubscribeParameters\n ): Promise<Subscriber<S> | null> {\n const result = await this._client.post<DataResponse<Subscriber<S>>>(\n this._url,\n {\n command: {\n command: CommandTypes.SUBSCRIBE,\n email: parameters.email,\n },\n }\n );\n\n if (Object.keys(result).length === 0 || !result.data) return null;\n return result.data;\n }\n\n /**\n * **This does not trigger automations!** - If you wish to trigger automations, please use the\n * core module's `removeSubscriber` method.\n *\n * Unsubscribes the supplied email to Bento. If the email does not exist, it is created and\n * immediately unsubscribed. If they had already unsubscribed, the `unsubscribed_at` property\n * is updated.\n *\n * @param parameters \\{ email: string \\}\n * @returns Promise\\<Subscriber | null\\>\n */\n public async unsubscribe(\n parameters: UnsubscribeParameters\n ): Promise<Subscriber<S> | null> {\n const result = await this._client.post<DataResponse<Subscriber<S>>>(\n this._url,\n {\n command: {\n command: CommandTypes.UNSUBSCRIBE,\n email: parameters.email,\n },\n }\n );\n\n if (Object.keys(result).length === 0 || !result.data) return null;\n return result.data;\n }\n\n /**\n * Updates the email of a user in Bento.\n *\n * @param parameters \\{ oldEmail: string, newEmail: string \\}\n * @returns Promise\\<Subscriber | null\\>\n */\n public async changeEmail(\n parameters: ChangeEmailParameters\n ): Promise<Subscriber<S> | null> {\n const result = await this._client.post<DataResponse<Subscriber<S>>>(\n this._url,\n {\n command: {\n command: CommandTypes.CHANGE_EMAIL,\n email: parameters.oldEmail,\n query: parameters.newEmail,\n },\n }\n );\n\n if (Object.keys(result).length === 0 || !result.data) return null;\n return result.data;\n }\n}\n","import type { BentoClient } from '../client';\nimport type { LocationData } from '../types';\nimport type {\n BlacklistParameters,\n BlacklistResponse,\n GeolocateParameters,\n GeolocateResponse,\n GuessGenderParameters,\n GuessGenderResponse,\n ValidateEmailParameters,\n ValidateEmailResponse,\n} from './types';\n\nexport class BentoExperimental {\n private readonly _url = '/experimental';\n\n constructor(private readonly _client: BentoClient) {}\n\n /**\n * **EXPERIMENTAL** -\n * This functionality is experimental and may change or stop working at any time.\n *\n * Attempts to validate the email. You can provide additional information to further\n * refine the validation.\n *\n * If a name is provided, it compares it against the US Census Data, and so the results\n * may be biased.\n *\n * @param parameters\n * @returns Promise\\<boolean\\>\n */\n public async validateEmail(\n parameters: ValidateEmailParameters\n ): Promise<boolean> {\n const result = await this._client.post<ValidateEmailResponse>(\n `${this._url}/validation`,\n {\n email: parameters.email,\n ip: parameters.ip,\n name: parameters.name,\n user_agent: parameters.userAgent,\n }\n );\n\n return result.valid;\n }\n\n /**\n * **EXPERIMENTAL** -\n * This functionality is experimental and may change or stop working at any time.\n *\n * Attempts to guess the gender of the person given a provided name. It compares\n * the name against the US Census Data, and so the results may be biased.\n *\n * It is possible for the gender to be unknown if the system cannot confidently\n * conclude what gender it may be.\n *\n * @param parameters\n * @returns Promise\\<GuessGenderResponse\\>\n */\n public async guessGender(\n parameters: GuessGenderParameters\n ): Promise<GuessGenderResponse> {\n const result = await this._client.post<GuessGenderResponse>(\n `${this._url}/gender`,\n parameters\n );\n\n return result;\n }\n\n /**\n * **EXPERIMENTAL** -\n * This functionality is experimental and may change or stop working at any time.\n *\n * Attempts to provide location data given a provided IP address.\n *\n * @param parameters\n * @returns Promise\\<GeolocateResponse\\>\n */\n public async geolocate(\n parameters: GeolocateParameters\n ): Promise<LocationData | null> {\n const result = await this._client.get<GeolocateResponse>(\n `${this._url}/geolocation`,\n parameters\n );\n\n if (Object.keys(result).length === 0) return null;\n return result as LocationData;\n }\n\n /**\n * **EXPERIMENTAL** -\n * This functionality is experimental and may change or stop working at any time.\n *\n * Looks up the provided URL or IP Address against various blacklists to see if the site has been\n * blacklisted anywhere.\n *\n * @param parameters\n * @returns Promise\\<BlacklistResponse\\>\n */\n public async checkBlacklist(\n parameters: BlacklistParameters\n ): Promise<BlacklistResponse> {\n const result = await this._client.get<BlacklistResponse>(\n `${this._url}/blacklist.json`,\n parameters\n );\n\n return result;\n }\n}\n","import type { BentoClient } from '../client';\nimport type { DataResponse } from '../client/types';\nimport type { CreateFieldParameters, Field } from './types';\n\nexport class BentoFields {\n private readonly _url = '/fetch/fields';\n\n constructor(private readonly _client: BentoClient) {}\n\n /**\n * Returns all of the fields for the site.\n *\n * @returns Promise<Field[]>\n */\n public async getFields(): Promise<Field[] | null> {\n const result = await this._client.get<DataResponse<Field[]>>(this._url);\n\n if (Object.keys(result).length === 0 || !result.data) return null;\n return result.data;\n }\n\n /**\n * Creates a field inside of Bento. The name of the field is automatically generated\n * from the key that is passed in upon creation. For example\n * - Key: `thisIsAKey`\n * Name: `This Is A Key`\n * - Key: `this is a key`\n * Name: `This Is A Key`\n * - Key: `this-is-a-key`\n * Name: `This Is A Key`\n * - Key: `this_is_a_key`\n * Name: `This Is A Key`\n *\n * @param parameters \\{ key: string \\}\n * @returns Promise<Field[]>\n */\n public async createField(\n parameters: CreateFieldParameters\n ): Promise<Field[] | null> {\n const result = await this._client.post<DataResponse<Field[]>>(this._url, {\n field: parameters,\n });\n\n if (Object.keys(result).length === 0 || !result.data) return null;\n return result.data;\n }\n}\n","import type { BentoClient } from '../client';\nimport type { DataResponse } from '../client/types';\nimport type { FormResponse } from './types';\n\nexport class BentoForms {\n private readonly _url = '/fetch/responses';\n\n constructor(private readonly _client: BentoClient) {}\n\n /**\n * Returns all of the responses for the form with the specified identifier.\n *\n * @param formIdentifier string\n * @returns Promise\\<FormResponse[] | null\\>\n */\n public async getResponses(\n formIdentifier: string\n ): Promise<FormResponse[] | null> {\n const result = await this._client.get<DataResponse<FormResponse[]>>(\n this._url,\n {\n id: formIdentifier,\n }\n );\n\n if (Object.keys(result).length === 0 || !result.data) return null;\n return result.data;\n }\n}\n","import type { BentoClient } from '../client';\nimport type { DataResponse } from '../client/types';\nimport type {\n CreateSubscriberParameters,\n GetSubscribersParameters,\n Subscriber,\n} from './types';\n\nexport class BentoSubscribers<S> {\n private readonly _url = '/fetch/subscribers';\n\n constructor(private readonly _client: BentoClient) {}\n\n /**\n * Returns the subscriber with the specified email or UUID.\n *\n * @returns Promise\\<Subscriber\\<S\\> | null\\>\n */\n public async getSubscribers(\n parameters?: GetSubscribersParameters\n ): Promise<Subscriber<S> | null> {\n const result = await this._client.get<DataResponse<Subscriber<S>>>(\n this._url,\n parameters\n );\n\n if (Object.keys(result).length === 0 || !result.data) return null;\n return result.data;\n }\n\n /**\n * Creates a subscriber inside of Bento.\n *\n * @param parameters CreateSubscriberParameters\n * @returns Promise\\<Subscriber\\<S\\> | null\\>\n */\n public async createSubscriber(\n parameters: CreateSubscriberParameters\n ): Promise<Subscriber<S> | null> {\n const result = await this._client.post<DataResponse<Subscriber<S>>>(\n this._url,\n {\n subscriber: parameters,\n }\n );\n\n if (Object.keys(result).length === 0 || !result.data) return null;\n return result.data;\n }\n}\n","import type { BentoClient } from '../client';\nimport type { DataResponse } from '../client/types';\nimport type { CreateTagParameters, Tag } from './types';\n\nexport class BentoTags {\n private readonly _url = '/fetch/tags';\n\n constructor(private readonly _client: BentoClient) {}\n\n /**\n * Returns all of the fields for the site.\n *\n * @returns Promise\\<Tag[] | null\\>\n */\n public async getTags(): Promise<Tag[] | null> {\n const result = await this._client.get<DataResponse<Tag[]>>(this._url);\n\n if (Object.keys(result).length === 0 || !result.data) return null;\n return result.data;\n }\n\n /**\n * Creates a tag inside of Bento.\n *\n * @param parameters CreateTagParameters\n * @returns Promise\\<Tag[] | null\\>\n */\n public async createTag(\n parameters: CreateTagParameters\n ): Promise<Tag[] | null> {\n const result = await this._client.post<DataResponse<Tag[]>>(this._url, {\n tag: parameters,\n });\n\n if (Object.keys(result).length === 0 || !result.data) return null;\n return result.data;\n }\n}\n","export enum BentoEvents {\n PURCHASE = '$purchase',\n SUBSCRIBE = '$subscribe',\n TAG = '$tag',\n REMOVE_TAG = '$remove_tag',\n UNSUBSCRIBE = '$unsubscribe',\n UPDATE_FIELDS = '$update_fields',\n}\n","import {\n BentoBatch,\n BentoClient,\n BentoCommands,\n BentoExperimental,\n BentoFields,\n BentoForms,\n BentoSubscribers,\n BentoTags,\n} from '../../sdk';\nimport { BentoEvents } from '../../sdk/batch/enums';\nimport type { AnalyticsOptions } from '../../sdk/interfaces';\nimport type {\n AddSubscriberParameters,\n RemoveSubscriberParameters,\n TagSubscriberParameters,\n TrackParameters,\n TrackPurchaseParameters,\n UpdateFieldsParameters,\n} from './types';\n\nexport class BentoAPIV1<\n S = { [key: string]: unknown },\n E extends string = '$custom'\n> {\n private readonly _client: BentoClient;\n\n public readonly Batch: BentoBatch<S, E>;\n public readonly Commands: BentoCommands<S>;\n public readonly Experimental: BentoExperimental;\n public readonly Fields: BentoFields;\n public readonly Forms: BentoForms;\n public readonly Subscribers: BentoSubscribers<S>;\n public readonly Tags: BentoTags;\n\n constructor(options: AnalyticsOptions) {\n this._client = new BentoClient(options);\n this.Batch = new BentoBatch(this._client);\n this.Commands = new BentoCommands(this._client);\n this.Experimental = new BentoExperimental(this._client);\n this.Fields = new BentoFields(this._client);\n this.Forms = new BentoForms(this._client);\n this.Subscribers = new BentoSubscribers(this._client);\n this.Tags = new BentoTags(this._client);\n }\n\n /**\n * **This TRIGGERS automations!** - If you do not wish to trigger automations, please use the\n * `Commands.addTag` method.\n *\n * Tags a subscriber with the specified email and tag. If either the tag or the user\n * do not exist, they will be created in the system. If the user already has the tag,\n * another tag event will be sent, triggering any automations that take place upon a\n * tag being added to a subscriber. Please be aware of the potential consequences.\n *\n * Because this method uses the batch API, the tag may take between 1 and 3 minutes\n * to appear in the system.\n *\n * Returns `true` if the event was successfully dispatched. Returns `false` otherwise.\n *\n * @param parameters TagSubscriberParameters\n * @returns Promise\\<boolean\\>\n */\n async tagSubscriber(parameters: TagSubscriberParameters): Promise<boolean> {\n const result = await this.Batch.importEvents({\n events: [\n {\n date: parameters.date,\n details: {\n tag: parameters.tagName,\n },\n email: parameters.email,\n type: BentoEvents.TAG,\n },\n ],\n });\n\n return result === 1;\n }\n\n /**\n * **This TRIGGERS automations!** - If you do not wish to trigger automations, please use the\n * `Commands.subscribe` method.\n *\n * Creates a subscriber in the system. If the subscriber already exists, another subscribe event\n * will be sent, triggering any automations that take place upon subscription. Please be aware\n * of the potential consequences.\n *\n * You may optionally pass any fields that you wish to be set on the subscriber during creation\n * as well as a `Date` which will backdate the event. If no date is supplied, then the event will\n * default to the current time.\n *\n * Because this method uses the batch API, the tag may take between 1 and 3 minutes\n * to appear in the system.\n *\n * Returns `true` if the event was successfully dispatched. Returns `false` otherwise.\n *\n * @param parameters AddSubscriberParameters\n * @returns Promise\\<boolean\\>\n */\n async addSubscriber(\n parameters: AddSubscriberParameters<S>\n ): Promise<boolean> {\n const result = await this.Batch.importEvents({\n events: [\n {\n date: parameters.date,\n email: parameters.email,\n type: BentoEvents.SUBSCRIBE,\n fields: parameters.fields || {},\n },\n ],\n });\n\n return result === 1;\n }\n\n /**\n * **This TRIGGERS automations!** - If you do not wish to trigger automations, please use the\n * `Commands.unsubscribe` method.\n *\n * Unsubscribes an email in the system. If the email is already unsubscribed, another unsubscribe event\n * will be sent, triggering any automations that take place upon an unsubscribe happening. Please be aware\n * of the potential consequences.\n *\n * You may optionally pass a `Date` which will backdate the event. If no date is supplied, then the event\n * will default to the current time.\n *\n * Because this method uses the batch API, the tag may take between 1 and 3 minutes\n * to appear in the system.\n *\n * Returns `true` if the event was successfully dispatched. Returns `false` otherwise.\n *\n * @param parameters RemoveSubscriberParameters\n * @returns Promise\\<boolean\\>\n */\n async removeSubscriber(\n parameters: RemoveSubscriberParameters\n ): Promise<boolean> {\n const result = await this.Batch.importEvents({\n events: [\n {\n date: parameters.date,\n email: parameters.email,\n type: BentoEvents.UNSUBSCRIBE,\n },\n ],\n });\n\n return result === 1;\n }\n\n /**\n * **This TRIGGERS automations!** - If you do not wish to trigger automations, please use the\n * `Commands.addField` method.\n *\n * Sets the passed-in custom fields on the subscriber, creating the subscriber if it does not exist.\n * If the fields are already set on the subscriber, the event will be sent, triggering any automations\n * that take place upon fields being updated. Please be aware of the potential consequences.\n *\n * You may optionally pass a `Date` which will backdate the event. If no date is supplied, then the event\n * will default to the current time.\n *\n * Because this method uses the batch API, the tag may take between 1 and 3 minutes\n * to appear in the system.\n *\n * Returns `true` if the event was successfully dispatched. Returns `false` otherwise.\n *\n * @param parameters UpdateFieldsParameters\\<S\\>\n * @returns Promise\\<boolean\\>\n */\n async updateFields(parameters: UpdateFieldsParameters<S>): Promise<boolean> {\n const result = await this.Batch.importEvents({\n events: [\n {\n date: parameters.date,\n email: parameters.email,\n type: BentoEvents.UPDATE_FIELDS,\n fields: parameters.fields,\n },\n ],\n });\n\n return result === 1;\n }\n\n /**\n * **This TRIGGERS automations!** - There is no way to achieve this same behavior without triggering\n * automations.\n *\n * Tracks a purchase in Bento, used to calculate LTV for your subscribers. The values that are received\n * should be numbers, in cents. For example, `$1.00` should be `100`.\n *\n * You may optionally pass a `Date` which will backdate the event. If no date is supplied, then the event\n * will default to the current time.\n *\n * Because this method uses the batch API, the tag may take between 1 and 3 minutes\n * to appear in the system.\n *\n * Returns `true` if the event was successfully dispatched. Returns `false` otherwise.\n *\n * @param parameters TrackPurchaseParameters\n * @returns Promise\\<boolean\\>\n */\n async trackPurchase(parameters: TrackPurchaseParameters): Promise<boolean> {\n const result = await this.Batch.importEvents({\n events: [\n {\n date: parameters.date,\n email: parameters.email,\n type: BentoEvents.PURCHASE,\n details: parameters.purchaseDetails,\n },\n ],\n });\n\n return result === 1;\n }\n\n /**\n * **This TRIGGERS automations!** - There is no way to achieve this same behavior without triggering\n * automations.\n *\n * Tracks a custom event in Bento.\n *\n * You may optionally pass a `Date` which will backdate the event. If no date is supplied, then the event\n * will default to the current time.\n *\n * Because this method uses the batch API, the tag may take between 1 and 3 minutes\n * to appear in the system.\n *\n * Returns `true` if the event was successfully dispatched. Returns `false` otherwise.\n *\n * @param parameters TrackParameters<S, E>\n * @returns Promise\\<boolean\\>\n */\n async track(parameters: TrackParameters<S, E>): Promise<boolean> {\n const result = await this.Batch.importEvents({\n events: [parameters],\n });\n\n return result === 1;\n }\n}\n","import type { AnalyticsOptions } from './sdk/interfaces';\nimport { BentoAPIV1 } from './versions/v1';\n\nexport class Analytics<S = { [key: string]: unknown }, E extends string = ''> {\n public readonly V1: BentoAPIV1<S, E>;\n\n constructor(options: AnalyticsOptions) {\n this.V1 = new BentoAPIV1(options);\n }\n}\n\nexport * from './sdk/client/errors';\n"],"names":["undefined","TooFewSubscribersError","message","name","Error","TooManySubscribersError","TooFewEventsError","TooManyEventsError","BentoBatch","_client","_maxBatchSize","_url","importSubscribers","parameters","subscribers","length","post","result","results","importEvents","events","NotAuthorizedError","RateLimitedError","BentoClient","options","_headers","_baseUrl","_siteUuid","_logErrors","clientOptions","baseUrl","siteUuid","_extractHeaders","authentication","logErrors","get","endpoint","payload","Promise","resolve","reject","queryParameters","_getQueryParameters","fetch","method","headers","then","_isSuccessfulStatus","status","json","_getErrorForResponse","data","error","body","_getBody","authenticationKey","Buffer","from","publishableKey","secretKey","toString","Authorization","JSON","stringify","site_uuid","URLSearchParams","Object","entries","key","value","append","statusCode","validStatusCodes","includes","response","console","contentType","responseMessage","toLocaleLowerCase","text","CommandTypes","BentoCommands","addTag","command","ADD_TAG","email","query","tagName","keys","removeTag","REMOVE_TAG","addField","ADD_FIELD","field","removeField","REMOVE_FIELD","fieldName","subscribe","SUBSCRIBE","unsubscribe","UNSUBSCRIBE","changeEmail","CHANGE_EMAIL","oldEmail","newEmail","BentoExperimental","validateEmail","ip","user_agent","userAgent","valid","guessGender","geolocate","checkBlacklist","BentoFields","getFields","createField","BentoForms","getResponses","formIdentifier","id","BentoSubscribers","getSubscribers","createSubscriber","subscriber","BentoTags","getTags","createTag","tag","BentoEvents","BentoAPIV1","Batch","Commands","Experimental","Fields","Forms","Subscribers","Tags","tagSubscriber","date","details","type","TAG","addSubscriber","fields","removeSubscriber","updateFields","UPDATE_FIELDS","trackPurchase","PURCHASE","purchaseDetails","track","Analytics","V1"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,IAAI,UAAU,OAAO,EAAE;AAElC;AACA,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC,SAAS,CAAC;AAC5B,EAAE,IAAI,MAAM,GAAG,EAAE,CAAC,cAAc,CAAC;AACjC,EAAE,IAAIA,WAAS,CAAC;AAChB,EAAE,IAAI,OAAO,GAAG,OAAO,MAAM,KAAK,UAAU,GAAG,MAAM,GAAG,EAAE,CAAC;AAC3D,EAAE,IAAI,cAAc,GAAG,OAAO,CAAC,QAAQ,IAAI,YAAY,CAAC;AACxD,EAAE,IAAI,mBAAmB,GAAG,OAAO,CAAC,aAAa,IAAI,iBAAiB,CAAC;AACvE,EAAE,IAAI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AAA;AAsME;;;;;;;;;;;;;;;;;AAtMF;;AAAA,SAuNQsI,KAvNR;AAAA;AAAA;AAAA,6EAuNE,kBAAY1I,UAAZ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBACuB,KAAKsH,KAAL,CAAWhH,YAAX,CAAwB;AAC3CC,gBAAAA,MAAM,EAAE,CAACP,UAAD;AADmC,eAAxB,CADvB;;AAAA;AACQI,cAAAA,MADR;AAAA,gDAKSA,MAAM,KAAK,CALpB;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAvNF;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAAA;AAAA;;IClBauI,SAAb,GAGE,mBAAYhI,OAAZ;OAFgBiI;AAGd,OAAKA,EAAL,GAAU,IAAIvB,UAAJ,CAAe1G,OAAf,CAAV;AACD,CALH;;;;"}
1
+ {"version":3,"file":"bento-node-sdk.esm.js","sources":["../src/sdk/batch/errors.ts","../src/sdk/batch/index.ts","../src/sdk/client/errors.ts","../src/sdk/client/index.ts","../src/sdk/commands/enums.ts","../src/sdk/commands/index.ts","../src/sdk/experimental/index.ts","../src/sdk/fields/index.ts","../src/sdk/forms/index.ts","../src/sdk/subscribers/index.ts","../src/sdk/tags/index.ts","../src/sdk/batch/enums.ts","../src/versions/v1/index.ts","../src/index.ts"],"sourcesContent":["export class TooFewSubscribersError extends Error {\n constructor(message = 'Too few subscribers') {\n super(message);\n this.name = 'TooFewSubscribersError';\n }\n}\n\nexport class TooManySubscribersError extends Error {\n constructor(message = 'Too many subscribers') {\n super(message);\n this.name = 'TooManySubscribersError';\n }\n}\n\nexport class TooFewEventsError extends Error {\n constructor(message = 'Too few events') {\n super(message);\n this.name = 'TooFewEventsError';\n }\n}\n\nexport class TooManyEventsError extends Error {\n constructor(message = 'Too many events') {\n super(message);\n this.name = 'TooManyEventsError';\n }\n}\n\nexport class TooFewEmailsError extends Error {\n constructor(message = 'Too few emails') {\n super(message);\n this.name = 'TooFewEmailsError';\n }\n}\n\nexport class TooManyEmailsError extends Error {\n constructor(message = 'Too many emails') {\n super(message);\n this.name = 'TooManyEmailsError';\n }\n}\n","import type { BentoClient } from '../client';\nimport {\n TooFewEmailsError,\n TooFewEventsError,\n TooFewSubscribersError,\n TooManyEmailsError,\n TooManyEventsError,\n TooManySubscribersError,\n} from './errors';\nimport type {\n BatchSendTransactionalEmailsParameter,\n BatchsendTransactionalEmailsResponse,\n BatchImportEventsParameter,\n BatchImportEventsResponse,\n BatchImportSubscribersParameter,\n BatchImportSubscribersResponse,\n} from './types';\n\nexport class BentoBatch<S, E extends string> {\n private readonly _maxEmailBatchSize = 100;\n private readonly _maxBatchSize = 1000;\n private readonly _url = '/batch';\n\n constructor(private readonly _client: BentoClient) {}\n\n /**\n * **This does not trigger automations!** - If you wish to trigger automations, please batch import\n * events with the type set to `BentoEvents.SUBSCRIBE`, or `$subscribe`. Note that the batch event import\n * cannot attach custom fields and will ignore everything except the email.\n *\n * Creates a batch job to import subscribers into the system. You can pass in\n * between 1 and 1,000 subscribers to import. Each subscriber must have an email,\n * and may optionally have any additional fields. The additional fields are added\n * as custom fields on the subscriber.\n *\n * This method is processed by the Bento import queues and it may take between 1 and\n * 5 minutes for the results to appear in your dashboard.\n *\n * Returns the number of subscribers that were imported.\n *\n * @param parameters\n * @returns Promise\\<number\\>\n */\n public async importSubscribers(\n parameters: BatchImportSubscribersParameter<S>\n ): Promise<number> {\n if (parameters.subscribers.length === 0) {\n throw new TooFewSubscribersError(\n `You must send between 1 and 1,000 subscribers.`\n );\n }\n\n if (parameters.subscribers.length > this._maxBatchSize) {\n throw new TooManySubscribersError(\n `You must send between 1 and 1,000 subscribers.`\n );\n }\n\n const result = await this._client.post<BatchImportSubscribersResponse>(\n `${this._url}/subscribers`,\n {\n subscribers: parameters.subscribers,\n }\n );\n\n return result.results;\n }\n\n /**\n * Creates a batch job to import events into the system. You can pass in\n * between 1 and 1,000 events to import. Each event must have an email and\n * a type. In addition to this, you my pass in additional data in the\n * `details` property.\n *\n * Returns the number of events that were imported.\n *\n * @param parameters\n * @returns Promise\\<number\\>\n */\n public async importEvents(\n parameters: BatchImportEventsParameter<S, E>\n ): Promise<number> {\n if (parameters.events.length === 0) {\n throw new TooFewEventsError(`You must send between 1 and 1,000 events.`);\n }\n\n if (parameters.events.length > this._maxBatchSize) {\n throw new TooManyEventsError(`You must send between 1 and 1,000 events.`);\n }\n\n const result = await this._client.post<BatchImportEventsResponse>(\n `${this._url}/events`,\n {\n events: parameters.events,\n }\n );\n\n return result.results;\n }\n\n /**\n * Creates a batch job to send transactional emails from Bento's infrastructure. You can pass in\n * between 1 and 100 emails to send.\n *\n * Each email must have a `to` address, a `from` address, a `subject`, an `html_body`\n * and `transactional: true`.\n * In addition you can add a `personalizations` object to provide\n * liquid tsags that will be injected into the email.\n *\n * Returns the number of events that were imported.\n *\n * @param parameters\n * @returns Promise\\<number\\>\n */\n public async sendTransactionalEmails(\n parameters: BatchSendTransactionalEmailsParameter\n ): Promise<number> {\n if (parameters.emails.length === 0) {\n throw new TooFewEmailsError(`You must send between 1 and 100 emails.`);\n }\n\n if (parameters.emails.length > this._maxEmailBatchSize) {\n throw new TooManyEmailsError(`You must send between 1 and 100 emails.`);\n }\n\n const result =\n await this._client.post<BatchsendTransactionalEmailsResponse>(\n `${this._url}/emails`,\n {\n emails: parameters.emails,\n }\n );\n\n return result.results;\n }\n}\n","export class NotAuthorizedError extends Error {\n constructor(message = 'Not authorized') {\n super(message);\n this.name = 'NotAuthorizedError';\n }\n}\n\nexport class RateLimitedError extends Error {\n constructor(message = 'You are being rate limited') {\n super(message);\n this.name = 'RateLimitedError';\n }\n}\n","import fetch from 'cross-fetch';\nimport type { AnalyticsOptions, AuthenticationOptions } from '../interfaces';\nimport { NotAuthorizedError, RateLimitedError } from './errors';\n\nexport class BentoClient {\n private readonly _headers: HeadersInit = {};\n private readonly _baseUrl: string = 'https://app.bentonow.com/api/v1';\n private readonly _siteUuid: string = '';\n private readonly _logErrors: boolean = false;\n\n constructor(options: AnalyticsOptions) {\n this._baseUrl = options.clientOptions?.baseUrl || this._baseUrl;\n this._siteUuid = options.siteUuid;\n this._headers = this._extractHeaders(options.authentication);\n this._logErrors = options.logErrors || false;\n }\n\n /**\n * Wraps a GET request to the Bento API and automatically adds the required\n * headers.\n *\n * @param endpoint string\n * @param payload object\n * @returns Promise\\<T\\>\n * */\n public get<T>(\n endpoint: string,\n payload: Record<string, unknown> = {}\n ): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n const queryParameters = this._getQueryParameters(payload);\n\n fetch(`${this._baseUrl}${endpoint}?${queryParameters}`, {\n method: 'GET',\n headers: this._headers,\n })\n .then(async result => {\n if (this._isSuccessfulStatus(result.status)) {\n return result.json();\n }\n\n throw await this._getErrorForResponse(result);\n })\n .then(data => resolve(data))\n .catch(error => reject(error));\n });\n }\n\n /**\n * Wraps a POST request to the Bento API and automatically adds the required\n * headers.\n *\n * @param endpoint string\n * @param payload object\n * @returns Promise\\<T\\>\n * */\n public post<T>(\n endpoint: string,\n payload: Record<string, unknown> = {}\n ): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n const body = this._getBody(payload);\n\n fetch(`${this._baseUrl}${endpoint}`, {\n method: 'POST',\n headers: {\n ...this._headers,\n 'Content-Type': 'application/json',\n },\n body,\n })\n .then(async result => {\n if (this._isSuccessfulStatus(result.status)) {\n return result.json();\n }\n\n throw await this._getErrorForResponse(result);\n })\n .then(data => resolve(data))\n .catch(error => reject(error));\n });\n }\n\n /**\n * Extracts the `publishableKey` and `secretKey` from the `authentication` options and\n * adds the `Authorization` header.\n *\n * @param authentication AuthenticationOptions\n * @returns HeadersInit\n */\n private _extractHeaders(authentication: AuthenticationOptions): HeadersInit {\n const authenticationKey = Buffer.from(\n `${authentication.publishableKey}:${authentication.secretKey}`\n ).toString('base64');\n\n return {\n Authorization: `Basic ${authenticationKey}`,\n };\n }\n\n /**\n * Takes the existing payload and adds the `site_uuid` to it, then returns\n * it out as a JSON string so that it can be sent alongside the request.\n *\n * @param payload object\n * @returns string\n */\n private _getBody(payload: Record<string, unknown>): string {\n return JSON.stringify({\n ...payload,\n site_uuid: this._siteUuid,\n });\n }\n\n /**\n * Takes the existing payload and adds the `site_uuid` to it, converts the\n * object to a query string so that it can be sent alongside a GET request.\n *\n * @param payload object\n * @returns string\n */\n private _getQueryParameters(payload: Record<string, unknown>): string {\n const body = {\n ...payload,\n site_uuid: this._siteUuid,\n };\n\n const queryParameters = new URLSearchParams();\n for (const [key, value] of Object.entries(body)) {\n queryParameters.append(key, value);\n }\n\n return queryParameters.toString();\n }\n\n /**\n * Filters down the status codes to those that are considered a 'success'.\n *\n * @param statusCode number\n * @returns boolean\n */\n private _isSuccessfulStatus(statusCode: number): boolean {\n const validStatusCodes: number[] = [200, 201];\n\n return validStatusCodes.includes(statusCode);\n }\n\n /**\n * Returns an appropriate error to be thrown given the received response.\n *\n * @param response Response\n * @returns Error\n */\n private async _getErrorForResponse(response: Response): Promise<Error> {\n if (this._logErrors) {\n console.error(response);\n }\n\n if (response.status === 401) return new NotAuthorizedError();\n if (response.status === 429) return new RateLimitedError();\n\n const contentType = response.headers.get('Content-Type');\n let responseMessage = '';\n\n switch (contentType?.toLocaleLowerCase()) {\n case 'text/plain':\n responseMessage = await response.text();\n break;\n case 'application/json':\n responseMessage = JSON.stringify(await response.json());\n break;\n default:\n responseMessage = 'Unknown response from the Bento API.';\n break;\n }\n\n return new Error(`[${response.status}] - ${responseMessage}`);\n }\n}\n","/**\n * Command Enums\n */\nexport enum CommandTypes {\n ADD_FIELD = 'add_field',\n ADD_TAG = 'add_tag',\n CHANGE_EMAIL = 'change_email',\n REMOVE_FIELD = 'remove_field',\n REMOVE_TAG = 'remove_tag',\n SUBSCRIBE = 'subscribe',\n UNSUBSCRIBE = 'unsubscribe',\n}\n","import type { BentoClient } from '../client';\nimport type { DataResponse } from '../client/types';\nimport type { Subscriber } from '../subscribers/types';\nimport { CommandTypes } from './enums';\nimport type {\n AddFieldParameters,\n AddTagParameters,\n ChangeEmailParameters,\n RemoveFieldParameters,\n RemoveTagParameters,\n SubscribeParameters,\n UnsubscribeParameters,\n} from './types';\n\nexport class BentoCommands<S> {\n private readonly _url = '/fetch/commands';\n\n constructor(private readonly _client: BentoClient) {}\n\n /**\n * **This does not trigger automations!** - If you wish to trigger automations, please use the\n * core module's `tagSubscriber` method.\n *\n * Adds a tag to the subscriber with the matching email.\n *\n * Note that both the tag and the subscriber will be created if either is missing\n * from system.\n *\n *\n * @param parameters \\{ email: string, tagName: string \\}\n * @returns Promise\\<Subscriber | null\\>\n */\n public async addTag(\n parameters: AddTagParameters\n ): Promise<Subscriber<S> | null> {\n const result = await this._client.post<DataResponse<Subscriber<S>>>(\n this._url,\n {\n command: {\n command: CommandTypes.ADD_TAG,\n email: parameters.email,\n query: parameters.tagName,\n },\n }\n );\n\n if (Object.keys(result).length === 0 || !result.data) return null;\n return result.data;\n }\n\n /**\n * Removes the specified tag from the subscriber with the matching email.\n *\n * @param parameters \\{ email: string, tagName: string \\}\n * @returns Promise\\<Subscriber | null\\>\n */\n public async removeTag(\n parameters: RemoveTagParameters\n ): Promise<Subscriber<S> | null> {\n const result = await this._client.post<DataResponse<Subscriber<S>>>(\n this._url,\n {\n command: {\n command: CommandTypes.REMOVE_TAG,\n email: parameters.email,\n query: parameters.tagName,\n },\n }\n );\n\n if (Object.keys(result).length === 0 || !result.data) return null;\n return result.data;\n }\n\n /**\n * **This does not trigger automations!** - If you wish to trigger automations, please use the\n * core module's `updateFields` method.\n *\n * Adds a field to the subscriber with the matching email.\n *\n * Note that both the field and the subscriber will be created if either is missing\n * from system.\n *\n * @param parameters \\{ email: string, field: \\{ key: string; value: string; \\} \\}\n * @returns Promise\\<Subscriber | null\\>\n */\n public async addField(\n parameters: AddFieldParameters<S>\n ): Promise<Subscriber<S> | null> {\n const result = await this._client.post<DataResponse<Subscriber<S>>>(\n this._url,\n {\n command: {\n command: CommandTypes.ADD_FIELD,\n email: parameters.email,\n query: parameters.field,\n },\n }\n );\n\n if (Object.keys(result).length === 0 || !result.data) return null;\n return result.data;\n }\n\n /**\n * Removes a field to the subscriber with the matching email.\n *\n * @param parameters \\{ email: string, fieldName: string \\}\n * @returns Promise\\<Subscriber | null\\>\n */\n public async removeField(\n parameters: RemoveFieldParameters<S>\n ): Promise<Subscriber<S> | null> {\n const result = await this._client.post<DataResponse<Subscriber<S>>>(\n this._url,\n {\n command: {\n command: CommandTypes.REMOVE_FIELD,\n email: parameters.email,\n query: parameters.fieldName,\n },\n }\n );\n\n if (Object.keys(result).length === 0 || !result.data) return null;\n return result.data;\n }\n\n /**\n * **This does not trigger automations!** - If you wish to trigger automations, please use the\n * core module's `addSubscriber` method.\n *\n * Subscribes the supplied email to Bento. If the email does not exist, it is created.\n * If the subscriber had previously unsubscribed, they will be re-subscribed.\n *\n * @param parameters \\{ email: string \\}\n * @returns Promise\\<Subscriber | null\\>\n */\n public async subscribe(\n parameters: SubscribeParameters\n ): Promise<Subscriber<S> | null> {\n const result = await this._client.post<DataResponse<Subscriber<S>>>(\n this._url,\n {\n command: {\n command: CommandTypes.SUBSCRIBE,\n email: parameters.email,\n },\n }\n );\n\n if (Object.keys(result).length === 0 || !result.data) return null;\n return result.data;\n }\n\n /**\n * **This does not trigger automations!** - If you wish to trigger automations, please use the\n * core module's `removeSubscriber` method.\n *\n * Unsubscribes the supplied email to Bento. If the email does not exist, it is created and\n * immediately unsubscribed. If they had already unsubscribed, the `unsubscribed_at` property\n * is updated.\n *\n * @param parameters \\{ email: string \\}\n * @returns Promise\\<Subscriber | null\\>\n */\n public async unsubscribe(\n parameters: UnsubscribeParameters\n ): Promise<Subscriber<S> | null> {\n const result = await this._client.post<DataResponse<Subscriber<S>>>(\n this._url,\n {\n command: {\n command: CommandTypes.UNSUBSCRIBE,\n email: parameters.email,\n },\n }\n );\n\n if (Object.keys(result).length === 0 || !result.data) return null;\n return result.data;\n }\n\n /**\n * Updates the email of a user in Bento.\n *\n * @param parameters \\{ oldEmail: string, newEmail: string \\}\n * @returns Promise\\<Subscriber | null\\>\n */\n public async changeEmail(\n parameters: ChangeEmailParameters\n ): Promise<Subscriber<S> | null> {\n const result = await this._client.post<DataResponse<Subscriber<S>>>(\n this._url,\n {\n command: {\n command: CommandTypes.CHANGE_EMAIL,\n email: parameters.oldEmail,\n query: parameters.newEmail,\n },\n }\n );\n\n if (Object.keys(result).length === 0 || !result.data) return null;\n return result.data;\n }\n}\n","import type { BentoClient } from '../client';\nimport type { LocationData } from '../types';\nimport type {\n BlacklistParameters,\n BlacklistResponse,\n GeolocateParameters,\n GeolocateResponse,\n GuessGenderParameters,\n GuessGenderResponse,\n ValidateEmailParameters,\n ValidateEmailResponse,\n} from './types';\n\nexport class BentoExperimental {\n private readonly _url = '/experimental';\n\n constructor(private readonly _client: BentoClient) {}\n\n /**\n * **EXPERIMENTAL** -\n * This functionality is experimental and may change or stop working at any time.\n *\n * Attempts to validate the email. You can provide additional information to further\n * refine the validation.\n *\n * If a name is provided, it compares it against the US Census Data, and so the results\n * may be biased.\n *\n * @param parameters\n * @returns Promise\\<boolean\\>\n */\n public async validateEmail(\n parameters: ValidateEmailParameters\n ): Promise<boolean> {\n const result = await this._client.post<ValidateEmailResponse>(\n `${this._url}/validation`,\n {\n email: parameters.email,\n ip: parameters.ip,\n name: parameters.name,\n user_agent: parameters.userAgent,\n }\n );\n\n return result.valid;\n }\n\n /**\n * **EXPERIMENTAL** -\n * This functionality is experimental and may change or stop working at any time.\n *\n * Attempts to guess the gender of the person given a provided name. It compares\n * the name against the US Census Data, and so the results may be biased.\n *\n * It is possible for the gender to be unknown if the system cannot confidently\n * conclude what gender it may be.\n *\n * @param parameters\n * @returns Promise\\<GuessGenderResponse\\>\n */\n public async guessGender(\n parameters: GuessGenderParameters\n ): Promise<GuessGenderResponse> {\n const result = await this._client.post<GuessGenderResponse>(\n `${this._url}/gender`,\n parameters\n );\n\n return result;\n }\n\n /**\n * **EXPERIMENTAL** -\n * This functionality is experimental and may change or stop working at any time.\n *\n * Attempts to provide location data given a provided IP address.\n *\n * @param parameters\n * @returns Promise\\<GeolocateResponse\\>\n */\n public async geolocate(\n parameters: GeolocateParameters\n ): Promise<LocationData | null> {\n const result = await this._client.get<GeolocateResponse>(\n `${this._url}/geolocation`,\n parameters\n );\n\n if (Object.keys(result).length === 0) return null;\n return result as LocationData;\n }\n\n /**\n * **EXPERIMENTAL** -\n * This functionality is experimental and may change or stop working at any time.\n *\n * Looks up the provided URL or IP Address against various blacklists to see if the site has been\n * blacklisted anywhere.\n *\n * @param parameters\n * @returns Promise\\<BlacklistResponse\\>\n */\n public async checkBlacklist(\n parameters: BlacklistParameters\n ): Promise<BlacklistResponse> {\n const result = await this._client.get<BlacklistResponse>(\n `${this._url}/blacklist.json`,\n parameters\n );\n\n return result;\n }\n}\n","import type { BentoClient } from '../client';\nimport type { DataResponse } from '../client/types';\nimport type { CreateFieldParameters, Field } from './types';\n\nexport class BentoFields {\n private readonly _url = '/fetch/fields';\n\n constructor(private readonly _client: BentoClient) {}\n\n /**\n * Returns all of the fields for the site.\n *\n * @returns Promise<Field[]>\n */\n public async getFields(): Promise<Field[] | null> {\n const result = await this._client.get<DataResponse<Field[]>>(this._url);\n\n if (Object.keys(result).length === 0 || !result.data) return null;\n return result.data;\n }\n\n /**\n * Creates a field inside of Bento. The name of the field is automatically generated\n * from the key that is passed in upon creation. For example\n * - Key: `thisIsAKey`\n * Name: `This Is A Key`\n * - Key: `this is a key`\n * Name: `This Is A Key`\n * - Key: `this-is-a-key`\n * Name: `This Is A Key`\n * - Key: `this_is_a_key`\n * Name: `This Is A Key`\n *\n * @param parameters \\{ key: string \\}\n * @returns Promise<Field[]>\n */\n public async createField(\n parameters: CreateFieldParameters\n ): Promise<Field[] | null> {\n const result = await this._client.post<DataResponse<Field[]>>(this._url, {\n field: parameters,\n });\n\n if (Object.keys(result).length === 0 || !result.data) return null;\n return result.data;\n }\n}\n","import type { BentoClient } from '../client';\nimport type { DataResponse } from '../client/types';\nimport type { FormResponse } from './types';\n\nexport class BentoForms {\n private readonly _url = '/fetch/responses';\n\n constructor(private readonly _client: BentoClient) {}\n\n /**\n * Returns all of the responses for the form with the specified identifier.\n *\n * @param formIdentifier string\n * @returns Promise\\<FormResponse[] | null\\>\n */\n public async getResponses(\n formIdentifier: string\n ): Promise<FormResponse[] | null> {\n const result = await this._client.get<DataResponse<FormResponse[]>>(\n this._url,\n {\n id: formIdentifier,\n }\n );\n\n if (Object.keys(result).length === 0 || !result.data) return null;\n return result.data;\n }\n}\n","import type { BentoClient } from '../client';\nimport type { DataResponse } from '../client/types';\nimport type {\n CreateSubscriberParameters,\n GetSubscribersParameters,\n Subscriber,\n} from './types';\n\nexport class BentoSubscribers<S> {\n private readonly _url = '/fetch/subscribers';\n\n constructor(private readonly _client: BentoClient) {}\n\n /**\n * Returns the subscriber with the specified email or UUID.\n *\n * @returns Promise\\<Subscriber\\<S\\> | null\\>\n */\n public async getSubscribers(\n parameters?: GetSubscribersParameters\n ): Promise<Subscriber<S> | null> {\n const result = await this._client.get<DataResponse<Subscriber<S>>>(\n this._url,\n parameters\n );\n\n if (Object.keys(result).length === 0 || !result.data) return null;\n return result.data;\n }\n\n /**\n * Creates a subscriber inside of Bento.\n *\n * @param parameters CreateSubscriberParameters\n * @returns Promise\\<Subscriber\\<S\\> | null\\>\n */\n public async createSubscriber(\n parameters: CreateSubscriberParameters\n ): Promise<Subscriber<S> | null> {\n const result = await this._client.post<DataResponse<Subscriber<S>>>(\n this._url,\n {\n subscriber: parameters,\n }\n );\n\n if (Object.keys(result).length === 0 || !result.data) return null;\n return result.data;\n }\n}\n","import type { BentoClient } from '../client';\nimport type { DataResponse } from '../client/types';\nimport type { CreateTagParameters, Tag } from './types';\n\nexport class BentoTags {\n private readonly _url = '/fetch/tags';\n\n constructor(private readonly _client: BentoClient) {}\n\n /**\n * Returns all of the fields for the site.\n *\n * @returns Promise\\<Tag[] | null\\>\n */\n public async getTags(): Promise<Tag[] | null> {\n const result = await this._client.get<DataResponse<Tag[]>>(this._url);\n\n if (Object.keys(result).length === 0 || !result.data) return null;\n return result.data;\n }\n\n /**\n * Creates a tag inside of Bento.\n *\n * @param parameters CreateTagParameters\n * @returns Promise\\<Tag[] | null\\>\n */\n public async createTag(\n parameters: CreateTagParameters\n ): Promise<Tag[] | null> {\n const result = await this._client.post<DataResponse<Tag[]>>(this._url, {\n tag: parameters,\n });\n\n if (Object.keys(result).length === 0 || !result.data) return null;\n return result.data;\n }\n}\n","export enum BentoEvents {\n PURCHASE = '$purchase',\n SUBSCRIBE = '$subscribe',\n TAG = '$tag',\n REMOVE_TAG = '$remove_tag',\n UNSUBSCRIBE = '$unsubscribe',\n UPDATE_FIELDS = '$update_fields',\n}\n","import {\n BentoBatch,\n BentoClient,\n BentoCommands,\n BentoExperimental,\n BentoFields,\n BentoForms,\n BentoSubscribers,\n BentoTags,\n} from '../../sdk';\nimport { BentoEvents } from '../../sdk/batch/enums';\nimport type { AnalyticsOptions } from '../../sdk/interfaces';\nimport type {\n AddSubscriberParameters,\n RemoveSubscriberParameters,\n TagSubscriberParameters,\n TrackParameters,\n TrackPurchaseParameters,\n UpdateFieldsParameters,\n} from './types';\n\nexport class BentoAPIV1<\n S = { [key: string]: unknown },\n E extends string = '$custom'\n> {\n private readonly _client: BentoClient;\n\n public readonly Batch: BentoBatch<S, E>;\n public readonly Commands: BentoCommands<S>;\n public readonly Experimental: BentoExperimental;\n public readonly Fields: BentoFields;\n public readonly Forms: BentoForms;\n public readonly Subscribers: BentoSubscribers<S>;\n public readonly Tags: BentoTags;\n\n constructor(options: AnalyticsOptions) {\n this._client = new BentoClient(options);\n this.Batch = new BentoBatch(this._client);\n this.Commands = new BentoCommands(this._client);\n this.Experimental = new BentoExperimental(this._client);\n this.Fields = new BentoFields(this._client);\n this.Forms = new BentoForms(this._client);\n this.Subscribers = new BentoSubscribers(this._client);\n this.Tags = new BentoTags(this._client);\n }\n\n /**\n * **This TRIGGERS automations!** - If you do not wish to trigger automations, please use the\n * `Commands.addTag` method.\n *\n * Tags a subscriber with the specified email and tag. If either the tag or the user\n * do not exist, they will be created in the system. If the user already has the tag,\n * another tag event will be sent, triggering any automations that take place upon a\n * tag being added to a subscriber. Please be aware of the potential consequences.\n *\n * Because this method uses the batch API, the tag may take between 1 and 3 minutes\n * to appear in the system.\n *\n * Returns `true` if the event was successfully dispatched. Returns `false` otherwise.\n *\n * @param parameters TagSubscriberParameters\n * @returns Promise\\<boolean\\>\n */\n async tagSubscriber(parameters: TagSubscriberParameters): Promise<boolean> {\n const result = await this.Batch.importEvents({\n events: [\n {\n date: parameters.date,\n details: {\n tag: parameters.tagName,\n },\n email: parameters.email,\n type: BentoEvents.TAG,\n },\n ],\n });\n\n return result === 1;\n }\n\n /**\n * **This TRIGGERS automations!** - If you do not wish to trigger automations, please use the\n * `Commands.subscribe` method.\n *\n * Creates a subscriber in the system. If the subscriber already exists, another subscribe event\n * will be sent, triggering any automations that take place upon subscription. Please be aware\n * of the potential consequences.\n *\n * You may optionally pass any fields that you wish to be set on the subscriber during creation\n * as well as a `Date` which will backdate the event. If no date is supplied, then the event will\n * default to the current time.\n *\n * Because this method uses the batch API, the tag may take between 1 and 3 minutes\n * to appear in the system.\n *\n * Returns `true` if the event was successfully dispatched. Returns `false` otherwise.\n *\n * @param parameters AddSubscriberParameters\n * @returns Promise\\<boolean\\>\n */\n async addSubscriber(\n parameters: AddSubscriberParameters<S>\n ): Promise<boolean> {\n const result = await this.Batch.importEvents({\n events: [\n {\n date: parameters.date,\n email: parameters.email,\n type: BentoEvents.SUBSCRIBE,\n fields: parameters.fields || {},\n },\n ],\n });\n\n return result === 1;\n }\n\n /**\n * **This TRIGGERS automations!** - If you do not wish to trigger automations, please use the\n * `Commands.unsubscribe` method.\n *\n * Unsubscribes an email in the system. If the email is already unsubscribed, another unsubscribe event\n * will be sent, triggering any automations that take place upon an unsubscribe happening. Please be aware\n * of the potential consequences.\n *\n * You may optionally pass a `Date` which will backdate the event. If no date is supplied, then the event\n * will default to the current time.\n *\n * Because this method uses the batch API, the tag may take between 1 and 3 minutes\n * to appear in the system.\n *\n * Returns `true` if the event was successfully dispatched. Returns `false` otherwise.\n *\n * @param parameters RemoveSubscriberParameters\n * @returns Promise\\<boolean\\>\n */\n async removeSubscriber(\n parameters: RemoveSubscriberParameters\n ): Promise<boolean> {\n const result = await this.Batch.importEvents({\n events: [\n {\n date: parameters.date,\n email: parameters.email,\n type: BentoEvents.UNSUBSCRIBE,\n },\n ],\n });\n\n return result === 1;\n }\n\n /**\n * **This TRIGGERS automations!** - If you do not wish to trigger automations, please use the\n * `Commands.addField` method.\n *\n * Sets the passed-in custom fields on the subscriber, creating the subscriber if it does not exist.\n * If the fields are already set on the subscriber, the event will be sent, triggering any automations\n * that take place upon fields being updated. Please be aware of the potential consequences.\n *\n * You may optionally pass a `Date` which will backdate the event. If no date is supplied, then the event\n * will default to the current time.\n *\n * Because this method uses the batch API, the tag may take between 1 and 3 minutes\n * to appear in the system.\n *\n * Returns `true` if the event was successfully dispatched. Returns `false` otherwise.\n *\n * @param parameters UpdateFieldsParameters\\<S\\>\n * @returns Promise\\<boolean\\>\n */\n async updateFields(parameters: UpdateFieldsParameters<S>): Promise<boolean> {\n const result = await this.Batch.importEvents({\n events: [\n {\n date: parameters.date,\n email: parameters.email,\n type: BentoEvents.UPDATE_FIELDS,\n fields: parameters.fields,\n },\n ],\n });\n\n return result === 1;\n }\n\n /**\n * **This TRIGGERS automations!** - There is no way to achieve this same behavior without triggering\n * automations.\n *\n * Tracks a purchase in Bento, used to calculate LTV for your subscribers. The values that are received\n * should be numbers, in cents. For example, `$1.00` should be `100`.\n *\n * You may optionally pass a `Date` which will backdate the event. If no date is supplied, then the event\n * will default to the current time.\n *\n * Because this method uses the batch API, the tag may take between 1 and 3 minutes\n * to appear in the system.\n *\n * Returns `true` if the event was successfully dispatched. Returns `false` otherwise.\n *\n * @param parameters TrackPurchaseParameters\n * @returns Promise\\<boolean\\>\n */\n async trackPurchase(parameters: TrackPurchaseParameters): Promise<boolean> {\n const result = await this.Batch.importEvents({\n events: [\n {\n date: parameters.date,\n email: parameters.email,\n type: BentoEvents.PURCHASE,\n details: parameters.purchaseDetails,\n },\n ],\n });\n\n return result === 1;\n }\n\n /**\n * **This TRIGGERS automations!** - There is no way to achieve this same behavior without triggering\n * automations.\n *\n * Tracks a custom event in Bento.\n *\n * You may optionally pass a `Date` which will backdate the event. If no date is supplied, then the event\n * will default to the current time.\n *\n * Because this method uses the batch API, the tag may take between 1 and 3 minutes\n * to appear in the system.\n *\n * Returns `true` if the event was successfully dispatched. Returns `false` otherwise.\n *\n * @param parameters TrackParameters<S, E>\n * @returns Promise\\<boolean\\>\n */\n async track(parameters: TrackParameters<S, E>): Promise<boolean> {\n const result = await this.Batch.importEvents({\n events: [parameters],\n });\n\n return result === 1;\n }\n}\n","import type { AnalyticsOptions } from './sdk/interfaces';\nimport { BentoAPIV1 } from './versions/v1';\n\nexport class Analytics<S = { [key: string]: unknown }, E extends string = ''> {\n public readonly V1: BentoAPIV1<S, E>;\n\n constructor(options: AnalyticsOptions) {\n this.V1 = new BentoAPIV1(options);\n }\n}\n\nexport * from './sdk/client/errors';\n"],"names":["TooFewSubscribersError","_Error","message","_this","call","name","_inheritsLoose","_wrapNativeSuper","Error","TooManySubscribersError","_Error2","_this2","TooFewEventsError","_Error3","_this3","TooManyEventsError","_Error4","_this4","TooFewEmailsError","_Error5","_this5","TooManyEmailsError","_Error6","_this6","BentoBatch","_client","_maxEmailBatchSize","_maxBatchSize","_url","_proto","prototype","importSubscribers","_importSubscribers","_asyncToGenerator","_regeneratorRuntime","mark","_callee","parameters","result","wrap","_callee$","_context","prev","next","subscribers","length","post","sent","abrupt","results","stop","_x","apply","arguments","importEvents","_importEvents","_callee2","_callee2$","_context2","events","_x2","sendTransactionalEmails","_sendTransactionalEmails","_callee3","_callee3$","_context3","emails","_x3","NotAuthorizedError","RateLimitedError","BentoClient","options","_headers","_baseUrl","_siteUuid","_logErrors","_options$clientOption","clientOptions","baseUrl","siteUuid","_extractHeaders","authentication","logErrors","get","endpoint","payload","Promise","resolve","reject","queryParameters","_getQueryParameters","fetch","method","headers","then","_ref","_isSuccessfulStatus","status","json","_getErrorForResponse","data","error","body","_getBody","_extends","_ref2","authenticationKey","Buffer","from","publishableKey","secretKey","toString","Authorization","JSON","stringify","site_uuid","URLSearchParams","_i","_Object$entries","Object","entries","_Object$entries$_i","key","value","append","statusCode","validStatusCodes","includes","_getErrorForResponse2","response","contentType","responseMessage","console","t0","toLocaleLowerCase","text","t1","t2","CommandTypes","BentoCommands","addTag","_addTag","command","ADD_TAG","email","query","tagName","keys","removeTag","_removeTag","REMOVE_TAG","addField","_addField","ADD_FIELD","field","removeField","_removeField","_callee4","_callee4$","_context4","REMOVE_FIELD","fieldName","_x4","subscribe","_subscribe","_callee5","_callee5$","_context5","SUBSCRIBE","_x5","unsubscribe","_unsubscribe","_callee6","_callee6$","_context6","UNSUBSCRIBE","_x6","changeEmail","_changeEmail","_callee7","_callee7$","_context7","CHANGE_EMAIL","oldEmail","newEmail","_x7","BentoExperimental","validateEmail","_validateEmail","ip","user_agent","userAgent","valid","guessGender","_guessGender","geolocate","_geolocate","checkBlacklist","_checkBlacklist","BentoFields","getFields","_getFields","createField","_createField","BentoForms","getResponses","_getResponses","formIdentifier","id","BentoSubscribers","getSubscribers","_getSubscribers","createSubscriber","_createSubscriber","subscriber","BentoTags","getTags","_getTags","createTag","_createTag","tag","BentoEvents","BentoAPIV1","Batch","Commands","Experimental","Fields","Forms","Subscribers","Tags","tagSubscriber","_tagSubscriber","date","details","type","TAG","addSubscriber","_addSubscriber","fields","removeSubscriber","_removeSubscriber","updateFields","_updateFields","UPDATE_FIELDS","trackPurchase","_trackPurchase","PURCHASE","purchaseDetails","track","_track","Analytics","V1"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AA;;IC/OU4B,SAAS,GAGpB,SAAAA,UAAYnL,OAAyB;OAFrBoL,EAAE;EAGhB,IAAI,CAACA,EAAE,GAAG,IAAI7B,UAAU,CAACvJ,OAAO,CAAC;AACnC,CAAC;;;;"}
@@ -10,3 +10,9 @@ export declare class TooFewEventsError extends Error {
10
10
  export declare class TooManyEventsError extends Error {
11
11
  constructor(message?: string);
12
12
  }
13
+ export declare class TooFewEmailsError extends Error {
14
+ constructor(message?: string);
15
+ }
16
+ export declare class TooManyEmailsError extends Error {
17
+ constructor(message?: string);
18
+ }
@@ -1,5 +1,5 @@
1
1
  import type { BentoEvents } from './enums';
2
- export declare type PurchaseItem = {
2
+ export type PurchaseItem = {
3
3
  product_sku?: string;
4
4
  product_name?: string;
5
5
  quantity?: number;
@@ -8,11 +8,11 @@ export declare type PurchaseItem = {
8
8
  } & {
9
9
  [key: string]: string;
10
10
  };
11
- export declare type PurchaseCart = {
11
+ export type PurchaseCart = {
12
12
  abandoned_checkout_url?: string;
13
13
  items?: PurchaseItem[];
14
14
  };
15
- export declare type PurchaseDetails = {
15
+ export type PurchaseDetails = {
16
16
  unique: {
17
17
  key: string | number;
18
18
  };
@@ -22,19 +22,19 @@ export declare type PurchaseDetails = {
22
22
  };
23
23
  cart?: PurchaseCart;
24
24
  };
25
- export declare type PurchaseEvent = {
25
+ export type PurchaseEvent = {
26
26
  date?: Date;
27
27
  details: PurchaseDetails;
28
28
  email: string;
29
29
  type: BentoEvents.PURCHASE | '$purchase';
30
30
  };
31
- export declare type SubscribeEvent<S> = {
31
+ export type SubscribeEvent<S> = {
32
32
  date?: Date;
33
33
  email: string;
34
34
  fields?: Partial<S>;
35
35
  type: BentoEvents.SUBSCRIBE | '$subscribe';
36
36
  };
37
- export declare type TagEvent = {
37
+ export type TagEvent = {
38
38
  date?: Date;
39
39
  details: {
40
40
  tag: string;
@@ -42,7 +42,7 @@ export declare type TagEvent = {
42
42
  email: string;
43
43
  type: BentoEvents.TAG | '$tag';
44
44
  };
45
- export declare type TagRemoveEvent = {
45
+ export type TagRemoveEvent = {
46
46
  date?: Date;
47
47
  details: {
48
48
  tag: string;
@@ -50,22 +50,22 @@ export declare type TagRemoveEvent = {
50
50
  email: string;
51
51
  type: BentoEvents.REMOVE_TAG | '$remove_tag';
52
52
  };
53
- export declare type UnsubscribeEvent = {
53
+ export type UnsubscribeEvent = {
54
54
  date?: Date;
55
55
  email: string;
56
56
  type: BentoEvents.UNSUBSCRIBE | '$unsubscribe';
57
57
  };
58
- export declare type UpdateFieldsEvent<S> = {
58
+ export type UpdateFieldsEvent<S> = {
59
59
  date?: Date;
60
60
  email: string;
61
61
  type: BentoEvents.UPDATE_FIELDS | '$update_fields';
62
62
  fields: Partial<S>;
63
63
  };
64
- export declare type InternalEvents<S> = PurchaseEvent | SubscribeEvent<S> | TagEvent | TagRemoveEvent | UnsubscribeEvent | UpdateFieldsEvent<S>;
65
- export declare type BaseEvent<E extends string> = {
64
+ export type InternalEvents<S> = PurchaseEvent | SubscribeEvent<S> | TagEvent | TagRemoveEvent | UnsubscribeEvent | UpdateFieldsEvent<S>;
65
+ export type BaseEvent<E extends string> = {
66
66
  date?: Date;
67
67
  details?: Record<string, unknown>;
68
68
  email: string;
69
69
  type: `${E}${string}`;
70
70
  };
71
- export declare type BentoEvent<S, E extends string> = InternalEvents<S> | BaseEvent<E>;
71
+ export type BentoEvent<S, E extends string> = InternalEvents<S> | BaseEvent<E>;
@@ -1,7 +1,8 @@
1
1
  import type { BentoClient } from '../client';
2
- import type { BatchImportEventsParameter, BatchImportSubscribersParameter } from './types';
2
+ import type { BatchSendTransactionalEmailsParameter, BatchImportEventsParameter, BatchImportSubscribersParameter } from './types';
3
3
  export declare class BentoBatch<S, E extends string> {
4
4
  private readonly _client;
5
+ private readonly _maxEmailBatchSize;
5
6
  private readonly _maxBatchSize;
6
7
  private readonly _url;
7
8
  constructor(_client: BentoClient);
@@ -36,4 +37,19 @@ export declare class BentoBatch<S, E extends string> {
36
37
  * @returns Promise\<number\>
37
38
  */
38
39
  importEvents(parameters: BatchImportEventsParameter<S, E>): Promise<number>;
40
+ /**
41
+ * Creates a batch job to send transactional emails from Bento's infrastructure. You can pass in
42
+ * between 1 and 100 emails to send.
43
+ *
44
+ * Each email must have a `to` address, a `from` address, a `subject`, an `html_body`
45
+ * and `transactional: true`.
46
+ * In addition you can add a `personalizations` object to provide
47
+ * liquid tsags that will be injected into the email.
48
+ *
49
+ * Returns the number of events that were imported.
50
+ *
51
+ * @param parameters
52
+ * @returns Promise\<number\>
53
+ */
54
+ sendTransactionalEmails(parameters: BatchSendTransactionalEmailsParameter): Promise<number>;
39
55
  }
@@ -2,20 +2,36 @@ import type { BentoEvent } from './events';
2
2
  /**
3
3
  * Batch Method Parameter Types
4
4
  */
5
- export declare type BatchImportSubscribersParameter<S> = {
5
+ export type BatchImportSubscribersParameter<S> = {
6
6
  subscribers: ({
7
7
  email: string;
8
8
  } & Partial<S>)[];
9
9
  };
10
- export declare type BatchImportEventsParameter<S, E extends string> = {
10
+ export type BatchImportEventsParameter<S, E extends string> = {
11
11
  events: BentoEvent<S, E>[];
12
12
  };
13
+ export type TransactionalEmail = {
14
+ to: string;
15
+ from: string;
16
+ subject: string;
17
+ html_body: string;
18
+ transactional: boolean;
19
+ personalizations?: {
20
+ [key: string]: string | number | boolean;
21
+ };
22
+ };
23
+ export type BatchSendTransactionalEmailsParameter = {
24
+ emails: TransactionalEmail[];
25
+ };
13
26
  /**
14
27
  * Batch Method Response Types
15
28
  */
16
- export declare type BatchImportSubscribersResponse = {
29
+ export type BatchImportSubscribersResponse = {
30
+ results: number;
31
+ };
32
+ export type BatchImportEventsResponse = {
17
33
  results: number;
18
34
  };
19
- export declare type BatchImportEventsResponse = {
35
+ export type BatchsendTransactionalEmailsResponse = {
20
36
  results: number;
21
37
  };
@@ -1,3 +1,3 @@
1
- export declare type DataResponse<T> = {
1
+ export type DataResponse<T> = {
2
2
  data: T;
3
3
  };