farseer-cli 1.0.8 → 1.0.9
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/dist/commands/app.js +349 -0
- package/dist/commands/app.js.map +7 -0
- package/dist/commands/apps.js +111 -0
- package/dist/commands/apps.js.map +7 -0
- package/dist/commands/checkout.js +142 -0
- package/dist/commands/checkout.js.map +7 -0
- package/dist/commands/config.js +139 -0
- package/dist/commands/config.js.map +7 -0
- package/dist/commands/diff.js +185 -0
- package/dist/commands/diff.js.map +7 -0
- package/dist/commands/dimensions.js +145 -0
- package/dist/commands/dimensions.js.map +7 -0
- package/dist/commands/files.js +99 -0
- package/dist/commands/files.js.map +7 -0
- package/dist/commands/install.js +79 -0
- package/dist/commands/install.js.map +7 -0
- package/dist/commands/list.js +92 -0
- package/dist/commands/list.js.map +7 -0
- package/dist/commands/login.js +134 -0
- package/dist/commands/login.js.map +7 -0
- package/dist/commands/logout.js +59 -0
- package/dist/commands/logout.js.map +7 -0
- package/dist/commands/mcp-server.js +41 -0
- package/dist/commands/mcp-server.js.map +7 -0
- package/dist/commands/model.js +189 -0
- package/dist/commands/model.js.map +7 -0
- package/dist/commands/pull.js +258 -0
- package/dist/commands/pull.js.map +7 -0
- package/dist/commands/push.js +213 -0
- package/dist/commands/push.js.map +7 -0
- package/dist/commands/run.js +288 -0
- package/dist/commands/run.js.map +7 -0
- package/dist/commands/status.js +155 -0
- package/dist/commands/status.js.map +7 -0
- package/dist/commands/variables.js +176 -0
- package/dist/commands/variables.js.map +7 -0
- package/dist/commands/whoami.js +63 -0
- package/dist/commands/whoami.js.map +7 -0
- package/dist/index.js +165 -0
- package/dist/index.js.map +7 -0
- package/dist/mcp/index.js +35 -0
- package/dist/mcp/index.js.map +7 -0
- package/dist/mcp/prompts/workflows.js +448 -0
- package/dist/mcp/prompts/workflows.js.map +7 -0
- package/dist/mcp/resources/documentation.js +167 -0
- package/dist/mcp/resources/documentation.js.map +7 -0
- package/dist/mcp/server.js +52 -0
- package/dist/mcp/server.js.map +7 -0
- package/dist/mcp/tools/appTools.js +377 -0
- package/dist/mcp/tools/appTools.js.map +7 -0
- package/dist/mcp/tools/authTools.js +159 -0
- package/dist/mcp/tools/authTools.js.map +7 -0
- package/dist/mcp/tools/dataTools.js +362 -0
- package/dist/mcp/tools/dataTools.js.map +7 -0
- package/dist/mcp/tools/modelTools.js +325 -0
- package/dist/mcp/tools/modelTools.js.map +7 -0
- package/dist/mcp/tools/runTools.js +233 -0
- package/dist/mcp/tools/runTools.js.map +7 -0
- package/dist/mcp/tools/syncTools.js +409 -0
- package/dist/mcp/tools/syncTools.js.map +7 -0
- package/dist/mcp/utils/helpers.js +135 -0
- package/dist/mcp/utils/helpers.js.map +7 -0
- package/dist/services/appSyncService.js +399 -0
- package/dist/services/appSyncService.js.map +7 -0
- package/dist/services/configService.js +196 -0
- package/dist/services/configService.js.map +7 -0
- package/dist/services/farseerApi.js +426 -0
- package/dist/services/farseerApi.js.map +7 -0
- package/dist/services/farseerFactory.js +231 -0
- package/dist/services/farseerFactory.js.map +7 -0
- package/dist/services/farseerService.js +614 -0
- package/dist/services/farseerService.js.map +7 -0
- package/dist/services/syncService.js +689 -0
- package/dist/services/syncService.js.map +7 -0
- package/dist/utils/constants.js +46 -0
- package/dist/utils/constants.js.map +7 -0
- package/dist/utils/helpers.js +413 -0
- package/dist/utils/helpers.js.map +7 -0
- package/dist/utils/logger.js +76 -0
- package/dist/utils/logger.js.map +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var status_exports = {};
|
|
29
|
+
__export(status_exports, {
|
|
30
|
+
registerStatusCommand: () => registerStatusCommand
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(status_exports);
|
|
33
|
+
var import_chalk = __toESM(require("chalk"));
|
|
34
|
+
var import_logger = require("../utils/logger");
|
|
35
|
+
var import_farseerFactory = require("../services/farseerFactory");
|
|
36
|
+
var import_syncService = require("../services/syncService");
|
|
37
|
+
var import_appSyncService = require("../services/appSyncService");
|
|
38
|
+
var import_helpers = require("../utils/helpers");
|
|
39
|
+
var fs = __toESM(require("fs"));
|
|
40
|
+
function registerStatusCommand(program) {
|
|
41
|
+
program.command("status [org] [tenant]").description("Show sync status between local and remote\n\nUsage: status <org> <tenant> OR status <tenant> (if org is known)").option("--all", "Show status for all files (default: only scripts .ts, .js)").action(async (arg1, arg2, options) => {
|
|
42
|
+
const { organisation, tenant } = (0, import_helpers.resolveTenantWithOrgMapping)(arg1, arg2);
|
|
43
|
+
const clientResult = await (0, import_farseerFactory.getFarseerClientWithFallback)(organisation, tenant);
|
|
44
|
+
if (!clientResult) {
|
|
45
|
+
(0, import_farseerFactory.showLoginPrompt)(tenant);
|
|
46
|
+
process.exit(1);
|
|
47
|
+
}
|
|
48
|
+
const filesDir = (0, import_helpers.getTenantFilesDir)(tenant);
|
|
49
|
+
if (!fs.existsSync(filesDir)) {
|
|
50
|
+
import_logger.logger.warning(`Local folder not found: apps/${tenant}/files/`);
|
|
51
|
+
import_logger.logger.dim('Run "farseer pull <tenant>" to download files from the instance.');
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
import_logger.logger.info(`Comparing local (apps/${tenant}/files/) with remote (Files/)...`);
|
|
55
|
+
console.log();
|
|
56
|
+
const syncService = new import_syncService.SyncService(tenant, clientResult.client);
|
|
57
|
+
try {
|
|
58
|
+
const status = await syncService.getStatus({ all: options.all });
|
|
59
|
+
const hasChanges = status.modifiedLocally.length > 0 || status.modifiedRemotely.length > 0 || status.onlyLocal.length > 0 || status.onlyRemote.length > 0 || status.conflicts && status.conflicts.length > 0;
|
|
60
|
+
if (!hasChanges) {
|
|
61
|
+
import_logger.logger.success("Everything is in sync!");
|
|
62
|
+
import_logger.logger.dim(`${status.inSync.length} file(s) synchronized.`);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (status.modifiedLocally.length > 0) {
|
|
66
|
+
console.log(import_chalk.default.yellow("Modified locally:"));
|
|
67
|
+
for (const file of status.modifiedLocally) {
|
|
68
|
+
console.log(import_chalk.default.yellow(` M ${file}`));
|
|
69
|
+
}
|
|
70
|
+
console.log();
|
|
71
|
+
}
|
|
72
|
+
if (status.modifiedRemotely.length > 0) {
|
|
73
|
+
console.log(import_chalk.default.cyan("Modified on remote:"));
|
|
74
|
+
const syncState = syncService.loadSyncState();
|
|
75
|
+
for (const file of status.modifiedRemotely) {
|
|
76
|
+
const metadata = syncState.files[file]?.metadata;
|
|
77
|
+
const uploaderInfo = metadata?.uploaderName ? ` (by ${metadata.uploaderName})` : metadata?.uploaderEmail ? ` (by ${metadata.uploaderEmail})` : "";
|
|
78
|
+
console.log(import_chalk.default.cyan(` M ${file}`) + import_chalk.default.dim(uploaderInfo));
|
|
79
|
+
}
|
|
80
|
+
console.log();
|
|
81
|
+
}
|
|
82
|
+
if (status.onlyLocal.length > 0) {
|
|
83
|
+
console.log(import_chalk.default.green("Only local (new):"));
|
|
84
|
+
for (const file of status.onlyLocal) {
|
|
85
|
+
console.log(import_chalk.default.green(` + ${file}`));
|
|
86
|
+
}
|
|
87
|
+
console.log();
|
|
88
|
+
}
|
|
89
|
+
if (status.onlyRemote.length > 0) {
|
|
90
|
+
console.log(import_chalk.default.red("Only on remote:"));
|
|
91
|
+
for (const file of status.onlyRemote) {
|
|
92
|
+
console.log(import_chalk.default.red(` - ${file}`));
|
|
93
|
+
}
|
|
94
|
+
console.log();
|
|
95
|
+
}
|
|
96
|
+
if (status.conflicts && status.conflicts.length > 0) {
|
|
97
|
+
console.log(import_chalk.default.red.bold("CONFLICTS:"));
|
|
98
|
+
for (const conflict of status.conflicts) {
|
|
99
|
+
console.log(import_chalk.default.red(` ! ${conflict.filePath}`));
|
|
100
|
+
console.log(import_chalk.default.dim(` ${conflict.description}`));
|
|
101
|
+
}
|
|
102
|
+
console.log();
|
|
103
|
+
import_logger.logger.dim(`Resolve conflicts during pull: farseer pull ${tenant}`);
|
|
104
|
+
console.log();
|
|
105
|
+
}
|
|
106
|
+
const appSyncService = new import_appSyncService.AppSyncService(tenant, clientResult.client);
|
|
107
|
+
const appStatus = await appSyncService.getStatus();
|
|
108
|
+
const hasAppChanges = appStatus.newLocal.length > 0 || appStatus.newRemote.length > 0 || appStatus.modified.length > 0;
|
|
109
|
+
if (hasAppChanges) {
|
|
110
|
+
console.log(import_chalk.default.bold("Apps:"));
|
|
111
|
+
console.log();
|
|
112
|
+
if (appStatus.newLocal.length > 0) {
|
|
113
|
+
console.log(import_chalk.default.green("New local apps (to be created on remote):"));
|
|
114
|
+
for (const app of appStatus.newLocal) {
|
|
115
|
+
console.log(import_chalk.default.green(` + ${app}`));
|
|
116
|
+
}
|
|
117
|
+
console.log();
|
|
118
|
+
}
|
|
119
|
+
if (appStatus.newRemote.length > 0) {
|
|
120
|
+
console.log(import_chalk.default.cyan("New remote apps (to be downloaded):"));
|
|
121
|
+
for (const app of appStatus.newRemote) {
|
|
122
|
+
console.log(import_chalk.default.cyan(` + ${app}`));
|
|
123
|
+
}
|
|
124
|
+
console.log();
|
|
125
|
+
}
|
|
126
|
+
if (appStatus.modified.length > 0) {
|
|
127
|
+
console.log(import_chalk.default.yellow("Modified apps:"));
|
|
128
|
+
for (const app of appStatus.modified) {
|
|
129
|
+
console.log(import_chalk.default.yellow(` ~ ${app}`));
|
|
130
|
+
}
|
|
131
|
+
console.log();
|
|
132
|
+
}
|
|
133
|
+
if (appStatus.synced.length > 0) {
|
|
134
|
+
import_logger.logger.dim(`${appStatus.synced.length} app(s) in sync.`);
|
|
135
|
+
}
|
|
136
|
+
} else if (appStatus.synced.length > 0) {
|
|
137
|
+
import_logger.logger.dim(`${appStatus.synced.length} app(s) in sync.`);
|
|
138
|
+
}
|
|
139
|
+
console.log();
|
|
140
|
+
import_logger.logger.dim('Use "farseer push <tenant>" to upload local changes.');
|
|
141
|
+
import_logger.logger.dim('Use "farseer pull <tenant>" to download remote changes.');
|
|
142
|
+
} catch (error) {
|
|
143
|
+
import_logger.logger.error("Failed to check status.");
|
|
144
|
+
if (error instanceof Error) {
|
|
145
|
+
import_logger.logger.dim(error.message);
|
|
146
|
+
}
|
|
147
|
+
process.exit(1);
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
152
|
+
0 && (module.exports = {
|
|
153
|
+
registerStatusCommand
|
|
154
|
+
});
|
|
155
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/commands/status.ts"],
|
|
4
|
+
"sourcesContent": ["import { Command } from 'commander';\nimport chalk from 'chalk';\nimport { logger } from '../utils/logger';\nimport { getFarseerClientWithFallback, showLoginPrompt } from '../services/farseerFactory';\nimport { SyncService } from '../services/syncService';\nimport { AppSyncService } from '../services/appSyncService';\nimport { getTenantFilesDir, resolveTenantWithOrgMapping } from '../utils/helpers';\nimport * as fs from 'fs';\n\nexport function registerStatusCommand(program: Command): void {\n program\n .command('status [org] [tenant]')\n .description('Show sync status between local and remote\\n\\nUsage: status <org> <tenant> OR status <tenant> (if org is known)')\n .option('--all', 'Show status for all files (default: only scripts .ts, .js)')\n .action(async (arg1, arg2, options) => {\n const { organisation, tenant } = resolveTenantWithOrgMapping(arg1, arg2);\n const clientResult = await getFarseerClientWithFallback(organisation, tenant);\n\n if (!clientResult) {\n showLoginPrompt(tenant);\n process.exit(1);\n }\n\n const filesDir = getTenantFilesDir(tenant);\n\n if (!fs.existsSync(filesDir)) {\n logger.warning(`Local folder not found: apps/${tenant}/files/`);\n logger.dim('Run \"farseer pull <tenant>\" to download files from the instance.');\n return;\n }\n\n logger.info(`Comparing local (apps/${tenant}/files/) with remote (Files/)...`);\n console.log();\n\n const syncService = new SyncService(tenant, clientResult.client);\n\n try {\n const status = await syncService.getStatus({ all: options.all });\n\n const hasChanges =\n status.modifiedLocally.length > 0 ||\n status.modifiedRemotely.length > 0 ||\n status.onlyLocal.length > 0 ||\n status.onlyRemote.length > 0 ||\n (status.conflicts && status.conflicts.length > 0);\n\n if (!hasChanges) {\n logger.success('Everything is in sync!');\n logger.dim(`${status.inSync.length} file(s) synchronized.`);\n return;\n }\n\n // Modified locally\n if (status.modifiedLocally.length > 0) {\n console.log(chalk.yellow('Modified locally:'));\n for (const file of status.modifiedLocally) {\n console.log(chalk.yellow(` M ${file}`));\n }\n console.log();\n }\n\n // Modified remotely\n if (status.modifiedRemotely.length > 0) {\n console.log(chalk.cyan('Modified on remote:'));\n const syncState = syncService.loadSyncState();\n\n for (const file of status.modifiedRemotely) {\n const metadata = syncState.files[file]?.metadata;\n const uploaderInfo = metadata?.uploaderName\n ? ` (by ${metadata.uploaderName})`\n : metadata?.uploaderEmail\n ? ` (by ${metadata.uploaderEmail})`\n : '';\n\n console.log(chalk.cyan(` M ${file}`) + chalk.dim(uploaderInfo));\n }\n console.log();\n }\n\n // Only local (new files)\n if (status.onlyLocal.length > 0) {\n console.log(chalk.green('Only local (new):'));\n for (const file of status.onlyLocal) {\n console.log(chalk.green(` + ${file}`));\n }\n console.log();\n }\n\n // Only remote (not downloaded)\n if (status.onlyRemote.length > 0) {\n console.log(chalk.red('Only on remote:'));\n for (const file of status.onlyRemote) {\n console.log(chalk.red(` - ${file}`));\n }\n console.log();\n }\n\n // Conflicts\n if (status.conflicts && status.conflicts.length > 0) {\n console.log(chalk.red.bold('CONFLICTS:'));\n for (const conflict of status.conflicts) {\n console.log(chalk.red(` ! ${conflict.filePath}`));\n console.log(chalk.dim(` ${conflict.description}`));\n }\n console.log();\n logger.dim(`Resolve conflicts during pull: farseer pull ${tenant}`);\n console.log();\n }\n\n // Apps status (works with both JWT and API key)\n const appSyncService = new AppSyncService(tenant, clientResult.client);\n const appStatus = await appSyncService.getStatus();\n\n const hasAppChanges =\n appStatus.newLocal.length > 0 ||\n appStatus.newRemote.length > 0 ||\n appStatus.modified.length > 0;\n\n if (hasAppChanges) {\n console.log(chalk.bold('Apps:'));\n console.log();\n\n if (appStatus.newLocal.length > 0) {\n console.log(chalk.green('New local apps (to be created on remote):'));\n for (const app of appStatus.newLocal) {\n console.log(chalk.green(` + ${app}`));\n }\n console.log();\n }\n\n if (appStatus.newRemote.length > 0) {\n console.log(chalk.cyan('New remote apps (to be downloaded):'));\n for (const app of appStatus.newRemote) {\n console.log(chalk.cyan(` + ${app}`));\n }\n console.log();\n }\n\n if (appStatus.modified.length > 0) {\n console.log(chalk.yellow('Modified apps:'));\n for (const app of appStatus.modified) {\n console.log(chalk.yellow(` ~ ${app}`));\n }\n console.log();\n }\n\n if (appStatus.synced.length > 0) {\n logger.dim(`${appStatus.synced.length} app(s) in sync.`);\n }\n } else if (appStatus.synced.length > 0) {\n logger.dim(`${appStatus.synced.length} app(s) in sync.`);\n }\n\n // Summary\n console.log();\n logger.dim('Use \"farseer push <tenant>\" to upload local changes.');\n logger.dim('Use \"farseer pull <tenant>\" to download remote changes.');\n } catch (error) {\n logger.error('Failed to check status.');\n if (error instanceof Error) {\n logger.dim(error.message);\n }\n process.exit(1);\n }\n });\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAkB;AAClB,oBAAuB;AACvB,4BAA8D;AAC9D,yBAA4B;AAC5B,4BAA+B;AAC/B,qBAA+D;AAC/D,SAAoB;AAEb,SAAS,sBAAsB,SAAwB;AAC1D,UACK,QAAQ,uBAAuB,EAC/B,YAAY,gHAAgH,EAC5H,OAAO,SAAS,4DAA4D,EAC5E,OAAO,OAAO,MAAM,MAAM,YAAY;AACnC,UAAM,EAAE,cAAc,OAAO,QAAI,4CAA4B,MAAM,IAAI;AACvE,UAAM,eAAe,UAAM,oDAA6B,cAAc,MAAM;AAE5E,QAAI,CAAC,cAAc;AACf,iDAAgB,MAAM;AACtB,cAAQ,KAAK,CAAC;AAAA,IAClB;AAEA,UAAM,eAAW,kCAAkB,MAAM;AAEzC,QAAI,CAAC,GAAG,WAAW,QAAQ,GAAG;AAC1B,2BAAO,QAAQ,gCAAgC,MAAM,SAAS;AAC9D,2BAAO,IAAI,kEAAkE;AAC7E;AAAA,IACJ;AAEA,yBAAO,KAAK,yBAAyB,MAAM,kCAAkC;AAC7E,YAAQ,IAAI;AAEZ,UAAM,cAAc,IAAI,+BAA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M,KAAK,qCAAqC,CAAC;AAC7D,qBAAW,OAAO,UAAU,WAAW;AACnC,oBAAQ,IAAI,aAAAA,QAAM,KAAK,OAAO,GAAG,EAAE,CAAC;AAAA,UACxC;AACA,kBAAQ,IAAI;AAAA,QAChB;AAEA,YAAI,UAAU,SAAS,SAAS,GAAG;AAC/B,kBAAQ,IAAI,aAAAA,QAAM,OAAO,gBAAgB,CAAC;AAC1C,qBAAW,OAAO,UAAU,UAAU;AAClC,oBAAQ,IAAI,aAAAA,QAAM,OAAO,OAAO,GAAG,EAAE,CAAC;AAAA,UAC1C;AACA,kBAAQ,IAAI;AAAA,QAChB;AAEA,YAAI,UAAU,OAAO,SAAS,GAAG;AAC7B,+BAAO,IAAI,GAAG,UAAU,OAAO,MAAM,kBAAkB;AAAA,QAC3D;AAAA,MACJ,WAAW,UAAU,OAAO,SAAS,GAAG;AACpC,6BAAO,IAAI,GAAG,UAAU,OAAO,MAAM,kBAAkB;AAAA,MAC3D;AAGA,cAAQ,IAAI;AACZ,2BAAO,IAAI,sDAAsD;AACjE,2BAAO,IAAI,yDAAyD;AAAA,IACxE,SAAS,OAAO;AACZ,2BAAO,MAAM,yBAAyB;AACtC,UAAI,iBAAiB,OAAO;AACxB,6BAAO,IAAI,MAAM,OAAO;AAAA,MAC5B;AACA,cAAQ,KAAK,CAAC;AAAA,IAClB;AAAA,EACJ,CAAC;AACT;",
|
|
6
|
+
"names": ["chalk"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var variables_exports = {};
|
|
29
|
+
__export(variables_exports, {
|
|
30
|
+
registerVariablesCommand: () => registerVariablesCommand
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(variables_exports);
|
|
33
|
+
var fs = __toESM(require("fs"));
|
|
34
|
+
var import_chalk = __toESM(require("chalk"));
|
|
35
|
+
var import_logger = require("../utils/logger");
|
|
36
|
+
var import_farseerFactory = require("../services/farseerFactory");
|
|
37
|
+
var import_helpers = require("../utils/helpers");
|
|
38
|
+
function registerVariablesCommand(program) {
|
|
39
|
+
const variablesCmd = program.command("variables").description("List and manage variables");
|
|
40
|
+
variablesCmd.command("list [org] [tenant]").description("List all variables").option("--json", "Output raw JSON").action(async (first, second, options) => {
|
|
41
|
+
const { organisation, tenant } = (0, import_helpers.resolveTenantWithOrgMapping)(first, second);
|
|
42
|
+
const result = await (0, import_farseerFactory.getFarseerClientWithFallback)(organisation, tenant);
|
|
43
|
+
if (!result) {
|
|
44
|
+
(0, import_farseerFactory.showLoginPrompt)(tenant);
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
try {
|
|
48
|
+
const model = await result.client.exportModel();
|
|
49
|
+
if (options.json) {
|
|
50
|
+
console.log(JSON.stringify(model.variables, null, 2));
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
import_logger.logger.header(`Variables (${model.variables.length})`);
|
|
54
|
+
console.log();
|
|
55
|
+
for (const variable of model.variables) {
|
|
56
|
+
const flags = [];
|
|
57
|
+
if (variable.readonly) flags.push("readonly");
|
|
58
|
+
if (variable.calculateOnDemand) flags.push("on-demand");
|
|
59
|
+
const flagStr = flags.length > 0 ? import_chalk.default.dim(` [${flags.join(", ")}]`) : "";
|
|
60
|
+
console.log(` ${import_chalk.default.bold(variable.name)}${flagStr}`);
|
|
61
|
+
console.log(` Dimensions: ${variable.tables.join(", ")}`);
|
|
62
|
+
console.log(` Rollup: ${variable.rollupType} | Type: ${variable.dataType}`);
|
|
63
|
+
if (variable.formula) {
|
|
64
|
+
console.log(` Formula: ${import_chalk.default.dim(variable.formula.substring(0, 80))}${variable.formula.length > 80 ? "..." : ""}`);
|
|
65
|
+
}
|
|
66
|
+
console.log();
|
|
67
|
+
}
|
|
68
|
+
} catch (error) {
|
|
69
|
+
handleModelError(error, tenant);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
const variableCmd = program.command("variable").description("Variable details and export");
|
|
73
|
+
variableCmd.command("details <name>").description("Show variable details (dimensions, formula, rollup, etc.)").option("--json", "Output raw JSON").action(async (name, options) => {
|
|
74
|
+
const { organisation, tenant } = (0, import_helpers.resolveTenantWithOrgMapping)();
|
|
75
|
+
const result = await (0, import_farseerFactory.getFarseerClientWithFallback)(organisation, tenant);
|
|
76
|
+
if (!result) {
|
|
77
|
+
(0, import_farseerFactory.showLoginPrompt)(tenant);
|
|
78
|
+
process.exit(1);
|
|
79
|
+
}
|
|
80
|
+
try {
|
|
81
|
+
const model = await result.client.exportModel();
|
|
82
|
+
const variable = model.variables.find(
|
|
83
|
+
(v) => v.name.toLowerCase() === name.toLowerCase()
|
|
84
|
+
);
|
|
85
|
+
if (!variable) {
|
|
86
|
+
import_logger.logger.error(`Variable "${name}" not found.`);
|
|
87
|
+
import_logger.logger.dim("Available variables:");
|
|
88
|
+
model.variables.slice(0, 10).forEach((v) => import_logger.logger.dim(` - ${v.name}`));
|
|
89
|
+
if (model.variables.length > 10) {
|
|
90
|
+
import_logger.logger.dim(` ... and ${model.variables.length - 10} more`);
|
|
91
|
+
}
|
|
92
|
+
process.exit(1);
|
|
93
|
+
}
|
|
94
|
+
if (options.json) {
|
|
95
|
+
console.log(JSON.stringify(variable, null, 2));
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
import_logger.logger.header(`Variable: ${variable.name}`);
|
|
99
|
+
console.log();
|
|
100
|
+
if (variable.description) {
|
|
101
|
+
console.log(` Description: ${variable.description}`);
|
|
102
|
+
}
|
|
103
|
+
if (variable.formula) {
|
|
104
|
+
console.log(` Formula: ${variable.formula}`);
|
|
105
|
+
}
|
|
106
|
+
console.log(` Dimensions: ${variable.tables.join(", ")}`);
|
|
107
|
+
if (variable.members.length > 0) {
|
|
108
|
+
console.log(` Specific members: ${variable.members.join(", ")}`);
|
|
109
|
+
}
|
|
110
|
+
console.log(` Roll-up type: ${variable.rollupType}`);
|
|
111
|
+
console.log(` Data type: ${variable.dataType}`);
|
|
112
|
+
if (variable.numberFormat) {
|
|
113
|
+
console.log(` Format: ${variable.numberFormat.type}${variable.numberFormat.formatString ? ` (${variable.numberFormat.formatString})` : ""}`);
|
|
114
|
+
}
|
|
115
|
+
console.log(` Readonly: ${variable.readonly}`);
|
|
116
|
+
console.log(` Calculate on demand: ${variable.calculateOnDemand}`);
|
|
117
|
+
if (variable.folderPath) {
|
|
118
|
+
console.log(` Folder: ${variable.folderPath.join(" / ")}`);
|
|
119
|
+
}
|
|
120
|
+
if (variable.cells && variable.cells.length > 0) {
|
|
121
|
+
console.log(` Cells with data: ${variable.cells.length}`);
|
|
122
|
+
}
|
|
123
|
+
} catch (error) {
|
|
124
|
+
handleModelError(error, tenant);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
variableCmd.command("export <name>").description("Export variable data to CSV file").option("--output <file>", "Output file path").option("--format <format>", "Output format: csv, json, xlsx", "csv").option("--limit <n>", "Limit number of rows", parseInt).action(async (name, options) => {
|
|
128
|
+
const { organisation, tenant } = (0, import_helpers.resolveTenantWithOrgMapping)();
|
|
129
|
+
const nativeClient = await (0, import_farseerFactory.getNativeFarseerClient)(organisation, tenant);
|
|
130
|
+
if (!nativeClient) {
|
|
131
|
+
(0, import_farseerFactory.showLoginPrompt)(tenant);
|
|
132
|
+
process.exit(1);
|
|
133
|
+
}
|
|
134
|
+
try {
|
|
135
|
+
import_logger.logger.info(`Exporting variable "${name}" from ${tenant}...`);
|
|
136
|
+
const exportRequest = {
|
|
137
|
+
formula: name,
|
|
138
|
+
format: options.format || "csv"
|
|
139
|
+
};
|
|
140
|
+
if (options.limit) {
|
|
141
|
+
exportRequest.limit = options.limit;
|
|
142
|
+
}
|
|
143
|
+
const blob = await nativeClient.export.exportFormula(exportRequest);
|
|
144
|
+
const content = await blob.text();
|
|
145
|
+
const outputFile = options.output || `${name.replace(/[^a-zA-Z0-9_-]/g, "_")}.${options.format || "csv"}`;
|
|
146
|
+
fs.writeFileSync(outputFile, content, "utf-8");
|
|
147
|
+
import_logger.logger.success(`Exported to ${outputFile}`);
|
|
148
|
+
const lines = content.split("\n").filter((l) => l.trim()).length;
|
|
149
|
+
import_logger.logger.dim(`${lines - 1} data rows`);
|
|
150
|
+
} catch (error) {
|
|
151
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
152
|
+
import_logger.logger.error(`Failed to export variable "${name}".`);
|
|
153
|
+
import_logger.logger.dim(errorMessage);
|
|
154
|
+
process.exit(1);
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
function handleModelError(error, tenant) {
|
|
159
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
160
|
+
if ((0, import_farseerFactory.isAuthError)(error)) {
|
|
161
|
+
(0, import_farseerFactory.showLoginPrompt)(tenant);
|
|
162
|
+
} else if (errorMessage.includes("404")) {
|
|
163
|
+
import_logger.logger.error(`Tenant "${tenant}" not found or not accessible.`);
|
|
164
|
+
} else if (errorMessage.includes("ENOTFOUND") || errorMessage.includes("ECONNREFUSED")) {
|
|
165
|
+
import_logger.logger.error("Failed to connect to Farseer.");
|
|
166
|
+
} else {
|
|
167
|
+
import_logger.logger.error("Failed to fetch model.");
|
|
168
|
+
import_logger.logger.dim(errorMessage);
|
|
169
|
+
}
|
|
170
|
+
process.exit(1);
|
|
171
|
+
}
|
|
172
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
173
|
+
0 && (module.exports = {
|
|
174
|
+
registerVariablesCommand
|
|
175
|
+
});
|
|
176
|
+
//# sourceMappingURL=variables.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/commands/variables.ts"],
|
|
4
|
+
"sourcesContent": ["import { Command } from 'commander';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport chalk from 'chalk';\nimport { logger } from '../utils/logger';\nimport { getFarseerClientWithFallback, getNativeFarseerClient, showLoginPrompt, isAuthError } from '../services/farseerFactory';\nimport { resolveTenantWithOrgMapping } from '../utils/helpers';\n\nexport function registerVariablesCommand(program: Command): void {\n // farseer variables list\n const variablesCmd = program\n .command('variables')\n .description('List and manage variables');\n\n variablesCmd\n .command('list [org] [tenant]')\n .description('List all variables')\n .option('--json', 'Output raw JSON')\n .action(async (first, second, options) => {\n const { organisation, tenant } = resolveTenantWithOrgMapping(first, second);\n const result = await getFarseerClientWithFallback(organisation, tenant);\n\n if (!result) {\n showLoginPrompt(tenant);\n process.exit(1);\n }\n\n try {\n const model = await result.client.exportModel();\n\n if (options.json) {\n console.log(JSON.stringify(model.variables, null, 2));\n return;\n }\n\n logger.header(`Variables (${model.variables.length})`);\n console.log();\n for (const variable of model.variables) {\n const flags = [];\n if (variable.readonly) flags.push('readonly');\n if (variable.calculateOnDemand) flags.push('on-demand');\n const flagStr = flags.length > 0 ? chalk.dim(` [${flags.join(', ')}]`) : '';\n\n console.log(` ${chalk.bold(variable.name)}${flagStr}`);\n console.log(` Dimensions: ${variable.tables.join(', ')}`);\n console.log(` Rollup: ${variable.rollupType} | Type: ${variable.dataType}`);\n if (variable.formula) {\n console.log(` Formula: ${chalk.dim(variable.formula.substring(0, 80))}${variable.formula.length > 80 ? '...' : ''}`);\n }\n console.log();\n }\n } catch (error) {\n handleModelError(error, tenant);\n }\n });\n\n // farseer variable details / export (singular)\n const variableCmd = program\n .command('variable')\n .description('Variable details and export');\n\n variableCmd\n .command('details <name>')\n .description('Show variable details (dimensions, formula, rollup, etc.)')\n .option('--json', 'Output raw JSON')\n .action(async (name, options) => {\n const { organisation, tenant } = resolveTenantWithOrgMapping();\n const result = await getFarseerClientWithFallback(organisation, tenant);\n\n if (!result) {\n showLoginPrompt(tenant);\n process.exit(1);\n }\n\n try {\n const model = await result.client.exportModel();\n const variable = model.variables.find(\n v => v.name.toLowerCase() === name.toLowerCase()\n );\n\n if (!variable) {\n logger.error(`Variable \"${name}\" 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 if (options.json) {\n console.log(JSON.stringify(variable, null, 2));\n return;\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(` Format: ${variable.numberFormat.type}${variable.numberFormat.formatString ? ` (${variable.numberFormat.formatString})` : ''}`);\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 } catch (error) {\n handleModelError(error, tenant);\n }\n });\n\n variableCmd\n .command('export <name>')\n .description('Export variable data to CSV file')\n .option('--output <file>', 'Output file path')\n .option('--format <format>', 'Output format: csv, json, xlsx', 'csv')\n .option('--limit <n>', 'Limit number of rows', parseInt)\n .action(async (name, options) => {\n const { organisation, tenant } = resolveTenantWithOrgMapping();\n const nativeClient = await getNativeFarseerClient(organisation, tenant);\n\n if (!nativeClient) {\n showLoginPrompt(tenant);\n process.exit(1);\n }\n\n try {\n logger.info(`Exporting variable \"${name}\" from ${tenant}...`);\n\n const exportRequest: any = {\n formula: name,\n format: options.format || 'csv',\n };\n if (options.limit) {\n exportRequest.limit = options.limit;\n }\n\n const blob = await nativeClient.export.exportFormula(exportRequest);\n const content = await blob.text();\n\n const outputFile = options.output || `${name.replace(/[^a-zA-Z0-9_-]/g, '_')}.${options.format || 'csv'}`;\n fs.writeFileSync(outputFile, content, 'utf-8');\n\n logger.success(`Exported to ${outputFile}`);\n const lines = content.split('\\n').filter(l => l.trim()).length;\n logger.dim(`${lines - 1} data rows`);\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n logger.error(`Failed to export variable \"${name}\".`);\n logger.dim(errorMessage);\n process.exit(1);\n }\n });\n}\n\nfunction handleModelError(error: unknown, tenant: string): void {\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 } else if (errorMessage.includes('ENOTFOUND') || errorMessage.includes('ECONNREFUSED')) {\n logger.error('Failed to connect to Farseer.');\n } else {\n logger.error('Failed to fetch model.');\n logger.dim(errorMessage);\n }\n process.exit(1);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,SAAoB;AAEpB,mBAAkB;AAClB,oBAAuB;AACvB,4BAAmG;AACnG,qBAA4C;AAErC,SAAS,yBAAyB,SAAwB;AAE7D,QAAM,eAAe,QAChB,QAAQ,WAAW,EACnB,YAAY,2BAA2B;AAE5C,eACK,QAAQ,qBAAqB,EAC7B,YAAY,oBAAoB,EAChC,OAAO,UAAU,iBAAiB,EAClC,OAAO,OAAO,OAAO,QAAQ,YAAY;AACtC,UAAM,EAAE,cAAc,OAAO,QAAI,4CAA4B,OAAO,MAAM;AAC1E,UAAM,SAAS,UAAM,oDAA6B,cAAc,MAAM;AAEtE,QAAI,CAAC,QAAQ;AACT,iDAAgB,MAAM;AACtB,cAAQ,KAAK,CAAC;AAAA,IAClB;AAEA,QAAI;AACA,YAAM,QAAQ,MAAM,OAAO,OAAO,YAAY;AAE9C,UAAI,QAAQ,MAAM;AACd,gBAAQ,IAAI,KAAK,UAAU,MAAM,WAAW,MAAM,CAAC,CAAC;AACpD;AAAA,MACJ;AAEA,2BAAO,OAAO,cAAc,MAAM,UAAU,MAAM,GAAG;AACrD,cAAQ,IAAI;AACZ,iBAAW,YAAY,MAAM,WAAW;AACpC,cAAM,QAAQ,CAAC;AACf,YAAI,SAAS,SAAU,OAAM,KAAK,UAAU;AAC5C,YAAI,SAAS,kBAAmB,OAAM,KAAK,WAAW;AACtD,cAAM,UAAU,MAAM,SAAS,IAAI,aAAAA,QAAM,IAAI,KAAK,MAAM,K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B,QAAQ,MAAM,UAAU,OAAO,KAAK;AAE1E,UAAI,mCAAY,KAAK,GAAG;AACpB,+CAAgB,MAAM;AAAA,EAC1B,WAAW,aAAa,SAAS,KAAK,GAAG;AACrC,yBAAO,MAAM,WAAW,MAAM,gCAAgC;AAAA,EAClE,WAAW,aAAa,SAAS,WAAW,KAAK,aAAa,SAAS,cAAc,GAAG;AACpF,yBAAO,MAAM,+BAA+B;AAAA,EAChD,OAAO;AACH,yBAAO,MAAM,wBAAwB;AACrC,yBAAO,IAAI,YAAY;AAAA,EAC3B;AACA,UAAQ,KAAK,CAAC;AAClB;",
|
|
6
|
+
"names": ["chalk"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var whoami_exports = {};
|
|
19
|
+
__export(whoami_exports, {
|
|
20
|
+
registerWhoamiCommand: () => registerWhoamiCommand
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(whoami_exports);
|
|
23
|
+
var import_logger = require("../utils/logger");
|
|
24
|
+
var import_configService = require("../services/configService");
|
|
25
|
+
function registerWhoamiCommand(program) {
|
|
26
|
+
program.command("whoami").description("Show current login status and configured tenants").action(async () => {
|
|
27
|
+
import_logger.logger.header("Farseer Status");
|
|
28
|
+
const userAuth = (0, import_configService.getUserAuth)();
|
|
29
|
+
if (userAuth) {
|
|
30
|
+
if ((0, import_configService.isUserAuthValid)()) {
|
|
31
|
+
const expiresAt = new Date(userAuth.expiresAt);
|
|
32
|
+
import_logger.logger.success("Logged in via browser");
|
|
33
|
+
import_logger.logger.dim(`Token expires: ${expiresAt.toLocaleString()}`);
|
|
34
|
+
} else {
|
|
35
|
+
import_logger.logger.warning("Browser login expired");
|
|
36
|
+
import_logger.logger.dim("Run: farseer login");
|
|
37
|
+
}
|
|
38
|
+
} else {
|
|
39
|
+
import_logger.logger.dim("Not logged in via browser");
|
|
40
|
+
}
|
|
41
|
+
console.log();
|
|
42
|
+
const credentials = (0, import_configService.listCredentials)();
|
|
43
|
+
const tenants = Object.keys(credentials);
|
|
44
|
+
if (tenants.length > 0) {
|
|
45
|
+
import_logger.logger.info(`Configured tenants (${tenants.length}):`);
|
|
46
|
+
for (const tenant of tenants) {
|
|
47
|
+
const cred = credentials[tenant];
|
|
48
|
+
const keyPreview = cred.apiKey.substring(0, 8) + "...";
|
|
49
|
+
console.log(` ${tenant}`);
|
|
50
|
+
console.log(` Base: ${cred.basePath}`);
|
|
51
|
+
console.log(` Key: ${keyPreview}`);
|
|
52
|
+
}
|
|
53
|
+
} else {
|
|
54
|
+
import_logger.logger.dim("No tenants configured");
|
|
55
|
+
import_logger.logger.dim("Run: farseer config set <tenant> --api-key <key>");
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
60
|
+
0 && (module.exports = {
|
|
61
|
+
registerWhoamiCommand
|
|
62
|
+
});
|
|
63
|
+
//# sourceMappingURL=whoami.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/commands/whoami.ts"],
|
|
4
|
+
"sourcesContent": ["import { Command } from 'commander';\nimport { logger } from '../utils/logger';\nimport { getUserAuth, isUserAuthValid, listCredentials } from '../services/configService';\n\nexport function registerWhoamiCommand(program: Command): void {\n program\n .command('whoami')\n .description('Show current login status and configured tenants')\n .action(async () => {\n logger.header('Farseer Status');\n\n // Check user auth (browser login)\n const userAuth = getUserAuth();\n if (userAuth) {\n if (isUserAuthValid()) {\n const expiresAt = new Date(userAuth.expiresAt);\n logger.success('Logged in via browser');\n logger.dim(`Token expires: ${expiresAt.toLocaleString()}`);\n } else {\n logger.warning('Browser login expired');\n logger.dim('Run: farseer login');\n }\n } else {\n logger.dim('Not logged in via browser');\n }\n\n console.log();\n\n // List configured tenants (API key)\n const credentials = listCredentials();\n const tenants = Object.keys(credentials);\n\n if (tenants.length > 0) {\n logger.info(`Configured tenants (${tenants.length}):`);\n for (const tenant of tenants) {\n const cred = credentials[tenant];\n const keyPreview = cred.apiKey.substring(0, 8) + '...';\n console.log(` ${tenant}`);\n console.log(` Base: ${cred.basePath}`);\n console.log(` Key: ${keyPreview}`);\n }\n } else {\n logger.dim('No tenants configured');\n logger.dim('Run: farseer config set <tenant> --api-key <key>');\n }\n });\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAAuB;AACvB,2BAA8D;AAEvD,SAAS,sBAAsB,SAAwB;AAC1D,UACK,QAAQ,QAAQ,EAChB,YAAY,kDAAkD,EAC9D,OAAO,YAAY;AAChB,yBAAO,OAAO,gBAAgB;AAG9B,UAAM,eAAW,kCAAY;AAC7B,QAAI,UAAU;AACV,cAAI,sCAAgB,GAAG;AACnB,cAAM,YAAY,IAAI,KAAK,SAAS,SAAS;AAC7C,6BAAO,QAAQ,uBAAuB;AACtC,6BAAO,IAAI,kBAAkB,UAAU,eAAe,CAAC,EAAE;AAAA,MAC7D,OAAO;AACH,6BAAO,QAAQ,uBAAuB;AACtC,6BAAO,IAAI,oBAAoB;AAAA,MACnC;AAAA,IACJ,OAAO;AACH,2BAAO,IAAI,2BAA2B;AAAA,IAC1C;AAEA,YAAQ,IAAI;AAGZ,UAAM,kBAAc,sCAAgB;AACpC,UAAM,UAAU,OAAO,KAAK,WAAW;AAEvC,QAAI,QAAQ,SAAS,GAAG;AACpB,2BAAO,KAAK,uBAAuB,QAAQ,MAAM,IAAI;AACrD,iBAAW,UAAU,SAAS;AAC1B,cAAM,OAAO,YAAY,MAAM;AAC/B,cAAM,aAAa,KAAK,OAAO,UAAU,GAAG,CAAC,IAAI;AACjD,gBAAQ,IAAI,KAAK,MAAM,EAAE;AACzB,gBAAQ,IAAI,aAAa,KAAK,QAAQ,EAAE;AACxC,gBAAQ,IAAI,aAAa,UAAU,EAAE;AAAA,MACzC;AAAA,IACJ,OAAO;AACH,2BAAO,IAAI,uBAAuB;AAClC,2BAAO,IAAI,kDAAkD;AAAA,IACjE;AAAA,EACJ,CAAC;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var import_commander = require("commander");
|
|
25
|
+
var import_chalk = __toESM(require("chalk"));
|
|
26
|
+
var import_constants = require("./utils/constants");
|
|
27
|
+
var import_login = require("./commands/login");
|
|
28
|
+
var import_logout = require("./commands/logout");
|
|
29
|
+
var import_config = require("./commands/config");
|
|
30
|
+
var import_list = require("./commands/list");
|
|
31
|
+
var import_files = require("./commands/files");
|
|
32
|
+
var import_status = require("./commands/status");
|
|
33
|
+
var import_diff = require("./commands/diff");
|
|
34
|
+
var import_pull = require("./commands/pull");
|
|
35
|
+
var import_push = require("./commands/push");
|
|
36
|
+
var import_run = require("./commands/run");
|
|
37
|
+
var import_install = require("./commands/install");
|
|
38
|
+
var import_whoami = require("./commands/whoami");
|
|
39
|
+
var import_app = require("./commands/app");
|
|
40
|
+
var import_model = require("./commands/model");
|
|
41
|
+
var import_variables = require("./commands/variables");
|
|
42
|
+
var import_dimensions = require("./commands/dimensions");
|
|
43
|
+
var import_checkout = require("./commands/checkout");
|
|
44
|
+
var import_mcp_server = require("./commands/mcp-server");
|
|
45
|
+
const originalEmit = process.emit;
|
|
46
|
+
process.emit = function(name, data, ...args) {
|
|
47
|
+
if (name === "warning" && typeof data === "object" && data !== null && "name" in data && data.name === "DeprecationWarning" && "message" in data && typeof data.message === "string" && data.message.includes("punycode")) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
return originalEmit.apply(process, [name, data, ...args]);
|
|
51
|
+
};
|
|
52
|
+
const program = new import_commander.Command();
|
|
53
|
+
program.configureHelp({
|
|
54
|
+
visibleCommands: () => []
|
|
55
|
+
// Hide all commands from default list
|
|
56
|
+
});
|
|
57
|
+
program.name("farseer").description("CLI tool for syncing Farseer App scripts between local folder and Farseer instances").version(import_constants.CLI_VERSION).addHelpText("after", `
|
|
58
|
+
${import_chalk.default.bold.underline("Tenant Resolution")}
|
|
59
|
+
Most commands accept ${import_chalk.default.cyan("[org] [tenant]")} arguments:
|
|
60
|
+
${import_chalk.default.green("$")} farseer checkout ${import_chalk.default.cyan("salvus-2 salvus-prodaja")} ${import_chalk.default.dim("First time: specify <org> <tenant>")}
|
|
61
|
+
${import_chalk.default.green("$")} farseer pull ${import_chalk.default.cyan("salvus-prodaja")} ${import_chalk.default.dim("After that: just <tenant> (org is remembered)")}
|
|
62
|
+
${import_chalk.default.green("$")} farseer push ${import_chalk.default.dim("Or omit entirely if checked out")}
|
|
63
|
+
|
|
64
|
+
${import_chalk.default.bold.underline("Authentication")}
|
|
65
|
+
login Login via browser (OAuth)
|
|
66
|
+
logout [tenant] Logout and remove credentials
|
|
67
|
+
whoami Show login status and configured tenants
|
|
68
|
+
checkout [org] [tenant] Set default tenant (verifies auth & pulls)
|
|
69
|
+
${import_chalk.default.dim("--no-pull")} Skip automatic pull
|
|
70
|
+
|
|
71
|
+
${import_chalk.default.bold.underline("Configuration")} ${import_chalk.default.dim("(farseer config <command>)")}
|
|
72
|
+
config set <tenant> Set API key for a tenant
|
|
73
|
+
${import_chalk.default.dim("--api-key <key>")} API key (required)
|
|
74
|
+
${import_chalk.default.dim("--org <name>")} Organisation if different from tenant
|
|
75
|
+
config remove <tenant> Remove credentials
|
|
76
|
+
config list List all configured tenants
|
|
77
|
+
config show <tenant> Show full credentials (incl. API key)
|
|
78
|
+
config test <tenant> Test connection to tenant
|
|
79
|
+
|
|
80
|
+
${import_chalk.default.bold.underline("Sync Operations")} ${import_chalk.default.dim("(tenant optional if checked out)")}
|
|
81
|
+
pull [org] [tenant] Pull files and apps from remote
|
|
82
|
+
${import_chalk.default.dim("--all")} Download all files (not just .ts/.js)
|
|
83
|
+
${import_chalk.default.dim("--force")} Overwrite local changes on conflicts
|
|
84
|
+
push [org] [tenant] Push local changes to remote
|
|
85
|
+
${import_chalk.default.dim("-y, --yes")} Skip confirmation prompt
|
|
86
|
+
${import_chalk.default.dim("--force")} Push even if remote has changes
|
|
87
|
+
status [tenant] Show sync status (local vs remote)
|
|
88
|
+
${import_chalk.default.dim("--all")} Show all files (not just .ts/.js)
|
|
89
|
+
diff [tenant] [file] Show file differences
|
|
90
|
+
|
|
91
|
+
${import_chalk.default.bold.underline("App Management")} ${import_chalk.default.dim("(tenant optional if checked out)")}
|
|
92
|
+
app list [tenant] List all apps
|
|
93
|
+
${import_chalk.default.dim("--details")} Show details for each app
|
|
94
|
+
app show [tenant] <name> Show app details
|
|
95
|
+
app create [tenant] <name> Create new app
|
|
96
|
+
app configure [tenant] <name> Configure app
|
|
97
|
+
${import_chalk.default.dim("--entrypoint <script>")} Set main script
|
|
98
|
+
${import_chalk.default.dim("--scripts <list>")} Comma-separated scripts
|
|
99
|
+
${import_chalk.default.dim("--add-arg <Name=Value>")} Add argument (repeatable)
|
|
100
|
+
${import_chalk.default.dim("--description <text>")} Set description
|
|
101
|
+
app delete [tenant] <name> Delete app (requires --force)
|
|
102
|
+
|
|
103
|
+
${import_chalk.default.bold.underline("Running & Development")} ${import_chalk.default.dim("(tenant optional if checked out)")}
|
|
104
|
+
run [tenant] <app> Run app locally with injected credentials
|
|
105
|
+
${import_chalk.default.dim("--arg <Name=Value>")} Override argument (repeatable)
|
|
106
|
+
run-script [tenant] <file> Run script directly (no app wrapper)
|
|
107
|
+
install [tenant] Install npm dependencies (npm install)
|
|
108
|
+
|
|
109
|
+
${import_chalk.default.bold.underline("Variables")} ${import_chalk.default.dim("(tenant optional if checked out)")}
|
|
110
|
+
variables list [tenant] List all variables
|
|
111
|
+
variable details <name> Show variable details (dimensions, formula, etc.)
|
|
112
|
+
variable export <name> Export variable data to CSV
|
|
113
|
+
${import_chalk.default.dim("--output <file>")} Output file path
|
|
114
|
+
${import_chalk.default.dim("--format <csv|json|xlsx>")} Output format (default: csv)
|
|
115
|
+
${import_chalk.default.dim("--limit <n>")} Limit number of rows
|
|
116
|
+
|
|
117
|
+
${import_chalk.default.bold.underline("Dimensions")} ${import_chalk.default.dim("(tenant optional if checked out)")}
|
|
118
|
+
dimensions list [tenant] List all dimension tables
|
|
119
|
+
dimension details <name> Show table details (columns, members)
|
|
120
|
+
${import_chalk.default.dim("--members <n>")} Number of sample members (default: 10)
|
|
121
|
+
|
|
122
|
+
${import_chalk.default.bold.underline("Model Inspection")} ${import_chalk.default.dim("(tenant optional if checked out)")}
|
|
123
|
+
model [tenant] Show model structure (dimensions, variables)
|
|
124
|
+
${import_chalk.default.dim("--variables")} List all variables
|
|
125
|
+
${import_chalk.default.dim("--tables")} List all dimension tables
|
|
126
|
+
${import_chalk.default.dim("--variable <name>")} Show dimensions for variable
|
|
127
|
+
|
|
128
|
+
${import_chalk.default.bold.underline("File Management")} ${import_chalk.default.dim("(farseer files <command>)")}
|
|
129
|
+
files list [tenant] List files on remote
|
|
130
|
+
${import_chalk.default.dim("--all")} Show all files (not just scripts)
|
|
131
|
+
|
|
132
|
+
${import_chalk.default.bold.underline("MCP Server")} ${import_chalk.default.dim("(AI assistant integration)")}
|
|
133
|
+
mcp-server Start MCP server for Claude, Cursor, etc.
|
|
134
|
+
|
|
135
|
+
${import_chalk.default.bold.underline("Examples")}
|
|
136
|
+
${import_chalk.default.green("$")} farseer login ${import_chalk.default.dim("Login via browser")}
|
|
137
|
+
${import_chalk.default.green("$")} farseer checkout salvus-2 salvus-prod ${import_chalk.default.dim("First time: org + tenant")}
|
|
138
|
+
${import_chalk.default.green("$")} farseer pull salvus-prod ${import_chalk.default.dim("Next time: just tenant")}
|
|
139
|
+
${import_chalk.default.green("$")} farseer push ${import_chalk.default.dim("If checked out: no args needed")}
|
|
140
|
+
${import_chalk.default.green("$")} farseer push -y ${import_chalk.default.dim("Push without confirmation")}
|
|
141
|
+
${import_chalk.default.green("$")} farseer run "My App" ${import_chalk.default.dim("Run app locally")}
|
|
142
|
+
${import_chalk.default.green("$")} farseer variables list ${import_chalk.default.dim("List all variables")}
|
|
143
|
+
${import_chalk.default.green("$")} farseer variable details "Revenue" ${import_chalk.default.dim("Show variable details")}
|
|
144
|
+
${import_chalk.default.green("$")} farseer dimensions list ${import_chalk.default.dim("List dimension tables")}
|
|
145
|
+
`);
|
|
146
|
+
(0, import_login.registerLoginCommand)(program);
|
|
147
|
+
(0, import_logout.registerLogoutCommand)(program);
|
|
148
|
+
(0, import_checkout.registerCheckoutCommand)(program);
|
|
149
|
+
(0, import_config.registerConfigCommand)(program);
|
|
150
|
+
(0, import_list.registerListCommand)(program);
|
|
151
|
+
(0, import_files.registerFilesCommand)(program);
|
|
152
|
+
(0, import_app.registerAppCommand)(program);
|
|
153
|
+
(0, import_variables.registerVariablesCommand)(program);
|
|
154
|
+
(0, import_dimensions.registerDimensionsCommand)(program);
|
|
155
|
+
(0, import_model.registerModelCommand)(program);
|
|
156
|
+
(0, import_status.registerStatusCommand)(program);
|
|
157
|
+
(0, import_diff.registerDiffCommand)(program);
|
|
158
|
+
(0, import_pull.registerPullCommand)(program);
|
|
159
|
+
(0, import_push.registerPushCommand)(program);
|
|
160
|
+
(0, import_run.registerRunCommand)(program);
|
|
161
|
+
(0, import_install.registerInstallCommand)(program);
|
|
162
|
+
(0, import_whoami.registerWhoamiCommand)(program);
|
|
163
|
+
(0, import_mcp_server.registerMcpServerCommand)(program);
|
|
164
|
+
program.parse();
|
|
165
|
+
//# sourceMappingURL=index.js.map
|