@memberjunction/core-entities 5.51.0 → 6.1.0-edge.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.
@@ -307,7 +307,7 @@ export const MJActionExecutionLogSchema = z.object({
307
307
  * * Field Name: Params
308
308
  * * Display Name: Params
309
309
  * * SQL Data Type: nvarchar(MAX)
310
- * * Description: JSON-formatted input parameters passed to the action during execution, storing the exact values used for this specific run.`),
310
+ * * Description: JSON-formatted input parameters AS THE ACTION WAS CALLED, captured once when execution starts and never overwritten. Custom and Generated actions mutate their parameter array in place, so this is the only durable record of the values actually passed in; the final state lives in ResultParams. Parameter values may be redacted per ActionParam.LogValue / EntityActionParam.LogValue, and whole-record value types are never written - see the parameter's own documentation.`),
311
311
  ResultCode: z.string().nullable().describe(`
312
312
  * * Field Name: ResultCode
313
313
  * * Display Name: Result Code
@@ -337,7 +337,35 @@ export const MJActionExecutionLogSchema = z.object({
337
337
  * * Field Name: Message
338
338
  * * Display Name: Message
339
339
  * * SQL Data Type: nvarchar(MAX)
340
- * * Description: JSON-formatted output data or response from the action execution`),
340
+ * * Description: Human-readable summary message returned by the action - the reason for a refusal, or a short description of what was done. Not the action's output data: parameter values live in Params and ResultParams, and the outcome code in ResultCode.`),
341
+ EntityActionID: z.string().nullable().describe(`
342
+ * * Field Name: EntityActionID
343
+ * * Display Name: Entity Action ID
344
+ * * SQL Data Type: uniqueidentifier
345
+ * * Related Entity/Foreign Key: MJ: Entity Actions (vwEntityActions.ID)
346
+ * * Description: Optional. The Entity Action binding that caused this run. NULL when the action was invoked directly - from a resolver, a script, an agent step or a scheduled action.`),
347
+ EntityActionInvocationTypeID: z.string().nullable().describe(`
348
+ * * Field Name: EntityActionInvocationTypeID
349
+ * * Display Name: Entity Action Invocation Type ID
350
+ * * SQL Data Type: uniqueidentifier
351
+ * * Related Entity/Foreign Key: MJ: Entity Action Invocation Types (vwEntityActionInvocationTypes.ID)
352
+ * * Description: Optional. Which lifecycle event fired the binding - AfterUpdate, Validate, List and so on. Recorded separately from EntityActionID because one binding may be attached to several invocation types, and telling a Validate refusal apart from an AfterUpdate side effect is the first question anyone asks of this log.`),
353
+ TargetEntityID: z.string().nullable().describe(`
354
+ * * Field Name: TargetEntityID
355
+ * * Display Name: Target Entity ID
356
+ * * SQL Data Type: uniqueidentifier
357
+ * * Related Entity/Foreign Key: MJ: Entities (vwEntities.ID)
358
+ * * Description: Optional. The entity of the record this run operated on. Deliberately denormalized rather than joined through EntityActionID: it survives the binding being deleted or retargeted, and it lets the log be queried by record with no join. Kept generic because every invoker has a subject - not only Entity Actions.`),
359
+ TargetRecordID: z.string().nullable().describe(`
360
+ * * Field Name: TargetRecordID
361
+ * * Display Name: Target Record ID
362
+ * * SQL Data Type: nvarchar(450)
363
+ * * Description: Optional. The primary key of the record this run operated on, as text, paired with TargetEntityID. For multi-record invocation types (List, View) one log row is written per record, so this is always a single record.`),
364
+ ResultParams: z.string().nullable().describe(`
365
+ * * Field Name: ResultParams
366
+ * * Display Name: Result Params
367
+ * * SQL Data Type: nvarchar(MAX)
368
+ * * Description: JSON-formatted FINAL parameter set captured when the action finished - the inputs as the action left them, plus any output parameters it produced. Written on FAILURE exactly as on success, under the same redaction rules: a failed run's partially-mutated inputs are usually the most diagnostic thing available, and an audit trail that records only successes is not an audit trail. Distinct from Params, which holds the values the action was called with and is never overwritten. NULL means one thing only - the run never finished (process died, host killed) - so it is a signal rather than an absence, and must not be backfilled.`),
341
369
  Action: z.string().describe(`
342
370
  * * Field Name: Action
343
371
  * * Display Name: Action
@@ -346,6 +374,18 @@ export const MJActionExecutionLogSchema = z.object({
346
374
  * * Field Name: User
347
375
  * * Display Name: User
348
376
  * * SQL Data Type: nvarchar(100)`),
377
+ EntityAction: z.string().nullable().describe(`
378
+ * * Field Name: EntityAction
379
+ * * Display Name: Entity Action
380
+ * * SQL Data Type: nvarchar(425)`),
381
+ EntityActionInvocationType: z.string().nullable().describe(`
382
+ * * Field Name: EntityActionInvocationType
383
+ * * Display Name: Entity Action Invocation Type
384
+ * * SQL Data Type: nvarchar(255)`),
385
+ TargetEntity: z.string().nullable().describe(`
386
+ * * Field Name: TargetEntity
387
+ * * Display Name: Target Entity
388
+ * * SQL Data Type: nvarchar(255)`),
349
389
  });
