@lotics/cli 0.64.0 → 0.66.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.js CHANGED
@@ -333,6 +333,17 @@ export class LoticsClient {
333
333
  ...(body.description ? { description: body.description } : {}),
334
334
  });
335
335
  }
336
+ /**
337
+ * Bind (create or replace) an app query by alias via the `set_app_query` tool
338
+ * — the deploy-free authoring path for `apps.queries`, parallel to
339
+ * `setAppWorkflow`. `declaration` is the `{ ast, params? }` from
340
+ * `package.json#lotics.queries.<alias>`. The server validates it exactly as a
341
+ * deploy validates the manifest. Note: `apps.queries` is manifest-authoritative,
342
+ * so the next `lotics app deploy` overwrites this from the manifest.
343
+ */
344
+ async setAppQuery(app_id, alias, declaration) {
345
+ return this.execute("set_app_query", { app_id, alias, declaration });
346
+ }
336
347
  /**
337
348
  * Fetch one app workflow's faithful source + bound input/output schemas via
338
349
  * `get_app_workflow`. `source` is the JS-subset body re-rendered from the
@@ -427,6 +438,10 @@ export class LoticsClient {
427
438
  if (args.capabilities !== undefined) {
428
439
  formData.append("capabilities", JSON.stringify(args.capabilities));
429
440
  }
441
+ // Always send the declared workflow aliases (empty array when none) so the
442
+ // server records what the served version calls — the remove_app_workflow
443
+ // guard reads this back. These are the manifest KEYS only, never bindings.
444
+ formData.append("workflow_aliases", JSON.stringify(args.workflow_aliases ?? []));
430
445
  const url = `${this.baseUrl}/v1/apps/${encodeURIComponent(args.app_id)}/versions`;
431
446
  const response = await fetch(url, {
432
447
  method: "POST",
@@ -122,7 +122,7 @@ function inputDeclToTsType(decl) {
122
122
  case "date_range":
123
123
  return "{ start: string; end: string }";
124
124
  case "file":
125
- return "string";
125
+ return decl.multi === true ? "ReadonlyArray<string>" : "string";
126
126
  case "object": {
127
127
  const fields = decl.fields !== null && typeof decl.fields === "object"
128
128
  ? decl.fields
@@ -70,4 +70,14 @@ describe("generateAppWorkflowsDts", () => {
70
70
  });
71
71
  expect(dts).toContain('owner: string; tags: ReadonlyArray<"a" | "b">');
72
72
  });
73
+ it("types a multi file input as ReadonlyArray<string>, single file as string", () => {
74
+ const dts = generateAppWorkflowsDts({
75
+ attach: {
76
+ workflow_id: "wfl_f",
77
+ inputs: { one: { type: "file" }, many: { type: "file", multi: true } },
78
+ },
79
+ });
80
+ expect(dts).toContain("one: string");
81
+ expect(dts).toContain("many: ReadonlyArray<string>");
82
+ });
73
83
  });