@singi-labs/sifa-sdk 0.11.26 → 0.11.28

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.
@@ -54,6 +54,14 @@ interface ProfileEducation {
54
54
  * for display (the "Linked" badge).
55
55
  */
56
56
  entityRef?: string;
57
+ /**
58
+ * Resolved current canonical name of the durably-linked institution (#252),
59
+ * computed by the AppView at read time. Render this over `institution` for a
60
+ * linked entry, so a name correction reaches every linked profile without a
61
+ * PDS write. Absent for free-text or unresolved entries (fall back to
62
+ * `institution`).
63
+ */
64
+ entityName?: string;
57
65
  degree?: string;
58
66
  fieldOfStudy?: string;
59
67
  description?: string;
@@ -113,6 +121,13 @@ interface ProfileCertification {
113
121
  * Mirrors `ProfilePosition.entityRef`; the AppView sends it for display.
114
122
  */
115
123
  entityRef?: string;
124
+ /**
125
+ * Resolved current canonical name of the durably-linked issuing organization
126
+ * (#252), computed by the AppView at read time. Render this over `issuingOrg`
127
+ * for a linked entry. Absent for free-text or unresolved entries (fall back to
128
+ * `issuingOrg`).
129
+ */
130
+ entityName?: string;
116
131
  issueDate?: string;
117
132
  expiryDate?: string;
118
133
  credentialUrl?: string;
@@ -179,6 +194,13 @@ interface ProfileVolunteering {
179
194
  * Mirrors `ProfilePosition.entityRef`; the AppView sends it for display.
180
195
  */
181
196
  entityRef?: string;
197
+ /**
198
+ * Resolved current canonical name of the durably-linked organization (#252),
199
+ * computed by the AppView at read time. Render this over `organization` for a
200
+ * linked entry. Absent for free-text or unresolved entries (fall back to
201
+ * `organization`).
202
+ */
203
+ entityName?: string;
182
204
  role?: string;
183
205
  cause?: string;
184
206
  startDate?: string;
@@ -196,6 +218,12 @@ interface ProfileHonor {
196
218
  * `ProfilePosition.entityRef`; the AppView sends it for display.
197
219
  */
198
220
  entityRef?: string;
221
+ /**
222
+ * Resolved current canonical name of the durably-linked issuer (#252),
223
+ * computed by the AppView at read time. Render this over `issuer` for a linked
224
+ * entry. Absent for free-text or unresolved entries (fall back to `issuer`).
225
+ */
226
+ entityName?: string;
199
227
  date?: string;
200
228
  description?: string;
201
229
  hidden?: boolean;
@@ -279,11 +307,21 @@ interface ProfileCourse {
279
307
  * `ProfilePosition.entityRef`; the AppView sends it for display.
280
308
  */
281
309
  entityRef?: string;
310
+ /**
311
+ * Resolved current canonical name of the durably-linked institution (#252),
312
+ * computed by the AppView at read time. Render this over `institution` for a
313
+ * linked entry. Absent for free-text or unresolved entries (fall back to
314
+ * `institution`).
315
+ */
316
+ entityName?: string;
282
317
  number?: string;
283
318
  /** rkey of the associated certification, resolved from the course's
284
319
  * `credential` at-uri. Used to join the course to a certification in the
285
320
  * same profile payload (for the linked-credential date and link). */
286
321
  credentialRkey?: string;
322
+ /** Date the course was completed, as an RFC 3339 datetime. Optional; the
323
+ * editor collects month granularity (YYYY-MM). */
324
+ completedAt?: string;
287
325
  hidden?: boolean;
288
326
  }
289
327
  /** A related link on a presentation or delivery, as returned by the AppView. */
@@ -54,6 +54,14 @@ interface ProfileEducation {
54
54
  * for display (the "Linked" badge).
55
55
  */
56
56
  entityRef?: string;
57
+ /**
58
+ * Resolved current canonical name of the durably-linked institution (#252),
59
+ * computed by the AppView at read time. Render this over `institution` for a
60
+ * linked entry, so a name correction reaches every linked profile without a
61
+ * PDS write. Absent for free-text or unresolved entries (fall back to
62
+ * `institution`).
63
+ */
64
+ entityName?: string;
57
65
  degree?: string;
58
66
  fieldOfStudy?: string;
59
67
  description?: string;
@@ -113,6 +121,13 @@ interface ProfileCertification {
113
121
  * Mirrors `ProfilePosition.entityRef`; the AppView sends it for display.
114
122
  */
115
123
  entityRef?: string;
124
+ /**
125
+ * Resolved current canonical name of the durably-linked issuing organization
126
+ * (#252), computed by the AppView at read time. Render this over `issuingOrg`
127
+ * for a linked entry. Absent for free-text or unresolved entries (fall back to
128
+ * `issuingOrg`).
129
+ */
130
+ entityName?: string;
116
131
  issueDate?: string;
117
132
  expiryDate?: string;
118
133
  credentialUrl?: string;
@@ -179,6 +194,13 @@ interface ProfileVolunteering {
179
194
  * Mirrors `ProfilePosition.entityRef`; the AppView sends it for display.
180
195
  */
181
196
  entityRef?: string;
197
+ /**
198
+ * Resolved current canonical name of the durably-linked organization (#252),
199
+ * computed by the AppView at read time. Render this over `organization` for a
200
+ * linked entry. Absent for free-text or unresolved entries (fall back to
201
+ * `organization`).
202
+ */
203
+ entityName?: string;
182
204
  role?: string;
183
205
  cause?: string;
184
206
  startDate?: string;
@@ -196,6 +218,12 @@ interface ProfileHonor {
196
218
  * `ProfilePosition.entityRef`; the AppView sends it for display.
197
219
  */
198
220
  entityRef?: string;
221
+ /**
222
+ * Resolved current canonical name of the durably-linked issuer (#252),
223
+ * computed by the AppView at read time. Render this over `issuer` for a linked
224
+ * entry. Absent for free-text or unresolved entries (fall back to `issuer`).
225
+ */
226
+ entityName?: string;
199
227
  date?: string;
200
228
  description?: string;
201
229
  hidden?: boolean;
@@ -279,11 +307,21 @@ interface ProfileCourse {
279
307
  * `ProfilePosition.entityRef`; the AppView sends it for display.
280
308
  */
281
309
  entityRef?: string;
310
+ /**
311
+ * Resolved current canonical name of the durably-linked institution (#252),
312
+ * computed by the AppView at read time. Render this over `institution` for a
313
+ * linked entry. Absent for free-text or unresolved entries (fall back to
314
+ * `institution`).
315
+ */
316
+ entityName?: string;
282
317
  number?: string;
283
318
  /** rkey of the associated certification, resolved from the course's
284
319
  * `credential` at-uri. Used to join the course to a certification in the
285
320
  * same profile payload (for the linked-credential date and link). */
286
321
  credentialRkey?: string;
322
+ /** Date the course was completed, as an RFC 3339 datetime. Optional; the
323
+ * editor collects month granularity (YYYY-MM). */
324
+ completedAt?: string;
287
325
  hidden?: boolean;
288
326
  }
289
327
  /** A related link on a presentation or delivery, as returned by the AppView. */
@@ -1,5 +1,5 @@
1
- import { S as SifaApiConfig, A as ApiFetchOptions, j as CreateResult, W as WriteResult } from './keys-9usqNSXo.cjs';
2
- import { d as Profile, v as ProfilePosition, D as SkillRef } from './adult-content-B6QylaCW.cjs';
1
+ import { S as SifaApiConfig, A as ApiFetchOptions, j as CreateResult, W as WriteResult } from './keys-CA2WLIM6.cjs';
2
+ import { d as Profile, v as ProfilePosition, D as SkillRef } from './adult-content-C34UkvI6.cjs';
3
3
  import { m as EntitySearchResponse, E as EntitySearchResult, g as EntityMintDomainResponse, k as EntityResolveDomainResponse, p as EntitySelectRequest, r as EntitySelectResponse } from './feed-D2ZV8Eaj.cjs';
4
4
 
5
5
  /**
@@ -1,9 +1,9 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { S as SifaApiConfig, s as sifaQueryKeys, W as WriteResult, a5 as RefreshPdsResult, aj as UpdateProfileOverrideInput, ak as UpdateProfileSelfInput, al as UploadAvatarResult, j as CreateResult, U as ProfileLocationInput, k as ExternalAccountInput, i as CreateExternalAccountResult, am as VerifyExternalAccountResult, E as EndorsementInput, a4 as RefreshOrcidPublicationsResult, B as BulkHideProfileItemInput, P as HideProfileItemInput, ag as StatsResponse, g as AppRegistryEntry, M as HiddenApp, w as FilterOptions, ab as SearchFilters, ac as SearchResponse, af as SkillSearchResult, l as FeaturedProfile, ae as SimilarProfile, v as FetchSuggestionsOptions, ai as SuggestionsResponse, G as FollowUserResult, o as FetchFollowListOptions, x as FollowListPage, H as FollowingResponse, q as FetchFollowingFeedOptions, p as FetchFollowProfilePageOptions, z as FollowProfilePageResponse, F as FeatureAllowlistResponse, m as FetchActivityFeedOptions, b as ActivityFeedResponse, e as ActivityTeaserResponse, L as HeatmapResponse, a as AccountCheckResult, a3 as ReactionStatus, a2 as ReactionResult, a1 as ReactionError, aa as RoadmapVotesResponse, C as CastRoadmapVoteResult, D as DeleteAccountResult } from './keys-BrOsePaR.js';
3
+ import { S as SifaApiConfig, s as sifaQueryKeys, W as WriteResult, a5 as RefreshPdsResult, aj as UpdateProfileOverrideInput, ak as UpdateProfileSelfInput, al as UploadAvatarResult, j as CreateResult, U as ProfileLocationInput, k as ExternalAccountInput, i as CreateExternalAccountResult, am as VerifyExternalAccountResult, E as EndorsementInput, a4 as RefreshOrcidPublicationsResult, B as BulkHideProfileItemInput, P as HideProfileItemInput, ag as StatsResponse, g as AppRegistryEntry, M as HiddenApp, w as FilterOptions, ab as SearchFilters, ac as SearchResponse, af as SkillSearchResult, l as FeaturedProfile, ae as SimilarProfile, v as FetchSuggestionsOptions, ai as SuggestionsResponse, G as FollowUserResult, o as FetchFollowListOptions, x as FollowListPage, H as FollowingResponse, q as FetchFollowingFeedOptions, p as FetchFollowProfilePageOptions, z as FollowProfilePageResponse, F as FeatureAllowlistResponse, m as FetchActivityFeedOptions, b as ActivityFeedResponse, e as ActivityTeaserResponse, L as HeatmapResponse, a as AccountCheckResult, a3 as ReactionStatus, a2 as ReactionResult, a1 as ReactionError, aa as RoadmapVotesResponse, C as CastRoadmapVoteResult, D as DeleteAccountResult } from './keys-BAdZNl3S.js';
4
4
  import * as _tanstack_react_query from '@tanstack/react-query';
5
5
  import { UseQueryOptions, UseMutationOptions, UseInfiniteQueryOptions, InfiniteData } from '@tanstack/react-query';
6
- import { d as Profile, v as ProfilePosition, D as SkillRef, E as ExternalAccount, S as SkillSuggestion } from './adult-content-B6QylaCW.js';
6
+ import { d as Profile, v as ProfilePosition, D as SkillRef, E as ExternalAccount, S as SkillSuggestion } from './adult-content-C34UkvI6.js';
7
7
  import { m as EntitySearchResponse, E as EntitySearchResult, g as EntityMintDomainResponse, k as EntityResolveDomainResponse, r as EntitySelectResponse, p as EntitySelectRequest, F as FollowFeedPage, c as FeatureFlag } from './feed-D2ZV8Eaj.js';
8
8
 
9
9
  interface SifaProviderProps {
@@ -1,9 +1,9 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { S as SifaApiConfig, s as sifaQueryKeys, W as WriteResult, a5 as RefreshPdsResult, aj as UpdateProfileOverrideInput, ak as UpdateProfileSelfInput, al as UploadAvatarResult, j as CreateResult, U as ProfileLocationInput, k as ExternalAccountInput, i as CreateExternalAccountResult, am as VerifyExternalAccountResult, E as EndorsementInput, a4 as RefreshOrcidPublicationsResult, B as BulkHideProfileItemInput, P as HideProfileItemInput, ag as StatsResponse, g as AppRegistryEntry, M as HiddenApp, w as FilterOptions, ab as SearchFilters, ac as SearchResponse, af as SkillSearchResult, l as FeaturedProfile, ae as SimilarProfile, v as FetchSuggestionsOptions, ai as SuggestionsResponse, G as FollowUserResult, o as FetchFollowListOptions, x as FollowListPage, H as FollowingResponse, q as FetchFollowingFeedOptions, p as FetchFollowProfilePageOptions, z as FollowProfilePageResponse, F as FeatureAllowlistResponse, m as FetchActivityFeedOptions, b as ActivityFeedResponse, e as ActivityTeaserResponse, L as HeatmapResponse, a as AccountCheckResult, a3 as ReactionStatus, a2 as ReactionResult, a1 as ReactionError, aa as RoadmapVotesResponse, C as CastRoadmapVoteResult, D as DeleteAccountResult } from './keys-9usqNSXo.cjs';
3
+ import { S as SifaApiConfig, s as sifaQueryKeys, W as WriteResult, a5 as RefreshPdsResult, aj as UpdateProfileOverrideInput, ak as UpdateProfileSelfInput, al as UploadAvatarResult, j as CreateResult, U as ProfileLocationInput, k as ExternalAccountInput, i as CreateExternalAccountResult, am as VerifyExternalAccountResult, E as EndorsementInput, a4 as RefreshOrcidPublicationsResult, B as BulkHideProfileItemInput, P as HideProfileItemInput, ag as StatsResponse, g as AppRegistryEntry, M as HiddenApp, w as FilterOptions, ab as SearchFilters, ac as SearchResponse, af as SkillSearchResult, l as FeaturedProfile, ae as SimilarProfile, v as FetchSuggestionsOptions, ai as SuggestionsResponse, G as FollowUserResult, o as FetchFollowListOptions, x as FollowListPage, H as FollowingResponse, q as FetchFollowingFeedOptions, p as FetchFollowProfilePageOptions, z as FollowProfilePageResponse, F as FeatureAllowlistResponse, m as FetchActivityFeedOptions, b as ActivityFeedResponse, e as ActivityTeaserResponse, L as HeatmapResponse, a as AccountCheckResult, a3 as ReactionStatus, a2 as ReactionResult, a1 as ReactionError, aa as RoadmapVotesResponse, C as CastRoadmapVoteResult, D as DeleteAccountResult } from './keys-CA2WLIM6.cjs';
4
4
  import * as _tanstack_react_query from '@tanstack/react-query';
5
5
  import { UseQueryOptions, UseMutationOptions, UseInfiniteQueryOptions, InfiniteData } from '@tanstack/react-query';
6
- import { d as Profile, v as ProfilePosition, D as SkillRef, E as ExternalAccount, S as SkillSuggestion } from './adult-content-B6QylaCW.cjs';
6
+ import { d as Profile, v as ProfilePosition, D as SkillRef, E as ExternalAccount, S as SkillSuggestion } from './adult-content-C34UkvI6.cjs';
7
7
  import { m as EntitySearchResponse, E as EntitySearchResult, g as EntityMintDomainResponse, k as EntityResolveDomainResponse, r as EntitySelectResponse, p as EntitySelectRequest, F as FollowFeedPage, c as FeatureFlag } from './feed-D2ZV8Eaj.cjs';
8
8
 
9
9
  interface SifaProviderProps {
@@ -1,5 +1,5 @@
1
- import { S as SifaApiConfig, A as ApiFetchOptions, j as CreateResult, W as WriteResult } from './keys-BrOsePaR.js';
2
- import { d as Profile, v as ProfilePosition, D as SkillRef } from './adult-content-B6QylaCW.js';
1
+ import { S as SifaApiConfig, A as ApiFetchOptions, j as CreateResult, W as WriteResult } from './keys-BAdZNl3S.js';
2
+ import { d as Profile, v as ProfilePosition, D as SkillRef } from './adult-content-C34UkvI6.js';
3
3
  import { m as EntitySearchResponse, E as EntitySearchResult, g as EntityMintDomainResponse, k as EntityResolveDomainResponse, p as EntitySelectRequest, r as EntitySelectResponse } from './feed-D2ZV8Eaj.js';
4
4
 
5
5
  /**
package/dist/index.cjs CHANGED
@@ -1538,6 +1538,82 @@ function formatCompanyName(name) {
1538
1538
  }).join("");
1539
1539
  }
1540
1540
 
1541
+ // src/format/normalize-legal-form.ts
1542
+ var CANONICAL_LEGAL_FORMS = {
1543
+ llc: "LLC",
1544
+ inc: "Inc",
1545
+ ltd: "Ltd",
1546
+ ltda: "Ltda",
1547
+ corp: "Corp",
1548
+ co: "Co",
1549
+ plc: "PLC",
1550
+ llp: "LLP",
1551
+ lp: "LP",
1552
+ gmbh: "GmbH",
1553
+ ag: "AG",
1554
+ ab: "AB",
1555
+ as: "AS",
1556
+ aps: "ApS",
1557
+ oy: "Oy",
1558
+ oyj: "Oyj",
1559
+ nv: "NV",
1560
+ bv: "BV",
1561
+ sa: "SA",
1562
+ sas: "SAS",
1563
+ sarl: "SARL",
1564
+ kk: "KK",
1565
+ sl: "SL",
1566
+ pty: "Pty"
1567
+ };
1568
+ var AMBIGUOUS_WHEN_LEADING = /* @__PURE__ */ new Set(["as"]);
1569
+ function recase(token, canonical) {
1570
+ let li = 0;
1571
+ let out = "";
1572
+ for (const ch of token) {
1573
+ if (/[A-Za-z]/.test(ch)) {
1574
+ out += canonical.charAt(li);
1575
+ li += 1;
1576
+ } else {
1577
+ out += ch;
1578
+ }
1579
+ }
1580
+ return out;
1581
+ }
1582
+ function normalizeToken(token, isLeading) {
1583
+ const letters = token.replace(/\./g, "");
1584
+ if (!/^[A-Za-z]+$/.test(letters)) return token;
1585
+ const key = letters.toLowerCase();
1586
+ const canonical = CANONICAL_LEGAL_FORMS[key];
1587
+ if (!canonical) return token;
1588
+ if (isLeading && AMBIGUOUS_WHEN_LEADING.has(key)) return token;
1589
+ return recase(token, canonical);
1590
+ }
1591
+ function normalizeLegalForm(name) {
1592
+ if (!name || hasNonAsciiLetter(name)) return name;
1593
+ const parts = name.split(/(\s+)/);
1594
+ const wordIndices = [];
1595
+ for (let i = 0; i < parts.length; i += 1) {
1596
+ const part = parts[i];
1597
+ if (part !== void 0 && part.length > 0 && !/^\s+$/.test(part)) wordIndices.push(i);
1598
+ }
1599
+ if (wordIndices.length === 0) return name;
1600
+ const firstIdx = wordIndices[0];
1601
+ const lastIdx = wordIndices[wordIndices.length - 1];
1602
+ if (firstIdx === void 0 || lastIdx === void 0) return name;
1603
+ const candidateIndices = firstIdx === lastIdx ? [firstIdx] : [firstIdx, lastIdx];
1604
+ let changed = false;
1605
+ for (const idx of candidateIndices) {
1606
+ const original = parts[idx];
1607
+ if (original === void 0) continue;
1608
+ const rewritten = normalizeToken(original, idx === firstIdx);
1609
+ if (rewritten !== original) {
1610
+ parts[idx] = rewritten;
1611
+ changed = true;
1612
+ }
1613
+ }
1614
+ return changed ? parts.join("") : name;
1615
+ }
1616
+
1541
1617
  // src/format/normalize-company-key.ts
1542
1618
  var COMBINING_MARKS = /[\u0300-\u036f]/g;
1543
1619
  function normalizeCompanyKey(name) {
@@ -2852,6 +2928,9 @@ var ProfileCourseRecordSchema = zod.z.object({
2852
2928
  // AT-URI of the associated id.sifa.profile.certification record. Plain
2853
2929
  // at-uri (not a strongRef) so the link tracks the live certification.
2854
2930
  credential: atUriSchema.optional(),
2931
+ // Date the course was completed. Stored as an RFC 3339 datetime to match the
2932
+ // other profile date fields; the editor collects month granularity (YYYY-MM).
2933
+ completedAt: datetimeSchema.optional(),
2855
2934
  createdAt: datetimeSchema
2856
2935
  });
2857
2936
  var ProfileEducationRecordSchema = zod.z.object({
@@ -3039,7 +3118,7 @@ var ProfileVolunteeringRecordSchema = zod.z.object({
3039
3118
  });
3040
3119
 
3041
3120
  // src/index.ts
3042
- var SIFA_SDK_VERSION = "0.11.26";
3121
+ var SIFA_SDK_VERSION = "0.11.28";
3043
3122
 
3044
3123
  exports.ACTIVITY_TIERS = ACTIVITY_TIERS;
3045
3124
  exports.ACTIVITY_VISIBILITY_RULES = ACTIVITY_VISIBILITY_RULES;
@@ -3197,6 +3276,7 @@ exports.makeGraphFollowRecordSchema = makeGraphFollowRecordSchema;
3197
3276
  exports.maxGraphemes = maxGraphemes;
3198
3277
  exports.meetsContrastAA = meetsContrastAA;
3199
3278
  exports.normalizeCompanyKey = normalizeCompanyKey;
3279
+ exports.normalizeLegalForm = normalizeLegalForm;
3200
3280
  exports.normalizeOpenTo = normalizeOpenTo;
3201
3281
  exports.normalizePlatformId = normalizePlatformId;
3202
3282
  exports.normalizePresentationMode = normalizePresentationMode;