@fuzdev/fuz_app 0.181.0 → 0.183.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 (267) hide show
  1. package/README.md +2 -0
  2. package/dist/actions/CLAUDE.md +28 -10
  3. package/dist/actions/action_rpc.d.ts +11 -1
  4. package/dist/actions/action_rpc.d.ts.map +1 -1
  5. package/dist/actions/action_rpc.js +3 -2
  6. package/dist/actions/action_types.d.ts +16 -1
  7. package/dist/actions/action_types.d.ts.map +1 -1
  8. package/dist/actions/action_types.js +1 -1
  9. package/dist/actions/notification_sender.d.ts +83 -0
  10. package/dist/actions/notification_sender.d.ts.map +1 -0
  11. package/dist/actions/notification_sender.js +85 -0
  12. package/dist/actions/perform_action.d.ts +9 -0
  13. package/dist/actions/perform_action.d.ts.map +1 -1
  14. package/dist/actions/perform_action.js +22 -13
  15. package/dist/actions/register_action_ws.d.ts +14 -0
  16. package/dist/actions/register_action_ws.d.ts.map +1 -1
  17. package/dist/actions/register_action_ws.js +3 -2
  18. package/dist/actions/ws_socket_session.d.ts +3 -0
  19. package/dist/actions/ws_socket_session.d.ts.map +1 -1
  20. package/dist/actions/ws_socket_session.js +2 -1
  21. package/dist/auth/CLAUDE.md +113 -70
  22. package/dist/auth/account_actions.d.ts.map +1 -1
  23. package/dist/auth/account_actions.js +13 -3
  24. package/dist/auth/account_queries.d.ts +158 -16
  25. package/dist/auth/account_queries.d.ts.map +1 -1
  26. package/dist/auth/account_queries.js +189 -18
  27. package/dist/auth/account_routes.d.ts +6 -4
  28. package/dist/auth/account_routes.d.ts.map +1 -1
  29. package/dist/auth/account_routes.js +98 -92
  30. package/dist/auth/admin_actions.d.ts.map +1 -1
  31. package/dist/auth/admin_actions.js +93 -45
  32. package/dist/auth/api_token_queries.d.ts +13 -5
  33. package/dist/auth/api_token_queries.d.ts.map +1 -1
  34. package/dist/auth/api_token_queries.js +24 -9
  35. package/dist/auth/audit_emitter.d.ts +75 -84
  36. package/dist/auth/audit_emitter.d.ts.map +1 -1
  37. package/dist/auth/audit_emitter.js +83 -71
  38. package/dist/auth/audit_log_schema.d.ts +10 -5
  39. package/dist/auth/audit_log_schema.d.ts.map +1 -1
  40. package/dist/auth/audit_log_schema.js +22 -6
  41. package/dist/auth/bearer_auth.d.ts.map +1 -1
  42. package/dist/auth/bearer_auth.js +3 -2
  43. package/dist/auth/bootstrap_account.d.ts +31 -13
  44. package/dist/auth/bootstrap_account.d.ts.map +1 -1
  45. package/dist/auth/bootstrap_account.js +34 -15
  46. package/dist/auth/bootstrap_routes.d.ts +1 -1
  47. package/dist/auth/bootstrap_routes.d.ts.map +1 -1
  48. package/dist/auth/bootstrap_routes.js +7 -14
  49. package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
  50. package/dist/auth/daemon_token_middleware.js +12 -1
  51. package/dist/auth/deps.d.ts +18 -5
  52. package/dist/auth/deps.d.ts.map +1 -1
  53. package/dist/auth/deps.js +3 -2
  54. package/dist/auth/request_context.d.ts +73 -73
  55. package/dist/auth/request_context.d.ts.map +1 -1
  56. package/dist/auth/request_context.js +78 -96
  57. package/dist/auth/resolved_auth.d.ts +16 -11
  58. package/dist/auth/resolved_auth.d.ts.map +1 -1
  59. package/dist/auth/resolved_auth.js +6 -6
  60. package/dist/auth/role_grant_offer_action_specs.d.ts +1 -1
  61. package/dist/auth/role_grant_offer_action_specs.d.ts.map +1 -1
  62. package/dist/auth/role_grant_offer_action_specs.js +2 -1
  63. package/dist/auth/role_grant_offer_actions.d.ts +32 -12
  64. package/dist/auth/role_grant_offer_actions.d.ts.map +1 -1
  65. package/dist/auth/role_grant_offer_actions.js +91 -116
  66. package/dist/auth/role_grant_offer_notifications.d.ts +87 -38
  67. package/dist/auth/role_grant_offer_notifications.d.ts.map +1 -1
  68. package/dist/auth/role_grant_offer_notifications.js +75 -22
  69. package/dist/auth/role_grant_offer_queries.d.ts +155 -18
  70. package/dist/auth/role_grant_offer_queries.d.ts.map +1 -1
  71. package/dist/auth/role_grant_offer_queries.js +262 -73
  72. package/dist/auth/role_grant_offer_schema.js +1 -1
  73. package/dist/auth/role_grant_queries.d.ts +43 -52
  74. package/dist/auth/role_grant_queries.d.ts.map +1 -1
  75. package/dist/auth/role_grant_queries.js +50 -74
  76. package/dist/auth/role_grant_sql.d.ts +21 -0
  77. package/dist/auth/role_grant_sql.d.ts.map +1 -1
  78. package/dist/auth/role_grant_sql.js +21 -0
  79. package/dist/auth/self_service_role_actions.d.ts.map +1 -1
  80. package/dist/auth/self_service_role_actions.js +17 -21
  81. package/dist/auth/session_queries.d.ts +40 -16
  82. package/dist/auth/session_queries.d.ts.map +1 -1
  83. package/dist/auth/session_queries.js +68 -29
  84. package/dist/auth/signup_routes.d.ts.map +1 -1
  85. package/dist/auth/signup_routes.js +90 -38
  86. package/dist/auth/standard_rpc_actions.d.ts +6 -19
  87. package/dist/auth/standard_rpc_actions.d.ts.map +1 -1
  88. package/dist/auth/standard_rpc_actions.js +5 -6
  89. package/dist/auth/token_scope.d.ts +1 -1
  90. package/dist/auth/token_scope.js +1 -1
  91. package/dist/db/sql_columns.d.ts +1 -1
  92. package/dist/db/sql_columns.js +1 -1
  93. package/dist/http/CLAUDE.md +22 -16
  94. package/dist/http/auth_shape.d.ts +1 -1
  95. package/dist/http/db_routes.d.ts +7 -22
  96. package/dist/http/db_routes.d.ts.map +1 -1
  97. package/dist/http/db_routes.js +72 -72
  98. package/dist/http/error_schemas.d.ts +9 -21
  99. package/dist/http/error_schemas.d.ts.map +1 -1
  100. package/dist/http/error_schemas.js +14 -24
  101. package/dist/http/pending_effects.d.ts +42 -4
  102. package/dist/http/pending_effects.d.ts.map +1 -1
  103. package/dist/http/pending_effects.js +34 -4
  104. package/dist/http/route_spec.d.ts +2 -2
  105. package/dist/server/app_backend.d.ts.map +1 -1
  106. package/dist/server/app_backend.js +3 -1
  107. package/dist/server/app_server.d.ts +69 -18
  108. package/dist/server/app_server.d.ts.map +1 -1
  109. package/dist/server/app_server.js +74 -10
  110. package/dist/server/serve_fact_route.d.ts +3 -3
  111. package/dist/server/serve_fact_route.js +12 -12
  112. package/dist/testing/CLAUDE.md +259 -790
  113. package/dist/testing/adversarial_404.d.ts +6 -1
  114. package/dist/testing/adversarial_404.d.ts.map +1 -1
  115. package/dist/testing/adversarial_404.js +38 -17
  116. package/dist/testing/app_server.d.ts +20 -140
  117. package/dist/testing/app_server.d.ts.map +1 -1
  118. package/dist/testing/app_server.js +48 -125
  119. package/dist/testing/audit_drift_guard.d.ts +11 -6
  120. package/dist/testing/audit_drift_guard.d.ts.map +1 -1
  121. package/dist/testing/audit_drift_guard.js +15 -8
  122. package/dist/testing/auth_apps.js +1 -1
  123. package/dist/testing/cross_backend/account_lifecycle.d.ts.map +1 -1
  124. package/dist/testing/cross_backend/account_lifecycle.js +43 -0
  125. package/dist/testing/cross_backend/audit_cross_helpers.d.ts +12 -9
  126. package/dist/testing/cross_backend/audit_cross_helpers.d.ts.map +1 -1
  127. package/dist/testing/cross_backend/audit_cross_helpers.js +13 -14
  128. package/dist/testing/cross_backend/capabilities.d.ts +9 -6
  129. package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
  130. package/dist/testing/cross_backend/capabilities.js +11 -7
  131. package/dist/testing/cross_backend/capability_mounts.d.ts +103 -0
  132. package/dist/testing/cross_backend/capability_mounts.d.ts.map +1 -0
  133. package/dist/testing/cross_backend/capability_mounts.js +423 -0
  134. package/dist/testing/cross_backend/cell_moderate.js +2 -2
  135. package/dist/testing/cross_backend/cell_relations.d.ts.map +1 -1
  136. package/dist/testing/cross_backend/cell_relations.js +12 -11
  137. package/dist/testing/cross_backend/conformance_principal.d.ts +54 -0
  138. package/dist/testing/cross_backend/conformance_principal.d.ts.map +1 -0
  139. package/dist/testing/cross_backend/conformance_principal.js +283 -0
  140. package/dist/testing/cross_backend/conformance_table.d.ts +2 -50
  141. package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
  142. package/dist/testing/cross_backend/conformance_table.js +2 -270
  143. package/dist/testing/cross_backend/credential_deadline.d.ts.map +1 -1
  144. package/dist/testing/cross_backend/credential_deadline.js +2 -0
  145. package/dist/testing/cross_backend/credential_wire.d.ts +1 -1
  146. package/dist/testing/cross_backend/credential_wire.d.ts.map +1 -1
  147. package/dist/testing/cross_backend/db_state_diff.d.ts +72 -0
  148. package/dist/testing/cross_backend/db_state_diff.d.ts.map +1 -0
  149. package/dist/testing/cross_backend/db_state_diff.js +444 -0
  150. package/dist/testing/cross_backend/declared_skips.d.ts +68 -0
  151. package/dist/testing/cross_backend/declared_skips.d.ts.map +1 -0
  152. package/dist/testing/cross_backend/declared_skips.js +132 -0
  153. package/dist/testing/cross_backend/default_spine_surface.d.ts +1 -26
  154. package/dist/testing/cross_backend/default_spine_surface.d.ts.map +1 -1
  155. package/dist/testing/cross_backend/default_spine_surface.js +2 -6
  156. package/dist/testing/cross_backend/differential.d.ts +11 -2
  157. package/dist/testing/cross_backend/differential.d.ts.map +1 -1
  158. package/dist/testing/cross_backend/differential.js +35 -11
  159. package/dist/testing/cross_backend/differential_normalize.d.ts +12 -0
  160. package/dist/testing/cross_backend/differential_normalize.d.ts.map +1 -1
  161. package/dist/testing/cross_backend/differential_normalize.js +16 -0
  162. package/dist/testing/cross_backend/full_spine_mount.d.ts +3 -10
  163. package/dist/testing/cross_backend/full_spine_mount.d.ts.map +1 -1
  164. package/dist/testing/cross_backend/full_spine_mount.js +4 -4
  165. package/dist/testing/cross_backend/in_process_setup.d.ts +22 -12
  166. package/dist/testing/cross_backend/in_process_setup.d.ts.map +1 -1
  167. package/dist/testing/cross_backend/in_process_setup.js +151 -134
  168. package/dist/testing/cross_backend/login_security.d.ts +12 -0
  169. package/dist/testing/cross_backend/login_security.d.ts.map +1 -1
  170. package/dist/testing/cross_backend/login_security.js +21 -4
  171. package/dist/testing/cross_backend/request_target_conformance_wire.d.ts +0 -2
  172. package/dist/testing/cross_backend/request_target_conformance_wire.d.ts.map +1 -1
  173. package/dist/testing/cross_backend/request_target_conformance_wire.js +3 -1
  174. package/dist/testing/cross_backend/revocation_drivers.d.ts +18 -5
  175. package/dist/testing/cross_backend/revocation_drivers.d.ts.map +1 -1
  176. package/dist/testing/cross_backend/revocation_drivers.js +18 -10
  177. package/dist/testing/cross_backend/role_grant_cross_helpers.d.ts +1 -1
  178. package/dist/testing/cross_backend/role_grant_cross_helpers.d.ts.map +1 -1
  179. package/dist/testing/cross_backend/role_grant_offer_lifecycle.d.ts.map +1 -1
  180. package/dist/testing/cross_backend/role_grant_offer_lifecycle.js +33 -1
  181. package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts +5 -4
  182. package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts.map +1 -1
  183. package/dist/testing/cross_backend/role_grant_offer_notification_ws.js +183 -30
  184. package/dist/testing/cross_backend/role_grant_participation.js +4 -4
  185. package/dist/testing/cross_backend/rpc_adversarial.js +1 -1
  186. package/dist/testing/cross_backend/session_cap.d.ts +2 -2
  187. package/dist/testing/cross_backend/session_cap.d.ts.map +1 -1
  188. package/dist/testing/cross_backend/session_cap.js +48 -16
  189. package/dist/testing/cross_backend/setup.d.ts +31 -1
  190. package/dist/testing/cross_backend/setup.d.ts.map +1 -1
  191. package/dist/testing/cross_backend/setup.js +32 -1
  192. package/dist/testing/cross_backend/spine_suites.d.ts +123 -12
  193. package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
  194. package/dist/testing/cross_backend/spine_suites.js +454 -57
  195. package/dist/testing/cross_backend/spine_surface_constants.d.ts +1 -1
  196. package/dist/testing/cross_backend/spine_surface_constants.d.ts.map +1 -1
  197. package/dist/testing/cross_backend/spine_surface_constants.js +1 -0
  198. package/dist/testing/cross_backend/sse_round_trip.d.ts +9 -1
  199. package/dist/testing/cross_backend/sse_round_trip.d.ts.map +1 -1
  200. package/dist/testing/cross_backend/sse_round_trip.js +123 -27
  201. package/dist/testing/cross_backend/testing_backdoor.d.ts.map +1 -1
  202. package/dist/testing/cross_backend/testing_backdoor.js +4 -2
  203. package/dist/testing/cross_backend/testing_reset_actions.d.ts +59 -27
  204. package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
  205. package/dist/testing/cross_backend/testing_reset_actions.js +66 -42
  206. package/dist/testing/cross_backend/transport_composition.d.ts +1 -1
  207. package/dist/testing/cross_backend/transport_composition.d.ts.map +1 -1
  208. package/dist/testing/cross_backend/transport_composition.js +7 -3
  209. package/dist/testing/cross_backend/ws_round_trip.d.ts +5 -0
  210. package/dist/testing/cross_backend/ws_round_trip.d.ts.map +1 -1
  211. package/dist/testing/cross_backend/ws_round_trip.js +54 -8
  212. package/dist/testing/data_exposure.d.ts.map +1 -1
  213. package/dist/testing/data_exposure.js +3 -0
  214. package/dist/testing/db.d.ts +0 -32
  215. package/dist/testing/db.d.ts.map +1 -1
  216. package/dist/testing/db.js +0 -86
  217. package/dist/testing/db_entities.d.ts +14 -0
  218. package/dist/testing/db_entities.d.ts.map +1 -1
  219. package/dist/testing/db_entities.js +17 -0
  220. package/dist/testing/db_invariant_queries.d.ts +259 -0
  221. package/dist/testing/db_invariant_queries.d.ts.map +1 -0
  222. package/dist/testing/db_invariant_queries.js +400 -0
  223. package/dist/testing/db_invariants.d.ts +106 -0
  224. package/dist/testing/db_invariants.d.ts.map +1 -0
  225. package/dist/testing/db_invariants.gen.sql.d.ts +11 -0
  226. package/dist/testing/db_invariants.gen.sql.d.ts.map +1 -0
  227. package/dist/testing/db_invariants.gen.sql.js +13 -0
  228. package/dist/testing/db_invariants.js +141 -0
  229. package/dist/testing/db_invariants.sql +152 -0
  230. package/dist/testing/describe_db.d.ts +36 -0
  231. package/dist/testing/describe_db.d.ts.map +1 -0
  232. package/dist/testing/describe_db.js +71 -0
  233. package/dist/testing/integration.d.ts +6 -9
  234. package/dist/testing/integration.d.ts.map +1 -1
  235. package/dist/testing/integration.js +9 -13
  236. package/dist/testing/integration_helpers.d.ts +1 -1
  237. package/dist/testing/integration_helpers.d.ts.map +1 -1
  238. package/dist/testing/middleware.d.ts +1 -1
  239. package/dist/testing/middleware.js +5 -5
  240. package/dist/testing/rate_limiting.d.ts +1 -1
  241. package/dist/testing/rate_limiting.d.ts.map +1 -1
  242. package/dist/testing/rate_limiting.js +3 -2
  243. package/dist/testing/resolved_auth.d.ts +3 -1
  244. package/dist/testing/resolved_auth.d.ts.map +1 -1
  245. package/dist/testing/resolved_auth.js +4 -4
  246. package/dist/testing/role_grant_helpers.d.ts +1 -1
  247. package/dist/testing/role_grant_helpers.d.ts.map +1 -1
  248. package/dist/testing/round_trip.d.ts.map +1 -1
  249. package/dist/testing/round_trip.js +3 -0
  250. package/dist/testing/rpc_attack_surface.d.ts +8 -6
  251. package/dist/testing/rpc_attack_surface.d.ts.map +1 -1
  252. package/dist/testing/rpc_attack_surface.js +69 -6
  253. package/dist/testing/rpc_round_trip.d.ts +1 -1
  254. package/dist/testing/rpc_round_trip.d.ts.map +1 -1
  255. package/dist/testing/rpc_round_trip.js +3 -0
  256. package/dist/testing/sse_round_trip.d.ts +1 -1
  257. package/dist/testing/sse_round_trip.d.ts.map +1 -1
  258. package/dist/testing/sse_round_trip.js +13 -4
  259. package/dist/testing/stubs.d.ts +4 -2
  260. package/dist/testing/stubs.d.ts.map +1 -1
  261. package/dist/testing/stubs.js +15 -7
  262. package/dist/testing/test_app.d.ts +166 -0
  263. package/dist/testing/test_app.d.ts.map +1 -0
  264. package/dist/testing/test_app.js +124 -0
  265. package/dist/testing/ws_round_trip.d.ts.map +1 -1
  266. package/dist/testing/ws_round_trip.js +8 -4
  267. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Role grant offer WebSocket notification specs, builders, and the narrow
