@memberjunction/record-set-processor 6.2.0-edge.4 → 6.2.0-edge.6
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 +36 -1
- package/dist/RecordProcessExecutor.d.ts +35 -17
- package/dist/RecordProcessExecutor.d.ts.map +1 -1
- package/dist/RecordProcessExecutor.js +79 -63
- package/dist/RecordProcessExecutor.js.map +1 -1
- package/dist/RecordSetProcessor.d.ts +15 -0
- package/dist/RecordSetProcessor.d.ts.map +1 -1
- package/dist/RecordSetProcessor.js +161 -81
- package/dist/RecordSetProcessor.js.map +1 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -4
- package/dist/index.js.map +1 -1
- package/dist/operations/RecordProcessControlOperations.d.ts.map +1 -1
- package/dist/operations/RecordProcessControlOperations.js +9 -7
- package/dist/operations/RecordProcessControlOperations.js.map +1 -1
- package/dist/processors/ActionRecordProcessor.d.ts.map +1 -1
- package/dist/processors/ActionRecordProcessor.js +6 -2
- package/dist/processors/ActionRecordProcessor.js.map +1 -1
- package/dist/processors/AgentRecordProcessor.d.ts.map +1 -1
- package/dist/processors/AgentRecordProcessor.js +5 -2
- package/dist/processors/AgentRecordProcessor.js.map +1 -1
- package/dist/processors/FieldRulesProcessor.d.ts +22 -7
- package/dist/processors/FieldRulesProcessor.d.ts.map +1 -1
- package/dist/processors/FieldRulesProcessor.js +24 -13
- package/dist/processors/FieldRulesProcessor.js.map +1 -1
- package/dist/processors/WriteBackProcessor.d.ts +62 -2
- package/dist/processors/WriteBackProcessor.d.ts.map +1 -1
- package/dist/processors/WriteBackProcessor.js +134 -58
- package/dist/processors/WriteBackProcessor.js.map +1 -1
- package/dist/trackers/GenericProcessRunTracker.d.ts.map +1 -1
- package/dist/trackers/GenericProcessRunTracker.js +22 -3
- package/dist/trackers/GenericProcessRunTracker.js.map +1 -1
- package/dist/watermark/WatermarkService.d.ts +62 -24
- package/dist/watermark/WatermarkService.d.ts.map +1 -1
- package/dist/watermark/WatermarkService.js +123 -70
- package/dist/watermark/WatermarkService.js.map +1 -1
- package/dist/writeBack.d.ts +358 -42
- package/dist/writeBack.d.ts.map +1 -1
- package/dist/writeBack.js +848 -208
- package/dist/writeBack.js.map +1 -1
- package/package.json +16 -17
- package/dist/feature-pipeline-drivers/BaseFeaturePipelineDriver.d.ts +0 -92
- package/dist/feature-pipeline-drivers/BaseFeaturePipelineDriver.d.ts.map +0 -1
- package/dist/feature-pipeline-drivers/BaseFeaturePipelineDriver.js +0 -26
- package/dist/feature-pipeline-drivers/BaseFeaturePipelineDriver.js.map +0 -1
- package/dist/feature-pipeline-drivers/DecisionFeaturePipelineDriver.d.ts +0 -79
- package/dist/feature-pipeline-drivers/DecisionFeaturePipelineDriver.d.ts.map +0 -1
- package/dist/feature-pipeline-drivers/DecisionFeaturePipelineDriver.js +0 -257
- package/dist/feature-pipeline-drivers/DecisionFeaturePipelineDriver.js.map +0 -1
- package/dist/feature-pipeline-drivers/LLMFeaturePipelineDriver.d.ts +0 -23
- package/dist/feature-pipeline-drivers/LLMFeaturePipelineDriver.d.ts.map +0 -1
- package/dist/feature-pipeline-drivers/LLMFeaturePipelineDriver.js +0 -85
- package/dist/feature-pipeline-drivers/LLMFeaturePipelineDriver.js.map +0 -1
- package/dist/processors/FeaturePipelineEscalation.d.ts +0 -155
- package/dist/processors/FeaturePipelineEscalation.d.ts.map +0 -1
- package/dist/processors/FeaturePipelineEscalation.js +0 -208
- package/dist/processors/FeaturePipelineEscalation.js.map +0 -1
- package/dist/processors/InferProcessor.d.ts +0 -306
- package/dist/processors/InferProcessor.d.ts.map +0 -1
- package/dist/processors/InferProcessor.js +0 -1210
- package/dist/processors/InferProcessor.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentRecordProcessor.d.ts","sourceRoot":"","sources":["../../src/processors/AgentRecordProcessor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA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M,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,EAAE,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAQrH,yCAAyC;WAC3B,SAAS,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,EAAE,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAIxG,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,YAAY,CAAC;CAyBxG"}
|
|
@@ -32,7 +32,7 @@ export class AgentRecordProcessor {
|
|
|
32
32
|
return this.BuildData(inputMapping, record);
|
|
33
33
|
}
|
|
34
34
|
async ProcessRecord(record, context) {
|
|
35
|
-
await AIEngine.Instance.Config(false, context.
|
|
35
|
+
await AIEngine.Instance.Config(false, context.ContextUser);
|
|
36
36
|
const agent = AIEngine.Instance.Agents.find((a) => UUIDsEqual(a.ID, this.agentID));
|
|
37
37
|
if (!agent) {
|
|
38
38
|
return { Status: 'Failed', ErrorMessage: `Agent '${this.agentID}' not found` };
|
|
@@ -41,8 +41,11 @@ export class AgentRecordProcessor {
|
|
|
41
41
|
const result = await runner.RunAgent({
|
|
42
42
|
agent,
|
|
43
43
|
conversationMessages: [],
|
|
44
|
-
contextUser: context.
|
|
44
|
+
contextUser: context.ContextUser,
|
|
45
45
|
data: AgentRecordProcessor.buildData(this.inputMapping, record),
|
|
46
|
+
// `data` is built on the server from the Record Process's admin-configured input mapping, so its reserved
|
|
47
|
+
// keys (a per-record tenant mapped into PrimaryScopeRecordID, say) are honoured rather than stripped.
|
|
48
|
+
TrustReservedRunData: true,
|
|
46
49
|
});
|
|
47
50
|
return {
|
|
48
51
|
Status: result.success ? 'Succeeded' : 'Failed',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentRecordProcessor.js","sourceRoot":"","sources":["../../src/processors/AgentRecordPro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AC,CAAC,CAAC,QAAQ;YAC/C,aAAa,EAAE,MAAM,CAAC,OAAO;YAC7B,YAAY,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,YAAY,IAAI,cAAc,CAAC;YAC5F,YAAY,EAAE,MAAM,CAAC,QAAQ,EAAE,EAAE;SACpC,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview FieldRulesProcessor — applies a declarative {@link FieldRuleSet} to each record: the
|
|
3
|
+
* rules-based bulk-update unit of work for the Record Set Processor.
|
|
4
|
+
*
|
|
5
|
+
* It is intentionally thin: the record set + batching / concurrency / pause-resume come from the engine,
|
|
6
|
+
* and the actual rule logic (compute → metadata-validate → type-coerce → write/preview, plus the
|
|
7
|
+
* RunView-backed lookup resolver) lives in {@link EntityFieldRules} in `@memberjunction/core`. This
|
|
8
|
+
* processor just maps a {@link RecordRef} to a loaded entity and translates the apply result into a
|
|
9
|
+
* {@link RecordResult}. The transform/rule substrate beneath `EntityFieldRules` is the pure
|
|
10
|
+
* field-rules engine in `@memberjunction/global` — the same one the integration field-mapping engine uses.
|
|
11
|
+
* @module @memberjunction/record-set-processor
|
|
12
|
+
*/
|
|
13
|
+
import { type UserInfo } from '@memberjunction/core';
|
|
14
|
+
import { type FieldRuleSet } from '@memberjunction/global';
|
|
2
15
|
import { type IRecordProcessor, type RecordProcessorContext, type RecordRef, type RecordResult } from '@memberjunction/record-set-processor-base';
|
|
3
16
|
/** Options for a {@link FieldRulesProcessor}. */
|
|
4
17
|
export interface FieldRulesProcessorOptions {
|
|
@@ -7,12 +20,6 @@ export interface FieldRulesProcessorOptions {
|
|
|
7
20
|
/** When true, COMPUTE the changes but do NOT save — each result payload carries the per-field diff. */
|
|
8
21
|
DryRun?: boolean;
|
|
9
22
|
}
|
|
10
|
-
/** The structured payload recorded on each Process Run Detail (the per-record diff). */
|
|
11
|
-
export interface FieldRulesResultPayload {
|
|
12
|
-
DryRun: boolean;
|
|
13
|
-
Changes: FieldChange[];
|
|
14
|
-
ChangedFields: string[];
|
|
15
|
-
}
|
|
16
23
|
/**
|
|
17
24
|
* Applies field rules to a single record via {@link EntityFieldRules}. Single-primary-key entities only
|
|
18
25
|
* (composite keys return a clear Failed result). On a real run the record is persisted via
|
|
@@ -40,5 +47,13 @@ export declare class FieldRulesProcessor implements IRecordProcessor {
|
|
|
40
47
|
* fed into a `prompt` source's `Data` to give the LLM a curated rendering of the record.
|
|
41
48
|
*/
|
|
42
49
|
private buildEntityDocumentResolver;
|
|
50
|
+
/**
|
|
51
|
+
* Renders an Entity Document's template against a record. The text feeds a prompt source's `Data`, so it renders
|
|
52
|
+
* without HTML escaping (`Affineur & Owner`, not `Affineur & Owner`).
|
|
53
|
+
* @param templateText the document's template text
|
|
54
|
+
* @param record the record the template reads
|
|
55
|
+
* @param contextUser the user the render runs as; the template engine is shared, so it is never taken from the engine
|
|
56
|
+
*/
|
|
57
|
+
protected RenderEntityDocument(templateText: string, record: Record<string, unknown>, contextUser?: UserInfo): Promise<string>;
|
|
43
58
|
}
|
|
44
59
|
//# sourceMappingURL=FieldRulesProcessor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldRulesProcessor.d.ts","sourceRoot":"","sources":["../../src/processors/FieldRulesProcessor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FieldRulesProcessor.d.ts","sourceRoot":"","sources":["../../src/processors/FieldRulesProcessor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAA2E,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC9H,OAAO,EAAc,KAAK,YAAY,EAAuB,MAAM,wBAAwB,CAAC;AAO5F,OAAO,EAEH,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,SAAS,EACd,KAAK,YAAY,EACpB,MAAM,2CAA2C,CAAC;AAEnD,iDAAiD;AACjD,MAAM,WAAW,0BAA0B;IACvC,yCAAyC;IACzC,OAAO,EAAE,YAAY,CAAC;IACtB,uGAAuG;IACvG,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,qBAAa,mBAAoB,YAAW,gBAAgB;IAC5C,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,0BAA0B;IAMnD,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,YAAY,CAAC;IAgBrG,wEAAwE;IACxE,OAAO,CAAC,cAAc;IAkBtB,qEAAqE;YACvD,UAAU;IAgBxB;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB;IAmB3B;;;;;OAKG;IACH,OAAO,CAAC,2BAA2B;IAenC;;;;;;OAMG;cACa,oBAAoB,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;CAOvI"}
|
|
@@ -36,8 +36,9 @@ export class FieldRulesProcessor {
|
|
|
36
36
|
if (typeof obj === 'string') {
|
|
37
37
|
return { Status: 'Failed', ErrorMessage: obj, DurationMs: Date.now() - started };
|
|
38
38
|
}
|
|
39
|
-
const rules = new EntityFieldRules(context.
|
|
40
|
-
|
|
39
|
+
const rules = new EntityFieldRules(context.ContextUser, this.buildPromptResolver(context), this.buildEntityDocumentResolver(context));
|
|
40
|
+
// A dry-run context previews too, whatever this processor was built with
|
|
41
|
+
const result = await rules.ApplyToEntity(obj, this.options.RuleSet, { DryRun: this.options.DryRun === true || context.DryRun === true });
|
|
41
42
|
return this.toRecordResult(result, started);
|
|
42
43
|
}
|
|
43
44
|
catch (err) {
|
|
@@ -64,14 +65,14 @@ export class FieldRulesProcessor {
|
|
|
64
65
|
}
|
|
65
66
|
/** Loads the BaseEntity for a record, or returns an error string. */
|
|
66
67
|
async loadRecord(record, context) {
|
|
67
|
-
const entity = context.
|
|
68
|
+
const entity = context.Provider.EntityByID(record.EntityID);
|
|
68
69
|
if (!entity) {
|
|
69
70
|
return `entity '${record.EntityID}' not found in metadata`;
|
|
70
71
|
}
|
|
71
72
|
if (entity.PrimaryKeys.length !== 1) {
|
|
72
73
|
return `field-rules updates support single-primary-key entities only ('${entity.Name}')`;
|
|
73
74
|
}
|
|
74
|
-
const obj = await context.
|
|
75
|
+
const obj = await context.Provider.GetEntityObject(entity.Name, context.ContextUser);
|
|
75
76
|
const loaded = await obj.InnerLoad(CompositeKey.FromURLSegment(entity, record.RecordID));
|
|
76
77
|
if (!loaded) {
|
|
77
78
|
return `record '${record.RecordID}' of '${entity.Name}' not found`;
|
|
@@ -86,7 +87,7 @@ export class FieldRulesProcessor {
|
|
|
86
87
|
*/
|
|
87
88
|
buildPromptResolver(context) {
|
|
88
89
|
return async ({ PromptID, Data }) => {
|
|
89
|
-
await AIEngine.Instance.Config(false, context.
|
|
90
|
+
await AIEngine.Instance.Config(false, context.ContextUser);
|
|
90
91
|
const prompt = AIEngine.Instance.Prompts.find((p) => UUIDsEqual(p.ID, PromptID));
|
|
91
92
|
if (!prompt) {
|
|
92
93
|
throw new Error(`AI Prompt '${PromptID}' not found`);
|
|
@@ -94,7 +95,7 @@ export class FieldRulesProcessor {
|
|
|
94
95
|
const params = new AIPromptParams();
|
|
95
96
|
params.prompt = prompt;
|
|
96
97
|
params.data = Data;
|
|
97
|
-
params.contextUser = context.
|
|
98
|
+
params.contextUser = context.ContextUser;
|
|
98
99
|
const result = await new AIPromptRunner().ExecutePrompt(params);
|
|
99
100
|
if (!result.success) {
|
|
100
101
|
throw new Error(result.errorMessage ?? 'AI prompt execution failed');
|
|
@@ -114,17 +115,27 @@ export class FieldRulesProcessor {
|
|
|
114
115
|
throw new Error('an entityDocument source requires an EntityDocumentID');
|
|
115
116
|
}
|
|
116
117
|
// Configure the template engine first so the EntityDocument's virtual TemplateText resolves.
|
|
117
|
-
await TemplateEngineServer.Instance.Config(false, context.
|
|
118
|
-
const doc = await context.
|
|
118
|
+
await TemplateEngineServer.Instance.Config(false, context.ContextUser);
|
|
119
|
+
const doc = await context.Provider.GetEntityObject('MJ: Entity Documents', context.ContextUser);
|
|
119
120
|
if (!(await doc.Load(EntityDocumentID))) {
|
|
120
121
|
throw new Error(`Entity Document '${EntityDocumentID}' not found`);
|
|
121
122
|
}
|
|
122
|
-
|
|
123
|
-
if (!rendered.Success) {
|
|
124
|
-
throw new Error(rendered.Message ?? 'entity document render failed');
|
|
125
|
-
}
|
|
126
|
-
return rendered.Output ?? '';
|
|
123
|
+
return this.RenderEntityDocument(doc.TemplateText, Record, context.ContextUser);
|
|
127
124
|
};
|
|
128
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* Renders an Entity Document's template against a record. The text feeds a prompt source's `Data`, so it renders
|
|
128
|
+
* without HTML escaping (`Affineur & Owner`, not `Affineur & Owner`).
|
|
129
|
+
* @param templateText the document's template text
|
|
130
|
+
* @param record the record the template reads
|
|
131
|
+
* @param contextUser the user the render runs as; the template engine is shared, so it is never taken from the engine
|
|
132
|
+
*/
|
|
133
|
+
async RenderEntityDocument(templateText, record, contextUser) {
|
|
134
|
+
const rendered = await TemplateEngineServer.Instance.RenderTemplateSimple(templateText, record, { autoescape: false, ContextUser: contextUser });
|
|
135
|
+
if (!rendered.Success) {
|
|
136
|
+
throw new Error(rendered.Message ?? 'entity document render failed');
|
|
137
|
+
}
|
|
138
|
+
return rendered.Output ?? '';
|
|
139
|
+
}
|
|
129
140
|
}
|
|
130
141
|
//# sourceMappingURL=FieldRulesProcessor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldRulesProcessor.js","sourceRoot":"","sources":["../../src/processors/FieldRulesProcessor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAc,YAA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E,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAiC,sBAAsB,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;YAChI,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC;gBACtC,MAAM,IAAI,KAAK,CAAC,oBAAoB,gBAAgB,aAAa,CAAC,CAAC;YACvE,CAAC;YACD,OAAO,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;QACpF,CAAC,CAAC;IACN,CAAC;IAED;;;;;;OAMG;IACO,KAAK,CAAC,oBAAoB,CAAC,YAAoB,EAAE,MAA+B,EAAE,WAAsB;QAC9G,MAAM,QAAQ,GAAG,MAAM,oBAAoB,CAAC,QAAQ,CAAC,oBAAoB,CAAC,YAAY,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC,CAAC;QACjJ,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,OAAO,IAAI,+BAA+B,CAAC,CAAC;QACzE,CAAC;QACD,OAAO,QAAQ,CAAC,MAAM,IAAI,EAAE,CAAC;IACjC,CAAC;CACJ"}
|
|
@@ -4,8 +4,23 @@
|
|
|
4
4
|
* result's payload. Lets any work type share the same declarative write-back.
|
|
5
5
|
* @module @memberjunction/record-set-processor
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
7
|
+
import { type IMetadataProvider } from '@memberjunction/core';
|
|
8
|
+
import { IRecordProcessor, ProcessorRunSummaryContext, RecordProcessorContext, RecordRef, RecordResult } from '@memberjunction/record-set-processor-base';
|
|
8
9
|
import { OutputMappingConfig, RunProvenance } from '../writeBack.js';
|
|
10
|
+
/** Counts of deferred record values written inside a write-back transaction. */
|
|
11
|
+
export interface DeferredRecordWriteOutcome {
|
|
12
|
+
Upserted: number;
|
|
13
|
+
Unchanged: number;
|
|
14
|
+
}
|
|
15
|
+
/** A processor whose per-record values commit with the record's write-back (e.g. InferProcessor's Feature Values). */
|
|
16
|
+
export interface DeferredRecordWriteSource {
|
|
17
|
+
/** From now on, queue the per-record writes instead of saving them immediately. */
|
|
18
|
+
DeferRecordWritesToWriteBack(): void;
|
|
19
|
+
/** Saves a record's queued writes on the write-back unit's provider; null when none were queued. */
|
|
20
|
+
WriteDeferredRecordValues(recordID: string, provider: IMetadataProvider): Promise<DeferredRecordWriteOutcome | null>;
|
|
21
|
+
/** Drops a record's queued writes (its result failed, so it gets no write-back). */
|
|
22
|
+
DiscardDeferredRecordValues(recordID: string): void;
|
|
23
|
+
}
|
|
9
24
|
/** Wraps a processor and applies output-mapping write-back to each successful result. */
|
|
10
25
|
export declare class WriteBackProcessor implements IRecordProcessor {
|
|
11
26
|
private readonly inner;
|
|
@@ -17,18 +32,63 @@ export declare class WriteBackProcessor implements IRecordProcessor {
|
|
|
17
32
|
* @param outputMapping - The `OutputMapping` config to apply to each successful result.
|
|
18
33
|
* @param dryRun - When true, the inner work still runs but the write-back only computes a
|
|
19
34
|
* preview (no entity is saved / no child is created), so a dry-run of any wrapped work type
|
|
20
|
-
* reports its effect without mutating data
|
|
35
|
+
* reports its effect without mutating data, and fails a record whose real write would fail.
|
|
36
|
+
* Mirrors `FieldRulesProcessor`'s dry-run. A dry-run context previews too.
|
|
21
37
|
* @param run - Optional run provenance information stamped on write-back operations.
|
|
22
38
|
*/
|
|
23
39
|
constructor(inner: IRecordProcessor, outputMapping: OutputMappingConfig, dryRun?: boolean, run?: RunProvenance);
|
|
24
40
|
private readonly _lookupCache;
|
|
25
41
|
get OutputMapping(): OutputMappingConfig;
|
|
42
|
+
get DefaultDryRunSampleSize(): number | undefined;
|
|
43
|
+
get FailRunOnRecordError(): boolean | undefined;
|
|
26
44
|
GetWriteBackFields(): string[];
|
|
27
45
|
/** @deprecated Use {@link GetWriteBackFields}. */
|
|
28
46
|
getWriteBackFields(): string[];
|
|
47
|
+
/** Whether the wrapped processor exposes a custom basis hash calculator. */
|
|
48
|
+
CanComputeBasisHash(): boolean;
|
|
49
|
+
/** Forwards output mapping preparation to the wrapped processor, when it declares one. */
|
|
50
|
+
PrepareOutputMapping(mapping: Record<string, unknown> | undefined): {
|
|
51
|
+
OutputMapping?: Record<string, unknown>;
|
|
52
|
+
HasUnmappedWrites?: boolean;
|
|
53
|
+
};
|
|
54
|
+
/** Forwards run summary building to the wrapped processor, when it declares one. */
|
|
55
|
+
BuildRunSummary(context: ProcessorRunSummaryContext): {
|
|
56
|
+
ResultSummary?: unknown;
|
|
57
|
+
WouldRefuse?: string;
|
|
58
|
+
};
|
|
29
59
|
/** Forwards the run-level readiness check to the wrapped processor, when it declares one. */
|
|
30
60
|
Preflight(context: RecordProcessorContext): Promise<void>;
|
|
31
61
|
ProcessRecord(record: RecordRef, context: RecordProcessorContext): Promise<RecordResult>;
|
|
62
|
+
/**
|
|
63
|
+
* Runs one successful result's write-back (`beforeWriteBack`, then {@link ApplyWriteBack}) and turns a write-back
|
|
64
|
+
* error into the record's failure; the one path of {@link ProcessRecord} and {@link ProcessBatch}.
|
|
65
|
+
*/
|
|
66
|
+
protected WriteBackOne(record: RecordRef, result: RecordResult, context: RecordProcessorContext): Promise<RecordResult>;
|
|
67
|
+
/** A record whose write-back is over or will not run: the inner processor's queued values for it are dropped. */
|
|
68
|
+
protected WithoutWriteBack(record: RecordRef, result: RecordResult): RecordResult;
|
|
69
|
+
/** The provenance a result's write-back maps via `$run.*`: the result's own links, else the run's. */
|
|
70
|
+
protected RunProvenanceFor(result: RecordResult, context: RecordProcessorContext): RunProvenance;
|
|
71
|
+
/**
|
|
72
|
+
* Applies the OutputMapping to one successful result, with the human-value guard and the run's overwrite switch;
|
|
73
|
+
* the inner processor's deferred record values are written first inside the write-back's unit. The outcome is
|
|
74
|
+
* `Upserted` when anything changed, else `Unchanged`. A dry run carries `DryRun: true` and no `Outcome`, and fails
|
|
75
|
+
* when its preview found what the real write would fail on.
|
|
76
|
+
*/
|
|
77
|
+
protected ApplyWriteBack(record: RecordRef, result: RecordResult, context: RecordProcessorContext, run: RunProvenance): Promise<RecordResult>;
|
|
78
|
+
/** The result without an `Outcome`: a dry run wrote nothing, so it claims neither Upserted nor Unchanged. */
|
|
79
|
+
protected static WithoutOutcome(result: RecordResult): Omit<RecordResult, 'Outcome'>;
|
|
80
|
+
/** The record's outcome after write-back: see {@link ApplyWriteBack}; the inner outcome when neither wrote anything. */
|
|
81
|
+
protected static OutcomeOf(changed: boolean, deferredValues: DeferredRecordWriteOutcome | null, result: RecordResult): RecordResult['Outcome'];
|
|
82
|
+
/** Whether a processor defers per-record values to its write-back (a capability check, not a class check). */
|
|
83
|
+
private static defersRecordWrites;
|
|
84
|
+
/** Whether a processor has the `beforeWriteBack` hook (InferProcessor and its extensions). */
|
|
85
|
+
private static hasBeforeWriteBack;
|
|
86
|
+
/** Whether a processor's results can withhold write-back targets (a capability check, not a class check). */
|
|
87
|
+
private static supportsWithheldTargets;
|
|
88
|
+
/** Whether a processor can preview, on a dry run, its deferred record values. */
|
|
89
|
+
private static supportsRecordValuePreview;
|
|
90
|
+
/** Whether a processor can say which target values a person entered (a capability check, not a class check). */
|
|
91
|
+
private static supportsHumanValueGuard;
|
|
32
92
|
/**
|
|
33
93
|
* Delegates basis hash computation to the inner processor if supported.
|
|
34
94
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WriteBackProcessor.d.ts","sourceRoot":"","sources":["../../src/processors/WriteBackProcessor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"WriteBackProcessor.d.ts","sourceRoot":"","sources":["../../src/processors/WriteBackProcessor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,iBAAiB,EAAY,MAAM,sBAAsB,CAAC;AACxE,OAAO,EACH,gBAA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I,EAAE,MAAM,EAAE,YAAY,GAAG,YAAY,CAAC,SAAS,CAAC;IAO9I,8GAA8G;IAC9G,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAIjC,8FAA8F;IAC9F,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAIjC,6GAA6G;IAC7G,OAAO,CAAC,MAAM,CAAC,uBAAuB;IAItC,iFAAiF;IACjF,OAAO,CAAC,MAAM,CAAC,0BAA0B;IAIzC,gHAAgH;IAChH,OAAO,CAAC,MAAM,CAAC,uBAAuB;IAItC;;OAEG;IACU,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAO9G;;;OAGG;IACU,YAAY,CAAC,OAAO,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IA0BpH;;;;OAIG;IACH,OAAO,CAAC,WAAW;CAYtB"}
|
|
@@ -13,7 +13,8 @@ export class WriteBackProcessor {
|
|
|
13
13
|
* @param outputMapping - The `OutputMapping` config to apply to each successful result.
|
|
14
14
|
* @param dryRun - When true, the inner work still runs but the write-back only computes a
|
|
15
15
|
* preview (no entity is saved / no child is created), so a dry-run of any wrapped work type
|
|
16
|
-
* reports its effect without mutating data
|
|
16
|
+
* reports its effect without mutating data, and fails a record whose real write would fail.
|
|
17
|
+
* Mirrors `FieldRulesProcessor`'s dry-run. A dry-run context previews too.
|
|
17
18
|
* @param run - Optional run provenance information stamped on write-back operations.
|
|
18
19
|
*/
|
|
19
20
|
constructor(inner, outputMapping, dryRun = false, run) {
|
|
@@ -22,10 +23,19 @@ export class WriteBackProcessor {
|
|
|
22
23
|
this.dryRun = dryRun;
|
|
23
24
|
this.run = run;
|
|
24
25
|
this._lookupCache = new Map();
|
|
26
|
+
if (WriteBackProcessor.defersRecordWrites(inner)) {
|
|
27
|
+
inner.DeferRecordWritesToWriteBack();
|
|
28
|
+
}
|
|
25
29
|
}
|
|
26
30
|
get OutputMapping() {
|
|
27
31
|
return this.outputMapping;
|
|
28
32
|
}
|
|
33
|
+
get DefaultDryRunSampleSize() {
|
|
34
|
+
return this.inner.DefaultDryRunSampleSize;
|
|
35
|
+
}
|
|
36
|
+
get FailRunOnRecordError() {
|
|
37
|
+
return this.inner.FailRunOnRecordError;
|
|
38
|
+
}
|
|
29
39
|
GetWriteBackFields() {
|
|
30
40
|
return Object.keys(this.outputMapping.fields ?? {});
|
|
31
41
|
}
|
|
@@ -33,6 +43,18 @@ export class WriteBackProcessor {
|
|
|
33
43
|
getWriteBackFields() {
|
|
34
44
|
return this.GetWriteBackFields();
|
|
35
45
|
}
|
|
46
|
+
/** Whether the wrapped processor exposes a custom basis hash calculator. */
|
|
47
|
+
CanComputeBasisHash() {
|
|
48
|
+
return typeof this.inner.ComputeBasisHash === 'function';
|
|
49
|
+
}
|
|
50
|
+
/** Forwards output mapping preparation to the wrapped processor, when it declares one. */
|
|
51
|
+
PrepareOutputMapping(mapping) {
|
|
52
|
+
return this.inner.PrepareOutputMapping ? this.inner.PrepareOutputMapping(mapping) : { OutputMapping: mapping };
|
|
53
|
+
}
|
|
54
|
+
/** Forwards run summary building to the wrapped processor, when it declares one. */
|
|
55
|
+
BuildRunSummary(context) {
|
|
56
|
+
return this.inner.BuildRunSummary ? this.inner.BuildRunSummary(context) : {};
|
|
57
|
+
}
|
|
36
58
|
/** Forwards the run-level readiness check to the wrapped processor, when it declares one. */
|
|
37
59
|
async Preflight(context) {
|
|
38
60
|
if (this.inner.Preflight) {
|
|
@@ -41,45 +63,128 @@ export class WriteBackProcessor {
|
|
|
41
63
|
}
|
|
42
64
|
async ProcessRecord(record, context) {
|
|
43
65
|
const result = await this.inner.ProcessRecord(record, context);
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
66
|
+
return result.Status === 'Succeeded' ? this.WriteBackOne(record, result, context) : this.WithoutWriteBack(record, result);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Runs one successful result's write-back (`beforeWriteBack`, then {@link ApplyWriteBack}) and turns a write-back
|
|
70
|
+
* error into the record's failure; the one path of {@link ProcessRecord} and {@link ProcessBatch}.
|
|
71
|
+
*/
|
|
72
|
+
async WriteBackOne(record, result, context) {
|
|
47
73
|
try {
|
|
48
|
-
|
|
49
|
-
...this.run,
|
|
50
|
-
ProcessRunID: context.processRunID ?? this.run?.ProcessRunID,
|
|
51
|
-
PromptID: result.PromptID ?? this.run?.PromptID,
|
|
52
|
-
AIPromptRunID: result.AIPromptRunID ?? this.run?.AIPromptRunID,
|
|
53
|
-
PromptVersionHash: result.PromptVersionHash ?? this.run?.PromptVersionHash,
|
|
54
|
-
FeatureValueCacheID: result.FeatureValueCacheID ?? this.run?.FeatureValueCacheID,
|
|
55
|
-
ExecutedAt: this.run?.ExecutedAt ?? new Date().toISOString(),
|
|
56
|
-
};
|
|
57
|
-
if ('beforeWriteBack' in this.inner && typeof this.inner.beforeWriteBack === 'function') {
|
|
74
|
+
if (WriteBackProcessor.hasBeforeWriteBack(this.inner)) {
|
|
58
75
|
await this.inner.beforeWriteBack(this.outputMapping, result.ResultPayload, record, context);
|
|
59
76
|
}
|
|
60
|
-
|
|
61
|
-
outputMapping: this.outputMapping,
|
|
62
|
-
result: result.ResultPayload,
|
|
63
|
-
record,
|
|
64
|
-
contextUser: context.contextUser,
|
|
65
|
-
provider: context.provider,
|
|
66
|
-
dryRun: this.dryRun,
|
|
67
|
-
run: runProvenance,
|
|
68
|
-
lookupCache: this._lookupCache,
|
|
69
|
-
});
|
|
70
|
-
return { ...result, ResultPayload: { output: result.ResultPayload, writeBack } };
|
|
77
|
+
return await this.ApplyWriteBack(record, result, context, this.RunProvenanceFor(result, context));
|
|
71
78
|
}
|
|
72
79
|
catch (e) {
|
|
73
80
|
const message = e instanceof Error ? e.message : String(e);
|
|
74
81
|
LogError(`WriteBackProcessor: write-back failed for record '${record.RecordID}': ${message}`);
|
|
75
82
|
return { ...result, Status: 'Failed', ErrorMessage: `Write-back failed: ${message}` };
|
|
76
83
|
}
|
|
84
|
+
finally {
|
|
85
|
+
// A dry-run, or a failure before the unit wrote them, leaves the record's queued values unwritten: drop them.
|
|
86
|
+
this.WithoutWriteBack(record, result);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/** A record whose write-back is over or will not run: the inner processor's queued values for it are dropped. */
|
|
90
|
+
WithoutWriteBack(record, result) {
|
|
91
|
+
if (WriteBackProcessor.defersRecordWrites(this.inner)) {
|
|
92
|
+
this.inner.DiscardDeferredRecordValues(record.RecordID);
|
|
93
|
+
}
|
|
94
|
+
return result;
|
|
95
|
+
}
|
|
96
|
+
/** The provenance a result's write-back maps via `$run.*`: the result's own links, else the run's. */
|
|
97
|
+
RunProvenanceFor(result, context) {
|
|
98
|
+
return {
|
|
99
|
+
...this.run,
|
|
100
|
+
ProcessRunID: context.ProcessRunID ?? this.run?.ProcessRunID,
|
|
101
|
+
PromptID: result.PromptID ?? this.run?.PromptID,
|
|
102
|
+
AIPromptRunID: result.AIPromptRunID ?? this.run?.AIPromptRunID,
|
|
103
|
+
PromptVersionHash: result.PromptVersionHash ?? this.run?.PromptVersionHash,
|
|
104
|
+
FeatureValueCacheID: result.FeatureValueCacheID ?? this.run?.FeatureValueCacheID,
|
|
105
|
+
ExecutedAt: this.run?.ExecutedAt ?? new Date().toISOString(),
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Applies the OutputMapping to one successful result, with the human-value guard and the run's overwrite switch;
|
|
110
|
+
* the inner processor's deferred record values are written first inside the write-back's unit. The outcome is
|
|
111
|
+
* `Upserted` when anything changed, else `Unchanged`. A dry run carries `DryRun: true` and no `Outcome`, and fails
|
|
112
|
+
* when its preview found what the real write would fail on.
|
|
113
|
+
*/
|
|
114
|
+
async ApplyWriteBack(record, result, context, run) {
|
|
115
|
+
const dry = this.dryRun || context.DryRun === true;
|
|
116
|
+
const guard = WriteBackProcessor.supportsHumanValueGuard(this.inner) ? this.inner.CreateHumanValueGuard(record, context) : undefined;
|
|
117
|
+
let deferredValues = null;
|
|
118
|
+
const inner = this.inner;
|
|
119
|
+
const unitWork = WriteBackProcessor.defersRecordWrites(inner)
|
|
120
|
+
? async (unitProvider) => { deferredValues = await inner.WriteDeferredRecordValues(record.RecordID, unitProvider); }
|
|
121
|
+
: undefined;
|
|
122
|
+
// The targets the result withheld (outputs below their confidence floor) are left as they are
|
|
123
|
+
const withheld = WriteBackProcessor.supportsWithheldTargets(inner) ? inner.WithheldWriteBackTargets(result) : undefined;
|
|
124
|
+
const writeBack = await ApplyOutputMapping({
|
|
125
|
+
outputMapping: this.outputMapping, result: result.ResultPayload, record, contextUser: context.ContextUser,
|
|
126
|
+
provider: context.Provider, dryRun: dry, run, lookupCache: this._lookupCache,
|
|
127
|
+
humanGuard: guard, overwriteHumanValues: context.OverwriteHumanValues === true, unitWork, withheld,
|
|
128
|
+
});
|
|
129
|
+
if (dry && WriteBackProcessor.supportsRecordValuePreview(inner)) {
|
|
130
|
+
const preview = inner.PreviewRecordValues(record.RecordID);
|
|
131
|
+
if (preview.length > 0) {
|
|
132
|
+
writeBack.previewValues = preview;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
const payload = { output: result.ResultPayload, writeBack };
|
|
136
|
+
const preserved = (writeBack.preservedHumanFields?.length || 0) + (writeBack.preservedHumanChildIDs?.length || 0);
|
|
137
|
+
if (dry) {
|
|
138
|
+
const previewed = WriteBackProcessor.WithoutOutcome(result);
|
|
139
|
+
if (writeBack.previewErrors && writeBack.previewErrors.length > 0) {
|
|
140
|
+
// A dry run that reports success for a write that would fail tells the operator the opposite of the truth.
|
|
141
|
+
return { ...previewed, Status: 'Failed', ErrorMessage: `Dry run: the real write would fail: ${writeBack.previewErrors.join('; ')}`,
|
|
142
|
+
ResultPayload: payload, DryRun: true };
|
|
143
|
+
}
|
|
144
|
+
return { ...previewed, ResultPayload: payload, HumanValuesPreserved: preserved, DryRun: true };
|
|
145
|
+
}
|
|
146
|
+
return {
|
|
147
|
+
...result, ResultPayload: payload,
|
|
148
|
+
Outcome: WriteBackProcessor.OutcomeOf(writeBack.changed, deferredValues, result), HumanValuesPreserved: preserved,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
/** The result without an `Outcome`: a dry run wrote nothing, so it claims neither Upserted nor Unchanged. */
|
|
152
|
+
static WithoutOutcome(result) {
|
|
153
|
+
const { Outcome: _written, ...rest } = result;
|
|
154
|
+
return rest;
|
|
155
|
+
}
|
|
156
|
+
/** The record's outcome after write-back: see {@link ApplyWriteBack}; the inner outcome when neither wrote anything. */
|
|
157
|
+
static OutcomeOf(changed, deferredValues, result) {
|
|
158
|
+
if (changed || (deferredValues !== null && deferredValues.Upserted > 0)) {
|
|
159
|
+
return 'Upserted';
|
|
160
|
+
}
|
|
161
|
+
return deferredValues !== null && deferredValues.Unchanged > 0 ? 'Unchanged' : result.Outcome;
|
|
162
|
+
}
|
|
163
|
+
/** Whether a processor defers per-record values to its write-back (a capability check, not a class check). */
|
|
164
|
+
static defersRecordWrites(p) {
|
|
165
|
+
return 'DeferRecordWritesToWriteBack' in p && typeof p.DeferRecordWritesToWriteBack === 'function';
|
|
166
|
+
}
|
|
167
|
+
/** Whether a processor has the `beforeWriteBack` hook (InferProcessor and its extensions). */
|
|
168
|
+
static hasBeforeWriteBack(p) {
|
|
169
|
+
return 'beforeWriteBack' in p && typeof p.beforeWriteBack === 'function';
|
|
170
|
+
}
|
|
171
|
+
/** Whether a processor's results can withhold write-back targets (a capability check, not a class check). */
|
|
172
|
+
static supportsWithheldTargets(p) {
|
|
173
|
+
return 'WithheldWriteBackTargets' in p && typeof p.WithheldWriteBackTargets === 'function';
|
|
174
|
+
}
|
|
175
|
+
/** Whether a processor can preview, on a dry run, its deferred record values. */
|
|
176
|
+
static supportsRecordValuePreview(p) {
|
|
177
|
+
return 'PreviewRecordValues' in p && typeof p.PreviewRecordValues === 'function';
|
|
178
|
+
}
|
|
179
|
+
/** Whether a processor can say which target values a person entered (a capability check, not a class check). */
|
|
180
|
+
static supportsHumanValueGuard(p) {
|
|
181
|
+
return 'CreateHumanValueGuard' in p && typeof p.CreateHumanValueGuard === 'function';
|
|
77
182
|
}
|
|
78
183
|
/**
|
|
79
184
|
* Delegates basis hash computation to the inner processor if supported.
|
|
80
185
|
*/
|
|
81
186
|
async ComputeBasisHash(record, context) {
|
|
82
|
-
if (
|
|
187
|
+
if (typeof this.inner.ComputeBasisHash === 'function') {
|
|
83
188
|
return this.inner.ComputeBasisHash(record, context);
|
|
84
189
|
}
|
|
85
190
|
return undefined;
|
|
@@ -89,46 +194,17 @@ export class WriteBackProcessor {
|
|
|
89
194
|
* output mapping write-back to each successful result.
|
|
90
195
|
*/
|
|
91
196
|
async ProcessBatch(records, context) {
|
|
92
|
-
if (
|
|
197
|
+
if (typeof this.inner.ProcessBatch === 'function') {
|
|
93
198
|
const rawResults = await this.inner.ProcessBatch(records, context);
|
|
94
199
|
const innerResults = this.toResultMap(records, rawResults);
|
|
95
200
|
const outResults = new Map();
|
|
96
201
|
for (const record of records) {
|
|
97
202
|
const res = innerResults.get(record.RecordID);
|
|
98
203
|
if (!res || res.Status !== 'Succeeded') {
|
|
99
|
-
outResults.set(record.RecordID, res ?? { Status: 'Failed', ErrorMessage: 'No result returned from batch processor' });
|
|
204
|
+
outResults.set(record.RecordID, this.WithoutWriteBack(record, res ?? { Status: 'Failed', ErrorMessage: 'No result returned from batch processor' }));
|
|
100
205
|
continue;
|
|
101
206
|
}
|
|
102
|
-
|
|
103
|
-
const runProvenance = {
|
|
104
|
-
...this.run,
|
|
105
|
-
ProcessRunID: context.processRunID ?? this.run?.ProcessRunID,
|
|
106
|
-
PromptID: res.PromptID ?? this.run?.PromptID,
|
|
107
|
-
AIPromptRunID: res.AIPromptRunID ?? this.run?.AIPromptRunID,
|
|
108
|
-
PromptVersionHash: res.PromptVersionHash ?? this.run?.PromptVersionHash,
|
|
109
|
-
FeatureValueCacheID: res.FeatureValueCacheID ?? this.run?.FeatureValueCacheID,
|
|
110
|
-
ExecutedAt: this.run?.ExecutedAt ?? new Date().toISOString(),
|
|
111
|
-
};
|
|
112
|
-
if ('beforeWriteBack' in this.inner && typeof this.inner.beforeWriteBack === 'function') {
|
|
113
|
-
await this.inner.beforeWriteBack(this.outputMapping, res.ResultPayload, record, context);
|
|
114
|
-
}
|
|
115
|
-
const writeBack = await ApplyOutputMapping({
|
|
116
|
-
outputMapping: this.outputMapping,
|
|
117
|
-
result: res.ResultPayload,
|
|
118
|
-
record,
|
|
119
|
-
contextUser: context.contextUser,
|
|
120
|
-
provider: context.provider,
|
|
121
|
-
dryRun: this.dryRun,
|
|
122
|
-
run: runProvenance,
|
|
123
|
-
lookupCache: this._lookupCache,
|
|
124
|
-
});
|
|
125
|
-
outResults.set(record.RecordID, { ...res, ResultPayload: { output: res.ResultPayload, writeBack } });
|
|
126
|
-
}
|
|
127
|
-
catch (e) {
|
|
128
|
-
const message = e instanceof Error ? e.message : String(e);
|
|
129
|
-
LogError(`WriteBackProcessor: write-back failed for record '${record.RecordID}': ${message}`);
|
|
130
|
-
outResults.set(record.RecordID, { ...res, Status: 'Failed', ErrorMessage: `Write-back failed: ${message}` });
|
|
131
|
-
}
|
|
207
|
+
outResults.set(record.RecordID, await this.WriteBackOne(record, res, context));
|
|
132
208
|
}
|
|
133
209
|
return outResults;
|
|
134
210
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WriteBackProcessor.js","sourceRoot":"","sources":["../../src/processors/WriteBackProcessor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"WriteBackProcessor.js","sourceRoot":"","sources":["../../src/processors/WriteBackProcessor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAA0B,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAUxE,OAAO,EAAsC,kBAA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