@noodleseed/one 0.83.0 → 0.84.1

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 (241) hide show
  1. package/dist/cli.d.ts.map +1 -1
  2. package/dist/cli.js +4 -1
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/author-loop.d.ts.map +1 -1
  5. package/dist/commands/author-loop.js +7 -7
  6. package/dist/commands/author-loop.js.map +1 -1
  7. package/dist/commands/catalog-data-platform-auth.d.ts.map +1 -1
  8. package/dist/commands/catalog-data-platform-auth.js +70 -2
  9. package/dist/commands/catalog-data-platform-auth.js.map +1 -1
  10. package/dist/commands/platform-account-reset-args.d.ts +40 -0
  11. package/dist/commands/platform-account-reset-args.d.ts.map +1 -0
  12. package/dist/commands/platform-account-reset-args.js +181 -0
  13. package/dist/commands/platform-account-reset-args.js.map +1 -0
  14. package/dist/commands/platform-account-reset-files.d.ts +9 -0
  15. package/dist/commands/platform-account-reset-files.d.ts.map +1 -0
  16. package/dist/commands/platform-account-reset-files.js +45 -0
  17. package/dist/commands/platform-account-reset-files.js.map +1 -0
  18. package/dist/commands/platform-account-reset-ops.d.ts +3 -0
  19. package/dist/commands/platform-account-reset-ops.d.ts.map +1 -0
  20. package/dist/commands/platform-account-reset-ops.js +162 -0
  21. package/dist/commands/platform-account-reset-ops.js.map +1 -0
  22. package/dist/plugin-mode/build-readiness-recorder.d.ts.map +1 -1
  23. package/dist/plugin-mode/build-readiness-recorder.js +3 -1
  24. package/dist/plugin-mode/build-readiness-recorder.js.map +1 -1
  25. package/node_modules/@noodle-borg/agent-kit/dist/generated/example-files.js +1 -1
  26. package/node_modules/@noodle-borg/agent-kit/dist/generated/example-files.js.map +1 -1
  27. package/node_modules/@noodle-borg/agent-kit/dist/skill-authoring-refs.d.ts.map +1 -1
  28. package/node_modules/@noodle-borg/agent-kit/dist/skill-authoring-refs.js +3 -1
  29. package/node_modules/@noodle-borg/agent-kit/dist/skill-authoring-refs.js.map +1 -1
  30. package/node_modules/@noodle-borg/agent-kit/dist/skill-embedded-assistant-ref.js +1 -1
  31. package/node_modules/@noodle-borg/agent-kit/dist/skill-embedded-assistant-ref.js.map +1 -1
  32. package/node_modules/@noodle-borg/agent-kit/dist/skill-operations-refs.js +2 -2
  33. package/node_modules/@noodle-borg/agent-kit/dist/skill-operations-refs.js.map +1 -1
  34. package/node_modules/@noodle-borg/agent-kit/package.json +1 -1
  35. package/node_modules/@noodle-borg/service/dist/billing/enforcement-activation.d.ts +4 -4
  36. package/node_modules/@noodle-borg/service/dist/billing/read-contract.d.ts +6 -6
  37. package/node_modules/@noodle-borg/service/dist/index.d.ts +4 -1
  38. package/node_modules/@noodle-borg/service/dist/index.d.ts.map +1 -1
  39. package/node_modules/@noodle-borg/service/dist/index.js +2 -0
  40. package/node_modules/@noodle-borg/service/dist/index.js.map +1 -1
  41. package/node_modules/@noodle-borg/service/dist/main.js +5 -0
  42. package/node_modules/@noodle-borg/service/dist/main.js.map +1 -1
  43. package/node_modules/@noodle-borg/service/dist/oauth/developer-grant-flow.d.ts.map +1 -1
  44. package/node_modules/@noodle-borg/service/dist/oauth/developer-grant-flow.js +1 -0
  45. package/node_modules/@noodle-borg/service/dist/oauth/developer-grant-flow.js.map +1 -1
  46. package/node_modules/@noodle-borg/service/dist/oauth/provider.d.ts.map +1 -1
  47. package/node_modules/@noodle-borg/service/dist/oauth/provider.js +1 -0
  48. package/node_modules/@noodle-borg/service/dist/oauth/provider.js.map +1 -1
  49. package/node_modules/@noodle-borg/service/dist/oauth/store-postgres-schema.d.ts.map +1 -1
  50. package/node_modules/@noodle-borg/service/dist/oauth/store-postgres-schema.js +17 -0
  51. package/node_modules/@noodle-borg/service/dist/oauth/store-postgres-schema.js.map +1 -1
  52. package/node_modules/@noodle-borg/service/dist/oauth/store-postgres.d.ts +2 -2
  53. package/node_modules/@noodle-borg/service/dist/oauth/store-postgres.d.ts.map +1 -1
  54. package/node_modules/@noodle-borg/service/dist/oauth/store-postgres.js +25 -5
  55. package/node_modules/@noodle-borg/service/dist/oauth/store-postgres.js.map +1 -1
  56. package/node_modules/@noodle-borg/service/dist/oauth/store.d.ts +5 -3
  57. package/node_modules/@noodle-borg/service/dist/oauth/store.d.ts.map +1 -1
  58. package/node_modules/@noodle-borg/service/dist/oauth/store.js +5 -5
  59. package/node_modules/@noodle-borg/service/dist/oauth/store.js.map +1 -1
  60. package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-handler.d.ts.map +1 -1
  61. package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-handler.js +7 -2
  62. package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-handler.js.map +1 -1
  63. package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-support.d.ts +1 -1
  64. package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-support.d.ts.map +1 -1
  65. package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-support.js.map +1 -1
  66. package/node_modules/@noodle-borg/service/dist/oauth/upstream-consent.d.ts.map +1 -1
  67. package/node_modules/@noodle-borg/service/dist/oauth/upstream-consent.js +1 -1
  68. package/node_modules/@noodle-borg/service/dist/oauth/upstream-consent.js.map +1 -1
  69. package/node_modules/@noodle-borg/service/dist/oauth/upstream-federation.d.ts.map +1 -1
  70. package/node_modules/@noodle-borg/service/dist/oauth/upstream-federation.js +6 -1
  71. package/node_modules/@noodle-borg/service/dist/oauth/upstream-federation.js.map +1 -1
  72. package/node_modules/@noodle-borg/service/dist/options.d.ts +13 -0
  73. package/node_modules/@noodle-borg/service/dist/options.d.ts.map +1 -1
  74. package/node_modules/@noodle-borg/service/dist/platform-account-reset-config.d.ts +9 -0
  75. package/node_modules/@noodle-borg/service/dist/platform-account-reset-config.d.ts.map +1 -0
  76. package/node_modules/@noodle-borg/service/dist/platform-account-reset-config.js +24 -0
  77. package/node_modules/@noodle-borg/service/dist/platform-account-reset-config.js.map +1 -0
  78. package/node_modules/@noodle-borg/service/dist/platform-account-reset-dispatch-lock-postgres.d.ts +12 -0
  79. package/node_modules/@noodle-borg/service/dist/platform-account-reset-dispatch-lock-postgres.d.ts.map +1 -0
  80. package/node_modules/@noodle-borg/service/dist/platform-account-reset-dispatch-lock-postgres.js +110 -0
  81. package/node_modules/@noodle-borg/service/dist/platform-account-reset-dispatch-lock-postgres.js.map +1 -0
  82. package/node_modules/@noodle-borg/service/dist/platform-account-reset-fingerprint.d.ts +9 -0
  83. package/node_modules/@noodle-borg/service/dist/platform-account-reset-fingerprint.d.ts.map +1 -0
  84. package/node_modules/@noodle-borg/service/dist/platform-account-reset-fingerprint.js +46 -0
  85. package/node_modules/@noodle-borg/service/dist/platform-account-reset-fingerprint.js.map +1 -0
  86. package/node_modules/@noodle-borg/service/dist/platform-account-reset-operation-postgres.d.ts +77 -0
  87. package/node_modules/@noodle-borg/service/dist/platform-account-reset-operation-postgres.d.ts.map +1 -0
  88. package/node_modules/@noodle-borg/service/dist/platform-account-reset-operation-postgres.js +144 -0
  89. package/node_modules/@noodle-borg/service/dist/platform-account-reset-operation-postgres.js.map +1 -0
  90. package/node_modules/@noodle-borg/service/dist/platform-account-reset-operator.d.ts +29 -0
  91. package/node_modules/@noodle-borg/service/dist/platform-account-reset-operator.d.ts.map +1 -0
  92. package/node_modules/@noodle-borg/service/dist/platform-account-reset-operator.js +59 -0
  93. package/node_modules/@noodle-borg/service/dist/platform-account-reset-operator.js.map +1 -0
  94. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-helpers.d.ts +11 -0
  95. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-helpers.d.ts.map +1 -0
  96. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-helpers.js +22 -0
  97. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-helpers.js.map +1 -0
  98. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-postgres.d.ts +41 -0
  99. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-postgres.d.ts.map +1 -0
  100. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-postgres.js +314 -0
  101. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-postgres.js.map +1 -0
  102. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-resources-postgres.d.ts +14 -0
  103. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-resources-postgres.d.ts.map +1 -0
  104. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-resources-postgres.js +210 -0
  105. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-resources-postgres.js.map +1 -0
  106. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-rollback-postgres.d.ts +11 -0
  107. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-rollback-postgres.d.ts.map +1 -0
  108. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-rollback-postgres.js +71 -0
  109. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-rollback-postgres.js.map +1 -0
  110. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ports.d.ts +12 -0
  111. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ports.d.ts.map +1 -0
  112. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ports.js +2 -0
  113. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ports.js.map +1 -0
  114. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-evidence-postgres.d.ts +22 -0
  115. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-evidence-postgres.d.ts.map +1 -0
  116. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-evidence-postgres.js +177 -0
  117. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-evidence-postgres.js.map +1 -0
  118. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-local-postgres.d.ts +35 -0
  119. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-local-postgres.d.ts.map +1 -0
  120. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-local-postgres.js +184 -0
  121. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-local-postgres.js.map +1 -0
  122. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-persistence-postgres.d.ts +11 -0
  123. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-persistence-postgres.d.ts.map +1 -0
  124. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-persistence-postgres.js +120 -0
  125. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-persistence-postgres.js.map +1 -0
  126. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-postgres.d.ts +79 -0
  127. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-postgres.d.ts.map +1 -0
  128. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-postgres.js +286 -0
  129. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-postgres.js.map +1 -0
  130. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-result.d.ts +21 -0
  131. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-result.d.ts.map +1 -0
  132. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-result.js +81 -0
  133. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-result.js.map +1 -0
  134. package/node_modules/@noodle-borg/service/dist/platform-account-reset-quarantine-postgres.d.ts +46 -0
  135. package/node_modules/@noodle-borg/service/dist/platform-account-reset-quarantine-postgres.d.ts.map +1 -0
  136. package/node_modules/@noodle-borg/service/dist/platform-account-reset-quarantine-postgres.js +283 -0
  137. package/node_modules/@noodle-borg/service/dist/platform-account-reset-quarantine-postgres.js.map +1 -0
  138. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-eligibility-postgres.d.ts +13 -0
  139. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-eligibility-postgres.d.ts.map +1 -0
  140. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-eligibility-postgres.js +81 -0
  141. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-eligibility-postgres.js.map +1 -0
  142. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-local-postgres.d.ts +30 -0
  143. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-local-postgres.d.ts.map +1 -0
  144. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-local-postgres.js +248 -0
  145. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-local-postgres.js.map +1 -0
  146. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-postgres.d.ts +29 -0
  147. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-postgres.d.ts.map +1 -0
  148. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-postgres.js +281 -0
  149. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-postgres.js.map +1 -0
  150. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-preview-postgres.d.ts +55 -0
  151. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-preview-postgres.d.ts.map +1 -0
  152. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-preview-postgres.js +262 -0
  153. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-preview-postgres.js.map +1 -0
  154. package/node_modules/@noodle-borg/service/dist/platform-account-reset-schema-postgres.d.ts +7 -0
  155. package/node_modules/@noodle-borg/service/dist/platform-account-reset-schema-postgres.d.ts.map +1 -0
  156. package/node_modules/@noodle-borg/service/dist/platform-account-reset-schema-postgres.js +439 -0
  157. package/node_modules/@noodle-borg/service/dist/platform-account-reset-schema-postgres.js.map +1 -0
  158. package/node_modules/@noodle-borg/service/dist/platform-account-reset.d.ts +276 -0
  159. package/node_modules/@noodle-borg/service/dist/platform-account-reset.d.ts.map +1 -0
  160. package/node_modules/@noodle-borg/service/dist/platform-account-reset.js +141 -0
  161. package/node_modules/@noodle-borg/service/dist/platform-account-reset.js.map +1 -0
  162. package/node_modules/@noodle-borg/service/dist/platform-auth-configuration.d.ts +1 -1
  163. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-legacy-sources-postgres.d.ts.map +1 -1
  164. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-legacy-sources-postgres.js +5 -1
  165. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-legacy-sources-postgres.js.map +1 -1
  166. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-local-subjects-postgres.d.ts.map +1 -1
  167. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-local-subjects-postgres.js +10 -1
  168. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-local-subjects-postgres.js.map +1 -1
  169. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-postgres.d.ts +5 -10
  170. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-postgres.d.ts.map +1 -1
  171. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-postgres.js +86 -47
  172. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-postgres.js.map +1 -1
  173. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-transaction-postgres.d.ts +17 -0
  174. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-transaction-postgres.d.ts.map +1 -0
  175. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-transaction-postgres.js +240 -0
  176. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-transaction-postgres.js.map +1 -0
  177. package/node_modules/@noodle-borg/service/dist/platform-auth-operator.d.ts +63 -63
  178. package/node_modules/@noodle-borg/service/dist/platform-auth-rollout-support.d.ts +1 -1
  179. package/node_modules/@noodle-borg/service/dist/platform-auth-runtime.d.ts +18 -1
  180. package/node_modules/@noodle-borg/service/dist/platform-auth-runtime.d.ts.map +1 -1
  181. package/node_modules/@noodle-borg/service/dist/platform-auth-runtime.js +97 -2
  182. package/node_modules/@noodle-borg/service/dist/platform-auth-runtime.js.map +1 -1
  183. package/node_modules/@noodle-borg/service/dist/platform-auth-service-bootstrap.d.ts +4 -1
  184. package/node_modules/@noodle-borg/service/dist/platform-auth-service-bootstrap.d.ts.map +1 -1
  185. package/node_modules/@noodle-borg/service/dist/platform-auth-service-bootstrap.js +4 -0
  186. package/node_modules/@noodle-borg/service/dist/platform-auth-service-bootstrap.js.map +1 -1
  187. package/node_modules/@noodle-borg/service/dist/platform-identity-postgres.d.ts +7 -2
  188. package/node_modules/@noodle-borg/service/dist/platform-identity-postgres.d.ts.map +1 -1
  189. package/node_modules/@noodle-borg/service/dist/platform-identity-postgres.js +24 -2
  190. package/node_modules/@noodle-borg/service/dist/platform-identity-postgres.js.map +1 -1
  191. package/node_modules/@noodle-borg/service/dist/platform-identity-schema-postgres.d.ts.map +1 -1
  192. package/node_modules/@noodle-borg/service/dist/platform-identity-schema-postgres.js +4 -0
  193. package/node_modules/@noodle-borg/service/dist/platform-identity-schema-postgres.js.map +1 -1
  194. package/node_modules/@noodle-borg/service/dist/platform-identity-sync-postgres.d.ts +7 -1
  195. package/node_modules/@noodle-borg/service/dist/platform-identity-sync-postgres.d.ts.map +1 -1
  196. package/node_modules/@noodle-borg/service/dist/platform-identity-sync-postgres.js +121 -8
  197. package/node_modules/@noodle-borg/service/dist/platform-identity-sync-postgres.js.map +1 -1
  198. package/node_modules/@noodle-borg/service/dist/platform-identity-sync-recovery-postgres.d.ts.map +1 -1
  199. package/node_modules/@noodle-borg/service/dist/platform-identity-sync-recovery-postgres.js +11 -1
  200. package/node_modules/@noodle-borg/service/dist/platform-identity-sync-recovery-postgres.js.map +1 -1
  201. package/node_modules/@noodle-borg/service/dist/platform-identity-sync.d.ts +5 -3
  202. package/node_modules/@noodle-borg/service/dist/platform-identity-sync.d.ts.map +1 -1
  203. package/node_modules/@noodle-borg/service/dist/platform-identity-sync.js +15 -1
  204. package/node_modules/@noodle-borg/service/dist/platform-identity-sync.js.map +1 -1
  205. package/node_modules/@noodle-borg/service/dist/platform-identity.d.ts +23 -2
  206. package/node_modules/@noodle-borg/service/dist/platform-identity.d.ts.map +1 -1
  207. package/node_modules/@noodle-borg/service/dist/platform-identity.js +21 -0
  208. package/node_modules/@noodle-borg/service/dist/platform-identity.js.map +1 -1
  209. package/node_modules/@noodle-borg/service/dist/registry-state.d.ts +8 -0
  210. package/node_modules/@noodle-borg/service/dist/registry-state.d.ts.map +1 -1
  211. package/node_modules/@noodle-borg/service/dist/registry-state.js +15 -2
  212. package/node_modules/@noodle-borg/service/dist/registry-state.js.map +1 -1
  213. package/node_modules/@noodle-borg/service/dist/registry.d.ts +2 -0
  214. package/node_modules/@noodle-borg/service/dist/registry.d.ts.map +1 -1
  215. package/node_modules/@noodle-borg/service/dist/registry.js +4 -1
  216. package/node_modules/@noodle-borg/service/dist/registry.js.map +1 -1
  217. package/node_modules/@noodle-borg/service/dist/routes/platform-account-reset-dispatch.d.ts +8 -0
  218. package/node_modules/@noodle-borg/service/dist/routes/platform-account-reset-dispatch.d.ts.map +1 -0
  219. package/node_modules/@noodle-borg/service/dist/routes/platform-account-reset-dispatch.js +36 -0
  220. package/node_modules/@noodle-borg/service/dist/routes/platform-account-reset-dispatch.js.map +1 -0
  221. package/node_modules/@noodle-borg/service/dist/routes/platform-account-reset.d.ts +22 -0
  222. package/node_modules/@noodle-borg/service/dist/routes/platform-account-reset.d.ts.map +1 -0
  223. package/node_modules/@noodle-borg/service/dist/routes/platform-account-reset.js +201 -0
  224. package/node_modules/@noodle-borg/service/dist/routes/platform-account-reset.js.map +1 -0
  225. package/node_modules/@noodle-borg/service/dist/routes/private-platform-auth-dispatch.d.ts +18 -0
  226. package/node_modules/@noodle-borg/service/dist/routes/private-platform-auth-dispatch.d.ts.map +1 -0
  227. package/node_modules/@noodle-borg/service/dist/routes/private-platform-auth-dispatch.js +36 -0
  228. package/node_modules/@noodle-borg/service/dist/routes/private-platform-auth-dispatch.js.map +1 -0
  229. package/node_modules/@noodle-borg/service/dist/serve-options.d.ts +2 -1
  230. package/node_modules/@noodle-borg/service/dist/serve-options.d.ts.map +1 -1
  231. package/node_modules/@noodle-borg/service/dist/serve.d.ts.map +1 -1
  232. package/node_modules/@noodle-borg/service/dist/serve.js +16 -1
  233. package/node_modules/@noodle-borg/service/dist/serve.js.map +1 -1
  234. package/node_modules/@noodle-borg/service/dist/service.d.ts.map +1 -1
  235. package/node_modules/@noodle-borg/service/dist/service.js +4 -5
  236. package/node_modules/@noodle-borg/service/dist/service.js.map +1 -1
  237. package/node_modules/@noodle-borg/service/dist/workos-directory.d.ts +22 -3
  238. package/node_modules/@noodle-borg/service/dist/workos-directory.d.ts.map +1 -1
  239. package/node_modules/@noodle-borg/service/dist/workos-directory.js +56 -5
  240. package/node_modules/@noodle-borg/service/dist/workos-directory.js.map +1 -1
  241. package/package.json +1 -1
