@singi-labs/sifa-sdk 0.12.10 → 0.12.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/{adult-content-DE7XOP9c.d.cts → adult-content-D2Dy1w2s.d.cts} +11 -0
- package/dist/{adult-content-DE7XOP9c.d.ts → adult-content-D2Dy1w2s.d.ts} +11 -0
- package/dist/{index-B__7m2Xg.d.cts → index-B9aqJbsG.d.cts} +2 -2
- package/dist/{index-DdfDo0Nx.d.ts → index-BQ46POs-.d.ts} +2 -2
- package/dist/{index-nNxAiYxw.d.ts → index-Br8vBw4N.d.ts} +2 -2
- package/dist/{index-CsvSv1S_.d.cts → index-CZ8BkCCc.d.cts} +2 -2
- package/dist/index.cjs +366 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +73 -5
- package/dist/index.d.ts +73 -5
- package/dist/index.js +361 -7
- package/dist/index.js.map +1 -1
- package/dist/{org-BCqhEA6J.d.ts → org-Bflg9EiB.d.ts} +1 -1
- package/dist/{org-It9hf-ni.d.cts → org-Df5IjADP.d.cts} +1 -1
- package/dist/query/fetchers/index.d.cts +3 -3
- package/dist/query/fetchers/index.d.ts +3 -3
- package/dist/query/hooks/index.d.cts +3 -3
- package/dist/query/hooks/index.d.ts +3 -3
- package/dist/query/index.d.cts +5 -5
- package/dist/query/index.d.ts +5 -5
- package/dist/schemas/index.cjs +21 -1
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +33 -1
- package/dist/schemas/index.d.ts +33 -1
- package/dist/schemas/index.js +21 -2
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/write/index.cjs +13 -1
- package/dist/schemas/write/index.cjs.map +1 -1
- package/dist/schemas/write/index.d.cts +18 -0
- package/dist/schemas/write/index.d.ts +18 -0
- package/dist/schemas/write/index.js +13 -1
- package/dist/schemas/write/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -367,6 +367,10 @@ interface ProfilePresentationDelivery {
|
|
|
367
367
|
/** Day-only date, YYYY-MM-DD. */
|
|
368
368
|
date?: string | null;
|
|
369
369
|
location?: string | null;
|
|
370
|
+
locationCountry?: string | null;
|
|
371
|
+
locationRegion?: string | null;
|
|
372
|
+
locationLocality?: string | null;
|
|
373
|
+
countryCode?: string | null;
|
|
370
374
|
/** Full community.lexicon.calendar.event mode token. */
|
|
371
375
|
mode?: string | null;
|
|
372
376
|
/** Full community.lexicon.calendar.event status token. */
|
|
@@ -390,6 +394,8 @@ interface ProfilePresentation {
|
|
|
390
394
|
links?: PresentationLinkView[];
|
|
391
395
|
/** at-uri of a long-form write-up (Leaflet / site.standard document). */
|
|
392
396
|
writeupUri?: string | null;
|
|
397
|
+
/** Resolved URL of the uploaded cover image, when present. */
|
|
398
|
+
coverImageUrl?: string | null;
|
|
393
399
|
hidden?: boolean;
|
|
394
400
|
deliveries?: ProfilePresentationDelivery[];
|
|
395
401
|
}
|
|
@@ -735,6 +741,10 @@ interface PresentationDeliveryView {
|
|
|
735
741
|
eventName?: string;
|
|
736
742
|
date?: string;
|
|
737
743
|
location?: string;
|
|
744
|
+
locationCountry?: string;
|
|
745
|
+
locationRegion?: string;
|
|
746
|
+
locationLocality?: string;
|
|
747
|
+
countryCode?: string;
|
|
738
748
|
mode?: string;
|
|
739
749
|
status?: string;
|
|
740
750
|
links?: PresentationLinkView[];
|
|
@@ -749,6 +759,7 @@ interface PresentationView {
|
|
|
749
759
|
intendedAudiences?: string[];
|
|
750
760
|
links?: PresentationLinkView[];
|
|
751
761
|
writeupUri?: string;
|
|
762
|
+
coverImageUrl?: string;
|
|
752
763
|
deliveries: PresentationDeliveryView[];
|
|
753
764
|
}
|
|
754
765
|
interface HonorView {
|
|
@@ -367,6 +367,10 @@ interface ProfilePresentationDelivery {
|
|
|
367
367
|
/** Day-only date, YYYY-MM-DD. */
|
|
368
368
|
date?: string | null;
|
|
369
369
|
location?: string | null;
|
|
370
|
+
locationCountry?: string | null;
|
|
371
|
+
locationRegion?: string | null;
|
|
372
|
+
locationLocality?: string | null;
|
|
373
|
+
countryCode?: string | null;
|
|
370
374
|
/** Full community.lexicon.calendar.event mode token. */
|
|
371
375
|
mode?: string | null;
|
|
372
376
|
/** Full community.lexicon.calendar.event status token. */
|
|
@@ -390,6 +394,8 @@ interface ProfilePresentation {
|
|
|
390
394
|
links?: PresentationLinkView[];
|
|
391
395
|
/** at-uri of a long-form write-up (Leaflet / site.standard document). */
|
|
392
396
|
writeupUri?: string | null;
|
|
397
|
+
/** Resolved URL of the uploaded cover image, when present. */
|
|
398
|
+
coverImageUrl?: string | null;
|
|
393
399
|
hidden?: boolean;
|
|
394
400
|
deliveries?: ProfilePresentationDelivery[];
|
|
395
401
|
}
|
|
@@ -735,6 +741,10 @@ interface PresentationDeliveryView {
|
|
|
735
741
|
eventName?: string;
|
|
736
742
|
date?: string;
|
|
737
743
|
location?: string;
|
|
744
|
+
locationCountry?: string;
|
|
745
|
+
locationRegion?: string;
|
|
746
|
+
locationLocality?: string;
|
|
747
|
+
countryCode?: string;
|
|
738
748
|
mode?: string;
|
|
739
749
|
status?: string;
|
|
740
750
|
links?: PresentationLinkView[];
|
|
@@ -749,6 +759,7 @@ interface PresentationView {
|
|
|
749
759
|
intendedAudiences?: string[];
|
|
750
760
|
links?: PresentationLinkView[];
|
|
751
761
|
writeupUri?: string;
|
|
762
|
+
coverImageUrl?: string;
|
|
752
763
|
deliveries: PresentationDeliveryView[];
|
|
753
764
|
}
|
|
754
765
|
interface HonorView {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as SifaApiConfig, A as ApiFetchOptions, j as CreateResult, W as WriteResult } from './org-
|
|
2
|
-
import { d as Profile, _ as ProfileView, e as ProfilePosition, a3 as SkillRef } from './adult-content-
|
|
1
|
+
import { S as SifaApiConfig, A as ApiFetchOptions, j as CreateResult, W as WriteResult } from './org-Df5IjADP.cjs';
|
|
2
|
+
import { d as Profile, _ as ProfileView, e as ProfilePosition, a3 as SkillRef } from './adult-content-D2Dy1w2s.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, ae as RefreshPdsResult, at as UpdateProfileOverrideInput, au as UpdateProfileSelfInput, av as UploadAvatarResult, j as CreateResult, a2 as ProfileLocationInput, k as ExternalAccountInput, i as CreateExternalAccountResult, aw as VerifyExternalAccountResult, E as EndorsementInput, ad as RefreshOrcidPublicationsResult, B as BulkHideProfileItemInput, P as HideProfileItemInput, aq as StatsResponse, g as AppRegistryEntry, M as HiddenApp, w as FilterOptions, al as SearchFilters, am as SearchResponse, ap as SkillSearchResult, l as FeaturedProfile, ao as SimilarProfile, v as FetchSuggestionsOptions, as 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, ac as ReactionStatus, ab as ReactionResult, aa as ReactionError, ak as RoadmapVotesResponse, C as CastRoadmapVoteResult, D as DeleteAccountResult, af as ResetProfileResult, T as OrgClaimResult, _ as OrgProfileUpdateResult, U as OrgDomainChallengeResult, V as OrgDomainVerifyResult, X as OrgNotificationEmailAddResult, Y as OrgNotificationEmailRemoveResult } from './org-
|
|
3
|
+
import { S as SifaApiConfig, s as sifaQueryKeys, W as WriteResult, ae as RefreshPdsResult, at as UpdateProfileOverrideInput, au as UpdateProfileSelfInput, av as UploadAvatarResult, j as CreateResult, a2 as ProfileLocationInput, k as ExternalAccountInput, i as CreateExternalAccountResult, aw as VerifyExternalAccountResult, E as EndorsementInput, ad as RefreshOrcidPublicationsResult, B as BulkHideProfileItemInput, P as HideProfileItemInput, aq as StatsResponse, g as AppRegistryEntry, M as HiddenApp, w as FilterOptions, al as SearchFilters, am as SearchResponse, ap as SkillSearchResult, l as FeaturedProfile, ao as SimilarProfile, v as FetchSuggestionsOptions, as 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, ac as ReactionStatus, ab as ReactionResult, aa as ReactionError, ak as RoadmapVotesResponse, C as CastRoadmapVoteResult, D as DeleteAccountResult, af as ResetProfileResult, T as OrgClaimResult, _ as OrgProfileUpdateResult, U as OrgDomainChallengeResult, V as OrgDomainVerifyResult, X as OrgNotificationEmailAddResult, Y as OrgNotificationEmailRemoveResult } from './org-Bflg9EiB.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, _ as ProfileView, e as ProfilePosition, a3 as SkillRef, E as ExternalAccount, S as SkillSuggestion, O as OrgFloorVerdict } from './adult-content-
|
|
6
|
+
import { d as Profile, _ as ProfileView, e as ProfilePosition, a3 as SkillRef, E as ExternalAccount, S as SkillSuggestion, O as OrgFloorVerdict } from './adult-content-D2Dy1w2s.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
|
import { O as OrgClaimRequestInput, h as OrgProfileUpdateRequestInput, b as OrgDomainChallengeRequestInput, d as OrgDomainVerifyRequestInput, f as OrgNotificationEmailRequestInput } from './org-settings-CmaSX5ZI.js';
|
|
9
9
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as SifaApiConfig, A as ApiFetchOptions, j as CreateResult, W as WriteResult } from './org-
|
|
2
|
-
import { d as Profile, _ as ProfileView, e as ProfilePosition, a3 as SkillRef } from './adult-content-
|
|
1
|
+
import { S as SifaApiConfig, A as ApiFetchOptions, j as CreateResult, W as WriteResult } from './org-Bflg9EiB.js';
|
|
2
|
+
import { d as Profile, _ as ProfileView, e as ProfilePosition, a3 as SkillRef } from './adult-content-D2Dy1w2s.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
|
/**
|
|
@@ -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, ae as RefreshPdsResult, at as UpdateProfileOverrideInput, au as UpdateProfileSelfInput, av as UploadAvatarResult, j as CreateResult, a2 as ProfileLocationInput, k as ExternalAccountInput, i as CreateExternalAccountResult, aw as VerifyExternalAccountResult, E as EndorsementInput, ad as RefreshOrcidPublicationsResult, B as BulkHideProfileItemInput, P as HideProfileItemInput, aq as StatsResponse, g as AppRegistryEntry, M as HiddenApp, w as FilterOptions, al as SearchFilters, am as SearchResponse, ap as SkillSearchResult, l as FeaturedProfile, ao as SimilarProfile, v as FetchSuggestionsOptions, as 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, ac as ReactionStatus, ab as ReactionResult, aa as ReactionError, ak as RoadmapVotesResponse, C as CastRoadmapVoteResult, D as DeleteAccountResult, af as ResetProfileResult, T as OrgClaimResult, _ as OrgProfileUpdateResult, U as OrgDomainChallengeResult, V as OrgDomainVerifyResult, X as OrgNotificationEmailAddResult, Y as OrgNotificationEmailRemoveResult } from './org-
|
|
3
|
+
import { S as SifaApiConfig, s as sifaQueryKeys, W as WriteResult, ae as RefreshPdsResult, at as UpdateProfileOverrideInput, au as UpdateProfileSelfInput, av as UploadAvatarResult, j as CreateResult, a2 as ProfileLocationInput, k as ExternalAccountInput, i as CreateExternalAccountResult, aw as VerifyExternalAccountResult, E as EndorsementInput, ad as RefreshOrcidPublicationsResult, B as BulkHideProfileItemInput, P as HideProfileItemInput, aq as StatsResponse, g as AppRegistryEntry, M as HiddenApp, w as FilterOptions, al as SearchFilters, am as SearchResponse, ap as SkillSearchResult, l as FeaturedProfile, ao as SimilarProfile, v as FetchSuggestionsOptions, as 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, ac as ReactionStatus, ab as ReactionResult, aa as ReactionError, ak as RoadmapVotesResponse, C as CastRoadmapVoteResult, D as DeleteAccountResult, af as ResetProfileResult, T as OrgClaimResult, _ as OrgProfileUpdateResult, U as OrgDomainChallengeResult, V as OrgDomainVerifyResult, X as OrgNotificationEmailAddResult, Y as OrgNotificationEmailRemoveResult } from './org-Df5IjADP.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, _ as ProfileView, e as ProfilePosition, a3 as SkillRef, E as ExternalAccount, S as SkillSuggestion, O as OrgFloorVerdict } from './adult-content-
|
|
6
|
+
import { d as Profile, _ as ProfileView, e as ProfilePosition, a3 as SkillRef, E as ExternalAccount, S as SkillSuggestion, O as OrgFloorVerdict } from './adult-content-D2Dy1w2s.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
|
import { O as OrgClaimRequestInput, h as OrgProfileUpdateRequestInput, b as OrgDomainChallengeRequestInput, d as OrgDomainVerifyRequestInput, f as OrgNotificationEmailRequestInput } from './org-settings-CmaSX5ZI.cjs';
|
|
9
9
|
|
package/dist/index.cjs
CHANGED
|
@@ -1904,6 +1904,136 @@ function detectPdsProvider(handle) {
|
|
|
1904
1904
|
return null;
|
|
1905
1905
|
}
|
|
1906
1906
|
|
|
1907
|
+
// src/format/embed.ts
|
|
1908
|
+
var LINK = { kind: "link" };
|
|
1909
|
+
var YOUTUBE_ID = /^[A-Za-z0-9_-]{6,}$/;
|
|
1910
|
+
function bareHost(hostname) {
|
|
1911
|
+
return hostname.toLowerCase().replace(/^www\./, "");
|
|
1912
|
+
}
|
|
1913
|
+
function resolveEmbed(url) {
|
|
1914
|
+
let parsed3;
|
|
1915
|
+
try {
|
|
1916
|
+
parsed3 = new URL(url);
|
|
1917
|
+
} catch {
|
|
1918
|
+
return LINK;
|
|
1919
|
+
}
|
|
1920
|
+
if (parsed3.protocol !== "https:") return LINK;
|
|
1921
|
+
const host = bareHost(parsed3.hostname);
|
|
1922
|
+
const segments = parsed3.pathname.split("/").filter(Boolean);
|
|
1923
|
+
if (host === "youtu.be") {
|
|
1924
|
+
const id = segments[0];
|
|
1925
|
+
if (id && YOUTUBE_ID.test(id)) {
|
|
1926
|
+
return youtubeEmbed(id);
|
|
1927
|
+
}
|
|
1928
|
+
return LINK;
|
|
1929
|
+
}
|
|
1930
|
+
if (host === "youtube.com" || host === "m.youtube.com") {
|
|
1931
|
+
if (parsed3.pathname === "/watch") {
|
|
1932
|
+
const id = parsed3.searchParams.get("v");
|
|
1933
|
+
if (id && YOUTUBE_ID.test(id)) return youtubeEmbed(id);
|
|
1934
|
+
return LINK;
|
|
1935
|
+
}
|
|
1936
|
+
if (segments[0] === "embed" || segments[0] === "shorts") {
|
|
1937
|
+
const id = segments[1];
|
|
1938
|
+
if (id && YOUTUBE_ID.test(id)) return youtubeEmbed(id);
|
|
1939
|
+
}
|
|
1940
|
+
return LINK;
|
|
1941
|
+
}
|
|
1942
|
+
if (host === "vimeo.com") {
|
|
1943
|
+
const id = segments[0];
|
|
1944
|
+
if (id && /^\d+$/.test(id)) {
|
|
1945
|
+
return {
|
|
1946
|
+
kind: "iframe",
|
|
1947
|
+
provider: "vimeo",
|
|
1948
|
+
src: `https://player.vimeo.com/video/${id}`,
|
|
1949
|
+
aspectRatio: "16:9"
|
|
1950
|
+
};
|
|
1951
|
+
}
|
|
1952
|
+
return LINK;
|
|
1953
|
+
}
|
|
1954
|
+
if (host === "player.vimeo.com") {
|
|
1955
|
+
if (segments[0] === "video" && segments[1] && /^\d+$/.test(segments[1])) {
|
|
1956
|
+
return {
|
|
1957
|
+
kind: "iframe",
|
|
1958
|
+
provider: "vimeo",
|
|
1959
|
+
src: `https://player.vimeo.com/video/${segments[1]}`,
|
|
1960
|
+
aspectRatio: "16:9"
|
|
1961
|
+
};
|
|
1962
|
+
}
|
|
1963
|
+
return LINK;
|
|
1964
|
+
}
|
|
1965
|
+
if (host === "speakerdeck.com") {
|
|
1966
|
+
if (segments[0] === "player" && segments[1]) {
|
|
1967
|
+
return { kind: "iframe", provider: "speakerdeck", src: parsed3.href, aspectRatio: "4:3" };
|
|
1968
|
+
}
|
|
1969
|
+
return LINK;
|
|
1970
|
+
}
|
|
1971
|
+
if (host === "slideshare.net") {
|
|
1972
|
+
if (segments[0] === "slideshow" && segments[1] === "embed_code") {
|
|
1973
|
+
return { kind: "iframe", provider: "slideshare", src: parsed3.href, aspectRatio: "4:3" };
|
|
1974
|
+
}
|
|
1975
|
+
return LINK;
|
|
1976
|
+
}
|
|
1977
|
+
if (host === "docs.google.com") {
|
|
1978
|
+
if (segments[0] === "presentation" && segments[1] === "d" && segments[2]) {
|
|
1979
|
+
return {
|
|
1980
|
+
kind: "iframe",
|
|
1981
|
+
provider: "googleslides",
|
|
1982
|
+
src: `https://docs.google.com/presentation/d/${segments[2]}/embed`,
|
|
1983
|
+
aspectRatio: "16:9"
|
|
1984
|
+
};
|
|
1985
|
+
}
|
|
1986
|
+
return LINK;
|
|
1987
|
+
}
|
|
1988
|
+
if (host === "loom.com") {
|
|
1989
|
+
if (segments[0] === "share" && segments[1]) {
|
|
1990
|
+
return {
|
|
1991
|
+
kind: "iframe",
|
|
1992
|
+
provider: "loom",
|
|
1993
|
+
src: `https://www.loom.com/embed/${segments[1]}`,
|
|
1994
|
+
aspectRatio: "16:9"
|
|
1995
|
+
};
|
|
1996
|
+
}
|
|
1997
|
+
return LINK;
|
|
1998
|
+
}
|
|
1999
|
+
if (host === "canva.com") {
|
|
2000
|
+
if (segments[0] === "design" && segments[1] && segments[2] === "view") {
|
|
2001
|
+
return {
|
|
2002
|
+
kind: "iframe",
|
|
2003
|
+
provider: "canva",
|
|
2004
|
+
src: `https://www.canva.com/design/${segments[1]}/view?embed`,
|
|
2005
|
+
aspectRatio: "16:9"
|
|
2006
|
+
};
|
|
2007
|
+
}
|
|
2008
|
+
return LINK;
|
|
2009
|
+
}
|
|
2010
|
+
return LINK;
|
|
2011
|
+
}
|
|
2012
|
+
function youtubeEmbed(id) {
|
|
2013
|
+
return {
|
|
2014
|
+
kind: "iframe",
|
|
2015
|
+
provider: "youtube",
|
|
2016
|
+
src: `https://www.youtube-nocookie.com/embed/${id}`,
|
|
2017
|
+
aspectRatio: "16:9"
|
|
2018
|
+
};
|
|
2019
|
+
}
|
|
2020
|
+
|
|
2021
|
+
// src/format/talk-slug.ts
|
|
2022
|
+
var MAX_SLUG_LENGTH = 60;
|
|
2023
|
+
var COMBINING_MARKS2 = /[̀-ͯ]/g;
|
|
2024
|
+
function slugifyTitle(title) {
|
|
2025
|
+
const slug = title.normalize("NFKD").replace(COMBINING_MARKS2, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/-+/g, "-").replace(/^-+|-+$/g, "");
|
|
2026
|
+
return slug.slice(0, MAX_SLUG_LENGTH).replace(/-+$/g, "");
|
|
2027
|
+
}
|
|
2028
|
+
function buildTalkSlug(title, rkey) {
|
|
2029
|
+
const slug = slugifyTitle(title);
|
|
2030
|
+
return slug ? `${slug}-${rkey}` : rkey;
|
|
2031
|
+
}
|
|
2032
|
+
function parseTalkRkey(segment) {
|
|
2033
|
+
const idx = segment.lastIndexOf("-");
|
|
2034
|
+
return idx === -1 ? segment : segment.slice(idx + 1);
|
|
2035
|
+
}
|
|
2036
|
+
|
|
1907
2037
|
// src/format/text-sanitize.ts
|
|
1908
2038
|
var COMBINING_MARK = /\p{M}/u;
|
|
1909
2039
|
var BIDI_CONTROLS = /[--]/gu;
|
|
@@ -2720,17 +2850,40 @@ var streamAddressSchema = zod.z.object({
|
|
|
2720
2850
|
country: zod.z.string().optional(),
|
|
2721
2851
|
postalCode: zod.z.string().optional()
|
|
2722
2852
|
});
|
|
2853
|
+
var streamRichSegmentSchema = zod.z.object({
|
|
2854
|
+
text: zod.z.string(),
|
|
2855
|
+
link: zod.z.string().optional(),
|
|
2856
|
+
mention: zod.z.string().optional(),
|
|
2857
|
+
tag: zod.z.string().optional()
|
|
2858
|
+
});
|
|
2723
2859
|
var streamCardBodySchema = zod.z.discriminatedUnion("kind", [
|
|
2724
|
-
zod.z.object({
|
|
2725
|
-
|
|
2726
|
-
|
|
2860
|
+
zod.z.object({
|
|
2861
|
+
kind: zod.z.literal("text"),
|
|
2862
|
+
text: zod.z.string(),
|
|
2863
|
+
richSegments: zod.z.array(streamRichSegmentSchema).optional(),
|
|
2864
|
+
tags: zod.z.array(zod.z.string()).optional()
|
|
2865
|
+
}),
|
|
2866
|
+
zod.z.object({
|
|
2867
|
+
kind: zod.z.literal("media"),
|
|
2868
|
+
text: zod.z.string().optional(),
|
|
2869
|
+
tags: zod.z.array(zod.z.string()).optional()
|
|
2870
|
+
}),
|
|
2871
|
+
zod.z.object({
|
|
2872
|
+
kind: zod.z.literal("link"),
|
|
2873
|
+
text: zod.z.string().optional(),
|
|
2874
|
+
tags: zod.z.array(zod.z.string()).optional()
|
|
2875
|
+
}),
|
|
2727
2876
|
zod.z.object({
|
|
2728
2877
|
kind: zod.z.literal("track"),
|
|
2729
2878
|
text: zod.z.string().optional(),
|
|
2730
2879
|
trackTitle: zod.z.string().optional(),
|
|
2731
2880
|
artist: zod.z.string().optional()
|
|
2732
2881
|
}),
|
|
2733
|
-
zod.z.object({
|
|
2882
|
+
zod.z.object({
|
|
2883
|
+
kind: zod.z.literal("generic"),
|
|
2884
|
+
text: zod.z.string().optional(),
|
|
2885
|
+
tags: zod.z.array(zod.z.string()).optional()
|
|
2886
|
+
}),
|
|
2734
2887
|
zod.z.object({
|
|
2735
2888
|
kind: zod.z.literal("github-pr"),
|
|
2736
2889
|
repoOwner: zod.z.string(),
|
|
@@ -3316,6 +3469,188 @@ function applyAsqAnswer(vm, record) {
|
|
|
3316
3469
|
vm.body = { kind: "generic" };
|
|
3317
3470
|
return vm;
|
|
3318
3471
|
}
|
|
3472
|
+
function nonBlankString(value) {
|
|
3473
|
+
return typeof value === "string" && value.trim().length > 0 ? value : void 0;
|
|
3474
|
+
}
|
|
3475
|
+
function readBodyField(value) {
|
|
3476
|
+
const direct = nonBlankString(value);
|
|
3477
|
+
if (direct) return direct;
|
|
3478
|
+
return nonBlankString(asRecord(value)?.value);
|
|
3479
|
+
}
|
|
3480
|
+
function httpUrl(value) {
|
|
3481
|
+
return typeof value === "string" && /^https?:\/\//i.test(value) ? value : void 0;
|
|
3482
|
+
}
|
|
3483
|
+
var GENERIC_TEXT_ORDER = [
|
|
3484
|
+
"text",
|
|
3485
|
+
"title",
|
|
3486
|
+
"name",
|
|
3487
|
+
"description",
|
|
3488
|
+
"content",
|
|
3489
|
+
"body",
|
|
3490
|
+
"message",
|
|
3491
|
+
"note",
|
|
3492
|
+
"caption",
|
|
3493
|
+
"summary",
|
|
3494
|
+
"status"
|
|
3495
|
+
];
|
|
3496
|
+
function genericText(collection, record) {
|
|
3497
|
+
if (collection === "social.passports.fiftyStates.visit") {
|
|
3498
|
+
return nonBlankString(record.city);
|
|
3499
|
+
}
|
|
3500
|
+
for (const field of GENERIC_TEXT_ORDER) {
|
|
3501
|
+
if (field === "body") {
|
|
3502
|
+
const body = readBodyField(record.body);
|
|
3503
|
+
if (body) return body;
|
|
3504
|
+
continue;
|
|
3505
|
+
}
|
|
3506
|
+
const value = nonBlankString(record[field]);
|
|
3507
|
+
if (value) return value;
|
|
3508
|
+
}
|
|
3509
|
+
return void 0;
|
|
3510
|
+
}
|
|
3511
|
+
function genericTags(record) {
|
|
3512
|
+
const tags = record.tags;
|
|
3513
|
+
if (!Array.isArray(tags)) return void 0;
|
|
3514
|
+
const out = tags.filter((t) => typeof t === "string" && t.length > 0);
|
|
3515
|
+
return out.length > 0 ? out : void 0;
|
|
3516
|
+
}
|
|
3517
|
+
function genericMedia(record, did, alt) {
|
|
3518
|
+
const fromArray = (raw) => {
|
|
3519
|
+
const img = asRecord(raw);
|
|
3520
|
+
if (!img) return void 0;
|
|
3521
|
+
return blobMedia(img.image ?? raw, did, asNonEmptyString(img.alt) ?? alt);
|
|
3522
|
+
};
|
|
3523
|
+
const images = record.images;
|
|
3524
|
+
if (Array.isArray(images)) {
|
|
3525
|
+
const out = images.map(fromArray).filter((m) => m !== void 0);
|
|
3526
|
+
if (out.length > 0) return out;
|
|
3527
|
+
}
|
|
3528
|
+
const embed = asRecord(record.embed);
|
|
3529
|
+
if (embed && Array.isArray(embed.images)) {
|
|
3530
|
+
const out = embed.images.map(fromArray).filter((m) => m !== void 0);
|
|
3531
|
+
if (out.length > 0) return out;
|
|
3532
|
+
}
|
|
3533
|
+
const single = blobMedia(record.image, did, alt) ?? blobMedia(record.thumbnail, did, alt) ?? blobMedia(record.thumb, did, alt) ?? blobMedia(record.photo, did, alt) ?? (embed ? blobMedia(embed.thumbnail, did, alt) : void 0);
|
|
3534
|
+
if (single) return [single];
|
|
3535
|
+
const coverCid = asRecord(record.galleryMeta)?.coverPhotoCid;
|
|
3536
|
+
if (typeof coverCid === "string" && coverCid.length > 0) {
|
|
3537
|
+
return [{ did, cid: coverCid, alt }];
|
|
3538
|
+
}
|
|
3539
|
+
return [];
|
|
3540
|
+
}
|
|
3541
|
+
function genericExternalLink(record) {
|
|
3542
|
+
const embed = asRecord(record.embed);
|
|
3543
|
+
if (embed) {
|
|
3544
|
+
const fromEmbed = bskyExternal(embed);
|
|
3545
|
+
if (fromEmbed) return fromEmbed;
|
|
3546
|
+
}
|
|
3547
|
+
const url = httpUrl(record.source) ?? httpUrl(record.subject) ?? httpUrl(record.url);
|
|
3548
|
+
return url ? { url } : void 0;
|
|
3549
|
+
}
|
|
3550
|
+
function genericSubject(record) {
|
|
3551
|
+
const subject = record.subject;
|
|
3552
|
+
if (typeof subject === "string") {
|
|
3553
|
+
if (subject.startsWith("at://")) return { kind: "record", uri: subject };
|
|
3554
|
+
if (subject.startsWith("did:")) return { kind: "person", did: subject };
|
|
3555
|
+
return void 0;
|
|
3556
|
+
}
|
|
3557
|
+
const uri = nonBlankString(asRecord(subject)?.uri);
|
|
3558
|
+
if (uri && uri.startsWith("at://")) return { kind: "record", uri };
|
|
3559
|
+
return void 0;
|
|
3560
|
+
}
|
|
3561
|
+
function parseFacetFeature(features) {
|
|
3562
|
+
for (const raw of features) {
|
|
3563
|
+
const feat = asRecord(raw);
|
|
3564
|
+
if (!feat) continue;
|
|
3565
|
+
const type = asNonEmptyString(feat["$type"]) ?? "";
|
|
3566
|
+
const uri = asNonEmptyString(feat.uri);
|
|
3567
|
+
const did = asNonEmptyString(feat.did);
|
|
3568
|
+
const tag = asNonEmptyString(feat.tag);
|
|
3569
|
+
if (type.endsWith("#link") && uri) return { link: uri };
|
|
3570
|
+
if (type.endsWith("#mention") && did) return { mention: did };
|
|
3571
|
+
if (type.endsWith("#tag") && tag) return { tag };
|
|
3572
|
+
if (uri) return { link: uri };
|
|
3573
|
+
if (did) return { mention: did };
|
|
3574
|
+
if (tag) return { tag };
|
|
3575
|
+
}
|
|
3576
|
+
return void 0;
|
|
3577
|
+
}
|
|
3578
|
+
function genericRichSegments(text, record) {
|
|
3579
|
+
const facets = record.facets;
|
|
3580
|
+
if (!Array.isArray(facets)) return void 0;
|
|
3581
|
+
const parsed3 = [];
|
|
3582
|
+
for (const raw of facets) {
|
|
3583
|
+
const facet = asRecord(raw);
|
|
3584
|
+
const index = asRecord(facet?.index);
|
|
3585
|
+
const start = asFiniteNumber(index?.byteStart);
|
|
3586
|
+
const end = asFiniteNumber(index?.byteEnd);
|
|
3587
|
+
if (start === void 0 || end === void 0 || start < 0 || end <= start) continue;
|
|
3588
|
+
const features = facet?.features;
|
|
3589
|
+
if (!Array.isArray(features)) continue;
|
|
3590
|
+
const feature = parseFacetFeature(features);
|
|
3591
|
+
if (!feature) continue;
|
|
3592
|
+
parsed3.push({ start, end, ...feature });
|
|
3593
|
+
}
|
|
3594
|
+
if (parsed3.length === 0) return void 0;
|
|
3595
|
+
const bytes = new TextEncoder().encode(text);
|
|
3596
|
+
const decoder = new TextDecoder();
|
|
3597
|
+
parsed3.sort((a, b) => a.start - b.start);
|
|
3598
|
+
const segments = [];
|
|
3599
|
+
let cursor = 0;
|
|
3600
|
+
for (const span of parsed3) {
|
|
3601
|
+
if (span.start < cursor || span.start > bytes.length) continue;
|
|
3602
|
+
const end = Math.min(span.end, bytes.length);
|
|
3603
|
+
if (span.start > cursor) {
|
|
3604
|
+
const plain = decoder.decode(bytes.slice(cursor, span.start));
|
|
3605
|
+
if (plain) segments.push({ text: plain });
|
|
3606
|
+
}
|
|
3607
|
+
const seg = { text: decoder.decode(bytes.slice(span.start, end)) };
|
|
3608
|
+
if (span.link) seg.link = span.link;
|
|
3609
|
+
if (span.mention) seg.mention = span.mention;
|
|
3610
|
+
if (span.tag) seg.tag = span.tag;
|
|
3611
|
+
segments.push(seg);
|
|
3612
|
+
cursor = end;
|
|
3613
|
+
}
|
|
3614
|
+
if (cursor < bytes.length) {
|
|
3615
|
+
const rest = decoder.decode(bytes.slice(cursor));
|
|
3616
|
+
if (rest) segments.push({ text: rest });
|
|
3617
|
+
}
|
|
3618
|
+
return segments.some((s) => s.link ?? s.mention ?? s.tag) ? segments : void 0;
|
|
3619
|
+
}
|
|
3620
|
+
function applyGeneric(vm, item, record) {
|
|
3621
|
+
if (!record) return withGeneric(vm);
|
|
3622
|
+
const text = genericText(item.collection, record);
|
|
3623
|
+
const tags = genericTags(record);
|
|
3624
|
+
const did = didFromUri(item.uri);
|
|
3625
|
+
if (did) {
|
|
3626
|
+
const media = genericMedia(record, did, text ?? "");
|
|
3627
|
+
if (media.length > 0) vm.media = media;
|
|
3628
|
+
}
|
|
3629
|
+
const externalLink = genericExternalLink(record);
|
|
3630
|
+
if (externalLink) vm.externalLink = externalLink;
|
|
3631
|
+
if (!vm.subject) {
|
|
3632
|
+
const subject = genericSubject(record);
|
|
3633
|
+
if (subject) vm.subject = subject;
|
|
3634
|
+
}
|
|
3635
|
+
let body;
|
|
3636
|
+
if (text) {
|
|
3637
|
+
body = { kind: "text", text };
|
|
3638
|
+
const richSegments = genericRichSegments(text, record);
|
|
3639
|
+
if (richSegments) body.richSegments = richSegments;
|
|
3640
|
+
if (tags) body.tags = tags;
|
|
3641
|
+
} else if (vm.media) {
|
|
3642
|
+
body = { kind: "media" };
|
|
3643
|
+
if (tags) body.tags = tags;
|
|
3644
|
+
} else if (vm.externalLink) {
|
|
3645
|
+
body = { kind: "link" };
|
|
3646
|
+
if (tags) body.tags = tags;
|
|
3647
|
+
} else {
|
|
3648
|
+
body = { kind: "generic" };
|
|
3649
|
+
if (tags) body.tags = tags;
|
|
3650
|
+
}
|
|
3651
|
+
vm.body = body;
|
|
3652
|
+
return vm;
|
|
3653
|
+
}
|
|
3319
3654
|
function toStreamCardVM(item, options = {}) {
|
|
3320
3655
|
const verb = verbForCollection(item.collection);
|
|
3321
3656
|
const source = buildSource(item, options);
|
|
@@ -3364,7 +3699,7 @@ function toStreamCardVM(item, options = {}) {
|
|
|
3364
3699
|
if (record && item.collection.startsWith("social.popfeed.feed.")) {
|
|
3365
3700
|
return applyMediaReview(vm, item, record);
|
|
3366
3701
|
}
|
|
3367
|
-
return
|
|
3702
|
+
return applyGeneric(vm, item, record);
|
|
3368
3703
|
}
|
|
3369
3704
|
function toStreamCardVMs(items, options = {}) {
|
|
3370
3705
|
const out = [];
|
|
@@ -3780,6 +4115,12 @@ function groupInvolvementByHeading(items) {
|
|
|
3780
4115
|
}
|
|
3781
4116
|
return groups;
|
|
3782
4117
|
}
|
|
4118
|
+
var BlobRefSchema = zod.z.object({
|
|
4119
|
+
$type: zod.z.literal("blob"),
|
|
4120
|
+
ref: zod.z.object({ $link: zod.z.string().min(1) }),
|
|
4121
|
+
mimeType: zod.z.string().min(1).max(255),
|
|
4122
|
+
size: zod.z.number().int().nonnegative()
|
|
4123
|
+
});
|
|
3783
4124
|
var EndorsementConfirmationRecordSchema = zod.z.object({
|
|
3784
4125
|
endorsement: strongRefSchema,
|
|
3785
4126
|
createdAt: datetimeSchema
|
|
@@ -4095,8 +4436,18 @@ var ProfilePresentationRecordSchema = zod.z.object({
|
|
|
4095
4436
|
// Optional reference to a long-form write-up (pub.leaflet.document or
|
|
4096
4437
|
// site.standard.document). Plain at-uri + optional cid so it tracks edits.
|
|
4097
4438
|
writeupRef: externalRecordRefSchema.optional(),
|
|
4439
|
+
// Optional uploaded cover image for the talk page.
|
|
4440
|
+
coverImage: BlobRefSchema.optional(),
|
|
4098
4441
|
createdAt: datetimeSchema
|
|
4099
4442
|
});
|
|
4443
|
+
var communityAddressSchema = zod.z.object({
|
|
4444
|
+
country: zod.z.string().optional(),
|
|
4445
|
+
postalCode: zod.z.string().optional(),
|
|
4446
|
+
region: zod.z.string().optional(),
|
|
4447
|
+
locality: zod.z.string().optional(),
|
|
4448
|
+
street: zod.z.string().optional(),
|
|
4449
|
+
name: zod.z.string().optional()
|
|
4450
|
+
});
|
|
4100
4451
|
var ProfilePresentationDeliveryRecordSchema = zod.z.object({
|
|
4101
4452
|
// Optional reference to the id.sifa.profile.presentation delivered here.
|
|
4102
4453
|
presentationRef: externalRecordRefSchema.optional(),
|
|
@@ -4107,6 +4458,9 @@ var ProfilePresentationDeliveryRecordSchema = zod.z.object({
|
|
|
4107
4458
|
// Calendar date as YYYY-MM-DD (day only).
|
|
4108
4459
|
date: zod.z.string().regex(/^\d{4}-\d{2}-\d{2}$/, "date must be YYYY-MM-DD").optional(),
|
|
4109
4460
|
location: zod.z.string().refine(maxGraphemes(256)).max(2560).optional(),
|
|
4461
|
+
// Structured community.lexicon.location.address for the occasion. The
|
|
4462
|
+
// free-text `location` string above stays as a legacy fallback.
|
|
4463
|
+
address: communityAddressSchema.optional(),
|
|
4110
4464
|
mode: zod.z.string().optional(),
|
|
4111
4465
|
status: zod.z.string().optional(),
|
|
4112
4466
|
links: zod.z.array(PresentationLinkSchema).max(20).optional(),
|
|
@@ -4174,7 +4528,7 @@ var ProfileVolunteeringRecordSchema = zod.z.object({
|
|
|
4174
4528
|
});
|
|
4175
4529
|
|
|
4176
4530
|
// src/index.ts
|
|
4177
|
-
var SIFA_SDK_VERSION = "0.12.
|
|
4531
|
+
var SIFA_SDK_VERSION = "0.12.12";
|
|
4178
4532
|
|
|
4179
4533
|
exports.ACTIVITY_TIERS = ACTIVITY_TIERS;
|
|
4180
4534
|
exports.ACTIVITY_VERBS = ACTIVITY_VERBS;
|
|
@@ -4189,6 +4543,7 @@ exports.ARTIFACT_LINK_KIND_LABELS = ARTIFACT_LINK_KIND_LABELS;
|
|
|
4189
4543
|
exports.ARTIFACT_LINK_KIND_OPTIONS = ARTIFACT_LINK_KIND_OPTIONS;
|
|
4190
4544
|
exports.ArtifactLinkSchema = ArtifactLinkSchema;
|
|
4191
4545
|
exports.AtmosphereFeedItemSchema = AtmosphereFeedItemSchema;
|
|
4546
|
+
exports.BlobRefSchema = BlobRefSchema;
|
|
4192
4547
|
exports.CALENDAR_EVENT_MODE_LABELS = CALENDAR_EVENT_MODE_LABELS;
|
|
4193
4548
|
exports.CALENDAR_EVENT_STATUS_LABELS = CALENDAR_EVENT_STATUS_LABELS;
|
|
4194
4549
|
exports.CATEGORY_LABELS = CATEGORY_LABELS;
|
|
@@ -4270,6 +4625,7 @@ exports.VERIFICATION_PROVIDERS = VERIFICATION_PROVIDERS;
|
|
|
4270
4625
|
exports.WORKPLACE_TYPE_LABELS = WORKPLACE_TYPE_LABELS;
|
|
4271
4626
|
exports.WORKPLACE_TYPE_OPTIONS = WORKPLACE_TYPE_OPTIONS;
|
|
4272
4627
|
exports.atUriSchema = atUriSchema;
|
|
4628
|
+
exports.buildTalkSlug = buildTalkSlug;
|
|
4273
4629
|
exports.categoryForApp = categoryForApp;
|
|
4274
4630
|
exports.certDateExtractor = certDateExtractor;
|
|
4275
4631
|
exports.cidSchema = cidSchema;
|
|
@@ -4365,6 +4721,7 @@ exports.openToValueToToken = openToValueToToken;
|
|
|
4365
4721
|
exports.parseIntendedAudiences = parseIntendedAudiences;
|
|
4366
4722
|
exports.parseLocationString = parseLocationString;
|
|
4367
4723
|
exports.parsePresentationDuration = parsePresentationDuration;
|
|
4724
|
+
exports.parseTalkRkey = parseTalkRkey;
|
|
4368
4725
|
exports.partialDateSchema = partialDateSchema;
|
|
4369
4726
|
exports.pdsProviderFromApi = pdsProviderFromApi;
|
|
4370
4727
|
exports.pickPrimaryPosition = pickPrimaryPosition;
|
|
@@ -4376,6 +4733,7 @@ exports.qualifiesAsOrg = qualifiesAsOrg;
|
|
|
4376
4733
|
exports.relativeLuminance = relativeLuminance;
|
|
4377
4734
|
exports.resolveCardHealth = resolveCardHealth;
|
|
4378
4735
|
exports.resolveCardUrl = resolveCardUrl;
|
|
4736
|
+
exports.resolveEmbed = resolveEmbed;
|
|
4379
4737
|
exports.resolveVerifierProvider = resolveVerifierProvider;
|
|
4380
4738
|
exports.rgbToString = rgbToString;
|
|
4381
4739
|
exports.sanitizeDisplayText = sanitizeDisplayText;
|
|
@@ -4383,6 +4741,7 @@ exports.sanitizeHandleInput = sanitizeHandleInput;
|
|
|
4383
4741
|
exports.searchResultDisambiguation = searchResultDisambiguation;
|
|
4384
4742
|
exports.selfLabelsSchema = selfLabelsSchema;
|
|
4385
4743
|
exports.singleDateExtractor = singleDateExtractor;
|
|
4744
|
+
exports.slugifyTitle = slugifyTitle;
|
|
4386
4745
|
exports.sortByActiveDateRange = sortByActiveDateRange;
|
|
4387
4746
|
exports.sortByDateDesc = sortByDateDesc;
|
|
4388
4747
|
exports.sortCertifications = sortCertifications;
|
|
@@ -4400,6 +4759,7 @@ exports.streamCardVMSchema = streamCardVMSchema;
|
|
|
4400
4759
|
exports.streamExternalLinkSchema = streamExternalLinkSchema;
|
|
4401
4760
|
exports.streamGeoSchema = streamGeoSchema;
|
|
4402
4761
|
exports.streamMediaSchema = streamMediaSchema;
|
|
4762
|
+
exports.streamRichSegmentSchema = streamRichSegmentSchema;
|
|
4403
4763
|
exports.streamSourceSchema = streamSourceSchema;
|
|
4404
4764
|
exports.streamThemeSchema = streamThemeSchema;
|
|
4405
4765
|
exports.streamVerbSchema = streamVerbSchema;
|