@lotics/cli 0.36.2 → 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 +13 -1
- 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.
|
|
@@ -32720,6 +32723,7 @@ import { spawn } from "node:child_process";
|
|
|
32720
32723
|
var SUPPORTED_OPS = /* @__PURE__ */ new Set([
|
|
32721
32724
|
"query",
|
|
32722
32725
|
"workflow",
|
|
32726
|
+
"members",
|
|
32723
32727
|
"upload_url",
|
|
32724
32728
|
"upload_complete"
|
|
32725
32729
|
]);
|
|
@@ -32736,7 +32740,12 @@ async function dispatchRpc(client, body) {
|
|
|
32736
32740
|
if (!p || typeof p.alias !== "string") {
|
|
32737
32741
|
throw new Error("query payload must include `alias`");
|
|
32738
32742
|
}
|
|
32739
|
-
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
|
+
});
|
|
32740
32749
|
}
|
|
32741
32750
|
case "workflow": {
|
|
32742
32751
|
const p = body.payload;
|
|
@@ -32745,6 +32754,9 @@ async function dispatchRpc(client, body) {
|
|
|
32745
32754
|
}
|
|
32746
32755
|
return client.appWorkflow(body.app_id, p.alias, p.inputs);
|
|
32747
32756
|
}
|
|
32757
|
+
case "members": {
|
|
32758
|
+
return client.appMembers(body.app_id);
|
|
32759
|
+
}
|
|
32748
32760
|
case "upload_url": {
|
|
32749
32761
|
const p = body.payload;
|
|
32750
32762
|
if (!p || typeof p.filename !== "string" || typeof p.mime_type !== "string" || typeof p.file_size !== "number") {
|