@quad-education/sdk 0.8.0 → 0.9.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.
Files changed (57) hide show
  1. package/README.md +1 -0
  2. package/dist/contract-tests/apps.d.ts +430 -0
  3. package/dist/contract-tests/apps.js +143 -1
  4. package/dist/contract-tests/harness.d.ts +1 -1
  5. package/dist/contract-tests/harness.js +4 -0
  6. package/dist/contract-tests/lists-and-files.d.ts +19 -0
  7. package/dist/contract-tests/lists-and-files.js +279 -0
  8. package/dist/contract-tests/live.d.ts +3 -0
  9. package/dist/contract-tests/live.js +156 -0
  10. package/dist/contract-tests/notifications.d.ts +3 -0
  11. package/dist/contract-tests/notifications.js +218 -0
  12. package/dist/contract-tests/search-and-totals.d.ts +13 -0
  13. package/dist/contract-tests/search-and-totals.js +226 -0
  14. package/dist/contract-tests/suite.d.ts +5 -0
  15. package/dist/contract-tests/suite.js +27 -1
  16. package/dist/contract-tests/writes.d.ts +3 -0
  17. package/dist/contract-tests/writes.js +265 -0
  18. package/dist/src/base64.d.ts +3 -0
  19. package/dist/src/base64.js +52 -0
  20. package/dist/src/client/connect.d.ts +1 -0
  21. package/dist/src/client/connect.js +1 -0
  22. package/dist/src/client/create-client.js +39 -5
  23. package/dist/src/client/save-file.d.ts +16 -0
  24. package/dist/src/client/save-file.js +28 -0
  25. package/dist/src/client/watch.d.ts +20 -0
  26. package/dist/src/client/watch.js +175 -0
  27. package/dist/src/contract/errors.d.ts +1 -1
  28. package/dist/src/contract/types.d.ts +214 -10
  29. package/dist/src/contract/types.js +4 -1
  30. package/dist/src/engine/engine.d.ts +68 -1
  31. package/dist/src/engine/engine.js +508 -57
  32. package/dist/src/engine/files.d.ts +25 -0
  33. package/dist/src/engine/files.js +88 -0
  34. package/dist/src/engine/index.d.ts +1 -1
  35. package/dist/src/engine/memory-store.d.ts +33 -3
  36. package/dist/src/engine/memory-store.js +116 -8
  37. package/dist/src/engine/notify-content.d.ts +9 -0
  38. package/dist/src/engine/notify-content.js +88 -0
  39. package/dist/src/engine/query.d.ts +14 -2
  40. package/dist/src/engine/query.js +45 -13
  41. package/dist/src/engine/search.d.ts +8 -0
  42. package/dist/src/engine/search.js +32 -0
  43. package/dist/src/engine/storage.d.ts +46 -1
  44. package/dist/src/engine/storage.js +46 -3
  45. package/dist/src/engine/store.d.ts +39 -2
  46. package/dist/src/engine/summary.d.ts +25 -0
  47. package/dist/src/engine/summary.js +107 -0
  48. package/dist/src/engine/validate-input.d.ts +7 -1
  49. package/dist/src/engine/validate-input.js +28 -1
  50. package/dist/src/engine/working-copy.d.ts +30 -0
  51. package/dist/src/engine/working-copy.js +91 -0
  52. package/dist/src/platform-types.d.ts +11 -1
  53. package/dist/src/protocol.d.ts +1 -1
  54. package/dist/src/protocol.js +9 -0
  55. package/dist/src/testing/index.d.ts +2 -0
  56. package/dist/src/testing/index.js +9 -1
  57. package/package.json +4 -4
package/README.md CHANGED
@@ -96,6 +96,7 @@ The types allow `orderBy` and ranges only on indexed fields, so most mistakes ar
96
96
 
97
97
  ## Versions
98
98
 
