@memberjunction/server 2.4.0 → 2.5.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.
@@ -2,7 +2,7 @@
2
2
  * ALL ENTITIES - TypeGraphQL Type Class Definition - AUTO GENERATED FILE
3
3
  * Generated Entities and Resolvers for Server
4
4
  *
5
- * GENERATED: 8/29/2024, 12:18:08 PM
5
+ * GENERATED: 9/20/2024, 11:11:39 AM
6
6
  *
7
7
  * >>> DO NOT MODIFY THIS FILE!!!!!!!!!!!!
8
8
  * >>> YOUR CHANGES WILL BE OVERWRITTEN
@@ -20,7 +20,7 @@ import { mj_core_schema } from '../config.js';
20
20
 
21
21
 
22
22
 
23
- import { ScheduledActionEntity, ScheduledActionParamEntity, ExplorerNavigationItemEntity, flyway_schema_historyEntity, 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 } from '@memberjunction/core-entities';
23
+ import { ScheduledActionEntity, ScheduledActionParamEntity, ExplorerNavigationItemEntity, flyway_schema_historyEntity, 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, ContentProcessRunEntity, ContentSourceEntity, ContentSourceParamEntity, ContentSourceTypeEntity, ContentSourceTypeParamEntity, ContentTypeEntity, ContentTypeAttributeEntity, ContentFileTypeEntity, ContentItemEntity, ContentItemAttributeEntity, ContentItemTagEntity } from '@memberjunction/core-entities';
24
24
 
25
25
 
26
26
  //****************************************************************************
@@ -10427,6 +10427,9 @@ export class AIModel_ {
10427
10427
  @Field({nullable: true, description: 'This column stores unstructured text notes that provide insights into what the model is particularly good at and areas where it may not perform as well. These notes can be used by a human or an AI to determine if the model is a good fit for various purposes.'})
10428
10428
  ModelSelectionInsights?: string;
10429
10429
 
10430
+ @Field(() => Int, {nullable: true, description: 'Stores the maximum number of tokens that fit in the context window for the model.'})
10431
+ InputTokenLimit?: number;
10432
+
10430
10433
  @Field()
10431
10434
  @MaxLength(100)
10432
10435
  AIModelType: string;
@@ -10443,12 +10446,15 @@ export class AIModel_ {
10443
10446
  @Field(() => [VectorIndex_])
10444
10447
  VectorIndexes_EmbeddingModelIDArray: VectorIndex_[]; // Link to VectorIndexes
10445
10448
 
10446
- @Field(() => [EntityAIAction_])
10447
- EntityAIActions_AIModelIDArray: EntityAIAction_[]; // Link to EntityAIActions
10449
+ @Field(() => [ContentType_])
10450
+ ContentTypes_AIModelIDArray: ContentType_[]; // Link to ContentTypes
10448
10451
 
10449
10452
  @Field(() => [AIResultCache_])
10450
10453
  AIResultCache_AIModelIDArray: AIResultCache_[]; // Link to AIResultCache
10451
10454
 
10455
+ @Field(() => [EntityAIAction_])
10456
+ EntityAIActions_AIModelIDArray: EntityAIAction_[]; // Link to EntityAIActions
10457
+
10452
10458
  }
10453
10459
 
10454
10460
  //****************************************************************************
@@ -10491,6 +10497,9 @@ export class CreateAIModelInput {
10491
10497
 
10492
10498
  @Field({ nullable: true })
10493
10499
  ModelSelectionInsights?: string;
10500
+
10501
+ @Field(() => Int, { nullable: true })
10502
+ InputTokenLimit?: number;
10494
10503
  }
10495
10504
 
10496
10505
 
@@ -10538,6 +10547,9 @@ export class UpdateAIModelInput {
10538
10547
  @Field({ nullable: true })
10539
10548
  ModelSelectionInsights?: string;
10540
10549
 
10550
+ @Field(() => Int, { nullable: true })
10551
+ InputTokenLimit?: number;
10552
+
10541
10553
  @Field(() => [KeyValuePairInput], { nullable: true })
10542
10554
  OldValues___?: KeyValuePairInput[];
10543
10555
  }
@@ -10634,11 +10646,11 @@ export class AIModelResolver extends ResolverBase {
10634
10646
  return result;
10635
10647
  }
10636
10648
 
10637
- @FieldResolver(() => [EntityAIAction_])
10638
- async EntityAIActions_AIModelIDArray(@Root() aimodel_: AIModel_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
10639
- this.CheckUserReadPermissions('Entity AI Actions', userPayload);
10640
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwEntityAIActions] WHERE [AIModelID]='${aimodel_.ID}' ` + this.getRowLevelSecurityWhereClause('Entity AI Actions', userPayload, EntityPermissionType.Read, 'AND');
10641
- const result = this.ArrayMapFieldNamesToCodeNames('Entity AI Actions', await dataSource.query(sSQL));
10649
+ @FieldResolver(() => [ContentType_])
10650
+ async ContentTypes_AIModelIDArray(@Root() aimodel_: AIModel_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
10651
+ this.CheckUserReadPermissions('Content Types', userPayload);
10652
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwContentTypes] WHERE [AIModelID]='${aimodel_.ID}' ` + this.getRowLevelSecurityWhereClause('Content Types', userPayload, EntityPermissionType.Read, 'AND');
10653
+ const result = this.ArrayMapFieldNamesToCodeNames('Content Types', await dataSource.query(sSQL));
10642
10654
  return result;
10643
10655
  }
10644
10656
 
@@ -10650,6 +10662,14 @@ export class AIModelResolver extends ResolverBase {
10650
10662
  return result;
10651
10663
  }
10652
10664
 
