@singi-labs/sifa-sdk 0.19.53 → 0.19.55
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.
- package/dist/badge/index.cjs +18 -2
- package/dist/badge/index.cjs.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/{network-map-C-p-k3gB.d.cts → network-map-CdYpUy-t.d.cts} +2 -2
- package/dist/{network-map-CnVlBE0G.d.ts → network-map-CiWrQ1fF.d.ts} +2 -2
- package/dist/{org-CFzRg61Q.d.cts → org-fmpG85L0.d.cts} +32 -27
- package/dist/{org-Bp4mNT8K.d.ts → org-hxHnoBfg.d.ts} +32 -27
- package/dist/{profile-summary-C_wdHGj6.d.cts → profile-summary-5T1hDw6Q.d.cts} +1 -1
- package/dist/{profile-summary-Qtfk-52i.d.ts → profile-summary-Bj7ufSDK.d.ts} +1 -1
- package/dist/query/client.js +26 -6
- package/dist/query/client.js.map +1 -1
- package/dist/query/fetchers/destructive.js.map +1 -1
- package/dist/query/fetchers/external-accounts.js.map +1 -1
- package/dist/query/fetchers/follow.js.map +1 -1
- package/dist/query/fetchers/index.cjs +26 -6
- package/dist/query/fetchers/index.cjs.map +1 -1
- package/dist/query/fetchers/index.d.cts +5 -5
- package/dist/query/fetchers/index.d.ts +5 -5
- package/dist/query/fetchers/org.js.map +1 -1
- package/dist/query/fetchers/profile-mutations.js.map +1 -1
- package/dist/query/fetchers/publications.js.map +1 -1
- package/dist/query/fetchers/repo-inventory.js.map +1 -1
- package/dist/query/fetchers/skills.js.map +1 -1
- package/dist/query/hooks/index.cjs +26 -6
- package/dist/query/hooks/index.cjs.map +1 -1
- package/dist/query/hooks/index.d.cts +3 -3
- package/dist/query/hooks/index.d.ts +3 -3
- package/dist/query/hooks/use-org-claim.js.map +1 -1
- package/dist/query/hooks/use-org-domains.js.map +1 -1
- package/dist/query/hooks/use-org-notification-emails.js.map +1 -1
- package/dist/query/hooks/use-org-profile-settings.js.map +1 -1
- package/dist/query/hooks/use-skill-mutations.js.map +1 -1
- package/dist/query/index.cjs +26 -6
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +8 -8
- package/dist/query/index.d.ts +8 -8
- package/dist/roadmap/index.js +1 -1
- package/dist/roadmap/index.js.map +1 -1
- package/dist/schemas/write/external-account.js +2 -1
- package/dist/schemas/write/external-account.js.map +1 -1
- package/dist/schemas/write/index.cjs +2 -1
- package/dist/schemas/write/index.cjs.map +1 -1
- package/dist/schemas/write/index.d.cts +1 -1
- package/dist/schemas/write/index.d.ts +1 -1
- package/dist/{types-DAGqE0b9.d.cts → types-DHT7jcZc.d.cts} +36 -8
- package/dist/{types-CK8KgdqA.d.ts → types-jB67EFpw.d.ts} +36 -8
- package/dist/{use-org-notification-emails-CJ0hKqco.d.ts → use-org-notification-emails-CWLCWkmb.d.ts} +15 -15
- package/dist/{use-org-notification-emails-Dk084Rrw.d.cts → use-org-notification-emails-Cj8IDI_7.d.cts} +15 -15
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { A as AddFeatureAllowlistVariables, C as CreateReactionVariables, a as CreateRecordVariables, D as DeleteReactionVariables, b as DeleteRecordVariables, F as FollowVariables, P as PositionSkillLinkVariables, R as RemoveFeatureAllowlistVariables, S as SifaProvider, c as SifaProviderProps, U as UnfollowVariables, d as UpdateEducationVariables, e as UpdateExternalAccountVariables, f as UpdatePositionVariables, g as UpdateProfileLocationVariables, h as UpdateRecordVariables, i as UpdateSkillSubCategoriesVariables, j as UpdateSkillVariables, k as UseEntitySearchOptions, l as UseMyGithubPullRequestsParams, u as useAccounts, m as useActivityFeed, n as useActivityTeaser, o as useAddFeatureAllowlist, p as useAddOrgNotificationEmail, q as useAdminReviewQueues, r as useAppAccountCheck, s as useAppsRegistry, t as useAtFundLink, v as useBlueskySuggestions, w as useBulkHideProfileItems, x as useBulkHideStandardPublications, y as useBulkUnhideProfileItems, z as useBulkUnhideStandardPublications, B as useCanonicalSkillSearch, E as useCastRoadmapVote, G as useCreateConfirmation, H as useCreateEducation, I as useCreateEndorsement, J as useCreateExternalAccount, K as useCreatePosition, L as useCreateProfileLocation, M as useCreateReaction, N as useCreateRecord, O as useCreateSkill, Q as useDebouncedValue, T as useDeleteAccount, V as useDeleteAvatarOverride, W as useDeleteEducation, X as useDeleteExternalAccount, Y as useDeleteNamePronunciationAudio, Z as useDeletePosition, _ as useDeleteProfileLocation, $ as useDeleteReaction, a0 as useDeleteRecord, a1 as useDeleteRepoRecords, a2 as useDeleteSkill, a3 as useDismissConfirmation, a4 as useDismissUnlinkedPosition, a5 as useEndorsementCount, a6 as useEntitySearch, a7 as useExternalAccounts, a8 as useFeatureAllowlist, a9 as useFeaturedProfile, aa as useFollow, ab as useFollowers, ac as useFollowing, ad as useFollowingFeed, ae as useFollowingFeedVersion, af as useFollowingList, ag as useGetProfileView, ah as useGivenConfirmations, ai as useHeatmapData, aj as useHiddenActivityItems, ak as useHiddenApps, al as useHideActivityItem, am as useHideKeytraceClaim, an as useHideOrcidPublication, ao as useHideProfileItem, ap as useHideSifaPublication, aq as useHideStandardPublication, ar as useImportSearchEntities, as as useInboxCounts, at as useLinkSkillToPosition, av as useMutuals, aw as useMyGithubPullRequests, ax as useMyRoadmapVotes, ay as useNetworkStreamCount, az as useOrgClaim, aA as useOrgDomainChallenge, aB as useOrgDomainVerify, aC as useOrgProfile, aD as usePendingConfirmations, aE as useProfile, aF as useProfileCompleteness, aG as useReactionStatus, aH as useRefreshOrcidPublications, aI as useRefreshPds, aJ as useRemoveFeatureAllowlist, aK as useRemoveOrgNotificationEmail, aL as useRepoInventory, aM as useResetProfile, aO as useRetractRoadmapVote, aP as useRevealMarqueDomain, aQ as useRevokeConfirmation, aR as useRoadmapVotes, bt as useSearchCompanies, aS as useSearchFilters, aT as useSearchProfiles, aU as useSelectEntity, aV as useSetExternalAccountPrimary, aW as useSetPositionPrimary, aX as useSetSectionPrimary, aY as useSifaConfig, aZ as useSimilarProfiles, a_ as useSkillSuggestions, a$ as useStats, b0 as useSuggestionCount, b1 as useSuggestions, b2 as useUnfollow, b3 as useUnhideActivityItem, b4 as useUnhideKeytraceClaim, b5 as useUnhideOrcidPublication, b6 as useUnhideProfileItem, b7 as useUnhideSifaPublication, b8 as useUnhideStandardPublication, b9 as useUnlinkSkillFromPosition, ba as useUnlinkedPositions, bb as useUnrevealMarqueDomain, bc as useUnsetExternalAccountPrimary, bd as useUnsetPositionPrimary, be as useUnsetSectionPrimary, bf as useUpdateEducation, bg as useUpdateExternalAccount, bh as useUpdateOrgProfile, bi as useUpdatePosition, bj as useUpdateProfileLocation, bk as useUpdateProfileOverride, bl as useUpdateProfileSelf, bm as useUpdateRecord, bn as useUpdateSkill, bo as useUpdateSkillSubCategories, bp as useUploadAvatar, bq as useUploadNamePronunciationAudio, br as useVerifyExternalAccount, bs as useWipePreview } from '../../use-org-notification-emails-
|
|
2
|
-
export { aK as SifaQueryKey, s as sifaQueryKeys } from '../../org-
|
|
1
|
+
export { A as AddFeatureAllowlistVariables, C as CreateReactionVariables, a as CreateRecordVariables, D as DeleteReactionVariables, b as DeleteRecordVariables, F as FollowVariables, P as PositionSkillLinkVariables, R as RemoveFeatureAllowlistVariables, S as SifaProvider, c as SifaProviderProps, U as UnfollowVariables, d as UpdateEducationVariables, e as UpdateExternalAccountVariables, f as UpdatePositionVariables, g as UpdateProfileLocationVariables, h as UpdateRecordVariables, i as UpdateSkillSubCategoriesVariables, j as UpdateSkillVariables, k as UseEntitySearchOptions, l as UseMyGithubPullRequestsParams, u as useAccounts, m as useActivityFeed, n as useActivityTeaser, o as useAddFeatureAllowlist, p as useAddOrgNotificationEmail, q as useAdminReviewQueues, r as useAppAccountCheck, s as useAppsRegistry, t as useAtFundLink, v as useBlueskySuggestions, w as useBulkHideProfileItems, x as useBulkHideStandardPublications, y as useBulkUnhideProfileItems, z as useBulkUnhideStandardPublications, B as useCanonicalSkillSearch, E as useCastRoadmapVote, G as useCreateConfirmation, H as useCreateEducation, I as useCreateEndorsement, J as useCreateExternalAccount, K as useCreatePosition, L as useCreateProfileLocation, M as useCreateReaction, N as useCreateRecord, O as useCreateSkill, Q as useDebouncedValue, T as useDeleteAccount, V as useDeleteAvatarOverride, W as useDeleteEducation, X as useDeleteExternalAccount, Y as useDeleteNamePronunciationAudio, Z as useDeletePosition, _ as useDeleteProfileLocation, $ as useDeleteReaction, a0 as useDeleteRecord, a1 as useDeleteRepoRecords, a2 as useDeleteSkill, a3 as useDismissConfirmation, a4 as useDismissUnlinkedPosition, a5 as useEndorsementCount, a6 as useEntitySearch, a7 as useExternalAccounts, a8 as useFeatureAllowlist, a9 as useFeaturedProfile, aa as useFollow, ab as useFollowers, ac as useFollowing, ad as useFollowingFeed, ae as useFollowingFeedVersion, af as useFollowingList, ag as useGetProfileView, ah as useGivenConfirmations, ai as useHeatmapData, aj as useHiddenActivityItems, ak as useHiddenApps, al as useHideActivityItem, am as useHideKeytraceClaim, an as useHideOrcidPublication, ao as useHideProfileItem, ap as useHideSifaPublication, aq as useHideStandardPublication, ar as useImportSearchEntities, as as useInboxCounts, at as useLinkSkillToPosition, av as useMutuals, aw as useMyGithubPullRequests, ax as useMyRoadmapVotes, ay as useNetworkStreamCount, az as useOrgClaim, aA as useOrgDomainChallenge, aB as useOrgDomainVerify, aC as useOrgProfile, aD as usePendingConfirmations, aE as useProfile, aF as useProfileCompleteness, aG as useReactionStatus, aH as useRefreshOrcidPublications, aI as useRefreshPds, aJ as useRemoveFeatureAllowlist, aK as useRemoveOrgNotificationEmail, aL as useRepoInventory, aM as useResetProfile, aO as useRetractRoadmapVote, aP as useRevealMarqueDomain, aQ as useRevokeConfirmation, aR as useRoadmapVotes, bt as useSearchCompanies, aS as useSearchFilters, aT as useSearchProfiles, aU as useSelectEntity, aV as useSetExternalAccountPrimary, aW as useSetPositionPrimary, aX as useSetSectionPrimary, aY as useSifaConfig, aZ as useSimilarProfiles, a_ as useSkillSuggestions, a$ as useStats, b0 as useSuggestionCount, b1 as useSuggestions, b2 as useUnfollow, b3 as useUnhideActivityItem, b4 as useUnhideKeytraceClaim, b5 as useUnhideOrcidPublication, b6 as useUnhideProfileItem, b7 as useUnhideSifaPublication, b8 as useUnhideStandardPublication, b9 as useUnlinkSkillFromPosition, ba as useUnlinkedPositions, bb as useUnrevealMarqueDomain, bc as useUnsetExternalAccountPrimary, bd as useUnsetPositionPrimary, be as useUnsetSectionPrimary, bf as useUpdateEducation, bg as useUpdateExternalAccount, bh as useUpdateOrgProfile, bi as useUpdatePosition, bj as useUpdateProfileLocation, bk as useUpdateProfileOverride, bl as useUpdateProfileSelf, bm as useUpdateRecord, bn as useUpdateSkill, bo as useUpdateSkillSubCategories, bp as useUploadAvatar, bq as useUploadNamePronunciationAudio, br as useVerifyExternalAccount, bs as useWipePreview } from '../../use-org-notification-emails-Cj8IDI_7.cjs';
|
|
2
|
+
export { aK as SifaQueryKey, s as sifaQueryKeys } from '../../org-fmpG85L0.cjs';
|
|
3
3
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
4
4
|
import { UseMutationOptions } from '@tanstack/react-query';
|
|
5
|
-
import { N as CreateResult, W as WriteResult } from '../../types-
|
|
5
|
+
import { N as CreateResult, W as WriteResult } from '../../types-DHT7jcZc.cjs';
|
|
6
6
|
import 'react';
|
|
7
7
|
import '../../index-DmlIG8sJ.cjs';
|
|
8
8
|
import '../../shared-v0vl5hov.cjs';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { A as AddFeatureAllowlistVariables, C as CreateReactionVariables, a as CreateRecordVariables, D as DeleteReactionVariables, b as DeleteRecordVariables, F as FollowVariables, P as PositionSkillLinkVariables, R as RemoveFeatureAllowlistVariables, S as SifaProvider, c as SifaProviderProps, U as UnfollowVariables, d as UpdateEducationVariables, e as UpdateExternalAccountVariables, f as UpdatePositionVariables, g as UpdateProfileLocationVariables, h as UpdateRecordVariables, i as UpdateSkillSubCategoriesVariables, j as UpdateSkillVariables, k as UseEntitySearchOptions, l as UseMyGithubPullRequestsParams, u as useAccounts, m as useActivityFeed, n as useActivityTeaser, o as useAddFeatureAllowlist, p as useAddOrgNotificationEmail, q as useAdminReviewQueues, r as useAppAccountCheck, s as useAppsRegistry, t as useAtFundLink, v as useBlueskySuggestions, w as useBulkHideProfileItems, x as useBulkHideStandardPublications, y as useBulkUnhideProfileItems, z as useBulkUnhideStandardPublications, B as useCanonicalSkillSearch, E as useCastRoadmapVote, G as useCreateConfirmation, H as useCreateEducation, I as useCreateEndorsement, J as useCreateExternalAccount, K as useCreatePosition, L as useCreateProfileLocation, M as useCreateReaction, N as useCreateRecord, O as useCreateSkill, Q as useDebouncedValue, T as useDeleteAccount, V as useDeleteAvatarOverride, W as useDeleteEducation, X as useDeleteExternalAccount, Y as useDeleteNamePronunciationAudio, Z as useDeletePosition, _ as useDeleteProfileLocation, $ as useDeleteReaction, a0 as useDeleteRecord, a1 as useDeleteRepoRecords, a2 as useDeleteSkill, a3 as useDismissConfirmation, a4 as useDismissUnlinkedPosition, a5 as useEndorsementCount, a6 as useEntitySearch, a7 as useExternalAccounts, a8 as useFeatureAllowlist, a9 as useFeaturedProfile, aa as useFollow, ab as useFollowers, ac as useFollowing, ad as useFollowingFeed, ae as useFollowingFeedVersion, af as useFollowingList, ag as useGetProfileView, ah as useGivenConfirmations, ai as useHeatmapData, aj as useHiddenActivityItems, ak as useHiddenApps, al as useHideActivityItem, am as useHideKeytraceClaim, an as useHideOrcidPublication, ao as useHideProfileItem, ap as useHideSifaPublication, aq as useHideStandardPublication, ar as useImportSearchEntities, as as useInboxCounts, at as useLinkSkillToPosition, av as useMutuals, aw as useMyGithubPullRequests, ax as useMyRoadmapVotes, ay as useNetworkStreamCount, az as useOrgClaim, aA as useOrgDomainChallenge, aB as useOrgDomainVerify, aC as useOrgProfile, aD as usePendingConfirmations, aE as useProfile, aF as useProfileCompleteness, aG as useReactionStatus, aH as useRefreshOrcidPublications, aI as useRefreshPds, aJ as useRemoveFeatureAllowlist, aK as useRemoveOrgNotificationEmail, aL as useRepoInventory, aM as useResetProfile, aO as useRetractRoadmapVote, aP as useRevealMarqueDomain, aQ as useRevokeConfirmation, aR as useRoadmapVotes, bt as useSearchCompanies, aS as useSearchFilters, aT as useSearchProfiles, aU as useSelectEntity, aV as useSetExternalAccountPrimary, aW as useSetPositionPrimary, aX as useSetSectionPrimary, aY as useSifaConfig, aZ as useSimilarProfiles, a_ as useSkillSuggestions, a$ as useStats, b0 as useSuggestionCount, b1 as useSuggestions, b2 as useUnfollow, b3 as useUnhideActivityItem, b4 as useUnhideKeytraceClaim, b5 as useUnhideOrcidPublication, b6 as useUnhideProfileItem, b7 as useUnhideSifaPublication, b8 as useUnhideStandardPublication, b9 as useUnlinkSkillFromPosition, ba as useUnlinkedPositions, bb as useUnrevealMarqueDomain, bc as useUnsetExternalAccountPrimary, bd as useUnsetPositionPrimary, be as useUnsetSectionPrimary, bf as useUpdateEducation, bg as useUpdateExternalAccount, bh as useUpdateOrgProfile, bi as useUpdatePosition, bj as useUpdateProfileLocation, bk as useUpdateProfileOverride, bl as useUpdateProfileSelf, bm as useUpdateRecord, bn as useUpdateSkill, bo as useUpdateSkillSubCategories, bp as useUploadAvatar, bq as useUploadNamePronunciationAudio, br as useVerifyExternalAccount, bs as useWipePreview } from '../../use-org-notification-emails-
|
|
2
|
-
export { aK as SifaQueryKey, s as sifaQueryKeys } from '../../org-
|
|
1
|
+
export { A as AddFeatureAllowlistVariables, C as CreateReactionVariables, a as CreateRecordVariables, D as DeleteReactionVariables, b as DeleteRecordVariables, F as FollowVariables, P as PositionSkillLinkVariables, R as RemoveFeatureAllowlistVariables, S as SifaProvider, c as SifaProviderProps, U as UnfollowVariables, d as UpdateEducationVariables, e as UpdateExternalAccountVariables, f as UpdatePositionVariables, g as UpdateProfileLocationVariables, h as UpdateRecordVariables, i as UpdateSkillSubCategoriesVariables, j as UpdateSkillVariables, k as UseEntitySearchOptions, l as UseMyGithubPullRequestsParams, u as useAccounts, m as useActivityFeed, n as useActivityTeaser, o as useAddFeatureAllowlist, p as useAddOrgNotificationEmail, q as useAdminReviewQueues, r as useAppAccountCheck, s as useAppsRegistry, t as useAtFundLink, v as useBlueskySuggestions, w as useBulkHideProfileItems, x as useBulkHideStandardPublications, y as useBulkUnhideProfileItems, z as useBulkUnhideStandardPublications, B as useCanonicalSkillSearch, E as useCastRoadmapVote, G as useCreateConfirmation, H as useCreateEducation, I as useCreateEndorsement, J as useCreateExternalAccount, K as useCreatePosition, L as useCreateProfileLocation, M as useCreateReaction, N as useCreateRecord, O as useCreateSkill, Q as useDebouncedValue, T as useDeleteAccount, V as useDeleteAvatarOverride, W as useDeleteEducation, X as useDeleteExternalAccount, Y as useDeleteNamePronunciationAudio, Z as useDeletePosition, _ as useDeleteProfileLocation, $ as useDeleteReaction, a0 as useDeleteRecord, a1 as useDeleteRepoRecords, a2 as useDeleteSkill, a3 as useDismissConfirmation, a4 as useDismissUnlinkedPosition, a5 as useEndorsementCount, a6 as useEntitySearch, a7 as useExternalAccounts, a8 as useFeatureAllowlist, a9 as useFeaturedProfile, aa as useFollow, ab as useFollowers, ac as useFollowing, ad as useFollowingFeed, ae as useFollowingFeedVersion, af as useFollowingList, ag as useGetProfileView, ah as useGivenConfirmations, ai as useHeatmapData, aj as useHiddenActivityItems, ak as useHiddenApps, al as useHideActivityItem, am as useHideKeytraceClaim, an as useHideOrcidPublication, ao as useHideProfileItem, ap as useHideSifaPublication, aq as useHideStandardPublication, ar as useImportSearchEntities, as as useInboxCounts, at as useLinkSkillToPosition, av as useMutuals, aw as useMyGithubPullRequests, ax as useMyRoadmapVotes, ay as useNetworkStreamCount, az as useOrgClaim, aA as useOrgDomainChallenge, aB as useOrgDomainVerify, aC as useOrgProfile, aD as usePendingConfirmations, aE as useProfile, aF as useProfileCompleteness, aG as useReactionStatus, aH as useRefreshOrcidPublications, aI as useRefreshPds, aJ as useRemoveFeatureAllowlist, aK as useRemoveOrgNotificationEmail, aL as useRepoInventory, aM as useResetProfile, aO as useRetractRoadmapVote, aP as useRevealMarqueDomain, aQ as useRevokeConfirmation, aR as useRoadmapVotes, bt as useSearchCompanies, aS as useSearchFilters, aT as useSearchProfiles, aU as useSelectEntity, aV as useSetExternalAccountPrimary, aW as useSetPositionPrimary, aX as useSetSectionPrimary, aY as useSifaConfig, aZ as useSimilarProfiles, a_ as useSkillSuggestions, a$ as useStats, b0 as useSuggestionCount, b1 as useSuggestions, b2 as useUnfollow, b3 as useUnhideActivityItem, b4 as useUnhideKeytraceClaim, b5 as useUnhideOrcidPublication, b6 as useUnhideProfileItem, b7 as useUnhideSifaPublication, b8 as useUnhideStandardPublication, b9 as useUnlinkSkillFromPosition, ba as useUnlinkedPositions, bb as useUnrevealMarqueDomain, bc as useUnsetExternalAccountPrimary, bd as useUnsetPositionPrimary, be as useUnsetSectionPrimary, bf as useUpdateEducation, bg as useUpdateExternalAccount, bh as useUpdateOrgProfile, bi as useUpdatePosition, bj as useUpdateProfileLocation, bk as useUpdateProfileOverride, bl as useUpdateProfileSelf, bm as useUpdateRecord, bn as useUpdateSkill, bo as useUpdateSkillSubCategories, bp as useUploadAvatar, bq as useUploadNamePronunciationAudio, br as useVerifyExternalAccount, bs as useWipePreview } from '../../use-org-notification-emails-CWLCWkmb.js';
|
|
2
|
+
export { aK as SifaQueryKey, s as sifaQueryKeys } from '../../org-hxHnoBfg.js';
|
|
3
3
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
4
4
|
import { UseMutationOptions } from '@tanstack/react-query';
|
|
5
|
-
import { N as CreateResult, W as WriteResult } from '../../types-
|
|
5
|
+
import { N as CreateResult, W as WriteResult } from '../../types-jB67EFpw.js';
|
|
6
6
|
import 'react';
|
|
7
7
|
import '../../index-D9GC0u__.js';
|
|
8
8
|
import '../../shared-v0vl5hov.js';
|
|
@@ -1 +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
|
|
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":[]}
|
|
@@ -1 +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
|
|
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":[]}
|
|
@@ -1 +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
|
|
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/**\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;AAaA,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":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/query/hooks/use-org-profile-settings.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 { updateOrgProfile, type OrgProfileUpdateResult } from '../fetchers/org.js';\nimport type { OrgProfileUpdateRequestInput } from '../../schemas/write/org-settings.js';\nimport { sifaQueryKeys } from '../keys.js';\n\ntype OrgProfileUpdateMutationResult = WriteResult
|
|
1
|
+
{"version":3,"sources":["../../../src/query/hooks/use-org-profile-settings.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 { updateOrgProfile, type OrgProfileUpdateResult } from '../fetchers/org.js';\nimport type { OrgProfileUpdateRequestInput } from '../../schemas/write/org-settings.js';\nimport { sifaQueryKeys } from '../keys.js';\n\ntype OrgProfileUpdateMutationResult = WriteResult<Partial<OrgProfileUpdateResult>>;\n\n/**\n * Edit the org record (`PUT /api/org/profile`). Pass the org's handle/DID to\n * invalidate the profile cache (org floor verdict + fields) on success.\n */\nexport function useUpdateOrgProfile(\n handleOrDid: string | null,\n options?: Omit<\n UseMutationOptions<OrgProfileUpdateMutationResult, Error, OrgProfileUpdateRequestInput>,\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: OrgProfileUpdateRequestInput) => updateOrgProfile(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,wBAAqD;AAE9D,SAAS,qBAAqB;AAQvB,SAAS,oBACd,aACA,SAIA;AACA,QAAM,SAAS,cAAc;AAC7B,QAAM,cAAc,eAAe;AACnC,SAAO,YAAY;AAAA;AAAA;AAAA,IAGjB,GAAG;AAAA,IACH,YAAY,CAAC,SAAuC,iBAAiB,QAAQ,IAAI;AAAA,IACjF,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":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/query/hooks/use-skill-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 createSkill,\n deleteSkill,\n updateSkill,\n updateSkillSubCategories,\n type SubCategoryBulkResult,\n} from '../fetchers/skills.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 skill record. */\nexport function useCreateSkill(\n ownerHandleOrDid: string,\n options?: Omit<UseMutationOptions<CreateResult, Error, Record<string, unknown>>, '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: Record<string, unknown>) => createSkill(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 useUpdateSkill}. */\nexport interface UpdateSkillVariables {\n rkey: string;\n data: Record<string, unknown>;\n}\n\n/** React hook for updating a skill record. */\nexport function useUpdateSkill(\n ownerHandleOrDid: string,\n options?: Omit<UseMutationOptions<WriteResult, Error, UpdateSkillVariables>, '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, data }: UpdateSkillVariables) => updateSkill(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/** Variables for {@link useUpdateSkillSubCategories}. */\nexport interface UpdateSkillSubCategoriesVariables {\n rkeys: string[];\n subCategory: string;\n}\n\n/**\n * React hook for setting (or clearing) the sub-category on many skills in a\n * single request. An empty `subCategory` clears the field.\n */\nexport function useUpdateSkillSubCategories(\n ownerHandleOrDid: string,\n options?: Omit<\n UseMutationOptions<\n WriteResult
|
|
1
|
+
{"version":3,"sources":["../../../src/query/hooks/use-skill-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 createSkill,\n deleteSkill,\n updateSkill,\n updateSkillSubCategories,\n type SubCategoryBulkResult,\n} from '../fetchers/skills.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 skill record. */\nexport function useCreateSkill(\n ownerHandleOrDid: string,\n options?: Omit<UseMutationOptions<CreateResult, Error, Record<string, unknown>>, '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: Record<string, unknown>) => createSkill(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 useUpdateSkill}. */\nexport interface UpdateSkillVariables {\n rkey: string;\n data: Record<string, unknown>;\n}\n\n/** React hook for updating a skill record. */\nexport function useUpdateSkill(\n ownerHandleOrDid: string,\n options?: Omit<UseMutationOptions<WriteResult, Error, UpdateSkillVariables>, '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, data }: UpdateSkillVariables) => updateSkill(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/** Variables for {@link useUpdateSkillSubCategories}. */\nexport interface UpdateSkillSubCategoriesVariables {\n rkeys: string[];\n subCategory: string;\n}\n\n/**\n * React hook for setting (or clearing) the sub-category on many skills in a\n * single request. An empty `subCategory` clears the field.\n */\nexport function useUpdateSkillSubCategories(\n ownerHandleOrDid: string,\n options?: Omit<\n UseMutationOptions<\n WriteResult<SubCategoryBulkResult>,\n Error,\n UpdateSkillSubCategoriesVariables\n >,\n 'mutationFn'\n >,\n) {\n const config = useSifaConfig();\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ rkeys, subCategory }: UpdateSkillSubCategoriesVariables) =>\n updateSkillSubCategories(config, rkeys, subCategory),\n // `...options` comes first so a caller-supplied onSuccess cannot replace the\n // wrapper below and silently skip profile invalidation; the wrapper calls it\n // instead. The older skill hooks in this file spread options last and still\n // carry that bug.\n ...options,\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 skill record. Variable: the `rkey` string. */\nexport function useDeleteSkill(\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) => deleteSkill(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,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,eACd,kBACA,SACA;AACA,QAAM,SAAS,cAAc;AAC7B,QAAM,cAAc,eAAe;AACnC,SAAO,YAAY;AAAA;AAAA;AAAA,IAGjB,GAAG;AAAA,IACH,YAAY,CAAC,SAAkC,YAAY,QAAQ,IAAI;AAAA,IACvE,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,eACd,kBACA,SACA;AACA,QAAM,SAAS,cAAc;AAC7B,QAAM,cAAc,eAAe;AACnC,SAAO,YAAY;AAAA;AAAA;AAAA,IAGjB,GAAG;AAAA,IACH,YAAY,CAAC,EAAE,MAAM,KAAK,MAA4B,YAAY,QAAQ,MAAM,IAAI;AAAA,IACpF,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;AAYO,SAAS,4BACd,kBACA,SAQA;AACA,QAAM,SAAS,cAAc;AAC7B,QAAM,cAAc,eAAe;AACnC,SAAO,YAAY;AAAA,IACjB,YAAY,CAAC,EAAE,OAAO,YAAY,MAChC,yBAAyB,QAAQ,OAAO,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA,IAKrD,GAAG;AAAA,IACH,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,eACd,kBACA,SACA;AACA,QAAM,SAAS,cAAc;AAC7B,QAAM,cAAc,eAAe;AACnC,SAAO,YAAY;AAAA;AAAA;AAAA,IAGjB,GAAG;AAAA,IACH,YAAY,CAAC,SAAiB,YAAY,QAAQ,IAAI;AAAA,IACtD,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":[]}
|
package/dist/query/index.cjs
CHANGED
|
@@ -9,16 +9,27 @@ var reactQuery = require('@tanstack/react-query');
|
|
|
9
9
|
var ApiError = class extends Error {
|
|
10
10
|
status;
|
|
11
11
|
body;
|
|
12
|
-
|
|
12
|
+
/** Seconds until a rate limit resets, read from the headers of a 429. */
|
|
13
|
+
retryAfterSeconds;
|
|
14
|
+
constructor(message, status, body, retryAfterSeconds) {
|
|
13
15
|
super(message);
|
|
14
16
|
this.name = "ApiError";
|
|
15
17
|
this.status = status;
|
|
16
18
|
this.body = body;
|
|
19
|
+
if (retryAfterSeconds !== void 0) this.retryAfterSeconds = retryAfterSeconds;
|
|
17
20
|
}
|
|
18
21
|
};
|
|
19
22
|
var DEFAULT_TIMEOUT_MS = 1e4;
|
|
20
23
|
var MAX_RATE_LIMIT_RETRIES = 3;
|
|
21
24
|
var RATE_LIMIT_RETRY_CAP_SECONDS = 3;
|
|
25
|
+
var RATE_LIMIT_RESET_HEADERS = ["retry-after", "x-ratelimit-reset"];
|
|
26
|
+
function parseRetryAfterSeconds(headers) {
|
|
27
|
+
for (const name of RATE_LIMIT_RESET_HEADERS) {
|
|
28
|
+
const seconds = Number.parseInt(headers.get(name) ?? "", 10);
|
|
29
|
+
if (Number.isFinite(seconds) && seconds > 0) return seconds;
|
|
30
|
+
}
|
|
31
|
+
return void 0;
|
|
32
|
+
}
|
|
22
33
|
function encodeIdentifier(value) {
|
|
23
34
|
let decoded = value;
|
|
24
35
|
try {
|
|
@@ -70,7 +81,12 @@ async function apiFetch(config, path, options = {}) {
|
|
|
70
81
|
errBody = void 0;
|
|
71
82
|
}
|
|
72
83
|
}
|
|
73
|
-
throw new ApiError(
|
|
84
|
+
throw new ApiError(
|
|
85
|
+
`Sifa API ${res.status} on ${path}`,
|
|
86
|
+
res.status,
|
|
87
|
+
errBody,
|
|
88
|
+
res.status === 429 ? parseRetryAfterSeconds(res.headers) : void 0
|
|
89
|
+
);
|
|
74
90
|
}
|
|
75
91
|
if (res.status === 204 || res.status === 205) {
|
|
76
92
|
return void 0;
|
|
@@ -87,10 +103,14 @@ async function apiFetchOrNull(config, path, options = {}) {
|
|
|
87
103
|
throw e;
|
|
88
104
|
}
|
|
89
105
|
}
|
|
90
|
-
function extractWriteError(
|
|
91
|
-
const body =
|
|
106
|
+
function extractWriteError(e) {
|
|
107
|
+
const body = e.body && typeof e.body === "object" ? e.body : {};
|
|
92
108
|
return {
|
|
93
|
-
|
|
109
|
+
// Fastify puts the detail in `message` and the status phrase in `error`;
|
|
110
|
+
// sifa-api's own handlers (and the rate limiter) only set `error`.
|
|
111
|
+
error: body.message ?? body.error ?? `Request failed (${e.status})`,
|
|
112
|
+
status: e.status,
|
|
113
|
+
...e.retryAfterSeconds !== void 0 ? { retryAfterSeconds: e.retryAfterSeconds } : {},
|
|
94
114
|
...body.pdsHost ? { pdsHost: body.pdsHost } : {}
|
|
95
115
|
};
|
|
96
116
|
}
|
|
@@ -104,7 +124,7 @@ async function apiWrite(config, path, method, options = {}) {
|
|
|
104
124
|
return { success: true, ...data ?? {} };
|
|
105
125
|
} catch (e) {
|
|
106
126
|
if (e instanceof ApiError) {
|
|
107
|
-
return { success: false, ...extractWriteError(e
|
|
127
|
+
return { success: false, ...extractWriteError(e) };
|
|
108
128
|
}
|
|
109
129
|
return { success: false, error: "Network error" };
|
|
110
130
|
}
|