farseer-cli 1.10.3 → 1.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/README.md +5 -0
  2. package/dist/commands/app.js +41 -42
  3. package/dist/commands/app.js.map +2 -2
  4. package/dist/commands/apps.js +3 -3
  5. package/dist/commands/apps.js.map +2 -2
  6. package/dist/commands/cells.js +3 -3
  7. package/dist/commands/cells.js.map +2 -2
  8. package/dist/commands/config.js +23 -15
  9. package/dist/commands/config.js.map +2 -2
  10. package/dist/commands/dashboards.js +3 -3
  11. package/dist/commands/dashboards.js.map +2 -2
  12. package/dist/commands/dimensions.js +3 -3
  13. package/dist/commands/dimensions.js.map +2 -2
  14. package/dist/commands/files.js +5 -4
  15. package/dist/commands/files.js.map +2 -2
  16. package/dist/commands/formula.js +3 -3
  17. package/dist/commands/formula.js.map +2 -2
  18. package/dist/commands/list.js +5 -4
  19. package/dist/commands/list.js.map +2 -2
  20. package/dist/commands/login.js +6 -5
  21. package/dist/commands/login.js.map +2 -2
  22. package/dist/commands/model.js +5 -4
  23. package/dist/commands/model.js.map +2 -2
  24. package/dist/commands/push.js +5 -7
  25. package/dist/commands/push.js.map +2 -2
  26. package/dist/commands/run.js +13 -15
  27. package/dist/commands/run.js.map +2 -2
  28. package/dist/commands/sheets.js +3 -3
  29. package/dist/commands/sheets.js.map +2 -2
  30. package/dist/commands/variables.js +5 -4
  31. package/dist/commands/variables.js.map +2 -2
  32. package/dist/mcp/index.js +1 -1
  33. package/dist/mcp/index.js.map +2 -2
  34. package/dist/mcp/tools/appTools.js +38 -23
  35. package/dist/mcp/tools/appTools.js.map +2 -2
  36. package/dist/mcp/tools/dataTools.js +5 -2
  37. package/dist/mcp/tools/dataTools.js.map +2 -2
  38. package/dist/mcp/tools/modelTools.js +45 -48
  39. package/dist/mcp/tools/modelTools.js.map +2 -2
  40. package/dist/mcp/tools/runTools.js +12 -7
  41. package/dist/mcp/tools/runTools.js.map +2 -2
  42. package/dist/mcp/utils/helpers.js +41 -0
  43. package/dist/mcp/utils/helpers.js.map +2 -2
  44. package/dist/mcp/utils/session.js +2 -2
  45. package/dist/mcp/utils/session.js.map +2 -2
  46. package/dist/services/appSyncService.js.map +1 -1
  47. package/dist/services/apps.js +149 -0
  48. package/dist/services/apps.js.map +7 -0
  49. package/dist/services/authErrors.js +77 -0
  50. package/dist/services/authErrors.js.map +7 -0
  51. package/dist/services/configService.js +7 -4
  52. package/dist/services/configService.js.map +2 -2
  53. package/dist/services/credentials.js +87 -0
  54. package/dist/services/credentials.js.map +7 -0
  55. package/dist/services/farseerService.js +247 -123
  56. package/dist/services/farseerService.js.map +2 -2
  57. package/dist/services/httpError.js +35 -0
  58. package/dist/services/httpError.js.map +7 -0
  59. package/dist/services/modelExport.js +63 -0
  60. package/dist/services/modelExport.js.map +7 -0
  61. package/dist/services/organisation.js +88 -0
  62. package/dist/services/organisation.js.map +7 -0
  63. package/dist/services/preflight.js +10 -13
  64. package/dist/services/preflight.js.map +2 -2
  65. package/dist/services/syncService.js +2 -2
  66. package/dist/services/syncService.js.map +2 -2
  67. package/dist/utils/appResolver.js +63 -0
  68. package/dist/utils/appResolver.js.map +7 -0
  69. package/dist/utils/constants.js +2 -5
  70. package/dist/utils/constants.js.map +2 -2
  71. package/dist/utils/fileLogger.js +24 -1
  72. package/dist/utils/fileLogger.js.map +2 -2
  73. package/dist/utils/folderMatch.js +49 -0
  74. package/dist/utils/folderMatch.js.map +7 -0
  75. package/dist/utils/helpers.js +98 -1
  76. package/dist/utils/helpers.js.map +3 -3
  77. package/dist/utils/syncScope.js +44 -0
  78. package/dist/utils/syncScope.js.map +7 -0
  79. package/docs/api-reference.md +13 -1
  80. package/package.json +1 -1
  81. package/dist/services/farseerApi.js +0 -716
  82. package/dist/services/farseerApi.js.map +0 -7
  83. package/dist/services/farseerFactory.js +0 -276
  84. package/dist/services/farseerFactory.js.map +0 -7
