@memberjunction/integration-engine 6.1.0-edge.3 → 6.1.0-edge.5

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 (85) hide show
  1. package/dist/BaseIntegrationConnector.d.ts +26 -2
  2. package/dist/BaseIntegrationConnector.d.ts.map +1 -1
  3. package/dist/BaseIntegrationConnector.js +145 -23
  4. package/dist/BaseIntegrationConnector.js.map +1 -1
  5. package/dist/BaseRESTIntegrationConnector.d.ts +62 -8
  6. package/dist/BaseRESTIntegrationConnector.d.ts.map +1 -1
  7. package/dist/BaseRESTIntegrationConnector.js +200 -20
  8. package/dist/BaseRESTIntegrationConnector.js.map +1 -1
  9. package/dist/BatchIdentity.d.ts +47 -0
  10. package/dist/BatchIdentity.d.ts.map +1 -0
  11. package/dist/BatchIdentity.js +78 -0
  12. package/dist/BatchIdentity.js.map +1 -0
  13. package/dist/DeclaredSampleMerge.d.ts +74 -0
  14. package/dist/DeclaredSampleMerge.d.ts.map +1 -0
  15. package/dist/DeclaredSampleMerge.js +104 -0
  16. package/dist/DeclaredSampleMerge.js.map +1 -0
  17. package/dist/DiscoveryWatchdog.d.ts +103 -0
  18. package/dist/DiscoveryWatchdog.d.ts.map +1 -0
  19. package/dist/DiscoveryWatchdog.js +166 -0
  20. package/dist/DiscoveryWatchdog.js.map +1 -0
  21. package/dist/FieldMapValidation.d.ts +40 -0
  22. package/dist/FieldMapValidation.d.ts.map +1 -0
  23. package/dist/FieldMapValidation.js +58 -0
  24. package/dist/FieldMapValidation.js.map +1 -0
  25. package/dist/FieldMappingEngine.d.ts +1 -13
  26. package/dist/FieldMappingEngine.d.ts.map +1 -1
  27. package/dist/FieldMappingEngine.js +18 -3
  28. package/dist/FieldMappingEngine.js.map +1 -1
  29. package/dist/IntegrationConnectorCreationPipeline.d.ts +20 -0
  30. package/dist/IntegrationConnectorCreationPipeline.d.ts.map +1 -1
  31. package/dist/IntegrationConnectorCreationPipeline.js +203 -30
  32. package/dist/IntegrationConnectorCreationPipeline.js.map +1 -1
  33. package/dist/IntegrationEngine.d.ts +204 -1
  34. package/dist/IntegrationEngine.d.ts.map +1 -1
  35. package/dist/IntegrationEngine.js +1224 -262
  36. package/dist/IntegrationEngine.js.map +1 -1
  37. package/dist/IntegrationSchemaSync.d.ts +54 -2
  38. package/dist/IntegrationSchemaSync.d.ts.map +1 -1
  39. package/dist/IntegrationSchemaSync.js +122 -16
  40. package/dist/IntegrationSchemaSync.js.map +1 -1
  41. package/dist/KeylessRecordGuard.d.ts +56 -0
  42. package/dist/KeylessRecordGuard.d.ts.map +1 -0
  43. package/dist/KeylessRecordGuard.js +80 -0
  44. package/dist/KeylessRecordGuard.js.map +1 -0
  45. package/dist/ResumeConcurrency.d.ts +46 -0
  46. package/dist/ResumeConcurrency.d.ts.map +1 -0
  47. package/dist/ResumeConcurrency.js +74 -0
  48. package/dist/ResumeConcurrency.js.map +1 -0
  49. package/dist/RetryAfter.d.ts +50 -0
  50. package/dist/RetryAfter.d.ts.map +1 -0
  51. package/dist/RetryAfter.js +127 -0
  52. package/dist/RetryAfter.js.map +1 -0
  53. package/dist/RetryRunner.d.ts +26 -2
  54. package/dist/RetryRunner.d.ts.map +1 -1
  55. package/dist/RetryRunner.js +11 -3
  56. package/dist/RetryRunner.js.map +1 -1
  57. package/dist/StreamingDiscovery.d.ts +11 -0
  58. package/dist/StreamingDiscovery.d.ts.map +1 -1
  59. package/dist/StreamingDiscovery.js +13 -3
  60. package/dist/StreamingDiscovery.js.map +1 -1
  61. package/dist/SyncDirectives.d.ts +66 -0
  62. package/dist/SyncDirectives.d.ts.map +1 -0
  63. package/dist/SyncDirectives.js +123 -0
  64. package/dist/SyncDirectives.js.map +1 -0
  65. package/dist/SyncLogger.d.ts +2 -1
  66. package/dist/SyncLogger.d.ts.map +1 -1
  67. package/dist/SyncLogger.js +1 -0
  68. package/dist/SyncLogger.js.map +1 -1
  69. package/dist/WatermarkService.d.ts +15 -0
  70. package/dist/WatermarkService.d.ts.map +1 -1
  71. package/dist/WatermarkService.js +26 -0
  72. package/dist/WatermarkService.js.map +1 -1
  73. package/dist/WriteSerializer.d.ts +44 -0
  74. package/dist/WriteSerializer.d.ts.map +1 -0
  75. package/dist/WriteSerializer.js +70 -0
  76. package/dist/WriteSerializer.js.map +1 -0
  77. package/dist/index.d.ts +10 -1
  78. package/dist/index.d.ts.map +1 -1
  79. package/dist/index.js +8 -1
  80. package/dist/index.js.map +1 -1
  81. package/dist/types.d.ts +45 -1
  82. package/dist/types.d.ts.map +1 -1
  83. package/dist/types.js +66 -1
  84. package/dist/types.js.map +1 -1
  85. package/package.json +7 -7
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @fileoverview How many orphaned syncs may be resumed at once, and the pool that does it.
3
+ *
4
+ * Syncs are STARTED concurrently — `processRSUPendingWork` launches each connector's `RunSync`
5
+ * without awaiting it — and used to be RESUMED serially, one `await` per iteration. A restart
6
+ * therefore converted a parallel workload into a queue ordered by whatever `RunView` returned,
7
+ * and the slowest connector became a head-of-line block for every other connector on the
8
+ * workspace. If it never finished, they never started.
9
+ *
10
+ * Kept in its own module so both decisions — the bound, and the isolation guarantee — can be
11
+ * tested directly rather than inferred from a resume that takes hours to run.
12
+ */
13
+ /**
14
+ * Default in-flight resumes. Deliberately small.
15
+ *
16
+ * A workspace is a single Node process: concurrency across connectors buys overlap on time spent
17
+ * waiting for different sources, not more CPU, because every response still returns to the same
18
+ * event loop to be parsed, hashed and written. Four covers the realistic case — a handful of
19
+ * connectors orphaned by one restart — without letting a boot that adopted fifty runs replace a
20
+ * head-of-line block with a thundering herd.
21
+ *
22
+ * The floor that actually matters is "greater than one". Serial was the bug.
23
+ */
24
+ export declare const DEFAULT_RESUME_CONCURRENCY = 4;
25
+ /**
26
+ * Resolves the in-flight resume bound, honouring `MJ_RESUME_CONCURRENCY`.
27
+ *
28
+ * An operator recovering a workspace with many orphaned runs may want more; one recovering a
29
+ * memory-starved box may want fewer. Anything unparseable, zero, or negative falls back to the
30
+ * default rather than being clamped to 1 — silently reintroducing the serial behaviour because of
31
+ * a typo in an env var is exactly the failure this module exists to prevent.
32
+ */
33
+ export declare function ResumeConcurrency(): number;
34
+ /**
35
+ * Runs `worker` over `items` with at most `concurrency` in flight, and does NOT stop early.
36
+ *
37
+ * The isolation is the point, and it is why this does not reuse a reject-on-first-error pool. A
38
+ * resume that fails must cost exactly one run, never the ones behind it — abandoning the queue on
39
+ * one bad item would recreate the head-of-line failure in a different shape. `ResumeOneOrphanedRun`
40
+ * already handles its own errors, so a rejection here means something genuinely unexpected; it is
41
+ * collected and rethrown only after every other item has had its turn.
42
+ *
43
+ * @throws the first worker rejection, AFTER all items have been attempted
44
+ */
45
+ export declare function RunResumesBounded<T>(items: T[], concurrency: number, worker: (item: T) => Promise<void>): Promise<void>;
46
+ //# sourceMappingURL=ResumeConcurrency.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResumeConcurrency.d.ts","sourceRoot":"","sources":["../src/ResumeConcurrency.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAE5C;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAG1C;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CAAC,CAAC,EACrC,KAAK,EAAE,CAAC,EAAE,EACV,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,GACnC,OAAO,CAAC,IAAI,CAAC,CA0Bf"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * @fileoverview How many orphaned syncs may be resumed at once, and the pool that does it.
3
+ *
4
+ * Syncs are STARTED concurrently — `processRSUPendingWork` launches each connector's `RunSync`
5
+ * without awaiting it — and used to be RESUMED serially, one `await` per iteration. A restart
6
+ * therefore converted a parallel workload into a queue ordered by whatever `RunView` returned,
7
+ * and the slowest connector became a head-of-line block for every other connector on the
8
+ * workspace. If it never finished, they never started.
9
+ *
10
+ * Kept in its own module so both decisions — the bound, and the isolation guarantee — can be
11
+ * tested directly rather than inferred from a resume that takes hours to run.
12
+ */
13
+ /**
14
+ * Default in-flight resumes. Deliberately small.
15
+ *
16
+ * A workspace is a single Node process: concurrency across connectors buys overlap on time spent
17
+ * waiting for different sources, not more CPU, because every response still returns to the same
18
+ * event loop to be parsed, hashed and written. Four covers the realistic case — a handful of
19
+ * connectors orphaned by one restart — without letting a boot that adopted fifty runs replace a
20
+ * head-of-line block with a thundering herd.
21
+ *
22
+ * The floor that actually matters is "greater than one". Serial was the bug.
23
+ */
24
+ export const DEFAULT_RESUME_CONCURRENCY = 4;
25
+ /**
26
+ * Resolves the in-flight resume bound, honouring `MJ_RESUME_CONCURRENCY`.
27
+ *
28
+ * An operator recovering a workspace with many orphaned runs may want more; one recovering a
29
+ * memory-starved box may want fewer. Anything unparseable, zero, or negative falls back to the
30
+ * default rather than being clamped to 1 — silently reintroducing the serial behaviour because of
31
+ * a typo in an env var is exactly the failure this module exists to prevent.
32
+ */
33
+ export function ResumeConcurrency() {
34
+ const raw = Number(process.env.MJ_RESUME_CONCURRENCY);
35
+ return Number.isFinite(raw) && raw >= 1 ? Math.floor(raw) : DEFAULT_RESUME_CONCURRENCY;
36
+ }
37
+ /**
38
+ * Runs `worker` over `items` with at most `concurrency` in flight, and does NOT stop early.
39
+ *
40
+ * The isolation is the point, and it is why this does not reuse a reject-on-first-error pool. A
41
+ * resume that fails must cost exactly one run, never the ones behind it — abandoning the queue on
42
+ * one bad item would recreate the head-of-line failure in a different shape. `ResumeOneOrphanedRun`
43
+ * already handles its own errors, so a rejection here means something genuinely unexpected; it is
44
+ * collected and rethrown only after every other item has had its turn.
45
+ *
46
+ * @throws the first worker rejection, AFTER all items have been attempted
47
+ */
48
+ export async function RunResumesBounded(items, concurrency, worker) {
49
+ if (items.length === 0)
50
+ return;
51
+ let index = 0;
52
+ let firstError;
53
+ let hasError = false;
54
+ const runner = async () => {
55
+ while (index < items.length) {
56
+ const item = items[index++];
57
+ try {
58
+ await worker(item);
59
+ }
60
+ catch (err) {
61
+ // Keep going. One run's failure is one run's failure.
62
+ if (!hasError) {
63
+ hasError = true;
64
+ firstError = err;
65
+ }
66
+ }
67
+ }
68
+ };
69
+ const lanes = Math.max(1, Math.min(concurrency, items.length));
70
+ await Promise.all(Array.from({ length: lanes }, () => runner()));
71
+ if (hasError)
72
+ throw firstError;
73
+ }
74
+ //# sourceMappingURL=ResumeConcurrency.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResumeConcurrency.js","sourceRoot":"","sources":["../src/ResumeConcurrency.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC;AAE5C;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB;IAC7B,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;IACtD,OAAO,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,0BAA0B,CAAC;AAC3F,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACnC,KAAU,EACV,WAAmB,EACnB,MAAkC;IAElC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAE/B,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,UAAmB,CAAC;IACxB,IAAI,QAAQ,GAAG,KAAK,CAAC;IAErB,MAAM,MAAM,GAAG,KAAK,IAAmB,EAAE;QACrC,OAAO,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;YAC1B,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;YAC5B,IAAI,CAAC;gBACD,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC;YACvB,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACX,sDAAsD;gBACtD,IAAI,CAAC,QAAQ,EAAE,CAAC;oBACZ,QAAQ,GAAG,IAAI,CAAC;oBAChB,UAAU,GAAG,GAAG,CAAC;gBACrB,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IAC/D,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAEjE,IAAI,QAAQ;QAAE,MAAM,UAAU,CAAC;AACnC,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * @fileoverview Standard `Retry-After` extraction, so a connector that writes no rate-limit code
3
+ * still backs off by the amount the vendor actually asked for.
4
+ *
5
+ * `BaseIntegrationConnector.ExtractRetryAfterMs` returned `undefined` unconditionally and no
6
+ * connector in this repo overrode it. The engine's limiter therefore always fell back to its own
7
+ * multiplicative decrease — correct in direction, but blind to a number the vendor had already
8
+ * supplied in the response.
9
+ *
10
+ * `Retry-After` is defined by RFC 9110 §10.2.3 and is the header a 429 (RFC 6585) and a 503 carry.
11
+ * Parsing it is not a heuristic and not vendor-specific, which is exactly why it belongs in the
12
+ * base class rather than in each connector: there is one correct reading of it, and every HTTP
13
+ * connector benefits from having it read.
14
+ *
15
+ * Deliberately NOT a message-text parser. Guessing a duration out of prose ("try again in a bit")
16
+ * risks inventing a number, and a wrong Retry-After is worse than none — it would freeze the bucket
17
+ * for a made-up interval. Text-shaped signals stay the connector's job (see PheedLoop, whose vendor
18
+ * puts its delay in the body rather than a header); this reads the standard header only.
19
+ */
20
+ /**
21
+ * Upper bound on an honored `Retry-After`, in milliseconds (5 minutes).
22
+ *
23
+ * A vendor occasionally returns an enormous or malformed value — a Unix timestamp mistaken for
24
+ * delay-seconds, a date years out. Freezing a sync's token bucket for hours on the strength of one
25
+ * response is a worse failure than backing off by the limiter's own decrease, so anything beyond
26
+ * this is treated as unusable and the limiter's default applies.
27
+ */
28
+ export declare const MAX_HONORED_RETRY_AFTER_MS: number;
29
+ /**
30
+ * Parses a `Retry-After` value into milliseconds. RFC 9110 permits two forms:
31
+ * - delay-seconds: a non-negative integer, e.g. `120`
32
+ * - HTTP-date: e.g. `Wed, 21 Oct 2015 07:28:00 GMT`
33
+ *
34
+ * @param value the raw header value
35
+ * @param nowMs clock reading used to convert an HTTP-date into a delay; injectable for tests
36
+ * @returns milliseconds to wait, or undefined when the value is unusable
37
+ */
38
+ export declare function ParseRetryAfterValue(value: string | undefined, nowMs?: number): number | undefined;
39
+ /**
40
+ * Extracts a `Retry-After` delay, in milliseconds, from a thrown error or a failed response.
41
+ *
42
+ * Walks the shapes HTTP clients actually throw: the error itself carrying `headers`, an axios-style
43
+ * `error.response.headers`, and one level of `error.cause` (how a wrapper preserves the original).
44
+ *
45
+ * @param error the thrown value
46
+ * @param nowMs clock reading for HTTP-date conversion; injectable for tests
47
+ * @returns milliseconds to wait, or undefined when no usable header is present
48
+ */
49
+ export declare function ExtractRetryAfterFromError(error: unknown, nowMs?: number): number | undefined;
50
+ //# sourceMappingURL=RetryAfter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RetryAfter.d.ts","sourceRoot":"","sources":["../src/RetryAfter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,QAAa,CAAC;AAwCrD;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,GAAE,MAAmB,GAAG,MAAM,GAAG,SAAS,CA2B9G;AAED;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,GAAE,MAAmB,GAAG,MAAM,GAAG,SAAS,CAgBzG"}
@@ -0,0 +1,127 @@
1
+ /**
2
+ * @fileoverview Standard `Retry-After` extraction, so a connector that writes no rate-limit code
3
+ * still backs off by the amount the vendor actually asked for.
4
+ *
5
+ * `BaseIntegrationConnector.ExtractRetryAfterMs` returned `undefined` unconditionally and no
6
+ * connector in this repo overrode it. The engine's limiter therefore always fell back to its own
7
+ * multiplicative decrease — correct in direction, but blind to a number the vendor had already
8
+ * supplied in the response.
9
+ *
10
+ * `Retry-After` is defined by RFC 9110 §10.2.3 and is the header a 429 (RFC 6585) and a 503 carry.
11
+ * Parsing it is not a heuristic and not vendor-specific, which is exactly why it belongs in the
12
+ * base class rather than in each connector: there is one correct reading of it, and every HTTP
13
+ * connector benefits from having it read.
14
+ *
15
+ * Deliberately NOT a message-text parser. Guessing a duration out of prose ("try again in a bit")
16
+ * risks inventing a number, and a wrong Retry-After is worse than none — it would freeze the bucket
17
+ * for a made-up interval. Text-shaped signals stay the connector's job (see PheedLoop, whose vendor
18
+ * puts its delay in the body rather than a header); this reads the standard header only.
19
+ */
20
+ /**
21
+ * Upper bound on an honored `Retry-After`, in milliseconds (5 minutes).
22
+ *
23
+ * A vendor occasionally returns an enormous or malformed value — a Unix timestamp mistaken for
24
+ * delay-seconds, a date years out. Freezing a sync's token bucket for hours on the strength of one
25
+ * response is a worse failure than backing off by the limiter's own decrease, so anything beyond
26
+ * this is treated as unusable and the limiter's default applies.
27
+ */
28
+ export const MAX_HONORED_RETRY_AFTER_MS = 5 * 60_000;
29
+ /**
30
+ * Reads one header by name from a `Headers` instance, a `Map`, or a plain object, case-insensitively.
31
+ * Returns undefined when the container is not one of those or the header is absent.
32
+ */
33
+ function readHeader(container, name) {
34
+ if (!container || typeof container !== 'object')
35
+ return undefined;
36
+ // fetch's Headers (and anything else exposing a case-insensitive get)
37
+ const getter = container.get;
38
+ if (typeof getter === 'function') {
39
+ try {
40
+ const v = container.get(name);
41
+ if (typeof v === 'string' && v.length > 0)
42
+ return v;
43
+ }
44
+ catch { /* not a Headers-like after all */ }
45
+ }
46
+ // Plain object / axios-style header bag. Node lower-cases response header names, but a hand-built
47
+ // object may not, so compare case-insensitively rather than trusting the spelling.
48
+ const target = name.toLowerCase();
49
+ for (const [k, v] of Object.entries(container)) {
50
+ if (k.toLowerCase() !== target)
51
+ continue;
52
+ // Node can hand back string[] for a repeated header; the first value is the one that counts.
53
+ const raw = Array.isArray(v) ? v[0] : v;
54
+ if (typeof raw === 'string' && raw.length > 0)
55
+ return raw;
56
+ if (typeof raw === 'number' && Number.isFinite(raw))
57
+ return String(raw);
58
+ }
59
+ return undefined;
60
+ }
61
+ /**
62
+ * Parses a `Retry-After` value into milliseconds. RFC 9110 permits two forms:
63
+ * - delay-seconds: a non-negative integer, e.g. `120`
64
+ * - HTTP-date: e.g. `Wed, 21 Oct 2015 07:28:00 GMT`
65
+ *
66
+ * @param value the raw header value
67
+ * @param nowMs clock reading used to convert an HTTP-date into a delay; injectable for tests
68
+ * @returns milliseconds to wait, or undefined when the value is unusable
69
+ */
70
+ export function ParseRetryAfterValue(value, nowMs = Date.now()) {
71
+ if (!value)
72
+ return undefined;
73
+ const trimmed = value.trim();
74
+ if (trimmed.length === 0)
75
+ return undefined;
76
+ // delay-seconds. Accept only a bare integer: a decimal or anything with trailing junk is not
77
+ // what the spec defines, and Number() would happily coerce forms that mean something else.
78
+ if (/^\d+$/.test(trimmed)) {
79
+ const ms = Number(trimmed) * 1000;
80
+ return ms > 0 && ms <= MAX_HONORED_RETRY_AFTER_MS ? ms : undefined;
81
+ }
82
+ // HTTP-date. `Date.parse` is extremely permissive — it happily reads '1.5' as a date and
83
+ // returns a real timestamp — so gate it on the string actually LOOKING like one first.
84
+ // Every form RFC 9110 permits (IMF-fixdate, obsolete RFC 850, asctime) carries a three-letter
85
+ // day or month name AND a digit; the junk that reaches here ('1.5', '30s', '1e3', 'soon')
86
+ // carries at most one of the two. Falling through to a misparsed date would invent a delay,
87
+ // which is the one outcome worse than having none.
88
+ if (!/[A-Za-z]{3}/.test(trimmed) || !/\d/.test(trimmed))
89
+ return undefined;
90
+ // A date already in the past means "retry now" — no wait, but also not a parse failure, so it
91
+ // must not fall through to the limiter's default as though nothing was said.
92
+ const at = Date.parse(trimmed);
93
+ if (Number.isNaN(at))
94
+ return undefined;
95
+ const ms = at - nowMs;
96
+ if (ms <= 0)
97
+ return 0;
98
+ return ms <= MAX_HONORED_RETRY_AFTER_MS ? ms : undefined;
99
+ }
100
+ /**
101
+ * Extracts a `Retry-After` delay, in milliseconds, from a thrown error or a failed response.
102
+ *
103
+ * Walks the shapes HTTP clients actually throw: the error itself carrying `headers`, an axios-style
104
+ * `error.response.headers`, and one level of `error.cause` (how a wrapper preserves the original).
105
+ *
106
+ * @param error the thrown value
107
+ * @param nowMs clock reading for HTTP-date conversion; injectable for tests
108
+ * @returns milliseconds to wait, or undefined when no usable header is present
109
+ */
110
+ export function ExtractRetryAfterFromError(error, nowMs = Date.now()) {
111
+ if (!error || typeof error !== 'object')
112
+ return undefined;
113
+ const e = error;
114
+ const candidates = [
115
+ e.headers,
116
+ e.response?.headers,
117
+ e.cause?.headers,
118
+ e.cause?.response?.headers,
119
+ ];
120
+ for (const container of candidates) {
121
+ const parsed = ParseRetryAfterValue(readHeader(container, 'retry-after'), nowMs);
122
+ if (parsed !== undefined)
123
+ return parsed;
124
+ }
125
+ return undefined;
126
+ }
127
+ //# sourceMappingURL=RetryAfter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RetryAfter.js","sourceRoot":"","sources":["../src/RetryAfter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,GAAG,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QAAE,OAAO,SAAS,CAAC;IAC1D,MAAM,CAAC,GAAG,KAAsB,CAAC;IAEjC,MAAM,UAAU,GAAc;QAC1B,CAAC,CAAC,OAAO;QACT,CAAC,CAAC,QAAQ,EAAE,OAAO;QAClB,CAAC,CAAC,KAAmC,EAAE,OAAO;QAC9C,CAAC,CAAC,KAAmC,EAAE,QAAQ,EAAE,OAAO;KAC5D,CAAC;IAEF,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,oBAAoB,CAAC,UAAU,CAAC,SAAS,EAAE,aAAa,CAAC,EAAE,KAAK,CAAC,CAAC;QACjF,IAAI,MAAM,KAAK,SAAS;YAAE,OAAO,MAAM,CAAC;IAC5C,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC"}
@@ -13,15 +13,39 @@ export interface RetryConfig {
13
13
  }
