@singi-labs/sifa-sdk 0.9.5 → 0.9.6
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 +13 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1497,10 +1497,16 @@ function interpolate(pattern, vars) {
|
|
|
1497
1497
|
}
|
|
1498
1498
|
return result;
|
|
1499
1499
|
}
|
|
1500
|
-
function
|
|
1500
|
+
function shouldUseItemPattern(appId, collection) {
|
|
1501
|
+
if (appId === "bluesky") {
|
|
1502
|
+
return collection === "app.bsky.feed.post";
|
|
1503
|
+
}
|
|
1504
|
+
return true;
|
|
1505
|
+
}
|
|
1506
|
+
function patternUrl(appId, vars, collection) {
|
|
1501
1507
|
const patterns = APP_URL_PATTERNS[appId];
|
|
1502
1508
|
if (!patterns) return null;
|
|
1503
|
-
if (patterns.urlPattern) {
|
|
1509
|
+
if (patterns.urlPattern && shouldUseItemPattern(appId, collection)) {
|
|
1504
1510
|
const url = interpolate(patterns.urlPattern, vars);
|
|
1505
1511
|
if (url) return url;
|
|
1506
1512
|
}
|
|
@@ -1510,6 +1516,7 @@ function patternUrl(appId, vars) {
|
|
|
1510
1516
|
}
|
|
1511
1517
|
return null;
|
|
1512
1518
|
}
|
|
1519
|
+
var TANGLED_REPO_SLUG = /^[a-zA-Z0-9._-]+$/;
|
|
1513
1520
|
function stringOrNull(value) {
|
|
1514
1521
|
if (typeof value !== "string") return null;
|
|
1515
1522
|
const trimmed = value.trim();
|
|
@@ -1525,10 +1532,10 @@ function resolveCardUrl(item) {
|
|
|
1525
1532
|
const appId = getAppIdForCollection(collection);
|
|
1526
1533
|
if (collection.startsWith("sh.tangled.")) {
|
|
1527
1534
|
const repoName = stringOrNull(record.name);
|
|
1528
|
-
if (repoName && authorHandle) {
|
|
1535
|
+
if (repoName && authorHandle && TANGLED_REPO_SLUG.test(repoName)) {
|
|
1529
1536
|
return `https://tangled.sh/${authorHandle}/${repoName}`;
|
|
1530
1537
|
}
|
|
1531
|
-
return patternUrl("tangled", { handle: authorHandle, did: authorDid, rkey });
|
|
1538
|
+
return patternUrl("tangled", { handle: authorHandle, did: authorDid, rkey }, collection);
|
|
1532
1539
|
}
|
|
1533
1540
|
if (collection.startsWith("com.kipclip.") || collection.startsWith("community.lexicon.bookmarks.")) {
|
|
1534
1541
|
const subject = stringOrNull(record.subject);
|
|
@@ -1576,7 +1583,7 @@ function resolveCardUrl(item) {
|
|
|
1576
1583
|
}
|
|
1577
1584
|
const recordUrl = stringOrNull(record.url);
|
|
1578
1585
|
if (recordUrl) return recordUrl;
|
|
1579
|
-
return patternUrl(appId, { handle: authorHandle, did: authorDid, rkey });
|
|
1586
|
+
return patternUrl(appId, { handle: authorHandle, did: authorDid, rkey }, collection);
|
|
1580
1587
|
}
|
|
1581
1588
|
|
|
1582
1589
|
// src/logic/profile-completeness.ts
|
|
@@ -1799,7 +1806,7 @@ var ProfileVolunteeringRecordSchema = zod.z.object({
|
|
|
1799
1806
|
});
|
|
1800
1807
|
|
|
1801
1808
|
// src/index.ts
|
|
1802
|
-
var SIFA_SDK_VERSION = "0.9.
|
|
1809
|
+
var SIFA_SDK_VERSION = "0.9.6";
|
|
1803
1810
|
|
|
1804
1811
|
exports.ACTIVITY_TIERS = ACTIVITY_TIERS;
|
|
1805
1812
|
exports.APP_URL_PATTERNS = APP_URL_PATTERNS;
|