@singi-labs/sifa-sdk 0.19.12 → 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 +94 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -6
- package/dist/index.d.ts +18 -6
- package/dist/index.js +94 -25
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2108,6 +2108,28 @@ function getActivityTaxonomyVersion() {
|
|
|
2108
2108
|
return { version: ACTIVITY_TIERS.version, updated: ACTIVITY_TIERS.updated };
|
|
2109
2109
|
}
|
|
2110
2110
|
|
|
2111
|
+
// src/taxonomy/relational.ts
|
|
2112
|
+
var RELATIONAL_SEGMENTS = /* @__PURE__ */ new Set([
|
|
2113
|
+
"comment",
|
|
2114
|
+
"reply",
|
|
2115
|
+
"like",
|
|
2116
|
+
"repost",
|
|
2117
|
+
"follow",
|
|
2118
|
+
"connection",
|
|
2119
|
+
"rsvp",
|
|
2120
|
+
"endorse",
|
|
2121
|
+
"endorsement",
|
|
2122
|
+
"bookmark",
|
|
2123
|
+
"member",
|
|
2124
|
+
"membership",
|
|
2125
|
+
"vouch"
|
|
2126
|
+
]);
|
|
2127
|
+
function isRelationalActivity(nsid) {
|
|
2128
|
+
if (!nsid || !nsid.includes(".")) return false;
|
|
2129
|
+
const segment = nsid.slice(nsid.lastIndexOf(".") + 1);
|
|
2130
|
+
return RELATIONAL_SEGMENTS.has(segment);
|
|
2131
|
+
}
|
|
2132
|
+
|
|
2111
2133
|
// src/taxonomy/presentation-role.ts
|
|
2112
2134
|
var PRESENTATION_ROLE_OPTIONS = [
|
|
2113
2135
|
{ value: "id.sifa.defs#presenter", label: "Presenter" },
|
|
@@ -3992,37 +4014,48 @@ function getPublisherFromSiteUrl(siteUrl) {
|
|
|
3992
4014
|
// src/stream/verbs.json
|
|
3993
4015
|
var verbs_default = {
|
|
3994
4016
|
$schema: "https://sifa.id/schemas/activity-verbs/v1.json",
|
|
3995
|
-
version: "1.
|
|
3996
|
-
updated: "2026-
|
|
4017
|
+
version: "1.2.0",
|
|
4018
|
+
updated: "2026-09-18",
|
|
3997
4019
|
defaultVerb: "created",
|
|
3998
4020
|
verbs: {
|
|
4021
|
+
"agency.portable.membership": "joined",
|
|
4022
|
+
"app.atmobb.discussion.reply": "replied",
|
|
3999
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",
|
|
4000
4030
|
"blue.flashes.feed.post": "posted",
|
|
4001
|
-
"social.psky.feed.post": "posted",
|
|
4002
|
-
"social.popfeed.feed.post": "posted",
|
|
4003
|
-
"social.popfeed.feed.note": "posted",
|
|
4004
|
-
"social.popfeed.feed.review": "reviewed",
|
|
4005
4031
|
"buzz.bookhive.book": "reviewed",
|
|
4006
|
-
"fyi.unravel.frontpage.post": "posted",
|
|
4007
|
-
"forum.barazo.post": "posted",
|
|
4008
|
-
"app.bsky.feed.repost": "reposted",
|
|
4009
4032
|
"com.whtwnd.blog.entry": "published",
|
|
4010
|
-
"
|
|
4033
|
+
"community.lexicon.calendar.rsvp": "rsvped",
|
|
4034
|
+
"community.nooki.comments": "commented",
|
|
4035
|
+
"community.nooki.membership": "joined",
|
|
4036
|
+
"community.opensocial.membership": "joined",
|
|
4011
4037
|
"computer.aetheros.page": "published",
|
|
4012
|
-
"
|
|
4013
|
-
"
|
|
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",
|
|
4014
4044
|
"id.sifa.profile.presentation": "presented",
|
|
4015
4045
|
"id.sifa.profile.presentationDelivery": "presented",
|
|
4016
|
-
"
|
|
4046
|
+
"link.pastesphere.snippet": "published",
|
|
4047
|
+
"org.impactindexer.review.comment": "commented",
|
|
4048
|
+
"pub.leaflet.comment": "commented",
|
|
4017
4049
|
"sh.tangled.repo": "shipped",
|
|
4018
4050
|
"sh.tangled.repo.issue": "shipped",
|
|
4019
4051
|
"sh.tangled.repo.pull": "shipped",
|
|
4020
|
-
"
|
|
4021
|
-
"app.sidetrail.walk": "shipped",
|
|
4052
|
+
"site.standard.document": "published",
|
|
4022
4053
|
"social.colibri.membership": "joined",
|
|
4023
|
-
"
|
|
4024
|
-
"
|
|
4025
|
-
"
|
|
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"
|
|
4026
4059
|
}
|
|
4027
4060
|
};
|
|
4028
4061
|
|
|
@@ -4036,7 +4069,16 @@ var STREAM_VERBS = [
|
|
|
4036
4069
|
"joined",
|
|
4037
4070
|
"shipped",
|
|
4038
4071
|
"reviewed",
|
|
4039
|
-
"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"
|
|
4040
4082
|
];
|
|
4041
4083
|
var streamVerbSchema = zod.z.enum(STREAM_VERBS);
|
|
4042
4084
|
var verbMapSchema = zod.z.object({
|
|
@@ -4485,10 +4527,33 @@ var TITLE_BY_VERB = {
|
|
|
4485
4527
|
joined: (label) => `Joined ${label}`,
|
|
4486
4528
|
shipped: (label) => `Shipped on ${label}`,
|
|
4487
4529
|
reviewed: (label) => `Reviewed on ${label}`,
|
|
4488
|
-
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"
|
|
4489
4537
|
};
|
|
4490
|
-
function buildTitle(verb, label) {
|
|
4491
|
-
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;
|
|
4492
4557
|
}
|
|
4493
4558
|
function resolveSourceUrl(item, record) {
|
|
4494
4559
|
const authorDid = didFromUri(item.uri);
|
|
@@ -5016,7 +5081,7 @@ function toStreamCardVM(item, options = {}) {
|
|
|
5016
5081
|
source,
|
|
5017
5082
|
tier: getActivityTier(item.collection),
|
|
5018
5083
|
timestamp,
|
|
5019
|
-
title: buildTitle(verb, source.label)
|
|
5084
|
+
title: buildTitle(verb, source.label, recordHasSubjectRef(record))
|
|
5020
5085
|
};
|
|
5021
5086
|
const author = buildAuthor(item);
|
|
5022
5087
|
if (author) vm.author = author;
|
|
@@ -5075,6 +5140,9 @@ function toStreamCardVMs(items, options = {}) {
|
|
|
5075
5140
|
}
|
|
5076
5141
|
|
|
5077
5142
|
// src/stream/two-tier.ts
|
|
5143
|
+
function collectionOf(uri) {
|
|
5144
|
+
return uri.split("/")[3] ?? "";
|
|
5145
|
+
}
|
|
5078
5146
|
var RICH_BODY_KINDS = /* @__PURE__ */ new Set([
|
|
5079
5147
|
"github-pr",
|
|
5080
5148
|
"book",
|
|
@@ -5089,6 +5157,7 @@ function isRich(vm) {
|
|
|
5089
5157
|
return false;
|
|
5090
5158
|
}
|
|
5091
5159
|
function isSelfAuthoredRich(vm) {
|
|
5160
|
+
if (isRelationalActivity(collectionOf(vm.uri))) return false;
|
|
5092
5161
|
return vm.tier === "creation" && isRich(vm);
|
|
5093
5162
|
}
|
|
5094
5163
|
function renderAsLine(vm) {
|
|
@@ -6499,7 +6568,7 @@ function describeSifaRecord(collection, value) {
|
|
|
6499
6568
|
}
|
|
6500
6569
|
|
|
6501
6570
|
// src/index.ts
|
|
6502
|
-
var SIFA_SDK_VERSION = "0.19.
|
|
6571
|
+
var SIFA_SDK_VERSION = "0.19.14";
|
|
6503
6572
|
|
|
6504
6573
|
exports.ACTIVITY_TIERS = ACTIVITY_TIERS;
|
|
6505
6574
|
exports.ACTIVITY_VERBS = ACTIVITY_VERBS;
|
|
@@ -6707,6 +6776,7 @@ exports.isLinked = isLinked;
|
|
|
6707
6776
|
exports.isOnBehalfOfApplicable = isOnBehalfOfApplicable;
|
|
6708
6777
|
exports.isPseudoEmployer = isPseudoEmployer;
|
|
6709
6778
|
exports.isRegistrableDomainHandle = isRegistrableDomainHandle;
|
|
6779
|
+
exports.isRelationalActivity = isRelationalActivity;
|
|
6710
6780
|
exports.isRoleLineRedundant = isRoleLineRedundant;
|
|
6711
6781
|
exports.isSectionPopulated = isSectionPopulated;
|
|
6712
6782
|
exports.isSelfAuthoredRich = isSelfAuthoredRich;
|