@memberjunction/server 0.9.234 → 0.9.236

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.
Files changed (76) hide show
  1. package/build.log.json +7 -1
  2. package/dist/entitySubclasses/userViewEntity.server.d.ts.map +1 -0
  3. package/dist/generated/generated.d.ts.map +1 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/resolvers/AskSkipResolver.d.ts.map +1 -0
  6. package/dist/resolvers/AskSkipResolver.js +4 -0
  7. package/dist/resolvers/AskSkipResolver.js.map +1 -1
  8. package/dist/resolvers/ColorResolver.d.ts.map +1 -0
  9. package/dist/resolvers/EntityResolver.d.ts.map +1 -0
  10. package/dist/resolvers/UserFavoriteResolver.d.ts.map +1 -0
  11. package/dist/resolvers/UserResolver.d.ts.map +1 -0
  12. package/dist/resolvers/UserViewResolver.d.ts.map +1 -0
  13. package/package.json +11 -11
  14. package/src/generated/generated.ts +1301 -344
  15. package/src/resolvers/AskSkipResolver.ts +4 -0
  16. package/tsconfig.json +30 -28
  17. package/dist/apolloServer/TransactionPlugin.js +0 -49
  18. package/dist/apolloServer/TransactionPlugin.js.map +0 -1
  19. package/dist/apolloServer/index.js +0 -27
  20. package/dist/apolloServer/index.js.map +0 -1
  21. package/dist/auth/exampleNewUserSubClass.js +0 -54
  22. package/dist/auth/exampleNewUserSubClass.js.map +0 -1
  23. package/dist/auth/index.js +0 -129
  24. package/dist/auth/index.js.map +0 -1
  25. package/dist/auth/newUsers.js +0 -66
  26. package/dist/auth/newUsers.js.map +0 -1
  27. package/dist/auth/tokenExpiredError.js +0 -16
  28. package/dist/auth/tokenExpiredError.js.map +0 -1
  29. package/dist/cache.js +0 -11
  30. package/dist/cache.js.map +0 -1
  31. package/dist/config.js +0 -69
  32. package/dist/config.js.map +0 -1
  33. package/dist/context.js +0 -111
  34. package/dist/context.js.map +0 -1
  35. package/dist/directives/Public.js +0 -34
  36. package/dist/directives/Public.js.map +0 -1
  37. package/dist/directives/index.js +0 -18
  38. package/dist/directives/index.js.map +0 -1
  39. package/dist/generated/generated.js +0 -23173
  40. package/dist/generated/generated.js.map +0 -1
  41. package/dist/generic/PushStatusResolver.js +0 -58
  42. package/dist/generic/PushStatusResolver.js.map +0 -1
  43. package/dist/generic/ResolverBase.js +0 -232
  44. package/dist/generic/ResolverBase.js.map +0 -1
  45. package/dist/generic/RunViewResolver.js +0 -401
  46. package/dist/generic/RunViewResolver.js.map +0 -1
  47. package/dist/index.js +0 -135
  48. package/dist/index.js.map +0 -1
  49. package/dist/orm.js +0 -34
  50. package/dist/orm.js.map +0 -1
  51. package/dist/resolvers/ColorResolver.js +0 -94
  52. package/dist/resolvers/ColorResolver.js.map +0 -1
  53. package/dist/resolvers/DatasetResolver.js +0 -168
  54. package/dist/resolvers/DatasetResolver.js.map +0 -1
  55. package/dist/resolvers/EntityRecordNameResolver.js +0 -112
  56. package/dist/resolvers/EntityRecordNameResolver.js.map +0 -1
  57. package/dist/resolvers/EntityResolver.js +0 -60
  58. package/dist/resolvers/EntityResolver.js.map +0 -1
  59. package/dist/resolvers/MergeRecordsResolver.js +0 -283
  60. package/dist/resolvers/MergeRecordsResolver.js.map +0 -1
  61. package/dist/resolvers/PotentialDuplicateRecordResolver.js +0 -97
  62. package/dist/resolvers/PotentialDuplicateRecordResolver.js.map +0 -1
  63. package/dist/resolvers/QueryResolver.js +0 -74
  64. package/dist/resolvers/QueryResolver.js.map +0 -1
  65. package/dist/resolvers/ReportResolver.js +0 -160
  66. package/dist/resolvers/ReportResolver.js.map +0 -1
  67. package/dist/resolvers/UserFavoriteResolver.js +0 -162
  68. package/dist/resolvers/UserFavoriteResolver.js.map +0 -1
  69. package/dist/resolvers/UserResolver.js +0 -70
  70. package/dist/resolvers/UserResolver.js.map +0 -1
  71. package/dist/resolvers/UserViewResolver.js +0 -102
  72. package/dist/resolvers/UserViewResolver.js.map +0 -1
  73. package/dist/types.js +0 -3
  74. package/dist/types.js.map +0 -1
  75. package/dist/util.js +0 -89
  76. package/dist/util.js.map +0 -1
@@ -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: 3/10/2024, 9:40:58 AM
5
+ * GENERATED: 3/17/2024, 7:51:53 PM
6
6
  *
7
7
  * >>> DO NOT MODIFY THIS FILE!!!!!!!!!!!!
8
8
  * >>> YOUR CHANGES WILL BE OVERWRITTEN
@@ -20,7 +20,7 @@ import { mj_core_schema } from '../config';
20
20
 
21
21
  import * as mj_core_schema_server_object_types from '@memberjunction/server'
22
22
 
23
- 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';
23
+ 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, FileStorageProviderEntity, FileEntity, FileCategoryEntity, FileEntityRecordLinkEntity } from '@memberjunction/core-entities';
24
24
 
25
25
 
26
26
  //****************************************************************************
