@memberjunction/server 2.105.0 → 2.107.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2493,6 +2493,7 @@ let MJAIAgentRun_ = class MJAIAgentRun_ {
2493
2493
  EffortLevel;
2494
2494
  RunName;
2495
2495
  Comments;
2496
+ ScheduledJobRunID;
2496
2497
  Agent;
2497
2498
  Conversation;
2498
2499
  User;
@@ -2501,8 +2502,8 @@ let MJAIAgentRun_ = class MJAIAgentRun_ {
2501
2502
  OverrideVendor;
2502
2503
  RootParentRunID;
2503
2504
  RootLastRunID;
2504
- MJ_AIAgentRuns_ParentRunIDArray;
2505
2505
  MJ_AIAgentRunSteps_AgentRunIDArray;
2506
+ MJ_AIAgentRuns_ParentRunIDArray;
2506
2507
  MJ_AIPromptRuns_AgentRunIDArray;
2507
2508
  };
2508
2509
  __decorate([
@@ -2680,6 +2681,11 @@ __decorate([
2680
2681
  Field({ nullable: true, description: `Human-readable notes and comments about this agent run` }),
2681
2682
  __metadata("design:type", String)
2682
2683
  ], MJAIAgentRun_.prototype, "Comments", void 0);
2684
+ __decorate([
2685
+ Field({ nullable: true, description: `Links to the scheduled job run that triggered this agent execution. NULL for manually-triggered agent runs. Enables tracking which scheduled jobs spawned which agent executions.` }),
2686
+ MaxLength(16),
2687
+ __metadata("design:type", String)
2688
+ ], MJAIAgentRun_.prototype, "ScheduledJobRunID", void 0);
2683
2689
  __decorate([
2684
2690
  Field({ nullable: true }),
2685
2691
  MaxLength(510),
@@ -2720,14 +2726,14 @@ __decorate([
2720
2726
  MaxLength(16),
2721
2727
  __metadata("design:type", String)
2722
2728
  ], MJAIAgentRun_.prototype, "RootLastRunID", void 0);
2723
- __decorate([
2724
- Field(() => [MJAIAgentRun_]),
2725
- __metadata("design:type", Array)
2726
- ], MJAIAgentRun_.prototype, "MJ_AIAgentRuns_ParentRunIDArray", void 0);
2727
2729
  __decorate([
2728
2730
  Field(() => [MJAIAgentRunStep_]),
2729
2731
  __metadata("design:type", Array)
2730
2732
  ], MJAIAgentRun_.prototype, "MJ_AIAgentRunSteps_AgentRunIDArray", void 0);
2733
+ __decorate([
2734
+ Field(() => [MJAIAgentRun_]),
2735
+ __metadata("design:type", Array)
2736
+ ], MJAIAgentRun_.prototype, "MJ_AIAgentRuns_ParentRunIDArray", void 0);
2731
2737
  __decorate([
2732
2738
  Field(() => [MJAIPromptRun_]),
2733
2739
  __metadata("design:type", Array)
@@ -2774,6 +2780,7 @@ let CreateMJAIAgentRunInput = class CreateMJAIAgentRunInput {
2774
2780
  EffortLevel;
2775
2781
  RunName;
2776
2782
  Comments;
2783
+ ScheduledJobRunID;
2777
2784
  };
2778
2785
  __decorate([
2779
2786
  Field({ nullable: true }),
@@ -2923,6 +2930,10 @@ __decorate([
2923
2930
  Field({ nullable: true }),
2924
2931
  __metadata("design:type", String)
2925
2932
  ], CreateMJAIAgentRunInput.prototype, "Comments", void 0);
2933
+ __decorate([
2934
+ Field({ nullable: true }),
2935
+ __metadata("design:type", String)
2936
+ ], CreateMJAIAgentRunInput.prototype, "ScheduledJobRunID", void 0);
2926
2937
  CreateMJAIAgentRunInput = __decorate([
2927
2938
  InputType()
2928
2939
  ], CreateMJAIAgentRunInput);
@@ -2965,6 +2976,7 @@ let UpdateMJAIAgentRunInput = class UpdateMJAIAgentRunInput {
2965
2976
  EffortLevel;
2966
2977
  RunName;
2967
2978
  Comments;
2979
+ ScheduledJobRunID;
2968
2980
  OldValues___;
2969
2981
  };
2970
2982
  __decorate([
@@ -3115,6 +3127,10 @@ __decorate([
3115
3127
  Field({ nullable: true }),
3116
3128
  __metadata("design:type", String)
3117
3129
  ], UpdateMJAIAgentRunInput.prototype, "Comments", void 0);
3130
+ __decorate([
3131
+ Field({ nullable: true }),
3132
+ __metadata("design:type", String)
3133
+ ], UpdateMJAIAgentRunInput.prototype, "ScheduledJobRunID", void 0);
3118
3134
  __decorate([
3119
3135
  Field(() => [KeyValuePairInput], { nullable: true }),
3120
3136
  __metadata("design:type", Array)
@@ -3187,22 +3203,22 @@ let MJAIAgentRunResolver = class MJAIAgentRunResolver extends ResolverBase {
3187
3203
  const result = this.MapFieldNamesToCodeNames('MJ: AI Agent Runs', rows && rows.length > 0 ? rows[0] : {});
3188
3204
  return result;
3189
3205
  }
3190
- async MJ_AIAgentRuns_ParentRunIDArray(mjaiagentrun_, { dataSources, userPayload, providers }, pubSub) {
3191
- this.CheckUserReadPermissions('MJ: AI Agent Runs', userPayload);
3206
+ async MJ_AIAgentRunSteps_AgentRunIDArray(mjaiagentrun_, { dataSources, userPayload, providers }, pubSub) {
3207
+ this.CheckUserReadPermissions('MJ: AI Agent Run Steps', userPayload);
3192
3208
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
3193
3209
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
3194
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentRuns] WHERE [ParentRunID]='${mjaiagentrun_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Runs', userPayload, EntityPermissionType.Read, 'AND');
3210
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentRunSteps] WHERE [AgentRunID]='${mjaiagentrun_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Run Steps', userPayload, EntityPermissionType.Read, 'AND');
3195
3211
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
3196
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Runs', rows);
3212
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Run Steps', rows);
3197
3213
  return result;
3198
3214
  }
3199
- async MJ_AIAgentRunSteps_AgentRunIDArray(mjaiagentrun_, { dataSources, userPayload, providers }, pubSub) {
3200
- this.CheckUserReadPermissions('MJ: AI Agent Run Steps', userPayload);
3215
+ async MJ_AIAgentRuns_ParentRunIDArray(mjaiagentrun_, { dataSources, userPayload, providers }, pubSub) {
3216
+ this.CheckUserReadPermissions('MJ: AI Agent Runs', userPayload);
3201
3217
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
3202
3218
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
3203
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentRunSteps] WHERE [AgentRunID]='${mjaiagentrun_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Run Steps', userPayload, EntityPermissionType.Read, 'AND');
3219
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentRuns] WHERE [ParentRunID]='${mjaiagentrun_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Runs', userPayload, EntityPermissionType.Read, 'AND');
3204
3220
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
3205
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Run Steps', rows);
3221
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Runs', rows);
3206
3222
  return result;
3207
3223
  }
3208
3224
  async MJ_AIPromptRuns_AgentRunIDArray(mjaiagentrun_, { dataSources, userPayload, providers }, pubSub) {
@@ -3265,23 +3281,23 @@ __decorate([
3265
3281
  __metadata("design:returntype", Promise)
3266
3282
  ], MJAIAgentRunResolver.prototype, "MJAIAgentRun", null);
3267
3283
  __decorate([
3268
- FieldResolver(() => [MJAIAgentRun_]),
3284
+ FieldResolver(() => [MJAIAgentRunStep_]),
3269
3285
  __param(0, Root()),
3270
3286
  __param(1, Ctx()),
3271
3287
  __param(2, PubSub()),
3272
3288
  __metadata("design:type", Function),
3273
3289
  __metadata("design:paramtypes", [MJAIAgentRun_, Object, PubSubEngine]),
3274
3290
  __metadata("design:returntype", Promise)
3275
- ], MJAIAgentRunResolver.prototype, "MJ_AIAgentRuns_ParentRunIDArray", null);
3291
+ ], MJAIAgentRunResolver.prototype, "MJ_AIAgentRunSteps_AgentRunIDArray", null);
3276
3292
  __decorate([
3277
- FieldResolver(() => [MJAIAgentRunStep_]),
3293
+ FieldResolver(() => [MJAIAgentRun_]),
3278
3294
  __param(0, Root()),
3279
3295
  __param(1, Ctx()),
3280
3296
  __param(2, PubSub()),
3281
3297
  __metadata("design:type", Function),
3282
3298
  __metadata("design:paramtypes", [MJAIAgentRun_, Object, PubSubEngine]),
3283
3299
  __metadata("design:returntype", Promise)
3284
- ], MJAIAgentRunResolver.prototype, "MJ_AIAgentRunSteps_AgentRunIDArray", null);
3300
+ ], MJAIAgentRunResolver.prototype, "MJ_AIAgentRuns_ParentRunIDArray", null);
3285
3301
  __decorate([
3286
3302
  FieldResolver(() => [MJAIPromptRun_]),
3287
3303
  __param(0, Root()),
@@ -3331,8 +3347,8 @@ let MJAIVendor_ = class MJAIVendor_ {
3331
3347
  _mj__UpdatedAt;
3332
3348
  MJ_AIPromptModels_VendorIDArray;
3333
3349
  AIResultCache_VendorIDArray;
3334
- MJ_AIPromptRuns_VendorIDArray;
3335
3350
  MJ_AIModelVendors_VendorIDArray;
3351
+ MJ_AIPromptRuns_VendorIDArray;
3336
3352
  MJ_AIVendorTypes_VendorIDArray;
3337
3353
  MJ_AIModelCosts_VendorIDArray;
3338
3354
  MJ_AIAgentRuns_OverrideVendorIDArray;
@@ -3369,14 +3385,14 @@ __decorate([
3369
3385
  Field(() => [MJAIResultCache_]),
3370
3386
  __metadata("design:type", Array)
3371
3387
  ], MJAIVendor_.prototype, "AIResultCache_VendorIDArray", void 0);
3372
- __decorate([
3373
- Field(() => [MJAIPromptRun_]),
3374
- __metadata("design:type", Array)
3375
- ], MJAIVendor_.prototype, "MJ_AIPromptRuns_VendorIDArray", void 0);
3376
3388
  __decorate([
3377
3389
  Field(() => [MJAIModelVendor_]),
3378
3390
  __metadata("design:type", Array)
3379
3391
  ], MJAIVendor_.prototype, "MJ_AIModelVendors_VendorIDArray", void 0);
3392
+ __decorate([
3393
+ Field(() => [MJAIPromptRun_]),
3394
+ __metadata("design:type", Array)
3395
+ ], MJAIVendor_.prototype, "MJ_AIPromptRuns_VendorIDArray", void 0);
3380
3396
  __decorate([
3381
3397
  Field(() => [MJAIVendorType_]),
3382
3398
  __metadata("design:type", Array)
@@ -3522,22 +3538,22 @@ let MJAIVendorResolver = class MJAIVendorResolver extends ResolverBase {
3522
3538
  const result = this.ArrayMapFieldNamesToCodeNames('AI Result Cache', rows);
3523
3539
  return result;
3524
3540
  }
3525
- async MJ_AIPromptRuns_VendorIDArray(mjaivendor_, { dataSources, userPayload, providers }, pubSub) {
3526
- this.CheckUserReadPermissions('MJ: AI Prompt Runs', userPayload);
3541
+ async MJ_AIModelVendors_VendorIDArray(mjaivendor_, { dataSources, userPayload, providers }, pubSub) {
3542
+ this.CheckUserReadPermissions('MJ: AI Model Vendors', userPayload);
3527
3543
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
3528
3544
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
3529
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIPromptRuns] WHERE [VendorID]='${mjaivendor_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Prompt Runs', userPayload, EntityPermissionType.Read, 'AND');
3545
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIModelVendors] WHERE [VendorID]='${mjaivendor_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Model Vendors', userPayload, EntityPermissionType.Read, 'AND');
3530
3546
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
3531
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Prompt Runs', rows);
3547
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Model Vendors', rows);
3532
3548
  return result;
3533
3549
  }
3534
- async MJ_AIModelVendors_VendorIDArray(mjaivendor_, { dataSources, userPayload, providers }, pubSub) {
3535
- this.CheckUserReadPermissions('MJ: AI Model Vendors', userPayload);
3550
+ async MJ_AIPromptRuns_VendorIDArray(mjaivendor_, { dataSources, userPayload, providers }, pubSub) {
3551
+ this.CheckUserReadPermissions('MJ: AI Prompt Runs', userPayload);
3536
3552
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
3537
3553
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
3538
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIModelVendors] WHERE [VendorID]='${mjaivendor_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Model Vendors', userPayload, EntityPermissionType.Read, 'AND');
3554
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIPromptRuns] WHERE [VendorID]='${mjaivendor_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Prompt Runs', userPayload, EntityPermissionType.Read, 'AND');
3539
3555
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
3540
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Model Vendors', rows);
3556
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Prompt Runs', rows);
3541
3557
  return result;
3542
3558
  }
3543
3559
  async MJ_AIVendorTypes_VendorIDArray(mjaivendor_, { dataSources, userPayload, providers }, pubSub) {
@@ -3636,23 +3652,23 @@ __decorate([
3636
3652
  __metadata("design:returntype", Promise)
3637
3653
  ], MJAIVendorResolver.prototype, "AIResultCache_VendorIDArray", null);
3638
3654
  __decorate([
3639
- FieldResolver(() => [MJAIPromptRun_]),
3655
+ FieldResolver(() => [MJAIModelVendor_]),
3640
3656
  __param(0, Root()),
3641
3657
  __param(1, Ctx()),
3642
3658
  __param(2, PubSub()),
3643
3659
  __metadata("design:type", Function),
3644
3660
  __metadata("design:paramtypes", [MJAIVendor_, Object, PubSubEngine]),
3645
3661
  __metadata("design:returntype", Promise)
3646
- ], MJAIVendorResolver.prototype, "MJ_AIPromptRuns_VendorIDArray", null);
3662
+ ], MJAIVendorResolver.prototype, "MJ_AIModelVendors_VendorIDArray", null);
3647
3663
  __decorate([
3648
- FieldResolver(() => [MJAIModelVendor_]),
3664
+ FieldResolver(() => [MJAIPromptRun_]),
3649
3665
  __param(0, Root()),
3650
3666
  __param(1, Ctx()),
3651
3667
  __param(2, PubSub()),
3652
3668
  __metadata("design:type", Function),
3653
3669
  __metadata("design:paramtypes", [MJAIVendor_, Object, PubSubEngine]),
3654
3670
  __metadata("design:returntype", Promise)
3655
- ], MJAIVendorResolver.prototype, "MJ_AIModelVendors_VendorIDArray", null);
3671
+ ], MJAIVendorResolver.prototype, "MJ_AIPromptRuns_VendorIDArray", null);
3656
3672
  __decorate([
3657
3673
  FieldResolver(() => [MJAIVendorType_]),
3658
3674
  __param(0, Root()),
@@ -3977,9 +3993,9 @@ let MJAIConfiguration_ = class MJAIConfiguration_ {
3977
3993
  DefaultPromptForContextSummarization;
3978
3994
  MJ_AIConfigurationParams_ConfigurationIDArray;
3979
3995
  MJ_AIAgentPrompts_ConfigurationIDArray;
3980
- MJ_AIPromptRuns_ConfigurationIDArray;
3981
- AIResultCache_ConfigurationIDArray;
3982
3996
  MJ_AIPromptModels_ConfigurationIDArray;
3997
+ AIResultCache_ConfigurationIDArray;
3998
+ MJ_AIPromptRuns_ConfigurationIDArray;
3983
3999
  MJ_AIAgentRuns_ConfigurationIDArray;
3984
4000
  };
3985
4001
  __decorate([
@@ -4044,17 +4060,17 @@ __decorate([
4044
4060
  __metadata("design:type", Array)
4045
4061
  ], MJAIConfiguration_.prototype, "MJ_AIAgentPrompts_ConfigurationIDArray", void 0);
4046
4062
  __decorate([
4047
- Field(() => [MJAIPromptRun_]),
4063
+ Field(() => [MJAIPromptModel_]),
4048
4064
  __metadata("design:type", Array)
4049
- ], MJAIConfiguration_.prototype, "MJ_AIPromptRuns_ConfigurationIDArray", void 0);
4065
+ ], MJAIConfiguration_.prototype, "MJ_AIPromptModels_ConfigurationIDArray", void 0);
4050
4066
  __decorate([
4051
4067
  Field(() => [MJAIResultCache_]),
4052
4068
  __metadata("design:type", Array)
4053
4069
  ], MJAIConfiguration_.prototype, "AIResultCache_ConfigurationIDArray", void 0);
4054
4070
  __decorate([
4055
- Field(() => [MJAIPromptModel_]),
4071
+ Field(() => [MJAIPromptRun_]),
4056
4072
  __metadata("design:type", Array)
4057
- ], MJAIConfiguration_.prototype, "MJ_AIPromptModels_ConfigurationIDArray", void 0);
4073
+ ], MJAIConfiguration_.prototype, "MJ_AIPromptRuns_ConfigurationIDArray", void 0);
4058
4074
  __decorate([
4059
4075
  Field(() => [MJAIAgentRun_]),
4060
4076
  __metadata("design:type", Array)
@@ -4232,13 +4248,13 @@ let MJAIConfigurationResolver = class MJAIConfigurationResolver extends Resolver
4232
4248
  const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Prompts', rows);
4233
4249
  return result;
4234
4250
  }
4235
- async MJ_AIPromptRuns_ConfigurationIDArray(mjaiconfiguration_, { dataSources, userPayload, providers }, pubSub) {
4236
- this.CheckUserReadPermissions('MJ: AI Prompt Runs', userPayload);
4251
+ async MJ_AIPromptModels_ConfigurationIDArray(mjaiconfiguration_, { dataSources, userPayload, providers }, pubSub) {
4252
+ this.CheckUserReadPermissions('MJ: AI Prompt Models', userPayload);
4237
4253
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
4238
4254
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
4239
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIPromptRuns] WHERE [ConfigurationID]='${mjaiconfiguration_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Prompt Runs', userPayload, EntityPermissionType.Read, 'AND');
4255
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIPromptModels] WHERE [ConfigurationID]='${mjaiconfiguration_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Prompt Models', userPayload, EntityPermissionType.Read, 'AND');
4240
4256
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
4241
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Prompt Runs', rows);
4257
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Prompt Models', rows);
4242
4258
  return result;
