@memberjunction/server 0.9.165 → 0.9.168

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build.log.json CHANGED
@@ -199,5 +199,11 @@
199
199
  },
200
200
  {
201
201
  "buildTime": "2024-02-13T17:22:27.4104257-06:00"
202
+ },
203
+ {
204
+ "buildTime": "2024-02-13T17:51:12.1577414-06:00"
205
+ },
206
+ {
207
+ "buildTime": "2024-02-14T09:26:08.0761801-06:00"
202
208
  }
203
209
  ]
@@ -78,7 +78,7 @@ __decorate([
78
78
  __metadata("design:type", Array)
79
79
  ], Company_.prototype, "WorkflowsArray", void 0);
80
80
  exports.Company_ = Company_ = __decorate([
81
- (0, server_1.ObjectType)({ description: 'List of Companies/Organizations within the top-level business, used for subsidiaries' })
81
+ (0, server_1.ObjectType)()
82
82
  ], Company_);
83
83
  let CreateCompanyInput = class CreateCompanyInput {
84
84
  };
@@ -406,7 +406,7 @@ __decorate([
406
406
  __metadata("design:type", String)
407
407
  ], Employee_.prototype, "Title", void 0);
408
408
  __decorate([
409
- (0, server_1.Field)({ description: '5' }),
409
+ (0, server_1.Field)(),
410
410
  (0, class_validator_1.MaxLength)(200),
411
411
  __metadata("design:type", String)
412
412
  ], Employee_.prototype, "Email", void 0);
@@ -479,7 +479,7 @@ __decorate([
479
479
  __metadata("design:type", Array)
480
480
  ], Employee_.prototype, "EmployeeSkillsArray", void 0);
481
481
  exports.Employee_ = Employee_ = __decorate([
482
- (0, server_1.ObjectType)({ description: 'Employees' })
482
+ (0, server_1.ObjectType)()
483
483
  ], Employee_);
484
484
  let CreateEmployeeInput = class CreateEmployeeInput {
485
485
  };
@@ -2356,7 +2356,7 @@ __decorate([
2356
2356
  __metadata("design:type", Array)
2357
2357
  ], Integration_.prototype, "CompanyIntegrationsArray", void 0);
2358
2358
  exports.Integration_ = Integration_ = __decorate([
2359
- (0, server_1.ObjectType)({ description: 'List of integrations that can be executed using the MemberJunction integration architecture.' })
2359
+ (0, server_1.ObjectType)()
2360
2360
  ], Integration_);
2361
2361
  let UpdateIntegrationInput = class UpdateIntegrationInput {
2362
2362
  };
@@ -2967,6 +2967,10 @@ __decorate([
2967
2967
  (0, server_1.Field)({ nullable: true }),
2968
2968
  __metadata("design:type", String)
2969
2969
  ], EntityField_.prototype, "Description", void 0);