@@ -0,0 +1,9 @@
1
+ import { type PlatformAccountResetTargetSet } from './platform-account-reset.js';
2
+ /**
3
+ * Parse the temporary Secret Manager-injected Release-A target binding.
4
+ *
5
+ * Absence keeps the reset surface dormant. Invalid content fails startup without echoing the protected
6
+ * value or any derived fingerprint.
7
+ */
8
+ export declare function resolvePlatformAccountResetApprovedTargetSet(value: string | undefined): PlatformAccountResetTargetSet | undefined;
9
+ //# sourceMappingURL=platform-account-reset-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-account-reset-config.d.ts","sourceRoot":"","sources":["../src/platform-account-reset-config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,6BAA6B,EAEnC,MAAM,6BAA6B,CAAC;AAKrC;;;;;GAKG;AACH,wBAAgB,4CAA4C,CAC1D,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,6BAA6B,GAAG,SAAS,CAW3C"}
@@ -0,0 +1,24 @@
1
+ import { PlatformAccountResetTargetSetSchema, } from './platform-account-reset.js';
2
+ const CONFIG_ERROR = 'NOODLE_PLATFORM_ACCOUNT_RESET_TARGET_SET must contain one strict three-principal target set';
3
+ /**
4
+ * Parse the temporary Secret Manager-injected Release-A target binding.
5
+ *
6
+ * Absence keeps the reset surface dormant. Invalid content fails startup without echoing the protected
7
+ * value or any derived fingerprint.
8
+ */
9
+ export function resolvePlatformAccountResetApprovedTargetSet(value) {
10
+ if (value === undefined)
11
+ return undefined;
12
+ let decoded;
13
+ try {
14
+ decoded = JSON.parse(value);
15
+ }
16
+ catch {
17
+ throw new Error(CONFIG_ERROR);
18
+ }
19
+ const parsed = PlatformAccountResetTargetSetSchema.safeParse(decoded);
20
+ if (!parsed.success)
21
+ throw new Error(CONFIG_ERROR);
22
+ return parsed.data;
23
+ }
24
+ //# sourceMappingURL=platform-account-reset-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-account-reset-config.js","sourceRoot":"","sources":["../src/platform-account-reset-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,mCAAmC,GACpC,MAAM,6BAA6B,CAAC;AAErC,MAAM,YAAY,GAChB,6FAA6F,CAAC;AAEhG;;;;;GAKG;AACH,MAAM,UAAU,4CAA4C,CAC1D,KAAyB;IAEzB,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,IAAI,OAAgB,CAAC;IACrB,IAAI,CAAC;QACH,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC;IAChC,CAAC;IACD,MAAM,MAAM,GAAG,mCAAmC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACtE,IAAI,CAAC,MAAM,CAAC,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC;IACnD,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { PlatformAccountResetMutationOutcome, PlatformAccountResetPool } from './platform-account-reset-operation-postgres.js';
2
+ export interface PlatformAccountResetDispatchContext {
3
+ readonly deadline: number;
4
+ readonly replayLifecycle: string | undefined;
5
+ }
6
+ export declare function runPlatformAccountResetWithDispatchLock(pool: PlatformAccountResetPool, input: {
7
+ readonly operationId: string;
8
+ readonly timeoutMs: number;
9
+ readonly task: (context: PlatformAccountResetDispatchContext) => Promise<PlatformAccountResetMutationOutcome>;
10
+ }): Promise<PlatformAccountResetMutationOutcome>;
11
+ export declare function remainingPlatformAccountResetDispatchMilliseconds(deadline: number, maximum: number): number;
12
+ //# sourceMappingURL=platform-account-reset-dispatch-lock-postgres.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-account-reset-dispatch-lock-postgres.d.ts","sourceRoot":"","sources":["../src/platform-account-reset-dispatch-lock-postgres.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mCAAmC,EACnC,wBAAwB,EACzB,MAAM,gDAAgD,CAAC;AAKxD,MAAM,WAAW,mCAAmC;IAClD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9C;AAED,wBAAsB,uCAAuC,CAC3D,IAAI,EAAE,wBAAwB,EAC9B,KAAK,EAAE;IACL,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,CACb,OAAO,EAAE,mCAAmC,KACzC,OAAO,CAAC,mCAAmC,CAAC,CAAC;CACnD,GACA,OAAO,CAAC,mCAAmC,CAAC,CAmF9C;AAED,wBAAgB,iDAAiD,CAC/D,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GACd,MAAM,CAER"}
@@ -0,0 +1,110 @@
1
+ import { PlatformAccountResetPreviewError } from './platform-account-reset-preview-result.js';
2
+ export async function runPlatformAccountResetWithDispatchLock(pool, input) {
3
+ if (pool.connect === undefined)
4
+ throw new PlatformAccountResetPreviewError('operation_conflict');
5
+ const deadline = performance.now() + input.timeoutMs;
6
+ const acquisition = pool.connect();
7
+ let connection;
8
+ try {
9
+ connection = await withinDispatchDeadline(acquisition, deadline);
10
+ }
11
+ catch (error) {
12
+ void acquisition.then((lateConnection) => releasePoisoned(lateConnection, dispatchError(error)), () => undefined);
13
+ throw error;
14
+ }
15
+ try {
16
+ const statementTimeoutMs = remainingDispatchMilliseconds(deadline);
17
+ await dispatchQuery(connection, `SET lock_timeout TO '${statementTimeoutMs}ms'`, undefined, deadline);
18
+ await dispatchQuery(connection, `SET statement_timeout TO '${remainingDispatchMilliseconds(deadline)}ms'`, undefined, deadline);
19
+ await dispatchQuery(connection, 'SELECT pg_advisory_lock(hashtextextended($1, 0))', [`platform-account-reset-dispatch:${input.operationId}`], deadline);
20
+ }
21
+ catch (error) {
22
+ releasePoisoned(connection, dispatchError(error));
23
+ throw error;
24
+ }
25
+ let outcome;
26
+ let operationFailure;
27
+ try {
28
+ const replayHint = await dispatchQuery(connection, 'SELECT lifecycle FROM platform_account_reset_operations WHERE operation_id = $1', [input.operationId], deadline);
29
+ outcome = await input.task({
30
+ deadline,
31
+ replayLifecycle: replayHint.rows[0]?.lifecycle,
32
+ });
33
+ assertDispatchDeadline(deadline);
34
+ }
35
+ catch (error) {
36
+ operationFailure = error;
37
+ }
38
+ let cleanupFailure;
39
+ try {
40
+ const unlocked = await dispatchQuery(connection, 'SELECT pg_advisory_unlock(hashtextextended($1, 0)) AS unlocked', [`platform-account-reset-dispatch:${input.operationId}`], deadline);
41
+ if (unlocked.rows[0]?.unlocked !== true)
42
+ throw new PlatformAccountResetPreviewError('operation_conflict');
43
+ await dispatchQuery(connection, 'RESET statement_timeout; RESET lock_timeout', undefined, deadline);
44
+ }
45
+ catch (error) {
46
+ cleanupFailure = error;
47
+ }
48
+ if (cleanupFailure !== undefined)
49
+ releasePoisoned(connection, dispatchError(cleanupFailure));
50
+ else
51
+ connection.release?.();
52
+ if (cleanupFailure !== undefined)
53
+ throw cleanupFailure;
54
+ if (operationFailure !== undefined)
55
+ throw operationFailure;
56
+ if (outcome === undefined)
57
+ throw new PlatformAccountResetPreviewError('operation_conflict');
58
+ return outcome;
59
+ }
60
+ export function remainingPlatformAccountResetDispatchMilliseconds(deadline, maximum) {
61
+ return Math.min(remainingDispatchMilliseconds(deadline), maximum);
62
+ }
63
+ function dispatchQuery(connection, sql, values, deadline) {
64
+ remainingDispatchMilliseconds(deadline);
65
+ const query = values === undefined ? connection.query(sql) : connection.query(sql, values);
66
+ return withinDispatchDeadline(query, deadline);
67
+ }
68
+ function assertDispatchDeadline(deadline) {
69
+ remainingDispatchMilliseconds(deadline);
70
+ }
71
+ function remainingDispatchMilliseconds(deadline) {
72
+ const remaining = Math.floor(deadline - performance.now());
73
+ if (remaining <= 0)
74
+ throw new PlatformAccountResetPreviewError('operation_conflict');
75
+ return remaining;
76
+ }
77
+ async function withinDispatchDeadline(operation, deadline) {
78
+ const remaining = Math.ceil(deadline - performance.now());
79
+ if (remaining <= 0) {
80
+ void operation.catch(() => undefined);
81
+ throw new PlatformAccountResetPreviewError('operation_conflict');
82
+ }
83
+ let timer;
84
+ try {
85
+ return await Promise.race([
86
+ operation,
87
+ new Promise((_, reject) => {
88
+ timer = setTimeout(() => reject(new PlatformAccountResetPreviewError('operation_conflict')), remaining);
89
+ }),
90
+ ]);
91
+ }
92
+ finally {
93
+ if (timer !== undefined)
94
+ clearTimeout(timer);
95
+ }
96
+ }
97
+ function releasePoisoned(connection, error) {
98
+ try {
99
+ connection.release?.(error);
100
+ }
101
+ catch {
102
+ // Releasing with an error is the final pool-destruction boundary.
103
+ }
104
+ }
105
+ function dispatchError(error) {
106
+ return error instanceof Error
107
+ ? error
108
+ : new PlatformAccountResetPreviewError('operation_conflict');
109
+ }
110
+ //# sourceMappingURL=platform-account-reset-dispatch-lock-postgres.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-account-reset-dispatch-lock-postgres.js","sourceRoot":"","sources":["../src/platform-account-reset-dispatch-lock-postgres.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gCAAgC,EAAE,MAAM,4CA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AI,CAAC;QACH,OAAO,MAAM,OAAO,CAAC,IAAI,CAAC;YACxB,SAAS;YACT,IAAI,OAAO,CAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE;gBAC/B,KAAK,GAAG,UAAU,CAChB,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,gCAAgC,CAAC,oBAAoB,CAAC,CAAC,EACxE,SAAS,CACV,CAAC;YACJ,CAAC,CAAC;SACH,CAAC,CAAC;IACL,CAAC;YAAS,CAAC;QACT,IAAI,KAAK,KAAK,SAAS;YAAE,YAAY,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,UAA8B,EAAE,KAAY;IACnE,IAAI,CAAC;QACH,UAAU,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAAC,MAAM,CAAC;QACP,kEAAkE;IACpE,CAAC;AACH,CAAC;AAED,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,KAAK,YAAY,KAAK;QAC3B,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,IAAI,gCAAgC,CAAC,oBAAoB,CAAC,CAAC;AACjE,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { type PlatformAccountResetTargetSet } from './platform-account-reset.js';
2
+ /**
3
+ * Account-reset evidence uses sorted object keys and sorted arrays so database/query order cannot change a
4
+ * preview checksum. Callers include an explicit schema version and label at every independent fingerprint.
5
+ */
6
+ export declare function sha256Canonical(value: unknown): string;
7
+ export declare function canonicalJson(value: unknown): string;
8
+ export declare function platformAccountResetApprovedTargetSetFingerprint(targetSet: PlatformAccountResetTargetSet): string;
9
+ //# sourceMappingURL=platform-account-reset-fingerprint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-account-reset-fingerprint.d.ts","sourceRoot":"","sources":["../src/platform-account-reset-fingerprint.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,6BAA6B,EAEnC,MAAM,6BAA6B,CAAC;AAUrC;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAItD;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEpD;AAED,wBAAgB,gDAAgD,CAC9D,SAAS,EAAE,6BAA6B,GACvC,MAAM,CAOR"}
@@ -0,0 +1,46 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { PlatformAccountResetTargetSetSchema, } from './platform-account-reset.js';
3
+ /**
4
+ * Account-reset evidence uses sorted object keys and sorted arrays so database/query order cannot change a
5
+ * preview checksum. Callers include an explicit schema version and label at every independent fingerprint.
6
+ */
7
+ export function sha256Canonical(value) {
8
+ return createHash('sha256')
9
+ .update(JSON.stringify(canonicalize(value)))
10
+ .digest('hex');
11
+ }
12
+ export function canonicalJson(value) {
13
+ return JSON.stringify(canonicalize(value));
14
+ }
15
+ export function platformAccountResetApprovedTargetSetFingerprint(targetSet) {
16
+ const approved = PlatformAccountResetTargetSetSchema.parse(targetSet);
17
+ return sha256Canonical({
18
+ schemaVersion: 1,
19
+ label: 'platform_account_reset_approved_target_set',
20
+ principalIds: [...approved.principalIds].sort(compareText),
21
+ });
22
+ }
23
+ function canonicalize(value) {
24
+ if (value === null ||
25
+ typeof value === 'boolean' ||
26
+ typeof value === 'string' ||
27
+ (typeof value === 'number' && Number.isFinite(value))) {
28
+ return value;
29
+ }
30
+ if (Array.isArray(value)) {
31
+ return value
32
+ .map(canonicalize)
33
+ .sort((left, right) => JSON.stringify(left).localeCompare(JSON.stringify(right)));
34
+ }
35
+ if (typeof value === 'object') {
36
+ const entries = Object.entries(value)
37
+ .filter(([, entry]) => entry !== undefined)
38
+ .sort(([left], [right]) => left.localeCompare(right));
39
+ return Object.fromEntries(entries.map(([key, entry]) => [key, canonicalize(entry)]));
40
+ }
41
+ throw new TypeError('account-reset fingerprint input is not canonical JSON');
42
+ }
43
+ function compareText(left, right) {
44
+ return left < right ? -1 : left > right ? 1 : 0;
45
+ }
46
+ //# sourceMappingURL=platform-account-reset-fingerprint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-account-reset-fingerprint.js","sourceRoot":"","sources":["../src/platform-account-reset-fingerprint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAEL,mCAAmC,GACpC,MAAM,6BAA6B,CAAC;AAUrC;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,OAAO,UAAU,CAAC,QAAQ,CAAC;SACxB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;SAC3C,MAAM,CAAC,KAAK,CAAC,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,OAAO,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,gDAAgD,CAC9D,SAAwC;IAExC,MAAM,QAAQ,GAAG,mCAAmC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IACtE,OAAO,eAAe,CAAC;QACrB,aAAa,EAAE,CAAC;QAChB,KAAK,EAAE,4CAA4C;QACnD,YAAY,EAAE,CAAC,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC;KAC3D,CAAC,CAAC;AACL,CAAC;AAED,SAAS,YAAY,CAAC,KAAc;IAClC,IACE,KAAK,KAAK,IAAI;QACd,OAAO,KAAK,KAAK,SAAS;QAC1B,OAAO,KAAK,KAAK,QAAQ;QACzB,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EACrD,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK;aACT,GAAG,CAAC,YAAY,CAAC;aACjB,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACtF,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;aAClC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC;aAC1C,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;QACxD,OAAO,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACvF,CAAC;IACD,MAAM,IAAI,SAAS,CAAC,uDAAuD,CAAC,CAAC;AAC/E,CAAC;AAED,SAAS,WAAW,CAAC,IAAY,EAAE,KAAa;IAC9C,OAAO,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClD,CAAC"}
@@ -0,0 +1,77 @@
1
+ import { type PlatformAccountResetExecuteRequest, type PlatformAccountResetResult } from './platform-account-reset.js';
2
+ import type { PlatformIdentityQueryable } from './platform-identity-postgres.js';
3
+ export type PlatformAccountResetConnection = PlatformIdentityQueryable & {
4
+ release?: (error?: Error) => void;
5
+ };
6
+ export type PlatformAccountResetPool = PlatformIdentityQueryable & {
7
+ connect?: () => Promise<PlatformAccountResetConnection>;
8
+ };
9
+ export interface PlatformAccountResetActionEvidence {
10
+ readonly actorFingerprint: string;
11
+ readonly idempotencyKeyHash: string;
12
+ readonly requestFingerprint: string;
13
+ readonly reasonFingerprint: string;
14
+ }
15
+ export interface PlatformAccountResetRegistryPlan {
16
+ readonly action: 'quarantine' | 'rollback';
17
+ readonly apps: readonly {
18
+ readonly org: string;
19
+ readonly app: string;
20
+ }[];
21
+ readonly archivedAt: string;
22
+ }
23
+ export interface PlatformAccountResetMutationOutcome {
24
+ readonly result: PlatformAccountResetResult;
25
+ readonly registry: PlatformAccountResetRegistryPlan;
26
+ }
27
+ export interface PlatformAccountResetOperationRow {
28
+ readonly lifecycle: string;
29
+ readonly release_sha: string;
30
+ readonly rollout_generation: string;
31
+ readonly workos_realm: string;
32
+ readonly source_epoch: string;
33
+ readonly preview_checksum: string;
34
+ readonly target_set_fingerprint: string;
35
+ readonly approved_target_set_fingerprint: string | null;
36
+ readonly request_fingerprint: string;
37
+ readonly safe_result: unknown;
38
+ readonly preview_expires_at: Date | string;
39
+ readonly quarantined_at: Date | string | null;
40
+ readonly finalize_after: Date | string | null;
41
+ readonly quarantine_idempotency_key_hash: string | null;
42
+ readonly quarantine_request_fingerprint: string | null;
43
+ readonly quarantine_reason_fingerprint: string | null;
44
+ readonly quarantine_actor_fingerprint: string | null;
45
+ readonly quarantine_safe_result: unknown;
46
+ readonly rollback_idempotency_key_hash: string | null;
47
+ readonly rollback_request_fingerprint: string | null;
48
+ readonly rollback_reason_fingerprint: string | null;
49
+ readonly rollback_actor_fingerprint: string | null;
50
+ readonly rollback_safe_result: unknown;
51
+ }
52
+ export interface PlatformAccountResetFrozenResources {
53
+ readonly apps: readonly {
54
+ readonly org: string;
55
+ readonly app: string;
56
+ }[];
57
+ readonly deploymentIds: readonly string[];
58
+ readonly resourceCount: number;
59
+ }
60
+ export declare function platformAccountResetActionEvidence(request: PlatformAccountResetExecuteRequest, actorFingerprint: string): PlatformAccountResetActionEvidence;
61
+ export declare function lockPlatformAccountResetOperation(connection: PlatformIdentityQueryable, operationId: string): Promise<PlatformAccountResetOperationRow>;
62
+ export declare function assertPlatformAccountResetApprovedTargetSet(operation: PlatformAccountResetOperationRow, approvedTargetSetFingerprint: string): void;
63
+ export declare function loadPlatformAccountResetTargets(connection: PlatformIdentityQueryable, operationId: string, lifecycle: 'previewed' | 'quarantined'): Promise<readonly string[]>;
64
+ export declare function loadPlatformAccountResetFrozenResources(connection: PlatformIdentityQueryable, operationId: string): Promise<PlatformAccountResetFrozenResources>;
65
+ export declare function parsePlatformAccountResetSafeResult(value: unknown): PlatformAccountResetResult;
66
+ export declare function assertPlatformAccountResetRequestMatches(operation: PlatformAccountResetOperationRow, request: PlatformAccountResetExecuteRequest, options: {
67
+ readonly releaseSha: string;
68
+ readonly workosRealm: string;
69
+ }): void;
70
+ export declare function assertPlatformAccountResetActionReplay(evidence: PlatformAccountResetActionEvidence, stored: {
71
+ readonly idempotencyKeyHash: string | null;
72
+ readonly requestFingerprint: string | null;
73
+ readonly reasonFingerprint: string | null;
74
+ readonly actorFingerprint: string | null;
75
+ readonly safeResult: unknown;
76
+ }): PlatformAccountResetResult;
77
+ //# sourceMappingURL=platform-account-reset-operation-postgres.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-account-reset-operation-postgres.d.ts","sourceRoot":"","sources":["../src/platform-account-reset-operation-postgres.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kCAAkC,EACvC,KAAK,0BAA0B,EAEhC,MAAM,6BAA6B,CAAC;AAGrC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAEjF,MAAM,MAAM,8BAA8B,GAAG,yBAAyB,GAAG;IACvE,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;CACnC,CAAC;AACF,MAAM,MAAM,wBAAwB,GAAG,yBAAyB,GAAG;IACjE,OAAO,CAAC,EAAE,M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,MAAM,GACnC,IAAI,CAGN;AAED,wBAAsB,+BAA+B,CACnD,UAAU,EAAE,yBAAyB,EACrC,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,WAAW,GAAG,aAAa,GACrC,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAW5B;AAED,wBAAsB,uCAAuC,CAC3D,UAAU,EAAE,yBAAyB,EACrC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,mCAAmC,CAAC,CAqD9C;AAED,wBAAgB,mCAAmC,CAAC,KAAK,EAAE,OAAO,GAAG,0BAA0B,CAI9F;AAED,wBAAgB,wCAAwC,CACtD,SAAS,EAAE,gCAAgC,EAC3C,OAAO,EAAE,kCAAkC,EAC3C,OAAO,EAAE;IAAE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GACrE,IAAI,CASN;AAED,wBAAgB,sCAAsC,CACpD,QAAQ,EAAE,kCAAkC,EAC5C,MAAM,EAAE;IACN,QAAQ,CAAC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,QAAQ,CAAC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,QAAQ,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;CAC9B,GACA,0BAA0B,CAS5B"}
@@ -0,0 +1,144 @@
1
+ import { PlatformAccountResetResultSchema, } from './platform-account-reset.js';
2
+ import { sha256Canonical } from './platform-account-reset-fingerprint.js';
3
+ import { PlatformAccountResetPreviewError } from './platform-account-reset-preview-result.js';
4
+ export function platformAccountResetActionEvidence(request, actorFingerprint) {
5
+ const idempotencyKeyHash = sha256Canonical({
6
+ schemaVersion: 1,
7
+ label: `platform_account_reset_idempotency:${request.action}`,
8
+ actorFingerprint,
9
+ idempotencyKey: request.idempotencyKey,
10
+ });
11
+ return {
12
+ actorFingerprint,
13
+ idempotencyKeyHash,
14
+ reasonFingerprint: sha256Canonical({
15
+ schemaVersion: 1,
16
+ label: `platform_account_reset_reason:${request.action}`,
17
+ reason: request.reason,
18
+ }),
19
+ requestFingerprint: sha256Canonical({
20
+ schemaVersion: 1,
21
+ label: `platform_account_reset_request:${request.action}`,
22
+ operationId: request.operationId,
23
+ expectedGeneration: request.expectedGeneration,
24
+ releaseSha: request.releaseSha,
25
+ previewChecksum: request.previewChecksum,
26
+ actorFingerprint,
27
+ idempotencyKeyHash,
28
+ reason: request.reason,
29
+ confirmed: request.confirmed,
30
+ }),
31
+ };
32
+ }
33
+ export async function lockPlatformAccountResetOperation(connection, operationId) {
34
+ await connection.query('SELECT pg_advisory_xact_lock(hashtextextended($1, 0))', [
35
+ `platform-account-reset:${operationId}`,
36
+ ]);
37
+ const operation = await connection.query(`SELECT lifecycle, release_sha, rollout_generation::text, workos_realm,
38
+ source_epoch::text, preview_checksum, target_set_fingerprint,
39
+ approved_target_set_fingerprint, request_fingerprint, safe_result,
40
+ preview_expires_at, quarantined_at,
41
+ finalize_after, quarantine_idempotency_key_hash,
42
+ quarantine_request_fingerprint, quarantine_reason_fingerprint,
43
+ quarantine_actor_fingerprint, quarantine_safe_result,
44
+ rollback_idempotency_key_hash,
45
+ rollback_request_fingerprint, rollback_reason_fingerprint,
46
+ rollback_actor_fingerprint, rollback_safe_result
47
+ FROM platform_account_reset_operations
48
+ WHERE operation_id = $1
49
+ FOR UPDATE`, [operationId]);
50
+ const row = operation.rows[0];
51
+ if (row === undefined)
52
+ throw new PlatformAccountResetPreviewError('operation_conflict');
53
+ return row;
54
+ }
55
+ export function assertPlatformAccountResetApprovedTargetSet(operation, approvedTargetSetFingerprint) {
56
+ if (operation.approved_target_set_fingerprint !== approvedTargetSetFingerprint)
57
+ throw new PlatformAccountResetPreviewError('operation_conflict');
58
+ }
59
+ export async function loadPlatformAccountResetTargets(connection, operationId, lifecycle) {
60
+ const result = await connection.query(`SELECT principal_id
61
+ FROM platform_account_reset_targets
62
+ WHERE operation_id = $1 AND lifecycle = $2
63
+ ORDER BY principal_id
64
+ FOR UPDATE`, [operationId, lifecycle]);
65
+ if (result.rows.length !== 3)
66
+ throw new PlatformAccountResetPreviewError('target_count_invalid');
67
+ return result.rows.map((row) => row.principal_id);
68
+ }
69
+ export async function loadPlatformAccountResetFrozenResources(connection, operationId) {
70
+ const result = await connection.query(`SELECT provider, resource_kind, provider_locator, locator_fingerprint
71
+ FROM platform_account_reset_cleanup_ledger
72
+ WHERE operation_id = $1
73
+ ORDER BY provider, resource_kind, locator_fingerprint
74
+ FOR SHARE`, [operationId]);
75
+ const apps = new Map();
76
+ const deploymentIds = new Set();
77
+ for (const row of result.rows) {
78
+ let locator;
79
+ try {
80
+ locator = JSON.parse(row.provider_locator);
81
+ }
82
+ catch {
83
+ throw new PlatformAccountResetPreviewError('operation_conflict');
84
+ }
85
+ if (!isRecord(locator))
86
+ throw new PlatformAccountResetPreviewError('operation_conflict');
87
+ const actual = sha256Canonical({
88
+ schemaVersion: 1,
89
+ label: `platform_account_reset_locator:${row.provider}:${row.resource_kind}`,
90
+ locator,
91
+ });
92
+ if (actual !== row.locator_fingerprint)
93
+ throw new PlatformAccountResetPreviewError('operation_conflict');
94
+ if (row.provider !== 'postgres')
95
+ continue;
96
+ if (row.resource_kind === 'application') {
97
+ const org = locator.org;
98
+ const app = locator.app;
99
+ if (typeof org !== 'string' || typeof app !== 'string')
100
+ throw new PlatformAccountResetPreviewError('operation_conflict');
101
+ apps.set(`${org}\u0000${app}`, { org, app });
102
+ }
103
+ if (row.resource_kind === 'deployment') {
104
+ const deploymentId = locator.deploymentId;
105
+ if (typeof deploymentId !== 'string' || typeof locator.archived !== 'boolean')
106
+ throw new PlatformAccountResetPreviewError('operation_conflict');
107
+ if (!locator.archived)
108
+ deploymentIds.add(deploymentId);
109
+ }
110
+ }
111
+ return {
112
+ apps: [...apps.values()].sort((left, right) => `${left.org}/${left.app}`.localeCompare(`${right.org}/${right.app}`)),
113
+ deploymentIds: [...deploymentIds].sort(),
114
+ resourceCount: result.rows.length,
115
+ };
116
+ }
117
+ export function parsePlatformAccountResetSafeResult(value) {
118
+ const parsed = PlatformAccountResetResultSchema.safeParse(value);
119
+ if (!parsed.success)
120
+ throw new PlatformAccountResetPreviewError('operation_conflict');
121
+ return parsed.data;
122
+ }
123
+ export function assertPlatformAccountResetRequestMatches(operation, request, options) {
124
+ if (request.releaseSha !== options.releaseSha || operation.release_sha !== request.releaseSha)
125
+ throw new PlatformAccountResetPreviewError('release_mismatch');
126
+ if (Number(operation.rollout_generation) !== request.expectedGeneration)
127
+ throw new PlatformAccountResetPreviewError('generation_mismatch');
128
+ if (operation.preview_checksum !== request.previewChecksum)
129
+ throw new PlatformAccountResetPreviewError('operation_conflict');
130
+ if (operation.workos_realm !== options.workosRealm)
131
+ throw new PlatformAccountResetPreviewError('operation_conflict');
132
+ }
133
+ export function assertPlatformAccountResetActionReplay(evidence, stored) {
134
+ if (stored.actorFingerprint !== evidence.actorFingerprint ||
135
+ stored.idempotencyKeyHash !== evidence.idempotencyKeyHash ||
136
+ stored.requestFingerprint !== evidence.requestFingerprint ||
137
+ stored.reasonFingerprint !== evidence.reasonFingerprint)
138
+ throw new PlatformAccountResetPreviewError('operation_conflict');
139
+ return parsePlatformAccountResetSafeResult(stored.safeResult);
140
+ }
141
+ function isRecord(value) {
142
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
143
+ }
144
+ //# sourceMappingURL=platform-account-reset-operation-postgres.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-account-reset-operation-postgres.js","sourceRoot":"","sources":["../src/platform-account-reset-operation-postgres.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,gCAAgC,GACjC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAE,gCAAgC,EAAE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AM,CAAC,kBAAkB,KAAK,QAAQ,CAAC,kBAAkB;QACzD,MAAM,CAAC,kBAAkB,KAAK,QAAQ,CAAC,kBAAkB;QACzD,MAAM,CAAC,iBAAiB,KAAK,QAAQ,CAAC,iBAAiB;QAEvD,MAAM,IAAI,gCAAgC,CAAC,oBAAoB,CAAC,CAAC;IACnE,OAAO,mCAAmC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AAChE,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { type PlatformAccountResetExecuteRequest, type PlatformAccountResetOperatorPreviewRequest, type PlatformAccountResetPreviewRequest, type PlatformAccountResetResult, type PlatformAccountResetRollbackPreviewRequest, type PlatformAccountResetStatusRequest } from './platform-account-reset.js';
2
+ import type { PlatformAccountResetMutationOutcome, PlatformAccountResetRegistryPlan } from './platform-account-reset-operation-postgres.js';
3
+ import type { PlatformAccountResetOperatorPort } from './platform-account-reset-ports.js';
4
+ import type { PlatformIdentityQueryable } from './platform-identity-postgres.js';
5
+ interface PlatformAccountResetOperatorOptions {
6
+ readonly preview: {
7
+ preview(input: PlatformAccountResetPreviewRequest): Promise<PlatformAccountResetResult>;
8
+ };
9
+ readonly rollbackPreview: {
10
+ preview(input: PlatformAccountResetRollbackPreviewRequest): Promise<PlatformAccountResetResult>;
11
+ };
12
+ readonly quarantine: {
13
+ apply(input: PlatformAccountResetExecuteRequest): Promise<PlatformAccountResetMutationOutcome>;
14
+ };
15
+ readonly rollback: {
16
+ apply(input: PlatformAccountResetExecuteRequest): Promise<PlatformAccountResetMutationOutcome>;
17
+ };
18
+ readonly statusStore: PlatformIdentityQueryable;
19
+ readonly reconcileRegistry?: (input: PlatformAccountResetRegistryPlan) => void | Promise<void>;
20
+ }
21
+ export declare class PlatformAccountResetOperator implements PlatformAccountResetOperatorPort {
22
+ #private;
23
+ constructor(options: PlatformAccountResetOperatorOptions);
24
+ preview(rawInput: PlatformAccountResetOperatorPreviewRequest): Promise<PlatformAccountResetResult>;
25
+ execute(rawInput: PlatformAccountResetExecuteRequest): Promise<PlatformAccountResetResult>;
26
+ status(rawInput: PlatformAccountResetStatusRequest): Promise<PlatformAccountResetResult | undefined>;
27
+ }
28
+ export {};
29
+ //# sourceMappingURL=platform-account-reset-operator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-account-reset-operator.d.ts","sourceRoot":"","sources":["../src/platform-account-reset-operator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kCAAkC,EAEvC,KAAK,0CAA0C,EAE/C,KAAK,kCAAkC,EACvC,KAAK,0BAA0B,EAE/B,KAAK,0CAA0C,EAC/C,KAAK,iCAAiC,EAEvC,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EACV,mCAAmC,EACnC,gCAAgC,EACjC,MAAM,gDAAgD,CAAC;AACxD,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,mCAAmC,CAAC;AAE1F,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAEjF,UAAU,mCAAmC;IAC3C,QAAQ,CAAC,OAAO,EAAE;QAChB,OAAO,CAAC,KAAK,EAAE,kCAAkC,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;KACzF,CAAC;IACF,QAAQ,CAAC,eAAe,EAAE;QACxB,OAAO,CAAC,KAAK,EAAE,0CAA0C,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;KACjG,CAAC;IACF,QAAQ,CAAC,UAAU,EAAE;QACnB,KAAK,CAAC,KAAK,EAAE,kCAAkC,GAAG,OAAO,CAAC,mCAAmC,CAAC,CAAC;KAChG,CAAC;IACF,QAAQ,CAAC,QAAQ,EAAE;QACjB,KAAK,CAAC,KAAK,EAAE,kCAAkC,GAAG,OAAO,CAAC,mCAAmC,CAAC,CAAC;KAChG,CAAC;IACF,QAAQ,CAAC,WAAW,EAAE,yBAAyB,CAAC;IAChD,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,gCAAgC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChG;AAUD,qBAAa,4BAA6B,YAAW,gCAAgC;;gBAGvE,OAAO,EAAE,mCAAmC;IAIxD,OAAO,CACL,QAAQ,EAAE,0CAA0C,GACnD,OAAO,CAAC,0BAA0B,CAAC;IAMhC,OAAO,CAAC,QAAQ,EAAE,kCAAkC,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAU1F,MAAM,CACV,QAAQ,EAAE,iCAAiC,GAC1C,OAAO,CAAC,0BAA0B,GAAG,SAAS,CAAC;CA8BnD"}
@@ -0,0 +1,59 @@
1
+ import { PlatformAccountResetExecuteRequestSchema, PlatformAccountResetOperatorPreviewRequestSchema, PlatformAccountResetResultSchema, PlatformAccountResetStatusRequestSchema, } from './platform-account-reset.js';
2
+ import { PlatformAccountResetPreviewError } from './platform-account-reset-preview-result.js';
3
+ export class PlatformAccountResetOperator {
4
+ #options;
5
+ constructor(options) {
6
+ this.#options = options;
7
+ }
8
+ preview(rawInput) {
9
+ const input = PlatformAccountResetOperatorPreviewRequestSchema.parse(rawInput);
10
+ if ('operation' in input)
11
+ return this.#options.rollbackPreview.preview(input);
12
+ return this.#options.preview.preview(input);
13
+ }
14
+ async execute(rawInput) {
15
+ const input = PlatformAccountResetExecuteRequestSchema.parse(rawInput);
16
+ let outcome;
17
+ if (input.action === 'quarantine')
18
+ outcome = await this.#options.quarantine.apply(input);
19
+ else if (input.action === 'rollback')
20
+ outcome = await this.#options.rollback.apply(input);
21
+ else
22
+ throw new PlatformAccountResetPreviewError('operation_conflict');
23
+ await this.#options.reconcileRegistry?.(outcome.registry);
24
+ return outcome.result;
25
+ }
26
+ async status(rawInput) {
27
+ const input = PlatformAccountResetStatusRequestSchema.parse(rawInput);
28
+ const status = await this.#options.statusStore.query(`SELECT operation.lifecycle, operation.safe_result,
29
+ operation.quarantine_safe_result, operation.rollback_safe_result,
30
+ count(*) FILTER (
31
+ WHERE cleanup.state IN ('pending', 'leased', 'failed')
32
+ )::int AS cleanup_pending_count
33
+ FROM platform_account_reset_operations operation
34
+ LEFT JOIN platform_account_reset_cleanup_ledger cleanup
35
+ ON cleanup.operation_id = operation.operation_id
36
+ WHERE operation.operation_id = $1
37
+ GROUP BY operation.operation_id`, [input.operationId]);
38
+ const row = status.rows[0];
39
+ if (row === undefined)
40
+ return undefined;
41
+ const value = row.rollback_safe_result ?? row.quarantine_safe_result ?? row.safe_result;
42
+ const result = PlatformAccountResetResultSchema.safeParse(value);
43
+ if (!result.success)
44
+ throw new PlatformAccountResetPreviewError('operation_conflict');
45
+ return {
46
+ ...result.data,
47
+ lifecycle: row.lifecycle,
48
+ counts: {
49
+ ...result.data.counts,
50
+ suspendedPrincipalCount: isSuspendedLifecycle(row.lifecycle) ? 3 : 0,
51
+ cleanupPendingCount: row.cleanup_pending_count,
52
+ },
53
+ };
54
+ }
55
+ }
56
+ function isSuspendedLifecycle(lifecycle) {
57
+ return ['quarantined', 'finalizing', 'finalization_blocked'].includes(lifecycle);
58
+ }
59
+ //# sourceMappingURL=platform-account-reset-operator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-account-reset-operator.js","sourceRoot":"","sources":["../src/platform-account-reset-operator.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,wCAAwC,EAExC,gDAAgD,EAGhD,gCAAgC,EAGhC,uCAAuC,GACxC,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAAE,gCAAgC,EAAE,MAAM,4CAA4C,CAAC;AA4B9F,MAAM,OAAO,4BAA4B;IAC9B,QAAQ,CAAsC;IAEvD,YAAY,OAA4C;QACtD,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAED,OAAO,CACL,QAAoD;QA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AC;QACxC,MAAM,KAAK,GAAG,GAAG,CAAC,oBAAoB,IAAI,GAAG,CAAC,sBAAsB,IAAI,GAAG,CAAC,WAAW,CAAC;QACxF,MAAM,MAAM,GAAG,gCAAgC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACjE,IAAI,CAAC,MAAM,CAAC,OAAO;YAAE,MAAM,IAAI,gCAAgC,CAAC,oBAAoB,CAAC,CAAC;QACtF,OAAO;YACL,GAAG,MAAM,CAAC,IAAI;YACd,SAAS,EAAE,GAAG,CAAC,SAAS;YACxB,MAAM,EAAE;gBACN,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM;gBACrB,uBAAuB,EAAE,oBAAoB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACpE,mBAAmB,EAAE,GAAG,CAAC,qBAAqB;aAC/C;SACF,CAAC;IACJ,CAAC;CACF;AAED,SAAS,oBAAoB,CAAC,SAAkD;IAC9E,OAAO,CAAC,aAAa,EAAE,YAAY,EAAE,sBAAsB,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AACnF,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { PlatformIdentityQueryable } from './platform-identity-postgres.js';
2
+ export declare function platformAccountResetAppKey(row: {
3
+ readonly org_slug: string;
4
+ readonly app_slug?: string;
5
+ readonly slug?: string;
6
+ }): string;
7
+ export declare function groupPlatformAccountResetRows<T>(values: readonly T[], key: (value: T) => string): Map<string, T[]>;
8
+ export declare function incrementPlatformAccountResetCount<T>(counts: Map<T, number>, key: T): void;
9
+ export declare function comparePlatformAccountResetText(left: string, right: string): number;
10
+ export declare function queryPlatformAccountResetRows<T>(pool: PlatformIdentityQueryable, sql: string, values?: readonly unknown[]): Promise<readonly T[]>;
11
+ //# sourceMappingURL=platform-account-reset-ownership-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-account-reset-ownership-helpers.d.ts","sourceRoot":"","sources":["../src/platform-account-reset-ownership-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAEjF,wBAAgB,0BAA0B,CAAC,GAAG,EAAE;IAC9C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB,GAAG,MAAM,CAET;AAED,wBAAgB,6BAA6B,CAAC,CAAC,EAC7C,MAAM,EAAE,SAAS,CAAC,EAAE,EACpB,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,MAAM,GACxB,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAQlB;AAED,wBAAgB,kCAAkC,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,IAAI,CAE1F;AAED,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEnF;AAED,wBAAsB,6BAA6B,CAAC,CAAC,EACnD,IAAI,EAAE,yBAAyB,EAC/B,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,SAAS,OAAO,EAAE,GAC1B,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAEvB"}
@@ -0,0 +1,22 @@
1
+ export function platformAccountResetAppKey(row) {
2
+ return `${row.org_slug}\0${row.app_slug ?? row.slug ?? ''}`;
3
+ }
4
+ export function groupPlatformAccountResetRows(values, key) {
5
+ const grouped = new Map();
6
+ for (const value of values) {
7
+ const bucket = grouped.get(key(value)) ?? [];
8
+ bucket.push(value);
9
+ grouped.set(key(value), bucket);
10
+ }
11
+ return grouped;
12
+ }
13
+ export function incrementPlatformAccountResetCount(counts, key) {
14
+ counts.set(key, (counts.get(key) ?? 0) + 1);
15
+ }
16
+ export function comparePlatformAccountResetText(left, right) {
17
+ return left < right ? -1 : left > right ? 1 : 0;
18
+ }
19
+ export async function queryPlatformAccountResetRows(pool, sql, values) {
20
+ return (await pool.query(sql, values)).rows;
21
+ }
22
+ //# sourceMappingURL=platform-account-reset-ownership-helpers.js.map