@memberjunction/server 2.7.1 → 2.8.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: 9/27/2024, 4:14:06 PM
5
+ * GENERATED: 10/15/2024, 6:15:08 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, ContentProcessRunEntity, ContentSourceEntity, ContentSourceParamEntity, ContentSourceTypeEntity, ContentSourceTypeParamEntity, ContentTypeEntity, ContentTypeAttributeEntity, ContentFileTypeEntity, ContentItemEntity, ContentItemAttributeEntity, ContentItemTagEntity } 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, ResourcePermissionEntity, ResourceLinkEntity, ContentProcessRunEntity, ContentSourceEntity, ContentSourceParamEntity, ContentSourceTypeEntity, ContentSourceTypeParamEntity, ContentTypeEntity, ContentTypeAttributeEntity, ContentFileTypeEntity, ContentItemEntity, ContentItemAttributeEntity, ContentItemTagEntity } from '@memberjunction/core-entities';
24
24
 
25
25
 
26
26
  //****************************************************************************
@@ -1302,12 +1302,12 @@ export class AIPromptCategory_ {
1302
1302
  @MaxLength(510)
1303
1303
  Parent?: string;
1304
1304
 
1305
- @Field(() => [AIPrompt_])
1306
- AIPrompts_CategoryIDArray: AIPrompt_[]; // Link to AIPrompts
1307
-
1308
1305
  @Field(() => [AIPromptCategory_])
1309
1306
  AIPromptCategories_ParentIDArray: AIPromptCategory_[]; // Link to AIPromptCategories
1310
1307
 
1308
+ @Field(() => [AIPrompt_])
1309
+ AIPrompts_CategoryIDArray: AIPrompt_[]; // Link to AIPrompts
1310
+
1311
1311
  }
1312
1312
 
1313
1313
  //****************************************************************************
@@ -1399,14 +1399,6 @@ export class AIPromptCategoryResolver extends ResolverBase {
1399
1399
  return result;
1400
1400
  }
1401
1401
 
1402
- @FieldResolver(() => [AIPrompt_])
1403
- async AIPrompts_CategoryIDArray(@Root() aipromptcategory_: AIPromptCategory_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
1404
- this.CheckUserReadPermissions('AI Prompts', userPayload);
1405
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIPrompts] WHERE [CategoryID]='${aipromptcategory_.ID}' ` + this.getRowLevelSecurityWhereClause('AI Prompts', userPayload, EntityPermissionType.Read, 'AND');
1406
- const result = this.ArrayMapFieldNamesToCodeNames('AI Prompts', await dataSource.query(sSQL));
1407
- return result;
1408
- }
1409
-
1410
1402
  @FieldResolver(() => [AIPromptCategory_])
1411
1403
  async AIPromptCategories_ParentIDArray(@Root() aipromptcategory_: AIPromptCategory_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
1412
1404
  this.CheckUserReadPermissions('AI Prompt Categories', userPayload);
@@ -1415,6 +1407,14 @@ export class AIPromptCategoryResolver extends ResolverBase {
1415
1407
  return result;
1416
1408
  }
1417
1409
 
1410
+ @FieldResolver(() => [AIPrompt_])
1411
+ async AIPrompts_CategoryIDArray(@Root() aipromptcategory_: AIPromptCategory_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
1412
+ this.CheckUserReadPermissions('AI Prompts', userPayload);
1413
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIPrompts] WHERE [CategoryID]='${aipromptcategory_.ID}' ` + this.getRowLevelSecurityWhereClause('AI Prompts', userPayload, EntityPermissionType.Read, 'AND');
1414
+ const result = this.ArrayMapFieldNamesToCodeNames('AI Prompts', await dataSource.query(sSQL));
1415
+ return result;
1416
+ }
1417
+
1418
1418
  @Mutation(() => AIPromptCategory_)
