@happyvertical/smrt-education 0.57.37 → 0.57.39
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/AGENTS.md +8 -0
- package/agents/catalog-previews.md +98 -0
- package/agents/family-intake.md +97 -0
- package/dist/catalog-contracts.d.ts +2 -0
- package/dist/catalog-contracts.d.ts.map +1 -1
- package/dist/catalog-database-sync-store.d.ts.map +1 -1
- package/dist/catalog-models.d.ts +5 -0
- package/dist/catalog-models.d.ts.map +1 -1
- package/dist/catalog-preview.d.ts +63 -0
- package/dist/catalog-preview.d.ts.map +1 -0
- package/dist/catalog-read-service.d.ts +3 -0
- package/dist/catalog-read-service.d.ts.map +1 -1
- package/dist/catalog.d.ts +4 -4
- package/dist/catalog.d.ts.map +1 -1
- package/dist/chunks/{workbook-photo-service-1wcnf-Xf.js → workbook-photo-service-DCmqeWLd.js} +448 -202
- package/dist/chunks/workbook-photo-service-DCmqeWLd.js.map +1 -0
- package/dist/course-source.d.ts +2 -2
- package/dist/course-source.d.ts.map +1 -1
- package/dist/family-intake-contracts.d.ts +56 -0
- package/dist/family-intake-contracts.d.ts.map +1 -0
- package/dist/family-intake-ingestion.d.ts +29 -0
- package/dist/family-intake-ingestion.d.ts.map +1 -0
- package/dist/family-intake-models.d.ts +58 -0
- package/dist/family-intake-models.d.ts.map +1 -0
- package/dist/family-intake-service.d.ts +70 -0
- package/dist/family-intake-service.d.ts.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +289 -13
- package/dist/index.js.map +1 -1
- package/dist/ingestion.d.ts +2 -0
- package/dist/ingestion.d.ts.map +1 -1
- package/dist/ingestion.js +426 -13
- package/dist/ingestion.js.map +1 -1
- package/dist/intake-original-evidence.d.ts +10 -0
- package/dist/intake-original-evidence.d.ts.map +1 -0
- package/dist/learner-service.d.ts +2 -0
- package/dist/learner-service.d.ts.map +1 -1
- package/dist/learners.d.ts +5 -5
- package/dist/learners.d.ts.map +1 -1
- package/dist/lesson-assets.d.ts +2 -2
- package/dist/lesson-assets.d.ts.map +1 -1
- package/dist/manifest.json +1447 -162
- package/dist/smrt-knowledge.json +563 -10
- package/dist/sources/public-illustrative-mathematics-adapter.d.ts +4 -2
- package/dist/sources/public-illustrative-mathematics-adapter.d.ts.map +1 -1
- package/dist/sources/public-illustrative-mathematics-parser.d.ts +5 -0
- package/dist/sources/public-illustrative-mathematics-parser.d.ts.map +1 -1
- package/dist/submission-service.d.ts +1 -1
- package/dist/submission-service.d.ts.map +1 -1
- package/dist/submissions.d.ts +7 -7
- package/dist/submissions.d.ts.map +1 -1
- package/dist/workbook-models.d.ts +8 -8
- package/dist/workbook-models.d.ts.map +1 -1
- package/dist/workbook-photo-ingestion.d.ts.map +1 -1
- package/dist/workbook-photo-models.d.ts +6 -5
- package/dist/workbook-photo-models.d.ts.map +1 -1
- package/dist/workbook-photo-service.d.ts +6 -0
- package/dist/workbook-photo-service.d.ts.map +1 -1
- package/package.json +10 -10
- package/dist/chunks/workbook-photo-service-1wcnf-Xf.js.map +0 -1
package/AGENTS.md
CHANGED
|
@@ -37,3 +37,11 @@ never create learning evidence, and blank exercises need explicit work intent.
|
|
|
37
37
|
Source import: [host boundary and transaction contract](agents/source-import.md).
|
|
38
38
|
`SourceImportService` requires host opt-in, matching active actor/tenant and
|
|
39
39
|
explicit licensing authorization; never add a system/global write bypass.
|
|
40
|
+
|
|
41
|
+
Family-owned unassigned originals and audited learner adoption use
|
|
42
|
+
[FamilyIntakeService](agents/family-intake.md). Keep family source scope immutable;
|
|
43
|
+
assignment alone never creates learning history or grants learner inbox access.
|
|
44
|
+
|
|
45
|
+
Publisher catalog previews use [the preview contract](agents/catalog-previews.md).
|
|
46
|
+
Keep independent image rights and source revisions; serve via `CatalogPreviewService`
|
|
47
|
+
with live actor/tenant authorization, never direct provider image URLs.
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Publisher catalog previews
|
|
2
|
+
|
|
3
|
+
`CatalogSourceRecord.preview` and `CatalogResourceView.preview` are optional
|
|
4
|
+
`CatalogPreview` metadata. They describe a publisher image, not an acquired
|
|
5
|
+
original, cover guarantee, download permission, or learner access grant. The
|
|
6
|
+
public root exports `CatalogPreviewService`, `CatalogPreviewStore`,
|
|
7
|
+
`CatalogPreviewLoader`, `catalogPreviewFor`, and `normalizeCatalogPreview`.
|
|
8
|
+
`CatalogResource.getPreview()` reads the guarded persisted JSON. Deploy the normal
|
|
9
|
+
additive manifest migration for its nullable `preview` column before sync; legacy
|
|
10
|
+
rows have no preview. Sync retains the first retrieval timestamp on identical
|
|
11
|
+
revision retries and rejects changing an existing preview within that revision.
|
|
12
|
+
New revisions replace the current reference; old revision requests become 404.
|
|
13
|
+
PNG verification resolves its Node host capability only when invoked; importing
|
|
14
|
+
catalog metadata/models remains browser-safe. Serving/verification requires a
|
|
15
|
+
Node host and fails closed without it.
|
|
16
|
+
The image hash participates in the IM page record's revision, so changed bytes
|
|
17
|
+
cannot silently reuse a preview revision.
|
|
18
|
+
|
|
19
|
+
The public IM first-edition adapter automatically selects at most one embedded
|
|
20
|
+
instructional diagram on a K–5 family-materials page. It requires that exact
|
|
21
|
+
page's CC BY 4.0 footer and attribution, an official ImageFile figure with an
|
|
22
|
+
empty caption, no separate credits or image-license notice in the instructional
|
|
23
|
+
content, a descriptive chart/diagram alt, and an exact official asset identifier.
|
|
24
|
+
Branding, photographs, credited or ambiguous images, other providers, unsupported
|
|
25
|
+
formats and missing metadata remain absent. This narrow page-scoped policy does
|
|
26
|
+
not grant a provider-wide image license. The source footer explicitly excludes
|
|
27
|
+
the name/logo and preserves third-party image licenses; never remove those
|
|
28
|
+
exclusions or apply this rule to arbitrary images. Existing teacher visibility
|
|
29
|
+
is retained, including family hierarchy records currently classified teacher.
|
|
30
|
+
|
|
31
|
+
Concrete publisher evidence, retrieved 2026-10-28:
|
|
32
|
+
[Grade 1 Unit 1 Family Materials](https://im.kendallhunt.com/k5/families/grade-1/unit-1/family-materials.html)
|
|
33
|
+
embeds ImageFile 38531, “Tally Chart. Turtle, tallies, 6. Dog, tallies, 2.
|
|
34
|
+
Rabbit, tallies, 12.” Its
|
|
35
|
+
[official PNG](https://cms-assets.illustrativemathematics.org/fd1cykl2wl4zyfc6vzfkl3x09pvr)
|
|
36
|
+
is 93,072 bytes, 1350 × 674. The licensed instructional fragment and PNG are
|
|
37
|
+
fixtures in `src/__tests__/fixtures/im-family-*`, attributed to © 2021
|
|
38
|
+
Illustrative Mathematics, CC BY 4.0. The image is unmodified. Captions or separate
|
|
39
|
+
attribution appearing in a future sync make the preview unavailable.
|
|
40
|
+
|
|
41
|
+
Enumeration performs metadata reads and at most one **preview image** GET per
|
|
42
|
+
page; it never GETs original PDFs/ZIPs. It accepts only official HTTPS origin and
|
|
43
|
+
opaque path, refuses redirects, and bounds the complete network/body operation
|
|
44
|
+
by the adapter deadline (20 seconds default, 60 maximum). Required HTML/HEAD
|
|
45
|
+
work completes before optional sync previews, which get an independent deadline
|
|
46
|
+
of one quarter of that budget, capped at two seconds and the remaining total
|
|
47
|
+
enumeration budget. A hung preview cannot pause
|
|
48
|
+
metadata enumeration or its cursor. PNG previews have a
|
|
49
|
+
2 MiB byte cap and 4096-pixel width/height cap. SVG, HTML, JPEG and other formats
|
|
50
|
+
are currently unavailable. Only non-interlaced, static 8-bit RGB/RGBA PNGs are
|
|
51
|
+
verified: complete chunks/CRCs/IEND and bounded inflated scanlines must be valid;
|
|
52
|
+
truncated or corrupt data never becomes a verified preview. This uses existing provider request bounds rather
|
|
53
|
+
than a general URL proxy. A preview failure leaves catalog metadata readable.
|
|
54
|
+
`CatalogReadService.search()` performs no image or content fetches.
|
|
55
|
+
|
|
56
|
+
Wire a host endpoint using only the published root API:
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
import {
|
|
60
|
+
CatalogPreviewService,
|
|
61
|
+
createPublicIllustrativeMathematicsFirstEditionAdapter,
|
|
62
|
+
} from '@happyvertical/smrt-education';
|
|
63
|
+
|
|
64
|
+
const previews = new CatalogPreviewService({
|
|
65
|
+
// Both functions use your trusted active-session/tenant executor. Adapt your
|
|
66
|
+
// persisted resource to CatalogSourceRecord, including row.getPreview().
|
|
67
|
+
getResource: (id, actor) => catalogStore.getReadableResource(id, actor),
|
|
68
|
+
authorize: (actor, resource) => catalogPolicy.canReadNow(actor, resource.id),
|
|
69
|
+
}, createPublicIllustrativeMathematicsFirstEditionAdapter());
|
|
70
|
+
|
|
71
|
+
// Inside GET /catalog/preview; actor is derived from the server session.
|
|
72
|
+
return previews.serve({ actor, resourceId, revision });
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Render your own endpoint URL only when `view.preview` is present, using `alt`,
|
|
76
|
+
width/height and rights attribution. Never place `reference` or `sourceUrl` into
|
|
77
|
+
an image URL. The endpoint re-reads the current resource and checks active
|
|
78
|
+
host authorization, tenant/actor identity, teacher visibility, withdrawal,
|
|
79
|
+
revision and optional rights expiry on **every request**, including cache hits.
|
|
80
|
+
The host must check actor membership/active tenant, not merely trust strings in a
|
|
81
|
+
request. Do not expose an unscoped collection read as this adapter.
|
|
82
|
+
|
|
83
|
+
Rights expiry is checked again after awaited loading/verification and before
|
|
84
|
+
serving or inserting cached bytes. The per-service cache holds at most 16 MiB of verified public image bytes for at
|
|
85
|
+
most 60 seconds; reuse a service instance to benefit from it. Cache lookup occurs
|
|
86
|
+
after authorization. Changed length, dimensions or SHA-256, expiry, missing or
|
|
87
|
+
invalid metadata, upstream failures and access denial yield uniform 404 with
|
|
88
|
+
`Cache-Control: no-store`; successful responses are PNG, `nosniff`, sandboxed,
|
|
89
|
+
and `private, no-store`, so browsers cannot serve a revoked preview from cache.
|
|
90
|
+
No credential, upstream image URL, redirect or raw provider error reaches the
|
|
91
|
+
browser. Synchronize regularly to observe publisher withdrawal/license changes;
|
|
92
|
+
server byte caching never bypasses the durable current-resource decision.
|
|
93
|
+
|
|
94
|
+
Private asset previews and derivatives of acquired originals are unavailable in
|
|
95
|
+
this publisher-only contract. Use the asset authority and the separate acquired
|
|
96
|
+
original derivative capability (#4470), with authorization on every private
|
|
97
|
+
asset read. Possessing an asset, granting full-resource download/print, or being
|
|
98
|
+
able to view a publisher page never supplies preview permission here.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Family intake
|
|
2
|
+
|
|
3
|
+
`FamilyIntakeService` retains guardian-only originals before a learner is known.
|
|
4
|
+
The host supplies a trusted actor/tenant and a current family authorizer; each
|
|
5
|
+
read, original download, assignment and adoption revalidates this authority on
|
|
6
|
+
the service's exact executor. Learners cannot browse the family inbox. Generated
|
|
7
|
+
CRUD, CLI, MCP and AI surfaces remain closed.
|
|
8
|
+
|
|
9
|
+
Retain the whole document with its source identity, delivery key, immutable hash
|
|
10
|
+
and original private assets. Source delivery retries must preserve identical
|
|
11
|
+
content and provenance. Email and scanner adapters are separate host configuration;
|
|
12
|
+
this service does not configure or select them. Trusted candidate DTOs and their
|
|
13
|
+
quoted evidence are advisory. A guardian's active learner preference, visible
|
|
14
|
+
marks, uncertain names or a first-page guess never establish ownership. Mixed
|
|
15
|
+
learner PDFs stay unresolved until an explicit whole-document assignment is safe.
|
|
16
|
+
|
|
17
|
+
Assignment records an immutable guardian decision with a revision and request
|
|
18
|
+
key. It does not create learner work. Adoption freezes that assignment and borrows
|
|
19
|
+
the exact original assets through learner photo ownership joins; it never rewrites
|
|
20
|
+
source confidentiality or creates grades. The existing photo resolution and
|
|
21
|
+
completed-work capture preconditions still apply. Existing derived capture copies
|
|
22
|
+
are permitted. Once adopted, a receipt cannot silently change learners; recovery
|
|
23
|
+
requires a separate explicit policy. An unadopted attribution can be corrected by
|
|
24
|
+
another audited decision with the current revision.
|
|
25
|
+
|
|
26
|
+
Family ownership retains originals beyond generic receipt expiry. Adoption does
|
|
27
|
+
not transfer or delete that ownership. Cleanup and rollback must preserve shared
|
|
28
|
+
retained bytes and compensate only newly created files. Every access checks the
|
|
29
|
+
original hash before adoption or download.
|
|
30
|
+
|
|
31
|
+
Validation uses shared family workflows on real SQLite and isolated PostgreSQL;
|
|
32
|
+
no AI providers, scanner/email services or containers are required.
|
|
33
|
+
|
|
34
|
+
Import `FamilyIntakeService`, `receiveFamilyIntake` and
|
|
35
|
+
`retainFamilyIntakeReceipt` from `@happyvertical/smrt-education/ingestion`.
|
|
36
|
+
The bridge uses the fixed `familyIntakeScopeId(tenantId)` namespace and public
|
|
37
|
+
`getReceiptSource` to retain authoritative delivery identity. This namespace is
|
|
38
|
+
never an authorization grant. The host's `IngestionService.authorize` callback
|
|
39
|
+
must call the same current family authorizer on every operation, including direct
|
|
40
|
+
`getEvidence`, `readEvidence` and `getReceiptSource` calls. For example, await
|
|
41
|
+
`family.authorizeFamilyIntake({ tenantId: scope.tenantId, actorUserId: scope.actorId })`
|
|
42
|
+
then return true; propagate denial. Actor equality or tenant membership alone is
|
|
43
|
+
insufficient. This protects raw envelopes and rejected/unretained originals as
|
|
44
|
+
well as adopted receipts. Adoption permits only normal authorized learner work
|
|
45
|
+
reads; it never grants the learner generic family ingestion access. A receive that
|
|
46
|
+
succeeds before education retention fails is repaired by retrying the same
|
|
47
|
+
receipt, never by inventing another delivery identity.
|
|
48
|
+
|
|
49
|
+
Deploy manifest migrations for all three FamilyIntake models and the nullable
|
|
50
|
+
`WorkbookPhotoIntake.familyIntakeId` FK before use. There is no runtime DDL.
|
|
51
|
+
Adoption commits its immutable audit and exact photo/original joins atomically;
|
|
52
|
+
the family asset remains the sole original owner. Existing derived submission
|
|
53
|
+
copies use normal capture compensation. The exact adoption audit is required
|
|
54
|
+
when validating borrowing joins, reads and immutable family-scope analysis.
|
|
55
|
+
`countFamilyIntakes` counts unadopted receipts across the full inbox, while
|
|
56
|
+
`listFamilyIntakes` pages the complete receipt history.
|
|
57
|
+
|
|
58
|
+
After adoption, use the returned `photoIntakeId` with ordinary photo
|
|
59
|
+
resolution/capture methods. Family-scope photo analysis checks the exact adopted
|
|
60
|
+
item/learner binding; learner-scoped uploads retain their existing strict scope.
|
|
61
|
+
The existing submission/assessment ingestion handlers still revalidate the
|
|
62
|
+
captured learner/attempt. Temporary ingestion expiry does not prevent manual
|
|
63
|
+
resolution/capture from retained education originals; re-analysis of an expired
|
|
64
|
+
receipt needs a separately authorized retained-input orchestration.
|
|
65
|
+
|
|
66
|
+
This initial contract assigns a whole receipt/document. It does not split a
|
|
67
|
+
mixed-child PDF, automatically infer a child or configure a source adapter.
|
|
68
|
+
Future range adoption must preserve original hashes and page provenance; the
|
|
69
|
+
retained immutable originals remain available for such an explicit workflow.
|
|
70
|
+
|
|
71
|
+
Source-tree retention includes image/PDF attachments beneath metadata envelopes.
|
|
72
|
+
A supported-media descendant of another supported original (for example a PDF's
|
|
73
|
+
page thumbnail) stays in the evidence graph but is not duplicated as learner
|
|
74
|
+
work. Photo identification and captured-work analysis preservation use this same
|
|
75
|
+
original-selection convention, so retained attachment hashes remain authoritative
|
|
76
|
+
after adoption and retries. The immutable graph retains only IDs, parent IDs, media types and hashes;
|
|
77
|
+
it does not copy email bodies, arbitrary headers or credentials into public
|
|
78
|
+
source metadata. A source image such as an email logo is not automatically
|
|
79
|
+
classified as completed work. Whole-document attribution/classification remains
|
|
80
|
+
an explicit guardian decision; ambiguous mixed contents need resolution.
|
|
81
|
+
|
|
82
|
+
Custom source adapters must follow this supported convention: metadata parents
|
|
83
|
+
contain independent original attachments; descendants of supported media are
|
|
84
|
+
renditions of that media. Extraction outputs already live separately from source
|
|
85
|
+
evidence. An adapter that uses media-child relationships for independently
|
|
86
|
+
authored attachments is unsupported by this bridge until its role is explicitly
|
|
87
|
+
established; do not claim complete attachment fidelity for that shape or infer
|
|
88
|
+
roles from first-page content. Full immutable evidence lineage is retained even
|
|
89
|
+
when a rendition is excluded from capture pages.
|
|
90
|
+
|
|
91
|
+
The bridge rejects an entire receipt containing an unsupported independent
|
|
92
|
+
original, including a mixed PDF/TIFF bundle, before family retention. Generic
|
|
93
|
+
source originals remain available for recovery; no partial family receipt or
|
|
94
|
+
adoption is created. Hosts must acknowledge successful family import only after
|
|
95
|
+
family retention succeeds and surface failed source imports. Known JSON
|
|
96
|
+
metadata wrappers and media descendants under the supported rendition convention
|
|
97
|
+
are not independent originals.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CatalogPreview } from './catalog-preview.js';
|
|
1
2
|
/** Metadata-only resource visibility. Teacher material is never learner-visible. */
|
|
2
3
|
export type CatalogVisibility = 'catalog' | 'teacher';
|
|
3
4
|
export type CatalogLicenseState = 'verified' | 'unknown' | 'conflicting' | 'restricted';
|
|
@@ -71,6 +72,7 @@ export interface CatalogSourceRecord {
|
|
|
71
72
|
parentStableId?: string;
|
|
72
73
|
availableFormats?: string[];
|
|
73
74
|
representation?: CatalogResourceRepresentation;
|
|
75
|
+
preview?: CatalogPreview;
|
|
74
76
|
licenseEvidence: CatalogLicenseEvidence;
|
|
75
77
|
visibility: CatalogVisibility;
|
|
76
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog-contracts.d.ts","sourceRoot":"","sources":["../src/catalog-contracts.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,SAAS,CAAC;AACtD,MAAM,MAAM,mBAAmB,GAC3B,UAAU,GACV,SAAS,GACT,aAAa,GACb,YAAY,CAAC;AACjB,MAAM,MAAM,gBAAgB,GACxB,MAAM,GACN,UAAU,GACV,OAAO,GACP,OAAO,GACP,cAAc,GACd,gBAAgB,CAAC;AAErB,8EAA8E;AAC9E,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,mBAAmB,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8DAA8D;IAC9D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,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog-database-sync-store.d.ts","sourceRoot":"","sources":["../src/catalog-database-sync-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAM5D,OAAO,KAAK,EACV,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"catalog-database-sync-store.d.ts","sourceRoot":"","sources":["../src/catalog-database-sync-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAM5D,OAAO,KAAK,EACV,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AA2ClE,wEAAwE;AACxE,qBAAa,wBAAyB,YAAW,gBAAgB;IACnD,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,iBAAiB;IAE5C,aAAa,CACjB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC;IAQvC,cAAc,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;IAyB3D,MAAM,CAAC,MAAM,EAAE,mBAAmB,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA2DjE,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAazE"}
|
package/dist/catalog-models.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SmrtObject } from '@happyvertical/smrt-core';
|
|
2
2
|
import type { CatalogLicenseState, CatalogResourceRepresentation, CatalogVisibility } from './catalog-contracts.js';
|
|
3
|
+
import { type CatalogPreview } from './catalog-preview.js';
|
|
3
4
|
/** Globally visible provider registration. Hosts configure adapters and credentials out of band. */
|
|
4
5
|
export declare class CatalogProvider extends SmrtObject {
|
|
5
6
|
providerId: string;
|
|
@@ -23,6 +24,10 @@ export declare class CatalogResource extends SmrtObject {
|
|
|
23
24
|
availableFormats: string;
|
|
24
25
|
/** Serialized observed representation; JSON null is legacy absence. */
|
|
25
26
|
representation: string;
|
|
27
|
+
/** Exact revision-bound publisher preview, not an original or private asset grant. */
|
|
28
|
+
preview: string;
|
|
29
|
+
getPreview(): CatalogPreview | undefined;
|
|
30
|
+
setPreview(value: CatalogPreview | undefined): void;
|
|
26
31
|
getRepresentation(): CatalogResourceRepresentation | undefined;
|
|
27
32
|
setRepresentation(value: CatalogResourceRepresentation | undefined): void;
|
|
28
33
|
licenseEvidence: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog-models.d.ts","sourceRoot":"","sources":["../src/catalog-models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,UAAU,EAAQ,MAAM,0BAA0B,CAAC;AAG/E,OAAO,KAAK,EACV,mBAAmB,EACnB,6BAA6B,EAC7B,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"catalog-models.d.ts","sourceRoot":"","sources":["../src/catalog-models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,UAAU,EAAQ,MAAM,0BAA0B,CAAC;AAG/E,OAAO,KAAK,EACV,mBAAmB,EACnB,6BAA6B,EAC7B,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,sBAAsB,CAAC;AAI9B,oGAAoG;AACpG,qBACa,eAAgB,SAAQ,UAAU;IAClB,UAAU,SAAM;IAChB,IAAI,SAAM;IACrC,MAAM,UAAQ;CACf;A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,MAAM,SAAM;IACvC,WAAW,SAAM;IACjB,OAAO,SAAM;CACd"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { CatalogActor, CatalogSourceRecord } from './catalog-contracts.js';
|
|
2
|
+
/** Publisher preview permission is independent of original-resource permissions. */
|
|
3
|
+
export interface CatalogPreview {
|
|
4
|
+
providerId: 'illustrative-mathematics';
|
|
5
|
+
stableId: string;
|
|
6
|
+
revision: string;
|
|
7
|
+
/** Official publisher ImageFile identifier, never a caller-supplied URL. */
|
|
8
|
+
reference: string;
|
|
9
|
+
mediaType: 'image/png';
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
byteLength: number;
|
|
13
|
+
sha256: string;
|
|
14
|
+
alt: string;
|
|
15
|
+
rights: {
|
|
16
|
+
state: 'verified';
|
|
17
|
+
identifier: 'CC-BY-4.0';
|
|
18
|
+
sourceUrl: string;
|
|
19
|
+
attribution: string;
|
|
20
|
+
retrievedAt: string;
|
|
21
|
+
expiresAt?: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export declare const CATALOG_PREVIEW_MAX_BYTES: number;
|
|
25
|
+
export declare const CATALOG_PREVIEW_MAX_DIMENSION = 4096;
|
|
26
|
+
/** Parse persisted/untrusted optional metadata. Invalid metadata is unavailable. */
|
|
27
|
+
export declare function normalizeCatalogPreview(value: unknown): CatalogPreview | undefined;
|
|
28
|
+
/** Exact source/revision binding; expired or corrupt references are unavailable. */
|
|
29
|
+
export declare function catalogPreviewFor(record: Pick<CatalogSourceRecord, 'providerId' | 'stableId' | 'revision' | 'preview'>, now?: number): CatalogPreview | undefined;
|
|
30
|
+
/** Verify complete bounded static 8-bit RGB/RGBA PNG data; never transform originals. */
|
|
31
|
+
export declare function catalogPreviewPngDimensions(bytes: Uint8Array): {
|
|
32
|
+
width: number;
|
|
33
|
+
height: number;
|
|
34
|
+
};
|
|
35
|
+
export interface CatalogPreviewStore {
|
|
36
|
+
/** Must read through the active actor/tenant-bound executor, never a global write bypass. */
|
|
37
|
+
getResource(id: string, actor: CatalogActor): Promise<(CatalogSourceRecord & {
|
|
38
|
+
id: string;
|
|
39
|
+
withdrawnAt?: string | null;
|
|
40
|
+
}) | undefined>;
|
|
41
|
+
/** Recheck live session, tenant membership and resource access on EVERY read, including cache hits. */
|
|
42
|
+
authorize(actor: CatalogActor, resource: CatalogSourceRecord & {
|
|
43
|
+
id: string;
|
|
44
|
+
}): Promise<boolean>;
|
|
45
|
+
}
|
|
46
|
+
export interface CatalogPreviewLoader {
|
|
47
|
+
/** Preview-only bytes, bounded by CATALOG_PREVIEW_MAX_BYTES; never acquire the original. */
|
|
48
|
+
loadPreview(preview: CatalogPreview): Promise<Uint8Array>;
|
|
49
|
+
}
|
|
50
|
+
/** Authorized serving of public publisher previews with a bounded, short-lived verified-byte cache. */
|
|
51
|
+
export declare class CatalogPreviewService {
|
|
52
|
+
private readonly store;
|
|
53
|
+
private readonly loader;
|
|
54
|
+
private readonly cache;
|
|
55
|
+
private cacheBytes;
|
|
56
|
+
constructor(store: CatalogPreviewStore, loader: CatalogPreviewLoader);
|
|
57
|
+
serve(input: {
|
|
58
|
+
actor: CatalogActor;
|
|
59
|
+
resourceId: string;
|
|
60
|
+
revision: string;
|
|
61
|
+
}): Promise<Response>;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=catalog-preview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog-preview.d.ts","sourceRoot":"","sources":["../src/catalog-preview.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAGhF,oFAAoF;AACpF,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,0BAA0B,CAAC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE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,GAC7C,OAAO,CAAC,OAAO,CAAC,CAAC;CACrB;AACD,MAAM,WAAW,oBAAoB;IACnC,4FAA4F;IAC5F,WAAW,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CAC3D;AAED,uGAAuG;AACvG,qBAAa,qBAAqB;IAO9B,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAPzB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAGlB;IACJ,OAAO,CAAC,UAAU,CAAK;gBAEJ,KAAK,EAAE,mBAAmB,EAC1B,MAAM,EAAE,oBAAoB;IAGzC,KAAK,CAAC,KAAK,EAAE;QACjB,KAAK,EAAE,YAAY,CAAC;QACpB,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;KAClB,GAAG,OAAO,CAAC,QAAQ,CAAC;CA8FtB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CatalogActor, CatalogLicenseEvidence, CatalogResourceRepresentation, CatalogSourceRecord } from './catalog-contracts.js';
|
|
2
2
|
import { CatalogPolicy } from './catalog-policy.js';
|
|
3
|
+
import { type CatalogPreview } from './catalog-preview.js';
|
|
3
4
|
export interface CatalogReadStore {
|
|
4
5
|
search(input: {
|
|
5
6
|
query?: string;
|
|
@@ -7,6 +8,7 @@ export interface CatalogReadStore {
|
|
|
7
8
|
grade?: string;
|
|
8
9
|
}): Promise<readonly (CatalogSourceRecord & {
|
|
9
10
|
id: string;
|
|
11
|
+
withdrawnAt?: string | null;
|
|
10
12
|
})[]>;
|
|
11
13
|
}
|
|
12
14
|
/** Deliberately metadata-only DTO: credentials, byte locations, and teacher records stay server-side. */
|
|
@@ -29,6 +31,7 @@ export interface CatalogResourceView {
|
|
|
29
31
|
parentStableId?: string;
|
|
30
32
|
availableFormats?: string[];
|
|
31
33
|
representation?: CatalogResourceRepresentation;
|
|
34
|
+
preview?: CatalogPreview;
|
|
32
35
|
license: Pick<CatalogLicenseEvidence, 'state' | 'identifier' | 'version' | 'attribution' | 'exceptions' | 'retrievedAt'>;
|
|
33
36
|
}
|
|
34
37
|
export declare class CatalogReadService {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog-read-service.d.ts","sourceRoot":"","sources":["../src/catalog-read-service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,YAAY,EACZ,sBAAsB,EACtB,6BAA6B,EAC7B,mBAAmB,EACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"catalog-read-service.d.ts","sourceRoot":"","sources":["../src/catalog-read-service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,YAAY,EACZ,sBAAsB,EACtB,6BAA6B,EAC7B,mBAAmB,EACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,KAAK,cAAc,EAAqB,MAAM,sBAAsB,CAAC;AAE9E,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,KAAK,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAC1E,SAAS,CAAC,mBAAmB,GAAG;QAC9B,EAAE,EAAE,MAAM,CAAC;QACX,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAC7B,CAAC,EAAE,CACL,CAAC;CACH;AAED,yGAAyG;AACzG,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,cAAc,CAAC,EAAE,6BAA6B,CAAC;IAC/C,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,IAAI,CACX,sBAAsB,EACpB,OAAO,GACP,YAAY,GACZ,SAAS,GACT,aAAa,GACb,YAAY,GACZ,aAAa,CAChB,CAAC;CACH;AAED,qBAAa,kBAAkB;IAE3B,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADN,KAAK,EAAE,gBAAgB,EACvB,MAAM,gBAAsB;IAGzC,MAAM,CACV,KAAK,EAAE,YAAY,EACnB,MAAM,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAO,GAChE,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAWjC,OAAO,CAAC,IAAI;CAmDb"}
|
package/dist/catalog.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SmrtObject } from '@happyvertical/smrt-core';
|
|
1
|
+
import { SmrtObject, type SmrtSaveOptions } from '@happyvertical/smrt-core';
|
|
2
2
|
export type CourseLicenseKind = 'own-work' | 'open-license' | 'personal-use-copy' | 'licensed-for-sharing';
|
|
3
3
|
export type CourseModality = 'online' | 'printable' | 'kit' | 'video' | 'game' | 'mixed';
|
|
4
4
|
export type CourseStatus = 'draft' | 'published' | 'archived';
|
|
@@ -25,7 +25,7 @@ export declare class Course extends SmrtObject {
|
|
|
25
25
|
status: CourseStatus;
|
|
26
26
|
constructor(options?: Record<string, unknown>);
|
|
27
27
|
/** A personal copy remains pinned to its original family and license. */
|
|
28
|
-
save(): Promise<this>;
|
|
28
|
+
save(options?: SmrtSaveOptions): Promise<this>;
|
|
29
29
|
}
|
|
30
30
|
export declare class ExternalCourse extends Course {
|
|
31
31
|
}
|
|
@@ -37,7 +37,7 @@ export declare class CourseSection extends SmrtObject {
|
|
|
37
37
|
title: string;
|
|
38
38
|
sortOrder: number;
|
|
39
39
|
constructor(options?: Record<string, unknown>);
|
|
40
|
-
save(): Promise<this>;
|
|
40
|
+
save(options?: SmrtSaveOptions): Promise<this>;
|
|
41
41
|
}
|
|
42
42
|
export declare class Lesson extends SmrtObject {
|
|
43
43
|
tenantId: string | null;
|
|
@@ -52,7 +52,7 @@ export declare class Lesson extends SmrtObject {
|
|
|
52
52
|
externalRef: string;
|
|
53
53
|
externalUrl: string;
|
|
54
54
|
constructor(options?: Record<string, unknown>);
|
|
55
|
-
save(): Promise<this>;
|
|
55
|
+
save(options?: SmrtSaveOptions): Promise<this>;
|
|
56
56
|
}
|
|
57
57
|
export declare class Reading extends Lesson {
|
|
58
58
|
}
|
package/dist/catalog.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,UAAU,
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,UAAU,EACV,KAAK,eAAe,EAErB,MAAM,0BAA0B,CAAC;AAGlC,MAAM,MAAM,iBAAiB,GACzB,UAAU,GACV,cAAc,GACd,mBAAmB,GACnB,sBAAsB,CAAC;AAC3B,MA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