epicenter-libs 3.34.0 → 3.34.2

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":"epicenter.js","sources":["../../node_modules/regenerator-runtime/runtime.js","../../node_modules/@babel/runtime/helpers/esm/typeof.js","../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","../../node_modules/cross-fetch/dist/browser-ponyfill.js","../../src/utils/error.ts","../../src/utils/fault.ts","../../src/utils/result.ts","../../src/utils/helpers.ts","../../src/utils/cookies.ts","../../src/utils/store.ts","../../src/utils/constants.ts","../../src/utils/config.ts","../../src/utils/identification.ts","../../src/utils/error-manager.ts","../../src/utils/router.ts","../../src/adapters/account.ts","../../src/adapters/admin.ts","../../src/utils/filter-parser.ts","../../src/adapters/project.ts","../../src/adapters/cometd.ts","../../src/adapters/authentication.ts","../../src/adapters/asset.ts","../../src/adapters/email.ts","../../src/adapters/episode.ts","../../src/adapters/group.ts","../../src/adapters/leaderboard.ts","../../src/adapters/presence.ts","../../src/adapters/recaptcha.ts","../../src/adapters/run.ts","../../src/adapters/user.ts","../../src/adapters/vault.ts","../../src/apis/video.ts","../../src/adapters/video.ts","../../src/apis/vonage.ts","../../src/adapters/vonage.ts","../../src/adapters/world.ts","../../src/adapters/time.ts","../../src/adapters/task.ts","../../src/adapters/chat.ts","../../src/adapters/consensus.ts","../../src/adapters/somebody.ts","../../src/adapters/matchmaker.ts","../../src/adapters/daily.ts","../../src/adapters/wallet.ts","../../src/adapters/channel.ts","../../src/utilities.ts","../../src/epicenter.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 defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; };\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 defineProperty(generator, \"_invoke\", { value: 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 defineProperty(Gp, \"constructor\", { value: GeneratorFunctionPrototype, configurable: true });\n defineProperty(\n GeneratorFunctionPrototype,\n \"constructor\",\n { value: GeneratorFunction, configurable: true }\n );\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 defineProperty(this, \"_invoke\", { value: 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 GeneratorResume behavior specified since ES2015:\n // ES2015 spec, step 3: https://262.ecma-international.org/6.0/#sec-generatorresume\n // Latest spec, step 2: https://tc39.es/ecma262/#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 methodName = context.method;\n var method = delegate.iterator[methodName];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method, or a missing .next method, always terminate the\n // yield* loop.\n context.delegate = null;\n\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (methodName === \"throw\" && 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 if (methodName !== \"return\") {\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a '\" + methodName + \"' 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(val) {\n var object = Object(val);\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 != null) {\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 throw new TypeError(typeof iterable + \" is not iterable\");\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","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };","// Save global object in a variable\nvar __global__ =\n(typeof globalThis !== 'undefined' && globalThis) ||\n(typeof self !== 'undefined' && self) ||\n(typeof global !== 'undefined' && global);\n// Create an object that extends from __global__ without the fetch function\nvar __globalThis__ = (function () {\nfunction F() {\nthis.fetch = false;\nthis.DOMException = __global__.DOMException\n}\nF.prototype = __global__; // Needed for feature detection on whatwg-fetch's code\nreturn new F();\n})();\n// Wraps whatwg-fetch with a function scope to hijack the global object\n// \"globalThis\" that's going to be patched\n(function(globalThis) {\n\nvar irrelevant = (function (exports) {\n\n /* eslint-disable no-prototype-builtins */\n var g =\n (typeof globalThis !== 'undefined' && globalThis) ||\n (typeof self !== 'undefined' && self) ||\n // eslint-disable-next-line no-undef\n (typeof global !== 'undefined' && global) ||\n {};\n\n var support = {\n searchParams: 'URLSearchParams' in g,\n iterable: 'Symbol' in g && 'iterator' in Symbol,\n blob:\n 'FileReader' in g &&\n 'Blob' in g &&\n (function() {\n try {\n new Blob();\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: 'FormData' in g,\n arrayBuffer: 'ArrayBuffer' in g\n };\n\n function isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n }\n\n if (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ];\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n };\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name);\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~!]/i.test(name) || name === '') {\n throw new TypeError('Invalid character in header field name: \"' + name + '\"')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value);\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {};\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value);\n }, this);\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n if (header.length != 2) {\n throw new TypeError('Headers constructor: expected name/value pair to be length 2, found' + header.length)\n }\n this.append(header[0], header[1]);\n }, this);\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name]);\n }, this);\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name);\n value = normalizeValue(value);\n var oldValue = this.map[name];\n this.map[name] = oldValue ? oldValue + ', ' + value : value;\n };\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)];\n };\n\n Headers.prototype.get = function(name) {\n name = normalizeName(name);\n return this.has(name) ? this.map[name] : null\n };\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n };\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value);\n };\n\n Headers.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this);\n }\n }\n };\n\n Headers.prototype.keys = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push(name);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.values = function() {\n var items = [];\n this.forEach(function(value) {\n items.push(value);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.entries = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push([name, value]);\n });\n return iteratorFor(items)\n };\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries;\n }\n\n function consumed(body) {\n if (body._noBody) return\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true;\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result);\n };\n reader.onerror = function() {\n reject(reader.error);\n };\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsArrayBuffer(blob);\n return promise\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n var match = /charset=([A-Za-z0-9_-]+)/.exec(blob.type);\n var encoding = match ? match[1] : 'utf-8';\n reader.readAsText(blob, encoding);\n return promise\n }\n\n function readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf);\n var chars = new Array(view.length);\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i]);\n }\n return chars.join('')\n }\n\n function bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength);\n view.set(new Uint8Array(buf));\n return view.buffer\n }\n }\n\n function Body() {\n this.bodyUsed = false;\n\n this._initBody = function(body) {\n /*\n fetch-mock wraps the Response object in an ES6 Proxy to\n provide useful test harness features such as flush. However, on\n ES5 browsers without fetch or Proxy support pollyfills must be used;\n the proxy-pollyfill is unable to proxy an attribute unless it exists\n on the object before the Proxy is created. This change ensures\n Response.bodyUsed exists on the instance, while maintaining the\n semantic of setting Request.bodyUsed in the constructor before\n _initBody is called.\n */\n // eslint-disable-next-line no-self-assign\n this.bodyUsed = this.bodyUsed;\n this._bodyInit = body;\n if (!body) {\n this._noBody = true;\n this._bodyText = '';\n } else if (typeof body === 'string') {\n this._bodyText = body;\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body;\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body;\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString();\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer);\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer]);\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body);\n } else {\n this._bodyText = body = Object.prototype.toString.call(body);\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8');\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type);\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');\n }\n }\n };\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n };\n }\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n var isConsumed = consumed(this);\n if (isConsumed) {\n return isConsumed\n } else if (ArrayBuffer.isView(this._bodyArrayBuffer)) {\n return Promise.resolve(\n this._bodyArrayBuffer.buffer.slice(\n this._bodyArrayBuffer.byteOffset,\n this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength\n )\n )\n } else {\n return Promise.resolve(this._bodyArrayBuffer)\n }\n } else if (support.blob) {\n return this.blob().then(readBlobAsArrayBuffer)\n } else {\n throw new Error('could not read as ArrayBuffer')\n }\n };\n\n this.text = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n };\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n };\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n };\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'];\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase();\n return methods.indexOf(upcased) > -1 ? upcased : method\n }\n\n function Request(input, options) {\n if (!(this instanceof Request)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.')\n }\n\n options = options || {};\n var body = options.body;\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url;\n this.credentials = input.credentials;\n if (!options.headers) {\n this.headers = new Headers(input.headers);\n }\n this.method = input.method;\n this.mode = input.mode;\n this.signal = input.signal;\n if (!body && input._bodyInit != null) {\n body = input._bodyInit;\n input.bodyUsed = true;\n }\n } else {\n this.url = String(input);\n }\n\n this.credentials = options.credentials || this.credentials || 'same-origin';\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers);\n }\n this.method = normalizeMethod(options.method || this.method || 'GET');\n this.mode = options.mode || this.mode || null;\n this.signal = options.signal || this.signal || (function () {\n if ('AbortController' in g) {\n var ctrl = new AbortController();\n return ctrl.signal;\n }\n }());\n this.referrer = null;\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body);\n\n if (this.method === 'GET' || this.method === 'HEAD') {\n if (options.cache === 'no-store' || options.cache === 'no-cache') {\n // Search for a '_' parameter in the query string\n var reParamSearch = /([?&])_=[^&]*/;\n if (reParamSearch.test(this.url)) {\n // If it already exists then set the value with the current time\n this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime());\n } else {\n // Otherwise add a new '_' parameter to the end with the current time\n var reQueryString = /\\?/;\n this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime();\n }\n }\n }\n }\n\n Request.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n };\n\n function decode(body) {\n var form = new FormData();\n body\n .trim()\n .split('&')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=');\n var name = split.shift().replace(/\\+/g, ' ');\n var value = split.join('=').replace(/\\+/g, ' ');\n form.append(decodeURIComponent(name), decodeURIComponent(value));\n }\n });\n return form\n }\n\n function parseHeaders(rawHeaders) {\n var headers = new Headers();\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ');\n // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill\n // https://github.com/github/fetch/issues/748\n // https://github.com/zloirock/core-js/issues/751\n preProcessedHeaders\n .split('\\r')\n .map(function(header) {\n return header.indexOf('\\n') === 0 ? header.substr(1, header.length) : header\n })\n .forEach(function(line) {\n var parts = line.split(':');\n var key = parts.shift().trim();\n if (key) {\n var value = parts.join(':').trim();\n try {\n headers.append(key, value);\n } catch (error) {\n console.warn('Response ' + error.message);\n }\n }\n });\n return headers\n }\n\n Body.call(Request.prototype);\n\n function Response(bodyInit, options) {\n if (!(this instanceof Response)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.')\n }\n if (!options) {\n options = {};\n }\n\n this.type = 'default';\n this.status = options.status === undefined ? 200 : options.status;\n if (this.status < 200 || this.status > 599) {\n throw new RangeError(\"Failed to construct 'Response': The status provided (0) is outside the range [200, 599].\")\n }\n this.ok = this.status >= 200 && this.status < 300;\n this.statusText = options.statusText === undefined ? '' : '' + options.statusText;\n this.headers = new Headers(options.headers);\n this.url = options.url || '';\n this._initBody(bodyInit);\n }\n\n Body.call(Response.prototype);\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n };\n\n Response.error = function() {\n var response = new Response(null, {status: 200, statusText: ''});\n response.ok = false;\n response.status = 0;\n response.type = 'error';\n return response\n };\n\n var redirectStatuses = [301, 302, 303, 307, 308];\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n };\n\n exports.DOMException = g.DOMException;\n try {\n new exports.DOMException();\n } catch (err) {\n exports.DOMException = function(message, name) {\n this.message = message;\n this.name = name;\n var error = Error(message);\n this.stack = error.stack;\n };\n exports.DOMException.prototype = Object.create(Error.prototype);\n exports.DOMException.prototype.constructor = exports.DOMException;\n }\n\n function fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init);\n\n if (request.signal && request.signal.aborted) {\n return reject(new exports.DOMException('Aborted', 'AbortError'))\n }\n\n var xhr = new XMLHttpRequest();\n\n function abortXhr() {\n xhr.abort();\n }\n\n xhr.onload = function() {\n var options = {\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n };\n // This check if specifically for when a user fetches a file locally from the file system\n // Only if the status is out of a normal range\n if (request.url.indexOf('file://') === 0 && (xhr.status < 200 || xhr.status > 599)) {\n options.status = 200;\n } else {\n options.status = xhr.status;\n }\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n setTimeout(function() {\n resolve(new Response(body, options));\n }, 0);\n };\n\n xhr.onerror = function() {\n setTimeout(function() {\n reject(new TypeError('Network request failed'));\n }, 0);\n };\n\n xhr.ontimeout = function() {\n setTimeout(function() {\n reject(new TypeError('Network request timed out'));\n }, 0);\n };\n\n xhr.onabort = function() {\n setTimeout(function() {\n reject(new exports.DOMException('Aborted', 'AbortError'));\n }, 0);\n };\n\n function fixUrl(url) {\n try {\n return url === '' && g.location.href ? g.location.href : url\n } catch (e) {\n return url\n }\n }\n\n xhr.open(request.method, fixUrl(request.url), true);\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true;\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false;\n }\n\n if ('responseType' in xhr) {\n if (support.blob) {\n xhr.responseType = 'blob';\n } else if (\n support.arrayBuffer\n ) {\n xhr.responseType = 'arraybuffer';\n }\n }\n\n if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers || (g.Headers && init.headers instanceof g.Headers))) {\n var names = [];\n Object.getOwnPropertyNames(init.headers).forEach(function(name) {\n names.push(normalizeName(name));\n xhr.setRequestHeader(name, normalizeValue(init.headers[name]));\n });\n request.headers.forEach(function(value, name) {\n if (names.indexOf(name) === -1) {\n xhr.setRequestHeader(name, value);\n }\n });\n } else {\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value);\n });\n }\n\n if (request.signal) {\n request.signal.addEventListener('abort', abortXhr);\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener('abort', abortXhr);\n }\n };\n }\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);\n })\n }\n\n fetch.polyfill = true;\n\n if (!g.fetch) {\n g.fetch = fetch;\n g.Headers = Headers;\n g.Request = Request;\n g.Response = Response;\n }\n\n exports.Headers = Headers;\n exports.Request = Request;\n exports.Response = Response;\n exports.fetch = fetch;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n return exports;\n\n})({});\n})(__globalThis__);\n// This is a ponyfill, so...\n__globalThis__.fetch.ponyfill = true;\ndelete __globalThis__.fetch.polyfill;\n// Choose between native implementation (__global__) or custom implementation (__globalThis__)\nvar ctx = __global__.fetch ? __global__ : __globalThis__;\nexports = ctx.fetch // To enable: import fetch from 'cross-fetch'\nexports.default = ctx.fetch // For TypeScript consumers without esModuleInterop.\nexports.fetch = ctx.fetch // To enable: import {fetch} from 'cross-fetch'\nexports.Headers = ctx.Headers\nexports.Request = ctx.Request\nexports.Response = ctx.Response\nmodule.exports = exports\n","\n/* Generic throwable error */\nexport default class EpicenterError extends Error {\n code?: string;\n constructor(message?: string, code?: string) {\n super(message);\n this.code = code;\n }\n}\n","import EpicenterError from './error';\n\nexport interface ErrorBody {\n status?: number;\n message: string;\n information?: {\n code: string;\n [key: string]: unknown;\n };\n cause?: unknown;\n code?: string;\n}\n\n\n/* For failed network calls */\nexport default class Fault extends EpicenterError {\n status?: number;\n information?: Record<string, unknown>;\n cause?: unknown;\n\n constructor(body: ErrorBody, response?: Response) {\n super(\n body.message,\n body.information?.code,\n );\n\n const { information, message, cause, status } = body;\n this.status = status ?? response?.status;\n this.message = message;\n\n if (information) {\n const { code, ...rest } = information;\n this.code = code;\n this.information = rest;\n }\n if (cause) {\n this.cause = cause;\n }\n }\n}\n","\n\n/* For network call responses */\nexport default class Result {\n status;\n headers;\n body;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(body: any, response: Response) {\n const { status, headers } = response;\n this.status = status;\n this.headers = headers;\n this.body = body;\n }\n}\n","/* eslint-disable no-new-func */\nexport const isBrowser = new Function('try {return this===window;}catch(e){ return false;}');\nexport const isNode = new Function('try {return (typeof process !== \"undefined\") && (typeof process.versions.node !== \"undefined\")}catch(e){return false;}');\n\n\nexport const last = (strOrArr: string | Array<unknown>): unknown => strOrArr[strOrArr.length - 1];\nexport const prefix = (pre: string, str: string): string => str.startsWith(pre) ? str : `${pre}${str}`;\n\n// Escape string for safe use in RegExp\nexport const escapeRegExp = (str: string): string => str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n","import { escapeRegExp } from './helpers';\n\ntype End = number | string | Date | undefined;\n\n// Modified version of https://github.com/madmurphy/cookies.js\nconst getExpiration = (vEnd: End) => {\n if (!vEnd) return '';\n switch (vEnd.constructor) {\n case Number: return vEnd === Infinity ? '; expires=Fri, 31 Dec 9999 23:59:59 GMT' : `; max-age=${vEnd}`;\n /*\n Note: Despite officially defined in RFC 6265, the use of `max-age` is not compatible with any\n version of Internet Explorer, Edge and some mobile browsers. Therefore passing a number to\n the end parameter might not work as expected. A possible solution might be to convert the the\n relative time to an absolute time. For instance, replacing the previous line with:\n */\n /*\n case Number: return vEnd === Infinity ? '; expires=Fri, 31 Dec 9999 23:59:59 GMT' : `; expires=${(new Date(vEnd * 1e3 + Date.now())).toUTCString()}`;\n */\n case String: return `; expires=${vEnd}`;\n case Date: return `; expires=${new Date(vEnd).toUTCString()}`;\n default: return '';\n }\n};\n\ninterface EditCookieOptions {\n path?: string;\n domain?: string;\n end?: End;\n secure?: boolean;\n samesite?: boolean;\n}\n\nexport default {\n getItem(key: string): null | string {\n if (!key) return null;\n return decodeURIComponent(document.cookie.replace(new RegExp(`(?:(?:^|.*;)\\\\s*${escapeRegExp(encodeURIComponent(key))}\\\\s*\\\\=\\\\s*([^;]*).*$)|^.*$`), '$1')) || null;\n },\n setItem(key: string, value: string | number | boolean, options: EditCookieOptions = {}): boolean {\n if (!key || (/^(?:expires|max-age|path|domain|secure)$/i).test(key)) return false;\n const { path, domain, end, secure, samesite } = options;\n const expireStr = getExpiration(end);\n const domainStr = domain ? `; domain=${domain}` : '';\n const pathStr = path ? `; path=${path}` : '';\n const secureStr = secure ? '; secure' : '';\n const samesiteStr = samesite ? `; samesite=${samesite}` : '';\n\n document.cookie = `${encodeURIComponent(key)}=${encodeURIComponent(value)}${expireStr}${domainStr}${pathStr}${secureStr}${samesiteStr}`;\n return true;\n },\n removeItem(key: string, options: EditCookieOptions = {}): boolean {\n if (!this.hasItem(key)) return false;\n const { path, domain } = options;\n const domainStr = domain ? `; domain=${domain}` : '';\n const pathStr = path ? `; path=${path}` : '';\n document.cookie = `${encodeURIComponent(key)}=; expires=Thu, 01 Jan 1970 00:00:00 GMT${domainStr}${pathStr}`;\n return true;\n },\n hasItem(key: string): boolean {\n if (!key || (/^(?:expires|max-age|path|domain|secure)$/i).test(key)) return false;\n\n return (new RegExp(`(?:^|;\\\\s*)${escapeRegExp(encodeURIComponent(key))}\\\\s*\\\\=`)).test(document.cookie);\n },\n clear(): string[] {\n // TODO: potentially replace this regex with simpler implementation\n // eslint-disable-next-line no-useless-backreference\n const aKeys = document.cookie.replace(/((?:^|\\s*;)[^=]+)(?=;|$)|^\\s*|\\s*(?:=[^;]*)?(?:\\1|$)/g, '').split(/\\s*(?:=[^;]*)?;\\s*/);\n for (let nLen = aKeys.length, nIdx = 0; nIdx < nLen; nIdx++) {\n aKeys[nIdx] = decodeURIComponent(aKeys[nIdx]);\n this.removeItem(aKeys[nIdx]);\n }\n return aKeys;\n },\n};\n","import cookies from './cookies';\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\ntype NodeMap = Record<any, any>;\ntype JavaScriptObject = Record<string, any>;\n/* eslint-enable @typescript-eslint/no-explicit-any */\n\ntype EpicenterStore = NodeMap | Storage;\n\n\nclass Store {\n _store: EpicenterStore;\n constructor(store: EpicenterStore) {\n this._store = store;\n }\n\n clear() {\n this._store.clear();\n }\n\n get store() {\n return this._store;\n }\n\n set store(store) {\n this._store = store;\n }\n}\n\nconst nodeMap = new Map();\nexport class NodeStore extends Store {\n constructor() {\n super(nodeMap);\n }\n\n getItem(key: string): NodeMap {\n return super.store.get(key);\n }\n\n setItem(key: string, value: JavaScriptObject): NodeMap {\n return super.store.set(key, value);\n }\n\n removeItem(key: string): boolean {\n return super.store.delete(key);\n }\n}\n\nexport class SessionStore extends Store {\n constructor() {\n super(window.sessionStorage);\n }\n\n getItem(key: string): JavaScriptObject | null {\n const item = super.store.getItem(key);\n return item ? JSON.parse(item) : null;\n }\n\n setItem(key: string, value: JavaScriptObject): void {\n return super.store.setItem(key, JSON.stringify(value));\n }\n\n removeItem(key: string): void {\n return super.store.removeItem(key);\n }\n}\n\nexport class CookieStore {\n options = {};\n constructor(options = {}) {\n const defaults = { path: '/' };\n this.options = { ...defaults, ...options };\n }\n\n getItem(key: string): JavaScriptObject | null {\n const item = cookies.getItem(key);\n return item ? JSON.parse(item) : null;\n }\n\n setItem(key: string, value: JavaScriptObject): boolean {\n return cookies.setItem(key, JSON.stringify(value), this.options);\n }\n\n removeItem(key: string): boolean {\n return cookies.removeItem(key, this.options);\n }\n\n clear(): string[] {\n return cookies.clear();\n }\n}\n","import type { FilterInput } from './filter-parser';\n\nexport enum BROWSER_STORAGE_TYPE {\n COOKIE = 'COOKIE',\n SESSION = 'SESSION',\n}\n\n\n/**\n * Scope boundaries are values associated with runs. They help to define the *default* user permissions used when a run is created, althought further permission configuration can be done with {@link #ROLE lock types}. Scopes also provide an index that in which a run can be queried for.\n *\n * Three parts -- boundary: level of hierarchy (ontology) that a piece of data belongs to. Specifically, a run, an asset, or a vault data\n * Boundary in which a piece of data (run, asset, vault) is ID-ed to (see scopeKey).\n *\n * pseudonymKey, goes in tandem w/ permit (lock types) --\n * Data lives and dies with scope, delete the scope, you lose the data and associated scopes\n * @enum {string}\n */\nexport enum SCOPE_BOUNDARY {\n /**\n * Runs scoped by project, users and facilitators are allowed access so long as they are a user in a group on the project.\n * @constant\n * @type {string}\n */\n PROJECT = 'PROJECT',\n /**\n * Runs scoped by group, users and facilitators are allowed access only if they are in the associated group\n * Groups are scoped by projects\n * @constant\n * @type {string}\n */\n GROUP = 'GROUP',\n /**\n * Runs scoped by episode, not sure what this one is permission-wise\n * Episodes are scoped by groups\n * @constant\n * @type {string}\n */\n EPISODE = 'EPISODE',\n /**\n * Runs scoped by world, users are only allowed access to the if they are assigned to the associated world. Facilitators need only to belong on the group that created the world\n * Worlds can be scoped by group or episode\n * @constant\n * @type {string}\n */\n WORLD = 'WORLD',\n}\n\n\n/**\n * Rituals are used to define the way in which the Epicenter stores a run while running actions like getting variables, saving meta data, and call model operations. Runs can exist in-memory for a certain amount of time before expiring, and requiring their revival again before use.\n * @enum {string}\n */\nexport enum RITUAL {\n /**\n * Allow GET action against archive, no revival of run\n * @constant\n * @type {string}\n */\n NONE = 'NONE',\n /**\n * Does not allow restore and will not access archived state (if down stay down)\n * @constant\n * @type {string}\n */\n INTER = 'INTER',\n /**\n * A run with this ritual will be pulled into memory as needed, and will stay in memory until it's lifespan (defined in your project Settings) has expired.\n * @constant\n * @type {string}\n */\n REANIMATE = 'REANIMATE',\n /**\n * Will always restore, and never access archived state\n * @constant\n * @type {string}\n */\n REVIVE = 'REVIVE',\n /**\n * A run with this ritual will be pulled into memory as needed, and removed from memory afterwards.\n * @constant\n * @type {string}\n */\n EXORCISE = 'EXORCISE',\n /**\n * Will always restore, and never access archived state, but will also terminate the run after issuing the command.\n * @constant\n * @type {string}\n */\n RESURRECT = 'RESURRECT',\n}\n\n\n/**\n * Push categories are pre-defined channels types in which one might use to receive push channel updates\n * @enum {string}\n */\nexport enum PUSH_CATEGORY {\n /**\n * intended for messaging users\n * yes pub\n * @constant\n * @type {string} */\n CHAT = 'CHAT',\n /**\n * Used for the {@link https://github.com/forio Consensus API}\n * no pub\n * @constant\n * @type {string} */\n CONSENSUS = 'CONSENSUS',\n /**\n * intended for general non-chat, sim-level communication\n * yes pub\n * @constant\n * @type {string} */\n CONTROL = 'CONTROL',\n /**\n * Used for the {@link https://github.com/forio Presence API}\n * no pub\n * @constant\n * @type {string} */\n PRESENCE = 'PRESENCE',\n /**\n * intended for awaiting entering games\n * yes pub\n * @constant\n * @type {string} */\n LOBBY = 'LOBBY',\n /**\n * Used for streaming data; bypasses ack extension\n * yes pub\n * @constant\n * @type {string} */\n STREAM = 'STREAM',\n /**\n * Used for the {@link https://github.com/forio Run API}\n * no pub\n * @constant\n * @type {string} */\n RUN = 'RUN',\n /**\n * Used for the {@link https://github.com/forio Vault API}\n * no pub\n * @constant\n * @type {string}\n */\n VAULT = 'VAULT',\n /**\n * Used for the {@link https://github.com/forio Video API}\n * no pub\n * @constant\n * @type {string}\n */\n VIDEO = 'VIDEO',\n /**\n * Used for the {@link https://github.com/forio World API}\n * no pub\n * @constant\n * @type {string}\n */\n WORLD = 'WORLD',\n /**\n * Used for the {@link https://github.com/forio Leaderboard API}\n * no pub\n * @constant\n * @type {string}\n */\n LEADERBOARD = 'LEADERBOARD',\n /**\n * For group related things; assignments, unassignments\n * @constant\n * @type {string}\n */\n GROUP = 'GROUP',\n /**\n * internal\n * @constant\n * @type {string} */\n SYSTEM = 'SYSTEM',\n}\n\nexport enum INTERNAL_ROLE {\n /**\n * System -- Epicenter Manager\n * @constant\n * @type {string}\n */\n SYSTEM = 'SYSTEM',\n /**\n * System minus -- read-only system access, write for certain accounts; think Geromel\n * @constant\n * @type {string}\n */\n MONITOR = 'MONITOR',\n /**\n * Author -- Team Members (and node server API keys)\n * tied to one account (personal + current account)\n * @constant\n * @type {string}\n */\n}\n\nexport enum ACCOUNT_ROLE {\n /**\n * Owner -- Full control over account\n * @constant\n * @type {string}\n */\n OWNER = 'OWNER',\n /**\n * Author -- Team Members (and node server API keys)\n * tied to one account (personal + current account)\n * @constant\n * @type {string}\n */\n AUTHOR = 'AUTHOR',\n /**\n * Author minus\n * @constant\n * @type {string}\n */\n SUPPORT = 'SUPPORT',\n /**\n * Associate -- Limited access to specific account\n * @constant\n * @type {string}\n */\n ASSOCIATE = 'ASSOCIATE',\n}\n\nexport enum PROJECT_ROLE {\n /**\n * Intended role for admin users who should only have access to a specific project\n * @constant\n * @type {string}\n */\n ASSOCIATE = 'ASSOCIATE',\n}\n\nexport enum GROUP_ROLE {\n /**\n * Facilitators\n * @constant\n * @type {string}\n */\n FACILITATOR = 'FACILITATOR',\n /**\n * Reviewers (weaker facilitator)\n * Facilitator minus\n * @constant\n * @type {string}\n */\n REVIEWER = 'REVIEWER',\n /**\n * Users -- psuedonymKey (userKey) required in scope\n * e.g., an avatar -- GROUP scope, PARTICIPANT read, USER write, userKey pseudonymKey\n * @constant\n * @type {string}\n */\n USER = 'USER',\n /**\n * Leader\n * Participant plus\n * @constant\n * @type {string}\n */\n LEADER = 'LEADER',\n /**\n * Participant\n * @constant\n * @type {string}\n */\n PARTICIPANT = 'PARTICIPANT',\n /**\n * Anonymous\n * @constant\n * @type {string}\n */\n ANONYMOUS = 'ANONYMOUS',\n}\n\n\n/**\n * Roles are used to define permissions on resources in Epicenter.\n * @enum {string}\n */\nexport enum ROLE {\n /**\n * System -- Epicenter Manager\n * @constant\n * @type {string}\n */\n SYSTEM = 'SYSTEM',\n /**\n * System minus -- read-only system access, write for certain accounts; think Geromel\n * @constant\n * @type {string}\n */\n MONITOR = 'MONITOR',\n /**\n * Owner -- Full control over account\n * @constant\n * @type {string}\n */\n OWNER = 'OWNER',\n /**\n * Author -- Team Members (and node server API keys)\n * tied to one account (personal + current account)\n * @constant\n * @type {string}\n */\n AUTHOR = 'AUTHOR',\n /**\n * Author minus\n * @constant\n * @type {string}\n */\n SUPPORT = 'SUPPORT',\n /**\n * Associate -- Limited access to specific account\n * @constant\n * @type {string}\n */\n ASSOCIATE = 'ASSOCIATE',\n /**\n * Facilitators\n * @constant\n * @type {string}\n */\n FACILITATOR = 'FACILITATOR',\n /**\n * Reviewers (weaker facilitator)\n * Facilitator minus\n * @constant\n * @type {string}\n */\n REVIEWER = 'REVIEWER',\n /**\n * Users -- pseudonymKey (userKey) required in scope\n * e.g., an avatar -- GROUP scope, PARTICIPANT read, USER write, userKey pseudonymKey\n * @constant\n * @type {string}\n */\n USER = 'USER',\n /**\n * Leader\n * Participant plus\n * @constant\n * @type {string}\n */\n LEADER = 'LEADER',\n /**\n * Participant\n * @constant\n * @type {string}\n */\n PARTICIPANT = 'PARTICIPANT',\n /**\n * Anonymous\n * @constant\n * @type {string}\n */\n ANONYMOUS = 'ANONYMOUS',\n}\n\n\n// /**\n// * Roles are used to define permissions on resources in Epicenter.\n// * @enum {string}\n// */\n// export const ROLE = {\n// ...INTERNAL_ROLE,\n// ...ACCOUNT_ROLE,\n// ...PROJECT_ROLE,\n// ...GROUP_ROLE,\n// };\n\n// export type ROLE = INTERNAL_ROLE | ACCOUNT_ROLE | PROJECT_ROLE | GROUP_ROLE;\n\n\nexport interface Permit {\n readLock: keyof typeof ROLE;\n writeLock: keyof typeof ROLE;\n}\n\nexport interface GenericScope {\n scopeBoundary: keyof typeof SCOPE_BOUNDARY;\n scopeKey: string;\n}\n\nexport interface Address {\n projectShortName: string;\n accountShortName: string;\n groupName: string;\n worldKey: string;\n episodeName: string;\n}\n\n\n/**\n * Generic search options for adapter methods. All adapter methods\n * will take `filter` and `sort` as a list of strings, and join with a \";\"\n *\n * Enhanced filter support allows:\n * - string[] (legacy): ['name=Mike', 'count<=3'] -> 'name=Mike;count<=3'\n * - string (raw): '(name=Mike;count<=3;[id=1;id=2])' -> passed through as-is\n * - FilterGroup (object): { type: 'and', filters: [...] } -> parsed to boolean syntax\n */\nexport interface GenericSearchOptions {\n filter?: FilterInput;\n sort?: string[];\n first?: number;\n max?: number;\n count?: boolean;\n}\n\n\n/**\n * The query parameters expected by the Epicenter APIs for\n * any kind of open search on a resource.\n */\nexport interface APISearchOptions {\n filter?: string;\n sort?: string;\n first?: number;\n max?: number;\n}\n","import EpicenterError from './error';\nimport { isBrowser, isNode } from './helpers';\n\n\nconst API_VERSION = 3;\nclass Config {\n _apiVersion = API_VERSION;\n _apiProtocol = '';\n _apiHost = '';\n _useProjectProxy = false;\n _accountShortName = '';\n _projectShortName = '';\n\n authOverride?: string;\n\n constructor() {\n if (isBrowser()) {\n this.loadBrowser();\n return;\n }\n if (isNode()) {\n this.loadNode();\n return;\n }\n throw new EpicenterError('Could not identify environment; no configuration was setup');\n }\n\n /**\n * Protocol used to make network requests (whether `http://` or `https://`).\n * It is typically set on-load based on your browser's URL. For local development,\n * this is defaulted to `https`, and can be overwritten if desired.\n * @memberof config\n * @type {string}\n * */\n get apiProtocol() {\n return this._apiProtocol;\n }\n\n set apiProtocol(apiProtocol) {\n if (!apiProtocol.startsWith('http')) return;\n if (apiProtocol.endsWith(':')) {\n apiProtocol = apiProtocol.slice(0, -1);\n }\n this._apiProtocol = apiProtocol;\n }\n\n /**\n * Hostname used to make network requests. It is typically set on-load based on\n * your browser's URL. For local development, this is defaulted to `forio.com`,\n * and can be overwritten if desired.\n * @memberof config\n * @type {string}\n * */\n get apiHost() {\n return this._apiHost;\n }\n\n set apiHost(apiHost) {\n this._apiHost = apiHost;\n }\n\n /**\n * If true, requests are routed to project proxy server.\n * The proxy server processes requests and forwards them to the Epicenter platform as appropriate,\n * usually with some modification. Can be used to grant heightened privileges to a request.\n * @memberof config\n * @type {boolean}\n */\n get useProjectProxy() {\n return this._useProjectProxy;\n }\n\n set useProjectProxy(useProjectProxy) {\n this._useProjectProxy = useProjectProxy;\n }\n\n /**\n * Version used to make network requests. This is read-only variable intended for internal use.\n * @memberof config\n * @type {number}\n */\n get apiVersion() {\n return this._apiVersion;\n }\n\n set apiVersion(_apiVersion) {\n return;\n }\n\n /**\n * Account name used for making network requests.\n * This is the default value used by Epicenter API adapters when making\n * network requests without explicitly defining an account to use.\n * It is defined on-load based on your browser's URL, and can be\n * overwritten for local development.\n * @example\n * // with browser URL: https://forio.com/app/acme-simulations/foobar-game\n *\n * console.log(config.accountShortName);\n * // should log 'acme-simulations'\n *\n * runAdapter.get(123);\n * // instantiates a GET call with the URL: https://forio.com/api/v3/acme-simulations/foobar-game/run/123\n *\n * config.accountShortName = 'globex-simuations';\n * runAdapter.get(123);\n * // now instantiates a GET with the URL: https://forio.com/api/v3/globex-simulations/foobar-game/run/123\n *\n * runAdapter.get(123, { accountShortName: 'initech-simulations' });\n * // now instantiates a GET with the URL: https://forio.com/api/v3/initech-simulations/foobar-game/run/123\n *\n * @memberof config\n * @type {string}\n */\n get accountShortName() {\n return this._accountShortName;\n }\n\n set accountShortName(accountShortName) {\n this._accountShortName = accountShortName;\n }\n\n /**\n * Project name used for making network requests.\n * This is the default value used by Epicenter API adapters when making\n * network requests without explicitly defining an account to use.\n * It is defined on-load based on your browser's URL, and can be\n * overwritten for local development.\n * @example\n * // with browser URL: https://forio.com/app/acme-simulations/foobar-game\n *\n * console.log(config.projectShortName);\n * // should log 'foobar-game'\n *\n * runAdapter.get(123);\n * // instantiates a GET call with the URL: https://forio.com/api/v3/acme-simulations/foobar-game/run/123\n *\n * config.projectShortName = 'barfoo-game';\n * runAdapter.get(123);\n * // now instantiates a GET with the URL: https://forio.com/api/v3/acme-simulations/barfoo-game/run/123\n *\n * runAdapter.get(123, { projectShortName: 'barbaz-game' });\n * // now instantiates a GET with the URL: https://forio.com/api/v3/acme-simulations/barbaz-game/run/123\n *\n * @memberof config\n * @type {string}\n */\n get projectShortName() {\n return this._projectShortName;\n }\n\n set projectShortName(projectShortName) {\n this._projectShortName = projectShortName;\n }\n\n /**\n * Use to determines whether or not the environment is local.\n * @memberof config\n * @return whether or not environment is local.\n */\n isLocal() {\n if (!isBrowser()) return false;\n const host = window.location.host;\n return host === '127.0.0.1' ||\n host.indexOf('local.') === 0 ||\n host.indexOf('ngrok') !== -1 ||\n host.indexOf('localhost') === 0;\n }\n\n loadNode() {\n this.apiProtocol = 'https';\n this.apiHost = 'forio.com';\n return;\n }\n\n loadBrowser() {\n const isLocal = this.isLocal();\n const { protocol, pathname, host } = window.location;\n this.apiProtocol = isLocal ? 'https' : protocol;\n this.apiHost = isLocal ? 'forio.com' : host;\n\n const match = pathname.match(/\\/app\\/([\\w-]+)\\/([\\w-]+)/);\n if (match) {\n const [account, project] = match.slice(1);\n this.accountShortName = account;\n this.projectShortName = project;\n }\n }\n\n setContext(context: {\n apiProtocol?: string;\n apiHost?: string;\n useProjectProxy?: boolean;\n accountShortName?: string;\n projectShortName?: string;\n }) {\n if (context.apiProtocol) this.apiProtocol = context.apiProtocol;\n if (context.apiHost) this.apiHost = context.apiHost;\n if (typeof context.useProjectProxy === 'boolean') this.useProjectProxy = context.useProjectProxy;\n if (context.accountShortName) this.accountShortName = context.accountShortName;\n if (context.projectShortName) this.projectShortName = context.projectShortName;\n }\n}\n\nconst config = new Config();\n/**\n * Configuration -- used to set up and configure global settings for Epicenter JS libs.\n * @namespace config\n */\nexport default config;\n","import EpicenterError from './error';\nimport cookies from './cookies';\nimport { NodeStore, SessionStore, CookieStore } from './store';\nimport { BROWSER_STORAGE_TYPE, ROLE, GROUP_ROLE } from './constants';\nimport { isNode } from './helpers';\nimport config from './config';\nconst { COOKIE, SESSION } = BROWSER_STORAGE_TYPE;\n\n/**\n * User session information returned from authentication endpoints.\n *\n * @remarks\n * Field dependencies:\n * - If `multipleGroups` is true, the user has access to multiple groups and\n * `projectShortName`, `projectKey`, `groupKey`, `groupName`, and `groupRole` will be undefined\n * - If `multipleGroups` is false or undefined, the user is scoped to a single group and\n * `projectShortName`, `projectKey`, `groupKey`, `groupName`, and `groupRole` should be present\n * - `groupKey` and `groupName` are present together (both or neither)\n * - `projectShortName` and `projectKey` are present together (both or neither)\n */\nexport interface UserSession {\n token: string;\n /** User identifier (actually the pseudonym key) */\n userKey: string;\n /**\n * Group identifier for the user's current group.\n * Present when user is scoped to a single group (multipleGroups is false/undefined).\n */\n groupKey?: string;\n /**\n * Name of the user's current group.\n * Present when user is scoped to a single group (multipleGroups is false/undefined).\n */\n groupName?: string;\n /**\n * User's role within their group (FACILITATOR, REVIEWER, LEADER, or PARTICIPANT).\n * Present when user is scoped to a single group (multipleGroups is false/undefined).\n */\n groupRole?: keyof typeof GROUP_ROLE;\n /**\n * Whether the user has access to multiple groups.\n * When true, group/project-specific fields will be undefined.\n */\n multipleGroups?: boolean;\n /**\n * Short name of the project.\n * Present when user is scoped to a single group (multipleGroups is false/undefined).\n */\n projectShortName?: string;\n /**\n * Unique identifier for the project.\n * Present when user is scoped to a single group (multipleGroups is false/undefined).\n */\n projectKey?: string;\n accountShortName: string;\n displayName: string;\n objectType: 'user';\n loginMethod: {\n objectType: string;\n };\n}\n\n/**\n * Admin session information returned from authentication endpoints.\n *\n * Admin sessions can have either:\n * - A global role (SYSTEM or MONITOR) for system-wide access\n * - Team-specific roles (teamAccountRole and/or teamProjectRole) for account/project access\n *\n * @remarks\n * Field dependencies:\n * - If `globalRole` is present, the admin has system-wide access\n * - If `teamAccountRole` is present, `teamAccountShortName` should also be present\n * - If `teamProjectRole` is present, `projectShortName` and `projectKey` should also be present\n * - Personal accounts: admins always have OWNER role for their personal account\n */\nexport interface AdminSession {\n adminHandle: string;\n adminKey: string;\n expires: boolean;\n multipleAccounts: boolean;\n objectType: 'admin';\n /**\n * Global system role (SYSTEM or MONITOR).\n * Present when admin has system-wide access.\n */\n globalRole?: ROLE.SYSTEM | ROLE.MONITOR;\n /**\n * Role within the team account (OWNER, AUTHOR, SUPPORT, or ASSOCIATE).\n * When present, teamAccountShortName should also be present.\n */\n teamAccountRole?: ROLE.OWNER | ROLE.AUTHOR | ROLE.SUPPORT | ROLE.ASSOCIATE;\n /**\n * Short name of the team account.\n * Present when teamAccountRole is set.\n */\n teamAccountShortName?: string;\n /**\n * Role within the specific project (AUTHOR or SUPPORT).\n * When present, projectShortName and projectKey should also be present.\n */\n teamProjectRole?: ROLE.AUTHOR | ROLE.SUPPORT;\n /**\n * Short name of the project.\n * Present when admin is scoped to a specific project.\n */\n projectShortName?: string;\n /**\n * Unique identifier for the project.\n * Present when admin is scoped to a specific project.\n */\n projectKey?: string;\n /**\n * Unique identifier for the group.\n * Present when admin is scoped to a specific group.\n */\n groupKey?: string;\n timeoutMinutes: number;\n token: string;\n}\n\nexport type Session = UserSession | AdminSession;\n\n\nconst SESSION_KEY = 'com.forio.epicenter.session';\nconst EPI_SSO_KEY = 'epicenter.v3.sso';\nclass Identification {\n type;\n\n constructor(storeType: keyof typeof BROWSER_STORAGE_TYPE) {\n if (storeType !== COOKIE && storeType !== SESSION) {\n throw new EpicenterError(`Invalid Storage Type: \"${String(storeType)}\", please use \"${String(COOKIE)}\" or \"${String(SESSION)}\".`);\n }\n this.type = storeType;\n this.consumeSSO();\n }\n\n get session() {\n const Store = this.getStore();\n return new Store().getItem(SESSION_KEY) as Session;\n }\n\n set session(session: Session | undefined) {\n const Store = this.getStore();\n const options = this.getStoreOptions(session);\n\n if (session) {\n new Store(options).setItem(SESSION_KEY, session as Session);\n } else if (this.session) {\n new Store(options).removeItem(SESSION_KEY);\n }\n }\n\n setSessionWithOptions(session: Session | undefined, forcePathInclusion?: boolean) {\n const Store = this.getStore();\n const options = this.getStoreOptions(session, forcePathInclusion);\n\n if (session) {\n new Store(options).setItem(SESSION_KEY, session as Session);\n } else if (this.session) {\n new Store(options).removeItem(SESSION_KEY);\n }\n }\n\n getStore() {\n if (isNode()) return NodeStore;\n switch (this.type) {\n case SESSION: return SessionStore;\n case COOKIE:\n default: return CookieStore;\n }\n }\n\n /* Generates the appropriate path for storing your session (applicable only to cookies) */\n getStoreOptions(session?: Session, forcePathInclusion?: boolean) {\n const mySession = session || this.session;\n if (!mySession || isNode()) return '';\n\n const { objectType } = mySession;\n const isLocal = config.isLocal();\n const base = { samesite: isLocal ? 'lax' : 'none', secure: !isLocal };\n const isCustomDomain = !isLocal && window.location.pathname.split('/')[1] !== 'app';\n const isEpicenterDomain = !isLocal && !isCustomDomain;\n\n /* forcePathInclusion can explicitly override behavior:\n * - true: force scoped path (even on custom domains)\n * - false: force root path (even for users/admins on Epicenter domain)\n * - undefined: use defaults (scoped for users and admins on Epicenter domain, root for custom domains) */\n if (forcePathInclusion === false) {\n return { ...base, path: '/' };\n }\n\n if (\n forcePathInclusion === true ||\n (isEpicenterDomain && (objectType === 'user' || objectType === 'admin'))\n ) {\n const { accountShortName, projectShortName } = config;\n const account = accountShortName ? `/${accountShortName}` : '';\n const project = account && projectShortName ? `/${projectShortName}` : '';\n return { ...base, path: `/app${account}${project}` };\n }\n\n /* Custom domains (when forcePathInclusion is not true) get the root path */\n return { ...base, path: '/' };\n }\n\n consumeSSO() {\n if (isNode()) return;\n\n // Occasionally, the backend might already wrap the cookie in quotes, have to handle\n // both cases, where we get string serialized content w/ quotes and without\n let cookieContent = cookies.getItem(EPI_SSO_KEY);\n if (\n typeof cookieContent === 'string' &&\n cookieContent.charAt(0) !== '\"' &&\n cookieContent.charAt(cookieContent.length - 1) !== '\"'\n ) {\n cookieContent = `\"${cookieContent}\"`;\n }\n\n /* Double parse here b/c the backend serializes it as a string; the first parse\n * converts it into a json string, the second parse converts the json string into\n * json. Yes, it's weird, no, we can't change it (unless we want to rewrite\n * Interface Builder code to accommodate) */\n const session = JSON.parse(JSON.parse(cookieContent ?? '\"null\"'));\n\n if (session) {\n const { accountShortName, projectShortName } = session;\n const account = accountShortName ? `/${accountShortName}` : '';\n const project = account && projectShortName ? `/${projectShortName}` : '';\n this.session = session;\n cookies.removeItem(EPI_SSO_KEY, { path: `/app${account}${project}` });\n }\n }\n}\n\nconst identification = new Identification(COOKIE);\nexport default identification;\n\n","import type { RetryFunction } from './router';\nimport Fault from './fault';\n\n\nexport type Identifier = (error: Fault) => boolean;\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport type HandleFunction = <T>(error: Fault, retry: RetryFunction<T>) => Promise<any>;\n/* eslint-enable @typescript-eslint/no-explicit-any */\n\nexport interface Handler {\n identifier: Identifier;\n handle: HandleFunction;\n unregister: () => void;\n}\n\nclass ErrorManager {\n _handlers: Handler[] = [];\n\n get handlers() {\n return this._handlers;\n }\n\n clearHandlers() {\n this._handlers = [];\n }\n\n registerHandler(\n identifier: Identifier,\n handleFn: HandleFunction,\n ) {\n const handler = {\n identifier,\n handle: handleFn,\n unregister: () => this.unregisterHandler(identifier),\n };\n this.handlers.unshift(handler);\n return handler;\n }\n\n unregisterHandler(identifier: Identifier) {\n const index = this.handlers.findIndex((handler) => handler.identifier === identifier);\n if (index > -1) this.handlers.splice(index, 1);\n }\n\n async handle<Output>(\n error: Fault,\n retryFn: RetryFunction<Output>,\n handlers?: Handler[],\n ): Promise<Output> {\n handlers = handlers || this.handlers;\n const index = handlers.findIndex(({ identifier }) => identifier(error));\n const handler = handlers[index];\n if (!handler) throw error;\n let promise;\n try {\n promise = await handler.handle(error, retryFn).catch((err) => {\n /* This catch call ensures that handle always returns a promise,\n otherwise it'd be caught in the catch block below */\n throw err;\n });\n } catch (e) {\n console.error('Handler failed due to error', e);\n const remainingHandlers = index > -1 ? [...handlers.slice(0, index), ...handlers.slice(index + 1)] : [];\n // Try to handle the new error with the remaining handlers, otherwise keep trying to handle the original error\n const handleableError = e instanceof Fault ? e : error;\n promise = await this.handle(handleableError, retryFn, remainingHandlers);\n }\n return promise;\n }\n}\n\nconst errorManager = new ErrorManager();\n/**\n * Configuration -- used to set up and configure global settings for Epicenter JS libs.\n * @namespace errorManager\n */\nexport default errorManager;\n","import fetch from 'cross-fetch';\nimport EpicenterError from './error';\nimport Fault from './fault';\nimport Result from './result';\nimport identification from './identification';\nimport errorManager from './error-manager';\nimport config from './config';\nimport { prefix, isBrowser } from './helpers';\n\n\ntype Version = number | undefined;\ntype Server = string | undefined;\ntype UseProjectProxy = boolean | undefined;\ntype AccountShortName = string | undefined;\ntype ProjectShortName = string | undefined;\ntype Authorization = string | undefined;\ntype QueryObject = Record<string, unknown>;\ntype SearchParams = string | string[][] | URLSearchParams | QueryObject;\n\nexport interface RoutingOptions {\n authorization?: Authorization;\n server?: Server;\n useProjectProxy?: UseProjectProxy;\n accountShortName?: AccountShortName;\n projectShortName?: ProjectShortName;\n query?: SearchParams;\n headers?: Record<string, string>;\n body?: unknown;\n includeAuthorization?: boolean;\n inert?: boolean | ((fault: Fault) => boolean);\n paginated?: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n parsePage?: (values: any[]) => any[];\n}\n\nexport interface RequestOptions extends RoutingOptions {\n method: string;\n}\n\nexport interface RetryFunction<Output> {\n (): Promise<Output>;\n requestArguments?: { url: URL } & RequestOptions;\n}\n\nexport interface Page<Item> {\n firstResult: number;\n maxResults: number;\n totalResults: number;\n values: Item[];\n prev: () => Promise<Item[]>;\n next: () => Promise<Item[]>;\n all: (first?: number, allValues?: Item[]) => Promise<Item[]>;\n}\n\nexport const MAX_URL_LENGTH = 2048;\nfunction paginate(json: Page<unknown>, url: URL, options: RequestOptions) {\n const parsePage = options.parsePage ?? (<T>(i: T) => i);\n const page = { ...json, values: parsePage(json.values) };\n const prev = async function() {\n const searchParams = new URLSearchParams(url.search);\n if (page.firstResult === 0) {\n console.warn('Pagination: cannot call \"prev\" on first page');\n return [];\n }\n\n const first = page.firstResult - page.maxResults;\n const max = page.maxResults + (first < 0 ? first : 0);\n\n searchParams.set('first', Math.max(first, 0).toString());\n searchParams.set('max', max.toString());\n url.search = searchParams.toString();\n // eslint-disable-next-line no-use-before-define\n const prevPage = await request(url, { ...options, paginated: false }).then(({ body }) => body);\n prevPage.values = parsePage(prevPage.values);\n Object.assign(page, prevPage);\n return page.values;\n };\n\n const next = async function() {\n const searchParams = new URLSearchParams(url.search);\n const first = page.firstResult + page.maxResults;\n if (first >= page.totalResults) {\n console.warn('Pagination: cannot call \"next\" on final page');\n return [];\n }\n\n searchParams.set('first', first.toString());\n url.search = searchParams.toString();\n // eslint-disable-next-line no-use-before-define\n const nextPage = await request(url, { ...options, paginated: false }).then(({ body }) => body);\n nextPage.values = parsePage(nextPage.values);\n Object.assign(page, nextPage);\n return page.values;\n };\n\n const initialTotal = json.totalResults;\n const all = async function(first = 0, allValues: unknown[] = []): Promise<unknown[]> {\n if (first >= initialTotal) return allValues;\n\n const searchParams = new URLSearchParams(url.search);\n searchParams.set('first', first.toString());\n searchParams.delete('max');\n url.search = searchParams.toString();\n // eslint-disable-next-line no-use-before-define\n const nextPage = await request(url, { ...options, paginated: false }).then(({ body }) => body);\n allValues.push(...parsePage(nextPage.values));\n return all(first + nextPage.maxResults, allValues);\n };\n\n page.prev = prev;\n page.next = next;\n page.all = all;\n return page;\n}\n\nconst parseQuery = (query: SearchParams) => {\n if (query.constructor === URLSearchParams) {\n return query;\n }\n\n /* 'query' should be either an array, or string. Objects will be coerced into [key, value] arrays */\n if (typeof query === 'object' && query.constructor === Object) {\n query = Object.entries(query).reduce((arr, [key, value]) => {\n if (Array.isArray(value)) {\n /* Special case for arrayed param values: use duplicated params here */\n return [...arr, ...value.map((v) => [key, v])];\n }\n if (value === undefined || value === null) {\n /* Skip nullish values */\n return arr;\n }\n arr.push([key, value.toString()]);\n return arr;\n }, [] as string[][]);\n }\n return new URLSearchParams(query as string | string[][] | URLSearchParams);\n};\n\n\ninterface Message {\n headers: HeadersInit;\n body: BodyInit | null;\n}\n\nconst createMessage = (\n headersRaw?: Record<string, string>,\n bodyRaw?: unknown,\n includeAuthorization?: boolean,\n authorization?: string,\n): Message => {\n const headers = Object.assign({}, headersRaw);\n let body = null;\n if (isBrowser() && bodyRaw instanceof FormData) {\n body = bodyRaw;\n } else if (bodyRaw) {\n headers['Content-type'] = 'application/json; charset=UTF-8';\n body = JSON.stringify(bodyRaw);\n }\n\n if (!includeAuthorization) {\n delete headers.Authorization;\n return { headers, body };\n }\n\n const { session } = identification;\n if (!headers.Authorization) { // \"headers\" option as primary everything\n if (session) headers.Authorization = `Bearer ${session.token}`; // session token should be default\n if (authorization) headers.Authorization = authorization; // Router option as tertiary override\n if (config.authOverride) headers.Authorization = config.authOverride; // config fallback as secondary override\n }\n return { headers, body };\n};\n\nconst NO_CONTENT = 204;\nconst BAD_REQUEST = 400;\nconst OK = 200;\nasync function request(\n url: URL,\n options: RequestOptions,\n): Promise<Result> {\n // Different browsers have different max URL lengths; we limit to 2048 as a safe\n // lower boundary to prevent truncation that might not be apparent to the user.\n // This can occur in particular with GET requests with large query strings.\n if (url.href.length > MAX_URL_LENGTH) {\n throw new EpicenterError(`URL length exceeds maximum of ${MAX_URL_LENGTH} characters: ${url.href.length} characters.`);\n }\n\n const {\n method,\n headers,\n body,\n includeAuthorization,\n inert,\n paginated,\n authorization,\n } = options;\n\n const message = createMessage(\n headers,\n body,\n includeAuthorization,\n authorization,\n );\n\n const response = await fetch(url.toString(), {\n method,\n cache: 'no-cache',\n redirect: 'follow',\n headers: message.headers,\n body: message.body,\n });\n\n if (response.status === NO_CONTENT) {\n return new Result(undefined, response);\n }\n\n const resContentType = response.headers.get('content-type');\n if (!resContentType || !resContentType.includes('application/json')) {\n throw new EpicenterError(`Response content-type '${resContentType}' does not include 'application/json' and my url is ${url.toString()}, ${method}`);\n }\n\n const json = await response.json();\n if ((response.status >= OK) && (response.status < BAD_REQUEST)) {\n const result = new Result(\n paginated ? paginate(json, url, options) : json,\n response,\n );\n return result;\n }\n\n const fault = new Fault(json, response);\n if (inert === true) throw fault;\n if (typeof inert === 'function' && inert(fault)) throw fault;\n\n const retryOptions = { ...options, inert: true };\n const retry = () => request(url, retryOptions);\n retry.requestArguments = {\n url,\n ...retryOptions,\n };\n return errorManager.handle<Result>(fault, retry);\n}\n\n\n/**\n * Used to make the network calls in all API adapters\n */\nexport default class Router {\n _version: Version = undefined;\n _server: Server = undefined;\n _useProjectProxy: UseProjectProxy = undefined;\n _accountShortName: AccountShortName = undefined;\n _projectShortName: ProjectShortName = undefined;\n _authorization: Authorization = undefined;\n _searchParams = new URLSearchParams();\n\n /**\n * The version of the Epicenter APIs being invoked; expected to stay at `3`\n */\n get version(): Version {\n return this._version;\n }\n\n set version(value: Version) {\n this._version = value;\n }\n\n /**\n * The root path used for the call, essentially protocol + hostname\n * @type {string}\n */\n get server(): Server {\n return this._server;\n }\n\n set server(value: Server) {\n this._server = value;\n }\n\n /**\n * If true, requests are routed to project proxy server.\n * The proxy server processes requests and forwards them to the Epicenter platform as appropriate,\n * usually with some modification. Can be used to grant heightened privileges to a request.\n *\n * If true, prefixes all request pathnames with `proxy/${accountShortName}/${projectShortName}/`.\n * @type {boolean}\n */\n get useProjectProxy(): UseProjectProxy {\n return this._useProjectProxy;\n }\n\n set useProjectProxy(value: UseProjectProxy) {\n this._useProjectProxy = value;\n }\n\n /**\n * Name of the account; for administrative use, this value should be set to 'epicenter'\n * @type {string}\n */\n get accountShortName(): AccountShortName {\n return this._accountShortName;\n }\n\n set accountShortName(value: AccountShortName) {\n this._accountShortName = value;\n }\n\n /**\n * Name of the project; for administrative use, this value should be set to 'manager'\n * @type {string}\n */\n get projectShortName(): ProjectShortName {\n return this._projectShortName;\n }\n\n set projectShortName(value: ProjectShortName) {\n this._projectShortName = value;\n }\n\n /**\n * Auth header; looks like `Bearer TOKEN` or `Basic TOKEN`\n * @type {string}\n */\n get authorization(): Authorization {\n return this._authorization;\n }\n\n set authorization(value: Authorization) {\n this._authorization = value;\n }\n\n /**\n * The search parameters for to use when making a network request. This property has should always return an instance of URLSearchParams or undefined. It has unique properties when used with the assignment operator (`=`); see the examples below for more details.\n * @type {URLSearchParams}\n *\n * @example\n * const router = new Router();\n * router.searchParams = '?foo=123';\n * console.log(router.searchParams); // always returns an instance object: URLSearchParams {}\n * console.log(router.searchParams.toString()); // logs 'foo=123'\n *\n * router.searchParams = 'foo=123'; // can omit the question mark\n * console.log(router.searchParams.toString()); // logs 'foo=123'\n *\n * router.searchParams = [['foo', '123'], ['bar', '456']]; // can accept arrays\n * console.log(router.searchParams.toString()); // logs 'foo=123&bar=456'\n *\n * router.searchParams = { foo: '123', bar: '456' }; // can accept objects\n * console.log(router.searchParams.toString()); // logs 'foo=123&bar=456'\n *\n * router.searchParams = { foo: '123', bar: ['4', '5', '6'] }; // can accept objects with arrayed values\n * console.log(router.searchParams.toString()); // logs 'foo=123&bar=4&bar=5&bar=6'\n *\n * router.searchParams = new URLSearchParams('foo=123'); // can accept instances of URLSearchParams\n * console.log(router.searchParams.toString()); // logs 'foo=123'\n *\n * @param {object|array|string|URLSearchParams} query Value used to set the search parameters\n */\n get searchParams(): SearchParams {\n return this._searchParams;\n }\n\n set searchParams(query: SearchParams) {\n this._searchParams = parseQuery(query);\n }\n\n /**\n * Sets the version. Does nothing if invoked with no input. This is a part of a series of convenience functions for chaining sets on values.\n * @param {string} [version] Version to use\n * @returns {Router} The Router instance\n */\n withVersion(version?: Version): Router {\n if (typeof version !== 'undefined') this.version = version;\n return this;\n }\n\n /**\n * Sets the root path. Does nothing if invoked with no input. This is a part of a series of convenience functions for chaining sets on values.\n * @param {string} [server] Root path to use\n * @returns {Router} The Router instance\n */\n withServer(server?: Server): Router {\n if (typeof server !== 'undefined') this.server = server;\n return this;\n }\n\n /**\n * Sets whether to route requests to project proxy server. Does nothing if invoked with no input. This is a part of a series of convenience functions for chaining sets on values.\n * @param {string} [useProjectProxy] Whether to use the proxy server\n * @returns {Router} The Router instance\n */\n withProjectProxy(useProjectProxy: UseProjectProxy): Router {\n if (typeof useProjectProxy !== 'undefined') this.useProjectProxy = useProjectProxy;\n return this;\n }\n\n /**\n * Sets the account. Does nothing if invoked with no input. This is a part of a series of convenience functions for chaining sets on values.\n * @param {string} [accountShortName] Account name to use\n * @returns {Router} The Router instance\n */\n withAccountShortName(accountShortName?: AccountShortName): Router {\n if (typeof accountShortName !== 'undefined') this.accountShortName = accountShortName;\n return this;\n }\n\n /**\n * Sets the project. Does nothing if invoked with no input. This is a part of a series of convenience functions for chaining sets on values.\n * @param {string} [projectShortName] Project name to use\n * @returns {Router} The Router instance\n */\n withProjectShortName(projectShortName?: ProjectShortName): Router {\n if (typeof projectShortName !== 'undefined') this.projectShortName = projectShortName;\n return this;\n }\n\n /**\n * Sets the project. Does nothing if invoked with no input. This is a part of a series of convenience functions for chaining sets on values.\n * @param {string} [projectShortName] Project name to use\n * @returns {Router} The Router instance\n */\n withAuthorization(authorization?: Authorization): Router {\n if (typeof authorization !== 'undefined') this.authorization = authorization;\n return this;\n }\n\n /**\n * Sets the search parameters. Does nothing if invoked with no input. This is a part of a series of convenience functions for chaining sets on values.\n * @param {string|array|object|URLSearchParams} [searchParams] Search parameters to use, utilizes the same setter as [searchParams](#Router-searchParams)\n * @returns {Router} The Router instance\n */\n withSearchParams(searchParams?: SearchParams): Router {\n if (typeof searchParams !== 'undefined') this.searchParams = searchParams;\n return this;\n }\n\n /**\n * Creates the URL that would be used for a network request. Should prioritize any overrides provided to it, falling back to any values set local to the Router instance, falling back to values set in the config\n * @param uriComponent The URI component used to generate the URL object\n * @param [overrides] Overrides for generating the URL object\n * @param [overrides.server] Override for the root URL string -- composed of the protocol and the hostname; e.g., https://forio.com\n * @param [overrides.useProjectProxy] Override for routing requests to the project proxy server\n * @param [overrides.accountShortName] Override for the account short name\n * @param [overrides.projectShortName] Override for the project short name\n * @param [overrides.version] Override for the version (NIU, is set by the config)\n * @param [overrides.query] Override for the URL search query\n * @returns URL object\n */\n getURL(\n uriComponent: string,\n overrides: {\n server?: string;\n useProjectProxy?: boolean;\n accountShortName?: string;\n projectShortName?: string;\n version?: number;\n query?: SearchParams;\n } = {},\n ): URL {\n const server = overrides.server ?? this.server ?? `${config.apiProtocol}://${config.apiHost}`;\n const useProjectProxy = overrides.useProjectProxy ?? this.useProjectProxy ?? config.useProjectProxy;\n const accountShortName = overrides.accountShortName ?? this.accountShortName ?? config.accountShortName;\n const projectShortName = overrides.projectShortName ?? this.projectShortName ?? config.projectShortName;\n const version = overrides?.version ?? this.version ?? config.apiVersion;\n\n const url = new URL(`${server}`);\n\n const proxyPathComponent = useProjectProxy ? `proxy/${accountShortName}/${projectShortName}/` : '';\n const commonPathComponent = `api/v${version}/${accountShortName}/${projectShortName}`;\n const uniquePathComponent = prefix('/', uriComponent);\n\n url.pathname = `${proxyPathComponent}${commonPathComponent}${uniquePathComponent}`;\n\n url.search = overrides.query !== undefined ?\n parseQuery(overrides.query).toString() :\n (this.searchParams ?? new URLSearchParams()).toString();\n return url;\n }\n\n // Network Requests\n async get(uriComponent: string, options: RoutingOptions = {}): Promise<Result> {\n const {\n accountShortName,\n projectShortName,\n authorization,\n server,\n query,\n useProjectProxy,\n headers,\n includeAuthorization,\n inert,\n paginated,\n parsePage,\n } = options;\n\n const url = this.getURL(uriComponent, {\n server,\n query,\n accountShortName,\n projectShortName,\n useProjectProxy,\n });\n\n return request(url, {\n method: 'GET',\n headers,\n includeAuthorization: includeAuthorization ?? true,\n authorization: authorization ?? this.authorization,\n inert,\n paginated,\n parsePage,\n });\n }\n\n async delete(uriComponent: string, options: RoutingOptions = {}): Promise<Result> {\n const {\n accountShortName,\n projectShortName,\n authorization,\n server,\n query,\n useProjectProxy,\n headers,\n includeAuthorization,\n inert,\n } = options;\n\n const url = this.getURL(uriComponent, {\n server,\n query,\n accountShortName,\n projectShortName,\n useProjectProxy,\n });\n\n return request(url, {\n method: 'DELETE',\n headers,\n includeAuthorization: includeAuthorization ?? true,\n authorization: authorization ?? this.authorization,\n inert,\n });\n }\n\n async patch(uriComponent: string, options: RoutingOptions = {}): Promise<Result> {\n const {\n accountShortName,\n projectShortName,\n authorization,\n server,\n query,\n useProjectProxy,\n headers,\n body,\n includeAuthorization,\n inert,\n } = options;\n\n const url = this.getURL(uriComponent, {\n server,\n query,\n accountShortName,\n projectShortName,\n useProjectProxy,\n });\n\n return request(url, {\n method: 'PATCH',\n headers,\n body,\n includeAuthorization: includeAuthorization ?? true,\n authorization: authorization ?? this.authorization,\n inert,\n });\n }\n\n async post(uriComponent: string, options: RoutingOptions = {}): Promise<Result> {\n const {\n accountShortName,\n projectShortName,\n authorization,\n server,\n query,\n useProjectProxy,\n headers,\n body,\n includeAuthorization,\n inert,\n } = options;\n\n const url = this.getURL(uriComponent, {\n server,\n query,\n accountShortName,\n projectShortName,\n useProjectProxy,\n });\n\n return request(url, {\n method: 'POST',\n headers,\n body,\n includeAuthorization: includeAuthorization ?? true,\n authorization: authorization ?? this.authorization,\n inert,\n });\n }\n\n async put(uriComponent: string, options: RoutingOptions = {}): Promise<Result> {\n const {\n accountShortName,\n projectShortName,\n authorization,\n server,\n query,\n useProjectProxy,\n headers,\n body,\n includeAuthorization,\n inert,\n } = options;\n\n const url = this.getURL(uriComponent, {\n server,\n query,\n accountShortName,\n projectShortName,\n useProjectProxy,\n });\n\n return request(url, {\n method: 'PUT',\n headers,\n body,\n includeAuthorization: includeAuthorization ?? true,\n authorization: authorization ?? this.authorization,\n inert,\n });\n }\n}\n","import type { RoutingOptions } from '../utils/router';\nimport type { Admin } from './admin';\nimport type { Project } from './project';\n\nimport Router from '../utils/router';\n\ntype WorkerPartition = 'NONE' | 'ALL' | 'DEVELOPMENT' | 'FREE' | 'LICENSED' | 'ACCOUNT';\n\nexport interface SecretStrategyCreateInView {\n difficulty?: string;\n encryption?: string;\n expirationDays?: number;\n reuseHorizon?: number;\n}\n\nexport interface DisplayNameStrategyCreateInView {\n displayNameGenerator: string;\n clearOnDeletion: boolean;\n}\n\nexport interface RetentionPreferenceCreateInView {\n inactiveUserRetentionDays?: number;\n dataRetentionDays?: number;\n}\n\nexport interface MultiFactorStrategyCreateInView {\n expirationDays: number;\n adminMultiFactorRequirement: string;\n userMultiFactorRequirement: string;\n}\n\nexport interface SecretCreateInView {\n password?: string;\n}\n\nexport interface AccountSettingCreateInView {\n allowProjectScopedModels?: boolean;\n concurrentRunLimit?: number;\n authenticatedProjectLimit?: number;\n maximumUsers?: number;\n allowMultiPlayer?: boolean;\n}\n\nexport interface BillingInformationCreateInView {\n subscriptionPlan?: string;\n subscriptionExpiration?: string;\n billingInterval?: string;\n}\n\nexport interface AccountLegacySettingsCreateInView {\n authorizationMode?: string;\n}\n\nexport interface LockoutLimitsCreateInView {\n blackoutMinutes: number;\n adminAttempts: number;\n userAttempts: number;\n}\n\nexport interface PersonalAccountCreateInView {\n objectType: 'personal';\n shortName: string;\n adminKey: string;\n name: string;\n workerPartition?: WorkerPartition;\n active?: boolean;\n sharedSecret?: string;\n}\n\nexport interface TeamAccountCreateInView {\n objectType: 'team';\n shortName: string;\n adminKey: string;\n name: string;\n secretStrategy?: SecretStrategyCreateInView;\n displayNameStrategy?: DisplayNameStrategyCreateInView;\n allowDeletion?: boolean;\n retentionPreference?: RetentionPreferenceCreateInView;\n multiFactorStrategy?: MultiFactorStrategyCreateInView;\n active?: boolean;\n apiSecret?: SecretCreateInView;\n accountSetting?: AccountSettingCreateInView;\n billingInformation?: BillingInformationCreateInView;\n legacySettings?: AccountLegacySettingsCreateInView;\n workerPartition?: WorkerPartition;\n allowStrongFacilitators?: boolean;\n sharedSecret?: string;\n allowAmbiguousHandles?: boolean;\n lockoutLimits?: LockoutLimitsCreateInView;\n}\n\nexport interface SecretStrategyReadOutView {\n difficulty?: string;\n encryption?: string;\n expirationDays?: number;\n reuseHorizon?: number;\n}\n\nexport interface DisplayNameStrategyReadOutView {\n displayNameGenerator?: string;\n clearOnDeletion?: boolean;\n}\n\nexport interface RetentionPreferenceReadOutView {\n inactiveUserRetentionDays?: number;\n dataRetentionDays?: number;\n}\n\nexport interface BillingInformationReadOutView {\n subscriptionPlan?: string;\n subscriptionExpiration?: string;\n billingInterval?: string;\n}\n\nexport interface MultiFactorStrategyReadOutView {\n expirationDays?: number;\n adminMultiFactorRequirement?: string;\n userMultiFactorRequirement?: string;\n}\n\nexport interface AccountLegacySettingsReadOutView {\n authorizationMode?: string;\n}\n\nexport interface AccountSettingReadOutView {\n allowProjectScopedModels?: boolean;\n concurrentRunLimit?: number;\n authenticatedProjectLimit?: number;\n maximumUsers?: number;\n allowMultiPlayer?: boolean;\n}\n\nexport interface AccountPermissionReadOutView {\n objectType: 'account';\n role?: string;\n handle?: string;\n adminKey?: string;\n}\n\nexport interface LogoReadOutView {\n imageType?: 'PNG' | 'JPG' | 'SVG';\n}\n\nexport interface LockoutLimitsReadOutView {\n adminAttempts?: number;\n userAttempts?: number;\n blackoutMinutes?: number;\n}\n\nexport interface PersonalAccountReadOutView {\n objectType: 'personal';\n shortName?: string;\n name?: string;\n workerPartition?: WorkerPartition;\n active?: boolean;\n admin?: Admin;\n projects?: Project[];\n tombstone?: string;\n created?: string;\n lastUpdated?: string;\n}\n\nexport interface TeamAccountReadOutView {\n objectType: 'team';\n shortName?: string;\n name?: string;\n workerPartition?: WorkerPartition;\n secretStrategy?: SecretStrategyReadOutView;\n displayNameStrategy?: DisplayNameStrategyReadOutView;\n allowDeletion?: boolean;\n retentionPreference?: RetentionPreferenceReadOutView;\n multiFactorStrategy?: MultiFactorStrategyReadOutView;\n active?: boolean;\n accountSetting?: AccountSettingReadOutView;\n billingInformation?: BillingInformationReadOutView;\n legacySettings?: AccountLegacySettingsReadOutView;\n allowStrongFacilitators?: boolean;\n allowAmbiguousHandles?: boolean;\n lockoutLimits?: LockoutLimitsReadOutView;\n members?: AccountPermissionReadOutView[];\n logo?: LogoReadOutView;\n projects?: Project[];\n tombstone?: string;\n created?: string;\n lastUpdated?: string;\n}\n\nexport type AccountReadOutView = PersonalAccountReadOutView | TeamAccountReadOutView;\n\nexport interface PersonalAccountUpdateInView {\n objectType: 'personal';\n name?: string;\n workerPartition?: WorkerPartition;\n active?: boolean;\n}\n\nexport interface TeamAccountUpdateInView {\n objectType: 'team';\n name?: string;\n workerPartition?: WorkerPartition;\n active?: boolean;\n billingInterval?: string;\n}\n\n\n/**\n * Retrieves account information by account short name\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/account`\n *\n * @example\n * import { accountAdapter } from 'epicenter-libs';\n * const account = await accountAdapter.getAccount('acme');\n *\n * @param accountShortName The short name of the account to retrieve\n * @returns promise that resolves to the account information\n */\nexport async function getAccount(accountShortName: string): Promise<AccountReadOutView> {\n return await new Router()\n .withAccountShortName(accountShortName)\n .get('/account')\n .then(({ body }) => body);\n}\n\n\n/**\n * Creates a new personal or team account\n * Base URL: POST `https://forio.com/api/v3/epicenter/manager/account`\n *\n * @example\n * import { accountAdapter } from 'epicenter-libs';\n * // Create a personal account\n * const personalAccount = await accountAdapter.createAccount({\n * objectType: 'personal',\n * adminKey: 'admin-key',\n * name: 'John Doe',\n * shortName: 'johndoe',\n * });\n * // Create a team account with billing\n * const teamAccount = await accountAdapter.createAccount({\n * objectType: 'team',\n * adminKey: 'admin-key',\n * name: 'Acme Corp',\n * shortName: 'acme',\n * billingInformation: {\n * billingInterval: 'monthly',\n * subscriptionPlan: 'standard',\n * },\n * });\n *\n * @param view Account creation information\n * @param view.objectType Account type; either 'personal' or 'team'\n * @param view.shortName Unique short name for account, used as part of URL\n * @param view.adminKey Admin key for the account\n * @param view.name Descriptive name of account\n * @param [view.workerPartition] Defines location of model execution\n * @param [view.active] Determines if the account can be used\n * @param [view.sharedSecret] Optional shared secret for the account\n * @param [view.secretStrategy] Configuration related to account secrets (team only)\n * @param [view.displayNameStrategy] Configuration related to user displayName (team only)\n * @param [view.allowDeletion] Determines if this account can be deleted (team only)\n * @param [view.retentionPreference] Configuration related to data, user, group retention preferences (team only)\n * @param [view.multiFactorStrategy] Configuration related to multifactor authentication (team only)\n * @param [view.apiSecret] Configuration related to API secret keys (team only)\n * @param [view.accountSetting] Configuration related to account usage limits and capabilities (team only)\n * @param [view.billingInformation] Subscription and billing configuration (team only)\n * @param [view.legacySettings] API settings used for compatibility with legacy accounts (team only)\n * @param [view.allowStrongFacilitators] Determines if facilitators can update participants' identifying information (team only)\n * @param [view.allowAmbiguousHandles] Determines if a handle can be reused for an admin and a user in this account (team only)\n * @param [view.lockoutLimits] Configuration related to failed login attempt limits (team only)\n * @returns promise that resolves to the newly created account\n */\nexport async function createAccount(\n view: PersonalAccountCreateInView | TeamAccountCreateInView,\n): Promise<AccountReadOutView> {\n return await new Router()\n .withAccountShortName('epicenter')\n .withProjectShortName('manager')\n .post('/account', {\n body: view,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Updates an existing personal or team account\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/account`\n *\n * @example\n * import { accountAdapter } from 'epicenter-libs';\n * // Update a personal account\n * const updatedPersonal = await accountAdapter.updateAccount({\n * objectType: 'personal',\n * name: 'Jane Doe',\n * active: true,\n * });\n * // Update a team account\n * const updatedTeam = await accountAdapter.updateAccount({\n * objectType: 'team',\n * name: 'Acme Corporation',\n * billingInterval: 'annual',\n * });\n *\n * @param view Account update information\n * @param view.objectType Account type; either 'personal' or 'team'\n * @param [view.name] Updated descriptive name of account\n * @param [view.workerPartition] Updated location of model execution\n * @param [view.active] Updated status determining if the account can be used\n * @param [view.billingInterval] Updated billing interval (team only)\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the updated account information\n */\nexport async function updateAccount(\n view: PersonalAccountUpdateInView | TeamAccountUpdateInView,\n optionals: RoutingOptions = {},\n): Promise<AccountReadOutView> {\n return await new Router()\n .patch('/account', {\n body: view,\n ...optionals,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Deletes an account by account short name\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/account`\n *\n * @example\n * import { accountAdapter } from 'epicenter-libs';\n * await accountAdapter.removeAccount('acme');\n *\n * @param accountShortName The short name of the account to delete\n * @returns promise that resolves when the account is deleted\n */\nexport async function removeAccount(\n accountShortName: string,\n): Promise<void> {\n return await new Router()\n .withAccountShortName(accountShortName)\n .delete('/account')\n .then(({ body }) => body);\n}\n\n\n/**\n * Retrieves all team accounts for a given admin user\n * Base URL: GET `https://forio.com/api/v3/epicenter/manager/account/team/for/{ADMIN_KEY}`\n *\n * @example\n * import { accountAdapter } from 'epicenter-libs';\n * const teams = await accountAdapter.teamForAdmin('admin-key-123', {\n * includeAllMembers: true,\n * filter: 'active',\n * first: 0,\n * max: 50,\n * });\n *\n * @param adminKey Admin key to retrieve teams for\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.includeAllMembers] Include all members in the response\n * @param [optionals.filter] Filter string for results\n * @param [optionals.first] Index of first result to return\n * @param [optionals.max] Maximum number of results to return\n * @returns promise that resolves to an array of team accounts\n */\nexport async function teamForAdmin(\n adminKey: string,\n optionals: {\n includeAllMembers?: boolean;\n filter?: string;\n first?: number;\n max?: number;\n } & RoutingOptions = {},\n): Promise<AccountReadOutView[]> {\n const {\n includeAllMembers,\n filter,\n first,\n max,\n ...routingOptions\n } = optionals;\n const searchParams = {\n includeAllMembers,\n filter,\n first,\n max,\n };\n\n return await new Router()\n .withAccountShortName('epicenter')\n .withProjectShortName('manager')\n .withSearchParams(searchParams)\n .get(`/account/team/for/${adminKey}`, routingOptions)\n .then(({ body }) => body);\n}\n","import type { RoutingOptions } from '../utils/router';\n\nimport Router from '../utils/router';\n\nexport interface Secret {\n password: string;\n}\n\nexport interface AdminCreateInView {\n [key: string]: unknown;\n handle: string;\n email: string;\n givenName?: string;\n familyName?: string;\n verified: true;\n active?: true;\n}\n\nexport interface Admin {\n lastUpdated: string;\n lastLogin: string;\n created: string;\n familyName: string;\n givenName: string;\n verified: boolean;\n handle: string;\n active: boolean;\n adminKey: string;\n email: string;\n objectType: 'external' | 'native';\n}\n\nexport interface NativeAdminCreateInView extends AdminCreateInView {\n objectType: 'native';\n secret: Secret;\n}\n\n\n/**\n * Creates a new admin user\n * Base URL: POST `https://forio.com/api/v3/epicenter/manager/admin`\n *\n * @example\n * import { adminAdapter } from 'epicenter-libs';\n * const admin = await adminAdapter.createAdmin({\n * handle: 'admin@example.com',\n * email: 'admin@example.com',\n * givenName: 'Jane',\n * familyName: 'Doe',\n * verified: true,\n * active: true,\n * });\n *\n * @param view Admin user information\n * @param view.handle Handle for the admin user\n * @param view.email Email address for the admin user\n * @param [view.givenName] Admin user's given name\n * @param [view.familyName] Admin user's family name\n * @param view.verified Verification status; must be true\n * @param [view.active] Active status; defaults to true if unset\n * @returns promise that resolves to the newly created admin user\n */\nexport async function createAdmin(\n view: {\n handle: string;\n email: string;\n givenName?: string;\n familyName?: string;\n verified: true;\n active?: true;\n [key: string]: unknown;\n },\n): Promise<Admin> {\n return await new Router()\n .withAccountShortName('epicenter')\n .withProjectShortName('manager')\n .post('/admin', {\n body: view,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Retrieves an admin user by handle\n * Base URL: GET `https://forio.com/api/v3/epicenter/manager/admin/with/{HANDLE}`\n *\n * @example\n * import { adminAdapter } from 'epicenter-libs';\n * const admin = await adminAdapter.getWithHandle('admin@example.com');\n *\n * @param handle Handle for the admin user\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the admin user\n */\nexport async function getWithHandle(handle: string, optionals: RoutingOptions = {}): Promise<Admin> {\n return await new Router()\n .withAccountShortName('epicenter')\n .withProjectShortName('manager')\n .get(`/admin/with/${handle}`, optionals)\n .then(({ body }) => body);\n}\n","/**\n * Enhanced filter functionality for epicenter-libs\n * Supports backwards-compatible string arrays, raw filter strings,\n * and object-based filter groups with arbitrary nesting\n */\n\nexport interface FilterGroup {\n type: 'and' | 'or' | 'taxonomy';\n filters: (string | FilterGroup)[];\n}\n\nexport type FilterInput = string[] | string | FilterGroup;\n\n/**\n * Recursively parses a FilterGroup object into a boolean filter string\n * @param group - FilterGroup object to parse\n * @returns Boolean filter string representation\n */\nfunction parseFilterGroup(group: FilterGroup): string {\n if (!group.filters || group.filters.length === 0) {\n return '';\n }\n\n const parsedFilters = group.filters\n .map((filter) => {\n if (typeof filter === 'string') {\n return filter;\n }\n return parseFilterGroup(filter);\n })\n .filter((filter) => filter.length > 0);\n\n if (parsedFilters.length === 0) {\n return '';\n }\n\n if (!group.type || !['and', 'or', 'taxonomy'].includes(group.type)) {\n throw new Error(`Invalid or missing filter group type: ${group.type || 'undefined'}`);\n }\n\n const joinedFilters = parsedFilters.join(';');\n\n if (parsedFilters.length === 1) {\n return joinedFilters;\n }\n\n switch (group.type) {\n case 'and':\n return `(${joinedFilters})`;\n case 'or':\n return `[${joinedFilters}]`;\n case 'taxonomy':\n return `{${joinedFilters}}`;\n default:\n throw new Error(`Unexpected filter group type: ${group.type}`);\n }\n}\n\n\n/**\n * Parses various filter input formats into the platform's expected filter string format\n * @param filterInput - Array of strings, filter string, or FilterGroup object\n * @returns Platform-compatible filter string or undefined if no filters\n */\nexport function parseFilterInput(filterInput: FilterInput | undefined): string | undefined {\n if (!filterInput) {\n return undefined;\n }\n\n // Handle string array (backwards compatibility)\n if (Array.isArray(filterInput)) {\n return filterInput.length > 0 ? filterInput.join(';') : undefined;\n }\n\n // Handle raw string (pass through - allows advanced users to write boolean syntax directly)\n if (typeof filterInput === 'string') {\n return filterInput || undefined;\n }\n\n // Handle FilterGroup object\n return parseFilterGroup(filterInput) || undefined;\n}\n","import type { RoutingOptions } from '../utils/router';\nimport { ROLE, Router } from '../utils';\n\nexport const ACCESS_TYPE = {\n PUBLIC: 'PUBLIC',\n PRIVATE: 'PRIVATE',\n AUTHENTICATED: 'AUTHENTICATED',\n} as const;\n\nexport type AccessType = (typeof ACCESS_TYPE)[keyof typeof ACCESS_TYPE];\n\nexport const WORKER_PARTITION = {\n NONE: 'NONE',\n ALL: 'ALL',\n FREE: 'FREE',\n LICENSED: 'LICENSED',\n ACCOUNT: 'ACCOUNT',\n} as const;\n\nexport type WorkerPartition = (typeof WORKER_PARTITION)[keyof typeof WORKER_PARTITION];\n\nexport const PHYLOGENY = {\n ORIGINAL: 'ORIGINAL',\n HISTORICAL: 'HISTORICAL',\n REFERENTIAL: 'REFERENTIAL',\n ORDERED: 'ORDERED',\n EVENTUAL: 'EVENTUAL',\n /**\n * TRANSMOGRIFIED Improves the way Epicenter runs proxies.\n */\n TRANSMOGRIFIED: 'TRANSMOGRIFIED',\n /**\n * REANIMATED Changes the default run start-up ritual.\n */\n REANIMATED: 'REANIMATED',\n /**\n * SILENT Inhibits push channel notifications unless allowChannel is true, which by default is false.\n */\n SILENT: 'SILENT',\n} as const;\n\nexport type Phylogeny = (typeof PHYLOGENY)[keyof typeof PHYLOGENY];\n\nexport type FileType = 'INSENSITIVE' | 'SENSITIVE';\n\nexport const CHANNEL_PROTOCOL = {\n OUMUAMUA: 'OUMUAMUA',\n COMETD: 'COMETD',\n} as const;\n\nexport type ChannelProtocol = (typeof CHANNEL_PROTOCOL)[keyof typeof CHANNEL_PROTOCOL];\n\nexport interface ProjectMember {\n role: ROLE.AUTHOR;\n adminKey: string;\n objectType: 'project';\n}\n\nexport interface Deployment {\n defaultGroupName: string;\n autoCreatePlayer: boolean;\n loginFile: string;\n welcomeFile: string;\n groupFile: string;\n}\n\nexport interface TeamProject {\n concurrentRunLimit: number;\n modelFile: string;\n available: boolean;\n allowWorldSelfAssign: boolean;\n legacySettings: {\n blockDirectApiCalls: boolean;\n channelAuthorizationRequired: boolean;\n filePermissionsActive: boolean;\n showEmail: boolean;\n transmogrifierActive: boolean;\n dataApiAllowAnonymousAccess: boolean;\n channelVersion: number;\n authorizationMode: 'LEGACY' | 'USER';\n dataApiEnforceScope: boolean;\n };\n objectType: 'team';\n accessType: AccessType;\n sessionTimeoutSeconds: number;\n projectKey: string;\n members: ProjectMember[];\n channelEnabled: boolean;\n workerPartition: WorkerPartition;\n name: string;\n phylogeny: Phylogeny;\n multiPlayerEnabled: boolean;\n shortName: string;\n approximateRunCount: number;\n pricing: {\n amount: number;\n };\n dataRetentionDays: number;\n fileType: FileType;\n dimensions: 'UNIVERSE' | 'MULTIVERSE';\n deployment: Deployment;\n channelProtocol: ChannelProtocol;\n}\n\nexport interface PersonalProject {\n concurrentRunLimit: number;\n available: boolean;\n objectType: 'personal';\n accessType: AccessType;\n sessionTimeoutSeconds: number;\n projectKey: string;\n workerPartition: WorkerPartition;\n name: string;\n phylogeny: Phylogeny;\n shortName: string;\n approximateRunCount: number;\n fileType: FileType;\n deployment: Deployment;\n channelProtocol: ChannelProtocol;\n channelEnabled: boolean;\n}\n\nexport type Project =\n | TeamProject\n | PersonalProject;\n\n/**\n * Checks to see if the project currently has the push channels enabled\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/project/channel/isEnabled`\n *\n * @example\n * import { projectAdapter } from 'epicenter-libs';\n * const enabled = await projectAdapter.channelsEnabled();\n *\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise resolving true/false whether or not the project supports the use of push channels\n */\nexport async function channelsEnabled(\n optionals: RoutingOptions = {},\n): Promise<boolean> {\n return await new Router()\n .get('/project/channel/isEnabled', optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Gets the current project details\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/project`\n *\n * @example\n * import { projectAdapter } from 'epicenter-libs';\n * const project = await projectAdapter.get();\n *\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the project object\n */\nexport async function get(\n optionals: RoutingOptions = {},\n): Promise<Project> {\n return await new Router()\n .get('/project', optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Lists all projects in an account\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/manager/project/in`\n *\n * @example\n * import { projectAdapter } from 'epicenter-libs';\n * const projects = await projectAdapter.list('my-account');\n *\n * @param accountShortName The account short name\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to an array of project objects\n */\nexport async function list(\n accountShortName: string,\n optionals: RoutingOptions = {},\n): Promise<Project[]> {\n return await new Router()\n .withAccountShortName(accountShortName)\n .withProjectShortName('manager')\n .get('/project/in', optionals)\n .then(({ body }) => body);\n}\n","import type { CometD, Message, SubscriptionHandle } from 'cometd';\nimport type Channel from './channel';\nimport type { ChannelMessage } from './channel';\n\nimport { EpicenterError, Fault, identification, isBrowser, errorManager, config } from '../utils';\nimport { get as getProject } from './project';\n\nconst AUTH_TOKEN_KEY = 'com.forio.epicenter.token';\nconst MAX_RETRIES = 3;\n\nconst IDLE = 'idle';\nconst FAILED = 'failed';\nconst CONNECTED = 'connected';\nconst SUCCEEDED = 'succeeded';\nconst CONNECTING = 'connecting';\nconst HANDSHAKING = 'handshaking';\nconst DISCONNECTED = 'disconnected';\nconst FORBIDDEN = 403;\nconst CONNECT_META_CHANNEL = '/meta/connect';\nconst DISCONNECT_META_CHANNEL = '/meta/disconnect';\nconst HANDSHAKE_META_CHANNEL = '/meta/handshake';\nconst COMETD_RECONNECTED = 'COMETD_RECONNECTED';\nconst DEFAULT_CHANNEL_PROTOCOL = 'cometd';\n\ntype HandshakeState = 'idle' | 'handshaking' | 'succeeded' | 'failed';\n\n// error messages that indicate session invalidation as\n// described in cometd documentation and oumuamua source code:\n// https://docs.cometd.org/current/reference/#_javascript_disconnect\n// https://github.com/zenbones/SmallMind/blob/main/bayeux/oumuamua/server/spi/src/main/java/org/smallmind/bayeux/oumuamua/server/spi/MetaProcessingException.java\n\nconst SESSION_INVALIDATION_ERRORS = [\n '402',\n 'session_unknown',\n 'invalid client id',\n 'missing client id',\n 'session has been disconnected',\n 'invalid session type',\n 'handshake_denied',\n 'handshake_failed',\n];\n\nfunction isSessionInvalidationError(errorMessage: string): boolean {\n const lowerError = errorMessage.toLowerCase();\n return SESSION_INVALIDATION_ERRORS.some((pattern) => {\n return lowerError.includes(pattern);\n });\n}\n\nfunction isIllegalStateError(error: unknown): boolean {\n return error instanceof Error && error.message.toLowerCase().includes('illegal state');\n}\n\nfunction shouldRehandshake(reply: Message): boolean {\n const advice = reply.advice?.reconnect;\n if (advice === 'handshake') {\n return true;\n }\n\n const errorMessage = reply.error ?? '';\n return isSessionInvalidationError(errorMessage);\n}\n\nlet cometdInstance: CometD | undefined;\nclass CometdAdapter {\n url = '';\n initialization: Promise<boolean> | undefined = undefined;\n handshakePromise: Promise<void> | undefined = undefined;\n subscriptions = new Map<string, SubscriptionHandle>();\n isConnected = false;\n handshakeState: HandshakeState = IDLE;\n pendingOperations: Array<() => Promise<unknown>> = [];\n processingQueue = false;\n\n get cometd() {\n if (!cometdInstance) {\n throw new EpicenterError('Tried to get non-existent cometd');\n }\n return cometdInstance;\n }\n\n set cometd(instance) {\n cometdInstance = instance;\n }\n\n async startup(options: { logLevel: 'info' | 'debug' | 'warn' } = { logLevel: 'warn' }) {\n const project = await getProject();\n if (!project.channelEnabled) throw new EpicenterError('Push Channels are not enabled on this project');\n const channelProtocol = project.channelProtocol?.toLowerCase() || DEFAULT_CHANNEL_PROTOCOL;\n const { CometD } = await import('cometd');\n const { AckExtension } = await import('cometd');\n const { ReloadExtension } = await import('cometd');\n\n this.cometd = new CometD();\n const { apiProtocol, apiHost, apiVersion, accountShortName, projectShortName } = config;\n const accountProject = (accountShortName && projectShortName) ?\n `/${accountShortName}/${projectShortName}` :\n '/epicenter/manager';\n this.url = `${apiProtocol}://${apiHost}/push/v${apiVersion}${accountProject}/${channelProtocol}`;\n\n this.cometd.registerExtension('ack', new AckExtension());\n if (isBrowser()) {\n this.cometd.registerExtension('reload', new ReloadExtension());\n\n window.onunload = () => {\n if (this.cometd.getStatus() === CONNECTED) {\n if (this.cometd.reload) this.cometd.reload();\n const transport = this.cometd.getTransport();\n if (transport) transport.abort();\n }\n };\n }\n\n this.cometd.configure({\n url: this.url,\n logLevel: options.logLevel,\n });\n return true;\n }\n\n listenToMetaChannels() {\n this.cometd.addListener(HANDSHAKE_META_CHANNEL, (message: Message) => {\n if (message.successful) {\n this.handshakeState = SUCCEEDED;\n this.processPendingOperations();\n } else {\n this.handshakeState = FAILED;\n this.handleHandshakeFailure(message);\n }\n });\n\n const connectListener = new Promise((resolve, reject) => {\n this.cometd.addListener(CONNECT_META_CHANNEL, (message: Message) => {\n if (this.cometd.isDisconnected()) {\n return;\n }\n const wasConnected = this.isConnected;\n this.isConnected = message.successful || false;\n\n if (!wasConnected && this.isConnected) {\n const error = new Fault({\n status: undefined,\n message: 'Reconnected to CometD',\n information: {\n code: COMETD_RECONNECTED,\n },\n });\n const retry = () => Promise.resolve();\n\n try {\n const result = errorManager.handle(error, retry);\n resolve(result);\n } catch (e) {\n reject(e);\n }\n this.processPendingOperations();\n } else if (wasConnected && !this.isConnected) {\n this.handshakeState = IDLE;\n }\n });\n });\n\n const disconnectListener = new Promise((resolve) => {\n this.cometd.addListener(DISCONNECT_META_CHANNEL, (message: Message) => {\n if (message.successful) {\n this.isConnected = false;\n this.handshakeState = IDLE;\n }\n resolve(message);\n });\n });\n\n return Promise.all([connectListener, disconnectListener]);\n }\n\n private handleHandshakeFailure(message: Message) {\n if (shouldRehandshake(message)) {\n this.handshakeState = IDLE;\n this.handshakePromise = undefined;\n }\n }\n\n private async processPendingOperations() {\n if (this.processingQueue || this.pendingOperations.length === 0) return;\n\n this.processingQueue = true;\n const operations = [...this.pendingOperations];\n this.pendingOperations = [];\n\n try {\n await Promise.all(operations.map((op) => op().catch(console.error)));\n } finally {\n this.processingQueue = false;\n }\n }\n\n async init(options?: { logLevel: 'info' | 'debug' | 'warn' }) {\n if (!this.initialization) {\n this.initialization = this.startup(options);\n }\n return this.initialization;\n }\n\n // Connects to CometD server\n async handshake(options: { inert?: boolean } = {}) {\n await this.init();\n\n // Prevent concurrent handshake attempts\n if (this.handshakePromise && this.handshakeState === HANDSHAKING) {\n return this.handshakePromise;\n }\n\n const currentStatus = this.cometd.getStatus();\n\n // If already connected and handshake succeeded, return immediately\n if (currentStatus === CONNECTED && this.handshakeState === SUCCEEDED) {\n return Promise.resolve();\n }\n\n // If CometD is connecting or handshaking, don't call handshake again - just wait\n if (currentStatus === CONNECTING || currentStatus === HANDSHAKING) {\n if (this.handshakePromise) {\n return this.handshakePromise;\n }\n // Return a rejected promise to indicate we can't handshake right now\n return Promise.reject(new Error('CometD is already connecting, please wait'));\n }\n\n // Only proceed if disconnected\n if (currentStatus !== DISCONNECTED) {\n return Promise.resolve();\n }\n\n this.handshakeState = HANDSHAKING;\n const { session } = identification;\n let handshakeProps = {};\n\n if (session) {\n handshakeProps = {\n ext: {\n [AUTH_TOKEN_KEY]: session.token,\n ack: true,\n },\n };\n }\n\n this.cometd.websocketEnabled = true;\n this.handshakePromise = new Promise((resolve, reject) => {\n this.cometd.handshake(handshakeProps, (handshakeReply) => {\n if (handshakeReply.successful) {\n this.handshakeState = SUCCEEDED;\n this.listenToMetaChannels();\n resolve(undefined);\n return;\n }\n\n this.handshakeState = FAILED;\n\n if (shouldRehandshake(handshakeReply)) {\n this.handshakeState = IDLE;\n this.handshakePromise = undefined;\n }\n\n const errorMessage = handshakeReply.error ?? '';\n const error = new Fault({\n status: errorMessage.includes('403') ? FORBIDDEN : undefined,\n message: errorMessage,\n information: {\n code: 'COMETD_ERROR',\n ...handshakeReply,\n },\n });\n\n if (options.inert) {\n reject(error);\n return;\n }\n\n const retry = () => this.handshake({ inert: true });\n try {\n const result = errorManager.handle(error, retry);\n resolve(result);\n } catch (e) {\n reject(e);\n }\n });\n });\n\n return this.handshakePromise;\n }\n\n async disconnect() {\n if (!this.initialization) return Promise.resolve();\n\n await this.init();\n await this.empty();\n if (this.cometd.getStatus() !== CONNECTED) return Promise.resolve();\n\n return new Promise((resolve, reject) => this.cometd.disconnect((disconnectReply: Message) => {\n if (disconnectReply.successful) {\n resolve(undefined);\n return;\n }\n\n const errorMessage = disconnectReply.error ?? '';\n if (isSessionInvalidationError(errorMessage)) {\n resolve(undefined);\n return;\n }\n\n reject(new EpicenterError('Unable to disconnect from CometD server'));\n }));\n }\n\n async add<D = unknown>(\n channel: Channel<D>,\n update: (data: ChannelMessage<D>) => unknown,\n options: {\n inert?: boolean;\n _retryCount?: number;\n } = {},\n ): Promise<SubscriptionHandle> {\n await this.init();\n\n const currentStatus = this.cometd?.getStatus();\n if (currentStatus !== CONNECTED) {\n try {\n await this.handshake();\n } catch (error: unknown) {\n const errorObj = error as { message?: string };\n if (errorObj?.message?.includes('already connecting')) {\n // Wait a moment and try again\n const retryDelay = 500;\n await new Promise((resolve) => setTimeout(resolve, retryDelay));\n if (this.cometd?.getStatus() === CONNECTED) {\n // Connection succeeded while we waited, continue to subscription\n // Don't return here since we need to continue with the subscription logic\n }\n }\n throw error;\n }\n }\n const { session } = identification;\n const subscriptionProps = !session ?\n {} :\n { ext: { [AUTH_TOKEN_KEY]: session.token } };\n\n const handleCometdUpdate = (message: Message) => {\n // TODO -- figure out why there's ambiguity here and try to remove it\n let data = message.data;\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (_error: unknown) {\n // If parsing fails, use raw string\n }\n }\n return update(data);\n };\n\n return new Promise((resolve, reject) => {\n let subscription: SubscriptionHandle;\n try {\n subscription = this.cometd.subscribe(\n channel.path,\n handleCometdUpdate,\n subscriptionProps,\n (subscribeReply: Message) => {\n if (subscribeReply.successful) {\n this.subscriptions.set(channel.path, subscription);\n resolve(subscription);\n return;\n }\n\n if (shouldRehandshake(subscribeReply)) {\n this.handshakeState = IDLE;\n this.handshakePromise = undefined;\n }\n\n const errorMessage = subscribeReply.error ?? '';\n const error = new Fault({\n status: errorMessage.includes('403') ? FORBIDDEN : undefined,\n message: errorMessage,\n information: {\n code: 'COMETD_ERROR',\n ...subscribeReply,\n },\n });\n\n if (options.inert) {\n reject(error);\n return;\n }\n\n const retry = async () => {\n if (shouldRehandshake(subscribeReply)) {\n await this.handshake({ inert: true });\n }\n return this.add<D>(channel, update, { inert: true });\n };\n try {\n const result = errorManager.handle<SubscriptionHandle>(error, retry);\n resolve(result);\n } catch (e) {\n reject(e);\n }\n },\n );\n } catch (error: unknown) {\n const retryCount = options._retryCount ?? 0;\n if (isIllegalStateError(error) && retryCount < MAX_RETRIES) {\n this.handshakeState = IDLE;\n this.handshakePromise = undefined;\n this.handshake()\n .then(() => this.add<D>(channel, update, {\n ...options,\n _retryCount: retryCount + 1,\n }))\n .then(resolve)\n .catch(reject);\n return;\n }\n reject(error);\n }\n });\n }\n\n async publish<D = unknown>(\n channel: Channel<D>,\n content: D,\n options: {\n inert?: boolean;\n _retryCount?: number;\n } = {},\n ): Promise<Message> {\n await this.init();\n if (this.cometd.getStatus() !== CONNECTED) {\n await this.handshake();\n }\n const { session } = identification;\n const publishProps = {\n ext: session ? { [AUTH_TOKEN_KEY]: session.token } : undefined,\n };\n\n return new Promise((resolve, reject) => {\n try {\n this.cometd.publish(\n channel.path,\n content,\n publishProps,\n (publishReply: Message) => {\n if (publishReply.successful) {\n resolve(publishReply);\n return;\n }\n\n if (shouldRehandshake(publishReply)) {\n this.handshakeState = IDLE;\n this.handshakePromise = undefined;\n }\n\n const errorMessage = publishReply.error ?? '';\n const error = new Fault({\n status: errorMessage.includes('403') ? FORBIDDEN : undefined,\n message: errorMessage,\n information: {\n code: 'COMETD_ERROR',\n ...publishReply,\n },\n });\n\n if (options.inert) {\n reject(error);\n return;\n }\n\n const retry = async () => {\n if (shouldRehandshake(publishReply)) {\n await this.handshake({ inert: true });\n }\n return this.publish<D>(channel, content, { inert: true });\n };\n try {\n const result = errorManager.handle<Message>(error, retry);\n resolve(result);\n } catch (e) {\n reject(e);\n }\n },\n );\n } catch (error: unknown) {\n const retryCount = options._retryCount ?? 0;\n if (isIllegalStateError(error) && retryCount < MAX_RETRIES) {\n this.handshakeState = IDLE;\n this.handshakePromise = undefined;\n this.handshake()\n .then(() => this.publish<D>(channel, content, {\n ...options,\n _retryCount: retryCount + 1,\n }))\n .then(resolve)\n .catch(reject);\n return;\n }\n reject(error);\n }\n });\n }\n\n async remove(subscription: SubscriptionHandle) {\n await this.init();\n\n // Find the subscription by iterating through the map\n let channelPath: string | undefined;\n for (const [path, sub] of this.subscriptions.entries()) {\n if (sub === subscription) {\n channelPath = path;\n break;\n }\n }\n\n if (channelPath) {\n this.subscriptions.delete(channelPath);\n if (this.cometd.getStatus() === DISCONNECTED) return Promise.resolve();\n }\n\n return new Promise((resolve, reject) => {\n try {\n this.cometd.unsubscribe(subscription, (unsubscribeReply: Message) => {\n if (unsubscribeReply.successful) {\n resolve(unsubscribeReply);\n return;\n }\n\n const errorMessage = unsubscribeReply.error ?? '';\n\n if (isSessionInvalidationError(errorMessage)) {\n resolve(unsubscribeReply);\n return;\n }\n\n const error = new Fault({\n status: undefined,\n message: errorMessage,\n information: {\n code: 'COMETD_ERROR',\n ...unsubscribeReply,\n },\n });\n reject(error);\n });\n } catch (error: unknown) {\n if (isIllegalStateError(error)) {\n resolve(undefined);\n return;\n }\n reject(error);\n }\n });\n }\n\n async empty() {\n await this.init();\n this.cometd.clearSubscriptions();\n this.subscriptions.clear();\n }\n}\n\nconst cometdAdapter = new CometdAdapter();\nexport default cometdAdapter;\n","import type { RoutingOptions } from '../utils/router';\nimport type { Session } from '../utils/identification';\n\nimport { Router, identification } from '../utils';\nimport cometdAdapter from './cometd';\n\n\nexport interface UserCredentials {\n handle: string;\n password: string;\n groupKey?: string;\n}\n\nexport interface AppCredentials {\n secretKey: string;\n}\n\n\n/**\n * Logs out of current Epicenter session. Also disconnects from CometD and removes user presence.\n * Priorities:\n * 1. Delete local session (even if 2 and 3 fail)\n * 2. Delete remote session (even if 3 fails)\n * 3. Other cleanup (disconnect CometD, delete presence)\n * Cleanup operations require authentication, so await cleanup before delete.\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/verification`\n *\n * @example\n * import { authAdapter } from 'epicenter-libs';\n * await authAdapter.logout();\n *\n * @param [verificationOptionals] Optional arguments; pass network call options overrides here.\n * @param [presenceOptionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves when logout is complete\n */\nexport async function logout(\n verificationOptionals: RoutingOptions = {},\n presenceOptionals: RoutingOptions = verificationOptionals,\n): Promise<void> {\n const cleanup = [cometdAdapter.disconnect()];\n const groupKey = identification?.session?.groupKey;\n if (groupKey) {\n cleanup.push(\n new Router().delete(\n `/presence/group/${groupKey}`,\n presenceOptionals,\n ),\n );\n }\n await Promise.allSettled(cleanup);\n await new Router()\n .delete('/verification', verificationOptionals)\n .finally(() => (identification.session = undefined));\n}\n\n\n/**\n * Retrieves the current session from the server\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/verification`\n *\n * @example\n * import { authAdapter } from 'epicenter-libs';\n * const session = await authAdapter.getSession();\n *\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the session object\n */\nexport async function getSession(optionals: RoutingOptions = {}): Promise<Session> {\n const { body } = await new Router().get('/verification', optionals);\n identification.session = body;\n return body;\n}\n\n\n/**\n * Retrieves the session stored in memory\n *\n * @example\n * import { authAdapter } from 'epicenter-libs';\n * const session = authAdapter.getLocalSession();\n *\n * @returns the session object if it exists, undefined otherwise\n */\nexport function getLocalSession(): Session | undefined {\n return identification.session;\n}\n\n\n/**\n * Stores a session in memory\n *\n * @example\n * import { authAdapter } from 'epicenter-libs';\n * authAdapter.setLocalSession(session);\n *\n * @param session The session object to store\n * @returns the stored session object\n */\nexport function setLocalSession(session: Session): Session {\n return identification.session = session;\n}\n\n\n/**\n * Removes the session stored in memory and disconnects from CometD\n *\n * @example\n * import { authAdapter } from 'epicenter-libs';\n * await authAdapter.removeLocalSession();\n *\n * @returns promise that resolves when the session is removed and CometD is disconnected\n */\nexport async function removeLocalSession(): Promise<void> {\n identification.session = undefined;\n await cometdAdapter.disconnect();\n}\n\n\n/**\n * Logs in a user or app and stores the session\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/authentication`\n *\n * @example\n * import { authAdapter } from 'epicenter-libs';\n * // User login\n * const session = await authAdapter.login({\n * handle: 'user@example.com',\n * password: 'myPassword',\n * groupKey: '00000165ad4e6a3cd22b993340b963820239',\n * });\n * // App login\n * const session = await authAdapter.login({\n * secretKey: 'my-secret-key',\n * });\n *\n * @param credentials User or app credentials\n * @param credentials.handle User handle (email or username)\n * @param credentials.password User password\n * @param [credentials.groupKey] Group key for user login\n * @param credentials.secretKey Secret key for app login\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.objectType] Object type for authentication (defaults to 'user' or 'account' based on credentials)\n * @param [optionals.forcePathInclusion] Controls cookie path behavior: `true` forces project-specific path (even on custom domains), `false` forces root path (even for users/admins on Epicenter domain), `undefined` uses defaults (project-specific for users/admins on Epicenter domain, root for custom domains)\n * @returns promise that resolves to the session object\n */\nexport async function login(\n credentials: UserCredentials | AppCredentials,\n optionals: {\n objectType?: string;\n forcePathInclusion?: boolean;\n } & RoutingOptions = {},\n): Promise<Session> {\n const { objectType, forcePathInclusion, ...routingOptions } = optionals;\n let payload;\n if (Object.prototype.hasOwnProperty.call(credentials, 'handle')) {\n const { handle, password, groupKey } = credentials as UserCredentials;\n payload = { objectType: objectType ?? 'user', handle, password, groupKey: groupKey || undefined };\n }\n if (Object.prototype.hasOwnProperty.call(credentials, 'secretKey')) {\n const { secretKey } = credentials as AppCredentials;\n payload = { objectType: objectType ?? 'account', secretKey };\n }\n const session = await new Router()\n .post('/authentication', {\n inert: true,\n includeAuthorization: false,\n body: payload,\n ...routingOptions,\n }).then(({ body }) => body);\n\n await removeLocalSession();\n\n identification.setSessionWithOptions(session, forcePathInclusion);\n return session;\n}\n\n\n/**\n * Regenerates your Epicenter session with the appropriate context.\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/authentication`\n *\n * - For users: Updates session to the specified group context\n * - For admins: Updates session to the specified account/project context (uses platform's focus API)\n *\n * This is automatically called when switching between projects/groups if the session cookie\n * is scoped to a specific project path.\n *\n * Will fail if the user/admin does not already belong to the group/account.\n *\n * @example\n * import { authAdapter } from 'epicenter-libs';\n * // Changes the current user session to have a group context associated with the provided key\n * await authAdapter.regenerate('00000165ad4e6a3cd22b993340b963820239');\n * // Changes the current admin session to use the account context for the 'acme' account\n * await authAdapter.regenerate('acme', { objectType: 'admin' });\n *\n * @param groupOrAccount Group key or account name\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.objectType] The object type to regenerate for (defaults to 'user')\n * @param [optionals.forcePathInclusion] Controls cookie path behavior: `true` forces project-specific path (even on custom domains), `false` forces root path (even for users/admins on Epicenter domain), `undefined` uses defaults (project-specific for users/admins on Epicenter domain, root for custom domains)\n * @returns promise that resolves to the new session object\n */\nexport async function regenerate(\n groupOrAccount: string,\n optionals: {\n objectType?: string;\n forcePathInclusion?: boolean;\n } & RoutingOptions = {},\n): Promise<Session> {\n const {\n objectType = 'user',\n accountShortName,\n forcePathInclusion,\n ...routingOptions\n } = optionals;\n\n const session = await new Router()\n .patch('/authentication', {\n accountShortName: objectType === 'admin' ?\n groupOrAccount :\n accountShortName,\n body: {\n objectType,\n groupKey: objectType === 'user' ?\n groupOrAccount :\n undefined,\n },\n ...routingOptions,\n }).then(({ body }) => body);\n\n await removeLocalSession();\n identification.setSessionWithOptions(session, forcePathInclusion);\n return session;\n}\n\n\n/**\n * Authenticates using Single Sign-On (SSO)\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/sso/user`\n *\n * @example\n * import { authAdapter } from 'epicenter-libs';\n * const session = await authAdapter.sso();\n *\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the session object\n */\nexport async function sso(\n optionals: RoutingOptions = {},\n): Promise<Session> {\n const session = await new Router()\n .get('/registration/sso/user', optionals)\n .then(({ body }) => body);\n\n identification.session = session;\n return session;\n}\n\n\n/**\n * Retrieves the SAML link from the SSO configuration\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/sso/user/saml`\n *\n * @example\n * import { authAdapter } from 'epicenter-libs';\n * const samlLink = await authAdapter.getSAMLLink();\n *\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the SAML link\n */\nexport async function getSAMLLink(\n optionals: RoutingOptions = {},\n): Promise<string> {\n return await new Router()\n .get('/registration/sso/user/saml', optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Generates and returns an epicenter URL that will redirect to the SAML url\n *\n * @example\n * import { authAdapter } from 'epicenter-libs';\n * const samlURL = authAdapter.generateSAMLLINK();\n *\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns the generated SAML URL string\n */\nexport function generateSAMLLINK(\n optionals: RoutingOptions = {},\n): string {\n return new Router().getURL('/registration/sso/user/saml', optionals).toString();\n}\n\n\n/**\n * Sends an outcome to an external link specified in project config. For example, sending a grade back to a third party platform.\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/lti/{LTI_VERSION}/outcome`\n *\n * @example\n * import { authAdapter } from 'epicenter-libs';\n * await authAdapter.ssoOutcome('1.3', {\n * value: 95,\n * sourcedId: 'student-assignment-123',\n * outcomeServiceUrl: 'https://lms.example.com/outcome',\n * });\n *\n * @param ltiVersion The version of LTI to use (valid versions: 1.1, 1.2, 1.3)\n * @param outcomeInformation Outcome information to send\n * @param outcomeInformation.value The value to pass back to the outcomeServiceUrl (e.g., the grade a student received)\n * @param outcomeInformation.sourcedId The id of the current assignment/student as provided by the client using the SSO service\n * @param outcomeInformation.outcomeServiceUrl The url called for passing back the outcome\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the response object\n */\nexport async function ssoOutcome(\n ltiVersion: string,\n outcomeInformation: {\n value: number;\n sourcedId: string;\n outcomeServiceUrl: string;\n },\n optionals: RoutingOptions = {},\n): Promise<Record<string, unknown>> {\n const { ...routingOptions } = optionals;\n return await new Router()\n .post(`/lti/${ltiVersion}/outcome`, {\n body: outcomeInformation,\n ...routingOptions,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Sends a link to reset a user's password to their email\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/verification/password/user/{HANDLE}`\n *\n * @example\n * import { authAdapter } from 'epicenter-libs';\n * const subject = 'Please reset your password for the Acme simulation';\n * const redirectURL = 'https://forio.com/app/acme/simulations';\n * const handle = 'testUser@test.com';\n * await authAdapter.resetPassword(handle, { redirectURL, subject });\n *\n * @param handle Handle that user would use to login\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.redirectURL] URL to redirect to after password reset is completed (must be in the forio domain)\n * @param [optionals.subject] The subject of the email that will be sent\n * @returns promise that resolves when the reset email is sent\n */\nexport async function resetPassword(\n handle: string,\n optionals: {\n redirectURL?: string;\n subject?: string;\n } & RoutingOptions = {},\n): Promise<void> {\n const {\n redirectURL, subject,\n ...routingOptions\n } = optionals;\n\n return await new Router()\n .post(`/verification/password/user/${handle}`, {\n ...routingOptions,\n body: {\n redirectUrl: redirectURL,\n subject,\n },\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Verifies a token and retrieves the associated session\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/verification`\n *\n * @example\n * import { authAdapter } from 'epicenter-libs';\n * const session = await authAdapter.verify('my-auth-token');\n *\n * @param token Authorization token to verify\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the session object\n */\nexport async function verify(\n token: string,\n optionals: RoutingOptions = {},\n): Promise<Session> {\n return await new Router()\n .get('/verification', {\n authorization: `Bearer ${token}`,\n ...optionals,\n })\n .then(({ body }) => body);\n}\n","import type { RoutingOptions } from '../utils/router';\nimport type { GenericScope, Address } from '../utils/constants';\n\nimport fetch from 'cross-fetch';\nimport { Fault, Router, ROLE } from '../utils';\n\nexport interface AssetScope extends GenericScope {\n userKey?: string;\n}\n\nexport interface Asset {\n file: string;\n address: Address;\n scope: AssetScope;\n}\n\nexport interface AssetTicket {\n url: string;\n}\n\n\n/**\n * Creates a presigned URL for uploading a file to S3\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/asset`\n *\n * @example\n * import { assetAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const ticket = await assetAdapter.create('myfile.pdf', {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * });\n *\n * @param file File path/name for the asset\n * @param scope Scope associated with the asset\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [scope.userKey] User key to further scope the asset to a specific user\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.readLock] Role allowed to read; defaults to USER\n * @param [optionals.writeLock] Role allowed to write; defaults to USER\n * @param [optionals.ttlSeconds] Time to live in seconds for the asset\n * @param [optionals.tokenAccessSeconds] How long the presigned URL is valid for in seconds\n * @returns promise that resolves to an asset ticket containing the presigned upload URL\n */\nexport async function create(\n file: string,\n scope: AssetScope,\n optionals: {\n readLock?: keyof typeof ROLE;\n writeLock?: keyof typeof ROLE;\n ttlSeconds?: number;\n tokenAccessSeconds?: number;\n } & RoutingOptions = {},\n): Promise<AssetTicket> {\n const { scopeBoundary, scopeKey, userKey } = scope;\n const {\n readLock,\n writeLock,\n ttlSeconds,\n tokenAccessSeconds,\n ...routingOptions\n } = optionals;\n return await new Router()\n .withSearchParams({ tokenAccessSeconds })\n .post('/asset', {\n body: {\n file,\n scope: {\n scopeBoundary,\n scopeKey,\n userKey,\n },\n permit: {\n readLock: readLock ?? ROLE.USER,\n writeLock: writeLock ?? ROLE.USER,\n },\n ttlSeconds,\n },\n ...routingOptions,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Updates an existing asset and returns a presigned URL for uploading the new file to S3\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/asset`\n *\n * @example\n * import { assetAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const ticket = await assetAdapter.update('myfile.pdf', {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * });\n *\n * @param file File path/name for the asset\n * @param scope Scope associated with the asset\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [scope.userKey] User key to further scope the asset to a specific user\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.readLock] Role allowed to read; defaults to USER\n * @param [optionals.writeLock] Role allowed to write; defaults to USER\n * @param [optionals.ttlSeconds] Time to live in seconds for the asset\n * @param [optionals.tokenAccessSeconds] How long the presigned URL is valid for in seconds\n * @returns promise that resolves to an asset ticket containing the presigned upload URL\n */\nexport async function update(\n file: string,\n scope: AssetScope,\n optionals: {\n readLock?: keyof typeof ROLE;\n writeLock?: keyof typeof ROLE;\n ttlSeconds?: number;\n tokenAccessSeconds?: number;\n } & RoutingOptions = {},\n): Promise<AssetTicket> {\n const { scopeBoundary, scopeKey, userKey } = scope;\n const {\n readLock,\n writeLock,\n ttlSeconds,\n tokenAccessSeconds,\n ...routingOptions\n } = optionals;\n return await new Router()\n .withSearchParams({ tokenAccessSeconds })\n .patch('/asset', {\n body: {\n file,\n scope: {\n scopeBoundary,\n scopeKey,\n userKey,\n },\n permit: {\n readLock: readLock ?? ROLE.USER,\n writeLock: writeLock ?? ROLE.USER,\n },\n ttlSeconds,\n },\n ...routingOptions,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Deletes an asset by asset key\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/asset/{ASSET_KEY}`\n *\n * @example\n * import { assetAdapter } from 'epicenter-libs';\n * await assetAdapter.remove('0000017dd3bf540e5ada5b1e058f08f20461');\n *\n * @param assetKey The unique key for the asset\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves when the asset is deleted\n */\nexport async function remove(\n assetKey: string,\n optionals: RoutingOptions = {},\n): Promise<void> {\n return await new Router()\n .delete(`/asset/${assetKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Deletes all assets within a given scope\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/asset/in/{SCOPE_BOUNDARY}/{SCOPE_KEY}` or DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/asset/in/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{USER_KEY}`\n *\n * @example\n * import { assetAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * await assetAdapter.removeFromScope({\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * });\n *\n * @param scope Scope associated with the assets to delete\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [scope.userKey] User key to further scope the deletion to a specific user\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves when all assets in the scope are deleted\n */\nexport async function removeFromScope(\n scope: AssetScope,\n optionals: RoutingOptions = {},\n): Promise<void> {\n const { scopeBoundary, scopeKey, userKey } = scope;\n const uriComponent = userKey ? `/${userKey}` : '';\n return await new Router()\n .delete(`/asset/in/${scopeBoundary}/${scopeKey}${uriComponent}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Retrieves asset metadata by asset key\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/asset/{ASSET_KEY}`\n *\n * @example\n * import { assetAdapter } from 'epicenter-libs';\n * const asset = await assetAdapter.get('0000017dd3bf540e5ada5b1e058f08f20461');\n *\n * @param assetKey The unique key for the asset\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the asset metadata\n */\nexport async function get(\n assetKey: string,\n optionals: RoutingOptions = {},\n): Promise<Asset> {\n const { server, accountShortName, projectShortName } = optionals;\n return await new Router()\n .withServer(server)\n .withAccountShortName(accountShortName)\n .withProjectShortName(projectShortName)\n .get(`/asset/${assetKey}`)\n .then(({ body }) => body);\n}\n\n\n/**\n * Lists all assets within a given scope, optionally filtered by file pattern\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/asset/in/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{FILTER}` or GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/asset/in/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{USER_KEY}/{FILTER}`\n *\n * @example\n * import { assetAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * // List all assets in the scope\n * const assets = await assetAdapter.list({\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * });\n * // List only PDF files\n * const pdfs = await assetAdapter.list({\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * }, { filter: '*.pdf' });\n *\n * @param scope Scope associated with the assets\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [scope.userKey] User key to further scope the list to a specific user\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.filter] File pattern to filter assets (e.g., '*.pdf' for PDF files); defaults to '*' (all files)\n * @returns promise that resolves to a list of assets\n */\nexport async function list(\n scope: AssetScope,\n optionals: {\n filter?: string;\n } & RoutingOptions = {},\n): Promise<Asset[]> {\n const { scopeBoundary, scopeKey, userKey } = scope;\n const {\n filter,\n ...routingOptions\n } = optionals;\n const uriComponent = userKey ? `/${userKey}` : '';\n return await new Router()\n .get(`/asset/in/${scopeBoundary}/${scopeKey}${uriComponent}/${filter ?? '*'}`, routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Generates a presigned URL for accessing an asset\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/asset/url/{ASSET_KEY}`\n *\n * @example\n * import { assetAdapter } from 'epicenter-libs';\n * const url = await assetAdapter.getURL('0000017dd3bf540e5ada5b1e058f08f20461');\n * // Use the url to access the asset\n *\n * @param assetKey The unique key for the asset\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.tokenAccessSeconds] How long the presigned URL is valid for in seconds\n * @returns promise that resolves to the presigned URL\n */\nexport async function getURL(\n assetKey: string,\n optionals: {\n tokenAccessSeconds?: number;\n } & RoutingOptions = {},\n): Promise<string> {\n const { tokenAccessSeconds, ...routingOptions } = optionals;\n return await new Router()\n .withSearchParams({ tokenAccessSeconds })\n .get(`/asset/url/${assetKey}`, routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Generates a presigned URL for accessing an asset by scope and file name\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/asset/url/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{FILE}` or GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/asset/url/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{USER_KEY}/{FILE}`\n *\n * @example\n * import { assetAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const url = await assetAdapter.getURLWithScope('myfile.pdf', {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * });\n *\n * @param file File path/name for the asset\n * @param scope Scope associated with the asset\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [scope.userKey] User key to further scope the asset to a specific user\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.tokenAccessSeconds] How long the presigned URL is valid for in seconds\n * @returns promise that resolves to the presigned URL\n */\nexport async function getURLWithScope(\n file: string,\n scope: AssetScope,\n optionals: {\n tokenAccessSeconds?: number;\n } & RoutingOptions = {},\n): Promise<string> {\n const { scopeBoundary, scopeKey, userKey } = scope;\n const { tokenAccessSeconds, ...routingOptions } = optionals;\n const uriComponent = userKey ? `/${userKey}` : '';\n return await new Router()\n .withSearchParams({ tokenAccessSeconds })\n .get(`/asset/url/with/${scopeBoundary}/${scopeKey}${uriComponent}/${file}`, routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Downloads an asset by asset key\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/asset/download/{ASSET_KEY}`\n *\n * @example\n * import { assetAdapter } from 'epicenter-libs';\n * await assetAdapter.download('0000017dd3bf540e5ada5b1e058f08f20461');\n *\n * @param assetKey The unique key for the asset\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.tokenAccessSeconds] How long the presigned URL is valid for in seconds\n * @returns promise that resolves when the download is complete\n */\nexport async function download(\n assetKey: string,\n optionals: {\n tokenAccessSeconds?: number;\n } & RoutingOptions = {},\n): Promise<void> {\n const { tokenAccessSeconds, ...routingOptions } = optionals;\n return await new Router()\n .withSearchParams({ tokenAccessSeconds })\n .get(`/asset/download/${assetKey}`, routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Downloads an asset by scope and file name\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/asset/download/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{FILE}` or GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/asset/download/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{USER_KEY}/{FILE}`\n *\n * @example\n * import { assetAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * await assetAdapter.downloadWithScope('myfile.pdf', {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * });\n *\n * @param file File path/name for the asset\n * @param scope Scope associated with the asset\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [scope.userKey] User key to further scope the asset to a specific user\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.tokenAccessSeconds] How long the presigned URL is valid for in seconds\n * @returns promise that resolves when the download is complete\n */\nexport async function downloadWithScope(\n file: string,\n scope: AssetScope,\n optionals: {\n tokenAccessSeconds?: number;\n } & RoutingOptions = {},\n): Promise<void> {\n const { scopeBoundary, scopeKey, userKey } = scope;\n const { tokenAccessSeconds, ...routingOptions } = optionals;\n const uriComponent = userKey ? `/${userKey}` : '';\n return await new Router()\n .withSearchParams({ tokenAccessSeconds })\n .get(`/asset/download/with/${scopeBoundary}/${scopeKey}${uriComponent}/${file}`, routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Convenience function to store a file directly to S3. This function obtains a presigned URL from the Epicenter server and uploads the file to S3. If the asset already exists and `overwrite` is true, it will update the existing asset.\n *\n * @example\n * import { assetAdapter, SCOPE_BOUNDARY, ROLE } from 'epicenter-libs';\n * const file = new File(['content'], 'myfile.pdf');\n * await assetAdapter.store(file, {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * }, {\n * overwrite: true,\n * readLock: ROLE.USER,\n * });\n *\n * @param file File object to store\n * @param scope Scope associated with the asset\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [scope.userKey] User key to further scope the asset to a specific user\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.readLock] Role allowed to read; defaults to USER\n * @param [optionals.writeLock] Role allowed to write; defaults to USER\n * @param [optionals.ttlSeconds] Time to live in seconds for the asset\n * @param [optionals.overwrite] If true, will update the asset if it already exists; if false, will throw an error if the asset exists\n * @param [optionals.fileName] Optional file name to use instead of the file's name property\n * @param [optionals.tokenAccessSeconds] How long the presigned URL is valid for in seconds\n * @returns promise that resolves when the file is stored\n */\nconst CONFLICT = 409;\nexport async function store(\n file: File,\n scope: AssetScope,\n optionals: {\n readLock?: keyof typeof ROLE;\n writeLock?: keyof typeof ROLE;\n ttlSeconds?: number;\n overwrite?: boolean;\n fileName?: string;\n tokenAccessSeconds?: number;\n } & RoutingOptions = {},\n): Promise<void> {\n const { overwrite, fileName, ...remaining } = optionals;\n const name = fileName ?? file.name;\n let presignedUrl = '';\n try {\n const response = await create(name, scope, { inert: true, ...remaining });\n presignedUrl = response.url;\n } catch (error) {\n if (error instanceof Fault) {\n const shouldUpdate = error.status === CONFLICT && overwrite;\n if (!shouldUpdate) throw error;\n const response = await update(name, scope, remaining);\n presignedUrl = response.url;\n } else {\n throw error;\n }\n }\n await fetch(presignedUrl, { method: 'PUT', body: file });\n return;\n}\n","import type { RoutingOptions } from '../utils/router';\n\nimport Router from '../utils/router';\n\nexport type Encoding = 'HEX' | 'BASE_64';\n\nexport interface Attachment {\n encoding: Encoding;\n data: string;\n name: string;\n contentType: string;\n}\n\n\n/**\n * Sends an email to an individual user; requires following authentication levels:\n * - /email/user/{groupKey}/{userKey} - PARTICIPANT\n * - /email/user/{groupKey}/{userKey}/from/{from} - REVIEWER\n * - /email/user/{groupKey}/{userKey}/from/{from}/{replyTo} - REVIEWER\n * - /email/user/{groupKey}/{userKey}/as/{fromUserKey} - REVIEWER\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/email/user/{GROUP_KEY}/{USER_KEY}` or POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/email/user/{GROUP_KEY}/{USER_KEY}/from/{FROM}` or POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/email/user/{GROUP_KEY}/{USER_KEY}/from/{FROM}/{REPLY_TO}` or POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/email/user/{GROUP_KEY}/{USER_KEY}/as/{FROM_USER_KEY}`\n *\n * @example\n * import { emailAdapter, authAdapter } from 'epicenter-libs';\n * // Sends an email with a smiley face png attachment\n * const groupKey = authAdapter.getLocalSession().groupKey;\n * const subject = 'check out this drawing!';\n * const emailBody = 'I hope you enjoy this smiley face!';\n * const attachments = [{\n * encoding: 'BASE_64',\n * name: 'testPic',\n * contentType: 'image/png',\n * data: 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAIxJREFUWEdjZBhgwDjA9jMQ5YAvzmb/efaewquWGDXYPDvqgNEQGA2B0RAYGiFAy+KaqBAYdcDICgFQtQryMaHql1qhgjURklu3IzuKWDNwOoCSUCAlFHFmQ2J9gB4VpFgO0kvVZhaplhPlAJgPCSVKciwn6ACY5TDD8aV8Qg7EpXe0KB4NgdEQGA0BAF7VgCFTeobfAAAAAElFTkSuQmCC',\n * }];\n *\n * // Sends an email to the address associated with the provided user key, sender will be seen as \"System\"\n * await emailAdapter.sendEmail(groupKey, '000001796733eef0842f4d6d960997018a3b', subject, emailBody, { attachments });\n * // Sends an email to the address associated with the provided user key, sender will be seen as the address provided by the \"from\" field\n * await emailAdapter.sendEmail(groupKey, '000001796733eef0842f4d6d960997018a3b', subject, emailBody, { attachments, from: 'sender@test.com' });\n * // Sends an email to the address defined at \"replyTo\", sender will be seen as the address provided by the \"from\" field\n * await emailAdapter.sendEmail(groupKey, '000001796733eef0842f4d6d960997018a3b', subject, emailBody, { attachments, from: 'sender@test.com', replyTo: 'receiver@test.com' });\n * // Sends an email to the address associated with the provided user key, sender will be seen as the user associated with the \"fromUserKey\"\n * await emailAdapter.sendEmail(groupKey, '000001796733eef0842f4d6d960997018a3b', subject, emailBody, { attachments, fromUserKey: '000001796733eef0842f4d6d960997018a33' });\n *\n * @param groupKey The groupKey in which the email target user exists\n * @param userKey The unique userKey for the email target user\n * @param subject The subject line for the email.\n * @param emailBody The body for the email\n * @param [optionals] Optional parameters\n * @param [optionals.familyNameFirst] Specifies whether email target's family name will come before their given name. Defaults to false.\n * @param [optionals.html] Whether to treat the body as HTML (true) or as plain text (false). Defaults to false.\n * @param [optionals.from] The email address from which the message will appear to have been sent from. Will be overridden by fromUserKey.\n * @param [optionals.replyTo] The email address that will be replied to by the recipient. Must be used in conjunction with optionals.from.\n * @param [optionals.fromUserKey] The userKey from which the email will appear to have been sent. The default response address will also be this email.\n * @param [optionals.attachments] An array of (binary) objects to include as attachments. All four properties must be included.\n * @param [optionals.attachments[].encoding] A string specifying the encoding method. See ENCODING for possible values.\n * @param [optionals.attachments[].data] A string containing the data for the attachment.\n * @param [optionals.attachments[].name] A string containing the name of the attachment.\n * @param [optionals.attachments[].contentType] A string specifying the attachment MIME Type.\n * @returns undefined indicating success\n */\nexport async function sendEmail(\n groupKey: string,\n userKey: string,\n subject: string,\n emailBody: string,\n optionals: {\n familyNameFirst?: string;\n html?: boolean;\n from?: string;\n replyTo?: string;\n fromUserKey?: string;\n attachments?: Attachment[];\n } & RoutingOptions = {},\n): Promise<void> {\n const {\n accountShortName,\n projectShortName,\n server,\n familyNameFirst,\n html,\n from,\n replyTo,\n fromUserKey,\n attachments,\n ...routingOptions\n } = optionals;\n\n let fromString = '';\n if (fromUserKey) {\n fromString += `/as/${fromUserKey}`;\n } else if (from) {\n fromString += `/from/${from}`;\n if (replyTo) {\n fromString += `/${replyTo}`;\n }\n }\n\n return await new Router()\n .withServer(server)\n .withAccountShortName(accountShortName)\n .withProjectShortName(projectShortName)\n .post(`/email/user/${groupKey}/${userKey}${fromString}`, {\n body: {\n subject,\n body: emailBody,\n familyNameFirst,\n html,\n attachments,\n },\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Sends an email to an individual admin (someone with epicenter account); Requires support level authentication\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/email/admin/{ADMIN_KEY}`\n *\n * @example\n * import { emailAdapter } from 'epicenter-libs';\n * await emailAdapter.sendEmailToAdmin('adminKey123', 'Subject Line', 'Email body content');\n *\n * @param adminKey The unique adminKey for the email target\n * @param subject The subject line for the email.\n * @param emailBody The body for the email\n * @param [optionals] Optional parameters\n * @param [optionals.familyNameFirst] Specifies whether email target's family name will come before their given name. Defaults to false.\n * @param [optionals.html] Whether to treat the body as HTML (true) or as plain text (false). Defaults to false.\n * @param [optionals.attachments] An array of (binary) objects to include as attachments. All four properties must be included.\n * @param [optionals.attachments[].encoding] A string specifying the encoding method. See ENCODING for possible values.\n * @param [optionals.attachments[].data] A string containing the data for the attachment.\n * @param [optionals.attachments[].name] A string containing the name of the attachment.\n * @param [optionals.attachments[].contentType] A string specifying the attachment MIME Type.\n * @returns undefined indicating success\n */\nexport async function sendEmailToAdmin(\n adminKey: string,\n subject: string,\n emailBody: string,\n optionals: {\n familyNameFirst?: string;\n html?: boolean;\n attachments?: Attachment[];\n } & RoutingOptions = {},\n): Promise<void> {\n const {\n accountShortName,\n projectShortName,\n server,\n familyNameFirst,\n html,\n attachments,\n ...routingOptions\n } = optionals;\n\n return await new Router()\n .withServer(server)\n .withAccountShortName(accountShortName)\n .withProjectShortName(projectShortName)\n .post(`/email/admin/${adminKey}`, {\n body: {\n subject,\n body: emailBody,\n familyNameFirst,\n html,\n attachments,\n },\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Sends an email to Epicenter support; Requires participant authentication\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/email/to/support`\n *\n * @example\n * import { emailAdapter } from 'epicenter-libs';\n * await emailAdapter.sendEmailToSupport('Help Request', 'I need assistance with my project');\n *\n * @param subject The subject line for the email.\n * @param emailBody The body for the email\n * @param [optionals] Optional parameters\n * @param [optionals.supportType] A string indicating the type of support request\n * @param [optionals.familyNameFirst] Specifies whether email target's family name will come before their given name. Defaults to false.\n * @param [optionals.html] Whether to treat the body as HTML (true) or as plain text (false). Defaults to false.\n * @param [optionals.attachments] An array of (binary) objects to include as attachments. All four properties must be included.\n * @param [optionals.attachments[].encoding] A string specifying the encoding method. See ENCODING for possible values.\n * @param [optionals.attachments[].data] A string containing the data for the attachment.\n * @param [optionals.attachments[].name] A string containing the name of the attachment.\n * @param [optionals.attachments[].contentType] A string specifying the attachment MIME Type.\n * @returns undefined indicating success\n */\nexport async function sendEmailToSupport(\n subject: string,\n emailBody: string,\n optionals: {\n supportType?: string;\n familyNameFirst?: string;\n html?: boolean;\n attachments?: Attachment[];\n } & RoutingOptions = {},\n): Promise<void> {\n const {\n accountShortName,\n projectShortName,\n server,\n supportType,\n familyNameFirst,\n html,\n attachments,\n ...routingOptions\n } = optionals;\n\n return await new Router()\n .withServer(server)\n .withAccountShortName(accountShortName)\n .withProjectShortName(projectShortName)\n .withSearchParams({ supportType })\n .post('/email/to/support', {\n body: {\n subject,\n body: emailBody,\n familyNameFirst,\n html,\n attachments,\n },\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n","import type { UserSession } from '../utils/identification';\nimport type { GenericSearchOptions } from '../utils/constants';\nimport type { RoutingOptions, Page } from '../utils/router';\n\nimport { Router, identification, parseFilterInput } from '../utils';\n\nexport interface EpisodeReadOutView {\n name: string;\n episodeKey: string;\n created: string;\n lastUpdated: string;\n runLimit: number;\n draft: boolean;\n category: string;\n}\n\n\n/**\n * Create an episode.\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/episode/{GROUP_NAME}`\n *\n * @example\n * import { episodeAdapter } from 'epicenter-libs';\n * const episode = await episodeAdapter.create('myEpisode', 'myGroupName', {\n * runLimit: 20,\n * draft: true,\n * });\n *\n * @param name Episode name\n * @param groupName Group to make the episode under\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.draft] Flag to indicate the episode is a draft (intended when used for settings scoping)\n * @param [optionals.runLimit] Optional argument to define the number of runs that can be made using this episode as the scope\n * @param [optionals.category] Optional argument to allow for establishing episode hierarchies\n * @returns promise that resolves to the newly created episode\n */\nexport async function create(\n name: string,\n groupName: string,\n optionals: {\n draft?: boolean;\n runLimit?: number;\n category?: string;\n } & RoutingOptions = {},\n): Promise<EpisodeReadOutView> {\n const {\n draft, runLimit, category,\n ...routingOptions\n } = optionals;\n return await new Router()\n .post(`/episode/${groupName}`, {\n body: { name, draft, runLimit, category },\n ...routingOptions,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Gets a specific episode.\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/episode/{EPISODE_KEY}`\n *\n * @example\n * import { episodeAdapter } from 'epicenter-libs';\n * const episode = await episodeAdapter.get('000001796733eef0842f4d6d960997018a37');\n *\n * @param episodeKey The episode key\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to an episode\n */\nexport async function get(\n episodeKey: string,\n optionals: RoutingOptions = {},\n): Promise<EpisodeReadOutView> {\n return await new Router()\n .get(`/episode/${episodeKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Gets episodes.\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/episode/search`\n *\n * @example\n * import { episodeAdapter } from 'epicenter-libs';\n * const filter = [\n * 'name|=one|two', // searches only for episodes named 'one' or 'two'\n * 'draft=false', // searches only for episodes that aren't drafts\n * 'created>=2022-01-03T20:30:53.054Z', // looks for any episodes created after Jan 3rd 2022\n * 'account.shortName=acme', // specifies the account, intended for admin use\n * 'project.shortName=simulations', // specifies the project, intended for admin use\n * 'group.name=my-group-name', // specifies a group name, intended for admin use\n * 'group.groupKey=0000017dd3bf540e5ada5b1e058f08f20461', // specifies a group key, intended for admin use\n * ];\n * const episodes = await episodeAdapter.query({\n * filter,\n * sort: ['+episode.created'], // sort all findings by the 'created' field (ascending)\n * first: 3, // page should start with the 4th item found (will default to 0)\n * max: 10, // page should only include the first 10 items\n * });\n *\n * @param searchOptions Search options for the query\n * @param [searchOptions.filter] Filters for searching\n * @param [searchOptions.sort] Sorting criteria\n * @param [searchOptions.first] The starting index of the page returned\n * @param [searchOptions.max] The number of entries per page\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a page of episodes\n */\nexport async function query(\n searchOptions: GenericSearchOptions,\n optionals: RoutingOptions = {},\n): Promise<Page<EpisodeReadOutView>> {\n const { filter, sort = [], first = 0, max } = searchOptions;\n\n return await new Router()\n .withSearchParams({\n filter: parseFilterInput(filter),\n sort: sort.join(';') || undefined,\n first, max,\n })\n .get('/episode/search', {\n paginated: true,\n ...optionals,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Gets episodes based on a group key\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/episode/in/{GROUP_KEY}`\n *\n * @example\n * import { episodeAdapter } from 'epicenter-libs';\n * const episodes = await episodeAdapter.forGroup('0000017dd3bf540e5ada5b1e058f08f20461');\n *\n * @param groupKey The group key\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise resolving to a list of episodes\n */\nexport async function forGroup(\n groupKey: string,\n optionals: RoutingOptions = {},\n): Promise<EpisodeReadOutView[]> {\n return await new Router()\n .get(`/episode/in/${groupKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Gets episode based on group name and episode name\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/episode/with/{GROUP_NAME}/{EPISODE_NAME}`\n *\n * @example\n * import { episodeAdapter } from 'epicenter-libs';\n * const episode = await episodeAdapter.withName('myEpisodeName');\n *\n * @param name The episode name\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.groupName] Name of the group, if omitted will use the group name associated with the current session\n * @returns promise that resolves to an episode\n */\nexport async function withName(\n name: string,\n optionals: { groupName?: string } & RoutingOptions = {},\n): Promise<EpisodeReadOutView> {\n const {\n groupName,\n ...routingOptions\n } = optionals;\n\n const session = identification.session as UserSession;\n return await new Router()\n .get(`/episode/with/${groupName ?? session?.groupName}/${name}`, routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Deletes an episode\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/episode/{EPISODE_KEY}`\n *\n * @example\n * import { episodeAdapter } from 'epicenter-libs';\n * await episodeAdapter.remove('000001796733eef0842f4d6d960997018a3b');\n *\n * @param episodeKey The episode key\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to undefined if successful\n */\nexport async function remove(\n episodeKey: string,\n optionals: RoutingOptions = {},\n): Promise<void> {\n return await new Router()\n .delete(`/episode/${episodeKey}`, optionals)\n .then(({ body }) => body);\n}\n","import type { UserSession, Session } from '../utils/identification';\nimport type { RoutingOptions, Page } from '../utils/router';\nimport type { GenericSearchOptions } from '../utils/constants';\nimport type { PseudonymReadOutView } from './user';\n\nimport { Router, EpicenterError, identification, ROLE, parseFilterInput } from '../utils';\n\nexport type Augment = 'MEMBERS' | 'QUANTIZED';\nexport type SalesChannel = 'TEAM' | 'TEST' | 'FORIO' | 'HBP_HIGHER_ED' | 'HBP_CL';\n\nexport interface Status {\n code?: string;\n message?: string;\n}\n\nexport interface StripePaymentCreateInView {\n description: string;\n token: string;\n objectType: 'stripe';\n}\n\nexport interface Pricing {\n amount?: number;\n}\n\nexport interface FlightRecorderReadOutView {\n enabled?: boolean;\n start?: number;\n stop?: number;\n}\n\nexport interface FlightRecorderCreateInView {\n enabled: boolean;\n stop: number;\n start?: number;\n}\n\nexport interface FlightRecorderUpdateInView {\n enabled?: boolean;\n start?: number;\n stop?: number;\n}\n\nexport interface GroupReadOutView {\n groupKey: string;\n name: string;\n members?: GroupPermissionReadOutView[];\n creator?: string;\n created?: string;\n lastUpdated?: string;\n tombstone?: string;\n capacity?: number;\n runLimit?: number;\n approximateMemberCount?: number;\n startDate?: string;\n expirationDate?: string;\n terminationDate?: string;\n allowSelfRegistration?: boolean;\n allowMembershipChanges?: boolean;\n allowChannel?: boolean;\n demonstration?: boolean;\n perpetual?: boolean;\n reference?: string;\n organization?: string;\n event?: string;\n salesChannel?: SalesChannel;\n status?: Status;\n pricing?: Pricing;\n flightRecorder?: FlightRecorderReadOutView;\n}\n\nexport interface GroupPermissionReadOutView {\n objectType: 'group';\n role?: string;\n available?: boolean;\n user: PseudonymReadOutView;\n}\n\nexport interface GroupPermissionCreateInView {\n userKey: string;\n role: string;\n available?: boolean;\n payment?: StripePaymentCreateInView;\n}\n\ntype UserInput = string | GroupPermissionCreateInView;\n\n// Aliases for backward compatibility\nexport type Group = GroupReadOutView;\nexport type Member = GroupPermissionReadOutView;\n\nexport interface SelfRegistrationResult {\n redirectUrl: string;\n whoAmI: Session;\n}\n\n\n/**\n * Provides information on a particular Epicenter group.\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/{GROUP_KEY}` or GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/member/{GROUP_KEY}` or GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/quantized/{GROUP_KEY}`\n *\n * @example\n * import { authAdapter, groupAdapter } from 'epicenter-libs';\n * const session = authAdapter.getLocalSession();\n * // include members of the group in the response\n * const group = await groupAdapter.get({ groupKey: session.groupKey, augment: 'MEMBERS' });\n * // include metrics relating to the group in the response\n * const group = await groupAdapter.get({ groupKey: session.groupKey, augment: 'QUANTIZED' });\n *\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.augment] Specifies which additional information you'd like returned with the group\n * @param [optionals.groupKey] Group key; if omitted will attempt to use the group associated with the current session\n * @returns promise that resolves to a group\n */\nexport async function get(\n optionals: {\n augment?: Augment;\n groupKey?: string;\n } & RoutingOptions = {},\n): Promise<GroupReadOutView> {\n const {\n groupKey,\n augment,\n ...routingOptions\n } = optionals;\n let uriComponent = '';\n if (augment === 'MEMBERS') uriComponent = '/member';\n if (augment === 'QUANTIZED') uriComponent = '/quantized';\n const session = identification.session as UserSession;\n\n return await new Router()\n .get(`/group${uriComponent}/${groupKey ?? session?.groupKey}`, routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Deletes the group; available only to Epicenter admins\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/{GROUP_KEY}`\n *\n * @example\n * import { groupAdapter } from 'epicenter-libs';\n * await groupAdapter.destroy('0000017dd3bf540e5ada5b1e058f08f20461');\n *\n * @param groupKey Key associated with group\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to undefined if successful\n */\nexport async function destroy(\n groupKey: string,\n optionals: RoutingOptions = {},\n): Promise<void> {\n return await new Router()\n .delete(`/group/${groupKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Provides information for all groups in the project\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group`\n *\n * @example\n * import { groupAdapter } from 'epicenter-libs';\n * const groups = await groupAdapter.gather();\n *\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.includeExpired] Indicates whether to include expired groups in the query\n * @returns promise that resolves to a list of groups\n */\nexport async function gather(\n optionals: { includeExpired?: boolean } & RoutingOptions = {},\n): Promise<GroupReadOutView[]> {\n const {\n includeExpired,\n ...routingOptions\n } = optionals;\n\n return await new Router()\n .withSearchParams({ includeExpired })\n .get('/group', routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Updates fields for a particular group; available only to Epicenter admins\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/{GROUP_KEY}`\n *\n * @example\n * import { groupAdapter } from 'epicenter-libs';\n * await groupAdapter.update('0000017dd3bf540e5ada5b1e058f08f20461', { event: 'Orientation Day' });\n *\n * @param groupKey Key associated with group\n * @param update Attributes you wish to update\n * @param [update.runLimit] Defines the upper limit of runs allowed in the group\n * @param [update.organization] Name of the organization owning the group\n * @param [update.allowSelfRegistration] Whether users can register to join the group without being invited\n * @param [update.flightRecorder] Diagnostic tool for logging HTTP requests for the server\n * @param [update.flightRecorder.start] Start time (epoch time)\n * @param [update.flightRecorder.stop] End time (epoch time)\n * @param [update.flightRecorder.enabled] Enabled flag for the flight recorder\n * @param [update.event] Name of the event the group is playing for\n * @param [update.allowMembershipChanges] Locks the group so members cannot be added and member permissions cannot be changed\n * @param [update.pricing] Group pricing information\n * @param [update.pricing.amount] Amount (in cents) for user signup\n * @param [update.startDate] Start date for group event\n * @param [update.expirationDate] Date the group expires\n * @param [update.capacity] Defines the upper limit on the number of users allowed in the group\n * @param [update.allowChannel] Opt into push notifications for this resource; applicable to projects with phylogeny >= SILENT\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the updated group\n */\nexport async function update(\n groupKey: string,\n update: {\n tombstone?: string;\n capacity?: number;\n runLimit?: number;\n perpetual?: boolean;\n salesChannel?: SalesChannel;\n reference?: string;\n organization?: string;\n event?: string;\n allowSelfRegistration?: boolean;\n allowMembershipChanges?: boolean;\n allowChannel?: boolean;\n demonstration?: boolean;\n startDate?: string;\n expirationDate?: string;\n terminationDate?: string;\n status?: Status;\n pricing?: Pricing;\n flightRecorder?: FlightRecorderUpdateInView;\n },\n optionals: RoutingOptions = {},\n): Promise<GroupReadOutView> {\n const {\n runLimit,\n organization,\n allowSelfRegistration,\n flightRecorder,\n event,\n allowMembershipChanges,\n pricing,\n startDate,\n expirationDate,\n capacity,\n allowChannel,\n } = update;\n\n return await new Router()\n .patch(`/group/${groupKey}`, {\n body: {\n runLimit,\n organization,\n allowSelfRegistration,\n flightRecorder,\n event,\n allowMembershipChanges,\n pricing,\n startDate,\n expirationDate,\n capacity,\n allowChannel,\n },\n ...optionals,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Creates a new group; available only to Epicenter admins\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group`\n *\n * @example\n * import { groupAdapter } from 'epicenter-libs';\n * const group = await groupAdapter.create({\n * runLimit: 10,\n * name: 'my-group-name',\n * });\n *\n * @param group Group object\n * @param group.name Group name (required)\n * @param [group.runLimit] Defines the upper limit on the number of runs allowed in the group\n * @param [group.organization] Name of the organization owning the group\n * @param [group.allowSelfRegistration] Whether users can register to join the group without being invited\n * @param [group.flightRecorder] Diagnostic tool for logging HTTP requests for the server\n * @param [group.flightRecorder.start] Start time (epoch time)\n * @param [group.flightRecorder.stop] End time (epoch time)\n * @param [group.flightRecorder.enabled] Enabled flag for the flight recorder\n * @param [group.event] Name of the event the group is playing for\n * @param [group.allowMembershipChanges] Locks the group so members cannot be added and member permissions cannot be changed\n * @param [group.pricing] Group pricing information\n * @param [group.pricing.amount] Amount (in cents) for user signup\n * @param [group.startDate] Start date for group event\n * @param [group.expirationDate] Date the group expires\n * @param [group.capacity] Defines the upper limit on the number of users allowed in the group\n * @param [group.allowChannel] Opt into push notifications for this resource; applicable to projects with phylogeny >= SILENT\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the newly created group\n */\nexport async function create(\n group: {\n name: string;\n capacity?: number;\n runLimit?: number;\n allowSelfRegistration?: boolean;\n allowMembershipChanges?: boolean;\n allowChannel?: boolean;\n perpetual?: boolean;\n demonstration?: boolean;\n startDate?: string;\n expirationDate?: string;\n terminationDate?: string;\n reference?: string;\n organization?: string;\n event?: string;\n salesChannel?: SalesChannel;\n status?: Status;\n pricing?: Pricing;\n flightRecorder?: FlightRecorderCreateInView;\n },\n optionals: RoutingOptions = {},\n): Promise<GroupReadOutView> {\n const {\n name,\n runLimit,\n organization,\n allowSelfRegistration,\n flightRecorder,\n event,\n allowMembershipChanges,\n pricing,\n startDate,\n expirationDate,\n capacity,\n allowChannel,\n } = group;\n if (!name) throw new EpicenterError('Cannot create a group with no name');\n return await new Router()\n .post('/group', {\n body: {\n name,\n runLimit,\n organization,\n allowSelfRegistration,\n flightRecorder,\n event,\n allowMembershipChanges,\n pricing,\n startDate,\n expirationDate,\n capacity,\n allowChannel,\n },\n ...optionals,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Queries for groups\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/search` or GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/quantized/search`\n *\n * @example\n * import { groupAdapter } from 'epicenter-libs';\n * const filter = [\n * 'name|=group1|group2', // look for groups whose name is 'group1' or 'group2'\n * 'groupKey=0000017dd3bf540e5ada5b1e058f08f20461', // look for groups with the specific group key\n * 'approximateMemberCount>30', // look for groups larger than 30\n * 'startDate<2022-01-03T20:30:53.054Z', // look for groups with start date before Jan 3rd 2022\n * 'expirationDate<2022-01-03T20:30:53.054Z', // look for groups with expiration date before Jan 3rd 2022\n * // 'account.shortName=acme', // specifies account, intended for admin use\n * // 'project.shortName=simulations', // specifies project, intended for admin use\n * ];\n * const page = await groupAdapter.query({\n * filter,\n * sort: ['+group.name'], // sort all findings by group name ascending (lexicographically)\n * first: 3, // page should start with the 4th item found (will default to 0)\n * max: 10, // page should only include the first 10 items\n * });\n *\n * @param searchOptions Search options for the query\n * @param [searchOptions.filter] Filters for searching\n * @param [searchOptions.sort] Sorting criteria\n * @param [searchOptions.first] The starting index of the page returned\n * @param [searchOptions.max] The number of entries per page\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a page of groups\n */\nexport async function query(\n searchOptions: { quantized?: boolean } & GenericSearchOptions,\n optionals: RoutingOptions = {},\n): Promise<Page<GroupReadOutView>> {\n const { filter, sort = [], first, max, quantized } = searchOptions;\n\n const searchParams = {\n filter: parseFilterInput(filter),\n sort: sort.join(';') || undefined,\n first, max,\n };\n\n return await new Router()\n .withSearchParams(searchParams)\n .get(`/group${quantized ? '/quantized' : ''}/search`, {\n paginated: true,\n ...optionals,\n })\n .then(({ body }) => body);\n}\n/** DEPRECATED -- use groupAdapter.query instead */\nexport async function search(\n optionals: { quantized?: boolean } & GenericSearchOptions & RoutingOptions = {},\n): Promise<Page<GroupReadOutView>> {\n console.warn('DEPRECATION WARNING: groupAdapter.search is deprecated and will be removed with the next release. Use groupAdapter.query instead.');\n const { filter = [], sort = [], first, max, quantized, ...routingOptions } = optionals;\n const searchOptions = { filter, sort, first, max, quantized };\n return await query(searchOptions, routingOptions);\n}\n\n\n/**\n * Retrieves a group with given group name\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/with/{NAME}`\n *\n * @example\n * import { groupAdapter } from 'epicenter-libs';\n * const group = await groupAdapter.withGroupName('my-group-name');\n *\n * @param name Name associated with the group\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a group\n */\nexport async function withGroupName(\n name: string,\n optionals: RoutingOptions = {},\n): Promise<GroupReadOutView> {\n return await new Router()\n .get(`/group/with/${name}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Retrieves the list of groups a particular user is in; intended for admin use\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/member/for/{USER_KEY}`\n *\n * @example\n * import { groupAdapter } from 'epicenter-libs';\n * const groups = await groupAdapter.forUser(\n * '000001796733eef0842f4d6d960997018a3b', // get groups where this user is a member of\n * { role: ['FACILITATOR'] } // where this user is a facilitator in the group\n * );\n *\n * @param userKey User key associated with the user\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.includeExpired] Indicates whether to include expired groups in the query\n * @param [optionals.includeAllMembers] Indicates whether to include the other members in the group (by default, only the requested user appears)\n * @param [optionals.role] Role or list of possible roles the user holds in the group\n * @returns promise that resolves to a list of groups\n */\nexport async function forUser(\n userKey: string,\n optionals: {\n includeAllMembers?: boolean;\n includeExpired?: boolean;\n role?: string | string[];\n } & RoutingOptions = {},\n): Promise<GroupReadOutView[]> {\n const {\n includeExpired,\n includeAllMembers,\n role,\n ...routingOptions\n } = optionals;\n const isMultiple = Array.isArray(role) && role.length > 0;\n const roleList = isMultiple ? role : [role];\n const searchParams = {\n includeExpired,\n includeAllMembers,\n role: role ? roleList : undefined,\n };\n\n return await new Router()\n .withSearchParams(searchParams)\n .get(`/group/member/for/${userKey}`, routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Retrieves the list of groups particular to the current session\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/member`\n *\n * @example\n * import { groupAdapter } from 'epicenter-libs';\n * const groups = await groupAdapter.getSessionGroups();\n *\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.includeExpired] Indicates whether to include expired groups in the query\n * @param [optionals.includeAllMembers] Indicates whether to include the other members in the group (by default, only the requested user appears)\n * @param [optionals.role] Role or list of possible roles the user holds in the group\n * @returns promise that resolves to a list of groups\n */\nexport async function getSessionGroups(\n optionals: {\n includeAllMembers?: boolean;\n includeExpired?: boolean;\n role?: string | string[];\n } & RoutingOptions = {},\n): Promise<GroupReadOutView[]> {\n const {\n includeExpired,\n role,\n ...routingOptions\n } = optionals;\n const isMultiple = Array.isArray(role) && role.length > 0;\n const roleList = isMultiple ? role : [role];\n const searchParams = {\n includeExpired,\n role: role ? roleList : undefined,\n };\n\n return await new Router()\n .withSearchParams(searchParams)\n .get('/group/member', routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Permits a list of users to self-register for membership in a group; will only work if the group has allowSelfRegistration set to true\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/self/{GROUP_KEY}`\n *\n * @example\n * import { groupAdapter } from 'epicenter-libs';\n * await groupAdapter.whitelistUsers('0000017dd3bf540e5ada5b1e058f08f20461', {\n * allow: true,\n * emails: ['user1@test.com', 'user2@test.com'],\n * });\n *\n * @param groupKey Key associated with group\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.allow] Whether to allow or disallow self-registration for the specified users; defaults to true if unset\n * @param [optionals.emails] List of emails to allow or disallow; a value of \"*\" is interpreted as all users; defaults to all users if unset\n * @returns promise that resolves to undefined (indicating success)\n */\nexport async function whitelistUsers(\n groupKey: string,\n optionals: {\n allow?: boolean;\n emails?: string[];\n } & RoutingOptions = {},\n): Promise<void> {\n const {\n allow = true,\n emails = ['*'],\n ...routingOptions\n } = optionals;\n\n return await new Router()\n .post(`/group/self/${groupKey}`, {\n body: {\n allow,\n emails,\n },\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Retrieves a list of users allowed to self-register for membership in a group with a given groupKey\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/self/{GROUP_KEY}`\n *\n * @example\n * import { groupAdapter } from 'epicenter-libs';\n * const users = await groupAdapter.getWhitelistedUsers('0000017dd3bf540e5ada5b1e058f08f20461');\n *\n * @param groupKey Key associated with the group\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a list of users\n */\nexport async function getWhitelistedUsers(\n groupKey: string,\n optionals: RoutingOptions = {},\n): Promise<PseudonymReadOutView[]> {\n return await new Router()\n .get(`/group/self/${groupKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Sends an email to the specified email address with a link to complete self-registration for a group\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/self/{GROUP_KEY}`\n *\n * @example\n * import { groupAdapter } from 'epicenter-libs';\n * await groupAdapter.sendRegistrationEmail('0000017dd3bf540e5ada5b1e058f08f20461', 'user1@test.com', {\n * redirectURL: '/login',\n * linkURL: '/register',\n * subject: 'Complete your registration!',\n * });\n *\n * @param groupKey Key associated with group\n * @param email Email address to send the link to\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.linkURL] Relative path to link sent in email to complete registration (<forio scheme>://<forio host>/app/<account>/<project><linkURL>)\n * @param [optionals.redirectURL] Relative path to redirect to after completing registration (<forio scheme>://<forio host>/app/<account>/<project><redirectURL>)\n * @param [optionals.subject] The subject of the email that will be sent\n * @returns promise that resolves to undefined (indicating success)\n */\nexport async function sendRegistrationEmail(\n groupKey: string,\n email: string,\n optionals: {\n linkURL?: string;\n redirectURL?: string;\n subject?: string;\n } & RoutingOptions = {},\n): Promise<void> {\n const {\n redirectURL,\n linkURL,\n subject,\n ...routingOptions\n } = optionals;\n\n return await new Router()\n .post(`/registration/self/${groupKey}`, {\n body: {\n email,\n linkUrl: linkURL,\n redirectUrl: redirectURL,\n subject,\n },\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Finalizes a user's self-registration process for a group; requires the project to have deployment.autoCreatePlayer set to true\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/self/{TOKEN}`\n *\n * @example\n * import { groupAdapter } from 'epicenter-libs';\n * const result = await groupAdapter.selfRegister('myregistrationtoken', 'pass', {\n * displayName: 'My Display Name',\n * givenName: 'Leonard',\n * familyName: 'Nimoy',\n * handle: 'the_real_spock',\n * });\n *\n * @param token Registration token\n * @param password Password the user would use to log in\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.displayName] Display name chosen by user\n * @param [optionals.givenName] User's given name\n * @param [optionals.familyName] User's family name\n * @param [optionals.handle] Handle the user would use to log in; defaults to email address if not specified\n * @returns promise resolving to an object containing the redirect URL and the session\n */\nexport async function selfRegister(\n token: string,\n password: string,\n optionals: {\n displayName?: string;\n givenName?: string;\n familyName?: string;\n handle?: string;\n } & RoutingOptions = {},\n): Promise<SelfRegistrationResult> {\n const {\n displayName,\n givenName,\n familyName,\n handle,\n ...routingOptions\n } = optionals;\n\n return await new Router()\n .patch(`/registration/self/${token}`, {\n body: {\n password,\n displayName,\n givenName,\n familyName,\n handle,\n },\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Adds user(s) to the group\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/member/{GROUP_KEY}`\n *\n * @example\n * import { groupAdapter } from 'epicenter-libs';\n * await groupAdapter.addUser('000001796733eef0842f4d6d960997018a3b');\n * await groupAdapter.addUser([{\n * userKey: '000001796733eef0842f4d6d960997018a3b',\n * role: 'REVIEWER',\n * available: false,\n * }]);\n *\n * @param usersInput List of user keys or user input objects (properties defined below)\n * @param usersInput[].userKey User key\n * @param [usersInput[].role] User's role; defaults to PARTICIPANT if unset; See [ROLE](#ROLE) for all types\n * @param [usersInput[].available] Indicates whether or not the user is 'active' (for semantic labeling); defaults to true if unset\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.groupKey] Group key to indicate the group; will default to the group key associated with the current session\n * @returns promise that resolves to the group the user was added to\n */\nexport async function addUser(\n usersInput: UserInput | UserInput[],\n optionals: { groupKey?: string } & RoutingOptions = {},\n): Promise<GroupReadOutView> {\n const { groupKey, ...routingOptions } = optionals;\n\n const users = Array.isArray(usersInput) ? usersInput : [usersInput];\n const session = identification.session as UserSession;\n return await new Router()\n .post(`/group/member/${groupKey ?? session?.groupKey}`, {\n body: users.map((u) => {\n const userKey = typeof u === 'string' ? u : u.userKey;\n const role = typeof u === 'string' ? ROLE.PARTICIPANT : u.role;\n const available = typeof u === 'string' ? true : u.available;\n\n return {\n role,\n userKey,\n objectType: 'group',\n available: available ?? true,\n };\n }),\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Updates a user's group membership information\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/member/{GROUP_KEY}/{USER_KEY}`\n *\n * @example\n * import { groupAdapter } from 'epicenter-libs';\n * const group = await groupAdapter.updateUser('000001796733eef0842f4d6d960997018a3b', { role: 'LEADER' });\n *\n * @param userKey User key\n * @param update Object containing the updates to a user's group membership information\n * @param [update.role] User's role; See [ROLE](#ROLE) for all types\n * @param [update.available] Indicates whether or not the user is 'active' (for semantic labeling)\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.groupKey] Group key; defaults to the group key associated with the current session\n * @returns promise that resolves to the membership information that was updated\n */\nexport async function updateUser(\n userKey: string,\n update: {\n role?: string;\n available?: boolean;\n },\n optionals: { groupKey?: string } & RoutingOptions = {},\n): Promise<GroupReadOutView> {\n const { role, available } = update;\n const { groupKey, ...routingOptions } = optionals;\n const session = identification.session as UserSession;\n return await new Router()\n .patch(`/group/member/${groupKey ?? session?.groupKey}/${userKey}`, {\n body: {\n objectType: 'group',\n role,\n available,\n },\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Removes user(s) from the group\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/member/{GROUP_KEY}/{USER_KEY}` or DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/member/{GROUP_KEY}` (for multiple users)\n *\n * @example\n * import { groupAdapter } from 'epicenter-libs';\n * const userKeys = members.map(({ userKey }) => userKey);\n * await groupAdapter.removeUser(userKeys);\n *\n * @param userKey Key associated with the user or an array of user keys to remove from group\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.groupKey] Group key for the group you want to remove from; defaults to the group in the current session\n * @returns promise that resolves to undefined when successful\n */\nexport async function removeUser(\n userKey: string | string[],\n optionals: { groupKey?: string } & RoutingOptions = {},\n): Promise<void> {\n const { groupKey, ...routingOptions } = optionals;\n const hasMultiple = Array.isArray(userKey) && userKey.length > 1;\n const uriComponent = hasMultiple ? '' : `/${userKey.length === 1 ? userKey[0] : userKey}`;\n const searchParams = hasMultiple ? { userKey } : undefined;\n const session = identification.session as UserSession;\n return await new Router()\n .withSearchParams(searchParams)\n .delete(`/group/member/${groupKey ?? session?.groupKey}${uriComponent}`, routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Updates the status of a group\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/status/{GROUP_KEY}`\n *\n * @example\n * import { groupAdapter } from 'epicenter-libs';\n * const group = await groupAdapter.statusUpdate('active', 'Group is currently active');\n *\n * @param code Status code\n * @param message Status message\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.groupKey] Group key; defaults to the group key associated with the current session\n * @returns promise that resolves to the updated group\n */\nexport async function statusUpdate(\n code: string,\n message: string,\n optionals: { groupKey?: string } & RoutingOptions = {},\n): Promise<GroupReadOutView> {\n const { groupKey, ...routingOptions } = optionals;\n const session = identification.session as UserSession;\n return await new Router()\n .patch(`/group/status/${groupKey ?? session?.groupKey}`, {\n body: { code, message },\n ...routingOptions,\n }).then(({ body }) => body);\n}\n","import type { UserSession } from '../utils/identification';\nimport type { RoutingOptions } from '../utils/router';\nimport type { GenericScope, GenericSearchOptions } from '../utils/constants';\n\nimport { identification, Router, parseFilterInput } from '../utils';\n\n\nexport interface Score {\n name: string;\n quantity: number;\n}\n\nexport interface Tag {\n label: string;\n content: string;\n}\n\nexport interface Leaderboard {\n lastUpdated: Date;\n scores: Score[];\n scope: { userKey?: string } & GenericScope;\n collection: string;\n tags: Tag[];\n}\n\n\n/**\n * Creates a leaderboard entry.\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/leaderboard`\n *\n * @example\n * import { leaderboardAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const leaderboard = await leaderboardAdapter.update(\n * 'class-23-leaderboard',\n * { scopeBoundary: SCOPE_BOUNDARY.GROUP, scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461' },\n * [{ name: 'total', quantity: 20 }, { name: 'extraCredit', quantity: 2 }],\n * { tags: [{ label: 'role', content: 'doctor' }] }\n * );\n *\n * @param collection Name of the leaderboard\n * @param scope Scope attached to the leaderboard entry; allows for scoping\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [scope.userKey] User key for the user creating the entry; if omitted will use the one in current session\n * @param scores List of score objects\n * @param scores[].name Name of the score\n * @param scores[].quantity Value of the score\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.tags] Tags for the leaderboard entry; helps to provide another layer of scope if needed\n * @param [optionals.allowChannel] If true, allows channel notifications for this update\n * @returns promise that resolves to the leaderboard entry created\n */\nexport async function update(\n collection: string,\n scope: { userKey?: string } & GenericScope,\n scores: Score[],\n optionals: {\n tags?: Tag[];\n allowChannel?: boolean;\n } & RoutingOptions = {},\n): Promise<Leaderboard> {\n const { tags, allowChannel, ...routingOptions } = optionals;\n const { scopeBoundary, scopeKey, userKey } = scope;\n const session = identification.session as UserSession;\n return await new Router()\n .post('/leaderboard', {\n body: {\n scope: {\n scopeBoundary,\n scopeKey,\n userKey: userKey ?? session?.userKey,\n },\n collection,\n scores,\n tags,\n allowChannel,\n },\n ...routingOptions,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Gathers leaderboard information; not paginable (hence named 'list' and not 'query')\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/leaderboard/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{COLLECTION}`\n *\n * @example\n * import { leaderboardAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const leaderboard = await leaderboardAdapter.list('myLeaderboard', {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: 'GROUP_KEY',\n * }, {\n * filter: [\n * 'tag.role=doctor', // look for leaderboard entries tagged with role=doctor\n * 'score.total>0' // where the users scored a total higher than 0\n * ],\n * sort: ['+score.total'], // sort results by 'total' in ascending order\n * first: 0,\n * max: 20 // retrieve only the first 20 entries\n * });\n *\n * @param collection Name of the leaderboard\n * @param scope Scope attached to the leaderboard entry; allows for scoping\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param searchOptions Search options for the query\n * @param [searchOptions.filter] Filters for searching\n * @param [searchOptions.sort] Sorting criteria\n * @param [searchOptions.first] The starting index of the list returned\n * @param [searchOptions.max] The maximum number of entries in the list\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a list of leaderboard entries\n */\nexport async function list(\n collection: string,\n scope: GenericScope,\n searchOptions: GenericSearchOptions,\n optionals: RoutingOptions = {},\n): Promise<Leaderboard[]> {\n const { scopeBoundary, scopeKey } = scope;\n const { filter, sort = [], first, max } = searchOptions;\n const searchParams = {\n filter: parseFilterInput(filter),\n sort: sort.join(';') || undefined,\n first, max,\n };\n\n return await new Router()\n .withSearchParams(searchParams)\n .get(`/leaderboard/${scopeBoundary}/${scopeKey}/${collection}`, optionals)\n .then(({ body }) => body);\n}\n\nexport async function get(\n collection: string,\n scope: GenericScope,\n searchOptions: GenericSearchOptions,\n optionals: RoutingOptions = {},\n): Promise<Leaderboard[]> {\n console.warn('DEPRECATION WARNING: leaderboardAdapter.get is deprecated and will be removed with the next release. Use leaderboardAdapter.list instead.');\n return await list(collection, scope, searchOptions, optionals);\n}\n\n\n/**\n * Returns the total count in the given collection\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/leaderboard/count/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{COLLECTION}`\n *\n * @example\n * import { leaderboardAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const count = await leaderboardAdapter.getCount('myLeaderboard', {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * }, {\n * filter: [\n * 'tag.role=doctor', // look for leaderboard entries tagged with role=doctor\n * 'score.total>0' // where the users scored a total higher than 0\n * ],\n * });\n *\n * @param collection Name of the leaderboard\n * @param scope Scope attached to the leaderboard entry; allows for scoping\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param searchOptions Search options for the query\n * @param [searchOptions.filter] Filters for searching\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the number of entries in the leaderboard\n */\nexport async function getCount(\n collection: string,\n scope: GenericScope,\n searchOptions: GenericSearchOptions,\n optionals: RoutingOptions = {},\n): Promise<number> {\n const { scopeBoundary, scopeKey } = scope;\n const { filter } = searchOptions;\n const searchParams = {\n filter: parseFilterInput(filter),\n };\n\n return await new Router()\n .withSearchParams(searchParams)\n .get(`/leaderboard/count/${scopeBoundary}/${scopeKey}/${collection}`, optionals)\n .then(({ body }) => body);\n}\n","import type { RoutingOptions } from '../utils/router';\nimport type { PseudonymReadOutView } from './user';\n\nimport { Router, identification, GROUP_ROLE } from '../utils';\nimport cometdAdapter from './cometd';\n\n\nexport interface Presence {\n lastUpdated: number;\n ttlSeconds: number;\n groupRole: keyof typeof GROUP_ROLE;\n user: PseudonymReadOutView;\n}\n\n\n/**\n * Makes a connection request to the CometD server; effectively marking the user as online.\n * This isn't required to be called in order to be considered online. Subscribe to a CometD\n * channel will do the same as well. This is just a convenience method for when you don't\n * need to utilize the channels except specifically for presence.\n * Using [logout](#authAdapter-logout) will automatically disconnect for you.\n * Base URL: Uses CometD push channel connection\n *\n * @example\n * import { presenceAdapter } from 'epicenter-libs';\n * await presenceAdapter.connect();\n *\n * @returns promise indicating whether or not the connection was successful\n */\nexport async function connect(): Promise<void> {\n await cometdAdapter.handshake();\n return;\n}\n\n\n/**\n * Disconnects from CometD and removes user presence.\n * Using [logout](#authAdapter-logout) will automatically disconnect for you.\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/presence/group/{GROUP_KEY}`\n *\n * @example\n * import { presenceAdapter } from 'epicenter-libs';\n * await presenceAdapter.disconnect();\n *\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise indicating whether or not the disconnection was successful\n */\nexport async function disconnect(optionals: RoutingOptions): Promise<void> {\n const cleanup = [cometdAdapter.disconnect()];\n const groupKey = identification?.session?.groupKey;\n if (groupKey) {\n cleanup.push(\n new Router().delete(\n `/presence/group/${groupKey}`,\n optionals,\n ),\n );\n }\n await Promise.allSettled(cleanup);\n}\n\n\n/**\n * Retrieves the presence information for a particular group\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/presence/group/{GROUP_KEY}`\n *\n * @example\n * import { presenceAdapter } from 'epicenter-libs';\n * const presence = await presenceAdapter.forGroup('0000017dd3bf540e5ada5b1e058f08f20461');\n *\n * @param groupKey Key associated with group\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a list of users online\n */\nexport async function forGroup(\n groupKey: string,\n optionals: RoutingOptions = {},\n): Promise<Presence[]> {\n return await new Router()\n .get(`/presence/group/${groupKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Retrieves the presence information for a particular world\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/presence/world/{WORLD_KEY}`\n *\n * @example\n * import { presenceAdapter } from 'epicenter-libs';\n * const presence = await presenceAdapter.forWorld('0000017a445032dc38cb2cecd5fc13708314');\n *\n * @param worldKey Key associated with world\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a list of users online\n */\nexport async function forWorld(\n worldKey: string,\n optionals: RoutingOptions = {},\n): Promise<Presence[]> {\n return await new Router()\n .get(`/presence/world/${worldKey}`, optionals)\n .then(({ body }) => body);\n}\n\n","import Router from '../utils/router';\n\n/**\n * Verifies a Google reCAPTCHA token\n * Base URL: POST `https://forio.com/api/v3/epicenter/manager/recaptcha/google`\n *\n * @example\n * import { recaptchaAdapter } from 'epicenter-libs';\n * const result = await recaptchaAdapter.google(token);\n *\n * @param humanKey The reCAPTCHA token to verify\n * @returns promise that resolves to the verification result\n */\nexport async function google(humanKey: string) {\n return await new Router()\n .withAccountShortName('epicenter')\n .withProjectShortName('manager')\n .post('/recaptcha/google', {\n body: { humanKey: humanKey },\n })\n .then(({ body }) => body);\n}\n","import type { UserSession } from '../utils/identification';\nimport type { GenericScope, GenericSearchOptions, Permit, Address } from '../utils/constants';\nimport type { RoutingOptions, Page } from '../utils/router';\nimport type { PseudonymReadOutView } from './user';\n\nimport {\n Router,\n identification,\n ROLE,\n SCOPE_BOUNDARY,\n RITUAL,\n EpicenterError,\n parseFilterInput,\n} from '../utils';\n\n// Generic type parameters for Run variables and metadata\nexport type RunVariables = Record<string, unknown>;\nexport type RunMetadata = Record<string, unknown>;\n\nexport interface V2ModelContext {\n variables?: Record<string, VariableOptions>;\n externalFunctions?: Record<string, WireExternalFunction>;\n modelVersion?: number;\n mappedFiles?: Record<string, string>;\n control?: ExcelModelControl | JavaModelControl | PowersimModelControl | VensimModelControl;\n language?: string;\n protections?: Protections;\n restorations?: Restorations;\n version: string;\n workerImage?: string;\n dependencies?: (AptExternalDependency | CranExternalDependency | GitExternalDependency | JuliaExternalDependency | NpmExternalDependency | PypiExternalDependency | ShellExternalDependency)[];\n operations?: Record<string, OperationOptions>;\n defaults?: ModelContextDefaults;\n enableStateCache?: boolean;\n redirectStandardOut?: boolean;\n startDebugger?: boolean;\n inceptionGracePeriodSeconds?: number;\n minimumLogLevel?: string;\n events?: Record<string, EventOptions>;\n}\n\nexport interface ModelContext extends V2ModelContext {}\n\nexport interface VariableOptions {\n resetDecision?: boolean;\n dialect?: string;\n save?: boolean;\n reportPer?: number;\n sensitivity?: boolean;\n reportOffset?: number;\n}\n\nexport interface WireExternalFunction {\n route?: Route;\n arguments?: string;\n objectType: 'wire';\n}\n\nexport interface Route {\n service?: string;\n version?: number;\n}\n\nexport interface ExcelModelControl {\n autoRecalculate?: boolean;\n objectType: 'excel';\n}\n\nexport interface JavaModelControl {\n executable?: string;\n objectType: 'java';\n}\n\nexport interface PowersimModelControl {\n minimizeMemoryFootprint?: boolean;\n objectType: 'powersim';\n}\n\nexport interface VensimModelControl {\n sensitivityControl?: 'SensitivityControl';\n extensionModule?: string;\n objectType: 'vensim';\n}\n\nexport interface Protections {\n guards: (InputGuard | OverwriteGuard | PrivilegeGuard | RelativeGuard | RoleGuard)[];\n}\n\nexport interface InputGuard {\n regex: string;\n operand?: string;\n operator?: string;\n objectType: 'input';\n}\n\nexport interface OverwriteGuard {\n regex: string;\n dialect?: string;\n initial: string;\n objectType: 'overwrite';\n}\n\nexport interface PrivilegeGuard {\n regex: string;\n read: string;\n domain: string;\n grant: string;\n write: string;\n execute: string;\n objectType: 'privilege';\n}\n\nexport interface RelativeGuard {\n regex: string;\n dialect?: string;\n value: string;\n operator: string;\n key: string;\n objectType: 'relative';\n}\n\nexport interface RoleGuard {\n regex: string;\n role: string;\n domain: string;\n grant: string;\n objectType: 'role';\n}\n\nexport interface Restorations {\n rewind?: RewindMarker;\n log?: string;\n assembly?: (ReplayRestoration | SnapshotRestoration)[];\n}\n\nexport interface RewindMarker {\n name?: string;\n destructible?: boolean;\n arguments?: Record<string, unknown>;\n}\n\nexport interface ReplayRestoration {\n replay: {\n operations?: ReplayOperation[];\n };\n}\n\nexport interface ReplayOperation {\n targetType: string;\n operationType: string;\n targetKey: string;\n}\n\nexport interface SnapshotRestoration {\n variables?: string[];\n objectType: 'snapshot';\n}\n\nexport interface AptExternalDependency {\n package?: string;\n repository?: string;\n version?: string;\n objectType: 'apt';\n}\n\nexport interface CranExternalDependency {\n package?: string;\n version?: string;\n objectType: 'cran';\n}\n\nexport interface GitExternalDependency {\n url?: string;\n script?: string;\n objectType: 'git';\n}\n\nexport interface JuliaExternalDependency {\n package?: string;\n version?: string;\n objectType: 'julia';\n}\n\nexport interface NpmExternalDependency {\n package?: string;\n version?: string;\n objectType: 'npm';\n}\n\nexport interface PypiExternalDependency {\n package?: string;\n version?: string;\n objectType: 'pypi';\n}\n\nexport interface ShellExternalDependency {\n script?: string;\n objectType: 'shell';\n}\n\nexport interface OperationOptions {\n timeoutSeconds?: number;\n inert?: boolean;\n}\n\nexport interface ModelContextDefaults {\n variables?: VariableOptions;\n operations?: OperationOptions;\n events?: EventOptions;\n}\n\nexport interface EventOptions {\n timeoutSeconds?: number;\n}\n\nexport interface V1ExecutionContext {\n presets?: Record<string, Record<string, unknown>>;\n mappedFiles?: Record<string, string>;\n version: string;\n tool?: StellaModelTool | VensimModelTool;\n};\n\nexport interface ExecutionContext extends V1ExecutionContext {}\n\nexport interface StellaModelTool {\n objectType: 'stella';\n gameMode?: boolean;\n}\n\nexport interface VensimModelTool {\n objectType: 'vensim';\n sensitivityMode?: boolean;\n cinFiles?: string[];\n}\n\nexport enum MORPHOLOGY {\n MANY = 'MANY',\n PROXY = 'PROXY',\n SINGULAR = 'SINGULAR',\n}\n\nexport interface ProcActionable {\n name: string;\n arguments?: unknown[];\n objectType: 'execute';\n}\n\nexport interface GetActionable {\n name: string;\n objectType: 'get';\n}\n\nexport interface SetActionable {\n name: string;\n value: unknown;\n objectType: 'set';\n}\n\nexport type Actionable =\n | ProcActionable\n | GetActionable\n | SetActionable;\n\n\nexport type RunReadOutView<\n V extends object = RunVariables,\n M extends object = RunMetadata,\n> = {\n cluster?: string;\n hidden?: boolean;\n modelVersion?: number;\n lastOperated?: string;\n modelLanguage?: string;\n perpetual?: boolean;\n cloud?: string;\n metaData?: M;\n grammar?: string;\n trackingKey?: string;\n scope: { userKey?: string } & GenericScope;\n executionContext?: V1ExecutionContext;\n allowChannel?: boolean;\n marked?: boolean;\n variables?: V;\n address?: Address;\n tombstone?: string;\n morphology?: string;\n modelFile?: string;\n created?: string;\n runKey: string;\n permit?: Permit;\n closed?: boolean;\n lastModified?: string;\n runState?: string;\n user?: PseudonymReadOutView;\n};\n\nexport type RunCreateOptions = {\n readLock?: keyof typeof ROLE;\n writeLock?: keyof typeof ROLE;\n ephemeral?: boolean;\n trackingKey?: string;\n modelContext?: ModelContext;\n executionContext?: ExecutionContext;\n allowChannel?: boolean;\n} & RoutingOptions;\n\nexport type RunStrategy =\n | 'reuse-across-sessions'\n | 'reuse-never'\n | 'reuse-by-tracking-key'\n | 'multiplayer';\n\n/**\n * Creates a run. By default, all runs are created with the user's ID (`userKey`), except in the case of world-scoped runs.\n * If no permit is specified, platform will assign a default determined by the session user type and the scope boundary.\n * For a participant creating a run, the default readLock/writeLock is `USER/USER`, unless that run is scoped to a world,\n * in which case `PARTICIPANT/FACILITATOR` is the default. Admins and facilitators/reviewers have their own defaults.\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run`\n *\n * @example\n * import { runAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * await runAdapter.create('model.py', {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461'\n * });\n *\n * @param model Name of your model file\n * @param scope Scope associated with your run\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.readLock] Read permission role; one of the strings defined in ROLE\n * @param [optionals.writeLock] Write permission role; one of the strings defined in ROLE\n * @param [optionals.ephemeral] Used for testing. If true, the run will only exist so long as its in memory; makes it so that nothing is written to the database, history, or variables.\n * @param [optionals.trackingKey] Tracking key\n * @param [optionals.modelContext] .ctx2 file overrides, this is not tracked by clone operations\n * @param [optionals.executionContext] Carries arguments for model file worker on model initialization. This is tracked by clone operations.\n * @param [optionals.allowChannel] Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT\n * @returns promise that resolves to the newly created run\n */\nexport async function create<\n V extends object = RunVariables,\n M extends object = RunMetadata,\n>(\n model: string,\n scope: { userKey?: string } & GenericScope,\n optionals: RunCreateOptions = {},\n): Promise<RunReadOutView<V, M>> {\n const { scopeBoundary, scopeKey, userKey } = scope;\n const {\n readLock,\n writeLock,\n ephemeral,\n trackingKey,\n modelContext,\n executionContext,\n allowChannel,\n ...routingOptions\n } = optionals;\n\n const { WORLD } = SCOPE_BOUNDARY;\n const session = identification.session as UserSession;\n\n const hasPermit = readLock || writeLock;\n const headers = Object.assign(\n {},\n routingOptions.headers,\n hasPermit ? { 'X-Forio-Confirmation': true } : {},\n );\n const permit = hasPermit ? { readLock, writeLock } : undefined;\n\n return await new Router()\n .post('/run', {\n body: {\n scope: {\n scopeBoundary,\n scopeKey,\n userKey: scopeBoundary === WORLD ?\n undefined :\n userKey ?? session?.userKey,\n },\n permit,\n morphology: 'MANY',\n trackingKey,\n modelFile: model,\n modelContext: modelContext || {/* Is not recorded for clone. Overrides model ctx2 file. */},\n executionContext: executionContext || {/* Affected by clone. Carries arguments for model file worker on model initialization */},\n ephemeral,\n allowChannel,\n },\n ...routingOptions,\n headers,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Creates a project scoped run\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/singular`\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * await runAdapter.createSingular('model.py');\n *\n * @param model Name of your model file\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.readLock] Read permission role; one of the strings defined in ROLE\n * @param [optionals.writeLock] Write permission role; one of the strings defined in ROLE\n * @param [optionals.ephemeral] Used for testing. If true, the run will only exist so long as its in memory; makes it so that nothing is written to the database, history, or variables.\n * @param [optionals.modelContext] .ctx2 file overrides, this is not tracked by clone operations\n * @param [optionals.executionContext] Carries arguments for model file worker on model initialization. This is tracked by clone operations.\n * @returns promise that resolves to the newly created run\n */\nexport async function createSingular<\n V extends object = RunVariables,\n M extends object = RunMetadata,\n>(\n model: string,\n optionals: RunCreateOptions = {},\n): Promise<RunReadOutView<V, M>> {\n const {\n readLock, writeLock, ephemeral,\n modelContext, executionContext,\n ...routingOptions\n } = optionals;\n\n const hasPermit = readLock || writeLock;\n const headers = Object.assign(\n {},\n routingOptions.headers,\n hasPermit ? { 'X-Forio-Confirmation': true } : {},\n );\n const permit = hasPermit ? { readLock, writeLock } : undefined;\n\n return await new Router()\n .post('/run/singular', {\n body: {\n modelFile: model,\n permit,\n modelContext: modelContext || {/* Is not recorded for clone. Overrides model ctx2 file. */},\n executionContext: executionContext || {/* Affected by clone. Carries arguments for model file worker on model initialization */},\n ephemeral,\n },\n ...routingOptions,\n headers,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Gets the singular run's runKey\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/singular/key`\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * const runKey = await runAdapter.getSingularRunKey();\n *\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a runKey\n */\nexport async function getSingularRunKey(\n optionals: RoutingOptions = {},\n): Promise<number> {\n return await new Router()\n .get('/run/singular/key', optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Clone a run\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/clone/{RUN_KEY}`\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * const clonedRun = await runAdapter.clone('00000173078afb05b4ae4c726637167a1a9e');\n *\n * @param runKey Run key for the run you want to clone\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.ephemeral] Used for testing. If true, the run will only exist so long as its in memory; makes it so that nothing is written to the database, history, or variables.\n * @param [optionals.trackingKey] Tracking key\n * @param [optionals.modelContext] .ctx2 file overrides, this is not tracked by clone operations\n * @param [optionals.executionContext] Carries arguments for model file worker on model initialization. This is tracked by clone operations.\n * @returns promise that resolves to the cloned run\n */\nexport async function clone(\n runKey: string,\n optionals: {\n ephemeral?: boolean;\n trackingKey?: string;\n modelContext?: ModelContext;\n executionContext?: ExecutionContext;\n } & RoutingOptions = {},\n): Promise<RunReadOutView> {\n const {\n ephemeral, trackingKey, modelContext = {}, executionContext = {},\n ...routingOptions\n } = optionals;\n return await new Router()\n .post(`/run/clone/${runKey}`, {\n body: {\n trackingKey,\n modelContext,\n executionContext,\n ephemeral,\n },\n ...routingOptions,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Restore a run into memory\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/restore/{RUN_KEY}`\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * const restoredRun = await runAdapter.restore('00000173078afb05b4ae4c726637167a1a9e');\n *\n * @param runKey Run key for the run you want to restore\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.ephemeral] Used for testing. If true, the run will only exist so long as its in memory; makes it so that nothing is written to the database, history, or variables.\n * @param [optionals.modelContext] .ctx2 file overrides, this is not tracked by clone operations\n * @param [optionals.executionContext] Carries arguments for model file worker on model initialization. This is tracked by clone operations.\n * @returns promise that resolves to the restored run\n */\nexport async function restore(\n runKey: string,\n optionals: {\n ephemeral?: boolean;\n modelContext?: ModelContext;\n executionContext?: ExecutionContext;\n } & RoutingOptions = {},\n): Promise<RunReadOutView> {\n const {\n ephemeral,\n modelContext = {},\n executionContext = {},\n ...routingOptions\n } = optionals;\n return await new Router()\n .post(`/run/restore/${runKey}`, {\n body: {\n modelContext,\n executionContext,\n ephemeral,\n },\n ...routingOptions,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Rewind a run by a specified number of steps\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/rewind/{RUN_KEY}`\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * const rewoundRun = await runAdapter.rewind('00000173078afb05b4ae4c726637167a1a9e', 5);\n *\n * @param runKey Run key for the run you want to rewind\n * @param steps Number of steps to rewind\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.ephemeral] Used for testing. If true, the run will only exist so long as its in memory; makes it so that nothing is written to the database, history, or variables.\n * @param [optionals.modelContext] .ctx2 file overrides, this is not tracked by clone operations\n * @returns promise that resolves to the rewound run\n */\nexport async function rewind(\n runKey: string,\n steps: number,\n optionals: {\n ephemeral?: boolean;\n modelContext?: ModelContext;\n } & RoutingOptions = {},\n): Promise<RunReadOutView> {\n const {\n ephemeral,\n modelContext = {},\n ...routingOptions\n } = optionals;\n return await new Router()\n .post(`/run/rewind/${runKey}`, {\n body: {\n rewindCount: steps,\n modelContext,\n ephemeral,\n },\n ...routingOptions,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Updates a run's attributes\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/{RUN_KEY}`\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * const updatedRun = await runAdapter.update('00000173078afb05b4ae4c726637167a1a9e', {\n * readLock: 'FACILITATOR',\n * writeLock: 'FACILITATOR',\n * marked: true,\n * hidden: false,\n * });\n *\n * @param runKey Key associated with the run\n * @param update Object with the key-value pairs you would like to update\n * @param update.readLock Read permission role; one of the strings defined in ROLE\n * @param update.writeLock Write permission role; one of the strings defined in ROLE\n * @param update.trackingKey Tracking key for the run\n * @param update.marked Whether the run is marked (analogous to v2's 'saved')\n * @param update.hidden Whether the run is hidden (analogous to v2's 'trashed')\n * @param update.closed Closed is a flag that means do not restore, the run is done, no more play\n * @param update.allowChannel Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT\n * @param [optionals] Optional arguments; pass network call options overrides here\n * @returns promise that resolve to the updated run\n */\nexport async function update(\n runKey: string,\n update: {\n readLock?: keyof typeof ROLE;\n writeLock?: keyof typeof ROLE;\n trackingKey?: string;\n marked?: boolean;\n hidden?: boolean;\n closed?: boolean;\n allowChannel?: boolean;\n },\n optionals: RoutingOptions = {},\n): Promise<RunReadOutView> {\n const {\n readLock,\n writeLock,\n trackingKey,\n marked,\n hidden,\n closed,\n allowChannel,\n } = update;\n const hasMultiple = Array.isArray(runKey) && runKey.length > 1;\n const uriComponent = hasMultiple ? '' : `/${runKey.length === 1 ? runKey[0] : runKey}`;\n const permit = (readLock || writeLock) ? { readLock, writeLock } : undefined;\n\n return await new Router()\n .withSearchParams(hasMultiple ? { runKey } : '')\n .patch(`/run${uriComponent}`, {\n body: {\n permit,\n trackingKey,\n marked,\n hidden,\n closed,\n allowChannel,\n },\n ...optionals,\n }).then(({ body }) => body);\n}\n\n\n/**\n * *Does not actually delete the run*. The run is instead removed from memory. This can be used as a means of preserving server CPUs, and should be used when you do not expect to perform any additional actions that would bring the run back into memory.\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/{RUN_KEY}`\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * await runAdapter.remove('00000173078afb05b4ae4c726637167a1a9e');\n *\n * @param runKey Key associated with the run\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolve to undefined if successful\n */\nexport async function remove(\n runKey: string,\n optionals: RoutingOptions = {},\n): Promise<void> {\n return await new Router()\n .delete(`/run/${runKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Gets a specific run by its runKey\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/{RUN_KEY}`\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * const run = await runAdapter.get('00000173078afb05b4ae4c726637167a1a9e');\n *\n * @param runKey Key associated with the run\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the run\n */\nexport async function get<\n V extends object = RunVariables,\n M extends object = RunMetadata,\n>(\n runKey: string,\n optionals: RoutingOptions = {},\n): Promise<RunReadOutView<V, M>> {\n return await new Router()\n .get(`/run/${runKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Queries for runs.\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{MODEL}` or GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/in/{GROUP_NAME}/{MODEL}` or GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/in/{GROUP_NAME}/{EPISODE_NAME}/{MODEL}`\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * const page = await runAdapter.query('model.xlsx', {\n * filter: [\n * 'var.foo|=1|2|3', // look for runs with a variable 'foo' with the values 1, 2, or 3\n * 'var.score>=24', // looks for runs with a variable 'score' higher than or equal to 24\n * 'var.certified*=true' // looks for runs where the variable 'certified' exists,\n * 'run.hidden=false', // where the run's 'hidden' attribute is false\n * 'meta.classification~=bar-*' // where the run metadata contains a 'classification' that begins with 'bar-',\n * 'meta.categorization~=*-baz' // where the run metadata contains a 'categorization' that does not end with '-baz',\n * ],\n * sort: ['+run.created'] // sort all findings by the 'created' field (ascending)\n * variables: ['foo', 'baz'], // include the run variables for 'foo' and 'baz' in the response\n * metadata: ['classification'] // include the run metadata for 'classification' in the response\n * });\n *\n * @param model Name of your model file\n * @param searchOptions Search options\n * @param [searchOptions.scope.scopeBoundary] Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param [searchOptions.scope.scopeKey] Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [searchOptions.scope.userKey] User attached to scope if necessary\n * @param [searchOptions.filter] List of conditionals to filter for\n * @param [searchOptions.sort] List of values to sort by (applies only to run attributes)\n * @param [searchOptions.variables] List of variables to include with the runs found\n * @param [searchOptions.metadata] List of metadata to include with the runs found\n * @param [searchOptions.first] The index from which we collect our runs from\n * @param [searchOptions.max] The maximum number of runs to return (upper limit: 200)\n * @param [searchOptions.timeout] Number of seconds we're willing to wait for the response from the server\n * @param [searchOptions.includeEpisodes] Only used for the `run/in/groupName` endpoint\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a page of runs\n */\nexport async function query<\n V extends object = RunVariables,\n M extends object = RunMetadata,\n>(\n model: string,\n searchOptions: {\n timeout?: number;\n variables?: (keyof V)[];\n metadata?: (keyof M)[];\n scope?: { userKey?: string } & GenericScope;\n groupName?: string;\n episodeName?: string;\n includeEpisodes?: boolean;\n } & GenericSearchOptions,\n optionals: RoutingOptions = {},\n): Promise<Page<RunReadOutView<V, M>>> {\n const {\n filter, sort = [], first, max, timeout, variables = [], metadata = [],\n scope, groupName, episodeName, includeEpisodes,\n } = searchOptions;\n const session = identification.session as UserSession;\n const uriComponent = scope ?\n `${scope.scopeBoundary}/${scope.scopeKey}` :\n `in/${groupName ?? session?.groupName}${episodeName ? `/${episodeName}` : ''}`;\n\n // Handle additional filters that need to be added programmatically\n let finalFilter = filter;\n if (scope?.userKey) {\n const userKeyFilter = `run.userKey=${scope.userKey}`;\n if (Array.isArray(filter)) {\n finalFilter = [...filter, userKeyFilter];\n } else if (typeof filter === 'string') {\n finalFilter = filter ? `${filter};${userKeyFilter}` : userKeyFilter;\n } else if (filter && typeof filter === 'object') {\n // For FilterGroup objects, wrap the existing filter and the userKey filter in an AND group\n finalFilter = {\n type: 'and' as const,\n filters: [filter, userKeyFilter],\n };\n } else {\n finalFilter = [userKeyFilter];\n }\n }\n\n const searchParams = {\n filter: parseFilterInput(finalFilter),\n sort: sort.join(';') || undefined,\n var: (variables as string[]).join(';') || undefined,\n meta: (metadata as string[]).join(';') || undefined,\n first, max, timeout, includeEpisodes,\n };\n\n return await new Router()\n .withSearchParams(searchParams)\n .get(`/run/${uriComponent}/${model}`, {\n paginated: true,\n parsePage: (values: RunReadOutView[]) => {\n return values.map((run) => {\n run.variables = variables.reduce((variableMap, key, index) => {\n // TODO -- add a test case to run.spec that makes sure it does not error if it receives run w/o 'variables'\n variableMap[key as keyof V] = run.variables?.[index] as V[keyof V];\n return variableMap;\n }, {} as Pick<V, keyof V>);\n return run;\n });\n },\n ...optionals,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Retrieves a model's introspection information based on model file.\n * The exact structure of the information returned varies between model languages, but generally includes information about the model's variables (data type, whether they are user-accessible/writable, etc), named ranges, available model functions. SimLang models also provide \"causes\" and \"effects\" for variables, which are ways of describing which variables are affected by changes to other variables.\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/introspect/model/{MODEL}`\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * const info = await runAdapter.introspect('model.py');\n *\n * @param model Name of your model file\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to an object containing the model's introspection information\n */\nexport async function introspect(\n model: string,\n optionals: RoutingOptions = {},\n): Promise<Record<string, unknown>> {\n return await new Router()\n .get(`/run/introspect/model/${model}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Retrieves a model's introspection information based on a run key associated with the model.\n * The exact structure of the information returned varies between model languages, but generally includes information about the model's variables (data type, whether they are user-accessible/writable, etc), named ranges, available model functions. SimLang models also provide \"causes\" and \"effects\" for variables, which are ways of describing which variables are affected by changes to other variables.\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/introspect/{RUN_KEY}`\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * const info = await runAdapter.introspectWithRunKey('00000173078afb05b4ae4c726637167a1a9e');\n *\n * @param runKey Identifier for your run\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to an object containing the model's introspection information\n */\nexport async function introspectWithRunKey(\n runKey: string,\n optionals: RoutingOptions = {},\n): Promise<Record<string, unknown>> {\n return await new Router()\n .get(`/run/introspect/${runKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Executes an operation on a run.\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/operation/{RUN_KEY}` or POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/operation` (for multiple runs)\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * const result = await runAdapter.operation('00000173078afb05b4ae4c726637167a1a9e', 'simulate', [10]);\n *\n * @param runKey Identifier for your run\n * @param name Name of the operation to execute\n * @param [args] Arguments to pass to the operation\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.timeout] Number of seconds we're willing to wait for the response from the server\n * @param [optionals.ritual] Ritual describing how to store and remove the run from memory; one of the strings defined in RITUAL\n * @returns promise that resolve to the operation's return value\n */\nexport async function operation(\n runKey: string | string[],\n name: string,\n args: unknown[] = [],\n optionals: {\n timeout?: number;\n ritual?: keyof typeof RITUAL;\n } & RoutingOptions = {},\n): Promise<unknown> {\n const {\n timeout, ritual,\n ...routingOptions\n } = optionals;\n const hasMultiple = Array.isArray(runKey) && runKey.length > 1;\n const uriComponent = hasMultiple ? '' : `/${runKey.length === 1 ? runKey[0] : runKey}`;\n const searchParams = hasMultiple ? { runKey, timeout } : { ritual, timeout };\n\n if (ritual !== RITUAL.EXORCISE && hasMultiple) {\n console.warn(`Detected ritual: ${ritual} usage with multiple runKeys; this not allowed. Defaulting to ritual: EXORCISE`);\n }\n\n return await new Router()\n .withSearchParams(searchParams)\n .post(`/run/operation${uriComponent}`, {\n body: {\n name,\n arguments: args,\n objectType: 'execute', // TODO: remove this when platform fixes this so that it's not manually required\n },\n ...routingOptions,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Retrieves model variables for a run or runs\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/variable/{RUN_KEY}` or POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/variable` (for multiple runs)\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * // Single runKey\n * const vars = await runAdapter.getVariables('00000173078afb05b4ae4c726637167a1a9e', ['var1', 'var2']);\n * // Multiple runKeys\n * const varsArray = await runAdapter.getVariables(['00000173078afb05b4ae4c726637167a1a9e', '0000017dd3bf540e5ada5b1e058f08f20461'], ['var1', 'var2']);\n *\n * @param runKey Identifier for your run or runs\n * @param variables List of variables to retrieve\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.timeout] Number of seconds we're willing to wait for the response from the server\n * @param [optionals.ritual] Ritual describing how to store and remove the run from memory; one of the strings defined in RITUAL\n * @param [optionals.ignorable] If true, suppresses errors when variables are not found\n * @returns promise that resolve to an object with the variables and their values\n */\nexport async function getVariables<V extends object = RunVariables>(\n runKey: string | string[],\n variables: (keyof V)[],\n optionals: {\n timeout?: number;\n ritual?: keyof typeof RITUAL;\n ignorable?: boolean;\n } & RoutingOptions = {},\n): Promise<\n | Pick<V, keyof V>\n | { runKey: string; variables: Pick<V, keyof V> }[]\n> {\n const {\n timeout, ritual, ignorable,\n ...routingOptions\n } = optionals;\n const hasMultiple = Array.isArray(runKey) && runKey.length > 1;\n\n if (ritual !== RITUAL.EXORCISE && hasMultiple) {\n console.warn(`Detected ritual: ${ritual} usage with multiple runKeys; this not allowed. Defaulting to ritual: EXORCISE`);\n }\n\n const mappify = (values: unknown[]): Pick<V, keyof V> => variables.reduce((variableMap, key, index) => {\n variableMap[key as keyof V] = values[index] as V[keyof V];\n return variableMap;\n }, {} as Pick<V, keyof V>);\n\n const uriComponent = hasMultiple ? '' : `/${runKey.length === 1 ? runKey[0] : runKey}`;\n const include = (variables as string[]).join(';');\n const body = hasMultiple ? { runKey, include, timeout } : { ritual, include, timeout };\n const additional = ignorable ? { ignorable } : {};\n return await new Router()\n .post(`/run/variable${uriComponent}`, {\n body: {\n ...body,\n ...additional,\n },\n ...routingOptions,\n })\n .then(({ body }) => {\n if (hasMultiple) {\n return Object.keys(body).map((runKey) => ({\n runKey,\n variables: mappify(body[runKey]),\n }));\n }\n return mappify(body);\n });\n}\n\n\n/**\n * Retrieves model variable(s) for a run or runs\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/variable/{RUN_KEY}/{VARIABLE}` or POST (for multiple runs/variables)\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * // Single runKey, single variable\n * const value = await runAdapter.getVariable('00000173078afb05b4ae4c726637167a1a9e', 'var1');\n * // Multiple runKeys, multiple variables\n * const varsArray = await runAdapter.getVariable(['00000173078afb05b4ae4c726637167a1a9e', '0000017dd3bf540e5ada5b1e058f08f20461'], ['var1', 'var2']);\n *\n * @param runKey Identifier for your run or runs\n * @param variable Variable or list of variables to retrieve\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.timeout] Number of seconds we're willing to wait for the response from the server\n * @param [optionals.ritual] Ritual describing how to store and remove the run from memory; one of the strings defined in RITUAL\n * @returns promise that resolve to the variable's value, or an object with the variables and their values\n */\nexport async function getVariable<V extends object = RunVariables>(\n runKey: string | string[],\n variable: keyof V | (keyof V)[],\n optionals: {\n timeout?: number;\n ritual?: keyof typeof RITUAL;\n } & RoutingOptions = {},\n): Promise<\n | V[keyof V]\n | Pick<V, keyof V>\n | { runKey: string; variables: Pick<V, keyof V> }[]\n> {\n const { timeout, ritual, ...routingOptions } = optionals;\n\n if (Array.isArray(runKey) || Array.isArray(variable)) {\n const variables = Array.isArray(variable) ? variable : [variable];\n return getVariables(runKey, variables, optionals);\n }\n\n return await new Router()\n .withSearchParams({ timeout, ritual })\n .get(`/run/variable/${runKey}/${String(variable)}`, routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Updates model variables for the run\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/variable/{RUN_KEY}` or PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/variable` (for multiple runs)\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * const updated = await runAdapter.updateVariables('00000173078afb05b4ae4c726637167a1a9e', {\n * price: 100,\n * foo: 'bar',\n * });\n *\n * @param runKey Identifier for your run\n * @param update Object with the key-value pairs you would like to update in the model\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.timeout] Number of seconds we're willing to wait for the response from the server\n * @param [optionals.ritual] Ritual describing how to store and remove the run from memory; one of the strings defined in RITUAL\n * @returns promise that resolve to an object with the variables and new values that were updated\n */\nexport async function updateVariables<V extends object = RunVariables>(\n runKey: string | string[],\n update: Partial<V>,\n optionals: {\n timeout?: number;\n ritual?: keyof typeof RITUAL;\n } & RoutingOptions = {},\n): Promise<Partial<V>> {\n const {\n timeout, ritual,\n ...routingOptions\n } = optionals;\n const hasMultiple = Array.isArray(runKey) && runKey.length > 1;\n const uriComponent = hasMultiple ? '' : `/${runKey.length === 1 ? runKey[0] : runKey}`;\n const searchParams = hasMultiple ? { runKey, timeout } : { ritual, timeout };\n\n if (ritual !== RITUAL.EXORCISE && hasMultiple) {\n console.warn(`Detected ritual: ${ritual} usage with multiple runKeys; this not allowed. Defaulting to ritual: EXORCISE`);\n }\n\n return await new Router()\n .withSearchParams(searchParams)\n .patch(`/run/variable${uriComponent}`, {\n body: update,\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Retrieves run metadata for a run or runs\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/meta`\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * // Single runKey\n * const meta = await runAdapter.getMetadata('00000173078afb05b4ae4c726637167a1a9e', ['meta1', 'meta2']);\n * // Multiple runKeys\n * const metaArray = await runAdapter.getMetadata(['00000173078afb05b4ae4c726637167a1a9e', '0000017dd3bf540e5ada5b1e058f08f20461'], ['meta1', 'meta2']);\n *\n * @param runKey Identifier for your run or runs\n * @param metadata List of metadata keys to retrieve\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.timeout] Number of seconds we're willing to wait for the response from the server\n * @returns promise that resolve to an object with the metadata and their values\n */\nexport async function getMetadata<M extends object = RunMetadata>(\n runKey: string | string[],\n metadata: (keyof M)[],\n optionals: {\n timeout?: number;\n } & RoutingOptions = {},\n): Promise<\n | Pick<M, keyof M>\n | { runKey: string; data: Pick<M, keyof M> }[]\n> {\n const {\n ...routingOptions\n } = optionals;\n const include = (metadata as string[]).join(';');\n const hasMultiple = Array.isArray(runKey) && runKey.length > 1;\n\n const runKeyArg = Array.isArray(runKey) ? runKey : [runKey];\n return await new Router()\n .post('/run/meta', {\n body: {\n include,\n runKey: runKeyArg,\n },\n ...routingOptions,\n })\n .then(({ body }) => {\n const bodyAsArray = Object.keys(body).map((runKey) => ({\n runKey,\n data: body[runKey],\n }));\n return (\n hasMultiple ? bodyAsArray : bodyAsArray?.[0]?.data\n );\n });\n}\n\n\nexport interface MetadataFirstPop {\n objectType: 'first';\n}\n\nexport interface MetadataLastPop {\n objectType: 'last';\n}\n\nexport interface MetadataAllPop {\n objectType: 'all';\n value?: unknown;\n}\n\nexport type MetadataPop = MetadataFirstPop | MetadataLastPop | MetadataAllPop;\n\nexport interface MetadataUpdate<M extends object = RunMetadata> {\n pop?: Partial<Record<keyof M, MetadataPop>>;\n set?: Partial<M>;\n push?: Partial<M>;\n}\n\n/**\n * Updates run metadata for a run or runs\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/meta/{RUN_KEY}` or PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/meta` (for multiple runs)\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * // Set metadata values\n * const updated = await runAdapter.updateMetadata('00000173078afb05b4ae4c726637167a1a9e', {\n * set: {\n * classification: 'new-classification',\n * categorization: 'new-categorization',\n * },\n * });\n * // Push values to array metadata\n * const pushed = await runAdapter.updateMetadata('00000173078afb05b4ae4c726637167a1a9e', {\n * push: {\n * history: 'new-entry',\n * },\n * });\n * // Pop values from array metadata\n * const popped = await runAdapter.updateMetadata('00000173078afb05b4ae4c726637167a1a9e', {\n * pop: {\n * history: { objectType: 'last' },\n * },\n * });\n *\n * @param runKey Identifier for your run or runs\n * @param update Metadata update operations\n * @param [update.set] Key-value pairs to set in the metadata\n * @param [update.push] Key-value pairs to push to array metadata\n * @param [update.pop] Keys with pop operations (first, last, or all) to remove from array metadata\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.timeout] Number of seconds we're willing to wait for the response from the server\n * @returns promise that resolves to an object with the updated metadata\n */\nexport async function updateMetadata<M extends object = RunMetadata>(\n runKey: string | string[],\n update: MetadataUpdate<M>,\n optionals: {\n timeout?: number;\n } & RoutingOptions = {},\n): Promise<Partial<M>> {\n const {\n timeout,\n ...routingOptions\n } = optionals;\n const hasMultiple = Array.isArray(runKey) && runKey.length > 1;\n const uriComponent = hasMultiple ? '' : `/${runKey.length === 1 ? runKey[0] : runKey}`;\n const searchParams = hasMultiple ? { runKey, timeout } : { timeout };\n\n return await new Router()\n .withSearchParams(searchParams)\n .patch(`/run/meta${uriComponent}`, {\n body: update,\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Executes a list of actions on a run or runs\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/action/{RUN_KEY}` or POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/action` (for multiple runs)\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * const actions = [\n * { name: 'price', value: 100, 'objectType': 'set' },\n * { name: 'simulate', arguments: [10], 'objectType': 'execute' },\n * ];\n * // Single runKey\n * const result = await runAdapter.action('00000173078afb05b4ae4c726637167a1a9e', actions);\n * // Multiple runKeys\n * const results = await runAdapter.action(['00000173078afb05b4ae4c726637167a1a9e', '0000017dd3bf540e5ada5b1e058f08f20461'], actions);\n *\n * @param runKey Identifier for your run or runs\n * @param actionList List of actions to perform\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.timeout] Number of seconds we're willing to wait for the response from the server\n * @param [optionals.ritual] Ritual describing how to store and remove the run from memory; one of the strings defined in RITUAL\n * @returns promise that resolve to an object with the action results\n */\nexport async function action(\n runKey: string | string[],\n actionList: Actionable[],\n optionals: {\n timeout?: number;\n ritual?: keyof typeof RITUAL;\n } & RoutingOptions = {},\n): Promise<Record<string, unknown>> {\n const {\n timeout,\n ritual,\n ...routingOptions\n } = optionals;\n const hasMultiple = Array.isArray(runKey) && runKey.length > 1;\n const uriComponent = hasMultiple ? '' : `/${runKey.length === 1 ? runKey[0] : runKey}`;\n const searchParams = hasMultiple ? { runKey, timeout } : { ritual, timeout };\n\n if (ritual !== RITUAL.EXORCISE && hasMultiple) {\n console.warn(`Detected ritual: ${ritual} usage with multiple runKeys; this not allowed. Defaulting to ritual: EXORCISE`);\n }\n\n return await new Router()\n .withSearchParams(searchParams)\n .post(`/run/action${uriComponent}`, {\n body: actionList,\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Returns the run associated with the given world key; brings the run into memory, if the run does not exist, it will create it.\n * See `runAdapter.create` for more information about platform-determined default permits.\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/world/{WORLD_KEY}`\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * const run = await runAdapter.retrieveFromWorld('0000017a445032dc38cb2cecd5fc13708314', 'model.py');\n *\n * @param worldKey Key associated with the world you'd like a run from\n * @param model Name of model file you'd use to create the run if needed\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.readLock] Read permission role; one of the strings defined in ROLE\n * @param [optionals.writeLock] Write permission role; one of the strings defined in ROLE\n * @param [optionals.ephemeral] Used for testing. If true, the run will only exist so long as its in memory; makes it so that nothing is written to the database, history, or variables.\n * @param [optionals.trackingKey] Tracking key\n * @param [optionals.modelContext] .ctx2 file overrides, this is not tracked by clone operations\n * @param [optionals.executionContext] Carries arguments for model file worker on model initialization. This is tracked by clone operations.\n * @param [optionals.allowChannel] Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT\n * @returns promise that resolves to the run retrieved from, or created for the world\n */\nexport async function retrieveFromWorld(\n worldKey: string,\n model: string,\n optionals: {\n readLock?: keyof typeof ROLE;\n writeLock?: keyof typeof ROLE;\n ephemeral?: boolean;\n trackingKey?: string;\n modelContext?: ModelContext;\n executionContext?: ExecutionContext;\n allowChannel?: boolean;\n } & RoutingOptions = {},\n): Promise<RunReadOutView> {\n const {\n readLock,\n writeLock,\n ephemeral,\n trackingKey,\n modelContext,\n executionContext,\n allowChannel,\n ...routingOptions\n } = optionals;\n\n const hasPermit = readLock || writeLock;\n const headers = Object.assign(\n {},\n routingOptions.headers,\n hasPermit ? { 'X-Forio-Confirmation': true } : {},\n );\n const permit = hasPermit ? { readLock, writeLock } : undefined;\n\n return await new Router()\n .post(`/run/world/${worldKey}`, {\n body: {\n permit,\n morphology: 'MANY',\n trackingKey,\n modelFile: model,\n modelContext: modelContext || {},\n executionContext: executionContext || {},\n ephemeral,\n allowChannel,\n },\n ...routingOptions,\n headers,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Removes the run associated with the given world key\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/world/{WORLD_KEY}`\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * await runAdapter.removeFromWorld('0000017a445032dc38cb2cecd5fc13708314');\n *\n * @param worldKey Key associated with the world\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to undefined when successful\n */\nexport async function removeFromWorld(\n worldKey: string,\n optionals: RoutingOptions = {},\n): Promise<void> {\n return await new Router()\n .delete(`/run/world/${worldKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Queries for and/or creates a run, depending on the strategy provided.\n *\n * 'reuse-across-sessions' -- will get the most recent run for the given scope, creating it if it does not exist\n * 'reuse-never' -- will create a new run every time\n *\n * @example\n * import { runAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const run = await runAdapter.getWithStrategy(\n * 'reuse-across-sessions',\n * 'model.py',\n * {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * },\n * );\n *\n * @param strategy Strategy to use when retrieving the run\n * @param model Name of your model file\n * @param scope Scope associated with your run\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.readLock] Read permission role; one of the strings defined in ROLE\n * @param [optionals.writeLock] Write permission role; one of the strings defined in ROLE\n * @param [optionals.ephemeral] Used for testing. If true, the run will only exist so long as its in memory; makes it so that nothing is written to the database, history, or variables.\n * @param [optionals.trackingKey] Tracking key\n * @param [optionals.modelContext] .ctx2 file overrides, this is not tracked by clone operations\n * @param [optionals.executionContext] Carries arguments for model file worker on model initialization. This is tracked by clone operations.\n * @returns promise that resolves to a run\n */\nexport async function getWithStrategy<\n V extends object = RunVariables,\n M extends object = RunMetadata,\n>(\n strategy: RunStrategy,\n model: string,\n scope: GenericScope,\n optionals: {\n // initOperations?: Array<string | { name: string, params?: unknown[]}>,\n } & RunCreateOptions = {},\n): Promise<RunReadOutView<V, M>> {\n // const { initOperations = [] } = optionals;\n if (strategy === 'reuse-across-sessions') {\n const searchOptions = {\n scope,\n sort: ['-run.created'],\n max: 1,\n };\n const { values: [lastRun] } = await query<V, M>(model, searchOptions);\n if (!lastRun) {\n const newRun = await create<V, M>(model, scope, optionals);\n // await serial(newRun.runKey, initOperations, optionals = {});\n return newRun;\n }\n return lastRun;\n } else if (strategy === 'reuse-never') {\n const newRun = await create<V, M>(model, scope, optionals);\n // await serial(newRun.runKey, initOperations, optionals = {});\n return newRun;\n } else if (strategy === 'reuse-by-tracking-key') {\n // TBD write out if needed\n // Platform plans to introduce run limits into episode scope, differing from v2's implementation of runLimit via 'reuse-by-tracking-key'\n } else if (strategy === 'multiplayer') {\n // TODO when multiplayer API is ready\n // check the current world for this end user, return the current run for that world (if there is none, create a run for the world)\n }\n throw new EpicenterError('Invalid run strategy.');\n}\n\n\n/**\n * Clone a run into a novel episode scope\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/migrate/to/{EPISODE_KEY}/{RUN_KEY}`\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * const migratedRun = await runAdapter.migrate(\n * '00000173078afb05b4ae4c726637167a1a9e',\n * '0000017dd3bf540e5ada5b1e058f08f20461',\n * );\n *\n * @param runKey Source run key for the run you want to copy and migrate\n * @param episodeKey Destination episode key for the run's new episode scope\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.ephemeral] Used for testing. If true, the run will only exist so long as its in memory; makes it so that nothing is written to the database, history, or variables.\n * @param [optionals.trackingKey] Tracking key\n * @param [optionals.modelContext] .ctx2 file overrides, this is not tracked by migrate operations\n * @param [optionals.executionContext] Carries arguments for model file worker on model initialization. This is tracked by migrate operations.\n * @returns promise that resolves to the migrated run\n */\nexport async function migrate<\n V extends object = RunVariables,\n M extends object = RunMetadata,\n>(\n runKey: string,\n episodeKey: string,\n optionals: {\n ephemeral?: boolean;\n trackingKey?: string;\n modelContext?: ModelContext;\n executionContext?: ExecutionContext;\n } & RoutingOptions = {},\n): Promise<RunReadOutView<V, M>> {\n const {\n ephemeral, trackingKey, modelContext = {}, executionContext = {},\n ...routingOptions\n } = optionals;\n return await new Router()\n .post(`/run/migrate/to/${episodeKey}/${runKey}`, {\n body: {\n trackingKey,\n modelContext,\n executionContext,\n ephemeral,\n },\n ...routingOptions,\n }).then(({ body }) => body);\n}\n","import type { RoutingOptions } from '../utils/router';\nimport { GROUP_ROLE } from '../utils/constants';\n\nimport Router from '../utils/router';\n\nexport type Modality = 'NONE' | 'HBP' | 'ICC' | 'SSO';\nexport type MFAMethodology = 'NONE' | 'NOOP' | 'TOTP';\n\n// Generic type alias for SSO realm data\nexport type RealmData = Record<string, unknown>;\n\nexport interface MFADetailReadOutView {\n mfaMethodology: MFAMethodology;\n}\n\nexport interface GraftReadOutView<R extends object = RealmData> {\n reference: string;\n realm: R;\n}\n\nexport interface Countdown {\n last?: string;\n count?: number;\n}\n\nexport interface GroupRelationshipReadOutView {\n role: keyof typeof GROUP_ROLE;\n}\n\nexport interface UserReadOutView {\n lastLogin: string;\n modality: Modality;\n lastUpdated: string;\n created: string;\n displayName: string;\n countdown?: Countdown;\n givenName: string;\n familyName: string;\n handle: string;\n loginCount: number;\n uploadOrder: number;\n email: string;\n active: boolean;\n userId: number;\n userKey: string;\n objectType: 'external' | 'native';\n mfaDetail: MFADetailReadOutView;\n}\n\nexport interface ExternalUserReadOutView extends UserReadOutView {\n graft: GraftReadOutView;\n objectType: 'external';\n}\n\nexport interface NativeUserReadOutView extends UserReadOutView {\n objectType: 'native';\n}\n\nexport interface PseudonymReadOutView {\n lastUpdated: string;\n created: string;\n displayName: string;\n detail: ExternalUserReadOutView | NativeUserReadOutView;\n userId: number;\n userKey: string;\n relationship: GroupRelationshipReadOutView;\n}\n\nexport interface MFADetailCreateInView {\n mfaMethodology: MFAMethodology;\n mfaKey?: string;\n}\n\nexport interface GraftCreateInView<R extends object = RealmData> {\n reference: string;\n realm: R;\n}\n\nexport interface SecretCreateInView {\n password: string;\n}\n\nexport interface UserCreateInView {\n handle: string;\n modality?: Modality;\n displayName?: string;\n familyName?: string;\n givenName?: string;\n countdown?: Countdown;\n active?: true;\n email?: string;\n mfaDetail?: MFADetailCreateInView;\n}\n\nexport interface NativeUserCreateInView extends UserCreateInView {\n objectType: 'native';\n secret?: SecretCreateInView;\n}\n\nexport interface ExternalUserCreateInView<R extends object = RealmData> extends UserCreateInView {\n objectType: 'external';\n graft: GraftCreateInView<R>;\n}\n\nexport interface UploadOptions extends RoutingOptions {\n groupKey?: string;\n overwrite?: boolean;\n}\n\nexport interface DiscardedUser {\n user: ExternalUserReadOutView | NativeUserReadOutView;\n message: string;\n information: Record<string, unknown>;\n code: string;\n}\n\nexport interface UserReport {\n duplicated?: PseudonymReadOutView[];\n created?: PseudonymReadOutView[];\n updated?: PseudonymReadOutView[];\n discarded?: DiscardedUser[];\n}\n\n\n/**\n * Upload a CSV file to create multiple users\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/user/upload`\n *\n * @example\n * import { userAdapter } from 'epicenter-libs';\n * const file = new File([csvContent], 'users.csv');\n * const report = await userAdapter.uploadCSV(file, { overwrite: true });\n *\n * @param file CSV file containing user data\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.overwrite] If true, overwrites existing users with matching identifiers; defaults to false\n * @returns promise that resolves to a report containing created, updated, and discarded users\n */\nexport async function uploadCSV(\n file: File,\n optionals: UploadOptions = {},\n): Promise<UserReport> {\n const {\n overwrite,\n ...routingOptions\n } = optionals;\n\n const formdata = new FormData();\n formdata.append('file', file);\n\n return await new Router()\n .withSearchParams({ overwrite })\n .post('/user/upload', {\n body: formdata,\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Create a new user (native or external).\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/user`\n *\n * @example\n * import { userAdapter } from 'epicenter-libs';\n * // Create a native user\n * const user = await userAdapter.createUser({\n * objectType: 'native',\n * handle: 'john.doe',\n * displayName: 'John Doe',\n * email: 'john@example.com',\n * });\n *\n * @param view User data to create; can be either a native or external user\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the created user\n */\nexport async function createUser<R extends object = RealmData>(\n view: {\n objectType: 'native';\n handle: string;\n modality?: Modality;\n displayName?: string;\n familyName?: string;\n givenName?: string;\n countdown?: Countdown;\n active?: true;\n email?: string;\n mfaDetail?: MFADetailCreateInView;\n secret?: SecretCreateInView;\n } | {\n objectType: 'external';\n handle: string;\n modality?: Modality;\n displayName?: string;\n familyName?: string;\n givenName?: string;\n countdown?: Countdown;\n active?: true;\n email?: string;\n mfaDetail?: MFADetailCreateInView;\n graft: GraftCreateInView<R>;\n },\n optionals: RoutingOptions = {},\n): Promise<PseudonymReadOutView> {\n return await new Router()\n .post('/user', {\n body: view,\n ...optionals,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Gets a specific user.\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/user/{USER_KEY}`\n *\n * @example\n * import { userAdapter } from 'epicenter-libs';\n * const user = await userAdapter.get('00000179b4d3fb0c84f822df8cd2aa53be25');\n *\n * @param userKey The user key\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a user\n */\nexport async function get(\n userKey: string,\n optionals: RoutingOptions = {},\n): Promise<PseudonymReadOutView> {\n return await new Router()\n .get(`/user/${userKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Gets a specific user by their handle.\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/user/with/{HANDLE}` or GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/user/with/{HANDLE}/{MODALITY}`\n *\n * @example\n * import { userAdapter } from 'epicenter-libs';\n * const user = await userAdapter.getWithHandle('john.doe@example.com', { modality: 'email' });\n *\n * @param handle Handle of the user to retrieve\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.modality] Modality to filter by (e.g., 'email', 'sms')\n * @returns promise that resolves to a user\n */\nexport async function getWithHandle(\n handle: string,\n optionals: {\n modality?: Modality;\n } & RoutingOptions = {},\n): Promise<PseudonymReadOutView> {\n const { modality, ...routingOptions } = optionals;\n const uriComponent = modality ? `/${modality}` : '';\n return await new Router()\n .get(`/user/with/${handle}${uriComponent}`, routingOptions)\n .then(({ body }) => body);\n}\n","import type { UserSession } from '../utils/identification';\nimport type { RoutingOptions } from '../utils/router';\nimport type { GenericScope, GenericSearchOptions, Permit, Address } from '../utils/constants';\n\nimport {\n identification,\n Router,\n ROLE,\n SCOPE_BOUNDARY,\n parseFilterInput,\n} from '../utils';\n\n// Generic type parameter for vault items structure\nexport type VaultItems = Record<string, unknown>;\n\nexport interface Vault<I extends object = VaultItems> {\n created: string;\n lastUpdated: string;\n mutationKey: string;\n address: Address;\n scope: { userKey?: string } & GenericScope;\n name: string;\n permit: Permit;\n vaultKey: string;\n expiration: string;\n items?: I;\n changed?: boolean;\n}\n\nexport interface Items<I extends object = VaultItems> {\n set?: Partial<I>;\n push?: Partial<I>;\n pop?: Partial<I>;\n}\n\n\n/**\n * Updates a vault's items\n * Base URL: PUT `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vault/{VAULT_KEY}`\n *\n * @example\n * import { vaultAdapter } from 'epicenter-libs';\n * // Change the name of the first student object in the list of students in the vault to \"Bob\"\n * await vaultAdapter.update('00000166d59adcb0f497ddc1aad0270c0a62', { set: { 'students.0.name': 'Bob' } });\n *\n * @param vaultKey Vault key\n * @param items Object with a set/push/pop field to update the vault items with\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.mutationKey] Mutation key for optimistic concurrency control\n * @returns promise that resolves to the vault\n */\nexport async function update<I extends object = VaultItems>(\n vaultKey: string,\n items: Items<I>,\n optionals: {\n mutationKey?: string;\n } & RoutingOptions = {},\n): Promise<Vault<I>> {\n const {\n mutationKey,\n ...routingOptions\n } = optionals;\n\n return await new Router()\n .withSearchParams({ mutationKey: mutationKey })\n .put(`/vault/${vaultKey}`, {\n body: {\n set: items.set ?? {},\n push: items.push ?? {},\n pop: items.pop ?? {},\n },\n ...routingOptions,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Updates a vault's properties\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vault/{VAULT_KEY}`\n *\n * @example\n * import { vaultAdapter, ROLE } from 'epicenter-libs';\n * await vaultAdapter.updateProperties('00000166d59adcb0f497ddc1aad0270c0a62', {\n * allowChannel: true,\n * permit: {\n * readLock: ROLE.FACILITATOR,\n * writeLock: ROLE.FACILITATOR,\n * },\n * ttlSeconds: 3600,\n * });\n * });\n *\n * @param vaultKey Vault key\n * @param update Object with properties to update\n * @param [update.mutationKey] Mutation key for optimistic concurrency control\n * @param [update.allowChannel] Opt into push notifications for this resource\n * @param [update.permit] Permission settings for the vault\n * @param [update.ttlSeconds] Time to live in seconds\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the vault\n */\nexport async function updateProperties<I extends object = VaultItems>(\n vaultKey: string,\n update: {\n mutationKey?: string;\n allowChannel?: boolean;\n permit?: Permit;\n ttlSeconds?: number;\n },\n optionals: RoutingOptions = {},\n): Promise<Vault<I>> {\n return await new Router()\n .patch(`/vault/${vaultKey}`, {\n body: {\n ...update,\n },\n ...optionals,\n }).then(({ body }) => body);\n}\n\n\nconst NOT_FOUND = 404;\n\n/**\n * Retrieves a vault by its vault key\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vault/{VAULT_KEY}`\n *\n * @example\n * import { vaultAdapter } from 'epicenter-libs';\n * const vault = await vaultAdapter.get('00000166d59adcb0f497ddc1aad0270c0a62');\n *\n * @param vaultKey Vault key\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the vault, or undefined if not found\n */\nexport async function get<I extends object = VaultItems>(\n vaultKey: string,\n optionals: RoutingOptions = {},\n): Promise<Vault<I>> {\n return await new Router()\n .get(`/vault/${vaultKey}`, optionals)\n .catch((error) => {\n if (error.status === NOT_FOUND) return { body: undefined };\n return Promise.reject(error);\n }).then(({ body }) => body);\n}\n\n\n/**\n * Retrieves a vault by name within a specific scope\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vault/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{VAULT_NAME}`\n *\n * @example\n * import { vaultAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const vault = await vaultAdapter.withScope('my-vault-name', {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * });\n *\n * @param name Name of the vault\n * @param scope Scope associated with the vault\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [scope.userKey] Optional key to scope the vault to a user\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the vault, or undefined if not found\n */\nexport async function withScope<I extends object = VaultItems>(\n name: string,\n scope: { userKey?: string } & GenericScope,\n optionals: RoutingOptions = {},\n): Promise<Vault<I>> {\n const { scopeBoundary, scopeKey, userKey } = scope;\n const uriComponent = userKey ? `/${userKey}` : '';\n return await new Router()\n .get(`/vault/with/${scopeBoundary}/${scopeKey}${uriComponent}/${name}`, optionals)\n .catch((error) => {\n if (error.status === NOT_FOUND) return { body: undefined };\n return Promise.reject(error);\n }).then(({ body }) => body);\n}\n\n\n/**\n * Retrieves all vaults with a specific name within a group or episode\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vault/in/{GROUP_NAME}/{VAULT_NAME}`\n *\n * @example\n * import { vaultAdapter } from 'epicenter-libs';\n * const vaults = await vaultAdapter.byName('my-vault-name', {\n * groupName: 'my-group',\n * episodeName: 'my-episode',\n * includeEpisodes: true,\n * });\n *\n * @param name Name of the vault\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.groupName] Name of the group to search within. Defaults to the session user's group.\n * @param [optionals.episodeName] Name of the episode to search within\n * @param [optionals.userKey] Optional user key to filter vaults by user\n * @param [optionals.includeEpisodes] Whether to include vaults from episodes within the group\n * @returns promise that resolves to an array of vaults with the specified name\n */\nexport async function byName<I extends object = VaultItems>(\n name: string,\n optionals: {\n groupName?: string;\n episodeName?: string;\n userKey?: string;\n includeEpisodes?: boolean;\n } & RoutingOptions = {},\n): Promise<Vault<I>[]> {\n const {\n groupName,\n episodeName,\n userKey,\n includeEpisodes,\n ...routingOptions\n } = optionals;\n const session = identification.session as UserSession;\n\n const searchParams = {\n userKey,\n includeEpisodes,\n };\n\n return await new Router()\n .withSearchParams(searchParams)\n .get(`/vault/in/${groupName ?? session?.groupName}${episodeName ? `/${episodeName}` : ''}/${name}`, {\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Deletes a vault\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vault/{VAULT_KEY}`\n *\n * @example\n * import { vaultAdapter } from 'epicenter-libs';\n * await vaultAdapter.remove('00000166d59adcb0f497ddc1aad0270c0a62');\n *\n * @param vaultKey Vault key\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.mutationKey] Mutation key for optimistic concurrency control\n * @returns promise that resolves to undefined when successful\n */\nexport async function remove(\n vaultKey: string,\n optionals: { mutationKey?: string } & RoutingOptions = {},\n): Promise<void> {\n const {\n mutationKey,\n ...routingOptions\n } = optionals;\n return await new Router()\n .withSearchParams({ mutationKey: mutationKey })\n .delete(`/vault/${vaultKey}`, routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Defines vault properties, used to create or modify a vault. Vault names are unique within their scope.\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vault/{COLLECTION_NAME}`\n *\n * @example\n * import { vaultAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * vaultAdapter.define('my-vault-name', {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * });\n *\n * @param name Name of the vault\n * @param scope Scope associated with your vault\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [scope.userKey] Optional key to scope the vault to a user\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.items] Optional items parameter for updating vault contents\n * @param [optionals.items.set] Sets a field in the vault, where `[name]: [value]`, send `[name]: null` to delete\n * @param [optionals.items.push] Adds an item to a list in the vault; if the list does not exist it will create one\n * @param [optionals.items.pop] Use to remove items from lists in a vault\n * @param [optionals.readLock] Role allowed to read\n * @param [optionals.writeLock] Role allowed to write\n * @param [optionals.ttlSeconds] Life span of the vault (defaults to null, minimum value of 1800 seconds / 30 minutes)\n * @param [optionals.mutationStrategy] Setting a mutation strategy allows for the following behaviors: ALLOW - Is an upsert which means if the entry exists it will be updated with the items in the POST. DISALLOW - Is an insert which means that if the entry exists no changes will be made (the 'changed' flag will be false). ERROR - Is an insert and, if the entry exists, a conflict exception will be thrown. If the mutationStrategy is omitted, it will simply search by scope and name; updating if it exists, creating if not.\n * @param [optionals.allowChannel] Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT\n * @returns promise that resolves to the vault (created or modified)\n */\nexport async function define<I extends object = VaultItems>(\n name: string,\n scope: { userKey?: string } & GenericScope,\n optionals: {\n items?: Items<I>;\n readLock?: keyof typeof ROLE;\n writeLock?: keyof typeof ROLE;\n ttlSeconds?: number;\n mutationStrategy?: string;\n allowChannel?: boolean;\n } & RoutingOptions = {},\n): Promise<Vault<I>> {\n const { scopeBoundary, scopeKey, userKey } = scope;\n const {\n readLock,\n writeLock,\n items,\n ttlSeconds,\n mutationStrategy = 'ERROR',\n allowChannel,\n ...routingOptions\n } = optionals;\n const { WORLD } = SCOPE_BOUNDARY;\n const { PARTICIPANT, USER } = ROLE;\n const defaultLock = scopeBoundary === WORLD ? PARTICIPANT : USER;\n\n const searchParams = { mutationStrategy };\n\n return await new Router()\n .withSearchParams(searchParams)\n .post(`/vault/${name}`, {\n body: {\n scope: {\n scopeBoundary,\n scopeKey,\n userKey,\n },\n permit: {\n readLock: readLock || defaultLock,\n writeLock: writeLock || defaultLock,\n },\n ttlSeconds,\n items,\n allowChannel,\n },\n ...routingOptions,\n }).then(({ body }) => body);\n}\n\n\n/**\n * @deprecated Use vaultAdapter.define instead. This method will be removed in the next release.\n *\n * Creates a new vault with the specified name, scope, and items\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vault/{COLLECTION_NAME}`\n *\n * @example\n * import { vaultAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * await vaultAdapter.create('my-vault-name', {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * }, {\n * set: { foo: 'bar' }\n * });\n *\n * @param name Name of the vault\n * @param scope Scope associated with your vault\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [scope.userKey] Optional key to scope the vault to a user\n * @param items Items to set, push, or pop in the vault\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.readLock] Role allowed to read\n * @param [optionals.writeLock] Role allowed to write\n * @param [optionals.ttlSeconds] Life span of the vault -- default to null, minimum value of 1800 (30 minutes)\n * @param [optionals.mutationStrategy] Mutation strategy: ALLOW (upsert), DISALLOW (insert without update), ERROR (insert with conflict exception if exists)\n * @returns promise that resolves to the created vault\n */\nexport async function create<I extends object = VaultItems>(\n name: string,\n scope: { userKey?: string } & GenericScope,\n items: Items<I>,\n optionals: {\n readLock?: keyof typeof ROLE;\n writeLock?: keyof typeof ROLE;\n ttlSeconds?: number;\n mutationStrategy?: string;\n } & RoutingOptions = {},\n): Promise<Vault<I>> {\n console.warn('DEPRECATION WARNING: vaultAdapter.create is deprecated and will be removed with the next release. Use vaultAdapter.define instead.');\n return await define<I>(name, scope, { items, ...optionals });\n}\n\n\n/**\n * Searches for vaults that match the search options; not paginable (hence named 'list' and not 'query')\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vault/search`\n *\n * @example\n * import { vaultAdapter } from 'epicenter-libs';\n * vaultAdapter.list({\n * filter: [\n * 'name|=vault-one|vault-two', // looks for any vaults with the names provided\n * 'scopeBoundary=WORLD', // looks for vaults scoped to a world\n * 'scopeKey=00000165ad4e6a3cd22b993340b963820239', // used in conjunction with the scopeBoundary\n * ],\n * sort: ['+vault.created'], // sort all findings by the 'created' field (ascending)\n * first: 3, // page should start with the 4th item found (defaults to 0)\n * max: 10, // page should only include the first 10 items\n * }, {\n * groupName: 'my-group-name', // search within a group\n * });\n *\n * @param searchOptions Search options\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.groupName] Name of the group\n * @returns promise that resolves to an array of vaults that match the search options\n */\nexport async function list<I extends object = VaultItems>(\n searchOptions: GenericSearchOptions,\n optionals: { groupName?: string } & RoutingOptions = {},\n): Promise<Vault<I>[]> {\n const { first, filter, max } = searchOptions;\n const searchParams = {\n filter: parseFilterInput(filter),\n first, max,\n };\n const {\n groupName,\n ...routingOptions\n } = optionals;\n\n return new Router()\n .withSearchParams(searchParams)\n .get(`/vault/search${groupName ? `/${groupName}` : ''}`, routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Counts the number of vaults that match the search options\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vault/count`\n *\n * @example\n * import { vaultAdapter } from 'epicenter-libs';\n * vaultAdapter.count({\n * filter: [\n * 'name|=vault-one|vault-two', // looks for any vaults with the names provided\n * 'scopeBoundary=WORLD', // looks for vaults scoped to a world\n * 'scopeKey=00000165ad4e6a3cd22b993340b963820239', // used in conjunction with the scopeBoundary\n * ],\n * }, {\n * groupName: 'my-group-name', // search within a group\n * });\n *\n * @param searchOptions Search options\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.groupName] Name of the group\n * @returns promise that resolves to the number of vaults that match the search options\n */\nexport async function count(\n searchOptions: GenericSearchOptions,\n optionals: { groupName?: string } & RoutingOptions = {},\n): Promise<number> {\n const { first, filter, max } = searchOptions;\n const searchParams = {\n filter: parseFilterInput(filter),\n first, max,\n };\n const {\n groupName,\n ...routingOptions\n } = optionals;\n\n return new Router()\n .withSearchParams(searchParams)\n .get(`/vault/count${groupName ? `/${groupName}` : ''}`, routingOptions)\n .then(({ body }) => body);\n}\n","import type { GenericScope, Address, Permit } from '../utils/constants';\nimport type { RoutingOptions, Page } from '../utils/router';\n\nimport Router from '../utils/router';\n\nexport interface VideoReadOutView {\n videoKey: string;\n family: string;\n affiliate: Affiliate;\n status: 'INITIALIZED' | 'RECORDED' | 'PROCESSED';\n scope: GenericScope;\n permit: Permit;\n address: Address;\n contents: string[];\n reference: string;\n created: string;\n lastUpdated: string;\n expiration: string;\n}\n\nexport const AFFILIATE = {\n VONAGE: 'VONAGE',\n DAILY: 'DAILY',\n DOMESTIC: 'DOMESTIC',\n} as const;\n\nexport type Affiliate = (typeof AFFILIATE)[keyof typeof AFFILIATE];\n\nexport type ProcessingType = 'transcription';\n\nexport const MEDIA_FORMAT = {\n mp3: 'mp3',\n mp4: 'mp4',\n wav: 'wav',\n flac: 'flac',\n ogg: 'ogg',\n amr: 'amr',\n webm: 'webm',\n} as const;\n\nexport type MediaFormat = (typeof MEDIA_FORMAT)[keyof typeof MEDIA_FORMAT];\n\nexport const LANGUAGE_CODE = {\n 'af-ZA': 'af-ZA',\n 'ar-AE': 'ar-AE',\n 'ar-SA': 'ar-SA',\n 'cy-GB': 'cy-GB',\n 'da-DK': 'da-DK',\n 'de-CH': 'de-CH',\n 'de-DE': 'de-DE',\n 'en-AB': 'en-AB',\n 'en-AU': 'en-AU',\n 'en-GB': 'en-GB',\n 'en-IE': 'en-IE',\n 'en-IN': 'en-IN',\n 'en-US': 'en-US',\n 'en-WL': 'en-WL',\n 'es-ES': 'es-ES',\n 'es-US': 'es-US',\n 'fa-IR': 'fa-IR',\n 'fr-CA': 'fr-CA',\n 'fr-FR': 'fr-FR',\n 'ga-IE': 'ga-IE',\n 'gd-GB': 'gd-GB',\n 'he-IL': 'he-IL',\n 'hi-IN': 'hi-IN',\n 'id-ID': 'id-ID',\n 'it-IT': 'it-IT',\n 'ja-JP': 'ja-JP',\n 'ko-KR': 'ko-KR',\n 'nl-NL': 'nl-NL',\n 'pt-BR': 'pt-BR',\n 'pt-PT': 'pt-PT',\n 'ru-RU': 'ru-RU',\n 'ta-IN': 'ta-IN',\n 'te-IN': 'te-IN',\n 'tr-TR': 'tr-TR',\n 'zh-CN': 'zh-CN',\n 'zh-TW': 'zh-TW',\n 'th-TH': 'th-TH',\n 'en-ZA': 'en-ZA',\n 'en-NZ': 'en-NZ',\n} as const;\n\nexport type LanguageCode = (typeof LANGUAGE_CODE)[keyof typeof LANGUAGE_CODE];\n\n/**\n * Represents a video directory.\n * @deprecated Use VideoReadOutView instead. VideoDir is an alias for backward compatibility.\n */\nexport type VideoDir = VideoReadOutView;\n\n\n/**\n * Retrieves a video URL by video key and file name\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/url/{VIDEO_KEY}/{FILE}`\n *\n * @example\n * import { videoAPI } from 'epicenter-libs';\n * const url = await videoAPI.getVideoURLByKey('recording.mp4', 'video-key-123');\n *\n * @param file Name of the file to retrieve\n * @param videoKey Video key identifier\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the video URL\n */\nexport async function getVideoURLByKey(\n file: string,\n videoKey: string,\n optionals: RoutingOptions = {},\n): Promise<string> {\n return await new Router()\n .get(`/video/url/${videoKey}/${file}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Retrieves a video URL by scope, affiliate, family, and file name\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/url/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{AFFILIATE}/{FAMILY}/{FILE}` or GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/url/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{USER_KEY}/{AFFILIATE}/{FAMILY}/{FILE}`\n *\n * @example\n * import { videoAPI } from 'epicenter-libs';\n * const url = await videoAPI.getVideoURLWith(\n * 'recording.mp4',\n * 'my-family',\n * 'DAILY',\n * { scopeBoundary: 'group', scopeKey: 'group-123' },\n * );\n *\n * @param file Name of the file to retrieve\n * @param family Family identifier for the video\n * @param affiliate Video service affiliate (VONAGE, DAILY, or DOMESTIC)\n * @param scope Scope associated with the video\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope\n * @param [scope.userKey] Optional key to scope the video to a user\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the video URL\n */\nexport async function getVideoURLWith(\n file: string,\n family: string,\n affiliate: Affiliate,\n scope: { userKey?: string } & GenericScope,\n optionals: RoutingOptions = {},\n): Promise<string> {\n const { scopeBoundary, scopeKey, userKey } = scope;\n const userKeyURIComponent = userKey ? `/${userKey}` : '';\n return await new Router()\n .get(`/video/url/with/${scopeBoundary}/${scopeKey}${userKeyURIComponent}/${affiliate}/${family}/${file}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Retrieves a video directory by video key\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/dir/{VIDEO_KEY}`\n *\n * @example\n * import { videoAPI } from 'epicenter-libs';\n * const dir = await videoAPI.getVideoDirectoryByKey('video-key-123');\n *\n * @param videoKey Video key identifier\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the video directory information\n */\nexport async function getVideoDirectoryByKey(\n videoKey: string,\n optionals: RoutingOptions = {},\n): Promise<VideoReadOutView> {\n return await new Router()\n .get(`/video/dir/${videoKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Retrieves a video directory by scope, affiliate, and family\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/dir/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{AFFILIATE}/{FAMILY}` or GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/dir/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{USER_KEY}/{AFFILIATE}/{FAMILY}`\n *\n * @example\n * import { videoAPI } from 'epicenter-libs';\n * const dir = await videoAPI.getVideoDirectoryWith(\n * 'my-family',\n * 'DAILY',\n * { scopeBoundary: 'group', scopeKey: 'group-123' },\n * );\n *\n * @param family Family identifier for the video\n * @param affiliate Video service affiliate (VONAGE, DAILY, or DOMESTIC)\n * @param scope Scope associated with the video\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope\n * @param [scope.userKey] Optional key to scope the video to a user\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the video directory information\n */\nexport async function getVideoDirectoryWith(\n family: string,\n affiliate: Affiliate,\n scope: { userKey?: string } & GenericScope,\n optionals: RoutingOptions = {},\n): Promise<VideoReadOutView> {\n const { scopeBoundary, scopeKey, userKey } = scope;\n const userKeyURIComponent = userKey ? `/${userKey}` : '';\n return await new Router()\n .get(`/video/dir/with/${scopeBoundary}/${scopeKey}${userKeyURIComponent}/${affiliate}/${family}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Searches for videos\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/search`\n *\n * @example\n * import { videoAPI } from 'epicenter-libs';\n * const videos = await videoAPI.getVideoSearch();\n *\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a page of videos\n */\nexport async function getVideoSearch(\n optionals: RoutingOptions = {},\n): Promise<Page<VideoReadOutView>> {\n return await new Router()\n .get('/video/search', optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Deletes a video by video key\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/{VIDEO_KEY}`\n *\n * @example\n * import { videoAPI } from 'epicenter-libs';\n * await videoAPI.deleteVideoByKey('video-key-123');\n *\n * @param videoKey Video key identifier\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves when the video is deleted\n */\nexport async function deleteVideoByKey(\n videoKey: string,\n optionals: RoutingOptions = {},\n): Promise<void> {\n return await new Router()\n .delete(`/video/${videoKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Processes a video with specified processors (e.g., transcription)\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/execute/{VIDEO_KEY}`\n *\n * @example\n * import { videoAPI } from 'epicenter-libs';\n * await videoAPI.postVideoProcessor('video-key-123', {\n * processors: [{\n * mediaFormat: 'mp4',\n * languageCode: 'en-US',\n * objectType: 'transcription',\n * }],\n * });\n *\n * @param videoKey Video key identifier\n * @param body Processing configuration\n * @param body.processors Array of processor configurations\n * @param [body.processors[].jobName] Optional name for the processing job\n * @param body.processors[].mediaFormat Media format (mp3, mp4, wav, etc.)\n * @param body.processors[].languageCode Language code for processing (e.g., 'en-US')\n * @param [body.processors[].timeoutMinutes] Optional timeout in minutes\n * @param [body.processors[].mediaFile] Optional specific media file to process\n * @param body.processors[].objectType Processing type (currently 'transcription')\n * @param [body.log] Optional log information\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to true if processing started successfully\n */\nexport async function postVideoProcessor(\n videoKey: string,\n body: {\n processors: {\n jobName?: string;\n mediaFormat: MediaFormat;\n languageCode: LanguageCode;\n timeoutMinutes?: number;\n mediaFile?: string;\n objectType: ProcessingType;\n }[];\n log?: string;\n },\n optionals: RoutingOptions = {},\n): Promise<boolean> {\n return await new Router()\n .post(`/video/execute/${videoKey}`, { body, ...optionals })\n .then(({ body }) => body);\n}\n\n\n/**\n * Downloads a video file by video key and file name\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/download/{VIDEO_KEY}/{FILE}`\n *\n * @example\n * import { videoAPI } from 'epicenter-libs';\n * await videoAPI.downloadVideoByKey('recording.mp4', 'video-key-123');\n *\n * @param file Name of the file to download\n * @param videoKey Video key identifier\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves when the download completes\n */\nexport async function downloadVideoByKey(\n file: string,\n videoKey: string,\n optionals: RoutingOptions = {},\n): Promise<void> {\n return await new Router()\n .get(`/video/download/${videoKey}/${file}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Downloads a video file by scope, affiliate, family, and file name\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/download/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{AFFILIATE}/{FAMILY}/{FILE}` or GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/download/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{USER_KEY}/{AFFILIATE}/{FAMILY}/{FILE}`\n *\n * @example\n * import { videoAPI } from 'epicenter-libs';\n * await videoAPI.downloadVideoWith(\n * 'recording.mp4',\n * 'my-family',\n * 'DAILY',\n * { scopeBoundary: 'group', scopeKey: 'group-123' },\n * );\n *\n * @param file Name of the file to download\n * @param family Family identifier for the video\n * @param affiliate Video service affiliate (VONAGE, DAILY, or DOMESTIC)\n * @param scope Scope associated with the video\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope\n * @param [scope.userKey] Optional key to scope the video to a user\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves when the download completes\n */\nexport async function downloadVideoWith(\n file: string,\n family: string,\n affiliate: Affiliate,\n scope: { userKey?: string } & GenericScope,\n optionals: RoutingOptions = {},\n): Promise<void> {\n const { scopeBoundary, scopeKey, userKey } = scope;\n const userKeyURIComponent = userKey ? `/${userKey}` : '';\n return await new Router()\n .get(`/video/download/with/${scopeBoundary}/${scopeKey}${userKeyURIComponent}/${affiliate}/${family}/${file}`, optionals)\n .then(({ body }) => body);\n}\n","import type { Page, RoutingOptions } from '../utils/router';\nimport type { GenericScope, GenericSearchOptions } from '../utils/constants';\nimport type { VideoReadOutView, Affiliate, ProcessingType, MediaFormat, LanguageCode } from '../apis/video';\n\nimport EpicenterError from '../utils/error';\nimport { parseFilterInput } from '../utils/filter-parser';\nimport * as videoAPI from '../apis/video';\n\n\n/**\n * Deletes a video (and its associated files)\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/{VIDEO_KEY}`\n *\n * @example\n * import { videoAdapter } from 'epicenter-libs';\n * await videoAdapter.remove(videoKey);\n *\n * @param videoKey Video key\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to undefined when successful\n */\nexport async function remove(\n videoKey: string,\n optionals: RoutingOptions = {},\n): Promise<void> {\n return videoAPI.deleteVideoByKey(videoKey, optionals);\n}\n\n\n/**\n * Open search for video objects\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/search`\n *\n * @example\n * import { videoAdapter } from 'epicenter-libs';\n * const videos = await videoAdapter.query({\n * filter: [\n * 'affiliate=VONAGE', // searches for videos provided by the Vonage affiliate\n * 'episodeName=myEpisode', // searches for videos tied to the episode with name 'myEpisode'\n * 'created>=2022-01-03T20:30:53.054Z', // searches for videos created after Jan 3rd 2022\n * ],\n * sort: ['+video.created'], // sort all findings by the 'created' field (ascending)\n * first: 0,\n * max: 25,\n * });\n *\n * @param searchOptions Search options\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a page of video objects\n */\nexport async function query(\n searchOptions: GenericSearchOptions,\n optionals: RoutingOptions = {},\n): Promise<Page<VideoReadOutView>> {\n const { filter, sort = [], first, max } = searchOptions;\n\n const searchParams = {\n filter: parseFilterInput(filter),\n sort: sort.join(';') || undefined,\n first, max,\n };\n\n return videoAPI.getVideoSearch({\n query: searchParams,\n paginated: true,\n ...optionals,\n });\n}\n\n\n/**\n * Gets a URL for a video file\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/url/{VIDEO_KEY}/{FILE}` or GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/url/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{AFFILIATE}/{FAMILY}/{FILE}`\n *\n * @example\n * import { videoAdapter } from 'epicenter-libs';\n *\n * // get using video key\n * videoAdapter.getURL('archive.mp4', {\n * videoKey: '0000017e31bb902cfe17615867d5005c5d5f',\n * });\n *\n * // get using scope/affiliate/family\n * videoAdapter.getURL('archive.mp4', {\n * scope: {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * },\n * affiliate: 'VONAGE',\n * family: 'archiveName'\n * });\n *\n * @param file Name of the file\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.scope] Scope object\n * @param [optionals.scope.scopeBoundary] Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param [optionals.scope.scopeKey] Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [optionals.scope.userKey] User attached to scope if necessary\n * @param [optionals.affiliate] Affiliate -- only support for one for now: Vonage\n * @param [optionals.family] Identifier for the resourced provided by the affiliate (in the case of Vonage, this is the archive name).\n * @param [optionals.videoKey] Key for the video object\n * @returns promise that resolves to the URL string for the video file\n */\nexport async function getURL(\n file: string,\n optionals: {\n scope?: { userKey?: string } & GenericScope;\n affiliate?: Affiliate;\n family?: string;\n videoKey?: string;\n } & RoutingOptions = {},\n): Promise<string> {\n const { scope, affiliate, family, videoKey, ...routingOptions } = optionals;\n if (scope && family && affiliate) {\n return videoAPI.getVideoURLWith(file, family, affiliate, scope, routingOptions);\n }\n if (videoKey) {\n return videoAPI.getVideoURLByKey(file, videoKey, routingOptions);\n }\n throw new EpicenterError('Cannot get video URL -- either a video key or scope/affiliate/family specification is required.');\n}\n\n\n/**\n * Gets a directory URL for a video file\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/dir/{VIDEO_KEY}` or GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/dir/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{AFFILIATE}/{FAMILY}`\n *\n * @example\n * import { videoAdapter } from 'epicenter-libs';\n *\n * // get using video key\n * videoAdapter.getDirectoryURL({\n * videoKey: '0000017e31bb902cfe17615867d5005c5d5f',\n * });\n *\n * // get using scope/affiliate/family\n * videoAdapter.getDirectoryURL({\n * scope: {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * },\n * affiliate: 'VONAGE',\n * family: 'archiveName'\n * });\n *\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.scope] Scope object\n * @param [optionals.scope.scopeBoundary] Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param [optionals.scope.scopeKey] Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [optionals.scope.userKey] User attached to scope if necessary\n * @param [optionals.affiliate] Affiliate -- only support for one for now: Vonage\n * @param [optionals.family] Identifier for the resourced provided by the affiliate (in the case of Vonage, this is the archive name).\n * @param [optionals.videoKey] Key for the video object\n * @returns promise that resolves to a video directory object containing file list and metadata\n */\nexport async function getDirectoryURL(\n optionals: {\n scope?: { userKey?: string } & GenericScope;\n affiliate?: Affiliate;\n family?: string;\n videoKey?: string;\n } & RoutingOptions = {},\n): Promise<VideoReadOutView> {\n const { scope, affiliate, family, videoKey, ...routingOptions } = optionals;\n if (scope && family && affiliate) {\n return videoAPI.getVideoDirectoryWith(family, affiliate, scope, routingOptions);\n }\n if (videoKey) {\n return videoAPI.getVideoDirectoryByKey(videoKey, routingOptions);\n }\n throw new EpicenterError('Cannot get video URL -- either a video key or scope/affiliate/family specification is required.');\n}\n\n\n/**\n * Processes a video (one example of this is transcribing a video)\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/execute/{VIDEO_KEY}`\n *\n * @example\n * const processors = [\n * {\n * mediaFormat: 'mp4',\n * languageCode: 'en-US',\n * objectType: 'transcription',\n * mediaFile: 'archive.mp4',\n * jobName: 'test-transcription',\n * },\n * ];\n * await videoAdapter.processVideo(videoKey, processors);\n *\n * @param videoKey Video key\n * @param [processors[]] List of processes to complete\n * @param [processors[].jobName] A string to specify the title of the newly file\n * @param [processors[].mediaFormat] The format of the file you are processing\n * @param [processors[].languageCode] The language which the video is recorded in\n * @param [processors[].timeoutMinutes] Optional- how long to wait before the call cancels out; defaults to 3 minutes\n * @param [processors[].mediaFile] The name of the media file to perform the process on\n * @param [processors[].objectType] The type of processing job to perform (currently limited to transcribe)\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @param [optionals.log] Name for log file\n * @returns promise that resolves to a boolean indicating success\n */\nexport async function processVideo(\n videoKey: string,\n processors: {\n jobName: string;\n mediaFormat: MediaFormat;\n languageCode: LanguageCode;\n timeoutMinutes?: number;\n mediaFile: string;\n objectType: ProcessingType;\n }[],\n optionals: {\n log?: string;\n } & RoutingOptions = {},\n): Promise<boolean> {\n const { log, ...routingOptions } = optionals;\n const body = {\n processors,\n log,\n };\n return videoAPI.postVideoProcessor(videoKey, body, routingOptions);\n}\n\n\n/**\n * Downloads a video file\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/download/{VIDEO_KEY}/{FILE}` or GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/download/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{AFFILIATE}/{FAMILY}/{FILE}`\n *\n * @example\n * import { videoAdapter } from 'epicenter-libs';\n * // download using video key\n * await videoAdapter.download('archive.mp4', {\n * videoKey: '0000017e31bb902cfe17615867d5005c5d5f',\n * });\n * // download using scope/affiliate/family\n * await videoAdapter.download('archive.mp4', {\n * scope: {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * },\n * affiliate: 'VONAGE',\n * family: 'archiveName'\n * });\n *\n * @param file Name of the file\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.scope] Scope object\n * @param [optionals.scope.scopeBoundary] Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param [optionals.scope.scopeKey] Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [optionals.scope.userKey] User attached to scope if necessary\n * @param [optionals.affiliate] Affiliate -- only support for one for now: Vonage\n * @param [optionals.family] Identifier for the resourced provided by the affiliate (in the case of Vonage, this is the archive name).\n * @param [optionals.videoKey] Key for the video object\n * @returns promise that resolves to undefined when download is complete\n */\nexport async function download(\n file: string,\n optionals: {\n scope?: { userKey?: string } & GenericScope;\n affiliate?: Affiliate;\n family?: string;\n videoKey?: string;\n } & RoutingOptions = {},\n): Promise<void> {\n const { scope, affiliate, family, videoKey, ...routingOptions } = optionals;\n if (scope && family && affiliate) {\n return videoAPI.downloadVideoWith(file, family, affiliate, scope, routingOptions);\n }\n if (videoKey) {\n return videoAPI.downloadVideoByKey(file, videoKey, routingOptions);\n }\n throw new EpicenterError('Cannot download video -- either a video key or scope/affiliate/family specification is required.');\n}\n","import type { GenericScope, Permit } from '../utils/constants';\nimport type { RoutingOptions } from '../utils/router';\n\nimport Router from '../utils/router';\n\n\nexport type SessionID = string;\nexport type ArchiveID = string;\nexport type APIKey = string;\nexport type Token = string;\nexport interface VonageSession {\n sessionId: SessionID;\n}\nexport interface VonageArchive {\n archiveId: string;\n status:\n | 'available'\n | 'deleted'\n | 'failed'\n | 'paused'\n | 'started'\n | 'stopped'\n | 'uploaded'\n | 'expired';\n}\n\n\n/**\n * Retrieves a Vonage session ID\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vonage/session`\n *\n * @example\n * import { vonageAPI } from 'epicenter-libs';\n * const session = await vonageAPI.getSession();\n * console.log(session.sessionId);\n *\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to an object containing the Vonage session ID\n */\nexport async function getSession(\n optionals: RoutingOptions = {},\n): Promise<{ sessionId: SessionID }> {\n return await new Router()\n .get('/vonage/session', optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Creates a token for a Vonage session\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vonage/token`\n *\n * @example\n * import { vonageAPI } from 'epicenter-libs';\n * const token = await vonageAPI.postToken({ sessionId: 'my-session-id' });\n * console.log(token.token);\n *\n * @param body Token request body\n * @param body.sessionId The Vonage session ID to create a token for\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to an object containing the Vonage token\n */\nexport async function postToken(\n body: { sessionId: string },\n optionals: RoutingOptions = {},\n): Promise<{ token: Token }> {\n return await new Router()\n // The initialLayoutClassList is a temporary fix for existing simulations;\n // This should likely be implemented differently if we decide to continue using Vonage;\n // We are currently investigating alternatives due to performance issues, so this solution just prevents API errors;\n .post('/vonage/token', { body: { ...body, initialLayoutClassList: ['placeholder'] }, ...optionals })\n .then(({ body }) => body);\n}\n\n\n/**\n * Creates an archive for a Vonage session\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vonage/archive`\n *\n * @example\n * import { vonageAPI } from 'epicenter-libs';\n * const archive = await vonageAPI.postArchive({\n * name: 'my-archive',\n * scope: { scopeBoundary: 'group', scopeKey: 'group-123' },\n * sessionId: 'session-id',\n * });\n *\n * @param body Archive configuration\n * @param body.name Name for the archive\n * @param body.scope Scope associated with the archive\n * @param body.scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param body.scope.scopeKey Scope key, a unique identifier tied to the scope\n * @param [body.scope.userKey] Optional key to scope the archive to a user\n * @param body.sessionId The Vonage session ID to archive\n * @param [body.permit] Optional permissions for the archive\n * @param [body.ttlSeconds] Time to live in seconds for the archive\n * @param [body.resolution] Resolution for the archive\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the created Vonage archive\n */\nexport async function postArchive(\n body: {\n name: string;\n scope: { userKey?: string } & GenericScope;\n sessionId: SessionID;\n permit?: Permit;\n ttlSeconds?: number;\n resolution?: string;\n },\n optionals: RoutingOptions = {},\n): Promise<VonageArchive> {\n return await new Router()\n .post('/vonage/archive', { body, ...optionals })\n .then(({ body }) => body);\n}\n\n\n/**\n * Retrieves Vonage API key information\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vonage/info`\n *\n * @example\n * import { vonageAPI } from 'epicenter-libs';\n * const info = await vonageAPI.getInfo();\n * console.log(info.apiKey);\n *\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to an object containing the Vonage API key\n */\nexport async function getInfo(\n optionals: RoutingOptions = {},\n): Promise<{ apiKey: APIKey }> {\n return await new Router()\n .get('/vonage/info', optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Deletes a Vonage archive by its ID\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vonage/archive/{ARCHIVE_ID}`\n *\n * @example\n * import { vonageAPI } from 'epicenter-libs';\n * await vonageAPI.deleteArchiveByID('archive-123');\n *\n * @param archiveID The ID of the archive to delete\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the deleted Vonage archive\n */\nexport async function deleteArchiveByID(\n archiveID: string,\n optionals: RoutingOptions = {},\n): Promise<VonageArchive> {\n return await new Router()\n .delete(`/vonage/archive/${archiveID}`, optionals)\n .then(({ body }) => body);\n}\n","import type { RoutingOptions } from '../utils/router';\nimport type { GenericScope } from '../utils/constants';\nimport type { APIKey, SessionID, Token, ArchiveID, VonageArchive, VonageSession } from '../apis/vonage';\n\nimport { ROLE } from '../utils/constants';\nimport * as vonageAPI from '../apis/vonage';\n\n\n/**\n * Gets the Vonage project ID (not to be confused with the Epicenter project). Used to initialize the session object on the client side\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vonage/info`\n *\n * @example\n * import OT from '@opentok/client';\n * import { vonageAdapter } from 'epicenter-libs';\n * const [sessionID, projectID] = await Promise.all([\n * vonageAdapter.createSession(),\n * vonageAdapter.getProjectID()\n * ]);\n * const vonageSession = OT.initSession(projectID, sessionID);\n *\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the Vonage project ID (otherwise known as the Vonage API key)\n */\nexport async function getProjectID(\n optionals: RoutingOptions = {},\n): Promise<APIKey> {\n return (await vonageAPI.getInfo(optionals)).apiKey;\n}\n\n\n/**\n * Calls the server SDK call for creating a session. Used to create a session object on the client side.\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vonage/session`\n *\n * @example\n * import OT from '@opentok/client';\n * import { vonageAdapter } from 'epicenter-libs';\n * const [sessionID, projectID] = await Promise.all([\n * vonageAdapter.createSession(),\n * vonageAdapter.getProjectID()\n * ]);\n * const vonageSession = OT.initSession(projectID, sessionID);\n *\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to an object containing the Vonage session ID\n */\nexport async function createSession(\n optionals: RoutingOptions = {},\n): Promise<VonageSession> {\n return vonageAPI.getSession(optionals);\n}\n\n\n/**\n * Creates a Vonage session token, used to connect a session.\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vonage/token`\n *\n * @example\n * import { vonageAdapter } from 'epicenter-libs';\n * const token = await vonageAdapter.generateToken('2_MX40NzQ...Y1TnZ-fg');\n * vonageSession.connect(token);\n *\n * @param sessionID ID of the session you're expecting to connect to using the token\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a Vonage session token\n */\nexport async function generateToken(\n sessionID: SessionID,\n optionals: RoutingOptions = {},\n): Promise<Token> {\n return (await vonageAPI.postToken({ sessionId: sessionID }, optionals)).token;\n}\n\n\n/**\n * Starts a Vonage archive -- a user recording of a Vonage session\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vonage/archive`\n *\n * @example\n * import { authAdapter, vonageAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const session = authAdapter.getLocalSession();\n * vonageAdapter.startArchive('my-archive', '2_MX40NzQ...Y1TnZ-fg', {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: session.groupKey,\n * })\n *\n * @param name Name of the archive; for your own purposes\n * @param sessionID ID of the session you're creating an archive for\n * @param scope Scope attached to the archive\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [scope.userKey] User key, to attach a user to the scope\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.readLock] Read permission role; one of the strings defined in ROLE\n * @param [optionals.writeLock] Write permission role; one of the strings defined in ROLE\n * @param [optionals.resolution] Video resolution the archive should be recorded at -- string like '1920x1080'\n * @param [optionals.ttlSeconds] Life span of the archive (how long before it is deleted); defaults to 604,800 (1 week), max of 31,536,000 (1 year)\n * @returns promise that resolves to an object containing the archive ID and status\n */\nexport async function startArchive(\n name: string,\n sessionID: SessionID,\n scope: { userKey?: string } & GenericScope,\n optionals: {\n readLock?: keyof typeof ROLE;\n writeLock?: keyof typeof ROLE;\n resolution?: string;\n ttlSeconds?: number;\n } & RoutingOptions = {},\n): Promise<VonageArchive> {\n const { readLock, writeLock, ttlSeconds, resolution, ...routingOptions } = optionals;\n const { PARTICIPANT, USER } = ROLE;\n const defaultLock = scope.userKey ? USER : PARTICIPANT;\n\n return vonageAPI.postArchive({\n name,\n sessionId: sessionID,\n scope,\n permit: {\n readLock: readLock ?? defaultLock,\n writeLock: writeLock ?? defaultLock,\n },\n ttlSeconds,\n resolution,\n }, routingOptions);\n}\n\n\n/**\n * Stops a Vonage archive -- begins the serialization process for a recording\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vonage/archive/{ARCHIVE_ID}`\n *\n * @example\n * import { vonageAdapter } from 'epicenter-libs';\n * vonageAdapter.stopArchive('004355...ede770e39');\n *\n * @param archiveID ID of the archive to stop\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to an object containing the archive ID and status (which should be \"stopped\")\n */\nexport async function stopArchive(\n archiveID: ArchiveID,\n optionals: RoutingOptions = {},\n): Promise<VonageArchive> {\n return vonageAPI.deleteArchiveByID(archiveID, optionals);\n}\n","import type { UserSession } from '../utils/identification';\nimport type { RoutingOptions } from '../utils/router';\nimport type { GenericScope } from '../utils/constants';\nimport type { PseudonymReadOutView } from './user';\n\nimport { Router, identification, SCOPE_BOUNDARY } from '../utils';\n\n// Generic type parameter for world role names\nexport type WorldRole = string;\n\nexport const OBJECTIVE = {\n MINIMUM: 'MINIMUM',\n MAXIMUM: 'MAXIMUM',\n MARGINAL: 'MARGINAL',\n OPTIMAL: 'OPTIMAL',\n} as const;\n\nexport type Objective = (typeof OBJECTIVE)[keyof typeof OBJECTIVE];\n\nexport type OrbitType = 'GROUP' | 'EPISODE';\n\nexport const WORLD_NAME_GENERATOR_TYPE = {\n colorAnimal: 'colorAnimal',\n sequential: 'sequential',\n} as const;\n\nexport type WorldNameGeneratorType = (typeof WORLD_NAME_GENERATOR_TYPE)[keyof typeof WORLD_NAME_GENERATOR_TYPE];\n\nexport interface ColorAnimalWorldNameGenerator {\n objectType: 'colorAnimal';\n}\n\nexport interface SequentialWorldNameGenerator {\n objectType: 'sequential';\n prefix?: string;\n}\n\nexport type WorldNameGenerator =\n | ColorAnimalWorldNameGenerator\n | SequentialWorldNameGenerator;\n\nexport interface AssignmentReadOutView<R extends WorldRole = WorldRole> {\n role: R;\n user: PseudonymReadOutView;\n}\n\nexport interface PersonaReadOutView<R extends WorldRole = WorldRole> {\n role: R;\n minimum?: number;\n maximum?: number;\n marginal?: number;\n insertionOrder?: number;\n}\n\nexport interface WorldReadOutView<R extends WorldRole = WorldRole> {\n lastUpdated: string;\n personae: PersonaReadOutView<R>[];\n assignments: AssignmentReadOutView<R>[];\n orbitKey: string;\n worldKey: string;\n created: string;\n orbitType: OrbitType;\n runKey: string;\n displayName: string;\n allowChannel: boolean;\n name: string;\n room: string;\n}\n\nexport interface AssignmentCreateInView<R extends WorldRole = WorldRole> {\n role?: R;\n userKey: string;\n}\n\nexport interface PersonaCreateInView<R extends WorldRole = WorldRole> {\n role: R;\n minimum?: number;\n maximum?: number;\n marginal?: number;\n insertionOrder?: number;\n}\n\ntype WorldKey = string;\nexport type AssignmentMap<R extends WorldRole = WorldRole> = Record<WorldKey, AssignmentCreateInView<R>[]>;\n\n/**\n * Updates fields for a particular world\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/world/{WORLD_KEY}`\n *\n * @example\n * import { worldAdapter } from 'epicenter-libs';\n * await worldAdapter.update('0000017a445032dc38cb2cecd5fc13708314', { runKey: '0000018d61f1217b22ce0ae605ff00609f5e', displayName: 'World A1' });\n *\n * @param worldKey Key associated with world\n * @param update Attributes you wish to update\n * @param [update.displayName] Display name of the world\n * @param [update.runKey] Key for the run you want to attach to the world\n * @param [update.allowChannel] Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the world with updated attributes\n */\nexport async function update<R extends WorldRole = WorldRole>(\n worldKey: string,\n update: {\n displayName?: string;\n runKey?: string;\n allowChannel?: boolean;\n },\n optionals: RoutingOptions = {},\n): Promise<WorldReadOutView<R>> {\n const {\n displayName,\n runKey,\n allowChannel,\n } = update;\n\n return await new Router()\n .patch(`/world/${worldKey}`, {\n body: {\n displayName,\n runKey,\n allowChannel,\n },\n ...optionals,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Deletes a world\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/world/{WORLD_KEY}`\n *\n * @example\n * import { worldAdapter } from 'epicenter-libs';\n * await worldAdapter.destroy('0000017a445032dc38cb2cecd5fc13708314');\n *\n * @param worldKey Key associated with world\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to undefined when successful\n */\nexport async function destroy(\n worldKey: string,\n optionals: RoutingOptions = {},\n): Promise<void> {\n return await new Router()\n .delete(`/world/${worldKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Creates a world\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/world/{GROUP_NAME}`\n *\n * @example\n * import { worldAdapter } from 'epicenter-libs';\n * await worldAdapter.create({ name: 'Whole New World' });\n *\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.name] Name of the new world (if omitted one will be provided by Epicenter). Must be unique within the world's scope.\n * @param [optionals.displayName] Display name of the new world\n * @param [optionals.groupName] Name of the group (defaults to name of group associated with session)\n * @param [optionals.episodeName] Name of the episode for episode scoping\n * @param [optionals.worldNameGenerator] Specifies how world names are generated\n * @param [optionals.worldNameGenerator.objectType] Can be either colorAnimal or sequential\n * @param [optionals.allowChannel] Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT\n * @returns promise that resolves to the newly created world\n */\nexport async function create<R extends WorldRole = WorldRole>(\n optionals: {\n name?: string;\n displayName?: string;\n groupName?: string;\n episodeName?: string;\n worldNameGenerator?: WorldNameGenerator;\n allowChannel?: boolean;\n } & RoutingOptions = {},\n): Promise<WorldReadOutView<R>> {\n const {\n name,\n displayName,\n groupName,\n episodeName,\n worldNameGenerator,\n allowChannel,\n ...routingOptions\n } = optionals;\n const session = identification.session as UserSession;\n return await new Router()\n .post(`/world/${groupName ?? session?.groupName}${episodeName ? `/${episodeName}` : ''}`, {\n body: {\n name,\n worldNameGenerator,\n displayName,\n allowChannel,\n },\n ...routingOptions,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Fetches the worlds in a group or episode if specified\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/world/{GROUP_NAME}`\n *\n * @example\n * // Gets all the worlds in the group attached to the session\n * import { worldAdapter } from 'epicenter-libs';\n * await worldAdapter.get();\n * // Gets all the worlds in the group attached to the session that the user is assigned to\n * import { worldAdapter } from 'epicenter-libs';\n * await worldAdapter.get({ mine: true });\n *\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.groupName] Name of the group (defaults to name of group associated with session)\n * @param [optionals.episodeName] Name of the episode for episode scoped worlds\n * @param [optionals.mine] Flag for indicating to get only the worlds the requesting user is in (based on session token)\n * @returns promise that resolves to a list of worlds\n */\nexport async function get<R extends WorldRole = WorldRole>(\n optionals: {\n groupName?: string;\n episodeName?: string;\n mine?: boolean;\n } & RoutingOptions = {},\n): Promise<WorldReadOutView<R>[]> {\n const {\n groupName, episodeName, mine,\n ...routingOptions\n } = optionals;\n const session = identification.session as UserSession;\n return await new Router()\n .withSearchParams({ mine })\n .get(`/world/${groupName ?? session?.groupName}${episodeName ? `/${episodeName}` : ''}`, routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Fetches the assignments (plus some world info) in a group or episode if specified\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/world/assignment/for/{GROUP_NAME}`\n *\n * @example\n * import { worldAdapter } from 'epicenter-libs';\n * worldAdapter.getAssignments({ mine: true });\n *\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.groupName] Name of the group (defaults to name of group associated with session)\n * @param [optionals.episodeName] Name of the episode for episode scoped worlds\n * @param [optionals.mine] Flag for indicating to get only the worlds the requesting user is in (based on session token)\n * @returns promise that resolves to a list of worlds the user is assigned to\n */\nexport async function getAssignments<R extends WorldRole = WorldRole>(\n optionals: {\n groupName?: string;\n episodeName?: string;\n mine?: boolean;\n } & RoutingOptions = {},\n): Promise<WorldReadOutView<R>[]> {\n const {\n groupName, episodeName, mine,\n ...routingOptions\n } = optionals;\n const session = identification.session as UserSession;\n return await new Router()\n .withSearchParams({ mine })\n .get(`/world/assignment/for/${groupName ?? session?.groupName}${episodeName ? `/${episodeName}` : ''}`, routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Fetches all worlds assigned to the current session's user\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/world/assignment`\n *\n * @example\n * import { worldAdapter } from 'epicenter-libs';\n * const worlds = await worldAdapter.getSessionWorlds();\n *\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to an array of worlds assigned to the current user\n */\nexport async function getSessionWorlds<R extends WorldRole = WorldRole>(\n optionals: RoutingOptions = {},\n): Promise<WorldReadOutView<R>[]> {\n return await new Router()\n .get('/world/assignment', optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Automatically assigns the current session's user a world\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/world/assignment`\n *\n * @example\n * // Assigns user to a group-scoped world\n * import { worldAdapter } from 'epicenter-libs';\n * await worldAdapter.selfAssign();\n * // Assigns user to a group-scoped world with role \"cartographer\"\n * import { worldAdapter } from 'epicenter-libs';\n * await worldAdapter.selfAssign({ role: 'cartographer' });\n * // Assigns user to an episode-scoped world with role \"cartographer\"\n * import { worldAdapter } from 'epicenter-libs';\n * await worldAdapter.selfAssign({ role: 'cartographer', episodeName: 'my-episode-name' });\n *\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.role] Role constraint -- will put the user in a world with a role\n * @param [optionals.groupName] Name of the group (defaults to name of group associated with session)\n * @param [optionals.episodeName] Name of the episode for episode scoped worlds\n * @param [optionals.objective] Allows platform to assign users beyond minimum amount\n * @param [optionals.worldNameGenerator] Specifies how world names are generated\n * @param [optionals.worldNameGenerator.objectType] Can be either colorAnimal or sequential\n * @param [optionals.populace] List of role description objects (personas) to dictate the self assignment\n * @param [optionals.populace[].role] Name of the role\n * @param [optionals.populace[].minimum] The minimum number of users that required for this role\n * @param [optionals.populace[].maximum] The maximum number of users that can be assigned to this role\n * @param [optionals.populace[].marginal] The maximum number of users that can be assigned to this role when using objective MARGINAL\n * @param [optionals.allowChannel] Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT\n * @returns promise that resolves to the world the user was assigned to\n */\nexport async function selfAssign<R extends WorldRole = WorldRole>(\n optionals: {\n role?: R;\n groupName?: string;\n episodeName?: string;\n objective?: keyof typeof OBJECTIVE;\n worldNameGenerator?: WorldNameGenerator;\n populace?: PersonaCreateInView<R>[];\n allowChannel?: boolean;\n } & RoutingOptions = {},\n): Promise<WorldReadOutView<R>> {\n const {\n role,\n groupName,\n episodeName,\n objective = OBJECTIVE.MINIMUM,\n worldNameGenerator,\n populace,\n allowChannel,\n ...routingOptions\n } = optionals;\n const session = identification.session as UserSession;\n return await new Router()\n .post(`/world/selfassign/${groupName ?? session?.groupName}${episodeName ? `/${episodeName}` : ''}`, {\n body: { role, objective, worldNameGenerator, populace, allowChannel },\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * (Auto assign) -- makes worlds given a list of users.\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/world/assignment`\n *\n * @example\n * import { worldAdapter } from 'epicenter-libs';\n * const worlds = await worldAdapter.assignUsers([\n * { userKey: '000001796733eef0842f4d6d960997018a43', role: 'locksmith' },\n * { userKey: '000001796733eef0842f4d6d960997018a3b' },\n * ]);\n *\n * @param assignments List of users assignment objects\n * @param assignments[].userKey User key\n * @param [assignments[].role] Role to assign to the user\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.role] Role constraint -- will put the user in a world with a role\n * @param [optionals.groupName] Name of the group (defaults to name of group associated with session)\n * @param [optionals.episodeName] Name of the episode for episode scoped worlds\n * @param [optionals.objective] Allows platform to assign users beyond minimum amount\n * @param [optionals.requireAllAssignments] Have the server return w/ an error whenever an assignment was not made (instead of silently leaving the user as unassigned)\n * @param [optionals.keepEmptyWorlds] Specify whether worlds that are now empty should be deleted\n * @param [optionals.worldNameGenerator] Specifies how world names are generated\n * @param [optionals.worldNameGenerator.objectType] Can be either colorAnimal or sequential\n * @param [optionals.populace] List of role description objects (personas) to use while creating assignments\n * @param [optionals.populace[].role] Name of the role\n * @param [optionals.populace[].minimum] The minimum number of users that required for this role\n * @param [optionals.populace[].maximum] The maximum number of users that can be assigned to this role\n * @param [optionals.populace[].marginal] The maximum number of users that can be assigned to this role when using objective MARGINAL\n * @param [optionals.allowChannel] Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT\n * @returns promise that resolves to the list of worlds created by the assignment\n */\nexport async function autoAssignUsers<R extends WorldRole = WorldRole>(\n assignments: AssignmentCreateInView<R>[],\n optionals: {\n groupName?: string;\n episodeName?: string;\n objective?: keyof typeof OBJECTIVE;\n worldNameGenerator?: WorldNameGenerator;\n requireAllAssignments?: boolean;\n keepEmptyWorlds?: boolean;\n populace?: PersonaCreateInView<R>[];\n allowChannel?: boolean;\n } & RoutingOptions = {},\n): Promise<WorldReadOutView<R>[]> {\n const {\n groupName,\n episodeName,\n objective = OBJECTIVE.MINIMUM,\n requireAllAssignments,\n worldNameGenerator,\n keepEmptyWorlds,\n populace,\n allowChannel,\n ...routingOptions\n } = optionals;\n const session = identification.session as UserSession;\n return await new Router()\n .post(`/world/assignment/${groupName ?? session?.groupName}${episodeName ? `/${episodeName}` : ''}`, {\n body: {\n assignments,\n objective,\n requireAllAssignments,\n worldNameGenerator,\n keepEmptyWorlds,\n populace,\n allowChannel,\n },\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Edits assignments across specified worlds\n * Base URL: PUT `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/world/assignment/{GROUP_NAME}`\n *\n * @example\n * import { worldAdapter } from 'epicenter-libs';\n * const updatedWorlds = await worldAdapter.editAssignments({\n * '0000017a445032dc38cb2cecd5fc13708314': [\n * { userKey: '000001796733eef0842f4d6d960997018a43', role: 'locksmith' },\n * { userKey: '000001796733eef0842f4d6d960997018a3b' },\n * ],\n * '0000017a445032dc38cb2cecd5fc13708315': [\n * { userKey: '000001796733eef0842f4d6d960997018a4c', role: 'navigator' },\n * ],\n * });\n *\n * @param assignments Map of world keys to list of user assignment objects\n * @param assignments[].userKey User key\n * @param [assignments[].role] Role to assign to the user\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.groupName] Name of the group (defaults to name of group associated with session)\n * @param [optionals.episodeName] Name of the episode for episode scoped worlds\n * @param [optionals.objective] Allows platform to assign users beyond minimum amount\n * @param [optionals.requireAllAssignments] Have the server return w/ an error whenever an assignment was not made (instead of silently leaving the user as unassigned)\n * @param [optionals.keepEmptyWorlds] Specify whether worlds that are now empty should be deleted\n * @returns promise that resolves to the list of worlds updated by the assignment\n */\nexport async function editAssignments<R extends WorldRole = WorldRole>(\n assignments: AssignmentMap<R>,\n optionals: {\n groupName?: string;\n episodeName?: string;\n objective?: keyof typeof OBJECTIVE;\n keepEmptyWorlds?: boolean;\n requireAllAssignments?: boolean;\n } & RoutingOptions = {},\n): Promise<WorldReadOutView<R>[]> {\n const {\n groupName, episodeName, objective = OBJECTIVE.MINIMUM, requireAllAssignments, keepEmptyWorlds,\n ...routingOptions\n } = optionals;\n const session = identification.session as UserSession;\n return await new Router()\n .put(`/world/assignment/${groupName ?? session?.groupName}${episodeName ? `/${episodeName}` : ''}`, {\n body: { assignments, objective, requireAllAssignments, keepEmptyWorlds },\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Retrieves the current assignment information for a given world\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/world/assignment/{WORLD_KEY}`\n *\n * @example\n * import { worldAdapter } from 'epicenter-libs';\n * const assignments = await worldAdapter.getAssignmentsByKey(world.worldKey);\n *\n * @param worldKey Key associated with the world\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the world containing the assignment object\n */\nexport async function getAssignmentsByKey<R extends WorldRole = WorldRole>(\n worldKey: string,\n optionals: RoutingOptions = {},\n): Promise<WorldReadOutView<R>> {\n return await new Router()\n .get(`/world/assignment/${worldKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Removes a user or list of users from all worlds in a given group or episode. Any worlds that do not contain users within them will be automatically deleted in the process.\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/world/assignment/{GROUP_NAME}`\n *\n * @example\n * import { worldAdapter } from 'epicenter-libs';\n * await worldAdapter.removeUser(user.userKey);\n *\n * @param userKeys List of keys associated with users to remove from worlds\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.groupName] Name of the group (defaults to name of group associated with session)\n * @param [optionals.episodeName] Name of the episode for episode scoped worlds\n * @param [optionals.keepEmptyWorlds] If the unassignment results in an empty world, whether to delete it\n * @returns promise that resolves to undefined when successful\n */\nexport async function removeUsers(\n userKeys: string[],\n optionals: {\n groupName?: string;\n episodeName?: string;\n keepEmptyWorlds?: boolean;\n } & RoutingOptions = {},\n): Promise<void> {\n const {\n groupName, episodeName, keepEmptyWorlds,\n ...routingOptions\n } = optionals;\n const session = identification.session as UserSession;\n return await new Router()\n .withSearchParams({ userKey: userKeys, keepEmptyWorlds: Boolean(keepEmptyWorlds) })\n .delete(`/world/assignment/${groupName ?? session?.groupName}${episodeName ? `/${episodeName}` : ''}`, routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Gets the personas of a given scope (project, group, episode, world). Personas correspond to a role that a user in the world can be assigned to.\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/world/persona/{SCOPE_BOUNDARY}/{SCOPE_KEY}`\n *\n * @example\n * import { worldAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * await worldAdapter.getPersonas({\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * });\n *\n * @param scope Scope associated with the persona set (by default the scope used will be the current project). Use this to do any specific overrides.\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to an array of personas for the specified scope\n */\nexport async function getPersonas<R extends WorldRole = WorldRole>(\n scope: GenericScope,\n optionals: RoutingOptions = {},\n): Promise<PersonaReadOutView<R>[]> {\n const { scopeBoundary, scopeKey } = scope;\n const boundary = scopeBoundary || SCOPE_BOUNDARY.PROJECT;\n /* We will at some point remove the need to explicitly lower case this */\n const boundaryComponent = boundary === SCOPE_BOUNDARY.WORLD ? '' : `/${boundary.toLowerCase()}`;\n const scopeKeyComponent = boundary === SCOPE_BOUNDARY.PROJECT ? '' : `/${scopeKey}`;\n const uriComponent = `${boundaryComponent}${scopeKeyComponent}`;\n\n return await new Router()\n .get(`/world/persona${uriComponent}`, {\n ...optionals,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Sets the personas of a given scope (project, group, episode, world). Personas correspond to a role a user in the world can be assigned to.\n * A null value for minimum is 0, but a null maximum is uncapped. A null marginal defaults to maximum. Personas with greater specificity override more general ones (which are by default PROJECT scoped).\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/world/persona/{SCOPE_BOUNDARY}/{SCOPE_KEY}`\n *\n * @example\n * import { worldAdapter } from 'epicenter-libs';\n * const scope = {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * };\n * const personas = [\n * { role: 'leader', minimum: 1 },\n * ];\n * await worldAdapter.setPersonas(personas, scope);\n *\n * @param personas List of role description objects (personas)\n * @param personas[].role Name of the role\n * @param [personas[].minimum] The minimum number of users that required for this role\n * @param [personas[].maximum] The maximum number of users that can be assigned to this role\n * @param [personas[].marginal] The maximum number of users that can be assigned to this role when using objective MARGINAL\n * @param scope Scope associated with the persona set (by default the scope used will be the current project). Use this to do any specific overrides.\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves with undefined when successful\n */\nexport async function setPersonas<R extends WorldRole = WorldRole>(\n personas: PersonaCreateInView<R>[],\n scope?: GenericScope,\n optionals: RoutingOptions = {},\n): Promise<void> {\n const boundary = scope?.scopeBoundary || SCOPE_BOUNDARY.PROJECT;\n /* We will at some point remove the need to explicitly lower case this */\n const boundaryComponent = boundary === SCOPE_BOUNDARY.WORLD ? '' : `/${boundary.toLowerCase()}`;\n const scopeKeyComponent = boundary === SCOPE_BOUNDARY.PROJECT ? '' : `/${scope?.scopeKey}`;\n const uriComponent = `${boundaryComponent}${scopeKeyComponent}`;\n\n return await new Router()\n .put(`/world/persona${uriComponent}`, {\n body: personas,\n ...optionals,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Assigns an existing run to the given world.\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/world/run/{WORLD_KEY}`\n *\n * @example\n * import { worldAdapter } from 'epicenter-libs';\n * await worldAdapter.assignRun(world.worldKey, { runKey: run.runKey });\n *\n * @param worldKey Key associated with the world\n * @param runKey Key associated with the run\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the newly resolved world\n */\nexport async function assignRun<R extends WorldRole = WorldRole>(\n worldKey: string,\n runKey: string,\n optionals: RoutingOptions = {},\n): Promise<WorldReadOutView<R>> {\n return await new Router()\n .patch(`/world/run/${worldKey}`, {\n body: { runKey },\n ...optionals,\n })\n .then(({ body }) => body);\n}\n","import type { RoutingOptions } from '../utils/router';\n\nimport Router from '../utils/router';\n\n\n/**\n * Fetches the current server time\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/time`\n *\n * @example\n * import { timeAdapter } from 'epicenter-libs';\n * const serverTime = await timeAdapter.get();\n *\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.accountShortName] Name of account (by default will be the account associated with the session)\n * @param [optionals.projectShortName] Name of project (by default will be the project associated with the session)\n * @returns promise that resolves to the current server time in ISO 8601 format, or undefined if not found\n */\nconst NOT_FOUND = 404;\nexport async function get(\n optionals: RoutingOptions = {},\n): Promise<void | string> {\n return await new Router()\n .get('/time', optionals)\n .catch((error) => {\n if (error.status === NOT_FOUND) return { body: undefined };\n return Promise.reject(error);\n }).then(({ body }) => body);\n}\n","import type { RoutingOptions } from '../utils/router';\nimport type { GenericScope, Address } from '../utils/constants';\n\nimport Router from '../utils/router';\n\nexport enum RETRY_POLICY {\n DO_NOTHING = 'DO_NOTHING', // If the task fails, do nothing (this is the default)\n RESCHEDULE = 'RESCHEDULE', // If the task fails retry at the next scheduled time point\n FIRE_ON_FAIL_SAFE = 'FIRE_ON_FAIL_SAFE', // Will re-execute the task after it fails; how long until this occurs is equal to ttlSeconds\n}\n\n// Generic type aliases for task adapter\nexport type TaskPayloadBody = Record<string, unknown>;\nexport type TaskPayloadHeaders = Record<string, string>;\n\n// Status type for group status tasks\nexport interface StatusReadOutView {\n code?: string;\n message?: string;\n}\n\nexport interface StatusCreateInView {\n code: string;\n message: string;\n}\n\n// Trigger type definitions for creating tasks\nexport interface CronTaskTriggerCreateInView {\n objectType: 'cron';\n value: string;\n}\n\nexport interface DateTaskTriggerCreateInView {\n objectType: 'date';\n value: string;\n}\n\nexport interface OffsetTaskTriggerCreateInView {\n objectType: 'offset';\n minutes?: number;\n hours?: number;\n days?: number;\n}\n\nexport type TaskTriggerCreateInView =\n | CronTaskTriggerCreateInView\n | DateTaskTriggerCreateInView\n | OffsetTaskTriggerCreateInView;\n\n// Payload type definitions for creating tasks\nexport interface HttpTaskPayloadCreateInView<\n B extends object = TaskPayloadBody,\n H extends object = TaskPayloadHeaders,\n> {\n objectType: 'http';\n method: string;\n url: string;\n body: B;\n headers?: H;\n}\n\nexport interface GroupStatusTaskPayloadCreateInView {\n objectType: 'groupStatus';\n groupKey: string;\n status: StatusCreateInView;\n}\n\nexport type TaskPayloadCreateInView<\n B extends object = TaskPayloadBody,\n H extends object = TaskPayloadHeaders,\n> =\n | HttpTaskPayloadCreateInView<B, H>\n | GroupStatusTaskPayloadCreateInView;\n\n// Payload type definitions for reading tasks\nexport interface HttpTaskPayloadReadOutView<\n B extends object = TaskPayloadBody,\n H extends object = TaskPayloadHeaders,\n> {\n objectType: 'http';\n method?: string;\n url?: string;\n body?: B;\n headers?: H;\n}\n\nexport interface GroupStatusTaskPayloadReadOutView {\n objectType: 'groupStatus';\n groupKey?: string;\n status?: StatusReadOutView;\n}\n\nexport type TaskPayloadReadOutView<\n B extends object = TaskPayloadBody,\n H extends object = TaskPayloadHeaders,\n> =\n | HttpTaskPayloadReadOutView<B, H>\n | GroupStatusTaskPayloadReadOutView;\n\n// Task response structure\nexport interface TaskReadOutView<\n B extends object = TaskPayloadBody,\n H extends object = TaskPayloadHeaders,\n> {\n taskKey?: string;\n name?: string;\n status?: string;\n cron?: string;\n mutationKey?: string;\n failures?: number;\n successes?: number;\n address?: Address;\n payload?: TaskPayloadReadOutView<B, H>;\n scope?: GenericScope;\n retryPolicy?: string;\n failSafeTermination?: string;\n ttlSeconds?: number;\n}\n\n\n/**\n * Creates a task; requires support level authentication\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/task`\n *\n * @example\n * import { taskAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const scope = {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: session.groupKey,\n * };\n * const name = 'task-1-send-emails';\n * const payload = {\n * method: 'POST',\n * url: 'https://forio.com/app/forio-dev/test-project/send-out-emails',\n * };\n * const trigger = {\n * value: '0 7 15 * * ?', // triggers on day 15 7am of each month\n * objectType: 'cron',\n * };\n * await taskAdapter.create(scope, name, payload, trigger);\n *\n * @param scope Scope associated with the task\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [scope.userKey] Key associated with the user\n * @param name Name of the task\n * @param payload An HTTP task object that will be executed when the task is triggered\n * @param payload.method Type of method to use with the HTTP request (e.g., 'GET', 'POST', 'PATCH')\n * @param payload.url The URL the HTTP request will be sent to\n * @param [payload.body] The body of the HTTP request\n * @param [payload.headers] Headers to send along with the HTTP request\n * @param trigger Object that determines when to run the task (cron, offset, or date)\n * @param [trigger.value] For cron: cron expression (e.g., '0 7 * * * ?'). For date: ISO-8601 date-time string\n * @param [trigger.objectType] Type of trigger: 'cron', 'offset', or 'date'\n * @param [trigger.minutes] For offset triggers: number of minutes until the task triggers\n * @param [trigger.hours] For offset triggers: number of hours until the task triggers\n * @param [trigger.days] For offset triggers: number of days until the task triggers\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.accountShortName] Name of account (by default will be the account associated with the session)\n * @param [optionals.projectShortName] Name of project (by default will be the project associated with the session)\n * @param [optionals.retryPolicy] Specifies what to do should the task fail; see RETRY_POLICY\n * @param [optionals.failSafeTermination] The ISO-8601 date-time when the task will be deleted regardless of any triggers; defaults to null\n * @param [optionals.ttlSeconds] Max life expectancy of the task; used to determine if retrying the task is necessary\n * @returns promise that resolves to the task object including the taskKey\n */\nexport async function create<\n B extends object = TaskPayloadBody,\n H extends object = TaskPayloadHeaders,\n>(\n scope: { userKey?: string } & GenericScope,\n name: string,\n payload: {\n method: string;\n url: string;\n body?: B;\n headers?: H;\n },\n trigger: TaskTriggerCreateInView,\n optionals: {\n retryPolicy?: keyof typeof RETRY_POLICY;\n failSafeTermination?: number;\n ttlSeconds?: number;\n } & RoutingOptions = {},\n): Promise<TaskReadOutView<B, H>> {\n const {\n retryPolicy,\n failSafeTermination,\n ttlSeconds,\n ...routingOptions\n } = optionals;\n return await new Router()\n .post(\n '/task',\n {\n body: {\n payload: { objectType: 'http' as const, ...payload },\n trigger,\n retryPolicy,\n failSafeTermination,\n ttlSeconds,\n scope,\n name,\n },\n ...routingOptions,\n },\n )\n .then(({ body }) => body);\n}\n\n\n/**\n * Deletes a task (changes status to cancelled); requires support level authentication\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/task/{TASK_KEY}`\n *\n * @example\n * import { taskAdapter } from 'epicenter-libs';\n * const taskKey = '0000017dd3bf540e5ada5b1e058f08f20461';\n * await taskAdapter.destroy(taskKey);\n *\n * @param taskKey Unique key associated with a task\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.accountShortName] Name of account (by default will be the account associated with the session)\n * @param [optionals.projectShortName] Name of project (by default will be the project associated with the session)\n * @returns promise that resolves to undefined when successful\n */\nexport async function destroy(\n taskKey: string,\n optionals: RoutingOptions = {},\n): Promise<void> {\n return await new Router()\n .delete(`/task/${taskKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Gets a task by taskKey; requires support level authentication\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/task/{TASK_KEY}`\n *\n * @example\n * import { taskAdapter } from 'epicenter-libs';\n * const taskKey = '0000017dd3bf540e5ada5b1e058f08f20461';\n * const task = await taskAdapter.get(taskKey);\n *\n * @param taskKey Unique key associated with a task\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.accountShortName] Name of account (by default will be the account associated with the session)\n * @param [optionals.projectShortName] Name of project (by default will be the project associated with the session)\n * @returns promise that resolves to the task object\n */\nexport async function get<\n B extends object = TaskPayloadBody,\n H extends object = TaskPayloadHeaders,\n>(taskKey: string, optionals: RoutingOptions = {}): Promise<TaskReadOutView<B, H>> {\n return await new Router()\n .get(`/task/${taskKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Gets the history (100 most recent times it has triggered) of a task by taskKey; requires support level authentication\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/task/history/{TASK_KEY}`\n *\n * @example\n * import { taskAdapter } from 'epicenter-libs';\n * const taskKey = '0000017dd3bf540e5ada5b1e058f08f20461';\n * const history = await taskAdapter.getHistory(taskKey);\n *\n * @param taskKey Unique key associated with a task\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.accountShortName] Name of account (by default will be the account associated with the session)\n * @param [optionals.projectShortName] Name of project (by default will be the project associated with the session)\n * @returns promise that resolves to an array of task history objects\n */\nexport async function getHistory<\n B extends object = TaskPayloadBody,\n H extends object = TaskPayloadHeaders,\n>(\n taskKey: string,\n optionals: RoutingOptions = {},\n): Promise<TaskReadOutView<B, H>[]> {\n return await new Router()\n .get(`/task/history/${taskKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Gets most recent 100 tasks related to the selected scope; requires support level authentication\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/task/in/{SCOPE_BOUNDARY}/{SCOPE_KEY}` or GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/task/in/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{USER_KEY}`\n *\n * Note: Will retrieve all tasks that were CREATED in the specified scope. If something was created with episode scope, it will not be retrievable through group scoping.\n *\n * @example\n * import { taskAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const scope = {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * };\n * const tasks = await taskAdapter.getTaskIn(scope);\n *\n * @param scope Scope associated with the tasks\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [scope.userKey] Key associated with the user; will retrieve tasks in the scope that were made by the specified user\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.accountShortName] Name of account (by default will be the account associated with the session)\n * @param [optionals.projectShortName] Name of project (by default will be the project associated with the session)\n * @returns promise that resolves to an array of task objects\n */\nexport async function getTaskIn<\n B extends object = TaskPayloadBody,\n H extends object = TaskPayloadHeaders,\n>(\n scope: { userKey?: string } & GenericScope,\n optionals: RoutingOptions = {},\n): Promise<TaskReadOutView<B, H>[]> {\n const { scopeBoundary, scopeKey, userKey } = scope;\n return await new Router()\n .get(\n `/task/in/${scopeBoundary}/${scopeKey}${\n userKey ? `/${userKey}` : ''\n }`,\n optionals,\n )\n .then(({ body }) => body);\n}\n","import type { GenericScope, GenericSearchOptions, Permit } from '../utils/constants';\nimport type { RoutingOptions, Page } from '../utils/router';\n\nimport Router from '../utils/router';\nimport { parseFilterInput } from '../utils/filter-parser';\n\nexport interface ChatMessageReadOutView {\n senderKey: string;\n receiverKey: string;\n created: string;\n id: string;\n message: string;\n}\n\nexport interface ChatReadOutView {\n permit: Permit;\n chatKey: string;\n messages: ChatMessageReadOutView[];\n room: string;\n scope: GenericScope;\n}\n\n\n/**\n * Updates the permissions of a chat\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/chat/{CHAT_KEY}`\n *\n * @example\n * import { chatAdapter, ROLE } from 'epicenter-libs';\n * await chatAdapter.updatePermit('0000017dd3bf540e5ada5b1e058f08f20461', {\n * readLock: ROLE.PARTICIPANT,\n * writeLock: ROLE.FACILITATOR,\n * });\n *\n * @param chatKey Key associated with the chat\n * @param permit Permit object with the updated permissions\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the updated chat\n */\nexport async function updatePermit(\n chatKey: string,\n permit: Permit,\n optionals: RoutingOptions = {},\n): Promise<ChatReadOutView> {\n return new Router()\n .patch(`/chat/${chatKey}`, {\n ...optionals,\n body: { permit },\n }).then(({ body }) => body);\n}\n\n\n/**\n * Creates a chat\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/chat`\n *\n * @example\n * import { chatAdapter, SCOPE_BOUNDARY, ROLE } from 'epicenter-libs';\n * const chat = await chatAdapter.create(\n * 'my-chat-room',\n * { scopeBoundary: SCOPE_BOUNDARY.GROUP, scopeKey: '00000165ad4e6a3cd22b993340b963820239' },\n * { readLock: ROLE.PARTICIPANT, writeLock: ROLE.PARTICIPANT }\n * );\n *\n * @param room Name of the chat\n * @param scope Scope of the chat; will not accept user scope\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param permit Permissions for the chat\n * @param permit.readLock Role allowed to read\n * @param permit.writeLock Role allowed to write\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the newly created chat\n */\nexport async function create(\n room: string,\n scope: GenericScope,\n permit: Permit,\n optionals: RoutingOptions = {},\n): Promise<ChatReadOutView> {\n return new Router()\n .post('/chat', {\n body: {\n scope: {\n scopeBoundary: scope.scopeBoundary,\n scopeKey: scope.scopeKey,\n },\n permit,\n room,\n },\n ...optionals,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Gets a chat\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/chat/{CHAT_KEY}`\n *\n * @example\n * import { chatAdapter } from 'epicenter-libs';\n * const chat = await chatAdapter.get('00000165ad4e6a3cd22b993340b963820239');\n *\n * @param chatKey Key of the associated chat\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the chat\n */\nexport async function get(\n chatKey: string,\n optionals: RoutingOptions = {},\n): Promise<ChatReadOutView> {\n return new Router()\n .get(`/chat/${chatKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Open search for chats, returns a page\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/chat/search`\n *\n * @example\n * import { chatAdapter } from 'epicenter-libs';\n * const page = await chatAdapter.query({\n * filter: [\n * 'room|=my-chat-room|my-other-chat|room-three', // looks for any rooms with the names provided\n * 'scopeBoundary=GROUP', // keeps the search within the group scope\n * 'scopeKey=00000165ad4e6a3cd22b993340b963820239', // used in conjunction with the scopeBoundary\n * 'chatKey=0000017dd3bf540e5ada5b1e058f08f20461', // searches for a specific chat\n * 'created>=2022-01-03T20:30:53.054Z', // looks for any chats created after Jan 3rd 2022\n * ],\n * sort: ['+chat.created'], // sort all findings by the 'created' field (ascending)\n * first: 3, // page should start with the 4th item found (defaults to 0)\n * max: 10, // page should only include the first 10 items\n * });\n *\n * @param searchOptions Search options for the query\n * @param [searchOptions.filter] Filters for searching\n * @param [searchOptions.sort] Sorting criteria\n * @param [searchOptions.first] The starting index of the page returned\n * @param [searchOptions.max] The number of entries per page\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a page of chats\n */\nexport async function query(\n searchOptions: GenericSearchOptions,\n optionals: RoutingOptions = {},\n): Promise<Page<ChatReadOutView>> {\n const { filter, sort = [], first = 0, max } = searchOptions;\n const searchParams = {\n filter: parseFilterInput(filter),\n sort: sort.join(';') || undefined,\n first, max,\n };\n return await new Router()\n .withSearchParams(searchParams)\n .get('/chat/search', {\n paginated: true,\n ...optionals,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Sends a message to a chat\n * Base URL: PUT `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/chat/message/{CHAT_KEY}` or PUT `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/chat/message/{CHAT_KEY}/{USER_KEY}`\n *\n * @example\n * import { chatAdapter } from 'epicenter-libs';\n * // Send a public message to the chat\n * await chatAdapter.sendMessage('0000017dd3bf540e5ada5b1e058f08f20461', 'hello');\n * // Send a private message to a specific user\n * await chatAdapter.sendMessage('0000017dd3bf540e5ada5b1e058f08f20461', 'hello, privately', { userKey: '000001796733eef0842f4d6d960997018a33' });\n *\n * @param chatKey Key associated with the chat\n * @param message Message text to send\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.userKey] Key of the user to send the message to. If omitted, will send as a public message\n * @returns promise that resolves to the chat message created\n */\nexport async function sendMessage(\n chatKey: string,\n message: string,\n optionals: { userKey?: string } & RoutingOptions = {},\n): Promise<ChatMessageReadOutView> {\n const { userKey, ...routingOptions } = optionals;\n const uriComponent = userKey ? `/${userKey}` : '';\n return new Router()\n .put(`/chat/message/${chatKey}${uriComponent}`, {\n body: { message },\n ...routingOptions,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Retrieves messages from for a given chat\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/chat/message/{CHAT_KEY}`\n *\n * @example\n * import { chatAdapter } from 'epicenter-libs';\n * // gets the chat message with id: 5\n * const message = await chatAdapter.getMessages('0000017dd3bf540e5ada5b1e058f08f20461', { horizon: 5, maxRecords: 1 });\n * // gets the 10 chat messages starting from id 5 (inclusive)\n * const messages = await chatAdapter.getMessages('0000017dd3bf540e5ada5b1e058f08f20461', { horizon: 5, maxRecords: 10 });\n *\n * @param chatKey Key associated with the chat\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.maxRecords] Maximum number of messages to get\n * @param [optionals.horizon] The message ID from which to start with; works backwards so if `maxRecords=20` and `horizon=50`, it will get the 20 messages starting from message ID 50, working backwards (50, 49, 48..., etc.). If this value is omitted the platform assumes it is the most recent message in the chat\n * @returns promise that resolves to the list of chat messages requested\n */\nexport async function getMessages(\n chatKey: string,\n optionals: {\n maxRecords?: number;\n horizon?: number;\n } & RoutingOptions = {},\n): Promise<ChatMessageReadOutView[]> {\n const { maxRecords, horizon, ...routingOptions } = optionals;\n return new Router()\n .withSearchParams({ maxRecords, horizon })\n .get(`/chat/message/${chatKey}`, routingOptions)\n .then(({ body }) => body);\n}\n\n/**\n * Retrieves messages for a given user; requires facilitator authentication; works with an admin user\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/chat/message/{CHAT_KEY}/{PSEUDONYM_KEY}`\n *\n * @example\n * import { chatAdapter } from 'epicenter-libs';\n * // gets the chat message with id: 5\n * const message = await chatAdapter.getMessagesForUser('0000017dd3bf540e5ada5b1e058f08f20461', '000001796733eef0842f4d6d960997018a33', { horizon: 5, maxRecords: 1 });\n * // gets the 10 chat messages starting from id 5 (inclusive)\n * const messages = await chatAdapter.getMessagesForUser('0000017dd3bf540e5ada5b1e058f08f20461', '000001796733eef0842f4d6d960997018a33', { horizon: 5, maxRecords: 10 });\n *\n * @param chatKey Key associated with the chat\n * @param pseudonymKey Key associated with the user whose messages are being retrieved\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.maxRecords] Maximum number of messages to get\n * @param [optionals.horizon] The message ID from which to start with; works backwards so if `maxRecords=20` and `horizon=50`, it will get the 20 messages starting from message ID 50, working backwards (50, 49, 48..., etc.). If this value is omitted the platform assumes it is the most recent message in the chat\n * @returns promise that resolves to the list of chat messages requested\n */\nexport async function getMessagesForUser(\n chatKey: string,\n pseudonymKey: string,\n optionals: {\n maxRecords?: number;\n horizon?: number;\n } & RoutingOptions = {},\n): Promise<ChatMessageReadOutView[]> {\n const { maxRecords, horizon, ...routingOptions } = optionals;\n return new Router()\n .withSearchParams({ maxRecords, horizon })\n .get(`/chat/message/${chatKey}/${pseudonymKey}`, routingOptions)\n .then(({ body }) => body);\n}\n\n/**\n * Retrieves messages from for a given chat for an admin user; requires support authentication\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/chat/message/all/{CHAT_KEY}`\n *\n * @example\n * import { chatAdapter } from 'epicenter-libs';\n * // gets the chat message with id: 5\n * const message = await chatAdapter.getMessagesAdmin('0000017dd3bf540e5ada5b1e058f08f20461', { horizon: 5, maxRecords: 1 });\n * // gets the 10 chat messages starting from id 5 (inclusive)\n * const messages = await chatAdapter.getMessagesAdmin('0000017dd3bf540e5ada5b1e058f08f20461', { horizon: 5, maxRecords: 10 });\n *\n * @param chatKey Key associated with the chat\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.maxRecords] Maximum number of messages to get\n * @param [optionals.horizon] The message ID from which to start with; works backwards so if `maxRecords=20` and `horizon=50`, it will get the 20 messages starting from message ID 50, working backwards (50, 49, 48..., etc.). If this value is omitted the platform assumes it is the most recent message in the chat\n * @returns promise that resolves to the list of chat messages requested\n */\nexport async function getMessagesAdmin(\n chatKey: string,\n optionals: {\n maxRecords?: number;\n horizon?: number;\n } & RoutingOptions = {},\n): Promise<ChatMessageReadOutView[]> {\n const { maxRecords, horizon, ...routingOptions } = optionals;\n return new Router()\n .withSearchParams({ maxRecords, horizon })\n .get(`/chat/message/all/${chatKey}`, routingOptions)\n .then(({ body }) => body);\n}\n\n/**\n * Sends a message to a chat as an admin user; requires support authentication\n * Base URL: PUT `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/chat/message/system/{CHAT_KEY}` or PUT `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/chat/message/system/{CHAT_KEY}/{USER_KEY}`\n *\n * @example\n * import { chatAdapter } from 'epicenter-libs';\n * // Send a public message to the chat\n * await chatAdapter.sendMessageAdmin('0000017dd3bf540e5ada5b1e058f08f20461', 'hello');\n * // Send a private message to a specific user\n * await chatAdapter.sendMessageAdmin('0000017dd3bf540e5ada5b1e058f08f20461', 'hello, privately', { userKey: '000001796733eef0842f4d6d960997018a33' });\n *\n * @param chatKey Key associated with the chat\n * @param message Message text to send\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.userKey] Key of the user to send the message to. If omitted, will send as a public message\n * @returns promise that resolves to the chat message created\n */\nexport async function sendMessageAdmin(\n chatKey: string,\n message: string,\n optionals: { userKey?: string } & RoutingOptions = {},\n): Promise<ChatMessageReadOutView> {\n const { userKey, ...routingOptions } = optionals;\n const uriComponent = userKey ? `/${userKey}` : '';\n return new Router()\n .put(`/chat/message/system/${chatKey}${uriComponent}`, {\n body: { message },\n ...routingOptions,\n }).then(({ body }) => body);\n}\n","import type { RoutingOptions } from '../utils/router';\nimport type { Actionable } from './run';\nimport type { WorldRole } from './world';\nimport type { PseudonymReadOutView } from './user';\n\nimport {\n Router,\n RITUAL,\n} from '../utils';\n\nexport interface BarrierArrival {\n arrived: string;\n message?: string;\n user: PseudonymReadOutView;\n}\n\nexport interface BarrierReadOutView<R extends WorldRole = WorldRole> {\n instantiated: boolean;\n triggered: boolean;\n closed: boolean;\n paused: boolean;\n transparent: boolean;\n worldKey: string;\n name: string;\n stage: string;\n ttlSeconds: number;\n secondsLeft: number;\n expectedRoles: Record<R, number>;\n impendingRoles: Record<R, PseudonymReadOutView[]>;\n arrivedRoles: Record<R, BarrierArrival[]>;\n allowChannel: boolean;\n}\n\nexport interface BarrierMap {\n [worldKey: string]: {\n name: string;\n stage: string;\n };\n}\n\n\n/**\n * Creates a new consensus barrier\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/consensus/{WORLD_KEY}/{NAME}/{STAGE}`\n *\n * @example\n * import { consensusAdapter } from 'epicenter-libs';\n * await consensusAdapter.create(\n * '00000173078afb05b4ae4c726637167a1a9e',\n * 'SUBMISSIONS',\n * 'ROUND1',\n * {\n * ROLE1: 1,\n * ROLE2: 1,\n * ROLE3: 2,\n * },\n * {\n * ROLE1: [{ name: 'step', arguments: [] }],\n * ROLE2: [{ name: 'step', arguments: [] }],\n * ROLE3: [{ name: 'step', arguments: [] }],\n * }\n * );\n *\n * @param worldKey World key for the world you are making a consensus barrier for\n * @param name Unique string to name a set of consensus barriers\n * @param stage Unique string to name one stage of the set of consensus barriers\n * @param expectedRoles Map where the keys are the names of each role participating and the number of users expected to submit consensus actions for each role\n * @param defaultActions Map defining which actions to take if the role specified in the key does not submit\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.ttlSeconds] How long the consensus barrier lasts for.\n * @param [optionals.transparent] If the barrier has `transparent: false`, then only one of the default actions will be sent. If it has `transparent: true` then they are all sent.\n * @param [optionals.allowChannel] Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT\n * @returns promise that resolves to the newly created consensus barrier\n */\nexport async function create<R extends WorldRole = WorldRole>(\n worldKey: string,\n name: string,\n stage: string,\n expectedRoles: Record<R, number>,\n defaultActions: Record<R, Actionable[]>,\n optionals: {\n ttlSeconds?: number;\n transparent?: boolean;\n allowChannel?: boolean;\n } & RoutingOptions = {},\n): Promise<BarrierReadOutView<R>> {\n const {\n ttlSeconds,\n transparent = false,\n allowChannel,\n ...routingOptions\n } = optionals;\n\n return await new Router()\n .post(`/consensus/${worldKey}/${name}/${stage}`, {\n body: {\n expectedRoles,\n ttlSeconds,\n transparent,\n actions: defaultActions,\n allowChannel,\n },\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Load one specific consensus barrier by specifying stage\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/consensus/{WORLD_KEY}/{NAME}/{STAGE}`\n *\n * @example\n * import { consensusAdapter } from 'epicenter-libs';\n * await consensusAdapter.load('00000173078afb05b4ae4c726637167a1a9e', 'SUBMISSIONS', 'ROUND1');\n *\n * @param worldKey World key for the world you are loading a consensus barrier for\n * @param name Unique string that names a set of consensus barriers\n * @param stage Unique string to specify which specific barrier to load\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the consensus barrier\n */\nexport async function load<R extends WorldRole = WorldRole>(\n worldKey: string,\n name: string,\n stage: string,\n optionals: RoutingOptions = {},\n): Promise<BarrierReadOutView<R>> {\n return await new Router()\n .get(`/consensus/${worldKey}/${name}/${stage}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * List all consensus barriers sharing the same name\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/consensus/{WORLD_KEY}/{NAME}`\n *\n * @example\n * import { consensusAdapter } from 'epicenter-libs';\n * await consensusAdapter.list('00000173078afb05b4ae4c726637167a1a9e', 'SUBMISSIONS');\n *\n * @param worldKey World key for the world you are loading consensus barriers for\n * @param name Unique string that specifies which set of consensus barriers to retrieve\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a list of consensus barriers\n */\nexport async function list<R extends WorldRole = WorldRole>(\n worldKey: string,\n name: string,\n optionals: RoutingOptions = {},\n): Promise<BarrierReadOutView<R>[]> {\n return await new Router()\n .get(`/consensus/${worldKey}/${name}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Facilitator only. Marks current consensus barrier as complete. Closing the barrier will send default actions for anyone who has not arrived. If the barrier is opaque, then only one of the default actions will be sent, and if it's transparent then they are all sent\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/consensus/close/{WORLD_KEY}/{NAME}/{STAGE}`\n *\n * @example\n * import { consensusAdapter } from 'epicenter-libs';\n * await consensusAdapter.forceClose('00000173078afb05b4ae4c726637167a1a9e', 'SUBMISSIONS', 'ROUND1');\n *\n * @param worldKey World key for the world you are making a consensus barrier for\n * @param name Unique string that names a set of consensus barriers\n * @param stage Unique string that specifies which stage of the set of consensus barriers to close\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.ritual] Ritual type for processing the consensus actions\n * @returns promise that resolves to the response\n */\nexport async function forceClose(\n worldKey: string,\n name: string,\n stage: string,\n optionals: {\n ritual?: keyof typeof RITUAL;\n } & RoutingOptions = {},\n): Promise<unknown> {\n const {\n ritual,\n ...routingOptions\n } = optionals;\n\n return await new Router()\n .post(`/consensus/close/${worldKey}/${name}/${stage}`, {\n body: {\n ritual,\n },\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Updates the default actions defined in .create. A user can only update their own default actions, and this call will only work for a barrier that has `transparent: true`\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/consensus/actions/{WORLD_KEY}/{NAME}/{STAGE}`\n *\n * @example\n * import { consensusAdapter } from 'epicenter-libs';\n * await consensusAdapter.updateDefaults(\n * '00000173078afb05b4ae4c726637167a1a9e',\n * 'SUBMISSIONS',\n * 'ROUND1',\n * [{ name: 'var1', value: 100, objectType: 'set' }]\n * );\n *\n * @param worldKey World key for the world you are making a consensus barrier for\n * @param name Unique string to name a set of consensus barriers\n * @param stage Unique string to name one stage of the set of consensus barriers\n * @param actions List of objects describing the default actions to update for the current user\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the updated consensus barrier\n */\nexport async function updateDefaults<R extends WorldRole = WorldRole>(\n worldKey: string,\n name: string,\n stage: string,\n actions: Record<R, Actionable[]>,\n optionals: RoutingOptions = {},\n): Promise<BarrierReadOutView<R>> {\n const {\n ...routingOptions\n } = optionals;\n\n return await new Router()\n .patch(`/consensus/actions/${worldKey}/${name}/${stage}`, {\n body: {\n actions,\n },\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Submits actions for your turn and marks you as having `submitted`.\n * Note that you can still call operations from the runAdapter directly, but will bypass the consensus requirements.\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/consensus/publish/{WORLD_KEY}/{NAME}/{STAGE}`\n *\n * @example\n * import { consensusAdapter } from 'epicenter-libs';\n * await consensusAdapter.submitActions(\n * '00000173078afb05b4ae4c726637167a1a9e',\n * 'SUBMISSIONS',\n * 'ROUND1',\n * [{ name: 'step', arguments: [] }],\n * { message: 'Student side submission!' },\n * );\n *\n * @param worldKey World key for the world you are making a consensus barrier for\n * @param name Unique string to name a set of consensus barriers\n * @param stage Unique string to name one stage of the set of consensus barriers\n * @param actions List of objects describing the actions to send\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.message] Message that is stored in the barrier arrival entity; opportunity to note a description regarding this submission\n * @param [optionals.ritual] Ritual type for processing the consensus actions\n * @returns promise that resolves to the response. Note: the response consensus object will have `triggered: true` for the final user that submits and triggers the barrier. triggered is a virtual field, not stored in the database as part of the barrier entity, so it only appears in the response for the final user submitting\n */\nexport async function submitActions(\n worldKey: string,\n name: string,\n stage: string,\n actions: Actionable[],\n optionals: {\n message?: string;\n ritual?: keyof typeof RITUAL;\n } & RoutingOptions = {},\n): Promise<unknown> {\n const {\n message,\n ritual,\n ...routingOptions\n } = optionals;\n return await new Router()\n .post(`/consensus/publish/${worldKey}/${name}/${stage}`, {\n body: {\n ritual,\n actions,\n message,\n },\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Deletes the targeted barrier, which allows users to create a new barrier with the same name and stage\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/consensus/{WORLD_KEY}/{NAME}/{STAGE}`\n *\n * @example\n * import { consensusAdapter } from 'epicenter-libs';\n * await consensusAdapter.deleteBarrier(\n * '00000173078afb05b4ae4c726637167a1a9e',\n * 'SUBMISSIONS',\n * 'ROUND1',\n * );\n *\n * @param worldKey World key for the world you are targeting\n * @param name Unique string that names a set of consensus barriers\n * @param stage Unique string to specify which specific barrier to delete\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the deleted consensus barrier\n */\nexport async function deleteBarrier<R extends WorldRole = WorldRole>(\n worldKey: string,\n name: string,\n stage: string,\n optionals: RoutingOptions = {},\n): Promise<BarrierReadOutView<R>> {\n const {\n ...routingOptions\n } = optionals;\n\n return await new Router()\n .delete(`/consensus/${worldKey}/${name}/${stage}`, {\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Deletes all barriers under the same name, which allows users to create new barriers with the same name and stage\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/consensus/{WORLD_KEY}/{NAME}`\n *\n * @example\n * import { consensusAdapter } from 'epicenter-libs';\n * await consensusAdapter.deleteAll(\n * '00000173078afb05b4ae4c726637167a1a9e',\n * 'SUBMISSIONS',\n * );\n *\n * @param worldKey World key for the world you are targeting\n * @param name Unique string that names a set of consensus barriers\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the deleted consensus barriers\n */\nexport async function deleteAll<R extends WorldRole = WorldRole>(\n worldKey: string,\n name: string,\n optionals: RoutingOptions = {},\n): Promise<BarrierReadOutView<R>> {\n const {\n ...routingOptions\n } = optionals;\n\n return await new Router()\n .delete(`/consensus/${worldKey}/${name}`, {\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Removes the currently logged in user from the list of users that have arrived at this barrier, thus allowing the user to redo their submission.\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/consensus/arrival/{WORLD_KEY}/{NAME}/{STAGE}`\n *\n * @example\n * import { consensusAdapter } from 'epicenter-libs';\n * await consensusAdapter.undoSubmit(\n * '00000173078afb05b4ae4c726637167a1a9e',\n * 'SUBMISSIONS',\n * 'ROUND1',\n * );\n *\n * @param worldKey World key for the world you are targeting\n * @param name Unique string that names a set of consensus barriers\n * @param stage Unique string to specify which specific barrier to undo your submission for\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the updated consensus barrier\n */\nexport async function undoSubmit<R extends WorldRole = WorldRole>(\n worldKey: string,\n name: string,\n stage: string,\n optionals: RoutingOptions = {},\n): Promise<BarrierReadOutView<R>> {\n const {\n ...routingOptions\n } = optionals;\n\n return await new Router()\n .delete(`/consensus/arrival/${worldKey}/${name}/${stage}`, {\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Facilitator only; artificial triggering of the arrival of a participant to the barrier. Useful for testing or for missing participants\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/consensus/trigger/{WORLD_KEY}/{NAME}/{STAGE}`\n *\n * @example\n * import { consensusAdapter } from 'epicenter-libs';\n * await consensusAdapter.triggerFor(\n * '00000173078afb05b4ae4c726637167a1a9e',\n * 'SUBMISSIONS',\n * 'ROUND1',\n * '0000017cb60ad697e109dcb11cdd4cfcdd1d',\n * [{ name: 'step', arguments: [] }],\n * { message: 'Facilitator triggered this submission!' },\n * );\n *\n * @param worldKey World key for the world you are targeting\n * @param name Unique string that names this set of consensus barriers\n * @param stage Unique string that names the stage of targeted barrier\n * @param userKey userKey of the user the facilitator is triggering for\n * @param actions List of objects describing the actions to send for the specified user\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.message] Message that is stored in the barrier arrival entity; opportunity to note a description regarding this submission\n * @param [optionals.ritual] Ritual type for processing the consensus actions\n * @returns promise that resolves to the response\n */\nexport async function triggerFor(\n worldKey: string,\n name: string,\n stage: string,\n userKey: string,\n actions: Actionable[],\n optionals: {\n message?: string;\n ritual?: keyof typeof RITUAL;\n } & RoutingOptions = {},\n): Promise<unknown> {\n const {\n ritual,\n message,\n ...routingOptions\n } = optionals;\n return await new Router()\n .post(`/consensus/trigger/${worldKey}/${name}/${stage}`, {\n\n body: {\n ritual,\n userKey,\n message,\n actions,\n },\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Facilitator only; removes the specified user from the list of users that have arrived at this barrier, thus allowing the user to redo their submission. This only removes the arrival, not the role expectation.\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/consensus/untrigger/{WORLD_KEY}/{NAME}/{STAGE}/{USER_KEY}`\n *\n * @example\n * import { consensusAdapter } from 'epicenter-libs';\n * await consensusAdapter.undoSubmitFor(\n * '00000173078afb05b4ae4c726637167a1a9e',\n * 'SUBMISSIONS',\n * 'ROUND1',\n * '0000017cb60ad697e109dcb11cdd4cfcdd1d',\n * );\n *\n * @param worldKey World key for the world you are targeting\n * @param name Unique string that names a set of consensus barriers\n * @param stage Unique string to specify which specific barrier to undo submission for\n * @param userKey userKey of the user the facilitator is undoing the submit for\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to undefined if successful\n */\nexport async function undoSubmitFor(\n worldKey: string,\n name: string,\n stage: string,\n userKey: string,\n optionals: RoutingOptions = {},\n): Promise<void> {\n const {\n ...routingOptions\n } = optionals;\n\n return await new Router()\n .delete(`/consensus/untrigger/${worldKey}/${name}/${stage}/${userKey}`, {\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Facilitator only; removes the entire role expectation from the consensus barrier based on the specified user's role assignment. This removes the expectation for that role and also removes any arrivals for that user. This is a structural change that affects all users with that role - the barrier will no longer wait for anyone with that role to submit.\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/consensus/expectation/{WORLD_KEY}/{NAME}/{STAGE}/{USER_KEY}`\n *\n * @example\n * import { consensusAdapter } from 'epicenter-libs';\n * await consensusAdapter.removeRoleExpectationFor(\n * '00000173078afb05b4ae4c726637167a1a9e',\n * 'SUBMISSIONS',\n * 'ROUND1',\n * '0000017cb60ad697e109dcb11cdd4cfcdd1d',\n * );\n *\n * @param worldKey World key for the world you are targeting\n * @param name Unique string that names a set of consensus barriers\n * @param stage Unique string to specify which specific barrier to remove the role expectation from\n * @param userKey userKey of a user whose role will be completely removed from the barrier expectations\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to undefined if successful\n */\nexport async function removeRoleExpectationFor(\n worldKey: string,\n name: string,\n stage: string,\n userKey: string,\n optionals: RoutingOptions = {},\n): Promise<void> {\n return await new Router()\n .delete(`/consensus/expectation/${worldKey}/${name}/${stage}/${userKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Pauses the TTL countdown timer for a timed consensus barrier. When paused, the timer stops counting down and the remaining time is preserved. Only works for barriers that have a ttlSeconds value set.\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/consensus/pause/{WORLD_KEY}/{NAME}/{STAGE}`\n *\n * @example\n * import { consensusAdapter } from 'epicenter-libs';\n * await consensusAdapter.pause(\n * '00000173078afb05b4ae4c726637167a1a9e',\n * 'SUBMISSIONS',\n * 'ROUND1',\n * );\n *\n * @param worldKey World key for the world you are targeting\n * @param name Unique string that names a set of consensus barriers\n * @param stage Unique string to specify which specific barrier to pause\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the updated consensus barrier\n */\nexport async function pause<R extends WorldRole = WorldRole>(\n worldKey: string,\n name: string,\n stage: string,\n optionals: RoutingOptions = {},\n): Promise<BarrierReadOutView<R>> {\n return await new Router()\n .patch(`/consensus/pause/${worldKey}/${name}/${stage}`, {\n body: {\n resume: false,\n },\n ...optionals,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Resumes the TTL countdown timer for a paused consensus barrier. The timer continues from where it was paused. Only works for barriers that were previously paused.\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/consensus/pause/{WORLD_KEY}/{NAME}/{STAGE}`\n *\n * @example\n * import { consensusAdapter } from 'epicenter-libs';\n * await consensusAdapter.resume(\n * '00000173078afb05b4ae4c726637167a1a9e',\n * 'SUBMISSIONS',\n * 'ROUND1',\n * );\n *\n * @param worldKey World key for the world you are targeting\n * @param name Unique string that names a set of consensus barriers\n * @param stage Unique string to specify which specific barrier to resume\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the updated consensus barrier\n */\nexport async function resume<R extends WorldRole = WorldRole>(\n worldKey: string,\n name: string,\n stage: string,\n optionals: RoutingOptions = {},\n): Promise<BarrierReadOutView<R>> {\n return await new Router()\n .patch(`/consensus/pause/${worldKey}/${name}/${stage}`, {\n body: {\n resume: true,\n },\n ...optionals,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Facilitator only; retrieves multiple consensus barriers across multiple worlds within a group or episode. This allows you to efficiently check the status of barriers across all specified worlds in a single API call.\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/consensus/in/{GROUP_NAME}` or POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/consensus/in/{GROUP_NAME}/{EPISODE_NAME}`\n *\n * @example\n * import { consensusAdapter } from 'epicenter-libs';\n * const barriers = await consensusAdapter.collectInGroup(\n * {\n * '00000173078afb05b4ae4c726637167a1a9e': { name: 'SUBMISSIONS', stage: 'ROUND1' },\n * '00000173078afb05b4ae4c726637167a1b2f': { name: 'SUBMISSIONS', stage: 'ROUND1' },\n * },\n * 'my-group-name',\n * { episodeName: 'my-episode-name' }\n * );\n *\n * @param barrierMap Map of world keys to barrier name/stage pairs\n * @param groupName Name of the group to collect barriers from\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.episodeName] Name of the episode to collect barriers from (optional)\n * @returns promise that resolves to an array of consensus barriers\n */\nexport async function collectInGroup<R extends WorldRole = WorldRole>(\n barrierMap: BarrierMap,\n groupName: string,\n optionals: {\n episodeName?: string;\n } & RoutingOptions = {},\n): Promise<BarrierReadOutView<R>[]> {\n const {\n episodeName,\n ...routingOptions\n } = optionals;\n\n return await new Router()\n .post(`/consensus/in/${groupName}${episodeName ? `/${episodeName}` : ''}`, {\n body: barrierMap,\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n","import type { Page, RoutingOptions } from '../utils/router';\nimport type { GenericScope } from '../utils/constants';\n\nimport Router from '../utils/router';\n\nexport interface Somebody {\n email: string;\n somebodyKey: string;\n scope: GenericScope;\n familyName?: string;\n givenName?: string;\n}\n\n\n/**\n * Adds somebody to an account; somebody is a person who is not a user, but whose information is used in a simulation; requires support level authentication\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/somebody`\n *\n * @example\n * import { somebodyAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const email = 'test@test.com';\n * const scope = {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * };\n * const somebody = await somebodyAdapter.create(email, scope, {\n * givenName: 'Person',\n * familyName: 'Family',\n * });\n *\n * @param email Email of the person being added\n * @param scope Scope associated with the somebody\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.givenName] Given name of the person\n * @param [optionals.familyName] Family name of the person\n * @returns promise that resolves to the newly created somebody object\n */\n\nexport async function create(\n email: string,\n scope: GenericScope,\n optionals: {\n givenName?: string;\n familyName?: string;\n } & RoutingOptions = {},\n): Promise<Somebody> {\n const {\n givenName,\n familyName,\n ...routingOptions\n } = optionals;\n return await new Router()\n .post(\n '/somebody',\n {\n body: {\n email,\n givenName,\n familyName,\n scope,\n },\n ...routingOptions,\n },\n )\n .then(({ body }) => body);\n}\n\n\n/**\n * Gets a somebody by their key\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/somebody/{SOMEBODY_KEY}`\n *\n * @example\n * import { somebodyAdapter } from 'epicenter-libs';\n * const somebodyKey = '0000017dd3bf540e5ada5b1e058f08f20461';\n * const somebody = await somebodyAdapter.get(somebodyKey);\n *\n * @param somebodyKey Key associated with the somebody\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the somebody object, or undefined if not found\n */\nconst NOT_FOUND = 404;\nexport async function get(\n somebodyKey: string,\n optionals: RoutingOptions = {},\n): Promise<Somebody | undefined> {\n return await new Router()\n .get(`/somebody/${somebodyKey}`, optionals)\n .catch((error) => {\n if (error.status === NOT_FOUND) return { body: undefined };\n return Promise.reject(error);\n }).then(({ body }) => body);\n}\n\n\n/**\n * Gets all somebodies within a specific scope\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/somebody/in/{SCOPE_BOUNDARY}/{SCOPE_KEY}`\n *\n * @example\n * import { somebodyAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const scope = {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * };\n * const somebodies = await somebodyAdapter.inScope(scope, { first: 0, max: 100 });\n *\n * @param scope Scope associated with the somebodies\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.first] Index of first result to return\n * @param [optionals.max] Maximum number of results to return (max of 300; default of 300)\n * @returns promise that resolves to a page of somebody objects, or undefined if not found\n */\nexport async function inScope(\n scope: GenericScope,\n optionals: {\n first?: number;\n max?: number;\n } & RoutingOptions = {},\n): Promise<Page<Somebody> | undefined> {\n const { scopeBoundary, scopeKey } = scope;\n const {\n first,\n max,\n ...routingOptions\n } = optionals;\n const searchParams = {\n first, max,\n };\n return await new Router()\n .withSearchParams(searchParams)\n .get(`/somebody/in/${scopeBoundary}/${scopeKey}`, {\n paginated: true,\n ...routingOptions,\n })\n .catch((error) => {\n if (error.status === NOT_FOUND) return { body: undefined };\n return Promise.reject(error);\n }).then(({ body }) => body);\n}\n\n\n/**\n * Gets a somebody by their email within a specific scope\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/somebody/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{EMAIL}`\n *\n * @example\n * import { somebodyAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const scope = {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * };\n * const somebody = await somebodyAdapter.byEmail('test@test.com', scope);\n *\n * @param email Email of the somebody to retrieve\n * @param scope Scope associated with the somebody\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the somebody object, or undefined if not found\n */\nexport async function byEmail(\n email: string,\n scope: GenericScope,\n optionals: RoutingOptions = {},\n): Promise<Somebody | undefined> {\n const { scopeBoundary, scopeKey } = scope;\n return await new Router()\n .get(`/somebody/with/${scopeBoundary}/${scopeKey}/${email}`, optionals)\n .catch((error) => {\n if (error.status === NOT_FOUND) return { body: undefined };\n return Promise.reject(error);\n }).then(({ body }) => body);\n}\n","import type { GenericScope } from '../utils/constants';\nimport type { RoutingOptions } from '../utils/router';\n\nimport Router from '../utils/router';\n\n/**\n * Creates a matchmaker list; requires facilitator level authentication\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/matchmaker/udome/{NAME}`\n *\n * @example\n * import { matchmakerAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const list = await matchmakerAdapter.create('my-matchmaker', 2, {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * });\n *\n * @param name The name for the matchmaker list\n * @param partners The number of partners each participant should be assigned\n * @param scope Scope associated with list\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the matchmaker list object\n */\nexport async function create(\n name: string,\n partners: number,\n scope: GenericScope,\n optionals: RoutingOptions = {},\n): Promise<Record<string, unknown>> {\n const { accountShortName, projectShortName, server } = optionals;\n\n return await new Router()\n .withServer(server)\n .withAccountShortName(accountShortName)\n .withProjectShortName(projectShortName)\n .post(`/matchmaker/udome/${name}`, {\n body: {\n scope,\n partners,\n },\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Changes the opened/closed status of a matchmaker list; requires facilitator level authentication\n * Base URL: PUT `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/matchmaker/udome/{UDOME_KEY}`\n *\n * @example\n * import { matchmakerAdapter } from 'epicenter-libs';\n * const list = await matchmakerAdapter.edit('udomeKey123', true);\n *\n * @param udomeKey The unique key for the targeted matchmaker list\n * @param closed Whether the matchmaker list is open or closed\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the matchmaker list object\n */\nexport async function edit(\n udomeKey: string,\n closed: boolean,\n optionals: RoutingOptions = {},\n): Promise<Record<string, unknown>> {\n const { accountShortName, projectShortName, server } = optionals;\n\n return await new Router()\n .withServer(server)\n .withAccountShortName(accountShortName)\n .withProjectShortName(projectShortName)\n .put(`/matchmaker/udome/${udomeKey}`, {\n body: {\n closed,\n },\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Adds the user making the request to the matchmaker list provided that it is open; requires participant authentication\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/matchmaker/udome`\n *\n * @example\n * import { matchmakerAdapter } from 'epicenter-libs';\n * const list = await matchmakerAdapter.addUser('udomeKey123');\n *\n * @param udomeKey The unique key for the targeted matchmaker list\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the matchmaker list object\n */\nexport async function addUser(\n udomeKey: string,\n optionals: RoutingOptions = {},\n): Promise<Record<string, unknown>> {\n const { accountShortName, projectShortName, server } = optionals;\n\n return await new Router()\n .withServer(server)\n .withAccountShortName(accountShortName)\n .withProjectShortName(projectShortName)\n .patch('/matchmaker/udome', {\n body: {\n udomeKey,\n },\n })\n .then(({ body }) => body);\n}\n\nconst NOT_FOUND = 404;\n/**\n * Gets a matchmaker list based on a udomeKey; requires participant level authentication\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/matchmaker/udome/{UDOME_KEY}`\n *\n * @example\n * import { matchmakerAdapter } from 'epicenter-libs';\n * const list = await matchmakerAdapter.get('udomeKey123');\n *\n * @param udomeKey The unique key for the targeted matchmaker list\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the matchmaker list object, or undefined if not found\n */\nexport async function get(\n udomeKey: string,\n optionals: RoutingOptions = {},\n): Promise<Record<string, unknown>> {\n const { accountShortName, projectShortName, server } = optionals;\n\n return await new Router()\n .withServer(server)\n .withAccountShortName(accountShortName)\n .withProjectShortName(projectShortName)\n .get(`/matchmaker/udome/${udomeKey}`)\n .catch((error) => {\n if (error.status === NOT_FOUND) return { body: undefined };\n return Promise.reject(error);\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Gets a matchmaker list based on name and scope; requires participant level authentication\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/matchmaker/udome/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{NAME}`\n *\n * @example\n * import { matchmakerAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const list = await matchmakerAdapter.byName('my-matchmaker', {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: 'GROUP_KEY',\n * });\n *\n * @param name The name of the matchmaker list\n * @param scope Scope associated with list\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the matchmaker list object, or undefined if not found\n */\nexport async function byName(\n name: string,\n scope: GenericScope,\n optionals: RoutingOptions = {},\n): Promise<Record<string, unknown>> {\n const { accountShortName, projectShortName, server } = optionals;\n const { scopeBoundary, scopeKey } = scope;\n\n return await new Router()\n .withServer(server)\n .withAccountShortName(accountShortName)\n .withProjectShortName(projectShortName)\n .get(`/matchmaker/udome/${scopeBoundary}/${scopeKey}/${name}`)\n .catch((error) => {\n if (error.status === NOT_FOUND) return { body: undefined };\n return Promise.reject(error);\n })\n .then(({ body }) => body);\n}\n","import type { RoutingOptions } from '../utils/router';\nimport type { GenericScope } from '../utils/constants';\n\nimport {\n Router,\n ROLE,\n Fault,\n} from '../utils';\nimport * as videoAdapter from './video';\n\nexport type RecordingType = 'CLOUD';\nexport type Privacy = 'PRIVATE';\nexport type StreamType = 'HLS';\n\nexport interface DailyRoomResponseReadOutView {\n name: string;\n url: string;\n}\n\nexport interface DailyMeetingTokenResponseReadOutView {\n token: string;\n}\n\nconst sleep = (ms: number) => new Promise((r) => setTimeout(r, ms));\n\nconst randRange = (min: number, max: number) => {\n return min + Math.random() * (max - min);\n};\n\n/* eslint-disable no-magic-numbers */\nconst RETRY_RANGES = [\n [6_000, 10_000],\n [11_000, 20_000],\n [30_000, 45_000],\n];\n/* eslint-enable no-magic-numbers */\n\nconst RATE_LIMIT_REACHED = 429;\nasync function handleRateLimit<T>(\n requestFunction: () => Promise<T>,\n retryNumber = 0,\n): Promise<T> {\n let response;\n try {\n response = await requestFunction();\n } catch (error) {\n if (error instanceof Fault && error.status === RATE_LIMIT_REACHED && retryNumber <= RETRY_RANGES.length) {\n const [min, max] = RETRY_RANGES[retryNumber];\n await sleep(randRange(min, max));\n response = await handleRateLimit(requestFunction, retryNumber + 1);\n } else {\n throw error;\n }\n }\n return response;\n}\n\n\n/**\n * Gets the daily configuration for the epicenter account. Requires Support auth\n *\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/daily/v1`\n *\n * @example\n * import { dailyAdapter } from 'epicenter-libs';\n * const config = await dailyAdapter.getConfig();\n *\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the daily object\n */\nexport async function getConfig(\n optionals: RoutingOptions = {},\n // TODO: investigate actual return type\n): Promise<unknown> {\n return await new Router()\n .get('/daily/v1', optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Creates a new daily meeting room\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/daily/v1/room`\n *\n * @example\n * import { dailyAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const room = await dailyAdapter.createRoom({\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461'\n * });\n *\n * @param scope Scope associated with your room\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [scope.userKey] Optional key to scope the room to a user\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.readLock] Role allowed to read\n * @param [optionals.writeLock] Role allowed to write\n * @param [optionals.ttlSeconds] Life span of any recording made (how long before it is deleted); defaults to 604,800 (1 week), max of 31,536,000 (1 year)\n * @param [optionals.privacy] Whether the room is private or not; currently can only be set to PRIVATE\n * @param [optionals.exp] When the room will be deleted in epoch seconds. Defaults to 24 hours. Max of 24 hours.\n * @param [optionals.enable_recording] The type of Daily recording method to use. Only CLOUD is currently permitted.\n * @param [optionals.streaming_endpoints] Details for daily streaming features.\n * @param [optionals.streaming_endpoints.name] Name of the stream\n * @param [optionals.streaming_endpoints.type] Type of the stream; only HLS is currently permitted\n * @param [optionals.streaming_endpoints.hls_config] Options for hls stream\n * @param [optionals.streaming_endpoints.hls_config.save_hls_recording] Whether or not to record the hls stream\n * @param [optionals.streaming_endpoints.hls_config.storage] Storage details for hls stream\n * @param [optionals.streaming_endpoints.hls_config.path] S3 storage path\n * @param [optionals.streaming_endpoints.hls_config.bucket_region] S3 bucket region\n * @param [optionals.streaming_endpoints.hls_config.assume_role_arn] S3 role ARN for permission to alter S3 resources\n * @param [optionals.streaming_endpoints.hls_config.bucket_name] S3 bucket name\n * @param [optionals.disableRateLimitHandling] Disable automatic rate limit retry handling\n * @returns promise that resolves to the newly created room details\n */\nexport async function createRoom(\n scope: { userKey?: string } & GenericScope,\n optionals: {\n readLock?: keyof typeof ROLE;\n writeLock?: keyof typeof ROLE;\n privacy?: Privacy;\n ttlSeconds?: number;\n exp?: number;\n enable_recording?: RecordingType;\n disableRateLimitHandling?: boolean;\n streaming_endpoints?: [{\n name: string;\n type: StreamType;\n hls_config: {\n storage: {\n path: string;\n bucket_region?: string;\n assume_role_arn?: string;\n bucket_name?: string;\n };\n save_hls_recording?: boolean;\n };\n }];\n } & RoutingOptions = {},\n): Promise<DailyRoomResponseReadOutView> {\n const {\n readLock,\n writeLock,\n ttlSeconds,\n privacy,\n exp,\n enable_recording,\n streaming_endpoints,\n disableRateLimitHandling,\n ...routingOptions\n } = optionals;\n const { PARTICIPANT } = ROLE;\n const callAPI = async (): Promise<DailyRoomResponseReadOutView> => {\n return await new Router()\n .post(\n '/daily/v1/room',\n {\n body: {\n epicenter: {\n ttlSeconds,\n scope,\n permit: {\n readLock: readLock || PARTICIPANT,\n writeLock: writeLock || PARTICIPANT,\n },\n },\n properties: {\n exp,\n enable_recording,\n streaming_endpoints,\n },\n privacy,\n },\n ...routingOptions,\n },\n )\n .then(({ body }) => body);\n };\n return handleRateLimit(callAPI, disableRateLimitHandling ? RETRY_RANGES.length + 1 : 0);\n}\n\n\n/**\n * Creates a token for a daily meeting room\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/daily/v1/meetingToken`\n *\n * @example\n * import { dailyAdapter } from 'epicenter-libs';\n * const token = await dailyAdapter.createToken('my-room-name');\n *\n * @param room_name Name of the room to create a token for\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.start_video_off] Whether the user should have their video off upon joining the meeting; defaults to true.\n * @param [optionals.is_owner] Whether the user has owner permissions; owner permissions are required to start a stream (not a recording); defaults to false\n * @param [optionals.user_name] Username to display in daily's system. This is relevant if the daily call is open in a separate window\n * @param [optionals.close_tab_on_exit] Whether to close the tab on the end of the call. This is relevant if the daily call is open in a separate window\n * @param [optionals.exp] When the token will be deleted in epoch seconds. Defaults to 24 hours. Max of 24 hours.\n * @param [optionals.enable_recording] The type of Daily recording method to permit. Only CLOUD is currently permitted.\n * @param [optionals.disableRateLimitHandling] Disable automatic rate limit retry handling\n * @param [optionals.selfSign] Whether to self-sign the token; defaults to true\n * @returns promise that resolves to the newly created token details\n */\nexport async function createToken(\n room_name: string,\n optionals: {\n start_video_off?: boolean;\n is_owner?: boolean;\n user_name?: string;\n close_tab_on_exit?: boolean;\n exp?: number;\n enable_recording?: RecordingType;\n disableRateLimitHandling?: boolean;\n selfSign?: boolean;\n } & RoutingOptions = {},\n): Promise<DailyMeetingTokenResponseReadOutView> {\n const {\n start_video_off,\n is_owner,\n user_name,\n close_tab_on_exit,\n exp,\n enable_recording,\n disableRateLimitHandling,\n selfSign = true,\n ...routingOptions\n } = optionals;\n const callAPI = async (): Promise<DailyMeetingTokenResponseReadOutView> => {\n return await new Router()\n .withSearchParams({ selfSign })\n .post(\n '/daily/v1/meetingToken',\n {\n body: {\n properties: {\n room_name,\n start_video_off,\n is_owner,\n user_name,\n close_tab_on_exit,\n exp,\n enable_recording,\n },\n },\n ...routingOptions,\n },\n )\n .then(({ body }) => body);\n };\n return handleRateLimit(callAPI, disableRateLimitHandling ? RETRY_RANGES.length + 1 : 0);\n}\n\n\n/**\n * Convenience function for retrieving the most recent recording for a Daily room\n *\n * @example\n * import { dailyAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const videoUrl = await dailyAdapter.getVideoByRecordingId('my-room', 'recording_instance_id', {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461'\n * });\n *\n * @param room_name Name of the room\n * @param recordingId Recording instance ID\n * @param scope Scope associated with the room\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [scope.userKey] Optional key to scope the room to a user\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a url if a video exists or null if it does not\n */\nexport async function getVideoByRecordingId(\n room_name: string,\n recordingId: string,\n scope: { userKey?: string } & GenericScope,\n optionals: RoutingOptions = {},\n): Promise<string | null> {\n const filePathInfo = await videoAdapter.getDirectoryURL({\n scope,\n affiliate: 'DAILY',\n family: room_name,\n ...optionals,\n });\n const filePaths = filePathInfo.contents;\n if (!filePaths?.length) return null;\n filePaths.sort((a, b) => Number(b.split('.')[0]) - Number(a.split('.')[0]));\n const filePath = filePaths.find((p) => p.includes(recordingId) && p.includes('.mp4'));\n if (!filePath) return null;\n return await videoAdapter.getURL(filePath, {\n scope,\n affiliate: 'DAILY',\n family: room_name,\n ...optionals,\n });\n}\n\n\n/**\n * Sets the daily family/room to a recording status of recorded; necessary to prevent videos from deleting automatically within 1 hour\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/daily/v1/meetingToken/{ROOM_NAME}`\n *\n * @example\n * import { dailyAdapter } from 'epicenter-libs';\n * const success = await dailyAdapter.updateRecordingStatus('my-room');\n *\n * @param room_name Name of the room\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to true if successful\n */\nexport async function updateRecordingStatus(\n room_name: string,\n optionals: RoutingOptions = {},\n): Promise<boolean> {\n return await new Router()\n .delete(`/daily/v1/meetingToken/${room_name}`, optionals)\n .then(({ body }) => body);\n}\n","import type { Page, RoutingOptions } from '../utils/router';\nimport type { GenericScope } from '../utils/constants';\nimport type { PseudonymReadOutView } from './user';\n\nimport { Router, identification } from '../utils';\nimport { UserSession } from 'epicenter';\n\nexport interface WalletItemReadOutView {\n label: string;\n value: string | null;\n}\n\nexport interface WalletReadOutView {\n walletKey: string;\n scope: { userKey: string } & GenericScope;\n user: PseudonymReadOutView;\n items: WalletItemReadOutView[];\n}\n\nexport interface WalletItemCreateInView {\n label: string;\n value?: string;\n}\n\n\n/**\n * Updates a wallet\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/wallet`\n *\n * @example\n * // Add a user's phone number to their wallet\n * import { walletAdapter } from 'epicenter-libs';\n * const scope = {\n * userKey: '000001796733eef0842f4d6d960997018a33',\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * };\n * walletAdapter.update(scope, [{ label: 'phone', value: '555-555-5555' }]);\n *\n * @param scope Scope attached to the wallet; userKey is required\n * @param scope.scopeBoundary Can be a couple things, commonly group, project, episode, or world\n * @param scope.scopeKey Key of the resource defined by the scope boundary\n * @param scope.userKey User key for the user creating the entry, if omitted will use the one in current session\n * @param items List of items to update the wallet with\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the updated wallet\n */\nexport async function update(\n scope: { userKey: string | undefined } & GenericScope,\n items: WalletItemCreateInView[],\n optionals: RoutingOptions = {},\n): Promise<WalletReadOutView> {\n const session = identification.session as UserSession;\n scope.userKey ??= session?.userKey;\n return await new Router()\n .post('/wallet', {\n body: {\n items,\n scope,\n },\n ...optionals,\n }).then(({ body }) => body);\n}\n\nconst NOT_FOUND = 404;\n/**\n * Gets a wallet\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/wallet/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{USER_KEY}`\n *\n * @example\n * // Get a user's wallet\n * import { walletAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const scope = {\n * userKey: '000001796733eef0842f4d6d960997018a33',\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * };\n * walletAdapter.get(scope);\n *\n * @param scope Scope attached to the wallet; userKey is required\n * @param scope.scopeBoundary Can be a couple things, commonly group, project, episode, or world\n * @param scope.scopeKey Key of the resource defined by the scope boundary\n * @param scope.userKey User key for the user creating the entry, if omitted will use the one in current session\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the wallet\n */\nexport async function get(\n scope: { userKey: string } & GenericScope,\n optionals: RoutingOptions = {},\n): Promise<WalletReadOutView | undefined> {\n const { scopeBoundary, scopeKey } = scope;\n let { userKey } = scope;\n const session = identification.session as UserSession;\n userKey ??= session?.userKey;\n return await new Router()\n .get(`/wallet/${scopeBoundary}/${scopeKey}/${userKey}`, optionals)\n .catch((error) => {\n if (error.status === NOT_FOUND) return { body: undefined };\n return Promise.reject(error);\n }).then(({ body }) => body);\n}\n\n\n/**\n * Get all wallets under a certain scope\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/wallet/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}`\n *\n * @example\n * // Get all wallets under a group\n * import { walletAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const scope = {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * };\n * walletAdapter.withScope(scope);\n *\n * @param scope Scope attached to the wallets\n * @param scope.scopeBoundary Can be a couple things, commonly group, project, episode, or world\n * @param scope.scopeKey Key of the resource defined by the scope boundary\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a page of wallets\n */\nexport async function withScope(\n scope: GenericScope,\n optionals: {\n first?: number;\n max?: number;\n } & RoutingOptions = {},\n): Promise<Page<WalletReadOutView>> {\n const { scopeBoundary, scopeKey } = scope;\n const { first = 0, max, ...routingOptions } = optionals;\n\n return await new Router()\n .withSearchParams({ first, max })\n .get(`/wallet/with/${scopeBoundary}/${scopeKey}`, {\n paginated: true,\n ...routingOptions,\n })\n .catch((error) => {\n if (error.status === NOT_FOUND) return { body: undefined };\n return Promise.reject(error);\n }).then(({ body }) => body);\n}\n","import type { SubscriptionHandle, Message } from 'cometd';\nimport type { GenericScope } from '../utils/constants';\n\nimport { EpicenterError, SCOPE_BOUNDARY, PUSH_CATEGORY } from '../utils';\nimport cometdAdapter from './cometd';\n\n// Generic type for push channel message custom data\nexport type ChannelMessageData = unknown;\n\n// Base structure for channel push messages\nexport interface ChannelMessage<D = ChannelMessageData> {\n /** The destination address for the message. */\n address: {\n /** The scope boundary of the address (e.g. 'WORLD'). */\n boundary: string;\n /** The push category of the address (e.g. 'RUN'). */\n category: string;\n /** The scope key of the address (e.g. your worldKey if boundary is 'WORLD'). */\n key: string;\n };\n /** The sender of the message. */\n sender: {\n /** The type of the sender (e.g., 'USER', 'SYSTEM'). */\n type: string;\n /** The key of the sender. */\n key: string;\n };\n /** The message content/payload. */\n content: D;\n /** The ISO 8601 date string when the message was sent. */\n date: string;\n /** The type/category of the message. */\n type: string;\n}\n\nexport interface ChannelScope extends GenericScope {\n pushCategory: keyof typeof PUSH_CATEGORY;\n}\n\nconst validateScope = (scope: ChannelScope) => {\n if (!scope) throw new EpicenterError('No scope found where one was required');\n const { scopeBoundary, scopeKey, pushCategory } = scope;\n if (!scopeBoundary) throw new EpicenterError('Missing scope component: scopeBoundary');\n if (!scopeKey) throw new EpicenterError('Missing scope component: scopeKey');\n if (!pushCategory) throw new EpicenterError('Missing scope component: pushCategory');\n if (!Object.prototype.hasOwnProperty.call(SCOPE_BOUNDARY, scopeBoundary)) throw new EpicenterError(`Invalid scope boundary: ${scopeBoundary}`);\n if (!Object.prototype.hasOwnProperty.call(PUSH_CATEGORY, pushCategory)) throw new EpicenterError(`Invalid push category: ${pushCategory}`);\n};\n\n/**\n * Used to subscribe to CometD channels. Pass in a channel scope to instantiate, if a subscription to that scope already exists it will use it.\n *\n * @example\n * import { Channel, authAdapter, SCOPE_BOUNDARY, PUSH_CATEGORY } from 'epicenter-libs';\n * const session = authAdapter.getLocalSession();\n * const channel = new Channel({\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: session.groupKey,\n * pushCategory: PUSH_CATEGORY.CHAT,\n * });\n * await channel.subscribe((data) => {\n * console.log('Received message:', data);\n * });\n */\nexport default class Channel<D = ChannelMessageData> {\n path: string;\n update: ((data: ChannelMessage<D>) => unknown) | undefined;\n subscription: SubscriptionHandle | null = null;\n\n /**\n * Channel constructor\n *\n * @param scope Object with the scope boundary, scope key, and push category; defines the namespace for the channel\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param scope.pushCategory Push category, defines the type of channel; See [push category](#PUSH_CATEGORY) for all types\n */\n constructor(scope: ChannelScope) {\n const { scopeBoundary, scopeKey, pushCategory } = scope;\n validateScope(scope);\n this.path = `/${scopeBoundary.toLowerCase()}/${scopeKey}/${pushCategory.toLowerCase()}`;\n if (cometdAdapter.subscriptions.has(this.path)) {\n this.subscription = cometdAdapter.subscriptions.get(this.path) || null;\n }\n }\n\n /**\n * Publishes content to the CometD channel\n *\n * @example\n * import { Channel, authAdapter, SCOPE_BOUNDARY, PUSH_CATEGORY } from 'epicenter-libs';\n * const session = authAdapter.getLocalSession();\n * const channel = new Channel({\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: session.groupKey,\n * pushCategory: PUSH_CATEGORY.CHAT,\n * });\n * await channel.publish({ message: 'Hello!' });\n *\n * @param content Content to publish to the channel\n * @returns promise that resolves to the CometD message response\n */\n publish(content: D): Promise<Message> {\n return cometdAdapter.publish(this, content);\n }\n\n /**\n * Subscribes to the CometD channel, attaching a handler for any channel updates. If a subscription already exists it will first unsubscribe, ensuring that only one subscription is ever attached to the channel.\n *\n * @example\n * import { Channel, authAdapter, SCOPE_BOUNDARY, PUSH_CATEGORY } from 'epicenter-libs';\n * const session = authAdapter.getLocalSession();\n * const channel = new Channel({\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: session.groupKey,\n * pushCategory: PUSH_CATEGORY.CHAT,\n * });\n * await channel.subscribe((data) => {\n * console.log(data.content);\n * });\n *\n * @param update Function that is called whenever a channel update occurs\n * @param [options] Optional arguments\n * @param [options.inert] If true, creates an inert subscription that doesn't trigger reconnection\n * @returns promise that resolves to the subscription object returned by CometD after a successful subscribe\n */\n // eslint-disable-next-line complexity\n async subscribe(\n update: (data: ChannelMessage<D>) => unknown,\n options: { inert?: boolean } = {},\n ): Promise<SubscriptionHandle> {\n if (this.subscription) {\n try {\n await cometdAdapter.remove(this.subscription);\n } catch (error: unknown) {\n const errorObj = error as { message?: string; information?: { error?: string } };\n const errorMessage = errorObj?.message || errorObj?.information?.error || '';\n\n if (errorMessage.includes('session_unknown') || errorMessage.includes('402')) {\n // Previous subscription already invalid due to session expiration\n } else {\n // Re-throw other errors\n throw error;\n }\n }\n }\n this.update = update;\n\n let retryCount = 0;\n const maxRetries = 3;\n\n while (retryCount < maxRetries) {\n try {\n this.subscription = await cometdAdapter.add(this, update, options) as SubscriptionHandle;\n return this.subscription;\n } catch (error: unknown) {\n const errorObj = error as { message?: string; information?: { error?: string } };\n const errorMessage = errorObj?.message || errorObj?.information?.error || '';\n\n if ((errorMessage.includes('session_unknown') || errorMessage.includes('402')) && retryCount < maxRetries - 1) {\n retryCount++;\n // Force fresh handshake\n cometdAdapter.handshakeState = 'idle';\n cometdAdapter.handshakePromise = undefined;\n\n // Wait a moment before retrying\n const retryDelay = 1000;\n const currentRetry = retryCount;\n await new Promise((resolve) => setTimeout(resolve, retryDelay * currentRetry));\n continue;\n }\n\n // Re-throw if not session_unknown or max retries exceeded\n throw error;\n }\n }\n\n throw new Error(`Failed to subscribe to ${this.path} after ${maxRetries} attempts`);\n }\n\n /**\n * Unsubscribes from the CometD channel\n *\n * @example\n * import { Channel, authAdapter, SCOPE_BOUNDARY, PUSH_CATEGORY } from 'epicenter-libs';\n * const session = authAdapter.getLocalSession();\n * const channel = new Channel({\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: session.groupKey,\n * pushCategory: PUSH_CATEGORY.CHAT,\n * });\n * await channel.subscribe((data) => console.log(data));\n * // Later...\n * await channel.unsubscribe();\n *\n * @returns promise that resolves when unsubscribed\n */\n async unsubscribe(): Promise<void> {\n if (this.subscription) {\n await cometdAdapter.remove(this.subscription);\n this.subscription = null;\n }\n }\n\n /**\n * Unsubscribes from all CometD channels\n *\n * @example\n * import { Channel, authAdapter, SCOPE_BOUNDARY, PUSH_CATEGORY } from 'epicenter-libs';\n * const session = authAdapter.getLocalSession();\n * const channel = new Channel({\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: session.groupKey,\n * pushCategory: PUSH_CATEGORY.CHAT,\n * });\n * await channel.subscribe((data) => console.log(data));\n * // Later, unsubscribe from all channels...\n * await channel.unsubscribeAll();\n *\n * @returns promise that resolves when all channels are unsubscribed\n */\n async unsubscribeAll(): Promise<void> {\n await cometdAdapter.empty();\n }\n}\n\n","import fetch from 'cross-fetch';\nimport config from './utils/config';\nimport { prefix } from './utils/helpers';\nimport { parseFilterInput } from './utils/filter-parser';\nimport type { FilterGroup, FilterInput } from './utils/filter-parser';\n\n\nexport const proxy = async (\n resource: string,\n options?: RequestInit,\n): Promise<Response> => {\n const { accountShortName, projectShortName, isLocal } = config;\n let path = prefix('/', resource);\n if (!isLocal()) path = `/proxy/${accountShortName}/${projectShortName}${path}`;\n return fetch(path, options);\n};\n\n// Export filter utilities for testing and advanced usage\nexport { parseFilterInput };\nexport type { FilterGroup, FilterInput };\n","import 'regenerator-runtime/runtime';\n\n/* yes, this string template literal is weird;\n * it's cause rollup does not recogize __VERSION__ as an individual token otherwise */\nconst version = `Epicenter (v${'__VERSION__'}) for __BUILD__ | Build Date: __DATE__`;\n\nimport type { RetryFunction } from './utils/router';\nimport { authAdapter, cometdAdapter } from './adapters';\nimport { errorManager, identification, isBrowser, Fault, EpicenterError } from './utils';\nimport { Handler } from './utils/error-manager';\n\nconst UNAUTHORIZED = 401;\nconst FORBIDDEN = 403;\nexport const DEFAULT_ERROR_HANDLERS: Record<string, Handler> = {};\n\nDEFAULT_ERROR_HANDLERS.cometdReconnected = errorManager.registerHandler(\n (error) => error.code === 'COMETD_RECONNECTED',\n async (error: Fault) => {\n if (isBrowser()) {\n console.warn('Cometd Reconnected. If you wish to react to this reconnection, register an error handler with identifier: error.code === \"COMETD_RECONNECTED\".', error);\n }\n },\n);\n\nDEFAULT_ERROR_HANDLERS.cometdError = errorManager.registerHandler(\n (error) => error.status === FORBIDDEN && error.code === 'COMETD_ERROR',\n async<T>(error: Fault, retry: RetryFunction<T>) => {\n console.warn('Cometd error. Attempting to reconnect.', error);\n await cometdAdapter.disconnect();\n return await retry();\n },\n);\n\nDEFAULT_ERROR_HANDLERS.authExpired = errorManager.registerHandler(\n (error: Fault) => error.status === UNAUTHORIZED && error.code === 'AUTHENTICATION_EXPIRED',\n async (error: Fault) => {\n await authAdapter.removeLocalSession();\n if (isBrowser()) {\n // eslint-disable-next-line no-alert\n alert('Session token has expired, try logging in again.');\n }\n throw error;\n },\n);\n\nDEFAULT_ERROR_HANDLERS.authGroupExpired = errorManager.registerHandler(\n (error: Fault) => error.status === UNAUTHORIZED && error.code === 'AUTHENTICATION_GROUP_EXPIRED',\n async (error: Fault) => {\n if (isBrowser()) {\n // eslint-disable-next-line no-alert\n alert('This group has expired. Try logging into a different group');\n }\n throw error;\n },\n);\n\nDEFAULT_ERROR_HANDLERS.authInvalidated = errorManager.registerHandler(\n (error) => error.status === UNAUTHORIZED && error.code === 'AUTHENTICATION_INVALIDATED',\n async<T>(error: Fault, retry: RetryFunction<T>) => {\n try {\n const session = identification.session;\n if (session?.objectType === 'admin') {\n throw new EpicenterError('Unhandled error: admin session was somehow invalidated');\n }\n const groupKey = session?.groupKey ?? '';\n await authAdapter.regenerate(groupKey, { objectType: 'user', inert: true });\n return await retry();\n } catch (_error) {\n await authAdapter.removeLocalSession();\n throw error;\n }\n },\n);\n\nObject.freeze(DEFAULT_ERROR_HANDLERS);\n\n/* Interfaces & Types */\nexport * from './types';\n\n/* Version */\nexport { version };\n\n/* Constants */\nexport {\n SCOPE_BOUNDARY,\n RITUAL,\n PUSH_CATEGORY,\n ROLE,\n} from './utils/constants';\n\n/* Auxilary Singletons/Classes */\nexport {\n config,\n errorManager,\n Router,\n Fault,\n} from './utils';\n\n/* Adapters */\nexport {\n accountAdapter,\n adminAdapter,\n assetAdapter,\n consensusAdapter,\n emailAdapter,\n authAdapter,\n chatAdapter,\n episodeAdapter,\n groupAdapter,\n leaderboardAdapter,\n presenceAdapter,\n projectAdapter,\n recaptchaAdapter,\n runAdapter,\n taskAdapter,\n timeAdapter,\n userAdapter,\n vaultAdapter,\n videoAdapter,\n vonageAdapter,\n worldAdapter,\n somebodyAdapter,\n dailyAdapter,\n matchmakerAdapter,\n walletAdapter,\n Channel,\n cometdAdapter,\n} from './adapters';\n\n/* APIs */\nexport {\n videoAPI,\n vonageAPI,\n} from './apis';\n\n/* Utility Functions */\nexport * as utils from './utilities';\n"],"names":["exports","undefined","global","EpicenterError","Error","constructor","message","code","_defineProperty","Fault","body","response","_body$information","information","cause","status","rest","Result","headers","isBrowser","Function","isNode","prefix","pre","str","startsWith","escapeRegExp","replace","getExpiration","vEnd","Number","Infinity","String","Date","toUTCString","getItem","key","decodeURIComponent","document","cookie","RegExp","encodeURIComponent","setItem","value","options","test","path","domain","end","secure","samesite","expireStr","domainStr","pathStr","secureStr","samesiteStr","removeItem","hasItem","clear","aKeys","split","nLen","length","nIdx","Store","store","_store","nodeMap","Map","NodeStore","get","set","delete","SessionStore","window","sessionStorage","item","JSON","parse","stringify","CookieStore","defaults","cookies","BROWSER_STORAGE_TYPE","SCOPE_BOUNDARY","RITUAL","PUSH_CATEGORY","ROLE","API_VERSION","Config","loadBrowser","loadNode","apiProtocol","_apiProtocol","endsWith","slice","apiHost","_apiHost","useProjectProxy","_useProjectProxy","apiVersion","_apiVersion","accountShortName","_accountShortName","projectShortName","_projectShortName","isLocal","host","location","indexOf","protocol","pathname","match","account","project","setContext","context","config","COOKIE","SESSION","SESSION_KEY","EPI_SSO_KEY","Identification","storeType","type","consumeSSO","session","getStore","getStoreOptions","setSessionWithOptions","forcePathInclusion","mySession","objectType","base","isCustomDomain","isEpicenterDomain","cookieContent","charAt","identification","ErrorManager","handlers","_handlers","clearHandlers","registerHandler","identifier","handleFn","handler","handle","unregister","unregisterHandler","unshift","index","findIndex","splice","error","retryFn","promise","catch","err","e","console","remainingHandlers","handleableError","errorManager","MAX_URL_LENGTH","paginate","json","url","_options$parsePage","parsePage","i","page","values","prev","searchParams","URLSearchParams","search","firstResult","warn","first","maxResults","max","Math","toString","prevPage","request","paginated","then","Object","assign","next","totalResults","nextPage","initialTotal","all","allValues","push","parseQuery","query","entries","reduce","arr","Array","isArray","map","v","createMessage","headersRaw","bodyRaw","includeAuthorization","authorization","FormData","Authorization","token","authOverride","NO_CONTENT","BAD_REQUEST","OK","href","method","inert","fetch","cache","redirect","resContentType","includes","result","fault","retryOptions","retry","requestArguments","Router","version","_version","server","_server","_authorization","_searchParams","withVersion","withServer","withProjectProxy","withAccountShortName","withProjectShortName","withAuthorization","withSearchParams","getURL","uriComponent","overrides","_ref","_overrides$server","_ref2","_overrides$useProject","_ref3","_overrides$accountSho","_ref4","_overrides$projectSho","_ref5","_overrides$version","_this$searchParams","URL","proxyPathComponent","commonPathComponent","uniquePathComponent","patch","post","put","getAccount","createAccount","view","updateAccount","optionals","removeAccount","teamForAdmin","adminKey","includeAllMembers","filter","routingOptions","createAdmin","getWithHandle","parseFilterGroup","group","filters","parsedFilters","joinedFilters","join","parseFilterInput","filterInput","ACCESS_TYPE","PUBLIC","PRIVATE","AUTHENTICATED","WORKER_PARTITION","NONE","ALL","FREE","LICENSED","ACCOUNT","PHYLOGENY","ORIGINAL","HISTORICAL","REFERENTIAL","ORDERED","EVENTUAL","TRANSMOGRIFIED","REANIMATED","SILENT","CHANNEL_PROTOCOL","OUMUAMUA","COMETD","channelsEnabled","list","AUTH_TOKEN_KEY","MAX_RETRIES","IDLE","FAILED","CONNECTED","SUCCEEDED","CONNECTING","HANDSHAKING","DISCONNECTED","FORBIDDEN","CONNECT_META_CHANNEL","DISCONNECT_META_CHANNEL","HANDSHAKE_META_CHANNEL","COMETD_RECONNECTED","DEFAULT_CHANNEL_PROTOCOL","SESSION_INVALIDATION_ERRORS","isSessionInvalidationError","errorMessage","lowerError","toLowerCase","some","pattern","isIllegalStateError","shouldRehandshake","reply","_reply$advice","_reply$error","advice","reconnect","cometdInstance","CometdAdapter","cometd","instance","startup","logLevel","_project$channelProto","getProject","channelEnabled","channelProtocol","CometD","AckExtension","ReloadExtension","accountProject","registerExtension","onunload","getStatus","reload","transport","getTransport","abort","configure","listenToMetaChannels","addListener","successful","handshakeState","processPendingOperations","handleHandshakeFailure","connectListener","Promise","resolve","reject","isDisconnected","wasConnected","isConnected","disconnectListener","handshakePromise","processingQueue","pendingOperations","operations","op","init","initialization","handshake","currentStatus","handshakeProps","ext","ack","websocketEnabled","handshakeReply","_handshakeReply$error","disconnect","empty","disconnectReply","_disconnectReply$erro","add","channel","update","_this$cometd","_errorObj$message","errorObj","_this$cometd2","retryDelay","setTimeout","subscriptionProps","handleCometdUpdate","data","_error","subscription","subscribe","subscribeReply","_subscribeReply$error","subscriptions","_options$_retryCount","retryCount","_retryCount","publish","content","publishProps","publishReply","_publishReply$error","_options$_retryCount2","remove","channelPath","sub","unsubscribe","unsubscribeReply","_unsubscribeReply$err","clearSubscriptions","cometdAdapter","logout","verificationOptionals","presenceOptionals","_identification$sessi","cleanup","groupKey","allSettled","finally","getSession","getLocalSession","setLocalSession","removeLocalSession","login","credentials","payload","prototype","hasOwnProperty","call","password","secretKey","regenerate","groupOrAccount","sso","getSAMLLink","generateSAMLLINK","ssoOutcome","ltiVersion","outcomeInformation","resetPassword","redirectURL","subject","redirectUrl","verify","create","file","scope","scopeBoundary","scopeKey","userKey","readLock","writeLock","ttlSeconds","tokenAccessSeconds","permit","USER","assetKey","removeFromScope","getURLWithScope","download","downloadWithScope","CONFLICT","overwrite","fileName","remaining","name","presignedUrl","shouldUpdate","sendEmail","emailBody","familyNameFirst","html","from","replyTo","fromUserKey","attachments","fromString","sendEmailToAdmin","sendEmailToSupport","supportType","groupName","draft","runLimit","category","episodeKey","searchOptions","sort","forGroup","withName","augment","destroy","gather","includeExpired","organization","allowSelfRegistration","flightRecorder","event","allowMembershipChanges","pricing","startDate","expirationDate","capacity","allowChannel","quantized","withGroupName","forUser","role","isMultiple","roleList","getSessionGroups","whitelistUsers","allow","emails","getWhitelistedUsers","sendRegistrationEmail","email","linkURL","linkUrl","selfRegister","displayName","givenName","familyName","addUser","usersInput","users","u","PARTICIPANT","available","updateUser","removeUser","hasMultiple","statusUpdate","collection","scores","tags","getCount","connect","forWorld","worldKey","google","humanKey","MORPHOLOGY","model","ephemeral","trackingKey","modelContext","executionContext","WORLD","hasPermit","morphology","modelFile","createSingular","getSingularRunKey","clone","runKey","restore","rewind","steps","rewindCount","marked","hidden","closed","timeout","variables","metadata","episodeName","includeEpisodes","finalFilter","userKeyFilter","var","meta","run","variableMap","_run$variables","introspect","introspectWithRunKey","operation","args","ritual","EXORCISE","arguments","getVariables","ignorable","mappify","include","additional","keys","getVariable","variable","updateVariables","getMetadata","runKeyArg","_bodyAsArray$","bodyAsArray","updateMetadata","action","actionList","retrieveFromWorld","removeFromWorld","getWithStrategy","strategy","lastRun","newRun","migrate","uploadCSV","formdata","append","createUser","modality","vaultKey","items","_items$set","_items$push","_items$pop","mutationKey","pop","updateProperties","NOT_FOUND","withScope","byName","define","mutationStrategy","defaultLock","count","AFFILIATE","VONAGE","DAILY","DOMESTIC","MEDIA_FORMAT","mp3","mp4","wav","flac","ogg","amr","webm","LANGUAGE_CODE","getVideoURLByKey","videoKey","getVideoURLWith","family","affiliate","userKeyURIComponent","getVideoDirectoryByKey","getVideoDirectoryWith","getVideoSearch","deleteVideoByKey","postVideoProcessor","downloadVideoByKey","downloadVideoWith","videoAPI","getDirectoryURL","processVideo","processors","log","postToken","initialLayoutClassList","postArchive","getInfo","deleteArchiveByID","archiveID","getProjectID","vonageAPI","apiKey","createSession","generateToken","sessionID","sessionId","startArchive","resolution","stopArchive","OBJECTIVE","MINIMUM","MAXIMUM","MARGINAL","OPTIMAL","WORLD_NAME_GENERATOR_TYPE","colorAnimal","sequential","worldNameGenerator","mine","getAssignments","getSessionWorlds","selfAssign","objective","populace","autoAssignUsers","assignments","requireAllAssignments","keepEmptyWorlds","editAssignments","getAssignmentsByKey","removeUsers","userKeys","Boolean","getPersonas","boundary","PROJECT","boundaryComponent","scopeKeyComponent","setPersonas","personas","assignRun","RETRY_POLICY","trigger","retryPolicy","failSafeTermination","taskKey","getHistory","getTaskIn","updatePermit","chatKey","room","sendMessage","getMessages","maxRecords","horizon","getMessagesForUser","pseudonymKey","getMessagesAdmin","sendMessageAdmin","stage","expectedRoles","defaultActions","transparent","actions","load","forceClose","updateDefaults","submitActions","deleteBarrier","deleteAll","undoSubmit","triggerFor","undoSubmitFor","removeRoleExpectationFor","pause","resume","collectInGroup","barrierMap","somebodyKey","inScope","byEmail","partners","edit","udomeKey","sleep","ms","r","randRange","min","random","RETRY_RANGES","RATE_LIMIT_REACHED","handleRateLimit","requestFunction","retryNumber","getConfig","createRoom","privacy","exp","enable_recording","streaming_endpoints","disableRateLimitHandling","callAPI","epicenter","properties","createToken","room_name","start_video_off","is_owner","user_name","close_tab_on_exit","selfSign","getVideoByRecordingId","recordingId","filePathInfo","videoAdapter","filePaths","contents","a","b","filePath","find","p","updateRecordingStatus","_scope$userKey","validateScope","pushCategory","Channel","has","_errorObj$information","maxRetries","_errorObj$information2","currentRetry","unsubscribeAll","proxy","resource","UNAUTHORIZED","DEFAULT_ERROR_HANDLERS","cometdReconnected","cometdError","authExpired","authAdapter","alert","authGroupExpired","authInvalidated","_session$groupKey","freeze"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAOA,EAAA,IAAI,OAAO,IAAI,UAAUA,SAAO,EAAE;;AAGlC,IAAE,IAAI,EAAE,GAAG,MAAM,CAAC,SAAS;AAC3B,IAAE,IAAI,MAAM,GAAG,EAAE,CAAC,cAAc;IAC9B,IAAI,cAAc,GAAG,MAAM,CAAC,cAAc,IAAI,UAAU,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAA,CAAE;IAClG,IAAIC,WAAS,CAAC;IACd,IAAI,OAAO,GAAG,OAAO,MAAM,KAAK,UAAU,GAAG,MAAM,GAAG,EAAE;AAC1D,IAAE,IAAI,cAAc,GAAG,OAAO,CAAC,QAAQ,IAAI,YAAY;AACvD,IAAE,IAAI,mBAAmB,GAAG,OAAO,CAAC,aAAa,IAAI,iBAAiB;AACtE,IAAE,IAAI,iBAAiB,GAAG,OAAO,CAAC,WAAW,IAAI,eAAe;;IAE9D,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE;AACnC,MAAI,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE;QAC9B,KAAK,EAAE,KAAK;QACZ,UAAU,EAAE,IAAI;QAChB,YAAY,EAAE,IAAI;AACxB,QAAM,QAAQ,EAAE;AAChB,OAAK,CAAC;AACN,MAAI,OAAO,GAAG,CA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gb,QAAQ,GAAA,CAAAuY,iBAAA,GAAG5rB,OAAO,aAAPA,OAAO,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAPA,OAAO,CAAEqT,QAAQ,MAAA,IAAA,IAAAuY,iBAAA,KAAA,KAAA,CAAA,GAAAA,iBAAA,GAAI,EAAE;AACxC,IAAA,MAAMJ,UAAsB,CAACnY,QAAQ,EAAE;AAAE/S,MAAAA,UAAU,EAAE,MAAM;AAAEwF,MAAAA,KAAK,EAAE;AAAK,KAAC,CAAC;IAC3E,OAAO,MAAMS,KAAK,EAAE;EACxB,CAAC,CAAC,OAAOkL,MAAM,EAAE;AACb,IAAA,MAAM+Z,kBAA8B,EAAE;AACtC,IAAA,MAAM5pB,KAAK;AACf,EAAA;AACJ,CACJ,CAAC;AAEDkC,MAAM,CAAC+nB,MAAM,CAACT,sBAAsB,CAAC;;;;","x_google_ignoreList":[0,1,2,3,4,5]}
1
+ {"version":3,"file":"epicenter.js","sources":["../../node_modules/regenerator-runtime/runtime.js","../../node_modules/@babel/runtime/helpers/esm/typeof.js","../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","../../node_modules/cross-fetch/dist/browser-ponyfill.js","../../src/utils/error.ts","../../src/utils/fault.ts","../../src/utils/result.ts","../../src/utils/helpers.ts","../../src/utils/cookies.ts","../../src/utils/store.ts","../../src/utils/constants.ts","../../src/utils/config.ts","../../src/utils/identification.ts","../../src/utils/error-manager.ts","../../src/utils/router.ts","../../src/adapters/account.ts","../../src/adapters/admin.ts","../../src/utils/filter-parser.ts","../../src/adapters/project.ts","../../src/adapters/cometd.ts","../../src/adapters/authentication.ts","../../src/adapters/asset.ts","../../src/adapters/email.ts","../../src/adapters/episode.ts","../../src/adapters/group.ts","../../src/adapters/leaderboard.ts","../../src/adapters/presence.ts","../../src/adapters/recaptcha.ts","../../src/adapters/run.ts","../../src/adapters/user.ts","../../src/adapters/vault.ts","../../src/apis/video.ts","../../src/adapters/video.ts","../../src/apis/vonage.ts","../../src/adapters/vonage.ts","../../src/adapters/world.ts","../../src/adapters/time.ts","../../src/adapters/task.ts","../../src/adapters/chat.ts","../../src/adapters/consensus.ts","../../src/adapters/somebody.ts","../../src/adapters/matchmaker.ts","../../src/adapters/daily.ts","../../src/adapters/wallet.ts","../../src/adapters/channel.ts","../../src/utilities.ts","../../src/epicenter.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 defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; };\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 defineProperty(generator, \"_invoke\", { value: 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 defineProperty(Gp, \"constructor\", { value: GeneratorFunctionPrototype, configurable: true });\n defineProperty(\n GeneratorFunctionPrototype,\n \"constructor\",\n { value: GeneratorFunction, configurable: true }\n );\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 defineProperty(this, \"_invoke\", { value: 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 GeneratorResume behavior specified since ES2015:\n // ES2015 spec, step 3: https://262.ecma-international.org/6.0/#sec-generatorresume\n // Latest spec, step 2: https://tc39.es/ecma262/#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 methodName = context.method;\n var method = delegate.iterator[methodName];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method, or a missing .next method, always terminate the\n // yield* loop.\n context.delegate = null;\n\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (methodName === \"throw\" && 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 if (methodName !== \"return\") {\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a '\" + methodName + \"' 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(val) {\n var object = Object(val);\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 != null) {\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 throw new TypeError(typeof iterable + \" is not iterable\");\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","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };","// Save global object in a variable\nvar __global__ =\n(typeof globalThis !== 'undefined' && globalThis) ||\n(typeof self !== 'undefined' && self) ||\n(typeof global !== 'undefined' && global);\n// Create an object that extends from __global__ without the fetch function\nvar __globalThis__ = (function () {\nfunction F() {\nthis.fetch = false;\nthis.DOMException = __global__.DOMException\n}\nF.prototype = __global__; // Needed for feature detection on whatwg-fetch's code\nreturn new F();\n})();\n// Wraps whatwg-fetch with a function scope to hijack the global object\n// \"globalThis\" that's going to be patched\n(function(globalThis) {\n\nvar irrelevant = (function (exports) {\n\n /* eslint-disable no-prototype-builtins */\n var g =\n (typeof globalThis !== 'undefined' && globalThis) ||\n (typeof self !== 'undefined' && self) ||\n // eslint-disable-next-line no-undef\n (typeof global !== 'undefined' && global) ||\n {};\n\n var support = {\n searchParams: 'URLSearchParams' in g,\n iterable: 'Symbol' in g && 'iterator' in Symbol,\n blob:\n 'FileReader' in g &&\n 'Blob' in g &&\n (function() {\n try {\n new Blob();\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: 'FormData' in g,\n arrayBuffer: 'ArrayBuffer' in g\n };\n\n function isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n }\n\n if (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ];\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n };\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name);\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~!]/i.test(name) || name === '') {\n throw new TypeError('Invalid character in header field name: \"' + name + '\"')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value);\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {};\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value);\n }, this);\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n if (header.length != 2) {\n throw new TypeError('Headers constructor: expected name/value pair to be length 2, found' + header.length)\n }\n this.append(header[0], header[1]);\n }, this);\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name]);\n }, this);\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name);\n value = normalizeValue(value);\n var oldValue = this.map[name];\n this.map[name] = oldValue ? oldValue + ', ' + value : value;\n };\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)];\n };\n\n Headers.prototype.get = function(name) {\n name = normalizeName(name);\n return this.has(name) ? this.map[name] : null\n };\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n };\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value);\n };\n\n Headers.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this);\n }\n }\n };\n\n Headers.prototype.keys = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push(name);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.values = function() {\n var items = [];\n this.forEach(function(value) {\n items.push(value);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.entries = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push([name, value]);\n });\n return iteratorFor(items)\n };\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries;\n }\n\n function consumed(body) {\n if (body._noBody) return\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true;\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result);\n };\n reader.onerror = function() {\n reject(reader.error);\n };\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsArrayBuffer(blob);\n return promise\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n var match = /charset=([A-Za-z0-9_-]+)/.exec(blob.type);\n var encoding = match ? match[1] : 'utf-8';\n reader.readAsText(blob, encoding);\n return promise\n }\n\n function readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf);\n var chars = new Array(view.length);\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i]);\n }\n return chars.join('')\n }\n\n function bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength);\n view.set(new Uint8Array(buf));\n return view.buffer\n }\n }\n\n function Body() {\n this.bodyUsed = false;\n\n this._initBody = function(body) {\n /*\n fetch-mock wraps the Response object in an ES6 Proxy to\n provide useful test harness features such as flush. However, on\n ES5 browsers without fetch or Proxy support pollyfills must be used;\n the proxy-pollyfill is unable to proxy an attribute unless it exists\n on the object before the Proxy is created. This change ensures\n Response.bodyUsed exists on the instance, while maintaining the\n semantic of setting Request.bodyUsed in the constructor before\n _initBody is called.\n */\n // eslint-disable-next-line no-self-assign\n this.bodyUsed = this.bodyUsed;\n this._bodyInit = body;\n if (!body) {\n this._noBody = true;\n this._bodyText = '';\n } else if (typeof body === 'string') {\n this._bodyText = body;\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body;\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body;\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString();\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer);\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer]);\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body);\n } else {\n this._bodyText = body = Object.prototype.toString.call(body);\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8');\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type);\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');\n }\n }\n };\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n };\n }\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n var isConsumed = consumed(this);\n if (isConsumed) {\n return isConsumed\n } else if (ArrayBuffer.isView(this._bodyArrayBuffer)) {\n return Promise.resolve(\n this._bodyArrayBuffer.buffer.slice(\n this._bodyArrayBuffer.byteOffset,\n this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength\n )\n )\n } else {\n return Promise.resolve(this._bodyArrayBuffer)\n }\n } else if (support.blob) {\n return this.blob().then(readBlobAsArrayBuffer)\n } else {\n throw new Error('could not read as ArrayBuffer')\n }\n };\n\n this.text = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n };\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n };\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n };\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'];\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase();\n return methods.indexOf(upcased) > -1 ? upcased : method\n }\n\n function Request(input, options) {\n if (!(this instanceof Request)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.')\n }\n\n options = options || {};\n var body = options.body;\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url;\n this.credentials = input.credentials;\n if (!options.headers) {\n this.headers = new Headers(input.headers);\n }\n this.method = input.method;\n this.mode = input.mode;\n this.signal = input.signal;\n if (!body && input._bodyInit != null) {\n body = input._bodyInit;\n input.bodyUsed = true;\n }\n } else {\n this.url = String(input);\n }\n\n this.credentials = options.credentials || this.credentials || 'same-origin';\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers);\n }\n this.method = normalizeMethod(options.method || this.method || 'GET');\n this.mode = options.mode || this.mode || null;\n this.signal = options.signal || this.signal || (function () {\n if ('AbortController' in g) {\n var ctrl = new AbortController();\n return ctrl.signal;\n }\n }());\n this.referrer = null;\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body);\n\n if (this.method === 'GET' || this.method === 'HEAD') {\n if (options.cache === 'no-store' || options.cache === 'no-cache') {\n // Search for a '_' parameter in the query string\n var reParamSearch = /([?&])_=[^&]*/;\n if (reParamSearch.test(this.url)) {\n // If it already exists then set the value with the current time\n this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime());\n } else {\n // Otherwise add a new '_' parameter to the end with the current time\n var reQueryString = /\\?/;\n this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime();\n }\n }\n }\n }\n\n Request.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n };\n\n function decode(body) {\n var form = new FormData();\n body\n .trim()\n .split('&')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=');\n var name = split.shift().replace(/\\+/g, ' ');\n var value = split.join('=').replace(/\\+/g, ' ');\n form.append(decodeURIComponent(name), decodeURIComponent(value));\n }\n });\n return form\n }\n\n function parseHeaders(rawHeaders) {\n var headers = new Headers();\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ');\n // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill\n // https://github.com/github/fetch/issues/748\n // https://github.com/zloirock/core-js/issues/751\n preProcessedHeaders\n .split('\\r')\n .map(function(header) {\n return header.indexOf('\\n') === 0 ? header.substr(1, header.length) : header\n })\n .forEach(function(line) {\n var parts = line.split(':');\n var key = parts.shift().trim();\n if (key) {\n var value = parts.join(':').trim();\n try {\n headers.append(key, value);\n } catch (error) {\n console.warn('Response ' + error.message);\n }\n }\n });\n return headers\n }\n\n Body.call(Request.prototype);\n\n function Response(bodyInit, options) {\n if (!(this instanceof Response)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.')\n }\n if (!options) {\n options = {};\n }\n\n this.type = 'default';\n this.status = options.status === undefined ? 200 : options.status;\n if (this.status < 200 || this.status > 599) {\n throw new RangeError(\"Failed to construct 'Response': The status provided (0) is outside the range [200, 599].\")\n }\n this.ok = this.status >= 200 && this.status < 300;\n this.statusText = options.statusText === undefined ? '' : '' + options.statusText;\n this.headers = new Headers(options.headers);\n this.url = options.url || '';\n this._initBody(bodyInit);\n }\n\n Body.call(Response.prototype);\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n };\n\n Response.error = function() {\n var response = new Response(null, {status: 200, statusText: ''});\n response.ok = false;\n response.status = 0;\n response.type = 'error';\n return response\n };\n\n var redirectStatuses = [301, 302, 303, 307, 308];\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n };\n\n exports.DOMException = g.DOMException;\n try {\n new exports.DOMException();\n } catch (err) {\n exports.DOMException = function(message, name) {\n this.message = message;\n this.name = name;\n var error = Error(message);\n this.stack = error.stack;\n };\n exports.DOMException.prototype = Object.create(Error.prototype);\n exports.DOMException.prototype.constructor = exports.DOMException;\n }\n\n function fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init);\n\n if (request.signal && request.signal.aborted) {\n return reject(new exports.DOMException('Aborted', 'AbortError'))\n }\n\n var xhr = new XMLHttpRequest();\n\n function abortXhr() {\n xhr.abort();\n }\n\n xhr.onload = function() {\n var options = {\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n };\n // This check if specifically for when a user fetches a file locally from the file system\n // Only if the status is out of a normal range\n if (request.url.indexOf('file://') === 0 && (xhr.status < 200 || xhr.status > 599)) {\n options.status = 200;\n } else {\n options.status = xhr.status;\n }\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n setTimeout(function() {\n resolve(new Response(body, options));\n }, 0);\n };\n\n xhr.onerror = function() {\n setTimeout(function() {\n reject(new TypeError('Network request failed'));\n }, 0);\n };\n\n xhr.ontimeout = function() {\n setTimeout(function() {\n reject(new TypeError('Network request timed out'));\n }, 0);\n };\n\n xhr.onabort = function() {\n setTimeout(function() {\n reject(new exports.DOMException('Aborted', 'AbortError'));\n }, 0);\n };\n\n function fixUrl(url) {\n try {\n return url === '' && g.location.href ? g.location.href : url\n } catch (e) {\n return url\n }\n }\n\n xhr.open(request.method, fixUrl(request.url), true);\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true;\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false;\n }\n\n if ('responseType' in xhr) {\n if (support.blob) {\n xhr.responseType = 'blob';\n } else if (\n support.arrayBuffer\n ) {\n xhr.responseType = 'arraybuffer';\n }\n }\n\n if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers || (g.Headers && init.headers instanceof g.Headers))) {\n var names = [];\n Object.getOwnPropertyNames(init.headers).forEach(function(name) {\n names.push(normalizeName(name));\n xhr.setRequestHeader(name, normalizeValue(init.headers[name]));\n });\n request.headers.forEach(function(value, name) {\n if (names.indexOf(name) === -1) {\n xhr.setRequestHeader(name, value);\n }\n });\n } else {\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value);\n });\n }\n\n if (request.signal) {\n request.signal.addEventListener('abort', abortXhr);\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener('abort', abortXhr);\n }\n };\n }\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);\n })\n }\n\n fetch.polyfill = true;\n\n if (!g.fetch) {\n g.fetch = fetch;\n g.Headers = Headers;\n g.Request = Request;\n g.Response = Response;\n }\n\n exports.Headers = Headers;\n exports.Request = Request;\n exports.Response = Response;\n exports.fetch = fetch;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n return exports;\n\n})({});\n})(__globalThis__);\n// This is a ponyfill, so...\n__globalThis__.fetch.ponyfill = true;\ndelete __globalThis__.fetch.polyfill;\n// Choose between native implementation (__global__) or custom implementation (__globalThis__)\nvar ctx = __global__.fetch ? __global__ : __globalThis__;\nexports = ctx.fetch // To enable: import fetch from 'cross-fetch'\nexports.default = ctx.fetch // For TypeScript consumers without esModuleInterop.\nexports.fetch = ctx.fetch // To enable: import {fetch} from 'cross-fetch'\nexports.Headers = ctx.Headers\nexports.Request = ctx.Request\nexports.Response = ctx.Response\nmodule.exports = exports\n","\n/* Generic throwable error */\nexport default class EpicenterError extends Error {\n code?: string;\n constructor(message?: string, code?: string) {\n super(message);\n this.code = code;\n }\n}\n","import EpicenterError from './error';\n\nexport interface ErrorBody {\n status?: number;\n message: string;\n information?: {\n code: string;\n [key: string]: unknown;\n };\n cause?: unknown;\n code?: string;\n}\n\n\n/* For failed network calls */\nexport default class Fault extends EpicenterError {\n status?: number;\n information?: Record<string, unknown>;\n cause?: unknown;\n\n constructor(body: ErrorBody, response?: Response) {\n super(\n body.message,\n body.information?.code,\n );\n\n const { information, message, cause, status } = body;\n this.status = status ?? response?.status;\n this.message = message;\n\n if (information) {\n const { code, ...rest } = information;\n this.code = code;\n this.information = rest;\n }\n if (cause) {\n this.cause = cause;\n }\n }\n}\n","\n\n/* For network call responses */\nexport default class Result {\n status;\n headers;\n body;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(body: any, response: Response) {\n const { status, headers } = response;\n this.status = status;\n this.headers = headers;\n this.body = body;\n }\n}\n","/* eslint-disable no-new-func */\nexport const isBrowser = new Function('try {return this===window;}catch(e){ return false;}');\nexport const isNode = new Function('try {return (typeof process !== \"undefined\") && (typeof process.versions.node !== \"undefined\")}catch(e){return false;}');\n\n\nexport const last = (strOrArr: string | Array<unknown>): unknown => strOrArr[strOrArr.length - 1];\nexport const prefix = (pre: string, str: string): string => str.startsWith(pre) ? str : `${pre}${str}`;\n\n// Escape string for safe use in RegExp\nexport const escapeRegExp = (str: string): string => str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n","import { escapeRegExp } from './helpers';\n\ntype End = number | string | Date | undefined;\n\n// Modified version of https://github.com/madmurphy/cookies.js\nconst getExpiration = (vEnd: End) => {\n if (!vEnd) return '';\n switch (vEnd.constructor) {\n case Number: return vEnd === Infinity ? '; expires=Fri, 31 Dec 9999 23:59:59 GMT' : `; max-age=${vEnd}`;\n /*\n Note: Despite officially defined in RFC 6265, the use of `max-age` is not compatible with any\n version of Internet Explorer, Edge and some mobile browsers. Therefore passing a number to\n the end parameter might not work as expected. A possible solution might be to convert the the\n relative time to an absolute time. For instance, replacing the previous line with:\n */\n /*\n case Number: return vEnd === Infinity ? '; expires=Fri, 31 Dec 9999 23:59:59 GMT' : `; expires=${(new Date(vEnd * 1e3 + Date.now())).toUTCString()}`;\n */\n case String: return `; expires=${vEnd}`;\n case Date: return `; expires=${new Date(vEnd).toUTCString()}`;\n default: return '';\n }\n};\n\ninterface EditCookieOptions {\n path?: string;\n domain?: string;\n end?: End;\n secure?: boolean;\n samesite?: boolean;\n}\n\nexport default {\n getItem(key: string): null | string {\n if (!key) return null;\n return decodeURIComponent(document.cookie.replace(new RegExp(`(?:(?:^|.*;)\\\\s*${escapeRegExp(encodeURIComponent(key))}\\\\s*\\\\=\\\\s*([^;]*).*$)|^.*$`), '$1')) || null;\n },\n setItem(key: string, value: string | number | boolean, options: EditCookieOptions = {}): boolean {\n if (!key || (/^(?:expires|max-age|path|domain|secure)$/i).test(key)) return false;\n const { path, domain, end, secure, samesite } = options;\n const expireStr = getExpiration(end);\n const domainStr = domain ? `; domain=${domain}` : '';\n const pathStr = path ? `; path=${path}` : '';\n const secureStr = secure ? '; secure' : '';\n const samesiteStr = samesite ? `; samesite=${samesite}` : '';\n\n document.cookie = `${encodeURIComponent(key)}=${encodeURIComponent(value)}${expireStr}${domainStr}${pathStr}${secureStr}${samesiteStr}`;\n return true;\n },\n removeItem(key: string, options: EditCookieOptions = {}): boolean {\n if (!this.hasItem(key)) return false;\n const { path, domain } = options;\n const domainStr = domain ? `; domain=${domain}` : '';\n const pathStr = path ? `; path=${path}` : '';\n document.cookie = `${encodeURIComponent(key)}=; expires=Thu, 01 Jan 1970 00:00:00 GMT${domainStr}${pathStr}`;\n return true;\n },\n hasItem(key: string): boolean {\n if (!key || (/^(?:expires|max-age|path|domain|secure)$/i).test(key)) return false;\n\n return (new RegExp(`(?:^|;\\\\s*)${escapeRegExp(encodeURIComponent(key))}\\\\s*\\\\=`)).test(document.cookie);\n },\n clear(): string[] {\n // TODO: potentially replace this regex with simpler implementation\n // eslint-disable-next-line no-useless-backreference\n const aKeys = document.cookie.replace(/((?:^|\\s*;)[^=]+)(?=;|$)|^\\s*|\\s*(?:=[^;]*)?(?:\\1|$)/g, '').split(/\\s*(?:=[^;]*)?;\\s*/);\n for (let nLen = aKeys.length, nIdx = 0; nIdx < nLen; nIdx++) {\n aKeys[nIdx] = decodeURIComponent(aKeys[nIdx]);\n this.removeItem(aKeys[nIdx]);\n }\n return aKeys;\n },\n};\n","import cookies from './cookies';\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\ntype NodeMap = Record<any, any>;\ntype JavaScriptObject = Record<string, any>;\n/* eslint-enable @typescript-eslint/no-explicit-any */\n\ntype EpicenterStore = NodeMap | Storage;\n\n\nclass Store {\n _store: EpicenterStore;\n constructor(store: EpicenterStore) {\n this._store = store;\n }\n\n clear() {\n this._store.clear();\n }\n\n get store() {\n return this._store;\n }\n\n set store(store) {\n this._store = store;\n }\n}\n\nconst nodeMap = new Map();\nexport class NodeStore extends Store {\n constructor() {\n super(nodeMap);\n }\n\n getItem(key: string): NodeMap {\n return super.store.get(key);\n }\n\n setItem(key: string, value: JavaScriptObject): NodeMap {\n return super.store.set(key, value);\n }\n\n removeItem(key: string): boolean {\n return super.store.delete(key);\n }\n}\n\nexport class SessionStore extends Store {\n constructor() {\n super(window.sessionStorage);\n }\n\n getItem(key: string): JavaScriptObject | null {\n const item = super.store.getItem(key);\n return item ? JSON.parse(item) : null;\n }\n\n setItem(key: string, value: JavaScriptObject): void {\n return super.store.setItem(key, JSON.stringify(value));\n }\n\n removeItem(key: string): void {\n return super.store.removeItem(key);\n }\n}\n\nexport class CookieStore {\n options = {};\n constructor(options = {}) {\n const defaults = { path: '/' };\n this.options = { ...defaults, ...options };\n }\n\n getItem(key: string): JavaScriptObject | null {\n const item = cookies.getItem(key);\n return item ? JSON.parse(item) : null;\n }\n\n setItem(key: string, value: JavaScriptObject): boolean {\n return cookies.setItem(key, JSON.stringify(value), this.options);\n }\n\n removeItem(key: string): boolean {\n return cookies.removeItem(key, this.options);\n }\n\n clear(): string[] {\n return cookies.clear();\n }\n}\n","import type { FilterInput } from './filter-parser';\n\nexport enum BROWSER_STORAGE_TYPE {\n COOKIE = 'COOKIE',\n SESSION = 'SESSION',\n}\n\n\n/**\n * Scope boundaries are values associated with runs. They help to define the *default* user permissions used when a run is created, althought further permission configuration can be done with {@link #ROLE lock types}. Scopes also provide an index that in which a run can be queried for.\n *\n * Three parts -- boundary: level of hierarchy (ontology) that a piece of data belongs to. Specifically, a run, an asset, or a vault data\n * Boundary in which a piece of data (run, asset, vault) is ID-ed to (see scopeKey).\n *\n * pseudonymKey, goes in tandem w/ permit (lock types) --\n * Data lives and dies with scope, delete the scope, you lose the data and associated scopes\n * @enum {string}\n */\nexport enum SCOPE_BOUNDARY {\n /**\n * Runs scoped by project, users and facilitators are allowed access so long as they are a user in a group on the project.\n * @constant\n * @type {string}\n */\n PROJECT = 'PROJECT',\n /**\n * Runs scoped by group, users and facilitators are allowed access only if they are in the associated group\n * Groups are scoped by projects\n * @constant\n * @type {string}\n */\n GROUP = 'GROUP',\n /**\n * Runs scoped by episode, not sure what this one is permission-wise\n * Episodes are scoped by groups\n * @constant\n * @type {string}\n */\n EPISODE = 'EPISODE',\n /**\n * Runs scoped by world, users are only allowed access to the if they are assigned to the associated world. Facilitators need only to belong on the group that created the world\n * Worlds can be scoped by group or episode\n * @constant\n * @type {string}\n */\n WORLD = 'WORLD',\n}\n\n\n/**\n * Rituals are used to define the way in which the Epicenter stores a run while running actions like getting variables, saving meta data, and call model operations. Runs can exist in-memory for a certain amount of time before expiring, and requiring their revival again before use.\n * @enum {string}\n */\nexport enum RITUAL {\n /**\n * Allow GET action against archive, no revival of run\n * @constant\n * @type {string}\n */\n NONE = 'NONE',\n /**\n * Does not allow restore and will not access archived state (if down stay down)\n * @constant\n * @type {string}\n */\n INTER = 'INTER',\n /**\n * A run with this ritual will be pulled into memory as needed, and will stay in memory until it's lifespan (defined in your project Settings) has expired.\n * @constant\n * @type {string}\n */\n REANIMATE = 'REANIMATE',\n /**\n * Will always restore, and never access archived state\n * @constant\n * @type {string}\n */\n REVIVE = 'REVIVE',\n /**\n * A run with this ritual will be pulled into memory as needed, and removed from memory afterwards.\n * @constant\n * @type {string}\n */\n EXORCISE = 'EXORCISE',\n /**\n * Will always restore, and never access archived state, but will also terminate the run after issuing the command.\n * @constant\n * @type {string}\n */\n RESURRECT = 'RESURRECT',\n}\n\n\n/**\n * Push categories are pre-defined channels types in which one might use to receive push channel updates\n * @enum {string}\n */\nexport enum PUSH_CATEGORY {\n /**\n * intended for messaging users\n * yes pub\n * @constant\n * @type {string} */\n CHAT = 'CHAT',\n /**\n * Used for the {@link https://github.com/forio Consensus API}\n * no pub\n * @constant\n * @type {string} */\n CONSENSUS = 'CONSENSUS',\n /**\n * intended for general non-chat, sim-level communication\n * yes pub\n * @constant\n * @type {string} */\n CONTROL = 'CONTROL',\n /**\n * Used for the {@link https://github.com/forio Presence API}\n * no pub\n * @constant\n * @type {string} */\n PRESENCE = 'PRESENCE',\n /**\n * intended for awaiting entering games\n * yes pub\n * @constant\n * @type {string} */\n LOBBY = 'LOBBY',\n /**\n * Used for streaming data; bypasses ack extension\n * yes pub\n * @constant\n * @type {string} */\n STREAM = 'STREAM',\n /**\n * Used for the {@link https://github.com/forio Run API}\n * no pub\n * @constant\n * @type {string} */\n RUN = 'RUN',\n /**\n * Used for the {@link https://github.com/forio Vault API}\n * no pub\n * @constant\n * @type {string}\n */\n VAULT = 'VAULT',\n /**\n * Used for the {@link https://github.com/forio Video API}\n * no pub\n * @constant\n * @type {string}\n */\n VIDEO = 'VIDEO',\n /**\n * Used for the {@link https://github.com/forio World API}\n * no pub\n * @constant\n * @type {string}\n */\n WORLD = 'WORLD',\n /**\n * Used for the {@link https://github.com/forio Leaderboard API}\n * no pub\n * @constant\n * @type {string}\n */\n LEADERBOARD = 'LEADERBOARD',\n /**\n * For group related things; assignments, unassignments\n * @constant\n * @type {string}\n */\n GROUP = 'GROUP',\n /**\n * internal\n * @constant\n * @type {string} */\n SYSTEM = 'SYSTEM',\n}\n\nexport enum INTERNAL_ROLE {\n /**\n * System -- Epicenter Manager\n * @constant\n * @type {string}\n */\n SYSTEM = 'SYSTEM',\n /**\n * System minus -- read-only system access, write for certain accounts; think Geromel\n * @constant\n * @type {string}\n */\n MONITOR = 'MONITOR',\n /**\n * Author -- Team Members (and node server API keys)\n * tied to one account (personal + current account)\n * @constant\n * @type {string}\n */\n}\n\nexport enum ACCOUNT_ROLE {\n /**\n * Owner -- Full control over account\n * @constant\n * @type {string}\n */\n OWNER = 'OWNER',\n /**\n * Author -- Team Members (and node server API keys)\n * tied to one account (personal + current account)\n * @constant\n * @type {string}\n */\n AUTHOR = 'AUTHOR',\n /**\n * Author minus\n * @constant\n * @type {string}\n */\n SUPPORT = 'SUPPORT',\n /**\n * Associate -- Limited access to specific account\n * @constant\n * @type {string}\n */\n ASSOCIATE = 'ASSOCIATE',\n}\n\nexport enum PROJECT_ROLE {\n /**\n * Intended role for admin users who should only have access to a specific project\n * @constant\n * @type {string}\n */\n ASSOCIATE = 'ASSOCIATE',\n}\n\nexport enum GROUP_ROLE {\n /**\n * Facilitators\n * @constant\n * @type {string}\n */\n FACILITATOR = 'FACILITATOR',\n /**\n * Reviewers (weaker facilitator)\n * Facilitator minus\n * @constant\n * @type {string}\n */\n REVIEWER = 'REVIEWER',\n /**\n * Users -- psuedonymKey (userKey) required in scope\n * e.g., an avatar -- GROUP scope, PARTICIPANT read, USER write, userKey pseudonymKey\n * @constant\n * @type {string}\n */\n USER = 'USER',\n /**\n * Leader\n * Participant plus\n * @constant\n * @type {string}\n */\n LEADER = 'LEADER',\n /**\n * Participant\n * @constant\n * @type {string}\n */\n PARTICIPANT = 'PARTICIPANT',\n /**\n * Anonymous\n * @constant\n * @type {string}\n */\n ANONYMOUS = 'ANONYMOUS',\n}\n\n\n/**\n * Roles are used to define permissions on resources in Epicenter.\n * @enum {string}\n */\nexport enum ROLE {\n /**\n * System -- Epicenter Manager\n * @constant\n * @type {string}\n */\n SYSTEM = 'SYSTEM',\n /**\n * System minus -- read-only system access, write for certain accounts; think Geromel\n * @constant\n * @type {string}\n */\n MONITOR = 'MONITOR',\n /**\n * Owner -- Full control over account\n * @constant\n * @type {string}\n */\n OWNER = 'OWNER',\n /**\n * Author -- Team Members (and node server API keys)\n * tied to one account (personal + current account)\n * @constant\n * @type {string}\n */\n AUTHOR = 'AUTHOR',\n /**\n * Author minus\n * @constant\n * @type {string}\n */\n SUPPORT = 'SUPPORT',\n /**\n * Associate -- Limited access to specific account\n * @constant\n * @type {string}\n */\n ASSOCIATE = 'ASSOCIATE',\n /**\n * Facilitators\n * @constant\n * @type {string}\n */\n FACILITATOR = 'FACILITATOR',\n /**\n * Reviewers (weaker facilitator)\n * Facilitator minus\n * @constant\n * @type {string}\n */\n REVIEWER = 'REVIEWER',\n /**\n * Users -- pseudonymKey (userKey) required in scope\n * e.g., an avatar -- GROUP scope, PARTICIPANT read, USER write, userKey pseudonymKey\n * @constant\n * @type {string}\n */\n USER = 'USER',\n /**\n * Leader\n * Participant plus\n * @constant\n * @type {string}\n */\n LEADER = 'LEADER',\n /**\n * Participant\n * @constant\n * @type {string}\n */\n PARTICIPANT = 'PARTICIPANT',\n /**\n * Anonymous\n * @constant\n * @type {string}\n */\n ANONYMOUS = 'ANONYMOUS',\n}\n\n\n// /**\n// * Roles are used to define permissions on resources in Epicenter.\n// * @enum {string}\n// */\n// export const ROLE = {\n// ...INTERNAL_ROLE,\n// ...ACCOUNT_ROLE,\n// ...PROJECT_ROLE,\n// ...GROUP_ROLE,\n// };\n\n// export type ROLE = INTERNAL_ROLE | ACCOUNT_ROLE | PROJECT_ROLE | GROUP_ROLE;\n\n\nexport interface Permit {\n readLock: keyof typeof ROLE;\n writeLock: keyof typeof ROLE;\n}\n\nexport interface GenericScope {\n scopeBoundary: keyof typeof SCOPE_BOUNDARY;\n scopeKey: string;\n}\n\nexport interface Address {\n projectShortName: string;\n accountShortName: string;\n groupName: string;\n worldKey: string;\n episodeName: string;\n}\n\n\n/**\n * Generic search options for adapter methods. All adapter methods\n * will take `filter` and `sort` as a list of strings, and join with a \";\"\n *\n * Enhanced filter support allows:\n * - string[] (legacy): ['name=Mike', 'count<=3'] -> 'name=Mike;count<=3'\n * - string (raw): '(name=Mike;count<=3;[id=1;id=2])' -> passed through as-is\n * - FilterGroup (object): { type: 'and', filters: [...] } -> parsed to boolean syntax\n */\nexport interface GenericSearchOptions {\n filter?: FilterInput;\n sort?: string[];\n first?: number;\n max?: number;\n count?: boolean;\n}\n\n\n/**\n * The query parameters expected by the Epicenter APIs for\n * any kind of open search on a resource.\n */\nexport interface APISearchOptions {\n filter?: string;\n sort?: string;\n first?: number;\n max?: number;\n}\n","import EpicenterError from './error';\nimport { isBrowser, isNode } from './helpers';\n\n\nconst API_VERSION = 3;\nclass Config {\n _apiVersion = API_VERSION;\n _apiProtocol = '';\n _apiHost = '';\n _useProjectProxy = false;\n _accountShortName = '';\n _projectShortName = '';\n\n authOverride?: string;\n\n constructor() {\n if (isBrowser()) {\n this.loadBrowser();\n return;\n }\n if (isNode()) {\n this.loadNode();\n return;\n }\n throw new EpicenterError('Could not identify environment; no configuration was setup');\n }\n\n /**\n * Protocol used to make network requests (whether `http://` or `https://`).\n * It is typically set on-load based on your browser's URL. For local development,\n * this is defaulted to `https`, and can be overwritten if desired.\n * @memberof config\n * @type {string}\n * */\n get apiProtocol() {\n return this._apiProtocol;\n }\n\n set apiProtocol(apiProtocol) {\n let proto = apiProtocol.toLowerCase();\n if (!proto.startsWith('http')) return;\n if (proto.endsWith(':')) {\n proto = proto.slice(0, -1);\n }\n this._apiProtocol = proto;\n }\n\n /**\n * Hostname used to make network requests. It is typically set on-load based on\n * your browser's URL. For local development, this is defaulted to `forio.com`,\n * and can be overwritten if desired.\n * @memberof config\n * @type {string}\n * */\n get apiHost() {\n return this._apiHost;\n }\n\n set apiHost(apiHost) {\n this._apiHost = apiHost;\n }\n\n /**\n * If true, requests are routed to project proxy server.\n * The proxy server processes requests and forwards them to the Epicenter platform as appropriate,\n * usually with some modification. Can be used to grant heightened privileges to a request.\n * @memberof config\n * @type {boolean}\n */\n get useProjectProxy() {\n return this._useProjectProxy;\n }\n\n set useProjectProxy(useProjectProxy) {\n this._useProjectProxy = useProjectProxy;\n }\n\n /**\n * Version used to make network requests. This is read-only variable intended for internal use.\n * @memberof config\n * @type {number}\n */\n get apiVersion() {\n return this._apiVersion;\n }\n\n set apiVersion(_apiVersion) {\n return;\n }\n\n /**\n * Account name used for making network requests.\n * This is the default value used by Epicenter API adapters when making\n * network requests without explicitly defining an account to use.\n * It is defined on-load based on your browser's URL, and can be\n * overwritten for local development.\n * @example\n * // with browser URL: https://forio.com/app/acme-simulations/foobar-game\n *\n * console.log(config.accountShortName);\n * // should log 'acme-simulations'\n *\n * runAdapter.get(123);\n * // instantiates a GET call with the URL: https://forio.com/api/v3/acme-simulations/foobar-game/run/123\n *\n * config.accountShortName = 'globex-simuations';\n * runAdapter.get(123);\n * // now instantiates a GET with the URL: https://forio.com/api/v3/globex-simulations/foobar-game/run/123\n *\n * runAdapter.get(123, { accountShortName: 'initech-simulations' });\n * // now instantiates a GET with the URL: https://forio.com/api/v3/initech-simulations/foobar-game/run/123\n *\n * @memberof config\n * @type {string}\n */\n get accountShortName() {\n return this._accountShortName;\n }\n\n set accountShortName(accountShortName) {\n this._accountShortName = accountShortName;\n }\n\n /**\n * Project name used for making network requests.\n * This is the default value used by Epicenter API adapters when making\n * network requests without explicitly defining an account to use.\n * It is defined on-load based on your browser's URL, and can be\n * overwritten for local development.\n * @example\n * // with browser URL: https://forio.com/app/acme-simulations/foobar-game\n *\n * console.log(config.projectShortName);\n * // should log 'foobar-game'\n *\n * runAdapter.get(123);\n * // instantiates a GET call with the URL: https://forio.com/api/v3/acme-simulations/foobar-game/run/123\n *\n * config.projectShortName = 'barfoo-game';\n * runAdapter.get(123);\n * // now instantiates a GET with the URL: https://forio.com/api/v3/acme-simulations/barfoo-game/run/123\n *\n * runAdapter.get(123, { projectShortName: 'barbaz-game' });\n * // now instantiates a GET with the URL: https://forio.com/api/v3/acme-simulations/barbaz-game/run/123\n *\n * @memberof config\n * @type {string}\n */\n get projectShortName() {\n return this._projectShortName;\n }\n\n set projectShortName(projectShortName) {\n this._projectShortName = projectShortName;\n }\n\n /**\n * Use to determines whether or not the environment is local.\n * @memberof config\n * @return whether or not environment is local.\n */\n isLocal() {\n if (!isBrowser()) return false;\n const host = window.location.host;\n return host === '127.0.0.1' ||\n host.indexOf('local.') === 0 ||\n host.indexOf('ngrok') !== -1 ||\n host.indexOf('localhost') === 0;\n }\n\n loadNode() {\n this.apiProtocol = 'https';\n this.apiHost = 'forio.com';\n return;\n }\n\n loadBrowser() {\n const isLocal = this.isLocal();\n const { protocol, pathname, host } = window.location;\n this.apiProtocol = isLocal ? 'https' : protocol;\n this.apiHost = isLocal ? 'forio.com' : host;\n\n const match = pathname.match(/\\/app\\/([\\w-]+)\\/([\\w-]+)/);\n if (match) {\n const [account, project] = match.slice(1);\n this.accountShortName = account;\n this.projectShortName = project;\n }\n }\n\n setContext(context: {\n apiProtocol?: string;\n apiHost?: string;\n useProjectProxy?: boolean;\n accountShortName?: string;\n projectShortName?: string;\n }) {\n if (context.apiProtocol) this.apiProtocol = context.apiProtocol;\n if (context.apiHost) this.apiHost = context.apiHost;\n if (typeof context.useProjectProxy === 'boolean') this.useProjectProxy = context.useProjectProxy;\n if (context.accountShortName) this.accountShortName = context.accountShortName;\n if (context.projectShortName) this.projectShortName = context.projectShortName;\n }\n}\n\nconst config = new Config();\n/**\n * Configuration -- used to set up and configure global settings for Epicenter JS libs.\n * @namespace config\n */\nexport default config;\n","import EpicenterError from './error';\nimport cookies from './cookies';\nimport { NodeStore, SessionStore, CookieStore } from './store';\nimport { BROWSER_STORAGE_TYPE, ROLE, GROUP_ROLE } from './constants';\nimport { isNode } from './helpers';\nimport config from './config';\nconst { COOKIE, SESSION } = BROWSER_STORAGE_TYPE;\n\n/**\n * User session information returned from authentication endpoints.\n *\n * @remarks\n * Field dependencies:\n * - If `multipleGroups` is true, the user has access to multiple groups and\n * `projectShortName`, `projectKey`, `groupKey`, `groupName`, and `groupRole` will be undefined\n * - If `multipleGroups` is false or undefined, the user is scoped to a single group and\n * `projectShortName`, `projectKey`, `groupKey`, `groupName`, and `groupRole` should be present\n * - `groupKey` and `groupName` are present together (both or neither)\n * - `projectShortName` and `projectKey` are present together (both or neither)\n */\nexport interface UserSession {\n token: string;\n /** User identifier (actually the pseudonym key) */\n userKey: string;\n /**\n * Group identifier for the user's current group.\n * Present when user is scoped to a single group (multipleGroups is false/undefined).\n */\n groupKey?: string;\n /**\n * Name of the user's current group.\n * Present when user is scoped to a single group (multipleGroups is false/undefined).\n */\n groupName?: string;\n /**\n * User's role within their group (FACILITATOR, REVIEWER, LEADER, or PARTICIPANT).\n * Present when user is scoped to a single group (multipleGroups is false/undefined).\n */\n groupRole?: keyof typeof GROUP_ROLE;\n /**\n * Whether the user has access to multiple groups.\n * When true, group/project-specific fields will be undefined.\n */\n multipleGroups?: boolean;\n /**\n * Short name of the project.\n * Present when user is scoped to a single group (multipleGroups is false/undefined).\n */\n projectShortName?: string;\n /**\n * Unique identifier for the project.\n * Present when user is scoped to a single group (multipleGroups is false/undefined).\n */\n projectKey?: string;\n accountShortName: string;\n displayName: string;\n objectType: 'user';\n loginMethod: {\n objectType: string;\n };\n}\n\n/**\n * Admin session information returned from authentication endpoints.\n *\n * Admin sessions can have either:\n * - A global role (SYSTEM or MONITOR) for system-wide access\n * - Team-specific roles (teamAccountRole and/or teamProjectRole) for account/project access\n *\n * @remarks\n * Field dependencies:\n * - If `globalRole` is present, the admin has system-wide access\n * - If `teamAccountRole` is present, `teamAccountShortName` should also be present\n * - If `teamProjectRole` is present, `projectShortName` and `projectKey` should also be present\n * - Personal accounts: admins always have OWNER role for their personal account\n */\nexport interface AdminSession {\n adminHandle: string;\n adminKey: string;\n expires: boolean;\n multipleAccounts: boolean;\n objectType: 'admin';\n /**\n * Global system role (SYSTEM or MONITOR).\n * Present when admin has system-wide access.\n */\n globalRole?: ROLE.SYSTEM | ROLE.MONITOR;\n /**\n * Role within the team account (OWNER, AUTHOR, SUPPORT, or ASSOCIATE).\n * When present, teamAccountShortName should also be present.\n */\n teamAccountRole?: ROLE.OWNER | ROLE.AUTHOR | ROLE.SUPPORT | ROLE.ASSOCIATE;\n /**\n * Short name of the team account.\n * Present when teamAccountRole is set.\n */\n teamAccountShortName?: string;\n /**\n * Role within the specific project (AUTHOR or SUPPORT).\n * When present, projectShortName and projectKey should also be present.\n */\n teamProjectRole?: ROLE.AUTHOR | ROLE.SUPPORT;\n /**\n * Short name of the project.\n * Present when admin is scoped to a specific project.\n */\n projectShortName?: string;\n /**\n * Unique identifier for the project.\n * Present when admin is scoped to a specific project.\n */\n projectKey?: string;\n /**\n * Unique identifier for the group.\n * Present when admin is scoped to a specific group.\n */\n groupKey?: string;\n timeoutMinutes: number;\n token: string;\n}\n\nexport type Session = UserSession | AdminSession;\n\n\nconst SESSION_KEY = 'com.forio.epicenter.session';\nconst EPI_SSO_KEY = 'epicenter.v3.sso';\nclass Identification {\n type;\n\n constructor(storeType: keyof typeof BROWSER_STORAGE_TYPE) {\n if (storeType !== COOKIE && storeType !== SESSION) {\n throw new EpicenterError(`Invalid Storage Type: \"${String(storeType)}\", please use \"${String(COOKIE)}\" or \"${String(SESSION)}\".`);\n }\n this.type = storeType;\n this.consumeSSO();\n }\n\n get session() {\n const Store = this.getStore();\n return new Store().getItem(SESSION_KEY) as Session;\n }\n\n set session(session: Session | undefined) {\n const Store = this.getStore();\n const options = this.getStoreOptions(session);\n\n if (session) {\n new Store(options).setItem(SESSION_KEY, session as Session);\n } else if (this.session) {\n new Store(options).removeItem(SESSION_KEY);\n }\n }\n\n setSessionWithOptions(session: Session | undefined, forcePathInclusion?: boolean) {\n const Store = this.getStore();\n const options = this.getStoreOptions(session, forcePathInclusion);\n\n if (session) {\n new Store(options).setItem(SESSION_KEY, session as Session);\n } else if (this.session) {\n new Store(options).removeItem(SESSION_KEY);\n }\n }\n\n getStore() {\n if (isNode()) return NodeStore;\n switch (this.type) {\n case SESSION: return SessionStore;\n case COOKIE:\n default: return CookieStore;\n }\n }\n\n /* Generates the appropriate path for storing your session (applicable only to cookies) */\n getStoreOptions(session?: Session, forcePathInclusion?: boolean) {\n const mySession = session || this.session;\n if (!mySession || isNode()) return '';\n\n const { objectType } = mySession;\n const isLocal = config.isLocal();\n const base = { samesite: isLocal ? 'lax' : 'none', secure: !isLocal };\n const isCustomDomain = !isLocal && window.location.pathname.split('/')[1] !== 'app';\n const isEpicenterDomain = !isLocal && !isCustomDomain;\n\n /* forcePathInclusion can explicitly override behavior:\n * - true: force scoped path (even on custom domains)\n * - false: force root path (even for users/admins on Epicenter domain)\n * - undefined: use defaults (scoped for users and admins on Epicenter domain, root for custom domains) */\n if (forcePathInclusion === false) {\n return { ...base, path: '/' };\n }\n\n if (\n forcePathInclusion === true ||\n (isEpicenterDomain && (objectType === 'user' || objectType === 'admin'))\n ) {\n const { accountShortName, projectShortName } = config;\n const account = accountShortName ? `/${accountShortName}` : '';\n const project = account && projectShortName ? `/${projectShortName}` : '';\n return { ...base, path: `/app${account}${project}` };\n }\n\n /* Custom domains (when forcePathInclusion is not true) get the root path */\n return { ...base, path: '/' };\n }\n\n consumeSSO() {\n if (isNode()) return;\n\n // Occasionally, the backend might already wrap the cookie in quotes, have to handle\n // both cases, where we get string serialized content w/ quotes and without\n let cookieContent = cookies.getItem(EPI_SSO_KEY);\n if (\n typeof cookieContent === 'string' &&\n cookieContent.charAt(0) !== '\"' &&\n cookieContent.charAt(cookieContent.length - 1) !== '\"'\n ) {\n cookieContent = `\"${cookieContent}\"`;\n }\n\n /* Double parse here b/c the backend serializes it as a string; the first parse\n * converts it into a json string, the second parse converts the json string into\n * json. Yes, it's weird, no, we can't change it (unless we want to rewrite\n * Interface Builder code to accommodate) */\n const session = JSON.parse(JSON.parse(cookieContent ?? '\"null\"'));\n\n if (session) {\n const { accountShortName, projectShortName } = session;\n const account = accountShortName ? `/${accountShortName}` : '';\n const project = account && projectShortName ? `/${projectShortName}` : '';\n this.session = session;\n cookies.removeItem(EPI_SSO_KEY, { path: `/app${account}${project}` });\n cookies.removeItem(EPI_SSO_KEY, {\n domain: `.${window.location.hostname}`,\n path: `/app${account}${project}`,\n });\n }\n }\n}\n\nconst identification = new Identification(COOKIE);\nexport default identification;\n\n","import type { RetryFunction } from './router';\nimport Fault from './fault';\n\n\nexport type Identifier = (error: Fault) => boolean;\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport type HandleFunction = <T>(error: Fault, retry: RetryFunction<T>) => Promise<any>;\n/* eslint-enable @typescript-eslint/no-explicit-any */\n\nexport interface Handler {\n identifier: Identifier;\n handle: HandleFunction;\n unregister: () => void;\n}\n\nclass ErrorManager {\n _handlers: Handler[] = [];\n\n get handlers() {\n return this._handlers;\n }\n\n clearHandlers() {\n this._handlers = [];\n }\n\n registerHandler(\n identifier: Identifier,\n handleFn: HandleFunction,\n ) {\n const handler = {\n identifier,\n handle: handleFn,\n unregister: () => this.unregisterHandler(identifier),\n };\n this.handlers.unshift(handler);\n return handler;\n }\n\n unregisterHandler(identifier: Identifier) {\n const index = this.handlers.findIndex((handler) => handler.identifier === identifier);\n if (index > -1) this.handlers.splice(index, 1);\n }\n\n async handle<Output>(\n error: Fault,\n retryFn: RetryFunction<Output>,\n handlers?: Handler[],\n ): Promise<Output> {\n handlers = handlers || this.handlers;\n const index = handlers.findIndex(({ identifier }) => identifier(error));\n const handler = handlers[index];\n if (!handler) throw error;\n let promise;\n try {\n promise = await handler.handle(error, retryFn).catch((err) => {\n /* This catch call ensures that handle always returns a promise,\n otherwise it'd be caught in the catch block below */\n throw err;\n });\n } catch (e) {\n console.error('Handler failed due to error', e);\n const remainingHandlers = index > -1 ? [...handlers.slice(0, index), ...handlers.slice(index + 1)] : [];\n // Try to handle the new error with the remaining handlers, otherwise keep trying to handle the original error\n const handleableError = e instanceof Fault ? e : error;\n promise = await this.handle(handleableError, retryFn, remainingHandlers);\n }\n return promise;\n }\n}\n\nconst errorManager = new ErrorManager();\n/**\n * Configuration -- used to set up and configure global settings for Epicenter JS libs.\n * @namespace errorManager\n */\nexport default errorManager;\n","import fetch from 'cross-fetch';\nimport EpicenterError from './error';\nimport Fault from './fault';\nimport Result from './result';\nimport identification from './identification';\nimport errorManager from './error-manager';\nimport config from './config';\nimport { prefix, isBrowser } from './helpers';\n\n\ntype Version = number | undefined;\ntype Server = string | undefined;\ntype UseProjectProxy = boolean | undefined;\ntype AccountShortName = string | undefined;\ntype ProjectShortName = string | undefined;\ntype Authorization = string | undefined;\ntype QueryObject = Record<string, unknown>;\ntype SearchParams = string | string[][] | URLSearchParams | QueryObject;\n\nexport interface RoutingOptions {\n authorization?: Authorization;\n server?: Server;\n useProjectProxy?: UseProjectProxy;\n accountShortName?: AccountShortName;\n projectShortName?: ProjectShortName;\n query?: SearchParams;\n headers?: Record<string, string>;\n body?: unknown;\n includeAuthorization?: boolean;\n inert?: boolean | ((fault: Fault) => boolean);\n paginated?: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n parsePage?: (values: any[]) => any[];\n}\n\nexport interface RequestOptions extends RoutingOptions {\n method: string;\n}\n\nexport interface RetryFunction<Output> {\n (): Promise<Output>;\n requestArguments?: { url: URL } & RequestOptions;\n}\n\nexport interface Page<Item> {\n firstResult: number;\n maxResults: number;\n totalResults: number;\n values: Item[];\n prev: () => Promise<Item[]>;\n next: () => Promise<Item[]>;\n all: (first?: number, allValues?: Item[]) => Promise<Item[]>;\n}\n\nexport const MAX_URL_LENGTH = 2048;\nfunction paginate(json: Page<unknown>, url: URL, options: RequestOptions) {\n const parsePage = options.parsePage ?? (<T>(i: T) => i);\n const page = { ...json, values: parsePage(json.values) };\n const prev = async function() {\n const searchParams = new URLSearchParams(url.search);\n if (page.firstResult === 0) {\n console.warn('Pagination: cannot call \"prev\" on first page');\n return [];\n }\n\n const first = page.firstResult - page.maxResults;\n const max = page.maxResults + (first < 0 ? first : 0);\n\n searchParams.set('first', Math.max(first, 0).toString());\n searchParams.set('max', max.toString());\n url.search = searchParams.toString();\n // eslint-disable-next-line no-use-before-define\n const prevPage = await request(url, { ...options, paginated: false }).then(({ body }) => body);\n prevPage.values = parsePage(prevPage.values);\n Object.assign(page, prevPage);\n return page.values;\n };\n\n const next = async function() {\n const searchParams = new URLSearchParams(url.search);\n const first = page.firstResult + page.maxResults;\n if (first >= page.totalResults) {\n console.warn('Pagination: cannot call \"next\" on final page');\n return [];\n }\n\n searchParams.set('first', first.toString());\n url.search = searchParams.toString();\n // eslint-disable-next-line no-use-before-define\n const nextPage = await request(url, { ...options, paginated: false }).then(({ body }) => body);\n nextPage.values = parsePage(nextPage.values);\n Object.assign(page, nextPage);\n return page.values;\n };\n\n const initialTotal = json.totalResults;\n const all = async function(first = 0, allValues: unknown[] = []): Promise<unknown[]> {\n if (first >= initialTotal) return allValues;\n\n const searchParams = new URLSearchParams(url.search);\n searchParams.set('first', first.toString());\n searchParams.delete('max');\n url.search = searchParams.toString();\n // eslint-disable-next-line no-use-before-define\n const nextPage = await request(url, { ...options, paginated: false }).then(({ body }) => body);\n allValues.push(...parsePage(nextPage.values));\n return all(first + nextPage.maxResults, allValues);\n };\n\n page.prev = prev;\n page.next = next;\n page.all = all;\n return page;\n}\n\nconst parseQuery = (query: SearchParams) => {\n if (query.constructor === URLSearchParams) {\n return query;\n }\n\n /* 'query' should be either an array, or string. Objects will be coerced into [key, value] arrays */\n if (typeof query === 'object' && query.constructor === Object) {\n query = Object.entries(query).reduce((arr, [key, value]) => {\n if (Array.isArray(value)) {\n /* Special case for arrayed param values: use duplicated params here */\n return [...arr, ...value.map((v) => [key, v])];\n }\n if (value === undefined || value === null) {\n /* Skip nullish values */\n return arr;\n }\n arr.push([key, value.toString()]);\n return arr;\n }, [] as string[][]);\n }\n return new URLSearchParams(query as string | string[][] | URLSearchParams);\n};\n\n\ninterface Message {\n headers: HeadersInit;\n body: BodyInit | null;\n}\n\nconst createMessage = (\n headersRaw?: Record<string, string>,\n bodyRaw?: unknown,\n includeAuthorization?: boolean,\n authorization?: string,\n): Message => {\n const headers = Object.assign({}, headersRaw);\n let body = null;\n if (isBrowser() && bodyRaw instanceof FormData) {\n body = bodyRaw;\n } else if (bodyRaw) {\n headers['Content-type'] = 'application/json; charset=UTF-8';\n body = JSON.stringify(bodyRaw);\n }\n\n if (!includeAuthorization) {\n delete headers.Authorization;\n return { headers, body };\n }\n\n const { session } = identification;\n if (!headers.Authorization) { // \"headers\" option as primary everything\n if (session) headers.Authorization = `Bearer ${session.token}`; // session token should be default\n if (authorization) headers.Authorization = authorization; // Router option as tertiary override\n if (config.authOverride) headers.Authorization = config.authOverride; // config fallback as secondary override\n }\n return { headers, body };\n};\n\nconst NO_CONTENT = 204;\nconst BAD_REQUEST = 400;\nconst OK = 200;\nasync function request(\n url: URL,\n options: RequestOptions,\n): Promise<Result> {\n // Different browsers have different max URL lengths; we limit to 2048 as a safe\n // lower boundary to prevent truncation that might not be apparent to the user.\n // This can occur in particular with GET requests with large query strings.\n if (url.href.length > MAX_URL_LENGTH) {\n throw new EpicenterError(`URL length exceeds maximum of ${MAX_URL_LENGTH} characters: ${url.href.length} characters.`);\n }\n\n const {\n method,\n headers,\n body,\n includeAuthorization,\n inert,\n paginated,\n authorization,\n } = options;\n\n const message = createMessage(\n headers,\n body,\n includeAuthorization,\n authorization,\n );\n\n const response = await fetch(url.toString(), {\n method,\n cache: 'no-cache',\n redirect: 'follow',\n headers: message.headers,\n body: message.body,\n });\n\n if (response.status === NO_CONTENT) {\n return new Result(undefined, response);\n }\n\n const resContentType = response.headers.get('content-type');\n if (!resContentType || !resContentType.includes('application/json')) {\n throw new EpicenterError(`Response content-type '${resContentType}' does not include 'application/json' and my url is ${url.toString()}, ${method}`);\n }\n\n const json = await response.json();\n if ((response.status >= OK) && (response.status < BAD_REQUEST)) {\n const result = new Result(\n paginated ? paginate(json, url, options) : json,\n response,\n );\n return result;\n }\n\n const fault = new Fault(json, response);\n if (inert === true) throw fault;\n if (typeof inert === 'function' && inert(fault)) throw fault;\n\n const retryOptions = { ...options, inert: true };\n const retry = () => request(url, retryOptions);\n retry.requestArguments = {\n url,\n ...retryOptions,\n };\n return errorManager.handle<Result>(fault, retry);\n}\n\n\n/**\n * Used to make the network calls in all API adapters\n */\nexport default class Router {\n _version: Version = undefined;\n _server: Server = undefined;\n _useProjectProxy: UseProjectProxy = undefined;\n _accountShortName: AccountShortName = undefined;\n _projectShortName: ProjectShortName = undefined;\n _authorization: Authorization = undefined;\n _searchParams = new URLSearchParams();\n\n /**\n * The version of the Epicenter APIs being invoked; expected to stay at `3`\n */\n get version(): Version {\n return this._version;\n }\n\n set version(value: Version) {\n this._version = value;\n }\n\n /**\n * The root path used for the call, essentially protocol + hostname\n * @type {string}\n */\n get server(): Server {\n return this._server;\n }\n\n set server(value: Server) {\n this._server = value;\n }\n\n /**\n * If true, requests are routed to project proxy server.\n * The proxy server processes requests and forwards them to the Epicenter platform as appropriate,\n * usually with some modification. Can be used to grant heightened privileges to a request.\n *\n * If true, prefixes all request pathnames with `proxy/${accountShortName}/${projectShortName}/`.\n * @type {boolean}\n */\n get useProjectProxy(): UseProjectProxy {\n return this._useProjectProxy;\n }\n\n set useProjectProxy(value: UseProjectProxy) {\n this._useProjectProxy = value;\n }\n\n /**\n * Name of the account; for administrative use, this value should be set to 'epicenter'\n * @type {string}\n */\n get accountShortName(): AccountShortName {\n return this._accountShortName;\n }\n\n set accountShortName(value: AccountShortName) {\n this._accountShortName = value;\n }\n\n /**\n * Name of the project; for administrative use, this value should be set to 'manager'\n * @type {string}\n */\n get projectShortName(): ProjectShortName {\n return this._projectShortName;\n }\n\n set projectShortName(value: ProjectShortName) {\n this._projectShortName = value;\n }\n\n /**\n * Auth header; looks like `Bearer TOKEN` or `Basic TOKEN`\n * @type {string}\n */\n get authorization(): Authorization {\n return this._authorization;\n }\n\n set authorization(value: Authorization) {\n this._authorization = value;\n }\n\n /**\n * The search parameters for to use when making a network request. This property has should always return an instance of URLSearchParams or undefined. It has unique properties when used with the assignment operator (`=`); see the examples below for more details.\n * @type {URLSearchParams}\n *\n * @example\n * const router = new Router();\n * router.searchParams = '?foo=123';\n * console.log(router.searchParams); // always returns an instance object: URLSearchParams {}\n * console.log(router.searchParams.toString()); // logs 'foo=123'\n *\n * router.searchParams = 'foo=123'; // can omit the question mark\n * console.log(router.searchParams.toString()); // logs 'foo=123'\n *\n * router.searchParams = [['foo', '123'], ['bar', '456']]; // can accept arrays\n * console.log(router.searchParams.toString()); // logs 'foo=123&bar=456'\n *\n * router.searchParams = { foo: '123', bar: '456' }; // can accept objects\n * console.log(router.searchParams.toString()); // logs 'foo=123&bar=456'\n *\n * router.searchParams = { foo: '123', bar: ['4', '5', '6'] }; // can accept objects with arrayed values\n * console.log(router.searchParams.toString()); // logs 'foo=123&bar=4&bar=5&bar=6'\n *\n * router.searchParams = new URLSearchParams('foo=123'); // can accept instances of URLSearchParams\n * console.log(router.searchParams.toString()); // logs 'foo=123'\n *\n * @param {object|array|string|URLSearchParams} query Value used to set the search parameters\n */\n get searchParams(): SearchParams {\n return this._searchParams;\n }\n\n set searchParams(query: SearchParams) {\n this._searchParams = parseQuery(query);\n }\n\n /**\n * Sets the version. Does nothing if invoked with no input. This is a part of a series of convenience functions for chaining sets on values.\n * @param {string} [version] Version to use\n * @returns {Router} The Router instance\n */\n withVersion(version?: Version): Router {\n if (typeof version !== 'undefined') this.version = version;\n return this;\n }\n\n /**\n * Sets the root path. Does nothing if invoked with no input. This is a part of a series of convenience functions for chaining sets on values.\n * @param {string} [server] Root path to use\n * @returns {Router} The Router instance\n */\n withServer(server?: Server): Router {\n if (typeof server !== 'undefined') this.server = server;\n return this;\n }\n\n /**\n * Sets whether to route requests to project proxy server. Does nothing if invoked with no input. This is a part of a series of convenience functions for chaining sets on values.\n * @param {string} [useProjectProxy] Whether to use the proxy server\n * @returns {Router} The Router instance\n */\n withProjectProxy(useProjectProxy: UseProjectProxy): Router {\n if (typeof useProjectProxy !== 'undefined') this.useProjectProxy = useProjectProxy;\n return this;\n }\n\n /**\n * Sets the account. Does nothing if invoked with no input. This is a part of a series of convenience functions for chaining sets on values.\n * @param {string} [accountShortName] Account name to use\n * @returns {Router} The Router instance\n */\n withAccountShortName(accountShortName?: AccountShortName): Router {\n if (typeof accountShortName !== 'undefined') this.accountShortName = accountShortName;\n return this;\n }\n\n /**\n * Sets the project. Does nothing if invoked with no input. This is a part of a series of convenience functions for chaining sets on values.\n * @param {string} [projectShortName] Project name to use\n * @returns {Router} The Router instance\n */\n withProjectShortName(projectShortName?: ProjectShortName): Router {\n if (typeof projectShortName !== 'undefined') this.projectShortName = projectShortName;\n return this;\n }\n\n /**\n * Sets the project. Does nothing if invoked with no input. This is a part of a series of convenience functions for chaining sets on values.\n * @param {string} [projectShortName] Project name to use\n * @returns {Router} The Router instance\n */\n withAuthorization(authorization?: Authorization): Router {\n if (typeof authorization !== 'undefined') this.authorization = authorization;\n return this;\n }\n\n /**\n * Sets the search parameters. Does nothing if invoked with no input. This is a part of a series of convenience functions for chaining sets on values.\n * @param {string|array|object|URLSearchParams} [searchParams] Search parameters to use, utilizes the same setter as [searchParams](#Router-searchParams)\n * @returns {Router} The Router instance\n */\n withSearchParams(searchParams?: SearchParams): Router {\n if (typeof searchParams !== 'undefined') this.searchParams = searchParams;\n return this;\n }\n\n /**\n * Creates the URL that would be used for a network request. Should prioritize any overrides provided to it, falling back to any values set local to the Router instance, falling back to values set in the config\n * @param uriComponent The URI component used to generate the URL object\n * @param [overrides] Overrides for generating the URL object\n * @param [overrides.server] Override for the root URL string -- composed of the protocol and the hostname; e.g., https://forio.com\n * @param [overrides.useProjectProxy] Override for routing requests to the project proxy server\n * @param [overrides.accountShortName] Override for the account short name\n * @param [overrides.projectShortName] Override for the project short name\n * @param [overrides.version] Override for the version (NIU, is set by the config)\n * @param [overrides.query] Override for the URL search query\n * @returns URL object\n */\n getURL(\n uriComponent: string,\n overrides: {\n server?: string;\n useProjectProxy?: boolean;\n accountShortName?: string;\n projectShortName?: string;\n version?: number;\n query?: SearchParams;\n } = {},\n ): URL {\n const server = overrides.server ?? this.server ?? `${config.apiProtocol}://${config.apiHost}`;\n const useProjectProxy = overrides.useProjectProxy ?? this.useProjectProxy ?? config.useProjectProxy;\n const accountShortName = overrides.accountShortName ?? this.accountShortName ?? config.accountShortName;\n const projectShortName = overrides.projectShortName ?? this.projectShortName ?? config.projectShortName;\n const version = overrides?.version ?? this.version ?? config.apiVersion;\n\n const url = new URL(`${server}`);\n\n const proxyPathComponent = useProjectProxy ? `proxy/${accountShortName}/${projectShortName}/` : '';\n const commonPathComponent = `api/v${version}/${accountShortName}/${projectShortName}`;\n const uniquePathComponent = prefix('/', uriComponent);\n\n url.pathname = `${proxyPathComponent}${commonPathComponent}${uniquePathComponent}`;\n\n url.search = overrides.query !== undefined ?\n parseQuery(overrides.query).toString() :\n (this.searchParams ?? new URLSearchParams()).toString();\n return url;\n }\n\n // Network Requests\n async get(uriComponent: string, options: RoutingOptions = {}): Promise<Result> {\n const {\n accountShortName,\n projectShortName,\n authorization,\n server,\n query,\n useProjectProxy,\n headers,\n includeAuthorization,\n inert,\n paginated,\n parsePage,\n } = options;\n\n const url = this.getURL(uriComponent, {\n server,\n query,\n accountShortName,\n projectShortName,\n useProjectProxy,\n });\n\n return request(url, {\n method: 'GET',\n headers,\n includeAuthorization: includeAuthorization ?? true,\n authorization: authorization ?? this.authorization,\n inert,\n paginated,\n parsePage,\n });\n }\n\n async delete(uriComponent: string, options: RoutingOptions = {}): Promise<Result> {\n const {\n accountShortName,\n projectShortName,\n authorization,\n server,\n query,\n useProjectProxy,\n headers,\n includeAuthorization,\n inert,\n } = options;\n\n const url = this.getURL(uriComponent, {\n server,\n query,\n accountShortName,\n projectShortName,\n useProjectProxy,\n });\n\n return request(url, {\n method: 'DELETE',\n headers,\n includeAuthorization: includeAuthorization ?? true,\n authorization: authorization ?? this.authorization,\n inert,\n });\n }\n\n async patch(uriComponent: string, options: RoutingOptions = {}): Promise<Result> {\n const {\n accountShortName,\n projectShortName,\n authorization,\n server,\n query,\n useProjectProxy,\n headers,\n body,\n includeAuthorization,\n inert,\n } = options;\n\n const url = this.getURL(uriComponent, {\n server,\n query,\n accountShortName,\n projectShortName,\n useProjectProxy,\n });\n\n return request(url, {\n method: 'PATCH',\n headers,\n body,\n includeAuthorization: includeAuthorization ?? true,\n authorization: authorization ?? this.authorization,\n inert,\n });\n }\n\n async post(uriComponent: string, options: RoutingOptions = {}): Promise<Result> {\n const {\n accountShortName,\n projectShortName,\n authorization,\n server,\n query,\n useProjectProxy,\n headers,\n body,\n includeAuthorization,\n inert,\n } = options;\n\n const url = this.getURL(uriComponent, {\n server,\n query,\n accountShortName,\n projectShortName,\n useProjectProxy,\n });\n\n return request(url, {\n method: 'POST',\n headers,\n body,\n includeAuthorization: includeAuthorization ?? true,\n authorization: authorization ?? this.authorization,\n inert,\n });\n }\n\n async put(uriComponent: string, options: RoutingOptions = {}): Promise<Result> {\n const {\n accountShortName,\n projectShortName,\n authorization,\n server,\n query,\n useProjectProxy,\n headers,\n body,\n includeAuthorization,\n inert,\n } = options;\n\n const url = this.getURL(uriComponent, {\n server,\n query,\n accountShortName,\n projectShortName,\n useProjectProxy,\n });\n\n return request(url, {\n method: 'PUT',\n headers,\n body,\n includeAuthorization: includeAuthorization ?? true,\n authorization: authorization ?? this.authorization,\n inert,\n });\n }\n}\n","import type { RoutingOptions } from '../utils/router';\nimport type { Admin } from './admin';\nimport type { Project } from './project';\n\nimport Router from '../utils/router';\n\ntype WorkerPartition = 'NONE' | 'ALL' | 'DEVELOPMENT' | 'FREE' | 'LICENSED' | 'ACCOUNT';\n\nexport interface SecretStrategyCreateInView {\n difficulty?: string;\n encryption?: string;\n expirationDays?: number;\n reuseHorizon?: number;\n}\n\nexport interface DisplayNameStrategyCreateInView {\n displayNameGenerator: string;\n clearOnDeletion: boolean;\n}\n\nexport interface RetentionPreferenceCreateInView {\n inactiveUserRetentionDays?: number;\n dataRetentionDays?: number;\n}\n\nexport interface MultiFactorStrategyCreateInView {\n expirationDays: number;\n adminMultiFactorRequirement: string;\n userMultiFactorRequirement: string;\n}\n\nexport interface SecretCreateInView {\n password?: string;\n}\n\nexport interface AccountSettingCreateInView {\n allowProjectScopedModels?: boolean;\n concurrentRunLimit?: number;\n authenticatedProjectLimit?: number;\n maximumUsers?: number;\n allowMultiPlayer?: boolean;\n}\n\nexport interface BillingInformationCreateInView {\n subscriptionPlan?: string;\n subscriptionExpiration?: string;\n billingInterval?: string;\n}\n\nexport interface AccountLegacySettingsCreateInView {\n authorizationMode?: string;\n}\n\nexport interface LockoutLimitsCreateInView {\n blackoutMinutes: number;\n adminAttempts: number;\n userAttempts: number;\n}\n\nexport interface PersonalAccountCreateInView {\n objectType: 'personal';\n shortName: string;\n adminKey: string;\n name: string;\n workerPartition?: WorkerPartition;\n active?: boolean;\n sharedSecret?: string;\n}\n\nexport interface TeamAccountCreateInView {\n objectType: 'team';\n shortName: string;\n adminKey: string;\n name: string;\n secretStrategy?: SecretStrategyCreateInView;\n displayNameStrategy?: DisplayNameStrategyCreateInView;\n allowDeletion?: boolean;\n retentionPreference?: RetentionPreferenceCreateInView;\n multiFactorStrategy?: MultiFactorStrategyCreateInView;\n active?: boolean;\n apiSecret?: SecretCreateInView;\n accountSetting?: AccountSettingCreateInView;\n billingInformation?: BillingInformationCreateInView;\n legacySettings?: AccountLegacySettingsCreateInView;\n workerPartition?: WorkerPartition;\n allowStrongFacilitators?: boolean;\n sharedSecret?: string;\n allowAmbiguousHandles?: boolean;\n lockoutLimits?: LockoutLimitsCreateInView;\n}\n\nexport interface SecretStrategyReadOutView {\n difficulty?: string;\n encryption?: string;\n expirationDays?: number;\n reuseHorizon?: number;\n}\n\nexport interface DisplayNameStrategyReadOutView {\n displayNameGenerator?: string;\n clearOnDeletion?: boolean;\n}\n\nexport interface RetentionPreferenceReadOutView {\n inactiveUserRetentionDays?: number;\n dataRetentionDays?: number;\n}\n\nexport interface BillingInformationReadOutView {\n subscriptionPlan?: string;\n subscriptionExpiration?: string;\n billingInterval?: string;\n}\n\nexport interface MultiFactorStrategyReadOutView {\n expirationDays?: number;\n adminMultiFactorRequirement?: string;\n userMultiFactorRequirement?: string;\n}\n\nexport interface AccountLegacySettingsReadOutView {\n authorizationMode?: string;\n}\n\nexport interface AccountSettingReadOutView {\n allowProjectScopedModels?: boolean;\n concurrentRunLimit?: number;\n authenticatedProjectLimit?: number;\n maximumUsers?: number;\n allowMultiPlayer?: boolean;\n}\n\nexport interface AccountPermissionReadOutView {\n objectType: 'account';\n role?: string;\n handle?: string;\n adminKey?: string;\n}\n\nexport interface LogoReadOutView {\n imageType?: 'PNG' | 'JPG' | 'SVG';\n}\n\nexport interface LockoutLimitsReadOutView {\n adminAttempts?: number;\n userAttempts?: number;\n blackoutMinutes?: number;\n}\n\nexport interface PersonalAccountReadOutView {\n objectType: 'personal';\n shortName?: string;\n name?: string;\n workerPartition?: WorkerPartition;\n active?: boolean;\n admin?: Admin;\n projects?: Project[];\n tombstone?: string;\n created?: string;\n lastUpdated?: string;\n}\n\nexport interface TeamAccountReadOutView {\n objectType: 'team';\n shortName?: string;\n name?: string;\n workerPartition?: WorkerPartition;\n secretStrategy?: SecretStrategyReadOutView;\n displayNameStrategy?: DisplayNameStrategyReadOutView;\n allowDeletion?: boolean;\n retentionPreference?: RetentionPreferenceReadOutView;\n multiFactorStrategy?: MultiFactorStrategyReadOutView;\n active?: boolean;\n accountSetting?: AccountSettingReadOutView;\n billingInformation?: BillingInformationReadOutView;\n legacySettings?: AccountLegacySettingsReadOutView;\n allowStrongFacilitators?: boolean;\n allowAmbiguousHandles?: boolean;\n lockoutLimits?: LockoutLimitsReadOutView;\n members?: AccountPermissionReadOutView[];\n logo?: LogoReadOutView;\n projects?: Project[];\n tombstone?: string;\n created?: string;\n lastUpdated?: string;\n}\n\nexport type AccountReadOutView = PersonalAccountReadOutView | TeamAccountReadOutView;\n\nexport interface PersonalAccountUpdateInView {\n objectType: 'personal';\n name?: string;\n workerPartition?: WorkerPartition;\n active?: boolean;\n}\n\nexport interface TeamAccountUpdateInView {\n objectType: 'team';\n name?: string;\n workerPartition?: WorkerPartition;\n active?: boolean;\n billingInterval?: string;\n}\n\n\n/**\n * Retrieves account information by account short name\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/account`\n *\n * @example\n * import { accountAdapter } from 'epicenter-libs';\n * const account = await accountAdapter.getAccount('acme');\n *\n * @param accountShortName The short name of the account to retrieve\n * @returns promise that resolves to the account information\n */\nexport async function getAccount(accountShortName: string): Promise<AccountReadOutView> {\n return await new Router()\n .withAccountShortName(accountShortName)\n .get('/account')\n .then(({ body }) => body);\n}\n\n\n/**\n * Creates a new personal or team account\n * Base URL: POST `https://forio.com/api/v3/epicenter/manager/account`\n *\n * @example\n * import { accountAdapter } from 'epicenter-libs';\n * // Create a personal account\n * const personalAccount = await accountAdapter.createAccount({\n * objectType: 'personal',\n * adminKey: 'admin-key',\n * name: 'John Doe',\n * shortName: 'johndoe',\n * });\n * // Create a team account with billing\n * const teamAccount = await accountAdapter.createAccount({\n * objectType: 'team',\n * adminKey: 'admin-key',\n * name: 'Acme Corp',\n * shortName: 'acme',\n * billingInformation: {\n * billingInterval: 'monthly',\n * subscriptionPlan: 'standard',\n * },\n * });\n *\n * @param view Account creation information\n * @param view.objectType Account type; either 'personal' or 'team'\n * @param view.shortName Unique short name for account, used as part of URL\n * @param view.adminKey Admin key for the account\n * @param view.name Descriptive name of account\n * @param [view.workerPartition] Defines location of model execution\n * @param [view.active] Determines if the account can be used\n * @param [view.sharedSecret] Optional shared secret for the account\n * @param [view.secretStrategy] Configuration related to account secrets (team only)\n * @param [view.displayNameStrategy] Configuration related to user displayName (team only)\n * @param [view.allowDeletion] Determines if this account can be deleted (team only)\n * @param [view.retentionPreference] Configuration related to data, user, group retention preferences (team only)\n * @param [view.multiFactorStrategy] Configuration related to multifactor authentication (team only)\n * @param [view.apiSecret] Configuration related to API secret keys (team only)\n * @param [view.accountSetting] Configuration related to account usage limits and capabilities (team only)\n * @param [view.billingInformation] Subscription and billing configuration (team only)\n * @param [view.legacySettings] API settings used for compatibility with legacy accounts (team only)\n * @param [view.allowStrongFacilitators] Determines if facilitators can update participants' identifying information (team only)\n * @param [view.allowAmbiguousHandles] Determines if a handle can be reused for an admin and a user in this account (team only)\n * @param [view.lockoutLimits] Configuration related to failed login attempt limits (team only)\n * @returns promise that resolves to the newly created account\n */\nexport async function createAccount(\n view: PersonalAccountCreateInView | TeamAccountCreateInView,\n): Promise<AccountReadOutView> {\n return await new Router()\n .withAccountShortName('epicenter')\n .withProjectShortName('manager')\n .post('/account', {\n body: view,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Updates an existing personal or team account\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/account`\n *\n * @example\n * import { accountAdapter } from 'epicenter-libs';\n * // Update a personal account\n * const updatedPersonal = await accountAdapter.updateAccount({\n * objectType: 'personal',\n * name: 'Jane Doe',\n * active: true,\n * });\n * // Update a team account\n * const updatedTeam = await accountAdapter.updateAccount({\n * objectType: 'team',\n * name: 'Acme Corporation',\n * billingInterval: 'annual',\n * });\n *\n * @param view Account update information\n * @param view.objectType Account type; either 'personal' or 'team'\n * @param [view.name] Updated descriptive name of account\n * @param [view.workerPartition] Updated location of model execution\n * @param [view.active] Updated status determining if the account can be used\n * @param [view.billingInterval] Updated billing interval (team only)\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the updated account information\n */\nexport async function updateAccount(\n view: PersonalAccountUpdateInView | TeamAccountUpdateInView,\n optionals: RoutingOptions = {},\n): Promise<AccountReadOutView> {\n return await new Router()\n .patch('/account', {\n body: view,\n ...optionals,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Deletes an account by account short name\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/account`\n *\n * @example\n * import { accountAdapter } from 'epicenter-libs';\n * await accountAdapter.removeAccount('acme');\n *\n * @param accountShortName The short name of the account to delete\n * @returns promise that resolves when the account is deleted\n */\nexport async function removeAccount(\n accountShortName: string,\n): Promise<void> {\n return await new Router()\n .withAccountShortName(accountShortName)\n .delete('/account')\n .then(({ body }) => body);\n}\n\n\n/**\n * Retrieves all team accounts for a given admin user\n * Base URL: GET `https://forio.com/api/v3/epicenter/manager/account/team/for/{ADMIN_KEY}`\n *\n * @example\n * import { accountAdapter } from 'epicenter-libs';\n * const teams = await accountAdapter.teamForAdmin('admin-key-123', {\n * includeAllMembers: true,\n * filter: 'active',\n * first: 0,\n * max: 50,\n * });\n *\n * @param adminKey Admin key to retrieve teams for\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.includeAllMembers] Include all members in the response\n * @param [optionals.filter] Filter string for results\n * @param [optionals.first] Index of first result to return\n * @param [optionals.max] Maximum number of results to return\n * @returns promise that resolves to an array of team accounts\n */\nexport async function teamForAdmin(\n adminKey: string,\n optionals: {\n includeAllMembers?: boolean;\n filter?: string;\n first?: number;\n max?: number;\n } & RoutingOptions = {},\n): Promise<AccountReadOutView[]> {\n const {\n includeAllMembers,\n filter,\n first,\n max,\n ...routingOptions\n } = optionals;\n const searchParams = {\n includeAllMembers,\n filter,\n first,\n max,\n };\n\n return await new Router()\n .withAccountShortName('epicenter')\n .withProjectShortName('manager')\n .withSearchParams(searchParams)\n .get(`/account/team/for/${adminKey}`, routingOptions)\n .then(({ body }) => body);\n}\n","import type { RoutingOptions } from '../utils/router';\n\nimport Router from '../utils/router';\n\nexport interface Secret {\n password: string;\n}\n\nexport interface AdminCreateInView {\n [key: string]: unknown;\n handle: string;\n email: string;\n givenName?: string;\n familyName?: string;\n verified: true;\n active?: true;\n}\n\nexport interface Admin {\n lastUpdated: string;\n lastLogin: string;\n created: string;\n familyName: string;\n givenName: string;\n verified: boolean;\n handle: string;\n active: boolean;\n adminKey: string;\n email: string;\n objectType: 'external' | 'native';\n}\n\nexport interface NativeAdminCreateInView extends AdminCreateInView {\n objectType: 'native';\n secret: Secret;\n}\n\n\n/**\n * Creates a new admin user\n * Base URL: POST `https://forio.com/api/v3/epicenter/manager/admin`\n *\n * @example\n * import { adminAdapter } from 'epicenter-libs';\n * const admin = await adminAdapter.createAdmin({\n * handle: 'admin@example.com',\n * email: 'admin@example.com',\n * givenName: 'Jane',\n * familyName: 'Doe',\n * verified: true,\n * active: true,\n * });\n *\n * @param view Admin user information\n * @param view.handle Handle for the admin user\n * @param view.email Email address for the admin user\n * @param [view.givenName] Admin user's given name\n * @param [view.familyName] Admin user's family name\n * @param view.verified Verification status; must be true\n * @param [view.active] Active status; defaults to true if unset\n * @returns promise that resolves to the newly created admin user\n */\nexport async function createAdmin(\n view: {\n handle: string;\n email: string;\n givenName?: string;\n familyName?: string;\n verified: true;\n active?: true;\n [key: string]: unknown;\n },\n): Promise<Admin> {\n return await new Router()\n .withAccountShortName('epicenter')\n .withProjectShortName('manager')\n .post('/admin', {\n body: view,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Retrieves an admin user by handle\n * Base URL: GET `https://forio.com/api/v3/epicenter/manager/admin/with/{HANDLE}`\n *\n * @example\n * import { adminAdapter } from 'epicenter-libs';\n * const admin = await adminAdapter.getWithHandle('admin@example.com');\n *\n * @param handle Handle for the admin user\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the admin user\n */\nexport async function getWithHandle(handle: string, optionals: RoutingOptions = {}): Promise<Admin> {\n return await new Router()\n .withAccountShortName('epicenter')\n .withProjectShortName('manager')\n .get(`/admin/with/${handle}`, optionals)\n .then(({ body }) => body);\n}\n","/**\n * Enhanced filter functionality for epicenter-libs\n * Supports backwards-compatible string arrays, raw filter strings,\n * and object-based filter groups with arbitrary nesting\n */\n\nexport interface FilterGroup {\n type: 'and' | 'or' | 'taxonomy';\n filters: (string | FilterGroup)[];\n}\n\nexport type FilterInput = string[] | string | FilterGroup;\n\n/**\n * Recursively parses a FilterGroup object into a boolean filter string\n * @param group - FilterGroup object to parse\n * @returns Boolean filter string representation\n */\nfunction parseFilterGroup(group: FilterGroup): string {\n if (!group.filters || group.filters.length === 0) {\n return '';\n }\n\n const parsedFilters = group.filters\n .map((filter) => {\n if (typeof filter === 'string') {\n return filter;\n }\n return parseFilterGroup(filter);\n })\n .filter((filter) => filter.length > 0);\n\n if (parsedFilters.length === 0) {\n return '';\n }\n\n if (!group.type || !['and', 'or', 'taxonomy'].includes(group.type)) {\n throw new Error(`Invalid or missing filter group type: ${group.type || 'undefined'}`);\n }\n\n const joinedFilters = parsedFilters.join(';');\n\n if (parsedFilters.length === 1) {\n return joinedFilters;\n }\n\n switch (group.type) {\n case 'and':\n return `(${joinedFilters})`;\n case 'or':\n return `[${joinedFilters}]`;\n case 'taxonomy':\n return `{${joinedFilters}}`;\n default:\n throw new Error(`Unexpected filter group type: ${group.type}`);\n }\n}\n\n\n/**\n * Parses various filter input formats into the platform's expected filter string format\n * @param filterInput - Array of strings, filter string, or FilterGroup object\n * @returns Platform-compatible filter string or undefined if no filters\n */\nexport function parseFilterInput(filterInput: FilterInput | undefined): string | undefined {\n if (!filterInput) {\n return undefined;\n }\n\n // Handle string array (backwards compatibility)\n if (Array.isArray(filterInput)) {\n return filterInput.length > 0 ? filterInput.join(';') : undefined;\n }\n\n // Handle raw string (pass through - allows advanced users to write boolean syntax directly)\n if (typeof filterInput === 'string') {\n return filterInput || undefined;\n }\n\n // Handle FilterGroup object\n return parseFilterGroup(filterInput) || undefined;\n}\n","import type { RoutingOptions } from '../utils/router';\nimport { ROLE, Router } from '../utils';\n\nexport const ACCESS_TYPE = {\n PUBLIC: 'PUBLIC',\n PRIVATE: 'PRIVATE',\n AUTHENTICATED: 'AUTHENTICATED',\n} as const;\n\nexport type AccessType = (typeof ACCESS_TYPE)[keyof typeof ACCESS_TYPE];\n\nexport const WORKER_PARTITION = {\n NONE: 'NONE',\n ALL: 'ALL',\n FREE: 'FREE',\n LICENSED: 'LICENSED',\n ACCOUNT: 'ACCOUNT',\n} as const;\n\nexport type WorkerPartition = (typeof WORKER_PARTITION)[keyof typeof WORKER_PARTITION];\n\nexport const PHYLOGENY = {\n ORIGINAL: 'ORIGINAL',\n HISTORICAL: 'HISTORICAL',\n REFERENTIAL: 'REFERENTIAL',\n ORDERED: 'ORDERED',\n EVENTUAL: 'EVENTUAL',\n /**\n * TRANSMOGRIFIED Improves the way Epicenter runs proxies.\n */\n TRANSMOGRIFIED: 'TRANSMOGRIFIED',\n /**\n * REANIMATED Changes the default run start-up ritual.\n */\n REANIMATED: 'REANIMATED',\n /**\n * SILENT Inhibits push channel notifications unless allowChannel is true, which by default is false.\n */\n SILENT: 'SILENT',\n} as const;\n\nexport type Phylogeny = (typeof PHYLOGENY)[keyof typeof PHYLOGENY];\n\nexport type FileType = 'INSENSITIVE' | 'SENSITIVE';\n\nexport const CHANNEL_PROTOCOL = {\n OUMUAMUA: 'OUMUAMUA',\n COMETD: 'COMETD',\n} as const;\n\nexport type ChannelProtocol = (typeof CHANNEL_PROTOCOL)[keyof typeof CHANNEL_PROTOCOL];\n\nexport interface ProjectMember {\n role: ROLE.AUTHOR;\n adminKey: string;\n objectType: 'project';\n}\n\nexport interface Deployment {\n defaultGroupName: string;\n autoCreatePlayer: boolean;\n loginFile: string;\n welcomeFile: string;\n groupFile: string;\n}\n\nexport interface TeamProject {\n concurrentRunLimit: number;\n modelFile: string;\n available: boolean;\n allowWorldSelfAssign: boolean;\n legacySettings: {\n blockDirectApiCalls: boolean;\n channelAuthorizationRequired: boolean;\n filePermissionsActive: boolean;\n showEmail: boolean;\n transmogrifierActive: boolean;\n dataApiAllowAnonymousAccess: boolean;\n channelVersion: number;\n authorizationMode: 'LEGACY' | 'USER';\n dataApiEnforceScope: boolean;\n };\n objectType: 'team';\n accessType: AccessType;\n sessionTimeoutSeconds: number;\n projectKey: string;\n members: ProjectMember[];\n channelEnabled: boolean;\n workerPartition: WorkerPartition;\n name: string;\n phylogeny: Phylogeny;\n multiPlayerEnabled: boolean;\n shortName: string;\n approximateRunCount: number;\n pricing: {\n amount: number;\n };\n dataRetentionDays: number;\n fileType: FileType;\n dimensions: 'UNIVERSE' | 'MULTIVERSE';\n deployment: Deployment;\n channelProtocol: ChannelProtocol;\n}\n\nexport interface PersonalProject {\n concurrentRunLimit: number;\n available: boolean;\n objectType: 'personal';\n accessType: AccessType;\n sessionTimeoutSeconds: number;\n projectKey: string;\n workerPartition: WorkerPartition;\n name: string;\n phylogeny: Phylogeny;\n shortName: string;\n approximateRunCount: number;\n fileType: FileType;\n deployment: Deployment;\n channelProtocol: ChannelProtocol;\n channelEnabled: boolean;\n}\n\nexport type Project =\n | TeamProject\n | PersonalProject;\n\n/**\n * Checks to see if the project currently has the push channels enabled\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/project/channel/isEnabled`\n *\n * @example\n * import { projectAdapter } from 'epicenter-libs';\n * const enabled = await projectAdapter.channelsEnabled();\n *\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise resolving true/false whether or not the project supports the use of push channels\n */\nexport async function channelsEnabled(\n optionals: RoutingOptions = {},\n): Promise<boolean> {\n return await new Router()\n .get('/project/channel/isEnabled', optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Gets the current project details\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/project`\n *\n * @example\n * import { projectAdapter } from 'epicenter-libs';\n * const project = await projectAdapter.get();\n *\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the project object\n */\nexport async function get(\n optionals: RoutingOptions = {},\n): Promise<Project> {\n return await new Router()\n .get('/project', optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Lists all projects in an account\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/manager/project/in`\n *\n * @example\n * import { projectAdapter } from 'epicenter-libs';\n * const projects = await projectAdapter.list('my-account');\n *\n * @param accountShortName The account short name\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to an array of project objects\n */\nexport async function list(\n accountShortName: string,\n optionals: RoutingOptions = {},\n): Promise<Project[]> {\n return await new Router()\n .withAccountShortName(accountShortName)\n .withProjectShortName('manager')\n .get('/project/in', optionals)\n .then(({ body }) => body);\n}\n","import type { CometD, Message, SubscriptionHandle } from 'cometd';\nimport type Channel from './channel';\nimport type { ChannelMessage } from './channel';\n\nimport { EpicenterError, Fault, identification, isBrowser, errorManager, config } from '../utils';\nimport { get as getProject } from './project';\n\nconst AUTH_TOKEN_KEY = 'com.forio.epicenter.token';\nconst MAX_RETRIES = 3;\n\nconst IDLE = 'idle';\nconst FAILED = 'failed';\nconst CONNECTED = 'connected';\nconst SUCCEEDED = 'succeeded';\nconst CONNECTING = 'connecting';\nconst HANDSHAKING = 'handshaking';\nconst DISCONNECTED = 'disconnected';\nconst FORBIDDEN = 403;\nconst CONNECT_META_CHANNEL = '/meta/connect';\nconst DISCONNECT_META_CHANNEL = '/meta/disconnect';\nconst HANDSHAKE_META_CHANNEL = '/meta/handshake';\nconst COMETD_RECONNECTED = 'COMETD_RECONNECTED';\nconst DEFAULT_CHANNEL_PROTOCOL = 'cometd';\n\ntype HandshakeState = 'idle' | 'handshaking' | 'succeeded' | 'failed';\n\n// error messages that indicate session invalidation as\n// described in cometd documentation and oumuamua source code:\n// https://docs.cometd.org/current/reference/#_javascript_disconnect\n// https://github.com/zenbones/SmallMind/blob/main/bayeux/oumuamua/server/spi/src/main/java/org/smallmind/bayeux/oumuamua/server/spi/MetaProcessingException.java\n\nconst SESSION_INVALIDATION_ERRORS = [\n '402',\n 'session_unknown',\n 'invalid client id',\n 'missing client id',\n 'session has been disconnected',\n 'invalid session type',\n 'handshake_denied',\n 'handshake_failed',\n];\n\nfunction isSessionInvalidationError(errorMessage: string): boolean {\n const lowerError = errorMessage.toLowerCase();\n return SESSION_INVALIDATION_ERRORS.some((pattern) => {\n return lowerError.includes(pattern);\n });\n}\n\nfunction isIllegalStateError(error: unknown): boolean {\n return error instanceof Error && error.message.toLowerCase().includes('illegal state');\n}\n\nfunction shouldRehandshake(reply: Message): boolean {\n const advice = reply.advice?.reconnect;\n if (advice === 'handshake') {\n return true;\n }\n\n const errorMessage = reply.error ?? '';\n return isSessionInvalidationError(errorMessage);\n}\n\nlet cometdInstance: CometD | undefined;\nclass CometdAdapter {\n url = '';\n initialization: Promise<boolean> | undefined = undefined;\n handshakePromise: Promise<void> | undefined = undefined;\n subscriptions = new Map<string, SubscriptionHandle>();\n isConnected = false;\n handshakeState: HandshakeState = IDLE;\n pendingOperations: Array<() => Promise<unknown>> = [];\n processingQueue = false;\n\n get cometd() {\n if (!cometdInstance) {\n throw new EpicenterError('Tried to get non-existent cometd');\n }\n return cometdInstance;\n }\n\n set cometd(instance) {\n cometdInstance = instance;\n }\n\n async startup(options: { logLevel: 'info' | 'debug' | 'warn' } = { logLevel: 'warn' }) {\n const project = await getProject();\n if (!project.channelEnabled) throw new EpicenterError('Push Channels are not enabled on this project');\n const channelProtocol = project.channelProtocol?.toLowerCase() || DEFAULT_CHANNEL_PROTOCOL;\n const { CometD } = await import('cometd');\n const { AckExtension } = await import('cometd');\n const { ReloadExtension } = await import('cometd');\n\n this.cometd = new CometD();\n const { apiProtocol, apiHost, apiVersion, accountShortName, projectShortName } = config;\n const accountProject = (accountShortName && projectShortName) ?\n `/${accountShortName}/${projectShortName}` :\n '/epicenter/manager';\n this.url = `${apiProtocol}://${apiHost}/push/v${apiVersion}${accountProject}/${channelProtocol}`;\n\n this.cometd.registerExtension('ack', new AckExtension());\n if (isBrowser()) {\n this.cometd.registerExtension('reload', new ReloadExtension());\n\n window.onunload = () => {\n if (this.cometd.getStatus() === CONNECTED) {\n if (this.cometd.reload) this.cometd.reload();\n const transport = this.cometd.getTransport();\n if (transport) transport.abort();\n }\n };\n }\n\n this.cometd.configure({\n url: this.url,\n logLevel: options.logLevel,\n });\n return true;\n }\n\n listenToMetaChannels() {\n this.cometd.addListener(HANDSHAKE_META_CHANNEL, (message: Message) => {\n if (message.successful) {\n this.handshakeState = SUCCEEDED;\n this.processPendingOperations();\n } else {\n this.handshakeState = FAILED;\n this.handleHandshakeFailure(message);\n }\n });\n\n const connectListener = new Promise((resolve, reject) => {\n this.cometd.addListener(CONNECT_META_CHANNEL, (message: Message) => {\n if (this.cometd.isDisconnected()) {\n return;\n }\n const wasConnected = this.isConnected;\n this.isConnected = message.successful || false;\n\n if (!wasConnected && this.isConnected) {\n const error = new Fault({\n status: undefined,\n message: 'Reconnected to CometD',\n information: {\n code: COMETD_RECONNECTED,\n },\n });\n const retry = () => Promise.resolve();\n\n try {\n const result = errorManager.handle(error, retry);\n resolve(result);\n } catch (e) {\n reject(e);\n }\n this.processPendingOperations();\n } else if (wasConnected && !this.isConnected) {\n this.handshakeState = IDLE;\n }\n });\n });\n\n const disconnectListener = new Promise((resolve) => {\n this.cometd.addListener(DISCONNECT_META_CHANNEL, (message: Message) => {\n if (message.successful) {\n this.isConnected = false;\n this.handshakeState = IDLE;\n }\n resolve(message);\n });\n });\n\n return Promise.all([connectListener, disconnectListener]);\n }\n\n private handleHandshakeFailure(message: Message) {\n if (shouldRehandshake(message)) {\n this.handshakeState = IDLE;\n this.handshakePromise = undefined;\n }\n }\n\n private async processPendingOperations() {\n if (this.processingQueue || this.pendingOperations.length === 0) return;\n\n this.processingQueue = true;\n const operations = [...this.pendingOperations];\n this.pendingOperations = [];\n\n try {\n await Promise.all(operations.map((op) => op().catch(console.error)));\n } finally {\n this.processingQueue = false;\n }\n }\n\n async init(options?: { logLevel: 'info' | 'debug' | 'warn' }) {\n if (!this.initialization) {\n this.initialization = this.startup(options);\n }\n return this.initialization;\n }\n\n // Connects to CometD server\n async handshake(options: { inert?: boolean } = {}) {\n await this.init();\n\n // Prevent concurrent handshake attempts\n if (this.handshakePromise && this.handshakeState === HANDSHAKING) {\n return this.handshakePromise;\n }\n\n const currentStatus = this.cometd.getStatus();\n\n // If already connected and handshake succeeded, return immediately\n if (currentStatus === CONNECTED && this.handshakeState === SUCCEEDED) {\n return Promise.resolve();\n }\n\n // If CometD is connecting or handshaking, don't call handshake again - just wait\n if (currentStatus === CONNECTING || currentStatus === HANDSHAKING) {\n if (this.handshakePromise) {\n return this.handshakePromise;\n }\n // Return a rejected promise to indicate we can't handshake right now\n return Promise.reject(new Error('CometD is already connecting, please wait'));\n }\n\n // Only proceed if disconnected\n if (currentStatus !== DISCONNECTED) {\n return Promise.resolve();\n }\n\n this.handshakeState = HANDSHAKING;\n const { session } = identification;\n let handshakeProps = {};\n\n if (session) {\n handshakeProps = {\n ext: {\n [AUTH_TOKEN_KEY]: session.token,\n ack: true,\n },\n };\n }\n\n this.cometd.websocketEnabled = true;\n this.handshakePromise = new Promise((resolve, reject) => {\n this.cometd.handshake(handshakeProps, (handshakeReply) => {\n if (handshakeReply.successful) {\n this.handshakeState = SUCCEEDED;\n this.listenToMetaChannels();\n resolve(undefined);\n return;\n }\n\n this.handshakeState = FAILED;\n\n if (shouldRehandshake(handshakeReply)) {\n this.handshakeState = IDLE;\n this.handshakePromise = undefined;\n }\n\n const errorMessage = handshakeReply.error ?? '';\n const error = new Fault({\n status: errorMessage.includes('403') ? FORBIDDEN : undefined,\n message: errorMessage,\n information: {\n code: 'COMETD_ERROR',\n ...handshakeReply,\n },\n });\n\n if (options.inert) {\n reject(error);\n return;\n }\n\n const retry = () => this.handshake({ inert: true });\n try {\n const result = errorManager.handle(error, retry);\n resolve(result);\n } catch (e) {\n reject(e);\n }\n });\n });\n\n return this.handshakePromise;\n }\n\n async disconnect() {\n if (!this.initialization) return Promise.resolve();\n\n await this.init();\n await this.empty();\n if (this.cometd.getStatus() !== CONNECTED) return Promise.resolve();\n\n return new Promise((resolve, reject) => this.cometd.disconnect((disconnectReply: Message) => {\n if (disconnectReply.successful) {\n resolve(undefined);\n return;\n }\n\n const errorMessage = disconnectReply.error ?? '';\n if (isSessionInvalidationError(errorMessage)) {\n resolve(undefined);\n return;\n }\n\n reject(new EpicenterError('Unable to disconnect from CometD server'));\n }));\n }\n\n async add<D = unknown>(\n channel: Channel<D>,\n update: (data: ChannelMessage<D>) => unknown,\n options: {\n inert?: boolean;\n _retryCount?: number;\n } = {},\n ): Promise<SubscriptionHandle> {\n await this.init();\n\n const currentStatus = this.cometd?.getStatus();\n if (currentStatus !== CONNECTED) {\n try {\n await this.handshake();\n } catch (error: unknown) {\n const errorObj = error as { message?: string };\n if (errorObj?.message?.includes('already connecting')) {\n // Wait a moment and try again\n const retryDelay = 500;\n await new Promise((resolve) => setTimeout(resolve, retryDelay));\n if (this.cometd?.getStatus() === CONNECTED) {\n // Connection succeeded while we waited, continue to subscription\n // Don't return here since we need to continue with the subscription logic\n }\n }\n throw error;\n }\n }\n const { session } = identification;\n const subscriptionProps = !session ?\n {} :\n { ext: { [AUTH_TOKEN_KEY]: session.token } };\n\n const handleCometdUpdate = (message: Message) => {\n // TODO -- figure out why there's ambiguity here and try to remove it\n let data = message.data;\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (_error: unknown) {\n // If parsing fails, use raw string\n }\n }\n return update(data);\n };\n\n return new Promise((resolve, reject) => {\n let subscription: SubscriptionHandle;\n try {\n subscription = this.cometd.subscribe(\n channel.path,\n handleCometdUpdate,\n subscriptionProps,\n (subscribeReply: Message) => {\n if (subscribeReply.successful) {\n this.subscriptions.set(channel.path, subscription);\n resolve(subscription);\n return;\n }\n\n if (shouldRehandshake(subscribeReply)) {\n this.handshakeState = IDLE;\n this.handshakePromise = undefined;\n }\n\n const errorMessage = subscribeReply.error ?? '';\n const error = new Fault({\n status: errorMessage.includes('403') ? FORBIDDEN : undefined,\n message: errorMessage,\n information: {\n code: 'COMETD_ERROR',\n ...subscribeReply,\n },\n });\n\n if (options.inert) {\n reject(error);\n return;\n }\n\n const retry = async () => {\n if (shouldRehandshake(subscribeReply)) {\n await this.handshake({ inert: true });\n }\n return this.add<D>(channel, update, { inert: true });\n };\n try {\n const result = errorManager.handle<SubscriptionHandle>(error, retry);\n resolve(result);\n } catch (e) {\n reject(e);\n }\n },\n );\n } catch (error: unknown) {\n const retryCount = options._retryCount ?? 0;\n if (isIllegalStateError(error) && retryCount < MAX_RETRIES) {\n this.handshakeState = IDLE;\n this.handshakePromise = undefined;\n this.handshake()\n .then(() => this.add<D>(channel, update, {\n ...options,\n _retryCount: retryCount + 1,\n }))\n .then(resolve)\n .catch(reject);\n return;\n }\n reject(error);\n }\n });\n }\n\n async publish<D = unknown>(\n channel: Channel<D>,\n content: D,\n options: {\n inert?: boolean;\n _retryCount?: number;\n } = {},\n ): Promise<Message> {\n await this.init();\n if (this.cometd.getStatus() !== CONNECTED) {\n await this.handshake();\n }\n const { session } = identification;\n const publishProps = {\n ext: session ? { [AUTH_TOKEN_KEY]: session.token } : undefined,\n };\n\n return new Promise((resolve, reject) => {\n try {\n this.cometd.publish(\n channel.path,\n content,\n publishProps,\n (publishReply: Message) => {\n if (publishReply.successful) {\n resolve(publishReply);\n return;\n }\n\n if (shouldRehandshake(publishReply)) {\n this.handshakeState = IDLE;\n this.handshakePromise = undefined;\n }\n\n const errorMessage = publishReply.error ?? '';\n const error = new Fault({\n status: errorMessage.includes('403') ? FORBIDDEN : undefined,\n message: errorMessage,\n information: {\n code: 'COMETD_ERROR',\n ...publishReply,\n },\n });\n\n if (options.inert) {\n reject(error);\n return;\n }\n\n const retry = async () => {\n if (shouldRehandshake(publishReply)) {\n await this.handshake({ inert: true });\n }\n return this.publish<D>(channel, content, { inert: true });\n };\n try {\n const result = errorManager.handle<Message>(error, retry);\n resolve(result);\n } catch (e) {\n reject(e);\n }\n },\n );\n } catch (error: unknown) {\n const retryCount = options._retryCount ?? 0;\n if (isIllegalStateError(error) && retryCount < MAX_RETRIES) {\n this.handshakeState = IDLE;\n this.handshakePromise = undefined;\n this.handshake()\n .then(() => this.publish<D>(channel, content, {\n ...options,\n _retryCount: retryCount + 1,\n }))\n .then(resolve)\n .catch(reject);\n return;\n }\n reject(error);\n }\n });\n }\n\n async remove(subscription: SubscriptionHandle) {\n await this.init();\n\n // Find the subscription by iterating through the map\n let channelPath: string | undefined;\n for (const [path, sub] of this.subscriptions.entries()) {\n if (sub === subscription) {\n channelPath = path;\n break;\n }\n }\n\n if (channelPath) {\n this.subscriptions.delete(channelPath);\n if (this.cometd.getStatus() === DISCONNECTED) return Promise.resolve();\n }\n\n return new Promise((resolve, reject) => {\n try {\n this.cometd.unsubscribe(subscription, (unsubscribeReply: Message) => {\n if (unsubscribeReply.successful) {\n resolve(unsubscribeReply);\n return;\n }\n\n const errorMessage = unsubscribeReply.error ?? '';\n\n if (isSessionInvalidationError(errorMessage)) {\n resolve(unsubscribeReply);\n return;\n }\n\n const error = new Fault({\n status: undefined,\n message: errorMessage,\n information: {\n code: 'COMETD_ERROR',\n ...unsubscribeReply,\n },\n });\n reject(error);\n });\n } catch (error: unknown) {\n if (isIllegalStateError(error)) {\n resolve(undefined);\n return;\n }\n reject(error);\n }\n });\n }\n\n async empty() {\n await this.init();\n this.cometd.clearSubscriptions();\n this.subscriptions.clear();\n }\n}\n\nconst cometdAdapter = new CometdAdapter();\nexport default cometdAdapter;\n","import type { RoutingOptions } from '../utils/router';\nimport type { Session } from '../utils/identification';\n\nimport { Router, identification } from '../utils';\nimport cometdAdapter from './cometd';\n\n\nexport interface UserCredentials {\n handle: string;\n password: string;\n groupKey?: string;\n}\n\nexport interface AppCredentials {\n secretKey: string;\n}\n\n\n/**\n * Logs out of current Epicenter session. Also disconnects from CometD and removes user presence.\n * Priorities:\n * 1. Delete local session (even if 2 and 3 fail)\n * 2. Delete remote session (even if 3 fails)\n * 3. Other cleanup (disconnect CometD, delete presence)\n * Cleanup operations require authentication, so await cleanup before delete.\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/verification`\n *\n * @example\n * import { authAdapter } from 'epicenter-libs';\n * await authAdapter.logout();\n *\n * @param [verificationOptionals] Optional arguments; pass network call options overrides here.\n * @param [presenceOptionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves when logout is complete\n */\nexport async function logout(\n verificationOptionals: RoutingOptions = {},\n presenceOptionals: RoutingOptions = verificationOptionals,\n): Promise<void> {\n const cleanup = [cometdAdapter.disconnect()];\n const groupKey = identification?.session?.groupKey;\n if (groupKey) {\n cleanup.push(\n new Router().delete(\n `/presence/group/${groupKey}`,\n presenceOptionals,\n ),\n );\n }\n await Promise.allSettled(cleanup);\n await new Router()\n .delete('/verification', verificationOptionals)\n .finally(() => (identification.session = undefined));\n}\n\n\n/**\n * Retrieves the current session from the server\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/verification`\n *\n * @example\n * import { authAdapter } from 'epicenter-libs';\n * const session = await authAdapter.getSession();\n *\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the session object\n */\nexport async function getSession(optionals: RoutingOptions = {}): Promise<Session> {\n const { body } = await new Router().get('/verification', optionals);\n identification.session = body;\n return body;\n}\n\n\n/**\n * Retrieves the session stored in memory\n *\n * @example\n * import { authAdapter } from 'epicenter-libs';\n * const session = authAdapter.getLocalSession();\n *\n * @returns the session object if it exists, undefined otherwise\n */\nexport function getLocalSession(): Session | undefined {\n return identification.session;\n}\n\n\n/**\n * Stores a session in memory\n *\n * @example\n * import { authAdapter } from 'epicenter-libs';\n * authAdapter.setLocalSession(session);\n *\n * @param session The session object to store\n * @returns the stored session object\n */\nexport function setLocalSession(session: Session): Session {\n return identification.session = session;\n}\n\n\n/**\n * Removes the session stored in memory and disconnects from CometD\n *\n * @example\n * import { authAdapter } from 'epicenter-libs';\n * await authAdapter.removeLocalSession();\n *\n * @returns promise that resolves when the session is removed and CometD is disconnected\n */\nexport async function removeLocalSession(): Promise<void> {\n identification.session = undefined;\n await cometdAdapter.disconnect();\n}\n\n\n/**\n * Logs in a user or app and stores the session\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/authentication`\n *\n * @example\n * import { authAdapter } from 'epicenter-libs';\n * // User login\n * const session = await authAdapter.login({\n * handle: 'user@example.com',\n * password: 'myPassword',\n * groupKey: '00000165ad4e6a3cd22b993340b963820239',\n * });\n * // App login\n * const session = await authAdapter.login({\n * secretKey: 'my-secret-key',\n * });\n *\n * @param credentials User or app credentials\n * @param credentials.handle User handle (email or username)\n * @param credentials.password User password\n * @param [credentials.groupKey] Group key for user login\n * @param credentials.secretKey Secret key for app login\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.objectType] Object type for authentication (defaults to 'user' or 'account' based on credentials)\n * @param [optionals.forcePathInclusion] Controls cookie path behavior: `true` forces project-specific path (even on custom domains), `false` forces root path (even for users/admins on Epicenter domain), `undefined` uses defaults (project-specific for users/admins on Epicenter domain, root for custom domains)\n * @returns promise that resolves to the session object\n */\nexport async function login(\n credentials: UserCredentials | AppCredentials,\n optionals: {\n objectType?: string;\n forcePathInclusion?: boolean;\n } & RoutingOptions = {},\n): Promise<Session> {\n const { objectType, forcePathInclusion, ...routingOptions } = optionals;\n let payload;\n if (Object.prototype.hasOwnProperty.call(credentials, 'handle')) {\n const { handle, password, groupKey } = credentials as UserCredentials;\n payload = { objectType: objectType ?? 'user', handle, password, groupKey: groupKey || undefined };\n }\n if (Object.prototype.hasOwnProperty.call(credentials, 'secretKey')) {\n const { secretKey } = credentials as AppCredentials;\n payload = { objectType: objectType ?? 'account', secretKey };\n }\n const session = await new Router()\n .post('/authentication', {\n inert: true,\n includeAuthorization: false,\n body: payload,\n ...routingOptions,\n }).then(({ body }) => body);\n\n await removeLocalSession();\n\n identification.setSessionWithOptions(session, forcePathInclusion);\n return session;\n}\n\n\n/**\n * Regenerates your Epicenter session with the appropriate context.\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/authentication`\n *\n * - For users: Updates session to the specified group context\n * - For admins: Updates session to the specified account/project context (uses platform's focus API)\n *\n * This is automatically called when switching between projects/groups if the session cookie\n * is scoped to a specific project path.\n *\n * Will fail if the user/admin does not already belong to the group/account.\n *\n * @example\n * import { authAdapter } from 'epicenter-libs';\n * // Changes the current user session to have a group context associated with the provided key\n * await authAdapter.regenerate('00000165ad4e6a3cd22b993340b963820239');\n * // Changes the current admin session to use the account context for the 'acme' account\n * await authAdapter.regenerate('acme', { objectType: 'admin' });\n *\n * @param groupOrAccount Group key or account name\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.objectType] The object type to regenerate for (defaults to 'user')\n * @param [optionals.forcePathInclusion] Controls cookie path behavior: `true` forces project-specific path (even on custom domains), `false` forces root path (even for users/admins on Epicenter domain), `undefined` uses defaults (project-specific for users/admins on Epicenter domain, root for custom domains)\n * @returns promise that resolves to the new session object\n */\nexport async function regenerate(\n groupOrAccount: string,\n optionals: {\n objectType?: string;\n forcePathInclusion?: boolean;\n } & RoutingOptions = {},\n): Promise<Session> {\n const {\n objectType = 'user',\n accountShortName,\n forcePathInclusion,\n ...routingOptions\n } = optionals;\n\n const session = await new Router()\n .patch('/authentication', {\n accountShortName: objectType === 'admin' ?\n groupOrAccount :\n accountShortName,\n body: {\n objectType,\n groupKey: objectType === 'user' ?\n groupOrAccount :\n undefined,\n },\n ...routingOptions,\n }).then(({ body }) => body);\n\n await removeLocalSession();\n identification.setSessionWithOptions(session, forcePathInclusion);\n return session;\n}\n\n\n/**\n * Authenticates using Single Sign-On (SSO)\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/sso/user`\n *\n * @example\n * import { authAdapter } from 'epicenter-libs';\n * const session = await authAdapter.sso();\n *\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the session object\n */\nexport async function sso(\n optionals: RoutingOptions = {},\n): Promise<Session> {\n const session = await new Router()\n .get('/registration/sso/user', optionals)\n .then(({ body }) => body);\n\n identification.session = session;\n return session;\n}\n\n\n/**\n * Retrieves the SAML link from the SSO configuration\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/sso/user/saml`\n *\n * @example\n * import { authAdapter } from 'epicenter-libs';\n * const samlLink = await authAdapter.getSAMLLink();\n *\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the SAML link\n */\nexport async function getSAMLLink(\n optionals: RoutingOptions = {},\n): Promise<string> {\n return await new Router()\n .get('/registration/sso/user/saml', optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Generates and returns an epicenter URL that will redirect to the SAML url\n *\n * @example\n * import { authAdapter } from 'epicenter-libs';\n * const samlURL = authAdapter.generateSAMLLINK();\n *\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns the generated SAML URL string\n */\nexport function generateSAMLLINK(\n optionals: RoutingOptions = {},\n): string {\n return new Router().getURL('/registration/sso/user/saml', optionals).toString();\n}\n\n\n/**\n * Sends an outcome to an external link specified in project config. For example, sending a grade back to a third party platform.\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/lti/{LTI_VERSION}/outcome`\n *\n * @example\n * import { authAdapter } from 'epicenter-libs';\n * await authAdapter.ssoOutcome('1.3', {\n * value: 95,\n * sourcedId: 'student-assignment-123',\n * outcomeServiceUrl: 'https://lms.example.com/outcome',\n * });\n *\n * @param ltiVersion The version of LTI to use (valid versions: 1.1, 1.2, 1.3)\n * @param outcomeInformation Outcome information to send\n * @param outcomeInformation.value The value to pass back to the outcomeServiceUrl (e.g., the grade a student received)\n * @param outcomeInformation.sourcedId The id of the current assignment/student as provided by the client using the SSO service\n * @param outcomeInformation.outcomeServiceUrl The url called for passing back the outcome\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the response object\n */\nexport async function ssoOutcome(\n ltiVersion: string,\n outcomeInformation: {\n value: number;\n sourcedId: string;\n outcomeServiceUrl: string;\n },\n optionals: RoutingOptions = {},\n): Promise<Record<string, unknown>> {\n const { ...routingOptions } = optionals;\n return await new Router()\n .post(`/lti/${ltiVersion}/outcome`, {\n body: outcomeInformation,\n ...routingOptions,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Sends a link to reset a user's password to their email\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/verification/password/user/{HANDLE}`\n *\n * @example\n * import { authAdapter } from 'epicenter-libs';\n * const subject = 'Please reset your password for the Acme simulation';\n * const redirectURL = 'https://forio.com/app/acme/simulations';\n * const handle = 'testUser@test.com';\n * await authAdapter.resetPassword(handle, { redirectURL, subject });\n *\n * @param handle Handle that user would use to login\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.redirectURL] URL to redirect to after password reset is completed (must be in the forio domain)\n * @param [optionals.subject] The subject of the email that will be sent\n * @returns promise that resolves when the reset email is sent\n */\nexport async function resetPassword(\n handle: string,\n optionals: {\n redirectURL?: string;\n subject?: string;\n } & RoutingOptions = {},\n): Promise<void> {\n const {\n redirectURL, subject,\n ...routingOptions\n } = optionals;\n\n return await new Router()\n .post(`/verification/password/user/${handle}`, {\n ...routingOptions,\n body: {\n redirectUrl: redirectURL,\n subject,\n },\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Verifies a token and retrieves the associated session\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/verification`\n *\n * @example\n * import { authAdapter } from 'epicenter-libs';\n * const session = await authAdapter.verify('my-auth-token');\n *\n * @param token Authorization token to verify\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the session object\n */\nexport async function verify(\n token: string,\n optionals: RoutingOptions = {},\n): Promise<Session> {\n return await new Router()\n .get('/verification', {\n authorization: `Bearer ${token}`,\n ...optionals,\n })\n .then(({ body }) => body);\n}\n","import type { RoutingOptions } from '../utils/router';\nimport type { GenericScope, Address } from '../utils/constants';\n\nimport fetch from 'cross-fetch';\nimport { Fault, Router, ROLE } from '../utils';\n\nexport interface AssetScope extends GenericScope {\n userKey?: string;\n}\n\nexport interface Asset {\n file: string;\n address: Address;\n scope: AssetScope;\n}\n\nexport interface AssetTicket {\n url: string;\n}\n\n\n/**\n * Creates a presigned URL for uploading a file to S3\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/asset`\n *\n * @example\n * import { assetAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const ticket = await assetAdapter.create('myfile.pdf', {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * });\n *\n * @param file File path/name for the asset\n * @param scope Scope associated with the asset\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [scope.userKey] User key to further scope the asset to a specific user\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.readLock] Role allowed to read; defaults to USER\n * @param [optionals.writeLock] Role allowed to write; defaults to USER\n * @param [optionals.ttlSeconds] Time to live in seconds for the asset\n * @param [optionals.tokenAccessSeconds] How long the presigned URL is valid for in seconds\n * @returns promise that resolves to an asset ticket containing the presigned upload URL\n */\nexport async function create(\n file: string,\n scope: AssetScope,\n optionals: {\n readLock?: keyof typeof ROLE;\n writeLock?: keyof typeof ROLE;\n ttlSeconds?: number;\n tokenAccessSeconds?: number;\n } & RoutingOptions = {},\n): Promise<AssetTicket> {\n const { scopeBoundary, scopeKey, userKey } = scope;\n const {\n readLock,\n writeLock,\n ttlSeconds,\n tokenAccessSeconds,\n ...routingOptions\n } = optionals;\n return await new Router()\n .withSearchParams({ tokenAccessSeconds })\n .post('/asset', {\n body: {\n file,\n scope: {\n scopeBoundary,\n scopeKey,\n userKey,\n },\n permit: {\n readLock: readLock ?? ROLE.USER,\n writeLock: writeLock ?? ROLE.USER,\n },\n ttlSeconds,\n },\n ...routingOptions,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Updates an existing asset and returns a presigned URL for uploading the new file to S3\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/asset`\n *\n * @example\n * import { assetAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const ticket = await assetAdapter.update('myfile.pdf', {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * });\n *\n * @param file File path/name for the asset\n * @param scope Scope associated with the asset\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [scope.userKey] User key to further scope the asset to a specific user\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.readLock] Role allowed to read; defaults to USER\n * @param [optionals.writeLock] Role allowed to write; defaults to USER\n * @param [optionals.ttlSeconds] Time to live in seconds for the asset\n * @param [optionals.tokenAccessSeconds] How long the presigned URL is valid for in seconds\n * @returns promise that resolves to an asset ticket containing the presigned upload URL\n */\nexport async function update(\n file: string,\n scope: AssetScope,\n optionals: {\n readLock?: keyof typeof ROLE;\n writeLock?: keyof typeof ROLE;\n ttlSeconds?: number;\n tokenAccessSeconds?: number;\n } & RoutingOptions = {},\n): Promise<AssetTicket> {\n const { scopeBoundary, scopeKey, userKey } = scope;\n const {\n readLock,\n writeLock,\n ttlSeconds,\n tokenAccessSeconds,\n ...routingOptions\n } = optionals;\n return await new Router()\n .withSearchParams({ tokenAccessSeconds })\n .patch('/asset', {\n body: {\n file,\n scope: {\n scopeBoundary,\n scopeKey,\n userKey,\n },\n permit: {\n readLock: readLock ?? ROLE.USER,\n writeLock: writeLock ?? ROLE.USER,\n },\n ttlSeconds,\n },\n ...routingOptions,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Deletes an asset by asset key\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/asset/{ASSET_KEY}`\n *\n * @example\n * import { assetAdapter } from 'epicenter-libs';\n * await assetAdapter.remove('0000017dd3bf540e5ada5b1e058f08f20461');\n *\n * @param assetKey The unique key for the asset\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves when the asset is deleted\n */\nexport async function remove(\n assetKey: string,\n optionals: RoutingOptions = {},\n): Promise<void> {\n return await new Router()\n .delete(`/asset/${assetKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Deletes all assets within a given scope\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/asset/in/{SCOPE_BOUNDARY}/{SCOPE_KEY}` or DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/asset/in/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{USER_KEY}`\n *\n * @example\n * import { assetAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * await assetAdapter.removeFromScope({\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * });\n *\n * @param scope Scope associated with the assets to delete\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [scope.userKey] User key to further scope the deletion to a specific user\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves when all assets in the scope are deleted\n */\nexport async function removeFromScope(\n scope: AssetScope,\n optionals: RoutingOptions = {},\n): Promise<void> {\n const { scopeBoundary, scopeKey, userKey } = scope;\n const uriComponent = userKey ? `/${userKey}` : '';\n return await new Router()\n .delete(`/asset/in/${scopeBoundary}/${scopeKey}${uriComponent}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Retrieves asset metadata by asset key\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/asset/{ASSET_KEY}`\n *\n * @example\n * import { assetAdapter } from 'epicenter-libs';\n * const asset = await assetAdapter.get('0000017dd3bf540e5ada5b1e058f08f20461');\n *\n * @param assetKey The unique key for the asset\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the asset metadata\n */\nexport async function get(\n assetKey: string,\n optionals: RoutingOptions = {},\n): Promise<Asset> {\n const { server, accountShortName, projectShortName } = optionals;\n return await new Router()\n .withServer(server)\n .withAccountShortName(accountShortName)\n .withProjectShortName(projectShortName)\n .get(`/asset/${assetKey}`)\n .then(({ body }) => body);\n}\n\n\n/**\n * Lists all assets within a given scope, optionally filtered by file pattern\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/asset/in/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{FILTER}` or GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/asset/in/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{USER_KEY}/{FILTER}`\n *\n * @example\n * import { assetAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * // List all assets in the scope\n * const assets = await assetAdapter.list({\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * });\n * // List only PDF files\n * const pdfs = await assetAdapter.list({\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * }, { filter: '*.pdf' });\n *\n * @param scope Scope associated with the assets\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [scope.userKey] User key to further scope the list to a specific user\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.filter] File pattern to filter assets (e.g., '*.pdf' for PDF files); defaults to '*' (all files)\n * @returns promise that resolves to a list of assets\n */\nexport async function list(\n scope: AssetScope,\n optionals: {\n filter?: string;\n } & RoutingOptions = {},\n): Promise<Asset[]> {\n const { scopeBoundary, scopeKey, userKey } = scope;\n const {\n filter,\n ...routingOptions\n } = optionals;\n const uriComponent = userKey ? `/${userKey}` : '';\n return await new Router()\n .get(`/asset/in/${scopeBoundary}/${scopeKey}${uriComponent}/${filter ?? '*'}`, routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Generates a presigned URL for accessing an asset\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/asset/url/{ASSET_KEY}`\n *\n * @example\n * import { assetAdapter } from 'epicenter-libs';\n * const url = await assetAdapter.getURL('0000017dd3bf540e5ada5b1e058f08f20461');\n * // Use the url to access the asset\n *\n * @param assetKey The unique key for the asset\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.tokenAccessSeconds] How long the presigned URL is valid for in seconds\n * @returns promise that resolves to the presigned URL\n */\nexport async function getURL(\n assetKey: string,\n optionals: {\n tokenAccessSeconds?: number;\n } & RoutingOptions = {},\n): Promise<string> {\n const { tokenAccessSeconds, ...routingOptions } = optionals;\n return await new Router()\n .withSearchParams({ tokenAccessSeconds })\n .get(`/asset/url/${assetKey}`, routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Generates a presigned URL for accessing an asset by scope and file name\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/asset/url/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{FILE}` or GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/asset/url/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{USER_KEY}/{FILE}`\n *\n * @example\n * import { assetAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const url = await assetAdapter.getURLWithScope('myfile.pdf', {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * });\n *\n * @param file File path/name for the asset\n * @param scope Scope associated with the asset\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [scope.userKey] User key to further scope the asset to a specific user\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.tokenAccessSeconds] How long the presigned URL is valid for in seconds\n * @returns promise that resolves to the presigned URL\n */\nexport async function getURLWithScope(\n file: string,\n scope: AssetScope,\n optionals: {\n tokenAccessSeconds?: number;\n } & RoutingOptions = {},\n): Promise<string> {\n const { scopeBoundary, scopeKey, userKey } = scope;\n const { tokenAccessSeconds, ...routingOptions } = optionals;\n const uriComponent = userKey ? `/${userKey}` : '';\n return await new Router()\n .withSearchParams({ tokenAccessSeconds })\n .get(`/asset/url/with/${scopeBoundary}/${scopeKey}${uriComponent}/${file}`, routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Downloads an asset by asset key\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/asset/download/{ASSET_KEY}`\n *\n * @example\n * import { assetAdapter } from 'epicenter-libs';\n * await assetAdapter.download('0000017dd3bf540e5ada5b1e058f08f20461');\n *\n * @param assetKey The unique key for the asset\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.tokenAccessSeconds] How long the presigned URL is valid for in seconds\n * @returns promise that resolves when the download is complete\n */\nexport async function download(\n assetKey: string,\n optionals: {\n tokenAccessSeconds?: number;\n } & RoutingOptions = {},\n): Promise<void> {\n const { tokenAccessSeconds, ...routingOptions } = optionals;\n return await new Router()\n .withSearchParams({ tokenAccessSeconds })\n .get(`/asset/download/${assetKey}`, routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Downloads an asset by scope and file name\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/asset/download/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{FILE}` or GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/asset/download/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{USER_KEY}/{FILE}`\n *\n * @example\n * import { assetAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * await assetAdapter.downloadWithScope('myfile.pdf', {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * });\n *\n * @param file File path/name for the asset\n * @param scope Scope associated with the asset\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [scope.userKey] User key to further scope the asset to a specific user\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.tokenAccessSeconds] How long the presigned URL is valid for in seconds\n * @returns promise that resolves when the download is complete\n */\nexport async function downloadWithScope(\n file: string,\n scope: AssetScope,\n optionals: {\n tokenAccessSeconds?: number;\n } & RoutingOptions = {},\n): Promise<void> {\n const { scopeBoundary, scopeKey, userKey } = scope;\n const { tokenAccessSeconds, ...routingOptions } = optionals;\n const uriComponent = userKey ? `/${userKey}` : '';\n return await new Router()\n .withSearchParams({ tokenAccessSeconds })\n .get(`/asset/download/with/${scopeBoundary}/${scopeKey}${uriComponent}/${file}`, routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Convenience function to store a file directly to S3. This function obtains a presigned URL from the Epicenter server and uploads the file to S3. If the asset already exists and `overwrite` is true, it will update the existing asset.\n *\n * @example\n * import { assetAdapter, SCOPE_BOUNDARY, ROLE } from 'epicenter-libs';\n * const file = new File(['content'], 'myfile.pdf');\n * await assetAdapter.store(file, {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * }, {\n * overwrite: true,\n * readLock: ROLE.USER,\n * });\n *\n * @param file File object to store\n * @param scope Scope associated with the asset\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [scope.userKey] User key to further scope the asset to a specific user\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.readLock] Role allowed to read; defaults to USER\n * @param [optionals.writeLock] Role allowed to write; defaults to USER\n * @param [optionals.ttlSeconds] Time to live in seconds for the asset\n * @param [optionals.overwrite] If true, will update the asset if it already exists; if false, will throw an error if the asset exists\n * @param [optionals.fileName] Optional file name to use instead of the file's name property\n * @param [optionals.tokenAccessSeconds] How long the presigned URL is valid for in seconds\n * @returns promise that resolves when the file is stored\n */\nconst CONFLICT = 409;\nexport async function store(\n file: File,\n scope: AssetScope,\n optionals: {\n readLock?: keyof typeof ROLE;\n writeLock?: keyof typeof ROLE;\n ttlSeconds?: number;\n overwrite?: boolean;\n fileName?: string;\n tokenAccessSeconds?: number;\n } & RoutingOptions = {},\n): Promise<void> {\n const { overwrite, fileName, ...remaining } = optionals;\n const name = fileName ?? file.name;\n let presignedUrl = '';\n try {\n const response = await create(name, scope, { inert: true, ...remaining });\n presignedUrl = response.url;\n } catch (error) {\n if (error instanceof Fault) {\n const shouldUpdate = error.status === CONFLICT && overwrite;\n if (!shouldUpdate) throw error;\n const response = await update(name, scope, remaining);\n presignedUrl = response.url;\n } else {\n throw error;\n }\n }\n await fetch(presignedUrl, { method: 'PUT', body: file });\n return;\n}\n","import type { RoutingOptions } from '../utils/router';\n\nimport Router from '../utils/router';\n\nexport type Encoding = 'HEX' | 'BASE_64';\n\nexport interface Attachment {\n encoding: Encoding;\n data: string;\n name: string;\n contentType: string;\n}\n\n\n/**\n * Sends an email to an individual user; requires following authentication levels:\n * - /email/user/{groupKey}/{userKey} - PARTICIPANT\n * - /email/user/{groupKey}/{userKey}/from/{from} - REVIEWER\n * - /email/user/{groupKey}/{userKey}/from/{from}/{replyTo} - REVIEWER\n * - /email/user/{groupKey}/{userKey}/as/{fromUserKey} - REVIEWER\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/email/user/{GROUP_KEY}/{USER_KEY}` or POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/email/user/{GROUP_KEY}/{USER_KEY}/from/{FROM}` or POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/email/user/{GROUP_KEY}/{USER_KEY}/from/{FROM}/{REPLY_TO}` or POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/email/user/{GROUP_KEY}/{USER_KEY}/as/{FROM_USER_KEY}`\n *\n * @example\n * import { emailAdapter, authAdapter } from 'epicenter-libs';\n * // Sends an email with a smiley face png attachment\n * const groupKey = authAdapter.getLocalSession().groupKey;\n * const subject = 'check out this drawing!';\n * const emailBody = 'I hope you enjoy this smiley face!';\n * const attachments = [{\n * encoding: 'BASE_64',\n * name: 'testPic',\n * contentType: 'image/png',\n * data: 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAIxJREFUWEdjZBhgwDjA9jMQ5YAvzmb/efaewquWGDXYPDvqgNEQGA2B0RAYGiFAy+KaqBAYdcDICgFQtQryMaHql1qhgjURklu3IzuKWDNwOoCSUCAlFHFmQ2J9gB4VpFgO0kvVZhaplhPlAJgPCSVKciwn6ACY5TDD8aV8Qg7EpXe0KB4NgdEQGA0BAF7VgCFTeobfAAAAAElFTkSuQmCC',\n * }];\n *\n * // Sends an email to the address associated with the provided user key, sender will be seen as \"System\"\n * await emailAdapter.sendEmail(groupKey, '000001796733eef0842f4d6d960997018a3b', subject, emailBody, { attachments });\n * // Sends an email to the address associated with the provided user key, sender will be seen as the address provided by the \"from\" field\n * await emailAdapter.sendEmail(groupKey, '000001796733eef0842f4d6d960997018a3b', subject, emailBody, { attachments, from: 'sender@test.com' });\n * // Sends an email to the address defined at \"replyTo\", sender will be seen as the address provided by the \"from\" field\n * await emailAdapter.sendEmail(groupKey, '000001796733eef0842f4d6d960997018a3b', subject, emailBody, { attachments, from: 'sender@test.com', replyTo: 'receiver@test.com' });\n * // Sends an email to the address associated with the provided user key, sender will be seen as the user associated with the \"fromUserKey\"\n * await emailAdapter.sendEmail(groupKey, '000001796733eef0842f4d6d960997018a3b', subject, emailBody, { attachments, fromUserKey: '000001796733eef0842f4d6d960997018a33' });\n *\n * @param groupKey The groupKey in which the email target user exists\n * @param userKey The unique userKey for the email target user\n * @param subject The subject line for the email.\n * @param emailBody The body for the email\n * @param [optionals] Optional parameters\n * @param [optionals.familyNameFirst] Specifies whether email target's family name will come before their given name. Defaults to false.\n * @param [optionals.html] Whether to treat the body as HTML (true) or as plain text (false). Defaults to false.\n * @param [optionals.from] The email address from which the message will appear to have been sent from. Will be overridden by fromUserKey.\n * @param [optionals.replyTo] The email address that will be replied to by the recipient. Must be used in conjunction with optionals.from.\n * @param [optionals.fromUserKey] The userKey from which the email will appear to have been sent. The default response address will also be this email.\n * @param [optionals.attachments] An array of (binary) objects to include as attachments. All four properties must be included.\n * @param [optionals.attachments[].encoding] A string specifying the encoding method. See ENCODING for possible values.\n * @param [optionals.attachments[].data] A string containing the data for the attachment.\n * @param [optionals.attachments[].name] A string containing the name of the attachment.\n * @param [optionals.attachments[].contentType] A string specifying the attachment MIME Type.\n * @returns undefined indicating success\n */\nexport async function sendEmail(\n groupKey: string,\n userKey: string,\n subject: string,\n emailBody: string,\n optionals: {\n familyNameFirst?: string;\n html?: boolean;\n from?: string;\n replyTo?: string;\n fromUserKey?: string;\n attachments?: Attachment[];\n } & RoutingOptions = {},\n): Promise<void> {\n const {\n accountShortName,\n projectShortName,\n server,\n familyNameFirst,\n html,\n from,\n replyTo,\n fromUserKey,\n attachments,\n ...routingOptions\n } = optionals;\n\n let fromString = '';\n if (fromUserKey) {\n fromString += `/as/${fromUserKey}`;\n } else if (from) {\n fromString += `/from/${from}`;\n if (replyTo) {\n fromString += `/${replyTo}`;\n }\n }\n\n return await new Router()\n .withServer(server)\n .withAccountShortName(accountShortName)\n .withProjectShortName(projectShortName)\n .post(`/email/user/${groupKey}/${userKey}${fromString}`, {\n body: {\n subject,\n body: emailBody,\n familyNameFirst,\n html,\n attachments,\n },\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Sends an email to an individual admin (someone with epicenter account); Requires support level authentication\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/email/admin/{ADMIN_KEY}`\n *\n * @example\n * import { emailAdapter } from 'epicenter-libs';\n * await emailAdapter.sendEmailToAdmin('adminKey123', 'Subject Line', 'Email body content');\n *\n * @param adminKey The unique adminKey for the email target\n * @param subject The subject line for the email.\n * @param emailBody The body for the email\n * @param [optionals] Optional parameters\n * @param [optionals.familyNameFirst] Specifies whether email target's family name will come before their given name. Defaults to false.\n * @param [optionals.html] Whether to treat the body as HTML (true) or as plain text (false). Defaults to false.\n * @param [optionals.attachments] An array of (binary) objects to include as attachments. All four properties must be included.\n * @param [optionals.attachments[].encoding] A string specifying the encoding method. See ENCODING for possible values.\n * @param [optionals.attachments[].data] A string containing the data for the attachment.\n * @param [optionals.attachments[].name] A string containing the name of the attachment.\n * @param [optionals.attachments[].contentType] A string specifying the attachment MIME Type.\n * @returns undefined indicating success\n */\nexport async function sendEmailToAdmin(\n adminKey: string,\n subject: string,\n emailBody: string,\n optionals: {\n familyNameFirst?: string;\n html?: boolean;\n attachments?: Attachment[];\n } & RoutingOptions = {},\n): Promise<void> {\n const {\n accountShortName,\n projectShortName,\n server,\n familyNameFirst,\n html,\n attachments,\n ...routingOptions\n } = optionals;\n\n return await new Router()\n .withServer(server)\n .withAccountShortName(accountShortName)\n .withProjectShortName(projectShortName)\n .post(`/email/admin/${adminKey}`, {\n body: {\n subject,\n body: emailBody,\n familyNameFirst,\n html,\n attachments,\n },\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Sends an email to Epicenter support; Requires participant authentication\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/email/to/support`\n *\n * @example\n * import { emailAdapter } from 'epicenter-libs';\n * await emailAdapter.sendEmailToSupport('Help Request', 'I need assistance with my project');\n *\n * @param subject The subject line for the email.\n * @param emailBody The body for the email\n * @param [optionals] Optional parameters\n * @param [optionals.supportType] A string indicating the type of support request\n * @param [optionals.familyNameFirst] Specifies whether email target's family name will come before their given name. Defaults to false.\n * @param [optionals.html] Whether to treat the body as HTML (true) or as plain text (false). Defaults to false.\n * @param [optionals.attachments] An array of (binary) objects to include as attachments. All four properties must be included.\n * @param [optionals.attachments[].encoding] A string specifying the encoding method. See ENCODING for possible values.\n * @param [optionals.attachments[].data] A string containing the data for the attachment.\n * @param [optionals.attachments[].name] A string containing the name of the attachment.\n * @param [optionals.attachments[].contentType] A string specifying the attachment MIME Type.\n * @returns undefined indicating success\n */\nexport async function sendEmailToSupport(\n subject: string,\n emailBody: string,\n optionals: {\n supportType?: string;\n familyNameFirst?: string;\n html?: boolean;\n attachments?: Attachment[];\n } & RoutingOptions = {},\n): Promise<void> {\n const {\n accountShortName,\n projectShortName,\n server,\n supportType,\n familyNameFirst,\n html,\n attachments,\n ...routingOptions\n } = optionals;\n\n return await new Router()\n .withServer(server)\n .withAccountShortName(accountShortName)\n .withProjectShortName(projectShortName)\n .withSearchParams({ supportType })\n .post('/email/to/support', {\n body: {\n subject,\n body: emailBody,\n familyNameFirst,\n html,\n attachments,\n },\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n","import type { UserSession } from '../utils/identification';\nimport type { GenericSearchOptions } from '../utils/constants';\nimport type { RoutingOptions, Page } from '../utils/router';\n\nimport { Router, identification, parseFilterInput } from '../utils';\n\nexport interface EpisodeReadOutView {\n name: string;\n episodeKey: string;\n created: string;\n lastUpdated: string;\n runLimit: number;\n draft: boolean;\n category: string;\n}\n\n\n/**\n * Create an episode.\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/episode/{GROUP_NAME}`\n *\n * @example\n * import { episodeAdapter } from 'epicenter-libs';\n * const episode = await episodeAdapter.create('myEpisode', 'myGroupName', {\n * runLimit: 20,\n * draft: true,\n * });\n *\n * @param name Episode name\n * @param groupName Group to make the episode under\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.draft] Flag to indicate the episode is a draft (intended when used for settings scoping)\n * @param [optionals.runLimit] Optional argument to define the number of runs that can be made using this episode as the scope\n * @param [optionals.category] Optional argument to allow for establishing episode hierarchies\n * @returns promise that resolves to the newly created episode\n */\nexport async function create(\n name: string,\n groupName: string,\n optionals: {\n draft?: boolean;\n runLimit?: number;\n category?: string;\n } & RoutingOptions = {},\n): Promise<EpisodeReadOutView> {\n const {\n draft, runLimit, category,\n ...routingOptions\n } = optionals;\n return await new Router()\n .post(`/episode/${groupName}`, {\n body: { name, draft, runLimit, category },\n ...routingOptions,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Gets a specific episode.\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/episode/{EPISODE_KEY}`\n *\n * @example\n * import { episodeAdapter } from 'epicenter-libs';\n * const episode = await episodeAdapter.get('000001796733eef0842f4d6d960997018a37');\n *\n * @param episodeKey The episode key\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to an episode\n */\nexport async function get(\n episodeKey: string,\n optionals: RoutingOptions = {},\n): Promise<EpisodeReadOutView> {\n return await new Router()\n .get(`/episode/${episodeKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Gets episodes.\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/episode/search`\n *\n * @example\n * import { episodeAdapter } from 'epicenter-libs';\n * const filter = [\n * 'name|=one|two', // searches only for episodes named 'one' or 'two'\n * 'draft=false', // searches only for episodes that aren't drafts\n * 'created>=2022-01-03T20:30:53.054Z', // looks for any episodes created after Jan 3rd 2022\n * 'account.shortName=acme', // specifies the account, intended for admin use\n * 'project.shortName=simulations', // specifies the project, intended for admin use\n * 'group.name=my-group-name', // specifies a group name, intended for admin use\n * 'group.groupKey=0000017dd3bf540e5ada5b1e058f08f20461', // specifies a group key, intended for admin use\n * ];\n * const episodes = await episodeAdapter.query({\n * filter,\n * sort: ['+episode.created'], // sort all findings by the 'created' field (ascending)\n * first: 3, // page should start with the 4th item found (will default to 0)\n * max: 10, // page should only include the first 10 items\n * });\n *\n * @param searchOptions Search options for the query\n * @param [searchOptions.filter] Filters for searching\n * @param [searchOptions.sort] Sorting criteria\n * @param [searchOptions.first] The starting index of the page returned\n * @param [searchOptions.max] The number of entries per page\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a page of episodes\n */\nexport async function query(\n searchOptions: GenericSearchOptions,\n optionals: RoutingOptions = {},\n): Promise<Page<EpisodeReadOutView>> {\n const { filter, sort = [], first = 0, max } = searchOptions;\n\n return await new Router()\n .withSearchParams({\n filter: parseFilterInput(filter),\n sort: sort.join(';') || undefined,\n first, max,\n })\n .get('/episode/search', {\n paginated: true,\n ...optionals,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Gets episodes based on a group key\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/episode/in/{GROUP_KEY}`\n *\n * @example\n * import { episodeAdapter } from 'epicenter-libs';\n * const episodes = await episodeAdapter.forGroup('0000017dd3bf540e5ada5b1e058f08f20461');\n *\n * @param groupKey The group key\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise resolving to a list of episodes\n */\nexport async function forGroup(\n groupKey: string,\n optionals: RoutingOptions = {},\n): Promise<EpisodeReadOutView[]> {\n return await new Router()\n .get(`/episode/in/${groupKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Gets episode based on group name and episode name\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/episode/with/{GROUP_NAME}/{EPISODE_NAME}`\n *\n * @example\n * import { episodeAdapter } from 'epicenter-libs';\n * const episode = await episodeAdapter.withName('myEpisodeName');\n *\n * @param name The episode name\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.groupName] Name of the group, if omitted will use the group name associated with the current session\n * @returns promise that resolves to an episode\n */\nexport async function withName(\n name: string,\n optionals: { groupName?: string } & RoutingOptions = {},\n): Promise<EpisodeReadOutView> {\n const {\n groupName,\n ...routingOptions\n } = optionals;\n\n const session = identification.session as UserSession;\n return await new Router()\n .get(`/episode/with/${groupName ?? session?.groupName}/${name}`, routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Deletes an episode\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/episode/{EPISODE_KEY}`\n *\n * @example\n * import { episodeAdapter } from 'epicenter-libs';\n * await episodeAdapter.remove('000001796733eef0842f4d6d960997018a3b');\n *\n * @param episodeKey The episode key\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to undefined if successful\n */\nexport async function remove(\n episodeKey: string,\n optionals: RoutingOptions = {},\n): Promise<void> {\n return await new Router()\n .delete(`/episode/${episodeKey}`, optionals)\n .then(({ body }) => body);\n}\n","import type { UserSession, Session } from '../utils/identification';\nimport type { RoutingOptions, Page } from '../utils/router';\nimport type { GenericSearchOptions } from '../utils/constants';\nimport type { PseudonymReadOutView } from './user';\n\nimport { Router, EpicenterError, identification, ROLE, parseFilterInput } from '../utils';\n\nexport type Augment = 'MEMBERS' | 'QUANTIZED';\nexport type SalesChannel = 'TEAM' | 'TEST' | 'FORIO' | 'HBP_HIGHER_ED' | 'HBP_CL';\n\nexport interface Status {\n code?: string;\n message?: string;\n}\n\nexport interface StripePaymentCreateInView {\n description: string;\n token: string;\n objectType: 'stripe';\n}\n\nexport interface Pricing {\n amount?: number;\n}\n\nexport interface FlightRecorderReadOutView {\n enabled?: boolean;\n start?: number;\n stop?: number;\n}\n\nexport interface FlightRecorderCreateInView {\n enabled: boolean;\n stop: number;\n start?: number;\n}\n\nexport interface FlightRecorderUpdateInView {\n enabled?: boolean;\n start?: number;\n stop?: number;\n}\n\nexport interface GroupReadOutView {\n groupKey: string;\n name: string;\n members?: GroupPermissionReadOutView[];\n creator?: string;\n created?: string;\n lastUpdated?: string;\n tombstone?: string;\n capacity?: number;\n runLimit?: number;\n approximateMemberCount?: number;\n startDate?: string;\n expirationDate?: string;\n terminationDate?: string;\n allowSelfRegistration?: boolean;\n allowMembershipChanges?: boolean;\n allowChannel?: boolean;\n demonstration?: boolean;\n perpetual?: boolean;\n reference?: string;\n organization?: string;\n event?: string;\n salesChannel?: SalesChannel;\n status?: Status;\n pricing?: Pricing;\n flightRecorder?: FlightRecorderReadOutView;\n}\n\nexport interface GroupPermissionReadOutView {\n objectType: 'group';\n role?: string;\n available?: boolean;\n user: PseudonymReadOutView;\n}\n\nexport interface GroupPermissionCreateInView {\n userKey: string;\n role: string;\n available?: boolean;\n payment?: StripePaymentCreateInView;\n}\n\ntype UserInput = string | GroupPermissionCreateInView;\n\n// Aliases for backward compatibility\nexport type Group = GroupReadOutView;\nexport type Member = GroupPermissionReadOutView;\n\nexport interface SelfRegistrationResult {\n redirectUrl: string;\n whoAmI: Session;\n}\n\n\n/**\n * Provides information on a particular Epicenter group.\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/{GROUP_KEY}` or GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/member/{GROUP_KEY}` or GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/quantized/{GROUP_KEY}`\n *\n * @example\n * import { authAdapter, groupAdapter } from 'epicenter-libs';\n * const session = authAdapter.getLocalSession();\n * // include members of the group in the response\n * const group = await groupAdapter.get({ groupKey: session.groupKey, augment: 'MEMBERS' });\n * // include metrics relating to the group in the response\n * const group = await groupAdapter.get({ groupKey: session.groupKey, augment: 'QUANTIZED' });\n *\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.augment] Specifies which additional information you'd like returned with the group\n * @param [optionals.groupKey] Group key; if omitted will attempt to use the group associated with the current session\n * @returns promise that resolves to a group\n */\nexport async function get(\n optionals: {\n augment?: Augment;\n groupKey?: string;\n } & RoutingOptions = {},\n): Promise<GroupReadOutView> {\n const {\n groupKey,\n augment,\n ...routingOptions\n } = optionals;\n let uriComponent = '';\n if (augment === 'MEMBERS') uriComponent = '/member';\n if (augment === 'QUANTIZED') uriComponent = '/quantized';\n const session = identification.session as UserSession;\n\n return await new Router()\n .get(`/group${uriComponent}/${groupKey ?? session?.groupKey}`, routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Deletes the group; available only to Epicenter admins\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/{GROUP_KEY}`\n *\n * @example\n * import { groupAdapter } from 'epicenter-libs';\n * await groupAdapter.destroy('0000017dd3bf540e5ada5b1e058f08f20461');\n *\n * @param groupKey Key associated with group\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to undefined if successful\n */\nexport async function destroy(\n groupKey: string,\n optionals: RoutingOptions = {},\n): Promise<void> {\n return await new Router()\n .delete(`/group/${groupKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Provides information for all groups in the project\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group`\n *\n * @example\n * import { groupAdapter } from 'epicenter-libs';\n * const groups = await groupAdapter.gather();\n *\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.includeExpired] Indicates whether to include expired groups in the query\n * @returns promise that resolves to a list of groups\n */\nexport async function gather(\n optionals: { includeExpired?: boolean } & RoutingOptions = {},\n): Promise<GroupReadOutView[]> {\n const {\n includeExpired,\n ...routingOptions\n } = optionals;\n\n return await new Router()\n .withSearchParams({ includeExpired })\n .get('/group', routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Updates fields for a particular group; available only to Epicenter admins\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/{GROUP_KEY}`\n *\n * @example\n * import { groupAdapter } from 'epicenter-libs';\n * await groupAdapter.update('0000017dd3bf540e5ada5b1e058f08f20461', { event: 'Orientation Day' });\n *\n * @param groupKey Key associated with group\n * @param update Attributes you wish to update\n * @param [update.runLimit] Defines the upper limit of runs allowed in the group\n * @param [update.organization] Name of the organization owning the group\n * @param [update.allowSelfRegistration] Whether users can register to join the group without being invited\n * @param [update.flightRecorder] Diagnostic tool for logging HTTP requests for the server\n * @param [update.flightRecorder.start] Start time (epoch time)\n * @param [update.flightRecorder.stop] End time (epoch time)\n * @param [update.flightRecorder.enabled] Enabled flag for the flight recorder\n * @param [update.event] Name of the event the group is playing for\n * @param [update.allowMembershipChanges] Locks the group so members cannot be added and member permissions cannot be changed\n * @param [update.pricing] Group pricing information\n * @param [update.pricing.amount] Amount (in cents) for user signup\n * @param [update.startDate] Start date for group event\n * @param [update.expirationDate] Date the group expires\n * @param [update.capacity] Defines the upper limit on the number of users allowed in the group\n * @param [update.allowChannel] Opt into push notifications for this resource; applicable to projects with phylogeny >= SILENT\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the updated group\n */\nexport async function update(\n groupKey: string,\n update: {\n tombstone?: string;\n capacity?: number;\n runLimit?: number;\n perpetual?: boolean;\n salesChannel?: SalesChannel;\n reference?: string;\n organization?: string;\n event?: string;\n allowSelfRegistration?: boolean;\n allowMembershipChanges?: boolean;\n allowChannel?: boolean;\n demonstration?: boolean;\n startDate?: string;\n expirationDate?: string;\n terminationDate?: string;\n status?: Status;\n pricing?: Pricing;\n flightRecorder?: FlightRecorderUpdateInView;\n },\n optionals: RoutingOptions = {},\n): Promise<GroupReadOutView> {\n const {\n runLimit,\n organization,\n allowSelfRegistration,\n flightRecorder,\n event,\n allowMembershipChanges,\n pricing,\n startDate,\n expirationDate,\n capacity,\n allowChannel,\n } = update;\n\n return await new Router()\n .patch(`/group/${groupKey}`, {\n body: {\n runLimit,\n organization,\n allowSelfRegistration,\n flightRecorder,\n event,\n allowMembershipChanges,\n pricing,\n startDate,\n expirationDate,\n capacity,\n allowChannel,\n },\n ...optionals,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Creates a new group; available only to Epicenter admins\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group`\n *\n * @example\n * import { groupAdapter } from 'epicenter-libs';\n * const group = await groupAdapter.create({\n * runLimit: 10,\n * name: 'my-group-name',\n * });\n *\n * @param group Group object\n * @param group.name Group name (required)\n * @param [group.runLimit] Defines the upper limit on the number of runs allowed in the group\n * @param [group.organization] Name of the organization owning the group\n * @param [group.allowSelfRegistration] Whether users can register to join the group without being invited\n * @param [group.flightRecorder] Diagnostic tool for logging HTTP requests for the server\n * @param [group.flightRecorder.start] Start time (epoch time)\n * @param [group.flightRecorder.stop] End time (epoch time)\n * @param [group.flightRecorder.enabled] Enabled flag for the flight recorder\n * @param [group.event] Name of the event the group is playing for\n * @param [group.allowMembershipChanges] Locks the group so members cannot be added and member permissions cannot be changed\n * @param [group.pricing] Group pricing information\n * @param [group.pricing.amount] Amount (in cents) for user signup\n * @param [group.startDate] Start date for group event\n * @param [group.expirationDate] Date the group expires\n * @param [group.capacity] Defines the upper limit on the number of users allowed in the group\n * @param [group.allowChannel] Opt into push notifications for this resource; applicable to projects with phylogeny >= SILENT\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the newly created group\n */\nexport async function create(\n group: {\n name: string;\n capacity?: number;\n runLimit?: number;\n allowSelfRegistration?: boolean;\n allowMembershipChanges?: boolean;\n allowChannel?: boolean;\n perpetual?: boolean;\n demonstration?: boolean;\n startDate?: string;\n expirationDate?: string;\n terminationDate?: string;\n reference?: string;\n organization?: string;\n event?: string;\n salesChannel?: SalesChannel;\n status?: Status;\n pricing?: Pricing;\n flightRecorder?: FlightRecorderCreateInView;\n },\n optionals: RoutingOptions = {},\n): Promise<GroupReadOutView> {\n const {\n name,\n runLimit,\n organization,\n allowSelfRegistration,\n flightRecorder,\n event,\n allowMembershipChanges,\n pricing,\n startDate,\n expirationDate,\n capacity,\n allowChannel,\n } = group;\n if (!name) throw new EpicenterError('Cannot create a group with no name');\n return await new Router()\n .post('/group', {\n body: {\n name,\n runLimit,\n organization,\n allowSelfRegistration,\n flightRecorder,\n event,\n allowMembershipChanges,\n pricing,\n startDate,\n expirationDate,\n capacity,\n allowChannel,\n },\n ...optionals,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Queries for groups\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/search` or GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/quantized/search`\n *\n * @example\n * import { groupAdapter } from 'epicenter-libs';\n * const filter = [\n * 'name|=group1|group2', // look for groups whose name is 'group1' or 'group2'\n * 'groupKey=0000017dd3bf540e5ada5b1e058f08f20461', // look for groups with the specific group key\n * 'approximateMemberCount>30', // look for groups larger than 30\n * 'startDate<2022-01-03T20:30:53.054Z', // look for groups with start date before Jan 3rd 2022\n * 'expirationDate<2022-01-03T20:30:53.054Z', // look for groups with expiration date before Jan 3rd 2022\n * // 'account.shortName=acme', // specifies account, intended for admin use\n * // 'project.shortName=simulations', // specifies project, intended for admin use\n * ];\n * const page = await groupAdapter.query({\n * filter,\n * sort: ['+group.name'], // sort all findings by group name ascending (lexicographically)\n * first: 3, // page should start with the 4th item found (will default to 0)\n * max: 10, // page should only include the first 10 items\n * });\n *\n * @param searchOptions Search options for the query\n * @param [searchOptions.filter] Filters for searching\n * @param [searchOptions.sort] Sorting criteria\n * @param [searchOptions.first] The starting index of the page returned\n * @param [searchOptions.max] The number of entries per page\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a page of groups\n */\nexport async function query(\n searchOptions: { quantized?: boolean } & GenericSearchOptions,\n optionals: RoutingOptions = {},\n): Promise<Page<GroupReadOutView>> {\n const { filter, sort = [], first, max, quantized } = searchOptions;\n\n const searchParams = {\n filter: parseFilterInput(filter),\n sort: sort.join(';') || undefined,\n first, max,\n };\n\n return await new Router()\n .withSearchParams(searchParams)\n .get(`/group${quantized ? '/quantized' : ''}/search`, {\n paginated: true,\n ...optionals,\n })\n .then(({ body }) => body);\n}\n/** DEPRECATED -- use groupAdapter.query instead */\nexport async function search(\n optionals: { quantized?: boolean } & GenericSearchOptions & RoutingOptions = {},\n): Promise<Page<GroupReadOutView>> {\n console.warn('DEPRECATION WARNING: groupAdapter.search is deprecated and will be removed with the next release. Use groupAdapter.query instead.');\n const { filter = [], sort = [], first, max, quantized, ...routingOptions } = optionals;\n const searchOptions = { filter, sort, first, max, quantized };\n return await query(searchOptions, routingOptions);\n}\n\n\n/**\n * Retrieves a group with given group name\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/with/{NAME}`\n *\n * @example\n * import { groupAdapter } from 'epicenter-libs';\n * const group = await groupAdapter.withGroupName('my-group-name');\n *\n * @param name Name associated with the group\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a group\n */\nexport async function withGroupName(\n name: string,\n optionals: RoutingOptions = {},\n): Promise<GroupReadOutView> {\n return await new Router()\n .get(`/group/with/${name}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Retrieves the list of groups a particular user is in; intended for admin use\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/member/for/{USER_KEY}`\n *\n * @example\n * import { groupAdapter } from 'epicenter-libs';\n * const groups = await groupAdapter.forUser(\n * '000001796733eef0842f4d6d960997018a3b', // get groups where this user is a member of\n * { role: ['FACILITATOR'] } // where this user is a facilitator in the group\n * );\n *\n * @param userKey User key associated with the user\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.includeExpired] Indicates whether to include expired groups in the query\n * @param [optionals.includeAllMembers] Indicates whether to include the other members in the group (by default, only the requested user appears)\n * @param [optionals.role] Role or list of possible roles the user holds in the group\n * @returns promise that resolves to a list of groups\n */\nexport async function forUser(\n userKey: string,\n optionals: {\n includeAllMembers?: boolean;\n includeExpired?: boolean;\n role?: string | string[];\n } & RoutingOptions = {},\n): Promise<GroupReadOutView[]> {\n const {\n includeExpired,\n includeAllMembers,\n role,\n ...routingOptions\n } = optionals;\n const isMultiple = Array.isArray(role) && role.length > 0;\n const roleList = isMultiple ? role : [role];\n const searchParams = {\n includeExpired,\n includeAllMembers,\n role: role ? roleList : undefined,\n };\n\n return await new Router()\n .withSearchParams(searchParams)\n .get(`/group/member/for/${userKey}`, routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Retrieves the list of groups particular to the current session\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/member`\n *\n * @example\n * import { groupAdapter } from 'epicenter-libs';\n * const groups = await groupAdapter.getSessionGroups();\n *\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.includeExpired] Indicates whether to include expired groups in the query\n * @param [optionals.includeAllMembers] Indicates whether to include the other members in the group (by default, only the requested user appears)\n * @param [optionals.role] Role or list of possible roles the user holds in the group\n * @returns promise that resolves to a list of groups\n */\nexport async function getSessionGroups(\n optionals: {\n includeAllMembers?: boolean;\n includeExpired?: boolean;\n role?: string | string[];\n } & RoutingOptions = {},\n): Promise<GroupReadOutView[]> {\n const {\n includeExpired,\n role,\n ...routingOptions\n } = optionals;\n const isMultiple = Array.isArray(role) && role.length > 0;\n const roleList = isMultiple ? role : [role];\n const searchParams = {\n includeExpired,\n role: role ? roleList : undefined,\n };\n\n return await new Router()\n .withSearchParams(searchParams)\n .get('/group/member', routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Permits a list of users to self-register for membership in a group; will only work if the group has allowSelfRegistration set to true\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/self/{GROUP_KEY}`\n *\n * @example\n * import { groupAdapter } from 'epicenter-libs';\n * await groupAdapter.whitelistUsers('0000017dd3bf540e5ada5b1e058f08f20461', {\n * allow: true,\n * emails: ['user1@test.com', 'user2@test.com'],\n * });\n *\n * @param groupKey Key associated with group\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.allow] Whether to allow or disallow self-registration for the specified users; defaults to true if unset\n * @param [optionals.emails] List of emails to allow or disallow; a value of \"*\" is interpreted as all users; defaults to all users if unset\n * @returns promise that resolves to undefined (indicating success)\n */\nexport async function whitelistUsers(\n groupKey: string,\n optionals: {\n allow?: boolean;\n emails?: string[];\n } & RoutingOptions = {},\n): Promise<void> {\n const {\n allow = true,\n emails = ['*'],\n ...routingOptions\n } = optionals;\n\n return await new Router()\n .post(`/group/self/${groupKey}`, {\n body: {\n allow,\n emails,\n },\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Retrieves a list of users allowed to self-register for membership in a group with a given groupKey\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/self/{GROUP_KEY}`\n *\n * @example\n * import { groupAdapter } from 'epicenter-libs';\n * const users = await groupAdapter.getWhitelistedUsers('0000017dd3bf540e5ada5b1e058f08f20461');\n *\n * @param groupKey Key associated with the group\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a list of users\n */\nexport async function getWhitelistedUsers(\n groupKey: string,\n optionals: RoutingOptions = {},\n): Promise<PseudonymReadOutView[]> {\n return await new Router()\n .get(`/group/self/${groupKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Sends an email to the specified email address with a link to complete self-registration for a group\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/self/{GROUP_KEY}`\n *\n * @example\n * import { groupAdapter } from 'epicenter-libs';\n * await groupAdapter.sendRegistrationEmail('0000017dd3bf540e5ada5b1e058f08f20461', 'user1@test.com', {\n * redirectURL: '/login',\n * linkURL: '/register',\n * subject: 'Complete your registration!',\n * });\n *\n * @param groupKey Key associated with group\n * @param email Email address to send the link to\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.linkURL] Relative path to link sent in email to complete registration (<forio scheme>://<forio host>/app/<account>/<project><linkURL>)\n * @param [optionals.redirectURL] Relative path to redirect to after completing registration (<forio scheme>://<forio host>/app/<account>/<project><redirectURL>)\n * @param [optionals.subject] The subject of the email that will be sent\n * @returns promise that resolves to undefined (indicating success)\n */\nexport async function sendRegistrationEmail(\n groupKey: string,\n email: string,\n optionals: {\n linkURL?: string;\n redirectURL?: string;\n subject?: string;\n } & RoutingOptions = {},\n): Promise<void> {\n const {\n redirectURL,\n linkURL,\n subject,\n ...routingOptions\n } = optionals;\n\n return await new Router()\n .post(`/registration/self/${groupKey}`, {\n body: {\n email,\n linkUrl: linkURL,\n redirectUrl: redirectURL,\n subject,\n },\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Finalizes a user's self-registration process for a group; requires the project to have deployment.autoCreatePlayer set to true\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/self/{TOKEN}`\n *\n * @example\n * import { groupAdapter } from 'epicenter-libs';\n * const result = await groupAdapter.selfRegister('myregistrationtoken', 'pass', {\n * displayName: 'My Display Name',\n * givenName: 'Leonard',\n * familyName: 'Nimoy',\n * handle: 'the_real_spock',\n * });\n *\n * @param token Registration token\n * @param password Password the user would use to log in\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.displayName] Display name chosen by user\n * @param [optionals.givenName] User's given name\n * @param [optionals.familyName] User's family name\n * @param [optionals.handle] Handle the user would use to log in; defaults to email address if not specified\n * @returns promise resolving to an object containing the redirect URL and the session\n */\nexport async function selfRegister(\n token: string,\n password: string,\n optionals: {\n displayName?: string;\n givenName?: string;\n familyName?: string;\n handle?: string;\n } & RoutingOptions = {},\n): Promise<SelfRegistrationResult> {\n const {\n displayName,\n givenName,\n familyName,\n handle,\n ...routingOptions\n } = optionals;\n\n return await new Router()\n .patch(`/registration/self/${token}`, {\n body: {\n password,\n displayName,\n givenName,\n familyName,\n handle,\n },\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Adds user(s) to the group\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/member/{GROUP_KEY}`\n *\n * @example\n * import { groupAdapter } from 'epicenter-libs';\n * await groupAdapter.addUser('000001796733eef0842f4d6d960997018a3b');\n * await groupAdapter.addUser([{\n * userKey: '000001796733eef0842f4d6d960997018a3b',\n * role: 'REVIEWER',\n * available: false,\n * }]);\n *\n * @param usersInput List of user keys or user input objects (properties defined below)\n * @param usersInput[].userKey User key\n * @param [usersInput[].role] User's role; defaults to PARTICIPANT if unset; See [ROLE](#ROLE) for all types\n * @param [usersInput[].available] Indicates whether or not the user is 'active' (for semantic labeling); defaults to true if unset\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.groupKey] Group key to indicate the group; will default to the group key associated with the current session\n * @returns promise that resolves to the group the user was added to\n */\nexport async function addUser(\n usersInput: UserInput | UserInput[],\n optionals: { groupKey?: string } & RoutingOptions = {},\n): Promise<GroupReadOutView> {\n const { groupKey, ...routingOptions } = optionals;\n\n const users = Array.isArray(usersInput) ? usersInput : [usersInput];\n const session = identification.session as UserSession;\n return await new Router()\n .post(`/group/member/${groupKey ?? session?.groupKey}`, {\n body: users.map((u) => {\n const userKey = typeof u === 'string' ? u : u.userKey;\n const role = typeof u === 'string' ? ROLE.PARTICIPANT : u.role;\n const available = typeof u === 'string' ? true : u.available;\n\n return {\n role,\n userKey,\n objectType: 'group',\n available: available ?? true,\n };\n }),\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Updates a user's group membership information\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/member/{GROUP_KEY}/{USER_KEY}`\n *\n * @example\n * import { groupAdapter } from 'epicenter-libs';\n * const group = await groupAdapter.updateUser('000001796733eef0842f4d6d960997018a3b', { role: 'LEADER' });\n *\n * @param userKey User key\n * @param update Object containing the updates to a user's group membership information\n * @param [update.role] User's role; See [ROLE](#ROLE) for all types\n * @param [update.available] Indicates whether or not the user is 'active' (for semantic labeling)\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.groupKey] Group key; defaults to the group key associated with the current session\n * @returns promise that resolves to the membership information that was updated\n */\nexport async function updateUser(\n userKey: string,\n update: {\n role?: string;\n available?: boolean;\n },\n optionals: { groupKey?: string } & RoutingOptions = {},\n): Promise<GroupReadOutView> {\n const { role, available } = update;\n const { groupKey, ...routingOptions } = optionals;\n const session = identification.session as UserSession;\n return await new Router()\n .patch(`/group/member/${groupKey ?? session?.groupKey}/${userKey}`, {\n body: {\n objectType: 'group',\n role,\n available,\n },\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Removes user(s) from the group\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/member/{GROUP_KEY}/{USER_KEY}` or DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/member/{GROUP_KEY}` (for multiple users)\n *\n * @example\n * import { groupAdapter } from 'epicenter-libs';\n * const userKeys = members.map(({ userKey }) => userKey);\n * await groupAdapter.removeUser(userKeys);\n *\n * @param userKey Key associated with the user or an array of user keys to remove from group\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.groupKey] Group key for the group you want to remove from; defaults to the group in the current session\n * @returns promise that resolves to undefined when successful\n */\nexport async function removeUser(\n userKey: string | string[],\n optionals: { groupKey?: string } & RoutingOptions = {},\n): Promise<void> {\n const { groupKey, ...routingOptions } = optionals;\n const hasMultiple = Array.isArray(userKey) && userKey.length > 1;\n const uriComponent = hasMultiple ? '' : `/${userKey.length === 1 ? userKey[0] : userKey}`;\n const searchParams = hasMultiple ? { userKey } : undefined;\n const session = identification.session as UserSession;\n return await new Router()\n .withSearchParams(searchParams)\n .delete(`/group/member/${groupKey ?? session?.groupKey}${uriComponent}`, routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Updates the status of a group\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/group/status/{GROUP_KEY}`\n *\n * @example\n * import { groupAdapter } from 'epicenter-libs';\n * const group = await groupAdapter.statusUpdate('active', 'Group is currently active');\n *\n * @param code Status code\n * @param message Status message\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.groupKey] Group key; defaults to the group key associated with the current session\n * @returns promise that resolves to the updated group\n */\nexport async function statusUpdate(\n code: string,\n message: string,\n optionals: { groupKey?: string } & RoutingOptions = {},\n): Promise<GroupReadOutView> {\n const { groupKey, ...routingOptions } = optionals;\n const session = identification.session as UserSession;\n return await new Router()\n .patch(`/group/status/${groupKey ?? session?.groupKey}`, {\n body: { code, message },\n ...routingOptions,\n }).then(({ body }) => body);\n}\n","import type { UserSession } from '../utils/identification';\nimport type { RoutingOptions } from '../utils/router';\nimport type { GenericScope, GenericSearchOptions } from '../utils/constants';\n\nimport { identification, Router, parseFilterInput } from '../utils';\n\n\nexport interface Score {\n name: string;\n quantity: number;\n}\n\nexport interface Tag {\n label: string;\n content: string;\n}\n\nexport interface Leaderboard {\n lastUpdated: Date;\n scores: Score[];\n scope: { userKey?: string } & GenericScope;\n collection: string;\n tags: Tag[];\n}\n\n\n/**\n * Creates a leaderboard entry.\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/leaderboard`\n *\n * @example\n * import { leaderboardAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const leaderboard = await leaderboardAdapter.update(\n * 'class-23-leaderboard',\n * { scopeBoundary: SCOPE_BOUNDARY.GROUP, scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461' },\n * [{ name: 'total', quantity: 20 }, { name: 'extraCredit', quantity: 2 }],\n * { tags: [{ label: 'role', content: 'doctor' }] }\n * );\n *\n * @param collection Name of the leaderboard\n * @param scope Scope attached to the leaderboard entry; allows for scoping\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [scope.userKey] User key for the user creating the entry; if omitted will use the one in current session\n * @param scores List of score objects\n * @param scores[].name Name of the score\n * @param scores[].quantity Value of the score\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.tags] Tags for the leaderboard entry; helps to provide another layer of scope if needed\n * @param [optionals.allowChannel] If true, allows channel notifications for this update\n * @returns promise that resolves to the leaderboard entry created\n */\nexport async function update(\n collection: string,\n scope: { userKey?: string } & GenericScope,\n scores: Score[],\n optionals: {\n tags?: Tag[];\n allowChannel?: boolean;\n } & RoutingOptions = {},\n): Promise<Leaderboard> {\n const { tags, allowChannel, ...routingOptions } = optionals;\n const { scopeBoundary, scopeKey, userKey } = scope;\n const session = identification.session as UserSession;\n return await new Router()\n .post('/leaderboard', {\n body: {\n scope: {\n scopeBoundary,\n scopeKey,\n userKey: userKey ?? session?.userKey,\n },\n collection,\n scores,\n tags,\n allowChannel,\n },\n ...routingOptions,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Gathers leaderboard information; not paginable (hence named 'list' and not 'query')\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/leaderboard/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{COLLECTION}`\n *\n * @example\n * import { leaderboardAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const leaderboard = await leaderboardAdapter.list('myLeaderboard', {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: 'GROUP_KEY',\n * }, {\n * filter: [\n * 'tag.role=doctor', // look for leaderboard entries tagged with role=doctor\n * 'score.total>0' // where the users scored a total higher than 0\n * ],\n * sort: ['+score.total'], // sort results by 'total' in ascending order\n * first: 0,\n * max: 20 // retrieve only the first 20 entries\n * });\n *\n * @param collection Name of the leaderboard\n * @param scope Scope attached to the leaderboard entry; allows for scoping\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param searchOptions Search options for the query\n * @param [searchOptions.filter] Filters for searching\n * @param [searchOptions.sort] Sorting criteria\n * @param [searchOptions.first] The starting index of the list returned\n * @param [searchOptions.max] The maximum number of entries in the list\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a list of leaderboard entries\n */\nexport async function list(\n collection: string,\n scope: GenericScope,\n searchOptions: GenericSearchOptions,\n optionals: RoutingOptions = {},\n): Promise<Leaderboard[]> {\n const { scopeBoundary, scopeKey } = scope;\n const { filter, sort = [], first, max } = searchOptions;\n const searchParams = {\n filter: parseFilterInput(filter),\n sort: sort.join(';') || undefined,\n first, max,\n };\n\n return await new Router()\n .withSearchParams(searchParams)\n .get(`/leaderboard/${scopeBoundary}/${scopeKey}/${collection}`, optionals)\n .then(({ body }) => body);\n}\n\nexport async function get(\n collection: string,\n scope: GenericScope,\n searchOptions: GenericSearchOptions,\n optionals: RoutingOptions = {},\n): Promise<Leaderboard[]> {\n console.warn('DEPRECATION WARNING: leaderboardAdapter.get is deprecated and will be removed with the next release. Use leaderboardAdapter.list instead.');\n return await list(collection, scope, searchOptions, optionals);\n}\n\n\n/**\n * Returns the total count in the given collection\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/leaderboard/count/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{COLLECTION}`\n *\n * @example\n * import { leaderboardAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const count = await leaderboardAdapter.getCount('myLeaderboard', {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * }, {\n * filter: [\n * 'tag.role=doctor', // look for leaderboard entries tagged with role=doctor\n * 'score.total>0' // where the users scored a total higher than 0\n * ],\n * });\n *\n * @param collection Name of the leaderboard\n * @param scope Scope attached to the leaderboard entry; allows for scoping\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param searchOptions Search options for the query\n * @param [searchOptions.filter] Filters for searching\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the number of entries in the leaderboard\n */\nexport async function getCount(\n collection: string,\n scope: GenericScope,\n searchOptions: GenericSearchOptions,\n optionals: RoutingOptions = {},\n): Promise<number> {\n const { scopeBoundary, scopeKey } = scope;\n const { filter } = searchOptions;\n const searchParams = {\n filter: parseFilterInput(filter),\n };\n\n return await new Router()\n .withSearchParams(searchParams)\n .get(`/leaderboard/count/${scopeBoundary}/${scopeKey}/${collection}`, optionals)\n .then(({ body }) => body);\n}\n","import type { RoutingOptions } from '../utils/router';\nimport type { PseudonymReadOutView } from './user';\n\nimport { Router, identification, GROUP_ROLE } from '../utils';\nimport cometdAdapter from './cometd';\n\n\nexport interface Presence {\n lastUpdated: number;\n ttlSeconds: number;\n groupRole: keyof typeof GROUP_ROLE;\n user: PseudonymReadOutView;\n}\n\n\n/**\n * Makes a connection request to the CometD server; effectively marking the user as online.\n * This isn't required to be called in order to be considered online. Subscribe to a CometD\n * channel will do the same as well. This is just a convenience method for when you don't\n * need to utilize the channels except specifically for presence.\n * Using [logout](#authAdapter-logout) will automatically disconnect for you.\n * Base URL: Uses CometD push channel connection\n *\n * @example\n * import { presenceAdapter } from 'epicenter-libs';\n * await presenceAdapter.connect();\n *\n * @returns promise indicating whether or not the connection was successful\n */\nexport async function connect(): Promise<void> {\n await cometdAdapter.handshake();\n return;\n}\n\n\n/**\n * Disconnects from CometD and removes user presence.\n * Using [logout](#authAdapter-logout) will automatically disconnect for you.\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/presence/group/{GROUP_KEY}`\n *\n * @example\n * import { presenceAdapter } from 'epicenter-libs';\n * await presenceAdapter.disconnect();\n *\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise indicating whether or not the disconnection was successful\n */\nexport async function disconnect(optionals: RoutingOptions): Promise<void> {\n const cleanup = [cometdAdapter.disconnect()];\n const groupKey = identification?.session?.groupKey;\n if (groupKey) {\n cleanup.push(\n new Router().delete(\n `/presence/group/${groupKey}`,\n optionals,\n ),\n );\n }\n await Promise.allSettled(cleanup);\n}\n\n\n/**\n * Retrieves the presence information for a particular group\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/presence/group/{GROUP_KEY}`\n *\n * @example\n * import { presenceAdapter } from 'epicenter-libs';\n * const presence = await presenceAdapter.forGroup('0000017dd3bf540e5ada5b1e058f08f20461');\n *\n * @param groupKey Key associated with group\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a list of users online\n */\nexport async function forGroup(\n groupKey: string,\n optionals: RoutingOptions = {},\n): Promise<Presence[]> {\n return await new Router()\n .get(`/presence/group/${groupKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Retrieves the presence information for a particular world\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/presence/world/{WORLD_KEY}`\n *\n * @example\n * import { presenceAdapter } from 'epicenter-libs';\n * const presence = await presenceAdapter.forWorld('0000017a445032dc38cb2cecd5fc13708314');\n *\n * @param worldKey Key associated with world\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a list of users online\n */\nexport async function forWorld(\n worldKey: string,\n optionals: RoutingOptions = {},\n): Promise<Presence[]> {\n return await new Router()\n .get(`/presence/world/${worldKey}`, optionals)\n .then(({ body }) => body);\n}\n\n","import Router from '../utils/router';\n\n/**\n * Verifies a Google reCAPTCHA token\n * Base URL: POST `https://forio.com/api/v3/epicenter/manager/recaptcha/google`\n *\n * @example\n * import { recaptchaAdapter } from 'epicenter-libs';\n * const result = await recaptchaAdapter.google(token);\n *\n * @param humanKey The reCAPTCHA token to verify\n * @returns promise that resolves to the verification result\n */\nexport async function google(humanKey: string) {\n return await new Router()\n .withAccountShortName('epicenter')\n .withProjectShortName('manager')\n .post('/recaptcha/google', {\n body: { humanKey: humanKey },\n })\n .then(({ body }) => body);\n}\n","import type { UserSession } from '../utils/identification';\nimport type { GenericScope, GenericSearchOptions, Permit, Address } from '../utils/constants';\nimport type { RoutingOptions, Page } from '../utils/router';\nimport type { PseudonymReadOutView } from './user';\n\nimport {\n Router,\n identification,\n ROLE,\n SCOPE_BOUNDARY,\n RITUAL,\n EpicenterError,\n parseFilterInput,\n} from '../utils';\n\n// Generic type parameters for Run variables and metadata\nexport type RunVariables = Record<string, unknown>;\nexport type RunMetadata = Record<string, unknown>;\n\nexport interface V2ModelContext {\n variables?: Record<string, VariableOptions>;\n externalFunctions?: Record<string, WireExternalFunction>;\n modelVersion?: number;\n mappedFiles?: Record<string, string>;\n control?: ExcelModelControl | JavaModelControl | PowersimModelControl | VensimModelControl;\n language?: string;\n protections?: Protections;\n restorations?: Restorations;\n version: string;\n workerImage?: string;\n dependencies?: (AptExternalDependency | CranExternalDependency | GitExternalDependency | JuliaExternalDependency | NpmExternalDependency | PypiExternalDependency | ShellExternalDependency)[];\n operations?: Record<string, OperationOptions>;\n defaults?: ModelContextDefaults;\n enableStateCache?: boolean;\n redirectStandardOut?: boolean;\n startDebugger?: boolean;\n inceptionGracePeriodSeconds?: number;\n minimumLogLevel?: string;\n events?: Record<string, EventOptions>;\n}\n\nexport interface ModelContext extends V2ModelContext {}\n\nexport interface VariableOptions {\n resetDecision?: boolean;\n dialect?: string;\n save?: boolean;\n reportPer?: number;\n sensitivity?: boolean;\n reportOffset?: number;\n}\n\nexport interface WireExternalFunction {\n route?: Route;\n arguments?: string;\n objectType: 'wire';\n}\n\nexport interface Route {\n service?: string;\n version?: number;\n}\n\nexport interface ExcelModelControl {\n autoRecalculate?: boolean;\n objectType: 'excel';\n}\n\nexport interface JavaModelControl {\n executable?: string;\n objectType: 'java';\n}\n\nexport interface PowersimModelControl {\n minimizeMemoryFootprint?: boolean;\n objectType: 'powersim';\n}\n\nexport interface VensimModelControl {\n sensitivityControl?: 'SensitivityControl';\n extensionModule?: string;\n objectType: 'vensim';\n}\n\nexport interface Protections {\n guards: (InputGuard | OverwriteGuard | PrivilegeGuard | RelativeGuard | RoleGuard)[];\n}\n\nexport interface InputGuard {\n regex: string;\n operand?: string;\n operator?: string;\n objectType: 'input';\n}\n\nexport interface OverwriteGuard {\n regex: string;\n dialect?: string;\n initial: string;\n objectType: 'overwrite';\n}\n\nexport interface PrivilegeGuard {\n regex: string;\n read: string;\n domain: string;\n grant: string;\n write: string;\n execute: string;\n objectType: 'privilege';\n}\n\nexport interface RelativeGuard {\n regex: string;\n dialect?: string;\n value: string;\n operator: string;\n key: string;\n objectType: 'relative';\n}\n\nexport interface RoleGuard {\n regex: string;\n role: string;\n domain: string;\n grant: string;\n objectType: 'role';\n}\n\nexport interface Restorations {\n rewind?: RewindMarker;\n log?: string;\n assembly?: (ReplayRestoration | SnapshotRestoration)[];\n}\n\nexport interface RewindMarker {\n name?: string;\n destructible?: boolean;\n arguments?: Record<string, unknown>;\n}\n\nexport interface ReplayRestoration {\n replay: {\n operations?: ReplayOperation[];\n };\n}\n\nexport interface ReplayOperation {\n targetType: string;\n operationType: string;\n targetKey: string;\n}\n\nexport interface SnapshotRestoration {\n variables?: string[];\n objectType: 'snapshot';\n}\n\nexport interface AptExternalDependency {\n package?: string;\n repository?: string;\n version?: string;\n objectType: 'apt';\n}\n\nexport interface CranExternalDependency {\n package?: string;\n version?: string;\n objectType: 'cran';\n}\n\nexport interface GitExternalDependency {\n url?: string;\n script?: string;\n objectType: 'git';\n}\n\nexport interface JuliaExternalDependency {\n package?: string;\n version?: string;\n objectType: 'julia';\n}\n\nexport interface NpmExternalDependency {\n package?: string;\n version?: string;\n objectType: 'npm';\n}\n\nexport interface PypiExternalDependency {\n package?: string;\n version?: string;\n objectType: 'pypi';\n}\n\nexport interface ShellExternalDependency {\n script?: string;\n objectType: 'shell';\n}\n\nexport interface OperationOptions {\n timeoutSeconds?: number;\n inert?: boolean;\n}\n\nexport interface ModelContextDefaults {\n variables?: VariableOptions;\n operations?: OperationOptions;\n events?: EventOptions;\n}\n\nexport interface EventOptions {\n timeoutSeconds?: number;\n}\n\nexport interface V1ExecutionContext {\n presets?: Record<string, Record<string, unknown>>;\n mappedFiles?: Record<string, string>;\n version: string;\n tool?: StellaModelTool | VensimModelTool;\n};\n\nexport interface ExecutionContext extends V1ExecutionContext {}\n\nexport interface StellaModelTool {\n objectType: 'stella';\n gameMode?: boolean;\n}\n\nexport interface VensimModelTool {\n objectType: 'vensim';\n sensitivityMode?: boolean;\n cinFiles?: string[];\n}\n\nexport enum MORPHOLOGY {\n MANY = 'MANY',\n PROXY = 'PROXY',\n SINGULAR = 'SINGULAR',\n}\n\nexport interface ProcActionable {\n name: string;\n arguments?: unknown[];\n objectType: 'execute';\n}\n\nexport interface GetActionable {\n name: string;\n objectType: 'get';\n}\n\nexport interface SetActionable {\n name: string;\n value: unknown;\n objectType: 'set';\n}\n\nexport type Actionable =\n | ProcActionable\n | GetActionable\n | SetActionable;\n\n\nexport type RunReadOutView<\n V extends object = RunVariables,\n M extends object = RunMetadata,\n> = {\n cluster?: string;\n hidden?: boolean;\n modelVersion?: number;\n lastOperated?: string;\n modelLanguage?: string;\n perpetual?: boolean;\n cloud?: string;\n metaData?: M;\n grammar?: string;\n trackingKey?: string;\n scope: { userKey?: string } & GenericScope;\n executionContext?: V1ExecutionContext;\n allowChannel?: boolean;\n marked?: boolean;\n variables?: V;\n address?: Address;\n tombstone?: string;\n morphology?: string;\n modelFile?: string;\n created?: string;\n runKey: string;\n permit?: Permit;\n closed?: boolean;\n lastModified?: string;\n runState?: string;\n user?: PseudonymReadOutView;\n};\n\nexport type RunCreateOptions = {\n readLock?: keyof typeof ROLE;\n writeLock?: keyof typeof ROLE;\n ephemeral?: boolean;\n trackingKey?: string;\n modelContext?: ModelContext;\n executionContext?: ExecutionContext;\n allowChannel?: boolean;\n} & RoutingOptions;\n\nexport type RunStrategy =\n | 'reuse-across-sessions'\n | 'reuse-never'\n | 'reuse-by-tracking-key'\n | 'multiplayer';\n\n/**\n * Creates a run. By default, all runs are created with the user's ID (`userKey`), except in the case of world-scoped runs.\n * If no permit is specified, platform will assign a default determined by the session user type and the scope boundary.\n * For a participant creating a run, the default readLock/writeLock is `USER/USER`, unless that run is scoped to a world,\n * in which case `PARTICIPANT/FACILITATOR` is the default. Admins and facilitators/reviewers have their own defaults.\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run`\n *\n * @example\n * import { runAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * await runAdapter.create('model.py', {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461'\n * });\n *\n * @param model Name of your model file\n * @param scope Scope associated with your run\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.readLock] Read permission role; one of the strings defined in ROLE\n * @param [optionals.writeLock] Write permission role; one of the strings defined in ROLE\n * @param [optionals.ephemeral] Used for testing. If true, the run will only exist so long as its in memory; makes it so that nothing is written to the database, history, or variables.\n * @param [optionals.trackingKey] Tracking key\n * @param [optionals.modelContext] .ctx2 file overrides, this is not tracked by clone operations\n * @param [optionals.executionContext] Carries arguments for model file worker on model initialization. This is tracked by clone operations.\n * @param [optionals.allowChannel] Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT\n * @returns promise that resolves to the newly created run\n */\nexport async function create<\n V extends object = RunVariables,\n M extends object = RunMetadata,\n>(\n model: string,\n scope: { userKey?: string } & GenericScope,\n optionals: RunCreateOptions = {},\n): Promise<RunReadOutView<V, M>> {\n const { scopeBoundary, scopeKey, userKey } = scope;\n const {\n readLock,\n writeLock,\n ephemeral,\n trackingKey,\n modelContext,\n executionContext,\n allowChannel,\n ...routingOptions\n } = optionals;\n\n const { WORLD } = SCOPE_BOUNDARY;\n const session = identification.session as UserSession;\n\n const hasPermit = readLock || writeLock;\n const headers = Object.assign(\n {},\n routingOptions.headers,\n hasPermit ? { 'X-Forio-Confirmation': true } : {},\n );\n const permit = hasPermit ? { readLock, writeLock } : undefined;\n\n return await new Router()\n .post('/run', {\n body: {\n scope: {\n scopeBoundary,\n scopeKey,\n userKey: scopeBoundary === WORLD ?\n undefined :\n userKey ?? session?.userKey,\n },\n permit,\n morphology: 'MANY',\n trackingKey,\n modelFile: model,\n modelContext: modelContext || {/* Is not recorded for clone. Overrides model ctx2 file. */},\n executionContext: executionContext || {/* Affected by clone. Carries arguments for model file worker on model initialization */},\n ephemeral,\n allowChannel,\n },\n ...routingOptions,\n headers,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Creates a project scoped run\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/singular`\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * await runAdapter.createSingular('model.py');\n *\n * @param model Name of your model file\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.readLock] Read permission role; one of the strings defined in ROLE\n * @param [optionals.writeLock] Write permission role; one of the strings defined in ROLE\n * @param [optionals.ephemeral] Used for testing. If true, the run will only exist so long as its in memory; makes it so that nothing is written to the database, history, or variables.\n * @param [optionals.modelContext] .ctx2 file overrides, this is not tracked by clone operations\n * @param [optionals.executionContext] Carries arguments for model file worker on model initialization. This is tracked by clone operations.\n * @returns promise that resolves to the newly created run\n */\nexport async function createSingular<\n V extends object = RunVariables,\n M extends object = RunMetadata,\n>(\n model: string,\n optionals: RunCreateOptions = {},\n): Promise<RunReadOutView<V, M>> {\n const {\n readLock, writeLock, ephemeral,\n modelContext, executionContext,\n ...routingOptions\n } = optionals;\n\n const hasPermit = readLock || writeLock;\n const headers = Object.assign(\n {},\n routingOptions.headers,\n hasPermit ? { 'X-Forio-Confirmation': true } : {},\n );\n const permit = hasPermit ? { readLock, writeLock } : undefined;\n\n return await new Router()\n .post('/run/singular', {\n body: {\n modelFile: model,\n permit,\n modelContext: modelContext || {/* Is not recorded for clone. Overrides model ctx2 file. */},\n executionContext: executionContext || {/* Affected by clone. Carries arguments for model file worker on model initialization */},\n ephemeral,\n },\n ...routingOptions,\n headers,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Gets the singular run's runKey\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/singular/key`\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * const runKey = await runAdapter.getSingularRunKey();\n *\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a runKey\n */\nexport async function getSingularRunKey(\n optionals: RoutingOptions = {},\n): Promise<number> {\n return await new Router()\n .get('/run/singular/key', optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Clone a run\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/clone/{RUN_KEY}`\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * const clonedRun = await runAdapter.clone('00000173078afb05b4ae4c726637167a1a9e');\n *\n * @param runKey Run key for the run you want to clone\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.ephemeral] Used for testing. If true, the run will only exist so long as its in memory; makes it so that nothing is written to the database, history, or variables.\n * @param [optionals.trackingKey] Tracking key\n * @param [optionals.modelContext] .ctx2 file overrides, this is not tracked by clone operations\n * @param [optionals.executionContext] Carries arguments for model file worker on model initialization. This is tracked by clone operations.\n * @returns promise that resolves to the cloned run\n */\nexport async function clone(\n runKey: string,\n optionals: {\n ephemeral?: boolean;\n trackingKey?: string;\n modelContext?: ModelContext;\n executionContext?: ExecutionContext;\n } & RoutingOptions = {},\n): Promise<RunReadOutView> {\n const {\n ephemeral, trackingKey, modelContext = {}, executionContext = {},\n ...routingOptions\n } = optionals;\n return await new Router()\n .post(`/run/clone/${runKey}`, {\n body: {\n trackingKey,\n modelContext,\n executionContext,\n ephemeral,\n },\n ...routingOptions,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Restore a run into memory\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/restore/{RUN_KEY}`\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * const restoredRun = await runAdapter.restore('00000173078afb05b4ae4c726637167a1a9e');\n *\n * @param runKey Run key for the run you want to restore\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.ephemeral] Used for testing. If true, the run will only exist so long as its in memory; makes it so that nothing is written to the database, history, or variables.\n * @param [optionals.modelContext] .ctx2 file overrides, this is not tracked by clone operations\n * @param [optionals.executionContext] Carries arguments for model file worker on model initialization. This is tracked by clone operations.\n * @returns promise that resolves to the restored run\n */\nexport async function restore(\n runKey: string,\n optionals: {\n ephemeral?: boolean;\n modelContext?: ModelContext;\n executionContext?: ExecutionContext;\n } & RoutingOptions = {},\n): Promise<RunReadOutView> {\n const {\n ephemeral,\n modelContext = {},\n executionContext = {},\n ...routingOptions\n } = optionals;\n return await new Router()\n .post(`/run/restore/${runKey}`, {\n body: {\n modelContext,\n executionContext,\n ephemeral,\n },\n ...routingOptions,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Rewind a run by a specified number of steps\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/rewind/{RUN_KEY}`\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * const rewoundRun = await runAdapter.rewind('00000173078afb05b4ae4c726637167a1a9e', 5);\n *\n * @param runKey Run key for the run you want to rewind\n * @param steps Number of steps to rewind\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.ephemeral] Used for testing. If true, the run will only exist so long as its in memory; makes it so that nothing is written to the database, history, or variables.\n * @param [optionals.modelContext] .ctx2 file overrides, this is not tracked by clone operations\n * @returns promise that resolves to the rewound run\n */\nexport async function rewind(\n runKey: string,\n steps: number,\n optionals: {\n ephemeral?: boolean;\n modelContext?: ModelContext;\n } & RoutingOptions = {},\n): Promise<RunReadOutView> {\n const {\n ephemeral,\n modelContext = {},\n ...routingOptions\n } = optionals;\n return await new Router()\n .post(`/run/rewind/${runKey}`, {\n body: {\n rewindCount: steps,\n modelContext,\n ephemeral,\n },\n ...routingOptions,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Updates a run's attributes\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/{RUN_KEY}`\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * const updatedRun = await runAdapter.update('00000173078afb05b4ae4c726637167a1a9e', {\n * readLock: 'FACILITATOR',\n * writeLock: 'FACILITATOR',\n * marked: true,\n * hidden: false,\n * });\n *\n * @param runKey Key associated with the run\n * @param update Object with the key-value pairs you would like to update\n * @param update.readLock Read permission role; one of the strings defined in ROLE\n * @param update.writeLock Write permission role; one of the strings defined in ROLE\n * @param update.trackingKey Tracking key for the run\n * @param update.marked Whether the run is marked (analogous to v2's 'saved')\n * @param update.hidden Whether the run is hidden (analogous to v2's 'trashed')\n * @param update.closed Closed is a flag that means do not restore, the run is done, no more play\n * @param update.allowChannel Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT\n * @param [optionals] Optional arguments; pass network call options overrides here\n * @returns promise that resolve to the updated run\n */\nexport async function update(\n runKey: string,\n update: {\n readLock?: keyof typeof ROLE;\n writeLock?: keyof typeof ROLE;\n trackingKey?: string;\n marked?: boolean;\n hidden?: boolean;\n closed?: boolean;\n allowChannel?: boolean;\n },\n optionals: RoutingOptions = {},\n): Promise<RunReadOutView> {\n const {\n readLock,\n writeLock,\n trackingKey,\n marked,\n hidden,\n closed,\n allowChannel,\n } = update;\n const hasMultiple = Array.isArray(runKey) && runKey.length > 1;\n const uriComponent = hasMultiple ? '' : `/${runKey.length === 1 ? runKey[0] : runKey}`;\n const permit = (readLock || writeLock) ? { readLock, writeLock } : undefined;\n\n return await new Router()\n .withSearchParams(hasMultiple ? { runKey } : '')\n .patch(`/run${uriComponent}`, {\n body: {\n permit,\n trackingKey,\n marked,\n hidden,\n closed,\n allowChannel,\n },\n ...optionals,\n }).then(({ body }) => body);\n}\n\n\n/**\n * *Does not actually delete the run*. The run is instead removed from memory. This can be used as a means of preserving server CPUs, and should be used when you do not expect to perform any additional actions that would bring the run back into memory.\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/{RUN_KEY}`\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * await runAdapter.remove('00000173078afb05b4ae4c726637167a1a9e');\n *\n * @param runKey Key associated with the run\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolve to undefined if successful\n */\nexport async function remove(\n runKey: string,\n optionals: RoutingOptions = {},\n): Promise<void> {\n return await new Router()\n .delete(`/run/${runKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Gets a specific run by its runKey\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/{RUN_KEY}`\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * const run = await runAdapter.get('00000173078afb05b4ae4c726637167a1a9e');\n *\n * @param runKey Key associated with the run\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the run\n */\nexport async function get<\n V extends object = RunVariables,\n M extends object = RunMetadata,\n>(\n runKey: string,\n optionals: RoutingOptions = {},\n): Promise<RunReadOutView<V, M>> {\n return await new Router()\n .get(`/run/${runKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Queries for runs.\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{MODEL}` or GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/in/{GROUP_NAME}/{MODEL}` or GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/in/{GROUP_NAME}/{EPISODE_NAME}/{MODEL}`\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * const page = await runAdapter.query('model.xlsx', {\n * filter: [\n * 'var.foo|=1|2|3', // look for runs with a variable 'foo' with the values 1, 2, or 3\n * 'var.score>=24', // looks for runs with a variable 'score' higher than or equal to 24\n * 'var.certified*=true' // looks for runs where the variable 'certified' exists,\n * 'run.hidden=false', // where the run's 'hidden' attribute is false\n * 'meta.classification~=bar-*' // where the run metadata contains a 'classification' that begins with 'bar-',\n * 'meta.categorization~=*-baz' // where the run metadata contains a 'categorization' that does not end with '-baz',\n * ],\n * sort: ['+run.created'] // sort all findings by the 'created' field (ascending)\n * variables: ['foo', 'baz'], // include the run variables for 'foo' and 'baz' in the response\n * metadata: ['classification'] // include the run metadata for 'classification' in the response\n * });\n *\n * @param model Name of your model file\n * @param searchOptions Search options\n * @param [searchOptions.scope.scopeBoundary] Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param [searchOptions.scope.scopeKey] Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [searchOptions.scope.userKey] User attached to scope if necessary\n * @param [searchOptions.filter] List of conditionals to filter for\n * @param [searchOptions.sort] List of values to sort by (applies only to run attributes)\n * @param [searchOptions.variables] List of variables to include with the runs found\n * @param [searchOptions.metadata] List of metadata to include with the runs found\n * @param [searchOptions.first] The index from which we collect our runs from\n * @param [searchOptions.max] The maximum number of runs to return (upper limit: 200)\n * @param [searchOptions.timeout] Number of seconds we're willing to wait for the response from the server\n * @param [searchOptions.includeEpisodes] Only used for the `run/in/groupName` endpoint\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a page of runs\n */\nexport async function query<\n V extends object = RunVariables,\n M extends object = RunMetadata,\n>(\n model: string,\n searchOptions: {\n timeout?: number;\n variables?: (keyof V)[];\n metadata?: (keyof M)[];\n scope?: { userKey?: string } & GenericScope;\n groupName?: string;\n episodeName?: string;\n includeEpisodes?: boolean;\n } & GenericSearchOptions,\n optionals: RoutingOptions = {},\n): Promise<Page<RunReadOutView<V, M>>> {\n const {\n filter, sort = [], first, max, timeout, variables = [], metadata = [],\n scope, groupName, episodeName, includeEpisodes,\n } = searchOptions;\n const session = identification.session as UserSession;\n const uriComponent = scope ?\n `${scope.scopeBoundary}/${scope.scopeKey}` :\n `in/${groupName ?? session?.groupName}${episodeName ? `/${episodeName}` : ''}`;\n\n // Handle additional filters that need to be added programmatically\n let finalFilter = filter;\n if (scope?.userKey) {\n const userKeyFilter = `run.userKey=${scope.userKey}`;\n if (Array.isArray(filter)) {\n finalFilter = [...filter, userKeyFilter];\n } else if (typeof filter === 'string') {\n finalFilter = filter ? `${filter};${userKeyFilter}` : userKeyFilter;\n } else if (filter && typeof filter === 'object') {\n // For FilterGroup objects, wrap the existing filter and the userKey filter in an AND group\n finalFilter = {\n type: 'and' as const,\n filters: [filter, userKeyFilter],\n };\n } else {\n finalFilter = [userKeyFilter];\n }\n }\n\n const searchParams = {\n filter: parseFilterInput(finalFilter),\n sort: sort.join(';') || undefined,\n var: (variables as string[]).join(';') || undefined,\n meta: (metadata as string[]).join(';') || undefined,\n first, max, timeout, includeEpisodes,\n };\n\n return await new Router()\n .withSearchParams(searchParams)\n .get(`/run/${uriComponent}/${model}`, {\n paginated: true,\n parsePage: (values: RunReadOutView[]) => {\n return values.map((run) => {\n run.variables = variables.reduce((variableMap, key, index) => {\n // TODO -- add a test case to run.spec that makes sure it does not error if it receives run w/o 'variables'\n variableMap[key as keyof V] = run.variables?.[index] as V[keyof V];\n return variableMap;\n }, {} as Pick<V, keyof V>);\n return run;\n });\n },\n ...optionals,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Retrieves a model's introspection information based on model file.\n * The exact structure of the information returned varies between model languages, but generally includes information about the model's variables (data type, whether they are user-accessible/writable, etc), named ranges, available model functions. SimLang models also provide \"causes\" and \"effects\" for variables, which are ways of describing which variables are affected by changes to other variables.\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/introspect/model/{MODEL}`\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * const info = await runAdapter.introspect('model.py');\n *\n * @param model Name of your model file\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to an object containing the model's introspection information\n */\nexport async function introspect(\n model: string,\n optionals: RoutingOptions = {},\n): Promise<Record<string, unknown>> {\n return await new Router()\n .get(`/run/introspect/model/${model}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Retrieves a model's introspection information based on a run key associated with the model.\n * The exact structure of the information returned varies between model languages, but generally includes information about the model's variables (data type, whether they are user-accessible/writable, etc), named ranges, available model functions. SimLang models also provide \"causes\" and \"effects\" for variables, which are ways of describing which variables are affected by changes to other variables.\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/introspect/{RUN_KEY}`\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * const info = await runAdapter.introspectWithRunKey('00000173078afb05b4ae4c726637167a1a9e');\n *\n * @param runKey Identifier for your run\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to an object containing the model's introspection information\n */\nexport async function introspectWithRunKey(\n runKey: string,\n optionals: RoutingOptions = {},\n): Promise<Record<string, unknown>> {\n return await new Router()\n .get(`/run/introspect/${runKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Executes an operation on a run.\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/operation/{RUN_KEY}` or POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/operation` (for multiple runs)\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * const result = await runAdapter.operation('00000173078afb05b4ae4c726637167a1a9e', 'simulate', [10]);\n *\n * @param runKey Identifier for your run\n * @param name Name of the operation to execute\n * @param [args] Arguments to pass to the operation\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.timeout] Number of seconds we're willing to wait for the response from the server\n * @param [optionals.ritual] Ritual describing how to store and remove the run from memory; one of the strings defined in RITUAL\n * @returns promise that resolve to the operation's return value\n */\nexport async function operation(\n runKey: string | string[],\n name: string,\n args: unknown[] = [],\n optionals: {\n timeout?: number;\n ritual?: keyof typeof RITUAL;\n } & RoutingOptions = {},\n): Promise<unknown> {\n const {\n timeout, ritual,\n ...routingOptions\n } = optionals;\n const hasMultiple = Array.isArray(runKey) && runKey.length > 1;\n const uriComponent = hasMultiple ? '' : `/${runKey.length === 1 ? runKey[0] : runKey}`;\n const searchParams = hasMultiple ? { runKey, timeout } : { ritual, timeout };\n\n if (ritual !== RITUAL.EXORCISE && hasMultiple) {\n console.warn(`Detected ritual: ${ritual} usage with multiple runKeys; this not allowed. Defaulting to ritual: EXORCISE`);\n }\n\n return await new Router()\n .withSearchParams(searchParams)\n .post(`/run/operation${uriComponent}`, {\n body: {\n name,\n arguments: args,\n objectType: 'execute', // TODO: remove this when platform fixes this so that it's not manually required\n },\n ...routingOptions,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Retrieves model variables for a run or runs\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/variable/{RUN_KEY}` or POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/variable` (for multiple runs)\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * // Single runKey\n * const vars = await runAdapter.getVariables('00000173078afb05b4ae4c726637167a1a9e', ['var1', 'var2']);\n * // Multiple runKeys\n * const varsArray = await runAdapter.getVariables(['00000173078afb05b4ae4c726637167a1a9e', '0000017dd3bf540e5ada5b1e058f08f20461'], ['var1', 'var2']);\n *\n * @param runKey Identifier for your run or runs\n * @param variables List of variables to retrieve\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.timeout] Number of seconds we're willing to wait for the response from the server\n * @param [optionals.ritual] Ritual describing how to store and remove the run from memory; one of the strings defined in RITUAL\n * @param [optionals.ignorable] If true, suppresses errors when variables are not found\n * @returns promise that resolve to an object with the variables and their values\n */\nexport async function getVariables<V extends object = RunVariables>(\n runKey: string | string[],\n variables: (keyof V)[],\n optionals: {\n timeout?: number;\n ritual?: keyof typeof RITUAL;\n ignorable?: boolean;\n } & RoutingOptions = {},\n): Promise<\n | Pick<V, keyof V>\n | { runKey: string; variables: Pick<V, keyof V> }[]\n> {\n const {\n timeout, ritual, ignorable,\n ...routingOptions\n } = optionals;\n const hasMultiple = Array.isArray(runKey) && runKey.length > 1;\n\n if (ritual !== RITUAL.EXORCISE && hasMultiple) {\n console.warn(`Detected ritual: ${ritual} usage with multiple runKeys; this not allowed. Defaulting to ritual: EXORCISE`);\n }\n\n const mappify = (values: unknown[]): Pick<V, keyof V> => variables.reduce((variableMap, key, index) => {\n variableMap[key as keyof V] = values[index] as V[keyof V];\n return variableMap;\n }, {} as Pick<V, keyof V>);\n\n const uriComponent = hasMultiple ? '' : `/${runKey.length === 1 ? runKey[0] : runKey}`;\n const include = (variables as string[]).join(';');\n const body = hasMultiple ? { runKey, include, timeout } : { ritual, include, timeout };\n const additional = ignorable ? { ignorable } : {};\n return await new Router()\n .post(`/run/variable${uriComponent}`, {\n body: {\n ...body,\n ...additional,\n },\n ...routingOptions,\n })\n .then(({ body }) => {\n if (hasMultiple) {\n return Object.keys(body).map((runKey) => ({\n runKey,\n variables: mappify(body[runKey]),\n }));\n }\n return mappify(body);\n });\n}\n\n\n/**\n * Retrieves model variable(s) for a run or runs\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/variable/{RUN_KEY}/{VARIABLE}` or POST (for multiple runs/variables)\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * // Single runKey, single variable\n * const value = await runAdapter.getVariable('00000173078afb05b4ae4c726637167a1a9e', 'var1');\n * // Multiple runKeys, multiple variables\n * const varsArray = await runAdapter.getVariable(['00000173078afb05b4ae4c726637167a1a9e', '0000017dd3bf540e5ada5b1e058f08f20461'], ['var1', 'var2']);\n *\n * @param runKey Identifier for your run or runs\n * @param variable Variable or list of variables to retrieve\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.timeout] Number of seconds we're willing to wait for the response from the server\n * @param [optionals.ritual] Ritual describing how to store and remove the run from memory; one of the strings defined in RITUAL\n * @returns promise that resolve to the variable's value, or an object with the variables and their values\n */\nexport async function getVariable<V extends object = RunVariables>(\n runKey: string | string[],\n variable: keyof V | (keyof V)[],\n optionals: {\n timeout?: number;\n ritual?: keyof typeof RITUAL;\n } & RoutingOptions = {},\n): Promise<\n | V[keyof V]\n | Pick<V, keyof V>\n | { runKey: string; variables: Pick<V, keyof V> }[]\n> {\n const { timeout, ritual, ...routingOptions } = optionals;\n\n if (Array.isArray(runKey) || Array.isArray(variable)) {\n const variables = Array.isArray(variable) ? variable : [variable];\n return getVariables(runKey, variables, optionals);\n }\n\n return await new Router()\n .withSearchParams({ timeout, ritual })\n .get(`/run/variable/${runKey}/${String(variable)}`, routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Updates model variables for the run\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/variable/{RUN_KEY}` or PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/variable` (for multiple runs)\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * const updated = await runAdapter.updateVariables('00000173078afb05b4ae4c726637167a1a9e', {\n * price: 100,\n * foo: 'bar',\n * });\n *\n * @param runKey Identifier for your run\n * @param update Object with the key-value pairs you would like to update in the model\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.timeout] Number of seconds we're willing to wait for the response from the server\n * @param [optionals.ritual] Ritual describing how to store and remove the run from memory; one of the strings defined in RITUAL\n * @returns promise that resolve to an object with the variables and new values that were updated\n */\nexport async function updateVariables<V extends object = RunVariables>(\n runKey: string | string[],\n update: Partial<V>,\n optionals: {\n timeout?: number;\n ritual?: keyof typeof RITUAL;\n } & RoutingOptions = {},\n): Promise<Partial<V>> {\n const {\n timeout, ritual,\n ...routingOptions\n } = optionals;\n const hasMultiple = Array.isArray(runKey) && runKey.length > 1;\n const uriComponent = hasMultiple ? '' : `/${runKey.length === 1 ? runKey[0] : runKey}`;\n const searchParams = hasMultiple ? { runKey, timeout } : { ritual, timeout };\n\n if (ritual !== RITUAL.EXORCISE && hasMultiple) {\n console.warn(`Detected ritual: ${ritual} usage with multiple runKeys; this not allowed. Defaulting to ritual: EXORCISE`);\n }\n\n return await new Router()\n .withSearchParams(searchParams)\n .patch(`/run/variable${uriComponent}`, {\n body: update,\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Retrieves run metadata for a run or runs\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/meta`\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * // Single runKey\n * const meta = await runAdapter.getMetadata('00000173078afb05b4ae4c726637167a1a9e', ['meta1', 'meta2']);\n * // Multiple runKeys\n * const metaArray = await runAdapter.getMetadata(['00000173078afb05b4ae4c726637167a1a9e', '0000017dd3bf540e5ada5b1e058f08f20461'], ['meta1', 'meta2']);\n *\n * @param runKey Identifier for your run or runs\n * @param metadata List of metadata keys to retrieve\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.timeout] Number of seconds we're willing to wait for the response from the server\n * @returns promise that resolve to an object with the metadata and their values\n */\nexport async function getMetadata<M extends object = RunMetadata>(\n runKey: string | string[],\n metadata: (keyof M)[],\n optionals: {\n timeout?: number;\n } & RoutingOptions = {},\n): Promise<\n | Pick<M, keyof M>\n | { runKey: string; data: Pick<M, keyof M> }[]\n> {\n const {\n ...routingOptions\n } = optionals;\n const include = (metadata as string[]).join(';');\n const hasMultiple = Array.isArray(runKey) && runKey.length > 1;\n\n const runKeyArg = Array.isArray(runKey) ? runKey : [runKey];\n return await new Router()\n .post('/run/meta', {\n body: {\n include,\n runKey: runKeyArg,\n },\n ...routingOptions,\n })\n .then(({ body }) => {\n const bodyAsArray = Object.keys(body).map((runKey) => ({\n runKey,\n data: body[runKey],\n }));\n return (\n hasMultiple ? bodyAsArray : bodyAsArray?.[0]?.data\n );\n });\n}\n\n\nexport interface MetadataFirstPop {\n objectType: 'first';\n}\n\nexport interface MetadataLastPop {\n objectType: 'last';\n}\n\nexport interface MetadataAllPop {\n objectType: 'all';\n value?: unknown;\n}\n\nexport type MetadataPop = MetadataFirstPop | MetadataLastPop | MetadataAllPop;\n\nexport interface MetadataUpdate<M extends object = RunMetadata> {\n pop?: Partial<Record<keyof M, MetadataPop>>;\n set?: Partial<M>;\n push?: Partial<M>;\n}\n\n/**\n * Updates run metadata for a run or runs\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/meta/{RUN_KEY}` or PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/meta` (for multiple runs)\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * // Set metadata values\n * const updated = await runAdapter.updateMetadata('00000173078afb05b4ae4c726637167a1a9e', {\n * set: {\n * classification: 'new-classification',\n * categorization: 'new-categorization',\n * },\n * });\n * // Push values to array metadata\n * const pushed = await runAdapter.updateMetadata('00000173078afb05b4ae4c726637167a1a9e', {\n * push: {\n * history: 'new-entry',\n * },\n * });\n * // Pop values from array metadata\n * const popped = await runAdapter.updateMetadata('00000173078afb05b4ae4c726637167a1a9e', {\n * pop: {\n * history: { objectType: 'last' },\n * },\n * });\n *\n * @param runKey Identifier for your run or runs\n * @param update Metadata update operations\n * @param [update.set] Key-value pairs to set in the metadata\n * @param [update.push] Key-value pairs to push to array metadata\n * @param [update.pop] Keys with pop operations (first, last, or all) to remove from array metadata\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.timeout] Number of seconds we're willing to wait for the response from the server\n * @returns promise that resolves to an object with the updated metadata\n */\nexport async function updateMetadata<M extends object = RunMetadata>(\n runKey: string | string[],\n update: MetadataUpdate<M>,\n optionals: {\n timeout?: number;\n } & RoutingOptions = {},\n): Promise<Partial<M>> {\n const {\n timeout,\n ...routingOptions\n } = optionals;\n const hasMultiple = Array.isArray(runKey) && runKey.length > 1;\n const uriComponent = hasMultiple ? '' : `/${runKey.length === 1 ? runKey[0] : runKey}`;\n const searchParams = hasMultiple ? { runKey, timeout } : { timeout };\n\n return await new Router()\n .withSearchParams(searchParams)\n .patch(`/run/meta${uriComponent}`, {\n body: update,\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Executes a list of actions on a run or runs\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/action/{RUN_KEY}` or POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/action` (for multiple runs)\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * const actions = [\n * { name: 'price', value: 100, 'objectType': 'set' },\n * { name: 'simulate', arguments: [10], 'objectType': 'execute' },\n * ];\n * // Single runKey\n * const result = await runAdapter.action('00000173078afb05b4ae4c726637167a1a9e', actions);\n * // Multiple runKeys\n * const results = await runAdapter.action(['00000173078afb05b4ae4c726637167a1a9e', '0000017dd3bf540e5ada5b1e058f08f20461'], actions);\n *\n * @param runKey Identifier for your run or runs\n * @param actionList List of actions to perform\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.timeout] Number of seconds we're willing to wait for the response from the server\n * @param [optionals.ritual] Ritual describing how to store and remove the run from memory; one of the strings defined in RITUAL\n * @returns promise that resolve to an object with the action results\n */\nexport async function action(\n runKey: string | string[],\n actionList: Actionable[],\n optionals: {\n timeout?: number;\n ritual?: keyof typeof RITUAL;\n } & RoutingOptions = {},\n): Promise<Record<string, unknown>> {\n const {\n timeout,\n ritual,\n ...routingOptions\n } = optionals;\n const hasMultiple = Array.isArray(runKey) && runKey.length > 1;\n const uriComponent = hasMultiple ? '' : `/${runKey.length === 1 ? runKey[0] : runKey}`;\n const searchParams = hasMultiple ? { runKey, timeout } : { ritual, timeout };\n\n if (ritual !== RITUAL.EXORCISE && hasMultiple) {\n console.warn(`Detected ritual: ${ritual} usage with multiple runKeys; this not allowed. Defaulting to ritual: EXORCISE`);\n }\n\n return await new Router()\n .withSearchParams(searchParams)\n .post(`/run/action${uriComponent}`, {\n body: actionList,\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Returns the run associated with the given world key; brings the run into memory, if the run does not exist, it will create it.\n * See `runAdapter.create` for more information about platform-determined default permits.\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/world/{WORLD_KEY}`\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * const run = await runAdapter.retrieveFromWorld('0000017a445032dc38cb2cecd5fc13708314', 'model.py');\n *\n * @param worldKey Key associated with the world you'd like a run from\n * @param model Name of model file you'd use to create the run if needed\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.readLock] Read permission role; one of the strings defined in ROLE\n * @param [optionals.writeLock] Write permission role; one of the strings defined in ROLE\n * @param [optionals.ephemeral] Used for testing. If true, the run will only exist so long as its in memory; makes it so that nothing is written to the database, history, or variables.\n * @param [optionals.trackingKey] Tracking key\n * @param [optionals.modelContext] .ctx2 file overrides, this is not tracked by clone operations\n * @param [optionals.executionContext] Carries arguments for model file worker on model initialization. This is tracked by clone operations.\n * @param [optionals.allowChannel] Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT\n * @returns promise that resolves to the run retrieved from, or created for the world\n */\nexport async function retrieveFromWorld(\n worldKey: string,\n model: string,\n optionals: {\n readLock?: keyof typeof ROLE;\n writeLock?: keyof typeof ROLE;\n ephemeral?: boolean;\n trackingKey?: string;\n modelContext?: ModelContext;\n executionContext?: ExecutionContext;\n allowChannel?: boolean;\n } & RoutingOptions = {},\n): Promise<RunReadOutView> {\n const {\n readLock,\n writeLock,\n ephemeral,\n trackingKey,\n modelContext,\n executionContext,\n allowChannel,\n ...routingOptions\n } = optionals;\n\n const hasPermit = readLock || writeLock;\n const headers = Object.assign(\n {},\n routingOptions.headers,\n hasPermit ? { 'X-Forio-Confirmation': true } : {},\n );\n const permit = hasPermit ? { readLock, writeLock } : undefined;\n\n return await new Router()\n .post(`/run/world/${worldKey}`, {\n body: {\n permit,\n morphology: 'MANY',\n trackingKey,\n modelFile: model,\n modelContext: modelContext || {},\n executionContext: executionContext || {},\n ephemeral,\n allowChannel,\n },\n ...routingOptions,\n headers,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Removes the run associated with the given world key\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/world/{WORLD_KEY}`\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * await runAdapter.removeFromWorld('0000017a445032dc38cb2cecd5fc13708314');\n *\n * @param worldKey Key associated with the world\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to undefined when successful\n */\nexport async function removeFromWorld(\n worldKey: string,\n optionals: RoutingOptions = {},\n): Promise<void> {\n return await new Router()\n .delete(`/run/world/${worldKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Queries for and/or creates a run, depending on the strategy provided.\n *\n * 'reuse-across-sessions' -- will get the most recent run for the given scope, creating it if it does not exist\n * 'reuse-never' -- will create a new run every time\n *\n * @example\n * import { runAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const run = await runAdapter.getWithStrategy(\n * 'reuse-across-sessions',\n * 'model.py',\n * {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * },\n * );\n *\n * @param strategy Strategy to use when retrieving the run\n * @param model Name of your model file\n * @param scope Scope associated with your run\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.readLock] Read permission role; one of the strings defined in ROLE\n * @param [optionals.writeLock] Write permission role; one of the strings defined in ROLE\n * @param [optionals.ephemeral] Used for testing. If true, the run will only exist so long as its in memory; makes it so that nothing is written to the database, history, or variables.\n * @param [optionals.trackingKey] Tracking key\n * @param [optionals.modelContext] .ctx2 file overrides, this is not tracked by clone operations\n * @param [optionals.executionContext] Carries arguments for model file worker on model initialization. This is tracked by clone operations.\n * @returns promise that resolves to a run\n */\nexport async function getWithStrategy<\n V extends object = RunVariables,\n M extends object = RunMetadata,\n>(\n strategy: RunStrategy,\n model: string,\n scope: GenericScope,\n optionals: {\n // initOperations?: Array<string | { name: string, params?: unknown[]}>,\n } & RunCreateOptions = {},\n): Promise<RunReadOutView<V, M>> {\n // const { initOperations = [] } = optionals;\n if (strategy === 'reuse-across-sessions') {\n const searchOptions = {\n scope,\n sort: ['-run.created'],\n max: 1,\n };\n const { values: [lastRun] } = await query<V, M>(model, searchOptions);\n if (!lastRun) {\n const newRun = await create<V, M>(model, scope, optionals);\n // await serial(newRun.runKey, initOperations, optionals = {});\n return newRun;\n }\n return lastRun;\n } else if (strategy === 'reuse-never') {\n const newRun = await create<V, M>(model, scope, optionals);\n // await serial(newRun.runKey, initOperations, optionals = {});\n return newRun;\n } else if (strategy === 'reuse-by-tracking-key') {\n // TBD write out if needed\n // Platform plans to introduce run limits into episode scope, differing from v2's implementation of runLimit via 'reuse-by-tracking-key'\n } else if (strategy === 'multiplayer') {\n // TODO when multiplayer API is ready\n // check the current world for this end user, return the current run for that world (if there is none, create a run for the world)\n }\n throw new EpicenterError('Invalid run strategy.');\n}\n\n\n/**\n * Clone a run into a novel episode scope\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/run/migrate/to/{EPISODE_KEY}/{RUN_KEY}`\n *\n * @example\n * import { runAdapter } from 'epicenter-libs';\n * const migratedRun = await runAdapter.migrate(\n * '00000173078afb05b4ae4c726637167a1a9e',\n * '0000017dd3bf540e5ada5b1e058f08f20461',\n * );\n *\n * @param runKey Source run key for the run you want to copy and migrate\n * @param episodeKey Destination episode key for the run's new episode scope\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.ephemeral] Used for testing. If true, the run will only exist so long as its in memory; makes it so that nothing is written to the database, history, or variables.\n * @param [optionals.trackingKey] Tracking key\n * @param [optionals.modelContext] .ctx2 file overrides, this is not tracked by migrate operations\n * @param [optionals.executionContext] Carries arguments for model file worker on model initialization. This is tracked by migrate operations.\n * @returns promise that resolves to the migrated run\n */\nexport async function migrate<\n V extends object = RunVariables,\n M extends object = RunMetadata,\n>(\n runKey: string,\n episodeKey: string,\n optionals: {\n ephemeral?: boolean;\n trackingKey?: string;\n modelContext?: ModelContext;\n executionContext?: ExecutionContext;\n } & RoutingOptions = {},\n): Promise<RunReadOutView<V, M>> {\n const {\n ephemeral, trackingKey, modelContext = {}, executionContext = {},\n ...routingOptions\n } = optionals;\n return await new Router()\n .post(`/run/migrate/to/${episodeKey}/${runKey}`, {\n body: {\n trackingKey,\n modelContext,\n executionContext,\n ephemeral,\n },\n ...routingOptions,\n }).then(({ body }) => body);\n}\n","import type { RoutingOptions } from '../utils/router';\nimport { GROUP_ROLE } from '../utils/constants';\n\nimport Router from '../utils/router';\n\nexport type Modality = 'NONE' | 'HBP' | 'ICC' | 'SSO';\nexport type MFAMethodology = 'NONE' | 'NOOP' | 'TOTP';\n\n// Generic type alias for SSO realm data\nexport type RealmData = Record<string, unknown>;\n\nexport interface MFADetailReadOutView {\n mfaMethodology: MFAMethodology;\n}\n\nexport interface GraftReadOutView<R extends object = RealmData> {\n reference: string;\n realm: R;\n}\n\nexport interface Countdown {\n last?: string;\n count?: number;\n}\n\nexport interface GroupRelationshipReadOutView {\n role: keyof typeof GROUP_ROLE;\n}\n\nexport interface UserReadOutView {\n lastLogin: string;\n modality: Modality;\n lastUpdated: string;\n created: string;\n displayName: string;\n countdown?: Countdown;\n givenName: string;\n familyName: string;\n handle: string;\n loginCount: number;\n uploadOrder: number;\n email: string;\n active: boolean;\n userId: number;\n userKey: string;\n objectType: 'external' | 'native';\n mfaDetail: MFADetailReadOutView;\n}\n\nexport interface ExternalUserReadOutView extends UserReadOutView {\n graft: GraftReadOutView;\n objectType: 'external';\n}\n\nexport interface NativeUserReadOutView extends UserReadOutView {\n objectType: 'native';\n}\n\nexport interface PseudonymReadOutView {\n lastUpdated: string;\n created: string;\n displayName: string;\n detail: ExternalUserReadOutView | NativeUserReadOutView;\n userId: number;\n userKey: string;\n relationship: GroupRelationshipReadOutView;\n}\n\nexport interface MFADetailCreateInView {\n mfaMethodology: MFAMethodology;\n mfaKey?: string;\n}\n\nexport interface GraftCreateInView<R extends object = RealmData> {\n reference: string;\n realm: R;\n}\n\nexport interface SecretCreateInView {\n password: string;\n}\n\nexport interface UserCreateInView {\n handle: string;\n modality?: Modality;\n displayName?: string;\n familyName?: string;\n givenName?: string;\n countdown?: Countdown;\n active?: true;\n email?: string;\n mfaDetail?: MFADetailCreateInView;\n}\n\nexport interface NativeUserCreateInView extends UserCreateInView {\n objectType: 'native';\n secret?: SecretCreateInView;\n}\n\nexport interface ExternalUserCreateInView<R extends object = RealmData> extends UserCreateInView {\n objectType: 'external';\n graft: GraftCreateInView<R>;\n}\n\nexport interface UploadOptions extends RoutingOptions {\n groupKey?: string;\n overwrite?: boolean;\n}\n\nexport interface DiscardedUser {\n user: ExternalUserReadOutView | NativeUserReadOutView;\n message: string;\n information: Record<string, unknown>;\n code: string;\n}\n\nexport interface UserReport {\n duplicated?: PseudonymReadOutView[];\n created?: PseudonymReadOutView[];\n updated?: PseudonymReadOutView[];\n discarded?: DiscardedUser[];\n}\n\n\n/**\n * Upload a CSV file to create multiple users\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/user/upload`\n *\n * @example\n * import { userAdapter } from 'epicenter-libs';\n * const file = new File([csvContent], 'users.csv');\n * const report = await userAdapter.uploadCSV(file, { overwrite: true });\n *\n * @param file CSV file containing user data\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.overwrite] If true, overwrites existing users with matching identifiers; defaults to false\n * @returns promise that resolves to a report containing created, updated, and discarded users\n */\nexport async function uploadCSV(\n file: File,\n optionals: UploadOptions = {},\n): Promise<UserReport> {\n const {\n overwrite,\n ...routingOptions\n } = optionals;\n\n const formdata = new FormData();\n formdata.append('file', file);\n\n return await new Router()\n .withSearchParams({ overwrite })\n .post('/user/upload', {\n body: formdata,\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Create a new user (native or external).\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/user`\n *\n * @example\n * import { userAdapter } from 'epicenter-libs';\n * // Create a native user\n * const user = await userAdapter.createUser({\n * objectType: 'native',\n * handle: 'john.doe',\n * displayName: 'John Doe',\n * email: 'john@example.com',\n * });\n *\n * @param view User data to create; can be either a native or external user\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the created user\n */\nexport async function createUser<R extends object = RealmData>(\n view: {\n objectType: 'native';\n handle: string;\n modality?: Modality;\n displayName?: string;\n familyName?: string;\n givenName?: string;\n countdown?: Countdown;\n active?: true;\n email?: string;\n mfaDetail?: MFADetailCreateInView;\n secret?: SecretCreateInView;\n } | {\n objectType: 'external';\n handle: string;\n modality?: Modality;\n displayName?: string;\n familyName?: string;\n givenName?: string;\n countdown?: Countdown;\n active?: true;\n email?: string;\n mfaDetail?: MFADetailCreateInView;\n graft: GraftCreateInView<R>;\n },\n optionals: RoutingOptions = {},\n): Promise<PseudonymReadOutView> {\n return await new Router()\n .post('/user', {\n body: view,\n ...optionals,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Gets a specific user.\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/user/{USER_KEY}`\n *\n * @example\n * import { userAdapter } from 'epicenter-libs';\n * const user = await userAdapter.get('00000179b4d3fb0c84f822df8cd2aa53be25');\n *\n * @param userKey The user key\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a user\n */\nexport async function get(\n userKey: string,\n optionals: RoutingOptions = {},\n): Promise<PseudonymReadOutView> {\n return await new Router()\n .get(`/user/${userKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Gets a specific user by their handle.\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/user/with/{HANDLE}` or GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/user/with/{HANDLE}/{MODALITY}`\n *\n * @example\n * import { userAdapter } from 'epicenter-libs';\n * const user = await userAdapter.getWithHandle('john.doe@example.com', { modality: 'email' });\n *\n * @param handle Handle of the user to retrieve\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.modality] Modality to filter by (e.g., 'email', 'sms')\n * @returns promise that resolves to a user\n */\nexport async function getWithHandle(\n handle: string,\n optionals: {\n modality?: Modality;\n } & RoutingOptions = {},\n): Promise<PseudonymReadOutView> {\n const { modality, ...routingOptions } = optionals;\n const uriComponent = modality ? `/${modality}` : '';\n return await new Router()\n .get(`/user/with/${handle}${uriComponent}`, routingOptions)\n .then(({ body }) => body);\n}\n","import type { UserSession } from '../utils/identification';\nimport type { RoutingOptions } from '../utils/router';\nimport type { GenericScope, GenericSearchOptions, Permit, Address } from '../utils/constants';\n\nimport {\n identification,\n Router,\n ROLE,\n SCOPE_BOUNDARY,\n parseFilterInput,\n} from '../utils';\n\n// Generic type parameter for vault items structure\nexport type VaultItems = Record<string, unknown>;\n\nexport interface Vault<I extends object = VaultItems> {\n created: string;\n lastUpdated: string;\n mutationKey: string;\n address: Address;\n scope: { userKey?: string } & GenericScope;\n name: string;\n permit: Permit;\n vaultKey: string;\n expiration: string;\n items?: I;\n changed?: boolean;\n}\n\nexport interface Items<I extends object = VaultItems> {\n set?: Partial<I>;\n push?: Partial<I>;\n pop?: Partial<I>;\n}\n\n\n/**\n * Updates a vault's items\n * Base URL: PUT `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vault/{VAULT_KEY}`\n *\n * @example\n * import { vaultAdapter } from 'epicenter-libs';\n * // Change the name of the first student object in the list of students in the vault to \"Bob\"\n * await vaultAdapter.update('00000166d59adcb0f497ddc1aad0270c0a62', { set: { 'students.0.name': 'Bob' } });\n *\n * @param vaultKey Vault key\n * @param items Object with a set/push/pop field to update the vault items with\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.mutationKey] Mutation key for optimistic concurrency control\n * @returns promise that resolves to the vault\n */\nexport async function update<I extends object = VaultItems>(\n vaultKey: string,\n items: Items<I>,\n optionals: {\n mutationKey?: string;\n } & RoutingOptions = {},\n): Promise<Vault<I>> {\n const {\n mutationKey,\n ...routingOptions\n } = optionals;\n\n return await new Router()\n .withSearchParams({ mutationKey: mutationKey })\n .put(`/vault/${vaultKey}`, {\n body: {\n set: items.set ?? {},\n push: items.push ?? {},\n pop: items.pop ?? {},\n },\n ...routingOptions,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Updates a vault's properties\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vault/{VAULT_KEY}`\n *\n * @example\n * import { vaultAdapter, ROLE } from 'epicenter-libs';\n * await vaultAdapter.updateProperties('00000166d59adcb0f497ddc1aad0270c0a62', {\n * allowChannel: true,\n * permit: {\n * readLock: ROLE.FACILITATOR,\n * writeLock: ROLE.FACILITATOR,\n * },\n * ttlSeconds: 3600,\n * });\n * });\n *\n * @param vaultKey Vault key\n * @param update Object with properties to update\n * @param [update.mutationKey] Mutation key for optimistic concurrency control\n * @param [update.allowChannel] Opt into push notifications for this resource\n * @param [update.permit] Permission settings for the vault\n * @param [update.ttlSeconds] Time to live in seconds\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the vault\n */\nexport async function updateProperties<I extends object = VaultItems>(\n vaultKey: string,\n update: {\n mutationKey?: string;\n allowChannel?: boolean;\n permit?: Permit;\n ttlSeconds?: number;\n },\n optionals: RoutingOptions = {},\n): Promise<Vault<I>> {\n return await new Router()\n .patch(`/vault/${vaultKey}`, {\n body: {\n ...update,\n },\n ...optionals,\n }).then(({ body }) => body);\n}\n\n\nconst NOT_FOUND = 404;\n\n/**\n * Retrieves a vault by its vault key\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vault/{VAULT_KEY}`\n *\n * @example\n * import { vaultAdapter } from 'epicenter-libs';\n * const vault = await vaultAdapter.get('00000166d59adcb0f497ddc1aad0270c0a62');\n *\n * @param vaultKey Vault key\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the vault, or undefined if not found\n */\nexport async function get<I extends object = VaultItems>(\n vaultKey: string,\n optionals: RoutingOptions = {},\n): Promise<Vault<I>> {\n return await new Router()\n .get(`/vault/${vaultKey}`, optionals)\n .catch((error) => {\n if (error.status === NOT_FOUND) return { body: undefined };\n return Promise.reject(error);\n }).then(({ body }) => body);\n}\n\n\n/**\n * Retrieves a vault by name within a specific scope\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vault/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{VAULT_NAME}`\n *\n * @example\n * import { vaultAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const vault = await vaultAdapter.withScope('my-vault-name', {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * });\n *\n * @param name Name of the vault\n * @param scope Scope associated with the vault\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [scope.userKey] Optional key to scope the vault to a user\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the vault, or undefined if not found\n */\nexport async function withScope<I extends object = VaultItems>(\n name: string,\n scope: { userKey?: string } & GenericScope,\n optionals: RoutingOptions = {},\n): Promise<Vault<I>> {\n const { scopeBoundary, scopeKey, userKey } = scope;\n const uriComponent = userKey ? `/${userKey}` : '';\n return await new Router()\n .get(`/vault/with/${scopeBoundary}/${scopeKey}${uriComponent}/${name}`, optionals)\n .catch((error) => {\n if (error.status === NOT_FOUND) return { body: undefined };\n return Promise.reject(error);\n }).then(({ body }) => body);\n}\n\n\n/**\n * Retrieves all vaults with a specific name within a group or episode\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vault/in/{GROUP_NAME}/{VAULT_NAME}`\n *\n * @example\n * import { vaultAdapter } from 'epicenter-libs';\n * const vaults = await vaultAdapter.byName('my-vault-name', {\n * groupName: 'my-group',\n * episodeName: 'my-episode',\n * includeEpisodes: true,\n * });\n *\n * @param name Name of the vault\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.groupName] Name of the group to search within. Defaults to the session user's group.\n * @param [optionals.episodeName] Name of the episode to search within\n * @param [optionals.userKey] Optional user key to filter vaults by user\n * @param [optionals.includeEpisodes] Whether to include vaults from episodes within the group\n * @returns promise that resolves to an array of vaults with the specified name\n */\nexport async function byName<I extends object = VaultItems>(\n name: string,\n optionals: {\n groupName?: string;\n episodeName?: string;\n userKey?: string;\n includeEpisodes?: boolean;\n } & RoutingOptions = {},\n): Promise<Vault<I>[]> {\n const {\n groupName,\n episodeName,\n userKey,\n includeEpisodes,\n ...routingOptions\n } = optionals;\n const session = identification.session as UserSession;\n\n const searchParams = {\n userKey,\n includeEpisodes,\n };\n\n return await new Router()\n .withSearchParams(searchParams)\n .get(`/vault/in/${groupName ?? session?.groupName}${episodeName ? `/${episodeName}` : ''}/${name}`, {\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Deletes a vault\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vault/{VAULT_KEY}`\n *\n * @example\n * import { vaultAdapter } from 'epicenter-libs';\n * await vaultAdapter.remove('00000166d59adcb0f497ddc1aad0270c0a62');\n *\n * @param vaultKey Vault key\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.mutationKey] Mutation key for optimistic concurrency control\n * @returns promise that resolves to undefined when successful\n */\nexport async function remove(\n vaultKey: string,\n optionals: { mutationKey?: string } & RoutingOptions = {},\n): Promise<void> {\n const {\n mutationKey,\n ...routingOptions\n } = optionals;\n return await new Router()\n .withSearchParams({ mutationKey: mutationKey })\n .delete(`/vault/${vaultKey}`, routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Defines vault properties, used to create or modify a vault. Vault names are unique within their scope.\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vault/{COLLECTION_NAME}`\n *\n * @example\n * import { vaultAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * vaultAdapter.define('my-vault-name', {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * });\n *\n * @param name Name of the vault\n * @param scope Scope associated with your vault\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [scope.userKey] Optional key to scope the vault to a user\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.items] Optional items parameter for updating vault contents\n * @param [optionals.items.set] Sets a field in the vault, where `[name]: [value]`, send `[name]: null` to delete\n * @param [optionals.items.push] Adds an item to a list in the vault; if the list does not exist it will create one\n * @param [optionals.items.pop] Use to remove items from lists in a vault\n * @param [optionals.readLock] Role allowed to read\n * @param [optionals.writeLock] Role allowed to write\n * @param [optionals.ttlSeconds] Life span of the vault (defaults to null, minimum value of 1800 seconds / 30 minutes)\n * @param [optionals.mutationStrategy] Setting a mutation strategy allows for the following behaviors: ALLOW - Is an upsert which means if the entry exists it will be updated with the items in the POST. DISALLOW - Is an insert which means that if the entry exists no changes will be made (the 'changed' flag will be false). ERROR - Is an insert and, if the entry exists, a conflict exception will be thrown. If the mutationStrategy is omitted, it will simply search by scope and name; updating if it exists, creating if not.\n * @param [optionals.allowChannel] Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT\n * @returns promise that resolves to the vault (created or modified)\n */\nexport async function define<I extends object = VaultItems>(\n name: string,\n scope: { userKey?: string } & GenericScope,\n optionals: {\n items?: Items<I>;\n readLock?: keyof typeof ROLE;\n writeLock?: keyof typeof ROLE;\n ttlSeconds?: number;\n mutationStrategy?: string;\n allowChannel?: boolean;\n } & RoutingOptions = {},\n): Promise<Vault<I>> {\n const { scopeBoundary, scopeKey, userKey } = scope;\n const {\n readLock,\n writeLock,\n items,\n ttlSeconds,\n mutationStrategy = 'ERROR',\n allowChannel,\n ...routingOptions\n } = optionals;\n const { WORLD } = SCOPE_BOUNDARY;\n const { PARTICIPANT, USER } = ROLE;\n const defaultLock = scopeBoundary === WORLD ? PARTICIPANT : USER;\n\n const searchParams = { mutationStrategy };\n\n return await new Router()\n .withSearchParams(searchParams)\n .post(`/vault/${name}`, {\n body: {\n scope: {\n scopeBoundary,\n scopeKey,\n userKey,\n },\n permit: {\n readLock: readLock || defaultLock,\n writeLock: writeLock || defaultLock,\n },\n ttlSeconds,\n items,\n allowChannel,\n },\n ...routingOptions,\n }).then(({ body }) => body);\n}\n\n\n/**\n * @deprecated Use vaultAdapter.define instead. This method will be removed in the next release.\n *\n * Creates a new vault with the specified name, scope, and items\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vault/{COLLECTION_NAME}`\n *\n * @example\n * import { vaultAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * await vaultAdapter.create('my-vault-name', {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * }, {\n * set: { foo: 'bar' }\n * });\n *\n * @param name Name of the vault\n * @param scope Scope associated with your vault\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [scope.userKey] Optional key to scope the vault to a user\n * @param items Items to set, push, or pop in the vault\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.readLock] Role allowed to read\n * @param [optionals.writeLock] Role allowed to write\n * @param [optionals.ttlSeconds] Life span of the vault -- default to null, minimum value of 1800 (30 minutes)\n * @param [optionals.mutationStrategy] Mutation strategy: ALLOW (upsert), DISALLOW (insert without update), ERROR (insert with conflict exception if exists)\n * @returns promise that resolves to the created vault\n */\nexport async function create<I extends object = VaultItems>(\n name: string,\n scope: { userKey?: string } & GenericScope,\n items: Items<I>,\n optionals: {\n readLock?: keyof typeof ROLE;\n writeLock?: keyof typeof ROLE;\n ttlSeconds?: number;\n mutationStrategy?: string;\n } & RoutingOptions = {},\n): Promise<Vault<I>> {\n console.warn('DEPRECATION WARNING: vaultAdapter.create is deprecated and will be removed with the next release. Use vaultAdapter.define instead.');\n return await define<I>(name, scope, { items, ...optionals });\n}\n\n\n/**\n * Searches for vaults that match the search options; not paginable (hence named 'list' and not 'query')\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vault/search`\n *\n * @example\n * import { vaultAdapter } from 'epicenter-libs';\n * vaultAdapter.list({\n * filter: [\n * 'name|=vault-one|vault-two', // looks for any vaults with the names provided\n * 'scopeBoundary=WORLD', // looks for vaults scoped to a world\n * 'scopeKey=00000165ad4e6a3cd22b993340b963820239', // used in conjunction with the scopeBoundary\n * ],\n * sort: ['+vault.created'], // sort all findings by the 'created' field (ascending)\n * first: 3, // page should start with the 4th item found (defaults to 0)\n * max: 10, // page should only include the first 10 items\n * }, {\n * groupName: 'my-group-name', // search within a group\n * });\n *\n * @param searchOptions Search options\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.groupName] Name of the group\n * @returns promise that resolves to an array of vaults that match the search options\n */\nexport async function list<I extends object = VaultItems>(\n searchOptions: GenericSearchOptions,\n optionals: { groupName?: string } & RoutingOptions = {},\n): Promise<Vault<I>[]> {\n const { first, filter, max } = searchOptions;\n const searchParams = {\n filter: parseFilterInput(filter),\n first, max,\n };\n const {\n groupName,\n ...routingOptions\n } = optionals;\n\n return new Router()\n .withSearchParams(searchParams)\n .get(`/vault/search${groupName ? `/${groupName}` : ''}`, routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Counts the number of vaults that match the search options\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vault/count`\n *\n * @example\n * import { vaultAdapter } from 'epicenter-libs';\n * vaultAdapter.count({\n * filter: [\n * 'name|=vault-one|vault-two', // looks for any vaults with the names provided\n * 'scopeBoundary=WORLD', // looks for vaults scoped to a world\n * 'scopeKey=00000165ad4e6a3cd22b993340b963820239', // used in conjunction with the scopeBoundary\n * ],\n * }, {\n * groupName: 'my-group-name', // search within a group\n * });\n *\n * @param searchOptions Search options\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.groupName] Name of the group\n * @returns promise that resolves to the number of vaults that match the search options\n */\nexport async function count(\n searchOptions: GenericSearchOptions,\n optionals: { groupName?: string } & RoutingOptions = {},\n): Promise<number> {\n const { first, filter, max } = searchOptions;\n const searchParams = {\n filter: parseFilterInput(filter),\n first, max,\n };\n const {\n groupName,\n ...routingOptions\n } = optionals;\n\n return new Router()\n .withSearchParams(searchParams)\n .get(`/vault/count${groupName ? `/${groupName}` : ''}`, routingOptions)\n .then(({ body }) => body);\n}\n","import type { GenericScope, Address, Permit } from '../utils/constants';\nimport type { RoutingOptions, Page } from '../utils/router';\n\nimport Router from '../utils/router';\n\nexport interface VideoReadOutView {\n videoKey: string;\n family: string;\n affiliate: Affiliate;\n status: 'INITIALIZED' | 'RECORDED' | 'PROCESSED';\n scope: GenericScope;\n permit: Permit;\n address: Address;\n contents: string[];\n reference: string;\n created: string;\n lastUpdated: string;\n expiration: string;\n}\n\nexport const AFFILIATE = {\n VONAGE: 'VONAGE',\n DAILY: 'DAILY',\n DOMESTIC: 'DOMESTIC',\n} as const;\n\nexport type Affiliate = (typeof AFFILIATE)[keyof typeof AFFILIATE];\n\nexport type ProcessingType = 'transcription';\n\nexport const MEDIA_FORMAT = {\n mp3: 'mp3',\n mp4: 'mp4',\n wav: 'wav',\n flac: 'flac',\n ogg: 'ogg',\n amr: 'amr',\n webm: 'webm',\n} as const;\n\nexport type MediaFormat = (typeof MEDIA_FORMAT)[keyof typeof MEDIA_FORMAT];\n\nexport const LANGUAGE_CODE = {\n 'af-ZA': 'af-ZA',\n 'ar-AE': 'ar-AE',\n 'ar-SA': 'ar-SA',\n 'cy-GB': 'cy-GB',\n 'da-DK': 'da-DK',\n 'de-CH': 'de-CH',\n 'de-DE': 'de-DE',\n 'en-AB': 'en-AB',\n 'en-AU': 'en-AU',\n 'en-GB': 'en-GB',\n 'en-IE': 'en-IE',\n 'en-IN': 'en-IN',\n 'en-US': 'en-US',\n 'en-WL': 'en-WL',\n 'es-ES': 'es-ES',\n 'es-US': 'es-US',\n 'fa-IR': 'fa-IR',\n 'fr-CA': 'fr-CA',\n 'fr-FR': 'fr-FR',\n 'ga-IE': 'ga-IE',\n 'gd-GB': 'gd-GB',\n 'he-IL': 'he-IL',\n 'hi-IN': 'hi-IN',\n 'id-ID': 'id-ID',\n 'it-IT': 'it-IT',\n 'ja-JP': 'ja-JP',\n 'ko-KR': 'ko-KR',\n 'nl-NL': 'nl-NL',\n 'pt-BR': 'pt-BR',\n 'pt-PT': 'pt-PT',\n 'ru-RU': 'ru-RU',\n 'ta-IN': 'ta-IN',\n 'te-IN': 'te-IN',\n 'tr-TR': 'tr-TR',\n 'zh-CN': 'zh-CN',\n 'zh-TW': 'zh-TW',\n 'th-TH': 'th-TH',\n 'en-ZA': 'en-ZA',\n 'en-NZ': 'en-NZ',\n} as const;\n\nexport type LanguageCode = (typeof LANGUAGE_CODE)[keyof typeof LANGUAGE_CODE];\n\n/**\n * Represents a video directory.\n * @deprecated Use VideoReadOutView instead. VideoDir is an alias for backward compatibility.\n */\nexport type VideoDir = VideoReadOutView;\n\n\n/**\n * Retrieves a video URL by video key and file name\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/url/{VIDEO_KEY}/{FILE}`\n *\n * @example\n * import { videoAPI } from 'epicenter-libs';\n * const url = await videoAPI.getVideoURLByKey('recording.mp4', 'video-key-123');\n *\n * @param file Name of the file to retrieve\n * @param videoKey Video key identifier\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the video URL\n */\nexport async function getVideoURLByKey(\n file: string,\n videoKey: string,\n optionals: RoutingOptions = {},\n): Promise<string> {\n return await new Router()\n .get(`/video/url/${videoKey}/${file}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Retrieves a video URL by scope, affiliate, family, and file name\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/url/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{AFFILIATE}/{FAMILY}/{FILE}` or GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/url/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{USER_KEY}/{AFFILIATE}/{FAMILY}/{FILE}`\n *\n * @example\n * import { videoAPI } from 'epicenter-libs';\n * const url = await videoAPI.getVideoURLWith(\n * 'recording.mp4',\n * 'my-family',\n * 'DAILY',\n * { scopeBoundary: 'group', scopeKey: 'group-123' },\n * );\n *\n * @param file Name of the file to retrieve\n * @param family Family identifier for the video\n * @param affiliate Video service affiliate (VONAGE, DAILY, or DOMESTIC)\n * @param scope Scope associated with the video\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope\n * @param [scope.userKey] Optional key to scope the video to a user\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the video URL\n */\nexport async function getVideoURLWith(\n file: string,\n family: string,\n affiliate: Affiliate,\n scope: { userKey?: string } & GenericScope,\n optionals: RoutingOptions = {},\n): Promise<string> {\n const { scopeBoundary, scopeKey, userKey } = scope;\n const userKeyURIComponent = userKey ? `/${userKey}` : '';\n return await new Router()\n .get(`/video/url/with/${scopeBoundary}/${scopeKey}${userKeyURIComponent}/${affiliate}/${family}/${file}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Retrieves a video directory by video key\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/dir/{VIDEO_KEY}`\n *\n * @example\n * import { videoAPI } from 'epicenter-libs';\n * const dir = await videoAPI.getVideoDirectoryByKey('video-key-123');\n *\n * @param videoKey Video key identifier\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the video directory information\n */\nexport async function getVideoDirectoryByKey(\n videoKey: string,\n optionals: RoutingOptions = {},\n): Promise<VideoReadOutView> {\n return await new Router()\n .get(`/video/dir/${videoKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Retrieves a video directory by scope, affiliate, and family\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/dir/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{AFFILIATE}/{FAMILY}` or GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/dir/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{USER_KEY}/{AFFILIATE}/{FAMILY}`\n *\n * @example\n * import { videoAPI } from 'epicenter-libs';\n * const dir = await videoAPI.getVideoDirectoryWith(\n * 'my-family',\n * 'DAILY',\n * { scopeBoundary: 'group', scopeKey: 'group-123' },\n * );\n *\n * @param family Family identifier for the video\n * @param affiliate Video service affiliate (VONAGE, DAILY, or DOMESTIC)\n * @param scope Scope associated with the video\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope\n * @param [scope.userKey] Optional key to scope the video to a user\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the video directory information\n */\nexport async function getVideoDirectoryWith(\n family: string,\n affiliate: Affiliate,\n scope: { userKey?: string } & GenericScope,\n optionals: RoutingOptions = {},\n): Promise<VideoReadOutView> {\n const { scopeBoundary, scopeKey, userKey } = scope;\n const userKeyURIComponent = userKey ? `/${userKey}` : '';\n return await new Router()\n .get(`/video/dir/with/${scopeBoundary}/${scopeKey}${userKeyURIComponent}/${affiliate}/${family}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Searches for videos\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/search`\n *\n * @example\n * import { videoAPI } from 'epicenter-libs';\n * const videos = await videoAPI.getVideoSearch();\n *\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a page of videos\n */\nexport async function getVideoSearch(\n optionals: RoutingOptions = {},\n): Promise<Page<VideoReadOutView>> {\n return await new Router()\n .get('/video/search', optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Deletes a video by video key\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/{VIDEO_KEY}`\n *\n * @example\n * import { videoAPI } from 'epicenter-libs';\n * await videoAPI.deleteVideoByKey('video-key-123');\n *\n * @param videoKey Video key identifier\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves when the video is deleted\n */\nexport async function deleteVideoByKey(\n videoKey: string,\n optionals: RoutingOptions = {},\n): Promise<void> {\n return await new Router()\n .delete(`/video/${videoKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Processes a video with specified processors (e.g., transcription)\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/execute/{VIDEO_KEY}`\n *\n * @example\n * import { videoAPI } from 'epicenter-libs';\n * await videoAPI.postVideoProcessor('video-key-123', {\n * processors: [{\n * mediaFormat: 'mp4',\n * languageCode: 'en-US',\n * objectType: 'transcription',\n * }],\n * });\n *\n * @param videoKey Video key identifier\n * @param body Processing configuration\n * @param body.processors Array of processor configurations\n * @param [body.processors[].jobName] Optional name for the processing job\n * @param body.processors[].mediaFormat Media format (mp3, mp4, wav, etc.)\n * @param body.processors[].languageCode Language code for processing (e.g., 'en-US')\n * @param [body.processors[].timeoutMinutes] Optional timeout in minutes\n * @param [body.processors[].mediaFile] Optional specific media file to process\n * @param body.processors[].objectType Processing type (currently 'transcription')\n * @param [body.log] Optional log information\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to true if processing started successfully\n */\nexport async function postVideoProcessor(\n videoKey: string,\n body: {\n processors: {\n jobName?: string;\n mediaFormat: MediaFormat;\n languageCode: LanguageCode;\n timeoutMinutes?: number;\n mediaFile?: string;\n objectType: ProcessingType;\n }[];\n log?: string;\n },\n optionals: RoutingOptions = {},\n): Promise<boolean> {\n return await new Router()\n .post(`/video/execute/${videoKey}`, { body, ...optionals })\n .then(({ body }) => body);\n}\n\n\n/**\n * Downloads a video file by video key and file name\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/download/{VIDEO_KEY}/{FILE}`\n *\n * @example\n * import { videoAPI } from 'epicenter-libs';\n * await videoAPI.downloadVideoByKey('recording.mp4', 'video-key-123');\n *\n * @param file Name of the file to download\n * @param videoKey Video key identifier\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves when the download completes\n */\nexport async function downloadVideoByKey(\n file: string,\n videoKey: string,\n optionals: RoutingOptions = {},\n): Promise<void> {\n return await new Router()\n .get(`/video/download/${videoKey}/${file}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Downloads a video file by scope, affiliate, family, and file name\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/download/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{AFFILIATE}/{FAMILY}/{FILE}` or GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/download/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{USER_KEY}/{AFFILIATE}/{FAMILY}/{FILE}`\n *\n * @example\n * import { videoAPI } from 'epicenter-libs';\n * await videoAPI.downloadVideoWith(\n * 'recording.mp4',\n * 'my-family',\n * 'DAILY',\n * { scopeBoundary: 'group', scopeKey: 'group-123' },\n * );\n *\n * @param file Name of the file to download\n * @param family Family identifier for the video\n * @param affiliate Video service affiliate (VONAGE, DAILY, or DOMESTIC)\n * @param scope Scope associated with the video\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope\n * @param [scope.userKey] Optional key to scope the video to a user\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves when the download completes\n */\nexport async function downloadVideoWith(\n file: string,\n family: string,\n affiliate: Affiliate,\n scope: { userKey?: string } & GenericScope,\n optionals: RoutingOptions = {},\n): Promise<void> {\n const { scopeBoundary, scopeKey, userKey } = scope;\n const userKeyURIComponent = userKey ? `/${userKey}` : '';\n return await new Router()\n .get(`/video/download/with/${scopeBoundary}/${scopeKey}${userKeyURIComponent}/${affiliate}/${family}/${file}`, optionals)\n .then(({ body }) => body);\n}\n","import type { Page, RoutingOptions } from '../utils/router';\nimport type { GenericScope, GenericSearchOptions } from '../utils/constants';\nimport type { VideoReadOutView, Affiliate, ProcessingType, MediaFormat, LanguageCode } from '../apis/video';\n\nimport EpicenterError from '../utils/error';\nimport { parseFilterInput } from '../utils/filter-parser';\nimport * as videoAPI from '../apis/video';\n\n\n/**\n * Deletes a video (and its associated files)\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/{VIDEO_KEY}`\n *\n * @example\n * import { videoAdapter } from 'epicenter-libs';\n * await videoAdapter.remove(videoKey);\n *\n * @param videoKey Video key\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to undefined when successful\n */\nexport async function remove(\n videoKey: string,\n optionals: RoutingOptions = {},\n): Promise<void> {\n return videoAPI.deleteVideoByKey(videoKey, optionals);\n}\n\n\n/**\n * Open search for video objects\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/search`\n *\n * @example\n * import { videoAdapter } from 'epicenter-libs';\n * const videos = await videoAdapter.query({\n * filter: [\n * 'affiliate=VONAGE', // searches for videos provided by the Vonage affiliate\n * 'episodeName=myEpisode', // searches for videos tied to the episode with name 'myEpisode'\n * 'created>=2022-01-03T20:30:53.054Z', // searches for videos created after Jan 3rd 2022\n * ],\n * sort: ['+video.created'], // sort all findings by the 'created' field (ascending)\n * first: 0,\n * max: 25,\n * });\n *\n * @param searchOptions Search options\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a page of video objects\n */\nexport async function query(\n searchOptions: GenericSearchOptions,\n optionals: RoutingOptions = {},\n): Promise<Page<VideoReadOutView>> {\n const { filter, sort = [], first, max } = searchOptions;\n\n const searchParams = {\n filter: parseFilterInput(filter),\n sort: sort.join(';') || undefined,\n first, max,\n };\n\n return videoAPI.getVideoSearch({\n query: searchParams,\n paginated: true,\n ...optionals,\n });\n}\n\n\n/**\n * Gets a URL for a video file\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/url/{VIDEO_KEY}/{FILE}` or GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/url/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{AFFILIATE}/{FAMILY}/{FILE}`\n *\n * @example\n * import { videoAdapter } from 'epicenter-libs';\n *\n * // get using video key\n * videoAdapter.getURL('archive.mp4', {\n * videoKey: '0000017e31bb902cfe17615867d5005c5d5f',\n * });\n *\n * // get using scope/affiliate/family\n * videoAdapter.getURL('archive.mp4', {\n * scope: {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * },\n * affiliate: 'VONAGE',\n * family: 'archiveName'\n * });\n *\n * @param file Name of the file\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.scope] Scope object\n * @param [optionals.scope.scopeBoundary] Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param [optionals.scope.scopeKey] Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [optionals.scope.userKey] User attached to scope if necessary\n * @param [optionals.affiliate] Affiliate -- only support for one for now: Vonage\n * @param [optionals.family] Identifier for the resourced provided by the affiliate (in the case of Vonage, this is the archive name).\n * @param [optionals.videoKey] Key for the video object\n * @returns promise that resolves to the URL string for the video file\n */\nexport async function getURL(\n file: string,\n optionals: {\n scope?: { userKey?: string } & GenericScope;\n affiliate?: Affiliate;\n family?: string;\n videoKey?: string;\n } & RoutingOptions = {},\n): Promise<string> {\n const { scope, affiliate, family, videoKey, ...routingOptions } = optionals;\n if (scope && family && affiliate) {\n return videoAPI.getVideoURLWith(file, family, affiliate, scope, routingOptions);\n }\n if (videoKey) {\n return videoAPI.getVideoURLByKey(file, videoKey, routingOptions);\n }\n throw new EpicenterError('Cannot get video URL -- either a video key or scope/affiliate/family specification is required.');\n}\n\n\n/**\n * Gets a directory URL for a video file\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/dir/{VIDEO_KEY}` or GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/dir/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{AFFILIATE}/{FAMILY}`\n *\n * @example\n * import { videoAdapter } from 'epicenter-libs';\n *\n * // get using video key\n * videoAdapter.getDirectoryURL({\n * videoKey: '0000017e31bb902cfe17615867d5005c5d5f',\n * });\n *\n * // get using scope/affiliate/family\n * videoAdapter.getDirectoryURL({\n * scope: {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * },\n * affiliate: 'VONAGE',\n * family: 'archiveName'\n * });\n *\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.scope] Scope object\n * @param [optionals.scope.scopeBoundary] Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param [optionals.scope.scopeKey] Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [optionals.scope.userKey] User attached to scope if necessary\n * @param [optionals.affiliate] Affiliate -- only support for one for now: Vonage\n * @param [optionals.family] Identifier for the resourced provided by the affiliate (in the case of Vonage, this is the archive name).\n * @param [optionals.videoKey] Key for the video object\n * @returns promise that resolves to a video directory object containing file list and metadata\n */\nexport async function getDirectoryURL(\n optionals: {\n scope?: { userKey?: string } & GenericScope;\n affiliate?: Affiliate;\n family?: string;\n videoKey?: string;\n } & RoutingOptions = {},\n): Promise<VideoReadOutView> {\n const { scope, affiliate, family, videoKey, ...routingOptions } = optionals;\n if (scope && family && affiliate) {\n return videoAPI.getVideoDirectoryWith(family, affiliate, scope, routingOptions);\n }\n if (videoKey) {\n return videoAPI.getVideoDirectoryByKey(videoKey, routingOptions);\n }\n throw new EpicenterError('Cannot get video URL -- either a video key or scope/affiliate/family specification is required.');\n}\n\n\n/**\n * Processes a video (one example of this is transcribing a video)\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/execute/{VIDEO_KEY}`\n *\n * @example\n * const processors = [\n * {\n * mediaFormat: 'mp4',\n * languageCode: 'en-US',\n * objectType: 'transcription',\n * mediaFile: 'archive.mp4',\n * jobName: 'test-transcription',\n * },\n * ];\n * await videoAdapter.processVideo(videoKey, processors);\n *\n * @param videoKey Video key\n * @param [processors[]] List of processes to complete\n * @param [processors[].jobName] A string to specify the title of the newly file\n * @param [processors[].mediaFormat] The format of the file you are processing\n * @param [processors[].languageCode] The language which the video is recorded in\n * @param [processors[].timeoutMinutes] Optional- how long to wait before the call cancels out; defaults to 3 minutes\n * @param [processors[].mediaFile] The name of the media file to perform the process on\n * @param [processors[].objectType] The type of processing job to perform (currently limited to transcribe)\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @param [optionals.log] Name for log file\n * @returns promise that resolves to a boolean indicating success\n */\nexport async function processVideo(\n videoKey: string,\n processors: {\n jobName: string;\n mediaFormat: MediaFormat;\n languageCode: LanguageCode;\n timeoutMinutes?: number;\n mediaFile: string;\n objectType: ProcessingType;\n }[],\n optionals: {\n log?: string;\n } & RoutingOptions = {},\n): Promise<boolean> {\n const { log, ...routingOptions } = optionals;\n const body = {\n processors,\n log,\n };\n return videoAPI.postVideoProcessor(videoKey, body, routingOptions);\n}\n\n\n/**\n * Downloads a video file\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/download/{VIDEO_KEY}/{FILE}` or GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/video/download/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{AFFILIATE}/{FAMILY}/{FILE}`\n *\n * @example\n * import { videoAdapter } from 'epicenter-libs';\n * // download using video key\n * await videoAdapter.download('archive.mp4', {\n * videoKey: '0000017e31bb902cfe17615867d5005c5d5f',\n * });\n * // download using scope/affiliate/family\n * await videoAdapter.download('archive.mp4', {\n * scope: {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * },\n * affiliate: 'VONAGE',\n * family: 'archiveName'\n * });\n *\n * @param file Name of the file\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.scope] Scope object\n * @param [optionals.scope.scopeBoundary] Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param [optionals.scope.scopeKey] Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [optionals.scope.userKey] User attached to scope if necessary\n * @param [optionals.affiliate] Affiliate -- only support for one for now: Vonage\n * @param [optionals.family] Identifier for the resourced provided by the affiliate (in the case of Vonage, this is the archive name).\n * @param [optionals.videoKey] Key for the video object\n * @returns promise that resolves to undefined when download is complete\n */\nexport async function download(\n file: string,\n optionals: {\n scope?: { userKey?: string } & GenericScope;\n affiliate?: Affiliate;\n family?: string;\n videoKey?: string;\n } & RoutingOptions = {},\n): Promise<void> {\n const { scope, affiliate, family, videoKey, ...routingOptions } = optionals;\n if (scope && family && affiliate) {\n return videoAPI.downloadVideoWith(file, family, affiliate, scope, routingOptions);\n }\n if (videoKey) {\n return videoAPI.downloadVideoByKey(file, videoKey, routingOptions);\n }\n throw new EpicenterError('Cannot download video -- either a video key or scope/affiliate/family specification is required.');\n}\n","import type { GenericScope, Permit } from '../utils/constants';\nimport type { RoutingOptions } from '../utils/router';\n\nimport Router from '../utils/router';\n\n\nexport type SessionID = string;\nexport type ArchiveID = string;\nexport type APIKey = string;\nexport type Token = string;\nexport interface VonageSession {\n sessionId: SessionID;\n}\nexport interface VonageArchive {\n archiveId: string;\n status:\n | 'available'\n | 'deleted'\n | 'failed'\n | 'paused'\n | 'started'\n | 'stopped'\n | 'uploaded'\n | 'expired';\n}\n\n\n/**\n * Retrieves a Vonage session ID\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vonage/session`\n *\n * @example\n * import { vonageAPI } from 'epicenter-libs';\n * const session = await vonageAPI.getSession();\n * console.log(session.sessionId);\n *\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to an object containing the Vonage session ID\n */\nexport async function getSession(\n optionals: RoutingOptions = {},\n): Promise<{ sessionId: SessionID }> {\n return await new Router()\n .get('/vonage/session', optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Creates a token for a Vonage session\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vonage/token`\n *\n * @example\n * import { vonageAPI } from 'epicenter-libs';\n * const token = await vonageAPI.postToken({ sessionId: 'my-session-id' });\n * console.log(token.token);\n *\n * @param body Token request body\n * @param body.sessionId The Vonage session ID to create a token for\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to an object containing the Vonage token\n */\nexport async function postToken(\n body: { sessionId: string },\n optionals: RoutingOptions = {},\n): Promise<{ token: Token }> {\n return await new Router()\n // The initialLayoutClassList is a temporary fix for existing simulations;\n // This should likely be implemented differently if we decide to continue using Vonage;\n // We are currently investigating alternatives due to performance issues, so this solution just prevents API errors;\n .post('/vonage/token', { body: { ...body, initialLayoutClassList: ['placeholder'] }, ...optionals })\n .then(({ body }) => body);\n}\n\n\n/**\n * Creates an archive for a Vonage session\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vonage/archive`\n *\n * @example\n * import { vonageAPI } from 'epicenter-libs';\n * const archive = await vonageAPI.postArchive({\n * name: 'my-archive',\n * scope: { scopeBoundary: 'group', scopeKey: 'group-123' },\n * sessionId: 'session-id',\n * });\n *\n * @param body Archive configuration\n * @param body.name Name for the archive\n * @param body.scope Scope associated with the archive\n * @param body.scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param body.scope.scopeKey Scope key, a unique identifier tied to the scope\n * @param [body.scope.userKey] Optional key to scope the archive to a user\n * @param body.sessionId The Vonage session ID to archive\n * @param [body.permit] Optional permissions for the archive\n * @param [body.ttlSeconds] Time to live in seconds for the archive\n * @param [body.resolution] Resolution for the archive\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the created Vonage archive\n */\nexport async function postArchive(\n body: {\n name: string;\n scope: { userKey?: string } & GenericScope;\n sessionId: SessionID;\n permit?: Permit;\n ttlSeconds?: number;\n resolution?: string;\n },\n optionals: RoutingOptions = {},\n): Promise<VonageArchive> {\n return await new Router()\n .post('/vonage/archive', { body, ...optionals })\n .then(({ body }) => body);\n}\n\n\n/**\n * Retrieves Vonage API key information\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vonage/info`\n *\n * @example\n * import { vonageAPI } from 'epicenter-libs';\n * const info = await vonageAPI.getInfo();\n * console.log(info.apiKey);\n *\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to an object containing the Vonage API key\n */\nexport async function getInfo(\n optionals: RoutingOptions = {},\n): Promise<{ apiKey: APIKey }> {\n return await new Router()\n .get('/vonage/info', optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Deletes a Vonage archive by its ID\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vonage/archive/{ARCHIVE_ID}`\n *\n * @example\n * import { vonageAPI } from 'epicenter-libs';\n * await vonageAPI.deleteArchiveByID('archive-123');\n *\n * @param archiveID The ID of the archive to delete\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the deleted Vonage archive\n */\nexport async function deleteArchiveByID(\n archiveID: string,\n optionals: RoutingOptions = {},\n): Promise<VonageArchive> {\n return await new Router()\n .delete(`/vonage/archive/${archiveID}`, optionals)\n .then(({ body }) => body);\n}\n","import type { RoutingOptions } from '../utils/router';\nimport type { GenericScope } from '../utils/constants';\nimport type { APIKey, SessionID, Token, ArchiveID, VonageArchive, VonageSession } from '../apis/vonage';\n\nimport { ROLE } from '../utils/constants';\nimport * as vonageAPI from '../apis/vonage';\n\n\n/**\n * Gets the Vonage project ID (not to be confused with the Epicenter project). Used to initialize the session object on the client side\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vonage/info`\n *\n * @example\n * import OT from '@opentok/client';\n * import { vonageAdapter } from 'epicenter-libs';\n * const [sessionID, projectID] = await Promise.all([\n * vonageAdapter.createSession(),\n * vonageAdapter.getProjectID()\n * ]);\n * const vonageSession = OT.initSession(projectID, sessionID);\n *\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the Vonage project ID (otherwise known as the Vonage API key)\n */\nexport async function getProjectID(\n optionals: RoutingOptions = {},\n): Promise<APIKey> {\n return (await vonageAPI.getInfo(optionals)).apiKey;\n}\n\n\n/**\n * Calls the server SDK call for creating a session. Used to create a session object on the client side.\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vonage/session`\n *\n * @example\n * import OT from '@opentok/client';\n * import { vonageAdapter } from 'epicenter-libs';\n * const [sessionID, projectID] = await Promise.all([\n * vonageAdapter.createSession(),\n * vonageAdapter.getProjectID()\n * ]);\n * const vonageSession = OT.initSession(projectID, sessionID);\n *\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to an object containing the Vonage session ID\n */\nexport async function createSession(\n optionals: RoutingOptions = {},\n): Promise<VonageSession> {\n return vonageAPI.getSession(optionals);\n}\n\n\n/**\n * Creates a Vonage session token, used to connect a session.\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vonage/token`\n *\n * @example\n * import { vonageAdapter } from 'epicenter-libs';\n * const token = await vonageAdapter.generateToken('2_MX40NzQ...Y1TnZ-fg');\n * vonageSession.connect(token);\n *\n * @param sessionID ID of the session you're expecting to connect to using the token\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a Vonage session token\n */\nexport async function generateToken(\n sessionID: SessionID,\n optionals: RoutingOptions = {},\n): Promise<Token> {\n return (await vonageAPI.postToken({ sessionId: sessionID }, optionals)).token;\n}\n\n\n/**\n * Starts a Vonage archive -- a user recording of a Vonage session\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vonage/archive`\n *\n * @example\n * import { authAdapter, vonageAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const session = authAdapter.getLocalSession();\n * vonageAdapter.startArchive('my-archive', '2_MX40NzQ...Y1TnZ-fg', {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: session.groupKey,\n * })\n *\n * @param name Name of the archive; for your own purposes\n * @param sessionID ID of the session you're creating an archive for\n * @param scope Scope attached to the archive\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [scope.userKey] User key, to attach a user to the scope\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.readLock] Read permission role; one of the strings defined in ROLE\n * @param [optionals.writeLock] Write permission role; one of the strings defined in ROLE\n * @param [optionals.resolution] Video resolution the archive should be recorded at -- string like '1920x1080'\n * @param [optionals.ttlSeconds] Life span of the archive (how long before it is deleted); defaults to 604,800 (1 week), max of 31,536,000 (1 year)\n * @returns promise that resolves to an object containing the archive ID and status\n */\nexport async function startArchive(\n name: string,\n sessionID: SessionID,\n scope: { userKey?: string } & GenericScope,\n optionals: {\n readLock?: keyof typeof ROLE;\n writeLock?: keyof typeof ROLE;\n resolution?: string;\n ttlSeconds?: number;\n } & RoutingOptions = {},\n): Promise<VonageArchive> {\n const { readLock, writeLock, ttlSeconds, resolution, ...routingOptions } = optionals;\n const { PARTICIPANT, USER } = ROLE;\n const defaultLock = scope.userKey ? USER : PARTICIPANT;\n\n return vonageAPI.postArchive({\n name,\n sessionId: sessionID,\n scope,\n permit: {\n readLock: readLock ?? defaultLock,\n writeLock: writeLock ?? defaultLock,\n },\n ttlSeconds,\n resolution,\n }, routingOptions);\n}\n\n\n/**\n * Stops a Vonage archive -- begins the serialization process for a recording\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/vonage/archive/{ARCHIVE_ID}`\n *\n * @example\n * import { vonageAdapter } from 'epicenter-libs';\n * vonageAdapter.stopArchive('004355...ede770e39');\n *\n * @param archiveID ID of the archive to stop\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to an object containing the archive ID and status (which should be \"stopped\")\n */\nexport async function stopArchive(\n archiveID: ArchiveID,\n optionals: RoutingOptions = {},\n): Promise<VonageArchive> {\n return vonageAPI.deleteArchiveByID(archiveID, optionals);\n}\n","import type { UserSession } from '../utils/identification';\nimport type { RoutingOptions } from '../utils/router';\nimport type { GenericScope } from '../utils/constants';\nimport type { PseudonymReadOutView } from './user';\n\nimport { Router, identification, SCOPE_BOUNDARY } from '../utils';\n\n// Generic type parameter for world role names\nexport type WorldRole = string;\n\nexport const OBJECTIVE = {\n MINIMUM: 'MINIMUM',\n MAXIMUM: 'MAXIMUM',\n MARGINAL: 'MARGINAL',\n OPTIMAL: 'OPTIMAL',\n} as const;\n\nexport type Objective = (typeof OBJECTIVE)[keyof typeof OBJECTIVE];\n\nexport type OrbitType = 'GROUP' | 'EPISODE';\n\nexport const WORLD_NAME_GENERATOR_TYPE = {\n colorAnimal: 'colorAnimal',\n sequential: 'sequential',\n} as const;\n\nexport type WorldNameGeneratorType = (typeof WORLD_NAME_GENERATOR_TYPE)[keyof typeof WORLD_NAME_GENERATOR_TYPE];\n\nexport interface ColorAnimalWorldNameGenerator {\n objectType: 'colorAnimal';\n}\n\nexport interface SequentialWorldNameGenerator {\n objectType: 'sequential';\n prefix?: string;\n}\n\nexport type WorldNameGenerator =\n | ColorAnimalWorldNameGenerator\n | SequentialWorldNameGenerator;\n\nexport interface AssignmentReadOutView<R extends WorldRole = WorldRole> {\n role: R;\n user: PseudonymReadOutView;\n}\n\nexport interface PersonaReadOutView<R extends WorldRole = WorldRole> {\n role: R;\n minimum?: number;\n maximum?: number;\n marginal?: number;\n insertionOrder?: number;\n}\n\nexport interface WorldReadOutView<R extends WorldRole = WorldRole> {\n lastUpdated: string;\n personae: PersonaReadOutView<R>[];\n assignments: AssignmentReadOutView<R>[];\n orbitKey: string;\n worldKey: string;\n created: string;\n orbitType: OrbitType;\n runKey: string;\n displayName: string;\n allowChannel: boolean;\n name: string;\n room: string;\n}\n\nexport interface AssignmentCreateInView<R extends WorldRole = WorldRole> {\n role?: R;\n userKey: string;\n}\n\nexport interface PersonaCreateInView<R extends WorldRole = WorldRole> {\n role: R;\n minimum?: number;\n maximum?: number;\n marginal?: number;\n insertionOrder?: number;\n}\n\ntype WorldKey = string;\nexport type AssignmentMap<R extends WorldRole = WorldRole> = Record<WorldKey, AssignmentCreateInView<R>[]>;\n\n/**\n * Updates fields for a particular world\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/world/{WORLD_KEY}`\n *\n * @example\n * import { worldAdapter } from 'epicenter-libs';\n * await worldAdapter.update('0000017a445032dc38cb2cecd5fc13708314', { runKey: '0000018d61f1217b22ce0ae605ff00609f5e', displayName: 'World A1' });\n *\n * @param worldKey Key associated with world\n * @param update Attributes you wish to update\n * @param [update.displayName] Display name of the world\n * @param [update.runKey] Key for the run you want to attach to the world\n * @param [update.allowChannel] Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the world with updated attributes\n */\nexport async function update<R extends WorldRole = WorldRole>(\n worldKey: string,\n update: {\n displayName?: string;\n runKey?: string;\n allowChannel?: boolean;\n },\n optionals: RoutingOptions = {},\n): Promise<WorldReadOutView<R>> {\n const {\n displayName,\n runKey,\n allowChannel,\n } = update;\n\n return await new Router()\n .patch(`/world/${worldKey}`, {\n body: {\n displayName,\n runKey,\n allowChannel,\n },\n ...optionals,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Deletes a world\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/world/{WORLD_KEY}`\n *\n * @example\n * import { worldAdapter } from 'epicenter-libs';\n * await worldAdapter.destroy('0000017a445032dc38cb2cecd5fc13708314');\n *\n * @param worldKey Key associated with world\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to undefined when successful\n */\nexport async function destroy(\n worldKey: string,\n optionals: RoutingOptions = {},\n): Promise<void> {\n return await new Router()\n .delete(`/world/${worldKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Creates a world\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/world/{GROUP_NAME}`\n *\n * @example\n * import { worldAdapter } from 'epicenter-libs';\n * await worldAdapter.create({ name: 'Whole New World' });\n *\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.name] Name of the new world (if omitted one will be provided by Epicenter). Must be unique within the world's scope.\n * @param [optionals.displayName] Display name of the new world\n * @param [optionals.groupName] Name of the group (defaults to name of group associated with session)\n * @param [optionals.episodeName] Name of the episode for episode scoping\n * @param [optionals.worldNameGenerator] Specifies how world names are generated\n * @param [optionals.worldNameGenerator.objectType] Can be either colorAnimal or sequential\n * @param [optionals.allowChannel] Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT\n * @returns promise that resolves to the newly created world\n */\nexport async function create<R extends WorldRole = WorldRole>(\n optionals: {\n name?: string;\n displayName?: string;\n groupName?: string;\n episodeName?: string;\n worldNameGenerator?: WorldNameGenerator;\n allowChannel?: boolean;\n } & RoutingOptions = {},\n): Promise<WorldReadOutView<R>> {\n const {\n name,\n displayName,\n groupName,\n episodeName,\n worldNameGenerator,\n allowChannel,\n ...routingOptions\n } = optionals;\n const session = identification.session as UserSession;\n return await new Router()\n .post(`/world/${groupName ?? session?.groupName}${episodeName ? `/${episodeName}` : ''}`, {\n body: {\n name,\n worldNameGenerator,\n displayName,\n allowChannel,\n },\n ...routingOptions,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Fetches the worlds in a group or episode if specified\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/world/{GROUP_NAME}`\n *\n * @example\n * // Gets all the worlds in the group attached to the session\n * import { worldAdapter } from 'epicenter-libs';\n * await worldAdapter.get();\n * // Gets all the worlds in the group attached to the session that the user is assigned to\n * import { worldAdapter } from 'epicenter-libs';\n * await worldAdapter.get({ mine: true });\n *\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.groupName] Name of the group (defaults to name of group associated with session)\n * @param [optionals.episodeName] Name of the episode for episode scoped worlds\n * @param [optionals.mine] Flag for indicating to get only the worlds the requesting user is in (based on session token)\n * @returns promise that resolves to a list of worlds\n */\nexport async function get<R extends WorldRole = WorldRole>(\n optionals: {\n groupName?: string;\n episodeName?: string;\n mine?: boolean;\n } & RoutingOptions = {},\n): Promise<WorldReadOutView<R>[]> {\n const {\n groupName, episodeName, mine,\n ...routingOptions\n } = optionals;\n const session = identification.session as UserSession;\n return await new Router()\n .withSearchParams({ mine })\n .get(`/world/${groupName ?? session?.groupName}${episodeName ? `/${episodeName}` : ''}`, routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Fetches the assignments (plus some world info) in a group or episode if specified\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/world/assignment/for/{GROUP_NAME}`\n *\n * @example\n * import { worldAdapter } from 'epicenter-libs';\n * worldAdapter.getAssignments({ mine: true });\n *\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.groupName] Name of the group (defaults to name of group associated with session)\n * @param [optionals.episodeName] Name of the episode for episode scoped worlds\n * @param [optionals.mine] Flag for indicating to get only the worlds the requesting user is in (based on session token)\n * @returns promise that resolves to a list of worlds the user is assigned to\n */\nexport async function getAssignments<R extends WorldRole = WorldRole>(\n optionals: {\n groupName?: string;\n episodeName?: string;\n mine?: boolean;\n } & RoutingOptions = {},\n): Promise<WorldReadOutView<R>[]> {\n const {\n groupName, episodeName, mine,\n ...routingOptions\n } = optionals;\n const session = identification.session as UserSession;\n return await new Router()\n .withSearchParams({ mine })\n .get(`/world/assignment/for/${groupName ?? session?.groupName}${episodeName ? `/${episodeName}` : ''}`, routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Fetches all worlds assigned to the current session's user\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/world/assignment`\n *\n * @example\n * import { worldAdapter } from 'epicenter-libs';\n * const worlds = await worldAdapter.getSessionWorlds();\n *\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to an array of worlds assigned to the current user\n */\nexport async function getSessionWorlds<R extends WorldRole = WorldRole>(\n optionals: RoutingOptions = {},\n): Promise<WorldReadOutView<R>[]> {\n return await new Router()\n .get('/world/assignment', optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Automatically assigns the current session's user a world\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/world/assignment`\n *\n * @example\n * // Assigns user to a group-scoped world\n * import { worldAdapter } from 'epicenter-libs';\n * await worldAdapter.selfAssign();\n * // Assigns user to a group-scoped world with role \"cartographer\"\n * import { worldAdapter } from 'epicenter-libs';\n * await worldAdapter.selfAssign({ role: 'cartographer' });\n * // Assigns user to an episode-scoped world with role \"cartographer\"\n * import { worldAdapter } from 'epicenter-libs';\n * await worldAdapter.selfAssign({ role: 'cartographer', episodeName: 'my-episode-name' });\n *\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.role] Role constraint -- will put the user in a world with a role\n * @param [optionals.groupName] Name of the group (defaults to name of group associated with session)\n * @param [optionals.episodeName] Name of the episode for episode scoped worlds\n * @param [optionals.objective] Allows platform to assign users beyond minimum amount\n * @param [optionals.worldNameGenerator] Specifies how world names are generated\n * @param [optionals.worldNameGenerator.objectType] Can be either colorAnimal or sequential\n * @param [optionals.populace] List of role description objects (personas) to dictate the self assignment\n * @param [optionals.populace[].role] Name of the role\n * @param [optionals.populace[].minimum] The minimum number of users that required for this role\n * @param [optionals.populace[].maximum] The maximum number of users that can be assigned to this role\n * @param [optionals.populace[].marginal] The maximum number of users that can be assigned to this role when using objective MARGINAL\n * @param [optionals.allowChannel] Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT\n * @returns promise that resolves to the world the user was assigned to\n */\nexport async function selfAssign<R extends WorldRole = WorldRole>(\n optionals: {\n role?: R;\n groupName?: string;\n episodeName?: string;\n objective?: keyof typeof OBJECTIVE;\n worldNameGenerator?: WorldNameGenerator;\n populace?: PersonaCreateInView<R>[];\n allowChannel?: boolean;\n } & RoutingOptions = {},\n): Promise<WorldReadOutView<R>> {\n const {\n role,\n groupName,\n episodeName,\n objective = OBJECTIVE.MINIMUM,\n worldNameGenerator,\n populace,\n allowChannel,\n ...routingOptions\n } = optionals;\n const session = identification.session as UserSession;\n return await new Router()\n .post(`/world/selfassign/${groupName ?? session?.groupName}${episodeName ? `/${episodeName}` : ''}`, {\n body: { role, objective, worldNameGenerator, populace, allowChannel },\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * (Auto assign) -- makes worlds given a list of users.\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/world/assignment`\n *\n * @example\n * import { worldAdapter } from 'epicenter-libs';\n * const worlds = await worldAdapter.assignUsers([\n * { userKey: '000001796733eef0842f4d6d960997018a43', role: 'locksmith' },\n * { userKey: '000001796733eef0842f4d6d960997018a3b' },\n * ]);\n *\n * @param assignments List of users assignment objects\n * @param assignments[].userKey User key\n * @param [assignments[].role] Role to assign to the user\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.role] Role constraint -- will put the user in a world with a role\n * @param [optionals.groupName] Name of the group (defaults to name of group associated with session)\n * @param [optionals.episodeName] Name of the episode for episode scoped worlds\n * @param [optionals.objective] Allows platform to assign users beyond minimum amount\n * @param [optionals.requireAllAssignments] Have the server return w/ an error whenever an assignment was not made (instead of silently leaving the user as unassigned)\n * @param [optionals.keepEmptyWorlds] Specify whether worlds that are now empty should be deleted\n * @param [optionals.worldNameGenerator] Specifies how world names are generated\n * @param [optionals.worldNameGenerator.objectType] Can be either colorAnimal or sequential\n * @param [optionals.populace] List of role description objects (personas) to use while creating assignments\n * @param [optionals.populace[].role] Name of the role\n * @param [optionals.populace[].minimum] The minimum number of users that required for this role\n * @param [optionals.populace[].maximum] The maximum number of users that can be assigned to this role\n * @param [optionals.populace[].marginal] The maximum number of users that can be assigned to this role when using objective MARGINAL\n * @param [optionals.allowChannel] Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT\n * @returns promise that resolves to the list of worlds created by the assignment\n */\nexport async function autoAssignUsers<R extends WorldRole = WorldRole>(\n assignments: AssignmentCreateInView<R>[],\n optionals: {\n groupName?: string;\n episodeName?: string;\n objective?: keyof typeof OBJECTIVE;\n worldNameGenerator?: WorldNameGenerator;\n requireAllAssignments?: boolean;\n keepEmptyWorlds?: boolean;\n populace?: PersonaCreateInView<R>[];\n allowChannel?: boolean;\n } & RoutingOptions = {},\n): Promise<WorldReadOutView<R>[]> {\n const {\n groupName,\n episodeName,\n objective = OBJECTIVE.MINIMUM,\n requireAllAssignments,\n worldNameGenerator,\n keepEmptyWorlds,\n populace,\n allowChannel,\n ...routingOptions\n } = optionals;\n const session = identification.session as UserSession;\n return await new Router()\n .post(`/world/assignment/${groupName ?? session?.groupName}${episodeName ? `/${episodeName}` : ''}`, {\n body: {\n assignments,\n objective,\n requireAllAssignments,\n worldNameGenerator,\n keepEmptyWorlds,\n populace,\n allowChannel,\n },\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Edits assignments across specified worlds\n * Base URL: PUT `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/world/assignment/{GROUP_NAME}`\n *\n * @example\n * import { worldAdapter } from 'epicenter-libs';\n * const updatedWorlds = await worldAdapter.editAssignments({\n * '0000017a445032dc38cb2cecd5fc13708314': [\n * { userKey: '000001796733eef0842f4d6d960997018a43', role: 'locksmith' },\n * { userKey: '000001796733eef0842f4d6d960997018a3b' },\n * ],\n * '0000017a445032dc38cb2cecd5fc13708315': [\n * { userKey: '000001796733eef0842f4d6d960997018a4c', role: 'navigator' },\n * ],\n * });\n *\n * @param assignments Map of world keys to list of user assignment objects\n * @param assignments[].userKey User key\n * @param [assignments[].role] Role to assign to the user\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.groupName] Name of the group (defaults to name of group associated with session)\n * @param [optionals.episodeName] Name of the episode for episode scoped worlds\n * @param [optionals.objective] Allows platform to assign users beyond minimum amount\n * @param [optionals.requireAllAssignments] Have the server return w/ an error whenever an assignment was not made (instead of silently leaving the user as unassigned)\n * @param [optionals.keepEmptyWorlds] Specify whether worlds that are now empty should be deleted\n * @returns promise that resolves to the list of worlds updated by the assignment\n */\nexport async function editAssignments<R extends WorldRole = WorldRole>(\n assignments: AssignmentMap<R>,\n optionals: {\n groupName?: string;\n episodeName?: string;\n objective?: keyof typeof OBJECTIVE;\n keepEmptyWorlds?: boolean;\n requireAllAssignments?: boolean;\n } & RoutingOptions = {},\n): Promise<WorldReadOutView<R>[]> {\n const {\n groupName, episodeName, objective = OBJECTIVE.MINIMUM, requireAllAssignments, keepEmptyWorlds,\n ...routingOptions\n } = optionals;\n const session = identification.session as UserSession;\n return await new Router()\n .put(`/world/assignment/${groupName ?? session?.groupName}${episodeName ? `/${episodeName}` : ''}`, {\n body: { assignments, objective, requireAllAssignments, keepEmptyWorlds },\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Retrieves the current assignment information for a given world\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/world/assignment/{WORLD_KEY}`\n *\n * @example\n * import { worldAdapter } from 'epicenter-libs';\n * const assignments = await worldAdapter.getAssignmentsByKey(world.worldKey);\n *\n * @param worldKey Key associated with the world\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the world containing the assignment object\n */\nexport async function getAssignmentsByKey<R extends WorldRole = WorldRole>(\n worldKey: string,\n optionals: RoutingOptions = {},\n): Promise<WorldReadOutView<R>> {\n return await new Router()\n .get(`/world/assignment/${worldKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Removes a user or list of users from all worlds in a given group or episode. Any worlds that do not contain users within them will be automatically deleted in the process.\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/world/assignment/{GROUP_NAME}`\n *\n * @example\n * import { worldAdapter } from 'epicenter-libs';\n * await worldAdapter.removeUser(user.userKey);\n *\n * @param userKeys List of keys associated with users to remove from worlds\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.groupName] Name of the group (defaults to name of group associated with session)\n * @param [optionals.episodeName] Name of the episode for episode scoped worlds\n * @param [optionals.keepEmptyWorlds] If the unassignment results in an empty world, whether to delete it\n * @returns promise that resolves to undefined when successful\n */\nexport async function removeUsers(\n userKeys: string[],\n optionals: {\n groupName?: string;\n episodeName?: string;\n keepEmptyWorlds?: boolean;\n } & RoutingOptions = {},\n): Promise<void> {\n const {\n groupName, episodeName, keepEmptyWorlds,\n ...routingOptions\n } = optionals;\n const session = identification.session as UserSession;\n return await new Router()\n .withSearchParams({ userKey: userKeys, keepEmptyWorlds: Boolean(keepEmptyWorlds) })\n .delete(`/world/assignment/${groupName ?? session?.groupName}${episodeName ? `/${episodeName}` : ''}`, routingOptions)\n .then(({ body }) => body);\n}\n\n\n/**\n * Gets the personas of a given scope (project, group, episode, world). Personas correspond to a role that a user in the world can be assigned to.\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/world/persona/{SCOPE_BOUNDARY}/{SCOPE_KEY}`\n *\n * @example\n * import { worldAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * await worldAdapter.getPersonas({\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * });\n *\n * @param scope Scope associated with the persona set (by default the scope used will be the current project). Use this to do any specific overrides.\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to an array of personas for the specified scope\n */\nexport async function getPersonas<R extends WorldRole = WorldRole>(\n scope: GenericScope,\n optionals: RoutingOptions = {},\n): Promise<PersonaReadOutView<R>[]> {\n const { scopeBoundary, scopeKey } = scope;\n const boundary = scopeBoundary || SCOPE_BOUNDARY.PROJECT;\n /* We will at some point remove the need to explicitly lower case this */\n const boundaryComponent = boundary === SCOPE_BOUNDARY.WORLD ? '' : `/${boundary.toLowerCase()}`;\n const scopeKeyComponent = boundary === SCOPE_BOUNDARY.PROJECT ? '' : `/${scopeKey}`;\n const uriComponent = `${boundaryComponent}${scopeKeyComponent}`;\n\n return await new Router()\n .get(`/world/persona${uriComponent}`, {\n ...optionals,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Sets the personas of a given scope (project, group, episode, world). Personas correspond to a role a user in the world can be assigned to.\n * A null value for minimum is 0, but a null maximum is uncapped. A null marginal defaults to maximum. Personas with greater specificity override more general ones (which are by default PROJECT scoped).\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/world/persona/{SCOPE_BOUNDARY}/{SCOPE_KEY}`\n *\n * @example\n * import { worldAdapter } from 'epicenter-libs';\n * const scope = {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * };\n * const personas = [\n * { role: 'leader', minimum: 1 },\n * ];\n * await worldAdapter.setPersonas(personas, scope);\n *\n * @param personas List of role description objects (personas)\n * @param personas[].role Name of the role\n * @param [personas[].minimum] The minimum number of users that required for this role\n * @param [personas[].maximum] The maximum number of users that can be assigned to this role\n * @param [personas[].marginal] The maximum number of users that can be assigned to this role when using objective MARGINAL\n * @param scope Scope associated with the persona set (by default the scope used will be the current project). Use this to do any specific overrides.\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves with undefined when successful\n */\nexport async function setPersonas<R extends WorldRole = WorldRole>(\n personas: PersonaCreateInView<R>[],\n scope?: GenericScope,\n optionals: RoutingOptions = {},\n): Promise<void> {\n const boundary = scope?.scopeBoundary || SCOPE_BOUNDARY.PROJECT;\n /* We will at some point remove the need to explicitly lower case this */\n const boundaryComponent = boundary === SCOPE_BOUNDARY.WORLD ? '' : `/${boundary.toLowerCase()}`;\n const scopeKeyComponent = boundary === SCOPE_BOUNDARY.PROJECT ? '' : `/${scope?.scopeKey}`;\n const uriComponent = `${boundaryComponent}${scopeKeyComponent}`;\n\n return await new Router()\n .put(`/world/persona${uriComponent}`, {\n body: personas,\n ...optionals,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Assigns an existing run to the given world.\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/world/run/{WORLD_KEY}`\n *\n * @example\n * import { worldAdapter } from 'epicenter-libs';\n * await worldAdapter.assignRun(world.worldKey, { runKey: run.runKey });\n *\n * @param worldKey Key associated with the world\n * @param runKey Key associated with the run\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the newly resolved world\n */\nexport async function assignRun<R extends WorldRole = WorldRole>(\n worldKey: string,\n runKey: string,\n optionals: RoutingOptions = {},\n): Promise<WorldReadOutView<R>> {\n return await new Router()\n .patch(`/world/run/${worldKey}`, {\n body: { runKey },\n ...optionals,\n })\n .then(({ body }) => body);\n}\n","import type { RoutingOptions } from '../utils/router';\n\nimport Router from '../utils/router';\n\n\n/**\n * Fetches the current server time\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/time`\n *\n * @example\n * import { timeAdapter } from 'epicenter-libs';\n * const serverTime = await timeAdapter.get();\n *\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.accountShortName] Name of account (by default will be the account associated with the session)\n * @param [optionals.projectShortName] Name of project (by default will be the project associated with the session)\n * @returns promise that resolves to the current server time in ISO 8601 format, or undefined if not found\n */\nconst NOT_FOUND = 404;\nexport async function get(\n optionals: RoutingOptions = {},\n): Promise<void | string> {\n return await new Router()\n .get('/time', optionals)\n .catch((error) => {\n if (error.status === NOT_FOUND) return { body: undefined };\n return Promise.reject(error);\n }).then(({ body }) => body);\n}\n","import type { RoutingOptions } from '../utils/router';\nimport type { GenericScope, Address } from '../utils/constants';\n\nimport Router from '../utils/router';\n\nexport enum RETRY_POLICY {\n DO_NOTHING = 'DO_NOTHING', // If the task fails, do nothing (this is the default)\n RESCHEDULE = 'RESCHEDULE', // If the task fails retry at the next scheduled time point\n FIRE_ON_FAIL_SAFE = 'FIRE_ON_FAIL_SAFE', // Will re-execute the task after it fails; how long until this occurs is equal to ttlSeconds\n}\n\n// Generic type aliases for task adapter\nexport type TaskPayloadBody = Record<string, unknown>;\nexport type TaskPayloadHeaders = Record<string, string>;\n\n// Status type for group status tasks\nexport interface StatusReadOutView {\n code?: string;\n message?: string;\n}\n\nexport interface StatusCreateInView {\n code: string;\n message: string;\n}\n\n// Trigger type definitions for creating tasks\nexport interface CronTaskTriggerCreateInView {\n objectType: 'cron';\n value: string;\n}\n\nexport interface DateTaskTriggerCreateInView {\n objectType: 'date';\n value: string;\n}\n\nexport interface OffsetTaskTriggerCreateInView {\n objectType: 'offset';\n minutes?: number;\n hours?: number;\n days?: number;\n}\n\nexport type TaskTriggerCreateInView =\n | CronTaskTriggerCreateInView\n | DateTaskTriggerCreateInView\n | OffsetTaskTriggerCreateInView;\n\n// Payload type definitions for creating tasks\nexport interface HttpTaskPayloadCreateInView<\n B extends object = TaskPayloadBody,\n H extends object = TaskPayloadHeaders,\n> {\n objectType: 'http';\n method: string;\n url: string;\n body: B;\n headers?: H;\n}\n\nexport interface GroupStatusTaskPayloadCreateInView {\n objectType: 'groupStatus';\n groupKey: string;\n status: StatusCreateInView;\n}\n\nexport type TaskPayloadCreateInView<\n B extends object = TaskPayloadBody,\n H extends object = TaskPayloadHeaders,\n> =\n | HttpTaskPayloadCreateInView<B, H>\n | GroupStatusTaskPayloadCreateInView;\n\n// Payload type definitions for reading tasks\nexport interface HttpTaskPayloadReadOutView<\n B extends object = TaskPayloadBody,\n H extends object = TaskPayloadHeaders,\n> {\n objectType: 'http';\n method?: string;\n url?: string;\n body?: B;\n headers?: H;\n}\n\nexport interface GroupStatusTaskPayloadReadOutView {\n objectType: 'groupStatus';\n groupKey?: string;\n status?: StatusReadOutView;\n}\n\nexport type TaskPayloadReadOutView<\n B extends object = TaskPayloadBody,\n H extends object = TaskPayloadHeaders,\n> =\n | HttpTaskPayloadReadOutView<B, H>\n | GroupStatusTaskPayloadReadOutView;\n\n// Task response structure\nexport interface TaskReadOutView<\n B extends object = TaskPayloadBody,\n H extends object = TaskPayloadHeaders,\n> {\n taskKey?: string;\n name?: string;\n status?: string;\n cron?: string;\n mutationKey?: string;\n failures?: number;\n successes?: number;\n address?: Address;\n payload?: TaskPayloadReadOutView<B, H>;\n scope?: GenericScope;\n retryPolicy?: string;\n failSafeTermination?: string;\n ttlSeconds?: number;\n}\n\n\n/**\n * Creates a task; requires support level authentication\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/task`\n *\n * @example\n * import { taskAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const scope = {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: session.groupKey,\n * };\n * const name = 'task-1-send-emails';\n * const payload = {\n * method: 'POST',\n * url: 'https://forio.com/app/forio-dev/test-project/send-out-emails',\n * };\n * const trigger = {\n * value: '0 7 15 * * ?', // triggers on day 15 7am of each month\n * objectType: 'cron',\n * };\n * await taskAdapter.create(scope, name, payload, trigger);\n *\n * @param scope Scope associated with the task\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [scope.userKey] Key associated with the user\n * @param name Name of the task\n * @param payload An HTTP task object that will be executed when the task is triggered\n * @param payload.method Type of method to use with the HTTP request (e.g., 'GET', 'POST', 'PATCH')\n * @param payload.url The URL the HTTP request will be sent to\n * @param [payload.body] The body of the HTTP request\n * @param [payload.headers] Headers to send along with the HTTP request\n * @param trigger Object that determines when to run the task (cron, offset, or date)\n * @param [trigger.value] For cron: cron expression (e.g., '0 7 * * * ?'). For date: ISO-8601 date-time string\n * @param [trigger.objectType] Type of trigger: 'cron', 'offset', or 'date'\n * @param [trigger.minutes] For offset triggers: number of minutes until the task triggers\n * @param [trigger.hours] For offset triggers: number of hours until the task triggers\n * @param [trigger.days] For offset triggers: number of days until the task triggers\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.accountShortName] Name of account (by default will be the account associated with the session)\n * @param [optionals.projectShortName] Name of project (by default will be the project associated with the session)\n * @param [optionals.retryPolicy] Specifies what to do should the task fail; see RETRY_POLICY\n * @param [optionals.failSafeTermination] The ISO-8601 date-time when the task will be deleted regardless of any triggers; defaults to null\n * @param [optionals.ttlSeconds] Max life expectancy of the task; used to determine if retrying the task is necessary\n * @returns promise that resolves to the task object including the taskKey\n */\nexport async function create<\n B extends object = TaskPayloadBody,\n H extends object = TaskPayloadHeaders,\n>(\n scope: { userKey?: string } & GenericScope,\n name: string,\n payload: {\n method: string;\n url: string;\n body?: B;\n headers?: H;\n },\n trigger: TaskTriggerCreateInView,\n optionals: {\n retryPolicy?: keyof typeof RETRY_POLICY;\n failSafeTermination?: number;\n ttlSeconds?: number;\n } & RoutingOptions = {},\n): Promise<TaskReadOutView<B, H>> {\n const {\n retryPolicy,\n failSafeTermination,\n ttlSeconds,\n ...routingOptions\n } = optionals;\n return await new Router()\n .post(\n '/task',\n {\n body: {\n payload: { objectType: 'http' as const, ...payload },\n trigger,\n retryPolicy,\n failSafeTermination,\n ttlSeconds,\n scope,\n name,\n },\n ...routingOptions,\n },\n )\n .then(({ body }) => body);\n}\n\n\n/**\n * Deletes a task (changes status to cancelled); requires support level authentication\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/task/{TASK_KEY}`\n *\n * @example\n * import { taskAdapter } from 'epicenter-libs';\n * const taskKey = '0000017dd3bf540e5ada5b1e058f08f20461';\n * await taskAdapter.destroy(taskKey);\n *\n * @param taskKey Unique key associated with a task\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.accountShortName] Name of account (by default will be the account associated with the session)\n * @param [optionals.projectShortName] Name of project (by default will be the project associated with the session)\n * @returns promise that resolves to undefined when successful\n */\nexport async function destroy(\n taskKey: string,\n optionals: RoutingOptions = {},\n): Promise<void> {\n return await new Router()\n .delete(`/task/${taskKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Gets a task by taskKey; requires support level authentication\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/task/{TASK_KEY}`\n *\n * @example\n * import { taskAdapter } from 'epicenter-libs';\n * const taskKey = '0000017dd3bf540e5ada5b1e058f08f20461';\n * const task = await taskAdapter.get(taskKey);\n *\n * @param taskKey Unique key associated with a task\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.accountShortName] Name of account (by default will be the account associated with the session)\n * @param [optionals.projectShortName] Name of project (by default will be the project associated with the session)\n * @returns promise that resolves to the task object\n */\nexport async function get<\n B extends object = TaskPayloadBody,\n H extends object = TaskPayloadHeaders,\n>(taskKey: string, optionals: RoutingOptions = {}): Promise<TaskReadOutView<B, H>> {\n return await new Router()\n .get(`/task/${taskKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Gets the history (100 most recent times it has triggered) of a task by taskKey; requires support level authentication\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/task/history/{TASK_KEY}`\n *\n * @example\n * import { taskAdapter } from 'epicenter-libs';\n * const taskKey = '0000017dd3bf540e5ada5b1e058f08f20461';\n * const history = await taskAdapter.getHistory(taskKey);\n *\n * @param taskKey Unique key associated with a task\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.accountShortName] Name of account (by default will be the account associated with the session)\n * @param [optionals.projectShortName] Name of project (by default will be the project associated with the session)\n * @returns promise that resolves to an array of task history objects\n */\nexport async function getHistory<\n B extends object = TaskPayloadBody,\n H extends object = TaskPayloadHeaders,\n>(\n taskKey: string,\n optionals: RoutingOptions = {},\n): Promise<TaskReadOutView<B, H>[]> {\n return await new Router()\n .get(`/task/history/${taskKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Gets most recent 100 tasks related to the selected scope; requires support level authentication\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/task/in/{SCOPE_BOUNDARY}/{SCOPE_KEY}` or GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/task/in/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{USER_KEY}`\n *\n * Note: Will retrieve all tasks that were CREATED in the specified scope. If something was created with episode scope, it will not be retrievable through group scoping.\n *\n * @example\n * import { taskAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const scope = {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * };\n * const tasks = await taskAdapter.getTaskIn(scope);\n *\n * @param scope Scope associated with the tasks\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [scope.userKey] Key associated with the user; will retrieve tasks in the scope that were made by the specified user\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.accountShortName] Name of account (by default will be the account associated with the session)\n * @param [optionals.projectShortName] Name of project (by default will be the project associated with the session)\n * @returns promise that resolves to an array of task objects\n */\nexport async function getTaskIn<\n B extends object = TaskPayloadBody,\n H extends object = TaskPayloadHeaders,\n>(\n scope: { userKey?: string } & GenericScope,\n optionals: RoutingOptions = {},\n): Promise<TaskReadOutView<B, H>[]> {\n const { scopeBoundary, scopeKey, userKey } = scope;\n return await new Router()\n .get(\n `/task/in/${scopeBoundary}/${scopeKey}${\n userKey ? `/${userKey}` : ''\n }`,\n optionals,\n )\n .then(({ body }) => body);\n}\n","import type { GenericScope, GenericSearchOptions, Permit } from '../utils/constants';\nimport type { RoutingOptions, Page } from '../utils/router';\n\nimport Router from '../utils/router';\nimport { parseFilterInput } from '../utils/filter-parser';\n\nexport interface ChatMessageReadOutView {\n senderKey: string;\n receiverKey: string;\n created: string;\n id: string;\n message: string;\n}\n\nexport interface ChatReadOutView {\n permit: Permit;\n chatKey: string;\n messages: ChatMessageReadOutView[];\n room: string;\n scope: GenericScope;\n}\n\n\n/**\n * Updates the permissions of a chat\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/chat/{CHAT_KEY}`\n *\n * @example\n * import { chatAdapter, ROLE } from 'epicenter-libs';\n * await chatAdapter.updatePermit('0000017dd3bf540e5ada5b1e058f08f20461', {\n * readLock: ROLE.PARTICIPANT,\n * writeLock: ROLE.FACILITATOR,\n * });\n *\n * @param chatKey Key associated with the chat\n * @param permit Permit object with the updated permissions\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the updated chat\n */\nexport async function updatePermit(\n chatKey: string,\n permit: Permit,\n optionals: RoutingOptions = {},\n): Promise<ChatReadOutView> {\n return new Router()\n .patch(`/chat/${chatKey}`, {\n ...optionals,\n body: { permit },\n }).then(({ body }) => body);\n}\n\n\n/**\n * Creates a chat\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/chat`\n *\n * @example\n * import { chatAdapter, SCOPE_BOUNDARY, ROLE } from 'epicenter-libs';\n * const chat = await chatAdapter.create(\n * 'my-chat-room',\n * { scopeBoundary: SCOPE_BOUNDARY.GROUP, scopeKey: '00000165ad4e6a3cd22b993340b963820239' },\n * { readLock: ROLE.PARTICIPANT, writeLock: ROLE.PARTICIPANT }\n * );\n *\n * @param room Name of the chat\n * @param scope Scope of the chat; will not accept user scope\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param permit Permissions for the chat\n * @param permit.readLock Role allowed to read\n * @param permit.writeLock Role allowed to write\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the newly created chat\n */\nexport async function create(\n room: string,\n scope: GenericScope,\n permit: Permit,\n optionals: RoutingOptions = {},\n): Promise<ChatReadOutView> {\n return new Router()\n .post('/chat', {\n body: {\n scope: {\n scopeBoundary: scope.scopeBoundary,\n scopeKey: scope.scopeKey,\n },\n permit,\n room,\n },\n ...optionals,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Gets a chat\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/chat/{CHAT_KEY}`\n *\n * @example\n * import { chatAdapter } from 'epicenter-libs';\n * const chat = await chatAdapter.get('00000165ad4e6a3cd22b993340b963820239');\n *\n * @param chatKey Key of the associated chat\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the chat\n */\nexport async function get(\n chatKey: string,\n optionals: RoutingOptions = {},\n): Promise<ChatReadOutView> {\n return new Router()\n .get(`/chat/${chatKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Open search for chats, returns a page\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/chat/search`\n *\n * @example\n * import { chatAdapter } from 'epicenter-libs';\n * const page = await chatAdapter.query({\n * filter: [\n * 'room|=my-chat-room|my-other-chat|room-three', // looks for any rooms with the names provided\n * 'scopeBoundary=GROUP', // keeps the search within the group scope\n * 'scopeKey=00000165ad4e6a3cd22b993340b963820239', // used in conjunction with the scopeBoundary\n * 'chatKey=0000017dd3bf540e5ada5b1e058f08f20461', // searches for a specific chat\n * 'created>=2022-01-03T20:30:53.054Z', // looks for any chats created after Jan 3rd 2022\n * ],\n * sort: ['+chat.created'], // sort all findings by the 'created' field (ascending)\n * first: 3, // page should start with the 4th item found (defaults to 0)\n * max: 10, // page should only include the first 10 items\n * });\n *\n * @param searchOptions Search options for the query\n * @param [searchOptions.filter] Filters for searching\n * @param [searchOptions.sort] Sorting criteria\n * @param [searchOptions.first] The starting index of the page returned\n * @param [searchOptions.max] The number of entries per page\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a page of chats\n */\nexport async function query(\n searchOptions: GenericSearchOptions,\n optionals: RoutingOptions = {},\n): Promise<Page<ChatReadOutView>> {\n const { filter, sort = [], first = 0, max } = searchOptions;\n const searchParams = {\n filter: parseFilterInput(filter),\n sort: sort.join(';') || undefined,\n first, max,\n };\n return await new Router()\n .withSearchParams(searchParams)\n .get('/chat/search', {\n paginated: true,\n ...optionals,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Sends a message to a chat\n * Base URL: PUT `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/chat/message/{CHAT_KEY}` or PUT `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/chat/message/{CHAT_KEY}/{USER_KEY}`\n *\n * @example\n * import { chatAdapter } from 'epicenter-libs';\n * // Send a public message to the chat\n * await chatAdapter.sendMessage('0000017dd3bf540e5ada5b1e058f08f20461', 'hello');\n * // Send a private message to a specific user\n * await chatAdapter.sendMessage('0000017dd3bf540e5ada5b1e058f08f20461', 'hello, privately', { userKey: '000001796733eef0842f4d6d960997018a33' });\n *\n * @param chatKey Key associated with the chat\n * @param message Message text to send\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.userKey] Key of the user to send the message to. If omitted, will send as a public message\n * @returns promise that resolves to the chat message created\n */\nexport async function sendMessage(\n chatKey: string,\n message: string,\n optionals: { userKey?: string } & RoutingOptions = {},\n): Promise<ChatMessageReadOutView> {\n const { userKey, ...routingOptions } = optionals;\n const uriComponent = userKey ? `/${userKey}` : '';\n return new Router()\n .put(`/chat/message/${chatKey}${uriComponent}`, {\n body: { message },\n ...routingOptions,\n }).then(({ body }) => body);\n}\n\n\n/**\n * Retrieves messages from for a given chat\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/chat/message/{CHAT_KEY}`\n *\n * @example\n * import { chatAdapter } from 'epicenter-libs';\n * // gets the chat message with id: 5\n * const message = await chatAdapter.getMessages('0000017dd3bf540e5ada5b1e058f08f20461', { horizon: 5, maxRecords: 1 });\n * // gets the 10 chat messages starting from id 5 (inclusive)\n * const messages = await chatAdapter.getMessages('0000017dd3bf540e5ada5b1e058f08f20461', { horizon: 5, maxRecords: 10 });\n *\n * @param chatKey Key associated with the chat\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.maxRecords] Maximum number of messages to get\n * @param [optionals.horizon] The message ID from which to start with; works backwards so if `maxRecords=20` and `horizon=50`, it will get the 20 messages starting from message ID 50, working backwards (50, 49, 48..., etc.). If this value is omitted the platform assumes it is the most recent message in the chat\n * @returns promise that resolves to the list of chat messages requested\n */\nexport async function getMessages(\n chatKey: string,\n optionals: {\n maxRecords?: number;\n horizon?: number;\n } & RoutingOptions = {},\n): Promise<ChatMessageReadOutView[]> {\n const { maxRecords, horizon, ...routingOptions } = optionals;\n return new Router()\n .withSearchParams({ maxRecords, horizon })\n .get(`/chat/message/${chatKey}`, routingOptions)\n .then(({ body }) => body);\n}\n\n/**\n * Retrieves messages for a given user; requires facilitator authentication; works with an admin user\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/chat/message/{CHAT_KEY}/{PSEUDONYM_KEY}`\n *\n * @example\n * import { chatAdapter } from 'epicenter-libs';\n * // gets the chat message with id: 5\n * const message = await chatAdapter.getMessagesForUser('0000017dd3bf540e5ada5b1e058f08f20461', '000001796733eef0842f4d6d960997018a33', { horizon: 5, maxRecords: 1 });\n * // gets the 10 chat messages starting from id 5 (inclusive)\n * const messages = await chatAdapter.getMessagesForUser('0000017dd3bf540e5ada5b1e058f08f20461', '000001796733eef0842f4d6d960997018a33', { horizon: 5, maxRecords: 10 });\n *\n * @param chatKey Key associated with the chat\n * @param pseudonymKey Key associated with the user whose messages are being retrieved\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.maxRecords] Maximum number of messages to get\n * @param [optionals.horizon] The message ID from which to start with; works backwards so if `maxRecords=20` and `horizon=50`, it will get the 20 messages starting from message ID 50, working backwards (50, 49, 48..., etc.). If this value is omitted the platform assumes it is the most recent message in the chat\n * @returns promise that resolves to the list of chat messages requested\n */\nexport async function getMessagesForUser(\n chatKey: string,\n pseudonymKey: string,\n optionals: {\n maxRecords?: number;\n horizon?: number;\n } & RoutingOptions = {},\n): Promise<ChatMessageReadOutView[]> {\n const { maxRecords, horizon, ...routingOptions } = optionals;\n return new Router()\n .withSearchParams({ maxRecords, horizon })\n .get(`/chat/message/${chatKey}/${pseudonymKey}`, routingOptions)\n .then(({ body }) => body);\n}\n\n/**\n * Retrieves messages from for a given chat for an admin user; requires support authentication\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/chat/message/all/{CHAT_KEY}`\n *\n * @example\n * import { chatAdapter } from 'epicenter-libs';\n * // gets the chat message with id: 5\n * const message = await chatAdapter.getMessagesAdmin('0000017dd3bf540e5ada5b1e058f08f20461', { horizon: 5, maxRecords: 1 });\n * // gets the 10 chat messages starting from id 5 (inclusive)\n * const messages = await chatAdapter.getMessagesAdmin('0000017dd3bf540e5ada5b1e058f08f20461', { horizon: 5, maxRecords: 10 });\n *\n * @param chatKey Key associated with the chat\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.maxRecords] Maximum number of messages to get\n * @param [optionals.horizon] The message ID from which to start with; works backwards so if `maxRecords=20` and `horizon=50`, it will get the 20 messages starting from message ID 50, working backwards (50, 49, 48..., etc.). If this value is omitted the platform assumes it is the most recent message in the chat\n * @returns promise that resolves to the list of chat messages requested\n */\nexport async function getMessagesAdmin(\n chatKey: string,\n optionals: {\n maxRecords?: number;\n horizon?: number;\n } & RoutingOptions = {},\n): Promise<ChatMessageReadOutView[]> {\n const { maxRecords, horizon, ...routingOptions } = optionals;\n return new Router()\n .withSearchParams({ maxRecords, horizon })\n .get(`/chat/message/all/${chatKey}`, routingOptions)\n .then(({ body }) => body);\n}\n\n/**\n * Sends a message to a chat as an admin user; requires support authentication\n * Base URL: PUT `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/chat/message/system/{CHAT_KEY}` or PUT `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/chat/message/system/{CHAT_KEY}/{USER_KEY}`\n *\n * @example\n * import { chatAdapter } from 'epicenter-libs';\n * // Send a public message to the chat\n * await chatAdapter.sendMessageAdmin('0000017dd3bf540e5ada5b1e058f08f20461', 'hello');\n * // Send a private message to a specific user\n * await chatAdapter.sendMessageAdmin('0000017dd3bf540e5ada5b1e058f08f20461', 'hello, privately', { userKey: '000001796733eef0842f4d6d960997018a33' });\n *\n * @param chatKey Key associated with the chat\n * @param message Message text to send\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.userKey] Key of the user to send the message to. If omitted, will send as a public message\n * @returns promise that resolves to the chat message created\n */\nexport async function sendMessageAdmin(\n chatKey: string,\n message: string,\n optionals: { userKey?: string } & RoutingOptions = {},\n): Promise<ChatMessageReadOutView> {\n const { userKey, ...routingOptions } = optionals;\n const uriComponent = userKey ? `/${userKey}` : '';\n return new Router()\n .put(`/chat/message/system/${chatKey}${uriComponent}`, {\n body: { message },\n ...routingOptions,\n }).then(({ body }) => body);\n}\n","import type { RoutingOptions } from '../utils/router';\nimport type { Actionable } from './run';\nimport type { WorldRole } from './world';\nimport type { PseudonymReadOutView } from './user';\n\nimport {\n Router,\n RITUAL,\n} from '../utils';\n\nexport interface BarrierArrival {\n arrived: string;\n message?: string;\n user: PseudonymReadOutView;\n}\n\nexport interface BarrierReadOutView<R extends WorldRole = WorldRole> {\n instantiated: boolean;\n triggered: boolean;\n closed: boolean;\n paused: boolean;\n transparent: boolean;\n worldKey: string;\n name: string;\n stage: string;\n ttlSeconds: number;\n secondsLeft: number;\n expectedRoles: Record<R, number>;\n impendingRoles: Record<R, PseudonymReadOutView[]>;\n arrivedRoles: Record<R, BarrierArrival[]>;\n allowChannel: boolean;\n}\n\nexport interface BarrierMap {\n [worldKey: string]: {\n name: string;\n stage: string;\n };\n}\n\n\n/**\n * Creates a new consensus barrier\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/consensus/{WORLD_KEY}/{NAME}/{STAGE}`\n *\n * @example\n * import { consensusAdapter } from 'epicenter-libs';\n * await consensusAdapter.create(\n * '00000173078afb05b4ae4c726637167a1a9e',\n * 'SUBMISSIONS',\n * 'ROUND1',\n * {\n * ROLE1: 1,\n * ROLE2: 1,\n * ROLE3: 2,\n * },\n * {\n * ROLE1: [{ name: 'step', arguments: [] }],\n * ROLE2: [{ name: 'step', arguments: [] }],\n * ROLE3: [{ name: 'step', arguments: [] }],\n * }\n * );\n *\n * @param worldKey World key for the world you are making a consensus barrier for\n * @param name Unique string to name a set of consensus barriers\n * @param stage Unique string to name one stage of the set of consensus barriers\n * @param expectedRoles Map where the keys are the names of each role participating and the number of users expected to submit consensus actions for each role\n * @param defaultActions Map defining which actions to take if the role specified in the key does not submit\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.ttlSeconds] How long the consensus barrier lasts for.\n * @param [optionals.transparent] If the barrier has `transparent: false`, then only one of the default actions will be sent. If it has `transparent: true` then they are all sent.\n * @param [optionals.allowChannel] Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT\n * @returns promise that resolves to the newly created consensus barrier\n */\nexport async function create<R extends WorldRole = WorldRole>(\n worldKey: string,\n name: string,\n stage: string,\n expectedRoles: Record<R, number>,\n defaultActions: Record<R, Actionable[]>,\n optionals: {\n ttlSeconds?: number;\n transparent?: boolean;\n allowChannel?: boolean;\n } & RoutingOptions = {},\n): Promise<BarrierReadOutView<R>> {\n const {\n ttlSeconds,\n transparent = false,\n allowChannel,\n ...routingOptions\n } = optionals;\n\n return await new Router()\n .post(`/consensus/${worldKey}/${name}/${stage}`, {\n body: {\n expectedRoles,\n ttlSeconds,\n transparent,\n actions: defaultActions,\n allowChannel,\n },\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Load one specific consensus barrier by specifying stage\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/consensus/{WORLD_KEY}/{NAME}/{STAGE}`\n *\n * @example\n * import { consensusAdapter } from 'epicenter-libs';\n * await consensusAdapter.load('00000173078afb05b4ae4c726637167a1a9e', 'SUBMISSIONS', 'ROUND1');\n *\n * @param worldKey World key for the world you are loading a consensus barrier for\n * @param name Unique string that names a set of consensus barriers\n * @param stage Unique string to specify which specific barrier to load\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the consensus barrier\n */\nexport async function load<R extends WorldRole = WorldRole>(\n worldKey: string,\n name: string,\n stage: string,\n optionals: RoutingOptions = {},\n): Promise<BarrierReadOutView<R>> {\n return await new Router()\n .get(`/consensus/${worldKey}/${name}/${stage}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * List all consensus barriers sharing the same name\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/consensus/{WORLD_KEY}/{NAME}`\n *\n * @example\n * import { consensusAdapter } from 'epicenter-libs';\n * await consensusAdapter.list('00000173078afb05b4ae4c726637167a1a9e', 'SUBMISSIONS');\n *\n * @param worldKey World key for the world you are loading consensus barriers for\n * @param name Unique string that specifies which set of consensus barriers to retrieve\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a list of consensus barriers\n */\nexport async function list<R extends WorldRole = WorldRole>(\n worldKey: string,\n name: string,\n optionals: RoutingOptions = {},\n): Promise<BarrierReadOutView<R>[]> {\n return await new Router()\n .get(`/consensus/${worldKey}/${name}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Facilitator only. Marks current consensus barrier as complete. Closing the barrier will send default actions for anyone who has not arrived. If the barrier is opaque, then only one of the default actions will be sent, and if it's transparent then they are all sent\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/consensus/close/{WORLD_KEY}/{NAME}/{STAGE}`\n *\n * @example\n * import { consensusAdapter } from 'epicenter-libs';\n * await consensusAdapter.forceClose('00000173078afb05b4ae4c726637167a1a9e', 'SUBMISSIONS', 'ROUND1');\n *\n * @param worldKey World key for the world you are making a consensus barrier for\n * @param name Unique string that names a set of consensus barriers\n * @param stage Unique string that specifies which stage of the set of consensus barriers to close\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.ritual] Ritual type for processing the consensus actions\n * @returns promise that resolves to the response\n */\nexport async function forceClose(\n worldKey: string,\n name: string,\n stage: string,\n optionals: {\n ritual?: keyof typeof RITUAL;\n } & RoutingOptions = {},\n): Promise<unknown> {\n const {\n ritual,\n ...routingOptions\n } = optionals;\n\n return await new Router()\n .post(`/consensus/close/${worldKey}/${name}/${stage}`, {\n body: {\n ritual,\n },\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Updates the default actions defined in .create. A user can only update their own default actions, and this call will only work for a barrier that has `transparent: true`\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/consensus/actions/{WORLD_KEY}/{NAME}/{STAGE}`\n *\n * @example\n * import { consensusAdapter } from 'epicenter-libs';\n * await consensusAdapter.updateDefaults(\n * '00000173078afb05b4ae4c726637167a1a9e',\n * 'SUBMISSIONS',\n * 'ROUND1',\n * [{ name: 'var1', value: 100, objectType: 'set' }]\n * );\n *\n * @param worldKey World key for the world you are making a consensus barrier for\n * @param name Unique string to name a set of consensus barriers\n * @param stage Unique string to name one stage of the set of consensus barriers\n * @param actions List of objects describing the default actions to update for the current user\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the updated consensus barrier\n */\nexport async function updateDefaults<R extends WorldRole = WorldRole>(\n worldKey: string,\n name: string,\n stage: string,\n actions: Record<R, Actionable[]>,\n optionals: RoutingOptions = {},\n): Promise<BarrierReadOutView<R>> {\n const {\n ...routingOptions\n } = optionals;\n\n return await new Router()\n .patch(`/consensus/actions/${worldKey}/${name}/${stage}`, {\n body: {\n actions,\n },\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Submits actions for your turn and marks you as having `submitted`.\n * Note that you can still call operations from the runAdapter directly, but will bypass the consensus requirements.\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/consensus/publish/{WORLD_KEY}/{NAME}/{STAGE}`\n *\n * @example\n * import { consensusAdapter } from 'epicenter-libs';\n * await consensusAdapter.submitActions(\n * '00000173078afb05b4ae4c726637167a1a9e',\n * 'SUBMISSIONS',\n * 'ROUND1',\n * [{ name: 'step', arguments: [] }],\n * { message: 'Student side submission!' },\n * );\n *\n * @param worldKey World key for the world you are making a consensus barrier for\n * @param name Unique string to name a set of consensus barriers\n * @param stage Unique string to name one stage of the set of consensus barriers\n * @param actions List of objects describing the actions to send\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.message] Message that is stored in the barrier arrival entity; opportunity to note a description regarding this submission\n * @param [optionals.ritual] Ritual type for processing the consensus actions\n * @returns promise that resolves to the response. Note: the response consensus object will have `triggered: true` for the final user that submits and triggers the barrier. triggered is a virtual field, not stored in the database as part of the barrier entity, so it only appears in the response for the final user submitting\n */\nexport async function submitActions(\n worldKey: string,\n name: string,\n stage: string,\n actions: Actionable[],\n optionals: {\n message?: string;\n ritual?: keyof typeof RITUAL;\n } & RoutingOptions = {},\n): Promise<unknown> {\n const {\n message,\n ritual,\n ...routingOptions\n } = optionals;\n return await new Router()\n .post(`/consensus/publish/${worldKey}/${name}/${stage}`, {\n body: {\n ritual,\n actions,\n message,\n },\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Deletes the targeted barrier, which allows users to create a new barrier with the same name and stage\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/consensus/{WORLD_KEY}/{NAME}/{STAGE}`\n *\n * @example\n * import { consensusAdapter } from 'epicenter-libs';\n * await consensusAdapter.deleteBarrier(\n * '00000173078afb05b4ae4c726637167a1a9e',\n * 'SUBMISSIONS',\n * 'ROUND1',\n * );\n *\n * @param worldKey World key for the world you are targeting\n * @param name Unique string that names a set of consensus barriers\n * @param stage Unique string to specify which specific barrier to delete\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the deleted consensus barrier\n */\nexport async function deleteBarrier<R extends WorldRole = WorldRole>(\n worldKey: string,\n name: string,\n stage: string,\n optionals: RoutingOptions = {},\n): Promise<BarrierReadOutView<R>> {\n const {\n ...routingOptions\n } = optionals;\n\n return await new Router()\n .delete(`/consensus/${worldKey}/${name}/${stage}`, {\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Deletes all barriers under the same name, which allows users to create new barriers with the same name and stage\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/consensus/{WORLD_KEY}/{NAME}`\n *\n * @example\n * import { consensusAdapter } from 'epicenter-libs';\n * await consensusAdapter.deleteAll(\n * '00000173078afb05b4ae4c726637167a1a9e',\n * 'SUBMISSIONS',\n * );\n *\n * @param worldKey World key for the world you are targeting\n * @param name Unique string that names a set of consensus barriers\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the deleted consensus barriers\n */\nexport async function deleteAll<R extends WorldRole = WorldRole>(\n worldKey: string,\n name: string,\n optionals: RoutingOptions = {},\n): Promise<BarrierReadOutView<R>> {\n const {\n ...routingOptions\n } = optionals;\n\n return await new Router()\n .delete(`/consensus/${worldKey}/${name}`, {\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Removes the currently logged in user from the list of users that have arrived at this barrier, thus allowing the user to redo their submission.\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/consensus/arrival/{WORLD_KEY}/{NAME}/{STAGE}`\n *\n * @example\n * import { consensusAdapter } from 'epicenter-libs';\n * await consensusAdapter.undoSubmit(\n * '00000173078afb05b4ae4c726637167a1a9e',\n * 'SUBMISSIONS',\n * 'ROUND1',\n * );\n *\n * @param worldKey World key for the world you are targeting\n * @param name Unique string that names a set of consensus barriers\n * @param stage Unique string to specify which specific barrier to undo your submission for\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the updated consensus barrier\n */\nexport async function undoSubmit<R extends WorldRole = WorldRole>(\n worldKey: string,\n name: string,\n stage: string,\n optionals: RoutingOptions = {},\n): Promise<BarrierReadOutView<R>> {\n const {\n ...routingOptions\n } = optionals;\n\n return await new Router()\n .delete(`/consensus/arrival/${worldKey}/${name}/${stage}`, {\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Facilitator only; artificial triggering of the arrival of a participant to the barrier. Useful for testing or for missing participants\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/consensus/trigger/{WORLD_KEY}/{NAME}/{STAGE}`\n *\n * @example\n * import { consensusAdapter } from 'epicenter-libs';\n * await consensusAdapter.triggerFor(\n * '00000173078afb05b4ae4c726637167a1a9e',\n * 'SUBMISSIONS',\n * 'ROUND1',\n * '0000017cb60ad697e109dcb11cdd4cfcdd1d',\n * [{ name: 'step', arguments: [] }],\n * { message: 'Facilitator triggered this submission!' },\n * );\n *\n * @param worldKey World key for the world you are targeting\n * @param name Unique string that names this set of consensus barriers\n * @param stage Unique string that names the stage of targeted barrier\n * @param userKey userKey of the user the facilitator is triggering for\n * @param actions List of objects describing the actions to send for the specified user\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.message] Message that is stored in the barrier arrival entity; opportunity to note a description regarding this submission\n * @param [optionals.ritual] Ritual type for processing the consensus actions\n * @returns promise that resolves to the response\n */\nexport async function triggerFor(\n worldKey: string,\n name: string,\n stage: string,\n userKey: string,\n actions: Actionable[],\n optionals: {\n message?: string;\n ritual?: keyof typeof RITUAL;\n } & RoutingOptions = {},\n): Promise<unknown> {\n const {\n ritual,\n message,\n ...routingOptions\n } = optionals;\n return await new Router()\n .post(`/consensus/trigger/${worldKey}/${name}/${stage}`, {\n\n body: {\n ritual,\n userKey,\n message,\n actions,\n },\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Facilitator only; removes the specified user from the list of users that have arrived at this barrier, thus allowing the user to redo their submission. This only removes the arrival, not the role expectation.\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/consensus/untrigger/{WORLD_KEY}/{NAME}/{STAGE}/{USER_KEY}`\n *\n * @example\n * import { consensusAdapter } from 'epicenter-libs';\n * await consensusAdapter.undoSubmitFor(\n * '00000173078afb05b4ae4c726637167a1a9e',\n * 'SUBMISSIONS',\n * 'ROUND1',\n * '0000017cb60ad697e109dcb11cdd4cfcdd1d',\n * );\n *\n * @param worldKey World key for the world you are targeting\n * @param name Unique string that names a set of consensus barriers\n * @param stage Unique string to specify which specific barrier to undo submission for\n * @param userKey userKey of the user the facilitator is undoing the submit for\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to undefined if successful\n */\nexport async function undoSubmitFor(\n worldKey: string,\n name: string,\n stage: string,\n userKey: string,\n optionals: RoutingOptions = {},\n): Promise<void> {\n const {\n ...routingOptions\n } = optionals;\n\n return await new Router()\n .delete(`/consensus/untrigger/${worldKey}/${name}/${stage}/${userKey}`, {\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Facilitator only; removes the entire role expectation from the consensus barrier based on the specified user's role assignment. This removes the expectation for that role and also removes any arrivals for that user. This is a structural change that affects all users with that role - the barrier will no longer wait for anyone with that role to submit.\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/consensus/expectation/{WORLD_KEY}/{NAME}/{STAGE}/{USER_KEY}`\n *\n * @example\n * import { consensusAdapter } from 'epicenter-libs';\n * await consensusAdapter.removeRoleExpectationFor(\n * '00000173078afb05b4ae4c726637167a1a9e',\n * 'SUBMISSIONS',\n * 'ROUND1',\n * '0000017cb60ad697e109dcb11cdd4cfcdd1d',\n * );\n *\n * @param worldKey World key for the world you are targeting\n * @param name Unique string that names a set of consensus barriers\n * @param stage Unique string to specify which specific barrier to remove the role expectation from\n * @param userKey userKey of a user whose role will be completely removed from the barrier expectations\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to undefined if successful\n */\nexport async function removeRoleExpectationFor(\n worldKey: string,\n name: string,\n stage: string,\n userKey: string,\n optionals: RoutingOptions = {},\n): Promise<void> {\n return await new Router()\n .delete(`/consensus/expectation/${worldKey}/${name}/${stage}/${userKey}`, optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Pauses the TTL countdown timer for a timed consensus barrier. When paused, the timer stops counting down and the remaining time is preserved. Only works for barriers that have a ttlSeconds value set.\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/consensus/pause/{WORLD_KEY}/{NAME}/{STAGE}`\n *\n * @example\n * import { consensusAdapter } from 'epicenter-libs';\n * await consensusAdapter.pause(\n * '00000173078afb05b4ae4c726637167a1a9e',\n * 'SUBMISSIONS',\n * 'ROUND1',\n * );\n *\n * @param worldKey World key for the world you are targeting\n * @param name Unique string that names a set of consensus barriers\n * @param stage Unique string to specify which specific barrier to pause\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the updated consensus barrier\n */\nexport async function pause<R extends WorldRole = WorldRole>(\n worldKey: string,\n name: string,\n stage: string,\n optionals: RoutingOptions = {},\n): Promise<BarrierReadOutView<R>> {\n return await new Router()\n .patch(`/consensus/pause/${worldKey}/${name}/${stage}`, {\n body: {\n resume: false,\n },\n ...optionals,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Resumes the TTL countdown timer for a paused consensus barrier. The timer continues from where it was paused. Only works for barriers that were previously paused.\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/consensus/pause/{WORLD_KEY}/{NAME}/{STAGE}`\n *\n * @example\n * import { consensusAdapter } from 'epicenter-libs';\n * await consensusAdapter.resume(\n * '00000173078afb05b4ae4c726637167a1a9e',\n * 'SUBMISSIONS',\n * 'ROUND1',\n * );\n *\n * @param worldKey World key for the world you are targeting\n * @param name Unique string that names a set of consensus barriers\n * @param stage Unique string to specify which specific barrier to resume\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the updated consensus barrier\n */\nexport async function resume<R extends WorldRole = WorldRole>(\n worldKey: string,\n name: string,\n stage: string,\n optionals: RoutingOptions = {},\n): Promise<BarrierReadOutView<R>> {\n return await new Router()\n .patch(`/consensus/pause/${worldKey}/${name}/${stage}`, {\n body: {\n resume: true,\n },\n ...optionals,\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Facilitator only; retrieves multiple consensus barriers across multiple worlds within a group or episode. This allows you to efficiently check the status of barriers across all specified worlds in a single API call.\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/consensus/in/{GROUP_NAME}` or POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/consensus/in/{GROUP_NAME}/{EPISODE_NAME}`\n *\n * @example\n * import { consensusAdapter } from 'epicenter-libs';\n * const barriers = await consensusAdapter.collectInGroup(\n * {\n * '00000173078afb05b4ae4c726637167a1a9e': { name: 'SUBMISSIONS', stage: 'ROUND1' },\n * '00000173078afb05b4ae4c726637167a1b2f': { name: 'SUBMISSIONS', stage: 'ROUND1' },\n * },\n * 'my-group-name',\n * { episodeName: 'my-episode-name' }\n * );\n *\n * @param barrierMap Map of world keys to barrier name/stage pairs\n * @param groupName Name of the group to collect barriers from\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.episodeName] Name of the episode to collect barriers from (optional)\n * @returns promise that resolves to an array of consensus barriers\n */\nexport async function collectInGroup<R extends WorldRole = WorldRole>(\n barrierMap: BarrierMap,\n groupName: string,\n optionals: {\n episodeName?: string;\n } & RoutingOptions = {},\n): Promise<BarrierReadOutView<R>[]> {\n const {\n episodeName,\n ...routingOptions\n } = optionals;\n\n return await new Router()\n .post(`/consensus/in/${groupName}${episodeName ? `/${episodeName}` : ''}`, {\n body: barrierMap,\n ...routingOptions,\n })\n .then(({ body }) => body);\n}\n","import type { Page, RoutingOptions } from '../utils/router';\nimport type { GenericScope } from '../utils/constants';\n\nimport Router from '../utils/router';\n\nexport interface Somebody {\n email: string;\n somebodyKey: string;\n scope: GenericScope;\n familyName?: string;\n givenName?: string;\n}\n\n\n/**\n * Adds somebody to an account; somebody is a person who is not a user, but whose information is used in a simulation; requires support level authentication\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/somebody`\n *\n * @example\n * import { somebodyAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const email = 'test@test.com';\n * const scope = {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * };\n * const somebody = await somebodyAdapter.create(email, scope, {\n * givenName: 'Person',\n * familyName: 'Family',\n * });\n *\n * @param email Email of the person being added\n * @param scope Scope associated with the somebody\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.givenName] Given name of the person\n * @param [optionals.familyName] Family name of the person\n * @returns promise that resolves to the newly created somebody object\n */\n\nexport async function create(\n email: string,\n scope: GenericScope,\n optionals: {\n givenName?: string;\n familyName?: string;\n } & RoutingOptions = {},\n): Promise<Somebody> {\n const {\n givenName,\n familyName,\n ...routingOptions\n } = optionals;\n return await new Router()\n .post(\n '/somebody',\n {\n body: {\n email,\n givenName,\n familyName,\n scope,\n },\n ...routingOptions,\n },\n )\n .then(({ body }) => body);\n}\n\n\n/**\n * Gets a somebody by their key\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/somebody/{SOMEBODY_KEY}`\n *\n * @example\n * import { somebodyAdapter } from 'epicenter-libs';\n * const somebodyKey = '0000017dd3bf540e5ada5b1e058f08f20461';\n * const somebody = await somebodyAdapter.get(somebodyKey);\n *\n * @param somebodyKey Key associated with the somebody\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the somebody object, or undefined if not found\n */\nconst NOT_FOUND = 404;\nexport async function get(\n somebodyKey: string,\n optionals: RoutingOptions = {},\n): Promise<Somebody | undefined> {\n return await new Router()\n .get(`/somebody/${somebodyKey}`, optionals)\n .catch((error) => {\n if (error.status === NOT_FOUND) return { body: undefined };\n return Promise.reject(error);\n }).then(({ body }) => body);\n}\n\n\n/**\n * Gets all somebodies within a specific scope\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/somebody/in/{SCOPE_BOUNDARY}/{SCOPE_KEY}`\n *\n * @example\n * import { somebodyAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const scope = {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * };\n * const somebodies = await somebodyAdapter.inScope(scope, { first: 0, max: 100 });\n *\n * @param scope Scope associated with the somebodies\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.first] Index of first result to return\n * @param [optionals.max] Maximum number of results to return (max of 300; default of 300)\n * @returns promise that resolves to a page of somebody objects, or undefined if not found\n */\nexport async function inScope(\n scope: GenericScope,\n optionals: {\n first?: number;\n max?: number;\n } & RoutingOptions = {},\n): Promise<Page<Somebody> | undefined> {\n const { scopeBoundary, scopeKey } = scope;\n const {\n first,\n max,\n ...routingOptions\n } = optionals;\n const searchParams = {\n first, max,\n };\n return await new Router()\n .withSearchParams(searchParams)\n .get(`/somebody/in/${scopeBoundary}/${scopeKey}`, {\n paginated: true,\n ...routingOptions,\n })\n .catch((error) => {\n if (error.status === NOT_FOUND) return { body: undefined };\n return Promise.reject(error);\n }).then(({ body }) => body);\n}\n\n\n/**\n * Gets a somebody by their email within a specific scope\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/somebody/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{EMAIL}`\n *\n * @example\n * import { somebodyAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const scope = {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * };\n * const somebody = await somebodyAdapter.byEmail('test@test.com', scope);\n *\n * @param email Email of the somebody to retrieve\n * @param scope Scope associated with the somebody\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the somebody object, or undefined if not found\n */\nexport async function byEmail(\n email: string,\n scope: GenericScope,\n optionals: RoutingOptions = {},\n): Promise<Somebody | undefined> {\n const { scopeBoundary, scopeKey } = scope;\n return await new Router()\n .get(`/somebody/with/${scopeBoundary}/${scopeKey}/${email}`, optionals)\n .catch((error) => {\n if (error.status === NOT_FOUND) return { body: undefined };\n return Promise.reject(error);\n }).then(({ body }) => body);\n}\n","import type { GenericScope } from '../utils/constants';\nimport type { RoutingOptions } from '../utils/router';\n\nimport Router from '../utils/router';\n\n/**\n * Creates a matchmaker list; requires facilitator level authentication\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/matchmaker/udome/{NAME}`\n *\n * @example\n * import { matchmakerAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const list = await matchmakerAdapter.create('my-matchmaker', 2, {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * });\n *\n * @param name The name for the matchmaker list\n * @param partners The number of partners each participant should be assigned\n * @param scope Scope associated with list\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the matchmaker list object\n */\nexport async function create(\n name: string,\n partners: number,\n scope: GenericScope,\n optionals: RoutingOptions = {},\n): Promise<Record<string, unknown>> {\n const { accountShortName, projectShortName, server } = optionals;\n\n return await new Router()\n .withServer(server)\n .withAccountShortName(accountShortName)\n .withProjectShortName(projectShortName)\n .post(`/matchmaker/udome/${name}`, {\n body: {\n scope,\n partners,\n },\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Changes the opened/closed status of a matchmaker list; requires facilitator level authentication\n * Base URL: PUT `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/matchmaker/udome/{UDOME_KEY}`\n *\n * @example\n * import { matchmakerAdapter } from 'epicenter-libs';\n * const list = await matchmakerAdapter.edit('udomeKey123', true);\n *\n * @param udomeKey The unique key for the targeted matchmaker list\n * @param closed Whether the matchmaker list is open or closed\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the matchmaker list object\n */\nexport async function edit(\n udomeKey: string,\n closed: boolean,\n optionals: RoutingOptions = {},\n): Promise<Record<string, unknown>> {\n const { accountShortName, projectShortName, server } = optionals;\n\n return await new Router()\n .withServer(server)\n .withAccountShortName(accountShortName)\n .withProjectShortName(projectShortName)\n .put(`/matchmaker/udome/${udomeKey}`, {\n body: {\n closed,\n },\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Adds the user making the request to the matchmaker list provided that it is open; requires participant authentication\n * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/matchmaker/udome`\n *\n * @example\n * import { matchmakerAdapter } from 'epicenter-libs';\n * const list = await matchmakerAdapter.addUser('udomeKey123');\n *\n * @param udomeKey The unique key for the targeted matchmaker list\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the matchmaker list object\n */\nexport async function addUser(\n udomeKey: string,\n optionals: RoutingOptions = {},\n): Promise<Record<string, unknown>> {\n const { accountShortName, projectShortName, server } = optionals;\n\n return await new Router()\n .withServer(server)\n .withAccountShortName(accountShortName)\n .withProjectShortName(projectShortName)\n .patch('/matchmaker/udome', {\n body: {\n udomeKey,\n },\n })\n .then(({ body }) => body);\n}\n\nconst NOT_FOUND = 404;\n/**\n * Gets a matchmaker list based on a udomeKey; requires participant level authentication\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/matchmaker/udome/{UDOME_KEY}`\n *\n * @example\n * import { matchmakerAdapter } from 'epicenter-libs';\n * const list = await matchmakerAdapter.get('udomeKey123');\n *\n * @param udomeKey The unique key for the targeted matchmaker list\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the matchmaker list object, or undefined if not found\n */\nexport async function get(\n udomeKey: string,\n optionals: RoutingOptions = {},\n): Promise<Record<string, unknown>> {\n const { accountShortName, projectShortName, server } = optionals;\n\n return await new Router()\n .withServer(server)\n .withAccountShortName(accountShortName)\n .withProjectShortName(projectShortName)\n .get(`/matchmaker/udome/${udomeKey}`)\n .catch((error) => {\n if (error.status === NOT_FOUND) return { body: undefined };\n return Promise.reject(error);\n })\n .then(({ body }) => body);\n}\n\n\n/**\n * Gets a matchmaker list based on name and scope; requires participant level authentication\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/matchmaker/udome/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{NAME}`\n *\n * @example\n * import { matchmakerAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const list = await matchmakerAdapter.byName('my-matchmaker', {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: 'GROUP_KEY',\n * });\n *\n * @param name The name of the matchmaker list\n * @param scope Scope associated with list\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the matchmaker list object, or undefined if not found\n */\nexport async function byName(\n name: string,\n scope: GenericScope,\n optionals: RoutingOptions = {},\n): Promise<Record<string, unknown>> {\n const { accountShortName, projectShortName, server } = optionals;\n const { scopeBoundary, scopeKey } = scope;\n\n return await new Router()\n .withServer(server)\n .withAccountShortName(accountShortName)\n .withProjectShortName(projectShortName)\n .get(`/matchmaker/udome/${scopeBoundary}/${scopeKey}/${name}`)\n .catch((error) => {\n if (error.status === NOT_FOUND) return { body: undefined };\n return Promise.reject(error);\n })\n .then(({ body }) => body);\n}\n","import type { RoutingOptions } from '../utils/router';\nimport type { GenericScope } from '../utils/constants';\n\nimport {\n Router,\n ROLE,\n Fault,\n} from '../utils';\nimport * as videoAdapter from './video';\n\nexport type RecordingType = 'CLOUD';\nexport type Privacy = 'PRIVATE';\nexport type StreamType = 'HLS';\n\nexport interface DailyRoomResponseReadOutView {\n name: string;\n url: string;\n}\n\nexport interface DailyMeetingTokenResponseReadOutView {\n token: string;\n}\n\nconst sleep = (ms: number) => new Promise((r) => setTimeout(r, ms));\n\nconst randRange = (min: number, max: number) => {\n return min + Math.random() * (max - min);\n};\n\n/* eslint-disable no-magic-numbers */\nconst RETRY_RANGES = [\n [6_000, 10_000],\n [11_000, 20_000],\n [30_000, 45_000],\n];\n/* eslint-enable no-magic-numbers */\n\nconst RATE_LIMIT_REACHED = 429;\nasync function handleRateLimit<T>(\n requestFunction: () => Promise<T>,\n retryNumber = 0,\n): Promise<T> {\n let response;\n try {\n response = await requestFunction();\n } catch (error) {\n if (error instanceof Fault && error.status === RATE_LIMIT_REACHED && retryNumber <= RETRY_RANGES.length) {\n const [min, max] = RETRY_RANGES[retryNumber];\n await sleep(randRange(min, max));\n response = await handleRateLimit(requestFunction, retryNumber + 1);\n } else {\n throw error;\n }\n }\n return response;\n}\n\n\n/**\n * Gets the daily configuration for the epicenter account. Requires Support auth\n *\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/daily/v1`\n *\n * @example\n * import { dailyAdapter } from 'epicenter-libs';\n * const config = await dailyAdapter.getConfig();\n *\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the daily object\n */\nexport async function getConfig(\n optionals: RoutingOptions = {},\n // TODO: investigate actual return type\n): Promise<unknown> {\n return await new Router()\n .get('/daily/v1', optionals)\n .then(({ body }) => body);\n}\n\n\n/**\n * Creates a new daily meeting room\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/daily/v1/room`\n *\n * @example\n * import { dailyAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const room = await dailyAdapter.createRoom({\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461'\n * });\n *\n * @param scope Scope associated with your room\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [scope.userKey] Optional key to scope the room to a user\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.readLock] Role allowed to read\n * @param [optionals.writeLock] Role allowed to write\n * @param [optionals.ttlSeconds] Life span of any recording made (how long before it is deleted); defaults to 604,800 (1 week), max of 31,536,000 (1 year)\n * @param [optionals.privacy] Whether the room is private or not; currently can only be set to PRIVATE\n * @param [optionals.exp] When the room will be deleted in epoch seconds. Defaults to 24 hours. Max of 24 hours.\n * @param [optionals.enable_recording] The type of Daily recording method to use. Only CLOUD is currently permitted.\n * @param [optionals.streaming_endpoints] Details for daily streaming features.\n * @param [optionals.streaming_endpoints.name] Name of the stream\n * @param [optionals.streaming_endpoints.type] Type of the stream; only HLS is currently permitted\n * @param [optionals.streaming_endpoints.hls_config] Options for hls stream\n * @param [optionals.streaming_endpoints.hls_config.save_hls_recording] Whether or not to record the hls stream\n * @param [optionals.streaming_endpoints.hls_config.storage] Storage details for hls stream\n * @param [optionals.streaming_endpoints.hls_config.path] S3 storage path\n * @param [optionals.streaming_endpoints.hls_config.bucket_region] S3 bucket region\n * @param [optionals.streaming_endpoints.hls_config.assume_role_arn] S3 role ARN for permission to alter S3 resources\n * @param [optionals.streaming_endpoints.hls_config.bucket_name] S3 bucket name\n * @param [optionals.disableRateLimitHandling] Disable automatic rate limit retry handling\n * @returns promise that resolves to the newly created room details\n */\nexport async function createRoom(\n scope: { userKey?: string } & GenericScope,\n optionals: {\n readLock?: keyof typeof ROLE;\n writeLock?: keyof typeof ROLE;\n privacy?: Privacy;\n ttlSeconds?: number;\n exp?: number;\n enable_recording?: RecordingType;\n disableRateLimitHandling?: boolean;\n streaming_endpoints?: [{\n name: string;\n type: StreamType;\n hls_config: {\n storage: {\n path: string;\n bucket_region?: string;\n assume_role_arn?: string;\n bucket_name?: string;\n };\n save_hls_recording?: boolean;\n };\n }];\n } & RoutingOptions = {},\n): Promise<DailyRoomResponseReadOutView> {\n const {\n readLock,\n writeLock,\n ttlSeconds,\n privacy,\n exp,\n enable_recording,\n streaming_endpoints,\n disableRateLimitHandling,\n ...routingOptions\n } = optionals;\n const { PARTICIPANT } = ROLE;\n const callAPI = async (): Promise<DailyRoomResponseReadOutView> => {\n return await new Router()\n .post(\n '/daily/v1/room',\n {\n body: {\n epicenter: {\n ttlSeconds,\n scope,\n permit: {\n readLock: readLock || PARTICIPANT,\n writeLock: writeLock || PARTICIPANT,\n },\n },\n properties: {\n exp,\n enable_recording,\n streaming_endpoints,\n },\n privacy,\n },\n ...routingOptions,\n },\n )\n .then(({ body }) => body);\n };\n return handleRateLimit(callAPI, disableRateLimitHandling ? RETRY_RANGES.length + 1 : 0);\n}\n\n\n/**\n * Creates a token for a daily meeting room\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/daily/v1/meetingToken`\n *\n * @example\n * import { dailyAdapter } from 'epicenter-libs';\n * const token = await dailyAdapter.createToken('my-room-name');\n *\n * @param room_name Name of the room to create a token for\n * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.\n * @param [optionals.start_video_off] Whether the user should have their video off upon joining the meeting; defaults to true.\n * @param [optionals.is_owner] Whether the user has owner permissions; owner permissions are required to start a stream (not a recording); defaults to false\n * @param [optionals.user_name] Username to display in daily's system. This is relevant if the daily call is open in a separate window\n * @param [optionals.close_tab_on_exit] Whether to close the tab on the end of the call. This is relevant if the daily call is open in a separate window\n * @param [optionals.exp] When the token will be deleted in epoch seconds. Defaults to 24 hours. Max of 24 hours.\n * @param [optionals.enable_recording] The type of Daily recording method to permit. Only CLOUD is currently permitted.\n * @param [optionals.disableRateLimitHandling] Disable automatic rate limit retry handling\n * @param [optionals.selfSign] Whether to self-sign the token; defaults to true\n * @returns promise that resolves to the newly created token details\n */\nexport async function createToken(\n room_name: string,\n optionals: {\n start_video_off?: boolean;\n is_owner?: boolean;\n user_name?: string;\n close_tab_on_exit?: boolean;\n exp?: number;\n enable_recording?: RecordingType;\n disableRateLimitHandling?: boolean;\n selfSign?: boolean;\n } & RoutingOptions = {},\n): Promise<DailyMeetingTokenResponseReadOutView> {\n const {\n start_video_off,\n is_owner,\n user_name,\n close_tab_on_exit,\n exp,\n enable_recording,\n disableRateLimitHandling,\n selfSign = true,\n ...routingOptions\n } = optionals;\n const callAPI = async (): Promise<DailyMeetingTokenResponseReadOutView> => {\n return await new Router()\n .withSearchParams({ selfSign })\n .post(\n '/daily/v1/meetingToken',\n {\n body: {\n properties: {\n room_name,\n start_video_off,\n is_owner,\n user_name,\n close_tab_on_exit,\n exp,\n enable_recording,\n },\n },\n ...routingOptions,\n },\n )\n .then(({ body }) => body);\n };\n return handleRateLimit(callAPI, disableRateLimitHandling ? RETRY_RANGES.length + 1 : 0);\n}\n\n\n/**\n * Convenience function for retrieving the most recent recording for a Daily room\n *\n * @example\n * import { dailyAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const videoUrl = await dailyAdapter.getVideoByRecordingId('my-room', 'recording_instance_id', {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461'\n * });\n *\n * @param room_name Name of the room\n * @param recordingId Recording instance ID\n * @param scope Scope associated with the room\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param [scope.userKey] Optional key to scope the room to a user\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a url if a video exists or null if it does not\n */\nexport async function getVideoByRecordingId(\n room_name: string,\n recordingId: string,\n scope: { userKey?: string } & GenericScope,\n optionals: RoutingOptions = {},\n): Promise<string | null> {\n const filePathInfo = await videoAdapter.getDirectoryURL({\n scope,\n affiliate: 'DAILY',\n family: room_name,\n ...optionals,\n });\n const filePaths = filePathInfo.contents;\n if (!filePaths?.length) return null;\n filePaths.sort((a, b) => Number(b.split('.')[0]) - Number(a.split('.')[0]));\n const filePath = filePaths.find((p) => p.includes(recordingId) && p.includes('.mp4'));\n if (!filePath) return null;\n return await videoAdapter.getURL(filePath, {\n scope,\n affiliate: 'DAILY',\n family: room_name,\n ...optionals,\n });\n}\n\n\n/**\n * Sets the daily family/room to a recording status of recorded; necessary to prevent videos from deleting automatically within 1 hour\n * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/daily/v1/meetingToken/{ROOM_NAME}`\n *\n * @example\n * import { dailyAdapter } from 'epicenter-libs';\n * const success = await dailyAdapter.updateRecordingStatus('my-room');\n *\n * @param room_name Name of the room\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to true if successful\n */\nexport async function updateRecordingStatus(\n room_name: string,\n optionals: RoutingOptions = {},\n): Promise<boolean> {\n return await new Router()\n .delete(`/daily/v1/meetingToken/${room_name}`, optionals)\n .then(({ body }) => body);\n}\n","import type { Page, RoutingOptions } from '../utils/router';\nimport type { GenericScope } from '../utils/constants';\nimport type { PseudonymReadOutView } from './user';\n\nimport { Router, identification } from '../utils';\nimport { UserSession } from 'epicenter';\n\nexport interface WalletItemReadOutView {\n label: string;\n value: string | null;\n}\n\nexport interface WalletReadOutView {\n walletKey: string;\n scope: { userKey: string } & GenericScope;\n user: PseudonymReadOutView;\n items: WalletItemReadOutView[];\n}\n\nexport interface WalletItemCreateInView {\n label: string;\n value?: string;\n}\n\n\n/**\n * Updates a wallet\n * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/wallet`\n *\n * @example\n * // Add a user's phone number to their wallet\n * import { walletAdapter } from 'epicenter-libs';\n * const scope = {\n * userKey: '000001796733eef0842f4d6d960997018a33',\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * };\n * walletAdapter.update(scope, [{ label: 'phone', value: '555-555-5555' }]);\n *\n * @param scope Scope attached to the wallet; userKey is required\n * @param scope.scopeBoundary Can be a couple things, commonly group, project, episode, or world\n * @param scope.scopeKey Key of the resource defined by the scope boundary\n * @param scope.userKey User key for the user creating the entry, if omitted will use the one in current session\n * @param items List of items to update the wallet with\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the updated wallet\n */\nexport async function update(\n scope: { userKey: string | undefined } & GenericScope,\n items: WalletItemCreateInView[],\n optionals: RoutingOptions = {},\n): Promise<WalletReadOutView> {\n const session = identification.session as UserSession;\n scope.userKey ??= session?.userKey;\n return await new Router()\n .post('/wallet', {\n body: {\n items,\n scope,\n },\n ...optionals,\n }).then(({ body }) => body);\n}\n\nconst NOT_FOUND = 404;\n/**\n * Gets a wallet\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/wallet/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{USER_KEY}`\n *\n * @example\n * // Get a user's wallet\n * import { walletAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const scope = {\n * userKey: '000001796733eef0842f4d6d960997018a33',\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * };\n * walletAdapter.get(scope);\n *\n * @param scope Scope attached to the wallet; userKey is required\n * @param scope.scopeBoundary Can be a couple things, commonly group, project, episode, or world\n * @param scope.scopeKey Key of the resource defined by the scope boundary\n * @param scope.userKey User key for the user creating the entry, if omitted will use the one in current session\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to the wallet\n */\nexport async function get(\n scope: { userKey: string } & GenericScope,\n optionals: RoutingOptions = {},\n): Promise<WalletReadOutView | undefined> {\n const { scopeBoundary, scopeKey } = scope;\n let { userKey } = scope;\n const session = identification.session as UserSession;\n userKey ??= session?.userKey;\n return await new Router()\n .get(`/wallet/${scopeBoundary}/${scopeKey}/${userKey}`, optionals)\n .catch((error) => {\n if (error.status === NOT_FOUND) return { body: undefined };\n return Promise.reject(error);\n }).then(({ body }) => body);\n}\n\n\n/**\n * Get all wallets under a certain scope\n * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/wallet/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}`\n *\n * @example\n * // Get all wallets under a group\n * import { walletAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';\n * const scope = {\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',\n * };\n * walletAdapter.withScope(scope);\n *\n * @param scope Scope attached to the wallets\n * @param scope.scopeBoundary Can be a couple things, commonly group, project, episode, or world\n * @param scope.scopeKey Key of the resource defined by the scope boundary\n * @param [optionals] Optional arguments; pass network call options overrides here.\n * @returns promise that resolves to a page of wallets\n */\nexport async function withScope(\n scope: GenericScope,\n optionals: {\n first?: number;\n max?: number;\n } & RoutingOptions = {},\n): Promise<Page<WalletReadOutView>> {\n const { scopeBoundary, scopeKey } = scope;\n const { first = 0, max, ...routingOptions } = optionals;\n\n return await new Router()\n .withSearchParams({ first, max })\n .get(`/wallet/with/${scopeBoundary}/${scopeKey}`, {\n paginated: true,\n ...routingOptions,\n })\n .catch((error) => {\n if (error.status === NOT_FOUND) return { body: undefined };\n return Promise.reject(error);\n }).then(({ body }) => body);\n}\n","import type { SubscriptionHandle, Message } from 'cometd';\nimport type { GenericScope } from '../utils/constants';\n\nimport { EpicenterError, SCOPE_BOUNDARY, PUSH_CATEGORY } from '../utils';\nimport cometdAdapter from './cometd';\n\n// Generic type for push channel message custom data\nexport type ChannelMessageData = unknown;\n\n// Base structure for channel push messages\nexport interface ChannelMessage<D = ChannelMessageData> {\n /** The destination address for the message. */\n address: {\n /** The scope boundary of the address (e.g. 'WORLD'). */\n boundary: string;\n /** The push category of the address (e.g. 'RUN'). */\n category: string;\n /** The scope key of the address (e.g. your worldKey if boundary is 'WORLD'). */\n key: string;\n };\n /** The sender of the message. */\n sender: {\n /** The type of the sender (e.g., 'USER', 'SYSTEM'). */\n type: string;\n /** The key of the sender. */\n key: string;\n };\n /** The message content/payload. */\n content: D;\n /** The ISO 8601 date string when the message was sent. */\n date: string;\n /** The type/category of the message. */\n type: string;\n}\n\nexport interface ChannelScope extends GenericScope {\n pushCategory: keyof typeof PUSH_CATEGORY;\n}\n\nconst validateScope = (scope: ChannelScope) => {\n if (!scope) throw new EpicenterError('No scope found where one was required');\n const { scopeBoundary, scopeKey, pushCategory } = scope;\n if (!scopeBoundary) throw new EpicenterError('Missing scope component: scopeBoundary');\n if (!scopeKey) throw new EpicenterError('Missing scope component: scopeKey');\n if (!pushCategory) throw new EpicenterError('Missing scope component: pushCategory');\n if (!Object.prototype.hasOwnProperty.call(SCOPE_BOUNDARY, scopeBoundary)) throw new EpicenterError(`Invalid scope boundary: ${scopeBoundary}`);\n if (!Object.prototype.hasOwnProperty.call(PUSH_CATEGORY, pushCategory)) throw new EpicenterError(`Invalid push category: ${pushCategory}`);\n};\n\n/**\n * Used to subscribe to CometD channels. Pass in a channel scope to instantiate, if a subscription to that scope already exists it will use it.\n *\n * @example\n * import { Channel, authAdapter, SCOPE_BOUNDARY, PUSH_CATEGORY } from 'epicenter-libs';\n * const session = authAdapter.getLocalSession();\n * const channel = new Channel({\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: session.groupKey,\n * pushCategory: PUSH_CATEGORY.CHAT,\n * });\n * await channel.subscribe((data) => {\n * console.log('Received message:', data);\n * });\n */\nexport default class Channel<D = ChannelMessageData> {\n path: string;\n update: ((data: ChannelMessage<D>) => unknown) | undefined;\n subscription: SubscriptionHandle | null = null;\n\n /**\n * Channel constructor\n *\n * @param scope Object with the scope boundary, scope key, and push category; defines the namespace for the channel\n * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types\n * @param scope.scopeKey Scope key, a unique identifier tied to the scope. E.g., if your `scopeBoundary` is `GROUP`, your `scopeKey` will be your `groupKey`; for `EPISODE`, `episodeKey`, etc.\n * @param scope.pushCategory Push category, defines the type of channel; See [push category](#PUSH_CATEGORY) for all types\n */\n constructor(scope: ChannelScope) {\n const { scopeBoundary, scopeKey, pushCategory } = scope;\n validateScope(scope);\n this.path = `/${scopeBoundary.toLowerCase()}/${scopeKey}/${pushCategory.toLowerCase()}`;\n if (cometdAdapter.subscriptions.has(this.path)) {\n this.subscription = cometdAdapter.subscriptions.get(this.path) || null;\n }\n }\n\n /**\n * Publishes content to the CometD channel\n *\n * @example\n * import { Channel, authAdapter, SCOPE_BOUNDARY, PUSH_CATEGORY } from 'epicenter-libs';\n * const session = authAdapter.getLocalSession();\n * const channel = new Channel({\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: session.groupKey,\n * pushCategory: PUSH_CATEGORY.CHAT,\n * });\n * await channel.publish({ message: 'Hello!' });\n *\n * @param content Content to publish to the channel\n * @returns promise that resolves to the CometD message response\n */\n publish(content: D): Promise<Message> {\n return cometdAdapter.publish(this, content);\n }\n\n /**\n * Subscribes to the CometD channel, attaching a handler for any channel updates. If a subscription already exists it will first unsubscribe, ensuring that only one subscription is ever attached to the channel.\n *\n * @example\n * import { Channel, authAdapter, SCOPE_BOUNDARY, PUSH_CATEGORY } from 'epicenter-libs';\n * const session = authAdapter.getLocalSession();\n * const channel = new Channel({\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: session.groupKey,\n * pushCategory: PUSH_CATEGORY.CHAT,\n * });\n * await channel.subscribe((data) => {\n * console.log(data.content);\n * });\n *\n * @param update Function that is called whenever a channel update occurs\n * @param [options] Optional arguments\n * @param [options.inert] If true, creates an inert subscription that doesn't trigger reconnection\n * @returns promise that resolves to the subscription object returned by CometD after a successful subscribe\n */\n // eslint-disable-next-line complexity\n async subscribe(\n update: (data: ChannelMessage<D>) => unknown,\n options: { inert?: boolean } = {},\n ): Promise<SubscriptionHandle> {\n if (this.subscription) {\n try {\n await cometdAdapter.remove(this.subscription);\n } catch (error: unknown) {\n const errorObj = error as { message?: string; information?: { error?: string } };\n const errorMessage = errorObj?.message || errorObj?.information?.error || '';\n\n if (errorMessage.includes('session_unknown') || errorMessage.includes('402')) {\n // Previous subscription already invalid due to session expiration\n } else {\n // Re-throw other errors\n throw error;\n }\n }\n }\n this.update = update;\n\n let retryCount = 0;\n const maxRetries = 3;\n\n while (retryCount < maxRetries) {\n try {\n this.subscription = await cometdAdapter.add(this, update, options) as SubscriptionHandle;\n return this.subscription;\n } catch (error: unknown) {\n const errorObj = error as { message?: string; information?: { error?: string } };\n const errorMessage = errorObj?.message || errorObj?.information?.error || '';\n\n if ((errorMessage.includes('session_unknown') || errorMessage.includes('402')) && retryCount < maxRetries - 1) {\n retryCount++;\n // Force fresh handshake\n cometdAdapter.handshakeState = 'idle';\n cometdAdapter.handshakePromise = undefined;\n\n // Wait a moment before retrying\n const retryDelay = 1000;\n const currentRetry = retryCount;\n await new Promise((resolve) => setTimeout(resolve, retryDelay * currentRetry));\n continue;\n }\n\n // Re-throw if not session_unknown or max retries exceeded\n throw error;\n }\n }\n\n throw new Error(`Failed to subscribe to ${this.path} after ${maxRetries} attempts`);\n }\n\n /**\n * Unsubscribes from the CometD channel\n *\n * @example\n * import { Channel, authAdapter, SCOPE_BOUNDARY, PUSH_CATEGORY } from 'epicenter-libs';\n * const session = authAdapter.getLocalSession();\n * const channel = new Channel({\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: session.groupKey,\n * pushCategory: PUSH_CATEGORY.CHAT,\n * });\n * await channel.subscribe((data) => console.log(data));\n * // Later...\n * await channel.unsubscribe();\n *\n * @returns promise that resolves when unsubscribed\n */\n async unsubscribe(): Promise<void> {\n if (this.subscription) {\n await cometdAdapter.remove(this.subscription);\n this.subscription = null;\n }\n }\n\n /**\n * Unsubscribes from all CometD channels\n *\n * @example\n * import { Channel, authAdapter, SCOPE_BOUNDARY, PUSH_CATEGORY } from 'epicenter-libs';\n * const session = authAdapter.getLocalSession();\n * const channel = new Channel({\n * scopeBoundary: SCOPE_BOUNDARY.GROUP,\n * scopeKey: session.groupKey,\n * pushCategory: PUSH_CATEGORY.CHAT,\n * });\n * await channel.subscribe((data) => console.log(data));\n * // Later, unsubscribe from all channels...\n * await channel.unsubscribeAll();\n *\n * @returns promise that resolves when all channels are unsubscribed\n */\n async unsubscribeAll(): Promise<void> {\n await cometdAdapter.empty();\n }\n}\n\n","import fetch from 'cross-fetch';\nimport config from './utils/config';\nimport { prefix } from './utils/helpers';\nimport { parseFilterInput } from './utils/filter-parser';\nimport type { FilterGroup, FilterInput } from './utils/filter-parser';\n\n\nexport const proxy = async (\n resource: string,\n options?: RequestInit,\n): Promise<Response> => {\n const { accountShortName, projectShortName, isLocal } = config;\n let path = prefix('/', resource);\n if (!isLocal()) path = `/proxy/${accountShortName}/${projectShortName}${path}`;\n return fetch(path, options);\n};\n\n// Export filter utilities for testing and advanced usage\nexport { parseFilterInput };\nexport type { FilterGroup, FilterInput };\n","import 'regenerator-runtime/runtime';\n\n/* yes, this string template literal is weird;\n * it's cause rollup does not recogize __VERSION__ as an individual token otherwise */\nconst version = `Epicenter (v${'__VERSION__'}) for __BUILD__ | Build Date: __DATE__`;\n\nimport type { RetryFunction } from './utils/router';\nimport { authAdapter, cometdAdapter } from './adapters';\nimport { errorManager, identification, isBrowser, Fault, EpicenterError } from './utils';\nimport { Handler } from './utils/error-manager';\n\nconst UNAUTHORIZED = 401;\nconst FORBIDDEN = 403;\nexport const DEFAULT_ERROR_HANDLERS: Record<string, Handler> = {};\n\nDEFAULT_ERROR_HANDLERS.cometdReconnected = errorManager.registerHandler(\n (error) => error.code === 'COMETD_RECONNECTED',\n async (error: Fault) => {\n if (isBrowser()) {\n console.warn('Cometd Reconnected. If you wish to react to this reconnection, register an error handler with identifier: error.code === \"COMETD_RECONNECTED\".', error);\n }\n },\n);\n\nDEFAULT_ERROR_HANDLERS.cometdError = errorManager.registerHandler(\n (error) => error.status === FORBIDDEN && error.code === 'COMETD_ERROR',\n async<T>(error: Fault, retry: RetryFunction<T>) => {\n console.warn('Cometd error. Attempting to reconnect.', error);\n await cometdAdapter.disconnect();\n return await retry();\n },\n);\n\nDEFAULT_ERROR_HANDLERS.authExpired = errorManager.registerHandler(\n (error: Fault) => error.status === UNAUTHORIZED && error.code === 'AUTHENTICATION_EXPIRED',\n async (error: Fault) => {\n await authAdapter.removeLocalSession();\n if (isBrowser()) {\n // eslint-disable-next-line no-alert\n alert('Session token has expired, try logging in again.');\n }\n throw error;\n },\n);\n\nDEFAULT_ERROR_HANDLERS.authGroupExpired = errorManager.registerHandler(\n (error: Fault) => error.status === UNAUTHORIZED && error.code === 'AUTHENTICATION_GROUP_EXPIRED',\n async (error: Fault) => {\n if (isBrowser()) {\n // eslint-disable-next-line no-alert\n alert('This group has expired. Try logging into a different group');\n }\n throw error;\n },\n);\n\nDEFAULT_ERROR_HANDLERS.authInvalidated = errorManager.registerHandler(\n (error) => error.status === UNAUTHORIZED && error.code === 'AUTHENTICATION_INVALIDATED',\n async<T>(error: Fault, retry: RetryFunction<T>) => {\n try {\n const session = identification.session;\n if (session?.objectType === 'admin') {\n throw new EpicenterError('Unhandled error: admin session was somehow invalidated');\n }\n const groupKey = session?.groupKey ?? '';\n await authAdapter.regenerate(groupKey, { objectType: 'user', inert: true });\n return await retry();\n } catch (_error) {\n await authAdapter.removeLocalSession();\n throw error;\n }\n },\n);\n\nObject.freeze(DEFAULT_ERROR_HANDLERS);\n\n/* Interfaces & Types */\nexport * from './types';\n\n/* Version */\nexport { version };\n\n/* Constants */\nexport {\n SCOPE_BOUNDARY,\n RITUAL,\n PUSH_CATEGORY,\n ROLE,\n} from './utils/constants';\n\n/* Auxilary Singletons/Classes */\nexport {\n config,\n errorManager,\n Router,\n Fault,\n} from './utils';\n\n/* Adapters */\nexport {\n accountAdapter,\n adminAdapter,\n assetAdapter,\n consensusAdapter,\n emailAdapter,\n authAdapter,\n chatAdapter,\n episodeAdapter,\n groupAdapter,\n leaderboardAdapter,\n presenceAdapter,\n projectAdapter,\n recaptchaAdapter,\n runAdapter,\n taskAdapter,\n timeAdapter,\n userAdapter,\n vaultAdapter,\n videoAdapter,\n vonageAdapter,\n worldAdapter,\n somebodyAdapter,\n dailyAdapter,\n matchmakerAdapter,\n walletAdapter,\n Channel,\n cometdAdapter,\n} from './adapters';\n\n/* APIs */\nexport {\n videoAPI,\n vonageAPI,\n} from './apis';\n\n/* Utility Functions */\nexport * as utils from './utilities';\n"],"names":["exports","undefined","global","EpicenterError","Error","constructor","message","code","_defineProperty","Fault","body","response","_body$information","information","cause","status","rest","Result","headers","isBrowser","Function","isNode","prefix","pre","str","startsWith","escapeRegExp","replace","getExpiration","vEnd","Number","Infinity","String","Date","toUTCString","getItem","key","decodeURIComponent","document","cookie","RegExp","encodeURIComponent","setItem","value","options","test","path","domain","end","secure","samesite","expireStr","domainStr","pathStr","secureStr","samesiteStr","removeItem","hasItem","clear","aKeys","split","nLen","length","nIdx","Store","store","_store","nodeMap","Map","NodeStore","get","set","delete","SessionStore","window","sessionStorage","item","JSON","parse","stringify","CookieStore","defaults","cookies","BROWSER_STORAGE_TYPE","SCOPE_BOUNDARY","RITUAL","PUSH_CATEGORY","ROLE","API_VERSION","Config","loadBrowser","loadNode","apiProtocol","_apiProtocol","proto","toLowerCase","endsWith","slice","apiHost","_apiHost","useProjectProxy","_useProjectProxy","apiVersion","_apiVersion","accountShortName","_accountShortName","projectShortName","_projectShortName","isLocal","host","location","indexOf","protocol","pathname","match","account","project","setContext","context","config","COOKIE","SESSION","SESSION_KEY","EPI_SSO_KEY","Identification","storeType","type","consumeSSO","session","getStore","getStoreOptions","setSessionWithOptions","forcePathInclusion","mySession","objectType","base","isCustomDomain","isEpicenterDomain","cookieContent","charAt","hostname","identification","ErrorManager","handlers","_handlers","clearHandlers","registerHandler","identifier","handleFn","handler","handle","unregister","unregisterHandler","unshift","index","findIndex","splice","error","retryFn","promise","catch","err","e","console","remainingHandlers","handleableError","errorManager","MAX_URL_LENGTH","paginate","json","url","_options$parsePage","parsePage","i","page","values","prev","searchParams","URLSearchParams","search","firstResult","warn","first","maxResults","max","Math","toString","prevPage","request","paginated","then","Object","assign","next","totalResults","nextPage","initialTotal","all","allValues","push","parseQuery","query","entries","reduce","arr","Array","isArray","map","v","createMessage","headersRaw","bodyRaw","includeAuthorization","authorization","FormData","Authorization","token","authOverride","NO_CONTENT","BAD_REQUEST","OK","href","method","inert","fetch","cache","redirect","resContentType","includes","result","fault","retryOptions","retry","requestArguments","Router","version","_version","server","_server","_authorization","_searchParams","withVersion","withServer","withProjectProxy","withAccountShortName","withProjectShortName","withAuthorization","withSearchParams","getURL","uriComponent","overrides","_ref","_overrides$server","_ref2","_overrides$useProject","_ref3","_overrides$accountSho","_ref4","_overrides$projectSho","_ref5","_overrides$version","_this$searchParams","URL","proxyPathComponent","commonPathComponent","uniquePathComponent","patch","post","put","getAccount","createAccount","view","updateAccount","optionals","removeAccount","teamForAdmin","adminKey","includeAllMembers","filter","routingOptions","createAdmin","getWithHandle","parseFilterGroup","group","filters","parsedFilters","joinedFilters","join","parseFilterInput","filterInput","ACCESS_TYPE","PUBLIC","PRIVATE","AUTHENTICATED","WORKER_PARTITION","NONE","ALL","FREE","LICENSED","ACCOUNT","PHYLOGENY","ORIGINAL","HISTORICAL","REFERENTIAL","ORDERED","EVENTUAL","TRANSMOGRIFIED","REANIMATED","SILENT","CHANNEL_PROTOCOL","OUMUAMUA","COMETD","channelsEnabled","list","AUTH_TOKEN_KEY","MAX_RETRIES","IDLE","FAILED","CONNECTED","SUCCEEDED","CONNECTING","HANDSHAKING","DISCONNECTED","FORBIDDEN","CONNECT_META_CHANNEL","DISCONNECT_META_CHANNEL","HANDSHAKE_META_CHANNEL","COMETD_RECONNECTED","DEFAULT_CHANNEL_PROTOCOL","SESSION_INVALIDATION_ERRORS","isSessionInvalidationError","errorMessage","lowerError","some","pattern","isIllegalStateError","shouldRehandshake","reply","_reply$advice","_reply$error","advice","reconnect","cometdInstance","CometdAdapter","cometd","instance","startup","logLevel","_project$channelProto","getProject","channelEnabled","channelProtocol","CometD","AckExtension","ReloadExtension","accountProject","registerExtension","onunload","getStatus","reload","transport","getTransport","abort","configure","listenToMetaChannels","addListener","successful","handshakeState","processPendingOperations","handleHandshakeFailure","connectListener","Promise","resolve","reject","isDisconnected","wasConnected","isConnected","disconnectListener","handshakePromise","processingQueue","pendingOperations","operations","op","init","initialization","handshake","currentStatus","handshakeProps","ext","ack","websocketEnabled","handshakeReply","_handshakeReply$error","disconnect","empty","disconnectReply","_disconnectReply$erro","add","channel","update","_this$cometd","_errorObj$message","errorObj","_this$cometd2","retryDelay","setTimeout","subscriptionProps","handleCometdUpdate","data","_error","subscription","subscribe","subscribeReply","_subscribeReply$error","subscriptions","_options$_retryCount","retryCount","_retryCount","publish","content","publishProps","publishReply","_publishReply$error","_options$_retryCount2","remove","channelPath","sub","unsubscribe","unsubscribeReply","_unsubscribeReply$err","clearSubscriptions","cometdAdapter","logout","verificationOptionals","presenceOptionals","_identification$sessi","cleanup","groupKey","allSettled","finally","getSession","getLocalSession","setLocalSession","removeLocalSession","login","credentials","payload","prototype","hasOwnProperty","call","password","secretKey","regenerate","groupOrAccount","sso","getSAMLLink","generateSAMLLINK","ssoOutcome","ltiVersion","outcomeInformation","resetPassword","redirectURL","subject","redirectUrl","verify","create","file","scope","scopeBoundary","scopeKey","userKey","readLock","writeLock","ttlSeconds","tokenAccessSeconds","permit","USER","assetKey","removeFromScope","getURLWithScope","download","downloadWithScope","CONFLICT","overwrite","fileName","remaining","name","presignedUrl","shouldUpdate","sendEmail","emailBody","familyNameFirst","html","from","replyTo","fromUserKey","attachments","fromString","sendEmailToAdmin","sendEmailToSupport","supportType","groupName","draft","runLimit","category","episodeKey","searchOptions","sort","forGroup","withName","augment","destroy","gather","includeExpired","organization","allowSelfRegistration","flightRecorder","event","allowMembershipChanges","pricing","startDate","expirationDate","capacity","allowChannel","quantized","withGroupName","forUser","role","isMultiple","roleList","getSessionGroups","whitelistUsers","allow","emails","getWhitelistedUsers","sendRegistrationEmail","email","linkURL","linkUrl","selfRegister","displayName","givenName","familyName","addUser","usersInput","users","u","PARTICIPANT","available","updateUser","removeUser","hasMultiple","statusUpdate","collection","scores","tags","getCount","connect","forWorld","worldKey","google","humanKey","MORPHOLOGY","model","ephemeral","trackingKey","modelContext","executionContext","WORLD","hasPermit","morphology","modelFile","createSingular","getSingularRunKey","clone","runKey","restore","rewind","steps","rewindCount","marked","hidden","closed","timeout","variables","metadata","episodeName","includeEpisodes","finalFilter","userKeyFilter","var","meta","run","variableMap","_run$variables","introspect","introspectWithRunKey","operation","args","ritual","EXORCISE","arguments","getVariables","ignorable","mappify","include","additional","keys","getVariable","variable","updateVariables","getMetadata","runKeyArg","_bodyAsArray$","bodyAsArray","updateMetadata","action","actionList","retrieveFromWorld","removeFromWorld","getWithStrategy","strategy","lastRun","newRun","migrate","uploadCSV","formdata","append","createUser","modality","vaultKey","items","_items$set","_items$push","_items$pop","mutationKey","pop","updateProperties","NOT_FOUND","withScope","byName","define","mutationStrategy","defaultLock","count","AFFILIATE","VONAGE","DAILY","DOMESTIC","MEDIA_FORMAT","mp3","mp4","wav","flac","ogg","amr","webm","LANGUAGE_CODE","getVideoURLByKey","videoKey","getVideoURLWith","family","affiliate","userKeyURIComponent","getVideoDirectoryByKey","getVideoDirectoryWith","getVideoSearch","deleteVideoByKey","postVideoProcessor","downloadVideoByKey","downloadVideoWith","videoAPI","getDirectoryURL","processVideo","processors","log","postToken","initialLayoutClassList","postArchive","getInfo","deleteArchiveByID","archiveID","getProjectID","vonageAPI","apiKey","createSession","generateToken","sessionID","sessionId","startArchive","resolution","stopArchive","OBJECTIVE","MINIMUM","MAXIMUM","MARGINAL","OPTIMAL","WORLD_NAME_GENERATOR_TYPE","colorAnimal","sequential","worldNameGenerator","mine","getAssignments","getSessionWorlds","selfAssign","objective","populace","autoAssignUsers","assignments","requireAllAssignments","keepEmptyWorlds","editAssignments","getAssignmentsByKey","removeUsers","userKeys","Boolean","getPersonas","boundary","PROJECT","boundaryComponent","scopeKeyComponent","setPersonas","personas","assignRun","RETRY_POLICY","trigger","retryPolicy","failSafeTermination","taskKey","getHistory","getTaskIn","updatePermit","chatKey","room","sendMessage","getMessages","maxRecords","horizon","getMessagesForUser","pseudonymKey","getMessagesAdmin","sendMessageAdmin","stage","expectedRoles","defaultActions","transparent","actions","load","forceClose","updateDefaults","submitActions","deleteBarrier","deleteAll","undoSubmit","triggerFor","undoSubmitFor","removeRoleExpectationFor","pause","resume","collectInGroup","barrierMap","somebodyKey","inScope","byEmail","partners","edit","udomeKey","sleep","ms","r","randRange","min","random","RETRY_RANGES","RATE_LIMIT_REACHED","handleRateLimit","requestFunction","retryNumber","getConfig","createRoom","privacy","exp","enable_recording","streaming_endpoints","disableRateLimitHandling","callAPI","epicenter","properties","createToken","room_name","start_video_off","is_owner","user_name","close_tab_on_exit","selfSign","getVideoByRecordingId","recordingId","filePathInfo","videoAdapter","filePaths","contents","a","b","filePath","find","p","updateRecordingStatus","_scope$userKey","validateScope","pushCategory","Channel","has","_errorObj$information","maxRetries","_errorObj$information2","currentRetry","unsubscribeAll","proxy","resource","UNAUTHORIZED","DEFAULT_ERROR_HANDLERS","cometdReconnected","cometdError","authExpired","authAdapter","alert","authGroupExpired","authInvalidated","_session$groupKey","freeze"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAOA,EAAA,IAAI,OAAO,IAAI,UAAUA,SAAO,EAAE;;AAGlC,IAAE,IAAI,EAAE,GAAG,MAAM,CAAC,SAAS;AAC3B,IAAE,IAAI,MAAM,GAAG,EAAE,CAAC,cAAc;IAC9B,IAAI,cAAc,GAAG,MAAM,CAAC,cAAc,IAAI,UAAU,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAA,CAAE;IAClG,IAAIC,WAAS,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