@nlabs/reaktor 1.19.2 → 1.19.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 (438) hide show
  1. package/README.md +290 -0
  2. package/docs/GENERATION.md +30 -0
  3. package/docs/LEAN_DATABASE.md +39 -0
  4. package/docs/LEAN_GRAPHQL.md +47 -0
  5. package/docs/MANAGED_AUTH.md +29 -0
  6. package/docs/NATIVE_PUSH.md +27 -1
  7. package/docs/OPAQUE_ACCOUNTS.md +17 -0
  8. package/lib/actions/alfredFaq.js +1 -1
  9. package/lib/actions/analytics.js +1 -1
  10. package/lib/actions/apps.js +17 -2
  11. package/lib/actions/connections.js +1 -1
  12. package/lib/actions/content.js +1 -1
  13. package/lib/actions/contentGeneration.d.ts +19 -1
  14. package/lib/actions/contentGeneration.js +59 -24
  15. package/lib/actions/contentGenerationErrors.js +1 -1
  16. package/lib/actions/contentGenerationSources.d.ts +29 -0
  17. package/lib/actions/contentGenerationSources.js +103 -0
  18. package/lib/actions/conversations.js +1 -1
  19. package/lib/actions/crm.d.ts +6 -2
  20. package/lib/actions/crm.js +91 -12
  21. package/lib/actions/crmCanonicalOutcomes.d.ts +88 -0
  22. package/lib/actions/crmCanonicalOutcomes.js +398 -0
  23. package/lib/actions/crmCanonicalPolicy.d.ts +92 -0
  24. package/lib/actions/crmCanonicalPolicy.js +104 -0
  25. package/lib/actions/crmCheckoutRecovery.d.ts +72 -0
  26. package/lib/actions/crmCheckoutRecovery.js +413 -0
  27. package/lib/actions/crmCheckoutRecoveryPolicy.d.ts +38 -0
  28. package/lib/actions/crmCheckoutRecoveryPolicy.js +61 -0
  29. package/lib/actions/crmDeliveryEvents.d.ts +24 -0
  30. package/lib/actions/crmDeliveryEvents.js +207 -0
  31. package/lib/actions/crmDeliveryEvidence.d.ts +17 -0
  32. package/lib/actions/crmDeliveryEvidence.js +58 -0
  33. package/lib/actions/crmExecution.d.ts +125 -0
  34. package/lib/actions/crmExecution.js +830 -0
  35. package/lib/actions/crmFinancialEvidence.d.ts +12 -0
  36. package/lib/actions/crmFinancialEvidence.js +60 -0
  37. package/lib/actions/crmInsights.d.ts +60 -0
  38. package/lib/actions/crmInsights.js +225 -0
  39. package/lib/actions/crmLeadFollowups.d.ts +66 -0
  40. package/lib/actions/crmLeadFollowups.js +209 -0
  41. package/lib/actions/crmOutcomes.d.ts +106 -0
  42. package/lib/actions/crmOutcomes.js +289 -0
  43. package/lib/actions/crmRecoveryRetention.d.ts +13 -0
  44. package/lib/actions/crmRecoveryRetention.js +163 -0
  45. package/lib/actions/crmReminderDispatch.d.ts +10 -0
  46. package/lib/actions/crmReminderDispatch.js +65 -0
  47. package/lib/actions/crmSourceOwnership.d.ts +7 -0
  48. package/lib/actions/crmSourceOwnership.js +27 -0
  49. package/lib/actions/crmSupportInsights.d.ts +18 -0
  50. package/lib/actions/crmSupportInsights.js +47 -0
  51. package/lib/actions/crmWinback.d.ts +71 -0
  52. package/lib/actions/crmWinback.js +347 -0
  53. package/lib/actions/crmWinbackConsent.d.ts +29 -0
  54. package/lib/actions/crmWinbackConsent.js +158 -0
  55. package/lib/actions/crmWinbackPolicy.d.ts +33 -0
  56. package/lib/actions/crmWinbackPolicy.js +115 -0
  57. package/lib/actions/crmWinbackShopSource.d.ts +15 -0
  58. package/lib/actions/crmWinbackShopSource.js +63 -0
  59. package/lib/actions/crud.js +1 -1
  60. package/lib/actions/databaseAccounts.js +1 -1
  61. package/lib/actions/databaseProvisioningLease.js +1 -1
  62. package/lib/actions/dynamodb.js +1 -1
  63. package/lib/actions/email.d.ts +4 -1
  64. package/lib/actions/email.js +25 -3
  65. package/lib/actions/files.js +1 -1
  66. package/lib/actions/flags.js +1 -1
  67. package/lib/actions/geminiVideo.js +1 -1
  68. package/lib/actions/groups.js +1 -1
  69. package/lib/actions/higgsfield.js +1 -1
  70. package/lib/actions/imageGeneration.js +1 -1
  71. package/lib/actions/images.js +1 -1
  72. package/lib/actions/index.d.ts +56 -0
  73. package/lib/actions/index.js +42 -1
  74. package/lib/actions/ios.js +1 -1
  75. package/lib/actions/locations.js +1 -1
  76. package/lib/actions/merchantAccountExperiment.d.ts +50 -0
  77. package/lib/actions/merchantAccountExperiment.js +424 -0
  78. package/lib/actions/merchantAccountExperimentConfig.d.ts +7 -0
  79. package/lib/actions/merchantAccountExperimentConfig.js +32 -0
  80. package/lib/actions/merchantAccountExperimentHost.d.ts +69 -0
  81. package/lib/actions/merchantAccountExperimentHost.js +92 -0
  82. package/lib/actions/merchantAccountExperimentPolicy.d.ts +66 -0
  83. package/lib/actions/merchantAccountExperimentPolicy.js +121 -0
  84. package/lib/actions/merchantAccountExperimentRelay.d.ts +10 -0
  85. package/lib/actions/merchantAccountExperimentRelay.js +75 -0
  86. package/lib/actions/merchantCalendar.d.ts +34 -0
  87. package/lib/actions/merchantCalendar.js +119 -0
  88. package/lib/actions/merchantCalendarBookings.d.ts +17 -0
  89. package/lib/actions/merchantCalendarBookings.js +113 -0
  90. package/lib/actions/merchantCalendarDelegation.d.ts +80 -0
  91. package/lib/actions/merchantCalendarDelegation.js +353 -0
  92. package/lib/actions/merchantCalendarDiscovery.d.ts +38 -0
  93. package/lib/actions/merchantCalendarDiscovery.js +125 -0
  94. package/lib/actions/merchantCalendarEventHost.d.ts +105 -0
  95. package/lib/actions/merchantCalendarEventHost.js +16 -0
  96. package/lib/actions/merchantCalendarEventPrivacy.d.ts +7 -0
  97. package/lib/actions/merchantCalendarEventPrivacy.js +70 -0
  98. package/lib/actions/merchantCalendarEventRepository.d.ts +121 -0
  99. package/lib/actions/merchantCalendarEventRepository.js +295 -0
  100. package/lib/actions/merchantCalendarEventTransport.d.ts +65 -0
  101. package/lib/actions/merchantCalendarEventTransport.js +132 -0
  102. package/lib/actions/merchantCalendarEvents.d.ts +172 -0
  103. package/lib/actions/merchantCalendarEvents.js +365 -0
  104. package/lib/actions/merchantCalendarInvitationConsent.d.ts +28 -0
  105. package/lib/actions/merchantCalendarInvitationConsent.js +118 -0
  106. package/lib/actions/merchantCalendarManagedSource.d.ts +22 -0
  107. package/lib/actions/merchantCalendarManagedSource.js +24 -0
  108. package/lib/actions/merchantCalendarOAuth.d.ts +92 -0
  109. package/lib/actions/merchantCalendarOAuth.js +502 -0
  110. package/lib/actions/merchantCalendarOAuthConfig.d.ts +4 -0
  111. package/lib/actions/merchantCalendarOAuthConfig.js +30 -0
  112. package/lib/actions/merchantCalendarOAuthRepository.d.ts +57 -0
  113. package/lib/actions/merchantCalendarOAuthRepository.js +108 -0
  114. package/lib/actions/merchantCalendarOAuthTransport.d.ts +4 -0
  115. package/lib/actions/merchantCalendarOAuthTransport.js +25 -0
  116. package/lib/actions/merchantCalendarScopes.d.ts +4 -0
  117. package/lib/actions/merchantCalendarScopes.js +31 -0
  118. package/lib/actions/merchantFinance.d.ts +65 -0
  119. package/lib/actions/merchantFinance.js +244 -0
  120. package/lib/actions/merchantFinanceProvider.d.ts +57 -0
  121. package/lib/actions/merchantFinanceProvider.js +180 -0
  122. package/lib/actions/merchantOperations.d.ts +94 -0
  123. package/lib/actions/merchantOperations.js +489 -0
  124. package/lib/actions/messages.js +1 -1
  125. package/lib/actions/notifications.d.ts +5 -8
  126. package/lib/actions/notifications.js +30 -23
  127. package/lib/actions/ollamaGeneration.js +1 -1
  128. package/lib/actions/openaiResponseSession.js +1 -1
  129. package/lib/actions/payments.js +4 -4
  130. package/lib/actions/personas.js +1 -1
  131. package/lib/actions/phoneSupport.js +1 -1
  132. package/lib/actions/posts.js +1 -1
  133. package/lib/actions/providerCredentials.d.ts +35 -0
  134. package/lib/actions/providerCredentials.js +166 -0
  135. package/lib/actions/query.js +1 -1
  136. package/lib/actions/reactions.js +1 -1
  137. package/lib/actions/rum.js +1 -1
  138. package/lib/actions/s3.js +1 -1
  139. package/lib/actions/search.js +1 -1
  140. package/lib/actions/sms.js +1 -1
  141. package/lib/actions/statistics.js +1 -1
  142. package/lib/actions/subscriptions.js +1 -1
  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 +88 -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 +1 -1
  168. package/lib/actions/users.js +24 -4
  169. package/lib/actions/videoGeneration.js +1 -1
  170. package/lib/actions/videos.js +1 -1
  171. package/lib/adapters/arangoAdapter.js +1 -1
  172. package/lib/adapters/contentAdapter.js +1 -1
  173. package/lib/adapters/fileAdapter.js +1 -1
  174. package/lib/adapters/geminiGenerationAdapter.js +1 -1
  175. package/lib/adapters/higgsfieldAdapter.js +1 -1
  176. package/lib/adapters/higgsfieldModelCatalog.js +1 -1
  177. package/lib/adapters/higgsfieldModels.js +1 -1
  178. package/lib/adapters/imageAdapter.js +1 -1
  179. package/lib/adapters/imageGenerationAdapter.js +1 -1
  180. package/lib/adapters/index.js +1 -1
  181. package/lib/adapters/messageAdapter.js +1 -1
  182. package/lib/adapters/postAdapter.js +1 -1
  183. package/lib/adapters/reaktorAdapter.js +1 -1
  184. package/lib/adapters/tagAdapter.js +1 -1
  185. package/lib/adapters/userAdapter.d.ts +2 -0
  186. package/lib/adapters/userAdapter.js +1 -1
  187. package/lib/assistant/core.js +1 -1
  188. package/lib/assistant/faq.js +1 -1
  189. package/lib/assistant/faqCore.js +1 -1
  190. package/lib/assistant/index.js +1 -1
  191. package/lib/assistant/service.js +1 -1
  192. package/lib/auth/credentials.d.ts +2 -0
  193. package/lib/auth/credentials.js +4 -0
  194. package/lib/auth/index.d.ts +7 -0
  195. package/lib/auth/index.js +6 -0
  196. package/lib/auth/kmsSigner.d.ts +24 -0
  197. package/lib/auth/kmsSigner.js +36 -0
  198. package/lib/auth/managedSession.d.ts +72 -0
  199. package/lib/auth/managedSession.js +247 -0
  200. package/lib/auth/opaqueAccounts/credentials.d.ts +13 -0
  201. package/lib/auth/opaqueAccounts/credentials.js +70 -0
  202. package/lib/auth/opaqueAccounts/index.d.ts +4 -0
  203. package/lib/auth/opaqueAccounts/index.js +4 -0
  204. package/lib/auth/opaqueAccounts/repository.d.ts +20 -0
  205. package/lib/auth/opaqueAccounts/repository.js +173 -0
  206. package/lib/auth/opaqueAccounts/service.d.ts +4 -0
  207. package/lib/auth/opaqueAccounts/service.js +128 -0
  208. package/lib/auth/opaqueAccounts/types.d.ts +49 -0
  209. package/lib/auth/opaqueAccounts/types.js +3 -0
  210. package/lib/auth/operation.d.ts +17 -0
  211. package/lib/auth/operation.js +77 -0
  212. package/lib/config.js +1 -1
  213. package/lib/constants/collections.d.ts +2 -1
  214. package/lib/constants/collections.js +2 -1
  215. package/lib/database/index.d.ts +60 -0
  216. package/lib/database/index.js +443 -0
  217. package/lib/durableChat/conversations.js +1 -1
  218. package/lib/durableChat/errors.js +1 -1
  219. package/lib/durableChat/events.js +1 -1
  220. package/lib/durableChat/index.js +1 -1
  221. package/lib/durableChat/membership.js +1 -1
  222. package/lib/durableChat/messageTypes.js +1 -1
  223. package/lib/durableChat/messages.js +1 -1
  224. package/lib/durableChat/transaction.d.ts +2 -1
  225. package/lib/durableChat/transaction.js +3 -3
  226. package/lib/durableChat/types.js +1 -1
  227. package/lib/graphql/domainErrors.d.ts +11 -0
  228. package/lib/graphql/domainErrors.js +27 -0
  229. package/lib/graphql/index.d.ts +68 -0
  230. package/lib/graphql/index.js +289 -0
  231. package/lib/graphql/requestPolicy.d.ts +25 -0
  232. package/lib/graphql/requestPolicy.js +149 -0
  233. package/lib/graphql/responseEncoding.d.ts +4 -0
  234. package/lib/graphql/responseEncoding.js +163 -0
  235. package/lib/handlers/graphqlHandler.js +1 -1
  236. package/lib/index.js +1 -1
  237. package/lib/lambdas/actions/websockets.js +1 -1
  238. package/lib/lambdas/authorizer.js +1 -1
  239. package/lib/lambdas/connection.js +1 -1
  240. package/lib/lambdas/utils/message.js +1 -1
  241. package/lib/lambdas/utils/websocket.js +1 -1
  242. package/lib/mocks/conversation.js +1 -1
  243. package/lib/mocks/file.js +1 -1
  244. package/lib/mocks/group.js +1 -1
  245. package/lib/mocks/image.js +1 -1
  246. package/lib/mocks/post.js +1 -1
  247. package/lib/mocks/tag.js +1 -1
  248. package/lib/mocks/user.js +1 -1
  249. package/lib/mocks/video.js +1 -1
  250. package/lib/mutations/analytics/analytics.js +1 -1
  251. package/lib/mutations/content/content.js +1 -1
  252. package/lib/mutations/crm/crm.js +395 -7
  253. package/lib/mutations/events/events.js +1 -1
  254. package/lib/mutations/flags/flags.js +1 -1
  255. package/lib/mutations/groups/groups.js +1 -1
  256. package/lib/mutations/higgsfield/higgsfield.js +1 -1
  257. package/lib/mutations/images/images.js +1 -1
  258. package/lib/mutations/index.js +1 -1
  259. package/lib/mutations/locations/locations.js +1 -1
  260. package/lib/mutations/messages/messages.js +1 -1
  261. package/lib/mutations/personas/personas.js +1 -1
  262. package/lib/mutations/posts/posts.js +1 -1
  263. package/lib/mutations/reactions/reactions.js +1 -1
  264. package/lib/mutations/rum/rum.js +1 -1
  265. package/lib/mutations/statistics/statistics.js +1 -1
  266. package/lib/mutations/subscriptions/subscriptions.js +1 -1
  267. package/lib/mutations/tags/tags.js +1 -1
  268. package/lib/mutations/users/users.js +1 -1
  269. package/lib/mutations/videos/videos.js +1 -1
  270. package/lib/nativePush/graphql.js +1 -1
  271. package/lib/nativePush/index.js +1 -1
  272. package/lib/nativePush/migrations.js +1 -1
  273. package/lib/nativePush/nativePushContract.fixture.js +1 -1
  274. package/lib/nativePush/payload.js +1 -1
  275. package/lib/nativePush/repository.js +1 -1
  276. package/lib/nativePush/service.js +1 -1
  277. package/lib/nativePush/snsProvider.js +1 -1
  278. package/lib/nativePush/types.js +1 -1
  279. package/lib/notifications/certificateProvider.d.ts +36 -0
  280. package/lib/notifications/certificateProvider.js +80 -0
  281. package/lib/objectTypes/analytics.js +1 -1
  282. package/lib/objectTypes/app.js +1 -1
  283. package/lib/objectTypes/bankAccount.js +1 -1
  284. package/lib/objectTypes/connection.js +1 -1
  285. package/lib/objectTypes/content.js +1 -1
  286. package/lib/objectTypes/contentGeneration.js +1 -1
  287. package/lib/objectTypes/conversation.js +1 -1
  288. package/lib/objectTypes/creditCard.js +1 -1
  289. package/lib/objectTypes/crm.js +1 -1
  290. package/lib/objectTypes/document.js +1 -1
  291. package/lib/objectTypes/error.js +1 -1
  292. package/lib/objectTypes/event.js +1 -1
  293. package/lib/objectTypes/external.js +1 -1
  294. package/lib/objectTypes/file.js +1 -1
  295. package/lib/objectTypes/filter.js +1 -1
  296. package/lib/objectTypes/flag.js +1 -1
  297. package/lib/objectTypes/group.js +1 -1
  298. package/lib/objectTypes/higgsfield.js +1 -1
  299. package/lib/objectTypes/iapSubscription.js +1 -1
  300. package/lib/objectTypes/image.js +1 -1
  301. package/lib/objectTypes/imageGeneration.js +1 -1
  302. package/lib/objectTypes/index.js +1 -1
  303. package/lib/objectTypes/location.js +1 -1
  304. package/lib/objectTypes/message.js +1 -1
  305. package/lib/objectTypes/passcode.js +1 -1
  306. package/lib/objectTypes/persona.js +1 -1
  307. package/lib/objectTypes/plan.js +1 -1
  308. package/lib/objectTypes/post.js +1 -1
  309. package/lib/objectTypes/query.js +1 -1
  310. package/lib/objectTypes/reaction.js +1 -1
  311. package/lib/objectTypes/relation.js +1 -1
  312. package/lib/objectTypes/rum.js +1 -1
  313. package/lib/objectTypes/search.js +1 -1
  314. package/lib/objectTypes/statistics.js +1 -1
  315. package/lib/objectTypes/subscription.js +1 -1
  316. package/lib/objectTypes/tag.js +1 -1
  317. package/lib/objectTypes/user.js +1 -1
  318. package/lib/objectTypes/video.js +1 -1
  319. package/lib/objectTypes/videoGeneration.js +1 -1
  320. package/lib/organizations/accountLifecycle.js +1 -1
  321. package/lib/organizations/authorization.js +1 -1
  322. package/lib/organizations/billing.js +1 -1
  323. package/lib/organizations/billingProvider.js +1 -1
  324. package/lib/organizations/billingUpdates.js +1 -1
  325. package/lib/organizations/index.js +1 -1
  326. package/lib/organizations/mail.js +1 -1
  327. package/lib/organizations/memberDirectory.js +1 -1
  328. package/lib/organizations/membership.js +1 -1
  329. package/lib/organizations/passwordRecovery.js +1 -1
  330. package/lib/organizations/plans.js +1 -1
  331. package/lib/organizations/providerPagination.js +1 -1
  332. package/lib/organizations/reconciliation.js +1 -1
  333. package/lib/organizations/signup.js +1 -1
  334. package/lib/organizations/store.js +1 -1
  335. package/lib/organizations/types.js +1 -1
  336. package/lib/organizations/verification.js +1 -1
  337. package/lib/queries/analytics/analytics.js +1 -1
  338. package/lib/queries/content/content.js +1 -1
  339. package/lib/queries/crm/crm.js +251 -5
  340. package/lib/queries/events/events.js +1 -1
  341. package/lib/queries/flags/flags.js +1 -1
  342. package/lib/queries/groups/groups.js +1 -1
  343. package/lib/queries/higgsfield/higgsfield.js +1 -1
  344. package/lib/queries/images/images.js +1 -1
  345. package/lib/queries/index.js +1 -1
  346. package/lib/queries/locations/locations.js +1 -1
  347. package/lib/queries/messages/messages.js +1 -1
  348. package/lib/queries/personas/personas.js +1 -1
  349. package/lib/queries/posts/posts.js +1 -1
  350. package/lib/queries/query/query.js +1 -1
  351. package/lib/queries/reactions/reactions.js +1 -1
  352. package/lib/queries/statistics/statistics.js +1 -1
  353. package/lib/queries/subscriptions/subscriptions.js +1 -1
  354. package/lib/queries/tags/tags.js +1 -1
  355. package/lib/queries/users/users.js +1 -1
  356. package/lib/queries/videos/videos.js +1 -1
  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 +2 -0
  396. package/lib/types/users.types.js +1 -1
  397. package/lib/types/videos.types.js +1 -1
  398. package/lib/types/websockets.types.js +1 -1
  399. package/lib/upload.js +1 -1
  400. package/lib/utils/adapterUtils.js +1 -1
  401. package/lib/utils/analyticsUtils.js +1 -1
  402. package/lib/utils/appContext.js +1 -1
  403. package/lib/utils/aqlHelpers.js +1 -1
  404. package/lib/utils/arangodbUtils.d.ts +2 -5
  405. package/lib/utils/arangodbUtils.js +8 -5
  406. package/lib/utils/authUtils.js +17 -1
  407. package/lib/utils/awsUtils.js +1 -1
  408. package/lib/utils/collectionRegistry.js +1 -1
  409. package/lib/utils/contextUtils.js +1 -1
  410. package/lib/utils/databaseCredentials.js +1 -1
  411. package/lib/utils/dbI18n.example.js +1 -1
  412. package/lib/utils/dbI18n.js +1 -1
  413. package/lib/utils/generationCallback.js +1 -1
  414. package/lib/utils/googleTranslate.js +1 -1
  415. package/lib/utils/graphqlUtils.d.ts +2 -0
  416. package/lib/utils/graphqlUtils.js +1 -1
  417. package/lib/utils/imageUtils.js +1 -1
  418. package/lib/utils/index.js +1 -1
  419. package/lib/utils/languageDetection.js +1 -1
  420. package/lib/utils/localeUtils.example.js +1 -1
  421. package/lib/utils/localeUtils.js +1 -1
  422. package/lib/utils/mediaAccess.js +1 -1
  423. package/lib/utils/middlewareUtils.js +1 -1
  424. package/lib/utils/nodeRealtime.js +1 -1
  425. package/lib/utils/opaqueToken.js +1 -1
  426. package/lib/utils/queryBuilder.js +1 -1
  427. package/lib/utils/schemaUtils.js +1 -1
  428. package/lib/utils/secretDatabase.js +1 -1
  429. package/lib/utils/sessionUtils.js +1 -1
  430. package/lib/utils/stripeUtils.d.ts +1 -1
  431. package/lib/utils/stripeUtils.js +2 -2
  432. package/lib/utils/stripeUtils.ts.bak +1 -1
  433. package/lib/utils/templateUtils.js +1 -1
  434. package/lib/utils/testUtils.js +1 -1
  435. package/lib/utils/translationQueue.example.js +1 -1
  436. package/lib/utils/translationQueue.js +1 -1
  437. package/lib/videoProcessing.js +1 -1
  438. package/package.json +57 -34
