@memberjunction/server 2.108.0 → 2.109.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/agents/skip-agent.d.ts.map +1 -1
- package/dist/agents/skip-agent.js +6 -13
- package/dist/agents/skip-agent.js.map +1 -1
- package/dist/generated/generated.d.ts +152 -2
- package/dist/generated/generated.d.ts.map +1 -1
- package/dist/generated/generated.js +932 -17
- package/dist/generated/generated.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +35 -34
- package/src/agents/skip-agent.ts +37 -47
- package/src/generated/generated.ts +591 -14
- package/src/index.ts +4 -0
|
@@ -19,7 +19,7 @@ import { mj_core_schema } from '../config.js';
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
import { ScheduledActionEntity, ScheduledActionParamEntity, ExplorerNavigationItemEntity, GeneratedCodeCategoryEntity, AIAgentModelEntity, ComponentRegistryEntity, AIAgentNoteTypeEntity, ComponentDependencyEntity, AIAgentRunEntity, AIVendorEntity, TaskTypeEntity, AIConfigurationEntity, AIAgentEntity, AIAgentStepEntity, AIModelCostEntity, AIPromptModelEntity, AIAgentTypeEntity, AIAgentNoteEntity, EnvironmentEntity, AIAgentActionEntity, TaskDependencyEntity, CollectionArtifactEntity, AIModelPriceTypeEntity, CollectionEntity, RecordLinkEntity, AIPromptEntity, AIResultCacheEntity, AIPromptCategoryEntity, AIPromptTypeEntity, CompanyEntity, EmployeeEntity, UserFavoriteEntity, EmployeeCompanyIntegrationEntity, EmployeeRoleEntity, EmployeeSkillEntity, RoleEntity, SkillEntity, IntegrationURLFormatEntity, IntegrationEntity, CompanyIntegrationEntity, EntityFieldEntity, EntityEntity, UserEntity, EntityRelationshipEntity, UserRecordLogEntity, UserViewEntity, CompanyIntegrationRunEntity, CompanyIntegrationRunDetailEntity, ErrorLogEntity, ApplicationEntity, ApplicationEntityEntity, EntityPermissionEntity, UserApplicationEntityEntity, UserApplicationEntity, CompanyIntegrationRunAPILogEntity, ListEntity, ListDetailEntity, UserViewRunEntity, UserViewRunDetailEntity, WorkflowRunEntity, WorkflowEntity, WorkflowEngineEntity, RecordChangeEntity, UserRoleEntity, RowLevelSecurityFilterEntity, AuditLogEntity, AuthorizationEntity, AuthorizationRoleEntity, AuditLogTypeEntity, EntityFieldValueEntity, AIModelEntity, AIActionEntity, AIModelActionEntity, EntityAIActionEntity, AIModelTypeEntity, QueueTypeEntity, QueueEntity, QueueTaskEntity, DashboardEntity, OutputTriggerTypeEntity, OutputFormatTypeEntity, OutputDeliveryTypeEntity, ReportEntity, ReportSnapshotEntity, ResourceTypeEntity, TagEntity, TaggedItemEntity, WorkspaceEntity, WorkspaceItemEntity, DatasetEntity, DatasetItemEntity, ConversationDetailEntity, ConversationEntity, UserNotificationEntity, SchemaInfoEntity, CompanyIntegrationRecordMapEntity, RecordMergeLogEntity, RecordMergeDeletionLogEntity, QueryFieldEntity, QueryCategoryEntity, QueryEntity, QueryPermissionEntity, VectorIndexEntity, EntityDocumentTypeEntity, EntityDocumentRunEntity, VectorDatabaseEntity, EntityRecordDocumentEntity, EntityDocumentEntity, DataContextItemEntity, DataContextEntity, UserViewCategoryEntity, DashboardCategoryEntity, ReportCategoryEntity, FileStorageProviderEntity, FileEntity, FileCategoryEntity, FileEntityRecordLinkEntity, VersionInstallationEntity, DuplicateRunDetailMatchEntity, EntityDocumentSettingEntity, EntitySettingEntity, DuplicateRunEntity, DuplicateRunDetailEntity, ApplicationSettingEntity, ActionCategoryEntity, EntityActionEntity, EntityActionInvocationEntity, ActionAuthorizationEntity, EntityActionInvocationTypeEntity, ActionEntity, EntityActionFilterEntity, ActionFilterEntity, ActionContextTypeEntity, ActionResultCodeEntity, ActionContextEntity, ActionExecutionLogEntity, ActionParamEntity, ActionLibraryEntity, LibraryEntity, ListCategoryEntity, CommunicationProviderEntity, CommunicationRunEntity, CommunicationProviderMessageTypeEntity, CommunicationLogEntity, CommunicationBaseMessageTypeEntity, TemplateEntity, TemplateCategoryEntity, TemplateContentEntity, TemplateParamEntity, TemplateContentTypeEntity, RecommendationEntity, RecommendationProviderEntity, RecommendationRunEntity, RecommendationItemEntity, EntityCommunicationMessageTypeEntity, EntityCommunicationFieldEntity, RecordChangeReplayRunEntity, LibraryItemEntity, EntityRelationshipDisplayComponentEntity, EntityActionParamEntity, ResourcePermissionEntity, ResourceLinkEntity, AIAgentArtifactTypeEntity, ConversationArtifactVersionEntity, AIAgentRequestEntity, AIModelVendorEntity, AIVendorTypeDefinitionEntity, ReportUserStateEntity, QueryEntityEntity, ScheduledJobRunEntity, DashboardUserStateEntity, ComponentEntity, AccessControlRuleEntity, PublicLinkEntity, ArtifactTypeEntity, AIVendorTypeEntity, ArtifactEntity, ConversationArtifactEntity, CollectionPermissionEntity, AIAgentPromptEntity, ComponentLibraryEntity, ScheduledJobTypeEntity, DashboardUserPreferenceEntity, QueryParameterEntity, AIAgentPermissionEntity, AIAgentRelationshipEntity, ComponentLibraryLinkEntity, ContentProcessRunEntity, ContentSourceEntity, ContentSourceParamEntity, ContentSourceTypeEntity, ContentSourceTypeParamEntity, ContentTypeEntity, ContentTypeAttributeEntity, ContentFileTypeEntity, ContentItemEntity, ContentItemAttributeEntity, ContentItemTagEntity, GeneratedCodeEntity, ScheduledJobEntity, AIPromptRunEntity, AIAgentRunStepEntity, ConversationDetailArtifactEntity, TaskEntity, ProjectEntity, ConversationArtifactPermissionEntity, AIModelPriceUnitTypeEntity, ArtifactVersionEntity, AIAgentStepPathEntity, AIAgentLearningCycleEntity, ReportVersionEntity, AIConfigurationParamEntity, ArtifactVersionAttributeEntity } from '@memberjunction/core-entities';
|
|
22
|
+
import { ScheduledActionEntity, ScheduledActionParamEntity, ExplorerNavigationItemEntity, GeneratedCodeCategoryEntity, AIAgentModelEntity, ComponentRegistryEntity, AIAgentNoteTypeEntity, ComponentDependencyEntity, AIAgentRunEntity, AIVendorEntity, TaskTypeEntity, AIConfigurationEntity, AIAgentEntity, AIAgentStepEntity, AIModelCostEntity, AIPromptModelEntity, AIAgentTypeEntity, AIAgentNoteEntity, EnvironmentEntity, ArtifactPermissionEntity, AIAgentActionEntity, TaskDependencyEntity, CollectionArtifactEntity, AIModelPriceTypeEntity, CollectionEntity, RecordLinkEntity, AIPromptEntity, AIResultCacheEntity, AIPromptCategoryEntity, AIPromptTypeEntity, CompanyEntity, EmployeeEntity, UserFavoriteEntity, EmployeeCompanyIntegrationEntity, EmployeeRoleEntity, EmployeeSkillEntity, RoleEntity, SkillEntity, IntegrationURLFormatEntity, IntegrationEntity, CompanyIntegrationEntity, EntityFieldEntity, EntityEntity, UserEntity, EntityRelationshipEntity, UserRecordLogEntity, UserViewEntity, CompanyIntegrationRunEntity, CompanyIntegrationRunDetailEntity, ErrorLogEntity, ApplicationEntity, ApplicationEntityEntity, EntityPermissionEntity, UserApplicationEntityEntity, UserApplicationEntity, CompanyIntegrationRunAPILogEntity, ListEntity, ListDetailEntity, UserViewRunEntity, UserViewRunDetailEntity, WorkflowRunEntity, WorkflowEntity, WorkflowEngineEntity, RecordChangeEntity, UserRoleEntity, RowLevelSecurityFilterEntity, AuditLogEntity, AuthorizationEntity, AuthorizationRoleEntity, AuditLogTypeEntity, EntityFieldValueEntity, AIModelEntity, AIActionEntity, AIModelActionEntity, EntityAIActionEntity, AIModelTypeEntity, QueueTypeEntity, QueueEntity, QueueTaskEntity, DashboardEntity, OutputTriggerTypeEntity, OutputFormatTypeEntity, OutputDeliveryTypeEntity, ReportEntity, ReportSnapshotEntity, ResourceTypeEntity, TagEntity, TaggedItemEntity, WorkspaceEntity, WorkspaceItemEntity, DatasetEntity, DatasetItemEntity, ConversationDetailEntity, ConversationEntity, UserNotificationEntity, SchemaInfoEntity, CompanyIntegrationRecordMapEntity, RecordMergeLogEntity, RecordMergeDeletionLogEntity, QueryFieldEntity, QueryCategoryEntity, QueryEntity, QueryPermissionEntity, VectorIndexEntity, EntityDocumentTypeEntity, EntityDocumentRunEntity, VectorDatabaseEntity, EntityRecordDocumentEntity, EntityDocumentEntity, DataContextItemEntity, DataContextEntity, UserViewCategoryEntity, DashboardCategoryEntity, ReportCategoryEntity, FileStorageProviderEntity, FileEntity, FileCategoryEntity, FileEntityRecordLinkEntity, VersionInstallationEntity, DuplicateRunDetailMatchEntity, EntityDocumentSettingEntity, EntitySettingEntity, DuplicateRunEntity, DuplicateRunDetailEntity, ApplicationSettingEntity, ActionCategoryEntity, EntityActionEntity, EntityActionInvocationEntity, ActionAuthorizationEntity, EntityActionInvocationTypeEntity, ActionEntity, EntityActionFilterEntity, ActionFilterEntity, ActionContextTypeEntity, ActionResultCodeEntity, ActionContextEntity, ActionExecutionLogEntity, ActionParamEntity, ActionLibraryEntity, LibraryEntity, ListCategoryEntity, CommunicationProviderEntity, CommunicationRunEntity, CommunicationProviderMessageTypeEntity, CommunicationLogEntity, CommunicationBaseMessageTypeEntity, TemplateEntity, TemplateCategoryEntity, TemplateContentEntity, TemplateParamEntity, TemplateContentTypeEntity, RecommendationEntity, RecommendationProviderEntity, RecommendationRunEntity, RecommendationItemEntity, EntityCommunicationMessageTypeEntity, EntityCommunicationFieldEntity, RecordChangeReplayRunEntity, LibraryItemEntity, EntityRelationshipDisplayComponentEntity, EntityActionParamEntity, ResourcePermissionEntity, ResourceLinkEntity, AIAgentArtifactTypeEntity, ConversationArtifactVersionEntity, AIAgentRequestEntity, AIModelVendorEntity, AIVendorTypeDefinitionEntity, ReportUserStateEntity, QueryEntityEntity, ScheduledJobRunEntity, DashboardUserStateEntity, ComponentEntity, AccessControlRuleEntity, PublicLinkEntity, ArtifactTypeEntity, AIVendorTypeEntity, ArtifactEntity, ConversationArtifactEntity, CollectionPermissionEntity, AIAgentPromptEntity, ComponentLibraryEntity, ScheduledJobTypeEntity, DashboardUserPreferenceEntity, QueryParameterEntity, AIAgentPermissionEntity, AIAgentRelationshipEntity, ComponentLibraryLinkEntity, ContentProcessRunEntity, ContentSourceEntity, ContentSourceParamEntity, ContentSourceTypeEntity, ContentSourceTypeParamEntity, ContentTypeEntity, ContentTypeAttributeEntity, ContentFileTypeEntity, ContentItemEntity, ContentItemAttributeEntity, ContentItemTagEntity, GeneratedCodeEntity, ScheduledJobEntity, AIPromptRunEntity, AIAgentRunStepEntity, ConversationDetailArtifactEntity, TaskEntity, ProjectEntity, ConversationArtifactPermissionEntity, AIModelPriceUnitTypeEntity, ArtifactVersionEntity, AIAgentStepPathEntity, AIAgentLearningCycleEntity, ReportVersionEntity, AIConfigurationParamEntity, ArtifactVersionAttributeEntity, AIAgentDataSourceEntity } from '@memberjunction/core-entities';
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
//****************************************************************************
|
|
@@ -3015,6 +3015,9 @@ if this limit is exceeded.`})
|
|
|
3015
3015
|
@Field(() => [MJAIAgentPermission_])
|
|
3016
3016
|
MJ_AIAgentPermissions_AgentIDArray: MJAIAgentPermission_[]; // Link to MJ_AIAgentPermissions
|
|
3017
3017
|
|
|
3018
|
+
@Field(() => [MJAIAgentDataSource_])
|
|
3019
|
+
MJ_AIAgentDataSources_AgentIDArray: MJAIAgentDataSource_[]; // Link to MJ_AIAgentDataSources
|
|
3020
|
+
|
|
3018
3021
|
@Field(() => [MJAIAgentNote_])
|
|
3019
3022
|
AIAgentNotes_AgentIDArray: MJAIAgentNote_[]; // Link to AIAgentNotes
|
|
3020
3023
|
|
|
@@ -3437,6 +3440,17 @@ export class MJAIAgentResolver extends ResolverBase {
|
|
|
3437
3440
|
return result;
|
|
3438
3441
|
}
|
|
3439
3442
|
|
|
3443
|
+
@FieldResolver(() => [MJAIAgentDataSource_])
|
|
3444
|
+
async MJ_AIAgentDataSources_AgentIDArray(@Root() mjaiagent_: MJAIAgent_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3445
|
+
this.CheckUserReadPermissions('MJ: AI Agent Data Sources', userPayload);
|
|
3446
|
+
const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
|
|
3447
|
+
const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
3448
|
+
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentDataSources] WHERE [AgentID]='${mjaiagent_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Data Sources', userPayload, EntityPermissionType.Read, 'AND');
|
|
3449
|
+
const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
|
|
3450
|
+
const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Data Sources', rows);
|
|
3451
|
+
return result;
|
|
3452
|
+
}
|
|
3453
|
+
|
|
3440
3454
|
@FieldResolver(() => [MJAIAgentNote_])
|
|
3441
3455
|
async AIAgentNotes_AgentIDArray(@Root() mjaiagent_: MJAIAgent_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3442
3456
|
this.CheckUserReadPermissions('AI Agent Notes', userPayload);
|
|
@@ -5114,6 +5128,212 @@ export class MJEnvironmentResolver extends ResolverBase {
|
|
|
5114
5128
|
|
|
5115
5129
|
}
|
|
5116
5130
|
|
|
5131
|
+
//****************************************************************************
|
|
5132
|
+
// ENTITY CLASS for MJ: Artifact Permissions
|
|
5133
|
+
//****************************************************************************
|
|
5134
|
+
@ObjectType({ description: `Manages user permissions for artifacts with granular access control (Read, Edit, Delete, Share)` })
|
|
5135
|
+
export class MJArtifactPermission_ {
|
|
5136
|
+
@Field()
|
|
5137
|
+
@MaxLength(16)
|
|
5138
|
+
ID: string;
|
|
5139
|
+
|
|
5140
|
+
@Field()
|
|
5141
|
+
@MaxLength(16)
|
|
5142
|
+
ArtifactID: string;
|
|
5143
|
+
|
|
5144
|
+
@Field()
|
|
5145
|
+
@MaxLength(16)
|
|
5146
|
+
UserID: string;
|
|
5147
|
+
|
|
5148
|
+
@Field(() => Boolean, {description: `Whether the user can view/read the artifact`})
|
|
5149
|
+
CanRead: boolean;
|
|
5150
|
+
|
|
5151
|
+
@Field(() => Boolean, {description: `Whether the user can modify the artifact or create new versions`})
|
|
5152
|
+
CanEdit: boolean;
|
|
5153
|
+
|
|
5154
|
+
@Field(() => Boolean, {description: `Whether the user can delete the artifact`})
|
|
5155
|
+
CanDelete: boolean;
|
|
5156
|
+
|
|
5157
|
+
@Field(() => Boolean, {description: `Whether the user can share the artifact with other users`})
|
|
5158
|
+
CanShare: boolean;
|
|
5159
|
+
|
|
5160
|
+
@Field({nullable: true, description: `Foreign key to the User who shared this artifact (if shared)`})
|
|
5161
|
+
@MaxLength(16)
|
|
5162
|
+
SharedByUserID?: string;
|
|
5163
|
+
|
|
5164
|
+
@Field()
|
|
5165
|
+
@MaxLength(10)
|
|
5166
|
+
_mj__CreatedAt: Date;
|
|
5167
|
+
|
|
5168
|
+
@Field()
|
|
5169
|
+
@MaxLength(10)
|
|
5170
|
+
_mj__UpdatedAt: Date;
|
|
5171
|
+
|
|
5172
|
+
@Field()
|
|
5173
|
+
@MaxLength(510)
|
|
5174
|
+
Artifact: string;
|
|
5175
|
+
|
|
5176
|
+
@Field()
|
|
5177
|
+
@MaxLength(200)
|
|
5178
|
+
User: string;
|
|
5179
|
+
|
|
5180
|
+
@Field({nullable: true})
|
|
5181
|
+
@MaxLength(200)
|
|
5182
|
+
SharedByUser?: string;
|
|
5183
|
+
|
|
5184
|
+
}
|
|
5185
|
+
|
|
5186
|
+
//****************************************************************************
|
|
5187
|
+
// INPUT TYPE for MJ: Artifact Permissions
|
|
5188
|
+
//****************************************************************************
|
|
5189
|
+
@InputType()
|
|
5190
|
+
export class CreateMJArtifactPermissionInput {
|
|
5191
|
+
@Field({ nullable: true })
|
|
5192
|
+
ID?: string;
|
|
5193
|
+
|
|
5194
|
+
@Field({ nullable: true })
|
|
5195
|
+
ArtifactID?: string;
|
|
5196
|
+
|
|
5197
|
+
@Field({ nullable: true })
|
|
5198
|
+
UserID?: string;
|
|
5199
|
+
|
|
5200
|
+
@Field(() => Boolean, { nullable: true })
|
|
5201
|
+
CanRead?: boolean;
|
|
5202
|
+
|
|
5203
|
+
@Field(() => Boolean, { nullable: true })
|
|
5204
|
+
CanEdit?: boolean;
|
|
5205
|
+
|
|
5206
|
+
@Field(() => Boolean, { nullable: true })
|
|
5207
|
+
CanDelete?: boolean;
|
|
5208
|
+
|
|
5209
|
+
@Field(() => Boolean, { nullable: true })
|
|
5210
|
+
CanShare?: boolean;
|
|
5211
|
+
|
|
5212
|
+
@Field({ nullable: true })
|
|
5213
|
+
SharedByUserID: string | null;
|
|
5214
|
+
}
|
|
5215
|
+
|
|
5216
|
+
|
|
5217
|
+
//****************************************************************************
|
|
5218
|
+
// INPUT TYPE for MJ: Artifact Permissions
|
|
5219
|
+
//****************************************************************************
|
|
5220
|
+
@InputType()
|
|
5221
|
+
export class UpdateMJArtifactPermissionInput {
|
|
5222
|
+
@Field()
|
|
5223
|
+
ID: string;
|
|
5224
|
+
|
|
5225
|
+
@Field({ nullable: true })
|
|
5226
|
+
ArtifactID?: string;
|
|
5227
|
+
|
|
5228
|
+
@Field({ nullable: true })
|
|
5229
|
+
UserID?: string;
|
|
5230
|
+
|
|
5231
|
+
@Field(() => Boolean, { nullable: true })
|
|
5232
|
+
CanRead?: boolean;
|
|
5233
|
+
|
|
5234
|
+
@Field(() => Boolean, { nullable: true })
|
|
5235
|
+
CanEdit?: boolean;
|
|
5236
|
+
|
|
5237
|
+
@Field(() => Boolean, { nullable: true })
|
|
5238
|
+
CanDelete?: boolean;
|
|
5239
|
+
|
|
5240
|
+
@Field(() => Boolean, { nullable: true })
|
|
5241
|
+
CanShare?: boolean;
|
|
5242
|
+
|
|
5243
|
+
@Field({ nullable: true })
|
|
5244
|
+
SharedByUserID?: string | null;
|
|
5245
|
+
|
|
5246
|
+
@Field(() => [KeyValuePairInput], { nullable: true })
|
|
5247
|
+
OldValues___?: KeyValuePairInput[];
|
|
5248
|
+
}
|
|
5249
|
+
|
|
5250
|
+
//****************************************************************************
|
|
5251
|
+
// RESOLVER for MJ: Artifact Permissions
|
|
5252
|
+
//****************************************************************************
|
|
5253
|
+
@ObjectType()
|
|
5254
|
+
export class RunMJArtifactPermissionViewResult {
|
|
5255
|
+
@Field(() => [MJArtifactPermission_])
|
|
5256
|
+
Results: MJArtifactPermission_[];
|
|
5257
|
+
|
|
5258
|
+
@Field(() => String, {nullable: true})
|
|
5259
|
+
UserViewRunID?: string;
|
|
5260
|
+
|
|
5261
|
+
@Field(() => Int, {nullable: true})
|
|
5262
|
+
RowCount: number;
|
|
5263
|
+
|
|
5264
|
+
@Field(() => Int, {nullable: true})
|
|
5265
|
+
TotalRowCount: number;
|
|
5266
|
+
|
|
5267
|
+
@Field(() => Int, {nullable: true})
|
|
5268
|
+
ExecutionTime: number;
|
|
5269
|
+
|
|
5270
|
+
@Field({nullable: true})
|
|
5271
|
+
ErrorMessage?: string;
|
|
5272
|
+
|
|
5273
|
+
@Field(() => Boolean, {nullable: false})
|
|
5274
|
+
Success: boolean;
|
|
5275
|
+
}
|
|
5276
|
+
|
|
5277
|
+
@Resolver(MJArtifactPermission_)
|
|
5278
|
+
export class MJArtifactPermissionResolver extends ResolverBase {
|
|
5279
|
+
@Query(() => RunMJArtifactPermissionViewResult)
|
|
5280
|
+
async RunMJArtifactPermissionViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
5281
|
+
const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
|
|
5282
|
+
return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
|
|
5283
|
+
}
|
|
5284
|
+
|
|
5285
|
+
@Query(() => RunMJArtifactPermissionViewResult)
|
|
5286
|
+
async RunMJArtifactPermissionViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
5287
|
+
const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
|
|
5288
|
+
return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
|
|
5289
|
+
}
|
|
5290
|
+
|
|
5291
|
+
@Query(() => RunMJArtifactPermissionViewResult)
|
|
5292
|
+
async RunMJArtifactPermissionDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
5293
|
+
const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
|
|
5294
|
+
input.EntityName = 'MJ: Artifact Permissions';
|
|
5295
|
+
return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
|
|
5296
|
+
}
|
|
5297
|
+
@Query(() => MJArtifactPermission_, { nullable: true })
|
|
5298
|
+
async MJArtifactPermission(@Arg('ID', () => String) ID: string, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJArtifactPermission_ | null> {
|
|
5299
|
+
this.CheckUserReadPermissions('MJ: Artifact Permissions', userPayload);
|
|
5300
|
+
const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
|
|
5301
|
+
const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
5302
|
+
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwArtifactPermissions] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Artifact Permissions', userPayload, EntityPermissionType.Read, 'AND');
|
|
5303
|
+
const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
|
|
5304
|
+
const result = this.MapFieldNamesToCodeNames('MJ: Artifact Permissions', rows && rows.length > 0 ? rows[0] : {})
|
|
5305
|
+
return result;
|
|
5306
|
+
}
|
|
5307
|
+
|
|
5308
|
+
@Mutation(() => MJArtifactPermission_)
|
|
5309
|
+
async CreateMJArtifactPermission(
|
|
5310
|
+
@Arg('input', () => CreateMJArtifactPermissionInput) input: CreateMJArtifactPermissionInput,
|
|
5311
|
+
@Ctx() { providers, userPayload }: AppContext,
|
|
5312
|
+
@PubSub() pubSub: PubSubEngine
|
|
5313
|
+
) {
|
|
5314
|
+
const provider = GetReadWriteProvider(providers);
|
|
5315
|
+
return this.CreateRecord('MJ: Artifact Permissions', input, provider, userPayload, pubSub)
|
|
5316
|
+
}
|
|
5317
|
+
|
|
5318
|
+
@Mutation(() => MJArtifactPermission_)
|
|
5319
|
+
async UpdateMJArtifactPermission(
|
|
5320
|
+
@Arg('input', () => UpdateMJArtifactPermissionInput) input: UpdateMJArtifactPermissionInput,
|
|
5321
|
+
@Ctx() { providers, userPayload }: AppContext,
|
|
5322
|
+
@PubSub() pubSub: PubSubEngine
|
|
5323
|
+
) {
|
|
5324
|
+
const provider = GetReadWriteProvider(providers);
|
|
5325
|
+
return this.UpdateRecord('MJ: Artifact Permissions', input, provider, userPayload, pubSub);
|
|
5326
|
+
}
|
|
5327
|
+
|
|
5328
|
+
@Mutation(() => MJArtifactPermission_)
|
|
5329
|
+
async DeleteMJArtifactPermission(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
5330
|
+
const provider = GetReadWriteProvider(providers);
|
|
5331
|
+
const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
|
|
5332
|
+
return this.DeleteRecord('MJ: Artifact Permissions', key, options, provider, userPayload, pubSub);
|
|
5333
|
+
}
|
|
5334
|
+
|
|
5335
|
+
}
|
|
5336
|
+
|
|
5117
5337
|
//****************************************************************************
|
|
5118
5338
|
// ENTITY CLASS for AI Agent Actions
|
|
5119
5339
|
//****************************************************************************
|
|
@@ -12092,6 +12312,9 @@ export class MJUser_ {
|
|
|
12092
12312
|
@Field(() => [MJScheduledJob_])
|
|
12093
12313
|
MJ_ScheduledJobs_NotifyUserIDArray: MJScheduledJob_[]; // Link to MJ_ScheduledJobs
|
|
12094
12314
|
|
|
12315
|
+
@Field(() => [MJArtifactPermission_])
|
|
12316
|
+
MJ_ArtifactPermissions_UserIDArray: MJArtifactPermission_[]; // Link to MJ_ArtifactPermissions
|
|
12317
|
+
|
|
12095
12318
|
@Field(() => [MJResourcePermission_])
|
|
12096
12319
|
ResourcePermissions_UserIDArray: MJResourcePermission_[]; // Link to ResourcePermissions
|
|
12097
12320
|
|
|
@@ -12113,18 +12336,21 @@ export class MJUser_ {
|
|
|
12113
12336
|
@Field(() => [MJCollectionPermission_])
|
|
12114
12337
|
MJ_CollectionPermissions_SharedByUserIDArray: MJCollectionPermission_[]; // Link to MJ_CollectionPermissions
|
|
12115
12338
|
|
|
12339
|
+
@Field(() => [MJArtifactPermission_])
|
|
12340
|
+
MJ_ArtifactPermissions_SharedByUserIDArray: MJArtifactPermission_[]; // Link to MJ_ArtifactPermissions
|
|
12341
|
+
|
|
12116
12342
|
@Field(() => [MJAIAgentRun_])
|
|
12117
12343
|
MJ_AIAgentRuns_UserIDArray: MJAIAgentRun_[]; // Link to MJ_AIAgentRuns
|
|
12118
12344
|
|
|
12119
12345
|
@Field(() => [MJAIAgentPermission_])
|
|
12120
12346
|
MJ_AIAgentPermissions_UserIDArray: MJAIAgentPermission_[]; // Link to MJ_AIAgentPermissions
|
|
12121
12347
|
|
|
12122
|
-
@Field(() => [MJCollectionPermission_])
|
|
12123
|
-
MJ_CollectionPermissions_UserIDArray: MJCollectionPermission_[]; // Link to MJ_CollectionPermissions
|
|
12124
|
-
|
|
12125
12348
|
@Field(() => [MJCollection_])
|
|
12126
12349
|
MJ_Collections_OwnerIDArray: MJCollection_[]; // Link to MJ_Collections
|
|
12127
12350
|
|
|
12351
|
+
@Field(() => [MJCollectionPermission_])
|
|
12352
|
+
MJ_CollectionPermissions_UserIDArray: MJCollectionPermission_[]; // Link to MJ_CollectionPermissions
|
|
12353
|
+
|
|
12128
12354
|
@Field(() => [MJTask_])
|
|
12129
12355
|
MJ_Tasks_UserIDArray: MJTask_[]; // Link to MJ_Tasks
|
|
12130
12356
|
|
|
@@ -12752,6 +12978,17 @@ export class MJUserResolverBase extends ResolverBase {
|
|
|
12752
12978
|
return result;
|
|
12753
12979
|
}
|
|
12754
12980
|
|
|
12981
|
+
@FieldResolver(() => [MJArtifactPermission_])
|
|
12982
|
+
async MJ_ArtifactPermissions_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
12983
|
+
this.CheckUserReadPermissions('MJ: Artifact Permissions', userPayload);
|
|
12984
|
+
const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
|
|
12985
|
+
const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
12986
|
+
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwArtifactPermissions] WHERE [UserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Artifact Permissions', userPayload, EntityPermissionType.Read, 'AND');
|
|
12987
|
+
const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
|
|
12988
|
+
const result = this.ArrayMapFieldNamesToCodeNames('MJ: Artifact Permissions', rows);
|
|
12989
|
+
return result;
|
|
12990
|
+
}
|
|
12991
|
+
|
|
12755
12992
|
@FieldResolver(() => [MJResourcePermission_])
|
|
12756
12993
|
async ResourcePermissions_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
12757
12994
|
this.CheckUserReadPermissions('Resource Permissions', userPayload);
|
|
@@ -12829,6 +13066,17 @@ export class MJUserResolverBase extends ResolverBase {
|
|
|
12829
13066
|
return result;
|
|
12830
13067
|
}
|
|
12831
13068
|
|
|
13069
|
+
@FieldResolver(() => [MJArtifactPermission_])
|
|
13070
|
+
async MJ_ArtifactPermissions_SharedByUserIDArray(@Root() mjuser_: MJUser_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
13071
|
+
this.CheckUserReadPermissions('MJ: Artifact Permissions', userPayload);
|
|
13072
|
+
const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
|
|
13073
|
+
const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
13074
|
+
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwArtifactPermissions] WHERE [SharedByUserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Artifact Permissions', userPayload, EntityPermissionType.Read, 'AND');
|
|
13075
|
+
const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
|
|
13076
|
+
const result = this.ArrayMapFieldNamesToCodeNames('MJ: Artifact Permissions', rows);
|
|
13077
|
+
return result;
|
|
13078
|
+
}
|
|
13079
|
+
|
|
12832
13080
|
@FieldResolver(() => [MJAIAgentRun_])
|
|
12833
13081
|
async MJ_AIAgentRuns_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
12834
13082
|
this.CheckUserReadPermissions('MJ: AI Agent Runs', userPayload);
|
|
@@ -12851,25 +13099,25 @@ export class MJUserResolverBase extends ResolverBase {
|
|
|
12851
13099
|
return result;
|
|
12852
13100
|
}
|
|
12853
13101
|
|
|
12854
|
-
@FieldResolver(() => [
|
|
12855
|
-
async
|
|
12856
|
-
this.CheckUserReadPermissions('MJ:
|
|
13102
|
+
@FieldResolver(() => [MJCollection_])
|
|
13103
|
+
async MJ_Collections_OwnerIDArray(@Root() mjuser_: MJUser_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
13104
|
+
this.CheckUserReadPermissions('MJ: Collections', userPayload);
|
|
12857
13105
|
const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
|
|
12858
13106
|
const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
12859
|
-
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[
|
|
13107
|
+
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwCollections] WHERE [OwnerID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Collections', userPayload, EntityPermissionType.Read, 'AND');
|
|
12860
13108
|
const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
|
|
12861
|
-
const result = this.ArrayMapFieldNamesToCodeNames('MJ:
|
|
13109
|
+
const result = this.ArrayMapFieldNamesToCodeNames('MJ: Collections', rows);
|
|
12862
13110
|
return result;
|
|
12863
13111
|
}
|
|
12864
13112
|
|
|
12865
|
-
@FieldResolver(() => [
|
|
12866
|
-
async
|
|
12867
|
-
this.CheckUserReadPermissions('MJ:
|
|
13113
|
+
@FieldResolver(() => [MJCollectionPermission_])
|
|
13114
|
+
async MJ_CollectionPermissions_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
13115
|
+
this.CheckUserReadPermissions('MJ: Collection Permissions', userPayload);
|
|
12868
13116
|
const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
|
|
12869
13117
|
const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
12870
|
-
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[
|
|
13118
|
+
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwCollectionPermissions] WHERE [UserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Collection Permissions', userPayload, EntityPermissionType.Read, 'AND');
|
|
12871
13119
|
const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
|
|
12872
|
-
const result = this.ArrayMapFieldNamesToCodeNames('MJ:
|
|
13120
|
+
const result = this.ArrayMapFieldNamesToCodeNames('MJ: Collection Permissions', rows);
|
|
12873
13121
|
return result;
|
|
12874
13122
|
}
|
|
12875
13123
|
|
|
@@ -41573,6 +41821,9 @@ export class MJArtifact_ {
|
|
|
41573
41821
|
@Field(() => [MJCollectionArtifact_])
|
|
41574
41822
|
MJ_CollectionArtifacts_ArtifactIDArray: MJCollectionArtifact_[]; // Link to MJ_CollectionArtifacts
|
|
41575
41823
|
|
|
41824
|
+
@Field(() => [MJArtifactPermission_])
|
|
41825
|
+
MJ_ArtifactPermissions_ArtifactIDArray: MJArtifactPermission_[]; // Link to MJ_ArtifactPermissions
|
|
41826
|
+
|
|
41576
41827
|
}
|
|
41577
41828
|
|
|
41578
41829
|
//****************************************************************************
|
|
@@ -41713,6 +41964,17 @@ export class MJArtifactResolver extends ResolverBase {
|
|
|
41713
41964
|
return result;
|
|
41714
41965
|
}
|
|
41715
41966
|
|
|
41967
|
+
@FieldResolver(() => [MJArtifactPermission_])
|
|
41968
|
+
async MJ_ArtifactPermissions_ArtifactIDArray(@Root() mjartifact_: MJArtifact_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
41969
|
+
this.CheckUserReadPermissions('MJ: Artifact Permissions', userPayload);
|
|
41970
|
+
const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
|
|
41971
|
+
const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
41972
|
+
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwArtifactPermissions] WHERE [ArtifactID]='${mjartifact_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Artifact Permissions', userPayload, EntityPermissionType.Read, 'AND');
|
|
41973
|
+
const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
|
|
41974
|
+
const result = this.ArrayMapFieldNamesToCodeNames('MJ: Artifact Permissions', rows);
|
|
41975
|
+
return result;
|
|
41976
|
+
}
|
|
41977
|
+
|
|
41716
41978
|
@Mutation(() => MJArtifact_)
|
|
41717
41979
|
async CreateMJArtifact(
|
|
41718
41980
|
@Arg('input', () => CreateMJArtifactInput) input: CreateMJArtifactInput,
|
|
@@ -50061,4 +50323,319 @@ export class MJArtifactVersionAttributeResolver extends ResolverBase {
|
|
|
50061
50323
|
return this.DeleteRecord('MJ: Artifact Version Attributes', key, options, provider, userPayload, pubSub);
|
|
50062
50324
|
}
|
|
50063
50325
|
|
|
50326
|
+
}
|
|
50327
|
+
|
|
50328
|
+
//****************************************************************************
|
|
50329
|
+
// ENTITY CLASS for MJ: AI Agent Data Sources
|
|
50330
|
+
//****************************************************************************
|
|
50331
|
+
@ObjectType({ description: `Defines data sources that should be preloaded into the data parameter before agent execution. Supports both RunView and RunQuery sources with configurable caching.` })
|
|
50332
|
+
export class MJAIAgentDataSource_ {
|
|
50333
|
+
@Field()
|
|
50334
|
+
@MaxLength(16)
|
|
50335
|
+
ID: string;
|
|
50336
|
+
|
|
50337
|
+
@Field()
|
|
50338
|
+
@MaxLength(16)
|
|
50339
|
+
AgentID: string;
|
|
50340
|
+
|
|
50341
|
+
@Field({description: `Variable name for the data in the data parameter (e.g., "ALL_ENTITIES"). Must be unique within an agent.`})
|
|
50342
|
+
@MaxLength(510)
|
|
50343
|
+
Name: string;
|
|
50344
|
+
|
|
50345
|
+
@Field({nullable: true, description: `Description of what this data source provides`})
|
|
50346
|
+
Description?: string;
|
|
50347
|
+
|
|
50348
|
+
@Field({description: `Type of data source: RunView or RunQuery. Determines which parameters are used.`})
|
|
50349
|
+
@MaxLength(40)
|
|
50350
|
+
SourceType: string;
|
|
50351
|
+
|
|
50352
|
+
@Field({nullable: true, description: `Entity name for RunView data sources (e.g., "Entities", "AI Models")`})
|
|
50353
|
+
@MaxLength(510)
|
|
50354
|
+
EntityName?: string;
|
|
50355
|
+
|
|
50356
|
+
@Field({nullable: true, description: `SQL WHERE clause filter for RunView data sources`})
|
|
50357
|
+
ExtraFilter?: string;
|
|
50358
|
+
|
|
50359
|
+
@Field({nullable: true, description: `SQL ORDER BY clause for RunView data sources`})
|
|
50360
|
+
@MaxLength(1000)
|
|
50361
|
+
OrderBy?: string;
|
|
50362
|
+
|
|
50363
|
+
@Field({nullable: true, description: `JSON array of field names to return for RunView data sources (e.g., ["ID", "Name", "Description"])`})
|
|
50364
|
+
FieldsToRetrieve?: string;
|
|
50365
|
+
|
|
50366
|
+
@Field({nullable: true, description: `Result type for RunView: simple (default) or entity_object`})
|
|
50367
|
+
@MaxLength(40)
|
|
50368
|
+
ResultType?: string;
|
|
50369
|
+
|
|
50370
|
+
@Field({nullable: true, description: `Query name for RunQuery data sources`})
|
|
50371
|
+
@MaxLength(510)
|
|
50372
|
+
QueryName?: string;
|
|
50373
|
+
|
|
50374
|
+
@Field({nullable: true, description: `Category path for RunQuery data sources (e.g., "/MJ/AI/Agents/")`})
|
|
50375
|
+
@MaxLength(1000)
|
|
50376
|
+
CategoryPath?: string;
|
|
50377
|
+
|
|
50378
|
+
@Field({nullable: true, description: `JSON object of parameters for RunQuery data sources (e.g., {"organizationId": "123"})`})
|
|
50379
|
+
Parameters?: string;
|
|
50380
|
+
|
|
50381
|
+
@Field(() => Int, {nullable: true, description: `Maximum number of rows to return. Applies to both RunView and RunQuery.`})
|
|
50382
|
+
MaxRows?: number;
|
|
50383
|
+
|
|
50384
|
+
@Field(() => Int, {description: `Execution order when multiple data sources are defined for an agent (lower numbers execute first)`})
|
|
50385
|
+
ExecutionOrder: number;
|
|
50386
|
+
|
|
50387
|
+
@Field({description: `Status of the data source: Active or Disabled`})
|
|
50388
|
+
@MaxLength(40)
|
|
50389
|
+
Status: string;
|
|
50390
|
+
|
|
50391
|
+
@Field({description: `Cache policy: None (no caching), PerRun (cache for duration of agent run), PerAgent (cache across runs with timeout)`})
|
|
50392
|
+
@MaxLength(40)
|
|
50393
|
+
CachePolicy: string;
|
|
50394
|
+
|
|
50395
|
+
@Field(() => Int, {nullable: true, description: `Time-to-live in seconds for PerAgent cache policy. Ignored for other cache policies.`})
|
|
50396
|
+
CacheTimeoutSeconds?: number;
|
|
50397
|
+
|
|
50398
|
+
@Field({description: `Destination for the preloaded data: Data (for Nunjucks templates in prompts), Context (for actions only), or Payload (for agent state)`})
|
|
50399
|
+
@MaxLength(40)
|
|
50400
|
+
DestinationType: string;
|
|
50401
|
+
|
|
50402
|
+
@Field({nullable: true, description: `Path within the destination where data should be injected. Supports nested paths using dot notation (e.g., "config.api.endpoints", "analysis.orders.recent"). If null, uses Name as root-level key.`})
|
|
50403
|
+
@MaxLength(1000)
|
|
50404
|
+
DestinationPath?: string;
|
|
50405
|
+
|
|
50406
|
+
@Field()
|
|
50407
|
+
@MaxLength(10)
|
|
50408
|
+
_mj__CreatedAt: Date;
|
|
50409
|
+
|
|
50410
|
+
@Field()
|
|
50411
|
+
@MaxLength(10)
|
|
50412
|
+
_mj__UpdatedAt: Date;
|
|
50413
|
+
|
|
50414
|
+
@Field({nullable: true})
|
|
50415
|
+
@MaxLength(510)
|
|
50416
|
+
Agent?: string;
|
|
50417
|
+
|
|
50418
|
+
}
|
|
50419
|
+
|
|
50420
|
+
//****************************************************************************
|
|
50421
|
+
// INPUT TYPE for MJ: AI Agent Data Sources
|
|
50422
|
+
//****************************************************************************
|
|
50423
|
+
@InputType()
|
|
50424
|
+
export class CreateMJAIAgentDataSourceInput {
|
|
50425
|
+
@Field({ nullable: true })
|
|
50426
|
+
ID?: string;
|
|
50427
|
+
|
|
50428
|
+
@Field({ nullable: true })
|
|
50429
|
+
AgentID?: string;
|
|
50430
|
+
|
|
50431
|
+
@Field({ nullable: true })
|
|
50432
|
+
Name?: string;
|
|
50433
|
+
|
|
50434
|
+
@Field({ nullable: true })
|
|
50435
|
+
Description: string | null;
|
|
50436
|
+
|
|
50437
|
+
@Field({ nullable: true })
|
|
50438
|
+
SourceType?: string;
|
|
50439
|
+
|
|
50440
|
+
@Field({ nullable: true })
|
|
50441
|
+
EntityName: string | null;
|
|
50442
|
+
|
|
50443
|
+
@Field({ nullable: true })
|
|
50444
|
+
ExtraFilter: string | null;
|
|
50445
|
+
|
|
50446
|
+
@Field({ nullable: true })
|
|
50447
|
+
OrderBy: string | null;
|
|
50448
|
+
|
|
50449
|
+
@Field({ nullable: true })
|
|
50450
|
+
FieldsToRetrieve: string | null;
|
|
50451
|
+
|
|
50452
|
+
@Field({ nullable: true })
|
|
50453
|
+
ResultType?: string | null;
|
|
50454
|
+
|
|
50455
|
+
@Field({ nullable: true })
|
|
50456
|
+
QueryName: string | null;
|
|
50457
|
+
|
|
50458
|
+
@Field({ nullable: true })
|
|
50459
|
+
CategoryPath: string | null;
|
|
50460
|
+
|
|
50461
|
+
@Field({ nullable: true })
|
|
50462
|
+
Parameters: string | null;
|
|
50463
|
+
|
|
50464
|
+
@Field(() => Int, { nullable: true })
|
|
50465
|
+
MaxRows: number | null;
|
|
50466
|
+
|
|
50467
|
+
@Field(() => Int, { nullable: true })
|
|
50468
|
+
ExecutionOrder?: number;
|
|
50469
|
+
|
|
50470
|
+
@Field({ nullable: true })
|
|
50471
|
+
Status?: string;
|
|
50472
|
+
|
|
50473
|
+
@Field({ nullable: true })
|
|
50474
|
+
CachePolicy?: string;
|
|
50475
|
+
|
|
50476
|
+
@Field(() => Int, { nullable: true })
|
|
50477
|
+
CacheTimeoutSeconds: number | null;
|
|
50478
|
+
|
|
50479
|
+
@Field({ nullable: true })
|
|
50480
|
+
DestinationType?: string;
|
|
50481
|
+
|
|
50482
|
+
@Field({ nullable: true })
|
|
50483
|
+
DestinationPath: string | null;
|
|
50484
|
+
}
|
|
50485
|
+
|
|
50486
|
+
|
|
50487
|
+
//****************************************************************************
|
|
50488
|
+
// INPUT TYPE for MJ: AI Agent Data Sources
|
|
50489
|
+
//****************************************************************************
|
|
50490
|
+
@InputType()
|
|
50491
|
+
export class UpdateMJAIAgentDataSourceInput {
|
|
50492
|
+
@Field()
|
|
50493
|
+
ID: string;
|
|
50494
|
+
|
|
50495
|
+
@Field({ nullable: true })
|
|
50496
|
+
AgentID?: string;
|
|
50497
|
+
|
|
50498
|
+
@Field({ nullable: true })
|
|
50499
|
+
Name?: string;
|
|
50500
|
+
|
|
50501
|
+
@Field({ nullable: true })
|
|
50502
|
+
Description?: string | null;
|
|
50503
|
+
|
|
50504
|
+
@Field({ nullable: true })
|
|
50505
|
+
SourceType?: string;
|
|
50506
|
+
|
|
50507
|
+
@Field({ nullable: true })
|
|
50508
|
+
EntityName?: string | null;
|
|
50509
|
+
|
|
50510
|
+
@Field({ nullable: true })
|
|
50511
|
+
ExtraFilter?: string | null;
|
|
50512
|
+
|
|
50513
|
+
@Field({ nullable: true })
|
|
50514
|
+
OrderBy?: string | null;
|
|
50515
|
+
|
|
50516
|
+
@Field({ nullable: true })
|
|
50517
|
+
FieldsToRetrieve?: string | null;
|
|
50518
|
+
|
|
50519
|
+
@Field({ nullable: true })
|
|
50520
|
+
ResultType?: string | null;
|
|
50521
|
+
|
|
50522
|
+
@Field({ nullable: true })
|
|
50523
|
+
QueryName?: string | null;
|
|
50524
|
+
|
|
50525
|
+
@Field({ nullable: true })
|
|
50526
|
+
CategoryPath?: string | null;
|
|
50527
|
+
|
|
50528
|
+
@Field({ nullable: true })
|
|
50529
|
+
Parameters?: string | null;
|
|
50530
|
+
|
|
50531
|
+
@Field(() => Int, { nullable: true })
|
|
50532
|
+
MaxRows?: number | null;
|
|
50533
|
+
|
|
50534
|
+
@Field(() => Int, { nullable: true })
|
|
50535
|
+
ExecutionOrder?: number;
|
|
50536
|
+
|
|
50537
|
+
@Field({ nullable: true })
|
|
50538
|
+
Status?: string;
|
|
50539
|
+
|
|
50540
|
+
@Field({ nullable: true })
|
|
50541
|
+
CachePolicy?: string;
|
|
50542
|
+
|
|
50543
|
+
@Field(() => Int, { nullable: true })
|
|
50544
|
+
CacheTimeoutSeconds?: number | null;
|
|
50545
|
+
|
|
50546
|
+
@Field({ nullable: true })
|
|
50547
|
+
DestinationType?: string;
|
|
50548
|
+
|
|
50549
|
+
@Field({ nullable: true })
|
|
50550
|
+
DestinationPath?: string | null;
|
|
50551
|
+
|
|
50552
|
+
@Field(() => [KeyValuePairInput], { nullable: true })
|
|
50553
|
+
OldValues___?: KeyValuePairInput[];
|
|
50554
|
+
}
|
|
50555
|
+
|
|
50556
|
+
//****************************************************************************
|
|
50557
|
+
// RESOLVER for MJ: AI Agent Data Sources
|
|
50558
|
+
//****************************************************************************
|
|
50559
|
+
@ObjectType()
|
|
50560
|
+
export class RunMJAIAgentDataSourceViewResult {
|
|
50561
|
+
@Field(() => [MJAIAgentDataSource_])
|
|
50562
|
+
Results: MJAIAgentDataSource_[];
|
|
50563
|
+
|
|
50564
|
+
@Field(() => String, {nullable: true})
|
|
50565
|
+
UserViewRunID?: string;
|
|
50566
|
+
|
|
50567
|
+
@Field(() => Int, {nullable: true})
|
|
50568
|
+
RowCount: number;
|
|
50569
|
+
|
|
50570
|
+
@Field(() => Int, {nullable: true})
|
|
50571
|
+
TotalRowCount: number;
|
|
50572
|
+
|
|
50573
|
+
@Field(() => Int, {nullable: true})
|
|
50574
|
+
ExecutionTime: number;
|
|
50575
|
+
|
|
50576
|
+
@Field({nullable: true})
|
|
50577
|
+
ErrorMessage?: string;
|
|
50578
|
+
|
|
50579
|
+
@Field(() => Boolean, {nullable: false})
|
|
50580
|
+
Success: boolean;
|
|
50581
|
+
}
|
|
50582
|
+
|
|
50583
|
+
@Resolver(MJAIAgentDataSource_)
|
|
50584
|
+
export class MJAIAgentDataSourceResolver extends ResolverBase {
|
|
50585
|
+
@Query(() => RunMJAIAgentDataSourceViewResult)
|
|
50586
|
+
async RunMJAIAgentDataSourceViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
50587
|
+
const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
|
|
50588
|
+
return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
|
|
50589
|
+
}
|
|
50590
|
+
|
|
50591
|
+
@Query(() => RunMJAIAgentDataSourceViewResult)
|
|
50592
|
+
async RunMJAIAgentDataSourceViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
50593
|
+
const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
|
|
50594
|
+
return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
|
|
50595
|
+
}
|
|
50596
|
+
|
|
50597
|
+
@Query(() => RunMJAIAgentDataSourceViewResult)
|
|
50598
|
+
async RunMJAIAgentDataSourceDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
50599
|
+
const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
|
|
50600
|
+
input.EntityName = 'MJ: AI Agent Data Sources';
|
|
50601
|
+
return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
|
|
50602
|
+
}
|
|
50603
|
+
@Query(() => MJAIAgentDataSource_, { nullable: true })
|
|
50604
|
+
async MJAIAgentDataSource(@Arg('ID', () => String) ID: string, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJAIAgentDataSource_ | null> {
|
|
50605
|
+
this.CheckUserReadPermissions('MJ: AI Agent Data Sources', userPayload);
|
|
50606
|
+
const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
|
|
50607
|
+
const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
|
|
50608
|
+
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentDataSources] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Data Sources', userPayload, EntityPermissionType.Read, 'AND');
|
|
50609
|
+
const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
|
|
50610
|
+
const result = this.MapFieldNamesToCodeNames('MJ: AI Agent Data Sources', rows && rows.length > 0 ? rows[0] : {})
|
|
50611
|
+
return result;
|
|
50612
|
+
}
|
|
50613
|
+
|
|
50614
|
+
@Mutation(() => MJAIAgentDataSource_)
|
|
50615
|
+
async CreateMJAIAgentDataSource(
|
|
50616
|
+
@Arg('input', () => CreateMJAIAgentDataSourceInput) input: CreateMJAIAgentDataSourceInput,
|
|
50617
|
+
@Ctx() { providers, userPayload }: AppContext,
|
|
50618
|
+
@PubSub() pubSub: PubSubEngine
|
|
50619
|
+
) {
|
|
50620
|
+
const provider = GetReadWriteProvider(providers);
|
|
50621
|
+
return this.CreateRecord('MJ: AI Agent Data Sources', input, provider, userPayload, pubSub)
|
|
50622
|
+
}
|
|
50623
|
+
|
|
50624
|
+
@Mutation(() => MJAIAgentDataSource_)
|
|
50625
|
+
async UpdateMJAIAgentDataSource(
|
|
50626
|
+
@Arg('input', () => UpdateMJAIAgentDataSourceInput) input: UpdateMJAIAgentDataSourceInput,
|
|
50627
|
+
@Ctx() { providers, userPayload }: AppContext,
|
|
50628
|
+
@PubSub() pubSub: PubSubEngine
|
|
50629
|
+
) {
|
|
50630
|
+
const provider = GetReadWriteProvider(providers);
|
|
50631
|
+
return this.UpdateRecord('MJ: AI Agent Data Sources', input, provider, userPayload, pubSub);
|
|
50632
|
+
}
|
|
50633
|
+
|
|
50634
|
+
@Mutation(() => MJAIAgentDataSource_)
|
|
50635
|
+
async DeleteMJAIAgentDataSource(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
50636
|
+
const provider = GetReadWriteProvider(providers);
|
|
50637
|
+
const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
|
|
50638
|
+
return this.DeleteRecord('MJ: AI Agent Data Sources', key, options, provider, userPayload, pubSub);
|
|
50639
|
+
}
|
|
50640
|
+
|
|
50064
50641
|
}
|