@memberjunction/server 5.37.0 → 5.39.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.
Files changed (121) hide show
  1. package/README.md +79 -12
  2. package/dist/agents/skip-sdk.d.ts.map +1 -1
  3. package/dist/agents/skip-sdk.js +16 -12
  4. package/dist/agents/skip-sdk.js.map +1 -1
  5. package/dist/apolloServer/index.d.ts +0 -8
  6. package/dist/apolloServer/index.d.ts.map +1 -1
  7. package/dist/apolloServer/index.js +61 -0
  8. package/dist/apolloServer/index.js.map +1 -1
  9. package/dist/config.d.ts +68 -0
  10. package/dist/config.d.ts.map +1 -1
  11. package/dist/config.js +24 -0
  12. package/dist/config.js.map +1 -1
  13. package/dist/context.d.ts.map +1 -1
  14. package/dist/context.js +2 -21
  15. package/dist/context.js.map +1 -1
  16. package/dist/generated/generated.d.ts +172 -5
  17. package/dist/generated/generated.d.ts.map +1 -1
  18. package/dist/generated/generated.js +867 -14
  19. package/dist/generated/generated.js.map +1 -1
  20. package/dist/generic/FireAndForgetHeartbeat.d.ts +51 -0
  21. package/dist/generic/FireAndForgetHeartbeat.d.ts.map +1 -0
  22. package/dist/generic/FireAndForgetHeartbeat.js +44 -0
  23. package/dist/generic/FireAndForgetHeartbeat.js.map +1 -0
  24. package/dist/index.d.ts +3 -0
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +177 -16
  27. package/dist/index.js.map +1 -1
  28. package/dist/logging/NoLog.d.ts +50 -0
  29. package/dist/logging/NoLog.d.ts.map +1 -0
  30. package/dist/logging/NoLog.js +80 -0
  31. package/dist/logging/NoLog.js.map +1 -0
  32. package/dist/logging/bootAudit.d.ts +43 -0
  33. package/dist/logging/bootAudit.d.ts.map +1 -0
  34. package/dist/logging/bootAudit.js +83 -0
  35. package/dist/logging/bootAudit.js.map +1 -0
  36. package/dist/logging/boundaryLogPayload.d.ts +18 -0
  37. package/dist/logging/boundaryLogPayload.d.ts.map +1 -0
  38. package/dist/logging/boundaryLogPayload.js +18 -0
  39. package/dist/logging/boundaryLogPayload.js.map +1 -0
  40. package/dist/logging/secretRedactor.d.ts +23 -0
  41. package/dist/logging/secretRedactor.d.ts.map +1 -0
  42. package/dist/logging/secretRedactor.js +53 -0
  43. package/dist/logging/secretRedactor.js.map +1 -0
  44. package/dist/logging/shortenForLog.d.ts +8 -0
  45. package/dist/logging/shortenForLog.d.ts.map +1 -0
  46. package/dist/logging/shortenForLog.js +21 -0
  47. package/dist/logging/shortenForLog.js.map +1 -0
  48. package/dist/logging/variablesLoggingMiddleware.d.ts +22 -0
  49. package/dist/logging/variablesLoggingMiddleware.d.ts.map +1 -0
  50. package/dist/logging/variablesLoggingMiddleware.js +127 -0
  51. package/dist/logging/variablesLoggingMiddleware.js.map +1 -0
  52. package/dist/resolvers/GetDataResolver.d.ts.map +1 -1
  53. package/dist/resolvers/GetDataResolver.js +8 -4
  54. package/dist/resolvers/GetDataResolver.js.map +1 -1
  55. package/dist/resolvers/IntegrationDiscoveryResolver.d.ts +259 -2
  56. package/dist/resolvers/IntegrationDiscoveryResolver.d.ts.map +1 -1
  57. package/dist/resolvers/IntegrationDiscoveryResolver.js +1276 -117
  58. package/dist/resolvers/IntegrationDiscoveryResolver.js.map +1 -1
  59. package/dist/resolvers/IntegrationProgressResolver.d.ts +90 -0
  60. package/dist/resolvers/IntegrationProgressResolver.d.ts.map +1 -0
  61. package/dist/resolvers/IntegrationProgressResolver.js +196 -0
  62. package/dist/resolvers/IntegrationProgressResolver.js.map +1 -0
  63. package/dist/resolvers/MCPResolver.d.ts.map +1 -1
  64. package/dist/resolvers/MCPResolver.js +19 -14
  65. package/dist/resolvers/MCPResolver.js.map +1 -1
  66. package/dist/resolvers/QueryResolver.d.ts.map +1 -1
  67. package/dist/resolvers/QueryResolver.js +5 -4
  68. package/dist/resolvers/QueryResolver.js.map +1 -1
  69. package/dist/resolvers/QuerySystemUserResolver.d.ts.map +1 -1
  70. package/dist/resolvers/QuerySystemUserResolver.js +6 -18
  71. package/dist/resolvers/QuerySystemUserResolver.js.map +1 -1
  72. package/dist/resolvers/RunAIAgentResolver.d.ts.map +1 -1
  73. package/dist/resolvers/RunAIAgentResolver.js +32 -64
  74. package/dist/resolvers/RunAIAgentResolver.js.map +1 -1
  75. package/dist/resolvers/RunTestResolver.d.ts.map +1 -1
  76. package/dist/resolvers/RunTestResolver.js +12 -2
  77. package/dist/resolvers/RunTestResolver.js.map +1 -1
  78. package/dist/resolvers/SearchEntitiesResolver.d.ts +46 -0
  79. package/dist/resolvers/SearchEntitiesResolver.d.ts.map +1 -0
  80. package/dist/resolvers/SearchEntitiesResolver.js +216 -0
  81. package/dist/resolvers/SearchEntitiesResolver.js.map +1 -0
  82. package/dist/resolvers/VectorizeEntityResolver.d.ts.map +1 -1
  83. package/dist/resolvers/VectorizeEntityResolver.js +14 -1
  84. package/dist/resolvers/VectorizeEntityResolver.js.map +1 -1
  85. package/dist/services/ScheduledJobsService.d.ts.map +1 -1
  86. package/dist/services/ScheduledJobsService.js +14 -2
  87. package/dist/services/ScheduledJobsService.js.map +1 -1
  88. package/package.json +75 -74
  89. package/src/__tests__/NoLog.test.ts +76 -0
  90. package/src/__tests__/bootAudit.test.ts +188 -0
  91. package/src/__tests__/boundaryLogPayload.test.ts +31 -0
  92. package/src/__tests__/getDataTokenRedaction.test.ts +84 -0
  93. package/src/__tests__/resolverBase.rls.test.ts +224 -0
  94. package/src/__tests__/secretRedactor.test.ts +163 -0
  95. package/src/__tests__/subscriptionRedaction.test.ts +217 -0
  96. package/src/agents/skip-sdk.ts +16 -13
  97. package/src/apolloServer/index.ts +58 -0
  98. package/src/config.ts +27 -0
  99. package/src/context.ts +2 -19
  100. package/src/generated/generated.ts +627 -15
  101. package/src/generic/FireAndForgetHeartbeat.ts +85 -0
  102. package/src/generic/__tests__/FireAndForgetHeartbeat.test.ts +99 -0
  103. package/src/index.ts +199 -19
  104. package/src/logging/NoLog.ts +88 -0
  105. package/src/logging/bootAudit.ts +117 -0
  106. package/src/logging/boundaryLogPayload.ts +19 -0
  107. package/src/logging/secretRedactor.ts +82 -0
  108. package/src/logging/shortenForLog.ts +17 -0
  109. package/src/logging/variablesLoggingMiddleware.ts +191 -0
  110. package/src/resolvers/GetDataResolver.ts +9 -5
  111. package/src/resolvers/IntegrationDiscoveryResolver.ts +1111 -120
  112. package/src/resolvers/IntegrationProgressResolver.ts +220 -0
  113. package/src/resolvers/MCPResolver.ts +18 -14
  114. package/src/resolvers/QueryResolver.ts +7 -6
  115. package/src/resolvers/QuerySystemUserResolver.ts +11 -25
  116. package/src/resolvers/RunAIAgentResolver.ts +34 -71
  117. package/src/resolvers/RunTestResolver.ts +14 -2
  118. package/src/resolvers/SearchEntitiesResolver.ts +173 -0
  119. package/src/resolvers/VectorizeEntityResolver.ts +14 -1
  120. package/src/resolvers/__tests__/IntegrationProgressResolver.test.ts +170 -0
  121. package/src/services/ScheduledJobsService.ts +15 -2
@@ -10957,6 +10957,14 @@ __decorate([
10957
10957
  MaxLength(36),
10958
10958
  __metadata("design:type", String)
10959
10959
  ], MJAIAgentRun_.prototype, "CompanyID", void 0);