4243
4259
  }
4244
4260
  async AIResultCache_ConfigurationIDArray(mjaiconfiguration_, { dataSources, userPayload, providers }, pubSub) {
@@ -4250,13 +4266,13 @@ let MJAIConfigurationResolver = class MJAIConfigurationResolver extends Resolver
4250
4266
  const result = this.ArrayMapFieldNamesToCodeNames('AI Result Cache', rows);
4251
4267
  return result;
4252
4268
  }
4253
- async MJ_AIPromptModels_ConfigurationIDArray(mjaiconfiguration_, { dataSources, userPayload, providers }, pubSub) {
4254
- this.CheckUserReadPermissions('MJ: AI Prompt Models', userPayload);
4269
+ async MJ_AIPromptRuns_ConfigurationIDArray(mjaiconfiguration_, { dataSources, userPayload, providers }, pubSub) {
4270
+ this.CheckUserReadPermissions('MJ: AI Prompt Runs', userPayload);
4255
4271
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
4256
4272
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
4257
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIPromptModels] WHERE [ConfigurationID]='${mjaiconfiguration_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Prompt Models', userPayload, EntityPermissionType.Read, 'AND');
4273
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIPromptRuns] WHERE [ConfigurationID]='${mjaiconfiguration_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Prompt Runs', userPayload, EntityPermissionType.Read, 'AND');
4258
4274
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
4259
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Prompt Models', rows);
4275
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Prompt Runs', rows);
4260
4276
  return result;
4261
4277
  }
4262
4278
  async MJ_AIAgentRuns_ConfigurationIDArray(mjaiconfiguration_, { dataSources, userPayload, providers }, pubSub) {
@@ -4337,14 +4353,14 @@ __decorate([
4337
4353
  __metadata("design:returntype", Promise)
4338
4354
  ], MJAIConfigurationResolver.prototype, "MJ_AIAgentPrompts_ConfigurationIDArray", null);
4339
4355
  __decorate([
4340
- FieldResolver(() => [MJAIPromptRun_]),
4356
+ FieldResolver(() => [MJAIPromptModel_]),
4341
4357
  __param(0, Root()),
4342
4358
  __param(1, Ctx()),
4343
4359
  __param(2, PubSub()),
4344
4360
  __metadata("design:type", Function),
4345
4361
  __metadata("design:paramtypes", [MJAIConfiguration_, Object, PubSubEngine]),
4346
4362
  __metadata("design:returntype", Promise)
4347
- ], MJAIConfigurationResolver.prototype, "MJ_AIPromptRuns_ConfigurationIDArray", null);
4363
+ ], MJAIConfigurationResolver.prototype, "MJ_AIPromptModels_ConfigurationIDArray", null);
4348
4364
  __decorate([
4349
4365
  FieldResolver(() => [MJAIResultCache_]),
4350
4366
  __param(0, Root()),
@@ -4355,14 +4371,14 @@ __decorate([
4355
4371
  __metadata("design:returntype", Promise)
4356
4372
  ], MJAIConfigurationResolver.prototype, "AIResultCache_ConfigurationIDArray", null);
4357
4373
  __decorate([
4358
- FieldResolver(() => [MJAIPromptModel_]),
4374
+ FieldResolver(() => [MJAIPromptRun_]),
4359
4375
  __param(0, Root()),
4360
4376
  __param(1, Ctx()),
4361
4377
  __param(2, PubSub()),
4362
4378
  __metadata("design:type", Function),
4363
4379
  __metadata("design:paramtypes", [MJAIConfiguration_, Object, PubSubEngine]),
4364
4380
  __metadata("design:returntype", Promise)
4365
- ], MJAIConfigurationResolver.prototype, "MJ_AIPromptModels_ConfigurationIDArray", null);
4381
+ ], MJAIConfigurationResolver.prototype, "MJ_AIPromptRuns_ConfigurationIDArray", null);
4366
4382
  __decorate([
4367
4383
  FieldResolver(() => [MJAIAgentRun_]),
4368
4384
  __param(0, Root()),
@@ -4450,8 +4466,8 @@ let MJAIAgent_ = class MJAIAgent_ {
4450
4466
  DefaultArtifactType;
4451
4467
  OwnerUser;
4452
4468
  RootParentID;
4453
- AIAgentActions_AgentIDArray;
4454
4469
  AIAgentModels_AgentIDArray;
4470
+ AIAgentActions_AgentIDArray;
4455
4471
  AIAgentLearningCycles_AgentIDArray;
4456
4472
  AIAgentRequests_AgentIDArray;
4457
4473
  MJ_AIAgentSteps_AgentIDArray;
@@ -4680,14 +4696,14 @@ __decorate([
4680
4696
  MaxLength(16),
4681
4697
  __metadata("design:type", String)
4682
4698
  ], MJAIAgent_.prototype, "RootParentID", void 0);
4683
- __decorate([
4684
- Field(() => [MJAIAgentAction_]),
4685
- __metadata("design:type", Array)
4686
- ], MJAIAgent_.prototype, "AIAgentActions_AgentIDArray", void 0);
4687
4699
  __decorate([
4688
4700
  Field(() => [MJAIAgentModel_]),
4689
4701
  __metadata("design:type", Array)
4690
4702
  ], MJAIAgent_.prototype, "AIAgentModels_AgentIDArray", void 0);
4703
+ __decorate([
4704
+ Field(() => [MJAIAgentAction_]),
4705
+ __metadata("design:type", Array)
4706
+ ], MJAIAgent_.prototype, "AIAgentActions_AgentIDArray", void 0);
4691
4707
  __decorate([
4692
4708
  Field(() => [MJAIAgentLearningCycle_]),
4693
4709
  __metadata("design:type", Array)
@@ -5207,22 +5223,22 @@ let MJAIAgentResolver = class MJAIAgentResolver extends ResolverBase {
5207
5223
  const result = this.MapFieldNamesToCodeNames('AI Agents', rows && rows.length > 0 ? rows[0] : {});
5208
5224
  return result;
5209
5225
  }
5210
- async AIAgentActions_AgentIDArray(mjaiagent_, { dataSources, userPayload, providers }, pubSub) {
5211
- this.CheckUserReadPermissions('AI Agent Actions', userPayload);
5226
+ async AIAgentModels_AgentIDArray(mjaiagent_, { dataSources, userPayload, providers }, pubSub) {
5227
+ this.CheckUserReadPermissions('AI Agent Models', userPayload);
5212
5228
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
5213
5229
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
5214
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentActions] WHERE [AgentID]='${mjaiagent_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'AI Agent Actions', userPayload, EntityPermissionType.Read, 'AND');
5230
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentModels] WHERE [AgentID]='${mjaiagent_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'AI Agent Models', userPayload, EntityPermissionType.Read, 'AND');
5215
5231
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
5216
- const result = this.ArrayMapFieldNamesToCodeNames('AI Agent Actions', rows);
5232
+ const result = this.ArrayMapFieldNamesToCodeNames('AI Agent Models', rows);
5217
5233
  return result;
5218
5234
  }
5219
- async AIAgentModels_AgentIDArray(mjaiagent_, { dataSources, userPayload, providers }, pubSub) {
5220
- this.CheckUserReadPermissions('AI Agent Models', userPayload);
5235
+ async AIAgentActions_AgentIDArray(mjaiagent_, { dataSources, userPayload, providers }, pubSub) {
5236
+ this.CheckUserReadPermissions('AI Agent Actions', userPayload);
5221
5237
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
5222
5238
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
5223
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentModels] WHERE [AgentID]='${mjaiagent_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'AI Agent Models', userPayload, EntityPermissionType.Read, 'AND');
5239
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentActions] WHERE [AgentID]='${mjaiagent_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'AI Agent Actions', userPayload, EntityPermissionType.Read, 'AND');
5224
5240
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
5225
- const result = this.ArrayMapFieldNamesToCodeNames('AI Agent Models', rows);
5241
+ const result = this.ArrayMapFieldNamesToCodeNames('AI Agent Actions', rows);
5226
5242
  return result;
5227
5243
  }
5228
5244
  async AIAgentLearningCycles_AgentIDArray(mjaiagent_, { dataSources, userPayload, providers }, pubSub) {
@@ -5420,23 +5436,23 @@ __decorate([
5420
5436
  __metadata("design:returntype", Promise)
5421
5437
  ], MJAIAgentResolver.prototype, "MJAIAgent", null);
5422
5438
  __decorate([
5423
- FieldResolver(() => [MJAIAgentAction_]),
5439
+ FieldResolver(() => [MJAIAgentModel_]),
5424
5440
  __param(0, Root()),
5425
5441
  __param(1, Ctx()),
5426
5442
  __param(2, PubSub()),
5427
5443
  __metadata("design:type", Function),
5428
5444
  __metadata("design:paramtypes", [MJAIAgent_, Object, PubSubEngine]),
5429
5445
  __metadata("design:returntype", Promise)
5430
- ], MJAIAgentResolver.prototype, "AIAgentActions_AgentIDArray", null);
5446
+ ], MJAIAgentResolver.prototype, "AIAgentModels_AgentIDArray", null);
5431
5447
  __decorate([
5432
- FieldResolver(() => [MJAIAgentModel_]),
5448
+ FieldResolver(() => [MJAIAgentAction_]),
5433
5449
  __param(0, Root()),
5434
5450
  __param(1, Ctx()),
5435
5451
  __param(2, PubSub()),
5436
5452
  __metadata("design:type", Function),
5437
5453
  __metadata("design:paramtypes", [MJAIAgent_, Object, PubSubEngine]),
5438
5454
  __metadata("design:returntype", Promise)
5439
- ], MJAIAgentResolver.prototype, "AIAgentModels_AgentIDArray", null);
5455
+ ], MJAIAgentResolver.prototype, "AIAgentActions_AgentIDArray", null);
5440
5456
  __decorate([
5441
5457
  FieldResolver(() => [MJAIAgentLearningCycle_]),
5442
5458
  __param(0, Root()),
@@ -7630,11 +7646,11 @@ let MJEnvironment_ = class MJEnvironment_ {
7630
7646
  Settings;
7631
7647
  _mj__CreatedAt;
7632
7648
  _mj__UpdatedAt;
7633
- MJ_Collections_EnvironmentIDArray;
7634
7649
  MJ_Projects_EnvironmentIDArray;
7650
+ MJ_Collections_EnvironmentIDArray;
7635
7651
  MJ_Artifacts_EnvironmentIDArray;
7636
- Dashboards_EnvironmentIDArray;
7637
7652
  MJ_Tasks_EnvironmentIDArray;
7653
+ Dashboards_EnvironmentIDArray;
7638
7654
  Reports_EnvironmentIDArray;
7639
7655
  Conversations_EnvironmentIDArray;
7640
7656
  };
@@ -7670,26 +7686,26 @@ __decorate([
7670
7686
  MaxLength(10),
7671
7687
  __metadata("design:type", Date)
7672
7688
  ], MJEnvironment_.prototype, "_mj__UpdatedAt", void 0);
7673
- __decorate([
7674
- Field(() => [MJCollection_]),
7675
- __metadata("design:type", Array)
7676
- ], MJEnvironment_.prototype, "MJ_Collections_EnvironmentIDArray", void 0);
7677
7689
  __decorate([
7678
7690
  Field(() => [MJProject_]),
7679
7691
  __metadata("design:type", Array)
7680
7692
  ], MJEnvironment_.prototype, "MJ_Projects_EnvironmentIDArray", void 0);
7681
7693
  __decorate([
7682
- Field(() => [MJArtifact_]),
7694
+ Field(() => [MJCollection_]),
7683
7695
  __metadata("design:type", Array)
7684
- ], MJEnvironment_.prototype, "MJ_Artifacts_EnvironmentIDArray", void 0);
7696
+ ], MJEnvironment_.prototype, "MJ_Collections_EnvironmentIDArray", void 0);
7685
7697
  __decorate([
7686
- Field(() => [MJDashboard_]),
7698
+ Field(() => [MJArtifact_]),
7687
7699
  __metadata("design:type", Array)
7688
- ], MJEnvironment_.prototype, "Dashboards_EnvironmentIDArray", void 0);
7700
+ ], MJEnvironment_.prototype, "MJ_Artifacts_EnvironmentIDArray", void 0);
7689
7701
  __decorate([
7690
7702
  Field(() => [MJTask_]),
7691
7703
  __metadata("design:type", Array)
7692
7704
  ], MJEnvironment_.prototype, "MJ_Tasks_EnvironmentIDArray", void 0);
7705
+ __decorate([
7706
+ Field(() => [MJDashboard_]),
7707
+ __metadata("design:type", Array)
7708
+ ], MJEnvironment_.prototype, "Dashboards_EnvironmentIDArray", void 0);
7693
7709
  __decorate([
7694
7710
  Field(() => [MJReport_]),
7695
7711
  __metadata("design:type", Array)
@@ -7833,22 +7849,22 @@ let MJEnvironmentResolver = class MJEnvironmentResolver extends ResolverBase {
7833
7849
  const result = this.MapFieldNamesToCodeNames('MJ: Environments', rows && rows.length > 0 ? rows[0] : {});
7834
7850
  return result;
7835
7851
  }
7836
- async MJ_Collections_EnvironmentIDArray(mjenvironment_, { dataSources, userPayload, providers }, pubSub) {
7837
- this.CheckUserReadPermissions('MJ: Collections', userPayload);
7852
+ async MJ_Projects_EnvironmentIDArray(mjenvironment_, { dataSources, userPayload, providers }, pubSub) {
7853
+ this.CheckUserReadPermissions('MJ: Projects', userPayload);
7838
7854
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
7839
7855
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
7840
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwCollections] WHERE [EnvironmentID]='${mjenvironment_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Collections', userPayload, EntityPermissionType.Read, 'AND');
7856
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwProjects] WHERE [EnvironmentID]='${mjenvironment_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Projects', userPayload, EntityPermissionType.Read, 'AND');
7841
7857
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
7842
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: Collections', rows);
7858
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Projects', rows);
7843
7859
  return result;
7844
7860
  }
7845
- async MJ_Projects_EnvironmentIDArray(mjenvironment_, { dataSources, userPayload, providers }, pubSub) {
7846
- this.CheckUserReadPermissions('MJ: Projects', userPayload);
7861
+ async MJ_Collections_EnvironmentIDArray(mjenvironment_, { dataSources, userPayload, providers }, pubSub) {
7862
+ this.CheckUserReadPermissions('MJ: Collections', userPayload);
7847
7863
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
7848
7864
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
7849
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwProjects] WHERE [EnvironmentID]='${mjenvironment_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Projects', userPayload, EntityPermissionType.Read, 'AND');
7865
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwCollections] WHERE [EnvironmentID]='${mjenvironment_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Collections', userPayload, EntityPermissionType.Read, 'AND');
7850
7866
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
7851
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: Projects', rows);
7867
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Collections', rows);
7852
7868
  return result;
7853
7869
  }