99
+ - **0.9.0 (D147, D148, 25 Nov 2026).** Lists and files (a contract change across all the `@quad-education/*` packages, which move together). The schema gains `listOf(inner, options?)`, a field holding up to 100 values (text, numbers, dates, dates and times, choices, links or files; no lists of lists), and `file({ accept? })`, a field holding the id of a file the app keeps; `FIELD_KINDS`, `ITEM_KINDS`, `MAX_LIST_ITEMS`, `FILE_GROUPS`, `FILE_TYPES`, `fileTypesFor` and `MAX_FILE_BYTES` are exported. `db` list gains the `{ has: value }` condition for a list field (`HasCondition`), a list is never sorted by, range-filtered or indexed, and `include` on a list of links returns a list of records. A tenth service, `sdk.files`: `upload(file, { name? })`, `info(id)` and `read(id)` (`FilesApi`, `FileInfo`, `FileSource`). A file is its uploader's alone until its id is written into a `file` field; from then on whoever can read that field can read it, and it is removed with the field or the record, or after 24 hours unattached. 10 MB a file; images, PDF, text and CSV, and office documents. The protocol gains `files.upload`, `files.info` and `files.read`, carrying contents as base64 so params stay JSON (D15). The engine's store gains the file methods of `AppStore`, the testing kit's `Effects` gains `filesUploaded`, and `@quad-education/sdk-react` gains `useFileUrl(id)`. The demo shell's app frame may start a download. **Unique rules and safe writes (D149, D150):** `entity({ unique: [['slotId'], ['studentId', 'term']] })` (up to five rules of one to four single-valued fields; `MAX_UNIQUE_RULES`, `MAX_UNIQUE_FIELDS`, `MAX_UNIQUE_TEXT`), enforced across every record of the entity whoever can read them; a new error code, `CONFLICT`; `db.batch(ops, { idempotencyKey? })`, up to 25 creates, updates and deletes written together or not at all (`DbBatchOp`, `DbBatchResults`, `MAX_BATCH_OPERATIONS`, the `db.batch` method), failing with the first operation's error and `details.index`; and `update(id, patch, { if })` and `delete(id, { if })`, which write only when the record still holds the given values (`WriteCondition`). `AppStore` gains `commit`, which stores a write call's records, files and keys in one step. **Richer notifications (D151, D152):** `notify.send` takes `content`, a list of `NotifyBlock`s (`heading`, `text`, `list`, `details`, `button`; plain text only, up to 30 and one button), with `body` optional beside it and made from the blocks; and `attachments`, up to five file ids and 10 MB in all, of files the sender can read, each copied into the message as it is sent. A file from a `visibleTo` field goes only to those roles, and one at a staff-only level only to staff (`NOT_PERMITTED`). `OutboxEntry` gains `content` and `attachments`, and the engine the platform-only `sentFile(appId, id)`. **Search and totals (D153, D154):** `entity({ search: ['title', 'body'] })` names up to five text fields (`MAX_SEARCH_FIELDS`), and `list({ search })` on `sdk.db` and on `sdk.school` collections matches records where every word appears, ignoring case and accents, after the access rules and never in a field hidden from the reader. `DbOps` gains `count({ where, search })` and `summarise({ where, search, groupBy, sum, min, max, avg })` (`DbSummary`, `DbTotals`; the `db.count` and `db.summarise` methods), over readable records and visible fields only, refused past 20,000 records or 200 groups. **Printing and made files (D155, D156):** `@quad-education/sdk/client` gains `saveFile({ name, type, data })` (`SavedFile`), which hands the person a file the app made, from text or bytes; and the demo shell's app frame allows modals, so `window.print()` works. **Live updates (D157, D158):** `db.watch(entities, callback, { intervalMs?, onError? })` calls back once at the start and whenever a record in a named entity is created, changed or deleted, and returns a `DbWatch` (`check()`, `stop()`); the client asks every 5 seconds, never faster than every 2, not while the page is hidden, and at once after a write through the same SDK. Under it the protocol gains `db.changes`, which returns an opaque stamp for each entity and no records, and is refused for an entity the caller has no read rule on; `AppStore` gains `versions`. `@quad-education/sdk-react` gains `useLive(entities, load, { deps?, intervalMs? })` (`Live`). `createEngine` takes a `channel` (`StoreChannel`, a `BroadcastChannel`), over which the in-browser stores of one browser's windows share an app's records, and the demo shell passes one.
99
100
  - **0.8.0 (D142, D143, 24 Nov 2026).** Two access rules and app roles (a contract change across all the `@quad-education/*` packages, which move together). The schema's rules gain `'appAdmin'` (the installation's app admins, for the `staff` key) and `listedIn('entity')` or `listedIn('entity', 'field')` (the staff, students or parents a table of the app's points at); both reach every record, and who changes that table is the app's own rules' business. `accessWarnings(schema)` says when the people a rule keeps out could add themselves, and `quad gen` prints it. `auth.me()` gains `appRoles` for a user: the app's own roles (manifest `roles`) the school gave them, in the manifest's spelling. A person's rules are those of their school role and of every app role they hold. The engine gains the platform-only `setAppRoles(appId, { personId: roles })` and `schema(appId)`, and the testing kit `appRoles` and `setAppRoles`. `SDK_VERSION`, left at `0.6.0` in 0.7.0, is `0.8.0`.
100
101
  - **0.7.0 (D132, 30 Oct 2026).** Apps are free in design; no change to the SDK's calls.
101
102
  - **0.6.0 (D133, 30 Oct 2026).** App admins: `auth.me()` gains `appAdmin` for a user (staff the school put in charge of the app), and `auth.appAdmins()` lists them for staff and jobs (FORBIDDEN for a student or parent). The engine gains the platform-only `setAppAdmins(appId, personIds)`, the testing kit `createTestPlatform({ appAdmins })` and `setAppAdmins`, and the contract tests the `setAppAdmins` control. A contract change; every `@quad-education/*` package moves to 0.6.0.
@@ -28,6 +28,8 @@ export declare const TEST_SCHEMA: {
28
28
  };
29
29
  };
