@memberjunction/core-entities 2.106.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.
@@ -4931,6 +4931,7 @@ export declare const AIAgentRelationshipSchema: z.ZodObject<{
4931
4931
  Status: z.ZodUnion<[z.ZodLiteral<"Active">, z.ZodLiteral<"Pending">, z.ZodLiteral<"Revoked">]>;
4932
4932
  __mj_CreatedAt: z.ZodDate;
4933
4933
  __mj_UpdatedAt: z.ZodDate;
4934
+ SubAgentOutputMapping: z.ZodNullable<z.ZodString>;
4934
4935
  Agent: z.ZodNullable<z.ZodString>;
4935
4936
  SubAgent: z.ZodNullable<z.ZodString>;
4936
4937
  }, "strip", z.ZodTypeAny, {
@@ -4941,6 +4942,7 @@ export declare const AIAgentRelationshipSchema: z.ZodObject<{
4941
4942
  AgentID?: string;
4942
4943
  Agent?: string;
4943
4944
  SubAgentID?: string;
4945
+ SubAgentOutputMapping?: string;
4944
4946
  SubAgent?: string;
4945
4947
  }, {
4946
4948
  ID?: string;
@@ -4950,6 +4952,7 @@ export declare const AIAgentRelationshipSchema: z.ZodObject<{
4950
4952
  AgentID?: string;
4951
4953
  Agent?: string;
4952
4954
  SubAgentID?: string;
4955
+ SubAgentOutputMapping?: string;
4953
4956
  SubAgent?: string;
4954
4957
  }>;
4955
4958
  export type AIAgentRelationshipEntityType = z.infer<typeof AIAgentRelationshipSchema>;
@@ -5073,6 +5076,7 @@ export declare const AIAgentRunSchema: z.ZodObject<{
5073
5076
  EffortLevel: z.ZodNullable<z.ZodNumber>;
5074
5077
  RunName: z.ZodNullable<z.ZodString>;
5075
5078
  Comments: z.ZodNullable<z.ZodString>;
5079
+ ScheduledJobRunID: z.ZodNullable<z.ZodString>;
5076
5080
  Agent: z.ZodNullable<z.ZodString>;
5077
5081
  Conversation: z.ZodNullable<z.ZodString>;
5078
5082
  User: z.ZodNullable<z.ZodString>;
@@ -5125,6 +5129,7 @@ export declare const AIAgentRunSchema: z.ZodObject<{
5125
5129
  Data?: string;
5126
5130
  Verbose?: boolean;
5127
5131
  RunName?: string;
5132
+ ScheduledJobRunID?: string;
5128
5133
  OverrideModel?: string;
5129
5134
  OverrideVendor?: string;
5130
5135
  RootParentRunID?: string;
@@ -5173,6 +5178,7 @@ export declare const AIAgentRunSchema: z.ZodObject<{
5173
5178
  Data?: string;
5174
5179
  Verbose?: boolean;
5175
5180
  RunName?: string;
5181
+ ScheduledJobRunID?: string;
5176
5182
  OverrideModel?: string;
5177
5183
  OverrideVendor?: string;
5178
5184
  RootParentRunID?: string;
@@ -7028,6 +7034,192 @@ export declare const ReportVersionSchema: z.ZodObject<{
7028
7034
  DataContextUpdated?: boolean;
7029
7035
  }>;
7030
7036
  export type ReportVersionEntityType = z.infer<typeof ReportVersionSchema>;
7037
+ /**
7038
+ * zod schema definition for the entity MJ: Scheduled Job Runs
7039
+ */
7040
+ export declare const ScheduledJobRunSchema: z.ZodObject<{
7041
+ ID: z.ZodString;
7042
+ ScheduledJobID: z.ZodString;
7043
+ StartedAt: z.ZodDate;
7044
+ CompletedAt: z.ZodNullable<z.ZodDate>;
7045
+ Status: z.ZodUnion<[z.ZodLiteral<"Cancelled">, z.ZodLiteral<"Completed">, z.ZodLiteral<"Failed">, z.ZodLiteral<"Running">, z.ZodLiteral<"Timeout">]>;
7046
+ Success: z.ZodNullable<z.ZodBoolean>;
7047
+ ErrorMessage: z.ZodNullable<z.ZodString>;
7048
+ Details: z.ZodNullable<z.ZodString>;
7049
+ ExecutedByUserID: z.ZodNullable<z.ZodString>;
7050
+ QueuedAt: z.ZodNullable<z.ZodDate>;
7051
+ __mj_CreatedAt: z.ZodDate;
7052
+ __mj_UpdatedAt: z.ZodDate;
7053
+ ScheduledJob: z.ZodString;
7054
+ ExecutedByUser: z.ZodNullable<z.ZodString>;
7055
+ }, "strip", z.ZodTypeAny, {
7056
+ ID?: string;
7057
+ __mj_CreatedAt?: Date;
7058
+ __mj_UpdatedAt?: Date;
7059
+ Status?: "Failed" | "Cancelled" | "Completed" | "Running" | "Timeout";
7060
+ StartedAt?: Date;
7061
+ Success?: boolean;
7062
+ Details?: string;
7063
+ ErrorMessage?: string;
7064
+ CompletedAt?: Date;
7065
+ ScheduledJobID?: string;
7066
+ ExecutedByUserID?: string;
7067
+ QueuedAt?: Date;
7068
+ ScheduledJob?: string;
7069
+ ExecutedByUser?: string;
7070
+ }, {
7071
+ ID?: string;
7072
+ __mj_CreatedAt?: Date;
7073
+ __mj_UpdatedAt?: Date;
7074
+ Status?: "Failed" | "Cancelled" | "Completed" | "Running" | "Timeout";
7075
+ StartedAt?: Date;
7076
+ Success?: boolean;
7077
+ Details?: string;
7078
+ ErrorMessage?: string;
7079
+ CompletedAt?: Date;
7080
+ ScheduledJobID?: string;
7081
+ ExecutedByUserID?: string;
7082
+ QueuedAt?: Date;
7083
+ ScheduledJob?: string;
7084
+ ExecutedByUser?: string;
7085
+ }>;
7086
+ export type ScheduledJobRunEntityType = z.infer<typeof ScheduledJobRunSchema>;
7087
+ /**
7088
+ * zod schema definition for the entity MJ: Scheduled Job Types
7089
+ */
7090
+ export declare const ScheduledJobTypeSchema: z.ZodObject<{
7091
+ ID: z.ZodString;
7092
+ Name: z.ZodString;
7093
+ Description: z.ZodNullable<z.ZodString>;
7094
+ DriverClass: z.ZodString;
7095
+ DomainRunEntity: z.ZodNullable<z.ZodString>;
7096
+ DomainRunEntityFKey: z.ZodNullable<z.ZodString>;
7097
+ NotificationsAvailable: z.ZodBoolean;
7098
+ __mj_CreatedAt: z.ZodDate;
7099
+ __mj_UpdatedAt: z.ZodDate;
7100
+ }, "strip", z.ZodTypeAny, {
7101
+ ID?: string;
7102
+ __mj_CreatedAt?: Date;
7103
+ __mj_UpdatedAt?: Date;
7104
+ Name?: string;
7105
+ Description?: string;
7106
+ DriverClass?: string;
7107
+ DomainRunEntity?: string;
7108
+ DomainRunEntityFKey?: string;
7109
+ NotificationsAvailable?: boolean;
7110
+ }, {
7111
+ ID?: string;
7112
+ __mj_CreatedAt?: Date;
7113
+ __mj_UpdatedAt?: Date;
7114
+ Name?: string;
7115
+ Description?: string;
7116
+ DriverClass?: string;
7117
+ DomainRunEntity?: string;
7118
+ DomainRunEntityFKey?: string;
7119
+ NotificationsAvailable?: boolean;
7120
+ }>;
7121
+ export type ScheduledJobTypeEntityType = z.infer<typeof ScheduledJobTypeSchema>;
7122
+ /**
7123
+ * zod schema definition for the entity MJ: Scheduled Jobs
7124
+ */
7125
+ export declare const ScheduledJobSchema: z.ZodObject<{
7126
+ ID: z.ZodString;
7127
+ JobTypeID: z.ZodString;
7128
+ Name: z.ZodString;
7129
+ Description: z.ZodNullable<z.ZodString>;
7130
+ CronExpression: z.ZodString;
7131
+ Timezone: z.ZodString;
7132
+ StartAt: z.ZodNullable<z.ZodDate>;
7133
+ EndAt: z.ZodNullable<z.ZodDate>;
7134
+ Status: z.ZodUnion<[z.ZodLiteral<"Active">, z.ZodLiteral<"Disabled">, z.ZodLiteral<"Expired">, z.ZodLiteral<"Paused">, z.ZodLiteral<"Pending">]>;
7135
+ Configuration: z.ZodNullable<z.ZodString>;
7136
+ OwnerUserID: z.ZodNullable<z.ZodString>;
7137
+ LastRunAt: z.ZodNullable<z.ZodDate>;
7138
+ NextRunAt: z.ZodNullable<z.ZodDate>;
7139
+ RunCount: z.ZodNumber;
7140
+ SuccessCount: z.ZodNumber;
7141
+ FailureCount: z.ZodNumber;
7142
+ NotifyOnSuccess: z.ZodBoolean;
7143
+ NotifyOnFailure: z.ZodBoolean;
7144
+ NotifyUserID: z.ZodNullable<z.ZodString>;
7145
+ NotifyViaEmail: z.ZodBoolean;
7146
+ NotifyViaInApp: z.ZodBoolean;
7147
+ LockToken: z.ZodNullable<z.ZodString>;
7148
+ LockedAt: z.ZodNullable<z.ZodDate>;
7149
+ LockedByInstance: z.ZodNullable<z.ZodString>;
7150
+ ExpectedCompletionAt: z.ZodNullable<z.ZodDate>;
7151
+ ConcurrencyMode: z.ZodUnion<[z.ZodLiteral<"Concurrent">, z.ZodLiteral<"Queue">, z.ZodLiteral<"Skip">]>;
7152
+ __mj_CreatedAt: z.ZodDate;
7153
+ __mj_UpdatedAt: z.ZodDate;
7154
+ JobType: z.ZodString;
7155
+ OwnerUser: z.ZodNullable<z.ZodString>;
7156
+ NotifyUser: z.ZodNullable<z.ZodString>;
7157
+ }, "strip", z.ZodTypeAny, {
7158
+ ID?: string;
7159
+ __mj_CreatedAt?: Date;
7160
+ __mj_UpdatedAt?: Date;
7161
+ Name?: string;
7162
+ Description?: string;
7163
+ Status?: "Active" | "Disabled" | "Pending" | "Expired" | "Paused";
7164
+ OwnerUserID?: string;
7165
+ OwnerUser?: string;
7166
+ Configuration?: string;
7167
+ JobTypeID?: string;
7168
+ CronExpression?: string;
7169
+ Timezone?: string;
7170
+ StartAt?: Date;
7171
+ EndAt?: Date;
7172
+ LastRunAt?: Date;
7173
+ NextRunAt?: Date;
7174
+ RunCount?: number;
7175
+ SuccessCount?: number;
7176
+ FailureCount?: number;
7177
+ NotifyOnSuccess?: boolean;
7178
+ NotifyOnFailure?: boolean;
7179
+ NotifyUserID?: string;
7180
+ NotifyViaEmail?: boolean;
7181
+ NotifyViaInApp?: boolean;
7182
+ LockToken?: string;
7183
+ LockedAt?: Date;
7184
+ LockedByInstance?: string;
7185
+ ExpectedCompletionAt?: Date;
7186
+ ConcurrencyMode?: "Concurrent" | "Queue" | "Skip";
7187
+ JobType?: string;
7188
+ NotifyUser?: string;
7189
+ }, {
7190
+ ID?: string;
7191
+ __mj_CreatedAt?: Date;
7192
+ __mj_UpdatedAt?: Date;
7193
+ Name?: string;
7194
+ Description?: string;
7195
+ Status?: "Active" | "Disabled" | "Pending" | "Expired" | "Paused";
7196
+ OwnerUserID?: string;
7197
+ OwnerUser?: string;
7198
+ Configuration?: string;
7199
+ JobTypeID?: string;
7200
+ CronExpression?: string;
7201
+ Timezone?: string;
7202
+ StartAt?: Date;
7203
+ EndAt?: Date;
7204
+ LastRunAt?: Date;
7205
+ NextRunAt?: Date;
7206
+ RunCount?: number;
7207
+ SuccessCount?: number;
7208
+ FailureCount?: number;
7209
+ NotifyOnSuccess?: boolean;
7210
+ NotifyOnFailure?: boolean;
7211
+ NotifyUserID?: string;
7212
+ NotifyViaEmail?: boolean;
7213
+ NotifyViaInApp?: boolean;
7214
+ LockToken?: string;
7215
+ LockedAt?: Date;
7216
+ LockedByInstance?: string;
7217
+ ExpectedCompletionAt?: Date;
7218
+ ConcurrencyMode?: "Concurrent" | "Queue" | "Skip";
7219
+ JobType?: string;
7220
+ NotifyUser?: string;
7221
+ }>;
7222
+ export type ScheduledJobEntityType = z.infer<typeof ScheduledJobSchema>;
7031
7223
  /**
7032
7224
  * zod schema definition for the entity MJ: Task Dependencies
7033
7225
  */
@@ -7519,9 +7711,9 @@ export declare const QueueTaskSchema: z.ZodObject<{
7519
7711
  Output?: string;
7520
7712
  ErrorMessage?: string;
7521
7713
  Data?: string;
7714
+ Queue?: string;
7522
7715
  QueueID?: string;
7523
7716
  Options?: string;
7524
- Queue?: string;
7525
7717
  }, {
7526
7718
  ID?: string;
7527
7719
  Comments?: string;
@@ -7533,9 +7725,9 @@ export declare const QueueTaskSchema: z.ZodObject<{
7533
7725
  Output?: string;
7534
7726
  ErrorMessage?: string;
7535
7727
  Data?: string;
7728
+ Queue?: string;
7536
7729
  QueueID?: string;
7537
7730
  Options?: string;
7538
- Queue?: string;
7539
7731
  }>;
7540
7732
  export type QueueTaskEntityType = z.infer<typeof QueueTaskSchema>;
7541
7733
  /**
@@ -8367,9 +8559,9 @@ export declare const ScheduledActionSchema: z.ZodObject<{
8367
8559
  Description?: string;
8368
8560
  Status?: "Active" | "Disabled" | "Pending" | "Expired";
8369
8561
  Type?: "Custom" | "Daily" | "Monthly" | "Weekly" | "Yearly";
8370
- CreatedByUserID?: string;
8371
8562
  CronExpression?: string;
8372
8563
  Timezone?: string;
8564
+ CreatedByUserID?: string;
8373
8565
  IntervalDays?: number;
8374
8566
  DayOfWeek?: string;
8375
8567
  DayOfMonth?: number;
@@ -8386,9 +8578,9 @@ export declare const ScheduledActionSchema: z.ZodObject<{
8386
8578
  Description?: string;
8387
8579
  Status?: "Active" | "Disabled" | "Pending" | "Expired";
8388
8580
  Type?: "Custom" | "Daily" | "Monthly" | "Weekly" | "Yearly";
8389
- CreatedByUserID?: string;
8390
8581
  CronExpression?: string;
8391
8582
  Timezone?: string;
8583
+ CreatedByUserID?: string;
8392
8584
  IntervalDays?: number;
8393
8585
  DayOfWeek?: string;
8394
8586
  DayOfMonth?: number;
@@ -23297,6 +23489,14 @@ export declare class AIAgentRelationshipEntity extends BaseEntity<AIAgentRelatio
23297
23489
  */
23298
23490
  get __mj_UpdatedAt(): Date;
23299
23491
  /**
23492
+ * * Field Name: SubAgentOutputMapping
23493
+ * * Display Name: Sub Agent Output Mapping
23494
+ * * SQL Data Type: nvarchar(MAX)
23495
+ * * 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.
23496
+ */
23497
+ get SubAgentOutputMapping(): string | null;
23498
+ set SubAgentOutputMapping(value: string | null);
23499
+ /**
23300
23500
  * * Field Name: Agent
23301
23501
  * * Display Name: Agent
23302
23502
  * * SQL Data Type: nvarchar(255)
@@ -23950,6 +24150,15 @@ each time the agent processes a prompt step.
23950
24150
  get Comments(): string | null;
23951
24151
  set Comments(value: string | null);
23952
24152
  /**
24153
+ * * Field Name: ScheduledJobRunID
24154
+ * * Display Name: Scheduled Job Run ID
24155
+ * * SQL Data Type: uniqueidentifier
24156
+ * * Related Entity/Foreign Key: MJ: Scheduled Job Runs (vwScheduledJobRuns.ID)
24157
+ * * 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.
24158
+ */
24159
+ get ScheduledJobRunID(): string | null;
24160
+ set ScheduledJobRunID(value: string | null);
24161
+ /**
23953
24162
  * * Field Name: Agent
23954
24163
  * * Display Name: Agent
23955
24164
  * * SQL Data Type: nvarchar(255)
@@ -29398,6 +29607,562 @@ export declare class ReportVersionEntity extends BaseEntity<ReportVersionEntityT
29398
29607
  */
29399
29608
  get Report(): string;
29400
29609
  }
29610
+ /**
29611
+ * MJ: Scheduled Job Runs - strongly typed entity sub-class
29612
+ * * Schema: __mj
29613
+ * * Base Table: ScheduledJobRun
29614
+ * * Base View: vwScheduledJobRuns
29615
+ * * @description Records execution history for scheduled jobs. Provides uniform tracking across all job types. Each record represents one execution attempt of a scheduled job.
29616
+ * * Primary Key: ID
29617
+ * @extends {BaseEntity}
29618
+ * @class
29619
+ * @public
29620
+ */
29621
+ export declare class ScheduledJobRunEntity extends BaseEntity<ScheduledJobRunEntityType> {
29622
+ /**
29623
+ * Loads the MJ: Scheduled Job Runs record from the database
29624
+ * @param ID: string - primary key value to load the MJ: Scheduled Job Runs record.
29625
+ * @param EntityRelationshipsToLoad - (optional) the relationships to load
29626
+ * @returns {Promise<boolean>} - true if successful, false otherwise
29627
+ * @public
29628
+ * @async
29629
+ * @memberof ScheduledJobRunEntity
29630
+ * @method
29631
+ * @override
29632
+ */
29633
+ Load(ID: string, EntityRelationshipsToLoad?: string[]): Promise<boolean>;
29634
+ /**
29635
+ * Validate() method override for MJ: Scheduled Job Runs entity. This is an auto-generated method that invokes the generated validators for this entity for the following fields:
29636
+ * * Details: This rule ensures that if the Details field is not empty, it must contain a valid JSON value.
29637
+ * @public
29638
+ * @method
29639
+ * @override
29640
+ */
29641
+ Validate(): ValidationResult;
29642
+ /**
29643
+ * This rule ensures that if the Details field is not empty, it must contain a valid JSON value.
29644
+ * @param result - the ValidationResult object to add any errors or warnings to
29645
+ * @public
29646
+ * @method
29647
+ */
29648
+ ValidateDetailsAsJson(result: ValidationResult): void;
29649
+ /**
29650
+ * * Field Name: ID
29651
+ * * Display Name: ID
29652
+ * * SQL Data Type: uniqueidentifier
29653
+ * * Default Value: newsequentialid()
29654
+ */
29655
+ get ID(): string;
29656
+ set ID(value: string);
29657
+ /**
29658
+ * * Field Name: ScheduledJobID
29659
+ * * Display Name: Scheduled Job ID
29660
+ * * SQL Data Type: uniqueidentifier
29661
+ * * Related Entity/Foreign Key: MJ: Scheduled Jobs (vwScheduledJobs.ID)
29662
+ */
29663
+ get ScheduledJobID(): string;
29664
+ set ScheduledJobID(value: string);
29665
+ /**
29666
+ * * Field Name: StartedAt
29667
+ * * Display Name: Started At
29668
+ * * SQL Data Type: datetimeoffset
29669
+ * * Default Value: sysdatetimeoffset()
29670
+ * * Description: Timestamp when this job execution began. Set immediately before calling the job plugin's Execute method.
29671
+ */
29672
+ get StartedAt(): Date;
29673
+ set StartedAt(value: Date);
29674
+ /**
29675
+ * * Field Name: CompletedAt
29676
+ * * Display Name: Completed At
29677
+ * * SQL Data Type: datetimeoffset
29678
+ * * Description: Timestamp when this job execution completed (successfully or with failure). NULL while the job is still running.
29679
+ */
29680
+ get CompletedAt(): Date | null;
29681
+ set CompletedAt(value: Date | null);
29682
+ /**
29683
+ * * Field Name: Status
29684
+ * * Display Name: Status
29685
+ * * SQL Data Type: nvarchar(20)
29686
+ * * Default Value: Running
29687
+ * * Value List Type: List
29688
+ * * Possible Values
29689
+ * * Running
29690
+ * * Timeout
29691
+ * * Completed
29692
+ * * Cancelled
29693
+ * * Failed
29694
+ * * 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.
29695
+ */
29696
+ get Status(): 'Cancelled' | 'Completed' | 'Failed' | 'Running' | 'Timeout';
29697
+ set Status(value: 'Cancelled' | 'Completed' | 'Failed' | 'Running' | 'Timeout');
29698
+ /**
29699
+ * * Field Name: Success
29700
+ * * Display Name: Success
29701
+ * * SQL Data Type: bit
29702
+ * * 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.
29703
+ */
29704
+ get Success(): boolean | null;
29705
+ set Success(value: boolean | null);
29706
+ /**
29707
+ * * Field Name: ErrorMessage
29708
+ * * Display Name: Error Message
29709
+ * * SQL Data Type: nvarchar(MAX)
29710
+ * * Description: Error message if the job failed. NULL for successful runs. Contains exception messages or error details from the plugin's Execute method.
29711
+ */
29712
+ get ErrorMessage(): string | null;
29713
+ set ErrorMessage(value: string | null);
29714
+ /**
29715
+ * * Field Name: Details
29716
+ * * Display Name: Details
29717
+ * * SQL Data Type: nvarchar(MAX)
29718
+ * * 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.
29719
+ */
29720
+ get Details(): string | null;
29721
+ set Details(value: string | null);
29722
+ /**
29723
+ * * Field Name: ExecutedByUserID
29724
+ * * Display Name: Executed By User ID
29725
+ * * SQL Data Type: uniqueidentifier
29726
+ * * Related Entity/Foreign Key: Users (vwUsers.ID)
29727
+ * * Description: User context under which the job was executed. Typically the OwnerUserID from the schedule, but can be overridden in job-specific configuration.
29728
+ */
29729
+ get ExecutedByUserID(): string | null;
29730
+ set ExecutedByUserID(value: string | null);
29731
+ /**
29732
+ * * Field Name: QueuedAt
29733
+ * * Display Name: Queued At
29734
+ * * SQL Data Type: datetimeoffset
29735
+ * * 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.
29736
+ */
29737
+ get QueuedAt(): Date | null;
29738
+ set QueuedAt(value: Date | null);
29739
+ /**
29740
+ * * Field Name: __mj_CreatedAt
29741
+ * * Display Name: Created At
29742
+ * * SQL Data Type: datetimeoffset
29743
+ * * Default Value: getutcdate()
29744
+ */
29745
+ get __mj_CreatedAt(): Date;
29746
+ /**
29747
+ * * Field Name: __mj_UpdatedAt
29748
+ * * Display Name: Updated At
29749
+ * * SQL Data Type: datetimeoffset
29750
+ * * Default Value: getutcdate()
29751
+ */
29752
+ get __mj_UpdatedAt(): Date;
29753
+ /**
29754
+ * * Field Name: ScheduledJob
29755
+ * * Display Name: Scheduled Job
29756
+ * * SQL Data Type: nvarchar(200)
29757
+ */
29758
+ get ScheduledJob(): string;
29759
+ /**
29760
+ * * Field Name: ExecutedByUser
29761
+ * * Display Name: Executed By User
29762
+ * * SQL Data Type: nvarchar(100)
29763
+ */
29764
+ get ExecutedByUser(): string | null;
29765
+ }
29766
+ /**
29767
+ * MJ: Scheduled Job Types - strongly typed entity sub-class
29768
+ * * Schema: __mj
29769
+ * * Base Table: ScheduledJobType
29770
+ * * Base View: vwScheduledJobTypes
29771
+ * * @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).
29772
+ * * Primary Key: ID
29773
+ * @extends {BaseEntity}
29774
+ * @class
29775
+ * @public
29776
+ */
29777
+ export declare class ScheduledJobTypeEntity extends BaseEntity<ScheduledJobTypeEntityType> {
29778
+ /**
29779
+ * Loads the MJ: Scheduled Job Types record from the database
29780
+ * @param ID: string - primary key value to load the MJ: Scheduled Job Types record.
29781
+ * @param EntityRelationshipsToLoad - (optional) the relationships to load
29782
+ * @returns {Promise<boolean>} - true if successful, false otherwise
29783
+ * @public
29784
+ * @async
29785
+ * @memberof ScheduledJobTypeEntity
29786
+ * @method
29787
+ * @override
29788
+ */
29789
+ Load(ID: string, EntityRelationshipsToLoad?: string[]): Promise<boolean>;
29790
+ /**
29791
+ * * Field Name: ID
29792
+ * * Display Name: ID
29793
+ * * SQL Data Type: uniqueidentifier
29794
+ * * Default Value: newsequentialid()
29795
+ */
29796
+ get ID(): string;
29797
+ set ID(value: string);
29798
+ /**
29799
+ * * Field Name: Name
29800
+ * * Display Name: Name
29801
+ * * SQL Data Type: nvarchar(100)
29802
+ * * Description: Unique name identifying this job type (e.g., Agent, Action, Report).
29803
+ */
29804
+ get Name(): string;
29805
+ set Name(value: string);
29806
+ /**
29807
+ * * Field Name: Description
29808
+ * * Display Name: Description
29809
+ * * SQL Data Type: nvarchar(MAX)
29810
+ * * Description: Human-readable description of what this job type does and when it should be used.
29811
+ */
29812
+ get Description(): string | null;
29813
+ set Description(value: string | null);
29814
+ /**
29815
+ * * Field Name: DriverClass
29816
+ * * Display Name: Driver Class
29817
+ * * SQL Data Type: nvarchar(255)
29818
+ * * Description: TypeScript class name that implements BaseScheduledJob for this job type. Used by ClassFactory to instantiate the correct plugin at runtime.
29819
+ */
29820
+ get DriverClass(): string;
29821
+ set DriverClass(value: string);
29822
+ /**
29823
+ * * Field Name: DomainRunEntity
29824
+ * * Display Name: Domain Run Entity
29825
+ * * SQL Data Type: nvarchar(255)
29826
+ * * 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.
29827
+ */
29828
+ get DomainRunEntity(): string | null;
29829
+ set DomainRunEntity(value: string | null);
29830
+ /**
29831
+ * * Field Name: DomainRunEntityFKey
29832
+ * * Display Name: Domain Run Entity F Key
29833
+ * * SQL Data Type: nvarchar(100)
29834
+ * * 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.
29835
+ */
29836
+ get DomainRunEntityFKey(): string | null;
29837
+ set DomainRunEntityFKey(value: string | null);
29838
+ /**
29839
+ * * Field Name: NotificationsAvailable
29840
+ * * Display Name: Notifications Available
29841
+ * * SQL Data Type: bit
29842
+ * * Default Value: 1
29843
+ * * Description: Indicates whether this job type supports sending notifications on completion or failure.
29844
+ */
29845
+ get NotificationsAvailable(): boolean;
29846
+ set NotificationsAvailable(value: boolean);
29847
+ /**
29848
+ * * Field Name: __mj_CreatedAt
29849
+ * * Display Name: Created At
29850
+ * * SQL Data Type: datetimeoffset
29851
+ * * Default Value: getutcdate()
29852
+ */
29853
+ get __mj_CreatedAt(): Date;
29854
+ /**
29855
+ * * Field Name: __mj_UpdatedAt
29856
+ * * Display Name: Updated At
29857
+ * * SQL Data Type: datetimeoffset
29858
+ * * Default Value: getutcdate()
29859
+ */
29860
+ get __mj_UpdatedAt(): Date;
29861
+ }
29862
+ /**
29863
+ * MJ: Scheduled Jobs - strongly typed entity sub-class
29864
+ * * Schema: __mj
29865
+ * * Base Table: ScheduledJob
29866
+ * * Base View: vwScheduledJobs
29867
+ * * @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.
29868
+ * * Primary Key: ID
29869
+ * @extends {BaseEntity}
29870
+ * @class
29871
+ * @public
29872
+ */
29873
+ export declare class ScheduledJobEntity extends BaseEntity<ScheduledJobEntityType> {
29874
+ /**
29875
+ * Loads the MJ: Scheduled Jobs record from the database
29876
+ * @param ID: string - primary key value to load the MJ: Scheduled Jobs record.
29877
+ * @param EntityRelationshipsToLoad - (optional) the relationships to load
29878
+ * @returns {Promise<boolean>} - true if successful, false otherwise
29879
+ * @public
29880
+ * @async
29881
+ * @memberof ScheduledJobEntity
29882
+ * @method
29883
+ * @override
29884
+ */
29885
+ Load(ID: string, EntityRelationshipsToLoad?: string[]): Promise<boolean>;
29886
+ /**
29887
+ * Validate() method override for MJ: Scheduled Jobs entity. This is an auto-generated method that invokes the generated validators for this entity for the following fields:
29888
+ * * Configuration: This rule ensures that if the Configuration field has a value, it must be valid JSON. If the Configuration field is empty or not set, this rule does not apply.
29889
+ * @public
29890
+ * @method
29891
+ * @override
29892
+ */
29893
+ Validate(): ValidationResult;
29894
+ /**
29895
+ * This rule ensures that if the Configuration field has a value, it must be valid JSON. If the Configuration field is empty or not set, this rule does not apply.
29896
+ * @param result - the ValidationResult object to add any errors or warnings to
29897
+ * @public
29898
+ * @method
29899
+ */
29900
+ ValidateConfigurationIsJson(result: ValidationResult): void;
29901
+ /**
29902
+ * * Field Name: ID
29903
+ * * Display Name: ID
29904
+ * * SQL Data Type: uniqueidentifier
29905
+ * * Default Value: newsequentialid()
29906
+ */
29907
+ get ID(): string;
29908
+ set ID(value: string);
29909
+ /**
29910
+ * * Field Name: JobTypeID
29911
+ * * Display Name: Job Type ID
29912
+ * * SQL Data Type: uniqueidentifier
29913
+ * * Related Entity/Foreign Key: MJ: Scheduled Job Types (vwScheduledJobTypes.ID)
29914
+ */
29915
+ get JobTypeID(): string;
29916
+ set JobTypeID(value: string);
29917
+ /**
29918
+ * * Field Name: Name
29919
+ * * Display Name: Name
29920
+ * * SQL Data Type: nvarchar(200)
29921
+ * * Description: Human-readable name for this scheduled job. Should clearly identify what the job does.
29922
+ */
29923
+ get Name(): string;
29924
+ set Name(value: string);
29925
+ /**
29926
+ * * Field Name: Description
29927
+ * * Display Name: Description
29928
+ * * SQL Data Type: nvarchar(MAX)
29929
+ * * Description: Detailed description of the job's purpose, what it does, and any important notes about its execution.
29930
+ */
29931
+ get Description(): string | null;
29932
+ set Description(value: string | null);
29933
+ /**
29934
+ * * Field Name: CronExpression
29935
+ * * Display Name: Cron Expression
29936
+ * * SQL Data Type: nvarchar(120)
29937
+ * * 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.
29938
+ */
29939
+ get CronExpression(): string;
29940
+ set CronExpression(value: string);
29941
+ /**
29942
+ * * Field Name: Timezone
29943
+ * * Display Name: Timezone
29944
+ * * SQL Data Type: nvarchar(64)
29945
+ * * Default Value: UTC
29946
+ * * Description: IANA timezone identifier for interpreting the cron expression (e.g., "America/Chicago", "UTC"). Ensures consistent scheduling across different server locations.
29947
+ */
29948
+ get Timezone(): string;
29949
+ set Timezone(value: string);
29950
+ /**
29951
+ * * Field Name: StartAt
29952
+ * * Display Name: Start At
29953
+ * * SQL Data Type: datetimeoffset
29954
+ * * Description: Optional start date/time for when this schedule becomes active. Job will not execute before this time. NULL means active immediately upon creation.
29955
+ */
29956
+ get StartAt(): Date | null;
29957
+ set StartAt(value: Date | null);
29958
+ /**
29959
+ * * Field Name: EndAt
29960
+ * * Display Name: End At
29961
+ * * SQL Data Type: datetimeoffset
29962
+ * * Description: Optional end date/time for when this schedule expires. Job will not execute after this time. NULL means no expiration.
29963
+ */
29964
+ get EndAt(): Date | null;
29965
+ set EndAt(value: Date | null);
29966
+ /**
29967
+ * * Field Name: Status
29968
+ * * Display Name: Status
29969
+ * * SQL Data Type: nvarchar(20)
29970
+ * * Default Value: Pending
29971
+ * * Value List Type: List
29972
+ * * Possible Values
29973
+ * * Paused
29974
+ * * Disabled
29975
+ * * Expired
29976
+ * * Pending
29977
+ * * Active
29978
+ * * 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.
29979
+ */
29980
+ get Status(): 'Active' | 'Disabled' | 'Expired' | 'Paused' | 'Pending';
29981
+ set Status(value: 'Active' | 'Disabled' | 'Expired' | 'Paused' | 'Pending');
29982
+ /**
29983
+ * * Field Name: Configuration
29984
+ * * Display Name: Configuration
29985
+ * * SQL Data Type: nvarchar(MAX)
29986
+ * * 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.
29987
+ */
29988
+ get Configuration(): string | null;
29989
+ set Configuration(value: string | null);
29990
+ /**
29991
+ * * Field Name: OwnerUserID
29992
+ * * Display Name: Owner User ID
29993
+ * * SQL Data Type: uniqueidentifier
29994
+ * * Related Entity/Foreign Key: Users (vwUsers.ID)
29995
+ * * Description: User who owns this schedule. Used as the execution context if no specific user is configured in the job-specific configuration.
29996
+ */
29997
+ get OwnerUserID(): string | null;
29998
+ set OwnerUserID(value: string | null);
29999
+ /**
30000
+ * * Field Name: LastRunAt
30001
+ * * Display Name: Last Run At
30002
+ * * SQL Data Type: datetimeoffset
30003
+ * * Description: Timestamp of the most recent execution. Updated after each run. Used for monitoring and dashboard displays.
30004
+ */
30005
+ get LastRunAt(): Date | null;
30006
+ set LastRunAt(value: Date | null);
30007
+ /**
30008
+ * * Field Name: NextRunAt
30009
+ * * Display Name: Next Run At
30010
+ * * SQL Data Type: datetimeoffset
30011
+ * * 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.
30012
+ */
30013
+ get NextRunAt(): Date | null;
30014
+ set NextRunAt(value: Date | null);
30015
+ /**
30016
+ * * Field Name: RunCount
30017
+ * * Display Name: Run Count
30018
+ * * SQL Data Type: int
30019
+ * * Default Value: 0
30020
+ * * Description: Total number of times this schedule has been executed, including both successful and failed runs.
30021
+ */
30022
+ get RunCount(): number;
30023
+ set RunCount(value: number);
30024
+ /**
30025
+ * * Field Name: SuccessCount
30026
+ * * Display Name: Success Count
30027
+ * * SQL Data Type: int
30028
+ * * Default Value: 0
30029
+ * * Description: Number of times this schedule has executed successfully (Success = true in ScheduledJobRun).
30030
+ */
30031
+ get SuccessCount(): number;
30032
+ set SuccessCount(value: number);
30033
+ /**
30034
+ * * Field Name: FailureCount
30035
+ * * Display Name: Failure Count
30036
+ * * SQL Data Type: int
30037
+ * * Default Value: 0
30038
+ * * Description: Number of times this schedule has executed but failed (Success = false in ScheduledJobRun).
30039
+ */
30040
+ get FailureCount(): number;
30041
+ set FailureCount(value: number);
30042
+ /**
30043
+ * * Field Name: NotifyOnSuccess
30044
+ * * Display Name: Notify On Success
30045
+ * * SQL Data Type: bit
30046
+ * * Default Value: 0
30047
+ * * Description: Whether to send notifications when the job completes successfully.
30048
+ */
30049
+ get NotifyOnSuccess(): boolean;
30050
+ set NotifyOnSuccess(value: boolean);
30051
+ /**
30052
+ * * Field Name: NotifyOnFailure
30053
+ * * Display Name: Notify On Failure
30054
+ * * SQL Data Type: bit
30055
+ * * Default Value: 1
30056
+ * * Description: Whether to send notifications when the job fails. Defaults to true for alerting on failures.
30057
+ */
30058
+ get NotifyOnFailure(): boolean;
30059
+ set NotifyOnFailure(value: boolean);
30060
+ /**
30061
+ * * Field Name: NotifyUserID
30062
+ * * Display Name: Notify User ID
30063
+ * * SQL Data Type: uniqueidentifier
30064
+ * * Related Entity/Foreign Key: Users (vwUsers.ID)
30065
+ * * Description: User to notify about job execution results. If NULL and notifications are enabled, falls back to OwnerUserID.
30066
+ */
30067
+ get NotifyUserID(): string | null;
30068
+ set NotifyUserID(value: string | null);
30069
+ /**
30070
+ * * Field Name: NotifyViaEmail
30071
+ * * Display Name: Notify Via Email
30072
+ * * SQL Data Type: bit
30073
+ * * Default Value: 0
30074
+ * * Description: Whether to send email notifications. Requires NotifyOnSuccess or NotifyOnFailure to also be enabled.
30075
+ */
30076
+ get NotifyViaEmail(): boolean;
30077
+ set NotifyViaEmail(value: boolean);
30078
+ /**
30079
+ * * Field Name: NotifyViaInApp
30080
+ * * Display Name: Notify Via In App
30081
+ * * SQL Data Type: bit
30082
+ * * Default Value: 1
30083
+ * * Description: Whether to send in-app notifications. Requires NotifyOnSuccess or NotifyOnFailure to also be enabled. Defaults to true.
30084
+ */
30085
+ get NotifyViaInApp(): boolean;
30086
+ set NotifyViaInApp(value: boolean);
30087
+ /**
30088
+ * * Field Name: LockToken
30089
+ * * Display Name: Lock Token
30090
+ * * SQL Data Type: uniqueidentifier
30091
+ * * 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.
30092
+ */
30093
+ get LockToken(): string | null;
30094
+ set LockToken(value: string | null);
30095
+ /**
30096
+ * * Field Name: LockedAt
30097
+ * * Display Name: Locked At
30098
+ * * SQL Data Type: datetimeoffset
30099
+ * * Description: Timestamp when the lock was acquired. Used with ExpectedCompletionAt to detect stale locks from crashed server instances.
30100
+ */
30101
+ get LockedAt(): Date | null;
30102
+ set LockedAt(value: Date | null);
30103
+ /**
30104
+ * * Field Name: LockedByInstance
30105
+ * * Display Name: Locked By Instance
30106
+ * * SQL Data Type: nvarchar(255)
30107
+ * * 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.
30108
+ */
30109
+ get LockedByInstance(): string | null;
30110
+ set LockedByInstance(value: string | null);
30111
+ /**
30112
+ * * Field Name: ExpectedCompletionAt
30113
+ * * Display Name: Expected Completion At
30114
+ * * SQL Data Type: datetimeoffset
30115
+ * * 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.
30116
+ */
30117
+ get ExpectedCompletionAt(): Date | null;
30118
+ set ExpectedCompletionAt(value: Date | null);
30119
+ /**
30120
+ * * Field Name: ConcurrencyMode
30121
+ * * Display Name: Concurrency Mode
30122
+ * * SQL Data Type: nvarchar(20)
30123
+ * * Default Value: Skip
30124
+ * * Value List Type: List
30125
+ * * Possible Values
30126
+ * * Queue
30127
+ * * Concurrent
30128
+ * * Skip
30129
+ * * 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.
30130
+ */
30131
+ get ConcurrencyMode(): 'Concurrent' | 'Queue' | 'Skip';
30132
+ set ConcurrencyMode(value: 'Concurrent' | 'Queue' | 'Skip');
30133
+ /**
30134
+ * * Field Name: __mj_CreatedAt
30135
+ * * Display Name: Created At
30136
+ * * SQL Data Type: datetimeoffset
30137
+ * * Default Value: getutcdate()
30138
+ */
30139
+ get __mj_CreatedAt(): Date;
30140
+ /**
30141
+ * * Field Name: __mj_UpdatedAt
30142
+ * * Display Name: Updated At
30143
+ * * SQL Data Type: datetimeoffset
30144
+ * * Default Value: getutcdate()
30145
+ */
30146
+ get __mj_UpdatedAt(): Date;
30147
+ /**
30148
+ * * Field Name: JobType
30149
+ * * Display Name: Job Type
30150
+ * * SQL Data Type: nvarchar(100)
30151
+ */
30152
+ get JobType(): string;
30153
+ /**
30154
+ * * Field Name: OwnerUser
30155
+ * * Display Name: Owner User
30156
+ * * SQL Data Type: nvarchar(100)
30157
+ */
30158
+ get OwnerUser(): string | null;
30159
+ /**
30160
+ * * Field Name: NotifyUser
30161
+ * * Display Name: Notify User
30162
+ * * SQL Data Type: nvarchar(100)
30163
+ */
30164
+ get NotifyUser(): string | null;
30165
+ }
29401
30166
  /**
29402
30167
  * MJ: Task Dependencies - strongly typed entity sub-class
29403
30168
  * * Schema: __mj