14
14
  /** Default retry configuration */
15
15
  export declare const DEFAULT_RETRY_CONFIG: RetryConfig;
16
+ /**
17
+ * Optional hooks that let a caller make the wait between attempts smarter than blind backoff.
18
+ *
19
+ * Both exist for rate limiting. Exponential backoff is the right default for a network blip, but it
20
+ * is the WRONG answer to a 429: the source has usually told us exactly how long to wait, and
21
+ * retrying sooner is what turns a soft throttle into a hard one.
22
+ */
23
+ export interface RetryHooks {
24
+ /**
25
+ * Derive the wait from the error itself — e.g. a `Retry-After` header. Return `null`/`undefined`
26
+ * to keep the computed exponential backoff. The larger of the two is NOT taken automatically;
27
+ * returning a value replaces the backoff, so a caller can honour a source that asks for a
28
+ * SHORTER wait as well as a longer one.
29
+ */
30
+ DelayForError?: (error: unknown, attempt: number, backoffMs: number) => number | null | undefined;
31
+ /**
32
+ * Awaited after the delay and before the next attempt — e.g. re-acquiring a rate-limit token, so
33
+ * a retry passes through the same gate the first attempt did instead of bypassing it.
34
+ */
35
+ BeforeRetry?: (attempt: number, error: unknown) => Promise<void> | void;
36
+ }
16
37
  /**
17
38
  * Executes an operation with retry logic using exponential backoff.
18
39
  *
19
40
  * @param operation - The async operation to execute
20
41
  * @param config - Retry configuration (uses defaults if not provided)
21
42
  * @param isRetryable - Predicate to determine if a caught error should trigger a retry
22
- * @param onRetry - Optional callback invoked before each retry with attempt number, error, and delay
43
+ * @param onRetry - Optional callback invoked before each retry with attempt number, error, and delay.
44
+ * Runs BEFORE the wait, so it is the right place to report the failure onward (e.g.
45
+ * backing off a shared limiter) rather than after the retries are spent.
46
+ * @param hooks - Optional {@link RetryHooks} for source-directed delays and pre-attempt gating
23
47
  * @returns The result of the operation
24
48
  * @throws The last error encountered if all attempts fail
25
49
  */
