@tryghost/mg-ghost-api 0.4.24 → 0.4.26
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 +8 -7
- package/lib/fetch.js +4 -4
- package/package.json +5 -5
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Migrate Ghost API
|
|
2
2
|
|
|
3
|
-
Export content from an existing Ghost installation using the [Admin API](https://ghost.org/
|
|
3
|
+
Export content from an existing Ghost installation using the [Admin API](https://docs.ghost.org/admin-api), and generate a `zip` file you can import into a Ghost installation.
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
## Install
|
|
@@ -45,10 +45,11 @@ It's possible to pass more options, in order to achieve a better migration file
|
|
|
45
45
|
- **`-s` `--scrape`**
|
|
46
46
|
- Configure scraping tasks
|
|
47
47
|
- string - default: `all`
|
|
48
|
-
- Choices: `all`, `
|
|
49
|
-
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
- Choices: `all`, `web`, `assets`, `none`
|
|
49
|
+
- `all`: Scrape web metadata and download assets
|
|
50
|
+
- `web`: Only scrape metadata from web pages
|
|
51
|
+
- `assets`: Only download assets (images, media, files)
|
|
52
|
+
- `none`: Skip all scraping tasks
|
|
52
53
|
- **`-I` `--info`**
|
|
53
54
|
- bool - default: `false`
|
|
54
55
|
- Show initalisation info only
|
|
@@ -82,7 +83,7 @@ migrate ghost --url https://example.com --apikey 1234abcd --batch 5 --limit 10 -
|
|
|
82
83
|
|
|
83
84
|
This will get the first 50 posts with the tag `news` or `press`, in 5 batches of 10 posts, exclude pages, and show all available output in the console.
|
|
84
85
|
|
|
85
|
-
See the [Filter documentation](https://ghost.org/
|
|
86
|
+
See the [Filter documentation](https://docs.ghost.org/content-api/filtering) for more info.
|
|
86
87
|
|
|
87
88
|
|
|
88
89
|
## Develop
|
|
@@ -111,4 +112,4 @@ yarn dev ghost --url https://example.com --apikey 1234abcd
|
|
|
111
112
|
|
|
112
113
|
# Copyright & License
|
|
113
114
|
|
|
114
|
-
Copyright (c) 2013-
|
|
115
|
+
Copyright (c) 2013-2026 Ghost Foundation - Released under the [MIT license](LICENSE).
|
package/lib/fetch.js
CHANGED
|
@@ -3,7 +3,7 @@ import ghostAPI from '@tryghost/admin-api';
|
|
|
3
3
|
const contentStats = async (options) => {
|
|
4
4
|
const requestOptions = {
|
|
5
5
|
url: options.url,
|
|
6
|
-
version: '
|
|
6
|
+
version: 'v6.0',
|
|
7
7
|
key: options.apikey
|
|
8
8
|
};
|
|
9
9
|
|
|
@@ -24,14 +24,14 @@ const contentStats = async (options) => {
|
|
|
24
24
|
const discover = async (options) => {
|
|
25
25
|
const requestOptions = {
|
|
26
26
|
url: options.url,
|
|
27
|
-
version: '
|
|
27
|
+
version: 'v6.0',
|
|
28
28
|
key: options.apikey
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
const site = new ghostAPI(requestOptions);
|
|
32
32
|
|
|
33
|
-
const posts = (options.posts) ? await site.posts.browse({limit: options.limit}) : null;
|
|
34
|
-
const pages = (options.pages) ? await site.pages.browse({limit: options.limit}) : null;
|
|
33
|
+
const posts = (options.posts) ? await site.posts.browse({limit: options.limit, filter: options?.postFilter ?? null}) : null;
|
|
34
|
+
const pages = (options.pages) ? await site.pages.browse({limit: options.limit, filter: options?.postFilter ?? null}) : null;
|
|
35
35
|
const users = await site.users.browse({limit: options.limit});
|
|
36
36
|
|
|
37
37
|
return {
|
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.26",
|
|
4
4
|
"repository": "https://github.com/TryGhost/migrate/tree/main/packages/mg-ghost-api",
|
|
5
5
|
"author": "Ghost Foundation",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"eslint": "8.57.0",
|
|
24
|
-
"jest": "30.0
|
|
25
|
-
"jest-extended": "
|
|
24
|
+
"jest": "30.2.0",
|
|
25
|
+
"jest-extended": "7.0.0"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@tryghost/admin-api": "1.14.
|
|
28
|
+
"@tryghost/admin-api": "1.14.4"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "ac9a868976ef5963df7fc2426af9e298bd5d8666"
|
|
31
31
|
}
|