350
390
  /**
351
391
  * zod schema definition for the entity MJ: Action Filters
@@ -515,6 +555,12 @@ export const MJActionParamSchema = z.object({
515
555
  * * Image
516
556
  * * Video
517
557
  * * Description: Specifies the type of media this parameter outputs when ValueType is MediaOutput. Used for action discovery and validation.`),
558
+ LogValue: z.boolean().describe(`
559
+ * * Field Name: LogValue
560
+ * * Display Name: Log Value
561
+ * * SQL Data Type: bit
562
+ * * Default Value: 1
563
+ * * Description: Whether this parameter's VALUE may be written to ActionExecutionLog.Params. Default 1. Set to 0 for parameters that carry records, credentials or personal data - for example the Data payload of Execute Agent. Independent of the hard rule that Entity Action params of ValueType 'Entity Object' or 'Entity Object Data' are never logged regardless of this flag. When logging is suppressed the log records the parameter name, its type and a redaction marker, never the value.`),
518
564
  Action: z.string().describe(`
519
565
  * * Field Name: Action
520
566
  * * Display Name: Action
@@ -7942,6 +7988,12 @@ export const MJAPIApplicationScopeSchema = z.object({
7942
7988
  * * Display Name: Updated At
7943
7989
  * * SQL Data Type: datetimeoffset
7944
7990
  * * Default Value: getutcdate()`),
7991
+ RowFilterID: z.string().nullable().describe(`
7992
+ * * Field Name: RowFilterID
7993
+ * * Display Name: Row Filter ID
7994
+ * * SQL Data Type: uniqueidentifier
7995
+ * * Related Entity/Foreign Key: MJ: Row Level Security Filters (vwRowLevelSecurityFilters.ID)
7996
+ * * Description: Optional row-level filter acting as a CEILING for every API key operating under this application — a restriction keys inherit and cannot widen. Composes with the per-key filter (APIKeyScope.RowFilterID) and with role-based RLS using AND, never OR, so no layer can broaden another. References the same RowLevelSecurityFilter catalog used by role-based RLS. NULL (the default) means the application imposes no row ceiling. The same authoring constraints as APIKeyScope.RowFilterID apply: exact single-entity resource pattern, all referenced columns must exist on that entity, and all referrers of the filter record must resolve to the same entity.`),
7945
7997
  Application: z.string().describe(`
7946
7998
  * * Field Name: Application
7947
7999
  * * Display Name: Application Name
@@ -7950,6 +8002,10 @@ export const MJAPIApplicationScopeSchema = z.object({
7950
8002
  * * Field Name: Scope
7951
8003
  * * Display Name: Scope Name
7952
8004
  * * SQL Data Type: nvarchar(100)`),
8005
+ RowFilter: z.string().nullable().describe(`
8006
+ * * Field Name: RowFilter
8007
+ * * Display Name: Row Filter
8008
+ * * SQL Data Type: nvarchar(100)`),
7953
8009
  });
7954
8010
  /**
7955
8011
  * zod schema definition for the entity MJ: API Applications
@@ -8083,6 +8139,12 @@ export const MJAPIKeyScopeSchema = z.object({
8083
8139
  * * SQL Data Type: int
8084
8140
  * * Default Value: 0
8085
8141
  * * Description: Rule evaluation order. Higher priority rules are evaluated first. Within same priority, deny rules are evaluated before allow rules.`),
8142
+ RowFilterID: z.string().nullable().describe(`
8143
+ * * Field Name: RowFilterID
8144
+ * * Display Name: Row Filter ID
8145
+ * * SQL Data Type: uniqueidentifier
8146
+ * * Related Entity/Foreign Key: MJ: Row Level Security Filters (vwRowLevelSecurityFilters.ID)
8147
+ * * Description: Optional row-level filter narrowing WHICH RECORDS this scope grant applies to, in addition to the resource pattern that governs which entities. References the same RowLevelSecurityFilter catalog used by role-based RLS, so the filter text flows through the standard {{Token}} substitution engine and every existing RLS enforcement point (RunView, Load by primary key, save, delete, search). NULL (the default) means no row restriction — behavior identical to before this column existed. When set, the rule's ResourcePattern must name a single exact entity (no wildcards, no comma-separated lists), every column the filter references must resolve to a real non-virtual field on that entity, and every other referrer of the same filter record must resolve to that same entity. Critically, this filter is evaluated INDEPENDENTLY of the role-RLS exemption: a user exempt from role RLS is still bound by their key's filter, because narrowing a principal below what their roles allow is the entire purpose of a key ceiling.`),
8086
8148
  APIKey: z.string().describe(`
8087
8149
  * * Field Name: APIKey
8088
8150
  * * Display Name: API Key
@@ -8091,6 +8153,10 @@ export const MJAPIKeyScopeSchema = z.object({
8091
8153
  * * Field Name: Scope
8092
8154
  * * Display Name: Scope
8093
8155
  * * SQL Data Type: nvarchar(100)`),
8156
+ RowFilter: z.string().nullable().describe(`
8157
+ * * Field Name: RowFilter
8158
+ * * Display Name: Row Filter
8159
+ * * SQL Data Type: nvarchar(100)`),
8094
8160
  });
8095
8161
  /**
8096
8162
  * zod schema definition for the entity MJ: API Key Usage Logs
@@ -11799,12 +11865,12 @@ export const MJContentItemChunkSchema = z.object({
11799
11865
  * * Description: Exclusive character offset where this chunk ends within the parent Content Item's extracted text. See StartOffset. NULL for media segments.`),
11800
11866
  StartMs: z.number().nullable().describe(`
11801
11867
  * * Field Name: StartMs
11802
- * * Display Name: Start (ms)
11868
+ * * Display Name: Start Milliseconds
11803
11869
  * * SQL Data Type: int
11804
11870
  * * Description: Start of this chunk's time window, in milliseconds from the beginning of the parent audio or video asset. Set by transcript- or window-based segmentation; enables time-windowed playback deep-links from a search result (for example 14:22-15:05 of a session recording). NULL for text segments.`),
11805
11871
  EndMs: z.number().nullable().describe(`
11806
11872
  * * Field Name: EndMs
11807
- * * Display Name: End (ms)
11873
+ * * Display Name: End Milliseconds
11808
11874
  * * SQL Data Type: int
11809
11875
  * * Description: End of this chunk's time window, in milliseconds from the beginning of the parent audio or video asset. See StartMs. NULL for text segments.`),
11810
11876
  PageNumber: z.number().nullable().describe(`
@@ -11840,8 +11906,12 @@ export const MJContentItemChunkSchema = z.object({
11840
11906
  * * Description: Optional self-reference to another chunk of the same Content Item that is the parent of this one, expressing a chapter to sub-chapter hierarchy — for example a five-minute chapter of a recording and the individual speaker turns within it, or a document section and its subsections. NULL for top-level segments.`),
11841
11907
  ContentItem: z.string().nullable().describe(`
11842
11908
  * * Field Name: ContentItem
11843
- * * Display Name: Content Item
11909
+ * * Display Name: Content Item Name
11844
11910
  * * SQL Data Type: nvarchar(250)`),
11911
+ ParentChunk: z.string().nullable().describe(`
11912
+ * * Field Name: ParentChunk
11913
+ * * Display Name: Parent Chunk Name
11914
+ * * SQL Data Type: nvarchar(500)`),
11845
11915
  RootParentChunkID: z.string().nullable().describe(`
11846
11916
  * * Field Name: RootParentChunkID
11847
11917
  * * Display Name: Root Parent Chunk
@@ -15953,7 +16023,7 @@ export const MJEntitySchema = z.object({
15953
16023
  * * Description: When set to 1 AND TrackRecordChanges is also 1, the external change detection system will scan this entity for changes made outside the MJ framework (direct SQL, third-party tools, etc.) and replay them through Save() to create proper RecordChange audit entries. Default is 0 (opt-out) because most entities, especially __mj schema metadata tables, are managed by migrations/CodeGen and should not be scanned.`),
15954
16024
  ExternalDataSourceID: z.string().nullable().describe(`
15955
16025
  * * Field Name: ExternalDataSourceID
15956
- * * Display Name: External Data Source ID
16026
+ * * Display Name: External Data Source
15957
16027
  * * SQL Data Type: uniqueidentifier
15958
16028
  * * Related Entity/Foreign Key: MJ: External Data Sources (vwExternalDataSources.ID)`),
15959
16029
  ExternalObjectName: z.string().nullable().describe(`
@@ -15961,6 +16031,29 @@ export const MJEntitySchema = z.object({
15961
16031
  * * Display Name: External Object Name
15962
16032
  * * SQL Data Type: nvarchar(255)
15963
16033
  * * Description: Remote object name (table / view / collection) on the external system that backs this entity. Resolved against the data source DefaultSchema/DefaultDatabase when unqualified. Only meaningful when ExternalDataSourceID is set.`),
16034
+ GeneratedBaseViewName: z.string().nullable().describe(`
16035
+ * * Field Name: GeneratedBaseViewName
16036
+ * * Display Name: Generated Base View Name
16037
+ * * SQL Data Type: nvarchar(255)
16038
+ * * Description: When set, CodeGen generates the entity's full base view under THIS name instead of BaseView, and the application owns BaseView — which is expected to wrap it (SELECT g.*, <extras> FROM <GeneratedBaseViewName> g). This gives an entity a custom base view WITHOUT inheriting the generated SQL: related-entity display joins, geo columns and recursive root-ID columns keep regenerating underneath, so a foreign key added later still appears. NULL (the default, and every pre-existing row) means the previous all-or-nothing behaviour: BaseViewGenerated alone decides whether CodeGen writes BaseView, and there is no second view. BaseView remains the public surface — entity field discovery, permissions and the generated CRUD procedures all target it. SQL SERVER ONLY: layering relies on sp_refreshview to re-resolve the application-owned outer view's SELECT * against a regenerated inner view. PostgreSQL freezes a view's column list at creation and has no refresh equivalent, so CodeGen rejects this column on PostgreSQL rather than let the outer view go silently stale.`),
16039
+ AllowDirectSQLInsert: z.boolean().describe(`
16040
+ * * Field Name: AllowDirectSQLInsert
16041
+ * * Display Name: Allow Direct SQL Insert
16042
+ * * SQL Data Type: bit
16043
+ * * Default Value: 0
16044
+ * * Description: When 1, this entity may be populated by INSERT statements that do not go through BaseEntity.Save() — bulk loads, ETL/integration sync, or rows created as a side effect of a stored procedure. Default 0, meaning every insert is expected to flow through BaseEntity so that record-change tracking, entity actions, validation and cache invalidation all run. This column DECLARES intent for the code paths and tooling that consult it; it does not and cannot prevent anyone from executing SQL. Requires TrackRecordChanges = 0 and TrustServerCacheCompletely = 0, because a direct insert produces neither an audit row nor a cache-invalidation event.`),
16045
+ AllowDirectSQLUpdate: z.boolean().describe(`
16046
+ * * Field Name: AllowDirectSQLUpdate
16047
+ * * Display Name: Allow Direct SQL Update
16048
+ * * SQL Data Type: bit
16049
+ * * Default Value: 0
16050
+ * * Description: When 1, this entity may be modified by UPDATE statements that do not go through BaseEntity.Save() — bulk backfills, integration sync, or maintenance routines. Default 0, meaning every update is expected to flow through BaseEntity so that record-change tracking, entity actions, validation and cache invalidation all run. This column DECLARES intent for the code paths and tooling that consult it; it does not and cannot prevent anyone from executing SQL. Requires TrackRecordChanges = 0 and TrustServerCacheCompletely = 0, because a direct update produces neither an audit row nor a cache-invalidation event.`),
16051
+ AllowDirectSQLDelete: z.boolean().describe(`
16052
+ * * Field Name: AllowDirectSQLDelete
16053
+ * * Display Name: Allow Direct SQL Delete
16054
+ * * SQL Data Type: bit
16055
+ * * Default Value: 0
16056
+ * * Description: When 1, this entity may have rows removed by DELETE statements that do not go through BaseEntity.Delete() — purge and retention routines, or integration sync reconciling a remote source. Default 0, meaning every delete is expected to flow through BaseEntity so that record-change tracking, entity actions, cascade handling and cache invalidation all run. This column DECLARES intent for the code paths and tooling that consult it; it does not and cannot prevent anyone from executing SQL. Requires TrackRecordChanges = 0 and TrustServerCacheCompletely = 0, and additionally requires DeleteType = 'Hard' — a direct DELETE removes the row outright rather than setting DeletedAt, which would defeat soft delete.`),
15964
16057
  CodeName: z.string().nullable().describe(`
15965
16058
  * * Field Name: CodeName
15966
16059
  * * Display Name: Code Name
@@ -16155,7 +16248,7 @@ export const MJEntityActionParamSchema = z.object({
16155
16248
  * * Display Name: Action Parameter ID
16156
16249
  * * SQL Data Type: uniqueidentifier
16157
16250
  * * Related Entity/Foreign Key: MJ: Action Params (vwActionParams.ID)`),
16158
- ValueType: z.union([z.literal('Entity Field'), z.literal('Entity Object'), z.literal('Script'), z.literal('Static')]).describe(`
16251
+ ValueType: z.union([z.literal('Entity Field'), z.literal('Entity Object'), z.literal('Entity Object Data'), z.literal('Script'), z.literal('Static')]).describe(`
16159
16252
  * * Field Name: ValueType
16160
16253
  * * Display Name: Value Type
16161
16254
  * * SQL Data Type: nvarchar(20)
@@ -16163,9 +16256,10 @@ export const MJEntityActionParamSchema = z.object({
16163
16256
  * * Possible Values
16164
16257
  * * Entity Field
16165
16258
  * * Entity Object
16259
+ * * Entity Object Data
16166
16260
  * * Script
16167
16261
  * * Static
16168
- * * Description: Type of the value, which can be Static, Entity Object, or Script.`),
16262
+ * * Description: How the parameter value is produced at invocation time. Static = the literal Value (parsed as JSON when it parses). Entity Object = the live BaseEntity instance, for actions that call entity methods. Entity Object Data = entity.GetAll(), a plain object - use this for any action that SERIALIZES the value, such as the Data payload of Execute Agent, because a BaseEntity serializes to {} (its fields are getters, not enumerable own properties). Entity Field = the named field's value. Script = evaluated expression with the entity in scope.`),
16169
16263
  Value: z.string().nullable().describe(`
16170
16264
  * * Field Name: Value
16171
16265
  * * Display Name: Value
@@ -16186,6 +16280,11 @@ export const MJEntityActionParamSchema = z.object({
16186
16280
  * * Display Name: Updated At
16187
16281
  * * SQL Data Type: datetimeoffset
16188
16282
  * * Default Value: getutcdate()`),
16283
+ LogValue: z.boolean().nullable().describe(`
16284
+ * * Field Name: LogValue
16285
+ * * Display Name: Log Value
16286
+ * * SQL Data Type: bit
16287
+ * * Description: Optional per-binding override of ActionParam.LogValue. NULL (the default) inherits the parameter definition. Set to 0 when this particular binding passes something sensitive through a parameter that is ordinarily safe to log - a message body through a generic Text parameter, for instance. Cannot re-enable logging for a value type the hard rule suppresses.`),
16189
16288
  EntityAction: z.string().describe(`
16190
16289
  * * Field Name: EntityAction
16191
16290
  * * Display Name: Entity Action
@@ -16235,6 +16334,34 @@ export const MJEntityActionSchema = z.object({
16235
16334
  * * Display Name: ID
16236
16335
  * * SQL Data Type: uniqueidentifier
16237
16336
  * * Default Value: newsequentialid()`),
16337
+ Sequence: z.number().describe(`
16338
+ * * Field Name: Sequence
16339
+ * * Display Name: Sequence
16340
+ * * SQL Data Type: int
16341
+ * * Default Value: 0
16342
+ * * Description: Execution order when multiple Entity Actions are bound to the same entity and invocation type. Lower runs first; ties fall back to creation order. Defaults to 0 so existing rows are unaffected.`),
16343
+ ScopeEntityID: z.string().nullable().describe(`
16344
+ * * Field Name: ScopeEntityID
16345
+ * * Display Name: Scope Entity ID
16346
+ * * SQL Data Type: uniqueidentifier
16347
+ * * Related Entity/Foreign Key: MJ: Entities (vwEntities.ID)
16348
+ * * Description: Optional. Together with ScopeRecordID, narrows this Entity Action to records related to ONE specific record - for example a single Deal Type, Contract Type, Pipeline or Company - rather than every record of EntityID. NULL (the default) means the action applies to all records, which is the pre-existing behaviour. How a scope record relates to the subject record is resolved by the app that owns the scope entity; the framework only stores and filters on the pair.`),
16349
+ ScopeRecordID: z.string().nullable().describe(`
16350
+ * * Field Name: ScopeRecordID
16351
+ * * Display Name: Scope Record ID
16352
+ * * SQL Data Type: nvarchar(450)
16353
+ * * Description: Optional. The primary key of the scope record, as text, paired with ScopeEntityID. Both columns are NULL or both are set (CK_EntityAction_Scope). Lets a configuration record such as a Deal Type surface "the workflows bound to me" as a real relationship rather than something buried in filter code.`),
16354
+ LoggingMode: z.union([z.literal('All'), z.literal('FailuresOnly'), z.literal('None')]).describe(`
16355
+ * * Field Name: LoggingMode
16356
+ * * Display Name: Logging Mode
16357
+ * * SQL Data Type: nvarchar(20)
16358
+ * * Default Value: All
16359
+ * * Value List Type: List
16360
+ * * Possible Values
16361
+ * * All
16362
+ * * FailuresOnly
16363
+ * * None
16364
+ * * Description: How much of this binding's activity reaches ActionExecutionLog. All (default) writes a row per invocation. FailuresOnly writes only runs that did not succeed - the right setting for a high-frequency binding on a busy entity, where the successful runs are noise. None disables logging for the binding entirely and should be rare, because it also removes the failure record.`),
16238
16365
  Entity: z.string().describe(`
16239
16366
  * * Field Name: Entity
16240
16367
  * * Display Name: Entity
@@ -16243,6 +16370,10 @@ export const MJEntityActionSchema = z.object({
16243
16370
  * * Field Name: Action
16244
16371
  * * Display Name: Action
16245
16372
  * * SQL Data Type: nvarchar(425)`),
16373
+ ScopeEntity: z.string().nullable().describe(`
16374
+ * * Field Name: ScopeEntity
16375
+ * * Display Name: Scope Entity
16376
+ * * SQL Data Type: nvarchar(255)`),
16246
16377
  });
16247
16378
  /**
16248
16379
  * zod schema definition for the entity MJ: Entity AI Actions
@@ -30872,11 +31003,12 @@ export const MJUserViewCategorySchema = z.object({
30872
31003
  export const MJUserViewRunDetailSchema = z.object({
30873
31004
  ID: z.string().describe(`
30874
31005
  * * Field Name: ID
31006
+ * * Display Name: ID
30875
31007
  * * SQL Data Type: uniqueidentifier
30876
31008
  * * Default Value: newsequentialid()`),
30877
31009
  UserViewRunID: z.string().describe(`
30878
31010
  * * Field Name: UserViewRunID
30879
- * * Display Name: User View Run ID
31011
+ * * Display Name: User View Run
30880
31012
  * * SQL Data Type: uniqueidentifier
30881
31013
  * * Related Entity/Foreign Key: MJ: User View Runs (vwUserViewRuns.ID)`),
30882
31014
  RecordID: z.string().describe(`
@@ -30894,6 +31026,10 @@ export const MJUserViewRunDetailSchema = z.object({
30894
31026
  * * Display Name: Updated At
30895
31027
  * * SQL Data Type: datetimeoffset
30896
31028
  * * Default Value: getutcdate()`),
31029
+ UserViewRun: z.string().describe(`
31030
+ * * Field Name: UserViewRun
31031
+ * * Display Name: User View Run Name
31032
+ * * SQL Data Type: nvarchar(100)`),
30897
31033
  UserViewID: z.string().describe(`
30898
31034
  * * Field Name: UserViewID
30899
31035
  * * Display Name: User View
@@ -32762,7 +32898,7 @@ let MJActionExecutionLogEntity = class MJActionExecutionLogEntity extends BaseEn
32762
32898
  * * Field Name: Params
32763
32899
  * * Display Name: Params
32764
32900
  * * SQL Data Type: nvarchar(MAX)
32765
- * * Description: JSON-formatted input parameters passed to the action during execution, storing the exact values used for this specific run.
32901
+ * * Description: JSON-formatted input parameters AS THE ACTION WAS CALLED, captured once when execution starts and never overwritten. Custom and Generated actions mutate their parameter array in place, so this is the only durable record of the values actually passed in; the final state lives in ResultParams. Parameter values may be redacted per ActionParam.LogValue / EntityActionParam.LogValue, and whole-record value types are never written - see the parameter's own documentation.
32766
32902
  */
