farseer-cli 1.18.0 → 1.20.0

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 (262) hide show
  1. package/README.md +33 -10
  2. package/dist/commands/app.js +42 -3
  3. package/dist/commands/app.js.map +1 -2
  4. package/dist/commands/apps.js.map +0 -1
  5. package/dist/commands/cells.js +120 -85
  6. package/dist/commands/cells.js.map +1 -2
  7. package/dist/commands/code.js.map +0 -1
  8. package/dist/commands/config.js.map +0 -1
  9. package/dist/commands/dashboards.js +246 -12
  10. package/dist/commands/dashboards.js.map +1 -2
  11. package/dist/commands/diff.js.map +0 -1
  12. package/dist/commands/dimensions.js +52 -27
  13. package/dist/commands/dimensions.js.map +1 -2
  14. package/dist/commands/docs.js +82 -0
  15. package/dist/commands/docs.js.map +6 -0
  16. package/dist/commands/files.js +49 -0
  17. package/dist/commands/files.js.map +2 -3
  18. package/dist/commands/folders.js +76 -0
  19. package/dist/commands/folders.js.map +6 -0
  20. package/dist/commands/formula.js +38 -30
  21. package/dist/commands/formula.js.map +1 -2
  22. package/dist/commands/install.js +32 -30
  23. package/dist/commands/install.js.map +2 -3
  24. package/dist/commands/list.js.map +0 -1
  25. package/dist/commands/login.js +3 -3
  26. package/dist/commands/login.js.map +1 -2
  27. package/dist/commands/logout.js.map +0 -1
  28. package/dist/commands/mcp-server.js.map +0 -1
  29. package/dist/commands/model.js +30 -5
  30. package/dist/commands/model.js.map +2 -3
  31. package/dist/commands/pipeline.js.map +0 -1
  32. package/dist/commands/pull.js +1 -1
  33. package/dist/commands/pull.js.map +1 -2
  34. package/dist/commands/push.js +6 -4
  35. package/dist/commands/push.js.map +1 -2
  36. package/dist/commands/refresh.js.map +0 -1
  37. package/dist/commands/run.js.map +0 -1
  38. package/dist/commands/sheets.js +289 -52
  39. package/dist/commands/sheets.js.map +1 -2
  40. package/dist/commands/skills.js +157 -0
  41. package/dist/commands/skills.js.map +6 -0
  42. package/dist/commands/status.js.map +0 -1
  43. package/dist/commands/tool.js.map +0 -1
  44. package/dist/commands/variables.js +246 -82
  45. package/dist/commands/variables.js.map +1 -2
  46. package/dist/commands/whoami.js.map +0 -1
  47. package/dist/index.js +117 -23
  48. package/dist/index.js.map +1 -2
  49. package/dist/mcp/index.js.map +0 -1
  50. package/dist/mcp/prompts/workflows.js.map +0 -1
  51. package/dist/mcp/resources/documentation.js +19 -12
  52. package/dist/mcp/resources/documentation.js.map +1 -2
  53. package/dist/mcp/server.js.map +0 -1
  54. package/dist/mcp/skills.js.map +0 -1
  55. package/dist/mcp/tools/appTools.js +1 -7
  56. package/dist/mcp/tools/appTools.js.map +1 -2
  57. package/dist/mcp/tools/authTools.js +1 -1
  58. package/dist/mcp/tools/authTools.js.map +1 -2
  59. package/dist/mcp/tools/cellTools.js +6 -19
  60. package/dist/mcp/tools/cellTools.js.map +1 -2
  61. package/dist/mcp/tools/dashboardTools.js +30 -412
  62. package/dist/mcp/tools/dashboardTools.js.map +2 -3
  63. package/dist/mcp/tools/dataTools.js +15 -146
  64. package/dist/mcp/tools/dataTools.js.map +1 -2
  65. package/dist/mcp/tools/folderTools.js +12 -78
  66. package/dist/mcp/tools/folderTools.js.map +1 -2
  67. package/dist/mcp/tools/modelTools.js +23 -372
  68. package/dist/mcp/tools/modelTools.js.map +1 -2
  69. package/dist/mcp/tools/pipelineContract.js +5 -1
  70. package/dist/mcp/tools/pipelineContract.js.map +1 -2
  71. package/dist/mcp/tools/pipelineTools.js.map +0 -1
  72. package/dist/mcp/tools/runTools.js +8 -69
  73. package/dist/mcp/tools/runTools.js.map +1 -2
  74. package/dist/mcp/tools/sheetTools.js +14 -264
  75. package/dist/mcp/tools/sheetTools.js.map +1 -2
  76. package/dist/mcp/tools/syncTools.js +7 -3
  77. package/dist/mcp/tools/syncTools.js.map +1 -2
  78. package/dist/mcp/utils/helpers.js.map +0 -1
  79. package/dist/mcp/utils/launchPin.js.map +0 -1
  80. package/dist/mcp/utils/operationResponse.js +41 -0
  81. package/dist/mcp/utils/operationResponse.js.map +6 -0
  82. package/dist/mcp/utils/registerTool.js.map +0 -1
  83. package/dist/mcp/utils/session.js.map +0 -1
  84. package/dist/mcp/utils/tenantPin.js.map +0 -1
  85. package/dist/operations/cells.js +444 -0
  86. package/dist/operations/cells.js.map +6 -0
  87. package/dist/operations/dashboards.js +357 -0
  88. package/dist/operations/dashboards.js.map +6 -0
  89. package/dist/operations/data.js +206 -0
  90. package/dist/operations/data.js.map +6 -0
  91. package/dist/operations/errors.js +64 -0
  92. package/dist/operations/errors.js.map +6 -0
  93. package/dist/operations/exportModel.js +59 -0
  94. package/dist/operations/exportModel.js.map +6 -0
  95. package/dist/operations/folderPath.js +128 -0
  96. package/dist/operations/folderPath.js.map +6 -0
  97. package/dist/operations/folders.js +80 -0
  98. package/dist/operations/folders.js.map +6 -0
  99. package/dist/operations/install.js +109 -0
  100. package/dist/operations/install.js.map +6 -0
  101. package/dist/operations/model.js +271 -0
  102. package/dist/operations/model.js.map +6 -0
  103. package/dist/operations/sheets.js +428 -0
  104. package/dist/operations/sheets.js.map +6 -0
  105. package/dist/pipeline/compatibility.js.map +0 -1
  106. package/dist/pipeline/connect.js.map +0 -1
  107. package/dist/pipeline/create.js.map +0 -1
  108. package/dist/pipeline/errors.js.map +0 -1
  109. package/dist/pipeline/failStep.js +43 -0
  110. package/dist/pipeline/failStep.js.map +6 -0
  111. package/dist/pipeline/generated-reference.json +25 -13
  112. package/dist/pipeline/guide.js.map +0 -1
  113. package/dist/pipeline/init.js.map +0 -1
  114. package/dist/pipeline/operations.js.map +0 -1
  115. package/dist/pipeline/query.js.map +0 -1
  116. package/dist/pipeline/queryDownloads.js.map +0 -1
  117. package/dist/pipeline/queryWorker.js +3 -1
  118. package/dist/pipeline/queryWorker.js.map +1 -2
  119. package/dist/pipeline/readiness.js.map +0 -1
  120. package/dist/pipeline/reference.js.map +0 -1
  121. package/dist/pipeline/requests.js +3 -32
  122. package/dist/pipeline/requests.js.map +1 -2
  123. package/dist/pipeline/runArguments.js.map +0 -1
  124. package/dist/pipeline/runtime.js.map +0 -1
  125. package/dist/pipeline/service.js +46 -2
  126. package/dist/pipeline/service.js.map +1 -2
  127. package/dist/services/appSyncService.js +59 -9
  128. package/dist/services/appSyncService.js.map +1 -2
  129. package/dist/services/apps.js +10 -0
  130. package/dist/services/apps.js.map +1 -2
  131. package/dist/services/authErrors.js.map +0 -1
  132. package/dist/services/codefirst/api.js +38 -5
  133. package/dist/services/codefirst/api.js.map +1 -2
  134. package/dist/services/codefirst/binaryDisk.js.map +0 -1
  135. package/dist/services/codefirst/byteHashes.js +5 -0
  136. package/dist/services/codefirst/byteHashes.js.map +1 -2
  137. package/dist/services/codefirst/documents.js +41 -15
  138. package/dist/services/codefirst/documents.js.map +1 -2
  139. package/dist/services/codefirst/layoutBinaryProjection.js +24 -13
  140. package/dist/services/codefirst/layoutBinaryProjection.js.map +1 -2
  141. package/dist/services/codefirst/layoutCompose.js +44 -38
  142. package/dist/services/codefirst/layoutCompose.js.map +1 -2
  143. package/dist/services/codefirst/layoutCore.js +14 -1
  144. package/dist/services/codefirst/layoutCore.js.map +1 -2
  145. package/dist/services/codefirst/layoutPaths.js +80 -4
  146. package/dist/services/codefirst/layoutPaths.js.map +1 -2
  147. package/dist/services/codefirst/layoutProjection.js +73 -39
  148. package/dist/services/codefirst/layoutProjection.js.map +1 -2
  149. package/dist/services/codefirst/layoutReadback.js +357 -130
  150. package/dist/services/codefirst/layoutReadback.js.map +2 -3
  151. package/dist/services/codefirst/layoutReadbackPlacement.js +94 -57
  152. package/dist/services/codefirst/layoutReadbackPlacement.js.map +2 -3
  153. package/dist/services/codefirst/layoutReceipt.js +283 -243
  154. package/dist/services/codefirst/layoutReceipt.js.map +2 -3
  155. package/dist/services/codefirst/layoutScan.js +208 -110
  156. package/dist/services/codefirst/layoutScan.js.map +1 -2
  157. package/dist/services/codefirst/output.js +76 -10
  158. package/dist/services/codefirst/output.js.map +1 -2
  159. package/dist/services/codefirst/types.js.map +0 -1
  160. package/dist/services/codefirst/workflow.js +65 -29
  161. package/dist/services/codefirst/workflow.js.map +2 -3
  162. package/dist/services/codefirst/workspace.js.map +0 -1
  163. package/dist/services/codefirst/workspaceLock.js.map +0 -1
  164. package/dist/services/codefirst/workspaceRoot.js +2 -1
  165. package/dist/services/codefirst/workspaceRoot.js.map +1 -2
  166. package/dist/services/configService.js.map +0 -1
  167. package/dist/services/credentials.js.map +0 -1
  168. package/dist/services/farseerService.js +31 -7
  169. package/dist/services/farseerService.js.map +1 -2
  170. package/dist/services/httpError.js.map +0 -1
  171. package/dist/services/modelExport.js.map +0 -1
  172. package/dist/services/organisation.js.map +0 -1
  173. package/dist/services/preflight.js.map +0 -1
  174. package/dist/services/realms.js.map +0 -1
  175. package/dist/services/syncService.js +3 -3
  176. package/dist/services/syncService.js.map +1 -2
  177. package/dist/skills/bundled.js +106 -0
  178. package/dist/skills/bundled.js.map +6 -0
  179. package/dist/skills/install.js +257 -0
  180. package/dist/skills/install.js.map +6 -0
  181. package/dist/skills/pipeline.js +10 -18
  182. package/dist/skills/pipeline.js.map +1 -2
  183. package/dist/utils/agentSandbox.js +1 -1
  184. package/dist/utils/agentSandbox.js.map +0 -1
  185. package/dist/utils/cliOptions.js.map +0 -1
  186. package/dist/utils/constants.js.map +0 -1
  187. package/dist/utils/entityResolver.js +72 -25
  188. package/dist/utils/entityResolver.js.map +1 -2
  189. package/dist/utils/errorFormatter.js +72 -11
  190. package/dist/utils/errorFormatter.js.map +1 -2
  191. package/dist/utils/fileLogger.js.map +0 -1
  192. package/dist/utils/fileValidation.js.map +0 -1
  193. package/dist/utils/folderMatch.js.map +0 -1
  194. package/dist/utils/formulaFilters.js +11 -2
  195. package/dist/utils/formulaFilters.js.map +1 -2
  196. package/dist/utils/helpers.js.map +0 -1
  197. package/dist/utils/logger.js.map +0 -1
  198. package/dist/utils/nameResolver.js.map +0 -1
  199. package/dist/utils/operationCli.js +102 -0
  200. package/dist/utils/operationCli.js.map +6 -0
  201. package/dist/utils/packageManager.js.map +0 -1
  202. package/dist/utils/syncReporting.js.map +0 -1
  203. package/dist/utils/syncScope.js.map +0 -1
  204. package/dist/utils/updateCheck.js.map +0 -1
  205. package/dist/utils/variableValues.js.map +0 -1
  206. package/dist/utils/workspace.js.map +0 -1
  207. package/docs/cli-guide.md +182 -2
  208. package/docs/import-workflows.md +14 -14
  209. package/docs/new-app-template.md +1 -1
  210. package/docs/pipeline-client-guide.md +1 -1
  211. package/docs/pipeline-reference.md +304 -9
  212. package/docs/troubleshooting.md +18 -0
  213. package/package.json +2 -2
  214. package/skills/farseer-analysis/SKILL.md +132 -0
  215. package/skills/farseer-app-dev/SKILL.md +131 -0
  216. package/skills/farseer-app-dev/assignments.md +185 -0
  217. package/skills/farseer-app-dev/farseer-client-api-guide.md +907 -0
  218. package/skills/farseer-app-dev/farseer-client-release-notes.md +212 -0
  219. package/skills/farseer-app-dev/working-patterns.md +876 -0
  220. package/skills/farseer-authenticate-to-tenant/SKILL.md +60 -0
  221. package/skills/farseer-authenticate-to-tenant/app-authentication.md +91 -0
  222. package/skills/farseer-author-import-job/SKILL.md +114 -0
  223. package/skills/farseer-author-import-job/cell-writes.md +530 -0
  224. package/skills/farseer-author-import-job/deploying-a-farseer-app.md +383 -0
  225. package/skills/farseer-author-import-job/import-job-pattern.md +232 -0
  226. package/skills/farseer-build-model/SKILL.md +122 -0
  227. package/skills/farseer-build-model/formula-grain-alignment.md +612 -0
  228. package/skills/farseer-build-model/naming-conventions.md +435 -0
  229. package/skills/farseer-build-model/sparse-formulas-pattern.md +330 -0
  230. package/skills/farseer-build-pipeline/SKILL.md +190 -0
  231. package/skills/farseer-build-pipeline/erp-sales/README.md +108 -0
  232. package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/bronze/erp_sales_invoice_lines.yaml +23 -0
  233. package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/bronze/erp_sales_invoice_lines_raw.yaml +23 -0
  234. package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/bronze/erp_sales_item_product_map.yaml +17 -0
  235. package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/bronze/erp_sales_item_product_map_raw.yaml +11 -0
  236. package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/gold/erp_sales_cells.yaml +40 -0
  237. package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/silver/erp_sales_lines.yaml +35 -0
  238. package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/silver/erp_sales_recon.yaml +43 -0
  239. package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/silver/erp_sales_unmapped_items.yaml +28 -0
  240. package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/main.py +49 -0
  241. package/skills/farseer-build-pipeline/erp-sales/erp-sales-load/Models/in/erp_sales_cells.yaml +17 -0
  242. package/skills/farseer-build-pipeline/erp-sales/erp-sales-load/Models/in/erp_sales_cells_raw.yaml +14 -0
  243. package/skills/farseer-build-pipeline/erp-sales/erp-sales-load/Models/load/erp_sales_to_model.yaml +47 -0
  244. package/skills/farseer-build-pipeline/erp-sales/erp-sales-load/main.py +44 -0
  245. package/skills/farseer-build-pipeline/erp-sales/item_to_product.csv +5 -0
  246. package/skills/farseer-build-pipeline/pipeline-app-failure-report-pattern.md +103 -0
  247. package/skills/farseer-build-pipeline/pipeline-source-encoding.md +68 -0
  248. package/skills/farseer-dashboards/SKILL.md +40 -0
  249. package/skills/farseer-formulas/SKILL.md +165 -0
  250. package/skills/farseer-help-center/SKILL.md +66 -0
  251. package/skills/farseer-model/SKILL.md +119 -0
  252. package/skills/farseer-modify-model/SKILL.md +158 -0
  253. package/skills/farseer-modify-model/model-validation-pattern.md +251 -0
  254. package/skills/farseer-optimize-model/SKILL.md +314 -0
  255. package/skills/farseer-optimize-model/stats-dump.ts +139 -0
  256. package/skills/farseer-pnl/SKILL.md +220 -0
  257. package/skills/farseer-review-model/SKILL.md +172 -0
  258. package/skills/farseer-run-apps/SKILL.md +102 -0
  259. package/skills/pipeline-authoring/SKILL.md +7 -5
  260. package/skills/pipeline-authoring/practices.md +21 -8
  261. package/dist/services/agentApprovalFetch.js +0 -86
  262. package/dist/services/agentApprovalFetch.js.map +0 -7
