busa-sdk 0.9.6 → 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 +476 -6
- package/dist/index.js +235 -24
- package/package.json +1 -1
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";
|
|
@@ -4215,6 +4330,7 @@ declare const cloudContract: {
|
|
|
4215
4330
|
targetBaseSlug: z.ZodOptional<z.ZodString>;
|
|
4216
4331
|
}, z.core.$strip>>;
|
|
4217
4332
|
}, z.core.$strip>>;
|
|
4333
|
+
materialized: z.ZodLiteral<true>;
|
|
4218
4334
|
}, z.core.$strip>, z.ZodObject<{
|
|
4219
4335
|
id: z.ZodString;
|
|
4220
4336
|
baseId: z.ZodNullable<z.ZodString>;
|
|
@@ -4592,12 +4708,187 @@ declare const cloudContract: {
|
|
|
4592
4708
|
visibleOperationHeads: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
4593
4709
|
createdAt: z.ZodString;
|
|
4594
4710
|
}, z.core.$strip>>;
|
|
4711
|
+
materialized: z.ZodLiteral<false>;
|
|
4595
4712
|
}, z.core.$strip>]>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
4596
4713
|
createChangeRequest: _orpc_contract.ContractProcedure<z.ZodObject<{
|
|
4597
4714
|
fields: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
4598
4715
|
message: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
4599
4716
|
submittedBy: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
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;
|
|
4600
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>;
|
|
4601
4892
|
}, z.core.$strip>, z.ZodObject<{
|
|
4602
4893
|
id: z.ZodString;
|
|
4603
4894
|
baseId: z.ZodNullable<z.ZodString>;
|
|
@@ -4975,11 +5266,13 @@ declare const cloudContract: {
|
|
|
4975
5266
|
visibleOperationHeads: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
4976
5267
|
createdAt: z.ZodString;
|
|
4977
5268
|
}, z.core.$strip>>;
|
|
4978
|
-
|
|
5269
|
+
materialized: z.ZodLiteral<false>;
|
|
5270
|
+
}, z.core.$strip>]>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
4979
5271
|
createBulkChangeRequest: _orpc_contract.ContractProcedure<z.ZodObject<{
|
|
4980
5272
|
records: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
4981
5273
|
message: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
4982
5274
|
submittedBy: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
5275
|
+
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
4983
5276
|
baseId: z.ZodString;
|
|
4984
5277
|
}, z.core.$strip>, z.ZodObject<{
|
|
4985
5278
|
id: z.ZodString;
|
|
@@ -6030,10 +6323,36 @@ declare const cloudContract: {
|
|
|
6030
6323
|
fieldId: z.ZodOptional<z.ZodString>;
|
|
6031
6324
|
}, z.core.$strip>>>;
|
|
6032
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
|
+
}>>;
|
|
6033
6345
|
}, z.core.$strip>>>;
|
|
6034
6346
|
description: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
6035
6347
|
message: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
6036
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
|
+
}>>>;
|
|
6037
6356
|
slug: z.ZodOptional<z.ZodString>;
|
|
6038
6357
|
submittedBy: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
6039
6358
|
baseId: z.ZodString;
|
|
@@ -9240,6 +9559,7 @@ declare const cloudContract: {
|
|
|
9240
9559
|
assetId: z.ZodString;
|
|
9241
9560
|
displayName: z.ZodNullable<z.ZodString>;
|
|
9242
9561
|
}, z.core.$strip>>;
|
|
9562
|
+
skippedGitignorePaths: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
9243
9563
|
}, z.core.$strip>>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
9244
9564
|
create: _orpc_contract.ContractProcedure<z.ZodObject<{
|
|
9245
9565
|
parentNodeId: z.ZodOptional<z.ZodString>;
|
|
@@ -9285,6 +9605,8 @@ declare const cloudContract: {
|
|
|
9285
9605
|
assetId: z.ZodString;
|
|
9286
9606
|
displayName: z.ZodNullable<z.ZodString>;
|
|
9287
9607
|
}, z.core.$strip>>;
|
|
9608
|
+
skippedGitignorePaths: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
9609
|
+
materialized: z.ZodLiteral<true>;
|
|
9288
9610
|
}, z.core.$strip>, z.ZodObject<{
|
|
9289
9611
|
id: z.ZodString;
|
|
9290
9612
|
baseId: z.ZodNullable<z.ZodString>;
|
|
@@ -9662,6 +9984,7 @@ declare const cloudContract: {
|
|
|
9662
9984
|
visibleOperationHeads: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
9663
9985
|
createdAt: z.ZodString;
|
|
9664
9986
|
}, z.core.$strip>>;
|
|
9987
|
+
materialized: z.ZodLiteral<false>;
|
|
9665
9988
|
}, z.core.$strip>]>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
9666
9989
|
get: _orpc_contract.ContractProcedure<z.ZodObject<{
|
|
9667
9990
|
nodeId: z.ZodString;
|
|
@@ -9683,6 +10006,7 @@ declare const cloudContract: {
|
|
|
9683
10006
|
assetId: z.ZodString;
|
|
9684
10007
|
displayName: z.ZodNullable<z.ZodString>;
|
|
9685
10008
|
}, z.core.$strip>>;
|
|
10009
|
+
skippedGitignorePaths: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
9686
10010
|
}, z.core.$strip>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
9687
10011
|
listFiles: _orpc_contract.ContractProcedure<z.ZodObject<{
|
|
9688
10012
|
nodeId: z.ZodString;
|
|
@@ -10149,6 +10473,7 @@ declare const cloudContract: {
|
|
|
10149
10473
|
assetId: z.ZodString;
|
|
10150
10474
|
displayName: z.ZodNullable<z.ZodString>;
|
|
10151
10475
|
}, z.core.$strip>>;
|
|
10476
|
+
skippedGitignorePaths: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
10152
10477
|
}, z.core.$strip>>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
10153
10478
|
create: _orpc_contract.ContractProcedure<z.ZodObject<{
|
|
10154
10479
|
parentNodeId: z.ZodOptional<z.ZodString>;
|
|
@@ -10194,6 +10519,8 @@ declare const cloudContract: {
|
|
|
10194
10519
|
assetId: z.ZodString;
|
|
10195
10520
|
displayName: z.ZodNullable<z.ZodString>;
|
|
10196
10521
|
}, z.core.$strip>>;
|
|
10522
|
+
skippedGitignorePaths: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
10523
|
+
materialized: z.ZodLiteral<true>;
|
|
10197
10524
|
}, z.core.$strip>, z.ZodObject<{
|
|
10198
10525
|
id: z.ZodString;
|
|
10199
10526
|
baseId: z.ZodNullable<z.ZodString>;
|
|
@@ -10571,6 +10898,7 @@ declare const cloudContract: {
|
|
|
10571
10898
|
visibleOperationHeads: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
10572
10899
|
createdAt: z.ZodString;
|
|
10573
10900
|
}, z.core.$strip>>;
|
|
10901
|
+
materialized: z.ZodLiteral<false>;
|
|
10574
10902
|
}, z.core.$strip>]>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
10575
10903
|
get: _orpc_contract.ContractProcedure<z.ZodObject<{
|
|
10576
10904
|
nodeId: z.ZodString;
|
|
@@ -10592,6 +10920,7 @@ declare const cloudContract: {
|
|
|
10592
10920
|
assetId: z.ZodString;
|
|
10593
10921
|
displayName: z.ZodNullable<z.ZodString>;
|
|
10594
10922
|
}, z.core.$strip>>;
|
|
10923
|
+
skippedGitignorePaths: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
10595
10924
|
}, z.core.$strip>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
10596
10925
|
listFiles: _orpc_contract.ContractProcedure<z.ZodObject<{
|
|
10597
10926
|
nodeId: z.ZodString;
|
|
@@ -11040,6 +11369,42 @@ declare const cloudContract: {
|
|
|
11040
11369
|
}, z.core.$strip>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
11041
11370
|
};
|
|
11042
11371
|
airapps: {
|
|
11372
|
+
runLocalNode: _orpc_contract.ContractProcedure<z.ZodObject<{
|
|
11373
|
+
nodeId: z.ZodString;
|
|
11374
|
+
files: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
11375
|
+
engine: z.ZodDefault<z.ZodEnum<{
|
|
11376
|
+
"local-node": "local-node";
|
|
11377
|
+
srt: "srt";
|
|
11378
|
+
}>>;
|
|
11379
|
+
}, z.core.$strip>, _orpc_contract.Schema<AsyncIteratorObject<{
|
|
11380
|
+
type: "log";
|
|
11381
|
+
line: string;
|
|
11382
|
+
} | {
|
|
11383
|
+
type: "installed";
|
|
11384
|
+
} | {
|
|
11385
|
+
type: "ready";
|
|
11386
|
+
previewUrl: string;
|
|
11387
|
+
} | {
|
|
11388
|
+
type: "exit";
|
|
11389
|
+
code: number | null;
|
|
11390
|
+
} | {
|
|
11391
|
+
type: "error";
|
|
11392
|
+
message: string;
|
|
11393
|
+
}, unknown, void>, _orpc_shared.AsyncIteratorClass<{
|
|
11394
|
+
type: "log";
|
|
11395
|
+
line: string;
|
|
11396
|
+
} | {
|
|
11397
|
+
type: "installed";
|
|
11398
|
+
} | {
|
|
11399
|
+
type: "ready";
|
|
11400
|
+
previewUrl: string;
|
|
11401
|
+
} | {
|
|
11402
|
+
type: "exit";
|
|
11403
|
+
code: number | null;
|
|
11404
|
+
} | {
|
|
11405
|
+
type: "error";
|
|
11406
|
+
message: string;
|
|
11407
|
+
}, unknown, void>>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
11043
11408
|
list: _orpc_contract.ContractProcedure<_orpc_contract.Schema<unknown, unknown>, z.ZodArray<z.ZodObject<{
|
|
11044
11409
|
node: z.ZodType<NodeOutput, unknown, z.core.$ZodTypeInternals<NodeOutput, unknown>>;
|
|
11045
11410
|
entryFile: z.ZodString;
|
|
@@ -11058,6 +11423,7 @@ declare const cloudContract: {
|
|
|
11058
11423
|
assetId: z.ZodString;
|
|
11059
11424
|
displayName: z.ZodNullable<z.ZodString>;
|
|
11060
11425
|
}, z.core.$strip>>;
|
|
11426
|
+
skippedGitignorePaths: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
11061
11427
|
}, z.core.$strip>>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
11062
11428
|
create: _orpc_contract.ContractProcedure<z.ZodObject<{
|
|
11063
11429
|
parentNodeId: z.ZodOptional<z.ZodString>;
|
|
@@ -11103,6 +11469,8 @@ declare const cloudContract: {
|
|
|
11103
11469
|
assetId: z.ZodString;
|
|
11104
11470
|
displayName: z.ZodNullable<z.ZodString>;
|
|
11105
11471
|
}, z.core.$strip>>;
|
|
11472
|
+
skippedGitignorePaths: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
11473
|
+
materialized: z.ZodLiteral<true>;
|
|
11106
11474
|
}, z.core.$strip>, z.ZodObject<{
|
|
11107
11475
|
id: z.ZodString;
|
|
11108
11476
|
baseId: z.ZodNullable<z.ZodString>;
|
|
@@ -11480,6 +11848,7 @@ declare const cloudContract: {
|
|
|
11480
11848
|
visibleOperationHeads: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
11481
11849
|
createdAt: z.ZodString;
|
|
11482
11850
|
}, z.core.$strip>>;
|
|
11851
|
+
materialized: z.ZodLiteral<false>;
|
|
11483
11852
|
}, z.core.$strip>]>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
11484
11853
|
get: _orpc_contract.ContractProcedure<z.ZodObject<{
|
|
11485
11854
|
nodeId: z.ZodString;
|
|
@@ -11501,6 +11870,7 @@ declare const cloudContract: {
|
|
|
11501
11870
|
assetId: z.ZodString;
|
|
11502
11871
|
displayName: z.ZodNullable<z.ZodString>;
|
|
11503
11872
|
}, z.core.$strip>>;
|
|
11873
|
+
skippedGitignorePaths: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
11504
11874
|
}, z.core.$strip>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
11505
11875
|
listFiles: _orpc_contract.ContractProcedure<z.ZodObject<{
|
|
11506
11876
|
nodeId: z.ZodString;
|
|
@@ -12007,6 +12377,7 @@ declare const cloudContract: {
|
|
|
12007
12377
|
}>;
|
|
12008
12378
|
createdAt: z.ZodString;
|
|
12009
12379
|
}, z.core.$strip>;
|
|
12380
|
+
materialized: z.ZodLiteral<true>;
|
|
12010
12381
|
}, z.core.$strip>, z.ZodObject<{
|
|
12011
12382
|
id: z.ZodString;
|
|
12012
12383
|
baseId: z.ZodNullable<z.ZodString>;
|
|
@@ -12384,6 +12755,7 @@ declare const cloudContract: {
|
|
|
12384
12755
|
visibleOperationHeads: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
12385
12756
|
createdAt: z.ZodString;
|
|
12386
12757
|
}, z.core.$strip>>;
|
|
12758
|
+
materialized: z.ZodLiteral<false>;
|
|
12387
12759
|
}, z.core.$strip>]>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
12388
12760
|
get: _orpc_contract.ContractProcedure<z.ZodObject<{
|
|
12389
12761
|
nodeId: z.ZodString;
|
|
@@ -12431,6 +12803,7 @@ declare const cloudContract: {
|
|
|
12431
12803
|
node: z.ZodType<NodeOutput, unknown, z.core.$ZodTypeInternals<NodeOutput, unknown>>;
|
|
12432
12804
|
storagePrefix: z.ZodString;
|
|
12433
12805
|
body: z.ZodString;
|
|
12806
|
+
materialized: z.ZodLiteral<true>;
|
|
12434
12807
|
}, z.core.$strip>, z.ZodObject<{
|
|
12435
12808
|
id: z.ZodString;
|
|
12436
12809
|
baseId: z.ZodNullable<z.ZodString>;
|
|
@@ -12808,6 +13181,7 @@ declare const cloudContract: {
|
|
|
12808
13181
|
visibleOperationHeads: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
12809
13182
|
createdAt: z.ZodString;
|
|
12810
13183
|
}, z.core.$strip>>;
|
|
13184
|
+
materialized: z.ZodLiteral<false>;
|
|
12811
13185
|
}, z.core.$strip>]>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
12812
13186
|
get: _orpc_contract.ContractProcedure<z.ZodObject<{
|
|
12813
13187
|
nodeId: z.ZodString;
|
|
@@ -14338,6 +14712,7 @@ declare const cloudContract: {
|
|
|
14338
14712
|
comments: "comments";
|
|
14339
14713
|
bases: "bases";
|
|
14340
14714
|
assets: "assets";
|
|
14715
|
+
nodePrincipals: "nodePrincipals";
|
|
14341
14716
|
views: "views";
|
|
14342
14717
|
fieldValues: "fieldValues";
|
|
14343
14718
|
recordLinks: "recordLinks";
|
|
@@ -14368,6 +14743,7 @@ declare const cloudContract: {
|
|
|
14368
14743
|
comments: "comments";
|
|
14369
14744
|
bases: "bases";
|
|
14370
14745
|
assets: "assets";
|
|
14746
|
+
nodePrincipals: "nodePrincipals";
|
|
14371
14747
|
views: "views";
|
|
14372
14748
|
fieldValues: "fieldValues";
|
|
14373
14749
|
recordLinks: "recordLinks";
|
|
@@ -16897,7 +17273,13 @@ declare const cloudContract: {
|
|
|
16897
17273
|
slug: z.ZodString;
|
|
16898
17274
|
name: z.ZodString;
|
|
16899
17275
|
description: z.ZodString;
|
|
16900
|
-
type: z.
|
|
17276
|
+
type: z.ZodEnum<{
|
|
17277
|
+
table: "table";
|
|
17278
|
+
gallery: "gallery";
|
|
17279
|
+
kanban: "kanban";
|
|
17280
|
+
calendar: "calendar";
|
|
17281
|
+
gantt: "gantt";
|
|
17282
|
+
}>;
|
|
16901
17283
|
config: z.ZodObject<{
|
|
16902
17284
|
filters: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
16903
17285
|
fieldSlug: z.ZodString;
|
|
@@ -16921,6 +17303,25 @@ declare const cloudContract: {
|
|
|
16921
17303
|
fieldId: z.ZodOptional<z.ZodString>;
|
|
16922
17304
|
}, z.core.$strip>>>;
|
|
16923
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
|
+
}>>;
|
|
16924
17325
|
}, z.core.$strip>;
|
|
16925
17326
|
status: z.ZodEnum<{
|
|
16926
17327
|
archived: "archived";
|
|
@@ -19639,10 +20040,36 @@ declare const cloudContract: {
|
|
|
19639
20040
|
fieldId: z.ZodOptional<z.ZodString>;
|
|
19640
20041
|
}, z.core.$strip>>>;
|
|
19641
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
|
+
}>>;
|
|
19642
20062
|
}, z.core.$strip>>;
|
|
19643
20063
|
description: z.ZodOptional<z.ZodString>;
|
|
19644
20064
|
message: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
19645
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
|
+
}>>;
|
|
19646
20073
|
submittedBy: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
19647
20074
|
viewId: z.ZodString;
|
|
19648
20075
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -20865,6 +21292,35 @@ declare function resolveConfig(config?: BusabaseConfig): ResolvedConfig;
|
|
|
20865
21292
|
* ```
|
|
20866
21293
|
*/
|
|
20867
21294
|
declare function createBusabaseClient(config?: BusabaseConfig): BusabaseClient;
|
|
21295
|
+
/** Options for {@link createBusabaseRpcClient}. No `apiKey`/`spaceId` — this
|
|
21296
|
+
* transport authenticates purely via the browser's ambient session cookie. */
|
|
21297
|
+
interface BusabaseRpcConfig {
|
|
21298
|
+
/**
|
|
21299
|
+
* Path to the internal RPC endpoint: either a full URL, or a path resolved
|
|
21300
|
+
* against `window.location.origin` (browser only — there is no ambient
|
|
21301
|
+
* session outside one).
|
|
21302
|
+
*
|
|
21303
|
+
* **The default (`/api/rpc`) only matches `apps/busabase` (the OSS app)**,
|
|
21304
|
+
* which mounts busabase's procedures unnamespaced. `apps/busabase-cloud`
|
|
21305
|
+
* mounts the *same* procedures under a `core` prefix instead — pass
|
|
21306
|
+
* `apiBasePath: "/api/rpc/core"` there, or this client will 404 on every
|
|
21307
|
+
* call. There is no single default that works for both; which one you're
|
|
21308
|
+
* targeting is something the caller has to know (this SDK doesn't probe
|
|
21309
|
+
* for it).
|
|
21310
|
+
*
|
|
21311
|
+
* From inside an AirApp running via Nodepod, prepend
|
|
21312
|
+
* `/__busabase_api__` to whichever of the above applies, to route through
|
|
21313
|
+
* the service-worker bridge instead of the sandboxed virtual server — e.g.
|
|
21314
|
+
* `/__busabase_api__/api/rpc/core` for busabase-cloud. See
|
|
21315
|
+
* apps/busabase/docs/node-types.md.
|
|
21316
|
+
*/
|
|
21317
|
+
apiBasePath?: string;
|
|
21318
|
+
/** Extra headers merged into every request. Static object or a (possibly async) factory. */
|
|
21319
|
+
headers?: Record<string, string> | (() => Record<string, string> | Promise<Record<string, string>>);
|
|
21320
|
+
/** Custom `fetch` implementation (e.g. a proxy-aware or instrumented fetch). */
|
|
21321
|
+
fetch?: typeof fetch;
|
|
21322
|
+
}
|
|
21323
|
+
declare function createBusabaseRpcClient(config?: BusabaseRpcConfig): BusabaseClient;
|
|
20868
21324
|
|
|
20869
21325
|
/**
|
|
20870
21326
|
* Attachments — DTO/VO Zod schemas + inferred types (the contract's type source
|
|
@@ -20983,10 +21439,23 @@ interface ViewSortVO {
|
|
|
20983
21439
|
fieldSlug: string;
|
|
20984
21440
|
fieldId?: string;
|
|
20985
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";
|
|
20986
21446
|
interface ViewConfigVO {
|
|
20987
21447
|
filters: ViewFilterVO[];
|
|
20988
21448
|
sorts: ViewSortVO[];
|
|
20989
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;
|
|
20990
21459
|
}
|
|
20991
21460
|
interface ViewVO {
|
|
20992
21461
|
id: string;
|
|
@@ -20994,7 +21463,7 @@ interface ViewVO {
|
|
|
20994
21463
|
slug: string;
|
|
20995
21464
|
name: string;
|
|
20996
21465
|
description: string;
|
|
20997
|
-
type:
|
|
21466
|
+
type: ViewType;
|
|
20998
21467
|
config: ViewConfigVO;
|
|
20999
21468
|
status: "active" | "archived";
|
|
21000
21469
|
createdBy: string;
|
|
@@ -22211,6 +22680,7 @@ interface FileTreeNodeVO {
|
|
|
22211
22680
|
visibility: "private" | "workspace" | "public";
|
|
22212
22681
|
version: string;
|
|
22213
22682
|
files: FileTreeFileVO[];
|
|
22683
|
+
skippedGitignorePaths?: string[];
|
|
22214
22684
|
}
|
|
22215
22685
|
interface FileTreeReadFileVO {
|
|
22216
22686
|
nodeId: string;
|
|
@@ -22881,4 +23351,4 @@ declare class Busabase {
|
|
|
22881
23351
|
}>>>>;
|
|
22882
23352
|
}
|
|
22883
23353
|
|
|
22884
|
-
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, 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, 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,6 +1,7 @@
|
|
|
1
|
-
import { createORPCClient } from '@orpc/client';
|
|
1
|
+
import { createORPCClient, ORPCError } from '@orpc/client';
|
|
2
|
+
import { RPCLink } from '@orpc/client/fetch';
|
|
3
|
+
import { oc, eventIterator, inferRPCMethodFromContractRouter } from '@orpc/contract';
|
|
2
4
|
import { OpenAPILink } from '@orpc/openapi-client/fetch';
|
|
3
|
-
import { oc, eventIterator } from '@orpc/contract';
|
|
4
5
|
import { z } from 'zod';
|
|
5
6
|
|
|
6
7
|
// src/client.ts
|
|
@@ -112,7 +113,9 @@ var baseSchema = z.object({
|
|
|
112
113
|
fields: z.array(baseFieldSchema)
|
|
113
114
|
});
|
|
114
115
|
var createBaseInputSchema = z.object({
|
|
115
|
-
parentNodeId: z.string().optional()
|
|
116
|
+
parentNodeId: z.string().optional().describe(
|
|
117
|
+
"Parent node id. Must be a folder or the space root; container-incapable node types (Base, Doc, AirApp, etc.) cannot hold children."
|
|
118
|
+
),
|
|
116
119
|
slug: z.string().min(1).regex(/^[a-z0-9-]+$/),
|
|
117
120
|
name: z.string().min(1),
|
|
118
121
|
description: z.string().optional().default(""),
|
|
@@ -433,6 +436,16 @@ var nodeSchema = z.lazy(
|
|
|
433
436
|
hasChildren: z.boolean().optional()
|
|
434
437
|
})
|
|
435
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
|
+
});
|
|
436
449
|
var listNodesInputSchema = z.object({
|
|
437
450
|
parentId: z.string().nullable().optional().describe("Node to start from. Omit or null to start from the space root."),
|
|
438
451
|
depth: z.coerce.number().int().min(1).max(5).optional().describe(
|
|
@@ -855,10 +868,17 @@ var fileTreeNodeSchema = z.object({
|
|
|
855
868
|
entryFile: z.string(),
|
|
856
869
|
visibility: z.enum(["private", "workspace", "public"]),
|
|
857
870
|
version: z.string(),
|
|
858
|
-
files: z.array(fileTreeFileSchema)
|
|
871
|
+
files: z.array(fileTreeFileSchema),
|
|
872
|
+
// Paths silently dropped from this create call by an uploaded `.gitignore`
|
|
873
|
+
// (upload-safety layer 1 — see `logic/upload-safety.ts`). Empty on
|
|
874
|
+
// ordinary get/list responses and on creates that didn't include a
|
|
875
|
+
// `.gitignore`.
|
|
876
|
+
skippedGitignorePaths: z.array(z.string()).optional().default([])
|
|
859
877
|
});
|
|
860
878
|
var createFileTreeInputSchema = z.object({
|
|
861
|
-
parentNodeId: z.string().optional()
|
|
879
|
+
parentNodeId: z.string().optional().describe(
|
|
880
|
+
"Parent node id. Must be a folder or the space root; container-incapable node types (Base, Doc, AirApp, etc.) cannot hold children."
|
|
881
|
+
),
|
|
862
882
|
slug: z.string().min(1).regex(/^[a-z0-9-]+$/),
|
|
863
883
|
name: z.string().min(1),
|
|
864
884
|
description: z.string().optional().default(""),
|
|
@@ -920,8 +940,13 @@ var makeFileTreeContract = (routeBase, tag) => {
|
|
|
920
940
|
path: basePath,
|
|
921
941
|
tags: [tag],
|
|
922
942
|
summary: `Create ${label} node`,
|
|
923
|
-
successDescription: `Review-first by default: a pending ChangeRequest proposing the ${label} node. Returns the materialized ${label} node instead when \`autoMerge: true\` is passed.`
|
|
924
|
-
}).input(createFileTreeInputSchema).output(
|
|
943
|
+
successDescription: `Review-first by default: a pending ChangeRequest proposing the ${label} node (\`materialized: false\`). Returns the materialized ${label} node instead (\`materialized: true\`) when \`autoMerge: true\` is passed.`
|
|
944
|
+
}).input(createFileTreeInputSchema).output(
|
|
945
|
+
z.union([
|
|
946
|
+
fileTreeNodeSchema.extend({ materialized: z.literal(true) }),
|
|
947
|
+
changeRequestSchema.extend({ materialized: z.literal(false) })
|
|
948
|
+
])
|
|
949
|
+
),
|
|
925
950
|
get: oc.route({
|
|
926
951
|
method: "GET",
|
|
927
952
|
path: `${basePath}/{nodeId}`,
|
|
@@ -967,6 +992,28 @@ var makeFileTreeContract = (routeBase, tag) => {
|
|
|
967
992
|
|
|
968
993
|
// ../../packages/busabase-contract/src/domains/airapp/contract.ts
|
|
969
994
|
var airappContract = makeFileTreeContract("airapps", "AirApps");
|
|
995
|
+
var airAppRunLocalNodeInputSchema = z.object({
|
|
996
|
+
nodeId: z.string(),
|
|
997
|
+
/** Text files to mount into the sandbox workdir before installing, keyed by
|
|
998
|
+
* path (same shape `RunPanel` already assembles for `NodepodRunner.mount`). */
|
|
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")
|
|
1006
|
+
});
|
|
1007
|
+
var airAppRuntimeEventSchema = z.discriminatedUnion("type", [
|
|
1008
|
+
z.object({ type: z.literal("log"), line: z.string() }),
|
|
1009
|
+
z.object({ type: z.literal("installed") }),
|
|
1010
|
+
z.object({ type: z.literal("ready"), previewUrl: z.string() }),
|
|
1011
|
+
z.object({ type: z.literal("exit"), code: z.number().nullable() }),
|
|
1012
|
+
z.object({ type: z.literal("error"), message: z.string() })
|
|
1013
|
+
]);
|
|
1014
|
+
var airappRuntimeContract = {
|
|
1015
|
+
runLocalNode: oc.input(airAppRunLocalNodeInputSchema).output(eventIterator(airAppRuntimeEventSchema))
|
|
1016
|
+
};
|
|
970
1017
|
var AttachmentMetadataSchema = z.record(z.string(), z.unknown());
|
|
971
1018
|
z.object({
|
|
972
1019
|
id: z.string(),
|
|
@@ -1304,10 +1351,30 @@ var viewSortSchema = z.object({
|
|
|
1304
1351
|
fieldSlug: z.string(),
|
|
1305
1352
|
fieldId: z.string().optional()
|
|
1306
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"]);
|
|
1307
1358
|
var viewConfigSchema = z.object({
|
|
1308
1359
|
filters: z.array(viewFilterSchema).default([]),
|
|
1309
1360
|
sorts: z.array(viewSortSchema).default([]),
|
|
1310
|
-
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()
|
|
1311
1378
|
});
|
|
1312
1379
|
var viewSchema = z.object({
|
|
1313
1380
|
id: z.string(),
|
|
@@ -1315,7 +1382,7 @@ var viewSchema = z.object({
|
|
|
1315
1382
|
slug: z.string(),
|
|
1316
1383
|
name: z.string(),
|
|
1317
1384
|
description: z.string(),
|
|
1318
|
-
type:
|
|
1385
|
+
type: viewTypeSchema,
|
|
1319
1386
|
config: viewConfigSchema,
|
|
1320
1387
|
status: z.enum(["active", "archived"]),
|
|
1321
1388
|
createdBy: z.string(),
|
|
@@ -1329,6 +1396,7 @@ var createViewInputSchema = z.object({
|
|
|
1329
1396
|
description: z.string().optional().default(""),
|
|
1330
1397
|
message: z.string().optional().default("Create view"),
|
|
1331
1398
|
name: z.string().min(1),
|
|
1399
|
+
type: viewTypeSchema.optional().default("table"),
|
|
1332
1400
|
slug: z.string().min(1).regex(/^[a-z0-9-]+$/).optional(),
|
|
1333
1401
|
submittedBy: z.string().optional().default("local-producer")
|
|
1334
1402
|
});
|
|
@@ -1337,6 +1405,7 @@ var updateViewInputSchema = z.object({
|
|
|
1337
1405
|
description: z.string().optional(),
|
|
1338
1406
|
message: z.string().optional().default("Update view"),
|
|
1339
1407
|
name: z.string().min(1).optional(),
|
|
1408
|
+
type: viewTypeSchema.optional(),
|
|
1340
1409
|
submittedBy: z.string().optional().default("local-producer")
|
|
1341
1410
|
});
|
|
1342
1411
|
var deleteViewInputSchema = z.object({
|
|
@@ -1409,7 +1478,16 @@ var createChangeRequestInputSchema = z.object({
|
|
|
1409
1478
|
message: z.string().optional().default("Initial change request").describe(
|
|
1410
1479
|
'Explanation shown to the human reviewer. Write a conventional-commit style subject \u2014 imperative verb + what + why, e.g. "Add Acme Corp \u2014 qualified lead from the June webinar".'
|
|
1411
1480
|
),
|
|
1412
|
-
submittedBy: z.string().optional().default("local-producer")
|
|
1481
|
+
submittedBy: z.string().optional().default("local-producer"),
|
|
1482
|
+
idempotencyKey: z.string().optional().describe(
|
|
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."
|
|
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)
|
|
1413
1491
|
});
|
|
1414
1492
|
var createBulkChangeRequestInputSchema = z.object({
|
|
1415
1493
|
records: z.array(z.record(z.string(), z.unknown())).min(1).max(1e3).describe(
|
|
@@ -1418,7 +1496,10 @@ var createBulkChangeRequestInputSchema = z.object({
|
|
|
1418
1496
|
message: z.string().optional().default("Bulk create records").describe(
|
|
1419
1497
|
'Explanation shown to the human reviewer for the whole batch \u2014 e.g. "Import 240 June webinar leads".'
|
|
1420
1498
|
),
|
|
1421
|
-
submittedBy: z.string().optional().default("local-producer")
|
|
1499
|
+
submittedBy: z.string().optional().default("local-producer"),
|
|
1500
|
+
idempotencyKey: z.string().optional().describe(
|
|
1501
|
+
"Optional client-supplied key that dedupes retries. Scoped per base + submitter: calling this endpoint again with the SAME idempotencyKey returns the bulk 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."
|
|
1502
|
+
)
|
|
1422
1503
|
});
|
|
1423
1504
|
var recordFieldFilterInputSchema = z.object({
|
|
1424
1505
|
baseId: z.string().optional(),
|
|
@@ -1505,15 +1586,25 @@ var baseContract = {
|
|
|
1505
1586
|
path: "/bases",
|
|
1506
1587
|
tags: ["Bases"],
|
|
1507
1588
|
summary: "Create Base",
|
|
1508
|
-
successDescription: "Review-first by default: a pending ChangeRequest proposing the Base. Returns the materialized Base instead when `autoMerge: true` is passed."
|
|
1509
|
-
}).input(createBaseInputSchema).output(
|
|
1589
|
+
successDescription: "Review-first by default: a pending ChangeRequest proposing the Base (`materialized: false`). Returns the materialized Base instead (`materialized: true`) when `autoMerge: true` is passed."
|
|
1590
|
+
}).input(createBaseInputSchema).output(
|
|
1591
|
+
z.union([
|
|
1592
|
+
baseSchema.extend({ materialized: z.literal(true) }),
|
|
1593
|
+
changeRequestSchema.extend({ materialized: z.literal(false) })
|
|
1594
|
+
])
|
|
1595
|
+
),
|
|
1510
1596
|
createChangeRequest: oc.route({
|
|
1511
1597
|
method: "POST",
|
|
1512
1598
|
path: "/bases/{baseId}/change-requests",
|
|
1513
1599
|
tags: ["Bases", "Change Requests"],
|
|
1514
1600
|
summary: "Create Change Request in Base",
|
|
1515
|
-
successDescription: "
|
|
1516
|
-
}).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
|
+
),
|
|
1517
1608
|
createBulkChangeRequest: oc.route({
|
|
1518
1609
|
method: "POST",
|
|
1519
1610
|
path: "/bases/{baseId}/records/bulk-change-request",
|
|
@@ -1707,7 +1798,9 @@ var docSchema = z.object({
|
|
|
1707
1798
|
body: z.string()
|
|
1708
1799
|
});
|
|
1709
1800
|
var createDocInputSchema = z.object({
|
|
1710
|
-
parentNodeId: z.string().optional()
|
|
1801
|
+
parentNodeId: z.string().optional().describe(
|
|
1802
|
+
"Parent node id. Must be a folder or the space root; container-incapable node types (Base, Doc, AirApp, etc.) cannot hold children."
|
|
1803
|
+
),
|
|
1711
1804
|
slug: z.string().min(1).regex(/^[a-z0-9-]+$/),
|
|
1712
1805
|
name: z.string().min(1),
|
|
1713
1806
|
description: z.string().optional().default(""),
|
|
@@ -1741,8 +1834,13 @@ var docContract = {
|
|
|
1741
1834
|
path: "/docs",
|
|
1742
1835
|
tags: ["Docs"],
|
|
1743
1836
|
summary: "Create Doc node",
|
|
1744
|
-
successDescription: "Review-first by default: a pending ChangeRequest proposing the Doc. Returns the materialized Doc node instead when `autoMerge: true` is passed."
|
|
1745
|
-
}).input(createDocInputSchema).output(
|
|
1837
|
+
successDescription: "Review-first by default: a pending ChangeRequest proposing the Doc (`materialized: false`). Returns the materialized Doc node instead (`materialized: true`) when `autoMerge: true` is passed."
|
|
1838
|
+
}).input(createDocInputSchema).output(
|
|
1839
|
+
z.union([
|
|
1840
|
+
docSchema.extend({ materialized: z.literal(true) }),
|
|
1841
|
+
changeRequestSchema.extend({ materialized: z.literal(false) })
|
|
1842
|
+
])
|
|
1843
|
+
),
|
|
1746
1844
|
get: oc.route({
|
|
1747
1845
|
method: "GET",
|
|
1748
1846
|
path: "/docs/{nodeId}",
|
|
@@ -1777,6 +1875,9 @@ var docContract = {
|
|
|
1777
1875
|
var driveContract = makeFileTreeContract("drives", "Drives");
|
|
1778
1876
|
var DumpTableSchema = z.enum([
|
|
1779
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",
|
|
1780
1881
|
"bases",
|
|
1781
1882
|
"baseFields",
|
|
1782
1883
|
"views",
|
|
@@ -1876,7 +1977,9 @@ var FileNodeVOSchema = z.object({
|
|
|
1876
1977
|
|
|
1877
1978
|
// ../../packages/busabase-contract/src/domains/file-node/contract.ts
|
|
1878
1979
|
var createFileNodeInputSchema = z.object({
|
|
1879
|
-
parentNodeId: z.string().optional()
|
|
1980
|
+
parentNodeId: z.string().optional().describe(
|
|
1981
|
+
"Parent node id. Must be a folder or the space root; container-incapable node types (Base, Doc, AirApp, etc.) cannot hold children."
|
|
1982
|
+
),
|
|
1880
1983
|
slug: z.string().min(1).regex(/^[a-z0-9-]+$/),
|
|
1881
1984
|
name: z.string().min(1),
|
|
1882
1985
|
description: z.string().optional().default(""),
|
|
@@ -1900,8 +2003,13 @@ var fileContract = {
|
|
|
1900
2003
|
path: "/files",
|
|
1901
2004
|
tags: ["Files"],
|
|
1902
2005
|
summary: "Create File node",
|
|
1903
|
-
successDescription: "Review-first by default: a pending ChangeRequest proposing the File node. Returns the materialized File node instead when `autoMerge: true` is passed."
|
|
1904
|
-
}).input(createFileNodeInputSchema).output(
|
|
2006
|
+
successDescription: "Review-first by default: a pending ChangeRequest proposing the File node (`materialized: false`). Returns the materialized File node instead (`materialized: true`) when `autoMerge: true` is passed."
|
|
2007
|
+
}).input(createFileNodeInputSchema).output(
|
|
2008
|
+
z.union([
|
|
2009
|
+
FileNodeVOSchema.extend({ materialized: z.literal(true) }),
|
|
2010
|
+
changeRequestSchema.extend({ materialized: z.literal(false) })
|
|
2011
|
+
])
|
|
2012
|
+
),
|
|
1905
2013
|
get: oc.route({
|
|
1906
2014
|
method: "GET",
|
|
1907
2015
|
path: "/files/{nodeId}",
|
|
@@ -2389,7 +2497,69 @@ var busabaseContractRoutes = {
|
|
|
2389
2497
|
tags: ["Nodes"],
|
|
2390
2498
|
summary: "Permanently delete an archived node",
|
|
2391
2499
|
successDescription: "Irreversibly removed an archived folder/doc/skill (and its subtree). Refused unless archived and refused if the subtree contains a Base."
|
|
2392
|
-
}).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
|
+
}
|
|
2393
2563
|
},
|
|
2394
2564
|
auditEvents: {
|
|
2395
2565
|
list: oc.route({
|
|
@@ -2449,7 +2619,7 @@ var busabaseContractRoutes = {
|
|
|
2449
2619
|
bases: baseContract,
|
|
2450
2620
|
skills: skillContract,
|
|
2451
2621
|
drives: driveContract,
|
|
2452
|
-
airapps: airappContract,
|
|
2622
|
+
airapps: { ...airappContract, ...airappRuntimeContract },
|
|
2453
2623
|
files: fileContract,
|
|
2454
2624
|
docs: docContract,
|
|
2455
2625
|
folders: folderContract,
|
|
@@ -2706,11 +2876,32 @@ function resolveConfig(config = {}) {
|
|
|
2706
2876
|
fetch: config.fetch
|
|
2707
2877
|
};
|
|
2708
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
|
+
};
|
|
2709
2899
|
function createBusabaseClient(config = {}) {
|
|
2710
2900
|
const resolved = resolveConfig(config);
|
|
2711
2901
|
const link = new OpenAPILink(cloudContract, {
|
|
2712
2902
|
url: resolved.baseUrl,
|
|
2713
2903
|
fetch: resolved.fetch,
|
|
2904
|
+
customErrorResponseBodyDecoder: decodeBusabaseError,
|
|
2714
2905
|
headers: async () => {
|
|
2715
2906
|
const extra = typeof resolved.headers === "function" ? await resolved.headers() : resolved.headers;
|
|
2716
2907
|
return {
|
|
@@ -2722,6 +2913,26 @@ function createBusabaseClient(config = {}) {
|
|
|
2722
2913
|
});
|
|
2723
2914
|
return createORPCClient(link);
|
|
2724
2915
|
}
|
|
2916
|
+
var getBrowserWindow = () => globalThis.window;
|
|
2917
|
+
function createBusabaseRpcClient(config = {}) {
|
|
2918
|
+
const apiBasePath = config.apiBasePath ?? "/api/rpc";
|
|
2919
|
+
const isAbsolute = /^https?:\/\//.test(apiBasePath);
|
|
2920
|
+
if (!isAbsolute && typeof getBrowserWindow() === "undefined") {
|
|
2921
|
+
throw new Error(
|
|
2922
|
+
"createBusabaseRpcClient: apiBasePath must be an absolute URL (http:// or https://) outside a browser \u2014 this client authenticates via the browser's ambient session cookie, which only exists client-side."
|
|
2923
|
+
);
|
|
2924
|
+
}
|
|
2925
|
+
const link = new RPCLink({
|
|
2926
|
+
method: inferRPCMethodFromContractRouter(cloudContract),
|
|
2927
|
+
url: () => isAbsolute ? apiBasePath : `${getBrowserWindow()?.location.origin}${apiBasePath}`,
|
|
2928
|
+
fetch: config.fetch,
|
|
2929
|
+
headers: async () => {
|
|
2930
|
+
const extra = typeof config.headers === "function" ? await config.headers() : config.headers;
|
|
2931
|
+
return { ...extra };
|
|
2932
|
+
}
|
|
2933
|
+
});
|
|
2934
|
+
return createORPCClient(link);
|
|
2935
|
+
}
|
|
2725
2936
|
|
|
2726
2937
|
// src/index.ts
|
|
2727
2938
|
var Busabase = class {
|
|
@@ -2848,4 +3059,4 @@ var Busabase = class {
|
|
|
2848
3059
|
}
|
|
2849
3060
|
};
|
|
2850
3061
|
|
|
2851
|
-
export { Busabase, CREATABLE_NODE_TYPES, DEFAULT_BASE_URL, cloudContract, createBusabaseClient, normalizeBaseUrl, resolveConfig };
|
|
3062
|
+
export { Busabase, CREATABLE_NODE_TYPES, DEFAULT_BASE_URL, cloudContract, createBusabaseClient, createBusabaseRpcClient, normalizeBaseUrl, resolveConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "busa-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). Short-name alias for busabase-sdk.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/busabase/busabase/tree/main/apps/busabase-sdk",
|