@memberjunction/server 2.78.0 → 2.80.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/generated/generated.d.ts +48 -8
- package/dist/generated/generated.d.ts.map +1 -1
- package/dist/generated/generated.js +317 -70
- package/dist/generated/generated.js.map +1 -1
- package/dist/resolvers/CreateQueryResolver.d.ts +71 -0
- package/dist/resolvers/CreateQueryResolver.d.ts.map +1 -1
- package/dist/resolvers/CreateQueryResolver.js +500 -27
- package/dist/resolvers/CreateQueryResolver.js.map +1 -1
- package/package.json +34 -34
- package/src/generated/generated.ts +205 -53
- package/src/resolvers/CreateQueryResolver.ts +409 -41
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/server",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.80.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",
|
|
@@ -22,39 +22,39 @@
|
|
|
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-core-plus": "2.
|
|
28
|
-
"@memberjunction/ai-agents": "2.
|
|
29
|
-
"@memberjunction/aiengine": "2.
|
|
30
|
-
"@memberjunction/ai-prompts": "2.
|
|
31
|
-
"@memberjunction/ai-agent-manager-actions": "2.
|
|
32
|
-
"@memberjunction/ai-mistral": "2.
|
|
33
|
-
"@memberjunction/ai-openai": "2.
|
|
34
|
-
"@memberjunction/ai-anthropic": "2.
|
|
35
|
-
"@memberjunction/ai-groq": "2.
|
|
36
|
-
"@memberjunction/ai-cerebras": "2.
|
|
37
|
-
"@memberjunction/ai-vectors-pinecone": "2.
|
|
38
|
-
"@memberjunction/core": "2.
|
|
39
|
-
"@memberjunction/core-actions": "2.
|
|
40
|
-
"@memberjunction/actions-bizapps-accounting": "2.
|
|
41
|
-
"@memberjunction/actions-bizapps-crm": "2.
|
|
42
|
-
"@memberjunction/actions-bizapps-lms": "2.
|
|
43
|
-
"@memberjunction/actions-bizapps-social": "2.
|
|
44
|
-
"@memberjunction/core-entities": "2.
|
|
45
|
-
"@memberjunction/core-entities-server": "2.
|
|
46
|
-
"@memberjunction/data-context": "2.
|
|
47
|
-
"@memberjunction/data-context-server": "2.
|
|
48
|
-
"@memberjunction/doc-utils": "2.
|
|
49
|
-
"@memberjunction/entity-communications-server": "2.
|
|
50
|
-
"@memberjunction/external-change-detection": "2.
|
|
51
|
-
"@memberjunction/global": "2.
|
|
52
|
-
"@memberjunction/graphql-dataprovider": "2.
|
|
53
|
-
"@memberjunction/queue": "2.
|
|
54
|
-
"@memberjunction/skip-types": "2.
|
|
55
|
-
"@memberjunction/sqlserver-dataprovider": "2.
|
|
56
|
-
"@memberjunction/storage": "2.
|
|
57
|
-
"@memberjunction/templates": "2.
|
|
25
|
+
"@memberjunction/actions": "2.80.0",
|
|
26
|
+
"@memberjunction/ai": "2.80.0",
|
|
27
|
+
"@memberjunction/ai-core-plus": "2.80.0",
|
|
28
|
+
"@memberjunction/ai-agents": "2.80.0",
|
|
29
|
+
"@memberjunction/aiengine": "2.80.0",
|
|
30
|
+
"@memberjunction/ai-prompts": "2.80.0",
|
|
31
|
+
"@memberjunction/ai-agent-manager-actions": "2.80.0",
|
|
32
|
+
"@memberjunction/ai-mistral": "2.80.0",
|
|
33
|
+
"@memberjunction/ai-openai": "2.80.0",
|
|
34
|
+
"@memberjunction/ai-anthropic": "2.80.0",
|
|
35
|
+
"@memberjunction/ai-groq": "2.80.0",
|
|
36
|
+
"@memberjunction/ai-cerebras": "2.80.0",
|
|
37
|
+
"@memberjunction/ai-vectors-pinecone": "2.80.0",
|
|
38
|
+
"@memberjunction/core": "2.80.0",
|
|
39
|
+
"@memberjunction/core-actions": "2.80.0",
|
|
40
|
+
"@memberjunction/actions-bizapps-accounting": "2.80.0",
|
|
41
|
+
"@memberjunction/actions-bizapps-crm": "2.80.0",
|
|
42
|
+
"@memberjunction/actions-bizapps-lms": "2.80.0",
|
|
43
|
+
"@memberjunction/actions-bizapps-social": "2.80.0",
|
|
44
|
+
"@memberjunction/core-entities": "2.80.0",
|
|
45
|
+
"@memberjunction/core-entities-server": "2.80.0",
|
|
46
|
+
"@memberjunction/data-context": "2.80.0",
|
|
47
|
+
"@memberjunction/data-context-server": "2.80.0",
|
|
48
|
+
"@memberjunction/doc-utils": "2.80.0",
|
|
49
|
+
"@memberjunction/entity-communications-server": "2.80.0",
|
|
50
|
+
"@memberjunction/external-change-detection": "2.80.0",
|
|
51
|
+
"@memberjunction/global": "2.80.0",
|
|
52
|
+
"@memberjunction/graphql-dataprovider": "2.80.0",
|
|
53
|
+
"@memberjunction/queue": "2.80.0",
|
|
54
|
+
"@memberjunction/skip-types": "2.80.0",
|
|
55
|
+
"@memberjunction/sqlserver-dataprovider": "2.80.0",
|
|
56
|
+
"@memberjunction/storage": "2.80.0",
|
|
57
|
+
"@memberjunction/templates": "2.80.0",
|
|
58
58
|
"@types/compression": "^1.7.5",
|
|
59
59
|
"@types/cors": "^2.8.13",
|
|
60
60
|
"@types/jsonwebtoken": "9.0.6",
|
|
@@ -1332,6 +1332,24 @@ export class AIAgentRun_ {
|
|
|
1332
1332
|
each time the agent processes a prompt step.`})
|
|
1333
1333
|
TotalPromptIterations: number;
|
|
1334
1334
|
|
|
1335
|
+
@Field({nullable: true, description: `The AI Configuration used for this agent execution. When set, this configuration was used for all prompts executed by this agent and its sub-agents.`})
|
|
1336
|
+
@MaxLength(16)
|
|
1337
|
+
ConfigurationID?: string;
|
|
1338
|
+
|
|
1339
|
+
@Field({nullable: true, description: `Runtime model override that was used for this execution. When set, this model took precedence over all other model selection methods.`})
|
|
1340
|
+
@MaxLength(16)
|
|
1341
|
+
OverrideModelID?: string;
|
|
1342
|
+
|
|
1343
|
+
@Field({nullable: true, description: `Runtime vendor override that was used for this execution. When set along with OverrideModelID, this vendor was used to provide the model.`})
|
|
1344
|
+
@MaxLength(16)
|
|
1345
|
+
OverrideVendorID?: string;
|
|
1346
|
+
|
|
1347
|
+
@Field({nullable: true, description: `JSON serialized data that was passed for template rendering and prompt execution. This data was passed to the agent's prompt as well as all sub-agents.`})
|
|
1348
|
+
Data?: string;
|
|
1349
|
+
|
|
1350
|
+
@Field(() => Boolean, {nullable: true, description: `Indicates whether verbose logging was enabled during this agent execution. When true, detailed decision-making and execution flow was logged.`})
|
|
1351
|
+
Verbose?: boolean;
|
|
1352
|
+
|
|
1335
1353
|
@Field({nullable: true})
|
|
1336
1354
|
@MaxLength(510)
|
|
1337
1355
|
Agent?: string;
|
|
@@ -1344,12 +1362,24 @@ each time the agent processes a prompt step.`})
|
|
|
1344
1362
|
@MaxLength(200)
|
|
1345
1363
|
User?: string;
|
|
1346
1364
|
|
|
1347
|
-
@Field(
|
|
1348
|
-
|
|
1349
|
-
|
|
1365
|
+
@Field({nullable: true})
|
|
1366
|
+
@MaxLength(200)
|
|
1367
|
+
Configuration?: string;
|
|
1368
|
+
|
|
1369
|
+
@Field({nullable: true})
|
|
1370
|
+
@MaxLength(100)
|
|
1371
|
+
OverrideModel?: string;
|
|
1372
|
+
|
|
1373
|
+
@Field({nullable: true})
|
|
1374
|
+
@MaxLength(100)
|
|
1375
|
+
OverrideVendor?: string;
|
|
1376
|
+
|
|
1350
1377
|
@Field(() => [AIAgentRunStep_])
|
|
1351
1378
|
MJ_AIAgentRunSteps_AgentRunIDArray: AIAgentRunStep_[]; // Link to MJ_AIAgentRunSteps
|
|
1352
1379
|
|
|
1380
|
+
@Field(() => [AIAgentRun_])
|
|
1381
|
+
MJ_AIAgentRuns_ParentRunIDArray: AIAgentRun_[]; // Link to MJ_AIAgentRuns
|
|
1382
|
+
|
|
1353
1383
|
@Field(() => [AIPromptRun_])
|
|
1354
1384
|
MJ_AIPromptRuns_AgentRunIDArray: AIPromptRun_[]; // Link to MJ_AIPromptRuns
|
|
1355
1385
|
|
|
@@ -1446,6 +1476,21 @@ export class CreateAIAgentRunInput {
|
|
|
1446
1476
|
|
|
1447
1477
|
@Field(() => Int, { nullable: true })
|
|
1448
1478
|
TotalPromptIterations?: number;
|
|
1479
|
+
|
|
1480
|
+
@Field({ nullable: true })
|
|
1481
|
+
ConfigurationID: string | null;
|
|
1482
|
+
|
|
1483
|
+
@Field({ nullable: true })
|
|
1484
|
+
OverrideModelID: string | null;
|
|
1485
|
+
|
|
1486
|
+
@Field({ nullable: true })
|
|
1487
|
+
OverrideVendorID: string | null;
|
|
1488
|
+
|
|
1489
|
+
@Field({ nullable: true })
|
|
1490
|
+
Data: string | null;
|
|
1491
|
+
|
|
1492
|
+
@Field(() => Boolean, { nullable: true })
|
|
1493
|
+
Verbose?: boolean | null;
|
|
1449
1494
|
}
|
|
1450
1495
|
|
|
1451
1496
|
|
|
@@ -1541,6 +1586,21 @@ export class UpdateAIAgentRunInput {
|
|
|
1541
1586
|
@Field(() => Int, { nullable: true })
|
|
1542
1587
|
TotalPromptIterations?: number;
|
|
1543
1588
|
|
|
1589
|
+
@Field({ nullable: true })
|
|
1590
|
+
ConfigurationID?: string | null;
|
|
1591
|
+
|
|
1592
|
+
@Field({ nullable: true })
|
|
1593
|
+
OverrideModelID?: string | null;
|
|
1594
|
+
|
|
1595
|
+
@Field({ nullable: true })
|
|
1596
|
+
OverrideVendorID?: string | null;
|
|
1597
|
+
|
|
1598
|
+
@Field({ nullable: true })
|
|
1599
|
+
Data?: string | null;
|
|
1600
|
+
|
|
1601
|
+
@Field(() => Boolean, { nullable: true })
|
|
1602
|
+
Verbose?: boolean | null;
|
|
1603
|
+
|
|
1544
1604
|
@Field(() => [KeyValuePairInput], { nullable: true })
|
|
1545
1605
|
OldValues___?: KeyValuePairInput[];
|
|
1546
1606
|
}
|
|
@@ -1603,25 +1663,25 @@ export class AIAgentRunResolver extends ResolverBase {
|
|
|
1603
1663
|
return result;
|
|
1604
1664
|
}
|
|
1605
1665
|
|
|
1606
|
-
@FieldResolver(() => [
|
|
1607
|
-
async
|
|
1608
|
-
this.CheckUserReadPermissions('MJ: AI Agent
|
|
1666
|
+
@FieldResolver(() => [AIAgentRunStep_])
|
|
1667
|
+
async MJ_AIAgentRunSteps_AgentRunIDArray(@Root() aiagentrun_: AIAgentRun_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
1668
|
+
this.CheckUserReadPermissions('MJ: AI Agent Run Steps', userPayload);
|
|
1609
1669
|
const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
|
|
1610
1670
|
const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
1611
|
-
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[
|
|
1671
|
+
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentRunSteps] WHERE [AgentRunID]='${aiagentrun_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Run Steps', userPayload, EntityPermissionType.Read, 'AND');
|
|
1612
1672
|
const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
|
|
1613
|
-
const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent
|
|
1673
|
+
const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Run Steps', rows);
|
|
1614
1674
|
return result;
|
|
1615
1675
|
}
|
|
1616
1676
|
|
|
1617
|
-
@FieldResolver(() => [
|
|
1618
|
-
async
|
|
1619
|
-
this.CheckUserReadPermissions('MJ: AI Agent
|
|
1677
|
+
@FieldResolver(() => [AIAgentRun_])
|
|
1678
|
+
async MJ_AIAgentRuns_ParentRunIDArray(@Root() aiagentrun_: AIAgentRun_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
1679
|
+
this.CheckUserReadPermissions('MJ: AI Agent Runs', userPayload);
|
|
1620
1680
|
const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
|
|
1621
1681
|
const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
1622
|
-
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[
|
|
1682
|
+
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentRuns] WHERE [ParentRunID]='${aiagentrun_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Runs', userPayload, EntityPermissionType.Read, 'AND');
|
|
1623
1683
|
const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
|
|
1624
|
-
const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent
|
|
1684
|
+
const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Runs', rows);
|
|
1625
1685
|
return result;
|
|
1626
1686
|
}
|
|
1627
1687
|
|
|
@@ -1707,6 +1767,9 @@ export class AIVendor_ {
|
|
|
1707
1767
|
@Field(() => [AIModelCost_])
|
|
1708
1768
|
MJ_AIModelCosts_VendorIDArray: AIModelCost_[]; // Link to MJ_AIModelCosts
|
|
1709
1769
|
|
|
1770
|
+
@Field(() => [AIAgentRun_])
|
|
1771
|
+
MJ_AIAgentRuns_OverrideVendorIDArray: AIAgentRun_[]; // Link to MJ_AIAgentRuns
|
|
1772
|
+
|
|
1710
1773
|
}
|
|
1711
1774
|
|
|
1712
1775
|
//****************************************************************************
|
|
@@ -1867,6 +1930,17 @@ export class AIVendorResolver extends ResolverBase {
|
|
|
1867
1930
|
return result;
|
|
1868
1931
|
}
|
|
1869
1932
|
|
|
1933
|
+
@FieldResolver(() => [AIAgentRun_])
|
|
1934
|
+
async MJ_AIAgentRuns_OverrideVendorIDArray(@Root() aivendor_: AIVendor_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
1935
|
+
this.CheckUserReadPermissions('MJ: AI Agent Runs', userPayload);
|
|
1936
|
+
const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
|
|
1937
|
+
const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
1938
|
+
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentRuns] WHERE [OverrideVendorID]='${aivendor_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Runs', userPayload, EntityPermissionType.Read, 'AND');
|
|
1939
|
+
const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
|
|
1940
|
+
const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Runs', rows);
|
|
1941
|
+
return result;
|
|
1942
|
+
}
|
|
1943
|
+
|
|
1870
1944
|
@Mutation(() => AIVendor_)
|
|
1871
1945
|
async CreateAIVendor(
|
|
1872
1946
|
@Arg('input', () => CreateAIVendorInput) input: CreateAIVendorInput,
|
|
@@ -1949,15 +2023,18 @@ export class AIConfiguration_ {
|
|
|
1949
2023
|
@Field(() => [AIAgentPrompt_])
|
|
1950
2024
|
MJ_AIAgentPrompts_ConfigurationIDArray: AIAgentPrompt_[]; // Link to MJ_AIAgentPrompts
|
|
1951
2025
|
|
|
1952
|
-
@Field(() => [AIPromptRun_])
|
|
1953
|
-
MJ_AIPromptRuns_ConfigurationIDArray: AIPromptRun_[]; // Link to MJ_AIPromptRuns
|
|
1954
|
-
|
|
1955
2026
|
@Field(() => [AIPromptModel_])
|
|
1956
2027
|
MJ_AIPromptModels_ConfigurationIDArray: AIPromptModel_[]; // Link to MJ_AIPromptModels
|
|
1957
2028
|
|
|
1958
2029
|
@Field(() => [AIResultCache_])
|
|
1959
2030
|
AIResultCache_ConfigurationIDArray: AIResultCache_[]; // Link to AIResultCache
|
|
1960
2031
|
|
|
2032
|
+
@Field(() => [AIPromptRun_])
|
|
2033
|
+
MJ_AIPromptRuns_ConfigurationIDArray: AIPromptRun_[]; // Link to MJ_AIPromptRuns
|
|
2034
|
+
|
|
2035
|
+
@Field(() => [AIAgentRun_])
|
|
2036
|
+
MJ_AIAgentRuns_ConfigurationIDArray: AIAgentRun_[]; // Link to MJ_AIAgentRuns
|
|
2037
|
+
|
|
1961
2038
|
}
|
|
1962
2039
|
|
|
1963
2040
|
//****************************************************************************
|
|
@@ -2098,17 +2175,6 @@ export class AIConfigurationResolver extends ResolverBase {
|
|
|
2098
2175
|
return result;
|
|
2099
2176
|
}
|
|
2100
2177
|
|
|
2101
|
-
@FieldResolver(() => [AIPromptRun_])
|
|
2102
|
-
async MJ_AIPromptRuns_ConfigurationIDArray(@Root() aiconfiguration_: AIConfiguration_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
2103
|
-
this.CheckUserReadPermissions('MJ: AI Prompt Runs', userPayload);
|
|
2104
|
-
const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
|
|
2105
|
-
const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
2106
|
-
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIPromptRuns] WHERE [ConfigurationID]='${aiconfiguration_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Prompt Runs', userPayload, EntityPermissionType.Read, 'AND');
|
|
2107
|
-
const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
|
|
2108
|
-
const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Prompt Runs', rows);
|
|
2109
|
-
return result;
|
|
2110
|
-
}
|
|
2111
|
-
|
|
2112
2178
|
@FieldResolver(() => [AIPromptModel_])
|
|
2113
2179
|
async MJ_AIPromptModels_ConfigurationIDArray(@Root() aiconfiguration_: AIConfiguration_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
2114
2180
|
this.CheckUserReadPermissions('MJ: AI Prompt Models', userPayload);
|
|
@@ -2131,6 +2197,28 @@ export class AIConfigurationResolver extends ResolverBase {
|
|
|
2131
2197
|
return result;
|
|
2132
2198
|
}
|
|
2133
2199
|
|
|
2200
|
+
@FieldResolver(() => [AIPromptRun_])
|
|
2201
|
+
async MJ_AIPromptRuns_ConfigurationIDArray(@Root() aiconfiguration_: AIConfiguration_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
2202
|
+
this.CheckUserReadPermissions('MJ: AI Prompt Runs', userPayload);
|
|
2203
|
+
const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
|
|
2204
|
+
const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
2205
|
+
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIPromptRuns] WHERE [ConfigurationID]='${aiconfiguration_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Prompt Runs', userPayload, EntityPermissionType.Read, 'AND');
|
|
2206
|
+
const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
|
|
2207
|
+
const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Prompt Runs', rows);
|
|
2208
|
+
return result;
|
|
2209
|
+
}
|
|
2210
|
+
|
|
2211
|
+
@FieldResolver(() => [AIAgentRun_])
|
|
2212
|
+
async MJ_AIAgentRuns_ConfigurationIDArray(@Root() aiconfiguration_: AIConfiguration_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
2213
|
+
this.CheckUserReadPermissions('MJ: AI Agent Runs', userPayload);
|
|
2214
|
+
const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
|
|
2215
|
+
const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
2216
|
+
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentRuns] WHERE [ConfigurationID]='${aiconfiguration_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Runs', userPayload, EntityPermissionType.Read, 'AND');
|
|
2217
|
+
const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
|
|
2218
|
+
const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Runs', rows);
|
|
2219
|
+
return result;
|
|
2220
|
+
}
|
|
2221
|
+
|
|
2134
2222
|
@Mutation(() => AIConfiguration_)
|
|
2135
2223
|
async CreateAIConfiguration(
|
|
2136
2224
|
@Arg('input', () => CreateAIConfigurationInput) input: CreateAIConfigurationInput,
|
|
@@ -4610,12 +4698,12 @@ export class AIPrompt_ {
|
|
|
4610
4698
|
@Field(() => [AIPrompt_])
|
|
4611
4699
|
AIPrompts_ResultSelectorPromptIDArray: AIPrompt_[]; // Link to AIPrompts
|
|
4612
4700
|
|
|
4613
|
-
@Field(() => [AIAgentPrompt_])
|
|
4614
|
-
MJ_AIAgentPrompts_PromptIDArray: AIAgentPrompt_[]; // Link to MJ_AIAgentPrompts
|
|
4615
|
-
|
|
4616
4701
|
@Field(() => [AIPromptModel_])
|
|
4617
4702
|
MJ_AIPromptModels_PromptIDArray: AIPromptModel_[]; // Link to MJ_AIPromptModels
|
|
4618
4703
|
|
|
4704
|
+
@Field(() => [AIAgentPrompt_])
|
|
4705
|
+
MJ_AIAgentPrompts_PromptIDArray: AIAgentPrompt_[]; // Link to MJ_AIAgentPrompts
|
|
4706
|
+
|
|
4619
4707
|
@Field(() => [AIAgentStep_])
|
|
4620
4708
|
MJ_AIAgentSteps_PromptIDArray: AIAgentStep_[]; // Link to MJ_AIAgentSteps
|
|
4621
4709
|
|
|
@@ -5044,25 +5132,25 @@ export class AIPromptResolver extends ResolverBase {
|
|
|
5044
5132
|
return result;
|
|
5045
5133
|
}
|
|
5046
5134
|
|
|
5047
|
-
@FieldResolver(() => [
|
|
5048
|
-
async
|
|
5049
|
-
this.CheckUserReadPermissions('MJ: AI
|
|
5135
|
+
@FieldResolver(() => [AIPromptModel_])
|
|
5136
|
+
async MJ_AIPromptModels_PromptIDArray(@Root() aiprompt_: AIPrompt_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
5137
|
+
this.CheckUserReadPermissions('MJ: AI Prompt Models', userPayload);
|
|
5050
5138
|
const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
|
|
5051
5139
|
const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
5052
|
-
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[
|
|
5140
|
+
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIPromptModels] WHERE [PromptID]='${aiprompt_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Prompt Models', userPayload, EntityPermissionType.Read, 'AND');
|
|
5053
5141
|
const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
|
|
5054
|
-
const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI
|
|
5142
|
+
const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Prompt Models', rows);
|
|
5055
5143
|
return result;
|
|
5056
5144
|
}
|
|
5057
5145
|
|
|
5058
|
-
@FieldResolver(() => [
|
|
5059
|
-
async
|
|
5060
|
-
this.CheckUserReadPermissions('MJ: AI
|
|
5146
|
+
@FieldResolver(() => [AIAgentPrompt_])
|
|
5147
|
+
async MJ_AIAgentPrompts_PromptIDArray(@Root() aiprompt_: AIPrompt_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
5148
|
+
this.CheckUserReadPermissions('MJ: AI Agent Prompts', userPayload);
|
|
5061
5149
|
const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
|
|
5062
5150
|
const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
5063
|
-
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[
|
|
5151
|
+
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentPrompts] WHERE [PromptID]='${aiprompt_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Prompts', userPayload, EntityPermissionType.Read, 'AND');
|
|
5064
5152
|
const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
|
|
5065
|
-
const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI
|
|
5153
|
+
const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Prompts', rows);
|
|
5066
5154
|
return result;
|
|
5067
5155
|
}
|
|
5068
5156
|
|
|
@@ -10044,12 +10132,12 @@ export class User_ {
|
|
|
10044
10132
|
@Field(() => [ReportUserState_])
|
|
10045
10133
|
MJ_ReportUserStates_UserIDArray: ReportUserState_[]; // Link to MJ_ReportUserStates
|
|
10046
10134
|
|
|
10047
|
-
@Field(() => [DashboardUserPreference_])
|
|
10048
|
-
MJ_DashboardUserPreferences_UserIDArray: DashboardUserPreference_[]; // Link to MJ_DashboardUserPreferences
|
|
10049
|
-
|
|
10050
10135
|
@Field(() => [DashboardUserState_])
|
|
10051
10136
|
MJ_DashboardUserStates_UserIDArray: DashboardUserState_[]; // Link to MJ_DashboardUserStates
|
|
10052
10137
|
|
|
10138
|
+
@Field(() => [DashboardUserPreference_])
|
|
10139
|
+
MJ_DashboardUserPreferences_UserIDArray: DashboardUserPreference_[]; // Link to MJ_DashboardUserPreferences
|
|
10140
|
+
|
|
10053
10141
|
@Field(() => [ResourcePermission_])
|
|
10054
10142
|
ResourcePermissions_UserIDArray: ResourcePermission_[]; // Link to ResourcePermissions
|
|
10055
10143
|
|
|
@@ -10617,25 +10705,25 @@ export class UserResolverBase extends ResolverBase {
|
|
|
10617
10705
|
return result;
|
|
10618
10706
|
}
|
|
10619
10707
|
|
|
10620
|
-
@FieldResolver(() => [
|
|
10621
|
-
async
|
|
10622
|
-
this.CheckUserReadPermissions('MJ: Dashboard User
|
|
10708
|
+
@FieldResolver(() => [DashboardUserState_])
|
|
10709
|
+
async MJ_DashboardUserStates_UserIDArray(@Root() user_: User_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
10710
|
+
this.CheckUserReadPermissions('MJ: Dashboard User States', userPayload);
|
|
10623
10711
|
const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
|
|
10624
10712
|
const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
10625
|
-
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[
|
|
10713
|
+
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwDashboardUserStates] WHERE [UserID]='${user_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Dashboard User States', userPayload, EntityPermissionType.Read, 'AND');
|
|
10626
10714
|
const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
|
|
10627
|
-
const result = this.ArrayMapFieldNamesToCodeNames('MJ: Dashboard User
|
|
10715
|
+
const result = this.ArrayMapFieldNamesToCodeNames('MJ: Dashboard User States', rows);
|
|
10628
10716
|
return result;
|
|
10629
10717
|
}
|
|
10630
10718
|
|
|
10631
|
-
@FieldResolver(() => [
|
|
10632
|
-
async
|
|
10633
|
-
this.CheckUserReadPermissions('MJ: Dashboard User
|
|
10719
|
+
@FieldResolver(() => [DashboardUserPreference_])
|
|
10720
|
+
async MJ_DashboardUserPreferences_UserIDArray(@Root() user_: User_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
10721
|
+
this.CheckUserReadPermissions('MJ: Dashboard User Preferences', userPayload);
|
|
10634
10722
|
const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
|
|
10635
10723
|
const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
10636
|
-
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[
|
|
10724
|
+
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwDashboardUserPreferences] WHERE [UserID]='${user_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Dashboard User Preferences', userPayload, EntityPermissionType.Read, 'AND');
|
|
10637
10725
|
const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
|
|
10638
|
-
const result = this.ArrayMapFieldNamesToCodeNames('MJ: Dashboard User
|
|
10726
|
+
const result = this.ArrayMapFieldNamesToCodeNames('MJ: Dashboard User Preferences', rows);
|
|
10639
10727
|
return result;
|
|
10640
10728
|
}
|
|
10641
10729
|
|
|
@@ -16769,6 +16857,9 @@ export class AIModel_ {
|
|
|
16769
16857
|
@Field(() => [AIPromptRun_])
|
|
16770
16858
|
MJ_AIPromptRuns_ModelIDArray: AIPromptRun_[]; // Link to MJ_AIPromptRuns
|
|
16771
16859
|
|
|
16860
|
+
@Field(() => [AIAgentRun_])
|
|
16861
|
+
MJ_AIAgentRuns_OverrideModelIDArray: AIAgentRun_[]; // Link to MJ_AIAgentRuns
|
|
16862
|
+
|
|
16772
16863
|
}
|
|
16773
16864
|
|
|
16774
16865
|
//****************************************************************************
|
|
@@ -17053,6 +17144,17 @@ export class AIModelResolver extends ResolverBase {
|
|
|
17053
17144
|
return result;
|
|
17054
17145
|
}
|
|
17055
17146
|
|
|
17147
|
+
@FieldResolver(() => [AIAgentRun_])
|
|
17148
|
+
async MJ_AIAgentRuns_OverrideModelIDArray(@Root() aimodel_: AIModel_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
17149
|
+
this.CheckUserReadPermissions('MJ: AI Agent Runs', userPayload);
|
|
17150
|
+
const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
|
|
17151
|
+
const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
17152
|
+
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentRuns] WHERE [OverrideModelID]='${aimodel_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Runs', userPayload, EntityPermissionType.Read, 'AND');
|
|
17153
|
+
const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
|
|
17154
|
+
const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Runs', rows);
|
|
17155
|
+
return result;
|
|
17156
|
+
}
|
|
17157
|
+
|
|
17056
17158
|
@Mutation(() => AIModel_)
|
|
17057
17159
|
async CreateAIModel(
|
|
17058
17160
|
@Arg('input', () => CreateAIModelInput) input: CreateAIModelInput,
|
|
@@ -41001,6 +41103,22 @@ export class AIPromptRun_ {
|
|
|
41001
41103
|
@Field({nullable: true, description: `Detailed error information in JSON format if the prompt execution failed, including stack traces and error codes`})
|
|
41002
41104
|
ErrorDetails?: string;
|
|
41003
41105
|
|
|
41106
|
+
@Field({nullable: true, description: `References the specific child prompt that was executed as part of hierarchical prompt composition. NULL for regular prompts or parent prompts that don't directly execute a child.`})
|
|
41107
|
+
@MaxLength(16)
|
|
41108
|
+
ChildPromptID?: string;
|
|
41109
|
+
|
|
41110
|
+
@Field(() => Int, {nullable: true, description: `Queue time in milliseconds before the model started processing the request. Provider-specific timing metric.`})
|
|
41111
|
+
QueueTime?: number;
|
|
41112
|
+
|
|
41113
|
+
@Field(() => Int, {nullable: true, description: `Time in milliseconds for the model to ingest and process the prompt. Provider-specific timing metric.`})
|
|
41114
|
+
PromptTime?: number;
|
|
41115
|
+
|
|
41116
|
+
@Field(() => Int, {nullable: true, description: `Time in milliseconds for the model to generate the completion/response tokens. Provider-specific timing metric.`})
|
|
41117
|
+
CompletionTime?: number;
|
|
41118
|
+
|
|
41119
|
+
@Field({nullable: true, description: `JSON field containing provider-specific response metadata and details not captured in standard fields. Structure varies by AI provider.`})
|
|
41120
|
+
ModelSpecificResponseDetails?: string;
|
|
41121
|
+
|
|
41004
41122
|
@Field()
|
|
41005
41123
|
@MaxLength(510)
|
|
41006
41124
|
Prompt: string;
|
|
@@ -41029,6 +41147,10 @@ export class AIPromptRun_ {
|
|
|
41029
41147
|
@MaxLength(510)
|
|
41030
41148
|
Judge?: string;
|
|
41031
41149
|
|
|
41150
|
+
@Field({nullable: true})
|
|
41151
|
+
@MaxLength(510)
|
|
41152
|
+
ChildPrompt?: string;
|
|
41153
|
+
|
|
41032
41154
|
@Field(() => [AIPromptRun_])
|
|
41033
41155
|
MJ_AIPromptRuns_ParentIDArray: AIPromptRun_[]; // Link to MJ_AIPromptRuns
|
|
41034
41156
|
|
|
@@ -41260,6 +41382,21 @@ export class CreateAIPromptRunInput {
|
|
|
41260
41382
|
|
|
41261
41383
|
@Field({ nullable: true })
|
|
41262
41384
|
ErrorDetails: string | null;
|
|
41385
|
+
|
|
41386
|
+
@Field({ nullable: true })
|
|
41387
|
+
ChildPromptID: string | null;
|
|
41388
|
+
|
|
41389
|
+
@Field(() => Int, { nullable: true })
|
|
41390
|
+
QueueTime: number | null;
|
|
41391
|
+
|
|
41392
|
+
@Field(() => Int, { nullable: true })
|
|
41393
|
+
PromptTime: number | null;
|
|
41394
|
+
|
|
41395
|
+
@Field(() => Int, { nullable: true })
|
|
41396
|
+
CompletionTime: number | null;
|
|
41397
|
+
|
|
41398
|
+
@Field({ nullable: true })
|
|
41399
|
+
ModelSpecificResponseDetails: string | null;
|
|
41263
41400
|
}
|
|
41264
41401
|
|
|
41265
41402
|
|
|
@@ -41487,6 +41624,21 @@ export class UpdateAIPromptRunInput {
|
|
|
41487
41624
|
@Field({ nullable: true })
|
|
41488
41625
|
ErrorDetails?: string | null;
|
|
41489
41626
|
|
|
41627
|
+
@Field({ nullable: true })
|
|
41628
|
+
ChildPromptID?: string | null;
|
|
41629
|
+
|
|
41630
|
+
@Field(() => Int, { nullable: true })
|
|
41631
|
+
QueueTime?: number | null;
|
|
41632
|
+
|
|
41633
|
+
@Field(() => Int, { nullable: true })
|
|
41634
|
+
PromptTime?: number | null;
|
|
41635
|
+
|
|
41636
|
+
@Field(() => Int, { nullable: true })
|
|
41637
|
+
CompletionTime?: number | null;
|
|
41638
|
+
|
|
41639
|
+
@Field({ nullable: true })
|
|
41640
|
+
ModelSpecificResponseDetails?: string | null;
|
|
41641
|
+
|
|
41490
41642
|
@Field(() => [KeyValuePairInput], { nullable: true })
|
|
41491
41643
|
OldValues___?: KeyValuePairInput[];
|
|
41492
41644
|
}
|