farseer-cli 1.0.10 → 1.1.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 (98) hide show
  1. package/README.md +19 -0
  2. package/dist/commands/app.js +348 -344
  3. package/dist/commands/app.js.map +7 -0
  4. package/dist/commands/apps.js +110 -82
  5. package/dist/commands/apps.js.map +7 -0
  6. package/dist/commands/cells.js +161 -0
  7. package/dist/commands/cells.js.map +7 -0
  8. package/dist/commands/checkout.js +140 -155
  9. package/dist/commands/checkout.js.map +7 -0
  10. package/dist/commands/config.js +128 -126
  11. package/dist/commands/config.js.map +7 -0
  12. package/dist/commands/dashboards.js +130 -0
  13. package/dist/commands/dashboards.js.map +7 -0
  14. package/dist/commands/diff.js +171 -193
  15. package/dist/commands/diff.js.map +7 -0
  16. package/dist/commands/dimensions.js +222 -119
  17. package/dist/commands/dimensions.js.map +7 -0
  18. package/dist/commands/files.js +96 -77
  19. package/dist/commands/files.js.map +7 -0
  20. package/dist/commands/formula.js +116 -0
  21. package/dist/commands/formula.js.map +7 -0
  22. package/dist/commands/install.js +74 -76
  23. package/dist/commands/install.js.map +7 -0
  24. package/dist/commands/list.js +91 -73
  25. package/dist/commands/list.js.map +7 -0
  26. package/dist/commands/login.js +137 -98
  27. package/dist/commands/login.js.map +7 -0
  28. package/dist/commands/logout.js +59 -41
  29. package/dist/commands/logout.js.map +7 -0
  30. package/dist/commands/mcp-server.js +36 -23
  31. package/dist/commands/mcp-server.js.map +7 -0
  32. package/dist/commands/model.js +186 -175
  33. package/dist/commands/model.js.map +7 -0
  34. package/dist/commands/pull.js +264 -274
  35. package/dist/commands/pull.js.map +7 -0
  36. package/dist/commands/push.js +209 -221
  37. package/dist/commands/push.js.map +7 -0
  38. package/dist/commands/run.js +276 -321
  39. package/dist/commands/run.js.map +7 -0
  40. package/dist/commands/sheets.js +200 -0
  41. package/dist/commands/sheets.js.map +7 -0
  42. package/dist/commands/status.js +149 -169
  43. package/dist/commands/status.js.map +7 -0
  44. package/dist/commands/variables.js +247 -188
  45. package/dist/commands/variables.js.map +7 -0
  46. package/dist/commands/whoami.js +65 -44
  47. package/dist/commands/whoami.js.map +7 -0
  48. package/dist/index.js +179 -115
  49. package/dist/index.js.map +7 -0
  50. package/dist/mcp/index.js +33 -16
  51. package/dist/mcp/index.js.map +7 -0
  52. package/dist/mcp/prompts/workflows.js +191 -145
  53. package/dist/mcp/prompts/workflows.js.map +7 -0
  54. package/dist/mcp/resources/documentation.js +158 -148
  55. package/dist/mcp/resources/documentation.js.map +7 -0
  56. package/dist/mcp/server.js +56 -33
  57. package/dist/mcp/server.js.map +7 -0
  58. package/dist/mcp/tools/appTools.js +309 -277
  59. package/dist/mcp/tools/appTools.js.map +7 -0
  60. package/dist/mcp/tools/authTools.js +130 -121
  61. package/dist/mcp/tools/authTools.js.map +7 -0
  62. package/dist/mcp/tools/cellTools.js +148 -0
  63. package/dist/mcp/tools/cellTools.js.map +7 -0
  64. package/dist/mcp/tools/dashboardTools.js +133 -0
  65. package/dist/mcp/tools/dashboardTools.js.map +7 -0
  66. package/dist/mcp/tools/dataTools.js +270 -267
  67. package/dist/mcp/tools/dataTools.js.map +7 -0
  68. package/dist/mcp/tools/modelTools.js +575 -229
  69. package/dist/mcp/tools/modelTools.js.map +7 -0
  70. package/dist/mcp/tools/runTools.js +201 -203
  71. package/dist/mcp/tools/runTools.js.map +7 -0
  72. package/dist/mcp/tools/sheetTools.js +240 -0
  73. package/dist/mcp/tools/sheetTools.js.map +7 -0
  74. package/dist/mcp/tools/syncTools.js +335 -314
  75. package/dist/mcp/tools/syncTools.js.map +7 -0
  76. package/dist/mcp/utils/helpers.js +117 -123
  77. package/dist/mcp/utils/helpers.js.map +7 -0
  78. package/dist/services/appSyncService.js +381 -437
  79. package/dist/services/appSyncService.js.map +7 -0
  80. package/dist/services/configService.js +154 -143
  81. package/dist/services/configService.js.map +7 -0
  82. package/dist/services/farseerApi.js +422 -399
  83. package/dist/services/farseerApi.js.map +7 -0
  84. package/dist/services/farseerFactory.js +208 -273
  85. package/dist/services/farseerFactory.js.map +7 -0
  86. package/dist/services/farseerService.js +467 -486
  87. package/dist/services/farseerService.js.map +7 -0
  88. package/dist/services/syncService.js +661 -731
  89. package/dist/services/syncService.js.map +7 -0
  90. package/dist/utils/constants.js +52 -19
  91. package/dist/utils/constants.js.map +7 -0
  92. package/dist/utils/entityResolver.js +78 -0
  93. package/dist/utils/entityResolver.js.map +7 -0
  94. package/dist/utils/helpers.js +331 -365
  95. package/dist/utils/helpers.js.map +7 -0
  96. package/dist/utils/logger.js +74 -42
  97. package/dist/utils/logger.js.map +7 -0
  98. package/package.json +3 -2