10665
+ @FieldResolver(() => [EntityAIAction_])
10666
+ async EntityAIActions_AIModelIDArray(@Root() aimodel_: AIModel_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
10667
+ this.CheckUserReadPermissions('Entity AI Actions', userPayload);
10668
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwEntityAIActions] WHERE [AIModelID]='${aimodel_.ID}' ` + this.getRowLevelSecurityWhereClause('Entity AI Actions', userPayload, EntityPermissionType.Read, 'AND');
10669
+ const result = this.ArrayMapFieldNamesToCodeNames('Entity AI Actions', await dataSource.query(sSQL));
10670
+ return result;
10671
+ }
10672
+
10653
10673
  @Mutation(() => AIModel_)
10654
10674
  async CreateAIModel(
10655
10675
  @Arg('input', () => CreateAIModelInput) input: CreateAIModelInput,
@@ -22891,6 +22911,9 @@ export class CommunicationProvider_ {
22891
22911
  @MaxLength(10)
22892
22912
  _mj__UpdatedAt: Date;
22893
22913
 
22914
+ @Field(() => Boolean, {description: 'Whether or not the provider supports sending messages at a specific time'})
22915
+ SupportsScheduledSending: boolean;
22916
+
22894
22917
  @Field(() => [CommunicationLog_])
22895
22918
  CommunicationLogs_CommunicationProviderIDArray: CommunicationLog_[]; // Link to CommunicationLogs
22896
22919
 
@@ -22918,6 +22941,9 @@ export class CreateCommunicationProviderInput {
22918
22941
 
22919
22942
  @Field(() => Boolean)
22920
22943
  SupportsReceiving: boolean;
22944
+
22945
+ @Field(() => Boolean)
22946
+ SupportsScheduledSending: boolean;
22921
22947
  }
22922
22948
 
22923
22949
 
@@ -22944,6 +22970,9 @@ export class UpdateCommunicationProviderInput {
22944
22970
  @Field(() => Boolean)
22945
22971
  SupportsReceiving: boolean;
22946
22972
 
22973
+ @Field(() => Boolean)
22974
+ SupportsScheduledSending: boolean;
22975
+
22947
22976
  @Field(() => [KeyValuePairInput], { nullable: true })
22948
22977
  OldValues___?: KeyValuePairInput[];
22949
22978
  }
@@ -24427,6 +24456,9 @@ export class TemplateParam_ {
24427
24456
  @MaxLength(10)
24428
24457
  _mj__UpdatedAt: Date;
24429
24458
 
24459
+ @Field({nullable: true, description: 'This field is used only when the Type of the TemplateParam table is "Entity". It is an optional field used to specify the sorting order for the related entity data that is used in the template for the Entity specified.'})
24460
+ OrderBy?: string;
24461
+
24430
24462
  @Field()
24431
24463
  @MaxLength(510)
24432
24464
  Template: string;
@@ -24474,6 +24506,9 @@ export class CreateTemplateParamInput {
24474
24506
 
24475
24507
  @Field({ nullable: true })
24476
24508
  RecordID?: string;
24509
+
24510
+ @Field({ nullable: true })
24511
+ OrderBy?: string;
24477
24512
  }
24478
24513
 
24479
24514
 
@@ -24518,6 +24553,9 @@ export class UpdateTemplateParamInput {
24518
24553
  @Field({ nullable: true })
24519
24554
  RecordID?: string;
24520
24555
 
24556
+ @Field({ nullable: true })
24557
+ OrderBy?: string;
24558
+
24521
24559
  @Field(() => [KeyValuePairInput], { nullable: true })
24522
24560
  OldValues___?: KeyValuePairInput[];
24523
24561
  }
@@ -26301,4 +26339,1886 @@ export class EntityActionParamResolver extends ResolverBase {
26301
26339
  return this.DeleteRecord('Entity Action Params', key, options, dataSource, userPayload, pubSub);
26302
26340
  }
26303
26341
 
26342
+ }
26343
+
26344
+ //****************************************************************************
26345
+ // ENTITY CLASS for Content Process Runs
26346
+ //****************************************************************************
26347
+ @ObjectType()
26348
+ export class ContentProcessRun_ {
26349
+ @Field()
26350
+ @MaxLength(16)
26351
+ ID: string;
26352
+
26353
+ @Field()
26354
+ @MaxLength(16)
26355
+ SourceID: string;
26356
+
26357
+ @Field({nullable: true})
26358
+ @MaxLength(8)
26359
+ StartTime?: Date;
26360
+
26361
+ @Field({nullable: true})
26362
+ @MaxLength(8)
26363
+ EndTime?: Date;
26364
+
26365
+ @Field({nullable: true})
26366
+ @MaxLength(200)
26367
+ Status?: string;
26368
+
26369
+ @Field(() => Int, {nullable: true})
26370
+ ProcessedItems?: number;
26371
+
26372
+ @Field()
26373
+ @MaxLength(10)
26374
+ _mj__CreatedAt: Date;
26375
+
26376
+ @Field()
26377
+ @MaxLength(10)
26378
+ _mj__UpdatedAt: Date;
26379
+
26380
+ @Field({nullable: true})
26381
+ @MaxLength(510)
26382
+ Source?: string;
26383
+
26384
+ }
26385
+
26386
+ //****************************************************************************
26387
+ // INPUT TYPE for Content Process Runs
26388
+ //****************************************************************************
26389
+ @InputType()
26390
+ export class CreateContentProcessRunInput {
26391
+ @Field()
26392
+ SourceID: string;
26393
+
26394
+ @Field({ nullable: true })
26395
+ StartTime?: Date;
26396
+
26397
+ @Field({ nullable: true })
26398
+ EndTime?: Date;
26399
+
26400
+ @Field({ nullable: true })
26401
+ Status?: string;
26402
+
26403
+ @Field(() => Int, { nullable: true })
26404
+ ProcessedItems?: number;
26405
+ }
26406
+
26407
+
26408
+ //****************************************************************************
26409
+ // INPUT TYPE for Content Process Runs
26410
+ //****************************************************************************
26411
+ @InputType()
26412
+ export class UpdateContentProcessRunInput {
26413
+ @Field()
26414
+ ID: string;
26415
+
26416
+ @Field()
26417
+ SourceID: string;
26418
+
26419
+ @Field({ nullable: true })
26420
+ StartTime?: Date;
26421
+
26422
+ @Field({ nullable: true })
26423
+ EndTime?: Date;
26424
+
26425
+ @Field({ nullable: true })
26426
+ Status?: string;
26427
+
26428
+ @Field(() => Int, { nullable: true })
26429
+ ProcessedItems?: number;
26430
+
26431
+ @Field(() => [KeyValuePairInput], { nullable: true })
26432
+ OldValues___?: KeyValuePairInput[];
26433
+ }
26434
+
26435
+ //****************************************************************************
26436
+ // RESOLVER for Content Process Runs
26437
+ //****************************************************************************
26438
+ @ObjectType()
26439
+ export class RunContentProcessRunViewResult {
26440
+ @Field(() => [ContentProcessRun_])
26441
+ Results: ContentProcessRun_[];
26442
+
26443
+ @Field(() => String, {nullable: true})
26444
+ UserViewRunID?: string;
26445
+
26446
+ @Field(() => Int, {nullable: true})
26447
+ RowCount: number;
26448
+
26449
+ @Field(() => Int, {nullable: true})
26450
+ TotalRowCount: number;
26451
+
26452
+ @Field(() => Int, {nullable: true})
26453
+ ExecutionTime: number;
26454
+
26455
+ @Field({nullable: true})
26456
+ ErrorMessage?: string;
26457
+
26458
+ @Field(() => Boolean, {nullable: false})
26459
+ Success: boolean;
26460
+ }
26461
+
26462
+ @Resolver(ContentProcessRun_)
26463
+ export class ContentProcessRunResolver extends ResolverBase {
26464
+ @Query(() => RunContentProcessRunViewResult)
26465
+ async RunContentProcessRunViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
26466
+ return super.RunViewByIDGeneric(input, dataSource, userPayload, pubSub);
26467
+ }
26468
+
26469
+ @Query(() => RunContentProcessRunViewResult)
26470
+ async RunContentProcessRunViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
26471
+ return super.RunViewByNameGeneric(input, dataSource, userPayload, pubSub);
26472
+ }
26473
+
26474
+ @Query(() => RunContentProcessRunViewResult)
26475
+ async RunContentProcessRunDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
26476
+ input.EntityName = 'Content Process Runs';
26477
+ return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
26478
+ }
26479
+ @Query(() => ContentProcessRun_, { nullable: true })
26480
+ async ContentProcessRun(@Arg('ID', () => String) ID: string, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<ContentProcessRun_ | null> {
26481
+ this.CheckUserReadPermissions('Content Process Runs', userPayload);
26482
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwContentProcessRuns] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause('Content Process Runs', userPayload, EntityPermissionType.Read, 'AND');
26483
+ const result = this.MapFieldNamesToCodeNames('Content Process Runs', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
26484
+ return result;
26485
+ }
26486
+
26487
+ @Mutation(() => ContentProcessRun_)
26488
+ async CreateContentProcessRun(
26489
+ @Arg('input', () => CreateContentProcessRunInput) input: CreateContentProcessRunInput,
26490
+ @Ctx() { dataSource, userPayload }: AppContext,
26491
+ @PubSub() pubSub: PubSubEngine
26492
+ ) {
26493
+ return this.CreateRecord('Content Process Runs', input, dataSource, userPayload, pubSub)
26494
+ }
26495
+
26496
+ @Mutation(() => ContentProcessRun_)
26497
+ async UpdateContentProcessRun(
26498
+ @Arg('input', () => UpdateContentProcessRunInput) input: UpdateContentProcessRunInput,
26499
+ @Ctx() { dataSource, userPayload }: AppContext,
26500
+ @PubSub() pubSub: PubSubEngine
26501
+ ) {
26502
+ return this.UpdateRecord('Content Process Runs', input, dataSource, userPayload, pubSub);
26503
+ }
26504
+
26505
+ @Mutation(() => ContentProcessRun_)
26506
+ async DeleteContentProcessRun(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
26507
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
26508
+ return this.DeleteRecord('Content Process Runs', key, options, dataSource, userPayload, pubSub);
26509
+ }
26510
+
26511
+ }
26512
+
26513
+ //****************************************************************************
26514
+ // ENTITY CLASS for Content Sources
26515
+ //****************************************************************************
26516
+ @ObjectType()
26517
+ export class ContentSource_ {
26518
+ @Field()
26519
+ @MaxLength(16)
26520
+ ID: string;
26521
+
26522
+ @Field({nullable: true})
26523
+ @MaxLength(510)
26524
+ Name?: string;
26525
+
26526
+ @Field()
26527
+ @MaxLength(16)
26528
+ ContentTypeID: string;
26529
+
26530
+ @Field()
26531
+ @MaxLength(16)
26532
+ ContentSourceTypeID: string;
26533
+
26534
+ @Field()
26535
+ @MaxLength(16)
26536
+ ContentFileTypeID: string;
26537
+
26538
+ @Field()
26539
+ @MaxLength(4000)
26540
+ URL: string;
26541
+
26542
+ @Field()
26543
+ @MaxLength(10)
26544
+ _mj__CreatedAt: Date;
26545
+
26546
+ @Field()
26547
+ @MaxLength(10)
26548
+ _mj__UpdatedAt: Date;
26549
+
26550
+ @Field()
26551
+ @MaxLength(510)
26552
+ ContentType: string;
26553
+
26554
+ @Field()
26555
+ @MaxLength(510)
26556
+ ContentSourceType: string;
26557
+
26558
+ @Field()
26559
+ @MaxLength(510)
26560
+ ContentFileType: string;
26561
+
26562
+ @Field(() => [ContentProcessRun_])
26563
+ ContentProcessRuns_SourceIDArray: ContentProcessRun_[]; // Link to ContentProcessRuns
26564
+
26565
+ @Field(() => [ContentSourceParam_])
26566
+ ContentSourceParams_ContentSourceIDArray: ContentSourceParam_[]; // Link to ContentSourceParams
26567
+
26568
+ @Field(() => [ContentItem_])
26569
+ ContentItems_ContentSourceIDArray: ContentItem_[]; // Link to ContentItems
26570
+
26571
+ }
26572
+
26573
+ //****************************************************************************
26574
+ // INPUT TYPE for Content Sources
26575
+ //****************************************************************************
26576
+ @InputType()
26577
+ export class CreateContentSourceInput {
26578
+ @Field({ nullable: true })
26579
+ Name?: string;
26580
+
26581
+ @Field()
26582
+ ContentTypeID: string;
26583
+
26584
+ @Field()
26585
+ ContentSourceTypeID: string;
26586
+
26587
+ @Field()
26588
+ ContentFileTypeID: string;
26589
+
26590
+ @Field()
26591
+ URL: string;
26592
+ }
26593
+
26594
+
26595
+ //****************************************************************************
26596
+ // INPUT TYPE for Content Sources
26597
+ //****************************************************************************
26598
+ @InputType()
26599
+ export class UpdateContentSourceInput {
26600
+ @Field()
26601
+ ID: string;
26602
+
26603
+ @Field({ nullable: true })
26604
+ Name?: string;
26605
+
26606
+ @Field()
26607
+ ContentTypeID: string;
26608
+
26609
+ @Field()
26610
+ ContentSourceTypeID: string;
26611
+
26612
+ @Field()
26613
+ ContentFileTypeID: string;
26614
+
26615
+ @Field()
26616
+ URL: string;
26617
+
26618
+ @Field(() => [KeyValuePairInput], { nullable: true })
26619
+ OldValues___?: KeyValuePairInput[];
26620
+ }
26621
+
26622
+ //****************************************************************************
26623
+ // RESOLVER for Content Sources
26624
+ //****************************************************************************
26625
+ @ObjectType()
26626
+ export class RunContentSourceViewResult {
26627
+ @Field(() => [ContentSource_])
26628
+ Results: ContentSource_[];
26629
+
26630
+ @Field(() => String, {nullable: true})
26631
+ UserViewRunID?: string;
26632
+
26633
+ @Field(() => Int, {nullable: true})
26634
+ RowCount: number;
26635
+
26636
+ @Field(() => Int, {nullable: true})
26637
+ TotalRowCount: number;
26638
+
26639
+ @Field(() => Int, {nullable: true})
26640
+ ExecutionTime: number;
26641
+
26642
+ @Field({nullable: true})
26643
+ ErrorMessage?: string;
26644
+
26645
+ @Field(() => Boolean, {nullable: false})
26646
+ Success: boolean;
26647
+ }
26648
+
26649
+ @Resolver(ContentSource_)
26650
+ export class ContentSourceResolver extends ResolverBase {
26651
+ @Query(() => RunContentSourceViewResult)
26652
+ async RunContentSourceViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
26653
+ return super.RunViewByIDGeneric(input, dataSource, userPayload, pubSub);
26654
+ }
26655
+
26656
+ @Query(() => RunContentSourceViewResult)
26657
+ async RunContentSourceViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
26658
+ return super.RunViewByNameGeneric(input, dataSource, userPayload, pubSub);
26659
+ }
26660
+
26661
+ @Query(() => RunContentSourceViewResult)
26662
+ async RunContentSourceDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
26663
+ input.EntityName = 'Content Sources';
26664
+ return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
26665
+ }
26666
+ @Query(() => ContentSource_, { nullable: true })
26667
+ async ContentSource(@Arg('ID', () => String) ID: string, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<ContentSource_ | null> {
26668
+ this.CheckUserReadPermissions('Content Sources', userPayload);
26669
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwContentSources] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause('Content Sources', userPayload, EntityPermissionType.Read, 'AND');
26670
+ const result = this.MapFieldNamesToCodeNames('Content Sources', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
26671
+ return result;
26672
+ }
26673
+
26674
+ @FieldResolver(() => [ContentProcessRun_])
26675
+ async ContentProcessRuns_SourceIDArray(@Root() contentsource_: ContentSource_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
26676
+ this.CheckUserReadPermissions('Content Process Runs', userPayload);
26677
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwContentProcessRuns] WHERE [SourceID]='${contentsource_.ID}' ` + this.getRowLevelSecurityWhereClause('Content Process Runs', userPayload, EntityPermissionType.Read, 'AND');
26678
+ const result = this.ArrayMapFieldNamesToCodeNames('Content Process Runs', await dataSource.query(sSQL));
26679
+ return result;
26680
+ }
26681
+
26682
+ @FieldResolver(() => [ContentSourceParam_])
26683
+ async ContentSourceParams_ContentSourceIDArray(@Root() contentsource_: ContentSource_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
26684
+ this.CheckUserReadPermissions('Content Source Params', userPayload);
26685
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwContentSourceParams] WHERE [ContentSourceID]='${contentsource_.ID}' ` + this.getRowLevelSecurityWhereClause('Content Source Params', userPayload, EntityPermissionType.Read, 'AND');
26686
+ const result = this.ArrayMapFieldNamesToCodeNames('Content Source Params', await dataSource.query(sSQL));
26687
+ return result;
26688
+ }
26689
+
26690
+ @FieldResolver(() => [ContentItem_])
26691
+ async ContentItems_ContentSourceIDArray(@Root() contentsource_: ContentSource_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
26692
+ this.CheckUserReadPermissions('Content Items', userPayload);
26693
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwContentItems] WHERE [ContentSourceID]='${contentsource_.ID}' ` + this.getRowLevelSecurityWhereClause('Content Items', userPayload, EntityPermissionType.Read, 'AND');
26694
+ const result = this.ArrayMapFieldNamesToCodeNames('Content Items', await dataSource.query(sSQL));
26695
+ return result;
26696
+ }
26697
+
26698
+ @Mutation(() => ContentSource_)
26699
+ async CreateContentSource(
26700
+ @Arg('input', () => CreateContentSourceInput) input: CreateContentSourceInput,
26701
+ @Ctx() { dataSource, userPayload }: AppContext,
26702
+ @PubSub() pubSub: PubSubEngine
26703
+ ) {
26704
+ return this.CreateRecord('Content Sources', input, dataSource, userPayload, pubSub)
26705
+ }
26706
+
26707
+ @Mutation(() => ContentSource_)
26708
+ async UpdateContentSource(
26709
+ @Arg('input', () => UpdateContentSourceInput) input: UpdateContentSourceInput,
26710
+ @Ctx() { dataSource, userPayload }: AppContext,
26711
+ @PubSub() pubSub: PubSubEngine
26712
+ ) {
26713
+ return this.UpdateRecord('Content Sources', input, dataSource, userPayload, pubSub);
26714
+ }
26715
+
26716
+ @Mutation(() => ContentSource_)
26717
+ async DeleteContentSource(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
26718
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
26719
+ return this.DeleteRecord('Content Sources', key, options, dataSource, userPayload, pubSub);
26720
+ }
26721
+
26722
+ }
26723
+
26724
+ //****************************************************************************
26725
+ // ENTITY CLASS for Content Source Params
26726
+ //****************************************************************************
26727
+ @ObjectType()
26728
+ export class ContentSourceParam_ {
26729
+ @Field()
26730
+ @MaxLength(16)
26731
+ ID: string;
26732
+
26733
+ @Field()
26734
+ @MaxLength(16)
26735
+ ContentSourceID: string;
26736
+
26737
+ @Field()
26738
+ @MaxLength(16)
26739
+ ContentSourceTypeParamID: string;
26740
+
26741
+ @Field()
26742
+ Value: string;
26743
+
26744
+ @Field()
26745
+ @MaxLength(10)
26746
+ _mj__CreatedAt: Date;
26747
+
26748
+ @Field()
26749
+ @MaxLength(10)
26750
+ _mj__UpdatedAt: Date;
26751
+
26752
+ @Field({nullable: true})
26753
+ @MaxLength(510)
26754
+ ContentSource?: string;
26755
+
26756
+ }
26757
+
26758
+ //****************************************************************************
26759
+ // INPUT TYPE for Content Source Params
26760
+ //****************************************************************************
26761
+ @InputType()
26762
+ export class CreateContentSourceParamInput {
26763
+ @Field()
26764
+ ContentSourceID: string;
26765
+
26766
+ @Field()
26767
+ ContentSourceTypeParamID: string;
26768
+
26769
+ @Field()
26770
+ Value: string;
26771
+ }
26772
+
26773
+
26774
+ //****************************************************************************
26775
+ // INPUT TYPE for Content Source Params
26776
+ //****************************************************************************
26777
+ @InputType()
26778
+ export class UpdateContentSourceParamInput {
26779
+ @Field()
26780
+ ID: string;
26781
+
26782
+ @Field()
26783
+ ContentSourceID: string;
26784
+
26785
+ @Field()
26786
+ ContentSourceTypeParamID: string;
26787
+
26788
+ @Field()
26789
+ Value: string;
26790
+
26791
+ @Field(() => [KeyValuePairInput], { nullable: true })
26792
+ OldValues___?: KeyValuePairInput[];
26793
+ }
26794
+
26795
+ //****************************************************************************
26796
+ // RESOLVER for Content Source Params
26797
+ //****************************************************************************
26798
+ @ObjectType()
26799
+ export class RunContentSourceParamViewResult {
26800
+ @Field(() => [ContentSourceParam_])
26801
+ Results: ContentSourceParam_[];
26802
+
26803
+ @Field(() => String, {nullable: true})
26804
+ UserViewRunID?: string;
26805
+
26806
+ @Field(() => Int, {nullable: true})
26807
+ RowCount: number;
26808
+
26809
+ @Field(() => Int, {nullable: true})
26810
+ TotalRowCount: number;
26811
+
26812
+ @Field(() => Int, {nullable: true})
26813
+ ExecutionTime: number;
26814
+
26815
+ @Field({nullable: true})
26816
+ ErrorMessage?: string;
26817
+
26818
+ @Field(() => Boolean, {nullable: false})
26819
+ Success: boolean;
26820
+ }
26821
+
26822
+ @Resolver(ContentSourceParam_)
26823
+ export class ContentSourceParamResolver extends ResolverBase {
26824
+ @Query(() => RunContentSourceParamViewResult)
26825
+ async RunContentSourceParamViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
26826
+ return super.RunViewByIDGeneric(input, dataSource, userPayload, pubSub);
26827
+ }
26828
+
26829
+ @Query(() => RunContentSourceParamViewResult)
26830
+ async RunContentSourceParamViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
26831
+ return super.RunViewByNameGeneric(input, dataSource, userPayload, pubSub);
26832
+ }
26833
+
26834
+ @Query(() => RunContentSourceParamViewResult)
26835
+ async RunContentSourceParamDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
26836
+ input.EntityName = 'Content Source Params';
26837
+ return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
26838
+ }
26839
+ @Query(() => ContentSourceParam_, { nullable: true })
26840
+ async ContentSourceParam(@Arg('ID', () => String) ID: string, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<ContentSourceParam_ | null> {
26841
+ this.CheckUserReadPermissions('Content Source Params', userPayload);
26842
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwContentSourceParams] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause('Content Source Params', userPayload, EntityPermissionType.Read, 'AND');
26843
+ const result = this.MapFieldNamesToCodeNames('Content Source Params', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
26844
+ return result;
26845
+ }
26846
+
26847
+ @Mutation(() => ContentSourceParam_)
26848
+ async CreateContentSourceParam(
26849
+ @Arg('input', () => CreateContentSourceParamInput) input: CreateContentSourceParamInput,
26850
+ @Ctx() { dataSource, userPayload }: AppContext,
26851
+ @PubSub() pubSub: PubSubEngine
26852
+ ) {
26853
+ return this.CreateRecord('Content Source Params', input, dataSource, userPayload, pubSub)
26854
+ }
26855
+
26856
+ @Mutation(() => ContentSourceParam_)
26857
+ async UpdateContentSourceParam(
26858
+ @Arg('input', () => UpdateContentSourceParamInput) input: UpdateContentSourceParamInput,
26859
+ @Ctx() { dataSource, userPayload }: AppContext,
26860
+ @PubSub() pubSub: PubSubEngine
26861
+ ) {
26862
+ return this.UpdateRecord('Content Source Params', input, dataSource, userPayload, pubSub);
26863
+ }
26864
+
26865
+ @Mutation(() => ContentSourceParam_)
26866
+ async DeleteContentSourceParam(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
26867
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
26868
+ return this.DeleteRecord('Content Source Params', key, options, dataSource, userPayload, pubSub);
26869
+ }
26870
+
26871
+ }
26872
+
26873
+ //****************************************************************************
26874
+ // ENTITY CLASS for Content Source Types
26875
+ //****************************************************************************
26876
+ @ObjectType()
26877
+ export class ContentSourceType_ {
26878
+ @Field()
26879
+ @MaxLength(16)
26880
+ ID: string;
26881
+
26882
+ @Field()
26883
+ @MaxLength(510)
26884
+ Name: string;
26885
+
26886
+ @Field({nullable: true})
26887
+ @MaxLength(2000)
26888
+ Description?: string;
26889
+
26890
+ @Field()
26891
+ @MaxLength(10)
26892
+ _mj__CreatedAt: Date;
26893
+
26894
+ @Field()
26895
+ @MaxLength(10)
26896
+ _mj__UpdatedAt: Date;
26897
+
26898
+ @Field(() => [ContentSource_])
26899
+ ContentSources_ContentSourceTypeIDArray: ContentSource_[]; // Link to ContentSources
26900
+
26901
+ @Field(() => [ContentItem_])
26902
+ ContentItems_ContentSourceTypeIDArray: ContentItem_[]; // Link to ContentItems
26903
+
26904
+ }
26905
+
26906
+ //****************************************************************************
26907
+ // INPUT TYPE for Content Source Types
26908
+ //****************************************************************************
26909
+ @InputType()
26910
+ export class CreateContentSourceTypeInput {
26911
+ @Field()
26912
+ Name: string;
26913
+
26914
+ @Field({ nullable: true })
26915
+ Description?: string;
26916
+ }
26917
+
26918
+
26919
+ //****************************************************************************
26920
+ // INPUT TYPE for Content Source Types
26921
+ //****************************************************************************
26922
+ @InputType()
26923
+ export class UpdateContentSourceTypeInput {
26924
+ @Field()
26925
+ ID: string;
26926
+
26927
+ @Field()
26928
+ Name: string;
26929
+
26930
+ @Field({ nullable: true })
26931
+ Description?: string;
26932
+
26933
+ @Field(() => [KeyValuePairInput], { nullable: true })
26934
+ OldValues___?: KeyValuePairInput[];
26935
+ }
26936
+
26937
+ //****************************************************************************
26938
+ // RESOLVER for Content Source Types
26939
+ //****************************************************************************
26940
+ @ObjectType()
26941
+ export class RunContentSourceTypeViewResult {
26942
+ @Field(() => [ContentSourceType_])
26943
+ Results: ContentSourceType_[];
26944
+
26945
+ @Field(() => String, {nullable: true})
26946
+ UserViewRunID?: string;
26947
+
26948
+ @Field(() => Int, {nullable: true})
26949
+ RowCount: number;
26950
+
26951
+ @Field(() => Int, {nullable: true})
26952
+ TotalRowCount: number;
26953
+
26954
+ @Field(() => Int, {nullable: true})
26955
+ ExecutionTime: number;
26956
+
26957
+ @Field({nullable: true})
26958
+ ErrorMessage?: string;
26959
+
26960
+ @Field(() => Boolean, {nullable: false})
26961
+ Success: boolean;
26962
+ }
26963
+
26964
+ @Resolver(ContentSourceType_)
26965
+ export class ContentSourceTypeResolver extends ResolverBase {
26966
+ @Query(() => RunContentSourceTypeViewResult)
26967
+ async RunContentSourceTypeViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
26968
+ return super.RunViewByIDGeneric(input, dataSource, userPayload, pubSub);
26969
+ }
26970
+
26971
+ @Query(() => RunContentSourceTypeViewResult)
26972
+ async RunContentSourceTypeViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
26973
+ return super.RunViewByNameGeneric(input, dataSource, userPayload, pubSub);
26974
+ }
26975
+
26976
+ @Query(() => RunContentSourceTypeViewResult)
26977
+ async RunContentSourceTypeDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
26978
+ input.EntityName = 'Content Source Types';
26979
+ return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
26980
+ }
26981
+ @Query(() => ContentSourceType_, { nullable: true })
26982
+ async ContentSourceType(@Arg('ID', () => String) ID: string, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<ContentSourceType_ | null> {
26983
+ this.CheckUserReadPermissions('Content Source Types', userPayload);
26984
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwContentSourceTypes] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause('Content Source Types', userPayload, EntityPermissionType.Read, 'AND');
26985
+ const result = this.MapFieldNamesToCodeNames('Content Source Types', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
26986
+ return result;
26987
+ }
26988
+
26989
+ @FieldResolver(() => [ContentSource_])
26990
+ async ContentSources_ContentSourceTypeIDArray(@Root() contentsourcetype_: ContentSourceType_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
26991
+ this.CheckUserReadPermissions('Content Sources', userPayload);
26992
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwContentSources] WHERE [ContentSourceTypeID]='${contentsourcetype_.ID}' ` + this.getRowLevelSecurityWhereClause('Content Sources', userPayload, EntityPermissionType.Read, 'AND');
26993
+ const result = this.ArrayMapFieldNamesToCodeNames('Content Sources', await dataSource.query(sSQL));
26994
+ return result;
26995
+ }
26996
+
26997
+ @FieldResolver(() => [ContentItem_])
26998
+ async ContentItems_ContentSourceTypeIDArray(@Root() contentsourcetype_: ContentSourceType_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
26999
+ this.CheckUserReadPermissions('Content Items', userPayload);
27000
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwContentItems] WHERE [ContentSourceTypeID]='${contentsourcetype_.ID}' ` + this.getRowLevelSecurityWhereClause('Content Items', userPayload, EntityPermissionType.Read, 'AND');
27001
+ const result = this.ArrayMapFieldNamesToCodeNames('Content Items', await dataSource.query(sSQL));
27002
+ return result;
27003
+ }
27004
+
27005
+ @Mutation(() => ContentSourceType_)
27006
+ async CreateContentSourceType(
27007
+ @Arg('input', () => CreateContentSourceTypeInput) input: CreateContentSourceTypeInput,
27008
+ @Ctx() { dataSource, userPayload }: AppContext,
27009
+ @PubSub() pubSub: PubSubEngine
27010
+ ) {
27011
+ return this.CreateRecord('Content Source Types', input, dataSource, userPayload, pubSub)
27012
+ }
27013
+
27014
+ @Mutation(() => ContentSourceType_)
27015
+ async UpdateContentSourceType(
27016
+ @Arg('input', () => UpdateContentSourceTypeInput) input: UpdateContentSourceTypeInput,
27017
+ @Ctx() { dataSource, userPayload }: AppContext,
27018
+ @PubSub() pubSub: PubSubEngine
27019
+ ) {
27020
+ return this.UpdateRecord('Content Source Types', input, dataSource, userPayload, pubSub);
27021
+ }
27022
+
27023
+ @Mutation(() => ContentSourceType_)
27024
+ async DeleteContentSourceType(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27025
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
27026
+ return this.DeleteRecord('Content Source Types', key, options, dataSource, userPayload, pubSub);
27027
+ }
27028
+
27029
+ }
27030
+
27031
+ //****************************************************************************
27032
+ // ENTITY CLASS for Content Source Type Params
27033
+ //****************************************************************************
27034
+ @ObjectType()
27035
+ export class ContentSourceTypeParam_ {
27036
+ @Field()
27037
+ @MaxLength(16)
27038
+ ID: string;
27039
+
27040
+ @Field()
27041
+ @MaxLength(200)
27042
+ Name: string;
27043
+
27044
+ @Field({nullable: true})
27045
+ Description?: string;
27046
+
27047
+ @Field({nullable: true})
27048
+ @MaxLength(100)
27049
+ Type?: string;
27050
+
27051
+ @Field({nullable: true})
27052
+ DefaultValue?: string;
27053
+
27054
+ @Field(() => Boolean)
27055
+ IsRequired: boolean;
27056
+
27057
+ @Field()
27058
+ @MaxLength(10)
27059
+ _mj__CreatedAt: Date;
27060
+
27061
+ @Field()
27062
+ @MaxLength(10)
27063
+ _mj__UpdatedAt: Date;
27064
+
27065
+ }
27066
+
27067
+ //****************************************************************************
27068
+ // INPUT TYPE for Content Source Type Params
27069
+ //****************************************************************************
27070
+ @InputType()
27071
+ export class CreateContentSourceTypeParamInput {
27072
+ @Field()
27073
+ Name: string;
27074
+
27075
+ @Field({ nullable: true })
27076
+ Description?: string;
27077
+
27078
+ @Field({ nullable: true })
27079
+ Type?: string;
27080
+
27081
+ @Field({ nullable: true })
27082
+ DefaultValue?: string;
27083
+
27084
+ @Field(() => Boolean)
27085
+ IsRequired: boolean;
27086
+ }
27087
+
27088
+
27089
+ //****************************************************************************
27090
+ // INPUT TYPE for Content Source Type Params
27091
+ //****************************************************************************
27092
+ @InputType()
27093
+ export class UpdateContentSourceTypeParamInput {
27094
+ @Field()
27095
+ ID: string;
27096
+
27097
+ @Field()
27098
+ Name: string;
27099
+
27100
+ @Field({ nullable: true })
27101
+ Description?: string;
27102
+
27103
+ @Field({ nullable: true })
27104
+ Type?: string;
27105
+
27106
+ @Field({ nullable: true })
27107
+ DefaultValue?: string;
27108
+
27109
+ @Field(() => Boolean)
27110
+ IsRequired: boolean;
27111
+
27112
+ @Field(() => [KeyValuePairInput], { nullable: true })
27113
+ OldValues___?: KeyValuePairInput[];
27114
+ }
27115
+
27116
+ //****************************************************************************
27117
+ // RESOLVER for Content Source Type Params
27118
+ //****************************************************************************
27119
+ @ObjectType()
27120
+ export class RunContentSourceTypeParamViewResult {
27121
+ @Field(() => [ContentSourceTypeParam_])
27122
+ Results: ContentSourceTypeParam_[];
27123
+
27124
+ @Field(() => String, {nullable: true})
27125
+ UserViewRunID?: string;
27126
+
27127
+ @Field(() => Int, {nullable: true})
27128
+ RowCount: number;
27129
+
27130
+ @Field(() => Int, {nullable: true})
27131
+ TotalRowCount: number;
27132
+
27133
+ @Field(() => Int, {nullable: true})
27134
+ ExecutionTime: number;
27135
+
27136
+ @Field({nullable: true})
27137
+ ErrorMessage?: string;
27138
+
27139
+ @Field(() => Boolean, {nullable: false})
27140
+ Success: boolean;
27141
+ }
27142
+
27143
+ @Resolver(ContentSourceTypeParam_)
27144
+ export class ContentSourceTypeParamResolver extends ResolverBase {
27145
+ @Query(() => RunContentSourceTypeParamViewResult)
27146
+ async RunContentSourceTypeParamViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27147
+ return super.RunViewByIDGeneric(input, dataSource, userPayload, pubSub);
27148
+ }
27149
+
27150
+ @Query(() => RunContentSourceTypeParamViewResult)
27151
+ async RunContentSourceTypeParamViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27152
+ return super.RunViewByNameGeneric(input, dataSource, userPayload, pubSub);
27153
+ }
27154
+
27155
+ @Query(() => RunContentSourceTypeParamViewResult)
27156
+ async RunContentSourceTypeParamDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27157
+ input.EntityName = 'Content Source Type Params';
27158
+ return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
27159
+ }
27160
+ @Query(() => ContentSourceTypeParam_, { nullable: true })
27161
+ async ContentSourceTypeParam(@Arg('ID', () => String) ID: string, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<ContentSourceTypeParam_ | null> {
27162
+ this.CheckUserReadPermissions('Content Source Type Params', userPayload);
27163
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwContentSourceTypeParams] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause('Content Source Type Params', userPayload, EntityPermissionType.Read, 'AND');
27164
+ const result = this.MapFieldNamesToCodeNames('Content Source Type Params', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
27165
+ return result;
27166
+ }
27167
+
27168
+ @Mutation(() => ContentSourceTypeParam_)
27169
+ async CreateContentSourceTypeParam(
27170
+ @Arg('input', () => CreateContentSourceTypeParamInput) input: CreateContentSourceTypeParamInput,
27171
+ @Ctx() { dataSource, userPayload }: AppContext,
27172
+ @PubSub() pubSub: PubSubEngine
27173
+ ) {
27174
+ return this.CreateRecord('Content Source Type Params', input, dataSource, userPayload, pubSub)
27175
+ }
27176
+
27177
+ @Mutation(() => ContentSourceTypeParam_)
27178
+ async UpdateContentSourceTypeParam(
27179
+ @Arg('input', () => UpdateContentSourceTypeParamInput) input: UpdateContentSourceTypeParamInput,
27180
+ @Ctx() { dataSource, userPayload }: AppContext,
27181
+ @PubSub() pubSub: PubSubEngine
27182
+ ) {
27183
+ return this.UpdateRecord('Content Source Type Params', input, dataSource, userPayload, pubSub);
27184
+ }
27185
+
27186
+ @Mutation(() => ContentSourceTypeParam_)
27187
+ async DeleteContentSourceTypeParam(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27188
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
27189
+ return this.DeleteRecord('Content Source Type Params', key, options, dataSource, userPayload, pubSub);
27190
+ }
27191
+
27192
+ }
27193
+
27194
+ //****************************************************************************
27195
+ // ENTITY CLASS for Content Types
27196
+ //****************************************************************************
27197
+ @ObjectType()
27198
+ export class ContentType_ {
27199
+ @Field()
27200
+ @MaxLength(16)
27201
+ ID: string;
27202
+
27203
+ @Field()
27204
+ @MaxLength(510)
27205
+ Name: string;
27206
+
27207
+ @Field({nullable: true})
27208
+ Description?: string;
27209
+
27210
+ @Field()
27211
+ @MaxLength(16)
27212
+ AIModelID: string;
27213
+
27214
+ @Field(() => Int)
27215
+ MinTags: number;
27216
+
27217
+ @Field(() => Int)
27218
+ MaxTags: number;
27219
+
27220
+ @Field()
27221
+ @MaxLength(10)
27222
+ _mj__CreatedAt: Date;
27223
+
27224
+ @Field()
27225
+ @MaxLength(10)
27226
+ _mj__UpdatedAt: Date;
27227
+
27228
+ @Field()
27229
+ @MaxLength(100)
27230
+ AIModel: string;
27231
+
27232
+ @Field(() => [ContentSource_])
27233
+ ContentSources_ContentTypeIDArray: ContentSource_[]; // Link to ContentSources
27234
+
27235
+ @Field(() => [ContentItem_])
27236
+ ContentItems_ContentTypeIDArray: ContentItem_[]; // Link to ContentItems
27237
+
27238
+ }
27239
+
27240
+ //****************************************************************************
27241
+ // INPUT TYPE for Content Types
27242
+ //****************************************************************************
27243
+ @InputType()
27244
+ export class CreateContentTypeInput {
27245
+ @Field()
27246
+ Name: string;
27247
+
27248
+ @Field({ nullable: true })
27249
+ Description?: string;
27250
+
27251
+ @Field()
27252
+ AIModelID: string;
27253
+
27254
+ @Field(() => Int)
27255
+ MinTags: number;
27256
+
27257
+ @Field(() => Int)
27258
+ MaxTags: number;
27259
+ }
27260
+
27261
+
27262
+ //****************************************************************************
27263
+ // INPUT TYPE for Content Types
27264
+ //****************************************************************************
27265
+ @InputType()
27266
+ export class UpdateContentTypeInput {
27267
+ @Field()
27268
+ ID: string;
27269
+
27270
+ @Field()
27271
+ Name: string;
27272
+
27273
+ @Field({ nullable: true })
27274
+ Description?: string;
27275
+
27276
+ @Field()
27277
+ AIModelID: string;
27278
+
27279
+ @Field(() => Int)
27280
+ MinTags: number;
27281
+
27282
+ @Field(() => Int)
27283
+ MaxTags: number;
27284
+
27285
+ @Field(() => [KeyValuePairInput], { nullable: true })
27286
+ OldValues___?: KeyValuePairInput[];
27287
+ }
27288
+
27289
+ //****************************************************************************
27290
+ // RESOLVER for Content Types
27291
+ //****************************************************************************
27292
+ @ObjectType()
27293
+ export class RunContentTypeViewResult {
27294
+ @Field(() => [ContentType_])
27295
+ Results: ContentType_[];
27296
+
27297
+ @Field(() => String, {nullable: true})
27298
+ UserViewRunID?: string;
27299
+
27300
+ @Field(() => Int, {nullable: true})
27301
+ RowCount: number;
27302
+
27303
+ @Field(() => Int, {nullable: true})
27304
+ TotalRowCount: number;
27305
+
27306
+ @Field(() => Int, {nullable: true})
27307
+ ExecutionTime: number;
27308
+
27309
+ @Field({nullable: true})
27310
+ ErrorMessage?: string;
27311
+
27312
+ @Field(() => Boolean, {nullable: false})
27313
+ Success: boolean;
27314
+ }
27315
+
27316
+ @Resolver(ContentType_)
27317
+ export class ContentTypeResolver extends ResolverBase {
27318
+ @Query(() => RunContentTypeViewResult)
27319
+ async RunContentTypeViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27320
+ return super.RunViewByIDGeneric(input, dataSource, userPayload, pubSub);
27321
+ }
27322
+
27323
+ @Query(() => RunContentTypeViewResult)
27324
+ async RunContentTypeViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27325
+ return super.RunViewByNameGeneric(input, dataSource, userPayload, pubSub);
27326
+ }
27327
+
27328
+ @Query(() => RunContentTypeViewResult)
27329
+ async RunContentTypeDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27330
+ input.EntityName = 'Content Types';
27331
+ return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
27332
+ }
27333
+ @Query(() => ContentType_, { nullable: true })
27334
+ async ContentType(@Arg('ID', () => String) ID: string, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<ContentType_ | null> {
27335
+ this.CheckUserReadPermissions('Content Types', userPayload);
27336
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwContentTypes] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause('Content Types', userPayload, EntityPermissionType.Read, 'AND');
27337
+ const result = this.MapFieldNamesToCodeNames('Content Types', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
27338
+ return result;
27339
+ }
27340
+
27341
+ @FieldResolver(() => [ContentSource_])
27342
+ async ContentSources_ContentTypeIDArray(@Root() contenttype_: ContentType_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27343
+ this.CheckUserReadPermissions('Content Sources', userPayload);
27344
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwContentSources] WHERE [ContentTypeID]='${contenttype_.ID}' ` + this.getRowLevelSecurityWhereClause('Content Sources', userPayload, EntityPermissionType.Read, 'AND');
27345
+ const result = this.ArrayMapFieldNamesToCodeNames('Content Sources', await dataSource.query(sSQL));
27346
+ return result;
27347
+ }
27348
+
27349
+ @FieldResolver(() => [ContentItem_])
27350
+ async ContentItems_ContentTypeIDArray(@Root() contenttype_: ContentType_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27351
+ this.CheckUserReadPermissions('Content Items', userPayload);
27352
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwContentItems] WHERE [ContentTypeID]='${contenttype_.ID}' ` + this.getRowLevelSecurityWhereClause('Content Items', userPayload, EntityPermissionType.Read, 'AND');
27353
+ const result = this.ArrayMapFieldNamesToCodeNames('Content Items', await dataSource.query(sSQL));
27354
+ return result;
27355
+ }
27356
+
27357
+ @Mutation(() => ContentType_)
27358
+ async CreateContentType(
27359
+ @Arg('input', () => CreateContentTypeInput) input: CreateContentTypeInput,
27360
+ @Ctx() { dataSource, userPayload }: AppContext,
27361
+ @PubSub() pubSub: PubSubEngine
27362
+ ) {
27363
+ return this.CreateRecord('Content Types', input, dataSource, userPayload, pubSub)
27364
+ }
27365
+
27366
+ @Mutation(() => ContentType_)
27367
+ async UpdateContentType(
27368
+ @Arg('input', () => UpdateContentTypeInput) input: UpdateContentTypeInput,
27369
+ @Ctx() { dataSource, userPayload }: AppContext,
27370
+ @PubSub() pubSub: PubSubEngine
27371
+ ) {
27372
+ return this.UpdateRecord('Content Types', input, dataSource, userPayload, pubSub);
27373
+ }
27374
+
27375
+ @Mutation(() => ContentType_)
27376
+ async DeleteContentType(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27377
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
27378
+ return this.DeleteRecord('Content Types', key, options, dataSource, userPayload, pubSub);
27379
+ }
27380
+
27381
+ }
27382
+
27383
+ //****************************************************************************
27384
+ // ENTITY CLASS for Content Type Attributes
27385
+ //****************************************************************************
27386
+ @ObjectType()
27387
+ export class ContentTypeAttribute_ {
27388
+ @Field()
27389
+ @MaxLength(16)
27390
+ ID: string;
27391
+
27392
+ @Field()
27393
+ @MaxLength(16)
27394
+ ContentTypeID: string;
27395
+
27396
+ @Field()
27397
+ @MaxLength(200)
27398
+ Name: string;
27399
+
27400
+ @Field()
27401
+ Prompt: string;
27402
+
27403
+ @Field({nullable: true})
27404
+ Description?: string;
27405
+
27406
+ @Field()
27407
+ @MaxLength(10)
27408
+ _mj__CreatedAt: Date;
27409
+
27410
+ @Field()
27411
+ @MaxLength(10)
27412
+ _mj__UpdatedAt: Date;
27413
+
27414
+ }
27415
+
27416
+ //****************************************************************************
27417
+ // INPUT TYPE for Content Type Attributes
27418
+ //****************************************************************************
27419
+ @InputType()
27420
+ export class CreateContentTypeAttributeInput {
27421
+ @Field()
27422
+ ContentTypeID: string;
27423
+
27424
+ @Field()
27425
+ Name: string;
27426
+
27427
+ @Field()
27428
+ Prompt: string;
27429
+
27430
+ @Field({ nullable: true })
27431
+ Description?: string;
27432
+ }
27433
+
27434
+
27435
+ //****************************************************************************
27436
+ // INPUT TYPE for Content Type Attributes
27437
+ //****************************************************************************
27438
+ @InputType()
27439
+ export class UpdateContentTypeAttributeInput {
27440
+ @Field()
27441
+ ID: string;
27442
+
27443
+ @Field()
27444
+ ContentTypeID: string;
27445
+
27446
+ @Field()
27447
+ Name: string;
27448
+
27449
+ @Field()
27450
+ Prompt: string;
27451
+
27452
+ @Field({ nullable: true })
27453
+ Description?: string;
27454
+
27455
+ @Field(() => [KeyValuePairInput], { nullable: true })
27456
+ OldValues___?: KeyValuePairInput[];
27457
+ }
27458
+
27459
+ //****************************************************************************
27460
+ // RESOLVER for Content Type Attributes
27461
+ //****************************************************************************
27462
+ @ObjectType()
27463
+ export class RunContentTypeAttributeViewResult {
27464
+ @Field(() => [ContentTypeAttribute_])
27465
+ Results: ContentTypeAttribute_[];
27466
+
27467
+ @Field(() => String, {nullable: true})
27468
+ UserViewRunID?: string;
27469
+
27470
+ @Field(() => Int, {nullable: true})
27471
+ RowCount: number;
27472
+
27473
+ @Field(() => Int, {nullable: true})
27474
+ TotalRowCount: number;
27475
+
27476
+ @Field(() => Int, {nullable: true})
27477
+ ExecutionTime: number;
27478
+
27479
+ @Field({nullable: true})
27480
+ ErrorMessage?: string;
27481
+
27482
+ @Field(() => Boolean, {nullable: false})
27483
+ Success: boolean;
27484
+ }
27485
+
27486
+ @Resolver(ContentTypeAttribute_)
27487
+ export class ContentTypeAttributeResolver extends ResolverBase {
27488
+ @Query(() => RunContentTypeAttributeViewResult)
27489
+ async RunContentTypeAttributeViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27490
+ return super.RunViewByIDGeneric(input, dataSource, userPayload, pubSub);
27491
+ }
27492
+
27493
+ @Query(() => RunContentTypeAttributeViewResult)
27494
+ async RunContentTypeAttributeViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27495
+ return super.RunViewByNameGeneric(input, dataSource, userPayload, pubSub);
27496
+ }
27497
+
27498
+ @Query(() => RunContentTypeAttributeViewResult)
27499
+ async RunContentTypeAttributeDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27500
+ input.EntityName = 'Content Type Attributes';
27501
+ return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
27502
+ }
27503
+ @Query(() => ContentTypeAttribute_, { nullable: true })
27504
+ async ContentTypeAttribute(@Arg('ID', () => String) ID: string, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<ContentTypeAttribute_ | null> {
27505
+ this.CheckUserReadPermissions('Content Type Attributes', userPayload);
27506
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwContentTypeAttributes] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause('Content Type Attributes', userPayload, EntityPermissionType.Read, 'AND');
27507
+ const result = this.MapFieldNamesToCodeNames('Content Type Attributes', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
27508
+ return result;
27509
+ }
27510
+
27511
+ @Mutation(() => ContentTypeAttribute_)
27512
+ async CreateContentTypeAttribute(
27513
+ @Arg('input', () => CreateContentTypeAttributeInput) input: CreateContentTypeAttributeInput,
27514
+ @Ctx() { dataSource, userPayload }: AppContext,
27515
+ @PubSub() pubSub: PubSubEngine
27516
+ ) {
27517
+ return this.CreateRecord('Content Type Attributes', input, dataSource, userPayload, pubSub)
27518
+ }
27519
+
27520
+ @Mutation(() => ContentTypeAttribute_)
27521
+ async UpdateContentTypeAttribute(
27522
+ @Arg('input', () => UpdateContentTypeAttributeInput) input: UpdateContentTypeAttributeInput,
27523
+ @Ctx() { dataSource, userPayload }: AppContext,
27524
+ @PubSub() pubSub: PubSubEngine
27525
+ ) {
27526
+ return this.UpdateRecord('Content Type Attributes', input, dataSource, userPayload, pubSub);
27527
+ }
27528
+
27529
+ @Mutation(() => ContentTypeAttribute_)
27530
+ async DeleteContentTypeAttribute(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27531
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
27532
+ return this.DeleteRecord('Content Type Attributes', key, options, dataSource, userPayload, pubSub);
27533
+ }
27534
+
27535
+ }
27536
+
27537
+ //****************************************************************************
27538
+ // ENTITY CLASS for Content File Types
27539
+ //****************************************************************************
27540
+ @ObjectType()
27541
+ export class ContentFileType_ {
27542
+ @Field()
27543
+ @MaxLength(16)
27544
+ ID: string;
27545
+
27546
+ @Field()
27547
+ @MaxLength(510)
27548
+ Name: string;
27549
+
27550
+ @Field({nullable: true})
27551
+ @MaxLength(510)
27552
+ FileExtension?: string;
27553
+
27554
+ @Field()
27555
+ @MaxLength(10)
27556
+ _mj__CreatedAt: Date;
27557
+
27558
+ @Field()
27559
+ @MaxLength(10)
27560
+ _mj__UpdatedAt: Date;
27561
+
27562
+ @Field(() => [ContentSource_])
27563
+ ContentSources_ContentFileTypeIDArray: ContentSource_[]; // Link to ContentSources
27564
+
27565
+ @Field(() => [ContentItem_])
27566
+ ContentItems_ContentFileTypeIDArray: ContentItem_[]; // Link to ContentItems
27567
+
27568
+ }
27569
+
27570
+ //****************************************************************************
27571
+ // INPUT TYPE for Content File Types
27572
+ //****************************************************************************
27573
+ @InputType()
27574
+ export class CreateContentFileTypeInput {
27575
+ @Field()
27576
+ Name: string;
27577
+
27578
+ @Field({ nullable: true })
27579
+ FileExtension?: string;
27580
+ }
27581
+
27582
+
27583
+ //****************************************************************************
27584
+ // INPUT TYPE for Content File Types
27585
+ //****************************************************************************
27586
+ @InputType()
27587
+ export class UpdateContentFileTypeInput {
27588
+ @Field()
27589
+ ID: string;
27590
+
27591
+ @Field()
27592
+ Name: string;
27593
+
27594
+ @Field({ nullable: true })
27595
+ FileExtension?: string;
27596
+
27597
+ @Field(() => [KeyValuePairInput], { nullable: true })
27598
+ OldValues___?: KeyValuePairInput[];
27599
+ }
27600
+
27601
+ //****************************************************************************
27602
+ // RESOLVER for Content File Types
27603
+ //****************************************************************************
27604
+ @ObjectType()
27605
+ export class RunContentFileTypeViewResult {
27606
+ @Field(() => [ContentFileType_])
27607
+ Results: ContentFileType_[];
27608
+
27609
+ @Field(() => String, {nullable: true})
27610
+ UserViewRunID?: string;
27611
+
27612
+ @Field(() => Int, {nullable: true})
27613
+ RowCount: number;
27614
+
27615
+ @Field(() => Int, {nullable: true})
27616
+ TotalRowCount: number;
27617
+
27618
+ @Field(() => Int, {nullable: true})
27619
+ ExecutionTime: number;
27620
+
27621
+ @Field({nullable: true})
27622
+ ErrorMessage?: string;
27623
+
27624
+ @Field(() => Boolean, {nullable: false})
27625
+ Success: boolean;
27626
+ }
27627
+
27628
+ @Resolver(ContentFileType_)
27629
+ export class ContentFileTypeResolver extends ResolverBase {
27630
+ @Query(() => RunContentFileTypeViewResult)
27631
+ async RunContentFileTypeViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27632
+ return super.RunViewByIDGeneric(input, dataSource, userPayload, pubSub);
27633
+ }
27634
+
27635
+ @Query(() => RunContentFileTypeViewResult)
27636
+ async RunContentFileTypeViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27637
+ return super.RunViewByNameGeneric(input, dataSource, userPayload, pubSub);
27638
+ }
27639
+
27640
+ @Query(() => RunContentFileTypeViewResult)
27641
+ async RunContentFileTypeDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27642
+ input.EntityName = 'Content File Types';
27643
+ return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
27644
+ }
27645
+ @Query(() => ContentFileType_, { nullable: true })
27646
+ async ContentFileType(@Arg('ID', () => String) ID: string, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<ContentFileType_ | null> {
27647
+ this.CheckUserReadPermissions('Content File Types', userPayload);
27648
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwContentFileTypes] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause('Content File Types', userPayload, EntityPermissionType.Read, 'AND');
27649
+ const result = this.MapFieldNamesToCodeNames('Content File Types', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
27650
+ return result;
27651
+ }
27652
+
27653
+ @FieldResolver(() => [ContentSource_])
27654
+ async ContentSources_ContentFileTypeIDArray(@Root() contentfiletype_: ContentFileType_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27655
+ this.CheckUserReadPermissions('Content Sources', userPayload);
27656
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwContentSources] WHERE [ContentFileTypeID]='${contentfiletype_.ID}' ` + this.getRowLevelSecurityWhereClause('Content Sources', userPayload, EntityPermissionType.Read, 'AND');
27657
+ const result = this.ArrayMapFieldNamesToCodeNames('Content Sources', await dataSource.query(sSQL));
27658
+ return result;
27659
+ }
27660
+
27661
+ @FieldResolver(() => [ContentItem_])
27662
+ async ContentItems_ContentFileTypeIDArray(@Root() contentfiletype_: ContentFileType_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27663
+ this.CheckUserReadPermissions('Content Items', userPayload);
27664
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwContentItems] WHERE [ContentFileTypeID]='${contentfiletype_.ID}' ` + this.getRowLevelSecurityWhereClause('Content Items', userPayload, EntityPermissionType.Read, 'AND');
27665
+ const result = this.ArrayMapFieldNamesToCodeNames('Content Items', await dataSource.query(sSQL));
27666
+ return result;
27667
+ }
27668
+
27669
+ @Mutation(() => ContentFileType_)
27670
+ async CreateContentFileType(
27671
+ @Arg('input', () => CreateContentFileTypeInput) input: CreateContentFileTypeInput,
27672
+ @Ctx() { dataSource, userPayload }: AppContext,
27673
+ @PubSub() pubSub: PubSubEngine
27674
+ ) {
27675
+ return this.CreateRecord('Content File Types', input, dataSource, userPayload, pubSub)
27676
+ }
27677
+
27678
+ @Mutation(() => ContentFileType_)
27679
+ async UpdateContentFileType(
27680
+ @Arg('input', () => UpdateContentFileTypeInput) input: UpdateContentFileTypeInput,
27681
+ @Ctx() { dataSource, userPayload }: AppContext,
27682
+ @PubSub() pubSub: PubSubEngine
27683
+ ) {
27684
+ return this.UpdateRecord('Content File Types', input, dataSource, userPayload, pubSub);
27685
+ }
27686
+
27687
+ @Mutation(() => ContentFileType_)
27688
+ async DeleteContentFileType(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27689
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
27690
+ return this.DeleteRecord('Content File Types', key, options, dataSource, userPayload, pubSub);
27691
+ }
27692
+
27693
+ }
27694
+
27695
+ //****************************************************************************
27696
+ // ENTITY CLASS for Content Items
27697
+ //****************************************************************************
27698
+ @ObjectType()
27699
+ export class ContentItem_ {
27700
+ @Field()
27701
+ @MaxLength(16)
27702
+ ID: string;
27703
+
27704
+ @Field()
27705
+ @MaxLength(16)
27706
+ ContentSourceID: string;
27707
+
27708
+ @Field({nullable: true})
27709
+ @MaxLength(500)
27710
+ Name?: string;
27711
+
27712
+ @Field({nullable: true})
27713
+ Description?: string;
27714
+
27715
+ @Field()
27716
+ @MaxLength(16)
27717
+ ContentTypeID: string;
27718
+
27719
+ @Field()
27720
+ @MaxLength(16)
27721
+ ContentSourceTypeID: string;
27722
+
27723
+ @Field()
27724
+ @MaxLength(16)
27725
+ ContentFileTypeID: string;
27726
+
27727
+ @Field({nullable: true})
27728
+ @MaxLength(200)
27729
+ Checksum?: string;
27730
+
27731
+ @Field()
27732
+ @MaxLength(4000)
27733
+ URL: string;
27734
+
27735
+ @Field({nullable: true})
27736
+ Text?: string;
27737
+
27738
+ @Field()
27739
+ @MaxLength(10)
27740
+ _mj__CreatedAt: Date;
27741
+
27742
+ @Field()
27743
+ @MaxLength(10)
27744
+ _mj__UpdatedAt: Date;
27745
+
27746
+ @Field({nullable: true})
27747
+ @MaxLength(510)
27748
+ ContentSource?: string;
27749
+
27750
+ @Field()
27751
+ @MaxLength(510)
27752
+ ContentType: string;
27753
+
27754
+ @Field()
27755
+ @MaxLength(510)
27756
+ ContentSourceType: string;
27757
+
27758
+ @Field()
27759
+ @MaxLength(510)
27760
+ ContentFileType: string;
27761
+
27762
+ @Field(() => [ContentItemAttribute_])
27763
+ ContentItemAttributes_ContentItemIDArray: ContentItemAttribute_[]; // Link to ContentItemAttributes
27764
+
27765
+ @Field(() => [ContentItemTag_])
27766
+ ContentItemTags_ItemIDArray: ContentItemTag_[]; // Link to ContentItemTags
27767
+
27768
+ }
27769
+
27770
+ //****************************************************************************
27771
+ // INPUT TYPE for Content Items
27772
+ //****************************************************************************
27773
+ @InputType()
27774
+ export class CreateContentItemInput {
27775
+ @Field()
27776
+ ContentSourceID: string;
27777
+
27778
+ @Field({ nullable: true })
27779
+ Name?: string;
27780
+
27781
+ @Field({ nullable: true })
27782
+ Description?: string;
27783
+
27784
+ @Field()
27785
+ ContentTypeID: string;
27786
+
27787
+ @Field()
27788
+ ContentSourceTypeID: string;
27789
+
27790
+ @Field()
27791
+ ContentFileTypeID: string;
27792
+
27793
+ @Field({ nullable: true })
27794
+ Checksum?: string;
27795
+
27796
+ @Field()
27797
+ URL: string;
27798
+
27799
+ @Field({ nullable: true })
27800
+ Text?: string;
27801
+ }
27802
+
27803
+
27804
+ //****************************************************************************
27805
+ // INPUT TYPE for Content Items
27806
+ //****************************************************************************
27807
+ @InputType()
27808
+ export class UpdateContentItemInput {
27809
+ @Field()
27810
+ ID: string;
27811
+
27812
+ @Field()
27813
+ ContentSourceID: string;
27814
+
27815
+ @Field({ nullable: true })
27816
+ Name?: string;
27817
+
27818
+ @Field({ nullable: true })
27819
+ Description?: string;
27820
+
27821
+ @Field()
27822
+ ContentTypeID: string;
27823
+
27824
+ @Field()
27825
+ ContentSourceTypeID: string;
27826
+
27827
+ @Field()
27828
+ ContentFileTypeID: string;
27829
+
27830
+ @Field({ nullable: true })
27831
+ Checksum?: string;
27832
+
27833
+ @Field()
27834
+ URL: string;
27835
+
27836
+ @Field({ nullable: true })
27837
+ Text?: string;
27838
+
27839
+ @Field(() => [KeyValuePairInput], { nullable: true })
27840
+ OldValues___?: KeyValuePairInput[];
27841
+ }
27842
+
27843
+ //****************************************************************************
27844
+ // RESOLVER for Content Items
27845
+ //****************************************************************************
27846
+ @ObjectType()
27847
+ export class RunContentItemViewResult {
27848
+ @Field(() => [ContentItem_])
27849
+ Results: ContentItem_[];
27850
+
27851
+ @Field(() => String, {nullable: true})
27852
+ UserViewRunID?: string;
27853
+
27854
+ @Field(() => Int, {nullable: true})
27855
+ RowCount: number;
27856
+
27857
+ @Field(() => Int, {nullable: true})
27858
+ TotalRowCount: number;
27859
+
27860
+ @Field(() => Int, {nullable: true})
27861
+ ExecutionTime: number;
27862
+
27863
+ @Field({nullable: true})
27864
+ ErrorMessage?: string;
27865
+
27866
+ @Field(() => Boolean, {nullable: false})
27867
+ Success: boolean;
27868
+ }
27869
+
27870
+ @Resolver(ContentItem_)
27871
+ export class ContentItemResolver extends ResolverBase {
27872
+ @Query(() => RunContentItemViewResult)
27873
+ async RunContentItemViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27874
+ return super.RunViewByIDGeneric(input, dataSource, userPayload, pubSub);
27875
+ }
27876
+
27877
+ @Query(() => RunContentItemViewResult)
27878
+ async RunContentItemViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27879
+ return super.RunViewByNameGeneric(input, dataSource, userPayload, pubSub);
27880
+ }
27881
+
27882
+ @Query(() => RunContentItemViewResult)
27883
+ async RunContentItemDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27884
+ input.EntityName = 'Content Items';
27885
+ return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
27886
+ }
27887
+ @Query(() => ContentItem_, { nullable: true })
27888
+ async ContentItem(@Arg('ID', () => String) ID: string, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<ContentItem_ | null> {
27889
+ this.CheckUserReadPermissions('Content Items', userPayload);
27890
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwContentItems] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause('Content Items', userPayload, EntityPermissionType.Read, 'AND');
27891
+ const result = this.MapFieldNamesToCodeNames('Content Items', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
27892
+ return result;
27893
+ }
27894
+
27895
+ @FieldResolver(() => [ContentItemAttribute_])
27896
+ async ContentItemAttributes_ContentItemIDArray(@Root() contentitem_: ContentItem_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27897
+ this.CheckUserReadPermissions('Content Item Attributes', userPayload);
27898
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwContentItemAttributes] WHERE [ContentItemID]='${contentitem_.ID}' ` + this.getRowLevelSecurityWhereClause('Content Item Attributes', userPayload, EntityPermissionType.Read, 'AND');
27899
+ const result = this.ArrayMapFieldNamesToCodeNames('Content Item Attributes', await dataSource.query(sSQL));
27900
+ return result;
27901
+ }
27902
+
27903
+ @FieldResolver(() => [ContentItemTag_])
27904
+ async ContentItemTags_ItemIDArray(@Root() contentitem_: ContentItem_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27905
+ this.CheckUserReadPermissions('Content Item Tags', userPayload);
27906
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwContentItemTags] WHERE [ItemID]='${contentitem_.ID}' ` + this.getRowLevelSecurityWhereClause('Content Item Tags', userPayload, EntityPermissionType.Read, 'AND');
27907
+ const result = this.ArrayMapFieldNamesToCodeNames('Content Item Tags', await dataSource.query(sSQL));
27908
+ return result;
27909
+ }
27910
+
27911
+ @Mutation(() => ContentItem_)
27912
+ async CreateContentItem(
27913
+ @Arg('input', () => CreateContentItemInput) input: CreateContentItemInput,
27914
+ @Ctx() { dataSource, userPayload }: AppContext,
27915
+ @PubSub() pubSub: PubSubEngine
27916
+ ) {
27917
+ return this.CreateRecord('Content Items', input, dataSource, userPayload, pubSub)
27918
+ }
27919
+
27920
+ @Mutation(() => ContentItem_)
27921
+ async UpdateContentItem(
27922
+ @Arg('input', () => UpdateContentItemInput) input: UpdateContentItemInput,
27923
+ @Ctx() { dataSource, userPayload }: AppContext,
27924
+ @PubSub() pubSub: PubSubEngine
27925
+ ) {
27926
+ return this.UpdateRecord('Content Items', input, dataSource, userPayload, pubSub);
27927
+ }
27928
+
27929
+ @Mutation(() => ContentItem_)
27930
+ async DeleteContentItem(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27931
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
27932
+ return this.DeleteRecord('Content Items', key, options, dataSource, userPayload, pubSub);
27933
+ }
27934
+
27935
+ }
27936
+
27937
+ //****************************************************************************
27938
+ // ENTITY CLASS for Content Item Attributes
27939
+ //****************************************************************************
27940
+ @ObjectType()
27941
+ export class ContentItemAttribute_ {
27942
+ @Field()
27943
+ @MaxLength(16)
27944
+ ID: string;
27945
+
27946
+ @Field()
27947
+ @MaxLength(16)
27948
+ ContentItemID: string;
27949
+
27950
+ @Field()
27951
+ @MaxLength(200)
27952
+ Name: string;
27953
+
27954
+ @Field()
27955
+ Value: string;
27956
+
27957
+ @Field()
27958
+ @MaxLength(10)
27959
+ _mj__CreatedAt: Date;
27960
+
27961
+ @Field()
27962
+ @MaxLength(10)
27963
+ _mj__UpdatedAt: Date;
27964
+
27965
+ @Field({nullable: true})
27966
+ @MaxLength(500)
27967
+ ContentItem?: string;
27968
+
27969
+ }
27970
+
27971
+ //****************************************************************************
27972
+ // INPUT TYPE for Content Item Attributes
27973
+ //****************************************************************************
27974
+ @InputType()
27975
+ export class CreateContentItemAttributeInput {
27976
+ @Field()
27977
+ ContentItemID: string;
27978
+
27979
+ @Field()
27980
+ Name: string;
27981
+
27982
+ @Field()
27983
+ Value: string;
27984
+ }
27985
+
27986
+
27987
+ //****************************************************************************
27988
+ // INPUT TYPE for Content Item Attributes
27989
+ //****************************************************************************
27990
+ @InputType()
27991
+ export class UpdateContentItemAttributeInput {
27992
+ @Field()
27993
+ ID: string;
27994
+
27995
+ @Field()
27996
+ ContentItemID: string;
27997
+
27998
+ @Field()
27999
+ Name: string;
28000
+
28001
+ @Field()
28002
+ Value: string;
28003
+
28004
+ @Field(() => [KeyValuePairInput], { nullable: true })
28005
+ OldValues___?: KeyValuePairInput[];
28006
+ }
28007
+
28008
+ //****************************************************************************
28009
+ // RESOLVER for Content Item Attributes
28010
+ //****************************************************************************
28011
+ @ObjectType()
28012
+ export class RunContentItemAttributeViewResult {
28013
+ @Field(() => [ContentItemAttribute_])
28014
+ Results: ContentItemAttribute_[];
28015
+
28016
+ @Field(() => String, {nullable: true})
28017
+ UserViewRunID?: string;
28018
+
28019
+ @Field(() => Int, {nullable: true})
28020
+ RowCount: number;
28021
+
28022
+ @Field(() => Int, {nullable: true})
28023
+ TotalRowCount: number;
28024
+
28025
+ @Field(() => Int, {nullable: true})
28026
+ ExecutionTime: number;
28027
+
28028
+ @Field({nullable: true})
28029
+ ErrorMessage?: string;
28030
+
28031
+ @Field(() => Boolean, {nullable: false})
28032
+ Success: boolean;
28033
+ }
28034
+
28035
+ @Resolver(ContentItemAttribute_)
28036
+ export class ContentItemAttributeResolver extends ResolverBase {
28037
+ @Query(() => RunContentItemAttributeViewResult)
28038
+ async RunContentItemAttributeViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
28039
+ return super.RunViewByIDGeneric(input, dataSource, userPayload, pubSub);
28040
+ }
28041
+
28042
+ @Query(() => RunContentItemAttributeViewResult)
28043
+ async RunContentItemAttributeViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
28044
+ return super.RunViewByNameGeneric(input, dataSource, userPayload, pubSub);
28045
+ }
28046
+
28047
+ @Query(() => RunContentItemAttributeViewResult)
28048
+ async RunContentItemAttributeDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
28049
+ input.EntityName = 'Content Item Attributes';
28050
+ return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
28051
+ }
28052
+ @Query(() => ContentItemAttribute_, { nullable: true })
28053
+ async ContentItemAttribute(@Arg('ID', () => String) ID: string, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<ContentItemAttribute_ | null> {
28054
+ this.CheckUserReadPermissions('Content Item Attributes', userPayload);
28055
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwContentItemAttributes] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause('Content Item Attributes', userPayload, EntityPermissionType.Read, 'AND');
28056
+ const result = this.MapFieldNamesToCodeNames('Content Item Attributes', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
28057
+ return result;
28058
+ }
28059
+
28060
+ @Mutation(() => ContentItemAttribute_)
28061
+ async CreateContentItemAttribute(
28062
+ @Arg('input', () => CreateContentItemAttributeInput) input: CreateContentItemAttributeInput,
28063
+ @Ctx() { dataSource, userPayload }: AppContext,
28064
+ @PubSub() pubSub: PubSubEngine
28065
+ ) {
28066
+ return this.CreateRecord('Content Item Attributes', input, dataSource, userPayload, pubSub)
28067
+ }
28068
+
28069
+ @Mutation(() => ContentItemAttribute_)
28070
+ async UpdateContentItemAttribute(
28071
+ @Arg('input', () => UpdateContentItemAttributeInput) input: UpdateContentItemAttributeInput,
28072
+ @Ctx() { dataSource, userPayload }: AppContext,
28073
+ @PubSub() pubSub: PubSubEngine
28074
+ ) {
28075
+ return this.UpdateRecord('Content Item Attributes', input, dataSource, userPayload, pubSub);
28076
+ }
28077
+
28078
+ @Mutation(() => ContentItemAttribute_)
28079
+ async DeleteContentItemAttribute(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
28080
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
28081
+ return this.DeleteRecord('Content Item Attributes', key, options, dataSource, userPayload, pubSub);
28082
+ }
28083
+
28084
+ }
28085
+
28086
+ //****************************************************************************
28087
+ // ENTITY CLASS for Content Item Tags
28088
+ //****************************************************************************
28089
+ @ObjectType()
28090
+ export class ContentItemTag_ {
28091
+ @Field()
28092
+ @MaxLength(16)
28093
+ ID: string;
28094
+
28095
+ @Field()
28096
+ @MaxLength(16)
28097
+ ItemID: string;
28098
+
28099
+ @Field()
28100
+ @MaxLength(400)
28101
+ Tag: string;
28102
+
28103
+ @Field()
28104
+ @MaxLength(10)
28105
+ _mj__CreatedAt: Date;
28106
+
28107
+ @Field()
28108
+ @MaxLength(10)
28109
+ _mj__UpdatedAt: Date;
28110
+
28111
+ @Field({nullable: true})
28112
+ @MaxLength(500)
28113
+ Item?: string;
28114
+
28115
+ }
28116
+
28117
+ //****************************************************************************
28118
+ // INPUT TYPE for Content Item Tags
28119
+ //****************************************************************************
28120
+ @InputType()
28121
+ export class CreateContentItemTagInput {
28122
+ @Field()
28123
+ ItemID: string;
28124
+
28125
+ @Field()
28126
+ Tag: string;
28127
+ }
28128
+
28129
+
28130
+ //****************************************************************************
28131
+ // INPUT TYPE for Content Item Tags
28132
+ //****************************************************************************
28133
+ @InputType()
28134
+ export class UpdateContentItemTagInput {
28135
+ @Field()
28136
+ ID: string;
28137
+
28138
+ @Field()
28139
+ ItemID: string;
28140
+
28141
+ @Field()
28142
+ Tag: string;
28143
+
28144
+ @Field(() => [KeyValuePairInput], { nullable: true })
28145
+ OldValues___?: KeyValuePairInput[];
28146
+ }
28147
+
28148
+ //****************************************************************************
28149
+ // RESOLVER for Content Item Tags
28150
+ //****************************************************************************
28151
+ @ObjectType()
28152
+ export class RunContentItemTagViewResult {
28153
+ @Field(() => [ContentItemTag_])
28154
+ Results: ContentItemTag_[];
28155
+
28156
+ @Field(() => String, {nullable: true})
28157
+ UserViewRunID?: string;
28158
+
28159
+ @Field(() => Int, {nullable: true})
28160
+ RowCount: number;
28161
+
28162
+ @Field(() => Int, {nullable: true})
28163
+ TotalRowCount: number;
28164
+
28165
+ @Field(() => Int, {nullable: true})
28166
+ ExecutionTime: number;
28167
+
28168
+ @Field({nullable: true})
28169
+ ErrorMessage?: string;
28170
+
28171
+ @Field(() => Boolean, {nullable: false})
28172
+ Success: boolean;
28173
+ }
28174
+
28175
+ @Resolver(ContentItemTag_)
28176
+ export class ContentItemTagResolver extends ResolverBase {
28177
+ @Query(() => RunContentItemTagViewResult)
28178
+ async RunContentItemTagViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
28179
+ return super.RunViewByIDGeneric(input, dataSource, userPayload, pubSub);
28180
+ }
28181
+
28182
+ @Query(() => RunContentItemTagViewResult)
28183
+ async RunContentItemTagViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
28184
+ return super.RunViewByNameGeneric(input, dataSource, userPayload, pubSub);
28185
+ }
28186
+
28187
+ @Query(() => RunContentItemTagViewResult)
28188
+ async RunContentItemTagDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
28189
+ input.EntityName = 'Content Item Tags';
28190
+ return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
28191
+ }
28192
+ @Query(() => ContentItemTag_, { nullable: true })
28193
+ async ContentItemTag(@Arg('ID', () => String) ID: string, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<ContentItemTag_ | null> {
28194
+ this.CheckUserReadPermissions('Content Item Tags', userPayload);
28195
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwContentItemTags] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause('Content Item Tags', userPayload, EntityPermissionType.Read, 'AND');
28196
+ const result = this.MapFieldNamesToCodeNames('Content Item Tags', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
28197
+ return result;
28198
+ }
28199
+
28200
+ @Mutation(() => ContentItemTag_)
28201
+ async CreateContentItemTag(
28202
+ @Arg('input', () => CreateContentItemTagInput) input: CreateContentItemTagInput,
28203
+ @Ctx() { dataSource, userPayload }: AppContext,
28204
+ @PubSub() pubSub: PubSubEngine
28205
+ ) {
28206
+ return this.CreateRecord('Content Item Tags', input, dataSource, userPayload, pubSub)
28207
+ }
28208
+
28209
+ @Mutation(() => ContentItemTag_)
28210
+ async UpdateContentItemTag(
28211
+ @Arg('input', () => UpdateContentItemTagInput) input: UpdateContentItemTagInput,
28212
+ @Ctx() { dataSource, userPayload }: AppContext,
28213
+ @PubSub() pubSub: PubSubEngine
28214
+ ) {
28215
+ return this.UpdateRecord('Content Item Tags', input, dataSource, userPayload, pubSub);
28216
+ }
28217
+
28218
+ @Mutation(() => ContentItemTag_)
28219
+ async DeleteContentItemTag(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
28220
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
28221
+ return this.DeleteRecord('Content Item Tags', key, options, dataSource, userPayload, pubSub);
28222
+ }
28223
+
26304
28224
  }