@lotics/cli 0.36.1 → 0.37.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/client.d.ts +9 -0
- package/dist/client.js +3 -0
- package/dist/dev/rpc_handler.d.ts +1 -1
- package/dist/dev/rpc_handler.js +10 -1
- package/dist/src/cli.js +26 -3
- package/dist/starter_template.js +13 -2
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -130,9 +130,18 @@ export declare class LoticsClient {
|
|
|
130
130
|
appQuery(app_id: string, body: {
|
|
131
131
|
alias: string;
|
|
132
132
|
params?: Record<string, unknown>;
|
|
133
|
+
limit?: number;
|
|
134
|
+
offset?: number;
|
|
133
135
|
}): Promise<{
|
|
134
136
|
rows: unknown[];
|
|
135
137
|
}>;
|
|
138
|
+
appMembers(app_id: string): Promise<{
|
|
139
|
+
members: Array<{
|
|
140
|
+
id: string;
|
|
141
|
+
name: string | null;
|
|
142
|
+
email: string | null;
|
|
143
|
+
}>;
|
|
144
|
+
}>;
|
|
136
145
|
/**
|
|
137
146
|
* Execute a workflow by alias declared in package.json#lotics.workflows.
|
|
138
147
|
* Mirrors POST /v1/apps/{app_id}/workflows/{alias}/execute.
|
package/dist/client.js
CHANGED
|
@@ -176,6 +176,9 @@ export class LoticsClient {
|
|
|
176
176
|
async appQuery(app_id, body) {
|
|
177
177
|
return this.request("POST", `/v1/apps/${encodeURIComponent(app_id)}/query`, body);
|
|
178
178
|
}
|
|
179
|
+
async appMembers(app_id) {
|
|
180
|
+
return this.request("GET", `/v1/apps/${encodeURIComponent(app_id)}/members`);
|
|
181
|
+
}
|
|
179
182
|
/**
|
|
180
183
|
* Execute a workflow by alias declared in package.json#lotics.workflows.
|
|
181
184
|
* Mirrors POST /v1/apps/{app_id}/workflows/{alias}/execute.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* { message }. Same shape as the production iframe-host's error path.
|
|
7
7
|
*/
|
|
8
8
|
import { LoticsClient } from "../client.js";
|
|
9
|
-
export type RpcOp = "query" | "workflow" | "upload_url" | "upload_complete";
|
|
9
|
+
export type RpcOp = "query" | "workflow" | "members" | "upload_url" | "upload_complete";
|
|
10
10
|
export interface RpcRequest {
|
|
11
11
|
app_id: string;
|
|
12
12
|
op: RpcOp;
|
package/dist/dev/rpc_handler.js
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
const SUPPORTED_OPS = new Set([
|
|
9
9
|
"query",
|
|
10
10
|
"workflow",
|
|
11
|
+
"members",
|
|
11
12
|
"upload_url",
|
|
12
13
|
"upload_complete",
|
|
13
14
|
]);
|
|
@@ -24,7 +25,12 @@ export async function dispatchRpc(client, body) {
|
|
|
24
25
|
if (!p || typeof p.alias !== "string") {
|
|
25
26
|
throw new Error("query payload must include `alias`");
|
|
26
27
|
}
|
|
27
|
-
return client.appQuery(body.app_id, {
|
|
28
|
+
return client.appQuery(body.app_id, {
|
|
29
|
+
alias: p.alias,
|
|
30
|
+
params: p.params,
|
|
31
|
+
limit: p.limit,
|
|
32
|
+
offset: p.offset,
|
|
33
|
+
});
|
|
28
34
|
}
|
|
29
35
|
case "workflow": {
|
|
30
36
|
const p = body.payload;
|
|
@@ -33,6 +39,9 @@ export async function dispatchRpc(client, body) {
|
|
|
33
39
|
}
|
|
34
40
|
return client.appWorkflow(body.app_id, p.alias, p.inputs);
|
|
35
41
|
}
|
|
42
|
+
case "members": {
|
|
43
|
+
return client.appMembers(body.app_id);
|
|
44
|
+
}
|
|
36
45
|
case "upload_url": {
|
|
37
46
|
const p = body.payload;
|
|
38
47
|
if (!p ||
|
package/dist/src/cli.js
CHANGED
|
@@ -31841,6 +31841,9 @@ var LoticsClient = class {
|
|
|
31841
31841
|
async appQuery(app_id, body) {
|
|
31842
31842
|
return this.request("POST", `/v1/apps/${encodeURIComponent(app_id)}/query`, body);
|
|
31843
31843
|
}
|
|
31844
|
+
async appMembers(app_id) {
|
|
31845
|
+
return this.request("GET", `/v1/apps/${encodeURIComponent(app_id)}/members`);
|
|
31846
|
+
}
|
|
31844
31847
|
/**
|
|
31845
31848
|
* Execute a workflow by alias declared in package.json#lotics.workflows.
|
|
31846
31849
|
* Mirrors POST /v1/apps/{app_id}/workflows/{alias}/execute.
|
|
@@ -32380,7 +32383,12 @@ export default defineConfig({
|
|
|
32380
32383
|
},
|
|
32381
32384
|
{ find: "react-native", replacement: "react-native-web" },
|
|
32382
32385
|
],
|
|
32383
|
-
|
|
32386
|
+
// \`.web.js\` resolves the web build of RN packages that ship \`X.js\` (native)
|
|
32387
|
+
// beside \`X.web.js\` (web) \u2014 e.g. @react-native-picker/picker, whose compiled
|
|
32388
|
+
// \`Picker.web.js\` renders a real <select>. Without it the extensionless
|
|
32389
|
+
// \`require("./Picker")\` picks native \`Picker.js\` and the standard Picker
|
|
32390
|
+
// renders nothing on web.
|
|
32391
|
+
extensions: [".web.tsx", ".web.ts", ".web.js", ".tsx", ".ts", ".jsx", ".js"],
|
|
32384
32392
|
// @lotics/ui ships source and is consumed across many subpath entries
|
|
32385
32393
|
// (./card, ./metric, ./use_screen_size, \u2026). Without dedupe, Vite can
|
|
32386
32394
|
// pre-bundle a subpath into its own chunk with a second React copy \u2014 a
|
|
@@ -32400,7 +32408,13 @@ export default defineConfig({
|
|
|
32400
32408
|
// top-level \`define\` doesn't always reach, so a pre-bundled RN dep can
|
|
32401
32409
|
// still hit \`__DEV__ is not defined\` under \`lotics app dev\`. Define it
|
|
32402
32410
|
// here too \u2014 belt-and-suspenders with the top-level \`define\` above.
|
|
32403
|
-
|
|
32411
|
+
// The optimizer pre-bundles with a SEPARATE esbuild resolver that ignores
|
|
32412
|
+
// \`resolve.extensions\`, so \`.web.js\` must be repeated here or a pre-bundled
|
|
32413
|
+
// RN dep still resolves \`./Picker\` to the native build.
|
|
32414
|
+
esbuildOptions: {
|
|
32415
|
+
define: { __DEV__: "false" },
|
|
32416
|
+
resolveExtensions: [".web.tsx", ".web.ts", ".web.js", ".tsx", ".ts", ".jsx", ".js", ".json"],
|
|
32417
|
+
},
|
|
32404
32418
|
},
|
|
32405
32419
|
build: {
|
|
32406
32420
|
outDir: "dist",
|
|
@@ -32709,6 +32723,7 @@ import { spawn } from "node:child_process";
|
|
|
32709
32723
|
var SUPPORTED_OPS = /* @__PURE__ */ new Set([
|
|
32710
32724
|
"query",
|
|
32711
32725
|
"workflow",
|
|
32726
|
+
"members",
|
|
32712
32727
|
"upload_url",
|
|
32713
32728
|
"upload_complete"
|
|
32714
32729
|
]);
|
|
@@ -32725,7 +32740,12 @@ async function dispatchRpc(client, body) {
|
|
|
32725
32740
|
if (!p || typeof p.alias !== "string") {
|
|
32726
32741
|
throw new Error("query payload must include `alias`");
|
|
32727
32742
|
}
|
|
32728
|
-
return client.appQuery(body.app_id, {
|
|
32743
|
+
return client.appQuery(body.app_id, {
|
|
32744
|
+
alias: p.alias,
|
|
32745
|
+
params: p.params,
|
|
32746
|
+
limit: p.limit,
|
|
32747
|
+
offset: p.offset
|
|
32748
|
+
});
|
|
32729
32749
|
}
|
|
32730
32750
|
case "workflow": {
|
|
32731
32751
|
const p = body.payload;
|
|
@@ -32734,6 +32754,9 @@ async function dispatchRpc(client, body) {
|
|
|
32734
32754
|
}
|
|
32735
32755
|
return client.appWorkflow(body.app_id, p.alias, p.inputs);
|
|
32736
32756
|
}
|
|
32757
|
+
case "members": {
|
|
32758
|
+
return client.appMembers(body.app_id);
|
|
32759
|
+
}
|
|
32737
32760
|
case "upload_url": {
|
|
32738
32761
|
const p = body.payload;
|
|
32739
32762
|
if (!p || typeof p.filename !== "string" || typeof p.mime_type !== "string" || typeof p.file_size !== "number") {
|
package/dist/starter_template.js
CHANGED
|
@@ -166,7 +166,12 @@ export default defineConfig({
|
|
|
166
166
|
},
|
|
167
167
|
{ find: "react-native", replacement: "react-native-web" },
|
|
168
168
|
],
|
|
169
|
-
|
|
169
|
+
// \`.web.js\` resolves the web build of RN packages that ship \`X.js\` (native)
|
|
170
|
+
// beside \`X.web.js\` (web) — e.g. @react-native-picker/picker, whose compiled
|
|
171
|
+
// \`Picker.web.js\` renders a real <select>. Without it the extensionless
|
|
172
|
+
// \`require("./Picker")\` picks native \`Picker.js\` and the standard Picker
|
|
173
|
+
// renders nothing on web.
|
|
174
|
+
extensions: [".web.tsx", ".web.ts", ".web.js", ".tsx", ".ts", ".jsx", ".js"],
|
|
170
175
|
// @lotics/ui ships source and is consumed across many subpath entries
|
|
171
176
|
// (./card, ./metric, ./use_screen_size, …). Without dedupe, Vite can
|
|
172
177
|
// pre-bundle a subpath into its own chunk with a second React copy — a
|
|
@@ -186,7 +191,13 @@ export default defineConfig({
|
|
|
186
191
|
// top-level \`define\` doesn't always reach, so a pre-bundled RN dep can
|
|
187
192
|
// still hit \`__DEV__ is not defined\` under \`lotics app dev\`. Define it
|
|
188
193
|
// here too — belt-and-suspenders with the top-level \`define\` above.
|
|
189
|
-
|
|
194
|
+
// The optimizer pre-bundles with a SEPARATE esbuild resolver that ignores
|
|
195
|
+
// \`resolve.extensions\`, so \`.web.js\` must be repeated here or a pre-bundled
|
|
196
|
+
// RN dep still resolves \`./Picker\` to the native build.
|
|
197
|
+
esbuildOptions: {
|
|
198
|
+
define: { __DEV__: "false" },
|
|
199
|
+
resolveExtensions: [".web.tsx", ".web.ts", ".web.js", ".tsx", ".ts", ".jsx", ".js", ".json"],
|
|
200
|
+
},
|
|
190
201
|
},
|
|
191
202
|
build: {
|
|
192
203
|
outDir: "dist",
|