7854
7870
  async MJ_Artifacts_EnvironmentIDArray(mjenvironment_, { dataSources, userPayload, providers }, pubSub) {
@@ -7860,22 +7876,22 @@ let MJEnvironmentResolver = class MJEnvironmentResolver extends ResolverBase {
7860
7876
  const result = this.ArrayMapFieldNamesToCodeNames('MJ: Artifacts', rows);
7861
7877
  return result;
7862
7878
  }
7863
- async Dashboards_EnvironmentIDArray(mjenvironment_, { dataSources, userPayload, providers }, pubSub) {
7864
- this.CheckUserReadPermissions('Dashboards', userPayload);
7879
+ async MJ_Tasks_EnvironmentIDArray(mjenvironment_, { dataSources, userPayload, providers }, pubSub) {
7880
+ this.CheckUserReadPermissions('MJ: Tasks', userPayload);
7865
7881
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
7866
7882
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
7867
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwDashboards] WHERE [EnvironmentID]='${mjenvironment_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'Dashboards', userPayload, EntityPermissionType.Read, 'AND');
7883
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwTasks] WHERE [EnvironmentID]='${mjenvironment_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Tasks', userPayload, EntityPermissionType.Read, 'AND');
7868
7884
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
7869
- const result = this.ArrayMapFieldNamesToCodeNames('Dashboards', rows);
7885
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Tasks', rows);
7870
7886
  return result;
7871
7887
  }
7872
- async MJ_Tasks_EnvironmentIDArray(mjenvironment_, { dataSources, userPayload, providers }, pubSub) {
7873
- this.CheckUserReadPermissions('MJ: Tasks', userPayload);
7888
+ async Dashboards_EnvironmentIDArray(mjenvironment_, { dataSources, userPayload, providers }, pubSub) {
7889
+ this.CheckUserReadPermissions('Dashboards', userPayload);
7874
7890
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
7875
7891
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
7876
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwTasks] WHERE [EnvironmentID]='${mjenvironment_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Tasks', userPayload, EntityPermissionType.Read, 'AND');
7892
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwDashboards] WHERE [EnvironmentID]='${mjenvironment_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'Dashboards', userPayload, EntityPermissionType.Read, 'AND');
7877
7893
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
7878
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: Tasks', rows);
7894
+ const result = this.ArrayMapFieldNamesToCodeNames('Dashboards', rows);
7879
7895
  return result;
7880
7896
  }
7881
7897
  async Reports_EnvironmentIDArray(mjenvironment_, { dataSources, userPayload, providers }, pubSub) {
@@ -7947,23 +7963,23 @@ __decorate([
7947
7963
  __metadata("design:returntype", Promise)
7948
7964
  ], MJEnvironmentResolver.prototype, "MJEnvironment", null);
7949
7965
  __decorate([
7950
- FieldResolver(() => [MJCollection_]),
7966
+ FieldResolver(() => [MJProject_]),
7951
7967
  __param(0, Root()),
7952
7968
  __param(1, Ctx()),
7953
7969
  __param(2, PubSub()),
7954
7970
  __metadata("design:type", Function),
7955
7971
  __metadata("design:paramtypes", [MJEnvironment_, Object, PubSubEngine]),
7956
7972
  __metadata("design:returntype", Promise)
7957
- ], MJEnvironmentResolver.prototype, "MJ_Collections_EnvironmentIDArray", null);
7973
+ ], MJEnvironmentResolver.prototype, "MJ_Projects_EnvironmentIDArray", null);
7958
7974
  __decorate([
7959
- FieldResolver(() => [MJProject_]),
7975
+ FieldResolver(() => [MJCollection_]),
7960
7976
  __param(0, Root()),
7961
7977
  __param(1, Ctx()),
7962
7978
  __param(2, PubSub()),
7963
7979
  __metadata("design:type", Function),
7964
7980
  __metadata("design:paramtypes", [MJEnvironment_, Object, PubSubEngine]),
7965
7981
  __metadata("design:returntype", Promise)
7966
- ], MJEnvironmentResolver.prototype, "MJ_Projects_EnvironmentIDArray", null);
7982
+ ], MJEnvironmentResolver.prototype, "MJ_Collections_EnvironmentIDArray", null);
7967
7983
  __decorate([
7968
7984
  FieldResolver(() => [MJArtifact_]),
7969
7985
  __param(0, Root()),
@@ -7974,23 +7990,23 @@ __decorate([
7974
7990
  __metadata("design:returntype", Promise)
7975
7991
  ], MJEnvironmentResolver.prototype, "MJ_Artifacts_EnvironmentIDArray", null);
7976
7992
  __decorate([
7977
- FieldResolver(() => [MJDashboard_]),
7993
+ FieldResolver(() => [MJTask_]),
7978
7994
  __param(0, Root()),
7979
7995
  __param(1, Ctx()),
7980
7996
  __param(2, PubSub()),
7981
7997
  __metadata("design:type", Function),
7982
7998
  __metadata("design:paramtypes", [MJEnvironment_, Object, PubSubEngine]),
7983
7999
  __metadata("design:returntype", Promise)
7984
- ], MJEnvironmentResolver.prototype, "Dashboards_EnvironmentIDArray", null);
8000
+ ], MJEnvironmentResolver.prototype, "MJ_Tasks_EnvironmentIDArray", null);
7985
8001
  __decorate([
7986
- FieldResolver(() => [MJTask_]),
8002
+ FieldResolver(() => [MJDashboard_]),
7987
8003
  __param(0, Root()),
7988
8004
  __param(1, Ctx()),
7989
8005
  __param(2, PubSub()),
7990
8006
  __metadata("design:type", Function),
7991
8007
  __metadata("design:paramtypes", [MJEnvironment_, Object, PubSubEngine]),
7992
8008
  __metadata("design:returntype", Promise)
7993
- ], MJEnvironmentResolver.prototype, "MJ_Tasks_EnvironmentIDArray", null);
8009
+ ], MJEnvironmentResolver.prototype, "Dashboards_EnvironmentIDArray", null);
7994
8010
  __decorate([
7995
8011
  FieldResolver(() => [MJReport_]),
7996
8012
  __param(0, Root()),
@@ -9845,8 +9861,8 @@ let MJAIPrompt_ = class MJAIPrompt_ {
9845
9861
  MJ_AIAgentTypes_SystemPromptIDArray;
9846
9862
  MJ_AIConfigurations_DefaultPromptForContextSummarizationIDArray;
9847
9863
  AIPrompts_ResultSelectorPromptIDArray;
9848
- MJ_AIAgentPrompts_PromptIDArray;
9849
9864
  MJ_AIPromptModels_PromptIDArray;
9865
+ MJ_AIAgentPrompts_PromptIDArray;
9850
9866
  MJ_AIAgentSteps_PromptIDArray;
9851
9867
  MJ_AIPromptRuns_PromptIDArray;
9852
9868
  AIAgents_ContextCompressionPromptIDArray;
@@ -10130,14 +10146,14 @@ __decorate([
10130
10146
  Field(() => [MJAIPrompt_]),
10131
10147
  __metadata("design:type", Array)
10132
10148
  ], MJAIPrompt_.prototype, "AIPrompts_ResultSelectorPromptIDArray", void 0);
10133
- __decorate([
10134
- Field(() => [MJAIAgentPrompt_]),
10135
- __metadata("design:type", Array)
10136
- ], MJAIPrompt_.prototype, "MJ_AIAgentPrompts_PromptIDArray", void 0);
10137
10149
  __decorate([
10138
10150
  Field(() => [MJAIPromptModel_]),
10139
10151
  __metadata("design:type", Array)
10140
10152
  ], MJAIPrompt_.prototype, "MJ_AIPromptModels_PromptIDArray", void 0);
10153
+ __decorate([
10154
+ Field(() => [MJAIAgentPrompt_]),
10155
+ __metadata("design:type", Array)
10156
+ ], MJAIPrompt_.prototype, "MJ_AIAgentPrompts_PromptIDArray", void 0);
10141
10157
  __decorate([
10142
10158
  Field(() => [MJAIAgentStep_]),
10143
10159
  __metadata("design:type", Array)
@@ -10770,22 +10786,22 @@ let MJAIPromptResolver = class MJAIPromptResolver extends ResolverBase {
10770
10786
  const result = this.ArrayMapFieldNamesToCodeNames('AI Prompts', rows);
10771
10787
  return result;
10772
10788
  }
10773
- async MJ_AIAgentPrompts_PromptIDArray(mjaiprompt_, { dataSources, userPayload, providers }, pubSub) {
10774
- this.CheckUserReadPermissions('MJ: AI Agent Prompts', userPayload);
10789
+ async MJ_AIPromptModels_PromptIDArray(mjaiprompt_, { dataSources, userPayload, providers }, pubSub) {
10790
+ this.CheckUserReadPermissions('MJ: AI Prompt Models', userPayload);
10775
10791
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
10776
10792
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
10777
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentPrompts] WHERE [PromptID]='${mjaiprompt_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Prompts', userPayload, EntityPermissionType.Read, 'AND');
10793
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIPromptModels] WHERE [PromptID]='${mjaiprompt_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Prompt Models', userPayload, EntityPermissionType.Read, 'AND');
10778
10794
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
10779
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Prompts', rows);
10795
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Prompt Models', rows);
10780
10796
  return result;
10781
10797
  }
10782
- async MJ_AIPromptModels_PromptIDArray(mjaiprompt_, { dataSources, userPayload, providers }, pubSub) {
10783
- this.CheckUserReadPermissions('MJ: AI Prompt Models', userPayload);
10798
+ async MJ_AIAgentPrompts_PromptIDArray(mjaiprompt_, { dataSources, userPayload, providers }, pubSub) {
10799
+ this.CheckUserReadPermissions('MJ: AI Agent Prompts', userPayload);
10784
10800
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
10785
10801
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
10786
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIPromptModels] WHERE [PromptID]='${mjaiprompt_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Prompt Models', userPayload, EntityPermissionType.Read, 'AND');
10802
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentPrompts] WHERE [PromptID]='${mjaiprompt_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Prompts', userPayload, EntityPermissionType.Read, 'AND');
10787
10803
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
10788
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Prompt Models', rows);
10804
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Prompts', rows);
10789
10805
  return result;
10790
10806
  }
