@singi-labs/sifa-sdk 0.19.82 → 0.19.84

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
@@ -5112,6 +5112,26 @@ function withGeneric(vm) {
5112
5112
  vm.body = { kind: "generic" };
5113
5113
  return vm;
5114
5114
  }
5115
+ function applyBirdSighting(vm, item, record) {
5116
+ const species = asNonEmptyString(record.species);
5117
+ const count = typeof record.count === "number" && record.count > 1 ? record.count : void 0;
5118
+ const title = species ? count ? `${count} \xD7 ${species}` : species : void 0;
5119
+ const notes = asNonEmptyString(record.notes);
5120
+ const text = title && notes ? `${title}. ${notes}` : title ?? notes;
5121
+ const did = didFromUri(item.uri);
5122
+ if (did && Array.isArray(record.media)) {
5123
+ const media = record.media.map((entry) => blobMedia(asRecord(entry)?.blob, did, title ?? "Bird sighting")).filter((m) => m !== void 0);
5124
+ if (media.length > 0) vm.media = media;
5125
+ }
5126
+ if (text) {
5127
+ vm.body = { kind: "text", text };
5128
+ } else if (vm.media) {
5129
+ vm.body = { kind: "media" };
5130
+ } else {
5131
+ return withGeneric(vm);
5132
+ }
5133
+ return vm;
5134
+ }
5115
5135
  function applyFediversePost(vm, record) {
5116
5136
  const url = httpUrl(record.url);
5117
5137
  if (url) vm.sourceUrl = url;
@@ -5623,6 +5643,8 @@ function toStreamCardVM(item, options = {}) {
5623
5643
  return record ? applyAsqAnswer(vm, record) : withGeneric(vm);
5624
5644
  case "fediverse.post":
5625
5645
  return record ? applyFediversePost(vm, record) : withGeneric(vm);
5646
+ case "place.birds.sighting":
5647
+ return record ? applyBirdSighting(vm, item, record) : withGeneric(vm);
5626
5648
  }
5627
5649
  if (record && item.collection.startsWith("social.popfeed.feed.")) {
5628
5650
  return applyMediaReview(vm, item, record);
@@ -7357,7 +7379,7 @@ function describeSifaRecord(collection, value) {
7357
7379
  }
7358
7380
 
7359
7381
  // src/index.ts
7360
- var SIFA_SDK_VERSION = "0.19.82";
7382
+ var SIFA_SDK_VERSION = "0.19.84";
7361
7383
 
7362
7384
  exports.ACTIVITY_TIERS = ACTIVITY_TIERS;
7363
7385
  exports.ACTIVITY_VERBS = ACTIVITY_VERBS;