26
- export declare function WithRetry<T>(operation: () => Promise<T>, config?: RetryConfig, isRetryable?: (error: unknown) => boolean, onRetry?: (attempt: number, error: unknown, delayMs: number) => void): Promise<T>;
50
+ export declare function WithRetry<T>(operation: () => Promise<T>, config?: RetryConfig, isRetryable?: (error: unknown) => boolean, onRetry?: (attempt: number, error: unknown, delayMs: number) => void, hooks?: RetryHooks): Promise<T>;
27
51
  //# sourceMappingURL=RetryRunner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RetryRunner.d.ts","sourceRoot":"","sources":["../src/RetryRunner.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,yEAAyE;IACzE,WAAW,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,gBAAgB,EAAE,MAAM,CAAC;IACzB,4DAA4D;IAC5D,YAAY,EAAE,MAAM,CAAC;IACrB,oDAAoD;IACpD,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,kCAAkC;AAClC,eAAO,MAAM,oBAAoB,EAAE,WAKlC,CAAC;AAeF;;;;;;;;;GASG;AACH,wBAAsB,SAAS,CAAC,CAAC,EAC7B,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAC3B,MAAM,GAAE,WAAkC,EAC1C,WAAW,GAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAoB,EACrD,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,GACrE,OAAO,CAAC,CAAC,CAAC,CAyBZ"}
