lemma-sdk 0.2.31 → 0.2.33

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 (45) hide show
  1. package/README.md +138 -52
  2. package/dist/browser/lemma-client.js +23 -8
  3. package/dist/namespaces/desks.d.ts +5 -2
  4. package/dist/namespaces/desks.js +5 -2
  5. package/dist/namespaces/files.d.ts +11 -0
  6. package/dist/namespaces/files.js +12 -0
  7. package/dist/openapi_client/models/DeskBundleUploadRequest.d.ts +1 -1
  8. package/dist/openapi_client/services/DesksService.d.ts +4 -4
  9. package/dist/openapi_client/services/DesksService.js +6 -6
  10. package/dist/openapi_client/services/PublicDesksService.d.ts +2 -2
  11. package/dist/openapi_client/services/PublicDesksService.js +3 -3
  12. package/dist/react/index.d.ts +13 -1
  13. package/dist/react/index.js +6 -0
  14. package/dist/react/useAssistantController.js +82 -37
  15. package/dist/react/useAssistantRuntime.js +8 -4
  16. package/dist/react/useAssistantSession.js +44 -2
  17. package/dist/react/useConversationMessages.js +19 -2
  18. package/dist/react/useCreateRecord.d.ts +33 -3
  19. package/dist/react/useCreateRecord.js +12 -2
  20. package/dist/react/useFile.d.ts +18 -0
  21. package/dist/react/useFile.js +58 -0
  22. package/dist/react/useFilePreview.d.ts +23 -0
  23. package/dist/react/useFilePreview.js +76 -0
  24. package/dist/react/useFileSearch.d.ts +26 -0
  25. package/dist/react/useFileSearch.js +64 -0
  26. package/dist/react/useFileTree.d.ts +21 -0
  27. package/dist/react/useFileTree.js +59 -0
  28. package/dist/react/useFiles.d.ts +29 -0
  29. package/dist/react/useFiles.js +90 -0
  30. package/dist/react/useForeignKeyOptions.d.ts +18 -0
  31. package/dist/react/useFunctionRun.d.ts +17 -0
  32. package/dist/react/useJoinedRecords.d.ts +57 -2
  33. package/dist/react/useJoinedRecords.js +54 -5
  34. package/dist/react/useRecord.d.ts +16 -0
  35. package/dist/react/useRecordForm.d.ts +42 -3
  36. package/dist/react/useRecordForm.js +43 -6
  37. package/dist/react/useRecords.js +8 -5
  38. package/dist/react/useReferencingRecords.d.ts +66 -0
  39. package/dist/react/useReferencingRecords.js +159 -0
  40. package/dist/react/useRelatedRecords.d.ts +17 -0
  41. package/dist/react/useReverseRelatedRecords.d.ts +21 -0
  42. package/dist/react/useUpdateRecord.d.ts +34 -3
  43. package/dist/react/useUpdateRecord.js +13 -2
  44. package/dist/types.d.ts +6 -1
  45. package/package.json +2 -1
