@singi-labs/sifa-sdk 0.12.2 → 0.12.4

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-n2uy3rT3.d.cts} +31 -1
  2. package/dist/{adult-content-DDGP8W1e.d.ts → adult-content-n2uy3rT3.d.ts} +31 -1
  3. package/dist/{index-IMvNS08M.d.ts → index-BLv2bK_K.d.ts} +2 -2
  4. package/dist/{index-BS7zO7KI.d.cts → index-COjgkXRe.d.cts} +86 -3
  5. package/dist/{index-CNh-GI9A.d.cts → index-HTTNUcN4.d.cts} +2 -2
  6. package/dist/{index-iAzeLOcz.d.ts → index-tkWmoZAu.d.ts} +86 -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-5oyp950_.d.ts → org-BZcAnLab.d.ts} +88 -2
  14. package/dist/{keys-Bn36IA8Q.d.cts → org-lIB6pSYc.d.cts} +88 -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 +45 -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 +40 -1
  22. package/dist/query/fetchers/index.js.map +1 -1
  23. package/dist/query/hooks/index.cjs +118 -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 +112 -1
  28. package/dist/query/hooks/index.js.map +1 -1
  29. package/dist/query/index.cjs +122 -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 +110 -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 +161 -1
  42. package/dist/schemas/write/index.cjs.map +1 -1
  43. package/dist/schemas/write/index.d.cts +204 -8
  44. package/dist/schemas/write/index.d.ts +204 -8
  45. package/dist/schemas/write/index.js +146 -2
  46. package/dist/schemas/write/index.js.map +1 -1
  47. package/package.json +1 -1
@@ -2397,12 +2397,124 @@ function useImportSearchEntities(options) {
2397
2397
  ...options
2398
2398
  });
2399
2399
  }
2400
+ function useOrgProfile(handleOrDid, options) {
2401
+ const config = useSifaConfig();
2402
+ return reactQuery.useQuery({
2403
+ queryKey: sifaQueryKeys.profile.byHandle(handleOrDid ?? ""),
2404
+ queryFn: () => fetchProfile(config, handleOrDid ?? ""),
2405
+ enabled: Boolean(handleOrDid) && (options?.enabled ?? true),
2406
+ select: (profile) => profile?.org ?? null,
2407
+ ...options
2408
+ });
2409
+ }
2410
+
2411
+ // src/query/fetchers/org.ts
2412
+ function submitOrgClaim(config, body, options = {}) {
2413
+ return apiWrite(config, "/api/org/claim", "POST", { body, ...options });
2414
+ }
2415
+ function updateOrgProfile(config, body, options = {}) {
2416
+ return apiWrite(config, "/api/org/profile", "PUT", {
2417
+ body,
2418
+ ...options
2419
+ });
2420
+ }
2421
+ function requestOrgDomainChallenge(config, body, options = {}) {
2422
+ return apiWrite(config, "/api/org/domains/challenge", "POST", {
2423
+ body,
2424
+ ...options
2425
+ });
2426
+ }
2427
+ function verifyOrgDomain(config, body, options = {}) {
2428
+ return apiWrite(config, "/api/org/domains/verify", "POST", {
2429
+ body,
2430
+ ...options
2431
+ });
2432
+ }
2433
+ function addOrgNotificationEmail(config, body, options = {}) {
2434
+ return apiWrite(
2435
+ config,
2436
+ "/api/org/notification-emails",
2437
+ "POST",
2438
+ { body, ...options }
2439
+ );
2440
+ }
2441
+ function removeOrgNotificationEmail(config, body, options = {}) {
2442
+ return apiWrite(
2443
+ config,
2444
+ "/api/org/notification-emails",
2445
+ "DELETE",
2446
+ { body, ...options }
2447
+ );
2448
+ }
2449
+
2450
+ // src/query/hooks/use-org-claim.ts
2451
+ function useOrgClaim(handleOrDid, options) {
2452
+ const config = useSifaConfig();
2453
+ const queryClient = reactQuery.useQueryClient();
2454
+ return reactQuery.useMutation({
2455
+ mutationFn: (body) => submitOrgClaim(config, body),
2456
+ onSuccess: async (result, variables, onMutateResult, context) => {
2457
+ if (result.success && handleOrDid) {
2458
+ await queryClient.invalidateQueries({
2459
+ queryKey: sifaQueryKeys.profile.byHandle(handleOrDid)
2460
+ });
2461
+ }
2462
+ await options?.onSuccess?.(result, variables, onMutateResult, context);
2463
+ },
2464
+ ...options
2465
+ });
2466
+ }
2467
+ function useUpdateOrgProfile(handleOrDid, options) {
2468
+ const config = useSifaConfig();
2469
+ const queryClient = reactQuery.useQueryClient();
2470
+ return reactQuery.useMutation({
2471
+ mutationFn: (body) => updateOrgProfile(config, body),
2472
+ onSuccess: async (result, variables, onMutateResult, context) => {
2473
+ if (result.success && handleOrDid) {
2474
+ await queryClient.invalidateQueries({
2475
+ queryKey: sifaQueryKeys.profile.byHandle(handleOrDid)
2476
+ });
2477
+ }
2478
+ await options?.onSuccess?.(result, variables, onMutateResult, context);
2479
+ },
2480
+ ...options
2481
+ });
2482
+ }
2483
+ function useOrgDomainChallenge(options) {
2484
+ const config = useSifaConfig();
2485
+ return reactQuery.useMutation({
2486
+ mutationFn: (body) => requestOrgDomainChallenge(config, body),
2487
+ ...options
2488
+ });
2489
+ }
2490
+ function useOrgDomainVerify(options) {
2491
+ const config = useSifaConfig();
2492
+ return reactQuery.useMutation({
2493
+ mutationFn: (body) => verifyOrgDomain(config, body),
2494
+ ...options
2495
+ });
2496
+ }
2497
+ function useAddOrgNotificationEmail(options) {
2498
+ const config = useSifaConfig();
2499
+ return reactQuery.useMutation({
2500
+ mutationFn: (body) => addOrgNotificationEmail(config, body),
2501
+ ...options
2502
+ });
2503
+ }
2504
+ function useRemoveOrgNotificationEmail(options) {
2505
+ const config = useSifaConfig();
2506
+ return reactQuery.useMutation({
2507
+ mutationFn: (body) => removeOrgNotificationEmail(config, body),
2508
+ ...options
2509
+ });
2510
+ }
2400
2511
 