1
+ {"version":3,"file":"RetryRunner.d.ts","sourceRoot":"","sources":["../src/RetryRunner.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,yEAAyE;IACzE,WAAW,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,gBAAgB,EAAE,MAAM,CAAC;IACzB,4DAA4D;IAC5D,YAAY,EAAE,MAAM,CAAC;IACrB,oDAAoD;IACpD,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,kCAAkC;AAClC,eAAO,MAAM,oBAAoB,EAAE,WAKlC,CAAC;AAeF;;;;;;GAMG;AACH,MAAM,WAAW,UAAU;IACvB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAClG;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CAC3E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,SAAS,CAAC,CAAC,EAC7B,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAC3B,MAAM,GAAE,WAAkC,EAC1C,WAAW,GAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAoB,EACrD,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,EACpE,KAAK,CAAC,EAAE,UAAU,GACnB,OAAO,CAAC,CAAC,CAAC,CA+BZ"}
@@ -23,11 +23,14 @@ function computeDelay(attempt, config) {
23
23
  * @param operation - The async operation to execute
24
24
  * @param config - Retry configuration (uses defaults if not provided)
25
25
  * @param isRetryable - Predicate to determine if a caught error should trigger a retry
26
- * @param onRetry - Optional callback invoked before each retry with attempt number, error, and delay
26
+ * @param onRetry - Optional callback invoked before each retry with attempt number, error, and delay.
27
+ * Runs BEFORE the wait, so it is the right place to report the failure onward (e.g.
28
+ * backing off a shared limiter) rather than after the retries are spent.
29
+ * @param hooks - Optional {@link RetryHooks} for source-directed delays and pre-attempt gating
27
30
  * @returns The result of the operation
28
31
  * @throws The last error encountered if all attempts fail
29
32
  */
30
- export async function WithRetry(operation, config = DEFAULT_RETRY_CONFIG, isRetryable = () => true, onRetry) {
33
+ export async function WithRetry(operation, config = DEFAULT_RETRY_CONFIG, isRetryable = () => true, onRetry, hooks) {
31
34
  let lastError;
32
35
  for (let attempt = 1; attempt <= config.MaxAttempts; attempt++) {
33
36
  try {
@@ -39,11 +42,16 @@ export async function WithRetry(operation, config = DEFAULT_RETRY_CONFIG, isRetr
39
42
  if (isLastAttempt || !isRetryable(err)) {
40
43
  throw err;
41
44
  }
42
- const delayMs = computeDelay(attempt, config);
45
+ const backoffMs = computeDelay(attempt, config);
46
+ const directed = hooks?.DelayForError?.(err, attempt, backoffMs);
47
+ const delayMs = typeof directed === 'number' && Number.isFinite(directed) && directed >= 0
48
+ ? directed
49
+ : backoffMs;
43
50
  if (onRetry) {
44
51
  onRetry(attempt, err, delayMs);
45
52
  }
46
53
  await sleep(delayMs);
54
+ await hooks?.BeforeRetry?.(attempt, err);
47
55
  }
48
56
  }
49
57
  // Should not reach here, but TypeScript needs this
@@ -1 +1 @@
1
- {"version":3,"file":"RetryRunner.js","sourceRoot":"","sources":["../src/RetryRunner.ts"],"names":[],"mappings":"AAcA,kCAAkC;AAClC,MAAM,CAAC,MAAM,oBAAoB,GAAgB;IAC7C,WAAW,EAAE,CAAC;IACd,gBAAgB,EAAE,IAAI;IACtB,YAAY,EAAE,KAAK;IACnB,cAAc,EAAE,GAAG;CAC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CAAC;YACX,SAAS,GAAG,GAAG,CAAC;YAEhB,MAAM,aAAa,GAAG,OAAO,KAAK,MAAM,CAAC,WAAW,CAAC;YACrD,IAAI,aAAa,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC;gBACrC,MAAM,GAAG,CAAC;YACd,CAAC;YAED,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAChD,MAAM,QAAQ,GAAG,KAAK,EAAE,aAAa,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;YACjE,MAAM,OAAO,GAAG,OAAO,QAAQ,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,QAAQ,IAAI,CAAC;gBACtF,CAAC,CAAC,QAAQ;gBACV,CAAC,CAAC,SAAS,CAAC;YAEhB,IAAI,OAAO,EAAE,CAAC;gBACV,OAAO,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;YACnC,CAAC;YAED,MAAM,KAAK,CAAC,OAAO,CAAC,CAAC;YACrB,MAAM,KAAK,EAAE,WAAW,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAC7C,CAAC;IACL,CAAC;IAED,mDAAmD;IACnD,MAAM,SAAS,CAAC;AACpB,CAAC;AAED;;;GAGG;AACH,SAAS,KAAK,CAAC,EAAU;IACrB,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC"}
@@ -102,6 +102,17 @@ export interface PkStatVerdict {
102
102
  AmbiguousForLLM: boolean;
103
103
  Reason: string;
104
104
  }
105
+ /** Minimum distinct/non-null ratio for a convention-named column to qualify as a SOFT key. */
106
+ /**
107
+ * Rows a value-statistic verdict needs before it counts as significant.
108
+ *
109
+ * Below this the classifier abstains (all-distinct over a handful of rows is chance, not a key);
110
+ * above it more rows change no verdict. Exported because callers must SIZE THEIR SAMPLE to it —
111
+ * a caller that buffers fewer rows than this gets abstention, and one that buffers more pays for
112
+ * confidence the classifier will not use. It was written inline three times here and duplicated a
113
+ * fourth time in the REST parent sampler, where the copy could drift out of step silently.
114
+ */
115
+ export declare const PK_STAT_MIN_ROWS_FOR_SIGNIFICANCE = 50;
105
116
  /**
106
117
  * Statistics-first PK pick from streamed evidence. A column is a candidate ONLY if it is, over a
107
118
  * statistically meaningful number of rows, **non-null on every row** AND **all-distinct** (and its
@@ -1 +1 @@
1
- {"version":3,"file":"StreamingDiscovery.d.ts","sourceRoot":"","sources":["../src/StreamingDiscovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAA4B,KAAK,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAE/F,MAAM,WAAW,sBAAsB;IACnC,qFAAqF;IACrF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4EAA4E;IAC5E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,0DAA0D;IAC1D,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACtB;AAED,oDAAoD;AACpD,MAAM,WAAW,oBAAoB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,iDAAiD;IACjD,WAAW,EAAE,MAAM,CAAC;IACpB,0BAA0B;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,eAAe,EAAE,MAAM,CAAC;IACxB,iFAAiF;IACjF,cAAc,EAAE,OAAO,CAAC;IACxB,8DAA8D;IAC9D,YAAY,EAAE,OAAO,EAAE,CAAC;IACxB;;;;OAIG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B,yGAAyG;IACzG,QAAQ,EAAE,kBAAkB,CAAC;CAChC;AAED,MAAM,WAAW,qBAAqB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iC,KAAK,CAAC;AAIpD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACnC,OAAO,EAAE,oBAAoB,EAAE,EAC/B,IAAI,GAAE,aAAkB,GACzB,aAAa,CAgDf;AAED,4GAA4G;AAC5G,MAAM,WAAW,kBAAkB;IAC/B,iGAAiG;IACjG,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,yBAAyB,CACrC,OAAO,EAAE,oBAAoB,EAAE,EAC/B,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EACzC,IAAI,GAAE,aAAkB,GACzB,kBAAkB,CA+BpB;AAED,sGAAsG;AACtG,MAAM,WAAW,UAAU;IACvB,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;CAClB;AAkCD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC5B,OAAO,EAAE,oBAAoB,EAAE,EAC/B,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EACzC,IAAI,GAAE,aAAa,GAAG;IAAE,aAAa,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAO,GAC9E,UAAU,CA4BZ"}
@@ -110,6 +110,16 @@ function isConventionPkName(name) {
110
110
  return /^(id|uuid|guid|pk)$|(^|_)(id|uuid|guid|key|code)$/i.test(name);
111
111
  }
112
112
  /** Minimum distinct/non-null ratio for a convention-named column to qualify as a SOFT key. */
113
+ /**
114
+ * Rows a value-statistic verdict needs before it counts as significant.
115
+ *
116
+ * Below this the classifier abstains (all-distinct over a handful of rows is chance, not a key);
117
+ * above it more rows change no verdict. Exported because callers must SIZE THEIR SAMPLE to it —
118
+ * a caller that buffers fewer rows than this gets abstention, and one that buffers more pays for
119
+ * confidence the classifier will not use. It was written inline three times here and duplicated a
120
+ * fourth time in the REST parent sampler, where the copy could drift out of step silently.
121
+ */
122
+ export const PK_STAT_MIN_ROWS_FOR_SIGNIFICANCE = 50;
113
123
  const SOFT_NEAR_UNIQUE_RATIO = 0.9;
114
124
  /**
115
125
  * Statistics-first PK pick from streamed evidence. A column is a candidate ONLY if it is, over a
@@ -119,7 +129,7 @@ const SOFT_NEAR_UNIQUE_RATIO = 0.9;
119
129
  * otherwise it's flagged ambiguous for the LLM tiebreaker. Zero candidates → no PK (no fabrication).
120
130
  */
121
131
  export function pickPrimaryKeyFromStats(columns, opts = {}) {
122
- const minRows = opts.MinRowsForSignificance ?? 50;
132
+ const minRows = opts.MinRowsForSignificance ?? PK_STAT_MIN_ROWS_FOR_SIGNIFICANCE;
123
133
  const candidates = columns.filter(c => c.TotalRows >= minRows &&
124
134
  c.Occurrences === c.TotalRows && // non-null on EVERY row
125
135
  !c.DistinctCapped && // uniqueness was provable from the scan
@@ -178,7 +188,7 @@ export function pickPrimaryKeyFromStats(columns, opts = {}) {
178
188
  * gate (MinRowsForSignificance) keeps a small-sample "uniqueness" from being a fluke.
179
189
  */
180
190
  export function pickCompositeKeyFromStats(columns, rowSamples, opts = {}) {
181
- const minRows = opts.MinRowsForSignificance ?? 50;
191
+ const minRows = opts.MinRowsForSignificance ?? PK_STAT_MIN_ROWS_FOR_SIGNIFICANCE;
182
192
  const n = rowSamples.length;
183
193
  if (n < minRows) {
184
194
  return { Fields: null, Reason: `Composite key not attempted — only ${n} sampled rows (< ${minRows} for significance).` };
@@ -259,7 +269,7 @@ function subsetKeyness(rowSamples, cols, minRows) {
259
269
  * size yields a provable key, returns null (the object is honestly keyless — never a fabricated key).
260
270
  */
261
271
  export function pickKeyFromStats(columns, rowSamples, opts = {}) {
262
- const minRows = opts.MinRowsForSignificance ?? 50;
272
+ const minRows = opts.MinRowsForSignificance ?? PK_STAT_MIN_ROWS_FOR_SIGNIFICANCE;
263
273
  const maxK = opts.MaxKeyColumns ?? 3;
264
274
  const maxCandidates = opts.MaxCandidates ?? 15;
265
275
  if (rowSamples.length < minRows) {
@@ -1 +1 @@
1
- {"version":3,"file":"StreamingDiscovery.js","sourceRoot":"","sources":["../src/StreamingDiscovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,wBAAwB,EAA2B,MAAM,4BAA4B,CAAC;AA0D/F,yEAAyE;AACzE,SAAS,MAAM,CAAC,IAAY,EAAE,QAAgB;IAC1C,MAAM,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAChD,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;AACtD,CAAC;AAED,uGAAuG;AACvG,uGAAuG;AACvG,+CAA+C;AAC/C,MAAM,sBAAsB,GAAG,MAAM,CAAC,yCAAyC,EAAE,MAAM,CAAC,CAAC;AACzF,MAAM,wBAAwB,GAAG,MAAM,CAAC,2CAA2C,EAAE,EAAE,CAAC,CAAC;AACzF,MAAM,4BAA4B,GAAG,MAAM,CAAC,uCAAuC,EAAE,OAAO,CAAC,CAAC;AAC9F,MAAM,gCAAgC,GAAG,MAAM,CAAC,4CAA4C,EAAE,KAAK,CAAC,CAAC;AAWrG;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACpC,OAAmF,EACnF,OAA+B,EAAE;IAEjC,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,IAAI,sBAAsB,CAAC;IACjE,MAAM,SAAS,GAAG,IAAI,CAAC,cAAc,IAAI,wBAAwB,CAAC;IAClE,MAAM,WAAW,GAAG,IAAI,CAAC,kBAAkB,IAAI,4BAA4B,CAAC;IAC5E,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,EAA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,EAAE,CAAC;YACrB,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,gBAAgB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,uBAAuB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,UAAU,CAAC,MAAM,iBAAiB,EAAE,CAAC;QACtL,CAAC;IACL,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,+BAA+B,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,SAAS,UAAU,CAAC,MAAM,iEAAiE,EAAE,CAAC;AACjM,CAAC;AAED,iGAAiG;AACjG,SAAS,cAAc,CAAC,KAAc;IAClC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5B,IAAI,CAAC;YAAC,OAAO,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAAC,CAAC;QAAC,MAAM,CAAC;YAAC,OAAO,oBAAoB,CAAC;QAAC,CAAC;IACvF,CAAC;IACD,OAAO,OAAO,KAAK,GAAG,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9C,CAAC;AAED,yFAAyF;AACzF,KAAK,SAAS,CAAC,CAAC,eAAe,CAAI,GAAmC;IAClE,IAAI,MAAM,CAAC,aAAa,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;QACtC,KAAK,CAAC,CAAC,GAAuB,CAAC;IACnC,CAAC;SAAM,CAAC;QACJ,KAAK,MAAM,IAAI,IAAI,GAAkB;YAAE,MAAM,IAAI,CAAC;IACtD,CAAC;AACL,CAAC"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Field-level sync directives.
3
+ *
4
+ * A connector can now declare that a source field should not be synced at all
5
+ * (`SourceFieldInfo.SyncDirective: 'Exclude'`). The directive is persisted into
6
+ * `IntegrationObjectField.Configuration` (a JSON column that already exists, so no
7
+ * migration is required) and honoured by the mapping stage, which strips excluded
8
+ * keys from the record BEFORE field mapping runs.
9
+ *
10
+ * Why stripping must happen there and not by deactivating a field map: an unmapped
11
+ * source key does not disappear — `computeUnmappedFields` captures it and the writer
12
+ * parks it in `__mj_integration_CustomOverflow`. Deactivating the map therefore
13
+ * REROUTES the value instead of excluding it, and the custom-column promoter will
14
+ * happily resurrect it as a real column later. Stripping before mapping keeps the
15
+ * key out of MappedFields, out of the overflow, and out of the content hash (whose
16
+ * basis is MappedFields), so an excluded field stops influencing change detection
17
+ * entirely.
18
+ *
19
+ * What this is for, concretely (measured on a live tenant, 2026-08-19):
20
+ * - `preferences` on Totara Users / Enrolled_Users: Moodle UI widget state
21
+ * (file-picker recents, user-selector toggles), identical nine keys on 100% of
22
+ * rows — ~2.5M expanded values of nothing.
23
+ * - `courseformatoptions` on Courses: course theming (header colours, tile icons).
24
+ * - `enrolledcourses` on Enrolled_Users: re-derives the Enrolled_Users table
25
+ * itself — ~7.6M expanded values that duplicate an object already synced.
26
+ *
27
+ * The directive lives in Configuration rather than a new column so that existing
28
+ * installs pick it up on their next schema sync with no DDL. Absence of a directive
29
+ * means Sync — connectors that never heard of this feature behave exactly as before.
30
+ */
31
+ /** The Configuration key under which a field's sync directive is stored. */
32
+ export declare const SYNC_DIRECTIVE_CONFIG_KEY = "syncDirective";
33
+ /** Recognised directive values. Anything unrecognised is treated as 'Sync'. */
34
+ export type FieldSyncDirective = 'Sync' | 'Exclude';
35
+ /** Minimal shape of an IntegrationObjectField row this module needs. */
36
+ export interface FieldWithConfiguration {
37
+ Name: string;
38
+ Configuration: string | null;
39
+ }
40
+ /**
41
+ * Reads the sync directive out of an IntegrationObjectField.Configuration JSON blob.
42
+ * Malformed JSON, a missing key, or an unrecognised value all mean 'Sync' — the
43
+ * directive can only ever narrow what is synced, never break a sync by its absence.
44
+ */
45
+ export declare function ReadFieldSyncDirective(configuration: string | null | undefined): FieldSyncDirective;
46
+ /**
47
+ * Merges a directive into an existing Configuration JSON string, preserving every
48
+ * other key. Returns the new JSON, or the original string when nothing changes
49
+ * (so callers can cheaply detect no-op writes). Setting 'Sync' REMOVES the key
50
+ * rather than storing the default.
51
+ */
52
+ export declare function WriteFieldSyncDirective(configuration: string | null | undefined, directive: FieldSyncDirective): string | null;
53
+ /**
54
+ * The set of source field names to strip for one integration object, derived from
55
+ * its IntegrationObjectField rows. Empty set when nothing is excluded — the
56
+ * mapping engine's fast path.
57
+ */
58
+ export declare function ComputeExcludedSourceNames(fields: ReadonlyArray<FieldWithConfiguration>): Set<string>;
59
+ /**
60
+ * Returns a copy of `fields` without the excluded keys, or the ORIGINAL object when
61
+ * no key matches (so the no-exclusions path allocates nothing). Matching is exact:
62
+ * source field names are the connector's own spelling, already used verbatim as
63
+ * field-map SourceFieldName and overflow keys.
64
+ */
65
+ export declare function StripExcludedFields(fields: Record<string, unknown>, excluded: ReadonlySet<string>): Record<string, unknown>;
66
+ //# sourceMappingURL=SyncDirectives.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SyncDirectives.d.ts","sourceRoot":"","sources":["../src/SyncDirectives.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,4EAA4E;AAC5E,eAAO,MAAM,yBAAyB,kBAAkB,CAAC;AAEzD,+EAA+E;AAC/E,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,SAAS,CAAC;AAEpD,wEAAwE;AACxE,MAAM,WAAW,sBAAsB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,kBAAkB,CAYnG;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACnC,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACxC,SAAS,EAAE,kBAAkB,GAC9B,MAAM,GAAG,IAAI,CAqBf;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,aAAa,CAAC,sBAAsB,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,CAQrG;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,GAC9B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAYzB"}