2970
+ __decorate([
2971
+ (0, server_1.Field)(() => Boolean, { description: 'When set to 1 (default), whenever a description is modified in the column within the underlying view (first choice) or table (second choice), the Description column in the entity field definition will be automatically updated. If you never set metadata in the database directly, you can leave this alone. However, if you have metadata set in the database level for description, and you want to provide a DIFFERENT description in this entity field definition, turn this bit off and then set the Description field and future CodeGen runs will NOT override the Description field here.' }),
2972
+ __metadata("design:type", Boolean)
2973
+ ], EntityField_.prototype, "AutoUpdateDescription", void 0);
2970
2974
  __decorate([
2971
2975
  (0, server_1.Field)(() => Boolean),
2972
2976
  __metadata("design:type", Boolean)
@@ -3176,6 +3180,10 @@ __decorate([
3176
3180
  (0, server_1.Field)({ nullable: true }),
3177
3181
  __metadata("design:type", String)
3178
3182
  ], CreateEntityFieldInput.prototype, "Description", void 0);
3183
+ __decorate([
3184
+ (0, server_1.Field)(() => Boolean),
3185
+ __metadata("design:type", Boolean)
3186
+ ], CreateEntityFieldInput.prototype, "AutoUpdateDescription", void 0);
3179
3187
  __decorate([
3180
3188
  (0, server_1.Field)(() => Boolean),
3181
3189
  __metadata("design:type", Boolean)
@@ -3274,6 +3282,10 @@ __decorate([
3274
3282
  (0, server_1.Field)({ nullable: true }),
3275
3283
  __metadata("design:type", String)
3276
3284
  ], UpdateEntityFieldInput.prototype, "Description", void 0);
3285
+ __decorate([
3286
+ (0, server_1.Field)(() => Boolean),
3287
+ __metadata("design:type", Boolean)
3288
+ ], UpdateEntityFieldInput.prototype, "AutoUpdateDescription", void 0);
3277
3289
  __decorate([
3278
3290
  (0, server_1.Field)(() => Boolean),
3279
3291
  __metadata("design:type", Boolean)
@@ -3576,7 +3588,7 @@ __decorate([
3576
3588
  __metadata("design:type", Number)
3577
3589
  ], Entity_.prototype, "ID", void 0);
3578
3590
  __decorate([
3579
- (0, server_1.Field)(() => server_1.Int, { nullable: true, description: 'Reserved for future use' }),
3591
+ (0, server_1.Field)(() => server_1.Int, { nullable: true }),
3580
3592
  __metadata("design:type", Number)
3581
3593
  ], Entity_.prototype, "ParentID", void 0);
3582
3594
  __decorate([
@@ -3593,6 +3605,10 @@ __decorate([
3593
3605
  (0, server_1.Field)({ nullable: true }),
3594
3606
  __metadata("design:type", String)
3595
3607
  ], Entity_.prototype, "Description", void 0);
3608
+ __decorate([
3609
+ (0, server_1.Field)(() => Boolean, { description: 'When set to 1 (default), whenever a description is modified in the underlying view (first choice) or table (second choice), the Description column in the entity definition will be automatically updated. If you never set metadata in the database directly, you can leave this alone. However, if you have metadata set in the database level for description, and you want to provide a DIFFERENT description in this entity definition, turn this bit off and then set the Description field and future CodeGen runs will NOT override the Description field here.' }),
3610
+ __metadata("design:type", Boolean)
3611
+ ], Entity_.prototype, "AutoUpdateDescription", void 0);
3596
3612
  __decorate([
3597
3613
  (0, server_1.Field)(),
3598
3614
  (0, class_validator_1.MaxLength)(510),
@@ -3608,7 +3624,7 @@ __decorate([
3608
3624
  __metadata("design:type", Boolean)
3609
3625
  ], Entity_.prototype, "BaseViewGenerated", void 0);
3610
3626
  __decorate([
3611
- (0, server_1.Field)({ description: 'Database Schema Name' }),
3627
+ (0, server_1.Field)(),
3612
3628
  (0, class_validator_1.MaxLength)(510),
3613
3629
  __metadata("design:type", String)
3614
3630
  ], Entity_.prototype, "SchemaName", void 0);
@@ -3629,7 +3645,7 @@ __decorate([
3629
3645
  __metadata("design:type", Boolean)
3630
3646
  ], Entity_.prototype, "AuditViewRuns", void 0);
3631
3647
  __decorate([
3632
- (0, server_1.Field)(() => Boolean, { description: 'Master switch to control if the field is included in the API or not' }),
3648
+ (0, server_1.Field)(() => Boolean),
3633
3649
  __metadata("design:type", Boolean)
3634
3650
  ], Entity_.prototype, "IncludeInAPI", void 0);
3635
3651
  __decorate([
@@ -3637,7 +3653,7 @@ __decorate([
3637
3653
  __metadata("design:type", Boolean)
3638
3654
  ], Entity_.prototype, "AllowAllRowsAPI", void 0);
3639
3655
  __decorate([
3640
- (0, server_1.Field)(() => Boolean, { description: 'If set to 1, allows updates to occur via API. Role based permissions are required in addition to turning this bit on.' }),
3656
+ (0, server_1.Field)(() => Boolean),
3641
3657
  __metadata("design:type", Boolean)
3642
3658
  ], Entity_.prototype, "AllowUpdateAPI", void 0);
3643
3659
  __decorate([
@@ -3653,7 +3669,7 @@ __decorate([
3653
3669
  __metadata("design:type", Boolean)
3654
3670
  ], Entity_.prototype, "CustomResolverAPI", void 0);
3655
3671
  __decorate([
3656
- (0, server_1.Field)(() => Boolean, { description: 'If set to 1, allows an end user to add their own search string when running a user view or searching without saving a view' }),
3672
+ (0, server_1.Field)(() => Boolean),
3657
3673
  __metadata("design:type", Boolean)
3658
3674
  ], Entity_.prototype, "AllowUserSearchAPI", void 0);
3659
3675
  __decorate([
@@ -3727,12 +3743,12 @@ __decorate([
3727
3743
  __metadata("design:type", Boolean)
3728
3744
  ], Entity_.prototype, "UserFormGenerated", void 0);
3729
3745
  __decorate([
3730
- (0, server_1.Field)({ nullable: true, description: 'Normally, CodeGen will sub-class BaseEntity to create a strongly-typed sub-class for each entity. If you provide a value here and in EntityObjectSubclassImport, CodeGen will sub-class the provided class instead of BaseEntity. Also make sure to provide a value for EntityObjectSubclassImport with the name of the module to import that contains an exported class of the name you provide in EntityObjectSubclassName.' }),
3746
+ (0, server_1.Field)({ nullable: true }),
3731
3747
  (0, class_validator_1.MaxLength)(510),
3732
3748
  __metadata("design:type", String)
3733
3749
  ], Entity_.prototype, "EntityObjectSubclassName", void 0);
3734
3750
  __decorate([
3735
- (0, server_1.Field)({ nullable: true, description: 'Normally, CodeGen will sub-class BaseEntity to create a strongly-typed sub-class for each entity. If you provide a value here and in EntityObjectSubclassName, CodeGen will sub-class the provided class instead of BaseEntity. Also make sure to provide a value for EntityObjectSubclassName with the name of the class itself. This field should have the name of the module to import that contains an exported class of the name you provide in EntityObjectSubclassName.' }),
3751
+ (0, server_1.Field)({ nullable: true }),
3736
3752
  (0, class_validator_1.MaxLength)(510),
3737
3753
  __metadata("design:type", String)
3738
3754
  ], Entity_.prototype, "EntityObjectSubclassImport", void 0);
@@ -3868,8 +3884,12 @@ __decorate([
3868
3884
  (0, server_1.Field)(() => [EntityDocument_]),
3869
3885
  __metadata("design:type", Array)
3870
3886
  ], Entity_.prototype, "EntityDocumentsArray", void 0);
3887
+ __decorate([
3888
+ (0, server_1.Field)(() => [DataContextItem_]),
3889
+ __metadata("design:type", Array)
3890
+ ], Entity_.prototype, "DataContextItemsArray", void 0);
3871
3891
  exports.Entity_ = Entity_ = __decorate([
3872
- (0, server_1.ObjectType)({ description: 'Metadata about all of the entities in the system. This information is managed by CodeGen, don\'t modify the parts that come from SQL Server' })
3892
+ (0, server_1.ObjectType)()
3873
3893
  ], Entity_);
3874
3894
  let CreateEntityInput = class CreateEntityInput {
3875
3895
  };
@@ -3894,6 +3914,10 @@ __decorate([
3894
3914
  (0, server_1.Field)({ nullable: true }),
3895
3915
  __metadata("design:type", String)
3896
3916
  ], CreateEntityInput.prototype, "Description", void 0);
3917
+ __decorate([
3918
+ (0, server_1.Field)(() => Boolean),
3919
+ __metadata("design:type", Boolean)
3920
+ ], CreateEntityInput.prototype, "AutoUpdateDescription", void 0);
3897
3921
  __decorate([
3898
3922
  (0, server_1.Field)(),
3899
3923
  __metadata("design:type", String)
@@ -4044,6 +4068,10 @@ __decorate([
4044
4068
  (0, server_1.Field)({ nullable: true }),
4045
4069
  __metadata("design:type", String)
4046
4070
  ], UpdateEntityInput.prototype, "Description", void 0);
4071
+ __decorate([
4072
+ (0, server_1.Field)(() => Boolean),
4073
+ __metadata("design:type", Boolean)
4074
+ ], UpdateEntityInput.prototype, "AutoUpdateDescription", void 0);
4047
4075
  __decorate([
4048
4076
  (0, server_1.Field)(),
4049
4077
  __metadata("design:type", String)
@@ -4366,6 +4394,12 @@ let EntityResolverBase = class EntityResolverBase extends server_1.ResolverBase
4366
4394
  const result = this.ArrayMapFieldNamesToCodeNames('Entity Documents', await dataSource.query(sSQL));
4367
4395
  return result;
4368
4396
  }
4397
+ async DataContextItemsArray(entity_, { dataSource, userPayload }, pubSub) {
4398
+ this.CheckUserReadPermissions('Data Context Items', userPayload);
4399
+ const sSQL = `SELECT * FROM [admin].[vwDataContextItems] WHERE [EntityID]=${entity_.ID} ` + this.getRowLevelSecurityWhereClause('Data Context Items', userPayload, core_1.EntityPermissionType.Read, 'AND');
4400
+ const result = this.ArrayMapFieldNamesToCodeNames('Data Context Items', await dataSource.query(sSQL));
4401
+ return result;
4402
+ }
4369
4403
  async CreateEntity(input, { dataSource, userPayload }, pubSub) {
4370
4404
  if (await this.BeforeCreate(dataSource, input)) {
4371
4405
  const entityObject = await new core_1.Metadata().GetEntityObject('Entities', this.GetUserFromPayload(userPayload));
@@ -4682,6 +4716,15 @@ __decorate([
4682
4716
  __metadata("design:paramtypes", [Entity_, Object, server_1.PubSubEngine]),
4683
4717
  __metadata("design:returntype", Promise)
4684
4718
  ], EntityResolverBase.prototype, "EntityDocumentsArray", null);
4719
+ __decorate([
4720
+ (0, server_1.FieldResolver)(() => [DataContextItem_]),
4721
+ __param(0, (0, server_1.Root)()),
4722
+ __param(1, (0, server_1.Ctx)()),
4723
+ __param(2, (0, server_1.PubSub)()),
4724
+ __metadata("design:type", Function),
4725
+ __metadata("design:paramtypes", [Entity_, Object, server_1.PubSubEngine]),
4726
+ __metadata("design:returntype", Promise)
4727
+ ], EntityResolverBase.prototype, "DataContextItemsArray", null);
4685
4728
  __decorate([
4686
4729
  (0, server_1.Mutation)(() => Entity_),
4687
4730
  __param(0, (0, server_1.Arg)('input', () => CreateEntityInput)),
@@ -5951,7 +5994,7 @@ __decorate([
5951
5994
  __metadata("design:type", String)
5952
5995
  ], UserRecordLog_.prototype, "UserSupervisorEmail", void 0);
5953
5996
  exports.UserRecordLog_ = UserRecordLog_ = __decorate([
5954
- (0, server_1.ObjectType)({ description: 'Tracks history of user access to records across the system, tracks reads and writes' })
5997
+ (0, server_1.ObjectType)()
5955
5998
  ], UserRecordLog_);
5956
5999
  let UpdateUserRecordLogInput = class UpdateUserRecordLogInput {
5957
6000
  };
@@ -6234,8 +6277,12 @@ __decorate([
6234
6277
  (0, server_1.Field)(() => [UserViewRun_]),
6235
6278
  __metadata("design:type", Array)
6236
6279
  ], UserView_.prototype, "UserViewRunsArray", void 0);
6280
+ __decorate([
6281
+ (0, server_1.Field)(() => [DataContextItem_]),
6282
+ __metadata("design:type", Array)
6283
+ ], UserView_.prototype, "DataContextItemsArray", void 0);
6237
6284
  exports.UserView_ = UserView_ = __decorate([
6238
- (0, server_1.ObjectType)({ description: 'User Views contain the metadata for the user viewing system of entity data' })
6285
+ (0, server_1.ObjectType)()
6239
6286
  ], UserView_);
6240
6287
  let CreateUserViewInput = class CreateUserViewInput {
6241
6288
  };
@@ -6450,6 +6497,12 @@ let UserViewResolverBase = class UserViewResolverBase extends server_1.ResolverB
6450
6497
  const result = this.ArrayMapFieldNamesToCodeNames('User View Runs', await dataSource.query(sSQL));
6451
6498
  return result;
6452
6499
  }
6500
+ async DataContextItemsArray(userview_, { dataSource, userPayload }, pubSub) {
6501
+ this.CheckUserReadPermissions('Data Context Items', userPayload);
6502
+ const sSQL = `SELECT * FROM [admin].[vwDataContextItems] WHERE [ViewID]=${userview_.ID} ` + this.getRowLevelSecurityWhereClause('Data Context Items', userPayload, core_1.EntityPermissionType.Read, 'AND');
6503
+ const result = this.ArrayMapFieldNamesToCodeNames('Data Context Items', await dataSource.query(sSQL));
6504
+ return result;
6505
+ }
6453
6506
  async CreateUserView(input, { dataSource, userPayload }, pubSub) {
6454
6507
  if (await this.BeforeCreate(dataSource, input)) {
6455
6508
  const entityObject = await new core_1.Metadata().GetEntityObject('User Views', this.GetUserFromPayload(userPayload));
@@ -6578,6 +6631,15 @@ __decorate([
6578
6631
  __metadata("design:paramtypes", [UserView_, Object, server_1.PubSubEngine]),
6579
6632
  __metadata("design:returntype", Promise)
6580
6633
  ], UserViewResolverBase.prototype, "UserViewRunsArray", null);
6634
+ __decorate([
6635
+ (0, server_1.FieldResolver)(() => [DataContextItem_]),
6636
+ __param(0, (0, server_1.Root)()),
6637
+ __param(1, (0, server_1.Ctx)()),
6638
+ __param(2, (0, server_1.PubSub)()),
6639
+ __metadata("design:type", Function),
6640
+ __metadata("design:paramtypes", [UserView_, Object, server_1.PubSubEngine]),
6641
+ __metadata("design:returntype", Promise)
6642
+ ], UserViewResolverBase.prototype, "DataContextItemsArray", null);
6581
6643
  __decorate([
6582
6644
  (0, server_1.Mutation)(() => UserView_),
6583
6645
  __param(0, (0, server_1.Arg)('input', () => CreateUserViewInput)),
@@ -6659,7 +6721,7 @@ __decorate([
6659
6721
  __metadata("design:type", Array)
6660
6722
  ], CompanyIntegrationRun_.prototype, "CompanyIntegrationRunDetailsArray", void 0);
6661
6723
  exports.CompanyIntegrationRun_ = CompanyIntegrationRun_ = __decorate([
6662
- (0, server_1.ObjectType)({ description: 'Audit Trail for each run of a given company integration' })
6724
+ (0, server_1.ObjectType)()
6663
6725
  ], CompanyIntegrationRun_);
6664
6726
  let UpdateCompanyIntegrationRunInput = class UpdateCompanyIntegrationRunInput {
6665
6727
  };
@@ -6916,7 +6978,7 @@ __decorate([
6916
6978
  __metadata("design:type", Array)
6917
6979
  ], CompanyIntegrationRunDetail_.prototype, "ErrorLogsArray", void 0);
6918
6980
  exports.CompanyIntegrationRunDetail_ = CompanyIntegrationRunDetail_ = __decorate([
6919
- (0, server_1.ObjectType)({ description: 'Record-level details for the audit trail for each integration run' })
6981
+ (0, server_1.ObjectType)()
6920
6982
  ], CompanyIntegrationRunDetail_);
6921
6983
  let UpdateCompanyIntegrationRunDetailInput = class UpdateCompanyIntegrationRunDetailInput {
6922
6984
  };
@@ -8915,11 +8977,6 @@ __decorate([
8915
8977
  (0, class_validator_1.MaxLength)(8),
8916
8978
  __metadata("design:type", Date)
8917
8979
  ], List_.prototype, "UpdatedAt", void 0);
8918
- __decorate([
8919
- (0, server_1.Field)({ nullable: true }),
8920
- (0, class_validator_1.MaxLength)(510),
8921
- __metadata("design:type", String)
8922
- ], List_.prototype, "Entity", void 0);
8923
8980
  __decorate([
8924
8981
  (0, server_1.Field)(),
8925
8982
  (0, class_validator_1.MaxLength)(200),
@@ -10609,7 +10666,7 @@ __decorate([
10609
10666
  __metadata("design:type", String)
10610
10667
  ], RecordChange_.prototype, "User", void 0);
10611
10668
  exports.RecordChange_ = RecordChange_ = __decorate([
10612
- (0, server_1.ObjectType)({ description: 'Tracks history of all pending and complete data changes to records' })
10669
+ (0, server_1.ObjectType)()
10613
10670
  ], RecordChange_);
10614
10671
  let CreateRecordChangeInput = class CreateRecordChangeInput {
10615
10672
  };
@@ -11173,11 +11230,6 @@ __decorate([
11173
11230
  (0, class_validator_1.MaxLength)(200),
11174
11231
  __metadata("design:type", String)
11175
11232
  ], AuditLog_.prototype, "User", void 0);
11176
- __decorate([
11177
- (0, server_1.Field)({ nullable: true }),
11178
- (0, class_validator_1.MaxLength)(510),
11179
- __metadata("design:type", String)
11180
- ], AuditLog_.prototype, "Entity", void 0);
11181
11233
  exports.AuditLog_ = AuditLog_ = __decorate([
11182
11234
  (0, server_1.ObjectType)()
11183
11235
  ], AuditLog_);
@@ -15926,11 +15978,6 @@ __decorate([
15926
15978
  (0, class_validator_1.MaxLength)(510),
15927
15979
  __metadata("design:type", String)
15928
15980
  ], TaggedItem_.prototype, "Tag", void 0);
15929
- __decorate([
15930
- (0, server_1.Field)(),
15931
- (0, class_validator_1.MaxLength)(510),
15932
- __metadata("design:type", String)
15933
- ], TaggedItem_.prototype, "Entity", void 0);
15934
15981
  exports.TaggedItem_ = TaggedItem_ = __decorate([
15935
15982
  (0, server_1.ObjectType)()
15936
15983
  ], TaggedItem_);
@@ -18410,11 +18457,6 @@ __decorate([
18410
18457
  (0, class_validator_1.MaxLength)(8),
18411
18458
  __metadata("design:type", Date)
18412
18459
  ], CompanyIntegrationRecordMap_.prototype, "UpdatedAt", void 0);
18413
- __decorate([
18414
- (0, server_1.Field)(),
18415
- (0, class_validator_1.MaxLength)(510),
18416
- __metadata("design:type", String)
18417
- ], CompanyIntegrationRecordMap_.prototype, "Entity", void 0);
18418
18460
  exports.CompanyIntegrationRecordMap_ = CompanyIntegrationRecordMap_ = __decorate([
18419
18461
  (0, server_1.ObjectType)()
18420
18462
  ], CompanyIntegrationRecordMap_);
@@ -19219,6 +19261,16 @@ __decorate([
19219
19261
  (0, server_1.Field)(() => server_1.Int),
19220
19262
  __metadata("design:type", Number)
19221
19263
  ], QueryField_.prototype, "Sequence", void 0);
19264
+ __decorate([
19265
+ (0, server_1.Field)({ description: 'The base type, not including parameters, in SQL. For example this field would be nvarchar or decimal, and wouldn\'t include type parameters. The SQLFullType field provides that information.' }),
19266
+ (0, class_validator_1.MaxLength)(100),
19267
+ __metadata("design:type", String)
19268
+ ], QueryField_.prototype, "SQLBaseType", void 0);
19269
+ __decorate([
19270
+ (0, server_1.Field)({ description: 'The full SQL type for the field, for example datetime or nvarchar(10) etc.' }),
19271
+ (0, class_validator_1.MaxLength)(200),
19272
+ __metadata("design:type", String)
19273
+ ], QueryField_.prototype, "SQLFullType", void 0);
19222
19274
  __decorate([
19223
19275
  (0, server_1.Field)(() => server_1.Int, { nullable: true }),
19224
19276
  __metadata("design:type", Number)
@@ -19259,11 +19311,6 @@ __decorate([
19259
19311
  (0, class_validator_1.MaxLength)(510),
19260
19312
  __metadata("design:type", String)
19261
19313
  ], QueryField_.prototype, "Query", void 0);
19262
- __decorate([
19263
- (0, server_1.Field)({ nullable: true }),
19264
- (0, class_validator_1.MaxLength)(510),
19265
- __metadata("design:type", String)
19266
- ], QueryField_.prototype, "SourceEntity", void 0);
19267
19314
  exports.QueryField_ = QueryField_ = __decorate([
19268
19315
  (0, server_1.ObjectType)()
19269
19316
  ], QueryField_);
@@ -19286,6 +19333,14 @@ __decorate([
19286
19333
  (0, server_1.Field)(() => server_1.Int),
19287
19334
  __metadata("design:type", Number)
19288
19335
  ], CreateQueryFieldInput.prototype, "Sequence", void 0);
19336
+ __decorate([
19337
+ (0, server_1.Field)(),
19338
+ __metadata("design:type", String)
19339
+ ], CreateQueryFieldInput.prototype, "SQLBaseType", void 0);
19340
+ __decorate([
19341
+ (0, server_1.Field)(),
19342
+ __metadata("design:type", String)
19343
+ ], CreateQueryFieldInput.prototype, "SQLFullType", void 0);
19289
19344
  __decorate([
19290
19345
  (0, server_1.Field)(() => server_1.Int, { nullable: true }),
19291
19346
  __metadata("design:type", Number)
@@ -19336,6 +19391,14 @@ __decorate([
19336
19391
  (0, server_1.Field)(() => server_1.Int),
19337
19392
  __metadata("design:type", Number)
19338
19393
  ], UpdateQueryFieldInput.prototype, "Sequence", void 0);
19394
+ __decorate([
19395
+ (0, server_1.Field)(),
19396
+ __metadata("design:type", String)
19397
+ ], UpdateQueryFieldInput.prototype, "SQLBaseType", void 0);
19398
+ __decorate([
19399
+ (0, server_1.Field)(),
19400
+ __metadata("design:type", String)
19401
+ ], UpdateQueryFieldInput.prototype, "SQLFullType", void 0);
19339
19402
  __decorate([
19340
19403
  (0, server_1.Field)(() => server_1.Int, { nullable: true }),
19341
19404
  __metadata("design:type", Number)
@@ -19845,6 +19908,10 @@ __decorate([
19845
19908
  (0, server_1.Field)(() => [QueryPermission_]),
19846
19909
  __metadata("design:type", Array)
19847
19910
  ], Query_.prototype, "QueryPermissionsArray", void 0);
19911
+ __decorate([
19912
+ (0, server_1.Field)(() => [DataContextItem_]),
19913
+ __metadata("design:type", Array)
19914
+ ], Query_.prototype, "DataContextItemsArray", void 0);
19848
19915
  exports.Query_ = Query_ = __decorate([
19849
19916
  (0, server_1.ObjectType)()
19850
19917
  ], Query_);
@@ -19991,6 +20058,12 @@ let QueryResolver = class QueryResolver extends server_1.ResolverBase {
19991
20058
  const result = this.ArrayMapFieldNamesToCodeNames('Query Permissions', await dataSource.query(sSQL));
19992
20059
  return result;
19993
20060
  }
20061
+ async DataContextItemsArray(query_, { dataSource, userPayload }, pubSub) {
20062
+ this.CheckUserReadPermissions('Data Context Items', userPayload);
20063
+ const sSQL = `SELECT * FROM [admin].[vwDataContextItems] WHERE [QueryID]=${query_.ID} ` + this.getRowLevelSecurityWhereClause('Data Context Items', userPayload, core_1.EntityPermissionType.Read, 'AND');
20064
+ const result = this.ArrayMapFieldNamesToCodeNames('Data Context Items', await dataSource.query(sSQL));
20065
+ return result;
20066
+ }
19994
20067
  async CreateQuery(input, { dataSource, userPayload }, pubSub) {
19995
20068
  if (await this.BeforeCreate(dataSource, input)) {
19996
20069
  const entityObject = await new core_1.Metadata().GetEntityObject('Queries', this.GetUserFromPayload(userPayload));
@@ -20088,6 +20161,15 @@ __decorate([
20088
20161
  __metadata("design:paramtypes", [Query_, Object, server_1.PubSubEngine]),
20089
20162
  __metadata("design:returntype", Promise)
20090
20163
  ], QueryResolver.prototype, "QueryPermissionsArray", null);
20164
+ __decorate([
20165
+ (0, server_1.FieldResolver)(() => [DataContextItem_]),
20166
+ __param(0, (0, server_1.Root)()),
20167
+ __param(1, (0, server_1.Ctx)()),
20168
+ __param(2, (0, server_1.PubSub)()),
20169
+ __metadata("design:type", Function),
20170
+ __metadata("design:paramtypes", [Query_, Object, server_1.PubSubEngine]),
20171
+ __metadata("design:returntype", Promise)
20172
+ ], QueryResolver.prototype, "DataContextItemsArray", null);
20091
20173
  __decorate([
20092
20174
  (0, server_1.Mutation)(() => Query_),
20093
20175
  __param(0, (0, server_1.Arg)('input', () => CreateQueryInput)),
@@ -20820,7 +20902,7 @@ __decorate([
20820
20902
  __metadata("design:type", Date)
20821
20903
  ], EntityDocumentRun_.prototype, "EndedAt", void 0);
20822
20904
  __decorate([
20823
- (0, server_1.Field)(),
20905
+ (0, server_1.Field)({ description: 'Can be Pending, In Progress, Completed, or Failed' }),
20824
20906
  (0, class_validator_1.MaxLength)(30),
20825
20907
  __metadata("design:type", String)
20826
20908
  ], EntityDocumentRun_.prototype, "Status", void 0);
@@ -21611,11 +21693,6 @@ __decorate([
21611
21693
  (0, class_validator_1.MaxLength)(8),
21612
21694
  __metadata("design:type", Date)
21613
21695
  ], EntityDocument_.prototype, "UpdatedAt", void 0);
21614
- __decorate([
21615
- (0, server_1.Field)(),
21616
- (0, class_validator_1.MaxLength)(510),
21617
- __metadata("design:type", String)
21618
- ], EntityDocument_.prototype, "Entity", void 0);
21619
21696
  __decorate([
21620
21697
  (0, server_1.Field)(),
21621
21698
  (0, class_validator_1.MaxLength)(200),
@@ -21858,28 +21935,41 @@ __decorate([
21858
21935
  __metadata("design:type", Number)
21859
21936
  ], DataContextItem_.prototype, "ID", void 0);
21860
21937
  __decorate([
21861
- (0, server_1.Field)(() => server_1.Int),
21938
+ (0, server_1.Field)(() => server_1.Int, { description: 'Foreign key to the DataContext table' }),
21862
21939
  __metadata("design:type", Number)
21863
21940
  ], DataContextItem_.prototype, "DataContextID", void 0);
21864
21941
  __decorate([
21865
- (0, server_1.Field)(),
21942
+ (0, server_1.Field)({ description: 'The type of the item, either "view", "query", "full_entity", "single_record", or "sql"' }),
21866
21943
  (0, class_validator_1.MaxLength)(100),
21867
21944
  __metadata("design:type", String)
21868
21945
  ], DataContextItem_.prototype, "Type", void 0);
21869
21946
  __decorate([
21870
- (0, server_1.Field)(() => server_1.Int),
21947
+ (0, server_1.Field)(() => server_1.Int, { nullable: true, description: 'Only used if Type=\'view\'' }),
21871
21948
  __metadata("design:type", Number)
21949
+ ], DataContextItem_.prototype, "ViewID", void 0);
21950
+ __decorate([
21951
+ (0, server_1.Field)(() => server_1.Int, { nullable: true, description: 'Only used if Type=\'query\'' }),
21952
+ __metadata("design:type", Number)
21953
+ ], DataContextItem_.prototype, "QueryID", void 0);
21954
+ __decorate([
21955
+ (0, server_1.Field)(() => server_1.Int, { nullable: true, description: 'Used if type=\'full_entity\' or type=\'single_record\'' }),
21956
+ __metadata("design:type", Number)
21957
+ ], DataContextItem_.prototype, "EntityID", void 0);
21958
+ __decorate([
21959
+ (0, server_1.Field)({ nullable: true, description: 'The Primary Key value for the record, only used when Type=\'single_record\'' }),
21960
+ (0, class_validator_1.MaxLength)(510),
21961
+ __metadata("design:type", String)
21872
21962
  ], DataContextItem_.prototype, "RecordID", void 0);
21873
21963
  __decorate([
21874
- (0, server_1.Field)({ nullable: true }),
21964
+ (0, server_1.Field)({ nullable: true, description: 'Only used when Type=sql' }),
21875
21965
  __metadata("design:type", String)
21876
21966
  ], DataContextItem_.prototype, "SQL", void 0);
21877
21967
  __decorate([
21878
- (0, server_1.Field)({ nullable: true }),
21968
+ (0, server_1.Field)({ nullable: true, description: 'Optionally used to cache results of an item. This can be used for performance optimization, and also for having snapshots of data for historical comparisons.' }),
21879
21969
  __metadata("design:type", String)
21880
21970
  ], DataContextItem_.prototype, "DataJSON", void 0);
21881
21971
  __decorate([
21882
- (0, server_1.Field)({ nullable: true }),
21972
+ (0, server_1.Field)({ nullable: true, description: 'If DataJSON is populated, this field will show the date the the data was captured' }),
21883
21973
  (0, class_validator_1.MaxLength)(8),
21884
21974
  __metadata("design:type", Date)
21885
21975
  ], DataContextItem_.prototype, "LastRefreshedAt", void 0);
@@ -21898,8 +21988,18 @@ __decorate([
21898
21988
  (0, class_validator_1.MaxLength)(510),
21899
21989
  __metadata("design:type", String)
21900
21990
  ], DataContextItem_.prototype, "DataContext", void 0);
21991
+ __decorate([
21992
+ (0, server_1.Field)({ nullable: true }),
21993
+ (0, class_validator_1.MaxLength)(200),
21994
+ __metadata("design:type", String)
21995
+ ], DataContextItem_.prototype, "View", void 0);
21996
+ __decorate([
21997
+ (0, server_1.Field)({ nullable: true }),
21998
+ (0, class_validator_1.MaxLength)(510),
21999
+ __metadata("design:type", String)
22000
+ ], DataContextItem_.prototype, "Query", void 0);
21901
22001
  exports.DataContextItem_ = DataContextItem_ = __decorate([
21902
- (0, server_1.ObjectType)()
22002
+ (0, server_1.ObjectType)({ description: 'Data Context Items store information about each item within a Data Context. Each item stores a link to a view, query, or raw sql statement and can optionally cache the JSON representing the last run of that data object as well.' })
21903
22003
  ], DataContextItem_);
21904
22004
  let CreateDataContextItemInput = class CreateDataContextItemInput {
21905
22005
  };
@@ -21913,8 +22013,20 @@ __decorate([
21913
22013
  __metadata("design:type", String)
21914
22014
  ], CreateDataContextItemInput.prototype, "Type", void 0);
21915
22015
  __decorate([
21916
- (0, server_1.Field)(() => server_1.Int),
22016
+ (0, server_1.Field)(() => server_1.Int, { nullable: true }),
21917
22017
  __metadata("design:type", Number)
22018
+ ], CreateDataContextItemInput.prototype, "ViewID", void 0);
22019
+ __decorate([
22020
+ (0, server_1.Field)(() => server_1.Int, { nullable: true }),
22021
+ __metadata("design:type", Number)
22022
+ ], CreateDataContextItemInput.prototype, "QueryID", void 0);
22023
+ __decorate([
22024
+ (0, server_1.Field)(() => server_1.Int, { nullable: true }),
22025
+ __metadata("design:type", Number)
22026
+ ], CreateDataContextItemInput.prototype, "EntityID", void 0);
22027
+ __decorate([
22028
+ (0, server_1.Field)({ nullable: true }),
22029
+ __metadata("design:type", String)
21918
22030
  ], CreateDataContextItemInput.prototype, "RecordID", void 0);
21919
22031
  __decorate([
21920
22032
  (0, server_1.Field)({ nullable: true }),
@@ -21947,8 +22059,20 @@ __decorate([
21947
22059
  __metadata("design:type", String)
21948
22060
  ], UpdateDataContextItemInput.prototype, "Type", void 0);
21949
22061
  __decorate([
21950
- (0, server_1.Field)(() => server_1.Int),
22062
+ (0, server_1.Field)(() => server_1.Int, { nullable: true }),
21951
22063
  __metadata("design:type", Number)
22064
+ ], UpdateDataContextItemInput.prototype, "ViewID", void 0);
22065
+ __decorate([
22066
+ (0, server_1.Field)(() => server_1.Int, { nullable: true }),
22067
+ __metadata("design:type", Number)
22068
+ ], UpdateDataContextItemInput.prototype, "QueryID", void 0);
22069
+ __decorate([
22070
+ (0, server_1.Field)(() => server_1.Int, { nullable: true }),
22071
+ __metadata("design:type", Number)
22072
+ ], UpdateDataContextItemInput.prototype, "EntityID", void 0);
22073
+ __decorate([
22074
+ (0, server_1.Field)({ nullable: true }),
22075
+ __metadata("design:type", String)
21952
22076
  ], UpdateDataContextItemInput.prototype, "RecordID", void 0);
21953
22077
  __decorate([
21954
22078
  (0, server_1.Field)({ nullable: true }),
@@ -22161,7 +22285,7 @@ __decorate([
22161
22285
  __metadata("design:type", Array)
22162
22286
  ], DataContext_.prototype, "DataContextItemsArray", void 0);
22163
22287
  exports.DataContext_ = DataContext_ = __decorate([
22164
- (0, server_1.ObjectType)()
22288
+ (0, server_1.ObjectType)({ description: 'Data Contexts are a primitive within the MemberJunction architecture. They store information about data contexts which are groups of data including views, queries, or raw SQL statements. Data contexts can be used in conversations, reports and more.' })
22165
22289
  ], DataContext_);
22166
22290
  let CreateDataContextInput = class CreateDataContextInput {
22167
22291
  };