busabase-sdk 0.11.4 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -234,7 +234,7 @@ declare const BUILTIN_NODE_TYPES: readonly [{
234
234
  }, {
235
235
  readonly type: "form";
236
236
  readonly label: "Form";
237
- readonly icon: "clipboard-list";
237
+ readonly icon: "form";
238
238
  readonly capabilities: {
239
239
  readonly hasDetail: true;
240
240
  readonly creatable: true;
@@ -486,6 +486,59 @@ declare const FormFieldBindingSchema: z.ZodObject<{
486
486
  help: z.ZodOptional<z.ZodString>;
487
487
  }, z.core.$strip>;
488
488
  type FormFieldBindingVO = z.infer<typeof FormFieldBindingSchema>;
489
+ /**
490
+ * Client-safe control metadata for one bound Base field. Public Forms expose
491
+ * only these curated fields, never the target Base or its records.
492
+ */
493
+ declare const FormBoundFieldSchema: z.ZodObject<{
494
+ slug: z.ZodString;
495
+ name: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodEnum<{
496
+ en: "en";
497
+ "zh-CN": "zh-CN";
498
+ "zh-TW": "zh-TW";
499
+ ja: "ja";
500
+ ko: "ko";
501
+ de: "de";
502
+ fr: "fr";
503
+ es: "es";
504
+ pt: "pt";
505
+ }> & z.core.$partial, z.ZodString>]>;
506
+ type: z.ZodEnum<{
507
+ number: "number";
508
+ email: "email";
509
+ date: "date";
510
+ text: "text";
511
+ whiteboard: "whiteboard";
512
+ html: "html";
513
+ longtext: "longtext";
514
+ markdown: "markdown";
515
+ attachment: "attachment";
516
+ relation: "relation";
517
+ checkbox: "checkbox";
518
+ select: "select";
519
+ multiselect: "multiselect";
520
+ url: "url";
521
+ embed: "embed";
522
+ phone: "phone";
523
+ created_time: "created_time";
524
+ updated_time: "updated_time";
525
+ created_by: "created_by";
526
+ updated_by: "updated_by";
527
+ auto_number: "auto_number";
528
+ ai_summary: "ai_summary";
529
+ ai_tags: "ai_tags";
530
+ code: "code";
531
+ json: "json";
532
+ yaml: "yaml";
533
+ formula: "formula";
534
+ lookup: "lookup";
535
+ }>;
536
+ choices: z.ZodDefault<z.ZodArray<z.ZodObject<{
537
+ id: z.ZodString;
538
+ name: z.ZodString;
539
+ }, z.core.$strip>>>;
540
+ }, z.core.$strip>;
541
+ type FormBoundFieldVO = z.infer<typeof FormBoundFieldSchema>;
489
542
  /** Optional theme tokens layered over the agent-authored page. */
490
543
  declare const FormThemeSchema: z.ZodObject<{
491
544
  logoUrl: z.ZodOptional<z.ZodString>;
@@ -536,6 +589,54 @@ declare const FormVOSchema: z.ZodObject<{
536
589
  label: z.ZodOptional<z.ZodString>;
537
590
  help: z.ZodOptional<z.ZodString>;
538
591
  }, z.core.$strip>>;
592
+ boundFields: z.ZodDefault<z.ZodArray<z.ZodObject<{
593
+ slug: z.ZodString;
594
+ name: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodEnum<{
595
+ en: "en";
596
+ "zh-CN": "zh-CN";
597
+ "zh-TW": "zh-TW";
598
+ ja: "ja";
599
+ ko: "ko";
600
+ de: "de";
601
+ fr: "fr";
602
+ es: "es";
603
+ pt: "pt";
604
+ }> & z.core.$partial, z.ZodString>]>;
605
+ type: z.ZodEnum<{
606
+ number: "number";
607
+ email: "email";
608
+ date: "date";
609
+ text: "text";
610
+ whiteboard: "whiteboard";
611
+ html: "html";
612
+ longtext: "longtext";
613
+ markdown: "markdown";
614
+ attachment: "attachment";
615
+ relation: "relation";
616
+ checkbox: "checkbox";
617
+ select: "select";
618
+ multiselect: "multiselect";
619
+ url: "url";
620
+ embed: "embed";
621
+ phone: "phone";
622
+ created_time: "created_time";
623
+ updated_time: "updated_time";
624
+ created_by: "created_by";
625
+ updated_by: "updated_by";
626
+ auto_number: "auto_number";
627
+ ai_summary: "ai_summary";
628
+ ai_tags: "ai_tags";
629
+ code: "code";
630
+ json: "json";
631
+ yaml: "yaml";
632
+ formula: "formula";
633
+ lookup: "lookup";
634
+ }>;
635
+ choices: z.ZodDefault<z.ZodArray<z.ZodObject<{
636
+ id: z.ZodString;
637
+ name: z.ZodString;
638
+ }, z.core.$strip>>>;
639
+ }, z.core.$strip>>>;
539
640
  page: z.ZodObject<{
540
641
  code: z.ZodOptional<z.ZodString>;
541
642
  theme: z.ZodOptional<z.ZodObject<{
@@ -3160,7 +3261,7 @@ declare const cloudContract: {
3160
3261
  }, z.core.$strip>>, z.ZodArray<z.ZodType<NodeOutput, unknown, z.core.$ZodTypeInternals<NodeOutput, unknown>>>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
3161
3262
  searchByName: _orpc_contract.ContractProcedure<z.ZodObject<{
3162
3263
  query: z.ZodString;
3163
- limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
3264
+ limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
3164
3265
  }, z.core.$strip>, z.ZodArray<z.ZodObject<{
3165
3266
  id: z.ZodString;
3166
3267
  type: z.ZodEnum<{
@@ -11985,6 +12086,54 @@ declare const cloudContract: {
11985
12086
  label: z.ZodOptional<z.ZodString>;
11986
12087
  help: z.ZodOptional<z.ZodString>;
11987
12088
  }, z.core.$strip>>;
12089
+ boundFields: z.ZodDefault<z.ZodArray<z.ZodObject<{
12090
+ slug: z.ZodString;
12091
+ name: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodEnum<{
12092
+ en: "en";
12093
+ "zh-CN": "zh-CN";
12094
+ "zh-TW": "zh-TW";
12095
+ ja: "ja";
12096
+ ko: "ko";
12097
+ de: "de";
12098
+ fr: "fr";
12099
+ es: "es";
12100
+ pt: "pt";
12101
+ }> & z.core.$partial, z.ZodString>]>;
12102
+ type: z.ZodEnum<{
12103
+ number: "number";
12104
+ email: "email";
12105
+ date: "date";
12106
+ text: "text";
12107
+ whiteboard: "whiteboard";
12108
+ html: "html";
12109
+ longtext: "longtext";
12110
+ markdown: "markdown";
12111
+ attachment: "attachment";
12112
+ relation: "relation";
12113
+ checkbox: "checkbox";
12114
+ select: "select";
12115
+ multiselect: "multiselect";
12116
+ url: "url";
12117
+ embed: "embed";
12118
+ phone: "phone";
12119
+ created_time: "created_time";
12120
+ updated_time: "updated_time";
12121
+ created_by: "created_by";
12122
+ updated_by: "updated_by";
12123
+ auto_number: "auto_number";
12124
+ ai_summary: "ai_summary";
12125
+ ai_tags: "ai_tags";
12126
+ code: "code";
12127
+ json: "json";
12128
+ yaml: "yaml";
12129
+ formula: "formula";
12130
+ lookup: "lookup";
12131
+ }>;
12132
+ choices: z.ZodDefault<z.ZodArray<z.ZodObject<{
12133
+ id: z.ZodString;
12134
+ name: z.ZodString;
12135
+ }, z.core.$strip>>>;
12136
+ }, z.core.$strip>>>;
11988
12137
  page: z.ZodObject<{
11989
12138
  code: z.ZodOptional<z.ZodString>;
11990
12139
  theme: z.ZodOptional<z.ZodObject<{
@@ -12050,6 +12199,54 @@ declare const cloudContract: {
12050
12199
  label: z.ZodOptional<z.ZodString>;
12051
12200
  help: z.ZodOptional<z.ZodString>;
12052
12201
  }, z.core.$strip>>;
12202
+ boundFields: z.ZodDefault<z.ZodArray<z.ZodObject<{
12203
+ slug: z.ZodString;
12204
+ name: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodEnum<{
12205
+ en: "en";
12206
+ "zh-CN": "zh-CN";
12207
+ "zh-TW": "zh-TW";
12208
+ ja: "ja";
12209
+ ko: "ko";
12210
+ de: "de";
12211
+ fr: "fr";
12212
+ es: "es";
12213
+ pt: "pt";
12214
+ }> & z.core.$partial, z.ZodString>]>;
12215
+ type: z.ZodEnum<{
12216
+ number: "number";
12217
+ email: "email";
12218
+ date: "date";
12219
+ text: "text";
12220
+ whiteboard: "whiteboard";
12221
+ html: "html";
12222
+ longtext: "longtext";
12223
+ markdown: "markdown";
12224
+ attachment: "attachment";
12225
+ relation: "relation";
12226
+ checkbox: "checkbox";
12227
+ select: "select";
12228
+ multiselect: "multiselect";
12229
+ url: "url";
12230
+ embed: "embed";
12231
+ phone: "phone";
12232
+ created_time: "created_time";
12233
+ updated_time: "updated_time";
12234
+ created_by: "created_by";
12235
+ updated_by: "updated_by";
12236
+ auto_number: "auto_number";
12237
+ ai_summary: "ai_summary";
12238
+ ai_tags: "ai_tags";
12239
+ code: "code";
12240
+ json: "json";
12241
+ yaml: "yaml";
12242
+ formula: "formula";
12243
+ lookup: "lookup";
12244
+ }>;
12245
+ choices: z.ZodDefault<z.ZodArray<z.ZodObject<{
12246
+ id: z.ZodString;
12247
+ name: z.ZodString;
12248
+ }, z.core.$strip>>>;
12249
+ }, z.core.$strip>>>;
12053
12250
  page: z.ZodObject<{
12054
12251
  code: z.ZodOptional<z.ZodString>;
12055
12252
  theme: z.ZodOptional<z.ZodObject<{
@@ -12114,6 +12311,54 @@ declare const cloudContract: {
12114
12311
  label: z.ZodOptional<z.ZodString>;
12115
12312
  help: z.ZodOptional<z.ZodString>;
12116
12313
  }, z.core.$strip>>;
12314
+ boundFields: z.ZodDefault<z.ZodArray<z.ZodObject<{
12315
+ slug: z.ZodString;
12316
+ name: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodEnum<{
12317
+ en: "en";
12318
+ "zh-CN": "zh-CN";
12319
+ "zh-TW": "zh-TW";
12320
+ ja: "ja";
12321
+ ko: "ko";
12322
+ de: "de";
12323
+ fr: "fr";
12324
+ es: "es";
12325
+ pt: "pt";
12326
+ }> & z.core.$partial, z.ZodString>]>;
12327
+ type: z.ZodEnum<{
12328
+ number: "number";
12329
+ email: "email";
12330
+ date: "date";
12331
+ text: "text";
12332
+ whiteboard: "whiteboard";
12333
+ html: "html";
12334
+ longtext: "longtext";
12335
+ markdown: "markdown";
12336
+ attachment: "attachment";
12337
+ relation: "relation";
12338
+ checkbox: "checkbox";
12339
+ select: "select";
12340
+ multiselect: "multiselect";
12341
+ url: "url";
12342
+ embed: "embed";
12343
+ phone: "phone";
12344
+ created_time: "created_time";
12345
+ updated_time: "updated_time";
12346
+ created_by: "created_by";
12347
+ updated_by: "updated_by";
12348
+ auto_number: "auto_number";
12349
+ ai_summary: "ai_summary";
12350
+ ai_tags: "ai_tags";
12351
+ code: "code";
12352
+ json: "json";
12353
+ yaml: "yaml";
12354
+ formula: "formula";
12355
+ lookup: "lookup";
12356
+ }>;
12357
+ choices: z.ZodDefault<z.ZodArray<z.ZodObject<{
12358
+ id: z.ZodString;
12359
+ name: z.ZodString;
12360
+ }, z.core.$strip>>>;
12361
+ }, z.core.$strip>>>;
12117
12362
  page: z.ZodObject<{
12118
12363
  code: z.ZodOptional<z.ZodString>;
12119
12364
  theme: z.ZodOptional<z.ZodObject<{
@@ -19408,4 +19653,4 @@ declare class Busabase {
19408
19653
  }>>>>;
19409
19654
  }
19410
19655
 
19411
- 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 BusabaseAssetsClient, type BusabaseChangeRequestsClient, type BusabaseClient, type BusabaseConfig, type BusabaseRecordsClient, CREATABLE_NODE_TYPES, type ChangeRequestBatchFailureVO, type ChangeRequestCountsVO, type ChangeRequestMergeBatchResultVO, type ChangeRequestReviewBatchResultVO, type ChangeRequestStatus, type ChangeRequestTargetType, type ChangeRequestVO, type CloudContract, type CommentSubjectType, type CommentVO, type CommitVO, type CreatableNodeType, type CreateFormDTO, 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 FormFieldBindingVO, type FormPageSourceVO, type FormShareVO, type FormSubmitResultVO, type FormThemeVO, type FormVO, type GalleryCardSize, type GalleryCoverFit, type GanttScale, type LookupRollup, type NodeDetailVO, type NodeSearchResultVO, type NodeType, type NodeVO, type OperationKind, type OperationStatus, type OperationVO, type RecordByFieldInput, 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 SubmitFormDTO, type UpdateFormDTO, type UpdateVaultSettingsDTO, type UserRefVO, VIEW_FIELD_MAX_WIDTH, VIEW_FIELD_MIN_WIDTH, 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, getRecordByField, grepAssets, normalizeBaseUrl, resolveConfig, toFilesOnlyGrepResult, toUnifiedFilesGrepInput };
19656
+ 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 BusabaseAssetsClient, type BusabaseChangeRequestsClient, type BusabaseClient, type BusabaseConfig, type BusabaseRecordsClient, CREATABLE_NODE_TYPES, type ChangeRequestBatchFailureVO, type ChangeRequestCountsVO, type ChangeRequestMergeBatchResultVO, type ChangeRequestReviewBatchResultVO, type ChangeRequestStatus, type ChangeRequestTargetType, type ChangeRequestVO, type CloudContract, type CommentSubjectType, type CommentVO, type CommitVO, type CreatableNodeType, type CreateFormDTO, 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 FormBoundFieldVO, type FormFieldBindingVO, type FormPageSourceVO, type FormShareVO, type FormSubmitResultVO, type FormThemeVO, type FormVO, type GalleryCardSize, type GalleryCoverFit, type GanttScale, type LookupRollup, type NodeDetailVO, type NodeSearchResultVO, type NodeType, type NodeVO, type OperationKind, type OperationStatus, type OperationVO, type RecordByFieldInput, 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 SubmitFormDTO, type UpdateFormDTO, type UpdateVaultSettingsDTO, type UserRefVO, VIEW_FIELD_MAX_WIDTH, VIEW_FIELD_MIN_WIDTH, 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, getRecordByField, grepAssets, normalizeBaseUrl, resolveConfig, toFilesOnlyGrepResult, toUnifiedFilesGrepInput };
package/dist/index.js CHANGED
@@ -443,7 +443,7 @@ var folderNodeType = {
443
443
  var formNodeType = {
444
444
  type: "form",
445
445
  label: "Form",
446
- icon: "clipboard-list",
446
+ icon: "form",
447
447
  capabilities: { hasDetail: true, creatable: true },
448
448
  operations: []
449
449
  };
@@ -631,7 +631,11 @@ var updateNodeMetadataInputSchema = z.object({
631
631
  });
632
632
  var searchNodesByNameInputSchema = z.object({
633
633
  query: z.string().min(1),
634
- limit: z.number().int().min(1).max(50).optional().default(20)
634
+ // GET route — query params arrive as strings, and oRPC's OpenAPI handler
635
+ // does not coerce them. A bare `z.number()` here rejected every real
636
+ // `?limit=` call with "expected number, received string"; every other
637
+ // limit/page field on a GET route in this file already uses `z.coerce`.
638
+ limit: z.coerce.number().int().min(1).max(50).optional().default(20)
635
639
  });
636
640
  var nodeSearchResultSchema = z.object({
637
641
  id: z.string(),
@@ -1067,6 +1071,9 @@ var fileTreeFileSchema = z.object({
1067
1071
  assetId: z.string(),
1068
1072
  displayName: z.string().nullable()
1069
1073
  });
1074
+ var baseContentHashSchema = z.string().regex(/^sha256:[a-f0-9]{64}$/, "must be sha256:<64 lowercase hex characters>").optional().describe(
1075
+ "Optimistic-concurrency baseline hash of the file's current content, formatted exactly as `sha256:<64 lowercase hex characters>` (matches the `contentHash` on the file's backing Asset). Omit to skip the conflict check."
1076
+ );
1070
1077
  var assetFileInputSchema = z.object({
1071
1078
  path: z.string().min(1),
1072
1079
  assetId: z.string().min(1),
@@ -1084,14 +1091,14 @@ var assetFileOperationInputSchema = z.object({
1084
1091
  assetId: z.string().min(1),
1085
1092
  displayName: z.string().optional(),
1086
1093
  mimeType: z.string().optional(),
1087
- baseContentHash: z.string().optional()
1094
+ baseContentHash: baseContentHashSchema
1088
1095
  }).strict();
1089
1096
  var textFileOperationInputSchema = z.object({
1090
1097
  kind: z.enum(["create", "update"]),
1091
1098
  path: z.string().min(1),
1092
1099
  content: z.string(),
1093
1100
  mimeType: z.string().optional(),
1094
- baseContentHash: z.string().optional()
1101
+ baseContentHash: baseContentHashSchema
1095
1102
  }).strict();
1096
1103
  var fileTreeNodeSchema = z.object({
1097
1104
  node: nodeSchema,
@@ -1136,7 +1143,7 @@ var fileTreeFileOperationInputSchema = z.union([
1136
1143
  z.object({
1137
1144
  kind: z.literal("delete"),
1138
1145
  path: z.string().min(1),
1139
- baseContentHash: z.string().optional()
1146
+ baseContentHash: baseContentHashSchema
1140
1147
  }).strict(),
1141
1148
  z.object({
1142
1149
  kind: z.literal("metadata_update"),
@@ -2276,6 +2283,17 @@ var FormFieldBindingSchema = z.object({
2276
2283
  label: z.string().optional(),
2277
2284
  help: z.string().optional()
2278
2285
  });
2286
+ var FormBoundFieldSchema = z.object({
2287
+ slug: z.string(),
2288
+ name: fieldNameSchema,
2289
+ type: fieldTypeSchema,
2290
+ choices: z.array(
2291
+ z.object({
2292
+ id: z.string(),
2293
+ name: z.string()
2294
+ })
2295
+ ).default([])
2296
+ });
2279
2297
  var FormThemeSchema = z.object({
2280
2298
  logoUrl: z.string().optional(),
2281
2299
  coverUrl: z.string().optional(),
@@ -2300,6 +2318,7 @@ var FormVOSchema = z.object({
2300
2318
  name: z.string(),
2301
2319
  description: z.string(),
2302
2320
  bindings: z.array(FormFieldBindingSchema),
2321
+ boundFields: z.array(FormBoundFieldSchema).default([]),
2303
2322
  page: FormPageSourceSchema,
2304
2323
  share: FormShareSchema,
2305
2324
  /** Accepted submissions so far — backs server-side `share.submitLimit`. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "busabase-sdk",
3
- "version": "0.11.4",
3
+ "version": "0.14.0",
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",
@@ -49,9 +49,9 @@
49
49
  "tsx": "^4.20.5",
50
50
  "typescript": "^5.9.3",
51
51
  "vitest": "^2.1.8",
52
- "open-domains": "0.0.2",
52
+ "busabase-contract": "0.14.0",
53
53
  "openlib": "0.1.1",
54
- "busabase-contract": "0.11.4"
54
+ "open-domains": "0.0.2"
55
55
  },
56
56
  "engines": {
57
57
  "node": ">=24.18.0"