busabase-sdk 0.9.7 → 0.9.9

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/index.d.ts CHANGED
@@ -512,6 +512,19 @@ declare const cloudContract: {
512
512
  parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
513
513
  depth: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
514
514
  }, z.core.$strip>>, z.ZodArray<z.ZodType<NodeOutput, unknown, z.core.$ZodTypeInternals<NodeOutput, unknown>>>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
515
+ searchByName: _orpc_contract.ContractProcedure<z.ZodObject<{
516
+ query: z.ZodString;
517
+ limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
518
+ }, z.core.$strip>, z.ZodArray<z.ZodObject<{
519
+ id: z.ZodString;
520
+ type: z.ZodEnum<{
521
+ [x: string]: string;
522
+ }>;
523
+ name: z.ZodString;
524
+ slug: z.ZodString;
525
+ path: z.ZodString;
526
+ updatedAt: z.ZodString;
527
+ }, z.core.$strip>>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
515
528
  isDescendant: _orpc_contract.ContractProcedure<z.ZodObject<{
516
529
  nodeId: z.ZodString;
517
530
  potentialAncestorId: z.ZodString;
@@ -1405,6 +1418,71 @@ declare const cloudContract: {
1405
1418
  }, z.core.$strip>, z.ZodObject<{
1406
1419
  purged: z.ZodBoolean;
1407
1420
  }, z.core.$strip>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
1421
+ updateVisibility: _orpc_contract.ContractProcedure<z.ZodObject<{
1422
+ nodeId: z.ZodString;
1423
+ visibility: z.ZodNullable<z.ZodEnum<{
1424
+ private: "private";
1425
+ workspace: "workspace";
1426
+ public: "public";
1427
+ }>>;
1428
+ }, z.core.$strip>, z.ZodObject<{
1429
+ updated: z.ZodBoolean;
1430
+ }, z.core.$strip>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
1431
+ toggleFavorite: _orpc_contract.ContractProcedure<z.ZodObject<{
1432
+ nodeId: z.ZodString;
1433
+ }, z.core.$strip>, z.ZodObject<{
1434
+ favorited: z.ZodBoolean;
1435
+ }, z.core.$strip>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
1436
+ listFavorites: _orpc_contract.ContractProcedure<_orpc_contract.Schema<unknown, unknown>, z.ZodArray<z.ZodType<NodeOutput, unknown, z.core.$ZodTypeInternals<NodeOutput, unknown>>>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
1437
+ principals: {
1438
+ list: _orpc_contract.ContractProcedure<z.ZodObject<{
1439
+ nodeId: z.ZodString;
1440
+ }, z.core.$strip>, z.ZodArray<z.ZodObject<{
1441
+ id: z.ZodString;
1442
+ nodeId: z.ZodString;
1443
+ principalType: z.ZodEnum<{
1444
+ space: "space";
1445
+ user: "user";
1446
+ team: "team";
1447
+ }>;
1448
+ principalId: z.ZodString;
1449
+ role: z.ZodEnum<{
1450
+ read: "read";
1451
+ changeRequest: "changeRequest";
1452
+ write: "write";
1453
+ manage: "manage";
1454
+ }>;
1455
+ grantedBy: z.ZodString;
1456
+ createdAt: z.ZodString;
1457
+ updatedAt: z.ZodString;
1458
+ }, z.core.$strip>>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
1459
+ add: _orpc_contract.ContractProcedure<z.ZodObject<{
1460
+ nodeId: z.ZodString;
1461
+ principalType: z.ZodEnum<{
1462
+ space: "space";
1463
+ user: "user";
1464
+ }>;
1465
+ principalId: z.ZodString;
1466
+ role: z.ZodEnum<{
1467
+ read: "read";
1468
+ changeRequest: "changeRequest";
1469
+ write: "write";
1470
+ manage: "manage";
1471
+ }>;
1472
+ }, z.core.$strip>, z.ZodObject<{
1473
+ granted: z.ZodBoolean;
1474
+ }, z.core.$strip>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
1475
+ remove: _orpc_contract.ContractProcedure<z.ZodObject<{
1476
+ nodeId: z.ZodString;
1477
+ principalType: z.ZodEnum<{
1478
+ space: "space";
1479
+ user: "user";
1480
+ }>;
1481
+ principalId: z.ZodString;
1482
+ }, z.core.$strip>, z.ZodObject<{
1483
+ removed: z.ZodBoolean;
1484
+ }, z.core.$strip>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
1485
+ };
1408
1486
  };
