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.
- package/README.md +33 -10
- package/dist/commands/app.js +42 -3
- package/dist/commands/app.js.map +1 -2
- package/dist/commands/apps.js.map +0 -1
- package/dist/commands/cells.js +120 -85
- package/dist/commands/cells.js.map +1 -2
- package/dist/commands/code.js.map +0 -1
- package/dist/commands/config.js.map +0 -1
- package/dist/commands/dashboards.js +246 -12
- package/dist/commands/dashboards.js.map +1 -2
- package/dist/commands/diff.js.map +0 -1
- package/dist/commands/dimensions.js +52 -27
- package/dist/commands/dimensions.js.map +1 -2
- package/dist/commands/docs.js +82 -0
- package/dist/commands/docs.js.map +6 -0
- package/dist/commands/files.js +49 -0
- package/dist/commands/files.js.map +2 -3
- package/dist/commands/folders.js +76 -0
- package/dist/commands/folders.js.map +6 -0
- package/dist/commands/formula.js +38 -30
- package/dist/commands/formula.js.map +1 -2
- package/dist/commands/install.js +32 -30
- package/dist/commands/install.js.map +2 -3
- package/dist/commands/list.js.map +0 -1
- package/dist/commands/login.js +3 -3
- package/dist/commands/login.js.map +1 -2
- package/dist/commands/logout.js.map +0 -1
- package/dist/commands/mcp-server.js.map +0 -1
- package/dist/commands/model.js +30 -5
- package/dist/commands/model.js.map +2 -3
- package/dist/commands/pipeline.js.map +0 -1
- package/dist/commands/pull.js +1 -1
- package/dist/commands/pull.js.map +1 -2
- package/dist/commands/push.js +6 -4
- package/dist/commands/push.js.map +1 -2
- package/dist/commands/refresh.js.map +0 -1
- package/dist/commands/run.js.map +0 -1
- package/dist/commands/sheets.js +289 -52
- package/dist/commands/sheets.js.map +1 -2
- package/dist/commands/skills.js +157 -0
- package/dist/commands/skills.js.map +6 -0
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/tool.js.map +0 -1
- package/dist/commands/variables.js +246 -82
- package/dist/commands/variables.js.map +1 -2
- package/dist/commands/whoami.js.map +0 -1
- package/dist/index.js +117 -23
- package/dist/index.js.map +1 -2
- package/dist/mcp/index.js.map +0 -1
- package/dist/mcp/prompts/workflows.js.map +0 -1
- package/dist/mcp/resources/documentation.js +19 -12
- package/dist/mcp/resources/documentation.js.map +1 -2
- package/dist/mcp/server.js.map +0 -1
- package/dist/mcp/skills.js.map +0 -1
- package/dist/mcp/tools/appTools.js +1 -7
- package/dist/mcp/tools/appTools.js.map +1 -2
- package/dist/mcp/tools/authTools.js +1 -1
- package/dist/mcp/tools/authTools.js.map +1 -2
- package/dist/mcp/tools/cellTools.js +6 -19
- package/dist/mcp/tools/cellTools.js.map +1 -2
- package/dist/mcp/tools/dashboardTools.js +30 -412
- package/dist/mcp/tools/dashboardTools.js.map +2 -3
- package/dist/mcp/tools/dataTools.js +15 -146
- package/dist/mcp/tools/dataTools.js.map +1 -2
- package/dist/mcp/tools/folderTools.js +12 -78
- package/dist/mcp/tools/folderTools.js.map +1 -2
- package/dist/mcp/tools/modelTools.js +23 -372
- package/dist/mcp/tools/modelTools.js.map +1 -2
- package/dist/mcp/tools/pipelineContract.js +5 -1
- package/dist/mcp/tools/pipelineContract.js.map +1 -2
- package/dist/mcp/tools/pipelineTools.js.map +0 -1
- package/dist/mcp/tools/runTools.js +8 -69
- package/dist/mcp/tools/runTools.js.map +1 -2
- package/dist/mcp/tools/sheetTools.js +14 -264
- package/dist/mcp/tools/sheetTools.js.map +1 -2
- package/dist/mcp/tools/syncTools.js +7 -3
- package/dist/mcp/tools/syncTools.js.map +1 -2
- package/dist/mcp/utils/helpers.js.map +0 -1
- package/dist/mcp/utils/launchPin.js.map +0 -1
- package/dist/mcp/utils/operationResponse.js +41 -0
- package/dist/mcp/utils/operationResponse.js.map +6 -0
- package/dist/mcp/utils/registerTool.js.map +0 -1
- package/dist/mcp/utils/session.js.map +0 -1
- package/dist/mcp/utils/tenantPin.js.map +0 -1
- package/dist/operations/cells.js +444 -0
- package/dist/operations/cells.js.map +6 -0
- package/dist/operations/dashboards.js +357 -0
- package/dist/operations/dashboards.js.map +6 -0
- package/dist/operations/data.js +206 -0
- package/dist/operations/data.js.map +6 -0
- package/dist/operations/errors.js +64 -0
- package/dist/operations/errors.js.map +6 -0
- package/dist/operations/exportModel.js +59 -0
- package/dist/operations/exportModel.js.map +6 -0
- package/dist/operations/folderPath.js +128 -0
- package/dist/operations/folderPath.js.map +6 -0
- package/dist/operations/folders.js +80 -0
- package/dist/operations/folders.js.map +6 -0
- package/dist/operations/install.js +109 -0
- package/dist/operations/install.js.map +6 -0
- package/dist/operations/model.js +271 -0
- package/dist/operations/model.js.map +6 -0
- package/dist/operations/sheets.js +428 -0
- package/dist/operations/sheets.js.map +6 -0
- package/dist/pipeline/compatibility.js.map +0 -1
- package/dist/pipeline/connect.js.map +0 -1
- package/dist/pipeline/create.js.map +0 -1
- package/dist/pipeline/errors.js.map +0 -1
- package/dist/pipeline/failStep.js +43 -0
- package/dist/pipeline/failStep.js.map +6 -0
- package/dist/pipeline/generated-reference.json +25 -13
- package/dist/pipeline/guide.js.map +0 -1
- package/dist/pipeline/init.js.map +0 -1
- package/dist/pipeline/operations.js.map +0 -1
- package/dist/pipeline/query.js.map +0 -1
- package/dist/pipeline/queryDownloads.js.map +0 -1
- package/dist/pipeline/queryWorker.js +3 -1
- package/dist/pipeline/queryWorker.js.map +1 -2
- package/dist/pipeline/readiness.js.map +0 -1
- package/dist/pipeline/reference.js.map +0 -1
- package/dist/pipeline/requests.js +3 -32
- package/dist/pipeline/requests.js.map +1 -2
- package/dist/pipeline/runArguments.js.map +0 -1
- package/dist/pipeline/runtime.js.map +0 -1
- package/dist/pipeline/service.js +46 -2
- package/dist/pipeline/service.js.map +1 -2
- package/dist/services/appSyncService.js +59 -9
- package/dist/services/appSyncService.js.map +1 -2
- package/dist/services/apps.js +10 -0
- package/dist/services/apps.js.map +1 -2
- package/dist/services/authErrors.js.map +0 -1
- package/dist/services/codefirst/api.js +38 -5
- package/dist/services/codefirst/api.js.map +1 -2
- package/dist/services/codefirst/binaryDisk.js.map +0 -1
- package/dist/services/codefirst/byteHashes.js +5 -0
- package/dist/services/codefirst/byteHashes.js.map +1 -2
- package/dist/services/codefirst/documents.js +41 -15
- package/dist/services/codefirst/documents.js.map +1 -2
- package/dist/services/codefirst/layoutBinaryProjection.js +24 -13
- package/dist/services/codefirst/layoutBinaryProjection.js.map +1 -2
- package/dist/services/codefirst/layoutCompose.js +44 -38
- package/dist/services/codefirst/layoutCompose.js.map +1 -2
- package/dist/services/codefirst/layoutCore.js +14 -1
- package/dist/services/codefirst/layoutCore.js.map +1 -2
- package/dist/services/codefirst/layoutPaths.js +80 -4
- package/dist/services/codefirst/layoutPaths.js.map +1 -2
- package/dist/services/codefirst/layoutProjection.js +73 -39
- package/dist/services/codefirst/layoutProjection.js.map +1 -2
- package/dist/services/codefirst/layoutReadback.js +357 -130
- package/dist/services/codefirst/layoutReadback.js.map +2 -3
- package/dist/services/codefirst/layoutReadbackPlacement.js +94 -57
- package/dist/services/codefirst/layoutReadbackPlacement.js.map +2 -3
- package/dist/services/codefirst/layoutReceipt.js +283 -243
- package/dist/services/codefirst/layoutReceipt.js.map +2 -3
- package/dist/services/codefirst/layoutScan.js +208 -110
- package/dist/services/codefirst/layoutScan.js.map +1 -2
- package/dist/services/codefirst/output.js +76 -10
- package/dist/services/codefirst/output.js.map +1 -2
- package/dist/services/codefirst/types.js.map +0 -1
- package/dist/services/codefirst/workflow.js +65 -29
- package/dist/services/codefirst/workflow.js.map +2 -3
- package/dist/services/codefirst/workspace.js.map +0 -1
- package/dist/services/codefirst/workspaceLock.js.map +0 -1
- package/dist/services/codefirst/workspaceRoot.js +2 -1
- package/dist/services/codefirst/workspaceRoot.js.map +1 -2
- package/dist/services/configService.js.map +0 -1
- package/dist/services/credentials.js.map +0 -1
- package/dist/services/farseerService.js +31 -7
- package/dist/services/farseerService.js.map +1 -2
- package/dist/services/httpError.js.map +0 -1
- package/dist/services/modelExport.js.map +0 -1
- package/dist/services/organisation.js.map +0 -1
- package/dist/services/preflight.js.map +0 -1
- package/dist/services/realms.js.map +0 -1
- package/dist/services/syncService.js +3 -3
- package/dist/services/syncService.js.map +1 -2
- package/dist/skills/bundled.js +106 -0
- package/dist/skills/bundled.js.map +6 -0
- package/dist/skills/install.js +257 -0
- package/dist/skills/install.js.map +6 -0
- package/dist/skills/pipeline.js +10 -18
- package/dist/skills/pipeline.js.map +1 -2
- package/dist/utils/agentSandbox.js +1 -1
- package/dist/utils/agentSandbox.js.map +0 -1
- package/dist/utils/cliOptions.js.map +0 -1
- package/dist/utils/constants.js.map +0 -1
- package/dist/utils/entityResolver.js +72 -25
- package/dist/utils/entityResolver.js.map +1 -2
- package/dist/utils/errorFormatter.js +72 -11
- package/dist/utils/errorFormatter.js.map +1 -2
- package/dist/utils/fileLogger.js.map +0 -1
- package/dist/utils/fileValidation.js.map +0 -1
- package/dist/utils/folderMatch.js.map +0 -1
- package/dist/utils/formulaFilters.js +11 -2
- package/dist/utils/formulaFilters.js.map +1 -2
- package/dist/utils/helpers.js.map +0 -1
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/nameResolver.js.map +0 -1
- package/dist/utils/operationCli.js +102 -0
- package/dist/utils/operationCli.js.map +6 -0
- package/dist/utils/packageManager.js.map +0 -1
- package/dist/utils/syncReporting.js.map +0 -1
- package/dist/utils/syncScope.js.map +0 -1
- package/dist/utils/updateCheck.js.map +0 -1
- package/dist/utils/variableValues.js.map +0 -1
- package/dist/utils/workspace.js.map +0 -1
- package/docs/cli-guide.md +182 -2
- package/docs/import-workflows.md +14 -14
- package/docs/new-app-template.md +1 -1
- package/docs/pipeline-client-guide.md +1 -1
- package/docs/pipeline-reference.md +304 -9
- package/docs/troubleshooting.md +18 -0
- package/package.json +2 -2
- package/skills/farseer-analysis/SKILL.md +132 -0
- package/skills/farseer-app-dev/SKILL.md +131 -0
- package/skills/farseer-app-dev/assignments.md +185 -0
- package/skills/farseer-app-dev/farseer-client-api-guide.md +907 -0
- package/skills/farseer-app-dev/farseer-client-release-notes.md +212 -0
- package/skills/farseer-app-dev/working-patterns.md +876 -0
- package/skills/farseer-authenticate-to-tenant/SKILL.md +60 -0
- package/skills/farseer-authenticate-to-tenant/app-authentication.md +91 -0
- package/skills/farseer-author-import-job/SKILL.md +114 -0
- package/skills/farseer-author-import-job/cell-writes.md +530 -0
- package/skills/farseer-author-import-job/deploying-a-farseer-app.md +383 -0
- package/skills/farseer-author-import-job/import-job-pattern.md +232 -0
- package/skills/farseer-build-model/SKILL.md +122 -0
- package/skills/farseer-build-model/formula-grain-alignment.md +612 -0
- package/skills/farseer-build-model/naming-conventions.md +435 -0
- package/skills/farseer-build-model/sparse-formulas-pattern.md +330 -0
- package/skills/farseer-build-pipeline/SKILL.md +190 -0
- package/skills/farseer-build-pipeline/erp-sales/README.md +108 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/bronze/erp_sales_invoice_lines.yaml +23 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/bronze/erp_sales_invoice_lines_raw.yaml +23 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/bronze/erp_sales_item_product_map.yaml +17 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/bronze/erp_sales_item_product_map_raw.yaml +11 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/gold/erp_sales_cells.yaml +40 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/silver/erp_sales_lines.yaml +35 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/silver/erp_sales_recon.yaml +43 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/silver/erp_sales_unmapped_items.yaml +28 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/main.py +49 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-load/Models/in/erp_sales_cells.yaml +17 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-load/Models/in/erp_sales_cells_raw.yaml +14 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-load/Models/load/erp_sales_to_model.yaml +47 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-load/main.py +44 -0
- package/skills/farseer-build-pipeline/erp-sales/item_to_product.csv +5 -0
- package/skills/farseer-build-pipeline/pipeline-app-failure-report-pattern.md +103 -0
- package/skills/farseer-build-pipeline/pipeline-source-encoding.md +68 -0
- package/skills/farseer-dashboards/SKILL.md +40 -0
- package/skills/farseer-formulas/SKILL.md +165 -0
- package/skills/farseer-help-center/SKILL.md +66 -0
- package/skills/farseer-model/SKILL.md +119 -0
- package/skills/farseer-modify-model/SKILL.md +158 -0
- package/skills/farseer-modify-model/model-validation-pattern.md +251 -0
- package/skills/farseer-optimize-model/SKILL.md +314 -0
- package/skills/farseer-optimize-model/stats-dump.ts +139 -0
- package/skills/farseer-pnl/SKILL.md +220 -0
- package/skills/farseer-review-model/SKILL.md +172 -0
- package/skills/farseer-run-apps/SKILL.md +102 -0
- package/skills/pipeline-authoring/SKILL.md +7 -5
- package/skills/pipeline-authoring/practices.md +21 -8
- package/dist/services/agentApprovalFetch.js +0 -86
- package/dist/services/agentApprovalFetch.js.map +0 -7
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/packageManager.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Package Manager Utilities\n *\n * Shared logic for managing tenant package.json files and farseer-client dependency.\n * Used by the CLI install and pull commands and the MCP farseer_install tool.\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { FARSEER_CLIENT_DEPENDENCY, FARSEER_CLIENT_VERSION } from './constants';\nimport { isNewerVersion } from './updateCheck';\n\n// Tarballs in this bucket are not an install source, so a dependency pointing\n// into it is always replaced, whoever wrote it.\nconst BUCKET_URL_PREFIX = 'https://storage.googleapis.com/farseer-remote-jobs-results/';\n\nconst CLI_MANAGED_NPM_VERSION = /^npm:@farseerdev\\/farseer-client@(\\d+\\.\\d+\\.\\d+)$/;\n\n// The CLI only overwrites a farseer-client dependency it wrote itself (a bucket\n// tarball or an exact npm version) and only moves it forward, so a user who\n// pinned a newer version, a fork, a local path or a version range keeps it.\nfunction isOutdatedCliManagedClient(dependency: unknown): boolean {\n if (typeof dependency !== 'string') return false;\n if (dependency.startsWith(`${BUCKET_URL_PREFIX}farseer-client/`)) return true;\n const pinned = CLI_MANAGED_NPM_VERSION.exec(dependency)?.[1];\n return pinned !== undefined && isNewerVersion(FARSEER_CLIENT_VERSION, pinned);\n}\n\n/**\n * Move an outdated CLI-managed farseer-client dependency to FARSEER_CLIENT_DEPENDENCY\n * and drop farseer-client-axios when it comes from the bucket. Returns the changes.\n */\nfunction updateClientDependencies(dependencies: Record<string, unknown>): string[] {\n const changes: string[] = [];\n\n const client = dependencies['farseer-client'];\n if (isOutdatedCliManagedClient(client)) {\n dependencies['farseer-client'] = FARSEER_CLIENT_DEPENDENCY;\n changes.push('farseer-client (upgraded)');\n }\n\n const axiosClient = dependencies['farseer-client-axios'];\n if (typeof axiosClient === 'string' && axiosClient.startsWith(BUCKET_URL_PREFIX)) {\n delete dependencies['farseer-client-axios'];\n changes.push('farseer-client-axios (removed)');\n }\n\n return changes;\n}\n\n/**\n * Ensure the tenant directory has a package.json with the current farseer-client\n * dependency. Creates package.json if missing; adds farseer-client if missing;\n * upgrades a CLI-managed farseer-client and removes the bucket's\n * farseer-client-axios. Returns the list of dependency changes performed.\n */\nexport function ensurePackageJson(tenantDir: string, tenant: string): string[] {\n const packageJsonPath = path.join(tenantDir, 'package.json');\n const changes: string[] = [];\n\n let pkg: any;\n if (fs.existsSync(packageJsonPath)) {\n pkg = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));\n } else {\n pkg = {\n name: `farseer-apps-${tenant}`,\n version: '1.0.0',\n private: true,\n description: `Farseer scripts for tenant ${tenant}`,\n dependencies: {},\n };\n changes.push('package.json (created)');\n }\n\n pkg.dependencies = pkg.dependencies || {};\n\n if (!pkg.dependencies['farseer-client']) {\n pkg.dependencies['farseer-client'] = FARSEER_CLIENT_DEPENDENCY;\n changes.push('farseer-client');\n }\n changes.push(...updateClientDependencies(pkg.dependencies));\n\n fs.writeFileSync(packageJsonPath, JSON.stringify(pkg, null, 2) + '\\n');\n return changes;\n}\n\n/**\n * Upgrade the farseer-client dependency of an existing tenant package.json and\n * remove the bucket's farseer-client-axios, without adding anything. The file\n * is only rewritten when something changed. Returns the changes.\n */\nexport function updatePackageJson(tenantDir: string): string[] {\n const packageJsonPath = path.join(tenantDir, 'package.json');\n if (!fs.existsSync(packageJsonPath)) return [];\n\n const pkg = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));\n const changes = pkg.dependencies ? updateClientDependencies(pkg.dependencies) : [];\n if (changes.length > 0) {\n fs.writeFileSync(packageJsonPath, JSON.stringify(pkg, null, 2) + '\\n');\n }\n return changes;\n}\n\n/**\n * Parse an npm package specifier into name and version.\n * Handles scoped packages: @scope/name@version \u2192 { name: \"@scope/name\", version: \"version\" }\n */\nexport function parsePackageSpec(spec: string): { name: string; version: string } {\n const isScoped = spec.startsWith('@');\n const lastAt = spec.lastIndexOf('@');\n const hasVersion = lastAt > 0 && (!isScoped || lastAt > spec.indexOf('/'));\n\n return {\n name: hasVersion ? spec.substring(0, lastAt) : spec,\n version: hasVersion ? spec.substring(lastAt + 1) : '*',\n };\n}\n"],
|
|
5
4
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,SAAoB;AACpB,WAAsB;AACtB,uBAAkE;AAClE,yBAA+B;AAI/B,MAAM,oBAAoB;AAE1B,MAAM,0BAA0B;AAKhC,SAAS,2BAA2B,YAA8B;AAC9D,MAAI,OAAO,eAAe,SAAU,QAAO;AAC3C,MAAI,WAAW,WAAW,GAAG,iBAAiB,iBAAiB,EAAG,QAAO;AACzE,QAAM,SAAS,wBAAwB,KAAK,UAAU,IAAI,CAAC;AAC3D,SAAO,WAAW,cAAa,mCAAe,yCAAwB,MAAM;AAChF;AAMA,SAAS,yBAAyB,cAAiD;AAC/E,QAAM,UAAoB,CAAC;AAE3B,QAAM,SAAS,aAAa,gBAAgB;AAC5C,MAAI,2BAA2B,MAAM,GAAG;AACpC,iBAAa,gBAAgB,IAAI;AACjC,YAAQ,KAAK,2BAA2B;AAAA,EAC5C;AAEA,QAAM,cAAc,aAAa,sBAAsB;AACvD,MAAI,OAAO,gBAAgB,YAAY,YAAY,WAAW,iBAAiB,GAAG;AAC9E,WAAO,aAAa,sBAAsB;AAC1C,YAAQ,KAAK,gCAAgC;AAAA,EACjD;AAEA,SAAO;AACX;AAQO,SAAS,kBAAkB,WAAmB,QAA0B;AAC3E,QAAM,kBAAkB,KAAK,KAAK,WAAW,cAAc;AAC3D,QAAM,UAAoB,CAAC;AAE3B,MAAI;AACJ,MAAI,GAAG,WAAW,eAAe,GAAG;AAChC,UAAM,KAAK,MAAM,GAAG,aAAa,iBAAiB,OAAO,CAAC;AAAA,EAC9D,OAAO;AACH,UAAM;AAAA,MACF,MAAM,gBAAgB,MAAM;AAAA,MAC5B,SAAS;AAAA,MACT,SAAS;AAAA,MACT,aAAa,8BAA8B,MAAM;AAAA,MACjD,cAAc,CAAC;AAAA,IACnB;AACA,YAAQ,KAAK,wBAAwB;AAAA,EACzC;AAEA,MAAI,eAAe,IAAI,gBAAgB,CAAC;AAExC,MAAI,CAAC,IAAI,aAAa,gBAAgB,GAAG;AACrC,QAAI,aAAa,gBAAgB,IAAI;AACrC,YAAQ,KAAK,gBAAgB;AAAA,EACjC;AACA,UAAQ,KAAK,GAAG,yBAAyB,IAAI,YAAY,CAAC;AAE1D,KAAG,cAAc,iBAAiB,KAAK,UAAU,KAAK,MAAM,CAAC,IAAI,IAAI;AACrE,SAAO;AACX;AAOO,SAAS,kBAAkB,WAA6B;AAC3D,QAAM,kBAAkB,KAAK,KAAK,WAAW,cAAc;AAC3D,MAAI,CAAC,GAAG,WAAW,eAAe,EAAG,QAAO,CAAC;AAE7C,QAAM,MAAM,KAAK,MAAM,GAAG,aAAa,iBAAiB,OAAO,CAAC;AAChE,QAAM,UAAU,IAAI,eAAe,yBAAyB,IAAI,YAAY,IAAI,CAAC;AACjF,MAAI,QAAQ,SAAS,GAAG;AACpB,OAAG,cAAc,iBAAiB,KAAK,UAAU,KAAK,MAAM,CAAC,IAAI,IAAI;AAAA,EACzE;AACA,SAAO;AACX;AAMO,SAAS,iBAAiB,MAAiD;AAC9E,QAAM,WAAW,KAAK,WAAW,GAAG;AACpC,QAAM,SAAS,KAAK,YAAY,GAAG;AACnC,QAAM,aAAa,SAAS,MAAM,CAAC,YAAY,SAAS,KAAK,QAAQ,GAAG;AAExE,SAAO;AAAA,IACH,MAAM,aAAa,KAAK,UAAU,GAAG,MAAM,IAAI;AAAA,IAC/C,SAAS,aAAa,KAAK,UAAU,SAAS,CAAC,IAAI;AAAA,EACvD;AACJ;",
|
|
6
5
|
"names": []
|
|
7
6
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/syncReporting.ts"],
|
|
4
|
-
"sourcesContent": ["import { logger } from './logger';\nimport type { IgnoredLocalEntry } from '../services/syncService';\n\n/**\n * Upper bound on entries we collect into `ignoredLocal`. A user that\n * clones a sibling repo into `farseer-apps/<tenant>/files/` (or worse,\n * `node_modules/`) would otherwise produce a multi-thousand-entry\n * array and a console wall. The warning only shows a 5-item preview\n * per category regardless of length, so capping the collection itself\n * loses no useful signal.\n */\nexport const IGNORED_LOCAL_CAP = 100;\n\n/**\n * Number of example file paths to surface per category in the warning text.\n * Independent of the in-memory cap above \u2014 the cap protects memory, the\n * preview count protects the user's eyes.\n */\nconst PREVIEW_COUNT = 5;\n\n/**\n * Surface files that live under the synced workspace but were dropped\n * from comparison because they don't match the current sync scope.\n *\n * Files are grouped by `reason` so the hint can be category-specific:\n * - `unsupportedExtension`: nudge the user toward `--include-ext`.\n * - `blocklistedFolder`: flag that opting in is unusual (the folder\n * is one users rarely want synced \u2014 node_modules/, dist/, \u2026).\n *\n * Hidden files (`.env`, `.git/`, `.vscode/`) are excluded upstream in\n * `getStatus`. The warning never tells the user to widen scope to\n * include those \u2014 that would be a credential-leak hint.\n *\n * `total` overrides the count reported in the warning header when the\n * caller truncated the list (the cap kicks in for misuse cases like\n * dropping `node_modules/` under the synced folder). Omit it when the\n * list is the full set.\n */\nexport function reportIgnoredLocal(ignoredLocal: IgnoredLocalEntry[], total?: number): void {\n if (ignoredLocal.length === 0 && (!total || total === 0)) return;\n const reportedTotal = total ?? ignoredLocal.length;\n logger.warning(`${reportedTotal} local file(s) outside the sync scope \u2014 NOT being compared or pushed.`);\n\n const byReason = {\n unsupportedExtension: [] as string[],\n blocklistedFolder: [] as string[],\n };\n for (const entry of ignoredLocal) {\n byReason[entry.reason].push(entry.path);\n }\n\n // Unsupported extension \u2014 straightforward \"broaden scope\" hint.\n // Listed first because most ignored files fall here under default\n // scope, and the hint is the safe one (no destructive opt-in).\n if (byReason.unsupportedExtension.length > 0) {\n const list = byReason.unsupportedExtension;\n const preview = list.slice(0, PREVIEW_COUNT).join(', ');\n const more = list.length > PREVIEW_COUNT ? `, +${list.length - PREVIEW_COUNT} more` : '';\n logger.dim(` Unsupported extension (${list.length}):`);\n logger.dim(` ${preview}${more}`);\n logger.dim(\n ' -> Include with --include-ext <ext> (e.g. --include-ext .csv), or `farseer config include --ext <ext>` to persist.',\n );\n }\n\n // Blocklisted folder \u2014 explicit warning that opting in is unusual.\n // The hint NEVER recommends a flag without first telling the user\n // these are typically tooling artifacts, not user content.\n if (byReason.blocklistedFolder.length > 0) {\n const list = byReason.blocklistedFolder;\n const preview = list.slice(0, PREVIEW_COUNT).join(', ');\n const more = list.length > PREVIEW_COUNT ? `, +${list.length - PREVIEW_COUNT} more` : '';\n logger.dim(` Inside blocklisted folder (${list.length}):`);\n logger.dim(` ${preview}${more}`);\n logger.dim(' -> Usually tooling output, not user content.');\n logger.dim(\n ' If you genuinely want one: --include-folder <path> (per-command) or `farseer config include --folder <path>` to persist.',\n );\n }\n\n // Hidden files are excluded from the warning entirely \u2014 see getStatus.\n // The hint deliberately omits any reference to hidden directories.\n}\n"],
|
|
5
4
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAuB;AAWhB,MAAM,oBAAoB;AAOjC,MAAM,gBAAgB;AAoBf,SAAS,mBAAmB,cAAmC,OAAsB;AACxF,MAAI,aAAa,WAAW,MAAM,CAAC,SAAS,UAAU,GAAI;AAC1D,QAAM,gBAAgB,SAAS,aAAa;AAC5C,uBAAO,QAAQ,GAAG,aAAa,4EAAuE;AAEtG,QAAM,WAAW;AAAA,IACb,sBAAsB,CAAC;AAAA,IACvB,mBAAmB,CAAC;AAAA,EACxB;AACA,aAAW,SAAS,cAAc;AAC9B,aAAS,MAAM,MAAM,EAAE,KAAK,MAAM,IAAI;AAAA,EAC1C;AAKA,MAAI,SAAS,qBAAqB,SAAS,GAAG;AAC1C,UAAM,OAAO,SAAS;AACtB,UAAM,UAAU,KAAK,MAAM,GAAG,aAAa,EAAE,KAAK,IAAI;AACtD,UAAM,OAAO,KAAK,SAAS,gBAAgB,MAAM,KAAK,SAAS,aAAa,UAAU;AACtF,yBAAO,IAAI,4BAA4B,KAAK,MAAM,IAAI;AACtD,yBAAO,IAAI,OAAO,OAAO,GAAG,IAAI,EAAE;AAClC,yBAAO;AAAA,MACH;AAAA,IACJ;AAAA,EACJ;AAKA,MAAI,SAAS,kBAAkB,SAAS,GAAG;AACvC,UAAM,OAAO,SAAS;AACtB,UAAM,UAAU,KAAK,MAAM,GAAG,aAAa,EAAE,KAAK,IAAI;AACtD,UAAM,OAAO,KAAK,SAAS,gBAAgB,MAAM,KAAK,SAAS,aAAa,UAAU;AACtF,yBAAO,IAAI,gCAAgC,KAAK,MAAM,IAAI;AAC1D,yBAAO,IAAI,OAAO,OAAO,GAAG,IAAI,EAAE;AAClC,yBAAO,IAAI,kDAAkD;AAC7D,yBAAO;AAAA,MACH;AAAA,IACJ;AAAA,EACJ;AAIJ;",
|
|
6
5
|
"names": []
|
|
7
6
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/syncScope.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Which files the CLI treats as a developer's own source, in two scopes.\n */\n\n// Narrow set of \"script\" extensions \u2014 used by `farseer files list` and\n// `farseer list` to default to source-code style files when listing a\n// folder. NOT the default sync scope; see DEFAULT_SYNC_EXTENSIONS below.\nexport const DEFAULT_SCRIPT_EXTENSIONS = ['.ts', '.js'];\n\n// Default sync scope \u2014 the curated set of files a developer AUTHORS in an\n// editor. NARROWER than the backend's accepted extension list\n// (`cli/src/utils/fileValidation.ts:BACKEND_EXTENSION_WHITELIST`, which\n// mirrors `farseer/backend/app/openapi/v3/services/farseerFileService.ts`).\n// The earlier \"default sync = everything backend accepts\" expanded the\n// default scope to 25 entries including binary / data formats (.csv,\n// .parquet, .xlsx, .pdf, images) \u2014 large files no one edits in a code\n// editor that dominated first-pull time and made `status` noisy.\n//\n// Users opt into the rest of the backend whitelist (data / docs /\n// archives) via `--include-ext <ext>` or persistent\n// `farseer config include`. Anything still outside the backend whitelist\n// requires `--all` or `--include-folder`.\n//\n// Subset contract: every entry here must also be in\n// `BACKEND_EXTENSION_WHITELIST`, otherwise push pre-flight will reject\n// in-scope files (extension not allowed) \u2014 defeats the purpose of the\n// default scope. Asserted by `defaultSyncExtensionsParity.test.ts`.\nexport const DEFAULT_SYNC_EXTENSIONS = [\n // Code (frontend / scripts)\n '.ts',\n '.js',\n // Code (Python)\n '.py',\n // Config / data\n '.yml',\n '.yaml',\n '.json',\n // Docs\n '.md',\n];\n"],
|
|
5
4
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOO,MAAM,4BAA4B,CAAC,OAAO,KAAK;AAoB/C,MAAM,0BAA0B;AAAA;AAAA,EAEnC;AAAA,EACA;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AACJ;",
|
|
6
5
|
"names": []
|
|
7
6
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/updateCheck.ts"],
|
|
4
|
-
"sourcesContent": ["import * as https from 'https';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport * as os from 'os';\nimport chalk from 'chalk';\nimport { CLI_VERSION } from './constants';\n\nconst CONFIG_DIR = path.join(os.homedir(), '.farseer');\nconst CACHE_FILE = path.join(CONFIG_DIR, 'update-check.json');\nconst CACHE_TTL_MS = 4 * 60 * 60 * 1000; // 4 hours\nconst FETCH_TIMEOUT_MS = 3000;\nconst REGISTRY_URL = 'https://registry.npmjs.org/farseer-cli/latest';\n\ninterface UpdateCache {\n lastCheck: number;\n latestVersion: string;\n}\n\nexport function isNewerVersion(latest: string, current: string): boolean {\n const latestParts = latest.split('.').map(Number);\n const currentParts = current.split('.').map(Number);\n for (let i = 0; i < 3; i++) {\n const l = latestParts[i] || 0;\n const c = currentParts[i] || 0;\n if (l > c) return true;\n if (l < c) return false;\n }\n return false;\n}\n\nfunction readCache(): UpdateCache | null {\n try {\n const data = JSON.parse(fs.readFileSync(CACHE_FILE, 'utf-8'));\n if (typeof data.lastCheck === 'number' && typeof data.latestVersion === 'string') {\n return data as UpdateCache;\n }\n } catch {\n // Cache missing or corrupt \u2014 ignore\n }\n return null;\n}\n\nfunction writeCache(latestVersion: string): void {\n try {\n if (!fs.existsSync(CONFIG_DIR)) {\n fs.mkdirSync(CONFIG_DIR, { recursive: true });\n }\n const data: UpdateCache = { lastCheck: Date.now(), latestVersion };\n fs.writeFileSync(CACHE_FILE, JSON.stringify(data), 'utf-8');\n } catch {\n // Non-critical \u2014 ignore write errors\n }\n}\n\nfunction fetchLatestVersion(): Promise<string | null> {\n return new Promise((resolve) => {\n const req = https.get(REGISTRY_URL, { timeout: FETCH_TIMEOUT_MS }, (res) => {\n if (res.statusCode !== 200) {\n res.resume(); // drain response\n resolve(null);\n return;\n }\n let body = '';\n res.setEncoding('utf-8');\n res.on('data', (chunk) => (body += chunk));\n res.on('end', () => {\n try {\n const json = JSON.parse(body);\n resolve(typeof json.version === 'string' ? json.version : null);\n } catch {\n resolve(null);\n }\n });\n });\n req.on('error', () => resolve(null));\n req.on('timeout', () => {\n req.destroy();\n resolve(null);\n });\n });\n}\n\nexport async function checkForUpdates(): Promise<string | null> {\n try {\n let latestVersion: string | null = null;\n\n const cache = readCache();\n if (cache && Date.now() - cache.lastCheck < CACHE_TTL_MS) {\n latestVersion = cache.latestVersion;\n } else {\n latestVersion = await fetchLatestVersion();\n if (latestVersion) {\n writeCache(latestVersion);\n }\n }\n\n if (latestVersion && isNewerVersion(latestVersion, CLI_VERSION)) {\n return [\n '',\n chalk.yellow(` Update available: ${CLI_VERSION} \u2192 ${chalk.green(latestVersion)}`),\n chalk.yellow(` Run ${chalk.cyan('npm install -g farseer-cli@latest')} to update`),\n '',\n ].join('\\n');\n }\n\n return null;\n } catch {\n // Graceful failure \u2014 never let update check break the CLI\n return null;\n }\n}\n"],
|
|
5
4
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAAuB;AACvB,SAAoB;AACpB,WAAsB;AACtB,SAAoB;AACpB,mBAAkB;AAClB,uBAA4B;AAE5B,MAAM,aAAa,KAAK,KAAK,GAAG,QAAQ,GAAG,UAAU;AACrD,MAAM,aAAa,KAAK,KAAK,YAAY,mBAAmB;AAC5D,MAAM,eAAe,IAAI,KAAK,KAAK;AACnC,MAAM,mBAAmB;AACzB,MAAM,eAAe;AAOd,SAAS,eAAe,QAAgB,SAA0B;AACrE,QAAM,cAAc,OAAO,MAAM,GAAG,EAAE,IAAI,MAAM;AAChD,QAAM,eAAe,QAAQ,MAAM,GAAG,EAAE,IAAI,MAAM;AAClD,WAAS,IAAI,GAAG,IAAI,GAAG,KAAK;AACxB,UAAM,IAAI,YAAY,CAAC,KAAK;AAC5B,UAAM,IAAI,aAAa,CAAC,KAAK;AAC7B,QAAI,IAAI,EAAG,QAAO;AAClB,QAAI,IAAI,EAAG,QAAO;AAAA,EACtB;AACA,SAAO;AACX;AAEA,SAAS,YAAgC;AACrC,MAAI;AACA,UAAM,OAAO,KAAK,MAAM,GAAG,aAAa,YAAY,OAAO,CAAC;AAC5D,QAAI,OAAO,KAAK,cAAc,YAAY,OAAO,KAAK,kBAAkB,UAAU;AAC9E,aAAO;AAAA,IACX;AAAA,EACJ,QAAQ;AAAA,EAER;AACA,SAAO;AACX;AAEA,SAAS,WAAW,eAA6B;AAC7C,MAAI;AACA,QAAI,CAAC,GAAG,WAAW,UAAU,GAAG;AAC5B,SAAG,UAAU,YAAY,EAAE,WAAW,KAAK,CAAC;AAAA,IAChD;AACA,UAAM,OAAoB,EAAE,WAAW,KAAK,IAAI,GAAG,cAAc;AACjE,OAAG,cAAc,YAAY,KAAK,UAAU,IAAI,GAAG,OAAO;AAAA,EAC9D,QAAQ;AAAA,EAER;AACJ;AAEA,SAAS,qBAA6C;AAClD,SAAO,IAAI,QAAQ,CAAC,YAAY;AAC5B,UAAM,MAAM,MAAM,IAAI,cAAc,EAAE,SAAS,iBAAiB,GAAG,CAAC,QAAQ;AACxE,UAAI,IAAI,eAAe,KAAK;AACxB,YAAI,OAAO;AACX,gBAAQ,IAAI;AACZ;AAAA,MACJ;AACA,UAAI,OAAO;AACX,UAAI,YAAY,OAAO;AACvB,UAAI,GAAG,QAAQ,CAAC,UAAW,QAAQ,KAAM;AACzC,UAAI,GAAG,OAAO,MAAM;AAChB,YAAI;AACA,gBAAM,OAAO,KAAK,MAAM,IAAI;AAC5B,kBAAQ,OAAO,KAAK,YAAY,WAAW,KAAK,UAAU,IAAI;AAAA,QAClE,QAAQ;AACJ,kBAAQ,IAAI;AAAA,QAChB;AAAA,MACJ,CAAC;AAAA,IACL,CAAC;AACD,QAAI,GAAG,SAAS,MAAM,QAAQ,IAAI,CAAC;AACnC,QAAI,GAAG,WAAW,MAAM;AACpB,UAAI,QAAQ;AACZ,cAAQ,IAAI;AAAA,IAChB,CAAC;AAAA,EACL,CAAC;AACL;AAEA,eAAsB,kBAA0C;AAC5D,MAAI;AACA,QAAI,gBAA+B;AAEnC,UAAM,QAAQ,UAAU;AACxB,QAAI,SAAS,KAAK,IAAI,IAAI,MAAM,YAAY,cAAc;AACtD,sBAAgB,MAAM;AAAA,IAC1B,OAAO;AACH,sBAAgB,MAAM,mBAAmB;AACzC,UAAI,eAAe;AACf,mBAAW,aAAa;AAAA,MAC5B;AAAA,IACJ;AAEA,QAAI,iBAAiB,eAAe,eAAe,4BAAW,GAAG;AAC7D,aAAO;AAAA,QACH;AAAA,QACA,aAAAA,QAAM,OAAO,uBAAuB,4BAAW,WAAM,aAAAA,QAAM,MAAM,aAAa,CAAC,EAAE;AAAA,QACjF,aAAAA,QAAM,OAAO,SAAS,aAAAA,QAAM,KAAK,mCAAmC,CAAC,YAAY;AAAA,QACjF;AAAA,MACJ,EAAE,KAAK,IAAI;AAAA,IACf;AAEA,WAAO;AAAA,EACX,QAAQ;AAEJ,WAAO;AAAA,EACX;AACJ;",
|
|
6
5
|
"names": ["chalk"]
|
|
7
6
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/variableValues.ts"],
|
|
4
|
-
"sourcesContent": ["// Shared by CLI commands and the existing MCP variable tools.\nconst ROLLUP_TYPES: Record<string, string> = {\n sum: 'SUM',\n average: 'AVERAGE',\n avg: 'AVERAGE',\n min: 'MIN',\n max: 'MAX',\n none: 'NONE',\n formula: 'FORMULA',\n closingstate: 'CLOSING STATE',\n 'closing state': 'CLOSING STATE',\n 'closing-state': 'CLOSING STATE',\n last: 'CLOSING STATE',\n beginningstate: 'BEGINNING STATE',\n 'beginning state': 'BEGINNING STATE',\n 'beginning-state': 'BEGINNING STATE',\n first: 'BEGINNING STATE',\n};\n\nexport function normalizeRollupType(value: string): string {\n const normalized = ROLLUP_TYPES[value.trim().toLowerCase()];\n if (!normalized)\n throw new Error(\n `Invalid rollupType \"${value}\". Valid types: ${[...new Set(Object.values(ROLLUP_TYPES))].join(', ')}`,\n );\n return normalized;\n}\n\nexport function normalizeDataType(value: string): string {\n const normalized = value.trim().toUpperCase();\n if (!['INTEGER', 'DECIMAL'].includes(normalized))\n throw new Error(`Invalid data type \"${value}\". Use Decimal or Integer.`);\n return normalized;\n}\n\n/** Entity updates require the complete variable component; omit read-only response fields. */\nexport function writableVariable(current: Record<string, any> = {}): Record<string, any> {\n return {\n notes: current.notes ?? null,\n tableGids: current.tableGids ?? [],\n memberGids: current.memberGids ?? [],\n rollupType: current.rollupType ?? 'SUM',\n dataType: current.dataType ?? 'DECIMAL',\n topDownMapping: current.topDownMapping ?? null,\n measure: current.measure ?? false,\n readonly: current.readonly ?? false,\n calculateOnDemand: current.calculateOnDemand ?? false,\n zConstraint: current.zConstraint ?? false,\n optimizeCalculation: current.optimizeCalculation ?? true,\n };\n}\n"],
|
|
5
4
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,MAAM,eAAuC;AAAA,EACzC,KAAK;AAAA,EACL,SAAS;AAAA,EACT,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,MAAM;AAAA,EACN,SAAS;AAAA,EACT,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,MAAM;AAAA,EACN,gBAAgB;AAAA,EAChB,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,OAAO;AACX;AAEO,SAAS,oBAAoB,OAAuB;AACvD,QAAM,aAAa,aAAa,MAAM,KAAK,EAAE,YAAY,CAAC;AAC1D,MAAI,CAAC;AACD,UAAM,IAAI;AAAA,MACN,uBAAuB,KAAK,mBAAmB,CAAC,GAAG,IAAI,IAAI,OAAO,OAAO,YAAY,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC;AAAA,IACvG;AACJ,SAAO;AACX;AAEO,SAAS,kBAAkB,OAAuB;AACrD,QAAM,aAAa,MAAM,KAAK,EAAE,YAAY;AAC5C,MAAI,CAAC,CAAC,WAAW,SAAS,EAAE,SAAS,UAAU;AAC3C,UAAM,IAAI,MAAM,sBAAsB,KAAK,4BAA4B;AAC3E,SAAO;AACX;AAGO,SAAS,iBAAiB,UAA+B,CAAC,GAAwB;AACrF,SAAO;AAAA,IACH,OAAO,QAAQ,SAAS;AAAA,IACxB,WAAW,QAAQ,aAAa,CAAC;AAAA,IACjC,YAAY,QAAQ,cAAc,CAAC;AAAA,IACnC,YAAY,QAAQ,cAAc;AAAA,IAClC,UAAU,QAAQ,YAAY;AAAA,IAC9B,gBAAgB,QAAQ,kBAAkB;AAAA,IAC1C,SAAS,QAAQ,WAAW;AAAA,IAC5B,UAAU,QAAQ,YAAY;AAAA,IAC9B,mBAAmB,QAAQ,qBAAqB;AAAA,IAChD,aAAa,QAAQ,eAAe;AAAA,IACpC,qBAAqB,QAAQ,uBAAuB;AAAA,EACxD;AACJ;",
|
|
6
5
|
"names": []
|
|
7
6
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/workspace.ts"],
|
|
4
|
-
"sourcesContent": ["import * as fs from 'fs';\nimport { logger } from './logger';\n\n// Entries that MUST appear in the tenant .gitignore for sync to work\n// correctly across machines. Order matters only for readability of a\n// freshly-created file; for the merge case (existing .gitignore missing\n// entries) we append missing entries in this order.\nconst REQUIRED_GITIGNORE_ENTRIES: { pattern: string; comment?: string }[] = [\n {\n pattern: '.farseer-sync.json',\n comment:\n '# Per-machine sync baseline \u2014 diff state, not user work.\\n' +\n '# Committing this causes spurious \"remote drifted\" reports on other machines.',\n },\n { pattern: '.farseer-audit.log', comment: '# Local audit / crash logs.' },\n { pattern: 'node_modules/', comment: '# Node tooling.' },\n];\n\n/**\n * Ensure the tenant .gitignore contains every per-machine entry. If the\n * file doesn't exist, write a fresh one with comments. If it exists but\n * is missing entries (common: pre-1.6.2 workspaces, or `npm init` created\n * a partial .gitignore listing only `node_modules/`), append the missing\n * patterns idempotently \u2014 match on exact-line so a re-run is a no-op.\n *\n * Called from the workspace-initializing path (`farseer pull`) so a\n * workspace can never reach a state where `.farseer-sync.json` is\n * unignored. Living in `utils/` rather than `commands/` keeps it\n * reusable, so any future init path picks it up too.\n */\nexport function ensureGitignoreEntries(gitignorePath: string): void {\n if (!fs.existsSync(gitignorePath)) {\n const blocks = REQUIRED_GITIGNORE_ENTRIES.map((e) =>\n e.comment ? `${e.comment}\\n${e.pattern}\\n` : `${e.pattern}\\n`,\n );\n fs.writeFileSync(gitignorePath, blocks.join('\\n'), 'utf-8');\n logger.dim(`Created .gitignore`);\n return;\n }\n\n const existing = fs.readFileSync(gitignorePath, 'utf-8');\n const existingLines = new Set(\n existing\n .split('\\n')\n .map((l) => l.trim())\n .filter((l) => l.length > 0 && !l.startsWith('#')),\n );\n\n const missing = REQUIRED_GITIGNORE_ENTRIES.filter((e) => !existingLines.has(e.pattern));\n if (missing.length === 0) return;\n\n // Preserve the file's native line ending so we don't mix CRLF/LF on Windows workspaces.\n const eol = existing.includes('\\r\\n') ? '\\r\\n' : '\\n';\n const normalize = (s: string): string => (eol === '\\n' ? s : s.replace(/\\n/g, eol));\n const needsLeadingNewline = !existing.endsWith('\\n');\n const appended =\n (needsLeadingNewline ? eol : '') +\n eol +\n '# farseer-cli \u2014 sync state (added by `farseer pull`).' +\n eol +\n missing.map((e) => (e.comment ? `${normalize(e.comment)}${eol}${e.pattern}` : e.pattern)).join(eol) +\n eol;\n fs.appendFileSync(gitignorePath, appended, 'utf-8');\n logger.dim(`Appended ${missing.length} entr${missing.length === 1 ? 'y' : 'ies'} to .gitignore`);\n}\n"],
|
|
5
4
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAoB;AACpB,oBAAuB;AAMvB,MAAM,6BAAsE;AAAA,EACxE;AAAA,IACI,SAAS;AAAA,IACT,SACI;AAAA,EAER;AAAA,EACA,EAAE,SAAS,sBAAsB,SAAS,8BAA8B;AAAA,EACxE,EAAE,SAAS,iBAAiB,SAAS,kBAAkB;AAC3D;AAcO,SAAS,uBAAuB,eAA6B;AAChE,MAAI,CAAC,GAAG,WAAW,aAAa,GAAG;AAC/B,UAAM,SAAS,2BAA2B;AAAA,MAAI,CAAC,MAC3C,EAAE,UAAU,GAAG,EAAE,OAAO;AAAA,EAAK,EAAE,OAAO;AAAA,IAAO,GAAG,EAAE,OAAO;AAAA;AAAA,IAC7D;AACA,OAAG,cAAc,eAAe,OAAO,KAAK,IAAI,GAAG,OAAO;AAC1D,yBAAO,IAAI,oBAAoB;AAC/B;AAAA,EACJ;AAEA,QAAM,WAAW,GAAG,aAAa,eAAe,OAAO;AACvD,QAAM,gBAAgB,IAAI;AAAA,IACtB,SACK,MAAM,IAAI,EACV,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,EACnB,OAAO,CAAC,MAAM,EAAE,SAAS,KAAK,CAAC,EAAE,WAAW,GAAG,CAAC;AAAA,EACzD;AAEA,QAAM,UAAU,2BAA2B,OAAO,CAAC,MAAM,CAAC,cAAc,IAAI,EAAE,OAAO,CAAC;AACtF,MAAI,QAAQ,WAAW,EAAG;AAG1B,QAAM,MAAM,SAAS,SAAS,MAAM,IAAI,SAAS;AACjD,QAAM,YAAY,CAAC,MAAuB,QAAQ,OAAO,IAAI,EAAE,QAAQ,OAAO,GAAG;AACjF,QAAM,sBAAsB,CAAC,SAAS,SAAS,IAAI;AACnD,QAAM,YACD,sBAAsB,MAAM,MAC7B,MACA,+DACA,MACA,QAAQ,IAAI,CAAC,MAAO,EAAE,UAAU,GAAG,UAAU,EAAE,OAAO,CAAC,GAAG,GAAG,GAAG,EAAE,OAAO,KAAK,EAAE,OAAQ,EAAE,KAAK,GAAG,IAClG;AACJ,KAAG,eAAe,eAAe,UAAU,OAAO;AAClD,uBAAO,IAAI,YAAY,QAAQ,MAAM,QAAQ,QAAQ,WAAW,IAAI,MAAM,KAAK,gBAAgB;AACnG;",
|
|
6
5
|
"names": []
|
|
7
6
|
}
|
package/docs/cli-guide.md
CHANGED
|
@@ -62,9 +62,10 @@ catches it and refuses with a clear hint.
|
|
|
62
62
|
|
|
63
63
|
```bash
|
|
64
64
|
farseer install
|
|
65
|
+
farseer install --package axios --package lodash@4 # add packages your scripts need
|
|
65
66
|
```
|
|
66
67
|
|
|
67
|
-
This runs `npm install` in the tenant directory (`farseer-apps/<tenant>/`).
|
|
68
|
+
This runs `npm install` in the tenant directory (`farseer-apps/<tenant>/`). `--package` adds each package to its `package.json` first, unless the package is already there.
|
|
68
69
|
|
|
69
70
|
> **Important:** All CLI commands must be run from the **repository root** (the directory containing `farseer-apps/`). The CLI resolves paths relative to `process.cwd()`. Running from inside `farseer-apps/<tenant>/` will fail.
|
|
70
71
|
|
|
@@ -121,7 +122,7 @@ deleted (they share the same status engine).
|
|
|
121
122
|
1. Write your script in `farseer-apps/<tenant>/files/Scripts/myScript.ts`
|
|
122
123
|
2. Push: `farseer push`
|
|
123
124
|
3. Create: `farseer app create "My App"`
|
|
124
|
-
4. Configure: `farseer app configure "My App" --
|
|
125
|
+
4. Configure: `farseer app configure "My App" --source-folder Scripts --entrypoint myScript.ts`
|
|
125
126
|
|
|
126
127
|
### Where and When an App Runs
|
|
127
128
|
|
|
@@ -139,6 +140,8 @@ farseer app configure "My App" --compute batch:l
|
|
|
139
140
|
All four settings round-trip through `apps/<name>.json`, so `pull` records them
|
|
140
141
|
and `push` puts them back.
|
|
141
142
|
|
|
143
|
+
`farseer app configure "My App" --predefined-actions actions.json` replaces the app's predefined actions with the JSON array in the file, as `[{"name": "Nightly", "runArguments": {"Year": "2026"}}]`: `[]` removes them all, and `<secret>` keeps the stored value of the action with exactly that name.
|
|
144
|
+
|
|
142
145
|
### Running Apps
|
|
143
146
|
|
|
144
147
|
```bash
|
|
@@ -178,8 +181,154 @@ farseer variable export "Revenue" --format csv --output revenue.csv
|
|
|
178
181
|
# List dimension tables
|
|
179
182
|
farseer dimensions list
|
|
180
183
|
|
|
184
|
+
# Tables with their member counts (fetches every member; slow on large tenants)
|
|
185
|
+
farseer model --tables --include-members
|
|
186
|
+
|
|
181
187
|
# Dimension details with sample members
|
|
182
188
|
farseer dimension details "Product" --members 20
|
|
189
|
+
|
|
190
|
+
# Export one slice of a variable (a whole-variable export is refused for agent keys)
|
|
191
|
+
farseer variable export "Revenue" --filter Years=2026 --filter Versions=Actual
|
|
192
|
+
|
|
193
|
+
# Several formulas in one request; --filter goes inside each, so each must be a variable name
|
|
194
|
+
farseer formula eval Revenue --formula Cost --filter Years=2026 --filter Versions=Actual --json
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## Cell Values
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
# Read a value. A dimension you leave out is totalled by the variable's rollup.
|
|
201
|
+
farseer cells query --variable "Revenue" --dimension Versions=Actual --dimension Years=Y2025
|
|
202
|
+
|
|
203
|
+
# Preview a write: the formula, the members it reaches on each dimension, the value now, and how a total spreads
|
|
204
|
+
farseer cells update --variable "Revenue" --dimension Versions=Plan --dimension Years=Y2026 --dimension Months=M1 --value 1000
|
|
205
|
+
|
|
206
|
+
# Write it, then read the slice back
|
|
207
|
+
farseer cells update --variable "Revenue" --dimension Versions=Plan --dimension Years=Y2026 --dimension Months=M1 --value 1000 -y
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
- Every dimension of the variable needs a filter, on its own table or on a table linked to it (`Quarters=Q1` for Months). A dimension left open is refused, because the write would reach all of its members; `--across <table>` asks for that on purpose.
|
|
211
|
+
- A value written to a total (a quarter, say) is spread over the cells beneath it: in proportion to the values they hold, or evenly into an empty slice. The preview says which applies and how many cells hold a value.
|
|
212
|
+
- A member with members under it in a hierarchy is refused: Farseer would write the parent's own cell too, after which it no longer totals its members. Write the members under it.
|
|
213
|
+
- `--clear` empties the slice instead. `--input <file>` takes a JSON array of `{variable, dimensions, value}` and writes them in one request.
|
|
214
|
+
- Farseer ignores a filter on a table the variable neither has nor links to. `cells update` and `cells query` refuse one.
|
|
215
|
+
|
|
216
|
+
## Model and Data Changes
|
|
217
|
+
|
|
218
|
+
Every command below takes `[org] [tenant]` (or `FARSEER_TENANT`) and `--json`,
|
|
219
|
+
which prints `{tenant, ...}`: the same result as the MCP tool named in the comment.
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
# Tables and members (farseer_create_table, farseer_manage_dimension_members)
|
|
223
|
+
farseer dimensions create "Sales regions" --folder-path "Dimensions/Sales"
|
|
224
|
+
farseer dimensions create-member --table "Sales regions" --name Nordics
|
|
225
|
+
farseer dimensions create-member --table "Sales regions" --name Norway --parent Nordics
|
|
226
|
+
farseer dimensions create-member --table "AC Period" --name Q1 --compound --formula 'or($101,$102,$103)'
|
|
227
|
+
|
|
228
|
+
# Variables (farseer_create_variable, farseer_update_variable)
|
|
229
|
+
farseer variables create --name Margin --dimensions Product,Years,Months --formula 'Revenue - Cost' \
|
|
230
|
+
--number-format '{"type":"PERCENTAGE","decimals":1}' --folder-path "Variables/Revenue"
|
|
231
|
+
farseer variables create --name "FX rate" --measure
|
|
232
|
+
farseer variables update --name Margin --new-name "Gross margin" --polarity NEGATIVE
|
|
233
|
+
|
|
234
|
+
# Deletes print a preview and change nothing without -y (farseer_delete_variable, farseer_delete_variable_data)
|
|
235
|
+
farseer variables delete-data Margin -y
|
|
236
|
+
farseer variables delete Margin -y
|
|
237
|
+
|
|
238
|
+
# One import job from a file of {"columns": [...], "rows": [...]} (farseer_create_import_job)
|
|
239
|
+
farseer variables import --input revenue.json --title "Revenue 2026" --label revenue-2026 --import-dimensions
|
|
240
|
+
farseer variables import --input revenue.json --title "Revenue 2026" --label revenue-2026 --undo-previous -y
|
|
241
|
+
|
|
242
|
+
# Upload a file; replacing an existing one previews without -y (farseer_create_file)
|
|
243
|
+
farseer files upload mapping.csv --folder-path Files/Mappings
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
`files upload` walks its `--folder-path` from the top level as `pull` and `push`
|
|
247
|
+
do, so the path starts at `Files/`; a folder shared with you under a parent you
|
|
248
|
+
cannot see is not reachable there.
|
|
249
|
+
|
|
250
|
+
- `--folder-path "A/B"` walks folders from the top level by exact name, or a
|
|
251
|
+
case-insensitive name when only one folder matches. Every folder must exist:
|
|
252
|
+
nothing is created, and a missing one is an error.
|
|
253
|
+
- `--folder-id <id>` names the folder by id instead, for `variables create` and
|
|
254
|
+
`dimensions create`: a folder shared with you can have the same name as a
|
|
255
|
+
top-level one, and a name can hold "/".
|
|
256
|
+
- `--parent` puts a member under another one through the table's foreign key to
|
|
257
|
+
itself; a table without one has no hierarchy and refuses it.
|
|
258
|
+
- A compound formula names members by id inside `or()` and `and()`, as the
|
|
259
|
+
web's compound builder writes it.
|
|
260
|
+
- An import into a cell that already holds a value is refused unless
|
|
261
|
+
`--overwrite-cells` is given. `--undo-previous` needs a `--label`: it undoes
|
|
262
|
+
the earlier jobs that carry the same labels, before the new one commits.
|
|
263
|
+
Both change data that is already there, so `variables import` previews them
|
|
264
|
+
without `-y`. A preview with `--json`
|
|
265
|
+
prints `{tenant, preview: true, ...}` on stdout and nothing else.
|
|
266
|
+
|
|
267
|
+
## Dashboards and Folders
|
|
268
|
+
|
|
269
|
+
```bash
|
|
270
|
+
# A folder for the dashboard, then the dashboard in it
|
|
271
|
+
farseer folders create "Sales" --parent-path Dashboards
|
|
272
|
+
farseer dashboards create "Sales overview" --folder-path Dashboards/Sales
|
|
273
|
+
|
|
274
|
+
# Tiles: a JSON file per tile (see "farseer dashboards create-tile --help" for the shape)
|
|
275
|
+
farseer dashboards create-tile "Sales overview" --input table-tile.json
|
|
276
|
+
farseer dashboards tiles "Sales overview" # ids, types and the sheet behind each table or chart
|
|
277
|
+
farseer dashboards show-tile "Sales overview" 12 --json
|
|
278
|
+
farseer dashboards update-tile "Sales overview" 12 --input changes.json
|
|
279
|
+
|
|
280
|
+
# Rename, change timeline/filters/options, copy, move
|
|
281
|
+
farseer dashboards update "Sales overview" --name "Sales"
|
|
282
|
+
farseer dashboards duplicate "Sales" --name "Sales (copy)" --folder-path Dashboards/Sales
|
|
283
|
+
farseer dashboards move "Sales (copy)" --folder-path Dashboards
|
|
284
|
+
|
|
285
|
+
# Deletes preview without -y and change nothing
|
|
286
|
+
farseer dashboards delete-tile "Sales" 12 -y
|
|
287
|
+
farseer dashboards delete "Sales (copy)" -y
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
- Folder paths start at the top level (`Dashboards/Sales`), as `dashboards list --include-folder-path` prints them, and match exactly. A folder that doesn't exist is refused, never replaced by another one. A folder needs a parent, because the API cannot create top-level folders.
|
|
291
|
+
- Only a dashboard needs a folder; without `--folder-path` or `--folder-id` it goes in the top-level Dashboards folder.
|
|
292
|
+
- Tile layouts go under `gridPlacements.absolute` (the default fixed grid) or `large`/`small` (responsive dashboards). Dashboards read no other key, so the CLI refuses any other.
|
|
293
|
+
- A table or chart tile gets a sheet of its own; its rows and columns are sheet lines, which these commands don't create. `POST /sheetLines` drops a gid it does not know and still answers 201, so read the lines back.
|
|
294
|
+
- `folders move` takes folder item ids, which are not dashboard or variable ids; `dashboards move` finds the right one for a dashboard.
|
|
295
|
+
- With `--json`, a command prints the result its MCP tool returns (`farseer_create_tile` and so on), with the tenant and without `success`. An error goes to stderr with the tool's message and exit code 1.
|
|
296
|
+
|
|
297
|
+
## Sheets
|
|
298
|
+
|
|
299
|
+
`farseer sheets` lists, reads and changes sheets. A sheet is named by its name or numeric id. With `--json`, `rows`, `create`, `create-row`, `update-row`, `delete-row` and `set-columns` print the MCP tool's payload with `tenant` and without `success`; `list --json` prints the plain array of sheets, `show --json` the whole sheet, and `data --json` its columns and rows.
|
|
300
|
+
|
|
301
|
+
```bash
|
|
302
|
+
farseer sheets list --limit 20 --offset 20 # page through the sheets
|
|
303
|
+
farseer sheets create "Plan 2026" --folder-path "Sheets/Reports" # or --folder-id <id>
|
|
304
|
+
farseer sheets rows "Plan 2026" # rows, nested, with their variable, members and table
|
|
305
|
+
farseer sheets data "Plan 2026" --limit 10 # columns and the first 10 rows with their values
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
**Rows.** A row lists a table's members (`--table-id`) or shows a variable at members (`--variable-id`, `--member-ids`). `--parent-id` nests it under another row. `update-row` changes only what you pass; `--no-variable-id`, `--no-member-ids` and `--no-table-id` unbind.
|
|
309
|
+
|
|
310
|
+
```bash
|
|
311
|
+
farseer sheets create-row "Plan 2026" --name Companies --table-id 56
|
|
312
|
+
farseer sheets update-row "Plan 2026" 5791 --name "Companies (all)"
|
|
313
|
+
farseer sheets delete-row 5791 # preview: the row, its child rows go with it; cell values stay
|
|
314
|
+
farseer sheets delete-row 5791 -y
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
Farseer drops a variable, member or table id it does not know and still saves the row. The commands read the row back and print a warning naming the dropped ids (`dropped` in `--json`).
|
|
318
|
+
|
|
319
|
+
**Columns.** `set-columns` replaces the column configuration from a JSON file holding the `columns` object of `farseer sheets show --json`. A custom column missing from the new `custom` array is deleted. Without `-y` it prints what would change.
|
|
320
|
+
|
|
321
|
+
```bash
|
|
322
|
+
farseer sheets show "Plan 2026" --json | jq .columns > columns.json # edit, then:
|
|
323
|
+
farseer sheets set-columns "Plan 2026" --input columns.json -y
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
**Lines.** `create-line` adds one NUMBER line on either axis, by name or id, which also fills a dashboard tile's sheet (by its numeric id). A row line lists a table's members; a column line is one variable at the members that filter it.
|
|
327
|
+
|
|
328
|
+
```bash
|
|
329
|
+
farseer sheets create-line 424 --axis row --name Companies --table "Company (LVL3)"
|
|
330
|
+
farseer sheets create-line 424 --axis column --name "Revenue Plan 2026" \
|
|
331
|
+
--variable Revenue --member Versions=Plan --member Years=Y2026
|
|
183
332
|
```
|
|
184
333
|
|
|
185
334
|
## Tenant Resolution
|
|
@@ -217,6 +366,37 @@ farseer config show mytenant
|
|
|
217
366
|
farseer config remove mytenant
|
|
218
367
|
```
|
|
219
368
|
|
|
369
|
+
## Skills and Docs for Agents
|
|
370
|
+
|
|
371
|
+
The CLI ships the skills a coding agent needs for Farseer work (analysis, formulas, the model, dashboards, pipeline authoring) and the reference docs the MCP server offers. An agent that loads skills from a folder picks them up after one install:
|
|
372
|
+
|
|
373
|
+
```bash
|
|
374
|
+
farseer skills list # each skill, its version and when an agent uses it
|
|
375
|
+
farseer skills show farseer-model # print its SKILL.md (--path prints the folder)
|
|
376
|
+
farseer skills show pipeline-authoring --file practices.md # another file of a skill
|
|
377
|
+
farseer skills install # the repo's .claude/skills (Claude Code) and .agents/skills (Codex, OpenHands)
|
|
378
|
+
farseer skills install --global # ~/.claude/skills and ~/.agents/skills instead
|
|
379
|
+
farseer docs # the reference docs; farseer docs troubleshooting prints one
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
`install` writes to the root of the git repository you are in, or to the current folder outside one. Run it again after updating the CLI: it updates the folders it installed and leaves alone a folder that was edited since, or that it did not install. `--force` shows the plan with those folders replaced too, and writes nothing; `--force -y` carries it out. `--json` prints each skill's `status`: `installed`, `updated`, `unchanged`, `skipped`, `replaced`, `obsolete` or `failed`, and in a `--force` plan `would-install`, `would-update` or `would-replace`. A Claude Code session started before `.claude/skills` existed needs `/reload-skills`.
|
|
383
|
+
|
|
384
|
+
### Agent workflows
|
|
385
|
+
|
|
386
|
+
All new repeatable data pipelines must use Simple Pipelines, even when TypeScript is requested: see the `pipeline-authoring` skill. Preserve existing TypeScript apps and make targeted fixes to them; migration requires an explicit migration request.
|
|
387
|
+
|
|
388
|
+
The MCP server's prompts, done from a terminal:
|
|
389
|
+
|
|
390
|
+
- `setup_new_tenant`: `farseer login`, `farseer pull <org> <tenant>`, `farseer install`, then `farseer app list` and `farseer model`.
|
|
391
|
+
- `create_new_app` (non-pipeline apps only): `farseer docs new-app-template`, then `farseer push`, `farseer app create`, `farseer app configure` and `farseer run`.
|
|
392
|
+
- `copy_app` (non-pipeline apps only): copy the app's JSON under `farseer-apps/<tenant>/apps/`, change its `name`, remove the `_remote` field so the push creates a new app, and set `schedule` to null unless both should run at the same moment. Then `farseer push`.
|
|
393
|
+
- `understand_model`: the `farseer-model` skill, with `farseer model`, `farseer dimensions list` and `farseer variables list`.
|
|
394
|
+
- `write_import_script`: the `pipeline-authoring` skill.
|
|
395
|
+
- `export_data`: `farseer variable export` to a file, or `farseer formula eval` for a few values.
|
|
396
|
+
- `debug_sync_issues`: `farseer docs troubleshooting`, section "Sync and authentication".
|
|
397
|
+
|
|
398
|
+
The server's instructions bind one tenant per MCP session; the CLI takes the tenant per command (see Tenant Resolution). `farseer tool list` prints those instructions.
|
|
399
|
+
|
|
220
400
|
## MCP Server
|
|
221
401
|
|
|
222
402
|
Start the MCP server for AI assistant integration (Claude, Cursor, etc.):
|
package/docs/import-workflows.md
CHANGED
|
@@ -16,17 +16,17 @@ Creates an import job and returns an `ImportActions` object with methods for add
|
|
|
16
16
|
|
|
17
17
|
```typescript
|
|
18
18
|
const importJob = await client.createImportJob({
|
|
19
|
-
title:
|
|
20
|
-
description: '
|
|
19
|
+
title: `Planned costs ${year} ${version}`,
|
|
20
|
+
description: 'Planned costs by cost center',
|
|
21
21
|
columns: [
|
|
22
|
-
{ type: 'DIMENSION_TABLE', dimensionTableName: '
|
|
22
|
+
{ type: 'DIMENSION_TABLE', dimensionTableName: 'Cost center' },
|
|
23
23
|
{ type: 'DIMENSION_TABLE', dimensionTableName: 'Entities' },
|
|
24
24
|
{ type: 'DIMENSION_TABLE', dimensionTableName: 'Years' },
|
|
25
25
|
{ type: 'DIMENSION_TABLE', dimensionTableName: 'Months' },
|
|
26
26
|
{ type: 'DIMENSION_TABLE', dimensionTableName: 'Versions' },
|
|
27
|
-
{ type: 'VARIABLE', variableName: '
|
|
27
|
+
{ type: 'VARIABLE', variableName: 'Planned costs' },
|
|
28
28
|
],
|
|
29
|
-
labels: ['
|
|
29
|
+
labels: ['planned costs', year, version]
|
|
30
30
|
});
|
|
31
31
|
```
|
|
32
32
|
|
|
@@ -39,10 +39,10 @@ async function getImportMetadata(client: FarseerClient) {
|
|
|
39
39
|
const YearsTable = await client.getDimensionTable('Years');
|
|
40
40
|
const MonthsTable = await client.getDimensionTable('Months');
|
|
41
41
|
const EntitiesTable = await client.getDimensionTable('Entities');
|
|
42
|
-
const
|
|
42
|
+
const CostCenterTable = await client.getDimensionTable('Cost center');
|
|
43
43
|
|
|
44
44
|
// VARIABLES
|
|
45
|
-
const
|
|
45
|
+
const PlannedCostsVar = await client.getVariable('Planned costs');
|
|
46
46
|
|
|
47
47
|
return {
|
|
48
48
|
handleMissingTags: HandleMissingTags.SKIP_ROW,
|
|
@@ -70,24 +70,24 @@ async function getImportMetadata(client: FarseerClient) {
|
|
|
70
70
|
tableTagId: EntitiesTable.id,
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
|
-
name: '
|
|
73
|
+
name: 'Cost center',
|
|
74
74
|
dataContext: farseer.ColumnMetaDataContext.IDENTIFIER,
|
|
75
|
-
tableTagId:
|
|
75
|
+
tableTagId: CostCenterTable.id,
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
|
-
name: '
|
|
78
|
+
name: 'Planned costs',
|
|
79
79
|
dataContext: farseer.ColumnMetaDataContext.VALUES,
|
|
80
|
-
applyTagsIds: [
|
|
80
|
+
applyTagsIds: [PlannedCostsVar.id],
|
|
81
81
|
},
|
|
82
82
|
],
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
const importJob = await client.createImportJob({
|
|
87
|
-
title: '
|
|
88
|
-
description: '
|
|
87
|
+
title: 'Planned costs',
|
|
88
|
+
description: 'Planned costs by cost center',
|
|
89
89
|
metadata: await getImportMetadata(client),
|
|
90
|
-
labels: ['auto', '
|
|
90
|
+
labels: ['auto', 'planned costs']
|
|
91
91
|
});
|
|
92
92
|
```
|
|
93
93
|
|
package/docs/new-app-template.md
CHANGED
|
@@ -47,7 +47,7 @@ farseer app create "My App Name"
|
|
|
47
47
|
### Step 4: Configure the App
|
|
48
48
|
|
|
49
49
|
```bash
|
|
50
|
-
farseer app configure "My App Name" --
|
|
50
|
+
farseer app configure "My App Name" --source-folder Scripts --entrypoint myScript.ts
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
Optionally add arguments:
|
|
@@ -44,7 +44,7 @@ The permissions alone are not enough for an analyst who is not a super user: Far
|
|
|
44
44
|
|
|
45
45
|
The CLI authors for exactly one engine version: the one inside the runner image it was released with. When Farseer releases a new runner image it also releases a CLI, and for a while the backend accepts both. `check` reports a newer CLI as available; below the minimum, pipeline commands stop with "update the CLI". IT should expect to update `farseer-cli` on analysts' laptops a few times a year.
|
|
46
46
|
|
|
47
|
-
The CLI never changes which engine a job runs on its own. A job on an older image keeps running on it. To edit it with a newer CLI, someone runs `farseer pipeline upgrade-runtime`, which moves the job to the CLI's image and says what it moved from; until then the CLI refuses to push to it. That includes pipelines Farseer consultants built for you earlier: the assistant asks before upgrading one, and if the newer engine rejects something it will say so and offer to fix it. A job set to follow `latest` is left alone. Moving a pipeline from simple-pipelines 2.x to 3.0 is a breaking change: every extract must be split into an extract, which only fetches the source's file, and a parse step that reads it, so an inherited pipeline's runs fail on the new engine from its upgrade until it is changed. The assistant's pipeline skill describes the new shape and can make that change. If you would rather a consultant did that, ask before an inherited pipeline is upgraded.
|
|
47
|
+
The CLI never changes which engine a job runs on its own. A job on an older image keeps running on it. To edit it with a newer CLI, someone runs `farseer pipeline upgrade-runtime`, which moves the job to the CLI's image and says what it moved from; until then the CLI refuses to push to it. That includes pipelines Farseer consultants built for you earlier: the assistant asks before upgrading one, and if the newer engine rejects something it will say so and offer to fix it. A job set to follow `latest` is left alone. Moving a pipeline from simple-pipelines 2.x to 3.0 is a breaking change: every extract must be split into an extract, which only fetches the source's file, and a parse step that reads it, so an inherited pipeline's runs fail on the new engine from its upgrade until it is changed. The assistant's pipeline skill describes the new shape and can make that change. If you would rather a consultant did that, ask before an inherited pipeline is upgraded. From 3.1.1, an inherited pipeline that names no store also moves its outputs from its `Data` folder to datasets when it is upgraded, so if anything reads that folder, ask before upgrading it.
|
|
48
48
|
|
|
49
49
|
## Moving to production
|
|
50
50
|
|