@@ -0,0 +1,44 @@
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 syncScope_exports = {};
20
+ __export(syncScope_exports, {
21
+ DEFAULT_SCRIPT_EXTENSIONS: () => DEFAULT_SCRIPT_EXTENSIONS,
22
+ DEFAULT_SYNC_EXTENSIONS: () => DEFAULT_SYNC_EXTENSIONS
23
+ });
24
+ module.exports = __toCommonJS(syncScope_exports);
25
+ const DEFAULT_SCRIPT_EXTENSIONS = [".ts", ".js"];
26
+ const DEFAULT_SYNC_EXTENSIONS = [
27
+ // Code (frontend / scripts)
28
+ ".ts",
29
+ ".js",
30
+ // Code (Python)
31
+ ".py",
32
+ // Config / data
33
+ ".yml",
34
+ ".yaml",
35
+ ".json",
36
+ // Docs
37
+ ".md"
38
+ ];
39
+ // Annotate the CommonJS export names for ESM import in node:
40
+ 0 && (module.exports = {
41
+ DEFAULT_SCRIPT_EXTENSIONS,
42
+ DEFAULT_SYNC_EXTENSIONS
43
+ });
44
+ //# sourceMappingURL=syncScope.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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
+ "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
+ "names": []
7
+ }
@@ -115,6 +115,14 @@ if (result === 'timeout') {
115
115
 
116
116
  Navigates the folder structure and retrieves an item by path.
117
117
 
118
+ > **A single-segment path is not a path lookup.** `getItemByPath(['Files'])` ignores
119
+ > the path and runs a tenant-wide name search across folders, dashboards, sheets,
120
+ > dimension tables and variables, capped at 20 results. The name match is exact, so
121
+ > "Files Overview" is harmless — but it throws when a second item is named exactly
122
+ > "Files" anywhere in the tenant, and it silently misses the real folder when 20
123
+ > other items share the name as a prefix. For a top-level folder, list the root with
124
+ > `folders.listItemsBatch([{ id: null }])` and match the name yourself.
125
+
118
126
  ```typescript
119
127
  // Get the "Reports" folder in "Finance"
120
128
  const item = await client.getItemByPath(['Finance', 'Reports']);
@@ -251,7 +259,11 @@ Saves an Arquero table as a CSV file in Farseer.
251
259
 
252
260
  ```typescript
253
261
  const data = aq.table({ A: [1, 2, 3], B: [4, 5, 6] });
254
- const folder = await client.getItemByPath(['Finance']);
262
+
263
+ // "Finance" is top-level, so list the root and match it — see the note on
264
+ // getItemByPath above for why a single-segment path is not a path lookup.
265
+ const root = await client.folders.listItemsBatch([{ id: null }]);
266
+ const folder = root[0].items.find((i) => i.name === 'Finance');
255
267
 
256
268
  await client.data.saveToCsvFarseerFile(data, 'output.csv', folder.id);
257
269
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "farseer-cli",
3
- "version": "1.10.3",
3
+ "version": "1.11.1",
4
4
  "description": "CLI tool for syncing Farseer App scripts between local folder and Farseer instances",
5
5
  "main": "dist/index.js",
6
6
  "bin": {