@lde/pipeline 0.43.0 → 0.44.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/distribution/importResolver.js +4 -4
- package/dist/distribution/resolver.d.ts +2 -2
- package/dist/distribution/resolver.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/pipeline.d.ts +6 -9
- package/dist/pipeline.d.ts.map +1 -1
- package/dist/pipeline.js +168 -71
- package/dist/pipelineEvent.d.ts +231 -0
- package/dist/pipelineEvent.d.ts.map +1 -0
- package/dist/pipelineEvent.js +35 -0
- package/dist/reporter.d.ts +14 -0
- package/dist/reporter.d.ts.map +1 -0
- package/dist/sparql/reader.d.ts +16 -7
- package/dist/sparql/reader.d.ts.map +1 -1
- package/dist/sparql/reader.js +16 -5
- package/dist/stage.d.ts +2 -2
- package/dist/stage.d.ts.map +1 -1
- package/dist/stage.js +2 -2
- package/dist/unreadValueTally.d.ts +2 -2
- package/dist/unreadValueTally.d.ts.map +1 -1
- package/dist/unreadValueTally.js +1 -1
- package/dist/writer/writer.d.ts +1 -1
- package/dist/writer/writer.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/combineReporters.d.ts +0 -16
- package/dist/combineReporters.d.ts.map +0 -1
- package/dist/combineReporters.js +0 -57
- package/dist/progressReporter.d.ts +0 -157
- package/dist/progressReporter.d.ts.map +0 -1
- /package/dist/{progressReporter.js → reporter.js} +0 -0
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import type { Dataset, Distribution } from '@lde/dataset';
|
|
2
|
-
import type { ValidityVerdict } from '@lde/distribution-health';
|
|
3
|
-
import type { ValidationReport } from './validator.js';
|
|
4
|
-
import type { ImportDetails } from './distribution/resolver.js';
|
|
5
|
-
import type { TimeoutTransitionEvent } from './sparql/timeoutPolicy.js';
|
|
6
|
-
export interface DistributionAnalysisResult {
|
|
7
|
-
distribution: Distribution;
|
|
8
|
-
type: 'sparql' | 'data-dump' | 'network-error';
|
|
9
|
-
available: boolean;
|
|
10
|
-
statusCode?: number;
|
|
11
|
-
error?: string;
|
|
12
|
-
warnings: string[];
|
|
13
|
-
/**
|
|
14
|
-
* The source-change fingerprint observed for this distribution, or `null`
|
|
15
|
-
* when none could be established (e.g. a live SPARQL endpoint). The shared
|
|
16
|
-
* key against which a validity verdict's `validatedFingerprint` is matched,
|
|
17
|
-
* so a consumer can record it on the reachability rail. Always populated by
|
|
18
|
-
* the pipeline; optional so consumers constructing the result need not set it.
|
|
19
|
-
*/
|
|
20
|
-
fingerprint?: string | null;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Items a writer left out of a dataset’s output instead of failing the
|
|
24
|
-
* dataset – documents a destination refused, say – reported once per
|
|
25
|
-
* (dataset, target) as the writer finalizes the dataset.
|
|
26
|
-
*/
|
|
27
|
-
export interface ItemsRejected {
|
|
28
|
-
/** The part of the destination that refused them, e.g. a search index’s
|
|
29
|
-
* type name. */
|
|
30
|
-
readonly target: string;
|
|
31
|
-
/** Items the dataset wrote to {@link target}, the rejected ones included. */
|
|
32
|
-
readonly written: number;
|
|
33
|
-
/** Items left out. */
|
|
34
|
-
readonly rejected: number;
|
|
35
|
-
/** Why, most frequent first: each distinct reason, how many items it
|
|
36
|
-
* rejected, and the ids of a few of them. Bounded by the writer, so a
|
|
37
|
-
* reason that varies per item cannot grow it without limit. */
|
|
38
|
-
readonly reasons: readonly RejectionReason[];
|
|
39
|
-
}
|
|
40
|
-
/** One reason a writer rejected items, in {@link ItemsRejected.reasons}. */
|
|
41
|
-
export interface RejectionReason {
|
|
42
|
-
readonly reason: string;
|
|
43
|
-
readonly count: number;
|
|
44
|
-
/** Ids of some of the items rejected for this reason. */
|
|
45
|
-
readonly examples: readonly string[];
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Values a stage read from a dataset but could not interpret – an integer
|
|
49
|
-
* field over `onbekend`, a date over `Z.j` – and so left out of the items it
|
|
50
|
-
* produced, reported once per (dataset, target, field) when the dataset
|
|
51
|
-
* completes. The item itself is still produced; only the value is missing.
|
|
52
|
-
*/
|
|
53
|
-
export interface ValuesUnread {
|
|
54
|
-
/** The kind of item the values were read for, e.g. a search type’s name. */
|
|
55
|
-
readonly target: string;
|
|
56
|
-
/** The field that could not read them; dotted for a nested field. */
|
|
57
|
-
readonly field: string;
|
|
58
|
-
/** How many values the field left out. */
|
|
59
|
-
readonly unread: number;
|
|
60
|
-
/** A few of them, each a distinct value. Bounded, so a field that rejects
|
|
61
|
-
* every value cannot grow the report with the data. */
|
|
62
|
-
readonly examples: readonly UnreadValue[];
|
|
63
|
-
}
|
|
64
|
-
/** One value a stage could not read, in {@link ValuesUnread.examples}. */
|
|
65
|
-
export interface UnreadValue {
|
|
66
|
-
/** What the value was read from, as the stage names it – for a search
|
|
67
|
-
* document, the node it was projected from, which a publisher can look up
|
|
68
|
-
* even where the document is keyed on something else. */
|
|
69
|
-
readonly id: string;
|
|
70
|
-
/** The value as the source stated it. */
|
|
71
|
-
readonly value: string;
|
|
72
|
-
}
|
|
73
|
-
export interface ProgressReporter {
|
|
74
|
-
pipelineStart?(name: string): void;
|
|
75
|
-
datasetsSelected?(count: number, duration: number): void;
|
|
76
|
-
/**
|
|
77
|
-
* Called when the run is abandoned because the selection was empty – no
|
|
78
|
-
* commit, destination unchanged. Distinct from a completed run that indexed
|
|
79
|
-
* nothing: the writers were told to abort, so nothing was swept or swapped.
|
|
80
|
-
*/
|
|
81
|
-
selectionEmpty?(reason: string): void;
|
|
82
|
-
datasetStart?(dataset: Dataset): void;
|
|
83
|
-
/** Called each time a single distribution probe completes. */
|
|
84
|
-
distributionProbed?(result: DistributionAnalysisResult): void;
|
|
85
|
-
/** Called when a data-dump import begins. */
|
|
86
|
-
importStarted?(): void;
|
|
87
|
-
/** Called when importing a distribution fails. */
|
|
88
|
-
importFailed?(distribution: Distribution, error: string): void;
|
|
89
|
-
/**
|
|
90
|
-
* Called with the RDF-validity verdict for a distribution the pipeline
|
|
91
|
-
* attempted, whether valid or invalid, and even when the dataset is
|
|
92
|
-
* otherwise skipped (no summary produced). The verdict is a plain
|
|
93
|
-
* TypeScript value; consumers decide how (and whether) to record it as RDF.
|
|
94
|
-
*/
|
|
95
|
-
distributionValidated?(distribution: Distribution, verdict: ValidityVerdict): void;
|
|
96
|
-
/** Called when a dataset’s source is resolved; `imported` is set when the
|
|
97
|
-
* source serves an imported data dump. */
|
|
98
|
-
distributionSelected?(dataset: Dataset, distribution: Distribution, imported?: ImportDetails): void;
|
|
99
|
-
stageStart?(stage: string): void;
|
|
100
|
-
stageProgress?(update: {
|
|
101
|
-
itemsProcessed: number;
|
|
102
|
-
quadsGenerated: number;
|
|
103
|
-
memoryUsageBytes: number;
|
|
104
|
-
heapUsedBytes: number;
|
|
105
|
-
}): void;
|
|
106
|
-
stageComplete?(stage: string, result: {
|
|
107
|
-
itemsProcessed: number;
|
|
108
|
-
quadsGenerated: number;
|
|
109
|
-
duration: number;
|
|
110
|
-
}): void;
|
|
111
|
-
stageFailed?(stage: string, error: Error): void;
|
|
112
|
-
stageSkipped?(stage: string, reason: string): void;
|
|
113
|
-
/**
|
|
114
|
-
* Called once per (dataset, validator) pair after all stages for a dataset
|
|
115
|
-
* have run. Fires regardless of whether any stage actually invoked
|
|
116
|
-
* `validate()` – the report reflects the validator’s accumulated state.
|
|
117
|
-
* When no stage produced data, the report typically carries
|
|
118
|
-
* `quadsValidated: 0` and `conforms: true` (the SHACL vacuous-truth
|
|
119
|
-
* default); consumers that want to distinguish ‘not tested’ from ‘tested
|
|
120
|
-
* and passed’ can read `quadsValidated`.
|
|
121
|
-
*/
|
|
122
|
-
datasetValidated?(dataset: Dataset, report: ValidationReport): void;
|
|
123
|
-
datasetComplete?(dataset: Dataset, result: {
|
|
124
|
-
memoryUsageBytes: number;
|
|
125
|
-
heapUsedBytes: number;
|
|
126
|
-
}): void;
|
|
127
|
-
datasetSkipped?(dataset: Dataset, reason: string): void;
|
|
128
|
-
/**
|
|
129
|
-
* Called when a writer leaves some of a dataset’s items out rather than
|
|
130
|
-
* failing the dataset ({@link RunContext.itemsRejected}).
|
|
131
|
-
*/
|
|
132
|
-
itemsRejected?(dataset: Dataset, rejection: ItemsRejected): void;
|
|
133
|
-
/**
|
|
134
|
-
* Called once per (target, field) that left values out of a dataset’s items
|
|
135
|
-
* ({@link BatchContext.valueUnread}), just before {@link datasetComplete}.
|
|
136
|
-
* Not called for a dataset whose stages or write failed: nothing of it is
|
|
137
|
-
* kept, so neither is what it could not read.
|
|
138
|
-
*/
|
|
139
|
-
valuesUnread?(dataset: Dataset, unread: ValuesUnread): void;
|
|
140
|
-
pipelineComplete?(result: {
|
|
141
|
-
duration: number;
|
|
142
|
-
memoryUsageBytes: number;
|
|
143
|
-
heapUsedBytes: number;
|
|
144
|
-
}): void;
|
|
145
|
-
/**
|
|
146
|
-
* Called when a {@link TimeoutPolicy} tightens the budget for an
|
|
147
|
-
* endpoint after a run of consecutive timeouts. Lets operators
|
|
148
|
-
* distinguish a fast-failed stage from an unexpected speedup.
|
|
149
|
-
*/
|
|
150
|
-
timeoutTightened?(event: TimeoutTransitionEvent): void;
|
|
151
|
-
/**
|
|
152
|
-
* Called when a {@link TimeoutPolicy} relaxes the budget back to the
|
|
153
|
-
* default after a successful request on a previously-tightened endpoint.
|
|
154
|
-
*/
|
|
155
|
-
timeoutRelaxed?(event: TimeoutTransitionEvent): void;
|
|
156
|
-
}
|
|
157
|
-
//# sourceMappingURL=progressReporter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"progressReporter.d.ts","sourceRoot":"","sources":["../src/progressReporter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gB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