@singi-labs/sifa-sdk 0.19.10 → 0.19.12
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 +57 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -1
- package/dist/index.d.ts +40 -1
- package/dist/index.js +54 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2618,6 +2618,37 @@ function normalizeDoi(value) {
|
|
|
2618
2618
|
return value.trim().replace(/^https?:\/\/(dx\.)?doi\.org\//i, "").replace(/^doi:\s*/i, "");
|
|
2619
2619
|
}
|
|
2620
2620
|
|
|
2621
|
+
// src/format/endorsement-context.ts
|
|
2622
|
+
var RELATIONSHIP_PREFIX = /^\[(\w+?)(?:: ([^\]]+))?\]\s*/;
|
|
2623
|
+
function formatRelationship(type, detail) {
|
|
2624
|
+
const trimmed = detail?.trim() || void 0;
|
|
2625
|
+
switch (type) {
|
|
2626
|
+
case "worked_together":
|
|
2627
|
+
return trimmed ? `Worked together at ${trimmed}` : "Worked together";
|
|
2628
|
+
case "collaborated_in":
|
|
2629
|
+
return trimmed ? `Collaborated in ${trimmed}` : "Collaborated";
|
|
2630
|
+
case "supervised_by":
|
|
2631
|
+
return "Manager or mentor relationship";
|
|
2632
|
+
case "co_authored":
|
|
2633
|
+
return "Co-authored";
|
|
2634
|
+
case "other":
|
|
2635
|
+
return trimmed ?? null;
|
|
2636
|
+
default:
|
|
2637
|
+
return null;
|
|
2638
|
+
}
|
|
2639
|
+
}
|
|
2640
|
+
function parseEndorsementComment(comment) {
|
|
2641
|
+
if (!comment) return { relationship: null, note: null };
|
|
2642
|
+
const match = comment.match(RELATIONSHIP_PREFIX);
|
|
2643
|
+
if (!match) {
|
|
2644
|
+
const note2 = comment.trim();
|
|
2645
|
+
return { relationship: null, note: note2 || null };
|
|
2646
|
+
}
|
|
2647
|
+
const relationship = formatRelationship(match[1] ?? "", match[2]);
|
|
2648
|
+
const note = comment.slice(match[0].length).trim();
|
|
2649
|
+
return { relationship, note: note || null };
|
|
2650
|
+
}
|
|
2651
|
+
|
|
2621
2652
|
// src/format/handle-utils.ts
|
|
2622
2653
|
function sanitizeHandleInput(raw) {
|
|
2623
2654
|
let identifier = raw.trim().replace(/^https?:\/\/bsky\.app\/profile\//i, "").replace(/^at:\/\//i, "").replace(/^@/, "").replace(/^https?:\/\//i, "");
|
|
@@ -5043,6 +5074,27 @@ function toStreamCardVMs(items, options = {}) {
|
|
|
5043
5074
|
return out;
|
|
5044
5075
|
}
|
|
5045
5076
|
|
|
5077
|
+
// src/stream/two-tier.ts
|
|
5078
|
+
var RICH_BODY_KINDS = /* @__PURE__ */ new Set([
|
|
5079
|
+
"github-pr",
|
|
5080
|
+
"book",
|
|
5081
|
+
"media-review",
|
|
5082
|
+
"media",
|
|
5083
|
+
"track"
|
|
5084
|
+
]);
|
|
5085
|
+
function isRich(vm) {
|
|
5086
|
+
if (vm.media && vm.media.length > 0) return true;
|
|
5087
|
+
if (vm.externalLink) return true;
|
|
5088
|
+
if (vm.body && RICH_BODY_KINDS.has(vm.body.kind)) return true;
|
|
5089
|
+
return false;
|
|
5090
|
+
}
|
|
5091
|
+
function isSelfAuthoredRich(vm) {
|
|
5092
|
+
return vm.tier === "creation" && isRich(vm);
|
|
5093
|
+
}
|
|
5094
|
+
function renderAsLine(vm) {
|
|
5095
|
+
return !isSelfAuthoredRich(vm);
|
|
5096
|
+
}
|
|
5097
|
+
|
|
5046
5098
|
// src/logic/profile-completeness.ts
|
|
5047
5099
|
var COMPLETENESS_MAX_SCORE = 6;
|
|
5048
5100
|
function completenessScore(c) {
|
|
@@ -6447,7 +6499,7 @@ function describeSifaRecord(collection, value) {
|
|
|
6447
6499
|
}
|
|
6448
6500
|
|
|
6449
6501
|
// src/index.ts
|
|
6450
|
-
var SIFA_SDK_VERSION = "0.19.
|
|
6502
|
+
var SIFA_SDK_VERSION = "0.19.12";
|
|
6451
6503
|
|
|
6452
6504
|
exports.ACTIVITY_TIERS = ACTIVITY_TIERS;
|
|
6453
6505
|
exports.ACTIVITY_VERBS = ACTIVITY_VERBS;
|
|
@@ -6599,6 +6651,7 @@ exports.formatDistanceToNow = formatDistanceToNow;
|
|
|
6599
6651
|
exports.formatEventDate = formatEventDate;
|
|
6600
6652
|
exports.formatLocation = formatLocation;
|
|
6601
6653
|
exports.formatPresentationDuration = formatPresentationDuration;
|
|
6654
|
+
exports.formatRelationship = formatRelationship;
|
|
6602
6655
|
exports.formatRelativeTime = formatRelativeTime;
|
|
6603
6656
|
exports.formatSingleDate = formatSingleDate;
|
|
6604
6657
|
exports.formatSpanDate = formatSpanDate;
|
|
@@ -6656,6 +6709,7 @@ exports.isPseudoEmployer = isPseudoEmployer;
|
|
|
6656
6709
|
exports.isRegistrableDomainHandle = isRegistrableDomainHandle;
|
|
6657
6710
|
exports.isRoleLineRedundant = isRoleLineRedundant;
|
|
6658
6711
|
exports.isSectionPopulated = isSectionPopulated;
|
|
6712
|
+
exports.isSelfAuthoredRich = isSelfAuthoredRich;
|
|
6659
6713
|
exports.isValidRgbColor = isValidRgbColor;
|
|
6660
6714
|
exports.isVisibleActivityItem = isVisibleActivityItem;
|
|
6661
6715
|
exports.languageTagSchema = languageTagSchema;
|
|
@@ -6677,6 +6731,7 @@ exports.normalizeSkillCategory = normalizeSkillCategory;
|
|
|
6677
6731
|
exports.normalizeWorkplaceTypes = normalizeWorkplaceTypes;
|
|
6678
6732
|
exports.openToTokenToValue = openToTokenToValue;
|
|
6679
6733
|
exports.openToValueToToken = openToValueToToken;
|
|
6734
|
+
exports.parseEndorsementComment = parseEndorsementComment;
|
|
6680
6735
|
exports.parseIntendedAudiences = parseIntendedAudiences;
|
|
6681
6736
|
exports.parseLocationString = parseLocationString;
|
|
6682
6737
|
exports.parsePresentationDuration = parsePresentationDuration;
|
|
@@ -6691,6 +6746,7 @@ exports.primaryVerification = primaryVerification;
|
|
|
6691
6746
|
exports.profileToDimensionInputs = profileToDimensionInputs;
|
|
6692
6747
|
exports.qualifiesAsOrg = qualifiesAsOrg;
|
|
6693
6748
|
exports.relativeLuminance = relativeLuminance;
|
|
6749
|
+
exports.renderAsLine = renderAsLine;
|
|
6694
6750
|
exports.rendersCompanyProfile = rendersCompanyProfile;
|
|
6695
6751
|
exports.rendersPersonalProfile = rendersPersonalProfile;
|
|
6696
6752
|
exports.repoGroupForCollection = repoGroupForCollection;
|