@memberjunction/server 6.2.0-edge.0 → 6.2.0-edge.2

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 (459) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/agentSessions/ReturningVisitorRecap.d.ts +2 -0
  3. package/dist/agentSessions/ReturningVisitorRecap.d.ts.map +1 -1
  4. package/dist/agentSessions/ReturningVisitorRecap.js +5 -1
  5. package/dist/agentSessions/ReturningVisitorRecap.js.map +1 -1
  6. package/dist/agentSessions/SessionManager.js +2 -2
  7. package/dist/agentSessions/remoteBrowserGoalEngine.d.ts +8 -0
  8. package/dist/agentSessions/remoteBrowserGoalEngine.d.ts.map +1 -1
  9. package/dist/agentSessions/remoteBrowserGoalEngine.js +21 -5
  10. package/dist/agentSessions/remoteBrowserGoalEngine.js.map +1 -1
  11. package/dist/auth/AuthProviderCatalogRouter.d.ts +2 -0
  12. package/dist/auth/AuthProviderCatalogRouter.d.ts.map +1 -1
  13. package/dist/auth/AuthProviderCatalogRouter.js +5 -1
  14. package/dist/auth/AuthProviderCatalogRouter.js.map +1 -1
  15. package/dist/auth/index.d.ts +20 -1
  16. package/dist/auth/index.d.ts.map +1 -1
  17. package/dist/auth/index.js +20 -10
  18. package/dist/auth/index.js.map +1 -1
  19. package/dist/auth/initializeProviders.d.ts +8 -0
  20. package/dist/auth/initializeProviders.d.ts.map +1 -1
  21. package/dist/auth/initializeProviders.js +21 -5
  22. package/dist/auth/initializeProviders.js.map +1 -1
  23. package/dist/auth/magicLink/MagicLinkRouter.d.ts +9 -0
  24. package/dist/auth/magicLink/MagicLinkRouter.d.ts.map +1 -1
  25. package/dist/auth/magicLink/MagicLinkRouter.js +22 -10
  26. package/dist/auth/magicLink/MagicLinkRouter.js.map +1 -1
  27. package/dist/auth/magicLink/MagicLinkService.d.ts +17 -15
  28. package/dist/auth/magicLink/MagicLinkService.d.ts.map +1 -1
  29. package/dist/auth/magicLink/MagicLinkService.js +65 -51
  30. package/dist/auth/magicLink/MagicLinkService.js.map +1 -1
  31. package/dist/auth/magicLink/index.d.ts +2 -2
  32. package/dist/auth/magicLink/index.d.ts.map +1 -1
  33. package/dist/auth/magicLink/index.js +2 -2
  34. package/dist/auth/magicLink/index.js.map +1 -1
  35. package/dist/auth/magicLink/magicLinkCore.d.ts +54 -33
  36. package/dist/auth/magicLink/magicLinkCore.d.ts.map +1 -1
  37. package/dist/auth/magicLink/magicLinkCore.js +61 -61
  38. package/dist/auth/magicLink/magicLinkCore.js.map +1 -1
  39. package/dist/auth/magicLink/redeemLanding.d.ts +4 -0
  40. package/dist/auth/magicLink/redeemLanding.d.ts.map +1 -1
  41. package/dist/auth/magicLink/redeemLanding.js +12 -4
  42. package/dist/auth/magicLink/redeemLanding.js.map +1 -1
  43. package/dist/auth/magicLink/types.d.ts +4 -4
  44. package/dist/auth/principals.d.ts +2 -0
  45. package/dist/auth/principals.d.ts.map +1 -1
  46. package/dist/auth/principals.js +6 -2
  47. package/dist/auth/principals.js.map +1 -1
  48. package/dist/cache.d.ts +2 -0
  49. package/dist/cache.d.ts.map +1 -1
  50. package/dist/cache.js +3 -1
  51. package/dist/cache.js.map +1 -1
  52. package/dist/config.d.ts +346 -2
  53. package/dist/config.d.ts.map +1 -1
  54. package/dist/config.js +34 -4
  55. package/dist/config.js.map +1 -1
  56. package/dist/context.d.ts +20 -0
  57. package/dist/context.d.ts.map +1 -1
  58. package/dist/context.js +27 -19
  59. package/dist/context.js.map +1 -1
  60. package/dist/directives/Public.d.ts +2 -0
  61. package/dist/directives/Public.d.ts.map +1 -1
  62. package/dist/directives/Public.js +3 -1
  63. package/dist/directives/Public.js.map +1 -1
  64. package/dist/directives/RequireSystemUser.d.ts +2 -0
  65. package/dist/directives/RequireSystemUser.d.ts.map +1 -1
  66. package/dist/directives/RequireSystemUser.js +3 -1
  67. package/dist/directives/RequireSystemUser.js.map +1 -1
  68. package/dist/generated/graphql-schemas/__mj.d.ts +1021 -0
  69. package/dist/generated/graphql-schemas/__mj.d.ts.map +1 -1
  70. package/dist/generated/graphql-schemas/__mj.js +7368 -2145
  71. package/dist/generated/graphql-schemas/__mj.js.map +1 -1
  72. package/dist/generic/CacheInvalidationResolver.d.ts +94 -4
  73. package/dist/generic/CacheInvalidationResolver.d.ts.map +1 -1
  74. package/dist/generic/CacheInvalidationResolver.js +122 -3
  75. package/dist/generic/CacheInvalidationResolver.js.map +1 -1
  76. package/dist/generic/DeleteOptionsInput.d.ts +8 -1
  77. package/dist/generic/DeleteOptionsInput.d.ts.map +1 -1
  78. package/dist/generic/DeleteOptionsInput.js +1 -1
  79. package/dist/generic/DeleteOptionsInput.js.map +1 -1
  80. package/dist/generic/FireAndForgetHeartbeat.d.ts +18 -2
  81. package/dist/generic/FireAndForgetHeartbeat.d.ts.map +1 -1
  82. package/dist/generic/FireAndForgetHeartbeat.js +24 -6
  83. package/dist/generic/FireAndForgetHeartbeat.js.map +1 -1
  84. package/dist/generic/OrphanedConversationDetailReconciler.d.ts +31 -0
  85. package/dist/generic/OrphanedConversationDetailReconciler.d.ts.map +1 -0
  86. package/dist/generic/OrphanedConversationDetailReconciler.js +215 -0
  87. package/dist/generic/OrphanedConversationDetailReconciler.js.map +1 -0
  88. package/dist/generic/PushStatusResolver.d.ts +48 -1
  89. package/dist/generic/PushStatusResolver.d.ts.map +1 -1
  90. package/dist/generic/PushStatusResolver.js +95 -4
  91. package/dist/generic/PushStatusResolver.js.map +1 -1
  92. package/dist/generic/ResolverBase.d.ts +18 -2
  93. package/dist/generic/ResolverBase.d.ts.map +1 -1
  94. package/dist/generic/ResolverBase.js +64 -55
  95. package/dist/generic/ResolverBase.js.map +1 -1
  96. package/dist/index.d.ts +9 -0
  97. package/dist/index.d.ts.map +1 -1
  98. package/dist/index.js +120 -11
  99. package/dist/index.js.map +1 -1
  100. package/dist/integration/CustomColumnPromoter.d.ts +2 -0
  101. package/dist/integration/CustomColumnPromoter.d.ts.map +1 -1
  102. package/dist/integration/CustomColumnPromoter.js +5 -1
  103. package/dist/integration/CustomColumnPromoter.js.map +1 -1
  104. package/dist/integration/EntityMapLifecycle.d.ts +4 -0
  105. package/dist/integration/EntityMapLifecycle.d.ts.map +1 -1
  106. package/dist/integration/EntityMapLifecycle.js +10 -2
  107. package/dist/integration/EntityMapLifecycle.js.map +1 -1
  108. package/dist/logging/NoLog.d.ts +4 -0
  109. package/dist/logging/NoLog.d.ts.map +1 -1
  110. package/dist/logging/NoLog.js +10 -2
  111. package/dist/logging/NoLog.js.map +1 -1
  112. package/dist/logging/StartupLogger.d.ts +2 -0
  113. package/dist/logging/StartupLogger.d.ts.map +1 -1
  114. package/dist/logging/StartupLogger.js +5 -1
  115. package/dist/logging/StartupLogger.js.map +1 -1
  116. package/dist/logging/bootAudit.d.ts +11 -7
  117. package/dist/logging/bootAudit.d.ts.map +1 -1
  118. package/dist/logging/bootAudit.js +15 -7
  119. package/dist/logging/bootAudit.js.map +1 -1
  120. package/dist/logging/boundaryLogPayload.d.ts +4 -0
  121. package/dist/logging/boundaryLogPayload.d.ts.map +1 -1
  122. package/dist/logging/boundaryLogPayload.js +5 -1
  123. package/dist/logging/boundaryLogPayload.js.map +1 -1
  124. package/dist/logging/secretRedactor.d.ts +2 -0
  125. package/dist/logging/secretRedactor.d.ts.map +1 -1
  126. package/dist/logging/secretRedactor.js +8 -4
  127. package/dist/logging/secretRedactor.js.map +1 -1
  128. package/dist/logging/shortenForLog.d.ts +2 -0
  129. package/dist/logging/shortenForLog.d.ts.map +1 -1
  130. package/dist/logging/shortenForLog.js +7 -3
  131. package/dist/logging/shortenForLog.js.map +1 -1
  132. package/dist/logging/variablesLoggingMiddleware.d.ts +2 -0
  133. package/dist/logging/variablesLoggingMiddleware.d.ts.map +1 -1
  134. package/dist/logging/variablesLoggingMiddleware.js +8 -6
  135. package/dist/logging/variablesLoggingMiddleware.js.map +1 -1
  136. package/dist/metadataRefreshSignal.d.ts +19 -0
  137. package/dist/metadataRefreshSignal.d.ts.map +1 -0
  138. package/dist/metadataRefreshSignal.js +45 -0
  139. package/dist/metadataRefreshSignal.js.map +1 -0
  140. package/dist/middleware/MJTenantFilterMiddleware.js +4 -4
  141. package/dist/multiTenancy/index.d.ts +8 -0
  142. package/dist/multiTenancy/index.d.ts.map +1 -1
  143. package/dist/multiTenancy/index.js +21 -5
  144. package/dist/multiTenancy/index.js.map +1 -1
  145. package/dist/realtimeWidget/WidgetRouter.d.ts +5 -0
  146. package/dist/realtimeWidget/WidgetRouter.d.ts.map +1 -1
  147. package/dist/realtimeWidget/WidgetRouter.js +14 -10
  148. package/dist/realtimeWidget/WidgetRouter.js.map +1 -1
  149. package/dist/realtimeWidget/WidgetSessionService.d.ts +6 -6
  150. package/dist/realtimeWidget/WidgetSessionService.js +27 -27
  151. package/dist/realtimeWidget/host-identity.d.ts +5 -1
  152. package/dist/realtimeWidget/host-identity.d.ts.map +1 -1
  153. package/dist/realtimeWidget/host-identity.js +11 -3
  154. package/dist/realtimeWidget/host-identity.js.map +1 -1
  155. package/dist/realtimeWidget/index.d.ts +2 -2
  156. package/dist/realtimeWidget/index.d.ts.map +1 -1
  157. package/dist/realtimeWidget/index.js +2 -2
  158. package/dist/realtimeWidget/index.js.map +1 -1
  159. package/dist/realtimeWidget/visitorIdentity.d.ts +21 -1
  160. package/dist/realtimeWidget/visitorIdentity.d.ts.map +1 -1
  161. package/dist/realtimeWidget/visitorIdentity.js +16 -4
  162. package/dist/realtimeWidget/visitorIdentity.js.map +1 -1
  163. package/dist/realtimeWidget/widgetCore.d.ts +48 -0
  164. package/dist/realtimeWidget/widgetCore.d.ts.map +1 -1
  165. package/dist/realtimeWidget/widgetCore.js +38 -10
  166. package/dist/realtimeWidget/widgetCore.js.map +1 -1
  167. package/dist/realtimeWidget/widgetGuestElevation.d.ts +10 -6
  168. package/dist/realtimeWidget/widgetGuestElevation.d.ts.map +1 -1
  169. package/dist/realtimeWidget/widgetGuestElevation.js +14 -6
  170. package/dist/realtimeWidget/widgetGuestElevation.js.map +1 -1
  171. package/dist/resolvers/AdhocQueryResolver.js +3 -3
  172. package/dist/resolvers/AgentRunStatusPublisher.d.ts +55 -0
  173. package/dist/resolvers/AgentRunStatusPublisher.d.ts.map +1 -0
  174. package/dist/resolvers/AgentRunStatusPublisher.js +141 -0
  175. package/dist/resolvers/AgentRunStatusPublisher.js.map +1 -0
  176. package/dist/resolvers/ConversationRunEventsResolver.d.ts +90 -0
  177. package/dist/resolvers/ConversationRunEventsResolver.d.ts.map +1 -0
  178. package/dist/resolvers/ConversationRunEventsResolver.js +283 -0
  179. package/dist/resolvers/ConversationRunEventsResolver.js.map +1 -0
  180. package/dist/resolvers/DuplicateEntryCheckResolver.d.ts +98 -0
  181. package/dist/resolvers/DuplicateEntryCheckResolver.d.ts.map +1 -0
  182. package/dist/resolvers/DuplicateEntryCheckResolver.js +227 -0
  183. package/dist/resolvers/DuplicateEntryCheckResolver.js.map +1 -0
  184. package/dist/resolvers/FetchEntityVectorsResolver.d.ts.map +1 -1
  185. package/dist/resolvers/FetchEntityVectorsResolver.js +2 -1
  186. package/dist/resolvers/FetchEntityVectorsResolver.js.map +1 -1
  187. package/dist/resolvers/FileResolver.js +3 -3
  188. package/dist/resolvers/GeoResolver.d.ts +2 -2
  189. package/dist/resolvers/GeoResolver.js +4 -4
  190. package/dist/resolvers/GetDataResolver.d.ts +14 -0
  191. package/dist/resolvers/GetDataResolver.d.ts.map +1 -1
  192. package/dist/resolvers/GetDataResolver.js +43 -15
  193. package/dist/resolvers/GetDataResolver.js.map +1 -1
  194. package/dist/resolvers/IntegrationDiscoveryResolver.js +2 -2
  195. package/dist/resolvers/ListOperationsResolver.d.ts +20 -0
  196. package/dist/resolvers/ListOperationsResolver.d.ts.map +1 -1
  197. package/dist/resolvers/ListOperationsResolver.js +68 -28
  198. package/dist/resolvers/ListOperationsResolver.js.map +1 -1
  199. package/dist/resolvers/MCPResolver.d.ts +11 -1
  200. package/dist/resolvers/MCPResolver.d.ts.map +1 -1
  201. package/dist/resolvers/MCPResolver.js +7 -3
  202. package/dist/resolvers/MCPResolver.js.map +1 -1
  203. package/dist/resolvers/MergeRecordsResolver.d.ts +7 -0
  204. package/dist/resolvers/MergeRecordsResolver.d.ts.map +1 -1
  205. package/dist/resolvers/MergeRecordsResolver.js +16 -2
  206. package/dist/resolvers/MergeRecordsResolver.js.map +1 -1
  207. package/dist/resolvers/RealtimeBridgeResolver.js +3 -3
  208. package/dist/resolvers/RealtimeClientSessionResolver.d.ts +44 -6
  209. package/dist/resolvers/RealtimeClientSessionResolver.d.ts.map +1 -1
  210. package/dist/resolvers/RealtimeClientSessionResolver.js +93 -37
  211. package/dist/resolvers/RealtimeClientSessionResolver.js.map +1 -1
  212. package/dist/resolvers/RemoteBrowserActionResolver.js +5 -5
  213. package/dist/resolvers/RunAIAgentResolver.d.ts +8 -18
  214. package/dist/resolvers/RunAIAgentResolver.d.ts.map +1 -1
  215. package/dist/resolvers/RunAIAgentResolver.js +85 -184
  216. package/dist/resolvers/RunAIAgentResolver.js.map +1 -1
  217. package/dist/resolvers/RunAIPromptResolver.d.ts +1 -1
  218. package/dist/resolvers/RunAIPromptResolver.js +2 -2
  219. package/dist/resolvers/RunDecisionResolver.d.ts +149 -0
  220. package/dist/resolvers/RunDecisionResolver.d.ts.map +1 -0
  221. package/dist/resolvers/RunDecisionResolver.js +396 -0
  222. package/dist/resolvers/RunDecisionResolver.js.map +1 -0
  223. package/dist/resolvers/RunTestResolver.js +5 -5
  224. package/dist/resolvers/SqlLoggingConfigResolver.d.ts +8 -4
  225. package/dist/resolvers/SqlLoggingConfigResolver.d.ts.map +1 -1
  226. package/dist/resolvers/SqlLoggingConfigResolver.js +5 -5
  227. package/dist/resolvers/TaskGraphFrameResolver.d.ts +8 -1
  228. package/dist/resolvers/TaskGraphFrameResolver.d.ts.map +1 -1
  229. package/dist/resolvers/TaskGraphFrameResolver.js +6 -2
  230. package/dist/resolvers/TaskGraphFrameResolver.js.map +1 -1
  231. package/dist/resolvers/VectorizeEntityResolver.d.ts +1 -1
  232. package/dist/resolvers/VectorizeEntityResolver.d.ts.map +1 -1
  233. package/dist/resolvers/VectorizeEntityResolver.js +14 -10
  234. package/dist/resolvers/VectorizeEntityResolver.js.map +1 -1
  235. package/dist/resolvers/adhoc-query-helpers.d.ts +6 -0
  236. package/dist/resolvers/adhoc-query-helpers.d.ts.map +1 -1
  237. package/dist/resolvers/adhoc-query-helpers.js +10 -2
  238. package/dist/resolvers/adhoc-query-helpers.js.map +1 -1
  239. package/dist/resolvers/artifact-routing.d.ts +8 -8
  240. package/dist/resolvers/artifact-routing.js +2 -2
  241. package/dist/resolvers/artifact-routing.js.map +1 -1
  242. package/dist/resolvers/meetingRecordingRegistration.d.ts +10 -2
  243. package/dist/resolvers/meetingRecordingRegistration.d.ts.map +1 -1
  244. package/dist/resolvers/meetingRecordingRegistration.js +24 -8
  245. package/dist/resolvers/meetingRecordingRegistration.js.map +1 -1
  246. package/dist/resolvers/peaksSidecar.d.ts +4 -0
  247. package/dist/resolvers/peaksSidecar.d.ts.map +1 -1
  248. package/dist/resolvers/peaksSidecar.js +10 -2
  249. package/dist/resolvers/peaksSidecar.js.map +1 -1
  250. package/dist/rest/EntityCRUDHandler.d.ts +28 -0
  251. package/dist/rest/EntityCRUDHandler.d.ts.map +1 -1
  252. package/dist/rest/EntityCRUDHandler.js +20 -4
  253. package/dist/rest/EntityCRUDHandler.js.map +1 -1
  254. package/dist/rest/MediaStreamHandler.d.ts +2 -0
  255. package/dist/rest/MediaStreamHandler.d.ts.map +1 -1
  256. package/dist/rest/MediaStreamHandler.js +10 -6
  257. package/dist/rest/MediaStreamHandler.js.map +1 -1
  258. package/dist/rest/OAuthCallbackHandler.d.ts +9 -0
  259. package/dist/rest/OAuthCallbackHandler.d.ts.map +1 -1
  260. package/dist/rest/OAuthCallbackHandler.js +15 -3
  261. package/dist/rest/OAuthCallbackHandler.js.map +1 -1
  262. package/dist/rest/RESTEndpointHandler.d.ts +6 -4
  263. package/dist/rest/RESTEndpointHandler.d.ts.map +1 -1
  264. package/dist/rest/RESTEndpointHandler.js +15 -11
  265. package/dist/rest/RESTEndpointHandler.js.map +1 -1
  266. package/dist/rest/RealtimeSdpBrokerHandler.d.ts +5 -1
  267. package/dist/rest/RealtimeSdpBrokerHandler.d.ts.map +1 -1
  268. package/dist/rest/RealtimeSdpBrokerHandler.js +12 -4
  269. package/dist/rest/RealtimeSdpBrokerHandler.js.map +1 -1
  270. package/dist/rest/SignatureWebhookHandler.d.ts +2 -0
  271. package/dist/rest/SignatureWebhookHandler.d.ts.map +1 -1
  272. package/dist/rest/SignatureWebhookHandler.js +5 -1
  273. package/dist/rest/SignatureWebhookHandler.js.map +1 -1
  274. package/dist/rest/UploadTokenManager.d.ts +24 -8
  275. package/dist/rest/UploadTokenManager.d.ts.map +1 -1
  276. package/dist/rest/UploadTokenManager.js +53 -21
  277. package/dist/rest/UploadTokenManager.js.map +1 -1
  278. package/dist/rest/ViewOperationsHandler.d.ts +20 -0
  279. package/dist/rest/ViewOperationsHandler.d.ts.map +1 -1
  280. package/dist/rest/ViewOperationsHandler.js +20 -4
  281. package/dist/rest/ViewOperationsHandler.js.map +1 -1
  282. package/dist/rest/mediaRange.d.ts +4 -0
  283. package/dist/rest/mediaRange.d.ts.map +1 -1
  284. package/dist/rest/mediaRange.js +10 -2
  285. package/dist/rest/mediaRange.js.map +1 -1
  286. package/dist/rest/setupRESTEndpoints.d.ts +4 -0
  287. package/dist/rest/setupRESTEndpoints.d.ts.map +1 -1
  288. package/dist/rest/setupRESTEndpoints.js +13 -7
  289. package/dist/rest/setupRESTEndpoints.js.map +1 -1
  290. package/dist/serverExtensionReservedRoots.d.ts +2 -0
  291. package/dist/serverExtensionReservedRoots.d.ts.map +1 -1
  292. package/dist/serverExtensionReservedRoots.js +5 -1
  293. package/dist/serverExtensionReservedRoots.js.map +1 -1
  294. package/dist/services/TaskGraphActionRunner.d.ts +13 -8
  295. package/dist/services/TaskGraphActionRunner.d.ts.map +1 -1
  296. package/dist/services/TaskGraphActionRunner.js +16 -15
  297. package/dist/services/TaskGraphActionRunner.js.map +1 -1
  298. package/dist/types.d.ts +2 -0
  299. package/dist/types.d.ts.map +1 -1
  300. package/dist/types.js +7 -3
  301. package/dist/types.js.map +1 -1
  302. package/dist/util.d.ts +6 -0
  303. package/dist/util.d.ts.map +1 -1
  304. package/dist/util.js +13 -5
  305. package/dist/util.js.map +1 -1
  306. package/package.json +94 -92
  307. package/src/__tests__/AgentRunStatusPublisher.test.ts +175 -0
  308. package/src/__tests__/DeleteOptionsInput.wireShape.test.ts +62 -0
  309. package/src/__tests__/DuplicateEntryCheckResolver.test.ts +300 -0
  310. package/src/__tests__/FileResolverPeaks.test.ts +13 -13
  311. package/src/__tests__/ListOperationsResolver.test.ts +17 -17
  312. package/src/__tests__/MediaStreamHandler.test.ts +28 -28
  313. package/src/__tests__/NoLog.test.ts +11 -11
  314. package/src/__tests__/PrimaryKeyAlwaysMapped.test.ts +10 -10
  315. package/src/__tests__/RESTEndpointHandler.test.ts +14 -14
  316. package/src/__tests__/RealtimeBridgeResolver.test.ts +4 -2
  317. package/src/__tests__/RealtimeClientSessionResolver.test.ts +216 -2
  318. package/src/__tests__/RealtimeSdpBrokerHandler.test.ts +6 -6
  319. package/src/__tests__/RefreshAdoptsNewColumns.test.ts +8 -8
  320. package/src/__tests__/RemoteBrowserActionRecovery.test.ts +7 -1
  321. package/src/__tests__/RemoteBrowserAudioStream.test.ts +7 -1
  322. package/src/__tests__/RemoteBrowserGoalEngine.test.ts +18 -18
  323. package/src/__tests__/RemoteBrowserSnapshot.test.ts +7 -1
  324. package/src/__tests__/ResolverBase.clientOldValues.test.ts +52 -0
  325. package/src/__tests__/RunAIAgentResolver.historyFrom.test.ts +398 -0
  326. package/src/__tests__/RunAIAgentResolver.streaming.test.ts +18 -27
  327. package/src/__tests__/RunDecisionResolver.test.ts +699 -0
  328. package/src/__tests__/TaskGraphActionRunner.durablePayload.test.ts +131 -0
  329. package/src/__tests__/TaskGraphFrameResolver.test.ts +2 -2
  330. package/src/__tests__/VectorizeEntityResolver.test.ts +106 -0
  331. package/src/__tests__/WidgetSessionService.test.ts +8 -4
  332. package/src/__tests__/adhoc-query-helpers.test.ts +21 -21
  333. package/src/__tests__/bootAudit.test.ts +11 -11
  334. package/src/__tests__/boundaryLogPayload.test.ts +6 -6
  335. package/src/__tests__/cacheInvalidationRecordData.test.ts +177 -0
  336. package/src/__tests__/conversationRunEvents.test.ts +399 -0
  337. package/src/__tests__/databaseAbstraction.test.ts +12 -6
  338. package/src/__tests__/getDataTokenRedaction.test.ts +7 -7
  339. package/src/__tests__/initializeProviders.refresh.test.ts +4 -4
  340. package/src/__tests__/magicLink.test.ts +73 -134
  341. package/src/__tests__/magicLinkService.consume.test.ts +224 -0
  342. package/src/__tests__/meetingRecordingRegistration.test.ts +12 -12
  343. package/src/__tests__/metadataRefreshSignal.test.ts +78 -0
  344. package/src/__tests__/multiTenancy.security.test.ts +40 -40
  345. package/src/__tests__/multiTenancy.test.ts +18 -18
  346. package/src/__tests__/newUsers.test.ts +24 -23
  347. package/src/__tests__/orphanedConversationDetailReconciler.test.ts +283 -0
  348. package/src/__tests__/principals.test.ts +22 -22
  349. package/src/__tests__/pushStatusFanOut.test.ts +206 -0
  350. package/src/__tests__/pushStatusResolver.filter.test.ts +8 -8
  351. package/src/__tests__/secretRedactor.failOpen.test.ts +12 -12
  352. package/src/__tests__/secretRedactor.test.ts +12 -12
  353. package/src/__tests__/serverExtensionReservedRoots.test.ts +7 -7
  354. package/src/__tests__/subscriptionRedaction.test.ts +5 -5
  355. package/src/__tests__/unifiedAuth.test.ts +15 -9
  356. package/src/__tests__/visitorIdentity.resolve.test.ts +6 -6
  357. package/src/__tests__/widget.test.ts +45 -45
  358. package/src/__tests__/widgetGuestElevation.test.ts +7 -7
  359. package/src/__tests__/widgetHostIdentity.test.ts +14 -14
  360. package/src/agentSessions/ReturningVisitorRecap.ts +12 -1
  361. package/src/agentSessions/SessionManager.ts +2 -2
  362. package/src/agentSessions/remoteBrowserGoalEngine.ts +30 -5
  363. package/src/auth/AuthProviderCatalogRouter.ts +6 -1
  364. package/src/auth/__tests__/backward-compatibility.test.ts +4 -3
  365. package/src/auth/index.ts +43 -28
  366. package/src/auth/initializeProviders.ts +25 -5
  367. package/src/auth/magicLink/MagicLinkRouter.ts +28 -10
  368. package/src/auth/magicLink/MagicLinkService.ts +71 -52
  369. package/src/auth/magicLink/index.ts +7 -7
  370. package/src/auth/magicLink/magicLinkCore.ts +96 -64
  371. package/src/auth/magicLink/redeemLanding.ts +14 -4
  372. package/src/auth/magicLink/types.ts +54 -54
  373. package/src/auth/newUsers.ts +1 -1
  374. package/src/auth/principals.ts +11 -2
  375. package/src/cache.ts +4 -1
  376. package/src/config.ts +37 -4
  377. package/src/context.ts +37 -24
  378. package/src/directives/Public.ts +4 -1
  379. package/src/directives/RequireSystemUser.ts +4 -1
  380. package/src/generated/graphql-schemas/__mj.ts +3674 -4
  381. package/src/generic/CacheInvalidationResolver.ts +148 -4
  382. package/src/generic/DeleteOptionsInput.ts +9 -2
  383. package/src/generic/FireAndForgetHeartbeat.ts +35 -16
  384. package/src/generic/OrphanedConversationDetailReconciler.ts +267 -0
  385. package/src/generic/PushStatusResolver.ts +118 -8
  386. package/src/generic/ResolverBase.ts +65 -57
  387. package/src/generic/RunViewResolver.ts +22 -22
  388. package/src/generic/__tests__/FireAndForgetHeartbeat.test.ts +7 -7
  389. package/src/index.ts +137 -11
  390. package/src/integration/CustomColumnPromoter.ts +6 -1
  391. package/src/integration/EntityMapLifecycle.ts +20 -2
  392. package/src/logging/NoLog.ts +16 -2
  393. package/src/logging/StartupLogger.ts +6 -1
  394. package/src/logging/bootAudit.ts +26 -16
  395. package/src/logging/boundaryLogPayload.ts +8 -1
  396. package/src/logging/secretRedactor.ts +14 -9
  397. package/src/logging/shortenForLog.ts +8 -3
  398. package/src/logging/variablesLoggingMiddleware.ts +9 -6
  399. package/src/metadataRefreshSignal.ts +45 -0
  400. package/src/middleware/MJTenantFilterMiddleware.ts +4 -4
  401. package/src/multiTenancy/index.ts +29 -5
  402. package/src/realtimeWidget/WidgetRouter.ts +15 -10
  403. package/src/realtimeWidget/WidgetSessionService.ts +76 -76
  404. package/src/realtimeWidget/host-identity.ts +24 -10
  405. package/src/realtimeWidget/index.ts +3 -3
  406. package/src/realtimeWidget/visitorIdentity.ts +39 -8
  407. package/src/realtimeWidget/widgetCore.ts +75 -10
  408. package/src/realtimeWidget/widgetGuestElevation.ts +25 -12
  409. package/src/resolvers/AdhocQueryResolver.ts +3 -3
  410. package/src/resolvers/AgentRunStatusPublisher.ts +175 -0
  411. package/src/resolvers/AgentSessionResolver.ts +3 -3
  412. package/src/resolvers/ColorResolver.ts +6 -6
  413. package/src/resolvers/ComponentRegistryResolver.ts +36 -36
  414. package/src/resolvers/ConversationRunEventsResolver.ts +308 -0
  415. package/src/resolvers/DuplicateEntryCheckResolver.ts +232 -0
  416. package/src/resolvers/EntityCommunicationsResolver.ts +4 -4
  417. package/src/resolvers/ExecuteRemoteOperationResolver.ts +9 -9
  418. package/src/resolvers/FetchEntityVectorsResolver.ts +2 -1
  419. package/src/resolvers/FileResolver.ts +42 -42
  420. package/src/resolvers/GeoResolver.ts +4 -4
  421. package/src/resolvers/GetDataResolver.ts +50 -15
  422. package/src/resolvers/IntegrationDiscoveryResolver.ts +2 -2
  423. package/src/resolvers/ListOperationsResolver.ts +78 -28
  424. package/src/resolvers/MCPResolver.ts +30 -15
  425. package/src/resolvers/MergeRecordsResolver.ts +14 -2
  426. package/src/resolvers/QueryResolver.ts +13 -13
  427. package/src/resolvers/RealtimeBridgeResolver.ts +3 -3
  428. package/src/resolvers/RealtimeClientSessionResolver.ts +96 -38
  429. package/src/resolvers/RemoteBrowserActionResolver.ts +5 -5
  430. package/src/resolvers/RunAIAgentResolver.ts +134 -239
  431. package/src/resolvers/RunAIPromptResolver.ts +22 -22
  432. package/src/resolvers/RunDecisionResolver.ts +435 -0
  433. package/src/resolvers/RunTemplateResolver.ts +4 -4
  434. package/src/resolvers/RunTestResolver.ts +25 -25
  435. package/src/resolvers/SqlLoggingConfigResolver.ts +56 -56
  436. package/src/resolvers/TaskGraphFrameResolver.ts +37 -28
  437. package/src/resolvers/TelemetryResolver.ts +79 -79
  438. package/src/resolvers/VectorizeEntityResolver.ts +16 -11
  439. package/src/resolvers/__tests__/GetDataResolver.tokens.test.ts +40 -38
  440. package/src/resolvers/__tests__/MergeRecordsResolver.test.ts +93 -0
  441. package/src/resolvers/__tests__/artifact-routing.test.ts +23 -23
  442. package/src/resolvers/adhoc-query-helpers.ts +19 -2
  443. package/src/resolvers/artifact-routing.ts +19 -19
  444. package/src/resolvers/meetingRecordingRegistration.ts +44 -10
  445. package/src/resolvers/peaksSidecar.ts +12 -2
  446. package/src/rest/EntityCRUDHandler.ts +24 -4
  447. package/src/rest/MediaStreamHandler.ts +11 -6
  448. package/src/rest/OAuthCallbackHandler.ts +25 -7
  449. package/src/rest/RESTEndpointHandler.ts +20 -15
  450. package/src/rest/RealtimeSdpBrokerHandler.ts +14 -4
  451. package/src/rest/SignatureWebhookHandler.ts +6 -1
  452. package/src/rest/UploadTokenManager.ts +66 -30
  453. package/src/rest/ViewOperationsHandler.ts +24 -4
  454. package/src/rest/mediaRange.ts +16 -6
  455. package/src/rest/setupRESTEndpoints.ts +24 -12
  456. package/src/serverExtensionReservedRoots.ts +6 -1
  457. package/src/services/TaskGraphActionRunner.ts +16 -15
  458. package/src/types.ts +21 -16
  459. package/src/util.ts +16 -6
