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,145 @@
|
|
|
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 dimensions_exports = {};
|
|
29
|
+
__export(dimensions_exports, {
|
|
30
|
+
registerDimensionsCommand: () => registerDimensionsCommand
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(dimensions_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_helpers = require("../utils/helpers");
|
|
37
|
+
function registerDimensionsCommand(program) {
|
|
38
|
+
const dimensionsCmd = program.command("dimensions").description("List and manage dimension tables");
|
|
39
|
+
dimensionsCmd.command("list [org] [tenant]").description("List all dimension tables").option("--json", "Output raw JSON").action(async (first, second, options) => {
|
|
40
|
+
const { organisation, tenant } = (0, import_helpers.resolveTenantWithOrgMapping)(first, second);
|
|
41
|
+
const result = await (0, import_farseerFactory.getFarseerClientWithFallback)(organisation, tenant);
|
|
42
|
+
if (!result) {
|
|
43
|
+
(0, import_farseerFactory.showLoginPrompt)(tenant);
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
try {
|
|
47
|
+
const model = await result.client.exportModel();
|
|
48
|
+
if (options.json) {
|
|
49
|
+
const tablesInfo = model.tables.map((t) => ({
|
|
50
|
+
name: t.name,
|
|
51
|
+
memberCount: t.rows.length,
|
|
52
|
+
columns: t.columns,
|
|
53
|
+
folderPath: t.folderPath
|
|
54
|
+
}));
|
|
55
|
+
console.log(JSON.stringify(tablesInfo, null, 2));
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
import_logger.logger.header(`Dimension Tables (${model.tables.length})`);
|
|
59
|
+
console.log();
|
|
60
|
+
for (const table of model.tables) {
|
|
61
|
+
const fkColumns = table.columns.filter((c) => c.type === "FOREIGN_KEY");
|
|
62
|
+
let info = ` ${import_chalk.default.bold(table.name)} ${import_chalk.default.dim(`(${table.rows.length} members)`)}`;
|
|
63
|
+
if (fkColumns.length > 0) {
|
|
64
|
+
info += import_chalk.default.cyan(` -> ${fkColumns.map((c) => c.foreignKeyTableName).join(", ")}`);
|
|
65
|
+
}
|
|
66
|
+
console.log(info);
|
|
67
|
+
}
|
|
68
|
+
} catch (error) {
|
|
69
|
+
handleModelError(error, tenant);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
const dimensionCmd = program.command("dimension").description("Dimension table details");
|
|
73
|
+
dimensionCmd.command("details <name>").description("Show dimension table details (columns, members)").option("--json", "Output raw JSON").option("--members <n>", "Number of sample members to show", "10").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 table = model.tables.find(
|
|
83
|
+
(t) => t.name.toLowerCase() === name.toLowerCase()
|
|
84
|
+
);
|
|
85
|
+
if (!table) {
|
|
86
|
+
import_logger.logger.error(`Table "${name}" not found.`);
|
|
87
|
+
import_logger.logger.dim("Available tables:");
|
|
88
|
+
model.tables.slice(0, 10).forEach((t) => import_logger.logger.dim(` - ${t.name}`));
|
|
89
|
+
if (model.tables.length > 10) {
|
|
90
|
+
import_logger.logger.dim(` ... and ${model.tables.length - 10} more`);
|
|
91
|
+
}
|
|
92
|
+
process.exit(1);
|
|
93
|
+
}
|
|
94
|
+
if (options.json) {
|
|
95
|
+
console.log(JSON.stringify(table, null, 2));
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const memberLimit = parseInt(options.members) || 10;
|
|
99
|
+
import_logger.logger.header(`Dimension Table: ${table.name}`);
|
|
100
|
+
console.log();
|
|
101
|
+
console.log(` Columns:`);
|
|
102
|
+
table.columns.forEach((col, i) => {
|
|
103
|
+
let colInfo = ` ${i + 1}. ${import_chalk.default.bold(col.type)}`;
|
|
104
|
+
if (col.name) colInfo += ` (${col.name})`;
|
|
105
|
+
if (col.foreignKeyTableName) colInfo += import_chalk.default.cyan(` -> ${col.foreignKeyTableName}`);
|
|
106
|
+
console.log(colInfo);
|
|
107
|
+
});
|
|
108
|
+
console.log(` Members: ${table.rows.length}`);
|
|
109
|
+
if (table.folderPath) {
|
|
110
|
+
console.log(` Folder: ${table.folderPath.join(" / ")}`);
|
|
111
|
+
}
|
|
112
|
+
if (table.rows.length > 0) {
|
|
113
|
+
console.log();
|
|
114
|
+
console.log(` Sample members (first ${Math.min(memberLimit, table.rows.length)}):`);
|
|
115
|
+
table.rows.slice(0, memberLimit).forEach((row) => {
|
|
116
|
+
console.log(` - ${row[0]}`);
|
|
117
|
+
});
|
|
118
|
+
if (table.rows.length > memberLimit) {
|
|
119
|
+
import_logger.logger.dim(` ... and ${table.rows.length - memberLimit} more`);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
} catch (error) {
|
|
123
|
+
handleModelError(error, tenant);
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
function handleModelError(error, tenant) {
|
|
128
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
129
|
+
if ((0, import_farseerFactory.isAuthError)(error)) {
|
|
130
|
+
(0, import_farseerFactory.showLoginPrompt)(tenant);
|
|
131
|
+
} else if (errorMessage.includes("404")) {
|
|
132
|
+
import_logger.logger.error(`Tenant "${tenant}" not found or not accessible.`);
|
|
133
|
+
} else if (errorMessage.includes("ENOTFOUND") || errorMessage.includes("ECONNREFUSED")) {
|
|
134
|
+
import_logger.logger.error("Failed to connect to Farseer.");
|
|
135
|
+
} else {
|
|
136
|
+
import_logger.logger.error("Failed to fetch model.");
|
|
137
|
+
import_logger.logger.dim(errorMessage);
|
|
138
|
+
}
|
|
139
|
+
process.exit(1);
|
|
140
|
+
}
|
|
141
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
142
|
+
0 && (module.exports = {
|
|
143
|
+
registerDimensionsCommand
|
|
144
|
+
});
|
|
145
|
+
//# sourceMappingURL=dimensions.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/commands/dimensions.ts"],
|
|
4
|
+
"sourcesContent": ["import { Command } from 'commander';\nimport chalk from 'chalk';\nimport { logger } from '../utils/logger';\nimport { getFarseerClientWithFallback, showLoginPrompt, isAuthError } from '../services/farseerFactory';\nimport { resolveTenantWithOrgMapping } from '../utils/helpers';\n\nexport function registerDimensionsCommand(program: Command): void {\n // farseer dimensions list\n const dimensionsCmd = program\n .command('dimensions')\n .description('List and manage dimension tables');\n\n dimensionsCmd\n .command('list [org] [tenant]')\n .description('List all dimension tables')\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 const tablesInfo = model.tables.map(t => ({\n name: t.name,\n memberCount: t.rows.length,\n columns: t.columns,\n folderPath: t.folderPath,\n }));\n console.log(JSON.stringify(tablesInfo, null, 2));\n return;\n }\n\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 = ` ${chalk.bold(table.name)} ${chalk.dim(`(${table.rows.length} members)`)}`;\n if (fkColumns.length > 0) {\n info += chalk.cyan(` -> ${fkColumns.map(c => c.foreignKeyTableName).join(', ')}`);\n }\n console.log(info);\n }\n } catch (error) {\n handleModelError(error, tenant);\n }\n });\n\n // farseer dimension details (singular)\n const dimensionCmd = program\n .command('dimension')\n .description('Dimension table details');\n\n dimensionCmd\n .command('details <name>')\n .description('Show dimension table details (columns, members)')\n .option('--json', 'Output raw JSON')\n .option('--members <n>', 'Number of sample members to show', '10')\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 table = model.tables.find(\n t => t.name.toLowerCase() === name.toLowerCase()\n );\n\n if (!table) {\n logger.error(`Table \"${name}\" 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 if (options.json) {\n console.log(JSON.stringify(table, null, 2));\n return;\n }\n\n const memberLimit = parseInt(options.members) || 10;\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}. ${chalk.bold(col.type)}`;\n if (col.name) colInfo += ` (${col.name})`;\n if (col.foreignKeyTableName) colInfo += chalk.cyan(` -> ${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();\n console.log(` Sample members (first ${Math.min(memberLimit, table.rows.length)}):`);\n table.rows.slice(0, memberLimit).forEach(row => {\n console.log(` - ${row[0]}`);\n });\n if (table.rows.length > memberLimit) {\n logger.dim(` ... and ${table.rows.length - memberLimit} more`);\n }\n }\n } catch (error) {\n handleModelError(error, tenant);\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,mBAAkB;AAClB,oBAAuB;AACvB,4BAA2E;AAC3E,qBAA4C;AAErC,SAAS,0BAA0B,SAAwB;AAE9D,QAAM,gBAAgB,QACjB,QAAQ,YAAY,EACpB,YAAY,kCAAkC;AAEnD,gBACK,QAAQ,qBAAqB,EAC7B,YAAY,2BAA2B,EACvC,OAAO,UAAU,iBAAiB,EAClC,OAAO,OAAO,OAAO,QAAQ,YAAY;AACtC,UAAM,EAAE,cAAc,OAAO,QAAI,4CAA4B,OAAO,MAAM;AAC1E,UAAM,S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Aa,MAAM,WAAW,KAAK,KAAK,CAAC,EAAE;AAAA,MAC3D;AACA,UAAI,MAAM,KAAK,SAAS,GAAG;AACvB,gBAAQ,IAAI;AACZ,gBAAQ,IAAI,2BAA2B,KAAK,IAAI,aAAa,MAAM,KAAK,MAAM,CAAC,IAAI;AACnF,cAAM,KAAK,MAAM,GAAG,WAAW,EAAE,QAAQ,SAAO;AAC5C,kBAAQ,IAAI,SAAS,IAAI,CAAC,CAAC,EAAE;AAAA,QACjC,CAAC;AACD,YAAI,MAAM,KAAK,SAAS,aAAa;AACjC,+BAAO,IAAI,eAAe,MAAM,KAAK,SAAS,WAAW,OAAO;AAAA,QACpE;AAAA,MACJ;AAAA,IACJ,SAAS,OAAO;AACZ,uBAAiB,OAAO,MAAM;AAAA,IAClC;AAAA,EACJ,CAAC;AACT;AAEA,SAAS,iBAAiB,OAAgB,QAAsB;AAC5D,QAAM,eAAe,iBAAiB,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,99 @@
|
|
|
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 files_exports = {};
|
|
19
|
+
__export(files_exports, {
|
|
20
|
+
registerFilesCommand: () => registerFilesCommand
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(files_exports);
|
|
23
|
+
var import_logger = require("../utils/logger");
|
|
24
|
+
var import_farseerFactory = require("../services/farseerFactory");
|
|
25
|
+
var import_helpers = require("../utils/helpers");
|
|
26
|
+
function registerFilesCommand(program) {
|
|
27
|
+
const filesCmd = program.command("files").description("Manage files on a Farseer instance").addHelpText("after", `
|
|
28
|
+
Commands:
|
|
29
|
+
list [tenant] List all files on remote
|
|
30
|
+
|
|
31
|
+
Examples:
|
|
32
|
+
$ farseer files list # List script files
|
|
33
|
+
$ farseer files list --all # List all files
|
|
34
|
+
$ farseer files list mycompany # List files on specific tenant
|
|
35
|
+
`);
|
|
36
|
+
filesCmd.command("list [org] [tenant]").description("List all files on a Farseer instance\n\nUsage: list <org> <tenant> OR list <tenant> (if org is known)").option("--all", "List all files (default: only scripts .ts, .js)").action(async (arg1, arg2, options) => {
|
|
37
|
+
const { organisation, tenant } = (0, import_helpers.resolveTenantWithOrgMapping)(arg1, arg2);
|
|
38
|
+
const result = await (0, import_farseerFactory.getFarseerClientWithFallback)(organisation, tenant);
|
|
39
|
+
if (!result) {
|
|
40
|
+
(0, import_farseerFactory.showLoginPrompt)(tenant);
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
const authLabel = result.authType === "apiKey" ? "API key" : "browser login";
|
|
44
|
+
import_logger.logger.info(`Fetching files from ${tenant} (using ${authLabel})...`);
|
|
45
|
+
let files;
|
|
46
|
+
try {
|
|
47
|
+
files = await result.client.listFiles();
|
|
48
|
+
} catch (error) {
|
|
49
|
+
if ((0, import_farseerFactory.isAuthError)(error)) {
|
|
50
|
+
(0, import_farseerFactory.showLoginPrompt)(tenant);
|
|
51
|
+
} else {
|
|
52
|
+
import_logger.logger.error("Failed to list files.");
|
|
53
|
+
if (error instanceof Error) {
|
|
54
|
+
import_logger.logger.dim(error.message);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
process.exit(1);
|
|
58
|
+
}
|
|
59
|
+
if (!options.all) {
|
|
60
|
+
files = files.filter(
|
|
61
|
+
(f) => import_farseerFactory.DEFAULT_SCRIPT_EXTENSIONS.some((ext) => f.name.toLowerCase().endsWith(ext))
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
if (files.length === 0) {
|
|
65
|
+
import_logger.logger.warning("No files found in Files/");
|
|
66
|
+
import_logger.logger.dim(options.all ? "The folder might be empty or does not exist." : "No script files (.ts, .js) found. Use --all to see all files.");
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
import_logger.logger.header(`Files on ${tenant} (Files/)`);
|
|
70
|
+
const grouped = {};
|
|
71
|
+
for (const file of files) {
|
|
72
|
+
const parts = file.path.split("/");
|
|
73
|
+
const fileName = parts.pop();
|
|
74
|
+
const dir = parts.length > 0 ? parts.join("/") + "/" : "";
|
|
75
|
+
if (!grouped[dir]) {
|
|
76
|
+
grouped[dir] = [];
|
|
77
|
+
}
|
|
78
|
+
grouped[dir].push(fileName);
|
|
79
|
+
}
|
|
80
|
+
const dirs = Object.keys(grouped).sort();
|
|
81
|
+
for (const dir of dirs) {
|
|
82
|
+
if (dir) {
|
|
83
|
+
console.log(` ${dir}`);
|
|
84
|
+
}
|
|
85
|
+
const dirFiles = grouped[dir].sort();
|
|
86
|
+
for (const file of dirFiles) {
|
|
87
|
+
const prefix = dir ? " " : " ";
|
|
88
|
+
console.log(`${prefix}${file}`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
console.log();
|
|
92
|
+
import_logger.logger.dim(`Total: ${files.length} file(s)`);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
96
|
+
0 && (module.exports = {
|
|
97
|
+
registerFilesCommand
|
|
98
|
+
});
|
|
99
|
+
//# sourceMappingURL=files.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/commands/files.ts"],
|
|
4
|
+
"sourcesContent": ["import { Command } from 'commander';\nimport { logger } from '../utils/logger';\nimport { getFarseerClientWithFallback, showLoginPrompt, isAuthError, DEFAULT_SCRIPT_EXTENSIONS } from '../services/farseerFactory';\nimport { resolveTenantWithOrgMapping } from '../utils/helpers';\n\nexport function registerFilesCommand(program: Command): void {\n const filesCmd = program\n .command('files')\n .description('Manage files on a Farseer instance')\n .addHelpText('after', `\nCommands:\n list [tenant] List all files on remote\n\nExamples:\n $ farseer files list # List script files\n $ farseer files list --all # List all files\n $ farseer files list mycompany # List files on specific tenant\n`);\n\n // List files\n filesCmd\n .command('list [org] [tenant]')\n .description('List all files on a Farseer instance\\n\\nUsage: list <org> <tenant> OR list <tenant> (if org is known)')\n .option('--all', 'List all files (default: only scripts .ts, .js)')\n .action(async (arg1, arg2, options) => {\n const { organisation, tenant } = resolveTenantWithOrgMapping(arg1, arg2);\n const result = await getFarseerClientWithFallback(organisation, tenant);\n\n if (!result) {\n showLoginPrompt(tenant);\n process.exit(1);\n }\n\n const authLabel = result.authType === 'apiKey' ? 'API key' : 'browser login';\n logger.info(`Fetching files from ${tenant} (using ${authLabel})...`);\n\n let files;\n try {\n files = await result.client.listFiles();\n } catch (error) {\n if (isAuthError(error)) {\n showLoginPrompt(tenant);\n } else {\n logger.error('Failed to list files.');\n if (error instanceof Error) {\n logger.dim(error.message);\n }\n }\n process.exit(1);\n }\n\n // Filter to scripts only unless --all is specified\n if (!options.all) {\n files = files.filter(f =>\n DEFAULT_SCRIPT_EXTENSIONS.some(ext => f.name.toLowerCase().endsWith(ext))\n );\n }\n\n if (files.length === 0) {\n logger.warning('No files found in Files/');\n logger.dim(options.all ? 'The folder might be empty or does not exist.' : 'No script files (.ts, .js) found. Use --all to see all files.');\n return;\n }\n\n logger.header(`Files on ${tenant} (Files/)`);\n\n // Group by directory\n const grouped: Record<string, string[]> = {};\n\n for (const file of files) {\n const parts = file.path.split('/');\n const fileName = parts.pop()!;\n const dir = parts.length > 0 ? parts.join('/') + '/' : '';\n\n if (!grouped[dir]) {\n grouped[dir] = [];\n }\n grouped[dir].push(fileName);\n }\n\n // Sort directories\n const dirs = Object.keys(grouped).sort();\n\n for (const dir of dirs) {\n if (dir) {\n console.log(` ${dir}`);\n }\n\n const dirFiles = grouped[dir].sort();\n for (const file of dirFiles) {\n const prefix = dir ? ' ' : ' ';\n console.log(`${prefix}${file}`);\n }\n }\n\n console.log();\n logger.dim(`Total: ${files.length} file(s)`);\n });\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAAuB;AACvB,4BAAsG;AACtG,qBAA4C;AAErC,SAAS,qBAAqB,SAAwB;AACzD,QAAM,WAAW,QACZ,QAAQ,OAAO,EACf,YAAY,oCAAoC,EAChD,YAAY,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAQ7B;AAGG,WACK,QAAQ,qBAAqB,EAC7B,YAAY,uGAAuG,EACnH,OAAO,SAAS,iDAAiD,EACjE,OAAO,OAAO,MAAM,MAAM,YAAY;AACnC,UAAM,EAAE,cAAc,OAAO,QAAI,4CAA4B,MAAM,IAAI;AACvE,UAAM,SA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pB,UAAI,KAAK;AACL,gBAAQ,IAAI,KAAK,GAAG,EAAE;AAAA,MAC1B;AAEA,YAAM,WAAW,QAAQ,GAAG,EAAE,KAAK;AACnC,iBAAW,QAAQ,UAAU;AACzB,cAAM,SAAS,MAAM,SAAS;AAC9B,gBAAQ,IAAI,GAAG,MAAM,GAAG,IAAI,EAAE;AAAA,MAClC;AAAA,IACJ;AAEA,YAAQ,IAAI;AACZ,yBAAO,IAAI,UAAU,MAAM,MAAM,UAAU;AAAA,EAC/C,CAAC;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
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 install_exports = {};
|
|
29
|
+
__export(install_exports, {
|
|
30
|
+
registerInstallCommand: () => registerInstallCommand
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(install_exports);
|
|
33
|
+
var import_logger = require("../utils/logger");
|
|
34
|
+
var import_helpers = require("../utils/helpers");
|
|
35
|
+
var fs = __toESM(require("fs"));
|
|
36
|
+
var import_child_process = require("child_process");
|
|
37
|
+
function registerInstallCommand(program) {
|
|
38
|
+
program.command("install [tenant]").description("Install npm dependencies for a tenant (runs npm install)").action(async (tenantArg) => {
|
|
39
|
+
const tenant = (0, import_helpers.resolveTenantOrExit)(tenantArg);
|
|
40
|
+
const tenantDir = (0, import_helpers.getTenantDir)(tenant);
|
|
41
|
+
if (!fs.existsSync(tenantDir)) {
|
|
42
|
+
import_logger.logger.error(`Tenant folder not found: farseer-apps/${tenant}/`);
|
|
43
|
+
import_logger.logger.dim('Run "farseer pull <tenant>" first to initialize the folder.');
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
const packageJsonPath = `${tenantDir}/package.json`;
|
|
47
|
+
if (!fs.existsSync(packageJsonPath)) {
|
|
48
|
+
import_logger.logger.error(`No package.json found in farseer-apps/${tenant}/`);
|
|
49
|
+
import_logger.logger.dim('Create a package.json first or run "npm init" in that folder.');
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
import_logger.logger.info(`Installing dependencies for ${tenant}...`);
|
|
53
|
+
import_logger.logger.dim(`Running: npm install in farseer-apps/${tenant}/`);
|
|
54
|
+
console.log();
|
|
55
|
+
const child = (0, import_child_process.spawn)("npm", ["install"], {
|
|
56
|
+
stdio: "inherit",
|
|
57
|
+
cwd: tenantDir,
|
|
58
|
+
shell: true
|
|
59
|
+
});
|
|
60
|
+
child.on("close", (code) => {
|
|
61
|
+
if (code === 0) {
|
|
62
|
+
console.log();
|
|
63
|
+
import_logger.logger.success("Dependencies installed successfully!");
|
|
64
|
+
} else {
|
|
65
|
+
import_logger.logger.error(`npm install exited with code ${code}`);
|
|
66
|
+
process.exit(code || 1);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
child.on("error", (err) => {
|
|
70
|
+
import_logger.logger.error(`Failed to run npm install: ${err.message}`);
|
|
71
|
+
process.exit(1);
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
76
|
+
0 && (module.exports = {
|
|
77
|
+
registerInstallCommand
|
|
78
|
+
});
|
|
79
|
+
//# sourceMappingURL=install.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/commands/install.ts"],
|
|
4
|
+
"sourcesContent": ["import { Command } from 'commander';\nimport { logger } from '../utils/logger';\nimport { getTenantDir, resolveTenantOrExit } from '../utils/helpers';\nimport * as fs from 'fs';\nimport { spawn } from 'child_process';\n\nexport function registerInstallCommand(program: Command): void {\n program\n .command('install [tenant]')\n .description('Install npm dependencies for a tenant (runs npm install)')\n .action(async (tenantArg) => {\n const tenant = resolveTenantOrExit(tenantArg);\n const tenantDir = getTenantDir(tenant);\n\n if (!fs.existsSync(tenantDir)) {\n logger.error(`Tenant folder not found: farseer-apps/${tenant}/`);\n logger.dim('Run \"farseer pull <tenant>\" first to initialize the folder.');\n process.exit(1);\n }\n\n const packageJsonPath = `${tenantDir}/package.json`;\n\n if (!fs.existsSync(packageJsonPath)) {\n logger.error(`No package.json found in farseer-apps/${tenant}/`);\n logger.dim('Create a package.json first or run \"npm init\" in that folder.');\n process.exit(1);\n }\n\n logger.info(`Installing dependencies for ${tenant}...`);\n logger.dim(`Running: npm install in farseer-apps/${tenant}/`);\n console.log();\n\n const child = spawn('npm', ['install'], {\n stdio: 'inherit',\n cwd: tenantDir,\n shell: true,\n });\n\n child.on('close', (code) => {\n if (code === 0) {\n console.log();\n logger.success('Dependencies installed successfully!');\n } else {\n logger.error(`npm install exited with code ${code}`);\n process.exit(code || 1);\n }\n });\n\n child.on('error', (err) => {\n logger.error(`Failed to run npm install: ${err.message}`);\n process.exit(1);\n });\n });\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAAuB;AACvB,qBAAkD;AAClD,SAAoB;AACpB,2BAAsB;AAEf,SAAS,uBAAuB,SAAwB;AAC3D,UACK,QAAQ,kBAAkB,EAC1B,YAAY,0DAA0D,EACtE,OAAO,OAAO,cAAc;AACzB,UAAM,aAAS,oCAAoB,SAAS;AAC5C,UAAM,gBAAY,6BAAa,MAAM;AAErC,QAAI,CAAC,GAAG,WAAW,SAAS,GAAG;AAC3B,2BAAO,MAAM,yCAAyC,MAAM,GAAG;AAC/D,2BAAO,IAAI,6DAA6D;AACxE,cAAQ,KAAK,CAAC;AAAA,IAClB;AAEA,UAAM,kBAAkB,GAAG,SAAS;AAEpC,QAAI,CAAC,GAAG,WAAW,eAAe,GAAG;AACjC,2BAAO,MAAM,yCAAyC,MAAM,GAAG;AAC/D,2BAAO,IAAI,+DAA+D;AAC1E,cAAQ,KAAK,CAAC;AAAA,IAClB;AAEA,yBAAO,KAAK,+BAA+B,MAAM,KAAK;AACtD,yBAAO,IAAI,wCAAwC,MAAM,GAAG;AAC5D,YAAQ,IAAI;AAEZ,UAAM,YAAQ,4BAAM,OAAO,CAAC,SAAS,GAAG;AAAA,MACpC,OAAO;AAAA,MACP,KAAK;AAAA,MACL,OAAO;AAAA,IACX,CAAC;AAED,UAAM,GAAG,SAAS,CAAC,SAAS;AACxB,UAAI,SAAS,GAAG;AACZ,gBAAQ,IAAI;AACZ,6BAAO,QAAQ,sCAAsC;AAAA,MACzD,OAAO;AACH,6BAAO,MAAM,gCAAgC,IAAI,EAAE;AACnD,gBAAQ,KAAK,QAAQ,CAAC;AAAA,MAC1B;AAAA,IACJ,CAAC;AAED,UAAM,GAAG,SAAS,CAAC,QAAQ;AACvB,2BAAO,MAAM,8BAA8B,IAAI,OAAO,EAAE;AACxD,cAAQ,KAAK,CAAC;AAAA,IAClB,CAAC;AAAA,EACL,CAAC;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
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 list_exports = {};
|
|
19
|
+
__export(list_exports, {
|
|
20
|
+
registerListCommand: () => registerListCommand
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(list_exports);
|
|
23
|
+
var import_logger = require("../utils/logger");
|
|
24
|
+
var import_farseerFactory = require("../services/farseerFactory");
|
|
25
|
+
var import_helpers = require("../utils/helpers");
|
|
26
|
+
function registerListCommand(program) {
|
|
27
|
+
program.command("list [arg1] [arg2]").description('[DEPRECATED] Use "farseer files list" instead').option("--all", "List all files (default: only scripts .ts, .js)").action(async (arg1, arg2, options) => {
|
|
28
|
+
import_logger.logger.warning('Deprecation: "farseer list" is deprecated. Use "farseer files list" instead.');
|
|
29
|
+
console.log();
|
|
30
|
+
const { organisation, tenant } = (0, import_helpers.resolveTenantWithOrgMapping)(arg1, arg2);
|
|
31
|
+
const result = await (0, import_farseerFactory.getFarseerClientWithFallback)(organisation, tenant);
|
|
32
|
+
if (!result) {
|
|
33
|
+
(0, import_farseerFactory.showLoginPrompt)(tenant);
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}
|
|
36
|
+
const authLabel = result.authType === "apiKey" ? "API key" : "browser login";
|
|
37
|
+
import_logger.logger.info(`Fetching files from ${tenant} (using ${authLabel})...`);
|
|
38
|
+
let files;
|
|
39
|
+
try {
|
|
40
|
+
files = await result.client.listFiles();
|
|
41
|
+
} catch (error) {
|
|
42
|
+
if ((0, import_farseerFactory.isAuthError)(error)) {
|
|
43
|
+
(0, import_farseerFactory.showLoginPrompt)(tenant);
|
|
44
|
+
} else {
|
|
45
|
+
import_logger.logger.error("Failed to list files.");
|
|
46
|
+
if (error instanceof Error) {
|
|
47
|
+
import_logger.logger.dim(error.message);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
if (!options.all) {
|
|
53
|
+
files = files.filter(
|
|
54
|
+
(f) => import_farseerFactory.DEFAULT_SCRIPT_EXTENSIONS.some((ext) => f.name.toLowerCase().endsWith(ext))
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
if (files.length === 0) {
|
|
58
|
+
import_logger.logger.warning("No files found in Files/");
|
|
59
|
+
import_logger.logger.dim(options.all ? "The folder might be empty or does not exist." : "No script files (.ts, .js) found. Use --all to see all files.");
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
import_logger.logger.header(`Files on ${tenant} (Files/)`);
|
|
63
|
+
const grouped = {};
|
|
64
|
+
for (const file of files) {
|
|
65
|
+
const parts = file.path.split("/");
|
|
66
|
+
const fileName = parts.pop();
|
|
67
|
+
const dir = parts.length > 0 ? parts.join("/") + "/" : "";
|
|
68
|
+
if (!grouped[dir]) {
|
|
69
|
+
grouped[dir] = [];
|
|
70
|
+
}
|
|
71
|
+
grouped[dir].push(fileName);
|
|
72
|
+
}
|
|
73
|
+
const dirs = Object.keys(grouped).sort();
|
|
74
|
+
for (const dir of dirs) {
|
|
75
|
+
if (dir) {
|
|
76
|
+
console.log(` ${dir}`);
|
|
77
|
+
}
|
|
78
|
+
const dirFiles = grouped[dir].sort();
|
|
79
|
+
for (const file of dirFiles) {
|
|
80
|
+
const prefix = dir ? " " : " ";
|
|
81
|
+
console.log(`${prefix}${file}`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
console.log();
|
|
85
|
+
import_logger.logger.dim(`Total: ${files.length} file(s)`);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
89
|
+
0 && (module.exports = {
|
|
90
|
+
registerListCommand
|
|
91
|
+
});
|
|
92
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/commands/list.ts"],
|
|
4
|
+
"sourcesContent": ["import { Command } from 'commander';\nimport { logger } from '../utils/logger';\nimport { getFarseerClientWithFallback, showLoginPrompt, isAuthError, DEFAULT_SCRIPT_EXTENSIONS } from '../services/farseerFactory';\nimport { resolveTenantWithOrgMapping } from '../utils/helpers';\n\nexport function registerListCommand(program: Command): void {\n program\n .command('list [arg1] [arg2]')\n .description('[DEPRECATED] Use \"farseer files list\" instead')\n .option('--all', 'List all files (default: only scripts .ts, .js)')\n .action(async (arg1, arg2, options) => {\n logger.warning('Deprecation: \"farseer list\" is deprecated. Use \"farseer files list\" instead.');\n console.log();\n const { organisation, tenant } = resolveTenantWithOrgMapping(arg1, arg2);\n const result = await getFarseerClientWithFallback(organisation, tenant);\n\n if (!result) {\n showLoginPrompt(tenant);\n process.exit(1);\n }\n\n const authLabel = result.authType === 'apiKey' ? 'API key' : 'browser login';\n logger.info(`Fetching files from ${tenant} (using ${authLabel})...`);\n\n let files;\n try {\n files = await result.client.listFiles();\n } catch (error) {\n if (isAuthError(error)) {\n showLoginPrompt(tenant);\n } else {\n logger.error('Failed to list files.');\n if (error instanceof Error) {\n logger.dim(error.message);\n }\n }\n process.exit(1);\n }\n\n // Filter to scripts only unless --all is specified\n if (!options.all) {\n files = files.filter(f =>\n DEFAULT_SCRIPT_EXTENSIONS.some(ext => f.name.toLowerCase().endsWith(ext))\n );\n }\n\n if (files.length === 0) {\n logger.warning('No files found in Files/');\n logger.dim(options.all ? 'The folder might be empty or does not exist.' : 'No script files (.ts, .js) found. Use --all to see all files.');\n return;\n }\n\n logger.header(`Files on ${tenant} (Files/)`);\n\n // Group by directory\n const grouped: Record<string, string[]> = {};\n\n for (const file of files) {\n const parts = file.path.split('/');\n const fileName = parts.pop()!;\n const dir = parts.length > 0 ? parts.join('/') + '/' : '';\n\n if (!grouped[dir]) {\n grouped[dir] = [];\n }\n grouped[dir].push(fileName);\n }\n\n // Sort directories\n const dirs = Object.keys(grouped).sort();\n\n for (const dir of dirs) {\n if (dir) {\n console.log(` ${dir}`);\n }\n\n const dirFiles = grouped[dir].sort();\n for (const file of dirFiles) {\n const prefix = dir ? ' ' : ' ';\n console.log(`${prefix}${file}`);\n }\n }\n\n console.log();\n logger.dim(`Total: ${files.length} file(s)`);\n });\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAAuB;AACvB,4BAAsG;AACtG,qBAA4C;AAErC,SAAS,oBAAoB,SAAwB;AACxD,UACK,QAAQ,oBAAoB,EAC5B,YAAY,+CAA+C,EAC3D,OAAO,SAAS,iDAAiD,EACjE,OAAO,OA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AC;AAAA,MACpB;AACA,cAAQ,GAAG,EAAE,KAAK,QAAQ;AAAA,IAC9B;AAGA,UAAM,OAAO,OAAO,KAAK,OAAO,EAAE,KAAK;AAEvC,eAAW,OAAO,MAAM;AACpB,UAAI,KAAK;AACL,gBAAQ,IAAI,KAAK,GAAG,EAAE;AAAA,MAC1B;AAEA,YAAM,WAAW,QAAQ,GAAG,EAAE,KAAK;AACnC,iBAAW,QAAQ,UAAU;AACzB,cAAM,SAAS,MAAM,SAAS;AAC9B,gBAAQ,IAAI,GAAG,MAAM,GAAG,IAAI,EAAE;AAAA,MAClC;AAAA,IACJ;AAEA,YAAQ,IAAI;AACZ,yBAAO,IAAI,UAAU,MAAM,MAAM,UAAU;AAAA,EAC/C,CAAC;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
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 login_exports = {};
|
|
29
|
+
__export(login_exports, {
|
|
30
|
+
registerLoginCommand: () => registerLoginCommand
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(login_exports);
|
|
33
|
+
var import_inquirer = __toESM(require("inquirer"));
|
|
34
|
+
var import_logger = require("../utils/logger");
|
|
35
|
+
var import_configService = require("../services/configService");
|
|
36
|
+
var import_farseerService = require("../services/farseerService");
|
|
37
|
+
function registerLoginCommand(program) {
|
|
38
|
+
program.command("login").description("Login to Farseer (opens browser or use --api-key)").option("--api-key", "Login using API key instead of browser").option("--realm <realm>", "Keycloak realm to use (default: master)").action(async (options) => {
|
|
39
|
+
if (options.apiKey) {
|
|
40
|
+
await loginWithApiKey();
|
|
41
|
+
} else {
|
|
42
|
+
await loginViaBrowser(options.realm);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
async function loginViaBrowser(realm) {
|
|
47
|
+
const realmToUse = realm || "master";
|
|
48
|
+
import_logger.logger.header("Farseer Login");
|
|
49
|
+
if (realm) {
|
|
50
|
+
import_logger.logger.info(`Using realm: ${realmToUse}`);
|
|
51
|
+
}
|
|
52
|
+
import_logger.logger.info("Opening browser for login...");
|
|
53
|
+
import_logger.logger.dim("Waiting for authentication (timeout: 5 minutes)...");
|
|
54
|
+
const result = await (0, import_farseerService.loginWithBrowser)(realmToUse);
|
|
55
|
+
if (!result) {
|
|
56
|
+
import_logger.logger.error("Login failed or timed out.");
|
|
57
|
+
import_logger.logger.dim("Try using --api-key for manual API key login.");
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
60
|
+
const expiresAt = new Date(Date.now() + result.expiresIn * 1e3);
|
|
61
|
+
(0, import_configService.setUserAuth)({
|
|
62
|
+
accessToken: result.accessToken,
|
|
63
|
+
refreshToken: result.refreshToken,
|
|
64
|
+
expiresAt: expiresAt.toISOString(),
|
|
65
|
+
realm: realmToUse
|
|
66
|
+
});
|
|
67
|
+
import_logger.logger.success("Login successful!");
|
|
68
|
+
import_logger.logger.dim(`Token expires at: ${expiresAt.toLocaleString()}`);
|
|
69
|
+
if (realm) {
|
|
70
|
+
import_logger.logger.dim(`Realm: ${realmToUse}`);
|
|
71
|
+
}
|
|
72
|
+
import_logger.logger.dim("You can now access any tenant you have permissions for.");
|
|
73
|
+
process.exit(0);
|
|
74
|
+
}
|
|
75
|
+
async function loginWithApiKey() {
|
|
76
|
+
import_logger.logger.header("Farseer Login (API Key)");
|
|
77
|
+
const answers = await import_inquirer.default.prompt([
|
|
78
|
+
{
|
|
79
|
+
type: "input",
|
|
80
|
+
name: "tenant",
|
|
81
|
+
message: "Tenant ID (e.g., tthotels):",
|
|
82
|
+
validate: (input) => {
|
|
83
|
+
if (!input || input.trim() === "") {
|
|
84
|
+
return "Tenant ID is required";
|
|
85
|
+
}
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
type: "input",
|
|
91
|
+
name: "organisation",
|
|
92
|
+
message: "Organisation (leave empty if same as tenant):"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
type: "password",
|
|
96
|
+
name: "apiKey",
|
|
97
|
+
message: "API Key:",
|
|
98
|
+
mask: "*",
|
|
99
|
+
validate: (input) => {
|
|
100
|
+
if (!input || input.trim() === "") {
|
|
101
|
+
return "API Key is required";
|
|
102
|
+
}
|
|
103
|
+
return true;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
]);
|
|
107
|
+
const tenant = answers.tenant.trim();
|
|
108
|
+
const organisation = answers.organisation.trim() || tenant;
|
|
109
|
+
const apiKey = answers.apiKey.trim();
|
|
110
|
+
const basePath = (0, import_configService.generateBasePath)(organisation);
|
|
111
|
+
import_logger.logger.info("Testing connection...");
|
|
112
|
+
const credential = {
|
|
113
|
+
type: "apiKey",
|
|
114
|
+
tenantId: tenant,
|
|
115
|
+
apiKey,
|
|
116
|
+
basePath
|
|
117
|
+
};
|
|
118
|
+
const service = new import_farseerService.FarseerService(credential);
|
|
119
|
+
const isConnected = await service.testConnection();
|
|
120
|
+
if (!isConnected) {
|
|
121
|
+
import_logger.logger.error("Connection failed. Please check your credentials.");
|
|
122
|
+
import_logger.logger.dim(`Tried to connect to: ${basePath}`);
|
|
123
|
+
process.exit(1);
|
|
124
|
+
}
|
|
125
|
+
(0, import_configService.setCredential)(tenant, credential);
|
|
126
|
+
import_logger.logger.success(`Successfully connected to ${tenant}!`);
|
|
127
|
+
import_logger.logger.dim(`Credentials saved for tenant: ${tenant}`);
|
|
128
|
+
import_logger.logger.dim(`Base path: ${basePath}`);
|
|
129
|
+
}
|
|
130
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
131
|
+
0 && (module.exports = {
|
|
132
|
+
registerLoginCommand
|
|
133
|
+
});
|
|
134
|
+
//# sourceMappingURL=login.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/commands/login.ts"],
|
|
4
|
+
"sourcesContent": ["import { Command } from 'commander';\nimport inquirer from 'inquirer';\nimport { logger } from '../utils/logger';\nimport {\n setCredential,\n setUserAuth,\n generateBasePath,\n ApiKeyCredential,\n} from '../services/configService';\nimport { loginWithBrowser, FarseerService } from '../services/farseerService';\n\nexport function registerLoginCommand(program: Command): void {\n program\n .command('login')\n .description('Login to Farseer (opens browser or use --api-key)')\n .option('--api-key', 'Login using API key instead of browser')\n .option('--realm <realm>', 'Keycloak realm to use (default: master)')\n .action(async (options) => {\n if (options.apiKey) {\n await loginWithApiKey();\n } else {\n await loginViaBrowser(options.realm);\n }\n });\n}\n\nasync function loginViaBrowser(realm?: string): Promise<void> {\n const realmToUse = realm || 'master';\n\n logger.header('Farseer Login');\n if (realm) {\n logger.info(`Using realm: ${realmToUse}`);\n }\n logger.info('Opening browser for login...');\n logger.dim('Waiting for authentication (timeout: 5 minutes)...');\n\n const result = await loginWithBrowser(realmToUse);\n\n if (!result) {\n logger.error('Login failed or timed out.');\n logger.dim('Try using --api-key for manual API key login.');\n process.exit(1);\n }\n\n const expiresAt = new Date(Date.now() + result.expiresIn * 1000);\n\n setUserAuth({\n accessToken: result.accessToken,\n refreshToken: result.refreshToken,\n expiresAt: expiresAt.toISOString(),\n realm: realmToUse,\n });\n\n logger.success('Login successful!');\n logger.dim(`Token expires at: ${expiresAt.toLocaleString()}`);\n if (realm) {\n logger.dim(`Realm: ${realmToUse}`);\n }\n logger.dim('You can now access any tenant you have permissions for.');\n process.exit(0);\n}\n\nasync function loginWithApiKey(): Promise<void> {\n logger.header('Farseer Login (API Key)');\n\n const answers = await inquirer.prompt([\n {\n type: 'input',\n name: 'tenant',\n message: 'Tenant ID (e.g., tthotels):',\n validate: (input) => {\n if (!input || input.trim() === '') {\n return 'Tenant ID is required';\n }\n return true;\n },\n },\n {\n type: 'input',\n name: 'organisation',\n message: 'Organisation (leave empty if same as tenant):',\n },\n {\n type: 'password',\n name: 'apiKey',\n message: 'API Key:',\n mask: '*',\n validate: (input) => {\n if (!input || input.trim() === '') {\n return 'API Key is required';\n }\n return true;\n },\n },\n ]);\n\n const tenant = answers.tenant.trim();\n const organisation = answers.organisation.trim() || tenant;\n const apiKey = answers.apiKey.trim();\n const basePath = generateBasePath(organisation);\n\n logger.info('Testing connection...');\n\n const credential: ApiKeyCredential = {\n type: 'apiKey',\n tenantId: tenant,\n apiKey: apiKey,\n basePath: basePath,\n };\n\n const service = new FarseerService(credential);\n const isConnected = await service.testConnection();\n\n if (!isConnected) {\n logger.error('Connection failed. Please check your credentials.');\n logger.dim(`Tried to connect to: ${basePath}`);\n process.exit(1);\n }\n\n setCredential(tenant, credential);\n\n logger.success(`Successfully connected to ${tenant}!`);\n logger.dim(`Credentials saved for tenant: ${tenant}`);\n logger.dim(`Base path: ${basePath}`);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,sBAAqB;AACrB,oBAAuB;AACvB,2BAKO;AACP,4BAAiD;AAE1C,SAAS,qBAAqB,SAAwB;AACzD,UACK,QAAQ,OAAO,EACf,YAAY,mDAAmD,EAC/D,OAAO,aAAa,wCAAwC,EAC5D,OAAO,mBAAmB,yCAAyC,EACnE,OAAO,OAAO,YAAY;AACvB,QAAI,QAAQ,QAAQ;AAChB,YAAM,gBAAgB;AAAA,IAC1B,OAAO;AACH,YAAM,gBAAgB,QAAQ,KAAK;AAAA,IACvC;AAAA,EACJ,CAAC;AACT;AAEA,eAAe,gBAAgB,OAA+B;AAC1D,QAAM,aAAa,SAAS;AAE5B,uBAAO,OAAO,eAAe;AAC7B,MAAI,OAAO;AACP,yBAAO,KAAK,gBAAgB,UAAU,EAAE;AAAA,EAC5C;AACA,uBAAO,KAAK,8BAA8B;AAC1C,uBAAO,IAAI,oDAAoD;AAE/D,QAAM,SAAS,UAAM,wCAAiB,UAAU;AAEhD,MAAI,CAAC,QAAQ;AACT,yBAAO,MAAM,4BAA4B;AACzC,yBAAO,IAAI,+CAA+C;AAC1D,YAAQ,KAAK,CAAC;AAAA,EAClB;AAEA,QAAM,YAAY,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,YAAY,GAAI;AAE/D,wCAAY;AAAA,IACR,aAAa,OAAO;AAAA,IACpB,cAAc,OAAO;AAAA,IACrB,WAAW,UAAU,YAAY;AAAA,IACjC,OAAO;AAAA,EACX,CAAC;AAED,uBAAO,QAAQ,mBAAmB;AAClC,uBAAO,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