@nlabs/reaktor 1.20.2 → 1.20.3

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 (448) hide show
  1. package/README.md +284 -0
  2. package/docs/GENERATION.md +30 -0
  3. package/docs/LEAN_GRAPHQL.md +47 -0
  4. package/docs/NATIVE_PUSH.md +27 -1
  5. package/lib/actions/alfredFaq.js +23 -9
  6. package/lib/actions/analytics.js +9 -4
  7. package/lib/actions/apps.js +27 -12
  8. package/lib/actions/connections.js +6 -6
  9. package/lib/actions/content.js +43 -36
  10. package/lib/actions/contentGeneration.d.ts +19 -1
  11. package/lib/actions/contentGeneration.js +59 -24
  12. package/lib/actions/contentGenerationErrors.js +1 -1
  13. package/lib/actions/contentGenerationSources.d.ts +29 -0
  14. package/lib/actions/contentGenerationSources.js +103 -0
  15. package/lib/actions/conversations.js +1 -1
  16. package/lib/actions/crm.d.ts +6 -2
  17. package/lib/actions/crm.js +156 -36
  18. package/lib/actions/crmCanonicalOutcomes.d.ts +88 -0
  19. package/lib/actions/crmCanonicalOutcomes.js +398 -0
  20. package/lib/actions/crmCanonicalPolicy.d.ts +92 -0
  21. package/lib/actions/crmCanonicalPolicy.js +104 -0
  22. package/lib/actions/crmCheckoutRecovery.d.ts +72 -0
  23. package/lib/actions/crmCheckoutRecovery.js +413 -0
  24. package/lib/actions/crmCheckoutRecoveryPolicy.d.ts +38 -0
  25. package/lib/actions/crmCheckoutRecoveryPolicy.js +61 -0
  26. package/lib/actions/crmDeliveryEvents.d.ts +24 -0
  27. package/lib/actions/crmDeliveryEvents.js +207 -0
  28. package/lib/actions/crmDeliveryEvidence.d.ts +17 -0
  29. package/lib/actions/crmDeliveryEvidence.js +58 -0
  30. package/lib/actions/crmExecution.d.ts +125 -0
  31. package/lib/actions/crmExecution.js +830 -0
  32. package/lib/actions/crmFinancialEvidence.d.ts +12 -0
  33. package/lib/actions/crmFinancialEvidence.js +60 -0
  34. package/lib/actions/crmInsights.d.ts +60 -0
  35. package/lib/actions/crmInsights.js +225 -0
  36. package/lib/actions/crmLeadFollowups.d.ts +66 -0
  37. package/lib/actions/crmLeadFollowups.js +209 -0
  38. package/lib/actions/crmOutcomes.d.ts +106 -0
  39. package/lib/actions/crmOutcomes.js +289 -0
  40. package/lib/actions/crmRecoveryRetention.d.ts +13 -0
  41. package/lib/actions/crmRecoveryRetention.js +163 -0
  42. package/lib/actions/crmReminderDispatch.d.ts +10 -0
  43. package/lib/actions/crmReminderDispatch.js +65 -0
  44. package/lib/actions/crmSourceOwnership.d.ts +7 -0
  45. package/lib/actions/crmSourceOwnership.js +27 -0
  46. package/lib/actions/crmSupportInsights.d.ts +18 -0
  47. package/lib/actions/crmSupportInsights.js +47 -0
  48. package/lib/actions/crmWinback.d.ts +71 -0
  49. package/lib/actions/crmWinback.js +347 -0
  50. package/lib/actions/crmWinbackConsent.d.ts +29 -0
  51. package/lib/actions/crmWinbackConsent.js +158 -0
  52. package/lib/actions/crmWinbackPolicy.d.ts +33 -0
  53. package/lib/actions/crmWinbackPolicy.js +115 -0
  54. package/lib/actions/crmWinbackShopSource.d.ts +15 -0
  55. package/lib/actions/crmWinbackShopSource.js +63 -0
  56. package/lib/actions/crud.js +4 -3
  57. package/lib/actions/databaseAccounts.js +3 -2
  58. package/lib/actions/databaseProvisioningLease.js +1 -2
  59. package/lib/actions/dynamodb.js +1 -1
  60. package/lib/actions/email.d.ts +4 -1
  61. package/lib/actions/email.js +25 -3
  62. package/lib/actions/files.js +4 -3
  63. package/lib/actions/flags.js +2 -2
  64. package/lib/actions/geminiVideo.js +1 -1
  65. package/lib/actions/groups.js +9 -3
  66. package/lib/actions/higgsfield.js +1 -1
  67. package/lib/actions/imageGeneration.js +1 -1
  68. package/lib/actions/images.js +22 -20
  69. package/lib/actions/index.d.ts +56 -0
  70. package/lib/actions/index.js +42 -1
  71. package/lib/actions/ios.js +1 -1
  72. package/lib/actions/locations.js +3 -2
  73. package/lib/actions/merchantAccountExperiment.d.ts +50 -0
  74. package/lib/actions/merchantAccountExperiment.js +424 -0
  75. package/lib/actions/merchantAccountExperimentConfig.d.ts +7 -0
  76. package/lib/actions/merchantAccountExperimentConfig.js +32 -0
  77. package/lib/actions/merchantAccountExperimentHost.d.ts +69 -0
  78. package/lib/actions/merchantAccountExperimentHost.js +92 -0
  79. package/lib/actions/merchantAccountExperimentPolicy.d.ts +66 -0
  80. package/lib/actions/merchantAccountExperimentPolicy.js +121 -0
  81. package/lib/actions/merchantAccountExperimentRelay.d.ts +10 -0
  82. package/lib/actions/merchantAccountExperimentRelay.js +75 -0
  83. package/lib/actions/merchantCalendar.d.ts +34 -0
  84. package/lib/actions/merchantCalendar.js +119 -0
  85. package/lib/actions/merchantCalendarBookings.d.ts +17 -0
  86. package/lib/actions/merchantCalendarBookings.js +113 -0
  87. package/lib/actions/merchantCalendarDelegation.d.ts +80 -0
  88. package/lib/actions/merchantCalendarDelegation.js +353 -0
  89. package/lib/actions/merchantCalendarDiscovery.d.ts +38 -0
  90. package/lib/actions/merchantCalendarDiscovery.js +125 -0
  91. package/lib/actions/merchantCalendarEventHost.d.ts +105 -0
  92. package/lib/actions/merchantCalendarEventHost.js +16 -0
  93. package/lib/actions/merchantCalendarEventPrivacy.d.ts +7 -0
  94. package/lib/actions/merchantCalendarEventPrivacy.js +70 -0
  95. package/lib/actions/merchantCalendarEventRepository.d.ts +121 -0
  96. package/lib/actions/merchantCalendarEventRepository.js +295 -0
  97. package/lib/actions/merchantCalendarEventTransport.d.ts +65 -0
  98. package/lib/actions/merchantCalendarEventTransport.js +132 -0
  99. package/lib/actions/merchantCalendarEvents.d.ts +172 -0
  100. package/lib/actions/merchantCalendarEvents.js +365 -0
  101. package/lib/actions/merchantCalendarInvitationConsent.d.ts +28 -0
  102. package/lib/actions/merchantCalendarInvitationConsent.js +118 -0
  103. package/lib/actions/merchantCalendarManagedSource.d.ts +22 -0
  104. package/lib/actions/merchantCalendarManagedSource.js +24 -0
  105. package/lib/actions/merchantCalendarOAuth.d.ts +92 -0
  106. package/lib/actions/merchantCalendarOAuth.js +502 -0
  107. package/lib/actions/merchantCalendarOAuthConfig.d.ts +4 -0
  108. package/lib/actions/merchantCalendarOAuthConfig.js +30 -0
  109. package/lib/actions/merchantCalendarOAuthRepository.d.ts +57 -0
  110. package/lib/actions/merchantCalendarOAuthRepository.js +108 -0
  111. package/lib/actions/merchantCalendarOAuthTransport.d.ts +4 -0
  112. package/lib/actions/merchantCalendarOAuthTransport.js +25 -0
  113. package/lib/actions/merchantCalendarScopes.d.ts +4 -0
  114. package/lib/actions/merchantCalendarScopes.js +31 -0
  115. package/lib/actions/merchantFinance.d.ts +65 -0
  116. package/lib/actions/merchantFinance.js +244 -0
  117. package/lib/actions/merchantFinanceProvider.d.ts +57 -0
  118. package/lib/actions/merchantFinanceProvider.js +180 -0
  119. package/lib/actions/merchantOperations.d.ts +94 -0
  120. package/lib/actions/merchantOperations.js +489 -0
  121. package/lib/actions/messages.js +1 -1
  122. package/lib/actions/notifications.d.ts +5 -8
  123. package/lib/actions/notifications.js +30 -23
  124. package/lib/actions/ollamaGeneration.js +61 -31
  125. package/lib/actions/openaiResponseSession.d.ts +1 -1
  126. package/lib/actions/openaiResponseSession.js +90 -34
  127. package/lib/actions/payments.js +10 -9
  128. package/lib/actions/personas.d.ts +1 -1
  129. package/lib/actions/personas.js +18 -8
  130. package/lib/actions/phoneSupport.js +15 -9
  131. package/lib/actions/posts.js +42 -37
  132. package/lib/actions/providerCredentials.d.ts +35 -0
  133. package/lib/actions/providerCredentials.js +166 -0
  134. package/lib/actions/query.js +1 -1
  135. package/lib/actions/reactions.js +20 -20
  136. package/lib/actions/rum.js +2 -1
  137. package/lib/actions/s3.js +1 -1
  138. package/lib/actions/search.d.ts +1 -1
  139. package/lib/actions/search.js +3 -5
  140. package/lib/actions/sms.js +4 -3
  141. package/lib/actions/statistics.js +2 -4
  142. package/lib/actions/subscriptions.js +7 -7
  143. package/lib/actions/supportChannelSources.d.ts +66 -0
  144. package/lib/actions/supportChannelSources.js +183 -0
  145. package/lib/actions/supportCommerce.d.ts +62 -0
  146. package/lib/actions/supportCommerce.js +252 -0
  147. package/lib/actions/supportConnect.d.ts +39 -0
  148. package/lib/actions/supportConnect.js +224 -0
  149. package/lib/actions/supportContext.d.ts +31 -0
  150. package/lib/actions/supportContext.js +104 -0
  151. package/lib/actions/supportConversation.d.ts +102 -0
  152. package/lib/actions/supportConversation.js +100 -0
  153. package/lib/actions/supportEmailEvents.d.ts +20 -0
  154. package/lib/actions/supportEmailEvents.js +130 -0
  155. package/lib/actions/supportEmailHandoff.d.ts +114 -0
  156. package/lib/actions/supportEmailHandoff.js +356 -0
  157. package/lib/actions/supportOperations.d.ts +32 -0
  158. package/lib/actions/supportOperations.js +74 -0
  159. package/lib/actions/supportPolicy.d.ts +9 -0
  160. package/lib/actions/supportPolicy.js +44 -0
  161. package/lib/actions/supportPurposeConsent.d.ts +32 -0
  162. package/lib/actions/supportPurposeConsent.js +196 -0
  163. package/lib/actions/supportPurposePrivacy.d.ts +15 -0
  164. package/lib/actions/supportPurposePrivacy.js +181 -0
  165. package/lib/actions/supportSemanticReview.d.ts +64 -0
  166. package/lib/actions/supportSemanticReview.js +239 -0
  167. package/lib/actions/tags.js +8 -8
  168. package/lib/actions/users.js +64 -36
  169. package/lib/actions/videoGeneration.js +1 -1
  170. package/lib/actions/videos.d.ts +1 -1
  171. package/lib/actions/videos.js +29 -27
  172. package/lib/adapters/arangoAdapter.js +1 -1
  173. package/lib/adapters/contentAdapter.js +70 -25
  174. package/lib/adapters/fileAdapter.js +1 -1
  175. package/lib/adapters/geminiGenerationAdapter.js +1 -1
  176. package/lib/adapters/higgsfieldAdapter.js +1 -1
  177. package/lib/adapters/higgsfieldModelCatalog.js +1 -1
  178. package/lib/adapters/higgsfieldModels.js +1 -1
  179. package/lib/adapters/imageAdapter.js +85 -25
  180. package/lib/adapters/imageGenerationAdapter.js +1 -1
  181. package/lib/adapters/index.js +1 -1
  182. package/lib/adapters/messageAdapter.js +67 -19
  183. package/lib/adapters/postAdapter.js +95 -26
  184. package/lib/adapters/reaktorAdapter.js +1 -1
  185. package/lib/adapters/tagAdapter.js +2 -2
  186. package/lib/adapters/userAdapter.d.ts +2 -0
  187. package/lib/adapters/userAdapter.js +244 -64
  188. package/lib/assistant/core.js +40 -13
  189. package/lib/assistant/faq.js +109 -65
  190. package/lib/assistant/faqCore.js +10 -6
  191. package/lib/assistant/index.js +1 -1
  192. package/lib/assistant/service.d.ts +1 -1
  193. package/lib/assistant/service.js +92 -56
  194. package/lib/auth/admission.js +1 -1
  195. package/lib/auth/credentials.js +1 -1
  196. package/lib/auth/index.js +1 -1
  197. package/lib/auth/kmsSigner.js +1 -1
  198. package/lib/auth/managedSession.js +1 -1
  199. package/lib/auth/operation.js +1 -1
  200. package/lib/auth/webSession.js +1 -1
  201. package/lib/auth/webSessionCookies.js +1 -1
  202. package/lib/auth/webSessionHttp.js +1 -1
  203. package/lib/config.js +1 -1
  204. package/lib/constants/collections.d.ts +12 -11
  205. package/lib/constants/collections.js +13 -12
  206. package/lib/database/httpPage.js +1 -1
  207. package/lib/database/index.js +1 -3
  208. package/lib/database/webSessions.js +1 -1
  209. package/lib/database/webSignInLimiter.js +1 -1
  210. package/lib/durableChat/conversations.js +2 -2
  211. package/lib/durableChat/errors.js +1 -1
  212. package/lib/durableChat/events.js +1 -1
  213. package/lib/durableChat/index.js +1 -1
  214. package/lib/durableChat/membership.js +1 -1
  215. package/lib/durableChat/messageTypes.js +1 -1
  216. package/lib/durableChat/messages.js +2 -2
  217. package/lib/durableChat/transaction.js +1 -1
  218. package/lib/durableChat/types.js +1 -1
  219. package/lib/graphql/domainErrors.d.ts +11 -0
  220. package/lib/graphql/domainErrors.js +27 -0
  221. package/lib/graphql/index.d.ts +68 -0
  222. package/lib/graphql/index.js +289 -0
  223. package/lib/graphql/requestPolicy.d.ts +25 -0
  224. package/lib/graphql/requestPolicy.js +149 -0
  225. package/lib/graphql/responseEncoding.d.ts +4 -0
  226. package/lib/graphql/responseEncoding.js +163 -0
  227. package/lib/handlers/graphqlHandler.d.ts +2 -2
  228. package/lib/handlers/graphqlHandler.js +13 -10
  229. package/lib/index.js +1 -1
  230. package/lib/lambdas/actions/websockets.js +1 -1
  231. package/lib/lambdas/authorizer.d.ts +3 -3
  232. package/lib/lambdas/authorizer.js +7 -6
  233. package/lib/lambdas/connection.js +13 -7
  234. package/lib/lambdas/utils/message.js +1 -1
  235. package/lib/lambdas/utils/websocket.js +3 -2
  236. package/lib/mocks/conversation.d.ts +1 -1
  237. package/lib/mocks/conversation.js +2 -2
  238. package/lib/mocks/file.js +1 -1
  239. package/lib/mocks/group.d.ts +1 -1
  240. package/lib/mocks/group.js +2 -2
  241. package/lib/mocks/image.js +1 -1
  242. package/lib/mocks/post.js +1 -1
  243. package/lib/mocks/tag.js +2 -2
  244. package/lib/mocks/user.js +3 -3
  245. package/lib/mocks/video.js +3 -3
  246. package/lib/mutations/analytics/analytics.js +1 -1
  247. package/lib/mutations/content/content.js +1 -1
  248. package/lib/mutations/crm/crm.js +402 -14
  249. package/lib/mutations/events/events.js +14 -14
  250. package/lib/mutations/flags/flags.js +1 -1
  251. package/lib/mutations/groups/groups.js +1 -1
  252. package/lib/mutations/higgsfield/higgsfield.js +1 -1
  253. package/lib/mutations/images/images.js +1 -1
  254. package/lib/mutations/index.d.ts +4 -0
  255. package/lib/mutations/index.js +69 -69
  256. package/lib/mutations/locations/locations.js +1 -1
  257. package/lib/mutations/messages/messages.js +1 -1
  258. package/lib/mutations/personas/personas.js +5 -5
  259. package/lib/mutations/posts/posts.js +1 -1
  260. package/lib/mutations/reactions/reactions.js +8 -8
  261. package/lib/mutations/rum/rum.js +1 -1
  262. package/lib/mutations/statistics/statistics.js +1 -1
  263. package/lib/mutations/subscriptions/subscriptions.js +1 -1
  264. package/lib/mutations/tags/tags.js +1 -1
  265. package/lib/mutations/users/users.js +40 -40
  266. package/lib/mutations/videos/videos.js +1 -1
  267. package/lib/nativePush/graphql.js +1 -1
  268. package/lib/nativePush/index.js +1 -1
  269. package/lib/nativePush/migrations.js +1 -1
  270. package/lib/nativePush/nativePushContract.fixture.js +1 -1
  271. package/lib/nativePush/payload.js +1 -1
  272. package/lib/nativePush/repository.js +1 -1
  273. package/lib/nativePush/service.js +1 -1
  274. package/lib/nativePush/snsProvider.js +1 -1
  275. package/lib/nativePush/types.js +1 -1
  276. package/lib/notifications/certificateProvider.d.ts +36 -0
  277. package/lib/notifications/certificateProvider.js +91 -0
  278. package/lib/objectTypes/analytics.js +2 -2
  279. package/lib/objectTypes/app.js +33 -33
  280. package/lib/objectTypes/bankAccount.js +1 -1
  281. package/lib/objectTypes/connection.js +1 -1
  282. package/lib/objectTypes/content.js +1 -1
  283. package/lib/objectTypes/contentGeneration.js +1 -1
  284. package/lib/objectTypes/conversation.js +15 -15
  285. package/lib/objectTypes/creditCard.js +1 -1
  286. package/lib/objectTypes/crm.js +1 -1
  287. package/lib/objectTypes/document.js +1 -1
  288. package/lib/objectTypes/error.js +1 -1
  289. package/lib/objectTypes/event.js +9 -9
  290. package/lib/objectTypes/external.js +1 -1
  291. package/lib/objectTypes/file.js +19 -19
  292. package/lib/objectTypes/filter.js +1 -1
  293. package/lib/objectTypes/flag.js +1 -1
  294. package/lib/objectTypes/group.js +3 -3
  295. package/lib/objectTypes/higgsfield.js +1 -1
  296. package/lib/objectTypes/iapSubscription.js +5 -5
  297. package/lib/objectTypes/image.js +14 -14
  298. package/lib/objectTypes/imageGeneration.js +1 -1
  299. package/lib/objectTypes/index.js +1 -1
  300. package/lib/objectTypes/location.js +17 -17
  301. package/lib/objectTypes/message.js +23 -23
  302. package/lib/objectTypes/passcode.js +1 -1
  303. package/lib/objectTypes/persona.js +48 -48
  304. package/lib/objectTypes/plan.js +41 -41
  305. package/lib/objectTypes/post.js +23 -23
  306. package/lib/objectTypes/query.js +1 -1
  307. package/lib/objectTypes/reaction.js +9 -9
  308. package/lib/objectTypes/relation.js +1 -1
  309. package/lib/objectTypes/rum.js +1 -1
  310. package/lib/objectTypes/search.js +1 -1
  311. package/lib/objectTypes/statistics.js +1 -1
  312. package/lib/objectTypes/subscription.js +17 -17
  313. package/lib/objectTypes/tag.js +7 -7
  314. package/lib/objectTypes/user.js +98 -98
  315. package/lib/objectTypes/video.js +47 -47
  316. package/lib/objectTypes/videoGeneration.js +1 -1
  317. package/lib/organizations/accountLifecycle.js +1 -1
  318. package/lib/organizations/authorization.js +1 -1
  319. package/lib/organizations/billing.js +1 -1
  320. package/lib/organizations/billingProvider.js +1 -1
  321. package/lib/organizations/billingUpdates.js +1 -1
  322. package/lib/organizations/index.js +1 -1
  323. package/lib/organizations/mail.js +1 -1
  324. package/lib/organizations/memberDirectory.js +1 -1
  325. package/lib/organizations/membership.js +1 -1
  326. package/lib/organizations/passwordRecovery.js +1 -1
  327. package/lib/organizations/plans.js +1 -1
  328. package/lib/organizations/providerPagination.js +1 -1
  329. package/lib/organizations/reconciliation.js +1 -1
  330. package/lib/organizations/signup.js +1 -1
  331. package/lib/organizations/store.js +1 -1
  332. package/lib/organizations/types.js +1 -1
  333. package/lib/organizations/verification.js +1 -1
  334. package/lib/queries/analytics/analytics.js +8 -8
  335. package/lib/queries/content/content.js +1 -1
  336. package/lib/queries/crm/crm.js +367 -108
  337. package/lib/queries/events/events.js +4 -4
  338. package/lib/queries/flags/flags.js +1 -1
  339. package/lib/queries/groups/groups.js +11 -11
  340. package/lib/queries/higgsfield/higgsfield.js +1 -1
  341. package/lib/queries/images/images.js +86 -81
  342. package/lib/queries/index.d.ts +5 -1
  343. package/lib/queries/index.js +70 -70
  344. package/lib/queries/locations/locations.js +1 -1
  345. package/lib/queries/messages/messages.js +56 -52
  346. package/lib/queries/personas/personas.js +1 -1
  347. package/lib/queries/posts/posts.js +142 -134
  348. package/lib/queries/query/query.js +1 -1
  349. package/lib/queries/reactions/reactions.js +11 -11
  350. package/lib/queries/statistics/statistics.js +1 -1
  351. package/lib/queries/subscriptions/subscriptions.js +17 -17
  352. package/lib/queries/tags/tags.js +1 -1
  353. package/lib/queries/users/users.js +10 -10
  354. package/lib/queries/videos/videos.js +1 -1
  355. package/lib/s3/index.d.ts +5 -0
  356. package/lib/s3/index.js +6 -0
  357. package/lib/templates/email/layout.js +1 -1
  358. package/lib/templates/email/passwordForgot.js +1 -1
  359. package/lib/templates/email/passwordRecovery.js +1 -1
  360. package/lib/templates/email/verifyEmail.js +1 -1
  361. package/lib/templates/email/welcome.js +1 -1
  362. package/lib/templates/sms/passwordForgot.js +1 -1
  363. package/lib/templates/sms/passwordRecovery.js +1 -1
  364. package/lib/templates/sms/verifyEmail.js +1 -1
  365. package/lib/templates/sms/verifyPhone.js +1 -1
  366. package/lib/templates/sms/welcome.js +1 -1
  367. package/lib/types/analytics.types.js +1 -1
  368. package/lib/types/apps.types.js +1 -1
  369. package/lib/types/arangodb.types.js +1 -1
  370. package/lib/types/auth.types.d.ts +2 -0
  371. package/lib/types/auth.types.js +1 -1
  372. package/lib/types/connections.types.js +1 -1
  373. package/lib/types/content.types.js +1 -1
  374. package/lib/types/conversations.types.js +1 -1
  375. package/lib/types/crm.types.d.ts +6 -0
  376. package/lib/types/crm.types.js +1 -1
  377. package/lib/types/databaseCredentials.types.js +1 -1
  378. package/lib/types/email.types.js +1 -1
  379. package/lib/types/error.types.js +1 -1
  380. package/lib/types/files.types.js +1 -1
  381. package/lib/types/flags.types.js +1 -1
  382. package/lib/types/google.types.js +1 -1
  383. package/lib/types/groups.types.js +1 -1
  384. package/lib/types/images.types.js +1 -1
  385. package/lib/types/index.js +1 -1
  386. package/lib/types/locations.types.js +1 -1
  387. package/lib/types/messages.types.js +1 -1
  388. package/lib/types/notifications.types.js +1 -1
  389. package/lib/types/payments.types.js +1 -1
  390. package/lib/types/personas.types.js +1 -1
  391. package/lib/types/posts.types.js +1 -1
  392. package/lib/types/rum.types.js +1 -1
  393. package/lib/types/statistics.types.js +1 -1
  394. package/lib/types/tags.types.js +1 -1
  395. package/lib/types/users.types.d.ts +3 -1
  396. package/lib/types/users.types.js +2 -5
  397. package/lib/types/videos.types.d.ts +3 -3
  398. package/lib/types/videos.types.js +1 -1
  399. package/lib/types/websockets.types.js +1 -1
  400. package/lib/upload.d.ts +1 -1
  401. package/lib/upload.js +5 -4
  402. package/lib/utils/adapterUtils.js +1 -1
  403. package/lib/utils/analyticsUtils.js +6 -8
  404. package/lib/utils/appContext.js +7 -3
  405. package/lib/utils/aqlHelpers.d.ts +2 -2
  406. package/lib/utils/aqlHelpers.js +3 -3
  407. package/lib/utils/arangodbUtils.js +3 -3
  408. package/lib/utils/authUtils.js +20 -3
  409. package/lib/utils/awsUtils.js +1 -1
  410. package/lib/utils/collectionRegistry.js +49 -49
  411. package/lib/utils/contextUtils.js +1 -1
  412. package/lib/utils/databaseCredentials.js +1 -1
  413. package/lib/utils/dbI18n.example.d.ts +7 -7
  414. package/lib/utils/dbI18n.example.js +25 -24
  415. package/lib/utils/dbI18n.js +2 -2
  416. package/lib/utils/generationCallback.js +1 -1
  417. package/lib/utils/googleTranslate.js +18 -17
  418. package/lib/utils/graphqlUtils.d.ts +2 -0
  419. package/lib/utils/graphqlUtils.js +1 -1
  420. package/lib/utils/imageUtils.js +1 -1
  421. package/lib/utils/index.js +1 -1
  422. package/lib/utils/languageDetection.js +18 -18
  423. package/lib/utils/localeUtils.example.js +47 -46
  424. package/lib/utils/localeUtils.js +1 -1
  425. package/lib/utils/mediaAccess.js +1 -1
  426. package/lib/utils/middlewareUtils.d.ts +1 -1
  427. package/lib/utils/middlewareUtils.js +1 -1
  428. package/lib/utils/nodeConsole.d.ts +6 -0
  429. package/lib/utils/nodeConsole.js +12 -0
  430. package/lib/utils/nodeRealtime.js +1 -1
  431. package/lib/utils/opaqueToken.js +1 -1
  432. package/lib/utils/queryBuilder.d.ts +4 -4
  433. package/lib/utils/queryBuilder.js +4 -10
  434. package/lib/utils/schemaUtils.js +10 -8
  435. package/lib/utils/secretDatabase.js +1 -1
  436. package/lib/utils/sessionUtils.js +1 -1
  437. package/lib/utils/stripeUtils.d.ts +1 -1
  438. package/lib/utils/stripeUtils.js +2 -2
  439. package/lib/utils/stripeUtils.ts.bak +1 -1
  440. package/lib/utils/templateUtils.js +1 -1
  441. package/lib/utils/testUtils.d.ts +1 -1
  442. package/lib/utils/testUtils.js +30 -33
  443. package/lib/utils/translationQueue.d.ts +1 -1
  444. package/lib/utils/translationQueue.example.d.ts +14 -23
  445. package/lib/utils/translationQueue.example.js +75 -74
  446. package/lib/utils/translationQueue.js +19 -19
  447. package/lib/videoProcessing.js +7 -4
  448. package/package.json +50 -38
