busa-cli 0.90.2 → 0.95.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/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { i as checkForUpdate, n as pkgVersion, r as runCli } from "./run-CLlUJcaW.js";
2
+ import { i as checkForUpdate, n as pkgVersion, r as runCli } from "./run-fBARIIox.js";
3
3
  //#region src/flush-stdio.ts
4
4
  /**
5
5
  * Wait for stdout/stderr to reach the other side before the process is torn down.
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { a as render, i as checkForUpdate, n as pkgVersion, r as runCli, t as HELP } from "./run-CLlUJcaW.js";
1
+ import { a as render, i as checkForUpdate, n as pkgVersion, r as runCli, t as HELP } from "./run-fBARIIox.js";
2
2
  import { DEFAULT_BASE_URL, createBusabaseClient, normalizeBaseUrl } from "busabase-sdk";
3
3
  export { DEFAULT_BASE_URL, HELP, checkForUpdate, createBusabaseClient, normalizeBaseUrl, pkgVersion, render, runCli };
@@ -6463,6 +6463,10 @@ const fieldOptionsSchema = z.object({
6463
6463
  name: z.string()
6464
6464
  })).optional(),
6465
6465
  code: z.object({ language: z.string().optional() }).optional(),
6466
+ date: z.object({
6467
+ includeTime: z.boolean().optional(),
6468
+ timezone: z.string().optional().describe("IANA time zone, e.g. \"Asia/Shanghai\". Omit to show each reader their own local time.")
6469
+ }).optional(),
6466
6470
  embed: z.object({
6467
6471
  aspectRatio: z.enum([
6468
6472
  "16:9",
@@ -6731,7 +6735,8 @@ const nodeSchema = z.lazy(() => z.object({
6731
6735
  baseId: z.string().nullable(),
6732
6736
  children: z.array(nodeSchema),
6733
6737
  hasChildren: z.boolean().optional(),
6734
- shared: z.boolean().optional()
6738
+ shared: z.boolean().optional(),
6739
+ sharedViaAncestor: z.boolean().optional()
6735
6740
  }));
6736
6741
  z.object({
6737
6742
  id: z.string(),
@@ -7610,8 +7615,15 @@ const createViewInputSchema = z.object({
7610
7615
  submittedBy: z.string().optional().default("local-producer"),
7611
7616
  autoMerge: autoMergeSchema
7612
7617
  });
7618
+ const viewConfigPatchSchema = viewConfigSchema.omit({
7619
+ filters: true,
7620
+ sorts: true
7621
+ }).extend({
7622
+ filters: z.array(viewFilterSchema).optional(),
7623
+ sorts: z.array(viewSortSchema).optional()
7624
+ });
7613
7625
  const updateViewInputSchema = z.object({
7614
- config: viewConfigSchema.optional(),
7626
+ config: viewConfigPatchSchema.optional().describe("Only supplied config keys change; empty arrays and null clear supported settings."),
7615
7627
  description: z.string().optional(),
7616
7628
  message: z.string().optional().default("Update view"),
7617
7629
  name: z.string().min(1).optional(),
@@ -7855,8 +7867,8 @@ const PackageDocFrontmatterSchema = z.object({
7855
7867
  * has no slug alias for them. Install MUST strip both before the options reach the
7856
7868
  * server and patch in the resolved ids afterwards.
7857
7869
  *
7858
- * Everything else (`choices` incl. its ids, `multiple`, `number`, `code`, `embed`,
7859
- * `attachment`) is carried verbatim — field options are stored verbatim server-side,
7870
+ * Everything else (`choices` incl. its ids, `multiple`, `number`, `code`, `date`,
7871
+ * `embed`, `attachment`) is carried verbatim — field options are stored verbatim server-side,
7860
7872
  * so choice ids survive and record values referencing them need no remap.
7861
7873
  */