30
30
  readonly indexes: readonly [readonly ["studentId"], readonly ["message"], readonly ["tone", "message"]];
31
+ readonly unique?: readonly (readonly string[])[];
32
+ readonly search?: readonly string[];
31
33
  readonly subject?: "studentId";
32
34
  readonly access?: {
33
35
  readonly staff: {
@@ -58,6 +60,8 @@ export declare const TEST_SCHEMA: {
58
60
  };
59
61
  };
60
62
  readonly indexes: readonly [];
63
+ readonly unique?: readonly (readonly string[])[];
64
+ readonly search?: readonly string[];
61
65
  readonly subject?: "message" | "greetingId";
62
66
  readonly access?: import("@quad-education/schema").AccessPolicy;
63
67
  };
@@ -90,6 +94,8 @@ export declare const ROLES_SCHEMA: {
90
94
  };
91
95
  };
92
96
  readonly indexes: readonly [];
97
+ readonly unique?: readonly (readonly string[])[];
98
+ readonly search?: readonly string[];
93
99
  readonly subject?: "body";
94
100
  readonly access?: {
95
101
  readonly Staff: {
@@ -122,6 +128,8 @@ export declare const ACCESS_SCHEMA: {
122
128
  };
123
129
  };
124
130
  readonly indexes: readonly [];
131
+ readonly unique?: readonly (readonly string[])[];
132
+ readonly search?: readonly string[];
125
133
  readonly subject?: "title";
126
134
  readonly access?: import("@quad-education/schema").AccessPolicy;
127
135
  };
@@ -155,6 +163,8 @@ export declare const ACCESS_SCHEMA: {
155
163
  };
156
164
  };
157
165
  readonly indexes: readonly [];
166
+ readonly unique?: readonly (readonly string[])[];
167
+ readonly search?: readonly string[];
158
168
  readonly subject?: "studentId";
