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