@noodleseed/one 0.63.0 → 0.64.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 (440) hide show
  1. package/dist/auth-discovery.d.ts +17 -0
  2. package/dist/auth-discovery.d.ts.map +1 -0
  3. package/dist/auth-discovery.js +54 -0
  4. package/dist/auth-discovery.js.map +1 -0
  5. package/dist/cli.d.ts.map +1 -1
  6. package/dist/cli.js +3 -0
  7. package/dist/cli.js.map +1 -1
  8. package/dist/commands/catalog-data-platform-auth.d.ts +7 -0
  9. package/dist/commands/catalog-data-platform-auth.d.ts.map +1 -0
  10. package/dist/commands/catalog-data-platform-auth.js +47 -0
  11. package/dist/commands/catalog-data-platform-auth.js.map +1 -0
  12. package/dist/commands/catalog.d.ts.map +1 -1
  13. package/dist/commands/catalog.js +6 -3
  14. package/dist/commands/catalog.js.map +1 -1
  15. package/dist/commands/docs-mcp.d.ts +3 -3
  16. package/dist/commands/docs-mcp.js +3 -3
  17. package/dist/commands/platform-auth-finalization-args.d.ts +13 -0
  18. package/dist/commands/platform-auth-finalization-args.d.ts.map +1 -0
  19. package/dist/commands/platform-auth-finalization-args.js +29 -0
  20. package/dist/commands/platform-auth-finalization-args.js.map +1 -0
  21. package/dist/commands/platform-auth-migration-args.d.ts +71 -0
  22. package/dist/commands/platform-auth-migration-args.d.ts.map +1 -0
  23. package/dist/commands/platform-auth-migration-args.js +320 -0
  24. package/dist/commands/platform-auth-migration-args.js.map +1 -0
  25. package/dist/commands/platform-auth-migration-ops.d.ts +3 -0
  26. package/dist/commands/platform-auth-migration-ops.d.ts.map +1 -0
  27. package/dist/commands/platform-auth-migration-ops.js +369 -0
  28. package/dist/commands/platform-auth-migration-ops.js.map +1 -0
  29. package/dist/commands/project-setup.js +1 -1
  30. package/dist/commands/project-setup.js.map +1 -1
  31. package/dist/config.d.ts +4 -4
  32. package/dist/config.d.ts.map +1 -1
  33. package/dist/control-plane.d.ts +0 -11
  34. package/dist/control-plane.d.ts.map +1 -1
  35. package/dist/control-plane.js +1 -8
  36. package/dist/control-plane.js.map +1 -1
  37. package/dist/doctor.d.ts.map +1 -1
  38. package/dist/doctor.js +3 -5
  39. package/dist/doctor.js.map +1 -1
  40. package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.d.ts.map +1 -1
  41. package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.js +4 -0
  42. package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.js.map +1 -1
  43. package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.d.ts.map +1 -1
  44. package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.js +1 -0
  45. package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.js.map +1 -1
  46. package/node_modules/@noodle-borg/auth/dist/jwt-issuer.d.ts +2 -2
  47. package/node_modules/@noodle-borg/auth/dist/jwt-issuer.d.ts.map +1 -1
  48. package/node_modules/@noodle-borg/auth/dist/jwt-issuer.js +1 -1
  49. package/node_modules/@noodle-borg/auth/dist/verify.d.ts +1 -1
  50. package/node_modules/@noodle-borg/auth/dist/verify.d.ts.map +1 -1
  51. package/node_modules/@noodle-borg/service/dist/auth/deploy-gate.d.ts +26 -0
  52. package/node_modules/@noodle-borg/service/dist/auth/deploy-gate.d.ts.map +1 -1
  53. package/node_modules/@noodle-borg/service/dist/auth/deploy-gate.js +105 -1
  54. package/node_modules/@noodle-borg/service/dist/auth/deploy-gate.js.map +1 -1
  55. package/node_modules/@noodle-borg/service/dist/control-plane-auth-bootstrap.d.ts +25 -0
  56. package/node_modules/@noodle-borg/service/dist/control-plane-auth-bootstrap.d.ts.map +1 -0
  57. package/node_modules/@noodle-borg/service/dist/control-plane-auth-bootstrap.js +99 -0
  58. package/node_modules/@noodle-borg/service/dist/control-plane-auth-bootstrap.js.map +1 -0
  59. package/node_modules/@noodle-borg/service/dist/index.d.ts +15 -0
  60. package/node_modules/@noodle-borg/service/dist/index.d.ts.map +1 -1
  61. package/node_modules/@noodle-borg/service/dist/index.js +15 -0
  62. package/node_modules/@noodle-borg/service/dist/index.js.map +1 -1
  63. package/node_modules/@noodle-borg/service/dist/main.js +112 -19
  64. package/node_modules/@noodle-borg/service/dist/main.js.map +1 -1
  65. package/node_modules/@noodle-borg/service/dist/oauth/app.d.ts +1 -1
  66. package/node_modules/@noodle-borg/service/dist/oauth/app.d.ts.map +1 -1
  67. package/node_modules/@noodle-borg/service/dist/oauth/app.js +9 -1
  68. package/node_modules/@noodle-borg/service/dist/oauth/app.js.map +1 -1
  69. package/node_modules/@noodle-borg/service/dist/oauth/authorization-initiation.d.ts +24 -0
  70. package/node_modules/@noodle-borg/service/dist/oauth/authorization-initiation.d.ts.map +1 -0
  71. package/node_modules/@noodle-borg/service/dist/oauth/authorization-initiation.js +88 -0
  72. package/node_modules/@noodle-borg/service/dist/oauth/authorization-initiation.js.map +1 -0
  73. package/node_modules/@noodle-borg/service/dist/oauth/branding.d.ts +2 -0
  74. package/node_modules/@noodle-borg/service/dist/oauth/branding.d.ts.map +1 -1
  75. package/node_modules/@noodle-borg/service/dist/oauth/branding.js +3 -2
  76. package/node_modules/@noodle-borg/service/dist/oauth/branding.js.map +1 -1
  77. package/node_modules/@noodle-borg/service/dist/oauth/consent-claims.d.ts +1 -1
  78. package/node_modules/@noodle-borg/service/dist/oauth/consent-claims.d.ts.map +1 -1
  79. package/node_modules/@noodle-borg/service/dist/oauth/consent-token.d.ts +5 -0
  80. package/node_modules/@noodle-borg/service/dist/oauth/consent-token.d.ts.map +1 -0
  81. package/node_modules/@noodle-borg/service/dist/oauth/consent-token.js +19 -0
  82. package/node_modules/@noodle-borg/service/dist/oauth/consent-token.js.map +1 -0
  83. package/node_modules/@noodle-borg/service/dist/oauth/consent.js +1 -1
  84. package/node_modules/@noodle-borg/service/dist/oauth/developer-grant-page.d.ts.map +1 -1
  85. package/node_modules/@noodle-borg/service/dist/oauth/developer-grant-page.js +216 -28
  86. package/node_modules/@noodle-borg/service/dist/oauth/developer-grant-page.js.map +1 -1
  87. package/node_modules/@noodle-borg/service/dist/oauth/first-party-client.d.ts +13 -0
  88. package/node_modules/@noodle-borg/service/dist/oauth/first-party-client.d.ts.map +1 -0
  89. package/node_modules/@noodle-borg/service/dist/oauth/first-party-client.js +62 -0
  90. package/node_modules/@noodle-borg/service/dist/oauth/first-party-client.js.map +1 -0
  91. package/node_modules/@noodle-borg/service/dist/oauth/metadata.d.ts +4 -0
  92. package/node_modules/@noodle-borg/service/dist/oauth/metadata.d.ts.map +1 -0
  93. package/node_modules/@noodle-borg/service/dist/oauth/metadata.js +20 -0
  94. package/node_modules/@noodle-borg/service/dist/oauth/metadata.js.map +1 -0
  95. package/node_modules/@noodle-borg/service/dist/oauth/paths.d.ts.map +1 -1
  96. package/node_modules/@noodle-borg/service/dist/oauth/paths.js +2 -0
  97. package/node_modules/@noodle-borg/service/dist/oauth/paths.js.map +1 -1
  98. package/node_modules/@noodle-borg/service/dist/oauth/platform-principal-guard.d.ts +15 -0
  99. package/node_modules/@noodle-borg/service/dist/oauth/platform-principal-guard.d.ts.map +1 -0
  100. package/node_modules/@noodle-borg/service/dist/oauth/platform-principal-guard.js +58 -0
  101. package/node_modules/@noodle-borg/service/dist/oauth/platform-principal-guard.js.map +1 -0
  102. package/node_modules/@noodle-borg/service/dist/oauth/platform-principal-postgres.d.ts +8 -0
  103. package/node_modules/@noodle-borg/service/dist/oauth/platform-principal-postgres.d.ts.map +1 -0
  104. package/node_modules/@noodle-borg/service/dist/oauth/platform-principal-postgres.js +49 -0
  105. package/node_modules/@noodle-borg/service/dist/oauth/platform-principal-postgres.js.map +1 -0
  106. package/node_modules/@noodle-borg/service/dist/oauth/postgres-time.d.ts +3 -0
  107. package/node_modules/@noodle-borg/service/dist/oauth/postgres-time.d.ts.map +1 -0
  108. package/node_modules/@noodle-borg/service/dist/oauth/postgres-time.js +7 -0
  109. package/node_modules/@noodle-borg/service/dist/oauth/postgres-time.js.map +1 -0
  110. package/node_modules/@noodle-borg/service/dist/oauth/provider.d.ts +20 -25
  111. package/node_modules/@noodle-borg/service/dist/oauth/provider.d.ts.map +1 -1
  112. package/node_modules/@noodle-borg/service/dist/oauth/provider.js +105 -196
  113. package/node_modules/@noodle-borg/service/dist/oauth/provider.js.map +1 -1
  114. package/node_modules/@noodle-borg/service/dist/oauth/service-bootstrap.d.ts +36 -0
  115. package/node_modules/@noodle-borg/service/dist/oauth/service-bootstrap.d.ts.map +1 -0
  116. package/node_modules/@noodle-borg/service/dist/oauth/service-bootstrap.js +157 -0
  117. package/node_modules/@noodle-borg/service/dist/oauth/service-bootstrap.js.map +1 -0
  118. package/node_modules/@noodle-borg/service/dist/oauth/store-postgres-schema.d.ts +4 -0
  119. package/node_modules/@noodle-borg/service/dist/oauth/store-postgres-schema.d.ts.map +1 -0
  120. package/node_modules/@noodle-borg/service/dist/oauth/store-postgres-schema.js +110 -0
  121. package/node_modules/@noodle-borg/service/dist/oauth/store-postgres-schema.js.map +1 -0
  122. package/node_modules/@noodle-borg/service/dist/oauth/store-postgres.d.ts +7 -4
  123. package/node_modules/@noodle-borg/service/dist/oauth/store-postgres.d.ts.map +1 -1
  124. package/node_modules/@noodle-borg/service/dist/oauth/store-postgres.js +63 -120
  125. package/node_modules/@noodle-borg/service/dist/oauth/store-postgres.js.map +1 -1
  126. package/node_modules/@noodle-borg/service/dist/oauth/store.d.ts +19 -6
  127. package/node_modules/@noodle-borg/service/dist/oauth/store.d.ts.map +1 -1
  128. package/node_modules/@noodle-borg/service/dist/oauth/store.js +24 -2
  129. package/node_modules/@noodle-borg/service/dist/oauth/store.js.map +1 -1
  130. package/node_modules/@noodle-borg/service/dist/oauth/tokens.d.ts +1 -1
  131. package/node_modules/@noodle-borg/service/dist/oauth/tokens.d.ts.map +1 -1
  132. package/node_modules/@noodle-borg/service/dist/oauth/tokens.js +1 -1
  133. package/node_modules/@noodle-borg/service/dist/oauth/tokens.js.map +1 -1
  134. package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-availability.d.ts +4 -0
  135. package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-availability.d.ts.map +1 -0
  136. package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-availability.js +8 -0
  137. package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-availability.js.map +1 -0
  138. package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-handler.d.ts +34 -0
  139. package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-handler.d.ts.map +1 -0
  140. package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-handler.js +109 -0
  141. package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-handler.js.map +1 -0
  142. package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-support.d.ts +22 -0
  143. package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-support.d.ts.map +1 -0
  144. package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-support.js +30 -0
  145. package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-support.js.map +1 -0
  146. package/node_modules/@noodle-borg/service/dist/oauth/upstream-consent.d.ts +21 -0
  147. package/node_modules/@noodle-borg/service/dist/oauth/upstream-consent.d.ts.map +1 -0
  148. package/node_modules/@noodle-borg/service/dist/oauth/upstream-consent.js +56 -0
  149. package/node_modules/@noodle-borg/service/dist/oauth/upstream-consent.js.map +1 -0
  150. package/node_modules/@noodle-borg/service/dist/oauth/upstream-federation.d.ts +30 -0
  151. package/node_modules/@noodle-borg/service/dist/oauth/upstream-federation.d.ts.map +1 -0
  152. package/node_modules/@noodle-borg/service/dist/oauth/upstream-federation.js +94 -0
  153. package/node_modules/@noodle-borg/service/dist/oauth/upstream-federation.js.map +1 -0
  154. package/node_modules/@noodle-borg/service/dist/oauth/upstream-human.d.ts +33 -0
  155. package/node_modules/@noodle-borg/service/dist/oauth/upstream-human.d.ts.map +1 -0
  156. package/node_modules/@noodle-borg/service/dist/oauth/upstream-human.js +27 -0
  157. package/node_modules/@noodle-borg/service/dist/oauth/upstream-human.js.map +1 -0
  158. package/node_modules/@noodle-borg/service/dist/oauth/upstream-provider-choice.d.ts +13 -0
  159. package/node_modules/@noodle-borg/service/dist/oauth/upstream-provider-choice.d.ts.map +1 -0
  160. package/node_modules/@noodle-borg/service/dist/oauth/upstream-provider-choice.js +63 -0
  161. package/node_modules/@noodle-borg/service/dist/oauth/upstream-provider-choice.js.map +1 -0
  162. package/node_modules/@noodle-borg/service/dist/oauth/upstream-rollout-store.d.ts +20 -0
  163. package/node_modules/@noodle-borg/service/dist/oauth/upstream-rollout-store.d.ts.map +1 -0
  164. package/node_modules/@noodle-borg/service/dist/oauth/upstream-rollout-store.js +40 -0
  165. package/node_modules/@noodle-borg/service/dist/oauth/upstream-rollout-store.js.map +1 -0
  166. package/node_modules/@noodle-borg/service/dist/oauth/workos-events.d.ts +115 -0
  167. package/node_modules/@noodle-borg/service/dist/oauth/workos-events.d.ts.map +1 -0
  168. package/node_modules/@noodle-borg/service/dist/oauth/workos-events.js +310 -0
  169. package/node_modules/@noodle-borg/service/dist/oauth/workos-events.js.map +1 -0
  170. package/node_modules/@noodle-borg/service/dist/oauth/workos.d.ts +65 -0
  171. package/node_modules/@noodle-borg/service/dist/oauth/workos.d.ts.map +1 -0
  172. package/node_modules/@noodle-borg/service/dist/oauth/workos.js +85 -0
  173. package/node_modules/@noodle-borg/service/dist/oauth/workos.js.map +1 -0
  174. package/node_modules/@noodle-borg/service/dist/options.d.ts +11 -2
  175. package/node_modules/@noodle-borg/service/dist/options.d.ts.map +1 -1
  176. package/node_modules/@noodle-borg/service/dist/personal-workspace.d.ts +2 -0
  177. package/node_modules/@noodle-borg/service/dist/personal-workspace.d.ts.map +1 -1
  178. package/node_modules/@noodle-borg/service/dist/personal-workspace.js +8 -2
  179. package/node_modules/@noodle-borg/service/dist/personal-workspace.js.map +1 -1
  180. package/node_modules/@noodle-borg/service/dist/platform-auth-configuration.d.ts +67 -0
  181. package/node_modules/@noodle-borg/service/dist/platform-auth-configuration.d.ts.map +1 -0
  182. package/node_modules/@noodle-borg/service/dist/platform-auth-configuration.js +54 -0
  183. package/node_modules/@noodle-borg/service/dist/platform-auth-configuration.js.map +1 -0
  184. package/node_modules/@noodle-borg/service/dist/platform-auth-frozen-candidate-postgres.d.ts +25 -0
  185. package/node_modules/@noodle-borg/service/dist/platform-auth-frozen-candidate-postgres.d.ts.map +1 -0
  186. package/node_modules/@noodle-borg/service/dist/platform-auth-frozen-candidate-postgres.js +61 -0
  187. package/node_modules/@noodle-borg/service/dist/platform-auth-frozen-candidate-postgres.js.map +1 -0
  188. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-legacy-sources-postgres.d.ts +32 -0
  189. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-legacy-sources-postgres.d.ts.map +1 -0
  190. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-legacy-sources-postgres.js +231 -0
  191. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-legacy-sources-postgres.js.map +1 -0
  192. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-local-postgres.d.ts +29 -0
  193. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-local-postgres.d.ts.map +1 -0
  194. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-local-postgres.js +350 -0
  195. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-local-postgres.js.map +1 -0
  196. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-local-subjects-postgres.d.ts +50 -0
  197. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-local-subjects-postgres.d.ts.map +1 -0
  198. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-local-subjects-postgres.js +239 -0
  199. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-local-subjects-postgres.js.map +1 -0
  200. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-paging.d.ts +66 -0
  201. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-paging.d.ts.map +1 -0
  202. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-paging.js +77 -0
  203. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-paging.js.map +1 -0
  204. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-postgres.d.ts +40 -0
  205. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-postgres.d.ts.map +1 -0
  206. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-postgres.js +355 -0
  207. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-postgres.js.map +1 -0
  208. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-progress-postgres.d.ts +41 -0
  209. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-progress-postgres.d.ts.map +1 -0
  210. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-progress-postgres.js +230 -0
  211. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-progress-postgres.js.map +1 -0
  212. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-postgres.d.ts +20 -0
  213. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-postgres.d.ts.map +1 -0
  214. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-postgres.js +126 -0
  215. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-postgres.js.map +1 -0
  216. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-sources.d.ts +8 -0
  217. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-sources.d.ts.map +1 -0
  218. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-sources.js +86 -0
  219. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-sources.js.map +1 -0
  220. package/node_modules/@noodle-borg/service/dist/platform-auth-migration-postgres.d.ts +42 -0
  221. package/node_modules/@noodle-borg/service/dist/platform-auth-migration-postgres.d.ts.map +1 -0
  222. package/node_modules/@noodle-borg/service/dist/platform-auth-migration-postgres.js +368 -0
  223. package/node_modules/@noodle-borg/service/dist/platform-auth-migration-postgres.js.map +1 -0
  224. package/node_modules/@noodle-borg/service/dist/platform-auth-migration-runs-postgres.d.ts +86 -0
  225. package/node_modules/@noodle-borg/service/dist/platform-auth-migration-runs-postgres.d.ts.map +1 -0
  226. package/node_modules/@noodle-borg/service/dist/platform-auth-migration-runs-postgres.js +474 -0
  227. package/node_modules/@noodle-borg/service/dist/platform-auth-migration-runs-postgres.js.map +1 -0
  228. package/node_modules/@noodle-borg/service/dist/platform-auth-migration-schema.d.ts +17 -0
  229. package/node_modules/@noodle-borg/service/dist/platform-auth-migration-schema.d.ts.map +1 -0
  230. package/node_modules/@noodle-borg/service/dist/platform-auth-migration-schema.js +435 -0
  231. package/node_modules/@noodle-borg/service/dist/platform-auth-migration-schema.js.map +1 -0
  232. package/node_modules/@noodle-borg/service/dist/platform-auth-migration.d.ts +202 -0
  233. package/node_modules/@noodle-borg/service/dist/platform-auth-migration.d.ts.map +1 -0
  234. package/node_modules/@noodle-borg/service/dist/platform-auth-migration.js +313 -0
  235. package/node_modules/@noodle-borg/service/dist/platform-auth-migration.js.map +1 -0
  236. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-batches.d.ts +48 -0
  237. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-batches.d.ts.map +1 -0
  238. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-batches.js +158 -0
  239. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-batches.js.map +1 -0
  240. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-effects.d.ts +43 -0
  241. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-effects.d.ts.map +1 -0
  242. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-effects.js +92 -0
  243. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-effects.js.map +1 -0
  244. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-operation-postgres.d.ts +31 -0
  245. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-operation-postgres.d.ts.map +1 -0
  246. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-operation-postgres.js +94 -0
  247. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-operation-postgres.js.map +1 -0
  248. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-ports.d.ts +102 -0
  249. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-ports.d.ts.map +1 -0
  250. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-ports.js +2 -0
  251. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-ports.js.map +1 -0
  252. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-postgres.d.ts +17 -0
  253. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-postgres.d.ts.map +1 -0
  254. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-postgres.js +367 -0
  255. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-postgres.js.map +1 -0
  256. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-remote-status.d.ts +10 -0
  257. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-remote-status.d.ts.map +1 -0
  258. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-remote-status.js +37 -0
  259. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-remote-status.js.map +1 -0
  260. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-rollout.d.ts +36 -0
  261. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-rollout.d.ts.map +1 -0
  262. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-rollout.js +156 -0
  263. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-rollout.js.map +1 -0
  264. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-schema.d.ts +4 -0
  265. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-schema.d.ts.map +1 -0
  266. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-schema.js +162 -0
  267. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-schema.js.map +1 -0
  268. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-state-postgres.d.ts +92 -0
  269. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-state-postgres.d.ts.map +1 -0
  270. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-state-postgres.js +271 -0
  271. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-state-postgres.js.map +1 -0
  272. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-state-support.d.ts +13 -0
  273. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-state-support.d.ts.map +1 -0
  274. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-state-support.js +67 -0
  275. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-state-support.js.map +1 -0
  276. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-support.d.ts +15 -0
  277. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-support.d.ts.map +1 -0
  278. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-support.js +47 -0
  279. package/node_modules/@noodle-borg/service/dist/platform-auth-operator-support.js.map +1 -0
  280. package/node_modules/@noodle-borg/service/dist/platform-auth-operator.d.ts +1569 -0
  281. package/node_modules/@noodle-borg/service/dist/platform-auth-operator.d.ts.map +1 -0
  282. package/node_modules/@noodle-borg/service/dist/platform-auth-operator.js +274 -0
  283. package/node_modules/@noodle-borg/service/dist/platform-auth-operator.js.map +1 -0
  284. package/node_modules/@noodle-borg/service/dist/platform-auth-remote-verification-postgres-support.d.ts +41 -0
  285. package/node_modules/@noodle-borg/service/dist/platform-auth-remote-verification-postgres-support.d.ts.map +1 -0
  286. package/node_modules/@noodle-borg/service/dist/platform-auth-remote-verification-postgres-support.js +163 -0
  287. package/node_modules/@noodle-borg/service/dist/platform-auth-remote-verification-postgres-support.js.map +1 -0
  288. package/node_modules/@noodle-borg/service/dist/platform-auth-remote-verification-postgres.d.ts +34 -0
  289. package/node_modules/@noodle-borg/service/dist/platform-auth-remote-verification-postgres.d.ts.map +1 -0
  290. package/node_modules/@noodle-borg/service/dist/platform-auth-remote-verification-postgres.js +274 -0
  291. package/node_modules/@noodle-borg/service/dist/platform-auth-remote-verification-postgres.js.map +1 -0
  292. package/node_modules/@noodle-borg/service/dist/platform-auth-remote-verification-schema.d.ts +3 -0
  293. package/node_modules/@noodle-borg/service/dist/platform-auth-remote-verification-schema.d.ts.map +1 -0
  294. package/node_modules/@noodle-borg/service/dist/platform-auth-remote-verification-schema.js +120 -0
  295. package/node_modules/@noodle-borg/service/dist/platform-auth-remote-verification-schema.js.map +1 -0
  296. package/node_modules/@noodle-borg/service/dist/platform-auth-remote-verification.d.ts +79 -0
  297. package/node_modules/@noodle-borg/service/dist/platform-auth-remote-verification.d.ts.map +1 -0
  298. package/node_modules/@noodle-borg/service/dist/platform-auth-remote-verification.js +88 -0
  299. package/node_modules/@noodle-borg/service/dist/platform-auth-remote-verification.js.map +1 -0
  300. package/node_modules/@noodle-borg/service/dist/platform-auth-rollback-guard.d.ts +6 -0
  301. package/node_modules/@noodle-borg/service/dist/platform-auth-rollback-guard.d.ts.map +1 -0
  302. package/node_modules/@noodle-borg/service/dist/platform-auth-rollback-guard.js +38 -0
  303. package/node_modules/@noodle-borg/service/dist/platform-auth-rollback-guard.js.map +1 -0
  304. package/node_modules/@noodle-borg/service/dist/platform-auth-rollout-postgres.d.ts +61 -0
  305. package/node_modules/@noodle-borg/service/dist/platform-auth-rollout-postgres.d.ts.map +1 -0
  306. package/node_modules/@noodle-borg/service/dist/platform-auth-rollout-postgres.js +292 -0
  307. package/node_modules/@noodle-borg/service/dist/platform-auth-rollout-postgres.js.map +1 -0
  308. package/node_modules/@noodle-borg/service/dist/platform-auth-rollout-readiness-postgres.d.ts +19 -0
  309. package/node_modules/@noodle-borg/service/dist/platform-auth-rollout-readiness-postgres.d.ts.map +1 -0
  310. package/node_modules/@noodle-borg/service/dist/platform-auth-rollout-readiness-postgres.js +121 -0
  311. package/node_modules/@noodle-borg/service/dist/platform-auth-rollout-readiness-postgres.js.map +1 -0
  312. package/node_modules/@noodle-borg/service/dist/platform-auth-rollout-support.d.ts +119 -0
  313. package/node_modules/@noodle-borg/service/dist/platform-auth-rollout-support.d.ts.map +1 -0
  314. package/node_modules/@noodle-borg/service/dist/platform-auth-rollout-support.js +194 -0
  315. package/node_modules/@noodle-borg/service/dist/platform-auth-rollout-support.js.map +1 -0
  316. package/node_modules/@noodle-borg/service/dist/platform-auth-runtime.d.ts +36 -0
  317. package/node_modules/@noodle-borg/service/dist/platform-auth-runtime.d.ts.map +1 -0
  318. package/node_modules/@noodle-borg/service/dist/platform-auth-runtime.js +93 -0
  319. package/node_modules/@noodle-borg/service/dist/platform-auth-runtime.js.map +1 -0
  320. package/node_modules/@noodle-borg/service/dist/platform-auth-service-bootstrap.d.ts +32 -0
  321. package/node_modules/@noodle-borg/service/dist/platform-auth-service-bootstrap.d.ts.map +1 -0
  322. package/node_modules/@noodle-borg/service/dist/platform-auth-service-bootstrap.js +68 -0
  323. package/node_modules/@noodle-borg/service/dist/platform-auth-service-bootstrap.js.map +1 -0
  324. package/node_modules/@noodle-borg/service/dist/platform-identity-maintenance.d.ts +36 -0
  325. package/node_modules/@noodle-borg/service/dist/platform-identity-maintenance.d.ts.map +1 -0
  326. package/node_modules/@noodle-borg/service/dist/platform-identity-maintenance.js +92 -0
  327. package/node_modules/@noodle-borg/service/dist/platform-identity-maintenance.js.map +1 -0
  328. package/node_modules/@noodle-borg/service/dist/platform-identity-postgres.d.ts +23 -0
  329. package/node_modules/@noodle-borg/service/dist/platform-identity-postgres.d.ts.map +1 -0
  330. package/node_modules/@noodle-borg/service/dist/platform-identity-postgres.js +231 -0
  331. package/node_modules/@noodle-borg/service/dist/platform-identity-postgres.js.map +1 -0
  332. package/node_modules/@noodle-borg/service/dist/platform-identity-schema-postgres.d.ts +13 -0
  333. package/node_modules/@noodle-borg/service/dist/platform-identity-schema-postgres.d.ts.map +1 -0
  334. package/node_modules/@noodle-borg/service/dist/platform-identity-schema-postgres.js +399 -0
  335. package/node_modules/@noodle-borg/service/dist/platform-identity-schema-postgres.js.map +1 -0
  336. package/node_modules/@noodle-borg/service/dist/platform-identity-sync-enqueue.d.ts +18 -0
  337. package/node_modules/@noodle-borg/service/dist/platform-identity-sync-enqueue.d.ts.map +1 -0
  338. package/node_modules/@noodle-borg/service/dist/platform-identity-sync-enqueue.js +25 -0
  339. package/node_modules/@noodle-borg/service/dist/platform-identity-sync-enqueue.js.map +1 -0
  340. package/node_modules/@noodle-borg/service/dist/platform-identity-sync-evidence-postgres.d.ts +15 -0
  341. package/node_modules/@noodle-borg/service/dist/platform-identity-sync-evidence-postgres.d.ts.map +1 -0
  342. package/node_modules/@noodle-borg/service/dist/platform-identity-sync-evidence-postgres.js +74 -0
  343. package/node_modules/@noodle-borg/service/dist/platform-identity-sync-evidence-postgres.js.map +1 -0
  344. package/node_modules/@noodle-borg/service/dist/platform-identity-sync-postgres.d.ts +19 -0
  345. package/node_modules/@noodle-borg/service/dist/platform-identity-sync-postgres.d.ts.map +1 -0
  346. package/node_modules/@noodle-borg/service/dist/platform-identity-sync-postgres.js +249 -0
  347. package/node_modules/@noodle-borg/service/dist/platform-identity-sync-postgres.js.map +1 -0
  348. package/node_modules/@noodle-borg/service/dist/platform-identity-sync-recovery-postgres.d.ts +34 -0
  349. package/node_modules/@noodle-borg/service/dist/platform-identity-sync-recovery-postgres.d.ts.map +1 -0
  350. package/node_modules/@noodle-borg/service/dist/platform-identity-sync-recovery-postgres.js +275 -0
  351. package/node_modules/@noodle-borg/service/dist/platform-identity-sync-recovery-postgres.js.map +1 -0
  352. package/node_modules/@noodle-borg/service/dist/platform-identity-sync.d.ts +98 -0
  353. package/node_modules/@noodle-borg/service/dist/platform-identity-sync.d.ts.map +1 -0
  354. package/node_modules/@noodle-borg/service/dist/platform-identity-sync.js +179 -0
  355. package/node_modules/@noodle-borg/service/dist/platform-identity-sync.js.map +1 -0
  356. package/node_modules/@noodle-borg/service/dist/platform-identity.d.ts +110 -0
  357. package/node_modules/@noodle-borg/service/dist/platform-identity.d.ts.map +1 -0
  358. package/node_modules/@noodle-borg/service/dist/platform-identity.js +312 -0
  359. package/node_modules/@noodle-borg/service/dist/platform-identity.js.map +1 -0
  360. package/node_modules/@noodle-borg/service/dist/routes/auth-discovery.d.ts +6 -0
  361. package/node_modules/@noodle-borg/service/dist/routes/auth-discovery.d.ts.map +1 -0
  362. package/node_modules/@noodle-borg/service/dist/routes/auth-discovery.js +36 -0
  363. package/node_modules/@noodle-borg/service/dist/routes/auth-discovery.js.map +1 -0
  364. package/node_modules/@noodle-borg/service/dist/routes/billing-read.d.ts.map +1 -1
  365. package/node_modules/@noodle-borg/service/dist/routes/billing-read.js +3 -9
  366. package/node_modules/@noodle-borg/service/dist/routes/billing-read.js.map +1 -1
  367. package/node_modules/@noodle-borg/service/dist/routes/billing-stripe.d.ts.map +1 -1
  368. package/node_modules/@noodle-borg/service/dist/routes/billing-stripe.js +3 -3
  369. package/node_modules/@noodle-borg/service/dist/routes/billing-stripe.js.map +1 -1
  370. package/node_modules/@noodle-borg/service/dist/routes/github-run-claim.d.ts.map +1 -1
  371. package/node_modules/@noodle-borg/service/dist/routes/github-run-claim.js +3 -1
  372. package/node_modules/@noodle-borg/service/dist/routes/github-run-claim.js.map +1 -1
  373. package/node_modules/@noodle-borg/service/dist/routes/platform-auth-migration-dispatch.d.ts +8 -0
  374. package/node_modules/@noodle-borg/service/dist/routes/platform-auth-migration-dispatch.d.ts.map +1 -0
  375. package/node_modules/@noodle-borg/service/dist/routes/platform-auth-migration-dispatch.js +40 -0
  376. package/node_modules/@noodle-borg/service/dist/routes/platform-auth-migration-dispatch.js.map +1 -0
  377. package/node_modules/@noodle-borg/service/dist/routes/platform-auth-migration.d.ts +13 -0
  378. package/node_modules/@noodle-borg/service/dist/routes/platform-auth-migration.d.ts.map +1 -0
  379. package/node_modules/@noodle-borg/service/dist/routes/platform-auth-migration.js +158 -0
  380. package/node_modules/@noodle-borg/service/dist/routes/platform-auth-migration.js.map +1 -0
  381. package/node_modules/@noodle-borg/service/dist/serve-options.d.ts +21 -3
  382. package/node_modules/@noodle-borg/service/dist/serve-options.d.ts.map +1 -1
  383. package/node_modules/@noodle-borg/service/dist/serve.d.ts.map +1 -1
  384. package/node_modules/@noodle-borg/service/dist/serve.js +61 -146
  385. package/node_modules/@noodle-borg/service/dist/serve.js.map +1 -1
  386. package/node_modules/@noodle-borg/service/dist/service-resource-cleanup.d.ts +1 -0
  387. package/node_modules/@noodle-borg/service/dist/service-resource-cleanup.d.ts.map +1 -1
  388. package/node_modules/@noodle-borg/service/dist/service-resource-cleanup.js +3 -0
  389. package/node_modules/@noodle-borg/service/dist/service-resource-cleanup.js.map +1 -1
  390. package/node_modules/@noodle-borg/service/dist/service.d.ts.map +1 -1
  391. package/node_modules/@noodle-borg/service/dist/service.js +17 -29
  392. package/node_modules/@noodle-borg/service/dist/service.js.map +1 -1
  393. package/node_modules/@noodle-borg/service/dist/store/control-plane.d.ts.map +1 -1
  394. package/node_modules/@noodle-borg/service/dist/store/control-plane.js +60 -19
  395. package/node_modules/@noodle-borg/service/dist/store/control-plane.js.map +1 -1
  396. package/node_modules/@noodle-borg/service/dist/store/postgres-control-plane.d.ts +1 -2
  397. package/node_modules/@noodle-borg/service/dist/store/postgres-control-plane.d.ts.map +1 -1
  398. package/node_modules/@noodle-borg/service/dist/store/postgres-control-plane.js +0 -40
  399. package/node_modules/@noodle-borg/service/dist/store/postgres-control-plane.js.map +1 -1
  400. package/node_modules/@noodle-borg/service/dist/store/postgres-personal-workspace.d.ts +5 -0
  401. package/node_modules/@noodle-borg/service/dist/store/postgres-personal-workspace.d.ts.map +1 -0
  402. package/node_modules/@noodle-borg/service/dist/store/postgres-personal-workspace.js +176 -0
  403. package/node_modules/@noodle-borg/service/dist/store/postgres-personal-workspace.js.map +1 -0
  404. package/node_modules/@noodle-borg/service/dist/store/postgres-schema.d.ts +2 -0
  405. package/node_modules/@noodle-borg/service/dist/store/postgres-schema.d.ts.map +1 -1
  406. package/node_modules/@noodle-borg/service/dist/store/postgres-schema.js +43 -1
  407. package/node_modules/@noodle-borg/service/dist/store/postgres-schema.js.map +1 -1
  408. package/node_modules/@noodle-borg/service/dist/store/postgres-signup.js +2 -1
  409. package/node_modules/@noodle-borg/service/dist/store/postgres-signup.js.map +1 -1
  410. package/node_modules/@noodle-borg/service/dist/workos-directory.d.ts +71 -0
  411. package/node_modules/@noodle-borg/service/dist/workos-directory.d.ts.map +1 -0
  412. package/node_modules/@noodle-borg/service/dist/workos-directory.js +175 -0
  413. package/node_modules/@noodle-borg/service/dist/workos-directory.js.map +1 -0
  414. package/node_modules/@noodle-borg/service/package.json +1 -0
  415. package/node_modules/@workos-inc/node/LICENSE +21 -0
  416. package/node_modules/@workos-inc/node/README.md +140 -0
  417. package/node_modules/@workos-inc/node/lib/factory-B8vTFojy.d.cts +9727 -0
  418. package/node_modules/@workos-inc/node/lib/factory-B8vTFojy.d.mts +9727 -0
  419. package/node_modules/@workos-inc/node/lib/factory-CoKXdPX2.cjs +8426 -0
  420. package/node_modules/@workos-inc/node/lib/factory-CoKXdPX2.cjs.map +1 -0
  421. package/node_modules/@workos-inc/node/lib/factory-MKPb5Egh.mjs +8241 -0
  422. package/node_modules/@workos-inc/node/lib/factory-MKPb5Egh.mjs.map +1 -0
  423. package/node_modules/@workos-inc/node/lib/index.cjs +449 -0
  424. package/node_modules/@workos-inc/node/lib/index.cjs.map +1 -0
  425. package/node_modules/@workos-inc/node/lib/index.d.cts +478 -0
  426. package/node_modules/@workos-inc/node/lib/index.d.mts +478 -0
  427. package/node_modules/@workos-inc/node/lib/index.mjs +394 -0
  428. package/node_modules/@workos-inc/node/lib/index.mjs.map +1 -0
  429. package/node_modules/@workos-inc/node/lib/index.worker.cjs +60 -0
  430. package/node_modules/@workos-inc/node/lib/index.worker.cjs.map +1 -0
  431. package/node_modules/@workos-inc/node/lib/index.worker.d.cts +16 -0
  432. package/node_modules/@workos-inc/node/lib/index.worker.d.mts +16 -0
  433. package/node_modules/@workos-inc/node/lib/index.worker.mjs +35 -0
  434. package/node_modules/@workos-inc/node/lib/index.worker.mjs.map +1 -0
  435. package/node_modules/@workos-inc/node/lib/webapi-BgpV54gi.mjs +3224 -0
  436. package/node_modules/@workos-inc/node/lib/webapi-BgpV54gi.mjs.map +1 -0
  437. package/node_modules/@workos-inc/node/lib/webapi-BzGFatFp.cjs +3271 -0
  438. package/node_modules/@workos-inc/node/lib/webapi-BzGFatFp.cjs.map +1 -0
  439. package/node_modules/@workos-inc/node/package.json +96 -0
  440. package/package.json +2 -1
