@x12i/kinedrop-cli 0.1.1 → 0.2.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/extended.mjs +12 -0
- package/index.mjs +0 -11
- package/package.json +2 -5
package/extended.mjs
CHANGED
|
@@ -64,6 +64,10 @@ Service operations:
|
|
|
64
64
|
|
|
65
65
|
Apps (requires a configured Apps service and explicit app/environment):
|
|
66
66
|
apps list | create <name> Register application metadata
|
|
67
|
+
workspaces plan <json-file> Plan a customer workspace enrollment
|
|
68
|
+
workspaces apply <operation-id> Apply that enrollment. A retry resumes it
|
|
69
|
+
workspaces inspect <operation-id> | list Inspect enrollment and its verification
|
|
70
|
+
workspaces inventory Read this workspace's apps, routes and attachments
|
|
67
71
|
apps retention capabilities|pins|retirements <app>
|
|
68
72
|
apps retention plan|set-pins <app> <json-file>
|
|
69
73
|
apps retention get <app> <plan-id>
|
|
@@ -258,6 +262,14 @@ export async function runExtended({args,options,client,requestOptions,cwd,stdin,
|
|
|
258
262
|
const families={sql:{query:'query','create-table':'createTable'},search:{query:'query','create-index':'createIndex',insert:'insert'},analytics:{query:'query','create-table':'createTable',ingest:'ingest'}};
|
|
259
263
|
if(families[command]?.[action]&&rest.length===2)return result(await client[command][families[command][action]](rest[0],await jsonFile(rest[1]),requestOptions));
|
|
260
264
|
if(command==='mongo'&&['query','insert'].includes(action)&&rest.length===3)return result(await client.databases[action](rest[0],rest[1],await jsonFile(rest[2]),requestOptions));
|
|
265
|
+
if(command==='workspaces'){
|
|
266
|
+
if(action==='plan'&&rest.length===1)return result(await client.workspaces.plan(await jsonFile(rest[0]),requestOptions));
|
|
267
|
+
if(action==='apply'&&rest.length===1)return result(await client.workspaces.apply(rest[0],requestOptions));
|
|
268
|
+
if(action==='inspect'&&rest.length===1)return result(await client.workspaces.inspect(rest[0]));
|
|
269
|
+
if(action==='list'&&!rest.length)return result(await client.workspaces.list());
|
|
270
|
+
if(action==='inventory'&&!rest.length)return result(await client.workspaces.inventory());
|
|
271
|
+
throw Object.assign(new Error('Use workspaces plan <json-file>, apply <operation-id>, inspect <operation-id>, list, or inventory.'),{code:'INVALID_ARGUMENTS'});
|
|
272
|
+
}
|
|
261
273
|
if(command==='apps'){
|
|
262
274
|
if(action==='retention'){
|
|
263
275
|
const [verb,app,idOrFile,file]=rest,api=client.apps.retention;required(app,'Application name');
|
package/index.mjs
CHANGED
|
@@ -22,9 +22,6 @@ Usage: kd <command> [arguments] [options]
|
|
|
22
22
|
runtime Inspect package and service evidence
|
|
23
23
|
auth authority Inspect the server's account authority
|
|
24
24
|
orgs list | create <name> Manage local organizations
|
|
25
|
-
workspaces plan | apply <enrollment.json> Enroll a customer workspace
|
|
26
|
-
workspaces inspect <operationId> Read one workspace enrollment
|
|
27
|
-
workspaces inventory Inspect targets and service bindings
|
|
28
25
|
resources list List organization resources
|
|
29
26
|
resources create <service> <name> Register resource intent
|
|
30
27
|
cache binding <id> Inspect a registered Valkey binding
|
|
@@ -174,14 +171,6 @@ export async function runCli(argv = process.argv.slice(2), { env = process.env,
|
|
|
174
171
|
else if (action === 'create' && rest.length === 1) result = await client.orgs.create({ name: required(rest[0], 'Organization name') }, requestOptions);
|
|
175
172
|
else throw invalid('Use orgs list or orgs create <name>.');
|
|
176
173
|
break;
|
|
177
|
-
case 'workspaces': {
|
|
178
|
-
const enrollmentFile = async () => JSON.parse((await inputBytes(required(rest[0], 'Enrollment file'))).toString('utf8'));
|
|
179
|
-
if ((action === 'plan' || action === 'apply') && rest.length === 1) result = await client.workspaces[action](await enrollmentFile(), requestOptions);
|
|
180
|
-
else if (action === 'inspect' && rest.length === 1) result = await client.workspaces.inspect(rest[0], requestOptions);
|
|
181
|
-
else if (action === 'inventory' && !rest.length) result = await client.workspaces.inventory();
|
|
182
|
-
else throw invalid('Use workspaces plan|apply <enrollment.json>, workspaces inspect <operationId>, or workspaces inventory.');
|
|
183
|
-
break;
|
|
184
|
-
}
|
|
185
174
|
case 'resources':
|
|
186
175
|
if (action === 'list' && !rest.length) result = await client.resources.list();
|
|
187
176
|
else if (action === 'create' && rest.length === 2) {
|
package/package.json
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@x12i/kinedrop-cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"license": "UNLICENSED",
|
|
5
|
-
"repository": { "type": "git", "url": "git+https://github.com/kinedrop/kinedrop.git", "directory": "packages/kinedrop-cli" },
|
|
6
|
-
"publishConfig": { "access": "public" },
|
|
3
|
+
"version": "0.2.0",
|
|
7
4
|
"type": "module",
|
|
8
5
|
"bin": { "kd": "./index.mjs" },
|
|
9
6
|
"engines": { "node": ">=24.0.0" },
|
|
10
|
-
"dependencies": { "@x12i/kinedrop": "0.
|
|
7
|
+
"dependencies": { "@x12i/kinedrop": "0.2.0" },
|
|
11
8
|
"files": ["index.mjs", "extended.mjs", "source.mjs", "login.mjs", "credential-output.mjs"]
|
|
12
9
|
}
|