@@ -0,0 +1,428 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var sheets_exports = {};
30
+ __export(sheets_exports, {
31
+ createSheet: () => createSheet,
32
+ createSheetLine: () => createSheetLine,
33
+ createSheetRow: () => createSheetRow,
34
+ deleteSheetRow: () => deleteSheetRow,
35
+ describeSheetRowDelete: () => describeSheetRowDelete,
36
+ droppedBindings: () => droppedBindings,
37
+ getSheetData: () => getSheetData,
38
+ getSheetRows: () => getSheetRows,
39
+ listSheetsPage: () => listSheetsPage,
40
+ refuseIgnoredColumnChange: () => refuseIgnoredColumnChange,
41
+ resolveSheetOrThrow: () => resolveSheetOrThrow,
42
+ updateSheetColumns: () => updateSheetColumns,
43
+ updateSheetRow: () => updateSheetRow
44
+ });
45
+ module.exports = __toCommonJS(sheets_exports);
46
+ var farseer = __toESM(require("farseer-client"));
47
+ var import_entityResolver = require("../utils/entityResolver");
48
+ var import_errorFormatter = require("../utils/errorFormatter");
49
+ var import_errors = require("./errors");
50
+ var import_folderPath = require("./folderPath");
51
+ async function resolveSheetOrThrow(client, nameOrId) {
52
+ const selection = await (0, import_entityResolver.resolveSheet)(client, nameOrId);
53
+ if (selection.kind === "found") {
54
+ return selection.entity;
55
+ }
56
+ if (selection.kind === "ambiguous") {
57
+ const message = await (0, import_entityResolver.describeAmbiguity)(
58
+ client,
59
+ "sheets",
60
+ nameOrId,
61
+ selection.matches,
62
+ farseer.FolderItemType.Sheet
63
+ );
64
+ throw new import_errors.OperationError(message, "VALIDATION_ERROR");
65
+ }
66
+ throw new import_errors.OperationError(`Sheet "${nameOrId}" not found`, "NOT_FOUND");
67
+ }
68
+ async function listSheetsPage(client, params) {
69
+ const allSheets = await (0, import_entityResolver.listSheets)(client);
70
+ const limit = params.limit ?? 100;
71
+ const offset = params.offset ?? 0;
72
+ const page = allSheets.slice(offset, offset + limit);
73
+ const hasMore = offset + limit < allSheets.length;
74
+ return {
75
+ totalSheets: allSheets.length,
76
+ returned: page.length,
77
+ offset,
78
+ limit,
79
+ hasMore,
80
+ sheets: page,
81
+ ...hasMore ? {
82
+ hint: `Showing ${offset + 1}-${offset + page.length} of ${allSheets.length}. Use offset=${offset + limit} to get the next page.`
83
+ } : {}
84
+ };
85
+ }
86
+ async function getSheetData(client, params) {
87
+ const sheet = await resolveSheetOrThrow(client, params.sheetNameOrId);
88
+ const data = await client.sheets.getData({ path: String(sheet.id), includeData: true });
89
+ const rows = data.rows ?? [];
90
+ const kept = params.limit !== void 0 ? rows.slice(0, params.limit) : rows;
91
+ return {
92
+ sheet: { id: sheet.id, name: sheet.name },
93
+ totalRows: rows.length,
94
+ returnedRows: kept.length,
95
+ data: { ...data, rows: kept }
96
+ };
97
+ }
98
+ async function createSheet(client, params) {
99
+ if (params.folderId !== void 0 && params.folderPath?.length) {
100
+ throw new import_errors.OperationError("Pass a folder id or a folder path, not both", "VALIDATION_ERROR");
101
+ }
102
+ const folder = (0, import_folderPath.requireFolderTakes)(
103
+ params.folderId !== void 0 ? await (0, import_folderPath.folderById)(client, params.folderId) : await (0, import_folderPath.resolveFolderPath)(client, params.folderPath?.length ? params.folderPath : ["Sheets"]),
104
+ farseer.FolderItemType.Sheet
105
+ );
106
+ const result = await client.sheets.create({ name: params.name, folderId: folder.id });
107
+ return {
108
+ sheet: {
109
+ id: result.id,
110
+ name: params.name
111
+ },
112
+ message: `Sheet "${params.name}" created successfully`
113
+ };
114
+ }
115
+ async function getSheetRows(client, params) {
116
+ const sheet = await resolveSheetOrThrow(client, params.sheetNameOrId);
117
+ const rows = await client.sheetRows.getBySheetId(sheet.id);
118
+ const result = rows.map((r) => ({
119
+ id: r.id,
120
+ name: r.name,
121
+ key: r.key,
122
+ path: r.path,
123
+ parentId: r.parentId,
124
+ order: r.order,
125
+ depth: r.depth,
126
+ readonly: r.readonly,
127
+ hasChildren: r.hasChildren,
128
+ hierarchyFlatten: r.hierarchyFlatten,
129
+ hierarchyMaxDepth: r.hierarchyMaxDepth,
130
+ variable: r.variable ? { id: r.variable.id, name: r.variable.name } : null,
131
+ members: r.members?.map((m) => ({
132
+ id: m.id,
133
+ name: m.name,
134
+ parentId: m.parentId
135
+ })) || [],
136
+ table: r.table ? { id: r.table.id, name: r.table.name } : null
137
+ }));
138
+ return {
139
+ sheet: { id: sheet.id, name: sheet.name },
140
+ totalRows: result.length,
141
+ rows: result
142
+ };
143
+ }
144
+ function missing(sent, stored) {
145
+ const kept = new Set(stored);
146
+ return sent.filter((id) => !kept.has(id));
147
+ }
148
+ function droppedBindings(sent, stored) {
149
+ const dropped = {};
150
+ if (sent.accountTagId !== null && stored.variable?.id !== sent.accountTagId) {
151
+ dropped.accountTagId = sent.accountTagId;
152
+ }
153
+ const members = missing(
154
+ sent.dimensionTagIds,
155
+ (stored.members ?? []).map((m) => m.id)
156
+ );
157
+ if (members.length > 0) {
158
+ dropped.dimensionTagIds = members;
159
+ }
160
+ if (sent.tableTagId !== null && stored.table?.id !== sent.tableTagId) {
161
+ dropped.tableTagId = sent.tableTagId;
162
+ }
163
+ return Object.keys(dropped).length > 0 ? dropped : void 0;
164
+ }
165
+ async function reportDropped(what, readBack) {
166
+ let dropped;
167
+ try {
168
+ dropped = await readBack();
169
+ } catch (error) {
170
+ return {
171
+ warning: `${what} was saved, but reading it back to check its bindings failed: ${await (0, import_errorFormatter.formatClientError)(error)}`
172
+ };
173
+ }
174
+ if (!dropped) {
175
+ return {};
176
+ }
177
+ const named = Object.entries(dropped).map(([field, ids]) => `${field} ${[ids].flat().join(", ")}`);
178
+ return {
179
+ dropped,
180
+ warning: `Farseer does not know ${named.join("; ")} and saved ${what.toLowerCase()} without them. Check the ids and update it.`
181
+ };
182
+ }
183
+ async function createSheetRow(client, params) {
184
+ const sheet = await resolveSheetOrThrow(client, params.sheetNameOrId);
185
+ const createRequest = {
186
+ sheetId: sheet.id,
187
+ parentId: params.parentRowId ?? null,
188
+ name: params.name,
189
+ accountTagId: params.accountTagId ?? null,
190
+ dimensionTagIds: params.dimensionTagIds ?? [],
191
+ tableTagId: params.tableTagId ?? null,
192
+ readonly: params.readonly ?? false,
193
+ withData: params.withData ?? false,
194
+ hierarchyFlatten: params.hierarchyFlatten ?? false,
195
+ hierarchyMaxDepth: params.hierarchyMaxDepth ?? 0
196
+ };
197
+ const result = await client.sheetRows.create(createRequest);
198
+ return {
199
+ sheet: { id: sheet.id, name: sheet.name },
200
+ action: "created",
201
+ row: {
202
+ id: result.id,
203
+ name: params.name,
204
+ parentId: params.parentRowId ?? null
205
+ },
206
+ message: `Row "${params.name}" created in sheet "${sheet.name}"`,
207
+ ...await reportDropped(
208
+ `Row ${result.id}`,
209
+ async () => droppedBindings(createRequest, await client.sheetRows.get(result.id))
210
+ )
211
+ };
212
+ }
213
+ async function updateSheetRow(client, params) {
214
+ const sheet = await resolveSheetOrThrow(client, params.sheetNameOrId);
215
+ const rows = await client.sheetRows.getBySheetId(sheet.id);
216
+ const currentRow = rows.find((r) => r.id === params.rowId);
217
+ if (!currentRow) {
218
+ throw new import_errors.OperationError(`Row ID ${params.rowId} not found in sheet "${sheet.name}"`, "NOT_FOUND");
219
+ }
220
+ const current = currentRow;
221
+ const updateRequest = {
222
+ sheetId: sheet.id,
223
+ name: params.name !== void 0 ? params.name : current.name,
224
+ accountTagId: params.accountTagId !== void 0 ? params.accountTagId : current.variable?.id ?? null,
225
+ dimensionTagIds: params.dimensionTagIds !== void 0 ? params.dimensionTagIds : current.members?.map((m) => m.id) ?? [],
226
+ tableTagId: params.tableTagId !== void 0 ? params.tableTagId : current.table?.id ?? null,
227
+ readonly: params.readonly !== void 0 ? params.readonly : current.readonly,
228
+ withData: true,
229
+ hierarchyFlatten: params.hierarchyFlatten !== void 0 ? params.hierarchyFlatten : current.hierarchyFlatten,
230
+ hierarchyMaxDepth: params.hierarchyMaxDepth !== void 0 ? params.hierarchyMaxDepth : current.hierarchyMaxDepth
231
+ };
232
+ await client.sheetRows.update(params.rowId, updateRequest);
233
+ return {
234
+ sheet: { id: sheet.id, name: sheet.name },
235
+ action: "updated",
236
+ rowId: params.rowId,
237
+ message: `Row ${params.rowId} updated in sheet "${sheet.name}"`,
238
+ ...await reportDropped(
239
+ `Row ${params.rowId}`,
240
+ async () => droppedBindings(updateRequest, await client.sheetRows.get(params.rowId))
241
+ )
242
+ };
243
+ }
244
+ async function deleteSheetRow(client, params) {
245
+ await client.sheetRows._delete(params.rowId);
246
+ return {
247
+ action: "deleted",
248
+ rowId: params.rowId,
249
+ message: `Row ${params.rowId} deleted`
250
+ };
251
+ }
252
+ class SheetLinesApi extends farseer.BaseAPI {
253
+ async create(body) {
254
+ const headers = { "Content-Type": "application/json" };
255
+ const response = await this.request({ path: "/sheetLines", method: "POST", headers, query: {}, body });
256
+ return await response.json();
257
+ }
258
+ async get(id) {
259
+ const response = await this.request({ path: `/sheetLines/${id}`, method: "GET", headers: {}, query: {} });
260
+ return await response.json();
261
+ }
262
+ }
263
+ async function createSheetLine(client, params) {
264
+ const sheet = await resolveSheetOrThrow(client, params.sheetNameOrId);
265
+ const names = params.variable !== void 0 || !!params.tables?.length || !!params.members?.length;
266
+ const tags = names ? await client.initTagMap() : {
267
+ variableMapByName: /* @__PURE__ */ new Map(),
268
+ dimensionTableMapByName: /* @__PURE__ */ new Map(),
269
+ dimensionMemberMapsByTableId: /* @__PURE__ */ new Map(),
270
+ mapById: /* @__PURE__ */ new Map()
271
+ };
272
+ const request = {
273
+ sheetId: sheet.id,
274
+ parentId: params.parentId ?? null,
275
+ axis: params.axis,
276
+ type: "NUMBER",
277
+ name: params.name ?? null,
278
+ variableGid: params.variable !== void 0 ? resolveTag(tags, "variable", params.variable).id : null,
279
+ memberGids: (params.members ?? []).map((member) => resolveMember(tags, member).id),
280
+ dimensionGenerationOptions: {
281
+ tableGids: (params.tables ?? []).map((table) => resolveTag(tags, "table", table).id),
282
+ hierarchyFlatten: false,
283
+ hierarchyMaxDepth: 0
284
+ }
285
+ };
286
+ const lines = new SheetLinesApi(
287
+ client.sheets.configuration
288
+ );
289
+ const { id } = await lines.create(request);
290
+ return {
291
+ sheet: { id: sheet.id, name: sheet.name },
292
+ action: "created",
293
+ line: {
294
+ id,
295
+ axis: request.axis,
296
+ name: request.name,
297
+ parentId: request.parentId,
298
+ variableGid: request.variableGid,
299
+ memberGids: request.memberGids,
300
+ tableGids: request.dimensionGenerationOptions.tableGids
301
+ },
302
+ message: `${params.axis === "ROW" ? "Row" : "Column"} line ${id} created in sheet "${sheet.name}"`,
303
+ ...await reportDropped(`Line ${id}`, async () => droppedLineIds(request, await lines.get(id)))
304
+ };
305
+ }
306
+ function droppedLineIds(sent, stored) {
307
+ const dropped = {};
308
+ if (sent.variableGid !== null && stored.variableGid !== sent.variableGid) {
309
+ dropped.variableGid = sent.variableGid;
310
+ }
311
+ const members = missing(sent.memberGids, stored.memberGids ?? []);
312
+ if (members.length > 0) {
313
+ dropped.memberGids = members;
314
+ }
315
+ const tables = missing(
316
+ sent.dimensionGenerationOptions.tableGids,
317
+ stored.dimensionGenerationOptions?.tableGids ?? []
318
+ );
319
+ if (tables.length > 0) {
320
+ dropped.tableGids = tables;
321
+ }
322
+ return Object.keys(dropped).length > 0 ? dropped : void 0;
323
+ }
324
+ function resolveTag(tags, kind, nameOrId) {
325
+ const [byName, type, label] = kind === "variable" ? [tags.variableMapByName.get(nameOrId), farseer.TagType.Account, "Variable"] : [tags.dimensionTableMapByName.get(nameOrId), farseer.TagType.Table, "Table"];
326
+ const byId = /^\d+$/.test(nameOrId) ? tags.mapById.get(Number(nameOrId)) : void 0;
327
+ return pick(nameOrId, byName, byId?.type === type ? byId : void 0, `${label} "${nameOrId}" not found`);
328
+ }
329
+ function resolveMember(tags, member) {
330
+ const table = resolveTag(tags, "table", member.dimensionTable);
331
+ const value = member.dimensionValue;
332
+ const byName = tags.dimensionMemberMapsByTableId.get(table.id)?.get(value);
333
+ const byId = /^\d+$/.test(value) ? tags.mapById.get(Number(value)) : void 0;
334
+ const notFound = `Member "${value}" not found in table "${table.name}"`;
335
+ return pick(value, byName, byId?.ParentId === table.id ? byId : void 0, notFound);
336
+ }
337
+ function pick(nameOrId, byName, byId, notFound) {
338
+ if (byName && byId && byName.id !== byId.id) {
339
+ throw new import_errors.OperationError(
340
+ `"${nameOrId}" is ambiguous: it is the name of id ${byName.id} and the id of "${byId.name}". Pass ${byName.id} for the first, or "${byId.name}" for the second.`,
341
+ "VALIDATION_ERROR"
342
+ );
343
+ }
344
+ const tag = byName ?? byId;
345
+ if (!tag) {
346
+ throw new import_errors.OperationError(notFound, "NOT_FOUND");
347
+ }
348
+ return tag;
349
+ }
350
+ async function describeSheetRowDelete(client, rowId) {
351
+ const row = await client.sheetRows.get(rowId);
352
+ const [sheet, rows] = await Promise.all([
353
+ client.sheets.get(row.sheetId),
354
+ client.sheetRows.getBySheetId(row.sheetId)
355
+ ]);
356
+ const children = /* @__PURE__ */ new Map();
357
+ for (const r of rows) {
358
+ if (r.parentId !== null) {
359
+ children.set(r.parentId, [...children.get(r.parentId) ?? [], r.id]);
360
+ }
361
+ }
362
+ let descendants = 0;
363
+ for (const queue = [rowId]; queue.length > 0; ) {
364
+ const next = children.get(queue.pop()) ?? [];
365
+ descendants += next.length;
366
+ queue.push(...next);
367
+ }
368
+ return { sheet: { id: sheet.id, name: sheet.name }, row: { id: row.id, name: row.name }, descendants };
369
+ }
370
+ function refuseIgnoredColumnChange(sheetName, current, columns) {
371
+ if (current.refSheetId == null || !current.refConfig?.useColumns) return;
372
+ const sent = farseer.SheetConfigColumnsWithOptionalCustomFromJSON({ ...current.columns, ...columns });
373
+ const changed = (key) => columns[key] !== void 0 && canonical(sent[key]) !== canonical(current.columns[key]);
374
+ if (changed("standard") || changed("custom")) {
375
+ throw new import_errors.OperationError(
376
+ `Sheet "${sheetName}" uses the columns of sheet ${current.refSheetId}; change its standard and custom columns there`,
377
+ "VALIDATION_ERROR"
378
+ );
379
+ }
380
+ }
381
+ function canonical(value) {
382
+ return JSON.stringify(
383
+ value,
384
+ (_key, v) => v && typeof v === "object" && !Array.isArray(v) ? Object.fromEntries(
385
+ Object.keys(v).sort().map((k) => [k, v[k]])
386
+ ) : v
387
+ );
388
+ }
389
+ async function updateSheetColumns(client, params) {
390
+ const sheet = await resolveSheetOrThrow(client, params.sheetNameOrId);
391
+ const config = client.dashboards?.configuration || client._configuration;
392
+ const basePath = config?.basePath || "";
393
+ const rawHeaders = { ...config?.headers, "Content-Type": "application/json" };
394
+ const current = await client.sheets.get(sheet.id);
395
+ refuseIgnoredColumnChange(sheet.name, current, params.columns);
396
+ const updatePayload = { name: current.name, columns: params.columns };
397
+ const resp = await fetch(`${basePath}/sheets/${sheet.id}`, {
398
+ method: "PUT",
399
+ headers: rawHeaders,
400
+ body: JSON.stringify(updatePayload)
401
+ });
402
+ if (!resp.ok) {
403
+ throw resp;
404
+ }
405
+ return {
406
+ sheet: { id: sheet.id, name: sheet.name },
407
+ action: "updated",
408
+ columnKeys: Object.keys(params.columns),
409
+ message: `Sheet "${sheet.name}" columns updated`
410
+ };
411
+ }
412
+ // Annotate the CommonJS export names for ESM import in node:
413
+ 0 && (module.exports = {
414
+ createSheet,
415
+ createSheetLine,
416
+ createSheetRow,
417
+ deleteSheetRow,
418
+ describeSheetRowDelete,
419
+ droppedBindings,
420
+ getSheetData,
421
+ getSheetRows,
422
+ listSheetsPage,
423
+ refuseIgnoredColumnChange,
424
+ resolveSheetOrThrow,
425
+ updateSheetColumns,
426
+ updateSheetRow
427
+ });
428
+ //# sourceMappingURL=sheets.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/operations/sheets.ts"],
4
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,cAAyB;AACzB,4BAA8E;AAC9E,4BAAkC;AAClC,oBAA+B;AAC/B,wBAAkE;AAGlE,eAAsB,oBAAoB,QAA+B,UAAwC;AAC7G,QAAM,YAAY,UAAM,oCAAa,QAAQ,QAAQ;AACrD,MAAI,UAAU,SAAS,SAAS;AAC5B,WAAO,UAAU;AAAA,EACrB;AACA,MAAI,UAAU,SAAS,aAAa;AAChC,UAAM,UAAU,UAAM;AAAA,MAClB;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU;AAAA,MACV,QAAQ,eAAe;AAAA,IAC3B;AACA,UAAM,IAAI,6BAAe,SAAS,kBAAkB;AAAA,EACxD;AACA,QAAM,IAAI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,CAAC,CAAC,CAAC;AAAA,IAC7B,IACA;AAAA,EACV;AACJ;AAEA,eAAsB,mBAClB,QACA,QACF;AACE,QAAM,QAAQ,MAAM,oBAAoB,QAAQ,OAAO,aAAa;AAIpE,QAAM,SAAU,OAAe,YAAY,iBAAkB,OAAe;AAC5E,QAAM,WAAW,QAAQ,YAAY;AACrC,QAAM,aAAa,EAAE,GAAG,QAAQ,SAAS,gBAAgB,mBAAmB;AAE5E,QAAM,UAAU,MAAM,OAAO,OAAO,IAAI,MAAM,EAAE;AAChD,4BAA0B,MAAM,MAAM,SAAS,OAAO,OAAO;AAI7D,QAAM,gBAAgB,EAAE,MAAM,QAAQ,MAAM,SAAS,OAAO,QAAQ;AAEpE,QAAM,OAAO,MAAM,MAAM,GAAG,QAAQ,WAAW,MAAM,EAAE,IAAI;AAAA,IACvD,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,MAAM,KAAK,UAAU,aAAa;AAAA,EACtC,CAAC;AACD,MAAI,CAAC,KAAK,IAAI;AAEV,UAAM;AAAA,EACV;AAEA,SAAO;AAAA,IACH,OAAO,EAAE,IAAI,MAAM,IAAI,MAAM,MAAM,KAAK;AAAA,IACxC,QAAQ;AAAA,IACR,YAAY,OAAO,KAAK,OAAO,OAAO;AAAA,IACtC,SAAS,UAAU,MAAM,IAAI;AAAA,EACjC;AACJ;",
5
+ "names": []
6
+ }
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/pipeline/compatibility.ts"],
4
- "sourcesContent": ["import { z } from 'zod';\nimport type { PipelineClient } from './service';\nimport { CLI_UPDATE_INSTRUCTION } from './reference';\n\nconst compatibilitySchema = z.object({\n protocolVersion: z.literal(3),\n minimumCliVersion: z.string().regex(/^\\d+\\.\\d+\\.\\d+$/),\n});\n\nexport async function checkPipelineCompatibility(client: PipelineClient): Promise<void> {\n let response: unknown;\n try {\n // The backend compares our version header before returning this contract.\n response = await client.pipelineRequest('GET', '/pipelineAuthoring');\n } catch (error: any) {\n const status = error.response?.status ?? /^HTTP (\\d+):/.exec(error.message ?? '')?.[1];\n if (Number(status) === 404)\n throw new Error(\n 'Pipeline authoring compatibility is unavailable on this tenant. Ask the pipeline setup owner to enable the matching backend.',\n );\n if (Number(status) === 426)\n throw new Error(`This tenant requires an updated pipeline CLI. ${CLI_UPDATE_INSTRUCTION}`);\n throw error;\n }\n if (!compatibilitySchema.safeParse(response).success)\n throw new Error(\n `This backend's pipeline authoring protocol is unknown to this CLI. ${CLI_UPDATE_INSTRUCTION} If it persists, ask the pipeline setup owner to check the backend.`,\n );\n}\n"],
5
4
  "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAkB;AAElB,uBAAuC;AAEvC,MAAM,sBAAsB,aAAE,OAAO;AAAA,EACjC,iBAAiB,aAAE,QAAQ,CAAC;AAAA,EAC5B,mBAAmB,aAAE,OAAO,EAAE,MAAM,iBAAiB;AACzD,CAAC;AAED,eAAsB,2BAA2B,QAAuC;AACpF,MAAI;AACJ,MAAI;AAEA,eAAW,MAAM,OAAO,gBAAgB,OAAO,oBAAoB;AAAA,EACvE,SAAS,OAAY;AACjB,UAAM,SAAS,MAAM,UAAU,UAAU,eAAe,KAAK,MAAM,WAAW,EAAE,IAAI,CAAC;AACrF,QAAI,OAAO,MAAM,MAAM;AACnB,YAAM,IAAI;AAAA,QACN;AAAA,MACJ;AACJ,QAAI,OAAO,MAAM,MAAM;AACnB,YAAM,IAAI,MAAM,iDAAiD,uCAAsB,EAAE;AAC7F,UAAM;AAAA,EACV;AACA,MAAI,CAAC,oBAAoB,UAAU,QAAQ,EAAE;AACzC,UAAM,IAAI;AAAA,MACN,sEAAsE,uCAAsB;AAAA,IAChG;AACR;",
