busabase-sdk 0.14.0 → 0.14.1

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
@@ -285,7 +285,7 @@ type OperationKind = GenericOperationKind | RegisteredOperationKind;
285
285
  * of truth). `schema/` is reserved for DB (PO); DTO/VO live here.
286
286
  *
287
287
  * Kernel-generic: `metadata` is an open record (apps layer their own typed
288
- * metadata on top — e.g. `apps/busabase-cloud`'s `AttachmentType` enum).
288
+ * metadata on top — e.g. Busabase Cloud's `AttachmentType` enum).
289
289
  */
290
290
 
291
291
  /**
@@ -662,6 +662,102 @@ declare const FormVOSchema: z.ZodObject<{
662
662
  updatedAt: z.ZodString;
663
663
  }, z.core.$strip>;
664
664
  type FormVO = z.infer<typeof FormVOSchema>;
665
+ declare const ListFormsInputSchema: z.ZodObject<{
666
+ targetBaseId: z.ZodString;
667
+ limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
668
+ cursor: z.ZodOptional<z.ZodString>;
669
+ }, z.core.$strip>;
670
+ type ListFormsDTO = z.infer<typeof ListFormsInputSchema>;
671
+ declare const ListFormsVOSchema: z.ZodObject<{
672
+ forms: z.ZodArray<z.ZodObject<{
673
+ id: z.ZodString;
674
+ nodeId: z.ZodString;
675
+ spaceId: z.ZodString;
676
+ targetBaseId: z.ZodString;
677
+ name: z.ZodString;
678
+ description: z.ZodString;
679
+ bindings: z.ZodArray<z.ZodObject<{
680
+ inputName: z.ZodString;
681
+ fieldSlug: z.ZodString;
682
+ required: z.ZodOptional<z.ZodBoolean>;
683
+ label: z.ZodOptional<z.ZodString>;
684
+ help: z.ZodOptional<z.ZodString>;
685
+ }, z.core.$strip>>;
686
+ boundFields: z.ZodDefault<z.ZodArray<z.ZodObject<{
687
+ slug: z.ZodString;
688
+ name: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodEnum<{
689
+ en: "en";
690
+ "zh-CN": "zh-CN";
691
+ "zh-TW": "zh-TW";
692
+ ja: "ja";
693
+ ko: "ko";
694
+ de: "de";
695
+ fr: "fr";
696
+ es: "es";
697
+ pt: "pt";
698
+ }> & z.core.$partial, z.ZodString>]>;
699
+ type: z.ZodEnum<{
700
+ number: "number";
701
+ email: "email";
702
+ date: "date";
703
+ text: "text";
704
+ whiteboard: "whiteboard";
705
+ html: "html";
706
+ longtext: "longtext";
707
+ markdown: "markdown";
708
+ attachment: "attachment";
709
+ relation: "relation";
710
+ checkbox: "checkbox";
711
+ select: "select";
712
+ multiselect: "multiselect";
713
+ url: "url";
714
+ embed: "embed";
715
+ phone: "phone";
716
+ created_time: "created_time";
717
+ updated_time: "updated_time";
718
+ created_by: "created_by";
719
+ updated_by: "updated_by";
720
+ auto_number: "auto_number";
721
+ ai_summary: "ai_summary";
722
+ ai_tags: "ai_tags";
723
+ code: "code";
724
+ json: "json";
725
+ yaml: "yaml";
726
+ formula: "formula";
727
+ lookup: "lookup";
728
+ }>;
729
+ choices: z.ZodDefault<z.ZodArray<z.ZodObject<{
730
+ id: z.ZodString;
731
+ name: z.ZodString;
732
+ }, z.core.$strip>>>;
733
+ }, z.core.$strip>>>;
734
+ page: z.ZodObject<{
735
+ code: z.ZodOptional<z.ZodString>;
736
+ theme: z.ZodOptional<z.ZodObject<{
737
+ logoUrl: z.ZodOptional<z.ZodString>;
738
+ coverUrl: z.ZodOptional<z.ZodString>;
739
+ brandColor: z.ZodOptional<z.ZodString>;
740
+ hideBranding: z.ZodOptional<z.ZodBoolean>;
741
+ }, z.core.$strip>>;
742
+ }, z.core.$strip>;
743
+ share: z.ZodObject<{
744
+ isPublic: z.ZodDefault<z.ZodBoolean>;
745
+ anonymousSubmit: z.ZodDefault<z.ZodBoolean>;
746
+ submitLimit: z.ZodOptional<z.ZodNumber>;
747
+ requireCaptcha: z.ZodOptional<z.ZodBoolean>;
748
+ }, z.core.$strip>;
749
+ submissionCount: z.ZodDefault<z.ZodNumber>;
750
+ status: z.ZodEnum<{
751
+ active: "active";
752
+ archived: "archived";
753
+ }>;
754
+ createdBy: z.ZodString;
755
+ createdAt: z.ZodString;
756
+ updatedAt: z.ZodString;
757
+ }, z.core.$strip>>;
758
+ nextCursor: z.ZodNullable<z.ZodString>;
759
+ }, z.core.$strip>;
760
+ type ListFormsVO = z.infer<typeof ListFormsVOSchema>;
665
761
  declare const CreateFormInputSchema: z.ZodObject<{
666
762
  nodeId: z.ZodString;
667
763
  targetBaseId: z.ZodString;
@@ -2529,8 +2625,7 @@ interface UserRefVO {
2529
2625
  role?: string | null;
2530
2626
  }
2531
2627
  /**
2532
- * Cheap, name/slug-only match from `nodes.searchByName` (see
2533
- * `apps/busabase/content/spec/search-quick-jump.md`) — deliberately a much
2628
+ * Cheap, name/slug-only match from `nodes.searchByName` — deliberately a much
2534
2629
  * smaller projection than `NodeVO` (no `description`/`metadata`/tree shape):
2535
2630
  * this backs the dashboard's instant quick-jump palette, not the sidebar tree
2536
2631
  * or a node's own detail view. `path` is the route this node navigates to
@@ -2729,7 +2824,7 @@ interface AuditEventVO {
2729
2824
 
2730
2825
  /**
2731
2826
  * Unified Grep (P2a files+docs, P2b records) — top-level, domain-agnostic
2732
- * schemas for `POST /grep`. See apps/busabase/content/spec/unified-grep.md.
2827
+ * schemas for `POST /grep`.
2733
2828
  *
2734
2829
  * Mirrors how `search`'s schemas live top-level in `contract/schemas.ts`
2735
2830
  * rather than inside a single domain's contract: `grep` composes multiple
@@ -12070,6 +12165,99 @@ declare const cloudContract: {
12070
12165
  }, z.core.$strip>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
12071
12166
  };
12072
12167
  forms: {
12168
+ list: _orpc_contract.ContractProcedure<z.ZodObject<{
12169
+ targetBaseId: z.ZodString;
12170
+ limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
12171
+ cursor: z.ZodOptional<z.ZodString>;
12172
+ }, z.core.$strip>, z.ZodObject<{
12173
+ forms: z.ZodArray<z.ZodObject<{
12174
+ id: z.ZodString;
12175
+ nodeId: z.ZodString;
12176
+ spaceId: z.ZodString;
12177
+ targetBaseId: z.ZodString;
12178
+ name: z.ZodString;
12179
+ description: z.ZodString;
12180
+ bindings: z.ZodArray<z.ZodObject<{
12181
+ inputName: z.ZodString;
12182
+ fieldSlug: z.ZodString;
12183
+ required: z.ZodOptional<z.ZodBoolean>;
12184
+ label: z.ZodOptional<z.ZodString>;
12185
+ help: z.ZodOptional<z.ZodString>;
12186
+ }, z.core.$strip>>;
12187
+ boundFields: z.ZodDefault<z.ZodArray<z.ZodObject<{
12188
+ slug: z.ZodString;
12189
+ name: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodEnum<{
12190
+ en: "en";
12191
+ "zh-CN": "zh-CN";
12192
+ "zh-TW": "zh-TW";
12193
+ ja: "ja";
12194
+ ko: "ko";
12195
+ de: "de";
12196
+ fr: "fr";
12197
+ es: "es";
12198
+ pt: "pt";
12199
+ }> & z.core.$partial, z.ZodString>]>;
12200
+ type: z.ZodEnum<{
12201
+ number: "number";
12202
+ email: "email";
12203
+ date: "date";
12204
+ text: "text";
12205
+ whiteboard: "whiteboard";
12206
+ html: "html";
12207
+ longtext: "longtext";
12208
+ markdown: "markdown";
12209
+ attachment: "attachment";
12210
+ relation: "relation";
12211
+ checkbox: "checkbox";
12212
+ select: "select";
12213
+ multiselect: "multiselect";
12214
+ url: "url";
12215
+ embed: "embed";
12216
+ phone: "phone";
12217
+ created_time: "created_time";
12218
+ updated_time: "updated_time";
12219
+ created_by: "created_by";
12220
+ updated_by: "updated_by";
12221
+ auto_number: "auto_number";
12222
+ ai_summary: "ai_summary";
12223
+ ai_tags: "ai_tags";
12224
+ code: "code";
12225
+ json: "json";
12226
+ yaml: "yaml";
12227
+ formula: "formula";
12228
+ lookup: "lookup";
12229
+ }>;
12230
+ choices: z.ZodDefault<z.ZodArray<z.ZodObject<{
12231
+ id: z.ZodString;
12232
+ name: z.ZodString;
12233
+ }, z.core.$strip>>>;
12234
+ }, z.core.$strip>>>;
12235
+ page: z.ZodObject<{
12236
+ code: z.ZodOptional<z.ZodString>;
12237
+ theme: z.ZodOptional<z.ZodObject<{
12238
+ logoUrl: z.ZodOptional<z.ZodString>;
12239
+ coverUrl: z.ZodOptional<z.ZodString>;
12240
+ brandColor: z.ZodOptional<z.ZodString>;
12241
+ hideBranding: z.ZodOptional<z.ZodBoolean>;
12242
+ }, z.core.$strip>>;
12243
+ }, z.core.$strip>;
12244
+ share: z.ZodObject<{
12245
+ isPublic: z.ZodDefault<z.ZodBoolean>;
12246
+ anonymousSubmit: z.ZodDefault<z.ZodBoolean>;
12247
+ submitLimit: z.ZodOptional<z.ZodNumber>;
12248
+ requireCaptcha: z.ZodOptional<z.ZodBoolean>;
12249
+ }, z.core.$strip>;
12250
+ submissionCount: z.ZodDefault<z.ZodNumber>;
12251
+ status: z.ZodEnum<{
12252
+ active: "active";
12253
+ archived: "archived";
12254
+ }>;
12255
+ createdBy: z.ZodString;
12256
+ createdAt: z.ZodString;
12257
+ updatedAt: z.ZodString;
12258
+ }, z.core.$strip>>;
12259
+ nextCursor: z.ZodNullable<z.ZodString>;
12260
+ }, z.core.$strip>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
12073
12261
  getByNode: _orpc_contract.ContractProcedure<z.ZodObject<{
12074
12262
  nodeId: z.ZodString;
12075
12263
  }, z.core.$strip>, z.ZodObject<{
@@ -19653,4 +19841,4 @@ declare class Busabase {
19653
19841
  }>>>>;
19654
19842
  }
19655
19843
 
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 };
19844
+ 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 ListFormsDTO, type ListFormsVO, 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
@@ -2328,6 +2328,16 @@ var FormVOSchema = z.object({
2328
2328
  createdAt: z.string(),
2329
2329
  updatedAt: z.string()
2330
2330
  });
2331
+ var ListFormsInputSchema = z.object({
2332
+ targetBaseId: z.string().min(1),
2333
+ limit: z.coerce.number().int().min(1).max(100).optional().default(50),
2334
+ /** Opaque createdAt/id keyset cursor. */
2335
+ cursor: z.string().optional()
2336
+ });
2337
+ var ListFormsVOSchema = z.object({
2338
+ forms: z.array(FormVOSchema),
2339
+ nextCursor: z.string().nullable()
2340
+ });
2331
2341
  var CreateFormInputSchema = z.object({
2332
2342
  nodeId: z.string().min(1),
2333
2343
  targetBaseId: z.string().min(1),
@@ -2355,6 +2365,13 @@ var FormSubmitResultSchema = z.object({
2355
2365
 
2356
2366
  // ../../packages/busabase-contract/src/domains/form/contract.ts
2357
2367
  var formContract = {
2368
+ list: oc.route({
2369
+ method: "GET",
2370
+ path: "/forms",
2371
+ tags: ["Forms"],
2372
+ summary: "List forms bound to a Base",
2373
+ successDescription: "A newest-first page of forms with a stable opaque cursor (null at the end)."
2374
+ }).input(ListFormsInputSchema).output(ListFormsVOSchema),
2358
2375
  getByNode: oc.route({
2359
2376
  method: "GET",
2360
2377
  path: "/forms/{nodeId}",
@@ -3041,7 +3058,7 @@ var busabaseContractRoutes = {
3041
3058
  path: "/nodes/search",
3042
3059
  tags: ["Nodes", "Search"],
3043
3060
  summary: "Search nodes by name/slug (cheap, name-only quick-jump)",
3044
- successDescription: "Plain ilike match on name/slug across every registered node type, scoped by the same node-visibility ACL as `nodes.list`. No content scan and no full-text ranking \u2014 ordered exact-slug-match first, then by name. Backs the dashboard search dialog's 'Recent' tab cache-miss path (see apps/busabase/content/spec/search-quick-jump.md); the heavier `search` endpoint remains the dedicated full-text content search."
3061
+ successDescription: "Plain ilike match on name/slug across every registered node type, scoped by the same node-visibility ACL as `nodes.list`. No content scan and no full-text ranking \u2014 ordered exact-slug-match first, then by name. Backs the dashboard search dialog's 'Recent' tab cache-miss path; the heavier `search` endpoint remains the dedicated full-text content search."
3045
3062
  }).input(searchNodesByNameInputSchema).output(z.array(nodeSearchResultSchema)),
3046
3063
  isDescendant: oc.route({
3047
3064
  method: "GET",
@@ -3556,9 +3573,9 @@ var cloudExtraRoutes = {
3556
3573
  })
3557
3574
  ).output(AgentTaskDetailSchema)
3558
3575
  },
3559
- // Relative-path twin of `embedLinksContract`
3560
- // (apps/busabase-cloud/src/domains/embed-links/contract.ts, served at the absolute
3561
- // `/api/v1/embed-links` paths) — same schemas imported from `./embed-link-schemas`, just
3576
+ // Relative-path twin of the `embedLinksContract` the Busabase Cloud host
3577
+ // serves at the absolute `/api/v1/embed-links` paths same schemas
3578
+ // imported from `./embed-link-schemas`, just
3562
3579
  // routed relative here so the shared `/api/v1` prefix below lands on the identical real path.
3563
3580
  embedLinks: {
3564
3581
  create: oc.route({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "busabase-sdk",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
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
- "busabase-contract": "0.14.0",
53
- "openlib": "0.1.1",
54
- "open-domains": "0.0.2"
52
+ "busabase-contract": "0.14.1",
53
+ "open-domains": "0.0.2",
54
+ "openlib": "0.1.1"
55
55
  },
56
56
  "engines": {
57
57
  "node": ">=24.18.0"