@apify/actor-utils 0.1.3-beta.0 → 0.1.3-beta.1
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 +51 -10
- package/dist/src/safePushData.d.ts +16 -6
- package/dist/src/safePushData.d.ts.map +1 -1
- package/dist/src/safePushData.js +223 -60
- package/dist/src/safePushData.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,13 +17,20 @@ await Actor.init();
|
|
|
17
17
|
const result = await safePushData((batch) => Actor.pushData(batch), items);
|
|
18
18
|
|
|
19
19
|
console.log(result);
|
|
20
|
-
// {
|
|
20
|
+
// { pushedCount: 2, droppedItems: [...], attemptCount: 2, pushResult: undefined }
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
Accepts a single item or an array. `pushFn` is the first positional arg
|
|
24
24
|
and is required — the library itself never imports the Apify SDK, and a
|
|
25
25
|
CI check forbids `.pushData(` from appearing anywhere in the source.
|
|
26
26
|
|
|
27
|
+
Whatever `pushFn` resolves to comes back as `pushResult`, so a push
|
|
28
|
+
function with a meaningful return value stays usable:
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
const { pushResult } = await safePushData((batch) => client.dataset(id).pushItems(batch), items);
|
|
32
|
+
```
|
|
33
|
+
|
|
27
34
|
## Performance notes
|
|
28
35
|
|
|
29
36
|
The happy path is a single `try/await pushFn(items)` with **no extra
|
|
@@ -38,11 +45,12 @@ every AJV error per item:
|
|
|
38
45
|
|
|
39
46
|
| Error | Action |
|
|
40
47
|
| ------------------------------------ | ---------------------------------------------------------------------------------- |
|
|
41
|
-
| `required` at
|
|
42
|
-
| `additionalProperties`
|
|
48
|
+
| `required` (at any depth) | Set the missing field to `null` and mark the path as a placeholder. |
|
|
49
|
+
| `additionalProperties` (any depth) | Delete the unknown property. |
|
|
43
50
|
| `type` / `format` / etc. at the root | Item itself is the wrong shape → dropped. |
|
|
44
51
|
| Constraint on a **placeholder** path | Replace with a type-aware default (see below). If no default is known → dropped. |
|
|
45
52
|
| Constraint on **user-supplied** data | Delete the field. If the schema later marks it required, a placeholder takes over. |
|
|
53
|
+
| Nothing on the item was actionable | Item is dropped — an unchanged item would fail identically on the next push. |
|
|
46
54
|
|
|
47
55
|
### Placeholder defaults
|
|
48
56
|
|
|
@@ -73,19 +81,52 @@ The retry loop chases one layer of errors per round
|
|
|
73
81
|
(`required` → `type` → push) until either the push succeeds
|
|
74
82
|
or `maxAttempts` (default 5) is hit.
|
|
75
83
|
|
|
84
|
+
### When the attempt cap is hit
|
|
85
|
+
|
|
86
|
+
Items still failing on the last allowed attempt are dropped — but the rest
|
|
87
|
+
of the batch is **not** lost with them. Because a rejected push stores
|
|
88
|
+
nothing at all, the wrapper drops the incurable items and then makes one
|
|
89
|
+
final push with the survivors, which the API already validated in the
|
|
90
|
+
previous round. That final push is counted in `attemptCount`, so a run that
|
|
91
|
+
exhausts `maxAttempts: 5` can report `attemptCount: 6`.
|
|
92
|
+
|
|
93
|
+
## Logging
|
|
94
|
+
|
|
95
|
+
Every failed round logs which fields went wrong, so you can fix the schema
|
|
96
|
+
(or the scraper) without digging through the returned `droppedItems`:
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
safePushData: schema validation failed on attempt 1: 12 invalid item(s); repaired fields: /age (type), /name (required), /tags/[] (type); dropped 2 item(s) on unfixable fields: /email (format); retrying with 10 item(s).
|
|
100
|
+
safePushData: gave up after 5 attempts; dropped 3 item(s) still failing on fields: /sku (pattern); pushing the 9 valid item(s) left.
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
The field list is a **set**, not a per-item breakdown — one bad field
|
|
104
|
+
usually shows up on many items in a batch, and knowing which item had which
|
|
105
|
+
problem rarely changes what you do about it. Array indices collapse
|
|
106
|
+
(`/tags/0`, `/tags/7` → `/tags/[]`) for the same reason, and the list is
|
|
107
|
+
capped at 20 entries with the rest reported as `(+N more)`.
|
|
108
|
+
|
|
76
109
|
## Options
|
|
77
110
|
|
|
78
|
-
| Option | Type | Default | Notes
|
|
79
|
-
| ------------- | -------- | ------- |
|
|
80
|
-
| `maxAttempts` | `number` | `5` |
|
|
111
|
+
| Option | Type | Default | Notes |
|
|
112
|
+
| ------------- | -------- | ------- | -------------------------------------------------------------- |
|
|
113
|
+
| `maxAttempts` | `number` | `5` | Cap on repair rounds, plus the final salvage push if it's hit. |
|
|
81
114
|
|
|
82
115
|
## Return shape
|
|
83
116
|
|
|
117
|
+
Names say what they hold: `*Count` is a number, `*Items` is an array of
|
|
118
|
+
objects.
|
|
119
|
+
|
|
84
120
|
```ts
|
|
85
|
-
interface SafePushDataResult<T> {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
121
|
+
interface SafePushDataResult<T, R = unknown> {
|
|
122
|
+
/** How many of the caller's items made it into the dataset. */
|
|
123
|
+
pushedCount: number;
|
|
124
|
+
/** The items we couldn't repair, each with the errors that doomed it. */
|
|
125
|
+
droppedItems: { item: T; errors: ValidationError[] }[];
|
|
126
|
+
/** How many times `pushFn` was actually called. */
|
|
127
|
+
attemptCount: number;
|
|
128
|
+
/** What the successful `pushFn` call resolved to; absent if none did. */
|
|
129
|
+
pushResult?: R;
|
|
89
130
|
}
|
|
90
131
|
```
|
|
91
132
|
|
|
@@ -23,15 +23,23 @@ export interface DroppedItem<T> {
|
|
|
23
23
|
item: T;
|
|
24
24
|
errors: ValidationError[];
|
|
25
25
|
}
|
|
26
|
-
export interface SafePushDataResult<T> {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
export interface SafePushDataResult<T, R = unknown> {
|
|
27
|
+
/** How many of the caller's items made it into the dataset. */
|
|
28
|
+
pushedCount: number;
|
|
29
|
+
/** The items we couldn't repair, each with the errors that doomed it. */
|
|
30
|
+
droppedItems: DroppedItem<T>[];
|
|
31
|
+
/** How many times `pushFn` was actually called. */
|
|
32
|
+
attemptCount: number;
|
|
33
|
+
/**
|
|
34
|
+
* What the successful `pushFn` call resolved to (e.g. the API response).
|
|
35
|
+
* Absent when no push ever succeeded — i.e. when every item was dropped.
|
|
36
|
+
*/
|
|
37
|
+
pushResult?: R;
|
|
30
38
|
}
|
|
31
39
|
export interface SafePushDataOptions {
|
|
32
40
|
maxAttempts?: number;
|
|
33
41
|
}
|
|
34
|
-
export type PushFn<T> = (items: T[]) => Promise<
|
|
42
|
+
export type PushFn<T, R = unknown> = (items: T[]) => Promise<R>;
|
|
35
43
|
/**
|
|
36
44
|
* Push `input` via `pushFn`, surviving Apify dataset schema-validation
|
|
37
45
|
* failures by cleaning offending items and retrying.
|
|
@@ -40,7 +48,9 @@ export type PushFn<T> = (items: T[]) => Promise<unknown>;
|
|
|
40
48
|
* direct `.pushData()` calls in this library, so the binding lives at the
|
|
41
49
|
* call site: `(b) => Actor.pushData(b)` or
|
|
42
50
|
* `(b) => client.dataset(id).pushItems(b)`.
|
|
51
|
+
*
|
|
52
|
+
* Whatever `pushFn` resolves to is handed back untouched as `pushResult`.
|
|
43
53
|
*/
|
|
44
|
-
export declare function safePushData<T>(pushFn: PushFn<T>, input: T | T[], options?: SafePushDataOptions): Promise<SafePushDataResult<T>>;
|
|
54
|
+
export declare function safePushData<T, R = unknown>(pushFn: PushFn<T, R>, input: T | T[], options?: SafePushDataOptions): Promise<SafePushDataResult<T, R>>;
|
|
45
55
|
export {};
|
|
46
56
|
//# sourceMappingURL=safePushData.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safePushData.d.ts","sourceRoot":"","sources":["../../src/safePushData.ts"],"names":[],"mappings":"AAWA,QAAA,MAAM,iBAAiB,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"safePushData.d.ts","sourceRoot":"","sources":["../../src/safePushData.ts"],"names":[],"mappings":"AAWA,QAAA,MAAM,iBAAiB,4BAA4B,CAAC;AAcpD,MAAM,WAAW,eAAe;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,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C,GAAG,CAAC,EAAE,EACd,OAAO,GAAE,mBAAwB,GAClC,OAAO,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAenC"}
|
package/dist/src/safePushData.js
CHANGED
|
@@ -9,6 +9,13 @@
|
|
|
9
9
|
// loop, but requires heavier code (locating + loading the schema, resolving
|
|
10
10
|
// $refs, walking the schema tree). Something to consider in the future.
|
|
11
11
|
const SCHEMA_ERROR_TYPE = 'schema-validation-error';
|
|
12
|
+
// Cap on how many distinct field issues we spell out in one log line. A
|
|
13
|
+
// pathological batch can fail on hundreds of fields; the overflow is
|
|
14
|
+
// summarised as a count instead of flooding the Actor log.
|
|
15
|
+
const MAX_LOGGED_FIELDS = 20;
|
|
16
|
+
// Shared empty error list. Positions that validated fine in the current round
|
|
17
|
+
// point at this instead of allocating a fresh array each time.
|
|
18
|
+
const NO_ERRORS = [];
|
|
12
19
|
export function isSchemaValidationError(err) {
|
|
13
20
|
if (!err || typeof err !== 'object')
|
|
14
21
|
return false;
|
|
@@ -27,6 +34,8 @@ export function isSchemaValidationError(err) {
|
|
|
27
34
|
* direct `.pushData()` calls in this library, so the binding lives at the
|
|
28
35
|
* call site: `(b) => Actor.pushData(b)` or
|
|
29
36
|
* `(b) => client.dataset(id).pushItems(b)`.
|
|
37
|
+
*
|
|
38
|
+
* Whatever `pushFn` resolves to is handed back untouched as `pushResult`.
|
|
30
39
|
*/
|
|
31
40
|
export async function safePushData(pushFn, input, options = {}) {
|
|
32
41
|
const items = Array.isArray(input) ? input : [input];
|
|
@@ -34,14 +43,14 @@ export async function safePushData(pushFn, input, options = {}) {
|
|
|
34
43
|
// case). No working copies, no maps, no per-item wrapper objects — just
|
|
35
44
|
// hand the caller's array to pushFn and return on success.
|
|
36
45
|
try {
|
|
37
|
-
await pushFn(items);
|
|
38
|
-
return {
|
|
46
|
+
const pushResult = await pushFn(items);
|
|
47
|
+
return { pushedCount: items.length, droppedItems: [], attemptCount: 1, pushResult };
|
|
39
48
|
}
|
|
40
49
|
catch (err) {
|
|
41
50
|
if (!isSchemaValidationError(err))
|
|
42
51
|
throw err;
|
|
43
52
|
// Clamp to >=1: the initial push above always counts as one attempt,
|
|
44
|
-
// so 0/negative would make the reported `
|
|
53
|
+
// so 0/negative would make the reported `attemptCount` lie about it.
|
|
45
54
|
return cleanAndRetry(pushFn, items, err, Math.max(1, options.maxAttempts ?? 5));
|
|
46
55
|
}
|
|
47
56
|
}
|
|
@@ -60,17 +69,44 @@ async function cleanAndRetry(pushFn, originalItems, initialError, maxAttempts) {
|
|
|
60
69
|
// without looping forever; for user-supplied fields the existing
|
|
61
70
|
// "delete the field" behaviour stays in effect.
|
|
62
71
|
const placeholderPaths = originalItems.map(() => new Set());
|
|
63
|
-
// Parallel to `working`. The
|
|
64
|
-
//
|
|
65
|
-
//
|
|
66
|
-
|
|
72
|
+
// Parallel to `working`. The errors the API reported for this position in
|
|
73
|
+
// the *current* round, reset every round. Non-empty therefore means "still
|
|
74
|
+
// failing right now", which is what decides who gets dropped when we run
|
|
75
|
+
// out of attempts — and it gives that drop a reason to report.
|
|
76
|
+
const roundErrors = originalItems.map(() => NO_ERRORS);
|
|
67
77
|
const dropped = [];
|
|
68
78
|
let attempts = 1;
|
|
69
79
|
let lastError = initialError;
|
|
80
|
+
// Remove position `i` from every parallel array and record why it went.
|
|
81
|
+
const dropAt = (i, errors) => {
|
|
82
|
+
dropped.push({ item: originalAt[i], errors });
|
|
83
|
+
working.splice(i, 1);
|
|
84
|
+
originalAt.splice(i, 1);
|
|
85
|
+
placeholderPaths.splice(i, 1);
|
|
86
|
+
roundErrors.splice(i, 1);
|
|
87
|
+
};
|
|
88
|
+
// Every return path below either follows a successful push or has dropped
|
|
89
|
+
// everything that isn't in it, so "original minus dropped" is exactly what
|
|
90
|
+
// landed. (A rejected push stores nothing at all — not even the items the
|
|
91
|
+
// API found no fault with.)
|
|
92
|
+
const result = (attemptCount, pushResult) => ({
|
|
93
|
+
pushedCount: originalItems.length - dropped.length,
|
|
94
|
+
droppedItems: dropped,
|
|
95
|
+
attemptCount,
|
|
96
|
+
pushResult,
|
|
97
|
+
});
|
|
70
98
|
while (true) {
|
|
71
99
|
// Process this round's errors. Highest position first so the splices
|
|
72
100
|
// below don't shift positions we still need to look at.
|
|
73
101
|
const invalids = lastError.data.invalidItems.slice().sort((a, b) => b.itemPosition - a.itemPosition);
|
|
102
|
+
roundErrors.fill(NO_ERRORS);
|
|
103
|
+
// Which fields went wrong this round, across every failing item. We
|
|
104
|
+
// deliberately don't track which item had which problem — with more
|
|
105
|
+
// than one bad item that detail is noise, and the field set is what
|
|
106
|
+
// actually tells you what to fix in the schema or the scraper.
|
|
107
|
+
const repairedFields = new Set();
|
|
108
|
+
const droppedFields = new Set();
|
|
109
|
+
let droppedThisRound = 0;
|
|
74
110
|
for (const invalid of invalids) {
|
|
75
111
|
const i = invalid.itemPosition;
|
|
76
112
|
// Guard against a malformed/unexpected error payload (e.g. a
|
|
@@ -82,34 +118,80 @@ async function cleanAndRetry(pushFn, originalItems, initialError, maxAttempts) {
|
|
|
82
118
|
}
|
|
83
119
|
const cleaned = cleanItemFields(working[i], invalid.validationErrors, placeholderPaths[i]);
|
|
84
120
|
if (cleaned === null) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
placeholderPaths.splice(i, 1);
|
|
89
|
-
lastErrorsAt.splice(i, 1);
|
|
121
|
+
collectFieldIssues(invalid.validationErrors, droppedFields);
|
|
122
|
+
droppedThisRound++;
|
|
123
|
+
dropAt(i, invalid.validationErrors);
|
|
90
124
|
}
|
|
91
125
|
else {
|
|
92
126
|
working[i] = cleaned;
|
|
93
|
-
|
|
127
|
+
roundErrors[i] = invalid.validationErrors;
|
|
128
|
+
collectFieldIssues(invalid.validationErrors, repairedFields);
|
|
94
129
|
}
|
|
95
130
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
if (
|
|
100
|
-
|
|
131
|
+
const report = [
|
|
132
|
+
`safePushData: schema validation failed on attempt ${attempts}: ${lastError.data.invalidItems.length} invalid item(s)`,
|
|
133
|
+
];
|
|
134
|
+
if (repairedFields.size > 0)
|
|
135
|
+
report.push(`repaired fields: ${formatFields(repairedFields)}`);
|
|
136
|
+
if (droppedThisRound > 0) {
|
|
137
|
+
report.push(`dropped ${droppedThisRound} item(s) on unfixable fields: ${formatFields(droppedFields)}`);
|
|
101
138
|
}
|
|
139
|
+
if (working.length === 0)
|
|
140
|
+
report.push('nothing left to retry.');
|
|
141
|
+
else if (attempts < maxAttempts)
|
|
142
|
+
report.push(`retrying with ${working.length} item(s).`);
|
|
143
|
+
else
|
|
144
|
+
report.push(`attempt cap reached with ${working.length} item(s) left.`);
|
|
145
|
+
console.log(report.join('; '));
|
|
146
|
+
if (working.length === 0)
|
|
147
|
+
return result(attempts);
|
|
102
148
|
attempts++;
|
|
103
149
|
if (attempts > maxAttempts) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
150
|
+
// Out of repair rounds. Drop what's still failing — but a rejected
|
|
151
|
+
// push stores *nothing*, so keeping the rest in the batch would
|
|
152
|
+
// throw away perfectly valid items along with the bad ones. Give
|
|
153
|
+
// the survivors one clean push of their own instead. They were
|
|
154
|
+
// validated in the round above and left untouched since, so this
|
|
155
|
+
// push is expected to go through.
|
|
156
|
+
const unresolvedFields = new Set();
|
|
157
|
+
let unresolved = 0;
|
|
158
|
+
for (let i = working.length - 1; i >= 0; i--) {
|
|
159
|
+
if (roundErrors[i].length === 0)
|
|
160
|
+
continue;
|
|
161
|
+
collectFieldIssues(roundErrors[i], unresolvedFields);
|
|
162
|
+
unresolved++;
|
|
163
|
+
dropAt(i, roundErrors[i]);
|
|
164
|
+
}
|
|
165
|
+
const giveUp = [`safePushData: gave up after ${maxAttempts} attempts`];
|
|
166
|
+
if (unresolved > 0) {
|
|
167
|
+
giveUp.push(`dropped ${unresolved} item(s) still failing on fields: ${formatFields(unresolvedFields)}`);
|
|
168
|
+
}
|
|
169
|
+
giveUp.push(working.length > 0 ? `pushing the ${working.length} valid item(s) left.` : 'nothing to salvage.');
|
|
170
|
+
console.log(giveUp.join('; '));
|
|
171
|
+
if (working.length === 0)
|
|
172
|
+
return result(maxAttempts);
|
|
173
|
+
try {
|
|
174
|
+
const pushResult = await pushFn(working);
|
|
175
|
+
return result(attempts, pushResult);
|
|
176
|
+
}
|
|
177
|
+
catch (err) {
|
|
178
|
+
if (!isSchemaValidationError(err))
|
|
179
|
+
throw err;
|
|
180
|
+
// Even the survivors were rejected, so nothing landed. Report
|
|
181
|
+
// each one with whatever the API said about it this time.
|
|
182
|
+
const errorsAt = new Map();
|
|
183
|
+
for (const invalid of err.data.invalidItems) {
|
|
184
|
+
errorsAt.set(invalid.itemPosition, invalid.validationErrors);
|
|
185
|
+
}
|
|
186
|
+
console.log(`safePushData: final push of ${working.length} item(s) was rejected too; dropping them.`);
|
|
187
|
+
for (let i = working.length - 1; i >= 0; i--)
|
|
188
|
+
dropAt(i, errorsAt.get(i) ?? NO_ERRORS);
|
|
189
|
+
return result(attempts);
|
|
107
190
|
}
|
|
108
|
-
return { pushed: originalItems.length - dropped.length, dropped, attempts: maxAttempts };
|
|
109
191
|
}
|
|
110
192
|
try {
|
|
111
|
-
await pushFn(working);
|
|
112
|
-
return
|
|
193
|
+
const pushResult = await pushFn(working);
|
|
194
|
+
return result(attempts, pushResult);
|
|
113
195
|
}
|
|
114
196
|
catch (err) {
|
|
115
197
|
if (!isSchemaValidationError(err))
|
|
@@ -118,60 +200,131 @@ async function cleanAndRetry(pushFn, originalItems, initialError, maxAttempts) {
|
|
|
118
200
|
}
|
|
119
201
|
}
|
|
120
202
|
}
|
|
203
|
+
// Add a `path (keyword)` label for every AJV error into `into`. A Set is
|
|
204
|
+
// used on purpose: one bad field usually shows up on many items in the
|
|
205
|
+
// batch, and repeating it once per item makes the log unreadable.
|
|
206
|
+
function collectFieldIssues(validationErrors, into) {
|
|
207
|
+
for (const err of validationErrors)
|
|
208
|
+
into.add(fieldIssueLabel(err));
|
|
209
|
+
}
|
|
210
|
+
// Human-readable "which field is broken, and how" for one AJV error.
|
|
211
|
+
//
|
|
212
|
+
// `required` and `additionalProperties` report the *parent* in instancePath
|
|
213
|
+
// and name the offending key in params, so we re-attach it — otherwise a
|
|
214
|
+
// missing top-level field would log as the useless `(item root)`.
|
|
215
|
+
function fieldIssueLabel(err) {
|
|
216
|
+
const child = offendingKey(err.params);
|
|
217
|
+
const parent = err.instancePath || '';
|
|
218
|
+
const path = child === undefined ? parent : `${parent}/${escapeJsonPointerSegment(child)}`;
|
|
219
|
+
return `${path === '' ? '(item root)' : collapseArrayIndices(path)} (${err.keyword})`;
|
|
220
|
+
}
|
|
221
|
+
// The key an error blames when instancePath points at its parent.
|
|
222
|
+
function offendingKey(params) {
|
|
223
|
+
if (typeof params?.missingProperty === 'string')
|
|
224
|
+
return params.missingProperty;
|
|
225
|
+
if (typeof params?.additionalProperty === 'string')
|
|
226
|
+
return params.additionalProperty;
|
|
227
|
+
return undefined;
|
|
228
|
+
}
|
|
229
|
+
// `/tags/0` and `/tags/7` are the same *field* as far as the log is
|
|
230
|
+
// concerned, so collapse numeric segments into `/tags/[]`. Keeps a batch
|
|
231
|
+
// with a hundred bad array elements down to a single entry.
|
|
232
|
+
function collapseArrayIndices(path) {
|
|
233
|
+
return path.replace(/\/\d+(?=\/|$)/g, '/[]');
|
|
234
|
+
}
|
|
235
|
+
// Render a field-issue set as a stable, bounded, comma-separated list.
|
|
236
|
+
function formatFields(fields) {
|
|
237
|
+
const sorted = [...fields].sort();
|
|
238
|
+
if (sorted.length <= MAX_LOGGED_FIELDS)
|
|
239
|
+
return sorted.join(', ');
|
|
240
|
+
const shown = sorted.slice(0, MAX_LOGGED_FIELDS);
|
|
241
|
+
return `${shown.join(', ')} (+${sorted.length - MAX_LOGGED_FIELDS} more)`;
|
|
242
|
+
}
|
|
121
243
|
// Try to repair a single item given its AJV errors. Returns null when the
|
|
122
|
-
// item can't be salvaged
|
|
244
|
+
// item can't be salvaged — including when none of its errors turned out to
|
|
245
|
+
// be actionable, since re-pushing an unchanged item would just reproduce the
|
|
246
|
+
// same errors and burn the remaining attempts.
|
|
123
247
|
//
|
|
124
248
|
// Mutates `placeholderPaths` to record any fields we filled in ourselves,
|
|
125
249
|
// so the caller can keep iterating on them across rounds.
|
|
126
250
|
function cleanItemFields(item, validationErrors, placeholderPaths) {
|
|
127
251
|
// structuredClone so we never mutate the caller's data.
|
|
128
252
|
const cloned = structuredClone(item);
|
|
129
|
-
|
|
253
|
+
let changed = false;
|
|
254
|
+
for (const err of sortForRepair(validationErrors)) {
|
|
130
255
|
const instancePath = err.instancePath || '';
|
|
131
256
|
const path = parseJsonPointer(instancePath);
|
|
132
|
-
//
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
placeholderPaths.add(
|
|
141
|
-
|
|
257
|
+
// Missing required field: insert a placeholder and remember we did
|
|
258
|
+
// so. The next round will see a `type` error on this path and we'll
|
|
259
|
+
// upgrade null to a type-appropriate value. The property is named in
|
|
260
|
+
// params — instancePath points at the object that's missing it, which
|
|
261
|
+
// may be the item root or any object nested inside it.
|
|
262
|
+
if (err.keyword === 'required' && typeof err.params?.missingProperty === 'string') {
|
|
263
|
+
const target = [...path, err.params.missingProperty];
|
|
264
|
+
if (setAtPath(cloned, target, null)) {
|
|
265
|
+
placeholderPaths.add(toJsonPointer(target));
|
|
266
|
+
changed = true;
|
|
142
267
|
}
|
|
143
|
-
|
|
144
|
-
if (err.keyword === 'additionalProperties' && typeof err.params?.additionalProperty === 'string') {
|
|
145
|
-
delete cloned[err.params.additionalProperty];
|
|
146
|
-
continue;
|
|
147
|
-
}
|
|
148
|
-
// type/format/etc. at the root means the item itself is the wrong shape.
|
|
149
|
-
return null;
|
|
268
|
+
continue;
|
|
150
269
|
}
|
|
270
|
+
// Unknown property: also named in params, with instancePath pointing
|
|
271
|
+
// at its parent. Strip it.
|
|
272
|
+
if (err.keyword === 'additionalProperties' && typeof err.params?.additionalProperty === 'string') {
|
|
273
|
+
if (deleteAtPath(cloned, [...path, err.params.additionalProperty]))
|
|
274
|
+
changed = true;
|
|
275
|
+
continue;
|
|
276
|
+
}
|
|
277
|
+
// Any other error at the root means the item itself is the wrong
|
|
278
|
+
// shape (wrong type, failed `anyOf`, …) — there's no field to strip.
|
|
279
|
+
if (path.length === 0)
|
|
280
|
+
return null;
|
|
151
281
|
// Errors on a path we placeholder'd: try to satisfy the constraint
|
|
152
282
|
// rather than delete the field (deleting would re-trigger required).
|
|
153
283
|
if (placeholderPaths.has(instancePath)) {
|
|
154
284
|
const fix = placeholderFor(err);
|
|
155
|
-
if (fix.ok) {
|
|
156
|
-
|
|
157
|
-
|
|
285
|
+
if (!fix.ok) {
|
|
286
|
+
// Constraint we don't know how to satisfy on a placeholder
|
|
287
|
+
// field (e.g. pattern, custom format). Give up on this item.
|
|
288
|
+
return null;
|
|
158
289
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
return null;
|
|
162
|
-
}
|
|
163
|
-
// additionalProperties errors point at the *parent* object; the
|
|
164
|
-
// offending key is in params, not in instancePath.
|
|
165
|
-
if (err.keyword === 'additionalProperties' && typeof err.params?.additionalProperty === 'string') {
|
|
166
|
-
deleteAtPath(cloned, [...path, err.params.additionalProperty]);
|
|
290
|
+
if (setAtPath(cloned, path, fix.value))
|
|
291
|
+
changed = true;
|
|
167
292
|
continue;
|
|
168
293
|
}
|
|
169
294
|
// User-supplied field with a violation we don't try to coerce.
|
|
170
295
|
// Strip it; if the schema declares it required, the next push will
|
|
171
296
|
// re-add a placeholder.
|
|
172
|
-
deleteAtPath(cloned, path)
|
|
297
|
+
if (deleteAtPath(cloned, path))
|
|
298
|
+
changed = true;
|
|
173
299
|
}
|
|
174
|
-
|
|
300
|
+
// Nothing we could act on (paths that no longer exist, keywords with no
|
|
301
|
+
// handler): the next push would fail identically, so drop the item now
|
|
302
|
+
// instead of spending every remaining attempt to learn that.
|
|
303
|
+
return changed ? cloned : null;
|
|
304
|
+
}
|
|
305
|
+
// Order one item's errors so the repairs don't interfere with each other.
|
|
306
|
+
// Deleting `/tags/0` shifts every later element down, so sibling array
|
|
307
|
+
// indices have to be handled highest-first; deeper paths come before their
|
|
308
|
+
// ancestors for the same reason.
|
|
309
|
+
function sortForRepair(validationErrors) {
|
|
310
|
+
return validationErrors
|
|
311
|
+
.map((err) => ({ err, path: parseJsonPointer(err.instancePath || '') }))
|
|
312
|
+
.sort((a, b) => comparePaths(a.path, b.path))
|
|
313
|
+
.map((entry) => entry.err);
|
|
314
|
+
}
|
|
315
|
+
function comparePaths(a, b) {
|
|
316
|
+
for (let i = 0; i < Math.min(a.length, b.length); i++) {
|
|
317
|
+
if (a[i] === b[i])
|
|
318
|
+
continue;
|
|
319
|
+
const ai = Number(a[i]);
|
|
320
|
+
const bi = Number(b[i]);
|
|
321
|
+
// Sibling array elements: highest index first.
|
|
322
|
+
if (Number.isInteger(ai) && Number.isInteger(bi))
|
|
323
|
+
return bi - ai;
|
|
324
|
+
return a[i] < b[i] ? -1 : 1;
|
|
325
|
+
}
|
|
326
|
+
// Same prefix: the deeper path first.
|
|
327
|
+
return b.length - a.length;
|
|
175
328
|
}
|
|
176
329
|
// Pick a value that will satisfy `err.keyword` on a placeholder field.
|
|
177
330
|
// Returns ok:false when we don't have a sensible default; the caller drops
|
|
@@ -227,8 +380,17 @@ function parseJsonPointer(pointer) {
|
|
|
227
380
|
.slice(1)
|
|
228
381
|
.map((seg) => seg.replace(/~1/g, '/').replace(/~0/g, '~'));
|
|
229
382
|
}
|
|
230
|
-
//
|
|
231
|
-
//
|
|
383
|
+
// Inverse of parseJsonPointer — used to record placeholder paths in the same
|
|
384
|
+
// encoding the API reports them in, so later errors match by string.
|
|
385
|
+
function toJsonPointer(path) {
|
|
386
|
+
return path.map((seg) => `/${escapeJsonPointerSegment(seg)}`).join('');
|
|
387
|
+
}
|
|
388
|
+
function escapeJsonPointerSegment(segment) {
|
|
389
|
+
return segment.replace(/~/g, '~0').replace(/\//g, '~1');
|
|
390
|
+
}
|
|
391
|
+
// Delete the value at `path` inside `obj`. Arrays splice; `sortForRepair`
|
|
392
|
+
// makes sure sibling indices are processed highest-first so the shift
|
|
393
|
+
// doesn't invalidate the paths we haven't handled yet.
|
|
232
394
|
function deleteAtPath(obj, path) {
|
|
233
395
|
if (path.length === 0)
|
|
234
396
|
return false;
|
|
@@ -256,8 +418,9 @@ function deleteAtPath(obj, path) {
|
|
|
256
418
|
}
|
|
257
419
|
return false;
|
|
258
420
|
}
|
|
259
|
-
// Set the value at `path` inside `obj`.
|
|
260
|
-
//
|
|
421
|
+
// Set the value at `path` inside `obj`. Only the final segment is created —
|
|
422
|
+
// every parent on the way has to exist already (it does: the API reports the
|
|
423
|
+
// error against an object it found).
|
|
261
424
|
function setAtPath(obj, path, value) {
|
|
262
425
|
if (path.length === 0)
|
|
263
426
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safePushData.js","sourceRoot":"","sources":["../../src/safePushData.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,6EAA6E;AAC7E,kBAAkB;AAClB,EAAE;AACF,8EAA8E;AAC9E,+EAA+E;AAC/E,4EAA4E;AAC5E,8EAA8E;AAC9E,4EAA4E;AAC5E,wEAAwE;AAExE,MAAM,iBAAiB,GAAG,yBAAyB,CAAC;AA4BpD,MAAM,UAAU,uBAAuB,CAAC,GAAY;IAChD,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAClD,MAAM,CAAC,GAAG,GAAqC,CAAC;IAChD,IAAI,CAAC,CAAC,IAAI,KAAK,iBAAiB;QAAE,OAAO,KAAK,CAAC;IAC/C,IAAI,CAAC,CAAC,UAAU,KAAK,GAAG;QAAE,OAAO,KAAK,CAAC;IACvC,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,Y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": "0.1.3-beta.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Wrapper around Actor.pushData that survives dataset schema-validation failures by stripping offending fields and retrying. Callers pass the actual push function as pushFn.",
|
|
6
6
|
"repository": {
|