farseer-cli 1.0.9 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/dist/commands/app.js +344 -316
  2. package/dist/commands/apps.js +83 -103
  3. package/dist/commands/checkout.js +156 -134
  4. package/dist/commands/config.js +126 -124
  5. package/dist/commands/diff.js +194 -169
  6. package/dist/commands/dimensions.js +122 -137
  7. package/dist/commands/files.js +77 -88
  8. package/dist/commands/install.js +77 -74
  9. package/dist/commands/list.js +74 -89
  10. package/dist/commands/login.js +101 -126
  11. package/dist/commands/logout.js +42 -57
  12. package/dist/commands/mcp-server.js +24 -39
  13. package/dist/commands/model.js +176 -184
  14. package/dist/commands/pull.js +276 -248
  15. package/dist/commands/push.js +222 -200
  16. package/dist/commands/run.js +322 -274
  17. package/dist/commands/status.js +170 -147
  18. package/dist/commands/variables.js +192 -168
  19. package/dist/commands/whoami.js +45 -61
  20. package/dist/index.js +115 -117
  21. package/dist/mcp/index.js +17 -33
  22. package/dist/mcp/prompts/workflows.js +146 -191
  23. package/dist/mcp/resources/documentation.js +149 -158
  24. package/dist/mcp/server.js +34 -50
  25. package/dist/mcp/tools/appTools.js +278 -307
  26. package/dist/mcp/tools/authTools.js +123 -130
  27. package/dist/mcp/tools/dataTools.js +271 -275
  28. package/dist/mcp/tools/modelTools.js +233 -265
  29. package/dist/mcp/tools/runTools.js +205 -199
  30. package/dist/mcp/tools/syncTools.js +315 -341
  31. package/dist/mcp/utils/helpers.js +124 -117
  32. package/dist/services/appSyncService.js +438 -379
  33. package/dist/services/configService.js +144 -154
  34. package/dist/services/farseerApi.js +401 -401
  35. package/dist/services/farseerFactory.js +274 -208
  36. package/dist/services/farseerService.js +488 -455
  37. package/dist/services/syncService.js +732 -657
  38. package/dist/utils/constants.js +20 -45
  39. package/dist/utils/helpers.js +366 -333
  40. package/dist/utils/logger.js +43 -74
  41. package/package.json +8 -1
  42. package/dist/commands/app.js.map +0 -7
  43. package/dist/commands/apps.js.map +0 -7
  44. package/dist/commands/checkout.js.map +0 -7
  45. package/dist/commands/config.js.map +0 -7
  46. package/dist/commands/diff.js.map +0 -7
  47. package/dist/commands/dimensions.js.map +0 -7
  48. package/dist/commands/files.js.map +0 -7
  49. package/dist/commands/install.js.map +0 -7
  50. package/dist/commands/list.js.map +0 -7
  51. package/dist/commands/login.js.map +0 -7
  52. package/dist/commands/logout.js.map +0 -7
  53. package/dist/commands/mcp-server.js.map +0 -7
  54. package/dist/commands/model.js.map +0 -7
  55. package/dist/commands/pull.js.map +0 -7
  56. package/dist/commands/push.js.map +0 -7
  57. package/dist/commands/run.js.map +0 -7
  58. package/dist/commands/status.js.map +0 -7
  59. package/dist/commands/variables.js.map +0 -7
  60. package/dist/commands/whoami.js.map +0 -7
  61. package/dist/index.js.map +0 -7
  62. package/dist/mcp/index.js.map +0 -7
  63. package/dist/mcp/prompts/workflows.js.map +0 -7
  64. package/dist/mcp/resources/documentation.js.map +0 -7
  65. package/dist/mcp/server.js.map +0 -7
  66. package/dist/mcp/tools/appTools.js.map +0 -7
  67. package/dist/mcp/tools/authTools.js.map +0 -7
  68. package/dist/mcp/tools/dataTools.js.map +0 -7
  69. package/dist/mcp/tools/modelTools.js.map +0 -7
  70. package/dist/mcp/tools/runTools.js.map +0 -7
  71. package/dist/mcp/tools/syncTools.js.map +0 -7
  72. package/dist/mcp/utils/helpers.js.map +0 -7
  73. package/dist/services/appSyncService.js.map +0 -7
  74. package/dist/services/configService.js.map +0 -7
  75. package/dist/services/farseerApi.js.map +0 -7
  76. package/dist/services/farseerFactory.js.map +0 -7
  77. package/dist/services/farseerService.js.map +0 -7
  78. package/dist/services/syncService.js.map +0 -7
  79. package/dist/utils/constants.js.map +0 -7
  80. package/dist/utils/helpers.js.map +0 -7
  81. package/dist/utils/logger.js.map +0 -7
