decoupled-cli 2.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/README.md +416 -0
- package/bin/decoupled-cli +3 -0
- package/dist/commands/auth.d.ts +3 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +386 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/config.d.ts +3 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +84 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/content.d.ts +3 -0
- package/dist/commands/content.d.ts.map +1 -0
- package/dist/commands/content.js +199 -0
- package/dist/commands/content.js.map +1 -0
- package/dist/commands/download.d.ts +4 -0
- package/dist/commands/download.d.ts.map +1 -0
- package/dist/commands/download.js +127 -0
- package/dist/commands/download.js.map +1 -0
- package/dist/commands/health.d.ts +3 -0
- package/dist/commands/health.d.ts.map +1 -0
- package/dist/commands/health.js +28 -0
- package/dist/commands/health.js.map +1 -0
- package/dist/commands/org.d.ts +3 -0
- package/dist/commands/org.d.ts.map +1 -0
- package/dist/commands/org.js +73 -0
- package/dist/commands/org.js.map +1 -0
- package/dist/commands/spaces.d.ts +3 -0
- package/dist/commands/spaces.d.ts.map +1 -0
- package/dist/commands/spaces.js +613 -0
- package/dist/commands/spaces.js.map +1 -0
- package/dist/commands/tokens.d.ts +3 -0
- package/dist/commands/tokens.d.ts.map +1 -0
- package/dist/commands/tokens.js +90 -0
- package/dist/commands/tokens.js.map +1 -0
- package/dist/commands/usage.d.ts +3 -0
- package/dist/commands/usage.d.ts.map +1 -0
- package/dist/commands/usage.js +104 -0
- package/dist/commands/usage.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +49 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/api.d.ts +40 -0
- package/dist/lib/api.d.ts.map +1 -0
- package/dist/lib/api.js +162 -0
- package/dist/lib/api.js.map +1 -0
- package/dist/lib/config.d.ts +63 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +317 -0
- package/dist/lib/config.js.map +1 -0
- package/examples/.cursorrules +189 -0
- package/examples/CLAUDE.md +1080 -0
- package/examples/GEMINI.md +1056 -0
- package/examples/content-import-sample.json +114 -0
- package/package.json +55 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.contentCommand = void 0;
|
|
40
|
+
const commander_1 = require("commander");
|
|
41
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
42
|
+
const fs = __importStar(require("fs"));
|
|
43
|
+
const api_1 = require("../lib/api");
|
|
44
|
+
// Helper function to check OAuth availability
|
|
45
|
+
function requiresOAuthOrPAT(commandName) {
|
|
46
|
+
// This command works with both OAuth (Drupal API) and PAT (when platform has content endpoints)
|
|
47
|
+
// For now, we'll focus on OAuth/Drupal implementation
|
|
48
|
+
}
|
|
49
|
+
exports.contentCommand = new commander_1.Command('content')
|
|
50
|
+
.description('Manage Drupal content (works with OAuth and PAT authentication)');
|
|
51
|
+
exports.contentCommand
|
|
52
|
+
.command('import')
|
|
53
|
+
.description('Import content models and data to Drupal')
|
|
54
|
+
.option('--file <path>', 'JSON file with content model and data')
|
|
55
|
+
.option('--preview', 'Preview what will be imported without applying changes')
|
|
56
|
+
.option('--example', 'Generate example import JSON structure')
|
|
57
|
+
.action(async (options) => {
|
|
58
|
+
try {
|
|
59
|
+
if (options.example) {
|
|
60
|
+
const exampleData = {
|
|
61
|
+
model: [
|
|
62
|
+
{
|
|
63
|
+
bundle: "example_content",
|
|
64
|
+
description: "Example content type for demonstration",
|
|
65
|
+
label: "Example Content",
|
|
66
|
+
body: true,
|
|
67
|
+
fields: [
|
|
68
|
+
{
|
|
69
|
+
id: "subtitle",
|
|
70
|
+
label: "Subtitle",
|
|
71
|
+
type: "string"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: "featured_image",
|
|
75
|
+
label: "Featured Image",
|
|
76
|
+
type: "image"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: "tags",
|
|
80
|
+
label: "Tags",
|
|
81
|
+
type: "string[]"
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
content: [
|
|
87
|
+
{
|
|
88
|
+
id: "example1",
|
|
89
|
+
type: "node.example_content",
|
|
90
|
+
path: "/example-content/sample-article",
|
|
91
|
+
values: {
|
|
92
|
+
title: "Sample Article",
|
|
93
|
+
body: "<p>This is sample content for demonstration.</p>",
|
|
94
|
+
subtitle: "A subtitle for this article",
|
|
95
|
+
tags: ["example", "demo", "content"]
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
};
|
|
100
|
+
console.log(JSON.stringify(exampleData, null, 2));
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if (!options.file) {
|
|
104
|
+
console.error(chalk_1.default.red('ā --file option is required'));
|
|
105
|
+
console.log(chalk_1.default.yellow('Use --example to see the expected JSON format'));
|
|
106
|
+
process.exit(1);
|
|
107
|
+
}
|
|
108
|
+
if (!fs.existsSync(options.file)) {
|
|
109
|
+
console.error(chalk_1.default.red(`ā File not found: ${options.file}`));
|
|
110
|
+
process.exit(1);
|
|
111
|
+
}
|
|
112
|
+
const importData = JSON.parse(fs.readFileSync(options.file, 'utf-8'));
|
|
113
|
+
const client = await (0, api_1.createApiClient)();
|
|
114
|
+
console.log(chalk_1.default.blue('š Importing content via dcloud_import API...'));
|
|
115
|
+
const url = options.preview ? '/api/dcloud-import?preview=true' : '/api/dcloud-import';
|
|
116
|
+
const response = await client.client.post(url, importData);
|
|
117
|
+
// Check for success in multiple ways (preview mode doesn't return success field)
|
|
118
|
+
if (response.data.success || response.data.summary || (response.status === 200 && response.data)) {
|
|
119
|
+
console.log(chalk_1.default.green('ā
Import successful!'));
|
|
120
|
+
if (options.preview) {
|
|
121
|
+
console.log(chalk_1.default.cyan('\nš Preview Results:'));
|
|
122
|
+
if (response.data.summary) {
|
|
123
|
+
response.data.summary.forEach((item) => {
|
|
124
|
+
console.log(chalk_1.default.green(` ā ${item}`));
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
if (response.data.warnings && response.data.warnings.length > 0) {
|
|
128
|
+
console.log(chalk_1.default.yellow('\nā ļø Warnings:'));
|
|
129
|
+
response.data.warnings.forEach((warning) => {
|
|
130
|
+
console.log(chalk_1.default.yellow(` ⢠${warning}`));
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
if (response.data.model) {
|
|
136
|
+
console.log(chalk_1.default.cyan('\nš¦ Content Types Created:'));
|
|
137
|
+
response.data.model.forEach((model) => {
|
|
138
|
+
console.log(chalk_1.default.gray(` ⢠${model.label} (${model.bundle})`));
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
if (response.data.content) {
|
|
142
|
+
console.log(chalk_1.default.cyan('\nš Content Created:'));
|
|
143
|
+
response.data.content.forEach((content) => {
|
|
144
|
+
console.log(chalk_1.default.gray(` ⢠${content.title} (${content.type})`));
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
if (response.data.summary) {
|
|
148
|
+
console.log(chalk_1.default.cyan('\nš Import Summary:'));
|
|
149
|
+
response.data.summary.forEach((item) => {
|
|
150
|
+
console.log(chalk_1.default.green(` ā ${item}`));
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
console.error(chalk_1.default.red('ā Import failed:'), response.data.error || 'Unknown error');
|
|
157
|
+
process.exit(1);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
catch (error) {
|
|
161
|
+
console.error(chalk_1.default.red('ā Content import failed:'));
|
|
162
|
+
if (error instanceof Error) {
|
|
163
|
+
console.error(chalk_1.default.red('Error message:'), error.message);
|
|
164
|
+
if (error.response) {
|
|
165
|
+
console.error(chalk_1.default.red('Response status:'), error.response.status);
|
|
166
|
+
console.error(chalk_1.default.red('Response data:'), JSON.stringify(error.response.data, null, 2));
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
console.error(chalk_1.default.red('Unknown error:'), String(error));
|
|
171
|
+
}
|
|
172
|
+
process.exit(1);
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
exports.contentCommand
|
|
176
|
+
.command('status')
|
|
177
|
+
.description('Check content import API status')
|
|
178
|
+
.action(async () => {
|
|
179
|
+
try {
|
|
180
|
+
const client = await (0, api_1.createApiClient)();
|
|
181
|
+
const response = await client.client.get('/api/dcloud-import/status');
|
|
182
|
+
console.log(chalk_1.default.bold('\nš Content Import API Status'));
|
|
183
|
+
console.log('āāāāāāāāāāāāāāāāāāāāāāāāāāāāāā');
|
|
184
|
+
console.log(`Service: ${chalk_1.default.cyan(response.data.service || 'Unknown')}`);
|
|
185
|
+
console.log(`Version: ${chalk_1.default.cyan(response.data.version || 'Unknown')}`);
|
|
186
|
+
console.log(`Status: ${response.status === 200 ? chalk_1.default.green('ā
Available') : chalk_1.default.red('ā Error')}`);
|
|
187
|
+
if (response.data.endpoints) {
|
|
188
|
+
console.log(chalk_1.default.cyan('\nEndpoints:'));
|
|
189
|
+
Object.entries(response.data.endpoints).forEach(([endpoint, description]) => {
|
|
190
|
+
console.log(chalk_1.default.gray(` ${endpoint}: ${description}`));
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
catch (error) {
|
|
195
|
+
console.error(chalk_1.default.red('ā Status check failed:'), error instanceof Error ? error.message : String(error));
|
|
196
|
+
process.exit(1);
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
//# sourceMappingURL=content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.js","sourceRoot":"","sources":["../../src/commands/content.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAoC;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OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,QAAA,MAAM,eAAe,SAA0B,CAAC;AAiGhD,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.downloadCommand = void 0;
|
|
40
|
+
const commander_1 = require("commander");
|
|
41
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
42
|
+
const fs = __importStar(require("fs"));
|
|
43
|
+
const path = __importStar(require("path"));
|
|
44
|
+
const downloadCommand = new commander_1.Command('download');
|
|
45
|
+
exports.downloadCommand = downloadCommand;
|
|
46
|
+
downloadCommand
|
|
47
|
+
.description('Download AI configuration files')
|
|
48
|
+
.argument('<file>', 'AI config file to download (cursorrules, claude, gemini)')
|
|
49
|
+
.action(async (file) => {
|
|
50
|
+
try {
|
|
51
|
+
// Normalize the file argument
|
|
52
|
+
const availableFiles = {
|
|
53
|
+
'cursorrules': { filename: '.cursorrules', displayName: 'Cursor Rules' },
|
|
54
|
+
'cursor': { filename: '.cursorrules', displayName: 'Cursor Rules' },
|
|
55
|
+
'claude': { filename: 'CLAUDE.md', displayName: 'Claude Code Configuration' },
|
|
56
|
+
'gemini': { filename: 'GEMINI.md', displayName: 'Google Gemini Configuration' }
|
|
57
|
+
};
|
|
58
|
+
const normalizedFile = file.toLowerCase();
|
|
59
|
+
if (!availableFiles[normalizedFile]) {
|
|
60
|
+
console.error(chalk_1.default.red(`ā Unknown file: ${file}`));
|
|
61
|
+
console.log(chalk_1.default.gray('\nAvailable files:'));
|
|
62
|
+
Object.entries(availableFiles).forEach(([key, config]) => {
|
|
63
|
+
console.log(chalk_1.default.gray(` ⢠${key} ā ${config.filename} (${config.displayName})`));
|
|
64
|
+
});
|
|
65
|
+
process.exit(1);
|
|
66
|
+
}
|
|
67
|
+
const fileConfig = availableFiles[normalizedFile];
|
|
68
|
+
const sourceFileName = fileConfig.filename;
|
|
69
|
+
const displayName = fileConfig.displayName;
|
|
70
|
+
// Get the directory where the CLI is installed
|
|
71
|
+
const cliDir = path.resolve(__dirname, '../..');
|
|
72
|
+
const examplesDir = path.join(cliDir, 'examples');
|
|
73
|
+
const sourcePath = path.join(examplesDir, sourceFileName);
|
|
74
|
+
// Check if source file exists
|
|
75
|
+
if (!fs.existsSync(sourcePath)) {
|
|
76
|
+
console.error(chalk_1.default.red(`ā Source file not found: ${sourcePath}`));
|
|
77
|
+
process.exit(1);
|
|
78
|
+
}
|
|
79
|
+
// Destination path (current working directory)
|
|
80
|
+
const destPath = path.join(process.cwd(), sourceFileName);
|
|
81
|
+
// Check if destination file already exists
|
|
82
|
+
if (fs.existsSync(destPath)) {
|
|
83
|
+
const { default: inquirer } = await Promise.resolve().then(() => __importStar(require('inquirer')));
|
|
84
|
+
const answers = await inquirer.prompt([
|
|
85
|
+
{
|
|
86
|
+
type: 'confirm',
|
|
87
|
+
name: 'overwrite',
|
|
88
|
+
message: `File ${sourceFileName} already exists. Overwrite?`,
|
|
89
|
+
default: false
|
|
90
|
+
}
|
|
91
|
+
]);
|
|
92
|
+
if (!answers.overwrite) {
|
|
93
|
+
console.log(chalk_1.default.yellow('Operation cancelled.'));
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
// Read and write the file
|
|
98
|
+
const content = fs.readFileSync(sourcePath, 'utf8');
|
|
99
|
+
fs.writeFileSync(destPath, content, 'utf8');
|
|
100
|
+
console.log(chalk_1.default.green(`ā
Downloaded ${displayName}`));
|
|
101
|
+
console.log(chalk_1.default.gray(`š Saved to: ${destPath}`));
|
|
102
|
+
// Show file size and first few lines as preview
|
|
103
|
+
const stats = fs.statSync(destPath);
|
|
104
|
+
const lines = content.split('\n');
|
|
105
|
+
const previewLines = lines.slice(0, 3).join('\n');
|
|
106
|
+
console.log(chalk_1.default.gray(`š Size: ${stats.size} bytes`));
|
|
107
|
+
console.log(chalk_1.default.gray('š Preview:'));
|
|
108
|
+
console.log(chalk_1.default.dim(previewLines + (lines.length > 3 ? '\n...' : '')));
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
console.error(chalk_1.default.red('ā Failed to download file:'), error instanceof Error ? error.message : String(error));
|
|
112
|
+
process.exit(1);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
// Add help examples
|
|
116
|
+
downloadCommand.addHelpText('after', `
|
|
117
|
+
Examples:
|
|
118
|
+
dcloud download cursorrules Download .cursorrules file for Cursor AI
|
|
119
|
+
dcloud download claude Download CLAUDE.md configuration
|
|
120
|
+
dcloud download gemini Download GEMINI.md configuration
|
|
121
|
+
|
|
122
|
+
Available Files:
|
|
123
|
+
⢠cursorrules/.cursor ā .cursorrules (Cursor AI configuration)
|
|
124
|
+
⢠claude ā CLAUDE.md (Claude Code configuration)
|
|
125
|
+
⢠gemini ā GEMINI.md (Google Gemini configuration)
|
|
126
|
+
`);
|
|
127
|
+
//# sourceMappingURL=download.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download.js","sourceRoot":"","sources":["../../src/commands/download.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAoC;AACpC,kDAA0B;AAC1B,uCAAyB;AACzB,2CAA6B;AAE7B,MAAM,eAAe,GAAG,IAAI,mBAAO,CAAC,UAAU,CAAC,CAAC;AAiGvC,0CAAe;AA/FxB,eAAe;KACZ,WAAW,CAAC,iCAAiC,CAAC;KAC9C,QAAQ,CAAC,QAAQ,EAAE,0DAA0D,CAAC;KAC9E,MAAM,CAAC,KAAK,EAAE,IAAY,EAAE,EAAE;IAC7B,IAAI,CAAC;QACH,8BAA8B;QAC9B,MAAM,cAAc,GAAG;YACrB,aAAa,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE;YACxE,QAAQ,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE;YACnE,QAAQ,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,WA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G,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAClC,MAAM,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAElD,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,YAAY,KAAK,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC;QACxD,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;QACvC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,GAAG,CAAC,YAAY,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAE3E,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,4BAA4B,CAAC,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC/G,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,oBAAoB;AACpB,eAAe,CAAC,WAAW,CAAC,OAAO,EAAE;;;;;;;;;;CAUpC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../src/commands/health.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,eAAO,MAAM,aAAa,SAoBtB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.healthCommand = void 0;
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
const api_1 = require("../lib/api");
|
|
10
|
+
exports.healthCommand = new commander_1.Command('health')
|
|
11
|
+
.description('Check API health and connectivity')
|
|
12
|
+
.option('--verbose', 'show detailed information')
|
|
13
|
+
.action(async (options) => {
|
|
14
|
+
try {
|
|
15
|
+
console.log(chalk_1.default.blue('š„ Checking API health...'));
|
|
16
|
+
const client = await (0, api_1.createApiClient)();
|
|
17
|
+
const health = await client.healthCheck();
|
|
18
|
+
console.log(chalk_1.default.green('ā
API is healthy'));
|
|
19
|
+
if (options.verbose) {
|
|
20
|
+
console.log('\nDetails:', health);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
console.error(chalk_1.default.red('ā Health check failed:'), error instanceof Error ? error.message : String(error));
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=health.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.js","sourceRoot":"","sources":["../../src/commands/health.ts"],"names":[],"mappings":";;;;;;AAAA,yCAAoC;AACpC,kDAA0B;AAC1B,oCAA6C;AAEhC,QAAA,aAAa,GAAG,IAAI,mBAAO,CAAC,QAAQ,CAAC;KAC/C,WAAW,CAAC,mCAAmC,CAAC;KAChD,MAAM,CAAC,WAAW,EAAE,2BAA2B,CAAC;KAChD,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IACxB,IAAI,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC,CAAC;QAErD,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAe,GAAE,CAAC;QACvC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,WAAW,EAAE,CAAC;QAE1C,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC;QAE7C,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YACpB,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;QACpC,CAAC;IAEH,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,wBAAwB,CAAC,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC3G,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"org.d.ts","sourceRoot":"","sources":["../../src/commands/org.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,eAAO,MAAM,UAAU,SAEkB,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.orgCommand = void 0;
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
const api_1 = require("../lib/api");
|
|
10
|
+
exports.orgCommand = new commander_1.Command('org')
|
|
11
|
+
.alias('organization')
|
|
12
|
+
.description('Organization management');
|
|
13
|
+
exports.orgCommand
|
|
14
|
+
.command('info')
|
|
15
|
+
.description('Show organization information')
|
|
16
|
+
.option('--json', 'output as JSON')
|
|
17
|
+
.action(async (options) => {
|
|
18
|
+
try {
|
|
19
|
+
const client = await (0, api_1.createApiClient)();
|
|
20
|
+
const org = await client.getOrganization();
|
|
21
|
+
if (options.json) {
|
|
22
|
+
console.log(JSON.stringify(org, null, 2));
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
console.log(chalk_1.default.bold('\nš¢ Organization Information'));
|
|
26
|
+
console.log('āāāāāāāāāāāāāāāāāāāāāāāāāāā');
|
|
27
|
+
if (org.organization) {
|
|
28
|
+
console.log(`Name: ${chalk_1.default.cyan(org.organization.name || 'N/A')}`);
|
|
29
|
+
console.log(`ID: ${chalk_1.default.cyan(org.organization.id || 'N/A')}`);
|
|
30
|
+
console.log(`Plan: ${chalk_1.default.cyan(org.organization.plan || 'N/A')}`);
|
|
31
|
+
console.log(`Created: ${chalk_1.default.gray(org.organization.createdAt ? new Date(org.organization.createdAt).toLocaleString() : 'N/A')}`);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
console.log(chalk_1.default.gray('No organization information available.'));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
console.error(chalk_1.default.red('ā Failed to get organization info:'), error instanceof Error ? error.message : String(error));
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
exports.orgCommand
|
|
44
|
+
.command('users')
|
|
45
|
+
.alias('members')
|
|
46
|
+
.description('List organization users')
|
|
47
|
+
.option('--json', 'output as JSON')
|
|
48
|
+
.action(async (options) => {
|
|
49
|
+
try {
|
|
50
|
+
const client = await (0, api_1.createApiClient)();
|
|
51
|
+
const users = await client.getUsers();
|
|
52
|
+
if (options.json) {
|
|
53
|
+
console.log(JSON.stringify(users, null, 2));
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
console.log(chalk_1.default.bold('\nš„ Organization Users'));
|
|
57
|
+
console.log('āāāāāāāāāāāāāāāāāāāā');
|
|
58
|
+
if (users.users && users.users.length > 0) {
|
|
59
|
+
users.users.forEach((user) => {
|
|
60
|
+
console.log(`${chalk_1.default.cyan(user.email)} - ${chalk_1.default.yellow(user.role)}`);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
console.log(chalk_1.default.gray('No users found.'));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
console.error(chalk_1.default.red('ā Failed to get users:'), error instanceof Error ? error.message : String(error));
|
|
70
|
+
process.exit(1);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
//# sourceMappingURL=org.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"org.js","sourceRoot":"","sources":["../../src/commands/org.ts"],"names":[],"mappings":";;;;;;AAAA,yCAAoC;AACpC,kDAA0B;AAC1B,oCAA6C;AAEhC,QAAA,UAAU,GAAG,IAAI,mBAAO,CAAC,KAAK,CAAC;KACzC,KAAK,CAAC,cAAc,CAAC;KACrB,WAAW,CAAC,yBAAyB,CAAC,CAAC;AAE1C,kBAAU;KACP,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,+BAA+B,CAAC;KAC5C,MAAM,CAAC,QAAQ,EAAE,gBAAgB,CAAC;KAClC,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IACxB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAe,GAAE,CAAC;QACvC,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,eAAe,EAAE,CAAC;QAE3C,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YACjB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAC5C,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC,CAAC;YACzD,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