6
5
  "names": []
7
6
  }
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/pipeline/connect.ts"],
4
- "sourcesContent": ["import * as fs from 'fs';\nimport * as path from 'path';\nimport { openTenantSession, sessionFrom, type TenantSession } from '../services/preflight';\nimport { getTenantDir, getTenantFilesDir } from '../utils/helpers';\nimport { PipelineClient, PipelineProfile, PipelineService, readPipelineProfileFile } from './service';\nimport { checkPipelineCompatibility } from './compatibility';\nimport { boundedPipelineCall, boundedPipelineClient } from './requests';\nimport { PipelineError } from './errors';\n\nexport interface PipelinePaths {\n /** Holds .pipelines/<name>.json, the legacy .pipeline.json and the local run state. */\n profileDir: string;\n filesDir: string;\n stateRoot: string;\n}\n/** Which profile a command works on: an explicit file, a pipeline name, or neither. */\nexport interface ProfileSelection {\n profile?: string;\n pipeline?: string;\n}\n\nconst LEGACY_PROFILE = '.pipeline.json';\nconst PROFILES_DIR = '.pipelines';\n\nexport function pipelinePaths(tenant: string): PipelinePaths {\n const profileDir = getTenantDir(tenant);\n return { profileDir, filesDir: getTenantFilesDir(tenant), stateRoot: path.join(profileDir, '.pipeline-runs') };\n}\n\n/** A profile is named after its pipeline folder, the last segment of the workspace path. */\nexport function profileFile(profileDir: string, name: string): string {\n if (!name || name.includes('/') || name.includes('\\\\') || name === '.' || name === '..')\n throw new Error(`\"${name}\" is not a pipeline folder name`);\n return path.join(profileDir, PROFILES_DIR, `${name}.json`);\n}\n\nfunction namedProfiles(profileDir: string): string[] {\n const dir = path.join(profileDir, PROFILES_DIR);\n if (!fs.existsSync(dir)) return [];\n return fs\n .readdirSync(dir)\n .filter((f) => f.endsWith('.json'))\n .map((f) => f.slice(0, -'.json'.length))\n .sort();\n}\n\n/**\n * The one rule every command uses to find its profile. Exactly one named profile is\n * taken without being asked; the legacy single .pipeline.json still works on its own.\n */\nexport function resolveProfileFile(profileDir: string, selection: ProfileSelection): string {\n if (selection.profile && selection.pipeline)\n throw new PipelineError(\n 'refused',\n 'PIPELINE_SELECTION',\n 'Select the pipeline by name (pipeline=<name>) or give a profile file (profile=<path>), not both',\n 'Pass one selector only.',\n );\n if (selection.profile) return selection.profile;\n if (selection.pipeline) {\n const file = profileFile(profileDir, selection.pipeline);\n if (!fs.existsSync(file)) throw setupRequired(`No profile for pipeline \"${selection.pipeline}\" at ${file}`);\n return file;\n }\n const names = namedProfiles(profileDir);\n if (names.length === 1) return profileFile(profileDir, names[0]);\n if (names.length > 1)\n throw new PipelineError(\n 'refused',\n 'PIPELINE_SELECTION',\n `Several pipelines have profiles: ${names.join(', ')}. Select the pipeline by name (pipeline=<name>)`,\n 'Pass pipeline=<name> naming one of the listed pipelines.',\n );\n const legacy = path.join(profileDir, LEGACY_PROFILE);\n if (fs.existsSync(legacy)) return legacy;\n throw setupRequired(`No pipeline profile under ${profileDir}`);\n}\n\nfunction setupRequired(detail: string): PipelineError {\n return new PipelineError(\n 'refused',\n 'SETUP_REQUIRED',\n `${detail}; initialise the pipeline first (pipeline init)`,\n 'Run init with a prepared jobId or a new name, or ask the setup owner to prepare the job, source and output datasets. Do not substitute a local app or direct import.',\n );\n}\n\n/** Sign in (unless a validated session is supplied) and confirm protocol compatibility. */\nexport async function openPipelineConnection(\n organisation: string,\n tenant: string,\n validatedSession?: TenantSession,\n): Promise<PipelineClient> {\n let result = validatedSession;\n if (result && (result.organisation !== organisation || result.tenant !== tenant))\n throw new Error('Validated connection does not match the selected tenant');\n if (!result) {\n const outcome = await boundedPipelineCall(() => openTenantSession(organisation, tenant));\n if (!outcome.ok)\n throw new PipelineError(\n 'refused',\n 'TENANT_CONNECTION_REFUSED',\n `Cannot connect to ${organisation}/${tenant}: ${outcome.failure.reason}. Check the tenant and sign in.`,\n 'Check the tenant selection and sign in before retrying.',\n );\n result = sessionFrom(outcome.organisation, outcome.tenant, outcome.auth);\n }\n const client = result.client as PipelineClient;\n await checkPipelineCompatibility(boundedPipelineClient(client));\n return client;\n}\n\nexport function readPipelineProfile(file: string): PipelineProfile {\n return readPipelineProfileFile(file);\n}\n\nexport async function connectPipeline(\n organisation: string,\n tenant: string,\n selection: ProfileSelection,\n validatedSession?: TenantSession,\n) {\n const paths = pipelinePaths(tenant);\n const profile = readPipelineProfile(resolveProfileFile(paths.profileDir, selection));\n if (profile.organisation !== organisation || profile.tenant !== tenant)\n throw new Error(\n `Pipeline profile belongs to ${profile.organisation}/${profile.tenant}, not ${organisation}/${tenant}. If the pipeline was copied from another tenant, delete the copied .pipelines/ entry and run init name=<folder> here; only files/<name>/ moves between tenants.`,\n );\n const client = await openPipelineConnection(organisation, tenant, validatedSession);\n return new PipelineService(profile, client, paths.filesDir, paths.stateRoot, undefined);\n}\n"],
5
4
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAoB;AACpB,WAAsB;AACtB,uBAAmE;AACnE,qBAAgD;AAChD,qBAA0F;AAC1F,2BAA2C;AAC3C,sBAA2D;AAC3D,oBAA8B;AAc9B,MAAM,iBAAiB;AACvB,MAAM,eAAe;AAEd,SAAS,cAAc,QAA+B;AACzD,QAAM,iBAAa,6BAAa,MAAM;AACtC,SAAO,EAAE,YAAY,cAAU,kCAAkB,MAAM,GAAG,WAAW,KAAK,KAAK,YAAY,gBAAgB,EAAE;AACjH;AAGO,SAAS,YAAY,YAAoB,MAAsB;AAClE,MAAI,CAAC,QAAQ,KAAK,SAAS,GAAG,KAAK,KAAK,SAAS,IAAI,KAAK,SAAS,OAAO,SAAS;AAC/E,UAAM,IAAI,MAAM,IAAI,IAAI,iCAAiC;AAC7D,SAAO,KAAK,KAAK,YAAY,cAAc,GAAG,IAAI,OAAO;AAC7D;AAEA,SAAS,cAAc,YAA8B;AACjD,QAAM,MAAM,KAAK,KAAK,YAAY,YAAY;AAC9C,MAAI,CAAC,GAAG,WAAW,GAAG,EAAG,QAAO,CAAC;AACjC,SAAO,GACF,YAAY,GAAG,EACf,OAAO,CAAC,MAAM,EAAE,SAAS,OAAO,CAAC,EACjC,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,QAAQ,MAAM,CAAC,EACtC,KAAK;AACd;AAMO,SAAS,mBAAmB,YA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,QAAQ,QAAQ,IAAI;AAAA,EAC3E;AACA,QAAM,SAAS,OAAO;AACtB,YAAM,qDAA2B,uCAAsB,MAAM,CAAC;AAC9D,SAAO;AACX;AAEO,SAAS,oBAAoB,MAA+B;AAC/D,aAAO,wCAAwB,IAAI;AACvC;AAEA,eAAsB,gBAClB,cACA,QACA,WACA,kBACF;AACE,QAAM,QAAQ,cAAc,MAAM;AAClC,QAAM,UAAU,oBAAoB,mBAAmB,MAAM,YAAY,SAAS,CAAC;AACnF,MAAI,QAAQ,iBAAiB,gBAAgB,QAAQ,WAAW;AAC5D,UAAM,IAAI;AAAA,MACN,+BAA+B,QAAQ,YAAY,IAAI,QAAQ,MAAM,SAAS,YAAY,IAAI,MAAM;AAAA,IACxG;AACJ,QAAM,SAAS,MAAM,uBAAuB,cAAc,QAAQ,gBAAgB;AAClF,SAAO,IAAI,+BAAgB,SAAS,QAAQ,MAAM,UAAU,MAAM,WAAW,MAAS;AAC1F;",
6
5
  "names": []