1419
1419
  async CreateAIPromptCategory(
1420
1420
  @Arg('input', () => CreateAIPromptCategoryInput) input: CreateAIPromptCategoryInput,
@@ -2626,6 +2626,9 @@ export class Role_ {
2626
2626
  @Field(() => [EmployeeRole_])
2627
2627
  EmployeeRoles_RoleIDArray: EmployeeRole_[]; // Link to EmployeeRoles
2628
2628
 
2629
+ @Field(() => [ResourcePermission_])
2630
+ ResourcePermissions_RoleIDArray: ResourcePermission_[]; // Link to ResourcePermissions
2631
+
2629
2632
  }
2630
2633
 
2631
2634
  //****************************************************************************
@@ -2771,6 +2774,14 @@ export class RoleResolver extends ResolverBase {
2771
2774
  return result;
2772
2775
  }
2773
2776
 
2777
+ @FieldResolver(() => [ResourcePermission_])
2778
+ async ResourcePermissions_RoleIDArray(@Root() role_: Role_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
2779
+ this.CheckUserReadPermissions('Resource Permissions', userPayload);
2780
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwResourcePermissions] WHERE [RoleID]='${role_.ID}' ` + this.getRowLevelSecurityWhereClause('Resource Permissions', userPayload, EntityPermissionType.Read, 'AND');
2781
+ const result = this.ArrayMapFieldNamesToCodeNames('Resource Permissions', await dataSource.query(sSQL));
2782
+ return result;
2783
+ }
2784
+
2774
2785
  @Mutation(() => Role_)
2775
2786
  async CreateRole(
2776
2787
  @Arg('input', () => CreateRoleInput) input: CreateRoleInput,
@@ -5057,6 +5068,12 @@ export class User_ {
5057
5068
  @Field(() => [ScheduledAction_])
5058
5069
  ScheduledActions_CreatedByUserIDArray: ScheduledAction_[]; // Link to ScheduledActions
5059
5070
 
5071
+ @Field(() => [ResourceLink_])
5072
+ ResourceLinks_UserIDArray: ResourceLink_[]; // Link to ResourceLinks
5073
+
5074
+ @Field(() => [ResourcePermission_])
5075
+ ResourcePermissions_UserIDArray: ResourcePermission_[]; // Link to ResourcePermissions
5076
+
5060
5077
  }
5061
5078
 
5062
5079
  //****************************************************************************
@@ -5460,6 +5477,22 @@ export class UserResolverBase extends ResolverBase {
5460
5477
  return result;
5461
5478
  }
5462
5479
 
5480
+ @FieldResolver(() => [ResourceLink_])
5481
+ async ResourceLinks_UserIDArray(@Root() user_: User_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
5482
+ this.CheckUserReadPermissions('Resource Links', userPayload);
5483
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwResourceLinks] WHERE [UserID]='${user_.ID}' ` + this.getRowLevelSecurityWhereClause('Resource Links', userPayload, EntityPermissionType.Read, 'AND');
5484
+ const result = this.ArrayMapFieldNamesToCodeNames('Resource Links', await dataSource.query(sSQL));
5485
+ return result;
5486
+ }
5487
+
5488
+ @FieldResolver(() => [ResourcePermission_])
5489
+ async ResourcePermissions_UserIDArray(@Root() user_: User_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
5490
+ this.CheckUserReadPermissions('Resource Permissions', userPayload);
5491
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwResourcePermissions] WHERE [UserID]='${user_.ID}' ` + this.getRowLevelSecurityWhereClause('Resource Permissions', userPayload, EntityPermissionType.Read, 'AND');
5492
+ const result = this.ArrayMapFieldNamesToCodeNames('Resource Permissions', await dataSource.query(sSQL));
5493
+ return result;
5494
+ }
5495
+
5463
5496
  @Mutation(() => User_)
5464
5497
  async CreateUser(
5465
5498
  @Arg('input', () => CreateUserInput) input: CreateUserInput,
@@ -10457,12 +10490,12 @@ export class AIModel_ {
10457
10490
  @Field(() => [ContentType_])
10458
10491
  ContentTypes_AIModelIDArray: ContentType_[]; // Link to ContentTypes
10459
10492
 
10460
- @Field(() => [AIResultCache_])
10461
- AIResultCache_AIModelIDArray: AIResultCache_[]; // Link to AIResultCache
10462
-
10463
10493
  @Field(() => [EntityAIAction_])
10464
10494
  EntityAIActions_AIModelIDArray: EntityAIAction_[]; // Link to EntityAIActions
10465
10495
 
10496
+ @Field(() => [AIResultCache_])
10497
+ AIResultCache_AIModelIDArray: AIResultCache_[]; // Link to AIResultCache
10498
+
10466
10499
  }
10467
10500
 
10468
10501
  //****************************************************************************
@@ -10662,14 +10695,6 @@ export class AIModelResolver extends ResolverBase {
10662
10695
  return result;
10663
10696
  }
10664
10697
 
10665
- @FieldResolver(() => [AIResultCache_])
10666
- async AIResultCache_AIModelIDArray(@Root() aimodel_: AIModel_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
10667
- this.CheckUserReadPermissions('AI Result Cache', userPayload);
10668
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIResultCaches] WHERE [AIModelID]='${aimodel_.ID}' ` + this.getRowLevelSecurityWhereClause('AI Result Cache', userPayload, EntityPermissionType.Read, 'AND');
10669
- const result = this.ArrayMapFieldNamesToCodeNames('AI Result Cache', await dataSource.query(sSQL));
10670
- return result;
10671
- }
10672
-
10673
10698
  @FieldResolver(() => [EntityAIAction_])
