@memberjunction/server 4.0.0 → 4.2.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 +689 -513
- package/dist/auth/newUsers.d.ts.map +1 -1
- package/dist/auth/newUsers.js +4 -2
- package/dist/auth/newUsers.js.map +1 -1
- package/dist/generated/generated.d.ts +20 -6
- package/dist/generated/generated.d.ts.map +1 -1
- package/dist/generated/generated.js +107 -51
- package/dist/generated/generated.js.map +1 -1
- package/dist/generic/DeleteOptionsInput.d.ts +14 -1
- package/dist/generic/DeleteOptionsInput.d.ts.map +1 -1
- package/dist/generic/DeleteOptionsInput.js +10 -1
- package/dist/generic/DeleteOptionsInput.js.map +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/resolvers/CreateQueryResolver.d.ts.map +1 -1
- package/dist/resolvers/CreateQueryResolver.js +3 -1
- package/dist/resolvers/CreateQueryResolver.js.map +1 -1
- package/dist/resolvers/FileCategoryResolver.d.ts +1 -1
- package/dist/resolvers/FileCategoryResolver.d.ts.map +1 -1
- package/dist/resolvers/FileCategoryResolver.js +2 -2
- package/dist/resolvers/FileCategoryResolver.js.map +1 -1
- package/dist/resolvers/InfoResolver.d.ts +2 -2
- package/dist/resolvers/InfoResolver.d.ts.map +1 -1
- package/dist/resolvers/InfoResolver.js +13 -13
- package/dist/resolvers/InfoResolver.js.map +1 -1
- package/package.json +52 -48
- package/src/auth/newUsers.ts +4 -2
- package/src/generated/generated.ts +82 -40
- package/src/generic/DeleteOptionsInput.ts +20 -3
- package/src/index.ts +12 -0
- package/src/resolvers/CreateQueryResolver.ts +3 -1
- package/src/resolvers/FileCategoryResolver.ts +1 -1
- package/src/resolvers/InfoResolver.ts +5 -5
- package/dist/apolloServer/TransactionPlugin.d.ts +0 -4
- package/dist/apolloServer/TransactionPlugin.d.ts.map +0 -1
- package/dist/apolloServer/TransactionPlugin.js +0 -46
- package/dist/apolloServer/TransactionPlugin.js.map +0 -1
- package/dist/auth/__tests__/backward-compatibility.test.d.ts +0 -2
- package/dist/auth/__tests__/backward-compatibility.test.d.ts.map +0 -1
- package/dist/auth/__tests__/backward-compatibility.test.js +0 -135
- package/dist/auth/__tests__/backward-compatibility.test.js.map +0 -1
- package/dist/resolvers/AskSkipResolver.d.ts +0 -123
- package/dist/resolvers/AskSkipResolver.d.ts.map +0 -1
- package/dist/resolvers/AskSkipResolver.js +0 -1788
- package/dist/resolvers/AskSkipResolver.js.map +0 -1
- package/dist/scheduler/LearningCycleScheduler.d.ts +0 -4
- package/dist/scheduler/LearningCycleScheduler.d.ts.map +0 -1
- package/dist/scheduler/LearningCycleScheduler.js +0 -4
- package/dist/scheduler/LearningCycleScheduler.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/server",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.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",
|
|
@@ -26,53 +26,57 @@
|
|
|
26
26
|
"@apollo/server": "^4.9.1",
|
|
27
27
|
"@graphql-tools/schema": "latest",
|
|
28
28
|
"@graphql-tools/utils": "^11.0.0",
|
|
29
|
-
"@memberjunction/actions": "4.
|
|
30
|
-
"@memberjunction/actions-
|
|
31
|
-
"@memberjunction/actions-
|
|
32
|
-
"@memberjunction/actions-bizapps-
|
|
33
|
-
"@memberjunction/actions-bizapps-
|
|
34
|
-
"@memberjunction/actions-bizapps-
|
|
35
|
-
"@memberjunction/actions-bizapps-
|
|
36
|
-
"@memberjunction/
|
|
37
|
-
"@memberjunction/ai
|
|
38
|
-
"@memberjunction/ai-
|
|
39
|
-
"@memberjunction/ai-agent-manager
|
|
40
|
-
"@memberjunction/ai-
|
|
41
|
-
"@memberjunction/ai-
|
|
42
|
-
"@memberjunction/ai-
|
|
43
|
-
"@memberjunction/ai-
|
|
44
|
-
"@memberjunction/ai-
|
|
45
|
-
"@memberjunction/
|
|
46
|
-
"@memberjunction/
|
|
47
|
-
"@memberjunction/communication-
|
|
48
|
-
"@memberjunction/
|
|
49
|
-
"@memberjunction/
|
|
50
|
-
"@memberjunction/
|
|
51
|
-
"@memberjunction/
|
|
52
|
-
"@memberjunction/core
|
|
53
|
-
"@memberjunction/core-
|
|
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/scheduling-
|
|
70
|
-
"@memberjunction/
|
|
71
|
-
"@memberjunction/
|
|
72
|
-
"@memberjunction/
|
|
73
|
-
"@memberjunction/
|
|
74
|
-
"@memberjunction/
|
|
75
|
-
"@memberjunction/
|
|
29
|
+
"@memberjunction/actions": "4.2.0",
|
|
30
|
+
"@memberjunction/actions-base": "4.2.0",
|
|
31
|
+
"@memberjunction/actions-apollo": "4.2.0",
|
|
32
|
+
"@memberjunction/actions-bizapps-accounting": "4.2.0",
|
|
33
|
+
"@memberjunction/actions-bizapps-crm": "4.2.0",
|
|
34
|
+
"@memberjunction/actions-bizapps-formbuilders": "4.2.0",
|
|
35
|
+
"@memberjunction/actions-bizapps-lms": "4.2.0",
|
|
36
|
+
"@memberjunction/actions-bizapps-social": "4.2.0",
|
|
37
|
+
"@memberjunction/ai": "4.2.0",
|
|
38
|
+
"@memberjunction/ai-mcp-client": "4.2.0",
|
|
39
|
+
"@memberjunction/ai-agent-manager": "4.2.0",
|
|
40
|
+
"@memberjunction/ai-agent-manager-actions": "4.2.0",
|
|
41
|
+
"@memberjunction/ai-agents": "4.2.0",
|
|
42
|
+
"@memberjunction/ai-core-plus": "4.2.0",
|
|
43
|
+
"@memberjunction/ai-prompts": "4.2.0",
|
|
44
|
+
"@memberjunction/ai-provider-bundle": "4.2.0",
|
|
45
|
+
"@memberjunction/ai-vectors-pinecone": "4.2.0",
|
|
46
|
+
"@memberjunction/aiengine": "4.2.0",
|
|
47
|
+
"@memberjunction/communication-ms-graph": "4.2.0",
|
|
48
|
+
"@memberjunction/communication-sendgrid": "4.2.0",
|
|
49
|
+
"@memberjunction/communication-types": "4.2.0",
|
|
50
|
+
"@memberjunction/component-registry-client-sdk": "4.2.0",
|
|
51
|
+
"@memberjunction/config": "4.2.0",
|
|
52
|
+
"@memberjunction/core": "4.2.0",
|
|
53
|
+
"@memberjunction/core-actions": "4.2.0",
|
|
54
|
+
"@memberjunction/core-entities": "4.2.0",
|
|
55
|
+
"@memberjunction/core-entities-server": "4.2.0",
|
|
56
|
+
"@memberjunction/data-context": "4.2.0",
|
|
57
|
+
"@memberjunction/data-context-server": "4.2.0",
|
|
58
|
+
"@memberjunction/doc-utils": "4.2.0",
|
|
59
|
+
"@memberjunction/api-keys": "4.2.0",
|
|
60
|
+
"@memberjunction/encryption": "4.2.0",
|
|
61
|
+
"@memberjunction/entity-communications-base": "4.2.0",
|
|
62
|
+
"@memberjunction/entity-communications-server": "4.2.0",
|
|
63
|
+
"@memberjunction/external-change-detection": "4.2.0",
|
|
64
|
+
"@memberjunction/global": "4.2.0",
|
|
65
|
+
"@memberjunction/graphql-dataprovider": "4.2.0",
|
|
66
|
+
"@memberjunction/interactive-component-types": "4.2.0",
|
|
67
|
+
"@memberjunction/notifications": "4.2.0",
|
|
68
|
+
"@memberjunction/queue": "4.2.0",
|
|
69
|
+
"@memberjunction/scheduling-actions": "4.2.0",
|
|
70
|
+
"@memberjunction/scheduling-base-types": "4.2.0",
|
|
71
|
+
"@memberjunction/scheduling-engine": "4.2.0",
|
|
72
|
+
"@memberjunction/scheduling-engine-base": "4.2.0",
|
|
73
|
+
"@memberjunction/skip-types": "4.2.0",
|
|
74
|
+
"@memberjunction/sqlserver-dataprovider": "4.2.0",
|
|
75
|
+
"@memberjunction/storage": "4.2.0",
|
|
76
|
+
"@memberjunction/templates": "4.2.0",
|
|
77
|
+
"@memberjunction/testing-engine": "4.2.0",
|
|
78
|
+
"@memberjunction/testing-engine-base": "4.2.0",
|
|
79
|
+
"@memberjunction/version-history": "4.2.0",
|
|
76
80
|
"@types/compression": "^1.8.1",
|
|
77
81
|
"@types/cors": "^2.8.19",
|
|
78
82
|
"@types/jsonwebtoken": "9.0.10",
|
package/src/auth/newUsers.ts
CHANGED
|
@@ -96,9 +96,11 @@ export class NewUserBase {
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
} else {
|
|
99
|
-
// Fall back to DefaultForNewUser applications from metadata
|
|
99
|
+
// Fall back to DefaultForNewUser applications from metadata, sorted by DefaultSequence
|
|
100
100
|
LogStatus(`No UserApplications configured, using DefaultForNewUser applications for new user ${user.Name}`);
|
|
101
|
-
applicationsToCreate = md.Applications
|
|
101
|
+
applicationsToCreate = md.Applications
|
|
102
|
+
.filter(a => a.DefaultForNewUser)
|
|
103
|
+
.sort((a, b) => (a.DefaultSequence ?? 100) - (b.DefaultSequence ?? 100));
|
|
102
104
|
LogStatus(`Found ${applicationsToCreate.length} applications with DefaultForNewUser=true`);
|
|
103
105
|
}
|
|
104
106
|
|
|
@@ -5367,6 +5367,27 @@ export class CreateMJAIModelInput {
|
|
|
5367
5367
|
|
|
5368
5368
|
@Field({ nullable: true })
|
|
5369
5369
|
PriorVersionID: string | null;
|
|
5370
|
+
|
|
5371
|
+
@Field({ nullable: true })
|
|
5372
|
+
Vendor: string | null;
|
|
5373
|
+
|
|
5374
|
+
@Field({ nullable: true })
|
|
5375
|
+
DriverClass: string | null;
|
|
5376
|
+
|
|
5377
|
+
@Field({ nullable: true })
|
|
5378
|
+
DriverImportPath: string | null;
|
|
5379
|
+
|
|
5380
|
+
@Field({ nullable: true })
|
|
5381
|
+
APIName: string | null;
|
|
5382
|
+
|
|
5383
|
+
@Field(() => Int, { nullable: true })
|
|
5384
|
+
InputTokenLimit: number | null;
|
|
5385
|
+
|
|
5386
|
+
@Field({ nullable: true })
|
|
5387
|
+
SupportedResponseFormats: string | null;
|
|
5388
|
+
|
|
5389
|
+
@Field(() => Boolean, { nullable: true })
|
|
5390
|
+
SupportsEffortLevel: boolean | null;
|
|
5370
5391
|
}
|
|
5371
5392
|
|
|
5372
5393
|
|
|
@@ -5408,6 +5429,27 @@ export class UpdateMJAIModelInput {
|
|
|
5408
5429
|
@Field({ nullable: true })
|
|
5409
5430
|
PriorVersionID?: string | null;
|
|
5410
5431
|
|
|
5432
|
+
@Field({ nullable: true })
|
|
5433
|
+
Vendor?: string | null;
|
|
5434
|
+
|
|
5435
|
+
@Field({ nullable: true })
|
|
5436
|
+
DriverClass?: string | null;
|
|
5437
|
+
|
|
5438
|
+
@Field({ nullable: true })
|
|
5439
|
+
DriverImportPath?: string | null;
|
|
5440
|
+
|
|
5441
|
+
@Field({ nullable: true })
|
|
5442
|
+
APIName?: string | null;
|
|
5443
|
+
|
|
5444
|
+
@Field(() => Int, { nullable: true })
|
|
5445
|
+
InputTokenLimit?: number | null;
|
|
5446
|
+
|
|
5447
|
+
@Field({ nullable: true })
|
|
5448
|
+
SupportedResponseFormats?: string | null;
|
|
5449
|
+
|
|
5450
|
+
@Field(() => Boolean, { nullable: true })
|
|
5451
|
+
SupportsEffortLevel?: boolean | null;
|
|
5452
|
+
|
|
5411
5453
|
@Field(() => [KeyValuePairInput], { nullable: true })
|
|
5412
5454
|
OldValues___?: KeyValuePairInput[];
|
|
5413
5455
|
}
|
|
@@ -17410,12 +17452,12 @@ export class MJEntity_ {
|
|
|
17410
17452
|
@Field(() => [MJRecordLink_])
|
|
17411
17453
|
MJ_RecordLinks_SourceEntityIDArray: MJRecordLink_[]; // Link to MJ_RecordLinks
|
|
17412
17454
|
|
|
17413
|
-
@Field(() => [MJAIAgentNote_])
|
|
17414
|
-
AIAgentNotes_PrimaryScopeEntityIDArray: MJAIAgentNote_[]; // Link to AIAgentNotes
|
|
17415
|
-
|
|
17416
17455
|
@Field(() => [MJAIAgentExample_])
|
|
17417
17456
|
MJ_AIAgentExamples_PrimaryScopeEntityIDArray: MJAIAgentExample_[]; // Link to MJ_AIAgentExamples
|
|
17418
17457
|
|
|
17458
|
+
@Field(() => [MJAIAgentNote_])
|
|
17459
|
+
AIAgentNotes_PrimaryScopeEntityIDArray: MJAIAgentNote_[]; // Link to AIAgentNotes
|
|
17460
|
+
|
|
17419
17461
|
@Field(() => [MJVersionLabel_])
|
|
17420
17462
|
MJ_VersionLabels_EntityIDArray: MJVersionLabel_[]; // Link to MJ_VersionLabels
|
|
17421
17463
|
|
|
@@ -18257,25 +18299,25 @@ export class MJEntityResolverBase extends ResolverBase {
|
|
|
18257
18299
|
return result;
|
|
18258
18300
|
}
|
|
18259
18301
|
|
|
18260
|
-
@FieldResolver(() => [
|
|
18261
|
-
async
|
|
18262
|
-
this.CheckUserReadPermissions('AI Agent
|
|
18302
|
+
@FieldResolver(() => [MJAIAgentExample_])
|
|
18303
|
+
async MJ_AIAgentExamples_PrimaryScopeEntityIDArray(@Root() mjentity_: MJEntity_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
18304
|
+
this.CheckUserReadPermissions('MJ: AI Agent Examples', userPayload);
|
|
18263
18305
|
const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
|
|
18264
18306
|
const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
18265
|
-
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[
|
|
18307
|
+
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentExamples] WHERE [PrimaryScopeEntityID]='${mjentity_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Examples', userPayload, EntityPermissionType.Read, 'AND');
|
|
18266
18308
|
const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
|
|
18267
|
-
const result = await this.ArrayMapFieldNamesToCodeNames('AI Agent
|
|
18309
|
+
const result = await this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Examples', rows, this.GetUserFromPayload(userPayload));
|
|
18268
18310
|
return result;
|
|
18269
18311
|
}
|
|
18270
18312
|
|
|
18271
|
-
@FieldResolver(() => [
|
|
18272
|
-
async
|
|
18273
|
-
this.CheckUserReadPermissions('
|
|
18313
|
+
@FieldResolver(() => [MJAIAgentNote_])
|
|
18314
|
+
async AIAgentNotes_PrimaryScopeEntityIDArray(@Root() mjentity_: MJEntity_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
18315
|
+
this.CheckUserReadPermissions('AI Agent Notes', userPayload);
|
|
18274
18316
|
const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
|
|
18275
18317
|
const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
18276
|
-
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[
|
|
18318
|
+
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentNotes] WHERE [PrimaryScopeEntityID]='${mjentity_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'AI Agent Notes', userPayload, EntityPermissionType.Read, 'AND');
|
|
18277
18319
|
const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
|
|
18278
|
-
const result = await this.ArrayMapFieldNamesToCodeNames('
|
|
18320
|
+
const result = await this.ArrayMapFieldNamesToCodeNames('AI Agent Notes', rows, this.GetUserFromPayload(userPayload));
|
|
18279
18321
|
return result;
|
|
18280
18322
|
}
|
|
18281
18323
|
|
|
@@ -35079,12 +35121,12 @@ export class MJAPIApplication_ {
|
|
|
35079
35121
|
@MaxLength(10)
|
|
35080
35122
|
_mj__UpdatedAt: Date;
|
|
35081
35123
|
|
|
35082
|
-
@Field(() => [MJAPIApplicationScope_])
|
|
35083
|
-
MJ_APIApplicationScopes_ApplicationIDArray: MJAPIApplicationScope_[]; // Link to MJ_APIApplicationScopes
|
|
35084
|
-
|
|
35085
35124
|
@Field(() => [MJAPIKeyUsageLog_])
|
|
35086
35125
|
MJ_APIKeyUsageLogs_ApplicationIDArray: MJAPIKeyUsageLog_[]; // Link to MJ_APIKeyUsageLogs
|
|
35087
35126
|
|
|
35127
|
+
@Field(() => [MJAPIApplicationScope_])
|
|
35128
|
+
MJ_APIApplicationScopes_ApplicationIDArray: MJAPIApplicationScope_[]; // Link to MJ_APIApplicationScopes
|
|
35129
|
+
|
|
35088
35130
|
@Field(() => [MJAPIKeyApplication_])
|
|
35089
35131
|
MJ_APIKeyApplications_ApplicationIDArray: MJAPIKeyApplication_[]; // Link to MJ_APIKeyApplications
|
|
35090
35132
|
|
|
@@ -35188,25 +35230,25 @@ export class MJAPIApplicationResolver extends ResolverBase {
|
|
|
35188
35230
|
return result;
|
|
35189
35231
|
}
|
|
35190
35232
|
|
|
35191
|
-
@FieldResolver(() => [
|
|
35192
|
-
async
|
|
35193
|
-
this.CheckUserReadPermissions('MJ: API
|
|
35233
|
+
@FieldResolver(() => [MJAPIKeyUsageLog_])
|
|
35234
|
+
async MJ_APIKeyUsageLogs_ApplicationIDArray(@Root() mjapiapplication_: MJAPIApplication_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
35235
|
+
this.CheckUserReadPermissions('MJ: API Key Usage Logs', userPayload);
|
|
35194
35236
|
const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
|
|
35195
35237
|
const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
35196
|
-
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[
|
|
35238
|
+
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAPIKeyUsageLogs] WHERE [ApplicationID]='${mjapiapplication_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: API Key Usage Logs', userPayload, EntityPermissionType.Read, 'AND');
|
|
35197
35239
|
const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
|
|
35198
|
-
const result = await this.ArrayMapFieldNamesToCodeNames('MJ: API
|
|
35240
|
+
const result = await this.ArrayMapFieldNamesToCodeNames('MJ: API Key Usage Logs', rows, this.GetUserFromPayload(userPayload));
|
|
35199
35241
|
return result;
|
|
35200
35242
|
}
|
|
35201
35243
|
|
|
35202
|
-
@FieldResolver(() => [
|
|
35203
|
-
async
|
|
35204
|
-
this.CheckUserReadPermissions('MJ: API
|
|
35244
|
+
@FieldResolver(() => [MJAPIApplicationScope_])
|
|
35245
|
+
async MJ_APIApplicationScopes_ApplicationIDArray(@Root() mjapiapplication_: MJAPIApplication_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
35246
|
+
this.CheckUserReadPermissions('MJ: API Application Scopes', userPayload);
|
|
35205
35247
|
const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
|
|
35206
35248
|
const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
35207
|
-
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[
|
|
35249
|
+
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAPIApplicationScopes] WHERE [ApplicationID]='${mjapiapplication_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: API Application Scopes', userPayload, EntityPermissionType.Read, 'AND');
|
|
35208
35250
|
const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
|
|
35209
|
-
const result = await this.ArrayMapFieldNamesToCodeNames('MJ: API
|
|
35251
|
+
const result = await this.ArrayMapFieldNamesToCodeNames('MJ: API Application Scopes', rows, this.GetUserFromPayload(userPayload));
|
|
35210
35252
|
return result;
|
|
35211
35253
|
}
|
|
35212
35254
|
|
|
@@ -44626,15 +44668,15 @@ export class MJMCPServerConnection_ {
|
|
|
44626
44668
|
@Field(() => [MJMCPToolExecutionLog_])
|
|
44627
44669
|
MJ_MCPToolExecutionLogs_MCPServerConnectionIDArray: MJMCPToolExecutionLog_[]; // Link to MJ_MCPToolExecutionLogs
|
|
44628
44670
|
|
|
44629
|
-
@Field(() => [MJOAuthAuthorizationState_])
|
|
44630
|
-
MJ_OAuthAuthorizationStates_MCPServerConnectionIDArray: MJOAuthAuthorizationState_[]; // Link to MJ_OAuthAuthorizationStates
|
|
44631
|
-
|
|
44632
44671
|
@Field(() => [MJOAuthClientRegistration_])
|
|
44633
44672
|
MJ_OAuthClientRegistrations_MCPServerConnectionIDArray: MJOAuthClientRegistration_[]; // Link to MJ_OAuthClientRegistrations
|
|
44634
44673
|
|
|
44635
44674
|
@Field(() => [MJOAuthToken_])
|
|
44636
44675
|
MJ_OAuthTokens_MCPServerConnectionIDArray: MJOAuthToken_[]; // Link to MJ_OAuthTokens
|
|
44637
44676
|
|
|
44677
|
+
@Field(() => [MJOAuthAuthorizationState_])
|
|
44678
|
+
MJ_OAuthAuthorizationStates_MCPServerConnectionIDArray: MJOAuthAuthorizationState_[]; // Link to MJ_OAuthAuthorizationStates
|
|
44679
|
+
|
|
44638
44680
|
@Field(() => [MJMCPServerConnectionPermission_])
|
|
44639
44681
|
MJ_MCPServerConnectionPermissions_MCPServerConnectionIDArray: MJMCPServerConnectionPermission_[]; // Link to MJ_MCPServerConnectionPermissions
|
|
44640
44682
|
|
|
@@ -44838,17 +44880,6 @@ export class MJMCPServerConnectionResolver extends ResolverBase {
|
|
|
44838
44880
|
return result;
|
|
44839
44881
|
}
|
|
44840
44882
|
|
|
44841
|
-
@FieldResolver(() => [MJOAuthAuthorizationState_])
|
|
44842
|
-
async MJ_OAuthAuthorizationStates_MCPServerConnectionIDArray(@Root() mjmcpserverconnection_: MJMCPServerConnection_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
44843
|
-
this.CheckUserReadPermissions('MJ: O Auth Authorization States', userPayload);
|
|
44844
|
-
const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
|
|
44845
|
-
const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
44846
|
-
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwOAuthAuthorizationStates] WHERE [MCPServerConnectionID]='${mjmcpserverconnection_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: O Auth Authorization States', userPayload, EntityPermissionType.Read, 'AND');
|
|
44847
|
-
const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
|
|
44848
|
-
const result = await this.ArrayMapFieldNamesToCodeNames('MJ: O Auth Authorization States', rows, this.GetUserFromPayload(userPayload));
|
|
44849
|
-
return result;
|
|
44850
|
-
}
|
|
44851
|
-
|
|
44852
44883
|
@FieldResolver(() => [MJOAuthClientRegistration_])
|
|
44853
44884
|
async MJ_OAuthClientRegistrations_MCPServerConnectionIDArray(@Root() mjmcpserverconnection_: MJMCPServerConnection_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
44854
44885
|
this.CheckUserReadPermissions('MJ: O Auth Client Registrations', userPayload);
|
|
@@ -44871,6 +44902,17 @@ export class MJMCPServerConnectionResolver extends ResolverBase {
|
|
|
44871
44902
|
return result;
|
|
44872
44903
|
}
|
|
44873
44904
|
|
|
44905
|
+
@FieldResolver(() => [MJOAuthAuthorizationState_])
|
|
44906
|
+
async MJ_OAuthAuthorizationStates_MCPServerConnectionIDArray(@Root() mjmcpserverconnection_: MJMCPServerConnection_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
44907
|
+
this.CheckUserReadPermissions('MJ: O Auth Authorization States', userPayload);
|
|
44908
|
+
const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
|
|
44909
|
+
const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
44910
|
+
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwOAuthAuthorizationStates] WHERE [MCPServerConnectionID]='${mjmcpserverconnection_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: O Auth Authorization States', userPayload, EntityPermissionType.Read, 'AND');
|
|
44911
|
+
const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
|
|
44912
|
+
const result = await this.ArrayMapFieldNamesToCodeNames('MJ: O Auth Authorization States', rows, this.GetUserFromPayload(userPayload));
|
|
44913
|
+
return result;
|
|
44914
|
+
}
|
|
44915
|
+
|
|
44874
44916
|
@FieldResolver(() => [MJMCPServerConnectionPermission_])
|
|
44875
44917
|
async MJ_MCPServerConnectionPermissions_MCPServerConnectionIDArray(@Root() mjmcpserverconnection_: MJMCPServerConnection_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
44876
44918
|
this.CheckUserReadPermissions('MJ: MCP Server Connection Permissions', userPayload);
|
|
@@ -1,13 +1,30 @@
|
|
|
1
1
|
import { Field, InputType } from "type-graphql";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* GraphQL InputType for the DeleteOptions
|
|
4
|
+
* GraphQL InputType for the DeleteOptions.
|
|
5
|
+
* Must be kept in sync with EntityDeleteOptions in @memberjunction/core.
|
|
5
6
|
*/
|
|
6
7
|
@InputType()
|
|
7
8
|
export class DeleteOptionsInput {
|
|
8
9
|
@Field(() => Boolean)
|
|
9
10
|
SkipEntityAIActions: boolean;
|
|
10
|
-
|
|
11
|
-
@Field(() => Boolean)
|
|
11
|
+
|
|
12
|
+
@Field(() => Boolean)
|
|
12
13
|
SkipEntityActions: boolean;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* When set to true, the delete operation will BYPASS Validate() and the actual
|
|
17
|
+
* process of deleting the record from the database but WILL invoke any associated
|
|
18
|
+
* actions (AI Actions, Entity Actions, etc...).
|
|
19
|
+
*/
|
|
20
|
+
@Field(() => Boolean)
|
|
21
|
+
ReplayOnly: boolean;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* When true, this entity is being deleted as part of an IS-A parent chain
|
|
25
|
+
* initiated by a child entity. The child deletes itself first (FK constraint),
|
|
26
|
+
* then cascades deletion to its parent.
|
|
27
|
+
*/
|
|
28
|
+
@Field(() => Boolean)
|
|
29
|
+
IsParentEntityDelete: boolean;
|
|
13
30
|
}
|
package/src/index.ts
CHANGED
|
@@ -88,6 +88,18 @@ export * from './resolvers/CreateQueryResolver.js';
|
|
|
88
88
|
export * from './resolvers/TelemetryResolver.js';
|
|
89
89
|
export * from './resolvers/APIKeyResolver.js';
|
|
90
90
|
export * from './resolvers/MCPResolver.js';
|
|
91
|
+
export * from './resolvers/ActionResolver.js';
|
|
92
|
+
export * from './resolvers/EntityCommunicationsResolver.js';
|
|
93
|
+
export * from './resolvers/EntityResolver.js';
|
|
94
|
+
export * from './resolvers/FileCategoryResolver.js';
|
|
95
|
+
export * from './resolvers/FileResolver.js';
|
|
96
|
+
export * from './resolvers/InfoResolver.js';
|
|
97
|
+
export * from './resolvers/PotentialDuplicateRecordResolver.js';
|
|
98
|
+
export * from './resolvers/RunTestResolver.js';
|
|
99
|
+
export * from './resolvers/UserFavoriteResolver.js';
|
|
100
|
+
export * from './resolvers/UserResolver.js';
|
|
101
|
+
export * from './resolvers/UserViewResolver.js';
|
|
102
|
+
export * from './resolvers/VersionHistoryResolver.js';
|
|
91
103
|
export { GetReadOnlyDataSource, GetReadWriteDataSource, GetReadWriteProvider, GetReadOnlyProvider } from './util.js';
|
|
92
104
|
|
|
93
105
|
export * from './generated/generated.js';
|
|
@@ -816,7 +816,9 @@ export class MJQueryResolverExtended extends MJQueryResolver {
|
|
|
816
816
|
// Provide default options if none provided
|
|
817
817
|
const deleteOptions = options || {
|
|
818
818
|
SkipEntityAIActions: false,
|
|
819
|
-
SkipEntityActions: false
|
|
819
|
+
SkipEntityActions: false,
|
|
820
|
+
ReplayOnly: false,
|
|
821
|
+
IsParentEntityDelete: false
|
|
820
822
|
};
|
|
821
823
|
|
|
822
824
|
// Use inherited DeleteRecord method from ResolverBase
|
|
@@ -7,7 +7,7 @@ import sql from 'mssql';
|
|
|
7
7
|
import { SQLServerDataProvider } from '@memberjunction/sqlserver-dataprovider';
|
|
8
8
|
import { GetReadWriteProvider } from '../util.js';
|
|
9
9
|
|
|
10
|
-
export class
|
|
10
|
+
export class FileCategoryResolver extends FileCategoryResolverBase {
|
|
11
11
|
@Mutation(() => MJFileCategory_)
|
|
12
12
|
async DeleteFileCategory(
|
|
13
13
|
@Arg('ID', () => String) ID: string,
|
|
@@ -9,7 +9,7 @@ const require = createRequire(import.meta.url);
|
|
|
9
9
|
const packageJson = require('../../package.json') as { version: string };
|
|
10
10
|
|
|
11
11
|
@ObjectType()
|
|
12
|
-
export class
|
|
12
|
+
export class ServerInfo {
|
|
13
13
|
@Public()
|
|
14
14
|
@Field()
|
|
15
15
|
Version: string;
|
|
@@ -33,11 +33,11 @@ export class Info {
|
|
|
33
33
|
Hostname: string;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
@Resolver(
|
|
37
|
-
export class InfoResolver {
|
|
36
|
+
@Resolver(ServerInfo)
|
|
37
|
+
export class InfoResolver {
|
|
38
38
|
@Public()
|
|
39
|
-
@Query(() =>
|
|
40
|
-
Info(@Ctx() context: AppContext):
|
|
39
|
+
@Query(() => ServerInfo)
|
|
40
|
+
Info(@Ctx() context: AppContext): ServerInfo {
|
|
41
41
|
return {
|
|
42
42
|
Version: packageJson.version,
|
|
43
43
|
IsSystemUser: Boolean(context.userPayload.isSystemUser),
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionPlugin.d.ts","sourceRoot":"","sources":["../../src/apolloServer/TransactionPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAgF,MAAM,gBAAgB,CAAC;AAElI,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,eAAO,MAAM,iBAAiB,EAAE,kBAAkB,CAAC,UAAU,CAgD5D,CAAC"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import sql from 'mssql';
|
|
2
|
-
export const TransactionPlugin = {
|
|
3
|
-
async requestDidStart(requestContext) {
|
|
4
|
-
const start = Date.now();
|
|
5
|
-
const query = requestContext.request.query || '';
|
|
6
|
-
const isMutation = /^\s*mutation\b/i.test(query);
|
|
7
|
-
if (!isMutation) {
|
|
8
|
-
return null;
|
|
9
|
-
}
|
|
10
|
-
const pool = requestContext.contextValue.dataSource;
|
|
11
|
-
const transaction = new sql.Transaction(pool);
|
|
12
|
-
requestContext.contextValue.transaction = transaction;
|
|
13
|
-
console.log('Starting transaction wrapper, time spent: ', Date.now() - start, 'ms ');
|
|
14
|
-
await transaction.begin();
|
|
15
|
-
return {
|
|
16
|
-
didEncounterErrors: async (requestContext) => {
|
|
17
|
-
console.log('Error in transaction wrapper: ' + requestContext.errors, 'time spent: ', Date.now() - start, 'ms');
|
|
18
|
-
},
|
|
19
|
-
executionDidStart: async () => {
|
|
20
|
-
return {
|
|
21
|
-
executionDidEnd: async (err) => {
|
|
22
|
-
try {
|
|
23
|
-
if (err) {
|
|
24
|
-
console.log('Error in transaction, rolling back, time spent: ', Date.now() - start, 'ms ');
|
|
25
|
-
console.error('Rolling back transaction', err);
|
|
26
|
-
await transaction.rollback();
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
console.log('Committing transaction, time spent: ', Date.now() - start, 'ms ');
|
|
30
|
-
await transaction.commit();
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
catch (execErr) {
|
|
34
|
-
console.log('Execution Error, time spent: ', Date.now() - start, 'ms ');
|
|
35
|
-
console.error(execErr);
|
|
36
|
-
}
|
|
37
|
-
finally {
|
|
38
|
-
console.log('Transaction complete, time spent: ', Date.now() - start, 'ms ');
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
//# sourceMappingURL=TransactionPlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionPlugin.js","sourceRoot":"","sources":["../../src/apolloServer/TransactionPlugin.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,OAAO,CAAC;AAGxB,MAAM,CAAC,MAAM,iBAAiB,GAAmC;IAC/D,KAAK,CAAC,eAAe,CAAC,cAAc;QAClC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACzB,MAAM,KAAK,GAAG,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC;QACjD,MAAM,UAAU,GAAG,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAEjD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO,IAAI,CAAC;QACd,CAAC;QAKD,MAAM,IAAI,GAAuB,cAAc,CAAC,YAAY,CAAC,UAAU,CAAC;QACxE,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAG7C,cAAc,CAAC,YAAoB,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/D,OAAO,CAAC,GAAG,CAAC,4CAA4C,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,EAAE,KAAK,CAAC,CAAC;QACrF,MAAM,WAAW,CAAC,KAAK,EAAE,CAAC;QAE1B,OAAO;YACL,kBAAkB,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE;gBAC3C,OAAO,CAAC,GAAG,CAAC,gCAAgC,GAAG,cAAc,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,EAAE,IAAI,CAAC,CAAC;YAClH,CAAC;YACD,iBAAiB,EAAE,KAAK,IAAI,EAAE;gBAC5B,OAAO;oBACL,eAAe,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;wBAC7B,IAAI,CAAC;4BACH,IAAI,GAAG,EAAE,CAAC;gCACR,OAAO,CAAC,GAAG,CAAC,kDAAkD,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,EAAE,KAAK,CAAC,CAAC;gCAC3F,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,GAAG,CAAC,CAAC;gCAC/C,MAAM,WAAW,CAAC,QAAQ,EAAE,CAAC;4BAC/B,CAAC;iCAAM,CAAC;gCACN,OAAO,CAAC,GAAG,CAAC,sCAAsC,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,EAAE,KAAK,CAAC,CAAC;gCAC/E,MAAM,WAAW,CAAC,MAAM,EAAE,CAAC;4BAC7B,CAAC;wBACH,CAAC;wBAAC,OAAO,OAAO,EAAE,CAAC;4BACjB,OAAO,CAAC,GAAG,CAAC,+BAA+B,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,EAAE,KAAK,CAAC,CAAC;4BACxE,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;wBACzB,CAAC;gCAAS,CAAC;4BACT,OAAO,CAAC,GAAG,CAAC,oCAAoC,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,EAAE,KAAK,CAAC,CAAC;wBAC/E,CAAC;oBACH,CAAC;iBACF,CAAC;YACJ,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"backward-compatibility.test.d.ts","sourceRoot":"","sources":["../../../src/auth/__tests__/backward-compatibility.test.ts"],"names":[],"mappings":""}
|