3
- * `NotificationSender` interface that decouples offer/revoke send sites
4
- * from `ConnectionRegistry`.
2
+ * Role grant offer WebSocket notification specs, builders, and the helpers
3
+ * the handlers queue them with (`queue_offer_notification`,
4
+ * `queue_supersede_notifications`).
5
5
  *
6
6
  * These `RemoteNotificationActionSpec`s cover the consentful-role-grants
7
7
  * lifecycle events the server pushes to affected accounts:
@@ -10,9 +10,9 @@
10
10
  * - `role_grant_offer_retracted` → recipient's sockets when a grantor retracts
11
11
  * - `role_grant_offer_accepted` → grantor's sockets when the recipient accepts
12
12
  * - `role_grant_offer_declined` → grantor's sockets when the recipient declines
13
- * - `role_grant_offer_supersede` → grantor's sockets when a sibling accept,
14
- * a revoke of the resulting role_grant, or destruction of the parent scope
15
- * row obsoletes their pending offer
13
+ * - `role_grant_offer_supersede` → each live party to a pending offer a
14
+ * cascade ended — a sibling accept, a revoke, an account removal — but the
15
+ * one the cascade's own answer or socket close already covers
16
16
  * - `role_grant_revoked` → revokee's sockets when one of their active
17
17
  * role_grants is revoked by the `role_grant_revoke` action (companion to the
18
18
  * `role_grant_revoke` audit event)
