busabase-sdk 0.9.8 → 0.9.9
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 +40 -2
- package/dist/index.js +52 -2
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -512,6 +512,19 @@ declare const cloudContract: {
|
|
|
512
512
|
parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
513
513
|
depth: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
514
514
|
}, 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>>;
|
|
515
|
+
searchByName: _orpc_contract.ContractProcedure<z.ZodObject<{
|
|
516
|
+
query: z.ZodString;
|
|
517
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
518
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
519
|
+
id: z.ZodString;
|
|
520
|
+
type: z.ZodEnum<{
|
|
521
|
+
[x: string]: string;
|
|
522
|
+
}>;
|
|
523
|
+
name: z.ZodString;
|
|
524
|
+
slug: z.ZodString;
|
|
525
|
+
path: z.ZodString;
|
|
526
|
+
updatedAt: z.ZodString;
|
|
527
|
+
}, z.core.$strip>>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
515
528
|
isDescendant: _orpc_contract.ContractProcedure<z.ZodObject<{
|
|
516
529
|
nodeId: z.ZodString;
|
|
517
530
|
potentialAncestorId: z.ZodString;
|
|
@@ -14729,6 +14742,15 @@ declare const cloudContract: {
|
|
|
14729
14742
|
rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
14730
14743
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
14731
14744
|
}, z.core.$strip>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
14745
|
+
exportAssetText: _orpc_contract.ContractProcedure<z.ZodObject<{
|
|
14746
|
+
assetId: z.ZodString;
|
|
14747
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
14748
|
+
assetId: z.ZodString;
|
|
14749
|
+
textStorageKey: z.ZodString;
|
|
14750
|
+
downloadUrl: z.ZodNullable<z.ZodString>;
|
|
14751
|
+
textContentHash: z.ZodNullable<z.ZodString>;
|
|
14752
|
+
byteCount: z.ZodNumber;
|
|
14753
|
+
}, z.core.$strip>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
14732
14754
|
importBegin: _orpc_contract.ContractProcedure<_orpc_contract.Schema<unknown, unknown>, z.ZodObject<{
|
|
14733
14755
|
sessionId: z.ZodString;
|
|
14734
14756
|
}, z.core.$strip>, _orpc_contract.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
@@ -14753,7 +14775,7 @@ declare const cloudContract: {
|
|
|
14753
14775
|
commits: "commits";
|
|
14754
14776
|
changeRequests: "changeRequests";
|
|
14755
14777
|
auditEvents: "auditEvents";
|
|
14756
|
-
}>, z.ZodLiteral<"docBodies">, z.ZodLiteral<"attachmentBlobs">]>;
|
|
14778
|
+
}>, z.ZodLiteral<"docBodies">, z.ZodLiteral<"attachmentBlobs">, z.ZodLiteral<"assetTextBlobs">]>;
|
|
14757
14779
|
rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
14758
14780
|
}, z.core.$strip>, z.ZodObject<{
|
|
14759
14781
|
inserted: z.ZodNumber;
|
|
@@ -23025,6 +23047,22 @@ interface UserRefVO {
|
|
|
23025
23047
|
image: string | null;
|
|
23026
23048
|
role?: string | null;
|
|
23027
23049
|
}
|
|
23050
|
+
/**
|
|
23051
|
+
* Cheap, name/slug-only match from `nodes.searchByName` (see
|
|
23052
|
+
* `apps/busabase/content/spec/search-quick-jump.md`) — deliberately a much
|
|
23053
|
+
* smaller projection than `NodeVO` (no `description`/`metadata`/tree shape):
|
|
23054
|
+
* this backs the dashboard's instant quick-jump palette, not the sidebar tree
|
|
23055
|
+
* or a node's own detail view. `path` is the route this node navigates to
|
|
23056
|
+
* (e.g. `/base/{slug}`), not a filesystem/breadcrumb tree path.
|
|
23057
|
+
*/
|
|
23058
|
+
interface NodeSearchResultVO {
|
|
23059
|
+
id: string;
|
|
23060
|
+
type: NodeType;
|
|
23061
|
+
name: string;
|
|
23062
|
+
slug: string;
|
|
23063
|
+
path: string;
|
|
23064
|
+
updatedAt: string;
|
|
23065
|
+
}
|
|
23028
23066
|
interface NodeVO {
|
|
23029
23067
|
id: string;
|
|
23030
23068
|
parentId: string | null;
|
|
@@ -23351,4 +23389,4 @@ declare class Busabase {
|
|
|
23351
23389
|
}>>>>;
|
|
23352
23390
|
}
|
|
23353
23391
|
|
|
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 };
|
|
23392
|
+
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 NodeSearchResultVO, 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
|
@@ -459,6 +459,18 @@ var isDescendantInputSchema = z.object({
|
|
|
459
459
|
var isDescendantOutputSchema = z.object({
|
|
460
460
|
isDescendant: z.boolean()
|
|
461
461
|
});
|
|
462
|
+
var searchNodesByNameInputSchema = z.object({
|
|
463
|
+
query: z.string().min(1),
|
|
464
|
+
limit: z.number().int().min(1).max(50).optional().default(20)
|
|
465
|
+
});
|
|
466
|
+
var nodeSearchResultSchema = z.object({
|
|
467
|
+
id: z.string(),
|
|
468
|
+
type: z.enum(NODE_TYPES),
|
|
469
|
+
name: z.string(),
|
|
470
|
+
slug: z.string(),
|
|
471
|
+
path: z.string(),
|
|
472
|
+
updatedAt: z.string()
|
|
473
|
+
});
|
|
462
474
|
var userRefSchema = z.object({
|
|
463
475
|
id: z.string(),
|
|
464
476
|
name: z.string().nullable(),
|
|
@@ -1907,12 +1919,36 @@ var ExportTablesVOSchema = z.object({
|
|
|
1907
1919
|
rows: z.array(z.record(z.string(), z.unknown())),
|
|
1908
1920
|
nextCursor: z.string().nullable()
|
|
1909
1921
|
});
|
|
1922
|
+
var ExportAssetTextInputSchema = z.object({ assetId: z.string() });
|
|
1923
|
+
var ExportAssetTextVOSchema = z.object({
|
|
1924
|
+
assetId: z.string(),
|
|
1925
|
+
/** The row's `text_storage_key` — the exact key a restore must write back to. */
|
|
1926
|
+
textStorageKey: z.string(),
|
|
1927
|
+
/**
|
|
1928
|
+
* `null` when this row owns no separate text object and therefore needs no
|
|
1929
|
+
* blob in the archive:
|
|
1930
|
+
* - auto-registered text-kind rows (`writtenBy: "auto"`), whose
|
|
1931
|
+
* `textStorageKey` IS the owning attachment's own key — those bytes are
|
|
1932
|
+
* already archived by the attachment-blob pass, and re-archiving them
|
|
1933
|
+
* would duplicate bytes and collide on restore;
|
|
1934
|
+
* - `status: "none"` rows (no extractable text), whose key is `""`.
|
|
1935
|
+
*/
|
|
1936
|
+
downloadUrl: z.string().nullable(),
|
|
1937
|
+
/** `sha256:<hex>` of the text bytes, so a backup can verify what it downloaded. */
|
|
1938
|
+
textContentHash: z.string().nullable(),
|
|
1939
|
+
byteCount: z.number().int().nonnegative()
|
|
1940
|
+
});
|
|
1910
1941
|
var ImportBeginVOSchema = z.object({
|
|
1911
1942
|
sessionId: z.string()
|
|
1912
1943
|
});
|
|
1913
1944
|
var ImportTablesInputSchema = z.object({
|
|
1914
1945
|
sessionId: z.string(),
|
|
1915
|
-
table: z.union([
|
|
1946
|
+
table: z.union([
|
|
1947
|
+
DumpTableSchema,
|
|
1948
|
+
z.literal("docBodies"),
|
|
1949
|
+
z.literal("attachmentBlobs"),
|
|
1950
|
+
z.literal("assetTextBlobs")
|
|
1951
|
+
]),
|
|
1916
1952
|
rows: z.array(z.record(z.string(), z.unknown()))
|
|
1917
1953
|
});
|
|
1918
1954
|
var ImportTablesVOSchema = z.object({
|
|
@@ -1938,6 +1974,13 @@ var dumpContract = {
|
|
|
1938
1974
|
summary: "Export raw rows for one table (cursor-paginated)",
|
|
1939
1975
|
successDescription: "A page of raw rows for the requested table (id-ordered), plus an opaque nextCursor (null at the end). Vault items and webhook secrets are never exportable through this endpoint."
|
|
1940
1976
|
}).input(ExportTablesInputSchema).output(ExportTablesVOSchema),
|
|
1977
|
+
exportAssetText: oc.route({
|
|
1978
|
+
method: "GET",
|
|
1979
|
+
path: "/dump/export/asset-texts/{assetId}/content",
|
|
1980
|
+
tags: ["Dump"],
|
|
1981
|
+
summary: "Resolve the download URL for one asset's extracted-text object",
|
|
1982
|
+
successDescription: "A resolved download URL for the asset's DERIVED text blob (`asset-texts/blobs/sha256/\u2026`) plus its `textStorageKey` and `textContentHash`, so a backup can archive the exact bytes and verify them. `downloadUrl` is null when the row owns no separate object (auto-registered text-kind rows point at their attachment's own key, already covered by the attachment blobs; `status: \"none\"` rows have no text at all)."
|
|
1983
|
+
}).input(ExportAssetTextInputSchema).output(ExportAssetTextVOSchema),
|
|
1941
1984
|
importBegin: oc.route({
|
|
1942
1985
|
method: "POST",
|
|
1943
1986
|
path: "/dump/import/begin",
|
|
@@ -1950,7 +1993,7 @@ var dumpContract = {
|
|
|
1950
1993
|
path: "/dump/import/tables",
|
|
1951
1994
|
tags: ["Dump"],
|
|
1952
1995
|
summary: "Import a batch of raw rows into an open session",
|
|
1953
|
-
successDescription: "Inserted rows preserving their original ids. `docBodies`
|
|
1996
|
+
successDescription: "Inserted rows preserving their original ids. `docBodies` ({nodeId, markdown}[]), `attachmentBlobs` ({storageKey, mimeType, base64}[]) and `assetTextBlobs` ({textStorageKey, base64}[]) are pseudo-tables written directly to object storage (none of them are DB rows)."
|
|
1954
1997
|
}).input(ImportTablesInputSchema).output(ImportTablesVOSchema),
|
|
1955
1998
|
importCommit: oc.route({
|
|
1956
1999
|
method: "POST",
|
|
@@ -2463,6 +2506,13 @@ var busabaseContractRoutes = {
|
|
|
2463
2506
|
summary: "List node tree",
|
|
2464
2507
|
successDescription: "Workspace node tree including folders, Bases, files, and agents. With no `parentId`/`depth`, returns the FULL tree (legacy behavior, still what every non-sidebar caller gets). Passing `parentId` and/or `depth` switches to a depth-bounded fetch: `parentId` omitted/null starts from the space root and returns it wrapped exactly like the legacy call (just depth-limited); an explicit `parentId` returns that node's children directly, ready to merge into its `NodeVO.children` for a sidebar's lazy per-folder expand. See `NodeVO.hasChildren` for how a depth boundary is surfaced."
|
|
2465
2508
|
}).input(listNodesInputSchema).output(z.array(nodeSchema)),
|
|
2509
|
+
searchByName: oc.route({
|
|
2510
|
+
method: "GET",
|
|
2511
|
+
path: "/nodes/search",
|
|
2512
|
+
tags: ["Nodes", "Search"],
|
|
2513
|
+
summary: "Search nodes by name/slug (cheap, name-only quick-jump)",
|
|
2514
|
+
successDescription: "Plain ilike match on name/slug across every node type (folder/base/skill/drive/airapp/file/doc), 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."
|
|
2515
|
+
}).input(searchNodesByNameInputSchema).output(z.array(nodeSearchResultSchema)),
|
|
2466
2516
|
isDescendant: oc.route({
|
|
2467
2517
|
method: "GET",
|
|
2468
2518
|
path: "/nodes/{nodeId}/is-descendant",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "busabase-sdk",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.9",
|
|
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
|
-
"busabase-contract": "0.9.
|
|
45
|
-
"
|
|
46
|
-
"
|
|
44
|
+
"busabase-contract": "0.9.9",
|
|
45
|
+
"open-domains": "0.0.2",
|
|
46
|
+
"openlib": "0.1.1"
|
|
47
47
|
},
|
|
48
48
|
"engines": {
|
|
49
49
|
"node": ">=24.18.0"
|