@@ -19,13 +19,13 @@ import { MJLruCache, UUIDsEqual } from '@memberjunction/global';
19
19
  import type { MJConversationWidgetInstanceEntity, MJConversationEntity } from '@memberjunction/core-entities';
20
20
  import { ResolveConfiguredPrincipal } from '../auth/principals.js';
21
21
  import { MagicLinkKeyManager } from '../auth/magicLink/MagicLinkKeys.js';
22
- import { generateSessionId } from '../auth/magicLink/magicLinkCore.js';
22
+ import { GenerateSessionId } from '../auth/magicLink/magicLinkCore.js';
23
23
  import { MagicLinkService } from '../auth/magicLink/MagicLinkService.js';
24
24
  import { configInfo, type WidgetConfig } from '../config.js';
25
- import { buildWidgetGuestClaims, evaluateWidgetMint, parseEnabledChannels, type WidgetMintErrorCode } from './widgetCore.js';
26
- import { verifyHostAssertion, type HostAssertedIdentity } from './host-identity.js';
27
- import { writeReturningVisitorRecap } from '../agentSessions/ReturningVisitorRecap.js';
28
- import { resolveIdentityByEmail, mergeVisitorIdentity, forgetVisitor, type ResolvedVisitorIdentity } from './visitorIdentity.js';
25
+ import { BuildWidgetGuestClaims, EvaluateWidgetMint, ParseEnabledChannels, type WidgetMintErrorCode } from './widgetCore.js';
26
+ import { VerifyHostAssertion, type HostAssertedIdentity } from './host-identity.js';
27
+ import { WriteReturningVisitorRecap } from '../agentSessions/ReturningVisitorRecap.js';
28
+ import { ResolveIdentityByEmail, MergeVisitorIdentity, ForgetVisitor, type ResolvedVisitorIdentity } from './visitorIdentity.js';
29
29
 
