@tryghost/mg-ghost-api 0.4.21 → 0.4.22

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.
Files changed (2) hide show
  1. package/lib/fetch.js +5 -6
  2. 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, logger) => {
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
- logger.error({message: `Failed to fetch ${type}, page ${page} of ${api.batches[type]}`, error});
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, logger);
134
- buildTasks(ctx.fileCache, tasks, api, 'pages', options, logger);
135
- buildTasks(ctx.fileCache, tasks, api, 'users', options, logger);
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.21",
3
+ "version": "0.4.22",
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": "29.7.0",
25
- "jest-extended": "4.0.2"
24
+ "jest": "30.0.3",
25
+ "jest-extended": "6.0.0"
26
26
  },
27
27
  "dependencies": {
28
- "@tryghost/admin-api": "1.13.13"
28
+ "@tryghost/admin-api": "1.13.17"
29
29
  },
30
- "gitHead": "e3a0a2184439eb672dedb18311cc6bcaebe4e334"
30
+ "gitHead": "958389c2c9667c0e7e44f983d4fd1aa256caff4d"
31
31
  }