@singi-labs/sifa-sdk 0.11.5 → 0.11.6

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.
@@ -406,4 +406,4 @@ declare function hasAdultContent(item: {
406
406
  labels?: ActivityLabel[];
407
407
  }): boolean;
408
408
 
409
- export { type AdultContentLabel as A, hasAdultContent as B, type ExternalAccount as E, type FeedItem as F, type LocationValue as L, type ProfileSkill as P, type SkillSuggestion as S, type TrustStat as T, type VerifiedAccount as V, type ActivityLabel as a, type PdsProviderInfo as b, type Profile as c, ADULT_CONTENT_LABELS as d, type ActiveApp as e, type Endorsement as f, type EndorsementData as g, type ExternalAccountKeytraceClaim as h, type LanguageProficiency as i, type PresentationLinkView as j, type ProfileCertification as k, type ProfileCourse as l, type ProfileEducation as m, type ProfileHonor as n, type ProfileIndustry as o, type ProfileLanguage as p, type ProfileLocation as q, type ProfileOverrideSource as r, type ProfilePosition as s, type ProfilePresentation as t, type ProfilePresentationDelivery as u, type ProfileProject as v, type ProfilePublication as w, type ProfileVolunteering as x, type PublicationContributor as y, type SkillRef as z };
409
+ export { type AdultContentLabel as A, hasAdultContent as B, type ExternalAccount as E, type FeedItem as F, type LocationValue as L, type ProfileSkill as P, type SkillSuggestion as S, type TrustStat as T, type VerifiedAccount as V, type ActivityLabel as a, type ProfilePresentationDelivery as b, type PdsProviderInfo as c, type Profile as d, ADULT_CONTENT_LABELS as e, type ActiveApp as f, type Endorsement as g, type EndorsementData as h, type ExternalAccountKeytraceClaim as i, type LanguageProficiency as j, type PresentationLinkView as k, type ProfileCertification as l, type ProfileCourse as m, type ProfileEducation as n, type ProfileHonor as o, type ProfileIndustry as p, type ProfileLanguage as q, type ProfileLocation as r, type ProfileOverrideSource as s, type ProfilePosition as t, type ProfilePresentation as u, type ProfileProject as v, type ProfilePublication as w, type ProfileVolunteering as x, type PublicationContributor as y, type SkillRef as z };
@@ -406,4 +406,4 @@ declare function hasAdultContent(item: {
406
406
  labels?: ActivityLabel[];
407
407
  }): boolean;
408
408
 
409
- export { type AdultContentLabel as A, hasAdultContent as B, type ExternalAccount as E, type FeedItem as F, type LocationValue as L, type ProfileSkill as P, type SkillSuggestion as S, type TrustStat as T, type VerifiedAccount as V, type ActivityLabel as a, type PdsProviderInfo as b, type Profile as c, ADULT_CONTENT_LABELS as d, type ActiveApp as e, type Endorsement as f, type EndorsementData as g, type ExternalAccountKeytraceClaim as h, type LanguageProficiency as i, type PresentationLinkView as j, type ProfileCertification as k, type ProfileCourse as l, type ProfileEducation as m, type ProfileHonor as n, type ProfileIndustry as o, type ProfileLanguage as p, type ProfileLocation as q, type ProfileOverrideSource as r, type ProfilePosition as s, type ProfilePresentation as t, type ProfilePresentationDelivery as u, type ProfileProject as v, type ProfilePublication as w, type ProfileVolunteering as x, type PublicationContributor as y, type SkillRef as z };
409
+ export { type AdultContentLabel as A, hasAdultContent as B, type ExternalAccount as E, type FeedItem as F, type LocationValue as L, type ProfileSkill as P, type SkillSuggestion as S, type TrustStat as T, type VerifiedAccount as V, type ActivityLabel as a, type ProfilePresentationDelivery as b, type PdsProviderInfo as c, type Profile as d, ADULT_CONTENT_LABELS as e, type ActiveApp as f, type Endorsement as g, type EndorsementData as h, type ExternalAccountKeytraceClaim as i, type LanguageProficiency as j, type PresentationLinkView as k, type ProfileCertification as l, type ProfileCourse as m, type ProfileEducation as n, type ProfileHonor as o, type ProfileIndustry as p, type ProfileLanguage as q, type ProfileLocation as r, type ProfileOverrideSource as s, type ProfilePosition as t, type ProfilePresentation as u, type ProfileProject as v, type ProfilePublication as w, type ProfileVolunteering as x, type PublicationContributor as y, type SkillRef as z };
package/dist/index.cjs CHANGED
@@ -1414,6 +1414,40 @@ function formatPresentationDuration(duration) {
1414
1414
  return `${minMinutes} min`;
1415
1415
  }
