@sockethub/platform-metadata 1.0.1-alpha.16 → 1.0.1-alpha.18
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 +2 -0
- package/dist/index.js +135 -16
- package/dist/index.js.map +4 -4
- package/dist/resolvers.d.ts +30 -0
- package/package.json +5 -5
package/dist/resolvers.d.ts
CHANGED
|
@@ -23,6 +23,19 @@
|
|
|
23
23
|
* Handles `/<user>/status/<id>` and the `/i/web/status/<id>` share form.
|
|
24
24
|
*/
|
|
25
25
|
export declare function resolveTwitterStatus(url: string): string | null;
|
|
26
|
+
/** Resolve supported YouTube video URLs to the official oEmbed endpoint. */
|
|
27
|
+
export declare function resolveYouTubeOEmbed(url: string): string | null;
|
|
28
|
+
export interface YouTubeOEmbed {
|
|
29
|
+
title: string;
|
|
30
|
+
provider_name?: string;
|
|
31
|
+
thumbnail_url: string;
|
|
32
|
+
thumbnail_width?: number;
|
|
33
|
+
thumbnail_height?: number;
|
|
34
|
+
}
|
|
35
|
+
/** Validate the subset of YouTube's external oEmbed payload we consume. */
|
|
36
|
+
export declare function parseYouTubeOEmbed(value: unknown): YouTubeOEmbed | null;
|
|
37
|
+
/** Map a validated YouTube oEmbed thumbnail to the platform image shape. */
|
|
38
|
+
export declare function youtubeOEmbedImage(embed?: YouTubeOEmbed): PageObject["image"] | undefined;
|
|
26
39
|
/**
|
|
27
40
|
* True for Reddit URLs (including redd.it short links). Reddit serves its
|
|
28
41
|
* Open Graph tags — with the post's real preview image — only to
|
|
@@ -94,6 +107,23 @@ export interface FxTwitterStatus {
|
|
|
94
107
|
duration?: number;
|
|
95
108
|
}>;
|
|
96
109
|
};
|
|
110
|
+
article?: {
|
|
111
|
+
title?: string;
|
|
112
|
+
preview_text?: string;
|
|
113
|
+
cover_media?: {
|
|
114
|
+
media_info?: {
|
|
115
|
+
original_img_url?: string;
|
|
116
|
+
original_img_width?: number;
|
|
117
|
+
original_img_height?: number;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
content?: {
|
|
121
|
+
blocks?: Array<{
|
|
122
|
+
text?: string;
|
|
123
|
+
type?: string;
|
|
124
|
+
}>;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
97
127
|
};
|
|
98
128
|
}
|
|
99
129
|
/** The `object` payload shape the metadata platform responds with. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sockethub/platform-metadata",
|
|
3
|
-
"version": "1.0.1-alpha.
|
|
3
|
+
"version": "1.0.1-alpha.18",
|
|
4
4
|
"description": "Fetch metadata from a given URL",
|
|
5
5
|
"author": "Nick Jennings <nick@silverbucket.net>",
|
|
6
6
|
"license": "LGPL-3.0+",
|
|
@@ -42,16 +42,16 @@
|
|
|
42
42
|
"clean:deps": "rm -rf node_modules"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@sockethub/util": "^1.0.0-alpha.
|
|
45
|
+
"@sockethub/util": "^1.0.0-alpha.11",
|
|
46
46
|
"open-graph-scraper": "^6.11.0",
|
|
47
47
|
"undici": "^7.16.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@sockethub/schemas": "^3.0.0-alpha.
|
|
50
|
+
"@sockethub/schemas": "^3.0.0-alpha.23"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"@sockethub/server": "^5.0.0-alpha.
|
|
53
|
+
"@sockethub/server": "^5.0.0-alpha.23"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "bb922fbb85f1f4c1c0120e2b0ac871e648e0074c",
|
|
56
56
|
"types": "./dist/index.d.ts"
|
|
57
57
|
}
|