@tryghost/mg-json 0.11.6 → 0.11.7
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
2
|
import {slugify} from '@tryghost/string';
|
|
3
|
-
import
|
|
3
|
+
import {decode} from 'html-entities';
|
|
4
4
|
/**
|
|
5
5
|
* Hydrate Ghost objects
|
|
6
6
|
* Extend object with the minimum data needed for an import to succeed
|
|
@@ -91,7 +91,7 @@ const hydratePost = (input, options) => {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
// Cleanup titles
|
|
94
|
-
input.title =
|
|
94
|
+
input.title = decode(input.title);
|
|
95
95
|
|
|
96
96
|
// @TODO: log some sort of warning for things like this?
|
|
97
97
|
if (!_.includes(['published', 'draft', 'scheduled'], input.status)) {
|
|
@@ -41,7 +41,14 @@ export default async (json, ctx = null) => {
|
|
|
41
41
|
|
|
42
42
|
if (json?.users?.length) {
|
|
43
43
|
for await (const [index, item] of json.users.entries()) {
|
|
44
|
-
|
|
44
|
+
let isEmailValid = false;
|
|
45
|
+
|
|
46
|
+
try {
|
|
47
|
+
isEmailValid = await emailValidator(item.data.email);
|
|
48
|
+
} catch (error) {
|
|
49
|
+
// Silently fail here as we don't want to break the migration
|
|
50
|
+
// Just fall back to the <user-slug>@example.com
|
|
51
|
+
}
|
|
45
52
|
|
|
46
53
|
if (!isEmailValid) {
|
|
47
54
|
item.data.email = `${slugify(item?.data?.slug || item?.data?.name || 'author')}@example.com`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tryghost/mg-json",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.7",
|
|
4
4
|
"repository": "https://github.com/TryGhost/migrate/tree/main/packages/mg-json",
|
|
5
5
|
"author": "Ghost Foundation",
|
|
6
6
|
"license": "MIT",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@tryghost/string": "0.2.12",
|
|
29
29
|
"bson-objectid": "2.0.4",
|
|
30
|
-
"html-entities": "2.
|
|
30
|
+
"html-entities": "2.6.0",
|
|
31
31
|
"lodash": "4.17.21",
|
|
32
32
|
"node-email-verifier": "2.0.0"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "e3a0a2184439eb672dedb18311cc6bcaebe4e334"
|
|
35
35
|
}
|