10674
10699
  async EntityAIActions_AIModelIDArray(@Root() aimodel_: AIModel_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
10675
10700
  this.CheckUserReadPermissions('Entity AI Actions', userPayload);
@@ -10678,6 +10703,14 @@ export class AIModelResolver extends ResolverBase {
10678
10703
  return result;
10679
10704
  }
10680
10705
 
10706
+ @FieldResolver(() => [AIResultCache_])
10707
+ async AIResultCache_AIModelIDArray(@Root() aimodel_: AIModel_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
10708
+ this.CheckUserReadPermissions('AI Result Cache', userPayload);
10709
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIResultCaches] WHERE [AIModelID]='${aimodel_.ID}' ` + this.getRowLevelSecurityWhereClause('AI Result Cache', userPayload, EntityPermissionType.Read, 'AND');
10710
+ const result = this.ArrayMapFieldNamesToCodeNames('AI Result Cache', await dataSource.query(sSQL));
10711
+ return result;
10712
+ }
10713
+
10681
10714
  @Mutation(() => AIModel_)
10682
10715
  async CreateAIModel(
10683
10716
  @Arg('input', () => CreateAIModelInput) input: CreateAIModelInput,
@@ -12995,16 +13028,30 @@ export class ResourceType_ {
12995
13028
  @MaxLength(10)
12996
13029
  _mj__UpdatedAt: Date;
12997
13030
 
13031
+ @Field({nullable: true, description: 'Nullable foreign key to the ID column in Entities entity, representing the category entity. ASSUMPTION: If provided, the assumption is there is a self-referencing/recursive foreign key establishing a hierarchy within the Category Entity, commonly called ParentID, but it can be named anything.'})
13032
+ @MaxLength(16)
13033
+ CategoryEntityID?: string;
13034
+
12998
13035
  @Field({nullable: true})
12999
13036
  @MaxLength(510)
13000
13037
  Entity?: string;
13001
13038
 
13039
+ @Field({nullable: true})
13040
+ @MaxLength(510)
13041
+ CategoryEntity?: string;
13042
+
13002
13043
  @Field(() => [WorkspaceItem_])
13003
13044
  WorkspaceItems_ResourceTypeIDArray: WorkspaceItem_[]; // Link to WorkspaceItems
13004
13045
 
13005
13046
  @Field(() => [UserNotification_])
13006
13047
  UserNotifications_ResourceTypeIDArray: UserNotification_[]; // Link to UserNotifications
13007
13048
 
13049
+ @Field(() => [ResourceLink_])
13050
+ ResourceLinks_ResourceTypeIDArray: ResourceLink_[]; // Link to ResourceLinks
13051
+
13052
+ @Field(() => [ResourcePermission_])
13053
+ ResourcePermissions_ResourceTypeIDArray: ResourcePermission_[]; // Link to ResourcePermissions
13054
+
13008
13055
  }
13009
13056
  //****************************************************************************
13010
13057
  // RESOLVER for Resource Types
@@ -13074,6 +13121,22 @@ export class ResourceTypeResolver extends ResolverBase {
13074
13121
  return result;
13075
13122
  }
13076
13123
 
13124
+ @FieldResolver(() => [ResourceLink_])
13125
+ async ResourceLinks_ResourceTypeIDArray(@Root() resourcetype_: ResourceType_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
13126
+ this.CheckUserReadPermissions('Resource Links', userPayload);
13127
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwResourceLinks] WHERE [ResourceTypeID]='${resourcetype_.ID}' ` + this.getRowLevelSecurityWhereClause('Resource Links', userPayload, EntityPermissionType.Read, 'AND');
13128
+ const result = this.ArrayMapFieldNamesToCodeNames('Resource Links', await dataSource.query(sSQL));
13129
+ return result;
13130
+ }
13131
+
13132
+ @FieldResolver(() => [ResourcePermission_])
13133
+ async ResourcePermissions_ResourceTypeIDArray(@Root() resourcetype_: ResourceType_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
13134
+ this.CheckUserReadPermissions('Resource Permissions', userPayload);
13135
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwResourcePermissions] WHERE [ResourceTypeID]='${resourcetype_.ID}' ` + this.getRowLevelSecurityWhereClause('Resource Permissions', userPayload, EntityPermissionType.Read, 'AND');
13136
+ const result = this.ArrayMapFieldNamesToCodeNames('Resource Permissions', await dataSource.query(sSQL));
13137
+ return result;
13138
+ }
13139
+
13077
13140
  }
13078
13141
 
13079
13142
  //****************************************************************************
@@ -26349,6 +26412,388 @@ export class EntityActionParamResolver extends ResolverBase {
26349
26412
 
26350
26413
  }
26351
26414
 
26415
+ //****************************************************************************
26416
+ // ENTITY CLASS for Resource Permissions
26417
+ //****************************************************************************
26418
+ @ObjectType({ description: 'Table for managing sharing of resources to users or roles with time constraints and permission levels' })
26419
+ export class ResourcePermission_ {
26420
+ @Field()
26421
+ @MaxLength(16)
26422
+ ID: string;
26423
+
26424
+ @Field({description: 'Reference to the type of resource being shared (View, Dashboard, Report, etc.)'})
26425
+ @MaxLength(16)
26426
+ ResourceTypeID: string;
26427
+
26428
+ @Field({description: 'ID of the specific resource being shared'})
26429
+ @MaxLength(510)
26430
+ ResourceRecordID: string;
26431
+
26432
+ @Field({description: 'The level of sharing either Role or User'})
26433
+ @MaxLength(20)
26434
+ Type: string;
26435
+
26436
+ @Field({nullable: true, description: 'Optional: Date when sharing starts'})
26437
+ @MaxLength(10)
26438
+ StartSharingAt?: Date;
26439
+
26440
+ @Field({nullable: true, description: 'Optional: Date when sharing ends'})
26441
+ @MaxLength(10)
26442
+ EndSharingAt?: Date;
26443
+
26444
+ @Field({nullable: true})
26445
+ @MaxLength(16)
26446
+ RoleID?: string;
26447
+
26448
+ @Field({nullable: true})
26449
+ @MaxLength(16)
26450
+ UserID?: string;
26451
+
26452
+ @Field({nullable: true, description: 'Permission level defining the type of access (View, Edit, Owner)'})
26453
+ @MaxLength(40)
26454
+ PermissionLevel?: string;
26455
+
26456
+ @Field()
26457
+ @MaxLength(10)
26458
+ _mj__CreatedAt: Date;
26459
+
26460
+ @Field()
26461
+ @MaxLength(10)
26462
+ _mj__UpdatedAt: Date;
26463
+
26464
+ @Field({description: 'Status of the resource permission request. Possible values are Requested, Approved, Rejected, or Revoked.'})
26465
+ @MaxLength(40)
26466
+ Status: string;
26467
+
26468
+ @Field()
26469
+ @MaxLength(510)
26470
+ ResourceType: string;
26471
+
26472
+ @Field({nullable: true})
26473
+ @MaxLength(100)
26474
+ Role?: string;
26475
+
26476
+ @Field({nullable: true})
26477
+ @MaxLength(200)
26478
+ User?: string;
26479
+
26480
+ }
26481
+
26482
+ //****************************************************************************
26483
+ // INPUT TYPE for Resource Permissions
26484
+ //****************************************************************************
26485
+ @InputType()
26486
+ export class CreateResourcePermissionInput {
26487
+ @Field()
26488
+ ResourceTypeID: string;
26489
+
26490
+ @Field()
26491
+ ResourceRecordID: string;
26492
+
26493
+ @Field()
26494
+ Type: string;
26495
+
26496
+ @Field({ nullable: true })
26497
+ StartSharingAt?: Date;
26498
+
26499
+ @Field({ nullable: true })
26500
+ EndSharingAt?: Date;
26501
+
26502
+ @Field({ nullable: true })
26503
+ RoleID?: string;
26504
+
26505
+ @Field({ nullable: true })
26506
+ UserID?: string;
26507
+
26508
+ @Field({ nullable: true })
26509
+ PermissionLevel?: string;
26510
+
26511
+ @Field()
26512
+ Status: string;
26513
+ }
26514
+
26515
+
26516
+ //****************************************************************************
26517
+ // INPUT TYPE for Resource Permissions
26518
+ //****************************************************************************
26519
+ @InputType()
26520
+ export class UpdateResourcePermissionInput {
26521
+ @Field()
26522
+ ID: string;
26523
+
26524
+ @Field()
26525
+ ResourceTypeID: string;
26526
+
26527
+ @Field()
26528
+ ResourceRecordID: string;
26529
+
26530
+ @Field()
26531
+ Type: string;
26532
+
26533
+ @Field({ nullable: true })
26534
+ StartSharingAt?: Date;
26535
+
26536
+ @Field({ nullable: true })
26537
+ EndSharingAt?: Date;
26538
+
26539
+ @Field({ nullable: true })
26540
+ RoleID?: string;
26541
+
26542
+ @Field({ nullable: true })
26543
+ UserID?: string;
26544
+
26545
+ @Field({ nullable: true })
26546
+ PermissionLevel?: string;
26547
+
26548
+ @Field()
26549
+ Status: string;
26550
+
26551
+ @Field(() => [KeyValuePairInput], { nullable: true })
26552
+ OldValues___?: KeyValuePairInput[];
26553
+ }
26554
+
26555
+ //****************************************************************************
26556
+ // RESOLVER for Resource Permissions
26557
+ //****************************************************************************
26558
+ @ObjectType()
26559
+ export class RunResourcePermissionViewResult {
26560
+ @Field(() => [ResourcePermission_])
26561
+ Results: ResourcePermission_[];
26562
+
26563
+ @Field(() => String, {nullable: true})
26564
+ UserViewRunID?: string;
26565
+
26566
+ @Field(() => Int, {nullable: true})
26567
+ RowCount: number;
26568
+
26569
+ @Field(() => Int, {nullable: true})
26570
+ TotalRowCount: number;
26571
+
26572
+ @Field(() => Int, {nullable: true})
26573
+ ExecutionTime: number;
26574
+
26575
+ @Field({nullable: true})
26576
+ ErrorMessage?: string;
26577
+
26578
+ @Field(() => Boolean, {nullable: false})
26579
+ Success: boolean;
26580
+ }
26581
+
26582
+ @Resolver(ResourcePermission_)
26583
+ export class ResourcePermissionResolver extends ResolverBase {
26584
+ @Query(() => RunResourcePermissionViewResult)
26585
+ async RunResourcePermissionViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
26586
+ return super.RunViewByIDGeneric(input, dataSource, userPayload, pubSub);
26587
+ }
26588
+
26589
+ @Query(() => RunResourcePermissionViewResult)
26590
+ async RunResourcePermissionViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
26591
+ return super.RunViewByNameGeneric(input, dataSource, userPayload, pubSub);
26592
+ }
26593
+
26594
+ @Query(() => RunResourcePermissionViewResult)
26595
+ async RunResourcePermissionDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
26596
+ input.EntityName = 'Resource Permissions';
26597
+ return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
26598
+ }
26599
+ @Query(() => ResourcePermission_, { nullable: true })
26600
+ async ResourcePermission(@Arg('ID', () => String) ID: string, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<ResourcePermission_ | null> {
26601
+ this.CheckUserReadPermissions('Resource Permissions', userPayload);
26602
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwResourcePermissions] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause('Resource Permissions', userPayload, EntityPermissionType.Read, 'AND');
26603
+ const result = this.MapFieldNamesToCodeNames('Resource Permissions', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
26604
+ return result;
26605
+ }
26606
+
26607
+ @Mutation(() => ResourcePermission_)
26608
+ async CreateResourcePermission(
26609
+ @Arg('input', () => CreateResourcePermissionInput) input: CreateResourcePermissionInput,
26610
+ @Ctx() { dataSource, userPayload }: AppContext,
26611
+ @PubSub() pubSub: PubSubEngine
26612
+ ) {
26613
+ return this.CreateRecord('Resource Permissions', input, dataSource, userPayload, pubSub)
26614
+ }
26615
+
26616
+ @Mutation(() => ResourcePermission_)
26617
+ async UpdateResourcePermission(
26618
+ @Arg('input', () => UpdateResourcePermissionInput) input: UpdateResourcePermissionInput,
26619
+ @Ctx() { dataSource, userPayload }: AppContext,
26620
+ @PubSub() pubSub: PubSubEngine
26621
+ ) {
26622
+ return this.UpdateRecord('Resource Permissions', input, dataSource, userPayload, pubSub);
26623
+ }
26624
+
26625
+ @Mutation(() => ResourcePermission_)
26626
+ async DeleteResourcePermission(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
26627
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
26628
+ return this.DeleteRecord('Resource Permissions', key, options, dataSource, userPayload, pubSub);
26629
+ }
26630
+
26631
+ }
26632
+
26633
+ //****************************************************************************
26634
+ // ENTITY CLASS for Resource Links
26635
+ //****************************************************************************
26636
+ @ObjectType({ description: 'Table to track user links to shared resources such as views, dashboards, etc.' })
26637
+ export class ResourceLink_ {
26638
+ @Field({description: 'Unique identifier for each resource link'})
26639
+ @MaxLength(16)
26640
+ ID: string;
26641
+
26642
+ @Field({description: 'Foreign key to the user linking the resource'})
26643
+ @MaxLength(16)
26644
+ UserID: string;
26645
+
26646
+ @Field({description: 'Foreign key to the resource type (view, dashboard, etc.)'})
26647
+ @MaxLength(16)
26648
+ ResourceTypeID: string;
26649
+
26650
+ @Field({description: 'ID of the specific resource being linked'})
26651
+ @MaxLength(510)
26652
+ ResourceRecordID: string;
26653
+
26654
+ @Field({nullable: true, description: 'Optional folder where the user organizes the linked resource'})
26655
+ @MaxLength(510)
26656
+ FolderID?: string;
26657
+
26658
+ @Field()
26659
+ @MaxLength(10)
26660
+ _mj__CreatedAt: Date;
26661
+
26662
+ @Field()
26663
+ @MaxLength(10)
26664
+ _mj__UpdatedAt: Date;
26665
+
26666
+ @Field()
26667
+ @MaxLength(200)
26668
+ User: string;
26669
+
26670
+ @Field()
26671
+ @MaxLength(510)
26672
+ ResourceType: string;
26673
+
26674
+ }
26675
+
26676
+ //****************************************************************************
26677
+ // INPUT TYPE for Resource Links
26678
+ //****************************************************************************
26679
+ @InputType()
26680
+ export class CreateResourceLinkInput {
26681
+ @Field()
26682
+ UserID: string;
26683
+
26684
+ @Field()
26685
+ ResourceTypeID: string;
26686
+
26687
+ @Field()
26688
+ ResourceRecordID: string;
26689
+
26690
+ @Field({ nullable: true })
26691
+ FolderID?: string;
26692
+ }
26693
+
26694
+
26695
+ //****************************************************************************
26696
+ // INPUT TYPE for Resource Links
26697
+ //****************************************************************************
26698
+ @InputType()
26699
+ export class UpdateResourceLinkInput {
26700
+ @Field()
26701
+ ID: string;
26702
+
26703
+ @Field()
26704
+ UserID: string;
26705
+
26706
+ @Field()
26707
+ ResourceTypeID: string;
26708
+
26709
+ @Field()
26710
+ ResourceRecordID: string;
26711
+
26712
+ @Field({ nullable: true })
26713
+ FolderID?: string;
26714
+
26715
+ @Field(() => [KeyValuePairInput], { nullable: true })
26716
+ OldValues___?: KeyValuePairInput[];
26717
+ }
26718
+
26719
+ //****************************************************************************
26720
+ // RESOLVER for Resource Links
26721
+ //****************************************************************************
26722
+ @ObjectType()
26723
+ export class RunResourceLinkViewResult {
26724
+ @Field(() => [ResourceLink_])
26725
+ Results: ResourceLink_[];
26726
+
26727
+ @Field(() => String, {nullable: true})
26728
+ UserViewRunID?: string;
26729
+
26730
+ @Field(() => Int, {nullable: true})
26731
+ RowCount: number;
26732
+
26733
+ @Field(() => Int, {nullable: true})
26734
+ TotalRowCount: number;
26735
+
26736
+ @Field(() => Int, {nullable: true})
26737
+ ExecutionTime: number;
26738
+
26739
+ @Field({nullable: true})
26740
+ ErrorMessage?: string;
26741
+
26742
+ @Field(() => Boolean, {nullable: false})
26743
+ Success: boolean;
26744
+ }
26745
+
26746
+ @Resolver(ResourceLink_)
26747
+ export class ResourceLinkResolver extends ResolverBase {
26748
+ @Query(() => RunResourceLinkViewResult)
26749
+ async RunResourceLinkViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
26750
+ return super.RunViewByIDGeneric(input, dataSource, userPayload, pubSub);
26751
+ }
26752
+
26753
+ @Query(() => RunResourceLinkViewResult)
26754
+ async RunResourceLinkViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
26755
+ return super.RunViewByNameGeneric(input, dataSource, userPayload, pubSub);
26756
+ }
26757
+
26758
+ @Query(() => RunResourceLinkViewResult)
26759
+ async RunResourceLinkDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
26760
+ input.EntityName = 'Resource Links';
26761
+ return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
26762
+ }
26763
+ @Query(() => ResourceLink_, { nullable: true })
26764
+ async ResourceLink(@Arg('ID', () => String) ID: string, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<ResourceLink_ | null> {
26765
+ this.CheckUserReadPermissions('Resource Links', userPayload);
26766
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwResourceLinks] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause('Resource Links', userPayload, EntityPermissionType.Read, 'AND');
26767
+ const result = this.MapFieldNamesToCodeNames('Resource Links', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
26768
+ return result;
26769
+ }
26770
+
26771
+ @Mutation(() => ResourceLink_)
26772
+ async CreateResourceLink(
26773
+ @Arg('input', () => CreateResourceLinkInput) input: CreateResourceLinkInput,
26774
+ @Ctx() { dataSource, userPayload }: AppContext,
26775
+ @PubSub() pubSub: PubSubEngine
26776
+ ) {
26777
+ return this.CreateRecord('Resource Links', input, dataSource, userPayload, pubSub)
26778
+ }
26779
+
26780
+ @Mutation(() => ResourceLink_)
26781
+ async UpdateResourceLink(
26782
+ @Arg('input', () => UpdateResourceLinkInput) input: UpdateResourceLinkInput,
26783
+ @Ctx() { dataSource, userPayload }: AppContext,
26784
+ @PubSub() pubSub: PubSubEngine
26785
+ ) {
26786
+ return this.UpdateRecord('Resource Links', input, dataSource, userPayload, pubSub);
26787
+ }
26788
+
26789
+ @Mutation(() => ResourceLink_)
26790
+ async DeleteResourceLink(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
26791
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
26792
+ return this.DeleteRecord('Resource Links', key, options, dataSource, userPayload, pubSub);
26793
+ }
26794
+
26795
+ }
26796
+
26352
26797
  //****************************************************************************
26353
26798
  // ENTITY CLASS for Content Process Runs
26354
26799
  //****************************************************************************