@singi-labs/sifa-sdk 0.10.8 → 0.10.10

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
@@ -700,13 +700,21 @@ var OPEN_TO_OPTIONS = [
700
700
  group: "peer"
701
701
  }
702
702
  ];
703
- Object.fromEntries(
703
+ var OPEN_TO_TOKEN_TO_VALUE = Object.fromEntries(
704
704
  OPEN_TO_OPTIONS.map((o) => [o.token, o.value])
705
705
  );
706
- Object.fromEntries(
706
+ var OPEN_TO_VALUE_TO_TOKEN = Object.fromEntries(
707
707
  OPEN_TO_OPTIONS.map((o) => [o.value, o.token])
708
708
  );
709
- OPEN_TO_OPTIONS.map((o) => o.token);
709
+ var OPEN_TO_TOKENS = OPEN_TO_OPTIONS.map((o) => o.token);
710
+ function openToTokenToValue(token) {
711
+ if (!token) return void 0;
712
+ return OPEN_TO_TOKEN_TO_VALUE[token];
713
+ }
714
+ function openToValueToToken(value) {
715
+ if (!value) return void 0;
716
+ return OPEN_TO_VALUE_TO_TOKEN[value];
717
+ }
710
718
  var OPEN_TO_LEGACY_ALIASES = {
711
719
  "id.sifa.defs#mentoring": "mentoringOthers"
712
720
  };
@@ -906,6 +914,7 @@ var APP_CATEGORY_MAP = {
906
914
  plyr: "Music",
907
915
  anisota: "Posts",
908
916
  atfund: "Endorsements",
917
+ crate: "Articles",
909
918
  // Web-only (rendered in pills/cards via sifa-web atproto-apps.ts;
910
919
  // no backend scan collection yet)
911
920
  linkat: "Links",
@@ -1621,6 +1630,13 @@ var APP_URL_PATTERNS = Object.freeze({
1621
1630
  // and there's no public per-endorsement permalink. Profile fallback only,
1622
1631
  // pointing at the main /give listing.
1623
1632
  profileUrlPattern: "https://www.at.fund/give"
1633
+ },
1634
+ crate: {
1635
+ // Crate (app.crate.social) is an authoring dashboard with no public
1636
+ // per-record viewer or per-handle profile page — records are designed to
1637
+ // render on the maker's own site. `content` cards link out via
1638
+ // record.canonicalUrl (handled in resolveCardUrl); `note` records have no
1639
+ // public URL and render non-clickable. So no app-level pattern applies.
1624
1640
  }
1625
1641
  });
1626
1642
  var COLLECTION_TO_APP = [
@@ -1662,7 +1678,8 @@ var COLLECTION_TO_APP = [
1662
1678
  ["community.nooki.", "nooki"],
1663
1679
  ["fyi.atstore.", "atstore"],
1664
1680
  ["fm.plyr.", "plyr"],
1665
- ["fund.at.", "atfund"]
1681
+ ["fund.at.", "atfund"],
1682
+ ["social.crate.", "crate"]
1666
1683
  ];
1667
1684
 
1668
1685
  // src/cards/resolve-card-url.ts
@@ -1770,6 +1787,12 @@ function resolveCardUrl(item) {
1770
1787
  }
1771
1788
  return APP_URL_PATTERNS.atstore?.profileUrlPattern ?? null;
1772
1789
  }
1790
+ if (collection === "social.crate.content") {
1791
+ return stringOrNull(record.canonicalUrl);
1792
+ }
1793
+ if (collection === "social.crate.note") {
1794
+ return null;
1795
+ }
1773
1796
  if (collection.startsWith("site.standard.")) {
1774
1797
  const siteUrl = stringOrNull(record.siteUrl);
1775
1798
  const path = stringOrNull(record.path);
@@ -2227,7 +2250,7 @@ var ProfileVolunteeringRecordSchema = zod.z.object({
2227
2250
  });
2228
2251
 
2229
2252
  // src/index.ts
2230
- var SIFA_SDK_VERSION = "0.10.8";
2253
+ var SIFA_SDK_VERSION = "0.10.10";
2231
2254
 
2232
2255
  exports.ACTIVITY_TIERS = ACTIVITY_TIERS;
2233
2256
  exports.ACTIVITY_VISIBILITY_RULES = ACTIVITY_VISIBILITY_RULES;
@@ -2259,6 +2282,9 @@ exports.GraphFollowRecordSchema = GraphFollowRecordSchema;
2259
2282
  exports.INDUSTRY_OPTIONS = INDUSTRY_OPTIONS;
2260
2283
  exports.MIN_SKILLS = MIN_SKILLS;
2261
2284
  exports.OPEN_TO_OPTIONS = OPEN_TO_OPTIONS;
2285
+ exports.OPEN_TO_TOKENS = OPEN_TO_TOKENS;
2286
+ exports.OPEN_TO_TOKEN_TO_VALUE = OPEN_TO_TOKEN_TO_VALUE;
2287
+ exports.OPEN_TO_VALUE_TO_TOKEN = OPEN_TO_VALUE_TO_TOKEN;
2262
2288
  exports.PLATFORM_LABELS = PLATFORM_LABELS;
2263
2289
  exports.PLATFORM_OPTIONS = PLATFORM_OPTIONS;
2264
2290
  exports.PUBLISHERS = PUBLISHERS;
@@ -2335,6 +2361,8 @@ exports.limitCombiningMarks = limitCombiningMarks;
2335
2361
  exports.makeGraphFollowRecordSchema = makeGraphFollowRecordSchema;
2336
2362
  exports.maxGraphemes = maxGraphemes;
2337
2363
  exports.meetsContrastAA = meetsContrastAA;
2364
+ exports.openToTokenToValue = openToTokenToValue;
2365
+ exports.openToValueToToken = openToValueToToken;
2338
2366
  exports.parseLocationString = parseLocationString;
2339
2367
  exports.pdsProviderFromApi = pdsProviderFromApi;
2340
2368
  exports.pickPrimaryPosition = pickPrimaryPosition;