@memberjunction/server 0.9.220 → 0.9.222
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build.log.json +6 -0
- package/dist/auth/index.js +3 -0
- package/dist/auth/index.js.map +1 -1
- package/dist/context.js +7 -3
- package/dist/context.js.map +1 -1
- package/dist/generated/generated.js +574 -477
- package/dist/generated/generated.js.map +1 -1
- package/dist/resolvers/MergeRecordsResolver.js +3 -3
- package/dist/resolvers/MergeRecordsResolver.js.map +1 -1
- package/package.json +8 -8
- package/src/auth/index.ts +4 -0
- package/src/context.ts +7 -3
- package/src/generated/generated.ts +794 -742
- package/src/resolvers/MergeRecordsResolver.ts +2 -2
|
@@ -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:
|
|
5
|
+
* GENERATED: 3/7/2024, 8:04:27 PM
|
|
6
6
|
*
|
|
7
7
|
* >>> DO NOT MODIFY THIS FILE!!!!!!!!!!!!
|
|
8
8
|
* >>> YOUR CHANGES WILL BE OVERWRITTEN
|
|
@@ -17,6 +17,8 @@ import { AppContext } from '@memberjunction/server';
|
|
|
17
17
|
import { MaxLength } from 'class-validator';
|
|
18
18
|
import { DataSource } from 'typeorm';
|
|
19
19
|
|
|
20
|
+
import * as mj_core_schema_server_object_types from '@memberjunction/server'
|
|
21
|
+
|
|
20
22
|
import { 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 } from '@memberjunction/core-entities';
|
|
21
23
|
|
|
22
24
|
|
|
@@ -56,14 +58,14 @@ export class Company_ {
|
|
|
56
58
|
@MaxLength(510)
|
|
57
59
|
Domain?: string;
|
|
58
60
|
|
|
59
|
-
@Field(() => [Employee_])
|
|
60
|
-
EmployeesArray: Employee_[]; // Link to Employees
|
|
61
|
+
@Field(() => [mj_core_schema_server_object_types.Employee_])
|
|
62
|
+
EmployeesArray: mj_core_schema_server_object_types.Employee_[]; // Link to Employees
|
|
61
63
|
|
|
62
|
-
@Field(() => [CompanyIntegration_])
|
|
63
|
-
CompanyIntegrationsArray: CompanyIntegration_[]; // Link to CompanyIntegrations
|
|
64
|
+
@Field(() => [mj_core_schema_server_object_types.CompanyIntegration_])
|
|
65
|
+
CompanyIntegrationsArray: mj_core_schema_server_object_types.CompanyIntegration_[]; // Link to CompanyIntegrations
|
|
64
66
|
|
|
65
|
-
@Field(() => [Workflow_])
|
|
66
|
-
WorkflowsArray: Workflow_[]; // Link to Workflows
|
|
67
|
+
@Field(() => [mj_core_schema_server_object_types.Workflow_])
|
|
68
|
+
WorkflowsArray: mj_core_schema_server_object_types.Workflow_[]; // Link to Workflows
|
|
67
69
|
|
|
68
70
|
}
|
|
69
71
|
|
|
@@ -158,9 +160,9 @@ export class CompanyResolver extends ResolverBase {
|
|
|
158
160
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
159
161
|
}
|
|
160
162
|
@Query(() => Company_, { nullable: true })
|
|
161
|
-
async Company(@Arg('ID', () => Int) ID:
|
|
163
|
+
async Company(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<Company_ | null> {
|
|
162
164
|
this.CheckUserReadPermissions('Companies', userPayload);
|
|
163
|
-
const sSQL = `SELECT * FROM [
|
|
165
|
+
const sSQL = `SELECT * FROM [__mj].[vwCompanies] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Companies', userPayload, EntityPermissionType.Read, 'AND');
|
|
164
166
|
const result = this.MapFieldNamesToCodeNames('Companies', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
165
167
|
return result;
|
|
166
168
|
}
|
|
@@ -168,31 +170,31 @@ export class CompanyResolver extends ResolverBase {
|
|
|
168
170
|
@Query(() => [Company_])
|
|
169
171
|
async AllCompanies(@Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
170
172
|
this.CheckUserReadPermissions('Companies', userPayload);
|
|
171
|
-
const sSQL = 'SELECT * FROM [
|
|
173
|
+
const sSQL = 'SELECT * FROM [__mj].[vwCompanies]' + this.getRowLevelSecurityWhereClause('Companies', userPayload, EntityPermissionType.Read, ' WHERE');
|
|
172
174
|
const result = this.ArrayMapFieldNamesToCodeNames('Companies', await dataSource.query(sSQL));
|
|
173
175
|
return result;
|
|
174
176
|
}
|
|
175
177
|
|
|
176
|
-
@FieldResolver(() => [Employee_])
|
|
178
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.Employee_])
|
|
177
179
|
async EmployeesArray(@Root() company_: Company_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
178
180
|
this.CheckUserReadPermissions('Employees', userPayload);
|
|
179
|
-
const sSQL = `SELECT * FROM [
|
|
181
|
+
const sSQL = `SELECT * FROM [__mj].[vwEmployees] WHERE [CompanyID]=${company_.ID} ` + this.getRowLevelSecurityWhereClause('Employees', userPayload, EntityPermissionType.Read, 'AND');
|
|
180
182
|
const result = this.ArrayMapFieldNamesToCodeNames('Employees', await dataSource.query(sSQL));
|
|
181
183
|
return result;
|
|
182
184
|
}
|
|
183
185
|
|
|
184
|
-
@FieldResolver(() => [CompanyIntegration_])
|
|
186
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.CompanyIntegration_])
|
|
185
187
|
async CompanyIntegrationsArray(@Root() company_: Company_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
186
188
|
this.CheckUserReadPermissions('Company Integrations', userPayload);
|
|
187
|
-
const sSQL = `SELECT * FROM [
|
|
189
|
+
const sSQL = `SELECT * FROM [__mj].[vwCompanyIntegrations] WHERE [CompanyName]=${company_.ID} ` + this.getRowLevelSecurityWhereClause('Company Integrations', userPayload, EntityPermissionType.Read, 'AND');
|
|
188
190
|
const result = this.ArrayMapFieldNamesToCodeNames('Company Integrations', await dataSource.query(sSQL));
|
|
189
191
|
return result;
|
|
190
192
|
}
|
|
191
193
|
|
|
192
|
-
@FieldResolver(() => [Workflow_])
|
|
194
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.Workflow_])
|
|
193
195
|
async WorkflowsArray(@Root() company_: Company_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
194
196
|
this.CheckUserReadPermissions('Workflows', userPayload);
|
|
195
|
-
const sSQL = `SELECT * FROM [
|
|
197
|
+
const sSQL = `SELECT * FROM [__mj].[vwWorkflows] WHERE [CompanyName]=${company_.ID} ` + this.getRowLevelSecurityWhereClause('Workflows', userPayload, EntityPermissionType.Read, 'AND');
|
|
196
198
|
const result = this.ArrayMapFieldNamesToCodeNames('Workflows', await dataSource.query(sSQL));
|
|
197
199
|
return result;
|
|
198
200
|
}
|
|
@@ -259,7 +261,7 @@ export class CompanyResolver extends ResolverBase {
|
|
|
259
261
|
}
|
|
260
262
|
|
|
261
263
|
@Mutation(() => Company_)
|
|
262
|
-
async DeleteCompany(@Arg('ID', () => Int) ID:
|
|
264
|
+
async DeleteCompany(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
263
265
|
if (await this.BeforeDelete(dataSource, ID)) { // fire event and proceed if it wasn't cancelled
|
|
264
266
|
const entityObject = <CompanyEntity>await new Metadata().GetEntityObject('Companies', this.GetUserFromPayload(userPayload));
|
|
265
267
|
await entityObject.Load(ID);
|
|
@@ -276,11 +278,11 @@ export class CompanyResolver extends ResolverBase {
|
|
|
276
278
|
}
|
|
277
279
|
|
|
278
280
|
// Before/After UPDATE Event Hooks for Sub-Classes to Override
|
|
279
|
-
protected async BeforeDelete(dataSource: DataSource, ID:
|
|
281
|
+
protected async BeforeDelete(dataSource: DataSource, ID: number): Promise<boolean> {
|
|
280
282
|
const i = ID, d = dataSource; // prevent error;
|
|
281
283
|
return true;
|
|
282
284
|
}
|
|
283
|
-
protected async AfterDelete(dataSource: DataSource, ID:
|
|
285
|
+
protected async AfterDelete(dataSource: DataSource, ID: number) {
|
|
284
286
|
const i = ID, d = dataSource; // prevent error
|
|
285
287
|
}
|
|
286
288
|
|
|
@@ -355,17 +357,17 @@ export class Employee_ {
|
|
|
355
357
|
@MaxLength(200)
|
|
356
358
|
SupervisorEmail?: string;
|
|
357
359
|
|
|
358
|
-
@Field(() => [Employee_])
|
|
359
|
-
EmployeesArray: Employee_[]; // Link to Employees
|
|
360
|
+
@Field(() => [mj_core_schema_server_object_types.Employee_])
|
|
361
|
+
EmployeesArray: mj_core_schema_server_object_types.Employee_[]; // Link to Employees
|
|
360
362
|
|
|
361
|
-
@Field(() => [EmployeeCompanyIntegration_])
|
|
362
|
-
EmployeeCompanyIntegrationsArray: EmployeeCompanyIntegration_[]; // Link to EmployeeCompanyIntegrations
|
|
363
|
+
@Field(() => [mj_core_schema_server_object_types.EmployeeCompanyIntegration_])
|
|
364
|
+
EmployeeCompanyIntegrationsArray: mj_core_schema_server_object_types.EmployeeCompanyIntegration_[]; // Link to EmployeeCompanyIntegrations
|
|
363
365
|
|
|
364
|
-
@Field(() => [EmployeeRole_])
|
|
365
|
-
EmployeeRolesArray: EmployeeRole_[]; // Link to EmployeeRoles
|
|
366
|
+
@Field(() => [mj_core_schema_server_object_types.EmployeeRole_])
|
|
367
|
+
EmployeeRolesArray: mj_core_schema_server_object_types.EmployeeRole_[]; // Link to EmployeeRoles
|
|
366
368
|
|
|
367
|
-
@Field(() => [EmployeeSkill_])
|
|
368
|
-
EmployeeSkillsArray: EmployeeSkill_[]; // Link to EmployeeSkills
|
|
369
|
+
@Field(() => [mj_core_schema_server_object_types.EmployeeSkill_])
|
|
370
|
+
EmployeeSkillsArray: mj_core_schema_server_object_types.EmployeeSkill_[]; // Link to EmployeeSkills
|
|
369
371
|
|
|
370
372
|
}
|
|
371
373
|
|
|
@@ -478,9 +480,9 @@ export class EmployeeResolver extends ResolverBase {
|
|
|
478
480
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
479
481
|
}
|
|
480
482
|
@Query(() => Employee_, { nullable: true })
|
|
481
|
-
async Employee(@Arg('ID', () => Int) ID:
|
|
483
|
+
async Employee(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<Employee_ | null> {
|
|
482
484
|
this.CheckUserReadPermissions('Employees', userPayload);
|
|
483
|
-
const sSQL = `SELECT * FROM [
|
|
485
|
+
const sSQL = `SELECT * FROM [__mj].[vwEmployees] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Employees', userPayload, EntityPermissionType.Read, 'AND');
|
|
484
486
|
const result = this.MapFieldNamesToCodeNames('Employees', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
485
487
|
return result;
|
|
486
488
|
}
|
|
@@ -488,39 +490,39 @@ export class EmployeeResolver extends ResolverBase {
|
|
|
488
490
|
@Query(() => [Employee_])
|
|
489
491
|
async AllEmployees(@Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
490
492
|
this.CheckUserReadPermissions('Employees', userPayload);
|
|
491
|
-
const sSQL = 'SELECT * FROM [
|
|
493
|
+
const sSQL = 'SELECT * FROM [__mj].[vwEmployees]' + this.getRowLevelSecurityWhereClause('Employees', userPayload, EntityPermissionType.Read, ' WHERE');
|
|
492
494
|
const result = this.ArrayMapFieldNamesToCodeNames('Employees', await dataSource.query(sSQL));
|
|
493
495
|
return result;
|
|
494
496
|
}
|
|
495
497
|
|
|
496
|
-
@FieldResolver(() => [Employee_])
|
|
498
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.Employee_])
|
|
497
499
|
async EmployeesArray(@Root() employee_: Employee_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
498
500
|
this.CheckUserReadPermissions('Employees', userPayload);
|
|
499
|
-
const sSQL = `SELECT * FROM [
|
|
501
|
+
const sSQL = `SELECT * FROM [__mj].[vwEmployees] WHERE [SupervisorID]=${employee_.ID} ` + this.getRowLevelSecurityWhereClause('Employees', userPayload, EntityPermissionType.Read, 'AND');
|
|
500
502
|
const result = this.ArrayMapFieldNamesToCodeNames('Employees', await dataSource.query(sSQL));
|
|
501
503
|
return result;
|
|
502
504
|
}
|
|
503
505
|
|
|
504
|
-
@FieldResolver(() => [EmployeeCompanyIntegration_])
|
|
506
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.EmployeeCompanyIntegration_])
|
|
505
507
|
async EmployeeCompanyIntegrationsArray(@Root() employee_: Employee_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
506
508
|
this.CheckUserReadPermissions('Employee Company Integrations', userPayload);
|
|
507
|
-
const sSQL = `SELECT * FROM [
|
|
509
|
+
const sSQL = `SELECT * FROM [__mj].[vwEmployeeCompanyIntegrations] WHERE [EmployeeID]=${employee_.ID} ` + this.getRowLevelSecurityWhereClause('Employee Company Integrations', userPayload, EntityPermissionType.Read, 'AND');
|
|
508
510
|
const result = this.ArrayMapFieldNamesToCodeNames('Employee Company Integrations', await dataSource.query(sSQL));
|
|
509
511
|
return result;
|
|
510
512
|
}
|
|
511
513
|
|
|
512
|
-
@FieldResolver(() => [EmployeeRole_])
|
|
514
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.EmployeeRole_])
|
|
513
515
|
async EmployeeRolesArray(@Root() employee_: Employee_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
514
516
|
this.CheckUserReadPermissions('Employee Roles', userPayload);
|
|
515
|
-
const sSQL = `SELECT * FROM [
|
|
517
|
+
const sSQL = `SELECT * FROM [__mj].[vwEmployeeRoles] WHERE [EmployeeID]=${employee_.ID} ` + this.getRowLevelSecurityWhereClause('Employee Roles', userPayload, EntityPermissionType.Read, 'AND');
|
|
516
518
|
const result = this.ArrayMapFieldNamesToCodeNames('Employee Roles', await dataSource.query(sSQL));
|
|
517
519
|
return result;
|
|
518
520
|
}
|
|
519
521
|
|
|
520
|
-
@FieldResolver(() => [EmployeeSkill_])
|
|
522
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.EmployeeSkill_])
|
|
521
523
|
async EmployeeSkillsArray(@Root() employee_: Employee_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
522
524
|
this.CheckUserReadPermissions('Employee Skills', userPayload);
|
|
523
|
-
const sSQL = `SELECT * FROM [
|
|
525
|
+
const sSQL = `SELECT * FROM [__mj].[vwEmployeeSkills] WHERE [EmployeeID]=${employee_.ID} ` + this.getRowLevelSecurityWhereClause('Employee Skills', userPayload, EntityPermissionType.Read, 'AND');
|
|
524
526
|
const result = this.ArrayMapFieldNamesToCodeNames('Employee Skills', await dataSource.query(sSQL));
|
|
525
527
|
return result;
|
|
526
528
|
}
|
|
@@ -587,7 +589,7 @@ export class EmployeeResolver extends ResolverBase {
|
|
|
587
589
|
}
|
|
588
590
|
|
|
589
591
|
@Mutation(() => Employee_)
|
|
590
|
-
async DeleteEmployee(@Arg('ID', () => Int) ID:
|
|
592
|
+
async DeleteEmployee(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
591
593
|
if (await this.BeforeDelete(dataSource, ID)) { // fire event and proceed if it wasn't cancelled
|
|
592
594
|
const entityObject = <EmployeeEntity>await new Metadata().GetEntityObject('Employees', this.GetUserFromPayload(userPayload));
|
|
593
595
|
await entityObject.Load(ID);
|
|
@@ -604,11 +606,11 @@ export class EmployeeResolver extends ResolverBase {
|
|
|
604
606
|
}
|
|
605
607
|
|
|
606
608
|
// Before/After UPDATE Event Hooks for Sub-Classes to Override
|
|
607
|
-
protected async BeforeDelete(dataSource: DataSource, ID:
|
|
609
|
+
protected async BeforeDelete(dataSource: DataSource, ID: number): Promise<boolean> {
|
|
608
610
|
const i = ID, d = dataSource; // prevent error;
|
|
609
611
|
return true;
|
|
610
612
|
}
|
|
611
|
-
protected async AfterDelete(dataSource: DataSource, ID:
|
|
613
|
+
protected async AfterDelete(dataSource: DataSource, ID: number) {
|
|
612
614
|
const i = ID, d = dataSource; // prevent error
|
|
613
615
|
}
|
|
614
616
|
|
|
@@ -733,9 +735,9 @@ export class UserFavoriteResolverBase extends ResolverBase {
|
|
|
733
735
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
734
736
|
}
|
|
735
737
|
@Query(() => UserFavorite_, { nullable: true })
|
|
736
|
-
async UserFavorite(@Arg('ID', () => Int) ID:
|
|
738
|
+
async UserFavorite(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<UserFavorite_ | null> {
|
|
737
739
|
this.CheckUserReadPermissions('User Favorites', userPayload);
|
|
738
|
-
const sSQL = `SELECT * FROM [
|
|
740
|
+
const sSQL = `SELECT * FROM [__mj].[vwUserFavorites] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('User Favorites', userPayload, EntityPermissionType.Read, 'AND');
|
|
739
741
|
const result = this.MapFieldNamesToCodeNames('User Favorites', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
740
742
|
return result;
|
|
741
743
|
}
|
|
@@ -802,7 +804,7 @@ export class UserFavoriteResolverBase extends ResolverBase {
|
|
|
802
804
|
}
|
|
803
805
|
|
|
804
806
|
@Mutation(() => UserFavorite_)
|
|
805
|
-
async DeleteUserFavorite(@Arg('ID', () => Int) ID:
|
|
807
|
+
async DeleteUserFavorite(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
806
808
|
if (await this.BeforeDelete(dataSource, ID)) { // fire event and proceed if it wasn't cancelled
|
|
807
809
|
const entityObject = <UserFavoriteEntity>await new Metadata().GetEntityObject('User Favorites', this.GetUserFromPayload(userPayload));
|
|
808
810
|
await entityObject.Load(ID);
|
|
@@ -819,11 +821,11 @@ export class UserFavoriteResolverBase extends ResolverBase {
|
|
|
819
821
|
}
|
|
820
822
|
|
|
821
823
|
// Before/After UPDATE Event Hooks for Sub-Classes to Override
|
|
822
|
-
protected async BeforeDelete(dataSource: DataSource, ID:
|
|
824
|
+
protected async BeforeDelete(dataSource: DataSource, ID: number): Promise<boolean> {
|
|
823
825
|
const i = ID, d = dataSource; // prevent error;
|
|
824
826
|
return true;
|
|
825
827
|
}
|
|
826
|
-
protected async AfterDelete(dataSource: DataSource, ID:
|
|
828
|
+
protected async AfterDelete(dataSource: DataSource, ID: number) {
|
|
827
829
|
const i = ID, d = dataSource; // prevent error
|
|
828
830
|
}
|
|
829
831
|
|
|
@@ -926,9 +928,9 @@ export class EmployeeCompanyIntegrationResolver extends ResolverBase {
|
|
|
926
928
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
927
929
|
}
|
|
928
930
|
@Query(() => EmployeeCompanyIntegration_, { nullable: true })
|
|
929
|
-
async EmployeeCompanyIntegration(@Arg('ID', () => Int) ID:
|
|
931
|
+
async EmployeeCompanyIntegration(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<EmployeeCompanyIntegration_ | null> {
|
|
930
932
|
this.CheckUserReadPermissions('Employee Company Integrations', userPayload);
|
|
931
|
-
const sSQL = `SELECT * FROM [
|
|
933
|
+
const sSQL = `SELECT * FROM [__mj].[vwEmployeeCompanyIntegrations] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Employee Company Integrations', userPayload, EntityPermissionType.Read, 'AND');
|
|
932
934
|
const result = this.MapFieldNamesToCodeNames('Employee Company Integrations', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
933
935
|
return result;
|
|
934
936
|
}
|
|
@@ -1054,9 +1056,9 @@ export class EmployeeRoleResolver extends ResolverBase {
|
|
|
1054
1056
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
1055
1057
|
}
|
|
1056
1058
|
@Query(() => EmployeeRole_, { nullable: true })
|
|
1057
|
-
async EmployeeRole(@Arg('ID', () => Int) ID:
|
|
1059
|
+
async EmployeeRole(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<EmployeeRole_ | null> {
|
|
1058
1060
|
this.CheckUserReadPermissions('Employee Roles', userPayload);
|
|
1059
|
-
const sSQL = `SELECT * FROM [
|
|
1061
|
+
const sSQL = `SELECT * FROM [__mj].[vwEmployeeRoles] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Employee Roles', userPayload, EntityPermissionType.Read, 'AND');
|
|
1060
1062
|
const result = this.MapFieldNamesToCodeNames('Employee Roles', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
1061
1063
|
return result;
|
|
1062
1064
|
}
|
|
@@ -1182,9 +1184,9 @@ export class EmployeeSkillResolver extends ResolverBase {
|
|
|
1182
1184
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
1183
1185
|
}
|
|
1184
1186
|
@Query(() => EmployeeSkill_, { nullable: true })
|
|
1185
|
-
async EmployeeSkill(@Arg('ID', () => Int) ID:
|
|
1187
|
+
async EmployeeSkill(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<EmployeeSkill_ | null> {
|
|
1186
1188
|
this.CheckUserReadPermissions('Employee Skills', userPayload);
|
|
1187
|
-
const sSQL = `SELECT * FROM [
|
|
1189
|
+
const sSQL = `SELECT * FROM [__mj].[vwEmployeeSkills] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Employee Skills', userPayload, EntityPermissionType.Read, 'AND');
|
|
1188
1190
|
const result = this.MapFieldNamesToCodeNames('Employee Skills', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
1189
1191
|
return result;
|
|
1190
1192
|
}
|
|
@@ -1254,20 +1256,20 @@ export class Role_ {
|
|
|
1254
1256
|
@MaxLength(8)
|
|
1255
1257
|
UpdatedAt: Date;
|
|
1256
1258
|
|
|
1257
|
-
@Field(() => [EmployeeRole_])
|
|
1258
|
-
EmployeeRolesArray: EmployeeRole_[]; // Link to EmployeeRoles
|
|
1259
|
+
@Field(() => [mj_core_schema_server_object_types.EmployeeRole_])
|
|
1260
|
+
EmployeeRolesArray: mj_core_schema_server_object_types.EmployeeRole_[]; // Link to EmployeeRoles
|
|
1259
1261
|
|
|
1260
|
-
@Field(() => [EntityPermission_])
|
|
1261
|
-
EntityPermissionsArray: EntityPermission_[]; // Link to EntityPermissions
|
|
1262
|
+
@Field(() => [mj_core_schema_server_object_types.EntityPermission_])
|
|
1263
|
+
EntityPermissionsArray: mj_core_schema_server_object_types.EntityPermission_[]; // Link to EntityPermissions
|
|
1262
1264
|
|
|
1263
|
-
@Field(() => [UserRole_])
|
|
1264
|
-
UserRolesArray: UserRole_[]; // Link to UserRoles
|
|
1265
|
+
@Field(() => [mj_core_schema_server_object_types.UserRole_])
|
|
1266
|
+
UserRolesArray: mj_core_schema_server_object_types.UserRole_[]; // Link to UserRoles
|
|
1265
1267
|
|
|
1266
|
-
@Field(() => [AuthorizationRole_])
|
|
1267
|
-
AuthorizationRolesArray: AuthorizationRole_[]; // Link to AuthorizationRoles
|
|
1268
|
+
@Field(() => [mj_core_schema_server_object_types.AuthorizationRole_])
|
|
1269
|
+
AuthorizationRolesArray: mj_core_schema_server_object_types.AuthorizationRole_[]; // Link to AuthorizationRoles
|
|
1268
1270
|
|
|
1269
|
-
@Field(() => [QueryPermission_])
|
|
1270
|
-
QueryPermissionsArray: QueryPermission_[]; // Link to QueryPermissions
|
|
1271
|
+
@Field(() => [mj_core_schema_server_object_types.QueryPermission_])
|
|
1272
|
+
QueryPermissionsArray: mj_core_schema_server_object_types.QueryPermission_[]; // Link to QueryPermissions
|
|
1271
1273
|
|
|
1272
1274
|
}
|
|
1273
1275
|
|
|
@@ -1337,9 +1339,9 @@ export class RoleResolver extends ResolverBase {
|
|
|
1337
1339
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
1338
1340
|
}
|
|
1339
1341
|
@Query(() => Role_, { nullable: true })
|
|
1340
|
-
async Role(@Arg('ID', () => Int) ID:
|
|
1342
|
+
async Role(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<Role_ | null> {
|
|
1341
1343
|
this.CheckUserReadPermissions('Roles', userPayload);
|
|
1342
|
-
const sSQL = `SELECT * FROM [
|
|
1344
|
+
const sSQL = `SELECT * FROM [__mj].[vwRoles] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Roles', userPayload, EntityPermissionType.Read, 'AND');
|
|
1343
1345
|
const result = this.MapFieldNamesToCodeNames('Roles', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
1344
1346
|
return result;
|
|
1345
1347
|
}
|
|
@@ -1347,47 +1349,47 @@ export class RoleResolver extends ResolverBase {
|
|
|
1347
1349
|
@Query(() => [Role_])
|
|
1348
1350
|
async AllRoles(@Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
1349
1351
|
this.CheckUserReadPermissions('Roles', userPayload);
|
|
1350
|
-
const sSQL = 'SELECT * FROM [
|
|
1352
|
+
const sSQL = 'SELECT * FROM [__mj].[vwRoles]' + this.getRowLevelSecurityWhereClause('Roles', userPayload, EntityPermissionType.Read, ' WHERE');
|
|
1351
1353
|
const result = this.ArrayMapFieldNamesToCodeNames('Roles', await dataSource.query(sSQL));
|
|
1352
1354
|
return result;
|
|
1353
1355
|
}
|
|
1354
1356
|
|
|
1355
|
-
@FieldResolver(() => [EmployeeRole_])
|
|
1357
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.EmployeeRole_])
|
|
1356
1358
|
async EmployeeRolesArray(@Root() role_: Role_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
1357
1359
|
this.CheckUserReadPermissions('Employee Roles', userPayload);
|
|
1358
|
-
const sSQL = `SELECT * FROM [
|
|
1360
|
+
const sSQL = `SELECT * FROM [__mj].[vwEmployeeRoles] WHERE [RoleID]=${role_.ID} ` + this.getRowLevelSecurityWhereClause('Employee Roles', userPayload, EntityPermissionType.Read, 'AND');
|
|
1359
1361
|
const result = this.ArrayMapFieldNamesToCodeNames('Employee Roles', await dataSource.query(sSQL));
|
|
1360
1362
|
return result;
|
|
1361
1363
|
}
|
|
1362
1364
|
|
|
1363
|
-
@FieldResolver(() => [EntityPermission_])
|
|
1365
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.EntityPermission_])
|
|
1364
1366
|
async EntityPermissionsArray(@Root() role_: Role_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
1365
1367
|
this.CheckUserReadPermissions('Entity Permissions', userPayload);
|
|
1366
|
-
const sSQL = `SELECT * FROM [
|
|
1368
|
+
const sSQL = `SELECT * FROM [__mj].[vwEntityPermissions] WHERE [RoleName]=${role_.ID} ` + this.getRowLevelSecurityWhereClause('Entity Permissions', userPayload, EntityPermissionType.Read, 'AND');
|
|
1367
1369
|
const result = this.ArrayMapFieldNamesToCodeNames('Entity Permissions', await dataSource.query(sSQL));
|
|
1368
1370
|
return result;
|
|
1369
1371
|
}
|
|
1370
1372
|
|
|
1371
|
-
@FieldResolver(() => [UserRole_])
|
|
1373
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.UserRole_])
|
|
1372
1374
|
async UserRolesArray(@Root() role_: Role_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
1373
1375
|
this.CheckUserReadPermissions('User Roles', userPayload);
|
|
1374
|
-
const sSQL = `SELECT * FROM [
|
|
1376
|
+
const sSQL = `SELECT * FROM [__mj].[vwUserRoles] WHERE [RoleName]=${role_.ID} ` + this.getRowLevelSecurityWhereClause('User Roles', userPayload, EntityPermissionType.Read, 'AND');
|
|
1375
1377
|
const result = this.ArrayMapFieldNamesToCodeNames('User Roles', await dataSource.query(sSQL));
|
|
1376
1378
|
return result;
|
|
1377
1379
|
}
|
|
1378
1380
|
|
|
1379
|
-
@FieldResolver(() => [AuthorizationRole_])
|
|
1381
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.AuthorizationRole_])
|
|
1380
1382
|
async AuthorizationRolesArray(@Root() role_: Role_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
1381
1383
|
this.CheckUserReadPermissions('Authorization Roles', userPayload);
|
|
1382
|
-
const sSQL = `SELECT * FROM [
|
|
1384
|
+
const sSQL = `SELECT * FROM [__mj].[vwAuthorizationRoles] WHERE [RoleName]=${role_.ID} ` + this.getRowLevelSecurityWhereClause('Authorization Roles', userPayload, EntityPermissionType.Read, 'AND');
|
|
1383
1385
|
const result = this.ArrayMapFieldNamesToCodeNames('Authorization Roles', await dataSource.query(sSQL));
|
|
1384
1386
|
return result;
|
|
1385
1387
|
}
|
|
1386
1388
|
|
|
1387
|
-
@FieldResolver(() => [QueryPermission_])
|
|
1389
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.QueryPermission_])
|
|
1388
1390
|
async QueryPermissionsArray(@Root() role_: Role_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
1389
1391
|
this.CheckUserReadPermissions('Query Permissions', userPayload);
|
|
1390
|
-
const sSQL = `SELECT * FROM [
|
|
1392
|
+
const sSQL = `SELECT * FROM [__mj].[vwQueryPermissions] WHERE [RoleName]=${role_.ID} ` + this.getRowLevelSecurityWhereClause('Query Permissions', userPayload, EntityPermissionType.Read, 'AND');
|
|
1391
1393
|
const result = this.ArrayMapFieldNamesToCodeNames('Query Permissions', await dataSource.query(sSQL));
|
|
1392
1394
|
return result;
|
|
1393
1395
|
}
|
|
@@ -1452,11 +1454,11 @@ export class Skill_ {
|
|
|
1452
1454
|
@MaxLength(100)
|
|
1453
1455
|
Parent?: string;
|
|
1454
1456
|
|
|
1455
|
-
@Field(() => [EmployeeSkill_])
|
|
1456
|
-
EmployeeSkillsArray: EmployeeSkill_[]; // Link to EmployeeSkills
|
|
1457
|
+
@Field(() => [mj_core_schema_server_object_types.EmployeeSkill_])
|
|
1458
|
+
EmployeeSkillsArray: mj_core_schema_server_object_types.EmployeeSkill_[]; // Link to EmployeeSkills
|
|
1457
1459
|
|
|
1458
|
-
@Field(() => [Skill_])
|
|
1459
|
-
SkillsArray: Skill_[]; // Link to Skills
|
|
1460
|
+
@Field(() => [mj_core_schema_server_object_types.Skill_])
|
|
1461
|
+
SkillsArray: mj_core_schema_server_object_types.Skill_[]; // Link to Skills
|
|
1460
1462
|
|
|
1461
1463
|
}
|
|
1462
1464
|
//****************************************************************************
|
|
@@ -1504,9 +1506,9 @@ export class SkillResolver extends ResolverBase {
|
|
|
1504
1506
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
1505
1507
|
}
|
|
1506
1508
|
@Query(() => Skill_, { nullable: true })
|
|
1507
|
-
async Skill(@Arg('ID', () => Int) ID:
|
|
1509
|
+
async Skill(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<Skill_ | null> {
|
|
1508
1510
|
this.CheckUserReadPermissions('Skills', userPayload);
|
|
1509
|
-
const sSQL = `SELECT * FROM [
|
|
1511
|
+
const sSQL = `SELECT * FROM [__mj].[vwSkills] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Skills', userPayload, EntityPermissionType.Read, 'AND');
|
|
1510
1512
|
const result = this.MapFieldNamesToCodeNames('Skills', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
1511
1513
|
return result;
|
|
1512
1514
|
}
|
|
@@ -1514,23 +1516,23 @@ export class SkillResolver extends ResolverBase {
|
|
|
1514
1516
|
@Query(() => [Skill_])
|
|
1515
1517
|
async AllSkills(@Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
1516
1518
|
this.CheckUserReadPermissions('Skills', userPayload);
|
|
1517
|
-
const sSQL = 'SELECT * FROM [
|
|
1519
|
+
const sSQL = 'SELECT * FROM [__mj].[vwSkills]' + this.getRowLevelSecurityWhereClause('Skills', userPayload, EntityPermissionType.Read, ' WHERE');
|
|
1518
1520
|
const result = this.ArrayMapFieldNamesToCodeNames('Skills', await dataSource.query(sSQL));
|
|
1519
1521
|
return result;
|
|
1520
1522
|
}
|
|
1521
1523
|
|
|
1522
|
-
@FieldResolver(() => [EmployeeSkill_])
|
|
1524
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.EmployeeSkill_])
|
|
1523
1525
|
async EmployeeSkillsArray(@Root() skill_: Skill_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
1524
1526
|
this.CheckUserReadPermissions('Employee Skills', userPayload);
|
|
1525
|
-
const sSQL = `SELECT * FROM [
|
|
1527
|
+
const sSQL = `SELECT * FROM [__mj].[vwEmployeeSkills] WHERE [SkillID]=${skill_.ID} ` + this.getRowLevelSecurityWhereClause('Employee Skills', userPayload, EntityPermissionType.Read, 'AND');
|
|
1526
1528
|
const result = this.ArrayMapFieldNamesToCodeNames('Employee Skills', await dataSource.query(sSQL));
|
|
1527
1529
|
return result;
|
|
1528
1530
|
}
|
|
1529
1531
|
|
|
1530
|
-
@FieldResolver(() => [Skill_])
|
|
1532
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.Skill_])
|
|
1531
1533
|
async SkillsArray(@Root() skill_: Skill_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
1532
1534
|
this.CheckUserReadPermissions('Skills', userPayload);
|
|
1533
|
-
const sSQL = `SELECT * FROM [
|
|
1535
|
+
const sSQL = `SELECT * FROM [__mj].[vwSkills] WHERE [ParentID]=${skill_.ID} ` + this.getRowLevelSecurityWhereClause('Skills', userPayload, EntityPermissionType.Read, 'AND');
|
|
1534
1536
|
const result = this.ArrayMapFieldNamesToCodeNames('Skills', await dataSource.query(sSQL));
|
|
1535
1537
|
return result;
|
|
1536
1538
|
}
|
|
@@ -1636,9 +1638,9 @@ export class IntegrationURLFormatResolver extends ResolverBase {
|
|
|
1636
1638
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
1637
1639
|
}
|
|
1638
1640
|
@Query(() => IntegrationURLFormat_, { nullable: true })
|
|
1639
|
-
async IntegrationURLFormat(@Arg('ID', () => Int) ID:
|
|
1641
|
+
async IntegrationURLFormat(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<IntegrationURLFormat_ | null> {
|
|
1640
1642
|
this.CheckUserReadPermissions('Integration URL Formats', userPayload);
|
|
1641
|
-
const sSQL = `SELECT * FROM [
|
|
1643
|
+
const sSQL = `SELECT * FROM [__mj].[vwIntegrationURLFormats] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Integration URL Formats', userPayload, EntityPermissionType.Read, 'AND');
|
|
1642
1644
|
const result = this.MapFieldNamesToCodeNames('Integration URL Formats', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
1643
1645
|
return result;
|
|
1644
1646
|
}
|
|
@@ -1646,7 +1648,7 @@ export class IntegrationURLFormatResolver extends ResolverBase {
|
|
|
1646
1648
|
@Query(() => [IntegrationURLFormat_])
|
|
1647
1649
|
async AllIntegrationURLFormats(@Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
1648
1650
|
this.CheckUserReadPermissions('Integration URL Formats', userPayload);
|
|
1649
|
-
const sSQL = 'SELECT * FROM [
|
|
1651
|
+
const sSQL = 'SELECT * FROM [__mj].[vwIntegrationURLFormats]' + this.getRowLevelSecurityWhereClause('Integration URL Formats', userPayload, EntityPermissionType.Read, ' WHERE');
|
|
1650
1652
|
const result = this.ArrayMapFieldNamesToCodeNames('Integration URL Formats', await dataSource.query(sSQL));
|
|
1651
1653
|
return result;
|
|
1652
1654
|
}
|
|
@@ -1726,11 +1728,11 @@ export class Integration_ {
|
|
|
1726
1728
|
@MaxLength(8)
|
|
1727
1729
|
UpdatedAt: Date;
|
|
1728
1730
|
|
|
1729
|
-
@Field(() => [IntegrationURLFormat_])
|
|
1730
|
-
IntegrationURLFormatsArray: IntegrationURLFormat_[]; // Link to IntegrationURLFormats
|
|
1731
|
+
@Field(() => [mj_core_schema_server_object_types.IntegrationURLFormat_])
|
|
1732
|
+
IntegrationURLFormatsArray: mj_core_schema_server_object_types.IntegrationURLFormat_[]; // Link to IntegrationURLFormats
|
|
1731
1733
|
|
|
1732
|
-
@Field(() => [CompanyIntegration_])
|
|
1733
|
-
CompanyIntegrationsArray: CompanyIntegration_[]; // Link to CompanyIntegrations
|
|
1734
|
+
@Field(() => [mj_core_schema_server_object_types.CompanyIntegration_])
|
|
1735
|
+
CompanyIntegrationsArray: mj_core_schema_server_object_types.CompanyIntegration_[]; // Link to CompanyIntegrations
|
|
1734
1736
|
|
|
1735
1737
|
}
|
|
1736
1738
|
|
|
@@ -1809,9 +1811,9 @@ export class IntegrationResolver extends ResolverBase {
|
|
|
1809
1811
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
1810
1812
|
}
|
|
1811
1813
|
@Query(() => Integration_, { nullable: true })
|
|
1812
|
-
async Integration(@Arg('ID', () => Int) ID:
|
|
1814
|
+
async Integration(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<Integration_ | null> {
|
|
1813
1815
|
this.CheckUserReadPermissions('Integrations', userPayload);
|
|
1814
|
-
const sSQL = `SELECT * FROM [
|
|
1816
|
+
const sSQL = `SELECT * FROM [__mj].[vwIntegrations] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Integrations', userPayload, EntityPermissionType.Read, 'AND');
|
|
1815
1817
|
const result = this.MapFieldNamesToCodeNames('Integrations', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
1816
1818
|
return result;
|
|
1817
1819
|
}
|
|
@@ -1819,23 +1821,23 @@ export class IntegrationResolver extends ResolverBase {
|
|
|
1819
1821
|
@Query(() => [Integration_])
|
|
1820
1822
|
async AllIntegrations(@Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
1821
1823
|
this.CheckUserReadPermissions('Integrations', userPayload);
|
|
1822
|
-
const sSQL = 'SELECT * FROM [
|
|
1824
|
+
const sSQL = 'SELECT * FROM [__mj].[vwIntegrations]' + this.getRowLevelSecurityWhereClause('Integrations', userPayload, EntityPermissionType.Read, ' WHERE');
|
|
1823
1825
|
const result = this.ArrayMapFieldNamesToCodeNames('Integrations', await dataSource.query(sSQL));
|
|
1824
1826
|
return result;
|
|
1825
1827
|
}
|
|
1826
1828
|
|
|
1827
|
-
@FieldResolver(() => [IntegrationURLFormat_])
|
|
1829
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.IntegrationURLFormat_])
|
|
1828
1830
|
async IntegrationURLFormatsArray(@Root() integration_: Integration_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
1829
1831
|
this.CheckUserReadPermissions('Integration URL Formats', userPayload);
|
|
1830
|
-
const sSQL = `SELECT * FROM [
|
|
1832
|
+
const sSQL = `SELECT * FROM [__mj].[vwIntegrationURLFormats] WHERE [IntegrationID]=${integration_.ID} ` + this.getRowLevelSecurityWhereClause('Integration URL Formats', userPayload, EntityPermissionType.Read, 'AND');
|
|
1831
1833
|
const result = this.ArrayMapFieldNamesToCodeNames('Integration URL Formats', await dataSource.query(sSQL));
|
|
1832
1834
|
return result;
|
|
1833
1835
|
}
|
|
1834
1836
|
|
|
1835
|
-
@FieldResolver(() => [CompanyIntegration_])
|
|
1837
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.CompanyIntegration_])
|
|
1836
1838
|
async CompanyIntegrationsArray(@Root() integration_: Integration_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
1837
1839
|
this.CheckUserReadPermissions('Company Integrations', userPayload);
|
|
1838
|
-
const sSQL = `SELECT * FROM [
|
|
1840
|
+
const sSQL = `SELECT * FROM [__mj].[vwCompanyIntegrations] WHERE [IntegrationName]=${integration_.ID} ` + this.getRowLevelSecurityWhereClause('Company Integrations', userPayload, EntityPermissionType.Read, 'AND');
|
|
1839
1841
|
const result = this.ArrayMapFieldNamesToCodeNames('Company Integrations', await dataSource.query(sSQL));
|
|
1840
1842
|
return result;
|
|
1841
1843
|
}
|
|
@@ -1968,17 +1970,17 @@ export class CompanyIntegration_ {
|
|
|
1968
1970
|
@MaxLength(8)
|
|
1969
1971
|
LastRunEndedAt?: Date;
|
|
1970
1972
|
|
|
1971
|
-
@Field(() => [List_])
|
|
1972
|
-
ListsArray: List_[]; // Link to Lists
|
|
1973
|
+
@Field(() => [mj_core_schema_server_object_types.List_])
|
|
1974
|
+
ListsArray: mj_core_schema_server_object_types.List_[]; // Link to Lists
|
|
1973
1975
|
|
|
1974
|
-
@Field(() => [EmployeeCompanyIntegration_])
|
|
1975
|
-
EmployeeCompanyIntegrationsArray: EmployeeCompanyIntegration_[]; // Link to EmployeeCompanyIntegrations
|
|
1976
|
+
@Field(() => [mj_core_schema_server_object_types.EmployeeCompanyIntegration_])
|
|
1977
|
+
EmployeeCompanyIntegrationsArray: mj_core_schema_server_object_types.EmployeeCompanyIntegration_[]; // Link to EmployeeCompanyIntegrations
|
|
1976
1978
|
|
|
1977
|
-
@Field(() => [CompanyIntegrationRun_])
|
|
1978
|
-
CompanyIntegrationRunsArray: CompanyIntegrationRun_[]; // Link to CompanyIntegrationRuns
|
|
1979
|
+
@Field(() => [mj_core_schema_server_object_types.CompanyIntegrationRun_])
|
|
1980
|
+
CompanyIntegrationRunsArray: mj_core_schema_server_object_types.CompanyIntegrationRun_[]; // Link to CompanyIntegrationRuns
|
|
1979
1981
|
|
|
1980
|
-
@Field(() => [CompanyIntegrationRecordMap_])
|
|
1981
|
-
CompanyIntegrationRecordMapsArray: CompanyIntegrationRecordMap_[]; // Link to CompanyIntegrationRecordMaps
|
|
1982
|
+
@Field(() => [mj_core_schema_server_object_types.CompanyIntegrationRecordMap_])
|
|
1983
|
+
CompanyIntegrationRecordMapsArray: mj_core_schema_server_object_types.CompanyIntegrationRecordMap_[]; // Link to CompanyIntegrationRecordMaps
|
|
1982
1984
|
|
|
1983
1985
|
}
|
|
1984
1986
|
|
|
@@ -2072,41 +2074,41 @@ export class CompanyIntegrationResolver extends ResolverBase {
|
|
|
2072
2074
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
2073
2075
|
}
|
|
2074
2076
|
@Query(() => CompanyIntegration_, { nullable: true })
|
|
2075
|
-
async CompanyIntegration(@Arg('ID', () => Int) ID:
|
|
2077
|
+
async CompanyIntegration(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<CompanyIntegration_ | null> {
|
|
2076
2078
|
this.CheckUserReadPermissions('Company Integrations', userPayload);
|
|
2077
|
-
const sSQL = `SELECT * FROM [
|
|
2079
|
+
const sSQL = `SELECT * FROM [__mj].[vwCompanyIntegrations] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Company Integrations', userPayload, EntityPermissionType.Read, 'AND');
|
|
2078
2080
|
const result = this.MapFieldNamesToCodeNames('Company Integrations', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
2079
2081
|
return result;
|
|
2080
2082
|
}
|
|
2081
2083
|
|
|
2082
|
-
@FieldResolver(() => [List_])
|
|
2084
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.List_])
|
|
2083
2085
|
async ListsArray(@Root() companyintegration_: CompanyIntegration_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
2084
2086
|
this.CheckUserReadPermissions('Lists', userPayload);
|
|
2085
|
-
const sSQL = `SELECT * FROM [
|
|
2087
|
+
const sSQL = `SELECT * FROM [__mj].[vwLists] WHERE [CompanyIntegrationID]=${companyintegration_.ID} ` + this.getRowLevelSecurityWhereClause('Lists', userPayload, EntityPermissionType.Read, 'AND');
|
|
2086
2088
|
const result = this.ArrayMapFieldNamesToCodeNames('Lists', await dataSource.query(sSQL));
|
|
2087
2089
|
return result;
|
|
2088
2090
|
}
|
|
2089
2091
|
|
|
2090
|
-
@FieldResolver(() => [EmployeeCompanyIntegration_])
|
|
2092
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.EmployeeCompanyIntegration_])
|
|
2091
2093
|
async EmployeeCompanyIntegrationsArray(@Root() companyintegration_: CompanyIntegration_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
2092
2094
|
this.CheckUserReadPermissions('Employee Company Integrations', userPayload);
|
|
2093
|
-
const sSQL = `SELECT * FROM [
|
|
2095
|
+
const sSQL = `SELECT * FROM [__mj].[vwEmployeeCompanyIntegrations] WHERE [CompanyIntegrationID]=${companyintegration_.ID} ` + this.getRowLevelSecurityWhereClause('Employee Company Integrations', userPayload, EntityPermissionType.Read, 'AND');
|
|
2094
2096
|
const result = this.ArrayMapFieldNamesToCodeNames('Employee Company Integrations', await dataSource.query(sSQL));
|
|
2095
2097
|
return result;
|
|
2096
2098
|
}
|
|
2097
2099
|
|
|
2098
|
-
@FieldResolver(() => [CompanyIntegrationRun_])
|
|
2100
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.CompanyIntegrationRun_])
|
|
2099
2101
|
async CompanyIntegrationRunsArray(@Root() companyintegration_: CompanyIntegration_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
2100
2102
|
this.CheckUserReadPermissions('Company Integration Runs', userPayload);
|
|
2101
|
-
const sSQL = `SELECT * FROM [
|
|
2103
|
+
const sSQL = `SELECT * FROM [__mj].[vwCompanyIntegrationRuns] WHERE [CompanyIntegrationID]=${companyintegration_.ID} ` + this.getRowLevelSecurityWhereClause('Company Integration Runs', userPayload, EntityPermissionType.Read, 'AND');
|
|
2102
2104
|
const result = this.ArrayMapFieldNamesToCodeNames('Company Integration Runs', await dataSource.query(sSQL));
|
|
2103
2105
|
return result;
|
|
2104
2106
|
}
|
|
2105
2107
|
|
|
2106
|
-
@FieldResolver(() => [CompanyIntegrationRecordMap_])
|
|
2108
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.CompanyIntegrationRecordMap_])
|
|
2107
2109
|
async CompanyIntegrationRecordMapsArray(@Root() companyintegration_: CompanyIntegration_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
2108
2110
|
this.CheckUserReadPermissions('Company Integration Record Maps', userPayload);
|
|
2109
|
-
const sSQL = `SELECT * FROM [
|
|
2111
|
+
const sSQL = `SELECT * FROM [__mj].[vwCompanyIntegrationRecordMaps] WHERE [CompanyIntegrationID]=${companyintegration_.ID} ` + this.getRowLevelSecurityWhereClause('Company Integration Record Maps', userPayload, EntityPermissionType.Read, 'AND');
|
|
2110
2112
|
const result = this.ArrayMapFieldNamesToCodeNames('Company Integration Record Maps', await dataSource.query(sSQL));
|
|
2111
2113
|
return result;
|
|
2112
2114
|
}
|
|
@@ -2321,8 +2323,8 @@ export class EntityField_ {
|
|
|
2321
2323
|
@MaxLength(8000)
|
|
2322
2324
|
RelatedEntityClassName?: string;
|
|
2323
2325
|
|
|
2324
|
-
@Field(() => [EntityFieldValue_])
|
|
2325
|
-
EntityFieldValuesArray: EntityFieldValue_[]; // Link to EntityFieldValues
|
|
2326
|
+
@Field(() => [mj_core_schema_server_object_types.EntityFieldValue_])
|
|
2327
|
+
EntityFieldValuesArray: mj_core_schema_server_object_types.EntityFieldValue_[]; // Link to EntityFieldValues
|
|
2326
2328
|
|
|
2327
2329
|
}
|
|
2328
2330
|
|
|
@@ -2525,9 +2527,9 @@ export class EntityFieldResolver extends ResolverBase {
|
|
|
2525
2527
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
2526
2528
|
}
|
|
2527
2529
|
@Query(() => EntityField_, { nullable: true })
|
|
2528
|
-
async EntityField(@Arg('ID', () => Int) ID:
|
|
2530
|
+
async EntityField(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<EntityField_ | null> {
|
|
2529
2531
|
this.CheckUserReadPermissions('Entity Fields', userPayload);
|
|
2530
|
-
const sSQL = `SELECT * FROM [
|
|
2532
|
+
const sSQL = `SELECT * FROM [__mj].[vwEntityFields] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Entity Fields', userPayload, EntityPermissionType.Read, 'AND');
|
|
2531
2533
|
const result = this.MapFieldNamesToCodeNames('Entity Fields', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
2532
2534
|
return result;
|
|
2533
2535
|
}
|
|
@@ -2535,15 +2537,15 @@ export class EntityFieldResolver extends ResolverBase {
|
|
|
2535
2537
|
@Query(() => [EntityField_])
|
|
2536
2538
|
async AllEntityFields(@Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
2537
2539
|
this.CheckUserReadPermissions('Entity Fields', userPayload);
|
|
2538
|
-
const sSQL = 'SELECT * FROM [
|
|
2540
|
+
const sSQL = 'SELECT * FROM [__mj].[vwEntityFields]' + this.getRowLevelSecurityWhereClause('Entity Fields', userPayload, EntityPermissionType.Read, ' WHERE');
|
|
2539
2541
|
const result = this.ArrayMapFieldNamesToCodeNames('Entity Fields', await dataSource.query(sSQL));
|
|
2540
2542
|
return result;
|
|
2541
2543
|
}
|
|
2542
2544
|
|
|
2543
|
-
@FieldResolver(() => [EntityFieldValue_])
|
|
2545
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.EntityFieldValue_])
|
|
2544
2546
|
async EntityFieldValuesArray(@Root() entityfield_: EntityField_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
2545
2547
|
this.CheckUserReadPermissions('Entity Field Values', userPayload);
|
|
2546
|
-
const sSQL = `SELECT * FROM [
|
|
2548
|
+
const sSQL = `SELECT * FROM [__mj].[vwEntityFieldValues] WHERE [EntityFieldID]=${entityfield_.ID} ` + this.getRowLevelSecurityWhereClause('Entity Field Values', userPayload, EntityPermissionType.Read, 'AND');
|
|
2547
2549
|
const result = this.ArrayMapFieldNamesToCodeNames('Entity Field Values', await dataSource.query(sSQL));
|
|
2548
2550
|
return result;
|
|
2549
2551
|
}
|
|
@@ -2610,7 +2612,7 @@ export class EntityFieldResolver extends ResolverBase {
|
|
|
2610
2612
|
}
|
|
2611
2613
|
|
|
2612
2614
|
@Mutation(() => EntityField_)
|
|
2613
|
-
async DeleteEntityField(@Arg('ID', () => Int) ID:
|
|
2615
|
+
async DeleteEntityField(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
2614
2616
|
if (await this.BeforeDelete(dataSource, ID)) { // fire event and proceed if it wasn't cancelled
|
|
2615
2617
|
const entityObject = <EntityFieldEntity>await new Metadata().GetEntityObject('Entity Fields', this.GetUserFromPayload(userPayload));
|
|
2616
2618
|
await entityObject.Load(ID);
|
|
@@ -2627,11 +2629,11 @@ export class EntityFieldResolver extends ResolverBase {
|
|
|
2627
2629
|
}
|
|
2628
2630
|
|
|
2629
2631
|
// Before/After UPDATE Event Hooks for Sub-Classes to Override
|
|
2630
|
-
protected async BeforeDelete(dataSource: DataSource, ID:
|
|
2632
|
+
protected async BeforeDelete(dataSource: DataSource, ID: number): Promise<boolean> {
|
|
2631
2633
|
const i = ID, d = dataSource; // prevent error;
|
|
2632
2634
|
return true;
|
|
2633
2635
|
}
|
|
2634
|
-
protected async AfterDelete(dataSource: DataSource, ID:
|
|
2636
|
+
protected async AfterDelete(dataSource: DataSource, ID: number) {
|
|
2635
2637
|
const i = ID, d = dataSource; // prevent error
|
|
2636
2638
|
}
|
|
2637
2639
|
|
|
@@ -2804,77 +2806,83 @@ export class Entity_ {
|
|
|
2804
2806
|
@MaxLength(510)
|
|
2805
2807
|
ParentBaseView?: string;
|
|
2806
2808
|
|
|
2807
|
-
@Field(() => [EntityField_])
|
|
2808
|
-
EntityFieldsArray: EntityField_[]; // Link to EntityFields
|
|
2809
|
+
@Field(() => [mj_core_schema_server_object_types.EntityField_])
|
|
2810
|
+
EntityFieldsArray: mj_core_schema_server_object_types.EntityField_[]; // Link to EntityFields
|
|
2809
2811
|
|
|
2810
|
-
@Field(() => [EntityPermission_])
|
|
2811
|
-
EntityPermissionsArray: EntityPermission_[]; // Link to EntityPermissions
|
|
2812
|
+
@Field(() => [mj_core_schema_server_object_types.EntityPermission_])
|
|
2813
|
+
EntityPermissionsArray: mj_core_schema_server_object_types.EntityPermission_[]; // Link to EntityPermissions
|
|
2812
2814
|
|
|
2813
|
-
@Field(() => [EntityRelationship_])
|
|
2814
|
-
EntityRelationshipsArray: EntityRelationship_[]; // Link to EntityRelationships
|
|
2815
|
+
@Field(() => [mj_core_schema_server_object_types.EntityRelationship_])
|
|
2816
|
+
EntityRelationshipsArray: mj_core_schema_server_object_types.EntityRelationship_[]; // Link to EntityRelationships
|
|
2815
2817
|
|
|
2816
|
-
@Field(() => [EntityAIAction_])
|
|
2817
|
-
EntityAIActionsArray: EntityAIAction_[]; // Link to EntityAIActions
|
|
2818
|
+
@Field(() => [mj_core_schema_server_object_types.EntityAIAction_])
|
|
2819
|
+
EntityAIActionsArray: mj_core_schema_server_object_types.EntityAIAction_[]; // Link to EntityAIActions
|
|
2818
2820
|
|
|
2819
|
-
@Field(() => [UserRecordLog_])
|
|
2820
|
-
UserRecordLogsArray: UserRecordLog_[]; // Link to UserRecordLogs
|
|
2821
|
+
@Field(() => [mj_core_schema_server_object_types.UserRecordLog_])
|
|
2822
|
+
UserRecordLogsArray: mj_core_schema_server_object_types.UserRecordLog_[]; // Link to UserRecordLogs
|
|
2821
2823
|
|
|
2822
|
-
@Field(() => [IntegrationURLFormat_])
|
|
2823
|
-
IntegrationURLFormatsArray: IntegrationURLFormat_[]; // Link to IntegrationURLFormats
|
|
2824
|
+
@Field(() => [mj_core_schema_server_object_types.IntegrationURLFormat_])
|
|
2825
|
+
IntegrationURLFormatsArray: mj_core_schema_server_object_types.IntegrationURLFormat_[]; // Link to IntegrationURLFormats
|
|
2824
2826
|
|
|
2825
|
-
@Field(() => [Entity_])
|
|
2826
|
-
EntitiesArray: Entity_[]; // Link to Entities
|
|
2827
|
+
@Field(() => [mj_core_schema_server_object_types.Entity_])
|
|
2828
|
+
EntitiesArray: mj_core_schema_server_object_types.Entity_[]; // Link to Entities
|
|
2827
2829
|
|
|
2828
|
-
@Field(() => [UserFavorite_])
|
|
2829
|
-
UserFavoritesArray: UserFavorite_[]; // Link to UserFavorites
|
|
2830
|
+
@Field(() => [mj_core_schema_server_object_types.UserFavorite_])
|
|
2831
|
+
UserFavoritesArray: mj_core_schema_server_object_types.UserFavorite_[]; // Link to UserFavorites
|
|
2830
2832
|
|
|
2831
|
-
@Field(() => [CompanyIntegrationRunDetail_])
|
|
2832
|
-
CompanyIntegrationRunDetailsArray: CompanyIntegrationRunDetail_[]; // Link to CompanyIntegrationRunDetails
|
|
2833
|
+
@Field(() => [mj_core_schema_server_object_types.CompanyIntegrationRunDetail_])
|
|
2834
|
+
CompanyIntegrationRunDetailsArray: mj_core_schema_server_object_types.CompanyIntegrationRunDetail_[]; // Link to CompanyIntegrationRunDetails
|
|
2833
2835
|
|
|
2834
|
-
@Field(() => [ApplicationEntity_])
|
|
2835
|
-
ApplicationEntitiesArray: ApplicationEntity_[]; // Link to ApplicationEntities
|
|
2836
|
+
@Field(() => [mj_core_schema_server_object_types.ApplicationEntity_])
|
|
2837
|
+
ApplicationEntitiesArray: mj_core_schema_server_object_types.ApplicationEntity_[]; // Link to ApplicationEntities
|
|
2836
2838
|
|
|
2837
|
-
@Field(() => [UserApplicationEntity_])
|
|
2838
|
-
UserApplicationEntitiesArray: UserApplicationEntity_[]; // Link to UserApplicationEntities
|
|
2839
|
+
@Field(() => [mj_core_schema_server_object_types.UserApplicationEntity_])
|
|
2840
|
+
UserApplicationEntitiesArray: mj_core_schema_server_object_types.UserApplicationEntity_[]; // Link to UserApplicationEntities
|
|
2839
2841
|
|
|
2840
|
-
@Field(() => [List_])
|
|
2841
|
-
ListsArray: List_[]; // Link to Lists
|
|
2842
|
+
@Field(() => [mj_core_schema_server_object_types.List_])
|
|
2843
|
+
ListsArray: mj_core_schema_server_object_types.List_[]; // Link to Lists
|
|
2842
2844
|
|
|
2843
|
-
@Field(() => [UserView_])
|
|
2844
|
-
UserViewsArray: UserView_[]; // Link to UserViews
|
|
2845
|
+
@Field(() => [mj_core_schema_server_object_types.UserView_])
|
|
2846
|
+
UserViewsArray: mj_core_schema_server_object_types.UserView_[]; // Link to UserViews
|
|
2845
2847
|
|
|
2846
|
-
@Field(() => [RecordChange_])
|
|
2847
|
-
RecordChangesArray: RecordChange_[]; // Link to RecordChanges
|
|
2848
|
+
@Field(() => [mj_core_schema_server_object_types.RecordChange_])
|
|
2849
|
+
RecordChangesArray: mj_core_schema_server_object_types.RecordChange_[]; // Link to RecordChanges
|
|
2848
2850
|
|
|
2849
|
-
@Field(() => [AuditLog_])
|
|
2850
|
-
AuditLogsArray: AuditLog_[]; // Link to AuditLogs
|
|
2851
|
+
@Field(() => [mj_core_schema_server_object_types.AuditLog_])
|
|
2852
|
+
AuditLogsArray: mj_core_schema_server_object_types.AuditLog_[]; // Link to AuditLogs
|
|
2851
2853
|
|
|
2852
|
-
@Field(() => [ResourceType_])
|
|
2853
|
-
ResourceTypesArray: ResourceType_[]; // Link to ResourceTypes
|
|
2854
|
+
@Field(() => [mj_core_schema_server_object_types.ResourceType_])
|
|
2855
|
+
ResourceTypesArray: mj_core_schema_server_object_types.ResourceType_[]; // Link to ResourceTypes
|
|
2854
2856
|
|
|
2855
|
-
@Field(() => [TaggedItem_])
|
|
2856
|
-
TaggedItemsArray: TaggedItem_[]; // Link to TaggedItems
|
|
2857
|
+
@Field(() => [mj_core_schema_server_object_types.TaggedItem_])
|
|
2858
|
+
TaggedItemsArray: mj_core_schema_server_object_types.TaggedItem_[]; // Link to TaggedItems
|
|
2857
2859
|
|
|
2858
|
-
@Field(() => [DatasetItem_])
|
|
2859
|
-
DatasetItemsArray: DatasetItem_[]; // Link to DatasetItems
|
|
2860
|
+
@Field(() => [mj_core_schema_server_object_types.DatasetItem_])
|
|
2861
|
+
DatasetItemsArray: mj_core_schema_server_object_types.DatasetItem_[]; // Link to DatasetItems
|
|
2860
2862
|
|
|
2861
|
-
@Field(() => [CompanyIntegrationRecordMap_])
|
|
2862
|
-
CompanyIntegrationRecordMapsArray: CompanyIntegrationRecordMap_[]; // Link to CompanyIntegrationRecordMaps
|
|
2863
|
+
@Field(() => [mj_core_schema_server_object_types.CompanyIntegrationRecordMap_])
|
|
2864
|
+
CompanyIntegrationRecordMapsArray: mj_core_schema_server_object_types.CompanyIntegrationRecordMap_[]; // Link to CompanyIntegrationRecordMaps
|
|
2863
2865
|
|
|
2864
|
-
@Field(() => [RecordMergeLog_])
|
|
2865
|
-
RecordMergeLogsArray: RecordMergeLog_[]; // Link to RecordMergeLogs
|
|
2866
|
+
@Field(() => [mj_core_schema_server_object_types.RecordMergeLog_])
|
|
2867
|
+
RecordMergeLogsArray: mj_core_schema_server_object_types.RecordMergeLog_[]; // Link to RecordMergeLogs
|
|
2866
2868
|
|
|
2867
|
-
@Field(() => [QueryField_])
|
|
2868
|
-
QueryFieldsArray: QueryField_[]; // Link to QueryFields
|
|
2869
|
+
@Field(() => [mj_core_schema_server_object_types.QueryField_])
|
|
2870
|
+
QueryFieldsArray: mj_core_schema_server_object_types.QueryField_[]; // Link to QueryFields
|
|
2869
2871
|
|
|
2870
|
-
@Field(() => [Conversation_])
|
|
2871
|
-
ConversationsArray: Conversation_[]; // Link to Conversations
|
|
2872
|
+
@Field(() => [mj_core_schema_server_object_types.Conversation_])
|
|
2873
|
+
ConversationsArray: mj_core_schema_server_object_types.Conversation_[]; // Link to Conversations
|
|
2872
2874
|
|
|
2873
|
-
@Field(() => [EntityDocument_])
|
|
2874
|
-
EntityDocumentsArray: EntityDocument_[]; // Link to EntityDocuments
|
|
2875
|
+
@Field(() => [mj_core_schema_server_object_types.EntityDocument_])
|
|
2876
|
+
EntityDocumentsArray: mj_core_schema_server_object_types.EntityDocument_[]; // Link to EntityDocuments
|
|
2875
2877
|
|
|
2876
|
-
@Field(() => [DataContextItem_])
|
|
2877
|
-
DataContextItemsArray: DataContextItem_[]; // Link to DataContextItems
|
|
2878
|
+
@Field(() => [mj_core_schema_server_object_types.DataContextItem_])
|
|
2879
|
+
DataContextItemsArray: mj_core_schema_server_object_types.DataContextItem_[]; // Link to DataContextItems
|
|
2880
|
+
|
|
2881
|
+
@Field(() => [mj_core_schema_server_object_types.User_])
|
|
2882
|
+
UsersArray: mj_core_schema_server_object_types.User_[]; // Link to Users
|
|
2883
|
+
|
|
2884
|
+
@Field(() => [mj_core_schema_server_object_types.EntityRecordDocument_])
|
|
2885
|
+
EntityRecordDocumentsArray: mj_core_schema_server_object_types.EntityRecordDocument_[]; // Link to EntityRecordDocuments
|
|
2878
2886
|
|
|
2879
2887
|
}
|
|
2880
2888
|
|
|
@@ -3158,9 +3166,9 @@ export class EntityResolverBase extends ResolverBase {
|
|
|
3158
3166
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
3159
3167
|
}
|
|
3160
3168
|
@Query(() => Entity_, { nullable: true })
|
|
3161
|
-
async Entity(@Arg('ID', () => Int) ID:
|
|
3169
|
+
async Entity(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<Entity_ | null> {
|
|
3162
3170
|
this.CheckUserReadPermissions('Entities', userPayload);
|
|
3163
|
-
const sSQL = `SELECT * FROM [
|
|
3171
|
+
const sSQL = `SELECT * FROM [__mj].[vwEntities] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Entities', userPayload, EntityPermissionType.Read, 'AND');
|
|
3164
3172
|
const result = this.MapFieldNamesToCodeNames('Entities', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
3165
3173
|
return result;
|
|
3166
3174
|
}
|
|
@@ -3168,202 +3176,218 @@ export class EntityResolverBase extends ResolverBase {
|
|
|
3168
3176
|
@Query(() => [Entity_])
|
|
3169
3177
|
async AllEntities(@Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3170
3178
|
this.CheckUserReadPermissions('Entities', userPayload);
|
|
3171
|
-
const sSQL = 'SELECT * FROM [
|
|
3179
|
+
const sSQL = 'SELECT * FROM [__mj].[vwEntities]' + this.getRowLevelSecurityWhereClause('Entities', userPayload, EntityPermissionType.Read, ' WHERE');
|
|
3172
3180
|
const result = this.ArrayMapFieldNamesToCodeNames('Entities', await dataSource.query(sSQL));
|
|
3173
3181
|
return result;
|
|
3174
3182
|
}
|
|
3175
3183
|
|
|
3176
|
-
@FieldResolver(() => [EntityField_])
|
|
3184
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.EntityField_])
|
|
3177
3185
|
async EntityFieldsArray(@Root() entity_: Entity_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3178
3186
|
this.CheckUserReadPermissions('Entity Fields', userPayload);
|
|
3179
|
-
const sSQL = `SELECT * FROM [
|
|
3187
|
+
const sSQL = `SELECT * FROM [__mj].[vwEntityFields] WHERE [EntityID]=${entity_.ID} ` + this.getRowLevelSecurityWhereClause('Entity Fields', userPayload, EntityPermissionType.Read, 'AND');
|
|
3180
3188
|
const result = this.ArrayMapFieldNamesToCodeNames('Entity Fields', await dataSource.query(sSQL));
|
|
3181
3189
|
return result;
|
|
3182
3190
|
}
|
|
3183
3191
|
|
|
3184
|
-
@FieldResolver(() => [EntityPermission_])
|
|
3192
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.EntityPermission_])
|
|
3185
3193
|
async EntityPermissionsArray(@Root() entity_: Entity_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3186
3194
|
this.CheckUserReadPermissions('Entity Permissions', userPayload);
|
|
3187
|
-
const sSQL = `SELECT * FROM [
|
|
3195
|
+
const sSQL = `SELECT * FROM [__mj].[vwEntityPermissions] WHERE [EntityID]=${entity_.ID} ` + this.getRowLevelSecurityWhereClause('Entity Permissions', userPayload, EntityPermissionType.Read, 'AND');
|
|
3188
3196
|
const result = this.ArrayMapFieldNamesToCodeNames('Entity Permissions', await dataSource.query(sSQL));
|
|
3189
3197
|
return result;
|
|
3190
3198
|
}
|
|
3191
3199
|
|
|
3192
|
-
@FieldResolver(() => [EntityRelationship_])
|
|
3200
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.EntityRelationship_])
|
|
3193
3201
|
async EntityRelationshipsArray(@Root() entity_: Entity_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3194
3202
|
this.CheckUserReadPermissions('Entity Relationships', userPayload);
|
|
3195
|
-
const sSQL = `SELECT * FROM [
|
|
3203
|
+
const sSQL = `SELECT * FROM [__mj].[vwEntityRelationships] WHERE [EntityID]=${entity_.ID} ` + this.getRowLevelSecurityWhereClause('Entity Relationships', userPayload, EntityPermissionType.Read, 'AND');
|
|
3196
3204
|
const result = this.ArrayMapFieldNamesToCodeNames('Entity Relationships', await dataSource.query(sSQL));
|
|
3197
3205
|
return result;
|
|
3198
3206
|
}
|
|
3199
3207
|
|
|
3200
|
-
@FieldResolver(() => [EntityAIAction_])
|
|
3208
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.EntityAIAction_])
|
|
3201
3209
|
async EntityAIActionsArray(@Root() entity_: Entity_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3202
3210
|
this.CheckUserReadPermissions('Entity AI Actions', userPayload);
|
|
3203
|
-
const sSQL = `SELECT * FROM [
|
|
3211
|
+
const sSQL = `SELECT * FROM [__mj].[vwEntityAIActions] WHERE [EntityID]=${entity_.ID} ` + this.getRowLevelSecurityWhereClause('Entity AI Actions', userPayload, EntityPermissionType.Read, 'AND');
|
|
3204
3212
|
const result = this.ArrayMapFieldNamesToCodeNames('Entity AI Actions', await dataSource.query(sSQL));
|
|
3205
3213
|
return result;
|
|
3206
3214
|
}
|
|
3207
3215
|
|
|
3208
|
-
@FieldResolver(() => [UserRecordLog_])
|
|
3216
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.UserRecordLog_])
|
|
3209
3217
|
async UserRecordLogsArray(@Root() entity_: Entity_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3210
3218
|
this.CheckUserReadPermissions('User Record Logs', userPayload);
|
|
3211
|
-
const sSQL = `SELECT * FROM [
|
|
3219
|
+
const sSQL = `SELECT * FROM [__mj].[vwUserRecordLogs] WHERE [EntityID]=${entity_.ID} ` + this.getRowLevelSecurityWhereClause('User Record Logs', userPayload, EntityPermissionType.Read, 'AND');
|
|
3212
3220
|
const result = this.ArrayMapFieldNamesToCodeNames('User Record Logs', await dataSource.query(sSQL));
|
|
3213
3221
|
return result;
|
|
3214
3222
|
}
|
|
3215
3223
|
|
|
3216
|
-
@FieldResolver(() => [IntegrationURLFormat_])
|
|
3224
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.IntegrationURLFormat_])
|
|
3217
3225
|
async IntegrationURLFormatsArray(@Root() entity_: Entity_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3218
3226
|
this.CheckUserReadPermissions('Integration URL Formats', userPayload);
|
|
3219
|
-
const sSQL = `SELECT * FROM [
|
|
3227
|
+
const sSQL = `SELECT * FROM [__mj].[vwIntegrationURLFormats] WHERE [EntityID]=${entity_.ID} ` + this.getRowLevelSecurityWhereClause('Integration URL Formats', userPayload, EntityPermissionType.Read, 'AND');
|
|
3220
3228
|
const result = this.ArrayMapFieldNamesToCodeNames('Integration URL Formats', await dataSource.query(sSQL));
|
|
3221
3229
|
return result;
|
|
3222
3230
|
}
|
|
3223
3231
|
|
|
3224
|
-
@FieldResolver(() => [Entity_])
|
|
3232
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.Entity_])
|
|
3225
3233
|
async EntitiesArray(@Root() entity_: Entity_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3226
3234
|
this.CheckUserReadPermissions('Entities', userPayload);
|
|
3227
|
-
const sSQL = `SELECT * FROM [
|
|
3235
|
+
const sSQL = `SELECT * FROM [__mj].[vwEntities] WHERE [ParentID]=${entity_.ID} ` + this.getRowLevelSecurityWhereClause('Entities', userPayload, EntityPermissionType.Read, 'AND');
|
|
3228
3236
|
const result = this.ArrayMapFieldNamesToCodeNames('Entities', await dataSource.query(sSQL));
|
|
3229
3237
|
return result;
|
|
3230
3238
|
}
|
|
3231
3239
|
|
|
3232
|
-
@FieldResolver(() => [UserFavorite_])
|
|
3240
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.UserFavorite_])
|
|
3233
3241
|
async UserFavoritesArray(@Root() entity_: Entity_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3234
3242
|
this.CheckUserReadPermissions('User Favorites', userPayload);
|
|
3235
|
-
const sSQL = `SELECT * FROM [
|
|
3243
|
+
const sSQL = `SELECT * FROM [__mj].[vwUserFavorites] WHERE [EntityID]=${entity_.ID} ` + this.getRowLevelSecurityWhereClause('User Favorites', userPayload, EntityPermissionType.Read, 'AND');
|
|
3236
3244
|
const result = this.ArrayMapFieldNamesToCodeNames('User Favorites', await dataSource.query(sSQL));
|
|
3237
3245
|
return result;
|
|
3238
3246
|
}
|
|
3239
3247
|
|
|
3240
|
-
@FieldResolver(() => [CompanyIntegrationRunDetail_])
|
|
3248
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.CompanyIntegrationRunDetail_])
|
|
3241
3249
|
async CompanyIntegrationRunDetailsArray(@Root() entity_: Entity_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3242
3250
|
this.CheckUserReadPermissions('Company Integration Run Details', userPayload);
|
|
3243
|
-
const sSQL = `SELECT * FROM [
|
|
3251
|
+
const sSQL = `SELECT * FROM [__mj].[vwCompanyIntegrationRunDetails] WHERE [EntityID]=${entity_.ID} ` + this.getRowLevelSecurityWhereClause('Company Integration Run Details', userPayload, EntityPermissionType.Read, 'AND');
|
|
3244
3252
|
const result = this.ArrayMapFieldNamesToCodeNames('Company Integration Run Details', await dataSource.query(sSQL));
|
|
3245
3253
|
return result;
|
|
3246
3254
|
}
|
|
3247
3255
|
|
|
3248
|
-
@FieldResolver(() => [ApplicationEntity_])
|
|
3256
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.ApplicationEntity_])
|
|
3249
3257
|
async ApplicationEntitiesArray(@Root() entity_: Entity_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3250
3258
|
this.CheckUserReadPermissions('Application Entities', userPayload);
|
|
3251
|
-
const sSQL = `SELECT * FROM [
|
|
3259
|
+
const sSQL = `SELECT * FROM [__mj].[vwApplicationEntities] WHERE [EntityID]=${entity_.ID} ` + this.getRowLevelSecurityWhereClause('Application Entities', userPayload, EntityPermissionType.Read, 'AND');
|
|
3252
3260
|
const result = this.ArrayMapFieldNamesToCodeNames('Application Entities', await dataSource.query(sSQL));
|
|
3253
3261
|
return result;
|
|
3254
3262
|
}
|
|
3255
3263
|
|
|
3256
|
-
@FieldResolver(() => [UserApplicationEntity_])
|
|
3264
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.UserApplicationEntity_])
|
|
3257
3265
|
async UserApplicationEntitiesArray(@Root() entity_: Entity_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3258
3266
|
this.CheckUserReadPermissions('User Application Entities', userPayload);
|
|
3259
|
-
const sSQL = `SELECT * FROM [
|
|
3267
|
+
const sSQL = `SELECT * FROM [__mj].[vwUserApplicationEntities] WHERE [EntityID]=${entity_.ID} ` + this.getRowLevelSecurityWhereClause('User Application Entities', userPayload, EntityPermissionType.Read, 'AND');
|
|
3260
3268
|
const result = this.ArrayMapFieldNamesToCodeNames('User Application Entities', await dataSource.query(sSQL));
|
|
3261
3269
|
return result;
|
|
3262
3270
|
}
|
|
3263
3271
|
|
|
3264
|
-
@FieldResolver(() => [List_])
|
|
3272
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.List_])
|
|
3265
3273
|
async ListsArray(@Root() entity_: Entity_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3266
3274
|
this.CheckUserReadPermissions('Lists', userPayload);
|
|
3267
|
-
const sSQL = `SELECT * FROM [
|
|
3275
|
+
const sSQL = `SELECT * FROM [__mj].[vwLists] WHERE [EntityID]=${entity_.ID} ` + this.getRowLevelSecurityWhereClause('Lists', userPayload, EntityPermissionType.Read, 'AND');
|
|
3268
3276
|
const result = this.ArrayMapFieldNamesToCodeNames('Lists', await dataSource.query(sSQL));
|
|
3269
3277
|
return result;
|
|
3270
3278
|
}
|
|
3271
3279
|
|
|
3272
|
-
@FieldResolver(() => [UserView_])
|
|
3280
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.UserView_])
|
|
3273
3281
|
async UserViewsArray(@Root() entity_: Entity_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3274
3282
|
this.CheckUserReadPermissions('User Views', userPayload);
|
|
3275
|
-
const sSQL = `SELECT * FROM [
|
|
3283
|
+
const sSQL = `SELECT * FROM [__mj].[vwUserViews] WHERE [EntityID]=${entity_.ID} ` + this.getRowLevelSecurityWhereClause('User Views', userPayload, EntityPermissionType.Read, 'AND');
|
|
3276
3284
|
const result = this.ArrayMapFieldNamesToCodeNames('User Views', await dataSource.query(sSQL));
|
|
3277
3285
|
return result;
|
|
3278
3286
|
}
|
|
3279
3287
|
|
|
3280
|
-
@FieldResolver(() => [RecordChange_])
|
|
3288
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.RecordChange_])
|
|
3281
3289
|
async RecordChangesArray(@Root() entity_: Entity_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3282
3290
|
this.CheckUserReadPermissions('Record Changes', userPayload);
|
|
3283
|
-
const sSQL = `SELECT * FROM [
|
|
3291
|
+
const sSQL = `SELECT * FROM [__mj].[vwRecordChanges] WHERE [EntityID]=${entity_.ID} ` + this.getRowLevelSecurityWhereClause('Record Changes', userPayload, EntityPermissionType.Read, 'AND');
|
|
3284
3292
|
const result = this.ArrayMapFieldNamesToCodeNames('Record Changes', await dataSource.query(sSQL));
|
|
3285
3293
|
return result;
|
|
3286
3294
|
}
|
|
3287
3295
|
|
|
3288
|
-
@FieldResolver(() => [AuditLog_])
|
|
3296
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.AuditLog_])
|
|
3289
3297
|
async AuditLogsArray(@Root() entity_: Entity_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3290
3298
|
this.CheckUserReadPermissions('Audit Logs', userPayload);
|
|
3291
|
-
const sSQL = `SELECT * FROM [
|
|
3299
|
+
const sSQL = `SELECT * FROM [__mj].[vwAuditLogs] WHERE [EntityID]=${entity_.ID} ` + this.getRowLevelSecurityWhereClause('Audit Logs', userPayload, EntityPermissionType.Read, 'AND');
|
|
3292
3300
|
const result = this.ArrayMapFieldNamesToCodeNames('Audit Logs', await dataSource.query(sSQL));
|
|
3293
3301
|
return result;
|
|
3294
3302
|
}
|
|
3295
3303
|
|
|
3296
|
-
@FieldResolver(() => [ResourceType_])
|
|
3304
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.ResourceType_])
|
|
3297
3305
|
async ResourceTypesArray(@Root() entity_: Entity_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3298
3306
|
this.CheckUserReadPermissions('Resource Types', userPayload);
|
|
3299
|
-
const sSQL = `SELECT * FROM [
|
|
3307
|
+
const sSQL = `SELECT * FROM [__mj].[vwResourceTypes] WHERE [EntityID]=${entity_.ID} ` + this.getRowLevelSecurityWhereClause('Resource Types', userPayload, EntityPermissionType.Read, 'AND');
|
|
3300
3308
|
const result = this.ArrayMapFieldNamesToCodeNames('Resource Types', await dataSource.query(sSQL));
|
|
3301
3309
|
return result;
|
|
3302
3310
|
}
|
|
3303
3311
|
|
|
3304
|
-
@FieldResolver(() => [TaggedItem_])
|
|
3312
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.TaggedItem_])
|
|
3305
3313
|
async TaggedItemsArray(@Root() entity_: Entity_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3306
3314
|
this.CheckUserReadPermissions('Tagged Items', userPayload);
|
|
3307
|
-
const sSQL = `SELECT * FROM [
|
|
3315
|
+
const sSQL = `SELECT * FROM [__mj].[vwTaggedItems] WHERE [EntityID]=${entity_.ID} ` + this.getRowLevelSecurityWhereClause('Tagged Items', userPayload, EntityPermissionType.Read, 'AND');
|
|
3308
3316
|
const result = this.ArrayMapFieldNamesToCodeNames('Tagged Items', await dataSource.query(sSQL));
|
|
3309
3317
|
return result;
|
|
3310
3318
|
}
|
|
3311
3319
|
|
|
3312
|
-
@FieldResolver(() => [DatasetItem_])
|
|
3320
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.DatasetItem_])
|
|
3313
3321
|
async DatasetItemsArray(@Root() entity_: Entity_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3314
3322
|
this.CheckUserReadPermissions('Dataset Items', userPayload);
|
|
3315
|
-
const sSQL = `SELECT * FROM [
|
|
3323
|
+
const sSQL = `SELECT * FROM [__mj].[vwDatasetItems] WHERE [EntityID]=${entity_.ID} ` + this.getRowLevelSecurityWhereClause('Dataset Items', userPayload, EntityPermissionType.Read, 'AND');
|
|
3316
3324
|
const result = this.ArrayMapFieldNamesToCodeNames('Dataset Items', await dataSource.query(sSQL));
|
|
3317
3325
|
return result;
|
|
3318
3326
|
}
|
|
3319
3327
|
|
|
3320
|
-
@FieldResolver(() => [CompanyIntegrationRecordMap_])
|
|
3328
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.CompanyIntegrationRecordMap_])
|
|
3321
3329
|
async CompanyIntegrationRecordMapsArray(@Root() entity_: Entity_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3322
3330
|
this.CheckUserReadPermissions('Company Integration Record Maps', userPayload);
|
|
3323
|
-
const sSQL = `SELECT * FROM [
|
|
3331
|
+
const sSQL = `SELECT * FROM [__mj].[vwCompanyIntegrationRecordMaps] WHERE [EntityID]=${entity_.ID} ` + this.getRowLevelSecurityWhereClause('Company Integration Record Maps', userPayload, EntityPermissionType.Read, 'AND');
|
|
3324
3332
|
const result = this.ArrayMapFieldNamesToCodeNames('Company Integration Record Maps', await dataSource.query(sSQL));
|
|
3325
3333
|
return result;
|
|
3326
3334
|
}
|
|
3327
3335
|
|
|
3328
|
-
@FieldResolver(() => [RecordMergeLog_])
|
|
3336
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.RecordMergeLog_])
|
|
3329
3337
|
async RecordMergeLogsArray(@Root() entity_: Entity_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3330
3338
|
this.CheckUserReadPermissions('Record Merge Logs', userPayload);
|
|
3331
|
-
const sSQL = `SELECT * FROM [
|
|
3339
|
+
const sSQL = `SELECT * FROM [__mj].[vwRecordMergeLogs] WHERE [EntityID]=${entity_.ID} ` + this.getRowLevelSecurityWhereClause('Record Merge Logs', userPayload, EntityPermissionType.Read, 'AND');
|
|
3332
3340
|
const result = this.ArrayMapFieldNamesToCodeNames('Record Merge Logs', await dataSource.query(sSQL));
|
|
3333
3341
|
return result;
|
|
3334
3342
|
}
|
|
3335
3343
|
|
|
3336
|
-
@FieldResolver(() => [QueryField_])
|
|
3344
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.QueryField_])
|
|
3337
3345
|
async QueryFieldsArray(@Root() entity_: Entity_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3338
3346
|
this.CheckUserReadPermissions('Query Fields', userPayload);
|
|
3339
|
-
const sSQL = `SELECT * FROM [
|
|
3347
|
+
const sSQL = `SELECT * FROM [__mj].[vwQueryFields] WHERE [SourceEntityID]=${entity_.ID} ` + this.getRowLevelSecurityWhereClause('Query Fields', userPayload, EntityPermissionType.Read, 'AND');
|
|
3340
3348
|
const result = this.ArrayMapFieldNamesToCodeNames('Query Fields', await dataSource.query(sSQL));
|
|
3341
3349
|
return result;
|
|
3342
3350
|
}
|
|
3343
3351
|
|
|
3344
|
-
@FieldResolver(() => [Conversation_])
|
|
3352
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.Conversation_])
|
|
3345
3353
|
async ConversationsArray(@Root() entity_: Entity_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3346
3354
|
this.CheckUserReadPermissions('Conversations', userPayload);
|
|
3347
|
-
const sSQL = `SELECT * FROM [
|
|
3355
|
+
const sSQL = `SELECT * FROM [__mj].[vwConversations] WHERE [LinkedEntityID]=${entity_.ID} ` + this.getRowLevelSecurityWhereClause('Conversations', userPayload, EntityPermissionType.Read, 'AND');
|
|
3348
3356
|
const result = this.ArrayMapFieldNamesToCodeNames('Conversations', await dataSource.query(sSQL));
|
|
3349
3357
|
return result;
|
|
3350
3358
|
}
|
|
3351
3359
|
|
|
3352
|
-
@FieldResolver(() => [EntityDocument_])
|
|
3360
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.EntityDocument_])
|
|
3353
3361
|
async EntityDocumentsArray(@Root() entity_: Entity_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3354
3362
|
this.CheckUserReadPermissions('Entity Documents', userPayload);
|
|
3355
|
-
const sSQL = `SELECT * FROM [
|
|
3363
|
+
const sSQL = `SELECT * FROM [__mj].[vwEntityDocuments] WHERE [EntityID]=${entity_.ID} ` + this.getRowLevelSecurityWhereClause('Entity Documents', userPayload, EntityPermissionType.Read, 'AND');
|
|
3356
3364
|
const result = this.ArrayMapFieldNamesToCodeNames('Entity Documents', await dataSource.query(sSQL));
|
|
3357
3365
|
return result;
|
|
3358
3366
|
}
|
|
3359
3367
|
|
|
3360
|
-
@FieldResolver(() => [DataContextItem_])
|
|
3368
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.DataContextItem_])
|
|
3361
3369
|
async DataContextItemsArray(@Root() entity_: Entity_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3362
3370
|
this.CheckUserReadPermissions('Data Context Items', userPayload);
|
|
3363
|
-
const sSQL = `SELECT * FROM [
|
|
3371
|
+
const sSQL = `SELECT * FROM [__mj].[vwDataContextItems] WHERE [EntityID]=${entity_.ID} ` + this.getRowLevelSecurityWhereClause('Data Context Items', userPayload, EntityPermissionType.Read, 'AND');
|
|
3364
3372
|
const result = this.ArrayMapFieldNamesToCodeNames('Data Context Items', await dataSource.query(sSQL));
|
|
3365
3373
|
return result;
|
|
3366
3374
|
}
|
|
3375
|
+
|
|
3376
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.User_])
|
|
3377
|
+
async UsersArray(@Root() entity_: Entity_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3378
|
+
this.CheckUserReadPermissions('Users', userPayload);
|
|
3379
|
+
const sSQL = `SELECT * FROM [__mj].[vwUsers] WHERE [LinkedEntityID]=${entity_.ID} ` + this.getRowLevelSecurityWhereClause('Users', userPayload, EntityPermissionType.Read, 'AND');
|
|
3380
|
+
const result = this.ArrayMapFieldNamesToCodeNames('Users', await dataSource.query(sSQL));
|
|
3381
|
+
return result;
|
|
3382
|
+
}
|
|
3383
|
+
|
|
3384
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.EntityRecordDocument_])
|
|
3385
|
+
async EntityRecordDocumentsArray(@Root() entity_: Entity_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3386
|
+
this.CheckUserReadPermissions('Entity Record Documents', userPayload);
|
|
3387
|
+
const sSQL = `SELECT * FROM [__mj].[vwEntityRecordDocuments] WHERE [EntityID]=${entity_.ID} ` + this.getRowLevelSecurityWhereClause('Entity Record Documents', userPayload, EntityPermissionType.Read, 'AND');
|
|
3388
|
+
const result = this.ArrayMapFieldNamesToCodeNames('Entity Record Documents', await dataSource.query(sSQL));
|
|
3389
|
+
return result;
|
|
3390
|
+
}
|
|
3367
3391
|
|
|
3368
3392
|
@Mutation(() => Entity_)
|
|
3369
3393
|
async CreateEntity(
|
|
@@ -3427,7 +3451,7 @@ export class EntityResolverBase extends ResolverBase {
|
|
|
3427
3451
|
}
|
|
3428
3452
|
|
|
3429
3453
|
@Mutation(() => Entity_)
|
|
3430
|
-
async DeleteEntity(@Arg('ID', () => Int) ID:
|
|
3454
|
+
async DeleteEntity(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3431
3455
|
if (await this.BeforeDelete(dataSource, ID)) { // fire event and proceed if it wasn't cancelled
|
|
3432
3456
|
const entityObject = <EntityEntity>await new Metadata().GetEntityObject('Entities', this.GetUserFromPayload(userPayload));
|
|
3433
3457
|
await entityObject.Load(ID);
|
|
@@ -3444,11 +3468,11 @@ export class EntityResolverBase extends ResolverBase {
|
|
|
3444
3468
|
}
|
|
3445
3469
|
|
|
3446
3470
|
// Before/After UPDATE Event Hooks for Sub-Classes to Override
|
|
3447
|
-
protected async BeforeDelete(dataSource: DataSource, ID:
|
|
3471
|
+
protected async BeforeDelete(dataSource: DataSource, ID: number): Promise<boolean> {
|
|
3448
3472
|
const i = ID, d = dataSource; // prevent error;
|
|
3449
3473
|
return true;
|
|
3450
3474
|
}
|
|
3451
|
-
protected async AfterDelete(dataSource: DataSource, ID:
|
|
3475
|
+
protected async AfterDelete(dataSource: DataSource, ID: number) {
|
|
3452
3476
|
const i = ID, d = dataSource; // prevent error
|
|
3453
3477
|
}
|
|
3454
3478
|
|
|
@@ -3534,59 +3558,59 @@ export class User_ {
|
|
|
3534
3558
|
@MaxLength(200)
|
|
3535
3559
|
EmployeeSupervisorEmail?: string;
|
|
3536
3560
|
|
|
3537
|
-
@Field(() => [UserApplication_])
|
|
3538
|
-
UserApplicationsArray: UserApplication_[]; // Link to UserApplications
|
|
3561
|
+
@Field(() => [mj_core_schema_server_object_types.UserApplication_])
|
|
3562
|
+
UserApplicationsArray: mj_core_schema_server_object_types.UserApplication_[]; // Link to UserApplications
|
|
3539
3563
|
|
|
3540
|
-
@Field(() => [UserRole_])
|
|
3541
|
-
UserRolesArray: UserRole_[]; // Link to UserRoles
|
|
3564
|
+
@Field(() => [mj_core_schema_server_object_types.UserRole_])
|
|
3565
|
+
UserRolesArray: mj_core_schema_server_object_types.UserRole_[]; // Link to UserRoles
|
|
3542
3566
|
|
|
3543
|
-
@Field(() => [Workspace_])
|
|
3544
|
-
WorkspacesArray: Workspace_[]; // Link to Workspaces
|
|
3567
|
+
@Field(() => [mj_core_schema_server_object_types.Workspace_])
|
|
3568
|
+
WorkspacesArray: mj_core_schema_server_object_types.Workspace_[]; // Link to Workspaces
|
|
3545
3569
|
|
|
3546
|
-
@Field(() => [Report_])
|
|
3547
|
-
ReportsArray: Report_[]; // Link to Reports
|
|
3570
|
+
@Field(() => [mj_core_schema_server_object_types.Report_])
|
|
3571
|
+
ReportsArray: mj_core_schema_server_object_types.Report_[]; // Link to Reports
|
|
3548
3572
|
|
|
3549
|
-
@Field(() => [ReportSnapshot_])
|
|
3550
|
-
ReportSnapshotsArray: ReportSnapshot_[]; // Link to ReportSnapshots
|
|
3573
|
+
@Field(() => [mj_core_schema_server_object_types.ReportSnapshot_])
|
|
3574
|
+
ReportSnapshotsArray: mj_core_schema_server_object_types.ReportSnapshot_[]; // Link to ReportSnapshots
|
|
3551
3575
|
|
|
3552
|
-
@Field(() => [RecordChange_])
|
|
3553
|
-
RecordChangesArray: RecordChange_[]; // Link to RecordChanges
|
|
3576
|
+
@Field(() => [mj_core_schema_server_object_types.RecordChange_])
|
|
3577
|
+
RecordChangesArray: mj_core_schema_server_object_types.RecordChange_[]; // Link to RecordChanges
|
|
3554
3578
|
|
|
3555
|
-
@Field(() => [Dashboard_])
|
|
3556
|
-
DashboardsArray: Dashboard_[]; // Link to Dashboards
|
|
3579
|
+
@Field(() => [mj_core_schema_server_object_types.Dashboard_])
|
|
3580
|
+
DashboardsArray: mj_core_schema_server_object_types.Dashboard_[]; // Link to Dashboards
|
|
3557
3581
|
|
|
3558
|
-
@Field(() => [UserViewRun_])
|
|
3559
|
-
UserViewRunsArray: UserViewRun_[]; // Link to UserViewRuns
|
|
3582
|
+
@Field(() => [mj_core_schema_server_object_types.UserViewRun_])
|
|
3583
|
+
UserViewRunsArray: mj_core_schema_server_object_types.UserViewRun_[]; // Link to UserViewRuns
|
|
3560
3584
|
|
|
3561
|
-
@Field(() => [AuditLog_])
|
|
3562
|
-
AuditLogsArray: AuditLog_[]; // Link to AuditLogs
|
|
3585
|
+
@Field(() => [mj_core_schema_server_object_types.AuditLog_])
|
|
3586
|
+
AuditLogsArray: mj_core_schema_server_object_types.AuditLog_[]; // Link to AuditLogs
|
|
3563
3587
|
|
|
3564
|
-
@Field(() => [List_])
|
|
3565
|
-
ListsArray: List_[]; // Link to Lists
|
|
3588
|
+
@Field(() => [mj_core_schema_server_object_types.List_])
|
|
3589
|
+
ListsArray: mj_core_schema_server_object_types.List_[]; // Link to Lists
|
|
3566
3590
|
|
|
3567
|
-
@Field(() => [UserFavorite_])
|
|
3568
|
-
UserFavoritesArray: UserFavorite_[]; // Link to UserFavorites
|
|
3591
|
+
@Field(() => [mj_core_schema_server_object_types.UserFavorite_])
|
|
3592
|
+
UserFavoritesArray: mj_core_schema_server_object_types.UserFavorite_[]; // Link to UserFavorites
|
|
3569
3593
|
|
|
3570
|
-
@Field(() => [UserRecordLog_])
|
|
3571
|
-
UserRecordLogsArray: UserRecordLog_[]; // Link to UserRecordLogs
|
|
3594
|
+
@Field(() => [mj_core_schema_server_object_types.UserRecordLog_])
|
|
3595
|
+
UserRecordLogsArray: mj_core_schema_server_object_types.UserRecordLog_[]; // Link to UserRecordLogs
|
|
3572
3596
|
|
|
3573
|
-
@Field(() => [UserView_])
|
|
3574
|
-
UserViewsArray: UserView_[]; // Link to UserViews
|
|
3597
|
+
@Field(() => [mj_core_schema_server_object_types.UserView_])
|
|
3598
|
+
UserViewsArray: mj_core_schema_server_object_types.UserView_[]; // Link to UserViews
|
|
3575
3599
|
|
|
3576
|
-
@Field(() => [CompanyIntegrationRun_])
|
|
3577
|
-
CompanyIntegrationRunsArray: CompanyIntegrationRun_[]; // Link to CompanyIntegrationRuns
|
|
3600
|
+
@Field(() => [mj_core_schema_server_object_types.CompanyIntegrationRun_])
|
|
3601
|
+
CompanyIntegrationRunsArray: mj_core_schema_server_object_types.CompanyIntegrationRun_[]; // Link to CompanyIntegrationRuns
|
|
3578
3602
|
|
|
3579
|
-
@Field(() => [UserNotification_])
|
|
3580
|
-
UserNotificationsArray: UserNotification_[]; // Link to UserNotifications
|
|
3603
|
+
@Field(() => [mj_core_schema_server_object_types.UserNotification_])
|
|
3604
|
+
UserNotificationsArray: mj_core_schema_server_object_types.UserNotification_[]; // Link to UserNotifications
|
|
3581
3605
|
|
|
3582
|
-
@Field(() => [Conversation_])
|
|
3583
|
-
ConversationsArray: Conversation_[]; // Link to Conversations
|
|
3606
|
+
@Field(() => [mj_core_schema_server_object_types.Conversation_])
|
|
3607
|
+
ConversationsArray: mj_core_schema_server_object_types.Conversation_[]; // Link to Conversations
|
|
3584
3608
|
|
|
3585
|
-
@Field(() => [RecordMergeLog_])
|
|
3586
|
-
RecordMergeLogsArray: RecordMergeLog_[]; // Link to RecordMergeLogs
|
|
3609
|
+
@Field(() => [mj_core_schema_server_object_types.RecordMergeLog_])
|
|
3610
|
+
RecordMergeLogsArray: mj_core_schema_server_object_types.RecordMergeLog_[]; // Link to RecordMergeLogs
|
|
3587
3611
|
|
|
3588
|
-
@Field(() => [DataContext_])
|
|
3589
|
-
DataContextsArray: DataContext_[]; // Link to DataContexts
|
|
3612
|
+
@Field(() => [mj_core_schema_server_object_types.DataContext_])
|
|
3613
|
+
DataContextsArray: mj_core_schema_server_object_types.DataContext_[]; // Link to DataContexts
|
|
3590
3614
|
|
|
3591
3615
|
}
|
|
3592
3616
|
|
|
@@ -3717,9 +3741,9 @@ export class UserResolverBase extends ResolverBase {
|
|
|
3717
3741
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
3718
3742
|
}
|
|
3719
3743
|
@Query(() => User_, { nullable: true })
|
|
3720
|
-
async User(@Arg('ID', () => Int) ID:
|
|
3744
|
+
async User(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<User_ | null> {
|
|
3721
3745
|
this.CheckUserReadPermissions('Users', userPayload);
|
|
3722
|
-
const sSQL = `SELECT * FROM [
|
|
3746
|
+
const sSQL = `SELECT * FROM [__mj].[vwUsers] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Users', userPayload, EntityPermissionType.Read, 'AND');
|
|
3723
3747
|
const result = this.MapFieldNamesToCodeNames('Users', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
3724
3748
|
return result;
|
|
3725
3749
|
}
|
|
@@ -3727,151 +3751,151 @@ export class UserResolverBase extends ResolverBase {
|
|
|
3727
3751
|
@Query(() => [User_])
|
|
3728
3752
|
async AllUsers(@Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3729
3753
|
this.CheckUserReadPermissions('Users', userPayload);
|
|
3730
|
-
const sSQL = 'SELECT * FROM [
|
|
3754
|
+
const sSQL = 'SELECT * FROM [__mj].[vwUsers]' + this.getRowLevelSecurityWhereClause('Users', userPayload, EntityPermissionType.Read, ' WHERE');
|
|
3731
3755
|
const result = this.ArrayMapFieldNamesToCodeNames('Users', await dataSource.query(sSQL));
|
|
3732
3756
|
return result;
|
|
3733
3757
|
}
|
|
3734
3758
|
|
|
3735
|
-
@FieldResolver(() => [UserApplication_])
|
|
3759
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.UserApplication_])
|
|
3736
3760
|
async UserApplicationsArray(@Root() user_: User_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3737
3761
|
this.CheckUserReadPermissions('User Applications', userPayload);
|
|
3738
|
-
const sSQL = `SELECT * FROM [
|
|
3762
|
+
const sSQL = `SELECT * FROM [__mj].[vwUserApplications] WHERE [UserID]=${user_.ID} ` + this.getRowLevelSecurityWhereClause('User Applications', userPayload, EntityPermissionType.Read, 'AND');
|
|
3739
3763
|
const result = this.ArrayMapFieldNamesToCodeNames('User Applications', await dataSource.query(sSQL));
|
|
3740
3764
|
return result;
|
|
3741
3765
|
}
|
|
3742
3766
|
|
|
3743
|
-
@FieldResolver(() => [UserRole_])
|
|
3767
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.UserRole_])
|
|
3744
3768
|
async UserRolesArray(@Root() user_: User_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3745
3769
|
this.CheckUserReadPermissions('User Roles', userPayload);
|
|
3746
|
-
const sSQL = `SELECT * FROM [
|
|
3770
|
+
const sSQL = `SELECT * FROM [__mj].[vwUserRoles] WHERE [UserID]=${user_.ID} ` + this.getRowLevelSecurityWhereClause('User Roles', userPayload, EntityPermissionType.Read, 'AND');
|
|
3747
3771
|
const result = this.ArrayMapFieldNamesToCodeNames('User Roles', await dataSource.query(sSQL));
|
|
3748
3772
|
return result;
|
|
3749
3773
|
}
|
|
3750
3774
|
|
|
3751
|
-
@FieldResolver(() => [Workspace_])
|
|
3775
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.Workspace_])
|
|
3752
3776
|
async WorkspacesArray(@Root() user_: User_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3753
3777
|
this.CheckUserReadPermissions('Workspaces', userPayload);
|
|
3754
|
-
const sSQL = `SELECT * FROM [
|
|
3778
|
+
const sSQL = `SELECT * FROM [__mj].[vwWorkspaces] WHERE [UserID]=${user_.ID} ` + this.getRowLevelSecurityWhereClause('Workspaces', userPayload, EntityPermissionType.Read, 'AND');
|
|
3755
3779
|
const result = this.ArrayMapFieldNamesToCodeNames('Workspaces', await dataSource.query(sSQL));
|
|
3756
3780
|
return result;
|
|
3757
3781
|
}
|
|
3758
3782
|
|
|
3759
|
-
@FieldResolver(() => [Report_])
|
|
3783
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.Report_])
|
|
3760
3784
|
async ReportsArray(@Root() user_: User_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3761
3785
|
this.CheckUserReadPermissions('Reports', userPayload);
|
|
3762
|
-
const sSQL = `SELECT * FROM [
|
|
3786
|
+
const sSQL = `SELECT * FROM [__mj].[vwReports] WHERE [UserID]=${user_.ID} ` + this.getRowLevelSecurityWhereClause('Reports', userPayload, EntityPermissionType.Read, 'AND');
|
|
3763
3787
|
const result = this.ArrayMapFieldNamesToCodeNames('Reports', await dataSource.query(sSQL));
|
|
3764
3788
|
return result;
|
|
3765
3789
|
}
|
|
3766
3790
|
|
|
3767
|
-
@FieldResolver(() => [ReportSnapshot_])
|
|
3791
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.ReportSnapshot_])
|
|
3768
3792
|
async ReportSnapshotsArray(@Root() user_: User_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3769
3793
|
this.CheckUserReadPermissions('Report Snapshots', userPayload);
|
|
3770
|
-
const sSQL = `SELECT * FROM [
|
|
3794
|
+
const sSQL = `SELECT * FROM [__mj].[vwReportSnapshots] WHERE [UserID]=${user_.ID} ` + this.getRowLevelSecurityWhereClause('Report Snapshots', userPayload, EntityPermissionType.Read, 'AND');
|
|
3771
3795
|
const result = this.ArrayMapFieldNamesToCodeNames('Report Snapshots', await dataSource.query(sSQL));
|
|
3772
3796
|
return result;
|
|
3773
3797
|
}
|
|
3774
3798
|
|
|
3775
|
-
@FieldResolver(() => [RecordChange_])
|
|
3799
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.RecordChange_])
|
|
3776
3800
|
async RecordChangesArray(@Root() user_: User_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3777
3801
|
this.CheckUserReadPermissions('Record Changes', userPayload);
|
|
3778
|
-
const sSQL = `SELECT * FROM [
|
|
3802
|
+
const sSQL = `SELECT * FROM [__mj].[vwRecordChanges] WHERE [UserID]=${user_.ID} ` + this.getRowLevelSecurityWhereClause('Record Changes', userPayload, EntityPermissionType.Read, 'AND');
|
|
3779
3803
|
const result = this.ArrayMapFieldNamesToCodeNames('Record Changes', await dataSource.query(sSQL));
|
|
3780
3804
|
return result;
|
|
3781
3805
|
}
|
|
3782
3806
|
|
|
3783
|
-
@FieldResolver(() => [Dashboard_])
|
|
3807
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.Dashboard_])
|
|
3784
3808
|
async DashboardsArray(@Root() user_: User_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3785
3809
|
this.CheckUserReadPermissions('Dashboards', userPayload);
|
|
3786
|
-
const sSQL = `SELECT * FROM [
|
|
3810
|
+
const sSQL = `SELECT * FROM [__mj].[vwDashboards] WHERE [UserID]=${user_.ID} ` + this.getRowLevelSecurityWhereClause('Dashboards', userPayload, EntityPermissionType.Read, 'AND');
|
|
3787
3811
|
const result = this.ArrayMapFieldNamesToCodeNames('Dashboards', await dataSource.query(sSQL));
|
|
3788
3812
|
return result;
|
|
3789
3813
|
}
|
|
3790
3814
|
|
|
3791
|
-
@FieldResolver(() => [UserViewRun_])
|
|
3815
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.UserViewRun_])
|
|
3792
3816
|
async UserViewRunsArray(@Root() user_: User_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3793
3817
|
this.CheckUserReadPermissions('User View Runs', userPayload);
|
|
3794
|
-
const sSQL = `SELECT * FROM [
|
|
3818
|
+
const sSQL = `SELECT * FROM [__mj].[vwUserViewRuns] WHERE [RunByUserID]=${user_.ID} ` + this.getRowLevelSecurityWhereClause('User View Runs', userPayload, EntityPermissionType.Read, 'AND');
|
|
3795
3819
|
const result = this.ArrayMapFieldNamesToCodeNames('User View Runs', await dataSource.query(sSQL));
|
|
3796
3820
|
return result;
|
|
3797
3821
|
}
|
|
3798
3822
|
|
|
3799
|
-
@FieldResolver(() => [AuditLog_])
|
|
3823
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.AuditLog_])
|
|
3800
3824
|
async AuditLogsArray(@Root() user_: User_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3801
3825
|
this.CheckUserReadPermissions('Audit Logs', userPayload);
|
|
3802
|
-
const sSQL = `SELECT * FROM [
|
|
3826
|
+
const sSQL = `SELECT * FROM [__mj].[vwAuditLogs] WHERE [UserID]=${user_.ID} ` + this.getRowLevelSecurityWhereClause('Audit Logs', userPayload, EntityPermissionType.Read, 'AND');
|
|
3803
3827
|
const result = this.ArrayMapFieldNamesToCodeNames('Audit Logs', await dataSource.query(sSQL));
|
|
3804
3828
|
return result;
|
|
3805
3829
|
}
|
|
3806
3830
|
|
|
3807
|
-
@FieldResolver(() => [List_])
|
|
3831
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.List_])
|
|
3808
3832
|
async ListsArray(@Root() user_: User_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3809
3833
|
this.CheckUserReadPermissions('Lists', userPayload);
|
|
3810
|
-
const sSQL = `SELECT * FROM [
|
|
3834
|
+
const sSQL = `SELECT * FROM [__mj].[vwLists] WHERE [UserID]=${user_.ID} ` + this.getRowLevelSecurityWhereClause('Lists', userPayload, EntityPermissionType.Read, 'AND');
|
|
3811
3835
|
const result = this.ArrayMapFieldNamesToCodeNames('Lists', await dataSource.query(sSQL));
|
|
3812
3836
|
return result;
|
|
3813
3837
|
}
|
|
3814
3838
|
|
|
3815
|
-
@FieldResolver(() => [UserFavorite_])
|
|
3839
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.UserFavorite_])
|
|
3816
3840
|
async UserFavoritesArray(@Root() user_: User_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3817
3841
|
this.CheckUserReadPermissions('User Favorites', userPayload);
|
|
3818
|
-
const sSQL = `SELECT * FROM [
|
|
3842
|
+
const sSQL = `SELECT * FROM [__mj].[vwUserFavorites] WHERE [UserID]=${user_.ID} ` + this.getRowLevelSecurityWhereClause('User Favorites', userPayload, EntityPermissionType.Read, 'AND');
|
|
3819
3843
|
const result = this.ArrayMapFieldNamesToCodeNames('User Favorites', await dataSource.query(sSQL));
|
|
3820
3844
|
return result;
|
|
3821
3845
|
}
|
|
3822
3846
|
|
|
3823
|
-
@FieldResolver(() => [UserRecordLog_])
|
|
3847
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.UserRecordLog_])
|
|
3824
3848
|
async UserRecordLogsArray(@Root() user_: User_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3825
3849
|
this.CheckUserReadPermissions('User Record Logs', userPayload);
|
|
3826
|
-
const sSQL = `SELECT * FROM [
|
|
3850
|
+
const sSQL = `SELECT * FROM [__mj].[vwUserRecordLogs] WHERE [UserID]=${user_.ID} ` + this.getRowLevelSecurityWhereClause('User Record Logs', userPayload, EntityPermissionType.Read, 'AND');
|
|
3827
3851
|
const result = this.ArrayMapFieldNamesToCodeNames('User Record Logs', await dataSource.query(sSQL));
|
|
3828
3852
|
return result;
|
|
3829
3853
|
}
|
|
3830
3854
|
|
|
3831
|
-
@FieldResolver(() => [UserView_])
|
|
3855
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.UserView_])
|
|
3832
3856
|
async UserViewsArray(@Root() user_: User_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3833
3857
|
this.CheckUserReadPermissions('User Views', userPayload);
|
|
3834
|
-
const sSQL = `SELECT * FROM [
|
|
3858
|
+
const sSQL = `SELECT * FROM [__mj].[vwUserViews] WHERE [UserID]=${user_.ID} ` + this.getRowLevelSecurityWhereClause('User Views', userPayload, EntityPermissionType.Read, 'AND');
|
|
3835
3859
|
const result = this.ArrayMapFieldNamesToCodeNames('User Views', await dataSource.query(sSQL));
|
|
3836
3860
|
return result;
|
|
3837
3861
|
}
|
|
3838
3862
|
|
|
3839
|
-
@FieldResolver(() => [CompanyIntegrationRun_])
|
|
3863
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.CompanyIntegrationRun_])
|
|
3840
3864
|
async CompanyIntegrationRunsArray(@Root() user_: User_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3841
3865
|
this.CheckUserReadPermissions('Company Integration Runs', userPayload);
|
|
3842
|
-
const sSQL = `SELECT * FROM [
|
|
3866
|
+
const sSQL = `SELECT * FROM [__mj].[vwCompanyIntegrationRuns] WHERE [RunByUserID]=${user_.ID} ` + this.getRowLevelSecurityWhereClause('Company Integration Runs', userPayload, EntityPermissionType.Read, 'AND');
|
|
3843
3867
|
const result = this.ArrayMapFieldNamesToCodeNames('Company Integration Runs', await dataSource.query(sSQL));
|
|
3844
3868
|
return result;
|
|
3845
3869
|
}
|
|
3846
3870
|
|
|
3847
|
-
@FieldResolver(() => [UserNotification_])
|
|
3871
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.UserNotification_])
|
|
3848
3872
|
async UserNotificationsArray(@Root() user_: User_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3849
3873
|
this.CheckUserReadPermissions('User Notifications', userPayload);
|
|
3850
|
-
const sSQL = `SELECT * FROM [
|
|
3874
|
+
const sSQL = `SELECT * FROM [__mj].[vwUserNotifications] WHERE [UserID]=${user_.ID} ` + this.getRowLevelSecurityWhereClause('User Notifications', userPayload, EntityPermissionType.Read, 'AND');
|
|
3851
3875
|
const result = this.ArrayMapFieldNamesToCodeNames('User Notifications', await dataSource.query(sSQL));
|
|
3852
3876
|
return result;
|
|
3853
3877
|
}
|
|
3854
3878
|
|
|
3855
|
-
@FieldResolver(() => [Conversation_])
|
|
3879
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.Conversation_])
|
|
3856
3880
|
async ConversationsArray(@Root() user_: User_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3857
3881
|
this.CheckUserReadPermissions('Conversations', userPayload);
|
|
3858
|
-
const sSQL = `SELECT * FROM [
|
|
3882
|
+
const sSQL = `SELECT * FROM [__mj].[vwConversations] WHERE [UserID]=${user_.ID} ` + this.getRowLevelSecurityWhereClause('Conversations', userPayload, EntityPermissionType.Read, 'AND');
|
|
3859
3883
|
const result = this.ArrayMapFieldNamesToCodeNames('Conversations', await dataSource.query(sSQL));
|
|
3860
3884
|
return result;
|
|
3861
3885
|
}
|
|
3862
3886
|
|
|
3863
|
-
@FieldResolver(() => [RecordMergeLog_])
|
|
3887
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.RecordMergeLog_])
|
|
3864
3888
|
async RecordMergeLogsArray(@Root() user_: User_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3865
3889
|
this.CheckUserReadPermissions('Record Merge Logs', userPayload);
|
|
3866
|
-
const sSQL = `SELECT * FROM [
|
|
3890
|
+
const sSQL = `SELECT * FROM [__mj].[vwRecordMergeLogs] WHERE [InitiatedByUserID]=${user_.ID} ` + this.getRowLevelSecurityWhereClause('Record Merge Logs', userPayload, EntityPermissionType.Read, 'AND');
|
|
3867
3891
|
const result = this.ArrayMapFieldNamesToCodeNames('Record Merge Logs', await dataSource.query(sSQL));
|
|
3868
3892
|
return result;
|
|
3869
3893
|
}
|
|
3870
3894
|
|
|
3871
|
-
@FieldResolver(() => [DataContext_])
|
|
3895
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.DataContext_])
|
|
3872
3896
|
async DataContextsArray(@Root() user_: User_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
3873
3897
|
this.CheckUserReadPermissions('Data Contexts', userPayload);
|
|
3874
|
-
const sSQL = `SELECT * FROM [
|
|
3898
|
+
const sSQL = `SELECT * FROM [__mj].[vwDataContexts] WHERE [UserID]=${user_.ID} ` + this.getRowLevelSecurityWhereClause('Data Contexts', userPayload, EntityPermissionType.Read, 'AND');
|
|
3875
3899
|
const result = this.ArrayMapFieldNamesToCodeNames('Data Contexts', await dataSource.query(sSQL));
|
|
3876
3900
|
return result;
|
|
3877
3901
|
}
|
|
@@ -4180,9 +4204,9 @@ export class EntityRelationshipResolver extends ResolverBase {
|
|
|
4180
4204
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
4181
4205
|
}
|
|
4182
4206
|
@Query(() => EntityRelationship_, { nullable: true })
|
|
4183
|
-
async EntityRelationship(@Arg('ID', () => Int) ID:
|
|
4207
|
+
async EntityRelationship(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<EntityRelationship_ | null> {
|
|
4184
4208
|
this.CheckUserReadPermissions('Entity Relationships', userPayload);
|
|
4185
|
-
const sSQL = `SELECT * FROM [
|
|
4209
|
+
const sSQL = `SELECT * FROM [__mj].[vwEntityRelationships] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Entity Relationships', userPayload, EntityPermissionType.Read, 'AND');
|
|
4186
4210
|
const result = this.MapFieldNamesToCodeNames('Entity Relationships', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
4187
4211
|
return result;
|
|
4188
4212
|
}
|
|
@@ -4190,7 +4214,7 @@ export class EntityRelationshipResolver extends ResolverBase {
|
|
|
4190
4214
|
@Query(() => [EntityRelationship_])
|
|
4191
4215
|
async AllEntityRelationships(@Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
4192
4216
|
this.CheckUserReadPermissions('Entity Relationships', userPayload);
|
|
4193
|
-
const sSQL = 'SELECT * FROM [
|
|
4217
|
+
const sSQL = 'SELECT * FROM [__mj].[vwEntityRelationships]' + this.getRowLevelSecurityWhereClause('Entity Relationships', userPayload, EntityPermissionType.Read, ' WHERE');
|
|
4194
4218
|
const result = this.ArrayMapFieldNamesToCodeNames('Entity Relationships', await dataSource.query(sSQL));
|
|
4195
4219
|
return result;
|
|
4196
4220
|
}
|
|
@@ -4257,7 +4281,7 @@ export class EntityRelationshipResolver extends ResolverBase {
|
|
|
4257
4281
|
}
|
|
4258
4282
|
|
|
4259
4283
|
@Mutation(() => EntityRelationship_)
|
|
4260
|
-
async DeleteEntityRelationship(@Arg('ID', () => Int) ID:
|
|
4284
|
+
async DeleteEntityRelationship(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
4261
4285
|
if (await this.BeforeDelete(dataSource, ID)) { // fire event and proceed if it wasn't cancelled
|
|
4262
4286
|
const entityObject = <EntityRelationshipEntity>await new Metadata().GetEntityObject('Entity Relationships', this.GetUserFromPayload(userPayload));
|
|
4263
4287
|
await entityObject.Load(ID);
|
|
@@ -4274,11 +4298,11 @@ export class EntityRelationshipResolver extends ResolverBase {
|
|
|
4274
4298
|
}
|
|
4275
4299
|
|
|
4276
4300
|
// Before/After UPDATE Event Hooks for Sub-Classes to Override
|
|
4277
|
-
protected async BeforeDelete(dataSource: DataSource, ID:
|
|
4301
|
+
protected async BeforeDelete(dataSource: DataSource, ID: number): Promise<boolean> {
|
|
4278
4302
|
const i = ID, d = dataSource; // prevent error;
|
|
4279
4303
|
return true;
|
|
4280
4304
|
}
|
|
4281
|
-
protected async AfterDelete(dataSource: DataSource, ID:
|
|
4305
|
+
protected async AfterDelete(dataSource: DataSource, ID: number) {
|
|
4282
4306
|
const i = ID, d = dataSource; // prevent error
|
|
4283
4307
|
}
|
|
4284
4308
|
|
|
@@ -4411,9 +4435,9 @@ export class UserRecordLogResolver extends ResolverBase {
|
|
|
4411
4435
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
4412
4436
|
}
|
|
4413
4437
|
@Query(() => UserRecordLog_, { nullable: true })
|
|
4414
|
-
async UserRecordLog(@Arg('ID', () => Int) ID:
|
|
4438
|
+
async UserRecordLog(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<UserRecordLog_ | null> {
|
|
4415
4439
|
this.CheckUserReadPermissions('User Record Logs', userPayload);
|
|
4416
|
-
const sSQL = `SELECT * FROM [
|
|
4440
|
+
const sSQL = `SELECT * FROM [__mj].[vwUserRecordLogs] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('User Record Logs', userPayload, EntityPermissionType.Read, 'AND');
|
|
4417
4441
|
const result = this.MapFieldNamesToCodeNames('User Record Logs', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
4418
4442
|
return result;
|
|
4419
4443
|
}
|
|
@@ -4547,14 +4571,14 @@ export class UserView_ {
|
|
|
4547
4571
|
@MaxLength(510)
|
|
4548
4572
|
EntityBaseView: string;
|
|
4549
4573
|
|
|
4550
|
-
@Field(() => [EntityRelationship_])
|
|
4551
|
-
EntityRelationshipsArray: EntityRelationship_[]; // Link to EntityRelationships
|
|
4574
|
+
@Field(() => [mj_core_schema_server_object_types.EntityRelationship_])
|
|
4575
|
+
EntityRelationshipsArray: mj_core_schema_server_object_types.EntityRelationship_[]; // Link to EntityRelationships
|
|
4552
4576
|
|
|
4553
|
-
@Field(() => [UserViewRun_])
|
|
4554
|
-
UserViewRunsArray: UserViewRun_[]; // Link to UserViewRuns
|
|
4577
|
+
@Field(() => [mj_core_schema_server_object_types.UserViewRun_])
|
|
4578
|
+
UserViewRunsArray: mj_core_schema_server_object_types.UserViewRun_[]; // Link to UserViewRuns
|
|
4555
4579
|
|
|
4556
|
-
@Field(() => [DataContextItem_])
|
|
4557
|
-
DataContextItemsArray: DataContextItem_[]; // Link to DataContextItems
|
|
4580
|
+
@Field(() => [mj_core_schema_server_object_types.DataContextItem_])
|
|
4581
|
+
DataContextItemsArray: mj_core_schema_server_object_types.DataContextItem_[]; // Link to DataContextItems
|
|
4558
4582
|
|
|
4559
4583
|
}
|
|
4560
4584
|
|
|
@@ -4721,9 +4745,9 @@ export class UserViewResolverBase extends ResolverBase {
|
|
|
4721
4745
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
4722
4746
|
}
|
|
4723
4747
|
@Query(() => UserView_, { nullable: true })
|
|
4724
|
-
async UserView(@Arg('ID', () => Int) ID:
|
|
4748
|
+
async UserView(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<UserView_ | null> {
|
|
4725
4749
|
this.CheckUserReadPermissions('User Views', userPayload);
|
|
4726
|
-
const sSQL = `SELECT * FROM [
|
|
4750
|
+
const sSQL = `SELECT * FROM [__mj].[vwUserViews] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('User Views', userPayload, EntityPermissionType.Read, 'AND');
|
|
4727
4751
|
const result = this.MapFieldNamesToCodeNames('User Views', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
4728
4752
|
return result;
|
|
4729
4753
|
}
|
|
@@ -4731,31 +4755,31 @@ export class UserViewResolverBase extends ResolverBase {
|
|
|
4731
4755
|
@Query(() => [UserView_])
|
|
4732
4756
|
async AllUserViews(@Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
4733
4757
|
this.CheckUserReadPermissions('User Views', userPayload);
|
|
4734
|
-
const sSQL = 'SELECT * FROM [
|
|
4758
|
+
const sSQL = 'SELECT * FROM [__mj].[vwUserViews]' + this.getRowLevelSecurityWhereClause('User Views', userPayload, EntityPermissionType.Read, ' WHERE');
|
|
4735
4759
|
const result = this.ArrayMapFieldNamesToCodeNames('User Views', await dataSource.query(sSQL));
|
|
4736
4760
|
return result;
|
|
4737
4761
|
}
|
|
4738
4762
|
|
|
4739
|
-
@FieldResolver(() => [EntityRelationship_])
|
|
4763
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.EntityRelationship_])
|
|
4740
4764
|
async EntityRelationshipsArray(@Root() userview_: UserView_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
4741
4765
|
this.CheckUserReadPermissions('Entity Relationships', userPayload);
|
|
4742
|
-
const sSQL = `SELECT * FROM [
|
|
4766
|
+
const sSQL = `SELECT * FROM [__mj].[vwEntityRelationships] WHERE [DisplayUserViewGUID]=${userview_.ID} ` + this.getRowLevelSecurityWhereClause('Entity Relationships', userPayload, EntityPermissionType.Read, 'AND');
|
|
4743
4767
|
const result = this.ArrayMapFieldNamesToCodeNames('Entity Relationships', await dataSource.query(sSQL));
|
|
4744
4768
|
return result;
|
|
4745
4769
|
}
|
|
4746
4770
|
|
|
4747
|
-
@FieldResolver(() => [UserViewRun_])
|
|
4771
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.UserViewRun_])
|
|
4748
4772
|
async UserViewRunsArray(@Root() userview_: UserView_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
4749
4773
|
this.CheckUserReadPermissions('User View Runs', userPayload);
|
|
4750
|
-
const sSQL = `SELECT * FROM [
|
|
4774
|
+
const sSQL = `SELECT * FROM [__mj].[vwUserViewRuns] WHERE [UserViewID]=${userview_.ID} ` + this.getRowLevelSecurityWhereClause('User View Runs', userPayload, EntityPermissionType.Read, 'AND');
|
|
4751
4775
|
const result = this.ArrayMapFieldNamesToCodeNames('User View Runs', await dataSource.query(sSQL));
|
|
4752
4776
|
return result;
|
|
4753
4777
|
}
|
|
4754
4778
|
|
|
4755
|
-
@FieldResolver(() => [DataContextItem_])
|
|
4779
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.DataContextItem_])
|
|
4756
4780
|
async DataContextItemsArray(@Root() userview_: UserView_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
4757
4781
|
this.CheckUserReadPermissions('Data Context Items', userPayload);
|
|
4758
|
-
const sSQL = `SELECT * FROM [
|
|
4782
|
+
const sSQL = `SELECT * FROM [__mj].[vwDataContextItems] WHERE [ViewID]=${userview_.ID} ` + this.getRowLevelSecurityWhereClause('Data Context Items', userPayload, EntityPermissionType.Read, 'AND');
|
|
4759
4783
|
const result = this.ArrayMapFieldNamesToCodeNames('Data Context Items', await dataSource.query(sSQL));
|
|
4760
4784
|
return result;
|
|
4761
4785
|
}
|
|
@@ -4822,7 +4846,7 @@ export class UserViewResolverBase extends ResolverBase {
|
|
|
4822
4846
|
}
|
|
4823
4847
|
|
|
4824
4848
|
@Mutation(() => UserView_)
|
|
4825
|
-
async DeleteUserView(@Arg('ID', () => Int) ID:
|
|
4849
|
+
async DeleteUserView(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
4826
4850
|
if (await this.BeforeDelete(dataSource, ID)) { // fire event and proceed if it wasn't cancelled
|
|
4827
4851
|
const entityObject = <UserViewEntity>await new Metadata().GetEntityObject('User Views', this.GetUserFromPayload(userPayload));
|
|
4828
4852
|
await entityObject.Load(ID);
|
|
@@ -4839,11 +4863,11 @@ export class UserViewResolverBase extends ResolverBase {
|
|
|
4839
4863
|
}
|
|
4840
4864
|
|
|
4841
4865
|
// Before/After UPDATE Event Hooks for Sub-Classes to Override
|
|
4842
|
-
protected async BeforeDelete(dataSource: DataSource, ID:
|
|
4866
|
+
protected async BeforeDelete(dataSource: DataSource, ID: number): Promise<boolean> {
|
|
4843
4867
|
const i = ID, d = dataSource; // prevent error;
|
|
4844
4868
|
return true;
|
|
4845
4869
|
}
|
|
4846
|
-
protected async AfterDelete(dataSource: DataSource, ID:
|
|
4870
|
+
protected async AfterDelete(dataSource: DataSource, ID: number) {
|
|
4847
4871
|
const i = ID, d = dataSource; // prevent error
|
|
4848
4872
|
}
|
|
4849
4873
|
|
|
@@ -4881,14 +4905,14 @@ export class CompanyIntegrationRun_ {
|
|
|
4881
4905
|
@MaxLength(200)
|
|
4882
4906
|
RunByUser: string;
|
|
4883
4907
|
|
|
4884
|
-
@Field(() => [CompanyIntegrationRunAPILog_])
|
|
4885
|
-
CompanyIntegrationRunAPILogsArray: CompanyIntegrationRunAPILog_[]; // Link to CompanyIntegrationRunAPILogs
|
|
4908
|
+
@Field(() => [mj_core_schema_server_object_types.CompanyIntegrationRunAPILog_])
|
|
4909
|
+
CompanyIntegrationRunAPILogsArray: mj_core_schema_server_object_types.CompanyIntegrationRunAPILog_[]; // Link to CompanyIntegrationRunAPILogs
|
|
4886
4910
|
|
|
4887
|
-
@Field(() => [ErrorLog_])
|
|
4888
|
-
ErrorLogsArray: ErrorLog_[]; // Link to ErrorLogs
|
|
4911
|
+
@Field(() => [mj_core_schema_server_object_types.ErrorLog_])
|
|
4912
|
+
ErrorLogsArray: mj_core_schema_server_object_types.ErrorLog_[]; // Link to ErrorLogs
|
|
4889
4913
|
|
|
4890
|
-
@Field(() => [CompanyIntegrationRunDetail_])
|
|
4891
|
-
CompanyIntegrationRunDetailsArray: CompanyIntegrationRunDetail_[]; // Link to CompanyIntegrationRunDetails
|
|
4914
|
+
@Field(() => [mj_core_schema_server_object_types.CompanyIntegrationRunDetail_])
|
|
4915
|
+
CompanyIntegrationRunDetailsArray: mj_core_schema_server_object_types.CompanyIntegrationRunDetail_[]; // Link to CompanyIntegrationRunDetails
|
|
4892
4916
|
|
|
4893
4917
|
}
|
|
4894
4918
|
|
|
@@ -4964,33 +4988,33 @@ export class CompanyIntegrationRunResolver extends ResolverBase {
|
|
|
4964
4988
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
4965
4989
|
}
|
|
4966
4990
|
@Query(() => CompanyIntegrationRun_, { nullable: true })
|
|
4967
|
-
async CompanyIntegrationRun(@Arg('ID', () => Int) ID:
|
|
4991
|
+
async CompanyIntegrationRun(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<CompanyIntegrationRun_ | null> {
|
|
4968
4992
|
this.CheckUserReadPermissions('Company Integration Runs', userPayload);
|
|
4969
|
-
const sSQL = `SELECT * FROM [
|
|
4993
|
+
const sSQL = `SELECT * FROM [__mj].[vwCompanyIntegrationRuns] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Company Integration Runs', userPayload, EntityPermissionType.Read, 'AND');
|
|
4970
4994
|
const result = this.MapFieldNamesToCodeNames('Company Integration Runs', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
4971
4995
|
return result;
|
|
4972
4996
|
}
|
|
4973
4997
|
|
|
4974
|
-
@FieldResolver(() => [CompanyIntegrationRunAPILog_])
|
|
4998
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.CompanyIntegrationRunAPILog_])
|
|
4975
4999
|
async CompanyIntegrationRunAPILogsArray(@Root() companyintegrationrun_: CompanyIntegrationRun_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
4976
5000
|
this.CheckUserReadPermissions('Company Integration Run API Logs', userPayload);
|
|
4977
|
-
const sSQL = `SELECT * FROM [
|
|
5001
|
+
const sSQL = `SELECT * FROM [__mj].[vwCompanyIntegrationRunAPILogs] WHERE [CompanyIntegrationRunID]=${companyintegrationrun_.ID} ` + this.getRowLevelSecurityWhereClause('Company Integration Run API Logs', userPayload, EntityPermissionType.Read, 'AND');
|
|
4978
5002
|
const result = this.ArrayMapFieldNamesToCodeNames('Company Integration Run API Logs', await dataSource.query(sSQL));
|
|
4979
5003
|
return result;
|
|
4980
5004
|
}
|
|
4981
5005
|
|
|
4982
|
-
@FieldResolver(() => [ErrorLog_])
|
|
5006
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.ErrorLog_])
|
|
4983
5007
|
async ErrorLogsArray(@Root() companyintegrationrun_: CompanyIntegrationRun_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
4984
5008
|
this.CheckUserReadPermissions('Error Logs', userPayload);
|
|
4985
|
-
const sSQL = `SELECT * FROM [
|
|
5009
|
+
const sSQL = `SELECT * FROM [__mj].[vwErrorLogs] WHERE [CompanyIntegrationRunID]=${companyintegrationrun_.ID} ` + this.getRowLevelSecurityWhereClause('Error Logs', userPayload, EntityPermissionType.Read, 'AND');
|
|
4986
5010
|
const result = this.ArrayMapFieldNamesToCodeNames('Error Logs', await dataSource.query(sSQL));
|
|
4987
5011
|
return result;
|
|
4988
5012
|
}
|
|
4989
5013
|
|
|
4990
|
-
@FieldResolver(() => [CompanyIntegrationRunDetail_])
|
|
5014
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.CompanyIntegrationRunDetail_])
|
|
4991
5015
|
async CompanyIntegrationRunDetailsArray(@Root() companyintegrationrun_: CompanyIntegrationRun_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
4992
5016
|
this.CheckUserReadPermissions('Company Integration Run Details', userPayload);
|
|
4993
|
-
const sSQL = `SELECT * FROM [
|
|
5017
|
+
const sSQL = `SELECT * FROM [__mj].[vwCompanyIntegrationRunDetails] WHERE [CompanyIntegrationRunID]=${companyintegrationrun_.ID} ` + this.getRowLevelSecurityWhereClause('Company Integration Run Details', userPayload, EntityPermissionType.Read, 'AND');
|
|
4994
5018
|
const result = this.ArrayMapFieldNamesToCodeNames('Company Integration Run Details', await dataSource.query(sSQL));
|
|
4995
5019
|
return result;
|
|
4996
5020
|
}
|
|
@@ -5069,8 +5093,8 @@ export class CompanyIntegrationRunDetail_ {
|
|
|
5069
5093
|
@MaxLength(8)
|
|
5070
5094
|
RunEndedAt?: Date;
|
|
5071
5095
|
|
|
5072
|
-
@Field(() => [ErrorLog_])
|
|
5073
|
-
ErrorLogsArray: ErrorLog_[]; // Link to ErrorLogs
|
|
5096
|
+
@Field(() => [mj_core_schema_server_object_types.ErrorLog_])
|
|
5097
|
+
ErrorLogsArray: mj_core_schema_server_object_types.ErrorLog_[]; // Link to ErrorLogs
|
|
5074
5098
|
|
|
5075
5099
|
}
|
|
5076
5100
|
|
|
@@ -5146,17 +5170,17 @@ export class CompanyIntegrationRunDetailResolver extends ResolverBase {
|
|
|
5146
5170
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
5147
5171
|
}
|
|
5148
5172
|
@Query(() => CompanyIntegrationRunDetail_, { nullable: true })
|
|
5149
|
-
async CompanyIntegrationRunDetail(@Arg('ID', () => Int) ID:
|
|
5173
|
+
async CompanyIntegrationRunDetail(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<CompanyIntegrationRunDetail_ | null> {
|
|
5150
5174
|
this.CheckUserReadPermissions('Company Integration Run Details', userPayload);
|
|
5151
|
-
const sSQL = `SELECT * FROM [
|
|
5175
|
+
const sSQL = `SELECT * FROM [__mj].[vwCompanyIntegrationRunDetails] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Company Integration Run Details', userPayload, EntityPermissionType.Read, 'AND');
|
|
5152
5176
|
const result = this.MapFieldNamesToCodeNames('Company Integration Run Details', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
5153
5177
|
return result;
|
|
5154
5178
|
}
|
|
5155
5179
|
|
|
5156
|
-
@FieldResolver(() => [ErrorLog_])
|
|
5180
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.ErrorLog_])
|
|
5157
5181
|
async ErrorLogsArray(@Root() companyintegrationrundetail_: CompanyIntegrationRunDetail_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
5158
5182
|
this.CheckUserReadPermissions('Error Logs', userPayload);
|
|
5159
|
-
const sSQL = `SELECT * FROM [
|
|
5183
|
+
const sSQL = `SELECT * FROM [__mj].[vwErrorLogs] WHERE [CompanyIntegrationRunDetailID]=${companyintegrationrundetail_.ID} ` + this.getRowLevelSecurityWhereClause('Error Logs', userPayload, EntityPermissionType.Read, 'AND');
|
|
5160
5184
|
const result = this.ArrayMapFieldNamesToCodeNames('Error Logs', await dataSource.query(sSQL));
|
|
5161
5185
|
return result;
|
|
5162
5186
|
}
|
|
@@ -5314,9 +5338,9 @@ export class ErrorLogResolver extends ResolverBase {
|
|
|
5314
5338
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
5315
5339
|
}
|
|
5316
5340
|
@Query(() => ErrorLog_, { nullable: true })
|
|
5317
|
-
async ErrorLog(@Arg('ID', () => Int) ID:
|
|
5341
|
+
async ErrorLog(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<ErrorLog_ | null> {
|
|
5318
5342
|
this.CheckUserReadPermissions('Error Logs', userPayload);
|
|
5319
|
-
const sSQL = `SELECT * FROM [
|
|
5343
|
+
const sSQL = `SELECT * FROM [__mj].[vwErrorLogs] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Error Logs', userPayload, EntityPermissionType.Read, 'AND');
|
|
5320
5344
|
const result = this.MapFieldNamesToCodeNames('Error Logs', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
5321
5345
|
return result;
|
|
5322
5346
|
}
|
|
@@ -5378,11 +5402,11 @@ export class Application_ {
|
|
|
5378
5402
|
@MaxLength(8)
|
|
5379
5403
|
UpdatedAt: Date;
|
|
5380
5404
|
|
|
5381
|
-
@Field(() => [ApplicationEntity_])
|
|
5382
|
-
ApplicationEntitiesArray: ApplicationEntity_[]; // Link to ApplicationEntities
|
|
5405
|
+
@Field(() => [mj_core_schema_server_object_types.ApplicationEntity_])
|
|
5406
|
+
ApplicationEntitiesArray: mj_core_schema_server_object_types.ApplicationEntity_[]; // Link to ApplicationEntities
|
|
5383
5407
|
|
|
5384
|
-
@Field(() => [UserApplication_])
|
|
5385
|
-
UserApplicationsArray: UserApplication_[]; // Link to UserApplications
|
|
5408
|
+
@Field(() => [mj_core_schema_server_object_types.UserApplication_])
|
|
5409
|
+
UserApplicationsArray: mj_core_schema_server_object_types.UserApplication_[]; // Link to UserApplications
|
|
5386
5410
|
|
|
5387
5411
|
}
|
|
5388
5412
|
|
|
@@ -5446,9 +5470,9 @@ export class ApplicationResolver extends ResolverBase {
|
|
|
5446
5470
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
5447
5471
|
}
|
|
5448
5472
|
@Query(() => Application_, { nullable: true })
|
|
5449
|
-
async Application(@Arg('ID', () => Int) ID:
|
|
5473
|
+
async Application(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<Application_ | null> {
|
|
5450
5474
|
this.CheckUserReadPermissions('Applications', userPayload);
|
|
5451
|
-
const sSQL = `SELECT * FROM [
|
|
5475
|
+
const sSQL = `SELECT * FROM [__mj].[vwApplications] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Applications', userPayload, EntityPermissionType.Read, 'AND');
|
|
5452
5476
|
const result = this.MapFieldNamesToCodeNames('Applications', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
5453
5477
|
return result;
|
|
5454
5478
|
}
|
|
@@ -5456,23 +5480,23 @@ export class ApplicationResolver extends ResolverBase {
|
|
|
5456
5480
|
@Query(() => [Application_])
|
|
5457
5481
|
async AllApplications(@Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
5458
5482
|
this.CheckUserReadPermissions('Applications', userPayload);
|
|
5459
|
-
const sSQL = 'SELECT * FROM [
|
|
5483
|
+
const sSQL = 'SELECT * FROM [__mj].[vwApplications]' + this.getRowLevelSecurityWhereClause('Applications', userPayload, EntityPermissionType.Read, ' WHERE');
|
|
5460
5484
|
const result = this.ArrayMapFieldNamesToCodeNames('Applications', await dataSource.query(sSQL));
|
|
5461
5485
|
return result;
|
|
5462
5486
|
}
|
|
5463
5487
|
|
|
5464
|
-
@FieldResolver(() => [ApplicationEntity_])
|
|
5488
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.ApplicationEntity_])
|
|
5465
5489
|
async ApplicationEntitiesArray(@Root() application_: Application_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
5466
5490
|
this.CheckUserReadPermissions('Application Entities', userPayload);
|
|
5467
|
-
const sSQL = `SELECT * FROM [
|
|
5491
|
+
const sSQL = `SELECT * FROM [__mj].[vwApplicationEntities] WHERE [ApplicationID]=${application_.ID} ` + this.getRowLevelSecurityWhereClause('Application Entities', userPayload, EntityPermissionType.Read, 'AND');
|
|
5468
5492
|
const result = this.ArrayMapFieldNamesToCodeNames('Application Entities', await dataSource.query(sSQL));
|
|
5469
5493
|
return result;
|
|
5470
5494
|
}
|
|
5471
5495
|
|
|
5472
|
-
@FieldResolver(() => [UserApplication_])
|
|
5496
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.UserApplication_])
|
|
5473
5497
|
async UserApplicationsArray(@Root() application_: Application_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
5474
5498
|
this.CheckUserReadPermissions('User Applications', userPayload);
|
|
5475
|
-
const sSQL = `SELECT * FROM [
|
|
5499
|
+
const sSQL = `SELECT * FROM [__mj].[vwUserApplications] WHERE [ApplicationID]=${application_.ID} ` + this.getRowLevelSecurityWhereClause('User Applications', userPayload, EntityPermissionType.Read, 'AND');
|
|
5476
5500
|
const result = this.ArrayMapFieldNamesToCodeNames('User Applications', await dataSource.query(sSQL));
|
|
5477
5501
|
return result;
|
|
5478
5502
|
}
|
|
@@ -5653,9 +5677,9 @@ export class ApplicationEntityResolver extends ResolverBase {
|
|
|
5653
5677
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
5654
5678
|
}
|
|
5655
5679
|
@Query(() => ApplicationEntity_, { nullable: true })
|
|
5656
|
-
async ApplicationEntity(@Arg('ID', () => Int) ID:
|
|
5680
|
+
async ApplicationEntity(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<ApplicationEntity_ | null> {
|
|
5657
5681
|
this.CheckUserReadPermissions('Application Entities', userPayload);
|
|
5658
|
-
const sSQL = `SELECT * FROM [
|
|
5682
|
+
const sSQL = `SELECT * FROM [__mj].[vwApplicationEntities] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Application Entities', userPayload, EntityPermissionType.Read, 'AND');
|
|
5659
5683
|
const result = this.MapFieldNamesToCodeNames('Application Entities', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
5660
5684
|
return result;
|
|
5661
5685
|
}
|
|
@@ -5722,7 +5746,7 @@ export class ApplicationEntityResolver extends ResolverBase {
|
|
|
5722
5746
|
}
|
|
5723
5747
|
|
|
5724
5748
|
@Mutation(() => ApplicationEntity_)
|
|
5725
|
-
async DeleteApplicationEntity(@Arg('ID', () => Int) ID:
|
|
5749
|
+
async DeleteApplicationEntity(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
5726
5750
|
if (await this.BeforeDelete(dataSource, ID)) { // fire event and proceed if it wasn't cancelled
|
|
5727
5751
|
const entityObject = <ApplicationEntityEntity>await new Metadata().GetEntityObject('Application Entities', this.GetUserFromPayload(userPayload));
|
|
5728
5752
|
await entityObject.Load(ID);
|
|
@@ -5739,11 +5763,11 @@ export class ApplicationEntityResolver extends ResolverBase {
|
|
|
5739
5763
|
}
|
|
5740
5764
|
|
|
5741
5765
|
// Before/After UPDATE Event Hooks for Sub-Classes to Override
|
|
5742
|
-
protected async BeforeDelete(dataSource: DataSource, ID:
|
|
5766
|
+
protected async BeforeDelete(dataSource: DataSource, ID: number): Promise<boolean> {
|
|
5743
5767
|
const i = ID, d = dataSource; // prevent error;
|
|
5744
5768
|
return true;
|
|
5745
5769
|
}
|
|
5746
|
-
protected async AfterDelete(dataSource: DataSource, ID:
|
|
5770
|
+
protected async AfterDelete(dataSource: DataSource, ID: number) {
|
|
5747
5771
|
const i = ID, d = dataSource; // prevent error
|
|
5748
5772
|
}
|
|
5749
5773
|
|
|
@@ -5946,9 +5970,9 @@ export class EntityPermissionResolver extends ResolverBase {
|
|
|
5946
5970
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
5947
5971
|
}
|
|
5948
5972
|
@Query(() => EntityPermission_, { nullable: true })
|
|
5949
|
-
async EntityPermission(@Arg('ID', () => Int) ID:
|
|
5973
|
+
async EntityPermission(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<EntityPermission_ | null> {
|
|
5950
5974
|
this.CheckUserReadPermissions('Entity Permissions', userPayload);
|
|
5951
|
-
const sSQL = `SELECT * FROM [
|
|
5975
|
+
const sSQL = `SELECT * FROM [__mj].[vwEntityPermissions] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Entity Permissions', userPayload, EntityPermissionType.Read, 'AND');
|
|
5952
5976
|
const result = this.MapFieldNamesToCodeNames('Entity Permissions', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
5953
5977
|
return result;
|
|
5954
5978
|
}
|
|
@@ -5956,7 +5980,7 @@ export class EntityPermissionResolver extends ResolverBase {
|
|
|
5956
5980
|
@Query(() => [EntityPermission_])
|
|
5957
5981
|
async AllEntityPermissions(@Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
5958
5982
|
this.CheckUserReadPermissions('Entity Permissions', userPayload);
|
|
5959
|
-
const sSQL = 'SELECT * FROM [
|
|
5983
|
+
const sSQL = 'SELECT * FROM [__mj].[vwEntityPermissions]' + this.getRowLevelSecurityWhereClause('Entity Permissions', userPayload, EntityPermissionType.Read, ' WHERE');
|
|
5960
5984
|
const result = this.ArrayMapFieldNamesToCodeNames('Entity Permissions', await dataSource.query(sSQL));
|
|
5961
5985
|
return result;
|
|
5962
5986
|
}
|
|
@@ -6023,7 +6047,7 @@ export class EntityPermissionResolver extends ResolverBase {
|
|
|
6023
6047
|
}
|
|
6024
6048
|
|
|
6025
6049
|
@Mutation(() => EntityPermission_)
|
|
6026
|
-
async DeleteEntityPermission(@Arg('ID', () => Int) ID:
|
|
6050
|
+
async DeleteEntityPermission(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
6027
6051
|
if (await this.BeforeDelete(dataSource, ID)) { // fire event and proceed if it wasn't cancelled
|
|
6028
6052
|
const entityObject = <EntityPermissionEntity>await new Metadata().GetEntityObject('Entity Permissions', this.GetUserFromPayload(userPayload));
|
|
6029
6053
|
await entityObject.Load(ID);
|
|
@@ -6040,11 +6064,11 @@ export class EntityPermissionResolver extends ResolverBase {
|
|
|
6040
6064
|
}
|
|
6041
6065
|
|
|
6042
6066
|
// Before/After UPDATE Event Hooks for Sub-Classes to Override
|
|
6043
|
-
protected async BeforeDelete(dataSource: DataSource, ID:
|
|
6067
|
+
protected async BeforeDelete(dataSource: DataSource, ID: number): Promise<boolean> {
|
|
6044
6068
|
const i = ID, d = dataSource; // prevent error;
|
|
6045
6069
|
return true;
|
|
6046
6070
|
}
|
|
6047
|
-
protected async AfterDelete(dataSource: DataSource, ID:
|
|
6071
|
+
protected async AfterDelete(dataSource: DataSource, ID: number) {
|
|
6048
6072
|
const i = ID, d = dataSource; // prevent error
|
|
6049
6073
|
}
|
|
6050
6074
|
|
|
@@ -6163,9 +6187,9 @@ export class UserApplicationEntityResolver extends ResolverBase {
|
|
|
6163
6187
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
6164
6188
|
}
|
|
6165
6189
|
@Query(() => UserApplicationEntity_, { nullable: true })
|
|
6166
|
-
async UserApplicationEntity(@Arg('ID', () => Int) ID:
|
|
6190
|
+
async UserApplicationEntity(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<UserApplicationEntity_ | null> {
|
|
6167
6191
|
this.CheckUserReadPermissions('User Application Entities', userPayload);
|
|
6168
|
-
const sSQL = `SELECT * FROM [
|
|
6192
|
+
const sSQL = `SELECT * FROM [__mj].[vwUserApplicationEntities] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('User Application Entities', userPayload, EntityPermissionType.Read, 'AND');
|
|
6169
6193
|
const result = this.MapFieldNamesToCodeNames('User Application Entities', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
6170
6194
|
return result;
|
|
6171
6195
|
}
|
|
@@ -6232,7 +6256,7 @@ export class UserApplicationEntityResolver extends ResolverBase {
|
|
|
6232
6256
|
}
|
|
6233
6257
|
|
|
6234
6258
|
@Mutation(() => UserApplicationEntity_)
|
|
6235
|
-
async DeleteUserApplicationEntity(@Arg('ID', () => Int) ID:
|
|
6259
|
+
async DeleteUserApplicationEntity(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
6236
6260
|
if (await this.BeforeDelete(dataSource, ID)) { // fire event and proceed if it wasn't cancelled
|
|
6237
6261
|
const entityObject = <UserApplicationEntityEntity>await new Metadata().GetEntityObject('User Application Entities', this.GetUserFromPayload(userPayload));
|
|
6238
6262
|
await entityObject.Load(ID);
|
|
@@ -6249,11 +6273,11 @@ export class UserApplicationEntityResolver extends ResolverBase {
|
|
|
6249
6273
|
}
|
|
6250
6274
|
|
|
6251
6275
|
// Before/After UPDATE Event Hooks for Sub-Classes to Override
|
|
6252
|
-
protected async BeforeDelete(dataSource: DataSource, ID:
|
|
6276
|
+
protected async BeforeDelete(dataSource: DataSource, ID: number): Promise<boolean> {
|
|
6253
6277
|
const i = ID, d = dataSource; // prevent error;
|
|
6254
6278
|
return true;
|
|
6255
6279
|
}
|
|
6256
|
-
protected async AfterDelete(dataSource: DataSource, ID:
|
|
6280
|
+
protected async AfterDelete(dataSource: DataSource, ID: number) {
|
|
6257
6281
|
const i = ID, d = dataSource; // prevent error
|
|
6258
6282
|
}
|
|
6259
6283
|
|
|
@@ -6287,8 +6311,8 @@ export class UserApplication_ {
|
|
|
6287
6311
|
@MaxLength(100)
|
|
6288
6312
|
Application: string;
|
|
6289
6313
|
|
|
6290
|
-
@Field(() => [UserApplicationEntity_])
|
|
6291
|
-
UserApplicationEntitiesArray: UserApplicationEntity_[]; // Link to UserApplicationEntities
|
|
6314
|
+
@Field(() => [mj_core_schema_server_object_types.UserApplicationEntity_])
|
|
6315
|
+
UserApplicationEntitiesArray: mj_core_schema_server_object_types.UserApplicationEntity_[]; // Link to UserApplicationEntities
|
|
6292
6316
|
|
|
6293
6317
|
}
|
|
6294
6318
|
|
|
@@ -6358,17 +6382,17 @@ export class UserApplicationResolver extends ResolverBase {
|
|
|
6358
6382
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
6359
6383
|
}
|
|
6360
6384
|
@Query(() => UserApplication_, { nullable: true })
|
|
6361
|
-
async UserApplication(@Arg('ID', () => Int) ID:
|
|
6385
|
+
async UserApplication(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<UserApplication_ | null> {
|
|
6362
6386
|
this.CheckUserReadPermissions('User Applications', userPayload);
|
|
6363
|
-
const sSQL = `SELECT * FROM [
|
|
6387
|
+
const sSQL = `SELECT * FROM [__mj].[vwUserApplications] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('User Applications', userPayload, EntityPermissionType.Read, 'AND');
|
|
6364
6388
|
const result = this.MapFieldNamesToCodeNames('User Applications', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
6365
6389
|
return result;
|
|
6366
6390
|
}
|
|
6367
6391
|
|
|
6368
|
-
@FieldResolver(() => [UserApplicationEntity_])
|
|
6392
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.UserApplicationEntity_])
|
|
6369
6393
|
async UserApplicationEntitiesArray(@Root() userapplication_: UserApplication_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
6370
6394
|
this.CheckUserReadPermissions('User Application Entities', userPayload);
|
|
6371
|
-
const sSQL = `SELECT * FROM [
|
|
6395
|
+
const sSQL = `SELECT * FROM [__mj].[vwUserApplicationEntities] WHERE [UserApplicationID]=${userapplication_.ID} ` + this.getRowLevelSecurityWhereClause('User Application Entities', userPayload, EntityPermissionType.Read, 'AND');
|
|
6372
6396
|
const result = this.ArrayMapFieldNamesToCodeNames('User Application Entities', await dataSource.query(sSQL));
|
|
6373
6397
|
return result;
|
|
6374
6398
|
}
|
|
@@ -6508,9 +6532,9 @@ export class CompanyIntegrationRunAPILogResolver extends ResolverBase {
|
|
|
6508
6532
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
6509
6533
|
}
|
|
6510
6534
|
@Query(() => CompanyIntegrationRunAPILog_, { nullable: true })
|
|
6511
|
-
async CompanyIntegrationRunAPILog(@Arg('ID', () => Int) ID:
|
|
6535
|
+
async CompanyIntegrationRunAPILog(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<CompanyIntegrationRunAPILog_ | null> {
|
|
6512
6536
|
this.CheckUserReadPermissions('Company Integration Run API Logs', userPayload);
|
|
6513
|
-
const sSQL = `SELECT * FROM [
|
|
6537
|
+
const sSQL = `SELECT * FROM [__mj].[vwCompanyIntegrationRunAPILogs] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Company Integration Run API Logs', userPayload, EntityPermissionType.Read, 'AND');
|
|
6514
6538
|
const result = this.MapFieldNamesToCodeNames('Company Integration Run API Logs', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
6515
6539
|
return result;
|
|
6516
6540
|
}
|
|
@@ -6584,12 +6608,16 @@ export class List_ {
|
|
|
6584
6608
|
@MaxLength(8)
|
|
6585
6609
|
UpdatedAt: Date;
|
|
6586
6610
|
|
|
6611
|
+
@Field({nullable: true})
|
|
6612
|
+
@MaxLength(510)
|
|
6613
|
+
Entity?: string;
|
|
6614
|
+
|
|
6587
6615
|
@Field()
|
|
6588
6616
|
@MaxLength(200)
|
|
6589
6617
|
User: string;
|
|
6590
6618
|
|
|
6591
|
-
@Field(() => [ListDetail_])
|
|
6592
|
-
ListDetailsArray: ListDetail_[]; // Link to ListDetails
|
|
6619
|
+
@Field(() => [mj_core_schema_server_object_types.ListDetail_])
|
|
6620
|
+
ListDetailsArray: mj_core_schema_server_object_types.ListDetail_[]; // Link to ListDetails
|
|
6593
6621
|
|
|
6594
6622
|
}
|
|
6595
6623
|
|
|
@@ -6693,17 +6721,17 @@ export class ListResolver extends ResolverBase {
|
|
|
6693
6721
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
6694
6722
|
}
|
|
6695
6723
|
@Query(() => List_, { nullable: true })
|
|
6696
|
-
async List(@Arg('ID', () => Int) ID:
|
|
6724
|
+
async List(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<List_ | null> {
|
|
6697
6725
|
this.CheckUserReadPermissions('Lists', userPayload);
|
|
6698
|
-
const sSQL = `SELECT * FROM [
|
|
6726
|
+
const sSQL = `SELECT * FROM [__mj].[vwLists] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Lists', userPayload, EntityPermissionType.Read, 'AND');
|
|
6699
6727
|
const result = this.MapFieldNamesToCodeNames('Lists', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
6700
6728
|
return result;
|
|
6701
6729
|
}
|
|
6702
6730
|
|
|
6703
|
-
@FieldResolver(() => [ListDetail_])
|
|
6731
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.ListDetail_])
|
|
6704
6732
|
async ListDetailsArray(@Root() list_: List_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
6705
6733
|
this.CheckUserReadPermissions('List Details', userPayload);
|
|
6706
|
-
const sSQL = `SELECT * FROM [
|
|
6734
|
+
const sSQL = `SELECT * FROM [__mj].[vwListDetails] WHERE [ListID]=${list_.ID} ` + this.getRowLevelSecurityWhereClause('List Details', userPayload, EntityPermissionType.Read, 'AND');
|
|
6707
6735
|
const result = this.ArrayMapFieldNamesToCodeNames('List Details', await dataSource.query(sSQL));
|
|
6708
6736
|
return result;
|
|
6709
6737
|
}
|
|
@@ -6770,7 +6798,7 @@ export class ListResolver extends ResolverBase {
|
|
|
6770
6798
|
}
|
|
6771
6799
|
|
|
6772
6800
|
@Mutation(() => List_)
|
|
6773
|
-
async DeleteList(@Arg('ID', () => Int) ID:
|
|
6801
|
+
async DeleteList(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
6774
6802
|
if (await this.BeforeDelete(dataSource, ID)) { // fire event and proceed if it wasn't cancelled
|
|
6775
6803
|
const entityObject = <ListEntity>await new Metadata().GetEntityObject('Lists', this.GetUserFromPayload(userPayload));
|
|
6776
6804
|
await entityObject.Load(ID);
|
|
@@ -6787,11 +6815,11 @@ export class ListResolver extends ResolverBase {
|
|
|
6787
6815
|
}
|
|
6788
6816
|
|
|
6789
6817
|
// Before/After UPDATE Event Hooks for Sub-Classes to Override
|
|
6790
|
-
protected async BeforeDelete(dataSource: DataSource, ID:
|
|
6818
|
+
protected async BeforeDelete(dataSource: DataSource, ID: number): Promise<boolean> {
|
|
6791
6819
|
const i = ID, d = dataSource; // prevent error;
|
|
6792
6820
|
return true;
|
|
6793
6821
|
}
|
|
6794
|
-
protected async AfterDelete(dataSource: DataSource, ID:
|
|
6822
|
+
protected async AfterDelete(dataSource: DataSource, ID: number) {
|
|
6795
6823
|
const i = ID, d = dataSource; // prevent error
|
|
6796
6824
|
}
|
|
6797
6825
|
|
|
@@ -6899,9 +6927,9 @@ export class ListDetailResolver extends ResolverBase {
|
|
|
6899
6927
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
6900
6928
|
}
|
|
6901
6929
|
@Query(() => ListDetail_, { nullable: true })
|
|
6902
|
-
async ListDetail(@Arg('ID', () => Int) ID:
|
|
6930
|
+
async ListDetail(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<ListDetail_ | null> {
|
|
6903
6931
|
this.CheckUserReadPermissions('List Details', userPayload);
|
|
6904
|
-
const sSQL = `SELECT * FROM [
|
|
6932
|
+
const sSQL = `SELECT * FROM [__mj].[vwListDetails] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('List Details', userPayload, EntityPermissionType.Read, 'AND');
|
|
6905
6933
|
const result = this.MapFieldNamesToCodeNames('List Details', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
6906
6934
|
return result;
|
|
6907
6935
|
}
|
|
@@ -6968,7 +6996,7 @@ export class ListDetailResolver extends ResolverBase {
|
|
|
6968
6996
|
}
|
|
6969
6997
|
|
|
6970
6998
|
@Mutation(() => ListDetail_)
|
|
6971
|
-
async DeleteListDetail(@Arg('ID', () => Int) ID:
|
|
6999
|
+
async DeleteListDetail(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
6972
7000
|
if (await this.BeforeDelete(dataSource, ID)) { // fire event and proceed if it wasn't cancelled
|
|
6973
7001
|
const entityObject = <ListDetailEntity>await new Metadata().GetEntityObject('List Details', this.GetUserFromPayload(userPayload));
|
|
6974
7002
|
await entityObject.Load(ID);
|
|
@@ -6985,11 +7013,11 @@ export class ListDetailResolver extends ResolverBase {
|
|
|
6985
7013
|
}
|
|
6986
7014
|
|
|
6987
7015
|
// Before/After UPDATE Event Hooks for Sub-Classes to Override
|
|
6988
|
-
protected async BeforeDelete(dataSource: DataSource, ID:
|
|
7016
|
+
protected async BeforeDelete(dataSource: DataSource, ID: number): Promise<boolean> {
|
|
6989
7017
|
const i = ID, d = dataSource; // prevent error;
|
|
6990
7018
|
return true;
|
|
6991
7019
|
}
|
|
6992
|
-
protected async AfterDelete(dataSource: DataSource, ID:
|
|
7020
|
+
protected async AfterDelete(dataSource: DataSource, ID: number) {
|
|
6993
7021
|
const i = ID, d = dataSource; // prevent error
|
|
6994
7022
|
}
|
|
6995
7023
|
|
|
@@ -7021,8 +7049,8 @@ export class UserViewRun_ {
|
|
|
7021
7049
|
@MaxLength(200)
|
|
7022
7050
|
RunByUser: string;
|
|
7023
7051
|
|
|
7024
|
-
@Field(() => [UserViewRunDetail_])
|
|
7025
|
-
UserViewRunDetailsArray: UserViewRunDetail_[]; // Link to UserViewRunDetails
|
|
7052
|
+
@Field(() => [mj_core_schema_server_object_types.UserViewRunDetail_])
|
|
7053
|
+
UserViewRunDetailsArray: mj_core_schema_server_object_types.UserViewRunDetail_[]; // Link to UserViewRunDetails
|
|
7026
7054
|
|
|
7027
7055
|
}
|
|
7028
7056
|
|
|
@@ -7108,17 +7136,17 @@ export class UserViewRunResolver extends ResolverBase {
|
|
|
7108
7136
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
7109
7137
|
}
|
|
7110
7138
|
@Query(() => UserViewRun_, { nullable: true })
|
|
7111
|
-
async UserViewRun(@Arg('ID', () => Int) ID:
|
|
7139
|
+
async UserViewRun(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<UserViewRun_ | null> {
|
|
7112
7140
|
this.CheckUserReadPermissions('User View Runs', userPayload);
|
|
7113
|
-
const sSQL = `SELECT * FROM [
|
|
7141
|
+
const sSQL = `SELECT * FROM [__mj].[vwUserViewRuns] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('User View Runs', userPayload, EntityPermissionType.Read, 'AND');
|
|
7114
7142
|
const result = this.MapFieldNamesToCodeNames('User View Runs', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
7115
7143
|
return result;
|
|
7116
7144
|
}
|
|
7117
7145
|
|
|
7118
|
-
@FieldResolver(() => [UserViewRunDetail_])
|
|
7146
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.UserViewRunDetail_])
|
|
7119
7147
|
async UserViewRunDetailsArray(@Root() userviewrun_: UserViewRun_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
7120
7148
|
this.CheckUserReadPermissions('User View Run Details', userPayload);
|
|
7121
|
-
const sSQL = `SELECT * FROM [
|
|
7149
|
+
const sSQL = `SELECT * FROM [__mj].[vwUserViewRunDetails] WHERE [UserViewRunID]=${userviewrun_.ID} ` + this.getRowLevelSecurityWhereClause('User View Run Details', userPayload, EntityPermissionType.Read, 'AND');
|
|
7122
7150
|
const result = this.ArrayMapFieldNamesToCodeNames('User View Run Details', await dataSource.query(sSQL));
|
|
7123
7151
|
return result;
|
|
7124
7152
|
}
|
|
@@ -7285,9 +7313,9 @@ export class UserViewRunDetailResolver extends ResolverBase {
|
|
|
7285
7313
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
7286
7314
|
}
|
|
7287
7315
|
@Query(() => UserViewRunDetail_, { nullable: true })
|
|
7288
|
-
async UserViewRunDetail(@Arg('ID', () => Int) ID:
|
|
7316
|
+
async UserViewRunDetail(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<UserViewRunDetail_ | null> {
|
|
7289
7317
|
this.CheckUserReadPermissions('User View Run Details', userPayload);
|
|
7290
|
-
const sSQL = `SELECT * FROM [
|
|
7318
|
+
const sSQL = `SELECT * FROM [__mj].[vwUserViewRunDetails] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('User View Run Details', userPayload, EntityPermissionType.Read, 'AND');
|
|
7291
7319
|
const result = this.MapFieldNamesToCodeNames('User View Run Details', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
7292
7320
|
return result;
|
|
7293
7321
|
}
|
|
@@ -7468,9 +7496,9 @@ export class WorkflowRunResolver extends ResolverBase {
|
|
|
7468
7496
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
7469
7497
|
}
|
|
7470
7498
|
@Query(() => WorkflowRun_, { nullable: true })
|
|
7471
|
-
async WorkflowRun(@Arg('ID', () => Int) ID:
|
|
7499
|
+
async WorkflowRun(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<WorkflowRun_ | null> {
|
|
7472
7500
|
this.CheckUserReadPermissions('Workflow Runs', userPayload);
|
|
7473
|
-
const sSQL = `SELECT * FROM [
|
|
7501
|
+
const sSQL = `SELECT * FROM [__mj].[vwWorkflowRuns] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Workflow Runs', userPayload, EntityPermissionType.Read, 'AND');
|
|
7474
7502
|
const result = this.MapFieldNamesToCodeNames('Workflow Runs', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
7475
7503
|
return result;
|
|
7476
7504
|
}
|
|
@@ -7543,11 +7571,11 @@ export class Workflow_ {
|
|
|
7543
7571
|
@MaxLength(8)
|
|
7544
7572
|
UpdatedAt: Date;
|
|
7545
7573
|
|
|
7546
|
-
@Field(() => [Report_])
|
|
7547
|
-
ReportsArray: Report_[]; // Link to Reports
|
|
7574
|
+
@Field(() => [mj_core_schema_server_object_types.Report_])
|
|
7575
|
+
ReportsArray: mj_core_schema_server_object_types.Report_[]; // Link to Reports
|
|
7548
7576
|
|
|
7549
|
-
@Field(() => [WorkflowRun_])
|
|
7550
|
-
WorkflowRunsArray: WorkflowRun_[]; // Link to WorkflowRuns
|
|
7577
|
+
@Field(() => [mj_core_schema_server_object_types.WorkflowRun_])
|
|
7578
|
+
WorkflowRunsArray: mj_core_schema_server_object_types.WorkflowRun_[]; // Link to WorkflowRuns
|
|
7551
7579
|
|
|
7552
7580
|
}
|
|
7553
7581
|
|
|
@@ -7620,25 +7648,25 @@ export class WorkflowResolver extends ResolverBase {
|
|
|
7620
7648
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
7621
7649
|
}
|
|
7622
7650
|
@Query(() => Workflow_, { nullable: true })
|
|
7623
|
-
async Workflow(@Arg('ID', () => Int) ID:
|
|
7651
|
+
async Workflow(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<Workflow_ | null> {
|
|
7624
7652
|
this.CheckUserReadPermissions('Workflows', userPayload);
|
|
7625
|
-
const sSQL = `SELECT * FROM [
|
|
7653
|
+
const sSQL = `SELECT * FROM [__mj].[vwWorkflows] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Workflows', userPayload, EntityPermissionType.Read, 'AND');
|
|
7626
7654
|
const result = this.MapFieldNamesToCodeNames('Workflows', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
7627
7655
|
return result;
|
|
7628
7656
|
}
|
|
7629
7657
|
|
|
7630
|
-
@FieldResolver(() => [Report_])
|
|
7658
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.Report_])
|
|
7631
7659
|
async ReportsArray(@Root() workflow_: Workflow_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
7632
7660
|
this.CheckUserReadPermissions('Reports', userPayload);
|
|
7633
|
-
const sSQL = `SELECT * FROM [
|
|
7661
|
+
const sSQL = `SELECT * FROM [__mj].[vwReports] WHERE [OutputWorkflowID]=${workflow_.ID} ` + this.getRowLevelSecurityWhereClause('Reports', userPayload, EntityPermissionType.Read, 'AND');
|
|
7634
7662
|
const result = this.ArrayMapFieldNamesToCodeNames('Reports', await dataSource.query(sSQL));
|
|
7635
7663
|
return result;
|
|
7636
7664
|
}
|
|
7637
7665
|
|
|
7638
|
-
@FieldResolver(() => [WorkflowRun_])
|
|
7666
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.WorkflowRun_])
|
|
7639
7667
|
async WorkflowRunsArray(@Root() workflow_: Workflow_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
7640
7668
|
this.CheckUserReadPermissions('Workflow Runs', userPayload);
|
|
7641
|
-
const sSQL = `SELECT * FROM [
|
|
7669
|
+
const sSQL = `SELECT * FROM [__mj].[vwWorkflowRuns] WHERE [WorkflowName]=${workflow_.ID} ` + this.getRowLevelSecurityWhereClause('Workflow Runs', userPayload, EntityPermissionType.Read, 'AND');
|
|
7642
7670
|
const result = this.ArrayMapFieldNamesToCodeNames('Workflow Runs', await dataSource.query(sSQL));
|
|
7643
7671
|
return result;
|
|
7644
7672
|
}
|
|
@@ -7707,8 +7735,8 @@ export class WorkflowEngine_ {
|
|
|
7707
7735
|
@MaxLength(8)
|
|
7708
7736
|
UpdatedAt: Date;
|
|
7709
7737
|
|
|
7710
|
-
@Field(() => [Workflow_])
|
|
7711
|
-
WorkflowsArray: Workflow_[]; // Link to Workflows
|
|
7738
|
+
@Field(() => [mj_core_schema_server_object_types.Workflow_])
|
|
7739
|
+
WorkflowsArray: mj_core_schema_server_object_types.Workflow_[]; // Link to Workflows
|
|
7712
7740
|
|
|
7713
7741
|
}
|
|
7714
7742
|
|
|
@@ -7778,17 +7806,17 @@ export class WorkflowEngineResolver extends ResolverBase {
|
|
|
7778
7806
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
7779
7807
|
}
|
|
7780
7808
|
@Query(() => WorkflowEngine_, { nullable: true })
|
|
7781
|
-
async WorkflowEngine(@Arg('ID', () => Int) ID:
|
|
7809
|
+
async WorkflowEngine(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<WorkflowEngine_ | null> {
|
|
7782
7810
|
this.CheckUserReadPermissions('Workflow Engines', userPayload);
|
|
7783
|
-
const sSQL = `SELECT * FROM [
|
|
7811
|
+
const sSQL = `SELECT * FROM [__mj].[vwWorkflowEngines] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Workflow Engines', userPayload, EntityPermissionType.Read, 'AND');
|
|
7784
7812
|
const result = this.MapFieldNamesToCodeNames('Workflow Engines', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
7785
7813
|
return result;
|
|
7786
7814
|
}
|
|
7787
7815
|
|
|
7788
|
-
@FieldResolver(() => [Workflow_])
|
|
7816
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.Workflow_])
|
|
7789
7817
|
async WorkflowsArray(@Root() workflowengine_: WorkflowEngine_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
7790
7818
|
this.CheckUserReadPermissions('Workflows', userPayload);
|
|
7791
|
-
const sSQL = `SELECT * FROM [
|
|
7819
|
+
const sSQL = `SELECT * FROM [__mj].[vwWorkflows] WHERE [WorkflowEngineName]=${workflowengine_.ID} ` + this.getRowLevelSecurityWhereClause('Workflows', userPayload, EntityPermissionType.Read, 'AND');
|
|
7792
7820
|
const result = this.ArrayMapFieldNamesToCodeNames('Workflows', await dataSource.query(sSQL));
|
|
7793
7821
|
return result;
|
|
7794
7822
|
}
|
|
@@ -7952,9 +7980,9 @@ export class RecordChangeResolver extends ResolverBase {
|
|
|
7952
7980
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
7953
7981
|
}
|
|
7954
7982
|
@Query(() => RecordChange_, { nullable: true })
|
|
7955
|
-
async RecordChange(@Arg('ID', () => Int) ID:
|
|
7983
|
+
async RecordChange(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<RecordChange_ | null> {
|
|
7956
7984
|
this.CheckUserReadPermissions('Record Changes', userPayload);
|
|
7957
|
-
const sSQL = `SELECT * FROM [
|
|
7985
|
+
const sSQL = `SELECT * FROM [__mj].[vwRecordChanges] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Record Changes', userPayload, EntityPermissionType.Read, 'AND');
|
|
7958
7986
|
const result = this.MapFieldNamesToCodeNames('Record Changes', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
7959
7987
|
return result;
|
|
7960
7988
|
}
|
|
@@ -8077,9 +8105,9 @@ export class UserRoleResolver extends ResolverBase {
|
|
|
8077
8105
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
8078
8106
|
}
|
|
8079
8107
|
@Query(() => UserRole_, { nullable: true })
|
|
8080
|
-
async UserRole(@Arg('ID', () => Int) ID:
|
|
8108
|
+
async UserRole(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<UserRole_ | null> {
|
|
8081
8109
|
this.CheckUserReadPermissions('User Roles', userPayload);
|
|
8082
|
-
const sSQL = `SELECT * FROM [
|
|
8110
|
+
const sSQL = `SELECT * FROM [__mj].[vwUserRoles] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('User Roles', userPayload, EntityPermissionType.Read, 'AND');
|
|
8083
8111
|
const result = this.MapFieldNamesToCodeNames('User Roles', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
8084
8112
|
return result;
|
|
8085
8113
|
}
|
|
@@ -8087,7 +8115,7 @@ export class UserRoleResolver extends ResolverBase {
|
|
|
8087
8115
|
@Query(() => [UserRole_])
|
|
8088
8116
|
async AllUserRoles(@Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
8089
8117
|
this.CheckUserReadPermissions('User Roles', userPayload);
|
|
8090
|
-
const sSQL = 'SELECT * FROM [
|
|
8118
|
+
const sSQL = 'SELECT * FROM [__mj].[vwUserRoles]' + this.getRowLevelSecurityWhereClause('User Roles', userPayload, EntityPermissionType.Read, ' WHERE');
|
|
8091
8119
|
const result = this.ArrayMapFieldNamesToCodeNames('User Roles', await dataSource.query(sSQL));
|
|
8092
8120
|
return result;
|
|
8093
8121
|
}
|
|
@@ -8150,8 +8178,8 @@ export class RowLevelSecurityFilter_ {
|
|
|
8150
8178
|
@MaxLength(8)
|
|
8151
8179
|
UpdatedAt: Date;
|
|
8152
8180
|
|
|
8153
|
-
@Field(() => [EntityPermission_])
|
|
8154
|
-
EntityPermissionsArray: EntityPermission_[]; // Link to EntityPermissions
|
|
8181
|
+
@Field(() => [mj_core_schema_server_object_types.EntityPermission_])
|
|
8182
|
+
EntityPermissionsArray: mj_core_schema_server_object_types.EntityPermission_[]; // Link to EntityPermissions
|
|
8155
8183
|
|
|
8156
8184
|
}
|
|
8157
8185
|
//****************************************************************************
|
|
@@ -8199,9 +8227,9 @@ export class RowLevelSecurityFilterResolver extends ResolverBase {
|
|
|
8199
8227
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
8200
8228
|
}
|
|
8201
8229
|
@Query(() => RowLevelSecurityFilter_, { nullable: true })
|
|
8202
|
-
async RowLevelSecurityFilter(@Arg('ID', () => Int) ID:
|
|
8230
|
+
async RowLevelSecurityFilter(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<RowLevelSecurityFilter_ | null> {
|
|
8203
8231
|
this.CheckUserReadPermissions('Row Level Security Filters', userPayload);
|
|
8204
|
-
const sSQL = `SELECT * FROM [
|
|
8232
|
+
const sSQL = `SELECT * FROM [__mj].[vwRowLevelSecurityFilters] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Row Level Security Filters', userPayload, EntityPermissionType.Read, 'AND');
|
|
8205
8233
|
const result = this.MapFieldNamesToCodeNames('Row Level Security Filters', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
8206
8234
|
return result;
|
|
8207
8235
|
}
|
|
@@ -8209,15 +8237,15 @@ export class RowLevelSecurityFilterResolver extends ResolverBase {
|
|
|
8209
8237
|
@Query(() => [RowLevelSecurityFilter_])
|
|
8210
8238
|
async AllRowLevelSecurityFilters(@Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
8211
8239
|
this.CheckUserReadPermissions('Row Level Security Filters', userPayload);
|
|
8212
|
-
const sSQL = 'SELECT * FROM [
|
|
8240
|
+
const sSQL = 'SELECT * FROM [__mj].[vwRowLevelSecurityFilters]' + this.getRowLevelSecurityWhereClause('Row Level Security Filters', userPayload, EntityPermissionType.Read, ' WHERE');
|
|
8213
8241
|
const result = this.ArrayMapFieldNamesToCodeNames('Row Level Security Filters', await dataSource.query(sSQL));
|
|
8214
8242
|
return result;
|
|
8215
8243
|
}
|
|
8216
8244
|
|
|
8217
|
-
@FieldResolver(() => [EntityPermission_])
|
|
8245
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.EntityPermission_])
|
|
8218
8246
|
async EntityPermissionsArray(@Root() rowlevelsecurityfilter_: RowLevelSecurityFilter_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
8219
8247
|
this.CheckUserReadPermissions('Entity Permissions', userPayload);
|
|
8220
|
-
const sSQL = `SELECT * FROM [
|
|
8248
|
+
const sSQL = `SELECT * FROM [__mj].[vwEntityPermissions] WHERE [ReadRLSFilterID]=${rowlevelsecurityfilter_.ID} ` + this.getRowLevelSecurityWhereClause('Entity Permissions', userPayload, EntityPermissionType.Read, 'AND');
|
|
8221
8249
|
const result = this.ArrayMapFieldNamesToCodeNames('Entity Permissions', await dataSource.query(sSQL));
|
|
8222
8250
|
return result;
|
|
8223
8251
|
}
|
|
@@ -8271,6 +8299,10 @@ export class AuditLog_ {
|
|
|
8271
8299
|
@Field()
|
|
8272
8300
|
@MaxLength(200)
|
|
8273
8301
|
User: string;
|
|
8302
|
+
|
|
8303
|
+
@Field({nullable: true})
|
|
8304
|
+
@MaxLength(510)
|
|
8305
|
+
Entity?: string;
|
|
8274
8306
|
|
|
8275
8307
|
}
|
|
8276
8308
|
|
|
@@ -8383,9 +8415,9 @@ export class AuditLogResolver extends ResolverBase {
|
|
|
8383
8415
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
8384
8416
|
}
|
|
8385
8417
|
@Query(() => AuditLog_, { nullable: true })
|
|
8386
|
-
async AuditLog(@Arg('ID', () => Int) ID:
|
|
8418
|
+
async AuditLog(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<AuditLog_ | null> {
|
|
8387
8419
|
this.CheckUserReadPermissions('Audit Logs', userPayload);
|
|
8388
|
-
const sSQL = `SELECT * FROM [
|
|
8420
|
+
const sSQL = `SELECT * FROM [__mj].[vwAuditLogs] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Audit Logs', userPayload, EntityPermissionType.Read, 'AND');
|
|
8389
8421
|
const result = this.MapFieldNamesToCodeNames('Audit Logs', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
8390
8422
|
return result;
|
|
8391
8423
|
}
|
|
@@ -8485,17 +8517,17 @@ export class Authorization_ {
|
|
|
8485
8517
|
@MaxLength(8)
|
|
8486
8518
|
UpdatedAt: Date;
|
|
8487
8519
|
|
|
8488
|
-
@Field(() => [AuthorizationRole_])
|
|
8489
|
-
AuthorizationRolesArray: AuthorizationRole_[]; // Link to AuthorizationRoles
|
|
8520
|
+
@Field(() => [mj_core_schema_server_object_types.AuthorizationRole_])
|
|
8521
|
+
AuthorizationRolesArray: mj_core_schema_server_object_types.AuthorizationRole_[]; // Link to AuthorizationRoles
|
|
8490
8522
|
|
|
8491
|
-
@Field(() => [Authorization_])
|
|
8492
|
-
AuthorizationsArray: Authorization_[]; // Link to Authorizations
|
|
8523
|
+
@Field(() => [mj_core_schema_server_object_types.Authorization_])
|
|
8524
|
+
AuthorizationsArray: mj_core_schema_server_object_types.Authorization_[]; // Link to Authorizations
|
|
8493
8525
|
|
|
8494
|
-
@Field(() => [AuditLogType_])
|
|
8495
|
-
AuditLogTypesArray: AuditLogType_[]; // Link to AuditLogTypes
|
|
8526
|
+
@Field(() => [mj_core_schema_server_object_types.AuditLogType_])
|
|
8527
|
+
AuditLogTypesArray: mj_core_schema_server_object_types.AuditLogType_[]; // Link to AuditLogTypes
|
|
8496
8528
|
|
|
8497
|
-
@Field(() => [AuditLog_])
|
|
8498
|
-
AuditLogsArray: AuditLog_[]; // Link to AuditLogs
|
|
8529
|
+
@Field(() => [mj_core_schema_server_object_types.AuditLog_])
|
|
8530
|
+
AuditLogsArray: mj_core_schema_server_object_types.AuditLog_[]; // Link to AuditLogs
|
|
8499
8531
|
|
|
8500
8532
|
}
|
|
8501
8533
|
//****************************************************************************
|
|
@@ -8543,9 +8575,9 @@ export class AuthorizationResolver extends ResolverBase {
|
|
|
8543
8575
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
8544
8576
|
}
|
|
8545
8577
|
@Query(() => Authorization_, { nullable: true })
|
|
8546
|
-
async Authorization(@Arg('ID', () => Int) ID:
|
|
8578
|
+
async Authorization(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<Authorization_ | null> {
|
|
8547
8579
|
this.CheckUserReadPermissions('Authorizations', userPayload);
|
|
8548
|
-
const sSQL = `SELECT * FROM [
|
|
8580
|
+
const sSQL = `SELECT * FROM [__mj].[vwAuthorizations] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Authorizations', userPayload, EntityPermissionType.Read, 'AND');
|
|
8549
8581
|
const result = this.MapFieldNamesToCodeNames('Authorizations', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
8550
8582
|
return result;
|
|
8551
8583
|
}
|
|
@@ -8553,39 +8585,39 @@ export class AuthorizationResolver extends ResolverBase {
|
|
|
8553
8585
|
@Query(() => [Authorization_])
|
|
8554
8586
|
async AllAuthorizations(@Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
8555
8587
|
this.CheckUserReadPermissions('Authorizations', userPayload);
|
|
8556
|
-
const sSQL = 'SELECT * FROM [
|
|
8588
|
+
const sSQL = 'SELECT * FROM [__mj].[vwAuthorizations]' + this.getRowLevelSecurityWhereClause('Authorizations', userPayload, EntityPermissionType.Read, ' WHERE');
|
|
8557
8589
|
const result = this.ArrayMapFieldNamesToCodeNames('Authorizations', await dataSource.query(sSQL));
|
|
8558
8590
|
return result;
|
|
8559
8591
|
}
|
|
8560
8592
|
|
|
8561
|
-
@FieldResolver(() => [AuthorizationRole_])
|
|
8593
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.AuthorizationRole_])
|
|
8562
8594
|
async AuthorizationRolesArray(@Root() authorization_: Authorization_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
8563
8595
|
this.CheckUserReadPermissions('Authorization Roles', userPayload);
|
|
8564
|
-
const sSQL = `SELECT * FROM [
|
|
8596
|
+
const sSQL = `SELECT * FROM [__mj].[vwAuthorizationRoles] WHERE [AuthorizationID]=${authorization_.ID} ` + this.getRowLevelSecurityWhereClause('Authorization Roles', userPayload, EntityPermissionType.Read, 'AND');
|
|
8565
8597
|
const result = this.ArrayMapFieldNamesToCodeNames('Authorization Roles', await dataSource.query(sSQL));
|
|
8566
8598
|
return result;
|
|
8567
8599
|
}
|
|
8568
8600
|
|
|
8569
|
-
@FieldResolver(() => [Authorization_])
|
|
8601
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.Authorization_])
|
|
8570
8602
|
async AuthorizationsArray(@Root() authorization_: Authorization_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
8571
8603
|
this.CheckUserReadPermissions('Authorizations', userPayload);
|
|
8572
|
-
const sSQL = `SELECT * FROM [
|
|
8604
|
+
const sSQL = `SELECT * FROM [__mj].[vwAuthorizations] WHERE [ParentID]=${authorization_.ID} ` + this.getRowLevelSecurityWhereClause('Authorizations', userPayload, EntityPermissionType.Read, 'AND');
|
|
8573
8605
|
const result = this.ArrayMapFieldNamesToCodeNames('Authorizations', await dataSource.query(sSQL));
|
|
8574
8606
|
return result;
|
|
8575
8607
|
}
|
|
8576
8608
|
|
|
8577
|
-
@FieldResolver(() => [AuditLogType_])
|
|
8609
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.AuditLogType_])
|
|
8578
8610
|
async AuditLogTypesArray(@Root() authorization_: Authorization_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
8579
8611
|
this.CheckUserReadPermissions('Audit Log Types', userPayload);
|
|
8580
|
-
const sSQL = `SELECT * FROM [
|
|
8612
|
+
const sSQL = `SELECT * FROM [__mj].[vwAuditLogTypes] WHERE [AuthorizationName]=${authorization_.ID} ` + this.getRowLevelSecurityWhereClause('Audit Log Types', userPayload, EntityPermissionType.Read, 'AND');
|
|
8581
8613
|
const result = this.ArrayMapFieldNamesToCodeNames('Audit Log Types', await dataSource.query(sSQL));
|
|
8582
8614
|
return result;
|
|
8583
8615
|
}
|
|
8584
8616
|
|
|
8585
|
-
@FieldResolver(() => [AuditLog_])
|
|
8617
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.AuditLog_])
|
|
8586
8618
|
async AuditLogsArray(@Root() authorization_: Authorization_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
8587
8619
|
this.CheckUserReadPermissions('Audit Logs', userPayload);
|
|
8588
|
-
const sSQL = `SELECT * FROM [
|
|
8620
|
+
const sSQL = `SELECT * FROM [__mj].[vwAuditLogs] WHERE [AuthorizationName]=${authorization_.ID} ` + this.getRowLevelSecurityWhereClause('Audit Logs', userPayload, EntityPermissionType.Read, 'AND');
|
|
8589
8621
|
const result = this.ArrayMapFieldNamesToCodeNames('Audit Logs', await dataSource.query(sSQL));
|
|
8590
8622
|
return result;
|
|
8591
8623
|
}
|
|
@@ -8666,9 +8698,9 @@ export class AuthorizationRoleResolver extends ResolverBase {
|
|
|
8666
8698
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
8667
8699
|
}
|
|
8668
8700
|
@Query(() => AuthorizationRole_, { nullable: true })
|
|
8669
|
-
async AuthorizationRole(@Arg('ID', () => Int) ID:
|
|
8701
|
+
async AuthorizationRole(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<AuthorizationRole_ | null> {
|
|
8670
8702
|
this.CheckUserReadPermissions('Authorization Roles', userPayload);
|
|
8671
|
-
const sSQL = `SELECT * FROM [
|
|
8703
|
+
const sSQL = `SELECT * FROM [__mj].[vwAuthorizationRoles] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Authorization Roles', userPayload, EntityPermissionType.Read, 'AND');
|
|
8672
8704
|
const result = this.MapFieldNamesToCodeNames('Authorization Roles', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
8673
8705
|
return result;
|
|
8674
8706
|
}
|
|
@@ -8676,7 +8708,7 @@ export class AuthorizationRoleResolver extends ResolverBase {
|
|
|
8676
8708
|
@Query(() => [AuthorizationRole_])
|
|
8677
8709
|
async AllAuthorizationRoles(@Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
8678
8710
|
this.CheckUserReadPermissions('Authorization Roles', userPayload);
|
|
8679
|
-
const sSQL = 'SELECT * FROM [
|
|
8711
|
+
const sSQL = 'SELECT * FROM [__mj].[vwAuthorizationRoles]' + this.getRowLevelSecurityWhereClause('Authorization Roles', userPayload, EntityPermissionType.Read, ' WHERE');
|
|
8680
8712
|
const result = this.ArrayMapFieldNamesToCodeNames('Authorization Roles', await dataSource.query(sSQL));
|
|
8681
8713
|
return result;
|
|
8682
8714
|
}
|
|
@@ -8717,11 +8749,11 @@ export class AuditLogType_ {
|
|
|
8717
8749
|
@MaxLength(100)
|
|
8718
8750
|
Parent?: string;
|
|
8719
8751
|
|
|
8720
|
-
@Field(() => [AuditLog_])
|
|
8721
|
-
AuditLogsArray: AuditLog_[]; // Link to AuditLogs
|
|
8752
|
+
@Field(() => [mj_core_schema_server_object_types.AuditLog_])
|
|
8753
|
+
AuditLogsArray: mj_core_schema_server_object_types.AuditLog_[]; // Link to AuditLogs
|
|
8722
8754
|
|
|
8723
|
-
@Field(() => [AuditLogType_])
|
|
8724
|
-
AuditLogTypesArray: AuditLogType_[]; // Link to AuditLogTypes
|
|
8755
|
+
@Field(() => [mj_core_schema_server_object_types.AuditLogType_])
|
|
8756
|
+
AuditLogTypesArray: mj_core_schema_server_object_types.AuditLogType_[]; // Link to AuditLogTypes
|
|
8725
8757
|
|
|
8726
8758
|
}
|
|
8727
8759
|
//****************************************************************************
|
|
@@ -8769,9 +8801,9 @@ export class AuditLogTypeResolver extends ResolverBase {
|
|
|
8769
8801
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
8770
8802
|
}
|
|
8771
8803
|
@Query(() => AuditLogType_, { nullable: true })
|
|
8772
|
-
async AuditLogType(@Arg('ID', () => Int) ID:
|
|
8804
|
+
async AuditLogType(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<AuditLogType_ | null> {
|
|
8773
8805
|
this.CheckUserReadPermissions('Audit Log Types', userPayload);
|
|
8774
|
-
const sSQL = `SELECT * FROM [
|
|
8806
|
+
const sSQL = `SELECT * FROM [__mj].[vwAuditLogTypes] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Audit Log Types', userPayload, EntityPermissionType.Read, 'AND');
|
|
8775
8807
|
const result = this.MapFieldNamesToCodeNames('Audit Log Types', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
8776
8808
|
return result;
|
|
8777
8809
|
}
|
|
@@ -8779,23 +8811,23 @@ export class AuditLogTypeResolver extends ResolverBase {
|
|
|
8779
8811
|
@Query(() => [AuditLogType_])
|
|
8780
8812
|
async AllAuditLogTypes(@Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
8781
8813
|
this.CheckUserReadPermissions('Audit Log Types', userPayload);
|
|
8782
|
-
const sSQL = 'SELECT * FROM [
|
|
8814
|
+
const sSQL = 'SELECT * FROM [__mj].[vwAuditLogTypes]' + this.getRowLevelSecurityWhereClause('Audit Log Types', userPayload, EntityPermissionType.Read, ' WHERE');
|
|
8783
8815
|
const result = this.ArrayMapFieldNamesToCodeNames('Audit Log Types', await dataSource.query(sSQL));
|
|
8784
8816
|
return result;
|
|
8785
8817
|
}
|
|
8786
8818
|
|
|
8787
|
-
@FieldResolver(() => [AuditLog_])
|
|
8819
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.AuditLog_])
|
|
8788
8820
|
async AuditLogsArray(@Root() auditlogtype_: AuditLogType_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
8789
8821
|
this.CheckUserReadPermissions('Audit Logs', userPayload);
|
|
8790
|
-
const sSQL = `SELECT * FROM [
|
|
8822
|
+
const sSQL = `SELECT * FROM [__mj].[vwAuditLogs] WHERE [AuditLogTypeName]=${auditlogtype_.ID} ` + this.getRowLevelSecurityWhereClause('Audit Logs', userPayload, EntityPermissionType.Read, 'AND');
|
|
8791
8823
|
const result = this.ArrayMapFieldNamesToCodeNames('Audit Logs', await dataSource.query(sSQL));
|
|
8792
8824
|
return result;
|
|
8793
8825
|
}
|
|
8794
8826
|
|
|
8795
|
-
@FieldResolver(() => [AuditLogType_])
|
|
8827
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.AuditLogType_])
|
|
8796
8828
|
async AuditLogTypesArray(@Root() auditlogtype_: AuditLogType_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
8797
8829
|
this.CheckUserReadPermissions('Audit Log Types', userPayload);
|
|
8798
|
-
const sSQL = `SELECT * FROM [
|
|
8830
|
+
const sSQL = `SELECT * FROM [__mj].[vwAuditLogTypes] WHERE [ParentID]=${auditlogtype_.ID} ` + this.getRowLevelSecurityWhereClause('Audit Log Types', userPayload, EntityPermissionType.Read, 'AND');
|
|
8799
8831
|
const result = this.ArrayMapFieldNamesToCodeNames('Audit Log Types', await dataSource.query(sSQL));
|
|
8800
8832
|
return result;
|
|
8801
8833
|
}
|
|
@@ -8889,9 +8921,9 @@ export class EntityFieldValueResolver extends ResolverBase {
|
|
|
8889
8921
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
8890
8922
|
}
|
|
8891
8923
|
@Query(() => EntityFieldValue_, { nullable: true })
|
|
8892
|
-
async EntityFieldValue(@Arg('ID', () => Int) ID:
|
|
8924
|
+
async EntityFieldValue(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<EntityFieldValue_ | null> {
|
|
8893
8925
|
this.CheckUserReadPermissions('Entity Field Values', userPayload);
|
|
8894
|
-
const sSQL = `SELECT * FROM [
|
|
8926
|
+
const sSQL = `SELECT * FROM [__mj].[vwEntityFieldValues] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Entity Field Values', userPayload, EntityPermissionType.Read, 'AND');
|
|
8895
8927
|
const result = this.MapFieldNamesToCodeNames('Entity Field Values', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
8896
8928
|
return result;
|
|
8897
8929
|
}
|
|
@@ -8899,7 +8931,7 @@ export class EntityFieldValueResolver extends ResolverBase {
|
|
|
8899
8931
|
@Query(() => [EntityFieldValue_])
|
|
8900
8932
|
async AllEntityFieldValues(@Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
8901
8933
|
this.CheckUserReadPermissions('Entity Field Values', userPayload);
|
|
8902
|
-
const sSQL = 'SELECT * FROM [
|
|
8934
|
+
const sSQL = 'SELECT * FROM [__mj].[vwEntityFieldValues]' + this.getRowLevelSecurityWhereClause('Entity Field Values', userPayload, EntityPermissionType.Read, ' WHERE');
|
|
8903
8935
|
const result = this.ArrayMapFieldNamesToCodeNames('Entity Field Values', await dataSource.query(sSQL));
|
|
8904
8936
|
return result;
|
|
8905
8937
|
}
|
|
@@ -8947,17 +8979,17 @@ export class AIModel_ {
|
|
|
8947
8979
|
@MaxLength(8)
|
|
8948
8980
|
UpdatedAt: Date;
|
|
8949
8981
|
|
|
8950
|
-
@Field(() => [AIAction_])
|
|
8951
|
-
AIActionsArray: AIAction_[]; // Link to AIActions
|
|
8982
|
+
@Field(() => [mj_core_schema_server_object_types.AIAction_])
|
|
8983
|
+
AIActionsArray: mj_core_schema_server_object_types.AIAction_[]; // Link to AIActions
|
|
8952
8984
|
|
|
8953
|
-
@Field(() => [AIModelAction_])
|
|
8954
|
-
AIModelActionsArray: AIModelAction_[]; // Link to AIModelActions
|
|
8985
|
+
@Field(() => [mj_core_schema_server_object_types.AIModelAction_])
|
|
8986
|
+
AIModelActionsArray: mj_core_schema_server_object_types.AIModelAction_[]; // Link to AIModelActions
|
|
8955
8987
|
|
|
8956
|
-
@Field(() => [EntityAIAction_])
|
|
8957
|
-
EntityAIActionsArray: EntityAIAction_[]; // Link to EntityAIActions
|
|
8988
|
+
@Field(() => [mj_core_schema_server_object_types.EntityAIAction_])
|
|
8989
|
+
EntityAIActionsArray: mj_core_schema_server_object_types.EntityAIAction_[]; // Link to EntityAIActions
|
|
8958
8990
|
|
|
8959
|
-
@Field(() => [VectorIndex_])
|
|
8960
|
-
VectorIndexesArray: VectorIndex_[]; // Link to VectorIndexes
|
|
8991
|
+
@Field(() => [mj_core_schema_server_object_types.VectorIndex_])
|
|
8992
|
+
VectorIndexesArray: mj_core_schema_server_object_types.VectorIndex_[]; // Link to VectorIndexes
|
|
8961
8993
|
|
|
8962
8994
|
}
|
|
8963
8995
|
|
|
@@ -9036,9 +9068,9 @@ export class AIModelResolver extends ResolverBase {
|
|
|
9036
9068
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
9037
9069
|
}
|
|
9038
9070
|
@Query(() => AIModel_, { nullable: true })
|
|
9039
|
-
async AIModel(@Arg('ID', () => Int) ID:
|
|
9071
|
+
async AIModel(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<AIModel_ | null> {
|
|
9040
9072
|
this.CheckUserReadPermissions('AI Models', userPayload);
|
|
9041
|
-
const sSQL = `SELECT * FROM [
|
|
9073
|
+
const sSQL = `SELECT * FROM [__mj].[vwAIModels] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('AI Models', userPayload, EntityPermissionType.Read, 'AND');
|
|
9042
9074
|
const result = this.MapFieldNamesToCodeNames('AI Models', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
9043
9075
|
return result;
|
|
9044
9076
|
}
|
|
@@ -9046,39 +9078,39 @@ export class AIModelResolver extends ResolverBase {
|
|
|
9046
9078
|
@Query(() => [AIModel_])
|
|
9047
9079
|
async AllAIModels(@Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
9048
9080
|
this.CheckUserReadPermissions('AI Models', userPayload);
|
|
9049
|
-
const sSQL = 'SELECT * FROM [
|
|
9081
|
+
const sSQL = 'SELECT * FROM [__mj].[vwAIModels]' + this.getRowLevelSecurityWhereClause('AI Models', userPayload, EntityPermissionType.Read, ' WHERE');
|
|
9050
9082
|
const result = this.ArrayMapFieldNamesToCodeNames('AI Models', await dataSource.query(sSQL));
|
|
9051
9083
|
return result;
|
|
9052
9084
|
}
|
|
9053
9085
|
|
|
9054
|
-
@FieldResolver(() => [AIAction_])
|
|
9086
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.AIAction_])
|
|
9055
9087
|
async AIActionsArray(@Root() aimodel_: AIModel_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
9056
9088
|
this.CheckUserReadPermissions('AI Actions', userPayload);
|
|
9057
|
-
const sSQL = `SELECT * FROM [
|
|
9089
|
+
const sSQL = `SELECT * FROM [__mj].[vwAIActions] WHERE [DefaultModelID]=${aimodel_.ID} ` + this.getRowLevelSecurityWhereClause('AI Actions', userPayload, EntityPermissionType.Read, 'AND');
|
|
9058
9090
|
const result = this.ArrayMapFieldNamesToCodeNames('AI Actions', await dataSource.query(sSQL));
|
|
9059
9091
|
return result;
|
|
9060
9092
|
}
|
|
9061
9093
|
|
|
9062
|
-
@FieldResolver(() => [AIModelAction_])
|
|
9094
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.AIModelAction_])
|
|
9063
9095
|
async AIModelActionsArray(@Root() aimodel_: AIModel_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
9064
9096
|
this.CheckUserReadPermissions('AI Model Actions', userPayload);
|
|
9065
|
-
const sSQL = `SELECT * FROM [
|
|
9097
|
+
const sSQL = `SELECT * FROM [__mj].[vwAIModelActions] WHERE [AIModelID]=${aimodel_.ID} ` + this.getRowLevelSecurityWhereClause('AI Model Actions', userPayload, EntityPermissionType.Read, 'AND');
|
|
9066
9098
|
const result = this.ArrayMapFieldNamesToCodeNames('AI Model Actions', await dataSource.query(sSQL));
|
|
9067
9099
|
return result;
|
|
9068
9100
|
}
|
|
9069
9101
|
|
|
9070
|
-
@FieldResolver(() => [EntityAIAction_])
|
|
9102
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.EntityAIAction_])
|
|
9071
9103
|
async EntityAIActionsArray(@Root() aimodel_: AIModel_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
9072
9104
|
this.CheckUserReadPermissions('Entity AI Actions', userPayload);
|
|
9073
|
-
const sSQL = `SELECT * FROM [
|
|
9105
|
+
const sSQL = `SELECT * FROM [__mj].[vwEntityAIActions] WHERE [AIModelID]=${aimodel_.ID} ` + this.getRowLevelSecurityWhereClause('Entity AI Actions', userPayload, EntityPermissionType.Read, 'AND');
|
|
9074
9106
|
const result = this.ArrayMapFieldNamesToCodeNames('Entity AI Actions', await dataSource.query(sSQL));
|
|
9075
9107
|
return result;
|
|
9076
9108
|
}
|
|
9077
9109
|
|
|
9078
|
-
@FieldResolver(() => [VectorIndex_])
|
|
9110
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.VectorIndex_])
|
|
9079
9111
|
async VectorIndexesArray(@Root() aimodel_: AIModel_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
9080
9112
|
this.CheckUserReadPermissions('Vector Indexes', userPayload);
|
|
9081
|
-
const sSQL = `SELECT * FROM [
|
|
9113
|
+
const sSQL = `SELECT * FROM [__mj].[vwVectorIndexes] WHERE [EmbeddingModelID]=${aimodel_.ID} ` + this.getRowLevelSecurityWhereClause('Vector Indexes', userPayload, EntityPermissionType.Read, 'AND');
|
|
9082
9114
|
const result = this.ArrayMapFieldNamesToCodeNames('Vector Indexes', await dataSource.query(sSQL));
|
|
9083
9115
|
return result;
|
|
9084
9116
|
}
|
|
@@ -9152,11 +9184,11 @@ export class AIAction_ {
|
|
|
9152
9184
|
@MaxLength(100)
|
|
9153
9185
|
DefaultModel?: string;
|
|
9154
9186
|
|
|
9155
|
-
@Field(() => [AIModelAction_])
|
|
9156
|
-
AIModelActionsArray: AIModelAction_[]; // Link to AIModelActions
|
|
9187
|
+
@Field(() => [mj_core_schema_server_object_types.AIModelAction_])
|
|
9188
|
+
AIModelActionsArray: mj_core_schema_server_object_types.AIModelAction_[]; // Link to AIModelActions
|
|
9157
9189
|
|
|
9158
|
-
@Field(() => [EntityAIAction_])
|
|
9159
|
-
EntityAIActionsArray: EntityAIAction_[]; // Link to EntityAIActions
|
|
9190
|
+
@Field(() => [mj_core_schema_server_object_types.EntityAIAction_])
|
|
9191
|
+
EntityAIActionsArray: mj_core_schema_server_object_types.EntityAIAction_[]; // Link to EntityAIActions
|
|
9160
9192
|
|
|
9161
9193
|
}
|
|
9162
9194
|
|
|
@@ -9229,9 +9261,9 @@ export class AIActionResolver extends ResolverBase {
|
|
|
9229
9261
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
9230
9262
|
}
|
|
9231
9263
|
@Query(() => AIAction_, { nullable: true })
|
|
9232
|
-
async AIAction(@Arg('ID', () => Int) ID:
|
|
9264
|
+
async AIAction(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<AIAction_ | null> {
|
|
9233
9265
|
this.CheckUserReadPermissions('AI Actions', userPayload);
|
|
9234
|
-
const sSQL = `SELECT * FROM [
|
|
9266
|
+
const sSQL = `SELECT * FROM [__mj].[vwAIActions] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('AI Actions', userPayload, EntityPermissionType.Read, 'AND');
|
|
9235
9267
|
const result = this.MapFieldNamesToCodeNames('AI Actions', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
9236
9268
|
return result;
|
|
9237
9269
|
}
|
|
@@ -9239,23 +9271,23 @@ export class AIActionResolver extends ResolverBase {
|
|
|
9239
9271
|
@Query(() => [AIAction_])
|
|
9240
9272
|
async AllAIActions(@Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
9241
9273
|
this.CheckUserReadPermissions('AI Actions', userPayload);
|
|
9242
|
-
const sSQL = 'SELECT * FROM [
|
|
9274
|
+
const sSQL = 'SELECT * FROM [__mj].[vwAIActions]' + this.getRowLevelSecurityWhereClause('AI Actions', userPayload, EntityPermissionType.Read, ' WHERE');
|
|
9243
9275
|
const result = this.ArrayMapFieldNamesToCodeNames('AI Actions', await dataSource.query(sSQL));
|
|
9244
9276
|
return result;
|
|
9245
9277
|
}
|
|
9246
9278
|
|
|
9247
|
-
@FieldResolver(() => [AIModelAction_])
|
|
9279
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.AIModelAction_])
|
|
9248
9280
|
async AIModelActionsArray(@Root() aiaction_: AIAction_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
9249
9281
|
this.CheckUserReadPermissions('AI Model Actions', userPayload);
|
|
9250
|
-
const sSQL = `SELECT * FROM [
|
|
9282
|
+
const sSQL = `SELECT * FROM [__mj].[vwAIModelActions] WHERE [AIActionID]=${aiaction_.ID} ` + this.getRowLevelSecurityWhereClause('AI Model Actions', userPayload, EntityPermissionType.Read, 'AND');
|
|
9251
9283
|
const result = this.ArrayMapFieldNamesToCodeNames('AI Model Actions', await dataSource.query(sSQL));
|
|
9252
9284
|
return result;
|
|
9253
9285
|
}
|
|
9254
9286
|
|
|
9255
|
-
@FieldResolver(() => [EntityAIAction_])
|
|
9287
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.EntityAIAction_])
|
|
9256
9288
|
async EntityAIActionsArray(@Root() aiaction_: AIAction_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
9257
9289
|
this.CheckUserReadPermissions('Entity AI Actions', userPayload);
|
|
9258
|
-
const sSQL = `SELECT * FROM [
|
|
9290
|
+
const sSQL = `SELECT * FROM [__mj].[vwEntityAIActions] WHERE [AIActionID]=${aiaction_.ID} ` + this.getRowLevelSecurityWhereClause('Entity AI Actions', userPayload, EntityPermissionType.Read, 'AND');
|
|
9259
9291
|
const result = this.ArrayMapFieldNamesToCodeNames('Entity AI Actions', await dataSource.query(sSQL));
|
|
9260
9292
|
return result;
|
|
9261
9293
|
}
|
|
@@ -9391,9 +9423,9 @@ export class AIModelActionResolver extends ResolverBase {
|
|
|
9391
9423
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
9392
9424
|
}
|
|
9393
9425
|
@Query(() => AIModelAction_, { nullable: true })
|
|
9394
|
-
async AIModelAction(@Arg('ID', () => Int) ID:
|
|
9426
|
+
async AIModelAction(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<AIModelAction_ | null> {
|
|
9395
9427
|
this.CheckUserReadPermissions('AI Model Actions', userPayload);
|
|
9396
|
-
const sSQL = `SELECT * FROM [
|
|
9428
|
+
const sSQL = `SELECT * FROM [__mj].[vwAIModelActions] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('AI Model Actions', userPayload, EntityPermissionType.Read, 'AND');
|
|
9397
9429
|
const result = this.MapFieldNamesToCodeNames('AI Model Actions', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
9398
9430
|
return result;
|
|
9399
9431
|
}
|
|
@@ -9401,7 +9433,7 @@ export class AIModelActionResolver extends ResolverBase {
|
|
|
9401
9433
|
@Query(() => [AIModelAction_])
|
|
9402
9434
|
async AllAIModelActions(@Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
9403
9435
|
this.CheckUserReadPermissions('AI Model Actions', userPayload);
|
|
9404
|
-
const sSQL = 'SELECT * FROM [
|
|
9436
|
+
const sSQL = 'SELECT * FROM [__mj].[vwAIModelActions]' + this.getRowLevelSecurityWhereClause('AI Model Actions', userPayload, EntityPermissionType.Read, ' WHERE');
|
|
9405
9437
|
const result = this.ArrayMapFieldNamesToCodeNames('AI Model Actions', await dataSource.query(sSQL));
|
|
9406
9438
|
return result;
|
|
9407
9439
|
}
|
|
@@ -9595,9 +9627,9 @@ export class EntityAIActionResolver extends ResolverBase {
|
|
|
9595
9627
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
9596
9628
|
}
|
|
9597
9629
|
@Query(() => EntityAIAction_, { nullable: true })
|
|
9598
|
-
async EntityAIAction(@Arg('ID', () => Int) ID:
|
|
9630
|
+
async EntityAIAction(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<EntityAIAction_ | null> {
|
|
9599
9631
|
this.CheckUserReadPermissions('Entity AI Actions', userPayload);
|
|
9600
|
-
const sSQL = `SELECT * FROM [
|
|
9632
|
+
const sSQL = `SELECT * FROM [__mj].[vwEntityAIActions] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Entity AI Actions', userPayload, EntityPermissionType.Read, 'AND');
|
|
9601
9633
|
const result = this.MapFieldNamesToCodeNames('Entity AI Actions', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
9602
9634
|
return result;
|
|
9603
9635
|
}
|
|
@@ -9605,7 +9637,7 @@ export class EntityAIActionResolver extends ResolverBase {
|
|
|
9605
9637
|
@Query(() => [EntityAIAction_])
|
|
9606
9638
|
async AllEntityAIActions(@Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
9607
9639
|
this.CheckUserReadPermissions('Entity AI Actions', userPayload);
|
|
9608
|
-
const sSQL = 'SELECT * FROM [
|
|
9640
|
+
const sSQL = 'SELECT * FROM [__mj].[vwEntityAIActions]' + this.getRowLevelSecurityWhereClause('Entity AI Actions', userPayload, EntityPermissionType.Read, ' WHERE');
|
|
9609
9641
|
const result = this.ArrayMapFieldNamesToCodeNames('Entity AI Actions', await dataSource.query(sSQL));
|
|
9610
9642
|
return result;
|
|
9611
9643
|
}
|
|
@@ -9658,8 +9690,8 @@ export class AIModelType_ {
|
|
|
9658
9690
|
@Field({nullable: true})
|
|
9659
9691
|
Description?: string;
|
|
9660
9692
|
|
|
9661
|
-
@Field(() => [AIModel_])
|
|
9662
|
-
AIModelsArray: AIModel_[]; // Link to AIModels
|
|
9693
|
+
@Field(() => [mj_core_schema_server_object_types.AIModel_])
|
|
9694
|
+
AIModelsArray: mj_core_schema_server_object_types.AIModel_[]; // Link to AIModels
|
|
9663
9695
|
|
|
9664
9696
|
}
|
|
9665
9697
|
|
|
@@ -9723,9 +9755,9 @@ export class AIModelTypeResolver extends ResolverBase {
|
|
|
9723
9755
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
9724
9756
|
}
|
|
9725
9757
|
@Query(() => AIModelType_, { nullable: true })
|
|
9726
|
-
async AIModelType(@Arg('ID', () => Int) ID:
|
|
9758
|
+
async AIModelType(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<AIModelType_ | null> {
|
|
9727
9759
|
this.CheckUserReadPermissions('AI Model Types', userPayload);
|
|
9728
|
-
const sSQL = `SELECT * FROM [
|
|
9760
|
+
const sSQL = `SELECT * FROM [__mj].[vwAIModelTypes] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('AI Model Types', userPayload, EntityPermissionType.Read, 'AND');
|
|
9729
9761
|
const result = this.MapFieldNamesToCodeNames('AI Model Types', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
9730
9762
|
return result;
|
|
9731
9763
|
}
|
|
@@ -9733,15 +9765,15 @@ export class AIModelTypeResolver extends ResolverBase {
|
|
|
9733
9765
|
@Query(() => [AIModelType_])
|
|
9734
9766
|
async AllAIModelTypes(@Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
9735
9767
|
this.CheckUserReadPermissions('AI Model Types', userPayload);
|
|
9736
|
-
const sSQL = 'SELECT * FROM [
|
|
9768
|
+
const sSQL = 'SELECT * FROM [__mj].[vwAIModelTypes]' + this.getRowLevelSecurityWhereClause('AI Model Types', userPayload, EntityPermissionType.Read, ' WHERE');
|
|
9737
9769
|
const result = this.ArrayMapFieldNamesToCodeNames('AI Model Types', await dataSource.query(sSQL));
|
|
9738
9770
|
return result;
|
|
9739
9771
|
}
|
|
9740
9772
|
|
|
9741
|
-
@FieldResolver(() => [AIModel_])
|
|
9773
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.AIModel_])
|
|
9742
9774
|
async AIModelsArray(@Root() aimodeltype_: AIModelType_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
9743
9775
|
this.CheckUserReadPermissions('AI Models', userPayload);
|
|
9744
|
-
const sSQL = `SELECT * FROM [
|
|
9776
|
+
const sSQL = `SELECT * FROM [__mj].[vwAIModels] WHERE [AIModelTypeID]=${aimodeltype_.ID} ` + this.getRowLevelSecurityWhereClause('AI Models', userPayload, EntityPermissionType.Read, 'AND');
|
|
9745
9777
|
const result = this.ArrayMapFieldNamesToCodeNames('AI Models', await dataSource.query(sSQL));
|
|
9746
9778
|
return result;
|
|
9747
9779
|
}
|
|
@@ -9805,8 +9837,8 @@ export class QueueType_ {
|
|
|
9805
9837
|
@Field(() => Boolean)
|
|
9806
9838
|
IsActive: boolean;
|
|
9807
9839
|
|
|
9808
|
-
@Field(() => [Queue_])
|
|
9809
|
-
QueuesArray: Queue_[]; // Link to Queues
|
|
9840
|
+
@Field(() => [mj_core_schema_server_object_types.Queue_])
|
|
9841
|
+
QueuesArray: mj_core_schema_server_object_types.Queue_[]; // Link to Queues
|
|
9810
9842
|
|
|
9811
9843
|
}
|
|
9812
9844
|
//****************************************************************************
|
|
@@ -9854,17 +9886,17 @@ export class QueueTypeResolver extends ResolverBase {
|
|
|
9854
9886
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
9855
9887
|
}
|
|
9856
9888
|
@Query(() => QueueType_, { nullable: true })
|
|
9857
|
-
async QueueType(@Arg('ID', () => Int) ID:
|
|
9889
|
+
async QueueType(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<QueueType_ | null> {
|
|
9858
9890
|
this.CheckUserReadPermissions('Queue Types', userPayload);
|
|
9859
|
-
const sSQL = `SELECT * FROM [
|
|
9891
|
+
const sSQL = `SELECT * FROM [__mj].[vwQueueTypes] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Queue Types', userPayload, EntityPermissionType.Read, 'AND');
|
|
9860
9892
|
const result = this.MapFieldNamesToCodeNames('Queue Types', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
9861
9893
|
return result;
|
|
9862
9894
|
}
|
|
9863
9895
|
|
|
9864
|
-
@FieldResolver(() => [Queue_])
|
|
9896
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.Queue_])
|
|
9865
9897
|
async QueuesArray(@Root() queuetype_: QueueType_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
9866
9898
|
this.CheckUserReadPermissions('Queues', userPayload);
|
|
9867
|
-
const sSQL = `SELECT * FROM [
|
|
9899
|
+
const sSQL = `SELECT * FROM [__mj].[vwQueues] WHERE [QueueTypeID]=${queuetype_.ID} ` + this.getRowLevelSecurityWhereClause('Queues', userPayload, EntityPermissionType.Read, 'AND');
|
|
9868
9900
|
const result = this.ArrayMapFieldNamesToCodeNames('Queues', await dataSource.query(sSQL));
|
|
9869
9901
|
return result;
|
|
9870
9902
|
}
|
|
@@ -9951,8 +9983,8 @@ export class Queue_ {
|
|
|
9951
9983
|
@MaxLength(100)
|
|
9952
9984
|
QueueType: string;
|
|
9953
9985
|
|
|
9954
|
-
@Field(() => [QueueTask_])
|
|
9955
|
-
QueueTasksArray: QueueTask_[]; // Link to QueueTasks
|
|
9986
|
+
@Field(() => [mj_core_schema_server_object_types.QueueTask_])
|
|
9987
|
+
QueueTasksArray: mj_core_schema_server_object_types.QueueTask_[]; // Link to QueueTasks
|
|
9956
9988
|
|
|
9957
9989
|
}
|
|
9958
9990
|
|
|
@@ -10113,17 +10145,17 @@ export class QueueResolver extends ResolverBase {
|
|
|
10113
10145
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
10114
10146
|
}
|
|
10115
10147
|
@Query(() => Queue_, { nullable: true })
|
|
10116
|
-
async Queue(@Arg('ID', () => Int) ID:
|
|
10148
|
+
async Queue(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<Queue_ | null> {
|
|
10117
10149
|
this.CheckUserReadPermissions('Queues', userPayload);
|
|
10118
|
-
const sSQL = `SELECT * FROM [
|
|
10150
|
+
const sSQL = `SELECT * FROM [__mj].[vwQueues] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Queues', userPayload, EntityPermissionType.Read, 'AND');
|
|
10119
10151
|
const result = this.MapFieldNamesToCodeNames('Queues', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
10120
10152
|
return result;
|
|
10121
10153
|
}
|
|
10122
10154
|
|
|
10123
|
-
@FieldResolver(() => [QueueTask_])
|
|
10155
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.QueueTask_])
|
|
10124
10156
|
async QueueTasksArray(@Root() queue_: Queue_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
10125
10157
|
this.CheckUserReadPermissions('Queue Tasks', userPayload);
|
|
10126
|
-
const sSQL = `SELECT * FROM [
|
|
10158
|
+
const sSQL = `SELECT * FROM [__mj].[vwQueueTasks] WHERE [QueueID]=${queue_.ID} ` + this.getRowLevelSecurityWhereClause('Queue Tasks', userPayload, EntityPermissionType.Read, 'AND');
|
|
10127
10159
|
const result = this.ArrayMapFieldNamesToCodeNames('Queue Tasks', await dataSource.query(sSQL));
|
|
10128
10160
|
return result;
|
|
10129
10161
|
}
|
|
@@ -10346,9 +10378,9 @@ export class QueueTaskResolver extends ResolverBase {
|
|
|
10346
10378
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
10347
10379
|
}
|
|
10348
10380
|
@Query(() => QueueTask_, { nullable: true })
|
|
10349
|
-
async QueueTask(@Arg('ID', () => Int) ID:
|
|
10381
|
+
async QueueTask(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<QueueTask_ | null> {
|
|
10350
10382
|
this.CheckUserReadPermissions('Queue Tasks', userPayload);
|
|
10351
|
-
const sSQL = `SELECT * FROM [
|
|
10383
|
+
const sSQL = `SELECT * FROM [__mj].[vwQueueTasks] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Queue Tasks', userPayload, EntityPermissionType.Read, 'AND');
|
|
10352
10384
|
const result = this.MapFieldNamesToCodeNames('Queue Tasks', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
10353
10385
|
return result;
|
|
10354
10386
|
}
|
|
@@ -10541,9 +10573,9 @@ export class DashboardResolver extends ResolverBase {
|
|
|
10541
10573
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
10542
10574
|
}
|
|
10543
10575
|
@Query(() => Dashboard_, { nullable: true })
|
|
10544
|
-
async Dashboard(@Arg('ID', () => Int) ID:
|
|
10576
|
+
async Dashboard(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<Dashboard_ | null> {
|
|
10545
10577
|
this.CheckUserReadPermissions('Dashboards', userPayload);
|
|
10546
|
-
const sSQL = `SELECT * FROM [
|
|
10578
|
+
const sSQL = `SELECT * FROM [__mj].[vwDashboards] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Dashboards', userPayload, EntityPermissionType.Read, 'AND');
|
|
10547
10579
|
this.createRecordAccessAuditLogRecord(userPayload, 'Dashboards', ID)
|
|
10548
10580
|
const result = this.MapFieldNamesToCodeNames('Dashboards', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
10549
10581
|
return result;
|
|
@@ -10611,7 +10643,7 @@ export class DashboardResolver extends ResolverBase {
|
|
|
10611
10643
|
}
|
|
10612
10644
|
|
|
10613
10645
|
@Mutation(() => Dashboard_)
|
|
10614
|
-
async DeleteDashboard(@Arg('ID', () => Int) ID:
|
|
10646
|
+
async DeleteDashboard(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
10615
10647
|
if (await this.BeforeDelete(dataSource, ID)) { // fire event and proceed if it wasn't cancelled
|
|
10616
10648
|
const entityObject = <DashboardEntity>await new Metadata().GetEntityObject('Dashboards', this.GetUserFromPayload(userPayload));
|
|
10617
10649
|
await entityObject.Load(ID);
|
|
@@ -10628,11 +10660,11 @@ export class DashboardResolver extends ResolverBase {
|
|
|
10628
10660
|
}
|
|
10629
10661
|
|
|
10630
10662
|
// Before/After UPDATE Event Hooks for Sub-Classes to Override
|
|
10631
|
-
protected async BeforeDelete(dataSource: DataSource, ID:
|
|
10663
|
+
protected async BeforeDelete(dataSource: DataSource, ID: number): Promise<boolean> {
|
|
10632
10664
|
const i = ID, d = dataSource; // prevent error;
|
|
10633
10665
|
return true;
|
|
10634
10666
|
}
|
|
10635
|
-
protected async AfterDelete(dataSource: DataSource, ID:
|
|
10667
|
+
protected async AfterDelete(dataSource: DataSource, ID: number) {
|
|
10636
10668
|
const i = ID, d = dataSource; // prevent error
|
|
10637
10669
|
}
|
|
10638
10670
|
|
|
@@ -10653,8 +10685,8 @@ export class OutputTriggerType_ {
|
|
|
10653
10685
|
@Field({nullable: true})
|
|
10654
10686
|
Description?: string;
|
|
10655
10687
|
|
|
10656
|
-
@Field(() => [Report_])
|
|
10657
|
-
ReportsArray: Report_[]; // Link to Reports
|
|
10688
|
+
@Field(() => [mj_core_schema_server_object_types.Report_])
|
|
10689
|
+
ReportsArray: mj_core_schema_server_object_types.Report_[]; // Link to Reports
|
|
10658
10690
|
|
|
10659
10691
|
}
|
|
10660
10692
|
//****************************************************************************
|
|
@@ -10702,18 +10734,18 @@ export class OutputTriggerTypeResolver extends ResolverBase {
|
|
|
10702
10734
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
10703
10735
|
}
|
|
10704
10736
|
@Query(() => OutputTriggerType_, { nullable: true })
|
|
10705
|
-
async OutputTriggerType(@Arg('ID', () => Int) ID:
|
|
10737
|
+
async OutputTriggerType(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<OutputTriggerType_ | null> {
|
|
10706
10738
|
this.CheckUserReadPermissions('Output Trigger Types', userPayload);
|
|
10707
|
-
const sSQL = `SELECT * FROM [
|
|
10739
|
+
const sSQL = `SELECT * FROM [__mj].[vwOutputTriggerTypes] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Output Trigger Types', userPayload, EntityPermissionType.Read, 'AND');
|
|
10708
10740
|
this.createRecordAccessAuditLogRecord(userPayload, 'Output Trigger Types', ID)
|
|
10709
10741
|
const result = this.MapFieldNamesToCodeNames('Output Trigger Types', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
10710
10742
|
return result;
|
|
10711
10743
|
}
|
|
10712
10744
|
|
|
10713
|
-
@FieldResolver(() => [Report_])
|
|
10745
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.Report_])
|
|
10714
10746
|
async ReportsArray(@Root() outputtriggertype_: OutputTriggerType_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
10715
10747
|
this.CheckUserReadPermissions('Reports', userPayload);
|
|
10716
|
-
const sSQL = `SELECT * FROM [
|
|
10748
|
+
const sSQL = `SELECT * FROM [__mj].[vwReports] WHERE [OutputTriggerTypeID]=${outputtriggertype_.ID} ` + this.getRowLevelSecurityWhereClause('Reports', userPayload, EntityPermissionType.Read, 'AND');
|
|
10717
10749
|
const result = this.ArrayMapFieldNamesToCodeNames('Reports', await dataSource.query(sSQL));
|
|
10718
10750
|
return result;
|
|
10719
10751
|
}
|
|
@@ -10738,8 +10770,8 @@ export class OutputFormatType_ {
|
|
|
10738
10770
|
@Field({nullable: true})
|
|
10739
10771
|
DisplayFormat?: string;
|
|
10740
10772
|
|
|
10741
|
-
@Field(() => [Report_])
|
|
10742
|
-
ReportsArray: Report_[]; // Link to Reports
|
|
10773
|
+
@Field(() => [mj_core_schema_server_object_types.Report_])
|
|
10774
|
+
ReportsArray: mj_core_schema_server_object_types.Report_[]; // Link to Reports
|
|
10743
10775
|
|
|
10744
10776
|
}
|
|
10745
10777
|
//****************************************************************************
|
|
@@ -10787,18 +10819,18 @@ export class OutputFormatTypeResolver extends ResolverBase {
|
|
|
10787
10819
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
10788
10820
|
}
|
|
10789
10821
|
@Query(() => OutputFormatType_, { nullable: true })
|
|
10790
|
-
async OutputFormatType(@Arg('ID', () => Int) ID:
|
|
10822
|
+
async OutputFormatType(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<OutputFormatType_ | null> {
|
|
10791
10823
|
this.CheckUserReadPermissions('Output Format Types', userPayload);
|
|
10792
|
-
const sSQL = `SELECT * FROM [
|
|
10824
|
+
const sSQL = `SELECT * FROM [__mj].[vwOutputFormatTypes] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Output Format Types', userPayload, EntityPermissionType.Read, 'AND');
|
|
10793
10825
|
this.createRecordAccessAuditLogRecord(userPayload, 'Output Format Types', ID)
|
|
10794
10826
|
const result = this.MapFieldNamesToCodeNames('Output Format Types', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
10795
10827
|
return result;
|
|
10796
10828
|
}
|
|
10797
10829
|
|
|
10798
|
-
@FieldResolver(() => [Report_])
|
|
10830
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.Report_])
|
|
10799
10831
|
async ReportsArray(@Root() outputformattype_: OutputFormatType_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
10800
10832
|
this.CheckUserReadPermissions('Reports', userPayload);
|
|
10801
|
-
const sSQL = `SELECT * FROM [
|
|
10833
|
+
const sSQL = `SELECT * FROM [__mj].[vwReports] WHERE [OutputFormatTypeID]=${outputformattype_.ID} ` + this.getRowLevelSecurityWhereClause('Reports', userPayload, EntityPermissionType.Read, 'AND');
|
|
10802
10834
|
const result = this.ArrayMapFieldNamesToCodeNames('Reports', await dataSource.query(sSQL));
|
|
10803
10835
|
return result;
|
|
10804
10836
|
}
|
|
@@ -10820,8 +10852,8 @@ export class OutputDeliveryType_ {
|
|
|
10820
10852
|
@Field({nullable: true})
|
|
10821
10853
|
Description?: string;
|
|
10822
10854
|
|
|
10823
|
-
@Field(() => [Report_])
|
|
10824
|
-
ReportsArray: Report_[]; // Link to Reports
|
|
10855
|
+
@Field(() => [mj_core_schema_server_object_types.Report_])
|
|
10856
|
+
ReportsArray: mj_core_schema_server_object_types.Report_[]; // Link to Reports
|
|
10825
10857
|
|
|
10826
10858
|
}
|
|
10827
10859
|
//****************************************************************************
|
|
@@ -10869,18 +10901,18 @@ export class OutputDeliveryTypeResolver extends ResolverBase {
|
|
|
10869
10901
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
10870
10902
|
}
|
|
10871
10903
|
@Query(() => OutputDeliveryType_, { nullable: true })
|
|
10872
|
-
async OutputDeliveryType(@Arg('ID', () => Int) ID:
|
|
10904
|
+
async OutputDeliveryType(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<OutputDeliveryType_ | null> {
|
|
10873
10905
|
this.CheckUserReadPermissions('Output Delivery Types', userPayload);
|
|
10874
|
-
const sSQL = `SELECT * FROM [
|
|
10906
|
+
const sSQL = `SELECT * FROM [__mj].[vwOutputDeliveryTypes] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Output Delivery Types', userPayload, EntityPermissionType.Read, 'AND');
|
|
10875
10907
|
this.createRecordAccessAuditLogRecord(userPayload, 'Output Delivery Types', ID)
|
|
10876
10908
|
const result = this.MapFieldNamesToCodeNames('Output Delivery Types', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
10877
10909
|
return result;
|
|
10878
10910
|
}
|
|
10879
10911
|
|
|
10880
|
-
@FieldResolver(() => [Report_])
|
|
10912
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.Report_])
|
|
10881
10913
|
async ReportsArray(@Root() outputdeliverytype_: OutputDeliveryType_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
10882
10914
|
this.CheckUserReadPermissions('Reports', userPayload);
|
|
10883
|
-
const sSQL = `SELECT * FROM [
|
|
10915
|
+
const sSQL = `SELECT * FROM [__mj].[vwReports] WHERE [OutputDeliveryTypeID]=${outputdeliverytype_.ID} ` + this.getRowLevelSecurityWhereClause('Reports', userPayload, EntityPermissionType.Read, 'AND');
|
|
10884
10916
|
const result = this.ArrayMapFieldNamesToCodeNames('Reports', await dataSource.query(sSQL));
|
|
10885
10917
|
return result;
|
|
10886
10918
|
}
|
|
@@ -10987,8 +11019,8 @@ export class Report_ {
|
|
|
10987
11019
|
@MaxLength(510)
|
|
10988
11020
|
OutputEvent?: string;
|
|
10989
11021
|
|
|
10990
|
-
@Field(() => [ReportSnapshot_])
|
|
10991
|
-
ReportSnapshotsArray: ReportSnapshot_[]; // Link to ReportSnapshots
|
|
11022
|
+
@Field(() => [mj_core_schema_server_object_types.ReportSnapshot_])
|
|
11023
|
+
ReportSnapshotsArray: mj_core_schema_server_object_types.ReportSnapshot_[]; // Link to ReportSnapshots
|
|
10992
11024
|
|
|
10993
11025
|
}
|
|
10994
11026
|
|
|
@@ -11149,17 +11181,17 @@ export class ReportResolver extends ResolverBase {
|
|
|
11149
11181
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
11150
11182
|
}
|
|
11151
11183
|
@Query(() => Report_, { nullable: true })
|
|
11152
|
-
async Report(@Arg('ID', () => Int) ID:
|
|
11184
|
+
async Report(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<Report_ | null> {
|
|
11153
11185
|
this.CheckUserReadPermissions('Reports', userPayload);
|
|
11154
|
-
const sSQL = `SELECT * FROM [
|
|
11186
|
+
const sSQL = `SELECT * FROM [__mj].[vwReports] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Reports', userPayload, EntityPermissionType.Read, 'AND');
|
|
11155
11187
|
const result = this.MapFieldNamesToCodeNames('Reports', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
11156
11188
|
return result;
|
|
11157
11189
|
}
|
|
11158
11190
|
|
|
11159
|
-
@FieldResolver(() => [ReportSnapshot_])
|
|
11191
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.ReportSnapshot_])
|
|
11160
11192
|
async ReportSnapshotsArray(@Root() report_: Report_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
11161
11193
|
this.CheckUserReadPermissions('Report Snapshots', userPayload);
|
|
11162
|
-
const sSQL = `SELECT * FROM [
|
|
11194
|
+
const sSQL = `SELECT * FROM [__mj].[vwReportSnapshots] WHERE [ReportID]=${report_.ID} ` + this.getRowLevelSecurityWhereClause('Report Snapshots', userPayload, EntityPermissionType.Read, 'AND');
|
|
11163
11195
|
const result = this.ArrayMapFieldNamesToCodeNames('Report Snapshots', await dataSource.query(sSQL));
|
|
11164
11196
|
return result;
|
|
11165
11197
|
}
|
|
@@ -11226,7 +11258,7 @@ export class ReportResolver extends ResolverBase {
|
|
|
11226
11258
|
}
|
|
11227
11259
|
|
|
11228
11260
|
@Mutation(() => Report_)
|
|
11229
|
-
async DeleteReport(@Arg('ID', () => Int) ID:
|
|
11261
|
+
async DeleteReport(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
11230
11262
|
if (await this.BeforeDelete(dataSource, ID)) { // fire event and proceed if it wasn't cancelled
|
|
11231
11263
|
const entityObject = <ReportEntity>await new Metadata().GetEntityObject('Reports', this.GetUserFromPayload(userPayload));
|
|
11232
11264
|
await entityObject.Load(ID);
|
|
@@ -11243,11 +11275,11 @@ export class ReportResolver extends ResolverBase {
|
|
|
11243
11275
|
}
|
|
11244
11276
|
|
|
11245
11277
|
// Before/After UPDATE Event Hooks for Sub-Classes to Override
|
|
11246
|
-
protected async BeforeDelete(dataSource: DataSource, ID:
|
|
11278
|
+
protected async BeforeDelete(dataSource: DataSource, ID: number): Promise<boolean> {
|
|
11247
11279
|
const i = ID, d = dataSource; // prevent error;
|
|
11248
11280
|
return true;
|
|
11249
11281
|
}
|
|
11250
|
-
protected async AfterDelete(dataSource: DataSource, ID:
|
|
11282
|
+
protected async AfterDelete(dataSource: DataSource, ID: number) {
|
|
11251
11283
|
const i = ID, d = dataSource; // prevent error
|
|
11252
11284
|
}
|
|
11253
11285
|
|
|
@@ -11363,9 +11395,9 @@ export class ReportSnapshotResolver extends ResolverBase {
|
|
|
11363
11395
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
11364
11396
|
}
|
|
11365
11397
|
@Query(() => ReportSnapshot_, { nullable: true })
|
|
11366
|
-
async ReportSnapshot(@Arg('ID', () => Int) ID:
|
|
11398
|
+
async ReportSnapshot(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<ReportSnapshot_ | null> {
|
|
11367
11399
|
this.CheckUserReadPermissions('Report Snapshots', userPayload);
|
|
11368
|
-
const sSQL = `SELECT * FROM [
|
|
11400
|
+
const sSQL = `SELECT * FROM [__mj].[vwReportSnapshots] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Report Snapshots', userPayload, EntityPermissionType.Read, 'AND');
|
|
11369
11401
|
const result = this.MapFieldNamesToCodeNames('Report Snapshots', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
11370
11402
|
return result;
|
|
11371
11403
|
}
|
|
@@ -11432,7 +11464,7 @@ export class ReportSnapshotResolver extends ResolverBase {
|
|
|
11432
11464
|
}
|
|
11433
11465
|
|
|
11434
11466
|
@Mutation(() => ReportSnapshot_)
|
|
11435
|
-
async DeleteReportSnapshot(@Arg('ID', () => Int) ID:
|
|
11467
|
+
async DeleteReportSnapshot(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
11436
11468
|
if (await this.BeforeDelete(dataSource, ID)) { // fire event and proceed if it wasn't cancelled
|
|
11437
11469
|
const entityObject = <ReportSnapshotEntity>await new Metadata().GetEntityObject('Report Snapshots', this.GetUserFromPayload(userPayload));
|
|
11438
11470
|
await entityObject.Load(ID);
|
|
@@ -11449,11 +11481,11 @@ export class ReportSnapshotResolver extends ResolverBase {
|
|
|
11449
11481
|
}
|
|
11450
11482
|
|
|
11451
11483
|
// Before/After UPDATE Event Hooks for Sub-Classes to Override
|
|
11452
|
-
protected async BeforeDelete(dataSource: DataSource, ID:
|
|
11484
|
+
protected async BeforeDelete(dataSource: DataSource, ID: number): Promise<boolean> {
|
|
11453
11485
|
const i = ID, d = dataSource; // prevent error;
|
|
11454
11486
|
return true;
|
|
11455
11487
|
}
|
|
11456
|
-
protected async AfterDelete(dataSource: DataSource, ID:
|
|
11488
|
+
protected async AfterDelete(dataSource: DataSource, ID: number) {
|
|
11457
11489
|
const i = ID, d = dataSource; // prevent error
|
|
11458
11490
|
}
|
|
11459
11491
|
|
|
@@ -11497,8 +11529,8 @@ export class ResourceType_ {
|
|
|
11497
11529
|
@MaxLength(510)
|
|
11498
11530
|
Entity?: string;
|
|
11499
11531
|
|
|
11500
|
-
@Field(() => [WorkspaceItem_])
|
|
11501
|
-
WorkspaceItemsArray: WorkspaceItem_[]; // Link to WorkspaceItems
|
|
11532
|
+
@Field(() => [mj_core_schema_server_object_types.WorkspaceItem_])
|
|
11533
|
+
WorkspaceItemsArray: mj_core_schema_server_object_types.WorkspaceItem_[]; // Link to WorkspaceItems
|
|
11502
11534
|
|
|
11503
11535
|
}
|
|
11504
11536
|
//****************************************************************************
|
|
@@ -11546,18 +11578,18 @@ export class ResourceTypeResolver extends ResolverBase {
|
|
|
11546
11578
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
11547
11579
|
}
|
|
11548
11580
|
@Query(() => ResourceType_, { nullable: true })
|
|
11549
|
-
async ResourceType(@Arg('ID', () => Int) ID:
|
|
11581
|
+
async ResourceType(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<ResourceType_ | null> {
|
|
11550
11582
|
this.CheckUserReadPermissions('Resource Types', userPayload);
|
|
11551
|
-
const sSQL = `SELECT * FROM [
|
|
11583
|
+
const sSQL = `SELECT * FROM [__mj].[vwResourceTypes] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Resource Types', userPayload, EntityPermissionType.Read, 'AND');
|
|
11552
11584
|
this.createRecordAccessAuditLogRecord(userPayload, 'Resource Types', ID)
|
|
11553
11585
|
const result = this.MapFieldNamesToCodeNames('Resource Types', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
11554
11586
|
return result;
|
|
11555
11587
|
}
|
|
11556
11588
|
|
|
11557
|
-
@FieldResolver(() => [WorkspaceItem_])
|
|
11589
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.WorkspaceItem_])
|
|
11558
11590
|
async WorkspaceItemsArray(@Root() resourcetype_: ResourceType_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
11559
11591
|
this.CheckUserReadPermissions('Workspace Items', userPayload);
|
|
11560
|
-
const sSQL = `SELECT * FROM [
|
|
11592
|
+
const sSQL = `SELECT * FROM [__mj].[vwWorkspaceItems] WHERE [ResourceTypeID]=${resourcetype_.ID} ` + this.getRowLevelSecurityWhereClause('Workspace Items', userPayload, EntityPermissionType.Read, 'AND');
|
|
11561
11593
|
const result = this.ArrayMapFieldNamesToCodeNames('Workspace Items', await dataSource.query(sSQL));
|
|
11562
11594
|
return result;
|
|
11563
11595
|
}
|
|
@@ -11590,11 +11622,11 @@ export class Tag_ {
|
|
|
11590
11622
|
@MaxLength(510)
|
|
11591
11623
|
Parent?: string;
|
|
11592
11624
|
|
|
11593
|
-
@Field(() => [Tag_])
|
|
11594
|
-
TagsArray: Tag_[]; // Link to Tags
|
|
11625
|
+
@Field(() => [mj_core_schema_server_object_types.Tag_])
|
|
11626
|
+
TagsArray: mj_core_schema_server_object_types.Tag_[]; // Link to Tags
|
|
11595
11627
|
|
|
11596
|
-
@Field(() => [TaggedItem_])
|
|
11597
|
-
TaggedItemsArray: TaggedItem_[]; // Link to TaggedItems
|
|
11628
|
+
@Field(() => [mj_core_schema_server_object_types.TaggedItem_])
|
|
11629
|
+
TaggedItemsArray: mj_core_schema_server_object_types.TaggedItem_[]; // Link to TaggedItems
|
|
11598
11630
|
|
|
11599
11631
|
}
|
|
11600
11632
|
//****************************************************************************
|
|
@@ -11642,26 +11674,26 @@ export class TagResolver extends ResolverBase {
|
|
|
11642
11674
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
11643
11675
|
}
|
|
11644
11676
|
@Query(() => Tag_, { nullable: true })
|
|
11645
|
-
async Tag(@Arg('ID', () => Int) ID:
|
|
11677
|
+
async Tag(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<Tag_ | null> {
|
|
11646
11678
|
this.CheckUserReadPermissions('Tags', userPayload);
|
|
11647
|
-
const sSQL = `SELECT * FROM [
|
|
11679
|
+
const sSQL = `SELECT * FROM [__mj].[vwTags] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Tags', userPayload, EntityPermissionType.Read, 'AND');
|
|
11648
11680
|
this.createRecordAccessAuditLogRecord(userPayload, 'Tags', ID)
|
|
11649
11681
|
const result = this.MapFieldNamesToCodeNames('Tags', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
11650
11682
|
return result;
|
|
11651
11683
|
}
|
|
11652
11684
|
|
|
11653
|
-
@FieldResolver(() => [Tag_])
|
|
11685
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.Tag_])
|
|
11654
11686
|
async TagsArray(@Root() tag_: Tag_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
11655
11687
|
this.CheckUserReadPermissions('Tags', userPayload);
|
|
11656
|
-
const sSQL = `SELECT * FROM [
|
|
11688
|
+
const sSQL = `SELECT * FROM [__mj].[vwTags] WHERE [ParentID]=${tag_.ID} ` + this.getRowLevelSecurityWhereClause('Tags', userPayload, EntityPermissionType.Read, 'AND');
|
|
11657
11689
|
const result = this.ArrayMapFieldNamesToCodeNames('Tags', await dataSource.query(sSQL));
|
|
11658
11690
|
return result;
|
|
11659
11691
|
}
|
|
11660
11692
|
|
|
11661
|
-
@FieldResolver(() => [TaggedItem_])
|
|
11693
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.TaggedItem_])
|
|
11662
11694
|
async TaggedItemsArray(@Root() tag_: Tag_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
11663
11695
|
this.CheckUserReadPermissions('Tagged Items', userPayload);
|
|
11664
|
-
const sSQL = `SELECT * FROM [
|
|
11696
|
+
const sSQL = `SELECT * FROM [__mj].[vwTaggedItems] WHERE [TagID]=${tag_.ID} ` + this.getRowLevelSecurityWhereClause('Tagged Items', userPayload, EntityPermissionType.Read, 'AND');
|
|
11665
11697
|
const result = this.ArrayMapFieldNamesToCodeNames('Tagged Items', await dataSource.query(sSQL));
|
|
11666
11698
|
return result;
|
|
11667
11699
|
}
|
|
@@ -11689,6 +11721,10 @@ export class TaggedItem_ {
|
|
|
11689
11721
|
@Field()
|
|
11690
11722
|
@MaxLength(510)
|
|
11691
11723
|
Tag: string;
|
|
11724
|
+
|
|
11725
|
+
@Field()
|
|
11726
|
+
@MaxLength(510)
|
|
11727
|
+
Entity: string;
|
|
11692
11728
|
|
|
11693
11729
|
}
|
|
11694
11730
|
//****************************************************************************
|
|
@@ -11736,9 +11772,9 @@ export class TaggedItemResolver extends ResolverBase {
|
|
|
11736
11772
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
11737
11773
|
}
|
|
11738
11774
|
@Query(() => TaggedItem_, { nullable: true })
|
|
11739
|
-
async TaggedItem(@Arg('ID', () => Int) ID:
|
|
11775
|
+
async TaggedItem(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<TaggedItem_ | null> {
|
|
11740
11776
|
this.CheckUserReadPermissions('Tagged Items', userPayload);
|
|
11741
|
-
const sSQL = `SELECT * FROM [
|
|
11777
|
+
const sSQL = `SELECT * FROM [__mj].[vwTaggedItems] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Tagged Items', userPayload, EntityPermissionType.Read, 'AND');
|
|
11742
11778
|
this.createRecordAccessAuditLogRecord(userPayload, 'Tagged Items', ID)
|
|
11743
11779
|
const result = this.MapFieldNamesToCodeNames('Tagged Items', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
11744
11780
|
return result;
|
|
@@ -11768,8 +11804,8 @@ export class Workspace_ {
|
|
|
11768
11804
|
@MaxLength(200)
|
|
11769
11805
|
User: string;
|
|
11770
11806
|
|
|
11771
|
-
@Field(() => [WorkspaceItem_])
|
|
11772
|
-
WorkspaceItemsArray: WorkspaceItem_[]; // Link to WorkspaceItems
|
|
11807
|
+
@Field(() => [mj_core_schema_server_object_types.WorkspaceItem_])
|
|
11808
|
+
WorkspaceItemsArray: mj_core_schema_server_object_types.WorkspaceItem_[]; // Link to WorkspaceItems
|
|
11773
11809
|
|
|
11774
11810
|
}
|
|
11775
11811
|
|
|
@@ -11852,18 +11888,18 @@ export class WorkspaceResolver extends ResolverBase {
|
|
|
11852
11888
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
11853
11889
|
}
|
|
11854
11890
|
@Query(() => Workspace_, { nullable: true })
|
|
11855
|
-
async Workspace(@Arg('ID', () => Int) ID:
|
|
11891
|
+
async Workspace(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<Workspace_ | null> {
|
|
11856
11892
|
this.CheckUserReadPermissions('Workspaces', userPayload);
|
|
11857
|
-
const sSQL = `SELECT * FROM [
|
|
11893
|
+
const sSQL = `SELECT * FROM [__mj].[vwWorkspaces] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Workspaces', userPayload, EntityPermissionType.Read, 'AND');
|
|
11858
11894
|
this.createRecordAccessAuditLogRecord(userPayload, 'Workspaces', ID)
|
|
11859
11895
|
const result = this.MapFieldNamesToCodeNames('Workspaces', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
11860
11896
|
return result;
|
|
11861
11897
|
}
|
|
11862
11898
|
|
|
11863
|
-
@FieldResolver(() => [WorkspaceItem_])
|
|
11899
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.WorkspaceItem_])
|
|
11864
11900
|
async WorkspaceItemsArray(@Root() workspace_: Workspace_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
11865
11901
|
this.CheckUserReadPermissions('Workspace Items', userPayload);
|
|
11866
|
-
const sSQL = `SELECT * FROM [
|
|
11902
|
+
const sSQL = `SELECT * FROM [__mj].[vwWorkspaceItems] WHERE [WorkSpaceID]=${workspace_.ID} ` + this.getRowLevelSecurityWhereClause('Workspace Items', userPayload, EntityPermissionType.Read, 'AND');
|
|
11867
11903
|
const result = this.ArrayMapFieldNamesToCodeNames('Workspace Items', await dataSource.query(sSQL));
|
|
11868
11904
|
return result;
|
|
11869
11905
|
}
|
|
@@ -11930,7 +11966,7 @@ export class WorkspaceResolver extends ResolverBase {
|
|
|
11930
11966
|
}
|
|
11931
11967
|
|
|
11932
11968
|
@Mutation(() => Workspace_)
|
|
11933
|
-
async DeleteWorkspace(@Arg('ID', () => Int) ID:
|
|
11969
|
+
async DeleteWorkspace(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
11934
11970
|
if (await this.BeforeDelete(dataSource, ID)) { // fire event and proceed if it wasn't cancelled
|
|
11935
11971
|
const entityObject = <WorkspaceEntity>await new Metadata().GetEntityObject('Workspaces', this.GetUserFromPayload(userPayload));
|
|
11936
11972
|
await entityObject.Load(ID);
|
|
@@ -11947,11 +11983,11 @@ export class WorkspaceResolver extends ResolverBase {
|
|
|
11947
11983
|
}
|
|
11948
11984
|
|
|
11949
11985
|
// Before/After UPDATE Event Hooks for Sub-Classes to Override
|
|
11950
|
-
protected async BeforeDelete(dataSource: DataSource, ID:
|
|
11986
|
+
protected async BeforeDelete(dataSource: DataSource, ID: number): Promise<boolean> {
|
|
11951
11987
|
const i = ID, d = dataSource; // prevent error;
|
|
11952
11988
|
return true;
|
|
11953
11989
|
}
|
|
11954
|
-
protected async AfterDelete(dataSource: DataSource, ID:
|
|
11990
|
+
protected async AfterDelete(dataSource: DataSource, ID: number) {
|
|
11955
11991
|
const i = ID, d = dataSource; // prevent error
|
|
11956
11992
|
}
|
|
11957
11993
|
|
|
@@ -12101,9 +12137,9 @@ export class WorkspaceItemResolver extends ResolverBase {
|
|
|
12101
12137
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
12102
12138
|
}
|
|
12103
12139
|
@Query(() => WorkspaceItem_, { nullable: true })
|
|
12104
|
-
async WorkspaceItem(@Arg('ID', () => Int) ID:
|
|
12140
|
+
async WorkspaceItem(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<WorkspaceItem_ | null> {
|
|
12105
12141
|
this.CheckUserReadPermissions('Workspace Items', userPayload);
|
|
12106
|
-
const sSQL = `SELECT * FROM [
|
|
12142
|
+
const sSQL = `SELECT * FROM [__mj].[vwWorkspaceItems] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Workspace Items', userPayload, EntityPermissionType.Read, 'AND');
|
|
12107
12143
|
this.createRecordAccessAuditLogRecord(userPayload, 'Workspace Items', ID)
|
|
12108
12144
|
const result = this.MapFieldNamesToCodeNames('Workspace Items', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
12109
12145
|
return result;
|
|
@@ -12171,7 +12207,7 @@ export class WorkspaceItemResolver extends ResolverBase {
|
|
|
12171
12207
|
}
|
|
12172
12208
|
|
|
12173
12209
|
@Mutation(() => WorkspaceItem_)
|
|
12174
|
-
async DeleteWorkspaceItem(@Arg('ID', () => Int) ID:
|
|
12210
|
+
async DeleteWorkspaceItem(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
12175
12211
|
if (await this.BeforeDelete(dataSource, ID)) { // fire event and proceed if it wasn't cancelled
|
|
12176
12212
|
const entityObject = <WorkspaceItemEntity>await new Metadata().GetEntityObject('Workspace Items', this.GetUserFromPayload(userPayload));
|
|
12177
12213
|
await entityObject.Load(ID);
|
|
@@ -12188,11 +12224,11 @@ export class WorkspaceItemResolver extends ResolverBase {
|
|
|
12188
12224
|
}
|
|
12189
12225
|
|
|
12190
12226
|
// Before/After UPDATE Event Hooks for Sub-Classes to Override
|
|
12191
|
-
protected async BeforeDelete(dataSource: DataSource, ID:
|
|
12227
|
+
protected async BeforeDelete(dataSource: DataSource, ID: number): Promise<boolean> {
|
|
12192
12228
|
const i = ID, d = dataSource; // prevent error;
|
|
12193
12229
|
return true;
|
|
12194
12230
|
}
|
|
12195
|
-
protected async AfterDelete(dataSource: DataSource, ID:
|
|
12231
|
+
protected async AfterDelete(dataSource: DataSource, ID: number) {
|
|
12196
12232
|
const i = ID, d = dataSource; // prevent error
|
|
12197
12233
|
}
|
|
12198
12234
|
|
|
@@ -12221,8 +12257,8 @@ export class Dataset_ {
|
|
|
12221
12257
|
@MaxLength(8)
|
|
12222
12258
|
UpdatedAt: Date;
|
|
12223
12259
|
|
|
12224
|
-
@Field(() => [DatasetItem_])
|
|
12225
|
-
DatasetItemsArray: DatasetItem_[]; // Link to DatasetItems
|
|
12260
|
+
@Field(() => [mj_core_schema_server_object_types.DatasetItem_])
|
|
12261
|
+
DatasetItemsArray: mj_core_schema_server_object_types.DatasetItem_[]; // Link to DatasetItems
|
|
12226
12262
|
|
|
12227
12263
|
}
|
|
12228
12264
|
//****************************************************************************
|
|
@@ -12270,17 +12306,17 @@ export class DatasetResolver extends ResolverBase {
|
|
|
12270
12306
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
12271
12307
|
}
|
|
12272
12308
|
@Query(() => Dataset_, { nullable: true })
|
|
12273
|
-
async Dataset(@Arg('ID', () => Int) ID:
|
|
12309
|
+
async Dataset(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<Dataset_ | null> {
|
|
12274
12310
|
this.CheckUserReadPermissions('Datasets', userPayload);
|
|
12275
|
-
const sSQL = `SELECT * FROM [
|
|
12311
|
+
const sSQL = `SELECT * FROM [__mj].[vwDatasets] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Datasets', userPayload, EntityPermissionType.Read, 'AND');
|
|
12276
12312
|
const result = this.MapFieldNamesToCodeNames('Datasets', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
12277
12313
|
return result;
|
|
12278
12314
|
}
|
|
12279
12315
|
|
|
12280
|
-
@FieldResolver(() => [DatasetItem_])
|
|
12316
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.DatasetItem_])
|
|
12281
12317
|
async DatasetItemsArray(@Root() dataset_: Dataset_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
12282
12318
|
this.CheckUserReadPermissions('Dataset Items', userPayload);
|
|
12283
|
-
const sSQL = `SELECT * FROM [
|
|
12319
|
+
const sSQL = `SELECT * FROM [__mj].[vwDatasetItems] WHERE [DatasetName]=${dataset_.ID} ` + this.getRowLevelSecurityWhereClause('Dataset Items', userPayload, EntityPermissionType.Read, 'AND');
|
|
12284
12320
|
const result = this.ArrayMapFieldNamesToCodeNames('Dataset Items', await dataSource.query(sSQL));
|
|
12285
12321
|
return result;
|
|
12286
12322
|
}
|
|
@@ -12377,9 +12413,9 @@ export class DatasetItemResolver extends ResolverBase {
|
|
|
12377
12413
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
12378
12414
|
}
|
|
12379
12415
|
@Query(() => DatasetItem_, { nullable: true })
|
|
12380
|
-
async DatasetItem(@Arg('ID', () => Int) ID:
|
|
12416
|
+
async DatasetItem(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<DatasetItem_ | null> {
|
|
12381
12417
|
this.CheckUserReadPermissions('Dataset Items', userPayload);
|
|
12382
|
-
const sSQL = `SELECT * FROM [
|
|
12418
|
+
const sSQL = `SELECT * FROM [__mj].[vwDatasetItems] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Dataset Items', userPayload, EntityPermissionType.Read, 'AND');
|
|
12383
12419
|
const result = this.MapFieldNamesToCodeNames('Dataset Items', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
12384
12420
|
return result;
|
|
12385
12421
|
}
|
|
@@ -12426,8 +12462,8 @@ export class ConversationDetail_ {
|
|
|
12426
12462
|
@MaxLength(200)
|
|
12427
12463
|
Conversation?: string;
|
|
12428
12464
|
|
|
12429
|
-
@Field(() => [Report_])
|
|
12430
|
-
ReportsArray: Report_[]; // Link to Reports
|
|
12465
|
+
@Field(() => [mj_core_schema_server_object_types.Report_])
|
|
12466
|
+
ReportsArray: mj_core_schema_server_object_types.Report_[]; // Link to Reports
|
|
12431
12467
|
|
|
12432
12468
|
}
|
|
12433
12469
|
|
|
@@ -12528,17 +12564,17 @@ export class ConversationDetailResolver extends ResolverBase {
|
|
|
12528
12564
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
12529
12565
|
}
|
|
12530
12566
|
@Query(() => ConversationDetail_, { nullable: true })
|
|
12531
|
-
async ConversationDetail(@Arg('ID', () => Int) ID:
|
|
12567
|
+
async ConversationDetail(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<ConversationDetail_ | null> {
|
|
12532
12568
|
this.CheckUserReadPermissions('Conversation Details', userPayload);
|
|
12533
|
-
const sSQL = `SELECT * FROM [
|
|
12569
|
+
const sSQL = `SELECT * FROM [__mj].[vwConversationDetails] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Conversation Details', userPayload, EntityPermissionType.Read, 'AND');
|
|
12534
12570
|
const result = this.MapFieldNamesToCodeNames('Conversation Details', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
12535
12571
|
return result;
|
|
12536
12572
|
}
|
|
12537
12573
|
|
|
12538
|
-
@FieldResolver(() => [Report_])
|
|
12574
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.Report_])
|
|
12539
12575
|
async ReportsArray(@Root() conversationdetail_: ConversationDetail_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
12540
12576
|
this.CheckUserReadPermissions('Reports', userPayload);
|
|
12541
|
-
const sSQL = `SELECT * FROM [
|
|
12577
|
+
const sSQL = `SELECT * FROM [__mj].[vwReports] WHERE [ConversationDetailID]=${conversationdetail_.ID} ` + this.getRowLevelSecurityWhereClause('Reports', userPayload, EntityPermissionType.Read, 'AND');
|
|
12542
12578
|
const result = this.ArrayMapFieldNamesToCodeNames('Reports', await dataSource.query(sSQL));
|
|
12543
12579
|
return result;
|
|
12544
12580
|
}
|
|
@@ -12605,7 +12641,7 @@ export class ConversationDetailResolver extends ResolverBase {
|
|
|
12605
12641
|
}
|
|
12606
12642
|
|
|
12607
12643
|
@Mutation(() => ConversationDetail_)
|
|
12608
|
-
async DeleteConversationDetail(@Arg('ID', () => Int) ID:
|
|
12644
|
+
async DeleteConversationDetail(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
12609
12645
|
if (await this.BeforeDelete(dataSource, ID)) { // fire event and proceed if it wasn't cancelled
|
|
12610
12646
|
const entityObject = <ConversationDetailEntity>await new Metadata().GetEntityObject('Conversation Details', this.GetUserFromPayload(userPayload));
|
|
12611
12647
|
await entityObject.Load(ID);
|
|
@@ -12622,11 +12658,11 @@ export class ConversationDetailResolver extends ResolverBase {
|
|
|
12622
12658
|
}
|
|
12623
12659
|
|
|
12624
12660
|
// Before/After UPDATE Event Hooks for Sub-Classes to Override
|
|
12625
|
-
protected async BeforeDelete(dataSource: DataSource, ID:
|
|
12661
|
+
protected async BeforeDelete(dataSource: DataSource, ID: number): Promise<boolean> {
|
|
12626
12662
|
const i = ID, d = dataSource; // prevent error;
|
|
12627
12663
|
return true;
|
|
12628
12664
|
}
|
|
12629
|
-
protected async AfterDelete(dataSource: DataSource, ID:
|
|
12665
|
+
protected async AfterDelete(dataSource: DataSource, ID: number) {
|
|
12630
12666
|
const i = ID, d = dataSource; // prevent error
|
|
12631
12667
|
}
|
|
12632
12668
|
|
|
@@ -12686,11 +12722,11 @@ export class Conversation_ {
|
|
|
12686
12722
|
@MaxLength(510)
|
|
12687
12723
|
LinkedEntity?: string;
|
|
12688
12724
|
|
|
12689
|
-
@Field(() => [ConversationDetail_])
|
|
12690
|
-
ConversationDetailsArray: ConversationDetail_[]; // Link to ConversationDetails
|
|
12725
|
+
@Field(() => [mj_core_schema_server_object_types.ConversationDetail_])
|
|
12726
|
+
ConversationDetailsArray: mj_core_schema_server_object_types.ConversationDetail_[]; // Link to ConversationDetails
|
|
12691
12727
|
|
|
12692
|
-
@Field(() => [Report_])
|
|
12693
|
-
ReportsArray: Report_[]; // Link to Reports
|
|
12728
|
+
@Field(() => [mj_core_schema_server_object_types.Report_])
|
|
12729
|
+
ReportsArray: mj_core_schema_server_object_types.Report_[]; // Link to Reports
|
|
12694
12730
|
|
|
12695
12731
|
}
|
|
12696
12732
|
|
|
@@ -12809,25 +12845,25 @@ export class ConversationResolver extends ResolverBase {
|
|
|
12809
12845
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
12810
12846
|
}
|
|
12811
12847
|
@Query(() => Conversation_, { nullable: true })
|
|
12812
|
-
async Conversation(@Arg('ID', () => Int) ID:
|
|
12848
|
+
async Conversation(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<Conversation_ | null> {
|
|
12813
12849
|
this.CheckUserReadPermissions('Conversations', userPayload);
|
|
12814
|
-
const sSQL = `SELECT * FROM [
|
|
12850
|
+
const sSQL = `SELECT * FROM [__mj].[vwConversations] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Conversations', userPayload, EntityPermissionType.Read, 'AND');
|
|
12815
12851
|
const result = this.MapFieldNamesToCodeNames('Conversations', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
12816
12852
|
return result;
|
|
12817
12853
|
}
|
|
12818
12854
|
|
|
12819
|
-
@FieldResolver(() => [ConversationDetail_])
|
|
12855
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.ConversationDetail_])
|
|
12820
12856
|
async ConversationDetailsArray(@Root() conversation_: Conversation_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
12821
12857
|
this.CheckUserReadPermissions('Conversation Details', userPayload);
|
|
12822
|
-
const sSQL = `SELECT * FROM [
|
|
12858
|
+
const sSQL = `SELECT * FROM [__mj].[vwConversationDetails] WHERE [ConversationID]=${conversation_.ID} ` + this.getRowLevelSecurityWhereClause('Conversation Details', userPayload, EntityPermissionType.Read, 'AND');
|
|
12823
12859
|
const result = this.ArrayMapFieldNamesToCodeNames('Conversation Details', await dataSource.query(sSQL));
|
|
12824
12860
|
return result;
|
|
12825
12861
|
}
|
|
12826
12862
|
|
|
12827
|
-
@FieldResolver(() => [Report_])
|
|
12863
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.Report_])
|
|
12828
12864
|
async ReportsArray(@Root() conversation_: Conversation_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
12829
12865
|
this.CheckUserReadPermissions('Reports', userPayload);
|
|
12830
|
-
const sSQL = `SELECT * FROM [
|
|
12866
|
+
const sSQL = `SELECT * FROM [__mj].[vwReports] WHERE [ConversationID]=${conversation_.ID} ` + this.getRowLevelSecurityWhereClause('Reports', userPayload, EntityPermissionType.Read, 'AND');
|
|
12831
12867
|
const result = this.ArrayMapFieldNamesToCodeNames('Reports', await dataSource.query(sSQL));
|
|
12832
12868
|
return result;
|
|
12833
12869
|
}
|
|
@@ -12894,7 +12930,7 @@ export class ConversationResolver extends ResolverBase {
|
|
|
12894
12930
|
}
|
|
12895
12931
|
|
|
12896
12932
|
@Mutation(() => Conversation_)
|
|
12897
|
-
async DeleteConversation(@Arg('ID', () => Int) ID:
|
|
12933
|
+
async DeleteConversation(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
12898
12934
|
if (await this.BeforeDelete(dataSource, ID)) { // fire event and proceed if it wasn't cancelled
|
|
12899
12935
|
const entityObject = <ConversationEntity>await new Metadata().GetEntityObject('Conversations', this.GetUserFromPayload(userPayload));
|
|
12900
12936
|
await entityObject.Load(ID);
|
|
@@ -12911,11 +12947,11 @@ export class ConversationResolver extends ResolverBase {
|
|
|
12911
12947
|
}
|
|
12912
12948
|
|
|
12913
12949
|
// Before/After UPDATE Event Hooks for Sub-Classes to Override
|
|
12914
|
-
protected async BeforeDelete(dataSource: DataSource, ID:
|
|
12950
|
+
protected async BeforeDelete(dataSource: DataSource, ID: number): Promise<boolean> {
|
|
12915
12951
|
const i = ID, d = dataSource; // prevent error;
|
|
12916
12952
|
return true;
|
|
12917
12953
|
}
|
|
12918
|
-
protected async AfterDelete(dataSource: DataSource, ID:
|
|
12954
|
+
protected async AfterDelete(dataSource: DataSource, ID: number) {
|
|
12919
12955
|
const i = ID, d = dataSource; // prevent error
|
|
12920
12956
|
}
|
|
12921
12957
|
|
|
@@ -13078,9 +13114,9 @@ export class UserNotificationResolver extends ResolverBase {
|
|
|
13078
13114
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
13079
13115
|
}
|
|
13080
13116
|
@Query(() => UserNotification_, { nullable: true })
|
|
13081
|
-
async UserNotification(@Arg('ID', () => Int) ID:
|
|
13117
|
+
async UserNotification(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<UserNotification_ | null> {
|
|
13082
13118
|
this.CheckUserReadPermissions('User Notifications', userPayload);
|
|
13083
|
-
const sSQL = `SELECT * FROM [
|
|
13119
|
+
const sSQL = `SELECT * FROM [__mj].[vwUserNotifications] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('User Notifications', userPayload, EntityPermissionType.Read, 'AND');
|
|
13084
13120
|
const result = this.MapFieldNamesToCodeNames('User Notifications', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
13085
13121
|
return result;
|
|
13086
13122
|
}
|
|
@@ -13264,9 +13300,9 @@ export class SchemaInfoResolver extends ResolverBase {
|
|
|
13264
13300
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
13265
13301
|
}
|
|
13266
13302
|
@Query(() => SchemaInfo_, { nullable: true })
|
|
13267
|
-
async SchemaInfo(@Arg('ID', () => Int) ID:
|
|
13303
|
+
async SchemaInfo(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<SchemaInfo_ | null> {
|
|
13268
13304
|
this.CheckUserReadPermissions('Schema Info', userPayload);
|
|
13269
|
-
const sSQL = `SELECT * FROM [
|
|
13305
|
+
const sSQL = `SELECT * FROM [__mj].[vwSchemaInfos] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Schema Info', userPayload, EntityPermissionType.Read, 'AND');
|
|
13270
13306
|
const result = this.MapFieldNamesToCodeNames('Schema Info', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
13271
13307
|
return result;
|
|
13272
13308
|
}
|
|
@@ -13363,6 +13399,10 @@ export class CompanyIntegrationRecordMap_ {
|
|
|
13363
13399
|
@Field()
|
|
13364
13400
|
@MaxLength(8)
|
|
13365
13401
|
UpdatedAt: Date;
|
|
13402
|
+
|
|
13403
|
+
@Field()
|
|
13404
|
+
@MaxLength(510)
|
|
13405
|
+
Entity: string;
|
|
13366
13406
|
|
|
13367
13407
|
}
|
|
13368
13408
|
|
|
@@ -13451,9 +13491,9 @@ export class CompanyIntegrationRecordMapResolver extends ResolverBase {
|
|
|
13451
13491
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
13452
13492
|
}
|
|
13453
13493
|
@Query(() => CompanyIntegrationRecordMap_, { nullable: true })
|
|
13454
|
-
async CompanyIntegrationRecordMap(@Arg('ID', () => Int) ID:
|
|
13494
|
+
async CompanyIntegrationRecordMap(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<CompanyIntegrationRecordMap_ | null> {
|
|
13455
13495
|
this.CheckUserReadPermissions('Company Integration Record Maps', userPayload);
|
|
13456
|
-
const sSQL = `SELECT * FROM [
|
|
13496
|
+
const sSQL = `SELECT * FROM [__mj].[vwCompanyIntegrationRecordMaps] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Company Integration Record Maps', userPayload, EntityPermissionType.Read, 'AND');
|
|
13457
13497
|
const result = this.MapFieldNamesToCodeNames('Company Integration Record Maps', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
13458
13498
|
return result;
|
|
13459
13499
|
}
|
|
@@ -13580,8 +13620,8 @@ export class RecordMergeLog_ {
|
|
|
13580
13620
|
@MaxLength(200)
|
|
13581
13621
|
InitiatedByUser: string;
|
|
13582
13622
|
|
|
13583
|
-
@Field(() => [RecordMergeDeletionLog_])
|
|
13584
|
-
RecordMergeDeletionLogsArray: RecordMergeDeletionLog_[]; // Link to RecordMergeDeletionLogs
|
|
13623
|
+
@Field(() => [mj_core_schema_server_object_types.RecordMergeDeletionLog_])
|
|
13624
|
+
RecordMergeDeletionLogsArray: mj_core_schema_server_object_types.RecordMergeDeletionLog_[]; // Link to RecordMergeDeletionLogs
|
|
13585
13625
|
|
|
13586
13626
|
}
|
|
13587
13627
|
|
|
@@ -13706,17 +13746,17 @@ export class RecordMergeLogResolver extends ResolverBase {
|
|
|
13706
13746
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
13707
13747
|
}
|
|
13708
13748
|
@Query(() => RecordMergeLog_, { nullable: true })
|
|
13709
|
-
async RecordMergeLog(@Arg('ID', () => Int) ID:
|
|
13749
|
+
async RecordMergeLog(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<RecordMergeLog_ | null> {
|
|
13710
13750
|
this.CheckUserReadPermissions('Record Merge Logs', userPayload);
|
|
13711
|
-
const sSQL = `SELECT * FROM [
|
|
13751
|
+
const sSQL = `SELECT * FROM [__mj].[vwRecordMergeLogs] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Record Merge Logs', userPayload, EntityPermissionType.Read, 'AND');
|
|
13712
13752
|
const result = this.MapFieldNamesToCodeNames('Record Merge Logs', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
13713
13753
|
return result;
|
|
13714
13754
|
}
|
|
13715
13755
|
|
|
13716
|
-
@FieldResolver(() => [RecordMergeDeletionLog_])
|
|
13756
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.RecordMergeDeletionLog_])
|
|
13717
13757
|
async RecordMergeDeletionLogsArray(@Root() recordmergelog_: RecordMergeLog_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
13718
13758
|
this.CheckUserReadPermissions('Record Merge Deletion Logs', userPayload);
|
|
13719
|
-
const sSQL = `SELECT * FROM [
|
|
13759
|
+
const sSQL = `SELECT * FROM [__mj].[vwRecordMergeDeletionLogs] WHERE [RecordMergeLogID]=${recordmergelog_.ID} ` + this.getRowLevelSecurityWhereClause('Record Merge Deletion Logs', userPayload, EntityPermissionType.Read, 'AND');
|
|
13720
13760
|
const result = this.ArrayMapFieldNamesToCodeNames('Record Merge Deletion Logs', await dataSource.query(sSQL));
|
|
13721
13761
|
return result;
|
|
13722
13762
|
}
|
|
@@ -13901,9 +13941,9 @@ export class RecordMergeDeletionLogResolver extends ResolverBase {
|
|
|
13901
13941
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
13902
13942
|
}
|
|
13903
13943
|
@Query(() => RecordMergeDeletionLog_, { nullable: true })
|
|
13904
|
-
async RecordMergeDeletionLog(@Arg('ID', () => Int) ID:
|
|
13944
|
+
async RecordMergeDeletionLog(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<RecordMergeDeletionLog_ | null> {
|
|
13905
13945
|
this.CheckUserReadPermissions('Record Merge Deletion Logs', userPayload);
|
|
13906
|
-
const sSQL = `SELECT * FROM [
|
|
13946
|
+
const sSQL = `SELECT * FROM [__mj].[vwRecordMergeDeletionLogs] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Record Merge Deletion Logs', userPayload, EntityPermissionType.Read, 'AND');
|
|
13907
13947
|
const result = this.MapFieldNamesToCodeNames('Record Merge Deletion Logs', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
13908
13948
|
return result;
|
|
13909
13949
|
}
|
|
@@ -14030,6 +14070,10 @@ export class QueryField_ {
|
|
|
14030
14070
|
@Field()
|
|
14031
14071
|
@MaxLength(510)
|
|
14032
14072
|
Query: string;
|
|
14073
|
+
|
|
14074
|
+
@Field({nullable: true})
|
|
14075
|
+
@MaxLength(510)
|
|
14076
|
+
SourceEntity?: string;
|
|
14033
14077
|
|
|
14034
14078
|
}
|
|
14035
14079
|
|
|
@@ -14166,9 +14210,9 @@ export class QueryFieldResolver extends ResolverBase {
|
|
|
14166
14210
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
14167
14211
|
}
|
|
14168
14212
|
@Query(() => QueryField_, { nullable: true })
|
|
14169
|
-
async QueryField(@Arg('ID', () => Int) ID:
|
|
14213
|
+
async QueryField(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<QueryField_ | null> {
|
|
14170
14214
|
this.CheckUserReadPermissions('Query Fields', userPayload);
|
|
14171
|
-
const sSQL = `SELECT * FROM [
|
|
14215
|
+
const sSQL = `SELECT * FROM [__mj].[vwQueryFields] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Query Fields', userPayload, EntityPermissionType.Read, 'AND');
|
|
14172
14216
|
const result = this.MapFieldNamesToCodeNames('Query Fields', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
14173
14217
|
return result;
|
|
14174
14218
|
}
|
|
@@ -14266,11 +14310,11 @@ export class QueryCategory_ {
|
|
|
14266
14310
|
@MaxLength(100)
|
|
14267
14311
|
Parent?: string;
|
|
14268
14312
|
|
|
14269
|
-
@Field(() => [QueryCategory_])
|
|
14270
|
-
QueryCategoriesArray: QueryCategory_[]; // Link to QueryCategories
|
|
14313
|
+
@Field(() => [mj_core_schema_server_object_types.QueryCategory_])
|
|
14314
|
+
QueryCategoriesArray: mj_core_schema_server_object_types.QueryCategory_[]; // Link to QueryCategories
|
|
14271
14315
|
|
|
14272
|
-
@Field(() => [Query_])
|
|
14273
|
-
QueriesArray: Query_[]; // Link to Queries
|
|
14316
|
+
@Field(() => [mj_core_schema_server_object_types.Query_])
|
|
14317
|
+
QueriesArray: mj_core_schema_server_object_types.Query_[]; // Link to Queries
|
|
14274
14318
|
|
|
14275
14319
|
}
|
|
14276
14320
|
|
|
@@ -14353,25 +14397,25 @@ export class QueryCategoryResolver extends ResolverBase {
|
|
|
14353
14397
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
14354
14398
|
}
|
|
14355
14399
|
@Query(() => QueryCategory_, { nullable: true })
|
|
14356
|
-
async QueryCategory(@Arg('ID', () => Int) ID:
|
|
14400
|
+
async QueryCategory(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<QueryCategory_ | null> {
|
|
14357
14401
|
this.CheckUserReadPermissions('Query Categories', userPayload);
|
|
14358
|
-
const sSQL = `SELECT * FROM [
|
|
14402
|
+
const sSQL = `SELECT * FROM [__mj].[vwQueryCategories] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Query Categories', userPayload, EntityPermissionType.Read, 'AND');
|
|
14359
14403
|
const result = this.MapFieldNamesToCodeNames('Query Categories', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
14360
14404
|
return result;
|
|
14361
14405
|
}
|
|
14362
14406
|
|
|
14363
|
-
@FieldResolver(() => [QueryCategory_])
|
|
14407
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.QueryCategory_])
|
|
14364
14408
|
async QueryCategoriesArray(@Root() querycategory_: QueryCategory_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
14365
14409
|
this.CheckUserReadPermissions('Query Categories', userPayload);
|
|
14366
|
-
const sSQL = `SELECT * FROM [
|
|
14410
|
+
const sSQL = `SELECT * FROM [__mj].[vwQueryCategories] WHERE [ParentID]=${querycategory_.ID} ` + this.getRowLevelSecurityWhereClause('Query Categories', userPayload, EntityPermissionType.Read, 'AND');
|
|
14367
14411
|
const result = this.ArrayMapFieldNamesToCodeNames('Query Categories', await dataSource.query(sSQL));
|
|
14368
14412
|
return result;
|
|
14369
14413
|
}
|
|
14370
14414
|
|
|
14371
|
-
@FieldResolver(() => [Query_])
|
|
14415
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.Query_])
|
|
14372
14416
|
async QueriesArray(@Root() querycategory_: QueryCategory_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
14373
14417
|
this.CheckUserReadPermissions('Queries', userPayload);
|
|
14374
|
-
const sSQL = `SELECT * FROM [
|
|
14418
|
+
const sSQL = `SELECT * FROM [__mj].[vwQueries] WHERE [CategoryID]=${querycategory_.ID} ` + this.getRowLevelSecurityWhereClause('Queries', userPayload, EntityPermissionType.Read, 'AND');
|
|
14375
14419
|
const result = this.ArrayMapFieldNamesToCodeNames('Queries', await dataSource.query(sSQL));
|
|
14376
14420
|
return result;
|
|
14377
14421
|
}
|
|
@@ -14485,14 +14529,14 @@ export class Query_ {
|
|
|
14485
14529
|
@MaxLength(100)
|
|
14486
14530
|
Category: string;
|
|
14487
14531
|
|
|
14488
|
-
@Field(() => [QueryField_])
|
|
14489
|
-
QueryFieldsArray: QueryField_[]; // Link to QueryFields
|
|
14532
|
+
@Field(() => [mj_core_schema_server_object_types.QueryField_])
|
|
14533
|
+
QueryFieldsArray: mj_core_schema_server_object_types.QueryField_[]; // Link to QueryFields
|
|
14490
14534
|
|
|
14491
|
-
@Field(() => [QueryPermission_])
|
|
14492
|
-
QueryPermissionsArray: QueryPermission_[]; // Link to QueryPermissions
|
|
14535
|
+
@Field(() => [mj_core_schema_server_object_types.QueryPermission_])
|
|
14536
|
+
QueryPermissionsArray: mj_core_schema_server_object_types.QueryPermission_[]; // Link to QueryPermissions
|
|
14493
14537
|
|
|
14494
|
-
@Field(() => [DataContextItem_])
|
|
14495
|
-
DataContextItemsArray: DataContextItem_[]; // Link to DataContextItems
|
|
14538
|
+
@Field(() => [mj_core_schema_server_object_types.DataContextItem_])
|
|
14539
|
+
DataContextItemsArray: mj_core_schema_server_object_types.DataContextItem_[]; // Link to DataContextItems
|
|
14496
14540
|
|
|
14497
14541
|
}
|
|
14498
14542
|
|
|
@@ -14605,33 +14649,33 @@ export class QueryResolver extends ResolverBase {
|
|
|
14605
14649
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
14606
14650
|
}
|
|
14607
14651
|
@Query(() => Query_, { nullable: true })
|
|
14608
|
-
async Query(@Arg('ID', () => Int) ID:
|
|
14652
|
+
async Query(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<Query_ | null> {
|
|
14609
14653
|
this.CheckUserReadPermissions('Queries', userPayload);
|
|
14610
|
-
const sSQL = `SELECT * FROM [
|
|
14654
|
+
const sSQL = `SELECT * FROM [__mj].[vwQueries] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Queries', userPayload, EntityPermissionType.Read, 'AND');
|
|
14611
14655
|
const result = this.MapFieldNamesToCodeNames('Queries', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
14612
14656
|
return result;
|
|
14613
14657
|
}
|
|
14614
14658
|
|
|
14615
|
-
@FieldResolver(() => [QueryField_])
|
|
14659
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.QueryField_])
|
|
14616
14660
|
async QueryFieldsArray(@Root() query_: Query_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
14617
14661
|
this.CheckUserReadPermissions('Query Fields', userPayload);
|
|
14618
|
-
const sSQL = `SELECT * FROM [
|
|
14662
|
+
const sSQL = `SELECT * FROM [__mj].[vwQueryFields] WHERE [QueryID]=${query_.ID} ` + this.getRowLevelSecurityWhereClause('Query Fields', userPayload, EntityPermissionType.Read, 'AND');
|
|
14619
14663
|
const result = this.ArrayMapFieldNamesToCodeNames('Query Fields', await dataSource.query(sSQL));
|
|
14620
14664
|
return result;
|
|
14621
14665
|
}
|
|
14622
14666
|
|
|
14623
|
-
@FieldResolver(() => [QueryPermission_])
|
|
14667
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.QueryPermission_])
|
|
14624
14668
|
async QueryPermissionsArray(@Root() query_: Query_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
14625
14669
|
this.CheckUserReadPermissions('Query Permissions', userPayload);
|
|
14626
|
-
const sSQL = `SELECT * FROM [
|
|
14670
|
+
const sSQL = `SELECT * FROM [__mj].[vwQueryPermissions] WHERE [QueryID]=${query_.ID} ` + this.getRowLevelSecurityWhereClause('Query Permissions', userPayload, EntityPermissionType.Read, 'AND');
|
|
14627
14671
|
const result = this.ArrayMapFieldNamesToCodeNames('Query Permissions', await dataSource.query(sSQL));
|
|
14628
14672
|
return result;
|
|
14629
14673
|
}
|
|
14630
14674
|
|
|
14631
|
-
@FieldResolver(() => [DataContextItem_])
|
|
14675
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.DataContextItem_])
|
|
14632
14676
|
async DataContextItemsArray(@Root() query_: Query_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
14633
14677
|
this.CheckUserReadPermissions('Data Context Items', userPayload);
|
|
14634
|
-
const sSQL = `SELECT * FROM [
|
|
14678
|
+
const sSQL = `SELECT * FROM [__mj].[vwDataContextItems] WHERE [QueryID]=${query_.ID} ` + this.getRowLevelSecurityWhereClause('Data Context Items', userPayload, EntityPermissionType.Read, 'AND');
|
|
14635
14679
|
const result = this.ArrayMapFieldNamesToCodeNames('Data Context Items', await dataSource.query(sSQL));
|
|
14636
14680
|
return result;
|
|
14637
14681
|
}
|
|
@@ -14797,9 +14841,9 @@ export class QueryPermissionResolver extends ResolverBase {
|
|
|
14797
14841
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
14798
14842
|
}
|
|
14799
14843
|
@Query(() => QueryPermission_, { nullable: true })
|
|
14800
|
-
async QueryPermission(@Arg('ID', () => Int) ID:
|
|
14844
|
+
async QueryPermission(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<QueryPermission_ | null> {
|
|
14801
14845
|
this.CheckUserReadPermissions('Query Permissions', userPayload);
|
|
14802
|
-
const sSQL = `SELECT * FROM [
|
|
14846
|
+
const sSQL = `SELECT * FROM [__mj].[vwQueryPermissions] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Query Permissions', userPayload, EntityPermissionType.Read, 'AND');
|
|
14803
14847
|
const result = this.MapFieldNamesToCodeNames('Query Permissions', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
14804
14848
|
return result;
|
|
14805
14849
|
}
|
|
@@ -14991,9 +15035,9 @@ export class VectorIndexResolver extends ResolverBase {
|
|
|
14991
15035
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
14992
15036
|
}
|
|
14993
15037
|
@Query(() => VectorIndex_, { nullable: true })
|
|
14994
|
-
async VectorIndex(@Arg('ID', () => Int) ID:
|
|
15038
|
+
async VectorIndex(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<VectorIndex_ | null> {
|
|
14995
15039
|
this.CheckUserReadPermissions('Vector Indexes', userPayload);
|
|
14996
|
-
const sSQL = `SELECT * FROM [
|
|
15040
|
+
const sSQL = `SELECT * FROM [__mj].[vwVectorIndexes] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Vector Indexes', userPayload, EntityPermissionType.Read, 'AND');
|
|
14997
15041
|
const result = this.MapFieldNamesToCodeNames('Vector Indexes', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
14998
15042
|
return result;
|
|
14999
15043
|
}
|
|
@@ -15084,8 +15128,8 @@ export class EntityDocumentType_ {
|
|
|
15084
15128
|
@MaxLength(8)
|
|
15085
15129
|
UpdatedAt: Date;
|
|
15086
15130
|
|
|
15087
|
-
@Field(() => [EntityDocument_])
|
|
15088
|
-
EntityDocumentsArray: EntityDocument_[]; // Link to EntityDocuments
|
|
15131
|
+
@Field(() => [mj_core_schema_server_object_types.EntityDocument_])
|
|
15132
|
+
EntityDocumentsArray: mj_core_schema_server_object_types.EntityDocument_[]; // Link to EntityDocuments
|
|
15089
15133
|
|
|
15090
15134
|
}
|
|
15091
15135
|
|
|
@@ -15162,17 +15206,17 @@ export class EntityDocumentTypeResolver extends ResolverBase {
|
|
|
15162
15206
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
15163
15207
|
}
|
|
15164
15208
|
@Query(() => EntityDocumentType_, { nullable: true })
|
|
15165
|
-
async EntityDocumentType(@Arg('ID', () => Int) ID:
|
|
15209
|
+
async EntityDocumentType(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<EntityDocumentType_ | null> {
|
|
15166
15210
|
this.CheckUserReadPermissions('Entity Document Types', userPayload);
|
|
15167
|
-
const sSQL = `SELECT * FROM [
|
|
15211
|
+
const sSQL = `SELECT * FROM [__mj].[vwEntityDocumentTypes] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Entity Document Types', userPayload, EntityPermissionType.Read, 'AND');
|
|
15168
15212
|
const result = this.MapFieldNamesToCodeNames('Entity Document Types', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
15169
15213
|
return result;
|
|
15170
15214
|
}
|
|
15171
15215
|
|
|
15172
|
-
@FieldResolver(() => [EntityDocument_])
|
|
15216
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.EntityDocument_])
|
|
15173
15217
|
async EntityDocumentsArray(@Root() entitydocumenttype_: EntityDocumentType_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
15174
15218
|
this.CheckUserReadPermissions('Entity Documents', userPayload);
|
|
15175
|
-
const sSQL = `SELECT * FROM [
|
|
15219
|
+
const sSQL = `SELECT * FROM [__mj].[vwEntityDocuments] WHERE [TypeID]=${entitydocumenttype_.ID} ` + this.getRowLevelSecurityWhereClause('Entity Documents', userPayload, EntityPermissionType.Read, 'AND');
|
|
15176
15220
|
const result = this.ArrayMapFieldNamesToCodeNames('Entity Documents', await dataSource.query(sSQL));
|
|
15177
15221
|
return result;
|
|
15178
15222
|
}
|
|
@@ -15362,9 +15406,9 @@ export class EntityDocumentRunResolver extends ResolverBase {
|
|
|
15362
15406
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
15363
15407
|
}
|
|
15364
15408
|
@Query(() => EntityDocumentRun_, { nullable: true })
|
|
15365
|
-
async EntityDocumentRun(@Arg('ID', () => Int) ID:
|
|
15409
|
+
async EntityDocumentRun(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<EntityDocumentRun_ | null> {
|
|
15366
15410
|
this.CheckUserReadPermissions('Entity Document Runs', userPayload);
|
|
15367
|
-
const sSQL = `SELECT * FROM [
|
|
15411
|
+
const sSQL = `SELECT * FROM [__mj].[vwEntityDocumentRuns] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Entity Document Runs', userPayload, EntityPermissionType.Read, 'AND');
|
|
15368
15412
|
const result = this.MapFieldNamesToCodeNames('Entity Document Runs', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
15369
15413
|
return result;
|
|
15370
15414
|
}
|
|
@@ -15463,8 +15507,8 @@ export class VectorDatabase_ {
|
|
|
15463
15507
|
@MaxLength(8)
|
|
15464
15508
|
UpdatedAt: Date;
|
|
15465
15509
|
|
|
15466
|
-
@Field(() => [VectorIndex_])
|
|
15467
|
-
VectorIndexesArray: VectorIndex_[]; // Link to VectorIndexes
|
|
15510
|
+
@Field(() => [mj_core_schema_server_object_types.VectorIndex_])
|
|
15511
|
+
VectorIndexesArray: mj_core_schema_server_object_types.VectorIndex_[]; // Link to VectorIndexes
|
|
15468
15512
|
|
|
15469
15513
|
}
|
|
15470
15514
|
|
|
@@ -15553,17 +15597,17 @@ export class VectorDatabaseResolver extends ResolverBase {
|
|
|
15553
15597
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
15554
15598
|
}
|
|
15555
15599
|
@Query(() => VectorDatabase_, { nullable: true })
|
|
15556
|
-
async VectorDatabase(@Arg('ID', () => Int) ID:
|
|
15600
|
+
async VectorDatabase(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<VectorDatabase_ | null> {
|
|
15557
15601
|
this.CheckUserReadPermissions('Vector Databases', userPayload);
|
|
15558
|
-
const sSQL = `SELECT * FROM [
|
|
15602
|
+
const sSQL = `SELECT * FROM [__mj].[vwVectorDatabases] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Vector Databases', userPayload, EntityPermissionType.Read, 'AND');
|
|
15559
15603
|
const result = this.MapFieldNamesToCodeNames('Vector Databases', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
15560
15604
|
return result;
|
|
15561
15605
|
}
|
|
15562
15606
|
|
|
15563
|
-
@FieldResolver(() => [VectorIndex_])
|
|
15607
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.VectorIndex_])
|
|
15564
15608
|
async VectorIndexesArray(@Root() vectordatabase_: VectorDatabase_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
15565
15609
|
this.CheckUserReadPermissions('Vector Indexes', userPayload);
|
|
15566
|
-
const sSQL = `SELECT * FROM [
|
|
15610
|
+
const sSQL = `SELECT * FROM [__mj].[vwVectorIndexes] WHERE [VectorDatabaseID]=${vectordatabase_.ID} ` + this.getRowLevelSecurityWhereClause('Vector Indexes', userPayload, EntityPermissionType.Read, 'AND');
|
|
15567
15611
|
const result = this.ArrayMapFieldNamesToCodeNames('Vector Indexes', await dataSource.query(sSQL));
|
|
15568
15612
|
return result;
|
|
15569
15613
|
}
|
|
@@ -15776,9 +15820,9 @@ export class EntityRecordDocumentResolver extends ResolverBase {
|
|
|
15776
15820
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
15777
15821
|
}
|
|
15778
15822
|
@Query(() => EntityRecordDocument_, { nullable: true })
|
|
15779
|
-
async EntityRecordDocument(@Arg('ID', () => Int) ID:
|
|
15823
|
+
async EntityRecordDocument(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<EntityRecordDocument_ | null> {
|
|
15780
15824
|
this.CheckUserReadPermissions('Entity Record Documents', userPayload);
|
|
15781
|
-
const sSQL = `SELECT * FROM [
|
|
15825
|
+
const sSQL = `SELECT * FROM [__mj].[vwEntityRecordDocuments] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Entity Record Documents', userPayload, EntityPermissionType.Read, 'AND');
|
|
15782
15826
|
const result = this.MapFieldNamesToCodeNames('Entity Record Documents', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
15783
15827
|
return result;
|
|
15784
15828
|
}
|
|
@@ -15879,12 +15923,16 @@ export class EntityDocument_ {
|
|
|
15879
15923
|
@MaxLength(8)
|
|
15880
15924
|
UpdatedAt: Date;
|
|
15881
15925
|
|
|
15926
|
+
@Field()
|
|
15927
|
+
@MaxLength(510)
|
|
15928
|
+
Entity: string;
|
|
15929
|
+
|
|
15882
15930
|
@Field()
|
|
15883
15931
|
@MaxLength(200)
|
|
15884
15932
|
Type: string;
|
|
15885
15933
|
|
|
15886
|
-
@Field(() => [EntityDocumentRun_])
|
|
15887
|
-
EntityDocumentRunsArray: EntityDocumentRun_[]; // Link to EntityDocumentRuns
|
|
15934
|
+
@Field(() => [mj_core_schema_server_object_types.EntityDocumentRun_])
|
|
15935
|
+
EntityDocumentRunsArray: mj_core_schema_server_object_types.EntityDocumentRun_[]; // Link to EntityDocumentRuns
|
|
15888
15936
|
|
|
15889
15937
|
}
|
|
15890
15938
|
|
|
@@ -15979,17 +16027,17 @@ export class EntityDocumentResolver extends ResolverBase {
|
|
|
15979
16027
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
15980
16028
|
}
|
|
15981
16029
|
@Query(() => EntityDocument_, { nullable: true })
|
|
15982
|
-
async EntityDocument(@Arg('ID', () => Int) ID:
|
|
16030
|
+
async EntityDocument(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<EntityDocument_ | null> {
|
|
15983
16031
|
this.CheckUserReadPermissions('Entity Documents', userPayload);
|
|
15984
|
-
const sSQL = `SELECT * FROM [
|
|
16032
|
+
const sSQL = `SELECT * FROM [__mj].[vwEntityDocuments] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Entity Documents', userPayload, EntityPermissionType.Read, 'AND');
|
|
15985
16033
|
const result = this.MapFieldNamesToCodeNames('Entity Documents', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
15986
16034
|
return result;
|
|
15987
16035
|
}
|
|
15988
16036
|
|
|
15989
|
-
@FieldResolver(() => [EntityDocumentRun_])
|
|
16037
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.EntityDocumentRun_])
|
|
15990
16038
|
async EntityDocumentRunsArray(@Root() entitydocument_: EntityDocument_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
15991
16039
|
this.CheckUserReadPermissions('Entity Document Runs', userPayload);
|
|
15992
|
-
const sSQL = `SELECT * FROM [
|
|
16040
|
+
const sSQL = `SELECT * FROM [__mj].[vwEntityDocumentRuns] WHERE [EntityDocumentID]=${entitydocument_.ID} ` + this.getRowLevelSecurityWhereClause('Entity Document Runs', userPayload, EntityPermissionType.Read, 'AND');
|
|
15993
16041
|
const result = this.ArrayMapFieldNamesToCodeNames('Entity Document Runs', await dataSource.query(sSQL));
|
|
15994
16042
|
return result;
|
|
15995
16043
|
}
|
|
@@ -16114,6 +16162,10 @@ export class DataContextItem_ {
|
|
|
16114
16162
|
@Field({nullable: true})
|
|
16115
16163
|
@MaxLength(510)
|
|
16116
16164
|
Query?: string;
|
|
16165
|
+
|
|
16166
|
+
@Field({nullable: true})
|
|
16167
|
+
@MaxLength(510)
|
|
16168
|
+
Entity?: string;
|
|
16117
16169
|
|
|
16118
16170
|
}
|
|
16119
16171
|
|
|
@@ -16232,9 +16284,9 @@ export class DataContextItemResolver extends ResolverBase {
|
|
|
16232
16284
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
16233
16285
|
}
|
|
16234
16286
|
@Query(() => DataContextItem_, { nullable: true })
|
|
16235
|
-
async DataContextItem(@Arg('ID', () => Int) ID:
|
|
16287
|
+
async DataContextItem(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<DataContextItem_ | null> {
|
|
16236
16288
|
this.CheckUserReadPermissions('Data Context Items', userPayload);
|
|
16237
|
-
const sSQL = `SELECT * FROM [
|
|
16289
|
+
const sSQL = `SELECT * FROM [__mj].[vwDataContextItems] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Data Context Items', userPayload, EntityPermissionType.Read, 'AND');
|
|
16238
16290
|
const result = this.MapFieldNamesToCodeNames('Data Context Items', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
16239
16291
|
return result;
|
|
16240
16292
|
}
|
|
@@ -16336,11 +16388,11 @@ export class DataContext_ {
|
|
|
16336
16388
|
@MaxLength(200)
|
|
16337
16389
|
User: string;
|
|
16338
16390
|
|
|
16339
|
-
@Field(() => [DataContextItem_])
|
|
16340
|
-
DataContextItemsArray: DataContextItem_[]; // Link to DataContextItems
|
|
16391
|
+
@Field(() => [mj_core_schema_server_object_types.DataContextItem_])
|
|
16392
|
+
DataContextItemsArray: mj_core_schema_server_object_types.DataContextItem_[]; // Link to DataContextItems
|
|
16341
16393
|
|
|
16342
|
-
@Field(() => [Report_])
|
|
16343
|
-
ReportsArray: Report_[]; // Link to Reports
|
|
16394
|
+
@Field(() => [mj_core_schema_server_object_types.Report_])
|
|
16395
|
+
ReportsArray: mj_core_schema_server_object_types.Report_[]; // Link to Reports
|
|
16344
16396
|
|
|
16345
16397
|
}
|
|
16346
16398
|
|
|
@@ -16429,25 +16481,25 @@ export class DataContextResolver extends ResolverBase {
|
|
|
16429
16481
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
16430
16482
|
}
|
|
16431
16483
|
@Query(() => DataContext_, { nullable: true })
|
|
16432
|
-
async DataContext(@Arg('ID', () => Int) ID:
|
|
16484
|
+
async DataContext(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<DataContext_ | null> {
|
|
16433
16485
|
this.CheckUserReadPermissions('Data Contexts', userPayload);
|
|
16434
|
-
const sSQL = `SELECT * FROM [
|
|
16486
|
+
const sSQL = `SELECT * FROM [__mj].[vwDataContexts] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Data Contexts', userPayload, EntityPermissionType.Read, 'AND');
|
|
16435
16487
|
const result = this.MapFieldNamesToCodeNames('Data Contexts', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
16436
16488
|
return result;
|
|
16437
16489
|
}
|
|
16438
16490
|
|
|
16439
|
-
@FieldResolver(() => [DataContextItem_])
|
|
16491
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.DataContextItem_])
|
|
16440
16492
|
async DataContextItemsArray(@Root() datacontext_: DataContext_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
16441
16493
|
this.CheckUserReadPermissions('Data Context Items', userPayload);
|
|
16442
|
-
const sSQL = `SELECT * FROM [
|
|
16494
|
+
const sSQL = `SELECT * FROM [__mj].[vwDataContextItems] WHERE [DataContextID]=${datacontext_.ID} ` + this.getRowLevelSecurityWhereClause('Data Context Items', userPayload, EntityPermissionType.Read, 'AND');
|
|
16443
16495
|
const result = this.ArrayMapFieldNamesToCodeNames('Data Context Items', await dataSource.query(sSQL));
|
|
16444
16496
|
return result;
|
|
16445
16497
|
}
|
|
16446
16498
|
|
|
16447
|
-
@FieldResolver(() => [Report_])
|
|
16499
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.Report_])
|
|
16448
16500
|
async ReportsArray(@Root() datacontext_: DataContext_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
16449
16501
|
this.CheckUserReadPermissions('Reports', userPayload);
|
|
16450
|
-
const sSQL = `SELECT * FROM [
|
|
16502
|
+
const sSQL = `SELECT * FROM [__mj].[vwReports] WHERE [DataContextID]=${datacontext_.ID} ` + this.getRowLevelSecurityWhereClause('Reports', userPayload, EntityPermissionType.Read, 'AND');
|
|
16451
16503
|
const result = this.ArrayMapFieldNamesToCodeNames('Reports', await dataSource.query(sSQL));
|
|
16452
16504
|
return result;
|
|
16453
16505
|
}
|
|
@@ -16545,11 +16597,11 @@ export class UserViewCategory_ {
|
|
|
16545
16597
|
@MaxLength(200)
|
|
16546
16598
|
Parent?: string;
|
|
16547
16599
|
|
|
16548
|
-
@Field(() => [UserViewCategory_])
|
|
16549
|
-
UserViewCategoriesArray: UserViewCategory_[]; // Link to UserViewCategories
|
|
16600
|
+
@Field(() => [mj_core_schema_server_object_types.UserViewCategory_])
|
|
16601
|
+
UserViewCategoriesArray: mj_core_schema_server_object_types.UserViewCategory_[]; // Link to UserViewCategories
|
|
16550
16602
|
|
|
16551
|
-
@Field(() => [UserView_])
|
|
16552
|
-
UserViewsArray: UserView_[]; // Link to UserViews
|
|
16603
|
+
@Field(() => [mj_core_schema_server_object_types.UserView_])
|
|
16604
|
+
UserViewsArray: mj_core_schema_server_object_types.UserView_[]; // Link to UserViews
|
|
16553
16605
|
|
|
16554
16606
|
}
|
|
16555
16607
|
|
|
@@ -16632,25 +16684,25 @@ export class UserViewCategoryResolver extends ResolverBase {
|
|
|
16632
16684
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
16633
16685
|
}
|
|
16634
16686
|
@Query(() => UserViewCategory_, { nullable: true })
|
|
16635
|
-
async UserViewCategory(@Arg('ID', () => Int) ID:
|
|
16687
|
+
async UserViewCategory(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<UserViewCategory_ | null> {
|
|
16636
16688
|
this.CheckUserReadPermissions('User View Categories', userPayload);
|
|
16637
|
-
const sSQL = `SELECT * FROM [
|
|
16689
|
+
const sSQL = `SELECT * FROM [__mj].[vwUserViewCategories] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('User View Categories', userPayload, EntityPermissionType.Read, 'AND');
|
|
16638
16690
|
const result = this.MapFieldNamesToCodeNames('User View Categories', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
16639
16691
|
return result;
|
|
16640
16692
|
}
|
|
16641
16693
|
|
|
16642
|
-
@FieldResolver(() => [UserViewCategory_])
|
|
16694
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.UserViewCategory_])
|
|
16643
16695
|
async UserViewCategoriesArray(@Root() userviewcategory_: UserViewCategory_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
16644
16696
|
this.CheckUserReadPermissions('User View Categories', userPayload);
|
|
16645
|
-
const sSQL = `SELECT * FROM [
|
|
16697
|
+
const sSQL = `SELECT * FROM [__mj].[vwUserViewCategories] WHERE [ParentID]=${userviewcategory_.ID} ` + this.getRowLevelSecurityWhereClause('User View Categories', userPayload, EntityPermissionType.Read, 'AND');
|
|
16646
16698
|
const result = this.ArrayMapFieldNamesToCodeNames('User View Categories', await dataSource.query(sSQL));
|
|
16647
16699
|
return result;
|
|
16648
16700
|
}
|
|
16649
16701
|
|
|
16650
|
-
@FieldResolver(() => [UserView_])
|
|
16702
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.UserView_])
|
|
16651
16703
|
async UserViewsArray(@Root() userviewcategory_: UserViewCategory_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
16652
16704
|
this.CheckUserReadPermissions('User Views', userPayload);
|
|
16653
|
-
const sSQL = `SELECT * FROM [
|
|
16705
|
+
const sSQL = `SELECT * FROM [__mj].[vwUserViews] WHERE [CategoryID]=${userviewcategory_.ID} ` + this.getRowLevelSecurityWhereClause('User Views', userPayload, EntityPermissionType.Read, 'AND');
|
|
16654
16706
|
const result = this.ArrayMapFieldNamesToCodeNames('User Views', await dataSource.query(sSQL));
|
|
16655
16707
|
return result;
|
|
16656
16708
|
}
|
|
@@ -16748,11 +16800,11 @@ export class DashboardCategory_ {
|
|
|
16748
16800
|
@MaxLength(200)
|
|
16749
16801
|
Parent?: string;
|
|
16750
16802
|
|
|
16751
|
-
@Field(() => [Dashboard_])
|
|
16752
|
-
DashboardsArray: Dashboard_[]; // Link to Dashboards
|
|
16803
|
+
@Field(() => [mj_core_schema_server_object_types.Dashboard_])
|
|
16804
|
+
DashboardsArray: mj_core_schema_server_object_types.Dashboard_[]; // Link to Dashboards
|
|
16753
16805
|
|
|
16754
|
-
@Field(() => [DashboardCategory_])
|
|
16755
|
-
DashboardCategoriesArray: DashboardCategory_[]; // Link to DashboardCategories
|
|
16806
|
+
@Field(() => [mj_core_schema_server_object_types.DashboardCategory_])
|
|
16807
|
+
DashboardCategoriesArray: mj_core_schema_server_object_types.DashboardCategory_[]; // Link to DashboardCategories
|
|
16756
16808
|
|
|
16757
16809
|
}
|
|
16758
16810
|
|
|
@@ -16838,25 +16890,25 @@ export class DashboardCategoryResolver extends ResolverBase {
|
|
|
16838
16890
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
16839
16891
|
}
|
|
16840
16892
|
@Query(() => DashboardCategory_, { nullable: true })
|
|
16841
|
-
async DashboardCategory(@Arg('ID', () => Int) ID:
|
|
16893
|
+
async DashboardCategory(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<DashboardCategory_ | null> {
|
|
16842
16894
|
this.CheckUserReadPermissions('Dashboard Categories', userPayload);
|
|
16843
|
-
const sSQL = `SELECT * FROM [
|
|
16895
|
+
const sSQL = `SELECT * FROM [__mj].[vwDashboardCategories] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Dashboard Categories', userPayload, EntityPermissionType.Read, 'AND');
|
|
16844
16896
|
const result = this.MapFieldNamesToCodeNames('Dashboard Categories', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
16845
16897
|
return result;
|
|
16846
16898
|
}
|
|
16847
16899
|
|
|
16848
|
-
@FieldResolver(() => [Dashboard_])
|
|
16900
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.Dashboard_])
|
|
16849
16901
|
async DashboardsArray(@Root() dashboardcategory_: DashboardCategory_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
16850
16902
|
this.CheckUserReadPermissions('Dashboards', userPayload);
|
|
16851
|
-
const sSQL = `SELECT * FROM [
|
|
16903
|
+
const sSQL = `SELECT * FROM [__mj].[vwDashboards] WHERE [CategoryID]=${dashboardcategory_.ID} ` + this.getRowLevelSecurityWhereClause('Dashboards', userPayload, EntityPermissionType.Read, 'AND');
|
|
16852
16904
|
const result = this.ArrayMapFieldNamesToCodeNames('Dashboards', await dataSource.query(sSQL));
|
|
16853
16905
|
return result;
|
|
16854
16906
|
}
|
|
16855
16907
|
|
|
16856
|
-
@FieldResolver(() => [DashboardCategory_])
|
|
16908
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.DashboardCategory_])
|
|
16857
16909
|
async DashboardCategoriesArray(@Root() dashboardcategory_: DashboardCategory_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
16858
16910
|
this.CheckUserReadPermissions('Dashboard Categories', userPayload);
|
|
16859
|
-
const sSQL = `SELECT * FROM [
|
|
16911
|
+
const sSQL = `SELECT * FROM [__mj].[vwDashboardCategories] WHERE [ParentID]=${dashboardcategory_.ID} ` + this.getRowLevelSecurityWhereClause('Dashboard Categories', userPayload, EntityPermissionType.Read, 'AND');
|
|
16860
16912
|
const result = this.ArrayMapFieldNamesToCodeNames('Dashboard Categories', await dataSource.query(sSQL));
|
|
16861
16913
|
return result;
|
|
16862
16914
|
}
|
|
@@ -16954,11 +17006,11 @@ export class ReportCategory_ {
|
|
|
16954
17006
|
@MaxLength(200)
|
|
16955
17007
|
Parent: string;
|
|
16956
17008
|
|
|
16957
|
-
@Field(() => [ReportCategory_])
|
|
16958
|
-
ReportCategoriesArray: ReportCategory_[]; // Link to ReportCategories
|
|
17009
|
+
@Field(() => [mj_core_schema_server_object_types.ReportCategory_])
|
|
17010
|
+
ReportCategoriesArray: mj_core_schema_server_object_types.ReportCategory_[]; // Link to ReportCategories
|
|
16959
17011
|
|
|
16960
|
-
@Field(() => [Report_])
|
|
16961
|
-
ReportsArray: Report_[]; // Link to Reports
|
|
17012
|
+
@Field(() => [mj_core_schema_server_object_types.Report_])
|
|
17013
|
+
ReportsArray: mj_core_schema_server_object_types.Report_[]; // Link to Reports
|
|
16962
17014
|
|
|
16963
17015
|
}
|
|
16964
17016
|
|
|
@@ -17041,25 +17093,25 @@ export class ReportCategoryResolver extends ResolverBase {
|
|
|
17041
17093
|
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
17042
17094
|
}
|
|
17043
17095
|
@Query(() => ReportCategory_, { nullable: true })
|
|
17044
|
-
async ReportCategory(@Arg('ID', () => Int) ID:
|
|
17096
|
+
async ReportCategory(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<ReportCategory_ | null> {
|
|
17045
17097
|
this.CheckUserReadPermissions('Report Categories', userPayload);
|
|
17046
|
-
const sSQL = `SELECT * FROM [
|
|
17098
|
+
const sSQL = `SELECT * FROM [__mj].[vwReportCategories] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Report Categories', userPayload, EntityPermissionType.Read, 'AND');
|
|
17047
17099
|
const result = this.MapFieldNamesToCodeNames('Report Categories', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
17048
17100
|
return result;
|
|
17049
17101
|
}
|
|
17050
17102
|
|
|
17051
|
-
@FieldResolver(() => [ReportCategory_])
|
|
17103
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.ReportCategory_])
|
|
17052
17104
|
async ReportCategoriesArray(@Root() reportcategory_: ReportCategory_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
17053
17105
|
this.CheckUserReadPermissions('Report Categories', userPayload);
|
|
17054
|
-
const sSQL = `SELECT * FROM [
|
|
17106
|
+
const sSQL = `SELECT * FROM [__mj].[vwReportCategories] WHERE [ParentID]=${reportcategory_.ID} ` + this.getRowLevelSecurityWhereClause('Report Categories', userPayload, EntityPermissionType.Read, 'AND');
|
|
17055
17107
|
const result = this.ArrayMapFieldNamesToCodeNames('Report Categories', await dataSource.query(sSQL));
|
|
17056
17108
|
return result;
|
|
17057
17109
|
}
|
|
17058
17110
|
|
|
17059
|
-
@FieldResolver(() => [Report_])
|
|
17111
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.Report_])
|
|
17060
17112
|
async ReportsArray(@Root() reportcategory_: ReportCategory_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
17061
17113
|
this.CheckUserReadPermissions('Reports', userPayload);
|
|
17062
|
-
const sSQL = `SELECT * FROM [
|
|
17114
|
+
const sSQL = `SELECT * FROM [__mj].[vwReports] WHERE [CategoryID]=${reportcategory_.ID} ` + this.getRowLevelSecurityWhereClause('Reports', userPayload, EntityPermissionType.Read, 'AND');
|
|
17063
17115
|
const result = this.ArrayMapFieldNamesToCodeNames('Reports', await dataSource.query(sSQL));
|
|
17064
17116
|
return result;
|
|
17065
17117
|
}
|