busabase-sdk 0.10.0 → 0.10.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
@@ -20520,6 +20520,202 @@ declare const cloudContract: {
20520
20520
  author: z.ZodDefault<z.ZodOptional<z.ZodString>>;
20521
20521
  baseCommitId: z.ZodOptional<z.ZodString>;
20522
20522
  recordId: z.ZodString;
20523
+ autoMerge: z.ZodOptional<z.ZodBoolean>;
20524
+ }, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
20525
+ id: z.ZodString;
20526
+ baseId: z.ZodString;
20527
+ headCommitId: z.ZodString;
20528
+ parentRecordId: z.ZodNullable<z.ZodString>;
20529
+ parentCommitId: z.ZodNullable<z.ZodString>;
20530
+ status: z.ZodEnum<{
20531
+ archived: "archived";
20532
+ active: "active";
20533
+ }>;
20534
+ createdBy: z.ZodString;
20535
+ createdByUser: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodObject<{
20536
+ id: z.ZodString;
20537
+ name: z.ZodNullable<z.ZodString>;
20538
+ email: z.ZodNullable<z.ZodString>;
20539
+ image: z.ZodNullable<z.ZodString>;
20540
+ role: z.ZodOptional<z.ZodNullable<z.ZodString>>;
20541
+ }, z.core.$strip>>>>;
20542
+ archivedAt: z.ZodNullable<z.ZodString>;
20543
+ createdAt: z.ZodString;
20544
+ updatedAt: z.ZodString;
20545
+ base: z.ZodObject<{
20546
+ id: z.ZodString;
20547
+ nodeId: z.ZodString;
20548
+ slug: z.ZodString;
20549
+ name: z.ZodString;
20550
+ description: z.ZodString;
20551
+ reviewPolicy: z.ZodObject<{
20552
+ kind: z.ZodLiteral<"single">;
20553
+ requiredApprovals: z.ZodNumber;
20554
+ }, z.core.$strip>;
20555
+ createdAt: z.ZodString;
20556
+ fields: z.ZodArray<z.ZodObject<{
20557
+ id: z.ZodString;
20558
+ baseId: z.ZodString;
20559
+ slug: z.ZodString;
20560
+ name: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodEnum<{
20561
+ en: "en";
20562
+ "zh-CN": "zh-CN";
20563
+ "zh-TW": "zh-TW";
20564
+ ja: "ja";
20565
+ ko: "ko";
20566
+ de: "de";
20567
+ fr: "fr";
20568
+ es: "es";
20569
+ pt: "pt";
20570
+ }> & z.core.$partial, z.ZodString>]>;
20571
+ type: z.ZodEnum<{
20572
+ number: "number";
20573
+ email: "email";
20574
+ date: "date";
20575
+ text: "text";
20576
+ whiteboard: "whiteboard";
20577
+ html: "html";
20578
+ longtext: "longtext";
20579
+ markdown: "markdown";
20580
+ attachment: "attachment";
20581
+ relation: "relation";
20582
+ checkbox: "checkbox";
20583
+ select: "select";
20584
+ multiselect: "multiselect";
20585
+ url: "url";
20586
+ embed: "embed";
20587
+ phone: "phone";
20588
+ created_time: "created_time";
20589
+ updated_time: "updated_time";
20590
+ created_by: "created_by";
20591
+ updated_by: "updated_by";
20592
+ auto_number: "auto_number";
20593
+ ai_summary: "ai_summary";
20594
+ ai_tags: "ai_tags";
20595
+ code: "code";
20596
+ json: "json";
20597
+ yaml: "yaml";
20598
+ formula: "formula";
20599
+ lookup: "lookup";
20600
+ }>;
20601
+ required: z.ZodBoolean;
20602
+ position: z.ZodNumber;
20603
+ options: z.ZodDefault<z.ZodObject<{
20604
+ ai: z.ZodOptional<z.ZodObject<{
20605
+ model: z.ZodOptional<z.ZodString>;
20606
+ prompt: z.ZodOptional<z.ZodString>;
20607
+ reviewRequired: z.ZodOptional<z.ZodBoolean>;
20608
+ sourceFieldIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
20609
+ }, z.core.$strip>>;
20610
+ attachment: z.ZodOptional<z.ZodObject<{
20611
+ maxFiles: z.ZodOptional<z.ZodNumber>;
20612
+ allowedMimeTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
20613
+ maxFileSize: z.ZodOptional<z.ZodNumber>;
20614
+ }, z.core.$strip>>;
20615
+ choices: z.ZodOptional<z.ZodArray<z.ZodObject<{
20616
+ color: z.ZodOptional<z.ZodString>;
20617
+ id: z.ZodString;
20618
+ name: z.ZodString;
20619
+ }, z.core.$strip>>>;
20620
+ code: z.ZodOptional<z.ZodObject<{
20621
+ language: z.ZodOptional<z.ZodString>;
20622
+ }, z.core.$strip>>;
20623
+ embed: z.ZodOptional<z.ZodObject<{
20624
+ aspectRatio: z.ZodOptional<z.ZodEnum<{
20625
+ "16:9": "16:9";
20626
+ "4:3": "4:3";
20627
+ "1:1": "1:1";
20628
+ }>>;
20629
+ height: z.ZodOptional<z.ZodNumber>;
20630
+ providers: z.ZodOptional<z.ZodArray<z.ZodString>>;
20631
+ }, z.core.$strip>>;
20632
+ formula: z.ZodOptional<z.ZodObject<{
20633
+ expression: z.ZodString;
20634
+ }, z.core.$strip>>;
20635
+ inverseFieldId: z.ZodOptional<z.ZodString>;
20636
+ lookup: z.ZodOptional<z.ZodObject<{
20637
+ relationFieldSlug: z.ZodString;
20638
+ targetFieldSlug: z.ZodString;
20639
+ rollup: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
20640
+ values: "values";
20641
+ count: "count";
20642
+ sum: "sum";
20643
+ average: "average";
20644
+ min: "min";
20645
+ max: "max";
20646
+ concatenate: "concatenate";
20647
+ }>>>;
20648
+ limit: z.ZodOptional<z.ZodEnum<{
20649
+ all: "all";
20650
+ first: "first";
20651
+ }>>;
20652
+ }, z.core.$strip>>;
20653
+ multiple: z.ZodOptional<z.ZodBoolean>;
20654
+ number: z.ZodOptional<z.ZodObject<{
20655
+ format: z.ZodOptional<z.ZodEnum<{
20656
+ plain: "plain";
20657
+ currency: "currency";
20658
+ }>>;
20659
+ currency: z.ZodOptional<z.ZodString>;
20660
+ locale: z.ZodOptional<z.ZodString>;
20661
+ }, z.core.$strip>>;
20662
+ targetBaseId: z.ZodOptional<z.ZodString>;
20663
+ targetBaseSlug: z.ZodOptional<z.ZodString>;
20664
+ }, z.core.$strip>>;
20665
+ }, z.core.$strip>>;
20666
+ }, z.core.$strip>;
20667
+ headCommit: z.ZodObject<{
20668
+ id: z.ZodString;
20669
+ baseId: z.ZodNullable<z.ZodString>;
20670
+ targetType: z.ZodEnum<{
20671
+ base: "base";
20672
+ node: "node";
20673
+ }>;
20674
+ nodeId: z.ZodNullable<z.ZodString>;
20675
+ operationId: z.ZodNullable<z.ZodString>;
20676
+ parentCommitId: z.ZodNullable<z.ZodString>;
20677
+ fields: z.ZodRecord<z.ZodString, z.ZodUnknown>;
20678
+ operation: z.ZodEnum<{
20679
+ [x: `${string}_file_create`]: `${string}_file_create`;
20680
+ [x: `${string}_file_update`]: `${string}_file_update`;
20681
+ [x: `${string}_file_delete`]: `${string}_file_delete`;
20682
+ [x: `${string}_metadata_update`]: `${string}_metadata_update`;
20683
+ record_create: "record_create";
20684
+ record_update: "record_update";
20685
+ record_delete: "record_delete";
20686
+ record_variant: "record_variant";
20687
+ view_create: "view_create";
20688
+ view_update: "view_update";
20689
+ view_delete: "view_delete";
20690
+ view_restore: "view_restore";
20691
+ base_add_field: "base_add_field";
20692
+ base_delete_field: "base_delete_field";
20693
+ base_update_field: "base_update_field";
20694
+ base_convert_field: "base_convert_field";
20695
+ base_reorder_fields: "base_reorder_fields";
20696
+ base_restore_field: "base_restore_field";
20697
+ base_archive: "base_archive";
20698
+ base_restore: "base_restore";
20699
+ record_restore: "record_restore";
20700
+ doc_update: "doc_update";
20701
+ node_create: "node_create";
20702
+ node_rename: "node_rename";
20703
+ node_delete: "node_delete";
20704
+ node_restore: "node_restore";
20705
+ node_move: "node_move";
20706
+ }>;
20707
+ message: z.ZodString;
20708
+ author: z.ZodString;
20709
+ authorUser: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodObject<{
20710
+ id: z.ZodString;
20711
+ name: z.ZodNullable<z.ZodString>;
20712
+ email: z.ZodNullable<z.ZodString>;
20713
+ image: z.ZodNullable<z.ZodString>;
20714
+ role: z.ZodOptional<z.ZodNullable<z.ZodString>>;
20715
+ }, z.core.$strip>>>>;
20716
+ createdAt: z.ZodString;
20717
+ }, z.core.$strip>;
20718
+ materialized: z.ZodLiteral<true>;
20523
20719
  }, z.core.$strip>, z.ZodObject<{
20524
20720
  id: z.ZodString;
20525
20721
  baseId: z.ZodNullable<z.ZodString>;
@@ -20920,7 +21116,8 @@ declare const cloudContract: {
20920
21116
  visibleOperationHeads: z.ZodRecord<z.ZodString, z.ZodString>;
20921
21117
  createdAt: z.ZodString;
20922
21118
  }, z.core.$strip>>;
20923
- }, z.core.$strip>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
21119
+ materialized: z.ZodLiteral<false>;
21120
+ }, z.core.$strip>]>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
20924
21121
  deleteChangeRequest: _orpc_contract.ContractProcedure<z.ZodObject<{
20925
21122
  message: z.ZodDefault<z.ZodOptional<z.ZodString>>;
20926
21123
  submittedBy: z.ZodDefault<z.ZodOptional<z.ZodString>>;
package/dist/index.js CHANGED
@@ -1860,8 +1860,18 @@ var recordContract = {
1860
1860
  path: "/records/{recordId}/change-requests",
1861
1861
  tags: ["Records", "Change Requests"],
1862
1862
  summary: "Create record update change request",
1863
- successDescription: "Created change request that proposes updating a canonical record."
1864
- }).input(reviseOperationInputSchema.extend({ recordId: z.string() })).output(changeRequestSchema),
1863
+ successDescription: "Permission-aware by default: updates the record immediately when the actor has write access, otherwise returns a pending ChangeRequest. Pass `autoMerge: false` to force review."
1864
+ }).input(
1865
+ reviseOperationInputSchema.extend({
1866
+ recordId: z.string(),
1867
+ autoMerge: z.boolean().optional()
1868
+ })
1869
+ ).output(
1870
+ z.union([
1871
+ recordSchema.extend({ materialized: z.literal(true) }),
1872
+ changeRequestSchema.extend({ materialized: z.literal(false) })
1873
+ ])
1874
+ ),
1865
1875
  deleteChangeRequest: oc.route({
1866
1876
  method: "DELETE",
1867
1877
  path: "/records/{recordId}/change-requests",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "busabase-sdk",
3
- "version": "0.10.0",
3
+ "version": "0.10.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",
@@ -41,9 +41,9 @@
41
41
  "tsx": "^4.20.5",
42
42
  "typescript": "^5.9.3",
43
43
  "vitest": "^2.1.8",
44
- "openlib": "0.1.1",
45
- "busabase-contract": "0.10.0",
46
- "open-domains": "0.0.2"
44
+ "busabase-contract": "0.10.1",
45
+ "open-domains": "0.0.2",
46
+ "openlib": "0.1.1"
47
47
  },
48
48
  "engines": {
49
49
  "node": ">=24.18.0"