@@ -29,10 +29,9 @@
29
29
  * action set of an RPC list that carries the role_grant_offer actions, so the
30
30
  * surface lists them on the WS endpoint as `remote_notification` methods. An
31
31
  * inbound frame for one is still answered `method_not_found`, as no handler is
32
- * registered. Under DEV,
33
- * `create_role_grant_offer_actions` checks each params object it sends
34
- * against its spec's `input` (`create_validated_notification_sender`);
35
- * production sends unchecked.
32
+ * registered. Under DEV, `perform_action` hands every action handler a sender
33
+ * wrapped in `create_validated_notification_sender`, so each params object
34
+ * sent is checked against its spec's `input`; production sends unchecked.
36
35
  *
37
36
  * @module
38
37
  */
@@ -41,9 +40,10 @@ import { nullable, object, one_of, void as fuz_void, parse } from '@fuzdev/fuz_s
41
40
  import { Uuid as UuidSchema, bounded_string } from '../primitive_schemas.js';
42
41
  import { create_action_event_spec } from '../actions/action_bridge.js';
43
42
  import { create_jsonrpc_notification } from '../http/jsonrpc_helpers.js';
43
+ import { emit_after_commit } from '../http/pending_effects.js';
44
44
  import { RoleName } from './role_schema.js';
