@singi-labs/sifa-sdk 0.19.14 → 0.19.16

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
@@ -4290,7 +4290,8 @@ var streamCardSubjectSchema = zod.z.discriminatedUnion("kind", [
4290
4290
  zod.z.object({
4291
4291
  kind: zod.z.literal("record"),
4292
4292
  uri: zod.z.string(),
4293
- title: zod.z.string().optional()
4293
+ title: zod.z.string().optional(),
4294
+ url: zod.z.string().optional()
4294
4295
  })
4295
4296
  ]);
4296
4297
  var hypercertDetailsSchema = zod.z.object({
@@ -4521,13 +4522,13 @@ function buildAuthor(item) {
4521
4522
  var TITLE_BY_VERB = {
4522
4523
  posted: () => "Posted",
4523
4524
  reposted: () => "Reposted",
4524
- published: (label) => `Published on ${label}`,
4525
+ published: () => "Published",
4525
4526
  presented: () => "Gave a presentation",
4526
4527
  endorsed: () => "Wrote an endorsement",
4527
- joined: (label) => `Joined ${label}`,
4528
- shipped: (label) => `Shipped on ${label}`,
4529
- reviewed: (label) => `Reviewed on ${label}`,
4530
- created: (label) => `Shared on ${label}`,
4528
+ joined: () => "Joined",
4529
+ shipped: () => "Shipped",
4530
+ reviewed: () => "Reviewed",
4531
+ created: () => "Shared",
4531
4532
  commented: (_label, hasSubject) => hasSubject ? "Commented on" : "Commented",
4532
4533
  replied: (_label, hasSubject) => hasSubject ? "Replied to" : "Replied",
4533
4534
  rsvped: (_label, hasSubject) => hasSubject ? "RSVP'd to" : "RSVP'd",
@@ -4766,6 +4767,14 @@ function applyEventRsvp(vm, record) {
4766
4767
  if (locationCountry) body.locationCountry = locationCountry;
4767
4768
  }
4768
4769
  vm.body = body;
4770
+ const eventUri = nonBlankString(asRecord(record.subject)?.uri);
4771
+ if (eventUri) {
4772
+ vm.subject = {
4773
+ kind: "record",
4774
+ uri: eventUri,
4775
+ ...body.eventName ? { title: body.eventName } : {}
4776
+ };
4777
+ }
4769
4778
  return vm;
4770
4779
  }
4771
4780
  function applyKeytraceVerification(vm, record) {
@@ -4974,8 +4983,16 @@ function genericSubject(record) {
4974
4983
  }
4975
4984
  const uri = nonBlankString(asRecord(subject)?.uri);
4976
4985
  if (uri && uri.startsWith("at://")) return { kind: "record", uri };
4986
+ const parentUri = nonBlankString(asRecord(asRecord(record.reply)?.parent)?.uri);
4987
+ if (parentUri && parentUri.startsWith("at://")) return { kind: "record", uri: parentUri };
4977
4988
  return void 0;
4978
4989
  }
4990
+ function withResolvedSubjectMeta(subject, item) {
4991
+ if (subject.kind !== "record") return subject;
4992
+ const title = nonBlankString(item.subjectTitle) ?? subject.title;
4993
+ const url = nonBlankString(item.subjectUrl);
4994
+ return { ...subject, ...title ? { title } : {}, ...url ? { url } : {} };
4995
+ }
4979
4996
  function parseFacetFeature(features) {
4980
4997
  for (const raw of features) {
4981
4998
  const feat = asRecord(raw);
@@ -5048,7 +5065,7 @@ function applyGeneric(vm, item, record) {
5048
5065
  if (externalLink) vm.externalLink = externalLink;
5049
5066
  if (!vm.subject) {
5050
5067
  const subject = genericSubject(record);
5051
- if (subject) vm.subject = subject;
5068
+ if (subject) vm.subject = withResolvedSubjectMeta(subject, item);
5052
5069
  }
5053
5070
  let body;
5054
5071
  if (text) {
@@ -6568,7 +6585,7 @@ function describeSifaRecord(collection, value) {
6568
6585
  }
6569
6586
 
6570
6587
  // src/index.ts
6571
- var SIFA_SDK_VERSION = "0.19.14";
6588
+ var SIFA_SDK_VERSION = "0.19.16";
6572
6589
 
6573
6590
  exports.ACTIVITY_TIERS = ACTIVITY_TIERS;
6574
6591
  exports.ACTIVITY_VERBS = ACTIVITY_VERBS;