30
30
  const WIDGET_ENTITY = 'MJ: Conversation Widget Instances';
31
31
  const CONVERSATIONS_ENTITY = 'MJ: Conversations';
@@ -43,115 +43,115 @@ interface ReturningVisitorResolution {
43
43
 
44
44
  /** Per-request forensic context captured for audit (sourced from the HTTP request). */
45
45
  export interface WidgetMintAuditContext {
46
- ipAddress?: string;
47
- userAgent?: string;
48
- origin?: string;
46
+ ipAddress?: string; // case-violation-ok-legacy-back-compat: optional, and the old name is also read off a value the checker cannot type; renaming it stays assignable and silently yields undefined
47
+ userAgent?: string; // case-violation-ok-legacy-back-compat: optional, and the old name is also read off a value the checker cannot type; renaming it stays assignable and silently yields undefined
48
+ origin?: string; // case-violation-ok-legacy-back-compat: optional, and the old name is also read off a value the checker cannot type; renaming it stays assignable and silently yields undefined
49
49
  }
50
50
 
51
51
  /** Input to mint a guest session. */
52
52
  export interface MintGuestSessionInput {
53
53
  /** The widget's public embed key (pk_live_…). */
54
- widgetKey: string;
54
+ widgetKey: string; // case-violation-ok-legacy-back-compat: the old name is also read off a value typed `any`, where a rename would compile and silently return undefined
55
55
  /** The request's Origin header — enforced against the instance allowlist. */
56
- origin?: string;
56
+ origin?: string; // case-violation-ok-legacy-back-compat: optional, and the old name is also read off a value the checker cannot type; renaming it stays assignable and silently yields undefined
57
57
  /**
58
58
  * A host-signed RS256 identity assertion (D1 `host-identity` strategy). Required when the
59
59
  * resolved widget's AuthStrategy is `HostIdentity`; ignored otherwise. Verified against the
60
60
  * host's registered public key; its identity is carried as informational claims only.
61
61
  */
62
- hostAssertion?: string;
62
+ hostAssertion?: string; // case-violation-ok-legacy-back-compat: optional, and the old name is also read off a value the checker cannot type; renaming it stays assignable and silently yields undefined
63
63
  /**
64
64
  * The durable returning-visitor anchor (RV1) the client presents from its first-party cookie.
65
65
  * Honored only when the widget's `RememberReturningVisitors` toggle is on: a valid presented key
66
66
  * chains this visit to the visitor's prior conversation; absent/invalid on a first visit, the
67
67
  * server mints a fresh one. Ignored entirely when remembering is off.
68
68
  */
69
- visitorKey?: string;
70
- audit?: WidgetMintAuditContext;
69
+ visitorKey?: string; // case-violation-ok-legacy-back-compat: optional, and the old name is also read off a value the checker cannot type; renaming it stays assignable and silently yields undefined
70
+ audit?: WidgetMintAuditContext; // case-violation-ok-legacy-back-compat: optional, and the old name is also read off a value the checker cannot type; renaming it stays assignable and silently yields undefined
71
71
  }
72
72
 
73
73
  /** Result of a guest-session mint. */
74
74
  export interface MintGuestSessionResult {
75
- success: boolean;
75
+ success: boolean; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
76
76
  /** The minted session JWT (RS256), held by the widget in memory and refreshed before expiry. */
77
- token?: string;
77
+ token?: string; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
78
78
  /** ISO expiry of the session token. */
79
- expiresAt?: string;
79
+ expiresAt?: string; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
80
80
  /** The widget instance id (also carried as the `mj_widget_id` claim). */
81
- widgetId?: string;
81
+ widgetId?: string; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
82
82
  /** The Application the session is scoped to. */
83
- applicationId?: string;
83
+ applicationId?: string; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
84
84
  /** The pinned support agent the widget passes as explicitAgentId for every turn (D5). */
85
- pinnedAgentId?: string;
85
+ pinnedAgentId?: string; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
86
86
  /** Which modalities this widget exposes (drives the widget UI). */
87
- modality?: string;
87
+ modality?: string; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
88
88
  /**
89
89
  * The opaque per-session id (also the signed scope resourceId). The widget stamps
90
90
  * Conversation.ExternalID with this so the Widget Guest RLS filters isolate this guest's rows.
91
91
  */
92
- sessionId?: string;
92
+ sessionId?: string; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
93
93
  /**
94
94
  * Optional hard ceiling (minutes) on a voice session for this widget. Surfaced so the client
95
95
  * voice-abuse guard uses the deployment-configured limit; also enforced server-side at mint.
96
96
  */
97
- voiceMaxSessionMinutes?: number;
97
+ voiceMaxSessionMinutes?: number; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
98
98
  /** Whether returning-visitor memory is enabled for this widget (gates the cookie + chaining). */
99
- rememberReturningVisitors?: boolean;
99
+ rememberReturningVisitors?: boolean; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
100
100
  /**
101
101
  * The durable visitor anchor to persist as a cookie (RV1). Set only when remembering is on:
102
102
  * the validated key the client presented, or a freshly minted one on a first visit.
103
103
  */
104
- visitorKey?: string;
104
+ visitorKey?: string; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
105
105
  /** The visitor's prior conversation for this anchor (RV2 chain); set only on a returning visit. */
106
- lastConversationId?: string;
106
+ lastConversationId?: string; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
107
107
  /**
108
108
  * The resolved polymorphic identity entity id (RV4), set only when a host-identity widget asserted a
109
109
  * resolvable identity at mint. The client stamps it (with {@link MintGuestSessionResult.linkedRecordId})
110
110
  * onto the new conversation so memory injection (RV3) keys off the resolved record, not the cookie.
111
111
  */
112
- linkedEntityId?: string;
112
+ linkedEntityId?: string; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
113
113
  /** The resolved polymorphic identity record id (RV4); paired with {@link MintGuestSessionResult.linkedEntityId}. */
114
- linkedRecordId?: string;
114
+ linkedRecordId?: string; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
115
115
  /**
116
116
  * Interactive channels (by name, e.g. `["Whiteboard"]`) this widget may attach when voice is active
117
117
  * (Phase 2). Mirrors the widget instance's `EnabledChannels`; empty (the default) = no channels.
118
118
  */
119
- enabledChannels?: string[];
120
- error?: string;
121
- errorCode?: WidgetMintErrorCode;
119
+ enabledChannels?: string[]; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
120
+ error?: string; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
121
+ errorCode?: WidgetMintErrorCode; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
122
122
  }
123
123
 
124
124
  /** Input to resolve a returning visitor's identity after they verify (RV4, magic-link upgrade path). */
125
125
  export interface ResolveVisitorIdentityInput {
126
126
  /** The widget's public embed key. */
127
- widgetKey: string;
127
+ WidgetKey: string;
128
128
  /** The durable returning-visitor anchor whose trail should be promoted to the verified identity. */
129
- visitorKey: string;
129
+ VisitorKey: string;
130
130
  /** The verified visitor's email (from the authenticated session) — resolved to a record via config. */
131
- verifiedEmail: string;
131
+ VerifiedEmail: string;
132
132
  /** The request's Origin header — enforced against the instance allowlist. */
133
- origin?: string;
133
+ origin?: string; // case-violation-ok-legacy-back-compat: optional, and the old name is also read off a value the checker cannot type; renaming it stays assignable and silently yields undefined
134
134
  }
135
135
 
136
136
  /** Result of an RV4 identity resolve+merge. */
137
137
  export interface ResolveVisitorIdentityResult {
138
- success: boolean;
138
+ success: boolean; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
139
139
  /** The resolved polymorphic pair, when a record matched the verified email. */
140
- resolved?: ResolvedVisitorIdentity;
140
+ resolved?: ResolvedVisitorIdentity; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
141
141
  /** How many conversations were stamped with the resolved identity. */
142
- mergedConversations?: number;
143
- error?: string;
144
- errorCode?: WidgetMintErrorCode;
142
+ mergedConversations?: number; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
143
+ error?: string; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
144
+ errorCode?: WidgetMintErrorCode; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
145
145
  }
146
146
 
147
147
  /** Input to a "forget me" request (RV5). */
148
148
  export interface ForgetVisitorInput {
149
149
  /** The widget's public embed key. */
150
- widgetKey: string;
150
+ WidgetKey: string;
151
151
  /** The durable returning-visitor anchor to forget. */
152
- visitorKey: string;
152
+ VisitorKey: string;
153
153
  /** The request's Origin header — enforced against the instance allowlist. */
154
- origin?: string;
154
+ origin?: string; // case-violation-ok-legacy-back-compat: optional, and the old name is also read off a value the checker cannot type; renaming it stays assignable and silently yields undefined
155
155
  }
156
156
 
157
157
  /**
@@ -169,32 +169,32 @@ interface VisitorPrivacyGateResult {
169
169
 
170
170
  /** Result of a "forget me" request (RV5). */
171
171
  export interface ForgetVisitorResult {
172
- success: boolean;
172
+ success: boolean; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
173
173
  /** Count of memory notes archived. */
174
- notesArchived?: number;
174
+ notesArchived?: number; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
175
175
  /** Count of conversations whose VisitorKey linkage was cleared. */
176
- conversationsCleared?: number;
177
- error?: string;
178
- errorCode?: WidgetMintErrorCode;
176
+ conversationsCleared?: number; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
177
+ error?: string; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
178
+ errorCode?: WidgetMintErrorCode; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
179
179
  }
180
180
 
181
181
  /** Input to request a magic-link identity upgrade for a live guest session (W5). */
182
182
  export interface UpgradeGuestSessionInput {
183
183
  /** The widget's public embed key. */
184
- widgetKey: string;
184
+ WidgetKey: string;
185
185
  /** The email to send the verification link to (becomes the provisioned user's email). */
186
- email: string;
186
+ email: string; // case-violation-ok-legacy-back-compat: the old name is also read off a value typed `any`, where a rename would compile and silently return undefined
187
187
  /** The request's Origin header — enforced against the instance allowlist. */
188
- origin?: string;
188
+ origin?: string; // case-violation-ok-legacy-back-compat: optional, and the old name is also read off a value the checker cannot type; renaming it stays assignable and silently yields undefined
189
189
  }
190
190
 
191
191
  /** Result of a magic-link upgrade request. Never carries the token (delivered by email, out-of-band). */
192
192
  export interface UpgradeGuestSessionResult {
193
- success: boolean;
193
+ success: boolean; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
194
194
  /** Whether the verification email was dispatched (false when no comms provider is configured). */
195
- emailSent?: boolean;
196
- error?: string;
197
- errorCode?: WidgetMintErrorCode;
195
+ emailSent?: boolean; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
196
+ error?: string; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
197
+ errorCode?: WidgetMintErrorCode; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
198
198
  }
199
199
 
200
200
  /** Minimal email sanity check (presence + single `@` with a dotted domain) — not full RFC validation. */
@@ -229,7 +229,7 @@ export class WidgetSessionService {
229
229
  return this.audited({ success: false, errorCode: 'not_found', error: 'Unknown widget key.' }, input, undefined);
230
230
  }
231
231
 
232
- const eligibility = evaluateWidgetMint(
232
+ const eligibility = EvaluateWidgetMint(
233
233
  { Status: widget.Status, AllowedOrigins: widget.AllowedOrigins, Modality: widget.Modality },
234
234
  input.origin,
235
235
  );
@@ -357,11 +357,11 @@ export class WidgetSessionService {
357
357
  if (!contextUser) {
358
358
  return { success: false, errorCode: 'server_error', error: 'Server not configured for widget sessions.' };
359
359
  }
360
- const widget = await this.loadWidgetByKey(input.widgetKey, contextUser);
360
+ const widget = await this.loadWidgetByKey(input.WidgetKey, contextUser);
361
361
  if (!widget) {
362
362
  return { success: false, errorCode: 'not_found', error: 'Unknown widget key.' };
363
363
  }
364
- const eligibility = evaluateWidgetMint({ Status: widget.Status, AllowedOrigins: widget.AllowedOrigins, Modality: widget.Modality }, input.origin);
364
+ const eligibility = EvaluateWidgetMint({ Status: widget.Status, AllowedOrigins: widget.AllowedOrigins, Modality: widget.Modality }, input.origin);
365
365
  if (!eligibility.ok) {
366
366
  return { success: false, errorCode: eligibility.errorCode, error: 'Widget upgrade rejected.' };
367
367
  }
@@ -374,7 +374,7 @@ export class WidgetSessionService {
374
374
  return { success: false, errorCode: 'server_error', error: 'Identity verification is not configured.' };
375
375
  }
376
376
  const service = new MagicLinkService(this.publicUrl, magicLinkConfig);
377
- const result = await service.CreateInvite({ email, applicationId: widget.ApplicationID }, contextUser);
377
+ const result = await service.CreateInvite({ email, ApplicationId: widget.ApplicationID }, contextUser);
378
378
  if (!result.success) {
379
379
  LogError(`[Widget] Upgrade invite failed for widget ${widget.ID}: ${result.error ?? result.errorCode ?? 'unknown'}`);
380
380
  return { success: false, errorCode: 'server_error', error: 'Could not start identity verification.' };
@@ -397,9 +397,9 @@ export class WidgetSessionService {
397
397
  // Prefer the per-instance HostPublicKey column (Phase 3 — no config-resident keys); fall back to the
398
398
  // interim config map (keyed by PublicKey) for deployments that haven't migrated their key yet.
399
399
  const hostKey = widget.HostPublicKey ?? this.config.hostPublicKeys?.[widget.PublicKey];
400
- const result = verifyHostAssertion(assertion, hostKey, widget.PublicKey);
401
- if (result.ok && result.identity) {
402
- return result.identity;
400
+ const result = VerifyHostAssertion(assertion, hostKey, widget.PublicKey);
401
+ if (result.ok && result.Identity) {
402
+ return result.Identity;
403
403
  }
404
404
  LogError(`[Widget] Host assertion rejected for widget ${widget.ID}: ${result.errorCode ?? 'unknown'}`);
405
405
  return null;
@@ -417,8 +417,8 @@ export class WidgetSessionService {
417
417
  const ttlMinutes = widget.SessionTTLMinutes || this.config.defaultSessionTtlMinutes;
418
418
  // Generated once and returned to the client: the widget stamps Conversation.ExternalID with
419
419
  // this id so the Widget Guest RLS filters ({{ScopeResourceID}}) isolate this guest's rows.
420
- const sessionId = generateSessionId();
421
- const claims = buildWidgetGuestClaims({
420
+ const sessionId = GenerateSessionId();
421
+ const claims = BuildWidgetGuestClaims({
422
422
  issuer: this.publicUrl,
423
423
  audience: this.config.audience,
424
424
  widgetId: widget.ID,
@@ -452,7 +452,7 @@ export class WidgetSessionService {
452
452
  sessionId,
453
453
  // Phase 2: which interactive channels this widget may attach during a voice session. Read from the
454
454
  // per-instance EnabledChannels column (added by the Widget_Public_Hardening migration + CodeGen).
455
- enabledChannels: parseEnabledChannels(widget.EnabledChannels),
455
+ enabledChannels: ParseEnabledChannels(widget.EnabledChannels),
456
456
  voiceMaxSessionMinutes: widget.VoiceMaxSessionMinutes ?? undefined,
457
457
  rememberReturningVisitors: !!returningVisitor,
458
458
  visitorKey: returningVisitor?.visitorKey,
@@ -477,11 +477,11 @@ export class WidgetSessionService {
477
477
  if (!widget.RememberReturningVisitors || !hostIdentity?.email || !returningVisitor?.visitorKey) {
478
478
  return undefined;
479
479
  }
480
- const identity = await resolveIdentityByEmail(hostIdentity.email, contextUser, Metadata.Provider, this.config.identityResolution); // global-provider-ok: server-side mint under the single default provider
480
+ const identity = await ResolveIdentityByEmail(hostIdentity.email, contextUser, Metadata.Provider, this.config.identityResolution); // global-provider-ok: server-side mint under the single default provider
481
481
  if (!identity) {
482
482
  return undefined;
483
483
  }
484
- await mergeVisitorIdentity({
484
+ await MergeVisitorIdentity({
485
485
  visitorKey: returningVisitor.visitorKey,
486
486
  applicationId: widget.ApplicationID,
487
487
  identity,
@@ -499,17 +499,17 @@ export class WidgetSessionService {
499
499
  */
500
500
  public async ResolveVisitorIdentity(input: ResolveVisitorIdentityInput): Promise<ResolveVisitorIdentityResult> {
501
501
  try {
502
- const gate = await this.gateVisitorPrivacyRequest(input.widgetKey, input.visitorKey, input.origin);
502
+ const gate = await this.gateVisitorPrivacyRequest(input.WidgetKey, input.VisitorKey, input.origin);
503
503
  if (!gate.ok) {
504
504
  return { success: false, errorCode: gate.errorCode, error: gate.error };
505
505
  }
506
- const identity = await resolveIdentityByEmail(input.verifiedEmail, gate.contextUser, Metadata.Provider, this.config.identityResolution); // global-provider-ok: server-side mint under the single default provider
506
+ const identity = await ResolveIdentityByEmail(input.VerifiedEmail, gate.contextUser, Metadata.Provider, this.config.identityResolution); // global-provider-ok: server-side mint under the single default provider
507
507
  if (!identity) {
508
508
  // Verified, but no record matches the email under the configured target — nothing to merge.
509
509
  return { success: true, mergedConversations: 0 };
510
510
  }
511
- const mergedConversations = await mergeVisitorIdentity({
512
- visitorKey: input.visitorKey,
511
+ const mergedConversations = await MergeVisitorIdentity({
512
+ visitorKey: input.VisitorKey,
513
513
  applicationId: gate.widget.ApplicationID,
514
514
  identity,
515
515
  contextUser: gate.contextUser,
@@ -529,12 +529,12 @@ export class WidgetSessionService {
529
529
  */
530
530
  public async ForgetVisitor(input: ForgetVisitorInput): Promise<ForgetVisitorResult> {
531
531
  try {
532
- const gate = await this.gateVisitorPrivacyRequest(input.widgetKey, input.visitorKey, input.origin);
532
+ const gate = await this.gateVisitorPrivacyRequest(input.WidgetKey, input.VisitorKey, input.origin);
533
533
  if (!gate.ok) {
534
534
  return { success: false, errorCode: gate.errorCode, error: gate.error };
535
535
  }
536
- const { notesArchived, conversationsCleared } = await forgetVisitor({
537
- visitorKey: input.visitorKey,
536
+ const { notesArchived, conversationsCleared } = await ForgetVisitor({
537
+ visitorKey: input.VisitorKey,
538
538
  applicationId: gate.widget.ApplicationID,
539
539
  contextUser: gate.contextUser,
540
540
  provider: Metadata.Provider, // global-provider-ok: server-side mint under the single default provider
@@ -564,7 +564,7 @@ export class WidgetSessionService {
564
564
  if (!widget) {
565
565
  return { ok: false, errorCode: 'not_found', error: 'Unknown widget key.' };
566
566
  }
567
- const eligibility = evaluateWidgetMint(
567
+ const eligibility = EvaluateWidgetMint(
568
568
  { Status: widget.Status, AllowedOrigins: widget.AllowedOrigins, Modality: widget.Modality },
569
569
  origin,
570
570
  );
@@ -597,7 +597,7 @@ export class WidgetSessionService {
597
597
  }
598
598
  const presented = (presentedKey ?? '').trim();
599
599
  const isReturning = VISITOR_KEY_PATTERN.test(presented);
600
- const visitorKey = isReturning ? presented : generateSessionId();
600
+ const visitorKey = isReturning ? presented : GenerateSessionId();
601
601
  const lastConversationId = isReturning
602
602
  ? await this.findPreviousConversationByVisitorKey(visitorKey, widget.ApplicationID, contextUser)
603
603
  : undefined;
@@ -622,7 +622,7 @@ export class WidgetSessionService {
622
622
  return;
623
623
  }
624
624
  // global-provider-ok: server-side mint under the single default provider (same rationale as resolveGuestRoleName).
625
- await writeReturningVisitorRecap(
625
+ await WriteReturningVisitorRecap(
626
626
  priorConversationId,
627
627
  widget.PinnedAgentID,
628
628
  contextUser,
@@ -20,18 +20,18 @@ export type { HostAssertionError };
20
20
 
21
21
  /** The visitor identity a host asserts. Standard OIDC-ish claims so synthesis is uniform. */
22
22
  export interface HostAssertedIdentity {
23
- email: string;
24
- firstName?: string;
25
- lastName?: string;
23
+ email: string; // case-violation-ok-legacy-back-compat: the old name is also read off a value typed `any`, where a rename would compile and silently return undefined
24
+ firstName?: string; // case-violation-ok-legacy-back-compat: optional, and the old name is also read off a value the checker cannot type; renaming it stays assignable and silently yields undefined
25
+ lastName?: string; // case-violation-ok-legacy-back-compat: optional, and the old name is also read off a value the checker cannot type; renaming it stays assignable and silently yields undefined
26
26
  /** The host's opaque user id for this visitor (audit correlation; not an MJ user id). */
27
- hostUserId?: string;
27
+ hostUserId?: string; // case-violation-ok-legacy-back-compat: optional, and the old name is also read off a value the checker cannot type; renaming it stays assignable and silently yields undefined
28
28
  }
29
29
 
30
30
  /** Result of verifying a host assertion. `identity` is present iff `ok` is true. */
31
31
  export interface HostAssertionResult {
32
- ok: boolean;
33
- identity?: HostAssertedIdentity;
34
- errorCode?: HostAssertionError;
32
+ ok: boolean; // case-violation-ok-legacy-back-compat: the old name is also read off a value typed `any`, where a rename would compile and silently return undefined
33
+ Identity?: HostAssertedIdentity;
34
+ errorCode?: HostAssertionError; // case-violation-ok-legacy-back-compat: optional, and the old name is also read off a value the checker cannot type; renaming it stays assignable and silently yields undefined
35
35
  }
36
36
 
37
37
  /**
@@ -52,7 +52,7 @@ const hostIdentityProvider = new HostIdentityProvider({
52
52
  * asserted visitor identity. Thin adapter over {@link HostIdentityProvider.VerifyHostAssertion} (the single
53
53
  * implementation, registered in the AuthProviderFactory) preserving this module's result shape. Never throws.
54
54
  */
55
- export function verifyHostAssertion(
55
+ export function VerifyHostAssertion(
56
56
  assertion: string | undefined,
57
57
  hostPublicKeyPem: string | undefined,
58
58
  expectedAudience: string,
@@ -63,7 +63,7 @@ export function verifyHostAssertion(
63
63
  }
64
64
  return {
65
65
  ok: true,
66
- identity: {
66
+ Identity: {
67
67
  email: result.userInfo.email,
68
68
  firstName: result.userInfo.firstName,
69
69
  lastName: result.userInfo.lastName,
@@ -72,8 +72,17 @@ export function verifyHostAssertion(
72
72
  };
73
73
  }
74
74
 
75
+ /** @deprecated Use {@link VerifyHostAssertion}. */
76
+ export function verifyHostAssertion(
77
+ assertion: string | undefined,
78
+ hostPublicKeyPem: string | undefined,
79
+ expectedAudience: string,
80
+ ): HostAssertionResult {
81
+ return VerifyHostAssertion(assertion, hostPublicKeyPem, expectedAudience);
82
+ }
83
+
75
84
  /** Pulls the visitor identity from a verified host-assertion payload (delegates to the provider). */
76
- export function extractHostIdentity(payload: jwt.JwtPayload): HostAssertedIdentity {
85
+ export function ExtractHostIdentity(payload: jwt.JwtPayload): HostAssertedIdentity {
77
86
  const info = hostIdentityProvider.extractUserInfo(payload);
78
87
  return {
79
88
  email: info.email ?? '',
@@ -82,3 +91,8 @@ export function extractHostIdentity(payload: jwt.JwtPayload): HostAssertedIdenti
82
91
  hostUserId: typeof payload.sub === 'string' ? payload.sub : undefined,
83
92
  };
84
93
  }
94
+
95
+ /** @deprecated Use {@link ExtractHostIdentity}. */
96
+ export function extractHostIdentity(payload: jwt.JwtPayload): HostAssertedIdentity {
97
+ return ExtractHostIdentity(payload);
98
+ }
@@ -4,12 +4,12 @@
4
4
  */
5
5
  export * from './widgetCore.js';
6
6
  export {
7
- verifyHostAssertion,
8
- extractHostIdentity,
7
+ VerifyHostAssertion, verifyHostAssertion,
8
+ ExtractHostIdentity, extractHostIdentity,
9
9
  type HostAssertedIdentity,
10
10
  type HostAssertionResult,
11
11
  type HostAssertionError,
12
12
  } from './host-identity.js';
13
13
  export { WidgetSessionService } from './WidgetSessionService.js';
14
14
  export type { MintGuestSessionInput, MintGuestSessionResult, WidgetMintAuditContext } from './WidgetSessionService.js';
15
- export { createWidgetHandler, WIDGET_MOUNT_PATH } from './WidgetRouter.js';
15
+ export { CreateWidgetHandler, createWidgetHandler, WIDGET_MOUNT_PATH } from './WidgetRouter.js';
@@ -32,14 +32,14 @@ const AGENT_NOTES_ENTITY = 'MJ: AI Agent Notes';
32
32
 
33
33
  /** A resolved polymorphic identity: the entity the visitor maps to, and that record's id. */
34
34
  export interface ResolvedVisitorIdentity {
35
- entityId: string;
36
- recordId: string;
35
+ entityId: string; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
36
+ recordId: string; // case-violation-ok-legacy-back-compat: the type crosses a serialization boundary (JSON / HTTP body), so this member name is part of a wire or on-disk shape
37
37
  }
38
38
 
39
39
  /** The deployment-configurable resolution target (defaults to the core `Users` entity keyed by `Email`). */
40
40
  export interface IdentityResolutionTarget {
41
- entityName?: string;
42
- emailField?: string;
41
+ entityName?: string; // case-violation-ok-legacy-back-compat: optional, and the old name is also read off a value the checker cannot type; renaming it stays assignable and silently yields undefined
42
+ EmailField?: string;
43
43
  }
44
44
 
45
45
  /**
@@ -47,7 +47,7 @@ export interface IdentityResolutionTarget {
47
47
  * target (default: the `Users` entity keyed by `Email`). Returns undefined when no record matches — the
48
48
  * visitor simply stays anonymous. Never throws; email is escaped for the filter literal.
49
49
  */
50
- export async function resolveIdentityByEmail(
50
+ export async function ResolveIdentityByEmail(
51
51
  email: string,
52
52
  contextUser: UserInfo,
53
53
  provider: IMetadataProvider,
@@ -59,7 +59,7 @@ export async function resolveIdentityByEmail(
59
59
  return undefined;
60
60
  }
61
61
  const entityName = target?.entityName?.trim() || 'Users';
62
- const emailField = target?.emailField?.trim() || 'Email';
62
+ const emailField = target?.EmailField?.trim() || 'Email';
63
63
  const entityInfo = provider.EntityByName(entityName);
64
64
  if (!entityInfo) {
65
65
  LogError(`[VisitorIdentity] identity-resolution entity '${entityName}' not found in metadata.`);
@@ -103,6 +103,16 @@ export async function resolveIdentityByEmail(
103
103
  }
104
104
  }
105
105
 
106
+ /** @deprecated Use {@link ResolveIdentityByEmail}. */
107
+ export async function resolveIdentityByEmail(
108
+ email: string,
109
+ contextUser: UserInfo,
110
+ provider: IMetadataProvider,
111
+ target?: IdentityResolutionTarget,
112
+ ): Promise<ResolvedVisitorIdentity | undefined> {
113
+ return ResolveIdentityByEmail(email, contextUser, provider, target);
114
+ }
115
+
106
116
  /** Loads every conversation sharing a VisitorKey within one application (entity objects, for mutation). */
107
117
  async function loadVisitorConversations(
108
118
  visitorKey: string,
@@ -134,7 +144,7 @@ async function loadVisitorConversations(
134
144
  *
135
145
  * @returns the number of conversations stamped (0 when nothing matched the key).
136
146
  */
137
- export async function mergeVisitorIdentity(args: {
147
+ export async function MergeVisitorIdentity(args: {
138
148
  visitorKey: string;
139
149
  applicationId: string;
140
150
  identity: ResolvedVisitorIdentity;
@@ -174,6 +184,17 @@ export async function mergeVisitorIdentity(args: {
174
184
  }
175
185
  }
176
186
 
187
+ /** @deprecated Use {@link MergeVisitorIdentity}. */
188
+ export async function mergeVisitorIdentity(args: {
189
+ visitorKey: string;
190
+ applicationId: string;
191
+ identity: ResolvedVisitorIdentity;
192
+ contextUser: UserInfo;
193
+ provider: IMetadataProvider;
194
+ }): Promise<number> {
195
+ return MergeVisitorIdentity(args);
196
+ }
197
+
177
198
  /** Re-keys notes scoped to `(Conversations entity, conversationId)` onto the resolved pair. */
178
199
  async function rekeyAnonymousNotes(
179
200
  conversationIds: string[],
@@ -217,7 +238,7 @@ async function rekeyAnonymousNotes(
217
238
  *
218
239
  * @returns a summary of what was archived/cleared.
219
240
  */
220
- export async function forgetVisitor(args: {
241
+ export async function ForgetVisitor(args: {
221
242
  visitorKey: string;
222
243
  applicationId: string;
223
244
  contextUser: UserInfo;
@@ -271,3 +292,13 @@ export async function forgetVisitor(args: {
271
292
  }
272
293
  return { notesArchived, conversationsCleared };
273
294
  }
295
+
296
+ /** @deprecated Use {@link ForgetVisitor}. */
297
+ export async function forgetVisitor(args: {
298
+ visitorKey: string;
299
+ applicationId: string;
300
+ contextUser: UserInfo;
301
+ provider: IMetadataProvider;
302
+ }): Promise<{ notesArchived: number; conversationsCleared: number }> {
303
+ return ForgetVisitor(args);
304
+ }