@@ -0,0 +1,38 @@
1
+ import { PlatformAuthOperationPreviewSchema, PlatformAuthOperatorError, } from './platform-auth-operator.js';
2
+ import { platformAuthPreviewTarget } from './platform-auth-operator-rollout.js';
3
+ /** Prevent an ordinary provider rollback from selecting Google after its human authenticator is removed. */
4
+ export function guardPlatformAuthRollback(operator, options) {
5
+ return options.googleHumanAuthAvailable ? operator : new RollbackUnavailableOperator(operator);
6
+ }
7
+ class RollbackUnavailableOperator {
8
+ #operator;
9
+ constructor(operator) {
10
+ this.#operator = operator;
11
+ }
12
+ inventory(input) {
13
+ return this.#operator.inventory(input);
14
+ }
15
+ status() {
16
+ return this.#operator.status();
17
+ }
18
+ async preview(input) {
19
+ if (input.operation !== 'rollback')
20
+ return this.#operator.preview(input);
21
+ const snapshot = await this.#operator.status();
22
+ return PlatformAuthOperationPreviewSchema.parse({
23
+ ...snapshot,
24
+ operation: input.operation,
25
+ ready: false,
26
+ previewChecksum: null,
27
+ blockers: [{ code: 'rollout_transition_invalid', count: 1 }],
28
+ target: platformAuthPreviewTarget(input, snapshot.rollout),
29
+ });
30
+ }
31
+ async execute(input) {
32
+ if (input.operation === 'rollback') {
33
+ throw new PlatformAuthOperatorError('rollout_transition_invalid');
34
+ }
35
+ return this.#operator.execute(input);
36
+ }
37
+ }
38
+ //# sourceMappingURL=platform-auth-rollback-guard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-auth-rollback-guard.js","sourceRoot":"","sources":["../src/platform-auth-rollback-guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kCAAkC,EAGlC,yBAAyB,GAG1B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AyB,CAAC,4BAA4B,CAAC,CAAC;QACpE,CAAC;QACD,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;CACF"}
@@ -0,0 +1,61 @@
1
+ import { type BuildInfo } from './build-info.js';
2
+ import { type WorkOSConfigurationIdentity } from './platform-auth-configuration.js';
3
+ import type { PlatformAuthRemoteVerificationStore } from './platform-auth-remote-verification.js';
4
+ import { type CohortInput, type PlatformAuthRolloutSafeResult } from './platform-auth-rollout-support.js';
5
+ import type { PlatformIdentityQueryable } from './platform-identity-postgres.js';
6
+ export type { PlatformAuthRolloutSafeResult } from './platform-auth-rollout-support.js';
7
+ type Connection = PlatformIdentityQueryable & {
8
+ release?: () => void;
9
+ };
10
+ type Pool = PlatformIdentityQueryable & {
11
+ connect?: () => Promise<Connection>;
12
+ };
13
+ export type PlatformAuthRolloutPreviewInput = CohortInput & {
14
+ /** Completed inventory run whose frozen candidates this operation controls. */
15
+ readonly inventoryRunId: string;
16
+ readonly inventoryChecksum: string;
17
+ /** Import/reconcile run that owns the WorkOS ledger rows. */
18
+ readonly importRunId: string;
19
+ readonly importLineageChecksum: string;
20
+ /** WorkOS environment/organization realm. Never stored in cleartext by this control plane. */
21
+ readonly workosRealm: string;
22
+ };
23
+ export type PlatformAuthRolloutMutationInput = PlatformAuthRolloutPreviewInput & {
24
+ readonly expectedGeneration: number;
25
+ readonly idempotencyKey: string;
26
+ readonly previewChecksum: string;
27
+ readonly actorFingerprint: string;
28
+ /** Stable caller request fingerprint used only for cross-ledger crash recovery. */
29
+ readonly replayRequestFingerprint?: string;
30
+ };
31
+ export interface PlatformAuthRolloutReplayInput {
32
+ readonly idempotencyKey: string;
33
+ readonly requestFingerprint: string;
34
+ }
35
+ export interface PlatformAuthRolloutLineage {
36
+ readonly inventoryRunId: string;
37
+ readonly inventoryChecksum: string;
38
+ readonly importRunId: string;
39
+ readonly importLineageChecksum: string;
40
+ }
41
+ /** Provider-neutral Postgres rollout control; provider calls stay outside this digest-only store. */
42
+ export declare class PostgresPlatformAuthRolloutStore {
43
+ #private;
44
+ constructor(pool: Pool, options?: {
45
+ readonly buildInfo?: BuildInfo;
46
+ readonly now?: () => Date;
47
+ readonly workos?: WorkOSConfigurationIdentity;
48
+ readonly remoteVerificationStore?: Pick<PlatformAuthRemoteVerificationStore, 'readiness'>;
49
+ });
50
+ status(): Promise<PlatformAuthRolloutSafeResult>;
51
+ /** Internal durable lineage for emergency rollback after newer inventory generations appear. */
52
+ boundLineage(): Promise<PlatformAuthRolloutLineage | undefined>;
53
+ preview(input: PlatformAuthRolloutPreviewInput): Promise<{
54
+ readonly generation: number;
55
+ readonly checksum: string;
56
+ }>;
57
+ /** Read-only exact replay used to close the crash window between this store and its operator ledger. */
58
+ replayMutation(input: PlatformAuthRolloutReplayInput): Promise<PlatformAuthRolloutSafeResult | undefined>;
59
+ mutate(input: PlatformAuthRolloutMutationInput): Promise<PlatformAuthRolloutSafeResult>;
60
+ }
61
+ //# sourceMappingURL=platform-auth-rollout-postgres.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-auth-rollout-postgres.d.ts","sourceRoot":"","sources":["../src/platform-auth-rollout-postgres.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAoB,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAKL,KAAK,2BAA2B,EACjC,MAAM,kCAAkC,CAAC;AAE1C,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,wCAAwC,CAAC;AAQlG,OAAO,EAEL,KAAK,WAAW,EAOhB,KAAK,6BAA6B,EASnC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAEjF,YAAY,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAExF,KAAK,UAAU,GAAG,yBAAyB,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC;AACv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AC,EAAE,MAAM,IAAI,CAAC;QAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,2BAA2B,CAAC;QAC9C,QAAQ,CAAC,uBAAuB,CAAC,EAAE,IAAI,CAAC,mCAAmC,EAAE,WAAW,CAAC,CAAC;KACtF;IASF,MAAM,IAAI,OAAO,CAAC,6BAA6B,CAAC;IAItD,gGAAgG;IAC1F,YAAY,IAAI,OAAO,CAAC,0BAA0B,GAAG,SAAS,CAAC;IAmC/D,OAAO,CAAC,KAAK,EAAE,+BAA+B,GAAG,OAAO,CAAC;QAC7D,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;QAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;KAC3B,CAAC;IAyEF,wGAAwG;IAClG,cAAc,CAClB,KAAK,EAAE,8BAA8B,GACpC,OAAO,CAAC,6BAA6B,GAAG,SAAS,CAAC;IAkB/C,MAAM,CAAC,KAAK,EAAE,gCAAgC,GAAG,OAAO,CAAC,6BAA6B,CAAC;CAoP9F"}
@@ -0,0 +1,292 @@
1
+ import { resolveBuildInfo } from './build-info.js';
2
+ import { configurationBoundPreviewRequest, resolveWorkOSRolloutConfigurationFingerprints, } from './platform-auth-configuration.js';
3
+ import { PlatformAuthMigrationError } from './platform-auth-migration.js';
4
+ import { assertPlatformAuthRemoteVerificationReady, loadPlatformAuthRolloutAggregate, loadPlatformAuthRolloutLineage, lockPlatformAuthFinalizationInputs, platformAuthFinalizationCandidatesReady, } from './platform-auth-rollout-readiness-postgres.js';
5
+ import { assertSha, decodeSafeState, effectiveCohorts, hash, lineageMatches, nextState, platformAuthRolloutRequiresReadiness, previewMatches, safeState, sorted, validateFinalize, validateTransition, validLineageId, validOperatorFingerprint, } from './platform-auth-rollout-support.js';
6
+ /** Provider-neutral Postgres rollout control; provider calls stay outside this digest-only store. */
7
+ export class PostgresPlatformAuthRolloutStore {
8
+ #pool;
9
+ #gitSha;
10
+ #now;
11
+ #workos;
12
+ #remoteVerificationStore;
13
+ constructor(pool, options = {}) {
14
+ this.#pool = pool;
15
+ this.#gitSha = (options.buildInfo ?? resolveBuildInfo()).gitSha;
16
+ this.#now = options.now ?? (() => new Date());
17
+ this.#workos = options.workos;
18
+ this.#remoteVerificationStore = options.remoteVerificationStore;
19
+ }
20
+ async status() {
21
+ return safeState(await this.#readState(this.#pool, false));
22
+ }
23
+ /** Internal durable lineage for emergency rollback after newer inventory generations appear. */
24
+ async boundLineage() {
25
+ const result = await this.#pool.query(`SELECT rollout_inventory_run_id, rollout_inventory_checksum,
26
+ rollout_import_run_id, rollout_import_lineage_checksum
27
+ FROM platform_auth_rollout_state WHERE singleton = true`);
28
+ const row = result.rows[0];
29
+ if (row === undefined)
30
+ throw new PlatformAuthMigrationError('finalize_precondition_failed');
31
+ const values = [
32
+ row.rollout_inventory_run_id,
33
+ row.rollout_inventory_checksum,
34
+ row.rollout_import_run_id,
35
+ row.rollout_import_lineage_checksum,
36
+ ];
37
+ if (values.every((value) => value === null))
38
+ return undefined;
39
+ if (!validLineageId(row.rollout_inventory_run_id ?? '') ||
40
+ !/^[0-9a-f]{64}$/.test(row.rollout_inventory_checksum ?? '') ||
41
+ !validLineageId(row.rollout_import_run_id ?? '') ||
42
+ !/^[0-9a-f]{64}$/.test(row.rollout_import_lineage_checksum ?? ''))
43
+ throw new PlatformAuthMigrationError('rollout_transition_invalid');
44
+ return {
45
+ inventoryRunId: row.rollout_inventory_run_id,
46
+ inventoryChecksum: row.rollout_inventory_checksum,
47
+ importRunId: row.rollout_import_run_id,
48
+ importLineageChecksum: row.rollout_import_lineage_checksum,
49
+ };
50
+ }
51
+ async preview(input) {
52
+ this.#assertRunningSha(input.releaseSha);
53
+ const state = await this.#readState(this.#pool, false);
54
+ const effective = effectiveCohorts(state, input);
55
+ validateTransition(state, effective, this.#now());
56
+ const requiresReady = platformAuthRolloutRequiresReadiness(state, effective);
57
+ const configuration = this.#configuration(state, effective, input.workosRealm);
58
+ const lineage = await loadPlatformAuthRolloutLineage(this.#pool, input, requiresReady);
59
+ const aggregate = await loadPlatformAuthRolloutAggregate(this.#pool, lineage);
60
+ const candidatesReady = requiresReady
61
+ ? await platformAuthFinalizationCandidatesReady(this.#pool, lineage)
62
+ : true;
63
+ if (requiresReady &&
64
+ (aggregate.unresolvedImports !== 0 ||
65
+ aggregate.pendingOutbox !== 0 ||
66
+ aggregate.candidates === 0 ||
67
+ aggregate.inventoryBlockers !== 0 ||
68
+ !candidatesReady))
69
+ throw new PlatformAuthMigrationError('finalize_precondition_failed');
70
+ if (requiresReady)
71
+ await assertPlatformAuthRemoteVerificationReady(this.#remoteVerificationStore, lineage, this.#now());
72
+ if (input.operation === 'finalize')
73
+ validateFinalize(state, effective, aggregate, candidatesReady, this.#now());
74
+ const request = configurationBoundPreviewRequest(state, aggregate, lineage, effective, configuration);
75
+ const checksum = hash(request);
76
+ await this.#pool.query(`INSERT INTO platform_auth_rollout_previews
77
+ (checksum, expected_generation, operation, percentage, cohort_mode,
78
+ canary_client_set_hash, canary_client_count, recovery_client_set_hash,
79
+ recovery_client_count, release_sha, inventory_run_hash, inventory_checksum,
80
+ import_run_hash, import_lineage_checksum, workos_realm_fingerprint,
81
+ workos_client_fingerprint, rollback_rehearsal_checksum,
82
+ staging_workos_only_smoke_checksum, aggregate_checksum, expires_at)
83
+ VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19,
84
+ now() + interval '15 minutes')
85
+ ON CONFLICT (checksum) DO NOTHING`, [
86
+ checksum,
87
+ state.generation,
88
+ input.operation,
89
+ input.percentage,
90
+ input.cohortMode,
91
+ hash(effective.canaryClientIds),
92
+ effective.canaryClientIds.length,
93
+ hash(effective.recoveryClientIds),
94
+ effective.recoveryClientIds.length,
95
+ input.releaseSha,
96
+ lineage.inventoryRunHash,
97
+ lineage.inventoryChecksum,
98
+ lineage.importRunHash,
99
+ lineage.importLineageChecksum,
100
+ lineage.workosRealmFingerprint,
101
+ configuration?.client ?? null,
102
+ effective.operation === 'finalize' ? effective.rollbackRehearsalChecksum : null,
103
+ effective.operation === 'finalize' ? effective.stagingWorkosOnlySmokeChecksum : null,
104
+ hash(aggregate),
105
+ ]);
106
+ return { generation: state.generation, checksum };
107
+ }
108
+ /** Read-only exact replay used to close the crash window between this store and its operator ledger. */
109
+ async replayMutation(input) {
110
+ if (!/^[0-9a-f]{64}$/.test(input.requestFingerprint))
111
+ throw new PlatformAuthMigrationError('rollout_transition_invalid');
112
+ const replay = await this.#pool.query(`SELECT replay_request_fingerprint, applied_state FROM platform_auth_rollout_evidence_v2
113
+ WHERE idempotency_key_hash = $1`, [hash(input.idempotencyKey)]);
114
+ const row = replay.rows[0];
115
+ if (row === undefined)
116
+ return undefined;
117
+ if (row.replay_request_fingerprint !== input.requestFingerprint)
118
+ throw new PlatformAuthMigrationError('idempotency_conflict');
119
+ return decodeSafeState(row.applied_state);
120
+ }
121
+ async mutate(input) {
122
+ this.#assertRunningSha(input.releaseSha);
123
+ if (!validOperatorFingerprint(input.actorFingerprint))
124
+ throw new PlatformAuthMigrationError('rollout_transition_invalid');
125
+ const requestFingerprint = hash({ ...input, idempotencyKey: undefined });
126
+ const replayRequestFingerprint = input.replayRequestFingerprint ?? requestFingerprint;
127
+ if (!/^[0-9a-f]{64}$/.test(replayRequestFingerprint))
128
+ throw new PlatformAuthMigrationError('rollout_transition_invalid');
129
+ const idempotencyHash = hash(input.idempotencyKey);
130
+ const connection = this.#pool.connect === undefined ? this.#pool : await this.#pool.connect();
131
+ try {
132
+ await connection.query('BEGIN');
133
+ await connection.query('SELECT pg_advisory_xact_lock(hashtextextended($1, 0))', [
134
+ `platform-auth-rollout-idempotency:${idempotencyHash}`,
135
+ ]);
136
+ // Exact replay is deliberately before generation validation, so a retry survives later changes.
137
+ const replay = await connection.query(`SELECT request_fingerprint, applied_state FROM platform_auth_rollout_evidence_v2
138
+ WHERE idempotency_key_hash = $1 FOR UPDATE`, [idempotencyHash]);
139
+ if (replay.rows[0] !== undefined) {
140
+ if (replay.rows[0].request_fingerprint !== requestFingerprint)
141
+ throw new PlatformAuthMigrationError('idempotency_conflict');
142
+ const replayed = decodeSafeState(replay.rows[0].applied_state);
143
+ await connection.query('COMMIT');
144
+ return replayed;
145
+ }
146
+ const state = await this.#readState(connection, true);
147
+ if (state.generation !== input.expectedGeneration)
148
+ throw new PlatformAuthMigrationError('stale_generation');
149
+ const effective = effectiveCohorts(state, input);
150
+ const preview = await connection.query(`SELECT expected_generation, operation, percentage, cohort_mode,
151
+ canary_client_set_hash, canary_client_count,
152
+ recovery_client_set_hash, recovery_client_count,
153
+ rollback_rehearsal_checksum, staging_workos_only_smoke_checksum,
154
+ release_sha, inventory_run_hash, inventory_checksum, import_run_hash,
155
+ import_lineage_checksum, workos_realm_fingerprint, workos_client_fingerprint,
156
+ aggregate_checksum
157
+ FROM platform_auth_rollout_previews
158
+ WHERE checksum = $1 AND expires_at > now() FOR UPDATE`, [input.previewChecksum]);
159
+ const frozen = preview.rows[0];
160
+ if (frozen === undefined ||
161
+ frozen.cohort_mode !== input.cohortMode ||
162
+ !previewMatches(frozen, { ...effective, expectedGeneration: input.expectedGeneration }))
163
+ throw new PlatformAuthMigrationError('preview_mismatch');
164
+ const requiresReady = platformAuthRolloutRequiresReadiness(state, effective);
165
+ if (requiresReady)
166
+ await lockPlatformAuthFinalizationInputs(connection, this.#remoteVerificationStore !== undefined);
167
+ const configuration = this.#configuration(state, effective, input.workosRealm);
168
+ const lineage = await loadPlatformAuthRolloutLineage(connection, input, requiresReady);
169
+ if (!lineageMatches(frozen, lineage) ||
170
+ frozen.workos_client_fingerprint !== (configuration?.client ?? null))
171
+ throw new PlatformAuthMigrationError('preview_mismatch');
172
+ const aggregate = await loadPlatformAuthRolloutAggregate(connection, lineage);
173
+ if (frozen.aggregate_checksum !== hash(aggregate) ||
174
+ input.previewChecksum !==
175
+ hash(configurationBoundPreviewRequest(state, aggregate, lineage, effective, configuration)))
176
+ throw new PlatformAuthMigrationError('preview_mismatch');
177
+ validateTransition(state, effective, this.#now());
178
+ const candidatesReady = requiresReady
179
+ ? await platformAuthFinalizationCandidatesReady(connection, lineage)
180
+ : true;
181
+ if (requiresReady &&
182
+ (aggregate.unresolvedImports !== 0 ||
183
+ aggregate.pendingOutbox !== 0 ||
184
+ aggregate.candidates === 0 ||
185
+ aggregate.inventoryBlockers !== 0 ||
186
+ !candidatesReady))
187
+ throw new PlatformAuthMigrationError('finalize_precondition_failed');
188
+ if (requiresReady)
189
+ await assertPlatformAuthRemoteVerificationReady(this.#remoteVerificationStore, lineage, this.#now());
190
+ if (input.operation === 'finalize') {
191
+ const finalAggregate = await loadPlatformAuthRolloutAggregate(connection, lineage);
192
+ validateFinalize(state, effective, finalAggregate, candidatesReady, this.#now());
193
+ }
194
+ const applied = nextState(state, effective, this.#now());
195
+ const updated = await connection.query(`UPDATE platform_auth_rollout_state
196
+ SET generation = $2, workos_percentage = $3, lifecycle = $4, release_sha = $5,
197
+ workos_canary_client_ids = $6, workos_recovery_client_ids = $7,
198
+ workos_default_since = $8, workos_stage_since = $9,
199
+ workos_client_fingerprint = COALESCE($10, workos_client_fingerprint),
200
+ workos_realm_fingerprint = COALESCE($11, workos_realm_fingerprint),
201
+ rollout_inventory_run_id = $12, rollout_inventory_checksum = $13,
202
+ rollout_import_run_id = $14, rollout_import_lineage_checksum = $15,
203
+ workos_recovery_enabled = $16,
204
+ finalized_at = CASE WHEN $4 = 'finalized' THEN now() ELSE NULL END, updated_at = now()
205
+ WHERE singleton = true AND generation = $1 RETURNING generation`, [
206
+ state.generation,
207
+ applied.generation,
208
+ applied.workosPercentage,
209
+ applied.lifecycle,
210
+ input.releaseSha,
211
+ applied.canaryClientIds,
212
+ applied.recoveryClientIds,
213
+ applied.workosDefaultSince,
214
+ applied.workosStageSince,
215
+ configuration?.client ?? null,
216
+ configuration?.realm ?? null,
217
+ input.inventoryRunId,
218
+ input.inventoryChecksum,
219
+ input.importRunId,
220
+ input.importLineageChecksum,
221
+ applied.workosRecoveryEnabled,
222
+ ]);
223
+ if (updated.rows[0] === undefined)
224
+ throw new PlatformAuthMigrationError('stale_generation');
225
+ await connection.query(`INSERT INTO platform_auth_rollout_evidence_v2
226
+ (idempotency_key_hash, request_fingerprint, replay_request_fingerprint,
227
+ actor_fingerprint, operation, release_sha, preview_checksum, lineage_fingerprint,
228
+ rollback_rehearsal_checksum, staging_workos_only_smoke_checksum,
229
+ prior_state, applied_state)
230
+ VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)`, [
231
+ idempotencyHash,
232
+ requestFingerprint,
233
+ replayRequestFingerprint,
234
+ hash(input.actorFingerprint),
235
+ input.operation,
236
+ input.releaseSha,
237
+ input.previewChecksum,
238
+ hash(lineage),
239
+ effective.operation === 'finalize' ? effective.rollbackRehearsalChecksum : null,
240
+ effective.operation === 'finalize' ? effective.stagingWorkosOnlySmokeChecksum : null,
241
+ JSON.stringify(safeState(state)),
242
+ JSON.stringify(safeState(applied)),
243
+ ]);
244
+ await connection.query('COMMIT');
245
+ return safeState(applied);
246
+ }
247
+ catch (error) {
248
+ await connection.query('ROLLBACK').catch(() => undefined);
249
+ throw error;
250
+ }
251
+ finally {
252
+ connection.release?.();
253
+ }
254
+ }
255
+ #assertRunningSha(releaseSha) {
256
+ assertSha(releaseSha);
257
+ if (releaseSha !== this.#gitSha)
258
+ throw new PlatformAuthMigrationError('release_sha_mismatch');
259
+ }
260
+ async #readState(pool, lock) {
261
+ const result = await pool.query(`SELECT generation, workos_percentage, workos_canary_client_ids,
262
+ workos_recovery_client_ids, workos_recovery_enabled,
263
+ workos_default_since, workos_stage_since, lifecycle,
264
+ workos_client_fingerprint, workos_realm_fingerprint
265
+ FROM platform_auth_rollout_state WHERE singleton = true${lock ? ' FOR UPDATE' : ''}`);
266
+ const row = result.rows[0];
267
+ if (row === undefined)
268
+ throw new PlatformAuthMigrationError('finalize_precondition_failed');
269
+ return {
270
+ generation: Number(row.generation),
271
+ workosPercentage: row.workos_percentage,
272
+ canaryClientIds: sorted(row.workos_canary_client_ids),
273
+ recoveryClientIds: sorted(row.workos_recovery_client_ids),
274
+ workosRecoveryEnabled: row.workos_recovery_enabled,
275
+ workosDefaultSince: row.workos_default_since?.toISOString() ?? null,
276
+ workosStageSince: row.workos_stage_since?.toISOString() ?? null,
277
+ lifecycle: row.lifecycle,
278
+ workosClientFingerprint: row.workos_client_fingerprint,
279
+ workosRealmFingerprint: row.workos_realm_fingerprint,
280
+ };
281
+ }
282
+ #configuration(state, effective, realm) {
283
+ const resolution = resolveWorkOSRolloutConfigurationFingerprints({
284
+ ...state,
285
+ workosRecoveryClientIds: state.recoveryClientIds,
286
+ }, effective, this.#workos, realm);
287
+ if (!resolution.valid)
288
+ throw new PlatformAuthMigrationError('rollout_transition_invalid');
289
+ return resolution.fingerprints;
290
+ }
291
+ }
292
+ //# sourceMappingURL=platform-auth-rollout-postgres.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-auth-rollout-postgres.js","sourceRoot":"","sources":["../src/platform-auth-rollout-postgres.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EACL,gCAAgC,EAChC,6CAA6C,GAI9C,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAE1E,OAAO,EACL,yCAAyC,EACzC,gCAAgC,EAChC,8BAA8B,EAC9B,kCAAkC,EAClC,uCAAuC,GACxC,MAAM,+CAA+C,CAAC;AACvD,OAAO,EACL,SAAS,EAET,eAAe,EACf,gBAAgB,EAChB,IAAI,EACJ,cAAc,EACd,SAAS,EAGT,oCAAoC,EACpC,cAAc,EACd,SAAS,EACT,MAAM,EACN,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,wBAAwB,GACzB,MAAM,oCAAoC,CAAC;AAwC5C,qGAAqG;AACrG,MAAM,OAAO,gCAAgC;IAClC,KAAK,CAAO;IACZ,OAAO,CAAS;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SAAS,EAAE,GAAG,CAAC,SAAS;YACxB,uBAAuB,EAAE,GAAG,CAAC,yBAAyB;YACtD,sBAAsB,EAAE,GAAG,CAAC,wBAAwB;SACrD,CAAC;IACJ,CAAC;IAED,cAAc,CACZ,KAA+B,EAC/B,SAAyF,EACzF,KAAa;QAEb,MAAM,UAAU,GAAG,6CAA6C,CAC9D;YACE,GAAG,KAAK;YACR,uBAAuB,EAAE,KAAK,CAAC,iBAAiB;SACjD,EACD,SAAS,EACT,IAAI,CAAC,OAAO,EACZ,KAAK,CACN,CAAC;QACF,IAAI,CAAC,UAAU,CAAC,KAAK;YAAE,MAAM,IAAI,0BAA0B,CAAC,4BAA4B,CAAC,CAAC;QAC1F,OAAO,UAAU,CAAC,YAAY,CAAC;IACjC,CAAC;CACF"}
@@ -0,0 +1,19 @@
1
+ import { type PlatformAuthRemoteVerificationStore } from './platform-auth-remote-verification.js';
2
+ import { type Aggregate, type Lineage } from './platform-auth-rollout-support.js';
3
+ import type { PlatformIdentityQueryable } from './platform-identity-postgres.js';
4
+ interface RolloutLineageInput {
5
+ readonly operation: 'activate' | 'rollback' | 'finalize';
6
+ readonly inventoryRunId: string;
7
+ readonly inventoryChecksum: string;
8
+ readonly importRunId: string;
9
+ readonly importLineageChecksum: string;
10
+ readonly workosRealm: string;
11
+ readonly releaseSha: string;
12
+ }
13
+ export declare function loadPlatformAuthRolloutLineage(pool: PlatformIdentityQueryable, input: RolloutLineageInput, requireCompletedImport: boolean): Promise<Lineage>;
14
+ export declare function loadPlatformAuthRolloutAggregate(pool: PlatformIdentityQueryable, lineage: Lineage): Promise<Aggregate>;
15
+ export declare function lockPlatformAuthFinalizationInputs(connection: PlatformIdentityQueryable, includeRemoteVerification: boolean): Promise<void>;
16
+ export declare function assertPlatformAuthRemoteVerificationReady(store: Pick<PlatformAuthRemoteVerificationStore, 'readiness'> | undefined, lineage: Lineage, now: Date): Promise<void>;
17
+ export declare function platformAuthFinalizationCandidatesReady(connection: PlatformIdentityQueryable, lineage: Lineage): Promise<boolean>;
18
+ export {};
19
+ //# sourceMappingURL=platform-auth-rollout-readiness-postgres.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-auth-rollout-readiness-postgres.d.ts","sourceRoot":"","sources":["../src/platform-auth-rollout-readiness-postgres.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,mCAAmC,EAEzC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,KAAK,SAAS,EAEd,KAAK,OAAO,EAGb,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAEjF,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,SAAS,EAAE,UAAU,GAAG,UAAU,GAAG,UAAU,CAAC;IACzD,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAsB,8BAA8B,CAClD,IAAI,EAAE,yBAAyB,EAC/B,KAAK,EAAE,mBAAmB,EAC1B,sBAAsB,EAAE,OAAO,GAC9B,OAAO,CAAC,OAAO,CAAC,CAsDlB;AAED,wBAAsB,gCAAgC,CACpD,IAAI,EAAE,yBAAyB,EAC/B,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,SAAS,CAAC,CA2BpB;AAED,wBAAsB,kCAAkC,CACtD,UAAU,EAAE,yBAAyB,EACrC,yBAAyB,EAAE,OAAO,GACjC,OAAO,CAAC,IAAI,CAAC,CASf;AAED,wBAAsB,yCAAyC,CAC7D,KAAK,EAAE,IAAI,CAAC,mCAAmC,EAAE,WAAW,CAAC,GAAG,SAAS,EACzE,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,IAAI,GACR,OAAO,CAAC,IAAI,CAAC,CAUf;AAED,wBAAsB,uCAAuC,CAC3D,UAAU,EAAE,yBAAyB,EACrC,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,OAAO,CAAC,CAsClB"}
@@ -0,0 +1,121 @@
1
+ import { PlatformAuthMigrationError } from './platform-auth-migration.js';
2
+ import { loadFrozenInventory } from './platform-auth-migration-runs-postgres.js';
3
+ import { platformAuthRemoteVerificationFreshAfter, } from './platform-auth-remote-verification.js';
4
+ import { hash, validLineageId, validRealm, } from './platform-auth-rollout-support.js';
5
+ export async function loadPlatformAuthRolloutLineage(pool, input, requireCompletedImport) {
6
+ if (!validLineageId(input.inventoryRunId) ||
7
+ !validLineageId(input.importRunId) ||
8
+ !validRealm(input.workosRealm) ||
9
+ !/^[0-9a-f]{64}$/.test(input.inventoryChecksum) ||
10
+ !/^[0-9a-f]{64}$/.test(input.importLineageChecksum))
11
+ throw new PlatformAuthMigrationError('rollout_transition_invalid');
12
+ const realmFingerprint = hash(input.workosRealm);
13
+ const lineage = {
14
+ inventoryRunId: input.inventoryRunId,
15
+ inventoryRunHash: hash(input.inventoryRunId),
16
+ inventoryChecksum: input.inventoryChecksum,
17
+ importRunId: input.importRunId,
18
+ importRunHash: hash(input.importRunId),
19
+ importLineageChecksum: input.importLineageChecksum,
20
+ workosRealm: input.workosRealm,
21
+ workosRealmFingerprint: realmFingerprint,
22
+ };
23
+ if (input.operation === 'rollback')
24
+ return lineage;
25
+ const frozen = await loadFrozenInventory(pool, {
26
+ inventoryRunId: input.inventoryRunId,
27
+ inventoryChecksum: input.inventoryChecksum,
28
+ releaseSha: input.releaseSha,
29
+ workosRealmFingerprint: realmFingerprint,
30
+ requireBlockerFree: true,
31
+ });
32
+ const imports = await pool.query(`SELECT state, release_sha, inventory_run_id, inventory_checksum,
33
+ workos_realm_fingerprint, lineage_checksum FROM identity_migration_runs
34
+ WHERE id = $1 AND kind IN ('import', 'reconcile') AND state IN ('running', 'completed')`, [input.importRunId]);
35
+ const importRow = imports.rows[0];
36
+ if (importRow === undefined ||
37
+ importRow.release_sha !== input.releaseSha ||
38
+ importRow.inventory_run_id !== input.inventoryRunId ||
39
+ importRow.inventory_checksum !== input.inventoryChecksum ||
40
+ importRow.workos_realm_fingerprint !== realmFingerprint ||
41
+ importRow.lineage_checksum !== input.importLineageChecksum ||
42
+ frozen.lineageChecksum !== input.importLineageChecksum ||
43
+ (requireCompletedImport && importRow.state !== 'completed'))
44
+ throw new PlatformAuthMigrationError('preview_mismatch');
45
+ return lineage;
46
+ }
47
+ export async function loadPlatformAuthRolloutAggregate(pool, lineage) {
48
+ // A transaction client processes one query at a time. Keep these reads sequential so
49
+ // finalization never relies on pg's deprecated concurrent-query queueing behavior.
50
+ const imports = await pool.query("SELECT count(*)::text AS count FROM workos_import_ledger WHERE migration_run_id = $1 AND realm = $2 AND state <> 'linked'", [lineage.importRunId, lineage.workosRealm]);
51
+ const outbox = await pool.query(`SELECT count(*)::text AS count
52
+ FROM platform_identity_sync_outbox outbox
53
+ JOIN platform_auth_inventory_candidates candidate
54
+ ON COALESCE(candidate.principal_id, candidate.source_subject) = outbox.principal_id
55
+ WHERE candidate.migration_run_id = $1 AND outbox.delivered_at IS NULL`, [lineage.inventoryRunId]);
56
+ const inventory = await pool.query(`SELECT count(*)::text AS candidates,
57
+ count(*) FILTER (WHERE cardinality(blocker_codes) > 0)::text AS blockers
58
+ FROM platform_auth_inventory_candidates WHERE migration_run_id = $1`, [lineage.inventoryRunId]);
59
+ return {
60
+ unresolvedImports: Number(imports.rows[0]?.count ?? 0),
61
+ pendingOutbox: Number(outbox.rows[0]?.count ?? 0),
62
+ candidates: Number(inventory.rows[0]?.candidates ?? 0),
63
+ inventoryBlockers: Number(inventory.rows[0]?.blockers ?? 0),
64
+ };
65
+ }
66
+ export async function lockPlatformAuthFinalizationInputs(connection, includeRemoteVerification) {
67
+ await connection.query('LOCK TABLE platform_auth_inventory_candidates, workos_import_ledger, platform_principals, platform_identity_links, platform_verified_emails, platform_identity_sync_outbox IN SHARE MODE');
68
+ if (includeRemoteVerification) {
69
+ await connection.query('LOCK TABLE platform_auth_remote_verification_sweeps, platform_auth_remote_verification_targets, platform_auth_remote_verification_evidence IN SHARE MODE');
70
+ }
71
+ }
72
+ export async function assertPlatformAuthRemoteVerificationReady(store, lineage, now) {
73
+ if (store === undefined)
74
+ throw new PlatformAuthMigrationError('remote_verification_incomplete');
75
+ const readiness = await store.readiness({
76
+ inventoryRunId: lineage.inventoryRunId,
77
+ importRunId: lineage.importRunId,
78
+ provider: 'workos',
79
+ realm: lineage.workosRealm,
80
+ freshAfter: platformAuthRemoteVerificationFreshAfter(now),
81
+ });
82
+ if (!readiness.ready)
83
+ throw new PlatformAuthMigrationError('remote_verification_incomplete');
84
+ }
85
+ export async function platformAuthFinalizationCandidatesReady(connection, lineage) {
86
+ const result = await connection.query(`SELECT count(*)::text AS count
87
+ FROM platform_auth_inventory_candidates candidate
88
+ LEFT JOIN workos_import_ledger ledger
89
+ ON ledger.principal_id = COALESCE(candidate.principal_id, candidate.source_subject)
90
+ AND ledger.migration_run_id = $1 AND ledger.realm = $2
91
+ LEFT JOIN platform_identity_links link
92
+ ON link.provider = 'workos' AND link.realm = ledger.realm
93
+ AND link.external_id = ledger.remote_user_id
94
+ AND link.principal_id = COALESCE(candidate.principal_id, candidate.source_subject)
95
+ LEFT JOIN platform_principals principal
96
+ ON principal.principal_id = COALESCE(candidate.principal_id, candidate.source_subject)
97
+ LEFT JOIN platform_identity_links google_link
98
+ ON google_link.provider = 'google' AND google_link.realm = candidate.source_realm
99
+ AND google_link.external_id = candidate.source_subject
100
+ AND google_link.principal_id = COALESCE(candidate.principal_id, candidate.source_subject)
101
+ WHERE candidate.migration_run_id = $3 AND (cardinality(candidate.blocker_codes) > 0
102
+ OR candidate.normalized_email IS NULL
103
+ OR principal.status IS DISTINCT FROM 'active'
104
+ OR principal.billing_identity_issuer IS DISTINCT FROM 'https://accounts.google.com'
105
+ OR principal.billing_subject IS DISTINCT FROM candidate.source_subject
106
+ OR google_link.principal_id IS NULL OR google_link.disabled_at IS NOT NULL
107
+ OR (SELECT count(*) FROM platform_verified_emails email
108
+ WHERE email.principal_id = COALESCE(candidate.principal_id, candidate.source_subject)
109
+ AND email.provider = 'google' AND email.realm = candidate.source_realm
110
+ AND email.status = 'active') <> 1
111
+ OR NOT EXISTS (SELECT 1 FROM platform_verified_emails email
112
+ WHERE email.principal_id = COALESCE(candidate.principal_id, candidate.source_subject)
113
+ AND email.provider = 'google' AND email.realm = candidate.source_realm
114
+ AND email.status = 'active'
115
+ AND email.normalized_email = candidate.normalized_email)
116
+ OR ledger.state IS DISTINCT FROM 'linked'
117
+ OR ledger.lease_token IS NOT NULL OR ledger.lease_expires_at IS NOT NULL
118
+ OR ledger.remote_user_id IS NULL OR link.principal_id IS NULL OR link.disabled_at IS NOT NULL)`, [lineage.importRunId, lineage.workosRealm, lineage.inventoryRunId]);
119
+ return Number(result.rows[0]?.count ?? 0) === 0;
120
+ }
121
+ //# sourceMappingURL=platform-auth-rollout-readiness-postgres.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-auth-rollout-readiness-postgres.js","sourceRoot":"","sources":["../src/platform-auth-rollout-readiness-postgres.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AACjF,OAAO,EAEL,wCAAwC,GACzC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAEL,IAAI,EAEJ,cAAc,EACd,UAAU,GACX,MAAM,oCAAoC,CAAC;AAa5C,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAClD,IAA+B,EAC/B,KAA0B,EAC1B,sBAA+B;IAE/B,IACE,CAAC,cAAc,CAAC,KAAK,CAAC,cAAc,CAAC;QACrC,CAAC,cAAc,CAAC,KAAK,CAAC,WAAW,CAAC;QAClC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