7
6
  }
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/pipeline/create.ts"],
4
- "sourcesContent": ["import * as fs from 'fs';\nimport * as path from 'path';\nimport { resolveRunnerImage } from '../services/apps';\nimport { profileFile, type PipelinePaths } from './connect';\nimport { initPipelineProfile, type InitResult } from './init';\nimport { localSourceFiles, PipelineService, readPipelineProfileFile, type PipelineClient } from './service';\nimport { PIPELINE_RUNNER_IMAGE } from './runtime';\n\nconst ENTRYPOINT = 'main.py';\n// The skill's starter for complete replacement outputs, with no destination arguments.\nconst STARTER_MAIN = `from farseer_simple_pipelines.runner import run_pipeline\nfrom farseer_simple_pipelines.storage import StoreType\nfrom farseer_simple_pipelines.authoring import PipelinePolicy\nrun_pipeline(store_type=StoreType.DATASETS, pipeline_policy=PipelinePolicy(), experimental__emit_pipeline_visualization_markers=True)\n`;\nconst FOLDER_NAME = /^[A-Za-z0-9][A-Za-z0-9._ -]*$/;\n\nexport interface CreateOptions {\n organisation: string;\n tenant: string;\n name: string;\n}\nexport interface CreateResult {\n organisation: string;\n tenant: string;\n jobId: number;\n name: string;\n workspace: string;\n profile: string;\n /** 'scaffold' wrote the starter files; 'adopted' uploaded the local folder that was already there. */\n source: 'scaffold' | 'adopted';\n created: { folder: { id: number; path: string }; job: { id: number; name: string }; files: string[] };\n pendingDatasets: InitResult['pendingDatasets'];\n warnings: string[];\n}\n\n/**\n * Start a pipeline on this tenant: the remote source folder, a job configured to run it, and\n * the profile init derives from that job. With no local folder the starter `main.py` is written\n * first; with one already there (a pipeline copied from another tenant, say) its source files\n * are uploaded as they are. Every refusal happens before the first remote write.\n */\nexport async function createPipeline(\n options: CreateOptions,\n client: PipelineClient,\n paths: PipelinePaths,\n): Promise<CreateResult> {\n const { name } = options;\n if (!FOLDER_NAME.test(name)) throw new Error(`\"${name}\" is not a plain pipeline folder name`);\n const workspaceDir = path.join(paths.filesDir, name);\n const adopting = fs.existsSync(workspaceDir);\n const scope = { workspace: name, entrypoint: ENTRYPOINT, configFiles: [] };\n // Entrypoint first, then a stable order, so the upload log reads the same on every machine.\n const entry = `${name}/${ENTRYPOINT}`;\n const sources = adopting\n ? localSourceFiles(scope, paths.filesDir).sort((a, b) =>\n a === entry ? -1 : b === entry ? 1 : a.localeCompare(b),\n )\n : [];\n if (adopting && !sources.includes(entry))\n throw new Error(\n `Local folder ${workspaceDir} exists but has no ${ENTRYPOINT}; it is not a pipeline folder. Pick another name or add the entrypoint.`,\n );\n refuseForeignProfile(profileFile(paths.profileDir, name), options);\n if ((await client.listApps()).some((app) => app.name === name))\n throw new Error(\n `Job \"${name}\" already exists on ${options.tenant}; pick another name or attach to that job (init jobId=<id>)`,\n );\n if (await client.resolveSourceFolder(name))\n throw new Error(\n `Folder \"${name}\" already exists under Files on ${options.tenant}; attach to its prepared job (init jobId=<id>) or pick another name`,\n );\n const image = resolveRunnerImage(PIPELINE_RUNNER_IMAGE, await client.getRunnerImageRepositories());\n if ('error' in image) throw new Error(image.error);\n // The backend hides Apps from a user without the remote jobs feature, super user or not, and\n // createApp then fails after the source folder is uploaded, leaving a folder that blocks a retry.\n if (!(await client.getFolderByPath(['Apps'])))\n throw new Error(\n `This user cannot see the Apps folder on ${options.tenant}, so init cannot create the job. Ask the tenant admin for the remote jobs feature (FEATURE.REMOTE_JOBS), then rerun init.`,\n );\n\n // Uploaded in this order into the new source folder. Models/ and Code/ stay local until they\n // hold a file. There is no starter model: every run would publish it as a dataset that only a\n // super user can delete.\n const files: { name: string; folder: string[]; content: string }[] = adopting\n ? sources.map((file) => {\n const inner = file.slice(name.length + 1).split('/');\n return {\n name: inner[inner.length - 1],\n folder: inner.slice(0, -1),\n content: fs.readFileSync(path.join(paths.filesDir, file), 'utf8'),\n };\n })\n : [{ name: ENTRYPOINT, folder: [], content: STARTER_MAIN }];\n if (!adopting) writeScaffold(workspaceDir, files);\n const created: string[] = [];\n try {\n for (const file of files) {\n await client.createFile(file.content, file.name, ['Files', name, ...file.folder]);\n created.push([name, ...file.folder, file.name].join('/'));\n }\n const folder = await client.resolveSourceFolder(name);\n const script = folder?.scripts.find((s) => s.name === ENTRYPOINT);\n if (!folder || !script) throw new Error(`Uploaded ${ENTRYPOINT} was not found in the new folder \"${name}\"`);\n const job = await client.createApp(name);\n created.push(`job ${job.id}`);\n await client.updateApp(\n String(job.id),\n { sourceFolderId: folder.id, mainScriptFileId: script.id, runnerImage: image.image },\n job,\n );\n const init = await initPipelineProfile(\n { organisation: options.organisation, tenant: options.tenant, jobId: job.id, workspace: name },\n client,\n paths,\n );\n // Local and remote are identical right now; one pull records that as the sync baseline,\n // so the first edit is a plain local change rather than a conflict with init's own upload.\n await new PipelineService(init.profile, client, paths.filesDir, paths.stateRoot).syncSources('pull');\n return {\n organisation: options.organisation,\n tenant: options.tenant,\n jobId: job.id,\n name,\n workspace: name,\n profile: init.file,\n source: adopting ? 'adopted' : 'scaffold',\n created: {\n folder: { id: folder.id, path: name },\n job: { id: job.id, name },\n files: created.filter((c) => !c.startsWith('job ')),\n },\n pendingDatasets: init.pendingDatasets,\n warnings: init.warnings,\n };\n } catch (error) {\n // The backend creates Files/<name> while storing the first file, so the folder can\n // exist even when no upload succeeded. Ask, rather than infer it from `created`.\n const remoteFolder = await client.resolveSourceFolder(name).then(\n (folder) => (folder ? 'present' : 'absent'),\n () => 'unknown',\n );\n const leftover = [\n ...(remoteFolder === 'present' ? [`folder Files/${name}`] : []),\n ...(remoteFolder === 'unknown' ? [`possibly folder Files/${name} (could not check)`] : []),\n ...created,\n ];\n throw new Error(\n `${String(error)}. Created before the failure and left in place: ${leftover.length ? leftover.join(', ') : 'nothing remote'}; local scaffold ${workspaceDir}`,\n );\n }\n}\n\n/**\n * A profile under this tenant that names another tenant is a copied .pipelines/ folder, the\n * mishap this guards against: it would make every later command talk about the wrong job.\n */\nfunction refuseForeignProfile(file: string, options: CreateOptions) {\n if (!fs.existsSync(file)) return;\n const existing = readPipelineProfileFile(file);\n if (existing.organisation !== options.organisation || existing.tenant !== options.tenant)\n throw new Error(\n `Profile ${file} belongs to ${existing.organisation}/${existing.tenant}, not ${options.organisation}/${options.tenant}. It was copied along with the pipeline; delete it and rerun init. Only files/<name>/ moves between tenants.`,\n );\n throw new Error(`Profile ${file} already exists; this pipeline is initialised on ${options.tenant}`);\n}\n\nfunction writeScaffold(workspaceDir: string, files: { name: string; folder: string[]; content: string }[]) {\n fs.mkdirSync(path.join(workspaceDir, 'Models'), { recursive: true });\n fs.mkdirSync(path.join(workspaceDir, 'Code'), { recursive: true });\n for (const file of files) fs.writeFileSync(path.join(workspaceDir, ...file.folder, file.name), file.content);\n fs.writeFileSync(path.join(workspaceDir, 'Code', '.gitkeep'), '');\n}\n"],
5
4
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAoB;AACpB,WAAsB;AACtB,kBAAmC;AACnC,qBAAgD;AAChD,kBAAqD;AACrD,qBAAgG;AAChG,qBAAsC;AAEtC,MAAM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UAAM,IAAI;AAAA,MACN,WAAW,IAAI,eAAe,SAAS,YAAY,IAAI,SAAS,MAAM,SAAS,QAAQ,YAAY,IAAI,QAAQ,MAAM;AAAA,IACzH;AACJ,QAAM,IAAI,MAAM,WAAW,IAAI,oDAAoD,QAAQ,MAAM,EAAE;AACvG;AAEA,SAAS,cAAc,cAAsB,OAA8D;AACvG,KAAG,UAAU,KAAK,KAAK,cAAc,QAAQ,GAAG,EAAE,WAAW,KAAK,CAAC;AACnE,KAAG,UAAU,KAAK,KAAK,cAAc,MAAM,GAAG,EAAE,WAAW,KAAK,CAAC;AACjE,aAAW,QAAQ,MAAO,IAAG,cAAc,KAAK,KAAK,cAAc,GAAG,KAAK,QAAQ,KAAK,IAAI,GAAG,KAAK,OAAO;AAC3G,KAAG,cAAc,KAAK,KAAK,cAAc,QAAQ,UAAU,GAAG,EAAE;AACpE;",
6
5
  "names": []
