@versini/sassysaint-common 4.69.0 → 4.70.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.
- package/dist/index.d.ts +0 -24
- package/dist/utilities/newsBrief.js +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -857,8 +857,6 @@ export declare interface NewsBrief {
|
|
|
857
857
|
time: string;
|
|
858
858
|
};
|
|
859
859
|
items: NewsBriefItem[];
|
|
860
|
-
otherCommentary?: NewsCommentary[];
|
|
861
|
-
onThisDay?: NewsOnThisDay;
|
|
862
860
|
}
|
|
863
861
|
|
|
864
862
|
export declare interface NewsBriefItem {
|
|
@@ -868,15 +866,6 @@ export declare interface NewsBriefItem {
|
|
|
868
866
|
local: boolean;
|
|
869
867
|
image?: string;
|
|
870
868
|
evidence: NewsEvidence[];
|
|
871
|
-
commentary?: NewsCommentary[];
|
|
872
|
-
}
|
|
873
|
-
|
|
874
|
-
export declare interface NewsCommentary {
|
|
875
|
-
author: string;
|
|
876
|
-
newsletter: string;
|
|
877
|
-
title: string;
|
|
878
|
-
url: string;
|
|
879
|
-
summary: string;
|
|
880
869
|
}
|
|
881
870
|
|
|
882
871
|
export declare interface NewsEvidence {
|
|
@@ -897,12 +886,6 @@ export declare function newsLinkParts(newsLinks: unknown): {
|
|
|
897
886
|
};
|
|
898
887
|
}[];
|
|
899
888
|
|
|
900
|
-
export declare interface NewsOnThisDay {
|
|
901
|
-
title: string;
|
|
902
|
-
url: string;
|
|
903
|
-
line: string;
|
|
904
|
-
}
|
|
905
|
-
|
|
906
889
|
/**
|
|
907
890
|
* Color class mappings and CSS variables for the theme. Covers both color
|
|
908
891
|
* schemes at once, via Tailwind `dark:` prefixes inside the class strings.
|
|
@@ -930,13 +913,6 @@ export declare const PLAN_PLUS = "sassy:plus";
|
|
|
930
913
|
|
|
931
914
|
export declare const PLAN_PREMIUM = "sassy:advanced";
|
|
932
915
|
|
|
933
|
-
/**
|
|
934
|
-
* The accessible name of a post's "Read the post" link, on the chat card and
|
|
935
|
-
* the shared page alike: the visible text first, then the title and newsletter,
|
|
936
|
-
* so two posts with the same title still read as different links.
|
|
937
|
-
*/
|
|
938
|
-
export declare function postLinkName(post: NewsCommentary): string;
|
|
939
|
-
|
|
940
916
|
export declare const PROVIDER_ANTHROPIC = "Anthropic";
|
|
941
917
|
|
|
942
918
|
export declare const PROVIDER_GOOGLE = "Google";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
let t=/^https:\/\/encrypted-tbn\d\.gstatic\.com\/images\?q=tbn:[\w-]+$/;function e(e){return"string"==typeof e&&t.test(e)}function r(t){return"string"==typeof t&&""!==t.trim()}let n=new Set(['"',"\\","/","b","f","n","r","t","u"]),a={"\n":"\\n","\r":"\\r"," ":"\\t"};function l(t){return t.replace(/\\([\\|[\]])/g,"$1")}function i(t){let i,u=t.trim();if(!u||u.length>4e4)return null;try{i=function(t){try{return JSON.parse(t)}catch{return JSON.parse(function(t){let e="",r=!1;for(let l=0;l<t.length;l++){let i=t[l];if(r)if("\\"===i){let r=t[l+1]??"";e+=n.has(r)?`\\${r}`:`\\\\${r}`,l++}else'"'===i?(r=!1,e+=i):i<" "?e+=a[i]??`\\u${i.charCodeAt(0).toString(16).padStart(4,"0")}`:e+=i;else r='"'===i,e+=i}return e}(t))}}(u)}catch{return null}if(!i||!r(i.asOf)||!Array.isArray(i.items))return null;let f=new Set,s=i.items.flatMap(t=>{let{id:n,title:a,summary:i,local:u,image:s,evidence:c}=t??{};return!r(n)||f.has(n)||!r(a)||!r(i)?[]:(f.add(n),[{id:n,title:a,summary:i,local:!0===u,...e(s)?{image:s}:{},evidence:function(t){if(!Array.isArray(t))return[];let e=new Set;return t.flatMap(t=>{let{outlet:n,headline:a,url:i}=t??{};return!r(n)||!r(a)||!function(t){if(!r(t))return!1;try{let{protocol:e}=new URL(t);return"http:"===e||"https:"===e}catch{return!1}}(i)||e.has(i)?[]:(e.add(i),[{outlet:l(n),headline:l(a),url:i}])})}(c)}])}),c=i.earlier;return{asOf:i.asOf,...r(i.note)?{note:i.note}:{},...r(i.place)?{place:i.place}:{},...c&&r(c.chatId)&&r(c.time)?{earlier:{chatId:c.chatId,time:c.time}}:{},items:s}}let u=/^[^\S\n]{0,3}```(\w*)[^\S\n]*\n([\s\S]*?)\n[^\S\n]{0,3}```/gm;function f(t){for(let[,e,r]of t.matchAll(u))if("newsbrief"===e.toLowerCase()||""===e&&/"asOf"/.test(r)){let t=i(r);if(t)return t}return null}export{f as findNewsBrief,e as isNewsImageUrl,i as parseNewsBrief};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/sassysaint-common",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.70.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
],
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@microsoft/api-extractor": "7.59.4",
|
|
18
|
-
"@rslib/core": "1.0.
|
|
18
|
+
"@rslib/core": "1.0.4"
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
21
|
"build:check": "tsc",
|