package/README.md CHANGED
@@ -1703,8 +1703,27 @@ Support requires user confirmation, valid contact details and a stable `web-UUID
1703
1703
 
1704
1704
  The backend factories are exported from the server-only `@nlabs/reaktor/assistant` subpath in the release containing the extraction. See [assistant endpoint, configuration and rollout](docs/ASSISTANT.md) for complete requests/responses, validation, limits, adapters and publication/deployment status.
1705
1705
 
1706
+ ## Minimized CRM and Support aggregate reads (source extension)
1707
+
1708
+ `crm.merchantInsights(appId: ID!, from: String!, to: String!, productId: ID)` returns `crm_merchant_insights_v1` JSON for a timezone-qualified window of at most 90 days. It reads bounded source contact/marketing-opt-in and Support type/status counters. Counts below five are withheld; source windows exceeding 10,000 records are marked truncated. No identities, ticket text, emails, customer values, campaign attribution or lead pipeline are returned. Product-scoped reads do not imply product-related contact acquisition.
1709
+
1710
+ Administrators issue an explicit scoped key with `crm.createInsightsReadKey(appId: ID!, scopes: [String!]!, expiresAt: String!)`; allowed scopes are `crm:aggregates` and `support:aggregates`. The host must provide its existing authorized application database resolver. The API returns the secret once and stores only its SHA256 hash, exact app/database scope, administrator owner and expiry in the owner API database. Expiry must be future and at most 365 days. `crm.revokeInsightsReadKey(appId: ID!, id: ID!)` revokes that credential. No customer records or graph edges change.
1711
+
1712
+ Send the opaque key as `Authorization: Bearer <readKey>` only to the verified owner GraphQL endpoint. It is isolated from ordinary session authentication; it grants no other CRM/Support/user actions. Reads check scope, hash, expiry and revocation before and after aggregation. Public package helpers are `createCrmInsightsReadKey`, `getCrmMerchantInsights` and `revokeCrmInsightsReadKey`. Keep keys server-side; rotate/revoke through the owner API and clear consumer caches when grants or projects are removed.
1713
+
1714
+ This extension needs a reviewed compatible package build adopted by the owner host and deployment of those fields before a consumer can connect. It does not establish a live service merely because a local source checkout exports it. Existing email campaigns, private ticket messages, appointments and merchant invoices need their separate consent, source, frozen-action and execution/reconciliation contracts.
1715
+
1716
+
1706
1717
  ## Account-scoped multipart S3 primitives
1707
1718
 
1719
+ Use the server-only `@nlabs/reaktor/s3` entry when only S3 helpers are needed:
1720
+
1721
+ ```ts
1722
+ import {s3Get, s3Put, s3GetUploadPartSignedUrl} from '@nlabs/reaktor/s3';
1723
+ ```
1724
+
1725
+ This entry reexports the same helpers without loading the root GraphQL, database or WebSocket modules. Import does not discover ambient private configuration or start provider requests. Existing Config still reads the current working directory's public `package.json` manifest on import; this entry does not promise zero filesystem activity. Supply an explicit nonempty Bucket and an injected S3Client to keep helper calls independent of global configuration/credential discovery. Existing root imports remain supported and keep their broader startup behavior.
1726
+
1708
1727
  `s3Head`, `s3Delete`, `s3CreateMultipartUpload`, `s3CompleteMultipartUpload`, and `s3AbortMultipartUpload` accept an optional second `S3Client` argument. `s3ListParts(params, client?)` returns exactly one raw SDK page, including truncation, markers, ordering and checksums. All propagate original errors; none retry, paginate or translate missing/denied errors.
1709
1728
 
1710
1729
  Explicit truthy buckets with an injected client never read global configuration/credentials. Empty/missing buckets fall back to `aws.s3.Bucket || aws.s3.bucket`. Injected branches copy caller inputs. Existing no-client helpers retain their legacy bucket mutations; new ListParts copies in both branches.
@@ -1716,3 +1735,268 @@ await s3GetUploadPartSignedUrl({Bucket: bucket, ChecksumSHA256: checksum,
1716
1735
  ContentLength: bytes, Expires: 900, Key: key, PartNumber: part, UploadId: uploadId},
1717
1736
  client, {unhoistableHeaders: new Set(['x-amz-checksum-sha256'])});
1718
1737
  ```
