farseer-cli 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +15 -0
- package/README.md +741 -0
- package/dist/commands/app.d.ts +2 -0
- package/dist/commands/app.js +349 -0
- package/dist/commands/app.js.map +7 -0
- package/dist/commands/apps.d.ts +2 -0
- package/dist/commands/apps.js +111 -0
- package/dist/commands/apps.js.map +7 -0
- package/dist/commands/checkout.d.ts +2 -0
- package/dist/commands/checkout.js +166 -0
- package/dist/commands/checkout.js.map +7 -0
- package/dist/commands/config.d.ts +2 -0
- package/dist/commands/config.js +139 -0
- package/dist/commands/config.js.map +7 -0
- package/dist/commands/diff.d.ts +2 -0
- package/dist/commands/diff.js +183 -0
- package/dist/commands/diff.js.map +7 -0
- package/dist/commands/files.js +99 -0
- package/dist/commands/files.js.map +7 -0
- package/dist/commands/install.d.ts +2 -0
- package/dist/commands/install.js +79 -0
- package/dist/commands/install.js.map +7 -0
- package/dist/commands/list.d.ts +2 -0
- package/dist/commands/list.js +92 -0
- package/dist/commands/list.js.map +7 -0
- package/dist/commands/login.d.ts +2 -0
- package/dist/commands/login.js +134 -0
- package/dist/commands/login.js.map +7 -0
- package/dist/commands/logout.d.ts +2 -0
- package/dist/commands/logout.js +59 -0
- package/dist/commands/logout.js.map +7 -0
- package/dist/commands/mcp-server.d.ts +8 -0
- package/dist/commands/mcp-server.js +41 -0
- package/dist/commands/mcp-server.js.map +7 -0
- package/dist/commands/model.d.ts +2 -0
- package/dist/commands/model.js +189 -0
- package/dist/commands/model.js.map +7 -0
- package/dist/commands/pull.d.ts +2 -0
- package/dist/commands/pull.js +287 -0
- package/dist/commands/pull.js.map +7 -0
- package/dist/commands/push.d.ts +2 -0
- package/dist/commands/push.js +251 -0
- package/dist/commands/push.js.map +7 -0
- package/dist/commands/run.d.ts +2 -0
- package/dist/commands/run.js +246 -0
- package/dist/commands/run.js.map +7 -0
- package/dist/commands/setup.d.ts +2 -0
- package/dist/commands/setup.js +137 -0
- package/dist/commands/status.d.ts +2 -0
- package/dist/commands/status.js +145 -0
- package/dist/commands/status.js.map +7 -0
- package/dist/commands/unsetup.d.ts +2 -0
- package/dist/commands/unsetup.js +122 -0
- package/dist/commands/whoami.d.ts +2 -0
- package/dist/commands/whoami.js +63 -0
- package/dist/commands/whoami.js.map +7 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +135 -0
- package/dist/index.js.map +7 -0
- package/dist/mcp/index.d.ts +7 -0
- package/dist/mcp/index.js +35 -0
- package/dist/mcp/index.js.map +7 -0
- package/dist/mcp/prompts/workflows.d.ts +7 -0
- package/dist/mcp/prompts/workflows.js +374 -0
- package/dist/mcp/prompts/workflows.js.map +7 -0
- package/dist/mcp/resources/documentation.d.ts +8 -0
- package/dist/mcp/resources/documentation.js +167 -0
- package/dist/mcp/resources/documentation.js.map +7 -0
- package/dist/mcp/server.d.ts +7 -0
- package/dist/mcp/server.js +49 -0
- package/dist/mcp/server.js.map +7 -0
- package/dist/mcp/tools/appTools.d.ts +7 -0
- package/dist/mcp/tools/appTools.js +377 -0
- package/dist/mcp/tools/appTools.js.map +7 -0
- package/dist/mcp/tools/authTools.d.ts +7 -0
- package/dist/mcp/tools/authTools.js +158 -0
- package/dist/mcp/tools/authTools.js.map +7 -0
- package/dist/mcp/tools/modelTools.d.ts +7 -0
- package/dist/mcp/tools/modelTools.js +331 -0
- package/dist/mcp/tools/modelTools.js.map +7 -0
- package/dist/mcp/tools/runTools.d.ts +7 -0
- package/dist/mcp/tools/runTools.js +231 -0
- package/dist/mcp/tools/runTools.js.map +7 -0
- package/dist/mcp/tools/syncTools.d.ts +7 -0
- package/dist/mcp/tools/syncTools.js +382 -0
- package/dist/mcp/tools/syncTools.js.map +7 -0
- package/dist/mcp/utils/helpers.d.ts +69 -0
- package/dist/mcp/utils/helpers.js +113 -0
- package/dist/mcp/utils/helpers.js.map +7 -0
- package/dist/services/appSyncService.d.ts +75 -0
- package/dist/services/appSyncService.js +370 -0
- package/dist/services/appSyncService.js.map +7 -0
- package/dist/services/configService.d.ts +39 -0
- package/dist/services/configService.js +196 -0
- package/dist/services/configService.js.map +7 -0
- package/dist/services/farseerApi.d.ts +166 -0
- package/dist/services/farseerApi.js +378 -0
- package/dist/services/farseerApi.js.map +7 -0
- package/dist/services/farseerFactory.d.ts +88 -0
- package/dist/services/farseerFactory.js +179 -0
- package/dist/services/farseerFactory.js.map +7 -0
- package/dist/services/farseerService.d.ts +96 -0
- package/dist/services/farseerService.js +614 -0
- package/dist/services/farseerService.js.map +7 -0
- package/dist/services/gitService.d.ts +31 -0
- package/dist/services/gitService.js +134 -0
- package/dist/services/gitService.js.map +7 -0
- package/dist/services/syncService.d.ts +44 -0
- package/dist/services/syncService.js +320 -0
- package/dist/services/syncService.js.map +7 -0
- package/dist/utils/constants.d.ts +7 -0
- package/dist/utils/constants.js +46 -0
- package/dist/utils/constants.js.map +7 -0
- package/dist/utils/helpers.d.ts +69 -0
- package/dist/utils/helpers.js +413 -0
- package/dist/utils/helpers.js.map +7 -0
- package/dist/utils/logger.d.ts +14 -0
- package/dist/utils/logger.js +76 -0
- package/dist/utils/logger.js.map +7 -0
- package/package.json +62 -0
|
@@ -0,0 +1,349 @@
|
|
|
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 app_exports = {};
|
|
29
|
+
__export(app_exports, {
|
|
30
|
+
registerAppCommand: () => registerAppCommand
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(app_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 registerAppCommand(program) {
|
|
38
|
+
const appCmd = program.command("app").description("Manage apps on a Farseer instance").addHelpText("after", `
|
|
39
|
+
Commands:
|
|
40
|
+
list [tenant] List all apps
|
|
41
|
+
show [tenant] <name...> Show app details
|
|
42
|
+
create [tenant] <name...> Create a new app
|
|
43
|
+
configure [tenant] <name...> Configure app (entrypoint, scripts, arguments)
|
|
44
|
+
delete [tenant] <name...> Delete an app (requires --force)
|
|
45
|
+
|
|
46
|
+
Note: App names with spaces don't need quotes if tenant is checked out.
|
|
47
|
+
|
|
48
|
+
Examples:
|
|
49
|
+
$ farseer app list mycompany # List all apps
|
|
50
|
+
$ farseer app show mycompany "My App" # Explicit tenant
|
|
51
|
+
$ farseer app show My App # Uses checked-out tenant
|
|
52
|
+
$ farseer app configure "My App" --entrypoint index.ts
|
|
53
|
+
`);
|
|
54
|
+
appCmd.command("list [tenant]").description("List all apps on a Farseer instance").option("--details", "Show detailed information for each app").action(async (tenantArg, options) => {
|
|
55
|
+
const { organisation, tenant } = (0, import_helpers.resolveTenantWithOrgMapping)(tenantArg);
|
|
56
|
+
const result = await (0, import_farseerFactory.getFarseerClientWithFallback)(organisation, tenant);
|
|
57
|
+
if (!result) {
|
|
58
|
+
(0, import_farseerFactory.showLoginPrompt)(tenant);
|
|
59
|
+
process.exit(1);
|
|
60
|
+
}
|
|
61
|
+
const api = result.client;
|
|
62
|
+
const authLabel = result.authType === "apiKey" ? "API key" : "browser login";
|
|
63
|
+
import_logger.logger.info(`Fetching apps from ${tenant} (using ${authLabel})...`);
|
|
64
|
+
try {
|
|
65
|
+
const apps = await api.listApps();
|
|
66
|
+
if (apps.length === 0) {
|
|
67
|
+
import_logger.logger.warning("No apps found.");
|
|
68
|
+
import_logger.logger.dim("Create an app with: farseer app create <name>");
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
import_logger.logger.header(`Apps on ${tenant}`);
|
|
72
|
+
console.log();
|
|
73
|
+
if (options.details) {
|
|
74
|
+
for (const app of apps) {
|
|
75
|
+
const details = await api.getApp(app.reference);
|
|
76
|
+
if (details) {
|
|
77
|
+
console.log(` \u{1F4E6} ${import_chalk.default.bold(details.name)}`);
|
|
78
|
+
if (details.description) {
|
|
79
|
+
console.log(` ${import_chalk.default.dim(details.description)}`);
|
|
80
|
+
}
|
|
81
|
+
console.log(` Status: ${details.status === "AVAILABLE" ? import_chalk.default.green(details.status) : import_chalk.default.yellow(details.status)}`);
|
|
82
|
+
if (details.scriptFiles.length > 0) {
|
|
83
|
+
const mainScript = details.scriptFiles.find((s) => s.id === details.mainScriptFileId);
|
|
84
|
+
console.log(` Entrypoint: ${mainScript ? import_chalk.default.cyan(mainScript.name) : import_chalk.default.red("Not set")}`);
|
|
85
|
+
console.log(` Scripts:`);
|
|
86
|
+
for (const script of details.scriptFiles) {
|
|
87
|
+
const isMain = script.id === details.mainScriptFileId;
|
|
88
|
+
console.log(` ${isMain ? import_chalk.default.green("\u25B6") : " "} ${script.name}${isMain ? import_chalk.default.dim(" (entrypoint)") : ""}`);
|
|
89
|
+
}
|
|
90
|
+
} else {
|
|
91
|
+
console.log(` Scripts: ${import_chalk.default.dim("None")}`);
|
|
92
|
+
}
|
|
93
|
+
if (details.expectedArguments.length > 0) {
|
|
94
|
+
console.log(` Arguments:`);
|
|
95
|
+
for (const arg of details.expectedArguments) {
|
|
96
|
+
console.log(` - ${arg.name}: ${import_chalk.default.dim(arg.defaultValue)}`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
console.log();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
} else {
|
|
103
|
+
for (const app of apps) {
|
|
104
|
+
console.log(` \u{1F4E6} ${app.name}`);
|
|
105
|
+
}
|
|
106
|
+
console.log();
|
|
107
|
+
import_logger.logger.dim(`Total: ${apps.length} app(s)`);
|
|
108
|
+
import_logger.logger.dim("Use --details to see more information.");
|
|
109
|
+
}
|
|
110
|
+
} catch (error) {
|
|
111
|
+
import_logger.logger.error("Failed to list apps.");
|
|
112
|
+
if (error?.message) {
|
|
113
|
+
import_logger.logger.dim(error.message);
|
|
114
|
+
}
|
|
115
|
+
process.exit(1);
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
appCmd.command("show <args...>").description("Show details of an app").action(async (args) => {
|
|
119
|
+
const { organisation, tenant, appName } = (0, import_helpers.parseAppArgs)(args);
|
|
120
|
+
const result = await (0, import_farseerFactory.getFarseerClientWithFallback)(organisation, tenant);
|
|
121
|
+
if (!result) {
|
|
122
|
+
(0, import_farseerFactory.showLoginPrompt)(tenant);
|
|
123
|
+
process.exit(1);
|
|
124
|
+
}
|
|
125
|
+
const api = result.client;
|
|
126
|
+
const app = await api.getAppByName(appName);
|
|
127
|
+
if (!app) {
|
|
128
|
+
import_logger.logger.error(`App not found: ${appName}`);
|
|
129
|
+
process.exit(1);
|
|
130
|
+
}
|
|
131
|
+
import_logger.logger.header(`App: ${app.name}`);
|
|
132
|
+
console.log();
|
|
133
|
+
console.log(` ID: ${app.id}`);
|
|
134
|
+
console.log(` Status: ${app.status}`);
|
|
135
|
+
if (app.description) {
|
|
136
|
+
console.log(` Description: ${app.description}`);
|
|
137
|
+
}
|
|
138
|
+
console.log();
|
|
139
|
+
if (app.scriptFiles.length > 0) {
|
|
140
|
+
console.log(" Scripts:");
|
|
141
|
+
for (const script of app.scriptFiles) {
|
|
142
|
+
const isMain = script.id === app.mainScriptFileId;
|
|
143
|
+
console.log(` ${isMain ? import_chalk.default.green("\u25B6") : " "} ${script.name}${isMain ? import_chalk.default.dim(" (entrypoint)") : ""}`);
|
|
144
|
+
}
|
|
145
|
+
} else {
|
|
146
|
+
console.log(" Scripts: None");
|
|
147
|
+
}
|
|
148
|
+
console.log();
|
|
149
|
+
if (app.expectedArguments.length > 0) {
|
|
150
|
+
console.log(" Arguments:");
|
|
151
|
+
for (const arg of app.expectedArguments) {
|
|
152
|
+
console.log(` - ${arg.name}: ${import_chalk.default.dim(arg.defaultValue)}`);
|
|
153
|
+
}
|
|
154
|
+
} else {
|
|
155
|
+
console.log(" Arguments: None");
|
|
156
|
+
}
|
|
157
|
+
console.log();
|
|
158
|
+
});
|
|
159
|
+
appCmd.command("create <args...>").description("Create a new app").action(async (args) => {
|
|
160
|
+
const { organisation, tenant, appName } = (0, import_helpers.parseAppArgs)(args);
|
|
161
|
+
const result = await (0, import_farseerFactory.getFarseerClientWithFallback)(organisation, tenant);
|
|
162
|
+
if (!result) {
|
|
163
|
+
(0, import_farseerFactory.showLoginPrompt)(tenant);
|
|
164
|
+
process.exit(1);
|
|
165
|
+
}
|
|
166
|
+
const api = result.client;
|
|
167
|
+
const existing = await api.getAppByName(appName);
|
|
168
|
+
if (existing) {
|
|
169
|
+
import_logger.logger.error(`App already exists: ${appName}`);
|
|
170
|
+
process.exit(1);
|
|
171
|
+
}
|
|
172
|
+
import_logger.logger.info(`Creating app: ${appName}...`);
|
|
173
|
+
try {
|
|
174
|
+
const app = await api.createApp(appName);
|
|
175
|
+
import_logger.logger.success(`App created: ${app.name} (ID: ${app.id})`);
|
|
176
|
+
import_logger.logger.dim('Configure it with: farseer app configure "' + appName + '"');
|
|
177
|
+
} catch (error) {
|
|
178
|
+
import_logger.logger.error("Failed to create app.");
|
|
179
|
+
if (error instanceof Error) {
|
|
180
|
+
import_logger.logger.dim(error.message);
|
|
181
|
+
}
|
|
182
|
+
process.exit(1);
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
appCmd.command("delete <args...>").description("Delete an app").option("--force", "Skip confirmation").action(async (args, options) => {
|
|
186
|
+
const { organisation, tenant, appName } = (0, import_helpers.parseAppArgs)(args);
|
|
187
|
+
const result = await (0, import_farseerFactory.getFarseerClientWithFallback)(organisation, tenant);
|
|
188
|
+
if (!result) {
|
|
189
|
+
(0, import_farseerFactory.showLoginPrompt)(tenant);
|
|
190
|
+
process.exit(1);
|
|
191
|
+
}
|
|
192
|
+
const api = result.client;
|
|
193
|
+
const apps = await api.listApps();
|
|
194
|
+
const app = apps.find((a) => a.name.toLowerCase() === appName.toLowerCase());
|
|
195
|
+
if (!app) {
|
|
196
|
+
import_logger.logger.error(`App not found: ${appName}`);
|
|
197
|
+
process.exit(1);
|
|
198
|
+
}
|
|
199
|
+
if (!options.force) {
|
|
200
|
+
import_logger.logger.warning(`This will permanently delete app: ${app.name}`);
|
|
201
|
+
import_logger.logger.dim("Use --force to skip this confirmation.");
|
|
202
|
+
process.exit(1);
|
|
203
|
+
}
|
|
204
|
+
import_logger.logger.info(`Deleting app: ${app.name}...`);
|
|
205
|
+
try {
|
|
206
|
+
await api.deleteApp(app.reference);
|
|
207
|
+
import_logger.logger.success(`App deleted: ${app.name}`);
|
|
208
|
+
} catch (error) {
|
|
209
|
+
import_logger.logger.error("Failed to delete app.");
|
|
210
|
+
if (error instanceof Error) {
|
|
211
|
+
import_logger.logger.dim(error.message);
|
|
212
|
+
}
|
|
213
|
+
process.exit(1);
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
appCmd.command("configure <args...>").description("Configure an app (set entrypoint, scripts, arguments)").option("--entrypoint <script>", 'Set the entrypoint script (e.g., "index.ts")').option("--scripts <scripts>", "Comma-separated list of scripts to include").option("--add-arg <arg>", 'Add argument in format "Name=DefaultValue" (can be used multiple times)', collectArgs, []).option("--description <desc>", "Set app description").option("--name <name>", "Rename the app").action(async (args, options) => {
|
|
217
|
+
const { organisation, tenant, appName } = (0, import_helpers.parseAppArgs)(args);
|
|
218
|
+
const result = await (0, import_farseerFactory.getFarseerClientWithFallback)(organisation, tenant);
|
|
219
|
+
if (!result) {
|
|
220
|
+
(0, import_farseerFactory.showLoginPrompt)(tenant);
|
|
221
|
+
process.exit(1);
|
|
222
|
+
}
|
|
223
|
+
const api = result.client;
|
|
224
|
+
const apps = await api.listApps();
|
|
225
|
+
const appListItem = apps.find((a) => a.name.toLowerCase() === appName.toLowerCase());
|
|
226
|
+
if (!appListItem) {
|
|
227
|
+
import_logger.logger.error(`App not found: ${appName}`);
|
|
228
|
+
process.exit(1);
|
|
229
|
+
}
|
|
230
|
+
const app = await api.getApp(appListItem.reference);
|
|
231
|
+
if (!app) {
|
|
232
|
+
import_logger.logger.error(`Failed to load app details: ${appName}`);
|
|
233
|
+
process.exit(1);
|
|
234
|
+
}
|
|
235
|
+
const update = {};
|
|
236
|
+
if (options.name) {
|
|
237
|
+
update.name = options.name;
|
|
238
|
+
}
|
|
239
|
+
if (options.description !== void 0) {
|
|
240
|
+
update.description = options.description;
|
|
241
|
+
}
|
|
242
|
+
if (options.scripts || options.entrypoint) {
|
|
243
|
+
const availableScripts = await api.getScriptFiles();
|
|
244
|
+
let autoSetEntrypoint = false;
|
|
245
|
+
let autoEntrypointName = "";
|
|
246
|
+
if (options.scripts) {
|
|
247
|
+
const scriptNames = options.scripts.split(",").map((s) => s.trim());
|
|
248
|
+
const scriptIds = [];
|
|
249
|
+
const resolvedScripts = [];
|
|
250
|
+
for (const name of scriptNames) {
|
|
251
|
+
const script = availableScripts.find((s) => s.name.toLowerCase() === name.toLowerCase());
|
|
252
|
+
if (!script) {
|
|
253
|
+
import_logger.logger.error(`Script not found: ${name}`);
|
|
254
|
+
import_logger.logger.dim("Available scripts: " + availableScripts.map((s) => s.name).join(", "));
|
|
255
|
+
process.exit(1);
|
|
256
|
+
}
|
|
257
|
+
scriptIds.push(script.id);
|
|
258
|
+
resolvedScripts.push({ id: script.id, name: script.name });
|
|
259
|
+
}
|
|
260
|
+
update.scriptFileIds = scriptIds;
|
|
261
|
+
if (!options.entrypoint && !app.mainScriptFileId && resolvedScripts.length > 0) {
|
|
262
|
+
update.mainScriptFileId = resolvedScripts[0].id;
|
|
263
|
+
autoSetEntrypoint = true;
|
|
264
|
+
autoEntrypointName = resolvedScripts[0].name;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
if (options.entrypoint) {
|
|
268
|
+
const entryScript = availableScripts.find(
|
|
269
|
+
(s) => s.name.toLowerCase() === options.entrypoint.toLowerCase()
|
|
270
|
+
);
|
|
271
|
+
if (!entryScript) {
|
|
272
|
+
import_logger.logger.error(`Entrypoint script not found: ${options.entrypoint}`);
|
|
273
|
+
import_logger.logger.dim("Available scripts: " + availableScripts.map((s) => s.name).join(", "));
|
|
274
|
+
process.exit(1);
|
|
275
|
+
}
|
|
276
|
+
update.mainScriptFileId = entryScript.id;
|
|
277
|
+
if (!update.scriptFileIds) {
|
|
278
|
+
update.scriptFileIds = [entryScript.id];
|
|
279
|
+
} else if (!update.scriptFileIds.includes(entryScript.id)) {
|
|
280
|
+
update.scriptFileIds.push(entryScript.id);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
if (autoSetEntrypoint) {
|
|
284
|
+
import_logger.logger.info(`Auto-set "${autoEntrypointName}" as entrypoint (first script).`);
|
|
285
|
+
import_logger.logger.dim(`Change with: farseer app configure "${appName}" --entrypoint <script>`);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
if (options.addArg && options.addArg.length > 0) {
|
|
289
|
+
const newArgs = [...app.expectedArguments];
|
|
290
|
+
for (const arg of options.addArg) {
|
|
291
|
+
const [name, defaultValue] = arg.split("=");
|
|
292
|
+
if (!name || defaultValue === void 0) {
|
|
293
|
+
import_logger.logger.error(`Invalid argument format: ${arg}`);
|
|
294
|
+
import_logger.logger.dim('Use format: --add-arg "Name=DefaultValue"');
|
|
295
|
+
process.exit(1);
|
|
296
|
+
}
|
|
297
|
+
const existingIdx = newArgs.findIndex((a) => a.name.toLowerCase() === name.toLowerCase());
|
|
298
|
+
if (existingIdx >= 0) {
|
|
299
|
+
newArgs[existingIdx] = { name, type: "variable", defaultValue };
|
|
300
|
+
} else {
|
|
301
|
+
newArgs.push({ name, type: "variable", defaultValue });
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
update.expectedArguments = newArgs;
|
|
305
|
+
}
|
|
306
|
+
if (Object.keys(update).length === 0) {
|
|
307
|
+
import_logger.logger.warning("No changes specified.");
|
|
308
|
+
import_logger.logger.dim("Use --entrypoint, --scripts, --add-arg, --description, or --name to configure the app.");
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
import_logger.logger.info(`Updating app: ${app.name}...`);
|
|
312
|
+
try {
|
|
313
|
+
if (!update.name) {
|
|
314
|
+
update.name = app.name;
|
|
315
|
+
}
|
|
316
|
+
if (update.description === void 0) {
|
|
317
|
+
update.description = app.description || "";
|
|
318
|
+
}
|
|
319
|
+
const updated = await api.updateApp(appListItem.reference, update);
|
|
320
|
+
import_logger.logger.success(`App updated: ${updated.name}`);
|
|
321
|
+
if (update.name) console.log(` Name: ${updated.name}`);
|
|
322
|
+
if (update.description !== void 0) console.log(` Description: ${updated.description || "(empty)"}`);
|
|
323
|
+
if (update.mainScriptFileId) {
|
|
324
|
+
const mainScript = updated.scriptFiles.find((s) => s.id === updated.mainScriptFileId);
|
|
325
|
+
console.log(` Entrypoint: ${mainScript?.name}`);
|
|
326
|
+
}
|
|
327
|
+
if (update.scriptFileIds) {
|
|
328
|
+
console.log(` Scripts: ${updated.scriptFiles.map((s) => s.name).join(", ")}`);
|
|
329
|
+
}
|
|
330
|
+
if (update.expectedArguments) {
|
|
331
|
+
console.log(` Arguments: ${updated.expectedArguments.map((a) => `${a.name}=${a.defaultValue}`).join(", ")}`);
|
|
332
|
+
}
|
|
333
|
+
} catch (error) {
|
|
334
|
+
import_logger.logger.error("Failed to update app.");
|
|
335
|
+
if (error instanceof Error) {
|
|
336
|
+
import_logger.logger.dim(error.message);
|
|
337
|
+
}
|
|
338
|
+
process.exit(1);
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
function collectArgs(value, previous) {
|
|
343
|
+
return previous.concat([value]);
|
|
344
|
+
}
|
|
345
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
346
|
+
0 && (module.exports = {
|
|
347
|
+
registerAppCommand
|
|
348
|
+
});
|
|
349
|
+
//# sourceMappingURL=app.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/commands/app.ts"],
|
|
4
|
+
"sourcesContent": ["import { Command } from 'commander';\nimport chalk from 'chalk';\nimport { logger } from '../utils/logger';\nimport { getFarseerClientWithFallback, showLoginPrompt, IFarseerClient } from '../services/farseerFactory';\nimport { AppArgument } from '../services/farseerApi';\nimport { parseAppArgs, resolveTenantWithOrgMapping } from '../utils/helpers';\n\nexport function registerAppCommand(program: Command): void {\n const appCmd = program\n .command('app')\n .description('Manage apps on a Farseer instance')\n .addHelpText('after', `\nCommands:\n list [tenant] List all apps\n show [tenant] <name...> Show app details\n create [tenant] <name...> Create a new app\n configure [tenant] <name...> Configure app (entrypoint, scripts, arguments)\n delete [tenant] <name...> Delete an app (requires --force)\n\nNote: App names with spaces don't need quotes if tenant is checked out.\n\nExamples:\n $ farseer app list mycompany # List all apps\n $ farseer app show mycompany \"My App\" # Explicit tenant\n $ farseer app show My App # Uses checked-out tenant\n $ farseer app configure \"My App\" --entrypoint index.ts\n`);\n\n // List apps\n appCmd\n .command('list [tenant]')\n .description('List all apps on a Farseer instance')\n .option('--details', 'Show detailed information for each app')\n .action(async (tenantArg, options) => {\n const { organisation, tenant } = resolveTenantWithOrgMapping(tenantArg);\n\n const result = await getFarseerClientWithFallback(organisation, tenant);\n if (!result) {\n showLoginPrompt(tenant);\n process.exit(1);\n }\n\n const api = result.client;\n const authLabel = result.authType === 'apiKey' ? 'API key' : 'browser login';\n logger.info(`Fetching apps from ${tenant} (using ${authLabel})...`);\n\n try {\n const apps = await api.listApps();\n\n if (apps.length === 0) {\n logger.warning('No apps found.');\n logger.dim('Create an app with: farseer app create <name>');\n return;\n }\n\n logger.header(`Apps on ${tenant}`);\n console.log();\n\n if (options.details) {\n // Fetch full details for each app\n for (const app of apps) {\n const details = await api.getApp(app.reference);\n if (details) {\n console.log(` \uD83D\uDCE6 ${chalk.bold(details.name)}`);\n if (details.description) {\n console.log(` ${chalk.dim(details.description)}`);\n }\n console.log(` Status: ${details.status === 'AVAILABLE' ? chalk.green(details.status) : chalk.yellow(details.status)}`);\n if (details.scriptFiles.length > 0) {\n const mainScript = details.scriptFiles.find(s => s.id === details.mainScriptFileId);\n console.log(` Entrypoint: ${mainScript ? chalk.cyan(mainScript.name) : chalk.red('Not set')}`);\n console.log(` Scripts:`);\n for (const script of details.scriptFiles) {\n const isMain = script.id === details.mainScriptFileId;\n console.log(` ${isMain ? chalk.green('\u25B6') : ' '} ${script.name}${isMain ? chalk.dim(' (entrypoint)') : ''}`);\n }\n } else {\n console.log(` Scripts: ${chalk.dim('None')}`);\n }\n if (details.expectedArguments.length > 0) {\n console.log(` Arguments:`);\n for (const arg of details.expectedArguments) {\n console.log(` - ${arg.name}: ${chalk.dim(arg.defaultValue)}`);\n }\n }\n console.log();\n }\n }\n } else {\n // Simple list\n for (const app of apps) {\n console.log(` \uD83D\uDCE6 ${app.name}`);\n }\n console.log();\n logger.dim(`Total: ${apps.length} app(s)`);\n logger.dim('Use --details to see more information.');\n }\n } catch (error: any) {\n logger.error('Failed to list apps.');\n if (error?.message) {\n logger.dim(error.message);\n }\n process.exit(1);\n }\n });\n\n // Show app details\n appCmd\n .command('show <args...>')\n .description('Show details of an app')\n .action(async (args: string[]) => {\n const { organisation, tenant, appName } = parseAppArgs(args);\n const result = await getFarseerClientWithFallback(organisation, tenant);\n if (!result) {\n showLoginPrompt(tenant);\n process.exit(1);\n }\n\n const api: IFarseerClient = result.client;\n const app = await api.getAppByName(appName);\n\n if (!app) {\n logger.error(`App not found: ${appName}`);\n process.exit(1);\n }\n\n logger.header(`App: ${app.name}`);\n console.log();\n console.log(` ID: ${app.id}`);\n console.log(` Status: ${app.status}`);\n if (app.description) {\n console.log(` Description: ${app.description}`);\n }\n console.log();\n\n if (app.scriptFiles.length > 0) {\n console.log(' Scripts:');\n for (const script of app.scriptFiles) {\n const isMain = script.id === app.mainScriptFileId;\n console.log(` ${isMain ? chalk.green('\u25B6') : ' '} ${script.name}${isMain ? chalk.dim(' (entrypoint)') : ''}`);\n }\n } else {\n console.log(' Scripts: None');\n }\n console.log();\n\n if (app.expectedArguments.length > 0) {\n console.log(' Arguments:');\n for (const arg of app.expectedArguments) {\n console.log(` - ${arg.name}: ${chalk.dim(arg.defaultValue)}`);\n }\n } else {\n console.log(' Arguments: None');\n }\n console.log();\n });\n\n // Create app\n appCmd\n .command('create <args...>')\n .description('Create a new app')\n .action(async (args: string[]) => {\n const { organisation, tenant, appName } = parseAppArgs(args);\n const result = await getFarseerClientWithFallback(organisation, tenant);\n if (!result) {\n showLoginPrompt(tenant);\n process.exit(1);\n }\n\n const api: IFarseerClient = result.client;\n\n // Check if app already exists\n const existing = await api.getAppByName(appName);\n if (existing) {\n logger.error(`App already exists: ${appName}`);\n process.exit(1);\n }\n\n logger.info(`Creating app: ${appName}...`);\n\n try {\n const app = await api.createApp(appName);\n logger.success(`App created: ${app.name} (ID: ${app.id})`);\n logger.dim('Configure it with: farseer app configure \"' + appName + '\"');\n } catch (error) {\n logger.error('Failed to create app.');\n if (error instanceof Error) {\n logger.dim(error.message);\n }\n process.exit(1);\n }\n });\n\n // Delete app\n appCmd\n .command('delete <args...>')\n .description('Delete an app')\n .option('--force', 'Skip confirmation')\n .action(async (args: string[], options) => {\n const { organisation, tenant, appName } = parseAppArgs(args);\n const result = await getFarseerClientWithFallback(organisation, tenant);\n if (!result) {\n showLoginPrompt(tenant);\n process.exit(1);\n }\n\n const api: IFarseerClient = result.client;\n\n // Find app\n const apps = await api.listApps();\n const app = apps.find((a: { name: string }) => a.name.toLowerCase() === appName.toLowerCase());\n if (!app) {\n logger.error(`App not found: ${appName}`);\n process.exit(1);\n }\n\n if (!options.force) {\n logger.warning(`This will permanently delete app: ${app.name}`);\n logger.dim('Use --force to skip this confirmation.');\n process.exit(1);\n }\n\n logger.info(`Deleting app: ${app.name}...`);\n\n try {\n await api.deleteApp(app.reference);\n logger.success(`App deleted: ${app.name}`);\n } catch (error) {\n logger.error('Failed to delete app.');\n if (error instanceof Error) {\n logger.dim(error.message);\n }\n process.exit(1);\n }\n });\n\n // Configure app\n appCmd\n .command('configure <args...>')\n .description('Configure an app (set entrypoint, scripts, arguments)')\n .option('--entrypoint <script>', 'Set the entrypoint script (e.g., \"index.ts\")')\n .option('--scripts <scripts>', 'Comma-separated list of scripts to include')\n .option('--add-arg <arg>', 'Add argument in format \"Name=DefaultValue\" (can be used multiple times)', collectArgs, [])\n .option('--description <desc>', 'Set app description')\n .option('--name <name>', 'Rename the app')\n .action(async (args: string[], options) => {\n const { organisation, tenant, appName } = parseAppArgs(args);\n const result = await getFarseerClientWithFallback(organisation, tenant);\n if (!result) {\n showLoginPrompt(tenant);\n process.exit(1);\n }\n\n const api: IFarseerClient = result.client;\n\n // Find app\n const apps = await api.listApps();\n const appListItem = apps.find((a: { name: string }) => a.name.toLowerCase() === appName.toLowerCase());\n if (!appListItem) {\n logger.error(`App not found: ${appName}`);\n process.exit(1);\n }\n\n const app = await api.getApp(appListItem.reference);\n if (!app) {\n logger.error(`Failed to load app details: ${appName}`);\n process.exit(1);\n }\n\n // Build update object\n const update: {\n name?: string;\n description?: string;\n expectedArguments?: AppArgument[];\n mainScriptFileId?: string | null;\n scriptFileIds?: string[];\n } = {};\n\n if (options.name) {\n update.name = options.name;\n }\n\n if (options.description !== undefined) {\n update.description = options.description;\n }\n\n // Handle scripts and entrypoint\n if (options.scripts || options.entrypoint) {\n const availableScripts = await api.getScriptFiles();\n let autoSetEntrypoint = false;\n let autoEntrypointName = '';\n\n if (options.scripts) {\n const scriptNames = options.scripts.split(',').map((s: string) => s.trim());\n const scriptIds: string[] = [];\n const resolvedScripts: { id: string; name: string }[] = [];\n\n for (const name of scriptNames) {\n const script = availableScripts.find((s: { name: string }) => s.name.toLowerCase() === name.toLowerCase());\n if (!script) {\n logger.error(`Script not found: ${name}`);\n logger.dim('Available scripts: ' + availableScripts.map((s: { name: string }) => s.name).join(', '));\n process.exit(1);\n }\n scriptIds.push(script.id);\n resolvedScripts.push({ id: script.id, name: script.name });\n }\n\n update.scriptFileIds = scriptIds;\n\n // Auto-set first script as entrypoint if no entrypoint specified and app has none\n if (!options.entrypoint && !app.mainScriptFileId && resolvedScripts.length > 0) {\n update.mainScriptFileId = resolvedScripts[0].id;\n autoSetEntrypoint = true;\n autoEntrypointName = resolvedScripts[0].name;\n }\n }\n\n if (options.entrypoint) {\n const entryScript = availableScripts.find(\n (s: { name: string }) => s.name.toLowerCase() === options.entrypoint.toLowerCase()\n );\n if (!entryScript) {\n logger.error(`Entrypoint script not found: ${options.entrypoint}`);\n logger.dim('Available scripts: ' + availableScripts.map((s: { name: string }) => s.name).join(', '));\n process.exit(1);\n }\n update.mainScriptFileId = entryScript.id;\n\n // If setting entrypoint but no scripts specified, include the entrypoint in scripts\n if (!update.scriptFileIds) {\n update.scriptFileIds = [entryScript.id];\n } else if (!update.scriptFileIds.includes(entryScript.id)) {\n update.scriptFileIds.push(entryScript.id);\n }\n }\n\n // Notify user about auto-set entrypoint\n if (autoSetEntrypoint) {\n logger.info(`Auto-set \"${autoEntrypointName}\" as entrypoint (first script).`);\n logger.dim(`Change with: farseer app configure \"${appName}\" --entrypoint <script>`);\n }\n }\n\n // Handle arguments\n if (options.addArg && options.addArg.length > 0) {\n const newArgs: AppArgument[] = [...app.expectedArguments];\n\n for (const arg of options.addArg) {\n const [name, defaultValue] = arg.split('=');\n if (!name || defaultValue === undefined) {\n logger.error(`Invalid argument format: ${arg}`);\n logger.dim('Use format: --add-arg \"Name=DefaultValue\"');\n process.exit(1);\n }\n\n // Check if arg already exists\n const existingIdx = newArgs.findIndex((a) => a.name.toLowerCase() === name.toLowerCase());\n if (existingIdx >= 0) {\n newArgs[existingIdx] = { name, type: 'variable', defaultValue };\n } else {\n newArgs.push({ name, type: 'variable', defaultValue });\n }\n }\n\n update.expectedArguments = newArgs;\n }\n\n if (Object.keys(update).length === 0) {\n logger.warning('No changes specified.');\n logger.dim('Use --entrypoint, --scripts, --add-arg, --description, or --name to configure the app.');\n return;\n }\n\n logger.info(`Updating app: ${app.name}...`);\n\n try {\n // API requires name field to be present\n if (!update.name) {\n update.name = app.name;\n }\n if (update.description === undefined) {\n update.description = app.description || '';\n }\n const updated = await api.updateApp(appListItem.reference, update);\n logger.success(`App updated: ${updated.name}`);\n\n // Show summary of changes\n if (update.name) console.log(` Name: ${updated.name}`);\n if (update.description !== undefined) console.log(` Description: ${updated.description || '(empty)'}`);\n if (update.mainScriptFileId) {\n const mainScript = updated.scriptFiles.find((s: { id: string | number }) => s.id === updated.mainScriptFileId);\n console.log(` Entrypoint: ${mainScript?.name}`);\n }\n if (update.scriptFileIds) {\n console.log(` Scripts: ${updated.scriptFiles.map((s: { name: string }) => s.name).join(', ')}`);\n }\n if (update.expectedArguments) {\n console.log(` Arguments: ${updated.expectedArguments.map((a: { name: string; defaultValue: string }) => `${a.name}=${a.defaultValue}`).join(', ')}`);\n }\n } catch (error) {\n logger.error('Failed to update app.');\n if (error instanceof Error) {\n logger.dim(error.message);\n }\n process.exit(1);\n }\n });\n}\n\n// Helper to collect multiple --add-arg options\nfunction collectArgs(value: string, previous: string[]): string[] {\n return previous.concat([value]);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAkB;AAClB,oBAAuB;AACvB,4BAA8E;AAE9E,qBAA0D;AAEnD,SAAS,mBAAmB,SAAwB;AACvD,QAAM,SAAS,QACV,QAAQ,KAAK,EACb,YAAY,mCAAmC,EAC/C,YAAY,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAe7B;AAGG,SACK,QAAQ,eAAe,EACvB,YAAY,qCAAqC,EACjD,OAAO,aAAa,wCAAwC,EAC5D,OAAO,OAAO,WAAW,YAAY;AAClC,UAAM,EAAE,cAAc,OAAO,QAAI,4CAA4B,SAAS;AAEtE,UAAM,SAAS,UAAM,oDAA6B,cAAc,MAAM;AACtE,QAAI,CAAC,QAAQ;AACT,iDAAgB,MAAM;AACtB,cAAQ,KAAK,CAAC;AAAA,IAClB;AAEA,UAAM,MAAM,OAAO;AACnB,UAAM,YAAY,OAAO,aAAa,WAAW,YAAY;AAC7D,yBAAO,KAAK,sBAAsB,MAAM,WAAW,SAAS,MAAM;AAElE,QAAI;AACA,YAAM,OAAO,MAAM,IAAI,SAAS;AAEhC,UAAI,KAAK,WAAW,GAAG;AACnB,6BAAO,QAAQ,gBAAgB;AAC/B,6BAAO,IAAI,+CAA+C;AAC1D;AAAA,MACJ;AAEA,2BAAO,OAAO,WAAW,MAAM,EAAE;AACjC,cAAQ,IAAI;AAEZ,UAAI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+B,EAAE,OAAO,QAAQ,gBAAgB;AAC7G,gBAAQ,IAAI,iBAAiB,YAAY,IAAI,EAAE;AAAA,MACnD;AACA,UAAI,OAAO,eAAe;AACtB,gBAAQ,IAAI,cAAc,QAAQ,YAAY,IAAI,CAAC,MAAwB,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC,EAAE;AAAA,MACnG;AACA,UAAI,OAAO,mBAAmB;AAC1B,gBAAQ,IAAI,gBAAgB,QAAQ,kBAAkB,IAAI,CAAC,MAA8C,GAAG,EAAE,IAAI,IAAI,EAAE,YAAY,EAAE,EAAE,KAAK,IAAI,CAAC,EAAE;AAAA,MACxJ;AAAA,IACJ,SAAS,OAAO;AACZ,2BAAO,MAAM,uBAAuB;AACpC,UAAI,iBAAiB,OAAO;AACxB,6BAAO,IAAI,MAAM,OAAO;AAAA,MAC5B;AACA,cAAQ,KAAK,CAAC;AAAA,IAClB;AAAA,EACJ,CAAC;AACT;AAGA,SAAS,YAAY,OAAe,UAA8B;AAC9D,SAAO,SAAS,OAAO,CAAC,KAAK,CAAC;AAClC;",
|
|
6
|
+
"names": ["chalk"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
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 apps_exports = {};
|
|
29
|
+
__export(apps_exports, {
|
|
30
|
+
registerAppsCommand: () => registerAppsCommand
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(apps_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 registerAppsCommand(program) {
|
|
38
|
+
program.command("apps [tenant]").description("List all apps on a Farseer instance").option("--details", "Show detailed information for each app").action(async (tenantArg, options) => {
|
|
39
|
+
const { organisation, tenant } = (0, import_helpers.resolveTenantWithOrgMapping)(tenantArg);
|
|
40
|
+
const result = await (0, import_farseerFactory.getFarseerClientWithFallback)(organisation, tenant);
|
|
41
|
+
if (!result) {
|
|
42
|
+
(0, import_farseerFactory.showLoginPrompt)(tenant);
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
45
|
+
const api = result.client;
|
|
46
|
+
const authLabel = result.authType === "apiKey" ? "API key" : "browser login";
|
|
47
|
+
import_logger.logger.info(`Fetching apps from ${tenant} (using ${authLabel})...`);
|
|
48
|
+
try {
|
|
49
|
+
const apps = await api.listApps();
|
|
50
|
+
if (apps.length === 0) {
|
|
51
|
+
import_logger.logger.warning("No apps found.");
|
|
52
|
+
import_logger.logger.dim("Create an app with: farseer app create <app-name>");
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
import_logger.logger.header(`Apps on ${tenant}`);
|
|
56
|
+
console.log();
|
|
57
|
+
if (options.details) {
|
|
58
|
+
for (const app of apps) {
|
|
59
|
+
const details = await api.getApp(app.reference);
|
|
60
|
+
if (details) {
|
|
61
|
+
console.log(` \u{1F4E6} ${import_chalk.default.bold(details.name)}`);
|
|
62
|
+
if (details.description) {
|
|
63
|
+
console.log(` ${import_chalk.default.dim(details.description)}`);
|
|
64
|
+
}
|
|
65
|
+
console.log(` Status: ${details.status === "AVAILABLE" ? import_chalk.default.green(details.status) : import_chalk.default.yellow(details.status)}`);
|
|
66
|
+
if (details.scriptFiles.length > 0) {
|
|
67
|
+
const mainScript = details.scriptFiles.find((s) => s.id === details.mainScriptFileId);
|
|
68
|
+
console.log(` Entrypoint: ${mainScript ? import_chalk.default.cyan(mainScript.name) : import_chalk.default.red("Not set")}`);
|
|
69
|
+
console.log(` Scripts:`);
|
|
70
|
+
for (const script of details.scriptFiles) {
|
|
71
|
+
const isMain = script.id === details.mainScriptFileId;
|
|
72
|
+
console.log(` ${isMain ? import_chalk.default.green("\u25B6") : " "} ${script.name}${isMain ? import_chalk.default.dim(" (entrypoint)") : ""}`);
|
|
73
|
+
}
|
|
74
|
+
} else {
|
|
75
|
+
console.log(` Scripts: ${import_chalk.default.dim("None")}`);
|
|
76
|
+
}
|
|
77
|
+
if (details.expectedArguments.length > 0) {
|
|
78
|
+
console.log(` Arguments:`);
|
|
79
|
+
for (const arg of details.expectedArguments) {
|
|
80
|
+
console.log(` - ${arg.name}: ${import_chalk.default.dim(arg.defaultValue)}`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
console.log();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
} else {
|
|
87
|
+
for (const app of apps) {
|
|
88
|
+
console.log(` \u{1F4E6} ${app.name}`);
|
|
89
|
+
}
|
|
90
|
+
console.log();
|
|
91
|
+
import_logger.logger.dim(`Total: ${apps.length} app(s)`);
|
|
92
|
+
import_logger.logger.dim("Use --details to see more information.");
|
|
93
|
+
}
|
|
94
|
+
} catch (error) {
|
|
95
|
+
if ((0, import_farseerFactory.isAuthError)(error)) {
|
|
96
|
+
(0, import_farseerFactory.showLoginPrompt)(tenant);
|
|
97
|
+
} else {
|
|
98
|
+
import_logger.logger.error("Failed to list apps.");
|
|
99
|
+
if (error instanceof Error) {
|
|
100
|
+
import_logger.logger.dim(error.message);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
process.exit(1);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
108
|
+
0 && (module.exports = {
|
|
109
|
+
registerAppsCommand
|
|
110
|
+
});
|
|
111
|
+
//# sourceMappingURL=apps.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/commands/apps.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 registerAppsCommand(program: Command): void {\n program\n .command('apps [tenant]')\n .description('List all apps on a Farseer instance')\n .option('--details', 'Show detailed information for each app')\n .action(async (tenantArg, options) => {\n const { organisation, tenant } = resolveTenantWithOrgMapping(tenantArg);\n const result = await getFarseerClientWithFallback(organisation, tenant);\n\n if (!result) {\n showLoginPrompt(tenant);\n process.exit(1);\n }\n\n const api = result.client;\n const authLabel = result.authType === 'apiKey' ? 'API key' : 'browser login';\n logger.info(`Fetching apps from ${tenant} (using ${authLabel})...`);\n\n try {\n const apps = await api.listApps();\n\n if (apps.length === 0) {\n logger.warning('No apps found.');\n logger.dim('Create an app with: farseer app create <app-name>');\n return;\n }\n\n logger.header(`Apps on ${tenant}`);\n console.log();\n\n if (options.details) {\n // Fetch full details for each app\n for (const app of apps) {\n const details = await api.getApp(app.reference);\n if (details) {\n console.log(` \uD83D\uDCE6 ${chalk.bold(details.name)}`);\n if (details.description) {\n console.log(` ${chalk.dim(details.description)}`);\n }\n console.log(` Status: ${details.status === 'AVAILABLE' ? chalk.green(details.status) : chalk.yellow(details.status)}`);\n if (details.scriptFiles.length > 0) {\n const mainScript = details.scriptFiles.find(s => s.id === details.mainScriptFileId);\n console.log(` Entrypoint: ${mainScript ? chalk.cyan(mainScript.name) : chalk.red('Not set')}`);\n console.log(` Scripts:`);\n for (const script of details.scriptFiles) {\n const isMain = script.id === details.mainScriptFileId;\n console.log(` ${isMain ? chalk.green('\u25B6') : ' '} ${script.name}${isMain ? chalk.dim(' (entrypoint)') : ''}`);\n }\n } else {\n console.log(` Scripts: ${chalk.dim('None')}`);\n }\n if (details.expectedArguments.length > 0) {\n console.log(` Arguments:`);\n for (const arg of details.expectedArguments) {\n console.log(` - ${arg.name}: ${chalk.dim(arg.defaultValue)}`);\n }\n }\n console.log();\n }\n }\n } else {\n // Simple list\n for (const app of apps) {\n console.log(` \uD83D\uDCE6 ${app.name}`);\n }\n console.log();\n logger.dim(`Total: ${apps.length} app(s)`);\n logger.dim('Use --details to see more information.');\n }\n } catch (error) {\n if (isAuthError(error)) {\n showLoginPrompt(tenant);\n } else {\n logger.error('Failed to list apps.');\n if (error instanceof Error) {\n logger.dim(error.message);\n }\n }\n process.exit(1);\n }\n });\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAkB;AAClB,oBAAuB;AACvB,4BAA2E;AAC3E,qB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