@singi-labs/sifa-sdk 0.12.3 → 0.12.5

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 (47) hide show
  1. package/dist/{adult-content-DDGP8W1e.d.cts → adult-content-BOY_T6j3.d.cts} +295 -1
  2. package/dist/{adult-content-DDGP8W1e.d.ts → adult-content-BOY_T6j3.d.ts} +295 -1
  3. package/dist/{index-CNh-GI9A.d.cts → index-BJV2XHOP.d.cts} +16 -3
  4. package/dist/{index-IMvNS08M.d.ts → index-C1SIpwOj.d.ts} +16 -3
  5. package/dist/{index-iAzeLOcz.d.ts → index-m5MELVUQ.d.ts} +95 -3
  6. package/dist/{index-BS7zO7KI.d.cts → index-xcu81B4E.d.cts} +95 -3
  7. package/dist/index.cjs +73 -1
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.d.cts +96 -5
  10. package/dist/index.d.ts +96 -5
  11. package/dist/index.js +68 -2
  12. package/dist/index.js.map +1 -1
  13. package/dist/{keys-Bn36IA8Q.d.cts → org-92bvwL8H.d.cts} +89 -2
  14. package/dist/{keys-5oyp950_.d.ts → org-Bxz__jbx.d.ts} +89 -2
  15. package/dist/org-settings-CmaSX5ZI.d.cts +74 -0
  16. package/dist/org-settings-CmaSX5ZI.d.ts +74 -0
  17. package/dist/query/fetchers/index.cjs +60 -0
  18. package/dist/query/fetchers/index.cjs.map +1 -1
  19. package/dist/query/fetchers/index.d.cts +4 -3
  20. package/dist/query/fetchers/index.d.ts +4 -3
  21. package/dist/query/fetchers/index.js +54 -1
  22. package/dist/query/fetchers/index.js.map +1 -1
  23. package/dist/query/hooks/index.cjs +144 -0
  24. package/dist/query/hooks/index.cjs.map +1 -1
  25. package/dist/query/hooks/index.d.cts +4 -3
  26. package/dist/query/hooks/index.d.ts +4 -3
  27. package/dist/query/hooks/index.js +137 -1
  28. package/dist/query/hooks/index.js.map +1 -1
  29. package/dist/query/index.cjs +147 -0
  30. package/dist/query/index.cjs.map +1 -1
  31. package/dist/query/index.d.cts +6 -5
  32. package/dist/query/index.d.ts +6 -5
  33. package/dist/query/index.js +133 -1
  34. package/dist/query/index.js.map +1 -1
  35. package/dist/schemas/index.cjs +27 -0
  36. package/dist/schemas/index.cjs.map +1 -1
  37. package/dist/schemas/index.d.cts +67 -1
  38. package/dist/schemas/index.d.ts +67 -1
  39. package/dist/schemas/index.js +26 -1
  40. package/dist/schemas/index.js.map +1 -1
  41. package/dist/schemas/write/index.cjs +36 -0
  42. package/dist/schemas/write/index.cjs.map +1 -1
  43. package/dist/schemas/write/index.d.cts +1 -0
  44. package/dist/schemas/write/index.d.ts +1 -0
  45. package/dist/schemas/write/index.js +32 -1
  46. package/dist/schemas/write/index.js.map +1 -1
  47. package/package.json +1 -1
@@ -157,6 +157,7 @@ var sifaQueryKeys = {
157
157
  all: () => ["sifa", "profile"],
158
158
  byHandle: (handleOrDid) => ["sifa", "profile", handleOrDid],
159
159
  atFundLink: (did) => ["sifa", "profile", "at-fund-link", did],
160
+ view: (actor) => ["sifa", "profile", "view", actor],
160
161
  externalAccounts: (handleOrDid) => ["sifa", "profile", "external-accounts", handleOrDid]
161
162
  },
162
163
  position: {
@@ -253,6 +254,30 @@ function useAtFundLink(did, options) {
253
254
  });
254
255
  }
255
256
 