159
169
  readonly access?: {
160
170
  readonly staff: {
@@ -194,6 +204,8 @@ export declare const ACCESS_SCHEMA: {
194
204
  };
195
205
  };
196
206
  readonly indexes: readonly [readonly ["body"]];
207
+ readonly unique?: readonly (readonly string[])[];
208
+ readonly search?: readonly string[];
197
209
  readonly subject?: "studentId";
198
210
  readonly access?: {
199
211
  readonly staff: {
@@ -228,6 +240,8 @@ export declare const APP_ROLES_SCHEMA: {
228
240
  };
229
241
  };
230
242
  readonly indexes: readonly [];
243
+ readonly unique?: readonly (readonly string[])[];
244
+ readonly search?: readonly string[];
231
245
  readonly subject?: "body";
232
246
  readonly access?: {
233
247
  readonly staff: {
@@ -251,6 +265,8 @@ export declare const APP_ROLES_SCHEMA: {
251
265
  };
252
266
  };
253
267
  readonly indexes: readonly [];
268
+ readonly unique?: readonly (readonly string[])[];
269
+ readonly search?: readonly string[];
254
270
  readonly subject?: "title";
255
271
  readonly access?: {
256
272
  readonly Coach: {
@@ -281,6 +297,8 @@ export declare const LISTED_SCHEMA: {
281
297
  };
282
298
  };
283
299
  readonly indexes: readonly [];
300
+ readonly unique?: readonly (readonly string[])[];
301
+ readonly search?: readonly string[];
284
302
  readonly subject?: "staffId";
285
303
  readonly access?: {
286
304
  readonly staff: {
@@ -299,6 +317,8 @@ export declare const LISTED_SCHEMA: {
299
317
  };
300
318
  };
301
319
  readonly indexes: readonly [];
320
+ readonly unique?: readonly (readonly string[])[];
321
+ readonly search?: readonly string[];
302
322
  readonly subject?: "mood";
303
323
  readonly access?: {
304
324
  readonly staff: {
@@ -316,6 +336,8 @@ export declare const LISTED_SCHEMA: {
316
336
  };
317
337
  };
318
338
  readonly indexes: readonly [];
339
+ readonly unique?: readonly (readonly string[])[];
340
+ readonly search?: readonly string[];
319
341
  readonly subject?: "label";
320
342
  readonly access?: {
321
343
  readonly staff: {
@@ -344,6 +366,8 @@ export declare const LISTED_SCHEMA: {
344
366
  };
345
367
  };
346
368
  readonly indexes: readonly [];
369
+ readonly unique?: readonly (readonly string[])[];
370
+ readonly search?: readonly string[];
347
371
  readonly subject?: "studentId" | "addedBy";
348
372
  readonly access?: import("@quad-education/schema").AccessPolicy;
349
373
  };
@@ -355,6 +379,8 @@ export declare const LISTED_SCHEMA: {
355
379
  };
356
380
  };
357
381
  readonly indexes: readonly [];
382
+ readonly unique?: readonly (readonly string[])[];
383
+ readonly search?: readonly string[];
358
384
  readonly subject?: "title";
359
385
  readonly access?: {
360
386
  readonly staff: {
@@ -377,6 +403,8 @@ export declare const LISTED_SCHEMA: {
377
403
  };
378
404
  };
379
405
  readonly indexes: readonly [];
406
+ readonly unique?: readonly (readonly string[])[];
407
+ readonly search?: readonly string[];
380
408
  readonly subject?: "staffId";
381
409
  readonly access?: import("@quad-education/schema").AccessPolicy;
382
410
  };
@@ -388,6 +416,8 @@ export declare const LISTED_SCHEMA: {
388
416
  };
389
417
  };
390
418
  readonly indexes: readonly [];
419
+ readonly unique?: readonly (readonly string[])[];
420
+ readonly search?: readonly string[];
391
421
  readonly subject?: "day";
392
422
  readonly access?: {
393
423
  readonly staff: {
@@ -428,6 +458,8 @@ export declare const JOBS_SCHEMA: {
428
458
  };
429
459
  };
430
460
  readonly indexes: readonly [];
461
+ readonly unique?: readonly (readonly string[])[];
462
+ readonly search?: readonly string[];
431
463
  readonly subject?: "runId" | "principal" | "studentsSeen" | "otherFamilyVisible" | "staffOnlyWriteAllowed";
432
464
  readonly access?: {
433
465
  readonly staff: {
@@ -470,6 +502,8 @@ export declare const JOBS_SCHEMA: {
470
502
  };
471
503
  };
472
504
  readonly indexes: readonly [];
505
+ readonly unique?: readonly (readonly string[])[];
506
+ readonly search?: readonly string[];
473
507
  readonly subject?: "note" | "runId" | "jobName" | "scheduledFor" | "principal";
474
508
  readonly access?: import("@quad-education/schema").AccessPolicy;
475
509
  };
@@ -499,6 +533,8 @@ export declare const JOBS_SCHEMA: {
499
533
  };
500
534
  };
501
535
  readonly indexes: readonly [readonly ["studentId"], readonly ["message"], readonly ["tone", "message"]];
536
+ readonly unique?: readonly (readonly string[])[];
537
+ readonly search?: readonly string[];
502
538
  readonly subject?: "studentId";
503
539
  readonly access?: {
504
540
  readonly staff: {
@@ -529,6 +565,8 @@ export declare const JOBS_SCHEMA: {
529
565
  };
530
566
  };
531
567
  readonly indexes: readonly [];
568
+ readonly unique?: readonly (readonly string[])[];
569
+ readonly search?: readonly string[];
532
570
  readonly subject?: "message" | "greetingId";
533
571
  readonly access?: import("@quad-education/schema").AccessPolicy;
534
572
  };
@@ -553,4 +591,396 @@ export declare const JOBS_APP: {
553
591
  schema: typeof JOBS_SCHEMA;
554
592
  jobs: typeof TEST_JOBS;
555
593
  };
594
+ /**
595
+ * Lists and files (D147, D148). Staff reach every incident; a student reaches the ones they wrote, so one student
596
+ * can't read another's files. `staffNotes` is hidden from students by `visibleTo`.
597
+ */
598
+ export declare const FILES_SCHEMA: {
599
+ readonly incident: {
600
+ readonly fields: {
601
+ readonly summary: {
602
+ readonly kind: "text";
603
+ readonly tier: import("@quad-education/canonical").Tier;
604
+ };
605
+ readonly students: {
606
+ readonly kind: "list";
607
+ readonly tier: import("@quad-education/canonical").Tier;
608
+ } & {
609
+ of: Omit<{
610
+ readonly kind: "ref";
611
+ readonly tier: import("@quad-education/canonical").Tier;
612
+ } & {
613
+ to: "school.students";
614
+ }, "optional" | "tier" | "visibleTo">;
615
+ } & {
616
+ readonly optional: true;
617
+ };
618
+ readonly tags: {
619
+ readonly kind: "list";
620
+ readonly tier: import("@quad-education/canonical").Tier;
621
+ } & {
622
+ of: Omit<{
623
+ readonly kind: "text";
624
+ readonly tier: import("@quad-education/canonical").Tier;
625
+ }, "optional" | "tier" | "visibleTo">;
626
+ } & {
627
+ readonly optional: true;
628
+ };
629
+ readonly days: {
630
+ readonly kind: "list";
631
+ readonly tier: import("@quad-education/canonical").Tier;
632
+ } & {
633
+ of: Omit<{
634
+ readonly kind: "enum";
635
+ readonly tier: import("@quad-education/canonical").Tier;
636
+ } & {
637
+ values: readonly ["mon", "tue", "wed"];
638
+ }, "optional" | "tier" | "visibleTo">;
639
+ } & {
640
+ readonly optional: true;
641
+ };
642
+ readonly scores: {
643
+ readonly kind: "list";
644
+ readonly tier: import("@quad-education/canonical").Tier;
645
+ } & {
646
+ of: Omit<{
647
+ readonly kind: "number";
648
+ readonly tier: import("@quad-education/canonical").Tier;
649
+ }, "optional" | "tier" | "visibleTo">;
650
+ } & {
651
+ readonly optional: true;
652
+ };
653
+ readonly related: {
654
+ readonly kind: "list";
655
+ readonly tier: import("@quad-education/canonical").Tier;
656
+ } & {
657
+ of: Omit<{
658
+ readonly kind: "ref";
659
+ readonly tier: import("@quad-education/canonical").Tier;
660
+ } & {
661
+ to: "incident";
662
+ }, "optional" | "tier" | "visibleTo">;
663
+ } & {
664
+ readonly optional: true;
665
+ };
666
+ readonly photo: {
667
+ readonly kind: "file";
668
+ readonly tier: import("@quad-education/canonical").Tier;
669
+ } & {
670
+ readonly accept: readonly ["image"];
671
+ } & {
672
+ readonly optional: true;
673
+ };
674
+ readonly evidence: {
675
+ readonly kind: "list";
676
+ readonly tier: import("@quad-education/canonical").Tier;
677
+ } & {
678
+ of: Omit<{
679
+ readonly kind: "file";
680
+ readonly tier: import("@quad-education/canonical").Tier;
681
+ } & object, "optional" | "tier" | "visibleTo">;
682
+ } & {
683
+ readonly optional: true;
684
+ };
685
+ readonly staffNotes: {
686
+ readonly kind: "list";
687
+ readonly tier: import("@quad-education/canonical").Tier;
688
+ } & {
689
+ of: Omit<{
690
+ readonly kind: "file";
691
+ readonly tier: import("@quad-education/canonical").Tier;
692
+ } & object, "optional" | "tier" | "visibleTo">;
693
+ } & {
694
+ readonly optional: true;
695
+ } & {
696
+ readonly visibleTo: readonly ["staff"];
697
+ };
698
+ };
699
+ readonly indexes: readonly [readonly ["summary"]];
700
+ readonly unique?: readonly (readonly string[])[];
701
+ readonly search?: readonly string[];
702
+ readonly subject?: "students" | "summary" | "related" | "days" | "tags" | "scores" | "photo" | "evidence" | "staffNotes";
703
+ readonly access?: {
704
+ readonly staff: {
705
+ readonly read: "all";
706
+ readonly create: "all";
707
+ readonly update: "all";
708
+ readonly delete: "all";
709
+ };
710
+ readonly student: {
711
+ readonly read: "own";
712
+ readonly create: "own";
713
+ readonly update: "own";
714
+ readonly delete: "own";
715
+ };
716
+ };
717
+ };
718
+ };
719
+ export declare const FILES_APP: {
720
+ manifest: Manifest;
721
+ schema: typeof FILES_SCHEMA;
722
+ };
723
+ /**
724
+ * Unique rules, batches and conditional writes (D149, D150). A student reaches only the bookings they made, so a
725
+ * unique rule is seen refusing a value held by a record the writer cannot read.
726
+ */
727
+ export declare const WRITES_SCHEMA: {
728
+ readonly slot: {
729
+ readonly fields: {
730
+ readonly label: {
731
+ readonly kind: "text";
732
+ readonly tier: import("@quad-education/canonical").Tier;
733
+ };
734
+ readonly status: {
735
+ readonly kind: "enum";
736
+ readonly tier: import("@quad-education/canonical").Tier;
737
+ } & {
738
+ values: readonly ["free", "taken"];
739
+ };
740
+ readonly seats: {
741
+ readonly kind: "number";
742
+ readonly tier: import("@quad-education/canonical").Tier;
743
+ } & {
744
+ readonly optional: true;
745
+ };
746
+ readonly secret: {
747
+ readonly kind: "text";
748
+ readonly tier: import("@quad-education/canonical").Tier;
749
+ } & {
750
+ readonly optional: true;
751
+ } & {
752
+ readonly visibleTo: readonly ["staff"];
753
+ };
754
+ };
755
+ readonly indexes: readonly [];
756
+ readonly unique?: readonly (readonly string[])[];
757
+ readonly search?: readonly string[];
758
+ readonly subject?: "status" | "label" | "seats" | "secret";
759
+ readonly access?: {
760
+ readonly staff: {
761
+ readonly read: "all";
762
+ readonly create: "all";
763
+ readonly update: "all";
764
+ readonly delete: "all";
765
+ };
766
+ };
767
+ };
768
+ readonly booking: {
769
+ readonly fields: {
770
+ readonly slotLabel: {
771
+ readonly kind: "text";
772
+ readonly tier: import("@quad-education/canonical").Tier;
773
+ };
774
+ readonly who: {
775
+ readonly kind: "text";
776
+ readonly tier: import("@quad-education/canonical").Tier;
777
+ } & {
778
+ readonly optional: true;
779
+ };
780
+ readonly term: {
781
+ readonly kind: "text";
782
+ readonly tier: import("@quad-education/canonical").Tier;
783
+ } & {
784
+ readonly optional: true;
785
+ };
786
+ readonly proof: {
787
+ readonly kind: "file";
788
+ readonly tier: import("@quad-education/canonical").Tier;
789
+ } & object & {
790
+ readonly optional: true;
791
+ };
792
+ };
793
+ readonly indexes: readonly [];
794
+ readonly unique?: readonly (readonly string[])[];
795
+ readonly search?: readonly string[];
796
+ readonly subject?: "who" | "slotLabel" | "term" | "proof";
797
+ readonly access?: {
798
+ readonly staff: {
799
+ readonly read: "all";
800
+ readonly create: "all";
801
+ readonly update: "all";
802
+ readonly delete: "all";
803
+ };
804
+ readonly student: {
805
+ readonly read: "own";
806
+ readonly create: "own";
807
+ readonly update: "own";
808
+ readonly delete: "own";
809
+ };
810
+ };
811
+ };
812
+ };
813
+ export declare const WRITES_APP: {
814
+ manifest: Manifest;
815
+ schema: typeof WRITES_SCHEMA;
816
+ };
817
+ /**
818
+ * Formatted notifications and attachments (D151, D152). `staffNote` is hidden from students and parents, and
819
+ * `review` is at a staff-only level, so neither may be sent to them.
820
+ */
821
+ export declare const NOTIFY_SCHEMA: {
822
+ readonly notice: {
823
+ readonly fields: {
824
+ readonly title: {
825
+ readonly kind: "text";
826
+ readonly tier: import("@quad-education/canonical").Tier;
827
+ };
828
+ readonly slip: {
829
+ readonly kind: "file";
830
+ readonly tier: import("@quad-education/canonical").Tier;
831
+ } & object & {
832
+ readonly optional: true;
833
+ };
834
+ readonly pages: {
835
+ readonly kind: "list";
836
+ readonly tier: import("@quad-education/canonical").Tier;
837
+ } & {
838
+ of: Omit<{
839
+ readonly kind: "file";
840
+ readonly tier: import("@quad-education/canonical").Tier;
841
+ } & object, "optional" | "tier" | "visibleTo">;
842
+ } & {
843
+ readonly optional: true;
844
+ };
845
+ readonly staffNote: {
846
+ readonly kind: "file";
847
+ readonly tier: import("@quad-education/canonical").Tier;
848
+ } & object & {
849
+ readonly optional: true;
850
+ } & {
851
+ readonly visibleTo: readonly ["staff"];
852
+ };
853
+ readonly review: {
854
+ readonly kind: "file";
855
+ readonly tier: import("@quad-education/canonical").Tier;
856
+ } & object & {
857
+ readonly optional: true;
858
+ };
859
+ };
860
+ readonly indexes: readonly [];
861
+ readonly unique?: readonly (readonly string[])[];
862
+ readonly search?: readonly string[];
863
+ readonly subject?: "title" | "staffNote" | "slip" | "pages" | "review";
864
+ readonly access?: {
865
+ readonly staff: {
866
+ readonly read: "all";
867
+ readonly create: "all";
868
+ readonly update: "all";
869
+ readonly delete: "all";
870
+ };
871
+ readonly student: {
872
+ readonly read: "own";
873
+ readonly create: "own";
874
+ };
875
+ };
876
+ };
877
+ };
878
+ export declare const NOTIFY_APP: {
879
+ manifest: Manifest;
880
+ schema: typeof NOTIFY_SCHEMA;
881
+ };
882
+ /**
883
+ * Search and totals (D153, D154). `secret` and `margin` are hidden from students, so neither a search nor a
884
+ * total may tell a student anything about them. `plain` names no searchable fields.
885
+ */
886
+ export declare const SEARCH_SCHEMA: {
887
+ readonly request: {
888
+ readonly fields: {
889
+ readonly title: {
890
+ readonly kind: "text";
891
+ readonly tier: import("@quad-education/canonical").Tier;
892
+ };
893
+ readonly body: {
894
+ readonly kind: "text";
895
+ readonly tier: import("@quad-education/canonical").Tier;
896
+ } & {
897
+ readonly optional: true;
898
+ };
899
+ readonly tags: {
900
+ readonly kind: "list";
901
+ readonly tier: import("@quad-education/canonical").Tier;
902
+ } & {
903
+ of: Omit<{
904
+ readonly kind: "text";
905
+ readonly tier: import("@quad-education/canonical").Tier;
906
+ }, "optional" | "tier" | "visibleTo">;
907
+ } & {
908
+ readonly optional: true;
909
+ };
910
+ readonly secret: {
911
+ readonly kind: "text";
912
+ readonly tier: import("@quad-education/canonical").Tier;
913
+ } & {
914
+ readonly optional: true;
915
+ } & {
916
+ readonly visibleTo: readonly ["staff"];
917
+ };
918
+ readonly status: {
919
+ readonly kind: "enum";
920
+ readonly tier: import("@quad-education/canonical").Tier;
921
+ } & {
922
+ values: readonly ["open", "closed"];
923
+ };
924
+ readonly term: {
925
+ readonly kind: "text";
926
+ readonly tier: import("@quad-education/canonical").Tier;
927
+ } & {
928
+ readonly optional: true;
929
+ };
930
+ readonly cost: {
931
+ readonly kind: "number";
932
+ readonly tier: import("@quad-education/canonical").Tier;
933
+ } & {
934
+ readonly optional: true;
935
+ };
936
+ readonly margin: {
937
+ readonly kind: "number";
938
+ readonly tier: import("@quad-education/canonical").Tier;
939
+ } & {
940
+ readonly optional: true;
941
+ } & {
942
+ readonly visibleTo: readonly ["staff"];
943
+ };
944
+ readonly proof: {
945
+ readonly kind: "file";
946
+ readonly tier: import("@quad-education/canonical").Tier;
947
+ } & object & {
948
+ readonly optional: true;
949
+ };
950
+ };
951
+ readonly indexes: readonly [readonly ["title"], readonly ["cost"]];
952
+ readonly unique?: readonly (readonly string[])[];
953
+ readonly search?: readonly string[];
954
+ readonly subject?: "title" | "status" | "body" | "tags" | "secret" | "term" | "proof" | "cost" | "margin";
955
+ readonly access?: {
956
+ readonly staff: {
957
+ readonly read: "all";
958
+ readonly create: "all";
959
+ readonly update: "all";
960
+ readonly delete: "all";
961
+ };
962
+ readonly student: {
963
+ readonly read: "own";
964
+ readonly create: "own";
965
+ };
966
+ };
967
+ };
968
+ readonly plain: {
969
+ readonly fields: {
970
+ readonly label: {
971
+ readonly kind: "text";
972
+ readonly tier: import("@quad-education/canonical").Tier;
973
+ };
974
+ };
975
+ readonly indexes: readonly [];
976
+ readonly unique?: readonly (readonly string[])[];
977
+ readonly search?: readonly string[];
978
+ readonly subject?: "label";
979
+ readonly access?: import("@quad-education/schema").AccessPolicy;
980
+ };
981
+ };
982
+ export declare const SEARCH_APP: {
983
+ manifest: Manifest;
984
+ schema: typeof SEARCH_SCHEMA;
985
+ };
556
986
  export {};