@fluidgrids/cli 2026.1108.1 → 2026.1110.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.
Files changed (238) hide show
  1. package/README.md +1 -1
  2. package/dist/cli.js +9708 -33
  3. package/package.json +37 -33
  4. package/dist/auth/device-login.d.ts +0 -31
  5. package/dist/auth/device-login.d.ts.map +0 -1
  6. package/dist/auth/device-login.js +0 -75
  7. package/dist/auth/device-login.js.map +0 -1
  8. package/dist/auth/token-auth.d.ts +0 -49
  9. package/dist/auth/token-auth.d.ts.map +0 -1
  10. package/dist/auth/token-auth.js +0 -279
  11. package/dist/auth/token-auth.js.map +0 -1
  12. package/dist/cli.d.ts +0 -10
  13. package/dist/cli.d.ts.map +0 -1
  14. package/dist/cli.js.map +0 -1
  15. package/dist/code-first/api.d.ts +0 -607
  16. package/dist/code-first/api.d.ts.map +0 -1
  17. package/dist/code-first/api.js +0 -438
  18. package/dist/code-first/api.js.map +0 -1
  19. package/dist/code-first/code-upload.d.ts +0 -68
  20. package/dist/code-first/code-upload.d.ts.map +0 -1
  21. package/dist/code-first/code-upload.js +0 -223
  22. package/dist/code-first/code-upload.js.map +0 -1
  23. package/dist/code-first/commands/codegen.d.ts +0 -20
  24. package/dist/code-first/commands/codegen.d.ts.map +0 -1
  25. package/dist/code-first/commands/codegen.js +0 -50
  26. package/dist/code-first/commands/codegen.js.map +0 -1
  27. package/dist/code-first/commands/diff.d.ts +0 -28
  28. package/dist/code-first/commands/diff.d.ts.map +0 -1
  29. package/dist/code-first/commands/diff.js +0 -73
  30. package/dist/code-first/commands/diff.js.map +0 -1
  31. package/dist/code-first/commands/hotfix.d.ts +0 -55
  32. package/dist/code-first/commands/hotfix.d.ts.map +0 -1
  33. package/dist/code-first/commands/hotfix.js +0 -231
  34. package/dist/code-first/commands/hotfix.js.map +0 -1
  35. package/dist/code-first/commands/import.d.ts +0 -40
  36. package/dist/code-first/commands/import.d.ts.map +0 -1
  37. package/dist/code-first/commands/import.js +0 -235
  38. package/dist/code-first/commands/import.js.map +0 -1
  39. package/dist/code-first/commands/init.d.ts +0 -33
  40. package/dist/code-first/commands/init.d.ts.map +0 -1
  41. package/dist/code-first/commands/init.js +0 -177
  42. package/dist/code-first/commands/init.js.map +0 -1
  43. package/dist/code-first/commands/interface.d.ts +0 -12
  44. package/dist/code-first/commands/interface.d.ts.map +0 -1
  45. package/dist/code-first/commands/interface.js +0 -21
  46. package/dist/code-first/commands/interface.js.map +0 -1
  47. package/dist/code-first/commands/pull.d.ts +0 -63
  48. package/dist/code-first/commands/pull.d.ts.map +0 -1
  49. package/dist/code-first/commands/pull.js +0 -266
  50. package/dist/code-first/commands/pull.js.map +0 -1
  51. package/dist/code-first/commands/push.d.ts +0 -104
  52. package/dist/code-first/commands/push.d.ts.map +0 -1
  53. package/dist/code-first/commands/push.js +0 -320
  54. package/dist/code-first/commands/push.js.map +0 -1
  55. package/dist/code-first/commands/replay.d.ts +0 -44
  56. package/dist/code-first/commands/replay.d.ts.map +0 -1
  57. package/dist/code-first/commands/replay.js +0 -271
  58. package/dist/code-first/commands/replay.js.map +0 -1
  59. package/dist/code-first/commands/runs.d.ts +0 -168
  60. package/dist/code-first/commands/runs.d.ts.map +0 -1
  61. package/dist/code-first/commands/runs.js +0 -598
  62. package/dist/code-first/commands/runs.js.map +0 -1
  63. package/dist/code-first/commands/suite.d.ts +0 -57
  64. package/dist/code-first/commands/suite.d.ts.map +0 -1
  65. package/dist/code-first/commands/suite.js +0 -197
  66. package/dist/code-first/commands/suite.js.map +0 -1
  67. package/dist/code-first/commands/validate.d.ts +0 -38
  68. package/dist/code-first/commands/validate.d.ts.map +0 -1
  69. package/dist/code-first/commands/validate.js +0 -140
  70. package/dist/code-first/commands/validate.js.map +0 -1
  71. package/dist/code-first/commands/versions.d.ts +0 -63
  72. package/dist/code-first/commands/versions.d.ts.map +0 -1
  73. package/dist/code-first/commands/versions.js +0 -204
  74. package/dist/code-first/commands/versions.js.map +0 -1
  75. package/dist/code-first/connections.d.ts +0 -55
  76. package/dist/code-first/connections.d.ts.map +0 -1
  77. package/dist/code-first/connections.js +0 -180
  78. package/dist/code-first/connections.js.map +0 -1
  79. package/dist/code-first/durable-operations.d.ts +0 -41
  80. package/dist/code-first/durable-operations.d.ts.map +0 -1
  81. package/dist/code-first/durable-operations.js +0 -135
  82. package/dist/code-first/durable-operations.js.map +0 -1
  83. package/dist/code-first/history.d.ts +0 -30
  84. package/dist/code-first/history.d.ts.map +0 -1
  85. package/dist/code-first/history.js +0 -139
  86. package/dist/code-first/history.js.map +0 -1
  87. package/dist/code-first/imports.d.ts +0 -22
  88. package/dist/code-first/imports.d.ts.map +0 -1
  89. package/dist/code-first/imports.js +0 -67
  90. package/dist/code-first/imports.js.map +0 -1
  91. package/dist/code-first/index.d.ts +0 -18
  92. package/dist/code-first/index.d.ts.map +0 -1
  93. package/dist/code-first/index.js +0 -36
  94. package/dist/code-first/index.js.map +0 -1
  95. package/dist/code-first/junit.d.ts +0 -24
  96. package/dist/code-first/junit.d.ts.map +0 -1
  97. package/dist/code-first/junit.js +0 -163
  98. package/dist/code-first/junit.js.map +0 -1
  99. package/dist/code-first/lowering.d.ts +0 -104
  100. package/dist/code-first/lowering.d.ts.map +0 -1
  101. package/dist/code-first/lowering.js +0 -254
  102. package/dist/code-first/lowering.js.map +0 -1
  103. package/dist/code-first/operations.d.ts +0 -55
  104. package/dist/code-first/operations.d.ts.map +0 -1
  105. package/dist/code-first/operations.js +0 -165
  106. package/dist/code-first/operations.js.map +0 -1
  107. package/dist/code-first/parity-operations.d.ts +0 -44
  108. package/dist/code-first/parity-operations.d.ts.map +0 -1
  109. package/dist/code-first/parity-operations.js +0 -211
  110. package/dist/code-first/parity-operations.js.map +0 -1
  111. package/dist/code-first/parity.d.ts +0 -83
  112. package/dist/code-first/parity.d.ts.map +0 -1
  113. package/dist/code-first/parity.js +0 -301
  114. package/dist/code-first/parity.js.map +0 -1
  115. package/dist/code-first/presigned.d.ts +0 -21
  116. package/dist/code-first/presigned.d.ts.map +0 -1
  117. package/dist/code-first/presigned.js +0 -85
  118. package/dist/code-first/presigned.js.map +0 -1
  119. package/dist/code-first/project.d.ts +0 -130
  120. package/dist/code-first/project.d.ts.map +0 -1
  121. package/dist/code-first/project.js +0 -308
  122. package/dist/code-first/project.js.map +0 -1
  123. package/dist/code-first/python-build.d.ts +0 -78
  124. package/dist/code-first/python-build.d.ts.map +0 -1
  125. package/dist/code-first/python-build.js +0 -268
  126. package/dist/code-first/python-build.js.map +0 -1
  127. package/dist/code-first/python.d.ts +0 -103
  128. package/dist/code-first/python.d.ts.map +0 -1
  129. package/dist/code-first/python.js +0 -260
  130. package/dist/code-first/python.js.map +0 -1
  131. package/dist/code-first/redact.d.ts +0 -31
  132. package/dist/code-first/redact.d.ts.map +0 -1
  133. package/dist/code-first/redact.js +0 -159
  134. package/dist/code-first/redact.js.map +0 -1
  135. package/dist/code-first/register.d.ts +0 -35
  136. package/dist/code-first/register.d.ts.map +0 -1
  137. package/dist/code-first/register.js +0 -420
  138. package/dist/code-first/register.js.map +0 -1
  139. package/dist/code-first/remote.d.ts +0 -58
  140. package/dist/code-first/remote.d.ts.map +0 -1
  141. package/dist/code-first/remote.js +0 -126
  142. package/dist/code-first/remote.js.map +0 -1
  143. package/dist/code-first/replay.d.ts +0 -36
  144. package/dist/code-first/replay.d.ts.map +0 -1
  145. package/dist/code-first/replay.js +0 -52
  146. package/dist/code-first/replay.js.map +0 -1
  147. package/dist/code-first/shared.d.ts +0 -53
  148. package/dist/code-first/shared.d.ts.map +0 -1
  149. package/dist/code-first/shared.js +0 -94
  150. package/dist/code-first/shared.js.map +0 -1
  151. package/dist/code-first/test-suite-operations.d.ts +0 -16
  152. package/dist/code-first/test-suite-operations.d.ts.map +0 -1
  153. package/dist/code-first/test-suite-operations.js +0 -44
  154. package/dist/code-first/test-suite-operations.js.map +0 -1
  155. package/dist/config/apply.d.ts +0 -51
  156. package/dist/config/apply.d.ts.map +0 -1
  157. package/dist/config/apply.js +0 -121
  158. package/dist/config/apply.js.map +0 -1
  159. package/dist/config/commands.d.ts +0 -58
  160. package/dist/config/commands.d.ts.map +0 -1
  161. package/dist/config/commands.js +0 -252
  162. package/dist/config/commands.js.map +0 -1
  163. package/dist/config/profiles.d.ts +0 -108
  164. package/dist/config/profiles.d.ts.map +0 -1
  165. package/dist/config/profiles.js +0 -339
  166. package/dist/config/profiles.js.map +0 -1
  167. package/dist/flag-hint.d.ts +0 -46
  168. package/dist/flag-hint.d.ts.map +0 -1
  169. package/dist/flag-hint.js +0 -114
  170. package/dist/flag-hint.js.map +0 -1
  171. package/dist/modules.d.ts +0 -17
  172. package/dist/modules.d.ts.map +0 -1
  173. package/dist/modules.js +0 -65
  174. package/dist/modules.js.map +0 -1
  175. package/dist/phase-c/api.d.ts +0 -433
  176. package/dist/phase-c/api.d.ts.map +0 -1
  177. package/dist/phase-c/api.js +0 -334
  178. package/dist/phase-c/api.js.map +0 -1
  179. package/dist/phase-c/commands/activities.d.ts +0 -119
  180. package/dist/phase-c/commands/activities.d.ts.map +0 -1
  181. package/dist/phase-c/commands/activities.js +0 -287
  182. package/dist/phase-c/commands/activities.js.map +0 -1
  183. package/dist/phase-c/commands/batch.d.ts +0 -90
  184. package/dist/phase-c/commands/batch.d.ts.map +0 -1
  185. package/dist/phase-c/commands/batch.js +0 -296
  186. package/dist/phase-c/commands/batch.js.map +0 -1
  187. package/dist/phase-c/commands/queues.d.ts +0 -67
  188. package/dist/phase-c/commands/queues.d.ts.map +0 -1
  189. package/dist/phase-c/commands/queues.js +0 -183
  190. package/dist/phase-c/commands/queues.js.map +0 -1
  191. package/dist/phase-c/commands/run-control.d.ts +0 -76
  192. package/dist/phase-c/commands/run-control.d.ts.map +0 -1
  193. package/dist/phase-c/commands/run-control.js +0 -245
  194. package/dist/phase-c/commands/run-control.js.map +0 -1
  195. package/dist/phase-c/commands/schedules.d.ts +0 -63
  196. package/dist/phase-c/commands/schedules.d.ts.map +0 -1
  197. package/dist/phase-c/commands/schedules.js +0 -198
  198. package/dist/phase-c/commands/schedules.js.map +0 -1
  199. package/dist/phase-c/commands/search-attributes.d.ts +0 -30
  200. package/dist/phase-c/commands/search-attributes.d.ts.map +0 -1
  201. package/dist/phase-c/commands/search-attributes.js +0 -70
  202. package/dist/phase-c/commands/search-attributes.js.map +0 -1
  203. package/dist/phase-c/commands/signal-tokens.d.ts +0 -27
  204. package/dist/phase-c/commands/signal-tokens.d.ts.map +0 -1
  205. package/dist/phase-c/commands/signal-tokens.js +0 -68
  206. package/dist/phase-c/commands/signal-tokens.js.map +0 -1
  207. package/dist/phase-c/commands/worker-run.d.ts +0 -109
  208. package/dist/phase-c/commands/worker-run.d.ts.map +0 -1
  209. package/dist/phase-c/commands/worker-run.js +0 -484
  210. package/dist/phase-c/commands/worker-run.js.map +0 -1
  211. package/dist/phase-c/commands/workers.d.ts +0 -46
  212. package/dist/phase-c/commands/workers.d.ts.map +0 -1
  213. package/dist/phase-c/commands/workers.js +0 -140
  214. package/dist/phase-c/commands/workers.js.map +0 -1
  215. package/dist/phase-c/index.d.ts +0 -16
  216. package/dist/phase-c/index.d.ts.map +0 -1
  217. package/dist/phase-c/index.js +0 -25
  218. package/dist/phase-c/index.js.map +0 -1
  219. package/dist/phase-c/operations.d.ts +0 -67
  220. package/dist/phase-c/operations.d.ts.map +0 -1
  221. package/dist/phase-c/operations.js +0 -559
  222. package/dist/phase-c/operations.js.map +0 -1
  223. package/dist/phase-c/register.d.ts +0 -39
  224. package/dist/phase-c/register.d.ts.map +0 -1
  225. package/dist/phase-c/register.js +0 -678
  226. package/dist/phase-c/register.js.map +0 -1
  227. package/dist/phase-c/shared.d.ts +0 -44
  228. package/dist/phase-c/shared.d.ts.map +0 -1
  229. package/dist/phase-c/shared.js +0 -146
  230. package/dist/phase-c/shared.js.map +0 -1
  231. package/dist/product-defaults.d.ts +0 -11
  232. package/dist/product-defaults.d.ts.map +0 -1
  233. package/dist/product-defaults.js +0 -25
  234. package/dist/product-defaults.js.map +0 -1
  235. package/dist/program.d.ts +0 -25
  236. package/dist/program.d.ts.map +0 -1
  237. package/dist/program.js +0 -60
  238. package/dist/program.js.map +0 -1