10960
+ __decorate([
10961
+ Field(() => Int, { nullable: true, description: `Total input tokens served from the AI provider's prompt cache (cache reads / hits) across this agent run, summed from child prompt runs' TokensCacheReadRollup and sub-agent runs' TotalCacheReadTokensUsed. Counts only; the cost impact (cache reads are billed at a steep discount) is reflected in TotalCost. The cache counterpart of TotalPromptTokensUsed.` }),
10962
+ __metadata("design:type", Number)
10963
+ ], MJAIAgentRun_.prototype, "TotalCacheReadTokensUsed", void 0);
10964
+ __decorate([
10965
+ Field(() => Int, { nullable: true, description: `Total input tokens written to the AI provider's prompt cache (cache writes / creation) across this agent run, summed from child prompt runs' TokensCacheWriteRollup and sub-agent runs' TotalCacheWriteTokensUsed. Populated for providers that bill cache creation (e.g. Anthropic); 0 or NULL otherwise. The cache counterpart of TotalCompletionTokensUsed.` }),
10966
+ __metadata("design:type", Number)
10967
+ ], MJAIAgentRun_.prototype, "TotalCacheWriteTokensUsed", void 0);
10960
10968
  __decorate([
10961
10969
  Field({ nullable: true }),
10962
10970
  MaxLength(255),
@@ -11247,6 +11255,14 @@ __decorate([
11247
11255
  Field({ nullable: true }),
11248
11256
  __metadata("design:type", String)
11249
11257
  ], CreateMJAIAgentRunInput.prototype, "CompanyID", void 0);
11258
+ __decorate([
11259
+ Field(() => Int, { nullable: true }),
11260
+ __metadata("design:type", Number)
11261
+ ], CreateMJAIAgentRunInput.prototype, "TotalCacheReadTokensUsed", void 0);
11262
+ __decorate([
11263
+ Field(() => Int, { nullable: true }),
11264
+ __metadata("design:type", Number)
11265
+ ], CreateMJAIAgentRunInput.prototype, "TotalCacheWriteTokensUsed", void 0);
11250
11266
  __decorate([
11251
11267
  Field(() => RestoreContextInput, { nullable: true }),
11252
11268
  __metadata("design:type", RestoreContextInput)
@@ -11436,6 +11452,14 @@ __decorate([
11436
11452
  Field({ nullable: true }),
11437
11453
  __metadata("design:type", String)
11438
11454
  ], UpdateMJAIAgentRunInput.prototype, "CompanyID", void 0);
11455
+ __decorate([
11456
+ Field(() => Int, { nullable: true }),
11457
+ __metadata("design:type", Number)
11458
+ ], UpdateMJAIAgentRunInput.prototype, "TotalCacheReadTokensUsed", void 0);
11459
+ __decorate([
11460
+ Field(() => Int, { nullable: true }),
11461
+ __metadata("design:type", Number)
11462
+ ], UpdateMJAIAgentRunInput.prototype, "TotalCacheWriteTokensUsed", void 0);
11439
11463
  __decorate([
11440
11464
  Field(() => [KeyValuePairInput], { nullable: true }),
11441
11465
  __metadata("design:type", Array)
@@ -13739,6 +13763,10 @@ __decorate([
13739
13763
  Field(() => [MJAction_]),
13740
13764
  __metadata("design:type", Array)
13741
13765
  ], MJAIAgent_.prototype, "MJActions_CreatedByAgentIDArray", void 0);
13766
+ __decorate([
13767
+ Field(() => [MJConversation_]),
13768
+ __metadata("design:type", Array)
13769
+ ], MJAIAgent_.prototype, "MJConversations_DefaultAgentIDArray", void 0);
13742
13770
  MJAIAgent_ = __decorate([
13743
13771
  ObjectType({ description: `Table to store information about AI agents.` })
13744
13772
  ], MJAIAgent_);
@@ -14552,6 +14580,14 @@ let MJAIAgentResolver = class MJAIAgentResolver extends ResolverBase {
14552
14580
  const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Actions', rows, this.GetUserFromPayload(userPayload));
14553
14581
  return result;
14554
14582
  }
14583
+ async MJConversations_DefaultAgentIDArray(mjaiagent_, { userPayload, providers }, pubSub) {
14584
+ this.CheckUserReadPermissions('MJ: Conversations', userPayload);
14585
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
14586
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwConversations')} WHERE ${provider.QuoteIdentifier('DefaultAgentID')}='${mjaiagent_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Conversations', userPayload, EntityPermissionType.Read, 'AND');
14587
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
14588
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Conversations', rows, this.GetUserFromPayload(userPayload));
14589
+ return result;
14590
+ }
14555
14591
  async CreateMJAIAgent(input, { providers, userPayload }, pubSub) {
14556
14592
  const provider = GetReadWriteProvider(providers);
14557
14593
  return this.CreateRecord('MJ: AI Agents', input, provider, userPayload, pubSub);
@@ -14836,6 +14872,15 @@ __decorate([
14836
14872
  __metadata("design:paramtypes", [MJAIAgent_, Object, PubSubEngine]),
14837
14873
  __metadata("design:returntype", Promise)
14838
14874
  ], MJAIAgentResolver.prototype, "MJActions_CreatedByAgentIDArray", null);
14875
+ __decorate([
14876
+ FieldResolver(() => [MJConversation_]),
14877
+ __param(0, Root()),
14878
+ __param(1, Ctx()),
14879
+ __param(2, PubSub()),
14880
+ __metadata("design:type", Function),
14881
+ __metadata("design:paramtypes", [MJAIAgent_, Object, PubSubEngine]),
14882
+ __metadata("design:returntype", Promise)
14883
+ ], MJAIAgentResolver.prototype, "MJConversations_DefaultAgentIDArray", null);
14839
14884
  __decorate([
14840
14885
  Mutation(() => MJAIAgent_),
14841
14886
  __param(0, Arg('input', () => CreateMJAIAgentInput)),
@@ -17668,6 +17713,14 @@ __decorate([
17668
17713
  Field(),
17669
17714
  __metadata("design:type", Date)
17670
17715
  ], MJAIModelCost_.prototype, "_mj__UpdatedAt", void 0);
17716
+ __decorate([
17717
+ Field(() => Float, { nullable: true, description: `Optional price per unit for input tokens served from the AI provider's prompt cache (cache reads / hits), expressed in the same currency and UnitType (e.g. per 1M tokens) as InputPricePerUnit. When NULL, cache-read tokens are priced at InputPricePerUnit. Cache reads are usually far cheaper than uncached input (e.g. ~0.1x for Anthropic/Gemini, ~0.5x for OpenAI).` }),
17718
+ __metadata("design:type", Number)
17719
+ ], MJAIModelCost_.prototype, "CacheReadPricePerUnit", void 0);
17720
+ __decorate([
17721
+ Field(() => Float, { nullable: true, description: `Optional price per unit for input tokens written to the AI provider's prompt cache (cache writes / creation), expressed in the same currency and UnitType as InputPricePerUnit. When NULL, cache-write tokens are priced at InputPricePerUnit. Populated for providers that bill cache creation separately (e.g. Anthropic, ~1.25x input); leave NULL for providers that do not (OpenAI, Gemini), which also report 0 cache-write tokens.` }),
17722
+ __metadata("design:type", Number)
17723
+ ], MJAIModelCost_.prototype, "CacheWritePricePerUnit", void 0);
17671
17724
  __decorate([
17672
17725
  Field(),
17673
17726
  MaxLength(50),
@@ -17749,6 +17802,14 @@ __decorate([
17749
17802
  Field({ nullable: true }),
17750
17803
  __metadata("design:type", String)
17751
17804
  ], CreateMJAIModelCostInput.prototype, "Comments", void 0);
17805
+ __decorate([
17806
+ Field(() => Float, { nullable: true }),
17807
+ __metadata("design:type", Number)
17808
+ ], CreateMJAIModelCostInput.prototype, "CacheReadPricePerUnit", void 0);
17809
+ __decorate([
17810
+ Field(() => Float, { nullable: true }),
17811
+ __metadata("design:type", Number)
17812
+ ], CreateMJAIModelCostInput.prototype, "CacheWritePricePerUnit", void 0);
17752
17813
  __decorate([
17753
17814
  Field(() => RestoreContextInput, { nullable: true }),
17754
17815
  __metadata("design:type", RestoreContextInput)
@@ -17814,6 +17875,14 @@ __decorate([
17814
17875
  Field({ nullable: true }),
17815
17876
  __metadata("design:type", String)
17816
17877
  ], UpdateMJAIModelCostInput.prototype, "Comments", void 0);
17878
+ __decorate([
17879
+ Field(() => Float, { nullable: true }),
17880
+ __metadata("design:type", Number)
17881
+ ], UpdateMJAIModelCostInput.prototype, "CacheReadPricePerUnit", void 0);
17882
+ __decorate([
17883
+ Field(() => Float, { nullable: true }),
17884
+ __metadata("design:type", Number)
17885
+ ], UpdateMJAIModelCostInput.prototype, "CacheWritePricePerUnit", void 0);
17817
17886
  __decorate([
17818
17887
  Field(() => [KeyValuePairInput], { nullable: true }),
17819
17888
  __metadata("design:type", Array)
@@ -22024,6 +22093,22 @@ __decorate([
22024
22093
  Field({ nullable: true, description: `The assistant prefill text that was used during this prompt execution. Records whether native prefill or fallback was applied. NULL means no prefill was used.` }),
22025
22094
  __metadata("design:type", String)
22026
22095
  ], MJAIPromptRun_.prototype, "AssistantPrefill", void 0);
22096
+ __decorate([
22097
+ Field(() => Int, { nullable: true, description: `Number of input tokens served from the AI provider's prompt cache (a cache READ / hit) for this run, as reported by the provider. Counts only; no cost is derived here. NULL if the provider did not report cache reads or caching did not engage. Distinct from CacheHit/CacheKey, which track MemberJunction's own result cache.` }),
22098
+ __metadata("design:type", Number)
22099
+ ], MJAIPromptRun_.prototype, "TokensCacheRead", void 0);
22100
+ __decorate([
22101
+ Field(() => Int, { nullable: true, description: `Number of input tokens written to the AI provider's prompt cache (a cache WRITE / creation) for this run, as reported by the provider. Populated for providers that report cache writes (e.g. Anthropic cache_creation_input_tokens); NULL or 0 for providers that do not bill/report writes (OpenAI, Gemini, Groq, Cerebras). Counts only; no cost is derived here.` }),
22102
+ __metadata("design:type", Number)
22103
+ ], MJAIPromptRun_.prototype, "TokensCacheWrite", void 0);
22104
+ __decorate([
22105
+ Field(() => Int, { nullable: true, description: `Rollup of TokensCacheRead across this prompt run and all of its descendant prompt runs (e.g. the individual attempts behind a parallel / multi-attempt / failover consolidation). For a leaf run this equals TokensCacheRead. Use this (not TokensCacheRead) when aggregating cache reads up a prompt-run or agent-run hierarchy so fan-out provider calls are not under-counted.` }),
22106
+ __metadata("design:type", Number)
22107
+ ], MJAIPromptRun_.prototype, "TokensCacheReadRollup", void 0);
22108
+ __decorate([
22109
+ Field(() => Int, { nullable: true, description: `Rollup of TokensCacheWrite across this prompt run and all of its descendant prompt runs. For a leaf run this equals TokensCacheWrite. Mirrors TokensUsedRollup/TokensPromptRollup; populated for providers that report cache writes (e.g. Anthropic), otherwise 0 or NULL.` }),
22110
+ __metadata("design:type", Number)
22111
+ ], MJAIPromptRun_.prototype, "TokensCacheWriteRollup", void 0);
22027
22112
  __decorate([
22028
22113
  Field(),
22029
22114
  MaxLength(255),
@@ -22455,6 +22540,22 @@ __decorate([
22455
22540
  Field({ nullable: true }),
22456
22541
  __metadata("design:type", String)
22457
22542
  ], CreateMJAIPromptRunInput.prototype, "AssistantPrefill", void 0);
22543
+ __decorate([
22544
+ Field(() => Int, { nullable: true }),
22545
+ __metadata("design:type", Number)
22546
+ ], CreateMJAIPromptRunInput.prototype, "TokensCacheRead", void 0);
22547
+ __decorate([
22548
+ Field(() => Int, { nullable: true }),
22549
+ __metadata("design:type", Number)
22550
+ ], CreateMJAIPromptRunInput.prototype, "TokensCacheWrite", void 0);
22551
+ __decorate([
22552
+ Field(() => Int, { nullable: true }),
22553
+ __metadata("design:type", Number)
22554
+ ], CreateMJAIPromptRunInput.prototype, "TokensCacheReadRollup", void 0);
22555
+ __decorate([
22556
+ Field(() => Int, { nullable: true }),
22557
+ __metadata("design:type", Number)
22558
+ ], CreateMJAIPromptRunInput.prototype, "TokensCacheWriteRollup", void 0);
22458
22559
  __decorate([
22459
22560
  Field(() => RestoreContextInput, { nullable: true }),
22460
22561
  __metadata("design:type", RestoreContextInput)
@@ -22800,6 +22901,22 @@ __decorate([
22800
22901
  Field({ nullable: true }),
22801
22902
  __metadata("design:type", String)
22802
22903
  ], UpdateMJAIPromptRunInput.prototype, "AssistantPrefill", void 0);
22904
+ __decorate([
22905
+ Field(() => Int, { nullable: true }),
22906
+ __metadata("design:type", Number)
22907
+ ], UpdateMJAIPromptRunInput.prototype, "TokensCacheRead", void 0);
22908
+ __decorate([
22909
+ Field(() => Int, { nullable: true }),
22910
+ __metadata("design:type", Number)
22911
+ ], UpdateMJAIPromptRunInput.prototype, "TokensCacheWrite", void 0);
22912
+ __decorate([
22913
+ Field(() => Int, { nullable: true }),
22914
+ __metadata("design:type", Number)
22915
+ ], UpdateMJAIPromptRunInput.prototype, "TokensCacheReadRollup", void 0);
22916
+ __decorate([
22917
+ Field(() => Int, { nullable: true }),
22918
+ __metadata("design:type", Number)
22919
+ ], UpdateMJAIPromptRunInput.prototype, "TokensCacheWriteRollup", void 0);
22803
22920
  __decorate([
22804
22921
  Field(() => [KeyValuePairInput], { nullable: true }),
22805
22922
  __metadata("design:type", Array)
@@ -28916,6 +29033,10 @@ __decorate([
28916
29033
  Field(() => [MJDashboardUserPreference_]),
28917
29034
  __metadata("design:type", Array)
28918
29035
  ], MJApplication_.prototype, "MJDashboardUserPreferences_ApplicationIDArray", void 0);
29036
+ __decorate([
29037
+ Field(() => [MJConversation_]),
29038
+ __metadata("design:type", Array)
29039
+ ], MJApplication_.prototype, "MJConversations_ApplicationIDArray", void 0);
28919
29040
  MJApplication_ = __decorate([
28920
29041
  ObjectType({ description: `Applications are used to group entities in the user interface for ease of user access` })
28921
29042
  ], MJApplication_);
@@ -29193,6 +29314,14 @@ let MJApplicationResolver = class MJApplicationResolver extends ResolverBase {
29193
29314
  const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Dashboard User Preferences', rows, this.GetUserFromPayload(userPayload));
29194
29315
  return result;
29195
29316
  }
29317
+ async MJConversations_ApplicationIDArray(mjapplication_, { userPayload, providers }, pubSub) {
29318
+ this.CheckUserReadPermissions('MJ: Conversations', userPayload);
29319
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
29320
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwConversations')} WHERE ${provider.QuoteIdentifier('ApplicationID')}='${mjapplication_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Conversations', userPayload, EntityPermissionType.Read, 'AND');
29321
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
29322
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Conversations', rows, this.GetUserFromPayload(userPayload));
29323
+ return result;
29324
+ }
29196
29325
  async CreateMJApplication(input, { providers, userPayload }, pubSub) {
29197
29326
  const provider = GetReadWriteProvider(providers);
29198
29327
  return this.CreateRecord('MJ: Applications', input, provider, userPayload, pubSub);
@@ -29305,6 +29434,15 @@ __decorate([
29305
29434
  __metadata("design:paramtypes", [MJApplication_, Object, PubSubEngine]),
29306
29435
  __metadata("design:returntype", Promise)
29307
29436
  ], MJApplicationResolver.prototype, "MJDashboardUserPreferences_ApplicationIDArray", null);
29437
+ __decorate([
29438
+ FieldResolver(() => [MJConversation_]),
29439
+ __param(0, Root()),
29440
+ __param(1, Ctx()),
29441
+ __param(2, PubSub()),
29442
+ __metadata("design:type", Function),
29443
+ __metadata("design:paramtypes", [MJApplication_, Object, PubSubEngine]),
29444
+ __metadata("design:returntype", Promise)
29445
+ ], MJApplicationResolver.prototype, "MJConversations_ApplicationIDArray", null);
29308
29446
  __decorate([
29309
29447
  Mutation(() => MJApplication_),
29310
29448
  __param(0, Arg('input', () => CreateMJApplicationInput)),
@@ -31688,8 +31826,9 @@ __decorate([
31688
31826
  __metadata("design:type", Date)
31689
31827
  ], MJArtifactUse_.prototype, "_mj__UpdatedAt", void 0);
31690
31828
  __decorate([
31691
- Field(() => Int),
31692
- __metadata("design:type", Number)
31829
+ Field({ nullable: true }),
31830
+ MaxLength(255),
31831
+ __metadata("design:type", String)
31693
31832
  ], MJArtifactUse_.prototype, "ArtifactVersion", void 0);
31694
31833
  __decorate([
31695
31834
  Field(),
@@ -31954,8 +32093,9 @@ __decorate([
31954
32093
  __metadata("design:type", Date)
31955
32094
  ], MJArtifactVersionAttribute_.prototype, "_mj__UpdatedAt", void 0);
31956
32095
  __decorate([
31957
- Field(() => Int),
31958
- __metadata("design:type", Number)
32096
+ Field({ nullable: true }),
32097
+ MaxLength(255),
32098
+ __metadata("design:type", String)
31959
32099
  ], MJArtifactVersionAttribute_.prototype, "ArtifactVersion", void 0);
31960
32100
  MJArtifactVersionAttribute_ = __decorate([
31961
32101
  ObjectType({ description: `Stores extracted attribute values from artifact content based on ArtifactType ExtractRules. Prevents re-running extraction logic on every access.` })
@@ -34382,8 +34522,9 @@ __decorate([
34382
34522
  __metadata("design:type", String)
34383
34523
  ], MJCollectionArtifact_.prototype, "Collection", void 0);
34384
34524
  __decorate([
34385
- Field(() => Int),
34386
- __metadata("design:type", Number)
34525
+ Field({ nullable: true }),
34526
+ MaxLength(255),
34527
+ __metadata("design:type", String)
34387
34528
  ], MJCollectionArtifact_.prototype, "ArtifactVersion", void 0);
34388
34529
  MJCollectionArtifact_ = __decorate([
34389
34530
  ObjectType({ description: `Links collections to specific artifact versions. Each collection can contain multiple versions of the same artifact.` })
@@ -41552,6 +41693,10 @@ __decorate([
41552
41693
  Field(() => [MJComponentDependency_]),
41553
41694
  __metadata("design:type", Array)
41554
41695
  ], MJComponent_.prototype, "MJComponentDependencies_DependencyComponentIDArray", void 0);
41696
+ __decorate([
41697
+ Field(() => [MJEntityFormOverride_]),
41698
+ __metadata("design:type", Array)
41699
+ ], MJComponent_.prototype, "MJEntityFormOverrides_ComponentIDArray", void 0);
41555
41700
  MJComponent_ = __decorate([
41556
41701
  ObjectType({ description: `Main catalog of reusable components with versioning and registry support` })
41557
41702
  ], MJComponent_);
@@ -41885,6 +42030,14 @@ let MJComponentResolver = class MJComponentResolver extends ResolverBase {
41885
42030
  const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Component Dependencies', rows, this.GetUserFromPayload(userPayload));
41886
42031
  return result;
41887
42032
  }
42033
+ async MJEntityFormOverrides_ComponentIDArray(mjcomponent_, { userPayload, providers }, pubSub) {
42034
+ this.CheckUserReadPermissions('MJ: Entity Form Overrides', userPayload);
42035
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
42036
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwEntityFormOverrides')} WHERE ${provider.QuoteIdentifier('ComponentID')}='${mjcomponent_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Entity Form Overrides', userPayload, EntityPermissionType.Read, 'AND');
42037
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
42038
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Entity Form Overrides', rows, this.GetUserFromPayload(userPayload));
42039
+ return result;
42040
+ }
41888
42041
  async CreateMJComponent(input, { providers, userPayload }, pubSub) {
41889
42042
  const provider = GetReadWriteProvider(providers);
41890
42043
  return this.CreateRecord('MJ: Components', input, provider, userPayload, pubSub);
@@ -41962,6 +42115,15 @@ __decorate([
41962
42115
  __metadata("design:paramtypes", [MJComponent_, Object, PubSubEngine]),
41963
42116
  __metadata("design:returntype", Promise)
41964
42117
  ], MJComponentResolver.prototype, "MJComponentDependencies_DependencyComponentIDArray", null);
42118
+ __decorate([
42119
+ FieldResolver(() => [MJEntityFormOverride_]),
42120
+ __param(0, Root()),
42121
+ __param(1, Ctx()),
42122
+ __param(2, PubSub()),
42123
+ __metadata("design:type", Function),
42124
+ __metadata("design:paramtypes", [MJComponent_, Object, PubSubEngine]),
42125
+ __metadata("design:returntype", Promise)
42126
+ ], MJComponentResolver.prototype, "MJEntityFormOverrides_ComponentIDArray", null);
41965
42127
  __decorate([
41966
42128
  Mutation(() => MJComponent_),
41967
42129
  __param(0, Arg('input', () => CreateMJComponentInput)),
@@ -47487,8 +47649,9 @@ __decorate([
47487
47649
  __metadata("design:type", String)
47488
47650
  ], MJConversationDetailArtifact_.prototype, "ConversationDetail", void 0);
47489
47651
  __decorate([
47490
- Field(() => Int),
47491
- __metadata("design:type", Number)
47652
+ Field({ nullable: true }),
47653
+ MaxLength(255),
47654
+ __metadata("design:type", String)
47492
47655
  ], MJConversationDetailArtifact_.prototype, "ArtifactVersion", void 0);
47493
47656
  MJConversationDetailArtifact_ = __decorate([
47494
47657
  ObjectType({ description: `Junction table tracking many-to-many relationship between conversation messages and artifact versions, with directionality tracking` })
@@ -47792,11 +47955,12 @@ __decorate([
47792
47955
  __metadata("design:type", String)
47793
47956
  ], MJConversationDetailAttachment_.prototype, "File", void 0);
47794
47957
  __decorate([
47795
- Field(() => Int, { nullable: true }),
47796
- __metadata("design:type", Number)
47958
+ Field({ nullable: true }),
47959
+ MaxLength(255),
47960
+ __metadata("design:type", String)
47797
47961
  ], MJConversationDetailAttachment_.prototype, "ArtifactVersion", void 0);
47798
47962
  MJConversationDetailAttachment_ = __decorate([
47799
- ObjectType({ description: `Stores attachments (images, videos, audio, documents) for conversation messages. Supports both inline base64 storage for small files and reference to MJStorage for large files.` })
47963
+ ObjectType({ description: `DEPRECATED: file uploads now flow through ConversationArtifactVersion so they share storage, identity, versioning, permissions, and the artifact-tool dispatch path. Table, generated entity class, GraphQL types, and stored procedures all remain functional — runtime use produces a console warning per the framework\'s standard handling of Status=\'Deprecated\'. See packages/AI/Agents/docs/ARTIFACT_TOOLS_GUIDE.md for migration guidance. Originally: Stores attachments (images, videos, audio, documents) for conversation messages.` })
47800
47964
  ], MJConversationDetailAttachment_);
47801
47965
  export { MJConversationDetailAttachment_ };
47802
47966
  //****************************************************************************
@@ -49116,12 +49280,12 @@ __decorate([
49116
49280
  __metadata("design:type", Boolean)
49117
49281
  ], MJConversation_.prototype, "IsArchived", void 0);
49118
49282
  __decorate([
49119
- Field({ nullable: true }),
49283
+ Field({ nullable: true, description: `Generic 'what is this conversation about?' pointer. Names the Entity whose record this conversation references (e.g. MJ: Components when the conversation was started in the Form Builder cockpit about a specific form). Paired with LinkedRecordID via the CK_Conversation_LinkBinding cross-column CHECK — both NULL or both populated. Surfaces use this to filter their conversation list to entries about the currently-loaded record (e.g. 'show prior conversations about THIS form'). Reusable beyond Form Builder by any future dashboard / record-context surface that wants the same UX without further schema work.` }),
49120
49284
  MaxLength(36),
49121
49285
  __metadata("design:type", String)
49122
49286
  ], MJConversation_.prototype, "LinkedEntityID", void 0);
49123
49287
  __decorate([
49124
- Field({ nullable: true, description: `ID of a related record this conversation is about (support ticket, order, etc.).` }),
49288
+ Field({ nullable: true, description: `The primary key of the record this conversation is about, serialized as a string so any entity type can be referenced regardless of its PK shape (UUID, int, composite). Used together with LinkedEntityID — see CK_Conversation_LinkBinding. Wide enough (NVARCHAR(500) in the baseline schema) to handle chunky composite keys. Surfaces query by (LinkedEntityID, LinkedRecordID) — or by LinkedRecordID IN (...) when a lineage of records shares conversation context (e.g. multiple Component versions of the same form lineage).` }),
49125
49289
  MaxLength(500),
49126
49290
  __metadata("design:type", String)
49127
49291
  ], MJConversation_.prototype, "LinkedRecordID", void 0);
@@ -49162,6 +49326,25 @@ __decorate([
49162
49326
  MaxLength(36),
49163
49327
  __metadata("design:type", String)
49164
49328
  ], MJConversation_.prototype, "TestRunID", void 0);
49329
+ __decorate([
49330
+ Field({ description: `Controls where this conversation surfaces in the UI. Global = appears in the main Chat app (no application binding). Application = scoped to a specific Application's embedded chat surface (e.g. the Form Builder cockpit); hidden from the main chat list by default. Both = explicitly promoted to appear in BOTH the main chat list and the bound Application's embedded surface. Defaults to Global so pre-existing conversations stay visible in main chat. Paired with ApplicationID via a cross-column CHECK constraint: Global => ApplicationID IS NULL; Application or Both => ApplicationID IS NOT NULL.` }),
49331
+ MaxLength(20),
49332
+ __metadata("design:type", String)
49333
+ ], MJConversation_.prototype, "ApplicationScope", void 0);
49334
+ __decorate([
49335
+ Field({ nullable: true, description: `Optional Application this conversation is bound to. Required when ApplicationScope is 'Application' or 'Both'; must be NULL when ApplicationScope is 'Global'. Enforced by the CK_Conversation_ScopeAppBinding cross-column CHECK. Used by embedded chat surfaces (e.g. the Form Builder cockpit) to filter their conversation list to just their own application's conversations.` }),
49336
+ MaxLength(36),
49337
+ __metadata("design:type", String)
49338
+ ], MJConversation_.prototype, "ApplicationID", void 0);
49339
+ __decorate([
49340
+ Field({ nullable: true, description: `Optional per-conversation default AI agent. When set, the message router targets this agent for non-mention, non-continuity messages instead of falling through to the embedder-supplied default (e.g. Form Builder) or to Sage. Lets a user pin a conversation to a specific specialist agent (e.g. Research Agent) so Sage is never invoked for that thread. Routing precedence: @mention > continuity (last responder) > Conversation.DefaultAgentID > embedder's defaultAgentId input > Sage fallback.` }),
49341
+ MaxLength(36),
49342
+ __metadata("design:type", String)
49343
+ ], MJConversation_.prototype, "DefaultAgentID", void 0);
49344
+ __decorate([
49345
+ Field({ nullable: true, description: `Free-form JSON extensibility column. Apps that want to attach conversation-scoped metadata (UI state, draft notes, custom analytics tags, etc.) can stuff it here without a schema change. **Namespace your keys** to avoid collisions across apps — store e.g. {"form-builder.lastPreviewRecordId":"...","my-app.fooFlag":true} rather than top-level lastPreviewRecordId. Core MJ code paths do NOT read this column; it's purely for downstream apps. NVARCHAR(MAX) so callers can store arbitrarily large blobs, but treat that as a smell — heavy data belongs in a real entity, not a JSON dump.` }),
49346
+ __metadata("design:type", String)
49347
+ ], MJConversation_.prototype, "AdditionalData", void 0);
49165
49348
  __decorate([
49166
49349
  Field(),
49167
49350
  MaxLength(100),
@@ -49192,6 +49375,16 @@ __decorate([
49192
49375
  MaxLength(255),
49193
49376
  __metadata("design:type", String)
49194
49377
  ], MJConversation_.prototype, "TestRun", void 0);
49378
+ __decorate([
49379
+ Field({ nullable: true }),
49380
+ MaxLength(100),
49381
+ __metadata("design:type", String)
49382
+ ], MJConversation_.prototype, "Application", void 0);
49383
+ __decorate([
49384
+ Field({ nullable: true }),
49385
+ MaxLength(255),
49386
+ __metadata("design:type", String)
49387
+ ], MJConversation_.prototype, "DefaultAgent", void 0);
49195
49388
  __decorate([
49196
49389
  Field(() => [MJConversationDetail_]),
49197
49390
  __metadata("design:type", Array)
@@ -49285,6 +49478,22 @@ __decorate([
49285
49478
  Field({ nullable: true }),
49286
49479
  __metadata("design:type", String)
49287
49480
  ], CreateMJConversationInput.prototype, "TestRunID", void 0);
49481
+ __decorate([
49482
+ Field({ nullable: true }),
49483
+ __metadata("design:type", String)
49484
+ ], CreateMJConversationInput.prototype, "ApplicationScope", void 0);
49485
+ __decorate([
49486
+ Field({ nullable: true }),
49487
+ __metadata("design:type", String)
49488
+ ], CreateMJConversationInput.prototype, "ApplicationID", void 0);
49489
+ __decorate([
49490
+ Field({ nullable: true }),
49491
+ __metadata("design:type", String)
49492
+ ], CreateMJConversationInput.prototype, "DefaultAgentID", void 0);
49493
+ __decorate([
49494
+ Field({ nullable: true }),
49495
+ __metadata("design:type", String)
49496
+ ], CreateMJConversationInput.prototype, "AdditionalData", void 0);
49288
49497
  __decorate([
49289
49498
  Field(() => RestoreContextInput, { nullable: true }),
49290
49499
  __metadata("design:type", RestoreContextInput)
@@ -49358,6 +49567,22 @@ __decorate([
49358
49567
  Field({ nullable: true }),
49359
49568
  __metadata("design:type", String)
49360
49569
  ], UpdateMJConversationInput.prototype, "TestRunID", void 0);
49570
+ __decorate([
49571
+ Field({ nullable: true }),
49572
+ __metadata("design:type", String)
49573
+ ], UpdateMJConversationInput.prototype, "ApplicationScope", void 0);
49574
+ __decorate([
49575
+ Field({ nullable: true }),
49576
+ __metadata("design:type", String)
49577
+ ], UpdateMJConversationInput.prototype, "ApplicationID", void 0);
49578
+ __decorate([
49579
+ Field({ nullable: true }),
49580
+ __metadata("design:type", String)
49581
+ ], UpdateMJConversationInput.prototype, "DefaultAgentID", void 0);
49582
+ __decorate([
49583
+ Field({ nullable: true }),
49584
+ __metadata("design:type", String)
49585
+ ], UpdateMJConversationInput.prototype, "AdditionalData", void 0);
49361
49586
  __decorate([
49362
49587
  Field(() => [KeyValuePairInput], { nullable: true }),
49363
49588
  __metadata("design:type", Array)
@@ -58738,6 +58963,10 @@ __decorate([
58738
58963
  Field(() => [MJTestRun_]),
58739
58964
  __metadata("design:type", Array)
58740
58965
  ], MJEntity_.prototype, "MJTestRuns_TargetLogEntityIDArray", void 0);
58966
+ __decorate([
58967
+ Field(() => [MJEntityFormOverride_]),
58968
+ __metadata("design:type", Array)
58969
+ ], MJEntity_.prototype, "MJEntityFormOverrides_EntityIDArray", void 0);
58741
58970
  MJEntity_ = __decorate([
58742
58971
  ObjectType({ description: `Catalog of all entities across all schemas` })
58743
58972
  ], MJEntity_);
@@ -59799,6 +60028,14 @@ let MJEntityResolverBase = class MJEntityResolverBase extends ResolverBase {
59799
60028
  const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Test Runs', rows, this.GetUserFromPayload(userPayload));
59800
60029
  return result;
59801
60030
  }
60031
+ async MJEntityFormOverrides_EntityIDArray(mjentity_, { userPayload, providers }, pubSub) {
60032
+ this.CheckUserReadPermissions('MJ: Entity Form Overrides', userPayload);
60033
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
60034
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwEntityFormOverrides')} WHERE ${provider.QuoteIdentifier('EntityID')}='${mjentity_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Entity Form Overrides', userPayload, EntityPermissionType.Read, 'AND');
60035
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
60036
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Entity Form Overrides', rows, this.GetUserFromPayload(userPayload));
60037
+ return result;
60038
+ }
59802
60039
  async CreateMJEntity(input, { providers, userPayload }, pubSub) {
59803
60040
  const provider = GetReadWriteProvider(providers);
59804
60041
  return this.CreateRecord('MJ: Entities', input, provider, userPayload, pubSub);
@@ -60388,6 +60625,15 @@ __decorate([
60388
60625
  __metadata("design:paramtypes", [MJEntity_, Object, PubSubEngine]),
60389
60626
  __metadata("design:returntype", Promise)
60390
60627
  ], MJEntityResolverBase.prototype, "MJTestRuns_TargetLogEntityIDArray", null);
60628
+ __decorate([
60629
+ FieldResolver(() => [MJEntityFormOverride_]),
60630
+ __param(0, Root()),
60631
+ __param(1, Ctx()),
60632
+ __param(2, PubSub()),
60633
+ __metadata("design:type", Function),
60634
+ __metadata("design:paramtypes", [MJEntity_, Object, PubSubEngine]),
60635
+ __metadata("design:returntype", Promise)
60636
+ ], MJEntityResolverBase.prototype, "MJEntityFormOverrides_EntityIDArray", null);
60391
60637
  __decorate([
60392
60638
  Mutation(() => MJEntity_),
60393
60639
  __param(0, Arg('input', () => CreateMJEntityInput)),
@@ -64275,7 +64521,7 @@ __decorate([
64275
64521
  __metadata("design:type", String)
64276
64522
  ], MJEntityField_.prototype, "ValueListType", void 0);
64277
64523
  __decorate([
64278
- Field({ nullable: true, description: `Defines extended behaviors for a field such as for Email, Web URLs, Code, etc.` }),
64524
+ Field({ nullable: true, description: `Defines extended behaviors for a field such as Email, Web URLs, Code, Markdown, HTML, and Icon. When set to 'Icon', the field's values are treated as icon CSS classes (e.g. Font Awesome) for per-row display in the UI.` }),
64279
64525
  MaxLength(50),
64280
64526
  __metadata("design:type", String)
64281
64527
  ], MJEntityField_.prototype, "ExtendedType", void 0);
@@ -65154,6 +65400,354 @@ MJEntityFieldResolver = __decorate([
65154
65400
  ], MJEntityFieldResolver);
65155
65401
  export { MJEntityFieldResolver };
65156
65402
  //****************************************************************************
65403
+ // ENTITY CLASS for MJ: Entity Form Overrides
65404
+ //****************************************************************************
65405
+ let MJEntityFormOverride_ = class MJEntityFormOverride_ {
65406
+ };
65407
+ __decorate([
65408
+ Field(),
65409
+ MaxLength(36),
65410
+ __metadata("design:type", String)
65411
+ ], MJEntityFormOverride_.prototype, "ID", void 0);
65412
+ __decorate([
65413
+ Field({ description: `Foreign key to Entity — which entity this override is for.` }),
65414
+ MaxLength(36),
65415
+ __metadata("design:type", String)
65416
+ ], MJEntityFormOverride_.prototype, "EntityID", void 0);
65417
+ __decorate([
65418
+ Field({ description: `Foreign key to Component — the component that renders the form. Must declare componentRole='form' and implement the FormHostProps contract.` }),
65419
+ MaxLength(36),
65420
+ __metadata("design:type", String)
65421
+ ], MJEntityFormOverride_.prototype, "ComponentID", void 0);
65422
+ __decorate([
65423
+ Field({ description: `Human-readable label for this override (e.g., "CSR Customer Form", "Compact Mobile Variant").` }),
65424
+ MaxLength(255),
65425
+ __metadata("design:type", String)
65426
+ ], MJEntityFormOverride_.prototype, "Name", void 0);
65427
+ __decorate([
65428
+ Field({ nullable: true, description: `Optional longer description of what this override is for and when it applies.` }),
65429
+ __metadata("design:type", String)
65430
+ ], MJEntityFormOverride_.prototype, "Description", void 0);
65431
+ __decorate([
65432
+ Field({ description: `Resolution tier: User (requires UserID), Role (requires RoleID), or Global. The resolver evaluates in that order — a User row beats a Role row beats a Global row.` }),
65433
+ MaxLength(20),
65434
+ __metadata("design:type", String)
65435
+ ], MJEntityFormOverride_.prototype, "Scope", void 0);
65436
+ __decorate([
65437
+ Field({ nullable: true, description: `Required when Scope='User'. The single user this override applies to.` }),
65438
+ MaxLength(36),
65439
+ __metadata("design:type", String)
65440
+ ], MJEntityFormOverride_.prototype, "UserID", void 0);
65441
+ __decorate([
65442
+ Field({ nullable: true, description: `Required when Scope='Role'. The role whose members see this override.` }),
65443
+ MaxLength(36),
65444
+ __metadata("design:type", String)
65445
+ ], MJEntityFormOverride_.prototype, "RoleID", void 0);
65446
+ __decorate([
65447
+ Field(() => Int, { description: `Higher value wins within a scope tier. Ties broken by __mj_CreatedAt DESC. No IsDefault — Priority is the only mechanism.` }),
65448
+ __metadata("design:type", Number)
65449
+ ], MJEntityFormOverride_.prototype, "Priority", void 0);
65450
+ __decorate([
65451
+ Field({ description: `Active = eligible for resolution. Inactive = ignored. Pending = AI-authored, awaiting human activation (resolver treats as Inactive).` }),
65452
+ MaxLength(20),
65453
+ __metadata("design:type", String)
65454
+ ], MJEntityFormOverride_.prototype, "Status", void 0);
65455
+ __decorate([
65456
+ Field({ nullable: true, description: `Optional free-form commentary about this override — e.g. who authored it, why it exists, what should change before it goes Global, links to related discussions. Does not affect resolution.` }),
65457
+ __metadata("design:type", String)
65458
+ ], MJEntityFormOverride_.prototype, "Notes", void 0);
65459
+ __decorate([
65460
+ Field(),
65461
+ __metadata("design:type", Date)
65462
+ ], MJEntityFormOverride_.prototype, "_mj__CreatedAt", void 0);
65463
+ __decorate([
65464
+ Field(),
65465
+ __metadata("design:type", Date)
65466
+ ], MJEntityFormOverride_.prototype, "_mj__UpdatedAt", void 0);
65467
+ __decorate([
65468
+ Field(),
65469
+ MaxLength(255),
65470
+ __metadata("design:type", String)
65471
+ ], MJEntityFormOverride_.prototype, "Entity", void 0);
65472
+ __decorate([
65473
+ Field(),
65474
+ MaxLength(500),
65475
+ __metadata("design:type", String)
65476
+ ], MJEntityFormOverride_.prototype, "Component", void 0);
65477
+ __decorate([
65478
+ Field({ nullable: true }),
65479
+ MaxLength(100),
65480
+ __metadata("design:type", String)
65481
+ ], MJEntityFormOverride_.prototype, "User", void 0);
65482
+ __decorate([
65483
+ Field({ nullable: true }),
65484
+ MaxLength(50),
65485
+ __metadata("design:type", String)
65486
+ ], MJEntityFormOverride_.prototype, "Role", void 0);
65487
+ MJEntityFormOverride_ = __decorate([
65488
+ ObjectType({ description: `Points an Entity at a Component to serve as its form at runtime. Scoped to User > Role > Global with priority-based resolution. When present and Active, takes precedence over the entity\'s @RegisterClass-registered or CodeGen-generated Angular form.` })
65489
+ ], MJEntityFormOverride_);
65490
+ export { MJEntityFormOverride_ };
65491
+ //****************************************************************************
65492
+ // INPUT TYPE for MJ: Entity Form Overrides
65493
+ //****************************************************************************
65494
+ let CreateMJEntityFormOverrideInput = class CreateMJEntityFormOverrideInput {
65495
+ };
65496
+ __decorate([
65497
+ Field({ nullable: true }),
65498
+ __metadata("design:type", String)
65499
+ ], CreateMJEntityFormOverrideInput.prototype, "ID", void 0);
65500
+ __decorate([
65501
+ Field({ nullable: true }),
65502
+ __metadata("design:type", String)
65503
+ ], CreateMJEntityFormOverrideInput.prototype, "EntityID", void 0);
65504
+ __decorate([
65505
+ Field({ nullable: true }),
65506
+ __metadata("design:type", String)
65507
+ ], CreateMJEntityFormOverrideInput.prototype, "ComponentID", void 0);
65508
+ __decorate([
65509
+ Field({ nullable: true }),
65510
+ __metadata("design:type", String)
65511
+ ], CreateMJEntityFormOverrideInput.prototype, "Name", void 0);
65512
+ __decorate([
65513
+ Field({ nullable: true }),
65514
+ __metadata("design:type", String)
65515
+ ], CreateMJEntityFormOverrideInput.prototype, "Description", void 0);
65516
+ __decorate([
65517
+ Field({ nullable: true }),
65518
+ __metadata("design:type", String)
65519
+ ], CreateMJEntityFormOverrideInput.prototype, "Scope", void 0);
65520
+ __decorate([
65521
+ Field({ nullable: true }),
65522
+ __metadata("design:type", String)
65523
+ ], CreateMJEntityFormOverrideInput.prototype, "UserID", void 0);
65524
+ __decorate([
65525
+ Field({ nullable: true }),
65526
+ __metadata("design:type", String)
65527
+ ], CreateMJEntityFormOverrideInput.prototype, "RoleID", void 0);
65528
+ __decorate([
65529
+ Field(() => Int, { nullable: true }),
65530
+ __metadata("design:type", Number)
65531
+ ], CreateMJEntityFormOverrideInput.prototype, "Priority", void 0);
65532
+ __decorate([
65533
+ Field({ nullable: true }),
65534
+ __metadata("design:type", String)
65535
+ ], CreateMJEntityFormOverrideInput.prototype, "Status", void 0);
65536
+ __decorate([
65537
+ Field({ nullable: true }),
65538
+ __metadata("design:type", String)
65539
+ ], CreateMJEntityFormOverrideInput.prototype, "Notes", void 0);
65540
+ __decorate([
65541
+ Field(() => RestoreContextInput, { nullable: true }),
65542
+ __metadata("design:type", RestoreContextInput)
65543
+ ], CreateMJEntityFormOverrideInput.prototype, "RestoreContext___", void 0);
65544
+ CreateMJEntityFormOverrideInput = __decorate([
65545
+ InputType()
65546
+ ], CreateMJEntityFormOverrideInput);
65547
+ export { CreateMJEntityFormOverrideInput };
65548
+ //****************************************************************************
65549
+ // INPUT TYPE for MJ: Entity Form Overrides
65550
+ //****************************************************************************
65551
+ let UpdateMJEntityFormOverrideInput = class UpdateMJEntityFormOverrideInput {
65552
+ };
65553
+ __decorate([
65554
+ Field(),
65555
+ __metadata("design:type", String)
65556
+ ], UpdateMJEntityFormOverrideInput.prototype, "ID", void 0);
65557
+ __decorate([
65558
+ Field({ nullable: true }),
65559
+ __metadata("design:type", String)
65560
+ ], UpdateMJEntityFormOverrideInput.prototype, "EntityID", void 0);
65561
+ __decorate([
65562
+ Field({ nullable: true }),
65563
+ __metadata("design:type", String)
65564
+ ], UpdateMJEntityFormOverrideInput.prototype, "ComponentID", void 0);
65565
+ __decorate([
65566
+ Field({ nullable: true }),
65567
+ __metadata("design:type", String)
65568
+ ], UpdateMJEntityFormOverrideInput.prototype, "Name", void 0);
65569
+ __decorate([
65570
+ Field({ nullable: true }),
65571
+ __metadata("design:type", String)
65572
+ ], UpdateMJEntityFormOverrideInput.prototype, "Description", void 0);
65573
+ __decorate([
65574
+ Field({ nullable: true }),
65575
+ __metadata("design:type", String)
65576
+ ], UpdateMJEntityFormOverrideInput.prototype, "Scope", void 0);
65577
+ __decorate([
65578
+ Field({ nullable: true }),
65579
+ __metadata("design:type", String)
65580
+ ], UpdateMJEntityFormOverrideInput.prototype, "UserID", void 0);
65581
+ __decorate([
65582
+ Field({ nullable: true }),
65583
+ __metadata("design:type", String)
65584
+ ], UpdateMJEntityFormOverrideInput.prototype, "RoleID", void 0);
65585
+ __decorate([
65586
+ Field(() => Int, { nullable: true }),
65587
+ __metadata("design:type", Number)
65588
+ ], UpdateMJEntityFormOverrideInput.prototype, "Priority", void 0);
65589
+ __decorate([
65590
+ Field({ nullable: true }),
65591
+ __metadata("design:type", String)
65592
+ ], UpdateMJEntityFormOverrideInput.prototype, "Status", void 0);
65593
+ __decorate([
65594
+ Field({ nullable: true }),
65595
+ __metadata("design:type", String)
65596
+ ], UpdateMJEntityFormOverrideInput.prototype, "Notes", void 0);
65597
+ __decorate([
65598
+ Field(() => [KeyValuePairInput], { nullable: true }),
65599
+ __metadata("design:type", Array)
65600
+ ], UpdateMJEntityFormOverrideInput.prototype, "OldValues___", void 0);
65601
+ __decorate([
65602
+ Field(() => RestoreContextInput, { nullable: true }),
65603
+ __metadata("design:type", RestoreContextInput)
65604
+ ], UpdateMJEntityFormOverrideInput.prototype, "RestoreContext___", void 0);
65605
+ UpdateMJEntityFormOverrideInput = __decorate([
65606
+ InputType()
65607
+ ], UpdateMJEntityFormOverrideInput);
65608
+ export { UpdateMJEntityFormOverrideInput };
65609
+ //****************************************************************************
65610
+ // RESOLVER for MJ: Entity Form Overrides
65611
+ //****************************************************************************
65612
+ let RunMJEntityFormOverrideViewResult = class RunMJEntityFormOverrideViewResult {
65613
+ };
65614
+ __decorate([
65615
+ Field(() => [MJEntityFormOverride_]),
65616
+ __metadata("design:type", Array)
65617
+ ], RunMJEntityFormOverrideViewResult.prototype, "Results", void 0);
65618
+ __decorate([
65619
+ Field(() => String, { nullable: true }),
65620
+ __metadata("design:type", String)
65621
+ ], RunMJEntityFormOverrideViewResult.prototype, "UserViewRunID", void 0);
65622
+ __decorate([
65623
+ Field(() => Int, { nullable: true }),
65624
+ __metadata("design:type", Number)
65625
+ ], RunMJEntityFormOverrideViewResult.prototype, "RowCount", void 0);
65626
+ __decorate([
65627
+ Field(() => Int, { nullable: true }),
65628
+ __metadata("design:type", Number)
65629
+ ], RunMJEntityFormOverrideViewResult.prototype, "TotalRowCount", void 0);
65630
+ __decorate([
65631
+ Field(() => Int, { nullable: true }),
65632
+ __metadata("design:type", Number)
65633
+ ], RunMJEntityFormOverrideViewResult.prototype, "ExecutionTime", void 0);
65634
+ __decorate([
65635
+ Field({ nullable: true }),
65636
+ __metadata("design:type", String)
65637
+ ], RunMJEntityFormOverrideViewResult.prototype, "ErrorMessage", void 0);
65638
+ __decorate([
65639
+ Field(() => Boolean, { nullable: false }),
65640
+ __metadata("design:type", Boolean)
65641
+ ], RunMJEntityFormOverrideViewResult.prototype, "Success", void 0);
65642
+ RunMJEntityFormOverrideViewResult = __decorate([
65643
+ ObjectType()
65644
+ ], RunMJEntityFormOverrideViewResult);
65645
+ export { RunMJEntityFormOverrideViewResult };
65646
+ let MJEntityFormOverrideResolver = class MJEntityFormOverrideResolver extends ResolverBase {
65647
+ async RunMJEntityFormOverrideViewByID(input, { providers, userPayload }, pubSub) {
65648
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
65649
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
65650
+ }
65651
+ async RunMJEntityFormOverrideViewByName(input, { providers, userPayload }, pubSub) {
65652
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
65653
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
65654
+ }
65655
+ async RunMJEntityFormOverrideDynamicView(input, { providers, userPayload }, pubSub) {
65656
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
65657
+ input.EntityName = 'MJ: Entity Form Overrides';
65658
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
65659
+ }
65660
+ async MJEntityFormOverride(ID, { userPayload, providers }, pubSub) {
65661
+ this.CheckUserReadPermissions('MJ: Entity Form Overrides', userPayload);
65662
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
65663
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwEntityFormOverrides')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Entity Form Overrides', userPayload, EntityPermissionType.Read, 'AND');
65664
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
65665
+ const result = await this.MapFieldNamesToCodeNames('MJ: Entity Form Overrides', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
65666
+ return result;
65667
+ }
65668
+ async CreateMJEntityFormOverride(input, { providers, userPayload }, pubSub) {
65669
+ const provider = GetReadWriteProvider(providers);
65670
+ return this.CreateRecord('MJ: Entity Form Overrides', input, provider, userPayload, pubSub);
65671
+ }
65672
+ async UpdateMJEntityFormOverride(input, { providers, userPayload }, pubSub) {
65673
+ const provider = GetReadWriteProvider(providers);
65674
+ return this.UpdateRecord('MJ: Entity Form Overrides', input, provider, userPayload, pubSub);
65675
+ }
65676
+ async DeleteMJEntityFormOverride(ID, options, { providers, userPayload }, pubSub) {
65677
+ const provider = GetReadWriteProvider(providers);
65678
+ const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
65679
+ return this.DeleteRecord('MJ: Entity Form Overrides', key, options, provider, userPayload, pubSub);
65680
+ }
65681
+ };
65682
+ __decorate([
65683
+ Query(() => RunMJEntityFormOverrideViewResult),
65684
+ __param(0, Arg('input', () => RunViewByIDInput)),
65685
+ __param(1, Ctx()),
65686
+ __param(2, PubSub()),
65687
+ __metadata("design:type", Function),
65688
+ __metadata("design:paramtypes", [RunViewByIDInput, Object, PubSubEngine]),
65689
+ __metadata("design:returntype", Promise)
65690
+ ], MJEntityFormOverrideResolver.prototype, "RunMJEntityFormOverrideViewByID", null);
65691
+ __decorate([
65692
+ Query(() => RunMJEntityFormOverrideViewResult),
65693
+ __param(0, Arg('input', () => RunViewByNameInput)),
65694
+ __param(1, Ctx()),
65695
+ __param(2, PubSub()),
65696
+ __metadata("design:type", Function),
65697
+ __metadata("design:paramtypes", [RunViewByNameInput, Object, PubSubEngine]),
65698
+ __metadata("design:returntype", Promise)
65699
+ ], MJEntityFormOverrideResolver.prototype, "RunMJEntityFormOverrideViewByName", null);
65700
+ __decorate([
65701
+ Query(() => RunMJEntityFormOverrideViewResult),
65702
+ __param(0, Arg('input', () => RunDynamicViewInput)),
65703
+ __param(1, Ctx()),
65704
+ __param(2, PubSub()),
65705
+ __metadata("design:type", Function),
65706
+ __metadata("design:paramtypes", [RunDynamicViewInput, Object, PubSubEngine]),
65707
+ __metadata("design:returntype", Promise)
65708
+ ], MJEntityFormOverrideResolver.prototype, "RunMJEntityFormOverrideDynamicView", null);
65709
+ __decorate([
65710
+ Query(() => MJEntityFormOverride_, { nullable: true }),
65711
+ __param(0, Arg('ID', () => String)),
65712
+ __param(1, Ctx()),
65713
+ __param(2, PubSub()),
65714
+ __metadata("design:type", Function),
65715
+ __metadata("design:paramtypes", [String, Object, PubSubEngine]),
65716
+ __metadata("design:returntype", Promise)
65717
+ ], MJEntityFormOverrideResolver.prototype, "MJEntityFormOverride", null);
65718
+ __decorate([
65719
+ Mutation(() => MJEntityFormOverride_),
65720
+ __param(0, Arg('input', () => CreateMJEntityFormOverrideInput)),
65721
+ __param(1, Ctx()),
65722
+ __param(2, PubSub()),
65723
+ __metadata("design:type", Function),
65724
+ __metadata("design:paramtypes", [CreateMJEntityFormOverrideInput, Object, PubSubEngine]),
65725
+ __metadata("design:returntype", Promise)
65726
+ ], MJEntityFormOverrideResolver.prototype, "CreateMJEntityFormOverride", null);
65727
+ __decorate([
65728
+ Mutation(() => MJEntityFormOverride_),
65729
+ __param(0, Arg('input', () => UpdateMJEntityFormOverrideInput)),
65730
+ __param(1, Ctx()),
65731
+ __param(2, PubSub()),
65732
+ __metadata("design:type", Function),
65733
+ __metadata("design:paramtypes", [UpdateMJEntityFormOverrideInput, Object, PubSubEngine]),
65734
+ __metadata("design:returntype", Promise)
65735
+ ], MJEntityFormOverrideResolver.prototype, "UpdateMJEntityFormOverride", null);
65736
+ __decorate([
65737
+ Mutation(() => MJEntityFormOverride_),
65738
+ __param(0, Arg('ID', () => String)),
65739
+ __param(1, Arg('options___', () => DeleteOptionsInput)),
65740
+ __param(2, Ctx()),
65741
+ __param(3, PubSub()),
65742
+ __metadata("design:type", Function),
65743
+ __metadata("design:paramtypes", [String, DeleteOptionsInput, Object, PubSubEngine]),
65744
+ __metadata("design:returntype", Promise)
65745
+ ], MJEntityFormOverrideResolver.prototype, "DeleteMJEntityFormOverride", null);
65746
+ MJEntityFormOverrideResolver = __decorate([
65747
+ Resolver(MJEntityFormOverride_)
65748
+ ], MJEntityFormOverrideResolver);
65749
+ export { MJEntityFormOverrideResolver };
65750
+ //****************************************************************************
65157
65751
  // ENTITY CLASS for MJ: Entity Organic Key Related Entities
65158
65752
  //****************************************************************************
65159
65753
  let MJEntityOrganicKeyRelatedEntity_ = class MJEntityOrganicKeyRelatedEntity_ {
@@ -71739,6 +72333,11 @@ __decorate([
71739
72333
  Field(() => Boolean, { description: `When true, this field was dynamically discovered by IntrospectSchema and is not defined in static connector metadata.` }),
71740
72334
  __metadata("design:type", Boolean)
71741
72335
  ], MJIntegrationObjectField_.prototype, "IsCustom", void 0);
72336
+ __decorate([
72337
+ Field({ description: `Provenance of this IntegrationObjectField row: Declared (from static research/docs), Discovered (from runtime API introspection), Custom (customer-defined custom field, e.g., HubSpot custom property on standard object). Drives merge precedence — discovered/runtime wins for type/constraints; declared wins for description/label/sequence/category.` }),
72338
+ MaxLength(20),
72339
+ __metadata("design:type", String)
72340
+ ], MJIntegrationObjectField_.prototype, "MetadataSource", void 0);
71742
72341
  __decorate([
71743
72342
  Field(),
71744
72343
  MaxLength(255),
@@ -71846,6 +72445,10 @@ __decorate([
71846
72445
  Field(() => Boolean, { nullable: true }),
71847
72446
  __metadata("design:type", Boolean)
71848
72447
  ], CreateMJIntegrationObjectFieldInput.prototype, "IsCustom", void 0);
72448
+ __decorate([
72449
+ Field({ nullable: true }),
72450
+ __metadata("design:type", String)
72451
+ ], CreateMJIntegrationObjectFieldInput.prototype, "MetadataSource", void 0);
71849
72452
  __decorate([
71850
72453
  Field(() => RestoreContextInput, { nullable: true }),
71851
72454
  __metadata("design:type", RestoreContextInput)
@@ -71947,6 +72550,10 @@ __decorate([
71947
72550
  Field(() => Boolean, { nullable: true }),
71948
72551
  __metadata("design:type", Boolean)
71949
72552
  ], UpdateMJIntegrationObjectFieldInput.prototype, "IsCustom", void 0);
72553
+ __decorate([
72554
+ Field({ nullable: true }),
72555
+ __metadata("design:type", String)
72556
+ ], UpdateMJIntegrationObjectFieldInput.prototype, "MetadataSource", void 0);
71950
72557
  __decorate([
71951
72558
  Field(() => [KeyValuePairInput], { nullable: true }),
71952
72559
  __metadata("design:type", Array)
@@ -72209,6 +72816,73 @@ __decorate([
72209
72816
  Field(() => Boolean, { description: `When true, this object was dynamically discovered by IntrospectSchema and is not defined in static connector metadata.` }),
72210
72817
  __metadata("design:type", Boolean)
72211
72818
  ], MJIntegrationObject_.prototype, "IsCustom", void 0);
72819
+ __decorate([
72820
+ Field({ nullable: true, description: `HTTP path template for create operations. Generic CRUD in BaseRESTIntegrationConnector substitutes parent IDs into {var} placeholders. NULL means create not supported via metadata-driven path.` }),
72821
+ __metadata("design:type", String)
72822
+ ], MJIntegrationObject_.prototype, "CreateAPIPath", void 0);
72823
+ __decorate([
72824
+ Field({ nullable: true, description: `HTTP method for create (typically POST). NULL means create not supported via metadata-driven path.` }),
72825
+ MaxLength(20),
72826
+ __metadata("design:type", String)
72827
+ ], MJIntegrationObject_.prototype, "CreateMethod", void 0);
72828
+ __decorate([
72829
+ Field({ nullable: true, description: `Request body shape for create: flat (top-level fields), wrapped (under CreateBodyKey), or literal (connector overrides CreateRecord and supplies own body).` }),
72830
+ MaxLength(50),
72831
+ __metadata("design:type", String)
72832
+ ], MJIntegrationObject_.prototype, "CreateBodyShape", void 0);
72833
+ __decorate([
72834
+ Field({ nullable: true, description: `Wrapper key for create body when CreateBodyShape=wrapped. Example: 'member' for YourMembership which wraps body as {member:{...}}.` }),
72835
+ MaxLength(100),
72836
+ __metadata("design:type", String)
72837
+ ], MJIntegrationObject_.prototype, "CreateBodyKey", void 0);
72838
+ __decorate([
72839
+ Field({ nullable: true, description: `Where the created record ID is found in the create response: path (URL of returned Location header), body (parsed from JSON response), header (specific named header).` }),
72840
+ MaxLength(20),
72841
+ __metadata("design:type", String)
72842
+ ], MJIntegrationObject_.prototype, "CreateIDLocation", void 0);
72843
+ __decorate([
72844
+ Field({ nullable: true, description: `HTTP path template for update operations. Typically contains {ID} placeholder substituted with the record ExternalID at runtime.` }),
72845
+ __metadata("design:type", String)
72846
+ ], MJIntegrationObject_.prototype, "UpdateAPIPath", void 0);
72847
+ __decorate([
72848
+ Field({ nullable: true, description: `HTTP method for update (typically PATCH or PUT).` }),
72849
+ MaxLength(20),
72850
+ __metadata("design:type", String)
72851
+ ], MJIntegrationObject_.prototype, "UpdateMethod", void 0);
72852
+ __decorate([
72853
+ Field({ nullable: true, description: `Request body shape for update: flat | wrapped | literal. See CreateBodyShape.` }),
72854
+ MaxLength(50),
72855
+ __metadata("design:type", String)
72856
+ ], MJIntegrationObject_.prototype, "UpdateBodyShape", void 0);
72857
+ __decorate([
72858
+ Field({ nullable: true, description: `Wrapper key for update body when UpdateBodyShape=wrapped.` }),
72859
+ MaxLength(100),
72860
+ __metadata("design:type", String)
72861
+ ], MJIntegrationObject_.prototype, "UpdateBodyKey", void 0);
72862
+ __decorate([
72863
+ Field({ nullable: true, description: `For update: where the target record ID is located in the request — typically 'path' (substituted into UpdateAPIPath URL template).` }),
72864
+ MaxLength(20),
72865
+ __metadata("design:type", String)
72866
+ ], MJIntegrationObject_.prototype, "UpdateIDLocation", void 0);
72867
+ __decorate([
72868
+ Field({ nullable: true, description: `HTTP path template for delete operations. Typically contains {ID} placeholder. NULL means delete not supported via metadata-driven path. (Existing DeleteMethod column carries the verb.)` }),
72869
+ __metadata("design:type", String)
72870
+ ], MJIntegrationObject_.prototype, "DeleteAPIPath", void 0);
72871
+ __decorate([
72872
+ Field({ nullable: true, description: `For delete: where the target record ID is located — typically 'path'.` }),
72873
+ MaxLength(20),
72874
+ __metadata("design:type", String)
72875
+ ], MJIntegrationObject_.prototype, "DeleteIDLocation", void 0);
72876
+ __decorate([
72877
+ Field({ nullable: true, description: `Vendor field name marking "last changed" — drives incremental sync filter when SupportsIncrementalSync=1. The exact filter syntax (e.g., $filter=Modified gt {value} or modified_since={value}) lives in Configuration.incrementalFilterFormat. Provable-only: leave NULL if docs do not name a watermark field.` }),
72878
+ MaxLength(255),
72879
+ __metadata("design:type", String)
72880
+ ], MJIntegrationObject_.prototype, "IncrementalWatermarkField", void 0);
72881
+ __decorate([
72882
+ Field({ description: `Provenance of this IntegrationObject row: Declared (from static research/docs), Discovered (from runtime API introspection like Salesforce /describe), Custom (genuinely customer-created, e.g., HubSpot custom objects). Drives merge precedence in IntegrationSchemaSync.` }),
72883
+ MaxLength(20),
72884
+ __metadata("design:type", String)
72885
+ ], MJIntegrationObject_.prototype, "MetadataSource", void 0);
72212
72886
  __decorate([
72213
72887
  Field(),
72214
72888
  MaxLength(100),
@@ -72315,6 +72989,62 @@ __decorate([
72315
72989
  Field(() => Boolean, { nullable: true }),
72316
72990
  __metadata("design:type", Boolean)
72317
72991
  ], CreateMJIntegrationObjectInput.prototype, "IsCustom", void 0);
72992
+ __decorate([
72993
+ Field({ nullable: true }),
72994
+ __metadata("design:type", String)
72995
+ ], CreateMJIntegrationObjectInput.prototype, "CreateAPIPath", void 0);
72996
+ __decorate([
72997
+ Field({ nullable: true }),
72998
+ __metadata("design:type", String)
72999
+ ], CreateMJIntegrationObjectInput.prototype, "CreateMethod", void 0);
73000
+ __decorate([
73001
+ Field({ nullable: true }),
73002
+ __metadata("design:type", String)
73003
+ ], CreateMJIntegrationObjectInput.prototype, "CreateBodyShape", void 0);
73004
+ __decorate([
73005
+ Field({ nullable: true }),
73006
+ __metadata("design:type", String)
73007
+ ], CreateMJIntegrationObjectInput.prototype, "CreateBodyKey", void 0);
73008
+ __decorate([
73009
+ Field({ nullable: true }),
73010
+ __metadata("design:type", String)
73011
+ ], CreateMJIntegrationObjectInput.prototype, "CreateIDLocation", void 0);
73012
+ __decorate([
73013
+ Field({ nullable: true }),
73014
+ __metadata("design:type", String)
73015
+ ], CreateMJIntegrationObjectInput.prototype, "UpdateAPIPath", void 0);
73016
+ __decorate([
73017
+ Field({ nullable: true }),
73018
+ __metadata("design:type", String)
73019
+ ], CreateMJIntegrationObjectInput.prototype, "UpdateMethod", void 0);
73020
+ __decorate([
73021
+ Field({ nullable: true }),
73022
+ __metadata("design:type", String)
73023
+ ], CreateMJIntegrationObjectInput.prototype, "UpdateBodyShape", void 0);
73024
+ __decorate([
73025
+ Field({ nullable: true }),
73026
+ __metadata("design:type", String)
73027
+ ], CreateMJIntegrationObjectInput.prototype, "UpdateBodyKey", void 0);
73028
+ __decorate([
73029
+ Field({ nullable: true }),
73030
+ __metadata("design:type", String)
73031
+ ], CreateMJIntegrationObjectInput.prototype, "UpdateIDLocation", void 0);
73032
+ __decorate([
73033
+ Field({ nullable: true }),
73034
+ __metadata("design:type", String)
73035
+ ], CreateMJIntegrationObjectInput.prototype, "DeleteAPIPath", void 0);
73036
+ __decorate([
73037
+ Field({ nullable: true }),
73038
+ __metadata("design:type", String)
73039
+ ], CreateMJIntegrationObjectInput.prototype, "DeleteIDLocation", void 0);
73040
+ __decorate([
73041
+ Field({ nullable: true }),
73042
+ __metadata("design:type", String)
73043
+ ], CreateMJIntegrationObjectInput.prototype, "IncrementalWatermarkField", void 0);
73044
+ __decorate([
73045
+ Field({ nullable: true }),
73046
+ __metadata("design:type", String)
73047
+ ], CreateMJIntegrationObjectInput.prototype, "MetadataSource", void 0);
72318
73048
  __decorate([
72319
73049
  Field(() => RestoreContextInput, { nullable: true }),
72320
73050
  __metadata("design:type", RestoreContextInput)
@@ -72412,6 +73142,62 @@ __decorate([
72412
73142
  Field(() => Boolean, { nullable: true }),
72413
73143
  __metadata("design:type", Boolean)
72414
73144
  ], UpdateMJIntegrationObjectInput.prototype, "IsCustom", void 0);
73145
+ __decorate([
73146
+ Field({ nullable: true }),
73147
+ __metadata("design:type", String)
73148
+ ], UpdateMJIntegrationObjectInput.prototype, "CreateAPIPath", void 0);
73149
+ __decorate([
73150
+ Field({ nullable: true }),
73151
+ __metadata("design:type", String)
73152
+ ], UpdateMJIntegrationObjectInput.prototype, "CreateMethod", void 0);
73153
+ __decorate([
73154
+ Field({ nullable: true }),
73155
+ __metadata("design:type", String)
73156
+ ], UpdateMJIntegrationObjectInput.prototype, "CreateBodyShape", void 0);
73157
+ __decorate([
73158
+ Field({ nullable: true }),
73159
+ __metadata("design:type", String)
73160
+ ], UpdateMJIntegrationObjectInput.prototype, "CreateBodyKey", void 0);
73161
+ __decorate([
73162
+ Field({ nullable: true }),
73163
+ __metadata("design:type", String)
73164
+ ], UpdateMJIntegrationObjectInput.prototype, "CreateIDLocation", void 0);
73165
+ __decorate([
73166
+ Field({ nullable: true }),
73167
+ __metadata("design:type", String)
73168
+ ], UpdateMJIntegrationObjectInput.prototype, "UpdateAPIPath", void 0);
73169
+ __decorate([
73170
+ Field({ nullable: true }),
73171
+ __metadata("design:type", String)
73172
+ ], UpdateMJIntegrationObjectInput.prototype, "UpdateMethod", void 0);
73173
+ __decorate([
73174
+ Field({ nullable: true }),
73175
+ __metadata("design:type", String)
73176
+ ], UpdateMJIntegrationObjectInput.prototype, "UpdateBodyShape", void 0);
73177
+ __decorate([
73178
+ Field({ nullable: true }),
73179
+ __metadata("design:type", String)
73180
+ ], UpdateMJIntegrationObjectInput.prototype, "UpdateBodyKey", void 0);
73181
+ __decorate([
73182
+ Field({ nullable: true }),
73183
+ __metadata("design:type", String)
73184
+ ], UpdateMJIntegrationObjectInput.prototype, "UpdateIDLocation", void 0);
73185
+ __decorate([
73186
+ Field({ nullable: true }),
73187
+ __metadata("design:type", String)
73188
+ ], UpdateMJIntegrationObjectInput.prototype, "DeleteAPIPath", void 0);
73189
+ __decorate([
73190
+ Field({ nullable: true }),
73191
+ __metadata("design:type", String)
73192
+ ], UpdateMJIntegrationObjectInput.prototype, "DeleteIDLocation", void 0);
73193
+ __decorate([
73194
+ Field({ nullable: true }),
73195
+ __metadata("design:type", String)
73196
+ ], UpdateMJIntegrationObjectInput.prototype, "IncrementalWatermarkField", void 0);
73197
+ __decorate([
73198
+ Field({ nullable: true }),
73199
+ __metadata("design:type", String)
73200
+ ], UpdateMJIntegrationObjectInput.prototype, "MetadataSource", void 0);
72415
73201
  __decorate([
72416
73202
  Field(() => [KeyValuePairInput], { nullable: true }),
72417
73203
  __metadata("design:type", Array)
@@ -92793,6 +93579,10 @@ __decorate([
92793
93579
  Field(() => [MJSearchScopePermission_]),
92794
93580
  __metadata("design:type", Array)
92795
93581
  ], MJRole_.prototype, "MJSearchScopePermissions_RoleIDArray", void 0);
93582
+ __decorate([
93583
+ Field(() => [MJEntityFormOverride_]),
93584
+ __metadata("design:type", Array)
93585
+ ], MJRole_.prototype, "MJEntityFormOverrides_RoleIDArray", void 0);
92796
93586
  MJRole_ = __decorate([
92797
93587
  ObjectType({ description: `Roles are used for security administration and can have zero to many Users as members` })
92798
93588
  ], MJRole_);
@@ -93022,6 +93812,14 @@ let MJRoleResolver = class MJRoleResolver extends ResolverBase {
93022
93812
  const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Search Scope Permissions', rows, this.GetUserFromPayload(userPayload));
93023
93813
  return result;
93024
93814
  }
93815
+ async MJEntityFormOverrides_RoleIDArray(mjrole_, { userPayload, providers }, pubSub) {
93816
+ this.CheckUserReadPermissions('MJ: Entity Form Overrides', userPayload);
93817
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
93818
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwEntityFormOverrides')} WHERE ${provider.QuoteIdentifier('RoleID')}='${mjrole_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Entity Form Overrides', userPayload, EntityPermissionType.Read, 'AND');
93819
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
93820
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Entity Form Overrides', rows, this.GetUserFromPayload(userPayload));
93821
+ return result;
93822
+ }
93025
93823
  async CreateMJRole(input, { providers, userPayload }, pubSub) {
93026
93824
  const provider = GetReadWriteProvider(providers);
93027
93825
  return this.CreateRecord('MJ: Roles', input, provider, userPayload, pubSub);
@@ -93179,6 +93977,15 @@ __decorate([
93179
93977
  __metadata("design:paramtypes", [MJRole_, Object, PubSubEngine]),
93180
93978
  __metadata("design:returntype", Promise)
93181
93979
  ], MJRoleResolver.prototype, "MJSearchScopePermissions_RoleIDArray", null);
93980
+ __decorate([
93981
+ FieldResolver(() => [MJEntityFormOverride_]),
93982
+ __param(0, Root()),
93983
+ __param(1, Ctx()),
93984
+ __param(2, PubSub()),
93985
+ __metadata("design:type", Function),
93986
+ __metadata("design:paramtypes", [MJRole_, Object, PubSubEngine]),
93987
+ __metadata("design:returntype", Promise)
93988
+ ], MJRoleResolver.prototype, "MJEntityFormOverrides_RoleIDArray", null);
93182
93989
  __decorate([
93183
93990
  Mutation(() => MJRole_),
93184
93991
  __param(0, Arg('input', () => CreateMJRoleInput)),
@@ -95032,6 +95839,10 @@ __decorate([
95032
95839
  Field(),
95033
95840
  __metadata("design:type", Date)
95034
95841
  ], MJScheduledJob_.prototype, "_mj__UpdatedAt", void 0);
95842
+ __decorate([
95843
+ Field(() => Boolean, { description: `When true AND LastRunAt IS NULL, the scheduler sets NextRunAt to now() instead of the next cron tick on initialization, so the job runs on the next polling cycle. Useful for newly-seeded jobs that should not wait up to a full cron interval before their first execution.` }),
95844
+ __metadata("design:type", Boolean)
95845
+ ], MJScheduledJob_.prototype, "RunImmediatelyIfNeverRun", void 0);
95035
95846
  __decorate([
95036
95847
  Field(),
95037
95848
  MaxLength(100),
@@ -95168,6 +95979,10 @@ __decorate([
95168
95979
  Field({ nullable: true }),
95169
95980
  __metadata("design:type", String)
95170
95981
  ], CreateMJScheduledJobInput.prototype, "ConcurrencyMode", void 0);
95982
+ __decorate([
95983
+ Field(() => Boolean, { nullable: true }),
95984
+ __metadata("design:type", Boolean)
95985
+ ], CreateMJScheduledJobInput.prototype, "RunImmediatelyIfNeverRun", void 0);
95171
95986
  __decorate([
95172
95987
  Field(() => RestoreContextInput, { nullable: true }),
95173
95988
  __metadata("design:type", RestoreContextInput)
@@ -95285,6 +96100,10 @@ __decorate([
95285
96100
  Field({ nullable: true }),
95286
96101
  __metadata("design:type", String)
95287
96102
  ], UpdateMJScheduledJobInput.prototype, "ConcurrencyMode", void 0);
96103
+ __decorate([
96104
+ Field(() => Boolean, { nullable: true }),
96105
+ __metadata("design:type", Boolean)
96106
+ ], UpdateMJScheduledJobInput.prototype, "RunImmediatelyIfNeverRun", void 0);
95288
96107
  __decorate([
95289
96108
  Field(() => [KeyValuePairInput], { nullable: true }),
95290
96109
  __metadata("design:type", Array)
@@ -100840,6 +101659,11 @@ __decorate([
100840
101659
  Field(),
100841
101660
  __metadata("design:type", Date)
100842
101661
  ], MJTagSynonym_.prototype, "_mj__UpdatedAt", void 0);
101662
+ __decorate([
101663
+ Field({ description: `Approval state of the synonym. Active = resolves to its tag during classification. Pending = proposed (e.g. by the LLM or a bulk import) and awaiting human review; does not resolve until approved. Rejected = reviewed and declined; retained for audit and to suppress re-proposal.` }),
101664
+ MaxLength(20),
101665
+ __metadata("design:type", String)
101666
+ ], MJTagSynonym_.prototype, "Status", void 0);
100843
101667
  __decorate([
100844
101668
  Field(),
100845
101669
  MaxLength(255),
@@ -100870,6 +101694,10 @@ __decorate([
100870
101694
  Field({ nullable: true }),
100871
101695
  __metadata("design:type", String)
100872
101696
  ], CreateMJTagSynonymInput.prototype, "Source", void 0);
101697
+ __decorate([
101698
+ Field({ nullable: true }),
101699
+ __metadata("design:type", String)
101700
+ ], CreateMJTagSynonymInput.prototype, "Status", void 0);
100873
101701
  __decorate([
100874
101702
  Field(() => RestoreContextInput, { nullable: true }),
100875
101703
  __metadata("design:type", RestoreContextInput)
@@ -100899,6 +101727,10 @@ __decorate([
100899
101727
  Field({ nullable: true }),
100900
101728
  __metadata("design:type", String)
100901
101729
  ], UpdateMJTagSynonymInput.prototype, "Source", void 0);
101730
+ __decorate([
101731
+ Field({ nullable: true }),
101732
+ __metadata("design:type", String)
101733
+ ], UpdateMJTagSynonymInput.prototype, "Status", void 0);
100902
101734
  __decorate([
100903
101735
  Field(() => [KeyValuePairInput], { nullable: true }),
100904
101736
  __metadata("design:type", Array)
@@ -113058,6 +113890,10 @@ __decorate([
113058
113890
  Field(() => [MJList_]),
113059
113891
  __metadata("design:type", Array)
113060
113892
  ], MJUser_.prototype, "MJLists_LastRefreshedByUserIDArray", void 0);
113893
+ __decorate([
113894
+ Field(() => [MJEntityFormOverride_]),
113895
+ __metadata("design:type", Array)
113896
+ ], MJUser_.prototype, "MJEntityFormOverrides_UserIDArray", void 0);
113061
113897
  MJUser_ = __decorate([
113062
113898
  ObjectType({ description: `A list of all users who have or had access to the system` })
113063
113899
  ], MJUser_);
@@ -114047,6 +114883,14 @@ let MJUserResolverBase = class MJUserResolverBase extends ResolverBase {
114047
114883
  const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Lists', rows, this.GetUserFromPayload(userPayload));
114048
114884
  return result;
114049
114885
  }
114886
+ async MJEntityFormOverrides_UserIDArray(mjuser_, { userPayload, providers }, pubSub) {
114887
+ this.CheckUserReadPermissions('MJ: Entity Form Overrides', userPayload);
114888
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
114889
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwEntityFormOverrides')} WHERE ${provider.QuoteIdentifier('UserID')}='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Entity Form Overrides', userPayload, EntityPermissionType.Read, 'AND');
114890
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
114891
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Entity Form Overrides', rows, this.GetUserFromPayload(userPayload));
114892
+ return result;
114893
+ }
114050
114894
  async CreateMJUser(input, { providers, userPayload }, pubSub) {
114051
114895
  const provider = GetReadWriteProvider(providers);
114052
114896
  return this.CreateRecord('MJ: Users', input, provider, userPayload, pubSub);
@@ -114978,6 +115822,15 @@ __decorate([
114978
115822
  __metadata("design:paramtypes", [MJUser_, Object, PubSubEngine]),
114979
115823
  __metadata("design:returntype", Promise)
114980
115824
  ], MJUserResolverBase.prototype, "MJLists_LastRefreshedByUserIDArray", null);
115825
+ __decorate([
115826
+ FieldResolver(() => [MJEntityFormOverride_]),
115827
+ __param(0, Root()),
115828
+ __param(1, Ctx()),
115829
+ __param(2, PubSub()),
115830
+ __metadata("design:type", Function),
115831
+ __metadata("design:paramtypes", [MJUser_, Object, PubSubEngine]),
115832
+ __metadata("design:returntype", Promise)
115833
+ ], MJUserResolverBase.prototype, "MJEntityFormOverrides_UserIDArray", null);
114981
115834
  __decorate([
114982
115835
  Mutation(() => MJUser_),
114983
115836
  __param(0, Arg('input', () => CreateMJUserInput)),