@fluidgrids/cli 2026.1107.1 → 2026.1109.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/README.md +98 -6
- package/dist/cli.js +9705 -33
- package/package.json +42 -35
- package/dist/auth/device-login.d.ts +0 -31
- package/dist/auth/device-login.d.ts.map +0 -1
- package/dist/auth/device-login.js +0 -75
- package/dist/auth/device-login.js.map +0 -1
- package/dist/auth/token-auth.d.ts +0 -49
- package/dist/auth/token-auth.d.ts.map +0 -1
- package/dist/auth/token-auth.js +0 -279
- package/dist/auth/token-auth.js.map +0 -1
- package/dist/cli.d.ts +0 -10
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/code-first/api.d.ts +0 -601
- package/dist/code-first/api.d.ts.map +0 -1
- package/dist/code-first/api.js +0 -432
- package/dist/code-first/api.js.map +0 -1
- package/dist/code-first/code-upload.d.ts +0 -53
- package/dist/code-first/code-upload.d.ts.map +0 -1
- package/dist/code-first/code-upload.js +0 -165
- package/dist/code-first/code-upload.js.map +0 -1
- package/dist/code-first/commands/codegen.d.ts +0 -20
- package/dist/code-first/commands/codegen.d.ts.map +0 -1
- package/dist/code-first/commands/codegen.js +0 -50
- package/dist/code-first/commands/codegen.js.map +0 -1
- package/dist/code-first/commands/diff.d.ts +0 -28
- package/dist/code-first/commands/diff.d.ts.map +0 -1
- package/dist/code-first/commands/diff.js +0 -73
- package/dist/code-first/commands/diff.js.map +0 -1
- package/dist/code-first/commands/hotfix.d.ts +0 -54
- package/dist/code-first/commands/hotfix.d.ts.map +0 -1
- package/dist/code-first/commands/hotfix.js +0 -225
- package/dist/code-first/commands/hotfix.js.map +0 -1
- package/dist/code-first/commands/import.d.ts +0 -40
- package/dist/code-first/commands/import.d.ts.map +0 -1
- package/dist/code-first/commands/import.js +0 -235
- package/dist/code-first/commands/import.js.map +0 -1
- package/dist/code-first/commands/init.d.ts +0 -33
- package/dist/code-first/commands/init.d.ts.map +0 -1
- package/dist/code-first/commands/init.js +0 -177
- package/dist/code-first/commands/init.js.map +0 -1
- package/dist/code-first/commands/interface.d.ts +0 -12
- package/dist/code-first/commands/interface.d.ts.map +0 -1
- package/dist/code-first/commands/interface.js +0 -21
- package/dist/code-first/commands/interface.js.map +0 -1
- package/dist/code-first/commands/pull.d.ts +0 -63
- package/dist/code-first/commands/pull.d.ts.map +0 -1
- package/dist/code-first/commands/pull.js +0 -266
- package/dist/code-first/commands/pull.js.map +0 -1
- package/dist/code-first/commands/push.d.ts +0 -97
- package/dist/code-first/commands/push.d.ts.map +0 -1
- package/dist/code-first/commands/push.js +0 -313
- package/dist/code-first/commands/push.js.map +0 -1
- package/dist/code-first/commands/replay.d.ts +0 -44
- package/dist/code-first/commands/replay.d.ts.map +0 -1
- package/dist/code-first/commands/replay.js +0 -238
- package/dist/code-first/commands/replay.js.map +0 -1
- package/dist/code-first/commands/runs.d.ts +0 -160
- package/dist/code-first/commands/runs.d.ts.map +0 -1
- package/dist/code-first/commands/runs.js +0 -565
- package/dist/code-first/commands/runs.js.map +0 -1
- package/dist/code-first/commands/suite.d.ts +0 -57
- package/dist/code-first/commands/suite.d.ts.map +0 -1
- package/dist/code-first/commands/suite.js +0 -197
- package/dist/code-first/commands/suite.js.map +0 -1
- package/dist/code-first/commands/validate.d.ts +0 -38
- package/dist/code-first/commands/validate.d.ts.map +0 -1
- package/dist/code-first/commands/validate.js +0 -140
- package/dist/code-first/commands/validate.js.map +0 -1
- package/dist/code-first/commands/versions.d.ts +0 -63
- package/dist/code-first/commands/versions.d.ts.map +0 -1
- package/dist/code-first/commands/versions.js +0 -204
- package/dist/code-first/commands/versions.js.map +0 -1
- package/dist/code-first/connections.d.ts +0 -55
- package/dist/code-first/connections.d.ts.map +0 -1
- package/dist/code-first/connections.js +0 -180
- package/dist/code-first/connections.js.map +0 -1
- package/dist/code-first/durable-operations.d.ts +0 -41
- package/dist/code-first/durable-operations.d.ts.map +0 -1
- package/dist/code-first/durable-operations.js +0 -135
- package/dist/code-first/durable-operations.js.map +0 -1
- package/dist/code-first/history.d.ts +0 -30
- package/dist/code-first/history.d.ts.map +0 -1
- package/dist/code-first/history.js +0 -139
- package/dist/code-first/history.js.map +0 -1
- package/dist/code-first/imports.d.ts +0 -22
- package/dist/code-first/imports.d.ts.map +0 -1
- package/dist/code-first/imports.js +0 -67
- package/dist/code-first/imports.js.map +0 -1
- package/dist/code-first/index.d.ts +0 -18
- package/dist/code-first/index.d.ts.map +0 -1
- package/dist/code-first/index.js +0 -36
- package/dist/code-first/index.js.map +0 -1
- package/dist/code-first/junit.d.ts +0 -24
- package/dist/code-first/junit.d.ts.map +0 -1
- package/dist/code-first/junit.js +0 -163
- package/dist/code-first/junit.js.map +0 -1
- package/dist/code-first/lowering.d.ts +0 -94
- package/dist/code-first/lowering.d.ts.map +0 -1
- package/dist/code-first/lowering.js +0 -248
- package/dist/code-first/lowering.js.map +0 -1
- package/dist/code-first/operations.d.ts +0 -55
- package/dist/code-first/operations.d.ts.map +0 -1
- package/dist/code-first/operations.js +0 -165
- package/dist/code-first/operations.js.map +0 -1
- package/dist/code-first/parity-operations.d.ts +0 -44
- package/dist/code-first/parity-operations.d.ts.map +0 -1
- package/dist/code-first/parity-operations.js +0 -211
- package/dist/code-first/parity-operations.js.map +0 -1
- package/dist/code-first/parity.d.ts +0 -83
- package/dist/code-first/parity.d.ts.map +0 -1
- package/dist/code-first/parity.js +0 -301
- package/dist/code-first/parity.js.map +0 -1
- package/dist/code-first/presigned.d.ts +0 -21
- package/dist/code-first/presigned.d.ts.map +0 -1
- package/dist/code-first/presigned.js +0 -85
- package/dist/code-first/presigned.js.map +0 -1
- package/dist/code-first/project.d.ts +0 -123
- package/dist/code-first/project.d.ts.map +0 -1
- package/dist/code-first/project.js +0 -301
- package/dist/code-first/project.js.map +0 -1
- package/dist/code-first/python.d.ts +0 -81
- package/dist/code-first/python.d.ts.map +0 -1
- package/dist/code-first/python.js +0 -249
- package/dist/code-first/python.js.map +0 -1
- package/dist/code-first/redact.d.ts +0 -31
- package/dist/code-first/redact.d.ts.map +0 -1
- package/dist/code-first/redact.js +0 -159
- package/dist/code-first/redact.js.map +0 -1
- package/dist/code-first/register.d.ts +0 -35
- package/dist/code-first/register.d.ts.map +0 -1
- package/dist/code-first/register.js +0 -415
- package/dist/code-first/register.js.map +0 -1
- package/dist/code-first/remote.d.ts +0 -58
- package/dist/code-first/remote.d.ts.map +0 -1
- package/dist/code-first/remote.js +0 -126
- package/dist/code-first/remote.js.map +0 -1
- package/dist/code-first/replay.d.ts +0 -36
- package/dist/code-first/replay.d.ts.map +0 -1
- package/dist/code-first/replay.js +0 -52
- package/dist/code-first/replay.js.map +0 -1
- package/dist/code-first/shared.d.ts +0 -53
- package/dist/code-first/shared.d.ts.map +0 -1
- package/dist/code-first/shared.js +0 -94
- package/dist/code-first/shared.js.map +0 -1
- package/dist/code-first/test-suite-operations.d.ts +0 -16
- package/dist/code-first/test-suite-operations.d.ts.map +0 -1
- package/dist/code-first/test-suite-operations.js +0 -44
- package/dist/code-first/test-suite-operations.js.map +0 -1
- package/dist/modules.d.ts +0 -15
- package/dist/modules.d.ts.map +0 -1
- package/dist/modules.js +0 -61
- package/dist/modules.js.map +0 -1
- package/dist/product-defaults.d.ts +0 -11
- package/dist/product-defaults.d.ts.map +0 -1
- package/dist/product-defaults.js +0 -25
- package/dist/product-defaults.js.map +0 -1
- package/dist/program.d.ts +0 -20
- package/dist/program.d.ts.map +0 -1
- package/dist/program.js +0 -44
- package/dist/program.js.map +0 -1
package/dist/code-first/junit.js
DELETED
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* JUnit XML for a workflow test suite run (`fluidgrids test <key> --junit`),
|
|
3
|
-
* the report format CI systems (GitHub Actions reporters, GitLab, Jenkins,
|
|
4
|
-
* Azure DevOps) read.
|
|
5
|
-
*
|
|
6
|
-
* One `<testsuite>` per suite run and one `<testcase>` per test case:
|
|
7
|
-
* - PASSED: an empty `<testcase>`;
|
|
8
|
-
* - FAILED: a `<failure>` (an assertion did not hold, or the run did not end
|
|
9
|
-
* as the case expects);
|
|
10
|
-
* - ERROR: an `<error>` (the case could not run);
|
|
11
|
-
* - PENDING or RUNNING, when the CLI stopped waiting first: an `<error>` of type
|
|
12
|
-
* NOT_FINISHED, so an unfinished case never reads as a pass.
|
|
13
|
-
*
|
|
14
|
-
* `time` is the seconds from the suite's start to the case's completion: the
|
|
15
|
-
* service records when a case finished, not when its run started.
|
|
16
|
-
*/
|
|
17
|
-
/** U+FFFD, written as an escape so the source stays plain ASCII. */
|
|
18
|
-
const REPLACEMENT_CHARACTER = '\uFFFD';
|
|
19
|
-
/**
|
|
20
|
-
* Whether XML 1.0 can carry a code point at all, even escaped (its `Char`
|
|
21
|
-
* production): tab, LF, CR, U+0020–U+D7FF, U+E000–U+FFFD and the supplementary
|
|
22
|
-
* planes. C0 controls, U+FFFE/U+FFFF and unpaired surrogates are not.
|
|
23
|
-
*/
|
|
24
|
-
function isXmlChar(codePoint) {
|
|
25
|
-
return (codePoint === 0x9 ||
|
|
26
|
-
codePoint === 0xa ||
|
|
27
|
-
codePoint === 0xd ||
|
|
28
|
-
(codePoint >= 0x20 && codePoint <= 0xd7ff) ||
|
|
29
|
-
(codePoint >= 0xe000 && codePoint <= 0xfffd) ||
|
|
30
|
-
(codePoint >= 0x10000 && codePoint <= 0x10ffff));
|
|
31
|
-
}
|
|
32
|
-
/** Text safe for an XML attribute value or element content. */
|
|
33
|
-
export function escapeXml(value) {
|
|
34
|
-
let out = '';
|
|
35
|
-
// Iterating a string yields code points; an unpaired surrogate comes out on its own.
|
|
36
|
-
for (const char of value) {
|
|
37
|
-
const codePoint = char.codePointAt(0) ?? 0;
|
|
38
|
-
if (!isXmlChar(codePoint)) {
|
|
39
|
-
out += REPLACEMENT_CHARACTER;
|
|
40
|
-
continue;
|
|
41
|
-
}
|
|
42
|
-
switch (char) {
|
|
43
|
-
case '&':
|
|
44
|
-
out += '&';
|
|
45
|
-
break;
|
|
46
|
-
case '<':
|
|
47
|
-
out += '<';
|
|
48
|
-
break;
|
|
49
|
-
case '>':
|
|
50
|
-
out += '>';
|
|
51
|
-
break;
|
|
52
|
-
case '"':
|
|
53
|
-
out += '"';
|
|
54
|
-
break;
|
|
55
|
-
case "'":
|
|
56
|
-
out += ''';
|
|
57
|
-
break;
|
|
58
|
-
default:
|
|
59
|
-
out += char;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return out;
|
|
63
|
-
}
|
|
64
|
-
function attributes(values) {
|
|
65
|
-
return Object.entries(values)
|
|
66
|
-
.map(([name, value]) => `${name}="${escapeXml(String(value))}"`)
|
|
67
|
-
.join(' ');
|
|
68
|
-
}
|
|
69
|
-
/** Seconds between two ISO instants, 3 decimals; 0 when either is missing or unparsable. */
|
|
70
|
-
export function elapsedSeconds(from, to) {
|
|
71
|
-
if (!from || !to)
|
|
72
|
-
return '0';
|
|
73
|
-
const ms = Date.parse(to) - Date.parse(from);
|
|
74
|
-
if (!Number.isFinite(ms) || ms < 0)
|
|
75
|
-
return '0';
|
|
76
|
-
return (ms / 1000).toFixed(3);
|
|
77
|
-
}
|
|
78
|
-
function failureText(result) {
|
|
79
|
-
const lines = result.failures.map((failure) => `${failure.code}${failure.nodeId ? ` [node ${failure.nodeId}]` : ''}: ${failure.message}`);
|
|
80
|
-
if (result.runId)
|
|
81
|
-
lines.push(`Run: ${result.runId}${result.runStatus ? ` (${result.runStatus})` : ''}`);
|
|
82
|
-
return lines.join('\n');
|
|
83
|
-
}
|
|
84
|
-
function caseOutcome(result) {
|
|
85
|
-
const first = result.failures[0];
|
|
86
|
-
const text = escapeXml(failureText(result));
|
|
87
|
-
switch (result.status) {
|
|
88
|
-
case 'PASSED':
|
|
89
|
-
return null;
|
|
90
|
-
case 'FAILED':
|
|
91
|
-
return `<failure ${attributes({
|
|
92
|
-
message: first ? `${first.code}: ${first.message}` : 'The case failed',
|
|
93
|
-
type: first?.code ?? 'FAILED',
|
|
94
|
-
})}>${text}</failure>`;
|
|
95
|
-
case 'ERROR':
|
|
96
|
-
return `<error ${attributes({
|
|
97
|
-
message: first ? `${first.code}: ${first.message}` : 'The case could not run',
|
|
98
|
-
type: first?.code ?? 'ERROR',
|
|
99
|
-
})}>${text}</error>`;
|
|
100
|
-
default:
|
|
101
|
-
return `<error ${attributes({
|
|
102
|
-
message: `The case was still ${result.status} when the CLI stopped waiting`,
|
|
103
|
-
type: 'NOT_FINISHED',
|
|
104
|
-
})}>${text}</error>`;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
/** The JUnit XML document for a suite run (final or not). */
|
|
108
|
-
export function suiteToJUnit(suite) {
|
|
109
|
-
const failures = suite.results.filter((result) => result.status === 'FAILED').length;
|
|
110
|
-
const errors = suite.results.filter((result) => result.status !== 'PASSED' && result.status !== 'FAILED').length;
|
|
111
|
-
const tests = suite.results.length;
|
|
112
|
-
const end = suite.completedAt ??
|
|
113
|
-
suite.results.reduce((latest, result) => result.completedAt && (!latest || result.completedAt > latest)
|
|
114
|
-
? result.completedAt
|
|
115
|
-
: latest, null);
|
|
116
|
-
const time = elapsedSeconds(suite.startedAt, end);
|
|
117
|
-
const name = `${suite.workflowKey}@${suite.version}`;
|
|
118
|
-
const classname = `fluidgrids.${suite.workflowKey}`;
|
|
119
|
-
const lines = [
|
|
120
|
-
'<?xml version="1.0" encoding="UTF-8"?>',
|
|
121
|
-
`<testsuites ${attributes({ name: 'fluidgrids', tests, failures, errors, time })}>`,
|
|
122
|
-
` <testsuite ${attributes({
|
|
123
|
-
name,
|
|
124
|
-
id: suite.id,
|
|
125
|
-
tests,
|
|
126
|
-
failures,
|
|
127
|
-
errors,
|
|
128
|
-
skipped: 0,
|
|
129
|
-
timestamp: suite.startedAt,
|
|
130
|
-
time,
|
|
131
|
-
})}>`,
|
|
132
|
-
' <properties>',
|
|
133
|
-
` <property ${attributes({ name: 'suiteRunId', value: suite.id })}/>`,
|
|
134
|
-
` <property ${attributes({ name: 'workflowKey', value: suite.workflowKey })}/>`,
|
|
135
|
-
` <property ${attributes({ name: 'version', value: suite.version })}/>`,
|
|
136
|
-
` <property ${attributes({ name: 'status', value: suite.status })}/>`,
|
|
137
|
-
' </properties>',
|
|
138
|
-
];
|
|
139
|
-
for (const result of suite.results) {
|
|
140
|
-
const open = ` <testcase ${attributes({
|
|
141
|
-
name: result.caseName,
|
|
142
|
-
classname,
|
|
143
|
-
time: elapsedSeconds(suite.startedAt, result.completedAt),
|
|
144
|
-
})}`;
|
|
145
|
-
const outcome = caseOutcome(result);
|
|
146
|
-
const runOut = result.runId
|
|
147
|
-
? ` <system-out>${escapeXml(`Case ${result.caseId}, run ${result.runId}`)}</system-out>`
|
|
148
|
-
: null;
|
|
149
|
-
if (!outcome && !runOut) {
|
|
150
|
-
lines.push(`${open}/>`);
|
|
151
|
-
continue;
|
|
152
|
-
}
|
|
153
|
-
lines.push(`${open}>`);
|
|
154
|
-
if (outcome)
|
|
155
|
-
lines.push(` ${outcome}`);
|
|
156
|
-
if (runOut)
|
|
157
|
-
lines.push(runOut);
|
|
158
|
-
lines.push(' </testcase>');
|
|
159
|
-
}
|
|
160
|
-
lines.push(' </testsuite>', '</testsuites>', '');
|
|
161
|
-
return lines.join('\n');
|
|
162
|
-
}
|
|
163
|
-
//# sourceMappingURL=junit.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"junit.js","sourceRoot":"","sources":["../../src/code-first/junit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,oEAAoE;AACpE,MAAM,qBAAqB,GAAG,QAAQ,CAAC;AAEvC;;;;GAIG;AACH,SAAS,SAAS,CAAC,SAAiB;IAClC,OAAO,CACL,SAAS,KAAK,GAAG;QACjB,SAAS,KAAK,GAAG;QACjB,SAAS,KAAK,GAAG;QACjB,CAAC,SAAS,IAAI,IAAI,IAAI,SAAS,IAAI,MAAM,CAAC;QAC1C,CAAC,SAAS,IAAI,MAAM,IAAI,SAAS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AG,iBAAiB,UAAU,CAAC;YACvC,IAAI,EAAE,MAAM,CAAC,QAAQ;YACrB,SAAS;YACT,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC;SAC1D,CAAC,EAAE,CAAC;QACL,MAAM,OAAO,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;QACpC,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK;YACzB,CAAC,CAAC,qBAAqB,SAAS,CAAC,QAAQ,MAAM,CAAC,MAAM,SAAS,MAAM,CAAC,KAAK,EAAE,CAAC,eAAe;YAC7F,CAAC,CAAC,IAAI,CAAC;QACT,IAAI,CAAC,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;YACxB,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC;YACxB,SAAS;QACX,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC;QACvB,IAAI,OAAO;YAAE,KAAK,CAAC,IAAI,CAAC,SAAS,OAAO,EAAE,CAAC,CAAC;QAC5C,IAAI,MAAM;YAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC/B,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAChC,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,gBAAgB,EAAE,eAAe,EAAE,EAAE,CAAC,CAAC;IAClD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Lower the project's workflows to IR v2 (spec 07 §4, tier 1):
|
|
3
|
-
* - TypeScript: `lower()` from `@fluidgrids/workflows/roundtrip`, with the
|
|
4
|
-
* pinned esbuild and the Node `vm` evaluator (the developer's own code);
|
|
5
|
-
* - Python: `python -m fluidgrids_workflows lower` from the installed
|
|
6
|
-
* `fluidgrids-workflows` package (see `python.ts`);
|
|
7
|
-
* - JSON: canvas workflows kept as the export envelope are read as they are.
|
|
8
|
-
*/
|
|
9
|
-
import type { ConnectionRef } from '@fluidgrids/workflows/ir';
|
|
10
|
-
import { type VendoredDeps } from '@fluidgrids/workflows/roundtrip';
|
|
11
|
-
import { type Project, type ProjectFile, type WorkflowFormat } from './project.js';
|
|
12
|
-
export interface LocalWorkflow {
|
|
13
|
-
key: string;
|
|
14
|
-
format: WorkflowFormat;
|
|
15
|
-
/** Project-relative file the workflow is defined in. */
|
|
16
|
-
path: string;
|
|
17
|
-
definition: Record<string, unknown>;
|
|
18
|
-
/** True when the definition runs code (a `code` block: tier-2 functions or `wf.codeWorkflow`). */
|
|
19
|
-
durable: boolean;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* A finding in durable-function sources that `push` refuses: `durable.phaseC`
|
|
23
|
-
* (a feature that arrives in Phase C) or `durable.activityTypeNotAllowed`.
|
|
24
|
-
*/
|
|
25
|
-
export interface DurableIssue {
|
|
26
|
-
code: string;
|
|
27
|
-
message: string;
|
|
28
|
-
module: string;
|
|
29
|
-
key?: string;
|
|
30
|
-
}
|
|
31
|
-
/** Largest code bundle the service accepts (C-S3, spec 01 §5). */
|
|
32
|
-
export declare const MAX_BUNDLE_BYTES: number;
|
|
33
|
-
export interface LoweredProject {
|
|
34
|
-
/** `buildId` of the TypeScript bundle, when the project has TypeScript workflows. */
|
|
35
|
-
buildId?: string;
|
|
36
|
-
/** `sourceHash` of the lowered sources, when the project has code workflows. */
|
|
37
|
-
sourceHash?: string;
|
|
38
|
-
workflows: LocalWorkflow[];
|
|
39
|
-
/** Notes about the lowering (for example SDK disagreements), one line each. */
|
|
40
|
-
warnings: string[];
|
|
41
|
-
/** The TypeScript bundle (one ES module that serves every code workflow of the push). */
|
|
42
|
-
bundle?: string;
|
|
43
|
-
/** The project files the bundle was built from, by path (the source archive's `files`). */
|
|
44
|
-
sourceFiles?: Record<string, string>;
|
|
45
|
-
/** Pure-ESM packages vendored from the project's `node_modules`. */
|
|
46
|
-
vendored?: VendoredDeps;
|
|
47
|
-
/**
|
|
48
|
-
* The bundle's source map (C-SOURCEMAP, SDK R2), uploaded inside the source
|
|
49
|
-
* archive so the service maps `__stack_trace` locations back to the sources.
|
|
50
|
-
*/
|
|
51
|
-
map?: string;
|
|
52
|
-
/** Durable-function findings; `push` refuses a project that has any. */
|
|
53
|
-
issues: DurableIssue[];
|
|
54
|
-
}
|
|
55
|
-
export interface LowerProjectOptions {
|
|
56
|
-
/** How connection names resolve. A function is called once per name. */
|
|
57
|
-
connections: (name: string) => ConnectionRef | undefined;
|
|
58
|
-
/** Explains unresolved names; one line each. */
|
|
59
|
-
explainUnresolved: (names: readonly string[]) => string[];
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* A failure of `lower()` as the CLI reports it: builder mistakes, determinism
|
|
63
|
-
* violations, size limits and esbuild compile errors are the user's to fix;
|
|
64
|
-
* anything else is rethrown as it is.
|
|
65
|
-
*/
|
|
66
|
-
export declare function lowerFailure(error: unknown, what: string): unknown;
|
|
67
|
-
/** True when a definition carries a `code` block, so a version of it needs a code bundle. */
|
|
68
|
-
export declare function runsCode(definition: Record<string, unknown>): boolean;
|
|
69
|
-
/**
|
|
70
|
-
* The project's runtime dependencies, vendored for the bundle: only when
|
|
71
|
-
* `package.json` lists `dependencies` besides the SDK itself (which the bundle
|
|
72
|
-
* embeds). Returns undefined when there is nothing to vendor.
|
|
73
|
-
*/
|
|
74
|
-
export declare function vendorProjectDependencies(root: string): VendoredDeps | undefined;
|
|
75
|
-
/**
|
|
76
|
-
* The files a durable project's bundle and source archive are built from: the
|
|
77
|
-
* workflow modules, the TypeScript files they import (transitively) and the
|
|
78
|
-
* sidecars. A co-located `*.spec.ts` test, or an `activities/` module no
|
|
79
|
-
* workflow imports, is neither bundled nor archived, so the service's rebuild
|
|
80
|
-
* with the SDK's default entries sees exactly the modules the CLI bundled.
|
|
81
|
-
*/
|
|
82
|
-
export declare function durableBundleFiles(files: readonly ProjectFile[], entries: readonly string[]): ProjectFile[];
|
|
83
|
-
/**
|
|
84
|
-
* The source map of a durable bundle (C-SOURCEMAP): the same build as
|
|
85
|
-
* `lower()`'s (the SDK's default entries over the archived files), with an
|
|
86
|
-
* external map. The bundle bytes are the same with or without a map; a build
|
|
87
|
-
* whose `buildId` differs anyway gives no map, so a map never describes
|
|
88
|
-
* another bundle.
|
|
89
|
-
*/
|
|
90
|
-
export declare function bundleSourceMap(files: readonly ProjectFile[], buildId: string, deps: VendoredDeps | undefined): Promise<string | undefined>;
|
|
91
|
-
export declare function lowerProject(project: Project, options: LowerProjectOptions & {
|
|
92
|
-
connectionNames: readonly string[];
|
|
93
|
-
}): Promise<LoweredProject>;
|
|
94
|
-
//# sourceMappingURL=lowering.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lowering.d.ts","sourceRoot":"","sources":["../../src/code-first/lowering.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EAOL,KAAK,YAAY,EAClB,MAAM,iCAAiC,CAAC;AAIzC,OAAO,EAML,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,cAAc,EACpB,MAAM,cAAc,CAAC;AAQtB,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,cAAc,CAAC;IACvB,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,kGAAkG;IAClG,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED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ACH,wBAAsB,eAAe,CACnC,KAAK,EAAE,SAAS,WAAW,EAAE,EAC7B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,YAAY,GAAG,SAAS,GAC7B,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAO7B;AAED,wBAAsB,YAAY,CAChC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,mBAAmB,GAAG;IAAE,eAAe,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GACpE,OAAO,CAAC,cAAc,CAAC,CA6HzB"}
|
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Lower the project's workflows to IR v2 (spec 07 §4, tier 1):
|
|
3
|
-
* - TypeScript: `lower()` from `@fluidgrids/workflows/roundtrip`, with the
|
|
4
|
-
* pinned esbuild and the Node `vm` evaluator (the developer's own code);
|
|
5
|
-
* - Python: `python -m fluidgrids_workflows lower` from the installed
|
|
6
|
-
* `fluidgrids-workflows` package (see `python.ts`);
|
|
7
|
-
* - JSON: canvas workflows kept as the export envelope are read as they are.
|
|
8
|
-
*/
|
|
9
|
-
import { CliUserError } from '@burdenoff/cli-sdk/core';
|
|
10
|
-
import { BuilderError, UnresolvedConnectionsError } from '@fluidgrids/workflows';
|
|
11
|
-
import { parseWorkflowDocument } from '@fluidgrids/workflows/ir';
|
|
12
|
-
import { buildBundle, defaultEntries, lower, LowerError, vendorDependencies, } from '@fluidgrids/workflows/roundtrip';
|
|
13
|
-
import { existsSync, readFileSync } from 'fs';
|
|
14
|
-
import { join, posix } from 'path';
|
|
15
|
-
import { isJsonWorkflow, isLoweringInput, isWorkflowModule, listSourcePaths, readProjectFiles, } from './project.js';
|
|
16
|
-
import { importClosure } from './imports.js';
|
|
17
|
-
import { lowerPython, PythonUnresolvedConnectionsError, resolvePythonInterpreter, } from './python.js';
|
|
18
|
-
/** Largest code bundle the service accepts (C-S3, spec 01 §5). */
|
|
19
|
-
export const MAX_BUNDLE_BYTES = 8 * 1024 * 1024;
|
|
20
|
-
function isBuildFailure(error) {
|
|
21
|
-
return error instanceof Error && 'errors' in error && Array.isArray(error.errors);
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* A failure of `lower()` as the CLI reports it: builder mistakes, determinism
|
|
25
|
-
* violations, size limits and esbuild compile errors are the user's to fix;
|
|
26
|
-
* anything else is rethrown as it is.
|
|
27
|
-
*/
|
|
28
|
-
export function lowerFailure(error, what) {
|
|
29
|
-
if (error instanceof LowerError || error instanceof BuilderError || isBuildFailure(error)) {
|
|
30
|
-
return new CliUserError(`Lowering ${what} failed: ${error.message}`);
|
|
31
|
-
}
|
|
32
|
-
return error;
|
|
33
|
-
}
|
|
34
|
-
function unresolvedError(names, explain) {
|
|
35
|
-
return new CliUserError(`The code names connections that do not resolve in this workspace: ${[...names].sort().join(', ')}`, { hint: explain(names).join('\n') });
|
|
36
|
-
}
|
|
37
|
-
function isRecord(value) {
|
|
38
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
39
|
-
}
|
|
40
|
-
/** True when a definition carries a `code` block, so a version of it needs a code bundle. */
|
|
41
|
-
export function runsCode(definition) {
|
|
42
|
-
return isRecord(definition['code']);
|
|
43
|
-
}
|
|
44
|
-
const SDK_PACKAGE = '@fluidgrids/workflows';
|
|
45
|
-
/**
|
|
46
|
-
* The project's runtime dependencies, vendored for the bundle: only when
|
|
47
|
-
* `package.json` lists `dependencies` besides the SDK itself (which the bundle
|
|
48
|
-
* embeds). Returns undefined when there is nothing to vendor.
|
|
49
|
-
*/
|
|
50
|
-
export function vendorProjectDependencies(root) {
|
|
51
|
-
const manifestPath = join(root, 'package.json');
|
|
52
|
-
if (!existsSync(manifestPath))
|
|
53
|
-
return undefined;
|
|
54
|
-
let manifest;
|
|
55
|
-
try {
|
|
56
|
-
manifest = JSON.parse(readFileSync(manifestPath, 'utf8'));
|
|
57
|
-
}
|
|
58
|
-
catch {
|
|
59
|
-
throw new CliUserError('package.json is not valid JSON.');
|
|
60
|
-
}
|
|
61
|
-
const dependencies = isRecord(manifest) ? manifest['dependencies'] : undefined;
|
|
62
|
-
if (!isRecord(dependencies))
|
|
63
|
-
return undefined;
|
|
64
|
-
if (!Object.keys(dependencies).some((name) => name !== SDK_PACKAGE))
|
|
65
|
-
return undefined;
|
|
66
|
-
try {
|
|
67
|
-
return vendorDependencies(root);
|
|
68
|
-
}
|
|
69
|
-
catch (error) {
|
|
70
|
-
throw lowerFailure(error, 'the project dependencies');
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* The files a durable project's bundle and source archive are built from: the
|
|
75
|
-
* workflow modules, the TypeScript files they import (transitively) and the
|
|
76
|
-
* sidecars. A co-located `*.spec.ts` test, or an `activities/` module no
|
|
77
|
-
* workflow imports, is neither bundled nor archived, so the service's rebuild
|
|
78
|
-
* with the SDK's default entries sees exactly the modules the CLI bundled.
|
|
79
|
-
*/
|
|
80
|
-
export function durableBundleFiles(files, entries) {
|
|
81
|
-
const sources = new Map(files.filter((file) => file.path.endsWith('.ts')).map((file) => [file.path, file.content]));
|
|
82
|
-
const reached = importClosure(sources, entries);
|
|
83
|
-
return files.filter((file) => !file.path.endsWith('.ts') || reached.has(file.path));
|
|
84
|
-
}
|
|
85
|
-
function sameList(a, b) {
|
|
86
|
-
return a.length === b.length && a.every((value, index) => value === b[index]);
|
|
87
|
-
}
|
|
88
|
-
function jsonWorkflows(project, paths) {
|
|
89
|
-
return readProjectFiles(project.root, paths).map((file) => {
|
|
90
|
-
const parsed = parseWorkflowDocument(file.content);
|
|
91
|
-
if (!parsed) {
|
|
92
|
-
throw new CliUserError(`${file.path} is not a workflow export or definition.`);
|
|
93
|
-
}
|
|
94
|
-
const stem = posix.basename(file.path, '.json');
|
|
95
|
-
const declared = typeof parsed.definitionJson['key'] === 'string' ? parsed.definitionJson['key'] : null;
|
|
96
|
-
const key = parsed.workflowKey ?? declared ?? stem;
|
|
97
|
-
const definition = parsed.definitionJson;
|
|
98
|
-
return { key, format: 'json', path: file.path, definition, durable: runsCode(definition) };
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
/** The full name → reference map a Python lowering receives. */
|
|
102
|
-
function connectionMap(names, resolve) {
|
|
103
|
-
const out = {};
|
|
104
|
-
for (const name of names) {
|
|
105
|
-
const ref = resolve(name);
|
|
106
|
-
if (ref) {
|
|
107
|
-
Object.defineProperty(out, name, {
|
|
108
|
-
value: ref,
|
|
109
|
-
enumerable: true,
|
|
110
|
-
writable: true,
|
|
111
|
-
configurable: true,
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
return out;
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* The source map of a durable bundle (C-SOURCEMAP): the same build as
|
|
119
|
-
* `lower()`'s (the SDK's default entries over the archived files), with an
|
|
120
|
-
* external map. The bundle bytes are the same with or without a map; a build
|
|
121
|
-
* whose `buildId` differs anyway gives no map, so a map never describes
|
|
122
|
-
* another bundle.
|
|
123
|
-
*/
|
|
124
|
-
export async function bundleSourceMap(files, buildId, deps) {
|
|
125
|
-
const built = await buildBundle(new Map(files.map((file) => [file.path, file.content])), {
|
|
126
|
-
maxBundleBytes: MAX_BUNDLE_BYTES,
|
|
127
|
-
sourcemap: 'external',
|
|
128
|
-
...(deps ? { deps } : {}),
|
|
129
|
-
});
|
|
130
|
-
return built.buildId === buildId ? built.map : undefined;
|
|
131
|
-
}
|
|
132
|
-
export async function lowerProject(project, options) {
|
|
133
|
-
const paths = listSourcePaths(project.root);
|
|
134
|
-
const language = project.config.language;
|
|
135
|
-
const entries = paths.filter((path) => isWorkflowModule(path, language));
|
|
136
|
-
const workflows = jsonWorkflows(project, paths.filter(isJsonWorkflow));
|
|
137
|
-
const result = { workflows, warnings: [], issues: [] };
|
|
138
|
-
if (entries.length > 0) {
|
|
139
|
-
if (language === 'ts') {
|
|
140
|
-
const files = readProjectFiles(project.root, paths.filter((path) => isLoweringInput(path, language)));
|
|
141
|
-
const deps = vendorProjectDependencies(project.root);
|
|
142
|
-
const run = (input, only) => lower(input, {
|
|
143
|
-
...(only ? { entries: only } : {}),
|
|
144
|
-
connections: options.connections,
|
|
145
|
-
maxBundleBytes: MAX_BUNDLE_BYTES,
|
|
146
|
-
...(deps ? { deps } : {}),
|
|
147
|
-
});
|
|
148
|
-
try {
|
|
149
|
-
let lowered = await run(files, entries);
|
|
150
|
-
let bundleFiles = files;
|
|
151
|
-
const durable = lowered.workflows.some((workflow) => runsCode(workflow.definition));
|
|
152
|
-
if (durable) {
|
|
153
|
-
bundleFiles = durableBundleFiles(files, entries);
|
|
154
|
-
// The service rebuilds a code bundle from the source archive with
|
|
155
|
-
// the SDK's default entries (`buildWorkflowCode`), so an uploaded
|
|
156
|
-
// bundle must come from those entries over the archived files, or
|
|
157
|
-
// the service's build would get another buildId. Graph-only
|
|
158
|
-
// projects keep their entries and files.
|
|
159
|
-
const paths = bundleFiles.map((file) => file.path);
|
|
160
|
-
if (bundleFiles.length !== files.length || !sameList(defaultEntries(paths), entries)) {
|
|
161
|
-
lowered = await run(bundleFiles);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
result.buildId = lowered.buildId;
|
|
165
|
-
result.sourceHash = lowered.sourceHash;
|
|
166
|
-
result.bundle = lowered.bundle;
|
|
167
|
-
if (durable) {
|
|
168
|
-
const map = await bundleSourceMap(bundleFiles, lowered.buildId, deps);
|
|
169
|
-
if (map !== undefined)
|
|
170
|
-
result.map = map;
|
|
171
|
-
else {
|
|
172
|
-
result.warnings.push('The source map build did not reproduce the bundle; the push uploads no source map (stack traces show bundle locations).');
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
result.sourceFiles = Object.fromEntries(bundleFiles.map((file) => [file.path, file.content]));
|
|
176
|
-
if (deps)
|
|
177
|
-
result.vendored = deps;
|
|
178
|
-
result.issues.push(...lowered.issues);
|
|
179
|
-
for (const workflow of lowered.workflows) {
|
|
180
|
-
const definition = workflow.definition;
|
|
181
|
-
workflows.push({
|
|
182
|
-
key: workflow.key,
|
|
183
|
-
format: 'ts',
|
|
184
|
-
path: workflow.module,
|
|
185
|
-
definition,
|
|
186
|
-
durable: runsCode(definition),
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
catch (error) {
|
|
191
|
-
if (error instanceof UnresolvedConnectionsError) {
|
|
192
|
-
throw unresolvedError(error.names, options.explainUnresolved);
|
|
193
|
-
}
|
|
194
|
-
throw lowerFailure(error, 'the TypeScript workflows');
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
else {
|
|
198
|
-
try {
|
|
199
|
-
const lowered = await lowerPython({
|
|
200
|
-
python: resolvePythonInterpreter(project.root, project.config.python),
|
|
201
|
-
root: project.root,
|
|
202
|
-
entries,
|
|
203
|
-
connections: connectionMap(options.connectionNames, options.connections),
|
|
204
|
-
});
|
|
205
|
-
result.sourceHash = lowered.sourceHash;
|
|
206
|
-
result.warnings.push(...lowered.warnings);
|
|
207
|
-
result.issues.push(...lowered.issues);
|
|
208
|
-
for (const workflow of lowered.workflows) {
|
|
209
|
-
const durable = runsCode(workflow.definition);
|
|
210
|
-
if (durable) {
|
|
211
|
-
// A Python definition with a code block needs a Python bundle and
|
|
212
|
-
// the Python durable worker, both Phase C (BOFF-9906).
|
|
213
|
-
result.issues.push({
|
|
214
|
-
code: 'durable.phaseC',
|
|
215
|
-
message: `${workflow.module}: Python durable functions (tier 2) arrive in Phase C`,
|
|
216
|
-
module: workflow.module,
|
|
217
|
-
key: workflow.key,
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
workflows.push({
|
|
221
|
-
key: workflow.key,
|
|
222
|
-
format: 'py',
|
|
223
|
-
path: workflow.module,
|
|
224
|
-
definition: workflow.definition,
|
|
225
|
-
durable,
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
catch (error) {
|
|
230
|
-
if (error instanceof PythonUnresolvedConnectionsError) {
|
|
231
|
-
throw unresolvedError(error.names, options.explainUnresolved);
|
|
232
|
-
}
|
|
233
|
-
throw error;
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
const seen = new Map();
|
|
238
|
-
for (const workflow of workflows) {
|
|
239
|
-
const previous = seen.get(workflow.key);
|
|
240
|
-
if (previous) {
|
|
241
|
-
throw new CliUserError(`Workflow key "${workflow.key}" is defined twice (${previous} and ${workflow.path}).`, { hint: 'Delete one of the files; `fluidgrids pull --as` replaces the other format.' });
|
|
242
|
-
}
|
|
243
|
-
seen.set(workflow.key, workflow.path);
|
|
244
|
-
}
|
|
245
|
-
workflows.sort((a, b) => (a.key < b.key ? -1 : a.key > b.key ? 1 : 0));
|
|
246
|
-
return result;
|
|
247
|
-
}
|
|
248
|
-
//# sourceMappingURL=lowering.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lowering.js","sourceRoot":"","sources":["../../src/code-first/lowering.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EACL,WAAW,EACX,cAAc,EACd,KAAK,EACL,UAAU,EACV,kBAAkB,GAGnB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAEnC,OAAO,EACL,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,gBAAgB,GAIjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EACL,WAAW,EACX,gCAAgC,EAChC,wBAAwB,GACzB,MAAM,aAAa,CAAC;AAuBrB,kEA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CACpB,iBAAiB,QAAQ,CAAC,GAAG,uBAAuB,QAAQ,QAAQ,QAAQ,CAAC,IAAI,IAAI,EACrF,EAAE,IAAI,EAAE,4EAA4E,EAAE,CACvF,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IACD,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACvE,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GraphQL documents for the code-first commands (spec 07 §7, Phase A).
|
|
3
|
-
*
|
|
4
|
-
* Every document targets the WORKSPACE gateway (wspace-workflow-svc, plus
|
|
5
|
-
* wspace-integrations-svc for connections). They are hand-written, like the
|
|
6
|
-
* documents in `@burdenoff/cli-sdk/modules/fluidgrids`, and validated by
|
|
7
|
-
* `tests/code-first/operations.test.ts`.
|
|
8
|
-
*
|
|
9
|
-
* Two groups:
|
|
10
|
-
* - Live operations, validated against the vendored supergraph
|
|
11
|
-
* `schema/wspace.graphql`: `exportWorkflow` (JSON envelope),
|
|
12
|
-
* `workflowVersions`, `createWorkflowVersion`, `importWorkflow`,
|
|
13
|
-
* `workflowVersionDiff`, `nodeEndpointConfigs`, `getConnections`,
|
|
14
|
-
* `workflowDefinitions`.
|
|
15
|
-
* - Code-first operations added by the wspace-workflow-svc code-first release
|
|
16
|
-
* (BOFF-9904): `exportWorkflow(format:, options:)` with the additive
|
|
17
|
-
* `exportFormat` / `files` / `fidelity` / `irHash` fields, `importWorkflow`
|
|
18
|
-
* with `source`, `validateWorkflowDefinition` and `workflowInterface`. They
|
|
19
|
-
* are validated against the vendored supergraph, which carries them.
|
|
20
|
-
*
|
|
21
|
-
* Every code-first operation is gated on the service by the
|
|
22
|
-
* `fluidgrids.code-first` feature flag; a workspace without it gets a GraphQL
|
|
23
|
-
* error that the CLI prints as it is.
|
|
24
|
-
*/
|
|
25
|
-
/** The portable JSON envelope, exactly the fields the service writes. */
|
|
26
|
-
export declare const CF_EXPORT_WORKFLOW = "\n query FluidgridsCodeExportWorkflow($workflowKey: String!, $version: String) {\n exportWorkflow(workflowKey: $workflowKey, version: $version) {\n format schemaVersion exportedAt workflowKey version name description\n definitionJson context tags tagsV2 icon category\n nodeReferences { nodeId nodeType nodeVersion }\n }\n }\n";
|
|
27
|
-
/** Code formats the service renders. */
|
|
28
|
-
export declare const RENDERED_EXPORT_FORMATS: readonly ["TYPESCRIPT", "PYTHON"];
|
|
29
|
-
export type RenderedExportFormat = (typeof RENDERED_EXPORT_FORMATS)[number];
|
|
30
|
-
/**
|
|
31
|
-
* `exportWorkflow` rendered as code on the service (code-first release).
|
|
32
|
-
* `ExportOptionsInput.connectionNames` is the on/off switch (default on) and
|
|
33
|
-
* `connectionNameMap` carries the connectionId-to-name map, because the service
|
|
34
|
-
* does not read the integrations service on the caller's behalf.
|
|
35
|
-
*/
|
|
36
|
-
export declare function renderedExportDocument(format: RenderedExportFormat): string;
|
|
37
|
-
export declare const CF_WORKFLOW_VERSIONS = "\n query FluidgridsCodeWorkflowVersions($workflowKey: String!) {\n workflowVersions(workflowKey: $workflowKey) {\n id workflowKey version name status isActive alias createdAt\n }\n }\n";
|
|
38
|
-
export declare const CF_LIST_WORKFLOW_KEYS = "\n query FluidgridsCodeListWorkflowKeys($input: ListWorkflowDefinitionsInput!) {\n workflowDefinitions(input: $input) {\n items { workflowKey version }\n total\n hasMore\n }\n }\n";
|
|
39
|
-
export declare const CF_CREATE_WORKFLOW_VERSION = "\n mutation FluidgridsCodeCreateWorkflowVersion(\n $workflowKey: String!\n $input: CreateWorkflowVersionInput!\n ) {\n createWorkflowVersion(workflowKey: $workflowKey, input: $input) {\n success\n message\n workflow { id workflowKey version status createdAt validationWarnings }\n }\n }\n";
|
|
40
|
-
/**
|
|
41
|
-
* `importWorkflow` with either a bare `definitionJson` (live) or, from the
|
|
42
|
-
* code-first release, `source: { format, files, connections }` so the service
|
|
43
|
-
* reads a JSON document or lowers tier-1 TypeScript itself.
|
|
44
|
-
*/
|
|
45
|
-
export declare const CF_IMPORT_WORKFLOW = "\n mutation FluidgridsCodeImportWorkflow($input: ImportWorkflowInput!) {\n importWorkflow(input: $input) {\n success\n message\n workflow { id workflowKey version status createdAt validationWarnings }\n validation {\n valid errors warnings\n missingNodes { nodeId nodeType nodeVersion }\n }\n }\n }\n";
|
|
46
|
-
export declare const CF_WORKFLOW_VERSION_DIFF = "\n query FluidgridsCodeWorkflowVersionDiff(\n $workflowKey: String!\n $fromVersion: String!\n $toVersion: String!\n ) {\n workflowVersionDiff(workflowKey: $workflowKey, fromVersion: $fromVersion, toVersion: $toVersion) {\n workflowKey fromVersion toVersion truncated\n entries { path kind before after }\n }\n }\n";
|
|
47
|
-
/** IR v2 validation on the service, with the strict rules on request (code-first release). */
|
|
48
|
-
export declare const CF_VALIDATE_WORKFLOW_DEFINITION = "\n query FluidgridsCodeValidateWorkflowDefinition($definitionJson: JSON!, $strict: Boolean) {\n validateWorkflowDefinition(definitionJson: $definitionJson, strict: $strict) {\n valid schemaVersion irHash taskQueues\n errors { code message nodeId path }\n warnings { code message nodeId path }\n }\n }\n";
|
|
49
|
-
/** The workflow's declared or derived interface (inputs, outputs, signals) (code-first release). */
|
|
50
|
-
export declare const CF_WORKFLOW_INTERFACE = "\n query FluidgridsCodeWorkflowInterface($workflowKey: String!, $version: String) {\n workflowInterface(workflowKey: $workflowKey, version: $version)\n }\n";
|
|
51
|
-
/** The node registry the workspace can use: the contract fields codegen reads. */
|
|
52
|
-
export declare const CF_LIST_NODE_MANIFESTS = "\n query FluidgridsCodeNodeManifests($status: NodeConfigStatus, $pagination: WorkflowPaginationInput) {\n nodeEndpointConfigs(status: $status, pagination: $pagination) {\n configs { nodeType nodeVersion name kind operations isLatest }\n pagination { total limit offset hasMore }\n }\n }\n";
|
|
53
|
-
/** Workspace connections, to resolve connection names in code to ids. */
|
|
54
|
-
export declare const CF_LIST_CONNECTIONS = "\n query FluidgridsCodeConnections($pagination: IntegrationsPaginationInput) {\n getConnections(pagination: $pagination) {\n items { id name provider { key } }\n total\n hasMore\n }\n }\n";
|
|
55
|
-
//# sourceMappingURL=operations.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/code-first/operations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAIH,yEAAyE;AACzE,eAAO,MAAM,kBAAkB,kWAQ9B,CAAC;AAEF,wCAAwC;AACxC,eAAO,MAAM,uBAAuB,mCAAoC,CAAC;AACzE,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5E;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAyB3E;AAED,eAAO,MAAM,oBAAoB,0MAMhC,CAAC;AAEF,eAAO,MAAM,qBAAqB,+MAQjC,CAAC;AAIF,eAAO,MAAM,0BAA0B,mUAWtC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,gWAY9B,CAAC;AAEF,eAAO,MAAM,wBAAwB,0VAWpC,CAAC;AAIF,8FAA8F;AAC9F,eAAO,MAAM,+BAA+B,0UAQ3C,CAAC;AAEF,oGAAoG;AACpG,eAAO,MAAM,qBAAqB,qKAIjC,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,sBAAsB,uTAOlC,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,mBAAmB,uNAQ/B,CAAC"}
|