deepline 0.3.294 → 0.3.296
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/dist/bundling-sources/sdk/src/compat.ts +35 -7
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +108 -35
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-api-origin.ts +25 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-http-errors.ts +14 -1
- package/dist/cli/auth-JCGIDVDF.mjs +31 -0
- package/dist/cli/auth-QDWV3TXX.js +31 -0
- package/dist/cli/billing-OQBSIXRG.mjs +1749 -0
- package/dist/cli/billing-YBK3J4WP.js +1749 -0
- package/dist/cli/chunk-2C3AVPTY.js +5688 -0
- package/dist/cli/chunk-2MZ5EQZE.mjs +499 -0
- package/dist/cli/chunk-3KC45UVF.js +150 -0
- package/dist/cli/chunk-3XX5TEA4.js +15 -0
- package/dist/cli/chunk-4MBOJQPL.mjs +0 -0
- package/dist/cli/chunk-4Y6CG4GE.js +2240 -0
- package/dist/cli/chunk-4ZB3CJRD.js +1269 -0
- package/dist/cli/chunk-5JLQPVNX.js +3056 -0
- package/dist/cli/chunk-6A3TJUWC.js +76 -0
- package/dist/cli/chunk-6HPEDBSJ.js +1995 -0
- package/dist/cli/chunk-7D6QG5KF.js +890 -0
- package/dist/cli/chunk-7P5AA3SN.js +344 -0
- package/dist/cli/chunk-7UAO5MWV.mjs +190 -0
- package/dist/cli/chunk-A7427JJH.js +190 -0
- package/dist/cli/chunk-AQRTLPHZ.js +735 -0
- package/dist/cli/chunk-AYHLUHE5.js +52 -0
- package/dist/cli/chunk-BZ77OTRF.mjs +923 -0
- package/dist/cli/chunk-CBVIJSHF.mjs +560 -0
- package/dist/cli/chunk-COGTRVWW.js +30 -0
- package/dist/cli/chunk-DLIRSHV6.mjs +28 -0
- package/dist/cli/chunk-DYWHXO7O.mjs +34 -0
- package/dist/cli/chunk-EDWJY6T4.mjs +3056 -0
- package/dist/cli/chunk-EXMLR72R.mjs +0 -0
- package/dist/cli/chunk-G46HHFNB.mjs +1269 -0
- package/dist/cli/chunk-GAMFK2ZP.mjs +148 -0
- package/dist/cli/chunk-GLKUGBTP.mjs +2240 -0
- package/dist/cli/chunk-GONRLVV3.js +3440 -0
- package/dist/cli/chunk-GVUJJJ5G.mjs +76 -0
- package/dist/cli/chunk-H7HIDGZ7.mjs +150 -0
- package/dist/cli/chunk-HUZXWOSK.mjs +503 -0
- package/dist/cli/chunk-I5YZLGMG.js +1 -0
- package/dist/cli/chunk-ITOFSXIU.mjs +15 -0
- package/dist/cli/chunk-J2D3VDOU.mjs +5688 -0
- package/dist/cli/chunk-J5NA2TTX.js +503 -0
- package/dist/cli/chunk-JCS5TPNY.mjs +3440 -0
- package/dist/cli/chunk-JNNOCMQY.js +47 -0
- package/dist/cli/chunk-KRD6H754.mjs +30 -0
- package/dist/cli/chunk-L4HBNHFW.js +34 -0
- package/dist/cli/chunk-LA46MMTL.js +560 -0
- package/dist/cli/chunk-LIKFCE7Z.js +190 -0
- package/dist/cli/chunk-MIMASXO4.mjs +389 -0
- package/dist/cli/chunk-NPPJX3BL.mjs +1995 -0
- package/dist/cli/chunk-NTEZFZLE.mjs +890 -0
- package/dist/cli/chunk-NXDRDJ4K.js +389 -0
- package/dist/cli/chunk-NXGCO4JB.mjs +344 -0
- package/dist/cli/chunk-OG64RBAC.js +6 -0
- package/dist/cli/chunk-OWJZUE3Y.mjs +103 -0
- package/dist/cli/chunk-QSIO4TX2.mjs +190 -0
- package/dist/cli/chunk-RCUE5C5C.mjs +735 -0
- package/dist/cli/chunk-SDK3ZA2C.js +103 -0
- package/dist/cli/chunk-SFLARO4Y.mjs +47 -0
- package/dist/cli/chunk-TAC3JIFE.mjs +354 -0
- package/dist/cli/chunk-UC6GHEL4.js +499 -0
- package/dist/cli/chunk-UFS752TU.mjs +52 -0
- package/dist/cli/chunk-UNEMDKXN.js +1 -0
- package/dist/cli/chunk-WB6Z2Q44.mjs +1622 -0
- package/dist/cli/chunk-WJYPBHTE.js +148 -0
- package/dist/cli/chunk-WOHBA5PV.js +354 -0
- package/dist/cli/chunk-WZYKRD7T.mjs +6 -0
- package/dist/cli/chunk-XNYIZMNQ.js +28 -0
- package/dist/cli/chunk-ZDO3TO3M.js +1622 -0
- package/dist/cli/chunk-ZDOC4HFL.js +923 -0
- package/dist/cli/client-CZDA4JKO.mjs +20 -0
- package/dist/cli/client-IZGIN2ZA.js +20 -0
- package/dist/cli/csv-6KOMZA2H.mjs +585 -0
- package/dist/cli/csv-UTEQY3NA.js +585 -0
- package/dist/cli/db-D5EP6TKO.mjs +486 -0
- package/dist/cli/db-SIBLPIKC.js +486 -0
- package/dist/cli/executions-2PHT57IO.js +28 -0
- package/dist/cli/executions-DFWM2YYY.mjs +28 -0
- package/dist/cli/feedback-GZW37JMI.mjs +107 -0
- package/dist/cli/feedback-IQVWIJZ4.js +107 -0
- package/dist/cli/getting-started.js +18 -76
- package/dist/cli/getting-started.mjs +10 -37
- package/dist/cli/git-563GYLMA.js +23 -0
- package/dist/cli/git-B72Y4FFQ.mjs +23 -0
- package/dist/cli/index.js +291 -54294
- package/dist/cli/index.mjs +209 -54352
- package/dist/cli/legacy-noops-37F5MX2P.mjs +157 -0
- package/dist/cli/legacy-noops-IFGVDCOM.js +157 -0
- package/dist/cli/monitors-42H6LOVT.mjs +3251 -0
- package/dist/cli/monitors-GQCHXBXZ.js +3251 -0
- package/dist/cli/org-4GCPBTGR.js +849 -0
- package/dist/cli/org-JYZA3ZRJ.mjs +849 -0
- package/dist/cli/play-46ZJ4FMI.js +18439 -0
- package/dist/cli/play-Q2XV3FZZ.mjs +18439 -0
- package/dist/cli/providers-CTKQP45X.mjs +95 -0
- package/dist/cli/providers-PCNF5E3K.js +95 -0
- package/dist/cli/proxy-env-EBANZHPV.js +161 -0
- package/dist/cli/proxy-env-M4ZHXHRL.mjs +161 -0
- package/dist/cli/quickstart-FTHWRVWN.js +69 -0
- package/dist/cli/quickstart-X7EVVWRG.mjs +69 -0
- package/dist/cli/search-73YPOFDO.mjs +18 -0
- package/dist/cli/search-XA5UVC3G.js +18 -0
- package/dist/cli/secrets-OUMPT4FX.mjs +400 -0
- package/dist/cli/secrets-UOEVR73Q.js +400 -0
- package/dist/cli/sessions-CMKXCN5Y.js +15 -0
- package/dist/cli/sessions-ZIFGDZE7.mjs +15 -0
- package/dist/cli/settings-OO5R3G52.mjs +846 -0
- package/dist/cli/settings-ULZT2NIC.js +846 -0
- package/dist/cli/setup-6GZH52OZ.mjs +1257 -0
- package/dist/cli/setup-DHGERXPZ.js +1257 -0
- package/dist/cli/skills-Q7NUCS2W.js +28 -0
- package/dist/cli/skills-T3EY2656.mjs +28 -0
- package/dist/cli/tools-BIMOAOTX.mjs +2955 -0
- package/dist/cli/tools-ODXVCKO7.js +2955 -0
- package/dist/cli/update-UMB3ULBR.js +28 -0
- package/dist/cli/update-X4HX7Z3M.mjs +28 -0
- package/dist/cli/workflow-EAUFVPIP.mjs +1936 -0
- package/dist/cli/workflow-IVLCPFTG.js +1936 -0
- package/dist/helpers.js +6 -32
- package/dist/helpers.mjs +2 -0
- package/dist/index.js +1972 -12825
- package/dist/index.mjs +1910 -12672
- package/dist/install-integrity.json +110 -0
- package/dist/monitor-fleet-contract.js +31 -730
- package/dist/monitor-fleet-contract.mjs +18 -667
- package/dist/monitor-input-contract.js +10 -390
- package/dist/monitor-input-contract.mjs +7 -348
- package/dist/plays/bundle-play-file.mjs +13 -5178
- package/dist/plays/csv-data-input.js +5 -3132
- package/dist/plays/csv-data-input.mjs +5 -3105
- package/dist/plays/run-request.js +56 -664
- package/dist/plays/run-request.mjs +30 -588
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +5 -212
- package/dist/release.mjs +5 -185
- package/package.json +1 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/cli/getting-started.ts
|
|
2
|
+
var DEEPLINE_GTM_SKILL = "/deepline-gtm";
|
|
3
|
+
var DEEPLINE_GTM_STARTER_PROMPTS = [
|
|
4
|
+
{
|
|
5
|
+
id: "competitor-tracking",
|
|
6
|
+
title: "Competitor tracking",
|
|
7
|
+
prompt: "/deepline-gtm Track competitors of my company. Use my business email domain when available; otherwise ask for my company name."
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
id: "contact-email-enrichment",
|
|
11
|
+
title: "Contact email enrichment",
|
|
12
|
+
prompt: "/deepline-gtm Find 10 CTOs at B2B SaaS companies and enrich them with email addresses."
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
// Historical ID retained for SDK payload compatibility; the current
|
|
16
|
+
// starter copy is the fintech hiring-and-growth workflow below.
|
|
17
|
+
id: "decision-maker-discovery",
|
|
18
|
+
title: "Fintech hiring and growth",
|
|
19
|
+
prompt: "/deepline-gtm Find five fintech companies with live SDR openings and six-month headcount growth. Show dated evidence for both."
|
|
20
|
+
}
|
|
21
|
+
];
|
|
22
|
+
var DEEPLINE_GTM_PRIMARY_STARTER_PROMPT = DEEPLINE_GTM_STARTER_PROMPTS[0].prompt;
|
|
23
|
+
var DEEPLINE_GTM_HANDOFF_QUESTION = "What would you like to do with Deepline?";
|
|
24
|
+
var DEEPLINE_GTM_CUSTOM_OPTION = "Tell me what you want to accomplish and I'll help you build it";
|
|
25
|
+
var DEEPLINE_GTM_STARTER_OPTIONS = [
|
|
26
|
+
...DEEPLINE_GTM_STARTER_PROMPTS.map(({ prompt }) => prompt),
|
|
27
|
+
DEEPLINE_GTM_CUSTOM_OPTION
|
|
28
|
+
];
|
|
29
|
+
function deeplineGtmGettingStartedPayload() {
|
|
30
|
+
return {
|
|
31
|
+
skill: DEEPLINE_GTM_SKILL,
|
|
32
|
+
examples: DEEPLINE_GTM_STARTER_PROMPTS,
|
|
33
|
+
question: DEEPLINE_GTM_HANDOFF_QUESTION,
|
|
34
|
+
customOption: DEEPLINE_GTM_CUSTOM_OPTION,
|
|
35
|
+
customProblemBehavior: "Turn the business problem into one exact /deepline-gtm prompt, show that reusable prompt, then execute it without asking the user to paste it again."
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
exports.DEEPLINE_GTM_SKILL = DEEPLINE_GTM_SKILL; exports.DEEPLINE_GTM_STARTER_PROMPTS = DEEPLINE_GTM_STARTER_PROMPTS; exports.DEEPLINE_GTM_PRIMARY_STARTER_PROMPT = DEEPLINE_GTM_PRIMARY_STARTER_PROMPT; exports.DEEPLINE_GTM_HANDOFF_QUESTION = DEEPLINE_GTM_HANDOFF_QUESTION; exports.DEEPLINE_GTM_CUSTOM_OPTION = DEEPLINE_GTM_CUSTOM_OPTION; exports.DEEPLINE_GTM_STARTER_OPTIONS = DEEPLINE_GTM_STARTER_OPTIONS; exports.deeplineGtmGettingStartedPayload = deeplineGtmGettingStartedPayload;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
20
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
21
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
22
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
23
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
24
|
+
mod
|
|
25
|
+
));
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
__commonJS,
|
|
29
|
+
__toESM
|
|
30
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
var _chunk4Y6CG4GEjs = require('./chunk-4Y6CG4GE.js');
|
|
4
|
+
|
|
5
|
+
// src/cli/npm-script-policy.ts
|
|
6
|
+
var _child_process = require('child_process');
|
|
7
|
+
function npmSupportsAllowScripts(version) {
|
|
8
|
+
const match = /^(\d+)\.(\d+)(?:\.|$)/.exec(_nullishCoalesce(_optionalChain([version, 'optionalAccess', _ => _.trim, 'call', _2 => _2()]), () => ( "")));
|
|
9
|
+
if (!match) return false;
|
|
10
|
+
const major = Number(match[1]);
|
|
11
|
+
const minor = Number(match[2]);
|
|
12
|
+
return major > 11 || major === 11 && minor >= 16;
|
|
13
|
+
}
|
|
14
|
+
function readNpmVersion(env) {
|
|
15
|
+
try {
|
|
16
|
+
const plan = _chunk4Y6CG4GEjs.resolveShellSpawn.call(void 0, "npm", ["--version"]);
|
|
17
|
+
const result = _child_process.spawnSync.call(void 0, plan.command, plan.args, {
|
|
18
|
+
encoding: "utf8",
|
|
19
|
+
env,
|
|
20
|
+
shell: plan.shell,
|
|
21
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
22
|
+
timeout: 5e3
|
|
23
|
+
});
|
|
24
|
+
if (result.status !== 0) return null;
|
|
25
|
+
return String(_nullishCoalesce(result.stdout, () => ( ""))).trim() || null;
|
|
26
|
+
} catch (e) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
exports.npmSupportsAllowScripts = npmSupportsAllowScripts; exports.readNpmVersion = readNpmVersion;
|
|
@@ -0,0 +1,560 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkXNYIZMNQjs = require('./chunk-XNYIZMNQ.js');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunk7P5AA3SNjs = require('./chunk-7P5AA3SN.js');
|
|
8
|
+
|
|
9
|
+
// ../play-runtime/run-lifecycle-policy.ts
|
|
10
|
+
var TERMINAL_PLAY_RUN_STATUSES = /* @__PURE__ */ new Set([
|
|
11
|
+
"completed",
|
|
12
|
+
"failed",
|
|
13
|
+
"cancelled",
|
|
14
|
+
"terminated",
|
|
15
|
+
"timed_out"
|
|
16
|
+
]);
|
|
17
|
+
function normalizePlayRunLifecycleStatus(value) {
|
|
18
|
+
const normalized = String(_nullishCoalesce(value, () => ( ""))).trim().toLowerCase();
|
|
19
|
+
switch (normalized) {
|
|
20
|
+
case "queued":
|
|
21
|
+
case "pending":
|
|
22
|
+
return "queued";
|
|
23
|
+
case "running":
|
|
24
|
+
case "started":
|
|
25
|
+
return "running";
|
|
26
|
+
case "waiting":
|
|
27
|
+
return "waiting";
|
|
28
|
+
case "completed":
|
|
29
|
+
case "complete":
|
|
30
|
+
case "succeeded":
|
|
31
|
+
return "completed";
|
|
32
|
+
case "failed":
|
|
33
|
+
case "error":
|
|
34
|
+
return "failed";
|
|
35
|
+
case "cancelled":
|
|
36
|
+
case "canceled":
|
|
37
|
+
return "cancelled";
|
|
38
|
+
case "terminated":
|
|
39
|
+
return "terminated";
|
|
40
|
+
case "timed_out":
|
|
41
|
+
case "timeout":
|
|
42
|
+
return "timed_out";
|
|
43
|
+
default:
|
|
44
|
+
return "unknown";
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function isTerminalPlayRunLifecycleStatus(status) {
|
|
48
|
+
return TERMINAL_PLAY_RUN_STATUSES.has(
|
|
49
|
+
normalizePlayRunLifecycleStatus(status)
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
function decodePlayRunPublicStatus(value) {
|
|
53
|
+
const status = normalizePlayRunLifecycleStatus(value);
|
|
54
|
+
switch (status) {
|
|
55
|
+
case "queued":
|
|
56
|
+
case "running":
|
|
57
|
+
case "waiting":
|
|
58
|
+
case "completed":
|
|
59
|
+
case "failed":
|
|
60
|
+
case "cancelled":
|
|
61
|
+
return status;
|
|
62
|
+
case "terminated":
|
|
63
|
+
case "timed_out":
|
|
64
|
+
return "cancelled";
|
|
65
|
+
case "unknown":
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// src/plays/run-request.ts
|
|
71
|
+
var PLAY_RUN_START_PATH = "/api/v2/plays/run";
|
|
72
|
+
var PLAY_RUN_START_STREAM_PATH = `${PLAY_RUN_START_PATH}?stream=true`;
|
|
73
|
+
var PLAY_FILES_STAGE_PATH = "/api/v2/plays/files/stage";
|
|
74
|
+
var PLAY_FILES_STAGE_MINT_PATH = `${PLAY_FILES_STAGE_PATH}/mint`;
|
|
75
|
+
function buildPlayRunStartBody(request) {
|
|
76
|
+
return {
|
|
77
|
+
...request.name ? { name: request.name } : {},
|
|
78
|
+
...request.revisionId ? { revisionId: request.revisionId } : {},
|
|
79
|
+
...request.artifactStorageKey ? { artifactStorageKey: request.artifactStorageKey } : {},
|
|
80
|
+
...request.sourceCode ? { sourceCode: request.sourceCode } : {},
|
|
81
|
+
...request.sourceFiles ? { sourceFiles: request.sourceFiles } : {},
|
|
82
|
+
...request.description ? { description: request.description } : {},
|
|
83
|
+
..."staticPipeline" in request ? { staticPipeline: request.staticPipeline } : {},
|
|
84
|
+
...request.artifactHash ? { artifactHash: request.artifactHash } : {},
|
|
85
|
+
...request.graphHash ? { graphHash: request.graphHash } : {},
|
|
86
|
+
...request.runtimeArtifact ? { runtimeArtifact: request.runtimeArtifact } : {},
|
|
87
|
+
...request.compilerManifest ? { compilerManifest: request.compilerManifest } : {},
|
|
88
|
+
...request.inputFileUpload ? { inputFileUpload: request.inputFileUpload } : {},
|
|
89
|
+
..._optionalChain([request, 'access', _ => _.packagedFileUploads, 'optionalAccess', _2 => _2.length]) ? { packagedFileUploads: request.packagedFileUploads } : {},
|
|
90
|
+
...request.input ? { input: request.input } : {},
|
|
91
|
+
...request.inputFile ? { inputFile: request.inputFile } : {},
|
|
92
|
+
..._optionalChain([request, 'access', _3 => _3.packagedFiles, 'optionalAccess', _4 => _4.length]) ? { packagedFiles: request.packagedFiles } : {},
|
|
93
|
+
...request.force ? { force: true } : {},
|
|
94
|
+
...request.forceToolRefresh === true ? { forceToolRefresh: true } : {},
|
|
95
|
+
...typeof request.maxConcurrentExternalCalls === "number" ? { maxConcurrentExternalCalls: request.maxConcurrentExternalCalls } : {},
|
|
96
|
+
...typeof request.maxConcurrentRows === "number" ? { maxConcurrentRows: request.maxConcurrentRows } : {},
|
|
97
|
+
...typeof request.waitForCompletionMs === "number" ? { waitForCompletionMs: request.waitForCompletionMs } : {},
|
|
98
|
+
// Profile selection is the API's job, not the caller's. The server
|
|
99
|
+
// defaults to absurd; callers normally omit this field.
|
|
100
|
+
...request.profile ? { profile: request.profile } : {},
|
|
101
|
+
...request.integrationMode ? { integrationMode: request.integrationMode } : {},
|
|
102
|
+
...request.fixtureBehavior ? { fixtureBehavior: request.fixtureBehavior } : {},
|
|
103
|
+
...request.runtime ? { runtime: request.runtime } : {},
|
|
104
|
+
...request.testPolicyOverrides ? { testPolicyOverrides: request.testPolicyOverrides } : {}
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
async function startPlayRun(http, request, headers) {
|
|
108
|
+
const response = await http.post(
|
|
109
|
+
PLAY_RUN_START_PATH,
|
|
110
|
+
buildPlayRunStartBody(request),
|
|
111
|
+
headers,
|
|
112
|
+
{ maxRetries: 0, exactUrlOnly: true }
|
|
113
|
+
);
|
|
114
|
+
return normalizePlayRunStart(response);
|
|
115
|
+
}
|
|
116
|
+
function isPlayRunPackage(value) {
|
|
117
|
+
return Boolean(
|
|
118
|
+
value && typeof value === "object" && !Array.isArray(value) && value.kind === "play_run" && value.run && typeof _optionalChain([value, 'access', _5 => _5.run, 'optionalAccess', _6 => _6.id]) === "string"
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
function normalizePlayRunStart(raw) {
|
|
122
|
+
const runPackage = isPlayRunPackage(raw) ? raw : isPlayRunPackage(raw.package) ? raw.package : null;
|
|
123
|
+
if (!runPackage) {
|
|
124
|
+
const workflowId = typeof raw.workflowId === "string" && raw.workflowId ? raw.workflowId : typeof raw.runId === "string" ? raw.runId : "";
|
|
125
|
+
return {
|
|
126
|
+
...raw,
|
|
127
|
+
workflowId
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
const status = typeof runPackage.run.status === "string" ? runPackage.run.status : "running";
|
|
131
|
+
return {
|
|
132
|
+
workflowId: runPackage.run.id,
|
|
133
|
+
name: runPackage.run.playName,
|
|
134
|
+
status,
|
|
135
|
+
...runPackage.run.dashboardUrl ? { dashboardUrl: runPackage.run.dashboardUrl } : {},
|
|
136
|
+
...isTerminalPlayRunLifecycleStatus(status) ? { finalStatus: runPackage } : {},
|
|
137
|
+
package: runPackage
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
function buildNamedPlayRunRequest(input) {
|
|
141
|
+
return {
|
|
142
|
+
name: input.name,
|
|
143
|
+
...input.revisionId ? { revisionId: input.revisionId } : {},
|
|
144
|
+
...Object.keys(input.runtimeInput).length > 0 ? { input: input.runtimeInput } : {},
|
|
145
|
+
...input.stagedFileInputs.inputFile ? { inputFile: input.stagedFileInputs.inputFile } : {},
|
|
146
|
+
...input.stagedFileInputs.packagedFiles.length ? { packagedFiles: input.stagedFileInputs.packagedFiles } : {},
|
|
147
|
+
...input.extra
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
var CSV_DATA_INPUT_KEY = "csv";
|
|
151
|
+
function schemaMetadata(schema, key) {
|
|
152
|
+
if (!schema || typeof schema !== "object" || Array.isArray(schema))
|
|
153
|
+
return null;
|
|
154
|
+
const value = schema[key];
|
|
155
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
156
|
+
}
|
|
157
|
+
function stringMetadata(metadata, key) {
|
|
158
|
+
const value = _optionalChain([metadata, 'optionalAccess', _7 => _7[key]]);
|
|
159
|
+
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
160
|
+
}
|
|
161
|
+
function inputFieldFromCsvArg(csvArg) {
|
|
162
|
+
if (typeof csvArg !== "string") return null;
|
|
163
|
+
const match = /^\(?\s*input\.([A-Za-z_$][\w$]*)\s*\)?(?:\s*\?\?[\s\S]+)?$/.exec(
|
|
164
|
+
csvArg.trim()
|
|
165
|
+
);
|
|
166
|
+
return _nullishCoalesce(_optionalChain([match, 'optionalAccess', _8 => _8[1]]), () => ( null));
|
|
167
|
+
}
|
|
168
|
+
function fileInputBindingsFromPlaySchema(inputSchema) {
|
|
169
|
+
const csvInput = schemaMetadata(inputSchema, "csvInput");
|
|
170
|
+
if (!csvInput) return [];
|
|
171
|
+
return [
|
|
172
|
+
{
|
|
173
|
+
inputPath: _nullishCoalesce(stringMetadata(csvInput, "inputField"), () => ( CSV_DATA_INPUT_KEY))
|
|
174
|
+
}
|
|
175
|
+
];
|
|
176
|
+
}
|
|
177
|
+
function fileInputBindingsFromStaticPipeline(staticPipeline) {
|
|
178
|
+
if (!staticPipeline || typeof staticPipeline !== "object" || Array.isArray(staticPipeline)) {
|
|
179
|
+
return [];
|
|
180
|
+
}
|
|
181
|
+
const inputField = inputFieldFromCsvArg(
|
|
182
|
+
staticPipeline.csvArg
|
|
183
|
+
);
|
|
184
|
+
return inputField ? [{ inputPath: inputField }] : [];
|
|
185
|
+
}
|
|
186
|
+
function playRunFileInputBindings(play) {
|
|
187
|
+
return [
|
|
188
|
+
...fileInputBindingsFromPlaySchema(play.inputSchema),
|
|
189
|
+
...fileInputBindingsFromStaticPipeline(play.staticPipeline)
|
|
190
|
+
];
|
|
191
|
+
}
|
|
192
|
+
function getDottedInputValue(input, path) {
|
|
193
|
+
const parts = path.split(".").map((part) => part.trim()).filter(Boolean);
|
|
194
|
+
let cursor = input;
|
|
195
|
+
for (const part of parts) {
|
|
196
|
+
if (!cursor || typeof cursor !== "object" || Array.isArray(cursor)) {
|
|
197
|
+
return void 0;
|
|
198
|
+
}
|
|
199
|
+
cursor = cursor[part];
|
|
200
|
+
}
|
|
201
|
+
return cursor;
|
|
202
|
+
}
|
|
203
|
+
function setDottedInputValue(input, path, value) {
|
|
204
|
+
const parts = path.split(".").map((part) => part.trim()).filter(Boolean);
|
|
205
|
+
if (parts.length === 0) {
|
|
206
|
+
throw new Error(`Invalid play input flag path: ${path}`);
|
|
207
|
+
}
|
|
208
|
+
let cursor = input;
|
|
209
|
+
for (const part of parts.slice(0, -1)) {
|
|
210
|
+
const existing = cursor[part];
|
|
211
|
+
if (existing !== void 0 && (!existing || typeof existing !== "object" || Array.isArray(existing))) {
|
|
212
|
+
throw new Error(
|
|
213
|
+
`Cannot set --${path}; input.${part} is already a non-object value.`
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
if (!existing) {
|
|
217
|
+
cursor[part] = {};
|
|
218
|
+
}
|
|
219
|
+
cursor = cursor[part];
|
|
220
|
+
}
|
|
221
|
+
cursor[parts[parts.length - 1]] = value;
|
|
222
|
+
}
|
|
223
|
+
var webStagedFileCodec = {
|
|
224
|
+
async sha256Hex(bytes) {
|
|
225
|
+
const digest = await globalThis.crypto.subtle.digest(
|
|
226
|
+
"SHA-256",
|
|
227
|
+
bytes
|
|
228
|
+
);
|
|
229
|
+
return Array.from(
|
|
230
|
+
new Uint8Array(digest),
|
|
231
|
+
(byte) => byte.toString(16).padStart(2, "0")
|
|
232
|
+
).join("");
|
|
233
|
+
},
|
|
234
|
+
base64(bytes) {
|
|
235
|
+
let binary = "";
|
|
236
|
+
for (let offset = 0; offset < bytes.length; offset += 32768) {
|
|
237
|
+
binary += String.fromCharCode(...bytes.subarray(offset, offset + 32768));
|
|
238
|
+
}
|
|
239
|
+
return btoa(binary);
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
function stagedFileContentType(logicalPath) {
|
|
243
|
+
const lower = logicalPath.toLowerCase();
|
|
244
|
+
return lower.endsWith(".csv") ? "text/csv" : lower.endsWith(".json") ? "application/json" : "application/octet-stream";
|
|
245
|
+
}
|
|
246
|
+
async function createStagedFileUpload(logicalPath, bytes, codec = webStagedFileCodec) {
|
|
247
|
+
return {
|
|
248
|
+
logicalPath,
|
|
249
|
+
contentBase64: codec.base64(bytes),
|
|
250
|
+
contentHash: await codec.sha256Hex(bytes),
|
|
251
|
+
contentType: stagedFileContentType(logicalPath),
|
|
252
|
+
bytes: bytes.byteLength
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
var STAGE_LEGACY_MULTIPART_MAX_BYTES = 4e6;
|
|
256
|
+
var STAGE_DIRECT_UPLOAD_MAX_ATTEMPTS = 3;
|
|
257
|
+
function sleep(ms) {
|
|
258
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
259
|
+
}
|
|
260
|
+
function stagedUploadIdentity(logicalPath, contentHash) {
|
|
261
|
+
return `${contentHash}:${logicalPath}`;
|
|
262
|
+
}
|
|
263
|
+
function isStagedUploadMintUnsupported(error) {
|
|
264
|
+
return error instanceof _chunk7P5AA3SNjs.DeeplineError && error.statusCode === 404;
|
|
265
|
+
}
|
|
266
|
+
function isStagedUploadDirectEgressDenied(error) {
|
|
267
|
+
return error instanceof _chunk7P5AA3SNjs.DeeplineError && error.code === "STAGED_FILE_UPLOAD_EGRESS_DENIED";
|
|
268
|
+
}
|
|
269
|
+
function formatMegabytes(bytes) {
|
|
270
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
271
|
+
}
|
|
272
|
+
function decodeBase64Bytes(value) {
|
|
273
|
+
const binary = atob(value);
|
|
274
|
+
const bytes = new Uint8Array(binary.length);
|
|
275
|
+
for (let index = 0; index < binary.length; index += 1) {
|
|
276
|
+
bytes[index] = binary.charCodeAt(index);
|
|
277
|
+
}
|
|
278
|
+
return bytes;
|
|
279
|
+
}
|
|
280
|
+
async function uploadStagedFileToPresignedUrl(input) {
|
|
281
|
+
const arrayBuffer = input.body.buffer.slice(
|
|
282
|
+
input.body.byteOffset,
|
|
283
|
+
input.body.byteOffset + input.body.byteLength
|
|
284
|
+
);
|
|
285
|
+
let lastError;
|
|
286
|
+
for (let attempt = 1; attempt <= STAGE_DIRECT_UPLOAD_MAX_ATTEMPTS; attempt += 1) {
|
|
287
|
+
try {
|
|
288
|
+
const response = await fetch(input.url, {
|
|
289
|
+
method: "PUT",
|
|
290
|
+
headers: input.headers,
|
|
291
|
+
body: new Blob([arrayBuffer])
|
|
292
|
+
});
|
|
293
|
+
if (response.ok) {
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
const text = await response.text().catch(() => "");
|
|
297
|
+
const egressDenied = response.status === 403 && _optionalChain([response, 'access', _9 => _9.headers, 'access', _10 => _10.get, 'call', _11 => _11("x-deny-reason"), 'optionalAccess', _12 => _12.trim, 'call', _13 => _13(), 'access', _14 => _14.toLowerCase, 'call', _15 => _15()]) === "host_not_allowed";
|
|
298
|
+
lastError = new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
299
|
+
`Direct storage upload of ${input.logicalPath} failed: ${response.status} ${text.slice(0, 200)}`,
|
|
300
|
+
response.status,
|
|
301
|
+
egressDenied ? "STAGED_FILE_UPLOAD_EGRESS_DENIED" : "STAGED_FILE_UPLOAD_FAILED",
|
|
302
|
+
{ logicalPath: input.logicalPath }
|
|
303
|
+
);
|
|
304
|
+
if (response.status < 500 && response.status !== 429) {
|
|
305
|
+
break;
|
|
306
|
+
}
|
|
307
|
+
} catch (error) {
|
|
308
|
+
lastError = error instanceof TypeError ? new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
309
|
+
`Direct storage upload of ${input.logicalPath} could not reach the storage endpoint: ${error.message}`,
|
|
310
|
+
void 0,
|
|
311
|
+
"STAGED_FILE_UPLOAD_EGRESS_DENIED",
|
|
312
|
+
{ logicalPath: input.logicalPath }
|
|
313
|
+
) : error;
|
|
314
|
+
}
|
|
315
|
+
if (attempt < STAGE_DIRECT_UPLOAD_MAX_ATTEMPTS) {
|
|
316
|
+
await sleep(250 * attempt);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
throw lastError instanceof Error ? lastError : new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
320
|
+
`Direct storage upload of ${input.logicalPath} failed.`,
|
|
321
|
+
void 0,
|
|
322
|
+
"STAGED_FILE_UPLOAD_FAILED",
|
|
323
|
+
{ logicalPath: input.logicalPath }
|
|
324
|
+
);
|
|
325
|
+
}
|
|
326
|
+
async function mintStagedPlayFileUploads(http, files) {
|
|
327
|
+
const response = await http.post(PLAY_FILES_STAGE_MINT_PATH, { files });
|
|
328
|
+
return _nullishCoalesce(response.uploads, () => ( []));
|
|
329
|
+
}
|
|
330
|
+
async function stagePlayFilesViaMultipart(http, files, reason = "mint-unsupported") {
|
|
331
|
+
for (const file of files) {
|
|
332
|
+
if (file.bytes > STAGE_LEGACY_MULTIPART_MAX_BYTES) {
|
|
333
|
+
const reasonMessage = reason === "direct-egress-denied" ? "direct storage is blocked by this environment's network egress policy" : "the connected Deepline server does not support direct-to-storage uploads";
|
|
334
|
+
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
335
|
+
`Cannot stage ${file.logicalPath} (${formatMegabytes(file.bytes)}): ${reasonMessage}, and this file exceeds the ~4.5MB request-body limit the legacy upload path is subject to.`,
|
|
336
|
+
413,
|
|
337
|
+
"STAGED_FILE_TOO_LARGE_FOR_LEGACY_UPLOAD",
|
|
338
|
+
{
|
|
339
|
+
logicalPath: file.logicalPath,
|
|
340
|
+
bytes: file.bytes,
|
|
341
|
+
maxBytes: STAGE_LEGACY_MULTIPART_MAX_BYTES
|
|
342
|
+
}
|
|
343
|
+
);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
const buildFormData = () => {
|
|
347
|
+
const formData = new FormData();
|
|
348
|
+
formData.set(
|
|
349
|
+
"metadata",
|
|
350
|
+
JSON.stringify({
|
|
351
|
+
files: files.map((file, index) => ({
|
|
352
|
+
index,
|
|
353
|
+
logicalPath: file.logicalPath,
|
|
354
|
+
contentHash: file.contentHash,
|
|
355
|
+
contentType: file.contentType,
|
|
356
|
+
bytes: file.bytes
|
|
357
|
+
}))
|
|
358
|
+
})
|
|
359
|
+
);
|
|
360
|
+
for (const [index, file] of files.entries()) {
|
|
361
|
+
const bytes = decodeBase64Bytes(file.contentBase64);
|
|
362
|
+
const body = bytes.buffer.slice(
|
|
363
|
+
bytes.byteOffset,
|
|
364
|
+
bytes.byteOffset + bytes.byteLength
|
|
365
|
+
);
|
|
366
|
+
formData.set(
|
|
367
|
+
`file:${index}`,
|
|
368
|
+
new Blob([body], { type: file.contentType }),
|
|
369
|
+
file.logicalPath
|
|
370
|
+
);
|
|
371
|
+
}
|
|
372
|
+
return formData;
|
|
373
|
+
};
|
|
374
|
+
const response = await http.postFormData(PLAY_FILES_STAGE_PATH, buildFormData);
|
|
375
|
+
return response.files;
|
|
376
|
+
}
|
|
377
|
+
async function stagePlayFiles(http, files) {
|
|
378
|
+
let uploads;
|
|
379
|
+
try {
|
|
380
|
+
uploads = await mintStagedPlayFileUploads(
|
|
381
|
+
http,
|
|
382
|
+
files.map((file) => ({
|
|
383
|
+
logicalPath: file.logicalPath,
|
|
384
|
+
contentHash: file.contentHash,
|
|
385
|
+
contentType: file.contentType,
|
|
386
|
+
bytes: file.bytes
|
|
387
|
+
}))
|
|
388
|
+
);
|
|
389
|
+
} catch (error) {
|
|
390
|
+
if (isStagedUploadMintUnsupported(error)) {
|
|
391
|
+
return stagePlayFilesViaMultipart(http, files);
|
|
392
|
+
}
|
|
393
|
+
throw error;
|
|
394
|
+
}
|
|
395
|
+
const uploadByIdentity = /* @__PURE__ */ new Map();
|
|
396
|
+
for (const upload of uploads) {
|
|
397
|
+
uploadByIdentity.set(
|
|
398
|
+
stagedUploadIdentity(upload.logicalPath, upload.contentHash),
|
|
399
|
+
upload
|
|
400
|
+
);
|
|
401
|
+
}
|
|
402
|
+
const directResults = await Promise.all(
|
|
403
|
+
files.map(async (file) => {
|
|
404
|
+
const upload = uploadByIdentity.get(
|
|
405
|
+
stagedUploadIdentity(file.logicalPath, file.contentHash)
|
|
406
|
+
);
|
|
407
|
+
if (!upload) {
|
|
408
|
+
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
409
|
+
`The staging server did not return an upload target for ${file.logicalPath}.`,
|
|
410
|
+
void 0,
|
|
411
|
+
"STAGED_FILE_MINT_INCOMPLETE"
|
|
412
|
+
);
|
|
413
|
+
}
|
|
414
|
+
if (upload.alreadyStaged || !upload.uploadUrl) {
|
|
415
|
+
return { ref: upload.ref };
|
|
416
|
+
}
|
|
417
|
+
try {
|
|
418
|
+
await uploadStagedFileToPresignedUrl({
|
|
419
|
+
url: upload.uploadUrl,
|
|
420
|
+
headers: _nullishCoalesce(upload.uploadHeaders, () => ( {
|
|
421
|
+
"content-type": file.contentType
|
|
422
|
+
})),
|
|
423
|
+
body: decodeBase64Bytes(file.contentBase64),
|
|
424
|
+
logicalPath: file.logicalPath
|
|
425
|
+
});
|
|
426
|
+
return { ref: upload.ref };
|
|
427
|
+
} catch (error) {
|
|
428
|
+
if (isStagedUploadDirectEgressDenied(error)) {
|
|
429
|
+
return { fallbackFile: file };
|
|
430
|
+
}
|
|
431
|
+
throw error;
|
|
432
|
+
}
|
|
433
|
+
})
|
|
434
|
+
);
|
|
435
|
+
return await Promise.all(
|
|
436
|
+
directResults.map(async (result) => {
|
|
437
|
+
if ("fallbackFile" in result) {
|
|
438
|
+
const [ref] = await stagePlayFilesViaMultipart(
|
|
439
|
+
http,
|
|
440
|
+
[result.fallbackFile],
|
|
441
|
+
"direct-egress-denied"
|
|
442
|
+
);
|
|
443
|
+
if (!ref) {
|
|
444
|
+
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
445
|
+
`The staging server did not return an upload target for ${result.fallbackFile.logicalPath}.`,
|
|
446
|
+
void 0,
|
|
447
|
+
"STAGED_FILE_MINT_INCOMPLETE"
|
|
448
|
+
);
|
|
449
|
+
}
|
|
450
|
+
return ref;
|
|
451
|
+
}
|
|
452
|
+
return result.ref;
|
|
453
|
+
})
|
|
454
|
+
);
|
|
455
|
+
}
|
|
456
|
+
async function stageFileInputs(input) {
|
|
457
|
+
const uniqueBindings = [
|
|
458
|
+
...new Map(
|
|
459
|
+
input.bindings.map((binding) => [binding.inputPath, binding])
|
|
460
|
+
).values()
|
|
461
|
+
];
|
|
462
|
+
const localFiles = uniqueBindings.flatMap((binding) => {
|
|
463
|
+
const file = input.resolveLocalFile(
|
|
464
|
+
getDottedInputValue(input.runtimeInput, binding.inputPath),
|
|
465
|
+
binding
|
|
466
|
+
);
|
|
467
|
+
return file ? [{ binding, file }] : [];
|
|
468
|
+
});
|
|
469
|
+
if (localFiles.length === 0) {
|
|
470
|
+
return { inputFile: null, packagedFiles: [] };
|
|
471
|
+
}
|
|
472
|
+
_optionalChain([input, 'access', _16 => _16.onStaging, 'optionalCall', _17 => _17(localFiles.length)]);
|
|
473
|
+
const uploads = await Promise.all(
|
|
474
|
+
localFiles.map(
|
|
475
|
+
async ({ file }) => createStagedFileUpload(file.logicalPath, await file.read(), input.codec)
|
|
476
|
+
)
|
|
477
|
+
);
|
|
478
|
+
const staged = await input.stage(uploads);
|
|
479
|
+
for (const [index, { binding, file }] of localFiles.entries()) {
|
|
480
|
+
setDottedInputValue(
|
|
481
|
+
input.runtimeInput,
|
|
482
|
+
binding.inputPath,
|
|
483
|
+
file.logicalPath
|
|
484
|
+
);
|
|
485
|
+
const stagedFile = staged[index];
|
|
486
|
+
if (stagedFile && stagedFile.logicalPath !== file.logicalPath) {
|
|
487
|
+
setDottedInputValue(
|
|
488
|
+
input.runtimeInput,
|
|
489
|
+
binding.inputPath,
|
|
490
|
+
stagedFile.logicalPath
|
|
491
|
+
);
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
return {
|
|
495
|
+
inputFile: _nullishCoalesce(staged[0], () => ( null)),
|
|
496
|
+
packagedFiles: staged.slice(1)
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
function createSessionPlayRunHttp(fetchImpl = (...args) => fetch(...args)) {
|
|
500
|
+
const send = async (path, init) => {
|
|
501
|
+
const response = await fetchImpl(path, {
|
|
502
|
+
...init,
|
|
503
|
+
credentials: "include"
|
|
504
|
+
});
|
|
505
|
+
const text = await response.text();
|
|
506
|
+
let parsed = text;
|
|
507
|
+
try {
|
|
508
|
+
parsed = text ? JSON.parse(text) : null;
|
|
509
|
+
} catch (e) {
|
|
510
|
+
}
|
|
511
|
+
if (!response.ok) {
|
|
512
|
+
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
513
|
+
_chunkXNYIZMNQjs.apiErrorMessage.call(void 0, parsed, response.status),
|
|
514
|
+
response.status,
|
|
515
|
+
_chunkXNYIZMNQjs.apiErrorCodeFromResponse.call(void 0, parsed),
|
|
516
|
+
{ response: parsed }
|
|
517
|
+
);
|
|
518
|
+
}
|
|
519
|
+
return parsed;
|
|
520
|
+
};
|
|
521
|
+
return {
|
|
522
|
+
post: (path, body, headers) => send(path, {
|
|
523
|
+
method: "POST",
|
|
524
|
+
headers: { "content-type": "application/json", ...headers },
|
|
525
|
+
body: JSON.stringify(body)
|
|
526
|
+
}),
|
|
527
|
+
postFormData: (path, formData) => send(path, {
|
|
528
|
+
method: "POST",
|
|
529
|
+
body: typeof formData === "function" ? formData() : formData
|
|
530
|
+
})
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
|
|
555
|
+
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
|
|
559
|
+
|
|
560
|
+
exports.isTerminalPlayRunLifecycleStatus = isTerminalPlayRunLifecycleStatus; exports.decodePlayRunPublicStatus = decodePlayRunPublicStatus; exports.PLAY_RUN_START_PATH = PLAY_RUN_START_PATH; exports.PLAY_RUN_START_STREAM_PATH = PLAY_RUN_START_STREAM_PATH; exports.PLAY_FILES_STAGE_PATH = PLAY_FILES_STAGE_PATH; exports.PLAY_FILES_STAGE_MINT_PATH = PLAY_FILES_STAGE_MINT_PATH; exports.buildPlayRunStartBody = buildPlayRunStartBody; exports.startPlayRun = startPlayRun; exports.isPlayRunPackage = isPlayRunPackage; exports.normalizePlayRunStart = normalizePlayRunStart; exports.buildNamedPlayRunRequest = buildNamedPlayRunRequest; exports.CSV_DATA_INPUT_KEY = CSV_DATA_INPUT_KEY; exports.fileInputBindingsFromPlaySchema = fileInputBindingsFromPlaySchema; exports.fileInputBindingsFromStaticPipeline = fileInputBindingsFromStaticPipeline; exports.playRunFileInputBindings = playRunFileInputBindings; exports.getDottedInputValue = getDottedInputValue; exports.setDottedInputValue = setDottedInputValue; exports.webStagedFileCodec = webStagedFileCodec; exports.stagedFileContentType = stagedFileContentType; exports.createStagedFileUpload = createStagedFileUpload; exports.STAGE_LEGACY_MULTIPART_MAX_BYTES = STAGE_LEGACY_MULTIPART_MAX_BYTES; exports.mintStagedPlayFileUploads = mintStagedPlayFileUploads; exports.stagePlayFiles = stagePlayFiles; exports.stageFileInputs = stageFileInputs; exports.createSessionPlayRunHttp = createSessionPlayRunHttp;
|