@singi-labs/sifa-sdk 0.19.44 → 0.19.45

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 (575) hide show
  1. package/dist/atproto/index.js +9 -3
  2. package/dist/atproto/index.js.map +1 -1
  3. package/dist/badge/index.js +5 -141
  4. package/dist/badge/index.js.map +1 -1
  5. package/dist/cards/adult-content.js +14 -0
  6. package/dist/cards/adult-content.js.map +1 -0
  7. package/dist/cards/app-url-patterns.js +369 -0
  8. package/dist/cards/app-url-patterns.js.map +1 -0
  9. package/dist/cards/index.js +24 -0
  10. package/dist/cards/index.js.map +1 -0
  11. package/dist/cards/resolve-card-url.js +198 -0
  12. package/dist/cards/resolve-card-url.js.map +1 -0
  13. package/dist/cards/visibility.js +45 -0
  14. package/dist/cards/visibility.js.map +1 -0
  15. package/dist/flags/index.js +4 -3
  16. package/dist/flags/index.js.map +1 -1
  17. package/dist/format/collapse-contributors.js +19 -0
  18. package/dist/format/collapse-contributors.js.map +1 -0
  19. package/dist/format/company-name.js +61 -0
  20. package/dist/format/company-name.js.map +1 -0
  21. package/dist/format/compare-text.js +9 -0
  22. package/dist/format/compare-text.js.map +1 -0
  23. package/dist/format/doi.js +8 -0
  24. package/dist/format/doi.js.map +1 -0
  25. package/dist/format/embed.js +131 -0
  26. package/dist/format/embed.js.map +1 -0
  27. package/dist/format/endorsement-context.js +35 -0
  28. package/dist/format/endorsement-context.js.map +1 -0
  29. package/dist/format/format-display-url.js +42 -0
  30. package/dist/format/format-display-url.js.map +1 -0
  31. package/dist/format/format-duration.js +13 -0
  32. package/dist/format/format-duration.js.map +1 -0
  33. package/dist/format/format-time.js +30 -0
  34. package/dist/format/format-time.js.map +1 -0
  35. package/dist/format/handle-utils.js +19 -0
  36. package/dist/format/handle-utils.js.map +1 -0
  37. package/dist/format/index.js +100 -0
  38. package/dist/format/index.js.map +1 -0
  39. package/dist/format/location-segments.js +29 -0
  40. package/dist/format/location-segments.js.map +1 -0
  41. package/dist/format/location-utils.js +42 -0
  42. package/dist/format/location-utils.js.map +1 -0
  43. package/dist/format/meta-description.js +35 -0
  44. package/dist/format/meta-description.js.map +1 -0
  45. package/dist/format/normalize-company-key.js +12 -0
  46. package/dist/format/normalize-company-key.js.map +1 -0
  47. package/dist/format/normalize-legal-form.js +71 -0
  48. package/dist/format/normalize-legal-form.js.map +1 -0
  49. package/dist/format/pds-utils.js +73 -0
  50. package/dist/format/pds-utils.js.map +1 -0
  51. package/dist/format/sort-by-date.js +39 -0
  52. package/dist/format/sort-by-date.js.map +1 -0
  53. package/dist/format/summarize-deliveries.js +37 -0
  54. package/dist/format/summarize-deliveries.js.map +1 -0
  55. package/dist/format/talk-slug.js +21 -0
  56. package/dist/format/talk-slug.js.map +1 -0
  57. package/dist/format/text-sanitize.js +29 -0
  58. package/dist/format/text-sanitize.js.map +1 -0
  59. package/dist/format/text-truncate.js +14 -0
  60. package/dist/format/text-truncate.js.map +1 -0
  61. package/dist/format/time-utils.js +19 -0
  62. package/dist/format/time-utils.js.map +1 -0
  63. package/dist/format/timeline.js +29 -0
  64. package/dist/format/timeline.js.map +1 -0
  65. package/dist/format/wcag-contrast.js +34 -0
  66. package/dist/format/wcag-contrast.js.map +1 -0
  67. package/dist/import/index.js +22 -0
  68. package/dist/import/index.js.map +1 -0
  69. package/dist/import/presentation-csv.js +116 -0
  70. package/dist/import/presentation-csv.js.map +1 -0
  71. package/dist/index.cjs +1 -1
  72. package/dist/index.js +675 -7086
  73. package/dist/index.js.map +1 -1
  74. package/dist/jev/index.js +18 -5
  75. package/dist/jev/index.js.map +1 -1
  76. package/dist/jsonld/index.js +30 -987
  77. package/dist/jsonld/index.js.map +1 -1
  78. package/dist/jsonld/profile.js +222 -0
  79. package/dist/jsonld/profile.js.map +1 -0
  80. package/dist/jsonld/terms.js +496 -0
  81. package/dist/jsonld/terms.js.map +1 -0
  82. package/dist/jsonld/url.js +17 -0
  83. package/dist/jsonld/url.js.map +1 -0
  84. package/dist/jsonld/works-graph.js +41 -0
  85. package/dist/jsonld/works-graph.js.map +1 -0
  86. package/dist/jsonld/works.js +178 -0
  87. package/dist/jsonld/works.js.map +1 -0
  88. package/dist/logic/actor-identity.js +8 -0
  89. package/dist/logic/actor-identity.js.map +1 -0
  90. package/dist/logic/agent-ref.js +24 -0
  91. package/dist/logic/agent-ref.js.map +1 -0
  92. package/dist/logic/company-page-indexable.js +23 -0
  93. package/dist/logic/company-page-indexable.js.map +1 -0
  94. package/dist/logic/date-lookahead.js +31 -0
  95. package/dist/logic/date-lookahead.js.map +1 -0
  96. package/dist/logic/domain-detect.js +43 -0
  97. package/dist/logic/domain-detect.js.map +1 -0
  98. package/dist/logic/entity-disambiguation.js +24 -0
  99. package/dist/logic/entity-disambiguation.js.map +1 -0
  100. package/dist/logic/entity-ref-anchor.js +33 -0
  101. package/dist/logic/entity-ref-anchor.js.map +1 -0
  102. package/dist/logic/index.js +91 -0
  103. package/dist/logic/index.js.map +1 -0
  104. package/dist/logic/org-floor.js +66 -0
  105. package/dist/logic/org-floor.js.map +1 -0
  106. package/dist/logic/primary-item.js +9 -0
  107. package/dist/logic/primary-item.js.map +1 -0
  108. package/dist/logic/primary-position.js +16 -0
  109. package/dist/logic/primary-position.js.map +1 -0
  110. package/dist/logic/profile-completeness.js +21 -0
  111. package/dist/logic/profile-completeness.js.map +1 -0
  112. package/dist/logic/profile-dimensions.js +50 -0
  113. package/dist/logic/profile-dimensions.js.map +1 -0
  114. package/dist/logic/profile-summary.js +23 -0
  115. package/dist/logic/profile-summary.js.map +1 -0
  116. package/dist/logic/pseudo-employer.js +34 -0
  117. package/dist/logic/pseudo-employer.js.map +1 -0
  118. package/dist/logic/recent-activity.js +10 -0
  119. package/dist/logic/recent-activity.js.map +1 -0
  120. package/dist/logic/self-app.js +10 -0
  121. package/dist/logic/self-app.js.map +1 -0
  122. package/dist/{org-BCrvebcf.d.ts → org-CxTEjjrm.d.ts} +1 -1
  123. package/dist/{org-settings-C73Sin5E.d.ts → org-settings-BShvhyFp.d.ts} +1 -1
  124. package/dist/profile/headline-role-dedupe.js +12 -0
  125. package/dist/profile/headline-role-dedupe.js.map +1 -0
  126. package/dist/profile/highlights.js +200 -0
  127. package/dist/profile/highlights.js.map +1 -0
  128. package/dist/profile/index.js +66 -0
  129. package/dist/profile/index.js.map +1 -0
  130. package/dist/profile/involvement-grouping.js +31 -0
  131. package/dist/profile/involvement-grouping.js.map +1 -0
  132. package/dist/profile/language-sort.js +24 -0
  133. package/dist/profile/language-sort.js.map +1 -0
  134. package/dist/profile/publication-versions.js +98 -0
  135. package/dist/profile/publication-versions.js.map +1 -0
  136. package/dist/profile/range-sort.js +14 -0
  137. package/dist/profile/range-sort.js.map +1 -0
  138. package/dist/profile/section-model.js +122 -0
  139. package/dist/profile/section-model.js.map +1 -0
  140. package/dist/profile/section-sorts.js +33 -0
  141. package/dist/profile/section-sorts.js.map +1 -0
  142. package/dist/publishers/index.js +16 -0
  143. package/dist/publishers/index.js.map +1 -0
  144. package/dist/publishers/registry.js +87 -0
  145. package/dist/publishers/registry.js.map +1 -0
  146. package/dist/publishing/index.js +46 -184
  147. package/dist/publishing/index.js.map +1 -1
  148. package/dist/publishing/linkblog.js +42 -0
  149. package/dist/publishing/linkblog.js.map +1 -0
  150. package/dist/publishing/registry.js +32 -0
  151. package/dist/publishing/registry.js.map +1 -0
  152. package/dist/publishing/schemas.js +74 -0
  153. package/dist/publishing/schemas.js.map +1 -0
  154. package/dist/publishing/types.js +32 -0
  155. package/dist/publishing/types.js.map +1 -0
  156. package/dist/query/client.js +119 -0
  157. package/dist/query/client.js.map +1 -0
  158. package/dist/query/config.js +23 -0
  159. package/dist/query/config.js.map +1 -0
  160. package/dist/query/fetchers/accounts.js +29 -0
  161. package/dist/query/fetchers/accounts.js.map +1 -0
  162. package/dist/query/fetchers/activity-items-hide.js +31 -0
  163. package/dist/query/fetchers/activity-items-hide.js.map +1 -0
  164. package/dist/query/fetchers/activity.js +61 -0
  165. package/dist/query/fetchers/activity.js.map +1 -0
  166. package/dist/query/fetchers/actor.js +30 -0
  167. package/dist/query/fetchers/actor.js.map +1 -0
  168. package/dist/query/fetchers/admin-feature-allowlists.js +41 -0
  169. package/dist/query/fetchers/admin-feature-allowlists.js.map +1 -0
  170. package/dist/query/fetchers/admin-review-queues.js +30 -0
  171. package/dist/query/fetchers/admin-review-queues.js.map +1 -0
  172. package/dist/query/fetchers/apps.js +31 -0
  173. package/dist/query/fetchers/apps.js.map +1 -0
  174. package/dist/query/fetchers/bsky-preferences.js +55 -0
  175. package/dist/query/fetchers/bsky-preferences.js.map +1 -0
  176. package/dist/query/fetchers/confirmations.js +55 -0
  177. package/dist/query/fetchers/confirmations.js.map +1 -0
  178. package/dist/query/fetchers/destructive.js +34 -0
  179. package/dist/query/fetchers/destructive.js.map +1 -0
  180. package/dist/query/fetchers/discovery.js +67 -0
  181. package/dist/query/fetchers/discovery.js.map +1 -0
  182. package/dist/query/fetchers/education.js +23 -0
  183. package/dist/query/fetchers/education.js.map +1 -0
  184. package/dist/query/fetchers/endorsement-inbox.js +36 -0
  185. package/dist/query/fetchers/endorsement-inbox.js.map +1 -0
  186. package/dist/query/fetchers/endorsement.js +23 -0
  187. package/dist/query/fetchers/endorsement.js.map +1 -0
  188. package/dist/query/fetchers/endorsements.js +20 -0
  189. package/dist/query/fetchers/endorsements.js.map +1 -0
  190. package/dist/query/fetchers/entities.js +65 -0
  191. package/dist/query/fetchers/entities.js.map +1 -0
  192. package/dist/query/fetchers/external-accounts.js +74 -0
  193. package/dist/query/fetchers/external-accounts.js.map +1 -0
  194. package/dist/query/fetchers/follow-extras.js +38 -0
  195. package/dist/query/fetchers/follow-extras.js.map +1 -0
  196. package/dist/query/fetchers/follow.js +105 -0
  197. package/dist/query/fetchers/follow.js.map +1 -0
  198. package/dist/query/fetchers/get-profile-view.js +21 -0
  199. package/dist/query/fetchers/get-profile-view.js.map +1 -0
  200. package/dist/query/fetchers/github-prs.js +45 -0
  201. package/dist/query/fetchers/github-prs.js.map +1 -0
  202. package/dist/query/fetchers/inbox.js +29 -0
  203. package/dist/query/fetchers/inbox.js.map +1 -0
  204. package/dist/query/fetchers/index.d.ts +2 -2
  205. package/dist/query/fetchers/index.js +360 -2045
  206. package/dist/query/fetchers/index.js.map +1 -1
  207. package/dist/query/fetchers/investments.js +18 -0
  208. package/dist/query/fetchers/investments.js.map +1 -0
  209. package/dist/query/fetchers/keytrace-claims.js +23 -0
  210. package/dist/query/fetchers/keytrace-claims.js.map +1 -0
  211. package/dist/query/fetchers/marque-domains.js +23 -0
  212. package/dist/query/fetchers/marque-domains.js.map +1 -0
  213. package/dist/query/fetchers/network-map.js +36 -0
  214. package/dist/query/fetchers/network-map.js.map +1 -0
  215. package/dist/query/fetchers/org.js +48 -0
  216. package/dist/query/fetchers/org.js.map +1 -0
  217. package/dist/query/fetchers/positions.js +77 -0
  218. package/dist/query/fetchers/positions.js.map +1 -0
  219. package/dist/query/fetchers/profile-completeness.js +45 -0
  220. package/dist/query/fetchers/profile-completeness.js.map +1 -0
  221. package/dist/query/fetchers/profile-items-hide.js +36 -0
  222. package/dist/query/fetchers/profile-items-hide.js.map +1 -0
  223. package/dist/query/fetchers/profile-locations.js +23 -0
  224. package/dist/query/fetchers/profile-locations.js.map +1 -0
  225. package/dist/query/fetchers/profile-mutations.js +82 -0
  226. package/dist/query/fetchers/profile-mutations.js.map +1 -0
  227. package/dist/query/fetchers/profile-summary.js +14 -0
  228. package/dist/query/fetchers/profile-summary.js.map +1 -0
  229. package/dist/query/fetchers/profile.js +31 -0
  230. package/dist/query/fetchers/profile.js.map +1 -0
  231. package/dist/query/fetchers/publications.js +66 -0
  232. package/dist/query/fetchers/publications.js.map +1 -0
  233. package/dist/query/fetchers/quoted-posts.js +40 -0
  234. package/dist/query/fetchers/quoted-posts.js.map +1 -0
  235. package/dist/query/fetchers/reactions.js +85 -0
  236. package/dist/query/fetchers/reactions.js.map +1 -0
  237. package/dist/query/fetchers/received-endorsements.js +20 -0
  238. package/dist/query/fetchers/received-endorsements.js.map +1 -0
  239. package/dist/query/fetchers/reciprocity.js +23 -0
  240. package/dist/query/fetchers/reciprocity.js.map +1 -0
  241. package/dist/query/fetchers/records.js +27 -0
  242. package/dist/query/fetchers/records.js.map +1 -0
  243. package/dist/query/fetchers/repo-inventory.js +23 -0
  244. package/dist/query/fetchers/repo-inventory.js.map +1 -0
  245. package/dist/query/fetchers/roadmap.js +73 -0
  246. package/dist/query/fetchers/roadmap.js.map +1 -0
  247. package/dist/query/fetchers/rpg.js +36 -0
  248. package/dist/query/fetchers/rpg.js.map +1 -0
  249. package/dist/query/fetchers/search.js +78 -0
  250. package/dist/query/fetchers/search.js.map +1 -0
  251. package/dist/query/fetchers/section-primary.js +23 -0
  252. package/dist/query/fetchers/section-primary.js.map +1 -0
  253. package/dist/query/fetchers/skills.js +30 -0
  254. package/dist/query/fetchers/skills.js.map +1 -0
  255. package/dist/query/fetchers/speakers.js +42 -0
  256. package/dist/query/fetchers/speakers.js.map +1 -0
  257. package/dist/query/fetchers/stats.js +16 -0
  258. package/dist/query/fetchers/stats.js.map +1 -0
  259. package/dist/query/fetchers/stream.js +30 -0
  260. package/dist/query/fetchers/stream.js.map +1 -0
  261. package/dist/query/fetchers/unlinked-positions.js +30 -0
  262. package/dist/query/fetchers/unlinked-positions.js.map +1 -0
  263. package/dist/query/hooks/index.d.ts +3 -3
  264. package/dist/query/hooks/index.js +283 -3555
  265. package/dist/query/hooks/index.js.map +1 -1
  266. package/dist/query/hooks/use-accounts.js +19 -0
  267. package/dist/query/hooks/use-accounts.js.map +1 -0
  268. package/dist/query/hooks/use-activity-items-hide.js +52 -0
  269. package/dist/query/hooks/use-activity-items-hide.js.map +1 -0
  270. package/dist/query/hooks/use-activity.js +44 -0
  271. package/dist/query/hooks/use-activity.js.map +1 -0
  272. package/dist/query/hooks/use-admin-review-queues.js +21 -0
  273. package/dist/query/hooks/use-admin-review-queues.js.map +1 -0
  274. package/dist/query/hooks/use-apps.js +31 -0
  275. package/dist/query/hooks/use-apps.js.map +1 -0
  276. package/dist/query/hooks/use-bsky-content-prefs.js +45 -0
  277. package/dist/query/hooks/use-bsky-content-prefs.js.map +1 -0
  278. package/dist/query/hooks/use-confirmations.js +121 -0
  279. package/dist/query/hooks/use-confirmations.js.map +1 -0
  280. package/dist/query/hooks/use-create-position.js +28 -0
  281. package/dist/query/hooks/use-create-position.js.map +1 -0
  282. package/dist/query/hooks/use-destructive.js +63 -0
  283. package/dist/query/hooks/use-destructive.js.map +1 -0
  284. package/dist/query/hooks/use-discovery.js +53 -0
  285. package/dist/query/hooks/use-discovery.js.map +1 -0
  286. package/dist/query/hooks/use-education-mutations.js +67 -0
  287. package/dist/query/hooks/use-education-mutations.js.map +1 -0
  288. package/dist/query/hooks/use-endorsement-inbox.js +80 -0
  289. package/dist/query/hooks/use-endorsement-inbox.js.map +1 -0
  290. package/dist/query/hooks/use-endorsement-mutations.js +33 -0
  291. package/dist/query/hooks/use-endorsement-mutations.js.map +1 -0
  292. package/dist/query/hooks/use-endorsement.js +20 -0
  293. package/dist/query/hooks/use-endorsement.js.map +1 -0
  294. package/dist/query/hooks/use-entity-search.js +73 -0
  295. package/dist/query/hooks/use-entity-search.js.map +1 -0
  296. package/dist/query/hooks/use-external-accounts.js +143 -0
  297. package/dist/query/hooks/use-external-accounts.js.map +1 -0
  298. package/dist/query/hooks/use-feature-allowlist.js +104 -0
  299. package/dist/query/hooks/use-feature-allowlist.js.map +1 -0
  300. package/dist/query/hooks/use-follow-extras.js +38 -0
  301. package/dist/query/hooks/use-follow-extras.js.map +1 -0
  302. package/dist/query/hooks/use-follow.js +113 -0
  303. package/dist/query/hooks/use-follow.js.map +1 -0
  304. package/dist/query/hooks/use-get-profile-view.js +20 -0
  305. package/dist/query/hooks/use-get-profile-view.js.map +1 -0
  306. package/dist/query/hooks/use-github-prs.js +21 -0
  307. package/dist/query/hooks/use-github-prs.js.map +1 -0
  308. package/dist/query/hooks/use-inbox.js +19 -0
  309. package/dist/query/hooks/use-inbox.js.map +1 -0
  310. package/dist/query/hooks/use-investment-mutations.js +65 -0
  311. package/dist/query/hooks/use-investment-mutations.js.map +1 -0
  312. package/dist/query/hooks/use-keytrace-claims.js +50 -0
  313. package/dist/query/hooks/use-keytrace-claims.js.map +1 -0
  314. package/dist/query/hooks/use-location-mutations.js +71 -0
  315. package/dist/query/hooks/use-location-mutations.js.map +1 -0
  316. package/dist/query/hooks/use-marque-domains.js +50 -0
  317. package/dist/query/hooks/use-marque-domains.js.map +1 -0
  318. package/dist/query/hooks/use-org-claim.js +29 -0
  319. package/dist/query/hooks/use-org-claim.js.map +1 -0
  320. package/dist/query/hooks/use-org-domains.js +28 -0
  321. package/dist/query/hooks/use-org-domains.js.map +1 -0
  322. package/dist/query/hooks/use-org-notification-emails.js +28 -0
  323. package/dist/query/hooks/use-org-notification-emails.js.map +1 -0
  324. package/dist/query/hooks/use-org-profile-settings.js +29 -0
  325. package/dist/query/hooks/use-org-profile-settings.js.map +1 -0
  326. package/dist/query/hooks/use-org-profile.js +21 -0
  327. package/dist/query/hooks/use-org-profile.js.map +1 -0
  328. package/dist/query/hooks/use-position-mutations.js +128 -0
  329. package/dist/query/hooks/use-position-mutations.js.map +1 -0
  330. package/dist/query/hooks/use-profile-completeness.js +21 -0
  331. package/dist/query/hooks/use-profile-completeness.js.map +1 -0
  332. package/dist/query/hooks/use-profile-items-hide.js +53 -0
  333. package/dist/query/hooks/use-profile-items-hide.js.map +1 -0
  334. package/dist/query/hooks/use-profile-mutations.js +143 -0
  335. package/dist/query/hooks/use-profile-mutations.js.map +1 -0
  336. package/dist/query/hooks/use-profile.js +30 -0
  337. package/dist/query/hooks/use-profile.js.map +1 -0
  338. package/dist/query/hooks/use-publication-mutations.js +90 -0
  339. package/dist/query/hooks/use-publication-mutations.js.map +1 -0
  340. package/dist/query/hooks/use-reaction-mutations.js +48 -0
  341. package/dist/query/hooks/use-reaction-mutations.js.map +1 -0
  342. package/dist/query/hooks/use-reactions.js +32 -0
  343. package/dist/query/hooks/use-reactions.js.map +1 -0
  344. package/dist/query/hooks/use-received-endorsements.js +23 -0
  345. package/dist/query/hooks/use-received-endorsements.js.map +1 -0
  346. package/dist/query/hooks/use-reciprocity.js +19 -0
  347. package/dist/query/hooks/use-reciprocity.js.map +1 -0
  348. package/dist/query/hooks/use-record-mutations.js +67 -0
  349. package/dist/query/hooks/use-record-mutations.js.map +1 -0
  350. package/dist/query/hooks/use-repo-inventory.js +43 -0
  351. package/dist/query/hooks/use-repo-inventory.js.map +1 -0
  352. package/dist/query/hooks/use-roadmap-mutations.js +51 -0
  353. package/dist/query/hooks/use-roadmap-mutations.js.map +1 -0
  354. package/dist/query/hooks/use-roadmap.js +31 -0
  355. package/dist/query/hooks/use-roadmap.js.map +1 -0
  356. package/dist/query/hooks/use-search.js +63 -0
  357. package/dist/query/hooks/use-search.js.map +1 -0
  358. package/dist/query/hooks/use-section-primary-mutations.js +53 -0
  359. package/dist/query/hooks/use-section-primary-mutations.js.map +1 -0
  360. package/dist/query/hooks/use-skill-mutations.js +91 -0
  361. package/dist/query/hooks/use-skill-mutations.js.map +1 -0
  362. package/dist/query/hooks/use-stats.js +19 -0
  363. package/dist/query/hooks/use-stats.js.map +1 -0
  364. package/dist/query/hooks/use-stream.js +20 -0
  365. package/dist/query/hooks/use-stream.js.map +1 -0
  366. package/dist/query/hooks/use-unlinked-positions.js +45 -0
  367. package/dist/query/hooks/use-unlinked-positions.js.map +1 -0
  368. package/dist/query/index.d.ts +4 -4
  369. package/dist/query/index.js +685 -3744
  370. package/dist/query/index.js.map +1 -1
  371. package/dist/query/keys.js +138 -0
  372. package/dist/query/keys.js.map +1 -0
  373. package/dist/repo/groups.js +81 -0
  374. package/dist/repo/groups.js.map +1 -0
  375. package/dist/repo/index.js +9 -0
  376. package/dist/repo/index.js.map +1 -0
  377. package/dist/repo/labels.js +121 -0
  378. package/dist/repo/labels.js.map +1 -0
  379. package/dist/repo/types.js +1 -0
  380. package/dist/repo/types.js.map +1 -0
  381. package/dist/resume/index.js +5 -179
  382. package/dist/resume/index.js.map +1 -1
  383. package/dist/resume/json-resume.js +153 -0
  384. package/dist/resume/json-resume.js.map +1 -0
  385. package/dist/roadmap/index.js +101 -0
  386. package/dist/roadmap/index.js.map +1 -0
  387. package/dist/rpg/catalog.js +101 -0
  388. package/dist/rpg/catalog.js.map +1 -0
  389. package/dist/rpg/index.js +13 -116
  390. package/dist/rpg/index.js.map +1 -1
  391. package/dist/rpg/unlocks.js +21 -0
  392. package/dist/rpg/unlocks.js.map +1 -0
  393. package/dist/schemas/blob-ref.js +12 -0
  394. package/dist/schemas/blob-ref.js.map +1 -0
  395. package/dist/schemas/confirmation.js +23 -0
  396. package/dist/schemas/confirmation.js.map +1 -0
  397. package/dist/schemas/endorsement-confirmation.js +18 -0
  398. package/dist/schemas/endorsement-confirmation.js.map +1 -0
  399. package/dist/schemas/endorsement.js +19 -0
  400. package/dist/schemas/endorsement.js.map +1 -0
  401. package/dist/schemas/entity.js +74 -0
  402. package/dist/schemas/entity.js.map +1 -0
  403. package/dist/schemas/feed.js +73 -0
  404. package/dist/schemas/feed.js.map +1 -0
  405. package/dist/schemas/follow-profile.js +32 -0
  406. package/dist/schemas/follow-profile.js.map +1 -0
  407. package/dist/schemas/graph-follow.js +19 -0
  408. package/dist/schemas/graph-follow.js.map +1 -0
  409. package/dist/schemas/index.js +164 -629
  410. package/dist/schemas/index.js.map +1 -1
  411. package/dist/schemas/org-employment-attestation.js +28 -0
  412. package/dist/schemas/org-employment-attestation.js.map +1 -0
  413. package/dist/schemas/org-profile.js +64 -0
  414. package/dist/schemas/org-profile.js.map +1 -0
  415. package/dist/schemas/profile-certification.js +28 -0
  416. package/dist/schemas/profile-certification.js.map +1 -0
  417. package/dist/schemas/profile-course.js +32 -0
  418. package/dist/schemas/profile-course.js.map +1 -0
  419. package/dist/schemas/profile-education.js +33 -0
  420. package/dist/schemas/profile-education.js.map +1 -0
  421. package/dist/schemas/profile-external-account.js +15 -0
  422. package/dist/schemas/profile-external-account.js.map +1 -0
  423. package/dist/schemas/profile-honor.js +18 -0
  424. package/dist/schemas/profile-honor.js.map +1 -0
  425. package/dist/schemas/profile-investment.js +48 -0
  426. package/dist/schemas/profile-investment.js.map +1 -0
  427. package/dist/schemas/profile-involvement.js +47 -0
  428. package/dist/schemas/profile-involvement.js.map +1 -0
  429. package/dist/schemas/profile-language.js +12 -0
  430. package/dist/schemas/profile-language.js.map +1 -0
  431. package/dist/schemas/profile-position.js +42 -0
  432. package/dist/schemas/profile-position.js.map +1 -0
  433. package/dist/schemas/profile-presentation-delivery.js +38 -0
  434. package/dist/schemas/profile-presentation-delivery.js.map +1 -0
  435. package/dist/schemas/profile-presentation.js +36 -0
  436. package/dist/schemas/profile-presentation.js.map +1 -0
  437. package/dist/schemas/profile-project.js +48 -0
  438. package/dist/schemas/profile-project.js.map +1 -0
  439. package/dist/schemas/profile-publication.js +30 -0
  440. package/dist/schemas/profile-publication.js.map +1 -0
  441. package/dist/schemas/profile-self.js +22 -0
  442. package/dist/schemas/profile-self.js.map +1 -0
  443. package/dist/schemas/profile-skill.js +13 -0
  444. package/dist/schemas/profile-skill.js.map +1 -0
  445. package/dist/schemas/profile-volunteering.js +20 -0
  446. package/dist/schemas/profile-volunteering.js.map +1 -0
  447. package/dist/schemas/shared.js +56 -0
  448. package/dist/schemas/shared.js.map +1 -0
  449. package/dist/schemas/write/certification.js +16 -0
  450. package/dist/schemas/write/certification.js.map +1 -0
  451. package/dist/schemas/write/course.js +36 -0
  452. package/dist/schemas/write/course.js.map +1 -0
  453. package/dist/schemas/write/education.js +18 -0
  454. package/dist/schemas/write/education.js.map +1 -0
  455. package/dist/schemas/write/external-account.js +13 -0
  456. package/dist/schemas/write/external-account.js.map +1 -0
  457. package/dist/schemas/write/honor.js +14 -0
  458. package/dist/schemas/write/honor.js.map +1 -0
  459. package/dist/schemas/write/index.d.ts +1 -1
  460. package/dist/schemas/write/index.js +89 -593
  461. package/dist/schemas/write/index.js.map +1 -1
  462. package/dist/schemas/write/investment.js +32 -0
  463. package/dist/schemas/write/investment.js.map +1 -0
  464. package/dist/schemas/write/involvement.js +34 -0
  465. package/dist/schemas/write/involvement.js.map +1 -0
  466. package/dist/schemas/write/language.js +10 -0
  467. package/dist/schemas/write/language.js.map +1 -0
  468. package/dist/schemas/write/org-claim.js +56 -0
  469. package/dist/schemas/write/org-claim.js.map +1 -0
  470. package/dist/schemas/write/org-employment-attestation.js +19 -0
  471. package/dist/schemas/write/org-employment-attestation.js.map +1 -0
  472. package/dist/schemas/write/org-profile.js +54 -0
  473. package/dist/schemas/write/org-profile.js.map +1 -0
  474. package/dist/schemas/write/org-settings.js +81 -0
  475. package/dist/schemas/write/org-settings.js.map +1 -0
  476. package/dist/schemas/write/position.js +24 -0
  477. package/dist/schemas/write/position.js.map +1 -0
  478. package/dist/schemas/write/presentation-delivery.js +34 -0
  479. package/dist/schemas/write/presentation-delivery.js.map +1 -0
  480. package/dist/schemas/write/presentation.js +23 -0
  481. package/dist/schemas/write/presentation.js.map +1 -0
  482. package/dist/schemas/write/profile-location.js +21 -0
  483. package/dist/schemas/write/profile-location.js.map +1 -0
  484. package/dist/schemas/write/profile-self.js +27 -0
  485. package/dist/schemas/write/profile-self.js.map +1 -0
  486. package/dist/schemas/write/project.js +27 -0
  487. package/dist/schemas/write/project.js.map +1 -0
  488. package/dist/schemas/write/publication.js +41 -0
  489. package/dist/schemas/write/publication.js.map +1 -0
  490. package/dist/schemas/write/shared.js +96 -0
  491. package/dist/schemas/write/shared.js.map +1 -0
  492. package/dist/schemas/write/skill.js +18 -0
  493. package/dist/schemas/write/skill.js.map +1 -0
  494. package/dist/schemas/write/volunteering.js +16 -0
  495. package/dist/schemas/write/volunteering.js.map +1 -0
  496. package/dist/stream/activity-item.js +1 -0
  497. package/dist/stream/activity-item.js.map +1 -0
  498. package/dist/stream/index.js +49 -0
  499. package/dist/stream/index.js.map +1 -0
  500. package/dist/stream/stream-card-vm-schema.js +265 -0
  501. package/dist/stream/stream-card-vm-schema.js.map +1 -0
  502. package/dist/stream/stream-card-vm.js +1 -0
  503. package/dist/stream/stream-card-vm.js.map +1 -0
  504. package/dist/stream/to-stream-card-vm.js +793 -0
  505. package/dist/stream/to-stream-card-vm.js.map +1 -0
  506. package/dist/stream/two-tier.js +30 -0
  507. package/dist/stream/two-tier.js.map +1 -0
  508. package/dist/stream/verbs.js +120 -0
  509. package/dist/stream/verbs.js.map +1 -0
  510. package/dist/taxonomy/activity-tiers.js +956 -0
  511. package/dist/taxonomy/activity-tiers.js.map +1 -0
  512. package/dist/taxonomy/app-categories.js +42 -0
  513. package/dist/taxonomy/app-categories.js.map +1 -0
  514. package/dist/taxonomy/app-category-map.js +166 -0
  515. package/dist/taxonomy/app-category-map.js.map +1 -0
  516. package/dist/taxonomy/artifact-link-kind.js +29 -0
  517. package/dist/taxonomy/artifact-link-kind.js.map +1 -0
  518. package/dist/taxonomy/calendar-event.js +28 -0
  519. package/dist/taxonomy/calendar-event.js.map +1 -0
  520. package/dist/taxonomy/continents.js +215 -0
  521. package/dist/taxonomy/continents.js.map +1 -0
  522. package/dist/taxonomy/countries.js +203 -0
  523. package/dist/taxonomy/countries.js.map +1 -0
  524. package/dist/taxonomy/course-role.js +37 -0
  525. package/dist/taxonomy/course-role.js.map +1 -0
  526. package/dist/taxonomy/employment-type.js +82 -0
  527. package/dist/taxonomy/employment-type.js.map +1 -0
  528. package/dist/taxonomy/eqf-level.js +59 -0
  529. package/dist/taxonomy/eqf-level.js.map +1 -0
  530. package/dist/taxonomy/index.js +263 -0
  531. package/dist/taxonomy/index.js.map +1 -0
  532. package/dist/taxonomy/industry-taxonomy.js +281 -0
  533. package/dist/taxonomy/industry-taxonomy.js.map +1 -0
  534. package/dist/taxonomy/investment.js +54 -0
  535. package/dist/taxonomy/investment.js.map +1 -0
  536. package/dist/taxonomy/involvement-kind.js +30 -0
  537. package/dist/taxonomy/involvement-kind.js.map +1 -0
  538. package/dist/taxonomy/open-to.js +128 -0
  539. package/dist/taxonomy/open-to.js.map +1 -0
  540. package/dist/taxonomy/platforms.js +56 -0
  541. package/dist/taxonomy/platforms.js.map +1 -0
  542. package/dist/taxonomy/presentation-link-type.js +22 -0
  543. package/dist/taxonomy/presentation-link-type.js.map +1 -0
  544. package/dist/taxonomy/presentation-role.js +21 -0
  545. package/dist/taxonomy/presentation-role.js.map +1 -0
  546. package/dist/taxonomy/publication-type.js +54 -0
  547. package/dist/taxonomy/publication-type.js.map +1 -0
  548. package/dist/taxonomy/relational.js +25 -0
  549. package/dist/taxonomy/relational.js.map +1 -0
  550. package/dist/taxonomy/search-filter-defs.js +66 -0
  551. package/dist/taxonomy/search-filter-defs.js.map +1 -0
  552. package/dist/taxonomy/skill-categories.js +28 -0
  553. package/dist/taxonomy/skill-categories.js.map +1 -0
  554. package/dist/taxonomy/skill-display-groups.js +12 -0
  555. package/dist/taxonomy/skill-display-groups.js.map +1 -0
  556. package/dist/taxonomy/skill-grouping.js +90 -0
  557. package/dist/taxonomy/skill-grouping.js.map +1 -0
  558. package/dist/taxonomy/verification-providers.js +69 -0
  559. package/dist/taxonomy/verification-providers.js.map +1 -0
  560. package/dist/taxonomy/workplace-type.js +38 -0
  561. package/dist/taxonomy/workplace-type.js.map +1 -0
  562. package/dist/tokens/colors.js +11 -0
  563. package/dist/tokens/colors.js.map +1 -0
  564. package/dist/tokens/icons.js +15 -0
  565. package/dist/tokens/icons.js.map +1 -0
  566. package/dist/tokens/index.js +10 -39
  567. package/dist/tokens/index.js.map +1 -1
  568. package/dist/tokens/typography.js +23 -0
  569. package/dist/tokens/typography.js.map +1 -0
  570. package/dist/types/index.js +10 -0
  571. package/dist/types/index.js.map +1 -0
  572. package/dist/types/profile-view.js +1 -0
  573. package/dist/types/profile-view.js.map +1 -0
  574. package/dist/{use-org-notification-emails-0hjt-dEw.d.ts → use-org-notification-emails-CWWi1D8t.d.ts} +2 -2
  575. package/package.json +4 -3