257
+ // src/query/fetchers/get-profile-view.ts
258
+ async function fetchGetProfileView(config, actor, options = {}) {
259
+ const path = `/xrpc/id.sifa.getProfileView?actor=${encodeIdentifier(actor)}`;
260
+ try {
261
+ return await apiFetch(config, path, { retryOn429: true, ...options });
262
+ } catch (e) {
263
+ if (e instanceof ApiError && e.status === 400 && typeof e.body === "object" && e.body !== null && e.body.error === "ProfileNotFound") {
264
+ return null;
265
+ }
266
+ throw e;
267
+ }
268
+ }
269
+
270
+ // src/query/hooks/use-get-profile-view.ts
271
+ function useGetProfileView(actor, options) {
272
+ const config = useSifaConfig();
273
+ return reactQuery.useQuery({
274
+ queryKey: sifaQueryKeys.profile.view(actor ?? ""),
275
+ queryFn: () => fetchGetProfileView(config, actor ?? ""),
276
+ enabled: Boolean(actor) && (options?.enabled ?? true),
277
+ ...options
278
+ });
279
+ }
280
+
256
281
  // src/query/fetchers/profile-mutations.ts
257
282
  function updateProfileSelf(config, data, options = {}) {
258
283
  return apiWrite(config, "/api/profile/self", "PUT", { body: data, ...options });
@@ -2397,12 +2422,124 @@ function useImportSearchEntities(options) {
2397
2422
  ...options
2398
2423
  });
2399
2424
  }
2425
+ function useOrgProfile(handleOrDid, options) {
2426
+ const config = useSifaConfig();
2427
+ return reactQuery.useQuery({
2428
+ queryKey: sifaQueryKeys.profile.byHandle(handleOrDid ?? ""),
2429
+ queryFn: () => fetchProfile(config, handleOrDid ?? ""),
2430
+ enabled: Boolean(handleOrDid) && (options?.enabled ?? true),
2431
+ select: (profile) => profile?.org ?? null,
2432
+ ...options
2433
+ });
2434
+ }
2435
+
2436
+ // src/query/fetchers/org.ts
2437
+ function submitOrgClaim(config, body, options = {}) {
2438
+ return apiWrite(config, "/api/org/claim", "POST", { body, ...options });
2439
+ }
2440
+ function updateOrgProfile(config, body, options = {}) {
2441
+ return apiWrite(config, "/api/org/profile", "PUT", {
2442
+ body,
2443
+ ...options
2444
+ });
2445
+ }
2446
+ function requestOrgDomainChallenge(config, body, options = {}) {
2447
+ return apiWrite(config, "/api/org/domains/challenge", "POST", {
2448
+ body,
2449
+ ...options
2450
+ });
2451
+ }
2452
+ function verifyOrgDomain(config, body, options = {}) {
2453
+ return apiWrite(config, "/api/org/domains/verify", "POST", {
2454
+ body,
2455
+ ...options
2456
+ });
2457
+ }
2458
+ function addOrgNotificationEmail(config, body, options = {}) {
2459
+ return apiWrite(
2460
+ config,
2461
+ "/api/org/notification-emails",
2462
+ "POST",
2463
+ { body, ...options }
2464
+ );
2465
+ }
2466
+ function removeOrgNotificationEmail(config, body, options = {}) {
2467
+ return apiWrite(
2468
+ config,
2469
+ "/api/org/notification-emails",
2470
+ "DELETE",
2471
+ { body, ...options }
2472
+ );
2473
+ }
2474
+
2475
+ // src/query/hooks/use-org-claim.ts
2476
+ function useOrgClaim(handleOrDid, options) {
2477
+ const config = useSifaConfig();
2478
+ const queryClient = reactQuery.useQueryClient();
2479
+ return reactQuery.useMutation({
2480
+ mutationFn: (body) => submitOrgClaim(config, body),
2481
+ onSuccess: async (result, variables, onMutateResult, context) => {
2482
+ if (result.success && handleOrDid) {
2483
+ await queryClient.invalidateQueries({
2484
+ queryKey: sifaQueryKeys.profile.byHandle(handleOrDid)
2485
+ });
2486
+ }
2487
+ await options?.onSuccess?.(result, variables, onMutateResult, context);
2488
+ },
2489
+ ...options
2490
+ });
2491
+ }
2492
+ function useUpdateOrgProfile(handleOrDid, options) {
2493
+ const config = useSifaConfig();
2494
+ const queryClient = reactQuery.useQueryClient();
2495
+ return reactQuery.useMutation({
2496
+ mutationFn: (body) => updateOrgProfile(config, body),
2497
+ onSuccess: async (result, variables, onMutateResult, context) => {
2498
+ if (result.success && handleOrDid) {
2499
+ await queryClient.invalidateQueries({
2500
+ queryKey: sifaQueryKeys.profile.byHandle(handleOrDid)
2501
+ });
2502
+ }
2503
+ await options?.onSuccess?.(result, variables, onMutateResult, context);
2504
+ },
2505
+ ...options
2506
+ });
2507
+ }
2508
+ function useOrgDomainChallenge(options) {
2509
+ const config = useSifaConfig();
2510
+ return reactQuery.useMutation({
2511
+ mutationFn: (body) => requestOrgDomainChallenge(config, body),
2512
+ ...options
2513
+ });
2514
+ }
2515
+ function useOrgDomainVerify(options) {
2516
+ const config = useSifaConfig();
2517
+ return reactQuery.useMutation({
2518
+ mutationFn: (body) => verifyOrgDomain(config, body),
2519
+ ...options
2520
+ });
2521
+ }
2522
+ function useAddOrgNotificationEmail(options) {
2523
+ const config = useSifaConfig();
2524
+ return reactQuery.useMutation({
2525
+ mutationFn: (body) => addOrgNotificationEmail(config, body),
2526
+ ...options
2527
+ });
2528
+ }
2529
+ function useRemoveOrgNotificationEmail(options) {
2530
+ const config = useSifaConfig();
2531
+ return reactQuery.useMutation({
2532
+ mutationFn: (body) => removeOrgNotificationEmail(config, body),
2533
+ ...options
2534
+ });
2535
+ }
2400
2536
 
