@noodleseed/one 0.82.0 → 0.84.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) 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/catalog-data-platform-auth.d.ts.map +1 -1
  5. package/dist/commands/catalog-data-platform-auth.js +70 -2
  6. package/dist/commands/catalog-data-platform-auth.js.map +1 -1
  7. package/dist/commands/platform-account-reset-args.d.ts +40 -0
  8. package/dist/commands/platform-account-reset-args.d.ts.map +1 -0
  9. package/dist/commands/platform-account-reset-args.js +181 -0
  10. package/dist/commands/platform-account-reset-args.js.map +1 -0
  11. package/dist/commands/platform-account-reset-files.d.ts +9 -0
  12. package/dist/commands/platform-account-reset-files.d.ts.map +1 -0
  13. package/dist/commands/platform-account-reset-files.js +45 -0
  14. package/dist/commands/platform-account-reset-files.js.map +1 -0
  15. package/dist/commands/platform-account-reset-ops.d.ts +3 -0
  16. package/dist/commands/platform-account-reset-ops.d.ts.map +1 -0
  17. package/dist/commands/platform-account-reset-ops.js +162 -0
  18. package/dist/commands/platform-account-reset-ops.js.map +1 -0
  19. package/node_modules/@noodle-borg/agent-kit/dist/generated/example-files.js +1 -1
  20. package/node_modules/@noodle-borg/agent-kit/dist/generated/example-files.js.map +1 -1
  21. package/node_modules/@noodle-borg/agent-kit/dist/skill-embedded-assistant-ref.d.ts.map +1 -1
  22. package/node_modules/@noodle-borg/agent-kit/dist/skill-embedded-assistant-ref.js +39 -3
  23. package/node_modules/@noodle-borg/agent-kit/dist/skill-embedded-assistant-ref.js.map +1 -1
  24. package/node_modules/@noodle-borg/agent-kit/package.json +1 -1
  25. package/node_modules/@noodle-borg/service/dist/assistant-interactive.d.ts +1 -0
  26. package/node_modules/@noodle-borg/service/dist/assistant-interactive.d.ts.map +1 -1
  27. package/node_modules/@noodle-borg/service/dist/assistant-interactive.js +1 -0
  28. package/node_modules/@noodle-borg/service/dist/assistant-interactive.js.map +1 -1
  29. package/node_modules/@noodle-borg/service/dist/billing/enforcement-activation.d.ts +4 -4
  30. package/node_modules/@noodle-borg/service/dist/billing/read-contract.d.ts +6 -6
  31. package/node_modules/@noodle-borg/service/dist/index.d.ts +4 -1
  32. package/node_modules/@noodle-borg/service/dist/index.d.ts.map +1 -1
  33. package/node_modules/@noodle-borg/service/dist/index.js +2 -0
  34. package/node_modules/@noodle-borg/service/dist/index.js.map +1 -1
  35. package/node_modules/@noodle-borg/service/dist/main.js +5 -0
  36. package/node_modules/@noodle-borg/service/dist/main.js.map +1 -1
  37. package/node_modules/@noodle-borg/service/dist/oauth/developer-grant-flow.d.ts.map +1 -1
  38. package/node_modules/@noodle-borg/service/dist/oauth/developer-grant-flow.js +1 -0
  39. package/node_modules/@noodle-borg/service/dist/oauth/developer-grant-flow.js.map +1 -1
  40. package/node_modules/@noodle-borg/service/dist/oauth/provider.d.ts.map +1 -1
  41. package/node_modules/@noodle-borg/service/dist/oauth/provider.js +1 -0
  42. package/node_modules/@noodle-borg/service/dist/oauth/provider.js.map +1 -1
  43. package/node_modules/@noodle-borg/service/dist/oauth/store-postgres-schema.d.ts.map +1 -1
  44. package/node_modules/@noodle-borg/service/dist/oauth/store-postgres-schema.js +17 -0
  45. package/node_modules/@noodle-borg/service/dist/oauth/store-postgres-schema.js.map +1 -1
  46. package/node_modules/@noodle-borg/service/dist/oauth/store-postgres.d.ts +2 -2
  47. package/node_modules/@noodle-borg/service/dist/oauth/store-postgres.d.ts.map +1 -1
  48. package/node_modules/@noodle-borg/service/dist/oauth/store-postgres.js +25 -5
  49. package/node_modules/@noodle-borg/service/dist/oauth/store-postgres.js.map +1 -1
  50. package/node_modules/@noodle-borg/service/dist/oauth/store.d.ts +5 -3
  51. package/node_modules/@noodle-borg/service/dist/oauth/store.d.ts.map +1 -1
  52. package/node_modules/@noodle-borg/service/dist/oauth/store.js +5 -5
  53. package/node_modules/@noodle-borg/service/dist/oauth/store.js.map +1 -1
  54. package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-handler.d.ts.map +1 -1
  55. package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-handler.js +7 -2
  56. package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-handler.js.map +1 -1
  57. package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-support.d.ts +1 -1
  58. package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-support.d.ts.map +1 -1
  59. package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-support.js.map +1 -1
  60. package/node_modules/@noodle-borg/service/dist/oauth/upstream-consent.d.ts.map +1 -1
  61. package/node_modules/@noodle-borg/service/dist/oauth/upstream-consent.js +1 -1
  62. package/node_modules/@noodle-borg/service/dist/oauth/upstream-consent.js.map +1 -1
  63. package/node_modules/@noodle-borg/service/dist/oauth/upstream-federation.d.ts.map +1 -1
  64. package/node_modules/@noodle-borg/service/dist/oauth/upstream-federation.js +6 -1
  65. package/node_modules/@noodle-borg/service/dist/oauth/upstream-federation.js.map +1 -1
  66. package/node_modules/@noodle-borg/service/dist/options.d.ts +13 -0
  67. package/node_modules/@noodle-borg/service/dist/options.d.ts.map +1 -1
  68. package/node_modules/@noodle-borg/service/dist/platform-account-reset-config.d.ts +9 -0
  69. package/node_modules/@noodle-borg/service/dist/platform-account-reset-config.d.ts.map +1 -0
  70. package/node_modules/@noodle-borg/service/dist/platform-account-reset-config.js +24 -0
  71. package/node_modules/@noodle-borg/service/dist/platform-account-reset-config.js.map +1 -0
  72. package/node_modules/@noodle-borg/service/dist/platform-account-reset-dispatch-lock-postgres.d.ts +12 -0
  73. package/node_modules/@noodle-borg/service/dist/platform-account-reset-dispatch-lock-postgres.d.ts.map +1 -0
  74. package/node_modules/@noodle-borg/service/dist/platform-account-reset-dispatch-lock-postgres.js +110 -0
  75. package/node_modules/@noodle-borg/service/dist/platform-account-reset-dispatch-lock-postgres.js.map +1 -0
  76. package/node_modules/@noodle-borg/service/dist/platform-account-reset-fingerprint.d.ts +9 -0
  77. package/node_modules/@noodle-borg/service/dist/platform-account-reset-fingerprint.d.ts.map +1 -0
  78. package/node_modules/@noodle-borg/service/dist/platform-account-reset-fingerprint.js +46 -0
  79. package/node_modules/@noodle-borg/service/dist/platform-account-reset-fingerprint.js.map +1 -0
  80. package/node_modules/@noodle-borg/service/dist/platform-account-reset-operation-postgres.d.ts +77 -0
  81. package/node_modules/@noodle-borg/service/dist/platform-account-reset-operation-postgres.d.ts.map +1 -0
  82. package/node_modules/@noodle-borg/service/dist/platform-account-reset-operation-postgres.js +144 -0
  83. package/node_modules/@noodle-borg/service/dist/platform-account-reset-operation-postgres.js.map +1 -0
  84. package/node_modules/@noodle-borg/service/dist/platform-account-reset-operator.d.ts +29 -0
  85. package/node_modules/@noodle-borg/service/dist/platform-account-reset-operator.d.ts.map +1 -0
  86. package/node_modules/@noodle-borg/service/dist/platform-account-reset-operator.js +59 -0
  87. package/node_modules/@noodle-borg/service/dist/platform-account-reset-operator.js.map +1 -0
  88. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-helpers.d.ts +11 -0
  89. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-helpers.d.ts.map +1 -0
  90. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-helpers.js +22 -0
  91. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-helpers.js.map +1 -0
  92. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-postgres.d.ts +41 -0
  93. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-postgres.d.ts.map +1 -0
  94. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-postgres.js +314 -0
  95. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-postgres.js.map +1 -0
  96. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-resources-postgres.d.ts +14 -0
  97. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-resources-postgres.d.ts.map +1 -0
  98. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-resources-postgres.js +210 -0
  99. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-resources-postgres.js.map +1 -0
  100. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-rollback-postgres.d.ts +11 -0
  101. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-rollback-postgres.d.ts.map +1 -0
  102. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-rollback-postgres.js +71 -0
  103. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-rollback-postgres.js.map +1 -0
  104. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ports.d.ts +12 -0
  105. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ports.d.ts.map +1 -0
  106. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ports.js +2 -0
  107. package/node_modules/@noodle-borg/service/dist/platform-account-reset-ports.js.map +1 -0
  108. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-evidence-postgres.d.ts +22 -0
  109. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-evidence-postgres.d.ts.map +1 -0
  110. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-evidence-postgres.js +177 -0
  111. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-evidence-postgres.js.map +1 -0
  112. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-local-postgres.d.ts +35 -0
  113. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-local-postgres.d.ts.map +1 -0
  114. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-local-postgres.js +184 -0
  115. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-local-postgres.js.map +1 -0
  116. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-persistence-postgres.d.ts +11 -0
  117. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-persistence-postgres.d.ts.map +1 -0
  118. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-persistence-postgres.js +120 -0
  119. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-persistence-postgres.js.map +1 -0
  120. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-postgres.d.ts +79 -0
  121. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-postgres.d.ts.map +1 -0
  122. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-postgres.js +286 -0
  123. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-postgres.js.map +1 -0
  124. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-result.d.ts +21 -0
  125. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-result.d.ts.map +1 -0
  126. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-result.js +81 -0
  127. package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-result.js.map +1 -0
  128. package/node_modules/@noodle-borg/service/dist/platform-account-reset-quarantine-postgres.d.ts +46 -0
  129. package/node_modules/@noodle-borg/service/dist/platform-account-reset-quarantine-postgres.d.ts.map +1 -0
  130. package/node_modules/@noodle-borg/service/dist/platform-account-reset-quarantine-postgres.js +283 -0
  131. package/node_modules/@noodle-borg/service/dist/platform-account-reset-quarantine-postgres.js.map +1 -0
  132. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-eligibility-postgres.d.ts +13 -0
  133. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-eligibility-postgres.d.ts.map +1 -0
  134. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-eligibility-postgres.js +81 -0
  135. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-eligibility-postgres.js.map +1 -0
  136. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-local-postgres.d.ts +30 -0
  137. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-local-postgres.d.ts.map +1 -0
  138. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-local-postgres.js +248 -0
  139. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-local-postgres.js.map +1 -0
  140. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-postgres.d.ts +29 -0
  141. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-postgres.d.ts.map +1 -0
  142. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-postgres.js +281 -0
  143. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-postgres.js.map +1 -0
  144. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-preview-postgres.d.ts +55 -0
  145. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-preview-postgres.d.ts.map +1 -0
  146. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-preview-postgres.js +262 -0
  147. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-preview-postgres.js.map +1 -0
  148. package/node_modules/@noodle-borg/service/dist/platform-account-reset-schema-postgres.d.ts +7 -0
  149. package/node_modules/@noodle-borg/service/dist/platform-account-reset-schema-postgres.d.ts.map +1 -0
  150. package/node_modules/@noodle-borg/service/dist/platform-account-reset-schema-postgres.js +439 -0
  151. package/node_modules/@noodle-borg/service/dist/platform-account-reset-schema-postgres.js.map +1 -0
  152. package/node_modules/@noodle-borg/service/dist/platform-account-reset.d.ts +276 -0
  153. package/node_modules/@noodle-borg/service/dist/platform-account-reset.d.ts.map +1 -0
  154. package/node_modules/@noodle-borg/service/dist/platform-account-reset.js +141 -0
  155. package/node_modules/@noodle-borg/service/dist/platform-account-reset.js.map +1 -0
  156. package/node_modules/@noodle-borg/service/dist/platform-auth-configuration.d.ts +1 -1
  157. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-legacy-sources-postgres.d.ts.map +1 -1
  158. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-legacy-sources-postgres.js +5 -1
  159. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-legacy-sources-postgres.js.map +1 -1
  160. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-local-subjects-postgres.d.ts.map +1 -1
  161. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-local-subjects-postgres.js +10 -1
  162. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-local-subjects-postgres.js.map +1 -1
  163. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-postgres.d.ts +5 -10
  164. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-postgres.d.ts.map +1 -1
  165. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-postgres.js +86 -47
  166. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-postgres.js.map +1 -1
  167. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-transaction-postgres.d.ts +17 -0
  168. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-transaction-postgres.d.ts.map +1 -0
  169. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-transaction-postgres.js +240 -0
  170. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-transaction-postgres.js.map +1 -0
  171. package/node_modules/@noodle-borg/service/dist/platform-auth-operator.d.ts +63 -63
  172. package/node_modules/@noodle-borg/service/dist/platform-auth-rollout-support.d.ts +1 -1
  173. package/node_modules/@noodle-borg/service/dist/platform-auth-runtime.d.ts +18 -1
  174. package/node_modules/@noodle-borg/service/dist/platform-auth-runtime.d.ts.map +1 -1
  175. package/node_modules/@noodle-borg/service/dist/platform-auth-runtime.js +97 -2
  176. package/node_modules/@noodle-borg/service/dist/platform-auth-runtime.js.map +1 -1
  177. package/node_modules/@noodle-borg/service/dist/platform-auth-service-bootstrap.d.ts +4 -1
  178. package/node_modules/@noodle-borg/service/dist/platform-auth-service-bootstrap.d.ts.map +1 -1
  179. package/node_modules/@noodle-borg/service/dist/platform-auth-service-bootstrap.js +4 -0
  180. package/node_modules/@noodle-borg/service/dist/platform-auth-service-bootstrap.js.map +1 -1
  181. package/node_modules/@noodle-borg/service/dist/platform-identity-postgres.d.ts +7 -2
  182. package/node_modules/@noodle-borg/service/dist/platform-identity-postgres.d.ts.map +1 -1
  183. package/node_modules/@noodle-borg/service/dist/platform-identity-postgres.js +24 -2
  184. package/node_modules/@noodle-borg/service/dist/platform-identity-postgres.js.map +1 -1
  185. package/node_modules/@noodle-borg/service/dist/platform-identity-schema-postgres.d.ts.map +1 -1
  186. package/node_modules/@noodle-borg/service/dist/platform-identity-schema-postgres.js +4 -0
  187. package/node_modules/@noodle-borg/service/dist/platform-identity-schema-postgres.js.map +1 -1
  188. package/node_modules/@noodle-borg/service/dist/platform-identity-sync-postgres.d.ts +7 -1
  189. package/node_modules/@noodle-borg/service/dist/platform-identity-sync-postgres.d.ts.map +1 -1
  190. package/node_modules/@noodle-borg/service/dist/platform-identity-sync-postgres.js +121 -8
  191. package/node_modules/@noodle-borg/service/dist/platform-identity-sync-postgres.js.map +1 -1
  192. package/node_modules/@noodle-borg/service/dist/platform-identity-sync-recovery-postgres.d.ts.map +1 -1
  193. package/node_modules/@noodle-borg/service/dist/platform-identity-sync-recovery-postgres.js +11 -1
  194. package/node_modules/@noodle-borg/service/dist/platform-identity-sync-recovery-postgres.js.map +1 -1
  195. package/node_modules/@noodle-borg/service/dist/platform-identity-sync.d.ts +5 -3
  196. package/node_modules/@noodle-borg/service/dist/platform-identity-sync.d.ts.map +1 -1
  197. package/node_modules/@noodle-borg/service/dist/platform-identity-sync.js +15 -1
  198. package/node_modules/@noodle-borg/service/dist/platform-identity-sync.js.map +1 -1
  199. package/node_modules/@noodle-borg/service/dist/platform-identity.d.ts +23 -2
  200. package/node_modules/@noodle-borg/service/dist/platform-identity.d.ts.map +1 -1
  201. package/node_modules/@noodle-borg/service/dist/platform-identity.js +21 -0
  202. package/node_modules/@noodle-borg/service/dist/platform-identity.js.map +1 -1
  203. package/node_modules/@noodle-borg/service/dist/registry-state.d.ts +8 -0
  204. package/node_modules/@noodle-borg/service/dist/registry-state.d.ts.map +1 -1
  205. package/node_modules/@noodle-borg/service/dist/registry-state.js +15 -2
  206. package/node_modules/@noodle-borg/service/dist/registry-state.js.map +1 -1
  207. package/node_modules/@noodle-borg/service/dist/registry.d.ts +2 -0
  208. package/node_modules/@noodle-borg/service/dist/registry.d.ts.map +1 -1
  209. package/node_modules/@noodle-borg/service/dist/registry.js +4 -1
  210. package/node_modules/@noodle-borg/service/dist/registry.js.map +1 -1
  211. package/node_modules/@noodle-borg/service/dist/routes/assistant-agent.d.ts +1 -1
  212. package/node_modules/@noodle-borg/service/dist/routes/assistant-agent.d.ts.map +1 -1
  213. package/node_modules/@noodle-borg/service/dist/routes/assistant-agent.js +1 -0
  214. package/node_modules/@noodle-borg/service/dist/routes/assistant-agent.js.map +1 -1
  215. package/node_modules/@noodle-borg/service/dist/routes/platform-account-reset-dispatch.d.ts +8 -0
  216. package/node_modules/@noodle-borg/service/dist/routes/platform-account-reset-dispatch.d.ts.map +1 -0
  217. package/node_modules/@noodle-borg/service/dist/routes/platform-account-reset-dispatch.js +36 -0
  218. package/node_modules/@noodle-borg/service/dist/routes/platform-account-reset-dispatch.js.map +1 -0
  219. package/node_modules/@noodle-borg/service/dist/routes/platform-account-reset.d.ts +22 -0
  220. package/node_modules/@noodle-borg/service/dist/routes/platform-account-reset.d.ts.map +1 -0
  221. package/node_modules/@noodle-borg/service/dist/routes/platform-account-reset.js +201 -0
  222. package/node_modules/@noodle-borg/service/dist/routes/platform-account-reset.js.map +1 -0
  223. package/node_modules/@noodle-borg/service/dist/routes/private-platform-auth-dispatch.d.ts +18 -0
  224. package/node_modules/@noodle-borg/service/dist/routes/private-platform-auth-dispatch.d.ts.map +1 -0
  225. package/node_modules/@noodle-borg/service/dist/routes/private-platform-auth-dispatch.js +36 -0
  226. package/node_modules/@noodle-borg/service/dist/routes/private-platform-auth-dispatch.js.map +1 -0
  227. package/node_modules/@noodle-borg/service/dist/serve-options.d.ts +2 -1
  228. package/node_modules/@noodle-borg/service/dist/serve-options.d.ts.map +1 -1
  229. package/node_modules/@noodle-borg/service/dist/serve.d.ts.map +1 -1
  230. package/node_modules/@noodle-borg/service/dist/serve.js +16 -1
  231. package/node_modules/@noodle-borg/service/dist/serve.js.map +1 -1
  232. package/node_modules/@noodle-borg/service/dist/service.d.ts.map +1 -1
  233. package/node_modules/@noodle-borg/service/dist/service.js +4 -5
  234. package/node_modules/@noodle-borg/service/dist/service.js.map +1 -1
  235. package/node_modules/@noodle-borg/service/dist/workos-directory.d.ts +22 -3
  236. package/node_modules/@noodle-borg/service/dist/workos-directory.d.ts.map +1 -1
  237. package/node_modules/@noodle-borg/service/dist/workos-directory.js +56 -5
  238. package/node_modules/@noodle-borg/service/dist/workos-directory.js.map +1 -1
  239. package/node_modules/@noodle-borg/wire-contracts/dist/assistant.d.ts +7 -0
  240. package/node_modules/@noodle-borg/wire-contracts/dist/assistant.d.ts.map +1 -1
  241. package/node_modules/@noodle-borg/wire-contracts/dist/assistant.js +5 -0
  242. package/node_modules/@noodle-borg/wire-contracts/dist/assistant.js.map +1 -1
  243. package/package.json +1 -1
