@tryghost/mg-ghost-api 0.4.9 → 0.4.10
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/LICENSE +1 -1
- package/README.md +1 -1
- package/lib/fetch.js +4 -2
- package/lib/processor.js +6 -0
- package/package.json +6 -6
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -111,4 +111,4 @@ yarn dev ghost --url https://example.com --apikey 1234abcd
|
|
|
111
111
|
|
|
112
112
|
# Copyright & License
|
|
113
113
|
|
|
114
|
-
Copyright (c) 2013-
|
|
114
|
+
Copyright (c) 2013-2023 Ghost Foundation - Released under the [MIT license](LICENSE).
|
package/lib/fetch.js
CHANGED
|
@@ -59,12 +59,14 @@ const cachedFetch = async (fileCache, api, type, options, page) => {
|
|
|
59
59
|
let response = null;
|
|
60
60
|
|
|
61
61
|
const postParams = {
|
|
62
|
+
formats: 'html',
|
|
62
63
|
limit: options.limit,
|
|
63
64
|
page: page,
|
|
64
65
|
filter: options.postFilter || null
|
|
65
66
|
};
|
|
66
67
|
|
|
67
68
|
const pageParams = {
|
|
69
|
+
formats: 'html',
|
|
68
70
|
limit: options.limit,
|
|
69
71
|
page: page,
|
|
70
72
|
filter: options.pageFilter || null
|
|
@@ -76,12 +78,12 @@ const cachedFetch = async (fileCache, api, type, options, page) => {
|
|
|
76
78
|
};
|
|
77
79
|
|
|
78
80
|
if (type === 'posts') {
|
|
79
|
-
response = await api.site.posts.browse(postParams);
|
|
81
|
+
response = await api.site.posts.browse(postParams, {source: 'html'});
|
|
80
82
|
response.forEach((item) => {
|
|
81
83
|
item.type = 'post';
|
|
82
84
|
});
|
|
83
85
|
} else if (type === 'pages') {
|
|
84
|
-
response = await api.site.pages.browse(pageParams);
|
|
86
|
+
response = await api.site.pages.browse(pageParams, {source: 'html'});
|
|
85
87
|
response.forEach((item) => {
|
|
86
88
|
item.type = 'page';
|
|
87
89
|
});
|
package/lib/processor.js
CHANGED
|
@@ -37,6 +37,12 @@ const processPost = (ghPost) => {
|
|
|
37
37
|
delete post.data.tags;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
delete post.data.tiers;
|
|
41
|
+
delete post.data.post_revisions;
|
|
42
|
+
delete post.data.count;
|
|
43
|
+
delete post.data.primary_author;
|
|
44
|
+
delete post.data.primary_tag;
|
|
45
|
+
|
|
40
46
|
return post;
|
|
41
47
|
};
|
|
42
48
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tryghost/mg-ghost-api",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.10",
|
|
4
4
|
"repository": "https://github.com/TryGhost/migrate/tree/main/packages/mg-ghost-api",
|
|
5
5
|
"author": "Ghost Foundation",
|
|
6
6
|
"license": "MIT",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"type": "module",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"dev": "echo \"Implement me!\"",
|
|
11
|
-
"test": "
|
|
11
|
+
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
|
|
12
12
|
"lint": "eslint . --ext .js --cache",
|
|
13
13
|
"posttest": "yarn lint"
|
|
14
14
|
},
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"access": "public"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"eslint": "8.
|
|
24
|
-
"jest": "29.
|
|
23
|
+
"eslint": "8.47.0",
|
|
24
|
+
"jest": "29.6.2",
|
|
25
25
|
"jest-extended": "3.2.4"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@tryghost/admin-api": "1.13.
|
|
28
|
+
"@tryghost/admin-api": "1.13.8"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "0df990176ed00c9076d1bec7ddafa2a6b2ddd967"
|
|
31
31
|
}
|