@@ -0,0 +1,113 @@
1
+ "use client";
2
+
3
+ // src/query/hooks/use-follow.ts
4
+ import {
5
+ useInfiniteQuery,
6
+ useMutation,
7
+ useQuery,
8
+ useQueryClient
9
+ } from "@tanstack/react-query";
10
+ import "../client.js";
11
+ import { useSifaConfig } from "../config.js";
12
+ import {
13
+ fetchFollowing,
14
+ fetchFollowingFeed,
15
+ followUser,
16
+ getFollowers,
17
+ getFollowing,
18
+ unfollowUser
19
+ } from "../fetchers/follow.js";
20
+ import { sifaQueryKeys } from "../keys.js";
21
+ function useFollowing(opts = {}, options) {
22
+ const config = useSifaConfig();
23
+ return useQuery({
24
+ queryKey: sifaQueryKeys.follow.following(opts),
25
+ queryFn: () => fetchFollowing(config, opts),
26
+ ...options
27
+ });
28
+ }
29
+ function useFollow(options) {
30
+ const config = useSifaConfig();
31
+ const queryClient = useQueryClient();
32
+ return useMutation({
33
+ // Spread first: a consumer-supplied handler would otherwise replace the
34
+ // one below and silently drop cache invalidation (#453).
35
+ ...options,
36
+ mutationFn: ({ handle, note }) => followUser(config, handle, { note }),
37
+ onSuccess: async (result, variables, onMutateResult, context) => {
38
+ if (result.success) {
39
+ await queryClient.invalidateQueries({ queryKey: sifaQueryKeys.follow.all() });
40
+ }
41
+ await options?.onSuccess?.(result, variables, onMutateResult, context);
42
+ },
43
+ onError: async (error, variables, onMutateResult, context) => {
44
+ await queryClient.invalidateQueries({ queryKey: sifaQueryKeys.follow.all() });
45
+ await options?.onError?.(error, variables, onMutateResult, context);
46
+ }
47
+ });
48
+ }
49
+ function useUnfollow(options) {
50
+ const config = useSifaConfig();
51
+ const queryClient = useQueryClient();
52
+ return useMutation({
53
+ // Spread first: a consumer-supplied handler would otherwise replace the
54
+ // one below and silently drop cache invalidation (#453).
55
+ ...options,
56
+ mutationFn: ({ handle }) => unfollowUser(config, handle),
57
+ onSuccess: async (result, variables, onMutateResult, context) => {
58
+ if (result.success) {
59
+ await queryClient.invalidateQueries({ queryKey: sifaQueryKeys.follow.all() });
60
+ }
61
+ await options?.onSuccess?.(result, variables, onMutateResult, context);
62
+ },
63
+ onError: async (error, variables, onMutateResult, context) => {
64
+ await queryClient.invalidateQueries({ queryKey: sifaQueryKeys.follow.all() });
65
+ await options?.onError?.(error, variables, onMutateResult, context);
66
+ }
67
+ });
68
+ }
69
+ function useFollowers(handle, opts = {}, options) {
70
+ const config = useSifaConfig();
71
+ return useInfiniteQuery({
72
+ queryKey: sifaQueryKeys.follow.followers(handle),
73
+ queryFn: ({ pageParam }) => getFollowers(config, handle, { ...opts, cursor: pageParam }),
74
+ initialPageParam: void 0,
75
+ getNextPageParam: (lastPage) => lastPage.cursor ?? void 0,
76
+ enabled: handle.length > 0,
77
+ ...options
78
+ });
79
+ }
80
+ function useFollowingList(handle, opts = {}, options) {
81
+ const config = useSifaConfig();
82
+ return useInfiniteQuery({
83
+ queryKey: sifaQueryKeys.follow.followingOf(handle),
84
+ queryFn: ({ pageParam }) => getFollowing(config, handle, { ...opts, cursor: pageParam }),
85
+ initialPageParam: void 0,
86
+ getNextPageParam: (lastPage) => lastPage.cursor ?? void 0,
87
+ enabled: handle.length > 0,
88
+ ...options
89
+ });
90
+ }
91
+ function useFollowingFeed(opts = {}, options) {
92
+ const config = useSifaConfig();
93
+ return useQuery({
94
+ // `app` is part of the key: each source tab is its own cache entry, so
95
+ // switching tabs does not serve the previous tab's items.
96
+ queryKey: sifaQueryKeys.follow.feed({
97
+ limit: opts.limit,
98
+ includeBluesky: opts.includeBluesky,
99
+ app: opts.app
100
+ }),
101
+ queryFn: () => fetchFollowingFeed(config, opts),
102
+ ...options
103
+ });
104
+ }
105
+ export {
106
+ useFollow,
107
+ useFollowers,
108
+ useFollowing,
109
+ useFollowingFeed,
110
+ useFollowingList,
111
+ useUnfollow
112
+ };
113
+ //# sourceMappingURL=use-follow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/query/hooks/use-follow.ts"],"sourcesContent":["'use client';\n\nimport {\n useInfiniteQuery,\n useMutation,\n useQuery,\n useQueryClient,\n type InfiniteData,\n type UseInfiniteQueryOptions,\n type UseMutationOptions,\n type UseQueryOptions,\n} from '@tanstack/react-query';\n\nimport { type WriteResult } from '../client.js';\nimport { useSifaConfig } from '../config.js';\nimport {\n fetchFollowing,\n fetchFollowingFeed,\n followUser,\n getFollowers,\n getFollowing,\n unfollowUser,\n type FetchFollowListOptions,\n type FetchFollowingFeedOptions,\n type FollowListPage,\n type FollowProfile,\n type FollowUserResult,\n type FollowingResponse,\n} from '../fetchers/follow.js';\nimport type { FollowingFeedResponse } from '../fetchers/follow.js';\nimport { sifaQueryKeys } from '../keys.js';\n\n/**\n * Legacy \"people I follow\" query. Kept as-is for back-compat with sifa-web\n * call sites that pre-date the V5 feed work. New code should use\n * {@link useFollowingList} (paginated per-profile) or\n * {@link useFollowingFeed} (V5 feed).\n */\nexport function useFollowing(\n opts: { source?: string; cursor?: string; limit?: number } = {},\n options?: Omit<\n UseQueryOptions<\n FollowingResponse,\n Error,\n FollowingResponse,\n ReturnType<typeof sifaQueryKeys.follow.following>\n >,\n 'queryKey' | 'queryFn'\n >,\n) {\n const config = useSifaConfig();\n return useQuery({\n queryKey: sifaQueryKeys.follow.following(opts as Record<string, unknown>),\n queryFn: () => fetchFollowing(config, opts),\n ...options,\n });\n}\n\n/** Variables for {@link useFollow}. */\nexport interface FollowVariables {\n handle: string;\n /** Server-resolved DID of the subject, when known. Used for optimistic cache writes. */\n subjectDid?: string;\n /** Optional Sifa-only \"why I followed\" note (max 200 graphemes). */\n note?: string;\n}\n\n/** Variables for {@link useUnfollow}. */\nexport interface UnfollowVariables {\n handle: string;\n}\n\n/**\n * Mutation hook for following a handle. Optimistically marks the\n * follow-state cache as `true` and rolls back on failure (per\n * sifa-api#673 TR8 / iter-1 plan TR8). Invalidates the followers /\n * following lists and the V5 feed on success so they refetch.\n *\n * Optimistic cache entry: `sifaQueryKeys.follow.followers(handle)`\n * receives the viewer prepended to the list shape; the optimistic update\n * is intentionally conservative — it only flips per-handle state and\n * doesn't try to invent rich `FollowProfile` fields.\n */\nexport function useFollow(\n options?: Omit<UseMutationOptions<FollowUserResult, Error, FollowVariables>, 'mutationFn'>,\n) {\n const config = useSifaConfig();\n const queryClient = useQueryClient();\n return useMutation({\n // Spread first: a consumer-supplied handler would otherwise replace the\n // one below and silently drop cache invalidation (#453).\n ...options,\n mutationFn: ({ handle, note }: FollowVariables) => followUser(config, handle, { note }),\n onSuccess: async (result, variables, onMutateResult, context) => {\n if (result.success) {\n await queryClient.invalidateQueries({ queryKey: sifaQueryKeys.follow.all() });\n }\n await options?.onSuccess?.(result, variables, onMutateResult, context);\n },\n onError: async (error, variables, onMutateResult, context) => {\n // Rollback: refetch the affected lists so stale optimistic state is reset.\n await queryClient.invalidateQueries({ queryKey: sifaQueryKeys.follow.all() });\n await options?.onError?.(error, variables, onMutateResult, context);\n },\n });\n}\n\n/**\n * Mutation hook for unfollowing a handle. Optimistic + rollback mirror\n * of {@link useFollow}.\n */\nexport function useUnfollow(\n options?: Omit<UseMutationOptions<WriteResult, Error, UnfollowVariables>, 'mutationFn'>,\n) {\n const config = useSifaConfig();\n const queryClient = useQueryClient();\n return useMutation({\n // Spread first: a consumer-supplied handler would otherwise replace the\n // one below and silently drop cache invalidation (#453).\n ...options,\n mutationFn: ({ handle }: UnfollowVariables) => unfollowUser(config, handle),\n onSuccess: async (result, variables, onMutateResult, context) => {\n if (result.success) {\n await queryClient.invalidateQueries({ queryKey: sifaQueryKeys.follow.all() });\n }\n await options?.onSuccess?.(result, variables, onMutateResult, context);\n },\n onError: async (error, variables, onMutateResult, context) => {\n await queryClient.invalidateQueries({ queryKey: sifaQueryKeys.follow.all() });\n await options?.onError?.(error, variables, onMutateResult, context);\n },\n });\n}\n\n/** Infinite-query hook for `handle`'s followers list. */\nexport function useFollowers(\n handle: string,\n opts: Omit<FetchFollowListOptions, 'cursor'> = {},\n options?: Omit<\n UseInfiniteQueryOptions<\n FollowListPage,\n Error,\n InfiniteData<FollowListPage>,\n ReturnType<typeof sifaQueryKeys.follow.followers>,\n string | undefined\n >,\n 'queryKey' | 'queryFn' | 'initialPageParam' | 'getNextPageParam'\n >,\n) {\n const config = useSifaConfig();\n return useInfiniteQuery({\n queryKey: sifaQueryKeys.follow.followers(handle),\n queryFn: ({ pageParam }) => getFollowers(config, handle, { ...opts, cursor: pageParam }),\n initialPageParam: undefined as string | undefined,\n getNextPageParam: (lastPage: FollowListPage) => lastPage.cursor ?? undefined,\n enabled: handle.length > 0,\n ...options,\n });\n}\n\n/** Infinite-query hook for who `handle` follows. */\nexport function useFollowingList(\n handle: string,\n opts: Omit<FetchFollowListOptions, 'cursor'> = {},\n options?: Omit<\n UseInfiniteQueryOptions<\n FollowListPage,\n Error,\n InfiniteData<FollowListPage>,\n ReturnType<typeof sifaQueryKeys.follow.followingOf>,\n string | undefined\n >,\n 'queryKey' | 'queryFn' | 'initialPageParam' | 'getNextPageParam'\n >,\n) {\n const config = useSifaConfig();\n return useInfiniteQuery({\n queryKey: sifaQueryKeys.follow.followingOf(handle),\n queryFn: ({ pageParam }) => getFollowing(config, handle, { ...opts, cursor: pageParam }),\n initialPageParam: undefined as string | undefined,\n getNextPageParam: (lastPage: FollowListPage) => lastPage.cursor ?? undefined,\n enabled: handle.length > 0,\n ...options,\n });\n}\n\n/**\n * Infinite-query hook for the V5 home feed (authenticated viewer).\n *\n * The viewer's cross-app following feed: what OTHER apps their connections use.\n * See {@link fetchFollowingFeed}. v1 is a finite first page (no infinite scroll\n * yet). The native app must set `config.getAuthToken`; web uses its cookie.\n */\nexport function useFollowingFeed(\n opts: FetchFollowingFeedOptions = {},\n options?: Omit<\n UseQueryOptions<\n FollowingFeedResponse | null,\n Error,\n FollowingFeedResponse | null,\n ReturnType<typeof sifaQueryKeys.follow.feed>\n >,\n 'queryKey' | 'queryFn'\n >,\n) {\n const config = useSifaConfig();\n return useQuery({\n // `app` is part of the key: each source tab is its own cache entry, so\n // switching tabs does not serve the previous tab's items.\n queryKey: sifaQueryKeys.follow.feed({\n limit: opts.limit,\n includeBluesky: opts.includeBluesky,\n app: opts.app,\n }),\n queryFn: () => fetchFollowingFeed(config, opts),\n ...options,\n });\n}\n\n// Re-export for convenience so consumers only need one import path for the type.\nexport type { FollowProfile };\n"],"mappings":";;;AAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AAEP,OAAiC;AACjC,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAOK;AAEP,SAAS,qBAAqB;AAQvB,SAAS,aACd,OAA6D,CAAC,GAC9D,SASA;AACA,QAAM,SAAS,cAAc;AAC7B,SAAO,SAAS;AAAA,IACd,UAAU,cAAc,OAAO,UAAU,IAA+B;AAAA,IACxE,SAAS,MAAM,eAAe,QAAQ,IAAI;AAAA,IAC1C,GAAG;AAAA,EACL,CAAC;AACH;AA2BO,SAAS,UACd,SACA;AACA,QAAM,SAAS,cAAc;AAC7B,QAAM,cAAc,eAAe;AACnC,SAAO,YAAY;AAAA;AAAA;AAAA,IAGjB,GAAG;AAAA,IACH,YAAY,CAAC,EAAE,QAAQ,KAAK,MAAuB,WAAW,QAAQ,QAAQ,EAAE,KAAK,CAAC;AAAA,IACtF,WAAW,OAAO,QAAQ,WAAW,gBAAgB,YAAY;AAC/D,UAAI,OAAO,SAAS;AAClB,cAAM,YAAY,kBAAkB,EAAE,UAAU,cAAc,OAAO,IAAI,EAAE,CAAC;AAAA,MAC9E;AACA,YAAM,SAAS,YAAY,QAAQ,WAAW,gBAAgB,OAAO;AAAA,IACvE;AAAA,IACA,SAAS,OAAO,OAAO,WAAW,gBAAgB,YAAY;AAE5D,YAAM,YAAY,kBAAkB,EAAE,UAAU,cAAc,OAAO,IAAI,EAAE,CAAC;AAC5E,YAAM,SAAS,UAAU,OAAO,WAAW,gBAAgB,OAAO;AAAA,IACpE;AAAA,EACF,CAAC;AACH;AAMO,SAAS,YACd,SACA;AACA,QAAM,SAAS,cAAc;AAC7B,QAAM,cAAc,eAAe;AACnC,SAAO,YAAY;AAAA;AAAA;AAAA,IAGjB,GAAG;AAAA,IACH,YAAY,CAAC,EAAE,OAAO,MAAyB,aAAa,QAAQ,MAAM;AAAA,IAC1E,WAAW,OAAO,QAAQ,WAAW,gBAAgB,YAAY;AAC/D,UAAI,OAAO,SAAS;AAClB,cAAM,YAAY,kBAAkB,EAAE,UAAU,cAAc,OAAO,IAAI,EAAE,CAAC;AAAA,MAC9E;AACA,YAAM,SAAS,YAAY,QAAQ,WAAW,gBAAgB,OAAO;AAAA,IACvE;AAAA,IACA,SAAS,OAAO,OAAO,WAAW,gBAAgB,YAAY;AAC5D,YAAM,YAAY,kBAAkB,EAAE,UAAU,cAAc,OAAO,IAAI,EAAE,CAAC;AAC5E,YAAM,SAAS,UAAU,OAAO,WAAW,gBAAgB,OAAO;AAAA,IACpE;AAAA,EACF,CAAC;AACH;AAGO,SAAS,aACd,QACA,OAA+C,CAAC,GAChD,SAUA;AACA,QAAM,SAAS,cAAc;AAC7B,SAAO,iBAAiB;AAAA,IACtB,UAAU,cAAc,OAAO,UAAU,MAAM;AAAA,IAC/C,SAAS,CAAC,EAAE,UAAU,MAAM,aAAa,QAAQ,QAAQ,EAAE,GAAG,MAAM,QAAQ,UAAU,CAAC;AAAA,IACvF,kBAAkB;AAAA,IAClB,kBAAkB,CAAC,aAA6B,SAAS,UAAU;AAAA,IACnE,SAAS,OAAO,SAAS;AAAA,IACzB,GAAG;AAAA,EACL,CAAC;AACH;AAGO,SAAS,iBACd,QACA,OAA+C,CAAC,GAChD,SAUA;AACA,QAAM,SAAS,cAAc;AAC7B,SAAO,iBAAiB;AAAA,IACtB,UAAU,cAAc,OAAO,YAAY,MAAM;AAAA,IACjD,SAAS,CAAC,EAAE,UAAU,MAAM,aAAa,QAAQ,QAAQ,EAAE,GAAG,MAAM,QAAQ,UAAU,CAAC;AAAA,IACvF,kBAAkB;AAAA,IAClB,kBAAkB,CAAC,aAA6B,SAAS,UAAU;AAAA,IACnE,SAAS,OAAO,SAAS;AAAA,IACzB,GAAG;AAAA,EACL,CAAC;AACH;AASO,SAAS,iBACd,OAAkC,CAAC,GACnC,SASA;AACA,QAAM,SAAS,cAAc;AAC7B,SAAO,SAAS;AAAA;AAAA;AAAA,IAGd,UAAU,cAAc,OAAO,KAAK;AAAA,MAClC,OAAO,KAAK;AAAA,MACZ,gBAAgB,KAAK;AAAA,MACrB,KAAK,KAAK;AAAA,IACZ,CAAC;AAAA,IACD,SAAS,MAAM,mBAAmB,QAAQ,IAAI;AAAA,IAC9C,GAAG;AAAA,EACL,CAAC;AACH;","names":[]}
@@ -0,0 +1,20 @@
1
+ "use client";
2
+
3
+ // src/query/hooks/use-get-profile-view.ts
4
+ import { useQuery } from "@tanstack/react-query";
5
+ import { useSifaConfig } from "../config.js";
6
+ import { fetchGetProfileView } from "../fetchers/get-profile-view.js";
7
+ import { sifaQueryKeys } from "../keys.js";
8
+ function useGetProfileView(actor, options) {
9
+ const config = useSifaConfig();
10
+ return useQuery({
11
+ queryKey: sifaQueryKeys.profile.view(actor ?? ""),
12
+ queryFn: () => fetchGetProfileView(config, actor ?? ""),
13
+ enabled: Boolean(actor) && (options?.enabled ?? true),
14
+ ...options
15
+ });
16
+ }
17
+ export {
18
+ useGetProfileView
19
+ };
20
+ //# sourceMappingURL=use-get-profile-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/query/hooks/use-get-profile-view.ts"],"sourcesContent":["'use client';\n\nimport { useQuery, type UseQueryOptions } from '@tanstack/react-query';\n\nimport type { ProfileView } from '../../types/profile-view.js';\nimport { useSifaConfig } from '../config.js';\nimport { fetchGetProfileView } from '../fetchers/get-profile-view.js';\nimport { sifaQueryKeys } from '../keys.js';\n\n/**\n * React hook that reads the aggregated public profile view via the\n * `id.sifa.getProfileView` XRPC query. Returns `null` data when the profile\n * does not exist.\n *\n * Pass `{ enabled: false }` (or an empty `actor`) to defer the fetch.\n */\nexport function useGetProfileView(\n actor: string | undefined | null,\n options?: Omit<\n UseQueryOptions<\n ProfileView | null,\n Error,\n ProfileView | null,\n ReturnType<typeof sifaQueryKeys.profile.view>\n >,\n 'queryKey' | 'queryFn'\n >,\n) {\n const config = useSifaConfig();\n return useQuery({\n queryKey: sifaQueryKeys.profile.view(actor ?? ''),\n queryFn: () => fetchGetProfileView(config, actor ?? ''),\n enabled: Boolean(actor) && (options?.enabled ?? true),\n ...options,\n });\n}\n"],"mappings":";;;AAEA,SAAS,gBAAsC;AAG/C,SAAS,qBAAqB;AAC9B,SAAS,2BAA2B;AACpC,SAAS,qBAAqB;AASvB,SAAS,kBACd,OACA,SASA;AACA,QAAM,SAAS,cAAc;AAC7B,SAAO,SAAS;AAAA,IACd,UAAU,cAAc,QAAQ,KAAK,SAAS,EAAE;AAAA,IAChD,SAAS,MAAM,oBAAoB,QAAQ,SAAS,EAAE;AAAA,IACtD,SAAS,QAAQ,KAAK,MAAM,SAAS,WAAW;AAAA,IAChD,GAAG;AAAA,EACL,CAAC;AACH;","names":[]}
@@ -0,0 +1,21 @@
1
+ "use client";
2
+
3
+ // src/query/hooks/use-github-prs.ts
4
+ import { useQuery } from "@tanstack/react-query";
5
+ import { useSifaConfig } from "../config.js";
6
+ import {
7
+ fetchMyGithubPullRequests
8
+ } from "../fetchers/github-prs.js";
9
+ import { sifaQueryKeys } from "../keys.js";
10
+ function useMyGithubPullRequests(params = {}, options) {
11
+ const config = useSifaConfig();
12
+ return useQuery({
13
+ queryKey: sifaQueryKeys.github.myPullRequests(params),
14
+ queryFn: () => fetchMyGithubPullRequests(config, params),
15
+ ...options
16
+ });
17
+ }
18
+ export {
19
+ useMyGithubPullRequests
20
+ };
21
+ //# sourceMappingURL=use-github-prs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/query/hooks/use-github-prs.ts"],"sourcesContent":["'use client';\n\nimport { useQuery, type UseQueryOptions } from '@tanstack/react-query';\n\nimport { useSifaConfig } from '../config.js';\nimport {\n fetchMyGithubPullRequests,\n type MyGithubPullRequestsResponse,\n} from '../fetchers/github-prs.js';\nimport { sifaQueryKeys } from '../keys.js';\n\nexport interface UseMyGithubPullRequestsParams {\n limit?: number;\n offset?: number;\n}\n\n/**\n * The authenticated viewer's own ingested merged PRs (newest first). Auth-scoped\n * via the session cookie. Backs the sifa-web GitHub importer (issue #302).\n */\nexport function useMyGithubPullRequests(\n params: UseMyGithubPullRequestsParams = {},\n options?: Omit<\n UseQueryOptions<\n MyGithubPullRequestsResponse,\n Error,\n MyGithubPullRequestsResponse,\n ReturnType<typeof sifaQueryKeys.github.myPullRequests>\n >,\n 'queryKey' | 'queryFn'\n >,\n) {\n const config = useSifaConfig();\n return useQuery({\n queryKey: sifaQueryKeys.github.myPullRequests(params),\n queryFn: () => fetchMyGithubPullRequests(config, params),\n ...options,\n });\n}\n"],"mappings":";;;AAEA,SAAS,gBAAsC;AAE/C,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,OAEK;AACP,SAAS,qBAAqB;AAWvB,SAAS,wBACd,SAAwC,CAAC,GACzC,SASA;AACA,QAAM,SAAS,cAAc;AAC7B,SAAO,SAAS;AAAA,IACd,UAAU,cAAc,OAAO,eAAe,MAAM;AAAA,IACpD,SAAS,MAAM,0BAA0B,QAAQ,MAAM;AAAA,IACvD,GAAG;AAAA,EACL,CAAC;AACH;","names":[]}
@@ -0,0 +1,19 @@
1
+ "use client";
2
+
3
+ // src/query/hooks/use-inbox.ts
4
+ import { useQuery } from "@tanstack/react-query";
5
+ import { useSifaConfig } from "../config.js";
6
+ import { fetchInboxCounts } from "../fetchers/inbox.js";
7
+ import { sifaQueryKeys } from "../keys.js";
8
+ function useInboxCounts(options) {
9
+ const config = useSifaConfig();
10
+ return useQuery({
11
+ queryKey: sifaQueryKeys.inbox.counts(),
12
+ queryFn: () => fetchInboxCounts(config),
13
+ ...options
14
+ });
15
+ }
16
+ export {
17
+ useInboxCounts
18
+ };
19
+ //# sourceMappingURL=use-inbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/query/hooks/use-inbox.ts"],"sourcesContent":["'use client';\n\nimport { useQuery, type UseQueryOptions } from '@tanstack/react-query';\n\nimport { useSifaConfig } from '../config.js';\nimport { fetchInboxCounts, type InboxCounts } from '../fetchers/inbox.js';\nimport { sifaQueryKeys } from '../keys.js';\n\n/**\n * Combined inbox counts (`tasks` + `unreadNotifications`) for the header bell.\n * Returns zeros when signed out or on error, so the bell renders \"nothing\n * waiting\" without special-casing. See {@link InboxCounts} for what `tasks`\n * covers and why the two numbers are disjoint.\n */\nexport function useInboxCounts(\n options?: Omit<\n UseQueryOptions<InboxCounts, Error, InboxCounts, ReturnType<typeof sifaQueryKeys.inbox.counts>>,\n 'queryKey' | 'queryFn'\n >,\n) {\n const config = useSifaConfig();\n return useQuery({\n queryKey: sifaQueryKeys.inbox.counts(),\n queryFn: () => fetchInboxCounts(config),\n ...options,\n });\n}\n"],"mappings":";;;AAEA,SAAS,gBAAsC;AAE/C,SAAS,qBAAqB;AAC9B,SAAS,wBAA0C;AACnD,SAAS,qBAAqB;AAQvB,SAAS,eACd,SAIA;AACA,QAAM,SAAS,cAAc;AAC7B,SAAO,SAAS;AAAA,IACd,UAAU,cAAc,MAAM,OAAO;AAAA,IACrC,SAAS,MAAM,iBAAiB,MAAM;AAAA,IACtC,GAAG;AAAA,EACL,CAAC;AACH;","names":[]}
@@ -0,0 +1,65 @@
1
+ "use client";
2
+
3
+ // src/query/hooks/use-investment-mutations.ts
4
+ import { useMutation, useQueryClient } from "@tanstack/react-query";
5
+ import { useSifaConfig } from "../config.js";
6
+ import {
7
+ createInvestment,
8
+ updateInvestment,
9
+ deleteInvestment
10
+ } from "../fetchers/investments.js";
11
+ import { sifaQueryKeys } from "../keys.js";
12
+ function useCreateInvestment(ownerDid, options) {
13
+ const config = useSifaConfig();
14
+ const queryClient = useQueryClient();
15
+ return useMutation({
16
+ // Spread first: a consumer-supplied onSuccess would otherwise replace the handler
17
+ // below and silently drop cache invalidation. The handler forwards to it instead.
18
+ ...options,
19
+ mutationFn: (data) => createInvestment(config, data),
20
+ onSuccess: async (result, variables, onMutateResult, context) => {
21
+ if (result.success) {
22
+ await queryClient.invalidateQueries({ queryKey: sifaQueryKeys.profile.byHandle(ownerDid) });
23
+ }
24
+ await options?.onSuccess?.(result, variables, onMutateResult, context);
25
+ }
26
+ });
27
+ }
28
+ function useUpdateInvestment(ownerDid, options) {
29
+ const config = useSifaConfig();
30
+ const queryClient = useQueryClient();
31
+ return useMutation({
32
+ // Spread first: a consumer-supplied onSuccess would otherwise replace the handler
33
+ // below and silently drop cache invalidation. The handler forwards to it instead.
34
+ ...options,
35
+ mutationFn: ({ rkey, data }) => updateInvestment(config, rkey, data),
36
+ onSuccess: async (result, variables, onMutateResult, context) => {
37
+ if (result.success) {
38
+ await queryClient.invalidateQueries({ queryKey: sifaQueryKeys.profile.byHandle(ownerDid) });
39
+ }
40
+ await options?.onSuccess?.(result, variables, onMutateResult, context);
41
+ }
42
+ });
43
+ }
44
+ function useDeleteInvestment(ownerDid, options) {
45
+ const config = useSifaConfig();
46
+ const queryClient = useQueryClient();
47
+ return useMutation({
48
+ // Spread first: a consumer-supplied onSuccess would otherwise replace the handler
49
+ // below and silently drop cache invalidation. The handler forwards to it instead.
50
+ ...options,
51
+ mutationFn: (rkey) => deleteInvestment(config, rkey),
52
+ onSuccess: async (result, variables, onMutateResult, context) => {
53
+ if (result.success) {
54
+ await queryClient.invalidateQueries({ queryKey: sifaQueryKeys.profile.byHandle(ownerDid) });
55
+ }
56
+ await options?.onSuccess?.(result, variables, onMutateResult, context);
57
+ }
58
+ });
59
+ }
60
+ export {
61
+ useCreateInvestment,
62
+ useDeleteInvestment,
63
+ useUpdateInvestment
64
+ };
65
+ //# sourceMappingURL=use-investment-mutations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/query/hooks/use-investment-mutations.ts"],"sourcesContent":["'use client';\n\nimport { useMutation, useQueryClient, type UseMutationOptions } from '@tanstack/react-query';\n\nimport { useSifaConfig } from '../config.js';\nimport {\n createInvestment,\n updateInvestment,\n deleteInvestment,\n type CreateResult,\n type WriteResult,\n} from '../fetchers/investments.js';\nimport { sifaQueryKeys } from '../keys.js';\n\n/**\n * React hooks for investment records. Each invalidates the owner's profile cache on\n * success so the section reflects the write on the next read.\n *\n * The owner DID is required so the mutation can target the correct cache entry.\n */\nexport function useCreateInvestment(\n ownerDid: string,\n options?: Omit<UseMutationOptions<CreateResult, Error, Record<string, unknown>>, 'mutationFn'>,\n) {\n const config = useSifaConfig();\n const queryClient = useQueryClient();\n\n return useMutation({\n // Spread first: a consumer-supplied onSuccess would otherwise replace the handler\n // below and silently drop cache invalidation. The handler forwards to it instead.\n ...options,\n mutationFn: (data: Record<string, unknown>) => createInvestment(config, data),\n onSuccess: async (result, variables, onMutateResult, context) => {\n if (result.success) {\n await queryClient.invalidateQueries({ queryKey: sifaQueryKeys.profile.byHandle(ownerDid) });\n }\n await options?.onSuccess?.(result, variables, onMutateResult, context);\n },\n });\n}\n\nexport function useUpdateInvestment(\n ownerDid: string,\n options?: Omit<\n UseMutationOptions<WriteResult, Error, { rkey: string; data: Record<string, unknown> }>,\n 'mutationFn'\n >,\n) {\n const config = useSifaConfig();\n const queryClient = useQueryClient();\n\n return useMutation({\n // Spread first: a consumer-supplied onSuccess would otherwise replace the handler\n // below and silently drop cache invalidation. The handler forwards to it instead.\n ...options,\n mutationFn: ({ rkey, data }: { rkey: string; data: Record<string, unknown> }) =>\n updateInvestment(config, rkey, data),\n onSuccess: async (result, variables, onMutateResult, context) => {\n if (result.success) {\n await queryClient.invalidateQueries({ queryKey: sifaQueryKeys.profile.byHandle(ownerDid) });\n }\n await options?.onSuccess?.(result, variables, onMutateResult, context);\n },\n });\n}\n\nexport function useDeleteInvestment(\n ownerDid: string,\n options?: Omit<UseMutationOptions<WriteResult, Error, string>, 'mutationFn'>,\n) {\n const config = useSifaConfig();\n const queryClient = useQueryClient();\n\n return useMutation({\n // Spread first: a consumer-supplied onSuccess would otherwise replace the handler\n // below and silently drop cache invalidation. The handler forwards to it instead.\n ...options,\n mutationFn: (rkey: string) => deleteInvestment(config, rkey),\n onSuccess: async (result, variables, onMutateResult, context) => {\n if (result.success) {\n await queryClient.invalidateQueries({ queryKey: sifaQueryKeys.profile.byHandle(ownerDid) });\n }\n await options?.onSuccess?.(result, variables, onMutateResult, context);\n },\n });\n}\n"],"mappings":";;;AAEA,SAAS,aAAa,sBAA+C;AAErE,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,SAAS,qBAAqB;AAQvB,SAAS,oBACd,UACA,SACA;AACA,QAAM,SAAS,cAAc;AAC7B,QAAM,cAAc,eAAe;AAEnC,SAAO,YAAY;AAAA;AAAA;AAAA,IAGjB,GAAG;AAAA,IACH,YAAY,CAAC,SAAkC,iBAAiB,QAAQ,IAAI;AAAA,IAC5E,WAAW,OAAO,QAAQ,WAAW,gBAAgB,YAAY;AAC/D,UAAI,OAAO,SAAS;AAClB,cAAM,YAAY,kBAAkB,EAAE,UAAU,cAAc,QAAQ,SAAS,QAAQ,EAAE,CAAC;AAAA,MAC5F;AACA,YAAM,SAAS,YAAY,QAAQ,WAAW,gBAAgB,OAAO;AAAA,IACvE;AAAA,EACF,CAAC;AACH;AAEO,SAAS,oBACd,UACA,SAIA;AACA,QAAM,SAAS,cAAc;AAC7B,QAAM,cAAc,eAAe;AAEnC,SAAO,YAAY;AAAA;AAAA;AAAA,IAGjB,GAAG;AAAA,IACH,YAAY,CAAC,EAAE,MAAM,KAAK,MACxB,iBAAiB,QAAQ,MAAM,IAAI;AAAA,IACrC,WAAW,OAAO,QAAQ,WAAW,gBAAgB,YAAY;AAC/D,UAAI,OAAO,SAAS;AAClB,cAAM,YAAY,kBAAkB,EAAE,UAAU,cAAc,QAAQ,SAAS,QAAQ,EAAE,CAAC;AAAA,MAC5F;AACA,YAAM,SAAS,YAAY,QAAQ,WAAW,gBAAgB,OAAO;AAAA,IACvE;AAAA,EACF,CAAC;AACH;AAEO,SAAS,oBACd,UACA,SACA;AACA,QAAM,SAAS,cAAc;AAC7B,QAAM,cAAc,eAAe;AAEnC,SAAO,YAAY;AAAA;AAAA;AAAA,IAGjB,GAAG;AAAA,IACH,YAAY,CAAC,SAAiB,iBAAiB,QAAQ,IAAI;AAAA,IAC3D,WAAW,OAAO,QAAQ,WAAW,gBAAgB,YAAY;AAC/D,UAAI,OAAO,SAAS;AAClB,cAAM,YAAY,kBAAkB,EAAE,UAAU,cAAc,QAAQ,SAAS,QAAQ,EAAE,CAAC;AAAA,MAC5F;AACA,YAAM,SAAS,YAAY,QAAQ,WAAW,gBAAgB,OAAO;AAAA,IACvE;AAAA,EACF,CAAC;AACH;","names":[]}
@@ -0,0 +1,50 @@
1
+ "use client";
2
+
3
+ // src/query/hooks/use-keytrace-claims.ts
4
+ import { useMutation, useQueryClient } from "@tanstack/react-query";
5
+ import "../client.js";
6
+ import { useSifaConfig } from "../config.js";
7
+ import { hideKeytraceClaim, unhideKeytraceClaim } from "../fetchers/keytrace-claims.js";
8
+ import { sifaQueryKeys } from "../keys.js";
9
+ async function invalidateProfile(queryClient, ownerHandleOrDid) {
10
+ await queryClient.invalidateQueries({
11
+ queryKey: sifaQueryKeys.profile.byHandle(ownerHandleOrDid)
12
+ });
13
+ }
14
+ function useHideKeytraceClaim(ownerHandleOrDid, options) {
15
+ const config = useSifaConfig();
16
+ const queryClient = useQueryClient();
17
+ return useMutation({
18
+ // Spread first: a consumer-supplied onSuccess would otherwise replace the
19
+ // handler below and silently drop cache invalidation (#453).
20
+ ...options,
21
+ mutationFn: (rkey) => hideKeytraceClaim(config, rkey),
22
+ onSuccess: async (result, variables, onMutateResult, context) => {
23
+ if (result.success) {
24
+ await invalidateProfile(queryClient, ownerHandleOrDid);
25
+ }
26
+ await options?.onSuccess?.(result, variables, onMutateResult, context);
27
+ }
28
+ });
29
+ }
30
+ function useUnhideKeytraceClaim(ownerHandleOrDid, options) {
31
+ const config = useSifaConfig();
32
+ const queryClient = useQueryClient();
33
+ return useMutation({
34
+ // Spread first: a consumer-supplied onSuccess would otherwise replace the
35
+ // handler below and silently drop cache invalidation (#453).
36
+ ...options,
37
+ mutationFn: (rkey) => unhideKeytraceClaim(config, rkey),
38
+ onSuccess: async (result, variables, onMutateResult, context) => {
39
+ if (result.success) {
40
+ await invalidateProfile(queryClient, ownerHandleOrDid);
41
+ }
42
+ await options?.onSuccess?.(result, variables, onMutateResult, context);
43
+ }
44
+ });
45
+ }
46
+ export {
47
+ useHideKeytraceClaim,
48
+ useUnhideKeytraceClaim
49
+ };
50
+ //# sourceMappingURL=use-keytrace-claims.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/query/hooks/use-keytrace-claims.ts"],"sourcesContent":["'use client';\n\nimport { useMutation, useQueryClient, type UseMutationOptions } from '@tanstack/react-query';\n\nimport { type WriteResult } from '../client.js';\nimport { useSifaConfig } from '../config.js';\nimport { hideKeytraceClaim, unhideKeytraceClaim } from '../fetchers/keytrace-claims.js';\nimport { sifaQueryKeys } from '../keys.js';\n\nasync function invalidateProfile(\n queryClient: ReturnType<typeof useQueryClient>,\n ownerHandleOrDid: string,\n): Promise<void> {\n await queryClient.invalidateQueries({\n queryKey: sifaQueryKeys.profile.byHandle(ownerHandleOrDid),\n });\n}\n\n/** React hook for hiding a keytrace claim. Variable: the claim `rkey` string. */\nexport function useHideKeytraceClaim(\n ownerHandleOrDid: string,\n options?: Omit<UseMutationOptions<WriteResult, Error, string>, 'mutationFn'>,\n) {\n const config = useSifaConfig();\n const queryClient = useQueryClient();\n return useMutation({\n // Spread first: a consumer-supplied onSuccess would otherwise replace the\n // handler below and silently drop cache invalidation (#453).\n ...options,\n mutationFn: (rkey: string) => hideKeytraceClaim(config, rkey),\n onSuccess: async (result, variables, onMutateResult, context) => {\n if (result.success) {\n await invalidateProfile(queryClient, ownerHandleOrDid);\n }\n await options?.onSuccess?.(result, variables, onMutateResult, context);\n },\n });\n}\n\n/** React hook for unhiding a previously-hidden keytrace claim. */\nexport function useUnhideKeytraceClaim(\n ownerHandleOrDid: string,\n options?: Omit<UseMutationOptions<WriteResult, Error, string>, 'mutationFn'>,\n) {\n const config = useSifaConfig();\n const queryClient = useQueryClient();\n return useMutation({\n // Spread first: a consumer-supplied onSuccess would otherwise replace the\n // handler below and silently drop cache invalidation (#453).\n ...options,\n mutationFn: (rkey: string) => unhideKeytraceClaim(config, rkey),\n onSuccess: async (result, variables, onMutateResult, context) => {\n if (result.success) {\n await invalidateProfile(queryClient, ownerHandleOrDid);\n }\n await options?.onSuccess?.(result, variables, onMutateResult, context);\n },\n });\n}\n"],"mappings":";;;AAEA,SAAS,aAAa,sBAA+C;AAErE,OAAiC;AACjC,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB,2BAA2B;AACvD,SAAS,qBAAqB;AAE9B,eAAe,kBACb,aACA,kBACe;AACf,QAAM,YAAY,kBAAkB;AAAA,IAClC,UAAU,cAAc,QAAQ,SAAS,gBAAgB;AAAA,EAC3D,CAAC;AACH;AAGO,SAAS,qBACd,kBACA,SACA;AACA,QAAM,SAAS,cAAc;AAC7B,QAAM,cAAc,eAAe;AACnC,SAAO,YAAY;AAAA;AAAA;AAAA,IAGjB,GAAG;AAAA,IACH,YAAY,CAAC,SAAiB,kBAAkB,QAAQ,IAAI;AAAA,IAC5D,WAAW,OAAO,QAAQ,WAAW,gBAAgB,YAAY;AAC/D,UAAI,OAAO,SAAS;AAClB,cAAM,kBAAkB,aAAa,gBAAgB;AAAA,MACvD;AACA,YAAM,SAAS,YAAY,QAAQ,WAAW,gBAAgB,OAAO;AAAA,IACvE;AAAA,EACF,CAAC;AACH;AAGO,SAAS,uBACd,kBACA,SACA;AACA,QAAM,SAAS,cAAc;AAC7B,QAAM,cAAc,eAAe;AACnC,SAAO,YAAY;AAAA;AAAA;AAAA,IAGjB,GAAG;AAAA,IACH,YAAY,CAAC,SAAiB,oBAAoB,QAAQ,IAAI;AAAA,IAC9D,WAAW,OAAO,QAAQ,WAAW,gBAAgB,YAAY;AAC/D,UAAI,OAAO,SAAS;AAClB,cAAM,kBAAkB,aAAa,gBAAgB;AAAA,MACvD;AACA,YAAM,SAAS,YAAY,QAAQ,WAAW,gBAAgB,OAAO;AAAA,IACvE;AAAA,EACF,CAAC;AACH;","names":[]}
@@ -0,0 +1,71 @@
1
+ "use client";
2
+
3
+ // src/query/hooks/use-location-mutations.ts
4
+ import { useMutation, useQueryClient } from "@tanstack/react-query";
5
+ import "../client.js";
6
+ import { useSifaConfig } from "../config.js";
7
+ import {
8
+ createProfileLocation,
9
+ deleteProfileLocation,
10
+ updateProfileLocation
11
+ } from "../fetchers/profile-locations.js";
12
+ import { sifaQueryKeys } from "../keys.js";
13
+ async function invalidateProfile(queryClient, ownerHandleOrDid) {
14
+ await queryClient.invalidateQueries({
15
+ queryKey: sifaQueryKeys.profile.byHandle(ownerHandleOrDid)
16
+ });
17
+ }
18
+ function useCreateProfileLocation(ownerHandleOrDid, options) {
19
+ const config = useSifaConfig();
20
+ const queryClient = useQueryClient();
21
+ return useMutation({
22
+ // Spread first: a consumer-supplied onSuccess would otherwise replace the
23
+ // handler below and silently drop cache invalidation (#453).
24
+ ...options,
25
+ mutationFn: (data) => createProfileLocation(config, data),
26
+ onSuccess: async (result, variables, onMutateResult, context) => {
27
+ if (result.success) {
28
+ await invalidateProfile(queryClient, ownerHandleOrDid);
29
+ }
30
+ await options?.onSuccess?.(result, variables, onMutateResult, context);
31
+ }
32
+ });
33
+ }
34
+ function useUpdateProfileLocation(ownerHandleOrDid, options) {
35
+ const config = useSifaConfig();
36
+ const queryClient = useQueryClient();
37
+ return useMutation({
38
+ // Spread first: a consumer-supplied onSuccess would otherwise replace the
39
+ // handler below and silently drop cache invalidation (#453).
40
+ ...options,
41
+ mutationFn: ({ rkey, data }) => updateProfileLocation(config, rkey, data),
42
+ onSuccess: async (result, variables, onMutateResult, context) => {
43
+ if (result.success) {
44
+ await invalidateProfile(queryClient, ownerHandleOrDid);
45
+ }
46
+ await options?.onSuccess?.(result, variables, onMutateResult, context);
47
+ }
48
+ });
49
+ }
50
+ function useDeleteProfileLocation(ownerHandleOrDid, options) {
51
+ const config = useSifaConfig();
52
+ const queryClient = useQueryClient();
53
+ return useMutation({
54
+ // Spread first: a consumer-supplied onSuccess would otherwise replace the
55
+ // handler below and silently drop cache invalidation (#453).
56
+ ...options,
57
+ mutationFn: (rkey) => deleteProfileLocation(config, rkey),
58
+ onSuccess: async (result, variables, onMutateResult, context) => {
59
+ if (result.success) {
60
+ await invalidateProfile(queryClient, ownerHandleOrDid);
61
+ }
62
+ await options?.onSuccess?.(result, variables, onMutateResult, context);
63
+ }
64
+ });
65
+ }
66
+ export {
67
+ useCreateProfileLocation,
68
+ useDeleteProfileLocation,
69
+ useUpdateProfileLocation
70
+ };
71
+ //# sourceMappingURL=use-location-mutations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/query/hooks/use-location-mutations.ts"],"sourcesContent":["'use client';\n\nimport { useMutation, useQueryClient, type UseMutationOptions } from '@tanstack/react-query';\n\nimport { type CreateResult, type WriteResult } from '../client.js';\nimport { useSifaConfig } from '../config.js';\nimport {\n createProfileLocation,\n deleteProfileLocation,\n updateProfileLocation,\n type ProfileLocationInput,\n} from '../fetchers/profile-locations.js';\nimport { sifaQueryKeys } from '../keys.js';\n\nasync function invalidateProfile(\n queryClient: ReturnType<typeof useQueryClient>,\n ownerHandleOrDid: string,\n): Promise<void> {\n await queryClient.invalidateQueries({\n queryKey: sifaQueryKeys.profile.byHandle(ownerHandleOrDid),\n });\n}\n\n/** React hook for creating a profile location record. */\nexport function useCreateProfileLocation(\n ownerHandleOrDid: string,\n options?: Omit<UseMutationOptions<CreateResult, Error, ProfileLocationInput>, 'mutationFn'>,\n) {\n const config = useSifaConfig();\n const queryClient = useQueryClient();\n return useMutation({\n // Spread first: a consumer-supplied onSuccess would otherwise replace the\n // handler below and silently drop cache invalidation (#453).\n ...options,\n mutationFn: (data: ProfileLocationInput) => createProfileLocation(config, data),\n onSuccess: async (result, variables, onMutateResult, context) => {\n if (result.success) {\n await invalidateProfile(queryClient, ownerHandleOrDid);\n }\n await options?.onSuccess?.(result, variables, onMutateResult, context);\n },\n });\n}\n\n/** Variables for {@link useUpdateProfileLocation}. */\nexport interface UpdateProfileLocationVariables {\n rkey: string;\n data: ProfileLocationInput;\n}\n\n/** React hook for updating a profile location record. */\nexport function useUpdateProfileLocation(\n ownerHandleOrDid: string,\n options?: Omit<\n UseMutationOptions<WriteResult, Error, UpdateProfileLocationVariables>,\n 'mutationFn'\n >,\n) {\n const config = useSifaConfig();\n const queryClient = useQueryClient();\n return useMutation({\n // Spread first: a consumer-supplied onSuccess would otherwise replace the\n // handler below and silently drop cache invalidation (#453).\n ...options,\n mutationFn: ({ rkey, data }: UpdateProfileLocationVariables) =>\n updateProfileLocation(config, rkey, data),\n onSuccess: async (result, variables, onMutateResult, context) => {\n if (result.success) {\n await invalidateProfile(queryClient, ownerHandleOrDid);\n }\n await options?.onSuccess?.(result, variables, onMutateResult, context);\n },\n });\n}\n\n/** React hook for deleting a profile location record. Variable: the `rkey` string. */\nexport function useDeleteProfileLocation(\n ownerHandleOrDid: string,\n options?: Omit<UseMutationOptions<WriteResult, Error, string>, 'mutationFn'>,\n) {\n const config = useSifaConfig();\n const queryClient = useQueryClient();\n return useMutation({\n // Spread first: a consumer-supplied onSuccess would otherwise replace the\n // handler below and silently drop cache invalidation (#453).\n ...options,\n mutationFn: (rkey: string) => deleteProfileLocation(config, rkey),\n onSuccess: async (result, variables, onMutateResult, context) => {\n if (result.success) {\n await invalidateProfile(queryClient, ownerHandleOrDid);\n }\n await options?.onSuccess?.(result, variables, onMutateResult, context);\n },\n });\n}\n"],"mappings":";;;AAEA,SAAS,aAAa,sBAA+C;AAErE,OAAoD;AACpD,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,qBAAqB;AAE9B,eAAe,kBACb,aACA,kBACe;AACf,QAAM,YAAY,kBAAkB;AAAA,IAClC,UAAU,cAAc,QAAQ,SAAS,gBAAgB;AAAA,EAC3D,CAAC;AACH;AAGO,SAAS,yBACd,kBACA,SACA;AACA,QAAM,SAAS,cAAc;AAC7B,QAAM,cAAc,eAAe;AACnC,SAAO,YAAY;AAAA;AAAA;AAAA,IAGjB,GAAG;AAAA,IACH,YAAY,CAAC,SAA+B,sBAAsB,QAAQ,IAAI;AAAA,IAC9E,WAAW,OAAO,QAAQ,WAAW,gBAAgB,YAAY;AAC/D,UAAI,OAAO,SAAS;AAClB,cAAM,kBAAkB,aAAa,gBAAgB;AAAA,MACvD;AACA,YAAM,SAAS,YAAY,QAAQ,WAAW,gBAAgB,OAAO;AAAA,IACvE;AAAA,EACF,CAAC;AACH;AASO,SAAS,yBACd,kBACA,SAIA;AACA,QAAM,SAAS,cAAc;AAC7B,QAAM,cAAc,eAAe;AACnC,SAAO,YAAY;AAAA;AAAA;AAAA,IAGjB,GAAG;AAAA,IACH,YAAY,CAAC,EAAE,MAAM,KAAK,MACxB,sBAAsB,QAAQ,MAAM,IAAI;AAAA,IAC1C,WAAW,OAAO,QAAQ,WAAW,gBAAgB,YAAY;AAC/D,UAAI,OAAO,SAAS;AAClB,cAAM,kBAAkB,aAAa,gBAAgB;AAAA,MACvD;AACA,YAAM,SAAS,YAAY,QAAQ,WAAW,gBAAgB,OAAO;AAAA,IACvE;AAAA,EACF,CAAC;AACH;AAGO,SAAS,yBACd,kBACA,SACA;AACA,QAAM,SAAS,cAAc;AAC7B,QAAM,cAAc,eAAe;AACnC,SAAO,YAAY;AAAA;AAAA;AAAA,IAGjB,GAAG;AAAA,IACH,YAAY,CAAC,SAAiB,sBAAsB,QAAQ,IAAI;AAAA,IAChE,WAAW,OAAO,QAAQ,WAAW,gBAAgB,YAAY;AAC/D,UAAI,OAAO,SAAS;AAClB,cAAM,kBAAkB,aAAa,gBAAgB;AAAA,MACvD;AACA,YAAM,SAAS,YAAY,QAAQ,WAAW,gBAAgB,OAAO;AAAA,IACvE;AAAA,EACF,CAAC;AACH;","names":[]}
@@ -0,0 +1,50 @@
1
+ "use client";
2
+
3
+ // src/query/hooks/use-marque-domains.ts
4
+ import { useMutation, useQueryClient } from "@tanstack/react-query";
5
+ import "../client.js";
6
+ import { useSifaConfig } from "../config.js";
7
+ import { revealMarqueDomain, unrevealMarqueDomain } from "../fetchers/marque-domains.js";
8
+ import { sifaQueryKeys } from "../keys.js";
9
+ async function invalidateProfile(queryClient, ownerHandleOrDid) {
10
+ await queryClient.invalidateQueries({
11
+ queryKey: sifaQueryKeys.profile.byHandle(ownerHandleOrDid)
12
+ });
13
+ }
14
+ function useRevealMarqueDomain(ownerHandleOrDid, options) {
15
+ const config = useSifaConfig();
16
+ const queryClient = useQueryClient();
17
+ return useMutation({
18
+ // Spread first: a consumer-supplied onSuccess would otherwise replace the
19
+ // handler below and silently drop cache invalidation (#453).
20
+ ...options,
21
+ mutationFn: (domain) => revealMarqueDomain(config, domain),
22
+ onSuccess: async (result, variables, onMutateResult, context) => {
23
+ if (result.success) {
24
+ await invalidateProfile(queryClient, ownerHandleOrDid);
25
+ }
26
+ await options?.onSuccess?.(result, variables, onMutateResult, context);
27
+ }
28
+ });
29
+ }
30
+ function useUnrevealMarqueDomain(ownerHandleOrDid, options) {
31
+ const config = useSifaConfig();
32
+ const queryClient = useQueryClient();
33
+ return useMutation({
34
+ // Spread first: a consumer-supplied onSuccess would otherwise replace the
35
+ // handler below and silently drop cache invalidation (#453).
36
+ ...options,
37
+ mutationFn: (domain) => unrevealMarqueDomain(config, domain),
38
+ onSuccess: async (result, variables, onMutateResult, context) => {
39
+ if (result.success) {
40
+ await invalidateProfile(queryClient, ownerHandleOrDid);
41
+ }
42
+ await options?.onSuccess?.(result, variables, onMutateResult, context);
43
+ }
44
+ });
45
+ }
46
+ export {
47
+ useRevealMarqueDomain,
48
+ useUnrevealMarqueDomain
49
+ };
50
+ //# sourceMappingURL=use-marque-domains.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/query/hooks/use-marque-domains.ts"],"sourcesContent":["'use client';\n\nimport { useMutation, useQueryClient, type UseMutationOptions } from '@tanstack/react-query';\n\nimport { type WriteResult } from '../client.js';\nimport { useSifaConfig } from '../config.js';\nimport { revealMarqueDomain, unrevealMarqueDomain } from '../fetchers/marque-domains.js';\nimport { sifaQueryKeys } from '../keys.js';\n\nasync function invalidateProfile(\n queryClient: ReturnType<typeof useQueryClient>,\n ownerHandleOrDid: string,\n): Promise<void> {\n await queryClient.invalidateQueries({\n queryKey: sifaQueryKeys.profile.byHandle(ownerHandleOrDid),\n });\n}\n\n/** React hook for revealing (making public) a Marque domain. Variable: the domain string. */\nexport function useRevealMarqueDomain(\n ownerHandleOrDid: string,\n options?: Omit<UseMutationOptions<WriteResult, Error, string>, 'mutationFn'>,\n) {\n const config = useSifaConfig();\n const queryClient = useQueryClient();\n return useMutation({\n // Spread first: a consumer-supplied onSuccess would otherwise replace the\n // handler below and silently drop cache invalidation (#453).\n ...options,\n mutationFn: (domain: string) => revealMarqueDomain(config, domain),\n onSuccess: async (result, variables, onMutateResult, context) => {\n if (result.success) {\n await invalidateProfile(queryClient, ownerHandleOrDid);\n }\n await options?.onSuccess?.(result, variables, onMutateResult, context);\n },\n });\n}\n\n/** React hook for hiding a previously-revealed Marque domain again. */\nexport function useUnrevealMarqueDomain(\n ownerHandleOrDid: string,\n options?: Omit<UseMutationOptions<WriteResult, Error, string>, 'mutationFn'>,\n) {\n const config = useSifaConfig();\n const queryClient = useQueryClient();\n return useMutation({\n // Spread first: a consumer-supplied onSuccess would otherwise replace the\n // handler below and silently drop cache invalidation (#453).\n ...options,\n mutationFn: (domain: string) => unrevealMarqueDomain(config, domain),\n onSuccess: async (result, variables, onMutateResult, context) => {\n if (result.success) {\n await invalidateProfile(queryClient, ownerHandleOrDid);\n }\n await options?.onSuccess?.(result, variables, onMutateResult, context);\n },\n });\n}\n"],"mappings":";;;AAEA,SAAS,aAAa,sBAA+C;AAErE,OAAiC;AACjC,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB,4BAA4B;AACzD,SAAS,qBAAqB;AAE9B,eAAe,kBACb,aACA,kBACe;AACf,QAAM,YAAY,kBAAkB;AAAA,IAClC,UAAU,cAAc,QAAQ,SAAS,gBAAgB;AAAA,EAC3D,CAAC;AACH;AAGO,SAAS,sBACd,kBACA,SACA;AACA,QAAM,SAAS,cAAc;AAC7B,QAAM,cAAc,eAAe;AACnC,SAAO,YAAY;AAAA;AAAA;AAAA,IAGjB,GAAG;AAAA,IACH,YAAY,CAAC,WAAmB,mBAAmB,QAAQ,MAAM;AAAA,IACjE,WAAW,OAAO,QAAQ,WAAW,gBAAgB,YAAY;AAC/D,UAAI,OAAO,SAAS;AAClB,cAAM,kBAAkB,aAAa,gBAAgB;AAAA,MACvD;AACA,YAAM,SAAS,YAAY,QAAQ,WAAW,gBAAgB,OAAO;AAAA,IACvE;AAAA,EACF,CAAC;AACH;AAGO,SAAS,wBACd,kBACA,SACA;AACA,QAAM,SAAS,cAAc;AAC7B,QAAM,cAAc,eAAe;AACnC,SAAO,YAAY;AAAA;AAAA;AAAA,IAGjB,GAAG;AAAA,IACH,YAAY,CAAC,WAAmB,qBAAqB,QAAQ,MAAM;AAAA,IACnE,WAAW,OAAO,QAAQ,WAAW,gBAAgB,YAAY;AAC/D,UAAI,OAAO,SAAS;AAClB,cAAM,kBAAkB,aAAa,gBAAgB;AAAA,MACvD;AACA,YAAM,SAAS,YAAY,QAAQ,WAAW,gBAAgB,OAAO;AAAA,IACvE;AAAA,EACF,CAAC;AACH;","names":[]}
@@ -0,0 +1,29 @@
1
+ "use client";
2
+
3
+ // src/query/hooks/use-org-claim.ts
4
+ import { useMutation, useQueryClient } from "@tanstack/react-query";
5
+ import { useSifaConfig } from "../config.js";
6
+ import { submitOrgClaim } from "../fetchers/org.js";
7
+ import { sifaQueryKeys } from "../keys.js";
8
+ function useOrgClaim(handleOrDid, options) {
9
+ const config = useSifaConfig();
10
+ const queryClient = useQueryClient();
11
+ return useMutation({
12
+ // Spread first: a consumer-supplied onSuccess would otherwise replace the
13
+ // handler below and silently drop cache invalidation (#453).
14
+ ...options,
15
+ mutationFn: (body) => submitOrgClaim(config, body),
16
+ onSuccess: async (result, variables, onMutateResult, context) => {
17
+ if (result.success && handleOrDid) {
18
+ await queryClient.invalidateQueries({
19
+ queryKey: sifaQueryKeys.profile.byHandle(handleOrDid)
20
+ });
21
+ }
22
+ await options?.onSuccess?.(result, variables, onMutateResult, context);
23
+ }
24
+ });
25
+ }
26
+ export {
27
+ useOrgClaim
28
+ };
29
+ //# sourceMappingURL=use-org-claim.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/query/hooks/use-org-claim.ts"],"sourcesContent":["'use client';\n\nimport { useMutation, useQueryClient, type UseMutationOptions } from '@tanstack/react-query';\n\nimport type { WriteResult } from '../client.js';\nimport { useSifaConfig } from '../config.js';\nimport { submitOrgClaim, type OrgClaimResult } from '../fetchers/org.js';\nimport type { OrgClaimRequestInput } from '../../schemas/write/org-claim.js';\nimport { sifaQueryKeys } from '../keys.js';\n\ntype OrgClaimMutationResult = WriteResult & Partial<OrgClaimResult>;\n\n/**\n * Finalize an org profile claim (`POST /api/org/claim`). Pass the org's\n * handle/DID so the profile cache (which carries the org floor verdict) is\n * invalidated on success; pass `null` to skip invalidation.\n */\nexport function useOrgClaim(\n handleOrDid: string | null,\n options?: Omit<\n UseMutationOptions<OrgClaimMutationResult, Error, OrgClaimRequestInput>,\n 'mutationFn'\n >,\n) {\n const config = useSifaConfig();\n const queryClient = useQueryClient();\n return useMutation({\n // Spread first: a consumer-supplied onSuccess would otherwise replace the\n // handler below and silently drop cache invalidation (#453).\n ...options,\n mutationFn: (body: OrgClaimRequestInput) => submitOrgClaim(config, body),\n onSuccess: async (result, variables, onMutateResult, context) => {\n if (result.success && handleOrDid) {\n await queryClient.invalidateQueries({\n queryKey: sifaQueryKeys.profile.byHandle(handleOrDid),\n });\n }\n await options?.onSuccess?.(result, variables, onMutateResult, context);\n },\n });\n}\n"],"mappings":";;;AAEA,SAAS,aAAa,sBAA+C;AAGrE,SAAS,qBAAqB;AAC9B,SAAS,sBAA2C;AAEpD,SAAS,qBAAqB;AASvB,SAAS,YACd,aACA,SAIA;AACA,QAAM,SAAS,cAAc;AAC7B,QAAM,cAAc,eAAe;AACnC,SAAO,YAAY;AAAA;AAAA;AAAA,IAGjB,GAAG;AAAA,IACH,YAAY,CAAC,SAA+B,eAAe,QAAQ,IAAI;AAAA,IACvE,WAAW,OAAO,QAAQ,WAAW,gBAAgB,YAAY;AAC/D,UAAI,OAAO,WAAW,aAAa;AACjC,cAAM,YAAY,kBAAkB;AAAA,UAClC,UAAU,cAAc,QAAQ,SAAS,WAAW;AAAA,QACtD,CAAC;AAAA,MACH;AACA,YAAM,SAAS,YAAY,QAAQ,WAAW,gBAAgB,OAAO;AAAA,IACvE;AAAA,EACF,CAAC;AACH;","names":[]}
@@ -0,0 +1,28 @@
1
+ "use client";
2
+
3
+ // src/query/hooks/use-org-domains.ts
4
+ import { useMutation } from "@tanstack/react-query";
5
+ import { useSifaConfig } from "../config.js";
6
+ import {
7
+ requestOrgDomainChallenge,
8
+ verifyOrgDomain
9
+ } from "../fetchers/org.js";
10
+ function useOrgDomainChallenge(options) {
11
+ const config = useSifaConfig();
12
+ return useMutation({
13
+ mutationFn: (body) => requestOrgDomainChallenge(config, body),
14
+ ...options
15
+ });
16
+ }
17
+ function useOrgDomainVerify(options) {
18
+ const config = useSifaConfig();
19
+ return useMutation({
20
+ mutationFn: (body) => verifyOrgDomain(config, body),
21
+ ...options
22
+ });
23
+ }
24
+ export {
25
+ useOrgDomainChallenge,
26
+ useOrgDomainVerify
27
+ };
28
+ //# sourceMappingURL=use-org-domains.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/query/hooks/use-org-domains.ts"],"sourcesContent":["'use client';\n\nimport { useMutation, type UseMutationOptions } from '@tanstack/react-query';\n\nimport type { WriteResult } from '../client.js';\nimport { useSifaConfig } from '../config.js';\nimport {\n requestOrgDomainChallenge,\n verifyOrgDomain,\n type OrgDomainChallengeResult,\n type OrgDomainVerifyResult,\n} from '../fetchers/org.js';\nimport type {\n OrgDomainChallengeRequestInput,\n OrgDomainVerifyRequestInput,\n} from '../../schemas/write/org-settings.js';\n\ntype OrgDomainChallengeMutationResult = WriteResult & Partial<OrgDomainChallengeResult>;\ntype OrgDomainVerifyMutationResult = WriteResult & Partial<OrgDomainVerifyResult>;\n\n/**\n * Issue a one-time DNS TXT domain challenge (`POST /api/org/domains/challenge`).\n * The result carries the TXT record name + value for the org to publish.\n */\nexport function useOrgDomainChallenge(\n options?: Omit<\n UseMutationOptions<OrgDomainChallengeMutationResult, Error, OrgDomainChallengeRequestInput>,\n 'mutationFn'\n >,\n) {\n const config = useSifaConfig();\n return useMutation({\n mutationFn: (body: OrgDomainChallengeRequestInput) => requestOrgDomainChallenge(config, body),\n ...options,\n });\n}\n\n/**\n * Verify a DNS TXT domain challenge (`POST /api/org/domains/verify`). On success\n * `status` is `verified` or `pending`; other outcomes surface as\n * `{ success: false }`.\n */\nexport function useOrgDomainVerify(\n options?: Omit<\n UseMutationOptions<OrgDomainVerifyMutationResult, Error, OrgDomainVerifyRequestInput>,\n 'mutationFn'\n >,\n) {\n const config = useSifaConfig();\n return useMutation({\n mutationFn: (body: OrgDomainVerifyRequestInput) => verifyOrgDomain(config, body),\n ...options,\n });\n}\n"],"mappings":";;;AAEA,SAAS,mBAA4C;AAGrD,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AAaA,SAAS,sBACd,SAIA;AACA,QAAM,SAAS,cAAc;AAC7B,SAAO,YAAY;AAAA,IACjB,YAAY,CAAC,SAAyC,0BAA0B,QAAQ,IAAI;AAAA,IAC5F,GAAG;AAAA,EACL,CAAC;AACH;AAOO,SAAS,mBACd,SAIA;AACA,QAAM,SAAS,cAAc;AAC7B,SAAO,YAAY;AAAA,IACjB,YAAY,CAAC,SAAsC,gBAAgB,QAAQ,IAAI;AAAA,IAC/E,GAAG;AAAA,EACL,CAAC;AACH;","names":[]}
@@ -0,0 +1,28 @@
1
+ "use client";
2
+
3
+ // src/query/hooks/use-org-notification-emails.ts
4
+ import { useMutation } from "@tanstack/react-query";
5
+ import { useSifaConfig } from "../config.js";
6
+ import {
7
+ addOrgNotificationEmail,
8
+ removeOrgNotificationEmail
9
+ } from "../fetchers/org.js";
10
+ function useAddOrgNotificationEmail(options) {
11
+ const config = useSifaConfig();
12
+ return useMutation({
13
+ mutationFn: (body) => addOrgNotificationEmail(config, body),
14
+ ...options
15
+ });
16
+ }
17
+ function useRemoveOrgNotificationEmail(options) {
18
+ const config = useSifaConfig();
19
+ return useMutation({
20
+ mutationFn: (body) => removeOrgNotificationEmail(config, body),
21
+ ...options
22
+ });
23
+ }
24
+ export {
25
+ useAddOrgNotificationEmail,
26
+ useRemoveOrgNotificationEmail
27
+ };
28
+ //# sourceMappingURL=use-org-notification-emails.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/query/hooks/use-org-notification-emails.ts"],"sourcesContent":["'use client';\n\nimport { useMutation, type UseMutationOptions } from '@tanstack/react-query';\n\nimport type { WriteResult } from '../client.js';\nimport { useSifaConfig } from '../config.js';\nimport {\n addOrgNotificationEmail,\n removeOrgNotificationEmail,\n type OrgNotificationEmailAddResult,\n type OrgNotificationEmailRemoveResult,\n} from '../fetchers/org.js';\nimport type { OrgNotificationEmailRequestInput } from '../../schemas/write/org-settings.js';\n\ntype OrgNotificationEmailAddMutationResult = WriteResult & Partial<OrgNotificationEmailAddResult>;\ntype OrgNotificationEmailRemoveMutationResult = WriteResult &\n Partial<OrgNotificationEmailRemoveResult>;\n\n/**\n * Add an org notification email (`POST /api/org/notification-emails`). The\n * address must use a domain the org controls (checked server-side). Sending is\n * gated behind the dormant email pipeline until activated.\n */\nexport function useAddOrgNotificationEmail(\n options?: Omit<\n UseMutationOptions<\n OrgNotificationEmailAddMutationResult,\n Error,\n OrgNotificationEmailRequestInput\n >,\n 'mutationFn'\n >,\n) {\n const config = useSifaConfig();\n return useMutation({\n mutationFn: (body: OrgNotificationEmailRequestInput) => addOrgNotificationEmail(config, body),\n ...options,\n });\n}\n\n/**\n * Remove an org notification email (`DELETE /api/org/notification-emails`).\n */\nexport function useRemoveOrgNotificationEmail(\n options?: Omit<\n UseMutationOptions<\n OrgNotificationEmailRemoveMutationResult,\n Error,\n OrgNotificationEmailRequestInput\n >,\n 'mutationFn'\n >,\n) {\n const config = useSifaConfig();\n return useMutation({\n mutationFn: (body: OrgNotificationEmailRequestInput) =>\n removeOrgNotificationEmail(config, body),\n ...options,\n });\n}\n"],"mappings":";;;AAEA,SAAS,mBAA4C;AAGrD,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AAYA,SAAS,2BACd,SAQA;AACA,QAAM,SAAS,cAAc;AAC7B,SAAO,YAAY;AAAA,IACjB,YAAY,CAAC,SAA2C,wBAAwB,QAAQ,IAAI;AAAA,IAC5F,GAAG;AAAA,EACL,CAAC;AACH;AAKO,SAAS,8BACd,SAQA;AACA,QAAM,SAAS,cAAc;AAC7B,SAAO,YAAY;AAAA,IACjB,YAAY,CAAC,SACX,2BAA2B,QAAQ,IAAI;AAAA,IACzC,GAAG;AAAA,EACL,CAAC;AACH;","names":[]}
@@ -0,0 +1,29 @@
1
+ "use client";
2
+
3
+ // src/query/hooks/use-org-profile-settings.ts
4
+ import { useMutation, useQueryClient } from "@tanstack/react-query";
5
+ import { useSifaConfig } from "../config.js";
6
+ import { updateOrgProfile } from "../fetchers/org.js";
7
+ import { sifaQueryKeys } from "../keys.js";
8
+ function useUpdateOrgProfile(handleOrDid, options) {
9
+ const config = useSifaConfig();
10
+ const queryClient = useQueryClient();
11
+ return useMutation({
12
+ // Spread first: a consumer-supplied onSuccess would otherwise replace the
13
+ // handler below and silently drop cache invalidation (#453).
14
+ ...options,
15
+ mutationFn: (body) => updateOrgProfile(config, body),
16
+ onSuccess: async (result, variables, onMutateResult, context) => {
17
+ if (result.success && handleOrDid) {
18
+ await queryClient.invalidateQueries({
19
+ queryKey: sifaQueryKeys.profile.byHandle(handleOrDid)
20
+ });
21
+ }
22
+ await options?.onSuccess?.(result, variables, onMutateResult, context);
23
+ }
24
+ });
25
+ }
26
+ export {
27
+ useUpdateOrgProfile
28
+ };
29
+ //# sourceMappingURL=use-org-profile-settings.js.map