45
45
  import { ScopeKindName } from './scope_kind_schema.js';
46
- import { RoleGrantOfferJson } from './role_grant_offer_schema.js';
46
+ import { RoleGrantOfferJson, to_role_grant_offer_json } from './role_grant_offer_schema.js';
47
47
  import { ROLE_GRANT_REVOKED_REASON_LENGTH_MAX } from './account_schema.js';
48
48
  // -- Method constants -------------------------------------------------------
49
49
  export const ROLE_GRANT_OFFER_RECEIVED_NOTIFICATION_METHOD = 'role_grant_offer_received';
@@ -74,18 +74,21 @@ export const RoleGrantOfferDeclinedParams = object({
74
74
  offer: RoleGrantOfferJson
75
75
  });
76
76
  /**
77
- * Params for `role_grant_offer_supersede`. Fires to the grantor's sockets when
78
- * their pending offer is obsoleted — either by a sibling accept
79
- * (`reason: 'sibling_accepted'`), by revoke of the resulting role_grant or of
80
- * one of the grantor's own (`reason: 'role_grant_revoked'`), or by deletion of
81
- * the parent scope row
82
- * the offer was bound to (`reason: 'scope_destroyed'`). `cause_id` points
83
- * at the accepted offer id, the revoked role_grant id, or the destroyed scope
84
- * row id respectively.
77
+ * Params for `role_grant_offer_supersede`, sent to a party of a pending offer
78
+ * a cascade ended: a sibling accept (`reason: 'sibling_accepted'`), a revoke of
79
+ * the recipient's grant or of any grant of the grantor's actor
80
+ * (`reason: 'role_grant_revoked'`), or the removal of either party's account
81
+ * (`reason: 'account_deleted'`). `cause_id` points at the accepted offer, the
82
+ * revoked role_grant, or the removed account respectively — the `cause_id` of
83
+ * the offer's `role_grant_offer_supersede` audit row — except on a recipient's
84
+ * frame of its grantor's account removal, where it is the offer's grantor
85
+ * actor (`from_actor_id`), an id the recipient already holds. The audit
86
+ * metadata's reason set is wider: a consumer's scope teardown audits
87
+ * `scope_destroyed`, which no notification carries.
85
88
  */
