@lotics/cli 0.149.0 → 0.150.1
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/dist/src/cli.js +30 -0
- package/dist/src/client.d.ts +7 -0
- package/dist/src/client.js +5 -0
- package/docs/cli_reference.md +1 -0
- package/package.json +1 -1
package/dist/src/cli.js
CHANGED
|
@@ -44381,6 +44381,11 @@ var LoticsClient = class {
|
|
|
44381
44381
|
async createWorkspace(body) {
|
|
44382
44382
|
return this.request("POST", "/v1/workspaces", body);
|
|
44383
44383
|
}
|
|
44384
|
+
/** Renames (and re-settings) the CURRENT workspace — the endpoint reads the
|
|
44385
|
+
* target from the request's workspace, never a path id. */
|
|
44386
|
+
async updateWorkspace(body) {
|
|
44387
|
+
return this.request("PATCH", "/v1/workspace", body);
|
|
44388
|
+
}
|
|
44384
44389
|
async deleteWorkspace(id) {
|
|
44385
44390
|
return this.request("DELETE", `/v1/workspaces/${encodeURIComponent(id)}`);
|
|
44386
44391
|
}
|
|
@@ -45789,6 +45794,7 @@ var COMMANDS = [
|
|
|
45789
45794
|
" lotics workspace List workspaces in the active org (marks current)",
|
|
45790
45795
|
" lotics workspace select <id> Switch to a different workspace",
|
|
45791
45796
|
" lotics workspace create <name> Create a new workspace (admin only)",
|
|
45797
|
+
" lotics workspace rename <name> Rename the current workspace (admin only)",
|
|
45792
45798
|
" lotics workspace delete <id> --yes Delete a workspace (admin only; soft delete, recoverable)",
|
|
45793
45799
|
" lotics workspace doctor Report dangling schema references (admin only)"
|
|
45794
45800
|
]
|
|
@@ -103432,6 +103438,30 @@ Available workspaces:`);
|
|
|
103432
103438
|
}
|
|
103433
103439
|
return;
|
|
103434
103440
|
}
|
|
103441
|
+
if (subcommand === "rename") {
|
|
103442
|
+
const name2 = toolArgs;
|
|
103443
|
+
if (!name2) {
|
|
103444
|
+
console.error("Usage: lotics workspace rename <new name>");
|
|
103445
|
+
console.error('Renames the CURRENT workspace. Switch first with "lotics workspace select <id>".');
|
|
103446
|
+
process.exit(1);
|
|
103447
|
+
}
|
|
103448
|
+
const current = workspaces.find((ws) => ws.id === currentWorkspaceId);
|
|
103449
|
+
if (!current) {
|
|
103450
|
+
console.error('No workspace selected. Choose one with "lotics workspace select <id>".');
|
|
103451
|
+
process.exit(1);
|
|
103452
|
+
}
|
|
103453
|
+
const renamed = await client.updateWorkspace({
|
|
103454
|
+
name: name2,
|
|
103455
|
+
default_currency: current.default_currency,
|
|
103456
|
+
timezone: current.timezone
|
|
103457
|
+
});
|
|
103458
|
+
if (flags.json) {
|
|
103459
|
+
console.log(JSON.stringify(renamed, null, 2));
|
|
103460
|
+
} else {
|
|
103461
|
+
console.error(`Renamed "${current.name}" to "${renamed.name}" (${renamed.id})`);
|
|
103462
|
+
}
|
|
103463
|
+
return;
|
|
103464
|
+
}
|
|
103435
103465
|
if (subcommand === "delete") {
|
|
103436
103466
|
const targetId = toolArgs;
|
|
103437
103467
|
if (!targetId) {
|
package/dist/src/client.d.ts
CHANGED
|
@@ -195,6 +195,13 @@ export declare class LoticsClient {
|
|
|
195
195
|
name: string;
|
|
196
196
|
timezone?: string;
|
|
197
197
|
}): Promise<WorkspaceInfo>;
|
|
198
|
+
/** Renames (and re-settings) the CURRENT workspace — the endpoint reads the
|
|
199
|
+
* target from the request's workspace, never a path id. */
|
|
200
|
+
updateWorkspace(body: {
|
|
201
|
+
name: string;
|
|
202
|
+
default_currency: string;
|
|
203
|
+
timezone: string;
|
|
204
|
+
}): Promise<WorkspaceInfo>;
|
|
198
205
|
deleteWorkspace(id: string): Promise<{
|
|
199
206
|
id: string;
|
|
200
207
|
deleted: boolean;
|
package/dist/src/client.js
CHANGED
|
@@ -143,6 +143,11 @@ export class LoticsClient {
|
|
|
143
143
|
async createWorkspace(body) {
|
|
144
144
|
return this.request("POST", "/v1/workspaces", body);
|
|
145
145
|
}
|
|
146
|
+
/** Renames (and re-settings) the CURRENT workspace — the endpoint reads the
|
|
147
|
+
* target from the request's workspace, never a path id. */
|
|
148
|
+
async updateWorkspace(body) {
|
|
149
|
+
return this.request("PATCH", "/v1/workspace", body);
|
|
150
|
+
}
|
|
146
151
|
async deleteWorkspace(id) {
|
|
147
152
|
return this.request("DELETE", `/v1/workspaces/${encodeURIComponent(id)}`);
|
|
148
153
|
}
|
package/docs/cli_reference.md
CHANGED
|
@@ -15,6 +15,7 @@ Per-command syntax, flags, contracts, and gotchas for the public `lotics` CLI. S
|
|
|
15
15
|
| `lotics workspace` | List workspaces in the active org, marks current with `(current)` |
|
|
16
16
|
| `lotics workspace select <id>` | Set the workspace in the **active scope** — a local pin if the dir has one, else the active org's global profile |
|
|
17
17
|
| `lotics workspace create <name>` | Create a new workspace (admin only), auto-switches to it. |
|
|
18
|
+
| `lotics workspace rename <name>` | Rename the **current** workspace (admin only) — the endpoint takes its target from the request's workspace, never a path id, so switch with `workspace select <id>` first and read the `lotics → <org> / <workspace>` echo before trusting it. Carries the workspace's existing `default_currency` and `timezone` through unchanged: the endpoint takes the whole settings triple, so sending only a name would blank the other two. |
|
|
18
19
|
| `lotics workspace delete <id> --yes` | Delete a workspace by id (admin only). **Soft delete** — `archived_at` is set, so it drops out of listings, can no longer be selected, and its tables/records go dark, while the data is retained and recoverable. Its **apps are cascade-archived** too — every app entry point (embedded, public link, standalone subdomain, incl. anonymous public links) stops serving. Refuses the org's **only** active workspace (400) and any workspace outside the caller's org (404). Requires `--yes` to confirm (destructive; the CLI is used non-interactively). |
|
|
19
20
|
| `lotics workspace doctor` | Report workspace-wide dangling schema references via `GET /v1/workspaces/dangling-references` — every active app/workflow artifact whose prefixed schema id no longer resolves, printed as `<referent.kind> "<name>" (<id>) → <namespace> <id> (missing)`; healthy prints a one-line all-clear. **Exits non-zero (exit 1) on findings** so scripts can gate on it. Resolves the first workspace like every data command (runs before the global workspace resolution). Admin-only. |
|
|
20
21
|
| `lotics tools` | List tools by category with descriptions |
|