7
6
  }
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/pipeline/errors.ts"],
4
- "sourcesContent": ["/** Known pipeline outcomes; callers must not infer write acceptance from a transport error. */\nexport class PipelineError extends Error {\n constructor(\n readonly outcome: 'refused' | 'failed' | 'unknown',\n readonly code: string,\n message: string,\n readonly nextAction: string,\n readonly runUuid?: string,\n ) {\n super(message);\n this.name = 'PipelineError';\n }\n}\n\nexport function httpStatus(error: unknown): number | undefined {\n const value = error as { response?: { status?: number }; message?: string } | undefined;\n const status = Number(value?.response?.status ?? /^HTTP (\\d+):/.exec(value?.message ?? '')?.[1]);\n return Number.isFinite(status) ? status : undefined;\n}\n"],
5
4
  "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACO,MAAM,sBAAsB,MAAM;AAAA,EACrC,YACa,SACA,MACT,SACS,YACA,SACX;AACE,UAAM,OAAO;AANJ;AACA;AAEA;AACA;AAGT,SAAK,OAAO;AAAA,EAChB;AACJ;AAEO,SAAS,WAAW,OAAoC;AAC3D,QAAM,QAAQ;AACd,QAAM,SAAS,OAAO,OAAO,UAAU,UAAU,eAAe,KAAK,OAAO,WAAW,EAAE,IAAI,CAAC,CAAC;AAC/F,SAAO,OAAO,SAAS,MAAM,IAAI,SAAS;AAC9C;",
