@memberjunction/server 5.41.0 → 5.43.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/agentSessions/SessionJanitor.d.ts.map +1 -1
- package/dist/agentSessions/SessionJanitor.js +5 -1
- package/dist/agentSessions/SessionJanitor.js.map +1 -1
- package/dist/agentSessions/SessionManager.d.ts +15 -2
- package/dist/agentSessions/SessionManager.d.ts.map +1 -1
- package/dist/agentSessions/SessionManager.js +50 -11
- package/dist/agentSessions/SessionManager.js.map +1 -1
- package/dist/agentSessions/index.d.ts +1 -0
- package/dist/agentSessions/index.d.ts.map +1 -1
- package/dist/agentSessions/index.js +5 -0
- package/dist/agentSessions/index.js.map +1 -1
- package/dist/agentSessions/remoteBrowserGoalEngine.d.ts +102 -0
- package/dist/agentSessions/remoteBrowserGoalEngine.d.ts.map +1 -0
- package/dist/agentSessions/remoteBrowserGoalEngine.js +164 -0
- package/dist/agentSessions/remoteBrowserGoalEngine.js.map +1 -0
- package/dist/agentSessions/remoteBrowserGoalRegistry.d.ts +66 -0
- package/dist/agentSessions/remoteBrowserGoalRegistry.d.ts.map +1 -0
- package/dist/agentSessions/remoteBrowserGoalRegistry.js +86 -0
- package/dist/agentSessions/remoteBrowserGoalRegistry.js.map +1 -0
- package/dist/auth/initializeProviders.d.ts.map +1 -1
- package/dist/auth/initializeProviders.js +4 -7
- package/dist/auth/initializeProviders.js.map +1 -1
- package/dist/config.d.ts +7 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +12 -2
- package/dist/config.js.map +1 -1
- package/dist/generated/generated.d.ts +612 -0
- package/dist/generated/generated.d.ts.map +1 -1
- package/dist/generated/generated.js +6934 -3626
- package/dist/generated/generated.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +38 -17
- package/dist/index.js.map +1 -1
- package/dist/integration/CustomColumnPromoter.d.ts +108 -0
- package/dist/integration/CustomColumnPromoter.d.ts.map +1 -0
- package/dist/integration/CustomColumnPromoter.js +508 -0
- package/dist/integration/CustomColumnPromoter.js.map +1 -0
- package/dist/logging/StartupLogger.d.ts +57 -1
- package/dist/logging/StartupLogger.d.ts.map +1 -1
- package/dist/logging/StartupLogger.js +115 -6
- package/dist/logging/StartupLogger.js.map +1 -1
- package/dist/resolvers/ExecuteRemoteOperationResolver.d.ts +46 -0
- package/dist/resolvers/ExecuteRemoteOperationResolver.d.ts.map +1 -0
- package/dist/resolvers/ExecuteRemoteOperationResolver.js +192 -0
- package/dist/resolvers/ExecuteRemoteOperationResolver.js.map +1 -0
- package/dist/resolvers/IntegrationDiscoveryResolver.d.ts +101 -1
- package/dist/resolvers/IntegrationDiscoveryResolver.d.ts.map +1 -1
- package/dist/resolvers/IntegrationDiscoveryResolver.js +629 -58
- package/dist/resolvers/IntegrationDiscoveryResolver.js.map +1 -1
- package/dist/resolvers/RealtimeBridgeResolver.d.ts +130 -0
- package/dist/resolvers/RealtimeBridgeResolver.d.ts.map +1 -0
- package/dist/resolvers/RealtimeBridgeResolver.js +580 -0
- package/dist/resolvers/RealtimeBridgeResolver.js.map +1 -0
- package/dist/resolvers/RemoteBrowserActionResolver.d.ts +78 -5
- package/dist/resolvers/RemoteBrowserActionResolver.d.ts.map +1 -1
- package/dist/resolvers/RemoteBrowserActionResolver.js +227 -15
- package/dist/resolvers/RemoteBrowserActionResolver.js.map +1 -1
- package/dist/resolvers/RunAIAgentResolver.d.ts.map +1 -1
- package/dist/resolvers/RunAIAgentResolver.js +0 -7
- package/dist/resolvers/RunAIAgentResolver.js.map +1 -1
- package/dist/resolvers/RunTemplateResolver.d.ts +8 -0
- package/dist/resolvers/RunTemplateResolver.d.ts.map +1 -1
- package/dist/resolvers/RunTemplateResolver.js +8 -0
- package/dist/resolvers/RunTemplateResolver.js.map +1 -1
- package/dist/rest/setupRESTEndpoints.d.ts.map +1 -1
- package/dist/rest/setupRESTEndpoints.js +5 -3
- package/dist/rest/setupRESTEndpoints.js.map +1 -1
- package/package.json +83 -78
- package/src/__tests__/RealtimeBridgeResolver.test.ts +100 -0
- package/src/__tests__/RemoteBrowserAudioStream.test.ts +8 -1
- package/src/__tests__/RemoteBrowserGoalEngine.test.ts +144 -0
- package/src/__tests__/remoteBrowserGoalRegistry.test.ts +81 -0
- package/src/agentSessions/SessionJanitor.ts +15 -1
- package/src/agentSessions/SessionManager.ts +59 -10
- package/src/agentSessions/index.ts +5 -0
- package/src/agentSessions/remoteBrowserGoalEngine.ts +191 -0
- package/src/agentSessions/remoteBrowserGoalRegistry.ts +122 -0
- package/src/auth/initializeProviders.ts +4 -7
- package/src/config.ts +13 -2
- package/src/generated/generated.ts +2502 -198
- package/src/index.ts +38 -17
- package/src/integration/CustomColumnPromoter.ts +597 -0
- package/src/logging/StartupLogger.ts +130 -6
- package/src/resolvers/ExecuteRemoteOperationResolver.ts +164 -0
- package/src/resolvers/IntegrationDiscoveryResolver.ts +490 -53
- package/src/resolvers/RealtimeBridgeResolver.ts +493 -0
- package/src/resolvers/RemoteBrowserActionResolver.ts +232 -17
- package/src/resolvers/RunAIAgentResolver.ts +1 -9
- package/src/resolvers/RunTemplateResolver.ts +8 -0
- package/src/rest/setupRESTEndpoints.ts +5 -3
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { configInfo } from '../config.js';
|
|
2
2
|
import { LogStatus } from '@memberjunction/core';
|
|
3
|
+
import ora from 'ora';
|
|
3
4
|
/** Numeric rank for each level, used for `>=` threshold comparisons. */
|
|
4
5
|
const LEVEL_RANK = {
|
|
5
6
|
minimal: 0,
|
|
@@ -37,6 +38,12 @@ export class StartupLogger {
|
|
|
37
38
|
constructor(level) {
|
|
38
39
|
this.phaseTimings = [];
|
|
39
40
|
this.summary = { AuthProviders: [] };
|
|
41
|
+
/** Transient boot spinner — active only at `standard` level on a TTY (see {@link spinnerEnabled}). */
|
|
42
|
+
this.spinner = null;
|
|
43
|
+
/** Interval that ticks the live elapsed counter on the spinner line. */
|
|
44
|
+
this.bootTimer = null;
|
|
45
|
+
/** Wall-clock start of the boot indicator, for the live elapsed counter. */
|
|
46
|
+
this.bootStartMs = 0;
|
|
40
47
|
this.resolvedLevel = level ?? StartupLogger.resolveLevelFromConfig();
|
|
41
48
|
}
|
|
42
49
|
/**
|
|
@@ -83,6 +90,79 @@ export class StartupLogger {
|
|
|
83
90
|
StartPhase() {
|
|
84
91
|
return performance.now();
|
|
85
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* True when the transient boot spinner should animate: only at `standard`
|
|
95
|
+
* level AND when stdout is an interactive TTY. In non-TTY contexts (Docker,
|
|
96
|
+
* systemd, piped logs) a spinner emits escape codes that pollute log
|
|
97
|
+
* aggregation, and at `verbose`+ the inline phase lines would fight it — so
|
|
98
|
+
* both fall back to plain, line-oriented output.
|
|
99
|
+
*/
|
|
100
|
+
get spinnerEnabled() {
|
|
101
|
+
return this.resolvedLevel === 'standard' && process.stdout.isTTY === true;
|
|
102
|
+
}
|
|
103
|
+
/** Prefix for the transient boot indicator (no rocket — we haven't launched yet). */
|
|
104
|
+
static { this.BOOT_LABEL = 'Bootstrapping MemberJunction Server'; }
|
|
105
|
+
/** Composes the boot label, plus the current phase when known (no elapsed counter). */
|
|
106
|
+
bootText(phase) {
|
|
107
|
+
return phase ? `${StartupLogger.BOOT_LABEL} · ${phase}` : StartupLogger.BOOT_LABEL;
|
|
108
|
+
}
|
|
109
|
+
/** Repaints the spinner line with the current phase and a live elapsed counter. */
|
|
110
|
+
refreshBootText() {
|
|
111
|
+
if (this.spinner) {
|
|
112
|
+
const elapsed = ((performance.now() - this.bootStartMs) / 1000).toFixed(1);
|
|
113
|
+
this.spinner.text = `${this.bootText(this.currentPhase)} ${elapsed}s`;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Begins the transient "Bootstrapping…" indicator, replaced by the 🚀 summary
|
|
118
|
+
* block once {@link PrintSummary} runs (so the rocket appears only after launch).
|
|
119
|
+
*
|
|
120
|
+
* - `standard` + TTY: an animated, self-clearing `ora` spinner (its glyph is the
|
|
121
|
+
* leading "working" icon; phase status is appended inline).
|
|
122
|
+
* - `verbose`/`debug`, or non-TTY at `standard`: a single plain line with an
|
|
123
|
+
* hourglass icon (can't be cleared, but inline phase logs / the final block
|
|
124
|
+
* carry the detail). `minimal` stays silent.
|
|
125
|
+
*/
|
|
126
|
+
StartBoot() {
|
|
127
|
+
if (this.spinner) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
if (this.spinnerEnabled) {
|
|
131
|
+
this.bootStartMs = performance.now();
|
|
132
|
+
this.spinner = ora({ text: this.bootText(), stream: process.stdout }).start();
|
|
133
|
+
// Tick the elapsed counter independently of ora's glyph animation. Unref'd so
|
|
134
|
+
// it never keeps the event loop alive; cleared by StopBoot before the block prints.
|
|
135
|
+
this.bootTimer = setInterval(() => this.refreshBootText(), 200);
|
|
136
|
+
this.bootTimer.unref();
|
|
137
|
+
}
|
|
138
|
+
else if (this.resolvedLevel !== 'minimal') {
|
|
139
|
+
// eslint-disable-next-line no-console
|
|
140
|
+
console.log(`⏳ ${this.bootText()}…`);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Marks the beginning of a named phase: updates the spinner status (when active)
|
|
145
|
+
* and returns a start timestamp to pass to {@link EndPhase}. Pure timing helper
|
|
146
|
+
* when the spinner is disabled — equivalent to {@link StartPhase}.
|
|
147
|
+
*
|
|
148
|
+
* @param phase Friendly label for the upcoming phase, shown after the boot label.
|
|
149
|
+
*/
|
|
150
|
+
BeginPhase(phase) {
|
|
151
|
+
this.currentPhase = phase;
|
|
152
|
+
this.refreshBootText();
|
|
153
|
+
return performance.now();
|
|
154
|
+
}
|
|
155
|
+
/** Stops and clears the boot spinner + its elapsed-counter interval. Safe to call when inactive. */
|
|
156
|
+
StopBoot() {
|
|
157
|
+
if (this.bootTimer) {
|
|
158
|
+
clearInterval(this.bootTimer);
|
|
159
|
+
this.bootTimer = null;
|
|
160
|
+
}
|
|
161
|
+
if (this.spinner) {
|
|
162
|
+
this.spinner.stop();
|
|
163
|
+
this.spinner = null;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
86
166
|
/**
|
|
87
167
|
* Records the elapsed time for a phase since `startedAt`, buffering it for the
|
|
88
168
|
* summary. At `verbose`+ the phase is also printed immediately (matching the
|
|
@@ -104,6 +184,10 @@ export class StartupLogger {
|
|
|
104
184
|
SetVersion(version) {
|
|
105
185
|
this.summary.Version = version;
|
|
106
186
|
}
|
|
187
|
+
/** Records the resolved config-file path for the summary `Config` line. */
|
|
188
|
+
SetConfigPath(path) {
|
|
189
|
+
this.summary.ConfigPath = path;
|
|
190
|
+
}
|
|
107
191
|
/** Records DB platform + connection + entity count for the summary `DB` line. */
|
|
108
192
|
SetDatabaseInfo(platform, connection, entityCount) {
|
|
109
193
|
this.summary.DbPlatform = platform;
|
|
@@ -134,6 +218,9 @@ export class StartupLogger {
|
|
|
134
218
|
* all detail lines were already printed inline during boot).
|
|
135
219
|
*/
|
|
136
220
|
PrintSummary() {
|
|
221
|
+
// Clear the transient spinner before any block output so the line it
|
|
222
|
+
// occupied is replaced cleanly by the summary.
|
|
223
|
+
this.StopBoot();
|
|
137
224
|
if (this.resolvedLevel === 'minimal') {
|
|
138
225
|
this.printReadyLineOnly();
|
|
139
226
|
return;
|
|
@@ -158,6 +245,7 @@ export class StartupLogger {
|
|
|
158
245
|
const lines = [];
|
|
159
246
|
lines.push(this.buildHeaderLine());
|
|
160
247
|
lines.push(this.buildDbLine());
|
|
248
|
+
lines.push(this.buildConfigLine());
|
|
161
249
|
lines.push(this.buildAuthLine());
|
|
162
250
|
lines.push(this.buildStartupLine());
|
|
163
251
|
lines.push(this.buildReadyLine());
|
|
@@ -182,6 +270,13 @@ export class StartupLogger {
|
|
|
182
270
|
}
|
|
183
271
|
return ` DB ${parts.join(' · ')}`;
|
|
184
272
|
}
|
|
273
|
+
/** ` Config <path>` (omitted when no config file was resolved). */
|
|
274
|
+
buildConfigLine() {
|
|
275
|
+
if (!this.summary.ConfigPath) {
|
|
276
|
+
return '';
|
|
277
|
+
}
|
|
278
|
+
return ` Config ${this.summary.ConfigPath}`;
|
|
279
|
+
}
|
|
185
280
|
/** ` Auth <providers> REST <on/off> · <N> scheduled jobs`. */
|
|
186
281
|
buildAuthLine() {
|
|
187
282
|
const providers = this.summary.AuthProviders.length > 0
|
|
@@ -197,16 +292,30 @@ export class StartupLogger {
|
|
|
197
292
|
const trailerPart = trailer ? ` ${trailer}` : '';
|
|
198
293
|
return ` Auth ${providers}${trailerPart}`;
|
|
199
294
|
}
|
|
200
|
-
/**
|
|
295
|
+
/**
|
|
296
|
+
* ` Startup <total>s (<phase> <x>s · … · other <z>s)`.
|
|
297
|
+
*
|
|
298
|
+
* The headline `<total>` is the TRUE wall-clock since process start — in Node,
|
|
299
|
+
* `performance.now()` is measured from `performance.timeOrigin` (≈ process
|
|
300
|
+
* start), so it captures the entire bootstrap (module import, config load,
|
|
301
|
+
* ServerBootstrap, and `serve()`), not just the timed phases. The parenthetical
|
|
302
|
+
* lists each captured phase; `other` is the unattributed remainder (import +
|
|
303
|
+
* config + any untimed setup) shown only when it's non-trivial.
|
|
304
|
+
*/
|
|
201
305
|
buildStartupLine() {
|
|
202
306
|
if (this.phaseTimings.length === 0) {
|
|
203
307
|
return '';
|
|
204
308
|
}
|
|
205
|
-
const totalMs =
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
309
|
+
const totalMs = performance.now();
|
|
310
|
+
const phaseSumMs = this.phaseTimings.reduce((sum, p) => sum + p.Ms, 0);
|
|
311
|
+
const otherMs = totalMs - phaseSumMs;
|
|
312
|
+
const parts = this.phaseTimings.map((p) => `${this.shortPhaseLabel(p.Label)} ${(p.Ms / 1000).toFixed(1)}s`);
|
|
313
|
+
// Surface unattributed boot time only when it's meaningful (>50ms), so the
|
|
314
|
+
// line stays clean when phases already account for ~all of startup.
|
|
315
|
+
if (otherMs > 50) {
|
|
316
|
+
parts.push(`other ${(otherMs / 1000).toFixed(1)}s`);
|
|
317
|
+
}
|
|
318
|
+
return ` Startup ${(totalMs / 1000).toFixed(1)}s (${parts.join(' · ')})`;
|
|
210
319
|
}
|
|
211
320
|
/**
|
|
212
321
|
* Abbreviates a verbose phase label into a compact token for the collapsed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StartupLogger.js","sourceRoot":"","sources":["../../src/logging/StartupLogger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"StartupLogger.js","sourceRoot":"","sources":["../../src/logging/StartupLogger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,GAAG,MAAM,KAAK,CAAC;AActB,wEAAwE;AACxE,MAAM,UAAU,GAAmC;IACjD,OAAO,EAAE,CAAC;IACV,QAAQ,EAAE,CAAC;IACX,OAAO,EAAE,CAAC;IACV,KAAK,EAAE,CAAC;CACT,CAAC;AAwCF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,aAAa;IAaxB;;;OAGG;IACH,YAAY,KAAsB;QAfjB,iBAAY,GAAkB,EAAE,CAAC;QACjC,YAAO,GAAuB,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC;QACrE,sGAAsG;QAC9F,YAAO,GAAe,IAAI,CAAC;QACnC,wEAAwE;QAChE,cAAS,GAA0C,IAAI,CAAC;QAChE,4EAA4E;QACpE,gBAAW,GAAG,CAAC,CAAC;QAStB,IAAI,CAAC,aAAa,GAAG,KAAK,IAAI,aAAa,CAAC,sBAAsB,EAAE,CAAC;IACvE,CAAC;IAED;;OAEG;IACH,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,aAAa,CAAC;IA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,CAAC;QACd,CAAC;QACD,IAAI,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;YAC/D,OAAO,WAAW,CAAC;QACrB,CAAC;QACD,IAAI,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;YAC1D,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,IAAI,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YAC3D,OAAO,OAAO,CAAC;QACjB,CAAC;QACD,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC;IAED,4BAA4B;IACpB,cAAc;QACpB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;YAC3B,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,OAAO,gBAAgB,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;IACjD,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { PubSubEngine } from 'type-graphql';
|
|
2
|
+
import { ResolverBase } from '../generic/ResolverBase.js';
|
|
3
|
+
import { AppContext } from '../types.js';
|
|
4
|
+
/** Input for the generic Remote Operation transport mutation. */
|
|
5
|
+
export declare class ExecuteRemoteOperationInput {
|
|
6
|
+
operationKey: string;
|
|
7
|
+
inputJSON: string;
|
|
8
|
+
invokeMode: string;
|
|
9
|
+
/**
|
|
10
|
+
* Optional client-generated channel id. When set (attached mode over the wire), the server publishes every
|
|
11
|
+
* `RemoteOpProgress` the operation emits to the `RemoteOperationProgress` subscription filtered by this id,
|
|
12
|
+
* so the caller's `onProgress` fires live while the operation runs. Omitted for sync / no-progress calls.
|
|
13
|
+
*/
|
|
14
|
+
progressChannelId?: string;
|
|
15
|
+
}
|
|
16
|
+
/** A single streamed progress envelope delivered over the `RemoteOperationProgress` subscription. */
|
|
17
|
+
export declare class RemoteOperationProgressNotification {
|
|
18
|
+
ChannelId: string;
|
|
19
|
+
/** JSON-serialized {@link RemoteOpProgress}. */
|
|
20
|
+
ProgressJSON: string;
|
|
21
|
+
}
|
|
22
|
+
/** Result of the generic Remote Operation transport mutation. */
|
|
23
|
+
export declare class ExecuteRemoteOperationResultType {
|
|
24
|
+
success: boolean;
|
|
25
|
+
resultCode?: string;
|
|
26
|
+
outputJSON?: string;
|
|
27
|
+
handle?: string;
|
|
28
|
+
errorMessage?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The single generic server entry point for Remote Operations. Resolves the operation by key,
|
|
32
|
+
* applies the framework authorization gates (API-key scope, system-user, then the operation's own
|
|
33
|
+
* `Authorize`), and routes the operation through the per-request provider — which executes it
|
|
34
|
+
* in-process. Only registered, active operations are reachable, so the public `RouteOperation`
|
|
35
|
+
* power-tool is safe by construction.
|
|
36
|
+
*/
|
|
37
|
+
export declare class ExecuteRemoteOperationResolver extends ResolverBase {
|
|
38
|
+
ExecuteRemoteOperation(input: ExecuteRemoteOperationInput, ctx: AppContext, pubSub: PubSubEngine): Promise<ExecuteRemoteOperationResultType>;
|
|
39
|
+
/**
|
|
40
|
+
* Subscription the client opens (with a self-generated `channelId`) immediately before calling
|
|
41
|
+
* `ExecuteRemoteOperation` with the same id in `progressChannelId`. The server publishes one event per
|
|
42
|
+
* `RemoteOpProgress` the operation emits; filtered by `channelId` so concurrent calls never interleave.
|
|
43
|
+
*/
|
|
44
|
+
RemoteOperationProgress(notification: RemoteOperationProgressNotification, _channelId: string): RemoteOperationProgressNotification;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=ExecuteRemoteOperationResolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExecuteRemoteOperationResolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/ExecuteRemoteOperationResolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgE,YAAY,EAAgC,MAAM,cAAc,CAAC;AAIxI,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAMzC,iEAAiE;AACjE,qBACa,2BAA2B;IAEpC,YAAY,EAAE,MAAM,CAAC;IAGrB,SAAS,EAAE,MAAM,CAAC;IAGlB,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IAEH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,qGAAqG;AACrG,qBACa,mCAAmC;IAE5C,SAAS,EAAE,MAAM,CAAC;IAElB,gDAAgD;IAEhD,YAAY,EAAE,MAAM,CAAC;CACxB;AAED,iEAAiE;AACjE,qBACa,gCAAgC;IAEzC,OAAO,EAAE,OAAO,CAAC;IAGjB,UAAU,CAAC,EAAE,MAAM,CAAC;IAGpB,UAAU,CAAC,EAAE,MAAM,CAAC;IAGpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;GAMG;AACH,qBACa,8BAA+B,SAAQ,YAAY;IAEtD,sBAAsB,CACV,KAAK,EAAE,2BAA2B,EACzC,GAAG,EAAE,UAAU,EACZ,MAAM,EAAE,YAAY,GAC/B,OAAO,CAAC,gCAAgC,CAAC;IAmE5C;;;;OAIG;IAKH,uBAAuB,CACX,YAAY,EAAE,mCAAmC,EAC7B,UAAU,EAAE,MAAM,GAC/C,mCAAmC;CAGzC"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
import { Arg, Ctx, Field, ID, InputType, Mutation, ObjectType, PubSub, PubSubEngine, Resolver, Root, Subscription } from 'type-graphql';
|
|
14
|
+
import { MJGlobal } from '@memberjunction/global';
|
|
15
|
+
import { BaseRemotableOperation } from '@memberjunction/core';
|
|
16
|
+
import { RemoteOperationEngineBase } from '@memberjunction/core-entities';
|
|
17
|
+
import { ResolverBase } from '../generic/ResolverBase.js';
|
|
18
|
+
import { GetReadWriteProvider } from '../util.js';
|
|
19
|
+
/** PubSub topic carrying RemoteOpProgress envelopes for attached over-the-wire callers (RO-3). */
|
|
20
|
+
const REMOTE_OP_PROGRESS_TOPIC = 'RemoteOperationProgress';
|
|
21
|
+
/** Input for the generic Remote Operation transport mutation. */
|
|
22
|
+
let ExecuteRemoteOperationInput = class ExecuteRemoteOperationInput {
|
|
23
|
+
};
|
|
24
|
+
__decorate([
|
|
25
|
+
Field(),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], ExecuteRemoteOperationInput.prototype, "operationKey", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
Field(),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], ExecuteRemoteOperationInput.prototype, "inputJSON", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
Field(),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], ExecuteRemoteOperationInput.prototype, "invokeMode", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
Field(() => String, { nullable: true }),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], ExecuteRemoteOperationInput.prototype, "progressChannelId", void 0);
|
|
40
|
+
ExecuteRemoteOperationInput = __decorate([
|
|
41
|
+
InputType()
|
|
42
|
+
], ExecuteRemoteOperationInput);
|
|
43
|
+
export { ExecuteRemoteOperationInput };
|
|
44
|
+
/** A single streamed progress envelope delivered over the `RemoteOperationProgress` subscription. */
|
|
45
|
+
let RemoteOperationProgressNotification = class RemoteOperationProgressNotification {
|
|
46
|
+
};
|
|
47
|
+
__decorate([
|
|
48
|
+
Field(),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], RemoteOperationProgressNotification.prototype, "ChannelId", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
Field(),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], RemoteOperationProgressNotification.prototype, "ProgressJSON", void 0);
|
|
55
|
+
RemoteOperationProgressNotification = __decorate([
|
|
56
|
+
ObjectType()
|
|
57
|
+
], RemoteOperationProgressNotification);
|
|
58
|
+
export { RemoteOperationProgressNotification };
|
|
59
|
+
/** Result of the generic Remote Operation transport mutation. */
|
|
60
|
+
let ExecuteRemoteOperationResultType = class ExecuteRemoteOperationResultType {
|
|
61
|
+
};
|
|
62
|
+
__decorate([
|
|
63
|
+
Field(() => Boolean),
|
|
64
|
+
__metadata("design:type", Boolean)
|
|
65
|
+
], ExecuteRemoteOperationResultType.prototype, "success", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
Field(() => String, { nullable: true }),
|
|
68
|
+
__metadata("design:type", String)
|
|
69
|
+
], ExecuteRemoteOperationResultType.prototype, "resultCode", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
Field(() => String, { nullable: true }),
|
|
72
|
+
__metadata("design:type", String)
|
|
73
|
+
], ExecuteRemoteOperationResultType.prototype, "outputJSON", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
Field(() => String, { nullable: true }),
|
|
76
|
+
__metadata("design:type", String)
|
|
77
|
+
], ExecuteRemoteOperationResultType.prototype, "handle", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
Field(() => String, { nullable: true }),
|
|
80
|
+
__metadata("design:type", String)
|
|
81
|
+
], ExecuteRemoteOperationResultType.prototype, "errorMessage", void 0);
|
|
82
|
+
ExecuteRemoteOperationResultType = __decorate([
|
|
83
|
+
ObjectType()
|
|
84
|
+
], ExecuteRemoteOperationResultType);
|
|
85
|
+
export { ExecuteRemoteOperationResultType };
|
|
86
|
+
/**
|
|
87
|
+
* The single generic server entry point for Remote Operations. Resolves the operation by key,
|
|
88
|
+
* applies the framework authorization gates (API-key scope, system-user, then the operation's own
|
|
89
|
+
* `Authorize`), and routes the operation through the per-request provider — which executes it
|
|
90
|
+
* in-process. Only registered, active operations are reachable, so the public `RouteOperation`
|
|
91
|
+
* power-tool is safe by construction.
|
|
92
|
+
*/
|
|
93
|
+
let ExecuteRemoteOperationResolver = class ExecuteRemoteOperationResolver extends ResolverBase {
|
|
94
|
+
async ExecuteRemoteOperation(input, ctx, pubSub) {
|
|
95
|
+
try {
|
|
96
|
+
const key = input.operationKey?.trim();
|
|
97
|
+
if (!key) {
|
|
98
|
+
return fail('INVALID_OPERATION_KEY', 'operationKey is required');
|
|
99
|
+
}
|
|
100
|
+
// Resolve the operation's declaration so we can apply its scope / system-user gates.
|
|
101
|
+
const registration = MJGlobal.Instance.ClassFactory.GetRegistration(BaseRemotableOperation, key);
|
|
102
|
+
if (!registration) {
|
|
103
|
+
return fail('UNKNOWN_OPERATION', `Remote operation '${key}' is not registered`);
|
|
104
|
+
}
|
|
105
|
+
const opDecl = MJGlobal.Instance.ClassFactory.CreateInstance(BaseRemotableOperation, key);
|
|
106
|
+
// (1) API-key scope gate — a no-op for interactive OAuth/JWT users.
|
|
107
|
+
if (opDecl?.RequiredScope) {
|
|
108
|
+
await this.CheckAPIKeyScopeAuthorization(opDecl.RequiredScope, key, ctx.userPayload);
|
|
109
|
+
}
|
|
110
|
+
// (2) System-user gate.
|
|
111
|
+
if (opDecl?.RequiresSystemUser && !ctx.userPayload.isSystemUser) {
|
|
112
|
+
return fail('FORBIDDEN', `Operation '${key}' may only be invoked by the system user`);
|
|
113
|
+
}
|
|
114
|
+
// (3) Resolve the acting user (works for OAuth/JWT and API-key sessions alike).
|
|
115
|
+
const user = this.GetUserFromPayload(ctx.userPayload);
|
|
116
|
+
if (!user) {
|
|
117
|
+
return fail('NO_USER', 'Not authenticated');
|
|
118
|
+
}
|
|
119
|
+
// (4) Metadata gate (defense-in-depth): honor the op's MJ: Remote Operations Status/approval, so a
|
|
120
|
+
// registered-but-disabled (or unapproved AI) op is rejected even though its class is still in code.
|
|
121
|
+
const provider = GetReadWriteProvider(ctx.providers);
|
|
122
|
+
await RemoteOperationEngineBase.Instance.Config(false, user, provider);
|
|
123
|
+
const invokability = RemoteOperationEngineBase.Instance.IsInvokable(key);
|
|
124
|
+
if (!invokability.Invokable) {
|
|
125
|
+
return fail(invokability.ResultCode ?? 'OPERATION_UNAVAILABLE', invokability.Reason ?? `Operation '${key}' is unavailable`);
|
|
126
|
+
}
|
|
127
|
+
let parsedInput;
|
|
128
|
+
try {
|
|
129
|
+
parsedInput = input.inputJSON ? JSON.parse(input.inputJSON) : {};
|
|
130
|
+
}
|
|
131
|
+
catch (e) {
|
|
132
|
+
return fail('INVALID_INPUT_JSON', `Invalid input JSON: ${e instanceof Error ? e.message : String(e)}`);
|
|
133
|
+
}
|
|
134
|
+
// Attached over-the-wire (RO-3): forward each emitted RemoteOpProgress to the progress channel so a
|
|
135
|
+
// remote caller's onProgress fires live. No-op when the caller didn't open a channel (sync calls).
|
|
136
|
+
const onProgress = input.progressChannelId
|
|
137
|
+
? (p) => {
|
|
138
|
+
void pubSub.publish(REMOTE_OP_PROGRESS_TOPIC, { ChannelId: input.progressChannelId, ProgressJSON: JSON.stringify(p) });
|
|
139
|
+
}
|
|
140
|
+
: undefined;
|
|
141
|
+
// Route through the per-request provider (server in-process path; runs the op's Authorize + InternalExecute).
|
|
142
|
+
const result = await provider.RouteOperation(key, parsedInput, { user, mode: input.invokeMode, onProgress });
|
|
143
|
+
return {
|
|
144
|
+
success: result.Success,
|
|
145
|
+
resultCode: result.ResultCode,
|
|
146
|
+
outputJSON: result.Output !== undefined ? JSON.stringify(result.Output) : undefined,
|
|
147
|
+
handle: result.Handle,
|
|
148
|
+
errorMessage: result.ErrorMessage,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
catch (e) {
|
|
152
|
+
return fail('ERROR', e instanceof Error ? e.message : String(e));
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Subscription the client opens (with a self-generated `channelId`) immediately before calling
|
|
157
|
+
* `ExecuteRemoteOperation` with the same id in `progressChannelId`. The server publishes one event per
|
|
158
|
+
* `RemoteOpProgress` the operation emits; filtered by `channelId` so concurrent calls never interleave.
|
|
159
|
+
*/
|
|
160
|
+
RemoteOperationProgress(notification, _channelId) {
|
|
161
|
+
return notification;
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
__decorate([
|
|
165
|
+
Mutation(() => ExecuteRemoteOperationResultType),
|
|
166
|
+
__param(0, Arg('input')),
|
|
167
|
+
__param(1, Ctx()),
|
|
168
|
+
__param(2, PubSub()),
|
|
169
|
+
__metadata("design:type", Function),
|
|
170
|
+
__metadata("design:paramtypes", [ExecuteRemoteOperationInput, Object, PubSubEngine]),
|
|
171
|
+
__metadata("design:returntype", Promise)
|
|
172
|
+
], ExecuteRemoteOperationResolver.prototype, "ExecuteRemoteOperation", null);
|
|
173
|
+
__decorate([
|
|
174
|
+
Subscription(() => RemoteOperationProgressNotification, {
|
|
175
|
+
topics: REMOTE_OP_PROGRESS_TOPIC,
|
|
176
|
+
filter: ({ payload, args }) => payload.ChannelId === args.channelId,
|
|
177
|
+
}),
|
|
178
|
+
__param(0, Root()),
|
|
179
|
+
__param(1, Arg('channelId', () => ID)),
|
|
180
|
+
__metadata("design:type", Function),
|
|
181
|
+
__metadata("design:paramtypes", [RemoteOperationProgressNotification, String]),
|
|
182
|
+
__metadata("design:returntype", RemoteOperationProgressNotification)
|
|
183
|
+
], ExecuteRemoteOperationResolver.prototype, "RemoteOperationProgress", null);
|
|
184
|
+
ExecuteRemoteOperationResolver = __decorate([
|
|
185
|
+
Resolver()
|
|
186
|
+
], ExecuteRemoteOperationResolver);
|
|
187
|
+
export { ExecuteRemoteOperationResolver };
|
|
188
|
+
/** Builds a failed result. */
|
|
189
|
+
function fail(resultCode, errorMessage) {
|
|
190
|
+
return { success: false, resultCode, errorMessage };
|
|
191
|
+
}
|
|
192
|
+
//# sourceMappingURL=ExecuteRemoteOperationResolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExecuteRemoteOperationResolver.js","sourceRoot":"","sources":["../../src/resolvers/ExecuteRemoteOperationResolver.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACxI,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAwC,MAAM,sBAAsB,CAAC;AACpG,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAElD,kGAAkG;AAClG,MAAM,wBAAwB,GAAG,yBAAyB,CAAC;AAE3D,iEAAiE;AAE1D,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;CAiBvC,CAAA;AAfG;IADC,KAAK,EA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UAAU,EAAE,YAAY,EAAE,CAAC;AACxD,CAAC"}
|
|
@@ -300,6 +300,60 @@ declare class MutationResultOutput {
|
|
|
300
300
|
Success: boolean;
|
|
301
301
|
Message: string;
|
|
302
302
|
}
|
|
303
|
+
declare class IntegrationSyncConfigInput {
|
|
304
|
+
SyncConcurrency?: number;
|
|
305
|
+
MaxConcurrency?: number;
|
|
306
|
+
RateLimitTokensPerSec?: number;
|
|
307
|
+
RateLimitBurst?: number;
|
|
308
|
+
CrossLayerPipeline?: boolean;
|
|
309
|
+
PartitionReconcile?: boolean;
|
|
310
|
+
DiscoveryTimeBudgetMs?: number;
|
|
311
|
+
DiscoveryBatchSize?: number;
|
|
312
|
+
DiscoveryMaxRecords?: number;
|
|
313
|
+
DeactivateAbsent?: boolean;
|
|
314
|
+
}
|
|
315
|
+
declare class IntegrationSyncConfigOutput {
|
|
316
|
+
Success: boolean;
|
|
317
|
+
Message: string;
|
|
318
|
+
SyncConcurrency?: number;
|
|
319
|
+
MaxConcurrency?: number;
|
|
320
|
+
RateLimitTokensPerSec?: number;
|
|
321
|
+
RateLimitBurst?: number;
|
|
322
|
+
CrossLayerPipeline?: boolean;
|
|
323
|
+
PartitionReconcile?: boolean;
|
|
324
|
+
DiscoveryTimeBudgetMs?: number;
|
|
325
|
+
DiscoveryBatchSize?: number;
|
|
326
|
+
DiscoveryMaxRecords?: number;
|
|
327
|
+
DeactivateAbsent?: boolean;
|
|
328
|
+
}
|
|
329
|
+
declare class CustomColumnCandidate {
|
|
330
|
+
EntityName: string;
|
|
331
|
+
/** The source field key as captured in the overflow column. */
|
|
332
|
+
SourceKey: string;
|
|
333
|
+
/** The sanitized, collision-resolved column name that would be created. */
|
|
334
|
+
ColumnName: string;
|
|
335
|
+
/** Inferred schema-field type family ('string' | 'number' | 'boolean' | 'datetime'). */
|
|
336
|
+
InferredType: string;
|
|
337
|
+
/** true = the real column does not exist yet (ADD COLUMN); false = recovery (column exists, mapping missing). */
|
|
338
|
+
NeedsColumn: boolean;
|
|
339
|
+
}
|
|
340
|
+
declare class CustomColumnCandidatesOutput {
|
|
341
|
+
Success: boolean;
|
|
342
|
+
Message: string;
|
|
343
|
+
Candidates: CustomColumnCandidate[];
|
|
344
|
+
}
|
|
345
|
+
declare class PromotedColumn {
|
|
346
|
+
EntityName: string;
|
|
347
|
+
ColumnName: string;
|
|
348
|
+
}
|
|
349
|
+
declare class PromoteCustomColumnsOutput {
|
|
350
|
+
Success: boolean;
|
|
351
|
+
Message: string;
|
|
352
|
+
Promoted: boolean;
|
|
353
|
+
ColumnsAdded: PromotedColumn[];
|
|
354
|
+
/** true when an RSU schema change ran (a server restart may be pending to expose the new columns). */
|
|
355
|
+
SchemaUpdatePending: boolean;
|
|
356
|
+
}
|
|
303
357
|
declare class FieldMapInput {
|
|
304
358
|
SourceFieldName: string;
|
|
305
359
|
DestinationFieldName: string;
|
|
@@ -345,6 +399,10 @@ declare class CreateScheduleInput {
|
|
|
345
399
|
Description?: string;
|
|
346
400
|
SyncDirection?: string;
|
|
347
401
|
FullSync?: boolean;
|
|
402
|
+
/** §13 — 'sync' (default; moves data via RunSync) or 'discovery' (schema-only RefreshConnectorSchema on cron, evolving the IO/IOF catalog — no RSU, no data sync). */
|
|
403
|
+
JobKind?: string;
|
|
404
|
+
/** Discovery-job only: deactivate objects/fields absent from an authoritative refresh (reversible). Default true. */
|
|
405
|
+
DeactivateAbsent?: boolean;
|
|
348
406
|
}
|
|
349
407
|
declare class CreateScheduleOutput {
|
|
350
408
|
Success: boolean;
|
|
@@ -598,7 +656,7 @@ export declare class IntegrationDiscoveryResolver extends ResolverBase {
|
|
|
598
656
|
* both on stdout (visible in the MJAPI log file) and in a per-run
|
|
599
657
|
* `<cwd>/logs/integration-runs/<runID>/progress.jsonl` artifact.
|
|
600
658
|
*/
|
|
601
|
-
IntegrationRefreshConnectorSchema(companyIntegrationID: string, universalPKConvention: string | undefined, ctx: AppContext): Promise<RefreshConnectorSchemaOutput>;
|
|
659
|
+
IntegrationRefreshConnectorSchema(companyIntegrationID: string, universalPKConvention: string | undefined, deactivateAbsent: boolean | undefined, ctx: AppContext): Promise<RefreshConnectorSchemaOutput>;
|
|
602
660
|
/**
|
|
603
661
|
* Generates + persists strongly-typed Action metadata on demand for an
|
|
604
662
|
* integration object. When `verb` is supplied, a single Action is generated
|
|
@@ -838,6 +896,37 @@ export declare class IntegrationDiscoveryResolver extends ResolverBase {
|
|
|
838
896
|
* Updates credential values and/or configuration on an existing CompanyIntegration.
|
|
839
897
|
*/
|
|
840
898
|
IntegrationUpdateConnection(companyIntegrationID: string, credentialValues: string, configuration: string, externalSystemID: string, testConnection: boolean, runSchemaRefresh: boolean, universalPKConvention: string | undefined, ctx: AppContext): Promise<MutationResultOutput>;
|
|
899
|
+
/**
|
|
900
|
+
* Sets the per-connection sync tuning (rate limit, concurrency, time budget, pipeline flags) as
|
|
901
|
+
* STRUCTURED typed fields, merged into CompanyIntegration.Configuration (other keys preserved).
|
|
902
|
+
* These are the exact keys the IntegrationEngine reads at runtime, so they become customizable
|
|
903
|
+
* via the API instead of hidden code constants. Returns the merged config typed.
|
|
904
|
+
*/
|
|
905
|
+
IntegrationSetSyncConfig(companyIntegrationID: string, config: IntegrationSyncConfigInput, ctx: AppContext): Promise<IntegrationSyncConfigOutput>;
|
|
906
|
+
/** Reads the per-connection sync tuning back as STRUCTURED typed fields. */
|
|
907
|
+
IntegrationGetSyncConfig(companyIntegrationID: string, ctx: AppContext): Promise<IntegrationSyncConfigOutput>;
|
|
908
|
+
/** Reads a single boolean key from a CompanyIntegration.Configuration JSON string (undefined if absent/malformed). */
|
|
909
|
+
private readConfigBool;
|
|
910
|
+
/** Extracts the typed sync-config fields from a parsed Configuration object (type-guarded). */
|
|
911
|
+
private readSyncConfig;
|
|
912
|
+
/** The MJ entity names this connection has entity maps for (for whole-connection scope). */
|
|
913
|
+
private getMappedEntityNames;
|
|
914
|
+
/**
|
|
915
|
+
* Lists the custom-column CANDIDATES captured in the overflow column awaiting promotion — the "new
|
|
916
|
+
* columns found" for a connection. READ-ONLY (no schema change, no RSU). Scope to one entity via
|
|
917
|
+
* entityName, or omit to list across all the connection's mapped entities. Computed live (overflow keys
|
|
918
|
+
* minus already-mapped/already-a-column), so it is inherently deduped against anything a concurrent
|
|
919
|
+
* discovery already promoted.
|
|
920
|
+
*/
|
|
921
|
+
IntegrationListCustomColumnCandidates(companyIntegrationID: string, entityName: string | undefined, ctx: AppContext): Promise<CustomColumnCandidatesOutput>;
|
|
922
|
+
/**
|
|
923
|
+
* On-demand promotion of captured custom columns: runs RSU (ADD COLUMN + register EntityField + field map),
|
|
924
|
+
* which may require a server restart to expose them over GraphQL. This is the USER-ACCEPTED trigger — by
|
|
925
|
+
* default a sync only CAPTURES to the overflow column (auto-promote is opt-in per connection via
|
|
926
|
+
* Configuration.autoPromoteCustomColumns). Scope via entityNames, or omit to promote across all mapped
|
|
927
|
+
* entities. Idempotent: already-promoted/mapped keys are skipped (safe to re-run / run alongside discovery).
|
|
928
|
+
*/
|
|
929
|
+
IntegrationPromoteCustomColumns(companyIntegrationID: string, entityNames: string[] | undefined, ctx: AppContext): Promise<PromoteCustomColumnsOutput>;
|
|
841
930
|
/**
|
|
842
931
|
* Soft-deletes a CompanyIntegration by setting IsActive=false.
|
|
843
932
|
*/
|
|
@@ -895,6 +984,17 @@ export declare class IntegrationDiscoveryResolver extends ResolverBase {
|
|
|
895
984
|
* Build schema artifacts for a single connector's objects.
|
|
896
985
|
* Shared by IntegrationApplySchema (single) and IntegrationApplySchemaBatch (batch).
|
|
897
986
|
*/
|
|
987
|
+
/**
|
|
988
|
+
* §B — enforce OPTIONAL table/column caps at the create-tables (RSU) gate. These are OPERATOR
|
|
989
|
+
* (deployment) guardrails read from ENV — `MJ_INTEGRATION_MAX_TABLES` / `MJ_INTEGRATION_MAX_COLUMNS_PER_TABLE`
|
|
990
|
+
* (absent or ≤0 = unbounded, the common case). They are DELIBERATELY env-only, NOT per-connection
|
|
991
|
+
* `Configuration`/GraphQL: a guardrail a user can raise via the same API they apply with is toothless.
|
|
992
|
+
* THROWS a clear error when the selection exceeds a cap so NOTHING partial is created — the caller surfaces
|
|
993
|
+
* it and the user narrows the selection (the cap itself is an operator concern). NEVER truncates. Discovery
|
|
994
|
+
* still surfaces every object/field; only materialization is capped. Per-table column count = the selected
|
|
995
|
+
* field subset, or the object's full discovered field count when all fields are selected.
|
|
996
|
+
*/
|
|
997
|
+
private enforceSchemaLimits;
|
|
898
998
|
private buildSchemaForConnector;
|
|
899
999
|
/**
|
|
900
1000
|
* Starts an async integration sync. Returns immediately with the run ID.
|