epicenter-libs 3.34.1 → 3.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +61 -86
  3. package/dist/browser/epicenter.js +1586 -230
  4. package/dist/browser/epicenter.js.map +1 -1
  5. package/dist/cjs/epicenter.js +1508 -145
  6. package/dist/cjs/epicenter.js.map +1 -1
  7. package/dist/cjs/package.json +1 -0
  8. package/dist/epicenter.js +1592 -229
  9. package/dist/epicenter.js.map +1 -1
  10. package/dist/epicenter.min.js +1 -1
  11. package/dist/epicenter.min.js.map +1 -1
  12. package/dist/module/epicenter.js +1502 -146
  13. package/dist/module/epicenter.js.map +1 -1
  14. package/dist/types/adapters/docket.d.ts +80 -0
  15. package/dist/types/adapters/encyclopedia.d.ts +86 -0
  16. package/dist/types/adapters/file.d.ts +201 -0
  17. package/dist/types/adapters/git.d.ts +171 -0
  18. package/dist/types/adapters/index.d.ts +8 -1
  19. package/dist/types/adapters/pipeline.d.ts +88 -0
  20. package/dist/types/adapters/powerpoint.d.ts +130 -0
  21. package/dist/types/adapters/registration.d.ts +270 -0
  22. package/dist/types/adapters/task.d.ts +99 -37
  23. package/dist/types/epicenter.d.ts +2 -2
  24. package/dist/types/types.d.ts +6 -1
  25. package/dist/types/utils/router.d.ts +1 -0
  26. package/package.json +12 -7
  27. package/src/adapters/docket.ts +109 -0
  28. package/src/adapters/encyclopedia.ts +128 -0
  29. package/src/adapters/file.ts +332 -0
  30. package/src/adapters/git.ts +278 -0
  31. package/src/adapters/index.ts +14 -0
  32. package/src/adapters/pipeline.ts +145 -0
  33. package/src/adapters/powerpoint.ts +238 -0
  34. package/src/adapters/registration.ts +413 -0
  35. package/src/adapters/task.ts +170 -47
  36. package/src/epicenter.ts +10 -3
  37. package/src/globals.d.ts +6 -0
  38. package/src/types.ts +61 -0
  39. package/src/utils/config.ts +5 -4
  40. package/src/utils/router.ts +1 -0