1738
+
1739
+ These additions require a verified compatible release before registry adoption. Local compatible archives preserve the installed baseline manifest/dependencies and replace only the S3 module/declarations; source checkout version alone is not a release guarantee.
1740
+
1741
+ ## Scoped merchant lead follow-up and Support operations
1742
+
1743
+ `generateCrmLeadFollowupCandidates` and GraphQL `crm.leadFollowupCandidates(input:JSON!)` read bounded native new/qualified lead opportunities from current consented campaign associations. Administrator-issued `crm:lead_followup` requires separate `crm:outreach` and exact organization/project/campaign bounds. Candidates expire within 15 minutes and source/grant/consent expiry. Existing exact execution previews accept a frozen candidate/revision binding; native source validation and once-only opportunity claims prevent concurrent or different-request-key duplicate sending. Unknown submission stays held. Generation alone sends nothing; these are current source opportunities, not fabricated historical events or inactivity cohorts.
1744
+
1745
+ `readSupportInbox` and GraphQL `crm.supportInbox(input:JSON!)` require native `support:read` and return bounded ticket status/priority/type/revision and eligible operator identifiers, with truncation and expiry. `support:manage` separately authorizes reviewed assignment, priority and internal escalation through the existing preview/decision/execution ledger with source and operator revisions. Escalation updates native ticket metadata without external notifications. `summarizeCampaignSupport` uses existing consented campaign associations for suppressed operational topic/status/resolution counters; it exposes no ticket text or customer testimonials. New pure public policy helpers include `supportPriorities`, `validSupportManagement` and `supportOperatorRevision`. Portable consumer adoption still requires compatible owner deployment and real granted source configuration.
1746
+
1747
+ ## Trusted native SES delivery relay
1748
+
1749
+ `ingestCrmDeliveryEvent(context,input)` and GraphQL mutation `crm.ingestDeliveryEvent(input:JSON!)`
1750
+ require a separately administrator-issued `crm:delivery_events` execution key. Keep that key on an
1751
+ explicitly trusted server relay; it is not an ordinary Ads customer-execution scope and does not grant
1752
+ outreach or target access. The relay must establish authentic AWS/provider event provenance before
1753
+ calling the owner operation. This operation does not verify raw SNS signatures, subscriptions or
1754
+ anonymous browser claims. Bridge deployment and SES event-destination configuration remain separate.
1755
+
1756
+ The exact normalized input is `{appId,eventId,receiptId,providerMessageId,kind,occurredAt,bounceType?}`.
1757
+ `kind` is `delivered`, `bounce` or `complaint`; bounce classification must be exactly `Permanent`,
1758
+ `Transient` or `Undetermined` when kind is bounce. No email, recipient/body, SNS envelope or additional
1759
+ properties are accepted. `receiptId` identifies the actual native execution receipt returned by the
1760
+ sending workflow, and `providerMessageId` must match its accepted SES MessageId. Native sends now
1761
+ persist `providerAcceptedAt`. Legacy records lacking that timestamp and submitting/unknown sends
1762
+ remain held; delivery claims cannot repair uncertain submission or trigger retry.
1763
+
1764
+ Events are bounded to thirty days, no more than one minute ahead of the owner clock or before recorded
1765
+ provider acceptance, and no more than thirty days after acceptance. Each receipt accepts at most 32
1766
+ unique events. Same app/event-ID payload replay is idempotent across key rotation; conflicting reuse is
1767
+ rejected. Minimized event metadata and receipt/user graph edges commit atomically with suppression.
1768
+ An exact current recipient is required; changed/deleted recipients hold. Bounce of any classification
1769
+ sets a delivery hold without claiming permanent rejection; complaint is monotonic over later bounces.
1770
+ Delivered events and replays never clear existing delivery holds or marketing opt-out. The returned
1771
+ `suppressed` value reflects the current delivery hold, not marketing permission. No sends or retries
1772
+ occur. Relay authority is rechecked before writes and immediately before transaction commit; native
1773
+ app writes use an exclusive transaction while the platform grant registry remains its existing separate
1774
+ authority boundary. Compatible owner deployment and real source relay acceptance remain outstanding.
1775
+
1776
+ Native administrator action `eraseCrmDeliveryEvidence(context,appId,userId)` and GraphQL mutation
1777
+ `crm.eraseDeliveryEvidence(appId:ID!,userId:ID!)` atomically remove that user's delivery event records and
1778
+ both event edges in the current owned app database. They preserve a hash-only tombstone and original
1779
+ send receipts; previously accepted messages cannot be reingested across relay key rotation. A genuinely
1780
+ new accepted send after erasure may start new evidence. This action does not clear suppression or consent,
1781
+ remove users, resend or change unknown submissions. Call it only from a configured authorized native
1782
+ privacy workflow; it is not granted by a relay key or exposed through ordinary Ads execution sources.
1783
+
1784
+
1785
+ Ordinary receipt inspection now includes optional minimized `deliveryEvidence` only for actual applied
1786
+ SES receipts. Its exact shape is `{schemaVersion:'crm_delivery_evidence_v1',status,generatedAt,validUntil,
1787
+ negativeHold,events:[{kind,occurredAt,bounceType?}]}`. Status is `available`, `unavailable` or `erased`;
1788
+ only available evidence supplies a boolean current native delivery hold. Other statuses supply null and
1789
+ an empty timeline. Reports contain no event IDs, relay key, recipient, message body or raw provider data.
1790
+ The snapshot expires within fifteen minutes and no later than ordinary receipt authority expiry.
1791
+ Inspection rechecks the same current grant after reading the native ledger. Missing, corrupt, erased or
1792
+ changed-recipient evidence does not imply delivery success or permission. Available delivered reports
1793
+ do not clear suppression or consent; transient bounce remains a hold rather than proven permanent rejection.
1794
+
1795
+ Ads accepts this strict projection through its existing ordinary receipt-read path, rejects nested private
1796
+ fields before persistence, clears cached evidence on failed or revoked refresh, and withholds the timeline
1797
+ after its deadline or source withdrawal. No relay-write scope is exposed through Ads and no retry follows
1798
+ a delivery report. A configured source bridge, compatible native deployment, provider event-destination
1799
+ configuration and administrator privacy-workflow adoption remain separate live acceptance requirements.
1800
+
1801
+ ### Canonical CRM lifecycle and verified settlement source
1802
+
1803
+ Public actions `createCrmCanonicalReadKey`, `getCrmCanonicalOutcomes`,
1804
+ `correctCrmCanonicalObservation`, and `registerCrmCanonicalFinanceBinding` are exposed through
1805
+ `crm.canonicalOutcomes(input: JSON!)` and the corresponding CRM administrator mutations.
1806
+ `crm:canonical_outcomes` is a distinct read scope bound to app, organization, project and campaigns.
1807
+ `crm:canonical_finance` additionally requires exact existing owned issuer IDs. Keys remain actor bound and expiring.
1808
+
1809
+ A campaign association must separately record `canonicalConsent` with purpose `canonical_campaign_outcomes`,
1810
+ explicit evidence reference and expiry no later than its campaign association consent. New native stage records
1811
+ contain actual occurrence time, immutable event ID and version. Legacy unversioned or truncated histories are
1812
+ explicitly incomplete; this API never invents an occurrence or silently deletes prior history from such a read.
1813
+ Corrections target an actual existing observation and retain its occurrence time under source/event/association CAS.
1814
+ A completed read emits versioned tombstones for consent/source withdrawal. Source snapshot metadata is bounded
1815
+ at 1,000 events and has a 30-day TTL; it contains minimized references, not form or ticket text.
1816
+
1817
+ Financial registration only binds existing native invoice, payment evidence, customer order, user and native
1818
+ payment documents under exact source revisions. It does not issue invoices or establish settlement authenticity.
1819
+ A financial read verifies the actual existing Stripe charge, bound customer and complete refund evidence using
1820
+ GET operations only, requires captured paid live settlement and matching immutable legal amounts/currency,
1821
+ and rechecks current native evidence and grant bounds after transport. Failed/uncertain verification is held.
1822
+ Stripe evidence alone does not prove a Shopify order namespace: financial observations remain
1823
+ `verified_settlement_namespace_unproven` until a consumer independently reads the current owned Shopify
1824
+ order and matches its exact provider payment/refund identities. Never sum these rows with Shopify revenue
1825
+ without that proof. No charge, refund, invoice issuance or external send is performed by this contract.
1826
+
1827
+ ### Advisory external calendar busy reads
1828
+
1829
+ `readMerchantCalendarBusy(context,{appId,from,resourceId,sourceId,to})` and
1830
+ `crm.merchantCalendarBusy(input: JSON!)` provide a separate Scheduling-owned Google Calendar busy-time
1831
+ read. Require an actual current `scheduling:read` grant, exact current native resource and explicit
1832
+ server-only `MERCHANT_CALENDAR_SOURCES` configuration (`appId,calendarId,expiresAt,id,resourceId,scopes,token`).
1833
+ Configure the actual obtained Google free/busy or read scope and finite token expiry; source rotation
1834
+ and native resource/grant changes invalidate an in-flight read. No native provider credential creation,
1835
+ OAuth refresh controller or token persistence API is implied by this configuration.
1836
+
1837
+ Only at most seven days within the next ninety days are read, with at most500 busy ranges and one
1838
+ configured calendar. Return minimized UTC intervals, resource timezone, revision and at most five-minute
1839
+ freshness. Group expansion, partial provider errors, absent calendars and mismatched time ranges hold
1840
+ evidence. Empty busy ranges mean no busy intervals were returned for this source/window; they do not
1841
+ establish complete availability. No event names, participant/email/calendar identities or keys are returned.
1842
+ This advisory read never creates an external event or native reservation, sends invitations or changes
1843
+ booking execution. Combining external availability with native reservation needs a separately validated
1844
+ collision and provider-race contract. Official operation:
1845
+ https://developers.google.com/workspace/calendar/api/v3/reference/freebusy/query
1846
+
1847
+ ### Native consented checkout recovery
1848
+
1849
+ `generateCrmCheckoutRecoveryCandidates` reads only registered, current Shopify abandoned checkout identities. It requires
1850
+ independent `crm:checkout_recovery` plus `crm:outreach` authority and exact `recoveryBounds` (organization, project,
1851
+ campaigns, source IDs, 24–720 hour recipient cooldown). Lead follow-up authority cannot enumerate recovery candidates.
1852
+ `recordCrmCheckoutRecoveryConsent` accepts only the authenticated native customer's own revision and explicit independent
1853
+ `checkout_recovery` purpose (at most 30 days); administrators cannot register consent on somebody else's behalf.
1854
+ `registerCrmCheckoutRecoveryBinding` is administrator-only and binds an existing consented campaign association, current
1855
+ native recipient and independently read current Shopify customer/checkout. Registration sends nothing.
1856
+
1857
+ Owner-only `CRM_CHECKOUT_RECOVERY_SOURCES` configuration contains exact app/organization/project/source ID, shop domain,
1858
+ server-held Shopify token, token expiry and explicit protected orders/customers access approval. Reads target fixed Shopify
1859
+ Admin API 2026-10, verify actual shop and current installed `read_orders`/`read_customers` scopes, and query the exact
1860
+ checkout with `status:open recovery_state:not_recovered email_state:not_sent`. Completed, absent, ambiguous, recovered,
1861
+ externally emailed, unsubscribed, suppressed, expired, changed or unavailable evidence is held. Candidate data is bounded
1862
+ and expires within 15 minutes; registration metadata and graph edges have at most the customer's 30-day consent lifetime.
1863
+
1864
+ Existing `previewCrmExecution` accepts independent `recovery: {candidateId, revision}` for `crm_outreach`. The native preview
1865
+ freezes one recipient and exact plain-text body with unsubscribe capability; exact approval remains a separate operation.
1866
+ Execution repeats provider completion/consent/source token and native recipient/association checks, atomically claims the
1867
+ stable shop/checkout/customer/campaign opportunity, and uses the existing durable SES ledger. Actual recent provider
1868
+ acceptance and every unknown/submitting marketing receipt enforce recipient cadence. Unknown submission outcomes remain
1869
+ claimed and cannot be retried automatically or bypassed by rotating grants. No paid operations, bookings, financial
1870
+ movements, implicit consent, automatic recovery sends, inferred inactivity or unsupported win-back eligibility are added.
1871
+
1872
+ GraphQL exposes `crm.checkoutRecoveryCandidates(input: JSON!)`, `crm.checkoutRecoveryConsent(input: JSON!)` and
1873
+ `crm.registerCheckoutRecoveryBinding(input: JSON!)`; the existing exact preview/approval/execution fields remain in use.
1874
+
1875
+ ### Permitted native Support order/product context
1876
+
1877
+ `readSupportContext(context, {appId, ticketId, ticketRevision})` and GraphQL `crm.supportContext(input: JSON!)` require a separately issued `support:context` execution-key scope plus `support:read`. The owner checks current app/database authorization, exact actionable ticket revision, explicit app-stamped native customer identity, and exact order/product references. Missing, ambiguous, deleted, legacy-unscoped and cross-customer references are held. Source and grant revisions are checked again before returning minimized IDs/revisions, native product title, recorded currency/date, held/reference status and a snapshot lasting at most 15 minutes. Contact details, amounts and ticket/conversation content are excluded. Provenance is `native_recorded_unverified_shop`: it does not verify a Shopify shop/customer namespace, live order/delivery state or settlement, and grants no reply/refund/payment authority.
1878
+
1879
+ For genuine newly owned source records, `ingestShopifyCustomerOrder(context, input, {appId})` and `createSupportTicket(context, input, {appId})` reauthorize administrator/app scope inside the owner helper. Their existing GraphQL mutations pass explicit `appId` to this supported path. New order/product/customer keys are app-scoped; customer lookup uses exact app and source customer ID rather than email matching. New records receive immutable app labels. Existing conflicting/deleted/unscoped labels are rejected; legacy records are not retroactively stamped or joined. Product ingestion is bounded to 50 referenced products. Scope-less legacy helper calls preserve their prior behavior, but those unscoped records are ineligible for this context read. Customer/order/product relationships remain native graph edges; this path is source registration, not proof of financial settlement. Deployed owner adoption and genuinely authorized source ingestion are required before real context exists.
1880
+
1881
+ ### Explicit verified recovery links and content retention
1882
+
1883
+ Recovery candidates can expose `recoveryLinkHash`, never the checkout capability URL.
1884
+ The source proof reads Shopify's `abandonedCheckoutUrl` plus actual shop identity and primary domain;
1885
+ only exact bounded HTTPS provider-owned URLs are supported. `includeVerifiedRecoveryLink: true`
1886
+ in a recovery preview explicitly appends that exact current URL before the native unsubscribe capability.
1887
+ The reviewed body has a hard 5000-character bound; an unsupported URL or changed source is held.
1888
+ Ordinary previews and older candidates without a link hash keep their existing behavior.
1889
+
1890
+ Recovery receipts carry `contentStatus: current | redacted`. Redacted receipts omit `body`, `subject`,
1891
+ and `recipient.email`; absence never represents an unchanged approved message. Reads recheck the
1892
+ current source, purpose consent, suppression and expiry before retaining content. Rejection, expiry,
1893
+ and grant revocation remove capability-bearing content without deleting source hashes, unsubscribe
1894
+ verification, exact receipt revision, provider acceptance or durable opportunity claims. Unknown outcomes
1895
+ remain unknown and cannot retry. Redacted content cannot be approved or submitted.
1896
+
1897
+ Native hosts can call administrator-only `retainCrmCheckoutRecoveryContent(context, appId)`
1898
+ (or `crm.retainCheckoutRecoveryContent`) for bounded 100-row expired/rejected content cleanup.
1899
+ A host maintenance worker should continue until it returns fewer than 100. The public receipt never
1900
+ exports the private payload/grant/unsubscribe hashes. Existing unsubscribe verification keeps working
1901
+ after content redaction or sending-grant expiry/revocation. Non-recovery content is unchanged.
1902
+
1903
+ ### Bounded Amazon Connect Support metadata (unreleased)
1904
+
1905
+ `configureSupportConnectSource`, `bindSupportConnectConversation` and
1906
+ `eraseSupportConnectEvidence` require ordinary native administrator authority. Configure an exact
1907
+ app database, Connect instance ARN, path-free IAM relay role and expiry. Binding requires a current,
1908
+ explicitly app-owned ticket and native user revision; legacy unscoped records are held. Contact IDs
1909
+ remain private. Erasure preserves opaque replay tombstones and does not send or retry anything.
1910
+
1911
+ `ingestSupportConnectMetadata` is a private host adapter API, requiring a current native
1912
+ `support:channel_ingest` grant and the AWS gateway-owned IAM principal. It performs one bounded
1913
+ `DescribeContact` call, verifies the exact contact ARN and VOICE channel, and records only actual
1914
+ initiation/disconnect timestamps. Claimed milestones, identity matching, transcripts and reply
1915
+ operations are unsupported. The relay scope is deliberately excluded from ordinary Ads credentials.
1916
+
1917
+ `readSupportConnectEvidence` / `crm.supportChannelEvidence` require current `support:read` authority.
1918
+ The minimized result contains source/ticket revision, channel, observed/ended timestamps, provenance,
1919
+ generation time and validity deadline; no contact/customer IDs, bodies, amounts or relay credentials.
1920
+ Validity is clamped to current read, source, contributing binding and relay authority expiries, at most
1921
+ 15 minutes. Current source/binding/grant/ticket changes hold old evidence. Completion is not resolution,
1922
+ message delivery, consent, settlement or a sale.
1923
+
1924
+ Core source/binding/event/grant checks and replay insertion share one native transaction. Tickets and
1925
+ users reside in the app database: their revisions are checked before the provider read, after it,
1926
+ immediately before core commit, and independently during inspection. Those checks do not lock the
1927
+ app database across the core transaction. A residual cross-database read-to-commit race remains;
1928
+ this metadata-only API must not be used as an atomic customer-action authorization proof.
1929
+
1930
+ Authenticated reads perform bounded retention cleanup (100 expired bindings and 200 events per read;
1931
+ events retain at most 30 days). Dormant sources require an owner-operated cleanup schedule; no live
1932
+ schedule or deployment is installed here. Tombstones retain only opaque hashes required to prevent
1933
+ re-ingestion after privacy erasure.
1934
+
1935
+ The host route is `POST /crm/support/channels/connect`, requiring AWS_IAM and exact qualified-Lambda
1936
+ invoke permissions. `apps/api/config/support-connect-route.yaml` is a review-only CloudFormation
1937
+ plan, not an automatic deployment. It separates the relay's exact execute-api route from the runtime's
1938
+ exact instance/contact `connect:DescribeContact` resource and documented `connect:Channel=VOICE`
1939
+ condition. Existing broader invocation policies must be reviewed separately. Local trusted-gateway
1940
+ fixtures do not implement or certify live SigV4 verification. Installed provisioning descriptors lack
1941
+ HTTP API IAM-route planning; deployment and cloud acceptance remain required before enabling intake.
1942
+
1943
+ ### Private scheduled recovery/win-back content expiry (unreleased)
1944
+
1945
+ `processCrmRecoveryRetention({databaseName, environment}, limit)` is a server maintenance entry,
1946
+ not a public GraphQL action or execution-key scope. The database comes only from private host
1947
+ configuration. No session or administrator is synthesized. It uses current explicit active `apps`
1948
+ registry entries and the public deterministic app/database mapping; legacy inferred names, duplicate
1949
+ namespaces, changed revisions, unsupported environments and the control database itself are held.
1950
+
1951
+ A domain checkpoint and sixty-second lease serialize workers and rotate discovery beyond the first
1952
+ page. One invocation checks at most ten apps and redacts at most one hundred due receipts per app.
1953
+ Only `crm_outreach` receipts with an explicit recovery or win-back object and expired/rejected content
1954
+ qualify. A single app-database query clears body, subject, unsubscribe token and recipient email,
1955
+ with revision conflict checks. It preserves the current document's review/source/purpose proof,
1956
+ provider acceptance, unsubscribe hash, unknown/submitting state and opportunity claim edges.
1957
+ Ordinary outreach, Support messages, financial records and unexpired content remain unchanged.
1958
+ A database/revision failure holds that app; cleanup is idempotent and never sends or retries customers.
1959
+
1960
+ `crmRecoveryRetentionWorker.ts` is a private scheduled host entry. The SAM configuration defines a
1961
+ fifteen-minute schedule, disabled by default, concurrency one and no public API event or provider/send
1962
+ IAM policy. Enable it only after reviewing the actual control registry, per-app database permissions
1963
+ and cloud transaction acceptance. At-rest scheduled expiry happens only after deployment and opt-in;
1964
+ large receipt/app backlogs need successive bounded passes. Local tests do not certify deployed IAM.
1965
+ Registry fencing and app receipt mutation span separate databases; the final registry read does not
1966
+ lock the registry across the app transaction. Receipt redaction itself is atomic with revision guards;
1967
+ this residual namespace read-to-mutation window cannot authorize customer operations.
1968
+
1969
+ ### Conditional verified-purchase win-back
1970
+
1971
+ `createCrmExecutionKey` accepts a separate `crm:winback` scope only with `crm:outreach` and strict
1972
+ `winbackBounds`: exact organization/project/campaign/source IDs, current app-owned issuer IDs,
1973
+ `quietDays` 30–365 and cross-outreach `cooldownHours` 24–720. These do not reuse lead-followup or
1974
+ checkout-recovery authority. Server-only `CRM_WINBACK_SOURCES` entries require explicit current
1975
+ orders/customer/all-orders access approvals and an expiring protected Shopify token. Default 60-day
1976
+ order coverage is insufficient.
1977
+
1978
+ A customer calls `getOwnCrmWinbackConsent` / `recordCrmWinbackConsent` under their own native session,
1979
+ with exact user and independent purpose-document revisions. Merchant administrator intent cannot
1980
+ substitute for this consent. The purpose document leaves the user's financial-evidence revision unchanged.
1981
+ An administrator can associate it with an existing current canonical financial binding using
1982
+ `registerCrmWinbackBinding`; registration never asserts settlement. Actual issued/native evidence,
1983
+ current Stripe customer/charge/refunds, positive remaining settlement and exact current Shopify
1984
+ shop/customer/order/payment namespace must independently agree. Unsupported gateways, namespace,
1985
+ protected access, refunds, suppression or uncertain evidence remain held.
1986
+
1987
+ `getCrmWinbackCandidates` / GraphQL `crm.winbackCandidates(input:JSON!)` enumerate at most 25 current
1988
+ review candidates from exact registered purchase associations. `complete` and `truncated` describe
1989
+ this bounded enumeration, not a customer's global history. Eligibility only proves no recent order
1990
+ updates in the verified shop using protected all-order access and its maximum updated order; it never
1991
+ claims global inactivity or invents a lifecycle event. Cached candidates contain no provider charge,
1992
+ financial binding, source token or recovery URL. A preview uses `winback:{candidateId,revision}`, freezes
1993
+ one exact recipient/body/unsubscribe capability and requires separate approval and execution.
1994
+
1995
+ All action boundaries recheck purpose, protected source, native financial CAS, actual settlement,
1996
+ current recipient/suppression and cadence. The once-only purchase opportunity namespace is actual
1997
+ app/shop/customer/charge/purpose, independent of grant, token, campaign and binding aliases. Unknown
1998
+ submissions keep their durable claim and cannot retry; CRM's default SES transport explicitly permits
1999
+ one SDK attempt. Expired/rejected/withdrawn candidate content is redacted while state, receipt revision,
2000
+ provider acceptance and once-only accounting remain. The separate host retention worker covers
2001
+ explicit recovery/win-back outreach receipts; deployment/credentials and real provider acceptance
2002
+ remain unexercised by the mocked verification suite.
@@ -341,3 +341,33 @@ roles are rejected for this conversation profile. `thinkingLevel` can explicitly
341
341
  select minimal, low, medium or high on Gemini text requests; no level is injected