32767
32903
  get Params() {
32768
32904
  return this.Get('Params');
@@ -32828,7 +32964,7 @@ let MJActionExecutionLogEntity = class MJActionExecutionLogEntity extends BaseEn
32828
32964
  * * Field Name: Message
32829
32965
  * * Display Name: Message
32830
32966
  * * SQL Data Type: nvarchar(MAX)
32831
- * * Description: JSON-formatted output data or response from the action execution
32967
+ * * Description: Human-readable summary message returned by the action - the reason for a refusal, or a short description of what was done. Not the action's output data: parameter values live in Params and ResultParams, and the outcome code in ResultCode.
32832
32968
  */
32833
32969
  get Message() {
32834
32970
  return this.Get('Message');
@@ -32837,6 +32973,69 @@ let MJActionExecutionLogEntity = class MJActionExecutionLogEntity extends BaseEn
32837
32973
  this.Set('Message', value);
32838
32974
  }
32839
32975
  /**
32976
+ * * Field Name: EntityActionID
32977
+ * * Display Name: Entity Action ID
32978
+ * * SQL Data Type: uniqueidentifier
32979
+ * * Related Entity/Foreign Key: MJ: Entity Actions (vwEntityActions.ID)
32980
+ * * Description: Optional. The Entity Action binding that caused this run. NULL when the action was invoked directly - from a resolver, a script, an agent step or a scheduled action.
32981
+ */
32982
+ get EntityActionID() {
32983
+ return this.Get('EntityActionID');
32984
+ }
32985
+ set EntityActionID(value) {
32986
+ this.Set('EntityActionID', value);
32987
+ }
32988
+ /**
32989
+ * * Field Name: EntityActionInvocationTypeID
32990
+ * * Display Name: Entity Action Invocation Type ID
32991
+ * * SQL Data Type: uniqueidentifier
32992
+ * * Related Entity/Foreign Key: MJ: Entity Action Invocation Types (vwEntityActionInvocationTypes.ID)
32993
+ * * Description: Optional. Which lifecycle event fired the binding - AfterUpdate, Validate, List and so on. Recorded separately from EntityActionID because one binding may be attached to several invocation types, and telling a Validate refusal apart from an AfterUpdate side effect is the first question anyone asks of this log.
32994
+ */
32995
+ get EntityActionInvocationTypeID() {
32996
+ return this.Get('EntityActionInvocationTypeID');
32997
+ }
32998
+ set EntityActionInvocationTypeID(value) {
32999
+ this.Set('EntityActionInvocationTypeID', value);
33000
+ }
33001
+ /**
33002
+ * * Field Name: TargetEntityID
33003
+ * * Display Name: Target Entity ID
33004
+ * * SQL Data Type: uniqueidentifier
33005
+ * * Related Entity/Foreign Key: MJ: Entities (vwEntities.ID)
33006
+ * * Description: Optional. The entity of the record this run operated on. Deliberately denormalized rather than joined through EntityActionID: it survives the binding being deleted or retargeted, and it lets the log be queried by record with no join. Kept generic because every invoker has a subject - not only Entity Actions.
33007
+ */
33008
+ get TargetEntityID() {
33009
+ return this.Get('TargetEntityID');
33010
+ }
33011
+ set TargetEntityID(value) {
33012
+ this.Set('TargetEntityID', value);
33013
+ }
33014
+ /**
33015
+ * * Field Name: TargetRecordID
33016
+ * * Display Name: Target Record ID
33017
+ * * SQL Data Type: nvarchar(450)
33018
+ * * Description: Optional. The primary key of the record this run operated on, as text, paired with TargetEntityID. For multi-record invocation types (List, View) one log row is written per record, so this is always a single record.
33019
+ */
33020
+ get TargetRecordID() {
33021
+ return this.Get('TargetRecordID');
33022
+ }
33023
+ set TargetRecordID(value) {
33024
+ this.Set('TargetRecordID', value);
33025
+ }
33026
+ /**
33027
+ * * Field Name: ResultParams
33028
+ * * Display Name: Result Params
33029
+ * * SQL Data Type: nvarchar(MAX)
33030
+ * * Description: JSON-formatted FINAL parameter set captured when the action finished - the inputs as the action left them, plus any output parameters it produced. Written on FAILURE exactly as on success, under the same redaction rules: a failed run's partially-mutated inputs are usually the most diagnostic thing available, and an audit trail that records only successes is not an audit trail. Distinct from Params, which holds the values the action was called with and is never overwritten. NULL means one thing only - the run never finished (process died, host killed) - so it is a signal rather than an absence, and must not be backfilled.
33031
+ */
33032
+ get ResultParams() {
33033
+ return this.Get('ResultParams');
33034
+ }
33035
+ set ResultParams(value) {
33036
+ this.Set('ResultParams', value);
33037
+ }
33038
+ /**
32840
33039
  * * Field Name: Action
32841
33040
  * * Display Name: Action
32842
33041
  * * SQL Data Type: nvarchar(425)
@@ -32852,6 +33051,30 @@ let MJActionExecutionLogEntity = class MJActionExecutionLogEntity extends BaseEn
32852
33051
  get User() {
32853
33052
  return this.Get('User');
32854
33053
  }
33054
+ /**
33055
+ * * Field Name: EntityAction
33056
+ * * Display Name: Entity Action
33057
+ * * SQL Data Type: nvarchar(425)
33058
+ */
33059
+ get EntityAction() {
33060
+ return this.Get('EntityAction');
33061
+ }
33062
+ /**
33063
+ * * Field Name: EntityActionInvocationType
33064
+ * * Display Name: Entity Action Invocation Type
33065
+ * * SQL Data Type: nvarchar(255)
33066
+ */
33067
+ get EntityActionInvocationType() {
33068
+ return this.Get('EntityActionInvocationType');
33069
+ }
33070
+ /**
33071
+ * * Field Name: TargetEntity
33072
+ * * Display Name: Target Entity
33073
+ * * SQL Data Type: nvarchar(255)
33074
+ */
33075
+ get TargetEntity() {
33076
+ return this.Get('TargetEntity');
33077
+ }
32855
33078
  };