1409
1487
  auditEvents: {
1410
1488
  list: _orpc_contract.ContractProcedure<z.ZodDefault<z.ZodOptional<z.ZodObject<{
@@ -3584,7 +3662,13 @@ declare const cloudContract: {
3584
3662
  slug: z.ZodString;
3585
3663
  name: z.ZodString;
3586
3664
  description: z.ZodString;
3587
- type: z.ZodLiteral<"table">;
3665
+ type: z.ZodEnum<{
3666
+ table: "table";
3667
+ gallery: "gallery";
3668
+ kanban: "kanban";
3669
+ calendar: "calendar";
3670
+ gantt: "gantt";
3671
+ }>;
3588
3672
  config: z.ZodObject<{
3589
3673
  filters: z.ZodDefault<z.ZodArray<z.ZodObject<{
3590
3674
  fieldSlug: z.ZodString;
@@ -3608,6 +3692,25 @@ declare const cloudContract: {
3608
3692
  fieldId: z.ZodOptional<z.ZodString>;
3609
3693
  }, z.core.$strip>>>;
3610
3694
  visibleFieldSlugs: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
3695
+ coverFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3696
+ coverFit: z.ZodOptional<z.ZodEnum<{
3697
+ cover: "cover";
3698
+ fit: "fit";
3699
+ }>>;
3700
+ cardSize: z.ZodOptional<z.ZodEnum<{
3701
+ small: "small";
3702
+ medium: "medium";
3703
+ large: "large";
3704
+ }>>;
3705
+ showFieldLabels: z.ZodOptional<z.ZodBoolean>;
3706
+ stackByFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3707
+ dateFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3708
+ startFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3709
+ endFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3710
+ ganttScale: z.ZodOptional<z.ZodEnum<{
3711
+ week: "week";
3712
+ month: "month";
3713
+ }>>;
3611
3714
  }, z.core.$strip>;
3612
3715
  status: z.ZodEnum<{
3613
3716
  archived: "archived";
@@ -3633,7 +3736,13 @@ declare const cloudContract: {
3633
3736
  slug: z.ZodString;
3634
3737
  name: z.ZodString;
3635
3738
  description: z.ZodString;
3636
- type: z.ZodLiteral<"table">;
3739
+ type: z.ZodEnum<{
3740
+ table: "table";
3741
+ gallery: "gallery";
3742
+ kanban: "kanban";
3743
+ calendar: "calendar";
3744
+ gantt: "gantt";
3745
+ }>;
3637
3746
  config: z.ZodObject<{
3638
3747
  filters: z.ZodDefault<z.ZodArray<z.ZodObject<{
3639
3748
  fieldSlug: z.ZodString;
@@ -3657,6 +3766,25 @@ declare const cloudContract: {
3657
3766
  fieldId: z.ZodOptional<z.ZodString>;
3658
3767
  }, z.core.$strip>>>;
3659
3768
  visibleFieldSlugs: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
3769
+ coverFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3770
+ coverFit: z.ZodOptional<z.ZodEnum<{
3771
+ cover: "cover";
3772
+ fit: "fit";
3773
+ }>>;
3774
+ cardSize: z.ZodOptional<z.ZodEnum<{
3775
+ small: "small";
3776
+ medium: "medium";
3777
+ large: "large";
3778
+ }>>;
3779
+ showFieldLabels: z.ZodOptional<z.ZodBoolean>;
3780
+ stackByFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3781
+ dateFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3782
+ startFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3783
+ endFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3784
+ ganttScale: z.ZodOptional<z.ZodEnum<{
3785
+ week: "week";
3786
+ month: "month";
3787
+ }>>;
3660
3788
  }, z.core.$strip>;
3661
3789
  status: z.ZodEnum<{
3662
3790
  archived: "archived";
@@ -4600,7 +4728,180 @@ declare const cloudContract: {
4600
4728
  message: z.ZodDefault<z.ZodOptional<z.ZodString>>;
4601
4729
  submittedBy: z.ZodDefault<z.ZodOptional<z.ZodString>>;
4602
4730
  idempotencyKey: z.ZodOptional<z.ZodString>;
4731
+ autoMerge: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
4732
+ baseId: z.ZodString;
4733
+ }, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
4734
+ id: z.ZodString;
4603
4735
  baseId: z.ZodString;
4736
+ headCommitId: z.ZodString;
4737
+ parentRecordId: z.ZodNullable<z.ZodString>;
4738
+ parentCommitId: z.ZodNullable<z.ZodString>;
4739
+ status: z.ZodEnum<{
4740
+ archived: "archived";
4741
+ active: "active";
4742
+ }>;
4743
+ createdBy: z.ZodString;
4744
+ createdByUser: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodObject<{
4745
+ id: z.ZodString;
4746
+ name: z.ZodNullable<z.ZodString>;
4747
+ email: z.ZodNullable<z.ZodString>;
4748
+ image: z.ZodNullable<z.ZodString>;
4749
+ role: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4750
+ }, z.core.$strip>>>>;
4751
+ archivedAt: z.ZodNullable<z.ZodString>;
4752
+ createdAt: z.ZodString;
4753
+ updatedAt: z.ZodString;
4754
+ base: z.ZodObject<{
4755
+ id: z.ZodString;
4756
+ nodeId: z.ZodString;
4757
+ slug: z.ZodString;
4758
+ name: z.ZodString;
4759
+ description: z.ZodString;
4760
+ reviewPolicy: z.ZodObject<{
4761
+ kind: z.ZodLiteral<"single">;
4762
+ requiredApprovals: z.ZodNumber;
4763
+ }, z.core.$strip>;
4764
+ createdAt: z.ZodString;
4765
+ fields: z.ZodArray<z.ZodObject<{
4766
+ id: z.ZodString;
4767
+ baseId: z.ZodString;
4768
+ slug: z.ZodString;
4769
+ name: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodEnum<{
4770
+ en: "en";
4771
+ "zh-CN": "zh-CN";
4772
+ "zh-TW": "zh-TW";
4773
+ ja: "ja";
4774
+ ko: "ko";
4775
+ de: "de";
4776
+ fr: "fr";
4777
+ es: "es";
4778
+ pt: "pt";
4779
+ }> & z.core.$partial, z.ZodString>]>;
4780
+ type: z.ZodEnum<{
4781
+ number: "number";
4782
+ email: "email";
4783
+ date: "date";
4784
+ text: "text";
4785
+ longtext: "longtext";
4786
+ markdown: "markdown";
4787
+ html: "html";
4788
+ attachment: "attachment";
4789
+ relation: "relation";
4790
+ checkbox: "checkbox";
4791
+ select: "select";
4792
+ multiselect: "multiselect";
4793
+ url: "url";
4794
+ embed: "embed";
4795
+ phone: "phone";
4796
+ created_time: "created_time";
4797
+ updated_time: "updated_time";
4798
+ created_by: "created_by";
4799
+ updated_by: "updated_by";
4800
+ auto_number: "auto_number";
4801
+ ai_summary: "ai_summary";
4802
+ ai_tags: "ai_tags";
4803
+ code: "code";
4804
+ json: "json";
4805
+ yaml: "yaml";
4806
+ }>;
4807
+ required: z.ZodBoolean;
4808
+ position: z.ZodNumber;
4809
+ options: z.ZodDefault<z.ZodObject<{
4810
+ ai: z.ZodOptional<z.ZodObject<{
4811
+ model: z.ZodOptional<z.ZodString>;
4812
+ prompt: z.ZodOptional<z.ZodString>;
4813
+ reviewRequired: z.ZodOptional<z.ZodBoolean>;
4814
+ sourceFieldIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
4815
+ }, z.core.$strip>>;
4816
+ attachment: z.ZodOptional<z.ZodObject<{
4817
+ maxFiles: z.ZodOptional<z.ZodNumber>;
4818
+ allowedMimeTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
4819
+ maxFileSize: z.ZodOptional<z.ZodNumber>;
4820
+ }, z.core.$strip>>;
4821
+ choices: z.ZodOptional<z.ZodArray<z.ZodObject<{
4822
+ color: z.ZodOptional<z.ZodString>;
4823
+ id: z.ZodString;
4824
+ name: z.ZodString;
4825
+ }, z.core.$strip>>>;
4826
+ code: z.ZodOptional<z.ZodObject<{
4827
+ language: z.ZodOptional<z.ZodString>;
4828
+ }, z.core.$strip>>;
4829
+ embed: z.ZodOptional<z.ZodObject<{
4830
+ aspectRatio: z.ZodOptional<z.ZodEnum<{
4831
+ "16:9": "16:9";
4832
+ "4:3": "4:3";
4833
+ "1:1": "1:1";
4834
+ }>>;
4835
+ height: z.ZodOptional<z.ZodNumber>;
4836
+ providers: z.ZodOptional<z.ZodArray<z.ZodString>>;
4837
+ }, z.core.$strip>>;
4838
+ inverseFieldId: z.ZodOptional<z.ZodString>;
4839
+ multiple: z.ZodOptional<z.ZodBoolean>;
4840
+ number: z.ZodOptional<z.ZodObject<{
4841
+ format: z.ZodOptional<z.ZodEnum<{
4842
+ plain: "plain";
4843
+ currency: "currency";
4844
+ }>>;
4845
+ currency: z.ZodOptional<z.ZodString>;
4846
+ locale: z.ZodOptional<z.ZodString>;
4847
+ }, z.core.$strip>>;
4848
+ targetBaseId: z.ZodOptional<z.ZodString>;
4849
+ targetBaseSlug: z.ZodOptional<z.ZodString>;
4850
+ }, z.core.$strip>>;
4851
+ }, z.core.$strip>>;
4852
+ }, z.core.$strip>;
4853
+ headCommit: z.ZodObject<{
4854
+ id: z.ZodString;
4855
+ baseId: z.ZodNullable<z.ZodString>;
4856
+ targetType: z.ZodEnum<{
4857
+ base: "base";
4858
+ node: "node";
4859
+ }>;
4860
+ nodeId: z.ZodNullable<z.ZodString>;
4861
+ operationId: z.ZodNullable<z.ZodString>;
4862
+ parentCommitId: z.ZodNullable<z.ZodString>;
4863
+ fields: z.ZodRecord<z.ZodString, z.ZodUnknown>;
4864
+ operation: z.ZodEnum<{
4865
+ [x: `${string}_file_create`]: `${string}_file_create`;
4866
+ [x: `${string}_file_update`]: `${string}_file_update`;
4867
+ [x: `${string}_file_delete`]: `${string}_file_delete`;
4868
+ [x: `${string}_metadata_update`]: `${string}_metadata_update`;
4869
+ record_create: "record_create";
4870
+ record_update: "record_update";
4871
+ record_delete: "record_delete";
4872
+ record_variant: "record_variant";
4873
+ view_create: "view_create";
4874
+ view_update: "view_update";
4875
+ view_delete: "view_delete";
4876
+ view_restore: "view_restore";
4877
+ base_add_field: "base_add_field";
4878
+ base_delete_field: "base_delete_field";
4879
+ base_update_field: "base_update_field";
4880
+ base_convert_field: "base_convert_field";
4881
+ base_reorder_fields: "base_reorder_fields";
4882
+ base_restore_field: "base_restore_field";
4883
+ base_archive: "base_archive";
4884
+ base_restore: "base_restore";
4885
+ record_restore: "record_restore";
4886
+ doc_update: "doc_update";
4887
+ node_create: "node_create";
4888
+ node_rename: "node_rename";
4889
+ node_delete: "node_delete";
4890
+ node_restore: "node_restore";
4891
+ node_move: "node_move";
4892
+ }>;
4893
+ message: z.ZodString;
4894
+ author: z.ZodString;
4895
+ authorUser: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodObject<{
4896
+ id: z.ZodString;
4897
+ name: z.ZodNullable<z.ZodString>;
4898
+ email: z.ZodNullable<z.ZodString>;
4899
+ image: z.ZodNullable<z.ZodString>;
4900
+ role: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4901
+ }, z.core.$strip>>>>;
4902
+ createdAt: z.ZodString;
4903
+ }, z.core.$strip>;
4904
+ materialized: z.ZodLiteral<true>;
4604
4905
  }, z.core.$strip>, z.ZodObject<{
4605
4906
  id: z.ZodString;
4606
4907
  baseId: z.ZodNullable<z.ZodString>;
@@ -4978,7 +5279,8 @@ declare const cloudContract: {
4978
5279
  visibleOperationHeads: z.ZodRecord<z.ZodString, z.ZodString>;
4979
5280
  createdAt: z.ZodString;
4980
5281
  }, z.core.$strip>>;
4981
- }, z.core.$strip>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
5282
+ materialized: z.ZodLiteral<false>;
5283
+ }, z.core.$strip>]>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
4982
5284
  createBulkChangeRequest: _orpc_contract.ContractProcedure<z.ZodObject<{
4983
5285
  records: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4984
5286
  message: z.ZodDefault<z.ZodOptional<z.ZodString>>;
@@ -6034,10 +6336,36 @@ declare const cloudContract: {
6034
6336
  fieldId: z.ZodOptional<z.ZodString>;
6035
6337
  }, z.core.$strip>>>;
6036
6338
  visibleFieldSlugs: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
6339
+ coverFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6340
+ coverFit: z.ZodOptional<z.ZodEnum<{
6341
+ cover: "cover";
6342
+ fit: "fit";
6343
+ }>>;
6344
+ cardSize: z.ZodOptional<z.ZodEnum<{
6345
+ small: "small";
6346
+ medium: "medium";
6347
+ large: "large";
6348
+ }>>;
6349
+ showFieldLabels: z.ZodOptional<z.ZodBoolean>;
6350
+ stackByFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6351
+ dateFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6352
+ startFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6353
+ endFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6354
+ ganttScale: z.ZodOptional<z.ZodEnum<{
6355
+ week: "week";
6356
+ month: "month";
6357
+ }>>;
6037
6358
  }, z.core.$strip>>>;
6038
6359
  description: z.ZodDefault<z.ZodOptional<z.ZodString>>;
6039
6360
  message: z.ZodDefault<z.ZodOptional<z.ZodString>>;
6040
6361
  name: z.ZodString;
6362
+ type: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
6363
+ table: "table";
6364
+ gallery: "gallery";
6365
+ kanban: "kanban";
6366
+ calendar: "calendar";
6367
+ gantt: "gantt";
6368
+ }>>>;
6041
6369
  slug: z.ZodOptional<z.ZodString>;
6042
6370
  submittedBy: z.ZodDefault<z.ZodOptional<z.ZodString>>;
6043
6371
  baseId: z.ZodString;
@@ -11057,6 +11385,10 @@ declare const cloudContract: {
11057
11385
  runLocalNode: _orpc_contract.ContractProcedure<z.ZodObject<{
11058
11386
  nodeId: z.ZodString;
11059
11387
  files: z.ZodRecord<z.ZodString, z.ZodString>;
11388
+ engine: z.ZodDefault<z.ZodEnum<{
11389
+ "local-node": "local-node";
11390
+ srt: "srt";
11391
+ }>>;
11060
11392
  }, z.core.$strip>, _orpc_contract.Schema<AsyncIteratorObject<{
11061
11393
  type: "log";
11062
11394
  line: string;
@@ -14393,6 +14725,7 @@ declare const cloudContract: {
14393
14725
  comments: "comments";
14394
14726
  bases: "bases";
14395
14727
  assets: "assets";
14728
+ nodePrincipals: "nodePrincipals";
14396
14729
  views: "views";
14397
14730
  fieldValues: "fieldValues";
14398
14731
  recordLinks: "recordLinks";
@@ -14409,6 +14742,15 @@ declare const cloudContract: {
14409
14742
  rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
14410
14743
  nextCursor: z.ZodNullable<z.ZodString>;
14411
14744
  }, z.core.$strip>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
14745
+ exportAssetText: _orpc_contract.ContractProcedure<z.ZodObject<{
14746
+ assetId: z.ZodString;
14747
+ }, z.core.$strip>, z.ZodObject<{
14748
+ assetId: z.ZodString;
14749
+ textStorageKey: z.ZodString;
14750
+ downloadUrl: z.ZodNullable<z.ZodString>;
14751
+ textContentHash: z.ZodNullable<z.ZodString>;
14752
+ byteCount: z.ZodNumber;
14753
+ }, z.core.$strip>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
14412
14754
  importBegin: _orpc_contract.ContractProcedure<_orpc_contract.Schema<unknown, unknown>, z.ZodObject<{
14413
14755
  sessionId: z.ZodString;
14414
14756
  }, z.core.$strip>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
@@ -14423,6 +14765,7 @@ declare const cloudContract: {
14423
14765
  comments: "comments";
14424
14766
  bases: "bases";
14425
14767
  assets: "assets";
14768
+ nodePrincipals: "nodePrincipals";
14426
14769
  views: "views";
14427
14770
  fieldValues: "fieldValues";
14428
14771
  recordLinks: "recordLinks";
@@ -14432,7 +14775,7 @@ declare const cloudContract: {
14432
14775
  commits: "commits";
14433
14776
  changeRequests: "changeRequests";
14434
14777
  auditEvents: "auditEvents";
14435
- }>, z.ZodLiteral<"docBodies">, z.ZodLiteral<"attachmentBlobs">]>;
14778
+ }>, z.ZodLiteral<"docBodies">, z.ZodLiteral<"attachmentBlobs">, z.ZodLiteral<"assetTextBlobs">]>;
14436
14779
  rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
14437
14780
  }, z.core.$strip>, z.ZodObject<{
14438
14781
  inserted: z.ZodNumber;
@@ -16952,7 +17295,13 @@ declare const cloudContract: {
16952
17295
  slug: z.ZodString;
16953
17296
  name: z.ZodString;
16954
17297
  description: z.ZodString;
16955
- type: z.ZodLiteral<"table">;
17298
+ type: z.ZodEnum<{
17299
+ table: "table";
17300
+ gallery: "gallery";
17301
+ kanban: "kanban";
17302
+ calendar: "calendar";
17303
+ gantt: "gantt";
17304
+ }>;
16956
17305
  config: z.ZodObject<{
16957
17306
  filters: z.ZodDefault<z.ZodArray<z.ZodObject<{
16958
17307
  fieldSlug: z.ZodString;
@@ -16976,6 +17325,25 @@ declare const cloudContract: {
16976
17325
  fieldId: z.ZodOptional<z.ZodString>;
16977
17326
  }, z.core.$strip>>>;
16978
17327
  visibleFieldSlugs: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
17328
+ coverFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
17329
+ coverFit: z.ZodOptional<z.ZodEnum<{
17330
+ cover: "cover";
17331
+ fit: "fit";
17332
+ }>>;
17333
+ cardSize: z.ZodOptional<z.ZodEnum<{
17334
+ small: "small";
17335
+ medium: "medium";
17336
+ large: "large";
17337
+ }>>;
17338
+ showFieldLabels: z.ZodOptional<z.ZodBoolean>;
17339
+ stackByFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
17340
+ dateFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
17341
+ startFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
17342
+ endFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
17343
+ ganttScale: z.ZodOptional<z.ZodEnum<{
17344
+ week: "week";
17345
+ month: "month";
17346
+ }>>;
16979
17347
  }, z.core.$strip>;
16980
17348
  status: z.ZodEnum<{
16981
17349
  archived: "archived";
@@ -19694,10 +20062,36 @@ declare const cloudContract: {
19694
20062
  fieldId: z.ZodOptional<z.ZodString>;
19695
20063
  }, z.core.$strip>>>;
19696
20064
  visibleFieldSlugs: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
20065
+ coverFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
20066
+ coverFit: z.ZodOptional<z.ZodEnum<{
20067
+ cover: "cover";
20068
+ fit: "fit";
20069
+ }>>;
20070
+ cardSize: z.ZodOptional<z.ZodEnum<{
20071
+ small: "small";
20072
+ medium: "medium";
20073
+ large: "large";
20074
+ }>>;
20075
+ showFieldLabels: z.ZodOptional<z.ZodBoolean>;
20076
+ stackByFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
20077
+ dateFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
20078
+ startFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
20079
+ endFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
20080
+ ganttScale: z.ZodOptional<z.ZodEnum<{
20081
+ week: "week";
20082
+ month: "month";
20083
+ }>>;
19697
20084
  }, z.core.$strip>>;
19698
20085
  description: z.ZodOptional<z.ZodString>;
19699
20086
  message: z.ZodDefault<z.ZodOptional<z.ZodString>>;
19700
20087
  name: z.ZodOptional<z.ZodString>;
20088
+ type: z.ZodOptional<z.ZodEnum<{
20089
+ table: "table";
20090
+ gallery: "gallery";
20091
+ kanban: "kanban";
20092
+ calendar: "calendar";
20093
+ gantt: "gantt";
20094
+ }>>;
19701
20095
  submittedBy: z.ZodDefault<z.ZodOptional<z.ZodString>>;
19702
20096
  viewId: z.ZodString;
19703
20097
  }, z.core.$strip>, z.ZodObject<{
@@ -21067,10 +21461,23 @@ interface ViewSortVO {
21067
21461
  fieldSlug: string;
21068
21462
  fieldId?: string;
21069
21463
  }
21464
+ type ViewType = "table" | "gallery" | "kanban" | "calendar" | "gantt";
21465
+ type GalleryCoverFit = "cover" | "fit";
21466
+ type GalleryCardSize = "small" | "medium" | "large";
21467
+ type GanttScale = "week" | "month";
21070
21468
  interface ViewConfigVO {
21071
21469
  filters: ViewFilterVO[];
21072
21470
  sorts: ViewSortVO[];
21073
21471
  visibleFieldSlugs?: string[] | null;
21472
+ coverFieldSlug?: string | null;
21473
+ coverFit?: GalleryCoverFit;
21474
+ cardSize?: GalleryCardSize;
21475
+ showFieldLabels?: boolean;
21476
+ stackByFieldSlug?: string | null;
21477
+ dateFieldSlug?: string | null;
21478
+ startFieldSlug?: string | null;
21479
+ endFieldSlug?: string | null;
21480
+ ganttScale?: GanttScale;
21074
21481
  }
21075
21482
  interface ViewVO {
21076
21483
  id: string;
@@ -21078,7 +21485,7 @@ interface ViewVO {
21078
21485
  slug: string;
21079
21486
  name: string;
21080
21487
  description: string;
21081
- type: "table";
21488
+ type: ViewType;
21082
21489
  config: ViewConfigVO;
21083
21490
  status: "active" | "archived";
21084
21491
  createdBy: string;
@@ -22640,6 +23047,22 @@ interface UserRefVO {
22640
23047
  image: string | null;
22641
23048
  role?: string | null;
22642
23049
  }
23050
+ /**
23051
+ * Cheap, name/slug-only match from `nodes.searchByName` (see
23052
+ * `apps/busabase/content/spec/search-quick-jump.md`) — deliberately a much
23053
+ * smaller projection than `NodeVO` (no `description`/`metadata`/tree shape):
23054
+ * this backs the dashboard's instant quick-jump palette, not the sidebar tree
23055
+ * or a node's own detail view. `path` is the route this node navigates to
23056
+ * (e.g. `/base/{slug}`), not a filesystem/breadcrumb tree path.
23057
+ */
23058
+ interface NodeSearchResultVO {
23059
+ id: string;
23060
+ type: NodeType;
23061
+ name: string;
23062
+ slug: string;
23063
+ path: string;
23064
+ updatedAt: string;
23065
+ }
22643
23066
  interface NodeVO {
22644
23067
  id: string;
22645
23068
  parentId: string | null;
@@ -22966,4 +23389,4 @@ declare class Busabase {
22966
23389
  }>>>>;
22967
23390
  }
22968
23391
 
22969
- export { type ActivityItemVO, type AgentTaskVO, type FileTreeFileVO as AirAppFileVO, type FileTreeReadFileVO as AirAppReadFileVO, type FileTreeNodeVO as AirAppVO, type AssetAttachmentRef, type AssetDetailVO, type AssetTextStatus, type AssetUsageVO, type AssetVO, type AttachmentRef, type AuditAction, type AuditEventVO, type BaseFieldVO, type BaseVO, Busabase, type BusabaseClient, type BusabaseConfig, type BusabaseRpcConfig, CREATABLE_NODE_TYPES, type ChangeRequestBatchResultVO, type ChangeRequestCountsVO, type ChangeRequestStatus, type ChangeRequestTargetType, type ChangeRequestVO, type CloudContract, type CommentSubjectType, type CommentVO, type CommitVO, type CreatableNodeType, DEFAULT_BASE_URL, type FileTreeFileVO as DriveFileVO, type FileTreeReadFileVO as DriveReadFileVO, type FileTreeNodeVO as DriveVO, type FieldType, type FileNodeMetadata, type FileNodeVO, type FileTreeFileVO, type FileTreeNodeVO, type FileTreeReadFileVO, type NodeType, type NodeVO, type OperationKind, type OperationStatus, type OperationVO, type RecordLinkVO, type RecordVO, type ResolvedConfig, type ReviewVO, type ReviewVerdict, type SearchResponseVO, type SearchResultKind, type SearchResultVO, type FileTreeFileVO as SkillFileVO, type FileTreeReadFileVO as SkillReadFileVO, type FileTreeNodeVO as SkillVO, type UpdateVaultSettingsDTO, type UserRefVO, type VaultAccessPolicy, type VaultEnvironment, type VaultItemInput, type VaultItemKind, type VaultItemVO, type VaultRuntimeEnv, type VaultScopeType, type VaultSettingsVO, type ViewConfigVO, type ViewFilterOperator, type ViewFilterVO, type ViewSortVO, type ViewVO, cloudContract, createBusabaseClient, createBusabaseRpcClient, normalizeBaseUrl, resolveConfig };
23392
+ export { type ActivityItemVO, type AgentTaskVO, type FileTreeFileVO as AirAppFileVO, type FileTreeReadFileVO as AirAppReadFileVO, type FileTreeNodeVO as AirAppVO, type AssetAttachmentRef, type AssetDetailVO, type AssetTextStatus, type AssetUsageVO, type AssetVO, type AttachmentRef, type AuditAction, type AuditEventVO, type BaseFieldVO, type BaseVO, Busabase, type BusabaseClient, type BusabaseConfig, type BusabaseRpcConfig, CREATABLE_NODE_TYPES, type ChangeRequestBatchResultVO, type ChangeRequestCountsVO, type ChangeRequestStatus, type ChangeRequestTargetType, type ChangeRequestVO, type CloudContract, type CommentSubjectType, type CommentVO, type CommitVO, type CreatableNodeType, DEFAULT_BASE_URL, type FileTreeFileVO as DriveFileVO, type FileTreeReadFileVO as DriveReadFileVO, type FileTreeNodeVO as DriveVO, type FieldType, type FileNodeMetadata, type FileNodeVO, type FileTreeFileVO, type FileTreeNodeVO, type FileTreeReadFileVO, type GalleryCardSize, type GalleryCoverFit, type GanttScale, type NodeSearchResultVO, type NodeType, type NodeVO, type OperationKind, type OperationStatus, type OperationVO, type RecordLinkVO, type RecordVO, type ResolvedConfig, type ReviewVO, type ReviewVerdict, type SearchResponseVO, type SearchResultKind, type SearchResultVO, type FileTreeFileVO as SkillFileVO, type FileTreeReadFileVO as SkillReadFileVO, type FileTreeNodeVO as SkillVO, type UpdateVaultSettingsDTO, type UserRefVO, type VaultAccessPolicy, type VaultEnvironment, type VaultItemInput, type VaultItemKind, type VaultItemVO, type VaultRuntimeEnv, type VaultScopeType, type VaultSettingsVO, type ViewConfigVO, type ViewFilterOperator, type ViewFilterVO, type ViewSortVO, type ViewType, type ViewVO, cloudContract, createBusabaseClient, createBusabaseRpcClient, normalizeBaseUrl, resolveConfig };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createORPCClient } from '@orpc/client';
1
+ import { createORPCClient, ORPCError } from '@orpc/client';
2
2
  import { RPCLink } from '@orpc/client/fetch';
3
3
  import { oc, eventIterator, inferRPCMethodFromContractRouter } from '@orpc/contract';
4
4
  import { OpenAPILink } from '@orpc/openapi-client/fetch';
@@ -436,6 +436,16 @@ var nodeSchema = z.lazy(
436
436
  hasChildren: z.boolean().optional()
437
437
  })
438
438
  );
439
+ var nodePrincipalSchema = z.object({
440
+ id: z.string(),
441
+ nodeId: z.string(),
442
+ principalType: z.enum(["user", "team", "space"]),
443
+ principalId: z.string(),
444
+ role: z.enum(["read", "changeRequest", "write", "manage"]),
445
+ grantedBy: z.string(),
446
+ createdAt: z.string(),
447
+ updatedAt: z.string()
448
+ });
439
449
  var listNodesInputSchema = z.object({
440
450
  parentId: z.string().nullable().optional().describe("Node to start from. Omit or null to start from the space root."),
441
451
  depth: z.coerce.number().int().min(1).max(5).optional().describe(
@@ -449,6 +459,18 @@ var isDescendantInputSchema = z.object({
449
459
  var isDescendantOutputSchema = z.object({
450
460
  isDescendant: z.boolean()
451
461
  });
462
+ var searchNodesByNameInputSchema = z.object({
463
+ query: z.string().min(1),
464
+ limit: z.number().int().min(1).max(50).optional().default(20)
465
+ });
466
+ var nodeSearchResultSchema = z.object({
467
+ id: z.string(),
468
+ type: z.enum(NODE_TYPES),
469
+ name: z.string(),
470
+ slug: z.string(),
471
+ path: z.string(),
472
+ updatedAt: z.string()
473
+ });
452
474
  var userRefSchema = z.object({
453
475
  id: z.string(),
454
476
  name: z.string().nullable(),
@@ -986,7 +1008,13 @@ var airAppRunLocalNodeInputSchema = z.object({
986
1008
  nodeId: z.string(),
987
1009
  /** Text files to mount into the sandbox workdir before installing, keyed by
988
1010
  * path (same shape `RunPanel` already assembles for `NodepodRunner.mount`). */
989
- files: z.record(z.string(), z.string())
1011
+ files: z.record(z.string(), z.string()),
1012
+ /** Server-side execution mode. `"local-node"` spawns a bare host Node.js
1013
+ * process (previewable, data bridge via reverse proxy, NOT OS-isolated);
1014
+ * `"srt"` wraps the same commands in the OS sandbox (isolated execution,
1015
+ * but live preview is unreachable). `"nodepod"` never calls this endpoint —
1016
+ * it runs entirely in-browser. */
1017
+ engine: z.enum(["local-node", "srt"]).default("local-node")
990
1018
  });
991
1019
  var airAppRuntimeEventSchema = z.discriminatedUnion("type", [
992
1020
  z.object({ type: z.literal("log"), line: z.string() }),
@@ -1335,10 +1363,30 @@ var viewSortSchema = z.object({
1335
1363
  fieldSlug: z.string(),
1336
1364
  fieldId: z.string().optional()
1337
1365
  });
1366
+ var viewTypeSchema = z.enum(["table", "gallery", "kanban", "calendar", "gantt"]);
1367
+ var ganttScaleSchema = z.enum(["week", "month"]);
1368
+ var galleryCoverFitSchema = z.enum(["cover", "fit"]);
1369
+ var galleryCardSizeSchema = z.enum(["small", "medium", "large"]);
1338
1370
  var viewConfigSchema = z.object({
1339
1371
  filters: z.array(viewFilterSchema).default([]),
1340
1372
  sorts: z.array(viewSortSchema).default([]),
1341
- visibleFieldSlugs: z.array(z.string()).nullable().optional()
1373
+ visibleFieldSlugs: z.array(z.string()).nullable().optional(),
1374
+ // ── Gallery-only presentation config (ignored by table views) ──
1375
+ // Which attachment field supplies the cover image (null = no cover).
1376
+ coverFieldSlug: z.string().nullable().optional(),
1377
+ coverFit: galleryCoverFitSchema.optional(),
1378
+ cardSize: galleryCardSizeSchema.optional(),
1379
+ // Whether to render the field label above each value on a card.
1380
+ showFieldLabels: z.boolean().optional(),
1381
+ // ── Kanban-only: which single-select field stacks records into columns.
1382
+ stackByFieldSlug: z.string().nullable().optional(),
1383
+ // ── Calendar-only: which date field positions records on the month grid.
1384
+ dateFieldSlug: z.string().nullable().optional(),
1385
+ // ── Gantt-only: the start/end date fields bounding each record's bar, plus
1386
+ // the time-axis granularity.
1387
+ startFieldSlug: z.string().nullable().optional(),
1388
+ endFieldSlug: z.string().nullable().optional(),
1389
+ ganttScale: ganttScaleSchema.optional()
1342
1390
  });
1343
1391
  var viewSchema = z.object({
1344
1392
  id: z.string(),
@@ -1346,7 +1394,7 @@ var viewSchema = z.object({
1346
1394
  slug: z.string(),
1347
1395
  name: z.string(),
1348
1396
  description: z.string(),
1349
- type: z.literal("table"),
1397
+ type: viewTypeSchema,
1350
1398
  config: viewConfigSchema,
1351
1399
  status: z.enum(["active", "archived"]),
1352
1400
  createdBy: z.string(),
@@ -1360,6 +1408,7 @@ var createViewInputSchema = z.object({
1360
1408
  description: z.string().optional().default(""),
1361
1409
  message: z.string().optional().default("Create view"),
1362
1410
  name: z.string().min(1),
1411
+ type: viewTypeSchema.optional().default("table"),
1363
1412
  slug: z.string().min(1).regex(/^[a-z0-9-]+$/).optional(),
1364
1413
  submittedBy: z.string().optional().default("local-producer")
1365
1414
  });
@@ -1368,6 +1417,7 @@ var updateViewInputSchema = z.object({
1368
1417
  description: z.string().optional(),
1369
1418
  message: z.string().optional().default("Update view"),
1370
1419
  name: z.string().min(1).optional(),
1420
+ type: viewTypeSchema.optional(),
1371
1421
  submittedBy: z.string().optional().default("local-producer")
1372
1422
  });
1373
1423
  var deleteViewInputSchema = z.object({
@@ -1443,7 +1493,13 @@ var createChangeRequestInputSchema = z.object({
1443
1493
  submittedBy: z.string().optional().default("local-producer"),
1444
1494
  idempotencyKey: z.string().optional().describe(
1445
1495
  "Optional client-supplied key that dedupes retries. Scoped per base + submitter: calling this endpoint again with the SAME idempotencyKey (e.g. after a timeout or a 5xx where you couldn't tell if the first call succeeded) returns the change request created by the first call instead of creating a duplicate. Omit for normal one-shot calls; only set it when you might retry."
1446
- )
1496
+ ),
1497
+ // Review-first by default: without `autoMerge: true`, this proposes the record
1498
+ // as a pending ChangeRequest (status "in_review") instead of creating it
1499
+ // immediately. Pass `autoMerge: true` only for callers that don't need human
1500
+ // review — approves and merges the change request right away, returning the
1501
+ // materialized record instead of the pending ChangeRequest.
1502
+ autoMerge: z.boolean().optional().default(false)
1447
1503
  });
1448
1504
  var createBulkChangeRequestInputSchema = z.object({
1449
1505
  records: z.array(z.record(z.string(), z.unknown())).min(1).max(1e3).describe(
@@ -1554,8 +1610,13 @@ var baseContract = {
1554
1610
  path: "/bases/{baseId}/change-requests",
1555
1611
  tags: ["Bases", "Change Requests"],
1556
1612
  summary: "Create Change Request in Base",
1557
- successDescription: "Created change request for review."
1558
- }).input(createChangeRequestInputSchema.extend({ baseId: z.string() })).output(changeRequestSchema),
1613
+ successDescription: "Review-first by default: a pending ChangeRequest proposing the record (`materialized: false`). Returns the materialized record instead (`materialized: true`) when `autoMerge: true` is passed."
1614
+ }).input(createChangeRequestInputSchema.extend({ baseId: z.string() })).output(
1615
+ z.union([
1616
+ recordSchema.extend({ materialized: z.literal(true) }),
1617
+ changeRequestSchema.extend({ materialized: z.literal(false) })
1618
+ ])
1619
+ ),
1559
1620
  createBulkChangeRequest: oc.route({
1560
1621
  method: "POST",
1561
1622
  path: "/bases/{baseId}/records/bulk-change-request",
@@ -1826,6 +1887,9 @@ var docContract = {
1826
1887
  var driveContract = makeFileTreeContract("drives", "Drives");
1827
1888
  var DumpTableSchema = z.enum([
1828
1889
  "nodes",
1890
+ /** Node-level access grants (permissions). Not secret — restore must keep them
1891
+ * so a backed-up space's sharing/permission config survives a full restore. */
1892
+ "nodePrincipals",
1829
1893
  "bases",
1830
1894
  "baseFields",
1831
1895
  "views",
@@ -1855,12 +1919,36 @@ var ExportTablesVOSchema = z.object({
1855
1919
  rows: z.array(z.record(z.string(), z.unknown())),
1856
1920
  nextCursor: z.string().nullable()
1857
1921
  });
1922
+ var ExportAssetTextInputSchema = z.object({ assetId: z.string() });
1923
+ var ExportAssetTextVOSchema = z.object({
1924
+ assetId: z.string(),
1925
+ /** The row's `text_storage_key` — the exact key a restore must write back to. */
1926
+ textStorageKey: z.string(),
1927
+ /**
1928
+ * `null` when this row owns no separate text object and therefore needs no
1929
+ * blob in the archive:
1930
+ * - auto-registered text-kind rows (`writtenBy: "auto"`), whose
1931
+ * `textStorageKey` IS the owning attachment's own key — those bytes are
1932
+ * already archived by the attachment-blob pass, and re-archiving them
1933
+ * would duplicate bytes and collide on restore;
1934
+ * - `status: "none"` rows (no extractable text), whose key is `""`.
1935
+ */
1936
+ downloadUrl: z.string().nullable(),
1937
+ /** `sha256:<hex>` of the text bytes, so a backup can verify what it downloaded. */
1938
+ textContentHash: z.string().nullable(),
1939
+ byteCount: z.number().int().nonnegative()
1940
+ });
1858
1941
  var ImportBeginVOSchema = z.object({
1859
1942
  sessionId: z.string()
1860
1943
  });
1861
1944
  var ImportTablesInputSchema = z.object({
1862
1945
  sessionId: z.string(),
1863
- table: z.union([DumpTableSchema, z.literal("docBodies"), z.literal("attachmentBlobs")]),
1946
+ table: z.union([
1947
+ DumpTableSchema,
1948
+ z.literal("docBodies"),
1949
+ z.literal("attachmentBlobs"),
1950
+ z.literal("assetTextBlobs")
1951
+ ]),
1864
1952
  rows: z.array(z.record(z.string(), z.unknown()))
1865
1953
  });
1866
1954
  var ImportTablesVOSchema = z.object({
@@ -1886,6 +1974,13 @@ var dumpContract = {
1886
1974
  summary: "Export raw rows for one table (cursor-paginated)",
1887
1975
  successDescription: "A page of raw rows for the requested table (id-ordered), plus an opaque nextCursor (null at the end). Vault items and webhook secrets are never exportable through this endpoint."
1888
1976
  }).input(ExportTablesInputSchema).output(ExportTablesVOSchema),
1977
+ exportAssetText: oc.route({
1978
+ method: "GET",
1979
+ path: "/dump/export/asset-texts/{assetId}/content",
1980
+ tags: ["Dump"],
1981
+ summary: "Resolve the download URL for one asset's extracted-text object",
1982
+ successDescription: "A resolved download URL for the asset's DERIVED text blob (`asset-texts/blobs/sha256/\u2026`) plus its `textStorageKey` and `textContentHash`, so a backup can archive the exact bytes and verify them. `downloadUrl` is null when the row owns no separate object (auto-registered text-kind rows point at their attachment's own key, already covered by the attachment blobs; `status: \"none\"` rows have no text at all)."
1983
+ }).input(ExportAssetTextInputSchema).output(ExportAssetTextVOSchema),
1889
1984
  importBegin: oc.route({
1890
1985
  method: "POST",
1891
1986
  path: "/dump/import/begin",
@@ -1898,7 +1993,7 @@ var dumpContract = {
1898
1993
  path: "/dump/import/tables",
1899
1994
  tags: ["Dump"],
1900
1995
  summary: "Import a batch of raw rows into an open session",
1901
- successDescription: "Inserted rows preserving their original ids. `docBodies` is a pseudo-table ({nodeId, markdown}[]) written directly to object storage (doc bodies are not a DB row)."
1996
+ successDescription: "Inserted rows preserving their original ids. `docBodies` ({nodeId, markdown}[]), `attachmentBlobs` ({storageKey, mimeType, base64}[]) and `assetTextBlobs` ({textStorageKey, base64}[]) are pseudo-tables written directly to object storage (none of them are DB rows)."
1902
1997
  }).input(ImportTablesInputSchema).output(ImportTablesVOSchema),
1903
1998
  importCommit: oc.route({
1904
1999
  method: "POST",
@@ -2411,6 +2506,13 @@ var busabaseContractRoutes = {
2411
2506
  summary: "List node tree",
2412
2507
  successDescription: "Workspace node tree including folders, Bases, files, and agents. With no `parentId`/`depth`, returns the FULL tree (legacy behavior, still what every non-sidebar caller gets). Passing `parentId` and/or `depth` switches to a depth-bounded fetch: `parentId` omitted/null starts from the space root and returns it wrapped exactly like the legacy call (just depth-limited); an explicit `parentId` returns that node's children directly, ready to merge into its `NodeVO.children` for a sidebar's lazy per-folder expand. See `NodeVO.hasChildren` for how a depth boundary is surfaced."
2413
2508
  }).input(listNodesInputSchema).output(z.array(nodeSchema)),
2509
+ searchByName: oc.route({
2510
+ method: "GET",
2511
+ path: "/nodes/search",
2512
+ tags: ["Nodes", "Search"],
2513
+ summary: "Search nodes by name/slug (cheap, name-only quick-jump)",
2514
+ successDescription: "Plain ilike match on name/slug across every node type (folder/base/skill/drive/airapp/file/doc), scoped by the same node-visibility ACL as `nodes.list`. No content scan and no full-text ranking \u2014 ordered exact-slug-match first, then by name. Backs the dashboard search dialog's 'Recent' tab cache-miss path (see apps/busabase/content/spec/search-quick-jump.md); the heavier `search` endpoint remains the dedicated full-text content search."
2515
+ }).input(searchNodesByNameInputSchema).output(z.array(nodeSearchResultSchema)),
2414
2516
  isDescendant: oc.route({
2415
2517
  method: "GET",
2416
2518
  path: "/nodes/{nodeId}/is-descendant",
@@ -2445,7 +2547,69 @@ var busabaseContractRoutes = {
2445
2547
  tags: ["Nodes"],
2446
2548
  summary: "Permanently delete an archived node",
2447
2549
  successDescription: "Irreversibly removed an archived folder/doc/skill (and its subtree). Refused unless archived and refused if the subtree contains a Base."
2448
- }).input(z.object({ nodeId: z.string() })).output(z.object({ purged: z.boolean() }))
2550
+ }).input(z.object({ nodeId: z.string() })).output(z.object({ purged: z.boolean() })),
2551
+ updateVisibility: oc.route({
2552
+ method: "POST",
2553
+ path: "/nodes/{nodeId}/visibility",
2554
+ tags: ["Nodes", "Permissions"],
2555
+ summary: "Set a node's visibility (private / workspace / public)",
2556
+ successDescription: "Updated the node's own explicit visibility and re-materialized the subtree's effective visibility (a child can only ever be as open as its strictest ancestor). Requires `manage` level on the node. The workspace root cannot be made private. `public` currently behaves as `workspace` (no anonymous surface yet)."
2557
+ }).input(
2558
+ z.object({
2559
+ nodeId: z.string(),
2560
+ visibility: z.enum(["private", "workspace", "public"]).nullable()
2561
+ })
2562
+ ).output(z.object({ updated: z.boolean() })),
2563
+ toggleFavorite: oc.route({
2564
+ method: "POST",
2565
+ path: "/nodes/{nodeId}/favorite",
2566
+ tags: ["Nodes", "Favorites"],
2567
+ summary: "Toggle the current actor's favorite on a node",
2568
+ successDescription: "Upserted or deleted a row keyed by the (nodeId, actorId) unique pair \u2014 a true toggle, race-safe under a rapid double-click, never a duplicate. `favorited` reflects the node's new state for the acting user. Purely additive: never moves or hides the node from its real position in the Bases tree."
2569
+ }).input(z.object({ nodeId: z.string() })).output(z.object({ favorited: z.boolean() })),
2570
+ listFavorites: oc.route({
2571
+ method: "GET",
2572
+ path: "/nodes/favorites",
2573
+ tags: ["Nodes", "Favorites"],
2574
+ summary: "List the current actor's favorited nodes",
2575
+ successDescription: "The acting user's favorited nodes, newest-favorited first, filtered through the same archived/deleted/visibility rules as the main tree \u2014 a favorited node that's later archived, purged, or (cloud) hidden from this actor silently drops out rather than erroring."
2576
+ }).output(z.array(nodeSchema)),
2577
+ principals: {
2578
+ list: oc.route({
2579
+ method: "GET",
2580
+ path: "/nodes/{nodeId}/principals",
2581
+ tags: ["Nodes", "Permissions"],
2582
+ summary: "List a node's direct access grants",
2583
+ successDescription: "Direct grants defined ON this node (inherited copies from ancestor folders are not listed). Requires the node to be visible to the caller."
2584
+ }).input(z.object({ nodeId: z.string() })).output(z.array(nodePrincipalSchema)),
2585
+ add: oc.route({
2586
+ method: "POST",
2587
+ path: "/nodes/{nodeId}/principals",
2588
+ tags: ["Nodes", "Permissions"],
2589
+ summary: "Grant (or update) a principal's access level on a node",
2590
+ successDescription: "Upserted one direct grant (same principal twice updates its level) and re-materialized inherited copies down the subtree. Requires `manage` level on the node."
2591
+ }).input(
2592
+ z.object({
2593
+ nodeId: z.string(),
2594
+ principalType: z.enum(["user", "space"]),
2595
+ principalId: z.string().min(1),
2596
+ role: z.enum(["read", "changeRequest", "write", "manage"])
2597
+ })
2598
+ ).output(z.object({ granted: z.boolean() })),
2599
+ remove: oc.route({
2600
+ method: "DELETE",
2601
+ path: "/nodes/{nodeId}/principals",
2602
+ tags: ["Nodes", "Permissions"],
2603
+ summary: "Revoke a principal's access grant on a node",
2604
+ successDescription: "Removed the direct grant (and its materialized inherited copies). Requires `manage` level on the node."
2605
+ }).input(
2606
+ z.object({
2607
+ nodeId: z.string(),
2608
+ principalType: z.enum(["user", "space"]),
2609
+ principalId: z.string().min(1)
2610
+ })
2611
+ ).output(z.object({ removed: z.boolean() }))
2612
+ }
2449
2613
  },
2450
2614
  auditEvents: {
2451
2615
  list: oc.route({
@@ -2762,11 +2926,32 @@ function resolveConfig(config = {}) {
2762
2926
  fetch: config.fetch
2763
2927
  };
2764
2928
  }
2929
+ var decodeBusabaseError = (deserializedBody, response) => {
2930
+ if (!deserializedBody || typeof deserializedBody !== "object") {
2931
+ return void 0;
2932
+ }
2933
+ const body = deserializedBody;
2934
+ if (typeof body.error !== "string") {
2935
+ return void 0;
2936
+ }
2937
+ const code = typeof body.code === "string" ? body.code : `HTTP_${response.status}`;
2938
+ const issues = body.data?.issues;
2939
+ let message = body.error;
2940
+ if (Array.isArray(issues) && issues.length > 0) {
2941
+ const details = issues.map((issue) => {
2942
+ const path = Array.isArray(issue?.path) ? issue.path.join(".") : void 0;
2943
+ return path ? `${path}: ${issue?.message}` : String(issue?.message ?? issue);
2944
+ }).join("; ");
2945
+ message = `${message} \u2014 ${details}`;
2946
+ }
2947
+ return new ORPCError(code, { status: response.status, message, data: body.data });
2948
+ };
2765
2949
  function createBusabaseClient(config = {}) {
2766
2950
  const resolved = resolveConfig(config);
2767
2951
  const link = new OpenAPILink(cloudContract, {
2768
2952
  url: resolved.baseUrl,
2769
2953
  fetch: resolved.fetch,
2954
+ customErrorResponseBodyDecoder: decodeBusabaseError,
2770
2955
  headers: async () => {
2771
2956
  const extra = typeof resolved.headers === "function" ? await resolved.headers() : resolved.headers;
2772
2957
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "busabase-sdk",
3
- "version": "0.9.7",
3
+ "version": "0.9.9",
4
4
  "description": "Typed TypeScript/JavaScript SDK for the Busabase OpenAPI REST API. Talks to a local or remote `busabase server` (or Busabase Cloud).",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/busabase/busabase/tree/main/apps/busabase-sdk",
@@ -41,9 +41,9 @@
41
41
  "tsx": "^4.20.5",
42
42
  "typescript": "^5.9.3",
43
43
  "vitest": "^2.1.8",
44
+ "busabase-contract": "0.9.9",
44
45
  "open-domains": "0.0.2",
45
- "openlib": "0.1.1",
46
- "busabase-contract": "0.9.6"
46
+ "openlib": "0.1.1"
47
47
  },
48
48
  "engines": {
49
49
  "node": ">=24.18.0"