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