package/README.md CHANGED
@@ -1703,6 +1703,17 @@ 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
 
1708
1719
  `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.
@@ -1716,3 +1727,282 @@ await s3GetUploadPartSignedUrl({Bucket: bucket, ChecksumSHA256: checksum,
1716
1727
  ContentLength: bytes, Expires: 900, Key: key, PartNumber: part, UploadId: uploadId},
1717
1728
  client, {unhoistableHeaders: new Set(['x-amz-checksum-sha256'])});
1718
1729
  ```
1730
+
1731
+ 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.
1732
+
1733
+ ## Scoped merchant lead follow-up and Support operations
1734
+
1735
+ `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.
1736
+
1737
+ `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.
1738
+
1739
+ ## Trusted native SES delivery relay
1740
+
1741
+ `ingestCrmDeliveryEvent(context,input)` and GraphQL mutation `crm.ingestDeliveryEvent(input:JSON!)`
1742
+ require a separately administrator-issued `crm:delivery_events` execution key. Keep that key on an
1743
+ explicitly trusted server relay; it is not an ordinary Ads customer-execution scope and does not grant
1744
+ outreach or target access. The relay must establish authentic AWS/provider event provenance before
1745
+ calling the owner operation. This operation does not verify raw SNS signatures, subscriptions or
1746
+ anonymous browser claims. Bridge deployment and SES event-destination configuration remain separate.
1747
+
1748
+ The exact normalized input is `{appId,eventId,receiptId,providerMessageId,kind,occurredAt,bounceType?}`.
1749
+ `kind` is `delivered`, `bounce` or `complaint`; bounce classification must be exactly `Permanent`,
1750
+ `Transient` or `Undetermined` when kind is bounce. No email, recipient/body, SNS envelope or additional
1751
+ properties are accepted. `receiptId` identifies the actual native execution receipt returned by the
1752
+ sending workflow, and `providerMessageId` must match its accepted SES MessageId. Native sends now
1753
+ persist `providerAcceptedAt`. Legacy records lacking that timestamp and submitting/unknown sends
1754
+ remain held; delivery claims cannot repair uncertain submission or trigger retry.
1755
+
1756
+ Events are bounded to thirty days, no more than one minute ahead of the owner clock or before recorded
1757
+ provider acceptance, and no more than thirty days after acceptance. Each receipt accepts at most 32
1758
+ unique events. Same app/event-ID payload replay is idempotent across key rotation; conflicting reuse is
1759
+ rejected. Minimized event metadata and receipt/user graph edges commit atomically with suppression.
1760
+ An exact current recipient is required; changed/deleted recipients hold. Bounce of any classification
1761
+ sets a delivery hold without claiming permanent rejection; complaint is monotonic over later bounces.
1762
+ Delivered events and replays never clear existing delivery holds or marketing opt-out. The returned
1763
+ `suppressed` value reflects the current delivery hold, not marketing permission. No sends or retries
1764
+ occur. Relay authority is rechecked before writes and immediately before transaction commit; native
1765
+ app writes use an exclusive transaction while the platform grant registry remains its existing separate
1766
+ authority boundary. Compatible owner deployment and real source relay acceptance remain outstanding.
1767
+
1768
+ Native administrator action `eraseCrmDeliveryEvidence(context,appId,userId)` and GraphQL mutation
1769
+ `crm.eraseDeliveryEvidence(appId:ID!,userId:ID!)` atomically remove that user's delivery event records and
1770
+ both event edges in the current owned app database. They preserve a hash-only tombstone and original
1771
+ send receipts; previously accepted messages cannot be reingested across relay key rotation. A genuinely
1772
+ new accepted send after erasure may start new evidence. This action does not clear suppression or consent,
1773
+ remove users, resend or change unknown submissions. Call it only from a configured authorized native
1774
+ privacy workflow; it is not granted by a relay key or exposed through ordinary Ads execution sources.
1775
+
1776
+
1777
+ Ordinary receipt inspection now includes optional minimized `deliveryEvidence` only for actual applied
1778
+ SES receipts. Its exact shape is `{schemaVersion:'crm_delivery_evidence_v1',status,generatedAt,validUntil,
1779
+ negativeHold,events:[{kind,occurredAt,bounceType?}]}`. Status is `available`, `unavailable` or `erased`;
1780
+ only available evidence supplies a boolean current native delivery hold. Other statuses supply null and
1781
+ an empty timeline. Reports contain no event IDs, relay key, recipient, message body or raw provider data.
1782
+ The snapshot expires within fifteen minutes and no later than ordinary receipt authority expiry.
1783
+ Inspection rechecks the same current grant after reading the native ledger. Missing, corrupt, erased or
1784
+ changed-recipient evidence does not imply delivery success or permission. Available delivered reports
1785
+ do not clear suppression or consent; transient bounce remains a hold rather than proven permanent rejection.
1786
+
1787
+ Ads accepts this strict projection through its existing ordinary receipt-read path, rejects nested private
1788
+ fields before persistence, clears cached evidence on failed or revoked refresh, and withholds the timeline
1789
+ after its deadline or source withdrawal. No relay-write scope is exposed through Ads and no retry follows
1790
+ a delivery report. A configured source bridge, compatible native deployment, provider event-destination
1791
+ configuration and administrator privacy-workflow adoption remain separate live acceptance requirements.
1792
+
1793
+ ### Canonical CRM lifecycle and verified settlement source
1794
+
1795
+ Public actions `createCrmCanonicalReadKey`, `getCrmCanonicalOutcomes`,
1796
+ `correctCrmCanonicalObservation`, and `registerCrmCanonicalFinanceBinding` are exposed through
1797
+ `crm.canonicalOutcomes(input: JSON!)` and the corresponding CRM administrator mutations.
1798
+ `crm:canonical_outcomes` is a distinct read scope bound to app, organization, project and campaigns.
1799
+ `crm:canonical_finance` additionally requires exact existing owned issuer IDs. Keys remain actor bound and expiring.
1800
+
1801
+ A campaign association must separately record `canonicalConsent` with purpose `canonical_campaign_outcomes`,
1802
+ explicit evidence reference and expiry no later than its campaign association consent. New native stage records
1803
+ contain actual occurrence time, immutable event ID and version. Legacy unversioned or truncated histories are
1804
+ explicitly incomplete; this API never invents an occurrence or silently deletes prior history from such a read.
1805
+ Corrections target an actual existing observation and retain its occurrence time under source/event/association CAS.
1806
+ A completed read emits versioned tombstones for consent/source withdrawal. Source snapshot metadata is bounded
1807
+ at 1,000 events and has a 30-day TTL; it contains minimized references, not form or ticket text.
1808
+
1809
+ Financial registration only binds existing native invoice, payment evidence, customer order, user and native
1810
+ payment documents under exact source revisions. It does not issue invoices or establish settlement authenticity.
1811
+ A financial read verifies the actual existing Stripe charge, bound customer and complete refund evidence using
1812
+ GET operations only, requires captured paid live settlement and matching immutable legal amounts/currency,
1813
+ and rechecks current native evidence and grant bounds after transport. Failed/uncertain verification is held.
1814
+ Stripe evidence alone does not prove a Shopify order namespace: financial observations remain
1815
+ `verified_settlement_namespace_unproven` until a consumer independently reads the current owned Shopify
1816
+ order and matches its exact provider payment/refund identities. Never sum these rows with Shopify revenue
1817
+ without that proof. No charge, refund, invoice issuance or external send is performed by this contract.
1818
+
1819
+ ### Advisory external calendar busy reads
1820
+
1821
+ `readMerchantCalendarBusy(context,{appId,from,resourceId,sourceId,to})` and
1822
+ `crm.merchantCalendarBusy(input: JSON!)` provide a separate Scheduling-owned Google Calendar busy-time
1823
+ read. Require an actual current `scheduling:read` grant, exact current native resource and explicit
1824
+ server-only `MERCHANT_CALENDAR_SOURCES` configuration (`appId,calendarId,expiresAt,id,resourceId,scopes,token`).
1825
+ Configure the actual obtained Google free/busy or read scope and finite token expiry; source rotation
1826
+ and native resource/grant changes invalidate an in-flight read. No native provider credential creation,
1827
+ OAuth refresh controller or token persistence API is implied by this configuration.
1828
+
1829
+ Only at most seven days within the next ninety days are read, with at most500 busy ranges and one
1830
+ configured calendar. Return minimized UTC intervals, resource timezone, revision and at most five-minute
1831
+ freshness. Group expansion, partial provider errors, absent calendars and mismatched time ranges hold
1832
+ evidence. Empty busy ranges mean no busy intervals were returned for this source/window; they do not
1833
+ establish complete availability. No event names, participant/email/calendar identities or keys are returned.
1834
+ This advisory read never creates an external event or native reservation, sends invitations or changes
1835
+ booking execution. Combining external availability with native reservation needs a separately validated
1836
+ collision and provider-race contract. Official operation:
1837
+ https://developers.google.com/workspace/calendar/api/v3/reference/freebusy/query
1838
+
1839
+ ### Native consented checkout recovery
1840
+
1841
+ `generateCrmCheckoutRecoveryCandidates` reads only registered, current Shopify abandoned checkout identities. It requires
1842
+ independent `crm:checkout_recovery` plus `crm:outreach` authority and exact `recoveryBounds` (organization, project,
1843
+ campaigns, source IDs, 24–720 hour recipient cooldown). Lead follow-up authority cannot enumerate recovery candidates.
1844
+ `recordCrmCheckoutRecoveryConsent` accepts only the authenticated native customer's own revision and explicit independent
1845
+ `checkout_recovery` purpose (at most 30 days); administrators cannot register consent on somebody else's behalf.
1846
+ `registerCrmCheckoutRecoveryBinding` is administrator-only and binds an existing consented campaign association, current
1847
+ native recipient and independently read current Shopify customer/checkout. Registration sends nothing.
1848
+
1849
+ Owner-only `CRM_CHECKOUT_RECOVERY_SOURCES` configuration contains exact app/organization/project/source ID, shop domain,
1850
+ server-held Shopify token, token expiry and explicit protected orders/customers access approval. Reads target fixed Shopify
1851
+ Admin API 2026-10, verify actual shop and current installed `read_orders`/`read_customers` scopes, and query the exact
1852
+ checkout with `status:open recovery_state:not_recovered email_state:not_sent`. Completed, absent, ambiguous, recovered,
1853
+ externally emailed, unsubscribed, suppressed, expired, changed or unavailable evidence is held. Candidate data is bounded
1854
+ and expires within 15 minutes; registration metadata and graph edges have at most the customer's 30-day consent lifetime.
1855
+
1856
+ Existing `previewCrmExecution` accepts independent `recovery: {candidateId, revision}` for `crm_outreach`. The native preview
1857
+ freezes one recipient and exact plain-text body with unsubscribe capability; exact approval remains a separate operation.
1858
+ Execution repeats provider completion/consent/source token and native recipient/association checks, atomically claims the
1859
+ stable shop/checkout/customer/campaign opportunity, and uses the existing durable SES ledger. Actual recent provider
1860
+ acceptance and every unknown/submitting marketing receipt enforce recipient cadence. Unknown submission outcomes remain
1861
+ claimed and cannot be retried automatically or bypassed by rotating grants. No paid operations, bookings, financial
1862
+ movements, implicit consent, automatic recovery sends, inferred inactivity or unsupported win-back eligibility are added.
1863
+
1864
+ GraphQL exposes `crm.checkoutRecoveryCandidates(input: JSON!)`, `crm.checkoutRecoveryConsent(input: JSON!)` and
1865
+ `crm.registerCheckoutRecoveryBinding(input: JSON!)`; the existing exact preview/approval/execution fields remain in use.
1866
+
1867
+ ### Permitted native Support order/product context
1868
+
1869
+ `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.
1870
+
1871
+ 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.
1872
+
1873
+ ### Explicit verified recovery links and content retention
1874
+
1875
+ Recovery candidates can expose `recoveryLinkHash`, never the checkout capability URL.
1876
+ The source proof reads Shopify's `abandonedCheckoutUrl` plus actual shop identity and primary domain;
1877
+ only exact bounded HTTPS provider-owned URLs are supported. `includeVerifiedRecoveryLink: true`
1878
+ in a recovery preview explicitly appends that exact current URL before the native unsubscribe capability.
1879
+ The reviewed body has a hard 5000-character bound; an unsupported URL or changed source is held.
1880
+ Ordinary previews and older candidates without a link hash keep their existing behavior.
1881
+
1882
+ Recovery receipts carry `contentStatus: current | redacted`. Redacted receipts omit `body`, `subject`,
1883
+ and `recipient.email`; absence never represents an unchanged approved message. Reads recheck the
1884
+ current source, purpose consent, suppression and expiry before retaining content. Rejection, expiry,
1885
+ and grant revocation remove capability-bearing content without deleting source hashes, unsubscribe
1886
+ verification, exact receipt revision, provider acceptance or durable opportunity claims. Unknown outcomes
1887
+ remain unknown and cannot retry. Redacted content cannot be approved or submitted.
1888
+
1889
+ Native hosts can call administrator-only `retainCrmCheckoutRecoveryContent(context, appId)`
1890
+ (or `crm.retainCheckoutRecoveryContent`) for bounded 100-row expired/rejected content cleanup.
1891
+ A host maintenance worker should continue until it returns fewer than 100. The public receipt never
1892
+ exports the private payload/grant/unsubscribe hashes. Existing unsubscribe verification keeps working
1893
+ after content redaction or sending-grant expiry/revocation. Non-recovery content is unchanged.
1894
+
1895
+ ### Bounded Amazon Connect Support metadata (unreleased)
1896
+
1897
+ `configureSupportConnectSource`, `bindSupportConnectConversation` and
1898
+ `eraseSupportConnectEvidence` require ordinary native administrator authority. Configure an exact
1899
+ app database, Connect instance ARN, path-free IAM relay role and expiry. Binding requires a current,
1900
+ explicitly app-owned ticket and native user revision; legacy unscoped records are held. Contact IDs
1901
+ remain private. Erasure preserves opaque replay tombstones and does not send or retry anything.
1902
+
1903
+ `ingestSupportConnectMetadata` is a private host adapter API, requiring a current native
1904
+ `support:channel_ingest` grant and the AWS gateway-owned IAM principal. It performs one bounded
1905
+ `DescribeContact` call, verifies the exact contact ARN and VOICE channel, and records only actual
1906
+ initiation/disconnect timestamps. Claimed milestones, identity matching, transcripts and reply
1907
+ operations are unsupported. The relay scope is deliberately excluded from ordinary Ads credentials.
1908
+
1909
+ `readSupportConnectEvidence` / `crm.supportChannelEvidence` require current `support:read` authority.
1910
+ The minimized result contains source/ticket revision, channel, observed/ended timestamps, provenance,
1911
+ generation time and validity deadline; no contact/customer IDs, bodies, amounts or relay credentials.
1912
+ Validity is clamped to current read, source, contributing binding and relay authority expiries, at most
1913
+ 15 minutes. Current source/binding/grant/ticket changes hold old evidence. Completion is not resolution,
1914
+ message delivery, consent, settlement or a sale.
1915
+
1916
+ Core source/binding/event/grant checks and replay insertion share one native transaction. Tickets and
1917
+ users reside in the app database: their revisions are checked before the provider read, after it,
1918
+ immediately before core commit, and independently during inspection. Those checks do not lock the
1919
+ app database across the core transaction. A residual cross-database read-to-commit race remains;
1920
+ this metadata-only API must not be used as an atomic customer-action authorization proof.
1921
+
1922
+ Authenticated reads perform bounded retention cleanup (100 expired bindings and 200 events per read;
1923
+ events retain at most 30 days). Dormant sources require an owner-operated cleanup schedule; no live
1924
+ schedule or deployment is installed here. Tombstones retain only opaque hashes required to prevent
1925
+ re-ingestion after privacy erasure.
1926
+
1927
+ The host route is `POST /crm/support/channels/connect`, requiring AWS_IAM and exact qualified-Lambda
1928
+ invoke permissions. `apps/api/config/support-connect-route.yaml` is a review-only CloudFormation
1929
+ plan, not an automatic deployment. It separates the relay's exact execute-api route from the runtime's
1930
+ exact instance/contact `connect:DescribeContact` resource and documented `connect:Channel=VOICE`
1931
+ condition. Existing broader invocation policies must be reviewed separately. Local trusted-gateway
1932
+ fixtures do not implement or certify live SigV4 verification. Installed provisioning descriptors lack
1933
+ HTTP API IAM-route planning; deployment and cloud acceptance remain required before enabling intake.
1934
+
1935
+ ### Private scheduled recovery/win-back content expiry (unreleased)
1936
+
1937
+ `processCrmRecoveryRetention({databaseName, environment}, limit)` is a server maintenance entry,
1938
+ not a public GraphQL action or execution-key scope. The database comes only from private host
1939
+ configuration. No session or administrator is synthesized. It uses current explicit active `apps`
1940
+ registry entries and the public deterministic app/database mapping; legacy inferred names, duplicate
1941
+ namespaces, changed revisions, unsupported environments and the control database itself are held.
1942
+
1943
+ A domain checkpoint and sixty-second lease serialize workers and rotate discovery beyond the first
1944
+ page. One invocation checks at most ten apps and redacts at most one hundred due receipts per app.
1945
+ Only `crm_outreach` receipts with an explicit recovery or win-back object and expired/rejected content
1946
+ qualify. A single app-database query clears body, subject, unsubscribe token and recipient email,
1947
+ with revision conflict checks. It preserves the current document's review/source/purpose proof,
1948
+ provider acceptance, unsubscribe hash, unknown/submitting state and opportunity claim edges.
1949
+ Ordinary outreach, Support messages, financial records and unexpired content remain unchanged.
1950
+ A database/revision failure holds that app; cleanup is idempotent and never sends or retries customers.
1951
+
1952
+ `crmRecoveryRetentionWorker.ts` is a private scheduled host entry. The SAM configuration defines a
1953
+ fifteen-minute schedule, disabled by default, concurrency one and no public API event or provider/send
1954
+ IAM policy. Enable it only after reviewing the actual control registry, per-app database permissions
1955
+ and cloud transaction acceptance. At-rest scheduled expiry happens only after deployment and opt-in;
1956
+ large receipt/app backlogs need successive bounded passes. Local tests do not certify deployed IAM.
1957
+ Registry fencing and app receipt mutation span separate databases; the final registry read does not
1958
+ lock the registry across the app transaction. Receipt redaction itself is atomic with revision guards;
1959
+ this residual namespace read-to-mutation window cannot authorize customer operations.
1960
+
1961
+ ### Conditional verified-purchase win-back
1962
+
1963
+ `createCrmExecutionKey` accepts a separate `crm:winback` scope only with `crm:outreach` and strict
1964
+ `winbackBounds`: exact organization/project/campaign/source IDs, current app-owned issuer IDs,
1965
+ `quietDays` 30–365 and cross-outreach `cooldownHours` 24–720. These do not reuse lead-followup or
1966
+ checkout-recovery authority. Server-only `CRM_WINBACK_SOURCES` entries require explicit current
1967
+ orders/customer/all-orders access approvals and an expiring protected Shopify token. Default 60-day
1968
+ order coverage is insufficient.
1969
+
1970
+ A customer calls `getOwnCrmWinbackConsent` / `recordCrmWinbackConsent` under their own native session,
1971
+ with exact user and independent purpose-document revisions. Merchant administrator intent cannot
1972
+ substitute for this consent. The purpose document leaves the user's financial-evidence revision unchanged.
1973
+ An administrator can associate it with an existing current canonical financial binding using
1974
+ `registerCrmWinbackBinding`; registration never asserts settlement. Actual issued/native evidence,
1975
+ current Stripe customer/charge/refunds, positive remaining settlement and exact current Shopify
1976
+ shop/customer/order/payment namespace must independently agree. Unsupported gateways, namespace,
1977
+ protected access, refunds, suppression or uncertain evidence remain held.
1978
+
1979
+ `getCrmWinbackCandidates` / GraphQL `crm.winbackCandidates(input:JSON!)` enumerate at most 25 current
1980
+ review candidates from exact registered purchase associations. `complete` and `truncated` describe
1981
+ this bounded enumeration, not a customer's global history. Eligibility only proves no recent order
1982
+ updates in the verified shop using protected all-order access and its maximum updated order; it never
1983
+ claims global inactivity or invents a lifecycle event. Cached candidates contain no provider charge,
1984
+ financial binding, source token or recovery URL. A preview uses `winback:{candidateId,revision}`, freezes
1985
+ one exact recipient/body/unsubscribe capability and requires separate approval and execution.
1986
+
1987
+ All action boundaries recheck purpose, protected source, native financial CAS, actual settlement,
1988
+ current recipient/suppression and cadence. The once-only purchase opportunity namespace is actual
1989
+ app/shop/customer/charge/purpose, independent of grant, token, campaign and binding aliases. Unknown
1990
+ submissions keep their durable claim and cannot retry; CRM's default SES transport explicitly permits
1991
+ one SDK attempt. Expired/rejected/withdrawn candidate content is redacted while state, receipt revision,
1992
+ provider acceptance and once-only accounting remain. The separate host retention worker covers
1993
+ explicit recovery/win-back outreach receipts; deployment/credentials and real provider acceptance
1994
+ remain unexercised by the mocked verification suite.
1995
+
1996
+
1997
+ ## Explicit database connection options
1998
+
1999
+ The Node root API accepts `useDb(databaseName, {agentOptions})`. Options use the public
2000
+ `arangojs/configuration` type and are passed to the database constructor. Omitting
2001
+ options preserves the existing configured database, credentials and connection behavior.
2002
+
2003
+ Pass the resulting database as the fourth argument to
2004
+ `createDurableTransaction(context, collections, undefined, database)` to use it for
2005
+ transaction begin, query and commit/abort. An injected query (third argument) retains
2006
+ precedence and caller-owned lifecycle. Neither path opens a fallback database.
2007
+ Connection retry policy belongs to the application adapter; this API does not retry
2008
+ transactions, ambiguous commits or application actions.
@@ -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,39 @@
1
+ # Lean hosted database
2
+
3
+ The additive `@nlabs/reaktor/database` entry exposes `createHostedDatabase`, `createManagedSessionPersistence`, and their public option/port types. It imports arangojs and the lean Rip-Hunter HTTP entry at runtime, never Config, schema defaults, auth crypto, media or AWS providers. Legacy root `useDb` is unchanged.
4
+
5
+ Configure a full HTTPS server origin, designated existing database name, non-root service username, private password and positive `timeoutMs`. Missing/invalid settings fail before the injected `DatabaseFactory` runs. No environment lookup, defaults, credentials discovery or database/collection/index creation occurs. The returned object is the actual arangojs `Database`; its public query, collection, beginTransaction and close APIs remain available. The optional constructor binding accepts the public arangojs `ConfigOptions` and returns its actual `Database` type.
6
+
7
+ Both factories require explicit `timeoutMs`, with the persistence adapter passing it in every public QueryOptions. arangojs10.5.0 query() passes its own undefined timeout and can override the constructor common timeout: raw driver query/transaction callers must provide their own explicit supported timeout options. The adapter’s `timeoutMs` maps to arangojs 10.5.0's per-request Fetch timeout (AbortSignal on the driver's request). The driver clears this timer when Fetch resolves its response headers; it does not guarantee a response-body deadline. Zero is rejected (no disable mode); the largest permitted integer is 2,147,483,647 milliseconds, preventing timer overflow. This is neither a Node socket-idle timeout nor an absolute deadline spanning multiple queries/cursor requests/whole auth operations. Callers needing whole-operation deadlines must provide a separately reviewed orchestration policy. Redirects fail, transport retries and conflict retries are disabled; mutations are never replayed by this adapter. TLS certificate verification retains driver defaults; private trust installation is external infrastructure.
8
+
9
+ `createManagedSessionPersistence({database, accountsCollection, familiesCollection, environment, timeoutMs})` returns the concrete `accounts`/`families` ports expected by `ManagedSessionOptions`. Use separate existing collections and least-privilege service access. Collections and environment are explicit configuration. Query text is fixed; names and all ids/data use AQL bind variables. Account reads use exact email matching (managed auth already normalizes email). Documents must have `_key === userId`, an explicit environment matching the configured stage, explicit boolean active, and nonempty username/password/salt strings. Password/salt are preserved unchanged. Unstaged legacy users, absent active fields and malformed records fail closed; this is not an implicit migration or proof that existing accounts are compatible. Authoritative enrollment/migration must establish this schema independently.
10
+
11
+ Session families require `_key === sid`, safe key-format sid/userId, exact environment, boolean revoked, nonnegative integer created and integer absoluteExpires greater than created with duration at most 86,400,000 milliseconds (24 hours, matching managed auth). Create accepts only unrevoked records. The built-in unique primary `_key` index provides atomic unique sid insertion; `INSERT ... overwriteMode: conflict` never updates prior rows, including revoked ones. Reads strictly validate records and requested identity. Revoke executes one AQL statement whose update predicate includes sid/userId/environment and revoked=false. Missing, wrong-owner, wrong-stage and already-revoked rows cause no update. Concurrent write conflicts return a sanitized error, never automatic replay. Isolated tests prove actual driver serialization and synthetic conflict handling; database server transactional execution and collection permissions require separate real-service acceptance.
12
+
13
+ Database errors become `database_unavailable`; malformed rows/ids become `invalid_database_record`; configuration errors become `invalid_database_configuration`, without raw driver/credential details. Game repositories, ownership/revision/idempotency/replay policy remain application domain work. This additive source requires fresh review and frozen package/archive verification before consumer adoption. No hosted service, credentials or native acceptance is implied.
14
+
15
+ ## Additive body deadline profile
16
+
17
+ `createManagedSessionHttpPersistence` accepts the explicit hosted database fields, distinct existing accounts/families collections, environment, positive safe-integer timeoutMs and maxResponseBytes (1..1,048,576). Its optional requestImplementation is the installed public Rip-Hunter RequestImplementation; optional signal can bind a caller scope. Configuration is captured before any I/O. This profile does not use arangojs query promises or change the existing driver factories. It reuses the same private account/family validations and fixed parameterized AQL commands.
18
+
19
+ The trusted HTTPS origin is extended only with /_db/<configured-name>/_api/cursor. Basic credentials are explicit private configuration; root and colon-containing usernames are rejected. Rip-Hunter owns JSON encoding, Fetch transport and the absolute deadline across request and consumer callback. No redirects or automatic retries occur. Exact final response URL and status 201 precede bounded streamed bytes, fatal UTF8 decoding, JSON and envelope validation. Errors/provider bodies are never included in messages. DatabaseRequestError distinguishes abort, timeout, limit, status, response and unavailable; only caller cancellation cause is retained exactly. Managed auth's existing I/O boundary continues to sanitize persistence failures.
20
+
21
+ Requests use batchSize2, cachefalse, ttl 1 and server maxRuntime matching the configured duration in seconds. Dirty-read opt-in is absent, matching the installed driver's allowDirtyReadfalse wire behavior. Only the fixed email query can return two rows (managed auth detects duplicates); keyed reads and mutations accept at most one row. hasMore and retained cursor ids are rejected; pagination is never followed. A rejected unexpected server cursor is bounded by the requested one-second TTL rather than an unbounded client pagination/cleanup chain. Server enforcement, actual atomic AQL execution and least-privilege access remain live acceptance gates.
22
+
23
+ The deadline now bounds post-header slow/hanging bodies for these per-query ports. Timers and caller listeners are cleaned by the installed public Rip-Hunter lifecycle, including finite durations above the platform timer maximum; zero remains rejected in this hosted profile. Native Fetch aborts its stream on cancellation; injected implementations must honor the supplied AbortSignal to release their underlying resources, although Rip-Hunter still bounds caller completion for noncooperative implementations. No whole-auth/KMS-signing deadline or Node socket-idle guarantee follows. A caller may supply a shared signal, but signing and overall operation orchestration remain separate required work. The consumer uses published Rip-Hunter 3.3.0 HTTP and deadline entry points rather than a private archive. Reaktor's own release and production qualification remain separate gates.
24
+
25
+ Managed auth ports now accept an optional `ManagedAuthPortContext`. HTTP ports use its operation signal (combined with the optional adapter signal) and the minimum remaining auth budget/per-request timeout, including streamed response consumption. Exhaustion rejects before dispatch instead of passing zero to disable transport deadlines. The old driver ports remain compatible and do not claim cooperative abort support. Neither adapter claims that cancellation rolls back an already-submitted mutation or establishes noncommit; no automatic replay occurs.
26
+
27
+ ## Bounded application AQL
28
+
29
+ `createBoundedAqlExecutor(options)` adds a public single-page executor to this entry. The trusted options require an existing HTTPS server origin, databaseName, non-root username, private password, positive safe-integer timeoutMs, and explicit maxRequestBytes/maxResponseBytes (1..16,777,216 each). Optional requestImplementation uses Rip-Hunter's public Fetch callback type; optional signal binds adapter shutdown. Construction reads each configuration field once before validating the captured values and performs no I/O/provisioning. Throwing configuration getters fail as invalid_database_configuration without retaining their cause. The managed-session HTTP profile retains its existing 1 MiB cap, fixed AQL and status behavior.
30
+
31
+ `executor.execute({query, bindVars, maxRows}, {signal?, remainingMs?}?)` accepts trusted caller-owned AQL and bind variables. maxRows is a required integer from 1..10,000. It sets batchSize and bounds accepted result rows; it does not rewrite/parse AQL or bound database work. The caller must author its query LIMIT, ownership predicates and mutation/transaction policy. Requests use cache:false, ttl:1 and options.maxRuntime in seconds. No redirects, retries, pagination, retained-cursor cleanup requests or environment defaults occur. Oversized results are rejected and any unexpected retained cursor expires under the requested one-second TTL. Server behavior needs separate acceptance.
32
+
33
+ Byte caps count UTF-8 bytes of the complete serialized JSON request and entire response envelope, including error envelopes, rather than just a document or Content-Length. An 8 MiB aggregate therefore needs envelope headroom: 9 MiB (9,437,184 bytes) is an example explicit bound for one aggregate, provided the caller separately ensures all query/bind/envelope fields fit; it is not a production default. Each statement field is read once before validation; its captured query, row bound and bind variables supply the bounded serializable JSON snapshot. The parsed snapshot must preserve the validated query and batch size and contain nonnull, non-array object bindVars, including when toJSON is present. Throwing statement/context getters and malformed serialized snapshots fail as invalid_database_statement before dispatch. Rip-Hunter encodes the wire payload. Failed serialization is sanitized as invalid_database_statement. Bind-variable schema, canonical JSON and untrusted input validation remain caller policy.
34
+
35
+ Only exact final endpoint responses with status 201 return data, with error:false, hasMore:false, an array within maxRows and no cursor id. An optional success code must match 201. Fatal UTF-8 and JSON parsing reject malformed data. Non-success statuses400..599 consume only bounded bodies within the full request deadline; they expose a DatabaseRequestError of kind status only when error:true, code matches the HTTP status, no cursor fields occur, and errorNum is an integer1..2,147,483,647. Only status/errorNum are retained; server errorMessage/body/query/credential details are discarded. Malformed error envelopes are response failures, excess bytes are limit failures. Other statuses and redirected endpoints are refused before JSON decode.
36
+
37
+ remainingMs, when supplied, must return a finite number; zero/negative rejects as timeout before dispatch, never a disabled timeout. Each request uses the smaller configured/remaining budget, rechecked after request snapshotting. Rip-Hunter bounds both headers and body consumption and handles finite durations above the platform timer maximum with bounded scheduling. Caller and adapter cancellation preserve the exact caller signal reason in DatabaseRequestError.cause; other error causes remain sanitized. Rip owns timer/listener cleanup. Injected transports must honor the supplied signal to release underlying resources. Cancellation or rejection after submitting a mutation does not establish rollback/noncommit. No mutation is replayed automatically.
38
+
39
+ Official [cursor API](https://docs.arango.ai/arangodb/stable/develop/http-api/queries/aql-queries/) describes single-roundtrip batchSize/hasMore/id behavior. Official [core errors](https://docs.arango.ai/arangodb/stable/develop/error-codes/) define 1200 as detected document conflict and 1210 as unique-constraint violation. These are raw sanitized database numbers, not an application CAS/idempotency interpretation. Product repository atomicity, database TLS/permissions/durability, live concurrency, artifact release and consumer adoption remain separate gates.
@@ -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.
@@ -0,0 +1,29 @@
1
+ # Managed authentication source capability
2
+
3
+ The additive `@nlabs/reaktor/auth` entry owns an asynchronous, database-backed session protocol. It is an unpublished source capability pending independent review and exact compatible artifact qualification; it is not installed in Kurupt or evidence of live service acceptance. Existing root user actions, admin policy and synchronous SESSION_SECRET functions remain unchanged.
4
+
5
+ `createManagedSessionService(options)` requires account and session-family persistence ports, an explicit issuer, audience, environment, signing binding and configured public-key trust. No provider or database client is created on import or by default. `signIn({user:{email,password}})`, `renew(token)`, `verify(token)` and `revoke(token)` are asynchronous. Sign-in uses the existing owned parsePassword/createPassword format factored into `matchesAccountPassword`, with no admin password override. An account must be explicitly active. Passwords and hashes never reach responses or JWTs. Enrollment/password migration and rate limits remain separate domain requirements.
6
+
7
+ Bearer tokens last at most 900 seconds. Every sign-in creates a unique session-family record with a fixed 86,400-second absolute limit; renewal retains sid and clamps expiration to that limit. Expired bearers require sign-in. This protocol has no refresh token, automatic mutation replay or immediate revocation of an earlier bearer on ordinary renewal. The client refresh window is 300 seconds and belongs to the frontend policy owner. Response `issued`/`expires` and family timestamps are milliseconds; JWT iat/exp are integer seconds. Responses include schemaVersion=1, environment, userId, username, sid, token, issued and expires only.
8
+
9
+ Every verify/renew/revoke reads the active account and family, including ownership and environment; revoked/missing families fail closed. Issuance rechecks them after managed signing, so account disable or revocation during signing cannot publish successful credentials. Persistence failures are `auth_unavailable`, with no provider/database error text. Adapters must atomically create unique sid records, never resurrect or overwrite revoked families, and atomically/idempotently mark the matching sid/userId revoked. Repeated revoke of an already revoked family rejects as revoked_session. Failed sign-in after family creation may leave an unusable family until its absolute expiry; housekeeping must not grant it a credential.
10
+
11
+ Family schema is `{sid,userId,environment,created,absoluteExpires,revoked}`. Account bindings must return canonical database-owned identity and explicit active status, salt and stored hash. No in-memory production adapter is supplied. The current owner has no session-family persistence implementation; composing these ports through a separately reviewed lean Reaktor database entry is an outstanding integration gate. Account repository implementations must enforce exact normalized email lookup and database authorization. Synthetic ports in owner tests are test fixtures only.
12
+
13
+ Trust uses RSA public keys of at least 2048 bits. Only RS256 JWTs with known kid and typ=JWT are accepted, with exact configured iss/aud, nonempty bounded sub/userId agreement, sid/jti and integer iat/exp. Tokens are limited to 8192 bytes, lifetime to 900 seconds and future-iat tolerance to a configured 0–30 seconds. Expiration remains strict even with skew. Token-supplied discovery/header fields are rejected. Trust allows exactly one nonretiring current signing kid and at most three explicitly retiring keys; retiring deadlines must be future and at most 900+skew seconds from configuration. Keys are captured at service creation and never discovered remotely. Rotation requires replacing the explicitly approved service configuration before deadlines; no ambient cache or URL discovery exists.
14
+
15
+ `createKmsSigner(kmsClient, SignCommand, {keyArn,kid})` binds the real AWS SDK KMSClient/SignCommand through their public structural contracts. The configured key ARN must identify a key, never an alias or JWT secret. It sends RAW JWT signing input (1–4096 bytes) with RSASSA_PKCS1_V1_5_SHA_256, validates returned key/algorithm/signature, and redacts provider errors. Signer output is verified against current configured public trust before credentials are returned. The owner does not add SDK construction or a provider default; the trusted runtime composition must install a compatible `@aws-sdk/client-kms`, supply credentials/IAM privately and disable mutation retry as appropriate. An isolated fixture qualifies 3.1138.0's actual client/command declarations and request serialization with denied network; this does not prove key capabilities, IAM or cloud acceptance.
16
+
17
+ Public declarations require Node crypto/Buffer and this entry is server-only. Native auth composition belongs to Metropolis; do not import it into a React Native bundle. The owner package still includes repository-relative analytics/transport dependencies and broad legacy root APIs. Scoped auth compilation does not certify a portable archive or the complete owner build. Exact artifact members/dependency closure, consumer adoption, a concrete database composition, GraphQL authorization, independent review, external signing key/current-retiring trust provision and real account/network/revocation acceptance remain open.
18
+
19
+ ## Optional whole-operation deadline and cancellation
20
+
21
+ `operationTimeoutMs` optionally configures the service default. Each `signIn`, `renew`, `verify` and `revoke` accepts a final `{timeoutMs?, signal?}` argument. Omitted timeouts preserve unlimited legacy timing; configured values must be finite positive safe integer milliseconds. An explicit per-call duration replaces the default. The operation owns one monotonic absolute budget across every read, insert, signer and post-sign verification, using the public Rip-Hunter `/deadline` scheduler for bounded intervals above the platform timer limit. Calls reject with `ManagedAuthOperationError` (`kind: timeout | abort`, sanitized `auth_timeout` / `auth_abort` message). For aborts its `cause` is the caller's exact reason; callers must not log that potentially sensitive value.
22
+
23
+ Account/family/signer ports accept an optional `ManagedAuthPortContext` containing `signal` and `remainingMs()`. Existing ports may ignore the additive argument. The service guards before/after each await and before starting subsequent work; it races cancellation so an uncooperative pending binding cannot indefinitely delay caller rejection. Later resolutions/rejections remain observed and cannot publish credentials or initiate a subsequent mutation. Synchronous password/signature work cannot be preempted on the JavaScript thread; the next guard rejects before continuing.
24
+
25
+ `createKmsSigner` forwards this signal via the actual AWS SDK `send(command, {abortSignal})` contract and checks cancellation before/after signing. Provider bindings must honor the signal to release their resources. The HTTP persistence adapter composes the operation signal with its optional adapter shutdown signal and caps each request/body deadline at the smaller remaining operation budget. Exhausted budget rejects before dispatch and is never passed as zero (which disables generic HTTP deadlines). The older arangojs persistence binding cannot cancel through its supported public API; it retains its per-query timeout and can ignore the optional context, while the service still bounds completion and further work.
26
+
27
+ Cancellation is not rollback. Already-submitted INSERT/revoke/KMS work may have executed or committed before cancellation, including when a provider ignores the signal. No mutation is replayed automatically, and a timeout/rejection does not establish noncommit. Live SDK/DB cancellation, cursor TTL/atomicity and compatible frozen artifact adoption remain separate acceptance gates. The newly public Rip-Hunter scheduler export must be adopted from an exact compatible artifact; physical file presence alone is insufficient.
28
+
29
+ An ordinary terminal operation failure also aborts its signal before timer/listener cleanup, so cooperative pending sibling ports (for example the parallel account/family reads) can release resources promptly. The signal reason is the original outward sanitized failure; the caller still receives that identical error, rather than a replacement cancellation error. Successful completion clears timer/listener controls without aborting its signal. Later caller cancellation cannot change the failed terminal reason or restart work. Bindings should not log signal reasons.
@@ -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.
@@ -0,0 +1,17 @@
1
+ # Opaque standalone accounts
2
+
3
+ Additive server-only `@nlabs/reaktor/auth/opaque-accounts` entry. Included in the pending1.19 release candidate; publication and consumer adoption are separate verification steps. Existing root user actions and managed JWT authentication remain separate. Native clients call the consumer API; they do not import this Node module.
4
+
5
+ `createOpaqueAccountService({repository})` supports signup, signin, verify and idempotent revoke. Enrollment/signin accept a trusted source identity as their second argument, never a request-supplied forwarding header. Optional operation `{signal,timeoutMs}` bounds publication and later steps (default10seconds, maximum60seconds). In-flight bindings/crypto cannot always be interrupted; uncertain mutations are never automatically retried. A timed-out signup may exist: try signin rather than reenrolling automatically.
6
+
7
+ Exact password contract:1–128 Unicode scalars (strength recommendations belong to the consumer UI),≤512UTF8bytes, no trim/truncation. Version1 scrypt N131072/r8/p1/key32/randomsalt16/maxmem256MiB. One expensive credential operation admitted per service instance; excess rejected, not queued. Legacy hash formats/CRM contacts are not silently migrated or linked. Generic invalid credentials, no admin override, inactive account fails. Credential work and unknown-user dummy work use the same pinned KDF.
8
+
9
+ `createArangoAccountRepository({databaseName,collections,connection?})` uses explicit exclusive transactions, waitForSync and no implicit collections. Collections are distinct trusted configuration, not user input: accounts, claims, sessions, attempts. Optional connection is `{url,username,password}` with HTTPS origin, non-root credentials, redirects/retries disabled and10second request timeout. It supplies that concrete database to the existing durable transaction helper; it does not replace global Reaktor configuration. Without it, the pre-existing useDb database behavior remains. Injected transaction queries are tests/caller-owned lifecycles only.
10
+
11
+ Unique email and username claims, account and initial session commit atomically. Account IDs are random UUIDs. There are no legacy users/personas or graph edges in this account namespace. DB time determines sessions/attempt windows. Raw opaque tokens are returned once; only SHA256 token digest is stored. Session validation checks active account and fixed seven-day absolute expiry; revoke deletes that session idempotently. No sliding renewal, refresh token, signing key or membership requirement.
12
+
13
+ Distributed attempt windows:15minutes, signup5 per email/20 per source, signin10 per email/60 per source. Both counters commit even for rejection. Limit keys contain hashes, not raw identifiers. Session/attempt rows include expiresAt milliseconds for correctness and expiresAtIso strings for optional Arango TTL indexes; TTL deletion is housekeeping and never substitutes for synchronous expiry checks. Provision TTL on expiresAtIso with expireAfter0, not on the millisecond numeric field. Claims/accounts are permanent until explicit lifecycle handling.
14
+
15
+ Consumers provision exactly declared collections/permissions before enablement. Existing limited users must receive explicit none on new collections when DB-ro inheritance would otherwise expose them. Never grant game-world workers account/password read access. Public enablement requires owned rate limits, scoped credentials, bounded cloud concurrency and real database acceptance. Unit repository ports are not real transaction/concurrency evidence.
16
+
17
+ The consumer maps internal IDs to its stable public subject and controls all routes/DTOs. No email verification, recovery, account deletion, legacy linking or general-public release is implied. Those require separate lifecycle work. Artifact ownership/revision, native/device acceptance and real cloud/database checks must be recorded by adopters.