2401
2537
  exports.SifaProvider = SifaProvider;
2402
2538
  exports.sifaQueryKeys = sifaQueryKeys;
2403
2539
  exports.useActivityFeed = useActivityFeed;
2404
2540
  exports.useActivityTeaser = useActivityTeaser;
2405
2541
  exports.useAddFeatureAllowlist = useAddFeatureAllowlist;
2542
+ exports.useAddOrgNotificationEmail = useAddOrgNotificationEmail;
2406
2543
  exports.useAppAccountCheck = useAppAccountCheck;
2407
2544
  exports.useAppsRegistry = useAppsRegistry;
2408
2545
  exports.useAtFundLink = useAtFundLink;
@@ -2441,6 +2578,7 @@ exports.useFollowers = useFollowers;
2441
2578
  exports.useFollowing = useFollowing;
2442
2579
  exports.useFollowingFeed = useFollowingFeed;
2443
2580
  exports.useFollowingList = useFollowingList;
2581
+ exports.useGetProfileView = useGetProfileView;
2444
2582
  exports.useHeatmapData = useHeatmapData;
2445
2583
  exports.useHiddenApps = useHiddenApps;
2446
2584
  exports.useHideKeytraceClaim = useHideKeytraceClaim;
@@ -2453,11 +2591,16 @@ exports.useLinkSkillToPosition = useLinkSkillToPosition;
2453
2591
  exports.useMutuals = useMutuals;
2454
2592
  exports.useMyRoadmapVotes = useMyRoadmapVotes;
2455
2593
  exports.useNetworkStreamCount = useNetworkStreamCount;
2594
+ exports.useOrgClaim = useOrgClaim;
2595
+ exports.useOrgDomainChallenge = useOrgDomainChallenge;
2596
+ exports.useOrgDomainVerify = useOrgDomainVerify;
2597
+ exports.useOrgProfile = useOrgProfile;
2456
2598
  exports.useProfile = useProfile;
2457
2599
  exports.useReactionStatus = useReactionStatus;
2458
2600
  exports.useRefreshOrcidPublications = useRefreshOrcidPublications;
2459
2601
  exports.useRefreshPds = useRefreshPds;
2460
2602
  exports.useRemoveFeatureAllowlist = useRemoveFeatureAllowlist;
2603
+ exports.useRemoveOrgNotificationEmail = useRemoveOrgNotificationEmail;
2461
2604
  exports.useResetProfile = useResetProfile;
2462
2605
  exports.useRetractRoadmapVote = useRetractRoadmapVote;
2463
2606
  exports.useRevealMarqueDomain = useRevealMarqueDomain;
@@ -2485,6 +2628,7 @@ exports.useUnsetExternalAccountPrimary = useUnsetExternalAccountPrimary;
2485
2628
  exports.useUnsetPositionPrimary = useUnsetPositionPrimary;
2486
2629
  exports.useUpdateEducation = useUpdateEducation;
2487
2630
  exports.useUpdateExternalAccount = useUpdateExternalAccount;
2631
+ exports.useUpdateOrgProfile = useUpdateOrgProfile;
2488
2632
  exports.useUpdatePosition = useUpdatePosition;
2489
2633
  exports.useUpdateProfileLocation = useUpdateProfileLocation;
2490
2634
  exports.useUpdateProfileOverride = useUpdateProfileOverride;