@@ -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 += '&amp;';
45
- break;
46
- case '<':
47
- out += '&lt;';
48
- break;
49
- case '>':
50
- out += '&gt;';
51
- break;
52
- case '"':
53
- out += '&quot;';
54
- break;
55
- case "'":
56
- out += '&apos;';
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,CAA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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
- import { type PythonBuildResult } from './python-build.js';
13
- export interface LocalWorkflow {
14
- key: string;
15
- format: WorkflowFormat;
16
- /** Project-relative file the workflow is defined in. */
17
- path: string;
18
- definition: Record<string, unknown>;
19
- /** True when the definition runs code (a `code` block: tier-2 functions or `wf.codeWorkflow`). */
20
- durable: boolean;
21
- }
22
- /**
23
- * A finding in durable-function sources that `push` refuses: `durable.phaseC`
24
- * (a feature that arrives in Phase C) or `durable.activityTypeNotAllowed`.
25
- */
26
- export interface DurableIssue {
27
- code: string;
28
- message: string;
29
- module: string;
30
- key?: string;
31
- }
32
- /** Largest code bundle the service accepts (C-S3, spec 01 §5). */
33
- export declare const MAX_BUNDLE_BYTES: number;
34
- export interface LoweredProject {
35
- /** `buildId` of the TypeScript bundle, when the project has TypeScript workflows. */
36
- buildId?: string;
37
- /** `sourceHash` of the lowered sources, when the project has code workflows. */
38
- sourceHash?: string;
39
- workflows: LocalWorkflow[];
40
- /** Notes about the lowering (for example SDK disagreements), one line each. */
41
- warnings: string[];
42
- /** The TypeScript bundle (one ES module that serves every code workflow of the push). */
43
- bundle?: string;
44
- /** The project files the bundle was built from, by path (the source archive's `files`). */
45
- sourceFiles?: Record<string, string>;
46
- /** Pure-ESM packages vendored from the project's `node_modules`. */
47
- vendored?: VendoredDeps;
48
- /**
49
- * The bundle's source map (C-SOURCEMAP, SDK R2), uploaded inside the source
50
- * archive so the service maps `__stack_trace` locations back to the sources.
51
- */
52
- map?: string;
53
- /** Durable-function findings; `push` refuses a project that has any. */
54
- issues: DurableIssue[];
55
- /**
56
- * Python durable functions (Phase C, C-S6): builds the `.pyz` bundle a push
57
- * uploads with the Python SDK's `build_project` (into `.fluidgrids/build/`),
58
- * with the same connections and entries as the lowering. Present only when
59
- * a Python workflow runs code.
60
- */
61
- buildPython?: () => Promise<PythonBuildResult>;
62
- /** The interpreter of a Python project (replays). */
63
- python?: string;
64
- }
65
- export interface LowerProjectOptions {
66
- /** How connection names resolve. A function is called once per name. */
67
- connections: (name: string) => ConnectionRef | undefined;
68
- /** Explains unresolved names; one line each. */
69
- explainUnresolved: (names: readonly string[]) => string[];
70
- }
71
- /**
72
- * A failure of `lower()` as the CLI reports it: builder mistakes, determinism
73
- * violations, size limits and esbuild compile errors are the user's to fix;
74
- * anything else is rethrown as it is.
75
- */
76
- export declare function lowerFailure(error: unknown, what: string): unknown;
77
- /** True when a definition carries a `code` block, so a version of it needs a code bundle. */
78
- export declare function runsCode(definition: Record<string, unknown>): boolean;
79
- /**
80
- * The project's runtime dependencies, vendored for the bundle: only when
81
- * `package.json` lists `dependencies` besides the SDK itself (which the bundle
82
- * embeds). Returns undefined when there is nothing to vendor.
83
- */
84
- export declare function vendorProjectDependencies(root: string): VendoredDeps | undefined;
85
- /**
86
- * The files a durable project's bundle and source archive are built from: the
87
- * workflow modules, the TypeScript files they import (transitively) and the
88
- * sidecars. A co-located `*.spec.ts` test, or an `activities/` module no
89
- * workflow imports, is neither bundled nor archived, so the service's rebuild
90
- * with the SDK's default entries sees exactly the modules the CLI bundled.
91
- */
92
- export declare function durableBundleFiles(files: readonly ProjectFile[], entries: readonly string[]): ProjectFile[];
93
- /**
94
- * The source map of a durable bundle (C-SOURCEMAP): the same build as
95
- * `lower()`'s (the SDK's default entries over the archived files), with an
96
- * external map. The bundle bytes are the same with or without a map; a build
97
- * whose `buildId` differs anyway gives no map, so a map never describes
98
- * another bundle.
99
- */
100
- export declare function bundleSourceMap(files: readonly ProjectFile[], buildId: string, deps: VendoredDeps | undefined): Promise<string | undefined>;
101
- export declare function lowerProject(project: Project, options: LowerProjectOptions & {
102
- connectionNames: readonly string[];
103
- }): Promise<LoweredProject>;
104
- //# 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;AAOtB,OAAO,EAAkC,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3F,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,kEAAkE;AAClE,eAAO,MAAM,gBAAgB,QAAkB,CAAC;AAEhD,MAAM,WAAW,cAAc;IAC7B,qFAAqF;IACrF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gFAAgF;IAChF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,+EAA+E;IAC/E,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,yFAAyF;IACz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C,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,CAsIzB"}
@@ -1,254 +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
- import { buildPython, pythonSourceFiles } from './python-build.js';
19
- /** Largest code bundle the service accepts (C-S3, spec 01 §5). */
20
- export const MAX_BUNDLE_BYTES = 8 * 1024 * 1024;
21
- function isBuildFailure(error) {
22
- return error instanceof Error && 'errors' in error && Array.isArray(error.errors);
23
- }
24
- /**
25
- * A failure of `lower()` as the CLI reports it: builder mistakes, determinism
26
- * violations, size limits and esbuild compile errors are the user's to fix;
27
- * anything else is rethrown as it is.
28
- */
29
- export function lowerFailure(error, what) {
30
- if (error instanceof LowerError || error instanceof BuilderError || isBuildFailure(error)) {
31
- return new CliUserError(`Lowering ${what} failed: ${error.message}`);
32
- }
33
- return error;
34
- }
35
- function unresolvedError(names, explain) {
36
- return new CliUserError(`The code names connections that do not resolve in this workspace: ${[...names].sort().join(', ')}`, { hint: explain(names).join('\n') });
37
- }
38
- function isRecord(value) {
39
- return typeof value === 'object' && value !== null && !Array.isArray(value);
40
- }
41
- /** True when a definition carries a `code` block, so a version of it needs a code bundle. */
42
- export function runsCode(definition) {
43
- return isRecord(definition['code']);
44
- }
45
- const SDK_PACKAGE = '@fluidgrids/workflows';
46
- /**
47
- * The project's runtime dependencies, vendored for the bundle: only when
48
- * `package.json` lists `dependencies` besides the SDK itself (which the bundle
49
- * embeds). Returns undefined when there is nothing to vendor.
50
- */
51
- export function vendorProjectDependencies(root) {
52
- const manifestPath = join(root, 'package.json');
53
- if (!existsSync(manifestPath))
54
- return undefined;
55
- let manifest;
56
- try {
57
- manifest = JSON.parse(readFileSync(manifestPath, 'utf8'));
58
- }
59
- catch {
60
- throw new CliUserError('package.json is not valid JSON.');
61
- }
62
- const dependencies = isRecord(manifest) ? manifest['dependencies'] : undefined;
63
- if (!isRecord(dependencies))
64
- return undefined;
65
- if (!Object.keys(dependencies).some((name) => name !== SDK_PACKAGE))
66
- return undefined;
67
- try {
68
- return vendorDependencies(root);
69
- }
70
- catch (error) {
71
- throw lowerFailure(error, 'the project dependencies');
72
- }
73
- }
74
- /**
75
- * The files a durable project's bundle and source archive are built from: the
76
- * workflow modules, the TypeScript files they import (transitively) and the
77
- * sidecars. A co-located `*.spec.ts` test, or an `activities/` module no
78
- * workflow imports, is neither bundled nor archived, so the service's rebuild
79
- * with the SDK's default entries sees exactly the modules the CLI bundled.
80
- */
81
- export function durableBundleFiles(files, entries) {
82
- const sources = new Map(files.filter((file) => file.path.endsWith('.ts')).map((file) => [file.path, file.content]));
83
- const reached = importClosure(sources, entries);
84
- return files.filter((file) => !file.path.endsWith('.ts') || reached.has(file.path));
85
- }
86
- function sameList(a, b) {
87
- return a.length === b.length && a.every((value, index) => value === b[index]);
88
- }
89
- function jsonWorkflows(project, paths) {
90
- return readProjectFiles(project.root, paths).map((file) => {
91
- const parsed = parseWorkflowDocument(file.content);
92
- if (!parsed) {
93
- throw new CliUserError(`${file.path} is not a workflow export or definition.`);
94
- }
95
- const stem = posix.basename(file.path, '.json');
96
- const declared = typeof parsed.definitionJson['key'] === 'string' ? parsed.definitionJson['key'] : null;
97
- const key = parsed.workflowKey ?? declared ?? stem;
98
- const definition = parsed.definitionJson;
99
- return { key, format: 'json', path: file.path, definition, durable: runsCode(definition) };
100
- });
101
- }
102
- /** The full name → reference map a Python lowering receives. */
103
- function connectionMap(names, resolve) {
104
- const out = {};
105
- for (const name of names) {
106
- const ref = resolve(name);
107
- if (ref) {
108
- Object.defineProperty(out, name, {
109
- value: ref,
110
- enumerable: true,
111
- writable: true,
112
- configurable: true,
113
- });
114
- }
115
- }
116
- return out;
117
- }
118
- /**
119
- * The source map of a durable bundle (C-SOURCEMAP): the same build as
120
- * `lower()`'s (the SDK's default entries over the archived files), with an
121
- * external map. The bundle bytes are the same with or without a map; a build
122
- * whose `buildId` differs anyway gives no map, so a map never describes
123
- * another bundle.
124
- */
125
- export async function bundleSourceMap(files, buildId, deps) {
126
- const built = await buildBundle(new Map(files.map((file) => [file.path, file.content])), {
127
- maxBundleBytes: MAX_BUNDLE_BYTES,
128
- sourcemap: 'external',
129
- ...(deps ? { deps } : {}),
130
- });
131
- return built.buildId === buildId ? built.map : undefined;
132
- }
133
- export async function lowerProject(project, options) {
134
- const paths = listSourcePaths(project.root);
135
- const language = project.config.language;
136
- const entries = paths.filter((path) => isWorkflowModule(path, language));
137
- const workflows = jsonWorkflows(project, paths.filter(isJsonWorkflow));
138
- const result = { workflows, warnings: [], issues: [] };
139
- if (entries.length > 0) {
140
- if (language === 'ts') {
141
- const files = readProjectFiles(project.root, paths.filter((path) => isLoweringInput(path, language)));
142
- const deps = vendorProjectDependencies(project.root);
143
- const run = (input, only) => lower(input, {
144
- ...(only ? { entries: only } : {}),
145
- connections: options.connections,
146
- maxBundleBytes: MAX_BUNDLE_BYTES,
147
- ...(deps ? { deps } : {}),
148
- });
149
- try {
150
- let lowered = await run(files, entries);
151
- let bundleFiles = files;
152
- const durable = lowered.workflows.some((workflow) => runsCode(workflow.definition));
153
- if (durable) {
154
- bundleFiles = durableBundleFiles(files, entries);
155
- // The service rebuilds a code bundle from the source archive with
156
- // the SDK's default entries (`buildWorkflowCode`), so an uploaded
157
- // bundle must come from those entries over the archived files, or
158
- // the service's build would get another buildId. Graph-only
159
- // projects keep their entries and files.
160
- const paths = bundleFiles.map((file) => file.path);
161
- if (bundleFiles.length !== files.length || !sameList(defaultEntries(paths), entries)) {
162
- lowered = await run(bundleFiles);
163
- }
164
- }
165
- result.buildId = lowered.buildId;
166
- result.sourceHash = lowered.sourceHash;
167
- result.bundle = lowered.bundle;
168
- if (durable) {
169
- const map = await bundleSourceMap(bundleFiles, lowered.buildId, deps);
170
- if (map !== undefined)
171
- result.map = map;
172
- else {
173
- result.warnings.push('The source map build did not reproduce the bundle; the push uploads no source map (stack traces show bundle locations).');
174
- }
175
- }
176
- result.sourceFiles = Object.fromEntries(bundleFiles.map((file) => [file.path, file.content]));
177
- if (deps)
178
- result.vendored = deps;
179
- result.issues.push(...lowered.issues);
180
- for (const workflow of lowered.workflows) {
181
- const definition = workflow.definition;
182
- workflows.push({
183
- key: workflow.key,
184
- format: 'ts',
185
- path: workflow.module,
186
- definition,
187
- durable: runsCode(definition),
188
- });
189
- }
190
- }
191
- catch (error) {
192
- if (error instanceof UnresolvedConnectionsError) {
193
- throw unresolvedError(error.names, options.explainUnresolved);
194
- }
195
- throw lowerFailure(error, 'the TypeScript workflows');
196
- }
197
- }
198
- else {
199
- try {
200
- const python = resolvePythonInterpreter(project.root, project.config.python);
201
- const connections = connectionMap(options.connectionNames, options.connections);
202
- const lowered = await lowerPython({ python, root: project.root, entries, connections });
203
- result.python = python;
204
- result.sourceHash = lowered.sourceHash;
205
- result.warnings.push(...lowered.warnings);
206
- result.issues.push(...lowered.issues);
207
- const buildIds = new Set();
208
- for (const workflow of lowered.workflows) {
209
- const durable = runsCode(workflow.definition);
210
- if (durable) {
211
- // Python durable functions (tier 2, Phase C): the version needs the Python bundle;
212
- // the service refuses it unless fluidgrids.python-durable-functions is on.
213
- const code = workflow.definition['code'];
214
- if (isRecord(code) && typeof code['buildId'] === 'string')
215
- buildIds.add(code['buildId']);
216
- }
217
- workflows.push({
218
- key: workflow.key,
219
- format: 'py',
220
- path: workflow.module,
221
- definition: workflow.definition,
222
- durable,
223
- });
224
- }
225
- if (buildIds.size > 1) {
226
- throw new CliUserError(`The Python workflows record ${buildIds.size} different build ids; one bundle serves a push.`, { hint: 'Upgrade the fluidgrids-workflows package so the lowering builds one bundle.' });
227
- }
228
- const [buildId] = [...buildIds];
229
- if (buildId !== undefined) {
230
- result.buildId = buildId;
231
- result.sourceFiles = pythonSourceFiles(project.root);
232
- result.buildPython = () => buildPython({ python, root: project.root, entries, connections });
233
- }
234
- }
235
- catch (error) {
236
- if (error instanceof PythonUnresolvedConnectionsError) {
237
- throw unresolvedError(error.names, options.explainUnresolved);
238
- }
239
- throw error;
240
- }
241
- }
242
- }
243
- const seen = new Map();
244
- for (const workflow of workflows) {
245
- const previous = seen.get(workflow.key);
246
- if (previous) {
247
- 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.' });
248
- }
249
- seen.set(workflow.key, workflow.path);
250
- }
251
- workflows.sort((a, b) => (a.key < b.key ? -1 : a.key > b.key ? 1 : 0));
252
- return result;
253
- }
254
- //# 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,OAA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AC,CAAC;QACxC,IAAI,QAAQ,EAAE,CAAC;YACb,MAAM,IAAI,YAAY,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"}