1416
1416
 
1417
+ // src/format/summarize-deliveries.ts
1418
+ var CANCELLED_STATUS = "community.lexicon.calendar.event#cancelled";
1419
+ var KEYNOTE_ROLE = "id.sifa.defs#keynote";
1420
+ function summarizePresentationDeliveries(deliveries, options = {}) {
1421
+ const venueLimit = options.venueLimit ?? 3;
1422
+ const counted = (deliveries ?? []).filter((delivery) => delivery.status !== CANCELLED_STATUS);
1423
+ const sorted = [...counted].sort((a, b) => (b.date ?? "").localeCompare(a.date ?? ""));
1424
+ let recentYear;
1425
+ for (const delivery of counted) {
1426
+ if (!delivery.date) continue;
1427
+ const year = Number(delivery.date.slice(0, 4));
1428
+ if (!Number.isNaN(year) && (recentYear === void 0 || year > recentYear)) {
1429
+ recentYear = year;
1430
+ }
1431
+ }
1432
+ const seen = /* @__PURE__ */ new Set();
1433
+ const distinctVenues = [];
1434
+ for (const delivery of sorted) {
1435
+ const name = delivery.eventName?.trim();
1436
+ if (name && !seen.has(name)) {
1437
+ seen.add(name);
1438
+ distinctVenues.push(name);
1439
+ }
1440
+ }
1441
+ const venues = distinctVenues.slice(0, venueLimit);
1442
+ return {
1443
+ count: counted.length,
1444
+ recentYear,
1445
+ keynoteCount: counted.filter((delivery) => delivery.role === KEYNOTE_ROLE).length,
1446
+ venues,
1447
+ moreVenues: distinctVenues.length - venues.length
1448
+ };
1449
+ }
1450
+
1417
1451
  // src/format/sort-by-date.ts
1418
1452
  var FAR_FUTURE = "9999-12-31";
1419
1453
  var FAR_PAST = "0000-01-01";
@@ -2550,7 +2584,7 @@ var ProfileVolunteeringRecordSchema = zod.z.object({
2550
2584
  });
2551
2585
 
2552
2586
  // src/index.ts
2553
- var SIFA_SDK_VERSION = "0.11.5";
2587
+ var SIFA_SDK_VERSION = "0.11.6";
2554
2588
 
2555
2589
  exports.ACTIVITY_TIERS = ACTIVITY_TIERS;
2556
2590
  exports.ACTIVITY_VISIBILITY_RULES = ACTIVITY_VISIBILITY_RULES;
@@ -2705,6 +2739,7 @@ exports.singleDateExtractor = singleDateExtractor;
2705
2739
  exports.sortByDateDesc = sortByDateDesc;
2706
2740
  exports.stripHtmlToText = stripHtmlToText;
2707
2741
  exports.strongRefSchema = strongRefSchema;
2742
+ exports.summarizePresentationDeliveries = summarizePresentationDeliveries;
2708
2743
  exports.truncateGraphemes = truncateGraphemes;
2709
2744
  exports.uriSchema = uriSchema;
2710
2745
  //# sourceMappingURL=index.cjs.map