epicenter-libs 3.34.2 → 3.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +61 -86
  3. package/dist/browser/epicenter.js +1581 -226
  4. package/dist/browser/epicenter.js.map +1 -1
  5. package/dist/cjs/epicenter.js +1503 -141
  6. package/dist/cjs/epicenter.js.map +1 -1
  7. package/dist/epicenter.js +1587 -225
  8. package/dist/epicenter.js.map +1 -1
  9. package/dist/epicenter.min.js +1 -1
  10. package/dist/epicenter.min.js.map +1 -1
  11. package/dist/module/epicenter.js +1497 -142
  12. package/dist/module/epicenter.js.map +1 -1
  13. package/dist/types/adapters/docket.d.ts +80 -0
  14. package/dist/types/adapters/encyclopedia.d.ts +86 -0
  15. package/dist/types/adapters/file.d.ts +201 -0
  16. package/dist/types/adapters/git.d.ts +171 -0
  17. package/dist/types/adapters/index.d.ts +8 -1
  18. package/dist/types/adapters/pipeline.d.ts +88 -0
  19. package/dist/types/adapters/powerpoint.d.ts +130 -0
  20. package/dist/types/adapters/registration.d.ts +270 -0
  21. package/dist/types/adapters/task.d.ts +99 -37
  22. package/dist/types/epicenter.d.ts +2 -2
  23. package/dist/types/types.d.ts +6 -1
  24. package/dist/types/utils/router.d.ts +1 -0
  25. package/package.json +12 -7
  26. package/src/adapters/docket.ts +109 -0
  27. package/src/adapters/encyclopedia.ts +128 -0
  28. package/src/adapters/file.ts +332 -0
  29. package/src/adapters/git.ts +278 -0
  30. package/src/adapters/index.ts +14 -0
  31. package/src/adapters/pipeline.ts +145 -0
  32. package/src/adapters/powerpoint.ts +238 -0
  33. package/src/adapters/registration.ts +413 -0
  34. package/src/adapters/task.ts +170 -47
  35. package/src/epicenter.ts +10 -3
  36. package/src/globals.d.ts +6 -0
  37. package/src/types.ts +61 -0
  38. package/src/utils/router.ts +1 -0
