epicenter-libs 3.34.2 → 3.35.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/README.md +61 -86
  3. package/dist/browser/epicenter.js +1589 -228
  4. package/dist/browser/epicenter.js.map +1 -1
  5. package/dist/cjs/epicenter.js +1512 -144
  6. package/dist/cjs/epicenter.js.map +1 -1
  7. package/dist/epicenter.js +1595 -227
  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 +1506 -145
  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/authentication.ts +2 -1
  27. package/src/adapters/cometd.ts +7 -2
  28. package/src/adapters/docket.ts +109 -0
  29. package/src/adapters/encyclopedia.ts +128 -0
  30. package/src/adapters/file.ts +332 -0
  31. package/src/adapters/git.ts +278 -0
  32. package/src/adapters/index.ts +14 -0
  33. package/src/adapters/pipeline.ts +145 -0
  34. package/src/adapters/powerpoint.ts +238 -0
  35. package/src/adapters/registration.ts +413 -0
  36. package/src/adapters/task.ts +170 -47
  37. package/src/epicenter.ts +10 -3
  38. package/src/globals.d.ts +6 -0
  39. package/src/types.ts +61 -0
  40. package/src/utils/router.ts +1 -0
@@ -55,7 +55,7 @@ function requireRuntime () {
55
55
  if (hasRequiredRuntime) return runtime.exports;
56
56
  hasRequiredRuntime = 1;
57
57
  (function (module) {
58
- var runtime = (function (exports$1) {
58
+ var runtime = (function (exports) {
59
59
 
60
60
  var Op = Object.prototype;
61
61
  var hasOwn = Op.hasOwnProperty;
@@ -96,7 +96,7 @@ function requireRuntime () {
96
96
 
97
97
  return generator;
98
98
  }
99
- exports$1.wrap = wrap;
99
+ exports.wrap = wrap;
100
100
 
101
101
  // Try/catch helper to minimize deoptimizations. Returns a completion
102
102
  // record like context.tryEntries[i].completion. This interface could
@@ -175,7 +175,7 @@ function requireRuntime () {
175
175
  });
176
176
  }
177
177
 
178
- exports$1.isGeneratorFunction = function(genFun) {
178
+ exports.isGeneratorFunction = function(genFun) {
179
179
  var ctor = typeof genFun === "function" && genFun.constructor;
180
180
  return ctor
181
181
  ? ctor === GeneratorFunction ||
@@ -185,7 +185,7 @@ function requireRuntime () {
185
185
  : false;
186
186
  };
187
187
 
188
- exports$1.mark = function(genFun) {
188
+ exports.mark = function(genFun) {
189
189
  if (Object.setPrototypeOf) {
190
190
  Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
191
191
  } else {
@@ -200,7 +200,7 @@ function requireRuntime () {
200
200
  // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
201
201
  // `hasOwn.call(value, "__await")` to determine if the yielded value is
202
202
  // meant to be awaited.
203
- exports$1.awrap = function(arg) {
203
+ exports.awrap = function(arg) {
204
204
  return { __await: arg };
205
205
  };
206
206
 
@@ -275,12 +275,12 @@ function requireRuntime () {
275
275
  define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
276
276
  return this;
277
277
  });
278
- exports$1.AsyncIterator = AsyncIterator;
278
+ exports.AsyncIterator = AsyncIterator;
279
279
 
280
280
  // Note that simple async functions are implemented on top of
281
281
  // AsyncIterator objects; they just return a Promise for the value of
282
282
  // the final result produced by the iterator.
283
- exports$1.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
283
+ exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
284
284
  if (PromiseImpl === void 0) PromiseImpl = Promise;
285
285
 
286
286
  var iter = new AsyncIterator(
@@ -288,7 +288,7 @@ function requireRuntime () {
288
288
  PromiseImpl
289
289
  );
290
290
 
291
- return exports$1.isGeneratorFunction(outerFn)
291
+ return exports.isGeneratorFunction(outerFn)
292
292
  ? iter // If outerFn is a generator, return the full iterator.
293
293
  : iter.next().then(function(result) {
294
294
  return result.done ? result.value : iter.next();
@@ -508,7 +508,7 @@ function requireRuntime () {
508
508
  this.reset(true);
509
509
  }
510
510
 
511
- exports$1.keys = function(val) {
511
+ exports.keys = function(val) {
512
512
  var object = Object(val);
513
513
  var keys = [];
514
514
  for (var key in object) {
@@ -569,7 +569,7 @@ function requireRuntime () {
569
569
 
570
570
  throw new TypeError(typeof iterable + " is not iterable");
571
571
  }
572
- exports$1.values = values;
572
+ exports.values = values;
573
573
 
574
574
  function doneResult() {
575
575
  return { value: undefined$1, done: true };
@@ -779,7 +779,7 @@ function requireRuntime () {
779
779
  // or not, return the runtime object so that we can declare the variable
780
780
  // regeneratorRuntime in the outer scope, which allows this module to be
781
781
  // injected easily by `bin/regenerator --include-runtime script.js`.
782
- return exports$1;
782
+ return exports;
783
783
 
784
784
  }(
785
785
  // If this script is executing as a CommonJS module, use module.exports
@@ -82459,7 +82459,7 @@ var hasRequiredNodePonyfill;
82459
82459
  function requireNodePonyfill () {
82460
82460
  if (hasRequiredNodePonyfill) return nodePonyfill.exports;
82461
82461
  hasRequiredNodePonyfill = 1;
82462
- (function (module, exports$1) {
82462
+ (function (module, exports) {
82463
82463
  const nodeFetch = require$$0;
82464
82464
  const realFetch = nodeFetch.default || nodeFetch;
82465
82465
 
@@ -82474,14 +82474,14 @@ function requireNodePonyfill () {
82474
82474
 
82475
82475
  fetch.ponyfill = true;
82476
82476
 
82477
- module.exports = exports$1 = fetch;
82478
- exports$1.fetch = fetch;
82479
- exports$1.Headers = nodeFetch.Headers;
82480
- exports$1.Request = nodeFetch.Request;
82481
- exports$1.Response = nodeFetch.Response;
82477
+ module.exports = exports = fetch;
82478
+ exports.fetch = fetch;
82479
+ exports.Headers = nodeFetch.Headers;
82480
+ exports.Request = nodeFetch.Request;
82481
+ exports.Response = nodeFetch.Response;
82482
82482
 
82483
82483
  // Needed for TypeScript consumers without esModuleInterop.
82484
- exports$1.default = fetch;
82484
+ exports.default = fetch;
82485
82485
  } (nodePonyfill, nodePonyfill.exports));
82486
82486
  return nodePonyfill.exports;
82487
82487
  }
@@ -84287,7 +84287,7 @@ async function channelsEnabled(optionals = {}) {
84287
84287
  * @param [optionals] Optional arguments; pass network call options overrides here.
84288
84288
  * @returns promise that resolves to the project object
84289
84289
  */
84290
- async function get$e(optionals = {}) {
84290
+ async function get$f(optionals = {}) {
84291
84291
  return await new Router().get('/project', optionals).then(({
84292
84292
  body
84293
84293
  }) => body);
@@ -84305,7 +84305,7 @@ async function get$e(optionals = {}) {
84305
84305
  * @param [optionals] Optional arguments; pass network call options overrides here.
84306
84306
  * @returns promise that resolves to an array of project objects
84307
84307
  */
84308
- async function list$4(accountShortName, optionals = {}) {
84308
+ async function list$5(accountShortName, optionals = {}) {
84309
84309
  return await new Router().withAccountShortName(accountShortName).withProjectShortName('manager').get('/project/in', optionals).then(({
84310
84310
  body
84311
84311
  }) => body);
@@ -84318,8 +84318,8 @@ var project = /*#__PURE__*/Object.freeze({
84318
84318
  PHYLOGENY: PHYLOGENY,
84319
84319
  WORKER_PARTITION: WORKER_PARTITION,
84320
84320
  channelsEnabled: channelsEnabled,
84321
- get: get$e,
84322
- list: list$4
84321
+ get: get$f,
84322
+ list: list$5
84323
84323
  });
84324
84324
 
84325
84325
  const AUTH_TOKEN_KEY = 'com.forio.epicenter.token';
@@ -84336,6 +84336,7 @@ const CONNECT_META_CHANNEL = '/meta/connect';
84336
84336
  const DISCONNECT_META_CHANNEL = '/meta/disconnect';
84337
84337
  const HANDSHAKE_META_CHANNEL = '/meta/handshake';
84338
84338
  const COMETD_RECONNECTED = 'COMETD_RECONNECTED';
84339
+ const CHANNELS_NOT_ENABLED = 'CHANNELS_NOT_ENABLED';
84339
84340
  const DEFAULT_CHANNEL_PROTOCOL = 'cometd';
84340
84341
  // error messages that indicate session invalidation as
84341
84342
  // described in cometd documentation and oumuamua source code:
@@ -84386,8 +84387,8 @@ class CometdAdapter {
84386
84387
  logLevel: 'warn'
84387
84388
  }) {
84388
84389
  var _project$channelProto;
84389
- const project = await get$e();
84390
- if (!project.channelEnabled) throw new EpicenterError('Push Channels are not enabled on this project');
84390
+ const project = await get$f();
84391
+ if (!project.channelEnabled) throw new EpicenterError('Push Channels are not enabled on this project', CHANNELS_NOT_ENABLED);
84391
84392
  const channelProtocol = ((_project$channelProto = project.channelProtocol) === null || _project$channelProto === void 0 ? void 0 : _project$channelProto.toLowerCase()) || DEFAULT_CHANNEL_PROTOCOL;
84392
84393
  const {
84393
84394
  CometD
@@ -84493,7 +84494,11 @@ class CometdAdapter {
84493
84494
  }
84494
84495
  async init(options) {
84495
84496
  if (!this.initialization) {
84496
- this.initialization = this.startup(options);
84497
+ // A rejected startup must not be cached, or every later init() call re-throws it
84498
+ this.initialization = this.startup(options).catch(error => {
84499
+ this.initialization = undefined;
84500
+ throw error;
84501
+ });
84497
84502
  }
84498
84503
  return this.initialization;
84499
84504
  }
@@ -84910,7 +84915,8 @@ function setLocalSession(session) {
84910
84915
  */
84911
84916
  async function removeLocalSession() {
84912
84917
  identification.session = undefined;
84913
- await cometdAdapter.disconnect();
84918
+ // CometD disconnect is best-effort cleanup; its failure must not fail session removal
84919
+ await cometdAdapter.disconnect().catch(() => undefined);
84914
84920
  }
84915
84921
 
84916
84922
  /**
@@ -85206,7 +85212,7 @@ var authentication = /*#__PURE__*/Object.freeze({
85206
85212
  * @param [optionals.tokenAccessSeconds] How long the presigned URL is valid for in seconds
85207
85213
  * @returns promise that resolves to an asset ticket containing the presigned upload URL
85208
85214
  */
85209
- async function create$a(file, scope, optionals = {}) {
85215
+ async function create$c(file, scope, optionals = {}) {
85210
85216
  const {
85211
85217
  scopeBoundary,
85212
85218
  scopeKey,
@@ -85311,7 +85317,7 @@ async function update$6(file, scope, optionals = {}) {
85311
85317
  * @param [optionals] Optional arguments; pass network call options overrides here.
85312
85318
  * @returns promise that resolves when the asset is deleted
85313
85319
  */
85314
- async function remove$4(assetKey, optionals = {}) {
85320
+ async function remove$5(assetKey, optionals = {}) {
85315
85321
  return await new Router().delete(`/asset/${assetKey}`, optionals).then(({
85316
85322
  body
85317
85323
  }) => body);
@@ -85359,7 +85365,7 @@ async function removeFromScope(scope, optionals = {}) {
85359
85365
  * @param [optionals] Optional arguments; pass network call options overrides here.
85360
85366
  * @returns promise that resolves to the asset metadata
85361
85367
  */
85362
- async function get$d(assetKey, optionals = {}) {
85368
+ async function get$e(assetKey, optionals = {}) {
85363
85369
  const {
85364
85370
  server,
85365
85371
  accountShortName,
@@ -85395,7 +85401,7 @@ async function get$d(assetKey, optionals = {}) {
85395
85401
  * @param [optionals.filter] File pattern to filter assets (e.g., '*.pdf' for PDF files); defaults to '*' (all files)
85396
85402
  * @returns promise that resolves to a list of assets
85397
85403
  */
85398
- async function list$3(scope, optionals = {}) {
85404
+ async function list$4(scope, optionals = {}) {
85399
85405
  const {
85400
85406
  scopeBoundary,
85401
85407
  scopeKey,
@@ -85488,7 +85494,7 @@ async function getURLWithScope(file, scope, optionals = {}) {
85488
85494
  * @param [optionals.tokenAccessSeconds] How long the presigned URL is valid for in seconds
85489
85495
  * @returns promise that resolves when the download is complete
85490
85496
  */
85491
- async function download$1(assetKey, optionals = {}) {
85497
+ async function download$2(assetKey, optionals = {}) {
85492
85498
  const {
85493
85499
  tokenAccessSeconds,
85494
85500
  ...routingOptions
@@ -85576,7 +85582,7 @@ async function store(file, scope, optionals = {}) {
85576
85582
  const name = fileName !== null && fileName !== void 0 ? fileName : file.name;
85577
85583
  let presignedUrl = '';
85578
85584
  try {
85579
- const response = await create$a(name, scope, {
85585
+ const response = await create$c(name, scope, {
85580
85586
  inert: true,
85581
85587
  ...remaining
85582
85588
  });
@@ -85600,14 +85606,14 @@ async function store(file, scope, optionals = {}) {
85600
85606
 
85601
85607
  var asset = /*#__PURE__*/Object.freeze({
85602
85608
  __proto__: null,
85603
- create: create$a,
85604
- download: download$1,
85609
+ create: create$c,
85610
+ download: download$2,
85605
85611
  downloadWithScope: downloadWithScope,
85606
- get: get$d,
85612
+ get: get$e,
85607
85613
  getURL: getURL$1,
85608
85614
  getURLWithScope: getURLWithScope,
85609
- list: list$3,
85610
- remove: remove$4,
85615
+ list: list$4,
85616
+ remove: remove$5,
85611
85617
  removeFromScope: removeFromScope,
85612
85618
  store: store,
85613
85619
  update: update$6
@@ -85815,7 +85821,7 @@ var email = /*#__PURE__*/Object.freeze({
85815
85821
  * @param [optionals.category] Optional argument to allow for establishing episode hierarchies
85816
85822
  * @returns promise that resolves to the newly created episode
85817
85823
  */
85818
- async function create$9(name, groupName, optionals = {}) {
85824
+ async function create$b(name, groupName, optionals = {}) {
85819
85825
  const {
85820
85826
  draft,
85821
85827
  runLimit,
@@ -85847,7 +85853,7 @@ async function create$9(name, groupName, optionals = {}) {
85847
85853
  * @param [optionals] Optional arguments; pass network call options overrides here.
85848
85854
  * @returns promise that resolves to an episode
85849
85855
  */
85850
- async function get$c(episodeKey, optionals = {}) {
85856
+ async function get$d(episodeKey, optionals = {}) {
85851
85857
  return await new Router().get(`/episode/${episodeKey}`, optionals).then(({
85852
85858
  body
85853
85859
  }) => body);
@@ -85883,7 +85889,7 @@ async function get$c(episodeKey, optionals = {}) {
85883
85889
  * @param [optionals] Optional arguments; pass network call options overrides here.
85884
85890
  * @returns promise that resolves to a page of episodes
85885
85891
  */
85886
- async function query$4(searchOptions, optionals = {}) {
85892
+ async function query$5(searchOptions, optionals = {}) {
85887
85893
  const {
85888
85894
  filter,
85889
85895
  sort = [],
@@ -85957,7 +85963,7 @@ async function withName(name, optionals = {}) {
85957
85963
  * @param [optionals] Optional arguments; pass network call options overrides here.
85958
85964
  * @returns promise that resolves to undefined if successful
85959
85965
  */
85960
- async function remove$3(episodeKey, optionals = {}) {
85966
+ async function remove$4(episodeKey, optionals = {}) {
85961
85967
  return await new Router().delete(`/episode/${episodeKey}`, optionals).then(({
85962
85968
  body
85963
85969
  }) => body);
@@ -85965,11 +85971,11 @@ async function remove$3(episodeKey, optionals = {}) {
85965
85971
 
85966
85972
  var episode = /*#__PURE__*/Object.freeze({
85967
85973
  __proto__: null,
85968
- create: create$9,
85974
+ create: create$b,
85969
85975
  forGroup: forGroup$1,
85970
- get: get$c,
85971
- query: query$4,
85972
- remove: remove$3,
85976
+ get: get$d,
85977
+ query: query$5,
85978
+ remove: remove$4,
85973
85979
  withName: withName
85974
85980
  });
85975
85981
 
@@ -85992,7 +85998,7 @@ var episode = /*#__PURE__*/Object.freeze({
85992
85998
  * @param [optionals.groupKey] Group key; if omitted will attempt to use the group associated with the current session
85993
85999
  * @returns promise that resolves to a group
85994
86000
  */
85995
- async function get$b(optionals = {}) {
86001
+ async function get$c(optionals = {}) {
85996
86002
  const {
85997
86003
  groupKey,
85998
86004
  augment,
@@ -86142,7 +86148,7 @@ async function update$5(groupKey, update, optionals = {}) {
86142
86148
  * @param [optionals] Optional arguments; pass network call options overrides here.
86143
86149
  * @returns promise that resolves to the newly created group
86144
86150
  */
86145
- async function create$8(group, optionals = {}) {
86151
+ async function create$a(group, optionals = {}) {
86146
86152
  const {
86147
86153
  name,
86148
86154
  runLimit,
@@ -86209,7 +86215,7 @@ async function create$8(group, optionals = {}) {
86209
86215
  * @param [optionals] Optional arguments; pass network call options overrides here.
86210
86216
  * @returns promise that resolves to a page of groups
86211
86217
  */
86212
- async function query$3(searchOptions, optionals = {}) {
86218
+ async function query$4(searchOptions, optionals = {}) {
86213
86219
  const {
86214
86220
  filter,
86215
86221
  sort = [],
@@ -86248,7 +86254,7 @@ async function search(optionals = {}) {
86248
86254
  max,
86249
86255
  quantized
86250
86256
  };
86251
- return await query$3(searchOptions, routingOptions);
86257
+ return await query$4(searchOptions, routingOptions);
86252
86258
  }
86253
86259
 
86254
86260
  /**
@@ -86621,14 +86627,14 @@ async function statusUpdate(code, message, optionals = {}) {
86621
86627
  var group = /*#__PURE__*/Object.freeze({
86622
86628
  __proto__: null,
86623
86629
  addUser: addUser$1,
86624
- create: create$8,
86630
+ create: create$a,
86625
86631
  destroy: destroy$2,
86626
86632
  forUser: forUser,
86627
86633
  gather: gather,
86628
- get: get$b,
86634
+ get: get$c,
86629
86635
  getSessionGroups: getSessionGroups,
86630
86636
  getWhitelistedUsers: getWhitelistedUsers,
86631
- query: query$3,
86637
+ query: query$4,
86632
86638
  removeUser: removeUser,
86633
86639
  search: search,
86634
86640
  selfRegister: selfRegister,
@@ -86727,7 +86733,7 @@ async function update$4(collection, scope, scores, optionals = {}) {
86727
86733
  * @param [optionals] Optional arguments; pass network call options overrides here.
86728
86734
  * @returns promise that resolves to a list of leaderboard entries
86729
86735
  */
86730
- async function list$2(collection, scope, searchOptions, optionals = {}) {
86736
+ async function list$3(collection, scope, searchOptions, optionals = {}) {
86731
86737
  const {
86732
86738
  scopeBoundary,
86733
86739
  scopeKey
@@ -86748,9 +86754,9 @@ async function list$2(collection, scope, searchOptions, optionals = {}) {
86748
86754
  body
86749
86755
  }) => body);
86750
86756
  }
86751
- async function get$a(collection, scope, searchOptions, optionals = {}) {
86757
+ async function get$b(collection, scope, searchOptions, optionals = {}) {
86752
86758
  console.warn('DEPRECATION WARNING: leaderboardAdapter.get is deprecated and will be removed with the next release. Use leaderboardAdapter.list instead.');
86753
- return await list$2(collection, scope, searchOptions, optionals);
86759
+ return await list$3(collection, scope, searchOptions, optionals);
86754
86760
  }
86755
86761
 
86756
86762
  /**
@@ -86796,9 +86802,9 @@ async function getCount(collection, scope, searchOptions, optionals = {}) {
86796
86802
 
86797
86803
  var leaderboard = /*#__PURE__*/Object.freeze({
86798
86804
  __proto__: null,
86799
- get: get$a,
86805
+ get: get$b,
86800
86806
  getCount: getCount,
86801
- list: list$2,
86807
+ list: list$3,
86802
86808
  update: update$4
86803
86809
  });
86804
86810
 
@@ -86947,7 +86953,7 @@ let MORPHOLOGY = /*#__PURE__*/function (MORPHOLOGY) {
86947
86953
  * @param [optionals.allowChannel] Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT
86948
86954
  * @returns promise that resolves to the newly created run
86949
86955
  */
86950
- async function create$7(model, scope, optionals = {}) {
86956
+ async function create$9(model, scope, optionals = {}) {
86951
86957
  const {
86952
86958
  scopeBoundary,
86953
86959
  scopeKey,
@@ -87238,7 +87244,7 @@ async function update$3(runKey, update, optionals = {}) {
87238
87244
  * @param [optionals] Optional arguments; pass network call options overrides here.
87239
87245
  * @returns promise that resolve to undefined if successful
87240
87246
  */
87241
- async function remove$2(runKey, optionals = {}) {
87247
+ async function remove$3(runKey, optionals = {}) {
87242
87248
  return await new Router().delete(`/run/${runKey}`, optionals).then(({
87243
87249
  body
87244
87250
  }) => body);
@@ -87256,7 +87262,7 @@ async function remove$2(runKey, optionals = {}) {
87256
87262
  * @param [optionals] Optional arguments; pass network call options overrides here.
87257
87263
  * @returns promise that resolves to the run
87258
87264
  */
87259
- async function get$9(runKey, optionals = {}) {
87265
+ async function get$a(runKey, optionals = {}) {
87260
87266
  return await new Router().get(`/run/${runKey}`, optionals).then(({
87261
87267
  body
87262
87268
  }) => body);
@@ -87298,7 +87304,7 @@ async function get$9(runKey, optionals = {}) {
87298
87304
  * @param [optionals] Optional arguments; pass network call options overrides here.
87299
87305
  * @returns promise that resolves to a page of runs
87300
87306
  */
87301
- async function query$2(model, searchOptions, optionals = {}) {
87307
+ async function query$3(model, searchOptions, optionals = {}) {
87302
87308
  const {
87303
87309
  filter,
87304
87310
  sort = [],
@@ -87855,15 +87861,15 @@ async function getWithStrategy(strategy, model, scope, optionals = {}) {
87855
87861
  };
87856
87862
  const {
87857
87863
  values: [lastRun]
87858
- } = await query$2(model, searchOptions);
87864
+ } = await query$3(model, searchOptions);
87859
87865
  if (!lastRun) {
87860
- const newRun = await create$7(model, scope, optionals);
87866
+ const newRun = await create$9(model, scope, optionals);
87861
87867
  // await serial(newRun.runKey, initOperations, optionals = {});
87862
87868
  return newRun;
87863
87869
  }
87864
87870
  return lastRun;
87865
87871
  } else if (strategy === 'reuse-never') {
87866
- const newRun = await create$7(model, scope, optionals);
87872
+ const newRun = await create$9(model, scope, optionals);
87867
87873
  // await serial(newRun.runKey, initOperations, optionals = {});
87868
87874
  return newRun;
87869
87875
  } else ;
@@ -87916,9 +87922,9 @@ var run = /*#__PURE__*/Object.freeze({
87916
87922
  MORPHOLOGY: MORPHOLOGY,
87917
87923
  action: action,
87918
87924
  clone: clone,
87919
- create: create$7,
87925
+ create: create$9,
87920
87926
  createSingular: createSingular,
87921
- get: get$9,
87927
+ get: get$a,
87922
87928
  getMetadata: getMetadata,
87923
87929
  getSingularRunKey: getSingularRunKey,
87924
87930
  getVariable: getVariable,
@@ -87928,8 +87934,8 @@ var run = /*#__PURE__*/Object.freeze({
87928
87934
  introspectWithRunKey: introspectWithRunKey,
87929
87935
  migrate: migrate,
87930
87936
  operation: operation,
87931
- query: query$2,
87932
- remove: remove$2,
87937
+ query: query$3,
87938
+ remove: remove$3,
87933
87939
  removeFromWorld: removeFromWorld,
87934
87940
  restore: restore,
87935
87941
  retrieveFromWorld: retrieveFromWorld,
@@ -88011,7 +88017,7 @@ async function createUser(view, optionals = {}) {
88011
88017
  * @param [optionals] Optional arguments; pass network call options overrides here.
88012
88018
  * @returns promise that resolves to a user
88013
88019
  */
88014
- async function get$8(userKey, optionals = {}) {
88020
+ async function get$9(userKey, optionals = {}) {
88015
88021
  return await new Router().get(`/user/${userKey}`, optionals).then(({
88016
88022
  body
88017
88023
  }) => body);
@@ -88044,7 +88050,7 @@ async function getWithHandle(handle, optionals = {}) {
88044
88050
  var user = /*#__PURE__*/Object.freeze({
88045
88051
  __proto__: null,
88046
88052
  createUser: createUser,
88047
- get: get$8,
88053
+ get: get$9,
88048
88054
  getWithHandle: getWithHandle,
88049
88055
  uploadCSV: uploadCSV
88050
88056
  });
@@ -88135,7 +88141,7 @@ const NOT_FOUND$4 = 404;
88135
88141
  * @param [optionals] Optional arguments; pass network call options overrides here.
88136
88142
  * @returns promise that resolves to the vault, or undefined if not found
88137
88143
  */
88138
- async function get$7(vaultKey, optionals = {}) {
88144
+ async function get$8(vaultKey, optionals = {}) {
88139
88145
  return await new Router().get(`/vault/${vaultKey}`, optionals).catch(error => {
88140
88146
  if (error.status === NOT_FOUND$4) return {
88141
88147
  body: undefined
@@ -88235,7 +88241,7 @@ async function byName$1(name, optionals = {}) {
88235
88241
  * @param [optionals.mutationKey] Mutation key for optimistic concurrency control
88236
88242
  * @returns promise that resolves to undefined when successful
88237
88243
  */
88238
- async function remove$1(vaultKey, optionals = {}) {
88244
+ async function remove$2(vaultKey, optionals = {}) {
88239
88245
  const {
88240
88246
  mutationKey,
88241
88247
  ...routingOptions
@@ -88350,7 +88356,7 @@ async function define(name, scope, optionals = {}) {
88350
88356
  * @param [optionals.mutationStrategy] Mutation strategy: ALLOW (upsert), DISALLOW (insert without update), ERROR (insert with conflict exception if exists)
88351
88357
  * @returns promise that resolves to the created vault
88352
88358
  */
88353
- async function create$6(name, scope, items, optionals = {}) {
88359
+ async function create$8(name, scope, items, optionals = {}) {
88354
88360
  console.warn('DEPRECATION WARNING: vaultAdapter.create is deprecated and will be removed with the next release. Use vaultAdapter.define instead.');
88355
88361
  return await define(name, scope, {
88356
88362
  items,
@@ -88382,7 +88388,7 @@ async function create$6(name, scope, items, optionals = {}) {
88382
88388
  * @param [optionals.groupName] Name of the group
88383
88389
  * @returns promise that resolves to an array of vaults that match the search options
88384
88390
  */
88385
- async function list$1(searchOptions, optionals = {}) {
88391
+ async function list$2(searchOptions, optionals = {}) {
88386
88392
  const {
88387
88393
  first,
88388
88394
  filter,
@@ -88447,11 +88453,11 @@ var vault = /*#__PURE__*/Object.freeze({
88447
88453
  __proto__: null,
88448
88454
  byName: byName$1,
88449
88455
  count: count,
88450
- create: create$6,
88456
+ create: create$8,
88451
88457
  define: define,
88452
- get: get$7,
88453
- list: list$1,
88454
- remove: remove$1,
88458
+ get: get$8,
88459
+ list: list$2,
88460
+ remove: remove$2,
88455
88461
  update: update$2,
88456
88462
  updateProperties: updateProperties,
88457
88463
  withScope: withScope$1
@@ -88776,7 +88782,7 @@ var video$1 = /*#__PURE__*/Object.freeze({
88776
88782
  * @param [optionals] Optional arguments; pass network call options overrides here.
88777
88783
  * @returns promise that resolves to undefined when successful
88778
88784
  */
88779
- async function remove(videoKey, optionals = {}) {
88785
+ async function remove$1(videoKey, optionals = {}) {
88780
88786
  return deleteVideoByKey(videoKey, optionals);
88781
88787
  }
88782
88788
 
@@ -88801,7 +88807,7 @@ async function remove(videoKey, optionals = {}) {
88801
88807
  * @param [optionals] Optional arguments; pass network call options overrides here.
88802
88808
  * @returns promise that resolves to a page of video objects
88803
88809
  */
88804
- async function query$1(searchOptions, optionals = {}) {
88810
+ async function query$2(searchOptions, optionals = {}) {
88805
88811
  const {
88806
88812
  filter,
88807
88813
  sort = [],
@@ -88991,7 +88997,7 @@ async function processVideo(videoKey, processors, optionals = {}) {
88991
88997
  * @param [optionals.videoKey] Key for the video object
88992
88998
  * @returns promise that resolves to undefined when download is complete
88993
88999
  */
88994
- async function download(file, optionals = {}) {
89000
+ async function download$1(file, optionals = {}) {
88995
89001
  const {
88996
89002
  scope,
88997
89003
  affiliate,
@@ -89010,12 +89016,12 @@ async function download(file, optionals = {}) {
89010
89016
 
89011
89017
  var video = /*#__PURE__*/Object.freeze({
89012
89018
  __proto__: null,
89013
- download: download,
89019
+ download: download$1,
89014
89020
  getDirectoryURL: getDirectoryURL,
89015
89021
  getURL: getURL,
89016
89022
  processVideo: processVideo,
89017
- query: query$1,
89018
- remove: remove
89023
+ query: query$2,
89024
+ remove: remove$1
89019
89025
  });
89020
89026
 
89021
89027
  /**
@@ -89362,7 +89368,7 @@ async function destroy$1(worldKey, optionals = {}) {
89362
89368
  * @param [optionals.allowChannel] Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT
89363
89369
  * @returns promise that resolves to the newly created world
89364
89370
  */
89365
- async function create$5(optionals = {}) {
89371
+ async function create$7(optionals = {}) {
89366
89372
  const {
89367
89373
  name,
89368
89374
  displayName,
@@ -89404,7 +89410,7 @@ async function create$5(optionals = {}) {
89404
89410
  * @param [optionals.mine] Flag for indicating to get only the worlds the requesting user is in (based on session token)
89405
89411
  * @returns promise that resolves to a list of worlds
89406
89412
  */
89407
- async function get$6(optionals = {}) {
89413
+ async function get$7(optionals = {}) {
89408
89414
  const {
89409
89415
  groupName,
89410
89416
  episodeName,
@@ -89785,10 +89791,10 @@ var world = /*#__PURE__*/Object.freeze({
89785
89791
  WORLD_NAME_GENERATOR_TYPE: WORLD_NAME_GENERATOR_TYPE,
89786
89792
  assignRun: assignRun,
89787
89793
  autoAssignUsers: autoAssignUsers,
89788
- create: create$5,
89794
+ create: create$7,
89789
89795
  destroy: destroy$1,
89790
89796
  editAssignments: editAssignments,
89791
- get: get$6,
89797
+ get: get$7,
89792
89798
  getAssignments: getAssignments,
89793
89799
  getAssignmentsByKey: getAssignmentsByKey,
89794
89800
  getPersonas: getPersonas,
@@ -89813,7 +89819,7 @@ var world = /*#__PURE__*/Object.freeze({
89813
89819
  * @returns promise that resolves to the current server time in ISO 8601 format, or undefined if not found
89814
89820
  */
89815
89821
  const NOT_FOUND$3 = 404;
89816
- async function get$5(optionals = {}) {
89822
+ async function get$6(optionals = {}) {
89817
89823
  return await new Router().get('/time', optionals).catch(error => {
89818
89824
  if (error.status === NOT_FOUND$3) return {
89819
89825
  body: undefined
@@ -89826,15 +89832,13 @@ async function get$5(optionals = {}) {
89826
89832
 
89827
89833
  var time = /*#__PURE__*/Object.freeze({
89828
89834
  __proto__: null,
89829
- get: get$5
89835
+ get: get$6
89830
89836
  });
89831
89837
 
89832
89838
  let RETRY_POLICY = /*#__PURE__*/function (RETRY_POLICY) {
89833
89839
  RETRY_POLICY["DO_NOTHING"] = "DO_NOTHING";
89834
89840
  // If the task fails, do nothing (this is the default)
89835
- RETRY_POLICY["RESCHEDULE"] = "RESCHEDULE";
89836
- // If the task fails retry at the next scheduled time point
89837
- 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
89841
+ RETRY_POLICY["FIRE_ON_FAIL_SAFE"] = "FIRE_ON_FAIL_SAFE"; // Retry within the task's fail-safe execution window
89838
89842
  return RETRY_POLICY;
89839
89843
  }({});
89840
89844
 
@@ -89851,7 +89855,7 @@ let RETRY_POLICY = /*#__PURE__*/function (RETRY_POLICY) {
89851
89855
  // Task response structure
89852
89856
 
89853
89857
  /**
89854
- * Creates a task; requires support level authentication
89858
+ * Creates a task; requires facilitator (or higher) privileges
89855
89859
  * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/task`
89856
89860
  *
89857
89861
  * @example
@@ -89863,7 +89867,9 @@ let RETRY_POLICY = /*#__PURE__*/function (RETRY_POLICY) {
89863
89867
  * const name = 'task-1-send-emails';
89864
89868
  * const payload = {
89865
89869
  * method: 'POST',
89866
- * url: 'https://forio.com/app/forio-dev/test-project/send-out-emails',
89870
+ * url: '/send-out-emails',
89871
+ * target: 'PROXY', // fire at the project's proxy server; omit to fire at the app
89872
+ * body: {},
89867
89873
  * };
89868
89874
  * const trigger = {
89869
89875
  * value: '0 7 15 * * ?', // triggers on day 15 7am of each month
@@ -89876,11 +89882,13 @@ let RETRY_POLICY = /*#__PURE__*/function (RETRY_POLICY) {
89876
89882
  * @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.
89877
89883
  * @param [scope.userKey] Key associated with the user
89878
89884
  * @param name Name of the task
89879
- * @param payload An HTTP task object that will be executed when the task is triggered
89880
- * @param payload.method Type of method to use with the HTTP request (e.g., 'GET', 'POST', 'PATCH')
89881
- * @param payload.url The URL the HTTP request will be sent to
89882
- * @param [payload.body] The body of the HTTP request
89883
- * @param [payload.headers] Headers to send along with the HTTP request
89885
+ * @param payload An HTTP request or group-status change to execute when the task is triggered
89886
+ * @param payload.method Type of method to use with the HTTP request (e.g., 'GET', 'POST')
89887
+ * @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}`
89888
+ * @param [payload.target] Where the task fires: 'APPLICATION' (the project app, `/app`, the default) or 'PROXY' (the project's proxy server, `/proxy`)
89889
+ * @param payload.body The JSON body of the HTTP request
89890
+ * @param [payload.headers] Headers to send along with the HTTP request; must be non-empty when provided — omit rather than pass an empty object
89891
+ * @param [payload.timeoutSeconds] Request timeout in seconds (1–30)
89884
89892
  * @param trigger Object that determines when to run the task (cron, offset, or date)
89885
89893
  * @param [trigger.value] For cron: cron expression (e.g., '0 7 * * * ?'). For date: ISO-8601 date-time string
89886
89894
  * @param [trigger.objectType] Type of trigger: 'cron', 'offset', or 'date'
@@ -89891,23 +89899,24 @@ let RETRY_POLICY = /*#__PURE__*/function (RETRY_POLICY) {
89891
89899
  * @param [optionals.accountShortName] Name of account (by default will be the account associated with the session)
89892
89900
  * @param [optionals.projectShortName] Name of project (by default will be the project associated with the session)
89893
89901
  * @param [optionals.retryPolicy] Specifies what to do should the task fail; see RETRY_POLICY
89894
- * @param [optionals.failSafeTermination] The ISO-8601 date-time when the task will be deleted regardless of any triggers; defaults to null
89895
- * @param [optionals.ttlSeconds] Max life expectancy of the task; used to determine if retrying the task is necessary
89902
+ * @param [optionals.failSafeTermination] ISO-8601 deadline after which the task terminates; the server defaults and caps this at one year from creation
89903
+ * @param [optionals.ttlSeconds] Execution fail-safe window in seconds; the server applies its configured minimum
89896
89904
  * @returns promise that resolves to the task object including the taskKey
89897
89905
  */
89898
- async function create$4(scope, name, payload, trigger, optionals = {}) {
89906
+ async function create$6(scope, name, payload, trigger, optionals = {}) {
89899
89907
  const {
89900
89908
  retryPolicy,
89901
89909
  failSafeTermination,
89902
89910
  ttlSeconds,
89903
89911
  ...routingOptions
89904
89912
  } = optionals;
89913
+ const normalizedPayload = payload.objectType === 'groupStatus' ? payload : {
89914
+ ...payload,
89915
+ objectType: 'http'
89916
+ };
89905
89917
  return await new Router().post('/task', {
89906
89918
  body: {
89907
- payload: {
89908
- objectType: 'http',
89909
- ...payload
89910
- },
89919
+ payload: normalizedPayload,
89911
89920
  trigger,
89912
89921
  retryPolicy,
89913
89922
  failSafeTermination,
@@ -89922,7 +89931,7 @@ async function create$4(scope, name, payload, trigger, optionals = {}) {
89922
89931
  }
89923
89932
 
89924
89933
  /**
89925
- * Deletes a task (changes status to cancelled); requires support level authentication
89934
+ * Deletes a task (changes status to cancelled); requires facilitator (or higher) privileges
89926
89935
  * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/task/{TASK_KEY}`
89927
89936
  *
89928
89937
  * @example
@@ -89931,7 +89940,7 @@ async function create$4(scope, name, payload, trigger, optionals = {}) {
89931
89940
  * await taskAdapter.destroy(taskKey);
89932
89941
  *
89933
89942
  * @param taskKey Unique key associated with a task
89934
- * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
89943
+ * @param [optionals] Optional arguments; pass network call options overrides here.
89935
89944
  * @param [optionals.accountShortName] Name of account (by default will be the account associated with the session)
89936
89945
  * @param [optionals.projectShortName] Name of project (by default will be the project associated with the session)
89937
89946
  * @returns promise that resolves to undefined when successful
@@ -89943,7 +89952,7 @@ async function destroy(taskKey, optionals = {}) {
89943
89952
  }
89944
89953
 
89945
89954
  /**
89946
- * Gets a task by taskKey; requires support level authentication
89955
+ * Gets a task by taskKey; requires facilitator (or higher) privileges
89947
89956
  * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/task/{TASK_KEY}`
89948
89957
  *
89949
89958
  * @example
@@ -89952,19 +89961,19 @@ async function destroy(taskKey, optionals = {}) {
89952
89961
  * const task = await taskAdapter.get(taskKey);
89953
89962
  *
89954
89963
  * @param taskKey Unique key associated with a task
89955
- * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
89964
+ * @param [optionals] Optional arguments; pass network call options overrides here.
89956
89965
  * @param [optionals.accountShortName] Name of account (by default will be the account associated with the session)
89957
89966
  * @param [optionals.projectShortName] Name of project (by default will be the project associated with the session)
89958
89967
  * @returns promise that resolves to the task object
89959
89968
  */
89960
- async function get$4(taskKey, optionals = {}) {
89969
+ async function get$5(taskKey, optionals = {}) {
89961
89970
  return await new Router().get(`/task/${taskKey}`, optionals).then(({
89962
89971
  body
89963
89972
  }) => body);
89964
89973
  }
89965
89974
 
89966
89975
  /**
89967
- * Gets the history (100 most recent times it has triggered) of a task by taskKey; requires support level authentication
89976
+ * Gets the history (100 most recent times it has triggered) of a task by taskKey; requires facilitator (or higher) privileges
89968
89977
  * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/task/history/{TASK_KEY}`
89969
89978
  *
89970
89979
  * @example
@@ -89973,19 +89982,32 @@ async function get$4(taskKey, optionals = {}) {
89973
89982
  * const history = await taskAdapter.getHistory(taskKey);
89974
89983
  *
89975
89984
  * @param taskKey Unique key associated with a task
89976
- * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
89985
+ * @param [optionals] Pagination and network options
89986
+ * @param [optionals.first] Zero-based index of the first history record; defaults to 0
89987
+ * @param [optionals.max] Maximum history records to return; defaults to 100 and cannot exceed 100
89977
89988
  * @param [optionals.accountShortName] Name of account (by default will be the account associated with the session)
89978
89989
  * @param [optionals.projectShortName] Name of project (by default will be the project associated with the session)
89979
- * @returns promise that resolves to an array of task history objects
89990
+ * @returns promise that resolves to a page of task history objects
89980
89991
  */
89981
89992
  async function getHistory(taskKey, optionals = {}) {
89982
- return await new Router().get(`/task/history/${taskKey}`, optionals).then(({
89993
+ const {
89994
+ first,
89995
+ max,
89996
+ ...routingOptions
89997
+ } = optionals;
89998
+ return await new Router().withSearchParams({
89999
+ first,
90000
+ max
90001
+ }).get(`/task/history/${taskKey}`, {
90002
+ paginated: true,
90003
+ ...routingOptions
90004
+ }).then(({
89983
90005
  body
89984
90006
  }) => body);
89985
90007
  }
89986
90008
 
89987
90009
  /**
89988
- * Gets most recent 100 tasks related to the selected scope; requires support level authentication
90010
+ * Gets most recent 100 tasks related to the selected scope; requires facilitator (or higher) privileges
89989
90011
  * 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}`
89990
90012
  *
89991
90013
  * 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.
@@ -90002,10 +90024,13 @@ async function getHistory(taskKey, optionals = {}) {
90002
90024
  * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types
90003
90025
  * @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.
90004
90026
  * @param [scope.userKey] Key associated with the user; will retrieve tasks in the scope that were made by the specified user
90005
- * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
90027
+ * @param [optionals] Pagination, sorting, and network options
90028
+ * @param [optionals.sort] Task fields to sort by
90029
+ * @param [optionals.first] Zero-based index of the first task; defaults to 0
90030
+ * @param [optionals.max] Maximum tasks to return; defaults to 100 and cannot exceed 100
90006
90031
  * @param [optionals.accountShortName] Name of account (by default will be the account associated with the session)
90007
90032
  * @param [optionals.projectShortName] Name of project (by default will be the project associated with the session)
90008
- * @returns promise that resolves to an array of task objects
90033
+ * @returns promise that resolves to a page of task objects
90009
90034
  */
90010
90035
  async function getTaskIn(scope, optionals = {}) {
90011
90036
  const {
@@ -90013,7 +90038,70 @@ async function getTaskIn(scope, optionals = {}) {
90013
90038
  scopeKey,
90014
90039
  userKey
90015
90040
  } = scope;
90016
- return await new Router().get(`/task/in/${scopeBoundary}/${scopeKey}${userKey ? `/${userKey}` : ''}`, optionals).then(({
90041
+ const {
90042
+ sort = [],
90043
+ first,
90044
+ max,
90045
+ ...routingOptions
90046
+ } = optionals;
90047
+ return await new Router().withSearchParams({
90048
+ sort: sort.join(';') || undefined,
90049
+ first,
90050
+ max
90051
+ }).get(`/task/in/${scopeBoundary}/${scopeKey}${userKey ? `/${userKey}` : ''}`, {
90052
+ paginated: true,
90053
+ ...routingOptions
90054
+ }).then(({
90055
+ body
90056
+ }) => body);
90057
+ }
90058
+
90059
+ /**
90060
+ * Queries for tasks
90061
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/task/search`
90062
+ *
90063
+ * No authentication is required; results use facilitator-level row visibility.
90064
+ * Filterable/sortable fields include
90065
+ * `task.taskKey`, `task.name`, `task.status`, `task.scopeBoundary`, `task.scopeKey`,
90066
+ * `task.userKey`, `task.groupName`, `task.episodeName`, `task.nextExecution`,
90067
+ * `task.failSafeExecution`, and `task.created`.
90068
+ *
90069
+ * @example
90070
+ * import { taskAdapter } from 'epicenter-libs';
90071
+ * const page = await taskAdapter.query({
90072
+ * filter: [
90073
+ * 'task.scopeKey=0000017dd3bf540e5ada5b1e058f08f20461', // tasks scoped to this group
90074
+ * 'task.status=INITIALIZED', // that have not yet fired
90075
+ * ],
90076
+ * sort: ['-task.created'], // newest first
90077
+ * max: 10, // page should only include the first 10 items
90078
+ * });
90079
+ *
90080
+ * @param searchOptions Search options for the query
90081
+ * @param [searchOptions.filter] Filters for searching
90082
+ * @param [searchOptions.sort] Sorting criteria
90083
+ * @param [searchOptions.first] The starting index of the page returned
90084
+ * @param [searchOptions.max] The number of entries per page
90085
+ * @param [optionals] Optional arguments; pass network call options overrides here.
90086
+ * @returns promise that resolves to a page of tasks
90087
+ */
90088
+ async function query$1(searchOptions, optionals = {}) {
90089
+ const {
90090
+ filter,
90091
+ sort = [],
90092
+ first,
90093
+ max
90094
+ } = searchOptions;
90095
+ const searchParams = {
90096
+ filter: parseFilterInput(filter),
90097
+ sort: sort.join(';') || undefined,
90098
+ first,
90099
+ max
90100
+ };
90101
+ return await new Router().withSearchParams(searchParams).get('/task/search', {
90102
+ paginated: true,
90103
+ ...optionals
90104
+ }).then(({
90017
90105
  body
90018
90106
  }) => body);
90019
90107
  }
@@ -90021,11 +90109,12 @@ async function getTaskIn(scope, optionals = {}) {
90021
90109
  var task = /*#__PURE__*/Object.freeze({
90022
90110
  __proto__: null,
90023
90111
  RETRY_POLICY: RETRY_POLICY,
90024
- create: create$4,
90112
+ create: create$6,
90025
90113
  destroy: destroy,
90026
- get: get$4,
90114
+ get: get$5,
90027
90115
  getHistory: getHistory,
90028
- getTaskIn: getTaskIn
90116
+ getTaskIn: getTaskIn,
90117
+ query: query$1
90029
90118
  });
90030
90119
 
90031
90120
  /**
@@ -90077,7 +90166,7 @@ async function updatePermit(chatKey, permit, optionals = {}) {
90077
90166
  * @param [optionals] Optional arguments; pass network call options overrides here.
90078
90167
  * @returns promise that resolves to the newly created chat
90079
90168
  */
90080
- async function create$3(room, scope, permit, optionals = {}) {
90169
+ async function create$5(room, scope, permit, optionals = {}) {
90081
90170
  return new Router().post('/chat', {
90082
90171
  body: {
90083
90172
  scope: {
@@ -90105,7 +90194,7 @@ async function create$3(room, scope, permit, optionals = {}) {
90105
90194
  * @param [optionals] Optional arguments; pass network call options overrides here.
90106
90195
  * @returns promise that resolves to the chat
90107
90196
  */
90108
- async function get$3(chatKey, optionals = {}) {
90197
+ async function get$4(chatKey, optionals = {}) {
90109
90198
  return new Router().get(`/chat/${chatKey}`, optionals).then(({
90110
90199
  body
90111
90200
  }) => body);
@@ -90321,8 +90410,8 @@ async function sendMessageAdmin(chatKey, message, optionals = {}) {
90321
90410
 
90322
90411
  var chat = /*#__PURE__*/Object.freeze({
90323
90412
  __proto__: null,
90324
- create: create$3,
90325
- get: get$3,
90413
+ create: create$5,
90414
+ get: get$4,
90326
90415
  getMessages: getMessages,
90327
90416
  getMessagesAdmin: getMessagesAdmin,
90328
90417
  getMessagesForUser: getMessagesForUser,
@@ -90365,7 +90454,7 @@ var chat = /*#__PURE__*/Object.freeze({
90365
90454
  * @param [optionals.allowChannel] Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT
90366
90455
  * @returns promise that resolves to the newly created consensus barrier
90367
90456
  */
90368
- async function create$2(worldKey, name, stage, expectedRoles, defaultActions, optionals = {}) {
90457
+ async function create$4(worldKey, name, stage, expectedRoles, defaultActions, optionals = {}) {
90369
90458
  const {
90370
90459
  ttlSeconds,
90371
90460
  transparent = false,
@@ -90419,7 +90508,7 @@ async function load(worldKey, name, stage, optionals = {}) {
90419
90508
  * @param [optionals] Optional arguments; pass network call options overrides here.
90420
90509
  * @returns promise that resolves to a list of consensus barriers
90421
90510
  */
90422
- async function list(worldKey, name, optionals = {}) {
90511
+ async function list$1(worldKey, name, optionals = {}) {
90423
90512
  return await new Router().get(`/consensus/${worldKey}/${name}`, optionals).then(({
90424
90513
  body
90425
90514
  }) => body);
@@ -90812,11 +90901,11 @@ async function collectInGroup(barrierMap, groupName, optionals = {}) {
90812
90901
  var consensus = /*#__PURE__*/Object.freeze({
90813
90902
  __proto__: null,
90814
90903
  collectInGroup: collectInGroup,
90815
- create: create$2,
90904
+ create: create$4,
90816
90905
  deleteAll: deleteAll,
90817
90906
  deleteBarrier: deleteBarrier,
90818
90907
  forceClose: forceClose,
90819
- list: list,
90908
+ list: list$1,
90820
90909
  load: load,
90821
90910
  pause: pause,
90822
90911
  removeRoleExpectationFor: removeRoleExpectationFor,
@@ -90854,7 +90943,7 @@ var consensus = /*#__PURE__*/Object.freeze({
90854
90943
  * @returns promise that resolves to the newly created somebody object
90855
90944
  */
90856
90945
 
90857
- async function create$1(email, scope, optionals = {}) {
90946
+ async function create$3(email, scope, optionals = {}) {
90858
90947
  const {
90859
90948
  givenName,
90860
90949
  familyName,
@@ -90887,7 +90976,7 @@ async function create$1(email, scope, optionals = {}) {
90887
90976
  * @returns promise that resolves to the somebody object, or undefined if not found
90888
90977
  */
90889
90978
  const NOT_FOUND$2 = 404;
90890
- async function get$2(somebodyKey, optionals = {}) {
90979
+ async function get$3(somebodyKey, optionals = {}) {
90891
90980
  return await new Router().get(`/somebody/${somebodyKey}`, optionals).catch(error => {
90892
90981
  if (error.status === NOT_FOUND$2) return {
90893
90982
  body: undefined
@@ -90982,8 +91071,8 @@ async function byEmail(email, scope, optionals = {}) {
90982
91071
  var somebody = /*#__PURE__*/Object.freeze({
90983
91072
  __proto__: null,
90984
91073
  byEmail: byEmail,
90985
- create: create$1,
90986
- get: get$2,
91074
+ create: create$3,
91075
+ get: get$3,
90987
91076
  inScope: inScope
90988
91077
  });
90989
91078
 
@@ -91006,7 +91095,7 @@ var somebody = /*#__PURE__*/Object.freeze({
91006
91095
  * @param [optionals] Optional arguments; pass network call options overrides here.
91007
91096
  * @returns promise that resolves to the matchmaker list object
91008
91097
  */
91009
- async function create(name, partners, scope, optionals = {}) {
91098
+ async function create$2(name, partners, scope, optionals = {}) {
91010
91099
  const {
91011
91100
  accountShortName,
91012
91101
  projectShortName,
@@ -91089,7 +91178,7 @@ const NOT_FOUND$1 = 404;
91089
91178
  * @param [optionals] Optional arguments; pass network call options overrides here.
91090
91179
  * @returns promise that resolves to the matchmaker list object, or undefined if not found
91091
91180
  */
91092
- async function get$1(udomeKey, optionals = {}) {
91181
+ async function get$2(udomeKey, optionals = {}) {
91093
91182
  const {
91094
91183
  accountShortName,
91095
91184
  projectShortName,
@@ -91147,9 +91236,9 @@ var matchmaker = /*#__PURE__*/Object.freeze({
91147
91236
  __proto__: null,
91148
91237
  addUser: addUser,
91149
91238
  byName: byName,
91150
- create: create,
91239
+ create: create$2,
91151
91240
  edit: edit,
91152
- get: get$1
91241
+ get: get$2
91153
91242
  });
91154
91243
 
91155
91244
  const sleep = ms => new Promise(r => setTimeout(r, ms));
@@ -91453,7 +91542,7 @@ const NOT_FOUND = 404;
91453
91542
  * @param [optionals] Optional arguments; pass network call options overrides here.
91454
91543
  * @returns promise that resolves to the wallet
91455
91544
  */
91456
- async function get(scope, optionals = {}) {
91545
+ async function get$1(scope, optionals = {}) {
91457
91546
  const {
91458
91547
  scopeBoundary,
91459
91548
  scopeKey
@@ -91520,11 +91609,922 @@ async function withScope(scope, optionals = {}) {
91520
91609
 
91521
91610
  var wallet = /*#__PURE__*/Object.freeze({
91522
91611
  __proto__: null,
91523
- get: get,
91612
+ get: get$1,
91524
91613
  update: update,
91525
91614
  withScope: withScope
91526
91615
  });
91527
91616
 
91617
+ /**
91618
+ * Builds the NPM Docker images used by pipeline NPM operations.
91619
+ * Requires `system` (admin) authorization.
91620
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/pipeline/npm/images`
91621
+ *
91622
+ * @example
91623
+ * import { pipelineAdapter } from 'epicenter-libs';
91624
+ * const built = await pipelineAdapter.buildImages();
91625
+ *
91626
+ * @param [optionals] Optional arguments; pass network call options overrides here.
91627
+ * @returns promise that resolves to `true` when the images were built successfully
91628
+ */
91629
+ async function buildImages(optionals = {}) {
91630
+ return await new Router().get('/pipeline/npm/images', optionals).then(({
91631
+ body
91632
+ }) => body);
91633
+ }
91634
+
91635
+ /**
91636
+ * Executes a stored pipeline configuration. The operations to run are read server-side from the
91637
+ * named config file; only step inputs (such as credentials) are supplied here via `attributes`.
91638
+ * The execution runs asynchronously — the returned audit record starts in its `RUNNING` state and
91639
+ * is updated by the worker on completion (poll `getExecution` to observe progress).
91640
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/pipeline/{configName}`
91641
+ *
91642
+ * @example
91643
+ * import { pipelineAdapter } from 'epicenter-libs';
91644
+ * // Pass the git credential the config's git step will consume, keyed by operation type
91645
+ * const audit = await pipelineAdapter.execute('deploy', { git: 'my-git-token' });
91646
+ *
91647
+ * @param configName Name of the stored pipeline config to execute
91648
+ * @param [attributes] Step inputs keyed by operation type (e.g. `{ git: '<token>' }`)
91649
+ * @param [optionals] Optional arguments; pass network call options overrides here.
91650
+ * @returns promise that resolves to the newly created audit record in its initial RUNNING state
91651
+ */
91652
+ async function execute(configName, attributes = {}, optionals = {}) {
91653
+ return await new Router().post(`/pipeline/${encodeURIComponent(configName)}`, {
91654
+ body: {
91655
+ attributes
91656
+ },
91657
+ ...optionals
91658
+ }).then(({
91659
+ body
91660
+ }) => body);
91661
+ }
91662
+
91663
+ /**
91664
+ * Retrieves a single pipeline audit record by its execution key.
91665
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/pipeline/{executionKey}`
91666
+ *
91667
+ * @example
91668
+ * import { pipelineAdapter } from 'epicenter-libs';
91669
+ * const audit = await pipelineAdapter.getExecution('<executionKey>');
91670
+ *
91671
+ * @param executionKey Execution key of the audit record to retrieve
91672
+ * @param [optionals] Optional arguments; pass network call options overrides here.
91673
+ * @returns promise that resolves to the audit record
91674
+ */
91675
+ async function getExecution(executionKey, optionals = {}) {
91676
+ return await new Router().get(`/pipeline/${encodeURIComponent(executionKey)}`, optionals).then(({
91677
+ body
91678
+ }) => body);
91679
+ }
91680
+
91681
+ /**
91682
+ * Lists the audit history for a stored pipeline config.
91683
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/pipeline/with/{configName}`
91684
+ *
91685
+ * @example
91686
+ * import { pipelineAdapter } from 'epicenter-libs';
91687
+ * const page = await pipelineAdapter.listAudits('deploy', { first: 0, max: 20 });
91688
+ *
91689
+ * @param configName Name of the stored pipeline config
91690
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
91691
+ * @param [optionals.first] Index of the first record to return (for pagination)
91692
+ * @param [optionals.max] Maximum number of records to return (for pagination)
91693
+ * @returns promise that resolves to a page of audit records
91694
+ */
91695
+ async function listAudits(configName, optionals = {}) {
91696
+ const {
91697
+ first = 0,
91698
+ max,
91699
+ ...routingOptions
91700
+ } = optionals;
91701
+ return await new Router().withSearchParams({
91702
+ first,
91703
+ max
91704
+ }).get(`/pipeline/with/${encodeURIComponent(configName)}`, {
91705
+ paginated: true,
91706
+ ...routingOptions
91707
+ }).then(({
91708
+ body
91709
+ }) => body);
91710
+ }
91711
+
91712
+ /**
91713
+ * Deletes a pipeline audit record by its execution key.
91714
+ * Requires `system` (admin) authorization.
91715
+ * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/pipeline/{executionKey}`
91716
+ *
91717
+ * @example
91718
+ * import { pipelineAdapter } from 'epicenter-libs';
91719
+ * await pipelineAdapter.deleteAudit('<executionKey>');
91720
+ *
91721
+ * @param executionKey Execution key of the audit record to delete
91722
+ * @param [optionals] Optional arguments; pass network call options overrides here.
91723
+ * @returns promise that resolves to `true` when the audit record was deleted
91724
+ */
91725
+ async function deleteAudit(executionKey, optionals = {}) {
91726
+ return await new Router().delete(`/pipeline/${encodeURIComponent(executionKey)}`, optionals).then(({
91727
+ body
91728
+ }) => body);
91729
+ }
91730
+
91731
+ var pipeline = /*#__PURE__*/Object.freeze({
91732
+ __proto__: null,
91733
+ buildImages: buildImages,
91734
+ deleteAudit: deleteAudit,
91735
+ execute: execute,
91736
+ getExecution: getExecution,
91737
+ listAudits: listAudits
91738
+ });
91739
+
91740
+ /**
91741
+ * Lists the known API services available for the given encyclopedia version.
91742
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/encyclopedia/v{version}`
91743
+ *
91744
+ * @example
91745
+ * import { encyclopediaAdapter } from 'epicenter-libs';
91746
+ * const services = await encyclopediaAdapter.listServices(3);
91747
+ *
91748
+ * @param version Encyclopedia version number
91749
+ * @param [optionals] Optional arguments; pass network call options overrides here.
91750
+ * @returns promise that resolves to an array of known service descriptors
91751
+ */
91752
+ async function listServices(version, optionals = {}) {
91753
+ return await new Router().get(`/encyclopedia/v${version}`, optionals).then(({
91754
+ body
91755
+ }) => body);
91756
+ }
91757
+
91758
+ /**
91759
+ * Retrieves the documented resource (API documentation) for a specific service and encyclopedia version.
91760
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/encyclopedia/v{version}/{api}`
91761
+ *
91762
+ * @example
91763
+ * import { encyclopediaAdapter } from 'epicenter-libs';
91764
+ * const resource = await encyclopediaAdapter.getResource(3, 'run');
91765
+ *
91766
+ * @param version Encyclopedia version number
91767
+ * @param api Name of the API service to retrieve documentation for
91768
+ * @param [optionals] Optional arguments; pass network call options overrides here.
91769
+ * @returns promise that resolves to the documented resource containing endpoints and definitions
91770
+ */
91771
+ async function getResource(version, api, optionals = {}) {
91772
+ return await new Router().get(`/encyclopedia/v${version}/${api}`, optionals).then(({
91773
+ body
91774
+ }) => body);
91775
+ }
91776
+
91777
+ /**
91778
+ * Retrieves a translated representation of the API documentation for a specific service and encyclopedia version.
91779
+ * Supported translators are ASCIIDOC, ASCIIDOC_TO_HTML, and OPENAPI.
91780
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/encyclopedia/as/{translator}/v{version}/{api}`
91781
+ *
91782
+ * NOTE: The backend returns the translated content with a translator-specific content-type
91783
+ * (e.g. `text/asciidoc`, `text/html`, `application/json`). The shared Router throws when the
91784
+ * response content-type is not `application/json`, so only the OPENAPI translator works here.
91785
+ * For ASCIIDOC and ASCIIDOC_TO_HTML, use the underlying fetch API directly against the
91786
+ * constructed URL.
91787
+ *
91788
+ * @example
91789
+ * import { encyclopediaAdapter } from 'epicenter-libs';
91790
+ * const openApiDoc = await encyclopediaAdapter.translate('OPENAPI', 3, 'run');
91791
+ *
91792
+ * @param translator Output format for the documentation; one of 'ASCIIDOC', 'ASCIIDOC_TO_HTML', or 'OPENAPI'
91793
+ * @param version Encyclopedia version number
91794
+ * @param api Name of the API service to translate documentation for
91795
+ * @param [optionals] Optional arguments; pass network call options overrides here.
91796
+ * @returns promise that resolves to the translated documentation (only when translator is 'OPENAPI')
91797
+ */
91798
+ async function translate(translator, version, api, optionals = {}) {
91799
+ return await new Router().get(`/encyclopedia/as/${translator}/v${version}/${api}`, optionals).then(({
91800
+ body
91801
+ }) => body);
91802
+ }
91803
+
91804
+ var encyclopedia = /*#__PURE__*/Object.freeze({
91805
+ __proto__: null,
91806
+ getResource: getResource,
91807
+ listServices: listServices,
91808
+ translate: translate
91809
+ });
91810
+
91811
+ /* File paths are free-form, user-authored strings that may contain spaces or URL-reserved
91812
+ * characters. Encode each segment while preserving the '/' separators that the backend's
91813
+ * `{filePath:.*}` routes expect. */
91814
+ const encodePath = filePath => filePath.split('/').map(encodeURIComponent).join('/');
91815
+
91816
+ /**
91817
+ * Lists files and directories at the project root or at a specific path.
91818
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file[/{filePath}]`
91819
+ *
91820
+ * @example
91821
+ * import { fileAdapter } from 'epicenter-libs';
91822
+ * // List all files at root
91823
+ * const entries = await fileAdapter.list();
91824
+ * // List contents of a specific directory up to 2 levels deep
91825
+ * const entries = await fileAdapter.list('src', { depth: 2 });
91826
+ *
91827
+ * @param [filePath] Path to a file or directory; omit to list the project root
91828
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
91829
+ * @param [optionals.depth] Maximum depth of directory traversal to include in the response
91830
+ * @returns promise that resolves to an array of file and directory entries
91831
+ */
91832
+ async function list(filePath, optionals = {}) {
91833
+ const {
91834
+ depth,
91835
+ ...routingOptions
91836
+ } = optionals;
91837
+ const uriComponent = filePath ? `/${encodePath(filePath)}` : '';
91838
+ return await new Router().withSearchParams({
91839
+ depth
91840
+ }).get(`/file${uriComponent}`, routingOptions).then(({
91841
+ body
91842
+ }) => body);
91843
+ }
91844
+
91845
+ /**
91846
+ * Uploads and replaces files at the project root or at a specific path using multipart/form-data (PUT).
91847
+ * Use this when you want to overwrite existing files. For creating new files, use `create`.
91848
+ * Base URL: PUT `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file[/{filePath}]`
91849
+ *
91850
+ * NOTE: This is browser-only. The `FormData` body is only serialized as multipart/form-data when
91851
+ * running in a browser environment; in Node it will not be sent correctly.
91852
+ *
91853
+ * @example
91854
+ * import { fileAdapter } from 'epicenter-libs';
91855
+ * const formData = new FormData();
91856
+ * formData.append('file', myFile);
91857
+ * const uploaded = await fileAdapter.upload(formData, 'models/model.py');
91858
+ *
91859
+ * @param formData Multipart form data containing the file(s) to upload
91860
+ * @param [filePath] Destination path for the file(s); omit to upload to the project root
91861
+ * @param [optionals] Optional arguments; pass network call options overrides here.
91862
+ * @returns promise that resolves to an array of the uploaded file entries
91863
+ */
91864
+ async function upload(formData, filePath, optionals = {}) {
91865
+ const uriComponent = filePath ? `/${encodePath(filePath)}` : '';
91866
+ return await new Router().put(`/file${uriComponent}`, {
91867
+ body: formData,
91868
+ ...optionals
91869
+ }).then(({
91870
+ body
91871
+ }) => body);
91872
+ }
91873
+
91874
+ /**
91875
+ * Creates new files at the project root or at a specific path using multipart/form-data (POST).
91876
+ * Use this when creating new files. For overwriting existing files, use `upload`.
91877
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file[/{filePath}]`
91878
+ *
91879
+ * NOTE: This is browser-only. The `FormData` body is only serialized as multipart/form-data when
91880
+ * running in a browser environment; in Node it will not be sent correctly.
91881
+ *
91882
+ * @example
91883
+ * import { fileAdapter } from 'epicenter-libs';
91884
+ * const formData = new FormData();
91885
+ * formData.append('file', myFile);
91886
+ * const created = await fileAdapter.create(formData, 'models/model.py');
91887
+ *
91888
+ * @param formData Multipart form data containing the file(s) to create
91889
+ * @param [filePath] Destination path for the file(s); omit to create at the project root
91890
+ * @param [optionals] Optional arguments; pass network call options overrides here.
91891
+ * @returns promise that resolves to an array of the created file entries
91892
+ */
91893
+ async function create$1(formData, filePath, optionals = {}) {
91894
+ const uriComponent = filePath ? `/${encodePath(filePath)}` : '';
91895
+ return await new Router().post(`/file${uriComponent}`, {
91896
+ body: formData,
91897
+ ...optionals
91898
+ }).then(({
91899
+ body
91900
+ }) => body);
91901
+ }
91902
+
91903
+ /**
91904
+ * Deletes a file or directory at the project root or at a specific path.
91905
+ * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file[/{filePath}]`
91906
+ *
91907
+ * @example
91908
+ * import { fileAdapter } from 'epicenter-libs';
91909
+ * // Delete a specific file
91910
+ * await fileAdapter.remove('models/old-model.py');
91911
+ * // Delete all files at the project root
91912
+ * await fileAdapter.remove();
91913
+ *
91914
+ * @param [filePath] Path of the file or directory to delete; omit to delete all files at the project root
91915
+ * @param [optionals] Optional arguments; pass network call options overrides here.
91916
+ * @returns promise that resolves when the deletion is complete
91917
+ */
91918
+ async function remove(filePath, optionals = {}) {
91919
+ const uriComponent = filePath ? `/${encodePath(filePath)}` : '';
91920
+ return await new Router().delete(`/file${uriComponent}`, optionals).then(({
91921
+ body
91922
+ }) => body);
91923
+ }
91924
+
91925
+ /**
91926
+ * Downloads the raw content of a file at the specified path.
91927
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file/download/{filePath}`
91928
+ *
91929
+ * NOTE: The backend streams the file with its detected content type (e.g. `application/zip`,
91930
+ * `text/plain`, `application/octet-stream`). The shared Router throws when the response
91931
+ * content-type is not `application/json`, so this call only succeeds for JSON files. To download
91932
+ * other file types, use the underlying fetch API directly against the constructed URL.
91933
+ *
91934
+ * @example
91935
+ * import { fileAdapter } from 'epicenter-libs';
91936
+ * const content = await fileAdapter.download('config.json');
91937
+ *
91938
+ * @param filePath Path to the file to download
91939
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
91940
+ * @param [optionals.depth] Currently unused on the backend; reserved for future expansion.
91941
+ * @returns promise that resolves to the raw file content
91942
+ */
91943
+ async function download(filePath, optionals = {}) {
91944
+ const {
91945
+ depth,
91946
+ ...routingOptions
91947
+ } = optionals;
91948
+ return await new Router().withSearchParams({
91949
+ depth
91950
+ }).get(`/file/download/${encodePath(filePath)}`, routingOptions).then(({
91951
+ body
91952
+ }) => body);
91953
+ }
91954
+
91955
+ /**
91956
+ * Lists files and directories matching a glob filter pattern, optionally scoped to a specific path.
91957
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file/filter/{filter}[/{filePath}]`
91958
+ *
91959
+ * @example
91960
+ * import { fileAdapter } from 'epicenter-libs';
91961
+ * // List all Python files in the project
91962
+ * const pyFiles = await fileAdapter.listByFilter('*.py');
91963
+ * // List all Python files within the 'models' directory
91964
+ * const pyFiles = await fileAdapter.listByFilter('*.py', 'models');
91965
+ *
91966
+ * @param filter Glob pattern to filter files by (e.g., '*.py', '*.json')
91967
+ * @param [filePath] Directory path to scope the filter to; omit to search the entire project
91968
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
91969
+ * @param [optionals.depth] Maximum depth of directory traversal to include in the response
91970
+ * @returns promise that resolves to an array of matching file and directory entries
91971
+ */
91972
+ async function listByFilter(filter, filePath, optionals = {}) {
91973
+ const {
91974
+ depth,
91975
+ ...routingOptions
91976
+ } = optionals;
91977
+ const uriComponent = filePath ? `/${encodePath(filePath)}` : '';
91978
+ return await new Router().withSearchParams({
91979
+ depth
91980
+ }).get(`/file/filter/${encodeURIComponent(filter)}${uriComponent}`, routingOptions).then(({
91981
+ body
91982
+ }) => body);
91983
+ }
91984
+
91985
+ /**
91986
+ * Compresses files into a ZIP archive at the project root or at a specific path.
91987
+ * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file/compress[/{filePath}]`
91988
+ *
91989
+ * NOTE: The backend streams the resulting archive with content-type `application/zip`. The
91990
+ * shared Router throws when the response content-type is not `application/json`, so this call
91991
+ * will not return the archive bytes through the normal flow. To retrieve the archive, use the
91992
+ * underlying fetch API directly against the constructed URL.
91993
+ *
91994
+ * @example
91995
+ * import { fileAdapter } from 'epicenter-libs';
91996
+ * // Compress a specific file or directory
91997
+ * await fileAdapter.compress('models');
91998
+ * // Compress at root
91999
+ * await fileAdapter.compress();
92000
+ *
92001
+ * @param [filePath] Path of the file or directory to compress; omit to compress at the project root
92002
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92003
+ * @returns promise that resolves to the compression result
92004
+ */
92005
+ async function compress(filePath, optionals = {}) {
92006
+ const uriComponent = filePath ? `/${encodePath(filePath)}` : '';
92007
+ return await new Router().patch(`/file/compress${uriComponent}`, optionals).then(({
92008
+ body
92009
+ }) => body);
92010
+ }
92011
+
92012
+ /**
92013
+ * Extracts (explodes) a ZIP archive at the project root or at a specific path in place,
92014
+ * deleting the archive after extraction.
92015
+ * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file/explode[/{filePath}]`
92016
+ *
92017
+ * @example
92018
+ * import { fileAdapter } from 'epicenter-libs';
92019
+ * // Extract a specific archive
92020
+ * await fileAdapter.explode('archive.zip');
92021
+ * // Explode at root
92022
+ * await fileAdapter.explode();
92023
+ *
92024
+ * @param [filePath] Path of the archive to extract; omit to extract at the project root
92025
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92026
+ * @returns promise that resolves when the extraction is complete
92027
+ */
92028
+ async function explode(filePath, optionals = {}) {
92029
+ const uriComponent = filePath ? `/${encodePath(filePath)}` : '';
92030
+ return await new Router().patch(`/file/explode${uriComponent}`, optionals).then(({
92031
+ body
92032
+ }) => body);
92033
+ }
92034
+
92035
+ /**
92036
+ * Moves a file or directory from one path to another within the project.
92037
+ * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file/move`
92038
+ *
92039
+ * @example
92040
+ * import { fileAdapter } from 'epicenter-libs';
92041
+ * await fileAdapter.move('models/old-name.py', 'models/new-name.py');
92042
+ * // Move and include the origin directory itself
92043
+ * await fileAdapter.move('old-dir', 'new-dir', { includeOrigin: true });
92044
+ *
92045
+ * @param origin Origin path of the file or directory to move
92046
+ * @param destination Destination path to move the file or directory to
92047
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
92048
+ * @param [optionals.includeOrigin] Whether to include the origin directory itself in the move
92049
+ * @returns promise that resolves when the move is complete
92050
+ */
92051
+ async function move(origin, destination, optionals = {}) {
92052
+ const {
92053
+ includeOrigin,
92054
+ ...routingOptions
92055
+ } = optionals;
92056
+ return await new Router().patch('/file/move', {
92057
+ body: {
92058
+ origin,
92059
+ destination,
92060
+ includeOrigin
92061
+ },
92062
+ ...routingOptions
92063
+ }).then(({
92064
+ body
92065
+ }) => body);
92066
+ }
92067
+
92068
+ /**
92069
+ * Creates a new directory at the specified path.
92070
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file/directory/{filePath}`
92071
+ *
92072
+ * @example
92073
+ * import { fileAdapter } from 'epicenter-libs';
92074
+ * const dir = await fileAdapter.createDirectory('models/new-folder');
92075
+ *
92076
+ * @param filePath Path at which to create the new directory
92077
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92078
+ * @returns promise that resolves to the created directory entry
92079
+ */
92080
+ async function createDirectory(filePath, optionals = {}) {
92081
+ return await new Router().post(`/file/directory/${encodePath(filePath)}`, optionals).then(({
92082
+ body
92083
+ }) => body);
92084
+ }
92085
+
92086
+ var file = /*#__PURE__*/Object.freeze({
92087
+ __proto__: null,
92088
+ compress: compress,
92089
+ create: create$1,
92090
+ createDirectory: createDirectory,
92091
+ download: download,
92092
+ explode: explode,
92093
+ list: list,
92094
+ listByFilter: listByFilter,
92095
+ move: move,
92096
+ remove: remove,
92097
+ upload: upload
92098
+ });
92099
+
92100
+ /**
92101
+ * Currently the API only supports `SAML`. This type is intentionally narrow so that adding new
92102
+ * protocols on the backend requires an explicit type update here.
92103
+ */
92104
+
92105
+ /**
92106
+ * Gets registration info for a self-registration token.
92107
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/self/{token}`
92108
+ *
92109
+ * @example
92110
+ * import { registrationAdapter } from 'epicenter-libs';
92111
+ * const info = await registrationAdapter.getSelfRegistrationInfo('my-token');
92112
+ *
92113
+ * @param token Self-registration token
92114
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92115
+ * @returns promise that resolves to registration info
92116
+ */
92117
+ async function getSelfRegistrationInfo(token, optionals = {}) {
92118
+ return await new Router().get(`/registration/self/${token}`, optionals).then(({
92119
+ body
92120
+ }) => body);
92121
+ }
92122
+
92123
+ /**
92124
+ * Completes a self-registration using a token.
92125
+ * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/self/{token}`
92126
+ *
92127
+ * @example
92128
+ * import { registrationAdapter } from 'epicenter-libs';
92129
+ * const result = await registrationAdapter.completeSelfRegistration('my-token', 'secret123', {
92130
+ * displayName: 'John Doe',
92131
+ * handle: 'johnd',
92132
+ * });
92133
+ *
92134
+ * @param token Self-registration token
92135
+ * @param password Password for the new account
92136
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92137
+ * @param [optionals.displayName] Display name for the new user
92138
+ * @param [optionals.givenName] Given name for the new user
92139
+ * @param [optionals.familyName] Family name for the new user
92140
+ * @param [optionals.handle] Handle for the new user
92141
+ * @returns promise that resolves to the registration result including session info
92142
+ */
92143
+ async function completeSelfRegistration(token, password, optionals = {}) {
92144
+ const {
92145
+ displayName,
92146
+ givenName,
92147
+ familyName,
92148
+ handle,
92149
+ ...routingOptions
92150
+ } = optionals;
92151
+ return await new Router().patch(`/registration/self/${token}`, {
92152
+ body: {
92153
+ password,
92154
+ displayName,
92155
+ givenName,
92156
+ familyName,
92157
+ handle
92158
+ },
92159
+ ...routingOptions
92160
+ }).then(({
92161
+ body
92162
+ }) => body);
92163
+ }
92164
+
92165
+ /**
92166
+ * Sends a self-registration invite email to a user. Pass an `Accept-Language` header via
92167
+ * `optionals.headers` to localize the email.
92168
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/self/{groupKey}`
92169
+ *
92170
+ * @example
92171
+ * import { registrationAdapter } from 'epicenter-libs';
92172
+ * await registrationAdapter.sendSelfRegistrationInvite('group-key', 'user@example.com', {
92173
+ * linkDestination: 'DASHBOARD',
92174
+ * redirectUrl: 'https://app.example.com',
92175
+ * headers: { 'Accept-Language': 'fr-FR' },
92176
+ * });
92177
+ *
92178
+ * @param groupKey Group key to register the user into
92179
+ * @param email Email address of the user to invite
92180
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92181
+ * @param [optionals.linkDestination] Destination for the registration link ('DASHBOARD' or 'MANAGER')
92182
+ * @param [optionals.modality] Registration modality
92183
+ * @param [optionals.redirectUrl] URL to redirect to after registration
92184
+ * @param [optionals.subject] Subject line for the invite email
92185
+ * @param [optionals.givenName] Pre-populate given name in the registration form
92186
+ * @param [optionals.familyName] Pre-populate family name in the registration form
92187
+ * @param [optionals.linkUrl] Custom URL to use for the registration link
92188
+ * @param [optionals.confirmation] Whether to send a confirmation email
92189
+ * @returns promise that resolves to undefined if successful
92190
+ */
92191
+ async function sendSelfRegistrationInvite(groupKey, email, optionals = {}) {
92192
+ const {
92193
+ linkDestination,
92194
+ modality,
92195
+ redirectUrl,
92196
+ subject,
92197
+ givenName,
92198
+ familyName,
92199
+ linkUrl,
92200
+ confirmation,
92201
+ ...routingOptions
92202
+ } = optionals;
92203
+ return await new Router().post(`/registration/self/${groupKey}`, {
92204
+ body: {
92205
+ email,
92206
+ linkDestination,
92207
+ modality,
92208
+ redirectUrl,
92209
+ subject,
92210
+ givenName,
92211
+ familyName,
92212
+ linkUrl,
92213
+ confirmation
92214
+ },
92215
+ ...routingOptions
92216
+ }).then(({
92217
+ body
92218
+ }) => body);
92219
+ }
92220
+
92221
+ /**
92222
+ * Gets registration info for an invite token.
92223
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/invite/{token}`
92224
+ *
92225
+ * @example
92226
+ * import { registrationAdapter } from 'epicenter-libs';
92227
+ * const info = await registrationAdapter.getInviteRegistrationInfo('invite-token');
92228
+ *
92229
+ * @param token Invite registration token
92230
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92231
+ * @returns promise that resolves to registration info
92232
+ */
92233
+ async function getInviteRegistrationInfo(token, optionals = {}) {
92234
+ return await new Router().get(`/registration/invite/${token}`, optionals).then(({
92235
+ body
92236
+ }) => body);
92237
+ }
92238
+
92239
+ /**
92240
+ * Completes an invite registration using a token.
92241
+ * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/invite/{token}`
92242
+ *
92243
+ * @example
92244
+ * import { registrationAdapter } from 'epicenter-libs';
92245
+ * const result = await registrationAdapter.completeInviteRegistration('invite-token', 'pass456', {
92246
+ * displayName: 'Jane Doe',
92247
+ * });
92248
+ *
92249
+ * @param token Invite registration token
92250
+ * @param password Password for the new account
92251
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92252
+ * @param [optionals.displayName] Display name for the new user
92253
+ * @param [optionals.givenName] Given name for the new user
92254
+ * @param [optionals.familyName] Family name for the new user
92255
+ * @param [optionals.handle] Handle for the new user
92256
+ * @returns promise that resolves to the registration result including session info
92257
+ */
92258
+ async function completeInviteRegistration(token, password, optionals = {}) {
92259
+ const {
92260
+ displayName,
92261
+ givenName,
92262
+ familyName,
92263
+ handle,
92264
+ ...routingOptions
92265
+ } = optionals;
92266
+ return await new Router().patch(`/registration/invite/${token}`, {
92267
+ body: {
92268
+ password,
92269
+ displayName,
92270
+ givenName,
92271
+ familyName,
92272
+ handle
92273
+ },
92274
+ ...routingOptions
92275
+ }).then(({
92276
+ body
92277
+ }) => body);
92278
+ }
92279
+
92280
+ /**
92281
+ * Sends an invite registration email to a user. Pass an `Accept-Language` header via
92282
+ * `optionals.headers` to localize the email.
92283
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/invite/{groupKey}`
92284
+ *
92285
+ * @example
92286
+ * import { registrationAdapter } from 'epicenter-libs';
92287
+ * await registrationAdapter.sendInvite('group-key', 'invited@example.com', {
92288
+ * givenName: 'New',
92289
+ * familyName: 'User',
92290
+ * redirectUrl: 'https://app.example.com',
92291
+ * });
92292
+ *
92293
+ * @param groupKey Group key to invite the user into
92294
+ * @param email Email address of the user to invite
92295
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92296
+ * @param [optionals.linkDestination] Destination for the registration link ('DASHBOARD' or 'MANAGER')
92297
+ * @param [optionals.modality] Registration modality
92298
+ * @param [optionals.redirectUrl] URL to redirect to after registration
92299
+ * @param [optionals.subject] Subject line for the invite email
92300
+ * @param [optionals.givenName] Pre-populate given name in the registration form
92301
+ * @param [optionals.familyName] Pre-populate family name in the registration form
92302
+ * @param [optionals.linkUrl] Custom URL to use for the registration link
92303
+ * @param [optionals.confirmation] Whether to send a confirmation email
92304
+ * @returns promise that resolves to undefined if successful
92305
+ */
92306
+ async function sendInvite(groupKey, email, optionals = {}) {
92307
+ const {
92308
+ linkDestination,
92309
+ modality,
92310
+ redirectUrl,
92311
+ subject,
92312
+ givenName,
92313
+ familyName,
92314
+ linkUrl,
92315
+ confirmation,
92316
+ ...routingOptions
92317
+ } = optionals;
92318
+ return await new Router().post(`/registration/invite/${groupKey}`, {
92319
+ body: {
92320
+ email,
92321
+ linkDestination,
92322
+ modality,
92323
+ redirectUrl,
92324
+ subject,
92325
+ givenName,
92326
+ familyName,
92327
+ linkUrl,
92328
+ confirmation
92329
+ },
92330
+ ...routingOptions
92331
+ }).then(({
92332
+ body
92333
+ }) => body);
92334
+ }
92335
+
92336
+ /**
92337
+ * Gets registration info for a team invite token.
92338
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/team/{token}`
92339
+ *
92340
+ * @example
92341
+ * import { registrationAdapter } from 'epicenter-libs';
92342
+ * const info = await registrationAdapter.getTeamRegistrationInfo('team-token');
92343
+ *
92344
+ * @param token Team invite token
92345
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92346
+ * @returns promise that resolves to team registration info
92347
+ */
92348
+ async function getTeamRegistrationInfo(token, optionals = {}) {
92349
+ return await new Router().get(`/registration/team/${token}`, optionals).then(({
92350
+ body
92351
+ }) => body);
92352
+ }
92353
+
92354
+ /**
92355
+ * Sends a team invite email. Pass an `Accept-Language` header via `optionals.headers` to
92356
+ * localize the email.
92357
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/team`
92358
+ *
92359
+ * @example
92360
+ * import { registrationAdapter } from 'epicenter-libs';
92361
+ * await registrationAdapter.sendTeamInvite(
92362
+ * 'Jane Author',
92363
+ * 'AUTHOR',
92364
+ * 'https://app.example.com',
92365
+ * 'newteammate@example.com',
92366
+ * { subject: 'Welcome to the team!' },
92367
+ * );
92368
+ *
92369
+ * @param invitingAuthor Name or identifier of the person sending the invite
92370
+ * @param role Role to assign to the invited user
92371
+ * @param redirectUrl URL to redirect to after accepting the invite
92372
+ * @param email Email address of the user to invite
92373
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92374
+ * @param [optionals.subject] Subject line for the invite email
92375
+ * @param [optionals.givenName] Pre-populate given name for the invited user
92376
+ * @param [optionals.familyName] Pre-populate family name for the invited user
92377
+ * @returns promise that resolves to undefined if successful
92378
+ */
92379
+ async function sendTeamInvite(invitingAuthor, role, redirectUrl, email, optionals = {}) {
92380
+ const {
92381
+ subject,
92382
+ givenName,
92383
+ familyName,
92384
+ ...routingOptions
92385
+ } = optionals;
92386
+ return await new Router().post('/registration/team', {
92387
+ body: {
92388
+ invitingAuthor,
92389
+ role,
92390
+ redirectUrl,
92391
+ email,
92392
+ subject,
92393
+ givenName,
92394
+ familyName
92395
+ },
92396
+ ...routingOptions
92397
+ }).then(({
92398
+ body
92399
+ }) => body);
92400
+ }
92401
+
92402
+ /**
92403
+ * @deprecated Use getSsoAdminRegistration or getSsoUserRegistration instead.
92404
+ * Gets SSO registration info for a given SSO protocol.
92405
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/sso/{ssoProtocol}`
92406
+ *
92407
+ * @example
92408
+ * import { registrationAdapter } from 'epicenter-libs';
92409
+ * const info = await registrationAdapter.getSsoRegistration('SAML');
92410
+ *
92411
+ * @param ssoProtocol The SSO protocol (e.g. 'SAML')
92412
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92413
+ * @returns promise that resolves to SSO registration data
92414
+ */
92415
+ async function getSsoRegistration(ssoProtocol, optionals = {}) {
92416
+ console.warn('DEPRECATION WARNING: registrationAdapter.getSsoRegistration is deprecated and will be removed with the next release. Use registrationAdapter.getSsoAdminRegistration or registrationAdapter.getSsoUserRegistration instead.');
92417
+ return await new Router().get(`/registration/sso/${ssoProtocol}`, optionals).then(({
92418
+ body
92419
+ }) => body);
92420
+ }
92421
+
92422
+ /**
92423
+ * Gets admin SSO registration info for a given SSO protocol.
92424
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/sso/admin/{ssoProtocol}`
92425
+ *
92426
+ * @example
92427
+ * import { registrationAdapter } from 'epicenter-libs';
92428
+ * const info = await registrationAdapter.getSsoAdminRegistration('SAML');
92429
+ *
92430
+ * @param ssoProtocol The SSO protocol (e.g. 'SAML')
92431
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92432
+ * @returns promise that resolves to SSO admin registration data
92433
+ */
92434
+ async function getSsoAdminRegistration(ssoProtocol, optionals = {}) {
92435
+ return await new Router().get(`/registration/sso/admin/${ssoProtocol}`, optionals).then(({
92436
+ body
92437
+ }) => body);
92438
+ }
92439
+
92440
+ /**
92441
+ * Gets user SSO registration info for a given SSO protocol.
92442
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/sso/user/{ssoProtocol}`
92443
+ *
92444
+ * @example
92445
+ * import { registrationAdapter } from 'epicenter-libs';
92446
+ * const info = await registrationAdapter.getSsoUserRegistration('SAML');
92447
+ *
92448
+ * @param ssoProtocol The SSO protocol (e.g. 'SAML')
92449
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92450
+ * @returns promise that resolves to SSO user registration data
92451
+ */
92452
+ async function getSsoUserRegistration(ssoProtocol, optionals = {}) {
92453
+ return await new Router().get(`/registration/sso/user/${ssoProtocol}`, optionals).then(({
92454
+ body
92455
+ }) => body);
92456
+ }
92457
+
92458
+ var registration = /*#__PURE__*/Object.freeze({
92459
+ __proto__: null,
92460
+ completeInviteRegistration: completeInviteRegistration,
92461
+ completeSelfRegistration: completeSelfRegistration,
92462
+ getInviteRegistrationInfo: getInviteRegistrationInfo,
92463
+ getSelfRegistrationInfo: getSelfRegistrationInfo,
92464
+ getSsoAdminRegistration: getSsoAdminRegistration,
92465
+ getSsoRegistration: getSsoRegistration,
92466
+ getSsoUserRegistration: getSsoUserRegistration,
92467
+ getTeamRegistrationInfo: getTeamRegistrationInfo,
92468
+ sendInvite: sendInvite,
92469
+ sendSelfRegistrationInvite: sendSelfRegistrationInvite,
92470
+ sendTeamInvite: sendTeamInvite
92471
+ });
92472
+
92473
+ /**
92474
+ * Creates a new docket entry, scheduling a deferred operation for later execution.
92475
+ * Requires `support` level authorization.
92476
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/docket`
92477
+ *
92478
+ * @example
92479
+ * import { docketAdapter } from 'epicenter-libs';
92480
+ * const docket = await docketAdapter.create(
92481
+ * {
92482
+ * objectType: 'scale',
92483
+ * operatingSystem: 'LINUX',
92484
+ * workerShape: 'GS',
92485
+ * scale: {
92486
+ * active: true,
92487
+ * initialWorkerCount: 1,
92488
+ * additionalWorkerLimit: 4,
92489
+ * flavors: ['DOCKER'],
92490
+ * },
92491
+ * },
92492
+ * { objectType: 'date', value: '2026-06-01T00:00:00Z' },
92493
+ * '2026-05-20T00:00:00Z',
92494
+ * { ttlMinutes: 60 },
92495
+ * );
92496
+ *
92497
+ * @param payload Docket payload describing the operation to schedule
92498
+ * @param trigger Trigger describing when the operation should fire
92499
+ * (cron, date, or offset)
92500
+ * @param date ISO-8601 date string indicating when the docket is scheduled
92501
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
92502
+ * @param [optionals.ttlMinutes] Time-to-live in minutes for the docket entry (minimum 2)
92503
+ * @returns promise that resolves to the newly created docket
92504
+ */
92505
+ async function create(payload, trigger, date, optionals = {}) {
92506
+ const {
92507
+ ttlMinutes,
92508
+ ...routingOptions
92509
+ } = optionals;
92510
+ return await new Router().post('/docket', {
92511
+ body: {
92512
+ payload,
92513
+ trigger,
92514
+ date,
92515
+ ttlMinutes
92516
+ },
92517
+ ...routingOptions
92518
+ }).then(({
92519
+ body
92520
+ }) => body);
92521
+ }
92522
+
92523
+ var docket = /*#__PURE__*/Object.freeze({
92524
+ __proto__: null,
92525
+ create: create
92526
+ });
92527
+
91528
92528
  // Generic type for push channel message custom data
91529
92529
 
91530
92530
  // Base structure for channel push messages
@@ -91715,6 +92715,367 @@ class Channel {
91715
92715
  }
91716
92716
  }
91717
92717
 
92718
+ // ──────────────────────────────────────────────
92719
+ // Types
92720
+ // ──────────────────────────────────────────────
92721
+
92722
+ // ──────────────────────────────────────────────
92723
+ // Functions
92724
+ // ──────────────────────────────────────────────
92725
+
92726
+ /**
92727
+ * Retrieves the git integration configuration for the project.
92728
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git`
92729
+ *
92730
+ * @example
92731
+ * import { gitAdapter } from 'epicenter-libs';
92732
+ * const integration = await gitAdapter.get();
92733
+ *
92734
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92735
+ * @returns promise that resolves to the git integration configuration
92736
+ */
92737
+ async function get(optionals = {}) {
92738
+ return new Router().get('/git', optionals).then(({
92739
+ body
92740
+ }) => body);
92741
+ }
92742
+
92743
+ /**
92744
+ * Retrieves the current git status for the project.
92745
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/status`
92746
+ *
92747
+ * @example
92748
+ * import { gitAdapter } from 'epicenter-libs';
92749
+ * const status = await gitAdapter.getStatus();
92750
+ * console.log(status.currentBranch);
92751
+ *
92752
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92753
+ * @returns promise that resolves to the git status, including the current branch
92754
+ */
92755
+ async function getStatus(optionals = {}) {
92756
+ return new Router().get('/git/status', optionals).then(({
92757
+ body
92758
+ }) => body);
92759
+ }
92760
+
92761
+ /**
92762
+ * Checks out a branch in the project's git repository.
92763
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/checkout/{branch}`
92764
+ *
92765
+ * @example
92766
+ * import { gitAdapter } from 'epicenter-libs';
92767
+ * await gitAdapter.checkout('main');
92768
+ *
92769
+ * @param branch Name of the branch to check out
92770
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92771
+ * @returns promise that resolves when the checkout is complete
92772
+ */
92773
+ async function checkout(branch, optionals = {}) {
92774
+ return new Router().get(`/git/checkout/${branch}`, optionals).then(({
92775
+ body
92776
+ }) => body);
92777
+ }
92778
+
92779
+ /**
92780
+ * Resets the project's git repository, optionally to a specific branch.
92781
+ * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/reset[/{branch}]`
92782
+ *
92783
+ * @example
92784
+ * import { gitAdapter } from 'epicenter-libs';
92785
+ * await gitAdapter.reset(); // reset current branch
92786
+ * await gitAdapter.reset({ branch: 'main' }); // reset to 'main'
92787
+ *
92788
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
92789
+ * @param [optionals.branch] Branch to reset to; if omitted, resets the current branch
92790
+ * @returns promise that resolves when the reset is complete
92791
+ */
92792
+ async function reset(optionals = {}) {
92793
+ const {
92794
+ branch,
92795
+ ...routingOptions
92796
+ } = optionals;
92797
+ return new Router().delete(`/git/reset${branch ? `/${branch}` : ''}`, routingOptions).then(({
92798
+ body
92799
+ }) => body);
92800
+ }
92801
+
92802
+ /**
92803
+ * Creates a git integration for the project.
92804
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/integration`
92805
+ *
92806
+ * @example
92807
+ * import { gitAdapter } from 'epicenter-libs';
92808
+ * const integration = await gitAdapter.createIntegration({
92809
+ * uri: 'git@github.com:myorg/myrepo.git',
92810
+ * publicKey: '...',
92811
+ * privateKey: '...',
92812
+ * publicKeySpec: 'openssh',
92813
+ * privateKeySpec: 'pkcs8',
92814
+ * algorithm: 'ed25519',
92815
+ * });
92816
+ *
92817
+ * @param integration Git integration configuration to create
92818
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92819
+ * @returns promise that resolves to the created git integration
92820
+ */
92821
+ async function createIntegration(integration, optionals = {}) {
92822
+ return new Router().post('/git/integration', {
92823
+ body: integration,
92824
+ ...optionals
92825
+ }).then(({
92826
+ body
92827
+ }) => body);
92828
+ }
92829
+
92830
+ /**
92831
+ * Updates the git integration for the project.
92832
+ * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/integration`
92833
+ *
92834
+ * @example
92835
+ * import { gitAdapter } from 'epicenter-libs';
92836
+ * const integration = await gitAdapter.updateIntegration({
92837
+ * uri: 'git@github.com:myorg/newrepo.git',
92838
+ * publicKeySpec: 'openssh',
92839
+ * privateKeySpec: 'pkcs8',
92840
+ * algorithm: 'ed25519',
92841
+ * });
92842
+ *
92843
+ * @param integration Fields to update on the git integration
92844
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92845
+ * @returns promise that resolves to the updated git integration
92846
+ */
92847
+ async function updateIntegration(integration, optionals = {}) {
92848
+ return new Router().patch('/git/integration', {
92849
+ body: integration,
92850
+ ...optionals
92851
+ }).then(({
92852
+ body
92853
+ }) => body);
92854
+ }
92855
+
92856
+ /**
92857
+ * Removes the git integration for the project.
92858
+ * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/integration`
92859
+ *
92860
+ * @example
92861
+ * import { gitAdapter } from 'epicenter-libs';
92862
+ * await gitAdapter.removeIntegration();
92863
+ *
92864
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92865
+ * @returns promise that resolves when the integration is removed
92866
+ */
92867
+ async function removeIntegration(optionals = {}) {
92868
+ return new Router().delete('/git/integration', optionals).then(({
92869
+ body
92870
+ }) => body);
92871
+ }
92872
+
92873
+ /**
92874
+ * Pushes local commits to the remote git repository.
92875
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/push`
92876
+ *
92877
+ * @example
92878
+ * import { gitAdapter } from 'epicenter-libs';
92879
+ * await gitAdapter.push({ message: 'Update simulation data' });
92880
+ *
92881
+ * @param optionals Arguments object; also accepts network call option overrides.
92882
+ * @param optionals.message Commit message (required)
92883
+ * @param [optionals.password] Password for authentication
92884
+ * @param [optionals.force] Force-push, bypassing non-fast-forward checks
92885
+ * @returns promise that resolves when the push is complete
92886
+ */
92887
+ async function push(optionals) {
92888
+ const {
92889
+ message,
92890
+ password,
92891
+ force,
92892
+ ...routingOptions
92893
+ } = optionals;
92894
+ return new Router().withSearchParams({
92895
+ force
92896
+ }).post('/git/push', {
92897
+ body: {
92898
+ message,
92899
+ password
92900
+ },
92901
+ ...routingOptions
92902
+ }).then(({
92903
+ body
92904
+ }) => body);
92905
+ }
92906
+
92907
+ /**
92908
+ * Pulls changes from the remote git repository into the project.
92909
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/pull`
92910
+ *
92911
+ * @example
92912
+ * import { gitAdapter } from 'epicenter-libs';
92913
+ * await gitAdapter.pull({ force: true, confirm: true });
92914
+ *
92915
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
92916
+ * @param [optionals.password] Password for authentication
92917
+ * @param [optionals.force] Force the pull, overwriting local changes
92918
+ * @param [optionals.confirm] Set the `X-Forio-Confirmation` header to confirm an overwrite
92919
+ * @returns promise that resolves when the pull is complete
92920
+ */
92921
+ async function pull(optionals = {}) {
92922
+ const {
92923
+ password,
92924
+ force,
92925
+ confirm,
92926
+ headers: headersOverride,
92927
+ ...routingOptions
92928
+ } = optionals;
92929
+ const headers = Object.assign({}, headersOverride, confirm ? {
92930
+ 'X-Forio-Confirmation': true
92931
+ } : {});
92932
+ return new Router().withSearchParams({
92933
+ force
92934
+ }).post('/git/pull', {
92935
+ body: {
92936
+ password
92937
+ },
92938
+ headers,
92939
+ ...routingOptions
92940
+ }).then(({
92941
+ body
92942
+ }) => body);
92943
+ }
92944
+
92945
+ var git = /*#__PURE__*/Object.freeze({
92946
+ __proto__: null,
92947
+ checkout: checkout,
92948
+ createIntegration: createIntegration,
92949
+ get: get,
92950
+ getStatus: getStatus,
92951
+ pull: pull,
92952
+ push: push,
92953
+ removeIntegration: removeIntegration,
92954
+ reset: reset,
92955
+ updateIntegration: updateIntegration
92956
+ });
92957
+
92958
+ // ──────────────────────────────────────────────
92959
+ // Data Points
92960
+ // ──────────────────────────────────────────────
92961
+
92962
+ // ──────────────────────────────────────────────
92963
+ // Chart Series
92964
+ // ──────────────────────────────────────────────
92965
+
92966
+ // ──────────────────────────────────────────────
92967
+ // Chart, Table, Picture
92968
+ // ──────────────────────────────────────────────
92969
+
92970
+ // ──────────────────────────────────────────────
92971
+ // Binary Data
92972
+ // ──────────────────────────────────────────────
92973
+
92974
+ // ──────────────────────────────────────────────
92975
+ // Environment, Slide, Document
92976
+ // ──────────────────────────────────────────────
92977
+
92978
+ /**
92979
+ * Generates a PowerPoint file from a template and returns it as binary data (JSON-encoded)
92980
+ * Base URL: PUT `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/powerpoint/{TEMPLATE_DIRECTORY}/{TEMPLATE_PATH}`
92981
+ *
92982
+ * @example
92983
+ * import { powerpointAdapter } from 'epicenter-libs';
92984
+ * const binaryData = await powerpointAdapter.generate('MODEL', 'en-US-debrief-template.pptx', {
92985
+ * output: 'debrief-slides.pptx',
92986
+ * environment: {},
92987
+ * slides: [
92988
+ * {
92989
+ * number: 1,
92990
+ * environment: {
92991
+ * tables: [{ name: 'Leaderboard', data: [['Rank', 'Name', 'Score']] }],
92992
+ * },
92993
+ * },
92994
+ * ],
92995
+ * });
92996
+ *
92997
+ * @param templateDirectory Directory where the template is stored: 'DATA' or 'MODEL'
92998
+ * @param templatePath Path to the template file within the directory
92999
+ * @param document Document shadow defining the output filename, environment, and slides
93000
+ * @param [optionals] Optional arguments; pass network call options overrides here.
93001
+ * @returns promise that resolves to the generated PowerPoint as BinaryData
93002
+ */
93003
+ async function generate(templateDirectory, templatePath, document, optionals = {}) {
93004
+ return new Router().put(`/powerpoint/${templateDirectory}/${templatePath}`, {
93005
+ body: document,
93006
+ ...optionals
93007
+ }).then(({
93008
+ body
93009
+ }) => body);
93010
+ }
93011
+
93012
+ /**
93013
+ * Generates a PowerPoint file from a template and returns it as a streaming response.
93014
+ * Useful for downloading the generated file directly.
93015
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/powerpoint/{TEMPLATE_DIRECTORY}/{TEMPLATE_PATH}`
93016
+ *
93017
+ * @example
93018
+ * import { powerpointAdapter } from 'epicenter-libs';
93019
+ * const response = await powerpointAdapter.stream('MODEL', 'en-US-debrief-template.pptx', {
93020
+ * output: 'debrief-slides.pptx',
93021
+ * environment: {},
93022
+ * slides: [],
93023
+ * });
93024
+ * const blob = await response.blob();
93025
+ *
93026
+ * @param templateDirectory Directory where the template is stored: 'DATA' or 'MODEL'
93027
+ * @param templatePath Path to the template file within the directory
93028
+ * @param document Document shadow defining the output filename, environment, and slides
93029
+ * @param [optionals] Optional arguments; pass network call options overrides here.
93030
+ * @returns promise that resolves to the raw Response for streaming/blob handling
93031
+ */
93032
+ async function stream(templateDirectory, templatePath, document, optionals = {}) {
93033
+ const {
93034
+ server,
93035
+ accountShortName,
93036
+ projectShortName,
93037
+ useProjectProxy,
93038
+ query,
93039
+ headers: headersOverride,
93040
+ authorization,
93041
+ includeAuthorization
93042
+ } = optionals;
93043
+ const url = new Router().getURL(`/powerpoint/${templateDirectory}/${templatePath}`, {
93044
+ server,
93045
+ accountShortName,
93046
+ projectShortName,
93047
+ useProjectProxy,
93048
+ query
93049
+ });
93050
+ const headers = {
93051
+ 'Content-type': 'application/json; charset=UTF-8',
93052
+ ...headersOverride
93053
+ };
93054
+ if (includeAuthorization !== false) {
93055
+ const {
93056
+ session
93057
+ } = identification;
93058
+ if (!headers.Authorization) {
93059
+ if (session) headers.Authorization = `Bearer ${session.token}`;
93060
+ if (authorization) headers.Authorization = authorization;
93061
+ if (config.authOverride) headers.Authorization = config.authOverride;
93062
+ }
93063
+ }
93064
+ return fetch(url.toString(), {
93065
+ method: 'POST',
93066
+ cache: 'no-cache',
93067
+ redirect: 'follow',
93068
+ headers,
93069
+ body: JSON.stringify(document)
93070
+ });
93071
+ }
93072
+
93073
+ var powerpoint = /*#__PURE__*/Object.freeze({
93074
+ __proto__: null,
93075
+ generate: generate,
93076
+ stream: stream
93077
+ });
93078
+
91718
93079
  const proxy = async (resource, options) => {
91719
93080
  const {
91720
93081
  accountShortName,
@@ -91732,9 +93093,9 @@ var utilities = /*#__PURE__*/Object.freeze({
91732
93093
  proxy: proxy
91733
93094
  });
91734
93095
 
91735
- /* yes, this string template literal is weird;
91736
- * it's cause rollup does not recogize 3.34.2 as an individual token otherwise */
91737
- const version = `Epicenter (v${'3.34.2'}) for Module | Build Date: 2026-04-01T19:37:08.284Z`;
93096
+ /* "3.35.1", "Module" and "2026-09-24T20:47:51.952Z" are injected at build time — by
93097
+ * @rollup/plugin-replace for the shipped bundles and by Vite's `define` for tests */
93098
+ const version = `Epicenter (v${"3.35.1"}) for ${"Module"} | Build Date: ${"2026-09-24T20:47:51.952Z"}`;
91738
93099
  const UNAUTHORIZED = 401;
91739
93100
  const FORBIDDEN = 403;
91740
93101
  const DEFAULT_ERROR_HANDLERS = {};
@@ -91800,15 +93161,22 @@ exports.cometdAdapter = cometdAdapter;
91800
93161
  exports.config = config;
91801
93162
  exports.consensusAdapter = consensus;
91802
93163
  exports.dailyAdapter = daily;
93164
+ exports.docketAdapter = docket;
91803
93165
  exports.emailAdapter = email;
93166
+ exports.encyclopediaAdapter = encyclopedia;
91804
93167
  exports.episodeAdapter = episode;
91805
93168
  exports.errorManager = errorManager;
93169
+ exports.fileAdapter = file;
93170
+ exports.gitAdapter = git;
91806
93171
  exports.groupAdapter = group;
91807
93172
  exports.leaderboardAdapter = leaderboard;
91808
93173
  exports.matchmakerAdapter = matchmaker;
93174
+ exports.pipelineAdapter = pipeline;
93175
+ exports.powerpointAdapter = powerpoint;
91809
93176
  exports.presenceAdapter = presence;
91810
93177
  exports.projectAdapter = project;
91811
93178
  exports.recaptchaAdapter = recaptcha;
93179
+ exports.registrationAdapter = registration;
91812
93180
  exports.runAdapter = run;
91813
93181
  exports.somebodyAdapter = somebody;
91814
93182
  exports.taskAdapter = task;