@@ -53,7 +53,7 @@ function requireRuntime () {
53
53
  if (hasRequiredRuntime) return runtime.exports;
54
54
  hasRequiredRuntime = 1;
55
55
  (function (module) {
56
- var runtime = (function (exports$1) {
56
+ var runtime = (function (exports) {
57
57
 
58
58
  var Op = Object.prototype;
59
59
  var hasOwn = Op.hasOwnProperty;
@@ -94,7 +94,7 @@ function requireRuntime () {
94
94
 
95
95
  return generator;
96
96
  }
97
- exports$1.wrap = wrap;
97
+ exports.wrap = wrap;
98
98
 
99
99
  // Try/catch helper to minimize deoptimizations. Returns a completion
100
100
  // record like context.tryEntries[i].completion. This interface could
@@ -173,7 +173,7 @@ function requireRuntime () {
173
173
  });
174
174
  }
175
175
 
176
- exports$1.isGeneratorFunction = function(genFun) {
176
+ exports.isGeneratorFunction = function(genFun) {
177
177
  var ctor = typeof genFun === "function" && genFun.constructor;
178
178
  return ctor
179
179
  ? ctor === GeneratorFunction ||
@@ -183,7 +183,7 @@ function requireRuntime () {
183
183
  : false;
184
184
  };
185
185
 
186
- exports$1.mark = function(genFun) {
186
+ exports.mark = function(genFun) {
187
187
  if (Object.setPrototypeOf) {
188
188
  Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
189
189
  } else {
@@ -198,7 +198,7 @@ function requireRuntime () {
198
198
  // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
199
199
  // `hasOwn.call(value, "__await")` to determine if the yielded value is
200
200
  // meant to be awaited.
201
- exports$1.awrap = function(arg) {
201
+ exports.awrap = function(arg) {
202
202
  return { __await: arg };
203
203
  };
204
204
 
@@ -273,12 +273,12 @@ function requireRuntime () {
273
273
  define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
274
274
  return this;
275
275
  });
276
- exports$1.AsyncIterator = AsyncIterator;
276
+ exports.AsyncIterator = AsyncIterator;
277
277
 
278
278
  // Note that simple async functions are implemented on top of
279
279
  // AsyncIterator objects; they just return a Promise for the value of
280
280
  // the final result produced by the iterator.
281
- exports$1.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
281
+ exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
282
282
  if (PromiseImpl === void 0) PromiseImpl = Promise;
283
283
 
284
284
  var iter = new AsyncIterator(
@@ -286,7 +286,7 @@ function requireRuntime () {
286
286
  PromiseImpl
287
287
  );
288
288
 
289
- return exports$1.isGeneratorFunction(outerFn)
289
+ return exports.isGeneratorFunction(outerFn)
290
290
  ? iter // If outerFn is a generator, return the full iterator.
291
291
  : iter.next().then(function(result) {
292
292
  return result.done ? result.value : iter.next();
@@ -506,7 +506,7 @@ function requireRuntime () {
506
506
  this.reset(true);
507
507
  }
508
508
 
509
- exports$1.keys = function(val) {
509
+ exports.keys = function(val) {
510
510
  var object = Object(val);
511
511
  var keys = [];
512
512
  for (var key in object) {
@@ -567,7 +567,7 @@ function requireRuntime () {
567
567
 
568
568
  throw new TypeError(typeof iterable + " is not iterable");
569
569
  }
570
- exports$1.values = values;
570
+ exports.values = values;
571
571
 
572
572
  function doneResult() {
573
573
  return { value: undefined$1, done: true };
@@ -777,7 +777,7 @@ function requireRuntime () {
777
777
  // or not, return the runtime object so that we can declare the variable
778
778
  // regeneratorRuntime in the outer scope, which allows this module to be
779
779
  // injected easily by `bin/regenerator --include-runtime script.js`.
780
- return exports$1;
780
+ return exports;
781
781
 
782
782
  }(
783
783
  // If this script is executing as a CommonJS module, use module.exports
@@ -82457,7 +82457,7 @@ var hasRequiredNodePonyfill;
82457
82457
  function requireNodePonyfill () {
82458
82458
  if (hasRequiredNodePonyfill) return nodePonyfill.exports;
82459
82459
  hasRequiredNodePonyfill = 1;
82460
- (function (module, exports$1) {
82460
+ (function (module, exports) {
82461
82461
  const nodeFetch = require$$0;
82462
82462
  const realFetch = nodeFetch.default || nodeFetch;
82463
82463
 
@@ -82472,14 +82472,14 @@ function requireNodePonyfill () {
82472
82472
 
82473
82473
  fetch.ponyfill = true;
82474
82474
 
82475
- module.exports = exports$1 = fetch;
82476
- exports$1.fetch = fetch;
82477
- exports$1.Headers = nodeFetch.Headers;
82478
- exports$1.Request = nodeFetch.Request;
82479
- exports$1.Response = nodeFetch.Response;
82475
+ module.exports = exports = fetch;
82476
+ exports.fetch = fetch;
82477
+ exports.Headers = nodeFetch.Headers;
82478
+ exports.Request = nodeFetch.Request;
82479
+ exports.Response = nodeFetch.Response;
82480
82480
 
82481
82481
  // Needed for TypeScript consumers without esModuleInterop.
82482
- exports$1.default = fetch;
82482
+ exports.default = fetch;
82483
82483
  } (nodePonyfill, nodePonyfill.exports));
82484
82484
  return nodePonyfill.exports;
82485
82485
  }
@@ -83022,11 +83022,12 @@ class Config {
83022
83022
  return this._apiProtocol;
83023
83023
  }
83024
83024
  set apiProtocol(apiProtocol) {
83025
- if (!apiProtocol.startsWith('http')) return;
83026
- if (apiProtocol.endsWith(':')) {
83027
- apiProtocol = apiProtocol.slice(0, -1);
83025
+ let proto = apiProtocol.toLowerCase();
83026
+ if (!proto.startsWith('http')) return;
83027
+ if (proto.endsWith(':')) {
83028
+ proto = proto.slice(0, -1);
83028
83029
  }
83029
- this._apiProtocol = apiProtocol;
83030
+ this._apiProtocol = proto;
83030
83031
  }
83031
83032
 
83032
83033
  /**
@@ -84284,7 +84285,7 @@ async function channelsEnabled(optionals = {}) {
84284
84285
  * @param [optionals] Optional arguments; pass network call options overrides here.
84285
84286
  * @returns promise that resolves to the project object
84286
84287
  */
84287
- async function get$e(optionals = {}) {
84288
+ async function get$f(optionals = {}) {
84288
84289
  return await new Router().get('/project', optionals).then(({
84289
84290
  body
84290
84291
  }) => body);
@@ -84302,7 +84303,7 @@ async function get$e(optionals = {}) {
84302
84303
  * @param [optionals] Optional arguments; pass network call options overrides here.
84303
84304
  * @returns promise that resolves to an array of project objects
84304
84305
  */
84305
- async function list$4(accountShortName, optionals = {}) {
84306
+ async function list$5(accountShortName, optionals = {}) {
84306
84307
  return await new Router().withAccountShortName(accountShortName).withProjectShortName('manager').get('/project/in', optionals).then(({
84307
84308
  body
84308
84309
  }) => body);
@@ -84315,8 +84316,8 @@ var project = /*#__PURE__*/Object.freeze({
84315
84316
  PHYLOGENY: PHYLOGENY,
84316
84317
  WORKER_PARTITION: WORKER_PARTITION,
84317
84318
  channelsEnabled: channelsEnabled,
84318
- get: get$e,
84319
- list: list$4
84319
+ get: get$f,
84320
+ list: list$5
84320
84321
  });
84321
84322
 
84322
84323
  const AUTH_TOKEN_KEY = 'com.forio.epicenter.token';
@@ -84383,7 +84384,7 @@ class CometdAdapter {
84383
84384
  logLevel: 'warn'
84384
84385
  }) {
84385
84386
  var _project$channelProto;
84386
- const project = await get$e();
84387
+ const project = await get$f();
84387
84388
  if (!project.channelEnabled) throw new EpicenterError('Push Channels are not enabled on this project');
84388
84389
  const channelProtocol = ((_project$channelProto = project.channelProtocol) === null || _project$channelProto === void 0 ? void 0 : _project$channelProto.toLowerCase()) || DEFAULT_CHANNEL_PROTOCOL;
84389
84390
  const {
@@ -85203,7 +85204,7 @@ var authentication = /*#__PURE__*/Object.freeze({
85203
85204
  * @param [optionals.tokenAccessSeconds] How long the presigned URL is valid for in seconds
85204
85205
  * @returns promise that resolves to an asset ticket containing the presigned upload URL
85205
85206
  */
85206
- async function create$a(file, scope, optionals = {}) {
85207
+ async function create$c(file, scope, optionals = {}) {
85207
85208
  const {
85208
85209
  scopeBoundary,
85209
85210
  scopeKey,
@@ -85308,7 +85309,7 @@ async function update$6(file, scope, optionals = {}) {
85308
85309
  * @param [optionals] Optional arguments; pass network call options overrides here.
85309
85310
  * @returns promise that resolves when the asset is deleted
85310
85311
  */
85311
- async function remove$4(assetKey, optionals = {}) {
85312
+ async function remove$5(assetKey, optionals = {}) {
85312
85313
  return await new Router().delete(`/asset/${assetKey}`, optionals).then(({
85313
85314
  body
85314
85315
  }) => body);
@@ -85356,7 +85357,7 @@ async function removeFromScope(scope, optionals = {}) {
85356
85357
  * @param [optionals] Optional arguments; pass network call options overrides here.
85357
85358
  * @returns promise that resolves to the asset metadata
85358
85359
  */
85359
- async function get$d(assetKey, optionals = {}) {
85360
+ async function get$e(assetKey, optionals = {}) {
85360
85361
  const {
85361
85362
  server,
85362
85363
  accountShortName,
@@ -85392,7 +85393,7 @@ async function get$d(assetKey, optionals = {}) {
85392
85393
  * @param [optionals.filter] File pattern to filter assets (e.g., '*.pdf' for PDF files); defaults to '*' (all files)
85393
85394
  * @returns promise that resolves to a list of assets
85394
85395
  */
85395
- async function list$3(scope, optionals = {}) {
85396
+ async function list$4(scope, optionals = {}) {
85396
85397
  const {
85397
85398
  scopeBoundary,
85398
85399
  scopeKey,
@@ -85485,7 +85486,7 @@ async function getURLWithScope(file, scope, optionals = {}) {
85485
85486
  * @param [optionals.tokenAccessSeconds] How long the presigned URL is valid for in seconds
85486
85487
  * @returns promise that resolves when the download is complete
85487
85488
  */
85488
- async function download$1(assetKey, optionals = {}) {
85489
+ async function download$2(assetKey, optionals = {}) {
85489
85490
  const {
85490
85491
  tokenAccessSeconds,
85491
85492
  ...routingOptions
@@ -85573,7 +85574,7 @@ async function store(file, scope, optionals = {}) {
85573
85574
  const name = fileName !== null && fileName !== void 0 ? fileName : file.name;
85574
85575
  let presignedUrl = '';
85575
85576
  try {
85576
- const response = await create$a(name, scope, {
85577
+ const response = await create$c(name, scope, {
85577
85578
  inert: true,
85578
85579
  ...remaining
85579
85580
  });
@@ -85597,14 +85598,14 @@ async function store(file, scope, optionals = {}) {
85597
85598
 
85598
85599
  var asset = /*#__PURE__*/Object.freeze({
85599
85600
  __proto__: null,
85600
- create: create$a,
85601
- download: download$1,
85601
+ create: create$c,
85602
+ download: download$2,
85602
85603
  downloadWithScope: downloadWithScope,
85603
- get: get$d,
85604
+ get: get$e,
85604
85605
  getURL: getURL$1,
85605
85606
  getURLWithScope: getURLWithScope,
85606
- list: list$3,
85607
- remove: remove$4,
85607
+ list: list$4,
85608
+ remove: remove$5,
85608
85609
  removeFromScope: removeFromScope,
85609
85610
  store: store,
85610
85611
  update: update$6
@@ -85812,7 +85813,7 @@ var email = /*#__PURE__*/Object.freeze({
85812
85813
  * @param [optionals.category] Optional argument to allow for establishing episode hierarchies
85813
85814
  * @returns promise that resolves to the newly created episode
85814
85815
  */
85815
- async function create$9(name, groupName, optionals = {}) {
85816
+ async function create$b(name, groupName, optionals = {}) {
85816
85817
  const {
85817
85818
  draft,
85818
85819
  runLimit,
@@ -85844,7 +85845,7 @@ async function create$9(name, groupName, optionals = {}) {
85844
85845
  * @param [optionals] Optional arguments; pass network call options overrides here.
85845
85846
  * @returns promise that resolves to an episode
85846
85847
  */
85847
- async function get$c(episodeKey, optionals = {}) {
85848
+ async function get$d(episodeKey, optionals = {}) {
85848
85849
  return await new Router().get(`/episode/${episodeKey}`, optionals).then(({
85849
85850
  body
85850
85851
  }) => body);
@@ -85880,7 +85881,7 @@ async function get$c(episodeKey, optionals = {}) {
85880
85881
  * @param [optionals] Optional arguments; pass network call options overrides here.
85881
85882
  * @returns promise that resolves to a page of episodes
85882
85883
  */
85883
- async function query$4(searchOptions, optionals = {}) {
85884
+ async function query$5(searchOptions, optionals = {}) {
85884
85885
  const {
85885
85886
  filter,
85886
85887
  sort = [],
@@ -85954,7 +85955,7 @@ async function withName(name, optionals = {}) {
85954
85955
  * @param [optionals] Optional arguments; pass network call options overrides here.
85955
85956
  * @returns promise that resolves to undefined if successful
85956
85957
  */
85957
- async function remove$3(episodeKey, optionals = {}) {
85958
+ async function remove$4(episodeKey, optionals = {}) {
85958
85959
  return await new Router().delete(`/episode/${episodeKey}`, optionals).then(({
85959
85960
  body
85960
85961
  }) => body);
@@ -85962,11 +85963,11 @@ async function remove$3(episodeKey, optionals = {}) {
85962
85963
 
85963
85964
  var episode = /*#__PURE__*/Object.freeze({
85964
85965
  __proto__: null,
85965
- create: create$9,
85966
+ create: create$b,
85966
85967
  forGroup: forGroup$1,
85967
- get: get$c,
85968
- query: query$4,
85969
- remove: remove$3,
85968
+ get: get$d,
85969
+ query: query$5,
85970
+ remove: remove$4,
85970
85971
  withName: withName
85971
85972
  });
85972
85973
 
@@ -85989,7 +85990,7 @@ var episode = /*#__PURE__*/Object.freeze({
85989
85990
  * @param [optionals.groupKey] Group key; if omitted will attempt to use the group associated with the current session
85990
85991
  * @returns promise that resolves to a group
85991
85992
  */
85992
- async function get$b(optionals = {}) {
85993
+ async function get$c(optionals = {}) {
85993
85994
  const {
85994
85995
  groupKey,
85995
85996
  augment,
@@ -86139,7 +86140,7 @@ async function update$5(groupKey, update, optionals = {}) {
86139
86140
  * @param [optionals] Optional arguments; pass network call options overrides here.
86140
86141
  * @returns promise that resolves to the newly created group
86141
86142
  */
86142
- async function create$8(group, optionals = {}) {
86143
+ async function create$a(group, optionals = {}) {
86143
86144
  const {
86144
86145
  name,
86145
86146
  runLimit,
@@ -86206,7 +86207,7 @@ async function create$8(group, optionals = {}) {
86206
86207
  * @param [optionals] Optional arguments; pass network call options overrides here.
86207
86208
  * @returns promise that resolves to a page of groups
86208
86209
  */
86209
- async function query$3(searchOptions, optionals = {}) {
86210
+ async function query$4(searchOptions, optionals = {}) {
86210
86211
  const {
86211
86212
  filter,
86212
86213
  sort = [],
@@ -86245,7 +86246,7 @@ async function search(optionals = {}) {
86245
86246
  max,
86246
86247
  quantized
86247
86248
  };
86248
- return await query$3(searchOptions, routingOptions);
86249
+ return await query$4(searchOptions, routingOptions);
86249
86250
  }
86250
86251
 
86251
86252
  /**
@@ -86618,14 +86619,14 @@ async function statusUpdate(code, message, optionals = {}) {
86618
86619
  var group = /*#__PURE__*/Object.freeze({
86619
86620
  __proto__: null,
86620
86621
  addUser: addUser$1,
86621
- create: create$8,
86622
+ create: create$a,
86622
86623
  destroy: destroy$2,
86623
86624
  forUser: forUser,
86624
86625
  gather: gather,
86625
- get: get$b,
86626
+ get: get$c,
86626
86627
  getSessionGroups: getSessionGroups,
86627
86628
  getWhitelistedUsers: getWhitelistedUsers,
86628
- query: query$3,
86629
+ query: query$4,
86629
86630
  removeUser: removeUser,
86630
86631
  search: search,
86631
86632
  selfRegister: selfRegister,
@@ -86724,7 +86725,7 @@ async function update$4(collection, scope, scores, optionals = {}) {
86724
86725
  * @param [optionals] Optional arguments; pass network call options overrides here.
86725
86726
  * @returns promise that resolves to a list of leaderboard entries
86726
86727
  */
86727
- async function list$2(collection, scope, searchOptions, optionals = {}) {
86728
+ async function list$3(collection, scope, searchOptions, optionals = {}) {
86728
86729
  const {
86729
86730
  scopeBoundary,
86730
86731
  scopeKey
@@ -86745,9 +86746,9 @@ async function list$2(collection, scope, searchOptions, optionals = {}) {
86745
86746
  body
86746
86747
  }) => body);
86747
86748
  }
86748
- async function get$a(collection, scope, searchOptions, optionals = {}) {
86749
+ async function get$b(collection, scope, searchOptions, optionals = {}) {
86749
86750
  console.warn('DEPRECATION WARNING: leaderboardAdapter.get is deprecated and will be removed with the next release. Use leaderboardAdapter.list instead.');
86750
- return await list$2(collection, scope, searchOptions, optionals);
86751
+ return await list$3(collection, scope, searchOptions, optionals);
86751
86752
  }
86752
86753
 
86753
86754
  /**
@@ -86793,9 +86794,9 @@ async function getCount(collection, scope, searchOptions, optionals = {}) {
86793
86794
 
86794
86795
  var leaderboard = /*#__PURE__*/Object.freeze({
86795
86796
  __proto__: null,
86796
- get: get$a,
86797
+ get: get$b,
86797
86798
  getCount: getCount,
86798
- list: list$2,
86799
+ list: list$3,
86799
86800
  update: update$4
86800
86801
  });
86801
86802
 
@@ -86944,7 +86945,7 @@ let MORPHOLOGY = /*#__PURE__*/function (MORPHOLOGY) {
86944
86945
  * @param [optionals.allowChannel] Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT
86945
86946
  * @returns promise that resolves to the newly created run
86946
86947
  */
86947
- async function create$7(model, scope, optionals = {}) {
86948
+ async function create$9(model, scope, optionals = {}) {
86948
86949
  const {
86949
86950
  scopeBoundary,
86950
86951
  scopeKey,
@@ -87235,7 +87236,7 @@ async function update$3(runKey, update, optionals = {}) {
87235
87236
  * @param [optionals] Optional arguments; pass network call options overrides here.
87236
87237
  * @returns promise that resolve to undefined if successful
87237
87238
  */
87238
- async function remove$2(runKey, optionals = {}) {
87239
+ async function remove$3(runKey, optionals = {}) {
87239
87240
  return await new Router().delete(`/run/${runKey}`, optionals).then(({
87240
87241
  body
87241
87242
  }) => body);
@@ -87253,7 +87254,7 @@ async function remove$2(runKey, optionals = {}) {
87253
87254
  * @param [optionals] Optional arguments; pass network call options overrides here.
87254
87255
  * @returns promise that resolves to the run
87255
87256
  */
87256
- async function get$9(runKey, optionals = {}) {
87257
+ async function get$a(runKey, optionals = {}) {
87257
87258
  return await new Router().get(`/run/${runKey}`, optionals).then(({
87258
87259
  body
87259
87260
  }) => body);
@@ -87295,7 +87296,7 @@ async function get$9(runKey, optionals = {}) {
87295
87296
  * @param [optionals] Optional arguments; pass network call options overrides here.
87296
87297
  * @returns promise that resolves to a page of runs
87297
87298
  */
87298
- async function query$2(model, searchOptions, optionals = {}) {
87299
+ async function query$3(model, searchOptions, optionals = {}) {
87299
87300
  const {
87300
87301
  filter,
87301
87302
  sort = [],
@@ -87852,15 +87853,15 @@ async function getWithStrategy(strategy, model, scope, optionals = {}) {
87852
87853
  };
87853
87854
  const {
87854
87855
  values: [lastRun]
87855
- } = await query$2(model, searchOptions);
87856
+ } = await query$3(model, searchOptions);
87856
87857
  if (!lastRun) {
87857
- const newRun = await create$7(model, scope, optionals);
87858
+ const newRun = await create$9(model, scope, optionals);
87858
87859
  // await serial(newRun.runKey, initOperations, optionals = {});
87859
87860
  return newRun;
87860
87861
  }
87861
87862
  return lastRun;
87862
87863
  } else if (strategy === 'reuse-never') {
87863
- const newRun = await create$7(model, scope, optionals);
87864
+ const newRun = await create$9(model, scope, optionals);
87864
87865
  // await serial(newRun.runKey, initOperations, optionals = {});
87865
87866
  return newRun;
87866
87867
  } else ;
@@ -87913,9 +87914,9 @@ var run = /*#__PURE__*/Object.freeze({
87913
87914
  MORPHOLOGY: MORPHOLOGY,
87914
87915
  action: action,
87915
87916
  clone: clone,
87916
- create: create$7,
87917
+ create: create$9,
87917
87918
  createSingular: createSingular,
87918
- get: get$9,
87919
+ get: get$a,
87919
87920
  getMetadata: getMetadata,
87920
87921
  getSingularRunKey: getSingularRunKey,
87921
87922
  getVariable: getVariable,
@@ -87925,8 +87926,8 @@ var run = /*#__PURE__*/Object.freeze({
87925
87926
  introspectWithRunKey: introspectWithRunKey,
87926
87927
  migrate: migrate,
87927
87928
  operation: operation,
87928
- query: query$2,
87929
- remove: remove$2,
87929
+ query: query$3,
87930
+ remove: remove$3,
87930
87931
  removeFromWorld: removeFromWorld,
87931
87932
  restore: restore,
87932
87933
  retrieveFromWorld: retrieveFromWorld,
@@ -88008,7 +88009,7 @@ async function createUser(view, optionals = {}) {
88008
88009
  * @param [optionals] Optional arguments; pass network call options overrides here.
88009
88010
  * @returns promise that resolves to a user
88010
88011
  */
88011
- async function get$8(userKey, optionals = {}) {
88012
+ async function get$9(userKey, optionals = {}) {
88012
88013
  return await new Router().get(`/user/${userKey}`, optionals).then(({
88013
88014
  body
88014
88015
  }) => body);
@@ -88041,7 +88042,7 @@ async function getWithHandle(handle, optionals = {}) {
88041
88042
  var user = /*#__PURE__*/Object.freeze({
88042
88043
  __proto__: null,
88043
88044
  createUser: createUser,
88044
- get: get$8,
88045
+ get: get$9,
88045
88046
  getWithHandle: getWithHandle,
88046
88047
  uploadCSV: uploadCSV
88047
88048
  });
@@ -88132,7 +88133,7 @@ const NOT_FOUND$4 = 404;
88132
88133
  * @param [optionals] Optional arguments; pass network call options overrides here.
88133
88134
  * @returns promise that resolves to the vault, or undefined if not found
88134
88135
  */
88135
- async function get$7(vaultKey, optionals = {}) {
88136
+ async function get$8(vaultKey, optionals = {}) {
88136
88137
  return await new Router().get(`/vault/${vaultKey}`, optionals).catch(error => {
88137
88138
  if (error.status === NOT_FOUND$4) return {
88138
88139
  body: undefined
@@ -88232,7 +88233,7 @@ async function byName$1(name, optionals = {}) {
88232
88233
  * @param [optionals.mutationKey] Mutation key for optimistic concurrency control
88233
88234
  * @returns promise that resolves to undefined when successful
88234
88235
  */
88235
- async function remove$1(vaultKey, optionals = {}) {
88236
+ async function remove$2(vaultKey, optionals = {}) {
88236
88237
  const {
88237
88238
  mutationKey,
88238
88239
  ...routingOptions
@@ -88347,7 +88348,7 @@ async function define(name, scope, optionals = {}) {
88347
88348
  * @param [optionals.mutationStrategy] Mutation strategy: ALLOW (upsert), DISALLOW (insert without update), ERROR (insert with conflict exception if exists)
88348
88349
  * @returns promise that resolves to the created vault
88349
88350
  */
88350
- async function create$6(name, scope, items, optionals = {}) {
88351
+ async function create$8(name, scope, items, optionals = {}) {
88351
88352
  console.warn('DEPRECATION WARNING: vaultAdapter.create is deprecated and will be removed with the next release. Use vaultAdapter.define instead.');
88352
88353
  return await define(name, scope, {
88353
88354
  items,
@@ -88379,7 +88380,7 @@ async function create$6(name, scope, items, optionals = {}) {
88379
88380
  * @param [optionals.groupName] Name of the group
88380
88381
  * @returns promise that resolves to an array of vaults that match the search options
88381
88382
  */
88382
- async function list$1(searchOptions, optionals = {}) {
88383
+ async function list$2(searchOptions, optionals = {}) {
88383
88384
  const {
88384
88385
  first,
88385
88386
  filter,
@@ -88444,11 +88445,11 @@ var vault = /*#__PURE__*/Object.freeze({
88444
88445
  __proto__: null,
88445
88446
  byName: byName$1,
88446
88447
  count: count,
88447
- create: create$6,
88448
+ create: create$8,
88448
88449
  define: define,
88449
- get: get$7,
88450
- list: list$1,
88451
- remove: remove$1,
88450
+ get: get$8,
88451
+ list: list$2,
88452
+ remove: remove$2,
88452
88453
  update: update$2,
88453
88454
  updateProperties: updateProperties,
88454
88455
  withScope: withScope$1
@@ -88773,7 +88774,7 @@ var video$1 = /*#__PURE__*/Object.freeze({
88773
88774
  * @param [optionals] Optional arguments; pass network call options overrides here.
88774
88775
  * @returns promise that resolves to undefined when successful
88775
88776
  */
88776
- async function remove(videoKey, optionals = {}) {
88777
+ async function remove$1(videoKey, optionals = {}) {
88777
88778
  return deleteVideoByKey(videoKey, optionals);
88778
88779
  }
88779
88780
 
@@ -88798,7 +88799,7 @@ async function remove(videoKey, optionals = {}) {
88798
88799
  * @param [optionals] Optional arguments; pass network call options overrides here.
88799
88800
  * @returns promise that resolves to a page of video objects
88800
88801
  */
88801
- async function query$1(searchOptions, optionals = {}) {
88802
+ async function query$2(searchOptions, optionals = {}) {
88802
88803
  const {
88803
88804
  filter,
88804
88805
  sort = [],
@@ -88988,7 +88989,7 @@ async function processVideo(videoKey, processors, optionals = {}) {
88988
88989
  * @param [optionals.videoKey] Key for the video object
88989
88990
  * @returns promise that resolves to undefined when download is complete
88990
88991
  */
88991
- async function download(file, optionals = {}) {
88992
+ async function download$1(file, optionals = {}) {
88992
88993
  const {
88993
88994
  scope,
88994
88995
  affiliate,
@@ -89007,12 +89008,12 @@ async function download(file, optionals = {}) {
89007
89008
 
89008
89009
  var video = /*#__PURE__*/Object.freeze({
89009
89010
  __proto__: null,
89010
- download: download,
89011
+ download: download$1,
89011
89012
  getDirectoryURL: getDirectoryURL,
89012
89013
  getURL: getURL,
89013
89014
  processVideo: processVideo,
89014
- query: query$1,
89015
- remove: remove
89015
+ query: query$2,
89016
+ remove: remove$1
89016
89017
  });
89017
89018
 
89018
89019
  /**
@@ -89359,7 +89360,7 @@ async function destroy$1(worldKey, optionals = {}) {
89359
89360
  * @param [optionals.allowChannel] Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT
89360
89361
  * @returns promise that resolves to the newly created world
89361
89362
  */
89362
- async function create$5(optionals = {}) {
89363
+ async function create$7(optionals = {}) {
89363
89364
  const {
89364
89365
  name,
89365
89366
  displayName,
@@ -89401,7 +89402,7 @@ async function create$5(optionals = {}) {
89401
89402
  * @param [optionals.mine] Flag for indicating to get only the worlds the requesting user is in (based on session token)
89402
89403
  * @returns promise that resolves to a list of worlds
89403
89404
  */
89404
- async function get$6(optionals = {}) {
89405
+ async function get$7(optionals = {}) {
89405
89406
  const {
89406
89407
  groupName,
89407
89408
  episodeName,
@@ -89782,10 +89783,10 @@ var world = /*#__PURE__*/Object.freeze({
89782
89783
  WORLD_NAME_GENERATOR_TYPE: WORLD_NAME_GENERATOR_TYPE,
89783
89784
  assignRun: assignRun,
89784
89785
  autoAssignUsers: autoAssignUsers,
89785
- create: create$5,
89786
+ create: create$7,
89786
89787
  destroy: destroy$1,
89787
89788
  editAssignments: editAssignments,
89788
- get: get$6,
89789
+ get: get$7,
89789
89790
  getAssignments: getAssignments,
89790
89791
  getAssignmentsByKey: getAssignmentsByKey,
89791
89792
  getPersonas: getPersonas,
@@ -89810,7 +89811,7 @@ var world = /*#__PURE__*/Object.freeze({
89810
89811
  * @returns promise that resolves to the current server time in ISO 8601 format, or undefined if not found
89811
89812
  */
89812
89813
  const NOT_FOUND$3 = 404;
89813
- async function get$5(optionals = {}) {
89814
+ async function get$6(optionals = {}) {
89814
89815
  return await new Router().get('/time', optionals).catch(error => {
89815
89816
  if (error.status === NOT_FOUND$3) return {
89816
89817
  body: undefined
@@ -89823,15 +89824,13 @@ async function get$5(optionals = {}) {
89823
89824
 
89824
89825
  var time = /*#__PURE__*/Object.freeze({
89825
89826
  __proto__: null,
89826
- get: get$5
89827
+ get: get$6
89827
89828
  });
89828
89829
 
89829
89830
  let RETRY_POLICY = /*#__PURE__*/function (RETRY_POLICY) {
89830
89831
  RETRY_POLICY["DO_NOTHING"] = "DO_NOTHING";
89831
89832
  // If the task fails, do nothing (this is the default)
89832
- RETRY_POLICY["RESCHEDULE"] = "RESCHEDULE";
89833
- // If the task fails retry at the next scheduled time point
89834
- 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
89833
+ RETRY_POLICY["FIRE_ON_FAIL_SAFE"] = "FIRE_ON_FAIL_SAFE"; // Retry within the task's fail-safe execution window
89835
89834
  return RETRY_POLICY;
89836
89835
  }({});
89837
89836
 
@@ -89848,7 +89847,7 @@ let RETRY_POLICY = /*#__PURE__*/function (RETRY_POLICY) {
89848
89847
  // Task response structure
89849
89848
 
89850
89849
  /**
89851
- * Creates a task; requires support level authentication
89850
+ * Creates a task; requires facilitator (or higher) privileges
89852
89851
  * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/task`
89853
89852
  *
89854
89853
  * @example
@@ -89860,7 +89859,9 @@ let RETRY_POLICY = /*#__PURE__*/function (RETRY_POLICY) {
89860
89859
  * const name = 'task-1-send-emails';
89861
89860
  * const payload = {
89862
89861
  * method: 'POST',
89863
- * url: 'https://forio.com/app/forio-dev/test-project/send-out-emails',
89862
+ * url: '/send-out-emails',
89863
+ * target: 'PROXY', // fire at the project's proxy server; omit to fire at the app
89864
+ * body: {},
89864
89865
  * };
89865
89866
  * const trigger = {
89866
89867
  * value: '0 7 15 * * ?', // triggers on day 15 7am of each month
@@ -89873,11 +89874,13 @@ let RETRY_POLICY = /*#__PURE__*/function (RETRY_POLICY) {
89873
89874
  * @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.
89874
89875
  * @param [scope.userKey] Key associated with the user
89875
89876
  * @param name Name of the task
89876
- * @param payload An HTTP task object that will be executed when the task is triggered
89877
- * @param payload.method Type of method to use with the HTTP request (e.g., 'GET', 'POST', 'PATCH')
89878
- * @param payload.url The URL the HTTP request will be sent to
89879
- * @param [payload.body] The body of the HTTP request
89880
- * @param [payload.headers] Headers to send along with the HTTP request
89877
+ * @param payload An HTTP request or group-status change to execute when the task is triggered
89878
+ * @param payload.method Type of method to use with the HTTP request (e.g., 'GET', 'POST')
89879
+ * @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}`
89880
+ * @param [payload.target] Where the task fires: 'APPLICATION' (the project app, `/app`, the default) or 'PROXY' (the project's proxy server, `/proxy`)
89881
+ * @param payload.body The JSON body of the HTTP request
89882
+ * @param [payload.headers] Headers to send along with the HTTP request; must be non-empty when provided — omit rather than pass an empty object
89883
+ * @param [payload.timeoutSeconds] Request timeout in seconds (1–30)
89881
89884
  * @param trigger Object that determines when to run the task (cron, offset, or date)
89882
89885
  * @param [trigger.value] For cron: cron expression (e.g., '0 7 * * * ?'). For date: ISO-8601 date-time string
89883
89886
  * @param [trigger.objectType] Type of trigger: 'cron', 'offset', or 'date'
@@ -89888,23 +89891,24 @@ let RETRY_POLICY = /*#__PURE__*/function (RETRY_POLICY) {
89888
89891
  * @param [optionals.accountShortName] Name of account (by default will be the account associated with the session)
89889
89892
  * @param [optionals.projectShortName] Name of project (by default will be the project associated with the session)
89890
89893
  * @param [optionals.retryPolicy] Specifies what to do should the task fail; see RETRY_POLICY
89891
- * @param [optionals.failSafeTermination] The ISO-8601 date-time when the task will be deleted regardless of any triggers; defaults to null
89892
- * @param [optionals.ttlSeconds] Max life expectancy of the task; used to determine if retrying the task is necessary
89894
+ * @param [optionals.failSafeTermination] ISO-8601 deadline after which the task terminates; the server defaults and caps this at one year from creation
89895
+ * @param [optionals.ttlSeconds] Execution fail-safe window in seconds; the server applies its configured minimum
89893
89896
  * @returns promise that resolves to the task object including the taskKey
89894
89897
  */
89895
- async function create$4(scope, name, payload, trigger, optionals = {}) {
89898
+ async function create$6(scope, name, payload, trigger, optionals = {}) {
89896
89899
  const {
89897
89900
  retryPolicy,
89898
89901
  failSafeTermination,
89899
89902
  ttlSeconds,
89900
89903
  ...routingOptions
89901
89904
  } = optionals;
89905
+ const normalizedPayload = payload.objectType === 'groupStatus' ? payload : {
89906
+ ...payload,
89907
+ objectType: 'http'
89908
+ };
89902
89909
  return await new Router().post('/task', {
89903
89910
  body: {
89904
- payload: {
89905
- objectType: 'http',
89906
- ...payload
89907
- },
89911
+ payload: normalizedPayload,
89908
89912
  trigger,
89909
89913
  retryPolicy,
89910
89914
  failSafeTermination,
@@ -89919,7 +89923,7 @@ async function create$4(scope, name, payload, trigger, optionals = {}) {
89919
89923
  }
89920
89924
 
89921
89925
  /**
89922
- * Deletes a task (changes status to cancelled); requires support level authentication
89926
+ * Deletes a task (changes status to cancelled); requires facilitator (or higher) privileges
89923
89927
  * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/task/{TASK_KEY}`
89924
89928
  *
89925
89929
  * @example
@@ -89928,7 +89932,7 @@ async function create$4(scope, name, payload, trigger, optionals = {}) {
89928
89932
  * await taskAdapter.destroy(taskKey);
89929
89933
  *
89930
89934
  * @param taskKey Unique key associated with a task
89931
- * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
89935
+ * @param [optionals] Optional arguments; pass network call options overrides here.
89932
89936
  * @param [optionals.accountShortName] Name of account (by default will be the account associated with the session)
89933
89937
  * @param [optionals.projectShortName] Name of project (by default will be the project associated with the session)
89934
89938
  * @returns promise that resolves to undefined when successful
@@ -89940,7 +89944,7 @@ async function destroy(taskKey, optionals = {}) {
89940
89944
  }
89941
89945
 
89942
89946
  /**
89943
- * Gets a task by taskKey; requires support level authentication
89947
+ * Gets a task by taskKey; requires facilitator (or higher) privileges
89944
89948
  * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/task/{TASK_KEY}`
89945
89949
  *
89946
89950
  * @example
@@ -89949,19 +89953,19 @@ async function destroy(taskKey, optionals = {}) {
89949
89953
  * const task = await taskAdapter.get(taskKey);
89950
89954
  *
89951
89955
  * @param taskKey Unique key associated with a task
89952
- * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
89956
+ * @param [optionals] Optional arguments; pass network call options overrides here.
89953
89957
  * @param [optionals.accountShortName] Name of account (by default will be the account associated with the session)
89954
89958
  * @param [optionals.projectShortName] Name of project (by default will be the project associated with the session)
89955
89959
  * @returns promise that resolves to the task object
89956
89960
  */
89957
- async function get$4(taskKey, optionals = {}) {
89961
+ async function get$5(taskKey, optionals = {}) {
89958
89962
  return await new Router().get(`/task/${taskKey}`, optionals).then(({
89959
89963
  body
89960
89964
  }) => body);
89961
89965
  }
89962
89966
 
89963
89967
  /**
89964
- * Gets the history (100 most recent times it has triggered) of a task by taskKey; requires support level authentication
89968
+ * Gets the history (100 most recent times it has triggered) of a task by taskKey; requires facilitator (or higher) privileges
89965
89969
  * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/task/history/{TASK_KEY}`
89966
89970
  *
89967
89971
  * @example
@@ -89970,19 +89974,32 @@ async function get$4(taskKey, optionals = {}) {
89970
89974
  * const history = await taskAdapter.getHistory(taskKey);
89971
89975
  *
89972
89976
  * @param taskKey Unique key associated with a task
89973
- * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
89977
+ * @param [optionals] Pagination and network options
89978
+ * @param [optionals.first] Zero-based index of the first history record; defaults to 0
89979
+ * @param [optionals.max] Maximum history records to return; defaults to 100 and cannot exceed 100
89974
89980
  * @param [optionals.accountShortName] Name of account (by default will be the account associated with the session)
89975
89981
  * @param [optionals.projectShortName] Name of project (by default will be the project associated with the session)
89976
- * @returns promise that resolves to an array of task history objects
89982
+ * @returns promise that resolves to a page of task history objects
89977
89983
  */
89978
89984
  async function getHistory(taskKey, optionals = {}) {
89979
- return await new Router().get(`/task/history/${taskKey}`, optionals).then(({
89985
+ const {
89986
+ first,
89987
+ max,
89988
+ ...routingOptions
89989
+ } = optionals;
89990
+ return await new Router().withSearchParams({
89991
+ first,
89992
+ max
89993
+ }).get(`/task/history/${taskKey}`, {
89994
+ paginated: true,
89995
+ ...routingOptions
89996
+ }).then(({
89980
89997
  body
89981
89998
  }) => body);
89982
89999
  }
89983
90000
 
89984
90001
  /**
89985
- * Gets most recent 100 tasks related to the selected scope; requires support level authentication
90002
+ * Gets most recent 100 tasks related to the selected scope; requires facilitator (or higher) privileges
89986
90003
  * 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}`
89987
90004
  *
89988
90005
  * 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.
@@ -89999,10 +90016,13 @@ async function getHistory(taskKey, optionals = {}) {
89999
90016
  * @param scope.scopeBoundary Scope boundary, defines the type of scope; See [scope boundary](#SCOPE_BOUNDARY) for all types
90000
90017
  * @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.
90001
90018
  * @param [scope.userKey] Key associated with the user; will retrieve tasks in the scope that were made by the specified user
90002
- * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
90019
+ * @param [optionals] Pagination, sorting, and network options
90020
+ * @param [optionals.sort] Task fields to sort by
90021
+ * @param [optionals.first] Zero-based index of the first task; defaults to 0
90022
+ * @param [optionals.max] Maximum tasks to return; defaults to 100 and cannot exceed 100
90003
90023
  * @param [optionals.accountShortName] Name of account (by default will be the account associated with the session)
90004
90024
  * @param [optionals.projectShortName] Name of project (by default will be the project associated with the session)
90005
- * @returns promise that resolves to an array of task objects
90025
+ * @returns promise that resolves to a page of task objects
90006
90026
  */
90007
90027
  async function getTaskIn(scope, optionals = {}) {
90008
90028
  const {
@@ -90010,7 +90030,70 @@ async function getTaskIn(scope, optionals = {}) {
90010
90030
  scopeKey,
90011
90031
  userKey
90012
90032
  } = scope;
90013
- return await new Router().get(`/task/in/${scopeBoundary}/${scopeKey}${userKey ? `/${userKey}` : ''}`, optionals).then(({
90033
+ const {
90034
+ sort = [],
90035
+ first,
90036
+ max,
90037
+ ...routingOptions
90038
+ } = optionals;
90039
+ return await new Router().withSearchParams({
90040
+ sort: sort.join(';') || undefined,
90041
+ first,
90042
+ max
90043
+ }).get(`/task/in/${scopeBoundary}/${scopeKey}${userKey ? `/${userKey}` : ''}`, {
90044
+ paginated: true,
90045
+ ...routingOptions
90046
+ }).then(({
90047
+ body
90048
+ }) => body);
90049
+ }
90050
+
90051
+ /**
90052
+ * Queries for tasks
90053
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/task/search`
90054
+ *
90055
+ * No authentication is required; results use facilitator-level row visibility.
90056
+ * Filterable/sortable fields include
90057
+ * `task.taskKey`, `task.name`, `task.status`, `task.scopeBoundary`, `task.scopeKey`,
90058
+ * `task.userKey`, `task.groupName`, `task.episodeName`, `task.nextExecution`,
90059
+ * `task.failSafeExecution`, and `task.created`.
90060
+ *
90061
+ * @example
90062
+ * import { taskAdapter } from 'epicenter-libs';
90063
+ * const page = await taskAdapter.query({
90064
+ * filter: [
90065
+ * 'task.scopeKey=0000017dd3bf540e5ada5b1e058f08f20461', // tasks scoped to this group
90066
+ * 'task.status=INITIALIZED', // that have not yet fired
90067
+ * ],
90068
+ * sort: ['-task.created'], // newest first
90069
+ * max: 10, // page should only include the first 10 items
90070
+ * });
90071
+ *
90072
+ * @param searchOptions Search options for the query
90073
+ * @param [searchOptions.filter] Filters for searching
90074
+ * @param [searchOptions.sort] Sorting criteria
90075
+ * @param [searchOptions.first] The starting index of the page returned
90076
+ * @param [searchOptions.max] The number of entries per page
90077
+ * @param [optionals] Optional arguments; pass network call options overrides here.
90078
+ * @returns promise that resolves to a page of tasks
90079
+ */
90080
+ async function query$1(searchOptions, optionals = {}) {
90081
+ const {
90082
+ filter,
90083
+ sort = [],
90084
+ first,
90085
+ max
90086
+ } = searchOptions;
90087
+ const searchParams = {
90088
+ filter: parseFilterInput(filter),
90089
+ sort: sort.join(';') || undefined,
90090
+ first,
90091
+ max
90092
+ };
90093
+ return await new Router().withSearchParams(searchParams).get('/task/search', {
90094
+ paginated: true,
90095
+ ...optionals
90096
+ }).then(({
90014
90097
  body
90015
90098
  }) => body);
90016
90099
  }
@@ -90018,11 +90101,12 @@ async function getTaskIn(scope, optionals = {}) {
90018
90101
  var task = /*#__PURE__*/Object.freeze({
90019
90102
  __proto__: null,
90020
90103
  RETRY_POLICY: RETRY_POLICY,
90021
- create: create$4,
90104
+ create: create$6,
90022
90105
  destroy: destroy,
90023
- get: get$4,
90106
+ get: get$5,
90024
90107
  getHistory: getHistory,
90025
- getTaskIn: getTaskIn
90108
+ getTaskIn: getTaskIn,
90109
+ query: query$1
90026
90110
  });
90027
90111
 
90028
90112
  /**
@@ -90074,7 +90158,7 @@ async function updatePermit(chatKey, permit, optionals = {}) {
90074
90158
  * @param [optionals] Optional arguments; pass network call options overrides here.
90075
90159
  * @returns promise that resolves to the newly created chat
90076
90160
  */
90077
- async function create$3(room, scope, permit, optionals = {}) {
90161
+ async function create$5(room, scope, permit, optionals = {}) {
90078
90162
  return new Router().post('/chat', {
90079
90163
  body: {
90080
90164
  scope: {
@@ -90102,7 +90186,7 @@ async function create$3(room, scope, permit, optionals = {}) {
90102
90186
  * @param [optionals] Optional arguments; pass network call options overrides here.
90103
90187
  * @returns promise that resolves to the chat
90104
90188
  */
90105
- async function get$3(chatKey, optionals = {}) {
90189
+ async function get$4(chatKey, optionals = {}) {
90106
90190
  return new Router().get(`/chat/${chatKey}`, optionals).then(({
90107
90191
  body
90108
90192
  }) => body);
@@ -90318,8 +90402,8 @@ async function sendMessageAdmin(chatKey, message, optionals = {}) {
90318
90402
 
90319
90403
  var chat = /*#__PURE__*/Object.freeze({
90320
90404
  __proto__: null,
90321
- create: create$3,
90322
- get: get$3,
90405
+ create: create$5,
90406
+ get: get$4,
90323
90407
  getMessages: getMessages,
90324
90408
  getMessagesAdmin: getMessagesAdmin,
90325
90409
  getMessagesForUser: getMessagesForUser,
@@ -90362,7 +90446,7 @@ var chat = /*#__PURE__*/Object.freeze({
90362
90446
  * @param [optionals.allowChannel] Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT
90363
90447
  * @returns promise that resolves to the newly created consensus barrier
90364
90448
  */
90365
- async function create$2(worldKey, name, stage, expectedRoles, defaultActions, optionals = {}) {
90449
+ async function create$4(worldKey, name, stage, expectedRoles, defaultActions, optionals = {}) {
90366
90450
  const {
90367
90451
  ttlSeconds,
90368
90452
  transparent = false,
@@ -90416,7 +90500,7 @@ async function load(worldKey, name, stage, optionals = {}) {
90416
90500
  * @param [optionals] Optional arguments; pass network call options overrides here.
90417
90501
  * @returns promise that resolves to a list of consensus barriers
90418
90502
  */
90419
- async function list(worldKey, name, optionals = {}) {
90503
+ async function list$1(worldKey, name, optionals = {}) {
90420
90504
  return await new Router().get(`/consensus/${worldKey}/${name}`, optionals).then(({
90421
90505
  body
90422
90506
  }) => body);
@@ -90809,11 +90893,11 @@ async function collectInGroup(barrierMap, groupName, optionals = {}) {
90809
90893
  var consensus = /*#__PURE__*/Object.freeze({
90810
90894
  __proto__: null,
90811
90895
  collectInGroup: collectInGroup,
90812
- create: create$2,
90896
+ create: create$4,
90813
90897
  deleteAll: deleteAll,
90814
90898
  deleteBarrier: deleteBarrier,
90815
90899
  forceClose: forceClose,
90816
- list: list,
90900
+ list: list$1,
90817
90901
  load: load,
90818
90902
  pause: pause,
90819
90903
  removeRoleExpectationFor: removeRoleExpectationFor,
@@ -90851,7 +90935,7 @@ var consensus = /*#__PURE__*/Object.freeze({
90851
90935
  * @returns promise that resolves to the newly created somebody object
90852
90936
  */
90853
90937
 
90854
- async function create$1(email, scope, optionals = {}) {
90938
+ async function create$3(email, scope, optionals = {}) {
90855
90939
  const {
90856
90940
  givenName,
90857
90941
  familyName,
@@ -90884,7 +90968,7 @@ async function create$1(email, scope, optionals = {}) {
90884
90968
  * @returns promise that resolves to the somebody object, or undefined if not found
90885
90969
  */
90886
90970
  const NOT_FOUND$2 = 404;
90887
- async function get$2(somebodyKey, optionals = {}) {
90971
+ async function get$3(somebodyKey, optionals = {}) {
90888
90972
  return await new Router().get(`/somebody/${somebodyKey}`, optionals).catch(error => {
90889
90973
  if (error.status === NOT_FOUND$2) return {
90890
90974
  body: undefined
@@ -90979,8 +91063,8 @@ async function byEmail(email, scope, optionals = {}) {
90979
91063
  var somebody = /*#__PURE__*/Object.freeze({
90980
91064
  __proto__: null,
90981
91065
  byEmail: byEmail,
90982
- create: create$1,
90983
- get: get$2,
91066
+ create: create$3,
91067
+ get: get$3,
90984
91068
  inScope: inScope
90985
91069
  });
90986
91070
 
@@ -91003,7 +91087,7 @@ var somebody = /*#__PURE__*/Object.freeze({
91003
91087
  * @param [optionals] Optional arguments; pass network call options overrides here.
91004
91088
  * @returns promise that resolves to the matchmaker list object
91005
91089
  */
91006
- async function create(name, partners, scope, optionals = {}) {
91090
+ async function create$2(name, partners, scope, optionals = {}) {
91007
91091
  const {
91008
91092
  accountShortName,
91009
91093
  projectShortName,
@@ -91086,7 +91170,7 @@ const NOT_FOUND$1 = 404;
91086
91170
  * @param [optionals] Optional arguments; pass network call options overrides here.
91087
91171
  * @returns promise that resolves to the matchmaker list object, or undefined if not found
91088
91172
  */
91089
- async function get$1(udomeKey, optionals = {}) {
91173
+ async function get$2(udomeKey, optionals = {}) {
91090
91174
  const {
91091
91175
  accountShortName,
91092
91176
  projectShortName,
@@ -91144,9 +91228,9 @@ var matchmaker = /*#__PURE__*/Object.freeze({
91144
91228
  __proto__: null,
91145
91229
  addUser: addUser,
91146
91230
  byName: byName,
91147
- create: create,
91231
+ create: create$2,
91148
91232
  edit: edit,
91149
- get: get$1
91233
+ get: get$2
91150
91234
  });
91151
91235
 
91152
91236
  const sleep = ms => new Promise(r => setTimeout(r, ms));
@@ -91450,7 +91534,7 @@ const NOT_FOUND = 404;
91450
91534
  * @param [optionals] Optional arguments; pass network call options overrides here.
91451
91535
  * @returns promise that resolves to the wallet
91452
91536
  */
91453
- async function get(scope, optionals = {}) {
91537
+ async function get$1(scope, optionals = {}) {
91454
91538
  const {
91455
91539
  scopeBoundary,
91456
91540
  scopeKey
@@ -91517,11 +91601,922 @@ async function withScope(scope, optionals = {}) {
91517
91601
 
91518
91602
  var wallet = /*#__PURE__*/Object.freeze({
91519
91603
  __proto__: null,
91520
- get: get,
91604
+ get: get$1,
91521
91605
  update: update,
91522
91606
  withScope: withScope
91523
91607
  });
91524
91608
 
91609
+ /**
91610
+ * Builds the NPM Docker images used by pipeline NPM operations.
91611
+ * Requires `system` (admin) authorization.
91612
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/pipeline/npm/images`
91613
+ *
91614
+ * @example
91615
+ * import { pipelineAdapter } from 'epicenter-libs';
91616
+ * const built = await pipelineAdapter.buildImages();
91617
+ *
91618
+ * @param [optionals] Optional arguments; pass network call options overrides here.
91619
+ * @returns promise that resolves to `true` when the images were built successfully
91620
+ */
91621
+ async function buildImages(optionals = {}) {
91622
+ return await new Router().get('/pipeline/npm/images', optionals).then(({
91623
+ body
91624
+ }) => body);
91625
+ }
91626
+
91627
+ /**
91628
+ * Executes a stored pipeline configuration. The operations to run are read server-side from the
91629
+ * named config file; only step inputs (such as credentials) are supplied here via `attributes`.
91630
+ * The execution runs asynchronously — the returned audit record starts in its `RUNNING` state and
91631
+ * is updated by the worker on completion (poll `getExecution` to observe progress).
91632
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/pipeline/{configName}`
91633
+ *
91634
+ * @example
91635
+ * import { pipelineAdapter } from 'epicenter-libs';
91636
+ * // Pass the git credential the config's git step will consume, keyed by operation type
91637
+ * const audit = await pipelineAdapter.execute('deploy', { git: 'my-git-token' });
91638
+ *
91639
+ * @param configName Name of the stored pipeline config to execute
91640
+ * @param [attributes] Step inputs keyed by operation type (e.g. `{ git: '<token>' }`)
91641
+ * @param [optionals] Optional arguments; pass network call options overrides here.
91642
+ * @returns promise that resolves to the newly created audit record in its initial RUNNING state
91643
+ */
91644
+ async function execute(configName, attributes = {}, optionals = {}) {
91645
+ return await new Router().post(`/pipeline/${encodeURIComponent(configName)}`, {
91646
+ body: {
91647
+ attributes
91648
+ },
91649
+ ...optionals
91650
+ }).then(({
91651
+ body
91652
+ }) => body);
91653
+ }
91654
+
91655
+ /**
91656
+ * Retrieves a single pipeline audit record by its execution key.
91657
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/pipeline/{executionKey}`
91658
+ *
91659
+ * @example
91660
+ * import { pipelineAdapter } from 'epicenter-libs';
91661
+ * const audit = await pipelineAdapter.getExecution('<executionKey>');
91662
+ *
91663
+ * @param executionKey Execution key of the audit record to retrieve
91664
+ * @param [optionals] Optional arguments; pass network call options overrides here.
91665
+ * @returns promise that resolves to the audit record
91666
+ */
91667
+ async function getExecution(executionKey, optionals = {}) {
91668
+ return await new Router().get(`/pipeline/${encodeURIComponent(executionKey)}`, optionals).then(({
91669
+ body
91670
+ }) => body);
91671
+ }
91672
+
91673
+ /**
91674
+ * Lists the audit history for a stored pipeline config.
91675
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/pipeline/with/{configName}`
91676
+ *
91677
+ * @example
91678
+ * import { pipelineAdapter } from 'epicenter-libs';
91679
+ * const page = await pipelineAdapter.listAudits('deploy', { first: 0, max: 20 });
91680
+ *
91681
+ * @param configName Name of the stored pipeline config
91682
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
91683
+ * @param [optionals.first] Index of the first record to return (for pagination)
91684
+ * @param [optionals.max] Maximum number of records to return (for pagination)
91685
+ * @returns promise that resolves to a page of audit records
91686
+ */
91687
+ async function listAudits(configName, optionals = {}) {
91688
+ const {
91689
+ first = 0,
91690
+ max,
91691
+ ...routingOptions
91692
+ } = optionals;
91693
+ return await new Router().withSearchParams({
91694
+ first,
91695
+ max
91696
+ }).get(`/pipeline/with/${encodeURIComponent(configName)}`, {
91697
+ paginated: true,
91698
+ ...routingOptions
91699
+ }).then(({
91700
+ body
91701
+ }) => body);
91702
+ }
91703
+
91704
+ /**
91705
+ * Deletes a pipeline audit record by its execution key.
91706
+ * Requires `system` (admin) authorization.
91707
+ * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/pipeline/{executionKey}`
91708
+ *
91709
+ * @example
91710
+ * import { pipelineAdapter } from 'epicenter-libs';
91711
+ * await pipelineAdapter.deleteAudit('<executionKey>');
91712
+ *
91713
+ * @param executionKey Execution key of the audit record to delete
91714
+ * @param [optionals] Optional arguments; pass network call options overrides here.
91715
+ * @returns promise that resolves to `true` when the audit record was deleted
91716
+ */
91717
+ async function deleteAudit(executionKey, optionals = {}) {
91718
+ return await new Router().delete(`/pipeline/${encodeURIComponent(executionKey)}`, optionals).then(({
91719
+ body
91720
+ }) => body);
91721
+ }
91722
+
91723
+ var pipeline = /*#__PURE__*/Object.freeze({
91724
+ __proto__: null,
91725
+ buildImages: buildImages,
91726
+ deleteAudit: deleteAudit,
91727
+ execute: execute,
91728
+ getExecution: getExecution,
91729
+ listAudits: listAudits
91730
+ });
91731
+
91732
+ /**
91733
+ * Lists the known API services available for the given encyclopedia version.
91734
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/encyclopedia/v{version}`
91735
+ *
91736
+ * @example
91737
+ * import { encyclopediaAdapter } from 'epicenter-libs';
91738
+ * const services = await encyclopediaAdapter.listServices(3);
91739
+ *
91740
+ * @param version Encyclopedia version number
91741
+ * @param [optionals] Optional arguments; pass network call options overrides here.
91742
+ * @returns promise that resolves to an array of known service descriptors
91743
+ */
91744
+ async function listServices(version, optionals = {}) {
91745
+ return await new Router().get(`/encyclopedia/v${version}`, optionals).then(({
91746
+ body
91747
+ }) => body);
91748
+ }
91749
+
91750
+ /**
91751
+ * Retrieves the documented resource (API documentation) for a specific service and encyclopedia version.
91752
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/encyclopedia/v{version}/{api}`
91753
+ *
91754
+ * @example
91755
+ * import { encyclopediaAdapter } from 'epicenter-libs';
91756
+ * const resource = await encyclopediaAdapter.getResource(3, 'run');
91757
+ *
91758
+ * @param version Encyclopedia version number
91759
+ * @param api Name of the API service to retrieve documentation for
91760
+ * @param [optionals] Optional arguments; pass network call options overrides here.
91761
+ * @returns promise that resolves to the documented resource containing endpoints and definitions
91762
+ */
91763
+ async function getResource(version, api, optionals = {}) {
91764
+ return await new Router().get(`/encyclopedia/v${version}/${api}`, optionals).then(({
91765
+ body
91766
+ }) => body);
91767
+ }
91768
+
91769
+ /**
91770
+ * Retrieves a translated representation of the API documentation for a specific service and encyclopedia version.
91771
+ * Supported translators are ASCIIDOC, ASCIIDOC_TO_HTML, and OPENAPI.
91772
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/encyclopedia/as/{translator}/v{version}/{api}`
91773
+ *
91774
+ * NOTE: The backend returns the translated content with a translator-specific content-type
91775
+ * (e.g. `text/asciidoc`, `text/html`, `application/json`). The shared Router throws when the
91776
+ * response content-type is not `application/json`, so only the OPENAPI translator works here.
91777
+ * For ASCIIDOC and ASCIIDOC_TO_HTML, use the underlying fetch API directly against the
91778
+ * constructed URL.
91779
+ *
91780
+ * @example
91781
+ * import { encyclopediaAdapter } from 'epicenter-libs';
91782
+ * const openApiDoc = await encyclopediaAdapter.translate('OPENAPI', 3, 'run');
91783
+ *
91784
+ * @param translator Output format for the documentation; one of 'ASCIIDOC', 'ASCIIDOC_TO_HTML', or 'OPENAPI'
91785
+ * @param version Encyclopedia version number
91786
+ * @param api Name of the API service to translate documentation for
91787
+ * @param [optionals] Optional arguments; pass network call options overrides here.
91788
+ * @returns promise that resolves to the translated documentation (only when translator is 'OPENAPI')
91789
+ */
91790
+ async function translate(translator, version, api, optionals = {}) {
91791
+ return await new Router().get(`/encyclopedia/as/${translator}/v${version}/${api}`, optionals).then(({
91792
+ body
91793
+ }) => body);
91794
+ }
91795
+
91796
+ var encyclopedia = /*#__PURE__*/Object.freeze({
91797
+ __proto__: null,
91798
+ getResource: getResource,
91799
+ listServices: listServices,
91800
+ translate: translate
91801
+ });
91802
+
91803
+ /* File paths are free-form, user-authored strings that may contain spaces or URL-reserved
91804
+ * characters. Encode each segment while preserving the '/' separators that the backend's
91805
+ * `{filePath:.*}` routes expect. */
91806
+ const encodePath = filePath => filePath.split('/').map(encodeURIComponent).join('/');
91807
+
91808
+ /**
91809
+ * Lists files and directories at the project root or at a specific path.
91810
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file[/{filePath}]`
91811
+ *
91812
+ * @example
91813
+ * import { fileAdapter } from 'epicenter-libs';
91814
+ * // List all files at root
91815
+ * const entries = await fileAdapter.list();
91816
+ * // List contents of a specific directory up to 2 levels deep
91817
+ * const entries = await fileAdapter.list('src', { depth: 2 });
91818
+ *
91819
+ * @param [filePath] Path to a file or directory; omit to list the project root
91820
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
91821
+ * @param [optionals.depth] Maximum depth of directory traversal to include in the response
91822
+ * @returns promise that resolves to an array of file and directory entries
91823
+ */
91824
+ async function list(filePath, optionals = {}) {
91825
+ const {
91826
+ depth,
91827
+ ...routingOptions
91828
+ } = optionals;
91829
+ const uriComponent = filePath ? `/${encodePath(filePath)}` : '';
91830
+ return await new Router().withSearchParams({
91831
+ depth
91832
+ }).get(`/file${uriComponent}`, routingOptions).then(({
91833
+ body
91834
+ }) => body);
91835
+ }
91836
+
91837
+ /**
91838
+ * Uploads and replaces files at the project root or at a specific path using multipart/form-data (PUT).
91839
+ * Use this when you want to overwrite existing files. For creating new files, use `create`.
91840
+ * Base URL: PUT `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file[/{filePath}]`
91841
+ *
91842
+ * NOTE: This is browser-only. The `FormData` body is only serialized as multipart/form-data when
91843
+ * running in a browser environment; in Node it will not be sent correctly.
91844
+ *
91845
+ * @example
91846
+ * import { fileAdapter } from 'epicenter-libs';
91847
+ * const formData = new FormData();
91848
+ * formData.append('file', myFile);
91849
+ * const uploaded = await fileAdapter.upload(formData, 'models/model.py');
91850
+ *
91851
+ * @param formData Multipart form data containing the file(s) to upload
91852
+ * @param [filePath] Destination path for the file(s); omit to upload to the project root
91853
+ * @param [optionals] Optional arguments; pass network call options overrides here.
91854
+ * @returns promise that resolves to an array of the uploaded file entries
91855
+ */
91856
+ async function upload(formData, filePath, optionals = {}) {
91857
+ const uriComponent = filePath ? `/${encodePath(filePath)}` : '';
91858
+ return await new Router().put(`/file${uriComponent}`, {
91859
+ body: formData,
91860
+ ...optionals
91861
+ }).then(({
91862
+ body
91863
+ }) => body);
91864
+ }
91865
+
91866
+ /**
91867
+ * Creates new files at the project root or at a specific path using multipart/form-data (POST).
91868
+ * Use this when creating new files. For overwriting existing files, use `upload`.
91869
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file[/{filePath}]`
91870
+ *
91871
+ * NOTE: This is browser-only. The `FormData` body is only serialized as multipart/form-data when
91872
+ * running in a browser environment; in Node it will not be sent correctly.
91873
+ *
91874
+ * @example
91875
+ * import { fileAdapter } from 'epicenter-libs';
91876
+ * const formData = new FormData();
91877
+ * formData.append('file', myFile);
91878
+ * const created = await fileAdapter.create(formData, 'models/model.py');
91879
+ *
91880
+ * @param formData Multipart form data containing the file(s) to create
91881
+ * @param [filePath] Destination path for the file(s); omit to create at the project root
91882
+ * @param [optionals] Optional arguments; pass network call options overrides here.
91883
+ * @returns promise that resolves to an array of the created file entries
91884
+ */
91885
+ async function create$1(formData, filePath, optionals = {}) {
91886
+ const uriComponent = filePath ? `/${encodePath(filePath)}` : '';
91887
+ return await new Router().post(`/file${uriComponent}`, {
91888
+ body: formData,
91889
+ ...optionals
91890
+ }).then(({
91891
+ body
91892
+ }) => body);
91893
+ }
91894
+
91895
+ /**
91896
+ * Deletes a file or directory at the project root or at a specific path.
91897
+ * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file[/{filePath}]`
91898
+ *
91899
+ * @example
91900
+ * import { fileAdapter } from 'epicenter-libs';
91901
+ * // Delete a specific file
91902
+ * await fileAdapter.remove('models/old-model.py');
91903
+ * // Delete all files at the project root
91904
+ * await fileAdapter.remove();
91905
+ *
91906
+ * @param [filePath] Path of the file or directory to delete; omit to delete all files at the project root
91907
+ * @param [optionals] Optional arguments; pass network call options overrides here.
91908
+ * @returns promise that resolves when the deletion is complete
91909
+ */
91910
+ async function remove(filePath, optionals = {}) {
91911
+ const uriComponent = filePath ? `/${encodePath(filePath)}` : '';
91912
+ return await new Router().delete(`/file${uriComponent}`, optionals).then(({
91913
+ body
91914
+ }) => body);
91915
+ }
91916
+
91917
+ /**
91918
+ * Downloads the raw content of a file at the specified path.
91919
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file/download/{filePath}`
91920
+ *
91921
+ * NOTE: The backend streams the file with its detected content type (e.g. `application/zip`,
91922
+ * `text/plain`, `application/octet-stream`). The shared Router throws when the response
91923
+ * content-type is not `application/json`, so this call only succeeds for JSON files. To download
91924
+ * other file types, use the underlying fetch API directly against the constructed URL.
91925
+ *
91926
+ * @example
91927
+ * import { fileAdapter } from 'epicenter-libs';
91928
+ * const content = await fileAdapter.download('config.json');
91929
+ *
91930
+ * @param filePath Path to the file to download
91931
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
91932
+ * @param [optionals.depth] Currently unused on the backend; reserved for future expansion.
91933
+ * @returns promise that resolves to the raw file content
91934
+ */
91935
+ async function download(filePath, optionals = {}) {
91936
+ const {
91937
+ depth,
91938
+ ...routingOptions
91939
+ } = optionals;
91940
+ return await new Router().withSearchParams({
91941
+ depth
91942
+ }).get(`/file/download/${encodePath(filePath)}`, routingOptions).then(({
91943
+ body
91944
+ }) => body);
91945
+ }
91946
+
91947
+ /**
91948
+ * Lists files and directories matching a glob filter pattern, optionally scoped to a specific path.
91949
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file/filter/{filter}[/{filePath}]`
91950
+ *
91951
+ * @example
91952
+ * import { fileAdapter } from 'epicenter-libs';
91953
+ * // List all Python files in the project
91954
+ * const pyFiles = await fileAdapter.listByFilter('*.py');
91955
+ * // List all Python files within the 'models' directory
91956
+ * const pyFiles = await fileAdapter.listByFilter('*.py', 'models');
91957
+ *
91958
+ * @param filter Glob pattern to filter files by (e.g., '*.py', '*.json')
91959
+ * @param [filePath] Directory path to scope the filter to; omit to search the entire project
91960
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
91961
+ * @param [optionals.depth] Maximum depth of directory traversal to include in the response
91962
+ * @returns promise that resolves to an array of matching file and directory entries
91963
+ */
91964
+ async function listByFilter(filter, filePath, optionals = {}) {
91965
+ const {
91966
+ depth,
91967
+ ...routingOptions
91968
+ } = optionals;
91969
+ const uriComponent = filePath ? `/${encodePath(filePath)}` : '';
91970
+ return await new Router().withSearchParams({
91971
+ depth
91972
+ }).get(`/file/filter/${encodeURIComponent(filter)}${uriComponent}`, routingOptions).then(({
91973
+ body
91974
+ }) => body);
91975
+ }
91976
+
91977
+ /**
91978
+ * Compresses files into a ZIP archive at the project root or at a specific path.
91979
+ * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file/compress[/{filePath}]`
91980
+ *
91981
+ * NOTE: The backend streams the resulting archive with content-type `application/zip`. The
91982
+ * shared Router throws when the response content-type is not `application/json`, so this call
91983
+ * will not return the archive bytes through the normal flow. To retrieve the archive, use the
91984
+ * underlying fetch API directly against the constructed URL.
91985
+ *
91986
+ * @example
91987
+ * import { fileAdapter } from 'epicenter-libs';
91988
+ * // Compress a specific file or directory
91989
+ * await fileAdapter.compress('models');
91990
+ * // Compress at root
91991
+ * await fileAdapter.compress();
91992
+ *
91993
+ * @param [filePath] Path of the file or directory to compress; omit to compress at the project root
91994
+ * @param [optionals] Optional arguments; pass network call options overrides here.
91995
+ * @returns promise that resolves to the compression result
91996
+ */
91997
+ async function compress(filePath, optionals = {}) {
91998
+ const uriComponent = filePath ? `/${encodePath(filePath)}` : '';
91999
+ return await new Router().patch(`/file/compress${uriComponent}`, optionals).then(({
92000
+ body
92001
+ }) => body);
92002
+ }
92003
+
92004
+ /**
92005
+ * Extracts (explodes) a ZIP archive at the project root or at a specific path in place,
92006
+ * deleting the archive after extraction.
92007
+ * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file/explode[/{filePath}]`
92008
+ *
92009
+ * @example
92010
+ * import { fileAdapter } from 'epicenter-libs';
92011
+ * // Extract a specific archive
92012
+ * await fileAdapter.explode('archive.zip');
92013
+ * // Explode at root
92014
+ * await fileAdapter.explode();
92015
+ *
92016
+ * @param [filePath] Path of the archive to extract; omit to extract at the project root
92017
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92018
+ * @returns promise that resolves when the extraction is complete
92019
+ */
92020
+ async function explode(filePath, optionals = {}) {
92021
+ const uriComponent = filePath ? `/${encodePath(filePath)}` : '';
92022
+ return await new Router().patch(`/file/explode${uriComponent}`, optionals).then(({
92023
+ body
92024
+ }) => body);
92025
+ }
92026
+
92027
+ /**
92028
+ * Moves a file or directory from one path to another within the project.
92029
+ * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file/move`
92030
+ *
92031
+ * @example
92032
+ * import { fileAdapter } from 'epicenter-libs';
92033
+ * await fileAdapter.move('models/old-name.py', 'models/new-name.py');
92034
+ * // Move and include the origin directory itself
92035
+ * await fileAdapter.move('old-dir', 'new-dir', { includeOrigin: true });
92036
+ *
92037
+ * @param origin Origin path of the file or directory to move
92038
+ * @param destination Destination path to move the file or directory to
92039
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
92040
+ * @param [optionals.includeOrigin] Whether to include the origin directory itself in the move
92041
+ * @returns promise that resolves when the move is complete
92042
+ */
92043
+ async function move(origin, destination, optionals = {}) {
92044
+ const {
92045
+ includeOrigin,
92046
+ ...routingOptions
92047
+ } = optionals;
92048
+ return await new Router().patch('/file/move', {
92049
+ body: {
92050
+ origin,
92051
+ destination,
92052
+ includeOrigin
92053
+ },
92054
+ ...routingOptions
92055
+ }).then(({
92056
+ body
92057
+ }) => body);
92058
+ }
92059
+
92060
+ /**
92061
+ * Creates a new directory at the specified path.
92062
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file/directory/{filePath}`
92063
+ *
92064
+ * @example
92065
+ * import { fileAdapter } from 'epicenter-libs';
92066
+ * const dir = await fileAdapter.createDirectory('models/new-folder');
92067
+ *
92068
+ * @param filePath Path at which to create the new directory
92069
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92070
+ * @returns promise that resolves to the created directory entry
92071
+ */
92072
+ async function createDirectory(filePath, optionals = {}) {
92073
+ return await new Router().post(`/file/directory/${encodePath(filePath)}`, optionals).then(({
92074
+ body
92075
+ }) => body);
92076
+ }
92077
+
92078
+ var file = /*#__PURE__*/Object.freeze({
92079
+ __proto__: null,
92080
+ compress: compress,
92081
+ create: create$1,
92082
+ createDirectory: createDirectory,
92083
+ download: download,
92084
+ explode: explode,
92085
+ list: list,
92086
+ listByFilter: listByFilter,
92087
+ move: move,
92088
+ remove: remove,
92089
+ upload: upload
92090
+ });
92091
+
92092
+ /**
92093
+ * Currently the API only supports `SAML`. This type is intentionally narrow so that adding new
92094
+ * protocols on the backend requires an explicit type update here.
92095
+ */
92096
+
92097
+ /**
92098
+ * Gets registration info for a self-registration token.
92099
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/self/{token}`
92100
+ *
92101
+ * @example
92102
+ * import { registrationAdapter } from 'epicenter-libs';
92103
+ * const info = await registrationAdapter.getSelfRegistrationInfo('my-token');
92104
+ *
92105
+ * @param token Self-registration token
92106
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92107
+ * @returns promise that resolves to registration info
92108
+ */
92109
+ async function getSelfRegistrationInfo(token, optionals = {}) {
92110
+ return await new Router().get(`/registration/self/${token}`, optionals).then(({
92111
+ body
92112
+ }) => body);
92113
+ }
92114
+
92115
+ /**
92116
+ * Completes a self-registration using a token.
92117
+ * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/self/{token}`
92118
+ *
92119
+ * @example
92120
+ * import { registrationAdapter } from 'epicenter-libs';
92121
+ * const result = await registrationAdapter.completeSelfRegistration('my-token', 'secret123', {
92122
+ * displayName: 'John Doe',
92123
+ * handle: 'johnd',
92124
+ * });
92125
+ *
92126
+ * @param token Self-registration token
92127
+ * @param password Password for the new account
92128
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92129
+ * @param [optionals.displayName] Display name for the new user
92130
+ * @param [optionals.givenName] Given name for the new user
92131
+ * @param [optionals.familyName] Family name for the new user
92132
+ * @param [optionals.handle] Handle for the new user
92133
+ * @returns promise that resolves to the registration result including session info
92134
+ */
92135
+ async function completeSelfRegistration(token, password, optionals = {}) {
92136
+ const {
92137
+ displayName,
92138
+ givenName,
92139
+ familyName,
92140
+ handle,
92141
+ ...routingOptions
92142
+ } = optionals;
92143
+ return await new Router().patch(`/registration/self/${token}`, {
92144
+ body: {
92145
+ password,
92146
+ displayName,
92147
+ givenName,
92148
+ familyName,
92149
+ handle
92150
+ },
92151
+ ...routingOptions
92152
+ }).then(({
92153
+ body
92154
+ }) => body);
92155
+ }
92156
+
92157
+ /**
92158
+ * Sends a self-registration invite email to a user. Pass an `Accept-Language` header via
92159
+ * `optionals.headers` to localize the email.
92160
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/self/{groupKey}`
92161
+ *
92162
+ * @example
92163
+ * import { registrationAdapter } from 'epicenter-libs';
92164
+ * await registrationAdapter.sendSelfRegistrationInvite('group-key', 'user@example.com', {
92165
+ * linkDestination: 'DASHBOARD',
92166
+ * redirectUrl: 'https://app.example.com',
92167
+ * headers: { 'Accept-Language': 'fr-FR' },
92168
+ * });
92169
+ *
92170
+ * @param groupKey Group key to register the user into
92171
+ * @param email Email address of the user to invite
92172
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92173
+ * @param [optionals.linkDestination] Destination for the registration link ('DASHBOARD' or 'MANAGER')
92174
+ * @param [optionals.modality] Registration modality
92175
+ * @param [optionals.redirectUrl] URL to redirect to after registration
92176
+ * @param [optionals.subject] Subject line for the invite email
92177
+ * @param [optionals.givenName] Pre-populate given name in the registration form
92178
+ * @param [optionals.familyName] Pre-populate family name in the registration form
92179
+ * @param [optionals.linkUrl] Custom URL to use for the registration link
92180
+ * @param [optionals.confirmation] Whether to send a confirmation email
92181
+ * @returns promise that resolves to undefined if successful
92182
+ */
92183
+ async function sendSelfRegistrationInvite(groupKey, email, optionals = {}) {
92184
+ const {
92185
+ linkDestination,
92186
+ modality,
92187
+ redirectUrl,
92188
+ subject,
92189
+ givenName,
92190
+ familyName,
92191
+ linkUrl,
92192
+ confirmation,
92193
+ ...routingOptions
92194
+ } = optionals;
92195
+ return await new Router().post(`/registration/self/${groupKey}`, {
92196
+ body: {
92197
+ email,
92198
+ linkDestination,
92199
+ modality,
92200
+ redirectUrl,
92201
+ subject,
92202
+ givenName,
92203
+ familyName,
92204
+ linkUrl,
92205
+ confirmation
92206
+ },
92207
+ ...routingOptions
92208
+ }).then(({
92209
+ body
92210
+ }) => body);
92211
+ }
92212
+
92213
+ /**
92214
+ * Gets registration info for an invite token.
92215
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/invite/{token}`
92216
+ *
92217
+ * @example
92218
+ * import { registrationAdapter } from 'epicenter-libs';
92219
+ * const info = await registrationAdapter.getInviteRegistrationInfo('invite-token');
92220
+ *
92221
+ * @param token Invite registration token
92222
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92223
+ * @returns promise that resolves to registration info
92224
+ */
92225
+ async function getInviteRegistrationInfo(token, optionals = {}) {
92226
+ return await new Router().get(`/registration/invite/${token}`, optionals).then(({
92227
+ body
92228
+ }) => body);
92229
+ }
92230
+
92231
+ /**
92232
+ * Completes an invite registration using a token.
92233
+ * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/invite/{token}`
92234
+ *
92235
+ * @example
92236
+ * import { registrationAdapter } from 'epicenter-libs';
92237
+ * const result = await registrationAdapter.completeInviteRegistration('invite-token', 'pass456', {
92238
+ * displayName: 'Jane Doe',
92239
+ * });
92240
+ *
92241
+ * @param token Invite registration token
92242
+ * @param password Password for the new account
92243
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92244
+ * @param [optionals.displayName] Display name for the new user
92245
+ * @param [optionals.givenName] Given name for the new user
92246
+ * @param [optionals.familyName] Family name for the new user
92247
+ * @param [optionals.handle] Handle for the new user
92248
+ * @returns promise that resolves to the registration result including session info
92249
+ */
92250
+ async function completeInviteRegistration(token, password, optionals = {}) {
92251
+ const {
92252
+ displayName,
92253
+ givenName,
92254
+ familyName,
92255
+ handle,
92256
+ ...routingOptions
92257
+ } = optionals;
92258
+ return await new Router().patch(`/registration/invite/${token}`, {
92259
+ body: {
92260
+ password,
92261
+ displayName,
92262
+ givenName,
92263
+ familyName,
92264
+ handle
92265
+ },
92266
+ ...routingOptions
92267
+ }).then(({
92268
+ body
92269
+ }) => body);
92270
+ }
92271
+
92272
+ /**
92273
+ * Sends an invite registration email to a user. Pass an `Accept-Language` header via
92274
+ * `optionals.headers` to localize the email.
92275
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/invite/{groupKey}`
92276
+ *
92277
+ * @example
92278
+ * import { registrationAdapter } from 'epicenter-libs';
92279
+ * await registrationAdapter.sendInvite('group-key', 'invited@example.com', {
92280
+ * givenName: 'New',
92281
+ * familyName: 'User',
92282
+ * redirectUrl: 'https://app.example.com',
92283
+ * });
92284
+ *
92285
+ * @param groupKey Group key to invite the user into
92286
+ * @param email Email address of the user to invite
92287
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92288
+ * @param [optionals.linkDestination] Destination for the registration link ('DASHBOARD' or 'MANAGER')
92289
+ * @param [optionals.modality] Registration modality
92290
+ * @param [optionals.redirectUrl] URL to redirect to after registration
92291
+ * @param [optionals.subject] Subject line for the invite email
92292
+ * @param [optionals.givenName] Pre-populate given name in the registration form
92293
+ * @param [optionals.familyName] Pre-populate family name in the registration form
92294
+ * @param [optionals.linkUrl] Custom URL to use for the registration link
92295
+ * @param [optionals.confirmation] Whether to send a confirmation email
92296
+ * @returns promise that resolves to undefined if successful
92297
+ */
92298
+ async function sendInvite(groupKey, email, optionals = {}) {
92299
+ const {
92300
+ linkDestination,
92301
+ modality,
92302
+ redirectUrl,
92303
+ subject,
92304
+ givenName,
92305
+ familyName,
92306
+ linkUrl,
92307
+ confirmation,
92308
+ ...routingOptions
92309
+ } = optionals;
92310
+ return await new Router().post(`/registration/invite/${groupKey}`, {
92311
+ body: {
92312
+ email,
92313
+ linkDestination,
92314
+ modality,
92315
+ redirectUrl,
92316
+ subject,
92317
+ givenName,
92318
+ familyName,
92319
+ linkUrl,
92320
+ confirmation
92321
+ },
92322
+ ...routingOptions
92323
+ }).then(({
92324
+ body
92325
+ }) => body);
92326
+ }
92327
+
92328
+ /**
92329
+ * Gets registration info for a team invite token.
92330
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/team/{token}`
92331
+ *
92332
+ * @example
92333
+ * import { registrationAdapter } from 'epicenter-libs';
92334
+ * const info = await registrationAdapter.getTeamRegistrationInfo('team-token');
92335
+ *
92336
+ * @param token Team invite token
92337
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92338
+ * @returns promise that resolves to team registration info
92339
+ */
92340
+ async function getTeamRegistrationInfo(token, optionals = {}) {
92341
+ return await new Router().get(`/registration/team/${token}`, optionals).then(({
92342
+ body
92343
+ }) => body);
92344
+ }
92345
+
92346
+ /**
92347
+ * Sends a team invite email. Pass an `Accept-Language` header via `optionals.headers` to
92348
+ * localize the email.
92349
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/team`
92350
+ *
92351
+ * @example
92352
+ * import { registrationAdapter } from 'epicenter-libs';
92353
+ * await registrationAdapter.sendTeamInvite(
92354
+ * 'Jane Author',
92355
+ * 'AUTHOR',
92356
+ * 'https://app.example.com',
92357
+ * 'newteammate@example.com',
92358
+ * { subject: 'Welcome to the team!' },
92359
+ * );
92360
+ *
92361
+ * @param invitingAuthor Name or identifier of the person sending the invite
92362
+ * @param role Role to assign to the invited user
92363
+ * @param redirectUrl URL to redirect to after accepting the invite
92364
+ * @param email Email address of the user to invite
92365
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92366
+ * @param [optionals.subject] Subject line for the invite email
92367
+ * @param [optionals.givenName] Pre-populate given name for the invited user
92368
+ * @param [optionals.familyName] Pre-populate family name for the invited user
92369
+ * @returns promise that resolves to undefined if successful
92370
+ */
92371
+ async function sendTeamInvite(invitingAuthor, role, redirectUrl, email, optionals = {}) {
92372
+ const {
92373
+ subject,
92374
+ givenName,
92375
+ familyName,
92376
+ ...routingOptions
92377
+ } = optionals;
92378
+ return await new Router().post('/registration/team', {
92379
+ body: {
92380
+ invitingAuthor,
92381
+ role,
92382
+ redirectUrl,
92383
+ email,
92384
+ subject,
92385
+ givenName,
92386
+ familyName
92387
+ },
92388
+ ...routingOptions
92389
+ }).then(({
92390
+ body
92391
+ }) => body);
92392
+ }
92393
+
92394
+ /**
92395
+ * @deprecated Use getSsoAdminRegistration or getSsoUserRegistration instead.
92396
+ * Gets SSO registration info for a given SSO protocol.
92397
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/sso/{ssoProtocol}`
92398
+ *
92399
+ * @example
92400
+ * import { registrationAdapter } from 'epicenter-libs';
92401
+ * const info = await registrationAdapter.getSsoRegistration('SAML');
92402
+ *
92403
+ * @param ssoProtocol The SSO protocol (e.g. 'SAML')
92404
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92405
+ * @returns promise that resolves to SSO registration data
92406
+ */
92407
+ async function getSsoRegistration(ssoProtocol, optionals = {}) {
92408
+ console.warn('DEPRECATION WARNING: registrationAdapter.getSsoRegistration is deprecated and will be removed with the next release. Use registrationAdapter.getSsoAdminRegistration or registrationAdapter.getSsoUserRegistration instead.');
92409
+ return await new Router().get(`/registration/sso/${ssoProtocol}`, optionals).then(({
92410
+ body
92411
+ }) => body);
92412
+ }
92413
+
92414
+ /**
92415
+ * Gets admin SSO registration info for a given SSO protocol.
92416
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/sso/admin/{ssoProtocol}`
92417
+ *
92418
+ * @example
92419
+ * import { registrationAdapter } from 'epicenter-libs';
92420
+ * const info = await registrationAdapter.getSsoAdminRegistration('SAML');
92421
+ *
92422
+ * @param ssoProtocol The SSO protocol (e.g. 'SAML')
92423
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92424
+ * @returns promise that resolves to SSO admin registration data
92425
+ */
92426
+ async function getSsoAdminRegistration(ssoProtocol, optionals = {}) {
92427
+ return await new Router().get(`/registration/sso/admin/${ssoProtocol}`, optionals).then(({
92428
+ body
92429
+ }) => body);
92430
+ }
92431
+
92432
+ /**
92433
+ * Gets user SSO registration info for a given SSO protocol.
92434
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/registration/sso/user/{ssoProtocol}`
92435
+ *
92436
+ * @example
92437
+ * import { registrationAdapter } from 'epicenter-libs';
92438
+ * const info = await registrationAdapter.getSsoUserRegistration('SAML');
92439
+ *
92440
+ * @param ssoProtocol The SSO protocol (e.g. 'SAML')
92441
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92442
+ * @returns promise that resolves to SSO user registration data
92443
+ */
92444
+ async function getSsoUserRegistration(ssoProtocol, optionals = {}) {
92445
+ return await new Router().get(`/registration/sso/user/${ssoProtocol}`, optionals).then(({
92446
+ body
92447
+ }) => body);
92448
+ }
92449
+
92450
+ var registration = /*#__PURE__*/Object.freeze({
92451
+ __proto__: null,
92452
+ completeInviteRegistration: completeInviteRegistration,
92453
+ completeSelfRegistration: completeSelfRegistration,
92454
+ getInviteRegistrationInfo: getInviteRegistrationInfo,
92455
+ getSelfRegistrationInfo: getSelfRegistrationInfo,
92456
+ getSsoAdminRegistration: getSsoAdminRegistration,
92457
+ getSsoRegistration: getSsoRegistration,
92458
+ getSsoUserRegistration: getSsoUserRegistration,
92459
+ getTeamRegistrationInfo: getTeamRegistrationInfo,
92460
+ sendInvite: sendInvite,
92461
+ sendSelfRegistrationInvite: sendSelfRegistrationInvite,
92462
+ sendTeamInvite: sendTeamInvite
92463
+ });
92464
+
92465
+ /**
92466
+ * Creates a new docket entry, scheduling a deferred operation for later execution.
92467
+ * Requires `support` level authorization.
92468
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/docket`
92469
+ *
92470
+ * @example
92471
+ * import { docketAdapter } from 'epicenter-libs';
92472
+ * const docket = await docketAdapter.create(
92473
+ * {
92474
+ * objectType: 'scale',
92475
+ * operatingSystem: 'LINUX',
92476
+ * workerShape: 'GS',
92477
+ * scale: {
92478
+ * active: true,
92479
+ * initialWorkerCount: 1,
92480
+ * additionalWorkerLimit: 4,
92481
+ * flavors: ['DOCKER'],
92482
+ * },
92483
+ * },
92484
+ * { objectType: 'date', value: '2026-06-01T00:00:00Z' },
92485
+ * '2026-05-20T00:00:00Z',
92486
+ * { ttlMinutes: 60 },
92487
+ * );
92488
+ *
92489
+ * @param payload Docket payload describing the operation to schedule
92490
+ * @param trigger Trigger describing when the operation should fire
92491
+ * (cron, date, or offset)
92492
+ * @param date ISO-8601 date string indicating when the docket is scheduled
92493
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
92494
+ * @param [optionals.ttlMinutes] Time-to-live in minutes for the docket entry (minimum 2)
92495
+ * @returns promise that resolves to the newly created docket
92496
+ */
92497
+ async function create(payload, trigger, date, optionals = {}) {
92498
+ const {
92499
+ ttlMinutes,
92500
+ ...routingOptions
92501
+ } = optionals;
92502
+ return await new Router().post('/docket', {
92503
+ body: {
92504
+ payload,
92505
+ trigger,
92506
+ date,
92507
+ ttlMinutes
92508
+ },
92509
+ ...routingOptions
92510
+ }).then(({
92511
+ body
92512
+ }) => body);
92513
+ }
92514
+
92515
+ var docket = /*#__PURE__*/Object.freeze({
92516
+ __proto__: null,
92517
+ create: create
92518
+ });
92519
+
91525
92520
  // Generic type for push channel message custom data
91526
92521
 
91527
92522
  // Base structure for channel push messages
@@ -91712,6 +92707,367 @@ class Channel {
91712
92707
  }
91713
92708
  }
91714
92709
 
92710
+ // ──────────────────────────────────────────────
92711
+ // Types
92712
+ // ──────────────────────────────────────────────
92713
+
92714
+ // ──────────────────────────────────────────────
92715
+ // Functions
92716
+ // ──────────────────────────────────────────────
92717
+
92718
+ /**
92719
+ * Retrieves the git integration configuration for the project.
92720
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git`
92721
+ *
92722
+ * @example
92723
+ * import { gitAdapter } from 'epicenter-libs';
92724
+ * const integration = await gitAdapter.get();
92725
+ *
92726
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92727
+ * @returns promise that resolves to the git integration configuration
92728
+ */
92729
+ async function get(optionals = {}) {
92730
+ return new Router().get('/git', optionals).then(({
92731
+ body
92732
+ }) => body);
92733
+ }
92734
+
92735
+ /**
92736
+ * Retrieves the current git status for the project.
92737
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/status`
92738
+ *
92739
+ * @example
92740
+ * import { gitAdapter } from 'epicenter-libs';
92741
+ * const status = await gitAdapter.getStatus();
92742
+ * console.log(status.currentBranch);
92743
+ *
92744
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92745
+ * @returns promise that resolves to the git status, including the current branch
92746
+ */
92747
+ async function getStatus(optionals = {}) {
92748
+ return new Router().get('/git/status', optionals).then(({
92749
+ body
92750
+ }) => body);
92751
+ }
92752
+
92753
+ /**
92754
+ * Checks out a branch in the project's git repository.
92755
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/checkout/{branch}`
92756
+ *
92757
+ * @example
92758
+ * import { gitAdapter } from 'epicenter-libs';
92759
+ * await gitAdapter.checkout('main');
92760
+ *
92761
+ * @param branch Name of the branch to check out
92762
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92763
+ * @returns promise that resolves when the checkout is complete
92764
+ */
92765
+ async function checkout(branch, optionals = {}) {
92766
+ return new Router().get(`/git/checkout/${branch}`, optionals).then(({
92767
+ body
92768
+ }) => body);
92769
+ }
92770
+
92771
+ /**
92772
+ * Resets the project's git repository, optionally to a specific branch.
92773
+ * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/reset[/{branch}]`
92774
+ *
92775
+ * @example
92776
+ * import { gitAdapter } from 'epicenter-libs';
92777
+ * await gitAdapter.reset(); // reset current branch
92778
+ * await gitAdapter.reset({ branch: 'main' }); // reset to 'main'
92779
+ *
92780
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
92781
+ * @param [optionals.branch] Branch to reset to; if omitted, resets the current branch
92782
+ * @returns promise that resolves when the reset is complete
92783
+ */
92784
+ async function reset(optionals = {}) {
92785
+ const {
92786
+ branch,
92787
+ ...routingOptions
92788
+ } = optionals;
92789
+ return new Router().delete(`/git/reset${branch ? `/${branch}` : ''}`, routingOptions).then(({
92790
+ body
92791
+ }) => body);
92792
+ }
92793
+
92794
+ /**
92795
+ * Creates a git integration for the project.
92796
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/integration`
92797
+ *
92798
+ * @example
92799
+ * import { gitAdapter } from 'epicenter-libs';
92800
+ * const integration = await gitAdapter.createIntegration({
92801
+ * uri: 'git@github.com:myorg/myrepo.git',
92802
+ * publicKey: '...',
92803
+ * privateKey: '...',
92804
+ * publicKeySpec: 'openssh',
92805
+ * privateKeySpec: 'pkcs8',
92806
+ * algorithm: 'ed25519',
92807
+ * });
92808
+ *
92809
+ * @param integration Git integration configuration to create
92810
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92811
+ * @returns promise that resolves to the created git integration
92812
+ */
92813
+ async function createIntegration(integration, optionals = {}) {
92814
+ return new Router().post('/git/integration', {
92815
+ body: integration,
92816
+ ...optionals
92817
+ }).then(({
92818
+ body
92819
+ }) => body);
92820
+ }
92821
+
92822
+ /**
92823
+ * Updates the git integration for the project.
92824
+ * Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/integration`
92825
+ *
92826
+ * @example
92827
+ * import { gitAdapter } from 'epicenter-libs';
92828
+ * const integration = await gitAdapter.updateIntegration({
92829
+ * uri: 'git@github.com:myorg/newrepo.git',
92830
+ * publicKeySpec: 'openssh',
92831
+ * privateKeySpec: 'pkcs8',
92832
+ * algorithm: 'ed25519',
92833
+ * });
92834
+ *
92835
+ * @param integration Fields to update on the git integration
92836
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92837
+ * @returns promise that resolves to the updated git integration
92838
+ */
92839
+ async function updateIntegration(integration, optionals = {}) {
92840
+ return new Router().patch('/git/integration', {
92841
+ body: integration,
92842
+ ...optionals
92843
+ }).then(({
92844
+ body
92845
+ }) => body);
92846
+ }
92847
+
92848
+ /**
92849
+ * Removes the git integration for the project.
92850
+ * Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/integration`
92851
+ *
92852
+ * @example
92853
+ * import { gitAdapter } from 'epicenter-libs';
92854
+ * await gitAdapter.removeIntegration();
92855
+ *
92856
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92857
+ * @returns promise that resolves when the integration is removed
92858
+ */
92859
+ async function removeIntegration(optionals = {}) {
92860
+ return new Router().delete('/git/integration', optionals).then(({
92861
+ body
92862
+ }) => body);
92863
+ }
92864
+
92865
+ /**
92866
+ * Pushes local commits to the remote git repository.
92867
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/push`
92868
+ *
92869
+ * @example
92870
+ * import { gitAdapter } from 'epicenter-libs';
92871
+ * await gitAdapter.push({ message: 'Update simulation data' });
92872
+ *
92873
+ * @param optionals Arguments object; also accepts network call option overrides.
92874
+ * @param optionals.message Commit message (required)
92875
+ * @param [optionals.password] Password for authentication
92876
+ * @param [optionals.force] Force-push, bypassing non-fast-forward checks
92877
+ * @returns promise that resolves when the push is complete
92878
+ */
92879
+ async function push(optionals) {
92880
+ const {
92881
+ message,
92882
+ password,
92883
+ force,
92884
+ ...routingOptions
92885
+ } = optionals;
92886
+ return new Router().withSearchParams({
92887
+ force
92888
+ }).post('/git/push', {
92889
+ body: {
92890
+ message,
92891
+ password
92892
+ },
92893
+ ...routingOptions
92894
+ }).then(({
92895
+ body
92896
+ }) => body);
92897
+ }
92898
+
92899
+ /**
92900
+ * Pulls changes from the remote git repository into the project.
92901
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/pull`
92902
+ *
92903
+ * @example
92904
+ * import { gitAdapter } from 'epicenter-libs';
92905
+ * await gitAdapter.pull({ force: true, confirm: true });
92906
+ *
92907
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
92908
+ * @param [optionals.password] Password for authentication
92909
+ * @param [optionals.force] Force the pull, overwriting local changes
92910
+ * @param [optionals.confirm] Set the `X-Forio-Confirmation` header to confirm an overwrite
92911
+ * @returns promise that resolves when the pull is complete
92912
+ */
92913
+ async function pull(optionals = {}) {
92914
+ const {
92915
+ password,
92916
+ force,
92917
+ confirm,
92918
+ headers: headersOverride,
92919
+ ...routingOptions
92920
+ } = optionals;
92921
+ const headers = Object.assign({}, headersOverride, confirm ? {
92922
+ 'X-Forio-Confirmation': true
92923
+ } : {});
92924
+ return new Router().withSearchParams({
92925
+ force
92926
+ }).post('/git/pull', {
92927
+ body: {
92928
+ password
92929
+ },
92930
+ headers,
92931
+ ...routingOptions
92932
+ }).then(({
92933
+ body
92934
+ }) => body);
92935
+ }
92936
+
92937
+ var git = /*#__PURE__*/Object.freeze({
92938
+ __proto__: null,
92939
+ checkout: checkout,
92940
+ createIntegration: createIntegration,
92941
+ get: get,
92942
+ getStatus: getStatus,
92943
+ pull: pull,
92944
+ push: push,
92945
+ removeIntegration: removeIntegration,
92946
+ reset: reset,
92947
+ updateIntegration: updateIntegration
92948
+ });
92949
+
92950
+ // ──────────────────────────────────────────────
92951
+ // Data Points
92952
+ // ──────────────────────────────────────────────
92953
+
92954
+ // ──────────────────────────────────────────────
92955
+ // Chart Series
92956
+ // ──────────────────────────────────────────────
92957
+
92958
+ // ──────────────────────────────────────────────
92959
+ // Chart, Table, Picture
92960
+ // ──────────────────────────────────────────────
92961
+
92962
+ // ──────────────────────────────────────────────
92963
+ // Binary Data
92964
+ // ──────────────────────────────────────────────
92965
+
92966
+ // ──────────────────────────────────────────────
92967
+ // Environment, Slide, Document
92968
+ // ──────────────────────────────────────────────
92969
+
92970
+ /**
92971
+ * Generates a PowerPoint file from a template and returns it as binary data (JSON-encoded)
92972
+ * Base URL: PUT `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/powerpoint/{TEMPLATE_DIRECTORY}/{TEMPLATE_PATH}`
92973
+ *
92974
+ * @example
92975
+ * import { powerpointAdapter } from 'epicenter-libs';
92976
+ * const binaryData = await powerpointAdapter.generate('MODEL', 'en-US-debrief-template.pptx', {
92977
+ * output: 'debrief-slides.pptx',
92978
+ * environment: {},
92979
+ * slides: [
92980
+ * {
92981
+ * number: 1,
92982
+ * environment: {
92983
+ * tables: [{ name: 'Leaderboard', data: [['Rank', 'Name', 'Score']] }],
92984
+ * },
92985
+ * },
92986
+ * ],
92987
+ * });
92988
+ *
92989
+ * @param templateDirectory Directory where the template is stored: 'DATA' or 'MODEL'
92990
+ * @param templatePath Path to the template file within the directory
92991
+ * @param document Document shadow defining the output filename, environment, and slides
92992
+ * @param [optionals] Optional arguments; pass network call options overrides here.
92993
+ * @returns promise that resolves to the generated PowerPoint as BinaryData
92994
+ */
92995
+ async function generate(templateDirectory, templatePath, document, optionals = {}) {
92996
+ return new Router().put(`/powerpoint/${templateDirectory}/${templatePath}`, {
92997
+ body: document,
92998
+ ...optionals
92999
+ }).then(({
93000
+ body
93001
+ }) => body);
93002
+ }
93003
+
93004
+ /**
93005
+ * Generates a PowerPoint file from a template and returns it as a streaming response.
93006
+ * Useful for downloading the generated file directly.
93007
+ * Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/powerpoint/{TEMPLATE_DIRECTORY}/{TEMPLATE_PATH}`
93008
+ *
93009
+ * @example
93010
+ * import { powerpointAdapter } from 'epicenter-libs';
93011
+ * const response = await powerpointAdapter.stream('MODEL', 'en-US-debrief-template.pptx', {
93012
+ * output: 'debrief-slides.pptx',
93013
+ * environment: {},
93014
+ * slides: [],
93015
+ * });
93016
+ * const blob = await response.blob();
93017
+ *
93018
+ * @param templateDirectory Directory where the template is stored: 'DATA' or 'MODEL'
93019
+ * @param templatePath Path to the template file within the directory
93020
+ * @param document Document shadow defining the output filename, environment, and slides
93021
+ * @param [optionals] Optional arguments; pass network call options overrides here.
93022
+ * @returns promise that resolves to the raw Response for streaming/blob handling
93023
+ */
93024
+ async function stream(templateDirectory, templatePath, document, optionals = {}) {
93025
+ const {
93026
+ server,
93027
+ accountShortName,
93028
+ projectShortName,
93029
+ useProjectProxy,
93030
+ query,
93031
+ headers: headersOverride,
93032
+ authorization,
93033
+ includeAuthorization
93034
+ } = optionals;
93035
+ const url = new Router().getURL(`/powerpoint/${templateDirectory}/${templatePath}`, {
93036
+ server,
93037
+ accountShortName,
93038
+ projectShortName,
93039
+ useProjectProxy,
93040
+ query
93041
+ });
93042
+ const headers = {
93043
+ 'Content-type': 'application/json; charset=UTF-8',
93044
+ ...headersOverride
93045
+ };
93046
+ if (includeAuthorization !== false) {
93047
+ const {
93048
+ session
93049
+ } = identification;
93050
+ if (!headers.Authorization) {
93051
+ if (session) headers.Authorization = `Bearer ${session.token}`;
93052
+ if (authorization) headers.Authorization = authorization;
93053
+ if (config.authOverride) headers.Authorization = config.authOverride;
93054
+ }
93055
+ }
93056
+ return fetch(url.toString(), {
93057
+ method: 'POST',
93058
+ cache: 'no-cache',
93059
+ redirect: 'follow',
93060
+ headers,
93061
+ body: JSON.stringify(document)
93062
+ });
93063
+ }
93064
+
93065
+ var powerpoint = /*#__PURE__*/Object.freeze({
93066
+ __proto__: null,
93067
+ generate: generate,
93068
+ stream: stream
93069
+ });
93070
+
91715
93071
  const proxy = async (resource, options) => {
91716
93072
  const {
91717
93073
  accountShortName,
@@ -91729,9 +93085,9 @@ var utilities = /*#__PURE__*/Object.freeze({
91729
93085
  proxy: proxy
91730
93086
  });
91731
93087
 
91732
- /* yes, this string template literal is weird;
91733
- * it's cause rollup does not recogize 3.34.1 as an individual token otherwise */
91734
- const version = `Epicenter (v${'3.34.1'}) for Module | Build Date: 2026-02-19T18:00:42.889Z`;
93088
+ /* "3.35.0", "Module" and "2026-07-21T22:45:13.866Z" are injected at build time — by
93089
+ * @rollup/plugin-replace for the shipped bundles and by Vite's `define` for tests */
93090
+ const version = `Epicenter (v${"3.35.0"}) for ${"Module"} | Build Date: ${"2026-07-21T22:45:13.866Z"}`;
91735
93091
  const UNAUTHORIZED = 401;
91736
93092
  const FORBIDDEN = 403;
91737
93093
  const DEFAULT_ERROR_HANDLERS = {};
@@ -91780,5 +93136,5 @@ DEFAULT_ERROR_HANDLERS.authInvalidated = errorManager.registerHandler(error => e
91780
93136
  });
91781
93137
  Object.freeze(DEFAULT_ERROR_HANDLERS);
91782
93138
 
91783
- export { Channel, DEFAULT_ERROR_HANDLERS, Fault, PUSH_CATEGORY, RITUAL, ROLE, Router, SCOPE_BOUNDARY, account as accountAdapter, admin as adminAdapter, asset as assetAdapter, authentication as authAdapter, chat as chatAdapter, cometdAdapter, config, consensus as consensusAdapter, daily as dailyAdapter, email as emailAdapter, episode as episodeAdapter, errorManager, group as groupAdapter, leaderboard as leaderboardAdapter, matchmaker as matchmakerAdapter, presence as presenceAdapter, project as projectAdapter, recaptcha as recaptchaAdapter, run as runAdapter, somebody as somebodyAdapter, task as taskAdapter, time as timeAdapter, user as userAdapter, utilities as utils, vault as vaultAdapter, version, video$1 as videoAPI, video as videoAdapter, vonage$1 as vonageAPI, vonage as vonageAdapter, wallet as walletAdapter, world as worldAdapter };
93139
+ export { Channel, DEFAULT_ERROR_HANDLERS, Fault, PUSH_CATEGORY, RITUAL, ROLE, Router, SCOPE_BOUNDARY, account as accountAdapter, admin as adminAdapter, asset as assetAdapter, authentication as authAdapter, chat as chatAdapter, cometdAdapter, config, consensus as consensusAdapter, daily as dailyAdapter, docket as docketAdapter, email as emailAdapter, encyclopedia as encyclopediaAdapter, episode as episodeAdapter, errorManager, file as fileAdapter, git as gitAdapter, group as groupAdapter, leaderboard as leaderboardAdapter, matchmaker as matchmakerAdapter, pipeline as pipelineAdapter, powerpoint as powerpointAdapter, presence as presenceAdapter, project as projectAdapter, recaptcha as recaptchaAdapter, registration as registrationAdapter, run as runAdapter, somebody as somebodyAdapter, task as taskAdapter, time as timeAdapter, user as userAdapter, utilities as utils, vault as vaultAdapter, version, video$1 as videoAPI, video as videoAdapter, vonage$1 as vonageAPI, vonage as vonageAdapter, wallet as walletAdapter, world as worldAdapter };
91784
93140
  //# sourceMappingURL=epicenter.js.map