@@ -19,7 +19,7 @@ function requireRuntime () {
19
19
  if (hasRequiredRuntime) return runtime.exports;
20
20
  hasRequiredRuntime = 1;
21
21
  (function (module) {
22
- var runtime = (function (exports$1) {
22
+ var runtime = (function (exports) {
23
23
 
24
24
  var Op = Object.prototype;
25
25
  var hasOwn = Op.hasOwnProperty;
@@ -60,7 +60,7 @@ function requireRuntime () {
60
60
 
61
61
  return generator;
62
62
  }
63
- exports$1.wrap = wrap;
63
+ exports.wrap = wrap;
64
64
 
65
65
  // Try/catch helper to minimize deoptimizations. Returns a completion
66
66
  // record like context.tryEntries[i].completion. This interface could
@@ -139,7 +139,7 @@ function requireRuntime () {
139
139
  });
140
140
  }
141
141
 
142
- exports$1.isGeneratorFunction = function(genFun) {
142
+ exports.isGeneratorFunction = function(genFun) {
143
143
  var ctor = typeof genFun === "function" && genFun.constructor;
144
144
  return ctor
145
145
  ? ctor === GeneratorFunction ||
@@ -149,7 +149,7 @@ function requireRuntime () {
149
149
  : false;
150
150
  };
151
151
 
152
- exports$1.mark = function(genFun) {
152
+ exports.mark = function(genFun) {
153
153
  if (Object.setPrototypeOf) {
154
154
  Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
155
155
  } else {
@@ -164,7 +164,7 @@ function requireRuntime () {
164
164
  // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
165
165
  // `hasOwn.call(value, "__await")` to determine if the yielded value is
166
166
  // meant to be awaited.
167
- exports$1.awrap = function(arg) {
167
+ exports.awrap = function(arg) {
168
168
  return { __await: arg };
169
169
  };
170
170
 
@@ -239,12 +239,12 @@ function requireRuntime () {
239
239
  define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
240
240
  return this;
241
241
  });
242
- exports$1.AsyncIterator = AsyncIterator;
242
+ exports.AsyncIterator = AsyncIterator;
243
243
 
244
244
  // Note that simple async functions are implemented on top of
245
245
  // AsyncIterator objects; they just return a Promise for the value of
246
246
  // the final result produced by the iterator.
247
- exports$1.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
247
+ exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
248
248
  if (PromiseImpl === void 0) PromiseImpl = Promise;
249
249
 
250
250
  var iter = new AsyncIterator(
@@ -252,7 +252,7 @@ function requireRuntime () {
252
252
  PromiseImpl
253
253
  );
254
254
 
255
- return exports$1.isGeneratorFunction(outerFn)
255
+ return exports.isGeneratorFunction(outerFn)
256
256
  ? iter // If outerFn is a generator, return the full iterator.
257
257
  : iter.next().then(function(result) {
258
258
  return result.done ? result.value : iter.next();
@@ -472,7 +472,7 @@ function requireRuntime () {
472
472
  this.reset(true);
473
473
  }
474
474
 
475
- exports$1.keys = function(val) {
475
+ exports.keys = function(val) {
476
476
  var object = Object(val);
477
477
  var keys = [];
478
478
  for (var key in object) {
@@ -533,7 +533,7 @@ function requireRuntime () {
533
533
 
534
534
  throw new TypeError(typeof iterable + " is not iterable");
535
535
  }
536
- exports$1.values = values;
536
+ exports.values = values;
537
537
 
538
538
  function doneResult() {
539
539
  return { value: undefined$1, done: true };
@@ -743,7 +743,7 @@ function requireRuntime () {
743
743
  // or not, return the runtime object so that we can declare the variable
744
744
  // regeneratorRuntime in the outer scope, which allows this module to be
745
745
  // injected easily by `bin/regenerator --include-runtime script.js`.
746
- return exports$1;
746
+ return exports;
747
747
 
748
748
  }(
749
749
  // If this script is executing as a CommonJS module, use module.exports
@@ -820,7 +820,7 @@ var hasRequiredBrowserPonyfill;
820
820
  function requireBrowserPonyfill () {
821
821
  if (hasRequiredBrowserPonyfill) return browserPonyfill.exports;
822
822
  hasRequiredBrowserPonyfill = 1;
823
- (function (module, exports$1) {
823
+ (function (module, exports) {
824
824
  // Save global object in a variable
825
825
  var __global__ =
826
826
  (typeof globalThis !== 'undefined' && globalThis) ||
@@ -839,7 +839,7 @@ function requireBrowserPonyfill () {
839
839
  // "globalThis" that's going to be patched
840
840
  (function(globalThis) {
841
841
 
842
- ((function (exports$1) {
842
+ ((function (exports) {
843
843
 
844
844
  /* eslint-disable no-prototype-builtins */
845
845
  var g =
@@ -1352,18 +1352,18 @@ function requireBrowserPonyfill () {
1352
1352
  return new Response(null, {status: status, headers: {location: url}})
1353
1353
  };
1354
1354
 
1355
- exports$1.DOMException = g.DOMException;
1355
+ exports.DOMException = g.DOMException;
1356
1356
  try {
1357
- new exports$1.DOMException();
1357
+ new exports.DOMException();
1358
1358
  } catch (err) {
1359
- exports$1.DOMException = function(message, name) {
1359
+ exports.DOMException = function(message, name) {
1360
1360
  this.message = message;
1361
1361
  this.name = name;
1362
1362
  var error = Error(message);
1363
1363
  this.stack = error.stack;
1364
1364
  };
1365
- exports$1.DOMException.prototype = Object.create(Error.prototype);
1366
- exports$1.DOMException.prototype.constructor = exports$1.DOMException;
1365
+ exports.DOMException.prototype = Object.create(Error.prototype);
1366
+ exports.DOMException.prototype.constructor = exports.DOMException;
1367
1367
  }
1368
1368
 
1369
1369
  function fetch(input, init) {
@@ -1371,7 +1371,7 @@ function requireBrowserPonyfill () {
1371
1371
  var request = new Request(input, init);
1372
1372
 
1373
1373
  if (request.signal && request.signal.aborted) {
1374
- return reject(new exports$1.DOMException('Aborted', 'AbortError'))
1374
+ return reject(new exports.DOMException('Aborted', 'AbortError'))
1375
1375
  }
1376
1376
 
1377
1377
  var xhr = new XMLHttpRequest();
@@ -1413,7 +1413,7 @@ function requireBrowserPonyfill () {
1413
1413
 
1414
1414
  xhr.onabort = function() {
1415
1415
  setTimeout(function() {
1416
- reject(new exports$1.DOMException('Aborted', 'AbortError'));
1416
+ reject(new exports.DOMException('Aborted', 'AbortError'));
1417
1417
  }, 0);
1418
1418
  };
1419
1419
 
@@ -1484,14 +1484,14 @@ function requireBrowserPonyfill () {
1484
1484
  g.Response = Response;
1485
1485
  }
1486
1486
 
1487
- exports$1.Headers = Headers;
1488
- exports$1.Request = Request;
1489
- exports$1.Response = Response;
1490
- exports$1.fetch = fetch;
1487
+ exports.Headers = Headers;
1488
+ exports.Request = Request;
1489
+ exports.Response = Response;
1490
+ exports.fetch = fetch;
1491
1491
 
1492
- Object.defineProperty(exports$1, '__esModule', { value: true });
1492
+ Object.defineProperty(exports, '__esModule', { value: true });
1493
1493
 
1494
- return exports$1;
1494
+ return exports;
1495
1495
 
1496
1496
  }))({});
1497
1497
  })(__globalThis__);
@@ -1500,13 +1500,13 @@ function requireBrowserPonyfill () {
1500
1500
  delete __globalThis__.fetch.polyfill;
1501
1501
  // Choose between native implementation (__global__) or custom implementation (__globalThis__)
1502
1502
  var ctx = __global__.fetch ? __global__ : __globalThis__;
1503
- exports$1 = ctx.fetch; // To enable: import fetch from 'cross-fetch'
1504
- exports$1.default = ctx.fetch; // For TypeScript consumers without esModuleInterop.
1505
- exports$1.fetch = ctx.fetch; // To enable: import {fetch} from 'cross-fetch'
1506
- exports$1.Headers = ctx.Headers;
1507
- exports$1.Request = ctx.Request;
1508
- exports$1.Response = ctx.Response;
1509
- module.exports = exports$1;
1503
+ exports = ctx.fetch; // To enable: import fetch from 'cross-fetch'
1504
+ exports.default = ctx.fetch; // For TypeScript consumers without esModuleInterop.
1505
+ exports.fetch = ctx.fetch; // To enable: import {fetch} from 'cross-fetch'
1506
+ exports.Headers = ctx.Headers;
1507
+ exports.Request = ctx.Request;
1508
+ exports.Response = ctx.Response;
1509
+ module.exports = exports;
1510
1510
  } (browserPonyfill, browserPonyfill.exports));
1511
1511
  return browserPonyfill.exports;
1512
1512
  }
@@ -3312,7 +3312,7 @@ async function channelsEnabled(optionals = {}) {
3312
3312
  * @param [optionals] Optional arguments; pass network call options overrides here.
3313
3313
  * @returns promise that resolves to the project object
3314
3314
  */
3315
- async function get$e(optionals = {}) {
3315
+ async function get$f(optionals = {}) {
3316
3316
  return await new Router().get('/project', optionals).then(({
3317
3317
  body
3318
3318
  }) => body);
@@ -3330,7 +3330,7 @@ async function get$e(optionals = {}) {
3330
3330
  * @param [optionals] Optional arguments; pass network call options overrides here.
3331
3331
  * @returns promise that resolves to an array of project objects
3332
3332
  */
3333
- async function list$4(accountShortName, optionals = {}) {
3333
+ async function list$5(accountShortName, optionals = {}) {
3334
3334
  return await new Router().withAccountShortName(accountShortName).withProjectShortName('manager').get('/project/in', optionals).then(({
3335
3335
  body
3336
3336
  }) => body);
@@ -3343,8 +3343,8 @@ var project = /*#__PURE__*/Object.freeze({
3343
3343
  PHYLOGENY: PHYLOGENY,
3344
3344
  WORKER_PARTITION: WORKER_PARTITION,
3345
3345
  channelsEnabled: channelsEnabled,
3346
- get: get$e,
3347
- list: list$4
3346
+ get: get$f,
3347
+ list: list$5
3348
3348
  });
3349
3349
 
3350
3350
  const AUTH_TOKEN_KEY = 'com.forio.epicenter.token';
@@ -3411,7 +3411,7 @@ class CometdAdapter {
3411
3411
  logLevel: 'warn'
3412
3412
  }) {
3413
3413
  var _project$channelProto;
3414
- const project = await get$e();
3414
+ const project = await get$f();
3415
3415
  if (!project.channelEnabled) throw new EpicenterError('Push Channels are not enabled on this project');
3416
3416
  const channelProtocol = ((_project$channelProto = project.channelProtocol) === null || _project$channelProto === void 0 ? void 0 : _project$channelProto.toLowerCase()) || DEFAULT_CHANNEL_PROTOCOL;
3417
3417
  const {
@@ -4231,7 +4231,7 @@ var authentication = /*#__PURE__*/Object.freeze({
4231
4231
  * @param [optionals.tokenAccessSeconds] How long the presigned URL is valid for in seconds
4232
4232
  * @returns promise that resolves to an asset ticket containing the presigned upload URL
4233
4233
  */
4234
- async function create$a(file, scope, optionals = {}) {
4234
+ async function create$c(file, scope, optionals = {}) {
4235
4235
  const {
4236
4236
  scopeBoundary,
4237
4237
  scopeKey,
@@ -4336,7 +4336,7 @@ async function update$6(file, scope, optionals = {}) {
4336
4336
  * @param [optionals] Optional arguments; pass network call options overrides here.
4337
4337
  * @returns promise that resolves when the asset is deleted
4338
4338
  */
4339
- async function remove$4(assetKey, optionals = {}) {
4339
+ async function remove$5(assetKey, optionals = {}) {
4340
4340
  return await new Router().delete(`/asset/${assetKey}`, optionals).then(({
4341
4341
  body
4342
4342
  }) => body);
@@ -4384,7 +4384,7 @@ async function removeFromScope(scope, optionals = {}) {
4384
4384
  * @param [optionals] Optional arguments; pass network call options overrides here.
4385
4385
  * @returns promise that resolves to the asset metadata
4386
4386
  */
4387
- async function get$d(assetKey, optionals = {}) {
4387
+ async function get$e(assetKey, optionals = {}) {
4388
4388
  const {
4389
4389
  server,
4390
4390
  accountShortName,
@@ -4420,7 +4420,7 @@ async function get$d(assetKey, optionals = {}) {
4420
4420
  * @param [optionals.filter] File pattern to filter assets (e.g., '*.pdf' for PDF files); defaults to '*' (all files)
4421
4421
  * @returns promise that resolves to a list of assets
4422
4422
  */
4423
- async function list$3(scope, optionals = {}) {
4423
+ async function list$4(scope, optionals = {}) {
4424
4424
  const {
4425
4425
  scopeBoundary,
4426
4426
  scopeKey,
@@ -4513,7 +4513,7 @@ async function getURLWithScope(file, scope, optionals = {}) {
4513
4513
  * @param [optionals.tokenAccessSeconds] How long the presigned URL is valid for in seconds
4514
4514
  * @returns promise that resolves when the download is complete
4515
4515
  */
4516
- async function download$1(assetKey, optionals = {}) {
4516
+ async function download$2(assetKey, optionals = {}) {
4517
4517
  const {
4518
4518
  tokenAccessSeconds,
4519
4519
  ...routingOptions
@@ -4601,7 +4601,7 @@ async function store(file, scope, optionals = {}) {
4601
4601
  const name = fileName !== null && fileName !== void 0 ? fileName : file.name;
4602
4602
  let presignedUrl = '';
4603
4603
  try {
4604
- const response = await create$a(name, scope, {
4604
+ const response = await create$c(name, scope, {
4605
4605
  inert: true,
4606
4606
  ...remaining
4607
4607
  });
@@ -4625,14 +4625,14 @@ async function store(file, scope, optionals = {}) {
4625
4625
 
4626
4626
  var asset = /*#__PURE__*/Object.freeze({
4627
4627
  __proto__: null,
4628
- create: create$a,
4629
- download: download$1,
4628
+ create: create$c,
4629
+ download: download$2,
4630
4630
  downloadWithScope: downloadWithScope,
4631
- get: get$d,
4631
+ get: get$e,
4632
4632
  getURL: getURL$1,
4633
4633
  getURLWithScope: getURLWithScope,
4634
- list: list$3,
4635
- remove: remove$4,
4634
+ list: list$4,
4635
+ remove: remove$5,
4636
4636
  removeFromScope: removeFromScope,
4637
4637
  store: store,
4638
4638
  update: update$6
@@ -4840,7 +4840,7 @@ var email = /*#__PURE__*/Object.freeze({
4840
4840
  * @param [optionals.category] Optional argument to allow for establishing episode hierarchies
4841
4841
  * @returns promise that resolves to the newly created episode
4842
4842
  */
4843
- async function create$9(name, groupName, optionals = {}) {
4843
+ async function create$b(name, groupName, optionals = {}) {
4844
4844
  const {
4845
4845
  draft,
4846
4846
  runLimit,
@@ -4872,7 +4872,7 @@ async function create$9(name, groupName, optionals = {}) {
4872
4872
  * @param [optionals] Optional arguments; pass network call options overrides here.
4873
4873
  * @returns promise that resolves to an episode
4874
4874
  */
4875
- async function get$c(episodeKey, optionals = {}) {
4875
+ async function get$d(episodeKey, optionals = {}) {
4876
4876
  return await new Router().get(`/episode/${episodeKey}`, optionals).then(({
4877
4877
  body
4878
4878
  }) => body);
@@ -4908,7 +4908,7 @@ async function get$c(episodeKey, optionals = {}) {
4908
4908
  * @param [optionals] Optional arguments; pass network call options overrides here.
4909
4909
  * @returns promise that resolves to a page of episodes
4910
4910
  */
4911
- async function query$4(searchOptions, optionals = {}) {
4911
+ async function query$5(searchOptions, optionals = {}) {
4912
4912
  const {
4913
4913
  filter,
4914
4914
  sort = [],
@@ -4982,7 +4982,7 @@ async function withName(name, optionals = {}) {
4982
4982
  * @param [optionals] Optional arguments; pass network call options overrides here.
4983
4983
  * @returns promise that resolves to undefined if successful
4984
4984
  */
4985
- async function remove$3(episodeKey, optionals = {}) {
4985
+ async function remove$4(episodeKey, optionals = {}) {
4986
4986
  return await new Router().delete(`/episode/${episodeKey}`, optionals).then(({
4987
4987
  body
4988
4988
  }) => body);
@@ -4990,11 +4990,11 @@ async function remove$3(episodeKey, optionals = {}) {
4990
4990
 
4991
4991
  var episode = /*#__PURE__*/Object.freeze({
4992
4992
  __proto__: null,
4993
- create: create$9,
4993
+ create: create$b,
4994
4994
  forGroup: forGroup$1,
4995
- get: get$c,
4996
- query: query$4,
4997
- remove: remove$3,
4995
+ get: get$d,
4996
+ query: query$5,
4997
+ remove: remove$4,
4998
4998
  withName: withName
4999
4999
  });
5000
5000
 
@@ -5017,7 +5017,7 @@ var episode = /*#__PURE__*/Object.freeze({
5017
5017
  * @param [optionals.groupKey] Group key; if omitted will attempt to use the group associated with the current session
5018
5018
  * @returns promise that resolves to a group
5019
5019
  */
5020
- async function get$b(optionals = {}) {
5020
+ async function get$c(optionals = {}) {
5021
5021
  const {
5022
5022
  groupKey,
5023
5023
  augment,
@@ -5167,7 +5167,7 @@ async function update$5(groupKey, update, optionals = {}) {
5167
5167
  * @param [optionals] Optional arguments; pass network call options overrides here.
5168
5168
  * @returns promise that resolves to the newly created group
5169
5169
  */
5170
- async function create$8(group, optionals = {}) {
5170
+ async function create$a(group, optionals = {}) {
5171
5171
  const {
5172
5172
  name,
5173
5173
  runLimit,
@@ -5234,7 +5234,7 @@ async function create$8(group, optionals = {}) {
5234
5234
  * @param [optionals] Optional arguments; pass network call options overrides here.
5235
5235
  * @returns promise that resolves to a page of groups
5236
5236
  */
5237
- async function query$3(searchOptions, optionals = {}) {
5237
+ async function query$4(searchOptions, optionals = {}) {
5238
5238
  const {
5239
5239
  filter,
5240
5240
  sort = [],
@@ -5273,7 +5273,7 @@ async function search(optionals = {}) {
5273
5273
  max,
5274
5274
  quantized
5275
5275
  };
5276
- return await query$3(searchOptions, routingOptions);
5276
+ return await query$4(searchOptions, routingOptions);
5277
5277
  }
5278
5278
 
5279
5279
  /**
@@ -5646,14 +5646,14 @@ async function statusUpdate(code, message, optionals = {}) {
5646
5646
  var group = /*#__PURE__*/Object.freeze({
5647
5647
  __proto__: null,
5648
5648
  addUser: addUser$1,
5649
- create: create$8,
5649
+ create: create$a,
5650
5650
  destroy: destroy$2,
5651
5651
  forUser: forUser,
5652
5652
  gather: gather,
5653
- get: get$b,
5653
+ get: get$c,
5654
5654
  getSessionGroups: getSessionGroups,
5655
5655
  getWhitelistedUsers: getWhitelistedUsers,
5656
- query: query$3,
5656
+ query: query$4,
5657
5657
  removeUser: removeUser,
5658
5658
  search: search,
5659
5659
  selfRegister: selfRegister,
@@ -5752,7 +5752,7 @@ async function update$4(collection, scope, scores, optionals = {}) {
5752
5752
  * @param [optionals] Optional arguments; pass network call options overrides here.
5753
5753
  * @returns promise that resolves to a list of leaderboard entries
5754
5754
  */
5755
- async function list$2(collection, scope, searchOptions, optionals = {}) {
5755
+ async function list$3(collection, scope, searchOptions, optionals = {}) {
5756
5756
  const {
5757
5757
  scopeBoundary,
5758
5758
  scopeKey
@@ -5773,9 +5773,9 @@ async function list$2(collection, scope, searchOptions, optionals = {}) {
5773
5773
  body
5774
5774
  }) => body);
5775
5775
  }
5776
- async function get$a(collection, scope, searchOptions, optionals = {}) {
5776
+ async function get$b(collection, scope, searchOptions, optionals = {}) {
5777
5777
  console.warn('DEPRECATION WARNING: leaderboardAdapter.get is deprecated and will be removed with the next release. Use leaderboardAdapter.list instead.');
5778
- return await list$2(collection, scope, searchOptions, optionals);
5778
+ return await list$3(collection, scope, searchOptions, optionals);
5779
5779
  }
5780
5780
 
5781
5781
  /**
@@ -5821,9 +5821,9 @@ async function getCount(collection, scope, searchOptions, optionals = {}) {
5821
5821
 
5822
5822
  var leaderboard = /*#__PURE__*/Object.freeze({
5823
5823
  __proto__: null,
5824
- get: get$a,
5824
+ get: get$b,
5825
5825
  getCount: getCount,
5826
- list: list$2,
5826
+ list: list$3,
5827
5827
  update: update$4
5828
5828
  });
5829
5829
 
@@ -5972,7 +5972,7 @@ let MORPHOLOGY = /*#__PURE__*/function (MORPHOLOGY) {
5972
5972
  * @param [optionals.allowChannel] Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT
5973
5973
  * @returns promise that resolves to the newly created run
5974
5974
  */
5975
- async function create$7(model, scope, optionals = {}) {
5975
+ async function create$9(model, scope, optionals = {}) {
5976
5976
  const {
5977
5977
  scopeBoundary,
5978
5978
  scopeKey,
@@ -6263,7 +6263,7 @@ async function update$3(runKey, update, optionals = {}) {
6263
6263
  * @param [optionals] Optional arguments; pass network call options overrides here.
6264
6264
  * @returns promise that resolve to undefined if successful
6265
6265
  */
6266
- async function remove$2(runKey, optionals = {}) {
6266
+ async function remove$3(runKey, optionals = {}) {
6267
6267
  return await new Router().delete(`/run/${runKey}`, optionals).then(({
6268
6268
  body
6269
6269
  }) => body);
@@ -6281,7 +6281,7 @@ async function remove$2(runKey, optionals = {}) {
6281
6281
  * @param [optionals] Optional arguments; pass network call options overrides here.
6282
6282
  * @returns promise that resolves to the run
6283
6283
  */
6284
- async function get$9(runKey, optionals = {}) {
6284
+ async function get$a(runKey, optionals = {}) {
6285
6285
  return await new Router().get(`/run/${runKey}`, optionals).then(({
6286
6286
  body
6287
6287
  }) => body);
@@ -6323,7 +6323,7 @@ async function get$9(runKey, optionals = {}) {
6323
6323
  * @param [optionals] Optional arguments; pass network call options overrides here.
6324
6324
  * @returns promise that resolves to a page of runs
6325
6325
  */
6326
- async function query$2(model, searchOptions, optionals = {}) {
6326
+ async function query$3(model, searchOptions, optionals = {}) {
6327
6327
  const {
6328
6328
  filter,
6329
6329
  sort = [],
@@ -6880,15 +6880,15 @@ async function getWithStrategy(strategy, model, scope, optionals = {}) {
6880
6880
  };
6881
6881
  const {
6882
6882
  values: [lastRun]
6883
- } = await query$2(model, searchOptions);
6883
+ } = await query$3(model, searchOptions);
6884
6884
  if (!lastRun) {
6885
- const newRun = await create$7(model, scope, optionals);
6885
+ const newRun = await create$9(model, scope, optionals);
6886
6886
  // await serial(newRun.runKey, initOperations, optionals = {});
6887
6887
  return newRun;
6888
6888
  }
6889
6889
  return lastRun;
6890
6890
  } else if (strategy === 'reuse-never') {
6891
- const newRun = await create$7(model, scope, optionals);
6891
+ const newRun = await create$9(model, scope, optionals);
6892
6892
  // await serial(newRun.runKey, initOperations, optionals = {});
6893
6893
  return newRun;
6894
6894
  } else ;
@@ -6941,9 +6941,9 @@ var run = /*#__PURE__*/Object.freeze({
6941
6941
  MORPHOLOGY: MORPHOLOGY,
6942
6942
  action: action,
6943
6943
  clone: clone,
6944
- create: create$7,
6944
+ create: create$9,
6945
6945
  createSingular: createSingular,
6946
- get: get$9,
6946
+ get: get$a,
6947
6947
  getMetadata: getMetadata,
6948
6948
  getSingularRunKey: getSingularRunKey,
6949
6949
  getVariable: getVariable,
@@ -6953,8 +6953,8 @@ var run = /*#__PURE__*/Object.freeze({
6953
6953
  introspectWithRunKey: introspectWithRunKey,
6954
6954
  migrate: migrate,
6955
6955
  operation: operation,
6956
- query: query$2,
6957
- remove: remove$2,
6956
+ query: query$3,
6957
+ remove: remove$3,
6958
6958
  removeFromWorld: removeFromWorld,
6959
6959
  restore: restore,
6960
6960
  retrieveFromWorld: retrieveFromWorld,
@@ -7036,7 +7036,7 @@ async function createUser(view, optionals = {}) {
7036
7036
  * @param [optionals] Optional arguments; pass network call options overrides here.
7037
7037
  * @returns promise that resolves to a user
7038
7038
  */
7039
- async function get$8(userKey, optionals = {}) {
7039
+ async function get$9(userKey, optionals = {}) {
7040
7040
  return await new Router().get(`/user/${userKey}`, optionals).then(({
7041
7041
  body
7042
7042
  }) => body);
@@ -7069,7 +7069,7 @@ async function getWithHandle(handle, optionals = {}) {
7069
7069
  var user = /*#__PURE__*/Object.freeze({
7070
7070
  __proto__: null,
7071
7071
  createUser: createUser,
7072
- get: get$8,
7072
+ get: get$9,
7073
7073
  getWithHandle: getWithHandle,
7074
7074
  uploadCSV: uploadCSV
7075
7075
  });
@@ -7160,7 +7160,7 @@ const NOT_FOUND$4 = 404;
7160
7160
  * @param [optionals] Optional arguments; pass network call options overrides here.
7161
7161
  * @returns promise that resolves to the vault, or undefined if not found
7162
7162
  */
7163
- async function get$7(vaultKey, optionals = {}) {
7163
+ async function get$8(vaultKey, optionals = {}) {
7164
7164
  return await new Router().get(`/vault/${vaultKey}`, optionals).catch(error => {
7165
7165
  if (error.status === NOT_FOUND$4) return {
7166
7166
  body: undefined
@@ -7260,7 +7260,7 @@ async function byName$1(name, optionals = {}) {
7260
7260
  * @param [optionals.mutationKey] Mutation key for optimistic concurrency control
7261
7261
  * @returns promise that resolves to undefined when successful
7262
7262
  */
7263
- async function remove$1(vaultKey, optionals = {}) {
7263
+ async function remove$2(vaultKey, optionals = {}) {
7264
7264
  const {
7265
7265
  mutationKey,
7266
7266
  ...routingOptions
@@ -7375,7 +7375,7 @@ async function define(name, scope, optionals = {}) {
7375
7375
  * @param [optionals.mutationStrategy] Mutation strategy: ALLOW (upsert), DISALLOW (insert without update), ERROR (insert with conflict exception if exists)
7376
7376
  * @returns promise that resolves to the created vault
7377
7377
  */
7378
- async function create$6(name, scope, items, optionals = {}) {
7378
+ async function create$8(name, scope, items, optionals = {}) {
7379
7379
  console.warn('DEPRECATION WARNING: vaultAdapter.create is deprecated and will be removed with the next release. Use vaultAdapter.define instead.');
7380
7380
  return await define(name, scope, {
7381
7381
  items,
@@ -7407,7 +7407,7 @@ async function create$6(name, scope, items, optionals = {}) {
7407
7407
  * @param [optionals.groupName] Name of the group
7408
7408
  * @returns promise that resolves to an array of vaults that match the search options
7409
7409
  */
7410
- async function list$1(searchOptions, optionals = {}) {
7410
+ async function list$2(searchOptions, optionals = {}) {
7411
7411
  const {
7412
7412
  first,
7413
7413
  filter,
@@ -7472,11 +7472,11 @@ var vault = /*#__PURE__*/Object.freeze({
7472
7472
  __proto__: null,
7473
7473
  byName: byName$1,
7474
7474
  count: count,
7475
- create: create$6,
7475
+ create: create$8,
7476
7476
  define: define,
7477
- get: get$7,
7478
- list: list$1,
7479
- remove: remove$1,
7477
+ get: get$8,
7478
+ list: list$2,
7479
+ remove: remove$2,
7480
7480
  update: update$2,
7481
7481
  updateProperties: updateProperties,
7482
7482
  withScope: withScope$1
@@ -7801,7 +7801,7 @@ var video$1 = /*#__PURE__*/Object.freeze({
7801
7801
  * @param [optionals] Optional arguments; pass network call options overrides here.
7802
7802
  * @returns promise that resolves to undefined when successful
7803
7803
  */
7804
- async function remove(videoKey, optionals = {}) {
7804
+ async function remove$1(videoKey, optionals = {}) {
7805
7805
  return deleteVideoByKey(videoKey, optionals);
7806
7806
  }
7807
7807
 
@@ -7826,7 +7826,7 @@ async function remove(videoKey, optionals = {}) {
7826
7826
  * @param [optionals] Optional arguments; pass network call options overrides here.
7827
7827
  * @returns promise that resolves to a page of video objects
7828
7828
  */
7829
- async function query$1(searchOptions, optionals = {}) {
7829
+ async function query$2(searchOptions, optionals = {}) {
7830
7830
  const {
7831
7831
  filter,
7832
7832
  sort = [],
@@ -8016,7 +8016,7 @@ async function processVideo(videoKey, processors, optionals = {}) {
8016
8016
  * @param [optionals.videoKey] Key for the video object
8017
8017
  * @returns promise that resolves to undefined when download is complete
8018
8018
  */
8019
- async function download(file, optionals = {}) {
8019
+ async function download$1(file, optionals = {}) {
8020
8020
  const {
8021
8021
  scope,
8022
8022
  affiliate,
@@ -8035,12 +8035,12 @@ async function download(file, optionals = {}) {
8035
8035
 
8036
8036
  var video = /*#__PURE__*/Object.freeze({
8037
8037
  __proto__: null,
8038
- download: download,
8038
+ download: download$1,
8039
8039
  getDirectoryURL: getDirectoryURL,
8040
8040
  getURL: getURL,
8041
8041
  processVideo: processVideo,
8042
- query: query$1,
8043
- remove: remove
8042
+ query: query$2,
8043
+ remove: remove$1
8044
8044
  });
8045
8045
 
8046
8046
  /**
@@ -8387,7 +8387,7 @@ async function destroy$1(worldKey, optionals = {}) {
8387
8387
  * @param [optionals.allowChannel] Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT
8388
8388
  * @returns promise that resolves to the newly created world
8389
8389
  */
8390
- async function create$5(optionals = {}) {
8390
+ async function create$7(optionals = {}) {
8391
8391
  const {
8392
8392
  name,
8393
8393
  displayName,
@@ -8429,7 +8429,7 @@ async function create$5(optionals = {}) {
8429
8429
  * @param [optionals.mine] Flag for indicating to get only the worlds the requesting user is in (based on session token)
8430
8430
  * @returns promise that resolves to a list of worlds
8431
8431
  */
8432
- async function get$6(optionals = {}) {
8432
+ async function get$7(optionals = {}) {
8433
8433
  const {
8434
8434
  groupName,
8435
8435
  episodeName,
@@ -8810,10 +8810,10 @@ var world = /*#__PURE__*/Object.freeze({
8810
8810
  WORLD_NAME_GENERATOR_TYPE: WORLD_NAME_GENERATOR_TYPE,
8811
8811
  assignRun: assignRun,
8812
8812
  autoAssignUsers: autoAssignUsers,
8813
- create: create$5,
8813
+ create: create$7,
8814
8814
  destroy: destroy$1,
8815
8815
  editAssignments: editAssignments,
8816
- get: get$6,
8816
+ get: get$7,
8817
8817
  getAssignments: getAssignments,
8818
8818
  getAssignmentsByKey: getAssignmentsByKey,
8819
8819
  getPersonas: getPersonas,
@@ -8838,7 +8838,7 @@ var world = /*#__PURE__*/Object.freeze({
8838
8838
  * @returns promise that resolves to the current server time in ISO 8601 format, or undefined if not found
8839
8839
  */
8840
8840
  const NOT_FOUND$3 = 404;
8841
- async function get$5(optionals = {}) {
8841
+ async function get$6(optionals = {}) {
8842
8842
  return await new Router().get('/time', optionals).catch(error => {
8843
8843
  if (error.status === NOT_FOUND$3) return {
8844
8844
  body: undefined
@@ -8851,15 +8851,13 @@ async function get$5(optionals = {}) {
8851
8851
 
8852
8852
  var time = /*#__PURE__*/Object.freeze({
8853
8853
  __proto__: null,
8854
- get: get$5
8854
+ get: get$6
8855
8855
  });
8856
8856
 
8857
8857
  let RETRY_POLICY = /*#__PURE__*/function (RETRY_POLICY) {
8858
8858
  RETRY_POLICY["DO_NOTHING"] = "DO_NOTHING";
8859
8859
  // If the task fails, do nothing (this is the default)
8860
- RETRY_POLICY["RESCHEDULE"] = "RESCHEDULE";
8861
- // If the task fails retry at the next scheduled time point
8862
- RETRY_POLICY["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
8860
+ RETRY_POLICY["FIRE_ON_FAIL_SAFE"] = "FIRE_ON_FAIL_SAFE"; // Retry within the task's fail-safe execution window
8863
8861
  return RETRY_POLICY;
8864
8862
  }({});
8865
8863
 
@@ -8876,7 +8874,7 @@ let RETRY_POLICY = /*#__PURE__*/function (RETRY_POLICY) {
8876
8874
  // Task response structure
8877
8875
 
8878
8876
  /**
8879
- * Creates a task; requires support level authentication
8877
+ * Creates a task; requires facilitator (or higher) privileges
8880
8878
  * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/task`
8881
8879
  *
8882
8880
  * @example
@@ -8888,7 +8886,9 @@ let RETRY_POLICY = /*#__PURE__*/function (RETRY_POLICY) {
8888
8886
  * const name = 'task-1-send-emails';
8889
8887
  * const payload = {
8890
8888
  * method: 'POST',
8891
- * url: 'https://forio.com/app/forio-dev/test-project/send-out-emails',
8889
+ * url: '/send-out-emails',
8890
+ * target: 'PROXY', // fire at the project's proxy server; omit to fire at the app
8891
+ * body: {},
8892
8892
  * };
8893
8893
  * const trigger = {
8894
8894
  * value: '0 7 15 * * ?', // triggers on day 15 7am of each month
@@ -8901,11 +8901,13 @@ let RETRY_POLICY = /*#__PURE__*/function (RETRY_POLICY) {
8901
8901
  * @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.
8902
8902
  * @param [scope.userKey] Key associated with the user
8903
8903
  * @param name Name of the task
8904
- * @param payload An HTTP task object that will be executed when the task is triggered
8905
- * @param payload.method Type of method to use with the HTTP request (e.g., 'GET', 'POST', 'PATCH')
8906
- * @param payload.url The URL the HTTP request will be sent to
8907
- * @param [payload.body] The body of the HTTP request
8908
- * @param [payload.headers] Headers to send along with the HTTP request
8904
+ * @param payload An HTTP request or group-status change to execute when the task is triggered
8905
+ * @param payload.method Type of method to use with the HTTP request (e.g., 'GET', 'POST')
8906
+ * @param payload.url Relative URL the HTTP request will be sent to; the task runner builds the full URL as `{host}{targetPath}/{account}/{project}{url}`
8907
+ * @param [payload.target] Where the task fires: 'APPLICATION' (the project app, `/app`, the default) or 'PROXY' (the project's proxy server, `/proxy`)
8908
+ * @param payload.body The JSON body of the HTTP request
8909
+ * @param [payload.headers] Headers to send along with the HTTP request; must be non-empty when provided — omit rather than pass an empty object
8910
+ * @param [payload.timeoutSeconds] Request timeout in seconds (1–30)
8909
8911
  * @param trigger Object that determines when to run the task (cron, offset, or date)
8910
8912
  * @param [trigger.value] For cron: cron expression (e.g., '0 7 * * * ?'). For date: ISO-8601 date-time string
8911
8913
  * @param [trigger.objectType] Type of trigger: 'cron', 'offset', or 'date'
@@ -8916,23 +8918,24 @@ let RETRY_POLICY = /*#__PURE__*/function (RETRY_POLICY) {
8916
8918
  * @param [optionals.accountShortName] Name of account (by default will be the account associated with the session)
8917
8919
  * @param [optionals.projectShortName] Name of project (by default will be the project associated with the session)
8918
8920
  * @param [optionals.retryPolicy] Specifies what to do should the task fail; see RETRY_POLICY
8919
- * @param [optionals.failSafeTermination] The ISO-8601 date-time when the task will be deleted regardless of any triggers; defaults to null
8920
- * @param [optionals.ttlSeconds] Max life expectancy of the task; used to determine if retrying the task is necessary
8921
+ * @param [optionals.failSafeTermination] ISO-8601 deadline after which the task terminates; the server defaults and caps this at one year from creation
8922
+ * @param [optionals.ttlSeconds] Execution fail-safe window in seconds; the server applies its configured minimum
8921
8923
  * @returns promise that resolves to the task object including the taskKey
8922
8924
  */
8923
- async function create$4(scope, name, payload, trigger, optionals = {}) {
8925
+ async function create$6(scope, name, payload, trigger, optionals = {}) {
8924
8926
  const {
8925
8927
  retryPolicy,
8926
8928
  failSafeTermination,
8927
8929
  ttlSeconds,
8928
8930
  ...routingOptions
8929
8931
  } = optionals;
8932
+ const normalizedPayload = payload.objectType === 'groupStatus' ? payload : {
8933
+ ...payload,
8934
+ objectType: 'http'
8935
+ };
8930
8936
  return await new Router().post('/task', {
8931
8937
  body: {
8932
- payload: {
8933
- objectType: 'http',
8934
- ...payload
8935
- },
8938
+ payload: normalizedPayload,
8936
8939
  trigger,
8937
8940
  retryPolicy,
8938
8941
  failSafeTermination,
@@ -8947,7 +8950,7 @@ async function create$4(scope, name, payload, trigger, optionals = {}) {
8947
8950
  }
8948
8951
 
8949
8952
  /**
8950
- * Deletes a task (changes status to cancelled); requires support level authentication
8953
+ * Deletes a task (changes status to cancelled); requires facilitator (or higher) privileges
8951
8954
  * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/task/{TASK_KEY}`
8952
8955
  *
8953
8956
  * @example
@@ -8956,7 +8959,7 @@ async function create$4(scope, name, payload, trigger, optionals = {}) {
8956
8959
  * await taskAdapter.destroy(taskKey);
8957
8960
  *
8958
8961
  * @param taskKey Unique key associated with a task
8959
- * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
8962
+ * @param [optionals] Optional arguments; pass network call options overrides here.
8960
8963
  * @param [optionals.accountShortName] Name of account (by default will be the account associated with the session)
8961
8964
  * @param [optionals.projectShortName] Name of project (by default will be the project associated with the session)
8962
8965
  * @returns promise that resolves to undefined when successful
@@ -8968,7 +8971,7 @@ async function destroy(taskKey, optionals = {}) {
8968
8971
  }
8969
8972
 
8970
8973
  /**
8971
- * Gets a task by taskKey; requires support level authentication
8974
+ * Gets a task by taskKey; requires facilitator (or higher) privileges
8972
8975
  * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/task/{TASK_KEY}`
8973
8976
  *
8974
8977
  * @example
@@ -8977,19 +8980,19 @@ async function destroy(taskKey, optionals = {}) {
8977
8980
  * const task = await taskAdapter.get(taskKey);
8978
8981
  *
8979
8982
  * @param taskKey Unique key associated with a task
8980
- * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
8983
+ * @param [optionals] Optional arguments; pass network call options overrides here.
8981
8984
  * @param [optionals.accountShortName] Name of account (by default will be the account associated with the session)
8982
8985
  * @param [optionals.projectShortName] Name of project (by default will be the project associated with the session)
8983
8986
  * @returns promise that resolves to the task object
8984
8987
  */
8985
- async function get$4(taskKey, optionals = {}) {
8988
+ async function get$5(taskKey, optionals = {}) {
8986
8989
  return await new Router().get(`/task/${taskKey}`, optionals).then(({
8987
8990
  body
8988
8991
  }) => body);
8989
8992
  }
8990
8993
 
8991
8994
  /**
8992
- * Gets the history (100 most recent times it has triggered) of a task by taskKey; requires support level authentication
8995
+ * Gets the history (100 most recent times it has triggered) of a task by taskKey; requires facilitator (or higher) privileges
8993
8996
  * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/task/history/{TASK_KEY}`
8994
8997
  *
8995
8998
  * @example
@@ -8998,19 +9001,32 @@ async function get$4(taskKey, optionals = {}) {
8998
9001
  * const history = await taskAdapter.getHistory(taskKey);
8999
9002
  *
9000
9003
  * @param taskKey Unique key associated with a task
9001
- * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
9004
+ * @param [optionals] Pagination and network options
9005
+ * @param [optionals.first] Zero-based index of the first history record; defaults to 0
9006
+ * @param [optionals.max] Maximum history records to return; defaults to 100 and cannot exceed 100
9002
9007
  * @param [optionals.accountShortName] Name of account (by default will be the account associated with the session)
9003
9008
  * @param [optionals.projectShortName] Name of project (by default will be the project associated with the session)
9004
- * @returns promise that resolves to an array of task history objects
9009
+ * @returns promise that resolves to a page of task history objects
9005
9010
  */
9006
9011
  async function getHistory(taskKey, optionals = {}) {
9007
- return await new Router().get(`/task/history/${taskKey}`, optionals).then(({
9012
+ const {
9013
+ first,
9014
+ max,
9015
+ ...routingOptions
9016
+ } = optionals;
9017
+ return await new Router().withSearchParams({
9018
+ first,
9019
+ max
9020
+ }).get(`/task/history/${taskKey}`, {
9021
+ paginated: true,
9022
+ ...routingOptions
9023
+ }).then(({
9008
9024
  body
9009
9025
  }) => body);
9010
9026
  }
9011
9027
 
9012
9028
  /**
9013
- * Gets most recent 100 tasks related to the selected scope; requires support level authentication
9029
+ * Gets most recent 100 tasks related to the selected scope; requires facilitator (or higher) privileges
9014
9030
  * 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}`
9015
9031
  *
9016
9032
  * 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.
@@ -9027,10 +9043,13 @@ async function getHistory(taskKey, optionals = {}) {
9027
9043
  * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types
9028
9044
  * @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.
9029
9045
  * @param [scope.userKey] Key associated with the user; will retrieve tasks in the scope that were made by the specified user
9030
- * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
9046
+ * @param [optionals] Pagination, sorting, and network options
9047
+ * @param [optionals.sort] Task fields to sort by
9048
+ * @param [optionals.first] Zero-based index of the first task; defaults to 0
9049
+ * @param [optionals.max] Maximum tasks to return; defaults to 100 and cannot exceed 100
9031
9050
  * @param [optionals.accountShortName] Name of account (by default will be the account associated with the session)
9032
9051
  * @param [optionals.projectShortName] Name of project (by default will be the project associated with the session)
9033
- * @returns promise that resolves to an array of task objects
9052
+ * @returns promise that resolves to a page of task objects
9034
9053
  */
9035
9054
  async function getTaskIn(scope, optionals = {}) {
9036
9055
  const {
@@ -9038,7 +9057,70 @@ async function getTaskIn(scope, optionals = {}) {
9038
9057
  scopeKey,
9039
9058
  userKey
9040
9059
  } = scope;
9041
- return await new Router().get(`/task/in/${scopeBoundary}/${scopeKey}${userKey ? `/${userKey}` : ''}`, optionals).then(({
9060
+ const {
9061
+ sort = [],
9062
+ first,
9063
+ max,
9064
+ ...routingOptions
9065
+ } = optionals;
9066
+ return await new Router().withSearchParams({
9067
+ sort: sort.join(';') || undefined,
9068
+ first,
9069
+ max
9070
+ }).get(`/task/in/${scopeBoundary}/${scopeKey}${userKey ? `/${userKey}` : ''}`, {
9071
+ paginated: true,
9072
+ ...routingOptions
9073
+ }).then(({
9074
+ body
9075
+ }) => body);
9076
+ }
9077
+
9078
+ /**
9079
+ * Queries for tasks
9080
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/task/search`
9081
+ *
9082
+ * No authentication is required; results use facilitator-level row visibility.
9083
+ * Filterable/sortable fields include
9084
+ * `task.taskKey`, `task.name`, `task.status`, `task.scopeBoundary`, `task.scopeKey`,
9085
+ * `task.userKey`, `task.groupName`, `task.episodeName`, `task.nextExecution`,
9086
+ * `task.failSafeExecution`, and `task.created`.
9087
+ *
9088
+ * @example
9089
+ * import { taskAdapter } from 'epicenter-libs';
9090
+ * const page = await taskAdapter.query({
9091
+ * filter: [
9092
+ * 'task.scopeKey=0000017dd3bf540e5ada5b1e058f08f20461', // tasks scoped to this group
9093
+ * 'task.status=INITIALIZED', // that have not yet fired
9094
+ * ],
9095
+ * sort: ['-task.created'], // newest first
9096
+ * max: 10, // page should only include the first 10 items
9097
+ * });
9098
+ *
9099
+ * @param searchOptions Search options for the query
9100
+ * @param [searchOptions.filter] Filters for searching
9101
+ * @param [searchOptions.sort] Sorting criteria
9102
+ * @param [searchOptions.first] The starting index of the page returned
9103
+ * @param [searchOptions.max] The number of entries per page
9104
+ * @param [optionals] Optional arguments; pass network call options overrides here.
9105
+ * @returns promise that resolves to a page of tasks
9106
+ */
9107
+ async function query$1(searchOptions, optionals = {}) {
9108
+ const {
9109
+ filter,
9110
+ sort = [],
9111
+ first,
9112
+ max
9113
+ } = searchOptions;
9114
+ const searchParams = {
9115
+ filter: parseFilterInput(filter),
9116
+ sort: sort.join(';') || undefined,
9117
+ first,
9118
+ max
9119
+ };
9120
+ return await new Router().withSearchParams(searchParams).get('/task/search', {
9121
+ paginated: true,
9122
+ ...optionals
9123
+ }).then(({
9042
9124
  body
9043
9125
  }) => body);
9044
9126
  }
@@ -9046,11 +9128,12 @@ async function getTaskIn(scope, optionals = {}) {
9046
9128
  var task = /*#__PURE__*/Object.freeze({
9047
9129
  __proto__: null,
9048
9130
  RETRY_POLICY: RETRY_POLICY,
9049
- create: create$4,
9131
+ create: create$6,
9050
9132
  destroy: destroy,
9051
- get: get$4,
9133
+ get: get$5,
9052
9134
  getHistory: getHistory,
9053
- getTaskIn: getTaskIn
9135
+ getTaskIn: getTaskIn,
9136
+ query: query$1
9054
9137
  });
9055
9138
 
9056
9139
  /**
@@ -9102,7 +9185,7 @@ async function updatePermit(chatKey, permit, optionals = {}) {
9102
9185
  * @param [optionals] Optional arguments; pass network call options overrides here.
9103
9186
  * @returns promise that resolves to the newly created chat
9104
9187
  */
9105
- async function create$3(room, scope, permit, optionals = {}) {
9188
+ async function create$5(room, scope, permit, optionals = {}) {
9106
9189
  return new Router().post('/chat', {
9107
9190
  body: {
9108
9191
  scope: {
@@ -9130,7 +9213,7 @@ async function create$3(room, scope, permit, optionals = {}) {
9130
9213
  * @param [optionals] Optional arguments; pass network call options overrides here.
9131
9214
  * @returns promise that resolves to the chat
9132
9215
  */
9133
- async function get$3(chatKey, optionals = {}) {
9216
+ async function get$4(chatKey, optionals = {}) {
9134
9217
  return new Router().get(`/chat/${chatKey}`, optionals).then(({
9135
9218
  body
9136
9219
  }) => body);
@@ -9346,8 +9429,8 @@ async function sendMessageAdmin(chatKey, message, optionals = {}) {
9346
9429
 
9347
9430
  var chat = /*#__PURE__*/Object.freeze({
9348
9431
  __proto__: null,
9349
- create: create$3,
9350
- get: get$3,
9432
+ create: create$5,
9433
+ get: get$4,
9351
9434
  getMessages: getMessages,
9352
9435
  getMessagesAdmin: getMessagesAdmin,
9353
9436
  getMessagesForUser: getMessagesForUser,
@@ -9390,7 +9473,7 @@ var chat = /*#__PURE__*/Object.freeze({
9390
9473
  * @param [optionals.allowChannel] Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT
9391
9474
  * @returns promise that resolves to the newly created consensus barrier
9392
9475
  */
9393
- async function create$2(worldKey, name, stage, expectedRoles, defaultActions, optionals = {}) {
9476
+ async function create$4(worldKey, name, stage, expectedRoles, defaultActions, optionals = {}) {
9394
9477
  const {
9395
9478
  ttlSeconds,
9396
9479
  transparent = false,
@@ -9444,7 +9527,7 @@ async function load(worldKey, name, stage, optionals = {}) {
9444
9527
  * @param [optionals] Optional arguments; pass network call options overrides here.
9445
9528
  * @returns promise that resolves to a list of consensus barriers
9446
9529
  */
9447
- async function list(worldKey, name, optionals = {}) {
9530
+ async function list$1(worldKey, name, optionals = {}) {
9448
9531
  return await new Router().get(`/consensus/${worldKey}/${name}`, optionals).then(({
9449
9532
  body
9450
9533
  }) => body);
@@ -9837,11 +9920,11 @@ async function collectInGroup(barrierMap, groupName, optionals = {}) {
9837
9920
  var consensus = /*#__PURE__*/Object.freeze({
9838
9921
  __proto__: null,
9839
9922
  collectInGroup: collectInGroup,
9840
- create: create$2,
9923
+ create: create$4,
9841
9924
  deleteAll: deleteAll,
9842
9925
  deleteBarrier: deleteBarrier,
9843
9926
  forceClose: forceClose,
9844
- list: list,
9927
+ list: list$1,
9845
9928
  load: load,
9846
9929
  pause: pause,
9847
9930
  removeRoleExpectationFor: removeRoleExpectationFor,
@@ -9879,7 +9962,7 @@ var consensus = /*#__PURE__*/Object.freeze({
9879
9962
  * @returns promise that resolves to the newly created somebody object
9880
9963
  */
9881
9964
 
9882
- async function create$1(email, scope, optionals = {}) {
9965
+ async function create$3(email, scope, optionals = {}) {
9883
9966
  const {
9884
9967
  givenName,
9885
9968
  familyName,
@@ -9912,7 +9995,7 @@ async function create$1(email, scope, optionals = {}) {
9912
9995
  * @returns promise that resolves to the somebody object, or undefined if not found
9913
9996
  */
9914
9997
  const NOT_FOUND$2 = 404;
9915
- async function get$2(somebodyKey, optionals = {}) {
9998
+ async function get$3(somebodyKey, optionals = {}) {
9916
9999
  return await new Router().get(`/somebody/${somebodyKey}`, optionals).catch(error => {
9917
10000
  if (error.status === NOT_FOUND$2) return {
9918
10001
  body: undefined
@@ -10007,8 +10090,8 @@ async function byEmail(email, scope, optionals = {}) {
10007
10090
  var somebody = /*#__PURE__*/Object.freeze({
10008
10091
  __proto__: null,
10009
10092
  byEmail: byEmail,
10010
- create: create$1,
10011
- get: get$2,
10093
+ create: create$3,
10094
+ get: get$3,
10012
10095
  inScope: inScope
10013
10096
  });
10014
10097
 
@@ -10031,7 +10114,7 @@ var somebody = /*#__PURE__*/Object.freeze({
10031
10114
  * @param [optionals] Optional arguments; pass network call options overrides here.
10032
10115
  * @returns promise that resolves to the matchmaker list object
10033
10116
  */
10034
- async function create(name, partners, scope, optionals = {}) {
10117
+ async function create$2(name, partners, scope, optionals = {}) {
10035
10118
  const {
10036
10119
  accountShortName,
10037
10120
  projectShortName,
@@ -10114,7 +10197,7 @@ const NOT_FOUND$1 = 404;
10114
10197
  * @param [optionals] Optional arguments; pass network call options overrides here.
10115
10198
  * @returns promise that resolves to the matchmaker list object, or undefined if not found
10116
10199
  */
10117
- async function get$1(udomeKey, optionals = {}) {
10200
+ async function get$2(udomeKey, optionals = {}) {
10118
10201
  const {
10119
10202
  accountShortName,
10120
10203
  projectShortName,
@@ -10172,9 +10255,9 @@ var matchmaker = /*#__PURE__*/Object.freeze({
10172
10255
  __proto__: null,
10173
10256
  addUser: addUser,
10174
10257
  byName: byName,
10175
- create: create,
10258
+ create: create$2,
10176
10259
  edit: edit,
10177
- get: get$1
10260
+ get: get$2
10178
10261
  });
10179
10262
 
10180
10263
  const sleep = ms => new Promise(r => setTimeout(r, ms));
@@ -10478,7 +10561,7 @@ const NOT_FOUND = 404;
10478
10561
  * @param [optionals] Optional arguments; pass network call options overrides here.
10479
10562
  * @returns promise that resolves to the wallet
10480
10563
  */
10481
- async function get(scope, optionals = {}) {
10564
+ async function get$1(scope, optionals = {}) {
10482
10565
  const {
10483
10566
  scopeBoundary,
10484
10567
  scopeKey
@@ -10545,90 +10628,1001 @@ async function withScope(scope, optionals = {}) {
10545
10628
 
10546
10629
  var wallet = /*#__PURE__*/Object.freeze({
10547
10630
  __proto__: null,
10548
- get: get,
10631
+ get: get$1,
10549
10632
  update: update,
10550
10633
  withScope: withScope
10551
10634
  });
10552
10635
 
10553
- // Generic type for push channel message custom data
10636
+ /**
10637
+ * Builds the NPM Docker images used by pipeline NPM operations.
10638
+ * Requires `system` (admin) authorization.
10639
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/pipeline/npm/images`
10640
+ *
10641
+ * @example
10642
+ * import { pipelineAdapter } from 'epicenter-libs';
10643
+ * const built = await pipelineAdapter.buildImages();
10644
+ *
10645
+ * @param [optionals] Optional arguments; pass network call options overrides here.
10646
+ * @returns promise that resolves to `true` when the images were built successfully
10647
+ */
10648
+ async function buildImages(optionals = {}) {
10649
+ return await new Router().get('/pipeline/npm/images', optionals).then(({
10650
+ body
10651
+ }) => body);
10652
+ }
10554
10653
 
10555
- // Base structure for channel push messages
10654
+ /**
10655
+ * Executes a stored pipeline configuration. The operations to run are read server-side from the
10656
+ * named config file; only step inputs (such as credentials) are supplied here via `attributes`.
10657
+ * The execution runs asynchronously — the returned audit record starts in its `RUNNING` state and
10658
+ * is updated by the worker on completion (poll `getExecution` to observe progress).
10659
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/pipeline/{configName}`
10660
+ *
10661
+ * @example
10662
+ * import { pipelineAdapter } from 'epicenter-libs';
10663
+ * // Pass the git credential the config's git step will consume, keyed by operation type
10664
+ * const audit = await pipelineAdapter.execute('deploy', { git: 'my-git-token' });
10665
+ *
10666
+ * @param configName Name of the stored pipeline config to execute
10667
+ * @param [attributes] Step inputs keyed by operation type (e.g. `{ git: '<token>' }`)
10668
+ * @param [optionals] Optional arguments; pass network call options overrides here.
10669
+ * @returns promise that resolves to the newly created audit record in its initial RUNNING state
10670
+ */
10671
+ async function execute(configName, attributes = {}, optionals = {}) {
10672
+ return await new Router().post(`/pipeline/${encodeURIComponent(configName)}`, {
10673
+ body: {
10674
+ attributes
10675
+ },
10676
+ ...optionals
10677
+ }).then(({
10678
+ body
10679
+ }) => body);
10680
+ }
10556
10681
 
10557
- const validateScope = scope => {
10558
- if (!scope) throw new EpicenterError('No scope found where one was required');
10682
+ /**
10683
+ * Retrieves a single pipeline audit record by its execution key.
10684
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/pipeline/{executionKey}`
10685
+ *
10686
+ * @example
10687
+ * import { pipelineAdapter } from 'epicenter-libs';
10688
+ * const audit = await pipelineAdapter.getExecution('<executionKey>');
10689
+ *
10690
+ * @param executionKey Execution key of the audit record to retrieve
10691
+ * @param [optionals] Optional arguments; pass network call options overrides here.
10692
+ * @returns promise that resolves to the audit record
10693
+ */
10694
+ async function getExecution(executionKey, optionals = {}) {
10695
+ return await new Router().get(`/pipeline/${encodeURIComponent(executionKey)}`, optionals).then(({
10696
+ body
10697
+ }) => body);
10698
+ }
10699
+
10700
+ /**
10701
+ * Lists the audit history for a stored pipeline config.
10702
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/pipeline/with/{configName}`
10703
+ *
10704
+ * @example
10705
+ * import { pipelineAdapter } from 'epicenter-libs';
10706
+ * const page = await pipelineAdapter.listAudits('deploy', { first: 0, max: 20 });
10707
+ *
10708
+ * @param configName Name of the stored pipeline config
10709
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
10710
+ * @param [optionals.first] Index of the first record to return (for pagination)
10711
+ * @param [optionals.max] Maximum number of records to return (for pagination)
10712
+ * @returns promise that resolves to a page of audit records
10713
+ */
10714
+ async function listAudits(configName, optionals = {}) {
10559
10715
  const {
10560
- scopeBoundary,
10561
- scopeKey,
10562
- pushCategory
10563
- } = scope;
10564
- if (!scopeBoundary) throw new EpicenterError('Missing scope component: scopeBoundary');
10565
- if (!scopeKey) throw new EpicenterError('Missing scope component: scopeKey');
10566
- if (!pushCategory) throw new EpicenterError('Missing scope component: pushCategory');
10567
- if (!Object.prototype.hasOwnProperty.call(SCOPE_BOUNDARY, scopeBoundary)) throw new EpicenterError(`Invalid scope boundary: ${scopeBoundary}`);
10568
- if (!Object.prototype.hasOwnProperty.call(PUSH_CATEGORY, pushCategory)) throw new EpicenterError(`Invalid push category: ${pushCategory}`);
10569
- };
10716
+ first = 0,
10717
+ max,
10718
+ ...routingOptions
10719
+ } = optionals;
10720
+ return await new Router().withSearchParams({
10721
+ first,
10722
+ max
10723
+ }).get(`/pipeline/with/${encodeURIComponent(configName)}`, {
10724
+ paginated: true,
10725
+ ...routingOptions
10726
+ }).then(({
10727
+ body
10728
+ }) => body);
10729
+ }
10570
10730
 
10571
10731
  /**
10572
- * 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.
10732
+ * Deletes a pipeline audit record by its execution key.
10733
+ * Requires `system` (admin) authorization.
10734
+ * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/pipeline/{executionKey}`
10573
10735
  *
10574
10736
  * @example
10575
- * import { Channel, authAdapter, SCOPE_BOUNDARY, PUSH_CATEGORY } from 'epicenter-libs';
10576
- * const session = authAdapter.getLocalSession();
10577
- * const channel = new Channel({
10578
- * scopeBoundary: SCOPE_BOUNDARY.GROUP,
10579
- * scopeKey: session.groupKey,
10580
- * pushCategory: PUSH_CATEGORY.CHAT,
10581
- * });
10582
- * await channel.subscribe((data) => {
10583
- * console.log('Received message:', data);
10584
- * });
10737
+ * import { pipelineAdapter } from 'epicenter-libs';
10738
+ * await pipelineAdapter.deleteAudit('<executionKey>');
10739
+ *
10740
+ * @param executionKey Execution key of the audit record to delete
10741
+ * @param [optionals] Optional arguments; pass network call options overrides here.
10742
+ * @returns promise that resolves to `true` when the audit record was deleted
10585
10743
  */
10586
- class Channel {
10587
- /**
10588
- * Channel constructor
10589
- *
10590
- * @param scope Object with the scope boundary, scope key, and push category; defines the namespace for the channel
10591
- * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types
10592
- * @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.
10593
- * @param scope.pushCategory Push category, defines the type of channel; See [push category](#PUSH_CATEGORY) for all types
10594
- */
10595
- constructor(scope) {
10596
- _defineProperty(this, "path", void 0);
10597
- _defineProperty(this, "update", void 0);
10598
- _defineProperty(this, "subscription", null);
10599
- const {
10600
- scopeBoundary,
10601
- scopeKey,
10602
- pushCategory
10603
- } = scope;
10604
- validateScope(scope);
10605
- this.path = `/${scopeBoundary.toLowerCase()}/${scopeKey}/${pushCategory.toLowerCase()}`;
10606
- if (cometdAdapter.subscriptions.has(this.path)) {
10607
- this.subscription = cometdAdapter.subscriptions.get(this.path) || null;
10608
- }
10609
- }
10744
+ async function deleteAudit(executionKey, optionals = {}) {
10745
+ return await new Router().delete(`/pipeline/${encodeURIComponent(executionKey)}`, optionals).then(({
10746
+ body
10747
+ }) => body);
10748
+ }
10610
10749
 
10611
- /**
10612
- * Publishes content to the CometD channel
10613
- *
10614
- * @example
10615
- * import { Channel, authAdapter, SCOPE_BOUNDARY, PUSH_CATEGORY } from 'epicenter-libs';
10616
- * const session = authAdapter.getLocalSession();
10617
- * const channel = new Channel({
10618
- * scopeBoundary: SCOPE_BOUNDARY.GROUP,
10619
- * scopeKey: session.groupKey,
10620
- * pushCategory: PUSH_CATEGORY.CHAT,
10621
- * });
10622
- * await channel.publish({ message: 'Hello!' });
10623
- *
10624
- * @param content Content to publish to the channel
10625
- * @returns promise that resolves to the CometD message response
10626
- */
10627
- publish(content) {
10628
- return cometdAdapter.publish(this, content);
10629
- }
10750
+ var pipeline = /*#__PURE__*/Object.freeze({
10751
+ __proto__: null,
10752
+ buildImages: buildImages,
10753
+ deleteAudit: deleteAudit,
10754
+ execute: execute,
10755
+ getExecution: getExecution,
10756
+ listAudits: listAudits
10757
+ });
10630
10758
 
10631
- /**
10759
+ /**
10760
+ * Lists the known API services available for the given encyclopedia version.
10761
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/encyclopedia/v{version}`
10762
+ *
10763
+ * @example
10764
+ * import { encyclopediaAdapter } from 'epicenter-libs';
10765
+ * const services = await encyclopediaAdapter.listServices(3);
10766
+ *
10767
+ * @param version Encyclopedia version number
10768
+ * @param [optionals] Optional arguments; pass network call options overrides here.
10769
+ * @returns promise that resolves to an array of known service descriptors
10770
+ */
10771
+ async function listServices(version, optionals = {}) {
10772
+ return await new Router().get(`/encyclopedia/v${version}`, optionals).then(({
10773
+ body
10774
+ }) => body);
10775
+ }
10776
+
10777
+ /**
10778
+ * Retrieves the documented resource (API documentation) for a specific service and encyclopedia version.
10779
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/encyclopedia/v{version}/{api}`
10780
+ *
10781
+ * @example
10782
+ * import { encyclopediaAdapter } from 'epicenter-libs';
10783
+ * const resource = await encyclopediaAdapter.getResource(3, 'run');
10784
+ *
10785
+ * @param version Encyclopedia version number
10786
+ * @param api Name of the API service to retrieve documentation for
10787
+ * @param [optionals] Optional arguments; pass network call options overrides here.
10788
+ * @returns promise that resolves to the documented resource containing endpoints and definitions
10789
+ */
10790
+ async function getResource(version, api, optionals = {}) {
10791
+ return await new Router().get(`/encyclopedia/v${version}/${api}`, optionals).then(({
10792
+ body
10793
+ }) => body);
10794
+ }
10795
+
10796
+ /**
10797
+ * Retrieves a translated representation of the API documentation for a specific service and encyclopedia version.
10798
+ * Supported translators are ASCIIDOC, ASCIIDOC_TO_HTML, and OPENAPI.
10799
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/encyclopedia/as/{translator}/v{version}/{api}`
10800
+ *
10801
+ * NOTE: The backend returns the translated content with a translator-specific content-type
10802
+ * (e.g. `text/asciidoc`, `text/html`, `application/json`). The shared Router throws when the
10803
+ * response content-type is not `application/json`, so only the OPENAPI translator works here.
10804
+ * For ASCIIDOC and ASCIIDOC_TO_HTML, use the underlying fetch API directly against the
10805
+ * constructed URL.
10806
+ *
10807
+ * @example
10808
+ * import { encyclopediaAdapter } from 'epicenter-libs';
10809
+ * const openApiDoc = await encyclopediaAdapter.translate('OPENAPI', 3, 'run');
10810
+ *
10811
+ * @param translator Output format for the documentation; one of 'ASCIIDOC', 'ASCIIDOC_TO_HTML', or 'OPENAPI'
10812
+ * @param version Encyclopedia version number
10813
+ * @param api Name of the API service to translate documentation for
10814
+ * @param [optionals] Optional arguments; pass network call options overrides here.
10815
+ * @returns promise that resolves to the translated documentation (only when translator is 'OPENAPI')
10816
+ */
10817
+ async function translate(translator, version, api, optionals = {}) {
10818
+ return await new Router().get(`/encyclopedia/as/${translator}/v${version}/${api}`, optionals).then(({
10819
+ body
10820
+ }) => body);
10821
+ }
10822
+
10823
+ var encyclopedia = /*#__PURE__*/Object.freeze({
10824
+ __proto__: null,
10825
+ getResource: getResource,
10826
+ listServices: listServices,
10827
+ translate: translate
10828
+ });
10829
+
10830
+ /* File paths are free-form, user-authored strings that may contain spaces or URL-reserved
10831
+ * characters. Encode each segment while preserving the '/' separators that the backend's
10832
+ * `{filePath:.*}` routes expect. */
10833
+ const encodePath = filePath => filePath.split('/').map(encodeURIComponent).join('/');
10834
+
10835
+ /**
10836
+ * Lists files and directories at the project root or at a specific path.
10837
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file[/{filePath}]`
10838
+ *
10839
+ * @example
10840
+ * import { fileAdapter } from 'epicenter-libs';
10841
+ * // List all files at root
10842
+ * const entries = await fileAdapter.list();
10843
+ * // List contents of a specific directory up to 2 levels deep
10844
+ * const entries = await fileAdapter.list('src', { depth: 2 });
10845
+ *
10846
+ * @param [filePath] Path to a file or directory; omit to list the project root
10847
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
10848
+ * @param [optionals.depth] Maximum depth of directory traversal to include in the response
10849
+ * @returns promise that resolves to an array of file and directory entries
10850
+ */
10851
+ async function list(filePath, optionals = {}) {
10852
+ const {
10853
+ depth,
10854
+ ...routingOptions
10855
+ } = optionals;
10856
+ const uriComponent = filePath ? `/${encodePath(filePath)}` : '';
10857
+ return await new Router().withSearchParams({
10858
+ depth
10859
+ }).get(`/file${uriComponent}`, routingOptions).then(({
10860
+ body
10861
+ }) => body);
10862
+ }
10863
+
10864
+ /**
10865
+ * Uploads and replaces files at the project root or at a specific path using multipart/form-data (PUT).
10866
+ * Use this when you want to overwrite existing files. For creating new files, use `create`.
10867
+ * Base URL: PUT `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file[/{filePath}]`
10868
+ *
10869
+ * NOTE: This is browser-only. The `FormData` body is only serialized as multipart/form-data when
10870
+ * running in a browser environment; in Node it will not be sent correctly.
10871
+ *
10872
+ * @example
10873
+ * import { fileAdapter } from 'epicenter-libs';
10874
+ * const formData = new FormData();
10875
+ * formData.append('file', myFile);
10876
+ * const uploaded = await fileAdapter.upload(formData, 'models/model.py');
10877
+ *
10878
+ * @param formData Multipart form data containing the file(s) to upload
10879
+ * @param [filePath] Destination path for the file(s); omit to upload to the project root
10880
+ * @param [optionals] Optional arguments; pass network call options overrides here.
10881
+ * @returns promise that resolves to an array of the uploaded file entries
10882
+ */
10883
+ async function upload(formData, filePath, optionals = {}) {
10884
+ const uriComponent = filePath ? `/${encodePath(filePath)}` : '';
10885
+ return await new Router().put(`/file${uriComponent}`, {
10886
+ body: formData,
10887
+ ...optionals
10888
+ }).then(({
10889
+ body
10890
+ }) => body);
10891
+ }
10892
+
10893
+ /**
10894
+ * Creates new files at the project root or at a specific path using multipart/form-data (POST).
10895
+ * Use this when creating new files. For overwriting existing files, use `upload`.
10896
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file[/{filePath}]`
10897
+ *
10898
+ * NOTE: This is browser-only. The `FormData` body is only serialized as multipart/form-data when
10899
+ * running in a browser environment; in Node it will not be sent correctly.
10900
+ *
10901
+ * @example
10902
+ * import { fileAdapter } from 'epicenter-libs';
10903
+ * const formData = new FormData();
10904
+ * formData.append('file', myFile);
10905
+ * const created = await fileAdapter.create(formData, 'models/model.py');
10906
+ *
10907
+ * @param formData Multipart form data containing the file(s) to create
10908
+ * @param [filePath] Destination path for the file(s); omit to create at the project root
10909
+ * @param [optionals] Optional arguments; pass network call options overrides here.
10910
+ * @returns promise that resolves to an array of the created file entries
10911
+ */
10912
+ async function create$1(formData, filePath, optionals = {}) {
10913
+ const uriComponent = filePath ? `/${encodePath(filePath)}` : '';
10914
+ return await new Router().post(`/file${uriComponent}`, {
10915
+ body: formData,
10916
+ ...optionals
10917
+ }).then(({
10918
+ body
10919
+ }) => body);
10920
+ }
10921
+
10922
+ /**
10923
+ * Deletes a file or directory at the project root or at a specific path.
10924
+ * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file[/{filePath}]`
10925
+ *
10926
+ * @example
10927
+ * import { fileAdapter } from 'epicenter-libs';
10928
+ * // Delete a specific file
10929
+ * await fileAdapter.remove('models/old-model.py');
10930
+ * // Delete all files at the project root
10931
+ * await fileAdapter.remove();
10932
+ *
10933
+ * @param [filePath] Path of the file or directory to delete; omit to delete all files at the project root
10934
+ * @param [optionals] Optional arguments; pass network call options overrides here.
10935
+ * @returns promise that resolves when the deletion is complete
10936
+ */
10937
+ async function remove(filePath, optionals = {}) {
10938
+ const uriComponent = filePath ? `/${encodePath(filePath)}` : '';
10939
+ return await new Router().delete(`/file${uriComponent}`, optionals).then(({
10940
+ body
10941
+ }) => body);
10942
+ }
10943
+
10944
+ /**
10945
+ * Downloads the raw content of a file at the specified path.
10946
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file/download/{filePath}`
10947
+ *
10948
+ * NOTE: The backend streams the file with its detected content type (e.g. `application/zip`,
10949
+ * `text/plain`, `application/octet-stream`). The shared Router throws when the response
10950
+ * content-type is not `application/json`, so this call only succeeds for JSON files. To download
10951
+ * other file types, use the underlying fetch API directly against the constructed URL.
10952
+ *
10953
+ * @example
10954
+ * import { fileAdapter } from 'epicenter-libs';
10955
+ * const content = await fileAdapter.download('config.json');
10956
+ *
10957
+ * @param filePath Path to the file to download
10958
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
10959
+ * @param [optionals.depth] Currently unused on the backend; reserved for future expansion.
10960
+ * @returns promise that resolves to the raw file content
10961
+ */
10962
+ async function download(filePath, optionals = {}) {
10963
+ const {
10964
+ depth,
10965
+ ...routingOptions
10966
+ } = optionals;
10967
+ return await new Router().withSearchParams({
10968
+ depth
10969
+ }).get(`/file/download/${encodePath(filePath)}`, routingOptions).then(({
10970
+ body
10971
+ }) => body);
10972
+ }
10973
+
10974
+ /**
10975
+ * Lists files and directories matching a glob filter pattern, optionally scoped to a specific path.
10976
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file/filter/{filter}[/{filePath}]`
10977
+ *
10978
+ * @example
10979
+ * import { fileAdapter } from 'epicenter-libs';
10980
+ * // List all Python files in the project
10981
+ * const pyFiles = await fileAdapter.listByFilter('*.py');
10982
+ * // List all Python files within the 'models' directory
10983
+ * const pyFiles = await fileAdapter.listByFilter('*.py', 'models');
10984
+ *
10985
+ * @param filter Glob pattern to filter files by (e.g., '*.py', '*.json')
10986
+ * @param [filePath] Directory path to scope the filter to; omit to search the entire project
10987
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
10988
+ * @param [optionals.depth] Maximum depth of directory traversal to include in the response
10989
+ * @returns promise that resolves to an array of matching file and directory entries
10990
+ */
10991
+ async function listByFilter(filter, filePath, optionals = {}) {
10992
+ const {
10993
+ depth,
10994
+ ...routingOptions
10995
+ } = optionals;
10996
+ const uriComponent = filePath ? `/${encodePath(filePath)}` : '';
10997
+ return await new Router().withSearchParams({
10998
+ depth
10999
+ }).get(`/file/filter/${encodeURIComponent(filter)}${uriComponent}`, routingOptions).then(({
11000
+ body
11001
+ }) => body);
11002
+ }
11003
+
11004
+ /**
11005
+ * Compresses files into a ZIP archive at the project root or at a specific path.
11006
+ * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file/compress[/{filePath}]`
11007
+ *
11008
+ * NOTE: The backend streams the resulting archive with content-type `application/zip`. The
11009
+ * shared Router throws when the response content-type is not `application/json`, so this call
11010
+ * will not return the archive bytes through the normal flow. To retrieve the archive, use the
11011
+ * underlying fetch API directly against the constructed URL.
11012
+ *
11013
+ * @example
11014
+ * import { fileAdapter } from 'epicenter-libs';
11015
+ * // Compress a specific file or directory
11016
+ * await fileAdapter.compress('models');
11017
+ * // Compress at root
11018
+ * await fileAdapter.compress();
11019
+ *
11020
+ * @param [filePath] Path of the file or directory to compress; omit to compress at the project root
11021
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11022
+ * @returns promise that resolves to the compression result
11023
+ */
11024
+ async function compress(filePath, optionals = {}) {
11025
+ const uriComponent = filePath ? `/${encodePath(filePath)}` : '';
11026
+ return await new Router().patch(`/file/compress${uriComponent}`, optionals).then(({
11027
+ body
11028
+ }) => body);
11029
+ }
11030
+
11031
+ /**
11032
+ * Extracts (explodes) a ZIP archive at the project root or at a specific path in place,
11033
+ * deleting the archive after extraction.
11034
+ * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file/explode[/{filePath}]`
11035
+ *
11036
+ * @example
11037
+ * import { fileAdapter } from 'epicenter-libs';
11038
+ * // Extract a specific archive
11039
+ * await fileAdapter.explode('archive.zip');
11040
+ * // Explode at root
11041
+ * await fileAdapter.explode();
11042
+ *
11043
+ * @param [filePath] Path of the archive to extract; omit to extract at the project root
11044
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11045
+ * @returns promise that resolves when the extraction is complete
11046
+ */
11047
+ async function explode(filePath, optionals = {}) {
11048
+ const uriComponent = filePath ? `/${encodePath(filePath)}` : '';
11049
+ return await new Router().patch(`/file/explode${uriComponent}`, optionals).then(({
11050
+ body
11051
+ }) => body);
11052
+ }
11053
+
11054
+ /**
11055
+ * Moves a file or directory from one path to another within the project.
11056
+ * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file/move`
11057
+ *
11058
+ * @example
11059
+ * import { fileAdapter } from 'epicenter-libs';
11060
+ * await fileAdapter.move('models/old-name.py', 'models/new-name.py');
11061
+ * // Move and include the origin directory itself
11062
+ * await fileAdapter.move('old-dir', 'new-dir', { includeOrigin: true });
11063
+ *
11064
+ * @param origin Origin path of the file or directory to move
11065
+ * @param destination Destination path to move the file or directory to
11066
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
11067
+ * @param [optionals.includeOrigin] Whether to include the origin directory itself in the move
11068
+ * @returns promise that resolves when the move is complete
11069
+ */
11070
+ async function move(origin, destination, optionals = {}) {
11071
+ const {
11072
+ includeOrigin,
11073
+ ...routingOptions
11074
+ } = optionals;
11075
+ return await new Router().patch('/file/move', {
11076
+ body: {
11077
+ origin,
11078
+ destination,
11079
+ includeOrigin
11080
+ },
11081
+ ...routingOptions
11082
+ }).then(({
11083
+ body
11084
+ }) => body);
11085
+ }
11086
+
11087
+ /**
11088
+ * Creates a new directory at the specified path.
11089
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file/directory/{filePath}`
11090
+ *
11091
+ * @example
11092
+ * import { fileAdapter } from 'epicenter-libs';
11093
+ * const dir = await fileAdapter.createDirectory('models/new-folder');
11094
+ *
11095
+ * @param filePath Path at which to create the new directory
11096
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11097
+ * @returns promise that resolves to the created directory entry
11098
+ */
11099
+ async function createDirectory(filePath, optionals = {}) {
11100
+ return await new Router().post(`/file/directory/${encodePath(filePath)}`, optionals).then(({
11101
+ body
11102
+ }) => body);
11103
+ }
11104
+
11105
+ var file = /*#__PURE__*/Object.freeze({
11106
+ __proto__: null,
11107
+ compress: compress,
11108
+ create: create$1,
11109
+ createDirectory: createDirectory,
11110
+ download: download,
11111
+ explode: explode,
11112
+ list: list,
11113
+ listByFilter: listByFilter,
11114
+ move: move,
11115
+ remove: remove,
11116
+ upload: upload
11117
+ });
11118
+
11119
+ /**
11120
+ * Currently the API only supports `SAML`. This type is intentionally narrow so that adding new
11121
+ * protocols on the backend requires an explicit type update here.
11122
+ */
11123
+
11124
+ /**
11125
+ * Gets registration info for a self-registration token.
11126
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/self/{token}`
11127
+ *
11128
+ * @example
11129
+ * import { registrationAdapter } from 'epicenter-libs';
11130
+ * const info = await registrationAdapter.getSelfRegistrationInfo('my-token');
11131
+ *
11132
+ * @param token Self-registration token
11133
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11134
+ * @returns promise that resolves to registration info
11135
+ */
11136
+ async function getSelfRegistrationInfo(token, optionals = {}) {
11137
+ return await new Router().get(`/registration/self/${token}`, optionals).then(({
11138
+ body
11139
+ }) => body);
11140
+ }
11141
+
11142
+ /**
11143
+ * Completes a self-registration using a token.
11144
+ * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/self/{token}`
11145
+ *
11146
+ * @example
11147
+ * import { registrationAdapter } from 'epicenter-libs';
11148
+ * const result = await registrationAdapter.completeSelfRegistration('my-token', 'secret123', {
11149
+ * displayName: 'John Doe',
11150
+ * handle: 'johnd',
11151
+ * });
11152
+ *
11153
+ * @param token Self-registration token
11154
+ * @param password Password for the new account
11155
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11156
+ * @param [optionals.displayName] Display name for the new user
11157
+ * @param [optionals.givenName] Given name for the new user
11158
+ * @param [optionals.familyName] Family name for the new user
11159
+ * @param [optionals.handle] Handle for the new user
11160
+ * @returns promise that resolves to the registration result including session info
11161
+ */
11162
+ async function completeSelfRegistration(token, password, optionals = {}) {
11163
+ const {
11164
+ displayName,
11165
+ givenName,
11166
+ familyName,
11167
+ handle,
11168
+ ...routingOptions
11169
+ } = optionals;
11170
+ return await new Router().patch(`/registration/self/${token}`, {
11171
+ body: {
11172
+ password,
11173
+ displayName,
11174
+ givenName,
11175
+ familyName,
11176
+ handle
11177
+ },
11178
+ ...routingOptions
11179
+ }).then(({
11180
+ body
11181
+ }) => body);
11182
+ }
11183
+
11184
+ /**
11185
+ * Sends a self-registration invite email to a user. Pass an `Accept-Language` header via
11186
+ * `optionals.headers` to localize the email.
11187
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/self/{groupKey}`
11188
+ *
11189
+ * @example
11190
+ * import { registrationAdapter } from 'epicenter-libs';
11191
+ * await registrationAdapter.sendSelfRegistrationInvite('group-key', 'user@example.com', {
11192
+ * linkDestination: 'DASHBOARD',
11193
+ * redirectUrl: 'https://app.example.com',
11194
+ * headers: { 'Accept-Language': 'fr-FR' },
11195
+ * });
11196
+ *
11197
+ * @param groupKey Group key to register the user into
11198
+ * @param email Email address of the user to invite
11199
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11200
+ * @param [optionals.linkDestination] Destination for the registration link ('DASHBOARD' or 'MANAGER')
11201
+ * @param [optionals.modality] Registration modality
11202
+ * @param [optionals.redirectUrl] URL to redirect to after registration
11203
+ * @param [optionals.subject] Subject line for the invite email
11204
+ * @param [optionals.givenName] Pre-populate given name in the registration form
11205
+ * @param [optionals.familyName] Pre-populate family name in the registration form
11206
+ * @param [optionals.linkUrl] Custom URL to use for the registration link
11207
+ * @param [optionals.confirmation] Whether to send a confirmation email
11208
+ * @returns promise that resolves to undefined if successful
11209
+ */
11210
+ async function sendSelfRegistrationInvite(groupKey, email, optionals = {}) {
11211
+ const {
11212
+ linkDestination,
11213
+ modality,
11214
+ redirectUrl,
11215
+ subject,
11216
+ givenName,
11217
+ familyName,
11218
+ linkUrl,
11219
+ confirmation,
11220
+ ...routingOptions
11221
+ } = optionals;
11222
+ return await new Router().post(`/registration/self/${groupKey}`, {
11223
+ body: {
11224
+ email,
11225
+ linkDestination,
11226
+ modality,
11227
+ redirectUrl,
11228
+ subject,
11229
+ givenName,
11230
+ familyName,
11231
+ linkUrl,
11232
+ confirmation
11233
+ },
11234
+ ...routingOptions
11235
+ }).then(({
11236
+ body
11237
+ }) => body);
11238
+ }
11239
+
11240
+ /**
11241
+ * Gets registration info for an invite token.
11242
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/invite/{token}`
11243
+ *
11244
+ * @example
11245
+ * import { registrationAdapter } from 'epicenter-libs';
11246
+ * const info = await registrationAdapter.getInviteRegistrationInfo('invite-token');
11247
+ *
11248
+ * @param token Invite registration token
11249
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11250
+ * @returns promise that resolves to registration info
11251
+ */
11252
+ async function getInviteRegistrationInfo(token, optionals = {}) {
11253
+ return await new Router().get(`/registration/invite/${token}`, optionals).then(({
11254
+ body
11255
+ }) => body);
11256
+ }
11257
+
11258
+ /**
11259
+ * Completes an invite registration using a token.
11260
+ * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/invite/{token}`
11261
+ *
11262
+ * @example
11263
+ * import { registrationAdapter } from 'epicenter-libs';
11264
+ * const result = await registrationAdapter.completeInviteRegistration('invite-token', 'pass456', {
11265
+ * displayName: 'Jane Doe',
11266
+ * });
11267
+ *
11268
+ * @param token Invite registration token
11269
+ * @param password Password for the new account
11270
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11271
+ * @param [optionals.displayName] Display name for the new user
11272
+ * @param [optionals.givenName] Given name for the new user
11273
+ * @param [optionals.familyName] Family name for the new user
11274
+ * @param [optionals.handle] Handle for the new user
11275
+ * @returns promise that resolves to the registration result including session info
11276
+ */
11277
+ async function completeInviteRegistration(token, password, optionals = {}) {
11278
+ const {
11279
+ displayName,
11280
+ givenName,
11281
+ familyName,
11282
+ handle,
11283
+ ...routingOptions
11284
+ } = optionals;
11285
+ return await new Router().patch(`/registration/invite/${token}`, {
11286
+ body: {
11287
+ password,
11288
+ displayName,
11289
+ givenName,
11290
+ familyName,
11291
+ handle
11292
+ },
11293
+ ...routingOptions
11294
+ }).then(({
11295
+ body
11296
+ }) => body);
11297
+ }
11298
+
11299
+ /**
11300
+ * Sends an invite registration email to a user. Pass an `Accept-Language` header via
11301
+ * `optionals.headers` to localize the email.
11302
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/invite/{groupKey}`
11303
+ *
11304
+ * @example
11305
+ * import { registrationAdapter } from 'epicenter-libs';
11306
+ * await registrationAdapter.sendInvite('group-key', 'invited@example.com', {
11307
+ * givenName: 'New',
11308
+ * familyName: 'User',
11309
+ * redirectUrl: 'https://app.example.com',
11310
+ * });
11311
+ *
11312
+ * @param groupKey Group key to invite the user into
11313
+ * @param email Email address of the user to invite
11314
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11315
+ * @param [optionals.linkDestination] Destination for the registration link ('DASHBOARD' or 'MANAGER')
11316
+ * @param [optionals.modality] Registration modality
11317
+ * @param [optionals.redirectUrl] URL to redirect to after registration
11318
+ * @param [optionals.subject] Subject line for the invite email
11319
+ * @param [optionals.givenName] Pre-populate given name in the registration form
11320
+ * @param [optionals.familyName] Pre-populate family name in the registration form
11321
+ * @param [optionals.linkUrl] Custom URL to use for the registration link
11322
+ * @param [optionals.confirmation] Whether to send a confirmation email
11323
+ * @returns promise that resolves to undefined if successful
11324
+ */
11325
+ async function sendInvite(groupKey, email, optionals = {}) {
11326
+ const {
11327
+ linkDestination,
11328
+ modality,
11329
+ redirectUrl,
11330
+ subject,
11331
+ givenName,
11332
+ familyName,
11333
+ linkUrl,
11334
+ confirmation,
11335
+ ...routingOptions
11336
+ } = optionals;
11337
+ return await new Router().post(`/registration/invite/${groupKey}`, {
11338
+ body: {
11339
+ email,
11340
+ linkDestination,
11341
+ modality,
11342
+ redirectUrl,
11343
+ subject,
11344
+ givenName,
11345
+ familyName,
11346
+ linkUrl,
11347
+ confirmation
11348
+ },
11349
+ ...routingOptions
11350
+ }).then(({
11351
+ body
11352
+ }) => body);
11353
+ }
11354
+
11355
+ /**
11356
+ * Gets registration info for a team invite token.
11357
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/team/{token}`
11358
+ *
11359
+ * @example
11360
+ * import { registrationAdapter } from 'epicenter-libs';
11361
+ * const info = await registrationAdapter.getTeamRegistrationInfo('team-token');
11362
+ *
11363
+ * @param token Team invite token
11364
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11365
+ * @returns promise that resolves to team registration info
11366
+ */
11367
+ async function getTeamRegistrationInfo(token, optionals = {}) {
11368
+ return await new Router().get(`/registration/team/${token}`, optionals).then(({
11369
+ body
11370
+ }) => body);
11371
+ }
11372
+
11373
+ /**
11374
+ * Sends a team invite email. Pass an `Accept-Language` header via `optionals.headers` to
11375
+ * localize the email.
11376
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/team`
11377
+ *
11378
+ * @example
11379
+ * import { registrationAdapter } from 'epicenter-libs';
11380
+ * await registrationAdapter.sendTeamInvite(
11381
+ * 'Jane Author',
11382
+ * 'AUTHOR',
11383
+ * 'https://app.example.com',
11384
+ * 'newteammate@example.com',
11385
+ * { subject: 'Welcome to the team!' },
11386
+ * );
11387
+ *
11388
+ * @param invitingAuthor Name or identifier of the person sending the invite
11389
+ * @param role Role to assign to the invited user
11390
+ * @param redirectUrl URL to redirect to after accepting the invite
11391
+ * @param email Email address of the user to invite
11392
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11393
+ * @param [optionals.subject] Subject line for the invite email
11394
+ * @param [optionals.givenName] Pre-populate given name for the invited user
11395
+ * @param [optionals.familyName] Pre-populate family name for the invited user
11396
+ * @returns promise that resolves to undefined if successful
11397
+ */
11398
+ async function sendTeamInvite(invitingAuthor, role, redirectUrl, email, optionals = {}) {
11399
+ const {
11400
+ subject,
11401
+ givenName,
11402
+ familyName,
11403
+ ...routingOptions
11404
+ } = optionals;
11405
+ return await new Router().post('/registration/team', {
11406
+ body: {
11407
+ invitingAuthor,
11408
+ role,
11409
+ redirectUrl,
11410
+ email,
11411
+ subject,
11412
+ givenName,
11413
+ familyName
11414
+ },
11415
+ ...routingOptions
11416
+ }).then(({
11417
+ body
11418
+ }) => body);
11419
+ }
11420
+
11421
+ /**
11422
+ * @deprecated Use getSsoAdminRegistration or getSsoUserRegistration instead.
11423
+ * Gets SSO registration info for a given SSO protocol.
11424
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/sso/{ssoProtocol}`
11425
+ *
11426
+ * @example
11427
+ * import { registrationAdapter } from 'epicenter-libs';
11428
+ * const info = await registrationAdapter.getSsoRegistration('SAML');
11429
+ *
11430
+ * @param ssoProtocol The SSO protocol (e.g. 'SAML')
11431
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11432
+ * @returns promise that resolves to SSO registration data
11433
+ */
11434
+ async function getSsoRegistration(ssoProtocol, optionals = {}) {
11435
+ console.warn('DEPRECATION WARNING: registrationAdapter.getSsoRegistration is deprecated and will be removed with the next release. Use registrationAdapter.getSsoAdminRegistration or registrationAdapter.getSsoUserRegistration instead.');
11436
+ return await new Router().get(`/registration/sso/${ssoProtocol}`, optionals).then(({
11437
+ body
11438
+ }) => body);
11439
+ }
11440
+
11441
+ /**
11442
+ * Gets admin SSO registration info for a given SSO protocol.
11443
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/sso/admin/{ssoProtocol}`
11444
+ *
11445
+ * @example
11446
+ * import { registrationAdapter } from 'epicenter-libs';
11447
+ * const info = await registrationAdapter.getSsoAdminRegistration('SAML');
11448
+ *
11449
+ * @param ssoProtocol The SSO protocol (e.g. 'SAML')
11450
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11451
+ * @returns promise that resolves to SSO admin registration data
11452
+ */
11453
+ async function getSsoAdminRegistration(ssoProtocol, optionals = {}) {
11454
+ return await new Router().get(`/registration/sso/admin/${ssoProtocol}`, optionals).then(({
11455
+ body
11456
+ }) => body);
11457
+ }
11458
+
11459
+ /**
11460
+ * Gets user SSO registration info for a given SSO protocol.
11461
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/sso/user/{ssoProtocol}`
11462
+ *
11463
+ * @example
11464
+ * import { registrationAdapter } from 'epicenter-libs';
11465
+ * const info = await registrationAdapter.getSsoUserRegistration('SAML');
11466
+ *
11467
+ * @param ssoProtocol The SSO protocol (e.g. 'SAML')
11468
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11469
+ * @returns promise that resolves to SSO user registration data
11470
+ */
11471
+ async function getSsoUserRegistration(ssoProtocol, optionals = {}) {
11472
+ return await new Router().get(`/registration/sso/user/${ssoProtocol}`, optionals).then(({
11473
+ body
11474
+ }) => body);
11475
+ }
11476
+
11477
+ var registration = /*#__PURE__*/Object.freeze({
11478
+ __proto__: null,
11479
+ completeInviteRegistration: completeInviteRegistration,
11480
+ completeSelfRegistration: completeSelfRegistration,
11481
+ getInviteRegistrationInfo: getInviteRegistrationInfo,
11482
+ getSelfRegistrationInfo: getSelfRegistrationInfo,
11483
+ getSsoAdminRegistration: getSsoAdminRegistration,
11484
+ getSsoRegistration: getSsoRegistration,
11485
+ getSsoUserRegistration: getSsoUserRegistration,
11486
+ getTeamRegistrationInfo: getTeamRegistrationInfo,
11487
+ sendInvite: sendInvite,
11488
+ sendSelfRegistrationInvite: sendSelfRegistrationInvite,
11489
+ sendTeamInvite: sendTeamInvite
11490
+ });
11491
+
11492
+ /**
11493
+ * Creates a new docket entry, scheduling a deferred operation for later execution.
11494
+ * Requires `support` level authorization.
11495
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/docket`
11496
+ *
11497
+ * @example
11498
+ * import { docketAdapter } from 'epicenter-libs';
11499
+ * const docket = await docketAdapter.create(
11500
+ * {
11501
+ * objectType: 'scale',
11502
+ * operatingSystem: 'LINUX',
11503
+ * workerShape: 'GS',
11504
+ * scale: {
11505
+ * active: true,
11506
+ * initialWorkerCount: 1,
11507
+ * additionalWorkerLimit: 4,
11508
+ * flavors: ['DOCKER'],
11509
+ * },
11510
+ * },
11511
+ * { objectType: 'date', value: '2026-06-01T00:00:00Z' },
11512
+ * '2026-05-20T00:00:00Z',
11513
+ * { ttlMinutes: 60 },
11514
+ * );
11515
+ *
11516
+ * @param payload Docket payload describing the operation to schedule
11517
+ * @param trigger Trigger describing when the operation should fire
11518
+ * (cron, date, or offset)
11519
+ * @param date ISO-8601 date string indicating when the docket is scheduled
11520
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
11521
+ * @param [optionals.ttlMinutes] Time-to-live in minutes for the docket entry (minimum 2)
11522
+ * @returns promise that resolves to the newly created docket
11523
+ */
11524
+ async function create(payload, trigger, date, optionals = {}) {
11525
+ const {
11526
+ ttlMinutes,
11527
+ ...routingOptions
11528
+ } = optionals;
11529
+ return await new Router().post('/docket', {
11530
+ body: {
11531
+ payload,
11532
+ trigger,
11533
+ date,
11534
+ ttlMinutes
11535
+ },
11536
+ ...routingOptions
11537
+ }).then(({
11538
+ body
11539
+ }) => body);
11540
+ }
11541
+
11542
+ var docket = /*#__PURE__*/Object.freeze({
11543
+ __proto__: null,
11544
+ create: create
11545
+ });
11546
+
11547
+ // Generic type for push channel message custom data
11548
+
11549
+ // Base structure for channel push messages
11550
+
11551
+ const validateScope = scope => {
11552
+ if (!scope) throw new EpicenterError('No scope found where one was required');
11553
+ const {
11554
+ scopeBoundary,
11555
+ scopeKey,
11556
+ pushCategory
11557
+ } = scope;
11558
+ if (!scopeBoundary) throw new EpicenterError('Missing scope component: scopeBoundary');
11559
+ if (!scopeKey) throw new EpicenterError('Missing scope component: scopeKey');
11560
+ if (!pushCategory) throw new EpicenterError('Missing scope component: pushCategory');
11561
+ if (!Object.prototype.hasOwnProperty.call(SCOPE_BOUNDARY, scopeBoundary)) throw new EpicenterError(`Invalid scope boundary: ${scopeBoundary}`);
11562
+ if (!Object.prototype.hasOwnProperty.call(PUSH_CATEGORY, pushCategory)) throw new EpicenterError(`Invalid push category: ${pushCategory}`);
11563
+ };
11564
+
11565
+ /**
11566
+ * 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.
11567
+ *
11568
+ * @example
11569
+ * import { Channel, authAdapter, SCOPE_BOUNDARY, PUSH_CATEGORY } from 'epicenter-libs';
11570
+ * const session = authAdapter.getLocalSession();
11571
+ * const channel = new Channel({
11572
+ * scopeBoundary: SCOPE_BOUNDARY.GROUP,
11573
+ * scopeKey: session.groupKey,
11574
+ * pushCategory: PUSH_CATEGORY.CHAT,
11575
+ * });
11576
+ * await channel.subscribe((data) => {
11577
+ * console.log('Received message:', data);
11578
+ * });
11579
+ */
11580
+ class Channel {
11581
+ /**
11582
+ * Channel constructor
11583
+ *
11584
+ * @param scope Object with the scope boundary, scope key, and push category; defines the namespace for the channel
11585
+ * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types
11586
+ * @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.
11587
+ * @param scope.pushCategory Push category, defines the type of channel; See [push category](#PUSH_CATEGORY) for all types
11588
+ */
11589
+ constructor(scope) {
11590
+ _defineProperty(this, "path", void 0);
11591
+ _defineProperty(this, "update", void 0);
11592
+ _defineProperty(this, "subscription", null);
11593
+ const {
11594
+ scopeBoundary,
11595
+ scopeKey,
11596
+ pushCategory
11597
+ } = scope;
11598
+ validateScope(scope);
11599
+ this.path = `/${scopeBoundary.toLowerCase()}/${scopeKey}/${pushCategory.toLowerCase()}`;
11600
+ if (cometdAdapter.subscriptions.has(this.path)) {
11601
+ this.subscription = cometdAdapter.subscriptions.get(this.path) || null;
11602
+ }
11603
+ }
11604
+
11605
+ /**
11606
+ * Publishes content to the CometD channel
11607
+ *
11608
+ * @example
11609
+ * import { Channel, authAdapter, SCOPE_BOUNDARY, PUSH_CATEGORY } from 'epicenter-libs';
11610
+ * const session = authAdapter.getLocalSession();
11611
+ * const channel = new Channel({
11612
+ * scopeBoundary: SCOPE_BOUNDARY.GROUP,
11613
+ * scopeKey: session.groupKey,
11614
+ * pushCategory: PUSH_CATEGORY.CHAT,
11615
+ * });
11616
+ * await channel.publish({ message: 'Hello!' });
11617
+ *
11618
+ * @param content Content to publish to the channel
11619
+ * @returns promise that resolves to the CometD message response
11620
+ */
11621
+ publish(content) {
11622
+ return cometdAdapter.publish(this, content);
11623
+ }
11624
+
11625
+ /**
10632
11626
  * 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.
10633
11627
  *
10634
11628
  * @example
@@ -10740,6 +11734,367 @@ class Channel {
10740
11734
  }
10741
11735
  }
10742
11736
 
11737
+ // ──────────────────────────────────────────────
11738
+ // Types
11739
+ // ──────────────────────────────────────────────
11740
+
11741
+ // ──────────────────────────────────────────────
11742
+ // Functions
11743
+ // ──────────────────────────────────────────────
11744
+
11745
+ /**
11746
+ * Retrieves the git integration configuration for the project.
11747
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git`
11748
+ *
11749
+ * @example
11750
+ * import { gitAdapter } from 'epicenter-libs';
11751
+ * const integration = await gitAdapter.get();
11752
+ *
11753
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11754
+ * @returns promise that resolves to the git integration configuration
11755
+ */
11756
+ async function get(optionals = {}) {
11757
+ return new Router().get('/git', optionals).then(({
11758
+ body
11759
+ }) => body);
11760
+ }
11761
+
11762
+ /**
11763
+ * Retrieves the current git status for the project.
11764
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/status`
11765
+ *
11766
+ * @example
11767
+ * import { gitAdapter } from 'epicenter-libs';
11768
+ * const status = await gitAdapter.getStatus();
11769
+ * console.log(status.currentBranch);
11770
+ *
11771
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11772
+ * @returns promise that resolves to the git status, including the current branch
11773
+ */
11774
+ async function getStatus(optionals = {}) {
11775
+ return new Router().get('/git/status', optionals).then(({
11776
+ body
11777
+ }) => body);
11778
+ }
11779
+
11780
+ /**
11781
+ * Checks out a branch in the project's git repository.
11782
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/checkout/{branch}`
11783
+ *
11784
+ * @example
11785
+ * import { gitAdapter } from 'epicenter-libs';
11786
+ * await gitAdapter.checkout('main');
11787
+ *
11788
+ * @param branch Name of the branch to check out
11789
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11790
+ * @returns promise that resolves when the checkout is complete
11791
+ */
11792
+ async function checkout(branch, optionals = {}) {
11793
+ return new Router().get(`/git/checkout/${branch}`, optionals).then(({
11794
+ body
11795
+ }) => body);
11796
+ }
11797
+
11798
+ /**
11799
+ * Resets the project's git repository, optionally to a specific branch.
11800
+ * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/reset[/{branch}]`
11801
+ *
11802
+ * @example
11803
+ * import { gitAdapter } from 'epicenter-libs';
11804
+ * await gitAdapter.reset(); // reset current branch
11805
+ * await gitAdapter.reset({ branch: 'main' }); // reset to 'main'
11806
+ *
11807
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
11808
+ * @param [optionals.branch] Branch to reset to; if omitted, resets the current branch
11809
+ * @returns promise that resolves when the reset is complete
11810
+ */
11811
+ async function reset(optionals = {}) {
11812
+ const {
11813
+ branch,
11814
+ ...routingOptions
11815
+ } = optionals;
11816
+ return new Router().delete(`/git/reset${branch ? `/${branch}` : ''}`, routingOptions).then(({
11817
+ body
11818
+ }) => body);
11819
+ }
11820
+
11821
+ /**
11822
+ * Creates a git integration for the project.
11823
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/integration`
11824
+ *
11825
+ * @example
11826
+ * import { gitAdapter } from 'epicenter-libs';
11827
+ * const integration = await gitAdapter.createIntegration({
11828
+ * uri: 'git@github.com:myorg/myrepo.git',
11829
+ * publicKey: '...',
11830
+ * privateKey: '...',
11831
+ * publicKeySpec: 'openssh',
11832
+ * privateKeySpec: 'pkcs8',
11833
+ * algorithm: 'ed25519',
11834
+ * });
11835
+ *
11836
+ * @param integration Git integration configuration to create
11837
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11838
+ * @returns promise that resolves to the created git integration
11839
+ */
11840
+ async function createIntegration(integration, optionals = {}) {
11841
+ return new Router().post('/git/integration', {
11842
+ body: integration,
11843
+ ...optionals
11844
+ }).then(({
11845
+ body
11846
+ }) => body);
11847
+ }
11848
+
11849
+ /**
11850
+ * Updates the git integration for the project.
11851
+ * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/integration`
11852
+ *
11853
+ * @example
11854
+ * import { gitAdapter } from 'epicenter-libs';
11855
+ * const integration = await gitAdapter.updateIntegration({
11856
+ * uri: 'git@github.com:myorg/newrepo.git',
11857
+ * publicKeySpec: 'openssh',
11858
+ * privateKeySpec: 'pkcs8',
11859
+ * algorithm: 'ed25519',
11860
+ * });
11861
+ *
11862
+ * @param integration Fields to update on the git integration
11863
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11864
+ * @returns promise that resolves to the updated git integration
11865
+ */
11866
+ async function updateIntegration(integration, optionals = {}) {
11867
+ return new Router().patch('/git/integration', {
11868
+ body: integration,
11869
+ ...optionals
11870
+ }).then(({
11871
+ body
11872
+ }) => body);
11873
+ }
11874
+
11875
+ /**
11876
+ * Removes the git integration for the project.
11877
+ * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/integration`
11878
+ *
11879
+ * @example
11880
+ * import { gitAdapter } from 'epicenter-libs';
11881
+ * await gitAdapter.removeIntegration();
11882
+ *
11883
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11884
+ * @returns promise that resolves when the integration is removed
11885
+ */
11886
+ async function removeIntegration(optionals = {}) {
11887
+ return new Router().delete('/git/integration', optionals).then(({
11888
+ body
11889
+ }) => body);
11890
+ }
11891
+
11892
+ /**
11893
+ * Pushes local commits to the remote git repository.
11894
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/push`
11895
+ *
11896
+ * @example
11897
+ * import { gitAdapter } from 'epicenter-libs';
11898
+ * await gitAdapter.push({ message: 'Update simulation data' });
11899
+ *
11900
+ * @param optionals Arguments object; also accepts network call option overrides.
11901
+ * @param optionals.message Commit message (required)
11902
+ * @param [optionals.password] Password for authentication
11903
+ * @param [optionals.force] Force-push, bypassing non-fast-forward checks
11904
+ * @returns promise that resolves when the push is complete
11905
+ */
11906
+ async function push(optionals) {
11907
+ const {
11908
+ message,
11909
+ password,
11910
+ force,
11911
+ ...routingOptions
11912
+ } = optionals;
11913
+ return new Router().withSearchParams({
11914
+ force
11915
+ }).post('/git/push', {
11916
+ body: {
11917
+ message,
11918
+ password
11919
+ },
11920
+ ...routingOptions
11921
+ }).then(({
11922
+ body
11923
+ }) => body);
11924
+ }
11925
+
11926
+ /**
11927
+ * Pulls changes from the remote git repository into the project.
11928
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/pull`
11929
+ *
11930
+ * @example
11931
+ * import { gitAdapter } from 'epicenter-libs';
11932
+ * await gitAdapter.pull({ force: true, confirm: true });
11933
+ *
11934
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
11935
+ * @param [optionals.password] Password for authentication
11936
+ * @param [optionals.force] Force the pull, overwriting local changes
11937
+ * @param [optionals.confirm] Set the `X-Forio-Confirmation` header to confirm an overwrite
11938
+ * @returns promise that resolves when the pull is complete
11939
+ */
11940
+ async function pull(optionals = {}) {
11941
+ const {
11942
+ password,
11943
+ force,
11944
+ confirm,
11945
+ headers: headersOverride,
11946
+ ...routingOptions
11947
+ } = optionals;
11948
+ const headers = Object.assign({}, headersOverride, confirm ? {
11949
+ 'X-Forio-Confirmation': true
11950
+ } : {});
11951
+ return new Router().withSearchParams({
11952
+ force
11953
+ }).post('/git/pull', {
11954
+ body: {
11955
+ password
11956
+ },
11957
+ headers,
11958
+ ...routingOptions
11959
+ }).then(({
11960
+ body
11961
+ }) => body);
11962
+ }
11963
+
11964
+ var git = /*#__PURE__*/Object.freeze({
11965
+ __proto__: null,
11966
+ checkout: checkout,
11967
+ createIntegration: createIntegration,
11968
+ get: get,
11969
+ getStatus: getStatus,
11970
+ pull: pull,
11971
+ push: push,
11972
+ removeIntegration: removeIntegration,
11973
+ reset: reset,
11974
+ updateIntegration: updateIntegration
11975
+ });
11976
+
11977
+ // ──────────────────────────────────────────────
11978
+ // Data Points
11979
+ // ──────────────────────────────────────────────
11980
+
11981
+ // ──────────────────────────────────────────────
11982
+ // Chart Series
11983
+ // ──────────────────────────────────────────────
11984
+
11985
+ // ──────────────────────────────────────────────
11986
+ // Chart, Table, Picture
11987
+ // ──────────────────────────────────────────────
11988
+
11989
+ // ──────────────────────────────────────────────
11990
+ // Binary Data
11991
+ // ──────────────────────────────────────────────
11992
+
11993
+ // ──────────────────────────────────────────────
11994
+ // Environment, Slide, Document
11995
+ // ──────────────────────────────────────────────
11996
+
11997
+ /**
11998
+ * Generates a PowerPoint file from a template and returns it as binary data (JSON-encoded)
11999
+ * Base URL: PUT `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/powerpoint/{TEMPLATE_DIRECTORY}/{TEMPLATE_PATH}`
12000
+ *
12001
+ * @example
12002
+ * import { powerpointAdapter } from 'epicenter-libs';
12003
+ * const binaryData = await powerpointAdapter.generate('MODEL', 'en-US-debrief-template.pptx', {
12004
+ * output: 'debrief-slides.pptx',
12005
+ * environment: {},
12006
+ * slides: [
12007
+ * {
12008
+ * number: 1,
12009
+ * environment: {
12010
+ * tables: [{ name: 'Leaderboard', data: [['Rank', 'Name', 'Score']] }],
12011
+ * },
12012
+ * },
12013
+ * ],
12014
+ * });
12015
+ *
12016
+ * @param templateDirectory Directory where the template is stored: 'DATA' or 'MODEL'
12017
+ * @param templatePath Path to the template file within the directory
12018
+ * @param document Document shadow defining the output filename, environment, and slides
12019
+ * @param [optionals] Optional arguments; pass network call options overrides here.
12020
+ * @returns promise that resolves to the generated PowerPoint as BinaryData
12021
+ */
12022
+ async function generate(templateDirectory, templatePath, document, optionals = {}) {
12023
+ return new Router().put(`/powerpoint/${templateDirectory}/${templatePath}`, {
12024
+ body: document,
12025
+ ...optionals
12026
+ }).then(({
12027
+ body
12028
+ }) => body);
12029
+ }
12030
+
12031
+ /**
12032
+ * Generates a PowerPoint file from a template and returns it as a streaming response.
12033
+ * Useful for downloading the generated file directly.
12034
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/powerpoint/{TEMPLATE_DIRECTORY}/{TEMPLATE_PATH}`
12035
+ *
12036
+ * @example
12037
+ * import { powerpointAdapter } from 'epicenter-libs';
12038
+ * const response = await powerpointAdapter.stream('MODEL', 'en-US-debrief-template.pptx', {
12039
+ * output: 'debrief-slides.pptx',
12040
+ * environment: {},
12041
+ * slides: [],
12042
+ * });
12043
+ * const blob = await response.blob();
12044
+ *
12045
+ * @param templateDirectory Directory where the template is stored: 'DATA' or 'MODEL'
12046
+ * @param templatePath Path to the template file within the directory
12047
+ * @param document Document shadow defining the output filename, environment, and slides
12048
+ * @param [optionals] Optional arguments; pass network call options overrides here.
12049
+ * @returns promise that resolves to the raw Response for streaming/blob handling
12050
+ */
12051
+ async function stream(templateDirectory, templatePath, document, optionals = {}) {
12052
+ const {
12053
+ server,
12054
+ accountShortName,
12055
+ projectShortName,
12056
+ useProjectProxy,
12057
+ query,
12058
+ headers: headersOverride,
12059
+ authorization,
12060
+ includeAuthorization
12061
+ } = optionals;
12062
+ const url = new Router().getURL(`/powerpoint/${templateDirectory}/${templatePath}`, {
12063
+ server,
12064
+ accountShortName,
12065
+ projectShortName,
12066
+ useProjectProxy,
12067
+ query
12068
+ });
12069
+ const headers = {
12070
+ 'Content-type': 'application/json; charset=UTF-8',
12071
+ ...headersOverride
12072
+ };
12073
+ if (includeAuthorization !== false) {
12074
+ const {
12075
+ session
12076
+ } = identification;
12077
+ if (!headers.Authorization) {
12078
+ if (session) headers.Authorization = `Bearer ${session.token}`;
12079
+ if (authorization) headers.Authorization = authorization;
12080
+ if (config.authOverride) headers.Authorization = config.authOverride;
12081
+ }
12082
+ }
12083
+ return fetch(url.toString(), {
12084
+ method: 'POST',
12085
+ cache: 'no-cache',
12086
+ redirect: 'follow',
12087
+ headers,
12088
+ body: JSON.stringify(document)
12089
+ });
12090
+ }
12091
+
12092
+ var powerpoint = /*#__PURE__*/Object.freeze({
12093
+ __proto__: null,
12094
+ generate: generate,
12095
+ stream: stream
12096
+ });
12097
+
10743
12098
  const proxy = async (resource, options) => {
10744
12099
  const {
10745
12100
  accountShortName,
@@ -10757,9 +12112,9 @@ var utilities = /*#__PURE__*/Object.freeze({
10757
12112
  proxy: proxy
10758
12113
  });
10759
12114
 
10760
- /* yes, this string template literal is weird;
10761
- * it's cause rollup does not recogize 3.34.2 as an individual token otherwise */
10762
- const version = `Epicenter (v${'3.34.2'}) for Browsers | Build Date: 2026-04-01T19:37:03.682Z`;
12115
+ /* "3.35.0", "Browsers" and "2026-07-21T22:45:13.866Z" are injected at build time — by
12116
+ * @rollup/plugin-replace for the shipped bundles and by Vite's `define` for tests */
12117
+ const version = `Epicenter (v${"3.35.0"}) for ${"Browsers"} | Build Date: ${"2026-07-21T22:45:13.866Z"}`;
10763
12118
  const UNAUTHORIZED = 401;
10764
12119
  const FORBIDDEN = 403;
10765
12120
  const DEFAULT_ERROR_HANDLERS = {};
@@ -10808,5 +12163,5 @@ DEFAULT_ERROR_HANDLERS.authInvalidated = errorManager.registerHandler(error => e
10808
12163
  });
10809
12164
  Object.freeze(DEFAULT_ERROR_HANDLERS);
10810
12165
 
10811
- export { Channel, DEFAULT_ERROR_HANDLERS, Fault, PUSH_CATEGORY, RITUAL, ROLE, Router, SCOPE_BOUNDARY, account as accountAdapter, admin as adminAdapter, asset as assetAdapter, authentication as authAdapter, chat as chatAdapter, cometdAdapter, config, consensus as consensusAdapter, daily as dailyAdapter, email as emailAdapter, episode as episodeAdapter, errorManager, group as groupAdapter, leaderboard as leaderboardAdapter, matchmaker as matchmakerAdapter, presence as presenceAdapter, project as projectAdapter, recaptcha as recaptchaAdapter, run as runAdapter, somebody as somebodyAdapter, task as taskAdapter, time as timeAdapter, user as userAdapter, utilities as utils, vault as vaultAdapter, version, video$1 as videoAPI, video as videoAdapter, vonage$1 as vonageAPI, vonage as vonageAdapter, wallet as walletAdapter, world as worldAdapter };
12166
+ export { Channel, DEFAULT_ERROR_HANDLERS, Fault, PUSH_CATEGORY, RITUAL, ROLE, Router, SCOPE_BOUNDARY, account as accountAdapter, admin as adminAdapter, asset as assetAdapter, authentication as authAdapter, chat as chatAdapter, cometdAdapter, config, consensus as consensusAdapter, daily as dailyAdapter, docket as docketAdapter, email as emailAdapter, encyclopedia as encyclopediaAdapter, episode as episodeAdapter, errorManager, file as fileAdapter, git as gitAdapter, group as groupAdapter, leaderboard as leaderboardAdapter, matchmaker as matchmakerAdapter, pipeline as pipelineAdapter, powerpoint as powerpointAdapter, presence as presenceAdapter, project as projectAdapter, recaptcha as recaptchaAdapter, registration as registrationAdapter, run as runAdapter, somebody as somebodyAdapter, task as taskAdapter, time as timeAdapter, user as userAdapter, utilities as utils, vault as vaultAdapter, version, video$1 as videoAPI, video as videoAdapter, vonage$1 as vonageAPI, vonage as vonageAdapter, wallet as walletAdapter, world as worldAdapter };
10812
12167
  //# sourceMappingURL=epicenter.js.map