6
5
  "names": []
7
6
  }
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var failStep_exports = {};
20
+ __export(failStep_exports, {
21
+ FAIL_STEP_FUNCTION: () => FAIL_STEP_FUNCTION,
22
+ FAIL_STEP_MACRO: () => FAIL_STEP_MACRO,
23
+ FAIL_STEP_MARK: () => FAIL_STEP_MARK,
24
+ failStepText: () => failStepText
25
+ });
26
+ module.exports = __toCommonJS(failStep_exports);
27
+ const FAIL_STEP_FUNCTION = "fail_step";
28
+ const FAIL_STEP_MARK = "fail_step";
29
+ const literal = (s) => `'${s.replace(/'/g, "''")}'`;
30
+ const FAIL_STEP_MACRO = `CREATE TEMP MACRO ${FAIL_STEP_FUNCTION}(message) AS error(${literal(FAIL_STEP_MARK)} || coalesce(CAST(message AS VARCHAR), ''))`;
31
+ function failStepText(message) {
32
+ const at = message.indexOf(FAIL_STEP_MARK);
33
+ if (at < 0) return message;
34
+ return `The query stopped at ${FAIL_STEP_FUNCTION}(): ${message.slice(at + FAIL_STEP_MARK.length)}`;
35
+ }
36
+ // Annotate the CommonJS export names for ESM import in node:
37
+ 0 && (module.exports = {
38
+ FAIL_STEP_FUNCTION,
39
+ FAIL_STEP_MACRO,
40
+ FAIL_STEP_MARK,
41
+ failStepText
42
+ });
43
+ //# sourceMappingURL=failStep.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/pipeline/failStep.ts"],
4
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKO,MAAM,qBAAqB;AAC3B,MAAM,iBAAiB;AAE9B,MAAM,UAAU,CAAC,MAAc,IAAI,EAAE,QAAQ,MAAM,IAAI,CAAC;AAGjD,MAAM,kBACT,qBAAqB,kBAAkB,sBAC9B,QAAQ,cAAc,CAAC;AAG7B,SAAS,aAAa,SAAyB;AAClD,QAAM,KAAK,QAAQ,QAAQ,cAAc;AACzC,MAAI,KAAK,EAAG,QAAO;AACnB,SAAO,wBAAwB,kBAAkB,OAAO,QAAQ,MAAM,KAAK,eAAe,MAAM,CAAC;AACrG;",
5
+ "names": []
6
+ }