342
342
  by default. Model-specific capability/account availability is caller-owned.
343
343
  See [Google's thinking controls](https://ai.google.dev/gemini-api/docs/thinking).
344
+
345
+ ### Explicit URL context and claim evidence
346
+
347
+ `generateContent` accepts `urlContext: readonly string[]` for the verified
348
+ `gemini-2.5-flash` text model. Supply one to twenty distinct public HTTPS URLs,
349
+ without credentials, ports, query strings, or fragments. `search: true` still
350
+ adds Google Search; URL context adds a separate tool to the same single
351
+ submission. No source URL is fetched by Reaktor. The selected URLs are included
352
+ as explicit prompt data. URL context is nonrecursive and cache-first, with a
353
+ possible live fallback; success does not establish publication age or live
354
+ freshness. Consumers must quote and approve paid refreshes separately.
355
+
356
+ `GeneratedContent.grounding` records only valid Gemini support mappings against
357
+ original candidate Part UTF-8 byte ranges (`startByte`, exclusive `endByte`,
358
+ `partIndex`, and exact `text`). Original grounding chunk indices are retained
359
+ when resolving sources. Thought parts, mismatched text, incomplete UTF-8 bytes,
360
+ invalid indices, unsafe URLs, and excessive metadata are omitted, with
361
+ `omittedSupports` recording the count. Links alone do not imply every generated
362
+ sentence is supported. `urlContext` returns bounded inspection metadata with
363
+ `success`, `error`, `paywall`, `unsafe`, or `unavailable` status and an omission
364
+ count; missing metadata must not be treated as successful inspection.
365
+
366
+ The provider reports token usage independently of evidence. Existing usage
367
+ validation, default timeout, explicit caller timeout, no-cache transport and
368
+ single-submission semantics remain unchanged. Consumer billing reconciliation
369
+ continues to own provisional settlement.
370
+
371
+ Provider contracts: [URL context](https://ai.google.dev/gemini-api/docs/generate-content/url-context),
372
+ [grounding](https://ai.google.dev/gemini-api/docs/google-search), and
373
+ [GenerateContent metadata](https://ai.google.dev/api/generate-content).
@@ -0,0 +1,47 @@
1
+ # Lean GraphQL API Gateway handler
2
+
3
+ Source entry `@nlabs/reaktor/graphql` exports `createLeanGraphqlHandler`, `GraphqlRequestError` and public option/handler/error-code types. It imports GraphQL, public Rip-Hunter deadline scheduling and Node byte/UTF8 utilities at runtime. It installs no schemas, resolvers, provider registries, listeners or authentication defaults. Existing root `createGraphqlHandler` is unchanged.
4
+
5
+ ```ts
6
+ import {createLeanGraphqlHandler, GraphqlRequestError} from '@nlabs/reaktor/graphql';
7
+
8
+ // schema is an explicitly constructed GraphQLSchema; sessions is a verified owner service.
9
+ export const handler = createLeanGraphqlHandler({
10
+ createContext: async (event) => {
11
+ const bearer = event.headers.authorization;
12
+ if (!bearer?.startsWith('Bearer ')) throw new GraphqlRequestError('UNAUTHENTICATED');
13
+ // Map typed session rejection to UNAUTHENTICATED; availability to SERVICE_UNAVAILABLE.
14
+ // Unexpected service failures must remain unknown errors (sanitized HTTP 500).
15
+ return {identity: await sessions.verify(bearer.slice(7))};
16
+ },
17
+ disableIntrospection: true,
18
+ maxBodyBytes: 64 * 1024,
19
+ maxEncodedBodyBytes: 88 * 1024,
20
+ maxQueryBytes: 16 * 1024,
21
+ schema
22
+ });
23
+ ```
24
+
25
+ All three positive safe-integer byte limits and the introspection policy are mandatory. The handler snapshots configuration on construction. Original body UTF8 bytes, decoded UTF8 bytes and query UTF8 bytes are checked independently with inclusive limits. POST and exactly one case-insensitive application/json content-type (optionally charset=utf-8) are required before decoding/context. Base64 must be canonical padded standard base64. Invalid UTF8, malformed JSON, arrays/non-object payloads/variables, empty queries and invalid operation names reject. Missing optional variables/operationName are allowed; null is rejected. Actual GraphQL parse/validation/execution rules select `operationName` and coerce variables. Strict mode adds GraphQL's `NoSchemaIntrospectionCustomRule`; aliases/fragments cannot bypass it, while `__typename` remains permitted.
26
+
27
+ Context is passed to execution unchanged. A factory that throws or returns null/undefined never produces an anonymous fallback. The factory and explicit protected field resolvers own authentication/authorization: an empty object context is valid for public authentication fields, so each protected resolver must require a verified identity. Product own-user policy remains in the consumer. This module does not infer protected operations from names or decoded JWT claims.
28
+
29
+ `GraphqlRequestError` supports fixed code/message/status pairs: BAD_REQUEST/400, UNAUTHENTICATED/401, FORBIDDEN/403, METHOD_NOT_ALLOWED/405, PAYLOAD_TOO_LARGE/413, UNSUPPORTED_MEDIA_TYPE/415, INTERNAL_ERROR/500 and SERVICE_UNAVAILABLE/503. Map known owner auth failures explicitly; never map all failures to authentication. Unknown context/resolver exceptions become INTERNAL_ERROR. Parse/validation/selection/variable-coercion errors become BAD_REQUEST. No raw exception message, extension, stack, variable or credential is serialized or logged. Every error response contains only the fixed message and allowlisted code, inside the standard GraphQL errors array with data:null. Paths, locations, source, positions and all other exception metadata are deliberately omitted for direct typed errors, wrapped typed errors, unknown resolver errors and validation errors alike. GraphQL accepts caller-created prelocated wrappers; the public API cannot establish trustworthy metadata provenance. Typed errors still determine meaningful HTTP status and code. Any execution errors return `data:null`; mixed success is deliberately discarded. For multiple errors the highest numeric HTTP status wins (availability > internal > forbidden > unauthenticated > invalid request). Successful execution returns standard GraphQL JSON with HTTP 200.
30
+
31
+ The source entry needs a compatible reviewed release/archive and consumer manifest/lock adoption before use. Strict owner emit and isolated TS6/public declaration verification are source evidence, not installed consumer, AWS runtime, live authentication or production acceptance. The current Kurupt consumer lacks its own installed public AWS Lambda types; adoption must pin a compatible `@types/aws-lambda` and repeat unassisted compilation.
32
+
33
+ ## Explicit request acceptance policy (source proposal)
34
+
35
+ `requestPolicy` adds mandatory positive safe integer `timeoutMs`, `maxDepth`, `maxFields`, `maxWork`, `maxResponseBytes` and nonnegative safe integer `lambdaCleanupMs`. When absent the legacy behavior is retained. When supplied, invoke the handler with the actual AWS Lambda `Context` as its second argument. The optional configured `signal(event, lambdaContext)` obtains a caller cancellation signal explicitly. The context factory receives the shared `GraphqlRequestOperation` as its second argument (optional on the legacy factory signature); it contains `lambdaContext`, `signal`, and a live `remainingMs()` getter. Pass this signal and remaining budget to managed auth and injected domain/repository ports; check zero remaining budget before an effect. Configuration is snapshotted at construction.
36
+
37
+ The whole request budget begins before parsing, takes the minimum of configured elapsed budget and actual Lambda remaining time minus cleanup headroom, and uses public Rip-Hunter `/deadline` bounded scheduling. Zero budget rejects before context/provider effects. Cancellation preserves the caller's exact reason on the operation signal and as the cancellation error cause, cleans timer/listener bindings, and races noncooperative asynchronous work without replay. This bounds request waiting and response bytes; synchronous parsing/validation/serialization/CPU cannot be preempted and already submitted writes may commit after cancellation. Cancellation returns sanitized SERVICE_UNAVAILABLE; it does not claim rollback.
38
+
39
+ After GraphQL's standard validation, an iterative bounded walk counts expanded selections for the selected operation before context/authentication effects. `maxDepth` counts fields only (root field depth one), `maxFields` counts every expanded field including aliases/repeated spreads, and `maxWork` counts every selection including inline fragments/spreads regardless of directives/type conditions. The conservative count deliberately does not predict runtime list cardinality or product paid-operation accounting. Cycles remain invalid under framework validation. The traversal stops at the first exceeded bound and does not materialize an expanded AST. Response JSON, including failures, must fit `maxResponseBytes`; oversized responses become PAYLOAD_TOO_LARGE, or an empty HTTP 413 body when even the fixed sanitized failure cannot fit. Output bounds do not undo executed provider operations.
40
+
41
+ `domainFailures` registers at most 32 unique static `{code,message,status}` entries. Codes use uppercase ASCII identifiers up to 64 characters and cannot shadow generic codes. Messages use 1–120 printable ASCII characters, HTTP statuses are integers from 400 through 599. Trusted configuration owns these static sanitized texts; never derive them from exceptions or provider metadata. `GraphqlDomainError(code)` only gains response authority when its code is registered. Unregistered codes remain INTERNAL_ERROR. Context and resolver errors use the same registry, and all path/location/source/stack/arbitrary extension metadata remains discarded. The product owns revision/idempotency/history/capacity meanings; this layer adds no retry or reconciliation policy.
42
+
43
+ These source changes require an isolated strict public types/build/test qualification and a reviewed portable archive before consumer adoption. The owner currently installed Rip-Hunter 3.2.1 archive lacks the public `/deadline` export despite built files, so this source cannot be adopted with that artifact. Reviewed consumer Rip-Hunter 3.2.2 has the required public API; no internal import or installed dependency patch is supported.
44
+
45
+ `createPolicyGraphqlHandler` is the strongly typed policy factory: `PolicyGraphqlHandlerOptions` requires `requestPolicy`, its context callback infers a nonoptional `GraphqlRequestOperation`, and the returned `PolicyGraphqlHandler` requires actual Lambda `Context`. It delegates the same validator/executor to preserve behavior. Prefer this entry for production composition. The legacy factory convenience policy still requires a runtime Lambda context but keeps its optional TypeScript argument to preserve existing one-argument callers; it does not promise context presence through its static signature.
46
+
47
+ The explicit policy uses an incremental GraphQL response encoder before creating a complete JSON string. It traverses iteratively, escapes string/key pieces of at most 513 UTF16 code units (surrogate pairs stay intact), accounts UTF8 bytes before retaining each piece, and stops at the first exceeded bound. Buffered serialized chunks scale with `maxResponseBytes` plus fixed piece overhead; repeated aliases cannot force an unbounded complete encoded string before rejection. Error-description copies are bounded before allocation and error JSON uses the same encoder. Cyclic/invalid JSON scalar output remains sanitized. This guarantee covers serialization buffers, not execution-result memory, resolver-created values, `toJSON`/getter work, list cardinality or synchronous CPU. Product/provider output and effect limits remain necessary. No compatible bounded response serializer was found in installed public Utils declarations; this encoder is internal to the Reaktor GraphQL boundary.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Import `createNativePushService`, `createArangoNativePushRepository`,
4
4
  `migrateNativePushRegistry`, and `createNativePushGraphql` from
5
- `@nlabs/reaktor/native-push`. Existing direct APNs actions are unchanged.
5
+ `@nlabs/reaktor/native-push`. Direct certificate APNs actions remain available; their transport now uses Rip-Hunter and native Node TLS rather than node-apn/node-forge.
6
6
 
7
7
  ```ts
8
8
  const scope = {appId: 'your-app', environment: 'dev'};
@@ -54,3 +54,29 @@ rotation, offline logout and account switching before production rollout.
54
54
  See MetropolisJS `docs/NATIVE_NOTIFICATIONS.md` for the optional Expo integration.
55
55
  Cloud provisioning, deployment, migrations and npm publication require separate
56
56
  approval; unit tests and bundles do not prove live native push.
57
+
58
+ ## Direct certificate APNs delivery
59
+
60
+ `getNotificationProvider`, `pushNotification`, and `clearNotificationBadges` keep
61
+ the existing `app.apn.cert`, `app.apn.key`, optional `app.apn.ca`, and `app.apn.id`
62
+ configuration. Credentials accept PEM strings, Buffers, or file paths; CA arrays
63
+ are supported. Default credential filenames remain `cert.pem` and `key.pem`.
64
+ `environment: prod` selects Apple's production endpoint; other environments use
65
+ the sandbox. Optional `app.apn.host` is an HTTPS origin for a trusted APNs proxy.
66
+ Node/OpenSSL validates credentials and verifies the remote certificate/hostname.
67
+ No APNs credential migration or AWS/SNS provisioning is required.
68
+
69
+ `pushNotification` keeps message, badge (including zero), custom JSON data and
70
+ mutable-content behavior. Both actions return `{sent: [{device}], failed:
71
+ [{device, status?, response?, error?}]}`. APNs errors retain reason/timestamp;
72
+ transport errors remain per device. Badge clearing now explicitly sends the
73
+ configured topic. Action-owned connections close after delivery or rejection.
74
+ A caller owning a provider must call `shutdown()` after its sends complete.
75
+ The provider supports `send(notification, recipients)` and `shutdown()`;
76
+ node-apn-specific broadcast/channel/logger APIs are not part of this replacement.
77
+ Requests have a 30-second deadline and are not automatically replayed, avoiding
78
+ duplicate delivery when acceptance is unknown. Local mutual-TLS regressions do
79
+ not prove live Apple acceptance or device presentation.
80
+
81
+ The local 1.17.1 build requires the new Rip-Hunter 3.2.1 `/http2` public entry point.
82
+ Publish Rip-Hunter before publishing Reaktor; these releases are not yet on npm.