@singi-labs/sifa-sdk 0.14.0 → 0.14.1

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.
Files changed (27) hide show
  1. package/dist/{index-jNyd5QP7.d.cts → index-CTzpbW81.d.cts} +10 -0
  2. package/dist/{index-jNyd5QP7.d.ts → index-CTzpbW81.d.ts} +10 -0
  3. package/dist/index.cjs +39 -1
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.d.cts +40 -5
  6. package/dist/index.d.ts +40 -5
  7. package/dist/index.js +39 -2
  8. package/dist/index.js.map +1 -1
  9. package/dist/jsonld/index.d.cts +1 -1
  10. package/dist/jsonld/index.d.ts +1 -1
  11. package/dist/{network-map-Ckl4k6v4.d.cts → network-map-BEcmDuQo.d.cts} +4 -4
  12. package/dist/{network-map-Cip8KjJA.d.ts → network-map-isNIwLjJ.d.ts} +4 -4
  13. package/dist/{org-zMZg_r7v.d.ts → org-BmxWk5e5.d.ts} +2 -2
  14. package/dist/{org-DCHb1xhw.d.cts → org-DCQ0CVhV.d.cts} +2 -2
  15. package/dist/{profile-summary-8fapqzHv.d.ts → profile-summary-Bj_vVxkv.d.ts} +1 -1
  16. package/dist/{profile-summary-DY78IoL9.d.cts → profile-summary-C557t4hr.d.cts} +1 -1
  17. package/dist/query/fetchers/index.d.cts +6 -6
  18. package/dist/query/fetchers/index.d.ts +6 -6
  19. package/dist/query/hooks/index.d.cts +5 -5
  20. package/dist/query/hooks/index.d.ts +5 -5
  21. package/dist/query/index.d.cts +8 -8
  22. package/dist/query/index.d.ts +8 -8
  23. package/dist/{types-8wAWvS-T.d.cts → types-DAEkBwRB.d.cts} +1 -1
  24. package/dist/{types-8JaS6abh.d.ts → types-zjv3qDWz.d.ts} +1 -1
  25. package/dist/{use-org-notification-emails-Bt-h3SAB.d.ts → use-org-notification-emails-CqoJgJKf.d.ts} +3 -3
  26. package/dist/{use-org-notification-emails-ByAvxb0x.d.cts → use-org-notification-emails-lU4L6aMl.d.cts} +3 -3
  27. package/package.json +1 -1
@@ -32,6 +32,16 @@ interface ProfilePosition {
32
32
  * `company`).
33
33
  */
34
34
  entityName?: string;
35
+ /**
36
+ * Company-page slug for a durably-linked position, resolved by the AppView at
37
+ * read time alongside `entityName` (#159). Lets a consumer link the company
38
+ * name to its `/c/{domain}` page without re-resolving `entityRef`. `domain` is
39
+ * the readable form, `publicId` the durable fallback; build the link as
40
+ * `/c/${companyDomain ?? companyPublicId}`. Both absent for free-text /
41
+ * unlinked positions.
42
+ */
43
+ companyDomain?: string;
44
+ companyPublicId?: string;
35
45
  title: string;
36
46
  description?: string;
37
47
  startedAt: string;
@@ -32,6 +32,16 @@ interface ProfilePosition {
32
32
  * `company`).
33
33
  */
34
34
  entityName?: string;
35
+ /**
36
+ * Company-page slug for a durably-linked position, resolved by the AppView at
37
+ * read time alongside `entityName` (#159). Lets a consumer link the company
38
+ * name to its `/c/{domain}` page without re-resolving `entityRef`. `domain` is
39
+ * the readable form, `publicId` the durable fallback; build the link as
40
+ * `/c/${companyDomain ?? companyPublicId}`. Both absent for free-text /
41
+ * unlinked positions.
42
+ */
43
+ companyDomain?: string;
44
+ companyPublicId?: string;
35
45
  title: string;
36
46
  description?: string;
37
47
  startedAt: string;
package/dist/index.cjs CHANGED
@@ -2908,6 +2908,43 @@ function truncateGraphemes(value, maxLen) {
2908
2908
  return graphemes.slice(0, maxLen - 1).join("") + ELLIPSIS;
2909
2909
  }
2910
2910
 
2911
+ // src/format/format-display-url.ts
2912
+ function tryParseUrl(raw) {
2913
+ try {
2914
+ return new URL(raw);
2915
+ } catch {
2916
+ }
2917
+ if (!/^[a-z][a-z0-9+.-]*:/i.test(raw)) {
2918
+ try {
2919
+ return new URL(`https://${raw}`);
2920
+ } catch {
2921
+ }
2922
+ }
2923
+ return null;
2924
+ }
2925
+ function formatDisplayUrl(url, options = {}) {
2926
+ const { path = "full" } = options;
2927
+ const raw = (url ?? "").trim();
2928
+ if (!raw) return { display: "", href: "" };
2929
+ const parsed3 = tryParseUrl(raw);
2930
+ if (!parsed3) {
2931
+ return { display: raw.replace(/^dns:/i, ""), href: raw };
2932
+ }
2933
+ if (parsed3.protocol !== "http:" && parsed3.protocol !== "https:") {
2934
+ const display = raw.replace(/^[a-z][a-z0-9+.-]*:/i, "").replace(/^\/\//, "") || raw;
2935
+ return { display, href: raw };
2936
+ }
2937
+ const host = parsed3.hostname.replace(/^www\./i, "");
2938
+ const segments = parsed3.pathname.split("/").filter(Boolean);
2939
+ let pathPart = "";
2940
+ if (path === "full" && segments.length > 0) {
2941
+ pathPart = `/${segments.join("/")}`;
2942
+ } else if (path === "firstSegment" && segments.length > 0) {
2943
+ pathPart = `/${segments[0]}`;
2944
+ }
2945
+ return { display: `${host}${pathPart}`, href: parsed3.href };
2946
+ }
2947
+
2911
2948
  // src/format/time-utils.ts
2912
2949
  function formatDistanceToNow(date) {
2913
2950
  const seconds = Math.floor((Date.now() - date.getTime()) / 1e3);
@@ -5842,7 +5879,7 @@ function describeSifaRecord(collection, value) {
5842
5879
  }
5843
5880
 
5844
5881
  // src/index.ts
5845
- var SIFA_SDK_VERSION = "0.14.0";
5882
+ var SIFA_SDK_VERSION = "0.14.1";
5846
5883
 
5847
5884
  exports.ACTIVITY_TIERS = ACTIVITY_TIERS;
5848
5885
  exports.ACTIVITY_VERBS = ACTIVITY_VERBS;
@@ -5982,6 +6019,7 @@ exports.filterHidden = filterHidden;
5982
6019
  exports.findIndustry = findIndustry;
5983
6020
  exports.formatCompanyName = formatCompanyName;
5984
6021
  exports.formatDateRange = formatDateRange;
6022
+ exports.formatDisplayUrl = formatDisplayUrl;
5985
6023
  exports.formatDistanceToNow = formatDistanceToNow;
5986
6024
  exports.formatLocation = formatLocation;
5987
6025
  exports.formatPresentationDuration = formatPresentationDuration;