@sockethub/platform-metadata 1.0.1-alpha.6 → 1.0.1-alpha.7
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/README.md +17 -7
- package/dist/index.js +35 -7
- package/dist/index.js.map +3 -3
- package/package.json +4 -4
- package/src/schema.ts +12 -0
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This platform fetches and extracts metadata from web pages, including Open Graph
|
|
|
8
8
|
site information, images, and other structured metadata. It uses the `open-graph-scraper`
|
|
9
9
|
library to analyze web pages and return structured data in ActivityStreams format.
|
|
10
10
|
|
|
11
|
-
## Implemented Verbs (
|
|
11
|
+
## Implemented Verbs (`type`)
|
|
12
12
|
|
|
13
13
|
* **fetch** - Extract metadata from a web page URL
|
|
14
14
|
|
|
@@ -21,10 +21,15 @@ to clients through the Sockethub service.
|
|
|
21
21
|
|
|
22
22
|
```json
|
|
23
23
|
{
|
|
24
|
-
"
|
|
25
|
-
"context":
|
|
24
|
+
"type": "fetch",
|
|
25
|
+
"@context": [
|
|
26
|
+
"https://www.w3.org/ns/activitystreams",
|
|
27
|
+
"https://sockethub.org/ns/context/v1.jsonld",
|
|
28
|
+
"https://sockethub.org/ns/context/platform/metadata/v1.jsonld"
|
|
29
|
+
],
|
|
26
30
|
"actor": {
|
|
27
|
-
"
|
|
31
|
+
"id": "https://example.com/page-to-analyze",
|
|
32
|
+
"type": "website"
|
|
28
33
|
}
|
|
29
34
|
}
|
|
30
35
|
```
|
|
@@ -35,10 +40,15 @@ The platform returns an ActivityStream object with extracted metadata:
|
|
|
35
40
|
|
|
36
41
|
```json
|
|
37
42
|
{
|
|
38
|
-
"
|
|
39
|
-
"context":
|
|
43
|
+
"type": "fetch",
|
|
44
|
+
"@context": [
|
|
45
|
+
"https://www.w3.org/ns/activitystreams",
|
|
46
|
+
"https://sockethub.org/ns/context/v1.jsonld",
|
|
47
|
+
"https://sockethub.org/ns/context/platform/metadata/v1.jsonld"
|
|
48
|
+
],
|
|
40
49
|
"actor": {
|
|
41
|
-
"
|
|
50
|
+
"id": "https://example.com/page-to-analyze",
|
|
51
|
+
"type": "website",
|
|
42
52
|
"name": "Example Site"
|
|
43
53
|
},
|
|
44
54
|
"object": {
|
package/dist/index.js
CHANGED
|
@@ -4,15 +4,29 @@ var __getProtoOf = Object.getPrototypeOf;
|
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
function __accessProp(key) {
|
|
8
|
+
return this[key];
|
|
9
|
+
}
|
|
10
|
+
var __toESMCache_node;
|
|
11
|
+
var __toESMCache_esm;
|
|
7
12
|
var __toESM = (mod, isNodeMode, target) => {
|
|
13
|
+
var canCache = mod != null && typeof mod === "object";
|
|
14
|
+
if (canCache) {
|
|
15
|
+
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
16
|
+
var cached = cache.get(mod);
|
|
17
|
+
if (cached)
|
|
18
|
+
return cached;
|
|
19
|
+
}
|
|
8
20
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
9
21
|
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
10
22
|
for (let key of __getOwnPropNames(mod))
|
|
11
23
|
if (!__hasOwnProp.call(to, key))
|
|
12
24
|
__defProp(to, key, {
|
|
13
|
-
get: (
|
|
25
|
+
get: __accessProp.bind(mod, key),
|
|
14
26
|
enumerable: true
|
|
15
27
|
});
|
|
28
|
+
if (canCache)
|
|
29
|
+
cache.set(mod, to);
|
|
16
30
|
return to;
|
|
17
31
|
};
|
|
18
32
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
@@ -71634,7 +71648,7 @@ var import_open_graph_scraper = __toESM(require_esm(), 1);
|
|
|
71634
71648
|
// package.json
|
|
71635
71649
|
var package_default = {
|
|
71636
71650
|
name: "@sockethub/platform-metadata",
|
|
71637
|
-
version: "1.0.1-alpha.
|
|
71651
|
+
version: "1.0.1-alpha.7",
|
|
71638
71652
|
description: "Fetch metadata from a given URL",
|
|
71639
71653
|
author: "Nick Jennings <nick@silverbucket.net>",
|
|
71640
71654
|
license: "LGPL-3.0+",
|
|
@@ -71650,7 +71664,10 @@ var package_default = {
|
|
|
71650
71664
|
default: "./dist/index.js"
|
|
71651
71665
|
}
|
|
71652
71666
|
},
|
|
71653
|
-
files: [
|
|
71667
|
+
files: [
|
|
71668
|
+
"src/",
|
|
71669
|
+
"dist/"
|
|
71670
|
+
],
|
|
71654
71671
|
engines: {
|
|
71655
71672
|
bun: ">=1.2"
|
|
71656
71673
|
},
|
|
@@ -71677,12 +71694,12 @@ var package_default = {
|
|
|
71677
71694
|
"open-graph-scraper": "^6.11.0"
|
|
71678
71695
|
},
|
|
71679
71696
|
devDependencies: {
|
|
71680
|
-
"@sockethub/schemas": "^3.0.0-alpha.
|
|
71697
|
+
"@sockethub/schemas": "^3.0.0-alpha.12"
|
|
71681
71698
|
},
|
|
71682
71699
|
peerDependencies: {
|
|
71683
|
-
"@sockethub/server": "^5.0.0-alpha.
|
|
71700
|
+
"@sockethub/server": "^5.0.0-alpha.12"
|
|
71684
71701
|
},
|
|
71685
|
-
gitHead: "
|
|
71702
|
+
gitHead: "cc495a5fcf7ce19a8f328a34bbc8cd1439bb67ce"
|
|
71686
71703
|
};
|
|
71687
71704
|
|
|
71688
71705
|
// src/schema.ts
|
|
@@ -71690,6 +71707,9 @@ var version = package_default.version;
|
|
|
71690
71707
|
var PlatformMetadataSchema = {
|
|
71691
71708
|
name: "metadata",
|
|
71692
71709
|
version,
|
|
71710
|
+
contextUrl: "https://sockethub.org/ns/context/platform/metadata/v1.jsonld",
|
|
71711
|
+
contextVersion: "1",
|
|
71712
|
+
schemaVersion: "1",
|
|
71693
71713
|
messages: {
|
|
71694
71714
|
required: ["type"],
|
|
71695
71715
|
properties: {
|
|
@@ -71703,6 +71723,14 @@ var PlatformMetadataSchema = {
|
|
|
71703
71723
|
{ $ref: "#/definitions/objectTypes/feed-parameters-url" }
|
|
71704
71724
|
]
|
|
71705
71725
|
}
|
|
71726
|
+
},
|
|
71727
|
+
definitions: {
|
|
71728
|
+
objectTypes: {
|
|
71729
|
+
"feed-parameters-url": {
|
|
71730
|
+
type: "object",
|
|
71731
|
+
additionalProperties: true
|
|
71732
|
+
}
|
|
71733
|
+
}
|
|
71706
71734
|
}
|
|
71707
71735
|
}
|
|
71708
71736
|
};
|
|
@@ -71755,4 +71783,4 @@ export {
|
|
|
71755
71783
|
Metadata as default
|
|
71756
71784
|
};
|
|
71757
71785
|
|
|
71758
|
-
//# debugId=
|
|
71786
|
+
//# debugId=036456F5F961839664756E2164756E21
|