@memberjunction/record-set-processor-base 5.42.0 → 5.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/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +4 -0
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/registry.d.ts +94 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +77 -0
- package/dist/registry.js.map +1 -0
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -6,4 +6,8 @@
|
|
|
6
6
|
export * from './types.js';
|
|
7
7
|
export * from './interfaces.js';
|
|
8
8
|
export * from './sources/index.js';
|
|
9
|
+
export * from './registry.js';
|
|
10
|
+
// The RecordProcess.RunNow Remote Operation base + RecordProcessScopeOverride/RecordProcessRunNowInput/Output
|
|
11
|
+
// are now CodeGen-emitted into @memberjunction/core-entities (generated/remote_operations.ts) from the
|
|
12
|
+
// MJ: Remote Operations metadata row.
|
|
9
13
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,8GAA8G;AAC9G,uGAAuG;AACvG,sCAAsC"}
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -87,6 +87,8 @@ export interface ProcessRunMeta {
|
|
|
87
87
|
TotalItemCount?: number | null;
|
|
88
88
|
/** JSON-serializable snapshot of the effective configuration. */
|
|
89
89
|
Configuration?: unknown;
|
|
90
|
+
/** True when this run is a dry-run (compute-only) preview — persisted on the run header so history can distinguish it from a real apply. */
|
|
91
|
+
DryRun?: boolean;
|
|
90
92
|
}
|
|
91
93
|
/**
|
|
92
94
|
* PERSISTENCE seam — records run lifecycle, per-record detail, checkpoints, and the pause/cancel
|
|
@@ -160,6 +162,8 @@ export interface RecordSetProcessOptions {
|
|
|
160
162
|
} | null>;
|
|
161
163
|
/** JSON-serializable snapshot of configuration, persisted on the run header. */
|
|
162
164
|
configuration?: unknown;
|
|
165
|
+
/** True when this is a dry-run (compute-only) pass — recorded on the run header so history can distinguish previews from real applies. */
|
|
166
|
+
dryRun?: boolean;
|
|
163
167
|
}
|
|
164
168
|
export type { ProgressInfo, ProcessRunSummary };
|
|
165
169
|
//# sourceMappingURL=interfaces.d.ts.map
|
package/dist/interfaces.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EACH,aAAa,EACb,iBAAiB,EACj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AAe,CAAC,EAAE,MAAM,CAAC;IACzB,kFAAkF;IAClF,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qEAAqE;IACrE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,uCAAuC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0EAA0E;IAC1E,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,yDAAyD;IACzD,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,oEAAoE;IACpE,SAAS,CAAC,EAAE;QAAE,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAAC,eAAe,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACrE,gFAAgF;IAChF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,KAAK,IAAI,CAAC;IAC9C;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC,CAAC;IACjH,gFAAgF;IAChF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,0IAA0I;IAC1I,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAGD,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview The **processor registry** — the open seam that lets external packages teach the
|
|
3
|
+
* Record Set Processing substrate about new work types WITHOUT the base package depending on them.
|
|
4
|
+
*
|
|
5
|
+
* The engine's `RecordProcessExecutor.buildProcessor()` handles the built-in work types
|
|
6
|
+
* (`FieldRules` / `Action` / `Agent` / `Infer`) directly, then consults this registry for any work
|
|
7
|
+
* type its switch doesn't recognize before failing. A consumer package (e.g. Predictive Studio's
|
|
8
|
+
* `'ML Model'` scoring) registers a factory keyed by its work-type string; the factory closes over
|
|
9
|
+
* whatever injected dependencies that consumer needs (sidecars, loaders, etc.) and constructs its
|
|
10
|
+
* `IRecordProcessor` from the per-run build context.
|
|
11
|
+
*
|
|
12
|
+
* @module @memberjunction/record-set-processor-base
|
|
13
|
+
*/
|
|
14
|
+
import { BaseSingleton } from '@memberjunction/global';
|
|
15
|
+
import { IRecordProcessor } from './interfaces.js';
|
|
16
|
+
/**
|
|
17
|
+
* The per-run context handed to a registered factory. Carries the resolved Record Process fields the
|
|
18
|
+
* factory needs to build its processor, plus the dry-run flag, WITHOUT coupling the base package to
|
|
19
|
+
* the `MJRecordProcessEntity` type (the base package depends only on `@memberjunction/core` +
|
|
20
|
+
* `@memberjunction/global`). The engine populates this from the loaded Record Process; the registered
|
|
21
|
+
* factory reads `Configuration` / `InputMapping` to build itself.
|
|
22
|
+
*/
|
|
23
|
+
export interface RecordProcessorBuildContext {
|
|
24
|
+
/** The work-type key being built (the registry lookup key). */
|
|
25
|
+
WorkType: string;
|
|
26
|
+
/** The Record Process's `Configuration` JSON string (work-type-specific config), if any. */
|
|
27
|
+
Configuration?: string | null;
|
|
28
|
+
/** The Record Process's `InputMapping` JSON string, if any. */
|
|
29
|
+
InputMapping?: string | null;
|
|
30
|
+
/** The Record Process's `OutputMapping` JSON string, if any (write-back targets). */
|
|
31
|
+
OutputMapping?: string | null;
|
|
32
|
+
/** The target entity id of the Record Process. */
|
|
33
|
+
EntityID?: string;
|
|
34
|
+
/** The Record Process id (lineage / diagnostics). */
|
|
35
|
+
RecordProcessID?: string;
|
|
36
|
+
/** The Record Process name (diagnostics). */
|
|
37
|
+
RecordProcessName?: string;
|
|
38
|
+
/** True when this is a dry-run (compute-only) pass — the factory should honor it when supported. */
|
|
39
|
+
DryRun?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* The loaded Record Process record itself, as an opaque object. The engine passes the real
|
|
42
|
+
* `MJRecordProcessEntity`; a factory that needs fields beyond those projected above can read them
|
|
43
|
+
* off this with its own typing. Typed as `unknown` so the base package stays free of
|
|
44
|
+
* `@memberjunction/core-entities`.
|
|
45
|
+
*/
|
|
46
|
+
RecordProcess?: unknown;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Factory that builds an {@link IRecordProcessor} for a registered work type. Returning `null` (or
|
|
50
|
+
* `undefined`) signals "not applicable" so the executor can continue (defensive — normally a factory
|
|
51
|
+
* registered for a work type always builds for it). The factory may throw to surface a configuration
|
|
52
|
+
* error (e.g. a missing required id), exactly as the built-in work types do.
|
|
53
|
+
*/
|
|
54
|
+
export type RecordProcessorFactory = (context: RecordProcessorBuildContext) => IRecordProcessor | null | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Process-wide registry of work-type → processor factory, used by the engine's `buildProcessor()` to
|
|
57
|
+
* resolve work types beyond its built-ins. A {@link BaseSingleton} so there is exactly one instance
|
|
58
|
+
* across the process even when a bundler duplicates the module (per CLAUDE.md rule 7).
|
|
59
|
+
*
|
|
60
|
+
* Work-type keys are matched case-insensitively (trimmed), so a consumer can register `'ML Model'`
|
|
61
|
+
* and the executor resolves it whether the Record Process row stores `'ML Model'` or `'ml model'`.
|
|
62
|
+
*/
|
|
63
|
+
export declare class RecordProcessorRegistry extends BaseSingleton<RecordProcessorRegistry> {
|
|
64
|
+
/** work-type (normalized) → factory. */
|
|
65
|
+
private readonly factories;
|
|
66
|
+
/** @internal — use {@link RecordProcessorRegistry.Instance}. */
|
|
67
|
+
protected constructor();
|
|
68
|
+
/** The single process-wide registry instance. */
|
|
69
|
+
static get Instance(): RecordProcessorRegistry;
|
|
70
|
+
/** Normalize a work-type key for case/whitespace-insensitive matching. */
|
|
71
|
+
private normalize;
|
|
72
|
+
/**
|
|
73
|
+
* Register a factory for a work-type key. A later registration for the same key overrides the
|
|
74
|
+
* earlier one (last-wins), which lets a consumer replace a default.
|
|
75
|
+
*
|
|
76
|
+
* @param workType the work-type string (e.g. `'ML Model'`), matched case-insensitively
|
|
77
|
+
* @param factory builds the processor for that work type from the per-run context
|
|
78
|
+
*/
|
|
79
|
+
Register(workType: string, factory: RecordProcessorFactory): void;
|
|
80
|
+
/** Whether a factory is registered for the given work type (case-insensitive). */
|
|
81
|
+
Has(workType: string | null | undefined): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Resolve and invoke the factory for a work type, returning the built processor or `null` when no
|
|
84
|
+
* factory is registered (or the factory itself declined by returning null/undefined).
|
|
85
|
+
*
|
|
86
|
+
* @param context the per-run build context (work type + Record Process fields)
|
|
87
|
+
*/
|
|
88
|
+
Resolve(context: RecordProcessorBuildContext): IRecordProcessor | null;
|
|
89
|
+
/** The set of registered work-type keys (normalized). Primarily for diagnostics/tests. */
|
|
90
|
+
get RegisteredWorkTypes(): string[];
|
|
91
|
+
/** Remove a registration (case-insensitive). Returns whether one was present. Primarily for tests. */
|
|
92
|
+
Unregister(workType: string): boolean;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,WAAW,2BAA2B;IACxC,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,CAAC;IACjB,4FAA4F;IAC5F,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,+DAA+D;IAC/D,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI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
|
+
* Record Set Processing substrate about new work types WITHOUT the base package depending on them.
|
|
4
|
+
*
|
|
5
|
+
* The engine's `RecordProcessExecutor.buildProcessor()` handles the built-in work types
|
|
6
|
+
* (`FieldRules` / `Action` / `Agent` / `Infer`) directly, then consults this registry for any work
|
|
7
|
+
* type its switch doesn't recognize before failing. A consumer package (e.g. Predictive Studio's
|
|
8
|
+
* `'ML Model'` scoring) registers a factory keyed by its work-type string; the factory closes over
|
|
9
|
+
* whatever injected dependencies that consumer needs (sidecars, loaders, etc.) and constructs its
|
|
10
|
+
* `IRecordProcessor` from the per-run build context.
|
|
11
|
+
*
|
|
12
|
+
* @module @memberjunction/record-set-processor-base
|
|
13
|
+
*/
|
|
14
|
+
import { BaseSingleton } from '@memberjunction/global';
|
|
15
|
+
/**
|
|
16
|
+
* Process-wide registry of work-type → processor factory, used by the engine's `buildProcessor()` to
|
|
17
|
+
* resolve work types beyond its built-ins. A {@link BaseSingleton} so there is exactly one instance
|
|
18
|
+
* across the process even when a bundler duplicates the module (per CLAUDE.md rule 7).
|
|
19
|
+
*
|
|
20
|
+
* Work-type keys are matched case-insensitively (trimmed), so a consumer can register `'ML Model'`
|
|
21
|
+
* and the executor resolves it whether the Record Process row stores `'ML Model'` or `'ml model'`.
|
|
22
|
+
*/
|
|
23
|
+
export class RecordProcessorRegistry extends BaseSingleton {
|
|
24
|
+
/** @internal — use {@link RecordProcessorRegistry.Instance}. */
|
|
25
|
+
constructor() {
|
|
26
|
+
super();
|
|
27
|
+
/** work-type (normalized) → factory. */
|
|
28
|
+
this.factories = new Map();
|
|
29
|
+
}
|
|
30
|
+
/** The single process-wide registry instance. */
|
|
31
|
+
static get Instance() {
|
|
32
|
+
return super.getInstance();
|
|
33
|
+
}
|
|
34
|
+
/** Normalize a work-type key for case/whitespace-insensitive matching. */
|
|
35
|
+
normalize(workType) {
|
|
36
|
+
return workType.trim().toLowerCase();
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Register a factory for a work-type key. A later registration for the same key overrides the
|
|
40
|
+
* earlier one (last-wins), which lets a consumer replace a default.
|
|
41
|
+
*
|
|
42
|
+
* @param workType the work-type string (e.g. `'ML Model'`), matched case-insensitively
|
|
43
|
+
* @param factory builds the processor for that work type from the per-run context
|
|
44
|
+
*/
|
|
45
|
+
Register(workType, factory) {
|
|
46
|
+
if (!workType || !workType.trim()) {
|
|
47
|
+
throw new Error('RecordProcessorRegistry.Register: workType must be a non-empty string');
|
|
48
|
+
}
|
|
49
|
+
this.factories.set(this.normalize(workType), factory);
|
|
50
|
+
}
|
|
51
|
+
/** Whether a factory is registered for the given work type (case-insensitive). */
|
|
52
|
+
Has(workType) {
|
|
53
|
+
return workType != null && this.factories.has(this.normalize(workType));
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Resolve and invoke the factory for a work type, returning the built processor or `null` when no
|
|
57
|
+
* factory is registered (or the factory itself declined by returning null/undefined).
|
|
58
|
+
*
|
|
59
|
+
* @param context the per-run build context (work type + Record Process fields)
|
|
60
|
+
*/
|
|
61
|
+
Resolve(context) {
|
|
62
|
+
const factory = context.WorkType != null ? this.factories.get(this.normalize(context.WorkType)) : undefined;
|
|
63
|
+
if (!factory) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
return factory(context) ?? null;
|
|
67
|
+
}
|
|
68
|
+
/** The set of registered work-type keys (normalized). Primarily for diagnostics/tests. */
|
|
69
|
+
get RegisteredWorkTypes() {
|
|
70
|
+
return Array.from(this.factories.keys());
|
|
71
|
+
}
|
|
72
|
+
/** Remove a registration (case-insensitive). Returns whether one was present. Primarily for tests. */
|
|
73
|
+
Unregister(workType) {
|
|
74
|
+
return this.factories.delete(this.normalize(workType));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;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ChB,CAAC;QACD,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC;IACpC,CAAC;IAED,0FAA0F;IAC1F,IAAW,mBAAmB;QAC1B,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED,sGAAsG;IAC/F,UAAU,CAAC,QAAgB;QAC9B,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC3D,CAAC;CACJ"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/record-set-processor-base",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.44.0",
|
|
5
5
|
"description": "MemberJunction: Record Set Processor Base - interfaces, types, and source adapters for batched, resumable record-set processing. Client-safe.",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"author": "MemberJunction.com",
|
|
18
18
|
"license": "ISC",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@memberjunction/core": "5.
|
|
21
|
-
"@memberjunction/global": "5.
|
|
20
|
+
"@memberjunction/core": "5.44.0",
|
|
21
|
+
"@memberjunction/global": "5.44.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@types/node": "24.10.11",
|