busabase-sdk 0.9.7 → 0.9.8
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 +391 -6
- package/dist/index.js +143 -8
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1405,6 +1405,71 @@ declare const cloudContract: {
|
|
|
1405
1405
|
}, z.core.$strip>, z.ZodObject<{
|
|
1406
1406
|
purged: z.ZodBoolean;
|
|
1407
1407
|
}, z.core.$strip>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
1408
|
+
updateVisibility: _orpc_contract.ContractProcedure<z.ZodObject<{
|
|
1409
|
+
nodeId: z.ZodString;
|
|
1410
|
+
visibility: z.ZodNullable<z.ZodEnum<{
|
|
1411
|
+
private: "private";
|
|
1412
|
+
workspace: "workspace";
|
|
1413
|
+
public: "public";
|
|
1414
|
+
}>>;
|
|
1415
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1416
|
+
updated: z.ZodBoolean;
|
|
1417
|
+
}, z.core.$strip>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
1418
|
+
toggleFavorite: _orpc_contract.ContractProcedure<z.ZodObject<{
|
|
1419
|
+
nodeId: z.ZodString;
|
|
1420
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1421
|
+
favorited: z.ZodBoolean;
|
|
1422
|
+
}, z.core.$strip>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
1423
|
+
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>>;
|
|
1424
|
+
principals: {
|
|
1425
|
+
list: _orpc_contract.ContractProcedure<z.ZodObject<{
|
|
1426
|
+
nodeId: z.ZodString;
|
|
1427
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
1428
|
+
id: z.ZodString;
|
|
1429
|
+
nodeId: z.ZodString;
|
|
1430
|
+
principalType: z.ZodEnum<{
|
|
1431
|
+
space: "space";
|
|
1432
|
+
user: "user";
|
|
1433
|
+
team: "team";
|
|
1434
|
+
}>;
|
|
1435
|
+
principalId: z.ZodString;
|
|
1436
|
+
role: z.ZodEnum<{
|
|
1437
|
+
read: "read";
|
|
1438
|
+
changeRequest: "changeRequest";
|
|
1439
|
+
write: "write";
|
|
1440
|
+
manage: "manage";
|
|
1441
|
+
}>;
|
|
1442
|
+
grantedBy: z.ZodString;
|
|
1443
|
+
createdAt: z.ZodString;
|
|
1444
|
+
updatedAt: z.ZodString;
|
|
1445
|
+
}, z.core.$strip>>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
1446
|
+
add: _orpc_contract.ContractProcedure<z.ZodObject<{
|
|
1447
|
+
nodeId: z.ZodString;
|
|
1448
|
+
principalType: z.ZodEnum<{
|
|
1449
|
+
space: "space";
|
|
1450
|
+
user: "user";
|
|
1451
|
+
}>;
|
|
1452
|
+
principalId: z.ZodString;
|
|
1453
|
+
role: z.ZodEnum<{
|
|
1454
|
+
read: "read";
|
|
1455
|
+
changeRequest: "changeRequest";
|
|
1456
|
+
write: "write";
|
|
1457
|
+
manage: "manage";
|
|
1458
|
+
}>;
|
|
1459
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1460
|
+
granted: z.ZodBoolean;
|
|
1461
|
+
}, z.core.$strip>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
1462
|
+
remove: _orpc_contract.ContractProcedure<z.ZodObject<{
|
|
1463
|
+
nodeId: z.ZodString;
|
|
1464
|
+
principalType: z.ZodEnum<{
|
|
1465
|
+
space: "space";
|
|
1466
|
+
user: "user";
|
|
1467
|
+
}>;
|
|
1468
|
+
principalId: z.ZodString;
|
|
1469
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1470
|
+
removed: z.ZodBoolean;
|
|
1471
|
+
}, z.core.$strip>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
1472
|
+
};
|
|
1408
1473
|
};
|
|
1409
1474
|
auditEvents: {
|
|
1410
1475
|
list: _orpc_contract.ContractProcedure<z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
@@ -3584,7 +3649,13 @@ declare const cloudContract: {
|
|
|
3584
3649
|
slug: z.ZodString;
|
|
3585
3650
|
name: z.ZodString;
|
|
3586
3651
|
description: z.ZodString;
|
|
3587
|
-
type: z.
|
|
3652
|
+
type: z.ZodEnum<{
|
|
3653
|
+
table: "table";
|
|
3654
|
+
gallery: "gallery";
|
|
3655
|
+
kanban: "kanban";
|
|
3656
|
+
calendar: "calendar";
|
|
3657
|
+
gantt: "gantt";
|
|
3658
|
+
}>;
|
|
3588
3659
|
config: z.ZodObject<{
|
|
3589
3660
|
filters: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
3590
3661
|
fieldSlug: z.ZodString;
|
|
@@ -3608,6 +3679,25 @@ declare const cloudContract: {
|
|
|
3608
3679
|
fieldId: z.ZodOptional<z.ZodString>;
|
|
3609
3680
|
}, z.core.$strip>>>;
|
|
3610
3681
|
visibleFieldSlugs: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
3682
|
+
coverFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
3683
|
+
coverFit: z.ZodOptional<z.ZodEnum<{
|
|
3684
|
+
cover: "cover";
|
|
3685
|
+
fit: "fit";
|
|
3686
|
+
}>>;
|
|
3687
|
+
cardSize: z.ZodOptional<z.ZodEnum<{
|
|
3688
|
+
small: "small";
|
|
3689
|
+
medium: "medium";
|
|
3690
|
+
large: "large";
|
|
3691
|
+
}>>;
|
|
3692
|
+
showFieldLabels: z.ZodOptional<z.ZodBoolean>;
|
|
3693
|
+
stackByFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
3694
|
+
dateFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
3695
|
+
startFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
3696
|
+
endFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
3697
|
+
ganttScale: z.ZodOptional<z.ZodEnum<{
|
|
3698
|
+
week: "week";
|
|
3699
|
+
month: "month";
|
|
3700
|
+
}>>;
|
|
3611
3701
|
}, z.core.$strip>;
|
|
3612
3702
|
status: z.ZodEnum<{
|
|
3613
3703
|
archived: "archived";
|
|
@@ -3633,7 +3723,13 @@ declare const cloudContract: {
|
|
|
3633
3723
|
slug: z.ZodString;
|
|
3634
3724
|
name: z.ZodString;
|
|
3635
3725
|
description: z.ZodString;
|
|
3636
|
-
type: z.
|
|
3726
|
+
type: z.ZodEnum<{
|
|
3727
|
+
table: "table";
|
|
3728
|
+
gallery: "gallery";
|
|
3729
|
+
kanban: "kanban";
|
|
3730
|
+
calendar: "calendar";
|
|
3731
|
+
gantt: "gantt";
|
|
3732
|
+
}>;
|
|
3637
3733
|
config: z.ZodObject<{
|
|
3638
3734
|
filters: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
3639
3735
|
fieldSlug: z.ZodString;
|
|
@@ -3657,6 +3753,25 @@ declare const cloudContract: {
|
|
|
3657
3753
|
fieldId: z.ZodOptional<z.ZodString>;
|
|
3658
3754
|
}, z.core.$strip>>>;
|
|
3659
3755
|
visibleFieldSlugs: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
3756
|
+
coverFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
3757
|
+
coverFit: z.ZodOptional<z.ZodEnum<{
|
|
3758
|
+
cover: "cover";
|
|
3759
|
+
fit: "fit";
|
|
3760
|
+
}>>;
|
|
3761
|
+
cardSize: z.ZodOptional<z.ZodEnum<{
|
|
3762
|
+
small: "small";
|
|
3763
|
+
medium: "medium";
|
|
3764
|
+
large: "large";
|
|
3765
|
+
}>>;
|
|
3766
|
+
showFieldLabels: z.ZodOptional<z.ZodBoolean>;
|
|
3767
|
+
stackByFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
3768
|
+
dateFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
3769
|
+
startFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
3770
|
+
endFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
3771
|
+
ganttScale: z.ZodOptional<z.ZodEnum<{
|
|
3772
|
+
week: "week";
|
|
3773
|
+
month: "month";
|
|
3774
|
+
}>>;
|
|
3660
3775
|
}, z.core.$strip>;
|
|
3661
3776
|
status: z.ZodEnum<{
|
|
3662
3777
|
archived: "archived";
|
|
@@ -4600,7 +4715,180 @@ declare const cloudContract: {
|
|
|
4600
4715
|
message: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
4601
4716
|
submittedBy: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
4602
4717
|
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
4718
|
+
autoMerge: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
4719
|
+
baseId: z.ZodString;
|
|
4720
|
+
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
|
|
4721
|
+
id: z.ZodString;
|
|
4603
4722
|
baseId: z.ZodString;
|
|
4723
|
+
headCommitId: z.ZodString;
|
|
4724
|
+
parentRecordId: z.ZodNullable<z.ZodString>;
|
|
4725
|
+
parentCommitId: z.ZodNullable<z.ZodString>;
|
|
4726
|
+
status: z.ZodEnum<{
|
|
4727
|
+
archived: "archived";
|
|
4728
|
+
active: "active";
|
|
4729
|
+
}>;
|
|
4730
|
+
createdBy: z.ZodString;
|
|
4731
|
+
createdByUser: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
4732
|
+
id: z.ZodString;
|
|
4733
|
+
name: z.ZodNullable<z.ZodString>;
|
|
4734
|
+
email: z.ZodNullable<z.ZodString>;
|
|
4735
|
+
image: z.ZodNullable<z.ZodString>;
|
|
4736
|
+
role: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
4737
|
+
}, z.core.$strip>>>>;
|
|
4738
|
+
archivedAt: z.ZodNullable<z.ZodString>;
|
|
4739
|
+
createdAt: z.ZodString;
|
|
4740
|
+
updatedAt: z.ZodString;
|
|
4741
|
+
base: z.ZodObject<{
|
|
4742
|
+
id: z.ZodString;
|
|
4743
|
+
nodeId: z.ZodString;
|
|
4744
|
+
slug: z.ZodString;
|
|
4745
|
+
name: z.ZodString;
|
|
4746
|
+
description: z.ZodString;
|
|
4747
|
+
reviewPolicy: z.ZodObject<{
|
|
4748
|
+
kind: z.ZodLiteral<"single">;
|
|
4749
|
+
requiredApprovals: z.ZodNumber;
|
|
4750
|
+
}, z.core.$strip>;
|
|
4751
|
+
createdAt: z.ZodString;
|
|
4752
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
4753
|
+
id: z.ZodString;
|
|
4754
|
+
baseId: z.ZodString;
|
|
4755
|
+
slug: z.ZodString;
|
|
4756
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodEnum<{
|
|
4757
|
+
en: "en";
|
|
4758
|
+
"zh-CN": "zh-CN";
|
|
4759
|
+
"zh-TW": "zh-TW";
|
|
4760
|
+
ja: "ja";
|
|
4761
|
+
ko: "ko";
|
|
4762
|
+
de: "de";
|
|
4763
|
+
fr: "fr";
|
|
4764
|
+
es: "es";
|
|
4765
|
+
pt: "pt";
|
|
4766
|
+
}> & z.core.$partial, z.ZodString>]>;
|
|
4767
|
+
type: z.ZodEnum<{
|
|
4768
|
+
number: "number";
|
|
4769
|
+
email: "email";
|
|
4770
|
+
date: "date";
|
|
4771
|
+
text: "text";
|
|
4772
|
+
longtext: "longtext";
|
|
4773
|
+
markdown: "markdown";
|
|
4774
|
+
html: "html";
|
|
4775
|
+
attachment: "attachment";
|
|
4776
|
+
relation: "relation";
|
|
4777
|
+
checkbox: "checkbox";
|
|
4778
|
+
select: "select";
|
|
4779
|
+
multiselect: "multiselect";
|
|
4780
|
+
url: "url";
|
|
4781
|
+
embed: "embed";
|
|
4782
|
+
phone: "phone";
|
|
4783
|
+
created_time: "created_time";
|
|
4784
|
+
updated_time: "updated_time";
|
|
4785
|
+
created_by: "created_by";
|
|
4786
|
+
updated_by: "updated_by";
|
|
4787
|
+
auto_number: "auto_number";
|
|
4788
|
+
ai_summary: "ai_summary";
|
|
4789
|
+
ai_tags: "ai_tags";
|
|
4790
|
+
code: "code";
|
|
4791
|
+
json: "json";
|
|
4792
|
+
yaml: "yaml";
|
|
4793
|
+
}>;
|
|
4794
|
+
required: z.ZodBoolean;
|
|
4795
|
+
position: z.ZodNumber;
|
|
4796
|
+
options: z.ZodDefault<z.ZodObject<{
|
|
4797
|
+
ai: z.ZodOptional<z.ZodObject<{
|
|
4798
|
+
model: z.ZodOptional<z.ZodString>;
|
|
4799
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
4800
|
+
reviewRequired: z.ZodOptional<z.ZodBoolean>;
|
|
4801
|
+
sourceFieldIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
4802
|
+
}, z.core.$strip>>;
|
|
4803
|
+
attachment: z.ZodOptional<z.ZodObject<{
|
|
4804
|
+
maxFiles: z.ZodOptional<z.ZodNumber>;
|
|
4805
|
+
allowedMimeTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
4806
|
+
maxFileSize: z.ZodOptional<z.ZodNumber>;
|
|
4807
|
+
}, z.core.$strip>>;
|
|
4808
|
+
choices: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
4809
|
+
color: z.ZodOptional<z.ZodString>;
|
|
4810
|
+
id: z.ZodString;
|
|
4811
|
+
name: z.ZodString;
|
|
4812
|
+
}, z.core.$strip>>>;
|
|
4813
|
+
code: z.ZodOptional<z.ZodObject<{
|
|
4814
|
+
language: z.ZodOptional<z.ZodString>;
|
|
4815
|
+
}, z.core.$strip>>;
|
|
4816
|
+
embed: z.ZodOptional<z.ZodObject<{
|
|
4817
|
+
aspectRatio: z.ZodOptional<z.ZodEnum<{
|
|
4818
|
+
"16:9": "16:9";
|
|
4819
|
+
"4:3": "4:3";
|
|
4820
|
+
"1:1": "1:1";
|
|
4821
|
+
}>>;
|
|
4822
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
4823
|
+
providers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
4824
|
+
}, z.core.$strip>>;
|
|
4825
|
+
inverseFieldId: z.ZodOptional<z.ZodString>;
|
|
4826
|
+
multiple: z.ZodOptional<z.ZodBoolean>;
|
|
4827
|
+
number: z.ZodOptional<z.ZodObject<{
|
|
4828
|
+
format: z.ZodOptional<z.ZodEnum<{
|
|
4829
|
+
plain: "plain";
|
|
4830
|
+
currency: "currency";
|
|
4831
|
+
}>>;
|
|
4832
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
4833
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
4834
|
+
}, z.core.$strip>>;
|
|
4835
|
+
targetBaseId: z.ZodOptional<z.ZodString>;
|
|
4836
|
+
targetBaseSlug: z.ZodOptional<z.ZodString>;
|
|
4837
|
+
}, z.core.$strip>>;
|
|
4838
|
+
}, z.core.$strip>>;
|
|
4839
|
+
}, z.core.$strip>;
|
|
4840
|
+
headCommit: z.ZodObject<{
|
|
4841
|
+
id: z.ZodString;
|
|
4842
|
+
baseId: z.ZodNullable<z.ZodString>;
|
|
4843
|
+
targetType: z.ZodEnum<{
|
|
4844
|
+
base: "base";
|
|
4845
|
+
node: "node";
|
|
4846
|
+
}>;
|
|
4847
|
+
nodeId: z.ZodNullable<z.ZodString>;
|
|
4848
|
+
operationId: z.ZodNullable<z.ZodString>;
|
|
4849
|
+
parentCommitId: z.ZodNullable<z.ZodString>;
|
|
4850
|
+
fields: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
4851
|
+
operation: z.ZodEnum<{
|
|
4852
|
+
[x: `${string}_file_create`]: `${string}_file_create`;
|
|
4853
|
+
[x: `${string}_file_update`]: `${string}_file_update`;
|
|
4854
|
+
[x: `${string}_file_delete`]: `${string}_file_delete`;
|
|
4855
|
+
[x: `${string}_metadata_update`]: `${string}_metadata_update`;
|
|
4856
|
+
record_create: "record_create";
|
|
4857
|
+
record_update: "record_update";
|
|
4858
|
+
record_delete: "record_delete";
|
|
4859
|
+
record_variant: "record_variant";
|
|
4860
|
+
view_create: "view_create";
|
|
4861
|
+
view_update: "view_update";
|
|
4862
|
+
view_delete: "view_delete";
|
|
4863
|
+
view_restore: "view_restore";
|
|
4864
|
+
base_add_field: "base_add_field";
|
|
4865
|
+
base_delete_field: "base_delete_field";
|
|
4866
|
+
base_update_field: "base_update_field";
|
|
4867
|
+
base_convert_field: "base_convert_field";
|
|
4868
|
+
base_reorder_fields: "base_reorder_fields";
|
|
4869
|
+
base_restore_field: "base_restore_field";
|
|
4870
|
+
base_archive: "base_archive";
|
|
4871
|
+
base_restore: "base_restore";
|
|
4872
|
+
record_restore: "record_restore";
|
|
4873
|
+
doc_update: "doc_update";
|
|
4874
|
+
node_create: "node_create";
|
|
4875
|
+
node_rename: "node_rename";
|
|
4876
|
+
node_delete: "node_delete";
|
|
4877
|
+
node_restore: "node_restore";
|
|
4878
|
+
node_move: "node_move";
|
|
4879
|
+
}>;
|
|
4880
|
+
message: z.ZodString;
|
|
4881
|
+
author: z.ZodString;
|
|
4882
|
+
authorUser: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
4883
|
+
id: z.ZodString;
|
|
4884
|
+
name: z.ZodNullable<z.ZodString>;
|
|
4885
|
+
email: z.ZodNullable<z.ZodString>;
|
|
4886
|
+
image: z.ZodNullable<z.ZodString>;
|
|
4887
|
+
role: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
4888
|
+
}, z.core.$strip>>>>;
|
|
4889
|
+
createdAt: z.ZodString;
|
|
4890
|
+
}, z.core.$strip>;
|
|
4891
|
+
materialized: z.ZodLiteral<true>;
|
|
4604
4892
|
}, z.core.$strip>, z.ZodObject<{
|
|
4605
4893
|
id: z.ZodString;
|
|
4606
4894
|
baseId: z.ZodNullable<z.ZodString>;
|
|
@@ -4978,7 +5266,8 @@ declare const cloudContract: {
|
|
|
4978
5266
|
visibleOperationHeads: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
4979
5267
|
createdAt: z.ZodString;
|
|
4980
5268
|
}, z.core.$strip>>;
|
|
4981
|
-
|
|
5269
|
+
materialized: z.ZodLiteral<false>;
|
|
5270
|
+
}, z.core.$strip>]>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
4982
5271
|
createBulkChangeRequest: _orpc_contract.ContractProcedure<z.ZodObject<{
|
|
4983
5272
|
records: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
4984
5273
|
message: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
@@ -6034,10 +6323,36 @@ declare const cloudContract: {
|
|
|
6034
6323
|
fieldId: z.ZodOptional<z.ZodString>;
|
|
6035
6324
|
}, z.core.$strip>>>;
|
|
6036
6325
|
visibleFieldSlugs: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
6326
|
+
coverFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
6327
|
+
coverFit: z.ZodOptional<z.ZodEnum<{
|
|
6328
|
+
cover: "cover";
|
|
6329
|
+
fit: "fit";
|
|
6330
|
+
}>>;
|
|
6331
|
+
cardSize: z.ZodOptional<z.ZodEnum<{
|
|
6332
|
+
small: "small";
|
|
6333
|
+
medium: "medium";
|
|
6334
|
+
large: "large";
|
|
6335
|
+
}>>;
|
|
6336
|
+
showFieldLabels: z.ZodOptional<z.ZodBoolean>;
|
|
6337
|
+
stackByFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
6338
|
+
dateFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
6339
|
+
startFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
6340
|
+
endFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
6341
|
+
ganttScale: z.ZodOptional<z.ZodEnum<{
|
|
6342
|
+
week: "week";
|
|
6343
|
+
month: "month";
|
|
6344
|
+
}>>;
|
|
6037
6345
|
}, z.core.$strip>>>;
|
|
6038
6346
|
description: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
6039
6347
|
message: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
6040
6348
|
name: z.ZodString;
|
|
6349
|
+
type: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
6350
|
+
table: "table";
|
|
6351
|
+
gallery: "gallery";
|
|
6352
|
+
kanban: "kanban";
|
|
6353
|
+
calendar: "calendar";
|
|
6354
|
+
gantt: "gantt";
|
|
6355
|
+
}>>>;
|
|
6041
6356
|
slug: z.ZodOptional<z.ZodString>;
|
|
6042
6357
|
submittedBy: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
6043
6358
|
baseId: z.ZodString;
|
|
@@ -11057,6 +11372,10 @@ declare const cloudContract: {
|
|
|
11057
11372
|
runLocalNode: _orpc_contract.ContractProcedure<z.ZodObject<{
|
|
11058
11373
|
nodeId: z.ZodString;
|
|
11059
11374
|
files: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
11375
|
+
engine: z.ZodDefault<z.ZodEnum<{
|
|
11376
|
+
"local-node": "local-node";
|
|
11377
|
+
srt: "srt";
|
|
11378
|
+
}>>;
|
|
11060
11379
|
}, z.core.$strip>, _orpc_contract.Schema<AsyncIteratorObject<{
|
|
11061
11380
|
type: "log";
|
|
11062
11381
|
line: string;
|
|
@@ -14393,6 +14712,7 @@ declare const cloudContract: {
|
|
|
14393
14712
|
comments: "comments";
|
|
14394
14713
|
bases: "bases";
|
|
14395
14714
|
assets: "assets";
|
|
14715
|
+
nodePrincipals: "nodePrincipals";
|
|
14396
14716
|
views: "views";
|
|
14397
14717
|
fieldValues: "fieldValues";
|
|
14398
14718
|
recordLinks: "recordLinks";
|
|
@@ -14423,6 +14743,7 @@ declare const cloudContract: {
|
|
|
14423
14743
|
comments: "comments";
|
|
14424
14744
|
bases: "bases";
|
|
14425
14745
|
assets: "assets";
|
|
14746
|
+
nodePrincipals: "nodePrincipals";
|
|
14426
14747
|
views: "views";
|
|
14427
14748
|
fieldValues: "fieldValues";
|
|
14428
14749
|
recordLinks: "recordLinks";
|
|
@@ -16952,7 +17273,13 @@ declare const cloudContract: {
|
|
|
16952
17273
|
slug: z.ZodString;
|
|
16953
17274
|
name: z.ZodString;
|
|
16954
17275
|
description: z.ZodString;
|
|
16955
|
-
type: z.
|
|
17276
|
+
type: z.ZodEnum<{
|
|
17277
|
+
table: "table";
|
|
17278
|
+
gallery: "gallery";
|
|
17279
|
+
kanban: "kanban";
|
|
17280
|
+
calendar: "calendar";
|
|
17281
|
+
gantt: "gantt";
|
|
17282
|
+
}>;
|
|
16956
17283
|
config: z.ZodObject<{
|
|
16957
17284
|
filters: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
16958
17285
|
fieldSlug: z.ZodString;
|
|
@@ -16976,6 +17303,25 @@ declare const cloudContract: {
|
|
|
16976
17303
|
fieldId: z.ZodOptional<z.ZodString>;
|
|
16977
17304
|
}, z.core.$strip>>>;
|
|
16978
17305
|
visibleFieldSlugs: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
17306
|
+
coverFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
17307
|
+
coverFit: z.ZodOptional<z.ZodEnum<{
|
|
17308
|
+
cover: "cover";
|
|
17309
|
+
fit: "fit";
|
|
17310
|
+
}>>;
|
|
17311
|
+
cardSize: z.ZodOptional<z.ZodEnum<{
|
|
17312
|
+
small: "small";
|
|
17313
|
+
medium: "medium";
|
|
17314
|
+
large: "large";
|
|
17315
|
+
}>>;
|
|
17316
|
+
showFieldLabels: z.ZodOptional<z.ZodBoolean>;
|
|
17317
|
+
stackByFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
17318
|
+
dateFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
17319
|
+
startFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
17320
|
+
endFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
17321
|
+
ganttScale: z.ZodOptional<z.ZodEnum<{
|
|
17322
|
+
week: "week";
|
|
17323
|
+
month: "month";
|
|
17324
|
+
}>>;
|
|
16979
17325
|
}, z.core.$strip>;
|
|
16980
17326
|
status: z.ZodEnum<{
|
|
16981
17327
|
archived: "archived";
|
|
@@ -19694,10 +20040,36 @@ declare const cloudContract: {
|
|
|
19694
20040
|
fieldId: z.ZodOptional<z.ZodString>;
|
|
19695
20041
|
}, z.core.$strip>>>;
|
|
19696
20042
|
visibleFieldSlugs: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
20043
|
+
coverFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
20044
|
+
coverFit: z.ZodOptional<z.ZodEnum<{
|
|
20045
|
+
cover: "cover";
|
|
20046
|
+
fit: "fit";
|
|
20047
|
+
}>>;
|
|
20048
|
+
cardSize: z.ZodOptional<z.ZodEnum<{
|
|
20049
|
+
small: "small";
|
|
20050
|
+
medium: "medium";
|
|
20051
|
+
large: "large";
|
|
20052
|
+
}>>;
|
|
20053
|
+
showFieldLabels: z.ZodOptional<z.ZodBoolean>;
|
|
20054
|
+
stackByFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
20055
|
+
dateFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
20056
|
+
startFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
20057
|
+
endFieldSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
20058
|
+
ganttScale: z.ZodOptional<z.ZodEnum<{
|
|
20059
|
+
week: "week";
|
|
20060
|
+
month: "month";
|
|
20061
|
+
}>>;
|
|
19697
20062
|
}, z.core.$strip>>;
|
|
19698
20063
|
description: z.ZodOptional<z.ZodString>;
|
|
19699
20064
|
message: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
19700
20065
|
name: z.ZodOptional<z.ZodString>;
|
|
20066
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
20067
|
+
table: "table";
|
|
20068
|
+
gallery: "gallery";
|
|
20069
|
+
kanban: "kanban";
|
|
20070
|
+
calendar: "calendar";
|
|
20071
|
+
gantt: "gantt";
|
|
20072
|
+
}>>;
|
|
19701
20073
|
submittedBy: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
19702
20074
|
viewId: z.ZodString;
|
|
19703
20075
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -21067,10 +21439,23 @@ interface ViewSortVO {
|
|
|
21067
21439
|
fieldSlug: string;
|
|
21068
21440
|
fieldId?: string;
|
|
21069
21441
|
}
|
|
21442
|
+
type ViewType = "table" | "gallery" | "kanban" | "calendar" | "gantt";
|
|
21443
|
+
type GalleryCoverFit = "cover" | "fit";
|
|
21444
|
+
type GalleryCardSize = "small" | "medium" | "large";
|
|
21445
|
+
type GanttScale = "week" | "month";
|
|
21070
21446
|
interface ViewConfigVO {
|
|
21071
21447
|
filters: ViewFilterVO[];
|
|
21072
21448
|
sorts: ViewSortVO[];
|
|
21073
21449
|
visibleFieldSlugs?: string[] | null;
|
|
21450
|
+
coverFieldSlug?: string | null;
|
|
21451
|
+
coverFit?: GalleryCoverFit;
|
|
21452
|
+
cardSize?: GalleryCardSize;
|
|
21453
|
+
showFieldLabels?: boolean;
|
|
21454
|
+
stackByFieldSlug?: string | null;
|
|
21455
|
+
dateFieldSlug?: string | null;
|
|
21456
|
+
startFieldSlug?: string | null;
|
|
21457
|
+
endFieldSlug?: string | null;
|
|
21458
|
+
ganttScale?: GanttScale;
|
|
21074
21459
|
}
|
|
21075
21460
|
interface ViewVO {
|
|
21076
21461
|
id: string;
|
|
@@ -21078,7 +21463,7 @@ interface ViewVO {
|
|
|
21078
21463
|
slug: string;
|
|
21079
21464
|
name: string;
|
|
21080
21465
|
description: string;
|
|
21081
|
-
type:
|
|
21466
|
+
type: ViewType;
|
|
21082
21467
|
config: ViewConfigVO;
|
|
21083
21468
|
status: "active" | "archived";
|
|
21084
21469
|
createdBy: string;
|
|
@@ -22966,4 +23351,4 @@ declare class Busabase {
|
|
|
22966
23351
|
}>>>>;
|
|
22967
23352
|
}
|
|
22968
23353
|
|
|
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 };
|
|
23354
|
+
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 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(
|
|
@@ -986,7 +996,13 @@ var airAppRunLocalNodeInputSchema = z.object({
|
|
|
986
996
|
nodeId: z.string(),
|
|
987
997
|
/** Text files to mount into the sandbox workdir before installing, keyed by
|
|
988
998
|
* path (same shape `RunPanel` already assembles for `NodepodRunner.mount`). */
|
|
989
|
-
files: z.record(z.string(), z.string())
|
|
999
|
+
files: z.record(z.string(), z.string()),
|
|
1000
|
+
/** Server-side execution mode. `"local-node"` spawns a bare host Node.js
|
|
1001
|
+
* process (previewable, data bridge via reverse proxy, NOT OS-isolated);
|
|
1002
|
+
* `"srt"` wraps the same commands in the OS sandbox (isolated execution,
|
|
1003
|
+
* but live preview is unreachable). `"nodepod"` never calls this endpoint —
|
|
1004
|
+
* it runs entirely in-browser. */
|
|
1005
|
+
engine: z.enum(["local-node", "srt"]).default("local-node")
|
|
990
1006
|
});
|
|
991
1007
|
var airAppRuntimeEventSchema = z.discriminatedUnion("type", [
|
|
992
1008
|
z.object({ type: z.literal("log"), line: z.string() }),
|
|
@@ -1335,10 +1351,30 @@ var viewSortSchema = z.object({
|
|
|
1335
1351
|
fieldSlug: z.string(),
|
|
1336
1352
|
fieldId: z.string().optional()
|
|
1337
1353
|
});
|
|
1354
|
+
var viewTypeSchema = z.enum(["table", "gallery", "kanban", "calendar", "gantt"]);
|
|
1355
|
+
var ganttScaleSchema = z.enum(["week", "month"]);
|
|
1356
|
+
var galleryCoverFitSchema = z.enum(["cover", "fit"]);
|
|
1357
|
+
var galleryCardSizeSchema = z.enum(["small", "medium", "large"]);
|
|
1338
1358
|
var viewConfigSchema = z.object({
|
|
1339
1359
|
filters: z.array(viewFilterSchema).default([]),
|
|
1340
1360
|
sorts: z.array(viewSortSchema).default([]),
|
|
1341
|
-
visibleFieldSlugs: z.array(z.string()).nullable().optional()
|
|
1361
|
+
visibleFieldSlugs: z.array(z.string()).nullable().optional(),
|
|
1362
|
+
// ── Gallery-only presentation config (ignored by table views) ──
|
|
1363
|
+
// Which attachment field supplies the cover image (null = no cover).
|
|
1364
|
+
coverFieldSlug: z.string().nullable().optional(),
|
|
1365
|
+
coverFit: galleryCoverFitSchema.optional(),
|
|
1366
|
+
cardSize: galleryCardSizeSchema.optional(),
|
|
1367
|
+
// Whether to render the field label above each value on a card.
|
|
1368
|
+
showFieldLabels: z.boolean().optional(),
|
|
1369
|
+
// ── Kanban-only: which single-select field stacks records into columns.
|
|
1370
|
+
stackByFieldSlug: z.string().nullable().optional(),
|
|
1371
|
+
// ── Calendar-only: which date field positions records on the month grid.
|
|
1372
|
+
dateFieldSlug: z.string().nullable().optional(),
|
|
1373
|
+
// ── Gantt-only: the start/end date fields bounding each record's bar, plus
|
|
1374
|
+
// the time-axis granularity.
|
|
1375
|
+
startFieldSlug: z.string().nullable().optional(),
|
|
1376
|
+
endFieldSlug: z.string().nullable().optional(),
|
|
1377
|
+
ganttScale: ganttScaleSchema.optional()
|
|
1342
1378
|
});
|
|
1343
1379
|
var viewSchema = z.object({
|
|
1344
1380
|
id: z.string(),
|
|
@@ -1346,7 +1382,7 @@ var viewSchema = z.object({
|
|
|
1346
1382
|
slug: z.string(),
|
|
1347
1383
|
name: z.string(),
|
|
1348
1384
|
description: z.string(),
|
|
1349
|
-
type:
|
|
1385
|
+
type: viewTypeSchema,
|
|
1350
1386
|
config: viewConfigSchema,
|
|
1351
1387
|
status: z.enum(["active", "archived"]),
|
|
1352
1388
|
createdBy: z.string(),
|
|
@@ -1360,6 +1396,7 @@ var createViewInputSchema = z.object({
|
|
|
1360
1396
|
description: z.string().optional().default(""),
|
|
1361
1397
|
message: z.string().optional().default("Create view"),
|
|
1362
1398
|
name: z.string().min(1),
|
|
1399
|
+
type: viewTypeSchema.optional().default("table"),
|
|
1363
1400
|
slug: z.string().min(1).regex(/^[a-z0-9-]+$/).optional(),
|
|
1364
1401
|
submittedBy: z.string().optional().default("local-producer")
|
|
1365
1402
|
});
|
|
@@ -1368,6 +1405,7 @@ var updateViewInputSchema = z.object({
|
|
|
1368
1405
|
description: z.string().optional(),
|
|
1369
1406
|
message: z.string().optional().default("Update view"),
|
|
1370
1407
|
name: z.string().min(1).optional(),
|
|
1408
|
+
type: viewTypeSchema.optional(),
|
|
1371
1409
|
submittedBy: z.string().optional().default("local-producer")
|
|
1372
1410
|
});
|
|
1373
1411
|
var deleteViewInputSchema = z.object({
|
|
@@ -1443,7 +1481,13 @@ var createChangeRequestInputSchema = z.object({
|
|
|
1443
1481
|
submittedBy: z.string().optional().default("local-producer"),
|
|
1444
1482
|
idempotencyKey: z.string().optional().describe(
|
|
1445
1483
|
"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
|
-
)
|
|
1484
|
+
),
|
|
1485
|
+
// Review-first by default: without `autoMerge: true`, this proposes the record
|
|
1486
|
+
// as a pending ChangeRequest (status "in_review") instead of creating it
|
|
1487
|
+
// immediately. Pass `autoMerge: true` only for callers that don't need human
|
|
1488
|
+
// review — approves and merges the change request right away, returning the
|
|
1489
|
+
// materialized record instead of the pending ChangeRequest.
|
|
1490
|
+
autoMerge: z.boolean().optional().default(false)
|
|
1447
1491
|
});
|
|
1448
1492
|
var createBulkChangeRequestInputSchema = z.object({
|
|
1449
1493
|
records: z.array(z.record(z.string(), z.unknown())).min(1).max(1e3).describe(
|
|
@@ -1554,8 +1598,13 @@ var baseContract = {
|
|
|
1554
1598
|
path: "/bases/{baseId}/change-requests",
|
|
1555
1599
|
tags: ["Bases", "Change Requests"],
|
|
1556
1600
|
summary: "Create Change Request in Base",
|
|
1557
|
-
successDescription: "
|
|
1558
|
-
}).input(createChangeRequestInputSchema.extend({ baseId: z.string() })).output(
|
|
1601
|
+
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."
|
|
1602
|
+
}).input(createChangeRequestInputSchema.extend({ baseId: z.string() })).output(
|
|
1603
|
+
z.union([
|
|
1604
|
+
recordSchema.extend({ materialized: z.literal(true) }),
|
|
1605
|
+
changeRequestSchema.extend({ materialized: z.literal(false) })
|
|
1606
|
+
])
|
|
1607
|
+
),
|
|
1559
1608
|
createBulkChangeRequest: oc.route({
|
|
1560
1609
|
method: "POST",
|
|
1561
1610
|
path: "/bases/{baseId}/records/bulk-change-request",
|
|
@@ -1826,6 +1875,9 @@ var docContract = {
|
|
|
1826
1875
|
var driveContract = makeFileTreeContract("drives", "Drives");
|
|
1827
1876
|
var DumpTableSchema = z.enum([
|
|
1828
1877
|
"nodes",
|
|
1878
|
+
/** Node-level access grants (permissions). Not secret — restore must keep them
|
|
1879
|
+
* so a backed-up space's sharing/permission config survives a full restore. */
|
|
1880
|
+
"nodePrincipals",
|
|
1829
1881
|
"bases",
|
|
1830
1882
|
"baseFields",
|
|
1831
1883
|
"views",
|
|
@@ -2445,7 +2497,69 @@ var busabaseContractRoutes = {
|
|
|
2445
2497
|
tags: ["Nodes"],
|
|
2446
2498
|
summary: "Permanently delete an archived node",
|
|
2447
2499
|
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() }))
|
|
2500
|
+
}).input(z.object({ nodeId: z.string() })).output(z.object({ purged: z.boolean() })),
|
|
2501
|
+
updateVisibility: oc.route({
|
|
2502
|
+
method: "POST",
|
|
2503
|
+
path: "/nodes/{nodeId}/visibility",
|
|
2504
|
+
tags: ["Nodes", "Permissions"],
|
|
2505
|
+
summary: "Set a node's visibility (private / workspace / public)",
|
|
2506
|
+
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)."
|
|
2507
|
+
}).input(
|
|
2508
|
+
z.object({
|
|
2509
|
+
nodeId: z.string(),
|
|
2510
|
+
visibility: z.enum(["private", "workspace", "public"]).nullable()
|
|
2511
|
+
})
|
|
2512
|
+
).output(z.object({ updated: z.boolean() })),
|
|
2513
|
+
toggleFavorite: oc.route({
|
|
2514
|
+
method: "POST",
|
|
2515
|
+
path: "/nodes/{nodeId}/favorite",
|
|
2516
|
+
tags: ["Nodes", "Favorites"],
|
|
2517
|
+
summary: "Toggle the current actor's favorite on a node",
|
|
2518
|
+
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."
|
|
2519
|
+
}).input(z.object({ nodeId: z.string() })).output(z.object({ favorited: z.boolean() })),
|
|
2520
|
+
listFavorites: oc.route({
|
|
2521
|
+
method: "GET",
|
|
2522
|
+
path: "/nodes/favorites",
|
|
2523
|
+
tags: ["Nodes", "Favorites"],
|
|
2524
|
+
summary: "List the current actor's favorited nodes",
|
|
2525
|
+
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."
|
|
2526
|
+
}).output(z.array(nodeSchema)),
|
|
2527
|
+
principals: {
|
|
2528
|
+
list: oc.route({
|
|
2529
|
+
method: "GET",
|
|
2530
|
+
path: "/nodes/{nodeId}/principals",
|
|
2531
|
+
tags: ["Nodes", "Permissions"],
|
|
2532
|
+
summary: "List a node's direct access grants",
|
|
2533
|
+
successDescription: "Direct grants defined ON this node (inherited copies from ancestor folders are not listed). Requires the node to be visible to the caller."
|
|
2534
|
+
}).input(z.object({ nodeId: z.string() })).output(z.array(nodePrincipalSchema)),
|
|
2535
|
+
add: oc.route({
|
|
2536
|
+
method: "POST",
|
|
2537
|
+
path: "/nodes/{nodeId}/principals",
|
|
2538
|
+
tags: ["Nodes", "Permissions"],
|
|
2539
|
+
summary: "Grant (or update) a principal's access level on a node",
|
|
2540
|
+
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."
|
|
2541
|
+
}).input(
|
|
2542
|
+
z.object({
|
|
2543
|
+
nodeId: z.string(),
|
|
2544
|
+
principalType: z.enum(["user", "space"]),
|
|
2545
|
+
principalId: z.string().min(1),
|
|
2546
|
+
role: z.enum(["read", "changeRequest", "write", "manage"])
|
|
2547
|
+
})
|
|
2548
|
+
).output(z.object({ granted: z.boolean() })),
|
|
2549
|
+
remove: oc.route({
|
|
2550
|
+
method: "DELETE",
|
|
2551
|
+
path: "/nodes/{nodeId}/principals",
|
|
2552
|
+
tags: ["Nodes", "Permissions"],
|
|
2553
|
+
summary: "Revoke a principal's access grant on a node",
|
|
2554
|
+
successDescription: "Removed the direct grant (and its materialized inherited copies). Requires `manage` level on the node."
|
|
2555
|
+
}).input(
|
|
2556
|
+
z.object({
|
|
2557
|
+
nodeId: z.string(),
|
|
2558
|
+
principalType: z.enum(["user", "space"]),
|
|
2559
|
+
principalId: z.string().min(1)
|
|
2560
|
+
})
|
|
2561
|
+
).output(z.object({ removed: z.boolean() }))
|
|
2562
|
+
}
|
|
2449
2563
|
},
|
|
2450
2564
|
auditEvents: {
|
|
2451
2565
|
list: oc.route({
|
|
@@ -2762,11 +2876,32 @@ function resolveConfig(config = {}) {
|
|
|
2762
2876
|
fetch: config.fetch
|
|
2763
2877
|
};
|
|
2764
2878
|
}
|
|
2879
|
+
var decodeBusabaseError = (deserializedBody, response) => {
|
|
2880
|
+
if (!deserializedBody || typeof deserializedBody !== "object") {
|
|
2881
|
+
return void 0;
|
|
2882
|
+
}
|
|
2883
|
+
const body = deserializedBody;
|
|
2884
|
+
if (typeof body.error !== "string") {
|
|
2885
|
+
return void 0;
|
|
2886
|
+
}
|
|
2887
|
+
const code = typeof body.code === "string" ? body.code : `HTTP_${response.status}`;
|
|
2888
|
+
const issues = body.data?.issues;
|
|
2889
|
+
let message = body.error;
|
|
2890
|
+
if (Array.isArray(issues) && issues.length > 0) {
|
|
2891
|
+
const details = issues.map((issue) => {
|
|
2892
|
+
const path = Array.isArray(issue?.path) ? issue.path.join(".") : void 0;
|
|
2893
|
+
return path ? `${path}: ${issue?.message}` : String(issue?.message ?? issue);
|
|
2894
|
+
}).join("; ");
|
|
2895
|
+
message = `${message} \u2014 ${details}`;
|
|
2896
|
+
}
|
|
2897
|
+
return new ORPCError(code, { status: response.status, message, data: body.data });
|
|
2898
|
+
};
|
|
2765
2899
|
function createBusabaseClient(config = {}) {
|
|
2766
2900
|
const resolved = resolveConfig(config);
|
|
2767
2901
|
const link = new OpenAPILink(cloudContract, {
|
|
2768
2902
|
url: resolved.baseUrl,
|
|
2769
2903
|
fetch: resolved.fetch,
|
|
2904
|
+
customErrorResponseBodyDecoder: decodeBusabaseError,
|
|
2770
2905
|
headers: async () => {
|
|
2771
2906
|
const extra = typeof resolved.headers === "function" ? await resolved.headers() : resolved.headers;
|
|
2772
2907
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "busabase-sdk",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.8",
|
|
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
|
-
"
|
|
44
|
+
"busabase-contract": "0.9.8",
|
|
45
45
|
"openlib": "0.1.1",
|
|
46
|
-
"
|
|
46
|
+
"open-domains": "0.0.2"
|
|
47
47
|
},
|
|
48
48
|
"engines": {
|
|
49
49
|
"node": ">=24.18.0"
|