@@ -0,0 +1,71 @@
1
+ import { canonicalJson } from './platform-account-reset-fingerprint.js';
2
+ /**
3
+ * Reintroduces only exact frozen owner-only app locators into rollback discovery. The current row must
4
+ * still carry this operation's quarantine archive stamp; broader archived deployment scans are forbidden.
5
+ */
6
+ export async function loadPlatformAccountResetFrozenOwnerOnlyApps(pool, operationId, targetPrincipalIds, cleanupResources) {
7
+ const applications = new Set(cleanupResources
8
+ .filter((resource) => resource.provider === 'postgres' && resource.resourceKind === 'application')
9
+ .map((resource) => frozenApplication(resource.locator))
10
+ .filter((application) => application !== undefined)
11
+ .map(applicationKey));
12
+ const deployments = cleanupResources
13
+ .filter((resource) => resource.provider === 'postgres' && resource.resourceKind === 'deployment')
14
+ .map((resource) => frozenDeployment(resource.locator))
15
+ .filter((deployment) => deployment !== undefined && applications.has(applicationKey(deployment)));
16
+ if (deployments.length === 0)
17
+ return [];
18
+ const stored = await pool.query(`SELECT deployment.deployment_id, deployment.org_slug, deployment.app_slug,
19
+ deployment.environment, deployment.active, deployment.access_mode,
20
+ deployment.created_by_subject,
21
+ deployment.archived_at = operation.quarantined_at AS operation_archived
22
+ FROM deploy_records deployment
23
+ JOIN platform_account_reset_operations operation
24
+ ON operation.operation_id = $1
25
+ WHERE deployment.deployment_id = ANY($2::text[])`, [operationId, deployments.map((deployment) => deployment.deploymentId)]);
26
+ const frozenById = new Map(deployments.map((deployment) => [deployment.deploymentId, deployment]));
27
+ return [
28
+ ...new Map(stored.rows
29
+ .filter((row) => {
30
+ const frozen = frozenById.get(row.deployment_id);
31
+ return (frozen !== undefined &&
32
+ row.operation_archived &&
33
+ row.org_slug === frozen.org &&
34
+ row.app_slug === frozen.app &&
35
+ row.environment === frozen.environment &&
36
+ row.active === frozen.active &&
37
+ row.access_mode === 'owner-only' &&
38
+ row.created_by_subject !== null &&
39
+ targetPrincipalIds.includes(row.created_by_subject));
40
+ })
41
+ .map((row) => [
42
+ applicationKey({ org: row.org_slug, app: row.app_slug }),
43
+ { org_slug: row.org_slug, app_slug: row.app_slug },
44
+ ])).values(),
45
+ ].sort((left, right) => canonicalJson(left).localeCompare(canonicalJson(right)));
46
+ }
47
+ function frozenApplication(locator) {
48
+ return typeof locator.org === 'string' && typeof locator.app === 'string'
49
+ ? { org: locator.org, app: locator.app }
50
+ : undefined;
51
+ }
52
+ function frozenDeployment(locator) {
53
+ const application = frozenApplication(locator);
54
+ return application !== undefined &&
55
+ typeof locator.deploymentId === 'string' &&
56
+ typeof locator.environment === 'string' &&
57
+ locator.active === true &&
58
+ locator.archived === false
59
+ ? {
60
+ ...application,
61
+ deploymentId: locator.deploymentId,
62
+ environment: locator.environment,
63
+ active: true,
64
+ archived: false,
65
+ }
66
+ : undefined;
67
+ }
68
+ function applicationKey(application) {
69
+ return `${application.org}\u0000${application.app}`;
70
+ }
71
+ //# sourceMappingURL=platform-account-reset-ownership-rollback-postgres.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-account-reset-ownership-rollback-postgres.js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,SAAS,iBAAiB,CACxB,OAA0C;IAE1C,OAAO,OAAO,OAAO,CAAC,GAAG,KAAK,QAAQ,IAAI,OAAO,OAAO,CAAC,GAAG,KAAK,QAAQ;QACvE,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;QACxC,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAED,SAAS,gBAAgB,CACvB,OAA0C;IAE1C,MAAM,WAAW,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAC/C,OAAO,WAAW,KAAK,SAAS;QAC9B,OAAO,OAAO,CAAC,YAAY,KAAK,QAAQ;QACxC,OAAO,OAAO,CAAC,WAAW,KAAK,QAAQ;QACvC,OAAO,CAAC,MAAM,KAAK,IAAI;QACvB,OAAO,CAAC,QAAQ,KAAK,KAAK;QAC1B,CAAC,CAAC;YACE,GAAG,WAAW;YACd,YAAY,EAAE,OAAO,CAAC,YAAY;YAClC,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,MAAM,EAAE,IAAI;YACZ,QAAQ,EAAE,KAAK;SAChB;QACH,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAED,SAAS,cAAc,CAAC,WAA8B;IACpD,OAAO,GAAG,WAAW,CAAC,GAAG,SAAS,WAAW,CAAC,GAAG,EAAE,CAAC;AACtD,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { PlatformAccountResetExecuteRequest, PlatformAccountResetOperatorPreviewRequest, PlatformAccountResetResult, PlatformAccountResetStatusRequest } from './platform-account-reset.js';
2
+ /** Route and CLI boundary for the private, aggregate-only account-reset operator. */
3
+ export interface PlatformAccountResetOperatorPort {
4
+ preview(input: PlatformAccountResetOperatorPreviewRequest): Promise<PlatformAccountResetResult>;
5
+ execute(input: PlatformAccountResetExecuteRequest): Promise<PlatformAccountResetResult>;
6
+ status(input: PlatformAccountResetStatusRequest): Promise<PlatformAccountResetResult | undefined>;
7
+ }
8
+ /** Persistence boundary; implementations must never return reservation emails or provider locators. */
9
+ export interface PlatformAccountResetStorePort {
10
+ readSafeResult(operationId: string): Promise<PlatformAccountResetResult | undefined>;
11
+ }
12
+ //# sourceMappingURL=platform-account-reset-ports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-account-reset-ports.d.ts","sourceRoot":"","sources":["../src/platform-account-reset-ports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kCAAkC,EAClC,0CAA0C,EAC1C,0BAA0B,EAC1B,iCAAiC,EAClC,MAAM,6BAA6B,CAAC;AAErC,qFAAqF;AACrF,MAAM,WAAW,gCAAgC;IAC/C,OAAO,CAAC,KAAK,EAAE,0CAA0C,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;IAChG,OAAO,CAAC,KAAK,EAAE,kCAAkC,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;IACxF,MAAM,CAAC,KAAK,EAAE,iCAAiC,GAAG,OAAO,CAAC,0BAA0B,GAAG,SAAS,CAAC,CAAC;CACnG;AAED,uGAAuG;AACvG,MAAM,WAAW,6BAA6B;IAC5C,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,0BAA0B,GAAG,SAAS,CAAC,CAAC;CACtF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=platform-account-reset-ports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-account-reset-ports.js","sourceRoot":"","sources":["../src/platform-account-reset-ports.ts"],"names":[],"mappings":""}
@@ -0,0 +1,22 @@
1
+ import type { PlatformAccountResetCleanupResource } from './platform-account-reset-ownership-postgres.js';
2
+ import type { PlatformAuthInventorySourceManifest } from './platform-auth-inventory-sources.js';
3
+ import type { PlatformIdentityQueryable } from './platform-identity-postgres.js';
4
+ import type { PlatformAccountResetDirectory, PlatformAccountResetDirectoryReadOptions } from './workos-directory.js';
5
+ export interface PlatformAccountResetContactEvidence {
6
+ readonly normalizedContacts: ReadonlyMap<string, string>;
7
+ readonly evidenceByTarget: ReadonlyMap<string, unknown>;
8
+ readonly missingCount: number;
9
+ readonly ambiguousCount: number;
10
+ }
11
+ export interface PlatformAccountResetWorkosEvidence {
12
+ readonly resources: readonly PlatformAccountResetCleanupResource[];
13
+ readonly providerUnavailableCount: number;
14
+ readonly conflictCount: number;
15
+ }
16
+ export declare function loadPlatformAccountResetCustomerEvidence(connection: PlatformIdentityQueryable, targets: readonly string[]): Promise<readonly {
17
+ readonly subject: string;
18
+ readonly source: string;
19
+ }[]>;
20
+ export declare function loadPlatformAccountResetContactEvidence(connection: PlatformIdentityQueryable, targets: readonly string[], configured: PlatformAuthInventorySourceManifest): Promise<PlatformAccountResetContactEvidence>;
21
+ export declare function loadPlatformAccountResetWorkosEvidence(contacts: ReadonlyMap<string, string>, directory: PlatformAccountResetDirectory, workosRealm: string, options: PlatformAccountResetDirectoryReadOptions): Promise<PlatformAccountResetWorkosEvidence>;
22
+ //# sourceMappingURL=platform-account-reset-preview-evidence-postgres.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-account-reset-preview-evidence-postgres.d.ts","sourceRoot":"","sources":["../src/platform-account-reset-preview-evidence-postgres.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,gDAAgD,CAAC;AAC1G,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,sCAAsC,CAAC;AAEhG,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,KAAK,EACV,6BAA6B,EAC7B,wCAAwC,EAEzC,MAAM,uBAAuB,CAAC;AAQ/B,MAAM,WAAW,mCAAmC;IAClD,QAAQ,CAAC,kBAAkB,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzD,QAAQ,CAAC,gBAAgB,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,SAAS,EAAE,SAAS,mCAAmC,EAAE,CAAC;IACnE,QAAQ,CAAC,wBAAwB,EAAE,MAAM,CAAC;IAC1C,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED,wBAAsB,wCAAwC,CAC5D,UAAU,EAAE,yBAAyB,EACrC,OAAO,EAAE,SAAS,MAAM,EAAE,GACzB,OAAO,CAAC,SAAS;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAAE,CAAC,CAY3E;AAED,wBAAsB,uCAAuC,CAC3D,UAAU,EAAE,yBAAyB,EACrC,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,UAAU,EAAE,mCAAmC,GAC9C,OAAO,CAAC,mCAAmC,CAAC,CA4E9C;AAED,wBAAsB,sCAAsC,CAC1D,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EACrC,SAAS,EAAE,6BAA6B,EACxC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,wCAAwC,GAChD,OAAO,CAAC,kCAAkC,CAAC,CA2D7C"}
@@ -0,0 +1,177 @@
1
+ import { sha256Canonical } from './platform-account-reset-fingerprint.js';
2
+ import { normalizePlatformIdentityEmail } from './platform-identity.js';
3
+ export async function loadPlatformAccountResetCustomerEvidence(connection, targets) {
4
+ return queryRows(connection, `SELECT owner_subject AS subject, 'oauth_refresh_tokens'::text AS source
5
+ FROM oauth_refresh_tokens
6
+ WHERE owner_subject = ANY($1::text[]) AND identity_kind = 'customer'
7
+ UNION ALL
8
+ SELECT owner_subject AS subject, 'oauth_device_authorizations'::text AS source
9
+ FROM oauth_device_authorizations
10
+ WHERE owner_subject = ANY($1::text[]) AND identity_kind = 'customer'`, [targets]);
11
+ }
12
+ export async function loadPlatformAccountResetContactEvidence(connection, targets, configured) {
13
+ const statements = [];
14
+ if (configured.org_members === 'configured')
15
+ statements.push(`SELECT subject, email, 'org_members'::text AS source
16
+ FROM org_members WHERE subject = ANY($1::text[])`);
17
+ if (configured.billing_account_members === 'configured')
18
+ statements.push(`SELECT subject, email, 'billing_account_members'::text AS source
19
+ FROM billing_account_members WHERE subject = ANY($1::text[])`);
20
+ if (configured.oauth_refresh_tokens === 'configured')
21
+ statements.push(`SELECT owner_subject AS subject, owner_email AS email,
22
+ 'oauth_refresh_tokens'::text AS source
23
+ FROM oauth_refresh_tokens
24
+ WHERE owner_subject = ANY($1::text[]) AND identity_kind <> 'customer'`);
25
+ if (configured.deploy_records === 'configured')
26
+ statements.push(`SELECT created_by_subject AS subject, created_by_email AS email,
27
+ 'deploy_records'::text AS source
28
+ FROM deploy_records
29
+ WHERE created_by_subject = ANY($1::text[]) AND active AND archived_at IS NULL`);
30
+ if (configured.oauth_device_authorizations === 'configured')
31
+ statements.push(`SELECT owner_subject AS subject, owner_email AS email,
32
+ 'oauth_device_authorizations'::text AS source
33
+ FROM oauth_device_authorizations
34
+ WHERE owner_subject = ANY($1::text[]) AND identity_kind <> 'customer'`);
35
+ if (configured.welcome_email_outbox === 'configured')
36
+ statements.push(`SELECT subject, email, 'welcome_email_outbox'::text AS source
37
+ FROM welcome_email_outbox WHERE subject = ANY($1::text[])`);
38
+ const rows = statements.length === 0
39
+ ? []
40
+ : await queryRows(connection, statements.join(' UNION ALL '), [targets]);
41
+ const rowsByTarget = groupBy(rows, (row) => row.subject);
42
+ const normalizedContacts = new Map();
43
+ const evidenceByTarget = new Map();
44
+ let missingCount = 0;
45
+ let ambiguousCount = 0;
46
+ for (const target of targets) {
47
+ const targetRows = rowsByTarget.get(target) ?? [];
48
+ const candidates = [
49
+ ...new Set(targetRows
50
+ .map((row) => safelyNormalizeEmail(row.email))
51
+ .filter((email) => email !== undefined)),
52
+ ].sort(compareText);
53
+ if (candidates.length === 0)
54
+ missingCount += 1;
55
+ else if (candidates.length !== 1)
56
+ ambiguousCount += 1;
57
+ else
58
+ normalizedContacts.set(target, candidates[0]);
59
+ evidenceByTarget.set(target, {
60
+ candidates: candidates.map((email) => sha256Canonical({ email })),
61
+ contributions: targetRows.map((row) => {
62
+ const normalized = safelyNormalizeEmail(row.email);
63
+ return {
64
+ source: row.source,
65
+ valueFingerprint: normalized === undefined ? 'invalid' : sha256Canonical({ normalized }),
66
+ };
67
+ }),
68
+ });
69
+ }
70
+ return {
71
+ normalizedContacts,
72
+ evidenceByTarget,
73
+ missingCount,
74
+ ambiguousCount,
75
+ };
76
+ }
77
+ export async function loadPlatformAccountResetWorkosEvidence(contacts, directory, workosRealm, options) {
78
+ const resources = [];
79
+ let providerUnavailableCount = 0;
80
+ let conflictCount = 0;
81
+ const orderedContacts = [...contacts].sort(([left], [right]) => compareText(left, right));
82
+ for (const [principalId, normalizedEmail] of orderedContacts) {
83
+ if (providerReadAborted(options))
84
+ return unavailableWorkosEvidence(orderedContacts.length);
85
+ let users;
86
+ try {
87
+ users = await directory.listUsersByNormalizedEmail(normalizedEmail, options);
88
+ }
89
+ catch {
90
+ if (providerReadAborted(options))
91
+ return unavailableWorkosEvidence(orderedContacts.length);
92
+ providerUnavailableCount += 1;
93
+ continue;
94
+ }
95
+ if (providerReadAborted(options))
96
+ return unavailableWorkosEvidence(orderedContacts.length);
97
+ const exact = users
98
+ .filter((user) => safelyNormalizeEmail(user.normalizedEmail) === normalizedEmail)
99
+ .sort((left, right) => compareText(left.id, right.id));
100
+ if (exact.length > 1 || exact.some((user) => user.externalId !== undefined)) {
101
+ conflictCount += 1;
102
+ continue;
103
+ }
104
+ const user = exact[0];
105
+ if (user === undefined)
106
+ continue;
107
+ if (providerReadAborted(options))
108
+ return unavailableWorkosEvidence(orderedContacts.length);
109
+ let byId;
110
+ try {
111
+ byId = await directory.findUserById(user.id, options);
112
+ }
113
+ catch {
114
+ if (providerReadAborted(options))
115
+ return unavailableWorkosEvidence(orderedContacts.length);
116
+ providerUnavailableCount += 1;
117
+ continue;
118
+ }
119
+ if (providerReadAborted(options))
120
+ return unavailableWorkosEvidence(orderedContacts.length);
121
+ if (byId === undefined ||
122
+ byId.id !== user.id ||
123
+ safelyNormalizeEmail(byId.normalizedEmail) !== normalizedEmail ||
124
+ byId.externalId !== undefined) {
125
+ conflictCount += 1;
126
+ continue;
127
+ }
128
+ const locator = { principalId, userId: user.id, normalizedEmail, realm: workosRealm };
129
+ const resourceKind = 'unlinked_user';
130
+ resources.push({
131
+ provider: 'workos',
132
+ resourceKind,
133
+ locator,
134
+ locatorFingerprint: sha256Canonical({
135
+ schemaVersion: 1,
136
+ label: `platform_account_reset_locator:workos:${resourceKind}`,
137
+ locator,
138
+ }),
139
+ });
140
+ }
141
+ if (providerReadAborted(options))
142
+ return unavailableWorkosEvidence(orderedContacts.length);
143
+ return { resources, providerUnavailableCount, conflictCount };
144
+ }
145
+ function providerReadAborted(options) {
146
+ return options.signal.aborted || options.deadline.getTime() <= Date.now();
147
+ }
148
+ function unavailableWorkosEvidence(contactCount) {
149
+ return {
150
+ resources: [],
151
+ providerUnavailableCount: contactCount,
152
+ conflictCount: 0,
153
+ };
154
+ }
155
+ function queryRows(pool, text, values) {
156
+ return pool.query(text, values).then((result) => result.rows);
157
+ }
158
+ function groupBy(values, key) {
159
+ const grouped = new Map();
160
+ for (const value of values) {
161
+ const itemKey = key(value);
162
+ grouped.set(itemKey, [...(grouped.get(itemKey) ?? []), value]);
163
+ }
164
+ return grouped;
165
+ }
166
+ function compareText(left, right) {
167
+ return left < right ? -1 : left > right ? 1 : 0;
168
+ }
169
+ function safelyNormalizeEmail(value) {
170
+ try {
171
+ return normalizePlatformIdentityEmail(value);
172
+ }
173
+ catch {
174
+ return undefined;
175
+ }
176
+ }
177
+ //# sourceMappingURL=platform-account-reset-preview-evidence-postgres.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-account-reset-preview-evidence-postgres.js","sourceRoot":"","sources":["../src/plat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,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,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;AAED,SAAS,oBAAoB,CAAC,KAAa;IACzC,IAAI,CAAC;QACH,OAAO,8BAA8B,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
@@ -0,0 +1,35 @@
1
+ import type { PlatformAccountResetBlockerCode, PlatformAccountResetPreviewRequest, PlatformAccountResetResult } from './platform-account-reset.js';
2
+ import { type PlatformAccountResetCleanupResource } from './platform-account-reset-ownership-postgres.js';
3
+ import type { PlatformAuthInventorySourceManifest } from './platform-auth-inventory-sources.js';
4
+ import type { PlatformIdentityQueryable } from './platform-identity-postgres.js';
5
+ export interface PlatformAccountResetLocalInspection {
6
+ readonly operationId: string;
7
+ readonly request: PlatformAccountResetPreviewRequest;
8
+ readonly targets: readonly string[];
9
+ readonly normalizedContacts: ReadonlyMap<string, string>;
10
+ readonly targetEvidence: ReadonlyMap<string, Readonly<Record<string, unknown>>>;
11
+ readonly cleanupResources: readonly PlatformAccountResetCleanupResource[];
12
+ readonly ownershipFingerprint: string;
13
+ readonly localCleanupSetFingerprint: string;
14
+ readonly requestFingerprint: string;
15
+ readonly workosRealmFingerprint: string;
16
+ readonly counts: PlatformAccountResetResult['counts'];
17
+ readonly blockers: readonly {
18
+ readonly code: PlatformAccountResetBlockerCode;
19
+ readonly count: number;
20
+ }[];
21
+ readonly evidenceFingerprint: string;
22
+ }
23
+ export interface PlatformAccountResetLocalInspectionOptions {
24
+ readonly sourceAvailability: PlatformAuthInventorySourceManifest;
25
+ readonly googleRealm: string;
26
+ readonly workosRealm: string;
27
+ readonly releaseSha: string;
28
+ readonly excludedSubjects: readonly {
29
+ readonly subject: string;
30
+ readonly kind: 'workload' | 'synthetic';
31
+ }[];
32
+ readonly ignoreCurrentOperation?: boolean;
33
+ }
34
+ export declare function inspectPlatformAccountResetLocalEvidence(connection: PlatformIdentityQueryable, request: PlatformAccountResetPreviewRequest, operationId: string, options: PlatformAccountResetLocalInspectionOptions): Promise<PlatformAccountResetLocalInspection>;
35
+ //# sourceMappingURL=platform-account-reset-preview-local-postgres.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-account-reset-preview-local-postgres.d.ts","sourceRoot":"","sources":["../src/platform-account-reset-preview-local-postgres.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,+BAA+B,EAC/B,kCAAkC,EAClC,0BAA0B,EAC3B,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAEL,KAAK,mCAAmC,EACzC,MAAM,gDAAgD,CAAC;AAMxD,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,sCAAsC,CAAC;AAChG,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AA6BjF,MAAM,WAAW,mCAAmC;IAClD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,kCAAkC,CAAC;IACrD,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,kBAAkB,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzD,QAAQ,CAAC,cAAc,EAAE,WAA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-account-reset-fingerprint.js';
2
+ import { loadPlatformAccountResetOwnershipSnapshot, } from './platform-account-reset-ownership-postgres.js';
3
+ import { loadPlatformAccountResetContactEvidence, loadPlatformAccountResetCustomerEvidence, } from './platform-account-reset-preview-evidence-postgres.js';
4
+ import { readPlatformAuthInventorySourceEpoch } from './platform-auth-inventory-source-fence-postgres.js';
5
+ export async function inspectPlatformAccountResetLocalEvidence(connection, request, operationId, options) {
6
+ const targets = [...request.targetSet.principalIds].sort(compareText);
7
+ const targetSet = new Set(targets);
8
+ const targetFingerprints = targets.map((target) => sha256Canonical(target));
9
+ const blockers = new Map();
10
+ const rollout = await connection.query(`SELECT generation::text FROM platform_auth_rollout_state
11
+ WHERE singleton = true FOR SHARE`);
12
+ const generation = Number(rollout.rows[0]?.generation);
13
+ const sourceEpoch = Number(await readPlatformAuthInventorySourceEpoch(connection));
14
+ if (request.releaseSha !== options.releaseSha)
15
+ increment(blockers, 'release_mismatch');
16
+ if (request.expectedGeneration !== generation)
17
+ increment(blockers, 'generation_mismatch');
18
+ if (request.sourceEpoch !== sourceEpoch)
19
+ increment(blockers, 'source_epoch_mismatch');
20
+ if (request.workosRealm !== options.workosRealm)
21
+ increment(blockers, 'operation_conflict');
22
+ const principals = await queryRows(connection, `SELECT principal_id, status, billing_identity_issuer, billing_subject
23
+ FROM platform_principals WHERE principal_id = ANY($1::text[])`, [targets]);
24
+ const links = await queryRows(connection, `SELECT principal_id, provider, realm, external_id, disabled_at
25
+ FROM platform_identity_links WHERE principal_id = ANY($1::text[])`, [targets]);
26
+ const verified = await queryRows(connection, `SELECT principal_id FROM platform_verified_emails
27
+ WHERE principal_id = ANY($1::text[])`, [targets]);
28
+ const imports = await queryRows(connection, `SELECT principal_id FROM workos_import_ledger
29
+ WHERE principal_id = ANY($1::text[])`, [targets]);
30
+ const importAttempts = await queryRows(connection, `SELECT principal_id, principal_fingerprint FROM workos_import_attempt_evidence
31
+ WHERE principal_id = ANY($1::text[])
32
+ OR principal_fingerprint = ANY($2::text[])`, [targets, targetFingerprints]);
33
+ const activeResets = await queryRows(connection, `SELECT target.principal_id
34
+ FROM platform_account_reset_targets target
35
+ JOIN platform_account_reset_operations operation
36
+ ON operation.operation_id = target.operation_id
37
+ WHERE target.principal_id = ANY($1::text[])
38
+ AND (
39
+ (operation.lifecycle = 'previewed'
40
+ AND operation.preview_expires_at > clock_timestamp())
41
+ OR operation.lifecycle IN ('quarantined','finalizing','finalization_blocked')
42
+ )
43
+ AND ($2::text IS NULL OR target.operation_id <> $2)`, [targets, options.ignoreCurrentOperation === true ? operationId : null]);
44
+ const personal = await queryRows(connection, `SELECT binding.principal_subject, binding.org_slug,
45
+ binding.billing_identity_issuer, binding.billing_subject,
46
+ binding.billing_account_id,
47
+ defaults.billing_account_id AS default_billing_account_id,
48
+ home.billing_account_id AS home_billing_account_id,
49
+ home.home_owner_identity_issuer, home.home_owner_subject
50
+ FROM personal_workspace_bindings binding
51
+ LEFT JOIN billing_account_defaults defaults
52
+ ON defaults.identity_issuer = binding.billing_identity_issuer
53
+ AND defaults.subject = binding.billing_subject
54
+ LEFT JOIN org_billing_home_accounts home ON home.org_slug = binding.org_slug
55
+ WHERE binding.principal_subject = ANY($1::text[])`, [targets]);
56
+ const principalsById = new Map(principals.map((row) => [row.principal_id, row]));
57
+ const linksByPrincipal = groupBy(links, (row) => row.principal_id);
58
+ for (const target of targets) {
59
+ const principal = principalsById.get(target);
60
+ if (principal?.status !== 'active') {
61
+ increment(blockers, 'principal_not_active');
62
+ continue;
63
+ }
64
+ const googleLinks = (linksByPrincipal.get(target) ?? []).filter((row) => row.provider === 'google' && row.realm === options.googleRealm && row.disabled_at === null);
65
+ if (googleLinks.length !== 1 ||
66
+ googleLinks[0]?.external_id !== target ||
67
+ principal.billing_identity_issuer !== 'https://accounts.google.com' ||
68
+ principal.billing_subject !== target)
69
+ increment(blockers, 'principal_not_legacy_google');
70
+ }
71
+ if (verified.length !== 0)
72
+ blockers.set('verified_email_evidence_present', verified.length);
73
+ const workosLinks = links.filter((row) => row.provider === 'workos');
74
+ if (workosLinks.length !== 0)
75
+ blockers.set('workos_link_present', workosLinks.length);
76
+ if (imports.length + importAttempts.length !== 0)
77
+ blockers.set('workos_import_present', imports.length + importAttempts.length);
78
+ if (activeResets.length !== 0)
79
+ blockers.set('operation_conflict', activeResets.length);
80
+ const customerEvidence = await loadPlatformAccountResetCustomerEvidence(connection, targets);
81
+ const configuredExcluded = options.excludedSubjects.filter((entry) => targetSet.has(entry.subject));
82
+ if (customerEvidence.length + configuredExcluded.length !== 0)
83
+ blockers.set('synthetic_or_customer_identity', customerEvidence.length + configuredExcluded.length);
84
+ const personalByTarget = groupBy(personal, (row) => row.principal_subject);
85
+ for (const target of targets) {
86
+ const rows = personalByTarget.get(target) ?? [];
87
+ const row = rows[0];
88
+ if (rows.length !== 1 ||
89
+ row === undefined ||
90
+ row.billing_identity_issuer !== 'https://accounts.google.com' ||
91
+ row.billing_subject !== target ||
92
+ row.billing_account_id !== row.default_billing_account_id ||
93
+ row.billing_account_id !== row.home_billing_account_id ||
94
+ row.home_owner_identity_issuer !== 'https://accounts.google.com' ||
95
+ row.home_owner_subject !== target)
96
+ increment(blockers, 'personal_workspace_mismatch');
97
+ }
98
+ const contactEvidence = await loadPlatformAccountResetContactEvidence(connection, targets, options.sourceAvailability);
99
+ if (contactEvidence.missingCount !== 0)
100
+ blockers.set('contact_hint_missing', contactEvidence.missingCount);
101
+ if (contactEvidence.ambiguousCount !== 0)
102
+ blockers.set('contact_hint_ambiguous', contactEvidence.ambiguousCount);
103
+ const ownership = await loadPlatformAccountResetOwnershipSnapshot(connection, {
104
+ targetPrincipalIds: targets,
105
+ });
106
+ for (const blocker of ownership.blockers)
107
+ blockers.set(blocker.code, (blockers.get(blocker.code) ?? 0) + blocker.count);
108
+ const blockerList = [...blockers]
109
+ .map(([code, count]) => ({ code, count }))
110
+ .sort((left, right) => left.code.localeCompare(right.code));
111
+ const targetEvidence = new Map();
112
+ for (const target of targets) {
113
+ targetEvidence.set(target, {
114
+ schemaVersion: 1,
115
+ label: 'platform_account_reset_target_eligibility',
116
+ target,
117
+ principal: principalsById.get(target) ?? null,
118
+ links: linksByPrincipal.get(target) ?? [],
119
+ verifiedEmailEvidence: verified.filter((row) => row.principal_id === target),
120
+ importEvidence: imports.filter((row) => row.principal_id === target),
121
+ importAttemptEvidence: importAttempts.filter((row) => row.principal_id === target || row.principal_fingerprint === sha256Canonical(target)),
122
+ personal: personalByTarget.get(target) ?? [],
123
+ contact: contactEvidence.evidenceByTarget.get(target),
124
+ configuredExclusion: configuredExcluded.find((entry) => entry.subject === target) ?? null,
125
+ customerEvidence: customerEvidence.filter((row) => row.subject === target),
126
+ });
127
+ }
128
+ const requestFingerprint = sha256Canonical(request);
129
+ const workosRealmFingerprint = sha256Canonical({
130
+ schemaVersion: 1,
131
+ label: 'workos_realm',
132
+ realm: request.workosRealm,
133
+ });
134
+ const counts = {
135
+ targetCount: targets.length,
136
+ suspendedPrincipalCount: principals.filter((row) => row.status === 'suspended').length,
137
+ ...ownership.counts,
138
+ cleanupPendingCount: 0,
139
+ };
140
+ const evidenceFingerprint = sha256Canonical({
141
+ schemaVersion: 1,
142
+ label: 'platform_account_reset_local_evidence',
143
+ requestFingerprint,
144
+ workosRealmFingerprint,
145
+ targetEvidence: [...targetEvidence],
146
+ blockers: blockerList,
147
+ counts,
148
+ ownershipFingerprint: ownership.ownershipFingerprint,
149
+ cleanupSetFingerprint: ownership.cleanupSetFingerprint,
150
+ });
151
+ return {
152
+ operationId,
153
+ request,
154
+ targets,
155
+ normalizedContacts: contactEvidence.normalizedContacts,
156
+ targetEvidence,
157
+ cleanupResources: ownership.cleanupResources,
158
+ ownershipFingerprint: ownership.ownershipFingerprint,
159
+ localCleanupSetFingerprint: ownership.cleanupSetFingerprint,
160
+ requestFingerprint,
161
+ workosRealmFingerprint,
162
+ counts,
163
+ blockers: blockerList,
164
+ evidenceFingerprint,
165
+ };
166
+ }
167
+ function queryRows(pool, text, values) {
168
+ return pool.query(text, values).then((result) => result.rows);
169
+ }
170
+ function groupBy(values, key) {
171
+ const grouped = new Map();
172
+ for (const value of values) {
173
+ const itemKey = key(value);
174
+ grouped.set(itemKey, [...(grouped.get(itemKey) ?? []), value]);
175
+ }
176
+ return grouped;
177
+ }
178
+ function increment(blockers, code) {
179
+ blockers.set(code, (blockers.get(code) ?? 0) + 1);
180
+ }
181
+ function compareText(left, right) {
182
+ return left < right ? -1 : left > right ? 1 : 0;
183
+ }
184
+ //# sourceMappingURL=platform-account-reset-preview-local-postgres.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-account-reset-preview-local-postgres.js","sourceRoot":"","sources":["../src/platform-account-reset-preview-local-postgres.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EACL,yCAAyC,GAE1C,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACL,uCAAuC,EACvC,wCAAwC,GACzC,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EAAE,oCAAoC,EAAE,MAAM,oDAAoD,CAAC;AA8D1G,MAAM,CAAC,KAAK,UAAU,wCAAwC,CAC5D,UAAqC,EACrC,OAA2C,EAC3C,WAAmB,EACnB,OAAmD;IAEnD,MAAM,OAAO,GAAG,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACtE,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;IACnC,MAAM,kBAAkB,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5E,MAAM,QAAQ,GAAG,IAAI,GAAG,EAA2C,CAAC;IACpE,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,KAAK,CACpC;uCACmC,CACpC,CAAC;IACF,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC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AC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACnE,CAAC;AAED,SAAS,OAAO,CACd,MAAoB,EACpB,GAAyB;IAEzB,MAAM,OAAO,GAAG,IAAI,GAAG,EAAe,CAAC;IACvC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,SAAS,CAChB,QAAsD,EACtD,IAAqC;IAErC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AACpD,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,11 @@
1
+ import { type PlatformAccountResetFrozenInspection } from './platform-account-reset-preview-result.js';
2
+ import type { PlatformIdentityQueryable } from './platform-identity-postgres.js';
3
+ export declare function persistPlatformAccountResetPreview(connection: PlatformIdentityQueryable, inspection: PlatformAccountResetFrozenInspection, options: {
4
+ readonly actorFingerprint: string;
5
+ readonly approvedTargetSetFingerprint: string;
6
+ readonly workosRealm: string;
7
+ readonly createdAt: Date | string;
8
+ readonly previewExpiresAt: Date | string;
9
+ }): Promise<void>;
10
+ export declare function assertPlatformAccountResetCleanupEvidence(connection: PlatformIdentityQueryable, operationId: string, inspection: PlatformAccountResetFrozenInspection): Promise<void>;
11
+ //# sourceMappingURL=platform-account-reset-preview-persistence-postgres.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-account-reset-preview-persistence-postgres.d.ts","sourceRoot":"","sources":["../src/platform-account-reset-preview-persistence-postgres.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,oCAAoC,EAE1C,MAAM,4CAA4C,CAAC;AACpD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAEjF,wBAAsB,kCAAkC,CACtD,UAAU,EAAE,yBAAyB,EACrC,UAAU,EAAE,oCAAoC,EAChD,OAAO,EAAE;IACP,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,4BAA4B,EAAE,MAAM,CAAC;IAC9C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,IAAI,GAAG,MAAM,CAAC;IAClC,QAAQ,CAAC,gBAAgB,EAAE,IAAI,GAAG,MAAM,CAAC;CAC1C,GACA,OAAO,CAAC,IAAI,CAAC,CAkFf;AAED,wBAAsB,yCAAyC,CAC7D,UAAU,EAAE,yBAAyB,EACrC,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,oCAAoC,GAC/C,OAAO,CAAC,IAAI,CAAC,CAgDf"}