@kernhq/module-quire 0.13.1 → 0.15.0
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/contract/models.d.ts +394 -0
- package/dist/contract/models.d.ts.map +1 -1
- package/dist/contract/models.js +284 -0
- package/dist/contract/models.js.map +1 -1
- package/dist/contract/permissions.d.ts +14 -0
- package/dist/contract/permissions.d.ts.map +1 -1
- package/dist/contract/permissions.js +114 -0
- package/dist/contract/permissions.js.map +1 -1
- package/dist/contract/properties.d.ts +7 -7
- package/dist/contract/router.d.ts +1124 -96
- package/dist/contract/router.d.ts.map +1 -1
- package/dist/contract/router.js +343 -1
- package/dist/contract/router.js.map +1 -1
- package/dist/server/_impl.d.ts +983 -1168
- package/dist/server/_impl.d.ts.map +1 -1
- package/dist/server/_impl.js +308 -0
- package/dist/server/_impl.js.map +1 -1
- package/dist/server/export/html.d.ts +67 -0
- package/dist/server/export/html.d.ts.map +1 -0
- package/dist/server/export/html.js +206 -0
- package/dist/server/export/html.js.map +1 -0
- package/dist/server/export/markdown.d.ts +51 -0
- package/dist/server/export/markdown.d.ts.map +1 -0
- package/dist/server/export/markdown.js +351 -0
- package/dist/server/export/markdown.js.map +1 -0
- package/dist/server/export/pdf.d.ts +20 -0
- package/dist/server/export/pdf.d.ts.map +1 -0
- package/dist/server/export/pdf.js +91 -0
- package/dist/server/export/pdf.js.map +1 -0
- package/dist/server/export/zip.d.ts +31 -0
- package/dist/server/export/zip.d.ts.map +1 -0
- package/dist/server/export/zip.js +158 -0
- package/dist/server/export/zip.js.map +1 -0
- package/dist/server/import/csv.d.ts +77 -0
- package/dist/server/import/csv.d.ts.map +1 -0
- package/dist/server/import/csv.js +263 -0
- package/dist/server/import/csv.js.map +1 -0
- package/dist/server/import/html.d.ts +52 -0
- package/dist/server/import/html.d.ts.map +1 -0
- package/dist/server/import/html.js +472 -0
- package/dist/server/import/html.js.map +1 -0
- package/dist/server/import/markdown.d.ts +63 -0
- package/dist/server/import/markdown.d.ts.map +1 -0
- package/dist/server/import/markdown.js +692 -0
- package/dist/server/import/markdown.js.map +1 -0
- package/dist/server/import/plan.d.ts +70 -0
- package/dist/server/import/plan.d.ts.map +1 -0
- package/dist/server/import/plan.js +761 -0
- package/dist/server/import/plan.js.map +1 -0
- package/dist/server/import/ydoc.d.ts +35 -0
- package/dist/server/import/ydoc.d.ts.map +1 -0
- package/dist/server/import/ydoc.js +91 -0
- package/dist/server/import/ydoc.js.map +1 -0
- package/dist/server/import/zip.d.ts +63 -0
- package/dist/server/import/zip.d.ts.map +1 -0
- package/dist/server/import/zip.js +308 -0
- package/dist/server/import/zip.js.map +1 -0
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +3 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/render.d.ts +158 -0
- package/dist/server/render.d.ts.map +1 -1
- package/dist/server/render.js +240 -0
- package/dist/server/render.js.map +1 -1
- package/dist/server/schema.d.ts +704 -1
- package/dist/server/schema.d.ts.map +1 -1
- package/dist/server/schema.js +254 -1
- package/dist/server/schema.js.map +1 -1
- package/dist/server/services/databases.d.ts +10 -10
- package/dist/server/services/export.d.ts +176 -0
- package/dist/server/services/export.d.ts.map +1 -0
- package/dist/server/services/export.js +822 -0
- package/dist/server/services/export.js.map +1 -0
- package/dist/server/services/import.d.ts +109 -0
- package/dist/server/services/import.d.ts.map +1 -0
- package/dist/server/services/import.js +570 -0
- package/dist/server/services/import.js.map +1 -0
- package/dist/server/services/index.d.ts +32 -1
- package/dist/server/services/index.d.ts.map +1 -1
- package/dist/server/services/index.js +87 -4
- package/dist/server/services/index.js.map +1 -1
- package/dist/server/services/macros.d.ts +83 -0
- package/dist/server/services/macros.d.ts.map +1 -0
- package/dist/server/services/macros.js +488 -0
- package/dist/server/services/macros.js.map +1 -0
- package/dist/server/services/publications.d.ts +2 -1
- package/dist/server/services/publications.d.ts.map +1 -1
- package/dist/server/services/publications.js +43 -4
- package/dist/server/services/publications.js.map +1 -1
- package/dist/server/services/templates.d.ts +135 -0
- package/dist/server/services/templates.d.ts.map +1 -0
- package/dist/server/services/templates.js +897 -0
- package/dist/server/services/templates.js.map +1 -0
- package/dist/server/services/versions.d.ts +13 -1
- package/dist/server/services/versions.d.ts.map +1 -1
- package/dist/server/services/versions.js +3 -1
- package/dist/server/services/versions.js.map +1 -1
- package/migrations/0010_transfers.sql +154 -0
- package/migrations/0011_templates.sql +157 -0
- package/migrations/meta/_journal.json +14 -0
- package/package.json +5 -5
- package/src/client/components/ExportDialog.svelte +685 -0
- package/src/client/components/ImportDialog.svelte +702 -0
- package/src/client/components/ImportReport.svelte +310 -0
- package/src/client/components/NewSpaceDialog.svelte +77 -8
- package/src/client/components/PageEditor.svelte +80 -0
- package/src/client/components/PagePicker.svelte +264 -0
- package/src/client/components/SaveAsTemplateDialog.svelte +502 -0
- package/src/client/components/SidebarSpaces.svelte +112 -1
- package/src/client/components/TemplatePicker.svelte +437 -0
- package/src/client/i18n.ts +941 -0
- package/src/client/index.ts +51 -0
- package/src/client/mock.ts +592 -0
- package/src/client/module.ts +36 -0
- package/src/client/pages/PageView.svelte +86 -0
- package/src/client/pages/SpacePage.svelte +20 -4
- package/src/client/pages/TransfersPage.svelte +570 -0
- package/src/client/permissions.ts +11 -0
- package/src/client/query.ts +40 -0
- package/src/client/transfers.ts +142 -0
- package/src/contract/models.ts +343 -0
- package/src/contract/permissions.ts +117 -0
- package/src/contract/router.ts +375 -0
|
@@ -333,6 +333,400 @@ export declare const Publication: z.ZodObject<{
|
|
|
333
333
|
updatedAt: z.ZodISODateTime;
|
|
334
334
|
}, z.core.$strip>;
|
|
335
335
|
export type Publication = z.infer<typeof Publication>;
|
|
336
|
+
/**
|
|
337
|
+
* How much of the tree an export takes.
|
|
338
|
+
*
|
|
339
|
+
* `page` is one page; `subtree` is a page and everything under it; `space` is every page in a space.
|
|
340
|
+
* The three are not a convenience — they are the three questions people actually ask ("send me this",
|
|
341
|
+
* "send me this section", "get us off this product"), and the middle one is the one a flat
|
|
342
|
+
* page-by-page export cannot answer without somebody clicking three hundred times.
|
|
343
|
+
*/
|
|
344
|
+
export declare const ExportScope: z.ZodEnum<{
|
|
345
|
+
page: "page";
|
|
346
|
+
subtree: "subtree";
|
|
347
|
+
space: "space";
|
|
348
|
+
}>;
|
|
349
|
+
export type ExportScope = z.infer<typeof ExportScope>;
|
|
350
|
+
/**
|
|
351
|
+
* What comes out.
|
|
352
|
+
*
|
|
353
|
+
* `html` and `pdf` are rendered by the same static renderer the public site uses — never the live
|
|
354
|
+
* document and never the draft, so an export of a `page` is what a reader is served rather than what
|
|
355
|
+
* the last person to open it happened to be typing.
|
|
356
|
+
*/
|
|
357
|
+
export declare const ExportFormat: z.ZodEnum<{
|
|
358
|
+
markdown: "markdown";
|
|
359
|
+
html: "html";
|
|
360
|
+
docx: "docx";
|
|
361
|
+
pdf: "pdf";
|
|
362
|
+
}>;
|
|
363
|
+
export type ExportFormat = z.infer<typeof ExportFormat>;
|
|
364
|
+
/** Where a transfer is. `done` and `failed` are terminal; nothing moves out of either. */
|
|
365
|
+
export declare const TransferState: z.ZodEnum<{
|
|
366
|
+
queued: "queued";
|
|
367
|
+
running: "running";
|
|
368
|
+
done: "done";
|
|
369
|
+
failed: "failed";
|
|
370
|
+
}>;
|
|
371
|
+
export type TransferState = z.infer<typeof TransferState>;
|
|
372
|
+
/**
|
|
373
|
+
* A job's own progress, shared by both directions.
|
|
374
|
+
*
|
|
375
|
+
* `skipped` is the counter that matters and the one a progress bar leaves out. An export skips a page
|
|
376
|
+
* the requester may not read; an import skips a file it cannot map. Reporting the count is the
|
|
377
|
+
* difference between an artefact that is quietly missing things and one that says how many.
|
|
378
|
+
*
|
|
379
|
+
* Every field defaults, so a job that has not started yet parses as four zeroes rather than as
|
|
380
|
+
* absent — a client should never have to distinguish "no progress" from "no counters".
|
|
381
|
+
*/
|
|
382
|
+
export declare const TransferCounts: z.ZodObject<{
|
|
383
|
+
total: z.ZodDefault<z.ZodNumber>;
|
|
384
|
+
done: z.ZodDefault<z.ZodNumber>;
|
|
385
|
+
skipped: z.ZodDefault<z.ZodNumber>;
|
|
386
|
+
failed: z.ZodDefault<z.ZodNumber>;
|
|
387
|
+
}, z.core.$strip>;
|
|
388
|
+
export type TransferCounts = z.infer<typeof TransferCounts>;
|
|
389
|
+
/**
|
|
390
|
+
* A request to take a page, a subtree or a space out of Quire as a file.
|
|
391
|
+
*
|
|
392
|
+
* There is no artefact URL here and there should not be. `fileId` is an opaque id, not an address:
|
|
393
|
+
* the download is a signed URL a procedure mints per request, so that the fence on who may fetch a
|
|
394
|
+
* subtree export — which flattens pages of different readerships into one file — is applied at the
|
|
395
|
+
* moment of the fetch rather than baked into a link that outlives it. A client that builds a storage
|
|
396
|
+
* key from an id is the mistake `migrations/0009` had to go back and scrub out of published HTML.
|
|
397
|
+
*/
|
|
398
|
+
export declare const ExportJob: z.ZodObject<{
|
|
399
|
+
id: z.ZodUUID;
|
|
400
|
+
workspaceId: z.core.$ZodBranded<z.ZodUUID, "WorkspaceId", "out">;
|
|
401
|
+
requestedBy: z.core.$ZodBranded<z.ZodUUID, "UserId", "out">;
|
|
402
|
+
scope: z.ZodEnum<{
|
|
403
|
+
page: "page";
|
|
404
|
+
subtree: "subtree";
|
|
405
|
+
space: "space";
|
|
406
|
+
}>;
|
|
407
|
+
targetId: z.ZodUUID;
|
|
408
|
+
format: z.ZodEnum<{
|
|
409
|
+
markdown: "markdown";
|
|
410
|
+
html: "html";
|
|
411
|
+
docx: "docx";
|
|
412
|
+
pdf: "pdf";
|
|
413
|
+
}>;
|
|
414
|
+
state: z.ZodEnum<{
|
|
415
|
+
queued: "queued";
|
|
416
|
+
running: "running";
|
|
417
|
+
done: "done";
|
|
418
|
+
failed: "failed";
|
|
419
|
+
}>;
|
|
420
|
+
fileId: z.ZodNullable<z.ZodUUID>;
|
|
421
|
+
error: z.ZodNullable<z.ZodString>;
|
|
422
|
+
counts: z.ZodObject<{
|
|
423
|
+
total: z.ZodDefault<z.ZodNumber>;
|
|
424
|
+
done: z.ZodDefault<z.ZodNumber>;
|
|
425
|
+
skipped: z.ZodDefault<z.ZodNumber>;
|
|
426
|
+
failed: z.ZodDefault<z.ZodNumber>;
|
|
427
|
+
}, z.core.$strip>;
|
|
428
|
+
createdAt: z.ZodISODateTime;
|
|
429
|
+
finishedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
430
|
+
}, z.core.$strip>;
|
|
431
|
+
export type ExportJob = z.infer<typeof ExportJob>;
|
|
432
|
+
/** What kind of export is being read in. */
|
|
433
|
+
export declare const ImportSource: z.ZodEnum<{
|
|
434
|
+
markdown: "markdown";
|
|
435
|
+
notion: "notion";
|
|
436
|
+
confluence: "confluence";
|
|
437
|
+
}>;
|
|
438
|
+
export type ImportSource = z.infer<typeof ImportSource>;
|
|
439
|
+
/**
|
|
440
|
+
* What happened to one file.
|
|
441
|
+
*
|
|
442
|
+
* Three outcomes and not two, because "not imported" covers two different situations a person needs
|
|
443
|
+
* to tell apart: a file Quire deliberately did not want (an asset already inlined, a Notion index
|
|
444
|
+
* page that duplicates the folder) is `skipped`, and a file that should have become a page and did
|
|
445
|
+
* not is `failed`. Collapsing them turns a broken import into a tidy-looking one.
|
|
446
|
+
*/
|
|
447
|
+
export declare const ImportOutcome: z.ZodEnum<{
|
|
448
|
+
failed: "failed";
|
|
449
|
+
skipped: "skipped";
|
|
450
|
+
imported: "imported";
|
|
451
|
+
}>;
|
|
452
|
+
export type ImportOutcome = z.infer<typeof ImportOutcome>;
|
|
453
|
+
/**
|
|
454
|
+
* One row of the report: what the file was, what became of it, and which.
|
|
455
|
+
*
|
|
456
|
+
* The failure list is the feature. A real Notion export has files that will not map, and an import
|
|
457
|
+
* that silently drops forty pages is worse than one that refuses — so every file in the upload gets
|
|
458
|
+
* an entry, including the ones that worked, and the report is complete rather than a list of
|
|
459
|
+
* complaints. `path` is the path inside the archive, which is what somebody has to go and look at.
|
|
460
|
+
*/
|
|
461
|
+
export declare const ImportReportEntry: z.ZodObject<{
|
|
462
|
+
path: z.ZodString;
|
|
463
|
+
outcome: z.ZodEnum<{
|
|
464
|
+
failed: "failed";
|
|
465
|
+
skipped: "skipped";
|
|
466
|
+
imported: "imported";
|
|
467
|
+
}>;
|
|
468
|
+
pageId: z.ZodDefault<z.ZodNullable<z.ZodUUID>>;
|
|
469
|
+
reason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
470
|
+
}, z.core.$strip>;
|
|
471
|
+
export type ImportReportEntry = z.infer<typeof ImportReportEntry>;
|
|
472
|
+
/**
|
|
473
|
+
* A Notion export zip, a Confluence export or a folder of Markdown, on its way into one space.
|
|
474
|
+
*
|
|
475
|
+
* `sourceFileId` is the upload, not an artefact — the opposite direction from `ExportJob.fileId`, and
|
|
476
|
+
* named differently for that reason. An import produces pages, not a file.
|
|
477
|
+
*
|
|
478
|
+
* Internal links between imported pages are rewritten to Quire page ids as the import goes; a link
|
|
479
|
+
* that cannot be resolved becomes plain text rather than a dead link, and the page that carried it
|
|
480
|
+
* still counts as `imported`. That choice is why `report` is per *file* and not per *link*: a page
|
|
481
|
+
* that arrived with one unresolvable link is an imported page, not a failure.
|
|
482
|
+
*/
|
|
483
|
+
export declare const ImportJob: z.ZodObject<{
|
|
484
|
+
id: z.ZodUUID;
|
|
485
|
+
workspaceId: z.core.$ZodBranded<z.ZodUUID, "WorkspaceId", "out">;
|
|
486
|
+
requestedBy: z.core.$ZodBranded<z.ZodUUID, "UserId", "out">;
|
|
487
|
+
source: z.ZodEnum<{
|
|
488
|
+
markdown: "markdown";
|
|
489
|
+
notion: "notion";
|
|
490
|
+
confluence: "confluence";
|
|
491
|
+
}>;
|
|
492
|
+
targetId: z.ZodUUID;
|
|
493
|
+
sourceFileId: z.ZodUUID;
|
|
494
|
+
state: z.ZodEnum<{
|
|
495
|
+
queued: "queued";
|
|
496
|
+
running: "running";
|
|
497
|
+
done: "done";
|
|
498
|
+
failed: "failed";
|
|
499
|
+
}>;
|
|
500
|
+
error: z.ZodNullable<z.ZodString>;
|
|
501
|
+
counts: z.ZodObject<{
|
|
502
|
+
total: z.ZodDefault<z.ZodNumber>;
|
|
503
|
+
done: z.ZodDefault<z.ZodNumber>;
|
|
504
|
+
skipped: z.ZodDefault<z.ZodNumber>;
|
|
505
|
+
failed: z.ZodDefault<z.ZodNumber>;
|
|
506
|
+
}, z.core.$strip>;
|
|
507
|
+
report: z.ZodArray<z.ZodObject<{
|
|
508
|
+
path: z.ZodString;
|
|
509
|
+
outcome: z.ZodEnum<{
|
|
510
|
+
failed: "failed";
|
|
511
|
+
skipped: "skipped";
|
|
512
|
+
imported: "imported";
|
|
513
|
+
}>;
|
|
514
|
+
pageId: z.ZodDefault<z.ZodNullable<z.ZodUUID>>;
|
|
515
|
+
reason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
516
|
+
}, z.core.$strip>>;
|
|
517
|
+
createdAt: z.ZodISODateTime;
|
|
518
|
+
finishedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
519
|
+
}, z.core.$strip>;
|
|
520
|
+
export type ImportJob = z.infer<typeof ImportJob>;
|
|
521
|
+
/**
|
|
522
|
+
* What a template makes.
|
|
523
|
+
*
|
|
524
|
+
* `page` — one page; the body is a page doc.
|
|
525
|
+
* `space` — a whole space; the body is a tree of pages, each with its own body.
|
|
526
|
+
*
|
|
527
|
+
* Two rather than one with a "just make the root" flag, because they are made from different places
|
|
528
|
+
* and answer different questions: a page template is offered on "New page" inside a space that
|
|
529
|
+
* already exists, and a space template is what somebody reaches for when there is no space yet.
|
|
530
|
+
*/
|
|
531
|
+
export declare const TemplateKind: z.ZodEnum<{
|
|
532
|
+
page: "page";
|
|
533
|
+
space: "space";
|
|
534
|
+
}>;
|
|
535
|
+
export type TemplateKind = z.infer<typeof TemplateKind>;
|
|
536
|
+
/**
|
|
537
|
+
* The starters this module ships.
|
|
538
|
+
*
|
|
539
|
+
* **They are constants in the module, not rows in a customer's database**, and the key is what a
|
|
540
|
+
* constant has instead of an id. `migrations/0011_templates.sql` argues the choice at length; the
|
|
541
|
+
* short of it is that a migration runs once per *database* and has no workspace to seed into, that a
|
|
542
|
+
* seeded row is frozen at the release that wrote it, and that a row holds one language in a product
|
|
543
|
+
* that ships five.
|
|
544
|
+
*
|
|
545
|
+
* A workspace edits a starter by **overriding** it: a `Template` row carrying one of these keys takes
|
|
546
|
+
* that starter's place in the picker rather than sitting beside it, so the first edit writes one row,
|
|
547
|
+
* a workspace that never touches them has none, and resetting is deleting the row.
|
|
548
|
+
*
|
|
549
|
+
* `Template.key` is deliberately **not** this enum — see the comment there.
|
|
550
|
+
*/
|
|
551
|
+
export declare const TemplateStarterKey: z.ZodEnum<{
|
|
552
|
+
"meeting-notes": "meeting-notes";
|
|
553
|
+
"decision-record": "decision-record";
|
|
554
|
+
requirements: "requirements";
|
|
555
|
+
retrospective: "retrospective";
|
|
556
|
+
"how-to": "how-to";
|
|
557
|
+
}>;
|
|
558
|
+
export type TemplateStarterKey = z.infer<typeof TemplateStarterKey>;
|
|
559
|
+
export declare const TEMPLATE_STARTER_KEYS: ("meeting-notes" | "decision-record" | "requirements" | "retrospective" | "how-to")[];
|
|
560
|
+
/**
|
|
561
|
+
* What a variable's type decides, which is **the control somebody is shown and not the storage**.
|
|
562
|
+
*
|
|
563
|
+
* Every filled value is substituted into prose as text, whatever the type: `{{sprint}}` in a heading
|
|
564
|
+
* becomes characters in a heading. The type is what turns "type the date" into a date picker and
|
|
565
|
+
* "type one of these four" into a menu — the difference between a form somebody fills correctly and
|
|
566
|
+
* one they fill approximately.
|
|
567
|
+
*/
|
|
568
|
+
export declare const TemplateVariableType: z.ZodEnum<{
|
|
569
|
+
number: "number";
|
|
570
|
+
date: "date";
|
|
571
|
+
text: "text";
|
|
572
|
+
select: "select";
|
|
573
|
+
user: "user";
|
|
574
|
+
}>;
|
|
575
|
+
export type TemplateVariableType = z.infer<typeof TemplateVariableType>;
|
|
576
|
+
/**
|
|
577
|
+
* The names a template author may not take, because the module already fills them.
|
|
578
|
+
*
|
|
579
|
+
* `date` and `author` are the two the plan names. The other three are reserved now rather than
|
|
580
|
+
* later, and that is the whole reason the list is longer than it needs to be today: adding
|
|
581
|
+
* `{{time}}` in a future release would silently change what an existing template renders if some
|
|
582
|
+
* author had already declared a variable of that name. Reserving a name costs an author one
|
|
583
|
+
* synonym; taking one back costs somebody a document that used to be right.
|
|
584
|
+
*/
|
|
585
|
+
export declare const TEMPLATE_BUILT_IN_VARIABLES: readonly ["date", "time", "author", "space", "workspace"];
|
|
586
|
+
/**
|
|
587
|
+
* What appears between the braces.
|
|
588
|
+
*
|
|
589
|
+
* ASCII, lowercase, no spaces — the same shape as `Space.key` and for the same reason: this string
|
|
590
|
+
* is matched against the body, so `{{Sprint}}` and `{{sprint}}` being two variables is exactly the
|
|
591
|
+
* near-duplicate that `labels_ws_space_name_uq` refuses next door. An author's own language belongs
|
|
592
|
+
* in `label`, which is the half a person actually reads.
|
|
593
|
+
*/
|
|
594
|
+
export declare const TemplateVariableName: z.ZodString;
|
|
595
|
+
/**
|
|
596
|
+
* One thing somebody is asked before the page is made.
|
|
597
|
+
*
|
|
598
|
+
* Every field but `name`, `label` and `type` defaults, so a variable written by an older client
|
|
599
|
+
* still parses. Note what that does to the *output* type: it makes them required, so anything
|
|
600
|
+
* constructing a variable supplies all six — which is the point, and the reason a widened contract
|
|
601
|
+
* is additive for parsing and breaking for constructing.
|
|
602
|
+
*/
|
|
603
|
+
export declare const TemplateVariable: z.ZodObject<{
|
|
604
|
+
name: z.ZodString;
|
|
605
|
+
label: z.ZodString;
|
|
606
|
+
type: z.ZodEnum<{
|
|
607
|
+
number: "number";
|
|
608
|
+
date: "date";
|
|
609
|
+
text: "text";
|
|
610
|
+
select: "select";
|
|
611
|
+
user: "user";
|
|
612
|
+
}>;
|
|
613
|
+
options: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
614
|
+
default: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
615
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
616
|
+
}, z.core.$strip>;
|
|
617
|
+
export type TemplateVariable = z.infer<typeof TemplateVariable>;
|
|
618
|
+
/**
|
|
619
|
+
* One page of a space template, and everything under it.
|
|
620
|
+
*
|
|
621
|
+
* Recursive because a space is a tree and flattening it into a list with parent pointers would mean
|
|
622
|
+
* inventing local ids that exist only inside the column — an identifier nothing outside this
|
|
623
|
+
* document ever resolves. The depth is bounded by the space it was made from.
|
|
624
|
+
*
|
|
625
|
+
* The type is written out and the schema annotated with it, rather than left to inference, because
|
|
626
|
+
* a self-referencing `const` has no type TypeScript can name on its own and the package emits
|
|
627
|
+
* declarations.
|
|
628
|
+
*/
|
|
629
|
+
export type TemplateSpaceNode = {
|
|
630
|
+
title: string;
|
|
631
|
+
icon: string | null;
|
|
632
|
+
doc: Record<string, unknown>;
|
|
633
|
+
children: TemplateSpaceNode[];
|
|
634
|
+
};
|
|
635
|
+
export declare const TemplateSpaceNode: z.ZodType<TemplateSpaceNode, TemplateSpaceNode>;
|
|
636
|
+
/**
|
|
637
|
+
* The body of a `space` template: the tree, under one key.
|
|
638
|
+
*
|
|
639
|
+
* An object rather than a bare array so that `Template.doc` is a JSON object for both kinds — the
|
|
640
|
+
* column defaults to `'{}'`, and a default that is the wrong *type* for half the rows is a default
|
|
641
|
+
* that lies. It also means the two bodies are told apart by their keys rather than by `typeof`.
|
|
642
|
+
*/
|
|
643
|
+
export declare const TemplateSpaceBody: z.ZodObject<{
|
|
644
|
+
pages: z.ZodArray<z.ZodType<TemplateSpaceNode, TemplateSpaceNode, z.core.$ZodTypeInternals<TemplateSpaceNode, TemplateSpaceNode>>>;
|
|
645
|
+
}, z.core.$strip>;
|
|
646
|
+
export type TemplateSpaceBody = z.infer<typeof TemplateSpaceBody>;
|
|
647
|
+
/**
|
|
648
|
+
* A page, or a whole space, saved so it can be made again.
|
|
649
|
+
*
|
|
650
|
+
* `doc` is left opaque here for the reason `RichDoc` is: this file is not what knows the shape of a
|
|
651
|
+
* document. It is a page doc when `kind` is `page` and a `TemplateSpaceBody` when `kind` is `space`,
|
|
652
|
+
* and the server parses the second with the schema above.
|
|
653
|
+
*
|
|
654
|
+
* A shipped starter is not one of these — it has no id, no workspace and no timestamps, because it
|
|
655
|
+
* is a constant. What the picker returns is the starters and these together, with a row carrying a
|
|
656
|
+
* starter's `key` standing in for that starter.
|
|
657
|
+
*/
|
|
658
|
+
export declare const Template: z.ZodObject<{
|
|
659
|
+
id: z.ZodUUID;
|
|
660
|
+
workspaceId: z.core.$ZodBranded<z.ZodUUID, "WorkspaceId", "out">;
|
|
661
|
+
spaceId: z.ZodNullable<z.ZodUUID>;
|
|
662
|
+
kind: z.ZodEnum<{
|
|
663
|
+
page: "page";
|
|
664
|
+
space: "space";
|
|
665
|
+
}>;
|
|
666
|
+
key: z.ZodNullable<z.ZodString>;
|
|
667
|
+
builtIn: z.ZodBoolean;
|
|
668
|
+
name: z.ZodString;
|
|
669
|
+
description: z.ZodString;
|
|
670
|
+
icon: z.ZodNullable<z.ZodString>;
|
|
671
|
+
doc: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
672
|
+
variables: z.ZodArray<z.ZodObject<{
|
|
673
|
+
name: z.ZodString;
|
|
674
|
+
label: z.ZodString;
|
|
675
|
+
type: z.ZodEnum<{
|
|
676
|
+
number: "number";
|
|
677
|
+
date: "date";
|
|
678
|
+
text: "text";
|
|
679
|
+
select: "select";
|
|
680
|
+
user: "user";
|
|
681
|
+
}>;
|
|
682
|
+
options: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
683
|
+
default: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
684
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
685
|
+
}, z.core.$strip>>;
|
|
686
|
+
createdBy: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UserId", "out">>;
|
|
687
|
+
createdAt: z.ZodISODateTime;
|
|
688
|
+
updatedAt: z.ZodISODateTime;
|
|
689
|
+
}, z.core.$strip>;
|
|
690
|
+
export type Template = z.infer<typeof Template>;
|
|
691
|
+
/**
|
|
692
|
+
* A template without its body.
|
|
693
|
+
*
|
|
694
|
+
* This exists so that opening a picker does not download every template's prose to draw a list of
|
|
695
|
+
* names — thirty page docs to render thirty rows, of which one is ever used. The body is fetched
|
|
696
|
+
* when a template is chosen.
|
|
697
|
+
*/
|
|
698
|
+
export declare const TemplateSummary: z.ZodObject<{
|
|
699
|
+
id: z.ZodUUID;
|
|
700
|
+
description: z.ZodString;
|
|
701
|
+
spaceId: z.ZodNullable<z.ZodUUID>;
|
|
702
|
+
workspaceId: z.core.$ZodBranded<z.ZodUUID, "WorkspaceId", "out">;
|
|
703
|
+
key: z.ZodNullable<z.ZodString>;
|
|
704
|
+
createdAt: z.ZodISODateTime;
|
|
705
|
+
updatedAt: z.ZodISODateTime;
|
|
706
|
+
name: z.ZodString;
|
|
707
|
+
icon: z.ZodNullable<z.ZodString>;
|
|
708
|
+
createdBy: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UserId", "out">>;
|
|
709
|
+
kind: z.ZodEnum<{
|
|
710
|
+
page: "page";
|
|
711
|
+
space: "space";
|
|
712
|
+
}>;
|
|
713
|
+
builtIn: z.ZodBoolean;
|
|
714
|
+
variables: z.ZodArray<z.ZodObject<{
|
|
715
|
+
name: z.ZodString;
|
|
716
|
+
label: z.ZodString;
|
|
717
|
+
type: z.ZodEnum<{
|
|
718
|
+
number: "number";
|
|
719
|
+
date: "date";
|
|
720
|
+
text: "text";
|
|
721
|
+
select: "select";
|
|
722
|
+
user: "user";
|
|
723
|
+
}>;
|
|
724
|
+
options: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
725
|
+
default: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
726
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
727
|
+
}, z.core.$strip>>;
|
|
728
|
+
}, z.core.$strip>;
|
|
729
|
+
export type TemplateSummary = z.infer<typeof TemplateSummary>;
|
|
336
730
|
export declare const Ok: z.Zod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