@lotics/cli 0.149.0 → 0.150.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/dist/src/cli.js +30 -0
- package/dist/src/client.d.ts +7 -0
- package/dist/src/client.js +5 -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
|
}
|