@@ -1,31 +1,15 @@
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 config_exports = {};
19
- __export(config_exports, {
20
- registerConfigCommand: () => registerConfigCommand
21
- });
22
- module.exports = __toCommonJS(config_exports);
23
- var import_logger = require("../utils/logger");
24
- var import_configService = require("../services/configService");
25
- var import_farseerService = require("../services/farseerService");
26
- var import_helpers = require("../utils/helpers");
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerConfigCommand = registerConfigCommand;
4
+ const logger_1 = require("../utils/logger");
5
+ const configService_1 = require("../services/configService");
6
+ const farseerService_1 = require("../services/farseerService");
7
+ const helpers_1 = require("../utils/helpers");
27
8
  function registerConfigCommand(program) {
28
- const configCmd = program.command("config").description("Manage Farseer CLI configuration").addHelpText("after", `
9
+ const configCmd = program
10
+ .command('config')
11
+ .description('Manage Farseer CLI configuration')
12
+ .addHelpText('after', `
29
13
  Commands:
30
14
  set <tenant> Set API key for a tenant
31
15
  remove <tenant> Remove credentials for a tenant
@@ -39,101 +23,119 @@ Examples:
39
23
  $ farseer config list
40
24
  $ farseer config test mycompany
41
25
  `);
42
- configCmd.command("set <tenant>").description("Set credentials for a tenant (use --org if org differs from tenant)").requiredOption("--api-key <key>", "API key for the tenant").option("--org <organisation>", "Organisation name if different from tenant (e.g., --org mycompany)").option("--base-path <url>", "Custom base path (overrides organisation)").option("--no-test", "Skip connection test").action(async (tenant, options) => {
43
- const organisation = options.org || tenant;
44
- const basePath = options.basePath || (0, import_configService.generateBasePath)(organisation);
45
- const apiKey = options.apiKey;
46
- const credential = {
47
- type: "apiKey",
48
- tenantId: tenant,
49
- apiKey,
50
- basePath
51
- };
52
- if (options.test !== false) {
53
- import_logger.logger.info("Testing connection...");
54
- const service = new import_farseerService.FarseerService(credential);
55
- const isConnected = await service.testConnection();
56
- if (!isConnected) {
57
- import_logger.logger.error("Connection failed. Please check your credentials.");
58
- import_logger.logger.dim(`Tried to connect to: ${basePath}`);
59
- process.exit(1);
60
- }
61
- }
62
- (0, import_configService.setCredential)(tenant, credential);
63
- import_logger.logger.success(`Credentials saved for tenant: ${tenant}`);
64
- import_logger.logger.table([
65
- { label: "Tenant ID", value: tenant },
66
- { label: "Base Path", value: basePath },
67
- { label: "API Key", value: apiKey.substring(0, 8) + "..." }
68
- ]);
69
- });
70
- configCmd.command("remove <tenant>").description("Remove credentials for a tenant").action((tenant) => {
71
- const removed = (0, import_configService.removeCredential)(tenant);
72
- if (removed) {
73
- import_logger.logger.success(`Removed credentials for tenant: ${tenant}`);
74
- } else {
75
- import_logger.logger.warning(`No credentials found for tenant: ${tenant}`);
76
- }
77
- });
78
- configCmd.command("list").description("List all configured tenants").action(() => {
79
- const credentials = (0, import_configService.listCredentials)();
80
- const tenants = Object.keys(credentials);
81
- if (tenants.length === 0) {
82
- import_logger.logger.info("No tenants configured.");
83
- import_logger.logger.dim('Use "farseer config set <tenant> --api-key <key>" to add one.');
84
- return;
85
- }
86
- import_logger.logger.header("Configured Tenants");
87
- for (const tenant of tenants) {
88
- const cred = credentials[tenant];
89
- console.log(` ${tenant}`);
90
- import_logger.logger.dim(` Base: ${cred.basePath}`);
91
- import_logger.logger.dim(` Key: ${cred.apiKey.substring(0, 8)}...`);
92
- console.log();
93
- }
94
- });
95
- configCmd.command("show <tenant>").description("Show full credentials for a tenant (including API key)").action((tenant) => {
96
- const credentials = (0, import_configService.listCredentials)();
97
- const cred = credentials[tenant];
98
- if (!cred) {
99
- import_logger.logger.error(`No credentials found for tenant: ${tenant}`);
100
- import_logger.logger.dim((0, import_helpers.getCredentialsHint)(tenant));
101
- process.exit(1);
102
- }
103
- import_logger.logger.header(`Credentials for ${tenant}`);
104
- import_logger.logger.table([
105
- { label: "Tenant ID", value: tenant },
106
- { label: "Base Path", value: cred.basePath },
107
- { label: "API Key", value: cred.apiKey }
108
- ]);
109
- });
110
- configCmd.command("test <tenant>").description("Test connection to a tenant").action(async (tenant) => {
111
- const credentials = (0, import_configService.listCredentials)();
112
- const cred = credentials[tenant];
113
- if (!cred) {
114
- import_logger.logger.error(`No credentials found for tenant: ${tenant}`);
115
- import_logger.logger.dim((0, import_helpers.getCredentialsHint)(tenant));
116
- process.exit(1);
117
- }
118
- import_logger.logger.info(`Testing connection to ${tenant}...`);
119
- const service = new import_farseerService.FarseerService(cred);
120
- const isConnected = await service.testConnection();
121
- if (isConnected) {
122
- import_logger.logger.success(`Connection successful!`);
123
- const filesFolder = await service.getFilesFolder();
124
- if (filesFolder) {
125
- import_logger.logger.dim("Files folder found.");
126
- } else {
127
- import_logger.logger.warning("Files folder not found. It will be created on first push.");
128
- }
129
- } else {
130
- import_logger.logger.error("Connection failed.");
131
- process.exit(1);
132
- }
133
- });
26
+ configCmd
27
+ .command('set <tenant>')
28
+ .description('Set credentials for a tenant (use --org if org differs from tenant)')
29
+ .requiredOption('--api-key <key>', 'API key for the tenant')
30
+ .option('--org <organisation>', 'Organisation name if different from tenant (e.g., --org mycompany)')
31
+ .option('--base-path <url>', 'Custom base path (overrides organisation)')
32
+ .option('--no-test', 'Skip connection test')
33
+ .action(async (tenant, options) => {
34
+ const organisation = options.org || tenant;
35
+ const basePath = options.basePath || (0, configService_1.generateBasePath)(organisation);
36
+ const apiKey = options.apiKey;
37
+ const credential = {
38
+ type: 'apiKey',
39
+ tenantId: tenant,
40
+ apiKey: apiKey,
41
+ basePath: basePath,
42
+ };
43
+ if (options.test !== false) {
44
+ logger_1.logger.info('Testing connection...');
45
+ const service = new farseerService_1.FarseerService(credential);
46
+ const isConnected = await service.testConnection();
47
+ if (!isConnected) {
48
+ logger_1.logger.error('Connection failed. Please check your credentials.');
49
+ logger_1.logger.dim(`Tried to connect to: ${basePath}`);
50
+ process.exit(1);
51
+ }
52
+ }
53
+ (0, configService_1.setCredential)(tenant, credential);
54
+ logger_1.logger.success(`Credentials saved for tenant: ${tenant}`);
55
+ logger_1.logger.table([
56
+ { label: 'Tenant ID', value: tenant },
57
+ { label: 'Base Path', value: basePath },
58
+ { label: 'API Key', value: apiKey.substring(0, 8) + '...' },
59
+ ]);
60
+ });
61
+ configCmd
62
+ .command('remove <tenant>')
63
+ .description('Remove credentials for a tenant')
64
+ .action((tenant) => {
65
+ const removed = (0, configService_1.removeCredential)(tenant);
66
+ if (removed) {
67
+ logger_1.logger.success(`Removed credentials for tenant: ${tenant}`);
68
+ }
69
+ else {
70
+ logger_1.logger.warning(`No credentials found for tenant: ${tenant}`);
71
+ }
72
+ });
73
+ configCmd
74
+ .command('list')
75
+ .description('List all configured tenants')
76
+ .action(() => {
77
+ const credentials = (0, configService_1.listCredentials)();
78
+ const tenants = Object.keys(credentials);
79
+ if (tenants.length === 0) {
80
+ logger_1.logger.info('No tenants configured.');
81
+ logger_1.logger.dim('Use "farseer config set <tenant> --api-key <key>" to add one.');
82
+ return;
83
+ }
84
+ logger_1.logger.header('Configured Tenants');
85
+ for (const tenant of tenants) {
86
+ const cred = credentials[tenant];
87
+ console.log(` ${tenant}`);
88
+ logger_1.logger.dim(` Base: ${cred.basePath}`);
89
+ logger_1.logger.dim(` Key: ${cred.apiKey.substring(0, 8)}...`);
90
+ console.log();
91
+ }
92
+ });
93
+ configCmd
94
+ .command('show <tenant>')
95
+ .description('Show full credentials for a tenant (including API key)')
96
+ .action((tenant) => {
97
+ const credentials = (0, configService_1.listCredentials)();
98
+ const cred = credentials[tenant];
99
+ if (!cred) {
100
+ logger_1.logger.error(`No credentials found for tenant: ${tenant}`);
101
+ logger_1.logger.dim((0, helpers_1.getCredentialsHint)(tenant));
102
+ process.exit(1);
103
+ }
104
+ logger_1.logger.header(`Credentials for ${tenant}`);
105
+ logger_1.logger.table([
106
+ { label: 'Tenant ID', value: tenant },
107
+ { label: 'Base Path', value: cred.basePath },
108
+ { label: 'API Key', value: cred.apiKey },
109
+ ]);
110
+ });
111
+ configCmd
112
+ .command('test <tenant>')
113
+ .description('Test connection to a tenant')
114
+ .action(async (tenant) => {
115
+ const credentials = (0, configService_1.listCredentials)();
116
+ const cred = credentials[tenant];
117
+ if (!cred) {
118
+ logger_1.logger.error(`No credentials found for tenant: ${tenant}`);
119
+ logger_1.logger.dim((0, helpers_1.getCredentialsHint)(tenant));
120
+ process.exit(1);
121
+ }
122
+ logger_1.logger.info(`Testing connection to ${tenant}...`);
123
+ const service = new farseerService_1.FarseerService(cred);
124
+ const isConnected = await service.testConnection();
125
+ if (isConnected) {
126
+ logger_1.logger.success(`Connection successful!`);
127
+ // Try to get files folder
128
+ const filesFolder = await service.getFilesFolder();
129
+ if (filesFolder) {
130
+ logger_1.logger.dim('Files folder found.');
131
+ }
132
+ else {
133
+ logger_1.logger.warning('Files folder not found. It will be created on first push.');
134
+ }
135
+ }
136
+ else {
137
+ logger_1.logger.error('Connection failed.');
138
+ process.exit(1);
139
+ }
140
+ });
134
141
  }
135
- // Annotate the CommonJS export names for ESM import in node:
136
- 0 && (module.exports = {
137
- registerConfigCommand
138
- });
139
- //# sourceMappingURL=config.js.map