@lotics/cli 0.46.0 → 0.47.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/app_commands.d.ts +0 -1
- package/dist/app_commands.js +7 -10
- package/dist/args.d.ts +2 -3
- package/dist/args.js +2 -6
- package/dist/args.test.js +3 -14
- package/dist/cli.js +6 -10
- package/dist/client.d.ts +0 -21
- package/dist/client.js +2 -10
- package/dist/src/cli.js +13 -26
- package/package.json +1 -1
package/dist/app_commands.d.ts
CHANGED
|
@@ -119,7 +119,6 @@ export declare function undeclaredCapabilities(sourceText: string, declared: Rec
|
|
|
119
119
|
export declare function appDeploy(client: LoticsClient, args: {
|
|
120
120
|
projectDir?: string;
|
|
121
121
|
message?: string;
|
|
122
|
-
forceWorkflowSync?: boolean;
|
|
123
122
|
}): Promise<void>;
|
|
124
123
|
/**
|
|
125
124
|
* `lotics app dev [path] [--port=5174] [--vite-port=5173]`
|
package/dist/app_commands.js
CHANGED
|
@@ -388,20 +388,17 @@ export async function appDeploy(client, args) {
|
|
|
388
388
|
dist_archive: fs.readFileSync(tmpDist),
|
|
389
389
|
prev_version_id: meta.current_version_id,
|
|
390
390
|
message: args.message,
|
|
391
|
-
// Sync apps.workflows from the manifest. Server validates each
|
|
392
|
-
// workflow_id exists in the workspace before committing.
|
|
393
|
-
workflows: meta.workflows ?? {},
|
|
394
391
|
// Sync apps.queries from the manifest. Server validates each query
|
|
395
392
|
// template (parseQueryNode, table access, param coverage).
|
|
396
393
|
queries: meta.queries ?? {},
|
|
397
|
-
// Capabilities are manifest-authoritative (like
|
|
398
|
-
//
|
|
399
|
-
//
|
|
400
|
-
//
|
|
394
|
+
// Capabilities are manifest-authoritative (like queries): always send,
|
|
395
|
+
// defaulting to `{}` when the manifest declares none — so deleting the
|
|
396
|
+
// `capabilities` block turns every capability OFF on the next deploy
|
|
397
|
+
// (fail-safe; the declaration is the grant).
|
|
401
398
|
capabilities: meta.capabilities ?? {},
|
|
402
|
-
//
|
|
403
|
-
//
|
|
404
|
-
|
|
399
|
+
// Workflow bindings are NOT a deploy concern — set_app_workflow /
|
|
400
|
+
// remove_app_workflow own apps.workflows. The manifest's `workflows`
|
|
401
|
+
// map is a pulled reflection used only for the .d.ts codegen above.
|
|
405
402
|
});
|
|
406
403
|
writeAppMeta(projectDir, {
|
|
407
404
|
...meta,
|
package/dist/args.d.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Splits `process.argv.slice(2)` into a command / subcommand / positional
|
|
5
5
|
* (`toolArgs`) / remaining-positionals (`restArgs`) shape plus typed `flags`.
|
|
6
6
|
* Value-taking flags (`-m`, `--api-key`, …) consume the next token; boolean
|
|
7
|
-
* flags (`--
|
|
8
|
-
*
|
|
7
|
+
* flags (`--json`, `--local`, …) toggle. Anything not matching a known flag is
|
|
8
|
+
* positional.
|
|
9
9
|
*
|
|
10
10
|
* Lives apart from `cli.ts` so it can be unit-tested — `cli.ts` runs `main()`
|
|
11
11
|
* on import, so importing the parser from there would execute the CLI.
|
|
@@ -26,7 +26,6 @@ export declare function parseArgs(argv: string[]): {
|
|
|
26
26
|
name?: string;
|
|
27
27
|
timezone?: string;
|
|
28
28
|
message?: string;
|
|
29
|
-
forceWorkflowSync: boolean;
|
|
30
29
|
local: boolean;
|
|
31
30
|
all: boolean;
|
|
32
31
|
version: boolean;
|
package/dist/args.js
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Splits `process.argv.slice(2)` into a command / subcommand / positional
|
|
5
5
|
* (`toolArgs`) / remaining-positionals (`restArgs`) shape plus typed `flags`.
|
|
6
6
|
* Value-taking flags (`-m`, `--api-key`, …) consume the next token; boolean
|
|
7
|
-
* flags (`--
|
|
8
|
-
*
|
|
7
|
+
* flags (`--json`, `--local`, …) toggle. Anything not matching a known flag is
|
|
8
|
+
* positional.
|
|
9
9
|
*
|
|
10
10
|
* Lives apart from `cli.ts` so it can be unit-tested — `cli.ts` runs `main()`
|
|
11
11
|
* on import, so importing the parser from there would execute the CLI.
|
|
@@ -22,7 +22,6 @@ export function parseArgs(argv) {
|
|
|
22
22
|
name: undefined,
|
|
23
23
|
timezone: undefined,
|
|
24
24
|
message: undefined,
|
|
25
|
-
forceWorkflowSync: false,
|
|
26
25
|
local: false,
|
|
27
26
|
all: false,
|
|
28
27
|
version: false,
|
|
@@ -69,9 +68,6 @@ export function parseArgs(argv) {
|
|
|
69
68
|
case "--message":
|
|
70
69
|
flags.message = argv[++i];
|
|
71
70
|
break;
|
|
72
|
-
case "--force-workflow-sync":
|
|
73
|
-
flags.forceWorkflowSync = true;
|
|
74
|
-
break;
|
|
75
71
|
case "--local":
|
|
76
72
|
flags.local = true;
|
|
77
73
|
break;
|
package/dist/args.test.js
CHANGED
|
@@ -8,8 +8,8 @@ describe("parseArgs", () => {
|
|
|
8
8
|
expect(r.toolArgs).toBe("my message");
|
|
9
9
|
expect(r.restArgs).toEqual([]);
|
|
10
10
|
});
|
|
11
|
-
// `app deploy` regression: `-m`
|
|
12
|
-
//
|
|
11
|
+
// `app deploy` regression: `-m` must be parsed as a flag, not silently
|
|
12
|
+
// consumed as the positional message.
|
|
13
13
|
it("parses -m as the message flag", () => {
|
|
14
14
|
const r = parseArgs(["app", "deploy", "-m", "a message"]);
|
|
15
15
|
expect(r.flags.message).toBe("a message");
|
|
@@ -19,19 +19,8 @@ describe("parseArgs", () => {
|
|
|
19
19
|
const r = parseArgs(["app", "deploy", "--message", "a message"]);
|
|
20
20
|
expect(r.flags.message).toBe("a message");
|
|
21
21
|
});
|
|
22
|
-
it("
|
|
23
|
-
const r = parseArgs(["app", "deploy", "msg", "--force-workflow-sync"]);
|
|
24
|
-
expect(r.flags.forceWorkflowSync).toBe(true);
|
|
25
|
-
expect(r.toolArgs).toBe("msg");
|
|
26
|
-
});
|
|
27
|
-
it("parses --force-workflow-sync before -m without eating the message", () => {
|
|
28
|
-
const r = parseArgs(["app", "deploy", "--force-workflow-sync", "-m", "msg"]);
|
|
29
|
-
expect(r.flags.forceWorkflowSync).toBe(true);
|
|
30
|
-
expect(r.flags.message).toBe("msg");
|
|
31
|
-
});
|
|
32
|
-
it("defaults forceWorkflowSync to false and message to undefined", () => {
|
|
22
|
+
it("defaults message to undefined for a bare deploy", () => {
|
|
33
23
|
const r = parseArgs(["app", "deploy"]);
|
|
34
|
-
expect(r.flags.forceWorkflowSync).toBe(false);
|
|
35
24
|
expect(r.flags.message).toBeUndefined();
|
|
36
25
|
});
|
|
37
26
|
it("parses --workspace as a value flag", () => {
|
package/dist/cli.js
CHANGED
|
@@ -60,10 +60,9 @@ COMMANDS
|
|
|
60
60
|
Download all files on a record file field
|
|
61
61
|
lotics app create <name> [path] Create a new custom-code app + scaffold locally
|
|
62
62
|
lotics app pull <app_id> [path] Bootstrap full local env (source + npm install + types)
|
|
63
|
-
lotics app deploy [-m <message>]
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
workflow aliases; default refuses)
|
|
63
|
+
lotics app deploy [-m <message>] Build + upload current dir as a new version
|
|
64
|
+
(code + queries only — workflow bindings are
|
|
65
|
+
managed by set_app_workflow / remove_app_workflow)
|
|
67
66
|
lotics app subdomain <new-subdomain> Rename the app's public <slug>.lotics.app address
|
|
68
67
|
lotics app rename "<new name>" Rename the app's display name (launcher title)
|
|
69
68
|
lotics app dev [path] Run the app locally with HMR (RPC forwarded to prod)
|
|
@@ -527,8 +526,7 @@ async function main() {
|
|
|
527
526
|
console.error("Usage:");
|
|
528
527
|
console.error(" lotics app create <name> [path] Scaffold a new app locally");
|
|
529
528
|
console.error(" lotics app pull <app_id> [path] Pull an existing app for local editing");
|
|
530
|
-
console.error(" lotics app deploy [-m <message>]
|
|
531
|
-
console.error(" Build + upload the current directory");
|
|
529
|
+
console.error(" lotics app deploy [-m <message>] Build + upload the current directory");
|
|
532
530
|
console.error(" lotics app subdomain <new-subdomain> Rename the app's public <slug>.lotics.app address");
|
|
533
531
|
console.error(" lotics app rename \"<new name>\" Rename the app's display name (launcher title)");
|
|
534
532
|
console.error(" lotics app dev [path] Run the app locally with HMR + RPC forwarding");
|
|
@@ -650,11 +648,9 @@ async function main() {
|
|
|
650
648
|
return;
|
|
651
649
|
}
|
|
652
650
|
if (subcommand === "deploy") {
|
|
653
|
-
// The message is either `-m <message>` or a bare positional arg after
|
|
654
|
-
// `deploy`. `--force-workflow-sync` is a parsed boolean flag, valid in
|
|
655
|
-
// any position.
|
|
651
|
+
// The message is either `-m <message>` or a bare positional arg after `deploy`.
|
|
656
652
|
const message = flags.message ?? toolArgs;
|
|
657
|
-
await appDeploy(client, { message
|
|
653
|
+
await appDeploy(client, { message });
|
|
658
654
|
return;
|
|
659
655
|
}
|
|
660
656
|
if (subcommand === "subdomain") {
|
package/dist/client.d.ts
CHANGED
|
@@ -235,19 +235,6 @@ export declare class LoticsClient {
|
|
|
235
235
|
dist_archive: Buffer;
|
|
236
236
|
prev_version_id?: string | null;
|
|
237
237
|
message?: string | null;
|
|
238
|
-
/**
|
|
239
|
-
* Alias → workflow declaration map from the app's `package.json#lotics.workflows`.
|
|
240
|
-
* Each value is a `{ workflow_id, inputs? }` object — inputs declares a typed
|
|
241
|
-
* schema or is omitted when the workflow accepts no typed inputs. Always sent
|
|
242
|
-
* (empty object when none declared) so the server can overwrite apps.workflows
|
|
243
|
-
* authoritatively. Deleting an alias from the manifest removes it from the DB
|
|
244
|
-
* on next deploy — gated by the destructive-removal guard unless
|
|
245
|
-
* `force_workflow_sync` is true.
|
|
246
|
-
*/
|
|
247
|
-
workflows?: Record<string, {
|
|
248
|
-
workflow_id: string;
|
|
249
|
-
inputs?: Record<string, unknown>;
|
|
250
|
-
}>;
|
|
251
238
|
/**
|
|
252
239
|
* Alias → query declaration map from `package.json#lotics.queries`. Each
|
|
253
240
|
* value is `{ ast, params? }` — a fixed query AST template and an optional
|
|
@@ -267,14 +254,6 @@ export declare class LoticsClient {
|
|
|
267
254
|
capabilities?: {
|
|
268
255
|
comments?: boolean;
|
|
269
256
|
};
|
|
270
|
-
/**
|
|
271
|
-
* Opt into destructive workflow removal. When false/absent, the server
|
|
272
|
-
* rejects a deploy whose `workflows` map is missing aliases that exist
|
|
273
|
-
* on the App row. Set true to deploy anyway and wipe the missing aliases —
|
|
274
|
-
* the user is asserting they know what they're doing. Wired to CLI flag
|
|
275
|
-
* `--force-workflow-sync`.
|
|
276
|
-
*/
|
|
277
|
-
force_workflow_sync?: boolean;
|
|
278
257
|
}): Promise<{
|
|
279
258
|
version_id: string;
|
|
280
259
|
version_number: number;
|
package/dist/client.js
CHANGED
|
@@ -239,11 +239,9 @@ export class LoticsClient {
|
|
|
239
239
|
if (args.message) {
|
|
240
240
|
formData.append("message", args.message);
|
|
241
241
|
}
|
|
242
|
-
// Always send workflows — empty object is meaningful (clears any
|
|
243
|
-
// previously-declared aliases). Server validates each entry.
|
|
244
|
-
formData.append("workflows", JSON.stringify(args.workflows ?? {}));
|
|
245
242
|
// Always send queries — empty object clears any previously-declared
|
|
246
|
-
// named queries. Server validates each template.
|
|
243
|
+
// named queries. Server validates each template. (Workflow bindings are
|
|
244
|
+
// not sent: set_app_workflow / remove_app_workflow own apps.workflows.)
|
|
247
245
|
formData.append("queries", JSON.stringify(args.queries ?? {}));
|
|
248
246
|
// capabilities is manifest-authoritative — the caller always passes it
|
|
249
247
|
// (`{}` when none declared), so a deploy turns off any capability the
|
|
@@ -251,12 +249,6 @@ export class LoticsClient {
|
|
|
251
249
|
if (args.capabilities !== undefined) {
|
|
252
250
|
formData.append("capabilities", JSON.stringify(args.capabilities));
|
|
253
251
|
}
|
|
254
|
-
// Only post the override flag when the user explicitly opts in. The
|
|
255
|
-
// server defaults to "honor the guard" — opt-in is loud, opt-out
|
|
256
|
-
// requires intent.
|
|
257
|
-
if (args.force_workflow_sync) {
|
|
258
|
-
formData.append("force_workflow_sync", "true");
|
|
259
|
-
}
|
|
260
252
|
const url = `${this.baseUrl}/v1/apps/${encodeURIComponent(args.app_id)}/versions`;
|
|
261
253
|
const response = await fetch(url, {
|
|
262
254
|
method: "POST",
|
package/dist/src/cli.js
CHANGED
|
@@ -29858,14 +29858,10 @@ var LoticsClient = class {
|
|
|
29858
29858
|
if (args.message) {
|
|
29859
29859
|
formData.append("message", args.message);
|
|
29860
29860
|
}
|
|
29861
|
-
formData.append("workflows", JSON.stringify(args.workflows ?? {}));
|
|
29862
29861
|
formData.append("queries", JSON.stringify(args.queries ?? {}));
|
|
29863
29862
|
if (args.capabilities !== void 0) {
|
|
29864
29863
|
formData.append("capabilities", JSON.stringify(args.capabilities));
|
|
29865
29864
|
}
|
|
29866
|
-
if (args.force_workflow_sync) {
|
|
29867
|
-
formData.append("force_workflow_sync", "true");
|
|
29868
|
-
}
|
|
29869
29865
|
const url = `${this.baseUrl}/v1/apps/${encodeURIComponent(args.app_id)}/versions`;
|
|
29870
29866
|
const response = await fetch(url, {
|
|
29871
29867
|
method: "POST",
|
|
@@ -31643,20 +31639,17 @@ async function appDeploy(client, args) {
|
|
|
31643
31639
|
dist_archive: fs3.readFileSync(tmpDist),
|
|
31644
31640
|
prev_version_id: meta.current_version_id,
|
|
31645
31641
|
message: args.message,
|
|
31646
|
-
// Sync apps.workflows from the manifest. Server validates each
|
|
31647
|
-
// workflow_id exists in the workspace before committing.
|
|
31648
|
-
workflows: meta.workflows ?? {},
|
|
31649
31642
|
// Sync apps.queries from the manifest. Server validates each query
|
|
31650
31643
|
// template (parseQueryNode, table access, param coverage).
|
|
31651
31644
|
queries: meta.queries ?? {},
|
|
31652
|
-
// Capabilities are manifest-authoritative (like
|
|
31653
|
-
//
|
|
31654
|
-
//
|
|
31655
|
-
//
|
|
31656
|
-
capabilities: meta.capabilities ?? {}
|
|
31657
|
-
//
|
|
31658
|
-
//
|
|
31659
|
-
|
|
31645
|
+
// Capabilities are manifest-authoritative (like queries): always send,
|
|
31646
|
+
// defaulting to `{}` when the manifest declares none — so deleting the
|
|
31647
|
+
// `capabilities` block turns every capability OFF on the next deploy
|
|
31648
|
+
// (fail-safe; the declaration is the grant).
|
|
31649
|
+
capabilities: meta.capabilities ?? {}
|
|
31650
|
+
// Workflow bindings are NOT a deploy concern — set_app_workflow /
|
|
31651
|
+
// remove_app_workflow own apps.workflows. The manifest's `workflows`
|
|
31652
|
+
// map is a pulled reflection used only for the .d.ts codegen above.
|
|
31660
31653
|
});
|
|
31661
31654
|
writeAppMeta(projectDir, {
|
|
31662
31655
|
...meta,
|
|
@@ -31756,7 +31749,6 @@ function parseArgs(argv) {
|
|
|
31756
31749
|
name: void 0,
|
|
31757
31750
|
timezone: void 0,
|
|
31758
31751
|
message: void 0,
|
|
31759
|
-
forceWorkflowSync: false,
|
|
31760
31752
|
local: false,
|
|
31761
31753
|
all: false,
|
|
31762
31754
|
version: false,
|
|
@@ -31803,9 +31795,6 @@ function parseArgs(argv) {
|
|
|
31803
31795
|
case "--message":
|
|
31804
31796
|
flags.message = argv[++i2];
|
|
31805
31797
|
break;
|
|
31806
|
-
case "--force-workflow-sync":
|
|
31807
|
-
flags.forceWorkflowSync = true;
|
|
31808
|
-
break;
|
|
31809
31798
|
case "--local":
|
|
31810
31799
|
flags.local = true;
|
|
31811
31800
|
break;
|
|
@@ -47595,10 +47584,9 @@ COMMANDS
|
|
|
47595
47584
|
Download all files on a record file field
|
|
47596
47585
|
lotics app create <name> [path] Create a new custom-code app + scaffold locally
|
|
47597
47586
|
lotics app pull <app_id> [path] Bootstrap full local env (source + npm install + types)
|
|
47598
|
-
lotics app deploy [-m <message>]
|
|
47599
|
-
|
|
47600
|
-
|
|
47601
|
-
workflow aliases; default refuses)
|
|
47587
|
+
lotics app deploy [-m <message>] Build + upload current dir as a new version
|
|
47588
|
+
(code + queries only \u2014 workflow bindings are
|
|
47589
|
+
managed by set_app_workflow / remove_app_workflow)
|
|
47602
47590
|
lotics app subdomain <new-subdomain> Rename the app's public <slug>.lotics.app address
|
|
47603
47591
|
lotics app rename "<new name>" Rename the app's display name (launcher title)
|
|
47604
47592
|
lotics app dev [path] Run the app locally with HMR (RPC forwarded to prod)
|
|
@@ -48027,8 +48015,7 @@ async function main() {
|
|
|
48027
48015
|
console.error("Usage:");
|
|
48028
48016
|
console.error(" lotics app create <name> [path] Scaffold a new app locally");
|
|
48029
48017
|
console.error(" lotics app pull <app_id> [path] Pull an existing app for local editing");
|
|
48030
|
-
console.error(" lotics app deploy [-m <message>]
|
|
48031
|
-
console.error(" Build + upload the current directory");
|
|
48018
|
+
console.error(" lotics app deploy [-m <message>] Build + upload the current directory");
|
|
48032
48019
|
console.error(" lotics app subdomain <new-subdomain> Rename the app's public <slug>.lotics.app address");
|
|
48033
48020
|
console.error(` lotics app rename "<new name>" Rename the app's display name (launcher title)`);
|
|
48034
48021
|
console.error(" lotics app dev [path] Run the app locally with HMR + RPC forwarding");
|
|
@@ -48145,7 +48132,7 @@ Available workspaces:`);
|
|
|
48145
48132
|
}
|
|
48146
48133
|
if (subcommand === "deploy") {
|
|
48147
48134
|
const message = flags.message ?? toolArgs;
|
|
48148
|
-
await appDeploy(client, { message
|
|
48135
|
+
await appDeploy(client, { message });
|
|
48149
48136
|
return;
|
|
48150
48137
|
}
|
|
48151
48138
|
if (subcommand === "subdomain") {
|