@sockethub/platform-metadata 1.0.1-alpha.5 → 1.0.1-alpha.6
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.js +14 -10
- package/dist/index.js.map +3 -3
- package/package.json +6 -5
- package/src/index.ts +10 -3
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.6",
|
|
4
4
|
"description": "Fetch metadata from a given URL",
|
|
5
5
|
"author": "Nick Jennings <nick@silverbucket.net>",
|
|
6
6
|
"license": "LGPL-3.0+",
|
|
@@ -39,16 +39,17 @@
|
|
|
39
39
|
"homepage": "https://github.com/sockethub/sockethub/tree/master/packages/platform-metadata",
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "bun build src/index.ts --outdir dist --target node --format esm --sourcemap=external",
|
|
42
|
-
"clean": "rm -rf dist"
|
|
42
|
+
"clean": "rm -rf dist",
|
|
43
|
+
"clean:deps": "rm -rf node_modules"
|
|
43
44
|
},
|
|
44
45
|
"dependencies": {
|
|
45
46
|
"open-graph-scraper": "^6.11.0"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
|
-
"@sockethub/schemas": "^3.0.0-alpha.
|
|
49
|
+
"@sockethub/schemas": "^3.0.0-alpha.11"
|
|
49
50
|
},
|
|
50
51
|
"peerDependencies": {
|
|
51
|
-
"@sockethub/server": "^5.0.0-alpha.
|
|
52
|
+
"@sockethub/server": "^5.0.0-alpha.11"
|
|
52
53
|
},
|
|
53
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "c243fa9e76c688ce5ffcf524400b1dd27dcce615"
|
|
54
55
|
}
|
package/src/index.ts
CHANGED
|
@@ -10,20 +10,27 @@ import ogs from "open-graph-scraper";
|
|
|
10
10
|
import { PlatformMetadataSchema } from "./schema";
|
|
11
11
|
|
|
12
12
|
export default class Metadata implements PlatformInterface {
|
|
13
|
-
readonly
|
|
13
|
+
private readonly log: Logger;
|
|
14
14
|
config: PlatformConfig = {
|
|
15
15
|
persist: false,
|
|
16
16
|
};
|
|
17
17
|
constructor(session: PlatformSession) {
|
|
18
|
-
this.
|
|
18
|
+
this.log = session.log;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
get schema() {
|
|
22
22
|
return PlatformMetadataSchema;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Stateless platforms are always ready to handle jobs.
|
|
27
|
+
*/
|
|
28
|
+
isInitialized(): boolean {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
|
|
25
32
|
fetch(job: ActivityStream, cb: PlatformCallback) {
|
|
26
|
-
this.debug(`fetching ${job.actor.id}`);
|
|
33
|
+
this.log.debug(`fetching ${job.actor.id}`);
|
|
27
34
|
ogs({
|
|
28
35
|
url: job.actor.id,
|
|
29
36
|
})
|