@memberjunction/server 5.15.0 → 5.17.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/README.md +66 -3
- package/dist/auth/index.d.ts +0 -3
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +5 -7
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/initializeProviders.js +2 -2
- package/dist/auth/initializeProviders.js.map +1 -1
- package/dist/config.d.ts +51 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +7 -0
- package/dist/config.js.map +1 -1
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +3 -3
- package/dist/context.js.map +1 -1
- package/dist/generated/generated.d.ts +46 -46
- package/dist/generated/generated.d.ts.map +1 -1
- package/dist/generated/generated.js +332 -332
- package/dist/generated/generated.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +327 -2
- package/dist/index.js.map +1 -1
- package/dist/resolvers/DatasetResolver.d.ts +5 -0
- package/dist/resolvers/DatasetResolver.d.ts.map +1 -1
- package/dist/resolvers/DatasetResolver.js +35 -0
- package/dist/resolvers/DatasetResolver.js.map +1 -1
- package/dist/resolvers/IntegrationDiscoveryResolver.d.ts +484 -0
- package/dist/resolvers/IntegrationDiscoveryResolver.d.ts.map +1 -1
- package/dist/resolvers/IntegrationDiscoveryResolver.js +3867 -328
- package/dist/resolvers/IntegrationDiscoveryResolver.js.map +1 -1
- package/dist/resolvers/RSUResolver.d.ts +89 -0
- package/dist/resolvers/RSUResolver.d.ts.map +1 -0
- package/dist/resolvers/RSUResolver.js +424 -0
- package/dist/resolvers/RSUResolver.js.map +1 -0
- package/package.json +63 -60
- package/src/__tests__/unifiedAuth.test.ts +3 -2
- package/src/auth/__tests__/backward-compatibility.test.ts +2 -3
- package/src/auth/index.ts +5 -8
- package/src/auth/initializeProviders.ts +2 -2
- package/src/config.ts +9 -0
- package/src/context.ts +3 -3
- package/src/generated/generated.ts +269 -269
- package/src/index.ts +371 -4
- package/src/resolvers/DatasetResolver.ts +36 -0
- package/src/resolvers/IntegrationDiscoveryResolver.ts +2970 -39
- package/src/resolvers/RSUResolver.ts +351 -0
- package/dist/auth/AuthProviderFactory.d.ts +0 -68
- package/dist/auth/AuthProviderFactory.d.ts.map +0 -1
- package/dist/auth/AuthProviderFactory.js +0 -155
- package/dist/auth/AuthProviderFactory.js.map +0 -1
- package/dist/auth/BaseAuthProvider.d.ts +0 -41
- package/dist/auth/BaseAuthProvider.d.ts.map +0 -1
- package/dist/auth/BaseAuthProvider.js +0 -102
- package/dist/auth/BaseAuthProvider.js.map +0 -1
- package/dist/auth/IAuthProvider.d.ts +0 -46
- package/dist/auth/IAuthProvider.d.ts.map +0 -1
- package/dist/auth/IAuthProvider.js +0 -2
- package/dist/auth/IAuthProvider.js.map +0 -1
- package/dist/auth/providers/Auth0Provider.d.ts +0 -18
- package/dist/auth/providers/Auth0Provider.d.ts.map +0 -1
- package/dist/auth/providers/Auth0Provider.js +0 -52
- package/dist/auth/providers/Auth0Provider.js.map +0 -1
- package/dist/auth/providers/CognitoProvider.d.ts +0 -18
- package/dist/auth/providers/CognitoProvider.d.ts.map +0 -1
- package/dist/auth/providers/CognitoProvider.js +0 -56
- package/dist/auth/providers/CognitoProvider.js.map +0 -1
- package/dist/auth/providers/GoogleProvider.d.ts +0 -18
- package/dist/auth/providers/GoogleProvider.d.ts.map +0 -1
- package/dist/auth/providers/GoogleProvider.js +0 -51
- package/dist/auth/providers/GoogleProvider.js.map +0 -1
- package/dist/auth/providers/MSALProvider.d.ts +0 -18
- package/dist/auth/providers/MSALProvider.d.ts.map +0 -1
- package/dist/auth/providers/MSALProvider.js +0 -52
- package/dist/auth/providers/MSALProvider.js.map +0 -1
- package/dist/auth/providers/OktaProvider.d.ts +0 -18
- package/dist/auth/providers/OktaProvider.d.ts.map +0 -1
- package/dist/auth/providers/OktaProvider.js +0 -52
- package/dist/auth/providers/OktaProvider.js.map +0 -1
- package/dist/auth/tokenExpiredError.d.ts +0 -5
- package/dist/auth/tokenExpiredError.d.ts.map +0 -1
- package/dist/auth/tokenExpiredError.js +0 -12
- package/dist/auth/tokenExpiredError.js.map +0 -1
- package/src/auth/AuthProviderFactory.ts +0 -182
- package/src/auth/BaseAuthProvider.ts +0 -137
- package/src/auth/IAuthProvider.ts +0 -54
- package/src/auth/providers/Auth0Provider.ts +0 -45
- package/src/auth/providers/CognitoProvider.ts +0 -50
- package/src/auth/providers/GoogleProvider.ts +0 -45
- package/src/auth/providers/MSALProvider.ts +0 -45
- package/src/auth/providers/OktaProvider.ts +0 -46
- package/src/auth/tokenExpiredError.ts +0 -12
|
@@ -0,0 +1,424 @@
|
|
|
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
|
+
/**
|
|
14
|
+
* RSUResolver — GraphQL API for the Runtime Schema Update pipeline.
|
|
15
|
+
*
|
|
16
|
+
* Exposes:
|
|
17
|
+
* - Query: RuntimeSchemaUpdateStatus — current RSU system status
|
|
18
|
+
* - Mutation: RunRuntimeSchemaUpdate — execute the full RSU pipeline
|
|
19
|
+
* - Mutation: PreviewRuntimeSchemaUpdate — dry-run preview
|
|
20
|
+
*
|
|
21
|
+
* All mutations require system user authorization.
|
|
22
|
+
*/
|
|
23
|
+
import { Arg, Ctx, Field, InputType, Mutation, ObjectType, Query, Resolver, Int, } from 'type-graphql';
|
|
24
|
+
import { RequireSystemUser } from '../directives/RequireSystemUser.js';
|
|
25
|
+
import { RuntimeSchemaManager, } from '@memberjunction/schema-engine';
|
|
26
|
+
import { readFileSync, existsSync } from 'node:fs';
|
|
27
|
+
// ─── RSU Input Types ─────────────────────────────────────────────────
|
|
28
|
+
let RSUMetadataFileInput = class RSUMetadataFileInput {
|
|
29
|
+
};
|
|
30
|
+
__decorate([
|
|
31
|
+
Field(() => String),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], RSUMetadataFileInput.prototype, "Path", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
Field(() => String),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], RSUMetadataFileInput.prototype, "Content", void 0);
|
|
38
|
+
RSUMetadataFileInput = __decorate([
|
|
39
|
+
InputType()
|
|
40
|
+
], RSUMetadataFileInput);
|
|
41
|
+
export { RSUMetadataFileInput };
|
|
42
|
+
let RSUPipelineInputGQL = class RSUPipelineInputGQL {
|
|
43
|
+
};
|
|
44
|
+
__decorate([
|
|
45
|
+
Field(() => String, { description: 'The migration SQL to execute' }),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], RSUPipelineInputGQL.prototype, "MigrationSQL", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
Field(() => String, { description: 'Descriptive name for this schema change' }),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], RSUPipelineInputGQL.prototype, "Description", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
Field(() => [String], { description: 'Tables being created or modified' }),
|
|
54
|
+
__metadata("design:type", Array)
|
|
55
|
+
], RSUPipelineInputGQL.prototype, "AffectedTables", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
Field(() => String, { nullable: true, description: 'additionalSchemaInfo JSON for soft FKs' }),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], RSUPipelineInputGQL.prototype, "AdditionalSchemaInfo", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
Field(() => [RSUMetadataFileInput], { nullable: true, description: 'Metadata JSON files for mj-sync' }),
|
|
62
|
+
__metadata("design:type", Array)
|
|
63
|
+
], RSUPipelineInputGQL.prototype, "MetadataFiles", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
Field(() => Boolean, { nullable: true, description: 'Skip git commit/push step' }),
|
|
66
|
+
__metadata("design:type", Boolean)
|
|
67
|
+
], RSUPipelineInputGQL.prototype, "SkipGitCommit", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
Field(() => Boolean, { nullable: true, description: 'Skip MJAPI restart' }),
|
|
70
|
+
__metadata("design:type", Boolean)
|
|
71
|
+
], RSUPipelineInputGQL.prototype, "SkipRestart", void 0);
|
|
72
|
+
RSUPipelineInputGQL = __decorate([
|
|
73
|
+
InputType()
|
|
74
|
+
], RSUPipelineInputGQL);
|
|
75
|
+
export { RSUPipelineInputGQL };
|
|
76
|
+
// ─── Output Types ────────────────────────────────────────────────────
|
|
77
|
+
let RSUPipelineStepGQL = class RSUPipelineStepGQL {
|
|
78
|
+
};
|
|
79
|
+
__decorate([
|
|
80
|
+
Field(() => String),
|
|
81
|
+
__metadata("design:type", String)
|
|
82
|
+
], RSUPipelineStepGQL.prototype, "Name", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
Field(() => String),
|
|
85
|
+
__metadata("design:type", String)
|
|
86
|
+
], RSUPipelineStepGQL.prototype, "Status", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
Field(() => Int),
|
|
89
|
+
__metadata("design:type", Number)
|
|
90
|
+
], RSUPipelineStepGQL.prototype, "DurationMs", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
Field(() => String),
|
|
93
|
+
__metadata("design:type", String)
|
|
94
|
+
], RSUPipelineStepGQL.prototype, "Message", void 0);
|
|
95
|
+
RSUPipelineStepGQL = __decorate([
|
|
96
|
+
ObjectType()
|
|
97
|
+
], RSUPipelineStepGQL);
|
|
98
|
+
export { RSUPipelineStepGQL };
|
|
99
|
+
let RSUPipelineResultGQL = class RSUPipelineResultGQL {
|
|
100
|
+
};
|
|
101
|
+
__decorate([
|
|
102
|
+
Field(() => Boolean),
|
|
103
|
+
__metadata("design:type", Boolean)
|
|
104
|
+
], RSUPipelineResultGQL.prototype, "Success", void 0);
|
|
105
|
+
__decorate([
|
|
106
|
+
Field(() => String, { nullable: true }),
|
|
107
|
+
__metadata("design:type", String)
|
|
108
|
+
], RSUPipelineResultGQL.prototype, "BranchName", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
Field(() => String, { nullable: true }),
|
|
111
|
+
__metadata("design:type", String)
|
|
112
|
+
], RSUPipelineResultGQL.prototype, "MigrationFilePath", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
Field(() => Int, { nullable: true }),
|
|
115
|
+
__metadata("design:type", Number)
|
|
116
|
+
], RSUPipelineResultGQL.prototype, "EntitiesProcessed", void 0);
|
|
117
|
+
__decorate([
|
|
118
|
+
Field(() => Boolean),
|
|
119
|
+
__metadata("design:type", Boolean)
|
|
120
|
+
], RSUPipelineResultGQL.prototype, "APIRestarted", void 0);
|
|
121
|
+
__decorate([
|
|
122
|
+
Field(() => Boolean),
|
|
123
|
+
__metadata("design:type", Boolean)
|
|
124
|
+
], RSUPipelineResultGQL.prototype, "GitCommitSuccess", void 0);
|
|
125
|
+
__decorate([
|
|
126
|
+
Field(() => [RSUPipelineStepGQL]),
|
|
127
|
+
__metadata("design:type", Array)
|
|
128
|
+
], RSUPipelineResultGQL.prototype, "Steps", void 0);
|
|
129
|
+
__decorate([
|
|
130
|
+
Field(() => String, { nullable: true }),
|
|
131
|
+
__metadata("design:type", String)
|
|
132
|
+
], RSUPipelineResultGQL.prototype, "ErrorMessage", void 0);
|
|
133
|
+
__decorate([
|
|
134
|
+
Field(() => String, { nullable: true }),
|
|
135
|
+
__metadata("design:type", String)
|
|
136
|
+
], RSUPipelineResultGQL.prototype, "ErrorStep", void 0);
|
|
137
|
+
RSUPipelineResultGQL = __decorate([
|
|
138
|
+
ObjectType()
|
|
139
|
+
], RSUPipelineResultGQL);
|
|
140
|
+
export { RSUPipelineResultGQL };
|
|
141
|
+
let RSUPipelineBatchResultGQL = class RSUPipelineBatchResultGQL {
|
|
142
|
+
};
|
|
143
|
+
__decorate([
|
|
144
|
+
Field(() => [RSUPipelineResultGQL]),
|
|
145
|
+
__metadata("design:type", Array)
|
|
146
|
+
], RSUPipelineBatchResultGQL.prototype, "Results", void 0);
|
|
147
|
+
__decorate([
|
|
148
|
+
Field(() => Int),
|
|
149
|
+
__metadata("design:type", Number)
|
|
150
|
+
], RSUPipelineBatchResultGQL.prototype, "SuccessCount", void 0);
|
|
151
|
+
__decorate([
|
|
152
|
+
Field(() => Int),
|
|
153
|
+
__metadata("design:type", Number)
|
|
154
|
+
], RSUPipelineBatchResultGQL.prototype, "FailureCount", void 0);
|
|
155
|
+
__decorate([
|
|
156
|
+
Field(() => Int),
|
|
157
|
+
__metadata("design:type", Number)
|
|
158
|
+
], RSUPipelineBatchResultGQL.prototype, "TotalCount", void 0);
|
|
159
|
+
RSUPipelineBatchResultGQL = __decorate([
|
|
160
|
+
ObjectType()
|
|
161
|
+
], RSUPipelineBatchResultGQL);
|
|
162
|
+
export { RSUPipelineBatchResultGQL };
|
|
163
|
+
let RSUPreviewResultGQL = class RSUPreviewResultGQL {
|
|
164
|
+
};
|
|
165
|
+
__decorate([
|
|
166
|
+
Field(() => String),
|
|
167
|
+
__metadata("design:type", String)
|
|
168
|
+
], RSUPreviewResultGQL.prototype, "MigrationSQL", void 0);
|
|
169
|
+
__decorate([
|
|
170
|
+
Field(() => [String]),
|
|
171
|
+
__metadata("design:type", Array)
|
|
172
|
+
], RSUPreviewResultGQL.prototype, "AffectedTables", void 0);
|
|
173
|
+
__decorate([
|
|
174
|
+
Field(() => [String]),
|
|
175
|
+
__metadata("design:type", Array)
|
|
176
|
+
], RSUPreviewResultGQL.prototype, "ValidationErrors", void 0);
|
|
177
|
+
__decorate([
|
|
178
|
+
Field(() => Boolean),
|
|
179
|
+
__metadata("design:type", Boolean)
|
|
180
|
+
], RSUPreviewResultGQL.prototype, "WouldExecute", void 0);
|
|
181
|
+
RSUPreviewResultGQL = __decorate([
|
|
182
|
+
ObjectType()
|
|
183
|
+
], RSUPreviewResultGQL);
|
|
184
|
+
export { RSUPreviewResultGQL };
|
|
185
|
+
let RSUStatusGQL = class RSUStatusGQL {
|
|
186
|
+
};
|
|
187
|
+
__decorate([
|
|
188
|
+
Field(() => Boolean),
|
|
189
|
+
__metadata("design:type", Boolean)
|
|
190
|
+
], RSUStatusGQL.prototype, "Enabled", void 0);
|
|
191
|
+
__decorate([
|
|
192
|
+
Field(() => Boolean),
|
|
193
|
+
__metadata("design:type", Boolean)
|
|
194
|
+
], RSUStatusGQL.prototype, "Running", void 0);
|
|
195
|
+
__decorate([
|
|
196
|
+
Field(() => Boolean),
|
|
197
|
+
__metadata("design:type", Boolean)
|
|
198
|
+
], RSUStatusGQL.prototype, "OutOfSync", void 0);
|
|
199
|
+
__decorate([
|
|
200
|
+
Field(() => Date, { nullable: true }),
|
|
201
|
+
__metadata("design:type", Date)
|
|
202
|
+
], RSUStatusGQL.prototype, "OutOfSyncSince", void 0);
|
|
203
|
+
__decorate([
|
|
204
|
+
Field(() => Date, { nullable: true }),
|
|
205
|
+
__metadata("design:type", Date)
|
|
206
|
+
], RSUStatusGQL.prototype, "LastRunAt", void 0);
|
|
207
|
+
__decorate([
|
|
208
|
+
Field(() => String, { nullable: true }),
|
|
209
|
+
__metadata("design:type", String)
|
|
210
|
+
], RSUStatusGQL.prototype, "LastRunResult", void 0);
|
|
211
|
+
RSUStatusGQL = __decorate([
|
|
212
|
+
ObjectType()
|
|
213
|
+
], RSUStatusGQL);
|
|
214
|
+
export { RSUStatusGQL };
|
|
215
|
+
let RSUQueueStatusGQL = class RSUQueueStatusGQL {
|
|
216
|
+
};
|
|
217
|
+
__decorate([
|
|
218
|
+
Field(() => Int),
|
|
219
|
+
__metadata("design:type", Number)
|
|
220
|
+
], RSUQueueStatusGQL.prototype, "PendingCount", void 0);
|
|
221
|
+
__decorate([
|
|
222
|
+
Field(() => Boolean),
|
|
223
|
+
__metadata("design:type", Boolean)
|
|
224
|
+
], RSUQueueStatusGQL.prototype, "IsCycleRunning", void 0);
|
|
225
|
+
RSUQueueStatusGQL = __decorate([
|
|
226
|
+
ObjectType()
|
|
227
|
+
], RSUQueueStatusGQL);
|
|
228
|
+
export { RSUQueueStatusGQL };
|
|
229
|
+
// ─── Resolver ────────────────────────────────────────────────────────
|
|
230
|
+
let RSUResolver = class RSUResolver {
|
|
231
|
+
/**
|
|
232
|
+
* Query: Get current RSU system status.
|
|
233
|
+
* Available to any authenticated user (status is informational).
|
|
234
|
+
*/
|
|
235
|
+
RuntimeSchemaUpdateStatus() {
|
|
236
|
+
const rsm = RuntimeSchemaManager.Instance;
|
|
237
|
+
const status = rsm.GetStatus();
|
|
238
|
+
return {
|
|
239
|
+
Enabled: status.Enabled,
|
|
240
|
+
Running: status.Running,
|
|
241
|
+
OutOfSync: status.OutOfSync,
|
|
242
|
+
OutOfSyncSince: status.OutOfSyncSince,
|
|
243
|
+
LastRunAt: status.LastRunAt,
|
|
244
|
+
LastRunResult: status.LastRunResult,
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Query: Tail the RSU pipeline log file. Returns the last N lines.
|
|
249
|
+
*/
|
|
250
|
+
RuntimeSchemaUpdateLogTail(lines) {
|
|
251
|
+
try {
|
|
252
|
+
const logPath = `${process.env.RSU_WORK_DIR || process.cwd()}/rsu-pipeline.log`;
|
|
253
|
+
if (!existsSync(logPath))
|
|
254
|
+
return ['(no log file found)'];
|
|
255
|
+
const content = readFileSync(logPath, 'utf-8');
|
|
256
|
+
const allLines = content.split('\n').filter(l => l.trim());
|
|
257
|
+
const maxLines = Math.min(Math.max(lines, 1), 1000);
|
|
258
|
+
return allLines.slice(-maxLines);
|
|
259
|
+
}
|
|
260
|
+
catch (e) {
|
|
261
|
+
return [`Error reading log: ${e.message}`];
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Query: Get RSU CodeGen queue status.
|
|
266
|
+
* Shows how many requests are pending and whether a cycle is running.
|
|
267
|
+
*/
|
|
268
|
+
RuntimeSchemaUpdateQueueStatus() {
|
|
269
|
+
const rsm = RuntimeSchemaManager.Instance;
|
|
270
|
+
return {
|
|
271
|
+
PendingCount: 0, // Batching is explicit via RunPipelineBatch — no implicit queue
|
|
272
|
+
IsCycleRunning: rsm.IsRunning,
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Mutation: Execute the full RSU pipeline.
|
|
277
|
+
* Requires system user authorization.
|
|
278
|
+
*/
|
|
279
|
+
async RunRuntimeSchemaUpdate(input, _ctx) {
|
|
280
|
+
const rsm = RuntimeSchemaManager.Instance;
|
|
281
|
+
const pipelineInput = {
|
|
282
|
+
MigrationSQL: input.MigrationSQL,
|
|
283
|
+
Description: input.Description,
|
|
284
|
+
AffectedTables: input.AffectedTables,
|
|
285
|
+
AdditionalSchemaInfo: input.AdditionalSchemaInfo ?? undefined,
|
|
286
|
+
MetadataFiles: input.MetadataFiles?.map(mf => ({ Path: mf.Path, Content: mf.Content })),
|
|
287
|
+
SkipGitCommit: input.SkipGitCommit ?? undefined,
|
|
288
|
+
SkipRestart: input.SkipRestart ?? undefined,
|
|
289
|
+
};
|
|
290
|
+
const result = await rsm.RunPipeline(pipelineInput);
|
|
291
|
+
return {
|
|
292
|
+
Success: result.Success,
|
|
293
|
+
BranchName: result.BranchName,
|
|
294
|
+
MigrationFilePath: result.MigrationFilePath,
|
|
295
|
+
EntitiesProcessed: result.EntitiesProcessed,
|
|
296
|
+
APIRestarted: result.APIRestarted,
|
|
297
|
+
GitCommitSuccess: result.GitCommitSuccess,
|
|
298
|
+
Steps: result.Steps.map(s => ({
|
|
299
|
+
Name: s.Name,
|
|
300
|
+
Status: s.Status,
|
|
301
|
+
DurationMs: s.DurationMs,
|
|
302
|
+
Message: s.Message,
|
|
303
|
+
})),
|
|
304
|
+
ErrorMessage: result.ErrorMessage,
|
|
305
|
+
ErrorStep: result.ErrorStep,
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Mutation: Execute the RSU pipeline for a batch of inputs.
|
|
310
|
+
* All migrations execute under one lock, then one CodeGen/compile/restart/git.
|
|
311
|
+
* Per-item migration results + shared post-migration result.
|
|
312
|
+
*/
|
|
313
|
+
async RunRuntimeSchemaUpdateBatch(inputs, _ctx) {
|
|
314
|
+
const rsm = RuntimeSchemaManager.Instance;
|
|
315
|
+
const pipelineInputs = inputs.map(input => ({
|
|
316
|
+
MigrationSQL: input.MigrationSQL,
|
|
317
|
+
Description: input.Description,
|
|
318
|
+
AffectedTables: input.AffectedTables,
|
|
319
|
+
AdditionalSchemaInfo: input.AdditionalSchemaInfo ?? undefined,
|
|
320
|
+
MetadataFiles: input.MetadataFiles?.map(mf => ({ Path: mf.Path, Content: mf.Content })),
|
|
321
|
+
SkipGitCommit: input.SkipGitCommit ?? undefined,
|
|
322
|
+
SkipRestart: input.SkipRestart ?? undefined,
|
|
323
|
+
}));
|
|
324
|
+
const batchResult = await rsm.RunPipelineBatch(pipelineInputs);
|
|
325
|
+
return {
|
|
326
|
+
Results: batchResult.Results.map(result => ({
|
|
327
|
+
Success: result.Success,
|
|
328
|
+
BranchName: result.BranchName,
|
|
329
|
+
MigrationFilePath: result.MigrationFilePath,
|
|
330
|
+
EntitiesProcessed: result.EntitiesProcessed,
|
|
331
|
+
APIRestarted: result.APIRestarted,
|
|
332
|
+
GitCommitSuccess: result.GitCommitSuccess,
|
|
333
|
+
Steps: result.Steps.map(s => ({
|
|
334
|
+
Name: s.Name,
|
|
335
|
+
Status: s.Status,
|
|
336
|
+
DurationMs: s.DurationMs,
|
|
337
|
+
Message: s.Message,
|
|
338
|
+
})),
|
|
339
|
+
ErrorMessage: result.ErrorMessage,
|
|
340
|
+
ErrorStep: result.ErrorStep,
|
|
341
|
+
})),
|
|
342
|
+
SuccessCount: batchResult.SuccessCount,
|
|
343
|
+
FailureCount: batchResult.FailureCount,
|
|
344
|
+
TotalCount: batchResult.TotalCount,
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Mutation: Preview mode — validate SQL and return what would happen.
|
|
349
|
+
* Requires system user authorization.
|
|
350
|
+
*/
|
|
351
|
+
PreviewRuntimeSchemaUpdate(input, _ctx) {
|
|
352
|
+
const rsm = RuntimeSchemaManager.Instance;
|
|
353
|
+
const pipelineInput = {
|
|
354
|
+
MigrationSQL: input.MigrationSQL,
|
|
355
|
+
Description: input.Description,
|
|
356
|
+
AffectedTables: input.AffectedTables,
|
|
357
|
+
};
|
|
358
|
+
const preview = rsm.Preview(pipelineInput);
|
|
359
|
+
return {
|
|
360
|
+
MigrationSQL: preview.MigrationSQL,
|
|
361
|
+
AffectedTables: preview.AffectedTables,
|
|
362
|
+
ValidationErrors: preview.ValidationErrors,
|
|
363
|
+
WouldExecute: preview.WouldExecute,
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
__decorate([
|
|
368
|
+
Query(() => RSUStatusGQL, { description: 'Returns the current Runtime Schema Update status' }),
|
|
369
|
+
__metadata("design:type", Function),
|
|
370
|
+
__metadata("design:paramtypes", []),
|
|
371
|
+
__metadata("design:returntype", RSUStatusGQL)
|
|
372
|
+
], RSUResolver.prototype, "RuntimeSchemaUpdateStatus", null);
|
|
373
|
+
__decorate([
|
|
374
|
+
Query(() => [String], { description: 'Returns recent lines from the RSU pipeline log' }),
|
|
375
|
+
__param(0, Arg('lines', () => Int, { defaultValue: 100 })),
|
|
376
|
+
__metadata("design:type", Function),
|
|
377
|
+
__metadata("design:paramtypes", [Number]),
|
|
378
|
+
__metadata("design:returntype", Array)
|
|
379
|
+
], RSUResolver.prototype, "RuntimeSchemaUpdateLogTail", null);
|
|
380
|
+
__decorate([
|
|
381
|
+
Query(() => RSUQueueStatusGQL, { description: 'Returns the RSU pipeline status' }),
|
|
382
|
+
__metadata("design:type", Function),
|
|
383
|
+
__metadata("design:paramtypes", []),
|
|
384
|
+
__metadata("design:returntype", RSUQueueStatusGQL)
|
|
385
|
+
], RSUResolver.prototype, "RuntimeSchemaUpdateQueueStatus", null);
|
|
386
|
+
__decorate([
|
|
387
|
+
Mutation(() => RSUPipelineResultGQL, {
|
|
388
|
+
description: 'Execute the Runtime Schema Update pipeline. Requires system user.',
|
|
389
|
+
}),
|
|
390
|
+
RequireSystemUser(),
|
|
391
|
+
__param(0, Arg('input', () => RSUPipelineInputGQL)),
|
|
392
|
+
__param(1, Ctx()),
|
|
393
|
+
__metadata("design:type", Function),
|
|
394
|
+
__metadata("design:paramtypes", [RSUPipelineInputGQL, Object]),
|
|
395
|
+
__metadata("design:returntype", Promise)
|
|
396
|
+
], RSUResolver.prototype, "RunRuntimeSchemaUpdate", null);
|
|
397
|
+
__decorate([
|
|
398
|
+
Mutation(() => RSUPipelineBatchResultGQL, {
|
|
399
|
+
description: 'Execute Runtime Schema Update for a batch of inputs. Requires system user.',
|
|
400
|
+
}),
|
|
401
|
+
RequireSystemUser(),
|
|
402
|
+
__param(0, Arg('inputs', () => [RSUPipelineInputGQL])),
|
|
403
|
+
__param(1, Ctx()),
|
|
404
|
+
__metadata("design:type", Function),
|
|
405
|
+
__metadata("design:paramtypes", [Array, Object]),
|
|
406
|
+
__metadata("design:returntype", Promise)
|
|
407
|
+
], RSUResolver.prototype, "RunRuntimeSchemaUpdateBatch", null);
|
|
408
|
+
__decorate([
|
|
409
|
+
Mutation(() => RSUPreviewResultGQL, {
|
|
410
|
+
description: 'Preview Runtime Schema Update without executing. Requires system user.',
|
|
411
|
+
}),
|
|
412
|
+
RequireSystemUser(),
|
|
413
|
+
__param(0, Arg('input', () => RSUPipelineInputGQL)),
|
|
414
|
+
__param(1, Ctx()),
|
|
415
|
+
__metadata("design:type", Function),
|
|
416
|
+
__metadata("design:paramtypes", [RSUPipelineInputGQL, Object]),
|
|
417
|
+
__metadata("design:returntype", RSUPreviewResultGQL)
|
|
418
|
+
], RSUResolver.prototype, "PreviewRuntimeSchemaUpdate", null);
|
|
419
|
+
RSUResolver = __decorate([
|
|
420
|
+
Resolver()
|
|
421
|
+
], RSUResolver);
|
|
422
|
+
export { RSUResolver };
|
|
423
|
+
export default RSUResolver;
|
|
424
|
+
//# sourceMappingURL=RSUResolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RSUResolver.js","sourceRoot":"","sources":["../../src/resolvers/RSUResolver.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;GASG;AACH,OAAO,EACH,GAAG,EACH,GAAG,EACH,KAAK,EACL,SAAS,EACT,QAAQ,EACR,UAAU,EACV,KAAK,EACL,QAAQ,EACR,GAAG,GACN,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EACH,oBAAoB,GAEvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEnD,wEAAwE;AAGjE,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAMhC,CAAA;AAJG;IADC,KAAK,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;kDACP;AAGb;IADC,KAAK,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;qDACJ;AALP,oBAAoB;IADhC,SAAS,EAAE;GACC,oBAAoB,CAMhC;;AAGM,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;CAqB/B,CAAA;AAnBG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|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.17.0",
|
|
4
4
|
"description": "MemberJunction: This project provides API access via GraphQL to the common data store.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -27,66 +27,72 @@
|
|
|
27
27
|
"@as-integrations/express5": "^1.0.0",
|
|
28
28
|
"@graphql-tools/schema": "latest",
|
|
29
29
|
"@graphql-tools/utils": "^11.0.0",
|
|
30
|
-
"@memberjunction/actions": "5.
|
|
31
|
-
"@memberjunction/actions-
|
|
32
|
-
"@memberjunction/actions-
|
|
33
|
-
"@memberjunction/actions-bizapps-accounting": "5.
|
|
34
|
-
"@memberjunction/actions-bizapps-crm": "5.
|
|
35
|
-
"@memberjunction/actions-bizapps-formbuilders": "5.
|
|
36
|
-
"@memberjunction/actions-bizapps-lms": "5.
|
|
37
|
-
"@memberjunction/actions-bizapps-social": "5.
|
|
38
|
-
"@memberjunction/ai": "5.
|
|
39
|
-
"@memberjunction/ai-
|
|
40
|
-
"@memberjunction/ai-agent-manager": "5.
|
|
41
|
-
"@memberjunction/ai-
|
|
42
|
-
"@memberjunction/ai-
|
|
43
|
-
"@memberjunction/ai-
|
|
44
|
-
"@memberjunction/ai-prompts": "5.
|
|
45
|
-
"@memberjunction/ai-provider-bundle": "5.
|
|
46
|
-
"@memberjunction/ai-vectors-pinecone": "5.
|
|
47
|
-
"@memberjunction/aiengine": "5.
|
|
48
|
-
"@memberjunction/
|
|
49
|
-
"@memberjunction/
|
|
50
|
-
"@memberjunction/
|
|
51
|
-
"@memberjunction/
|
|
52
|
-
"@memberjunction/
|
|
53
|
-
"@memberjunction/
|
|
54
|
-
"@memberjunction/
|
|
55
|
-
"@memberjunction/
|
|
56
|
-
"@memberjunction/
|
|
57
|
-
"@memberjunction/
|
|
58
|
-
"@memberjunction/
|
|
59
|
-
"@memberjunction/
|
|
60
|
-
"@memberjunction/
|
|
61
|
-
"@memberjunction/
|
|
62
|
-
"@memberjunction/
|
|
63
|
-
"@memberjunction/
|
|
64
|
-
"@memberjunction/
|
|
65
|
-
"@memberjunction/
|
|
66
|
-
"@memberjunction/
|
|
67
|
-
"@memberjunction/
|
|
68
|
-
"@memberjunction/
|
|
69
|
-
"@memberjunction/
|
|
70
|
-
"@memberjunction/
|
|
71
|
-
"@memberjunction/
|
|
72
|
-
"@memberjunction/
|
|
73
|
-
"@memberjunction/
|
|
74
|
-
"@memberjunction/
|
|
75
|
-
"@memberjunction/
|
|
76
|
-
"@memberjunction/
|
|
77
|
-
"@memberjunction/
|
|
78
|
-
"@memberjunction/scheduling-
|
|
79
|
-
"@memberjunction/
|
|
80
|
-
"@memberjunction/
|
|
81
|
-
"@memberjunction/
|
|
82
|
-
"@memberjunction/
|
|
83
|
-
"@memberjunction/
|
|
84
|
-
"@memberjunction/
|
|
85
|
-
"@memberjunction/
|
|
30
|
+
"@memberjunction/actions": "5.17.0",
|
|
31
|
+
"@memberjunction/actions-apollo": "5.17.0",
|
|
32
|
+
"@memberjunction/actions-base": "5.17.0",
|
|
33
|
+
"@memberjunction/actions-bizapps-accounting": "5.17.0",
|
|
34
|
+
"@memberjunction/actions-bizapps-crm": "5.17.0",
|
|
35
|
+
"@memberjunction/actions-bizapps-formbuilders": "5.17.0",
|
|
36
|
+
"@memberjunction/actions-bizapps-lms": "5.17.0",
|
|
37
|
+
"@memberjunction/actions-bizapps-social": "5.17.0",
|
|
38
|
+
"@memberjunction/ai": "5.17.0",
|
|
39
|
+
"@memberjunction/ai-agent-manager": "5.17.0",
|
|
40
|
+
"@memberjunction/ai-agent-manager-actions": "5.17.0",
|
|
41
|
+
"@memberjunction/ai-agents": "5.17.0",
|
|
42
|
+
"@memberjunction/ai-core-plus": "5.17.0",
|
|
43
|
+
"@memberjunction/ai-mcp-client": "5.17.0",
|
|
44
|
+
"@memberjunction/ai-prompts": "5.17.0",
|
|
45
|
+
"@memberjunction/ai-provider-bundle": "5.17.0",
|
|
46
|
+
"@memberjunction/ai-vectors-pinecone": "5.17.0",
|
|
47
|
+
"@memberjunction/aiengine": "5.17.0",
|
|
48
|
+
"@memberjunction/api-keys": "5.17.0",
|
|
49
|
+
"@memberjunction/auth-providers": "5.17.0",
|
|
50
|
+
"@memberjunction/codegen-lib": "5.17.0",
|
|
51
|
+
"@memberjunction/communication-ms-graph": "5.17.0",
|
|
52
|
+
"@memberjunction/communication-sendgrid": "5.17.0",
|
|
53
|
+
"@memberjunction/communication-types": "5.17.0",
|
|
54
|
+
"@memberjunction/component-registry-client-sdk": "5.17.0",
|
|
55
|
+
"@memberjunction/computer-use-engine": "5.17.0",
|
|
56
|
+
"@memberjunction/config": "5.17.0",
|
|
57
|
+
"@memberjunction/core": "5.17.0",
|
|
58
|
+
"@memberjunction/core-actions": "5.17.0",
|
|
59
|
+
"@memberjunction/core-entities": "5.17.0",
|
|
60
|
+
"@memberjunction/core-entities-server": "5.17.0",
|
|
61
|
+
"@memberjunction/data-context": "5.17.0",
|
|
62
|
+
"@memberjunction/data-context-server": "5.17.0",
|
|
63
|
+
"@memberjunction/doc-utils": "5.17.0",
|
|
64
|
+
"@memberjunction/encryption": "5.17.0",
|
|
65
|
+
"@memberjunction/entity-communications-base": "5.17.0",
|
|
66
|
+
"@memberjunction/entity-communications-server": "5.17.0",
|
|
67
|
+
"@memberjunction/external-change-detection": "5.17.0",
|
|
68
|
+
"@memberjunction/generic-database-provider": "5.17.0",
|
|
69
|
+
"@memberjunction/global": "5.17.0",
|
|
70
|
+
"@memberjunction/graphql-dataprovider": "5.17.0",
|
|
71
|
+
"@memberjunction/integration-engine": "5.17.0",
|
|
72
|
+
"@memberjunction/integration-schema-builder": "5.17.0",
|
|
73
|
+
"@memberjunction/interactive-component-types": "5.17.0",
|
|
74
|
+
"@memberjunction/notifications": "5.17.0",
|
|
75
|
+
"@memberjunction/postgresql-dataprovider": "5.17.0",
|
|
76
|
+
"@memberjunction/queue": "5.17.0",
|
|
77
|
+
"@memberjunction/redis-provider": "5.17.0",
|
|
78
|
+
"@memberjunction/scheduling-actions": "5.17.0",
|
|
79
|
+
"@memberjunction/scheduling-base-types": "5.17.0",
|
|
80
|
+
"@memberjunction/scheduling-engine": "5.17.0",
|
|
81
|
+
"@memberjunction/scheduling-engine-base": "5.17.0",
|
|
82
|
+
"@memberjunction/server-extensions-core": "5.17.0",
|
|
83
|
+
"@memberjunction/skip-types": "5.17.0",
|
|
84
|
+
"@memberjunction/sql-dialect": "5.17.0",
|
|
85
|
+
"@memberjunction/sqlserver-dataprovider": "5.17.0",
|
|
86
|
+
"@memberjunction/storage": "5.17.0",
|
|
87
|
+
"@memberjunction/templates": "5.17.0",
|
|
88
|
+
"@memberjunction/testing-engine": "5.17.0",
|
|
89
|
+
"@memberjunction/testing-engine-base": "5.17.0",
|
|
90
|
+
"@memberjunction/version-history": "5.17.0",
|
|
86
91
|
"@types/compression": "^1.8.1",
|
|
87
92
|
"@types/cors": "^2.8.19",
|
|
88
93
|
"@types/jsonwebtoken": "9.0.10",
|
|
89
94
|
"@types/node": "24.10.11",
|
|
95
|
+
"@types/pg": "^8.11.11",
|
|
90
96
|
"@types/ws": "8.18.1",
|
|
91
97
|
"axios": "^1.13.4",
|
|
92
98
|
"body-parser": "^2.2.2",
|
|
@@ -107,10 +113,7 @@
|
|
|
107
113
|
"jwks-rsa": "^3.2.2",
|
|
108
114
|
"lru-cache": "^11.2.5",
|
|
109
115
|
"mssql": "^12.2.0",
|
|
110
|
-
"@memberjunction/postgresql-dataprovider": "5.15.0",
|
|
111
|
-
"@memberjunction/sql-dialect": "5.15.0",
|
|
112
116
|
"pg": "^8.13.3",
|
|
113
|
-
"@types/pg": "^8.11.11",
|
|
114
117
|
"reflect-metadata": "0.2.2",
|
|
115
118
|
"rxjs": "^7.8.2",
|
|
116
119
|
"type-graphql": "2.0.0-beta.3",
|
|
@@ -64,7 +64,6 @@ vi.mock('../auth/index.js', () => ({
|
|
|
64
64
|
getValidationOptions: mockGetValidationOptions,
|
|
65
65
|
verifyUserRecord: mockVerifyUserRecord,
|
|
66
66
|
extractUserInfoFromPayload: mockExtractUserInfo,
|
|
67
|
-
TokenExpiredError: MockTokenExpiredError,
|
|
68
67
|
}));
|
|
69
68
|
|
|
70
69
|
vi.mock('../cache.js', () => {
|
|
@@ -84,9 +83,11 @@ vi.mock('../config.js', () => ({
|
|
|
84
83
|
mj_core_schema: '__mj',
|
|
85
84
|
}));
|
|
86
85
|
|
|
87
|
-
vi.mock('
|
|
86
|
+
vi.mock('@memberjunction/auth-providers', () => ({
|
|
87
|
+
TokenExpiredError: MockTokenExpiredError,
|
|
88
88
|
AuthProviderFactory: {
|
|
89
89
|
getInstance: () => ({ getByIssuer: mockGetByIssuer }),
|
|
90
|
+
get Instance() { return { getByIssuer: mockGetByIssuer }; },
|
|
90
91
|
},
|
|
91
92
|
}));
|
|
92
93
|
|
|
@@ -11,8 +11,7 @@ vi.mock('../../config', () => ({
|
|
|
11
11
|
},
|
|
12
12
|
}));
|
|
13
13
|
|
|
14
|
-
import { AuthProviderFactory } from '
|
|
15
|
-
import { IAuthProvider } from '../IAuthProvider';
|
|
14
|
+
import { AuthProviderFactory, IAuthProvider } from '@memberjunction/auth-providers';
|
|
16
15
|
import { initializeAuthProviders } from '../initializeProviders';
|
|
17
16
|
|
|
18
17
|
/**
|
|
@@ -22,7 +21,7 @@ describe('Authentication Provider Backward Compatibility', () => {
|
|
|
22
21
|
let factory: AuthProviderFactory;
|
|
23
22
|
|
|
24
23
|
beforeEach(() => {
|
|
25
|
-
factory = AuthProviderFactory.
|
|
24
|
+
factory = AuthProviderFactory.Instance;
|
|
26
25
|
factory.clear();
|
|
27
26
|
});
|
|
28
27
|
|