7862
7874
  const PackageFieldOptionsSchema = z.object({
@@ -7878,6 +7890,10 @@ const PackageFieldOptionsSchema = z.object({
7878
7890
  name: z.string()
7879
7891
  })).optional(),
7880
7892
  code: z.object({ language: z.string().optional() }).optional(),
7893
+ date: z.object({
7894
+ includeTime: z.boolean().optional(),
7895
+ timezone: z.string().optional()
7896
+ }).optional(),
7881
7897
  embed: z.object({
7882
7898
  aspectRatio: z.enum([
7883
7899
  "16:9",
@@ -12184,10 +12200,13 @@ const PROCEDURE_PERMISSION_POLICY = {
12184
12200
  "embedLinks.revoke": workspace("manage"),
12185
12201
  "nodes.share.list": workspace("manage"),
12186
12202
  "nodes.listFavorites": node("read"),
12203
+ "nodes.subscription.get": node("read"),
12204
+ "nodes.subscription.set": node("read"),
12187
12205
  "auditEvents.list": node("read"),
12188
12206
  "activity.listPaged": node("read"),
12189
12207
  "activity.listForNode": node("read"),
12190
12208
  "activity.listForRecord": node("read"),
12209
+ "activity.listForRecordPaged": node("read"),
12191
12210
  "comments.list": node("read"),
12192
12211
  "comments.listMentions": node("read"),
12193
12212
  "comments.markMentionsRead": node("read"),
@@ -12238,6 +12257,7 @@ const PROCEDURE_PERMISSION_POLICY = {
12238
12257
  "changeRequests.inboxSnapshot": node("read"),
12239
12258
  "changeRequests.counts": node("read"),
12240
12259
  "changeRequests.get": node("read"),
12260
+ "changeRequests.createPreviewLink": node("changeRequest"),
12241
12261
  "records.list": node("read"),
12242
12262
  "records.listPage": node("read"),
12243
12263
  "records.count": node("read"),
@@ -13425,8 +13445,8 @@ literally to the user. The user's final line must be:
13425
13445
 
13426
13446
  > 🔗 [Open Busabase Dashboard](${site}/dashboard/${dashboardSpaceId}/home)` : ""}
13427
13447
 
13428
- Normal agent work remains review-first. Only the versioned system-onboarding initializer may use
13429
- \`autoMerge\` for starter structure and sample records.`;
13448
+ Later writes omit \`autoMerge\`: merged where the user can write, reviewed elsewhere. Only
13449
+ the onboarding initializer passes \`autoMerge: true\`, for starter data.`;
13430
13450
  return `---
13431
13451
  name: busabase
13432
13452
  description: ${SETUP_SKILL_DESCRIPTION}
@@ -15606,6 +15626,15 @@ than as a 403 later. The choice is stored in the active profile and mirrored to
15606
15626
  });
15607
15627
  const nodes = program.command("nodes").description("Workspace node tree");
15608
15628
  addGlobalFlags(nodes.command("list")).description("Workspace node tree").action(runAction(state, (client) => client.nodes.list()));
15629
+ addGlobalFlags(nodes.command("update-description")).description("Propose a node description update via a Change Request").requiredOption("--node-id <id>", "node id").requiredOption("--description <text>", "new description").option("--message <text>", "reviewer-facing Change Request message").option("--submitted-by <name>", "producer label").option("--dry-run", "print the request this would send and send nothing").addHelpText("after", `\nExample:\n busabase-cli nodes update-description --node-id nod_123 --description "Campaign resources"\n\nThis submits a Change Request: it merges with write access, otherwise it waits for review.`).action(runAction(state, (client, opts) => client.nodes.createChangeRequest({
15630
+ operations: [{
15631
+ kind: "rename",
15632
+ nodeId: opts.nodeId,
15633
+ description: opts.description
15634
+ }],
15635
+ message: opts.message,
15636
+ submittedBy: opts.submittedBy
15637
+ })));
15609
15638
  addGlobalFlags(nodes.command("purge")).description("Permanently delete an ALREADY-archived node and its subtree (irreversible). Archive it first with `nodes archive` if it isn't archived yet.").requiredOption("--node-id <id>", "archived node id to purge").option("--dry-run", "print the request this would send and send nothing").action(runAction(state, (client, opts) => client.nodes.purge({ nodeId: opts.nodeId })));
15610
15639
  addGlobalFlags(nodes.command("move")).description("Move or reorder a node (applied immediately, no review needed)").requiredOption("--node-id <id>", "node id to move").option("--parent-node-id <id>", "new parent folder node id; omit to keep the current parent").option("--position <n>", "new position among the target parent's children", (v) => Number.parseInt(v, 10)).option("--message <text>", "Change Request message").option("--submitted-by <name>", "producer label").addHelpText("after", `
15611
15640
  Examples:
@@ -15653,11 +15682,11 @@ Examples:
15653
15682
  }));
15654
15683
  const bases = program.command("bases").description("Bases (structured tables)");
15655
15684
  addGlobalFlags(bases.command("list")).description("List Bases in the active space").addOption(new Option("--status <active|archived>", "live Bases (default) or archived ones").choices(["active", "archived"])).action(runAction(state, (client, opts) => client.bases.list({ status: opts.status ?? "active" })));
15656
- addGlobalFlags(bases.command("get")).description("Get one Base by slug").requiredOption("--slug <slug>", "Base slug").action(runAction(state, async (client, opts) => {
15685
+ addGlobalFlags(bases.command("get")).description("Get one Base by id or slug").option("--slug <slug>", "Base slug").option("--base-id <id>", "Base id").action(runAction(state, (client, opts) => {
15657
15686
  const slug = opts.slug;
15658
- const found = (await client.bases.list({})).find((base) => base.slug === slug);
15659
- if (!found) throw new Error(`no Base with slug "${slug}"`);
15660
- return found;
15687
+ const baseId = opts.baseId;
15688
+ if (Boolean(slug) === Boolean(baseId)) throw new CliOutcomeError("VALIDATION", "Pass exactly one of --slug or --base-id.");
15689
+ return client.bases.get({ baseId: baseId ?? slug });
15661
15690
  }));
15662
15691
  addGlobalFlags(bases.command("create-field")).description("Add a field to a Base").requiredOption("--base-id <id>", "Base id").requiredOption("--slug <slug>", "field slug").requiredOption("--name <name>", "field name").option("--field-type <type>", "field type (default text)").option("--required", "mark the field as required").option("--max-files <n>", "attachment option: max files", parsePositiveInt).option("--max-file-size <bytes>", "attachment option: max size in bytes", parsePositiveInt).option("--allowed-mime <mime>", "attachment option: allowed MIME type, repeatable", collectValues).option("--dry-run", "print the request this would send and send nothing").action(runAction(state, (client, opts) => client.bases.createField({
15663
15692
  baseId: opts.baseId,
@@ -15982,14 +16011,16 @@ To copy a still-live space's current content into another space, use
15982
16011
  "post",
15983
16012
  "put",
15984
16013
  "delete"
15985
- ]).makeOptionMandatory()).requiredOption("--path <p>", "path under /api/v1, e.g. /bases").option("--query <k=v...>", "query-string param, repeatable").option("--body-json <json>", "JSON request body").option("--dry-run", "print the request this would send and send nothing").action(runAction(state, (_client, opts, config) => {
16014
+ ]).makeOptionMandatory()).requiredOption("--path <p>", "path under /api/v1 (e.g. /bases) or full /api/v1 path").option("--query <k=v...>", "query-string param, repeatable").option("--body-json <json>", "JSON request body").option("--dry-run", "print the request this would send and send nothing").action(runAction(state, (_client, opts, config) => {
15986
16015
  const query = new URLSearchParams();
15987
16016
  for (const pair of opts.query ?? []) {
15988
16017
  const [key, ...rest] = pair.split("=");
15989
16018
  query.set(key, rest.join("="));
15990
16019
  }
15991
16020
  const qs = query.toString();
15992
- const path = `/api/v1${opts.path}${qs ? `?${qs}` : ""}`;
16021
+ const requestedPath = opts.path;
16022
+ if (!requestedPath.startsWith("/")) throw new CliOutcomeError("VALIDATION", "--path must start with /.");
16023
+ const path = `${/^\/api\/v1(?:\/|$)/.test(requestedPath) ? requestedPath : `/api/v1${requestedPath}`}${qs ? `?${qs}` : ""}`;
15993
16024
  const bodyJson = opts.bodyJson;
15994
16025
  return rawFetch(config, opts.method, path, bodyJson ? parseJsonValue(bodyJson, "body-json") : void 0);
15995
16026
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "busa-cli",
3
- "version": "0.90.2",
3
+ "version": "0.95.0",
4
4
  "description": "Command-line client for the Busabase OpenAPI REST API. Talks to a local or remote `busabase server`. Short-name alias for busabase-cli.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/busabase/busabase/tree/main/apps/busabase-cli",
@@ -33,7 +33,7 @@
33
33
  "dependencies": {
34
34
  "@zip.js/zip.js": "^2.8.20",
35
35
  "busabase-package": "workspace:*",
36
- "busabase-sdk": "0.90.2",
36
+ "busabase-sdk": "0.95.0",
37
37
  "commander": "^14.0.0",
38
38
  "qrcode": "^1.5.4",
39
39
  "tar-stream": "^3.1.7",