busabase-sdk 0.11.0 → 0.11.2

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.
Files changed (3) hide show
  1. package/dist/index.d.ts +862 -841
  2. package/dist/index.js +32 -12
  3. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -254,6 +254,10 @@ var fieldChangeRequestInputSchema = z.discriminatedUnion("operation", [
254
254
  reorderFieldsChangeRequestInputSchema.extend({ operation: z.literal("reorder"), ...withBaseId }),
255
255
  restoreFieldChangeRequestInputSchema.extend({ operation: z.literal("restore"), ...withBaseId })
256
256
  ]);
257
+ var baseLifecycleChangeRequestInputSchema = z.discriminatedUnion("operation", [
258
+ archiveBaseInputSchema.extend({ operation: z.literal("archive"), ...withBaseId }),
259
+ restoreBaseInputSchema.extend({ operation: z.literal("restore"), ...withBaseId })
260
+ ]);
257
261
 
258
262
  // ../../packages/busabase-contract/src/domains/filetree/definition.ts
259
263
  var fileTreeOperations = (type) => [
@@ -938,6 +942,19 @@ var listChangeRequestsResponseSchema = z.object({
938
942
  changeRequests: z.array(changeRequestSchema),
939
943
  nextCursor: z.string().nullable()
940
944
  });
945
+ var listChangeRequestsPageInputSchema = z.object({
946
+ page: z.coerce.number().int().min(1).optional().default(1),
947
+ pageSize: z.coerce.number().int().min(1).max(100).optional().default(50),
948
+ status: z.array(changeRequestStatusSchema).optional(),
949
+ mine: z.boolean().optional()
950
+ }).optional().default({ page: 1, pageSize: 50 });
951
+ var listChangeRequestsPageResponseSchema = z.object({
952
+ changeRequests: z.array(changeRequestSchema),
953
+ total: z.number().int().nonnegative(),
954
+ totalPages: z.number().int().nonnegative(),
955
+ page: z.number().int().min(1),
956
+ pageSize: z.number().int().min(1).max(100)
957
+ });
941
958
  var changeRequestCountsSchema = z.object({
942
959
  review: z.number().int().nonnegative(),
943
960
  changes: z.number().int().nonnegative(),
@@ -1838,20 +1855,13 @@ var baseContract = {
1838
1855
  summary: "Preview field type conversion",
1839
1856
  successDescription: "Dry-run statistics for converting a field to a different type."
1840
1857
  }).input(previewFieldConversionInputSchema.extend({ baseId: z.string() })).output(previewFieldConversionOutputSchema),
1841
- archiveChangeRequest: oc.route({
1858
+ lifecycleChangeRequest: oc.route({
1842
1859
  method: "POST",
1843
- path: "/bases/{baseId}/archive/change-requests",
1860
+ path: "/bases/{baseId}/lifecycle/change-requests",
1844
1861
  tags: ["Bases", "Change Requests"],
1845
- summary: "Archive base",
1846
- successDescription: "Created change request that archives a base."
1847
- }).input(archiveBaseInputSchema.extend({ baseId: z.string() })).output(changeRequestSchema),
1848
- restoreChangeRequest: oc.route({
1849
- method: "POST",
1850
- path: "/bases/{baseId}/restore/change-requests",
1851
- tags: ["Bases", "Change Requests"],
1852
- summary: "Restore base",
1853
- successDescription: "Created change request that restores an archived base."
1854
- }).input(restoreBaseInputSchema.extend({ baseId: z.string() })).output(changeRequestSchema)
1862
+ summary: "Create Base lifecycle change request",
1863
+ successDescription: "Created change request that moves a Base between its lifecycle states. `operation` selects the direction: `archive` (soft-delete a live Base) or `restore` (bring an archived Base back)."
1864
+ }).input(baseLifecycleChangeRequestInputSchema).output(changeRequestSchema)
1855
1865
  };
1856
1866
  var recordContract = {
1857
1867
  // One listing for records: always keyset-paginated, `baseId` always honoured,
@@ -3154,6 +3164,16 @@ var busabaseContractRoutes = {
3154
3164
  summary: "List change requests",
3155
3165
  successDescription: "A page of change requests plus an opaque nextCursor (null at the end). Filter with `status` and/or `mine`."
3156
3166
  }).input(listChangeRequestsPagedInputSchema).output(listChangeRequestsResponseSchema),
3167
+ // Numbered paging alongside the cursor listing, mirroring records.listPage.
3168
+ // Keyset is right for "keep scrolling"; a reviewer working a 2,000-item tab
3169
+ // needs to jump to page 30 and to see how many pages there are at all.
3170
+ listPage: oc.route({
3171
+ method: "GET",
3172
+ path: "/change-requests/page",
3173
+ tags: ["Change Requests"],
3174
+ summary: "List a numbered change request page",
3175
+ successDescription: "A random-access page of change requests plus the total across the whole filter. Same `status` / `mine` filters as the cursor listing."
3176
+ }).input(listChangeRequestsPageInputSchema).output(listChangeRequestsPageResponseSchema),
3157
3177
  counts: oc.route({
3158
3178
  method: "GET",
3159
3179
  path: "/change-requests/counts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "busabase-sdk",
3
- "version": "0.11.0",
3
+ "version": "0.11.2",
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.11.0",
52
+ "open-domains": "0.0.2",
53
53
  "openlib": "0.1.1",
54
- "open-domains": "0.0.2"
54
+ "busabase-contract": "0.11.2"
55
55
  },
56
56
  "engines": {
57
57
  "node": ">=24.18.0"