86
89
  export const RoleGrantOfferSupersedeParams = object({
87
90
  offer: RoleGrantOfferJson,
88
- reason: one_of(['sibling_accepted', 'role_grant_revoked', 'scope_destroyed']),
91
+ reason: one_of(['sibling_accepted', 'role_grant_revoked', 'account_deleted']),
89
92
  cause_id: UuidSchema
90
93
  });
91
94
  /**
@@ -157,7 +160,7 @@ export const role_grant_offer_supersede_notification_spec = {
157
160
  input: RoleGrantOfferSupersedeParams,
158
161
  output: fuz_void,
159
162
  async: true,
160
- description: 'A grantor’s pending role_grant offer was obsoleted by a sibling accept, by revoke of the resulting role_grant, or by destruction of the parent scope row.'
163
+ description: 'A pending role_grant offer this account was a party to, as its grantor or its recipient, was ended by a sibling accept, a role_grant revoke, or the removal of the other party’s account.'
161
164
  };
162
165
  export const role_grant_revoked_notification_spec = {
163
166
  method: ROLE_GRANT_REVOKED_NOTIFICATION_METHOD,
@@ -204,7 +207,8 @@ const notification_spec_by_method = new Map(role_grant_offer_notification_action
204
207
  * a mismatch logged as an error the way DEV output validation logs one; the
205
208
  * notification is sent either way, unchanged. A method that is no
206
209
  * role_grant_offer notification passes unchecked. In production the sender is
207
- * returned as it is.
210
+ * returned as it is. `perform_action` wraps the sender of every handler
211
+ * context, so every send site is checked whichever factory it sits in.
208
212
  *
209
213
  * @param sender - the sender to wrap
210
214
  * @param log - where a mismatch is logged
@@ -233,3 +237,52 @@ export const build_role_grant_offer_accepted_notification = (params) => create_j
233
237
  export const build_role_grant_offer_declined_notification = (params) => create_jsonrpc_notification(ROLE_GRANT_OFFER_DECLINED_NOTIFICATION_METHOD, params);
234
238
  export const build_role_grant_offer_supersede_notification = (params) => create_jsonrpc_notification(ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD, params);
235
239
  export const build_role_grant_revoked_notification = (params) => create_jsonrpc_notification(ROLE_GRANT_REVOKED_NOTIFICATION_METHOD, params);
240
+ /**
241
+ * Queue `message` to every socket bound to `account_id`, sent once the
242
+ * handler's transaction commits and dropped when it rolls back, so a
243
+ * notification never announces state that never landed.
244
+ *
245
+ * Twin of the Rust spine's `queue_offer_notification`.
246
+ *
247
+ * @param ctx - the handler context, whose sender the send goes through
248
+ * @param account_id - the recipient account
249
+ * @param message - the notification, from one of the builders above
250
+ */
251
+ export const queue_offer_notification = (ctx, account_id, message) => {
252
+ const { notification_sender } = ctx;
253
+ emit_after_commit(ctx, () => {
254
+ notification_sender.send_to_account(account_id, message);
255
+ });
256
+ };
257
+ const to_supersede_cause_id = (cause, offer) => cause.kind === 'id' ? cause.id : offer.from_actor_id;
258
+ /**
259
+ * Queue a `role_grant_offer_supersede` notification to the parties of each
260
+ * superseded offer `audience` names, each with its own `cause_id` — the
261
+ * grantor (`from_account_id`, off the cascade's `RETURNING`) and the recipient
262
+ * (`to_account_id`). Sent in the cascade's row order, which is the order of
263
+ * its audit rows, each offer's parties together and its grantor ahead of its
264
+ * recipient — one fixed order, so both spines send a cascade's frames alike.
265
+ *
266
+ * Twin of the Rust spine's `queue_supersede_notifications`.
267
+ *
268
+ * @param ctx - the handler context, whose sender the sends go through
269
+ * @param superseded - the offers the cascade superseded
270
+ * @param reason - why they were superseded
271
+ * @param audience - which party of each offer is told, and the `cause_id` it is sent
272
+ */
273
+ export const queue_supersede_notifications = (ctx, superseded, reason, audience) => {
274
+ for (const offer of superseded) {
275
+ for (const [party, cause] of [
276
+ [offer.from_account_id, audience.grantor],
277
+ [offer.to_account_id, audience.recipient]
278
+ ]) {
279
+ if (!cause)
280
+ continue;
281
+ queue_offer_notification(ctx, party, build_role_grant_offer_supersede_notification({
282
+ offer: to_role_grant_offer_json(offer),
283
+ reason,
284
+ cause_id: to_supersede_cause_id(cause, offer)
285
+ }));
286
+ }
287
+ }
288
+ };
@@ -106,12 +106,16 @@ export declare class RoleGrantOfferActorAccountMismatchError extends Error {
106
106
  constructor();
107
107
  }
108
108
  /**
109
- * Error thrown by `query_role_grant_offer_create` when the recipient is not an
110
- * active account: `to_account_id` names no account, a soft-deleted one, or one
111
- * with no active actor. A deleted recipient and one that never existed are the
112
- * one refusal, so a caller learns nothing from it that a missing id wouldn't
113
- * tell; the handler answers it as `role_grant_assign` answers the same
114
- * recipient. Twin of the Rust `RoleGrantOfferError::RecipientNotActive`.
109
+ * Error thrown when the recipient is not an active account.
110
+ *
111
+ * By `query_role_grant_offer_create`: `to_account_id` names no account, a
112
+ * soft-deleted one, or one with no active actor. A deleted recipient and one
113
+ * that never existed are the one refusal, so a caller learns nothing from it
114
+ * that a missing id wouldn't tell; the handler answers it as
115
+ * `role_grant_assign` answers the same recipient. By `query_accept_offer`: the
116
+ * accepting account — the caller — was deleted or purged after its credential
117
+ * was read, and its handler answers the dead credential. Twin of the Rust
118
+ * `RoleGrantOfferError::RecipientNotActive`.
115
119
  */
