@chronicle.app/google-reader 0.3.0 → 0.4.0
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 +1 -1
- package/dist/connectors/GoogleReaderTransformer.js +15 -21
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ reader-archive/
|
|
|
22
22
|
|
|
23
23
|
Each stream JSON has an `items` array. Items carry `id`, `title`, a microsecond `timestampUsec` string, and `categories` such as `user/123/state/com.google/read`. Optional `alternate`, `content`/`summary`, and `annotations` supply article URLs, bodies, and notes. Other archive files are ignored; this plugin does not parse OPML, ZIP files, preferences, or separate friend-activity files.
|
|
24
24
|
|
|
25
|
-
The archive owner's ID comes from `user_id` in `data/user-info.json`; `user_name` and `email` provide optional profile details. Use `--user-id 123` to explicitly select your account, including when user info is missing. This also restricts stream filenames to that user. Only that account's states and annotations become actions, and only that account is linked to `@me`.
|
|
25
|
+
The archive owner's ID comes from `user_id` in `data/user-info.json`; `user_name` and `email` provide optional profile details. Use `--user-id 123` to explicitly select your account, including when user info is missing. This also restricts stream filenames to that user. Only that account's states and annotations become actions, and only that account is linked to `@me`. When matching user info supplies an email, the owner also links to an `email` identity and a `google-account` identity, both keyed by that address, as Gmail, Google Calendar, and Chrome key you. These `sameAs` references resolve to the same entity on import; no email identity is inferred when the address is missing.
|
|
26
26
|
|
|
27
27
|
`--since` and `--until` are inclusive bounds on the item's `timestampUsec`. `--limit` caps matching raw items across all files, not generated actions; `0` means unlimited. Files are processed in filename order, not chronological order. Invalid stream JSON or item timestamps fail the extraction rather than silently dropping a file.
|
|
28
28
|
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { ChronicleTransformer, selfAgent } from '@chronicle.app/etl';
|
|
2
|
+
import { googleAccount } from '@chronicle.app/google';
|
|
2
3
|
export default class GoogleReaderTransformer extends ChronicleTransformer {
|
|
3
4
|
async transform(record) {
|
|
4
|
-
this.logger.debug('Transforming google-reader record', {
|
|
5
|
-
recordType: record.extraction.recordType,
|
|
6
|
-
});
|
|
7
5
|
const actions = [];
|
|
8
6
|
if (record.extraction.recordType === 'stream-contents') {
|
|
9
7
|
actions.push(...this.buildStreamContentActions(record));
|
|
10
8
|
}
|
|
11
|
-
this.logger.verboseInfo(`Generated ${actions.length} actions from google-reader record`);
|
|
12
9
|
return actions;
|
|
13
10
|
}
|
|
14
11
|
buildStreamContentActions(record) {
|
|
@@ -92,23 +89,20 @@ export default class GoogleReaderTransformer extends ChronicleTransformer {
|
|
|
92
89
|
const profile = userInfo?.user_id === userId ? userInfo : null;
|
|
93
90
|
const email = profile?.email?.trim() || undefined;
|
|
94
91
|
const name = profile?.user_name;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
sourceId: userId,
|
|
110
|
-
...(name && { name }),
|
|
111
|
-
});
|
|
92
|
+
// Your address, and the Google account it is, keyed by that address as
|
|
93
|
+
// Gmail, Google Calendar, and Chrome key it.
|
|
94
|
+
const sameAs = email
|
|
95
|
+
? [
|
|
96
|
+
{
|
|
97
|
+
'@type': 'Agent',
|
|
98
|
+
'@key': ['@type', 'source', 'handle'],
|
|
99
|
+
source: 'email',
|
|
100
|
+
handle: email.toLowerCase(),
|
|
101
|
+
...(name && { name }),
|
|
102
|
+
},
|
|
103
|
+
googleAccount(email),
|
|
104
|
+
]
|
|
105
|
+
: [];
|
|
112
106
|
return selfAgent({
|
|
113
107
|
type: 'Agent',
|
|
114
108
|
source: 'google-reader',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chronicle.app/google-reader",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"type": "module",
|
|
23
23
|
"description": "Import personal actions from Google Reader archive streams",
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@chronicle.app/etl": "0.
|
|
26
|
-
"@chronicle.app/schema": "0.
|
|
27
|
-
"@chronicle.app/tsconfig": "0.
|
|
25
|
+
"@chronicle.app/etl": "0.4.0",
|
|
26
|
+
"@chronicle.app/schema": "0.4.0",
|
|
27
|
+
"@chronicle.app/tsconfig": "0.4.0",
|
|
28
28
|
"@types/node": "^22.10.1",
|
|
29
29
|
"typescript": "^5.7.2"
|
|
30
30
|
},
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"registry": "https://registry.npmjs.org/"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
+
"@chronicle.app/google": "0.4.0",
|
|
42
43
|
"zod": "^3.24.1"
|
|
43
44
|
},
|
|
44
45
|
"peerDependencies": {
|