@memberjunction/server 2.36.1 → 2.37.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/config.d.ts +5 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +8 -1
- package/dist/config.js.map +1 -1
- package/dist/generated/generated.d.ts +23 -15
- package/dist/generated/generated.d.ts.map +1 -1
- package/dist/generated/generated.js +138 -73
- package/dist/generated/generated.js.map +1 -1
- package/dist/generic/ResolverBase.d.ts.map +1 -1
- package/dist/generic/ResolverBase.js +24 -1
- package/dist/generic/ResolverBase.js.map +1 -1
- package/dist/resolvers/AskSkipResolver.d.ts.map +1 -1
- package/dist/resolvers/AskSkipResolver.js +42 -6
- package/dist/resolvers/AskSkipResolver.js.map +1 -1
- package/dist/scheduler/LearningCycleScheduler.d.ts.map +1 -1
- package/dist/scheduler/LearningCycleScheduler.js +3 -4
- package/dist/scheduler/LearningCycleScheduler.js.map +1 -1
- package/package.json +22 -22
- package/src/config.ts +8 -0
- package/src/generated/generated.ts +92 -53
- package/src/generic/ResolverBase.ts +25 -1
- package/src/resolvers/AskSkipResolver.ts +53 -9
- package/src/scheduler/LearningCycleScheduler.ts +7 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LearningCycleScheduler.d.ts","sourceRoot":"","sources":["../../src/scheduler/LearningCycleScheduler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAMvD,qBAAa,sBAAuB,SAAQ,aAAa,CAAC,sBAAsB,CAAC;IAC/E,OAAO,CAAC,UAAU,CAA+B;IAGjD,OAAO,CAAC,oBAAoB,CAAwE;IAEpG,OAAO,CAAC,WAAW,CAAqB;IACxC,OAAO,CAAC,WAAW,CAAwB;IAG3C,SAAS;IAIT,WAAkB,QAAQ,IAAI,sBAAsB,CAEnD;IAMM,cAA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,YAAY,CAAC,EAAE;YAAE,eAAe,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,IAAI,CAAC;YAAC,iBAAiB,EAAE,MAAM,CAAA;SAAE,CAAA;KACvF;CAuCF"}
|
|
@@ -18,14 +18,14 @@ export class LearningCycleScheduler extends BaseSingleton {
|
|
|
18
18
|
this.dataSources = dataSources;
|
|
19
19
|
}
|
|
20
20
|
start(intervalMinutes = 60) {
|
|
21
|
-
this.runLearningCycle()
|
|
22
|
-
.catch(error => LogError(`Error in initial learning cycle: ${error}`));
|
|
23
|
-
const intervalMs = intervalMinutes * 60 * 1000;
|
|
24
21
|
LogStatus(`Starting learning cycle scheduler with interval of ${intervalMinutes} minutes`);
|
|
22
|
+
const intervalMs = intervalMinutes * 60 * 1000;
|
|
25
23
|
this.intervalId = setInterval(() => {
|
|
26
24
|
this.runLearningCycle()
|
|
27
25
|
.catch(error => LogError(`Error in scheduled learning cycle: ${error}`));
|
|
28
26
|
}, intervalMs);
|
|
27
|
+
this.runLearningCycle()
|
|
28
|
+
.catch(error => LogError(`Error in initial learning cycle: ${error}`));
|
|
29
29
|
}
|
|
30
30
|
stop() {
|
|
31
31
|
if (this.intervalId) {
|
|
@@ -37,7 +37,6 @@ export class LearningCycleScheduler extends BaseSingleton {
|
|
|
37
37
|
async runLearningCycle() {
|
|
38
38
|
const startTime = new Date();
|
|
39
39
|
try {
|
|
40
|
-
LogStatus('Starting scheduled learning cycle execution');
|
|
41
40
|
if (!this.dataSources || this.dataSources.length === 0) {
|
|
42
41
|
throw new Error('No data sources available for the learning cycle');
|
|
43
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LearningCycleScheduler.js","sourceRoot":"","sources":["../../src/scheduler/LearningCycleScheduler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO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|
|
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",
|
|
@@ -22,27 +22,27 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@apollo/server": "^4.9.1",
|
|
24
24
|
"@graphql-tools/utils": "^10.0.1",
|
|
25
|
-
"@memberjunction/actions": "2.
|
|
26
|
-
"@memberjunction/ai": "2.
|
|
27
|
-
"@memberjunction/ai-mistral": "2.
|
|
28
|
-
"@memberjunction/ai-openai": "2.
|
|
29
|
-
"@memberjunction/ai-vectors-pinecone": "2.
|
|
30
|
-
"@memberjunction/aiengine": "2.
|
|
31
|
-
"@memberjunction/core": "2.
|
|
32
|
-
"@memberjunction/core-actions": "2.
|
|
33
|
-
"@memberjunction/core-entities": "2.
|
|
34
|
-
"@memberjunction/data-context": "2.
|
|
35
|
-
"@memberjunction/data-context-server": "2.
|
|
36
|
-
"@memberjunction/doc-utils": "2.
|
|
37
|
-
"@memberjunction/entity-communications-server": "2.
|
|
38
|
-
"@memberjunction/external-change-detection": "2.
|
|
39
|
-
"@memberjunction/global": "2.
|
|
40
|
-
"@memberjunction/graphql-dataprovider": "2.
|
|
41
|
-
"@memberjunction/queue": "2.
|
|
42
|
-
"@memberjunction/skip-types": "2.
|
|
43
|
-
"@memberjunction/sqlserver-dataprovider": "2.
|
|
44
|
-
"@memberjunction/storage": "2.
|
|
45
|
-
"@memberjunction/templates": "2.
|
|
25
|
+
"@memberjunction/actions": "2.37.0",
|
|
26
|
+
"@memberjunction/ai": "2.37.0",
|
|
27
|
+
"@memberjunction/ai-mistral": "2.37.0",
|
|
28
|
+
"@memberjunction/ai-openai": "2.37.0",
|
|
29
|
+
"@memberjunction/ai-vectors-pinecone": "2.37.0",
|
|
30
|
+
"@memberjunction/aiengine": "2.37.0",
|
|
31
|
+
"@memberjunction/core": "2.37.0",
|
|
32
|
+
"@memberjunction/core-actions": "2.37.0",
|
|
33
|
+
"@memberjunction/core-entities": "2.37.0",
|
|
34
|
+
"@memberjunction/data-context": "2.37.0",
|
|
35
|
+
"@memberjunction/data-context-server": "2.37.0",
|
|
36
|
+
"@memberjunction/doc-utils": "2.37.0",
|
|
37
|
+
"@memberjunction/entity-communications-server": "2.37.0",
|
|
38
|
+
"@memberjunction/external-change-detection": "2.37.0",
|
|
39
|
+
"@memberjunction/global": "2.37.0",
|
|
40
|
+
"@memberjunction/graphql-dataprovider": "2.37.0",
|
|
41
|
+
"@memberjunction/queue": "2.37.0",
|
|
42
|
+
"@memberjunction/skip-types": "2.37.0",
|
|
43
|
+
"@memberjunction/sqlserver-dataprovider": "2.37.0",
|
|
44
|
+
"@memberjunction/storage": "2.37.0",
|
|
45
|
+
"@memberjunction/templates": "2.37.0",
|
|
46
46
|
"@types/compression": "^1.7.5",
|
|
47
47
|
"@types/cors": "^2.8.13",
|
|
48
48
|
"@types/jsonwebtoken": "9.0.6",
|
package/src/config.ts
CHANGED
|
@@ -85,6 +85,13 @@ const configInfoSchema = z.object({
|
|
|
85
85
|
___skipAPIurl: z.string().optional(),
|
|
86
86
|
___skipLearningAPIurl: z.string().optional(),
|
|
87
87
|
___skipLearningCycleIntervalInMinutes: z.coerce.number().optional(),
|
|
88
|
+
___skipRunLearningCycles: z.string()
|
|
89
|
+
.optional()
|
|
90
|
+
.default("0")
|
|
91
|
+
.transform((v) => {
|
|
92
|
+
const enabled = v === "1";
|
|
93
|
+
return enabled ? 'Y' : 'N';
|
|
94
|
+
}),
|
|
88
95
|
___skipAPIOrgId: z.string().optional(),
|
|
89
96
|
auth0Domain: z.string().optional(),
|
|
90
97
|
auth0WebClientID: z.string().optional(),
|
|
@@ -121,6 +128,7 @@ export const {
|
|
|
121
128
|
___skipAPIurl,
|
|
122
129
|
___skipLearningAPIurl,
|
|
123
130
|
___skipLearningCycleIntervalInMinutes,
|
|
131
|
+
___skipRunLearningCycles,
|
|
124
132
|
___skipAPIOrgId,
|
|
125
133
|
auth0Domain,
|
|
126
134
|
auth0WebClientID,
|
|
@@ -1402,13 +1402,13 @@ export class AIAgentNote_ {
|
|
|
1402
1402
|
@MaxLength(16)
|
|
1403
1403
|
ID: string;
|
|
1404
1404
|
|
|
1405
|
-
@Field()
|
|
1405
|
+
@Field({nullable: true})
|
|
1406
1406
|
@MaxLength(16)
|
|
1407
|
-
AgentID
|
|
1407
|
+
AgentID?: string;
|
|
1408
1408
|
|
|
1409
|
-
@Field()
|
|
1409
|
+
@Field({nullable: true})
|
|
1410
1410
|
@MaxLength(16)
|
|
1411
|
-
AgentNoteTypeID
|
|
1411
|
+
AgentNoteTypeID?: string;
|
|
1412
1412
|
|
|
1413
1413
|
@Field({nullable: true})
|
|
1414
1414
|
Note?: string;
|
|
@@ -1449,10 +1449,10 @@ export class AIAgentNote_ {
|
|
|
1449
1449
|
@InputType()
|
|
1450
1450
|
export class CreateAIAgentNoteInput {
|
|
1451
1451
|
@Field({ nullable: true })
|
|
1452
|
-
AgentID
|
|
1452
|
+
AgentID: string | null;
|
|
1453
1453
|
|
|
1454
1454
|
@Field({ nullable: true })
|
|
1455
|
-
AgentNoteTypeID
|
|
1455
|
+
AgentNoteTypeID: string | null;
|
|
1456
1456
|
|
|
1457
1457
|
@Field({ nullable: true })
|
|
1458
1458
|
Note: string | null;
|
|
@@ -1474,10 +1474,10 @@ export class UpdateAIAgentNoteInput {
|
|
|
1474
1474
|
ID: string;
|
|
1475
1475
|
|
|
1476
1476
|
@Field({ nullable: true })
|
|
1477
|
-
AgentID?: string;
|
|
1477
|
+
AgentID?: string | null;
|
|
1478
1478
|
|
|
1479
1479
|
@Field({ nullable: true })
|
|
1480
|
-
AgentNoteTypeID?: string;
|
|
1480
|
+
AgentNoteTypeID?: string | null;
|
|
1481
1481
|
|
|
1482
1482
|
@Field({ nullable: true })
|
|
1483
1483
|
Note?: string | null;
|
|
@@ -6271,6 +6271,9 @@ export class User_ {
|
|
|
6271
6271
|
@Field(() => [UserFavorite_])
|
|
6272
6272
|
UserFavorites_UserIDArray: UserFavorite_[]; // Link to UserFavorites
|
|
6273
6273
|
|
|
6274
|
+
@Field(() => [ResourceLink_])
|
|
6275
|
+
ResourceLinks_UserIDArray: ResourceLink_[]; // Link to ResourceLinks
|
|
6276
|
+
|
|
6274
6277
|
@Field(() => [ListCategory_])
|
|
6275
6278
|
ListCategories_UserIDArray: ListCategory_[]; // Link to ListCategories
|
|
6276
6279
|
|
|
@@ -6280,24 +6283,21 @@ export class User_ {
|
|
|
6280
6283
|
@Field(() => [AIAgentRequest_])
|
|
6281
6284
|
AIAgentRequests_ResponseByUserIDArray: AIAgentRequest_[]; // Link to AIAgentRequests
|
|
6282
6285
|
|
|
6283
|
-
@Field(() => [ResourceLink_])
|
|
6284
|
-
ResourceLinks_UserIDArray: ResourceLink_[]; // Link to ResourceLinks
|
|
6285
|
-
|
|
6286
6286
|
@Field(() => [ReportUserState_])
|
|
6287
6287
|
MJ_ReportUserStates_UserIDArray: ReportUserState_[]; // Link to MJ_ReportUserStates
|
|
6288
6288
|
|
|
6289
6289
|
@Field(() => [AIAgentNote_])
|
|
6290
6290
|
AIAgentNotes_UserIDArray: AIAgentNote_[]; // Link to AIAgentNotes
|
|
6291
6291
|
|
|
6292
|
+
@Field(() => [ResourcePermission_])
|
|
6293
|
+
ResourcePermissions_UserIDArray: ResourcePermission_[]; // Link to ResourcePermissions
|
|
6294
|
+
|
|
6292
6295
|
@Field(() => [AIAgentRequest_])
|
|
6293
6296
|
AIAgentRequests_RequestForUserIDArray: AIAgentRequest_[]; // Link to AIAgentRequests
|
|
6294
6297
|
|
|
6295
6298
|
@Field(() => [ConversationDetail_])
|
|
6296
6299
|
ConversationDetails_UserIDArray: ConversationDetail_[]; // Link to ConversationDetails
|
|
6297
6300
|
|
|
6298
|
-
@Field(() => [ResourcePermission_])
|
|
6299
|
-
ResourcePermissions_UserIDArray: ResourcePermission_[]; // Link to ResourcePermissions
|
|
6300
|
-
|
|
6301
6301
|
}
|
|
6302
6302
|
|
|
6303
6303
|
//****************************************************************************
|
|
@@ -6720,6 +6720,15 @@ export class UserResolverBase extends ResolverBase {
|
|
|
6720
6720
|
return result;
|
|
6721
6721
|
}
|
|
6722
6722
|
|
|
6723
|
+
@FieldResolver(() => [ResourceLink_])
|
|
6724
|
+
async ResourceLinks_UserIDArray(@Root() user_: User_, @Ctx() { dataSources, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
6725
|
+
this.CheckUserReadPermissions('Resource Links', userPayload);
|
|
6726
|
+
const dataSource = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
6727
|
+
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwResourceLinks] WHERE [UserID]='${user_.ID}' ` + this.getRowLevelSecurityWhereClause('Resource Links', userPayload, EntityPermissionType.Read, 'AND');
|
|
6728
|
+
const result = this.ArrayMapFieldNamesToCodeNames('Resource Links', await dataSource.query(sSQL));
|
|
6729
|
+
return result;
|
|
6730
|
+
}
|
|
6731
|
+
|
|
6723
6732
|
@FieldResolver(() => [ListCategory_])
|
|
6724
6733
|
async ListCategories_UserIDArray(@Root() user_: User_, @Ctx() { dataSources, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
6725
6734
|
this.CheckUserReadPermissions('List Categories', userPayload);
|
|
@@ -6747,15 +6756,6 @@ export class UserResolverBase extends ResolverBase {
|
|
|
6747
6756
|
return result;
|
|
6748
6757
|
}
|
|
6749
6758
|
|
|
6750
|
-
@FieldResolver(() => [ResourceLink_])
|
|
6751
|
-
async ResourceLinks_UserIDArray(@Root() user_: User_, @Ctx() { dataSources, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
6752
|
-
this.CheckUserReadPermissions('Resource Links', userPayload);
|
|
6753
|
-
const dataSource = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
6754
|
-
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwResourceLinks] WHERE [UserID]='${user_.ID}' ` + this.getRowLevelSecurityWhereClause('Resource Links', userPayload, EntityPermissionType.Read, 'AND');
|
|
6755
|
-
const result = this.ArrayMapFieldNamesToCodeNames('Resource Links', await dataSource.query(sSQL));
|
|
6756
|
-
return result;
|
|
6757
|
-
}
|
|
6758
|
-
|
|
6759
6759
|
@FieldResolver(() => [ReportUserState_])
|
|
6760
6760
|
async MJ_ReportUserStates_UserIDArray(@Root() user_: User_, @Ctx() { dataSources, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
6761
6761
|
this.CheckUserReadPermissions('MJ: Report User States', userPayload);
|
|
@@ -6774,6 +6774,15 @@ export class UserResolverBase extends ResolverBase {
|
|
|
6774
6774
|
return result;
|
|
6775
6775
|
}
|
|
6776
6776
|
|
|
6777
|
+
@FieldResolver(() => [ResourcePermission_])
|
|
6778
|
+
async ResourcePermissions_UserIDArray(@Root() user_: User_, @Ctx() { dataSources, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
6779
|
+
this.CheckUserReadPermissions('Resource Permissions', userPayload);
|
|
6780
|
+
const dataSource = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
6781
|
+
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwResourcePermissions] WHERE [UserID]='${user_.ID}' ` + this.getRowLevelSecurityWhereClause('Resource Permissions', userPayload, EntityPermissionType.Read, 'AND');
|
|
6782
|
+
const result = this.ArrayMapFieldNamesToCodeNames('Resource Permissions', await dataSource.query(sSQL));
|
|
6783
|
+
return result;
|
|
6784
|
+
}
|
|
6785
|
+
|
|
6777
6786
|
@FieldResolver(() => [AIAgentRequest_])
|
|
6778
6787
|
async AIAgentRequests_RequestForUserIDArray(@Root() user_: User_, @Ctx() { dataSources, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
6779
6788
|
this.CheckUserReadPermissions('AI Agent Requests', userPayload);
|
|
@@ -6792,15 +6801,6 @@ export class UserResolverBase extends ResolverBase {
|
|
|
6792
6801
|
return result;
|
|
6793
6802
|
}
|
|
6794
6803
|
|
|
6795
|
-
@FieldResolver(() => [ResourcePermission_])
|
|
6796
|
-
async ResourcePermissions_UserIDArray(@Root() user_: User_, @Ctx() { dataSources, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
6797
|
-
this.CheckUserReadPermissions('Resource Permissions', userPayload);
|
|
6798
|
-
const dataSource = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
6799
|
-
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwResourcePermissions] WHERE [UserID]='${user_.ID}' ` + this.getRowLevelSecurityWhereClause('Resource Permissions', userPayload, EntityPermissionType.Read, 'AND');
|
|
6800
|
-
const result = this.ArrayMapFieldNamesToCodeNames('Resource Permissions', await dataSource.query(sSQL));
|
|
6801
|
-
return result;
|
|
6802
|
-
}
|
|
6803
|
-
|
|
6804
6804
|
@Mutation(() => User_)
|
|
6805
6805
|
async CreateUser(
|
|
6806
6806
|
@Arg('input', () => CreateUserInput) input: CreateUserInput,
|
|
@@ -12023,9 +12023,6 @@ export class AIModel_ {
|
|
|
12023
12023
|
@MaxLength(200)
|
|
12024
12024
|
SupportedResponseFormats: string;
|
|
12025
12025
|
|
|
12026
|
-
@Field(() => Boolean, {description: `Specifies if the model supports the concept of an effort level. For example, for a reasoning model, the options often include low, medium, and high.`})
|
|
12027
|
-
SupportsEffortLevel: boolean;
|
|
12028
|
-
|
|
12029
12026
|
@Field()
|
|
12030
12027
|
@MaxLength(100)
|
|
12031
12028
|
AIModelType: string;
|
|
@@ -12042,15 +12039,15 @@ export class AIModel_ {
|
|
|
12042
12039
|
@Field(() => [VectorIndex_])
|
|
12043
12040
|
VectorIndexes_EmbeddingModelIDArray: VectorIndex_[]; // Link to VectorIndexes
|
|
12044
12041
|
|
|
12042
|
+
@Field(() => [ContentType_])
|
|
12043
|
+
ContentTypes_AIModelIDArray: ContentType_[]; // Link to ContentTypes
|
|
12044
|
+
|
|
12045
12045
|
@Field(() => [AIResultCache_])
|
|
12046
12046
|
AIResultCache_AIModelIDArray: AIResultCache_[]; // Link to AIResultCache
|
|
12047
12047
|
|
|
12048
12048
|
@Field(() => [EntityAIAction_])
|
|
12049
12049
|
EntityAIActions_AIModelIDArray: EntityAIAction_[]; // Link to EntityAIActions
|
|
12050
12050
|
|
|
12051
|
-
@Field(() => [ContentType_])
|
|
12052
|
-
ContentTypes_AIModelIDArray: ContentType_[]; // Link to ContentTypes
|
|
12053
|
-
|
|
12054
12051
|
@Field(() => [AIAgentModel_])
|
|
12055
12052
|
AIAgentModels_ModelIDArray: AIAgentModel_[]; // Link to AIAgentModels
|
|
12056
12053
|
|
|
@@ -12105,9 +12102,6 @@ export class CreateAIModelInput {
|
|
|
12105
12102
|
|
|
12106
12103
|
@Field({ nullable: true })
|
|
12107
12104
|
SupportedResponseFormats?: string;
|
|
12108
|
-
|
|
12109
|
-
@Field(() => Boolean, { nullable: true })
|
|
12110
|
-
SupportsEffortLevel?: boolean;
|
|
12111
12105
|
}
|
|
12112
12106
|
|
|
12113
12107
|
|
|
@@ -12161,9 +12155,6 @@ export class UpdateAIModelInput {
|
|
|
12161
12155
|
@Field({ nullable: true })
|
|
12162
12156
|
SupportedResponseFormats?: string;
|
|
12163
12157
|
|
|
12164
|
-
@Field(() => Boolean, { nullable: true })
|
|
12165
|
-
SupportsEffortLevel?: boolean;
|
|
12166
|
-
|
|
12167
12158
|
@Field(() => [KeyValuePairInput], { nullable: true })
|
|
12168
12159
|
OldValues___?: KeyValuePairInput[];
|
|
12169
12160
|
}
|
|
@@ -12269,6 +12260,15 @@ export class AIModelResolver extends ResolverBase {
|
|
|
12269
12260
|
return result;
|
|
12270
12261
|
}
|
|
12271
12262
|
|
|
12263
|
+
@FieldResolver(() => [ContentType_])
|
|
12264
|
+
async ContentTypes_AIModelIDArray(@Root() aimodel_: AIModel_, @Ctx() { dataSources, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
12265
|
+
this.CheckUserReadPermissions('Content Types', userPayload);
|
|
12266
|
+
const dataSource = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
12267
|
+
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwContentTypes] WHERE [AIModelID]='${aimodel_.ID}' ` + this.getRowLevelSecurityWhereClause('Content Types', userPayload, EntityPermissionType.Read, 'AND');
|
|
12268
|
+
const result = this.ArrayMapFieldNamesToCodeNames('Content Types', await dataSource.query(sSQL));
|
|
12269
|
+
return result;
|
|
12270
|
+
}
|
|
12271
|
+
|
|
12272
12272
|
@FieldResolver(() => [AIResultCache_])
|
|
12273
12273
|
async AIResultCache_AIModelIDArray(@Root() aimodel_: AIModel_, @Ctx() { dataSources, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
12274
12274
|
this.CheckUserReadPermissions('AI Result Cache', userPayload);
|
|
@@ -12287,15 +12287,6 @@ export class AIModelResolver extends ResolverBase {
|
|
|
12287
12287
|
return result;
|
|
12288
12288
|
}
|
|
12289
12289
|
|
|
12290
|
-
@FieldResolver(() => [ContentType_])
|
|
12291
|
-
async ContentTypes_AIModelIDArray(@Root() aimodel_: AIModel_, @Ctx() { dataSources, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
12292
|
-
this.CheckUserReadPermissions('Content Types', userPayload);
|
|
12293
|
-
const dataSource = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
12294
|
-
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwContentTypes] WHERE [AIModelID]='${aimodel_.ID}' ` + this.getRowLevelSecurityWhereClause('Content Types', userPayload, EntityPermissionType.Read, 'AND');
|
|
12295
|
-
const result = this.ArrayMapFieldNamesToCodeNames('Content Types', await dataSource.query(sSQL));
|
|
12296
|
-
return result;
|
|
12297
|
-
}
|
|
12298
|
-
|
|
12299
12290
|
@FieldResolver(() => [AIAgentModel_])
|
|
12300
12291
|
async AIAgentModels_ModelIDArray(@Root() aimodel_: AIModel_, @Ctx() { dataSources, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
12301
12292
|
this.CheckUserReadPermissions('AI Agent Models', userPayload);
|
|
@@ -15709,6 +15700,14 @@ export class ConversationDetail_ {
|
|
|
15709
15700
|
@MaxLength(16)
|
|
15710
15701
|
UserID?: string;
|
|
15711
15702
|
|
|
15703
|
+
@Field({nullable: true, description: `Optional reference to a conversation artifact associated with this conversation detail`})
|
|
15704
|
+
@MaxLength(16)
|
|
15705
|
+
ArtifactID?: string;
|
|
15706
|
+
|
|
15707
|
+
@Field({nullable: true, description: `Optional reference to a specific version of a conversation artifact associated with this conversation detail`})
|
|
15708
|
+
@MaxLength(16)
|
|
15709
|
+
ArtifactVersionID?: string;
|
|
15710
|
+
|
|
15712
15711
|
@Field({nullable: true})
|
|
15713
15712
|
@MaxLength(510)
|
|
15714
15713
|
Conversation?: string;
|
|
@@ -15717,6 +15716,10 @@ export class ConversationDetail_ {
|
|
|
15717
15716
|
@MaxLength(200)
|
|
15718
15717
|
User?: string;
|
|
15719
15718
|
|
|
15719
|
+
@Field({nullable: true})
|
|
15720
|
+
@MaxLength(510)
|
|
15721
|
+
Artifact?: string;
|
|
15722
|
+
|
|
15720
15723
|
@Field(() => [Report_])
|
|
15721
15724
|
Reports_ConversationDetailIDArray: Report_[]; // Link to Reports
|
|
15722
15725
|
|
|
@@ -15759,6 +15762,12 @@ export class CreateConversationDetailInput {
|
|
|
15759
15762
|
|
|
15760
15763
|
@Field({ nullable: true })
|
|
15761
15764
|
UserID: string | null;
|
|
15765
|
+
|
|
15766
|
+
@Field({ nullable: true })
|
|
15767
|
+
ArtifactID: string | null;
|
|
15768
|
+
|
|
15769
|
+
@Field({ nullable: true })
|
|
15770
|
+
ArtifactVersionID: string | null;
|
|
15762
15771
|
}
|
|
15763
15772
|
|
|
15764
15773
|
|
|
@@ -15803,6 +15812,12 @@ export class UpdateConversationDetailInput {
|
|
|
15803
15812
|
@Field({ nullable: true })
|
|
15804
15813
|
UserID?: string | null;
|
|
15805
15814
|
|
|
15815
|
+
@Field({ nullable: true })
|
|
15816
|
+
ArtifactID?: string | null;
|
|
15817
|
+
|
|
15818
|
+
@Field({ nullable: true })
|
|
15819
|
+
ArtifactVersionID?: string | null;
|
|
15820
|
+
|
|
15806
15821
|
@Field(() => [KeyValuePairInput], { nullable: true })
|
|
15807
15822
|
OldValues___?: KeyValuePairInput[];
|
|
15808
15823
|
}
|
|
@@ -29399,6 +29414,9 @@ export class ConversationArtifactVersion_ {
|
|
|
29399
29414
|
@MaxLength(510)
|
|
29400
29415
|
ConversationArtifact: string;
|
|
29401
29416
|
|
|
29417
|
+
@Field(() => [ConversationDetail_])
|
|
29418
|
+
ConversationDetails_ArtifactVersionIDArray: ConversationDetail_[]; // Link to ConversationDetails
|
|
29419
|
+
|
|
29402
29420
|
}
|
|
29403
29421
|
|
|
29404
29422
|
//****************************************************************************
|
|
@@ -29506,6 +29524,15 @@ export class ConversationArtifactVersionResolver extends ResolverBase {
|
|
|
29506
29524
|
return result;
|
|
29507
29525
|
}
|
|
29508
29526
|
|
|
29527
|
+
@FieldResolver(() => [ConversationDetail_])
|
|
29528
|
+
async ConversationDetails_ArtifactVersionIDArray(@Root() conversationartifactversion_: ConversationArtifactVersion_, @Ctx() { dataSources, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
29529
|
+
this.CheckUserReadPermissions('Conversation Details', userPayload);
|
|
29530
|
+
const dataSource = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
29531
|
+
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwConversationDetails] WHERE [ArtifactVersionID]='${conversationartifactversion_.ID}' ` + this.getRowLevelSecurityWhereClause('Conversation Details', userPayload, EntityPermissionType.Read, 'AND');
|
|
29532
|
+
const result = this.ArrayMapFieldNamesToCodeNames('Conversation Details', await dataSource.query(sSQL));
|
|
29533
|
+
return result;
|
|
29534
|
+
}
|
|
29535
|
+
|
|
29509
29536
|
@Mutation(() => ConversationArtifactVersion_)
|
|
29510
29537
|
async CreateConversationArtifactVersion(
|
|
29511
29538
|
@Arg('input', () => CreateConversationArtifactVersionInput) input: CreateConversationArtifactVersionInput,
|
|
@@ -30294,6 +30321,9 @@ export class ConversationArtifact_ {
|
|
|
30294
30321
|
@Field(() => [ConversationArtifactVersion_])
|
|
30295
30322
|
MJ_ConversationArtifactVersions_ConversationArtifactIDArray: ConversationArtifactVersion_[]; // Link to MJ_ConversationArtifactVersions
|
|
30296
30323
|
|
|
30324
|
+
@Field(() => [ConversationDetail_])
|
|
30325
|
+
ConversationDetails_ArtifactIDArray: ConversationDetail_[]; // Link to ConversationDetails
|
|
30326
|
+
|
|
30297
30327
|
}
|
|
30298
30328
|
|
|
30299
30329
|
//****************************************************************************
|
|
@@ -30425,6 +30455,15 @@ export class ConversationArtifactResolver extends ResolverBase {
|
|
|
30425
30455
|
return result;
|
|
30426
30456
|
}
|
|
30427
30457
|
|
|
30458
|
+
@FieldResolver(() => [ConversationDetail_])
|
|
30459
|
+
async ConversationDetails_ArtifactIDArray(@Root() conversationartifact_: ConversationArtifact_, @Ctx() { dataSources, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
30460
|
+
this.CheckUserReadPermissions('Conversation Details', userPayload);
|
|
30461
|
+
const dataSource = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
30462
|
+
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwConversationDetails] WHERE [ArtifactID]='${conversationartifact_.ID}' ` + this.getRowLevelSecurityWhereClause('Conversation Details', userPayload, EntityPermissionType.Read, 'AND');
|
|
30463
|
+
const result = this.ArrayMapFieldNamesToCodeNames('Conversation Details', await dataSource.query(sSQL));
|
|
30464
|
+
return result;
|
|
30465
|
+
}
|
|
30466
|
+
|
|
30428
30467
|
@Mutation(() => ConversationArtifact_)
|
|
30429
30468
|
async CreateConversationArtifact(
|
|
30430
30469
|
@Arg('input', () => CreateConversationArtifactInput) input: CreateConversationArtifactInput,
|
|
@@ -775,7 +775,31 @@ export class ResolverBase {
|
|
|
775
775
|
if (field) {
|
|
776
776
|
switch (field.TSType) {
|
|
777
777
|
case EntityFieldTSType.Number:
|
|
778
|
-
|
|
778
|
+
if (val == null && val == undefined) {
|
|
779
|
+
val = null;
|
|
780
|
+
}
|
|
781
|
+
else {
|
|
782
|
+
let typeLowered = (field.Type as string).toLowerCase();
|
|
783
|
+
|
|
784
|
+
switch (typeLowered) {
|
|
785
|
+
case 'int':
|
|
786
|
+
case 'smallint':
|
|
787
|
+
case 'bigint':
|
|
788
|
+
case 'tinyint':
|
|
789
|
+
val = parseInt(val);
|
|
790
|
+
break;
|
|
791
|
+
case 'money':
|
|
792
|
+
case 'smallmoney':
|
|
793
|
+
case 'decimal':
|
|
794
|
+
case 'numeric':
|
|
795
|
+
case 'float':
|
|
796
|
+
val = parseFloat(val);
|
|
797
|
+
break;
|
|
798
|
+
default:
|
|
799
|
+
val = parseFloat(val);
|
|
800
|
+
break;
|
|
801
|
+
}
|
|
802
|
+
}
|
|
779
803
|
break;
|
|
780
804
|
case EntityFieldTSType.Boolean:
|
|
781
805
|
val = val === null || val === undefined || val === 'false' || val === '0' || parseInt(val) === 0 ? false : true;
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
UserNotificationEntity,
|
|
48
48
|
} from '@memberjunction/core-entities';
|
|
49
49
|
import { DataSource } from 'typeorm';
|
|
50
|
-
import { ___skipAPIOrgId, ___skipAPIurl, ___skipLearningAPIurl, ___skipLearningCycleIntervalInMinutes, apiKey, baseUrl, configInfo, graphqlPort, mj_core_schema } from '../config.js';
|
|
50
|
+
import { ___skipAPIOrgId, ___skipAPIurl, ___skipLearningAPIurl, ___skipLearningCycleIntervalInMinutes, ___skipRunLearningCycles, apiKey, baseUrl, configInfo, graphqlPort, mj_core_schema } from '../config.js';
|
|
51
51
|
|
|
52
52
|
import { registerEnumType } from 'type-graphql';
|
|
53
53
|
import { MJGlobal, CopyScalarsAndArrays } from '@memberjunction/global';
|
|
@@ -162,14 +162,23 @@ export class AskSkipResolver {
|
|
|
162
162
|
// Static initializer that runs when the class is loaded - initializes the learning cycle scheduler
|
|
163
163
|
static {
|
|
164
164
|
try {
|
|
165
|
-
LogStatus('Initializing Skip AI Learning Cycle Scheduler');
|
|
166
|
-
|
|
167
165
|
// Set up event listener for server initialization
|
|
168
166
|
const eventListener = MJGlobal.Instance.GetEventListener(true);
|
|
169
167
|
eventListener.subscribe(event => {
|
|
170
168
|
// Filter for our server's setup complete event
|
|
171
169
|
if (event.eventCode === MJ_SERVER_EVENT_CODE && event.args?.type === 'setupComplete') {
|
|
172
170
|
try {
|
|
171
|
+
if (___skipRunLearningCycles !== 'Y') {
|
|
172
|
+
LogStatus('Skip AI Learning cycle scheduler not started: Disabled in configuration');
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// Check if we have a valid endpoint when cycles are enabled
|
|
177
|
+
if (!___skipLearningAPIurl || ___skipLearningAPIurl.trim() === '') {
|
|
178
|
+
LogError('Skip AI Learning cycle scheduler not started: Learning cycles are enabled but no API endpoint is configured');
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
|
|
173
182
|
const dataSources = event.args.dataSources;
|
|
174
183
|
if (dataSources && dataSources.length > 0) {
|
|
175
184
|
// Initialize the scheduler
|
|
@@ -181,7 +190,6 @@ export class AskSkipResolver {
|
|
|
181
190
|
// Default is 60 minutes, if the interval is not set in the config, use 60 minutes
|
|
182
191
|
const interval = ___skipLearningCycleIntervalInMinutes ?? 60;
|
|
183
192
|
scheduler.start(interval);
|
|
184
|
-
LogStatus(`📅 Skip AI Learning cycle scheduler started with ${interval} minute interval`);
|
|
185
193
|
} else {
|
|
186
194
|
LogError('Cannot initialize Skip learning cycle scheduler: No data sources available');
|
|
187
195
|
}
|
|
@@ -190,8 +198,6 @@ export class AskSkipResolver {
|
|
|
190
198
|
}
|
|
191
199
|
}
|
|
192
200
|
});
|
|
193
|
-
|
|
194
|
-
LogStatus('Skip AI Learning Cycle Scheduler initialization listener registered');
|
|
195
201
|
} catch (error) {
|
|
196
202
|
// Handle any errors from the static initializer
|
|
197
203
|
LogError(`Failed to initialize Skip learning cycle scheduler: ${error}`);
|
|
@@ -283,6 +289,30 @@ export class AskSkipResolver {
|
|
|
283
289
|
@Ctx() { dataSource, userPayload }: AppContext,
|
|
284
290
|
@Arg('ForceEntityRefresh', () => Boolean, { nullable: true }) ForceEntityRefresh?: boolean
|
|
285
291
|
) {
|
|
292
|
+
// First check if learning cycles are enabled in configuration
|
|
293
|
+
if (___skipRunLearningCycles !== 'Y') {
|
|
294
|
+
return {
|
|
295
|
+
success: false,
|
|
296
|
+
error: 'Learning cycles are disabled in configuration',
|
|
297
|
+
elapsedTime: 0,
|
|
298
|
+
noteChanges: [],
|
|
299
|
+
queryChanges: [],
|
|
300
|
+
requestChanges: []
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// Check if we have a valid endpoint when cycles are enabled
|
|
305
|
+
if (!___skipLearningAPIurl || ___skipLearningAPIurl.trim() === '') {
|
|
306
|
+
return {
|
|
307
|
+
success: false,
|
|
308
|
+
error: 'Learning cycle API endpoint is not configured',
|
|
309
|
+
elapsedTime: 0,
|
|
310
|
+
noteChanges: [],
|
|
311
|
+
queryChanges: [],
|
|
312
|
+
requestChanges: []
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
|
|
286
316
|
const startTime = new Date();
|
|
287
317
|
// First, get the user from the cache
|
|
288
318
|
const user = UserCache.Instance.Users.find((u) => u.Email.trim().toLowerCase() === userPayload.email.trim().toLowerCase());
|
|
@@ -308,8 +338,6 @@ export class AskSkipResolver {
|
|
|
308
338
|
};
|
|
309
339
|
}
|
|
310
340
|
|
|
311
|
-
LogStatus(`Starting learning cycle for AI agent Skip`);
|
|
312
|
-
|
|
313
341
|
// Get the Skip agent ID
|
|
314
342
|
const md = new Metadata();
|
|
315
343
|
const skipAgent = AIEngine.Instance.GetAgentByName('Skip');
|
|
@@ -342,7 +370,7 @@ export class AskSkipResolver {
|
|
|
342
370
|
try {
|
|
343
371
|
// Build the request to Skip learning API
|
|
344
372
|
LogStatus(`Building Skip Learning API request`);
|
|
345
|
-
const input = await this.buildSkipLearningAPIRequest(learningCycleId, lastCompleteLearningCycleDate, true, true, true,
|
|
373
|
+
const input = await this.buildSkipLearningAPIRequest(learningCycleId, lastCompleteLearningCycleDate, true, true, true, false, dataSource, user, ForceEntityRefresh || false);
|
|
346
374
|
|
|
347
375
|
// Make the API request
|
|
348
376
|
const response = await this.handleSimpleSkipLearningPostRequest(input, user, learningCycleId, agentID);
|
|
@@ -2121,6 +2149,22 @@ cycle.`);
|
|
|
2121
2149
|
try {
|
|
2122
2150
|
LogStatus('Manual execution of Skip learning cycle requested via API');
|
|
2123
2151
|
|
|
2152
|
+
// First check if learning cycles are enabled in configuration
|
|
2153
|
+
if (___skipRunLearningCycles !== 'Y') {
|
|
2154
|
+
return {
|
|
2155
|
+
Success: false,
|
|
2156
|
+
Message: 'Learning cycles are disabled in configuration'
|
|
2157
|
+
};
|
|
2158
|
+
}
|
|
2159
|
+
|
|
2160
|
+
// Check if we have a valid endpoint when cycles are enabled
|
|
2161
|
+
if (!___skipLearningAPIurl || ___skipLearningAPIurl.trim() === '') {
|
|
2162
|
+
return {
|
|
2163
|
+
Success: false,
|
|
2164
|
+
Message: 'Learning cycle API endpoint is not configured'
|
|
2165
|
+
};
|
|
2166
|
+
}
|
|
2167
|
+
|
|
2124
2168
|
// Use the organization ID from config if not provided
|
|
2125
2169
|
const orgId = OrganizationId || ___skipAPIOrgId;
|
|
2126
2170
|
|