@memberjunction/server 2.12.0 → 2.13.1

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.
@@ -18,7 +18,7 @@ import { mj_core_schema } from '../config.js';
18
18
 
19
19
 
20
20
 
21
- import { ScheduledActionEntity, ScheduledActionParamEntity, ExplorerNavigationItemEntity, AIPromptEntity, AIResultCacheEntity, AIPromptCategoryEntity, AIPromptTypeEntity, CompanyEntity, EmployeeEntity, UserFavoriteEntity, EmployeeCompanyIntegrationEntity, EmployeeRoleEntity, EmployeeSkillEntity, RoleEntity, SkillEntity, IntegrationURLFormatEntity, IntegrationEntity, CompanyIntegrationEntity, EntityFieldEntity, EntityEntity, UserEntity, EntityRelationshipEntity, UserRecordLogEntity, UserViewEntity, CompanyIntegrationRunEntity, CompanyIntegrationRunDetailEntity, ErrorLogEntity, ApplicationEntity, ApplicationEntityEntity, EntityPermissionEntity, UserApplicationEntityEntity, UserApplicationEntity, CompanyIntegrationRunAPILogEntity, ListEntity, ListDetailEntity, UserViewRunEntity, UserViewRunDetailEntity, WorkflowRunEntity, WorkflowEntity, WorkflowEngineEntity, RecordChangeEntity, UserRoleEntity, RowLevelSecurityFilterEntity, AuditLogEntity, AuthorizationEntity, AuthorizationRoleEntity, AuditLogTypeEntity, EntityFieldValueEntity, AIModelEntity, AIActionEntity, AIModelActionEntity, EntityAIActionEntity, AIModelTypeEntity, QueueTypeEntity, QueueEntity, QueueTaskEntity, DashboardEntity, OutputTriggerTypeEntity, OutputFormatTypeEntity, OutputDeliveryTypeEntity, ReportEntity, ReportSnapshotEntity, ResourceTypeEntity, TagEntity, TaggedItemEntity, WorkspaceEntity, WorkspaceItemEntity, DatasetEntity, DatasetItemEntity, ConversationDetailEntity, ConversationEntity, UserNotificationEntity, SchemaInfoEntity, CompanyIntegrationRecordMapEntity, RecordMergeLogEntity, RecordMergeDeletionLogEntity, QueryFieldEntity, QueryCategoryEntity, QueryEntity, QueryPermissionEntity, VectorIndexEntity, EntityDocumentTypeEntity, EntityDocumentRunEntity, VectorDatabaseEntity, EntityRecordDocumentEntity, EntityDocumentEntity, DataContextItemEntity, DataContextEntity, UserViewCategoryEntity, DashboardCategoryEntity, ReportCategoryEntity, FileStorageProviderEntity, FileEntity, FileCategoryEntity, FileEntityRecordLinkEntity, VersionInstallationEntity, DuplicateRunDetailMatchEntity, EntityDocumentSettingEntity, EntitySettingEntity, DuplicateRunEntity, DuplicateRunDetailEntity, ApplicationSettingEntity, ActionCategoryEntity, EntityActionEntity, EntityActionInvocationEntity, ActionAuthorizationEntity, EntityActionInvocationTypeEntity, ActionEntity, EntityActionFilterEntity, ActionFilterEntity, ActionContextTypeEntity, ActionResultCodeEntity, ActionContextEntity, ActionExecutionLogEntity, ActionParamEntity, ActionLibraryEntity, LibraryEntity, ListCategoryEntity, CommunicationProviderEntity, CommunicationRunEntity, CommunicationProviderMessageTypeEntity, CommunicationLogEntity, CommunicationBaseMessageTypeEntity, TemplateEntity, TemplateCategoryEntity, TemplateContentEntity, TemplateParamEntity, TemplateContentTypeEntity, RecommendationEntity, RecommendationProviderEntity, RecommendationRunEntity, RecommendationItemEntity, EntityCommunicationMessageTypeEntity, EntityCommunicationFieldEntity, RecordChangeReplayRunEntity, LibraryItemEntity, EntityRelationshipDisplayComponentEntity, EntityActionParamEntity, ResourcePermissionEntity, ResourceLinkEntity, ContentProcessRunEntity, ContentSourceEntity, ContentSourceParamEntity, ContentSourceTypeEntity, ContentSourceTypeParamEntity, ContentTypeEntity, ContentTypeAttributeEntity, ContentFileTypeEntity, ContentItemEntity, ContentItemAttributeEntity, ContentItemTagEntity, flyway_schema_historyEntity } from '@memberjunction/core-entities';
21
+ 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, ResourcePermissionEntity, ResourceLinkEntity, ContentProcessRunEntity, ContentSourceEntity, ContentSourceParamEntity, ContentSourceTypeEntity, ContentSourceTypeParamEntity, ContentTypeEntity, ContentTypeAttributeEntity, ContentFileTypeEntity, ContentItemEntity, ContentItemAttributeEntity, ContentItemTagEntity } from '@memberjunction/core-entities';
22
22
 