32856
33079
  MJActionExecutionLogEntity = __decorate([
32857
33080
  RegisterClass(BaseEntity, 'MJ: Action Execution Logs')
@@ -33271,6 +33494,19 @@ let MJActionParamEntity = class MJActionParamEntity extends BaseEntity {
33271
33494
  this.Set('MediaModality', value);
33272
33495
  }
33273
33496
  /**
33497
+ * * Field Name: LogValue
33498
+ * * Display Name: Log Value
33499
+ * * SQL Data Type: bit
33500
+ * * Default Value: 1
33501
+ * * Description: Whether this parameter's VALUE may be written to ActionExecutionLog.Params. Default 1. Set to 0 for parameters that carry records, credentials or personal data - for example the Data payload of Execute Agent. Independent of the hard rule that Entity Action params of ValueType 'Entity Object' or 'Entity Object Data' are never logged regardless of this flag. When logging is suppressed the log records the parameter name, its type and a redaction marker, never the value.
33502
+ */
33503
+ get LogValue() {
33504
+ return this.Get('LogValue');
33505
+ }
33506
+ set LogValue(value) {
33507
+ this.Set('LogValue', value);
33508
+ }
33509
+ /**
33274
33510
  * * Field Name: Action
33275
33511
  * * Display Name: Action
33276
33512
  * * SQL Data Type: nvarchar(425)
@@ -42113,7 +42349,7 @@ let MJAIAgentTypeEntity = class MJAIAgentTypeEntity extends BaseEntity {
42113
42349
  * @method
42114
42350
  */
42115
42351
  ValidateCompactionTriggerPercentRange(result) {
42116
- if (this.CompactionTriggerPercent != null && (this.CompactionTriggerPercent < 1 || this.CompactionTriggerPercent > 100)) {
42352
+ if (this.CompactionTriggerPercent < 1 || this.CompactionTriggerPercent > 100) {
42117
42353
  result.Errors.push(new ValidationErrorInfo("CompactionTriggerPercent", "Compaction trigger percentage must be between 1 and 100.", this.CompactionTriggerPercent, ValidationErrorType.Failure));
42118
42354
  }
42119
42355
  }
@@ -52265,6 +52501,19 @@ let MJAPIApplicationScopeEntity = class MJAPIApplicationScopeEntity extends Base
52265
52501
  return this.Get('__mj_UpdatedAt');
52266
52502
  }
52267
52503
  /**
52504
+ * * Field Name: RowFilterID
52505
+ * * Display Name: Row Filter ID
52506
+ * * SQL Data Type: uniqueidentifier
52507
+ * * Related Entity/Foreign Key: MJ: Row Level Security Filters (vwRowLevelSecurityFilters.ID)
52508
+ * * Description: Optional row-level filter acting as a CEILING for every API key operating under this application — a restriction keys inherit and cannot widen. Composes with the per-key filter (APIKeyScope.RowFilterID) and with role-based RLS using AND, never OR, so no layer can broaden another. References the same RowLevelSecurityFilter catalog used by role-based RLS. NULL (the default) means the application imposes no row ceiling. The same authoring constraints as APIKeyScope.RowFilterID apply: exact single-entity resource pattern, all referenced columns must exist on that entity, and all referrers of the filter record must resolve to the same entity.
52509
+ */
52510
+ get RowFilterID() {
52511
+ return this.Get('RowFilterID');
52512
+ }
52513
+ set RowFilterID(value) {
52514
+ this.Set('RowFilterID', value);
52515
+ }
52516
+ /**
52268
52517
  * * Field Name: Application
52269
52518
  * * Display Name: Application Name
52270
52519
  * * SQL Data Type: nvarchar(100)
@@ -52280,6 +52529,14 @@ let MJAPIApplicationScopeEntity = class MJAPIApplicationScopeEntity extends Base
52280
52529
  get Scope() {
52281
52530
  return this.Get('Scope');
52282
52531
  }
52532
+ /**
52533
+ * * Field Name: RowFilter
52534
+ * * Display Name: Row Filter
52535
+ * * SQL Data Type: nvarchar(100)
52536
+ */
52537
+ get RowFilter() {
52538
+ return this.Get('RowFilter');
52539
+ }
52283
52540
  };
52284
52541
  MJAPIApplicationScopeEntity = __decorate([
52285
52542
  RegisterClass(BaseEntity, 'MJ: API Application Scopes')
@@ -52628,6 +52885,19 @@ let MJAPIKeyScopeEntity = class MJAPIKeyScopeEntity extends BaseEntity {
52628
52885
  this.Set('Priority', value);
52629
52886
  }
52630
52887
  /**
52888
+ * * Field Name: RowFilterID
52889
+ * * Display Name: Row Filter ID
52890
+ * * SQL Data Type: uniqueidentifier
52891
+ * * Related Entity/Foreign Key: MJ: Row Level Security Filters (vwRowLevelSecurityFilters.ID)
52892
+ * * Description: Optional row-level filter narrowing WHICH RECORDS this scope grant applies to, in addition to the resource pattern that governs which entities. References the same RowLevelSecurityFilter catalog used by role-based RLS, so the filter text flows through the standard {{Token}} substitution engine and every existing RLS enforcement point (RunView, Load by primary key, save, delete, search). NULL (the default) means no row restriction — behavior identical to before this column existed. When set, the rule's ResourcePattern must name a single exact entity (no wildcards, no comma-separated lists), every column the filter references must resolve to a real non-virtual field on that entity, and every other referrer of the same filter record must resolve to that same entity. Critically, this filter is evaluated INDEPENDENTLY of the role-RLS exemption: a user exempt from role RLS is still bound by their key's filter, because narrowing a principal below what their roles allow is the entire purpose of a key ceiling.
52893
+ */
52894
+ get RowFilterID() {
52895
+ return this.Get('RowFilterID');
52896
+ }
52897
+ set RowFilterID(value) {
52898
+ this.Set('RowFilterID', value);
52899
+ }
52900
+ /**
52631
52901
  * * Field Name: APIKey
52632
52902
  * * Display Name: API Key
52633
52903
  * * SQL Data Type: nvarchar(255)
@@ -52643,6 +52913,14 @@ let MJAPIKeyScopeEntity = class MJAPIKeyScopeEntity extends BaseEntity {
52643
52913
  get Scope() {
52644
52914
  return this.Get('Scope');
52645
52915
  }
52916
+ /**
52917
+ * * Field Name: RowFilter
52918
+ * * Display Name: Row Filter
52919
+ * * SQL Data Type: nvarchar(100)
52920
+ */
52921
+ get RowFilter() {
52922
+ return this.Get('RowFilter');
52923
+ }
52646
52924
  };
52647
52925
  MJAPIKeyScopeEntity = __decorate([
52648
52926
  RegisterClass(BaseEntity, 'MJ: API Key Scopes')
@@ -61685,7 +61963,7 @@ let MJContentItemChunkEntity = class MJContentItemChunkEntity extends BaseEntity
61685
61963
  }
61686
61964
  /**
61687
61965
  * * Field Name: StartMs
61688
- * * Display Name: Start (ms)
61966
+ * * Display Name: Start Milliseconds
61689
61967
  * * SQL Data Type: int
61690
61968
  * * Description: Start of this chunk's time window, in milliseconds from the beginning of the parent audio or video asset. Set by transcript- or window-based segmentation; enables time-windowed playback deep-links from a search result (for example 14:22-15:05 of a session recording). NULL for text segments.
61691
61969
  */
@@ -61697,7 +61975,7 @@ let MJContentItemChunkEntity = class MJContentItemChunkEntity extends BaseEntity
61697
61975
  }
61698
61976
  /**
61699
61977
  * * Field Name: EndMs
61700
- * * Display Name: End (ms)
61978
+ * * Display Name: End Milliseconds
61701
61979
  * * SQL Data Type: int
61702
61980
  * * Description: End of this chunk's time window, in milliseconds from the beginning of the parent audio or video asset. See StartMs. NULL for text segments.
61703
61981
  */
@@ -61782,13 +62060,21 @@ let MJContentItemChunkEntity = class MJContentItemChunkEntity extends BaseEntity
61782
62060
  }
61783
62061
  /**
61784
62062
  * * Field Name: ContentItem
61785
- * * Display Name: Content Item
62063
+ * * Display Name: Content Item Name
61786
62064
  * * SQL Data Type: nvarchar(250)
61787
62065
  */
61788
62066
  get ContentItem() {
61789
62067
  return this.Get('ContentItem');
61790
62068
  }
61791
62069
  /**
62070
+ * * Field Name: ParentChunk
62071
+ * * Display Name: Parent Chunk Name
62072
+ * * SQL Data Type: nvarchar(500)
62073
+ */
62074
+ get ParentChunk() {
62075
+ return this.Get('ParentChunk');
62076
+ }
62077
+ /**
61792
62078
  * * Field Name: RootParentChunkID
61793
62079
  * * Display Name: Root Parent Chunk
61794
62080
  * * SQL Data Type: uniqueidentifier
@@ -71345,6 +71631,10 @@ let MJEntityEntity = class MJEntityEntity extends BaseEntity {
71345
71631
  /**
71346
71632
  * Validate() method override for MJ: Entities entity. This is an auto-generated method that invokes the generated validators for this entity for the following fields:
71347
71633
  * * Table-Level: This rule ensures that if deleting via the API is allowed and the delete type is set to 'Soft', then record merging must also be allowed. In other words, you cannot allow API deletes with a soft delete type without also allowing record merging.
71634
+ * * Table-Level: If direct SQL deletion is allowed, the delete type must be set to 'Hard' to ensure data integrity.
71635
+ * * Table-Level: Direct SQL operations (Insert, Update, and Delete) must be disabled if Track Record Changes or Trust Server Cache Completely is enabled, ensuring that cache integrity and change tracking are not bypassed.
71636
+ * * Table-Level: If the base view is marked as generated, the generated base view name must be null. A generated base view name can only be set when the base view is not marked as generated.
71637
+ * * Table-Level: If a generated base view name is specified, a base view must also be defined, and the generated base view name cannot be the same as the base view name to prevent naming conflicts.
71348
71638
  * @public
71349
71639
  * @method
71350
71640
  * @override
@@ -71352,6 +71642,10 @@ let MJEntityEntity = class MJEntityEntity extends BaseEntity {
71352
71642
  Validate() {
71353
71643
  const result = super.Validate();
71354
71644
  this.ValidateAllowRecordMergeForSoftDeleteAPI(result);
71645
+ this.ValidateDeleteTypeForDirectSQLDelete(result);
71646
+ this.ValidateDirectSQLAndTrackingConstraints(result);
71647
+ this.ValidateGeneratedBaseViewNameAndBaseViewGenerated(result);
71648
+ this.ValidateGeneratedBaseViewNameDifferentFromBaseView(result);
71355
71649
  result.Success = result.Success && (result.Errors.length === 0);
71356
71650
  return result;
71357
71651
  }
@@ -71367,6 +71661,55 @@ let MJEntityEntity = class MJEntityEntity extends BaseEntity {
71367
71661
  }
71368
71662
  }
71369
71663
  /**
71664
+ * If direct SQL deletion is allowed, the delete type must be set to 'Hard' to ensure data integrity.
71665
+ * @param result - the ValidationResult object to add any errors or warnings to
71666
+ * @public
71667
+ * @method
71668
+ */
71669
+ ValidateDeleteTypeForDirectSQLDelete(result) {
71670
+ if (this.AllowDirectSQLDelete && this.DeleteType !== "Hard") {
71671
+ result.Errors.push(new ValidationErrorInfo("DeleteType", "Delete Type must be 'Hard' if Allow Direct SQL Delete is enabled.", this.DeleteType, ValidationErrorType.Failure));
71672
+ }
71673
+ }
71674
+ /**
71675
+ * Direct SQL operations (Insert, Update, and Delete) must be disabled if Track Record Changes or Trust Server Cache Completely is enabled, ensuring that cache integrity and change tracking are not bypassed.
71676
+ * @param result - the ValidationResult object to add any errors or warnings to
71677
+ * @public
71678
+ * @method
71679
+ */
71680
+ ValidateDirectSQLAndTrackingConstraints(result) {
71681
+ if ((this.AllowDirectSQLInsert || this.AllowDirectSQLUpdate || this.AllowDirectSQLDelete) && (this.TrackRecordChanges || this.TrustServerCacheCompletely)) {
71682
+ result.Errors.push(new ValidationErrorInfo("AllowDirectSQLInsert", "Direct SQL operations (Insert, Update, Delete) cannot be enabled when Track Record Changes or Trust Server Cache Completely is enabled.", this.AllowDirectSQLInsert, ValidationErrorType.Failure));
71683
+ }
71684
+ }
71685
+ /**
71686
+ * If the base view is marked as generated, the generated base view name must be null. A generated base view name can only be set when the base view is not marked as generated.
71687
+ * @param result - the ValidationResult object to add any errors or warnings to
71688
+ * @public
71689
+ * @method
71690
+ */
71691
+ ValidateGeneratedBaseViewNameAndBaseViewGenerated(result) {
71692
+ if (this.GeneratedBaseViewName != null && this.BaseViewGenerated) {
71693
+ result.Errors.push(new ValidationErrorInfo("GeneratedBaseViewName", "Generated Base View Name must be empty when Base View Generated is enabled.", this.GeneratedBaseViewName, ValidationErrorType.Failure));
71694
+ }
71695
+ }
71696
+ /**
71697
+ * If a generated base view name is specified, a base view must also be defined, and the generated base view name cannot be the same as the base view name to prevent naming conflicts.
71698
+ * @param result - the ValidationResult object to add any errors or warnings to
71699
+ * @public
71700
+ * @method
71701
+ */
71702
+ ValidateGeneratedBaseViewNameDifferentFromBaseView(result) {
71703
+ if (this.GeneratedBaseViewName != null && this.GeneratedBaseViewName.trim() !== "") {
71704
+ if (this.BaseView == null || this.BaseView.trim() === "") {
71705
+ result.Errors.push(new ValidationErrorInfo("GeneratedBaseViewName", "A Base View must be specified when a Generated Base View Name is provided.", this.GeneratedBaseViewName, ValidationErrorType.Failure));
71706
+ }
71707
+ else if (this.GeneratedBaseViewName === this.BaseView) {
71708
+ result.Errors.push(new ValidationErrorInfo("GeneratedBaseViewName", "The Generated Base View Name cannot be the same as the Base View name.", this.GeneratedBaseViewName, ValidationErrorType.Failure));
71709
+ }
71710
+ }
71711
+ }
71712
+ /**
71370
71713
  * * Field Name: ID
71371
71714
  * * Display Name: ID
71372
71715
  * * SQL Data Type: uniqueidentifier
@@ -72197,7 +72540,7 @@ let MJEntityEntity = class MJEntityEntity extends BaseEntity {
72197
72540
  }
72198
72541
  /**
72199
72542
  * * Field Name: ExternalDataSourceID
72200
- * * Display Name: External Data Source ID
72543
+ * * Display Name: External Data Source
72201
72544
  * * SQL Data Type: uniqueidentifier
72202
72545
  * * Related Entity/Foreign Key: MJ: External Data Sources (vwExternalDataSources.ID)
72203
72546
  */
@@ -72220,6 +72563,57 @@ let MJEntityEntity = class MJEntityEntity extends BaseEntity {
72220
72563
  this.Set('ExternalObjectName', value);
72221
72564
  }
72222
72565
  /**
72566
+ * * Field Name: GeneratedBaseViewName
72567
+ * * Display Name: Generated Base View Name
72568
+ * * SQL Data Type: nvarchar(255)
72569
+ * * Description: When set, CodeGen generates the entity's full base view under THIS name instead of BaseView, and the application owns BaseView — which is expected to wrap it (SELECT g.*, <extras> FROM <GeneratedBaseViewName> g). This gives an entity a custom base view WITHOUT inheriting the generated SQL: related-entity display joins, geo columns and recursive root-ID columns keep regenerating underneath, so a foreign key added later still appears. NULL (the default, and every pre-existing row) means the previous all-or-nothing behaviour: BaseViewGenerated alone decides whether CodeGen writes BaseView, and there is no second view. BaseView remains the public surface — entity field discovery, permissions and the generated CRUD procedures all target it. SQL SERVER ONLY: layering relies on sp_refreshview to re-resolve the application-owned outer view's SELECT * against a regenerated inner view. PostgreSQL freezes a view's column list at creation and has no refresh equivalent, so CodeGen rejects this column on PostgreSQL rather than let the outer view go silently stale.
72570
+ */
72571
+ get GeneratedBaseViewName() {
72572
+ return this.Get('GeneratedBaseViewName');
72573
+ }
72574
+ set GeneratedBaseViewName(value) {
72575
+ this.Set('GeneratedBaseViewName', value);
72576
+ }
72577
+ /**
72578
+ * * Field Name: AllowDirectSQLInsert
72579
+ * * Display Name: Allow Direct SQL Insert
72580
+ * * SQL Data Type: bit
72581
+ * * Default Value: 0
72582
+ * * Description: When 1, this entity may be populated by INSERT statements that do not go through BaseEntity.Save() — bulk loads, ETL/integration sync, or rows created as a side effect of a stored procedure. Default 0, meaning every insert is expected to flow through BaseEntity so that record-change tracking, entity actions, validation and cache invalidation all run. This column DECLARES intent for the code paths and tooling that consult it; it does not and cannot prevent anyone from executing SQL. Requires TrackRecordChanges = 0 and TrustServerCacheCompletely = 0, because a direct insert produces neither an audit row nor a cache-invalidation event.
72583
+ */
72584
+ get AllowDirectSQLInsert() {
72585
+ return this.Get('AllowDirectSQLInsert');
72586
+ }
72587
+ set AllowDirectSQLInsert(value) {
72588
+ this.Set('AllowDirectSQLInsert', value);
72589
+ }
72590
+ /**
72591
+ * * Field Name: AllowDirectSQLUpdate
72592
+ * * Display Name: Allow Direct SQL Update
72593
+ * * SQL Data Type: bit
72594
+ * * Default Value: 0
72595
+ * * Description: When 1, this entity may be modified by UPDATE statements that do not go through BaseEntity.Save() — bulk backfills, integration sync, or maintenance routines. Default 0, meaning every update is expected to flow through BaseEntity so that record-change tracking, entity actions, validation and cache invalidation all run. This column DECLARES intent for the code paths and tooling that consult it; it does not and cannot prevent anyone from executing SQL. Requires TrackRecordChanges = 0 and TrustServerCacheCompletely = 0, because a direct update produces neither an audit row nor a cache-invalidation event.
72596
+ */
72597
+ get AllowDirectSQLUpdate() {
72598
+ return this.Get('AllowDirectSQLUpdate');
72599
+ }
72600
+ set AllowDirectSQLUpdate(value) {
72601
+ this.Set('AllowDirectSQLUpdate', value);
72602
+ }
72603
+ /**
72604
+ * * Field Name: AllowDirectSQLDelete
72605
+ * * Display Name: Allow Direct SQL Delete
72606
+ * * SQL Data Type: bit
72607
+ * * Default Value: 0
72608
+ * * Description: When 1, this entity may have rows removed by DELETE statements that do not go through BaseEntity.Delete() — purge and retention routines, or integration sync reconciling a remote source. Default 0, meaning every delete is expected to flow through BaseEntity so that record-change tracking, entity actions, cascade handling and cache invalidation all run. This column DECLARES intent for the code paths and tooling that consult it; it does not and cannot prevent anyone from executing SQL. Requires TrackRecordChanges = 0 and TrustServerCacheCompletely = 0, and additionally requires DeleteType = 'Hard' — a direct DELETE removes the row outright rather than setting DeletedAt, which would defeat soft delete.
72609
+ */
72610
+ get AllowDirectSQLDelete() {
72611
+ return this.Get('AllowDirectSQLDelete');
72612
+ }
72613
+ set AllowDirectSQLDelete(value) {
72614
+ this.Set('AllowDirectSQLDelete', value);
72615
+ }
72616
+ /**
72223
72617
  * * Field Name: CodeName
72224
72618
  * * Display Name: Code Name
72225
72619
  * * SQL Data Type: nvarchar(MAX)
@@ -72720,9 +73114,10 @@ let MJEntityActionParamEntity = class MJEntityActionParamEntity extends BaseEnti
72720
73114
  * * Possible Values
72721
73115
  * * Entity Field
72722
73116
  * * Entity Object
73117
+ * * Entity Object Data
72723
73118
  * * Script
72724
73119
  * * Static
72725
- * * Description: Type of the value, which can be Static, Entity Object, or Script.
73120
+ * * Description: How the parameter value is produced at invocation time. Static = the literal Value (parsed as JSON when it parses). Entity Object = the live BaseEntity instance, for actions that call entity methods. Entity Object Data = entity.GetAll(), a plain object - use this for any action that SERIALIZES the value, such as the Data payload of Execute Agent, because a BaseEntity serializes to {} (its fields are getters, not enumerable own properties). Entity Field = the named field's value. Script = evaluated expression with the entity in scope.
72726
73121
  */
72727
73122
  get ValueType() {
72728
73123
  return this.Get('ValueType');
@@ -72773,6 +73168,18 @@ let MJEntityActionParamEntity = class MJEntityActionParamEntity extends BaseEnti
72773
73168
  return this.Get('__mj_UpdatedAt');
72774
73169
  }
72775
73170
  /**
73171
+ * * Field Name: LogValue
73172
+ * * Display Name: Log Value
73173
+ * * SQL Data Type: bit
73174
+ * * Description: Optional per-binding override of ActionParam.LogValue. NULL (the default) inherits the parameter definition. Set to 0 when this particular binding passes something sensitive through a parameter that is ordinarily safe to log - a message body through a generic Text parameter, for instance. Cannot re-enable logging for a value type the hard rule suppresses.
73175
+ */
73176
+ get LogValue() {
73177
+ return this.Get('LogValue');
73178
+ }
73179
+ set LogValue(value) {
73180
+ this.Set('LogValue', value);
73181
+ }
73182
+ /**
72776
73183
  * * Field Name: EntityAction
72777
73184
  * * Display Name: Entity Action
72778
73185
  * * SQL Data Type: nvarchar(425)
@@ -72822,6 +73229,30 @@ let MJEntityActionEntity = class MJEntityActionEntity extends BaseEntity {
72822
73229
  return await super.InnerLoad(compositeKey, EntityRelationshipsToLoad);
72823
73230
  }
72824
73231
  /**
73232
+ * Validate() method override for MJ: Entity Actions entity. This is an auto-generated method that invokes the generated validators for this entity for the following fields:
73233
+ * * Table-Level: Both Scope Entity and Scope Record must be provided together, or both must be left blank. You cannot specify one without the other.
73234
+ * @public
73235
+ * @method
73236
+ * @override
73237
+ */
73238
+ Validate() {
73239
+ const result = super.Validate();
73240
+ this.ValidateScopeEntityAndRecordCoexistence(result);
73241
+ result.Success = result.Success && (result.Errors.length === 0);
73242
+ return result;
73243
+ }
73244
+ /**
73245
+ * Both Scope Entity and Scope Record must be provided together, or both must be left blank. You cannot specify one without the other.
73246
+ * @param result - the ValidationResult object to add any errors or warnings to
73247
+ * @public
73248
+ * @method
73249
+ */
73250
+ ValidateScopeEntityAndRecordCoexistence(result) {
73251
+ if ((this.ScopeEntityID == null && this.ScopeRecordID != null) || (this.ScopeEntityID != null && this.ScopeRecordID == null)) {
73252
+ result.Errors.push(new ValidationErrorInfo("ScopeEntityID", "Scope Entity and Scope Record must either both be specified or both be empty.", this.ScopeEntityID, ValidationErrorType.Failure));
73253
+ }
73254
+ }
73255
+ /**
72825
73256
  * * Field Name: EntityID
72826
73257
  * * Display Name: Entity ID
72827
73258
  * * SQL Data Type: uniqueidentifier
@@ -72894,6 +73325,62 @@ let MJEntityActionEntity = class MJEntityActionEntity extends BaseEntity {
72894
73325
  this.Set('ID', value);
72895
73326
  }
72896
73327
  /**
73328
+ * * Field Name: Sequence
73329
+ * * Display Name: Sequence
73330
+ * * SQL Data Type: int
73331
+ * * Default Value: 0
73332
+ * * Description: Execution order when multiple Entity Actions are bound to the same entity and invocation type. Lower runs first; ties fall back to creation order. Defaults to 0 so existing rows are unaffected.
73333
+ */
73334
+ get Sequence() {
73335
+ return this.Get('Sequence');
73336
+ }
73337
+ set Sequence(value) {
73338
+ this.Set('Sequence', value);
73339
+ }
73340
+ /**
73341
+ * * Field Name: ScopeEntityID
73342
+ * * Display Name: Scope Entity ID
73343
+ * * SQL Data Type: uniqueidentifier
73344
+ * * Related Entity/Foreign Key: MJ: Entities (vwEntities.ID)
73345
+ * * Description: Optional. Together with ScopeRecordID, narrows this Entity Action to records related to ONE specific record - for example a single Deal Type, Contract Type, Pipeline or Company - rather than every record of EntityID. NULL (the default) means the action applies to all records, which is the pre-existing behaviour. How a scope record relates to the subject record is resolved by the app that owns the scope entity; the framework only stores and filters on the pair.
73346
+ */
73347
+ get ScopeEntityID() {
73348
+ return this.Get('ScopeEntityID');
73349
+ }
73350
+ set ScopeEntityID(value) {
73351
+ this.Set('ScopeEntityID', value);
73352
+ }
73353
+ /**
73354
+ * * Field Name: ScopeRecordID
73355
+ * * Display Name: Scope Record ID
73356
+ * * SQL Data Type: nvarchar(450)
73357
+ * * Description: Optional. The primary key of the scope record, as text, paired with ScopeEntityID. Both columns are NULL or both are set (CK_EntityAction_Scope). Lets a configuration record such as a Deal Type surface "the workflows bound to me" as a real relationship rather than something buried in filter code.
73358
+ */
73359
+ get ScopeRecordID() {
73360
+ return this.Get('ScopeRecordID');
73361
+ }
73362
+ set ScopeRecordID(value) {
73363
+ this.Set('ScopeRecordID', value);
73364
+ }
73365
+ /**
73366
+ * * Field Name: LoggingMode
73367
+ * * Display Name: Logging Mode
73368
+ * * SQL Data Type: nvarchar(20)
73369
+ * * Default Value: All
73370
+ * * Value List Type: List
73371
+ * * Possible Values
73372
+ * * All
73373
+ * * FailuresOnly
73374
+ * * None
73375
+ * * Description: How much of this binding's activity reaches ActionExecutionLog. All (default) writes a row per invocation. FailuresOnly writes only runs that did not succeed - the right setting for a high-frequency binding on a busy entity, where the successful runs are noise. None disables logging for the binding entirely and should be rare, because it also removes the failure record.
73376
+ */
73377
+ get LoggingMode() {
73378
+ return this.Get('LoggingMode');
73379
+ }
73380
+ set LoggingMode(value) {
73381
+ this.Set('LoggingMode', value);
73382
+ }
73383
+ /**
72897
73384
  * * Field Name: Entity
72898
73385
  * * Display Name: Entity
72899
73386
  * * SQL Data Type: nvarchar(255)
@@ -72909,6 +73396,14 @@ let MJEntityActionEntity = class MJEntityActionEntity extends BaseEntity {
72909
73396
  get Action() {
72910
73397
  return this.Get('Action');
72911
73398
  }
73399
+ /**
73400
+ * * Field Name: ScopeEntity
73401
+ * * Display Name: Scope Entity
73402
+ * * SQL Data Type: nvarchar(255)
73403
+ */
73404
+ get ScopeEntity() {
73405
+ return this.Get('ScopeEntity');
73406
+ }
72912
73407
  };