116
120
  export declare class RoleGrantOfferRecipientNotActiveError extends Error {
117
121
  constructor();
@@ -231,8 +235,11 @@ export declare const query_role_grant_offer_history_for_account: (deps: QueryDep
231
235
  * caller's `role_grant_offer_expire` audit inserts — committed together, or
232
236
  * rolled back together so the next sweep retries. Concurrent sweeps claim
233
237
  * disjoint rows: a row another sweep has stamped but not committed blocks on
234
- * its row lock, then fails the re-checked `expire_audited_at IS NULL`.
235
- * `cleanup_expired_role_grant_offers` is the caller.
238
+ * its row lock, then fails the re-checked `expire_audited_at IS NULL`. The
239
+ * rows are locked in id order (`offer_rows_locked_in_id_order`), as every
240
+ * multi-row offer write takes them, so a sweep and a delete, purge, revoke or
241
+ * accept over the same expired offers never wait on each other in opposite
242
+ * orders. `cleanup_expired_role_grant_offers` is the caller.
236
243
  *
237
244
  * @mutates `role_grant_offer` rows - stamps `expire_audited_at` on each claimed row
238
245
  */
@@ -261,6 +268,12 @@ export interface AcceptOfferInput {
261
268
  export interface AcceptOfferResult {
262
269
  role_grant: RoleGrant;
263
270
  offer: RoleGrantOffer;
271
+ /**
272
+ * The grantor's account (the offer's `from_actor_id` → account), read on the
273
+ * claimed row, so the caller can tell the grantor without a second read.
274
+ * Twin of the Rust `AcceptOfferResult::from_account_id`.
275
+ */
276
+ from_account_id: Uuid;
264
277
  /** `true` if this call is the one that accepted the offer (new role_grant inserted); `false` on a replay (or a race loser) returning the already-created, still-held role_grant — the caller then audits and notifies nothing. */
265
278
  created: boolean;
266
279
  /**
@@ -286,9 +299,29 @@ export interface AcceptOfferResult {
286
299
  * creating a duplicate or throwing — while that grant is still held. A grant
287
300
  * revoked since the accept, or gone, makes the offer terminal.
288
301
  *
302
+ * Lock order — accounts, then offers, then the grant: the recipient's account
303
+ * row (and, for an unscoped `admin` offer, the grantor's) in id order
304
+ * (`query_account_lock_for_offer_accept`), then the offer and the pending
305
+ * siblings it supersedes in one id-ordered claim, then the grant insert. The
306
+ * accounts first, as every removal of either account takes them first, so a
307
+ * removal and an accept never meet at the offers, the actor, or a grant a
308
+ * purge's cascade reaches; two accepts by one recipient take turns. The
309
+ * offers in id order, as every transaction that writes several offer rows
310
+ * locks them all first in one id-ordered statement (a delete, a purge, a
311
+ * revoke, the expiry sweep). The grantor's authority is read unlocked after
312
+ * the grantor's account lock — the invariant it rests on: every write that
313
+ * ends a grantor's global `admin` takes the grantor's account row first (a
314
+ * revoke of the grant through `query_account_lock_for_revoke`, whether or not
315
+ * its last-admin guard ran; a delete through its write of the row; a purge
316
+ * through `query_account_lock_admins_for_purge` and
317
+ * `query_account_lock_for_purge`; the DB browser's delete, which takes none of
318
+ * them, excepted).
319
+ *
289
320
  * Error map:
290
321
  * - `RoleGrantOfferNotFoundError` — offer does not exist, or belongs to a
291
322
  * different recipient (IDOR guard). The offer row is untouched.
323
+ * - `RoleGrantOfferRecipientNotActiveError` — the recipient's account was
324
+ * deleted or purged since the caller's credential was read.
292
325
  * - `RoleGrantOfferAlreadyTerminalError` — offer is declined, retracted, or
293
326
  * superseded; or accepted, and its grant revoked, gone, or bound to another
294
327
  * actor.
@@ -296,8 +329,8 @@ export interface AcceptOfferResult {
296
329
  * - `RoleGrantOfferActorMismatchError` — actor-targeted offer, different actor.
297
330
  * - `RoleGrantOfferBuiltinRefusedError` — a builtin-role offer that must not
298
331
  * mint: `keeper` at all, a builtin bound to a scope, or one whose grantor no
299
- * longer holds an active global `admin` (read under `FOR SHARE`). The offer
300
- * stays pending.
332
+ * longer holds an active global `admin` (read under the grantor's account
333
+ * lock). The offer stays pending.
301
334
  *
302
335
  * Sibling supersede is what closes the "accept a pre-revoke sibling offer
303
336
  * to bypass a revoke" path: once A is accepted, B/C/... can no longer be
@@ -308,6 +341,7 @@ export interface AcceptOfferResult {
308
341
  * @mutates `role_grant_offer` siblings - stamps `superseded_at` on every other pending offer for the tuple
309
342
  * @mutates `audit_log` table - emits `role_grant_offer_accept` + `role_grant_create` + one `role_grant_offer_supersede` per sibling
310
343
  * @throws RoleGrantOfferNotFoundError if the offer is missing or belongs to another recipient
344
+ * @throws RoleGrantOfferRecipientNotActiveError if the recipient's account is deleted or gone
311
345
  * @throws RoleGrantOfferAlreadyTerminalError if the offer is declined, retracted, or superseded, or accepted with its grant revoked, gone, or bound to another actor
312
346
  * @throws RoleGrantOfferExpiredError if the offer is pending but past `expires_at`
313
347
  * @throws RoleGrantOfferActorMismatchError if the offer is actor-targeted to a different actor
@@ -321,12 +355,15 @@ export declare const query_accept_offer: (deps: QueryDeps, input: AcceptOfferInp
321
355
  *
322
356
  * An offer carries no record of the authority it was made under, so one
323
357
  * outliving that authority would still confer its role on accept. Revoking a
324
- * grant (`role_grant_revoke`, the revokee's actor) and removing an account
325
- * (`account_delete` / `account_purge`, every actor of the account) end the
326
- * grantor's outgoing pending offers in the same transaction. Each row carries
358
+ * grant (`query_revoke_role_grant`, the revokee's actor) and removing an
359
+ * account (`account_delete` / `account_purge`, every actor of the account) end
360
+ * the grantor's outgoing pending offers in the same transaction. Each row carries
327
361
  * the grantor's `from_account_id`, as every supersede cascade's does; the
328
- * caller emits a `role_grant_offer_supersede` audit event per entry, and the
329
- * revoke caller also sends the supersede notification. Twin of the Rust
362
+ * caller emits a `role_grant_offer_supersede` audit event per entry and
363
+ * queues its notifications (`queue_supersede_notifications`). The rows are
364
+ * taken in id order; a caller that writes other offers too locks them all
365
+ * first (`query_role_grant_offer_lock_for_account_removal`,
366
+ * `query_role_grant_offer_lock_for_revoke`). Twin of the Rust
330
367
  * `query_role_grant_offer_supersede_outgoing`.
331
368
  *
332
369
  * @param deps - query dependencies
@@ -337,7 +374,7 @@ export declare const query_accept_offer: (deps: QueryDeps, input: AcceptOfferInp
337
374
  export declare const query_role_grant_offer_supersede_outgoing: (deps: QueryDeps, from_actor_ids: ReadonlyArray<Uuid>) => Promise<Array<SupersededOffer>>;
338
375
  /**
339
376
  * Supersede every pending offer **made to** `to_account_id` — the
340
- * recipient-side cascade of an account delete.
377
+ * recipient-side cascade of an account delete or purge.
341
378
  *
342
379
  * An undelete restores the account, so an offer left pending through the
343
380
  * delete would come back with it and could then be accepted; superseding it
@@ -345,8 +382,11 @@ export declare const query_role_grant_offer_supersede_outgoing: (deps: QueryDeps
345
382
  * `to_account_id` alone covers the actor-addressed offers too: an offer's
346
383
  * `to_actor_id` is bound to its `to_account_id` at create. Each row carries
347
384
  * the grantor's `from_account_id`, as every supersede cascade's does; the
348
- * caller emits a `role_grant_offer_supersede` audit event per entry. Twin of
349
- * the Rust `query_role_grant_offer_supersede_incoming`.
385
+ * caller emits a `role_grant_offer_supersede` audit event per entry and
386
+ * queues its notifications (`queue_supersede_notifications`). The rows are
387
+ * taken in id order, after the caller's
388
+ * `query_role_grant_offer_lock_for_account_removal`. Twin of the Rust
389
+ * `query_role_grant_offer_supersede_incoming`.
350
390
  *
351
391
  * @param deps - query dependencies
352
392
  * @param to_account_id - the recipient account whose pending offers end
@@ -354,4 +394,101 @@ export declare const query_role_grant_offer_supersede_outgoing: (deps: QueryDeps
354
394
  * @mutates `role_grant_offer` rows - stamps `superseded_at` on every pending offer to `to_account_id`
355
395
  */
356
396
  export declare const query_role_grant_offer_supersede_incoming: (deps: QueryDeps, to_account_id: Uuid) => Promise<Array<SupersededOffer>>;
397
+ /**
398
+ * Lock every pending offer an account removal supersedes — the ones its actors
399
+ * made and the ones made to it — in one statement, in id order.
400
+ *
401
+ * A delete or a purge writes those offers in two statements, the outgoing
402
+ * then the incoming; taken that way, each could hold rows another writer of
403
+ * both sets (a revoke of the account's grant, the expiry sweep) waits on while
404
+ * waiting on rows that writer holds. Locked together first, in the order every
405
+ * multi-row offer write takes its rows, the two supersedes then write rows
406
+ * this transaction already holds. No offer to or from the account can be made
407
+ * meanwhile: an offer create takes both parties' account rows, which the
408
+ * removal has written or locked. Twin of the Rust
409
+ * `query_role_grant_offer_lock_for_account_removal`.
410
+ *
411
+ * @param deps - query dependencies (must be the removal's transaction)
412
+ * @param to_account_id - the removed account
413
+ * @param from_actor_ids - the removed account's actors
414
+ * @mutates `role_grant_offer` rows - row-locks every pending offer to the account or from its actors
415
+ */
416
+ export declare const query_role_grant_offer_lock_for_account_removal: (deps: QueryDeps, to_account_id: Uuid, from_actor_ids: ReadonlyArray<Uuid>) => Promise<void>;
417
+ /**
418
+ * Lock every pending offer a revoke supersedes (`query_revoke_role_grant`) — the revokee
419
+ * account's incoming offers of the revoked grant's role and scope, and every
420
+ * offer the revokee's actor made — in one statement, in id order.
421
+ *
422
+ * Taken after the revokee's account row (`query_account_lock_for_revoke`),
423
+ * which keeps any new offer to or from the account out, and before the grant's
424
+ * update: an accept claims its offers before it inserts its grant (whose unique
425
+ * slot waits on a revoke's uncommitted update of the same grant), so a revoke
426
+ * updating the grant first and then reaching the offers the accept holds would
427
+ * close a cycle. Then the revoke's two supersedes write rows it already holds,
428
+ * in the order every multi-row offer write takes its rows. Twin of the Rust
429
+ * `query_role_grant_offer_lock_for_revoke`.
430
+ *
431
+ * @param deps - query dependencies (must be the revoke's transaction)
432
+ * @param actor_id - the revokee actor
433
+ * @param role - the revoked grant's role
434
+ * @param scope_id - the revoked grant's scope, `null` for global
435
+ * @mutates `role_grant_offer` rows - row-locks the pending offers the revoke supersedes
436
+ */
437
+ export declare const query_role_grant_offer_lock_for_revoke: (deps: QueryDeps, actor_id: Uuid, role: string, scope_id: Uuid | null) => Promise<void>;
438
+ /** Result of `query_revoke_role_grant` — the revoked role_grant plus every pending offer the revoke superseded. */
439
+ export interface RevokeRoleGrantResult {
440
+ id: Uuid;
441
+ role: string;
442
+ scope_kind: string | null;
443
+ scope_id: Uuid | null;
444
+ /**
445
+ * The pending offers the revoke ended: the revokee account's incoming
446
+ * offers of the revoked grant's `(role, scope)`, then every offer the
447
+ * revokee's actor made. Each entry carries its grantor's `from_account_id`
448
+ * so callers can fan out `role_grant_offer_supersede` notifications without
449
+ * a second round-trip. The caller emits a `role_grant_offer_supersede`
450
+ * audit event per entry (with `reason: 'role_grant_revoked'` and
451
+ * `cause_id: <revoked role_grant id>`) and queues its notifications
452
+ * (`queue_supersede_notifications`).
453
+ */
454
+ superseded_offers: Array<SupersededOffer>;
455
+ }
456
+ /**
457
+ * Revoke a role_grant by id, constrained to a specific actor, and end the
458
+ * pending offers the grant stood behind — the one supersede rule every revoke
459
+ * follows, the admin `role_grant_revoke`, a self-service disable, and a
460
+ * consumer's direct call alike.
461
+ *
462
+ * Requires `actor_id` to prevent cross-account revocation (IDOR guard).
463
+ * Returns `null` if the role_grant is not found, already revoked, or belongs
464
+ * to a different actor.
465
+ *
466
+ * Two sets of offers end with the grant, in the same transaction:
467
+ *
468
+ * - the revokee account's pending offers of the grant's `(role, scope)` — an
469
+ * offer accepted after the revoke would hand the role straight back;
470
+ * - every pending offer the revokee's actor made, whatever its role — an
471
+ * offer records no authority, so one made under this grant would still
472
+ * confer on accept.
473
+ *
474
+ * Locks follow the class order (accounts, then offers, then grants): the
475
+ * revokee's account row (`query_account_lock_for_revoke`), which keeps any new
476
+ * offer to or from the account out and any accept by it waiting, then both
477
+ * sets of offers in one id-ordered statement
478
+ * (`query_role_grant_offer_lock_for_revoke`), then the grant's update — an
479
+ * accept claims its offers before it inserts its grant, and that insert waits
480
+ * on an uncommitted update of the same grant, so the grant first and the
481
+ * offers second would close a cycle. The two supersedes then write only rows
482
+ * the transaction holds. Twin of the Rust
483
+ * `fuz_auth::role_grant_offer_queries::query_revoke_role_grant`.
484
+ *
485
+ * @param deps - query dependencies (must be the revoke's transaction)
486
+ * @param role_grant_id - the role_grant to revoke
487
+ * @param actor_id - the actor that must own the role_grant
488
+ * @param revoked_by - the actor who revoked it (for audit trail)
489
+ * @param reason - optional free-form reason, stamped on `role_grant.revoked_reason` and surfaced to the revokee notification.
490
+ * @mutates `role_grant` row - sets `revoked_at`, `revoked_by`, and `revoked_reason`
491
+ * @mutates `role_grant_offer` rows - stamps `superseded_at` on every pending incoming sibling for the same `(account, role, scope)` and every pending offer from `actor_id`
492
+ */
493
+ export declare const query_revoke_role_grant: (deps: QueryDeps, role_grant_id: Uuid, actor_id: Uuid, revoked_by: Uuid | null, reason?: string | null) => Promise<RevokeRoleGrantResult | null>;
357
494
  //# sourceMappingURL=role_grant_offer_queries.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"role_grant_offer_queries.d.ts","sourceRoot":"","sources":["../../src/lib/auth/role_grant_offer_queries.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAUrD,OAAO,KAAK,EACX,yBAAyB,EACzB,cAAc,EACd,eAAe,EACf,MAAM,8BAA8B,CAAC;AAGtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAG3D;;;;;GAKG;AACH,qBAAa,kCAAmC,SAAQ,KAAK;gBAChD,QAAQ,EAAE,MAAM;CAI5B;AAED;;;;;GAKG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;gBACxC,QAAQ,EAAE,MAAM;CAI5B;AAED;;;;;GAKG;AACH,qBAAa,2BAA4B,SAAQ,KAAK;gBACzC,QAAQ,EAAE,MAAM;CAI5B;AAED;;;;;;;;GAQG;AACH,qBAAa,6BAA8B,SAAQ,KAAK;;CAKvD;AAED;;;;;;;GAOG;AACH,qBAAa,gCAAiC,SAAQ,KAAK;gBAC9C,QAAQ,EAAE,MAAM;CAI5B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,GAAG,QAAQ,GAAG,wBAAwB,CAAC;AAEzF;;;;;GAKG;AACH,qBAAa,iCAAkC,SAAQ,KAAK;IAC3D,QAAQ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;GAcG;AACH,eAAO,MAAM,oCAAoC,GAChD,MAAM,SAAS,KACb,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,CAe/B,CAAC;AAqCF,sCAAsC;AACtC,MAAM,WAAW,gBAAgB;IAChC,QAAQ,EAAE,IAAI,CAAC;IACf,mGAAmG;IACnG,aAAa,EAAE,IAAI,CAAC;IACpB;;;;;;;;;;OAUG;IACH,QAAQ,EAAE,IAAI,CAAC;IACf,gDAAgD;IAChD,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACnB;AAED,6HAA6H;AAC7H,MAAM,WAAW,iBAAiB;IACjC,UAAU,EAAE,SAAS,CAAC;IACtB,KAAK,EAAE,cAAc,CAAC;IACtB,kOAAkO;IAClO,OAAO,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,iBAAiB,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;IAC1C,yMAAyM;IACzM,YAAY,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;CACnC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,eAAO,MAAM,kBAAkB,GAC9B,MAAM,SAAS,EACf,OAAO,gBAAgB,KACrB,OAAO,CAAC,iBAAiB,CAgP3B,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,yCAAyC,GACrD,MAAM,SAAS,EACf,gBAAgB,aAAa,CAAC,IAAI,CAAC,KACjC,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC,CAchC,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,yCAAyC,GACrD,MAAM,SAAS,EACf,eAAe,IAAI,KACjB,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC,CAahC,CAAC"}
1
+ {"version":3,"file":"role_grant_offer_queries.d.ts","sourceRoot":"","sources":["../../src/lib/auth/role_grant_offer_queries.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,O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