10791
10807
  async MJ_AIAgentSteps_PromptIDArray(mjaiprompt_, { dataSources, userPayload, providers }, pubSub) {
@@ -10911,23 +10927,23 @@ __decorate([
10911
10927
  __metadata("design:returntype", Promise)
10912
10928
  ], MJAIPromptResolver.prototype, "AIPrompts_ResultSelectorPromptIDArray", null);
10913
10929
  __decorate([
10914
- FieldResolver(() => [MJAIAgentPrompt_]),
10930
+ FieldResolver(() => [MJAIPromptModel_]),
10915
10931
  __param(0, Root()),
10916
10932
  __param(1, Ctx()),
10917
10933
  __param(2, PubSub()),
10918
10934
  __metadata("design:type", Function),
10919
10935
  __metadata("design:paramtypes", [MJAIPrompt_, Object, PubSubEngine]),
10920
10936
  __metadata("design:returntype", Promise)
10921
- ], MJAIPromptResolver.prototype, "MJ_AIAgentPrompts_PromptIDArray", null);
10937
+ ], MJAIPromptResolver.prototype, "MJ_AIPromptModels_PromptIDArray", null);
10922
10938
  __decorate([
10923
- FieldResolver(() => [MJAIPromptModel_]),
10939
+ FieldResolver(() => [MJAIAgentPrompt_]),
10924
10940
  __param(0, Root()),
10925
10941
  __param(1, Ctx()),
10926
10942
  __param(2, PubSub()),
10927
10943
  __metadata("design:type", Function),
10928
10944
  __metadata("design:paramtypes", [MJAIPrompt_, Object, PubSubEngine]),
10929
10945
  __metadata("design:returntype", Promise)
10930
- ], MJAIPromptResolver.prototype, "MJ_AIPromptModels_PromptIDArray", null);
10946
+ ], MJAIPromptResolver.prototype, "MJ_AIAgentPrompts_PromptIDArray", null);
10931
10947
  __decorate([
10932
10948
  FieldResolver(() => [MJAIAgentStep_]),
10933
10949
  __param(0, Root()),
@@ -18650,15 +18666,18 @@ let MJUser_ = class MJUser_ {
18650
18666
  AIAgentRequests_ResponseByUserIDArray;
18651
18667
  AIAgentNotes_UserIDArray;
18652
18668
  MJ_ReportUserStates_UserIDArray;
18653
- MJ_DashboardUserStates_UserIDArray;
18654
18669
  MJ_DashboardUserPreferences_UserIDArray;
18670
+ MJ_DashboardUserStates_UserIDArray;
18655
18671
  MJ_ArtifactVersions_UserIDArray;
18656
18672
  MJ_PublicLinks_UserIDArray;
18673
+ MJ_ScheduledJobs_NotifyUserIDArray;
18674
+ MJ_ScheduledJobRuns_ExecutedByUserIDArray;
18657
18675
  ResourcePermissions_UserIDArray;
18658
18676
  AIAgentRequests_RequestForUserIDArray;
18659
18677
  ConversationDetails_UserIDArray;
18660
18678
  MJ_AccessControlRules_GrantedByUserIDArray;
18661
18679
  MJ_Artifacts_UserIDArray;
18680
+ MJ_ScheduledJobs_OwnerUserIDArray;
18662
18681
  MJ_AIAgentRuns_UserIDArray;
18663
18682
  MJ_AIAgentPermissions_UserIDArray;
18664
18683
  MJ_Tasks_UserIDArray;
@@ -18907,14 +18926,14 @@ __decorate([
18907
18926
  Field(() => [MJReportUserState_]),
18908
18927
  __metadata("design:type", Array)
18909
18928
  ], MJUser_.prototype, "MJ_ReportUserStates_UserIDArray", void 0);
18910
- __decorate([
18911
- Field(() => [MJDashboardUserState_]),
18912
- __metadata("design:type", Array)
18913
- ], MJUser_.prototype, "MJ_DashboardUserStates_UserIDArray", void 0);
18914
18929
  __decorate([
18915
18930
  Field(() => [MJDashboardUserPreference_]),
18916
18931
  __metadata("design:type", Array)
18917
18932
  ], MJUser_.prototype, "MJ_DashboardUserPreferences_UserIDArray", void 0);
18933
+ __decorate([
18934
+ Field(() => [MJDashboardUserState_]),
18935
+ __metadata("design:type", Array)
18936
+ ], MJUser_.prototype, "MJ_DashboardUserStates_UserIDArray", void 0);
18918
18937
  __decorate([
18919
18938
  Field(() => [MJArtifactVersion_]),
18920
18939
  __metadata("design:type", Array)
@@ -18923,6 +18942,14 @@ __decorate([
18923
18942
  Field(() => [MJPublicLink_]),
18924
18943
  __metadata("design:type", Array)
18925
18944
  ], MJUser_.prototype, "MJ_PublicLinks_UserIDArray", void 0);
18945
+ __decorate([
18946
+ Field(() => [MJScheduledJob_]),
18947
+ __metadata("design:type", Array)
18948
+ ], MJUser_.prototype, "MJ_ScheduledJobs_NotifyUserIDArray", void 0);
18949
+ __decorate([
18950
+ Field(() => [MJScheduledJobRun_]),
18951
+ __metadata("design:type", Array)
18952
+ ], MJUser_.prototype, "MJ_ScheduledJobRuns_ExecutedByUserIDArray", void 0);
18926
18953
  __decorate([
18927
18954
  Field(() => [MJResourcePermission_]),
18928
18955
  __metadata("design:type", Array)
@@ -18943,6 +18970,10 @@ __decorate([
18943
18970
  Field(() => [MJArtifact_]),
18944
18971
  __metadata("design:type", Array)
18945
18972
  ], MJUser_.prototype, "MJ_Artifacts_UserIDArray", void 0);
18973
+ __decorate([
18974
+ Field(() => [MJScheduledJob_]),
18975
+ __metadata("design:type", Array)
18976
+ ], MJUser_.prototype, "MJ_ScheduledJobs_OwnerUserIDArray", void 0);
18946
18977
  __decorate([
18947
18978
  Field(() => [MJAIAgentRun_]),
18948
18979
  __metadata("design:type", Array)
@@ -19497,22 +19528,22 @@ let MJUserResolverBase = class MJUserResolverBase extends ResolverBase {
19497
19528
  const result = this.ArrayMapFieldNamesToCodeNames('MJ: Report User States', rows);
19498
19529
  return result;
19499
19530
  }
19500
- async MJ_DashboardUserStates_UserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
19501
- this.CheckUserReadPermissions('MJ: Dashboard User States', userPayload);
19531
+ async MJ_DashboardUserPreferences_UserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
19532
+ this.CheckUserReadPermissions('MJ: Dashboard User Preferences', userPayload);
19502
19533
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
19503
19534
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
19504
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwDashboardUserStates] WHERE [UserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Dashboard User States', userPayload, EntityPermissionType.Read, 'AND');
19535
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwDashboardUserPreferences] WHERE [UserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Dashboard User Preferences', userPayload, EntityPermissionType.Read, 'AND');
19505
19536
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
19506
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: Dashboard User States', rows);
19537
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Dashboard User Preferences', rows);
19507
19538
  return result;
19508
19539
  }
19509
- async MJ_DashboardUserPreferences_UserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
19510
- this.CheckUserReadPermissions('MJ: Dashboard User Preferences', userPayload);
19540
+ async MJ_DashboardUserStates_UserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
19541
+ this.CheckUserReadPermissions('MJ: Dashboard User States', userPayload);
19511
19542
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
19512
19543
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
19513
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwDashboardUserPreferences] WHERE [UserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Dashboard User Preferences', userPayload, EntityPermissionType.Read, 'AND');
19544
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwDashboardUserStates] WHERE [UserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Dashboard User States', userPayload, EntityPermissionType.Read, 'AND');
19514
19545
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
19515
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: Dashboard User Preferences', rows);
19546
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Dashboard User States', rows);
19516
19547
  return result;
19517
19548
  }
19518
19549
  async MJ_ArtifactVersions_UserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
@@ -19533,6 +19564,24 @@ let MJUserResolverBase = class MJUserResolverBase extends ResolverBase {
19533
19564
  const result = this.ArrayMapFieldNamesToCodeNames('MJ: Public Links', rows);
19534
19565
  return result;
19535
19566
  }
19567
+ async MJ_ScheduledJobs_NotifyUserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
19568
+ this.CheckUserReadPermissions('MJ: Scheduled Jobs', userPayload);
19569
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
19570
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
19571
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwScheduledJobs] WHERE [NotifyUserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Scheduled Jobs', userPayload, EntityPermissionType.Read, 'AND');
19572
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
19573
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Scheduled Jobs', rows);
19574
+ return result;
19575
+ }
19576
+ async MJ_ScheduledJobRuns_ExecutedByUserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
19577
+ this.CheckUserReadPermissions('MJ: Scheduled Job Runs', userPayload);
19578
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
19579
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
19580
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwScheduledJobRuns] WHERE [ExecutedByUserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Scheduled Job Runs', userPayload, EntityPermissionType.Read, 'AND');
19581
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
19582
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Scheduled Job Runs', rows);
19583
+ return result;
19584
+ }
19536
19585
  async ResourcePermissions_UserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
19537
19586
  this.CheckUserReadPermissions('Resource Permissions', userPayload);
19538
19587
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
@@ -19578,6 +19627,15 @@ let MJUserResolverBase = class MJUserResolverBase extends ResolverBase {
19578
19627
  const result = this.ArrayMapFieldNamesToCodeNames('MJ: Artifacts', rows);
19579
19628
  return result;
19580
19629
  }
19630
+ async MJ_ScheduledJobs_OwnerUserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
19631
+ this.CheckUserReadPermissions('MJ: Scheduled Jobs', userPayload);
19632
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
19633
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
19634
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwScheduledJobs] WHERE [OwnerUserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Scheduled Jobs', userPayload, EntityPermissionType.Read, 'AND');
19635
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
19636
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Scheduled Jobs', rows);
19637
+ return result;
19638
+ }
19581
19639
  async MJ_AIAgentRuns_UserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
19582
19640
  this.CheckUserReadPermissions('MJ: AI Agent Runs', userPayload);
19583
19641
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
@@ -19997,23 +20055,23 @@ __decorate([
19997
20055
  __metadata("design:returntype", Promise)
19998
20056
  ], MJUserResolverBase.prototype, "MJ_ReportUserStates_UserIDArray", null);
19999
20057
  __decorate([
20000
- FieldResolver(() => [MJDashboardUserState_]),
20058
+ FieldResolver(() => [MJDashboardUserPreference_]),
20001
20059
  __param(0, Root()),
20002
20060
  __param(1, Ctx()),
20003
20061
  __param(2, PubSub()),
20004
20062
  __metadata("design:type", Function),
20005
20063
  __metadata("design:paramtypes", [MJUser_, Object, PubSubEngine]),
20006
20064
  __metadata("design:returntype", Promise)
20007
- ], MJUserResolverBase.prototype, "MJ_DashboardUserStates_UserIDArray", null);
20065
+ ], MJUserResolverBase.prototype, "MJ_DashboardUserPreferences_UserIDArray", null);
20008
20066
  __decorate([
20009
- FieldResolver(() => [MJDashboardUserPreference_]),
20067
+ FieldResolver(() => [MJDashboardUserState_]),
20010
20068
  __param(0, Root()),
20011
20069
  __param(1, Ctx()),
20012
20070
  __param(2, PubSub()),
20013
20071
  __metadata("design:type", Function),
20014
20072
  __metadata("design:paramtypes", [MJUser_, Object, PubSubEngine]),
20015
20073
  __metadata("design:returntype", Promise)
20016
- ], MJUserResolverBase.prototype, "MJ_DashboardUserPreferences_UserIDArray", null);
20074
+ ], MJUserResolverBase.prototype, "MJ_DashboardUserStates_UserIDArray", null);
20017
20075
  __decorate([
20018
20076
  FieldResolver(() => [MJArtifactVersion_]),
20019
20077
  __param(0, Root()),
@@ -20032,6 +20090,24 @@ __decorate([
20032
20090
  __metadata("design:paramtypes", [MJUser_, Object, PubSubEngine]),
20033
20091
  __metadata("design:returntype", Promise)
20034
20092
  ], MJUserResolverBase.prototype, "MJ_PublicLinks_UserIDArray", null);
20093
+ __decorate([
20094
+ FieldResolver(() => [MJScheduledJob_]),
20095
+ __param(0, Root()),
20096
+ __param(1, Ctx()),
20097
+ __param(2, PubSub()),
20098
+ __metadata("design:type", Function),
20099
+ __metadata("design:paramtypes", [MJUser_, Object, PubSubEngine]),
20100
+ __metadata("design:returntype", Promise)
20101
+ ], MJUserResolverBase.prototype, "MJ_ScheduledJobs_NotifyUserIDArray", null);
20102
+ __decorate([
20103
+ FieldResolver(() => [MJScheduledJobRun_]),
20104
+ __param(0, Root()),
20105
+ __param(1, Ctx()),
20106
+ __param(2, PubSub()),
20107
+ __metadata("design:type", Function),
20108
+ __metadata("design:paramtypes", [MJUser_, Object, PubSubEngine]),
20109
+ __metadata("design:returntype", Promise)
20110
+ ], MJUserResolverBase.prototype, "MJ_ScheduledJobRuns_ExecutedByUserIDArray", null);
20035
20111
  __decorate([
20036
20112
  FieldResolver(() => [MJResourcePermission_]),
20037
20113
  __param(0, Root()),
@@ -20077,6 +20153,15 @@ __decorate([
20077
20153
  __metadata("design:paramtypes", [MJUser_, Object, PubSubEngine]),
20078
20154
  __metadata("design:returntype", Promise)
20079
20155
  ], MJUserResolverBase.prototype, "MJ_Artifacts_UserIDArray", null);
20156
+ __decorate([
20157
+ FieldResolver(() => [MJScheduledJob_]),
20158
+ __param(0, Root()),
20159
+ __param(1, Ctx()),
20160
+ __param(2, PubSub()),
20161
+ __metadata("design:type", Function),
20162
+ __metadata("design:paramtypes", [MJUser_, Object, PubSubEngine]),
20163
+ __metadata("design:returntype", Promise)
20164
+ ], MJUserResolverBase.prototype, "MJ_ScheduledJobs_OwnerUserIDArray", null);
20080
20165
  __decorate([
20081
20166
  FieldResolver(() => [MJAIAgentRun_]),
20082
20167
  __param(0, Root()),
@@ -62263,6 +62348,379 @@ MJQueryEntityResolver = __decorate([
62263
62348
  Resolver(MJQueryEntity_)
62264
62349
  ], MJQueryEntityResolver);
62265
62350
  export { MJQueryEntityResolver };
62351
+ let MJScheduledJobRun_ = class MJScheduledJobRun_ {
62352
+ ID;
62353
+ ScheduledJobID;
62354
+ StartedAt;
62355
+ CompletedAt;
62356
+ Status;
62357
+ Success;
62358
+ ErrorMessage;
62359
+ Details;
62360
+ ExecutedByUserID;
62361
+ QueuedAt;
62362
+ _mj__CreatedAt;
62363
+ _mj__UpdatedAt;
62364
+ ScheduledJob;
62365
+ ExecutedByUser;
62366
+ MJ_AIAgentRuns_ScheduledJobRunIDArray;
62367
+ };
62368
+ __decorate([
62369
+ Field(),
62370
+ MaxLength(16),
62371
+ __metadata("design:type", String)
62372
+ ], MJScheduledJobRun_.prototype, "ID", void 0);
62373
+ __decorate([
62374
+ Field(),
62375
+ MaxLength(16),
62376
+ __metadata("design:type", String)
62377
+ ], MJScheduledJobRun_.prototype, "ScheduledJobID", void 0);
62378
+ __decorate([
62379
+ Field({ description: `Timestamp when this job execution began. Set immediately before calling the job plugin's Execute method.` }),
62380
+ MaxLength(10),
62381
+ __metadata("design:type", Date)
62382
+ ], MJScheduledJobRun_.prototype, "StartedAt", void 0);
62383
+ __decorate([
62384
+ Field({ nullable: true, description: `Timestamp when this job execution completed (successfully or with failure). NULL while the job is still running.` }),
62385
+ MaxLength(10),
62386
+ __metadata("design:type", Date)
62387
+ ], MJScheduledJobRun_.prototype, "CompletedAt", void 0);
62388
+ __decorate([
62389
+ Field({ description: `Current status of the job execution. Running=currently executing, Completed=finished (check Success for outcome), Failed=exception during execution, Cancelled=manually cancelled, Timeout=exceeded maximum execution time.` }),
62390
+ MaxLength(40),
62391
+ __metadata("design:type", String)
62392
+ ], MJScheduledJobRun_.prototype, "Status", void 0);
62393
+ __decorate([
62394
+ Field(() => Boolean, { nullable: true, description: `Whether the job execution completed successfully. NULL while running, TRUE if successful, FALSE if failed. This is the job-level success from the plugin's Execute method, separate from domain-specific success tracking.` }),
62395
+ __metadata("design:type", Boolean)
62396
+ ], MJScheduledJobRun_.prototype, "Success", void 0);
62397
+ __decorate([
62398
+ Field({ nullable: true, description: `Error message if the job failed. NULL for successful runs. Contains exception messages or error details from the plugin's Execute method.` }),
62399
+ __metadata("design:type", String)
62400
+ ], MJScheduledJobRun_.prototype, "ErrorMessage", void 0);
62401
+ __decorate([
62402
+ Field({ nullable: true, description: `Job-type specific execution details stored as JSON. May include references to domain-specific run records (e.g., {"AgentRunID": "...", "TokensUsed": 5000}), performance metrics, or other execution metadata. Schema is defined by the job type plugin.` }),
62403
+ __metadata("design:type", String)
62404
+ ], MJScheduledJobRun_.prototype, "Details", void 0);
62405
+ __decorate([
62406
+ Field({ nullable: true, description: `User context under which the job was executed. Typically the OwnerUserID from the schedule, but can be overridden in job-specific configuration.` }),
62407
+ MaxLength(16),
62408
+ __metadata("design:type", String)
62409
+ ], MJScheduledJobRun_.prototype, "ExecutedByUserID", void 0);
62410
+ __decorate([
62411
+ Field({ nullable: true, description: `Timestamp when this execution was queued (for ConcurrencyMode=Queue). NULL for immediate executions. When set, indicates this run is waiting for a previous execution to complete before starting.` }),
62412
+ MaxLength(10),
62413
+ __metadata("design:type", Date)
62414
+ ], MJScheduledJobRun_.prototype, "QueuedAt", void 0);
62415
+ __decorate([
62416
+ Field(),
62417
+ MaxLength(10),
62418
+ __metadata("design:type", Date)
62419
+ ], MJScheduledJobRun_.prototype, "_mj__CreatedAt", void 0);
62420
+ __decorate([
62421
+ Field(),
62422
+ MaxLength(10),
62423
+ __metadata("design:type", Date)
62424
+ ], MJScheduledJobRun_.prototype, "_mj__UpdatedAt", void 0);
62425
+ __decorate([
62426
+ Field(),
62427
+ MaxLength(400),
62428
+ __metadata("design:type", String)
62429
+ ], MJScheduledJobRun_.prototype, "ScheduledJob", void 0);
62430
+ __decorate([
62431
+ Field({ nullable: true }),
62432
+ MaxLength(200),
62433
+ __metadata("design:type", String)
62434
+ ], MJScheduledJobRun_.prototype, "ExecutedByUser", void 0);
62435
+ __decorate([
62436
+ Field(() => [MJAIAgentRun_]),
62437
+ __metadata("design:type", Array)
62438
+ ], MJScheduledJobRun_.prototype, "MJ_AIAgentRuns_ScheduledJobRunIDArray", void 0);
62439
+ MJScheduledJobRun_ = __decorate([
62440
+ ObjectType({ description: `Records execution history for scheduled jobs. Provides uniform tracking across all job types. Each record represents one execution attempt of a scheduled job.` })
62441
+ ], MJScheduledJobRun_);
62442
+ export { MJScheduledJobRun_ };
62443
+ let CreateMJScheduledJobRunInput = class CreateMJScheduledJobRunInput {
62444
+ ID;
62445
+ ScheduledJobID;
62446
+ StartedAt;
62447
+ CompletedAt;
62448
+ Status;
62449
+ Success;
62450
+ ErrorMessage;
62451
+ Details;
62452
+ ExecutedByUserID;
62453
+ QueuedAt;
62454
+ };
62455
+ __decorate([
62456
+ Field({ nullable: true }),
62457
+ __metadata("design:type", String)
62458
+ ], CreateMJScheduledJobRunInput.prototype, "ID", void 0);
62459
+ __decorate([
62460
+ Field({ nullable: true }),
62461
+ __metadata("design:type", String)
62462
+ ], CreateMJScheduledJobRunInput.prototype, "ScheduledJobID", void 0);
62463
+ __decorate([
62464
+ Field({ nullable: true }),
62465
+ __metadata("design:type", Date)
62466
+ ], CreateMJScheduledJobRunInput.prototype, "StartedAt", void 0);
62467
+ __decorate([
62468
+ Field({ nullable: true }),
62469
+ __metadata("design:type", Date)
62470
+ ], CreateMJScheduledJobRunInput.prototype, "CompletedAt", void 0);
62471
+ __decorate([
62472
+ Field({ nullable: true }),
62473
+ __metadata("design:type", String)
62474
+ ], CreateMJScheduledJobRunInput.prototype, "Status", void 0);
62475
+ __decorate([
62476
+ Field(() => Boolean, { nullable: true }),
62477
+ __metadata("design:type", Boolean)
62478
+ ], CreateMJScheduledJobRunInput.prototype, "Success", void 0);
62479
+ __decorate([
62480
+ Field({ nullable: true }),
62481
+ __metadata("design:type", String)
62482
+ ], CreateMJScheduledJobRunInput.prototype, "ErrorMessage", void 0);
62483
+ __decorate([
62484
+ Field({ nullable: true }),
62485
+ __metadata("design:type", String)
62486
+ ], CreateMJScheduledJobRunInput.prototype, "Details", void 0);
62487
+ __decorate([
62488
+ Field({ nullable: true }),
62489
+ __metadata("design:type", String)
62490
+ ], CreateMJScheduledJobRunInput.prototype, "ExecutedByUserID", void 0);
62491
+ __decorate([
62492
+ Field({ nullable: true }),
62493
+ __metadata("design:type", Date)
62494
+ ], CreateMJScheduledJobRunInput.prototype, "QueuedAt", void 0);
62495
+ CreateMJScheduledJobRunInput = __decorate([
62496
+ InputType()
62497
+ ], CreateMJScheduledJobRunInput);
62498
+ export { CreateMJScheduledJobRunInput };
62499
+ let UpdateMJScheduledJobRunInput = class UpdateMJScheduledJobRunInput {
62500
+ ID;
62501
+ ScheduledJobID;
62502
+ StartedAt;
62503
+ CompletedAt;
62504
+ Status;
62505
+ Success;
62506
+ ErrorMessage;
62507
+ Details;
62508
+ ExecutedByUserID;
62509
+ QueuedAt;
62510
+ OldValues___;
62511
+ };
62512
+ __decorate([
62513
+ Field(),
62514
+ __metadata("design:type", String)
62515
+ ], UpdateMJScheduledJobRunInput.prototype, "ID", void 0);
62516
+ __decorate([
62517
+ Field({ nullable: true }),
62518
+ __metadata("design:type", String)
62519
+ ], UpdateMJScheduledJobRunInput.prototype, "ScheduledJobID", void 0);
62520
+ __decorate([
62521
+ Field({ nullable: true }),
62522
+ __metadata("design:type", Date)
62523
+ ], UpdateMJScheduledJobRunInput.prototype, "StartedAt", void 0);
62524
+ __decorate([
62525
+ Field({ nullable: true }),
62526
+ __metadata("design:type", Date)
62527
+ ], UpdateMJScheduledJobRunInput.prototype, "CompletedAt", void 0);
62528
+ __decorate([
62529
+ Field({ nullable: true }),
62530
+ __metadata("design:type", String)
62531
+ ], UpdateMJScheduledJobRunInput.prototype, "Status", void 0);
62532
+ __decorate([
62533
+ Field(() => Boolean, { nullable: true }),
62534
+ __metadata("design:type", Boolean)
62535
+ ], UpdateMJScheduledJobRunInput.prototype, "Success", void 0);
62536
+ __decorate([
62537
+ Field({ nullable: true }),
62538
+ __metadata("design:type", String)
62539
+ ], UpdateMJScheduledJobRunInput.prototype, "ErrorMessage", void 0);
62540
+ __decorate([
62541
+ Field({ nullable: true }),
62542
+ __metadata("design:type", String)
62543
+ ], UpdateMJScheduledJobRunInput.prototype, "Details", void 0);
62544
+ __decorate([
62545
+ Field({ nullable: true }),
62546
+ __metadata("design:type", String)
62547
+ ], UpdateMJScheduledJobRunInput.prototype, "ExecutedByUserID", void 0);
62548
+ __decorate([
62549
+ Field({ nullable: true }),
62550
+ __metadata("design:type", Date)
62551
+ ], UpdateMJScheduledJobRunInput.prototype, "QueuedAt", void 0);
62552
+ __decorate([
62553
+ Field(() => [KeyValuePairInput], { nullable: true }),
62554
+ __metadata("design:type", Array)
62555
+ ], UpdateMJScheduledJobRunInput.prototype, "OldValues___", void 0);
62556
+ UpdateMJScheduledJobRunInput = __decorate([
62557
+ InputType()
62558
+ ], UpdateMJScheduledJobRunInput);
62559
+ export { UpdateMJScheduledJobRunInput };
62560
+ let RunMJScheduledJobRunViewResult = class RunMJScheduledJobRunViewResult {
62561
+ Results;
62562
+ UserViewRunID;
62563
+ RowCount;
62564
+ TotalRowCount;
62565
+ ExecutionTime;
62566
+ ErrorMessage;
62567
+ Success;
62568
+ };
62569
+ __decorate([
62570
+ Field(() => [MJScheduledJobRun_]),
62571
+ __metadata("design:type", Array)
62572
+ ], RunMJScheduledJobRunViewResult.prototype, "Results", void 0);
62573
+ __decorate([
62574
+ Field(() => String, { nullable: true }),
62575
+ __metadata("design:type", String)
62576
+ ], RunMJScheduledJobRunViewResult.prototype, "UserViewRunID", void 0);
62577
+ __decorate([
62578
+ Field(() => Int, { nullable: true }),
62579
+ __metadata("design:type", Number)
62580
+ ], RunMJScheduledJobRunViewResult.prototype, "RowCount", void 0);
62581
+ __decorate([
62582
+ Field(() => Int, { nullable: true }),
62583
+ __metadata("design:type", Number)
62584
+ ], RunMJScheduledJobRunViewResult.prototype, "TotalRowCount", void 0);
62585
+ __decorate([
62586
+ Field(() => Int, { nullable: true }),
62587
+ __metadata("design:type", Number)
62588
+ ], RunMJScheduledJobRunViewResult.prototype, "ExecutionTime", void 0);
62589
+ __decorate([
62590
+ Field({ nullable: true }),
62591
+ __metadata("design:type", String)
62592
+ ], RunMJScheduledJobRunViewResult.prototype, "ErrorMessage", void 0);
62593
+ __decorate([
62594
+ Field(() => Boolean, { nullable: false }),
62595
+ __metadata("design:type", Boolean)
62596
+ ], RunMJScheduledJobRunViewResult.prototype, "Success", void 0);
62597
+ RunMJScheduledJobRunViewResult = __decorate([
62598
+ ObjectType()
62599
+ ], RunMJScheduledJobRunViewResult);
62600
+ export { RunMJScheduledJobRunViewResult };
62601
+ let MJScheduledJobRunResolver = class MJScheduledJobRunResolver extends ResolverBase {
62602
+ async RunMJScheduledJobRunViewByID(input, { providers, userPayload }, pubSub) {
62603
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
62604
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
62605
+ }
62606
+ async RunMJScheduledJobRunViewByName(input, { providers, userPayload }, pubSub) {
62607
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
62608
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
62609
+ }
62610
+ async RunMJScheduledJobRunDynamicView(input, { providers, userPayload }, pubSub) {
62611
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
62612
+ input.EntityName = 'MJ: Scheduled Job Runs';
62613
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
62614
+ }
62615
+ async MJScheduledJobRun(ID, { dataSources, userPayload, providers }, pubSub) {
62616
+ this.CheckUserReadPermissions('MJ: Scheduled Job Runs', userPayload);
62617
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
62618
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
62619
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwScheduledJobRuns] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Scheduled Job Runs', userPayload, EntityPermissionType.Read, 'AND');
62620
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
62621
+ const result = this.MapFieldNamesToCodeNames('MJ: Scheduled Job Runs', rows && rows.length > 0 ? rows[0] : {});
62622
+ return result;
62623
+ }
62624
+ async MJ_AIAgentRuns_ScheduledJobRunIDArray(mjscheduledjobrun_, { dataSources, userPayload, providers }, pubSub) {
62625
+ this.CheckUserReadPermissions('MJ: AI Agent Runs', userPayload);
62626
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
62627
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
62628
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentRuns] WHERE [ScheduledJobRunID]='${mjscheduledjobrun_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Runs', userPayload, EntityPermissionType.Read, 'AND');
62629
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
62630
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Runs', rows);
62631
+ return result;
62632
+ }
62633
+ async CreateMJScheduledJobRun(input, { providers, userPayload }, pubSub) {
62634
+ const provider = GetReadWriteProvider(providers);
62635
+ return this.CreateRecord('MJ: Scheduled Job Runs', input, provider, userPayload, pubSub);
62636
+ }
62637
+ async UpdateMJScheduledJobRun(input, { providers, userPayload }, pubSub) {
62638
+ const provider = GetReadWriteProvider(providers);
62639
+ return this.UpdateRecord('MJ: Scheduled Job Runs', input, provider, userPayload, pubSub);
62640
+ }
62641
+ async DeleteMJScheduledJobRun(ID, options, { providers, userPayload }, pubSub) {
62642
+ const provider = GetReadWriteProvider(providers);
62643
+ const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
62644
+ return this.DeleteRecord('MJ: Scheduled Job Runs', key, options, provider, userPayload, pubSub);
62645
+ }
62646
+ };
62647
+ __decorate([
62648
+ Query(() => RunMJScheduledJobRunViewResult),
62649
+ __param(0, Arg('input', () => RunViewByIDInput)),
62650
+ __param(1, Ctx()),
62651
+ __param(2, PubSub()),
62652
+ __metadata("design:type", Function),
62653
+ __metadata("design:paramtypes", [RunViewByIDInput, Object, PubSubEngine]),
62654
+ __metadata("design:returntype", Promise)
62655
+ ], MJScheduledJobRunResolver.prototype, "RunMJScheduledJobRunViewByID", null);
62656
+ __decorate([
62657
+ Query(() => RunMJScheduledJobRunViewResult),
62658
+ __param(0, Arg('input', () => RunViewByNameInput)),
62659
+ __param(1, Ctx()),
62660
+ __param(2, PubSub()),
62661
+ __metadata("design:type", Function),
62662
+ __metadata("design:paramtypes", [RunViewByNameInput, Object, PubSubEngine]),
62663
+ __metadata("design:returntype", Promise)
62664
+ ], MJScheduledJobRunResolver.prototype, "RunMJScheduledJobRunViewByName", null);
62665
+ __decorate([
62666
+ Query(() => RunMJScheduledJobRunViewResult),
62667
+ __param(0, Arg('input', () => RunDynamicViewInput)),
62668
+ __param(1, Ctx()),
62669
+ __param(2, PubSub()),
62670
+ __metadata("design:type", Function),
62671
+ __metadata("design:paramtypes", [RunDynamicViewInput, Object, PubSubEngine]),
62672
+ __metadata("design:returntype", Promise)
62673
+ ], MJScheduledJobRunResolver.prototype, "RunMJScheduledJobRunDynamicView", null);
62674
+ __decorate([
62675
+ Query(() => MJScheduledJobRun_, { nullable: true }),
62676
+ __param(0, Arg('ID', () => String)),
62677
+ __param(1, Ctx()),
62678
+ __param(2, PubSub()),
62679
+ __metadata("design:type", Function),
62680
+ __metadata("design:paramtypes", [String, Object, PubSubEngine]),
62681
+ __metadata("design:returntype", Promise)
62682
+ ], MJScheduledJobRunResolver.prototype, "MJScheduledJobRun", null);
62683
+ __decorate([
62684
+ FieldResolver(() => [MJAIAgentRun_]),
62685
+ __param(0, Root()),
62686
+ __param(1, Ctx()),
62687
+ __param(2, PubSub()),
62688
+ __metadata("design:type", Function),
62689
+ __metadata("design:paramtypes", [MJScheduledJobRun_, Object, PubSubEngine]),
62690
+ __metadata("design:returntype", Promise)
62691
+ ], MJScheduledJobRunResolver.prototype, "MJ_AIAgentRuns_ScheduledJobRunIDArray", null);
62692
+ __decorate([
62693
+ Mutation(() => MJScheduledJobRun_),
62694
+ __param(0, Arg('input', () => CreateMJScheduledJobRunInput)),
62695
+ __param(1, Ctx()),
62696
+ __param(2, PubSub()),
62697
+ __metadata("design:type", Function),
62698
+ __metadata("design:paramtypes", [CreateMJScheduledJobRunInput, Object, PubSubEngine]),
62699
+ __metadata("design:returntype", Promise)
62700
+ ], MJScheduledJobRunResolver.prototype, "CreateMJScheduledJobRun", null);
62701
+ __decorate([
62702
+ Mutation(() => MJScheduledJobRun_),
62703
+ __param(0, Arg('input', () => UpdateMJScheduledJobRunInput)),
62704
+ __param(1, Ctx()),
62705
+ __param(2, PubSub()),
62706
+ __metadata("design:type", Function),
62707
+ __metadata("design:paramtypes", [UpdateMJScheduledJobRunInput, Object, PubSubEngine]),
62708
+ __metadata("design:returntype", Promise)
62709
+ ], MJScheduledJobRunResolver.prototype, "UpdateMJScheduledJobRun", null);
62710
+ __decorate([
62711
+ Mutation(() => MJScheduledJobRun_),
62712
+ __param(0, Arg('ID', () => String)),
62713
+ __param(1, Arg('options___', () => DeleteOptionsInput)),
62714
+ __param(2, Ctx()),
62715
+ __param(3, PubSub()),
62716
+ __metadata("design:type", Function),
62717
+ __metadata("design:paramtypes", [String, DeleteOptionsInput, Object, PubSubEngine]),
62718
+ __metadata("design:returntype", Promise)
62719
+ ], MJScheduledJobRunResolver.prototype, "DeleteMJScheduledJobRun", null);
62720
+ MJScheduledJobRunResolver = __decorate([
62721
+ Resolver(MJScheduledJobRun_)
62722
+ ], MJScheduledJobRunResolver);
62723
+ export { MJScheduledJobRunResolver };
62266
62724
  let MJDashboardUserState_ = class MJDashboardUserState_ {
62267
62725
  ID;
62268
62726
  DashboardID;
@@ -66097,6 +66555,320 @@ MJComponentLibraryResolver = __decorate([
66097
66555
  Resolver(MJComponentLibrary_)
66098
66556
  ], MJComponentLibraryResolver);
66099
66557
  export { MJComponentLibraryResolver };
66558
+ let MJScheduledJobType_ = class MJScheduledJobType_ {
66559
+ ID;
66560
+ Name;
66561
+ Description;
66562
+ DriverClass;
66563
+ DomainRunEntity;
66564
+ DomainRunEntityFKey;
66565
+ NotificationsAvailable;
66566
+ _mj__CreatedAt;
66567
+ _mj__UpdatedAt;
66568
+ MJ_ScheduledJobs_JobTypeIDArray;
66569
+ };
66570
+ __decorate([
66571
+ Field(),
66572
+ MaxLength(16),
66573
+ __metadata("design:type", String)
66574
+ ], MJScheduledJobType_.prototype, "ID", void 0);
66575
+ __decorate([
66576
+ Field({ description: `Unique name identifying this job type (e.g., Agent, Action, Report).` }),
66577
+ MaxLength(200),
66578
+ __metadata("design:type", String)
66579
+ ], MJScheduledJobType_.prototype, "Name", void 0);
66580
+ __decorate([
66581
+ Field({ nullable: true, description: `Human-readable description of what this job type does and when it should be used.` }),
66582
+ __metadata("design:type", String)
66583
+ ], MJScheduledJobType_.prototype, "Description", void 0);
66584
+ __decorate([
66585
+ Field({ description: `TypeScript class name that implements BaseScheduledJob for this job type. Used by ClassFactory to instantiate the correct plugin at runtime.` }),
66586
+ MaxLength(510),
66587
+ __metadata("design:type", String)
66588
+ ], MJScheduledJobType_.prototype, "DriverClass", void 0);
66589
+ __decorate([
66590
+ Field({ nullable: true, description: `Name of the entity that stores execution records for this job type (e.g., "MJ: AI Agent Runs", "Action Execution Logs"). Used for generic UI linking to domain-specific run records. NULL if job type uses ScheduledJobRun as its only execution record.` }),
66591
+ MaxLength(510),
66592
+ __metadata("design:type", String)
66593
+ ], MJScheduledJobType_.prototype, "DomainRunEntity", void 0);
66594
+ __decorate([
66595
+ Field({ nullable: true, description: `Name of the foreign key field in the DomainRunEntity that links back to ScheduledJobRun (e.g., "ScheduleID"). Used for querying related domain runs. NULL if DomainRunEntity is NULL.` }),
66596
+ MaxLength(200),
66597
+ __metadata("design:type", String)
66598
+ ], MJScheduledJobType_.prototype, "DomainRunEntityFKey", void 0);
66599
+ __decorate([
66600
+ Field(() => Boolean, { description: `Indicates whether this job type supports sending notifications on completion or failure.` }),
66601
+ __metadata("design:type", Boolean)
66602
+ ], MJScheduledJobType_.prototype, "NotificationsAvailable", void 0);
66603
+ __decorate([
66604
+ Field(),
66605
+ MaxLength(10),
66606
+ __metadata("design:type", Date)
66607
+ ], MJScheduledJobType_.prototype, "_mj__CreatedAt", void 0);
66608
+ __decorate([
66609
+ Field(),
66610
+ MaxLength(10),
66611
+ __metadata("design:type", Date)
66612
+ ], MJScheduledJobType_.prototype, "_mj__UpdatedAt", void 0);
66613
+ __decorate([
66614
+ Field(() => [MJScheduledJob_]),
66615
+ __metadata("design:type", Array)
66616
+ ], MJScheduledJobType_.prototype, "MJ_ScheduledJobs_JobTypeIDArray", void 0);
66617
+ MJScheduledJobType_ = __decorate([
66618
+ ObjectType({ description: `Defines types of schedulable jobs and their plugin implementations. Each job type represents a different kind of work that can be scheduled (e.g., Agents, Actions, Reports).` })
66619
+ ], MJScheduledJobType_);
66620
+ export { MJScheduledJobType_ };
66621
+ let CreateMJScheduledJobTypeInput = class CreateMJScheduledJobTypeInput {
66622
+ ID;
66623
+ Name;
66624
+ Description;
66625
+ DriverClass;
66626
+ DomainRunEntity;
66627
+ DomainRunEntityFKey;
66628
+ NotificationsAvailable;
66629
+ };
66630
+ __decorate([
66631
+ Field({ nullable: true }),
66632
+ __metadata("design:type", String)
66633
+ ], CreateMJScheduledJobTypeInput.prototype, "ID", void 0);
66634
+ __decorate([
66635
+ Field({ nullable: true }),
66636
+ __metadata("design:type", String)
66637
+ ], CreateMJScheduledJobTypeInput.prototype, "Name", void 0);
66638
+ __decorate([
66639
+ Field({ nullable: true }),
66640
+ __metadata("design:type", String)
66641
+ ], CreateMJScheduledJobTypeInput.prototype, "Description", void 0);
66642
+ __decorate([
66643
+ Field({ nullable: true }),
66644
+ __metadata("design:type", String)
66645
+ ], CreateMJScheduledJobTypeInput.prototype, "DriverClass", void 0);
66646
+ __decorate([
66647
+ Field({ nullable: true }),
66648
+ __metadata("design:type", String)
66649
+ ], CreateMJScheduledJobTypeInput.prototype, "DomainRunEntity", void 0);
66650
+ __decorate([
66651
+ Field({ nullable: true }),
66652
+ __metadata("design:type", String)
66653
+ ], CreateMJScheduledJobTypeInput.prototype, "DomainRunEntityFKey", void 0);
66654
+ __decorate([
66655
+ Field(() => Boolean, { nullable: true }),
66656
+ __metadata("design:type", Boolean)
66657
+ ], CreateMJScheduledJobTypeInput.prototype, "NotificationsAvailable", void 0);
66658
+ CreateMJScheduledJobTypeInput = __decorate([
66659
+ InputType()
66660
+ ], CreateMJScheduledJobTypeInput);
66661
+ export { CreateMJScheduledJobTypeInput };
66662
+ let UpdateMJScheduledJobTypeInput = class UpdateMJScheduledJobTypeInput {
66663
+ ID;
66664
+ Name;
66665
+ Description;
66666
+ DriverClass;
66667
+ DomainRunEntity;
66668
+ DomainRunEntityFKey;
66669
+ NotificationsAvailable;
66670
+ OldValues___;
66671
+ };
66672
+ __decorate([
66673
+ Field(),
66674
+ __metadata("design:type", String)
66675
+ ], UpdateMJScheduledJobTypeInput.prototype, "ID", void 0);
66676
+ __decorate([
66677
+ Field({ nullable: true }),
66678
+ __metadata("design:type", String)
66679
+ ], UpdateMJScheduledJobTypeInput.prototype, "Name", void 0);
66680
+ __decorate([
66681
+ Field({ nullable: true }),
66682
+ __metadata("design:type", String)
66683
+ ], UpdateMJScheduledJobTypeInput.prototype, "Description", void 0);
66684
+ __decorate([
66685
+ Field({ nullable: true }),
66686
+ __metadata("design:type", String)
66687
+ ], UpdateMJScheduledJobTypeInput.prototype, "DriverClass", void 0);
66688
+ __decorate([
66689
+ Field({ nullable: true }),
66690
+ __metadata("design:type", String)
66691
+ ], UpdateMJScheduledJobTypeInput.prototype, "DomainRunEntity", void 0);
66692
+ __decorate([
66693
+ Field({ nullable: true }),
66694
+ __metadata("design:type", String)
66695
+ ], UpdateMJScheduledJobTypeInput.prototype, "DomainRunEntityFKey", void 0);
66696
+ __decorate([
66697
+ Field(() => Boolean, { nullable: true }),
66698
+ __metadata("design:type", Boolean)
66699
+ ], UpdateMJScheduledJobTypeInput.prototype, "NotificationsAvailable", void 0);
66700
+ __decorate([
66701
+ Field(() => [KeyValuePairInput], { nullable: true }),
66702
+ __metadata("design:type", Array)
66703
+ ], UpdateMJScheduledJobTypeInput.prototype, "OldValues___", void 0);
66704
+ UpdateMJScheduledJobTypeInput = __decorate([
66705
+ InputType()
66706
+ ], UpdateMJScheduledJobTypeInput);
66707
+ export { UpdateMJScheduledJobTypeInput };
66708
+ let RunMJScheduledJobTypeViewResult = class RunMJScheduledJobTypeViewResult {
66709
+ Results;
66710
+ UserViewRunID;
66711
+ RowCount;
66712
+ TotalRowCount;
66713
+ ExecutionTime;
66714
+ ErrorMessage;
66715
+ Success;
66716
+ };
66717
+ __decorate([
66718
+ Field(() => [MJScheduledJobType_]),
66719
+ __metadata("design:type", Array)
66720
+ ], RunMJScheduledJobTypeViewResult.prototype, "Results", void 0);
66721
+ __decorate([
66722
+ Field(() => String, { nullable: true }),
66723
+ __metadata("design:type", String)
66724
+ ], RunMJScheduledJobTypeViewResult.prototype, "UserViewRunID", void 0);
66725
+ __decorate([
66726
+ Field(() => Int, { nullable: true }),
66727
+ __metadata("design:type", Number)
66728
+ ], RunMJScheduledJobTypeViewResult.prototype, "RowCount", void 0);
66729
+ __decorate([
66730
+ Field(() => Int, { nullable: true }),
66731
+ __metadata("design:type", Number)
66732
+ ], RunMJScheduledJobTypeViewResult.prototype, "TotalRowCount", void 0);
66733
+ __decorate([
66734
+ Field(() => Int, { nullable: true }),
66735
+ __metadata("design:type", Number)
66736
+ ], RunMJScheduledJobTypeViewResult.prototype, "ExecutionTime", void 0);
66737
+ __decorate([
66738
+ Field({ nullable: true }),
66739
+ __metadata("design:type", String)
66740
+ ], RunMJScheduledJobTypeViewResult.prototype, "ErrorMessage", void 0);
66741
+ __decorate([
66742
+ Field(() => Boolean, { nullable: false }),
66743
+ __metadata("design:type", Boolean)
66744
+ ], RunMJScheduledJobTypeViewResult.prototype, "Success", void 0);
66745
+ RunMJScheduledJobTypeViewResult = __decorate([
66746
+ ObjectType()
66747
+ ], RunMJScheduledJobTypeViewResult);
66748
+ export { RunMJScheduledJobTypeViewResult };
66749
+ let MJScheduledJobTypeResolver = class MJScheduledJobTypeResolver extends ResolverBase {
66750
+ async RunMJScheduledJobTypeViewByID(input, { providers, userPayload }, pubSub) {
66751
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
66752
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
66753
+ }
66754
+ async RunMJScheduledJobTypeViewByName(input, { providers, userPayload }, pubSub) {
66755
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
66756
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
66757
+ }
66758
+ async RunMJScheduledJobTypeDynamicView(input, { providers, userPayload }, pubSub) {
66759
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
66760
+ input.EntityName = 'MJ: Scheduled Job Types';
66761
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
66762
+ }
66763
+ async MJScheduledJobType(ID, { dataSources, userPayload, providers }, pubSub) {
66764
+ this.CheckUserReadPermissions('MJ: Scheduled Job Types', userPayload);
66765
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
66766
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
66767
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwScheduledJobTypes] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Scheduled Job Types', userPayload, EntityPermissionType.Read, 'AND');
66768
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
66769
+ const result = this.MapFieldNamesToCodeNames('MJ: Scheduled Job Types', rows && rows.length > 0 ? rows[0] : {});
66770
+ return result;
66771
+ }
66772
+ async MJ_ScheduledJobs_JobTypeIDArray(mjscheduledjobtype_, { dataSources, userPayload, providers }, pubSub) {
66773
+ this.CheckUserReadPermissions('MJ: Scheduled Jobs', userPayload);
66774
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
66775
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
66776
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwScheduledJobs] WHERE [JobTypeID]='${mjscheduledjobtype_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Scheduled Jobs', userPayload, EntityPermissionType.Read, 'AND');
66777
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
66778
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Scheduled Jobs', rows);
66779
+ return result;
66780
+ }
66781
+ async CreateMJScheduledJobType(input, { providers, userPayload }, pubSub) {
66782
+ const provider = GetReadWriteProvider(providers);
66783
+ return this.CreateRecord('MJ: Scheduled Job Types', input, provider, userPayload, pubSub);
66784
+ }
66785
+ async UpdateMJScheduledJobType(input, { providers, userPayload }, pubSub) {
66786
+ const provider = GetReadWriteProvider(providers);
66787
+ return this.UpdateRecord('MJ: Scheduled Job Types', input, provider, userPayload, pubSub);
66788
+ }
66789
+ async DeleteMJScheduledJobType(ID, options, { providers, userPayload }, pubSub) {
66790
+ const provider = GetReadWriteProvider(providers);
66791
+ const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
66792
+ return this.DeleteRecord('MJ: Scheduled Job Types', key, options, provider, userPayload, pubSub);
66793
+ }
66794
+ };
66795
+ __decorate([
66796
+ Query(() => RunMJScheduledJobTypeViewResult),
66797
+ __param(0, Arg('input', () => RunViewByIDInput)),
66798
+ __param(1, Ctx()),
66799
+ __param(2, PubSub()),
66800
+ __metadata("design:type", Function),
66801
+ __metadata("design:paramtypes", [RunViewByIDInput, Object, PubSubEngine]),
66802
+ __metadata("design:returntype", Promise)
66803
+ ], MJScheduledJobTypeResolver.prototype, "RunMJScheduledJobTypeViewByID", null);
66804
+ __decorate([
66805
+ Query(() => RunMJScheduledJobTypeViewResult),
66806
+ __param(0, Arg('input', () => RunViewByNameInput)),
66807
+ __param(1, Ctx()),
66808
+ __param(2, PubSub()),
66809
+ __metadata("design:type", Function),
66810
+ __metadata("design:paramtypes", [RunViewByNameInput, Object, PubSubEngine]),
66811
+ __metadata("design:returntype", Promise)
66812
+ ], MJScheduledJobTypeResolver.prototype, "RunMJScheduledJobTypeViewByName", null);
66813
+ __decorate([
66814
+ Query(() => RunMJScheduledJobTypeViewResult),
66815
+ __param(0, Arg('input', () => RunDynamicViewInput)),
66816
+ __param(1, Ctx()),
66817
+ __param(2, PubSub()),
66818
+ __metadata("design:type", Function),
66819
+ __metadata("design:paramtypes", [RunDynamicViewInput, Object, PubSubEngine]),
66820
+ __metadata("design:returntype", Promise)
66821
+ ], MJScheduledJobTypeResolver.prototype, "RunMJScheduledJobTypeDynamicView", null);
66822
+ __decorate([
66823
+ Query(() => MJScheduledJobType_, { nullable: true }),
66824
+ __param(0, Arg('ID', () => String)),
66825
+ __param(1, Ctx()),
66826
+ __param(2, PubSub()),
66827
+ __metadata("design:type", Function),
66828
+ __metadata("design:paramtypes", [String, Object, PubSubEngine]),
66829
+ __metadata("design:returntype", Promise)
66830
+ ], MJScheduledJobTypeResolver.prototype, "MJScheduledJobType", null);
66831
+ __decorate([
66832
+ FieldResolver(() => [MJScheduledJob_]),
66833
+ __param(0, Root()),
66834
+ __param(1, Ctx()),
66835
+ __param(2, PubSub()),
66836
+ __metadata("design:type", Function),
66837
+ __metadata("design:paramtypes", [MJScheduledJobType_, Object, PubSubEngine]),
66838
+ __metadata("design:returntype", Promise)
66839
+ ], MJScheduledJobTypeResolver.prototype, "MJ_ScheduledJobs_JobTypeIDArray", null);
66840
+ __decorate([
66841
+ Mutation(() => MJScheduledJobType_),
66842
+ __param(0, Arg('input', () => CreateMJScheduledJobTypeInput)),
66843
+ __param(1, Ctx()),
66844
+ __param(2, PubSub()),
66845
+ __metadata("design:type", Function),
66846
+ __metadata("design:paramtypes", [CreateMJScheduledJobTypeInput, Object, PubSubEngine]),
66847
+ __metadata("design:returntype", Promise)
66848
+ ], MJScheduledJobTypeResolver.prototype, "CreateMJScheduledJobType", null);
66849
+ __decorate([
66850
+ Mutation(() => MJScheduledJobType_),
66851
+ __param(0, Arg('input', () => UpdateMJScheduledJobTypeInput)),
66852
+ __param(1, Ctx()),
66853
+ __param(2, PubSub()),
66854
+ __metadata("design:type", Function),
66855
+ __metadata("design:paramtypes", [UpdateMJScheduledJobTypeInput, Object, PubSubEngine]),
66856
+ __metadata("design:returntype", Promise)
66857
+ ], MJScheduledJobTypeResolver.prototype, "UpdateMJScheduledJobType", null);
66858
+ __decorate([
66859
+ Mutation(() => MJScheduledJobType_),
66860
+ __param(0, Arg('ID', () => String)),
66861
+ __param(1, Arg('options___', () => DeleteOptionsInput)),
66862
+ __param(2, Ctx()),
66863
+ __param(3, PubSub()),
66864
+ __metadata("design:type", Function),
66865
+ __metadata("design:paramtypes", [String, DeleteOptionsInput, Object, PubSubEngine]),
66866
+ __metadata("design:returntype", Promise)
66867
+ ], MJScheduledJobTypeResolver.prototype, "DeleteMJScheduledJobType", null);
66868
+ MJScheduledJobTypeResolver = __decorate([
66869
+ Resolver(MJScheduledJobType_)
66870
+ ], MJScheduledJobTypeResolver);
66871
+ export { MJScheduledJobTypeResolver };
66100
66872
  let MJDashboardUserPreference_ = class MJDashboardUserPreference_ {
66101
66873
  ID;
66102
66874
  UserID;
@@ -67093,6 +67865,7 @@ let MJAIAgentRelationship_ = class MJAIAgentRelationship_ {
67093
67865
  Status;
67094
67866
  _mj__CreatedAt;
67095
67867
  _mj__UpdatedAt;
67868
+ SubAgentOutputMapping;
67096
67869
  Agent;
67097
67870
  SubAgent;
67098
67871
  };
@@ -67126,6 +67899,10 @@ __decorate([
67126
67899
  MaxLength(10),
67127
67900
  __metadata("design:type", Date)
67128
67901
  ], MJAIAgentRelationship_.prototype, "_mj__UpdatedAt", void 0);
67902
+ __decorate([
67903
+ Field({ nullable: true, description: `JSON configuration mapping sub-agent result payload paths to parent agent payload paths. Enables controlled merging of sub-agent results. Format: {"subAgentPath": "parentPath", "*": "captureAllPath"}. If null, sub-agent results are not automatically merged into parent payload.` }),
67904
+ __metadata("design:type", String)
67905
+ ], MJAIAgentRelationship_.prototype, "SubAgentOutputMapping", void 0);
67129
67906
  __decorate([
67130
67907
  Field({ nullable: true }),
67131
67908
  MaxLength(510),
@@ -67145,6 +67922,7 @@ let CreateMJAIAgentRelationshipInput = class CreateMJAIAgentRelationshipInput {
67145
67922
  AgentID;
67146
67923
  SubAgentID;
67147
67924
  Status;
67925
+ SubAgentOutputMapping;
67148
67926
  };
67149
67927
  __decorate([
67150
67928
  Field({ nullable: true }),
@@ -67162,6 +67940,10 @@ __decorate([
67162
67940
  Field({ nullable: true }),
67163
67941
  __metadata("design:type", String)
67164
67942
  ], CreateMJAIAgentRelationshipInput.prototype, "Status", void 0);
67943
+ __decorate([
67944
+ Field({ nullable: true }),
67945
+ __metadata("design:type", String)
67946
+ ], CreateMJAIAgentRelationshipInput.prototype, "SubAgentOutputMapping", void 0);
67165
67947
  CreateMJAIAgentRelationshipInput = __decorate([
67166
67948
  InputType()
67167
67949
  ], CreateMJAIAgentRelationshipInput);
@@ -67171,6 +67953,7 @@ let UpdateMJAIAgentRelationshipInput = class UpdateMJAIAgentRelationshipInput {
67171
67953
  AgentID;
67172
67954
  SubAgentID;
67173
67955
  Status;
67956
+ SubAgentOutputMapping;
67174
67957
  OldValues___;
67175
67958
  };
67176
67959
  __decorate([
@@ -67189,6 +67972,10 @@ __decorate([
67189
67972
  Field({ nullable: true }),
67190
67973
  __metadata("design:type", String)
67191
67974
  ], UpdateMJAIAgentRelationshipInput.prototype, "Status", void 0);
67975
+ __decorate([
67976
+ Field({ nullable: true }),
67977
+ __metadata("design:type", String)
67978
+ ], UpdateMJAIAgentRelationshipInput.prototype, "SubAgentOutputMapping", void 0);
67192
67979
  __decorate([
67193
67980
  Field(() => [KeyValuePairInput], { nullable: true }),
67194
67981
  __metadata("design:type", Array)
@@ -71186,6 +71973,635 @@ MJGeneratedCodeResolver = __decorate([
71186
71973
  Resolver(MJGeneratedCode_)
71187
71974
  ], MJGeneratedCodeResolver);
71188
71975
  export { MJGeneratedCodeResolver };
71976
+ let MJScheduledJob_ = class MJScheduledJob_ {
71977
+ ID;
71978
+ JobTypeID;
71979
+ Name;
71980
+ Description;
71981
+ CronExpression;
71982
+ Timezone;
71983
+ StartAt;
71984
+ EndAt;
71985
+ Status;
71986
+ Configuration;
71987
+ OwnerUserID;
71988
+ LastRunAt;
71989
+ NextRunAt;
71990
+ RunCount;
71991
+ SuccessCount;
71992
+ FailureCount;
71993
+ NotifyOnSuccess;
71994
+ NotifyOnFailure;
71995
+ NotifyUserID;
71996
+ NotifyViaEmail;
71997
+ NotifyViaInApp;
71998
+ LockToken;
71999
+ LockedAt;
72000
+ LockedByInstance;
72001
+ ExpectedCompletionAt;
72002
+ ConcurrencyMode;
72003
+ _mj__CreatedAt;
72004
+ _mj__UpdatedAt;
72005
+ JobType;
72006
+ OwnerUser;
72007
+ NotifyUser;
72008
+ MJ_ScheduledJobRuns_ScheduledJobIDArray;
72009
+ };
72010
+ __decorate([
72011
+ Field(),
72012
+ MaxLength(16),
72013
+ __metadata("design:type", String)
72014
+ ], MJScheduledJob_.prototype, "ID", void 0);
72015
+ __decorate([
72016
+ Field(),
72017
+ MaxLength(16),
72018
+ __metadata("design:type", String)
72019
+ ], MJScheduledJob_.prototype, "JobTypeID", void 0);
72020
+ __decorate([
72021
+ Field({ description: `Human-readable name for this scheduled job. Should clearly identify what the job does.` }),
72022
+ MaxLength(400),
72023
+ __metadata("design:type", String)
72024
+ ], MJScheduledJob_.prototype, "Name", void 0);
72025
+ __decorate([
72026
+ Field({ nullable: true, description: `Detailed description of the job's purpose, what it does, and any important notes about its execution.` }),
72027
+ __metadata("design:type", String)
72028
+ ], MJScheduledJob_.prototype, "Description", void 0);
72029
+ __decorate([
72030
+ Field({ description: `Cron expression defining when the job should execute (e.g., "0 30 9 * * MON-FRI" for weekdays at 9:30 AM). Uses standard cron syntax with seconds precision.` }),
72031
+ MaxLength(240),
72032
+ __metadata("design:type", String)
72033
+ ], MJScheduledJob_.prototype, "CronExpression", void 0);
72034
+ __decorate([
72035
+ Field({ description: `IANA timezone identifier for interpreting the cron expression (e.g., "America/Chicago", "UTC"). Ensures consistent scheduling across different server locations.` }),
72036
+ MaxLength(128),
72037
+ __metadata("design:type", String)
72038
+ ], MJScheduledJob_.prototype, "Timezone", void 0);
72039
+ __decorate([
72040
+ Field({ nullable: true, description: `Optional start date/time for when this schedule becomes active. Job will not execute before this time. NULL means active immediately upon creation.` }),
72041
+ MaxLength(10),
72042
+ __metadata("design:type", Date)
72043
+ ], MJScheduledJob_.prototype, "StartAt", void 0);
72044
+ __decorate([
72045
+ Field({ nullable: true, description: `Optional end date/time for when this schedule expires. Job will not execute after this time. NULL means no expiration.` }),
72046
+ MaxLength(10),
72047
+ __metadata("design:type", Date)
72048
+ ], MJScheduledJob_.prototype, "EndAt", void 0);
72049
+ __decorate([
72050
+ Field({ description: `Current status of the schedule. Pending=created but not yet active, Active=currently running on schedule, Paused=temporarily stopped, Disabled=manually disabled, Expired=past EndAt date.` }),
72051
+ MaxLength(40),
72052
+ __metadata("design:type", String)
72053
+ ], MJScheduledJob_.prototype, "Status", void 0);
72054
+ __decorate([
72055
+ Field({ nullable: true, description: `Job-type specific configuration stored as JSON. Schema is defined by the ScheduledJobType plugin. For Agents: includes AgentID, StartingPayload, InitialMessage, etc. For Actions: includes ActionID and parameter mappings.` }),
72056
+ __metadata("design:type", String)
72057
+ ], MJScheduledJob_.prototype, "Configuration", void 0);
72058
+ __decorate([
72059
+ Field({ nullable: true, description: `User who owns this schedule. Used as the execution context if no specific user is configured in the job-specific configuration.` }),
72060
+ MaxLength(16),
72061
+ __metadata("design:type", String)
72062
+ ], MJScheduledJob_.prototype, "OwnerUserID", void 0);
72063
+ __decorate([
72064
+ Field({ nullable: true, description: `Timestamp of the most recent execution. Updated after each run. Used for monitoring and dashboard displays.` }),
72065
+ MaxLength(10),
72066
+ __metadata("design:type", Date)
72067
+ ], MJScheduledJob_.prototype, "LastRunAt", void 0);
72068
+ __decorate([
72069
+ Field({ nullable: true, description: `Calculated timestamp of when this job should next execute based on the cron expression. Updated after each run. Used by scheduler to determine which jobs are due.` }),
72070
+ MaxLength(10),
72071
+ __metadata("design:type", Date)
72072
+ ], MJScheduledJob_.prototype, "NextRunAt", void 0);
72073
+ __decorate([
72074
+ Field(() => Int, { description: `Total number of times this schedule has been executed, including both successful and failed runs.` }),
72075
+ __metadata("design:type", Number)
72076
+ ], MJScheduledJob_.prototype, "RunCount", void 0);
72077
+ __decorate([
72078
+ Field(() => Int, { description: `Number of times this schedule has executed successfully (Success = true in ScheduledJobRun).` }),
72079
+ __metadata("design:type", Number)
72080
+ ], MJScheduledJob_.prototype, "SuccessCount", void 0);
72081
+ __decorate([
72082
+ Field(() => Int, { description: `Number of times this schedule has executed but failed (Success = false in ScheduledJobRun).` }),
72083
+ __metadata("design:type", Number)
72084
+ ], MJScheduledJob_.prototype, "FailureCount", void 0);
72085
+ __decorate([
72086
+ Field(() => Boolean, { description: `Whether to send notifications when the job completes successfully.` }),
72087
+ __metadata("design:type", Boolean)
72088
+ ], MJScheduledJob_.prototype, "NotifyOnSuccess", void 0);
72089
+ __decorate([
72090
+ Field(() => Boolean, { description: `Whether to send notifications when the job fails. Defaults to true for alerting on failures.` }),
72091
+ __metadata("design:type", Boolean)
72092
+ ], MJScheduledJob_.prototype, "NotifyOnFailure", void 0);
72093
+ __decorate([
72094
+ Field({ nullable: true, description: `User to notify about job execution results. If NULL and notifications are enabled, falls back to OwnerUserID.` }),
72095
+ MaxLength(16),
72096
+ __metadata("design:type", String)
72097
+ ], MJScheduledJob_.prototype, "NotifyUserID", void 0);
72098
+ __decorate([
72099
+ Field(() => Boolean, { description: `Whether to send email notifications. Requires NotifyOnSuccess or NotifyOnFailure to also be enabled.` }),
72100
+ __metadata("design:type", Boolean)
72101
+ ], MJScheduledJob_.prototype, "NotifyViaEmail", void 0);
72102
+ __decorate([
72103
+ Field(() => Boolean, { description: `Whether to send in-app notifications. Requires NotifyOnSuccess or NotifyOnFailure to also be enabled. Defaults to true.` }),
72104
+ __metadata("design:type", Boolean)
72105
+ ], MJScheduledJob_.prototype, "NotifyViaInApp", void 0);
72106
+ __decorate([
72107
+ Field({ nullable: true, description: `Unique token used for distributed locking across multiple server instances. Set when a server claims the job for execution. Prevents duplicate executions in multi-server environments.` }),
72108
+ MaxLength(16),
72109
+ __metadata("design:type", String)
72110
+ ], MJScheduledJob_.prototype, "LockToken", void 0);
72111
+ __decorate([
72112
+ Field({ nullable: true, description: `Timestamp when the lock was acquired. Used with ExpectedCompletionAt to detect stale locks from crashed server instances.` }),
72113
+ MaxLength(10),
72114
+ __metadata("design:type", Date)
72115
+ ], MJScheduledJob_.prototype, "LockedAt", void 0);
72116
+ __decorate([
72117
+ Field({ nullable: true, description: `Identifier of the server instance that currently holds the lock (e.g., "hostname-12345"). Used for troubleshooting and monitoring which server is executing which job.` }),
72118
+ MaxLength(510),
72119
+ __metadata("design:type", String)
72120
+ ], MJScheduledJob_.prototype, "LockedByInstance", void 0);
72121
+ __decorate([
72122
+ Field({ nullable: true, description: `Expected completion time for the current execution. If current time exceeds this and lock still exists, the lock is considered stale and can be claimed by another instance. Handles crashed server cleanup.` }),
72123
+ MaxLength(10),
72124
+ __metadata("design:type", Date)
72125
+ ], MJScheduledJob_.prototype, "ExpectedCompletionAt", void 0);
72126
+ __decorate([
72127
+ Field({ description: `Controls behavior when a new execution is scheduled while a previous execution is still running. Skip=do not start new execution (default), Queue=wait for current to finish then execute, Concurrent=allow multiple simultaneous executions.` }),
72128
+ MaxLength(40),
72129
+ __metadata("design:type", String)
72130
+ ], MJScheduledJob_.prototype, "ConcurrencyMode", void 0);
72131
+ __decorate([
72132
+ Field(),
72133
+ MaxLength(10),
72134
+ __metadata("design:type", Date)
72135
+ ], MJScheduledJob_.prototype, "_mj__CreatedAt", void 0);
72136
+ __decorate([
72137
+ Field(),
72138
+ MaxLength(10),
72139
+ __metadata("design:type", Date)
72140
+ ], MJScheduledJob_.prototype, "_mj__UpdatedAt", void 0);
72141
+ __decorate([
72142
+ Field(),
72143
+ MaxLength(200),
72144
+ __metadata("design:type", String)
72145
+ ], MJScheduledJob_.prototype, "JobType", void 0);
72146
+ __decorate([
72147
+ Field({ nullable: true }),
72148
+ MaxLength(200),
72149
+ __metadata("design:type", String)
72150
+ ], MJScheduledJob_.prototype, "OwnerUser", void 0);
72151
+ __decorate([
72152
+ Field({ nullable: true }),
72153
+ MaxLength(200),
72154
+ __metadata("design:type", String)
72155
+ ], MJScheduledJob_.prototype, "NotifyUser", void 0);
72156
+ __decorate([
72157
+ Field(() => [MJScheduledJobRun_]),
72158
+ __metadata("design:type", Array)
72159
+ ], MJScheduledJob_.prototype, "MJ_ScheduledJobRuns_ScheduledJobIDArray", void 0);
72160
+ MJScheduledJob_ = __decorate([
72161
+ ObjectType({ description: `Defines schedules for automated job execution across all schedulable types. Each record represents a scheduled job with its cron expression, configuration, and execution tracking.` })
72162
+ ], MJScheduledJob_);
72163
+ export { MJScheduledJob_ };
72164
+ let CreateMJScheduledJobInput = class CreateMJScheduledJobInput {
72165
+ ID;
72166
+ JobTypeID;
72167
+ Name;
72168
+ Description;
72169
+ CronExpression;
72170
+ Timezone;
72171
+ StartAt;
72172
+ EndAt;
72173
+ Status;
72174
+ Configuration;
72175
+ OwnerUserID;
72176
+ LastRunAt;
72177
+ NextRunAt;
72178
+ RunCount;
72179
+ SuccessCount;
72180
+ FailureCount;
72181
+ NotifyOnSuccess;
72182
+ NotifyOnFailure;
72183
+ NotifyUserID;
72184
+ NotifyViaEmail;
72185
+ NotifyViaInApp;
72186
+ LockToken;
72187
+ LockedAt;
72188
+ LockedByInstance;
72189
+ ExpectedCompletionAt;
72190
+ ConcurrencyMode;
72191
+ };
72192
+ __decorate([
72193
+ Field({ nullable: true }),
72194
+ __metadata("design:type", String)
72195
+ ], CreateMJScheduledJobInput.prototype, "ID", void 0);
72196
+ __decorate([
72197
+ Field({ nullable: true }),
72198
+ __metadata("design:type", String)
72199
+ ], CreateMJScheduledJobInput.prototype, "JobTypeID", void 0);
72200
+ __decorate([
72201
+ Field({ nullable: true }),
72202
+ __metadata("design:type", String)
72203
+ ], CreateMJScheduledJobInput.prototype, "Name", void 0);
72204
+ __decorate([
72205
+ Field({ nullable: true }),
72206
+ __metadata("design:type", String)
72207
+ ], CreateMJScheduledJobInput.prototype, "Description", void 0);
72208
+ __decorate([
72209
+ Field({ nullable: true }),
72210
+ __metadata("design:type", String)
72211
+ ], CreateMJScheduledJobInput.prototype, "CronExpression", void 0);
72212
+ __decorate([
72213
+ Field({ nullable: true }),
72214
+ __metadata("design:type", String)
72215
+ ], CreateMJScheduledJobInput.prototype, "Timezone", void 0);
72216
+ __decorate([
72217
+ Field({ nullable: true }),
72218
+ __metadata("design:type", Date)
72219
+ ], CreateMJScheduledJobInput.prototype, "StartAt", void 0);
72220
+ __decorate([
72221
+ Field({ nullable: true }),
72222
+ __metadata("design:type", Date)
72223
+ ], CreateMJScheduledJobInput.prototype, "EndAt", void 0);
72224
+ __decorate([
72225
+ Field({ nullable: true }),
72226
+ __metadata("design:type", String)
72227
+ ], CreateMJScheduledJobInput.prototype, "Status", void 0);
72228
+ __decorate([
72229
+ Field({ nullable: true }),
72230
+ __metadata("design:type", String)
72231
+ ], CreateMJScheduledJobInput.prototype, "Configuration", void 0);
72232
+ __decorate([
72233
+ Field({ nullable: true }),
72234
+ __metadata("design:type", String)
72235
+ ], CreateMJScheduledJobInput.prototype, "OwnerUserID", void 0);
72236
+ __decorate([
72237
+ Field({ nullable: true }),
72238
+ __metadata("design:type", Date)
72239
+ ], CreateMJScheduledJobInput.prototype, "LastRunAt", void 0);
72240
+ __decorate([
72241
+ Field({ nullable: true }),
72242
+ __metadata("design:type", Date)
72243
+ ], CreateMJScheduledJobInput.prototype, "NextRunAt", void 0);
72244
+ __decorate([
72245
+ Field(() => Int, { nullable: true }),
72246
+ __metadata("design:type", Number)
72247
+ ], CreateMJScheduledJobInput.prototype, "RunCount", void 0);
72248
+ __decorate([
72249
+ Field(() => Int, { nullable: true }),
72250
+ __metadata("design:type", Number)
72251
+ ], CreateMJScheduledJobInput.prototype, "SuccessCount", void 0);
72252
+ __decorate([
72253
+ Field(() => Int, { nullable: true }),
72254
+ __metadata("design:type", Number)
72255
+ ], CreateMJScheduledJobInput.prototype, "FailureCount", void 0);
72256
+ __decorate([
72257
+ Field(() => Boolean, { nullable: true }),
72258
+ __metadata("design:type", Boolean)
72259
+ ], CreateMJScheduledJobInput.prototype, "NotifyOnSuccess", void 0);
72260
+ __decorate([
72261
+ Field(() => Boolean, { nullable: true }),
72262
+ __metadata("design:type", Boolean)
72263
+ ], CreateMJScheduledJobInput.prototype, "NotifyOnFailure", void 0);
72264
+ __decorate([
72265
+ Field({ nullable: true }),
72266
+ __metadata("design:type", String)
72267
+ ], CreateMJScheduledJobInput.prototype, "NotifyUserID", void 0);
72268
+ __decorate([
72269
+ Field(() => Boolean, { nullable: true }),
72270
+ __metadata("design:type", Boolean)
72271
+ ], CreateMJScheduledJobInput.prototype, "NotifyViaEmail", void 0);
72272
+ __decorate([
72273
+ Field(() => Boolean, { nullable: true }),
72274
+ __metadata("design:type", Boolean)
72275
+ ], CreateMJScheduledJobInput.prototype, "NotifyViaInApp", void 0);
72276
+ __decorate([
72277
+ Field({ nullable: true }),
72278
+ __metadata("design:type", String)
72279
+ ], CreateMJScheduledJobInput.prototype, "LockToken", void 0);
72280
+ __decorate([
72281
+ Field({ nullable: true }),
72282
+ __metadata("design:type", Date)
72283
+ ], CreateMJScheduledJobInput.prototype, "LockedAt", void 0);
72284
+ __decorate([
72285
+ Field({ nullable: true }),
72286
+ __metadata("design:type", String)
72287
+ ], CreateMJScheduledJobInput.prototype, "LockedByInstance", void 0);
72288
+ __decorate([
72289
+ Field({ nullable: true }),
72290
+ __metadata("design:type", Date)
72291
+ ], CreateMJScheduledJobInput.prototype, "ExpectedCompletionAt", void 0);
72292
+ __decorate([
72293
+ Field({ nullable: true }),
72294
+ __metadata("design:type", String)
72295
+ ], CreateMJScheduledJobInput.prototype, "ConcurrencyMode", void 0);
72296
+ CreateMJScheduledJobInput = __decorate([
72297
+ InputType()
72298
+ ], CreateMJScheduledJobInput);
72299
+ export { CreateMJScheduledJobInput };
72300
+ let UpdateMJScheduledJobInput = class UpdateMJScheduledJobInput {
72301
+ ID;
72302
+ JobTypeID;
72303
+ Name;
72304
+ Description;
72305
+ CronExpression;
72306
+ Timezone;
72307
+ StartAt;
72308
+ EndAt;
72309
+ Status;
72310
+ Configuration;
72311
+ OwnerUserID;
72312
+ LastRunAt;
72313
+ NextRunAt;
72314
+ RunCount;
72315
+ SuccessCount;
72316
+ FailureCount;
72317
+ NotifyOnSuccess;
72318
+ NotifyOnFailure;
72319
+ NotifyUserID;
72320
+ NotifyViaEmail;
72321
+ NotifyViaInApp;
72322
+ LockToken;
72323
+ LockedAt;
72324
+ LockedByInstance;
72325
+ ExpectedCompletionAt;
72326
+ ConcurrencyMode;
72327
+ OldValues___;
72328
+ };
72329
+ __decorate([
72330
+ Field(),
72331
+ __metadata("design:type", String)
72332
+ ], UpdateMJScheduledJobInput.prototype, "ID", void 0);
72333
+ __decorate([
72334
+ Field({ nullable: true }),
72335
+ __metadata("design:type", String)
72336
+ ], UpdateMJScheduledJobInput.prototype, "JobTypeID", void 0);
72337
+ __decorate([
72338
+ Field({ nullable: true }),
72339
+ __metadata("design:type", String)
72340
+ ], UpdateMJScheduledJobInput.prototype, "Name", void 0);
72341
+ __decorate([
72342
+ Field({ nullable: true }),
72343
+ __metadata("design:type", String)
72344
+ ], UpdateMJScheduledJobInput.prototype, "Description", void 0);
72345
+ __decorate([
72346
+ Field({ nullable: true }),
72347
+ __metadata("design:type", String)
72348
+ ], UpdateMJScheduledJobInput.prototype, "CronExpression", void 0);
72349
+ __decorate([
72350
+ Field({ nullable: true }),
72351
+ __metadata("design:type", String)
72352
+ ], UpdateMJScheduledJobInput.prototype, "Timezone", void 0);
72353
+ __decorate([
72354
+ Field({ nullable: true }),
72355
+ __metadata("design:type", Date)
72356
+ ], UpdateMJScheduledJobInput.prototype, "StartAt", void 0);
72357
+ __decorate([
72358
+ Field({ nullable: true }),
72359
+ __metadata("design:type", Date)
72360
+ ], UpdateMJScheduledJobInput.prototype, "EndAt", void 0);
72361
+ __decorate([
72362
+ Field({ nullable: true }),
72363
+ __metadata("design:type", String)
72364
+ ], UpdateMJScheduledJobInput.prototype, "Status", void 0);
72365
+ __decorate([
72366
+ Field({ nullable: true }),
72367
+ __metadata("design:type", String)
72368
+ ], UpdateMJScheduledJobInput.prototype, "Configuration", void 0);
72369
+ __decorate([
72370
+ Field({ nullable: true }),
72371
+ __metadata("design:type", String)
72372
+ ], UpdateMJScheduledJobInput.prototype, "OwnerUserID", void 0);
72373
+ __decorate([
72374
+ Field({ nullable: true }),
72375
+ __metadata("design:type", Date)
72376
+ ], UpdateMJScheduledJobInput.prototype, "LastRunAt", void 0);
72377
+ __decorate([
72378
+ Field({ nullable: true }),
72379
+ __metadata("design:type", Date)
72380
+ ], UpdateMJScheduledJobInput.prototype, "NextRunAt", void 0);
72381
+ __decorate([
72382
+ Field(() => Int, { nullable: true }),
72383
+ __metadata("design:type", Number)
72384
+ ], UpdateMJScheduledJobInput.prototype, "RunCount", void 0);
72385
+ __decorate([
72386
+ Field(() => Int, { nullable: true }),
72387
+ __metadata("design:type", Number)
72388
+ ], UpdateMJScheduledJobInput.prototype, "SuccessCount", void 0);
72389
+ __decorate([
72390
+ Field(() => Int, { nullable: true }),
72391
+ __metadata("design:type", Number)
72392
+ ], UpdateMJScheduledJobInput.prototype, "FailureCount", void 0);
72393
+ __decorate([
72394
+ Field(() => Boolean, { nullable: true }),
72395
+ __metadata("design:type", Boolean)
72396
+ ], UpdateMJScheduledJobInput.prototype, "NotifyOnSuccess", void 0);
72397
+ __decorate([
72398
+ Field(() => Boolean, { nullable: true }),
72399
+ __metadata("design:type", Boolean)
72400
+ ], UpdateMJScheduledJobInput.prototype, "NotifyOnFailure", void 0);
72401
+ __decorate([
72402
+ Field({ nullable: true }),
72403
+ __metadata("design:type", String)
72404
+ ], UpdateMJScheduledJobInput.prototype, "NotifyUserID", void 0);
72405
+ __decorate([
72406
+ Field(() => Boolean, { nullable: true }),
72407
+ __metadata("design:type", Boolean)
72408
+ ], UpdateMJScheduledJobInput.prototype, "NotifyViaEmail", void 0);
72409
+ __decorate([
72410
+ Field(() => Boolean, { nullable: true }),
72411
+ __metadata("design:type", Boolean)
72412
+ ], UpdateMJScheduledJobInput.prototype, "NotifyViaInApp", void 0);
72413
+ __decorate([
72414
+ Field({ nullable: true }),
72415
+ __metadata("design:type", String)
72416
+ ], UpdateMJScheduledJobInput.prototype, "LockToken", void 0);
72417
+ __decorate([
72418
+ Field({ nullable: true }),
72419
+ __metadata("design:type", Date)
72420
+ ], UpdateMJScheduledJobInput.prototype, "LockedAt", void 0);
72421
+ __decorate([
72422
+ Field({ nullable: true }),
72423
+ __metadata("design:type", String)
72424
+ ], UpdateMJScheduledJobInput.prototype, "LockedByInstance", void 0);
72425
+ __decorate([
72426
+ Field({ nullable: true }),
72427
+ __metadata("design:type", Date)
72428
+ ], UpdateMJScheduledJobInput.prototype, "ExpectedCompletionAt", void 0);
72429
+ __decorate([
72430
+ Field({ nullable: true }),
72431
+ __metadata("design:type", String)
72432
+ ], UpdateMJScheduledJobInput.prototype, "ConcurrencyMode", void 0);
72433
+ __decorate([
72434
+ Field(() => [KeyValuePairInput], { nullable: true }),
72435
+ __metadata("design:type", Array)
72436
+ ], UpdateMJScheduledJobInput.prototype, "OldValues___", void 0);
72437
+ UpdateMJScheduledJobInput = __decorate([
72438
+ InputType()
72439
+ ], UpdateMJScheduledJobInput);
72440
+ export { UpdateMJScheduledJobInput };
72441
+ let RunMJScheduledJobViewResult = class RunMJScheduledJobViewResult {
72442
+ Results;
72443
+ UserViewRunID;
72444
+ RowCount;
72445
+ TotalRowCount;
72446
+ ExecutionTime;
72447
+ ErrorMessage;
72448
+ Success;
72449
+ };
72450
+ __decorate([
72451
+ Field(() => [MJScheduledJob_]),
72452
+ __metadata("design:type", Array)
72453
+ ], RunMJScheduledJobViewResult.prototype, "Results", void 0);
72454
+ __decorate([
72455
+ Field(() => String, { nullable: true }),
72456
+ __metadata("design:type", String)
72457
+ ], RunMJScheduledJobViewResult.prototype, "UserViewRunID", void 0);
72458
+ __decorate([
72459
+ Field(() => Int, { nullable: true }),
72460
+ __metadata("design:type", Number)
72461
+ ], RunMJScheduledJobViewResult.prototype, "RowCount", void 0);
72462
+ __decorate([
72463
+ Field(() => Int, { nullable: true }),
72464
+ __metadata("design:type", Number)
72465
+ ], RunMJScheduledJobViewResult.prototype, "TotalRowCount", void 0);
72466
+ __decorate([
72467
+ Field(() => Int, { nullable: true }),
72468
+ __metadata("design:type", Number)
72469
+ ], RunMJScheduledJobViewResult.prototype, "ExecutionTime", void 0);
72470
+ __decorate([
72471
+ Field({ nullable: true }),
72472
+ __metadata("design:type", String)
72473
+ ], RunMJScheduledJobViewResult.prototype, "ErrorMessage", void 0);
72474
+ __decorate([
72475
+ Field(() => Boolean, { nullable: false }),
72476
+ __metadata("design:type", Boolean)
72477
+ ], RunMJScheduledJobViewResult.prototype, "Success", void 0);
72478
+ RunMJScheduledJobViewResult = __decorate([
72479
+ ObjectType()
72480
+ ], RunMJScheduledJobViewResult);
72481
+ export { RunMJScheduledJobViewResult };
72482
+ let MJScheduledJobResolver = class MJScheduledJobResolver extends ResolverBase {
72483
+ async RunMJScheduledJobViewByID(input, { providers, userPayload }, pubSub) {
72484
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
72485
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
72486
+ }
72487
+ async RunMJScheduledJobViewByName(input, { providers, userPayload }, pubSub) {
72488
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
72489
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
72490
+ }
72491
+ async RunMJScheduledJobDynamicView(input, { providers, userPayload }, pubSub) {
72492
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
72493
+ input.EntityName = 'MJ: Scheduled Jobs';
72494
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
72495
+ }
72496
+ async MJScheduledJob(ID, { dataSources, userPayload, providers }, pubSub) {
72497
+ this.CheckUserReadPermissions('MJ: Scheduled Jobs', userPayload);
72498
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
72499
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
72500
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwScheduledJobs] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Scheduled Jobs', userPayload, EntityPermissionType.Read, 'AND');
72501
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
72502
+ const result = this.MapFieldNamesToCodeNames('MJ: Scheduled Jobs', rows && rows.length > 0 ? rows[0] : {});
72503
+ return result;
72504
+ }
72505
+ async MJ_ScheduledJobRuns_ScheduledJobIDArray(mjscheduledjob_, { dataSources, userPayload, providers }, pubSub) {
72506
+ this.CheckUserReadPermissions('MJ: Scheduled Job Runs', userPayload);
72507
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
72508
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
72509
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwScheduledJobRuns] WHERE [ScheduledJobID]='${mjscheduledjob_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Scheduled Job Runs', userPayload, EntityPermissionType.Read, 'AND');
72510
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
72511
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Scheduled Job Runs', rows);
72512
+ return result;
72513
+ }
72514
+ async CreateMJScheduledJob(input, { providers, userPayload }, pubSub) {
72515
+ const provider = GetReadWriteProvider(providers);
72516
+ return this.CreateRecord('MJ: Scheduled Jobs', input, provider, userPayload, pubSub);
72517
+ }
72518
+ async UpdateMJScheduledJob(input, { providers, userPayload }, pubSub) {
72519
+ const provider = GetReadWriteProvider(providers);
72520
+ return this.UpdateRecord('MJ: Scheduled Jobs', input, provider, userPayload, pubSub);
72521
+ }
72522
+ async DeleteMJScheduledJob(ID, options, { providers, userPayload }, pubSub) {
72523
+ const provider = GetReadWriteProvider(providers);
72524
+ const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
72525
+ return this.DeleteRecord('MJ: Scheduled Jobs', key, options, provider, userPayload, pubSub);
72526
+ }
72527
+ };
72528
+ __decorate([
72529
+ Query(() => RunMJScheduledJobViewResult),
72530
+ __param(0, Arg('input', () => RunViewByIDInput)),
72531
+ __param(1, Ctx()),
72532
+ __param(2, PubSub()),
72533
+ __metadata("design:type", Function),
72534
+ __metadata("design:paramtypes", [RunViewByIDInput, Object, PubSubEngine]),
72535
+ __metadata("design:returntype", Promise)
72536
+ ], MJScheduledJobResolver.prototype, "RunMJScheduledJobViewByID", null);
72537
+ __decorate([
72538
+ Query(() => RunMJScheduledJobViewResult),
72539
+ __param(0, Arg('input', () => RunViewByNameInput)),
72540
+ __param(1, Ctx()),
72541
+ __param(2, PubSub()),
72542
+ __metadata("design:type", Function),
72543
+ __metadata("design:paramtypes", [RunViewByNameInput, Object, PubSubEngine]),
72544
+ __metadata("design:returntype", Promise)
72545
+ ], MJScheduledJobResolver.prototype, "RunMJScheduledJobViewByName", null);
72546
+ __decorate([
72547
+ Query(() => RunMJScheduledJobViewResult),
72548
+ __param(0, Arg('input', () => RunDynamicViewInput)),
72549
+ __param(1, Ctx()),
72550
+ __param(2, PubSub()),
72551
+ __metadata("design:type", Function),
72552
+ __metadata("design:paramtypes", [RunDynamicViewInput, Object, PubSubEngine]),
72553
+ __metadata("design:returntype", Promise)
72554
+ ], MJScheduledJobResolver.prototype, "RunMJScheduledJobDynamicView", null);
72555
+ __decorate([
72556
+ Query(() => MJScheduledJob_, { nullable: true }),
72557
+ __param(0, Arg('ID', () => String)),
72558
+ __param(1, Ctx()),
72559
+ __param(2, PubSub()),
72560
+ __metadata("design:type", Function),
72561
+ __metadata("design:paramtypes", [String, Object, PubSubEngine]),
72562
+ __metadata("design:returntype", Promise)
72563
+ ], MJScheduledJobResolver.prototype, "MJScheduledJob", null);
72564
+ __decorate([
72565
+ FieldResolver(() => [MJScheduledJobRun_]),
72566
+ __param(0, Root()),
72567
+ __param(1, Ctx()),
72568
+ __param(2, PubSub()),
72569
+ __metadata("design:type", Function),
72570
+ __metadata("design:paramtypes", [MJScheduledJob_, Object, PubSubEngine]),
72571
+ __metadata("design:returntype", Promise)
72572
+ ], MJScheduledJobResolver.prototype, "MJ_ScheduledJobRuns_ScheduledJobIDArray", null);
72573
+ __decorate([
72574
+ Mutation(() => MJScheduledJob_),
72575
+ __param(0, Arg('input', () => CreateMJScheduledJobInput)),
72576
+ __param(1, Ctx()),
72577
+ __param(2, PubSub()),
72578
+ __metadata("design:type", Function),
72579
+ __metadata("design:paramtypes", [CreateMJScheduledJobInput, Object, PubSubEngine]),
72580
+ __metadata("design:returntype", Promise)
72581
+ ], MJScheduledJobResolver.prototype, "CreateMJScheduledJob", null);
72582
+ __decorate([
72583
+ Mutation(() => MJScheduledJob_),
72584
+ __param(0, Arg('input', () => UpdateMJScheduledJobInput)),
72585
+ __param(1, Ctx()),
72586
+ __param(2, PubSub()),
72587
+ __metadata("design:type", Function),
72588
+ __metadata("design:paramtypes", [UpdateMJScheduledJobInput, Object, PubSubEngine]),
72589
+ __metadata("design:returntype", Promise)
72590
+ ], MJScheduledJobResolver.prototype, "UpdateMJScheduledJob", null);
72591
+ __decorate([
72592
+ Mutation(() => MJScheduledJob_),
72593
+ __param(0, Arg('ID', () => String)),
72594
+ __param(1, Arg('options___', () => DeleteOptionsInput)),
72595
+ __param(2, Ctx()),
72596
+ __param(3, PubSub()),
72597
+ __metadata("design:type", Function),
72598
+ __metadata("design:paramtypes", [String, DeleteOptionsInput, Object, PubSubEngine]),
72599
+ __metadata("design:returntype", Promise)
72600
+ ], MJScheduledJobResolver.prototype, "DeleteMJScheduledJob", null);
72601
+ MJScheduledJobResolver = __decorate([
72602
+ Resolver(MJScheduledJob_)
72603
+ ], MJScheduledJobResolver);
72604
+ export { MJScheduledJobResolver };
71189
72605
  let MJAIPromptRun_ = class MJAIPromptRun_ {
71190
72606
  ID;
71191
72607
  PromptID;