72913
73408
  MJEntityActionEntity = __decorate([
72914
73409
  RegisterClass(BaseEntity, 'MJ: Entity Actions')
@@ -109148,6 +109643,7 @@ let MJUserViewRunDetailEntity = class MJUserViewRunDetailEntity extends BaseEnti
109148
109643
  }
109149
109644
  /**
109150
109645
  * * Field Name: ID
109646
+ * * Display Name: ID
109151
109647
  * * SQL Data Type: uniqueidentifier
109152
109648
  * * Default Value: newsequentialid()
109153
109649
  */
@@ -109159,7 +109655,7 @@ let MJUserViewRunDetailEntity = class MJUserViewRunDetailEntity extends BaseEnti
109159
109655
  }
109160
109656
  /**
109161
109657
  * * Field Name: UserViewRunID
109162
- * * Display Name: User View Run ID
109658
+ * * Display Name: User View Run
109163
109659
  * * SQL Data Type: uniqueidentifier
109164
109660
  * * Related Entity/Foreign Key: MJ: User View Runs (vwUserViewRuns.ID)
109165
109661
  */
@@ -109200,6 +109696,14 @@ let MJUserViewRunDetailEntity = class MJUserViewRunDetailEntity extends BaseEnti
109200
109696
  return this.Get('__mj_UpdatedAt');
109201
109697
  }
109202
109698
  /**
109699
+ * * Field Name: UserViewRun
109700
+ * * Display Name: User View Run Name
109701
+ * * SQL Data Type: nvarchar(100)
109702
+ */
109703
+ get UserViewRun() {
109704
+ return this.Get('UserViewRun');
109705
+ }
109706
+ /**
109203
109707
  * * Field Name: UserViewID
109204
109708
  * * Display Name: User View
109205
109709
  * * SQL Data Type: uniqueidentifier