@singi-labs/sifa-sdk 0.19.49 → 0.19.51

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 (35) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +1 -1
  3. package/dist/jsonld/index.cjs +28 -13
  4. package/dist/jsonld/index.cjs.map +1 -1
  5. package/dist/jsonld/works-graph.js +29 -14
  6. package/dist/jsonld/works-graph.js.map +1 -1
  7. package/dist/{org-CxTEjjrm.d.ts → org-Bp4mNT8K.d.ts} +26 -2
  8. package/dist/{org-DC_FpoTY.d.cts → org-CFzRg61Q.d.cts} +26 -2
  9. package/dist/query/fetchers/follow.js +30 -6
  10. package/dist/query/fetchers/follow.js.map +1 -1
  11. package/dist/query/fetchers/index.cjs +31 -6
  12. package/dist/query/fetchers/index.cjs.map +1 -1
  13. package/dist/query/fetchers/index.d.cts +1 -1
  14. package/dist/query/fetchers/index.d.ts +1 -1
  15. package/dist/query/fetchers/index.js +4 -0
  16. package/dist/query/fetchers/index.js.map +1 -1
  17. package/dist/query/hooks/index.cjs +45 -7
  18. package/dist/query/hooks/index.cjs.map +1 -1
  19. package/dist/query/hooks/index.d.cts +2 -2
  20. package/dist/query/hooks/index.d.ts +2 -2
  21. package/dist/query/hooks/index.js +2 -0
  22. package/dist/query/hooks/index.js.map +1 -1
  23. package/dist/query/hooks/use-follow.js +21 -1
  24. package/dist/query/hooks/use-follow.js.map +1 -1
  25. package/dist/query/index.cjs +51 -7
  26. package/dist/query/index.cjs.map +1 -1
  27. package/dist/query/index.d.cts +3 -3
  28. package/dist/query/index.d.ts +3 -3
  29. package/dist/query/index.js +6 -0
  30. package/dist/query/index.js.map +1 -1
  31. package/dist/query/keys.js +1 -0
  32. package/dist/query/keys.js.map +1 -1
  33. package/dist/{use-org-notification-emails-CWWi1D8t.d.ts → use-org-notification-emails-CJ0hKqco.d.ts} +9 -3
  34. package/dist/{use-org-notification-emails-DOyAF0C_.d.cts → use-org-notification-emails-Dk084Rrw.d.cts} +9 -3
  35. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -7128,7 +7128,7 @@ function describeSifaRecord(collection, value) {
7128
7128
  }
7129
7129
 
7130
7130
  // src/index.ts
7131
- var SIFA_SDK_VERSION = "0.19.49";
7131
+ var SIFA_SDK_VERSION = "0.19.51";
7132
7132
 
7133
7133
  exports.ACTIVITY_TIERS = ACTIVITY_TIERS;
7134
7134
  exports.ACTIVITY_VERBS = ACTIVITY_VERBS;
package/dist/index.js CHANGED
@@ -347,7 +347,7 @@ import {
347
347
  roadmapIssueUrl
348
348
  } from "./roadmap/index.js";
349
349
  import { SIFA_REPO_GROUPS, describeSifaRecord, repoGroupForCollection } from "./repo/index.js";
350
- var SIFA_SDK_VERSION = "0.19.49";
350
+ var SIFA_SDK_VERSION = "0.19.51";
351
351
  export {
352
352
  ACTIVITY_TIERS,
353
353
  ACTIVITY_VERBS,
@@ -966,21 +966,36 @@ function buildProfileWorksJsonLd(profile, author, options = {}) {
966
966
  const { "@context": _context, ...rest } = node;
967
967
  return rest;
968
968
  };
969
- const authorRef = [{ "@id": personId }];
969
+ const ownerUrl = profileUrl(normaliseBaseUrl(options.baseUrl), author.handle);
970
+ const refOwner = (nodes) => {
971
+ let seenOwner = false;
972
+ const out = [];
973
+ for (const node of nodes) {
974
+ const isOwner = typeof node === "object" && node !== null && node["@type"] === "Person" && node.url === ownerUrl;
975
+ if (isOwner) {
976
+ if (seenOwner) continue;
977
+ seenOwner = true;
978
+ out.push({ "@id": personId });
979
+ } else {
980
+ out.push(node);
981
+ }
982
+ }
983
+ return out;
984
+ };
970
985
  const graph = [
971
- ...visible3(profile.publications).map((p) => ({
972
- ...strip(buildPublicationJsonLd(p, author, options)),
973
- author: authorRef
974
- })),
975
- ...visible3(profile.presentations).map((p) => ({
976
- ...strip(buildPresentationJsonLd(p, author, options)),
977
- author: authorRef
978
- })),
986
+ ...visible3(profile.publications).map((p) => {
987
+ const node = strip(buildPublicationJsonLd(p, author, options));
988
+ return { ...node, author: refOwner(node.author) };
989
+ }),
990
+ ...visible3(profile.presentations).map((p) => {
991
+ const node = strip(buildPresentationJsonLd(p, author, options));
992
+ return { ...node, author: refOwner([node.author]) };
993
+ }),
979
994
  ...visible3(profile.courses).map((c) => strip(buildCourseJsonLd(c, options))),
980
- ...visible3(profile.projects).map((p) => ({
981
- ...strip(buildProjectJsonLd(p, author, options)),
982
- member: authorRef
983
- }))
995
+ ...visible3(profile.projects).map((p) => {
996
+ const node = strip(buildProjectJsonLd(p, author, options));
997
+ return { ...node, member: refOwner(node.member) };
998
+ })
984
999
  ];
985
1000
  if (graph.length === 0) return null;
986
1001
  return { "@context": "https://schema.org", "@graph": graph };