package/README.md CHANGED
@@ -74,9 +74,10 @@ import {
74
74
  | Area | Hooks | Stability | Use when |
75
75
  | --- | --- | --- | --- |
76
76
  | Auth | `AuthGuard`, `useAuth`, `useCurrentUser`, `usePodAccess` | Stable | Gate an app, read signed-in user state, or request pod access. |
77
- | Tables | `useTables`, `useTable`, `useRecords`, `useRecord`, `useJoinedRecords`, `useRelatedRecords`, `useReverseRelatedRecords` | Stable | Build custom table browsers, details views, related-record views, and relational reads. |
78
- | Record mutations | `useCreateRecord`, `useUpdateRecord`, `useDeleteRecord`, `useBulkRecords` | Stable | Create, update, delete, or bulk-delete rows from headless UI. |
79
- | Record forms | `useRecordSchema`, `useRecordForm`, `useForeignKeyOptions`, `useSchemaForm` | Stable | Render schema-driven forms, enum fields, and foreign-key selectors. |
77
+ | Tables | `useTables`, `useTable`, `useRecords`, `useRecord`, `useJoinedRecords`, `useRelatedRecords`, `useReverseRelatedRecords`, `useReferencingRecords` | Stable | Build custom table browsers, details views, related-record views, and relational reads. |
78
+ | Record mutations | `useCreateRecord`, `useUpdateRecord`, `useDeleteRecord`, `useBulkRecords` | Stable | Create, update, delete, or bulk-delete rows from headless UI. Function-backed mutations via `createVia`/`updateVia` options. |
79
+ | Record forms | `useRecordSchema`, `useRecordForm`, `useForeignKeyOptions`, `useSchemaForm` | Stable | Render schema-driven forms, enum fields, and foreign-key selectors. `useRecordForm` supports `submitVia: "function"`, `visibleFields`, `hiddenFields`. |
80
+ | Files | `useFiles`, `useFile`, `useFileSearch`, `useFileTree`, `useFilePreview` | Stable | Browse datastore folders, resolve file metadata, search indexed files, load directory trees, and preview converted or raw file content. |
80
81
  | Assistant | `useConversations`, `useConversation`, `useConversationMessages`, `useAssistantRun`, `useAssistantSession`, `useAssistantRuntime`, `useAssistantController` | Stable except controller/runtime | Build custom chat, conversation lists, streaming output, and final-output views. |
81
82
  | Agents | `useAgentRun`, `useAgentRuns`, `useAgentInputSchema`, `useTaskSession` | Stable except raw session | Start agent tasks, submit follow-up input, read task history, and inspect input/output schemas. |
82
83
  | Workflows | `useWorkflowStart`, `useWorkflowRun`, `useWorkflowRuns`, `useWorkflowResume` | Stable | Start, poll, resume, cancel, retry, and inspect workflow runs. |
@@ -86,6 +87,8 @@ import {
86
87
 
87
88
  ### Common Hook Shapes
88
89
 
90
+ For business-facing examples and a decision guide mapping "I want to..." to the right hook, see [docs/hooks-guide.md](docs/hooks-guide.md).
91
+
89
92
  List hooks generally expose:
90
93
 
91
94
  - `items` named for the resource, such as `records`, `runs`, or `members`
@@ -213,10 +216,15 @@ Lemma UI lives in the registry, not in `lemma-sdk/react`.
213
216
  After running `npx lemma-sdk init-shadcn`, install blocks like:
214
217
 
215
218
  ```bash
216
- npx shadcn@latest add @lemma/lemma-records-page
217
- npx shadcn@latest add @lemma/lemma-agent-runner-page
218
- npx shadcn@latest add @lemma/lemma-workflow-launcher-page
219
- npx shadcn@latest add @lemma/lemma-function-runner-page
219
+ npx shadcn@latest add @lemma/lemma-records-view
220
+ npx shadcn@latest add @lemma/lemma-record-form
221
+ npx shadcn@latest add @lemma/lemma-global-search
222
+ npx shadcn@latest add @lemma/lemma-file-browser
223
+ npx shadcn@latest add @lemma/lemma-members
224
+ npx shadcn@latest add @lemma/lemma-approval-queue
225
+ npx shadcn@latest add @lemma/lemma-email-workbench
226
+ npx shadcn@latest add @lemma/lemma-insights
227
+ npx shadcn@latest add @lemma/lemma-assistant-embedded
220
228
  ```
221
229
 
222
230
  Current registry items:
@@ -224,12 +232,17 @@ Current registry items:
224
232
  | Area | Items |
225
233
  | --- | --- |
226
234
  | Assistant | `lemma-assistant-experience`, `lemma-assistant-embedded` |
227
- | Schema | `lemma-schema-form` |
228
- | Tables | `lemma-table-picker`, `lemma-record-picker`, `lemma-record-filters-bar`, `lemma-records-table`, `lemma-record-details-card`, `lemma-record-form`, `lemma-related-records-table`, `lemma-reverse-related-records-table`, `lemma-bulk-actions-bar`, `lemma-records-page` |
229
- | Agents | `lemma-agent-run-panel`, `lemma-agent-output-card`, `lemma-agent-messages`, `lemma-agent-runner-page` |
230
- | Workflows | `lemma-workflow-start-form`, `lemma-workflow-history`, `lemma-workflow-run-status`, `lemma-workflow-run-details`, `lemma-workflow-launcher-page` |
231
- | Members and access | `lemma-members-table`, `lemma-member-picker`, `lemma-org-member-picker`, `lemma-pod-access-card` |
232
- | Functions | `lemma-function-run-panel`, `lemma-function-run-history`, `lemma-function-runner-page` |
235
+ | App shell | `lemma-dashboard` |
236
+ | Navigation | `lemma-breadcrumbs`, `lemma-global-search` |
237
+ | Records | `lemma-records-view`, `lemma-record-form` |
238
+ | Files | `lemma-file-browser`, `lemma-file-viewer` |
239
+ | People | `lemma-members` |
240
+ | Writing | `lemma-markdown-editor` |
241
+ | Business workflows | `lemma-approval-queue`, `lemma-email-workbench` |
242
+ | Analytics | `lemma-insights` |
243
+ | Planning | `lemma-calendar`, `lemma-timeline` |
244
+ | Collaboration | `lemma-activity-feed`, `lemma-comments`, `lemma-notification-bell` |
245
+ | Automation | `lemma-workflow-runner` |
233
246
 
234
247
  The registry is currently served from jsDelivr against this public repo:
235
248
 
@@ -238,54 +251,127 @@ The registry is currently served from jsDelivr against this public repo:
238
251
 
239
252
  For more stable installs, pin the registry URL to a tag or commit SHA instead of `@main`.
240
253
 
254
+ Blocks that install a CSS file, such as records view, should be imported by your app's global stylesheet:
255
+
256
+ ```css
257
+ @import "@/styles/lemma-records-view.css";
258
+ ```
259
+
241
260
  ### Records Workspace Customization
242
261
 
243
262
  The records blocks are meant to be configured with props before you reach for a fork.
244
263
 
245
- `lemma-records-page` supports:
264
+ `lemma-records-view` supports:
265
+
266
+ - `tableName`, `visibleColumns`, and `hiddenFields` for schema-aware display
267
+ - `defaultView="grid" | "list" | "kanban" | "linear"` and `groupBy` for table, card, horizontal board, or Linear-style grouped layouts
268
+ - `renderCell` and `renderCard` for custom record rendering
269
+ - `foreignKeyLabels` for human-readable FK values in cards, detail views, and create/edit forms
270
+ - `onCreateOptions` and `onUpdateOptions` for function-backed mutations
271
+ - `createMode="sheet" | "modal" | "page"` and `detailMode="sheet" | "page"` for app-specific interaction patterns
272
+ - `headerActions`, `emptyState`, `onRecordClick`, and `renderFilesTab` for app-specific extensions
273
+ - `appearance="default" | "minimal" | "borderless" | "contained"` and `density="compact" | "comfortable" | "spacious"` for host-level block chrome; `minimal` is the cardless mode
274
+
275
+ `lemma-record-form` supports:
276
+
277
+ - `mode="inline" | "modal" | "sheet"`
278
+ - `submitVia="direct" | "function"` and `submitFunctionName`
279
+ - `hiddenFields`, `visibleFields`, `fieldOrder`, and `fieldGroups`
280
+ - `foreignKeyLabels` for FK select labels
281
+ - `initialValues`, `onSuccess`, and `onClose`
282
+ - `appearance` and `density` using the same values as `lemma-records-view`
283
+
284
+ `lemma-insights` supports:
285
+
286
+ - table-backed count, sum, average, and grouped chart cards
287
+ - bar, line, area, and pie charts with count/sum/avg aggregation
288
+ - chart descriptions, value/category formatters, limits, sorting, empty states, and optional footers
289
+ - function-backed stats and charts
290
+ - shared `appearance` and `density` block chrome controls
291
+
292
+ `lemma-global-search` supports:
246
293
 
247
- - capability toggles such as `allowCreate`, `allowEdit`, `allowSelection`, `allowBulkDelete`, `allowSearch`, `allowFilters`, `allowSorting`, `allowPageSizeSelect`, and `allowColumnVisibility`
248
- - layout toggles such as `showTablePicker`, `showRecordPicker`, and `showRecordDetails`
249
- - column control through `columns`, `hiddenColumnNames`, `defaultHiddenColumnNames`, and `onHiddenColumnNamesChange`
250
- - non-`id` primary keys through `recordIdField` or `getRecordId`
251
- - record-form overrides through `recordFormHiddenFields`, `recordFormFieldOrder`, `recordFormFieldLabels`, `recordFormFieldDescriptions`, `createFormTitle`, `editFormTitle`, `createSubmitLabel`, and `editSubmitLabel`
294
+ - configured `tables[]` with `searchFields`, `displayField`, `subtitleField`, `href`, `onSelect`, and `openMode`
295
+ - optional file search with `searchMethod`, `href`, `onSelect`, and `openMode`
296
+ - progressive table/file result groups, smooth loading/error source states, hidden empty sources, keyboard navigation, and built-in `cmd/ctrl+k` handling
297
+ - `minQueryLength`, `debounceMs`, `appearance`, `density`, trigger label, and placeholder customization
298
+ - assistant handoff by `assistantName`, with optional query/results message shaping and conversation routing
252
299
 
253
- `lemma-records-table` supports richer column definitions:
300
+ File blocks support:
254
301
 
255
- - `label`, `description`, `type`, `width`, `minWidth`, `align`
256
- - `searchable`, `hideable`, `hidden`
257
- - `renderCell(...)` for custom cell output
258
- - per-row buttons through `rowActions`
302
+ - datastore folder navigation and path breadcrumbs through `lemma-file-browser`
303
+ - upload, download, search, and AlertDialog-backed delete flows
304
+ - image, PDF, text, markdown, converted HTML, and download fallback previews through `lemma-file-viewer`
305
+
306
+ People blocks support:
307
+
308
+ - `LemmaMemberChip`, `LemmaAvatarGroup`, `LemmaMemberSelect`, and `LemmaUserField`
309
+ - pod member labels for owner, creator, assignee, participant, and author fields
310
+ - searchable member picking backed by `useMembers`
311
+
312
+ Business workflow blocks support:
313
+
314
+ - approval queues for AI or workflow recommendations through `lemma-approval-queue`
315
+ - direct record updates or function-backed approve, reject, and request-changes actions
316
+ - email draft review through `lemma-email-workbench`, including thread context, editable composer, approve, send, and approve-and-send actions
317
+ - table-backed defaults with escape hatches for custom action payloads and render slots
318
+
319
+ `lemma-markdown-editor` supports:
320
+
321
+ - write, preview, and split modes
322
+ - controlled and uncontrolled values
323
+ - GitHub-flavored markdown preview via `react-markdown` and `remark-gfm`
324
+
325
+ Assistant blocks support:
326
+
327
+ - assistant-name-first configuration through `assistantName`
328
+ - shared `appearance` and `density` controls on the assistant experience surface
329
+ - `chromeStyle`, `statusPlacement`, `radius`, model picker, conversation list, and render overrides for deeper customization
259
330
 
260
331
  ```tsx
261
- import { LemmaRecordsPage } from "@/components/lemma/lemma-records-page";
262
- import type { LemmaRecordsTableColumn } from "@/components/lemma/lemma-records-table";
263
-
264
- const columns: LemmaRecordsTableColumn[] = [
265
- { name: "item_id", label: "Item ID", hideable: false, width: 180 },
266
- { name: "group_id", label: "Group", width: 160 },
267
- { name: "name", label: "Name", minWidth: 320, searchable: true },
268
- {
269
- name: "sellable",
270
- label: "Sellable",
271
- type: "boolean",
272
- width: 120,
273
- align: "center",
274
- renderCell: ({ value }) => (value ? "Yes" : "No"),
275
- },
276
- ];
277
-
278
- <LemmaRecordsPage
279
- allowColumnVisibility
280
- allowCreate
281
- allowEdit
282
- columns={columns}
283
- createButtonLabel="New SKU"
284
- defaultHiddenColumnNames={["group_id"]}
285
- editSubmitLabel="Save SKU"
286
- recordFormFieldLabels={{ item_id: "Item ID" }}
287
- recordIdField="item_id"
288
- tableName="catalog_items"
332
+ import { LemmaRecordsView } from "@/components/lemma/lemma-records-view";
333
+ import { LemmaGlobalSearch } from "@/components/lemma/lemma-global-search";
334
+
335
+ <LemmaRecordsView
336
+ client={client}
337
+ podId={podId}
338
+ tableName="deals"
339
+ defaultView="kanban"
340
+ groupBy="status"
341
+ hiddenFields={["id", "created_at", "updated_at"]}
342
+ foreignKeyLabels={{ company_id: "name" }}
343
+ appearance="minimal"
344
+ density="compact"
345
+ createMode="sheet"
346
+ onCreateOptions={{
347
+ submitVia: "function",
348
+ submitFunctionName: "create-deal",
349
+ }}
350
+ />;
351
+
352
+ <LemmaGlobalSearch
353
+ client={client}
354
+ podId={podId}
355
+ tables={[
356
+ {
357
+ tableName: "deals",
358
+ label: "Deals",
359
+ searchFields: ["name", "status", "source"],
360
+ displayField: "name",
361
+ subtitleField: "status",
362
+ href: (record) => `/deals?record=${record.id}`,
363
+ },
364
+ ]}
365
+ files={{ enabled: true, openMode: "new-tab" }}
366
+ assistant={{
367
+ assistantName: "sales-copilot",
368
+ label: "Ask CRM",
369
+ resultLimit: 8,
370
+ }}
371
+ minQueryLength={3}
372
+ debounceMs={450}
373
+ appearance="minimal"
374
+ density="compact"
289
375
  />;
290
376
  ```
291
377
 
@@ -1742,8 +1742,8 @@ class DesksNamespace {
1742
1742
  this.client = client;
1743
1743
  this.http = http;
1744
1744
  this.podId = podId;
1745
- this.html = {
1746
- get: (name) => this.client.request(() => DesksService_js_1.DesksService.deskHtmlGet(this.podId(), name)),
1745
+ this.assets = {
1746
+ get: (name, path) => this.http.request("GET", `/pods/${this.podId()}/desks/${name}/assets${path ? `/${path.replace(/^\/+/, "")}` : ""}`),
1747
1747
  };
1748
1748
  this.bundle = {
1749
1749
  upload: (name, payload) => this.client.request(() => DesksService_js_1.DesksService.deskBundleUpload(this.podId(), name, payload)),
@@ -1751,6 +1751,9 @@ class DesksNamespace {
1751
1751
  this.source = {
1752
1752
  download: (name) => this.http.requestBytes("GET", `/pods/${this.podId()}/desks/${name}/source/archive`),
1753
1753
  };
1754
+ this.dist = {
1755
+ download: (name) => this.http.requestBytes("GET", `/pods/${this.podId()}/desks/${name}/dist/archive`),
1756
+ };
1754
1757
  }
1755
1758
  list(options = {}) {
1756
1759
  return this.client.request(() => DesksService_js_1.DesksService.deskList(this.podId(), options.limit ?? 100, options.pageToken));
@@ -1910,16 +1913,16 @@ class DesksService {
1910
1913
  });
1911
1914
  }
1912
1915
  /**
1913
- * Get Desk HTML
1916
+ * Download Desk Source Archive
1914
1917
  * @param podId
1915
1918
  * @param deskName
1916
1919
  * @returns any Successful Response
1917
1920
  * @throws ApiError
1918
1921
  */
1919
- static deskHtmlGet(podId, deskName) {
1922
+ static deskSourceArchiveGet(podId, deskName) {
1920
1923
  return (0, request_js_1.request)(OpenAPI_js_1.OpenAPI, {
1921
1924
  method: 'GET',
1922
- url: '/pods/{pod_id}/desks/{desk_name}/html',
1925
+ url: '/pods/{pod_id}/desks/{desk_name}/source/archive',
1923
1926
  path: {
1924
1927
  'pod_id': podId,
1925
1928
  'desk_name': deskName,
@@ -1930,16 +1933,16 @@ class DesksService {
1930
1933
  });
1931
1934
  }
1932
1935
  /**
1933
- * Download Desk Source Archive
1936
+ * Download Desk Dist Archive
1934
1937
  * @param podId
1935
1938
  * @param deskName
1936
1939
  * @returns any Successful Response
1937
1940
  * @throws ApiError
1938
1941
  */
1939
- static deskSourceArchiveGet(podId, deskName) {
1942
+ static deskDistArchiveGet(podId, deskName) {
1940
1943
  return (0, request_js_1.request)(OpenAPI_js_1.OpenAPI, {
1941
1944
  method: 'GET',
1942
- url: '/pods/{pod_id}/desks/{desk_name}/source/archive',
1945
+ url: '/pods/{pod_id}/desks/{desk_name}/dist/archive',
1943
1946
  path: {
1944
1947
  'pod_id': podId,
1945
1948
  'desk_name': deskName,
@@ -2002,6 +2005,15 @@ class FilesNamespace {
2002
2005
  return this.client.request(() => FilesService_js_1.FilesService.fileFolderCreate(this.podId(), payload));
2003
2006
  },
2004
2007
  };
2008
+ this.converted = {
2009
+ get: (path) => this.client.request(() => FilesService_js_1.FilesService.fileConvertedGet(this.podId(), path)),
2010
+ render: (path) => this.client.request(() => FilesService_js_1.FilesService.fileConvertedRender(this.podId(), path)),
2011
+ download: (path, artifact = "document.md") => {
2012
+ const encodedPath = encodeURIComponent(path);
2013
+ const encodedArtifact = encodeURIComponent(artifact);
2014
+ return this.http.requestBytes("GET", `/pods/${this.podId()}/datastore/files/converted/download?path=${encodedPath}&artifact=${encodedArtifact}`);
2015
+ },
2016
+ };
2005
2017
  }
2006
2018
  list(options = {}) {
2007
2019
  const directoryPath = options.directoryPath ?? options.parentId ?? "/";
@@ -2024,6 +2036,9 @@ class FilesNamespace {
2024
2036
  const encodedPath = encodeURIComponent(path);
2025
2037
  return this.http.requestBytes("GET", `/pods/${this.podId()}/datastore/files/download?path=${encodedPath}`);
2026
2038
  }
2039
+ tree(options = {}) {
2040
+ return this.client.request(() => FilesService_js_1.FilesService.fileTree(this.podId(), options.rootPath ?? "/", options.filesPerDirectory ?? 3));
2041
+ }
2027
2042
  upload(file, options = {}) {
2028
2043
  const payload = {
2029
2044
  data: file,
@@ -16,8 +16,8 @@ export declare class DesksNamespace {
16
16
  get(name: string): Promise<import("../types.js").DeskResponse>;
17
17
  update(name: string, payload: UpdateDeskRequest): Promise<import("../types.js").DeskResponse>;
18
18
  delete(name: string): Promise<import("../types.js").DeskMessageResponse>;
19
- readonly html: {
20
- get: (name: string) => Promise<string>;
19
+ readonly assets: {
20
+ get: (name: string, path?: string) => Promise<string>;
21
21
  };
22
22
  readonly bundle: {
23
23
  upload: (name: string, payload: DeskBundleUploadRequest) => Promise<import("../types.js").DeskBundleUploadResponse>;
@@ -25,4 +25,7 @@ export declare class DesksNamespace {
25
25
  readonly source: {
26
26
  download: (name: string) => Promise<Blob>;
27
27
  };
28
+ readonly dist: {
29
+ download: (name: string) => Promise<Blob>;
30
+ };
28
31
  }
@@ -23,8 +23,8 @@ export class DesksNamespace {
23
23
  delete(name) {
24
24
  return this.client.request(() => DesksService.deskDelete(this.podId(), name));
25
25
  }
26
- html = {
27
- get: (name) => this.client.request(() => DesksService.deskHtmlGet(this.podId(), name)),
26
+ assets = {
27
+ get: (name, path) => this.http.request("GET", `/pods/${this.podId()}/desks/${name}/assets${path ? `/${path.replace(/^\/+/, "")}` : ""}`),
28
28
  };
29
29
  bundle = {
30
30
  upload: (name, payload) => this.client.request(() => DesksService.deskBundleUpload(this.podId(), name, payload)),
@@ -32,4 +32,7 @@ export class DesksNamespace {
32
32
  source = {
33
33
  download: (name) => this.http.requestBytes("GET", `/pods/${this.podId()}/desks/${name}/source/archive`),
34
34
  };
35
+ dist = {
36
+ download: (name) => this.http.requestBytes("GET", `/pods/${this.podId()}/desks/${name}/dist/archive`),
37
+ };
35
38
  }
@@ -1,5 +1,7 @@
1
1
  import type { GeneratedClientAdapter } from "../generated.js";
2
2
  import type { HttpClient } from "../http.js";
3
+ import type { ConvertedFileResponse } from "../openapi_client/models/ConvertedFileResponse.js";
4
+ import type { DirectoryTreeResponse } from "../openapi_client/models/DirectoryTreeResponse.js";
3
5
  import { SearchMethod } from "../openapi_client/models/SearchMethod.js";
4
6
  export declare class FilesNamespace {
5
7
  private readonly client;
@@ -19,6 +21,10 @@ export declare class FilesNamespace {
19
21
  searchMethod?: SearchMethod;
20
22
  }): Promise<import("../types.js").FileSearchResponse>;
21
23
  download(path: string): Promise<Blob>;
24
+ tree(options?: {
25
+ rootPath?: string;
26
+ filesPerDirectory?: number;
27
+ }): Promise<DirectoryTreeResponse>;
22
28
  upload(file: Blob, options?: {
23
29
  name?: string;
24
30
  directoryPath?: string;
@@ -42,4 +48,9 @@ export declare class FilesNamespace {
42
48
  description?: string;
43
49
  }) => Promise<import("../types.js").FileResponse>;
44
50
  };
51
+ readonly converted: {
52
+ get: (path: string) => Promise<ConvertedFileResponse>;
53
+ render: (path: string) => Promise<string>;
54
+ download: (path: string, artifact?: string) => Promise<Blob>;
55
+ };
45
56
  }
@@ -59,6 +59,9 @@ export class FilesNamespace {
59
59
  const encodedPath = encodeURIComponent(path);
60
60
  return this.http.requestBytes("GET", `/pods/${this.podId()}/datastore/files/download?path=${encodedPath}`);
61
61
  }
62
+ tree(options = {}) {
63
+ return this.client.request(() => FilesService.fileTree(this.podId(), options.rootPath ?? "/", options.filesPerDirectory ?? 3));
64
+ }
62
65
  upload(file, options = {}) {
63
66
  const payload = {
64
67
  data: file,
@@ -96,4 +99,13 @@ export class FilesNamespace {
96
99
  return this.client.request(() => FilesService.fileFolderCreate(this.podId(), payload));
97
100
  },
98
101
  };
102
+ converted = {
103
+ get: (path) => this.client.request(() => FilesService.fileConvertedGet(this.podId(), path)),
104
+ render: (path) => this.client.request(() => FilesService.fileConvertedRender(this.podId(), path)),
105
+ download: (path, artifact = "document.md") => {
106
+ const encodedPath = encodeURIComponent(path);
107
+ const encodedArtifact = encodeURIComponent(artifact);
108
+ return this.http.requestBytes("GET", `/pods/${this.podId()}/datastore/files/converted/download?path=${encodedPath}&artifact=${encodedArtifact}`);
109
+ },
110
+ };
99
111
  }
@@ -1,4 +1,4 @@
1
1
  export type DeskBundleUploadRequest = {
2
- html?: (string | null);
2
+ dist_archive?: (string | null);
3
3
  source_archive?: (string | null);
4
4
  };
@@ -59,19 +59,19 @@ export declare class DesksService {
59
59
  */
60
60
  static deskBundleUpload(podId: string, deskName: string, formData?: DeskBundleUploadRequest): CancelablePromise<DeskBundleUploadResponse>;
61
61
  /**
62
- * Get Desk HTML
62
+ * Download Desk Source Archive
63
63
  * @param podId
64
64
  * @param deskName
65
65
  * @returns any Successful Response
66
66
  * @throws ApiError
67
67
  */
68
- static deskHtmlGet(podId: string, deskName: string): CancelablePromise<any>;
68
+ static deskSourceArchiveGet(podId: string, deskName: string): CancelablePromise<any>;
69
69
  /**
70
- * Download Desk Source Archive
70
+ * Download Desk Dist Archive
71
71
  * @param podId
72
72
  * @param deskName
73
73
  * @returns any Successful Response
74
74
  * @throws ApiError
75
75
  */
76
- static deskSourceArchiveGet(podId: string, deskName: string): CancelablePromise<any>;
76
+ static deskDistArchiveGet(podId: string, deskName: string): CancelablePromise<any>;
77
77
  }
@@ -133,16 +133,16 @@ export class DesksService {
133
133
  });
134
134
  }
135
135
  /**
136
- * Get Desk HTML
136
+ * Download Desk Source Archive
137
137
  * @param podId
138
138
  * @param deskName
139
139
  * @returns any Successful Response
140
140
  * @throws ApiError
141
141
  */
142
- static deskHtmlGet(podId, deskName) {
142
+ static deskSourceArchiveGet(podId, deskName) {
143
143
  return __request(OpenAPI, {
144
144
  method: 'GET',
145
- url: '/pods/{pod_id}/desks/{desk_name}/html',
145
+ url: '/pods/{pod_id}/desks/{desk_name}/source/archive',
146
146
  path: {
147
147
  'pod_id': podId,
148
148
  'desk_name': deskName,
@@ -153,16 +153,16 @@ export class DesksService {
153
153
  });
154
154
  }
155
155
  /**
156
- * Download Desk Source Archive
156
+ * Download Desk Dist Archive
157
157
  * @param podId
158
158
  * @param deskName
159
159
  * @returns any Successful Response
160
160
  * @throws ApiError
161
161
  */
162
- static deskSourceArchiveGet(podId, deskName) {
162
+ static deskDistArchiveGet(podId, deskName) {
163
163
  return __request(OpenAPI, {
164
164
  method: 'GET',
165
- url: '/pods/{pod_id}/desks/{desk_name}/source/archive',
165
+ url: '/pods/{pod_id}/desks/{desk_name}/dist/archive',
166
166
  path: {
167
167
  'pod_id': podId,
168
168
  'desk_name': deskName,
@@ -1,10 +1,10 @@
1
1
  import type { CancelablePromise } from '../core/CancelablePromise.js';
2
2
  export declare class PublicDesksService {
3
3
  /**
4
- * Get public desk HTML by slug host
4
+ * Get public desk asset by slug host
5
5
  * @param xDeskPublicSlug
6
6
  * @returns any Successful Response
7
7
  * @throws ApiError
8
8
  */
9
- static deskHtmlPublicSlugGet(xDeskPublicSlug?: (string | null)): CancelablePromise<any>;
9
+ static deskAssetPublicSlugGet(xDeskPublicSlug?: (string | null)): CancelablePromise<any>;
10
10
  }
@@ -2,15 +2,15 @@ import { OpenAPI } from '../core/OpenAPI.js';
2
2
  import { request as __request } from '../core/request.js';
3
3
  export class PublicDesksService {
4
4
  /**
5
- * Get public desk HTML by slug host
5
+ * Get public desk asset by slug host
6
6
  * @param xDeskPublicSlug
7
7
  * @returns any Successful Response
8
8
  * @throws ApiError
9
9
  */
10
- static deskHtmlPublicSlugGet(xDeskPublicSlug) {
10
+ static deskAssetPublicSlugGet(xDeskPublicSlug) {
11
11
  return __request(OpenAPI, {
12
12
  method: 'GET',
13
- url: '/public/desks/html',
13
+ url: '/public/desks',
14
14
  headers: {
15
15
  'x-desk-public-slug': xDeskPublicSlug,
16
16
  },
@@ -28,6 +28,16 @@ export { useCurrentUser } from "./useCurrentUser.js";
28
28
  export type { UseCurrentUserOptions, UseCurrentUserResult } from "./useCurrentUser.js";
29
29
  export { usePodAccess } from "./usePodAccess.js";
30
30
  export type { PodAccessStatus, UsePodAccessOptions, UsePodAccessResult, } from "./usePodAccess.js";
31
+ export { useFiles } from "./useFiles.js";
32
+ export type { UseFilesOptions, UseFilesResult } from "./useFiles.js";
33
+ export { useFile } from "./useFile.js";
34
+ export type { UseFileOptions, UseFileResult } from "./useFile.js";
35
+ export { useFileSearch } from "./useFileSearch.js";
36
+ export type { UseFileSearchOptions, UseFileSearchResult } from "./useFileSearch.js";
37
+ export { useFileTree } from "./useFileTree.js";
38
+ export type { UseFileTreeOptions, UseFileTreeResult } from "./useFileTree.js";
39
+ export { useFilePreview } from "./useFilePreview.js";
40
+ export type { FilePreviewMode, UseFilePreviewOptions, UseFilePreviewResult, } from "./useFilePreview.js";
31
41
  export { useTables } from "./useTables.js";
32
42
  export type { UseTablesOptions, UseTablesResult } from "./useTables.js";
33
43
  export { useTable } from "./useTable.js";
@@ -45,11 +55,13 @@ export type { UseDeleteRecordOptions, UseDeleteRecordResult } from "./useDeleteR
45
55
  export { useBulkRecords } from "./useBulkRecords.js";
46
56
  export type { UseBulkRecordsOptions, UseBulkRecordsResult } from "./useBulkRecords.js";
47
57
  export { useJoinedRecords } from "./useJoinedRecords.js";
48
- export type { UseJoinedRecordsOptions, UseJoinedRecordsResult } from "./useJoinedRecords.js";
58
+ export type { JoinedRecordsShorthandJoin, UseJoinedRecordsOptions, UseJoinedRecordsResult, } from "./useJoinedRecords.js";
49
59
  export { useRelatedRecords } from "./useRelatedRecords.js";
50
60
  export type { RelatedRecordsColumn, RelatedRecordsInclude, RelatedRecordsResolvedInclude, UseRelatedRecordsOptions, UseRelatedRecordsResult, } from "./useRelatedRecords.js";
51
61
  export { useReverseRelatedRecords } from "./useReverseRelatedRecords.js";
52
62
  export type { ReverseRelatedRecordsColumn, ReverseRelatedRelation, ReverseRelationSelector, UseReverseRelatedRecordsOptions, UseReverseRelatedRecordsResult, } from "./useReverseRelatedRecords.js";
63
+ export { useReferencingRecords } from "./useReferencingRecords.js";
64
+ export type { ReferencingRecordsColumn, UseReferencingRecordsOptions, UseReferencingRecordsResult, } from "./useReferencingRecords.js";
53
65
  export { useForeignKeyOptions } from "./useForeignKeyOptions.js";
54
66
  export type { ForeignKeyOption, UseForeignKeyOptionsOptions, UseForeignKeyOptionsResult, } from "./useForeignKeyOptions.js";
55
67
  export { useRecordSchema } from "./useRecordSchema.js";
@@ -13,6 +13,11 @@ export { useMembers } from "./useMembers.js";
13
13
  export { useOrganizationMembers } from "./useOrganizationMembers.js";
14
14
  export { useCurrentUser } from "./useCurrentUser.js";
15
15
  export { usePodAccess } from "./usePodAccess.js";
16
+ export { useFiles } from "./useFiles.js";
17
+ export { useFile } from "./useFile.js";
18
+ export { useFileSearch } from "./useFileSearch.js";
19
+ export { useFileTree } from "./useFileTree.js";
20
+ export { useFilePreview } from "./useFilePreview.js";
16
21
  export { useTables } from "./useTables.js";
17
22
  export { useTable } from "./useTable.js";
18
23
  export { useRecords } from "./useRecords.js";
@@ -24,6 +29,7 @@ export { useBulkRecords } from "./useBulkRecords.js";
24
29
  export { useJoinedRecords } from "./useJoinedRecords.js";
25
30
  export { useRelatedRecords } from "./useRelatedRecords.js";
26
31
  export { useReverseRelatedRecords } from "./useReverseRelatedRecords.js";
32
+ export { useReferencingRecords } from "./useReferencingRecords.js";
27
33
  export { useForeignKeyOptions } from "./useForeignKeyOptions.js";
28
34
  export { useRecordSchema } from "./useRecordSchema.js";
29
35
  export { useRecordForm } from "./useRecordForm.js";