@memberjunction/core 6.3.0-edge.0 → 6.3.0-edge.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generic/baseEngine.d.ts +9 -0
- package/dist/generic/baseEngine.d.ts.map +1 -1
- package/dist/generic/baseEngine.js +23 -1
- package/dist/generic/baseEngine.js.map +1 -1
- package/dist/generic/baseEngineRegistry.d.ts +8 -0
- package/dist/generic/baseEngineRegistry.d.ts.map +1 -1
- package/dist/generic/baseEngineRegistry.js +28 -10
- package/dist/generic/baseEngineRegistry.js.map +1 -1
- package/dist/generic/baseEntity.d.ts +8 -0
- package/dist/generic/baseEntity.d.ts.map +1 -1
- package/dist/generic/baseEntity.js +87 -53
- package/dist/generic/baseEntity.js.map +1 -1
- package/dist/generic/baseRemotableOperation.d.ts +17 -0
- package/dist/generic/baseRemotableOperation.d.ts.map +1 -1
- package/dist/generic/baseRemotableOperation.js +18 -0
- package/dist/generic/baseRemotableOperation.js.map +1 -1
- package/dist/generic/constraintErrorRedaction.d.ts +26 -0
- package/dist/generic/constraintErrorRedaction.d.ts.map +1 -0
- package/dist/generic/constraintErrorRedaction.js +166 -0
- package/dist/generic/constraintErrorRedaction.js.map +1 -0
- package/dist/generic/dataHooks.d.ts +27 -3
- package/dist/generic/dataHooks.d.ts.map +1 -1
- package/dist/generic/dataHooks.js +82 -0
- package/dist/generic/dataHooks.js.map +1 -1
- package/dist/generic/databaseProviderBase.d.ts +59 -1
- package/dist/generic/databaseProviderBase.d.ts.map +1 -1
- package/dist/generic/databaseProviderBase.js +201 -27
- package/dist/generic/databaseProviderBase.js.map +1 -1
- package/dist/generic/entityInfo.d.ts +48 -5
- package/dist/generic/entityInfo.d.ts.map +1 -1
- package/dist/generic/entityInfo.js +181 -49
- package/dist/generic/entityInfo.js.map +1 -1
- package/dist/generic/entitySavePlan.d.ts +6 -0
- package/dist/generic/entitySavePlan.d.ts.map +1 -1
- package/dist/generic/entitySavePlan.js +145 -1
- package/dist/generic/entitySavePlan.js.map +1 -1
- package/dist/generic/interfaces.d.ts +69 -18
- package/dist/generic/interfaces.d.ts.map +1 -1
- package/dist/generic/interfaces.js +9 -9
- package/dist/generic/interfaces.js.map +1 -1
- package/dist/generic/localCacheManager.d.ts +10 -13
- package/dist/generic/localCacheManager.d.ts.map +1 -1
- package/dist/generic/localCacheManager.js +189 -67
- package/dist/generic/localCacheManager.js.map +1 -1
- package/dist/generic/metadata.d.ts +4 -4
- package/dist/generic/metadata.d.ts.map +1 -1
- package/dist/generic/metadata.js +4 -4
- package/dist/generic/metadata.js.map +1 -1
- package/dist/generic/providerBase.d.ts +193 -12
- package/dist/generic/providerBase.d.ts.map +1 -1
- package/dist/generic/providerBase.js +571 -90
- package/dist/generic/providerBase.js.map +1 -1
- package/dist/generic/queryResultEnricher.d.ts +4 -1
- package/dist/generic/queryResultEnricher.d.ts.map +1 -1
- package/dist/generic/queryResultEnricher.js.map +1 -1
- package/dist/generic/queryTemplateContext.d.ts.map +1 -1
- package/dist/generic/queryTemplateContext.js +38 -3
- package/dist/generic/queryTemplateContext.js.map +1 -1
- package/dist/generic/relatedRecordCollection.d.ts +20 -0
- package/dist/generic/relatedRecordCollection.d.ts.map +1 -1
- package/dist/generic/relatedRecordCollection.js +257 -22
- package/dist/generic/relatedRecordCollection.js.map +1 -1
- package/dist/generic/securityInfo.d.ts +49 -2
- package/dist/generic/securityInfo.d.ts.map +1 -1
- package/dist/generic/securityInfo.js +139 -12
- package/dist/generic/securityInfo.js.map +1 -1
- package/dist/generic/telemetryManager.d.ts +40 -4
- package/dist/generic/telemetryManager.d.ts.map +1 -1
- package/dist/generic/telemetryManager.js +68 -15
- package/dist/generic/telemetryManager.js.map +1 -1
- package/dist/generic/transactionGroup.d.ts +41 -23
- package/dist/generic/transactionGroup.d.ts.map +1 -1
- package/dist/generic/transactionGroup.js +133 -70
- package/dist/generic/transactionGroup.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/views/runView.d.ts +8 -0
- package/dist/views/runView.d.ts.map +1 -1
- package/dist/views/runView.js +20 -3
- package/dist/views/runView.js.map +1 -1
- package/package.json +3 -3
- package/readme.md +6 -5
- package/dist/generic/typedQuery.d.ts +0 -151
- package/dist/generic/typedQuery.d.ts.map +0 -1
- package/dist/generic/typedQuery.js +0 -286
- package/dist/generic/typedQuery.js.map +0 -1
|
@@ -124,6 +124,13 @@ export declare abstract class BaseRemotableOperation<TInput = unknown, TOutput =
|
|
|
124
124
|
* `ServerOperationOnly` gates by wrapping entity writes in a generic graph mutation.
|
|
125
125
|
*/
|
|
126
126
|
get GrantsServerWriteAuthority(): boolean;
|
|
127
|
+
/**
|
|
128
|
+
* When `true`, {@link ExecuteRemoteOperationResolver} refuses scoped/anonymous Magic Link
|
|
129
|
+
* sessions (`IsMagicLinkAnonymous || MagicLinkScope`) before invoking this operation.
|
|
130
|
+
* Defaults to `false` so Open Apps visitor operations can execute over scoped Magic Links;
|
|
131
|
+
* artifact and other high-privilege operations override this to `true`.
|
|
132
|
+
*/
|
|
133
|
+
get DisallowMagicLinkScope(): boolean;
|
|
127
134
|
/**
|
|
128
135
|
* Optional allow-list of entity names (or `['*']`) that this Remote Operation is authorized
|
|
129
136
|
* to mutate when `GrantsServerWriteAuthority` is `true`. Forwarded into the active
|
|
@@ -144,6 +151,16 @@ export declare abstract class BaseRemotableOperation<TInput = unknown, TOutput =
|
|
|
144
151
|
readonly ToolDescription?: string;
|
|
145
152
|
/** Optional JSON-Schema object describing `TInput` when exposed as an Agent or MCP tool. */
|
|
146
153
|
readonly ToolInputSchema?: Record<string, RemoteOpToolSchemaValue>;
|
|
154
|
+
/**
|
|
155
|
+
* Returns the resource identifiers checked against API-key scope authorization when
|
|
156
|
+
* {@link RequiredScope} is set (default: `[this.OperationKey]`). Operations that target
|
|
157
|
+
* specific resources (artifacts, collections, etc.) override this to declare all authoritative
|
|
158
|
+
* scope resource IDs from the validated input rather than relying on heuristic field guessing.
|
|
159
|
+
*/
|
|
160
|
+
GetScopeResourceIds(_input: TInput, _context?: {
|
|
161
|
+
provider?: IMetadataProvider;
|
|
162
|
+
user?: UserInfo;
|
|
163
|
+
}): string[] | Promise<string[]>;
|
|
147
164
|
/**
|
|
148
165
|
* Discovers all ClassFactory-registered {@link BaseRemotableOperation} subclasses that opt into
|
|
149
166
|
* AI Agent (`ExposeAsAgentTool`) and/or MCP (`ExposeAsMCPTool`) tool exposure.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseRemotableOperation.d.ts","sourceRoot":"","sources":["../../src/generic/baseRemotableOperation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EACH,iBAAiB,EAEjB,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACjB,MAAM,cAAc,CAAC;AAEtB;;;;;GAKG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;IAC3C,mFAAmF;IACnF,SAAgB,UAAU,EAAE,MAAM,CAAC;gBAEvB,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAKlD;AAED;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IACxC,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,gBAAgB,GAAG,MAAM,GAAG,IAAI,CAAC;IACjD,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,gBAAgB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAClC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,iBAAiB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC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S,EAAE,iBAAiB,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,qBAAqB,GAAG,OAAO,CAAC,OAAO,CAAC;IAO3I;;;;;;;;;OASG;cACa,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,OAAO,CAAC;CAGjH"}
|
|
@@ -81,6 +81,24 @@ export class BaseRemotableOperation {
|
|
|
81
81
|
get GrantsServerWriteAuthority() {
|
|
82
82
|
return true;
|
|
83
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* When `true`, {@link ExecuteRemoteOperationResolver} refuses scoped/anonymous Magic Link
|
|
86
|
+
* sessions (`IsMagicLinkAnonymous || MagicLinkScope`) before invoking this operation.
|
|
87
|
+
* Defaults to `false` so Open Apps visitor operations can execute over scoped Magic Links;
|
|
88
|
+
* artifact and other high-privilege operations override this to `true`.
|
|
89
|
+
*/
|
|
90
|
+
get DisallowMagicLinkScope() {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Returns the resource identifiers checked against API-key scope authorization when
|
|
95
|
+
* {@link RequiredScope} is set (default: `[this.OperationKey]`). Operations that target
|
|
96
|
+
* specific resources (artifacts, collections, etc.) override this to declare all authoritative
|
|
97
|
+
* scope resource IDs from the validated input rather than relying on heuristic field guessing.
|
|
98
|
+
*/
|
|
99
|
+
GetScopeResourceIds(_input, _context) {
|
|
100
|
+
return [this.OperationKey];
|
|
101
|
+
}
|
|
84
102
|
/**
|
|
85
103
|
* Discovers all ClassFactory-registered {@link BaseRemotableOperation} subclasses that opt into
|
|
86
104
|
* AI Agent (`ExposeAsAgentTool`) and/or MCP (`ExposeAsMCPTool`) tool exposure.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseRemotableOperation.js","sourceRoot":"","sources":["../../src/generic/baseRemotableOperation.ts"],"names":[],"mappings":"AAAA,OAAO,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';
|
|
3
|
+
/** What replaces a value list the database echoed in a constraint error. */
|
|
4
|
+
export declare const REDACTED_CONSTRAINT_VALUES = "(values withheld)";
|
|
5
|
+
/**
|
|
6
|
+
* Removes the column values a database constraint error echoes, keeping the rest of the
|
|
7
|
+
* message (constraint name, table, column names) so the caller still learns which rule failed.
|
|
8
|
+
*
|
|
9
|
+
* A duplicate-key error on a unique index lists every value in the index, including the stored
|
|
10
|
+
* value of a column the caller may not be allowed to read. A message with none of the known
|
|
11
|
+
* value lists comes back unchanged.
|
|
12
|
+
*/
|
|
13
|
+
export declare function RedactConstraintValues(message: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* The save- or delete-failure message a caller may see (direct or through a transaction group): unchanged when field-level security withholds no
|
|
16
|
+
* column of this entity from them, otherwise without the executed SQL (see
|
|
17
|
+
* {@link StripExecutedSQL}) and with constraint values removed (see {@link RedactConstraintValues}). The full message still belongs in the server log.
|
|
18
|
+
*/
|
|
19
|
+
export declare function SaveErrorMessageForUser(message: string, entityInfo: EntityInfo, user: UserInfo | undefined): string;
|
|
20
|
+
/**
|
|
21
|
+
* Drops the SQL text a provider appends to an execution error (`Query: …` and `Parameters: …`
|
|
22
|
+
* lines and everything after them). A save's SQL can carry stored values the caller may not
|
|
23
|
+
* read, such as the full-record JSON written to the audit trail.
|
|
24
|
+
*/
|
|
25
|
+
export declare function StripExecutedSQL(message: string): string;
|
|
26
|
+
//# sourceMappingURL=constraintErrorRedaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constraintErrorRedaction.d.ts","sourceRoot":"","sources":["../../src/generic/constraintErrorRedaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,4EAA4E;AAC5E,eAAO,MAAM,0BAA0B,sBAAsB,CAAC;AAiC9D;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAmB9D;AA8FD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,MAAM,CAQnH;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAiBxD"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/** What replaces a value list the database echoed in a constraint error. */
|
|
2
|
+
export const REDACTED_CONSTRAINT_VALUES = '(values withheld)';
|
|
3
|
+
const VALUE_LIST_RULES = [
|
|
4
|
+
{ Label: 'The duplicate key value is ', Open: '(', Close: ')' },
|
|
5
|
+
{ Label: 'Truncated value: ', Open: "'", Close: "'" },
|
|
6
|
+
{ Label: 'Key (', Open: '(', Close: ')', KeyColumns: true, Suffixes: ['already exists', 'is not present', 'is still referenced'] },
|
|
7
|
+
{ Label: 'Failing row contains ', Open: '(', Close: ')' },
|
|
8
|
+
];
|
|
9
|
+
/**
|
|
10
|
+
* Removes the column values a database constraint error echoes, keeping the rest of the
|
|
11
|
+
* message (constraint name, table, column names) so the caller still learns which rule failed.
|
|
12
|
+
*
|
|
13
|
+
* A duplicate-key error on a unique index lists every value in the index, including the stored
|
|
14
|
+
* value of a column the caller may not be allowed to read. A message with none of the known
|
|
15
|
+
* value lists comes back unchanged.
|
|
16
|
+
*/
|
|
17
|
+
export function RedactConstraintValues(message) {
|
|
18
|
+
if (!message) {
|
|
19
|
+
return message;
|
|
20
|
+
}
|
|
21
|
+
const lines = message.split('\n');
|
|
22
|
+
const out = [];
|
|
23
|
+
for (const line of lines) {
|
|
24
|
+
const redacted = VALUE_LIST_RULES.reduce((current, rule) => redactLine(current, rule), line);
|
|
25
|
+
// A value can itself contain a line break, so its list does not close on this line. The
|
|
26
|
+
// rest of the message may be part of that value, so everything from the opening
|
|
27
|
+
// character on is withheld.
|
|
28
|
+
const unclosedAt = findUnclosedValueList(redacted);
|
|
29
|
+
if (unclosedAt >= 0) {
|
|
30
|
+
out.push(redacted.slice(0, unclosedAt) + REDACTED_CONSTRAINT_VALUES);
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
out.push(redacted);
|
|
34
|
+
}
|
|
35
|
+
return out.join('\n');
|
|
36
|
+
}
|
|
37
|
+
/** Where a value list opens on the line without being closed (and not already redacted), or -1. */
|
|
38
|
+
function findUnclosedValueList(line) {
|
|
39
|
+
let first = -1;
|
|
40
|
+
for (const rule of VALUE_LIST_RULES) {
|
|
41
|
+
let searchFrom = 0;
|
|
42
|
+
while (searchFrom < line.length) {
|
|
43
|
+
const labelAt = line.indexOf(rule.Label, searchFrom);
|
|
44
|
+
if (labelAt < 0) {
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
const opened = findValueListOpen(line, labelAt, rule);
|
|
48
|
+
if (opened.OpenAt >= 0 && !line.startsWith(REDACTED_CONSTRAINT_VALUES, opened.OpenAt)) {
|
|
49
|
+
if (first < 0 || opened.OpenAt < first) {
|
|
50
|
+
first = opened.OpenAt;
|
|
51
|
+
}
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
searchFrom = opened.ResumeAt;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return first;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Applies one rule to one line; returns the line unchanged when the rule does not match.
|
|
61
|
+
* The value list runs to the last qualifying closing character on the line, so that position is
|
|
62
|
+
* found once; the scan then takes the first label before it whose opening character is in place.
|
|
63
|
+
*/
|
|
64
|
+
function redactLine(line, rule) {
|
|
65
|
+
const closeAt = findLastValueListClose(line, rule);
|
|
66
|
+
let searchFrom = 0;
|
|
67
|
+
while (closeAt >= 0 && searchFrom < closeAt) {
|
|
68
|
+
const labelAt = line.indexOf(rule.Label, searchFrom);
|
|
69
|
+
if (labelAt < 0 || labelAt >= closeAt) {
|
|
70
|
+
return line;
|
|
71
|
+
}
|
|
72
|
+
const opened = findValueListOpen(line, labelAt, rule);
|
|
73
|
+
if (opened.OpenAt >= 0 && opened.OpenAt < closeAt) {
|
|
74
|
+
return line.slice(0, opened.OpenAt) + REDACTED_CONSTRAINT_VALUES + line.slice(closeAt + 1);
|
|
75
|
+
}
|
|
76
|
+
if (opened.OpenAt >= closeAt) {
|
|
77
|
+
return line;
|
|
78
|
+
}
|
|
79
|
+
searchFrom = opened.ResumeAt;
|
|
80
|
+
}
|
|
81
|
+
return line;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Where the value list after the label at `labelAt` opens (`OpenAt`, -1 when it does not), and
|
|
85
|
+
* where to look for the next label when it does not.
|
|
86
|
+
*/
|
|
87
|
+
function findValueListOpen(line, labelAt, rule) {
|
|
88
|
+
const afterLabel = labelAt + rule.Label.length;
|
|
89
|
+
if (rule.KeyColumns) {
|
|
90
|
+
// `Key (<columns>)=(` — the column list ends at the first `)=(`, not the first `)`, because
|
|
91
|
+
// an expression index lists an expression such as `lower(email)` in place of a column.
|
|
92
|
+
// Any later label before that `)=(` ends its column list at the same place, so the search
|
|
93
|
+
// resumes after it.
|
|
94
|
+
const columnsClose = line.indexOf(')=' + rule.Open, afterLabel);
|
|
95
|
+
if (columnsClose < 0) {
|
|
96
|
+
return { OpenAt: -1, ResumeAt: line.length };
|
|
97
|
+
}
|
|
98
|
+
return { OpenAt: columnsClose + 2, ResumeAt: columnsClose + 1 };
|
|
99
|
+
}
|
|
100
|
+
return { OpenAt: line.startsWith(rule.Open, afterLabel) ? afterLabel : -1, ResumeAt: afterLabel };
|
|
101
|
+
}
|
|
102
|
+
/** Index of the last closing character on the line that satisfies the rule's suffix, or -1. */
|
|
103
|
+
function findLastValueListClose(line, rule) {
|
|
104
|
+
let closeAt = line.lastIndexOf(rule.Close);
|
|
105
|
+
while (closeAt >= 0) {
|
|
106
|
+
if (!rule.Suffixes || closeIsFollowedBySuffix(line, closeAt, rule.Suffixes)) {
|
|
107
|
+
return closeAt;
|
|
108
|
+
}
|
|
109
|
+
closeAt = closeAt > 0 ? line.lastIndexOf(rule.Close, closeAt - 1) : -1;
|
|
110
|
+
}
|
|
111
|
+
return -1;
|
|
112
|
+
}
|
|
113
|
+
/** True when the text after `closeAt` is whitespace and then one of `suffixes`. */
|
|
114
|
+
function closeIsFollowedBySuffix(line, closeAt, suffixes) {
|
|
115
|
+
let at = closeAt + 1;
|
|
116
|
+
while (at < line.length && /\s/.test(line[at])) {
|
|
117
|
+
at++;
|
|
118
|
+
}
|
|
119
|
+
if (at === closeAt + 1) {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
return suffixes.some((suffix) => line.startsWith(suffix, at));
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* The save- or delete-failure message a caller may see (direct or through a transaction group): unchanged when field-level security withholds no
|
|
126
|
+
* column of this entity from them, otherwise without the executed SQL (see
|
|
127
|
+
* {@link StripExecutedSQL}) and with constraint values removed (see {@link RedactConstraintValues}). The full message still belongs in the server log.
|
|
128
|
+
*/
|
|
129
|
+
export function SaveErrorMessageForUser(message, entityInfo, user) {
|
|
130
|
+
if (!entityInfo?.FieldLevelSecurityApplies) {
|
|
131
|
+
return message;
|
|
132
|
+
}
|
|
133
|
+
if (user && entityInfo.GetDeniedReadFields(user).size === 0) {
|
|
134
|
+
return message;
|
|
135
|
+
}
|
|
136
|
+
return RedactConstraintValues(StripExecutedSQL(message));
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Drops the SQL text a provider appends to an execution error (`Query: …` and `Parameters: …`
|
|
140
|
+
* lines and everything after them). A save's SQL can carry stored values the caller may not
|
|
141
|
+
* read, such as the full-record JSON written to the audit trail.
|
|
142
|
+
*/
|
|
143
|
+
export function StripExecutedSQL(message) {
|
|
144
|
+
if (!message) {
|
|
145
|
+
return message;
|
|
146
|
+
}
|
|
147
|
+
let cut = message.length;
|
|
148
|
+
const match = /^[ \t]*(?:Query|Parameters):/m.exec(message);
|
|
149
|
+
if (match) {
|
|
150
|
+
cut = match.index;
|
|
151
|
+
}
|
|
152
|
+
// The provider's own "no rows" save errors put the SQL inline after a fixed lead-in.
|
|
153
|
+
for (const leadIn of INLINE_SQL_LEAD_INS) {
|
|
154
|
+
const at = message.indexOf(leadIn);
|
|
155
|
+
if (at >= 0 && at + leadIn.length < cut) {
|
|
156
|
+
cut = at + leadIn.length;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return cut < message.length ? message.slice(0, cut).trimEnd() : message;
|
|
160
|
+
}
|
|
161
|
+
/** Lead-ins after which a provider save error carries the executed SQL on the same line. */
|
|
162
|
+
const INLINE_SQL_LEAD_INS = [
|
|
163
|
+
'no rows returned from SQL:',
|
|
164
|
+
'no MATCHING rows found within the database:',
|
|
165
|
+
];
|
|
166
|
+
//# sourceMappingURL=constraintErrorRedaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constraintErrorRedaction.js","sourceRoot":"","sources":["../../src/generic/constraintErrorRedaction.ts"],"names":[],"mappings":"AAGA,4EAA4E;AAC5E,MAAM,CAAC,MAAM,0BAA0B,GAAG,mBAAmB,CAAC;AA0B9D,MAAM,gBAAgB,GAA6B;IAC/C,EAAE,KAAK,EAAE,6BAA6B,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE;IAC/D,EAAE,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE;IACrD,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,qBAAqB,CAAC,EAAE;IAClI,EAAE,KAAK,EAAE,uBAAuB,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE;CAC5D,CAAC;AAEF;;;;;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,CAAC;IACnB,CAAC;IACD,IAAI,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;IACzB,MAAM,KAAK,GAAG,+BAA+B,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5D,IAAI,KAAK,EAAE,CAAC;QACR,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC;IACtB,CAAC;IACD,qFAAqF;IACrF,KAAK,MAAM,MAAM,IAAI,mBAAmB,EAAE,CAAC;QACvC,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACnC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,MAAM,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;YACtC,GAAG,GAAG,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC;QAC7B,CAAC;IACL,CAAC;IACD,OAAO,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;AAC5E,CAAC;AAED,4FAA4F;AAC5F,MAAM,mBAAmB,GAAsB;IAC3C,4BAA4B;IAC5B,6CAA6C;CAChD,CAAC"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* All intelligent work (discovery, deduplication) happens once in serve().
|
|
9
9
|
* Execution order follows ClassFactory registration order (dependency-graph order).
|
|
10
10
|
*/
|
|
11
|
-
import type { RunViewResult } from './interfaces.js';
|
|
11
|
+
import type { IMetadataProvider, RunViewResult } from './interfaces.js';
|
|
12
12
|
import type { RunViewParams } from '../views/runView.js';
|
|
13
13
|
import type { UserInfo } from './securityInfo.js';
|
|
14
14
|
import type { BaseEntity } from './baseEntity.js';
|
|
@@ -17,7 +17,7 @@ import type { BaseEntity } from './baseEntity.js';
|
|
|
17
17
|
* (e.g., injecting tenant filters) before execution.
|
|
18
18
|
* Return the (possibly modified) params to continue, or throw to abort.
|
|
19
19
|
*/
|
|
20
|
-
export type PreRunViewHook = (params: RunViewParams, contextUser: UserInfo | undefined) => RunViewParams | Promise<RunViewParams>;
|
|
20
|
+
export type PreRunViewHook = (params: RunViewParams, contextUser: UserInfo | undefined, provider?: IMetadataProvider) => RunViewParams | Promise<RunViewParams>;
|
|
21
21
|
/**
|
|
22
22
|
* Hook that runs after a RunView operation completes. Can modify the result
|
|
23
23
|
* (e.g., filtering or augmenting data) before it is returned to the caller.
|
|
@@ -27,7 +27,7 @@ export type PreRunViewHook = (params: RunViewParams, contextUser: UserInfo | und
|
|
|
27
27
|
* build copies and either reassign `results.Results = results.Results.map(r => ({ ...r, ... }))`
|
|
28
28
|
* or return a new result; never mutate rows in place.
|
|
29
29
|
*/
|
|
30
|
-
export type PostRunViewHook = (params: RunViewParams, results: RunViewResult, contextUser: UserInfo | undefined) => RunViewResult | Promise<RunViewResult>;
|
|
30
|
+
export type PostRunViewHook = (params: RunViewParams, results: RunViewResult, contextUser: UserInfo | undefined, provider?: IMetadataProvider) => RunViewResult | Promise<RunViewResult>;
|
|
31
31
|
/**
|
|
32
32
|
* Hook that runs before a Save operation on a BaseEntity.
|
|
33
33
|
* Return `true` to allow the save, `false` to reject silently,
|
|
@@ -71,4 +71,28 @@ export declare function GetDataHooks<T>(hookName: HookName | string): T[];
|
|
|
71
71
|
* Removes all hooks from all slots. For testing only.
|
|
72
72
|
*/
|
|
73
73
|
export declare function ClearAllDataHooks(): void;
|
|
74
|
+
/**
|
|
75
|
+
* Registers an entity whose read access control is enforced by server-side
|
|
76
|
+
* `PostRunView` hooks rather than SQL `RowLevelSecurityFilter` or field-level security.
|
|
77
|
+
*
|
|
78
|
+
* `ClientClauseScreen.AssertUnscopedRead` rejects direct SQL reads against any
|
|
79
|
+
* registered entity's base view (in ExtraFilter subqueries or ExecuteAdhocQuery)
|
|
80
|
+
* because raw SQL bypasses `PostRunView` hooks.
|
|
81
|
+
*/
|
|
82
|
+
export declare function RegisterPostRunViewProtectedEntity(entityName: string): void;
|
|
83
|
+
/**
|
|
84
|
+
* Returns true if the given entity has been registered as enforcing row-level
|
|
85
|
+
* access via server-side `PostRunView` hooks (case-insensitive, trimmed).
|
|
86
|
+
*/
|
|
87
|
+
export declare function IsPostRunViewProtectedEntity(entityName: string): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Returns a read-only view of all currently registered `PostRunView`-protected entity names.
|
|
90
|
+
*/
|
|
91
|
+
export declare function GetPostRunViewProtectedEntities(): ReadonlySet<string>;
|
|
92
|
+
/**
|
|
93
|
+
* Clears all registered `PostRunView`-protected entities from the global store.
|
|
94
|
+
* Kept separate from `ClearAllDataHooks()` so data-hook test resets do not wipe
|
|
95
|
+
* module-level protected entity declarations unless explicitly requested.
|
|
96
|
+
*/
|
|
97
|
+
export declare function ClearPostRunViewProtectedEntities(): void;
|
|
74
98
|
//# sourceMappingURL=dataHooks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataHooks.d.ts","sourceRoot":"","sources":["../../src/generic/dataHooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"dataHooks.d.ts","sourceRoot":"","sources":["../../src/generic/dataHooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,CAC3B,MAAM,EAAE,aAAa,EACrB,WAAW,EAAE,QAAQ,GAAG,SAAS,EACjC,QAAQ,CAAC,EAAE,iBAAiB,KACzB,aAA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AiB,IAAI,IAAI,CAKxC;AAeD;;;;;;;GAOG;AACH,wBAAgB,kCAAkC,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAgB3E;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAoBxE;AAED;;GAEG;AACH,wBAAgB,+BAA+B,IAAI,WAAW,CAAC,MAAM,CAAC,CAIrE;AAED;;;;GAIG;AACH,wBAAgB,iCAAiC,IAAI,IAAI,CAKxD"}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { GetGlobalObjectStore } from '@memberjunction/global';
|
|
12
12
|
const DATA_HOOKS_KEY = '__mj_dataHooks';
|
|
13
|
+
const POST_RUNVIEW_PROTECTED_ENTITIES_KEY = '__mj_postRunViewProtectedEntities';
|
|
13
14
|
/**
|
|
14
15
|
* Memoized result of {@link GetGlobalObjectStore}. `undefined` means "not resolved yet";
|
|
15
16
|
* `null` is a legitimate resolved value (neither `window` nor `global` available).
|
|
@@ -77,4 +78,85 @@ export function ClearAllDataHooks() {
|
|
|
77
78
|
gos[DATA_HOOKS_KEY] = {};
|
|
78
79
|
}
|
|
79
80
|
}
|
|
81
|
+
function getOrCreateProtectedEntitySet() {
|
|
82
|
+
const gos = globalStore();
|
|
83
|
+
if (!gos) {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
let set = gos[POST_RUNVIEW_PROTECTED_ENTITIES_KEY];
|
|
87
|
+
if (!set) {
|
|
88
|
+
set = new Set();
|
|
89
|
+
gos[POST_RUNVIEW_PROTECTED_ENTITIES_KEY] = set;
|
|
90
|
+
}
|
|
91
|
+
return set;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Registers an entity whose read access control is enforced by server-side
|
|
95
|
+
* `PostRunView` hooks rather than SQL `RowLevelSecurityFilter` or field-level security.
|
|
96
|
+
*
|
|
97
|
+
* `ClientClauseScreen.AssertUnscopedRead` rejects direct SQL reads against any
|
|
98
|
+
* registered entity's base view (in ExtraFilter subqueries or ExecuteAdhocQuery)
|
|
99
|
+
* because raw SQL bypasses `PostRunView` hooks.
|
|
100
|
+
*/
|
|
101
|
+
export function RegisterPostRunViewProtectedEntity(entityName) {
|
|
102
|
+
const trimmed = entityName.trim();
|
|
103
|
+
if (!trimmed) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
const set = getOrCreateProtectedEntitySet();
|
|
107
|
+
if (!set) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const lower = trimmed.toLowerCase();
|
|
111
|
+
for (const existing of set) {
|
|
112
|
+
if (existing.toLowerCase() === lower) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
set.add(trimmed);
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Returns true if the given entity has been registered as enforcing row-level
|
|
120
|
+
* access via server-side `PostRunView` hooks (case-insensitive, trimmed).
|
|
121
|
+
*/
|
|
122
|
+
export function IsPostRunViewProtectedEntity(entityName) {
|
|
123
|
+
const trimmed = entityName?.trim();
|
|
124
|
+
if (!trimmed) {
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
const gos = globalStore();
|
|
128
|
+
const set = gos?.[POST_RUNVIEW_PROTECTED_ENTITIES_KEY];
|
|
129
|
+
if (!set || set.size === 0) {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
if (set.has(trimmed)) {
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
const lower = trimmed.toLowerCase();
|
|
136
|
+
for (const existing of set) {
|
|
137
|
+
if (existing.toLowerCase() === lower) {
|
|
138
|
+
return true;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Returns a read-only view of all currently registered `PostRunView`-protected entity names.
|
|
145
|
+
*/
|
|
146
|
+
export function GetPostRunViewProtectedEntities() {
|
|
147
|
+
const gos = globalStore();
|
|
148
|
+
const set = gos?.[POST_RUNVIEW_PROTECTED_ENTITIES_KEY];
|
|
149
|
+
return set ? new Set(set) : new Set();
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Clears all registered `PostRunView`-protected entities from the global store.
|
|
153
|
+
* Kept separate from `ClearAllDataHooks()` so data-hook test resets do not wipe
|
|
154
|
+
* module-level protected entity declarations unless explicitly requested.
|
|
155
|
+
*/
|
|
156
|
+
export function ClearPostRunViewProtectedEntities() {
|
|
157
|
+
const gos = globalStore();
|
|
158
|
+
if (gos) {
|
|
159
|
+
gos[POST_RUNVIEW_PROTECTED_ENTITIES_KEY] = new Set();
|
|
160
|
+
}
|
|
161
|
+
}
|
|
80
162
|
//# sourceMappingURL=dataHooks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataHooks.js","sourceRoot":"","sources":["../../src/generic/dataHooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,oBAAoB,EAAqB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"dataHooks.js","sourceRoot":"","sources":["../../src/generic/dataHooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,oBAAoB,EAAqB,MAAM,wBAAwB,CAAC;AAqEjF,MAAM,cAAc,GAAG,gBAAgB,CAAC;AACxC,MAAM,mCAAmC,GAAG,mCAAmC,CAAC;AAEhF;;;GAGG;AACH,IAAI,YAAY,GAAyC,SAAS,CAAC;AAEnE;;;;;;;;;;;;GAYG;AACH,SAAS,WAAW;IAChB,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAC7B,YAAY,GAAG,oBAAoB,EAAE,CAAC;IAC1C,CAAC;IACD,OAAO,YAAY,CAAC;AACxB,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAA2B,EAAE,IAAa;IACvE,MAAM,GAAG,G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AACjB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,+BAA+B;IAC3C,MAAM,GAAG,GAAG,WAAW,EAAE,CAAC;IAC1B,MAAM,GAAG,GAAG,GAAG,EAAE,CAAC,mCAAmC,CAA4B,CAAC;IAClF,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC;AAC1C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iCAAiC;IAC7C,MAAM,GAAG,GAAG,WAAW,EAAE,CAAC;IAC1B,IAAI,GAAG,EAAE,CAAC;QACN,GAAG,CAAC,mCAAmC,CAAC,GAAG,IAAI,GAAG,EAAU,CAAC;IACjE,CAAC;AACL,CAAC"}
|
|
@@ -18,6 +18,15 @@ export type FieldChange = {
|
|
|
18
18
|
oldValue: unknown;
|
|
19
19
|
newValue: unknown;
|
|
20
20
|
};
|
|
21
|
+
interface EntityFieldStateSnapshot {
|
|
22
|
+
Name: string;
|
|
23
|
+
Kind: 'primitive' | 'date' | 'bytes' | 'json' | 'uncomparable';
|
|
24
|
+
PrimitiveValue?: string | number | boolean | null | undefined;
|
|
25
|
+
DateMs?: number;
|
|
26
|
+
BytesCopy?: Uint8Array;
|
|
27
|
+
SerializedJson?: string;
|
|
28
|
+
Dirty: boolean;
|
|
29
|
+
}
|
|
21
30
|
/**
|
|
22
31
|
* Options controlling how {@link Metadata.GetRecordDependencies} discovers dependent records.
|
|
23
32
|
*/
|
|
@@ -104,6 +113,11 @@ export interface SaveContext {
|
|
|
104
113
|
* Work handed to {@link DatabaseProviderBase.RunAfterCommit}. Runs at most once.
|
|
105
114
|
*/
|
|
106
115
|
export type PostCommitTask = () => Promise<void>;
|
|
116
|
+
/**
|
|
117
|
+
* Deduplication strategy used by {@link DatabaseProviderBase.ScheduleAfterCommit} when multiple
|
|
118
|
+
* tasks share the same `coalesceKey` within one commit batch (or detached microtask turn).
|
|
119
|
+
*/
|
|
120
|
+
export type PostCommitCoalesceMode = 'last-wins' | 'first-wins';
|
|
107
121
|
/**
|
|
108
122
|
* Identifies the transaction frames that were open at one moment, so work registered *later* with
|
|
109
123
|
* {@link DatabaseProviderBase.RunAfterCommit} is tied to the transaction it came from rather than to
|
|
@@ -138,6 +152,8 @@ export declare abstract class DatabaseProviderBase extends ProviderBase {
|
|
|
138
152
|
private static _nextProviderInstanceId;
|
|
139
153
|
private readonly _providerInstanceId;
|
|
140
154
|
private _transactionEpoch;
|
|
155
|
+
private readonly _detachedCoalescedTasks;
|
|
156
|
+
private _detachedCoalesceScheduled;
|
|
141
157
|
/**
|
|
142
158
|
* Whether the calling async scope is part of this provider's ambient transaction.
|
|
143
159
|
* Subclasses with async-context transaction affinity (`GenericDatabaseProvider`) override this
|
|
@@ -288,6 +304,20 @@ export declare abstract class DatabaseProviderBase extends ProviderBase {
|
|
|
288
304
|
* it always returns `undefined`.
|
|
289
305
|
*/
|
|
290
306
|
CapturePostCommitToken(): PostCommitToken | undefined;
|
|
307
|
+
/**
|
|
308
|
+
* Enqueues post-commit work coalesced by `coalesceKey`.
|
|
309
|
+
*
|
|
310
|
+
* Outside an open transaction (on transactional providers) or on non-transactional providers,
|
|
311
|
+
* registrations sharing a `coalesceKey` within the same microtask turn collapse per `mode`
|
|
312
|
+
* (`'last-wins'` by default) before flushing once on a microtask. Inside a transaction,
|
|
313
|
+
* transactional providers bind each registration to the caller's ambient frame (or `token`)
|
|
314
|
+
* so rolled-back savepoints drop their entries cleanly while surviving entries coalesce at commit.
|
|
315
|
+
*/
|
|
316
|
+
ScheduleAfterCommit(coalesceKey: string, task: PostCommitTask, description?: string, token?: PostCommitToken, mode?: PostCommitCoalesceMode): void;
|
|
317
|
+
/** Runs a detached post-commit task safely; transactional subclasses detach transaction affinity here. */
|
|
318
|
+
protected ExecuteDetachedPostCommitTask(task: PostCommitTask, description: string): void;
|
|
319
|
+
/** Coalesces detached post-commit registrations onto a single microtask flush per turn. */
|
|
320
|
+
protected EnqueueDetachedCoalescedTask(coalesceKey: string, task: PostCommitTask, description: string, mode: PostCommitCoalesceMode): void;
|
|
291
321
|
/**
|
|
292
322
|
* Await one post-commit task, logging (never rethrowing) its failure. Shared by the immediate
|
|
293
323
|
* path of {@link RunAfterCommit} and by subclasses that drain a queue after commit.
|
|
@@ -726,6 +756,19 @@ export declare abstract class DatabaseProviderBase extends ProviderBase {
|
|
|
726
756
|
* `entityResult.Success = false`).
|
|
727
757
|
*/
|
|
728
758
|
protected CheckUpdateConcurrency(_entity: BaseEntity, _user: UserInfo, _options: EntitySaveOptions, _entityResult: BaseEntityResult): Promise<boolean>;
|
|
759
|
+
/**
|
|
760
|
+
* The `TransactionGroup` counterpart of {@link CheckUpdateConcurrency}, called when an UPDATE is
|
|
761
|
+
* queued into a group. The values the check compares (each changed field's baseline and new
|
|
762
|
+
* value) are captured now, when the save's SQL is generated; the returned function performs the
|
|
763
|
+
* locked row read and comparison later, inside the group's transaction before any of the
|
|
764
|
+
* group's statements run.
|
|
765
|
+
*
|
|
766
|
+
* The returned function resolves `true` when the save may proceed, or `false` when it is
|
|
767
|
+
* rejected (after populating `entityResult` the same way {@link CheckUpdateConcurrency} does).
|
|
768
|
+
*
|
|
769
|
+
* Default: `null`, meaning no check (and no extra work at submit).
|
|
770
|
+
*/
|
|
771
|
+
protected PrepareQueuedUpdateConcurrencyCheck(_entity: BaseEntity, _user: UserInfo, _options: EntitySaveOptions, _entityResult: BaseEntityResult): (() => Promise<boolean>) | null;
|
|
729
772
|
/**
|
|
730
773
|
* Awaited immediately after the save SQL succeeds (inside direct `Save()`'s
|
|
731
774
|
* {@link EntityTransactionScope} before commit, or inside a `TransactionGroup` item's completion
|
|
@@ -979,6 +1022,18 @@ export declare abstract class DatabaseProviderBase extends ProviderBase {
|
|
|
979
1022
|
* implement; return true when no Update filter applies.
|
|
980
1023
|
*/
|
|
981
1024
|
protected abstract CheckUpdateRLSPostImage(entity: BaseEntity, user: UserInfo): Promise<boolean>;
|
|
1025
|
+
/**
|
|
1026
|
+
* Captures an immutable snapshot of an entity's fields (name, value, dirty status)
|
|
1027
|
+
* so we can detect whether before-save hooks mutated any field (including in-place
|
|
1028
|
+
* Date, Uint8Array, or JSON object mutations and case-sensitive string changes).
|
|
1029
|
+
*/
|
|
1030
|
+
protected CaptureEntityFieldSnapshot(entity: BaseEntity): EntityFieldStateSnapshot[];
|
|
1031
|
+
private snapshotSingleFieldState;
|
|
1032
|
+
/**
|
|
1033
|
+
* Checks whether an entity's field values or dirty flags have mutated compared to a previous snapshot.
|
|
1034
|
+
*/
|
|
1035
|
+
protected HasEntityFieldStateMutated(entity: BaseEntity, snapshot: EntityFieldStateSnapshot[]): boolean;
|
|
1036
|
+
private matchesFieldSnapshot;
|
|
982
1037
|
/**************************************************************************/
|
|
983
1038
|
/**************************************************************************/
|
|
984
1039
|
/**************************************************************************/
|
|
@@ -1107,8 +1162,11 @@ export declare abstract class DatabaseProviderBase extends ProviderBase {
|
|
|
1107
1162
|
* `DiffObjects`. Defaults to single quote.
|
|
1108
1163
|
* @param cloneContext When non-null, populates `source='Clone'` and the
|
|
1109
1164
|
* structured `changeContext` JSON payload.
|
|
1165
|
+
* @param skipFullRecordJSON When true (because the dialect builds `FullRecordJSON` in SQL
|
|
1166
|
+
* from the returned row), skips `EscapeQuotesInProperties` and `JSON.stringify` for
|
|
1167
|
+
* `fullRecordJSON`, returning `''`.
|
|
1110
1168
|
*/
|
|
1111
|
-
protected BuildRecordChangePayload(newData: Record<string, unknown> | null, oldData: Record<string, unknown> | null, recordID: string, entityInfo: EntityInfo, type: 'Create' | 'Update' | 'Delete', user: UserInfo, restoreContext?: RestoreContext | null, quoteToEscape?: string, cloneContext?: CloneContext | null): RecordChangePayload | null;
|
|
1169
|
+
protected BuildRecordChangePayload(newData: Record<string, unknown> | null, oldData: Record<string, unknown> | null, recordID: string, entityInfo: EntityInfo, type: 'Create' | 'Update' | 'Delete', user: UserInfo, restoreContext?: RestoreContext | null, quoteToEscape?: string, cloneContext?: CloneContext | null, skipFullRecordJSON?: boolean): RecordChangePayload | null;
|
|
1112
1170
|
/**
|
|
1113
1171
|
* Builds the SQL (and optional parameters) for inserting a record change entry.
|
|
1114
1172
|
* Each provider generates its own dialect: SQL Server uses EXEC spCreateRecordChange_Internal,
|