23
23
 
24
24
  //****************************************************************************
@@ -655,6 +655,211 @@ export class ExplorerNavigationItemResolver extends ResolverBase {
655
655
 
656
656
  }
657
657
 
658
+ //****************************************************************************
659
+ // ENTITY CLASS for flyway _schema _histories
660
+ //****************************************************************************
661
+ @ObjectType()
662
+ export class flyway_schema_history_ {
663
+ @Field(() => Int)
664
+ installed_rank: number;
665
+
666
+ @Field({nullable: true})
667
+ @MaxLength(100)
668
+ version?: string;
669
+
670
+ @Field({nullable: true})
671
+ @MaxLength(400)
672
+ description?: string;
673
+
674
+ @Field()
675
+ @MaxLength(40)
676
+ type: string;
677
+
678
+ @Field()
679
+ @MaxLength(2000)
680
+ script: string;
681
+
682
+ @Field(() => Int, {nullable: true})
683
+ checksum?: number;
684
+
685
+ @Field()
686
+ @MaxLength(200)
687
+ installed_by: string;
688
+
689
+ @Field()
690
+ @MaxLength(8)
691
+ installed_on: Date;
692
+
693
+ @Field(() => Int)
694
+ execution_time: number;
695
+
696
+ @Field(() => Boolean)
697
+ success: boolean;
698
+
699
+ @Field()
700
+ @MaxLength(10)
701
+ _mj__CreatedAt: Date;
702
+
703
+ @Field()
704
+ @MaxLength(10)
705
+ _mj__UpdatedAt: Date;
706
+
707
+ }
708
+
709
+ //****************************************************************************
710
+ // INPUT TYPE for flyway _schema _histories
711
+ //****************************************************************************
712
+ @InputType()
713
+ export class Createflyway_schema_historyInput {
714
+ @Field(() => Int)
715
+ installed_rank: number;
716
+
717
+ @Field({ nullable: true })
718
+ version?: string;
719
+
720
+ @Field({ nullable: true })
721
+ description?: string;
722
+
723
+ @Field()
724
+ type: string;
725
+
726
+ @Field()
727
+ script: string;
728
+
729
+ @Field(() => Int, { nullable: true })
730
+ checksum?: number;
731
+
732
+ @Field()
733
+ installed_by: string;
734
+
735
+ @Field()
736
+ installed_on: Date;
737
+
738
+ @Field(() => Int)
739
+ execution_time: number;
740
+
741
+ @Field(() => Boolean)
742
+ success: boolean;
743
+ }
744
+
745
+
746
+ //****************************************************************************
747
+ // INPUT TYPE for flyway _schema _histories
748
+ //****************************************************************************
749
+ @InputType()
750
+ export class Updateflyway_schema_historyInput {
751
+ @Field(() => Int)
752
+ installed_rank: number;
753
+
754
+ @Field({ nullable: true })
755
+ version?: string;
756
+
757
+ @Field({ nullable: true })
758
+ description?: string;
759
+
760
+ @Field()
761
+ type: string;
762
+
763
+ @Field()
764
+ script: string;
765
+
766
+ @Field(() => Int, { nullable: true })
767
+ checksum?: number;
768
+
769
+ @Field()
770
+ installed_by: string;
771
+
772
+ @Field()
773
+ installed_on: Date;
774
+
775
+ @Field(() => Int)
776
+ execution_time: number;
777
+
778
+ @Field(() => Boolean)
779
+ success: boolean;
780
+
781
+ @Field(() => [KeyValuePairInput], { nullable: true })
782
+ OldValues___?: KeyValuePairInput[];
783
+ }
784
+
785
+ //****************************************************************************
786
+ // RESOLVER for flyway _schema _histories
787
+ //****************************************************************************
788
+ @ObjectType()
789
+ export class Runflyway_schema_historyViewResult {
790
+ @Field(() => [flyway_schema_history_])
791
+ Results: flyway_schema_history_[];
792
+
793
+ @Field(() => String, {nullable: true})
794
+ UserViewRunID?: string;
795
+
796
+ @Field(() => Int, {nullable: true})
797
+ RowCount: number;
798
+
799
+ @Field(() => Int, {nullable: true})
800
+ TotalRowCount: number;
801
+
802
+ @Field(() => Int, {nullable: true})
803
+ ExecutionTime: number;
804
+
805
+ @Field({nullable: true})
806
+ ErrorMessage?: string;
807
+
808
+ @Field(() => Boolean, {nullable: false})
809
+ Success: boolean;
810
+ }
811
+
812
+ @Resolver(flyway_schema_history_)
813
+ export class flyway_schema_historyResolver extends ResolverBase {
814
+ @Query(() => Runflyway_schema_historyViewResult)
815
+ async Runflyway_schema_historyViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
816
+ return super.RunViewByIDGeneric(input, dataSource, userPayload, pubSub);
817
+ }
818
+
819
+ @Query(() => Runflyway_schema_historyViewResult)
820
+ async Runflyway_schema_historyViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
821
+ return super.RunViewByNameGeneric(input, dataSource, userPayload, pubSub);
822
+ }
823
+
824
+ @Query(() => Runflyway_schema_historyViewResult)
825
+ async Runflyway_schema_historyDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
826
+ input.EntityName = 'flyway _schema _histories';
827
+ return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
828
+ }
829
+ @Query(() => flyway_schema_history_, { nullable: true })
830
+ async flyway_schema_history(@Arg('installed_rank', () => Int) installed_rank: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<flyway_schema_history_ | null> {
831
+ this.CheckUserReadPermissions('flyway _schema _histories', userPayload);
832
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwflyway_schema_histories] WHERE [installed_rank]=${installed_rank} ` + this.getRowLevelSecurityWhereClause('flyway _schema _histories', userPayload, EntityPermissionType.Read, 'AND');
833
+ const result = this.MapFieldNamesToCodeNames('flyway _schema _histories', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
834
+ return result;
835
+ }
836
+
837
+ @Mutation(() => flyway_schema_history_)
838
+ async Createflyway_schema_history(
839
+ @Arg('input', () => Createflyway_schema_historyInput) input: Createflyway_schema_historyInput,
840
+ @Ctx() { dataSource, userPayload }: AppContext,
841
+ @PubSub() pubSub: PubSubEngine
842
+ ) {
843
+ return this.CreateRecord('flyway _schema _histories', input, dataSource, userPayload, pubSub)
844
+ }
845
+
846
+ @Mutation(() => flyway_schema_history_)
847
+ async Updateflyway_schema_history(
848
+ @Arg('input', () => Updateflyway_schema_historyInput) input: Updateflyway_schema_historyInput,
849
+ @Ctx() { dataSource, userPayload }: AppContext,
850
+ @PubSub() pubSub: PubSubEngine
851
+ ) {
852
+ return this.UpdateRecord('flyway _schema _histories', input, dataSource, userPayload, pubSub);
853
+ }
854
+
855
+ @Mutation(() => flyway_schema_history_)
856
+ async Deleteflyway_schema_history(@Arg('installed_rank', () => Int) installed_rank: number, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
857
+ const key = new CompositeKey([{FieldName: 'installed_rank', Value: installed_rank}]);
858
+ return this.DeleteRecord('flyway _schema _histories', key, options, dataSource, userPayload, pubSub);
859
+ }
860
+
861
+ }
862
+
658
863
  //****************************************************************************
659
864
  // ENTITY CLASS for AI Prompts
660
865
  //****************************************************************************
@@ -1095,12 +1300,12 @@ export class AIPromptCategory_ {
1095
1300
  @MaxLength(510)
1096
1301
  Parent?: string;
1097
1302
 
1098
- @Field(() => [AIPrompt_])
1099
- AIPrompts_CategoryIDArray: AIPrompt_[]; // Link to AIPrompts
1100
-
1101
1303
  @Field(() => [AIPromptCategory_])
1102
1304
  AIPromptCategories_ParentIDArray: AIPromptCategory_[]; // Link to AIPromptCategories
1103
1305
 
1306
+ @Field(() => [AIPrompt_])
1307
+ AIPrompts_CategoryIDArray: AIPrompt_[]; // Link to AIPrompts
1308
+
1104
1309
  }
1105
1310
 
1106
1311
  //****************************************************************************
@@ -1192,14 +1397,6 @@ export class AIPromptCategoryResolver extends ResolverBase {
1192
1397
  return result;
1193
1398
  }
1194
1399
 
1195
- @FieldResolver(() => [AIPrompt_])
1196
- async AIPrompts_CategoryIDArray(@Root() aipromptcategory_: AIPromptCategory_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
1197
- this.CheckUserReadPermissions('AI Prompts', userPayload);
1198
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIPrompts] WHERE [CategoryID]='${aipromptcategory_.ID}' ` + this.getRowLevelSecurityWhereClause('AI Prompts', userPayload, EntityPermissionType.Read, 'AND');
1199
- const result = this.ArrayMapFieldNamesToCodeNames('AI Prompts', await dataSource.query(sSQL));
1200
- return result;
1201
- }
1202
-
1203
1400
  @FieldResolver(() => [AIPromptCategory_])
