@tryghost/mg-ghost-api 0.4.21 → 0.4.23
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/lib/fetch.js +5 -6
- package/package.json +5 -5
package/lib/fetch.js
CHANGED
|
@@ -96,7 +96,7 @@ const cachedFetch = async (fileCache, api, type, options, page) => {
|
|
|
96
96
|
return response;
|
|
97
97
|
};
|
|
98
98
|
|
|
99
|
-
const buildTasks = (fileCache, tasks, api, type, options
|
|
99
|
+
const buildTasks = (fileCache, tasks, api, type, options) => {
|
|
100
100
|
for (let page = 1; page <= api.batches[type]; page++) {
|
|
101
101
|
tasks.push({
|
|
102
102
|
title: `Fetching ${type}, page ${page} of ${api.batches[type]}`,
|
|
@@ -109,7 +109,7 @@ const buildTasks = (fileCache, tasks, api, type, options, logger) => {
|
|
|
109
109
|
|
|
110
110
|
ctx.result[type] = ctx.result[type].concat(response);
|
|
111
111
|
} catch (error) {
|
|
112
|
-
|
|
112
|
+
console.error(`Failed to fetch ${type}, page ${page} of ${api.batches[type]}`, error); // eslint-disable-line no-console
|
|
113
113
|
throw error;
|
|
114
114
|
}
|
|
115
115
|
}
|
|
@@ -119,7 +119,6 @@ const buildTasks = (fileCache, tasks, api, type, options, logger) => {
|
|
|
119
119
|
|
|
120
120
|
const tasks = async (options, ctx) => {
|
|
121
121
|
const {limit} = ctx.options;
|
|
122
|
-
const {logger} = ctx;
|
|
123
122
|
|
|
124
123
|
const api = await discover(options, {limit});
|
|
125
124
|
|
|
@@ -130,9 +129,9 @@ const tasks = async (options, ctx) => {
|
|
|
130
129
|
users: []
|
|
131
130
|
};
|
|
132
131
|
|
|
133
|
-
buildTasks(ctx.fileCache, tasks, api, 'posts', options
|
|
134
|
-
buildTasks(ctx.fileCache, tasks, api, 'pages', options
|
|
135
|
-
buildTasks(ctx.fileCache, tasks, api, 'users', options
|
|
132
|
+
buildTasks(ctx.fileCache, tasks, api, 'posts', options);
|
|
133
|
+
buildTasks(ctx.fileCache, tasks, api, 'pages', options);
|
|
134
|
+
buildTasks(ctx.fileCache, tasks, api, 'users', options);
|
|
136
135
|
|
|
137
136
|
return tasks;
|
|
138
137
|
};
|
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.23",
|
|
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": "
|
|
25
|
-
"jest-extended": "
|
|
24
|
+
"jest": "30.0.5",
|
|
25
|
+
"jest-extended": "6.0.0"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@tryghost/admin-api": "1.
|
|
28
|
+
"@tryghost/admin-api": "1.14.0"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "89e6e38587face966cdfadfbbc74aef95c594c7c"
|
|
31
31
|
}
|