@camunda8/cli 1.1.0 → 2.0.0-alpha.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.
- package/README.md +98 -39
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +1 -1
- package/dist/client.js.map +1 -1
- package/dist/commands/completion.d.ts.map +1 -1
- package/dist/commands/completion.js +108 -9
- package/dist/commands/completion.js.map +1 -1
- package/dist/commands/deployments.d.ts.map +1 -1
- package/dist/commands/deployments.js +289 -49
- package/dist/commands/deployments.js.map +1 -1
- package/dist/commands/forms.d.ts +26 -0
- package/dist/commands/forms.d.ts.map +1 -0
- package/dist/commands/forms.js +125 -0
- package/dist/commands/forms.js.map +1 -0
- package/dist/commands/help.d.ts +24 -0
- package/dist/commands/help.d.ts.map +1 -1
- package/dist/commands/help.js +238 -9
- package/dist/commands/help.js.map +1 -1
- package/dist/commands/incidents.d.ts +6 -0
- package/dist/commands/incidents.d.ts.map +1 -1
- package/dist/commands/incidents.js +15 -0
- package/dist/commands/incidents.js.map +1 -1
- package/dist/commands/plugins.d.ts +5 -0
- package/dist/commands/plugins.d.ts.map +1 -1
- package/dist/commands/plugins.js +190 -23
- package/dist/commands/plugins.js.map +1 -1
- package/dist/commands/process-instances.d.ts +12 -2
- package/dist/commands/process-instances.d.ts.map +1 -1
- package/dist/commands/process-instances.js +55 -4
- package/dist/commands/process-instances.js.map +1 -1
- package/dist/commands/profiles.d.ts +17 -8
- package/dist/commands/profiles.d.ts.map +1 -1
- package/dist/commands/profiles.js +74 -35
- package/dist/commands/profiles.js.map +1 -1
- package/dist/commands/session.js +3 -3
- package/dist/commands/session.js.map +1 -1
- package/dist/config.d.ts +104 -49
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +306 -165
- package/dist/config.js.map +1 -1
- package/dist/index.js +100 -16
- package/dist/index.js.map +1 -1
- package/dist/plugin-registry.d.ts +45 -0
- package/dist/plugin-registry.d.ts.map +1 -0
- package/dist/plugin-registry.js +101 -0
- package/dist/plugin-registry.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,70 +1,109 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Profile management commands
|
|
3
|
+
* c8ctl profiles are stored in DATA_DIR/c8ctl/profiles.json
|
|
4
|
+
* Modeler connections are read from settings.json (read-only) with "modeler:" prefix
|
|
3
5
|
*/
|
|
4
6
|
import { getLogger } from "../logger.js";
|
|
5
|
-
import {
|
|
7
|
+
import { getAllProfiles, getProfileOrModeler, addProfile as addProfileConfig, removeProfile as removeProfileConfig, MODELER_PREFIX, } from "../config.js";
|
|
6
8
|
/**
|
|
7
|
-
* List all profiles
|
|
9
|
+
* List all profiles (c8ctl + Modeler)
|
|
8
10
|
*/
|
|
9
11
|
export function listProfiles() {
|
|
10
12
|
const logger = getLogger();
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
const totalProfiles = c8ctlProfiles.length + modelerProfiles.length;
|
|
14
|
-
if (totalProfiles === 0) {
|
|
13
|
+
const profiles = getAllProfiles();
|
|
14
|
+
if (profiles.length === 0) {
|
|
15
15
|
logger.info('No profiles configured');
|
|
16
|
+
logger.info('');
|
|
17
|
+
logger.info('Add a profile with: c8ctl profiles add <name> --url <cluster-url>');
|
|
18
|
+
logger.info('Or configure connections in Camunda Modeler and they will appear with "modeler:" prefix.');
|
|
16
19
|
return;
|
|
17
20
|
}
|
|
18
|
-
const tableData =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
const tableData = profiles.map(profile => {
|
|
22
|
+
const isModeler = profile.name.startsWith(MODELER_PREFIX);
|
|
23
|
+
return {
|
|
24
|
+
Name: profile.name,
|
|
25
|
+
URL: profile.baseUrl || '(not set)',
|
|
26
|
+
Tenant: profile.defaultTenantId || '<default>',
|
|
27
|
+
Source: isModeler ? 'Modeler' : 'c8ctl',
|
|
28
|
+
};
|
|
29
|
+
});
|
|
30
|
+
logger.table(tableData);
|
|
31
|
+
// Show hint about read-only Modeler profiles
|
|
32
|
+
const hasModelerProfiles = profiles.some(p => p.name.startsWith(MODELER_PREFIX));
|
|
33
|
+
if (hasModelerProfiles) {
|
|
34
|
+
logger.info('');
|
|
35
|
+
logger.info(`Note: Modeler profiles (prefixed with "${MODELER_PREFIX}") are read-only. Manage them in Camunda Modeler.`);
|
|
27
36
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
});
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Show profile details
|
|
40
|
+
*/
|
|
41
|
+
export function showProfile(name) {
|
|
42
|
+
const logger = getLogger();
|
|
43
|
+
const profile = getProfileOrModeler(name);
|
|
44
|
+
if (!profile) {
|
|
45
|
+
logger.error(`Profile '${name}' not found`);
|
|
46
|
+
process.exit(1);
|
|
47
|
+
}
|
|
48
|
+
const isModeler = profile.name.startsWith(MODELER_PREFIX);
|
|
49
|
+
logger.info(`Profile: ${profile.name}`);
|
|
50
|
+
logger.info(` Source: ${isModeler ? 'Camunda Modeler (read-only)' : 'c8ctl'}`);
|
|
51
|
+
logger.info(` Base URL: ${profile.baseUrl}`);
|
|
52
|
+
if (profile.username) {
|
|
53
|
+
logger.info(` Username: ${profile.username}`);
|
|
54
|
+
logger.info(` Password: ${profile.password ? '********' : '(not set)'}`);
|
|
55
|
+
}
|
|
56
|
+
if (profile.clientId) {
|
|
57
|
+
logger.info(` Client ID: ${profile.clientId}`);
|
|
58
|
+
logger.info(` Client Secret: ${profile.clientSecret ? '********' : '(not set)'}`);
|
|
59
|
+
}
|
|
60
|
+
if (profile.audience) {
|
|
61
|
+
logger.info(` Audience: ${profile.audience}`);
|
|
62
|
+
}
|
|
63
|
+
if (profile.oAuthUrl) {
|
|
64
|
+
logger.info(` OAuth URL: ${profile.oAuthUrl}`);
|
|
65
|
+
}
|
|
66
|
+
if (profile.defaultTenantId) {
|
|
67
|
+
logger.info(` Default Tenant: ${profile.defaultTenantId}`);
|
|
37
68
|
}
|
|
38
|
-
logger.table(tableData);
|
|
39
69
|
}
|
|
40
70
|
/**
|
|
41
|
-
* Add a profile
|
|
71
|
+
* Add a c8ctl profile
|
|
42
72
|
*/
|
|
43
73
|
export function addProfile(name, options) {
|
|
44
74
|
const logger = getLogger();
|
|
45
|
-
//
|
|
46
|
-
if (
|
|
47
|
-
logger.error(
|
|
75
|
+
// Prevent adding profiles with "modeler:" prefix
|
|
76
|
+
if (name.startsWith(MODELER_PREFIX)) {
|
|
77
|
+
logger.error(`Profile names cannot start with "${MODELER_PREFIX}" - this prefix is reserved for Camunda Modeler connections`);
|
|
78
|
+
logger.info('Please choose a different name or manage this profile in Camunda Modeler');
|
|
48
79
|
process.exit(1);
|
|
49
80
|
}
|
|
50
81
|
const profile = {
|
|
51
82
|
name,
|
|
52
|
-
baseUrl: options.
|
|
83
|
+
baseUrl: options.url || 'http://localhost:8080/v2',
|
|
53
84
|
clientId: options.clientId,
|
|
54
85
|
clientSecret: options.clientSecret,
|
|
55
86
|
audience: options.audience,
|
|
56
|
-
oAuthUrl: options.
|
|
57
|
-
|
|
87
|
+
oAuthUrl: options.oauthUrl,
|
|
88
|
+
username: options.username,
|
|
89
|
+
password: options.password,
|
|
90
|
+
defaultTenantId: options.tenantId,
|
|
58
91
|
};
|
|
59
|
-
|
|
92
|
+
addProfileConfig(profile);
|
|
60
93
|
logger.success(`Profile '${name}' added`);
|
|
61
94
|
}
|
|
62
95
|
/**
|
|
63
|
-
* Remove a profile
|
|
96
|
+
* Remove a c8ctl profile
|
|
64
97
|
*/
|
|
65
98
|
export function removeProfile(name) {
|
|
66
99
|
const logger = getLogger();
|
|
67
|
-
|
|
100
|
+
// Prevent removing Modeler profiles
|
|
101
|
+
if (name.startsWith(MODELER_PREFIX)) {
|
|
102
|
+
logger.error('Cannot remove Modeler profiles via c8ctl');
|
|
103
|
+
logger.info('Manage Modeler connections directly in Camunda Modeler');
|
|
104
|
+
process.exit(1);
|
|
105
|
+
}
|
|
106
|
+
const removed = removeProfileConfig(name);
|
|
68
107
|
if (removed) {
|
|
69
108
|
logger.success(`Profile '${name}' removed`);
|
|
70
109
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiles.js","sourceRoot":"","sources":["../../src/commands/profiles.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"profiles.js","sourceRoot":"","sources":["../../src/commands/profiles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EACL,cAAc,EAEd,mBAAmB,EACnB,UAAU,IAAI,gBAAgB,EAC9B,aAAa,IAAI,mBAAmB,EACpC,cAAc,GAEf,MAAM,cAAc,CAAC;AAEtB;;GAEG;AACH,MAAM,UAAU,YAAY;IAC1B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,QAAQ,GAAG,cAAc,EAAE,CAAC;IAElC,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QACtC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAChB,MAAM,CAAC,IAAI,CAAC,mEAAmE,CAAC,CAAC;QACjF,MAAM,CAAC,IAAI,CAAC,0FAA0F,CAAC,CAAC;QACxG,OAAO;IACT,CAAC;IASD,MAAM,SAAS,GAAsB,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;QAC1D,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;QAE1D,OAAO;YACL,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,GAAG,EAAE,OAAO,CAAC,OAAO,IAAI,WAAW;YACnC,MAAM,EAAE,OAAO,CAAC,eAAe,IA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0BAA0B;QAClD,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,YAAY,EAAE,OAAO,CAAC,YAAY;QAClC,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,eAAe,EAAE,OAAO,CAAC,QAAQ;KAClC,CAAC;IAEF,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC1B,MAAM,CAAC,OAAO,CAAC,YAAY,IAAI,SAAS,CAAC,CAAC;AAC5C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAE3B,oCAAoC;IACpC,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;QACpC,MAAM,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC;QACzD,MAAM,CAAC,IAAI,CAAC,wDAAwD,CAAC,CAAC;QACtE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,OAAO,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC1C,IAAI,OAAO,EAAE,CAAC;QACZ,MAAM,CAAC,OAAO,CAAC,YAAY,IAAI,WAAW,CAAC,CAAC;IAC9C,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,KAAK,CAAC,YAAY,IAAI,aAAa,CAAC,CAAC;QAC5C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
package/dist/commands/session.js
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
* Session management commands (use profile, use tenant, output mode)
|
|
3
3
|
*/
|
|
4
4
|
import { getLogger } from "../logger.js";
|
|
5
|
-
import { setActiveProfile, setActiveTenant, setOutputMode,
|
|
5
|
+
import { setActiveProfile, setActiveTenant, setOutputMode, getProfileOrModeler, } from "../config.js";
|
|
6
6
|
import { c8ctl } from "../runtime.js";
|
|
7
7
|
/**
|
|
8
8
|
* Set active profile
|
|
9
9
|
*/
|
|
10
10
|
export function useProfile(name) {
|
|
11
11
|
const logger = getLogger();
|
|
12
|
-
// Verify profile exists
|
|
13
|
-
const profile =
|
|
12
|
+
// Verify profile exists (checks both c8ctl and Modeler profiles)
|
|
13
|
+
const profile = getProfileOrModeler(name);
|
|
14
14
|
if (!profile) {
|
|
15
15
|
logger.error(`Profile '${name}' not found`);
|
|
16
16
|
process.exit(1);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/commands/session.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,
|
|
1
|
+
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/commands/session.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,mBAAmB,GACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGtC;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAE3B,iEAAiE;IACjE,MAAM,OAAO,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,CAAC,KAAK,CAAC,YAAY,IAAI,aAAa,CAAC,CAAC;QAC5C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACvB,MAAM,CAAC,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
2
|
* Configuration and session state management for c8ctl
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
|
+
* c8ctl stores its own profiles in DATA_DIR/c8ctl/profiles.json
|
|
5
|
+
* Modeler connections are read from settings.json (read-only) with "modeler:" prefix
|
|
4
6
|
*/
|
|
5
7
|
import type { OutputMode } from './logger.ts';
|
|
8
|
+
export declare const TARGET_TYPES: {
|
|
9
|
+
readonly CAMUNDA_CLOUD: "camundaCloud";
|
|
10
|
+
readonly SELF_HOSTED: "selfHosted";
|
|
11
|
+
};
|
|
12
|
+
export type TargetType = typeof TARGET_TYPES[keyof typeof TARGET_TYPES];
|
|
13
|
+
export declare const AUTH_TYPES: {
|
|
14
|
+
readonly NONE: "none";
|
|
15
|
+
readonly BASIC: "basic";
|
|
16
|
+
readonly OAUTH: "oauth";
|
|
17
|
+
};
|
|
18
|
+
export type AuthType = typeof AUTH_TYPES[keyof typeof AUTH_TYPES];
|
|
19
|
+
/**
|
|
20
|
+
* Connection structure matching Camunda Modeler's ConnectionManagerSettingsProperties
|
|
21
|
+
* @see https://github.com/camunda/camunda-modeler/blob/main/client/src/plugins/zeebe-plugin/connection-manager-plugin/ConnectionManagerSettingsProperties.js
|
|
22
|
+
*/
|
|
23
|
+
export interface Connection {
|
|
24
|
+
/** Unique identifier (UUID) */
|
|
25
|
+
id: string;
|
|
26
|
+
/** Human-readable connection name */
|
|
27
|
+
name?: string;
|
|
28
|
+
/** Target environment type */
|
|
29
|
+
targetType: TargetType;
|
|
30
|
+
/** Camunda Cloud cluster URL (e.g., https://xxx.bru-2.zeebe.camunda.io/xxx) */
|
|
31
|
+
camundaCloudClusterUrl?: string;
|
|
32
|
+
/** Camunda Cloud client ID */
|
|
33
|
+
camundaCloudClientId?: string;
|
|
34
|
+
/** Camunda Cloud client secret */
|
|
35
|
+
camundaCloudClientSecret?: string;
|
|
36
|
+
/** Self-hosted cluster URL (e.g., http://localhost:8080/v2) */
|
|
37
|
+
contactPoint?: string;
|
|
38
|
+
/** Authentication type for self-hosted */
|
|
39
|
+
authType?: AuthType;
|
|
40
|
+
/** Tenant ID (optional) */
|
|
41
|
+
tenantId?: string;
|
|
42
|
+
/** Operate URL (optional) */
|
|
43
|
+
operateUrl?: string;
|
|
44
|
+
basicAuthUsername?: string;
|
|
45
|
+
basicAuthPassword?: string;
|
|
46
|
+
clientId?: string;
|
|
47
|
+
clientSecret?: string;
|
|
48
|
+
oauthURL?: string;
|
|
49
|
+
audience?: string;
|
|
50
|
+
scope?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* c8ctl Profile interface - stored in DATA_DIR/c8ctl/profiles.json
|
|
54
|
+
* This is c8ctl's native profile format
|
|
55
|
+
*/
|
|
6
56
|
export interface Profile {
|
|
7
57
|
name: string;
|
|
8
58
|
baseUrl: string;
|
|
@@ -29,57 +79,90 @@ export interface ClusterConfig {
|
|
|
29
79
|
password?: string;
|
|
30
80
|
}
|
|
31
81
|
/**
|
|
32
|
-
*
|
|
82
|
+
* Validate a connection configuration
|
|
83
|
+
* Returns array of error messages (empty if valid)
|
|
33
84
|
*/
|
|
34
|
-
export
|
|
35
|
-
name?: string;
|
|
36
|
-
clusterId?: string;
|
|
37
|
-
clusterUrl?: string;
|
|
38
|
-
audience?: string;
|
|
39
|
-
clientId?: string;
|
|
40
|
-
clientSecret?: string;
|
|
41
|
-
}
|
|
85
|
+
export declare function validateConnection(conn: Partial<Connection>): string[];
|
|
42
86
|
/**
|
|
43
|
-
* Get platform-specific user data directory
|
|
87
|
+
* Get platform-specific user data directory for c8ctl
|
|
44
88
|
*/
|
|
45
89
|
export declare function getUserDataDir(): string;
|
|
46
90
|
/**
|
|
47
91
|
* Get platform-specific Camunda Modeler data directory
|
|
92
|
+
* Modeler stores connections in settings.json
|
|
48
93
|
*/
|
|
49
94
|
export declare function getModelerDataDir(): string;
|
|
50
95
|
/**
|
|
51
|
-
* Load
|
|
96
|
+
* Load c8ctl profiles from profiles.json
|
|
52
97
|
*/
|
|
53
98
|
export declare function loadProfiles(): Profile[];
|
|
54
99
|
/**
|
|
55
|
-
* Save profiles to
|
|
100
|
+
* Save c8ctl profiles to profiles.json
|
|
56
101
|
*/
|
|
57
102
|
export declare function saveProfiles(profiles: Profile[]): void;
|
|
58
103
|
/**
|
|
59
|
-
* Get a profile by name
|
|
60
|
-
* Supports both c8ctl profiles and modeler profiles (with 'modeler:' prefix)
|
|
104
|
+
* Get a c8ctl profile by name
|
|
61
105
|
*/
|
|
62
106
|
export declare function getProfile(name: string): Profile | undefined;
|
|
63
107
|
/**
|
|
64
|
-
* Add
|
|
108
|
+
* Add a c8ctl profile
|
|
65
109
|
*/
|
|
66
110
|
export declare function addProfile(profile: Profile): void;
|
|
67
111
|
/**
|
|
68
|
-
* Remove a profile
|
|
112
|
+
* Remove a c8ctl profile by name
|
|
69
113
|
*/
|
|
70
114
|
export declare function removeProfile(name: string): boolean;
|
|
115
|
+
export declare const MODELER_PREFIX = "modeler:";
|
|
116
|
+
/**
|
|
117
|
+
* Load connections from Modeler's settings.json (read-only)
|
|
118
|
+
* These are NOT modified by c8ctl
|
|
119
|
+
*/
|
|
120
|
+
export declare function loadModelerConnections(): Connection[];
|
|
121
|
+
/**
|
|
122
|
+
* Get all profiles including c8ctl profiles and Modeler connections
|
|
123
|
+
* Modeler connections are prefixed with "modeler:"
|
|
124
|
+
*/
|
|
125
|
+
export declare function getAllProfiles(): Profile[];
|
|
126
|
+
/**
|
|
127
|
+
* Get a profile by name, checking both c8ctl and Modeler sources
|
|
128
|
+
* For Modeler profiles, accepts name with or without "modeler:" prefix
|
|
129
|
+
*/
|
|
130
|
+
export declare function getProfileOrModeler(name: string): Profile | undefined;
|
|
131
|
+
/**
|
|
132
|
+
* Convert a Connection to ClusterConfig for API client use
|
|
133
|
+
*/
|
|
134
|
+
export declare function connectionToClusterConfig(conn: Connection): ClusterConfig;
|
|
135
|
+
/**
|
|
136
|
+
* Convert Connection to Profile format
|
|
137
|
+
* Used to convert read-only Modeler connections to c8ctl Profile format
|
|
138
|
+
*/
|
|
139
|
+
export declare function connectionToProfile(conn: Connection): Profile;
|
|
140
|
+
/**
|
|
141
|
+
* Convert Profile to ClusterConfig for API client use
|
|
142
|
+
*/
|
|
143
|
+
export declare function profileToClusterConfig(profile: Profile): ClusterConfig;
|
|
144
|
+
/**
|
|
145
|
+
* Get display label for a connection
|
|
146
|
+
*/
|
|
147
|
+
export declare function getConnectionLabel(conn: Connection): string;
|
|
148
|
+
/**
|
|
149
|
+
* Get auth type label for display
|
|
150
|
+
*/
|
|
151
|
+
export declare function getAuthTypeLabel(conn: Connection): string;
|
|
152
|
+
/**
|
|
153
|
+
* Get target type label for display
|
|
154
|
+
*/
|
|
155
|
+
export declare function getTargetTypeLabel(conn: Connection): string;
|
|
71
156
|
/**
|
|
72
157
|
* Load session state from disk and populate c8ctl runtime object
|
|
73
|
-
* Loads all session properties (activeProfile, activeTenant, outputMode)
|
|
74
158
|
*/
|
|
75
159
|
export declare function loadSessionState(): SessionState;
|
|
76
160
|
/**
|
|
77
161
|
* Save session state from c8ctl runtime object to disk
|
|
78
|
-
* Always persists all session properties (activeProfile, activeTenant, outputMode)
|
|
79
162
|
*/
|
|
80
163
|
export declare function saveSessionState(state?: SessionState): void;
|
|
81
164
|
/**
|
|
82
|
-
* Set active profile in session and persist to disk
|
|
165
|
+
* Set active profile/connection in session and persist to disk
|
|
83
166
|
*/
|
|
84
167
|
export declare function setActiveProfile(name: string): void;
|
|
85
168
|
/**
|
|
@@ -97,35 +180,7 @@ export declare function setOutputMode(mode: OutputMode): void;
|
|
|
97
180
|
export declare function resolveClusterConfig(profileFlag?: string): ClusterConfig;
|
|
98
181
|
/**
|
|
99
182
|
* Resolve tenant ID from session, profile, env vars, or default
|
|
100
|
-
* Priority: session tenant → profile
|
|
183
|
+
* Priority: session tenant → profile tenant → env var → '<default>'
|
|
101
184
|
*/
|
|
102
185
|
export declare function resolveTenantId(profileFlag?: string): string;
|
|
103
|
-
/**
|
|
104
|
-
* Load Camunda Modeler profiles from profiles.json
|
|
105
|
-
* Always reads fresh from disk (no caching)
|
|
106
|
-
*
|
|
107
|
-
* TODO: Consider introducing caching mechanism for better performance.
|
|
108
|
-
* Current implementation reads from disk on every call. For commands that
|
|
109
|
-
* list profiles or look up multiple profiles, this could be optimized by
|
|
110
|
-
* implementing per-execution memoization or a time-based cache.
|
|
111
|
-
*/
|
|
112
|
-
export declare function loadModelerProfiles(): ModelerProfile[];
|
|
113
|
-
/**
|
|
114
|
-
* Get a modeler profile by name or cluster ID
|
|
115
|
-
* Accepts 'modeler:name' or 'modeler:id' format, or just 'name'/'id'
|
|
116
|
-
*/
|
|
117
|
-
export declare function getModelerProfile(identifier: string): ModelerProfile | undefined;
|
|
118
|
-
/**
|
|
119
|
-
* Construct REST API URL from modeler profile
|
|
120
|
-
* For cloud: uses clusterUrl as-is (Camunda cloud URLs don't need /v2)
|
|
121
|
-
* For self-managed: localhost URLs get /v2 appended
|
|
122
|
-
* Does not derive values - uses what's provided
|
|
123
|
-
*
|
|
124
|
-
* Note: Self-managed clusters should include /v2 in their clusterUrl if needed
|
|
125
|
-
*/
|
|
126
|
-
export declare function constructApiUrl(profile: ModelerProfile): string;
|
|
127
|
-
/**
|
|
128
|
-
* Convert a modeler profile to a c8ctl Profile
|
|
129
|
-
*/
|
|
130
|
-
export declare function convertModelerProfile(modelerProfile: ModelerProfile): Profile;
|
|
131
186
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAO9C,eAAO,MAAM,YAAY;;;CAGf,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,OAAO,YAAY,C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