1204
1401
  async AIPromptCategories_ParentIDArray(@Root() aipromptcategory_: AIPromptCategory_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
1205
1402
  this.CheckUserReadPermissions('AI Prompt Categories', userPayload);
@@ -1208,6 +1405,14 @@ export class AIPromptCategoryResolver extends ResolverBase {
1208
1405
  return result;
1209
1406
  }
1210
1407
 
1408
+ @FieldResolver(() => [AIPrompt_])
1409
+ async AIPrompts_CategoryIDArray(@Root() aipromptcategory_: AIPromptCategory_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
1410
+ this.CheckUserReadPermissions('AI Prompts', userPayload);
1411
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIPrompts] WHERE [CategoryID]='${aipromptcategory_.ID}' ` + this.getRowLevelSecurityWhereClause('AI Prompts', userPayload, EntityPermissionType.Read, 'AND');
1412
+ const result = this.ArrayMapFieldNamesToCodeNames('AI Prompts', await dataSource.query(sSQL));
1413
+ return result;
1414
+ }
1415
+
1211
1416
  @Mutation(() => AIPromptCategory_)
1212
1417
  async CreateAIPromptCategory(
1213
1418
  @Arg('input', () => CreateAIPromptCategoryInput) input: CreateAIPromptCategoryInput,
@@ -26285,7 +26490,7 @@ export class ResourcePermission_ {
26285
26490
  @MaxLength(10)
26286
26491
  _mj__UpdatedAt: Date;
26287
26492
 
26288
- @Field({description: 'Status of the resource permission request. Possible values are Requested, Approved, Rejected, or Revoked.'})
26493
+ @Field({description: 'Status of the resource permission request. Possible values are Pending, Approved, Rejected, Revoked, or Requested.'})
26289
26494
  @MaxLength(40)
26290
26495
  Status: string;
26291
26496
 
@@ -28498,209 +28703,4 @@ export class ContentItemTagResolver extends ResolverBase {
28498
28703
  return this.DeleteRecord('Content Item Tags', key, options, dataSource, userPayload, pubSub);
28499
28704
  }
28500
28705
 
28501
- }
28502
-
28503
- //****************************************************************************
28504
- // ENTITY CLASS for flyway _schema _histories
28505
- //****************************************************************************
28506
- @ObjectType()
28507
- export class flyway_schema_history_ {
28508
- @Field(() => Int)
28509
- installed_rank: number;
28510
-
28511
- @Field({nullable: true})
28512
- @MaxLength(100)
28513
- version?: string;
28514
-
28515
- @Field({nullable: true})
28516
- @MaxLength(400)
28517
- description?: string;
28518
-
28519
- @Field()
28520
- @MaxLength(40)
28521
- type: string;
28522
-
28523
- @Field()
28524
- @MaxLength(2000)
28525
- script: string;
28526
-
28527
- @Field(() => Int, {nullable: true})
28528
- checksum?: number;
28529
-
28530
- @Field()
28531
- @MaxLength(200)
28532
- installed_by: string;
28533
-
28534
- @Field()
28535
- @MaxLength(8)
28536
- installed_on: Date;
28537
-
28538
- @Field(() => Int)
28539
- execution_time: number;
28540
-
28541
- @Field(() => Boolean)
28542
- success: boolean;
28543
-
28544
- @Field()
28545
- @MaxLength(10)
28546
- _mj__CreatedAt: Date;
28547
-
28548
- @Field()
28549
- @MaxLength(10)
28550
- _mj__UpdatedAt: Date;
28551
-
28552
- }
28553
-
28554
- //****************************************************************************
28555
- // INPUT TYPE for flyway _schema _histories
28556
- //****************************************************************************
28557
- @InputType()
28558
- export class Createflyway_schema_historyInput {
28559
- @Field(() => Int)
28560
- installed_rank: number;
28561
-
28562
- @Field({ nullable: true })
28563
- version?: string;
28564
-
28565
- @Field({ nullable: true })
28566
- description?: string;
28567
-
28568
- @Field()
28569
- type: string;
28570
-
28571
- @Field()
28572
- script: string;
28573
-
28574
- @Field(() => Int, { nullable: true })
28575
- checksum?: number;
28576
-
28577
- @Field()
28578
- installed_by: string;
28579
-
28580
- @Field()
28581
- installed_on: Date;
28582
-
28583
- @Field(() => Int)
28584
- execution_time: number;
28585
-
28586
- @Field(() => Boolean)
28587
- success: boolean;
28588
- }
28589
-
28590
-
28591
- //****************************************************************************
28592
- // INPUT TYPE for flyway _schema _histories
28593
- //****************************************************************************
28594
- @InputType()
28595
- export class Updateflyway_schema_historyInput {
28596
- @Field(() => Int)
28597
- installed_rank: number;
28598
-
28599
- @Field({ nullable: true })
28600
- version?: string;
28601
-
28602
- @Field({ nullable: true })
28603
- description?: string;
28604
-
28605
- @Field()
28606
- type: string;
28607
-
28608
- @Field()
28609
- script: string;
28610
-
28611
- @Field(() => Int, { nullable: true })
28612
- checksum?: number;
28613
-
28614
- @Field()
28615
- installed_by: string;
28616
-
28617
- @Field()
28618
- installed_on: Date;
28619
-
28620
- @Field(() => Int)
28621
- execution_time: number;
28622
-
28623
- @Field(() => Boolean)
28624
- success: boolean;
28625
-
28626
- @Field(() => [KeyValuePairInput], { nullable: true })
28627
- OldValues___?: KeyValuePairInput[];
28628
- }
28629
-
28630
- //****************************************************************************
28631
- // RESOLVER for flyway _schema _histories
28632
- //****************************************************************************
28633
- @ObjectType()
28634
- export class Runflyway_schema_historyViewResult {
28635
- @Field(() => [flyway_schema_history_])
28636
- Results: flyway_schema_history_[];
28637
-
28638
- @Field(() => String, {nullable: true})
28639
- UserViewRunID?: string;
28640
-
28641
- @Field(() => Int, {nullable: true})
28642
- RowCount: number;
28643
-
28644
- @Field(() => Int, {nullable: true})
28645
- TotalRowCount: number;
28646
-
28647
- @Field(() => Int, {nullable: true})
28648
- ExecutionTime: number;
28649
-
28650
- @Field({nullable: true})
28651
- ErrorMessage?: string;
28652
-
28653
- @Field(() => Boolean, {nullable: false})
28654
- Success: boolean;
28655
- }
28656
-
28657
- @Resolver(flyway_schema_history_)
28658
- export class flyway_schema_historyResolver extends ResolverBase {
28659
- @Query(() => Runflyway_schema_historyViewResult)
28660
- async Runflyway_schema_historyViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
28661
- return super.RunViewByIDGeneric(input, dataSource, userPayload, pubSub);
28662
- }
28663
-
28664
- @Query(() => Runflyway_schema_historyViewResult)
28665
- async Runflyway_schema_historyViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
28666
- return super.RunViewByNameGeneric(input, dataSource, userPayload, pubSub);
28667
- }
28668
-
28669
- @Query(() => Runflyway_schema_historyViewResult)
28670
- async Runflyway_schema_historyDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
28671
- input.EntityName = 'flyway _schema _histories';
28672
- return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
28673
- }
28674
- @Query(() => flyway_schema_history_, { nullable: true })
28675
- async flyway_schema_history(@Arg('installed_rank', () => Int) installed_rank: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<flyway_schema_history_ | null> {
28676
- this.CheckUserReadPermissions('flyway _schema _histories', userPayload);
28677
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwflyway_schema_histories] WHERE [installed_rank]=${installed_rank} ` + this.getRowLevelSecurityWhereClause('flyway _schema _histories', userPayload, EntityPermissionType.Read, 'AND');
28678
- const result = this.MapFieldNamesToCodeNames('flyway _schema _histories', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
28679
- return result;
28680
- }
28681
-
28682
- @Mutation(() => flyway_schema_history_)
28683
- async Createflyway_schema_history(
28684
- @Arg('input', () => Createflyway_schema_historyInput) input: Createflyway_schema_historyInput,
28685
- @Ctx() { dataSource, userPayload }: AppContext,
28686
- @PubSub() pubSub: PubSubEngine
28687
- ) {
28688
- return this.CreateRecord('flyway _schema _histories', input, dataSource, userPayload, pubSub)
28689
- }
28690
-
28691
- @Mutation(() => flyway_schema_history_)
28692
- async Updateflyway_schema_history(
28693
- @Arg('input', () => Updateflyway_schema_historyInput) input: Updateflyway_schema_historyInput,
28694
- @Ctx() { dataSource, userPayload }: AppContext,
28695
- @PubSub() pubSub: PubSubEngine
28696
- ) {
28697
- return this.UpdateRecord('flyway _schema _histories', input, dataSource, userPayload, pubSub);
28698
- }
28699
-
28700
- @Mutation(() => flyway_schema_history_)
28701
- async Deleteflyway_schema_history(@Arg('installed_rank', () => Int) installed_rank: number, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
28702
- const key = new CompositeKey([{FieldName: 'installed_rank', Value: installed_rank}]);
28703
- return this.DeleteRecord('flyway _schema _histories', key, options, dataSource, userPayload, pubSub);
28704
- }
28705
-
28706
28706
  }