lemma-sdk 0.2.32 → 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.
- package/README.md +133 -49
- package/dist/browser/lemma-client.js +23 -8
- package/dist/namespaces/desks.d.ts +5 -2
- package/dist/namespaces/desks.js +5 -2
- package/dist/namespaces/files.d.ts +11 -0
- package/dist/namespaces/files.js +12 -0
- package/dist/openapi_client/models/DeskBundleUploadRequest.d.ts +1 -1
- package/dist/openapi_client/services/DesksService.d.ts +4 -4
- package/dist/openapi_client/services/DesksService.js +6 -6
- package/dist/openapi_client/services/PublicDesksService.d.ts +2 -2
- package/dist/openapi_client/services/PublicDesksService.js +3 -3
- package/dist/react/index.d.ts +10 -0
- package/dist/react/index.js +5 -0
- package/dist/react/useAssistantController.js +82 -37
- package/dist/react/useAssistantRuntime.js +8 -4
- package/dist/react/useAssistantSession.js +44 -2
- package/dist/react/useConversationMessages.js +19 -2
- package/dist/react/useFile.d.ts +18 -0
- package/dist/react/useFile.js +58 -0
- package/dist/react/useFilePreview.d.ts +23 -0
- package/dist/react/useFilePreview.js +76 -0
- package/dist/react/useFileSearch.d.ts +26 -0
- package/dist/react/useFileSearch.js +64 -0
- package/dist/react/useFileTree.d.ts +21 -0
- package/dist/react/useFileTree.js +59 -0
- package/dist/react/useFiles.d.ts +29 -0
- package/dist/react/useFiles.js +90 -0
- package/dist/react/useRecords.js +8 -5
- package/dist/types.d.ts +6 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -77,6 +77,7 @@ import {
|
|
|
77
77
|
| Tables | `useTables`, `useTable`, `useRecords`, `useRecord`, `useJoinedRecords`, `useRelatedRecords`, `useReverseRelatedRecords`, `useReferencingRecords` | Stable | Build custom table browsers, details views, related-record views, and relational reads. |
|
|
78
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
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. |
|
|
@@ -215,10 +216,15 @@ Lemma UI lives in the registry, not in `lemma-sdk/react`.
|
|
|
215
216
|
After running `npx lemma-sdk init-shadcn`, install blocks like:
|
|
216
217
|
|
|
217
218
|
```bash
|
|
218
|
-
npx shadcn@latest add @lemma/lemma-records-
|
|
219
|
-
npx shadcn@latest add @lemma/lemma-
|
|
220
|
-
npx shadcn@latest add @lemma/lemma-
|
|
221
|
-
npx shadcn@latest add @lemma/lemma-
|
|
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
|
|
222
228
|
```
|
|
223
229
|
|
|
224
230
|
Current registry items:
|
|
@@ -226,12 +232,17 @@ Current registry items:
|
|
|
226
232
|
| Area | Items |
|
|
227
233
|
| --- | --- |
|
|
228
234
|
| Assistant | `lemma-assistant-experience`, `lemma-assistant-embedded` |
|
|
229
|
-
|
|
|
230
|
-
|
|
|
231
|
-
|
|
|
232
|
-
|
|
|
233
|
-
|
|
|
234
|
-
|
|
|
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` |
|
|
235
246
|
|
|
236
247
|
The registry is currently served from jsDelivr against this public repo:
|
|
237
248
|
|
|
@@ -240,54 +251,127 @@ The registry is currently served from jsDelivr against this public repo:
|
|
|
240
251
|
|
|
241
252
|
For more stable installs, pin the registry URL to a tag or commit SHA instead of `@main`.
|
|
242
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
|
+
|
|
243
260
|
### Records Workspace Customization
|
|
244
261
|
|
|
245
262
|
The records blocks are meant to be configured with props before you reach for a fork.
|
|
246
263
|
|
|
247
|
-
`lemma-records-
|
|
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:
|
|
293
|
+
|
|
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
|
|
248
299
|
|
|
249
|
-
|
|
250
|
-
- layout toggles such as `showTablePicker`, `showRecordPicker`, and `showRecordDetails`
|
|
251
|
-
- column control through `columns`, `hiddenColumnNames`, `defaultHiddenColumnNames`, and `onHiddenColumnNamesChange`
|
|
252
|
-
- non-`id` primary keys through `recordIdField` or `getRecordId`
|
|
253
|
-
- record-form overrides through `recordFormHiddenFields`, `recordFormFieldOrder`, `recordFormFieldLabels`, `recordFormFieldDescriptions`, `createFormTitle`, `editFormTitle`, `createSubmitLabel`, and `editSubmitLabel`
|
|
300
|
+
File blocks support:
|
|
254
301
|
|
|
255
|
-
`lemma-
|
|
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`
|
|
256
305
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
- `
|
|
260
|
-
-
|
|
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
|
|
261
330
|
|
|
262
331
|
```tsx
|
|
263
|
-
import {
|
|
264
|
-
import
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
{
|
|
268
|
-
{
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
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"
|
|
291
375
|
/>;
|
|
292
376
|
```
|
|
293
377
|
|
|
@@ -1742,8 +1742,8 @@ class DesksNamespace {
|
|
|
1742
1742
|
this.client = client;
|
|
1743
1743
|
this.http = http;
|
|
1744
1744
|
this.podId = podId;
|
|
1745
|
-
this.
|
|
1746
|
-
get: (name) => this.
|
|
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
|
-
*
|
|
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
|
|
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}/
|
|
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
|
|
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
|
|
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}/
|
|
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
|
|
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
|
}
|
package/dist/namespaces/desks.js
CHANGED
|
@@ -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
|
-
|
|
27
|
-
get: (name) => this.
|
|
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
|
}
|
package/dist/namespaces/files.js
CHANGED
|
@@ -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
|
}
|
|
@@ -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
|
-
*
|
|
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
|
|
68
|
+
static deskSourceArchiveGet(podId: string, deskName: string): CancelablePromise<any>;
|
|
69
69
|
/**
|
|
70
|
-
* Download Desk
|
|
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
|
|
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
|
-
*
|
|
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
|
|
142
|
+
static deskSourceArchiveGet(podId, deskName) {
|
|
143
143
|
return __request(OpenAPI, {
|
|
144
144
|
method: 'GET',
|
|
145
|
-
url: '/pods/{pod_id}/desks/{desk_name}/
|
|
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
|
|
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
|
|
162
|
+
static deskDistArchiveGet(podId, deskName) {
|
|
163
163
|
return __request(OpenAPI, {
|
|
164
164
|
method: 'GET',
|
|
165
|
-
url: '/pods/{pod_id}/desks/{desk_name}/
|
|
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
|
|
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
|
|
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
|
|
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
|
|
10
|
+
static deskAssetPublicSlugGet(xDeskPublicSlug) {
|
|
11
11
|
return __request(OpenAPI, {
|
|
12
12
|
method: 'GET',
|
|
13
|
-
url: '/public/desks
|
|
13
|
+
url: '/public/desks',
|
|
14
14
|
headers: {
|
|
15
15
|
'x-desk-public-slug': xDeskPublicSlug,
|
|
16
16
|
},
|
package/dist/react/index.d.ts
CHANGED
|
@@ -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";
|
package/dist/react/index.js
CHANGED
|
@@ -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";
|