@singi-labs/sifa-sdk 0.19.13 → 0.19.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 +67 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -5
- package/dist/index.d.ts +11 -5
- package/dist/index.js +67 -24
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4014,37 +4014,48 @@ function getPublisherFromSiteUrl(siteUrl) {
|
|
|
4014
4014
|
// src/stream/verbs.json
|
|
4015
4015
|
var verbs_default = {
|
|
4016
4016
|
$schema: "https://sifa.id/schemas/activity-verbs/v1.json",
|
|
4017
|
-
version: "1.
|
|
4018
|
-
updated: "2026-
|
|
4017
|
+
version: "1.2.0",
|
|
4018
|
+
updated: "2026-09-18",
|
|
4019
4019
|
defaultVerb: "created",
|
|
4020
4020
|
verbs: {
|
|
4021
|
+
"agency.portable.membership": "joined",
|
|
4022
|
+
"app.atmobb.discussion.reply": "replied",
|
|
4021
4023
|
"app.bsky.feed.post": "posted",
|
|
4024
|
+
"app.bsky.feed.repost": "reposted",
|
|
4025
|
+
"app.sidetrail.trail": "shipped",
|
|
4026
|
+
"app.sidetrail.walk": "shipped",
|
|
4027
|
+
"app.userinput.reply": "replied",
|
|
4028
|
+
"at.margin.bookmark": "bookmarked",
|
|
4029
|
+
"at.youandme.connection": "followed",
|
|
4022
4030
|
"blue.flashes.feed.post": "posted",
|
|
4023
|
-
"social.psky.feed.post": "posted",
|
|
4024
|
-
"social.popfeed.feed.post": "posted",
|
|
4025
|
-
"social.popfeed.feed.note": "posted",
|
|
4026
|
-
"social.popfeed.feed.review": "reviewed",
|
|
4027
4031
|
"buzz.bookhive.book": "reviewed",
|
|
4028
|
-
"fyi.unravel.frontpage.post": "posted",
|
|
4029
|
-
"forum.barazo.post": "posted",
|
|
4030
|
-
"app.bsky.feed.repost": "reposted",
|
|
4031
4032
|
"com.whtwnd.blog.entry": "published",
|
|
4032
|
-
"
|
|
4033
|
+
"community.lexicon.calendar.rsvp": "rsvped",
|
|
4034
|
+
"community.nooki.comments": "commented",
|
|
4035
|
+
"community.nooki.membership": "joined",
|
|
4036
|
+
"community.opensocial.membership": "joined",
|
|
4033
4037
|
"computer.aetheros.page": "published",
|
|
4034
|
-
"
|
|
4035
|
-
"
|
|
4038
|
+
"eu.atcommons.member": "joined",
|
|
4039
|
+
"fm.plyr.comment": "commented",
|
|
4040
|
+
"forum.barazo.post": "posted",
|
|
4041
|
+
"fyi.unravel.frontpage.post": "posted",
|
|
4042
|
+
"id.sifa.endorsement": "endorsed",
|
|
4043
|
+
"id.sifa.graph.connection": "joined",
|
|
4036
4044
|
"id.sifa.profile.presentation": "presented",
|
|
4037
4045
|
"id.sifa.profile.presentationDelivery": "presented",
|
|
4038
|
-
"
|
|
4046
|
+
"link.pastesphere.snippet": "published",
|
|
4047
|
+
"org.impactindexer.review.comment": "commented",
|
|
4048
|
+
"pub.leaflet.comment": "commented",
|
|
4039
4049
|
"sh.tangled.repo": "shipped",
|
|
4040
4050
|
"sh.tangled.repo.issue": "shipped",
|
|
4041
4051
|
"sh.tangled.repo.pull": "shipped",
|
|
4042
|
-
"
|
|
4043
|
-
"app.sidetrail.walk": "shipped",
|
|
4052
|
+
"site.standard.document": "published",
|
|
4044
4053
|
"social.colibri.membership": "joined",
|
|
4045
|
-
"
|
|
4046
|
-
"
|
|
4047
|
-
"
|
|
4054
|
+
"social.kut.community.membership": "joined",
|
|
4055
|
+
"social.popfeed.feed.note": "posted",
|
|
4056
|
+
"social.popfeed.feed.post": "posted",
|
|
4057
|
+
"social.popfeed.feed.review": "reviewed",
|
|
4058
|
+
"social.psky.feed.post": "posted"
|
|
4048
4059
|
}
|
|
4049
4060
|
};
|
|
4050
4061
|
|
|
@@ -4058,7 +4069,16 @@ var STREAM_VERBS = [
|
|
|
4058
4069
|
"joined",
|
|
4059
4070
|
"shipped",
|
|
4060
4071
|
"reviewed",
|
|
4061
|
-
"created"
|
|
4072
|
+
"created",
|
|
4073
|
+
// Relational verbs: a reaction or reference to someone else's thing. These
|
|
4074
|
+
// read with the subject the two-tier line renders after them ("Commented on
|
|
4075
|
+
// {doc}", "Followed {person}").
|
|
4076
|
+
"commented",
|
|
4077
|
+
"replied",
|
|
4078
|
+
"rsvped",
|
|
4079
|
+
"liked",
|
|
4080
|
+
"followed",
|
|
4081
|
+
"bookmarked"
|
|
4062
4082
|
];
|
|
4063
4083
|
var streamVerbSchema = zod.z.enum(STREAM_VERBS);
|
|
4064
4084
|
var verbMapSchema = zod.z.object({
|
|
@@ -4507,10 +4527,33 @@ var TITLE_BY_VERB = {
|
|
|
4507
4527
|
joined: (label) => `Joined ${label}`,
|
|
4508
4528
|
shipped: (label) => `Shipped on ${label}`,
|
|
4509
4529
|
reviewed: (label) => `Reviewed on ${label}`,
|
|
4510
|
-
created: (label) => `Shared on ${label}
|
|
4530
|
+
created: (label) => `Shared on ${label}`,
|
|
4531
|
+
commented: (_label, hasSubject) => hasSubject ? "Commented on" : "Commented",
|
|
4532
|
+
replied: (_label, hasSubject) => hasSubject ? "Replied to" : "Replied",
|
|
4533
|
+
rsvped: (_label, hasSubject) => hasSubject ? "RSVP'd to" : "RSVP'd",
|
|
4534
|
+
liked: () => "Liked",
|
|
4535
|
+
followed: () => "Followed",
|
|
4536
|
+
bookmarked: () => "Bookmarked"
|
|
4511
4537
|
};
|
|
4512
|
-
function buildTitle(verb, label) {
|
|
4513
|
-
return TITLE_BY_VERB[verb](label);
|
|
4538
|
+
function buildTitle(verb, label, hasSubject) {
|
|
4539
|
+
return TITLE_BY_VERB[verb](label, hasSubject);
|
|
4540
|
+
}
|
|
4541
|
+
function recordHasSubjectRef(record) {
|
|
4542
|
+
if (!record) return false;
|
|
4543
|
+
const subject = record.subject;
|
|
4544
|
+
if (typeof subject === "string" && subject.startsWith("at://")) return true;
|
|
4545
|
+
if (subject && typeof subject === "object") {
|
|
4546
|
+
const uri = subject.uri;
|
|
4547
|
+
if (typeof uri === "string" && uri.length > 0) return true;
|
|
4548
|
+
}
|
|
4549
|
+
const reply = record.reply;
|
|
4550
|
+
if (reply && typeof reply === "object") {
|
|
4551
|
+
for (const key of ["parent", "root"]) {
|
|
4552
|
+
const ref = reply[key];
|
|
4553
|
+
if (ref && typeof ref === "object" && typeof ref.uri === "string") return true;
|
|
4554
|
+
}
|
|
4555
|
+
}
|
|
4556
|
+
return false;
|
|
4514
4557
|
}
|
|
4515
4558
|
function resolveSourceUrl(item, record) {
|
|
4516
4559
|
const authorDid = didFromUri(item.uri);
|
|
@@ -5038,7 +5081,7 @@ function toStreamCardVM(item, options = {}) {
|
|
|
5038
5081
|
source,
|
|
5039
5082
|
tier: getActivityTier(item.collection),
|
|
5040
5083
|
timestamp,
|
|
5041
|
-
title: buildTitle(verb, source.label)
|
|
5084
|
+
title: buildTitle(verb, source.label, recordHasSubjectRef(record))
|
|
5042
5085
|
};
|
|
5043
5086
|
const author = buildAuthor(item);
|
|
5044
5087
|
if (author) vm.author = author;
|
|
@@ -6525,7 +6568,7 @@ function describeSifaRecord(collection, value) {
|
|
|
6525
6568
|
}
|
|
6526
6569
|
|
|
6527
6570
|
// src/index.ts
|
|
6528
|
-
var SIFA_SDK_VERSION = "0.19.
|
|
6571
|
+
var SIFA_SDK_VERSION = "0.19.14";
|
|
6529
6572
|
|
|
6530
6573
|
exports.ACTIVITY_TIERS = ACTIVITY_TIERS;
|
|
6531
6574
|
exports.ACTIVITY_VERBS = ACTIVITY_VERBS;
|