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
package/dist/epicenter.js CHANGED
@@ -25,7 +25,7 @@
25
25
  if (hasRequiredRuntime) return runtime.exports;
26
26
  hasRequiredRuntime = 1;
27
27
  (function (module) {
28
- var runtime = (function (exports$1) {
28
+ var runtime = (function (exports) {
29
29
 
30
30
  var Op = Object.prototype;
31
31
  var hasOwn = Op.hasOwnProperty;
@@ -66,7 +66,7 @@
66
66
 
67
67
  return generator;
68
68
  }
69
- exports$1.wrap = wrap;
69
+ exports.wrap = wrap;
70
70
 
71
71
  // Try/catch helper to minimize deoptimizations. Returns a completion
72
72
  // record like context.tryEntries[i].completion. This interface could
@@ -145,7 +145,7 @@
145
145
  });
146
146
  }
147
147
 
148
- exports$1.isGeneratorFunction = function(genFun) {
148
+ exports.isGeneratorFunction = function(genFun) {
149
149
  var ctor = typeof genFun === "function" && genFun.constructor;
150
150
  return ctor
151
151
  ? ctor === GeneratorFunction ||
@@ -155,7 +155,7 @@
155
155
  : false;
156
156
  };
157
157
 
158
- exports$1.mark = function(genFun) {
158
+ exports.mark = function(genFun) {
159
159
  if (Object.setPrototypeOf) {
160
160
  Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
161
161
  } else {
@@ -170,7 +170,7 @@
170
170
  // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
171
171
  // `hasOwn.call(value, "__await")` to determine if the yielded value is
172
172
  // meant to be awaited.
173
- exports$1.awrap = function(arg) {
173
+ exports.awrap = function(arg) {
174
174
  return { __await: arg };
175
175
  };
176
176
 
@@ -245,12 +245,12 @@
245
245
  define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
246
246
  return this;
247
247
  });
248
- exports$1.AsyncIterator = AsyncIterator;
248
+ exports.AsyncIterator = AsyncIterator;
249
249
 
250
250
  // Note that simple async functions are implemented on top of
251
251
  // AsyncIterator objects; they just return a Promise for the value of
252
252
  // the final result produced by the iterator.
253
- exports$1.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
253
+ exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
254
254
  if (PromiseImpl === void 0) PromiseImpl = Promise;
255
255
 
256
256
  var iter = new AsyncIterator(
@@ -258,7 +258,7 @@
258
258
  PromiseImpl
259
259
  );
260
260
 
261
- return exports$1.isGeneratorFunction(outerFn)
261
+ return exports.isGeneratorFunction(outerFn)
262
262
  ? iter // If outerFn is a generator, return the full iterator.
263
263
  : iter.next().then(function(result) {
264
264
  return result.done ? result.value : iter.next();
@@ -478,7 +478,7 @@
478
478
  this.reset(true);
479
479
  }
480
480
 
481
- exports$1.keys = function(val) {
481
+ exports.keys = function(val) {
482
482
  var object = Object(val);
483
483
  var keys = [];
484
484
  for (var key in object) {
@@ -539,7 +539,7 @@
539
539
 
540
540
  throw new TypeError(typeof iterable + " is not iterable");
541
541
  }
542
- exports$1.values = values;
542
+ exports.values = values;
543
543
 
544
544
  function doneResult() {
545
545
  return { value: undefined$1, done: true };
@@ -749,7 +749,7 @@
749
749
  // or not, return the runtime object so that we can declare the variable
750
750
  // regeneratorRuntime in the outer scope, which allows this module to be
751
751
  // injected easily by `bin/regenerator --include-runtime script.js`.
752
- return exports$1;
752
+ return exports;
753
753
 
754
754
  }(
755
755
  // If this script is executing as a CommonJS module, use module.exports
@@ -826,7 +826,7 @@
826
826
  function requireBrowserPonyfill () {
827
827
  if (hasRequiredBrowserPonyfill) return browserPonyfill.exports;
828
828
  hasRequiredBrowserPonyfill = 1;
829
- (function (module, exports$1) {
829
+ (function (module, exports) {
830
830
  // Save global object in a variable
831
831
  var __global__ =
832
832
  (typeof globalThis !== 'undefined' && globalThis) ||
@@ -845,7 +845,7 @@
845
845
  // "globalThis" that's going to be patched
846
846
  (function(globalThis) {
847
847
 
848
- ((function (exports$1) {
848
+ ((function (exports) {
849
849
 
850
850
  /* eslint-disable no-prototype-builtins */
851
851
  var g =
@@ -1358,18 +1358,18 @@
1358
1358
  return new Response(null, {status: status, headers: {location: url}})
1359
1359
  };
1360
1360
 
1361
- exports$1.DOMException = g.DOMException;
1361
+ exports.DOMException = g.DOMException;
1362
1362
  try {
1363
- new exports$1.DOMException();
1363
+ new exports.DOMException();
1364
1364
  } catch (err) {
1365
- exports$1.DOMException = function(message, name) {
1365
+ exports.DOMException = function(message, name) {
1366
1366
  this.message = message;
1367
1367
  this.name = name;
1368
1368
  var error = Error(message);
1369
1369
  this.stack = error.stack;
1370
1370
  };
1371
- exports$1.DOMException.prototype = Object.create(Error.prototype);
1372
- exports$1.DOMException.prototype.constructor = exports$1.DOMException;
1371
+ exports.DOMException.prototype = Object.create(Error.prototype);
1372
+ exports.DOMException.prototype.constructor = exports.DOMException;
1373
1373
  }
1374
1374
 
1375
1375
  function fetch(input, init) {
@@ -1377,7 +1377,7 @@
1377
1377
  var request = new Request(input, init);
1378
1378
 
1379
1379
  if (request.signal && request.signal.aborted) {
1380
- return reject(new exports$1.DOMException('Aborted', 'AbortError'))
1380
+ return reject(new exports.DOMException('Aborted', 'AbortError'))
1381
1381
  }
1382
1382
 
1383
1383
  var xhr = new XMLHttpRequest();
@@ -1419,7 +1419,7 @@
1419
1419
 
1420
1420
  xhr.onabort = function() {
1421
1421
  setTimeout(function() {
1422
- reject(new exports$1.DOMException('Aborted', 'AbortError'));
1422
+ reject(new exports.DOMException('Aborted', 'AbortError'));
1423
1423
  }, 0);
1424
1424
  };
1425
1425
 
@@ -1490,14 +1490,14 @@
1490
1490
  g.Response = Response;
1491
1491
  }
1492
1492
 
1493
- exports$1.Headers = Headers;
1494
- exports$1.Request = Request;
1495
- exports$1.Response = Response;
1496
- exports$1.fetch = fetch;
1493
+ exports.Headers = Headers;
1494
+ exports.Request = Request;
1495
+ exports.Response = Response;
1496
+ exports.fetch = fetch;
1497
1497
 
1498
- Object.defineProperty(exports$1, '__esModule', { value: true });
1498
+ Object.defineProperty(exports, '__esModule', { value: true });
1499
1499
 
1500
- return exports$1;
1500
+ return exports;
1501
1501
 
1502
1502
  }))({});
1503
1503
  })(__globalThis__);
@@ -1506,13 +1506,13 @@
1506
1506
  delete __globalThis__.fetch.polyfill;
1507
1507
  // Choose between native implementation (__global__) or custom implementation (__globalThis__)
1508
1508
  var ctx = __global__.fetch ? __global__ : __globalThis__;
1509
- exports$1 = ctx.fetch; // To enable: import fetch from 'cross-fetch'
1510
- exports$1.default = ctx.fetch; // For TypeScript consumers without esModuleInterop.
1511
- exports$1.fetch = ctx.fetch; // To enable: import {fetch} from 'cross-fetch'
1512
- exports$1.Headers = ctx.Headers;
1513
- exports$1.Request = ctx.Request;
1514
- exports$1.Response = ctx.Response;
1515
- module.exports = exports$1;
1509
+ exports = ctx.fetch; // To enable: import fetch from 'cross-fetch'
1510
+ exports.default = ctx.fetch; // For TypeScript consumers without esModuleInterop.
1511
+ exports.fetch = ctx.fetch; // To enable: import {fetch} from 'cross-fetch'
1512
+ exports.Headers = ctx.Headers;
1513
+ exports.Request = ctx.Request;
1514
+ exports.Response = ctx.Response;
1515
+ module.exports = exports;
1516
1516
  } (browserPonyfill, browserPonyfill.exports));
1517
1517
  return browserPonyfill.exports;
1518
1518
  }
@@ -3318,7 +3318,7 @@
3318
3318
  * @param [optionals] Optional arguments; pass network call options overrides here.
3319
3319
  * @returns promise that resolves to the project object
3320
3320
  */
3321
- async function get$e(optionals = {}) {
3321
+ async function get$f(optionals = {}) {
3322
3322
  return await new Router().get('/project', optionals).then(({
3323
3323
  body
3324
3324
  }) => body);
@@ -3336,7 +3336,7 @@
3336
3336
  * @param [optionals] Optional arguments; pass network call options overrides here.
3337
3337
  * @returns promise that resolves to an array of project objects
3338
3338
  */
3339
- async function list$4(accountShortName, optionals = {}) {
3339
+ async function list$5(accountShortName, optionals = {}) {
3340
3340
  return await new Router().withAccountShortName(accountShortName).withProjectShortName('manager').get('/project/in', optionals).then(({
3341
3341
  body
3342
3342
  }) => body);
@@ -3349,8 +3349,8 @@
3349
3349
  PHYLOGENY: PHYLOGENY,
3350
3350
  WORKER_PARTITION: WORKER_PARTITION,
3351
3351
  channelsEnabled: channelsEnabled,
3352
- get: get$e,
3353
- list: list$4
3352
+ get: get$f,
3353
+ list: list$5
3354
3354
  });
3355
3355
 
3356
3356
  const AUTH_TOKEN_KEY = 'com.forio.epicenter.token';
@@ -3417,7 +3417,7 @@
3417
3417
  logLevel: 'warn'
3418
3418
  }) {
3419
3419
  var _project$channelProto;
3420
- const project = await get$e();
3420
+ const project = await get$f();
3421
3421
  if (!project.channelEnabled) throw new EpicenterError('Push Channels are not enabled on this project');
3422
3422
  const channelProtocol = ((_project$channelProto = project.channelProtocol) === null || _project$channelProto === void 0 ? void 0 : _project$channelProto.toLowerCase()) || DEFAULT_CHANNEL_PROTOCOL;
3423
3423
  const {
@@ -4237,7 +4237,7 @@
4237
4237
  * @param [optionals.tokenAccessSeconds] How long the presigned URL is valid for in seconds
4238
4238
  * @returns promise that resolves to an asset ticket containing the presigned upload URL
4239
4239
  */
4240
- async function create$a(file, scope, optionals = {}) {
4240
+ async function create$c(file, scope, optionals = {}) {
4241
4241
  const {
4242
4242
  scopeBoundary,
4243
4243
  scopeKey,
@@ -4342,7 +4342,7 @@
4342
4342
  * @param [optionals] Optional arguments; pass network call options overrides here.
4343
4343
  * @returns promise that resolves when the asset is deleted
4344
4344
  */
4345
- async function remove$4(assetKey, optionals = {}) {
4345
+ async function remove$5(assetKey, optionals = {}) {
4346
4346
  return await new Router().delete(`/asset/${assetKey}`, optionals).then(({
4347
4347
  body
4348
4348
  }) => body);
@@ -4390,7 +4390,7 @@
4390
4390
  * @param [optionals] Optional arguments; pass network call options overrides here.
4391
4391
  * @returns promise that resolves to the asset metadata
4392
4392
  */
4393
- async function get$d(assetKey, optionals = {}) {
4393
+ async function get$e(assetKey, optionals = {}) {
4394
4394
  const {
4395
4395
  server,
4396
4396
  accountShortName,
@@ -4426,7 +4426,7 @@
4426
4426
  * @param [optionals.filter] File pattern to filter assets (e.g., '*.pdf' for PDF files); defaults to '*' (all files)
4427
4427
  * @returns promise that resolves to a list of assets
4428
4428
  */
4429
- async function list$3(scope, optionals = {}) {
4429
+ async function list$4(scope, optionals = {}) {
4430
4430
  const {
4431
4431
  scopeBoundary,
4432
4432
  scopeKey,
@@ -4519,7 +4519,7 @@
4519
4519
  * @param [optionals.tokenAccessSeconds] How long the presigned URL is valid for in seconds
4520
4520
  * @returns promise that resolves when the download is complete
4521
4521
  */
4522
- async function download$1(assetKey, optionals = {}) {
4522
+ async function download$2(assetKey, optionals = {}) {
4523
4523
  const {
4524
4524
  tokenAccessSeconds,
4525
4525
  ...routingOptions
@@ -4607,7 +4607,7 @@
4607
4607
  const name = fileName !== null && fileName !== void 0 ? fileName : file.name;
4608
4608
  let presignedUrl = '';
4609
4609
  try {
4610
- const response = await create$a(name, scope, {
4610
+ const response = await create$c(name, scope, {
4611
4611
  inert: true,
4612
4612
  ...remaining
4613
4613
  });
@@ -4631,14 +4631,14 @@
4631
4631
 
4632
4632
  var asset = /*#__PURE__*/Object.freeze({
4633
4633
  __proto__: null,
4634
- create: create$a,
4635
- download: download$1,
4634
+ create: create$c,
4635
+ download: download$2,
4636
4636
  downloadWithScope: downloadWithScope,
4637
- get: get$d,
4637
+ get: get$e,
4638
4638
  getURL: getURL$1,
4639
4639
  getURLWithScope: getURLWithScope,
4640
- list: list$3,
4641
- remove: remove$4,
4640
+ list: list$4,
4641
+ remove: remove$5,
4642
4642
  removeFromScope: removeFromScope,
4643
4643
  store: store,
4644
4644
  update: update$6
@@ -4846,7 +4846,7 @@
4846
4846
  * @param [optionals.category] Optional argument to allow for establishing episode hierarchies
4847
4847
  * @returns promise that resolves to the newly created episode
4848
4848
  */
4849
- async function create$9(name, groupName, optionals = {}) {
4849
+ async function create$b(name, groupName, optionals = {}) {
4850
4850
  const {
4851
4851
  draft,
4852
4852
  runLimit,
@@ -4878,7 +4878,7 @@
4878
4878
  * @param [optionals] Optional arguments; pass network call options overrides here.
4879
4879
  * @returns promise that resolves to an episode
4880
4880
  */
4881
- async function get$c(episodeKey, optionals = {}) {
4881
+ async function get$d(episodeKey, optionals = {}) {
4882
4882
  return await new Router().get(`/episode/${episodeKey}`, optionals).then(({
4883
4883
  body
4884
4884
  }) => body);
@@ -4914,7 +4914,7 @@
4914
4914
  * @param [optionals] Optional arguments; pass network call options overrides here.
4915
4915
  * @returns promise that resolves to a page of episodes
4916
4916
  */
4917
- async function query$4(searchOptions, optionals = {}) {
4917
+ async function query$5(searchOptions, optionals = {}) {
4918
4918
  const {
4919
4919
  filter,
4920
4920
  sort = [],
@@ -4988,7 +4988,7 @@
4988
4988
  * @param [optionals] Optional arguments; pass network call options overrides here.
4989
4989
  * @returns promise that resolves to undefined if successful
4990
4990
  */
4991
- async function remove$3(episodeKey, optionals = {}) {
4991
+ async function remove$4(episodeKey, optionals = {}) {
4992
4992
  return await new Router().delete(`/episode/${episodeKey}`, optionals).then(({
4993
4993
  body
4994
4994
  }) => body);
@@ -4996,11 +4996,11 @@
4996
4996
 
4997
4997
  var episode = /*#__PURE__*/Object.freeze({
4998
4998
  __proto__: null,
4999
- create: create$9,
4999
+ create: create$b,
5000
5000
  forGroup: forGroup$1,
5001
- get: get$c,
5002
- query: query$4,
5003
- remove: remove$3,
5001
+ get: get$d,
5002
+ query: query$5,
5003
+ remove: remove$4,
5004
5004
  withName: withName
5005
5005
  });
5006
5006
 
@@ -5023,7 +5023,7 @@
5023
5023
  * @param [optionals.groupKey] Group key; if omitted will attempt to use the group associated with the current session
5024
5024
  * @returns promise that resolves to a group
5025
5025
  */
5026
- async function get$b(optionals = {}) {
5026
+ async function get$c(optionals = {}) {
5027
5027
  const {
5028
5028
  groupKey,
5029
5029
  augment,
@@ -5173,7 +5173,7 @@
5173
5173
  * @param [optionals] Optional arguments; pass network call options overrides here.
5174
5174
  * @returns promise that resolves to the newly created group
5175
5175
  */
5176
- async function create$8(group, optionals = {}) {
5176
+ async function create$a(group, optionals = {}) {
5177
5177
  const {
5178
5178
  name,
5179
5179
  runLimit,
@@ -5240,7 +5240,7 @@
5240
5240
  * @param [optionals] Optional arguments; pass network call options overrides here.
5241
5241
  * @returns promise that resolves to a page of groups
5242
5242
  */
5243
- async function query$3(searchOptions, optionals = {}) {
5243
+ async function query$4(searchOptions, optionals = {}) {
5244
5244
  const {
5245
5245
  filter,
5246
5246
  sort = [],
@@ -5279,7 +5279,7 @@
5279
5279
  max,
5280
5280
  quantized
5281
5281
  };
5282
- return await query$3(searchOptions, routingOptions);
5282
+ return await query$4(searchOptions, routingOptions);
5283
5283
  }
5284
5284
 
5285
5285
  /**
@@ -5652,14 +5652,14 @@
5652
5652
  var group = /*#__PURE__*/Object.freeze({
5653
5653
  __proto__: null,
5654
5654
  addUser: addUser$1,
5655
- create: create$8,
5655
+ create: create$a,
5656
5656
  destroy: destroy$2,
5657
5657
  forUser: forUser,
5658
5658
  gather: gather,
5659
- get: get$b,
5659
+ get: get$c,
5660
5660
  getSessionGroups: getSessionGroups,
5661
5661
  getWhitelistedUsers: getWhitelistedUsers,
5662
- query: query$3,
5662
+ query: query$4,
5663
5663
  removeUser: removeUser,
5664
5664
  search: search,
5665
5665
  selfRegister: selfRegister,
@@ -5758,7 +5758,7 @@
5758
5758
  * @param [optionals] Optional arguments; pass network call options overrides here.
5759
5759
  * @returns promise that resolves to a list of leaderboard entries
5760
5760
  */
5761
- async function list$2(collection, scope, searchOptions, optionals = {}) {
5761
+ async function list$3(collection, scope, searchOptions, optionals = {}) {
5762
5762
  const {
5763
5763
  scopeBoundary,
5764
5764
  scopeKey
@@ -5779,9 +5779,9 @@
5779
5779
  body
5780
5780
  }) => body);
5781
5781
  }
5782
- async function get$a(collection, scope, searchOptions, optionals = {}) {
5782
+ async function get$b(collection, scope, searchOptions, optionals = {}) {
5783
5783
  console.warn('DEPRECATION WARNING: leaderboardAdapter.get is deprecated and will be removed with the next release. Use leaderboardAdapter.list instead.');
5784
- return await list$2(collection, scope, searchOptions, optionals);
5784
+ return await list$3(collection, scope, searchOptions, optionals);
5785
5785
  }
5786
5786
 
5787
5787
  /**
@@ -5827,9 +5827,9 @@
5827
5827
 
5828
5828
  var leaderboard = /*#__PURE__*/Object.freeze({
5829
5829
  __proto__: null,
5830
- get: get$a,
5830
+ get: get$b,
5831
5831
  getCount: getCount,
5832
- list: list$2,
5832
+ list: list$3,
5833
5833
  update: update$4
5834
5834
  });
5835
5835
 
@@ -5978,7 +5978,7 @@
5978
5978
  * @param [optionals.allowChannel] Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT
5979
5979
  * @returns promise that resolves to the newly created run
5980
5980
  */
5981
- async function create$7(model, scope, optionals = {}) {
5981
+ async function create$9(model, scope, optionals = {}) {
5982
5982
  const {
5983
5983
  scopeBoundary,
5984
5984
  scopeKey,
@@ -6269,7 +6269,7 @@
6269
6269
  * @param [optionals] Optional arguments; pass network call options overrides here.
6270
6270
  * @returns promise that resolve to undefined if successful
6271
6271
  */
6272
- async function remove$2(runKey, optionals = {}) {
6272
+ async function remove$3(runKey, optionals = {}) {
6273
6273
  return await new Router().delete(`/run/${runKey}`, optionals).then(({
6274
6274
  body
6275
6275
  }) => body);
@@ -6287,7 +6287,7 @@
6287
6287
  * @param [optionals] Optional arguments; pass network call options overrides here.
6288
6288
  * @returns promise that resolves to the run
6289
6289
  */
6290
- async function get$9(runKey, optionals = {}) {
6290
+ async function get$a(runKey, optionals = {}) {
6291
6291
  return await new Router().get(`/run/${runKey}`, optionals).then(({
6292
6292
  body
6293
6293
  }) => body);
@@ -6329,7 +6329,7 @@
6329
6329
  * @param [optionals] Optional arguments; pass network call options overrides here.
6330
6330
  * @returns promise that resolves to a page of runs
6331
6331
  */
6332
- async function query$2(model, searchOptions, optionals = {}) {
6332
+ async function query$3(model, searchOptions, optionals = {}) {
6333
6333
  const {
6334
6334
  filter,
6335
6335
  sort = [],
@@ -6886,15 +6886,15 @@
6886
6886
  };
6887
6887
  const {
6888
6888
  values: [lastRun]
6889
- } = await query$2(model, searchOptions);
6889
+ } = await query$3(model, searchOptions);
6890
6890
  if (!lastRun) {
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
  }
6895
6895
  return lastRun;
6896
6896
  } else if (strategy === 'reuse-never') {
6897
- const newRun = await create$7(model, scope, optionals);
6897
+ const newRun = await create$9(model, scope, optionals);
6898
6898
  // await serial(newRun.runKey, initOperations, optionals = {});
6899
6899
  return newRun;
6900
6900
  } else ;
@@ -6947,9 +6947,9 @@
6947
6947
  MORPHOLOGY: MORPHOLOGY,
6948
6948
  action: action,
6949
6949
  clone: clone,
6950
- create: create$7,
6950
+ create: create$9,
6951
6951
  createSingular: createSingular,
6952
- get: get$9,
6952
+ get: get$a,
6953
6953
  getMetadata: getMetadata,
6954
6954
  getSingularRunKey: getSingularRunKey,
6955
6955
  getVariable: getVariable,
@@ -6959,8 +6959,8 @@
6959
6959
  introspectWithRunKey: introspectWithRunKey,
6960
6960
  migrate: migrate,
6961
6961
  operation: operation,
6962
- query: query$2,
6963
- remove: remove$2,
6962
+ query: query$3,
6963
+ remove: remove$3,
6964
6964
  removeFromWorld: removeFromWorld,
6965
6965
  restore: restore,
6966
6966
  retrieveFromWorld: retrieveFromWorld,
@@ -7042,7 +7042,7 @@
7042
7042
  * @param [optionals] Optional arguments; pass network call options overrides here.
7043
7043
  * @returns promise that resolves to a user
7044
7044
  */
7045
- async function get$8(userKey, optionals = {}) {
7045
+ async function get$9(userKey, optionals = {}) {
7046
7046
  return await new Router().get(`/user/${userKey}`, optionals).then(({
7047
7047
  body
7048
7048
  }) => body);
@@ -7075,7 +7075,7 @@
7075
7075
  var user = /*#__PURE__*/Object.freeze({
7076
7076
  __proto__: null,
7077
7077
  createUser: createUser,
7078
- get: get$8,
7078
+ get: get$9,
7079
7079
  getWithHandle: getWithHandle,
7080
7080
  uploadCSV: uploadCSV
7081
7081
  });
@@ -7166,7 +7166,7 @@
7166
7166
  * @param [optionals] Optional arguments; pass network call options overrides here.
7167
7167
  * @returns promise that resolves to the vault, or undefined if not found
7168
7168
  */
7169
- async function get$7(vaultKey, optionals = {}) {
7169
+ async function get$8(vaultKey, optionals = {}) {
7170
7170
  return await new Router().get(`/vault/${vaultKey}`, optionals).catch(error => {
7171
7171
  if (error.status === NOT_FOUND$4) return {
7172
7172
  body: undefined
@@ -7266,7 +7266,7 @@
7266
7266
  * @param [optionals.mutationKey] Mutation key for optimistic concurrency control
7267
7267
  * @returns promise that resolves to undefined when successful
7268
7268
  */
7269
- async function remove$1(vaultKey, optionals = {}) {
7269
+ async function remove$2(vaultKey, optionals = {}) {
7270
7270
  const {
7271
7271
  mutationKey,
7272
7272
  ...routingOptions
@@ -7381,7 +7381,7 @@
7381
7381
  * @param [optionals.mutationStrategy] Mutation strategy: ALLOW (upsert), DISALLOW (insert without update), ERROR (insert with conflict exception if exists)
7382
7382
  * @returns promise that resolves to the created vault
7383
7383
  */
7384
- async function create$6(name, scope, items, optionals = {}) {
7384
+ async function create$8(name, scope, items, optionals = {}) {
7385
7385
  console.warn('DEPRECATION WARNING: vaultAdapter.create is deprecated and will be removed with the next release. Use vaultAdapter.define instead.');
7386
7386
  return await define(name, scope, {
7387
7387
  items,
@@ -7413,7 +7413,7 @@
7413
7413
  * @param [optionals.groupName] Name of the group
7414
7414
  * @returns promise that resolves to an array of vaults that match the search options
7415
7415
  */
7416
- async function list$1(searchOptions, optionals = {}) {
7416
+ async function list$2(searchOptions, optionals = {}) {
7417
7417
  const {
7418
7418
  first,
7419
7419
  filter,
@@ -7478,11 +7478,11 @@
7478
7478
  __proto__: null,
7479
7479
  byName: byName$1,
7480
7480
  count: count,
7481
- create: create$6,
7481
+ create: create$8,
7482
7482
  define: define,
7483
- get: get$7,
7484
- list: list$1,
7485
- remove: remove$1,
7483
+ get: get$8,
7484
+ list: list$2,
7485
+ remove: remove$2,
7486
7486
  update: update$2,
7487
7487
  updateProperties: updateProperties,
7488
7488
  withScope: withScope$1
@@ -7807,7 +7807,7 @@
7807
7807
  * @param [optionals] Optional arguments; pass network call options overrides here.
7808
7808
  * @returns promise that resolves to undefined when successful
7809
7809
  */
7810
- async function remove(videoKey, optionals = {}) {
7810
+ async function remove$1(videoKey, optionals = {}) {
7811
7811
  return deleteVideoByKey(videoKey, optionals);
7812
7812
  }
7813
7813
 
@@ -7832,7 +7832,7 @@
7832
7832
  * @param [optionals] Optional arguments; pass network call options overrides here.
7833
7833
  * @returns promise that resolves to a page of video objects
7834
7834
  */
7835
- async function query$1(searchOptions, optionals = {}) {
7835
+ async function query$2(searchOptions, optionals = {}) {
7836
7836
  const {
7837
7837
  filter,
7838
7838
  sort = [],
@@ -8022,7 +8022,7 @@
8022
8022
  * @param [optionals.videoKey] Key for the video object
8023
8023
  * @returns promise that resolves to undefined when download is complete
8024
8024
  */
8025
- async function download(file, optionals = {}) {
8025
+ async function download$1(file, optionals = {}) {
8026
8026
  const {
8027
8027
  scope,
8028
8028
  affiliate,
@@ -8041,12 +8041,12 @@
8041
8041
 
8042
8042
  var video = /*#__PURE__*/Object.freeze({
8043
8043
  __proto__: null,
8044
- download: download,
8044
+ download: download$1,
8045
8045
  getDirectoryURL: getDirectoryURL,
8046
8046
  getURL: getURL,
8047
8047
  processVideo: processVideo,
8048
- query: query$1,
8049
- remove: remove
8048
+ query: query$2,
8049
+ remove: remove$1
8050
8050
  });
8051
8051
 
8052
8052
  /**
@@ -8393,7 +8393,7 @@
8393
8393
  * @param [optionals.allowChannel] Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT
8394
8394
  * @returns promise that resolves to the newly created world
8395
8395
  */
8396
- async function create$5(optionals = {}) {
8396
+ async function create$7(optionals = {}) {
8397
8397
  const {
8398
8398
  name,
8399
8399
  displayName,
@@ -8435,7 +8435,7 @@
8435
8435
  * @param [optionals.mine] Flag for indicating to get only the worlds the requesting user is in (based on session token)
8436
8436
  * @returns promise that resolves to a list of worlds
8437
8437
  */
8438
- async function get$6(optionals = {}) {
8438
+ async function get$7(optionals = {}) {
8439
8439
  const {
8440
8440
  groupName,
8441
8441
  episodeName,
@@ -8816,10 +8816,10 @@
8816
8816
  WORLD_NAME_GENERATOR_TYPE: WORLD_NAME_GENERATOR_TYPE,
8817
8817
  assignRun: assignRun,
8818
8818
  autoAssignUsers: autoAssignUsers,
8819
- create: create$5,
8819
+ create: create$7,
8820
8820
  destroy: destroy$1,
8821
8821
  editAssignments: editAssignments,
8822
- get: get$6,
8822
+ get: get$7,
8823
8823
  getAssignments: getAssignments,
8824
8824
  getAssignmentsByKey: getAssignmentsByKey,
8825
8825
  getPersonas: getPersonas,
@@ -8844,7 +8844,7 @@
8844
8844
  * @returns promise that resolves to the current server time in ISO 8601 format, or undefined if not found
8845
8845
  */
8846
8846
  const NOT_FOUND$3 = 404;
8847
- async function get$5(optionals = {}) {
8847
+ async function get$6(optionals = {}) {
8848
8848
  return await new Router().get('/time', optionals).catch(error => {
8849
8849
  if (error.status === NOT_FOUND$3) return {
8850
8850
  body: undefined
@@ -8857,15 +8857,13 @@
8857
8857
 
8858
8858
  var time = /*#__PURE__*/Object.freeze({
8859
8859
  __proto__: null,
8860
- get: get$5
8860
+ get: get$6
8861
8861
  });
8862
8862
 
8863
8863
  let RETRY_POLICY = /*#__PURE__*/function (RETRY_POLICY) {
8864
8864
  RETRY_POLICY["DO_NOTHING"] = "DO_NOTHING";
8865
8865
  // If the task fails, do nothing (this is the default)
8866
- RETRY_POLICY["RESCHEDULE"] = "RESCHEDULE";
8867
- // If the task fails retry at the next scheduled time point
8868
- 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
8866
+ RETRY_POLICY["FIRE_ON_FAIL_SAFE"] = "FIRE_ON_FAIL_SAFE"; // Retry within the task's fail-safe execution window
8869
8867
  return RETRY_POLICY;
8870
8868
  }({});
8871
8869
 
@@ -8882,7 +8880,7 @@
8882
8880
  // Task response structure
8883
8881
 
8884
8882
  /**
8885
- * Creates a task; requires support level authentication
8883
+ * Creates a task; requires facilitator (or higher) privileges
8886
8884
  * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/task`
8887
8885
  *
8888
8886
  * @example
@@ -8894,7 +8892,9 @@
8894
8892
  * const name = 'task-1-send-emails';
8895
8893
  * const payload = {
8896
8894
  * method: 'POST',
8897
- * url: 'https://forio.com/app/forio-dev/test-project/send-out-emails',
8895
+ * url: '/send-out-emails',
8896
+ * target: 'PROXY', // fire at the project's proxy server; omit to fire at the app
8897
+ * body: {},
8898
8898
  * };
8899
8899
  * const trigger = {
8900
8900
  * value: '0 7 15 * * ?', // triggers on day 15 7am of each month
@@ -8907,11 +8907,13 @@
8907
8907
  * @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.
8908
8908
  * @param [scope.userKey] Key associated with the user
8909
8909
  * @param name Name of the task
8910
- * @param payload An HTTP task object that will be executed when the task is triggered
8911
- * @param payload.method Type of method to use with the HTTP request (e.g., 'GET', 'POST', 'PATCH')
8912
- * @param payload.url The URL the HTTP request will be sent to
8913
- * @param [payload.body] The body of the HTTP request
8914
- * @param [payload.headers] Headers to send along with the HTTP request
8910
+ * @param payload An HTTP request or group-status change to execute when the task is triggered
8911
+ * @param payload.method Type of method to use with the HTTP request (e.g., 'GET', 'POST')
8912
+ * @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}`
8913
+ * @param [payload.target] Where the task fires: 'APPLICATION' (the project app, `/app`, the default) or 'PROXY' (the project's proxy server, `/proxy`)
8914
+ * @param payload.body The JSON body of the HTTP request
8915
+ * @param [payload.headers] Headers to send along with the HTTP request; must be non-empty when provided — omit rather than pass an empty object
8916
+ * @param [payload.timeoutSeconds] Request timeout in seconds (1–30)
8915
8917
  * @param trigger Object that determines when to run the task (cron, offset, or date)
8916
8918
  * @param [trigger.value] For cron: cron expression (e.g., '0 7 * * * ?'). For date: ISO-8601 date-time string
8917
8919
  * @param [trigger.objectType] Type of trigger: 'cron', 'offset', or 'date'
@@ -8922,23 +8924,24 @@
8922
8924
  * @param [optionals.accountShortName] Name of account (by default will be the account associated with the session)
8923
8925
  * @param [optionals.projectShortName] Name of project (by default will be the project associated with the session)
8924
8926
  * @param [optionals.retryPolicy] Specifies what to do should the task fail; see RETRY_POLICY
8925
- * @param [optionals.failSafeTermination] The ISO-8601 date-time when the task will be deleted regardless of any triggers; defaults to null
8926
- * @param [optionals.ttlSeconds] Max life expectancy of the task; used to determine if retrying the task is necessary
8927
+ * @param [optionals.failSafeTermination] ISO-8601 deadline after which the task terminates; the server defaults and caps this at one year from creation
8928
+ * @param [optionals.ttlSeconds] Execution fail-safe window in seconds; the server applies its configured minimum
8927
8929
  * @returns promise that resolves to the task object including the taskKey
8928
8930
  */
8929
- async function create$4(scope, name, payload, trigger, optionals = {}) {
8931
+ async function create$6(scope, name, payload, trigger, optionals = {}) {
8930
8932
  const {
8931
8933
  retryPolicy,
8932
8934
  failSafeTermination,
8933
8935
  ttlSeconds,
8934
8936
  ...routingOptions
8935
8937
  } = optionals;
8938
+ const normalizedPayload = payload.objectType === 'groupStatus' ? payload : {
8939
+ ...payload,
8940
+ objectType: 'http'
8941
+ };
8936
8942
  return await new Router().post('/task', {
8937
8943
  body: {
8938
- payload: {
8939
- objectType: 'http',
8940
- ...payload
8941
- },
8944
+ payload: normalizedPayload,
8942
8945
  trigger,
8943
8946
  retryPolicy,
8944
8947
  failSafeTermination,
@@ -8953,7 +8956,7 @@
8953
8956
  }
8954
8957
 
8955
8958
  /**
8956
- * Deletes a task (changes status to cancelled); requires support level authentication
8959
+ * Deletes a task (changes status to cancelled); requires facilitator (or higher) privileges
8957
8960
  * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/task/{TASK_KEY}`
8958
8961
  *
8959
8962
  * @example
@@ -8962,7 +8965,7 @@
8962
8965
  * await taskAdapter.destroy(taskKey);
8963
8966
  *
8964
8967
  * @param taskKey Unique key associated with a task
8965
- * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
8968
+ * @param [optionals] Optional arguments; pass network call options overrides here.
8966
8969
  * @param [optionals.accountShortName] Name of account (by default will be the account associated with the session)
8967
8970
  * @param [optionals.projectShortName] Name of project (by default will be the project associated with the session)
8968
8971
  * @returns promise that resolves to undefined when successful
@@ -8974,7 +8977,7 @@
8974
8977
  }
8975
8978
 
8976
8979
  /**
8977
- * Gets a task by taskKey; requires support level authentication
8980
+ * Gets a task by taskKey; requires facilitator (or higher) privileges
8978
8981
  * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/task/{TASK_KEY}`
8979
8982
  *
8980
8983
  * @example
@@ -8983,19 +8986,19 @@
8983
8986
  * const task = await taskAdapter.get(taskKey);
8984
8987
  *
8985
8988
  * @param taskKey Unique key associated with a task
8986
- * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
8989
+ * @param [optionals] Optional arguments; pass network call options overrides here.
8987
8990
  * @param [optionals.accountShortName] Name of account (by default will be the account associated with the session)
8988
8991
  * @param [optionals.projectShortName] Name of project (by default will be the project associated with the session)
8989
8992
  * @returns promise that resolves to the task object
8990
8993
  */
8991
- async function get$4(taskKey, optionals = {}) {
8994
+ async function get$5(taskKey, optionals = {}) {
8992
8995
  return await new Router().get(`/task/${taskKey}`, optionals).then(({
8993
8996
  body
8994
8997
  }) => body);
8995
8998
  }
8996
8999
 
8997
9000
  /**
8998
- * Gets the history (100 most recent times it has triggered) of a task by taskKey; requires support level authentication
9001
+ * Gets the history (100 most recent times it has triggered) of a task by taskKey; requires facilitator (or higher) privileges
8999
9002
  * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/task/history/{TASK_KEY}`
9000
9003
  *
9001
9004
  * @example
@@ -9004,19 +9007,32 @@
9004
9007
  * const history = await taskAdapter.getHistory(taskKey);
9005
9008
  *
9006
9009
  * @param taskKey Unique key associated with a task
9007
- * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
9010
+ * @param [optionals] Pagination and network options
9011
+ * @param [optionals.first] Zero-based index of the first history record; defaults to 0
9012
+ * @param [optionals.max] Maximum history records to return; defaults to 100 and cannot exceed 100
9008
9013
  * @param [optionals.accountShortName] Name of account (by default will be the account associated with the session)
9009
9014
  * @param [optionals.projectShortName] Name of project (by default will be the project associated with the session)
9010
- * @returns promise that resolves to an array of task history objects
9015
+ * @returns promise that resolves to a page of task history objects
9011
9016
  */
9012
9017
  async function getHistory(taskKey, optionals = {}) {
9013
- return await new Router().get(`/task/history/${taskKey}`, optionals).then(({
9018
+ const {
9019
+ first,
9020
+ max,
9021
+ ...routingOptions
9022
+ } = optionals;
9023
+ return await new Router().withSearchParams({
9024
+ first,
9025
+ max
9026
+ }).get(`/task/history/${taskKey}`, {
9027
+ paginated: true,
9028
+ ...routingOptions
9029
+ }).then(({
9014
9030
  body
9015
9031
  }) => body);
9016
9032
  }
9017
9033
 
9018
9034
  /**
9019
- * Gets most recent 100 tasks related to the selected scope; requires support level authentication
9035
+ * Gets most recent 100 tasks related to the selected scope; requires facilitator (or higher) privileges
9020
9036
  * 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}`
9021
9037
  *
9022
9038
  * 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.
@@ -9033,10 +9049,13 @@
9033
9049
  * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types
9034
9050
  * @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.
9035
9051
  * @param [scope.userKey] Key associated with the user; will retrieve tasks in the scope that were made by the specified user
9036
- * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
9052
+ * @param [optionals] Pagination, sorting, and network options
9053
+ * @param [optionals.sort] Task fields to sort by
9054
+ * @param [optionals.first] Zero-based index of the first task; defaults to 0
9055
+ * @param [optionals.max] Maximum tasks to return; defaults to 100 and cannot exceed 100
9037
9056
  * @param [optionals.accountShortName] Name of account (by default will be the account associated with the session)
9038
9057
  * @param [optionals.projectShortName] Name of project (by default will be the project associated with the session)
9039
- * @returns promise that resolves to an array of task objects
9058
+ * @returns promise that resolves to a page of task objects
9040
9059
  */
9041
9060
  async function getTaskIn(scope, optionals = {}) {
9042
9061
  const {
@@ -9044,7 +9063,70 @@
9044
9063
  scopeKey,
9045
9064
  userKey
9046
9065
  } = scope;
9047
- return await new Router().get(`/task/in/${scopeBoundary}/${scopeKey}${userKey ? `/${userKey}` : ''}`, optionals).then(({
9066
+ const {
9067
+ sort = [],
9068
+ first,
9069
+ max,
9070
+ ...routingOptions
9071
+ } = optionals;
9072
+ return await new Router().withSearchParams({
9073
+ sort: sort.join(';') || undefined,
9074
+ first,
9075
+ max
9076
+ }).get(`/task/in/${scopeBoundary}/${scopeKey}${userKey ? `/${userKey}` : ''}`, {
9077
+ paginated: true,
9078
+ ...routingOptions
9079
+ }).then(({
9080
+ body
9081
+ }) => body);
9082
+ }
9083
+
9084
+ /**
9085
+ * Queries for tasks
9086
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/task/search`
9087
+ *
9088
+ * No authentication is required; results use facilitator-level row visibility.
9089
+ * Filterable/sortable fields include
9090
+ * `task.taskKey`, `task.name`, `task.status`, `task.scopeBoundary`, `task.scopeKey`,
9091
+ * `task.userKey`, `task.groupName`, `task.episodeName`, `task.nextExecution`,
9092
+ * `task.failSafeExecution`, and `task.created`.
9093
+ *
9094
+ * @example
9095
+ * import { taskAdapter } from 'epicenter-libs';
9096
+ * const page = await taskAdapter.query({
9097
+ * filter: [
9098
+ * 'task.scopeKey=0000017dd3bf540e5ada5b1e058f08f20461', // tasks scoped to this group
9099
+ * 'task.status=INITIALIZED', // that have not yet fired
9100
+ * ],
9101
+ * sort: ['-task.created'], // newest first
9102
+ * max: 10, // page should only include the first 10 items
9103
+ * });
9104
+ *
9105
+ * @param searchOptions Search options for the query
9106
+ * @param [searchOptions.filter] Filters for searching
9107
+ * @param [searchOptions.sort] Sorting criteria
9108
+ * @param [searchOptions.first] The starting index of the page returned
9109
+ * @param [searchOptions.max] The number of entries per page
9110
+ * @param [optionals] Optional arguments; pass network call options overrides here.
9111
+ * @returns promise that resolves to a page of tasks
9112
+ */
9113
+ async function query$1(searchOptions, optionals = {}) {
9114
+ const {
9115
+ filter,
9116
+ sort = [],
9117
+ first,
9118
+ max
9119
+ } = searchOptions;
9120
+ const searchParams = {
9121
+ filter: parseFilterInput(filter),
9122
+ sort: sort.join(';') || undefined,
9123
+ first,
9124
+ max
9125
+ };
9126
+ return await new Router().withSearchParams(searchParams).get('/task/search', {
9127
+ paginated: true,
9128
+ ...optionals
9129
+ }).then(({
9048
9130
  body
9049
9131
  }) => body);
9050
9132
  }
@@ -9052,11 +9134,12 @@
9052
9134
  var task = /*#__PURE__*/Object.freeze({
9053
9135
  __proto__: null,
9054
9136
  RETRY_POLICY: RETRY_POLICY,
9055
- create: create$4,
9137
+ create: create$6,
9056
9138
  destroy: destroy,
9057
- get: get$4,
9139
+ get: get$5,
9058
9140
  getHistory: getHistory,
9059
- getTaskIn: getTaskIn
9141
+ getTaskIn: getTaskIn,
9142
+ query: query$1
9060
9143
  });
9061
9144
 
9062
9145
  /**
@@ -9108,7 +9191,7 @@
9108
9191
  * @param [optionals] Optional arguments; pass network call options overrides here.
9109
9192
  * @returns promise that resolves to the newly created chat
9110
9193
  */
9111
- async function create$3(room, scope, permit, optionals = {}) {
9194
+ async function create$5(room, scope, permit, optionals = {}) {
9112
9195
  return new Router().post('/chat', {
9113
9196
  body: {
9114
9197
  scope: {
@@ -9136,7 +9219,7 @@
9136
9219
  * @param [optionals] Optional arguments; pass network call options overrides here.
9137
9220
  * @returns promise that resolves to the chat
9138
9221
  */
9139
- async function get$3(chatKey, optionals = {}) {
9222
+ async function get$4(chatKey, optionals = {}) {
9140
9223
  return new Router().get(`/chat/${chatKey}`, optionals).then(({
9141
9224
  body
9142
9225
  }) => body);
@@ -9352,8 +9435,8 @@
9352
9435
 
9353
9436
  var chat = /*#__PURE__*/Object.freeze({
9354
9437
  __proto__: null,
9355
- create: create$3,
9356
- get: get$3,
9438
+ create: create$5,
9439
+ get: get$4,
9357
9440
  getMessages: getMessages,
9358
9441
  getMessagesAdmin: getMessagesAdmin,
9359
9442
  getMessagesForUser: getMessagesForUser,
@@ -9396,7 +9479,7 @@
9396
9479
  * @param [optionals.allowChannel] Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT
9397
9480
  * @returns promise that resolves to the newly created consensus barrier
9398
9481
  */
9399
- async function create$2(worldKey, name, stage, expectedRoles, defaultActions, optionals = {}) {
9482
+ async function create$4(worldKey, name, stage, expectedRoles, defaultActions, optionals = {}) {
9400
9483
  const {
9401
9484
  ttlSeconds,
9402
9485
  transparent = false,
@@ -9450,7 +9533,7 @@
9450
9533
  * @param [optionals] Optional arguments; pass network call options overrides here.
9451
9534
  * @returns promise that resolves to a list of consensus barriers
9452
9535
  */
9453
- async function list(worldKey, name, optionals = {}) {
9536
+ async function list$1(worldKey, name, optionals = {}) {
9454
9537
  return await new Router().get(`/consensus/${worldKey}/${name}`, optionals).then(({
9455
9538
  body
9456
9539
  }) => body);
@@ -9843,11 +9926,11 @@
9843
9926
  var consensus = /*#__PURE__*/Object.freeze({
9844
9927
  __proto__: null,
9845
9928
  collectInGroup: collectInGroup,
9846
- create: create$2,
9929
+ create: create$4,
9847
9930
  deleteAll: deleteAll,
9848
9931
  deleteBarrier: deleteBarrier,
9849
9932
  forceClose: forceClose,
9850
- list: list,
9933
+ list: list$1,
9851
9934
  load: load,
9852
9935
  pause: pause,
9853
9936
  removeRoleExpectationFor: removeRoleExpectationFor,
@@ -9885,7 +9968,7 @@
9885
9968
  * @returns promise that resolves to the newly created somebody object
9886
9969
  */
9887
9970
 
9888
- async function create$1(email, scope, optionals = {}) {
9971
+ async function create$3(email, scope, optionals = {}) {
9889
9972
  const {
9890
9973
  givenName,
9891
9974
  familyName,
@@ -9918,7 +10001,7 @@
9918
10001
  * @returns promise that resolves to the somebody object, or undefined if not found
9919
10002
  */
9920
10003
  const NOT_FOUND$2 = 404;
9921
- async function get$2(somebodyKey, optionals = {}) {
10004
+ async function get$3(somebodyKey, optionals = {}) {
9922
10005
  return await new Router().get(`/somebody/${somebodyKey}`, optionals).catch(error => {
9923
10006
  if (error.status === NOT_FOUND$2) return {
9924
10007
  body: undefined
@@ -10013,8 +10096,8 @@
10013
10096
  var somebody = /*#__PURE__*/Object.freeze({
10014
10097
  __proto__: null,
10015
10098
  byEmail: byEmail,
10016
- create: create$1,
10017
- get: get$2,
10099
+ create: create$3,
10100
+ get: get$3,
10018
10101
  inScope: inScope
10019
10102
  });
10020
10103
 
@@ -10037,7 +10120,7 @@
10037
10120
  * @param [optionals] Optional arguments; pass network call options overrides here.
10038
10121
  * @returns promise that resolves to the matchmaker list object
10039
10122
  */
10040
- async function create(name, partners, scope, optionals = {}) {
10123
+ async function create$2(name, partners, scope, optionals = {}) {
10041
10124
  const {
10042
10125
  accountShortName,
10043
10126
  projectShortName,
@@ -10120,7 +10203,7 @@
10120
10203
  * @param [optionals] Optional arguments; pass network call options overrides here.
10121
10204
  * @returns promise that resolves to the matchmaker list object, or undefined if not found
10122
10205
  */
10123
- async function get$1(udomeKey, optionals = {}) {
10206
+ async function get$2(udomeKey, optionals = {}) {
10124
10207
  const {
10125
10208
  accountShortName,
10126
10209
  projectShortName,
@@ -10178,9 +10261,9 @@
10178
10261
  __proto__: null,
10179
10262
  addUser: addUser,
10180
10263
  byName: byName,
10181
- create: create,
10264
+ create: create$2,
10182
10265
  edit: edit,
10183
- get: get$1
10266
+ get: get$2
10184
10267
  });
10185
10268
 
10186
10269
  const sleep = ms => new Promise(r => setTimeout(r, ms));
@@ -10484,7 +10567,7 @@
10484
10567
  * @param [optionals] Optional arguments; pass network call options overrides here.
10485
10568
  * @returns promise that resolves to the wallet
10486
10569
  */
10487
- async function get(scope, optionals = {}) {
10570
+ async function get$1(scope, optionals = {}) {
10488
10571
  const {
10489
10572
  scopeBoundary,
10490
10573
  scopeKey
@@ -10551,90 +10634,1001 @@
10551
10634
 
10552
10635
  var wallet = /*#__PURE__*/Object.freeze({
10553
10636
  __proto__: null,
10554
- get: get,
10637
+ get: get$1,
10555
10638
  update: update,
10556
10639
  withScope: withScope
10557
10640
  });
10558
10641
 
10559
- // Generic type for push channel message custom data
10642
+ /**
10643
+ * Builds the NPM Docker images used by pipeline NPM operations.
10644
+ * Requires `system` (admin) authorization.
10645
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/pipeline/npm/images`
10646
+ *
10647
+ * @example
10648
+ * import { pipelineAdapter } from 'epicenter-libs';
10649
+ * const built = await pipelineAdapter.buildImages();
10650
+ *
10651
+ * @param [optionals] Optional arguments; pass network call options overrides here.
10652
+ * @returns promise that resolves to `true` when the images were built successfully
10653
+ */
10654
+ async function buildImages(optionals = {}) {
10655
+ return await new Router().get('/pipeline/npm/images', optionals).then(({
10656
+ body
10657
+ }) => body);
10658
+ }
10560
10659
 
10561
- // Base structure for channel push messages
10660
+ /**
10661
+ * Executes a stored pipeline configuration. The operations to run are read server-side from the
10662
+ * named config file; only step inputs (such as credentials) are supplied here via `attributes`.
10663
+ * The execution runs asynchronously — the returned audit record starts in its `RUNNING` state and
10664
+ * is updated by the worker on completion (poll `getExecution` to observe progress).
10665
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/pipeline/{configName}`
10666
+ *
10667
+ * @example
10668
+ * import { pipelineAdapter } from 'epicenter-libs';
10669
+ * // Pass the git credential the config's git step will consume, keyed by operation type
10670
+ * const audit = await pipelineAdapter.execute('deploy', { git: 'my-git-token' });
10671
+ *
10672
+ * @param configName Name of the stored pipeline config to execute
10673
+ * @param [attributes] Step inputs keyed by operation type (e.g. `{ git: '<token>' }`)
10674
+ * @param [optionals] Optional arguments; pass network call options overrides here.
10675
+ * @returns promise that resolves to the newly created audit record in its initial RUNNING state
10676
+ */
10677
+ async function execute(configName, attributes = {}, optionals = {}) {
10678
+ return await new Router().post(`/pipeline/${encodeURIComponent(configName)}`, {
10679
+ body: {
10680
+ attributes
10681
+ },
10682
+ ...optionals
10683
+ }).then(({
10684
+ body
10685
+ }) => body);
10686
+ }
10562
10687
 
10563
- const validateScope = scope => {
10564
- if (!scope) throw new EpicenterError('No scope found where one was required');
10688
+ /**
10689
+ * Retrieves a single pipeline audit record by its execution key.
10690
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/pipeline/{executionKey}`
10691
+ *
10692
+ * @example
10693
+ * import { pipelineAdapter } from 'epicenter-libs';
10694
+ * const audit = await pipelineAdapter.getExecution('<executionKey>');
10695
+ *
10696
+ * @param executionKey Execution key of the audit record to retrieve
10697
+ * @param [optionals] Optional arguments; pass network call options overrides here.
10698
+ * @returns promise that resolves to the audit record
10699
+ */
10700
+ async function getExecution(executionKey, optionals = {}) {
10701
+ return await new Router().get(`/pipeline/${encodeURIComponent(executionKey)}`, optionals).then(({
10702
+ body
10703
+ }) => body);
10704
+ }
10705
+
10706
+ /**
10707
+ * Lists the audit history for a stored pipeline config.
10708
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/pipeline/with/{configName}`
10709
+ *
10710
+ * @example
10711
+ * import { pipelineAdapter } from 'epicenter-libs';
10712
+ * const page = await pipelineAdapter.listAudits('deploy', { first: 0, max: 20 });
10713
+ *
10714
+ * @param configName Name of the stored pipeline config
10715
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
10716
+ * @param [optionals.first] Index of the first record to return (for pagination)
10717
+ * @param [optionals.max] Maximum number of records to return (for pagination)
10718
+ * @returns promise that resolves to a page of audit records
10719
+ */
10720
+ async function listAudits(configName, optionals = {}) {
10565
10721
  const {
10566
- scopeBoundary,
10567
- scopeKey,
10568
- pushCategory
10569
- } = scope;
10570
- if (!scopeBoundary) throw new EpicenterError('Missing scope component: scopeBoundary');
10571
- if (!scopeKey) throw new EpicenterError('Missing scope component: scopeKey');
10572
- if (!pushCategory) throw new EpicenterError('Missing scope component: pushCategory');
10573
- if (!Object.prototype.hasOwnProperty.call(SCOPE_BOUNDARY, scopeBoundary)) throw new EpicenterError(`Invalid scope boundary: ${scopeBoundary}`);
10574
- if (!Object.prototype.hasOwnProperty.call(PUSH_CATEGORY, pushCategory)) throw new EpicenterError(`Invalid push category: ${pushCategory}`);
10575
- };
10722
+ first = 0,
10723
+ max,
10724
+ ...routingOptions
10725
+ } = optionals;
10726
+ return await new Router().withSearchParams({
10727
+ first,
10728
+ max
10729
+ }).get(`/pipeline/with/${encodeURIComponent(configName)}`, {
10730
+ paginated: true,
10731
+ ...routingOptions
10732
+ }).then(({
10733
+ body
10734
+ }) => body);
10735
+ }
10576
10736
 
10577
10737
  /**
10578
- * 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.
10738
+ * Deletes a pipeline audit record by its execution key.
10739
+ * Requires `system` (admin) authorization.
10740
+ * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/pipeline/{executionKey}`
10579
10741
  *
10580
10742
  * @example
10581
- * import { Channel, authAdapter, SCOPE_BOUNDARY, PUSH_CATEGORY } from 'epicenter-libs';
10582
- * const session = authAdapter.getLocalSession();
10583
- * const channel = new Channel({
10584
- * scopeBoundary: SCOPE_BOUNDARY.GROUP,
10585
- * scopeKey: session.groupKey,
10586
- * pushCategory: PUSH_CATEGORY.CHAT,
10587
- * });
10588
- * await channel.subscribe((data) => {
10589
- * console.log('Received message:', data);
10590
- * });
10743
+ * import { pipelineAdapter } from 'epicenter-libs';
10744
+ * await pipelineAdapter.deleteAudit('<executionKey>');
10745
+ *
10746
+ * @param executionKey Execution key of the audit record to delete
10747
+ * @param [optionals] Optional arguments; pass network call options overrides here.
10748
+ * @returns promise that resolves to `true` when the audit record was deleted
10591
10749
  */
10592
- class Channel {
10593
- /**
10594
- * Channel constructor
10595
- *
10596
- * @param scope Object with the scope boundary, scope key, and push category; defines the namespace for the channel
10597
- * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types
10598
- * @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.
10599
- * @param scope.pushCategory Push category, defines the type of channel; See [push category](#PUSH_CATEGORY) for all types
10600
- */
10601
- constructor(scope) {
10602
- _defineProperty(this, "path", void 0);
10603
- _defineProperty(this, "update", void 0);
10604
- _defineProperty(this, "subscription", null);
10605
- const {
10606
- scopeBoundary,
10607
- scopeKey,
10608
- pushCategory
10609
- } = scope;
10610
- validateScope(scope);
10611
- this.path = `/${scopeBoundary.toLowerCase()}/${scopeKey}/${pushCategory.toLowerCase()}`;
10612
- if (cometdAdapter.subscriptions.has(this.path)) {
10613
- this.subscription = cometdAdapter.subscriptions.get(this.path) || null;
10614
- }
10615
- }
10750
+ async function deleteAudit(executionKey, optionals = {}) {
10751
+ return await new Router().delete(`/pipeline/${encodeURIComponent(executionKey)}`, optionals).then(({
10752
+ body
10753
+ }) => body);
10754
+ }
10616
10755
 
10617
- /**
10618
- * Publishes content to the CometD channel
10619
- *
10620
- * @example
10621
- * import { Channel, authAdapter, SCOPE_BOUNDARY, PUSH_CATEGORY } from 'epicenter-libs';
10622
- * const session = authAdapter.getLocalSession();
10623
- * const channel = new Channel({
10624
- * scopeBoundary: SCOPE_BOUNDARY.GROUP,
10625
- * scopeKey: session.groupKey,
10626
- * pushCategory: PUSH_CATEGORY.CHAT,
10627
- * });
10628
- * await channel.publish({ message: 'Hello!' });
10629
- *
10630
- * @param content Content to publish to the channel
10631
- * @returns promise that resolves to the CometD message response
10632
- */
10633
- publish(content) {
10634
- return cometdAdapter.publish(this, content);
10635
- }
10756
+ var pipeline = /*#__PURE__*/Object.freeze({
10757
+ __proto__: null,
10758
+ buildImages: buildImages,
10759
+ deleteAudit: deleteAudit,
10760
+ execute: execute,
10761
+ getExecution: getExecution,
10762
+ listAudits: listAudits
10763
+ });
10636
10764
 
10637
- /**
10765
+ /**
10766
+ * Lists the known API services available for the given encyclopedia version.
10767
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/encyclopedia/v{version}`
10768
+ *
10769
+ * @example
10770
+ * import { encyclopediaAdapter } from 'epicenter-libs';
10771
+ * const services = await encyclopediaAdapter.listServices(3);
10772
+ *
10773
+ * @param version Encyclopedia version number
10774
+ * @param [optionals] Optional arguments; pass network call options overrides here.
10775
+ * @returns promise that resolves to an array of known service descriptors
10776
+ */
10777
+ async function listServices(version, optionals = {}) {
10778
+ return await new Router().get(`/encyclopedia/v${version}`, optionals).then(({
10779
+ body
10780
+ }) => body);
10781
+ }
10782
+
10783
+ /**
10784
+ * Retrieves the documented resource (API documentation) for a specific service and encyclopedia version.
10785
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/encyclopedia/v{version}/{api}`
10786
+ *
10787
+ * @example
10788
+ * import { encyclopediaAdapter } from 'epicenter-libs';
10789
+ * const resource = await encyclopediaAdapter.getResource(3, 'run');
10790
+ *
10791
+ * @param version Encyclopedia version number
10792
+ * @param api Name of the API service to retrieve documentation for
10793
+ * @param [optionals] Optional arguments; pass network call options overrides here.
10794
+ * @returns promise that resolves to the documented resource containing endpoints and definitions
10795
+ */
10796
+ async function getResource(version, api, optionals = {}) {
10797
+ return await new Router().get(`/encyclopedia/v${version}/${api}`, optionals).then(({
10798
+ body
10799
+ }) => body);
10800
+ }
10801
+
10802
+ /**
10803
+ * Retrieves a translated representation of the API documentation for a specific service and encyclopedia version.
10804
+ * Supported translators are ASCIIDOC, ASCIIDOC_TO_HTML, and OPENAPI.
10805
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/encyclopedia/as/{translator}/v{version}/{api}`
10806
+ *
10807
+ * NOTE: The backend returns the translated content with a translator-specific content-type
10808
+ * (e.g. `text/asciidoc`, `text/html`, `application/json`). The shared Router throws when the
10809
+ * response content-type is not `application/json`, so only the OPENAPI translator works here.
10810
+ * For ASCIIDOC and ASCIIDOC_TO_HTML, use the underlying fetch API directly against the
10811
+ * constructed URL.
10812
+ *
10813
+ * @example
10814
+ * import { encyclopediaAdapter } from 'epicenter-libs';
10815
+ * const openApiDoc = await encyclopediaAdapter.translate('OPENAPI', 3, 'run');
10816
+ *
10817
+ * @param translator Output format for the documentation; one of 'ASCIIDOC', 'ASCIIDOC_TO_HTML', or 'OPENAPI'
10818
+ * @param version Encyclopedia version number
10819
+ * @param api Name of the API service to translate documentation for
10820
+ * @param [optionals] Optional arguments; pass network call options overrides here.
10821
+ * @returns promise that resolves to the translated documentation (only when translator is 'OPENAPI')
10822
+ */
10823
+ async function translate(translator, version, api, optionals = {}) {
10824
+ return await new Router().get(`/encyclopedia/as/${translator}/v${version}/${api}`, optionals).then(({
10825
+ body
10826
+ }) => body);
10827
+ }
10828
+
10829
+ var encyclopedia = /*#__PURE__*/Object.freeze({
10830
+ __proto__: null,
10831
+ getResource: getResource,
10832
+ listServices: listServices,
10833
+ translate: translate
10834
+ });
10835
+
10836
+ /* File paths are free-form, user-authored strings that may contain spaces or URL-reserved
10837
+ * characters. Encode each segment while preserving the '/' separators that the backend's
10838
+ * `{filePath:.*}` routes expect. */
10839
+ const encodePath = filePath => filePath.split('/').map(encodeURIComponent).join('/');
10840
+
10841
+ /**
10842
+ * Lists files and directories at the project root or at a specific path.
10843
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file[/{filePath}]`
10844
+ *
10845
+ * @example
10846
+ * import { fileAdapter } from 'epicenter-libs';
10847
+ * // List all files at root
10848
+ * const entries = await fileAdapter.list();
10849
+ * // List contents of a specific directory up to 2 levels deep
10850
+ * const entries = await fileAdapter.list('src', { depth: 2 });
10851
+ *
10852
+ * @param [filePath] Path to a file or directory; omit to list the project root
10853
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
10854
+ * @param [optionals.depth] Maximum depth of directory traversal to include in the response
10855
+ * @returns promise that resolves to an array of file and directory entries
10856
+ */
10857
+ async function list(filePath, optionals = {}) {
10858
+ const {
10859
+ depth,
10860
+ ...routingOptions
10861
+ } = optionals;
10862
+ const uriComponent = filePath ? `/${encodePath(filePath)}` : '';
10863
+ return await new Router().withSearchParams({
10864
+ depth
10865
+ }).get(`/file${uriComponent}`, routingOptions).then(({
10866
+ body
10867
+ }) => body);
10868
+ }
10869
+
10870
+ /**
10871
+ * Uploads and replaces files at the project root or at a specific path using multipart/form-data (PUT).
10872
+ * Use this when you want to overwrite existing files. For creating new files, use `create`.
10873
+ * Base URL: PUT `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file[/{filePath}]`
10874
+ *
10875
+ * NOTE: This is browser-only. The `FormData` body is only serialized as multipart/form-data when
10876
+ * running in a browser environment; in Node it will not be sent correctly.
10877
+ *
10878
+ * @example
10879
+ * import { fileAdapter } from 'epicenter-libs';
10880
+ * const formData = new FormData();
10881
+ * formData.append('file', myFile);
10882
+ * const uploaded = await fileAdapter.upload(formData, 'models/model.py');
10883
+ *
10884
+ * @param formData Multipart form data containing the file(s) to upload
10885
+ * @param [filePath] Destination path for the file(s); omit to upload to the project root
10886
+ * @param [optionals] Optional arguments; pass network call options overrides here.
10887
+ * @returns promise that resolves to an array of the uploaded file entries
10888
+ */
10889
+ async function upload(formData, filePath, optionals = {}) {
10890
+ const uriComponent = filePath ? `/${encodePath(filePath)}` : '';
10891
+ return await new Router().put(`/file${uriComponent}`, {
10892
+ body: formData,
10893
+ ...optionals
10894
+ }).then(({
10895
+ body
10896
+ }) => body);
10897
+ }
10898
+
10899
+ /**
10900
+ * Creates new files at the project root or at a specific path using multipart/form-data (POST).
10901
+ * Use this when creating new files. For overwriting existing files, use `upload`.
10902
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file[/{filePath}]`
10903
+ *
10904
+ * NOTE: This is browser-only. The `FormData` body is only serialized as multipart/form-data when
10905
+ * running in a browser environment; in Node it will not be sent correctly.
10906
+ *
10907
+ * @example
10908
+ * import { fileAdapter } from 'epicenter-libs';
10909
+ * const formData = new FormData();
10910
+ * formData.append('file', myFile);
10911
+ * const created = await fileAdapter.create(formData, 'models/model.py');
10912
+ *
10913
+ * @param formData Multipart form data containing the file(s) to create
10914
+ * @param [filePath] Destination path for the file(s); omit to create at the project root
10915
+ * @param [optionals] Optional arguments; pass network call options overrides here.
10916
+ * @returns promise that resolves to an array of the created file entries
10917
+ */
10918
+ async function create$1(formData, filePath, optionals = {}) {
10919
+ const uriComponent = filePath ? `/${encodePath(filePath)}` : '';
10920
+ return await new Router().post(`/file${uriComponent}`, {
10921
+ body: formData,
10922
+ ...optionals
10923
+ }).then(({
10924
+ body
10925
+ }) => body);
10926
+ }
10927
+
10928
+ /**
10929
+ * Deletes a file or directory at the project root or at a specific path.
10930
+ * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file[/{filePath}]`
10931
+ *
10932
+ * @example
10933
+ * import { fileAdapter } from 'epicenter-libs';
10934
+ * // Delete a specific file
10935
+ * await fileAdapter.remove('models/old-model.py');
10936
+ * // Delete all files at the project root
10937
+ * await fileAdapter.remove();
10938
+ *
10939
+ * @param [filePath] Path of the file or directory to delete; omit to delete all files at the project root
10940
+ * @param [optionals] Optional arguments; pass network call options overrides here.
10941
+ * @returns promise that resolves when the deletion is complete
10942
+ */
10943
+ async function remove(filePath, optionals = {}) {
10944
+ const uriComponent = filePath ? `/${encodePath(filePath)}` : '';
10945
+ return await new Router().delete(`/file${uriComponent}`, optionals).then(({
10946
+ body
10947
+ }) => body);
10948
+ }
10949
+
10950
+ /**
10951
+ * Downloads the raw content of a file at the specified path.
10952
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file/download/{filePath}`
10953
+ *
10954
+ * NOTE: The backend streams the file with its detected content type (e.g. `application/zip`,
10955
+ * `text/plain`, `application/octet-stream`). The shared Router throws when the response
10956
+ * content-type is not `application/json`, so this call only succeeds for JSON files. To download
10957
+ * other file types, use the underlying fetch API directly against the constructed URL.
10958
+ *
10959
+ * @example
10960
+ * import { fileAdapter } from 'epicenter-libs';
10961
+ * const content = await fileAdapter.download('config.json');
10962
+ *
10963
+ * @param filePath Path to the file to download
10964
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
10965
+ * @param [optionals.depth] Currently unused on the backend; reserved for future expansion.
10966
+ * @returns promise that resolves to the raw file content
10967
+ */
10968
+ async function download(filePath, optionals = {}) {
10969
+ const {
10970
+ depth,
10971
+ ...routingOptions
10972
+ } = optionals;
10973
+ return await new Router().withSearchParams({
10974
+ depth
10975
+ }).get(`/file/download/${encodePath(filePath)}`, routingOptions).then(({
10976
+ body
10977
+ }) => body);
10978
+ }
10979
+
10980
+ /**
10981
+ * Lists files and directories matching a glob filter pattern, optionally scoped to a specific path.
10982
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file/filter/{filter}[/{filePath}]`
10983
+ *
10984
+ * @example
10985
+ * import { fileAdapter } from 'epicenter-libs';
10986
+ * // List all Python files in the project
10987
+ * const pyFiles = await fileAdapter.listByFilter('*.py');
10988
+ * // List all Python files within the 'models' directory
10989
+ * const pyFiles = await fileAdapter.listByFilter('*.py', 'models');
10990
+ *
10991
+ * @param filter Glob pattern to filter files by (e.g., '*.py', '*.json')
10992
+ * @param [filePath] Directory path to scope the filter to; omit to search the entire project
10993
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
10994
+ * @param [optionals.depth] Maximum depth of directory traversal to include in the response
10995
+ * @returns promise that resolves to an array of matching file and directory entries
10996
+ */
10997
+ async function listByFilter(filter, filePath, optionals = {}) {
10998
+ const {
10999
+ depth,
11000
+ ...routingOptions
11001
+ } = optionals;
11002
+ const uriComponent = filePath ? `/${encodePath(filePath)}` : '';
11003
+ return await new Router().withSearchParams({
11004
+ depth
11005
+ }).get(`/file/filter/${encodeURIComponent(filter)}${uriComponent}`, routingOptions).then(({
11006
+ body
11007
+ }) => body);
11008
+ }
11009
+
11010
+ /**
11011
+ * Compresses files into a ZIP archive at the project root or at a specific path.
11012
+ * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file/compress[/{filePath}]`
11013
+ *
11014
+ * NOTE: The backend streams the resulting archive with content-type `application/zip`. The
11015
+ * shared Router throws when the response content-type is not `application/json`, so this call
11016
+ * will not return the archive bytes through the normal flow. To retrieve the archive, use the
11017
+ * underlying fetch API directly against the constructed URL.
11018
+ *
11019
+ * @example
11020
+ * import { fileAdapter } from 'epicenter-libs';
11021
+ * // Compress a specific file or directory
11022
+ * await fileAdapter.compress('models');
11023
+ * // Compress at root
11024
+ * await fileAdapter.compress();
11025
+ *
11026
+ * @param [filePath] Path of the file or directory to compress; omit to compress at the project root
11027
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11028
+ * @returns promise that resolves to the compression result
11029
+ */
11030
+ async function compress(filePath, optionals = {}) {
11031
+ const uriComponent = filePath ? `/${encodePath(filePath)}` : '';
11032
+ return await new Router().patch(`/file/compress${uriComponent}`, optionals).then(({
11033
+ body
11034
+ }) => body);
11035
+ }
11036
+
11037
+ /**
11038
+ * Extracts (explodes) a ZIP archive at the project root or at a specific path in place,
11039
+ * deleting the archive after extraction.
11040
+ * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file/explode[/{filePath}]`
11041
+ *
11042
+ * @example
11043
+ * import { fileAdapter } from 'epicenter-libs';
11044
+ * // Extract a specific archive
11045
+ * await fileAdapter.explode('archive.zip');
11046
+ * // Explode at root
11047
+ * await fileAdapter.explode();
11048
+ *
11049
+ * @param [filePath] Path of the archive to extract; omit to extract at the project root
11050
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11051
+ * @returns promise that resolves when the extraction is complete
11052
+ */
11053
+ async function explode(filePath, optionals = {}) {
11054
+ const uriComponent = filePath ? `/${encodePath(filePath)}` : '';
11055
+ return await new Router().patch(`/file/explode${uriComponent}`, optionals).then(({
11056
+ body
11057
+ }) => body);
11058
+ }
11059
+
11060
+ /**
11061
+ * Moves a file or directory from one path to another within the project.
11062
+ * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file/move`
11063
+ *
11064
+ * @example
11065
+ * import { fileAdapter } from 'epicenter-libs';
11066
+ * await fileAdapter.move('models/old-name.py', 'models/new-name.py');
11067
+ * // Move and include the origin directory itself
11068
+ * await fileAdapter.move('old-dir', 'new-dir', { includeOrigin: true });
11069
+ *
11070
+ * @param origin Origin path of the file or directory to move
11071
+ * @param destination Destination path to move the file or directory to
11072
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
11073
+ * @param [optionals.includeOrigin] Whether to include the origin directory itself in the move
11074
+ * @returns promise that resolves when the move is complete
11075
+ */
11076
+ async function move(origin, destination, optionals = {}) {
11077
+ const {
11078
+ includeOrigin,
11079
+ ...routingOptions
11080
+ } = optionals;
11081
+ return await new Router().patch('/file/move', {
11082
+ body: {
11083
+ origin,
11084
+ destination,
11085
+ includeOrigin
11086
+ },
11087
+ ...routingOptions
11088
+ }).then(({
11089
+ body
11090
+ }) => body);
11091
+ }
11092
+
11093
+ /**
11094
+ * Creates a new directory at the specified path.
11095
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file/directory/{filePath}`
11096
+ *
11097
+ * @example
11098
+ * import { fileAdapter } from 'epicenter-libs';
11099
+ * const dir = await fileAdapter.createDirectory('models/new-folder');
11100
+ *
11101
+ * @param filePath Path at which to create the new directory
11102
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11103
+ * @returns promise that resolves to the created directory entry
11104
+ */
11105
+ async function createDirectory(filePath, optionals = {}) {
11106
+ return await new Router().post(`/file/directory/${encodePath(filePath)}`, optionals).then(({
11107
+ body
11108
+ }) => body);
11109
+ }
11110
+
11111
+ var file = /*#__PURE__*/Object.freeze({
11112
+ __proto__: null,
11113
+ compress: compress,
11114
+ create: create$1,
11115
+ createDirectory: createDirectory,
11116
+ download: download,
11117
+ explode: explode,
11118
+ list: list,
11119
+ listByFilter: listByFilter,
11120
+ move: move,
11121
+ remove: remove,
11122
+ upload: upload
11123
+ });
11124
+
11125
+ /**
11126
+ * Currently the API only supports `SAML`. This type is intentionally narrow so that adding new
11127
+ * protocols on the backend requires an explicit type update here.
11128
+ */
11129
+
11130
+ /**
11131
+ * Gets registration info for a self-registration token.
11132
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/self/{token}`
11133
+ *
11134
+ * @example
11135
+ * import { registrationAdapter } from 'epicenter-libs';
11136
+ * const info = await registrationAdapter.getSelfRegistrationInfo('my-token');
11137
+ *
11138
+ * @param token Self-registration token
11139
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11140
+ * @returns promise that resolves to registration info
11141
+ */
11142
+ async function getSelfRegistrationInfo(token, optionals = {}) {
11143
+ return await new Router().get(`/registration/self/${token}`, optionals).then(({
11144
+ body
11145
+ }) => body);
11146
+ }
11147
+
11148
+ /**
11149
+ * Completes a self-registration using a token.
11150
+ * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/self/{token}`
11151
+ *
11152
+ * @example
11153
+ * import { registrationAdapter } from 'epicenter-libs';
11154
+ * const result = await registrationAdapter.completeSelfRegistration('my-token', 'secret123', {
11155
+ * displayName: 'John Doe',
11156
+ * handle: 'johnd',
11157
+ * });
11158
+ *
11159
+ * @param token Self-registration token
11160
+ * @param password Password for the new account
11161
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11162
+ * @param [optionals.displayName] Display name for the new user
11163
+ * @param [optionals.givenName] Given name for the new user
11164
+ * @param [optionals.familyName] Family name for the new user
11165
+ * @param [optionals.handle] Handle for the new user
11166
+ * @returns promise that resolves to the registration result including session info
11167
+ */
11168
+ async function completeSelfRegistration(token, password, optionals = {}) {
11169
+ const {
11170
+ displayName,
11171
+ givenName,
11172
+ familyName,
11173
+ handle,
11174
+ ...routingOptions
11175
+ } = optionals;
11176
+ return await new Router().patch(`/registration/self/${token}`, {
11177
+ body: {
11178
+ password,
11179
+ displayName,
11180
+ givenName,
11181
+ familyName,
11182
+ handle
11183
+ },
11184
+ ...routingOptions
11185
+ }).then(({
11186
+ body
11187
+ }) => body);
11188
+ }
11189
+
11190
+ /**
11191
+ * Sends a self-registration invite email to a user. Pass an `Accept-Language` header via
11192
+ * `optionals.headers` to localize the email.
11193
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/self/{groupKey}`
11194
+ *
11195
+ * @example
11196
+ * import { registrationAdapter } from 'epicenter-libs';
11197
+ * await registrationAdapter.sendSelfRegistrationInvite('group-key', 'user@example.com', {
11198
+ * linkDestination: 'DASHBOARD',
11199
+ * redirectUrl: 'https://app.example.com',
11200
+ * headers: { 'Accept-Language': 'fr-FR' },
11201
+ * });
11202
+ *
11203
+ * @param groupKey Group key to register the user into
11204
+ * @param email Email address of the user to invite
11205
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11206
+ * @param [optionals.linkDestination] Destination for the registration link ('DASHBOARD' or 'MANAGER')
11207
+ * @param [optionals.modality] Registration modality
11208
+ * @param [optionals.redirectUrl] URL to redirect to after registration
11209
+ * @param [optionals.subject] Subject line for the invite email
11210
+ * @param [optionals.givenName] Pre-populate given name in the registration form
11211
+ * @param [optionals.familyName] Pre-populate family name in the registration form
11212
+ * @param [optionals.linkUrl] Custom URL to use for the registration link
11213
+ * @param [optionals.confirmation] Whether to send a confirmation email
11214
+ * @returns promise that resolves to undefined if successful
11215
+ */
11216
+ async function sendSelfRegistrationInvite(groupKey, email, optionals = {}) {
11217
+ const {
11218
+ linkDestination,
11219
+ modality,
11220
+ redirectUrl,
11221
+ subject,
11222
+ givenName,
11223
+ familyName,
11224
+ linkUrl,
11225
+ confirmation,
11226
+ ...routingOptions
11227
+ } = optionals;
11228
+ return await new Router().post(`/registration/self/${groupKey}`, {
11229
+ body: {
11230
+ email,
11231
+ linkDestination,
11232
+ modality,
11233
+ redirectUrl,
11234
+ subject,
11235
+ givenName,
11236
+ familyName,
11237
+ linkUrl,
11238
+ confirmation
11239
+ },
11240
+ ...routingOptions
11241
+ }).then(({
11242
+ body
11243
+ }) => body);
11244
+ }
11245
+
11246
+ /**
11247
+ * Gets registration info for an invite token.
11248
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/invite/{token}`
11249
+ *
11250
+ * @example
11251
+ * import { registrationAdapter } from 'epicenter-libs';
11252
+ * const info = await registrationAdapter.getInviteRegistrationInfo('invite-token');
11253
+ *
11254
+ * @param token Invite registration token
11255
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11256
+ * @returns promise that resolves to registration info
11257
+ */
11258
+ async function getInviteRegistrationInfo(token, optionals = {}) {
11259
+ return await new Router().get(`/registration/invite/${token}`, optionals).then(({
11260
+ body
11261
+ }) => body);
11262
+ }
11263
+
11264
+ /**
11265
+ * Completes an invite registration using a token.
11266
+ * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/invite/{token}`
11267
+ *
11268
+ * @example
11269
+ * import { registrationAdapter } from 'epicenter-libs';
11270
+ * const result = await registrationAdapter.completeInviteRegistration('invite-token', 'pass456', {
11271
+ * displayName: 'Jane Doe',
11272
+ * });
11273
+ *
11274
+ * @param token Invite registration token
11275
+ * @param password Password for the new account
11276
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11277
+ * @param [optionals.displayName] Display name for the new user
11278
+ * @param [optionals.givenName] Given name for the new user
11279
+ * @param [optionals.familyName] Family name for the new user
11280
+ * @param [optionals.handle] Handle for the new user
11281
+ * @returns promise that resolves to the registration result including session info
11282
+ */
11283
+ async function completeInviteRegistration(token, password, optionals = {}) {
11284
+ const {
11285
+ displayName,
11286
+ givenName,
11287
+ familyName,
11288
+ handle,
11289
+ ...routingOptions
11290
+ } = optionals;
11291
+ return await new Router().patch(`/registration/invite/${token}`, {
11292
+ body: {
11293
+ password,
11294
+ displayName,
11295
+ givenName,
11296
+ familyName,
11297
+ handle
11298
+ },
11299
+ ...routingOptions
11300
+ }).then(({
11301
+ body
11302
+ }) => body);
11303
+ }
11304
+
11305
+ /**
11306
+ * Sends an invite registration email to a user. Pass an `Accept-Language` header via
11307
+ * `optionals.headers` to localize the email.
11308
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/invite/{groupKey}`
11309
+ *
11310
+ * @example
11311
+ * import { registrationAdapter } from 'epicenter-libs';
11312
+ * await registrationAdapter.sendInvite('group-key', 'invited@example.com', {
11313
+ * givenName: 'New',
11314
+ * familyName: 'User',
11315
+ * redirectUrl: 'https://app.example.com',
11316
+ * });
11317
+ *
11318
+ * @param groupKey Group key to invite the user into
11319
+ * @param email Email address of the user to invite
11320
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11321
+ * @param [optionals.linkDestination] Destination for the registration link ('DASHBOARD' or 'MANAGER')
11322
+ * @param [optionals.modality] Registration modality
11323
+ * @param [optionals.redirectUrl] URL to redirect to after registration
11324
+ * @param [optionals.subject] Subject line for the invite email
11325
+ * @param [optionals.givenName] Pre-populate given name in the registration form
11326
+ * @param [optionals.familyName] Pre-populate family name in the registration form
11327
+ * @param [optionals.linkUrl] Custom URL to use for the registration link
11328
+ * @param [optionals.confirmation] Whether to send a confirmation email
11329
+ * @returns promise that resolves to undefined if successful
11330
+ */
11331
+ async function sendInvite(groupKey, email, optionals = {}) {
11332
+ const {
11333
+ linkDestination,
11334
+ modality,
11335
+ redirectUrl,
11336
+ subject,
11337
+ givenName,
11338
+ familyName,
11339
+ linkUrl,
11340
+ confirmation,
11341
+ ...routingOptions
11342
+ } = optionals;
11343
+ return await new Router().post(`/registration/invite/${groupKey}`, {
11344
+ body: {
11345
+ email,
11346
+ linkDestination,
11347
+ modality,
11348
+ redirectUrl,
11349
+ subject,
11350
+ givenName,
11351
+ familyName,
11352
+ linkUrl,
11353
+ confirmation
11354
+ },
11355
+ ...routingOptions
11356
+ }).then(({
11357
+ body
11358
+ }) => body);
11359
+ }
11360
+
11361
+ /**
11362
+ * Gets registration info for a team invite token.
11363
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/team/{token}`
11364
+ *
11365
+ * @example
11366
+ * import { registrationAdapter } from 'epicenter-libs';
11367
+ * const info = await registrationAdapter.getTeamRegistrationInfo('team-token');
11368
+ *
11369
+ * @param token Team invite token
11370
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11371
+ * @returns promise that resolves to team registration info
11372
+ */
11373
+ async function getTeamRegistrationInfo(token, optionals = {}) {
11374
+ return await new Router().get(`/registration/team/${token}`, optionals).then(({
11375
+ body
11376
+ }) => body);
11377
+ }
11378
+
11379
+ /**
11380
+ * Sends a team invite email. Pass an `Accept-Language` header via `optionals.headers` to
11381
+ * localize the email.
11382
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/team`
11383
+ *
11384
+ * @example
11385
+ * import { registrationAdapter } from 'epicenter-libs';
11386
+ * await registrationAdapter.sendTeamInvite(
11387
+ * 'Jane Author',
11388
+ * 'AUTHOR',
11389
+ * 'https://app.example.com',
11390
+ * 'newteammate@example.com',
11391
+ * { subject: 'Welcome to the team!' },
11392
+ * );
11393
+ *
11394
+ * @param invitingAuthor Name or identifier of the person sending the invite
11395
+ * @param role Role to assign to the invited user
11396
+ * @param redirectUrl URL to redirect to after accepting the invite
11397
+ * @param email Email address of the user to invite
11398
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11399
+ * @param [optionals.subject] Subject line for the invite email
11400
+ * @param [optionals.givenName] Pre-populate given name for the invited user
11401
+ * @param [optionals.familyName] Pre-populate family name for the invited user
11402
+ * @returns promise that resolves to undefined if successful
11403
+ */
11404
+ async function sendTeamInvite(invitingAuthor, role, redirectUrl, email, optionals = {}) {
11405
+ const {
11406
+ subject,
11407
+ givenName,
11408
+ familyName,
11409
+ ...routingOptions
11410
+ } = optionals;
11411
+ return await new Router().post('/registration/team', {
11412
+ body: {
11413
+ invitingAuthor,
11414
+ role,
11415
+ redirectUrl,
11416
+ email,
11417
+ subject,
11418
+ givenName,
11419
+ familyName
11420
+ },
11421
+ ...routingOptions
11422
+ }).then(({
11423
+ body
11424
+ }) => body);
11425
+ }
11426
+
11427
+ /**
11428
+ * @deprecated Use getSsoAdminRegistration or getSsoUserRegistration instead.
11429
+ * Gets SSO registration info for a given SSO protocol.
11430
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/sso/{ssoProtocol}`
11431
+ *
11432
+ * @example
11433
+ * import { registrationAdapter } from 'epicenter-libs';
11434
+ * const info = await registrationAdapter.getSsoRegistration('SAML');
11435
+ *
11436
+ * @param ssoProtocol The SSO protocol (e.g. 'SAML')
11437
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11438
+ * @returns promise that resolves to SSO registration data
11439
+ */
11440
+ async function getSsoRegistration(ssoProtocol, optionals = {}) {
11441
+ console.warn('DEPRECATION WARNING: registrationAdapter.getSsoRegistration is deprecated and will be removed with the next release. Use registrationAdapter.getSsoAdminRegistration or registrationAdapter.getSsoUserRegistration instead.');
11442
+ return await new Router().get(`/registration/sso/${ssoProtocol}`, optionals).then(({
11443
+ body
11444
+ }) => body);
11445
+ }
11446
+
11447
+ /**
11448
+ * Gets admin SSO registration info for a given SSO protocol.
11449
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/sso/admin/{ssoProtocol}`
11450
+ *
11451
+ * @example
11452
+ * import { registrationAdapter } from 'epicenter-libs';
11453
+ * const info = await registrationAdapter.getSsoAdminRegistration('SAML');
11454
+ *
11455
+ * @param ssoProtocol The SSO protocol (e.g. 'SAML')
11456
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11457
+ * @returns promise that resolves to SSO admin registration data
11458
+ */
11459
+ async function getSsoAdminRegistration(ssoProtocol, optionals = {}) {
11460
+ return await new Router().get(`/registration/sso/admin/${ssoProtocol}`, optionals).then(({
11461
+ body
11462
+ }) => body);
11463
+ }
11464
+
11465
+ /**
11466
+ * Gets user SSO registration info for a given SSO protocol.
11467
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/sso/user/{ssoProtocol}`
11468
+ *
11469
+ * @example
11470
+ * import { registrationAdapter } from 'epicenter-libs';
11471
+ * const info = await registrationAdapter.getSsoUserRegistration('SAML');
11472
+ *
11473
+ * @param ssoProtocol The SSO protocol (e.g. 'SAML')
11474
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11475
+ * @returns promise that resolves to SSO user registration data
11476
+ */
11477
+ async function getSsoUserRegistration(ssoProtocol, optionals = {}) {
11478
+ return await new Router().get(`/registration/sso/user/${ssoProtocol}`, optionals).then(({
11479
+ body
11480
+ }) => body);
11481
+ }
11482
+
11483
+ var registration = /*#__PURE__*/Object.freeze({
11484
+ __proto__: null,
11485
+ completeInviteRegistration: completeInviteRegistration,
11486
+ completeSelfRegistration: completeSelfRegistration,
11487
+ getInviteRegistrationInfo: getInviteRegistrationInfo,
11488
+ getSelfRegistrationInfo: getSelfRegistrationInfo,
11489
+ getSsoAdminRegistration: getSsoAdminRegistration,
11490
+ getSsoRegistration: getSsoRegistration,
11491
+ getSsoUserRegistration: getSsoUserRegistration,
11492
+ getTeamRegistrationInfo: getTeamRegistrationInfo,
11493
+ sendInvite: sendInvite,
11494
+ sendSelfRegistrationInvite: sendSelfRegistrationInvite,
11495
+ sendTeamInvite: sendTeamInvite
11496
+ });
11497
+
11498
+ /**
11499
+ * Creates a new docket entry, scheduling a deferred operation for later execution.
11500
+ * Requires `support` level authorization.
11501
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/docket`
11502
+ *
11503
+ * @example
11504
+ * import { docketAdapter } from 'epicenter-libs';
11505
+ * const docket = await docketAdapter.create(
11506
+ * {
11507
+ * objectType: 'scale',
11508
+ * operatingSystem: 'LINUX',
11509
+ * workerShape: 'GS',
11510
+ * scale: {
11511
+ * active: true,
11512
+ * initialWorkerCount: 1,
11513
+ * additionalWorkerLimit: 4,
11514
+ * flavors: ['DOCKER'],
11515
+ * },
11516
+ * },
11517
+ * { objectType: 'date', value: '2026-06-01T00:00:00Z' },
11518
+ * '2026-05-20T00:00:00Z',
11519
+ * { ttlMinutes: 60 },
11520
+ * );
11521
+ *
11522
+ * @param payload Docket payload describing the operation to schedule
11523
+ * @param trigger Trigger describing when the operation should fire
11524
+ * (cron, date, or offset)
11525
+ * @param date ISO-8601 date string indicating when the docket is scheduled
11526
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
11527
+ * @param [optionals.ttlMinutes] Time-to-live in minutes for the docket entry (minimum 2)
11528
+ * @returns promise that resolves to the newly created docket
11529
+ */
11530
+ async function create(payload, trigger, date, optionals = {}) {
11531
+ const {
11532
+ ttlMinutes,
11533
+ ...routingOptions
11534
+ } = optionals;
11535
+ return await new Router().post('/docket', {
11536
+ body: {
11537
+ payload,
11538
+ trigger,
11539
+ date,
11540
+ ttlMinutes
11541
+ },
11542
+ ...routingOptions
11543
+ }).then(({
11544
+ body
11545
+ }) => body);
11546
+ }
11547
+
11548
+ var docket = /*#__PURE__*/Object.freeze({
11549
+ __proto__: null,
11550
+ create: create
11551
+ });
11552
+
11553
+ // Generic type for push channel message custom data
11554
+
11555
+ // Base structure for channel push messages
11556
+
11557
+ const validateScope = scope => {
11558
+ if (!scope) throw new EpicenterError('No scope found where one was required');
11559
+ const {
11560
+ scopeBoundary,
11561
+ scopeKey,
11562
+ pushCategory
11563
+ } = scope;
11564
+ if (!scopeBoundary) throw new EpicenterError('Missing scope component: scopeBoundary');
11565
+ if (!scopeKey) throw new EpicenterError('Missing scope component: scopeKey');
11566
+ if (!pushCategory) throw new EpicenterError('Missing scope component: pushCategory');
11567
+ if (!Object.prototype.hasOwnProperty.call(SCOPE_BOUNDARY, scopeBoundary)) throw new EpicenterError(`Invalid scope boundary: ${scopeBoundary}`);
11568
+ if (!Object.prototype.hasOwnProperty.call(PUSH_CATEGORY, pushCategory)) throw new EpicenterError(`Invalid push category: ${pushCategory}`);
11569
+ };
11570
+
11571
+ /**
11572
+ * 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.
11573
+ *
11574
+ * @example
11575
+ * import { Channel, authAdapter, SCOPE_BOUNDARY, PUSH_CATEGORY } from 'epicenter-libs';
11576
+ * const session = authAdapter.getLocalSession();
11577
+ * const channel = new Channel({
11578
+ * scopeBoundary: SCOPE_BOUNDARY.GROUP,
11579
+ * scopeKey: session.groupKey,
11580
+ * pushCategory: PUSH_CATEGORY.CHAT,
11581
+ * });
11582
+ * await channel.subscribe((data) => {
11583
+ * console.log('Received message:', data);
11584
+ * });
11585
+ */
11586
+ class Channel {
11587
+ /**
11588
+ * Channel constructor
11589
+ *
11590
+ * @param scope Object with the scope boundary, scope key, and push category; defines the namespace for the channel
11591
+ * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types
11592
+ * @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.
11593
+ * @param scope.pushCategory Push category, defines the type of channel; See [push category](#PUSH_CATEGORY) for all types
11594
+ */
11595
+ constructor(scope) {
11596
+ _defineProperty(this, "path", void 0);
11597
+ _defineProperty(this, "update", void 0);
11598
+ _defineProperty(this, "subscription", null);
11599
+ const {
11600
+ scopeBoundary,
11601
+ scopeKey,
11602
+ pushCategory
11603
+ } = scope;
11604
+ validateScope(scope);
11605
+ this.path = `/${scopeBoundary.toLowerCase()}/${scopeKey}/${pushCategory.toLowerCase()}`;
11606
+ if (cometdAdapter.subscriptions.has(this.path)) {
11607
+ this.subscription = cometdAdapter.subscriptions.get(this.path) || null;
11608
+ }
11609
+ }
11610
+
11611
+ /**
11612
+ * Publishes content to the CometD channel
11613
+ *
11614
+ * @example
11615
+ * import { Channel, authAdapter, SCOPE_BOUNDARY, PUSH_CATEGORY } from 'epicenter-libs';
11616
+ * const session = authAdapter.getLocalSession();
11617
+ * const channel = new Channel({
11618
+ * scopeBoundary: SCOPE_BOUNDARY.GROUP,
11619
+ * scopeKey: session.groupKey,
11620
+ * pushCategory: PUSH_CATEGORY.CHAT,
11621
+ * });
11622
+ * await channel.publish({ message: 'Hello!' });
11623
+ *
11624
+ * @param content Content to publish to the channel
11625
+ * @returns promise that resolves to the CometD message response
11626
+ */
11627
+ publish(content) {
11628
+ return cometdAdapter.publish(this, content);
11629
+ }
11630
+
11631
+ /**
10638
11632
  * 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.
10639
11633
  *
10640
11634
  * @example
@@ -10746,6 +11740,367 @@
10746
11740
  }
10747
11741
  }
10748
11742
 
11743
+ // ──────────────────────────────────────────────
11744
+ // Types
11745
+ // ──────────────────────────────────────────────
11746
+
11747
+ // ──────────────────────────────────────────────
11748
+ // Functions
11749
+ // ──────────────────────────────────────────────
11750
+
11751
+ /**
11752
+ * Retrieves the git integration configuration for the project.
11753
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git`
11754
+ *
11755
+ * @example
11756
+ * import { gitAdapter } from 'epicenter-libs';
11757
+ * const integration = await gitAdapter.get();
11758
+ *
11759
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11760
+ * @returns promise that resolves to the git integration configuration
11761
+ */
11762
+ async function get(optionals = {}) {
11763
+ return new Router().get('/git', optionals).then(({
11764
+ body
11765
+ }) => body);
11766
+ }
11767
+
11768
+ /**
11769
+ * Retrieves the current git status for the project.
11770
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/status`
11771
+ *
11772
+ * @example
11773
+ * import { gitAdapter } from 'epicenter-libs';
11774
+ * const status = await gitAdapter.getStatus();
11775
+ * console.log(status.currentBranch);
11776
+ *
11777
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11778
+ * @returns promise that resolves to the git status, including the current branch
11779
+ */
11780
+ async function getStatus(optionals = {}) {
11781
+ return new Router().get('/git/status', optionals).then(({
11782
+ body
11783
+ }) => body);
11784
+ }
11785
+
11786
+ /**
11787
+ * Checks out a branch in the project's git repository.
11788
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/checkout/{branch}`
11789
+ *
11790
+ * @example
11791
+ * import { gitAdapter } from 'epicenter-libs';
11792
+ * await gitAdapter.checkout('main');
11793
+ *
11794
+ * @param branch Name of the branch to check out
11795
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11796
+ * @returns promise that resolves when the checkout is complete
11797
+ */
11798
+ async function checkout(branch, optionals = {}) {
11799
+ return new Router().get(`/git/checkout/${branch}`, optionals).then(({
11800
+ body
11801
+ }) => body);
11802
+ }
11803
+
11804
+ /**
11805
+ * Resets the project's git repository, optionally to a specific branch.
11806
+ * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/reset[/{branch}]`
11807
+ *
11808
+ * @example
11809
+ * import { gitAdapter } from 'epicenter-libs';
11810
+ * await gitAdapter.reset(); // reset current branch
11811
+ * await gitAdapter.reset({ branch: 'main' }); // reset to 'main'
11812
+ *
11813
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
11814
+ * @param [optionals.branch] Branch to reset to; if omitted, resets the current branch
11815
+ * @returns promise that resolves when the reset is complete
11816
+ */
11817
+ async function reset(optionals = {}) {
11818
+ const {
11819
+ branch,
11820
+ ...routingOptions
11821
+ } = optionals;
11822
+ return new Router().delete(`/git/reset${branch ? `/${branch}` : ''}`, routingOptions).then(({
11823
+ body
11824
+ }) => body);
11825
+ }
11826
+
11827
+ /**
11828
+ * Creates a git integration for the project.
11829
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/integration`
11830
+ *
11831
+ * @example
11832
+ * import { gitAdapter } from 'epicenter-libs';
11833
+ * const integration = await gitAdapter.createIntegration({
11834
+ * uri: 'git@github.com:myorg/myrepo.git',
11835
+ * publicKey: '...',
11836
+ * privateKey: '...',
11837
+ * publicKeySpec: 'openssh',
11838
+ * privateKeySpec: 'pkcs8',
11839
+ * algorithm: 'ed25519',
11840
+ * });
11841
+ *
11842
+ * @param integration Git integration configuration to create
11843
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11844
+ * @returns promise that resolves to the created git integration
11845
+ */
11846
+ async function createIntegration(integration, optionals = {}) {
11847
+ return new Router().post('/git/integration', {
11848
+ body: integration,
11849
+ ...optionals
11850
+ }).then(({
11851
+ body
11852
+ }) => body);
11853
+ }
11854
+
11855
+ /**
11856
+ * Updates the git integration for the project.
11857
+ * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/integration`
11858
+ *
11859
+ * @example
11860
+ * import { gitAdapter } from 'epicenter-libs';
11861
+ * const integration = await gitAdapter.updateIntegration({
11862
+ * uri: 'git@github.com:myorg/newrepo.git',
11863
+ * publicKeySpec: 'openssh',
11864
+ * privateKeySpec: 'pkcs8',
11865
+ * algorithm: 'ed25519',
11866
+ * });
11867
+ *
11868
+ * @param integration Fields to update on the git integration
11869
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11870
+ * @returns promise that resolves to the updated git integration
11871
+ */
11872
+ async function updateIntegration(integration, optionals = {}) {
11873
+ return new Router().patch('/git/integration', {
11874
+ body: integration,
11875
+ ...optionals
11876
+ }).then(({
11877
+ body
11878
+ }) => body);
11879
+ }
11880
+
11881
+ /**
11882
+ * Removes the git integration for the project.
11883
+ * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/integration`
11884
+ *
11885
+ * @example
11886
+ * import { gitAdapter } from 'epicenter-libs';
11887
+ * await gitAdapter.removeIntegration();
11888
+ *
11889
+ * @param [optionals] Optional arguments; pass network call options overrides here.
11890
+ * @returns promise that resolves when the integration is removed
11891
+ */
11892
+ async function removeIntegration(optionals = {}) {
11893
+ return new Router().delete('/git/integration', optionals).then(({
11894
+ body
11895
+ }) => body);
11896
+ }
11897
+
11898
+ /**
11899
+ * Pushes local commits to the remote git repository.
11900
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/push`
11901
+ *
11902
+ * @example
11903
+ * import { gitAdapter } from 'epicenter-libs';
11904
+ * await gitAdapter.push({ message: 'Update simulation data' });
11905
+ *
11906
+ * @param optionals Arguments object; also accepts network call option overrides.
11907
+ * @param optionals.message Commit message (required)
11908
+ * @param [optionals.password] Password for authentication
11909
+ * @param [optionals.force] Force-push, bypassing non-fast-forward checks
11910
+ * @returns promise that resolves when the push is complete
11911
+ */
11912
+ async function push(optionals) {
11913
+ const {
11914
+ message,
11915
+ password,
11916
+ force,
11917
+ ...routingOptions
11918
+ } = optionals;
11919
+ return new Router().withSearchParams({
11920
+ force
11921
+ }).post('/git/push', {
11922
+ body: {
11923
+ message,
11924
+ password
11925
+ },
11926
+ ...routingOptions
11927
+ }).then(({
11928
+ body
11929
+ }) => body);
11930
+ }
11931
+
11932
+ /**
11933
+ * Pulls changes from the remote git repository into the project.
11934
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/pull`
11935
+ *
11936
+ * @example
11937
+ * import { gitAdapter } from 'epicenter-libs';
11938
+ * await gitAdapter.pull({ force: true, confirm: true });
11939
+ *
11940
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
11941
+ * @param [optionals.password] Password for authentication
11942
+ * @param [optionals.force] Force the pull, overwriting local changes
11943
+ * @param [optionals.confirm] Set the `X-Forio-Confirmation` header to confirm an overwrite
11944
+ * @returns promise that resolves when the pull is complete
11945
+ */
11946
+ async function pull(optionals = {}) {
11947
+ const {
11948
+ password,
11949
+ force,
11950
+ confirm,
11951
+ headers: headersOverride,
11952
+ ...routingOptions
11953
+ } = optionals;
11954
+ const headers = Object.assign({}, headersOverride, confirm ? {
11955
+ 'X-Forio-Confirmation': true
11956
+ } : {});
11957
+ return new Router().withSearchParams({
11958
+ force
11959
+ }).post('/git/pull', {
11960
+ body: {
11961
+ password
11962
+ },
11963
+ headers,
11964
+ ...routingOptions
11965
+ }).then(({
11966
+ body
11967
+ }) => body);
11968
+ }
11969
+
11970
+ var git = /*#__PURE__*/Object.freeze({
11971
+ __proto__: null,
11972
+ checkout: checkout,
11973
+ createIntegration: createIntegration,
11974
+ get: get,
11975
+ getStatus: getStatus,
11976
+ pull: pull,
11977
+ push: push,
11978
+ removeIntegration: removeIntegration,
11979
+ reset: reset,
11980
+ updateIntegration: updateIntegration
11981
+ });
11982
+
11983
+ // ──────────────────────────────────────────────
11984
+ // Data Points
11985
+ // ──────────────────────────────────────────────
11986
+
11987
+ // ──────────────────────────────────────────────
11988
+ // Chart Series
11989
+ // ──────────────────────────────────────────────
11990
+
11991
+ // ──────────────────────────────────────────────
11992
+ // Chart, Table, Picture
11993
+ // ──────────────────────────────────────────────
11994
+
11995
+ // ──────────────────────────────────────────────
11996
+ // Binary Data
11997
+ // ──────────────────────────────────────────────
11998
+
11999
+ // ──────────────────────────────────────────────
12000
+ // Environment, Slide, Document
12001
+ // ──────────────────────────────────────────────
12002
+
12003
+ /**
12004
+ * Generates a PowerPoint file from a template and returns it as binary data (JSON-encoded)
12005
+ * Base URL: PUT `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/powerpoint/{TEMPLATE_DIRECTORY}/{TEMPLATE_PATH}`
12006
+ *
12007
+ * @example
12008
+ * import { powerpointAdapter } from 'epicenter-libs';
12009
+ * const binaryData = await powerpointAdapter.generate('MODEL', 'en-US-debrief-template.pptx', {
12010
+ * output: 'debrief-slides.pptx',
12011
+ * environment: {},
12012
+ * slides: [
12013
+ * {
12014
+ * number: 1,
12015
+ * environment: {
12016
+ * tables: [{ name: 'Leaderboard', data: [['Rank', 'Name', 'Score']] }],
12017
+ * },
12018
+ * },
12019
+ * ],
12020
+ * });
12021
+ *
12022
+ * @param templateDirectory Directory where the template is stored: 'DATA' or 'MODEL'
12023
+ * @param templatePath Path to the template file within the directory
12024
+ * @param document Document shadow defining the output filename, environment, and slides
12025
+ * @param [optionals] Optional arguments; pass network call options overrides here.
12026
+ * @returns promise that resolves to the generated PowerPoint as BinaryData
12027
+ */
12028
+ async function generate(templateDirectory, templatePath, document, optionals = {}) {
12029
+ return new Router().put(`/powerpoint/${templateDirectory}/${templatePath}`, {
12030
+ body: document,
12031
+ ...optionals
12032
+ }).then(({
12033
+ body
12034
+ }) => body);
12035
+ }
12036
+
12037
+ /**
12038
+ * Generates a PowerPoint file from a template and returns it as a streaming response.
12039
+ * Useful for downloading the generated file directly.
12040
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/powerpoint/{TEMPLATE_DIRECTORY}/{TEMPLATE_PATH}`
12041
+ *
12042
+ * @example
12043
+ * import { powerpointAdapter } from 'epicenter-libs';
12044
+ * const response = await powerpointAdapter.stream('MODEL', 'en-US-debrief-template.pptx', {
12045
+ * output: 'debrief-slides.pptx',
12046
+ * environment: {},
12047
+ * slides: [],
12048
+ * });
12049
+ * const blob = await response.blob();
12050
+ *
12051
+ * @param templateDirectory Directory where the template is stored: 'DATA' or 'MODEL'
12052
+ * @param templatePath Path to the template file within the directory
12053
+ * @param document Document shadow defining the output filename, environment, and slides
12054
+ * @param [optionals] Optional arguments; pass network call options overrides here.
12055
+ * @returns promise that resolves to the raw Response for streaming/blob handling
12056
+ */
12057
+ async function stream(templateDirectory, templatePath, document, optionals = {}) {
12058
+ const {
12059
+ server,
12060
+ accountShortName,
12061
+ projectShortName,
12062
+ useProjectProxy,
12063
+ query,
12064
+ headers: headersOverride,
12065
+ authorization,
12066
+ includeAuthorization
12067
+ } = optionals;
12068
+ const url = new Router().getURL(`/powerpoint/${templateDirectory}/${templatePath}`, {
12069
+ server,
12070
+ accountShortName,
12071
+ projectShortName,
12072
+ useProjectProxy,
12073
+ query
12074
+ });
12075
+ const headers = {
12076
+ 'Content-type': 'application/json; charset=UTF-8',
12077
+ ...headersOverride
12078
+ };
12079
+ if (includeAuthorization !== false) {
12080
+ const {
12081
+ session
12082
+ } = identification;
12083
+ if (!headers.Authorization) {
12084
+ if (session) headers.Authorization = `Bearer ${session.token}`;
12085
+ if (authorization) headers.Authorization = authorization;
12086
+ if (config.authOverride) headers.Authorization = config.authOverride;
12087
+ }
12088
+ }
12089
+ return fetch(url.toString(), {
12090
+ method: 'POST',
12091
+ cache: 'no-cache',
12092
+ redirect: 'follow',
12093
+ headers,
12094
+ body: JSON.stringify(document)
12095
+ });
12096
+ }
12097
+
12098
+ var powerpoint = /*#__PURE__*/Object.freeze({
12099
+ __proto__: null,
12100
+ generate: generate,
12101
+ stream: stream
12102
+ });
12103
+
10749
12104
  const proxy = async (resource, options) => {
10750
12105
  const {
10751
12106
  accountShortName,
@@ -10763,9 +12118,9 @@
10763
12118
  proxy: proxy
10764
12119
  });
10765
12120
 
10766
- /* yes, this string template literal is weird;
10767
- * it's cause rollup does not recogize 3.34.2 as an individual token otherwise */
10768
- const version = `Epicenter (v${'3.34.2'}) for Browsers | Build Date: 2026-04-01T19:37:03.682Z`;
12121
+ /* "3.35.0", "Browsers" and "2026-07-21T22:45:13.866Z" are injected at build time — by
12122
+ * @rollup/plugin-replace for the shipped bundles and by Vite's `define` for tests */
12123
+ const version = `Epicenter (v${"3.35.0"}) for ${"Browsers"} | Build Date: ${"2026-07-21T22:45:13.866Z"}`;
10769
12124
  const UNAUTHORIZED = 401;
10770
12125
  const FORBIDDEN = 403;
10771
12126
  const DEFAULT_ERROR_HANDLERS = {};
@@ -14538,15 +15893,22 @@
14538
15893
  exports.config = config;
14539
15894
  exports.consensusAdapter = consensus;
14540
15895
  exports.dailyAdapter = daily;
15896
+ exports.docketAdapter = docket;
14541
15897
  exports.emailAdapter = email;
15898
+ exports.encyclopediaAdapter = encyclopedia;
14542
15899
  exports.episodeAdapter = episode;
14543
15900
  exports.errorManager = errorManager;
15901
+ exports.fileAdapter = file;
15902
+ exports.gitAdapter = git;
14544
15903
  exports.groupAdapter = group;
14545
15904
  exports.leaderboardAdapter = leaderboard;
14546
15905
  exports.matchmakerAdapter = matchmaker;
15906
+ exports.pipelineAdapter = pipeline;
15907
+ exports.powerpointAdapter = powerpoint;
14547
15908
  exports.presenceAdapter = presence;
14548
15909
  exports.projectAdapter = project;
14549
15910
  exports.recaptchaAdapter = recaptcha;
15911
+ exports.registrationAdapter = registration;
14550
15912
  exports.runAdapter = run;
14551
15913
  exports.somebodyAdapter = somebody;
14552
15914
  exports.taskAdapter = task;