@@ -1,181 +1,192 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.registerModelCommand = registerModelCommand;
4
- const logger_1 = require("../utils/logger");
5
- const farseerFactory_1 = require("../services/farseerFactory");
6
- const helpers_1 = require("../utils/helpers");
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 model_exports = {};
20
+ __export(model_exports, {
21
+ registerModelCommand: () => registerModelCommand
22
+ });
23
+ module.exports = __toCommonJS(model_exports);
24
+ var import_logger = require("../utils/logger");
25
+ var import_farseerFactory = require("../services/farseerFactory");
26
+ var import_helpers = require("../utils/helpers");
7
27
  function registerModelCommand(program) {
8
- program
9
- .command('model [tenant]')
10
- .description('Export and display the model structure (dimensions, variables)')
11
- .option('--json', 'Output raw JSON')
12
- .option('--tables', 'Show only dimension tables')
13
- .option('--variables', 'Show only variables')
14
- .option('--variable <name>', 'Show details for specific variable')
15
- .option('--table <name>', 'Show details for specific dimension table')
16
- .action(async (tenantArg, options) => {
17
- const { organisation, tenant } = (0, helpers_1.resolveTenantWithOrgMapping)(tenantArg);
18
- const result = await (0, farseerFactory_1.getFarseerClientWithFallback)(organisation, tenant);
19
- if (!result) {
20
- (0, farseerFactory_1.showLoginPrompt)(tenant);
21
- process.exit(1);
28
+ program.command("model [tenant]").description("Export and display the model structure (dimensions, variables)").option("--json", "Output raw JSON").option("--tables", "Show only dimension tables").option("--variables", "Show only variables").option("--variable <name>", "Show details for specific variable").option("--table <name>", "Show details for specific dimension table").action(async (tenantArg, options) => {
29
+ const { organisation, tenant } = (0, import_helpers.resolveTenantWithOrgMapping)(tenantArg);
30
+ const result = await (0, import_farseerFactory.getFarseerClientWithFallback)(organisation, tenant);
31
+ if (!result) {
32
+ (0, import_farseerFactory.showLoginPrompt)(tenant);
33
+ process.exit(1);
34
+ }
35
+ const api = result.client;
36
+ try {
37
+ const model = await api.exportModel();
38
+ if (options.json) {
39
+ console.log(JSON.stringify(model, null, 2));
40
+ return;
41
+ }
42
+ if (options.variable) {
43
+ const variable = model.variables.find(
44
+ (v) => v.name.toLowerCase() === options.variable.toLowerCase()
45
+ );
46
+ if (!variable) {
47
+ import_logger.logger.error(`Variable "${options.variable}" not found.`);
48
+ import_logger.logger.dim("Available variables:");
49
+ model.variables.slice(0, 10).forEach((v) => import_logger.logger.dim(` - ${v.name}`));
50
+ if (model.variables.length > 10) {
51
+ import_logger.logger.dim(` ... and ${model.variables.length - 10} more`);
52
+ }
53
+ process.exit(1);
22
54
  }
23
- const api = result.client;
24
- try {
25
- const model = await api.exportModel();
26
- // Raw JSON output
27
- if (options.json) {
28
- console.log(JSON.stringify(model, null, 2));
29
- return;
30
- }
31
- // Specific variable details
32
- if (options.variable) {
33
- const variable = model.variables.find((v) => v.name.toLowerCase() === options.variable.toLowerCase());
34
- if (!variable) {
35
- logger_1.logger.error(`Variable "${options.variable}" not found.`);
36
- logger_1.logger.dim('Available variables:');
37
- model.variables.slice(0, 10).forEach((v) => logger_1.logger.dim(` - ${v.name}`));
38
- if (model.variables.length > 10) {
39
- logger_1.logger.dim(` ... and ${model.variables.length - 10} more`);
40
- }
41
- process.exit(1);
42
- }
43
- logger_1.logger.header(`Variable: ${variable.name}`);
44
- console.log();
45
- if (variable.description) {
46
- console.log(` Description: ${variable.description}`);
47
- }
48
- if (variable.formula) {
49
- console.log(` Formula: ${variable.formula}`);
50
- }
51
- console.log(` Dimensions: ${variable.tables.join(', ')}`);
52
- if (variable.members.length > 0) {
53
- console.log(` Specific members: ${variable.members.join(', ')}`);
54
- }
55
- console.log(` Roll-up type: ${variable.rollupType}`);
56
- console.log(` Data type: ${variable.dataType}`);
57
- if (variable.numberFormat) {
58
- console.log(` Format: ${variable.numberFormat.type}${variable.numberFormat.formatString ? ` (${variable.numberFormat.formatString})` : ''}`);
59
- }
60
- console.log(` Readonly: ${variable.readonly}`);
61
- console.log(` Calculate on demand: ${variable.calculateOnDemand}`);
62
- if (variable.folderPath) {
63
- console.log(` Folder: ${variable.folderPath.join(' / ')}`);
64
- }
65
- if (variable.cells && variable.cells.length > 0) {
66
- console.log(` Cells with data: ${variable.cells.length}`);
67
- }
68
- return;
69
- }
70
- // Specific table details
71
- if (options.table) {
72
- const table = model.tables.find((t) => t.name.toLowerCase() === options.table.toLowerCase());
73
- if (!table) {
74
- logger_1.logger.error(`Table "${options.table}" not found.`);
75
- logger_1.logger.dim('Available tables:');
76
- model.tables.slice(0, 10).forEach((t) => logger_1.logger.dim(` - ${t.name}`));
77
- if (model.tables.length > 10) {
78
- logger_1.logger.dim(` ... and ${model.tables.length - 10} more`);
79
- }
80
- process.exit(1);
81
- }
82
- logger_1.logger.header(`Dimension Table: ${table.name}`);
83
- console.log();
84
- console.log(` Columns:`);
85
- table.columns.forEach((col, i) => {
86
- let colInfo = ` ${i + 1}. ${col.type}`;
87
- if (col.name)
88
- colInfo += ` (${col.name})`;
89
- if (col.foreignKeyTableName)
90
- colInfo += ` → ${col.foreignKeyTableName}`;
91
- console.log(colInfo);
92
- });
93
- console.log(` Members: ${table.rows.length}`);
94
- if (table.folderPath) {
95
- console.log(` Folder: ${table.folderPath.join(' / ')}`);
96
- }
97
- if (table.rows.length > 0) {
98
- console.log(` Sample members:`);
99
- table.rows.slice(0, 5).forEach((row) => {
100
- console.log(` - ${row[0]}`);
101
- });
102
- if (table.rows.length > 5) {
103
- console.log(` ... and ${table.rows.length - 5} more`);
104
- }
105
- }
106
- return;
107
- }
108
- // Tables only
109
- if (options.tables) {
110
- logger_1.logger.header(`Dimension Tables (${model.tables.length})`);
111
- console.log();
112
- for (const table of model.tables) {
113
- const fkColumns = table.columns.filter((c) => c.type === 'FOREIGN_KEY');
114
- let info = ` 📋 ${table.name} (${table.rows.length} members)`;
115
- if (fkColumns.length > 0) {
116
- info += ` → ${fkColumns.map((c) => c.foreignKeyTableName).join(', ')}`;
117
- }
118
- console.log(info);
119
- }
120
- return;
121
- }
122
- // Variables only
123
- if (options.variables) {
124
- logger_1.logger.header(`Variables (${model.variables.length})`);
125
- console.log();
126
- for (const variable of model.variables) {
127
- console.log(` 📊 ${variable.name}`);
128
- console.log(` Dimensions: ${variable.tables.join(', ')}`);
129
- if (variable.formula) {
130
- console.log(` Formula: ${variable.formula.substring(0, 50)}${variable.formula.length > 50 ? '...' : ''}`);
131
- }
132
- console.log();
133
- }
134
- return;
135
- }
136
- // Default: summary
137
- logger_1.logger.header(`Model Summary for ${tenant}`);
138
- console.log();
139
- console.log(` Dimension Tables: ${model.tables.length}`);
140
- console.log(` Variables: ${model.variables.length}`);
141
- console.log();
142
- logger_1.logger.dim('Dimension Tables:');
143
- model.tables.slice(0, 10).forEach((t) => {
144
- logger_1.logger.dim(` - ${t.name} (${t.rows.length} members)`);
145
- });
146
- if (model.tables.length > 10) {
147
- logger_1.logger.dim(` ... and ${model.tables.length - 10} more`);
148
- }
149
- console.log();
150
- logger_1.logger.dim('Variables (first 10):');
151
- model.variables.slice(0, 10).forEach((v) => {
152
- logger_1.logger.dim(` - ${v.name} [${v.tables.join(', ')}]`);
153
- });
154
- if (model.variables.length > 10) {
155
- logger_1.logger.dim(` ... and ${model.variables.length - 10} more`);
156
- }
157
- console.log();
158
- logger_1.logger.dim('Use --tables, --variables, --table <name>, or --variable <name> for details.');
159
- logger_1.logger.dim('Use --json for raw JSON output.');
55
+ import_logger.logger.header(`Variable: ${variable.name}`);
56
+ console.log();
57
+ if (variable.description) {
58
+ console.log(` Description: ${variable.description}`);
160
59
  }
161
- catch (error) {
162
- const errorMessage = error instanceof Error ? error.message : String(error);
163
- if ((0, farseerFactory_1.isAuthError)(error)) {
164
- (0, farseerFactory_1.showLoginPrompt)(tenant);
165
- }
166
- else if (errorMessage.includes('404')) {
167
- logger_1.logger.error(`Tenant "${tenant}" not found or not accessible.`);
168
- logger_1.logger.dim('Check that the tenant name is correct.');
169
- }
170
- else if (errorMessage.includes('ENOTFOUND') || errorMessage.includes('ECONNREFUSED')) {
171
- logger_1.logger.error('Failed to connect to Farseer.');
172
- logger_1.logger.dim('Check your network connection.');
173
- }
174
- else {
175
- logger_1.logger.error('Failed to export model.');
176
- logger_1.logger.dim(errorMessage);
177
- }
178
- process.exit(1);
60
+ if (variable.formula) {
61
+ console.log(` Formula: ${variable.formula}`);
179
62
  }
180
- });
63
+ console.log(` Dimensions: ${variable.tables.join(", ")}`);
64
+ if (variable.members.length > 0) {
65
+ console.log(` Specific members: ${variable.members.join(", ")}`);
66
+ }
67
+ console.log(` Roll-up type: ${variable.rollupType}`);
68
+ console.log(` Data type: ${variable.dataType}`);
69
+ if (variable.numberFormat) {
70
+ console.log(
71
+ ` Format: ${variable.numberFormat.type}${variable.numberFormat.formatString ? ` (${variable.numberFormat.formatString})` : ""}`
72
+ );
73
+ }
74
+ console.log(` Readonly: ${variable.readonly}`);
75
+ console.log(` Calculate on demand: ${variable.calculateOnDemand}`);
76
+ if (variable.folderPath) {
77
+ console.log(` Folder: ${variable.folderPath.join(" / ")}`);
78
+ }
79
+ if (variable.cells && variable.cells.length > 0) {
80
+ console.log(` Cells with data: ${variable.cells.length}`);
81
+ }
82
+ return;
83
+ }
84
+ if (options.table) {
85
+ const table = model.tables.find((t) => t.name.toLowerCase() === options.table.toLowerCase());
86
+ if (!table) {
87
+ import_logger.logger.error(`Table "${options.table}" not found.`);
88
+ import_logger.logger.dim("Available tables:");
89
+ model.tables.slice(0, 10).forEach((t) => import_logger.logger.dim(` - ${t.name}`));
90
+ if (model.tables.length > 10) {
91
+ import_logger.logger.dim(` ... and ${model.tables.length - 10} more`);
92
+ }
93
+ process.exit(1);
94
+ }
95
+ import_logger.logger.header(`Dimension Table: ${table.name}`);
96
+ console.log();
97
+ console.log(` Columns:`);
98
+ table.columns.forEach((col, i) => {
99
+ let colInfo = ` ${i + 1}. ${col.type}`;
100
+ if (col.name) colInfo += ` (${col.name})`;
101
+ if (col.foreignKeyTableName) colInfo += ` \u2192 ${col.foreignKeyTableName}`;
102
+ console.log(colInfo);
103
+ });
104
+ console.log(` Members: ${table.rows.length}`);
105
+ if (table.folderPath) {
106
+ console.log(` Folder: ${table.folderPath.join(" / ")}`);
107
+ }
108
+ if (table.rows.length > 0) {
109
+ console.log(` Sample members:`);
110
+ table.rows.slice(0, 5).forEach((row) => {
111
+ console.log(` - ${row[0]}`);
112
+ });
113
+ if (table.rows.length > 5) {
114
+ console.log(` ... and ${table.rows.length - 5} more`);
115
+ }
116
+ }
117
+ return;
118
+ }
119
+ if (options.tables) {
120
+ import_logger.logger.header(`Dimension Tables (${model.tables.length})`);
121
+ console.log();
122
+ for (const table of model.tables) {
123
+ const fkColumns = table.columns.filter((c) => c.type === "FOREIGN_KEY");
124
+ let info = ` \u{1F4CB} ${table.name} (${table.rows.length} members)`;
125
+ if (fkColumns.length > 0) {
126
+ info += ` \u2192 ${fkColumns.map((c) => c.foreignKeyTableName).join(", ")}`;
127
+ }
128
+ console.log(info);
129
+ }
130
+ return;
131
+ }
132
+ if (options.variables) {
133
+ import_logger.logger.header(`Variables (${model.variables.length})`);
134
+ console.log();
135
+ for (const variable of model.variables) {
136
+ console.log(` \u{1F4CA} ${variable.name}`);
137
+ console.log(` Dimensions: ${variable.tables.join(", ")}`);
138
+ if (variable.formula) {
139
+ console.log(
140
+ ` Formula: ${variable.formula.substring(0, 50)}${variable.formula.length > 50 ? "..." : ""}`
141
+ );
142
+ }
143
+ console.log();
144
+ }
145
+ return;
146
+ }
147
+ import_logger.logger.header(`Model Summary for ${tenant}`);
148
+ console.log();
149
+ console.log(` Dimension Tables: ${model.tables.length}`);
150
+ console.log(` Variables: ${model.variables.length}`);
151
+ console.log();
152
+ import_logger.logger.dim("Dimension Tables:");
153
+ model.tables.slice(0, 10).forEach((t) => {
154
+ import_logger.logger.dim(` - ${t.name} (${t.rows.length} members)`);
155
+ });
156
+ if (model.tables.length > 10) {
157
+ import_logger.logger.dim(` ... and ${model.tables.length - 10} more`);
158
+ }
159
+ console.log();
160
+ import_logger.logger.dim("Variables (first 10):");
161
+ model.variables.slice(0, 10).forEach((v) => {
162
+ import_logger.logger.dim(` - ${v.name} [${v.tables.join(", ")}]`);
163
+ });
164
+ if (model.variables.length > 10) {
165
+ import_logger.logger.dim(` ... and ${model.variables.length - 10} more`);
166
+ }
167
+ console.log();
168
+ import_logger.logger.dim("Use --tables, --variables, --table <name>, or --variable <name> for details.");
169
+ import_logger.logger.dim("Use --json for raw JSON output.");
170
+ } catch (error) {
171
+ const errorMessage = error instanceof Error ? error.message : String(error);
172
+ if ((0, import_farseerFactory.isAuthError)(error)) {
173
+ (0, import_farseerFactory.showLoginPrompt)(tenant);
174
+ } else if (errorMessage.includes("404")) {
175
+ import_logger.logger.error(`Tenant "${tenant}" not found or not accessible.`);
176
+ import_logger.logger.dim("Check that the tenant name is correct.");
177
+ } else if (errorMessage.includes("ENOTFOUND") || errorMessage.includes("ECONNREFUSED")) {
178
+ import_logger.logger.error("Failed to connect to Farseer.");
179
+ import_logger.logger.dim("Check your network connection.");
180
+ } else {
181
+ import_logger.logger.error("Failed to export model.");
182
+ import_logger.logger.dim(errorMessage);
183
+ }
184
+ process.exit(1);
185
+ }
186
+ });
181
187
  }
188
+ // Annotate the CommonJS export names for ESM import in node:
189
+ 0 && (module.exports = {
190
+ registerModelCommand
191
+ });
192
+ //# sourceMappingURL=model.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/commands/model.ts"],
4
+ "sourcesContent": ["import { Command } from 'commander';\nimport { logger } from '../utils/logger';\nimport { getFarseerClientWithFallback, showLoginPrompt, isAuthError } from '../services/farseerFactory';\nimport { resolveTenantWithOrgMapping } from '../utils/helpers';\n\nexport function registerModelCommand(program: Command): void {\n program\n .command('model [tenant]')\n .description('Export and display the model structure (dimensions, variables)')\n .option('--json', 'Output raw JSON')\n .option('--tables', 'Show only dimension tables')\n .option('--variables', 'Show only variables')\n .option('--variable <name>', 'Show details for specific variable')\n .option('--table <name>', 'Show details for specific dimension table')\n .action(async (tenantArg, options) => {\n const { organisation, tenant } = resolveTenantWithOrgMapping(tenantArg);\n const result = await getFarseerClientWithFallback(organisation, tenant);\n\n if (!result) {\n showLoginPrompt(tenant);\n process.exit(1);\n }\n\n const api = result.client;\n\n try {\n const model = await api.exportModel();\n\n // Raw JSON output\n if (options.json) {\n console.log(JSON.stringify(model, null, 2));\n return;\n }\n\n // Specific variable details\n if (options.variable) {\n const variable = model.variables.find(\n (v) => v.name.toLowerCase() === options.variable.toLowerCase(),\n );\n if (!variable) {\n logger.error(`Variable \"${options.variable}\" not found.`);\n logger.dim('Available variables:');\n model.variables.slice(0, 10).forEach((v) => logger.dim(` - ${v.name}`));\n if (model.variables.length > 10) {\n logger.dim(` ... and ${model.variables.length - 10} more`);\n }\n process.exit(1);\n }\n\n logger.header(`Variable: ${variable.name}`);\n console.log();\n if (variable.description) {\n console.log(` Description: ${variable.description}`);\n }\n if (variable.formula) {\n console.log(` Formula: ${variable.formula}`);\n }\n console.log(` Dimensions: ${variable.tables.join(', ')}`);\n if (variable.members.length > 0) {\n console.log(` Specific members: ${variable.members.join(', ')}`);\n }\n console.log(` Roll-up type: ${variable.rollupType}`);\n console.log(` Data type: ${variable.dataType}`);\n if (variable.numberFormat) {\n console.log(\n ` Format: ${variable.numberFormat.type}${variable.numberFormat.formatString ? ` (${variable.numberFormat.formatString})` : ''}`,\n );\n }\n console.log(` Readonly: ${variable.readonly}`);\n console.log(` Calculate on demand: ${variable.calculateOnDemand}`);\n if (variable.folderPath) {\n console.log(` Folder: ${variable.folderPath.join(' / ')}`);\n }\n if (variable.cells && variable.cells.length > 0) {\n console.log(` Cells with data: ${variable.cells.length}`);\n }\n return;\n }\n\n // Specific table details\n if (options.table) {\n const table = model.tables.find((t) => t.name.toLowerCase() === options.table.toLowerCase());\n if (!table) {\n logger.error(`Table \"${options.table}\" not found.`);\n logger.dim('Available tables:');\n model.tables.slice(0, 10).forEach((t) => logger.dim(` - ${t.name}`));\n if (model.tables.length > 10) {\n logger.dim(` ... and ${model.tables.length - 10} more`);\n }\n process.exit(1);\n }\n\n logger.header(`Dimension Table: ${table.name}`);\n console.log();\n console.log(` Columns:`);\n table.columns.forEach((col, i) => {\n let colInfo = ` ${i + 1}. ${col.type}`;\n if (col.name) colInfo += ` (${col.name})`;\n if (col.foreignKeyTableName) colInfo += ` \u2192 ${col.foreignKeyTableName}`;\n console.log(colInfo);\n });\n console.log(` Members: ${table.rows.length}`);\n if (table.folderPath) {\n console.log(` Folder: ${table.folderPath.join(' / ')}`);\n }\n if (table.rows.length > 0) {\n console.log(` Sample members:`);\n table.rows.slice(0, 5).forEach((row) => {\n console.log(` - ${row[0]}`);\n });\n if (table.rows.length > 5) {\n console.log(` ... and ${table.rows.length - 5} more`);\n }\n }\n return;\n }\n\n // Tables only\n if (options.tables) {\n logger.header(`Dimension Tables (${model.tables.length})`);\n console.log();\n for (const table of model.tables) {\n const fkColumns = table.columns.filter((c) => c.type === 'FOREIGN_KEY');\n let info = ` \uD83D\uDCCB ${table.name} (${table.rows.length} members)`;\n if (fkColumns.length > 0) {\n info += ` \u2192 ${fkColumns.map((c) => c.foreignKeyTableName).join(', ')}`;\n }\n console.log(info);\n }\n return;\n }\n\n // Variables only\n if (options.variables) {\n logger.header(`Variables (${model.variables.length})`);\n console.log();\n for (const variable of model.variables) {\n console.log(` \uD83D\uDCCA ${variable.name}`);\n console.log(` Dimensions: ${variable.tables.join(', ')}`);\n if (variable.formula) {\n console.log(\n ` Formula: ${variable.formula.substring(0, 50)}${variable.formula.length > 50 ? '...' : ''}`,\n );\n }\n console.log();\n }\n return;\n }\n\n // Default: summary\n logger.header(`Model Summary for ${tenant}`);\n console.log();\n console.log(` Dimension Tables: ${model.tables.length}`);\n console.log(` Variables: ${model.variables.length}`);\n console.log();\n\n logger.dim('Dimension Tables:');\n model.tables.slice(0, 10).forEach((t) => {\n logger.dim(` - ${t.name} (${t.rows.length} members)`);\n });\n if (model.tables.length > 10) {\n logger.dim(` ... and ${model.tables.length - 10} more`);\n }\n console.log();\n\n logger.dim('Variables (first 10):');\n model.variables.slice(0, 10).forEach((v) => {\n logger.dim(` - ${v.name} [${v.tables.join(', ')}]`);\n });\n if (model.variables.length > 10) {\n logger.dim(` ... and ${model.variables.length - 10} more`);\n }\n console.log();\n\n logger.dim('Use --tables, --variables, --table <name>, or --variable <name> for details.');\n logger.dim('Use --json for raw JSON output.');\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n\n if (isAuthError(error)) {\n showLoginPrompt(tenant);\n } else if (errorMessage.includes('404')) {\n logger.error(`Tenant \"${tenant}\" not found or not accessible.`);\n logger.dim('Check that the tenant name is correct.');\n } else if (errorMessage.includes('ENOTFOUND') || errorMessage.includes('ECONNREFUSED')) {\n logger.error('Failed to connect to Farseer.');\n logger.dim('Check your network connection.');\n } else {\n logger.error('Failed to export model.');\n logger.dim(errorMessage);\n }\n process.exit(1);\n }\n });\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAAuB;AACvB,4BAA2E;AAC3E,qBAA4C;AAErC,SAAS,qBAAqB,SAAwB;AACzD,UACK,QAAQ,gBAAgB,EACxB,YAAY,gEAAgE,EAC5E,OAAO,UAAU,iBAAiB,EAClC,OAAO,YAAY,4BAA4B,EAC/C,OAAO,eAAe,qBAAqB,EAC3C,OAAO,qBAAqB,oCAAoC,EAChE,OAAO,kBAAkB,2CAA2C,EACpE,OAAO,OAAO,WAAW,YAAY;AAClC,UAAM,EAAE,cAAc,OAAO,QAAI,4CAA4B,SAAS;AACtE,UAAM,SAAS,UAAM,oDAA6B,cAAc,MAAM;AAEtE,QAAI,CAAC,QAAQ;AACT,iDAAgB,MAAM;AACtB,cAAQ,KAAK,CAAC;AAAA,IAClB;AAEA,UAAM,MAAM,OAAO;AAEnB,QAAI;AACA,YAAM,QAAQ,MAAM,IAAI,YAAY;AAGpC,UAAI,QAAQ,MAAM;AACd,gBAAQ,IAAI,KAAK,UAAU,OAAO,MAAM,CAAC,CAAC;AAC1C;AAAA,MACJ;AAGA,UAAI,QAAQ,UAAU;AAClB,cAAM,WAAW,MAAM,UAAU;AAAA,UAC7B,CAAC,MAAM,EAAE,KAAK,YAAY,MAAM,QAAQ,SAAS,YAAY;AAAA,QACjE;AACA,YAAI,CAAC,UAAU;AACX,+BAAO,MAAM,aAAa,QAAQ,QAAQ,cAAc;AACxD,+BAAO,IAAI,sBAAsB;AACjC,gBAAM,UAAU,MAAM,GAAG,EAAE,EAAE,QAAQ,CAAC,MAAM,qBAAO,IAAI,OAAO,EAAE,IAAI,EAAE,CAAC;AACvE,cAAI,MAAM,UAAU,SAAS,IAAI;AAC7B,iCAAO,IAAI,a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