@singi-labs/sifa-sdk 0.12.13 → 0.12.15
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 +29 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -1
- package/dist/index.d.ts +16 -1
- package/dist/index.js +29 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2747,8 +2747,8 @@ function getPublisherFromSiteUrl(siteUrl) {
|
|
|
2747
2747
|
// src/stream/verbs.json
|
|
2748
2748
|
var verbs_default = {
|
|
2749
2749
|
$schema: "https://sifa.id/schemas/activity-verbs/v1.json",
|
|
2750
|
-
version: "1.
|
|
2751
|
-
updated: "2026-07-
|
|
2750
|
+
version: "1.1.0",
|
|
2751
|
+
updated: "2026-07-19",
|
|
2752
2752
|
defaultVerb: "created",
|
|
2753
2753
|
verbs: {
|
|
2754
2754
|
"app.bsky.feed.post": "posted",
|
|
@@ -2756,6 +2756,8 @@ var verbs_default = {
|
|
|
2756
2756
|
"social.psky.feed.post": "posted",
|
|
2757
2757
|
"social.popfeed.feed.post": "posted",
|
|
2758
2758
|
"social.popfeed.feed.note": "posted",
|
|
2759
|
+
"social.popfeed.feed.review": "reviewed",
|
|
2760
|
+
"buzz.bookhive.book": "reviewed",
|
|
2759
2761
|
"fyi.unravel.frontpage.post": "posted",
|
|
2760
2762
|
"forum.barazo.post": "posted",
|
|
2761
2763
|
"app.bsky.feed.repost": "reposted",
|
|
@@ -2790,6 +2792,7 @@ var STREAM_VERBS = [
|
|
|
2790
2792
|
"endorsed",
|
|
2791
2793
|
"joined",
|
|
2792
2794
|
"shipped",
|
|
2795
|
+
"reviewed",
|
|
2793
2796
|
"created"
|
|
2794
2797
|
];
|
|
2795
2798
|
var streamVerbSchema = zod.z.enum(STREAM_VERBS);
|
|
@@ -3008,6 +3011,7 @@ var streamCardVMSchema = zod.z.lazy(
|
|
|
3008
3011
|
tier: zod.z.enum(["creation", "action", "filtered"]),
|
|
3009
3012
|
timestamp: zod.z.string(),
|
|
3010
3013
|
title: zod.z.string(),
|
|
3014
|
+
sourceUrl: zod.z.string().optional(),
|
|
3011
3015
|
body: streamCardBodySchema.optional(),
|
|
3012
3016
|
media: zod.z.array(streamMediaSchema).optional(),
|
|
3013
3017
|
externalLink: streamExternalLinkSchema.optional(),
|
|
@@ -3170,18 +3174,33 @@ function buildSource(item, options) {
|
|
|
3170
3174
|
};
|
|
3171
3175
|
}
|
|
3172
3176
|
var TITLE_BY_VERB = {
|
|
3173
|
-
posted: (
|
|
3174
|
-
reposted: () => "Reposted
|
|
3177
|
+
posted: () => "Posted",
|
|
3178
|
+
reposted: () => "Reposted",
|
|
3175
3179
|
published: (label) => `Published on ${label}`,
|
|
3176
3180
|
presented: () => "Gave a presentation",
|
|
3177
3181
|
endorsed: () => "Wrote an endorsement",
|
|
3178
3182
|
joined: (label) => `Joined ${label}`,
|
|
3179
3183
|
shipped: (label) => `Shipped on ${label}`,
|
|
3180
|
-
|
|
3184
|
+
reviewed: (label) => `Reviewed on ${label}`,
|
|
3185
|
+
created: (label) => `Shared on ${label}`
|
|
3181
3186
|
};
|
|
3182
3187
|
function buildTitle(verb, label) {
|
|
3183
3188
|
return TITLE_BY_VERB[verb](label);
|
|
3184
3189
|
}
|
|
3190
|
+
function resolveSourceUrl(item, record) {
|
|
3191
|
+
const authorDid = didFromUri(item.uri);
|
|
3192
|
+
if (!authorDid) return void 0;
|
|
3193
|
+
const authorHandle = asNonEmptyString(item.authorHandle) ?? asNonEmptyString(record.handle);
|
|
3194
|
+
const url = resolveCardUrl({
|
|
3195
|
+
collection: item.collection,
|
|
3196
|
+
record,
|
|
3197
|
+
uri: item.uri,
|
|
3198
|
+
rkey: item.rkey,
|
|
3199
|
+
authorDid,
|
|
3200
|
+
...authorHandle ? { authorHandle } : {}
|
|
3201
|
+
});
|
|
3202
|
+
return url && /^https?:\/\//i.test(url) ? url : void 0;
|
|
3203
|
+
}
|
|
3185
3204
|
function readTheme(record) {
|
|
3186
3205
|
const theme = asRecord(record?.publicationTheme ?? record?.theme);
|
|
3187
3206
|
if (!theme) return void 0;
|
|
@@ -3679,6 +3698,10 @@ function toStreamCardVM(item, options = {}) {
|
|
|
3679
3698
|
};
|
|
3680
3699
|
const theme = readTheme(record);
|
|
3681
3700
|
if (theme) vm.theme = theme;
|
|
3701
|
+
if (record) {
|
|
3702
|
+
const sourceUrl = resolveSourceUrl(item, record);
|
|
3703
|
+
if (sourceUrl) vm.sourceUrl = sourceUrl;
|
|
3704
|
+
}
|
|
3682
3705
|
if (item.subject) {
|
|
3683
3706
|
vm.subject = { kind: "post", post: toStreamCardVM(item.subject, options) };
|
|
3684
3707
|
}
|
|
@@ -4540,7 +4563,7 @@ var ProfileVolunteeringRecordSchema = zod.z.object({
|
|
|
4540
4563
|
});
|
|
4541
4564
|
|
|
4542
4565
|
// src/index.ts
|
|
4543
|
-
var SIFA_SDK_VERSION = "0.12.
|
|
4566
|
+
var SIFA_SDK_VERSION = "0.12.15";
|
|
4544
4567
|
|
|
4545
4568
|
exports.ACTIVITY_TIERS = ACTIVITY_TIERS;
|
|
4546
4569
|
exports.ACTIVITY_VERBS = ACTIVITY_VERBS;
|