@singi-labs/sifa-sdk 0.9.13 → 0.9.14

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/index.cjs CHANGED
@@ -1600,6 +1600,43 @@ function resolveCardUrl(item) {
1600
1600
  return patternUrl(appId, { handle: authorHandle, did: authorDid, rkey }, collection);
1601
1601
  }
1602
1602
 
1603
+ // src/cards/visibility.ts
1604
+ function isNonEmptyString(value) {
1605
+ return typeof value === "string" && value.trim().length > 0;
1606
+ }
1607
+ function bookhiveHasOpinion(record) {
1608
+ const review = typeof record.review === "string" ? record.review.trim() : "";
1609
+ const stars = typeof record.stars === "number" ? record.stars : 0;
1610
+ return review.length > 0 || stars > 0;
1611
+ }
1612
+ function beaconbitsHasContent(record) {
1613
+ return isNonEmptyString(record.shout) || record.postRef != null;
1614
+ }
1615
+ function marginBookmarkHasSource(record) {
1616
+ return isNonEmptyString(record.source);
1617
+ }
1618
+ function marginAnnotationHasBody(record) {
1619
+ const body = record.body;
1620
+ if (typeof body === "string") return body.trim().length > 0;
1621
+ if (body != null && typeof body === "object") {
1622
+ const value = body.value;
1623
+ return typeof value === "string" && value.trim().length > 0;
1624
+ }
1625
+ return false;
1626
+ }
1627
+ var ACTIVITY_VISIBILITY_RULES = Object.freeze({
1628
+ "buzz.bookhive.book": bookhiveHasOpinion,
1629
+ "app.beaconbits.beacon": beaconbitsHasContent,
1630
+ "at.margin.bookmark": marginBookmarkHasSource,
1631
+ "at.margin.annotation": marginAnnotationHasBody
1632
+ });
1633
+ function isVisibleActivityItem(collection, record) {
1634
+ if (record === null || typeof record !== "object") return false;
1635
+ const rule = ACTIVITY_VISIBILITY_RULES[collection];
1636
+ if (!rule) return true;
1637
+ return rule(record);
1638
+ }
1639
+
1603
1640
  // src/logic/profile-completeness.ts
1604
1641
  var COMPLETENESS_MAX_SCORE = 6;
1605
1642
  function completenessScore(c) {
@@ -1830,9 +1867,10 @@ var ProfileVolunteeringRecordSchema = zod.z.object({
1830
1867
  });
1831
1868
 
1832
1869
  // src/index.ts
1833
- var SIFA_SDK_VERSION = "0.9.13";
1870
+ var SIFA_SDK_VERSION = "0.9.14";
1834
1871
 
1835
1872
  exports.ACTIVITY_TIERS = ACTIVITY_TIERS;
1873
+ exports.ACTIVITY_VISIBILITY_RULES = ACTIVITY_VISIBILITY_RULES;
1836
1874
  exports.APP_URL_PATTERNS = APP_URL_PATTERNS;
1837
1875
  exports.CATEGORY_LABELS = CATEGORY_LABELS;
1838
1876
  exports.CATEGORY_ORDER = CATEGORY_ORDER;
@@ -1905,6 +1943,7 @@ exports.getWorkplaceTypeLabel = getWorkplaceTypeLabel;
1905
1943
  exports.groupSkillsByCategory = groupSkillsByCategory;
1906
1944
  exports.isKnownPlatform = isKnownPlatform;
1907
1945
  exports.isValidRgbColor = isValidRgbColor;
1946
+ exports.isVisibleActivityItem = isVisibleActivityItem;
1908
1947
  exports.languageTagSchema = languageTagSchema;
1909
1948
  exports.lexiconDateExtractor = lexiconDateExtractor;
1910
1949
  exports.limitCombiningMarks = limitCombiningMarks;