2401
2512
  exports.SifaProvider = SifaProvider;
2402
2513
  exports.sifaQueryKeys = sifaQueryKeys;
2403
2514
  exports.useActivityFeed = useActivityFeed;
2404
2515
  exports.useActivityTeaser = useActivityTeaser;
2405
2516
  exports.useAddFeatureAllowlist = useAddFeatureAllowlist;
2517
+ exports.useAddOrgNotificationEmail = useAddOrgNotificationEmail;
2406
2518
  exports.useAppAccountCheck = useAppAccountCheck;
2407
2519
  exports.useAppsRegistry = useAppsRegistry;
2408
2520
  exports.useAtFundLink = useAtFundLink;
@@ -2453,11 +2565,16 @@ exports.useLinkSkillToPosition = useLinkSkillToPosition;
2453
2565
  exports.useMutuals = useMutuals;
2454
2566
  exports.useMyRoadmapVotes = useMyRoadmapVotes;
2455
2567
  exports.useNetworkStreamCount = useNetworkStreamCount;
2568
+ exports.useOrgClaim = useOrgClaim;
2569
+ exports.useOrgDomainChallenge = useOrgDomainChallenge;
2570
+ exports.useOrgDomainVerify = useOrgDomainVerify;
2571
+ exports.useOrgProfile = useOrgProfile;
2456
2572
  exports.useProfile = useProfile;
2457
2573
  exports.useReactionStatus = useReactionStatus;
2458
2574
  exports.useRefreshOrcidPublications = useRefreshOrcidPublications;
2459
2575
  exports.useRefreshPds = useRefreshPds;
2460
2576
  exports.useRemoveFeatureAllowlist = useRemoveFeatureAllowlist;
2577
+ exports.useRemoveOrgNotificationEmail = useRemoveOrgNotificationEmail;
2461
2578
  exports.useResetProfile = useResetProfile;
2462
2579
  exports.useRetractRoadmapVote = useRetractRoadmapVote;
2463
2580
  exports.useRevealMarqueDomain = useRevealMarqueDomain;
@@ -2485,6 +2602,7 @@ exports.useUnsetExternalAccountPrimary = useUnsetExternalAccountPrimary;
2485
2602
  exports.useUnsetPositionPrimary = useUnsetPositionPrimary;
2486
2603
  exports.useUpdateEducation = useUpdateEducation;
2487
2604
  exports.useUpdateExternalAccount = useUpdateExternalAccount;
2605
+ exports.useUpdateOrgProfile = useUpdateOrgProfile;
2488
2606
  exports.useUpdatePosition = useUpdatePosition;
2489
2607
  exports.useUpdateProfileLocation = useUpdateProfileLocation;
2490
2608
  exports.useUpdateProfileOverride = useUpdateProfileOverride;