@serve.zone/cli 5.5.1 → 32.9.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/cli.js +2 -2
- package/dist_ts_cliclient/classes.cliclient.d.ts +6 -0
- package/dist_ts_cliclient/classes.cliclient.js +12 -0
- package/dist_ts_cliclient/index.d.ts +1 -0
- package/dist_ts_cliclient/index.js +31 -0
- package/dist_ts_cliclient/plugins.d.ts +6 -0
- package/dist_ts_cliclient/plugins.js +9 -0
- package/package.json +54 -24
- package/readme.md +5 -5
- package/ts_cliclient/index.ts +5 -1
- package/ts_cliclient/readme.md +5 -5
- package/ts_cliclient/tspublish.json +0 -15
package/cli.js
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as plugins from './plugins.js';
|
|
2
|
+
import { CloudlyApiClient } from '@serve.zone/api';
|
|
3
|
+
export class CliClient {
|
|
4
|
+
constructor(cloudlyApiClientArg) {
|
|
5
|
+
this.cloudlyApiClient = cloudlyApiClientArg;
|
|
6
|
+
}
|
|
7
|
+
async getClusters() {
|
|
8
|
+
const clusters = await this.cloudlyApiClient.cluster.getClusters();
|
|
9
|
+
console.log(clusters);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xhc3Nlcy5jbGljbGllbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90c19jbGljbGllbnQvY2xhc3Nlcy5jbGljbGllbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLE9BQU8sTUFBTSxjQUFjLENBQUM7QUFDeEMsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFFbkQsTUFBTSxPQUFPLFNBQVM7SUFHcEIsWUFBWSxtQkFBcUM7UUFDL0MsSUFBSSxDQUFDLGdCQUFnQixHQUFHLG1CQUFtQixDQUFDO0lBQzlDLENBQUM7SUFFTSxLQUFLLENBQUMsV0FBVztRQUN0QixNQUFNLFFBQVEsR0FBRyxNQUFNLElBQUksQ0FBQyxnQkFBZ0IsQ0FBQyxPQUFPLENBQUMsV0FBVyxFQUFFLENBQUM7UUFDbkUsT0FBTyxDQUFDLEdBQUcsQ0FBQyxRQUFRLENBQUMsQ0FBQztJQUN4QixDQUFDO0NBQ0YifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const runCli: () => Promise<void>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as plugins from './plugins.js';
|
|
2
|
+
import { CliClient } from './classes.cliclient.js';
|
|
3
|
+
export const runCli = async () => {
|
|
4
|
+
// The directory the operator runs the CLI in is read for sources, exactly as before, but the
|
|
5
|
+
// `required:` list it may find there is never enforced: that list is the Cloudly server's own
|
|
6
|
+
// start-time contract, and none of a remote server's database, storage or keyring facts is this
|
|
7
|
+
// client's to hold. The one name this client needs is asked for by name on the next line.
|
|
8
|
+
const cliQenv = new plugins.qenv.Qenv(process.cwd(), undefined, false);
|
|
9
|
+
const cloudlyUrl = await cliQenv.getEnvVarOnDemand('CLOUDLY_URL');
|
|
10
|
+
const token = process.env.CLOUDLY_TOKEN;
|
|
11
|
+
const username = process.env.CLOUDLY_USERNAME;
|
|
12
|
+
const password = process.env.CLOUDLY_PASSWORD;
|
|
13
|
+
const apiClient = new plugins.servezoneApi.CloudlyApiClient({
|
|
14
|
+
registerAs: 'cli',
|
|
15
|
+
cloudlyUrl,
|
|
16
|
+
});
|
|
17
|
+
await apiClient.start();
|
|
18
|
+
if (token) {
|
|
19
|
+
await apiClient.getIdentityByToken(token, { tagConnection: true, statefullIdentity: true });
|
|
20
|
+
}
|
|
21
|
+
else if (username && password) {
|
|
22
|
+
await apiClient.loginWithUsernameAndPassword(username, password);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
console.log('No credentials provided. Set CLOUDLY_TOKEN or CLOUDLY_USERNAME/CLOUDLY_PASSWORD.');
|
|
26
|
+
}
|
|
27
|
+
const cliClient = new CliClient(apiClient);
|
|
28
|
+
// Default action example: list clusters when invoked without subcommands
|
|
29
|
+
await cliClient.getClusters();
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90c19jbGljbGllbnQvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLE9BQU8sTUFBTSxjQUFjLENBQUM7QUFDeEMsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBRW5ELE1BQU0sQ0FBQyxNQUFNLE1BQU0sR0FBRyxLQUFLLElBQUksRUFBRTtJQUMvQiw2RkFBNkY7SUFDN0YsOEZBQThGO0lBQzlGLGdHQUFnRztJQUNoRywwRkFBMEY7SUFDMUYsTUFBTSxPQUFPLEdBQUcsSUFBSSxPQUFPLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsR0FBRyxFQUFFLEVBQUUsU0FBUyxFQUFFLEtBQUssQ0FBQyxDQUFDO0lBQ3ZFLE1BQU0sVUFBVSxHQUFHLE1BQU0sT0FBTyxDQUFDLGlCQUFpQixDQUFDLGFBQWEsQ0FBQyxDQUFDO0lBQ2xFLE1BQU0sS0FBSyxHQUFHLE9BQU8sQ0FBQyxHQUFHLENBQUMsYUFBYSxDQUFDO0lBQ3hDLE1BQU0sUUFBUSxHQUFHLE9BQU8sQ0FBQyxHQUFHLENBQUMsZ0JBQWdCLENBQUM7SUFDOUMsTUFBTSxRQUFRLEdBQUcsT0FBTyxDQUFDLEdBQUcsQ0FBQyxnQkFBZ0IsQ0FBQztJQUU5QyxNQUFNLFNBQVMsR0FBRyxJQUFJLE9BQU8sQ0FBQyxZQUFZLENBQUMsZ0JBQWdCLENBQUM7UUFDMUQsVUFBVSxFQUFFLEtBQUs7UUFDakIsVUFBVTtLQUNYLENBQUMsQ0FBQztJQUNILE1BQU0sU0FBUyxDQUFDLEtBQUssRUFBRSxDQUFDO0lBRXhCLElBQUksS0FBSyxFQUFFLENBQUM7UUFDVixNQUFNLFNBQVMsQ0FBQyxrQkFBa0IsQ0FBQyxLQUFLLEVBQUUsRUFBRSxhQUFhLEVBQUUsSUFBSSxFQUFFLGlCQUFpQixFQUFFLElBQUksRUFBRSxDQUFDLENBQUM7SUFDOUYsQ0FBQztTQUFNLElBQUksUUFBUSxJQUFJLFFBQVEsRUFBRSxDQUFDO1FBQ2hDLE1BQU0sU0FBUyxDQUFDLDRCQUE0QixDQUFDLFFBQVEsRUFBRSxRQUFRLENBQUMsQ0FBQztJQUNuRSxDQUFDO1NBQU0sQ0FBQztRQUNOLE9BQU8sQ0FBQyxHQUFHLENBQUMsa0ZBQWtGLENBQUMsQ0FBQztJQUNsRyxDQUFDO0lBRUQsTUFBTSxTQUFTLEdBQUcsSUFBSSxTQUFTLENBQUMsU0FBUyxDQUFDLENBQUM7SUFDM0MseUVBQXlFO0lBQ3pFLE1BQU0sU0FBUyxDQUFDLFdBQVcsRUFBRSxDQUFDO0FBQ2hDLENBQUMsQ0FBQyJ9
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as servezoneApi from '@serve.zone/api';
|
|
2
|
+
import * as servezoneInterfaces from '@serve.zone/interfaces';
|
|
3
|
+
export { servezoneApi, servezoneInterfaces };
|
|
4
|
+
import * as projectinfo from '@push.rocks/projectinfo';
|
|
5
|
+
import * as qenv from '@push.rocks/qenv';
|
|
6
|
+
export { projectinfo, qenv, };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// @serve.zone scope
|
|
2
|
+
import * as servezoneApi from '@serve.zone/api';
|
|
3
|
+
import * as servezoneInterfaces from '@serve.zone/interfaces';
|
|
4
|
+
export { servezoneApi, servezoneInterfaces };
|
|
5
|
+
// @push.rocks scope
|
|
6
|
+
import * as projectinfo from '@push.rocks/projectinfo';
|
|
7
|
+
import * as qenv from '@push.rocks/qenv';
|
|
8
|
+
export { projectinfo, qenv, };
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGx1Z2lucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzX2NsaWNsaWVudC9wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLG9CQUFvQjtBQUNwQixPQUFPLEtBQUssWUFBWSxNQUFNLGlCQUFpQixDQUFDO0FBQ2hELE9BQU8sS0FBSyxtQkFBbUIsTUFBTSx3QkFBd0IsQ0FBQztBQUU5RCxPQUFPLEVBQ0wsWUFBWSxFQUNaLG1CQUFtQixFQUNwQixDQUFBO0FBRUQsb0JBQW9CO0FBQ3BCLE9BQU8sS0FBSyxXQUFXLE1BQU0seUJBQXlCLENBQUM7QUFDdkQsT0FBTyxLQUFLLElBQUksTUFBTSxrQkFBa0IsQ0FBQztBQUV6QyxPQUFPLEVBQ0wsV0FBVyxFQUNYLElBQUksR0FDTCxDQUFBIn0=
|
package/package.json
CHANGED
|
@@ -1,39 +1,69 @@
|
|
|
1
1
|
{
|
|
2
|
+
"author": "Task Venture Capital GmbH",
|
|
3
|
+
"license": "MIT",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "git+https://code.foss.global/serve.zone/cloudly.git"
|
|
7
|
+
},
|
|
8
|
+
"homepage": "https://code.foss.global/serve.zone/cloudly#readme",
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://code.foss.global/serve.zone/cloudly/issues"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"multi-cloud management",
|
|
14
|
+
"Docker Swarmkit",
|
|
15
|
+
"container orchestration",
|
|
16
|
+
"cloud services",
|
|
17
|
+
"API integration",
|
|
18
|
+
"web interface",
|
|
19
|
+
"CLI",
|
|
20
|
+
"CI/CD integration",
|
|
21
|
+
"cloud providers",
|
|
22
|
+
"DigitalOcean",
|
|
23
|
+
"Hetzner Cloud",
|
|
24
|
+
"Cloudflare",
|
|
25
|
+
"TypeScript",
|
|
26
|
+
"Node.js",
|
|
27
|
+
"infrastructure automation",
|
|
28
|
+
"devOps",
|
|
29
|
+
"secret management",
|
|
30
|
+
"configuration management",
|
|
31
|
+
"task scheduling",
|
|
32
|
+
"logging",
|
|
33
|
+
"SSL management",
|
|
34
|
+
"system logging",
|
|
35
|
+
"cloud API client",
|
|
36
|
+
"frontend",
|
|
37
|
+
"backend",
|
|
38
|
+
"security"
|
|
39
|
+
],
|
|
2
40
|
"name": "@serve.zone/cli",
|
|
3
|
-
"version": "
|
|
41
|
+
"version": "32.9.0",
|
|
4
42
|
"type": "module",
|
|
5
|
-
"description": "",
|
|
43
|
+
"description": "A comprehensive tool for managing containerized applications across multiple cloud providers using Docker Swarmkit, featuring web, CLI, and API interfaces.",
|
|
44
|
+
"main": "./dist_ts_cliclient/index.js",
|
|
45
|
+
"types": "./dist_ts_cliclient/index.d.ts",
|
|
6
46
|
"exports": {
|
|
7
47
|
".": {
|
|
48
|
+
"types": "./dist_ts_cliclient/index.d.ts",
|
|
8
49
|
"import": "./dist_ts_cliclient/index.js"
|
|
9
50
|
}
|
|
10
51
|
},
|
|
11
52
|
"dependencies": {
|
|
12
|
-
"@serve.zone/api": "
|
|
13
|
-
"@serve.zone/interfaces": "
|
|
53
|
+
"@serve.zone/api": "32.0.0",
|
|
54
|
+
"@serve.zone/interfaces": "32.18.0",
|
|
14
55
|
"@push.rocks/projectinfo": "^5.1.0",
|
|
15
|
-
"@push.rocks/qenv": "^
|
|
16
|
-
"@push.rocks/smartcli": "^4.0
|
|
17
|
-
},
|
|
18
|
-
"devDependencies": {
|
|
19
|
-
"@git.zone/tsbuild": "2.1.67"
|
|
56
|
+
"@push.rocks/qenv": "^8.1.0",
|
|
57
|
+
"@push.rocks/smartcli": "^4.3.0"
|
|
20
58
|
},
|
|
21
|
-
"files": [
|
|
22
|
-
"ts/**/*",
|
|
23
|
-
"ts_*/**/*",
|
|
24
|
-
"dist/**/*",
|
|
25
|
-
"dist_*/**/*",
|
|
26
|
-
"dist_ts/**/*",
|
|
27
|
-
"dist_ts_web/**/*",
|
|
28
|
-
"assets/**/*",
|
|
29
|
-
"cli.js",
|
|
30
|
-
".smartconfig.json",
|
|
31
|
-
"readme.md"
|
|
32
|
-
],
|
|
33
59
|
"bin": {
|
|
34
60
|
"servezone": "./cli.js"
|
|
35
61
|
},
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
|
|
62
|
+
"files": [
|
|
63
|
+
"ts_cliclient",
|
|
64
|
+
"dist_ts_cliclient",
|
|
65
|
+
"readme.md",
|
|
66
|
+
"license",
|
|
67
|
+
"cli.js"
|
|
68
|
+
]
|
|
39
69
|
}
|
package/readme.md
CHANGED
|
@@ -20,10 +20,10 @@ It is not currently a full command tree for services, secrets, deployments, logs
|
|
|
20
20
|
|
|
21
21
|
## Installation
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
Every Cloudly release publishes the package from `cloudly/ts_cliclient`, through its `tspublish.json`, under the name `@serve.zone/cli` with the `servezone` binary and at the Cloudly version. Its registry versions therefore jump from 5.5.1 to Cloudly's 32.x line.
|
|
24
24
|
|
|
25
25
|
```sh
|
|
26
|
-
pnpm add
|
|
26
|
+
pnpm add --global @serve.zone/cli
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
For local development inside the Cloudly repository, build the parent package:
|
|
@@ -52,11 +52,11 @@ CLOUDLY_PASSWORD=change-me \
|
|
|
52
52
|
servezone
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
When `CLOUDLY_TOKEN` is present, the CLI
|
|
55
|
+
When `CLOUDLY_TOKEN` is present, the CLI exchanges it for an identity and tags the WebSocket with a JWT-only credential. Cloudly verifies the JWT and reconstructs authoritative identity fields from persisted user data. Machine JWTs never outlive their source tokens, and cluster machine users must belong to exactly one persisted cluster. When username/password are present instead, the CLI uses Cloudly's admin login flow. If no credentials are provided, it prints a warning before attempting the default cluster-list operation.
|
|
56
56
|
|
|
57
57
|
## Programmatic Use
|
|
58
58
|
|
|
59
|
-
The submodule exports the `runCli()` entry point
|
|
59
|
+
The published submodule exports the `runCli()` entry point. For automation, most callers should use `@serve.zone/api` directly; the internal `CliClient` currently wraps `CloudlyApiClient` only to run the default cluster-list action:
|
|
60
60
|
|
|
61
61
|
```ts
|
|
62
62
|
import { CloudlyApiClient } from '@serve.zone/api';
|
|
@@ -81,7 +81,7 @@ await cli.getClusters();
|
|
|
81
81
|
| `index.ts` | Runtime entry point for the published CLI. |
|
|
82
82
|
| `classes.cliclient.ts` | Minimal client wrapper; currently exposes `getClusters()`. |
|
|
83
83
|
| `plugins.ts` | Centralized imports for the submodule. |
|
|
84
|
-
| `tspublish.json` | Published package name, dependencies,
|
|
84
|
+
| `tspublish.json` | Published package name, dependencies, `servezone` bin metadata, and `useBase`, which takes the registries from the release's npm target. |
|
|
85
85
|
|
|
86
86
|
## License and Legal Information
|
|
87
87
|
|
package/ts_cliclient/index.ts
CHANGED
|
@@ -2,7 +2,11 @@ import * as plugins from './plugins.js';
|
|
|
2
2
|
import { CliClient } from './classes.cliclient.js';
|
|
3
3
|
|
|
4
4
|
export const runCli = async () => {
|
|
5
|
-
|
|
5
|
+
// The directory the operator runs the CLI in is read for sources, exactly as before, but the
|
|
6
|
+
// `required:` list it may find there is never enforced: that list is the Cloudly server's own
|
|
7
|
+
// start-time contract, and none of a remote server's database, storage or keyring facts is this
|
|
8
|
+
// client's to hold. The one name this client needs is asked for by name on the next line.
|
|
9
|
+
const cliQenv = new plugins.qenv.Qenv(process.cwd(), undefined, false);
|
|
6
10
|
const cloudlyUrl = await cliQenv.getEnvVarOnDemand('CLOUDLY_URL');
|
|
7
11
|
const token = process.env.CLOUDLY_TOKEN;
|
|
8
12
|
const username = process.env.CLOUDLY_USERNAME;
|
package/ts_cliclient/readme.md
CHANGED
|
@@ -20,10 +20,10 @@ It is not currently a full command tree for services, secrets, deployments, logs
|
|
|
20
20
|
|
|
21
21
|
## Installation
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
Every Cloudly release publishes the package from `cloudly/ts_cliclient`, through its `tspublish.json`, under the name `@serve.zone/cli` with the `servezone` binary and at the Cloudly version. Its registry versions therefore jump from 5.5.1 to Cloudly's 32.x line.
|
|
24
24
|
|
|
25
25
|
```sh
|
|
26
|
-
pnpm add
|
|
26
|
+
pnpm add --global @serve.zone/cli
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
For local development inside the Cloudly repository, build the parent package:
|
|
@@ -52,11 +52,11 @@ CLOUDLY_PASSWORD=change-me \
|
|
|
52
52
|
servezone
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
When `CLOUDLY_TOKEN` is present, the CLI
|
|
55
|
+
When `CLOUDLY_TOKEN` is present, the CLI exchanges it for an identity and tags the WebSocket with a JWT-only credential. Cloudly verifies the JWT and reconstructs authoritative identity fields from persisted user data. Machine JWTs never outlive their source tokens, and cluster machine users must belong to exactly one persisted cluster. When username/password are present instead, the CLI uses Cloudly's admin login flow. If no credentials are provided, it prints a warning before attempting the default cluster-list operation.
|
|
56
56
|
|
|
57
57
|
## Programmatic Use
|
|
58
58
|
|
|
59
|
-
The submodule exports the `runCli()` entry point
|
|
59
|
+
The published submodule exports the `runCli()` entry point. For automation, most callers should use `@serve.zone/api` directly; the internal `CliClient` currently wraps `CloudlyApiClient` only to run the default cluster-list action:
|
|
60
60
|
|
|
61
61
|
```ts
|
|
62
62
|
import { CloudlyApiClient } from '@serve.zone/api';
|
|
@@ -81,7 +81,7 @@ await cli.getClusters();
|
|
|
81
81
|
| `index.ts` | Runtime entry point for the published CLI. |
|
|
82
82
|
| `classes.cliclient.ts` | Minimal client wrapper; currently exposes `getClusters()`. |
|
|
83
83
|
| `plugins.ts` | Centralized imports for the submodule. |
|
|
84
|
-
| `tspublish.json` | Published package name, dependencies,
|
|
84
|
+
| `tspublish.json` | Published package name, dependencies, `servezone` bin metadata, and `useBase`, which takes the registries from the release's npm target. |
|
|
85
85
|
|
|
86
86
|
## License and Legal Information
|
|
87
87
|
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@serve.zone/cli",
|
|
3
|
-
"dependencies": [
|
|
4
|
-
"@serve.zone/api",
|
|
5
|
-
"@serve.zone/interfaces",
|
|
6
|
-
"@push.rocks/projectinfo",
|
|
7
|
-
"@push.rocks/qenv",
|
|
8
|
-
"@push.rocks/smartcli"
|
|
9
|
-
],
|
|
10
|
-
"registries": [
|
|
11
|
-
"registry.npmjs.org:public",
|
|
12
|
-
"verdaccio.lossless.digital:public"
|
|
13
|
-
],
|
|
14
|
-
"bin": ["servezone"]
|
|
15
|
-
}
|