@@ -97,7 +97,7 @@ export class CreateCompanyInput {
97
97
  //****************************************************************************
98
98
  @InputType()
99
99
  export class UpdateCompanyInput {
100
- @Field(() => Int, )
100
+ @Field(() => Int)
101
101
  ID: number;
102
102
 
103
103
  @Field()
@@ -392,10 +392,10 @@ export class CreateEmployeeInput {
392
392
  @Field({ nullable: true })
393
393
  Phone: string;
394
394
 
395
- @Field(() => Boolean, )
395
+ @Field(() => Boolean)
396
396
  Active: boolean;
397
397
 
398
- @Field(() => Int, )
398
+ @Field(() => Int)
399
399
  CompanyID: number;
400
400
 
401
401
  @Field(() => Int, { nullable: true })
@@ -408,7 +408,7 @@ export class CreateEmployeeInput {
408
408
  //****************************************************************************
409
409
  @InputType()
410
410
  export class UpdateEmployeeInput {
411
- @Field(() => Int, )
411
+ @Field(() => Int)
412
412
  ID: number;
413
413
 
414
414
  @Field()
@@ -426,10 +426,10 @@ export class UpdateEmployeeInput {
426
426
  @Field({ nullable: true })
427
427
  Phone: string;
428
428
 
429
- @Field(() => Boolean, )
429
+ @Field(() => Boolean)
430
430
  Active: boolean;
431
431
 
432
- @Field(() => Int, )
432
+ @Field(() => Int)
433
433
  CompanyID: number;
434
434
 
435
435
  @Field(() => Int, { nullable: true })
@@ -662,10 +662,10 @@ export class UserFavorite_ {
662
662
  //****************************************************************************
663
663
  @InputType()
664
664
  export class CreateUserFavoriteInput {
665
- @Field(() => Int, )
665
+ @Field(() => Int)
666
666
  UserID: number;
667
667
 
668
- @Field(() => Int, )
668
+ @Field(() => Int)
669
669
  EntityID: number;
670
670
 
671
671
  @Field()
@@ -678,13 +678,13 @@ export class CreateUserFavoriteInput {
678
678
  //****************************************************************************
679
679
  @InputType()
680
680
  export class UpdateUserFavoriteInput {
681
- @Field(() => Int, )
681
+ @Field(() => Int)
682
682
  ID: number;
683
683
 
684
- @Field(() => Int, )
684
+ @Field(() => Int)
685
685
  UserID: number;
686
686
 
687
- @Field(() => Int, )
687
+ @Field(() => Int)
688
688
  EntityID: number;
689
689
 
690
690
  @Field()
@@ -868,19 +868,19 @@ export class EmployeeCompanyIntegration_ {
868
868
  //****************************************************************************
869
869
  @InputType()
870
870
  export class UpdateEmployeeCompanyIntegrationInput {
871
- @Field(() => Int, )
871
+ @Field(() => Int)
872
872
  ID: number;
873
873
 
874
- @Field(() => Int, )
874
+ @Field(() => Int)
875
875
  EmployeeID: number;
876
876
 
877
- @Field(() => Int, )
877
+ @Field(() => Int)
878
878
  CompanyIntegrationID: number;
879
879
 
880
880
  @Field()
881
881
  ExternalSystemRecordID: string;
882
882
 
883
- @Field(() => Boolean, )
883
+ @Field(() => Boolean)
884
884
  IsActive: boolean;
885
885
  }
886
886
 
@@ -1002,13 +1002,13 @@ export class EmployeeRole_ {
1002
1002
  //****************************************************************************
1003
1003
  @InputType()
1004
1004
  export class UpdateEmployeeRoleInput {
1005
- @Field(() => Int, )
1005
+ @Field(() => Int)
1006
1006
  ID: number;
1007
1007
 
1008
- @Field(() => Int, )
1008
+ @Field(() => Int)
1009
1009
  EmployeeID: number;
1010
1010
 
1011
- @Field(() => Int, )
1011
+ @Field(() => Int)
1012
1012
  RoleID: number;
1013
1013
  }
1014
1014
 
@@ -1130,13 +1130,13 @@ export class EmployeeSkill_ {
1130
1130
  //****************************************************************************
1131
1131
  @InputType()
1132
1132
  export class UpdateEmployeeSkillInput {
1133
- @Field(() => Int, )
1133
+ @Field(() => Int)
1134
1134
  ID: number;
1135
1135
 
1136
- @Field(() => Int, )
1136
+ @Field(() => Int)
1137
1137
  EmployeeID: number;
1138
1138
 
1139
- @Field(() => Int, )
1139
+ @Field(() => Int)
1140
1140
  SkillID: number;
1141
1141
  }
1142
1142
 
@@ -1279,7 +1279,7 @@ export class Role_ {
1279
1279
  //****************************************************************************
1280
1280
  @InputType()
1281
1281
  export class UpdateRoleInput {
1282
- @Field(() => Int, )
1282
+ @Field(() => Int)
1283
1283
  ID: number;
1284
1284
 
1285
1285
  @Field()
@@ -1581,13 +1581,13 @@ export class IntegrationURLFormat_ {
1581
1581
  //****************************************************************************
1582
1582
  @InputType()
1583
1583
  export class UpdateIntegrationURLFormatInput {
1584
- @Field(() => Int, )
1584
+ @Field(() => Int)
1585
1585
  ID: number;
1586
1586
 
1587
1587
  @Field({ nullable: true })
1588
1588
  IntegrationName: string;
1589
1589
 
1590
- @Field(() => Int, )
1590
+ @Field(() => Int)
1591
1591
  EntityID: number;
1592
1592
 
1593
1593
  @Field()
@@ -1742,7 +1742,7 @@ export class Integration_ {
1742
1742
  //****************************************************************************
1743
1743
  @InputType()
1744
1744
  export class UpdateIntegrationInput {
1745
- @Field(() => Int, )
1745
+ @Field(() => Int)
1746
1746
  ID: number;
1747
1747
 
1748
1748
  @Field()
@@ -1760,10 +1760,10 @@ export class UpdateIntegrationInput {
1760
1760
  @Field({ nullable: true })
1761
1761
  ImportPath: string;
1762
1762
 
1763
- @Field(() => Int, )
1763
+ @Field(() => Int)
1764
1764
  BatchMaxRequestCount: number;
1765
1765
 
1766
- @Field(() => Int, )
1766
+ @Field(() => Int)
1767
1767
  BatchRequestWaitTime: number;
1768
1768
  }
1769
1769
 
@@ -1990,7 +1990,7 @@ export class CompanyIntegration_ {
1990
1990
  //****************************************************************************
1991
1991
  @InputType()
1992
1992
  export class UpdateCompanyIntegrationInput {
1993
- @Field(() => Int, )
1993
+ @Field(() => Int)
1994
1994
  ID: number;
1995
1995
 
1996
1996
  @Field()
@@ -2017,7 +2017,7 @@ export class UpdateCompanyIntegrationInput {
2017
2017
  @Field({ nullable: true })
2018
2018
  ExternalSystemID: string;
2019
2019
 
2020
- @Field(() => Boolean, )
2020
+ @Field(() => Boolean)
2021
2021
  IsExternalSystemReadOnly: boolean;
2022
2022
 
2023
2023
  @Field({ nullable: true })
@@ -2340,13 +2340,13 @@ export class CreateEntityFieldInput {
2340
2340
  @Field({ nullable: true })
2341
2341
  Description: string;
2342
2342
 
2343
- @Field(() => Boolean, )
2343
+ @Field(() => Boolean)
2344
2344
  AutoUpdateDescription: boolean;
2345
2345
 
2346
- @Field(() => Boolean, )
2346
+ @Field(() => Boolean)
2347
2347
  IsPrimaryKey: boolean;
2348
2348
 
2349
- @Field(() => Boolean, )
2349
+ @Field(() => Boolean)
2350
2350
  IsUnique: boolean;
2351
2351
 
2352
2352
  @Field({ nullable: true })
@@ -2358,7 +2358,7 @@ export class CreateEntityFieldInput {
2358
2358
  @Field({ nullable: true })
2359
2359
  ExtendedType: string;
2360
2360
 
2361
- @Field(() => Boolean, )
2361
+ @Field(() => Boolean)
2362
2362
  DefaultInView: boolean;
2363
2363
 
2364
2364
  @Field({ nullable: true })
@@ -2367,28 +2367,28 @@ export class CreateEntityFieldInput {
2367
2367
  @Field(() => Int, { nullable: true })
2368
2368
  DefaultColumnWidth: number;
2369
2369
 
2370
- @Field(() => Boolean, )
2370
+ @Field(() => Boolean)
2371
2371
  AllowUpdateAPI: boolean;
2372
2372
 
2373
- @Field(() => Boolean, )
2373
+ @Field(() => Boolean)
2374
2374
  AllowUpdateInView: boolean;
2375
2375
 
2376
- @Field(() => Boolean, )
2376
+ @Field(() => Boolean)
2377
2377
  IncludeInUserSearchAPI: boolean;
2378
2378
 
2379
- @Field(() => Boolean, )
2379
+ @Field(() => Boolean)
2380
2380
  FullTextSearchEnabled: boolean;
2381
2381
 
2382
2382
  @Field({ nullable: true })
2383
2383
  UserSearchParamFormatAPI: string;
2384
2384
 
2385
- @Field(() => Boolean, )
2385
+ @Field(() => Boolean)
2386
2386
  IncludeInGeneratedForm: boolean;
2387
2387
 
2388
2388
  @Field()
2389
2389
  GeneratedFormSection: string;
2390
2390
 
2391
- @Field(() => Boolean, )
2391
+ @Field(() => Boolean)
2392
2392
  IsNameField: boolean;
2393
2393
 
2394
2394
  @Field(() => Int, { nullable: true })
@@ -2397,7 +2397,7 @@ export class CreateEntityFieldInput {
2397
2397
  @Field({ nullable: true })
2398
2398
  RelatedEntityFieldName: string;
2399
2399
 
2400
- @Field(() => Boolean, )
2400
+ @Field(() => Boolean)
2401
2401
  IncludeRelatedEntityNameFieldInBaseView: boolean;
2402
2402
 
2403
2403
  @Field({ nullable: true })
@@ -2410,7 +2410,7 @@ export class CreateEntityFieldInput {
2410
2410
  //****************************************************************************
2411
2411
  @InputType()
2412
2412
  export class UpdateEntityFieldInput {
2413
- @Field(() => Int, )
2413
+ @Field(() => Int)
2414
2414
  ID: number;
2415
2415
 
2416
2416
  @Field({ nullable: true })
@@ -2419,13 +2419,13 @@ export class UpdateEntityFieldInput {
2419
2419
  @Field({ nullable: true })
2420
2420
  Description: string;
2421
2421
 
2422
- @Field(() => Boolean, )
2422
+ @Field(() => Boolean)
2423
2423
  AutoUpdateDescription: boolean;
2424
2424
 
2425
- @Field(() => Boolean, )
2425
+ @Field(() => Boolean)
2426
2426
  IsPrimaryKey: boolean;
2427
2427
 
2428
- @Field(() => Boolean, )
2428
+ @Field(() => Boolean)
2429
2429
  IsUnique: boolean;
2430
2430
 
2431
2431
  @Field({ nullable: true })
@@ -2437,7 +2437,7 @@ export class UpdateEntityFieldInput {
2437
2437
  @Field({ nullable: true })
2438
2438
  ExtendedType: string;
2439
2439
 
2440
- @Field(() => Boolean, )
2440
+ @Field(() => Boolean)
2441
2441
  DefaultInView: boolean;
2442
2442
 
2443
2443
  @Field({ nullable: true })
@@ -2446,28 +2446,28 @@ export class UpdateEntityFieldInput {
2446
2446
  @Field(() => Int, { nullable: true })
2447
2447
  DefaultColumnWidth: number;
2448
2448
 
2449
- @Field(() => Boolean, )
2449
+ @Field(() => Boolean)
2450
2450
  AllowUpdateAPI: boolean;
2451
2451
 
2452
- @Field(() => Boolean, )
2452
+ @Field(() => Boolean)
2453
2453
  AllowUpdateInView: boolean;
2454
2454
 
2455
- @Field(() => Boolean, )
2455
+ @Field(() => Boolean)
2456
2456
  IncludeInUserSearchAPI: boolean;
2457
2457
 
2458
- @Field(() => Boolean, )
2458
+ @Field(() => Boolean)
2459
2459
  FullTextSearchEnabled: boolean;
2460
2460
 
2461
2461
  @Field({ nullable: true })
2462
2462
  UserSearchParamFormatAPI: string;
2463
2463
 
2464
- @Field(() => Boolean, )
2464
+ @Field(() => Boolean)
2465
2465
  IncludeInGeneratedForm: boolean;
2466
2466
 
2467
2467
  @Field()
2468
2468
  GeneratedFormSection: string;
2469
2469
 
2470
- @Field(() => Boolean, )
2470
+ @Field(() => Boolean)
2471
2471
  IsNameField: boolean;
2472
2472
 
2473
2473
  @Field(() => Int, { nullable: true })
@@ -2476,7 +2476,7 @@ export class UpdateEntityFieldInput {
2476
2476
  @Field({ nullable: true })
2477
2477
  RelatedEntityFieldName: string;
2478
2478
 
2479
- @Field(() => Boolean, )
2479
+ @Field(() => Boolean)
2480
2480
  IncludeRelatedEntityNameFieldInBaseView: boolean;
2481
2481
 
2482
2482
  @Field({ nullable: true })
@@ -2885,6 +2885,9 @@ export class Entity_ {
2885
2885
  @Field(() => [mj_core_schema_server_object_types.EntityRecordDocument_])
2886
2886
  EntityRecordDocumentsArray: mj_core_schema_server_object_types.EntityRecordDocument_[]; // Link to EntityRecordDocuments
2887
2887
 
2888
+ @Field(() => [mj_core_schema_server_object_types.FileEntityRecordLink_])
2889
+ FileEntityRecordLinksArray: mj_core_schema_server_object_types.FileEntityRecordLink_[]; // Link to FileEntityRecordLinks
2890
+
2888
2891
  }
2889
2892
 
2890
2893
  //****************************************************************************
@@ -2892,7 +2895,7 @@ export class Entity_ {
2892
2895
  //****************************************************************************
2893
2896
  @InputType()
2894
2897
  export class CreateEntityInput {
2895
- @Field(() => Int, )
2898
+ @Field(() => Int)
2896
2899
  ID: number;
2897
2900
 
2898
2901
  @Field(() => Int, { nullable: true })
@@ -2907,67 +2910,67 @@ export class CreateEntityInput {
2907
2910
  @Field({ nullable: true })
2908
2911
  Description: string;
2909
2912
 
2910
- @Field(() => Boolean, )
2913
+ @Field(() => Boolean)
2911
2914
  AutoUpdateDescription: boolean;
2912
2915
 
2913
2916
  @Field()
2914
2917
  BaseView: string;
2915
2918
 
2916
- @Field(() => Boolean, )
2919
+ @Field(() => Boolean)
2917
2920
  BaseViewGenerated: boolean;
2918
2921
 
2919
- @Field(() => Boolean, )
2922
+ @Field(() => Boolean)
2920
2923
  VirtualEntity: boolean;
2921
2924
 
2922
- @Field(() => Boolean, )
2925
+ @Field(() => Boolean)
2923
2926
  TrackRecordChanges: boolean;
2924
2927
 
2925
- @Field(() => Boolean, )
2928
+ @Field(() => Boolean)
2926
2929
  AuditRecordAccess: boolean;
2927
2930
 
2928
- @Field(() => Boolean, )
2931
+ @Field(() => Boolean)
2929
2932
  AuditViewRuns: boolean;
2930
2933
 
2931
- @Field(() => Boolean, )
2934
+ @Field(() => Boolean)
2932
2935
  IncludeInAPI: boolean;
2933
2936
 
2934
- @Field(() => Boolean, )
2937
+ @Field(() => Boolean)
2935
2938
  AllowAllRowsAPI: boolean;
2936
2939
 
2937
- @Field(() => Boolean, )
2940
+ @Field(() => Boolean)
2938
2941
  AllowUpdateAPI: boolean;
2939
2942
 
2940
- @Field(() => Boolean, )
2943
+ @Field(() => Boolean)
2941
2944
  AllowCreateAPI: boolean;
2942
2945
 
2943
- @Field(() => Boolean, )
2946
+ @Field(() => Boolean)
2944
2947
  AllowDeleteAPI: boolean;
2945
2948
 
2946
- @Field(() => Boolean, )
2949
+ @Field(() => Boolean)
2947
2950
  CustomResolverAPI: boolean;
2948
2951
 
2949
- @Field(() => Boolean, )
2952
+ @Field(() => Boolean)
2950
2953
  AllowUserSearchAPI: boolean;
2951
2954
 
2952
- @Field(() => Boolean, )
2955
+ @Field(() => Boolean)
2953
2956
  FullTextSearchEnabled: boolean;
2954
2957
 
2955
2958
  @Field({ nullable: true })
2956
2959
  FullTextCatalog: string;
2957
2960
 
2958
- @Field(() => Boolean, )
2961
+ @Field(() => Boolean)
2959
2962
  FullTextCatalogGenerated: boolean;
2960
2963
 
2961
2964
  @Field({ nullable: true })
2962
2965
  FullTextIndex: string;
2963
2966
 
2964
- @Field(() => Boolean, )
2967
+ @Field(() => Boolean)
2965
2968
  FullTextIndexGenerated: boolean;
2966
2969
 
2967
2970
  @Field({ nullable: true })
2968
2971
  FullTextSearchFunction: string;
2969
2972
 
2970
- @Field(() => Boolean, )
2973
+ @Field(() => Boolean)
2971
2974
  FullTextSearchFunctionGenerated: boolean;
2972
2975
 
2973
2976
  @Field(() => Int, { nullable: true })
@@ -2982,19 +2985,19 @@ export class CreateEntityInput {
2982
2985
  @Field({ nullable: true })
2983
2986
  spDelete: string;
2984
2987
 
2985
- @Field(() => Boolean, )
2988
+ @Field(() => Boolean)
2986
2989
  spCreateGenerated: boolean;
2987
2990
 
2988
- @Field(() => Boolean, )
2991
+ @Field(() => Boolean)
2989
2992
  spUpdateGenerated: boolean;
2990
2993
 
2991
- @Field(() => Boolean, )
2994
+ @Field(() => Boolean)
2992
2995
  spDeleteGenerated: boolean;
2993
2996
 
2994
- @Field(() => Boolean, )
2997
+ @Field(() => Boolean)
2995
2998
  CascadeDeletes: boolean;
2996
2999
 
2997
- @Field(() => Boolean, )
3000
+ @Field(() => Boolean)
2998
3001
  UserFormGenerated: boolean;
2999
3002
 
3000
3003
  @Field({ nullable: true })
@@ -3010,7 +3013,7 @@ export class CreateEntityInput {
3010
3013
  //****************************************************************************
3011
3014
  @InputType()
3012
3015
  export class UpdateEntityInput {
3013
- @Field(() => Int, )
3016
+ @Field(() => Int)
3014
3017
  ID: number;
3015
3018
 
3016
3019
  @Field(() => Int, { nullable: true })
@@ -3025,67 +3028,67 @@ export class UpdateEntityInput {
3025
3028
  @Field({ nullable: true })
3026
3029
  Description: string;
3027
3030
 
3028
- @Field(() => Boolean, )
3031
+ @Field(() => Boolean)
3029
3032
  AutoUpdateDescription: boolean;
3030
3033
 
3031
3034
  @Field()
3032
3035
  BaseView: string;
3033
3036
 
3034
- @Field(() => Boolean, )
3037
+ @Field(() => Boolean)
3035
3038
  BaseViewGenerated: boolean;
3036
3039
 
3037
- @Field(() => Boolean, )
3040
+ @Field(() => Boolean)
3038
3041
  VirtualEntity: boolean;
3039
3042
 
3040
- @Field(() => Boolean, )
3043
+ @Field(() => Boolean)
3041
3044
  TrackRecordChanges: boolean;
3042
3045
 
3043
- @Field(() => Boolean, )
3046
+ @Field(() => Boolean)
3044
3047
  AuditRecordAccess: boolean;
3045
3048
 
3046
- @Field(() => Boolean, )
3049
+ @Field(() => Boolean)
3047
3050
  AuditViewRuns: boolean;
3048
3051
 
3049
- @Field(() => Boolean, )
3052
+ @Field(() => Boolean)
3050
3053
  IncludeInAPI: boolean;
3051
3054
 
3052
- @Field(() => Boolean, )
3055
+ @Field(() => Boolean)
3053
3056
  AllowAllRowsAPI: boolean;
3054
3057
 
3055
- @Field(() => Boolean, )
3058
+ @Field(() => Boolean)
3056
3059
  AllowUpdateAPI: boolean;
3057
3060
 
3058
- @Field(() => Boolean, )
3061
+ @Field(() => Boolean)
3059
3062
  AllowCreateAPI: boolean;
3060
3063
 
3061
- @Field(() => Boolean, )
3064
+ @Field(() => Boolean)
3062
3065
  AllowDeleteAPI: boolean;
3063
3066
 
3064
- @Field(() => Boolean, )
3067
+ @Field(() => Boolean)
3065
3068
  CustomResolverAPI: boolean;
3066
3069
 
3067
- @Field(() => Boolean, )
3070
+ @Field(() => Boolean)
3068
3071
  AllowUserSearchAPI: boolean;
3069
3072
 
3070
- @Field(() => Boolean, )
3073
+ @Field(() => Boolean)
3071
3074
  FullTextSearchEnabled: boolean;
3072
3075
 
3073
3076
  @Field({ nullable: true })
3074
3077
  FullTextCatalog: string;
3075
3078
 
3076
- @Field(() => Boolean, )
3079
+ @Field(() => Boolean)
3077
3080
  FullTextCatalogGenerated: boolean;
3078
3081
 
3079
3082
  @Field({ nullable: true })
3080
3083
  FullTextIndex: string;
3081
3084
 
3082
- @Field(() => Boolean, )
3085
+ @Field(() => Boolean)
3083
3086
  FullTextIndexGenerated: boolean;
3084
3087
 
3085
3088
  @Field({ nullable: true })
3086
3089
  FullTextSearchFunction: string;
3087
3090
 
3088
- @Field(() => Boolean, )
3091
+ @Field(() => Boolean)
3089
3092
  FullTextSearchFunctionGenerated: boolean;
3090
3093
 
3091
3094
  @Field(() => Int, { nullable: true })
@@ -3100,19 +3103,19 @@ export class UpdateEntityInput {
3100
3103
  @Field({ nullable: true })
3101
3104
  spDelete: string;
3102
3105
 
3103
- @Field(() => Boolean, )
3106
+ @Field(() => Boolean)
3104
3107
  spCreateGenerated: boolean;
3105
3108
 
3106
- @Field(() => Boolean, )
3109
+ @Field(() => Boolean)
3107
3110
  spUpdateGenerated: boolean;
3108
3111
 
3109
- @Field(() => Boolean, )
3112
+ @Field(() => Boolean)
3110
3113
  spDeleteGenerated: boolean;
3111
3114
 
3112
- @Field(() => Boolean, )
3115
+ @Field(() => Boolean)
3113
3116
  CascadeDeletes: boolean;
3114
3117
 
3115
- @Field(() => Boolean, )
3118
+ @Field(() => Boolean)
3116
3119
  UserFormGenerated: boolean;
3117
3120
 
3118
3121
  @Field({ nullable: true })
@@ -3389,6 +3392,14 @@ export class EntityResolverBase extends ResolverBase {
3389
3392
  const result = this.ArrayMapFieldNamesToCodeNames('Entity Record Documents', await dataSource.query(sSQL));
3390
3393
  return result;
3391
3394
  }
3395
+
3396
+ @FieldResolver(() => [mj_core_schema_server_object_types.FileEntityRecordLink_])
3397
+ async FileEntityRecordLinksArray(@Root() entity_: Entity_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
3398
+ this.CheckUserReadPermissions('File Entity Record Links', userPayload);
3399
+ const sSQL = `SELECT * FROM [${mj_core_schema}].[vwFileEntityRecordLinks] WHERE [EntityID]=${entity_.ID} ` + this.getRowLevelSecurityWhereClause('File Entity Record Links', userPayload, EntityPermissionType.Read, 'AND');
3400
+ const result = this.ArrayMapFieldNamesToCodeNames('File Entity Record Links', await dataSource.query(sSQL));
3401
+ return result;
3402
+ }
3392
3403
 
3393
3404
  @Mutation(() => Entity_)
3394
3405
  async CreateEntity(
@@ -3638,7 +3649,7 @@ export class CreateUserInput {
3638
3649
  @Field()
3639
3650
  Type: string;
3640
3651
 
3641
- @Field(() => Boolean, )
3652
+ @Field(() => Boolean)
3642
3653
  IsActive: boolean;
3643
3654
 
3644
3655
  @Field()
@@ -3660,7 +3671,7 @@ export class CreateUserInput {
3660
3671
  //****************************************************************************
3661
3672
  @InputType()
3662
3673
  export class UpdateUserInput {
3663
- @Field(() => Int, )
3674
+ @Field(() => Int)
3664
3675
  ID: number;
3665
3676
 
3666
3677
  @Field()
@@ -3681,7 +3692,7 @@ export class UpdateUserInput {
3681
3692
  @Field()
3682
3693
  Type: string;
3683
3694
 
3684
- @Field(() => Boolean, )
3695
+ @Field(() => Boolean)
3685
3696
  IsActive: boolean;
3686
3697
 
3687
3698
  @Field()
@@ -3962,6 +3973,32 @@ export class UserResolverBase extends ResolverBase {
3962
3973
  const i = input, d = dataSource; // prevent error
3963
3974
  }
3964
3975
 
3976
+ @Mutation(() => User_)
3977
+ async DeleteUser(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
3978
+ if (await this.BeforeDelete(dataSource, ID)) { // fire event and proceed if it wasn't cancelled
3979
+ const entityObject = <UserEntity>await new Metadata().GetEntityObject('Users', this.GetUserFromPayload(userPayload));
3980
+ await entityObject.Load(ID);
3981
+ const returnValue = entityObject.GetAll(); // grab the values before we delete so we can return last state before delete if we are successful.
3982
+ if (await entityObject.Delete()) {
3983
+ await this.AfterDelete(dataSource, ID); // fire event
3984
+ return returnValue;
3985
+ }
3986
+ else
3987
+ return null; // delete failed, this will cause an exception
3988
+ }
3989
+ else
3990
+ return null; // BeforeDelete canceled the operation, this will cause an exception
3991
+ }
3992
+
3993
+ // Before/After UPDATE Event Hooks for Sub-Classes to Override
3994
+ protected async BeforeDelete(dataSource: DataSource, ID: number): Promise<boolean> {
3995
+ const i = ID, d = dataSource; // prevent error;
3996
+ return true;
3997
+ }
3998
+ protected async AfterDelete(dataSource: DataSource, ID: number) {
3999
+ const i = ID, d = dataSource; // prevent error
4000
+ }
4001
+
3965
4002
  }
3966
4003
 
3967
4004
  //****************************************************************************
@@ -4077,16 +4114,16 @@ export class EntityRelationship_ {
4077
4114
  //****************************************************************************
4078
4115
  @InputType()
4079
4116
  export class CreateEntityRelationshipInput {
4080
- @Field(() => Int, )
4117
+ @Field(() => Int)
4081
4118
  EntityID: number;
4082
4119
 
4083
- @Field(() => Int, )
4120
+ @Field(() => Int)
4084
4121
  RelatedEntityID: number;
4085
4122
 
4086
- @Field(() => Boolean, )
4123
+ @Field(() => Boolean)
4087
4124
  BundleInAPI: boolean;
4088
4125
 
4089
- @Field(() => Boolean, )
4126
+ @Field(() => Boolean)
4090
4127
  IncludeInParentAllQuery: boolean;
4091
4128
 
4092
4129
  @Field()
@@ -4107,7 +4144,7 @@ export class CreateEntityRelationshipInput {
4107
4144
  @Field({ nullable: true })
4108
4145
  JoinEntityInverseJoinField: string;
4109
4146
 
4110
- @Field(() => Boolean, )
4147
+ @Field(() => Boolean)
4111
4148
  DisplayInForm: boolean;
4112
4149
 
4113
4150
  @Field({ nullable: true })
@@ -4120,19 +4157,19 @@ export class CreateEntityRelationshipInput {
4120
4157
  //****************************************************************************
4121
4158
  @InputType()
4122
4159
  export class UpdateEntityRelationshipInput {
4123
- @Field(() => Int, )
4160
+ @Field(() => Int)
4124
4161
  ID: number;
4125
4162
 
4126
- @Field(() => Int, )
4163
+ @Field(() => Int)
4127
4164
  EntityID: number;
4128
4165
 
4129
- @Field(() => Int, )
4166
+ @Field(() => Int)
4130
4167
  RelatedEntityID: number;
4131
4168
 
4132
- @Field(() => Boolean, )
4169
+ @Field(() => Boolean)
4133
4170
  BundleInAPI: boolean;
4134
4171
 
4135
- @Field(() => Boolean, )
4172
+ @Field(() => Boolean)
4136
4173
  IncludeInParentAllQuery: boolean;
4137
4174
 
4138
4175
  @Field()
@@ -4153,7 +4190,7 @@ export class UpdateEntityRelationshipInput {
4153
4190
  @Field({ nullable: true })
4154
4191
  JoinEntityInverseJoinField: string;
4155
4192
 
4156
- @Field(() => Boolean, )
4193
+ @Field(() => Boolean)
4157
4194
  DisplayInForm: boolean;
4158
4195
 
4159
4196
  @Field({ nullable: true })
@@ -4369,13 +4406,13 @@ export class UserRecordLog_ {
4369
4406
  //****************************************************************************
4370
4407
  @InputType()
4371
4408
  export class UpdateUserRecordLogInput {
4372
- @Field(() => Int, )
4409
+ @Field(() => Int)
4373
4410
  ID: number;
4374
4411
 
4375
- @Field(() => Int, )
4412
+ @Field(() => Int)
4376
4413
  UserID: number;
4377
4414
 
4378
- @Field(() => Int, )
4415
+ @Field(() => Int)
4379
4416
  EntityID: number;
4380
4417
 
4381
4418
  @Field()
@@ -4387,7 +4424,7 @@ export class UpdateUserRecordLogInput {
4387
4424
  @Field()
4388
4425
  LatestAt: Date;
4389
4426
 
4390
- @Field(() => Int, )
4427
+ @Field(() => Int)
4391
4428
  TotalCount: number;
4392
4429
  }
4393
4430
 
@@ -4588,10 +4625,10 @@ export class UserView_ {
4588
4625
  //****************************************************************************
4589
4626
  @InputType()
4590
4627
  export class CreateUserViewInput {
4591
- @Field(() => Int, )
4628
+ @Field(() => Int)
4592
4629
  UserID: number;
4593
4630
 
4594
- @Field(() => Int, )
4631
+ @Field(() => Int)
4595
4632
  EntityID: number;
4596
4633
 
4597
4634
  @Field()
@@ -4603,10 +4640,10 @@ export class CreateUserViewInput {
4603
4640
  @Field(() => Int, { nullable: true })
4604
4641
  CategoryID: number;
4605
4642
 
4606
- @Field(() => Boolean, )
4643
+ @Field(() => Boolean)
4607
4644
  IsShared: boolean;
4608
4645
 
4609
- @Field(() => Boolean, )
4646
+ @Field(() => Boolean)
4610
4647
  IsDefault: boolean;
4611
4648
 
4612
4649
  @Field({ nullable: true })
@@ -4615,10 +4652,10 @@ export class CreateUserViewInput {
4615
4652
  @Field({ nullable: true })
4616
4653
  FilterState: string;
4617
4654
 
4618
- @Field(() => Boolean, )
4655
+ @Field(() => Boolean)
4619
4656
  CustomFilterState: boolean;
4620
4657
 
4621
- @Field(() => Boolean, )
4658
+ @Field(() => Boolean)
4622
4659
  SmartFilterEnabled: boolean;
4623
4660
 
4624
4661
  @Field({ nullable: true })
@@ -4633,7 +4670,7 @@ export class CreateUserViewInput {
4633
4670
  @Field({ nullable: true })
4634
4671
  WhereClause: string;
4635
4672
 
4636
- @Field(() => Boolean, )
4673
+ @Field(() => Boolean)
4637
4674
  CustomWhereClause: boolean;
4638
4675
 
4639
4676
  @Field({ nullable: true })
@@ -4646,13 +4683,13 @@ export class CreateUserViewInput {
4646
4683
  //****************************************************************************
4647
4684
  @InputType()
4648
4685
  export class UpdateUserViewInput {
4649
- @Field(() => Int, )
4686
+ @Field(() => Int)
4650
4687
  ID: number;
4651
4688
 
4652
- @Field(() => Int, )
4689
+ @Field(() => Int)
4653
4690
  UserID: number;
4654
4691
 
4655
- @Field(() => Int, )
4692
+ @Field(() => Int)
4656
4693
  EntityID: number;
4657
4694
 
4658
4695
  @Field()
@@ -4664,10 +4701,10 @@ export class UpdateUserViewInput {
4664
4701
  @Field(() => Int, { nullable: true })
4665
4702
  CategoryID: number;
4666
4703
 
4667
- @Field(() => Boolean, )
4704
+ @Field(() => Boolean)
4668
4705
  IsShared: boolean;
4669
4706
 
4670
- @Field(() => Boolean, )
4707
+ @Field(() => Boolean)
4671
4708
  IsDefault: boolean;
4672
4709
 
4673
4710
  @Field({ nullable: true })
@@ -4676,10 +4713,10 @@ export class UpdateUserViewInput {
4676
4713
  @Field({ nullable: true })
4677
4714
  FilterState: string;
4678
4715
 
4679
- @Field(() => Boolean, )
4716
+ @Field(() => Boolean)
4680
4717
  CustomFilterState: boolean;
4681
4718
 
4682
- @Field(() => Boolean, )
4719
+ @Field(() => Boolean)
4683
4720
  SmartFilterEnabled: boolean;
4684
4721
 
4685
4722
  @Field({ nullable: true })
@@ -4694,7 +4731,7 @@ export class UpdateUserViewInput {
4694
4731
  @Field({ nullable: true })
4695
4732
  WhereClause: string;
4696
4733
 
4697
- @Field(() => Boolean, )
4734
+ @Field(() => Boolean)
4698
4735
  CustomWhereClause: boolean;
4699
4736
 
4700
4737
  @Field({ nullable: true })
@@ -4922,13 +4959,13 @@ export class CompanyIntegrationRun_ {
4922
4959
  //****************************************************************************
4923
4960
  @InputType()
4924
4961
  export class UpdateCompanyIntegrationRunInput {
4925
- @Field(() => Int, )
4962
+ @Field(() => Int)
4926
4963
  ID: number;
4927
4964
 
4928
- @Field(() => Int, )
4965
+ @Field(() => Int)
4929
4966
  CompanyIntegrationID: number;
4930
4967
 
4931
- @Field(() => Int, )
4968
+ @Field(() => Int)
4932
4969
  RunByUserID: number;
4933
4970
 
4934
4971
  @Field({ nullable: true })
@@ -4937,7 +4974,7 @@ export class UpdateCompanyIntegrationRunInput {
4937
4974
  @Field({ nullable: true })
4938
4975
  EndedAt: Date;
4939
4976
 
4940
- @Field(() => Int, )
4977
+ @Field(() => Int)
4941
4978
  TotalRecords: number;
4942
4979
 
4943
4980
  @Field({ nullable: true })
@@ -5104,13 +5141,13 @@ export class CompanyIntegrationRunDetail_ {
5104
5141
  //****************************************************************************
5105
5142
  @InputType()
5106
5143
  export class UpdateCompanyIntegrationRunDetailInput {
5107
- @Field(() => Int, )
5144
+ @Field(() => Int)
5108
5145
  ID: number;
5109
5146
 
5110
- @Field(() => Int, )
5147
+ @Field(() => Int)
5111
5148
  CompanyIntegrationRunID: number;
5112
5149
 
5113
- @Field(() => Int, )
5150
+ @Field(() => Int)
5114
5151
  EntityID: number;
5115
5152
 
5116
5153
  @Field()
@@ -5122,7 +5159,7 @@ export class UpdateCompanyIntegrationRunDetailInput {
5122
5159
  @Field()
5123
5160
  ExecutedAt: Date;
5124
5161
 
5125
- @Field(() => Boolean, )
5162
+ @Field(() => Boolean)
5126
5163
  IsSuccess: boolean;
5127
5164
  }
5128
5165
 
@@ -5266,7 +5303,7 @@ export class ErrorLog_ {
5266
5303
  //****************************************************************************
5267
5304
  @InputType()
5268
5305
  export class UpdateErrorLogInput {
5269
- @Field(() => Int, )
5306
+ @Field(() => Int)
5270
5307
  ID: number;
5271
5308
 
5272
5309
  @Field(() => Int, { nullable: true })
@@ -5416,7 +5453,7 @@ export class Application_ {
5416
5453
  //****************************************************************************
5417
5454
  @InputType()
5418
5455
  export class UpdateApplicationInput {
5419
- @Field(() => Int, )
5456
+ @Field(() => Int)
5420
5457
  ID: number;
5421
5458
 
5422
5459
  @Field()
@@ -5595,19 +5632,16 @@ export class ApplicationEntity_ {
5595
5632
  //****************************************************************************
5596
5633
  @InputType()
5597
5634
  export class CreateApplicationEntityInput {
5598
- @Field(() => Int, )
5599
- ID: number;
5600
-
5601
5635
  @Field({ nullable: true })
5602
5636
  ApplicationName: string;
5603
5637
 
5604
- @Field(() => Int, )
5638
+ @Field(() => Int)
5605
5639
  EntityID: number;
5606
5640
 
5607
- @Field(() => Int, )
5641
+ @Field(() => Int)
5608
5642
  Sequence: number;
5609
5643
 
5610
- @Field(() => Boolean, )
5644
+ @Field(() => Boolean)
5611
5645
  DefaultForNewUser: boolean;
5612
5646
  }
5613
5647
 
@@ -5617,19 +5651,19 @@ export class CreateApplicationEntityInput {
5617
5651
  //****************************************************************************
5618
5652
  @InputType()
5619
5653
  export class UpdateApplicationEntityInput {
5620
- @Field(() => Int, )
5654
+ @Field(() => Int)
5621
5655
  ID: number;
5622
5656
 
5623
5657
  @Field({ nullable: true })
5624
5658
  ApplicationName: string;
5625
5659
 
5626
- @Field(() => Int, )
5660
+ @Field(() => Int)
5627
5661
  EntityID: number;
5628
5662
 
5629
- @Field(() => Int, )
5663
+ @Field(() => Int)
5630
5664
  Sequence: number;
5631
5665
 
5632
- @Field(() => Boolean, )
5666
+ @Field(() => Boolean)
5633
5667
  DefaultForNewUser: boolean;
5634
5668
  }
5635
5669
 
@@ -5852,25 +5886,22 @@ export class EntityPermission_ {
5852
5886
  //****************************************************************************
5853
5887
  @InputType()
5854
5888
  export class CreateEntityPermissionInput {
5855
- @Field(() => Int, )
5856
- ID: number;
5857
-
5858
- @Field(() => Int, )
5889
+ @Field(() => Int)
5859
5890
  EntityID: number;
5860
5891
 
5861
5892
  @Field({ nullable: true })
5862
5893
  RoleName: string;
5863
5894
 
5864
- @Field(() => Boolean, )
5895
+ @Field(() => Boolean)
5865
5896
  CanCreate: boolean;
5866
5897
 
5867
- @Field(() => Boolean, )
5898
+ @Field(() => Boolean)
5868
5899
  CanRead: boolean;
5869
5900
 
5870
- @Field(() => Boolean, )
5901
+ @Field(() => Boolean)
5871
5902
  CanUpdate: boolean;
5872
5903
 
5873
- @Field(() => Boolean, )
5904
+ @Field(() => Boolean)
5874
5905
  CanDelete: boolean;
5875
5906
 
5876
5907
  @Field(() => Int, { nullable: true })
@@ -5892,25 +5923,25 @@ export class CreateEntityPermissionInput {
5892
5923
  //****************************************************************************
5893
5924
  @InputType()
5894
5925
  export class UpdateEntityPermissionInput {
5895
- @Field(() => Int, )
5926
+ @Field(() => Int)
5896
5927
  ID: number;
5897
5928
 
5898
- @Field(() => Int, )
5929
+ @Field(() => Int)
5899
5930
  EntityID: number;
5900
5931
 
5901
5932
  @Field({ nullable: true })
5902
5933
  RoleName: string;
5903
5934
 
5904
- @Field(() => Boolean, )
5935
+ @Field(() => Boolean)
5905
5936
  CanCreate: boolean;
5906
5937
 
5907
- @Field(() => Boolean, )
5938
+ @Field(() => Boolean)
5908
5939
  CanRead: boolean;
5909
5940
 
5910
- @Field(() => Boolean, )
5941
+ @Field(() => Boolean)
5911
5942
  CanUpdate: boolean;
5912
5943
 
5913
- @Field(() => Boolean, )
5944
+ @Field(() => Boolean)
5914
5945
  CanDelete: boolean;
5915
5946
 
5916
5947
  @Field(() => Int, { nullable: true })
@@ -6111,16 +6142,13 @@ export class UserApplicationEntity_ {
6111
6142
  //****************************************************************************
6112
6143
  @InputType()
6113
6144
  export class CreateUserApplicationEntityInput {
6114
- @Field(() => Int, )
6115
- ID: number;
6116
-
6117
- @Field(() => Int, )
6145
+ @Field(() => Int)
6118
6146
  UserApplicationID: number;
6119
6147
 
6120
- @Field(() => Int, )
6148
+ @Field(() => Int)
6121
6149
  EntityID: number;
6122
6150
 
6123
- @Field(() => Int, )
6151
+ @Field(() => Int)
6124
6152
  Sequence: number;
6125
6153
  }
6126
6154
 
@@ -6130,16 +6158,16 @@ export class CreateUserApplicationEntityInput {
6130
6158
  //****************************************************************************
6131
6159
  @InputType()
6132
6160
  export class UpdateUserApplicationEntityInput {
6133
- @Field(() => Int, )
6161
+ @Field(() => Int)
6134
6162
  ID: number;
6135
6163
 
6136
- @Field(() => Int, )
6164
+ @Field(() => Int)
6137
6165
  UserApplicationID: number;
6138
6166
 
6139
- @Field(() => Int, )
6167
+ @Field(() => Int)
6140
6168
  EntityID: number;
6141
6169
 
6142
- @Field(() => Int, )
6170
+ @Field(() => Int)
6143
6171
  Sequence: number;
6144
6172
  }
6145
6173
 
@@ -6322,19 +6350,19 @@ export class UserApplication_ {
6322
6350
  //****************************************************************************
6323
6351
  @InputType()
6324
6352
  export class UpdateUserApplicationInput {
6325
- @Field(() => Int, )
6353
+ @Field(() => Int)
6326
6354
  ID: number;
6327
6355
 
6328
- @Field(() => Int, )
6356
+ @Field(() => Int)
6329
6357
  UserID: number;
6330
6358
 
6331
- @Field(() => Int, )
6359
+ @Field(() => Int)
6332
6360
  ApplicationID: number;
6333
6361
 
6334
- @Field(() => Int, )
6362
+ @Field(() => Int)
6335
6363
  Sequence: number;
6336
6364
 
6337
- @Field(() => Boolean, )
6365
+ @Field(() => Boolean)
6338
6366
  IsActive: boolean;
6339
6367
  }
6340
6368
 
@@ -6429,6 +6457,32 @@ export class UserApplicationResolver extends ResolverBase {
6429
6457
  const i = input, d = dataSource; // prevent error
6430
6458
  }
6431
6459
 
6460
+ @Mutation(() => UserApplication_)
6461
+ async DeleteUserApplication(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
6462
+ if (await this.BeforeDelete(dataSource, ID)) { // fire event and proceed if it wasn't cancelled
6463
+ const entityObject = <UserApplicationEntity>await new Metadata().GetEntityObject('User Applications', this.GetUserFromPayload(userPayload));
6464
+ await entityObject.Load(ID);
6465
+ const returnValue = entityObject.GetAll(); // grab the values before we delete so we can return last state before delete if we are successful.
6466
+ if (await entityObject.Delete()) {
6467
+ await this.AfterDelete(dataSource, ID); // fire event
6468
+ return returnValue;
6469
+ }
6470
+ else
6471
+ return null; // delete failed, this will cause an exception
6472
+ }
6473
+ else
6474
+ return null; // BeforeDelete canceled the operation, this will cause an exception
6475
+ }
6476
+
6477
+ // Before/After UPDATE Event Hooks for Sub-Classes to Override
6478
+ protected async BeforeDelete(dataSource: DataSource, ID: number): Promise<boolean> {
6479
+ const i = ID, d = dataSource; // prevent error;
6480
+ return true;
6481
+ }
6482
+ protected async AfterDelete(dataSource: DataSource, ID: number) {
6483
+ const i = ID, d = dataSource; // prevent error
6484
+ }
6485
+
6432
6486
  }
6433
6487
 
6434
6488
  //****************************************************************************
@@ -6466,16 +6520,16 @@ export class CompanyIntegrationRunAPILog_ {
6466
6520
  //****************************************************************************
6467
6521
  @InputType()
6468
6522
  export class UpdateCompanyIntegrationRunAPILogInput {
6469
- @Field(() => Int, )
6523
+ @Field(() => Int)
6470
6524
  ID: number;
6471
6525
 
6472
- @Field(() => Int, )
6526
+ @Field(() => Int)
6473
6527
  CompanyIntegrationRunID: number;
6474
6528
 
6475
6529
  @Field()
6476
6530
  ExecutedAt: Date;
6477
6531
 
6478
- @Field(() => Boolean, )
6532
+ @Field(() => Boolean)
6479
6533
  IsSuccess: boolean;
6480
6534
 
6481
6535
  @Field({ nullable: true })
@@ -6627,9 +6681,6 @@ export class List_ {
6627
6681
  //****************************************************************************
6628
6682
  @InputType()
6629
6683
  export class CreateListInput {
6630
- @Field(() => Int, )
6631
- ID: number;
6632
-
6633
6684
  @Field()
6634
6685
  Name: string;
6635
6686
 
@@ -6639,7 +6690,7 @@ export class CreateListInput {
6639
6690
  @Field(() => Int, { nullable: true })
6640
6691
  EntityID: number;
6641
6692
 
6642
- @Field(() => Int, )
6693
+ @Field(() => Int)
6643
6694
  UserID: number;
6644
6695
 
6645
6696
  @Field({ nullable: true })
@@ -6655,7 +6706,7 @@ export class CreateListInput {
6655
6706
  //****************************************************************************
6656
6707
  @InputType()
6657
6708
  export class UpdateListInput {
6658
- @Field(() => Int, )
6709
+ @Field(() => Int)
6659
6710
  ID: number;
6660
6711
 
6661
6712
  @Field()
@@ -6667,7 +6718,7 @@ export class UpdateListInput {
6667
6718
  @Field(() => Int, { nullable: true })
6668
6719
  EntityID: number;
6669
6720
 
6670
- @Field(() => Int, )
6721
+ @Field(() => Int)
6671
6722
  UserID: number;
6672
6723
 
6673
6724
  @Field({ nullable: true })
@@ -6851,16 +6902,13 @@ export class ListDetail_ {
6851
6902
  //****************************************************************************
6852
6903
  @InputType()
6853
6904
  export class CreateListDetailInput {
6854
- @Field(() => Int, )
6855
- ID: number;
6856
-
6857
- @Field(() => Int, )
6905
+ @Field(() => Int)
6858
6906
  ListID: number;
6859
6907
 
6860
6908
  @Field()
6861
6909
  RecordID: string;
6862
6910
 
6863
- @Field(() => Int, )
6911
+ @Field(() => Int)
6864
6912
  Sequence: number;
6865
6913
  }
6866
6914
 
@@ -6870,16 +6918,16 @@ export class CreateListDetailInput {
6870
6918
  //****************************************************************************
6871
6919
  @InputType()
6872
6920
  export class UpdateListDetailInput {
6873
- @Field(() => Int, )
6921
+ @Field(() => Int)
6874
6922
  ID: number;
6875
6923
 
6876
- @Field(() => Int, )
6924
+ @Field(() => Int)
6877
6925
  ListID: number;
6878
6926
 
6879
6927
  @Field()
6880
6928
  RecordID: string;
6881
6929
 
6882
- @Field(() => Int, )
6930
+ @Field(() => Int)
6883
6931
  Sequence: number;
6884
6932
  }
6885
6933
 
@@ -7060,16 +7108,13 @@ export class UserViewRun_ {
7060
7108
  //****************************************************************************
7061
7109
  @InputType()
7062
7110
  export class CreateUserViewRunInput {
7063
- @Field(() => Int, )
7064
- ID: number;
7065
-
7066
- @Field(() => Int, )
7111
+ @Field(() => Int)
7067
7112
  UserViewID: number;
7068
7113
 
7069
7114
  @Field()
7070
7115
  RunAt: Date;
7071
7116
 
7072
- @Field(() => Int, )
7117
+ @Field(() => Int)
7073
7118
  RunByUserID: number;
7074
7119
  }
7075
7120
 
@@ -7079,16 +7124,16 @@ export class CreateUserViewRunInput {
7079
7124
  //****************************************************************************
7080
7125
  @InputType()
7081
7126
  export class UpdateUserViewRunInput {
7082
- @Field(() => Int, )
7127
+ @Field(() => Int)
7083
7128
  ID: number;
7084
7129
 
7085
- @Field(() => Int, )
7130
+ @Field(() => Int)
7086
7131
  UserViewID: number;
7087
7132
 
7088
7133
  @Field()
7089
7134
  RunAt: Date;
7090
7135
 
7091
- @Field(() => Int, )
7136
+ @Field(() => Int)
7092
7137
  RunByUserID: number;
7093
7138
  }
7094
7139
 
@@ -7243,10 +7288,7 @@ export class UserViewRunDetail_ {
7243
7288
  //****************************************************************************
7244
7289
  @InputType()
7245
7290
  export class CreateUserViewRunDetailInput {
7246
- @Field(() => Int, )
7247
- ID: number;
7248
-
7249
- @Field(() => Int, )
7291
+ @Field(() => Int)
7250
7292
  UserViewRunID: number;
7251
7293
 
7252
7294
  @Field()
@@ -7259,10 +7301,10 @@ export class CreateUserViewRunDetailInput {
7259
7301
  //****************************************************************************
7260
7302
  @InputType()
7261
7303
  export class UpdateUserViewRunDetailInput {
7262
- @Field(() => Int, )
7304
+ @Field(() => Int)
7263
7305
  ID: number;
7264
7306
 
7265
- @Field(() => Int, )
7307
+ @Field(() => Int)
7266
7308
  UserViewRunID: number;
7267
7309
 
7268
7310
  @Field()
@@ -7430,7 +7472,7 @@ export class WorkflowRun_ {
7430
7472
  //****************************************************************************
7431
7473
  @InputType()
7432
7474
  export class UpdateWorkflowRunInput {
7433
- @Field(() => Int, )
7475
+ @Field(() => Int)
7434
7476
  ID: number;
7435
7477
 
7436
7478
  @Field()
@@ -7585,7 +7627,7 @@ export class Workflow_ {
7585
7627
  //****************************************************************************
7586
7628
  @InputType()
7587
7629
  export class UpdateWorkflowInput {
7588
- @Field(() => Int, )
7630
+ @Field(() => Int)
7589
7631
  ID: number;
7590
7632
 
7591
7633
  @Field()
@@ -7746,7 +7788,7 @@ export class WorkflowEngine_ {
7746
7788
  //****************************************************************************
7747
7789
  @InputType()
7748
7790
  export class UpdateWorkflowEngineInput {
7749
- @Field(() => Int, )
7791
+ @Field(() => Int)
7750
7792
  ID: number;
7751
7793
 
7752
7794
  @Field()
@@ -7908,13 +7950,13 @@ export class RecordChange_ {
7908
7950
  //****************************************************************************
7909
7951
  @InputType()
7910
7952
  export class CreateRecordChangeInput {
7911
- @Field(() => Int, )
7953
+ @Field(() => Int)
7912
7954
  EntityID: number;
7913
7955
 
7914
7956
  @Field()
7915
7957
  RecordID: string;
7916
7958
 
7917
- @Field(() => Int, )
7959
+ @Field(() => Int)
7918
7960
  UserID: number;
7919
7961
 
7920
7962
  @Field()
@@ -8054,7 +8096,7 @@ export class UserRole_ {
8054
8096
  //****************************************************************************
8055
8097
  @InputType()
8056
8098
  export class CreateUserRoleInput {
8057
- @Field(() => Int, )
8099
+ @Field(() => Int)
8058
8100
  UserID: number;
8059
8101
 
8060
8102
  @Field()
@@ -8151,6 +8193,32 @@ export class UserRoleResolver extends ResolverBase {
8151
8193
  protected async AfterCreate(dataSource: DataSource, input: CreateUserRoleInput) {
8152
8194
  }
8153
8195
 
8196
+ @Mutation(() => UserRole_)
8197
+ async DeleteUserRole(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
8198
+ if (await this.BeforeDelete(dataSource, ID)) { // fire event and proceed if it wasn't cancelled
8199
+ const entityObject = <UserRoleEntity>await new Metadata().GetEntityObject('User Roles', this.GetUserFromPayload(userPayload));
8200
+ await entityObject.Load(ID);
8201
+ const returnValue = entityObject.GetAll(); // grab the values before we delete so we can return last state before delete if we are successful.
8202
+ if (await entityObject.Delete()) {
8203
+ await this.AfterDelete(dataSource, ID); // fire event
8204
+ return returnValue;
8205
+ }
8206
+ else
8207
+ return null; // delete failed, this will cause an exception
8208
+ }
8209
+ else
8210
+ return null; // BeforeDelete canceled the operation, this will cause an exception
8211
+ }
8212
+
8213
+ // Before/After UPDATE Event Hooks for Sub-Classes to Override
8214
+ protected async BeforeDelete(dataSource: DataSource, ID: number): Promise<boolean> {
8215
+ const i = ID, d = dataSource; // prevent error;
8216
+ return true;
8217
+ }
8218
+ protected async AfterDelete(dataSource: DataSource, ID: number) {
8219
+ const i = ID, d = dataSource; // prevent error
8220
+ }
8221
+
8154
8222
  }
8155
8223
 
8156
8224
  //****************************************************************************
@@ -8315,7 +8383,7 @@ export class CreateAuditLogInput {
8315
8383
  @Field({ nullable: true })
8316
8384
  AuditLogTypeName: string;
8317
8385
 
8318
- @Field(() => Int, )
8386
+ @Field(() => Int)
8319
8387
  UserID: number;
8320
8388
 
8321
8389
  @Field({ nullable: true })
@@ -8343,13 +8411,13 @@ export class CreateAuditLogInput {
8343
8411
  //****************************************************************************
8344
8412
  @InputType()
8345
8413
  export class UpdateAuditLogInput {
8346
- @Field(() => Int, )
8414
+ @Field(() => Int)
8347
8415
  ID: number;
8348
8416
 
8349
8417
  @Field({ nullable: true })
8350
8418
  AuditLogTypeName: string;
8351
8419
 
8352
- @Field(() => Int, )
8420
+ @Field(() => Int)
8353
8421
  UserID: number;
8354
8422
 
8355
8423
  @Field({ nullable: true })
@@ -8999,7 +9067,7 @@ export class AIModel_ {
8999
9067
  //****************************************************************************
9000
9068
  @InputType()
9001
9069
  export class UpdateAIModelInput {
9002
- @Field(() => Int, )
9070
+ @Field(() => Int)
9003
9071
  ID: number;
9004
9072
 
9005
9073
  @Field()
@@ -9008,7 +9076,7 @@ export class UpdateAIModelInput {
9008
9076
  @Field({ nullable: true })
9009
9077
  Vendor: string;
9010
9078
 
9011
- @Field(() => Int, )
9079
+ @Field(() => Int)
9012
9080
  AIModelTypeID: number;
9013
9081
 
9014
9082
  @Field({ nullable: true })
@@ -9020,7 +9088,7 @@ export class UpdateAIModelInput {
9020
9088
  @Field({ nullable: true })
9021
9089
  DriverImportPath: string;
9022
9090
 
9023
- @Field(() => Boolean, )
9091
+ @Field(() => Boolean)
9024
9092
  IsActive: boolean;
9025
9093
  }
9026
9094
 
@@ -9198,7 +9266,7 @@ export class AIAction_ {
9198
9266
  //****************************************************************************
9199
9267
  @InputType()
9200
9268
  export class UpdateAIActionInput {
9201
- @Field(() => Int, )
9269
+ @Field(() => Int)
9202
9270
  ID: number;
9203
9271
 
9204
9272
  @Field()
@@ -9213,7 +9281,7 @@ export class UpdateAIActionInput {
9213
9281
  @Field({ nullable: true })
9214
9282
  DefaultPrompt: string;
9215
9283
 
9216
- @Field(() => Boolean, )
9284
+ @Field(() => Boolean)
9217
9285
  IsActive: boolean;
9218
9286
  }
9219
9287
 
@@ -9366,16 +9434,16 @@ export class AIModelAction_ {
9366
9434
  //****************************************************************************
9367
9435
  @InputType()
9368
9436
  export class UpdateAIModelActionInput {
9369
- @Field(() => Int, )
9437
+ @Field(() => Int)
9370
9438
  ID: number;
9371
9439
 
9372
- @Field(() => Int, )
9440
+ @Field(() => Int)
9373
9441
  AIModelID: number;
9374
9442
 
9375
- @Field(() => Int, )
9443
+ @Field(() => Int)
9376
9444
  AIActionID: number;
9377
9445
 
9378
- @Field(() => Boolean, )
9446
+ @Field(() => Boolean)
9379
9447
  IsActive: boolean;
9380
9448
  }
9381
9449
 
@@ -9543,13 +9611,13 @@ export class EntityAIAction_ {
9543
9611
  //****************************************************************************
9544
9612
  @InputType()
9545
9613
  export class UpdateEntityAIActionInput {
9546
- @Field(() => Int, )
9614
+ @Field(() => Int)
9547
9615
  ID: number;
9548
9616
 
9549
- @Field(() => Int, )
9617
+ @Field(() => Int)
9550
9618
  EntityID: number;
9551
9619
 
9552
- @Field(() => Int, )
9620
+ @Field(() => Int)
9553
9621
  AIActionID: number;
9554
9622
 
9555
9623
  @Field(() => Int, { nullable: true })
@@ -9573,7 +9641,7 @@ export class UpdateEntityAIActionInput {
9573
9641
  @Field({ nullable: true })
9574
9642
  OutputField: string;
9575
9643
 
9576
- @Field(() => Boolean, )
9644
+ @Field(() => Boolean)
9577
9645
  SkipIfOutputFieldNotEmpty: boolean;
9578
9646
 
9579
9647
  @Field(() => Int, { nullable: true })
@@ -9701,7 +9769,7 @@ export class AIModelType_ {
9701
9769
  //****************************************************************************
9702
9770
  @InputType()
9703
9771
  export class UpdateAIModelTypeInput {
9704
- @Field(() => Int, )
9772
+ @Field(() => Int)
9705
9773
  ID: number;
9706
9774
 
9707
9775
  @Field()
@@ -10000,10 +10068,10 @@ export class CreateQueueInput {
10000
10068
  @Field({ nullable: true })
10001
10069
  Description: string;
10002
10070
 
10003
- @Field(() => Int, )
10071
+ @Field(() => Int)
10004
10072
  QueueTypeID: number;
10005
10073
 
10006
- @Field(() => Boolean, )
10074
+ @Field(() => Boolean)
10007
10075
  IsActive: boolean;
10008
10076
 
10009
10077
  @Field(() => Int, { nullable: true })
@@ -10049,7 +10117,7 @@ export class CreateQueueInput {
10049
10117
  //****************************************************************************
10050
10118
  @InputType()
10051
10119
  export class UpdateQueueInput {
10052
- @Field(() => Int, )
10120
+ @Field(() => Int)
10053
10121
  ID: number;
10054
10122
 
10055
10123
  @Field()
@@ -10058,10 +10126,10 @@ export class UpdateQueueInput {
10058
10126
  @Field({ nullable: true })
10059
10127
  Description: string;
10060
10128
 
10061
- @Field(() => Int, )
10129
+ @Field(() => Int)
10062
10130
  QueueTypeID: number;
10063
10131
 
10064
- @Field(() => Boolean, )
10132
+ @Field(() => Boolean)
10065
10133
  IsActive: boolean;
10066
10134
 
10067
10135
  @Field(() => Int, { nullable: true })
@@ -10269,7 +10337,7 @@ export class QueueTask_ {
10269
10337
  //****************************************************************************
10270
10338
  @InputType()
10271
10339
  export class CreateQueueTaskInput {
10272
- @Field(() => Int, )
10340
+ @Field(() => Int)
10273
10341
  QueueID: number;
10274
10342
 
10275
10343
  @Field()
@@ -10303,10 +10371,10 @@ export class CreateQueueTaskInput {
10303
10371
  //****************************************************************************
10304
10372
  @InputType()
10305
10373
  export class UpdateQueueTaskInput {
10306
- @Field(() => Int, )
10374
+ @Field(() => Int)
10307
10375
  ID: number;
10308
10376
 
10309
- @Field(() => Int, )
10377
+ @Field(() => Int)
10310
10378
  QueueID: number;
10311
10379
 
10312
10380
  @Field()
@@ -10510,7 +10578,7 @@ export class CreateDashboardInput {
10510
10578
  //****************************************************************************
10511
10579
  @InputType()
10512
10580
  export class UpdateDashboardInput {
10513
- @Field(() => Int, )
10581
+ @Field(() => Int)
10514
10582
  ID: number;
10515
10583
 
10516
10584
  @Field()
@@ -11039,7 +11107,7 @@ export class CreateReportInput {
11039
11107
  @Field(() => Int, { nullable: true })
11040
11108
  CategoryID: number;
11041
11109
 
11042
- @Field(() => Int, )
11110
+ @Field(() => Int)
11043
11111
  UserID: number;
11044
11112
 
11045
11113
  @Field()
@@ -11085,7 +11153,7 @@ export class CreateReportInput {
11085
11153
  //****************************************************************************
11086
11154
  @InputType()
11087
11155
  export class UpdateReportInput {
11088
- @Field(() => Int, )
11156
+ @Field(() => Int)
11089
11157
  ID: number;
11090
11158
 
11091
11159
  @Field()
@@ -11097,7 +11165,7 @@ export class UpdateReportInput {
11097
11165
  @Field(() => Int, { nullable: true })
11098
11166
  CategoryID: number;
11099
11167
 
11100
- @Field(() => Int, )
11168
+ @Field(() => Int)
11101
11169
  UserID: number;
11102
11170
 
11103
11171
  @Field()
@@ -11322,7 +11390,7 @@ export class ReportSnapshot_ {
11322
11390
  //****************************************************************************
11323
11391
  @InputType()
11324
11392
  export class CreateReportSnapshotInput {
11325
- @Field(() => Int, )
11393
+ @Field(() => Int)
11326
11394
  ReportID: number;
11327
11395
 
11328
11396
  @Field()
@@ -11338,10 +11406,10 @@ export class CreateReportSnapshotInput {
11338
11406
  //****************************************************************************
11339
11407
  @InputType()
11340
11408
  export class UpdateReportSnapshotInput {
11341
- @Field(() => Int, )
11409
+ @Field(() => Int)
11342
11410
  ID: number;
11343
11411
 
11344
- @Field(() => Int, )
11412
+ @Field(() => Int)
11345
11413
  ReportID: number;
11346
11414
 
11347
11415
  @Field()
@@ -11821,7 +11889,7 @@ export class CreateWorkspaceInput {
11821
11889
  @Field({ nullable: true })
11822
11890
  Description: string;
11823
11891
 
11824
- @Field(() => Int, )
11892
+ @Field(() => Int)
11825
11893
  UserID: number;
11826
11894
  }
11827
11895
 
@@ -11831,7 +11899,7 @@ export class CreateWorkspaceInput {
11831
11899
  //****************************************************************************
11832
11900
  @InputType()
11833
11901
  export class UpdateWorkspaceInput {
11834
- @Field(() => Int, )
11902
+ @Field(() => Int)
11835
11903
  ID: number;
11836
11904
 
11837
11905
  @Field()
@@ -11840,7 +11908,7 @@ export class UpdateWorkspaceInput {
11840
11908
  @Field({ nullable: true })
11841
11909
  Description: string;
11842
11910
 
11843
- @Field(() => Int, )
11911
+ @Field(() => Int)
11844
11912
  UserID: number;
11845
11913
  }
11846
11914
 
@@ -12046,16 +12114,16 @@ export class CreateWorkspaceItemInput {
12046
12114
  @Field({ nullable: true })
12047
12115
  Description: string;
12048
12116
 
12049
- @Field(() => Int, )
12117
+ @Field(() => Int)
12050
12118
  WorkSpaceID: number;
12051
12119
 
12052
- @Field(() => Int, )
12120
+ @Field(() => Int)
12053
12121
  ResourceTypeID: number;
12054
12122
 
12055
12123
  @Field({ nullable: true })
12056
12124
  ResourceRecordID: string;
12057
12125
 
12058
- @Field(() => Int, )
12126
+ @Field(() => Int)
12059
12127
  Sequence: number;
12060
12128
 
12061
12129
  @Field({ nullable: true })
@@ -12068,7 +12136,7 @@ export class CreateWorkspaceItemInput {
12068
12136
  //****************************************************************************
12069
12137
  @InputType()
12070
12138
  export class UpdateWorkspaceItemInput {
12071
- @Field(() => Int, )
12139
+ @Field(() => Int)
12072
12140
  ID: number;
12073
12141
 
12074
12142
  @Field()
@@ -12077,16 +12145,16 @@ export class UpdateWorkspaceItemInput {
12077
12145
  @Field({ nullable: true })
12078
12146
  Description: string;
12079
12147
 
12080
- @Field(() => Int, )
12148
+ @Field(() => Int)
12081
12149
  WorkSpaceID: number;
12082
12150
 
12083
- @Field(() => Int, )
12151
+ @Field(() => Int)
12084
12152
  ResourceTypeID: number;
12085
12153
 
12086
12154
  @Field({ nullable: true })
12087
12155
  ResourceRecordID: string;
12088
12156
 
12089
- @Field(() => Int, )
12157
+ @Field(() => Int)
12090
12158
  Sequence: number;
12091
12159
 
12092
12160
  @Field({ nullable: true })
@@ -12473,7 +12541,7 @@ export class ConversationDetail_ {
12473
12541
  //****************************************************************************
12474
12542
  @InputType()
12475
12543
  export class CreateConversationDetailInput {
12476
- @Field(() => Int, )
12544
+ @Field(() => Int)
12477
12545
  ConversationID: number;
12478
12546
 
12479
12547
  @Field({ nullable: true })
@@ -12488,7 +12556,7 @@ export class CreateConversationDetailInput {
12488
12556
  @Field({ nullable: true })
12489
12557
  Error: string;
12490
12558
 
12491
- @Field(() => Boolean, )
12559
+ @Field(() => Boolean)
12492
12560
  HiddenToUser: boolean;
12493
12561
  }
12494
12562
 
@@ -12498,10 +12566,10 @@ export class CreateConversationDetailInput {
12498
12566
  //****************************************************************************
12499
12567
  @InputType()
12500
12568
  export class UpdateConversationDetailInput {
12501
- @Field(() => Int, )
12569
+ @Field(() => Int)
12502
12570
  ID: number;
12503
12571
 
12504
- @Field(() => Int, )
12572
+ @Field(() => Int)
12505
12573
  ConversationID: number;
12506
12574
 
12507
12575
  @Field({ nullable: true })
@@ -12516,7 +12584,7 @@ export class UpdateConversationDetailInput {
12516
12584
  @Field({ nullable: true })
12517
12585
  Error: string;
12518
12586
 
12519
- @Field(() => Boolean, )
12587
+ @Field(() => Boolean)
12520
12588
  HiddenToUser: boolean;
12521
12589
  }
12522
12590
 
@@ -12736,7 +12804,7 @@ export class Conversation_ {
12736
12804
  //****************************************************************************
12737
12805
  @InputType()
12738
12806
  export class CreateConversationInput {
12739
- @Field(() => Int, )
12807
+ @Field(() => Int)
12740
12808
  UserID: number;
12741
12809
 
12742
12810
  @Field({ nullable: true })
@@ -12751,7 +12819,7 @@ export class CreateConversationInput {
12751
12819
  @Field()
12752
12820
  Type: string;
12753
12821
 
12754
- @Field(() => Boolean, )
12822
+ @Field(() => Boolean)
12755
12823
  IsArchived: boolean;
12756
12824
 
12757
12825
  @Field(() => Int, { nullable: true })
@@ -12770,10 +12838,10 @@ export class CreateConversationInput {
12770
12838
  //****************************************************************************
12771
12839
  @InputType()
12772
12840
  export class UpdateConversationInput {
12773
- @Field(() => Int, )
12841
+ @Field(() => Int)
12774
12842
  ID: number;
12775
12843
 
12776
- @Field(() => Int, )
12844
+ @Field(() => Int)
12777
12845
  UserID: number;
12778
12846
 
12779
12847
  @Field({ nullable: true })
@@ -12788,7 +12856,7 @@ export class UpdateConversationInput {
12788
12856
  @Field()
12789
12857
  Type: string;
12790
12858
 
12791
- @Field(() => Boolean, )
12859
+ @Field(() => Boolean)
12792
12860
  IsArchived: boolean;
12793
12861
 
12794
12862
  @Field(() => Int, { nullable: true })
@@ -13011,7 +13079,7 @@ export class UserNotification_ {
13011
13079
  //****************************************************************************
13012
13080
  @InputType()
13013
13081
  export class CreateUserNotificationInput {
13014
- @Field(() => Int, )
13082
+ @Field(() => Int)
13015
13083
  UserID: number;
13016
13084
 
13017
13085
  @Field({ nullable: true })
@@ -13029,7 +13097,7 @@ export class CreateUserNotificationInput {
13029
13097
  @Field({ nullable: true })
13030
13098
  ResourceConfiguration: string;
13031
13099
 
13032
- @Field(() => Boolean, )
13100
+ @Field(() => Boolean)
13033
13101
  Unread: boolean;
13034
13102
 
13035
13103
  @Field({ nullable: true })
@@ -13042,10 +13110,10 @@ export class CreateUserNotificationInput {
13042
13110
  //****************************************************************************
13043
13111
  @InputType()
13044
13112
  export class UpdateUserNotificationInput {
13045
- @Field(() => Int, )
13113
+ @Field(() => Int)
13046
13114
  ID: number;
13047
13115
 
13048
- @Field(() => Int, )
13116
+ @Field(() => Int)
13049
13117
  UserID: number;
13050
13118
 
13051
13119
  @Field({ nullable: true })
@@ -13063,7 +13131,7 @@ export class UpdateUserNotificationInput {
13063
13131
  @Field({ nullable: true })
13064
13132
  ResourceConfiguration: string;
13065
13133
 
13066
- @Field(() => Boolean, )
13134
+ @Field(() => Boolean)
13067
13135
  Unread: boolean;
13068
13136
 
13069
13137
  @Field({ nullable: true })
@@ -13183,6 +13251,32 @@ export class UserNotificationResolver extends ResolverBase {
13183
13251
  const i = input, d = dataSource; // prevent error
13184
13252
  }
13185
13253
 
13254
+ @Mutation(() => UserNotification_)
13255
+ async DeleteUserNotification(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
13256
+ if (await this.BeforeDelete(dataSource, ID)) { // fire event and proceed if it wasn't cancelled
13257
+ const entityObject = <UserNotificationEntity>await new Metadata().GetEntityObject('User Notifications', this.GetUserFromPayload(userPayload));
13258
+ await entityObject.Load(ID);
13259
+ const returnValue = entityObject.GetAll(); // grab the values before we delete so we can return last state before delete if we are successful.
13260
+ if (await entityObject.Delete()) {
13261
+ await this.AfterDelete(dataSource, ID); // fire event
13262
+ return returnValue;
13263
+ }
13264
+ else
13265
+ return null; // delete failed, this will cause an exception
13266
+ }
13267
+ else
13268
+ return null; // BeforeDelete canceled the operation, this will cause an exception
13269
+ }
13270
+
13271
+ // Before/After UPDATE Event Hooks for Sub-Classes to Override
13272
+ protected async BeforeDelete(dataSource: DataSource, ID: number): Promise<boolean> {
13273
+ const i = ID, d = dataSource; // prevent error;
13274
+ return true;
13275
+ }
13276
+ protected async AfterDelete(dataSource: DataSource, ID: number) {
13277
+ const i = ID, d = dataSource; // prevent error
13278
+ }
13279
+
13186
13280
  }
13187
13281
 
13188
13282
  //****************************************************************************
@@ -13224,10 +13318,10 @@ export class CreateSchemaInfoInput {
13224
13318
  @Field()
13225
13319
  SchemaName: string;
13226
13320
 
13227
- @Field(() => Int, )
13321
+ @Field(() => Int)
13228
13322
  EntityIDMin: number;
13229
13323
 
13230
- @Field(() => Int, )
13324
+ @Field(() => Int)
13231
13325
  EntityIDMax: number;
13232
13326
 
13233
13327
  @Field({ nullable: true })
@@ -13240,16 +13334,16 @@ export class CreateSchemaInfoInput {
13240
13334
  //****************************************************************************
13241
13335
  @InputType()
13242
13336
  export class UpdateSchemaInfoInput {
13243
- @Field(() => Int, )
13337
+ @Field(() => Int)
13244
13338
  ID: number;
13245
13339
 
13246
13340
  @Field()
13247
13341
  SchemaName: string;
13248
13342
 
13249
- @Field(() => Int, )
13343
+ @Field(() => Int)
13250
13344
  EntityIDMin: number;
13251
13345
 
13252
- @Field(() => Int, )
13346
+ @Field(() => Int)
13253
13347
  EntityIDMax: number;
13254
13348
 
13255
13349
  @Field({ nullable: true })
@@ -13412,13 +13506,13 @@ export class CompanyIntegrationRecordMap_ {
13412
13506
  //****************************************************************************
13413
13507
  @InputType()
13414
13508
  export class CreateCompanyIntegrationRecordMapInput {
13415
- @Field(() => Int, )
13509
+ @Field(() => Int)
13416
13510
  CompanyIntegrationID: number;
13417
13511
 
13418
13512
  @Field()
13419
13513
  ExternalSystemRecordID: string;
13420
13514
 
13421
- @Field(() => Int, )
13515
+ @Field(() => Int)
13422
13516
  EntityID: number;
13423
13517
 
13424
13518
  @Field()
@@ -13431,16 +13525,16 @@ export class CreateCompanyIntegrationRecordMapInput {
13431
13525
  //****************************************************************************
13432
13526
  @InputType()
13433
13527
  export class UpdateCompanyIntegrationRecordMapInput {
13434
- @Field(() => Int, )
13528
+ @Field(() => Int)
13435
13529
  ID: number;
13436
13530
 
13437
- @Field(() => Int, )
13531
+ @Field(() => Int)
13438
13532
  CompanyIntegrationID: number;
13439
13533
 
13440
13534
  @Field()
13441
13535
  ExternalSystemRecordID: string;
13442
13536
 
13443
- @Field(() => Int, )
13537
+ @Field(() => Int)
13444
13538
  EntityID: number;
13445
13539
 
13446
13540
  @Field()
@@ -13631,13 +13725,13 @@ export class RecordMergeLog_ {
13631
13725
  //****************************************************************************
13632
13726
  @InputType()
13633
13727
  export class CreateRecordMergeLogInput {
13634
- @Field(() => Int, )
13728
+ @Field(() => Int)
13635
13729
  EntityID: number;
13636
13730
 
13637
13731
  @Field()
13638
13732
  SurvivingRecordID: string;
13639
13733
 
13640
- @Field(() => Int, )
13734
+ @Field(() => Int)
13641
13735
  InitiatedByUserID: number;
13642
13736
 
13643
13737
  @Field()
@@ -13668,16 +13762,16 @@ export class CreateRecordMergeLogInput {
13668
13762
  //****************************************************************************
13669
13763
  @InputType()
13670
13764
  export class UpdateRecordMergeLogInput {
13671
- @Field(() => Int, )
13765
+ @Field(() => Int)
13672
13766
  ID: number;
13673
13767
 
13674
- @Field(() => Int, )
13768
+ @Field(() => Int)
13675
13769
  EntityID: number;
13676
13770
 
13677
13771
  @Field()
13678
13772
  SurvivingRecordID: string;
13679
13773
 
13680
- @Field(() => Int, )
13774
+ @Field(() => Int)
13681
13775
  InitiatedByUserID: number;
13682
13776
 
13683
13777
  @Field()
@@ -13862,7 +13956,7 @@ export class RecordMergeDeletionLog_ {
13862
13956
  //****************************************************************************
13863
13957
  @InputType()
13864
13958
  export class CreateRecordMergeDeletionLogInput {
13865
- @Field(() => Int, )
13959
+ @Field(() => Int)
13866
13960
  RecordMergeLogID: number;
13867
13961
 
13868
13962
  @Field()
@@ -13881,10 +13975,10 @@ export class CreateRecordMergeDeletionLogInput {
13881
13975
  //****************************************************************************
13882
13976
  @InputType()
13883
13977
  export class UpdateRecordMergeDeletionLogInput {
13884
- @Field(() => Int, )
13978
+ @Field(() => Int)
13885
13979
  ID: number;
13886
13980
 
13887
- @Field(() => Int, )
13981
+ @Field(() => Int)
13888
13982
  RecordMergeLogID: number;
13889
13983
 
13890
13984
  @Field()
@@ -14083,7 +14177,7 @@ export class QueryField_ {
14083
14177
  //****************************************************************************
14084
14178
  @InputType()
14085
14179
  export class CreateQueryFieldInput {
14086
- @Field(() => Int, )
14180
+ @Field(() => Int)
14087
14181
  QueryID: number;
14088
14182
 
14089
14183
  @Field()
@@ -14092,7 +14186,7 @@ export class CreateQueryFieldInput {
14092
14186
  @Field({ nullable: true })
14093
14187
  Description: string;
14094
14188
 
14095
- @Field(() => Int, )
14189
+ @Field(() => Int)
14096
14190
  Sequence: number;
14097
14191
 
14098
14192
  @Field()
@@ -14107,13 +14201,13 @@ export class CreateQueryFieldInput {
14107
14201
  @Field({ nullable: true })
14108
14202
  SourceFieldName: string;
14109
14203
 
14110
- @Field(() => Boolean, )
14204
+ @Field(() => Boolean)
14111
14205
  IsComputed: boolean;
14112
14206
 
14113
14207
  @Field({ nullable: true })
14114
14208
  ComputationDescription: string;
14115
14209
 
14116
- @Field(() => Boolean, )
14210
+ @Field(() => Boolean)
14117
14211
  IsSummary: boolean;
14118
14212
 
14119
14213
  @Field({ nullable: true })
@@ -14126,10 +14220,10 @@ export class CreateQueryFieldInput {
14126
14220
  //****************************************************************************
14127
14221
  @InputType()
14128
14222
  export class UpdateQueryFieldInput {
14129
- @Field(() => Int, )
14223
+ @Field(() => Int)
14130
14224
  ID: number;
14131
14225
 
14132
- @Field(() => Int, )
14226
+ @Field(() => Int)
14133
14227
  QueryID: number;
14134
14228
 
14135
14229
  @Field()
@@ -14138,7 +14232,7 @@ export class UpdateQueryFieldInput {
14138
14232
  @Field({ nullable: true })
14139
14233
  Description: string;
14140
14234
 
14141
- @Field(() => Int, )
14235
+ @Field(() => Int)
14142
14236
  Sequence: number;
14143
14237
 
14144
14238
  @Field()
@@ -14153,13 +14247,13 @@ export class UpdateQueryFieldInput {
14153
14247
  @Field({ nullable: true })
14154
14248
  SourceFieldName: string;
14155
14249
 
14156
- @Field(() => Boolean, )
14250
+ @Field(() => Boolean)
14157
14251
  IsComputed: boolean;
14158
14252
 
14159
14253
  @Field({ nullable: true })
14160
14254
  ComputationDescription: string;
14161
14255
 
14162
- @Field(() => Boolean, )
14256
+ @Field(() => Boolean)
14163
14257
  IsSummary: boolean;
14164
14258
 
14165
14259
  @Field({ nullable: true })
@@ -14340,7 +14434,7 @@ export class CreateQueryCategoryInput {
14340
14434
  //****************************************************************************
14341
14435
  @InputType()
14342
14436
  export class UpdateQueryCategoryInput {
14343
- @Field(() => Int, )
14437
+ @Field(() => Int)
14344
14438
  ID: number;
14345
14439
 
14346
14440
  @Field()
@@ -14552,7 +14646,7 @@ export class CreateQueryInput {
14552
14646
  @Field({ nullable: true })
14553
14647
  Description: string;
14554
14648
 
14555
- @Field(() => Int, )
14649
+ @Field(() => Int)
14556
14650
  CategoryID: number;
14557
14651
 
14558
14652
  @Field({ nullable: true })
@@ -14577,7 +14671,7 @@ export class CreateQueryInput {
14577
14671
  //****************************************************************************
14578
14672
  @InputType()
14579
14673
  export class UpdateQueryInput {
14580
- @Field(() => Int, )
14674
+ @Field(() => Int)
14581
14675
  ID: number;
14582
14676
 
14583
14677
  @Field()
@@ -14586,7 +14680,7 @@ export class UpdateQueryInput {
14586
14680
  @Field({ nullable: true })
14587
14681
  Description: string;
14588
14682
 
14589
- @Field(() => Int, )
14683
+ @Field(() => Int)
14590
14684
  CategoryID: number;
14591
14685
 
14592
14686
  @Field({ nullable: true })
@@ -14774,7 +14868,7 @@ export class QueryPermission_ {
14774
14868
  //****************************************************************************
14775
14869
  @InputType()
14776
14870
  export class CreateQueryPermissionInput {
14777
- @Field(() => Int, )
14871
+ @Field(() => Int)
14778
14872
  QueryID: number;
14779
14873
 
14780
14874
  @Field()
@@ -14787,10 +14881,10 @@ export class CreateQueryPermissionInput {
14787
14881
  //****************************************************************************
14788
14882
  @InputType()
14789
14883
  export class UpdateQueryPermissionInput {
14790
- @Field(() => Int, )
14884
+ @Field(() => Int)
14791
14885
  ID: number;
14792
14886
 
14793
- @Field(() => Int, )
14887
+ @Field(() => Int)
14794
14888
  QueryID: number;
14795
14889
 
14796
14890
  @Field()
@@ -14962,10 +15056,10 @@ export class CreateVectorIndexInput {
14962
15056
  @Field({ nullable: true })
14963
15057
  Description: string;
14964
15058
 
14965
- @Field(() => Int, )
15059
+ @Field(() => Int)
14966
15060
  VectorDatabaseID: number;
14967
15061
 
14968
- @Field(() => Int, )
15062
+ @Field(() => Int)
14969
15063
  EmbeddingModelID: number;
14970
15064
  }
14971
15065
 
@@ -14975,7 +15069,7 @@ export class CreateVectorIndexInput {
14975
15069
  //****************************************************************************
14976
15070
  @InputType()
14977
15071
  export class UpdateVectorIndexInput {
14978
- @Field(() => Int, )
15072
+ @Field(() => Int)
14979
15073
  ID: number;
14980
15074
 
14981
15075
  @Field()
@@ -14984,10 +15078,10 @@ export class UpdateVectorIndexInput {
14984
15078
  @Field({ nullable: true })
14985
15079
  Description: string;
14986
15080
 
14987
- @Field(() => Int, )
15081
+ @Field(() => Int)
14988
15082
  VectorDatabaseID: number;
14989
15083
 
14990
- @Field(() => Int, )
15084
+ @Field(() => Int)
14991
15085
  EmbeddingModelID: number;
14992
15086
  }
14993
15087
 
@@ -15152,7 +15246,7 @@ export class CreateEntityDocumentTypeInput {
15152
15246
  //****************************************************************************
15153
15247
  @InputType()
15154
15248
  export class UpdateEntityDocumentTypeInput {
15155
- @Field(() => Int, )
15249
+ @Field(() => Int)
15156
15250
  ID: number;
15157
15251
 
15158
15252
  @Field()
@@ -15327,7 +15421,7 @@ export class EntityDocumentRun_ {
15327
15421
  //****************************************************************************
15328
15422
  @InputType()
15329
15423
  export class CreateEntityDocumentRunInput {
15330
- @Field(() => Int, )
15424
+ @Field(() => Int)
15331
15425
  EntityDocumentID: number;
15332
15426
 
15333
15427
  @Field({ nullable: true })
@@ -15346,10 +15440,10 @@ export class CreateEntityDocumentRunInput {
15346
15440
  //****************************************************************************
15347
15441
  @InputType()
15348
15442
  export class UpdateEntityDocumentRunInput {
15349
- @Field(() => Int, )
15443
+ @Field(() => Int)
15350
15444
  ID: number;
15351
15445
 
15352
- @Field(() => Int, )
15446
+ @Field(() => Int)
15353
15447
  EntityDocumentID: number;
15354
15448
 
15355
15449
  @Field({ nullable: true })
@@ -15537,7 +15631,7 @@ export class CreateVectorDatabaseInput {
15537
15631
  //****************************************************************************
15538
15632
  @InputType()
15539
15633
  export class UpdateVectorDatabaseInput {
15540
- @Field(() => Int, )
15634
+ @Field(() => Int)
15541
15635
  ID: number;
15542
15636
 
15543
15637
  @Field()
@@ -15723,7 +15817,7 @@ export class EntityRecordDocument_ {
15723
15817
  //****************************************************************************
15724
15818
  @InputType()
15725
15819
  export class CreateEntityRecordDocumentInput {
15726
- @Field(() => Int, )
15820
+ @Field(() => Int)
15727
15821
  EntityID: number;
15728
15822
 
15729
15823
  @Field()
@@ -15732,7 +15826,7 @@ export class CreateEntityRecordDocumentInput {
15732
15826
  @Field({ nullable: true })
15733
15827
  DocumentText: string;
15734
15828
 
15735
- @Field(() => Int, )
15829
+ @Field(() => Int)
15736
15830
  VectorIndexID: number;
15737
15831
 
15738
15832
  @Field({ nullable: true })
@@ -15751,10 +15845,10 @@ export class CreateEntityRecordDocumentInput {
15751
15845
  //****************************************************************************
15752
15846
  @InputType()
15753
15847
  export class UpdateEntityRecordDocumentInput {
15754
- @Field(() => Int, )
15848
+ @Field(() => Int)
15755
15849
  ID: number;
15756
15850
 
15757
- @Field(() => Int, )
15851
+ @Field(() => Int)
15758
15852
  EntityID: number;
15759
15853
 
15760
15854
  @Field()
@@ -15763,7 +15857,7 @@ export class UpdateEntityRecordDocumentInput {
15763
15857
  @Field({ nullable: true })
15764
15858
  DocumentText: string;
15765
15859
 
15766
- @Field(() => Int, )
15860
+ @Field(() => Int)
15767
15861
  VectorIndexID: number;
15768
15862
 
15769
15863
  @Field({ nullable: true })
@@ -15945,10 +16039,10 @@ export class CreateEntityDocumentInput {
15945
16039
  @Field()
15946
16040
  Name: string;
15947
16041
 
15948
- @Field(() => Int, )
16042
+ @Field(() => Int)
15949
16043
  EntityID: number;
15950
16044
 
15951
- @Field(() => Int, )
16045
+ @Field(() => Int)
15952
16046
  TypeID: number;
15953
16047
 
15954
16048
  @Field()
@@ -15964,16 +16058,16 @@ export class CreateEntityDocumentInput {
15964
16058
  //****************************************************************************
15965
16059
  @InputType()
15966
16060
  export class UpdateEntityDocumentInput {
15967
- @Field(() => Int, )
16061
+ @Field(() => Int)
15968
16062
  ID: number;
15969
16063
 
15970
16064
  @Field()
15971
16065
  Name: string;
15972
16066
 
15973
- @Field(() => Int, )
16067
+ @Field(() => Int)
15974
16068
  EntityID: number;
15975
16069
 
15976
- @Field(() => Int, )
16070
+ @Field(() => Int)
15977
16071
  TypeID: number;
15978
16072
 
15979
16073
  @Field()
@@ -16175,7 +16269,7 @@ export class DataContextItem_ {
16175
16269
  //****************************************************************************
16176
16270
  @InputType()
16177
16271
  export class CreateDataContextItemInput {
16178
- @Field(() => Int, )
16272
+ @Field(() => Int)
16179
16273
  DataContextID: number;
16180
16274
 
16181
16275
  @Field()
@@ -16209,10 +16303,10 @@ export class CreateDataContextItemInput {
16209
16303
  //****************************************************************************
16210
16304
  @InputType()
16211
16305
  export class UpdateDataContextItemInput {
16212
- @Field(() => Int, )
16306
+ @Field(() => Int)
16213
16307
  ID: number;
16214
16308
 
16215
- @Field(() => Int, )
16309
+ @Field(() => Int)
16216
16310
  DataContextID: number;
16217
16311
 
16218
16312
  @Field()
@@ -16405,7 +16499,7 @@ export class CreateDataContextInput {
16405
16499
  @Field()
16406
16500
  Name: string;
16407
16501
 
16408
- @Field(() => Int, )
16502
+ @Field(() => Int)
16409
16503
  UserID: number;
16410
16504
 
16411
16505
  @Field({ nullable: true })
@@ -16421,13 +16515,13 @@ export class CreateDataContextInput {
16421
16515
  //****************************************************************************
16422
16516
  @InputType()
16423
16517
  export class UpdateDataContextInput {
16424
- @Field(() => Int, )
16518
+ @Field(() => Int)
16425
16519
  ID: number;
16426
16520
 
16427
16521
  @Field()
16428
16522
  Name: string;
16429
16523
 
16430
- @Field(() => Int, )
16524
+ @Field(() => Int)
16431
16525
  UserID: number;
16432
16526
 
16433
16527
  @Field({ nullable: true })
@@ -16627,7 +16721,7 @@ export class CreateUserViewCategoryInput {
16627
16721
  //****************************************************************************
16628
16722
  @InputType()
16629
16723
  export class UpdateUserViewCategoryInput {
16630
- @Field(() => Int, )
16724
+ @Field(() => Int)
16631
16725
  ID: number;
16632
16726
 
16633
16727
  @Field()
@@ -16769,6 +16863,32 @@ export class UserViewCategoryResolver extends ResolverBase {
16769
16863
  const i = input, d = dataSource; // prevent error
16770
16864
  }
16771
16865
 
16866
+ @Mutation(() => UserViewCategory_)
16867
+ async DeleteUserViewCategory(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
16868
+ if (await this.BeforeDelete(dataSource, ID)) { // fire event and proceed if it wasn't cancelled
16869
+ const entityObject = <UserViewCategoryEntity>await new Metadata().GetEntityObject('User View Categories', this.GetUserFromPayload(userPayload));
16870
+ await entityObject.Load(ID);
16871
+ const returnValue = entityObject.GetAll(); // grab the values before we delete so we can return last state before delete if we are successful.
16872
+ if (await entityObject.Delete()) {
16873
+ await this.AfterDelete(dataSource, ID); // fire event
16874
+ return returnValue;
16875
+ }
16876
+ else
16877
+ return null; // delete failed, this will cause an exception
16878
+ }
16879
+ else
16880
+ return null; // BeforeDelete canceled the operation, this will cause an exception
16881
+ }
16882
+
16883
+ // Before/After UPDATE Event Hooks for Sub-Classes to Override
16884
+ protected async BeforeDelete(dataSource: DataSource, ID: number): Promise<boolean> {
16885
+ const i = ID, d = dataSource; // prevent error;
16886
+ return true;
16887
+ }
16888
+ protected async AfterDelete(dataSource: DataSource, ID: number) {
16889
+ const i = ID, d = dataSource; // prevent error
16890
+ }
16891
+
16772
16892
  }
16773
16893
 
16774
16894
  //****************************************************************************
@@ -16814,9 +16934,6 @@ export class DashboardCategory_ {
16814
16934
  //****************************************************************************
16815
16935
  @InputType()
16816
16936
  export class CreateDashboardCategoryInput {
16817
- @Field(() => Int, )
16818
- ID: number;
16819
-
16820
16937
  @Field()
16821
16938
  Name: string;
16822
16939
 
@@ -16833,7 +16950,7 @@ export class CreateDashboardCategoryInput {
16833
16950
  //****************************************************************************
16834
16951
  @InputType()
16835
16952
  export class UpdateDashboardCategoryInput {
16836
- @Field(() => Int, )
16953
+ @Field(() => Int)
16837
16954
  ID: number;
16838
16955
 
16839
16956
  @Field()
@@ -17026,7 +17143,7 @@ export class CreateReportCategoryInput {
17026
17143
  @Field({ nullable: true })
17027
17144
  Description: string;
17028
17145
 
17029
- @Field(() => Int, )
17146
+ @Field(() => Int)
17030
17147
  ParentID: number;
17031
17148
  }
17032
17149
 
@@ -17036,7 +17153,7 @@ export class CreateReportCategoryInput {
17036
17153
  //****************************************************************************
17037
17154
  @InputType()
17038
17155
  export class UpdateReportCategoryInput {
17039
- @Field(() => Int, )
17156
+ @Field(() => Int)
17040
17157
  ID: number;
17041
17158
 
17042
17159
  @Field()
@@ -17045,7 +17162,7 @@ export class UpdateReportCategoryInput {
17045
17162
  @Field({ nullable: true })
17046
17163
  Description: string;
17047
17164
 
17048
- @Field(() => Int, )
17165
+ @Field(() => Int)
17049
17166
  ParentID: number;
17050
17167
  }
17051
17168
 
@@ -17178,4 +17295,844 @@ export class ReportCategoryResolver extends ResolverBase {
17178
17295
  const i = input, d = dataSource; // prevent error
17179
17296
  }
17180
17297
 
17298
+ }
17299
+
17300
+ //****************************************************************************
17301
+ // ENTITY CLASS for File Storage Providers
17302
+ //****************************************************************************
17303
+ @ObjectType()
17304
+ export class FileStorageProvider_ {
17305
+ @Field(() => Int)
17306
+ ID: number;
17307
+
17308
+ @Field()
17309
+ @MaxLength(100)
17310
+ Name: string;
17311
+
17312
+ @Field({nullable: true})
17313
+ Description?: string;
17314
+
17315
+ @Field()
17316
+ @MaxLength(200)
17317
+ ServerDriverKey: string;
17318
+
17319
+ @Field()
17320
+ @MaxLength(200)
17321
+ ClientDriverKey: string;
17322
+
17323
+ @Field(() => Int)
17324
+ Priority: number;
17325
+
17326
+ @Field(() => Boolean)
17327
+ IsActive: boolean;
17328
+
17329
+ @Field()
17330
+ @MaxLength(8)
17331
+ CreatedAt: Date;
17332
+
17333
+ @Field()
17334
+ @MaxLength(8)
17335
+ UpdatedAt: Date;
17336
+
17337
+ @Field(() => [mj_core_schema_server_object_types.File_])
17338
+ FilesArray: mj_core_schema_server_object_types.File_[]; // Link to Files
17339
+
17340
+ }
17341
+
17342
+ //****************************************************************************
17343
+ // INPUT TYPE for File Storage Providers
17344
+ //****************************************************************************
17345
+ @InputType()
17346
+ export class CreateFileStorageProviderInput {
17347
+ @Field()
17348
+ Name: string;
17349
+
17350
+ @Field({ nullable: true })
17351
+ Description: string;
17352
+
17353
+ @Field()
17354
+ ServerDriverKey: string;
17355
+
17356
+ @Field()
17357
+ ClientDriverKey: string;
17358
+
17359
+ @Field(() => Int)
17360
+ Priority: number;
17361
+
17362
+ @Field(() => Boolean)
17363
+ IsActive: boolean;
17364
+ }
17365
+
17366
+
17367
+ //****************************************************************************
17368
+ // INPUT TYPE for File Storage Providers
17369
+ //****************************************************************************
17370
+ @InputType()
17371
+ export class UpdateFileStorageProviderInput {
17372
+ @Field(() => Int)
17373
+ ID: number;
17374
+
17375
+ @Field()
17376
+ Name: string;
17377
+
17378
+ @Field({ nullable: true })
17379
+ Description: string;
17380
+
17381
+ @Field()
17382
+ ServerDriverKey: string;
17383
+
17384
+ @Field()
17385
+ ClientDriverKey: string;
17386
+
17387
+ @Field(() => Int)
17388
+ Priority: number;
17389
+
17390
+ @Field(() => Boolean)
17391
+ IsActive: boolean;
17392
+ }
17393
+
17394
+ //****************************************************************************
17395
+ // RESOLVER for File Storage Providers
17396
+ //****************************************************************************
17397
+ @ObjectType()
17398
+ export class RunFileStorageProviderViewResult {
17399
+ @Field(() => [FileStorageProvider_])
17400
+ Results: FileStorageProvider_[];
17401
+
17402
+ @Field(() => Int, {nullable: true})
17403
+ UserViewRunID?: number;
17404
+
17405
+ @Field(() => Int, {nullable: true})
17406
+ RowCount: number;
17407
+
17408
+ @Field(() => Int, {nullable: true})
17409
+ TotalRowCount: number;
17410
+
17411
+ @Field(() => Int, {nullable: true})
17412
+ ExecutionTime: number;
17413
+
17414
+ @Field({nullable: true})
17415
+ ErrorMessage?: string;
17416
+
17417
+ @Field(() => Boolean, {nullable: false})
17418
+ Success: boolean;
17419
+ }
17420
+
17421
+ @Resolver(FileStorageProvider_)
17422
+ export class FileStorageProviderResolver extends ResolverBase {
17423
+ @Query(() => RunFileStorageProviderViewResult)
17424
+ async RunFileStorageProviderViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
17425
+ return super.RunViewByIDGeneric(input, dataSource, userPayload, pubSub);
17426
+ }
17427
+
17428
+ @Query(() => RunFileStorageProviderViewResult)
17429
+ async RunFileStorageProviderViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
17430
+ return super.RunViewByNameGeneric(input, dataSource, userPayload, pubSub);
17431
+ }
17432
+
17433
+ @Query(() => RunFileStorageProviderViewResult)
17434
+ async RunFileStorageProviderDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
17435
+ input.EntityName = 'File Storage Providers';
17436
+ return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
17437
+ }
17438
+ @Query(() => FileStorageProvider_, { nullable: true })
17439
+ async FileStorageProvider(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<FileStorageProvider_ | null> {
17440
+ this.CheckUserReadPermissions('File Storage Providers', userPayload);
17441
+ const sSQL = `SELECT * FROM [${mj_core_schema}].[vwFileStorageProviders] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('File Storage Providers', userPayload, EntityPermissionType.Read, 'AND');
17442
+ const result = this.MapFieldNamesToCodeNames('File Storage Providers', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
17443
+ return result;
17444
+ }
17445
+
17446
+ @FieldResolver(() => [mj_core_schema_server_object_types.File_])
17447
+ async FilesArray(@Root() filestorageprovider_: FileStorageProvider_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
17448
+ this.CheckUserReadPermissions('Files', userPayload);
17449
+ const sSQL = `SELECT * FROM [${mj_core_schema}].[vwFiles] WHERE [ProviderID]=${filestorageprovider_.ID} ` + this.getRowLevelSecurityWhereClause('Files', userPayload, EntityPermissionType.Read, 'AND');
17450
+ const result = this.ArrayMapFieldNamesToCodeNames('Files', await dataSource.query(sSQL));
17451
+ return result;
17452
+ }
17453
+
17454
+ @Mutation(() => FileStorageProvider_)
17455
+ async CreateFileStorageProvider(
17456
+ @Arg('input', () => CreateFileStorageProviderInput) input: CreateFileStorageProviderInput,
17457
+ @Ctx() { dataSource, userPayload }: AppContext,
17458
+ @PubSub() pubSub: PubSubEngine
17459
+ ) {
17460
+ if (await this.BeforeCreate(dataSource, input)) { // fire event and proceed if it wasn't cancelled
17461
+ const entityObject = <FileStorageProviderEntity>await new Metadata().GetEntityObject('File Storage Providers', this.GetUserFromPayload(userPayload));
17462
+ await entityObject.NewRecord();
17463
+ entityObject.SetMany(input);
17464
+ if (await entityObject.Save()) {
17465
+ // save worked, fire the AfterCreate event and then return all the data
17466
+ await this.AfterCreate(dataSource, input); // fire event
17467
+ return entityObject.GetAll();
17468
+ }
17469
+ else
17470
+ // save failed, return null
17471
+ return null;
17472
+ }
17473
+ else
17474
+ return null;
17475
+ }
17476
+
17477
+ // Before/After CREATE Event Hooks for Sub-Classes to Override
17478
+ protected async BeforeCreate(dataSource: DataSource, input: CreateFileStorageProviderInput): Promise<boolean> {
17479
+ return true;
17480
+ }
17481
+ protected async AfterCreate(dataSource: DataSource, input: CreateFileStorageProviderInput) {
17482
+ }
17483
+
17484
+ @Mutation(() => FileStorageProvider_)
17485
+ async UpdateFileStorageProvider(
17486
+ @Arg('input', () => UpdateFileStorageProviderInput) input: UpdateFileStorageProviderInput,
17487
+ @Ctx() { dataSource, userPayload }: AppContext,
17488
+ @PubSub() pubSub: PubSubEngine
17489
+ ) {
17490
+ if (await this.BeforeUpdate(dataSource, input)) { // fire event and proceed if it wasn't cancelled
17491
+ const entityObject = <FileStorageProviderEntity>await new Metadata().GetEntityObject('File Storage Providers', this.GetUserFromPayload(userPayload));
17492
+ entityObject.LoadFromData(input) // using the input instead of loading from DB because TrackChanges is turned off for File Storage Providers
17493
+
17494
+ if (await entityObject.Save({ IgnoreDirtyState: true /*flag used because of LoadFromData() call above*/ })) {
17495
+ // save worked, fire afterevent and return all the data
17496
+ await this.AfterUpdate(dataSource, input); // fire event
17497
+ return entityObject.GetAll();
17498
+ }
17499
+ else
17500
+ return null; // save failed, return null
17501
+ }
17502
+ else
17503
+ return null;
17504
+ }
17505
+
17506
+ // Before/After UPDATE Event Hooks for Sub-Classes to Override
17507
+ protected async BeforeUpdate(dataSource: DataSource, input: UpdateFileStorageProviderInput): Promise<boolean> {
17508
+ const i = input, d = dataSource; // prevent error
17509
+ return true;
17510
+ }
17511
+ protected async AfterUpdate(dataSource: DataSource, input: UpdateFileStorageProviderInput) {
17512
+ const i = input, d = dataSource; // prevent error
17513
+ }
17514
+
17515
+ }
17516
+
17517
+ //****************************************************************************
17518
+ // ENTITY CLASS for Files
17519
+ //****************************************************************************
17520
+ @ObjectType()
17521
+ export class File_ {
17522
+ @Field(() => Int)
17523
+ ID: number;
17524
+
17525
+ @Field()
17526
+ @MaxLength(1000)
17527
+ Name: string;
17528
+
17529
+ @Field({nullable: true})
17530
+ Description?: string;
17531
+
17532
+ @Field(() => Int)
17533
+ ProviderID: number;
17534
+
17535
+ @Field({nullable: true})
17536
+ @MaxLength(100)
17537
+ ContentType?: string;
17538
+
17539
+ @Field({nullable: true})
17540
+ @MaxLength(1000)
17541
+ ProviderKey?: string;
17542
+
17543
+ @Field(() => Int, {nullable: true})
17544
+ CategoryID?: number;
17545
+
17546
+ @Field({description: 'Pending, Uploading, Uploaded, Deleting, Deleted'})
17547
+ @MaxLength(40)
17548
+ Status: string;
17549
+
17550
+ @Field()
17551
+ @MaxLength(8)
17552
+ CreatedAt: Date;
17553
+
17554
+ @Field()
17555
+ @MaxLength(8)
17556
+ UpdatedAt: Date;
17557
+
17558
+ @Field()
17559
+ @MaxLength(100)
17560
+ Provider: string;
17561
+
17562
+ @Field({nullable: true})
17563
+ @MaxLength(510)
17564
+ Category?: string;
17565
+
17566
+ @Field(() => [mj_core_schema_server_object_types.FileEntityRecordLink_])
17567
+ FileEntityRecordLinksArray: mj_core_schema_server_object_types.FileEntityRecordLink_[]; // Link to FileEntityRecordLinks
17568
+
17569
+ }
17570
+
17571
+ //****************************************************************************
17572
+ // INPUT TYPE for Files
17573
+ //****************************************************************************
17574
+ @InputType()
17575
+ export class CreateFileInput {
17576
+ @Field()
17577
+ Name: string;
17578
+
17579
+ @Field({ nullable: true })
17580
+ Description: string;
17581
+
17582
+ @Field(() => Int)
17583
+ ProviderID: number;
17584
+
17585
+ @Field({ nullable: true })
17586
+ ContentType: string;
17587
+
17588
+ @Field({ nullable: true })
17589
+ ProviderKey: string;
17590
+
17591
+ @Field(() => Int, { nullable: true })
17592
+ CategoryID: number;
17593
+
17594
+ @Field()
17595
+ Status: string;
17596
+ }
17597
+
17598
+
17599
+ //****************************************************************************
17600
+ // INPUT TYPE for Files
17601
+ //****************************************************************************
17602
+ @InputType()
17603
+ export class UpdateFileInput {
17604
+ @Field(() => Int)
17605
+ ID: number;
17606
+
17607
+ @Field()
17608
+ Name: string;
17609
+
17610
+ @Field({ nullable: true })
17611
+ Description: string;
17612
+
17613
+ @Field(() => Int)
17614
+ ProviderID: number;
17615
+
17616
+ @Field({ nullable: true })
17617
+ ContentType: string;
17618
+
17619
+ @Field({ nullable: true })
17620
+ ProviderKey: string;
17621
+
17622
+ @Field(() => Int, { nullable: true })
17623
+ CategoryID: number;
17624
+
17625
+ @Field()
17626
+ Status: string;
17627
+ }
17628
+
17629
+ //****************************************************************************
17630
+ // RESOLVER for Files
17631
+ //****************************************************************************
17632
+ @ObjectType()
17633
+ export class RunFileViewResult {
17634
+ @Field(() => [File_])
17635
+ Results: File_[];
17636
+
17637
+ @Field(() => Int, {nullable: true})
17638
+ UserViewRunID?: number;
17639
+
17640
+ @Field(() => Int, {nullable: true})
17641
+ RowCount: number;
17642
+
17643
+ @Field(() => Int, {nullable: true})
17644
+ TotalRowCount: number;
17645
+
17646
+ @Field(() => Int, {nullable: true})
17647
+ ExecutionTime: number;
17648
+
17649
+ @Field({nullable: true})
17650
+ ErrorMessage?: string;
17651
+
17652
+ @Field(() => Boolean, {nullable: false})
17653
+ Success: boolean;
17654
+ }
17655
+
17656
+ @Resolver(File_)
17657
+ export class FileResolver extends ResolverBase {
17658
+ @Query(() => RunFileViewResult)
17659
+ async RunFileViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
17660
+ return super.RunViewByIDGeneric(input, dataSource, userPayload, pubSub);
17661
+ }
17662
+
17663
+ @Query(() => RunFileViewResult)
17664
+ async RunFileViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
17665
+ return super.RunViewByNameGeneric(input, dataSource, userPayload, pubSub);
17666
+ }
17667
+
17668
+ @Query(() => RunFileViewResult)
17669
+ async RunFileDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
17670
+ input.EntityName = 'Files';
17671
+ return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
17672
+ }
17673
+ @Query(() => File_, { nullable: true })
17674
+ async File(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<File_ | null> {
17675
+ this.CheckUserReadPermissions('Files', userPayload);
17676
+ const sSQL = `SELECT * FROM [${mj_core_schema}].[vwFiles] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Files', userPayload, EntityPermissionType.Read, 'AND');
17677
+ const result = this.MapFieldNamesToCodeNames('Files', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
17678
+ return result;
17679
+ }
17680
+
17681
+ @FieldResolver(() => [mj_core_schema_server_object_types.FileEntityRecordLink_])
17682
+ async FileEntityRecordLinksArray(@Root() file_: File_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
17683
+ this.CheckUserReadPermissions('File Entity Record Links', userPayload);
17684
+ const sSQL = `SELECT * FROM [${mj_core_schema}].[vwFileEntityRecordLinks] WHERE [FileID]=${file_.ID} ` + this.getRowLevelSecurityWhereClause('File Entity Record Links', userPayload, EntityPermissionType.Read, 'AND');
17685
+ const result = this.ArrayMapFieldNamesToCodeNames('File Entity Record Links', await dataSource.query(sSQL));
17686
+ return result;
17687
+ }
17688
+
17689
+ @Mutation(() => File_)
17690
+ async CreateFile(
17691
+ @Arg('input', () => CreateFileInput) input: CreateFileInput,
17692
+ @Ctx() { dataSource, userPayload }: AppContext,
17693
+ @PubSub() pubSub: PubSubEngine
17694
+ ) {
17695
+ if (await this.BeforeCreate(dataSource, input)) { // fire event and proceed if it wasn't cancelled
17696
+ const entityObject = <FileEntity>await new Metadata().GetEntityObject('Files', this.GetUserFromPayload(userPayload));
17697
+ await entityObject.NewRecord();
17698
+ entityObject.SetMany(input);
17699
+ if (await entityObject.Save()) {
17700
+ // save worked, fire the AfterCreate event and then return all the data
17701
+ await this.AfterCreate(dataSource, input); // fire event
17702
+ return entityObject.GetAll();
17703
+ }
17704
+ else
17705
+ // save failed, return null
17706
+ return null;
17707
+ }
17708
+ else
17709
+ return null;
17710
+ }
17711
+
17712
+ // Before/After CREATE Event Hooks for Sub-Classes to Override
17713
+ protected async BeforeCreate(dataSource: DataSource, input: CreateFileInput): Promise<boolean> {
17714
+ return true;
17715
+ }
17716
+ protected async AfterCreate(dataSource: DataSource, input: CreateFileInput) {
17717
+ }
17718
+
17719
+ @Mutation(() => File_)
17720
+ async UpdateFile(
17721
+ @Arg('input', () => UpdateFileInput) input: UpdateFileInput,
17722
+ @Ctx() { dataSource, userPayload }: AppContext,
17723
+ @PubSub() pubSub: PubSubEngine
17724
+ ) {
17725
+ if (await this.BeforeUpdate(dataSource, input)) { // fire event and proceed if it wasn't cancelled
17726
+ const entityObject = <FileEntity>await new Metadata().GetEntityObject('Files', this.GetUserFromPayload(userPayload));
17727
+ entityObject.LoadFromData(input) // using the input instead of loading from DB because TrackChanges is turned off for Files
17728
+
17729
+ if (await entityObject.Save({ IgnoreDirtyState: true /*flag used because of LoadFromData() call above*/ })) {
17730
+ // save worked, fire afterevent and return all the data
17731
+ await this.AfterUpdate(dataSource, input); // fire event
17732
+ return entityObject.GetAll();
17733
+ }
17734
+ else
17735
+ return null; // save failed, return null
17736
+ }
17737
+ else
17738
+ return null;
17739
+ }
17740
+
17741
+ // Before/After UPDATE Event Hooks for Sub-Classes to Override
17742
+ protected async BeforeUpdate(dataSource: DataSource, input: UpdateFileInput): Promise<boolean> {
17743
+ const i = input, d = dataSource; // prevent error
17744
+ return true;
17745
+ }
17746
+ protected async AfterUpdate(dataSource: DataSource, input: UpdateFileInput) {
17747
+ const i = input, d = dataSource; // prevent error
17748
+ }
17749
+
17750
+ }
17751
+
17752
+ //****************************************************************************
17753
+ // ENTITY CLASS for File Categories
17754
+ //****************************************************************************
17755
+ @ObjectType()
17756
+ export class FileCategory_ {
17757
+ @Field(() => Int)
17758
+ ID: number;
17759
+
17760
+ @Field()
17761
+ @MaxLength(510)
17762
+ Name: string;
17763
+
17764
+ @Field({nullable: true})
17765
+ Description?: string;
17766
+
17767
+ @Field(() => Int, {nullable: true})
17768
+ ParentID?: number;
17769
+
17770
+ @Field()
17771
+ @MaxLength(8)
17772
+ CreatedAt: Date;
17773
+
17774
+ @Field()
17775
+ @MaxLength(8)
17776
+ UpdatedAt: Date;
17777
+
17778
+ @Field({nullable: true})
17779
+ @MaxLength(510)
17780
+ Parent?: string;
17781
+
17782
+ @Field(() => [mj_core_schema_server_object_types.File_])
17783
+ FilesArray: mj_core_schema_server_object_types.File_[]; // Link to Files
17784
+
17785
+ @Field(() => [mj_core_schema_server_object_types.FileCategory_])
17786
+ FileCategoriesArray: mj_core_schema_server_object_types.FileCategory_[]; // Link to FileCategories
17787
+
17788
+ }
17789
+
17790
+ //****************************************************************************
17791
+ // INPUT TYPE for File Categories
17792
+ //****************************************************************************
17793
+ @InputType()
17794
+ export class CreateFileCategoryInput {
17795
+ @Field()
17796
+ Name: string;
17797
+
17798
+ @Field({ nullable: true })
17799
+ Description: string;
17800
+
17801
+ @Field(() => Int, { nullable: true })
17802
+ ParentID: number;
17803
+ }
17804
+
17805
+
17806
+ //****************************************************************************
17807
+ // INPUT TYPE for File Categories
17808
+ //****************************************************************************
17809
+ @InputType()
17810
+ export class UpdateFileCategoryInput {
17811
+ @Field(() => Int)
17812
+ ID: number;
17813
+
17814
+ @Field()
17815
+ Name: string;
17816
+
17817
+ @Field({ nullable: true })
17818
+ Description: string;
17819
+
17820
+ @Field(() => Int, { nullable: true })
17821
+ ParentID: number;
17822
+ }
17823
+
17824
+ //****************************************************************************
17825
+ // RESOLVER for File Categories
17826
+ //****************************************************************************
17827
+ @ObjectType()
17828
+ export class RunFileCategoryViewResult {
17829
+ @Field(() => [FileCategory_])
17830
+ Results: FileCategory_[];
17831
+
17832
+ @Field(() => Int, {nullable: true})
17833
+ UserViewRunID?: number;
17834
+
17835
+ @Field(() => Int, {nullable: true})
17836
+ RowCount: number;
17837
+
17838
+ @Field(() => Int, {nullable: true})
17839
+ TotalRowCount: number;
17840
+
17841
+ @Field(() => Int, {nullable: true})
17842
+ ExecutionTime: number;
17843
+
17844
+ @Field({nullable: true})
17845
+ ErrorMessage?: string;
17846
+
17847
+ @Field(() => Boolean, {nullable: false})
17848
+ Success: boolean;
17849
+ }
17850
+
17851
+ @Resolver(FileCategory_)
17852
+ export class FileCategoryResolver extends ResolverBase {
17853
+ @Query(() => RunFileCategoryViewResult)
17854
+ async RunFileCategoryViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
17855
+ return super.RunViewByIDGeneric(input, dataSource, userPayload, pubSub);
17856
+ }
17857
+
17858
+ @Query(() => RunFileCategoryViewResult)
17859
+ async RunFileCategoryViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
17860
+ return super.RunViewByNameGeneric(input, dataSource, userPayload, pubSub);
17861
+ }
17862
+
17863
+ @Query(() => RunFileCategoryViewResult)
17864
+ async RunFileCategoryDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
17865
+ input.EntityName = 'File Categories';
17866
+ return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
17867
+ }
17868
+ @Query(() => FileCategory_, { nullable: true })
17869
+ async FileCategory(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<FileCategory_ | null> {
17870
+ this.CheckUserReadPermissions('File Categories', userPayload);
17871
+ const sSQL = `SELECT * FROM [${mj_core_schema}].[vwFileCategories] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('File Categories', userPayload, EntityPermissionType.Read, 'AND');
17872
+ const result = this.MapFieldNamesToCodeNames('File Categories', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
17873
+ return result;
17874
+ }
17875
+
17876
+ @FieldResolver(() => [mj_core_schema_server_object_types.File_])
17877
+ async FilesArray(@Root() filecategory_: FileCategory_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
17878
+ this.CheckUserReadPermissions('Files', userPayload);
17879
+ const sSQL = `SELECT * FROM [${mj_core_schema}].[vwFiles] WHERE [CategoryID]=${filecategory_.ID} ` + this.getRowLevelSecurityWhereClause('Files', userPayload, EntityPermissionType.Read, 'AND');
17880
+ const result = this.ArrayMapFieldNamesToCodeNames('Files', await dataSource.query(sSQL));
17881
+ return result;
17882
+ }
17883
+
17884
+ @FieldResolver(() => [mj_core_schema_server_object_types.FileCategory_])
17885
+ async FileCategoriesArray(@Root() filecategory_: FileCategory_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
17886
+ this.CheckUserReadPermissions('File Categories', userPayload);
17887
+ const sSQL = `SELECT * FROM [${mj_core_schema}].[vwFileCategories] WHERE [ParentID]=${filecategory_.ID} ` + this.getRowLevelSecurityWhereClause('File Categories', userPayload, EntityPermissionType.Read, 'AND');
17888
+ const result = this.ArrayMapFieldNamesToCodeNames('File Categories', await dataSource.query(sSQL));
17889
+ return result;
17890
+ }
17891
+
17892
+ @Mutation(() => FileCategory_)
17893
+ async CreateFileCategory(
17894
+ @Arg('input', () => CreateFileCategoryInput) input: CreateFileCategoryInput,
17895
+ @Ctx() { dataSource, userPayload }: AppContext,
17896
+ @PubSub() pubSub: PubSubEngine
17897
+ ) {
17898
+ if (await this.BeforeCreate(dataSource, input)) { // fire event and proceed if it wasn't cancelled
17899
+ const entityObject = <FileCategoryEntity>await new Metadata().GetEntityObject('File Categories', this.GetUserFromPayload(userPayload));
17900
+ await entityObject.NewRecord();
17901
+ entityObject.SetMany(input);
17902
+ if (await entityObject.Save()) {
17903
+ // save worked, fire the AfterCreate event and then return all the data
17904
+ await this.AfterCreate(dataSource, input); // fire event
17905
+ return entityObject.GetAll();
17906
+ }
17907
+ else
17908
+ // save failed, return null
17909
+ return null;
17910
+ }
17911
+ else
17912
+ return null;
17913
+ }
17914
+
17915
+ // Before/After CREATE Event Hooks for Sub-Classes to Override
17916
+ protected async BeforeCreate(dataSource: DataSource, input: CreateFileCategoryInput): Promise<boolean> {
17917
+ return true;
17918
+ }
17919
+ protected async AfterCreate(dataSource: DataSource, input: CreateFileCategoryInput) {
17920
+ }
17921
+
17922
+ @Mutation(() => FileCategory_)
17923
+ async UpdateFileCategory(
17924
+ @Arg('input', () => UpdateFileCategoryInput) input: UpdateFileCategoryInput,
17925
+ @Ctx() { dataSource, userPayload }: AppContext,
17926
+ @PubSub() pubSub: PubSubEngine
17927
+ ) {
17928
+ if (await this.BeforeUpdate(dataSource, input)) { // fire event and proceed if it wasn't cancelled
17929
+ const entityObject = <FileCategoryEntity>await new Metadata().GetEntityObject('File Categories', this.GetUserFromPayload(userPayload));
17930
+ entityObject.LoadFromData(input) // using the input instead of loading from DB because TrackChanges is turned off for File Categories
17931
+
17932
+ if (await entityObject.Save({ IgnoreDirtyState: true /*flag used because of LoadFromData() call above*/ })) {
17933
+ // save worked, fire afterevent and return all the data
17934
+ await this.AfterUpdate(dataSource, input); // fire event
17935
+ return entityObject.GetAll();
17936
+ }
17937
+ else
17938
+ return null; // save failed, return null
17939
+ }
17940
+ else
17941
+ return null;
17942
+ }
17943
+
17944
+ // Before/After UPDATE Event Hooks for Sub-Classes to Override
17945
+ protected async BeforeUpdate(dataSource: DataSource, input: UpdateFileCategoryInput): Promise<boolean> {
17946
+ const i = input, d = dataSource; // prevent error
17947
+ return true;
17948
+ }
17949
+ protected async AfterUpdate(dataSource: DataSource, input: UpdateFileCategoryInput) {
17950
+ const i = input, d = dataSource; // prevent error
17951
+ }
17952
+
17953
+ }
17954
+
17955
+ //****************************************************************************
17956
+ // ENTITY CLASS for File Entity Record Links
17957
+ //****************************************************************************
17958
+ @ObjectType()
17959
+ export class FileEntityRecordLink_ {
17960
+ @Field(() => Int)
17961
+ ID: number;
17962
+
17963
+ @Field(() => Int)
17964
+ FileID: number;
17965
+
17966
+ @Field(() => Int)
17967
+ EntityID: number;
17968
+
17969
+ @Field()
17970
+ @MaxLength(510)
17971
+ RecordID: string;
17972
+
17973
+ @Field()
17974
+ @MaxLength(8)
17975
+ CreatedAt: Date;
17976
+
17977
+ @Field()
17978
+ @MaxLength(8)
17979
+ UpdatedAt: Date;
17980
+
17981
+ @Field()
17982
+ @MaxLength(1000)
17983
+ File: string;
17984
+
17985
+ @Field()
17986
+ @MaxLength(510)
17987
+ Entity: string;
17988
+
17989
+ }
17990
+
17991
+ //****************************************************************************
17992
+ // INPUT TYPE for File Entity Record Links
17993
+ //****************************************************************************
17994
+ @InputType()
17995
+ export class CreateFileEntityRecordLinkInput {
17996
+ @Field(() => Int)
17997
+ FileID: number;
17998
+
17999
+ @Field(() => Int)
18000
+ EntityID: number;
18001
+
18002
+ @Field()
18003
+ RecordID: string;
18004
+ }
18005
+
18006
+
18007
+ //****************************************************************************
18008
+ // INPUT TYPE for File Entity Record Links
18009
+ //****************************************************************************
18010
+ @InputType()
18011
+ export class UpdateFileEntityRecordLinkInput {
18012
+ @Field(() => Int)
18013
+ ID: number;
18014
+
18015
+ @Field(() => Int)
18016
+ FileID: number;
18017
+
18018
+ @Field(() => Int)
18019
+ EntityID: number;
18020
+
18021
+ @Field()
18022
+ RecordID: string;
18023
+ }
18024
+
18025
+ //****************************************************************************
18026
+ // RESOLVER for File Entity Record Links
18027
+ //****************************************************************************
18028
+ @ObjectType()
18029
+ export class RunFileEntityRecordLinkViewResult {
18030
+ @Field(() => [FileEntityRecordLink_])
18031
+ Results: FileEntityRecordLink_[];
18032
+
18033
+ @Field(() => Int, {nullable: true})
18034
+ UserViewRunID?: number;
18035
+
18036
+ @Field(() => Int, {nullable: true})
18037
+ RowCount: number;
18038
+
18039
+ @Field(() => Int, {nullable: true})
18040
+ TotalRowCount: number;
18041
+
18042
+ @Field(() => Int, {nullable: true})
18043
+ ExecutionTime: number;
18044
+
18045
+ @Field({nullable: true})
18046
+ ErrorMessage?: string;
18047
+
18048
+ @Field(() => Boolean, {nullable: false})
18049
+ Success: boolean;
18050
+ }
18051
+
18052
+ @Resolver(FileEntityRecordLink_)
18053
+ export class FileEntityRecordLinkResolver extends ResolverBase {
18054
+ @Query(() => RunFileEntityRecordLinkViewResult)
18055
+ async RunFileEntityRecordLinkViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
18056
+ return super.RunViewByIDGeneric(input, dataSource, userPayload, pubSub);
18057
+ }
18058
+
18059
+ @Query(() => RunFileEntityRecordLinkViewResult)
18060
+ async RunFileEntityRecordLinkViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
18061
+ return super.RunViewByNameGeneric(input, dataSource, userPayload, pubSub);
18062
+ }
18063
+
18064
+ @Query(() => RunFileEntityRecordLinkViewResult)
18065
+ async RunFileEntityRecordLinkDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
18066
+ input.EntityName = 'File Entity Record Links';
18067
+ return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
18068
+ }
18069
+ @Query(() => FileEntityRecordLink_, { nullable: true })
18070
+ async FileEntityRecordLink(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<FileEntityRecordLink_ | null> {
18071
+ this.CheckUserReadPermissions('File Entity Record Links', userPayload);
18072
+ const sSQL = `SELECT * FROM [${mj_core_schema}].[vwFileEntityRecordLinks] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('File Entity Record Links', userPayload, EntityPermissionType.Read, 'AND');
18073
+ const result = this.MapFieldNamesToCodeNames('File Entity Record Links', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
18074
+ return result;
18075
+ }
18076
+
18077
+ @Mutation(() => FileEntityRecordLink_)
18078
+ async CreateFileEntityRecordLink(
18079
+ @Arg('input', () => CreateFileEntityRecordLinkInput) input: CreateFileEntityRecordLinkInput,
18080
+ @Ctx() { dataSource, userPayload }: AppContext,
18081
+ @PubSub() pubSub: PubSubEngine
18082
+ ) {
18083
+ if (await this.BeforeCreate(dataSource, input)) { // fire event and proceed if it wasn't cancelled
18084
+ const entityObject = <FileEntityRecordLinkEntity>await new Metadata().GetEntityObject('File Entity Record Links', this.GetUserFromPayload(userPayload));
18085
+ await entityObject.NewRecord();
18086
+ entityObject.SetMany(input);
18087
+ if (await entityObject.Save()) {
18088
+ // save worked, fire the AfterCreate event and then return all the data
18089
+ await this.AfterCreate(dataSource, input); // fire event
18090
+ return entityObject.GetAll();
18091
+ }
18092
+ else
18093
+ // save failed, return null
18094
+ return null;
18095
+ }
18096
+ else
18097
+ return null;
18098
+ }
18099
+
18100
+ // Before/After CREATE Event Hooks for Sub-Classes to Override
18101
+ protected async BeforeCreate(dataSource: DataSource, input: CreateFileEntityRecordLinkInput): Promise<boolean> {
18102
+ return true;
18103
+ }
18104
+ protected async AfterCreate(dataSource: DataSource, input: CreateFileEntityRecordLinkInput) {
18105
+ }
18106
+
18107
+ @Mutation(() => FileEntityRecordLink_)
18108
+ async UpdateFileEntityRecordLink(
18109
+ @Arg('input', () => UpdateFileEntityRecordLinkInput) input: UpdateFileEntityRecordLinkInput,
18110
+ @Ctx() { dataSource, userPayload }: AppContext,
18111
+ @PubSub() pubSub: PubSubEngine
18112
+ ) {
18113
+ if (await this.BeforeUpdate(dataSource, input)) { // fire event and proceed if it wasn't cancelled
18114
+ const entityObject = <FileEntityRecordLinkEntity>await new Metadata().GetEntityObject('File Entity Record Links', this.GetUserFromPayload(userPayload));
18115
+ entityObject.LoadFromData(input) // using the input instead of loading from DB because TrackChanges is turned off for File Entity Record Links
18116
+
18117
+ if (await entityObject.Save({ IgnoreDirtyState: true /*flag used because of LoadFromData() call above*/ })) {
18118
+ // save worked, fire afterevent and return all the data
18119
+ await this.AfterUpdate(dataSource, input); // fire event
18120
+ return entityObject.GetAll();
18121
+ }
18122
+ else
18123
+ return null; // save failed, return null
18124
+ }
18125
+ else
18126
+ return null;
18127
+ }
18128
+
18129
+ // Before/After UPDATE Event Hooks for Sub-Classes to Override
18130
+ protected async BeforeUpdate(dataSource: DataSource, input: UpdateFileEntityRecordLinkInput): Promise<boolean> {
18131
+ const i = input, d = dataSource; // prevent error
18132
+ return true;
18133
+ }
18134
+ protected async AfterUpdate(dataSource: DataSource, input: UpdateFileEntityRecordLinkInput) {
18135
+ const i = input, d = dataSource; // prevent error
18136
+ }
18137
+
17181
18138
  }