@ndes/iiif-images 0.1.2 → 0.2.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/README.md +12 -9
- package/dist/lib/iiif-images.d.ts +6 -6
- package/dist/lib/iiif-images.js +2 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -48,11 +48,11 @@ const pipeline = await createSearchIndexer(config, {
|
|
|
48
48
|
`representativeImage` and `associatedMedia`, so a deployment on an older schema loses
|
|
49
49
|
the enrichment rather than the run.
|
|
50
50
|
|
|
51
|
-
| Option | Default | Purpose
|
|
52
|
-
| --------------- | --------------- |
|
|
53
|
-
| `storePath` | required | SQLite file holding resolved facts between runs
|
|
54
|
-
| `
|
|
55
|
-
| `report` | console warning | Called for each reference whose fetch failed
|
|
51
|
+
| Option | Default | Purpose |
|
|
52
|
+
| --------------- | --------------- | ---------------------------------------------------------- |
|
|
53
|
+
| `storePath` | required | SQLite file holding resolved facts between runs |
|
|
54
|
+
| `fetchWindowMs` | no limit | How long after construction a fetch may still start, in ms |
|
|
55
|
+
| `report` | console warning | Called for each reference whose fetch failed |
|
|
56
56
|
|
|
57
57
|
`storePath` has to be on a durable volume. The store is the only place these facts
|
|
58
58
|
live between runs, and with an empty one every image is fetched from the publisher
|
|
@@ -116,12 +116,15 @@ again.
|
|
|
116
116
|
manifest too broken to read. A 200 that is no IIIF document at all, such as an error
|
|
117
117
|
page served as JSON, counts as a failure, so it is retried every run and five in a
|
|
118
118
|
row stop that dataset’s manifests for the run.
|
|
119
|
-
- **
|
|
120
|
-
|
|
119
|
+
- **Window:** without `fetchWindowMs`, a cold store is fetched in one run, as fast
|
|
120
|
+
as each publisher keeps up. With it, a fetch that has not started once the window
|
|
121
|
+
has passed waits for a later run; one already under way finishes. The window covers
|
|
122
|
+
all datasets together, and what it defers is not reported: those works are indexed
|
|
123
|
+
without an image until a later run.
|
|
121
124
|
- **Later runs:** retries, deferred works and refreshes all need the dataset to be
|
|
122
125
|
reprocessed. With `PROVENANCE_FILE`, an unchanged dataset waits until it changes
|
|
123
|
-
or `PIPELINE_VERSION` is bumped, so
|
|
124
|
-
one run.
|
|
126
|
+
or `PIPELINE_VERSION` is bumped, so leave `fetchWindowMs` long enough to cover it
|
|
127
|
+
in one run.
|
|
125
128
|
- **Limits:** manifest requests are grouped per dataset, because manifest URLs often
|
|
126
129
|
sit on a redirector such as `n2t.net`, and `info.json` requests per host. Datasets
|
|
127
130
|
on one server are limited separately, with only the overall limit across them.
|
|
@@ -8,15 +8,15 @@ export interface IiifImagesOptions {
|
|
|
8
8
|
*/
|
|
9
9
|
readonly storePath: string;
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
* all datasets, so construct one per run.
|
|
11
|
+
* How long after this object’s construction it may still start fetching, in
|
|
12
|
+
* milliseconds, across all datasets, so construct one per run. Unset, there is
|
|
13
|
+
* no limit: everything is fetched as fast as the publishers allow.
|
|
13
14
|
*
|
|
14
|
-
* What the
|
|
15
|
+
* What the window defers is counted, as `manifests deferred` or
|
|
15
16
|
* `image services deferred`, but not reported, and those works are indexed
|
|
16
|
-
* without an image
|
|
17
|
-
* unchanged datasets are skipped, set this high enough to cover them in one run.
|
|
17
|
+
* without an image until a later run fetches it.
|
|
18
18
|
*/
|
|
19
|
-
readonly
|
|
19
|
+
readonly fetchWindowMs?: number;
|
|
20
20
|
/** Told about each reference that failed. Defaults to a console warning. */
|
|
21
21
|
readonly report?: (failure: ResolutionFailure) => void;
|
|
22
22
|
}
|
package/dist/lib/iiif-images.js
CHANGED
|
@@ -15,9 +15,9 @@ import { iiifImage, iiifImageService, iiifImageSize, representativeImageField, }
|
|
|
15
15
|
* in `associatedMedia`, and a failed resolution is retried on a later run.
|
|
16
16
|
*/
|
|
17
17
|
export function iiifImages(schema, options) {
|
|
18
|
-
const limits = options.
|
|
18
|
+
const limits = options.fetchWindowMs === undefined
|
|
19
19
|
? {}
|
|
20
|
-
: {
|
|
20
|
+
: { fetchWindowMs: options.fetchWindowMs };
|
|
21
21
|
const report = options.report ??
|
|
22
22
|
((failure) => console.warn(`${failure.key}: ${failure.reason}`));
|
|
23
23
|
const manifests = createResolver({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndes/iiif-images",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Enriches SCHEMA-AP-NDE works with the dimensions and sizes of their representative IIIF image, as a quad transform for the search indexer.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "git+https://github.com/netwerk-digitaal-erfgoed/stack.git",
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@lde/iiif-image": "^0.2.0",
|
|
35
35
|
"@lde/public-fetch": "^0.1.0",
|
|
36
|
-
"@lde/resolver": "^0.
|
|
36
|
+
"@lde/resolver": "^0.7.0",
|
|
37
37
|
"@rdfjs/types": "^2.0.1",
|
|
38
38
|
"rdf-data-factory": "^2.1.0",
|
|
39
39
|
"tslib": "^2.3.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@lde/pipeline": "^0.
|
|
42
|
+
"@lde/pipeline": "^0.42.0",
|
|
43
43
|
"@lde/search": "^0.36.3"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|