@automattic/vip 2.22.0 → 2.23.0
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/CHANGELOG.md +7 -0
- package/automattic-vip-2.23.0.tgz +0 -0
- package/dist/bin/vip-app-list.js +0 -12
- package/dist/bin/vip-app.js +6 -13
- package/dist/bin/vip-cache-purge-url.js +4 -19
- package/dist/bin/vip-cache.js +0 -2
- package/dist/bin/vip-config-envvar-delete.js +4 -19
- package/dist/bin/vip-config-envvar-get-all.js +6 -19
- package/dist/bin/vip-config-envvar-get.js +4 -15
- package/dist/bin/vip-config-envvar-list.js +8 -20
- package/dist/bin/vip-config-envvar-set.js +4 -23
- package/dist/bin/vip-config-envvar.js +0 -2
- package/dist/bin/vip-config-software-get.js +0 -17
- package/dist/bin/vip-config-software-update.js +6 -22
- package/dist/bin/vip-config-software.js +0 -2
- package/dist/bin/vip-config.js +0 -2
- package/dist/bin/vip-dev-env-create.js +0 -18
- package/dist/bin/vip-dev-env-destroy.js +0 -9
- package/dist/bin/vip-dev-env-exec.js +0 -12
- package/dist/bin/vip-dev-env-import-media.js +0 -7
- package/dist/bin/vip-dev-env-import-sql.js +2 -17
- package/dist/bin/vip-dev-env-import.js +0 -3
- package/dist/bin/vip-dev-env-info.js +0 -10
- package/dist/bin/vip-dev-env-list.js +0 -7
- package/dist/bin/vip-dev-env-start.js +4 -14
- package/dist/bin/vip-dev-env-stop.js +0 -9
- package/dist/bin/vip-dev-env-update.js +0 -11
- package/dist/bin/vip-dev-env.js +0 -2
- package/dist/bin/vip-import-media-abort.js +0 -18
- package/dist/bin/vip-import-media-status.js +0 -12
- package/dist/bin/vip-import-media.js +6 -23
- package/dist/bin/vip-import-sql-status.js +0 -12
- package/dist/bin/vip-import-sql.js +33 -99
- package/dist/bin/vip-import-validate-files.js +21 -42
- package/dist/bin/vip-import-validate-sql.js +0 -8
- package/dist/bin/vip-import.js +0 -3
- package/dist/bin/vip-logs.js +20 -50
- package/dist/bin/vip-search-replace.js +8 -14
- package/dist/bin/vip-sync.js +2 -25
- package/dist/bin/vip-validate-preflight.js +427 -0
- package/dist/bin/vip-validate.js +19 -0
- package/dist/bin/vip-whoami.js +2 -14
- package/dist/bin/vip-wp.js +39 -89
- package/dist/bin/vip.js +5 -35
- package/dist/lib/analytics/clients/pendo.js +9 -18
- package/dist/lib/analytics/clients/stub.js +1 -3
- package/dist/lib/analytics/clients/tracks.js +11 -20
- package/dist/lib/analytics/index.js +4 -11
- package/dist/lib/api/app.js +1 -11
- package/dist/lib/api/cache-purge.js +4 -7
- package/dist/lib/api/feature-flags.js +1 -4
- package/dist/lib/api/http.js +9 -15
- package/dist/lib/api/user.js +1 -7
- package/dist/lib/api.js +7 -18
- package/dist/lib/app-logs/app-logs.js +2 -9
- package/dist/lib/app.js +2 -5
- package/dist/lib/cli/apiConfig.js +4 -19
- package/dist/lib/cli/command.js +43 -133
- package/dist/lib/cli/config.js +1 -5
- package/dist/lib/cli/envAlias.js +14 -15
- package/dist/lib/cli/exit.js +4 -6
- package/dist/lib/cli/format.js +8 -50
- package/dist/lib/cli/progress.js +13 -42
- package/dist/lib/cli/prompt.js +1 -5
- package/dist/lib/cli/repo.js +7 -20
- package/dist/lib/client-file-uploader.js +44 -97
- package/dist/lib/config/software.js +2 -52
- package/dist/lib/constants/dev-environment.js +1 -2
- package/dist/lib/constants/file-size.js +1 -1
- package/dist/lib/constants/vipgo.js +1 -1
- package/dist/lib/dev-environment/dev-environment-cli.js +31 -134
- package/dist/lib/dev-environment/dev-environment-core.js +63 -171
- package/dist/lib/dev-environment/dev-environment-lando.js +16 -71
- package/dist/lib/env.js +1 -4
- package/dist/lib/envvar/api-delete.js +1 -4
- package/dist/lib/envvar/api-get-all.js +1 -4
- package/dist/lib/envvar/api-get.js +1 -2
- package/dist/lib/envvar/api-list.js +3 -4
- package/dist/lib/envvar/api-set.js +1 -4
- package/dist/lib/envvar/api.js +5 -16
- package/dist/lib/envvar/input.js +1 -8
- package/dist/lib/envvar/logging.js +2 -6
- package/dist/lib/envvar/read-file.js +1 -3
- package/dist/lib/http/proxy-agent.js +17 -22
- package/dist/lib/keychain/browser.js +1 -4
- package/dist/lib/keychain/insecure.js +1 -10
- package/dist/lib/keychain/secure.js +1 -8
- package/dist/lib/keychain.js +4 -8
- package/dist/lib/logout.js +0 -6
- package/dist/lib/media-import/media-file-import.js +3 -7
- package/dist/lib/media-import/progress.js +6 -17
- package/dist/lib/media-import/status.js +14 -65
- package/dist/lib/read-file.js +1 -6
- package/dist/lib/rollbar.js +1 -7
- package/dist/lib/search-and-replace.js +9 -41
- package/dist/lib/site-import/db-file-import.js +3 -9
- package/dist/lib/site-import/status.js +17 -74
- package/dist/lib/token.js +1 -33
- package/dist/lib/tracker.js +4 -20
- package/dist/lib/user-error.js +0 -2
- package/dist/lib/validations/is-multi-site-sql-dump.js +4 -12
- package/dist/lib/validations/is-multi-site.js +5 -21
- package/dist/lib/validations/is-multisite-domain-mapped.js +5 -31
- package/dist/lib/validations/line-by-line.js +4 -16
- package/dist/lib/validations/site-type.js +10 -19
- package/dist/lib/validations/sql.js +11 -76
- package/dist/lib/validations/utils.js +1 -6
- package/dist/lib/vip-import-validate-files.js +82 -109
- package/npm-shrinkwrap.json +837 -67
- package/package.json +4 -1
|
@@ -11,29 +11,17 @@
|
|
|
11
11
|
"use strict";
|
|
12
12
|
|
|
13
13
|
var _graphqlTag = _interopRequireDefault(require("graphql-tag"));
|
|
14
|
-
|
|
15
14
|
var _chalk = _interopRequireDefault(require("chalk"));
|
|
16
|
-
|
|
17
15
|
var _mediaFileImport = require("../lib/media-import/media-file-import");
|
|
18
|
-
|
|
19
16
|
var _command = _interopRequireDefault(require("../lib/cli/command"));
|
|
20
|
-
|
|
21
17
|
var _api = _interopRequireDefault(require("../lib/api"));
|
|
22
|
-
|
|
23
18
|
var exit = _interopRequireWildcard(require("../lib/cli/exit"));
|
|
24
|
-
|
|
25
19
|
var _tracker = require("../lib/tracker");
|
|
26
|
-
|
|
27
20
|
var _progress = require("../lib/media-import/progress");
|
|
28
|
-
|
|
29
21
|
var _status = require("../lib/media-import/status");
|
|
30
|
-
|
|
31
22
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
32
|
-
|
|
33
23
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
34
|
-
|
|
35
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
36
|
-
|
|
37
25
|
/**
|
|
38
26
|
* Internal dependencies
|
|
39
27
|
*/
|
|
@@ -83,16 +71,13 @@ ${_chalk.default.red.bold('Are you sure you want to abort this Media Import?')}
|
|
|
83
71
|
id: envId,
|
|
84
72
|
appId
|
|
85
73
|
} = env;
|
|
86
|
-
|
|
87
74
|
const track = _tracker.trackEventWithEnv.bind(null, appId, envId);
|
|
88
|
-
|
|
89
75
|
if (!(0, _mediaFileImport.isSupportedApp)(app)) {
|
|
90
76
|
await track('import_media_command_error', {
|
|
91
77
|
errorType: 'unsupported-app'
|
|
92
78
|
});
|
|
93
79
|
exit.withError('The type of application you specified does not currently support Media imports.');
|
|
94
80
|
}
|
|
95
|
-
|
|
96
81
|
const api = await (0, _api.default)();
|
|
97
82
|
await track('import_media_abort_execute');
|
|
98
83
|
const progressTracker = new _progress.MediaImportProgressTracker([]);
|
|
@@ -100,7 +85,6 @@ ${_chalk.default.red.bold('Are you sure you want to abort this Media Import?')}
|
|
|
100
85
|
=============================================================
|
|
101
86
|
Aborting the Media Import running on your App
|
|
102
87
|
`;
|
|
103
|
-
|
|
104
88
|
try {
|
|
105
89
|
await api.mutate({
|
|
106
90
|
mutation: ABORT_IMPORT_MUTATION,
|
|
@@ -121,10 +105,8 @@ Aborting the Media Import running on your App
|
|
|
121
105
|
for (const err of error.graphQLErrors) {
|
|
122
106
|
console.log(_chalk.default.red('Error:'), err.message);
|
|
123
107
|
}
|
|
124
|
-
|
|
125
108
|
return;
|
|
126
109
|
}
|
|
127
|
-
|
|
128
110
|
await track('import_media_abort_execute_error', {
|
|
129
111
|
error: `Error: ${error.message}`
|
|
130
112
|
});
|
|
@@ -11,23 +11,14 @@
|
|
|
11
11
|
"use strict";
|
|
12
12
|
|
|
13
13
|
var _tracker = require("../lib/tracker");
|
|
14
|
-
|
|
15
14
|
var exit = _interopRequireWildcard(require("../lib/cli/exit"));
|
|
16
|
-
|
|
17
15
|
var _mediaFileImport = require("../lib/media-import/media-file-import");
|
|
18
|
-
|
|
19
16
|
var _command = _interopRequireDefault(require("../lib/cli/command"));
|
|
20
|
-
|
|
21
17
|
var _progress = require("../lib/media-import/progress");
|
|
22
|
-
|
|
23
18
|
var _status = require("../lib/media-import/status");
|
|
24
|
-
|
|
25
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
26
|
-
|
|
27
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
28
|
-
|
|
29
21
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
30
|
-
|
|
31
22
|
/**
|
|
32
23
|
* Internal dependencies
|
|
33
24
|
*/
|
|
@@ -59,16 +50,13 @@ const appQuery = `
|
|
|
59
50
|
id: envId,
|
|
60
51
|
appId
|
|
61
52
|
} = env;
|
|
62
|
-
|
|
63
53
|
const track = _tracker.trackEventWithEnv.bind(null, appId, envId);
|
|
64
|
-
|
|
65
54
|
if (!(0, _mediaFileImport.isSupportedApp)(app)) {
|
|
66
55
|
await track('import_media_command_error', {
|
|
67
56
|
errorType: 'unsupported-app'
|
|
68
57
|
});
|
|
69
58
|
exit.withError('The type of application you specified does not currently support this feature');
|
|
70
59
|
}
|
|
71
|
-
|
|
72
60
|
await track('import_media_check_status_command_execute');
|
|
73
61
|
const progressTracker = new _progress.MediaImportProgressTracker([]);
|
|
74
62
|
progressTracker.prefix = `
|
|
@@ -11,25 +11,15 @@
|
|
|
11
11
|
"use strict";
|
|
12
12
|
|
|
13
13
|
var _graphqlTag = _interopRequireDefault(require("graphql-tag"));
|
|
14
|
-
|
|
15
14
|
var _debug = _interopRequireDefault(require("debug"));
|
|
16
|
-
|
|
17
15
|
var _chalk = _interopRequireDefault(require("chalk"));
|
|
18
|
-
|
|
19
16
|
var _command = _interopRequireDefault(require("../lib/cli/command"));
|
|
20
|
-
|
|
21
17
|
var _api = _interopRequireDefault(require("../lib/api"));
|
|
22
|
-
|
|
23
18
|
var _tracker = require("../lib/tracker");
|
|
24
|
-
|
|
25
19
|
var _format = require("../lib/cli/format");
|
|
26
|
-
|
|
27
20
|
var _progress = require("../lib/media-import/progress");
|
|
28
|
-
|
|
29
21
|
var _status = require("../lib/media-import/status");
|
|
30
|
-
|
|
31
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
32
|
-
|
|
33
23
|
/**
|
|
34
24
|
* Internal dependencies
|
|
35
25
|
*/
|
|
@@ -60,33 +50,32 @@ const START_IMPORT_MUTATION = (0, _graphqlTag.default)`
|
|
|
60
50
|
}
|
|
61
51
|
}
|
|
62
52
|
`;
|
|
63
|
-
const debug = (0, _debug.default)('vip:vip-import-media');
|
|
53
|
+
const debug = (0, _debug.default)('vip:vip-import-media');
|
|
64
54
|
|
|
55
|
+
// Command examples for the `vip import media` help prompt
|
|
65
56
|
const examples = [{
|
|
66
57
|
usage: 'vip import media @mysite.production https://<path_to_publicly_accessible_archive>',
|
|
67
58
|
description: 'Start a media import with the contents of the archive file in the URL'
|
|
68
|
-
},
|
|
59
|
+
},
|
|
60
|
+
// `media status` subcommand
|
|
69
61
|
{
|
|
70
62
|
usage: 'vip import media status @mysite.production',
|
|
71
63
|
description: 'Check the status of the most recent import. If an import is running, this will poll until it is complete.'
|
|
72
|
-
},
|
|
64
|
+
},
|
|
65
|
+
// `media abort` subcommand
|
|
73
66
|
{
|
|
74
67
|
usage: 'vip import media abort @mysite.production',
|
|
75
68
|
description: 'Abort an ongoing import'
|
|
76
69
|
}];
|
|
77
|
-
|
|
78
70
|
function isSupportedUrl(urlToTest) {
|
|
79
71
|
let url;
|
|
80
|
-
|
|
81
72
|
try {
|
|
82
73
|
url = new URL(urlToTest);
|
|
83
74
|
} catch (err) {
|
|
84
75
|
return false;
|
|
85
76
|
}
|
|
86
|
-
|
|
87
77
|
return url.protocol === 'http:' || url.protocol === 'https:';
|
|
88
78
|
}
|
|
89
|
-
|
|
90
79
|
(0, _command.default)({
|
|
91
80
|
appContext: true,
|
|
92
81
|
appQuery,
|
|
@@ -109,7 +98,6 @@ Are you sure you want to import the contents of the url?
|
|
|
109
98
|
importIntermediateImages
|
|
110
99
|
} = opts;
|
|
111
100
|
const [url] = args;
|
|
112
|
-
|
|
113
101
|
if (!isSupportedUrl(url)) {
|
|
114
102
|
console.log(_chalk.default.red(`
|
|
115
103
|
Error:
|
|
@@ -117,9 +105,7 @@ Error:
|
|
|
117
105
|
Please make sure that it is a publicly accessible web URL containing an archive of the media files to import`));
|
|
118
106
|
return;
|
|
119
107
|
}
|
|
120
|
-
|
|
121
108
|
const track = _tracker.trackEventWithEnv.bind(null, app.id, env.id);
|
|
122
|
-
|
|
123
109
|
const api = await (0, _api.default)();
|
|
124
110
|
debug('Options: ', opts);
|
|
125
111
|
debug('Args:', args);
|
|
@@ -132,7 +118,6 @@ Importing Media into your App...
|
|
|
132
118
|
console.log();
|
|
133
119
|
console.log(`Importing archive from: ${url}`);
|
|
134
120
|
console.log(`to: ${env.primaryDomain.name} (${(0, _format.formatEnvironment)(env.type)})`);
|
|
135
|
-
|
|
136
121
|
try {
|
|
137
122
|
await api.mutate({
|
|
138
123
|
mutation: START_IMPORT_MUTATION,
|
|
@@ -157,10 +142,8 @@ Importing Media into your App...
|
|
|
157
142
|
for (const err of error.graphQLErrors) {
|
|
158
143
|
console.log(_chalk.default.red('Error:'), err.message);
|
|
159
144
|
}
|
|
160
|
-
|
|
161
145
|
return;
|
|
162
146
|
}
|
|
163
|
-
|
|
164
147
|
await track('import_media_start_execute_error', {
|
|
165
148
|
error: `Error: ${error.message}`
|
|
166
149
|
});
|
|
@@ -11,23 +11,14 @@
|
|
|
11
11
|
"use strict";
|
|
12
12
|
|
|
13
13
|
var _tracker = require("../lib/tracker");
|
|
14
|
-
|
|
15
14
|
var exit = _interopRequireWildcard(require("../lib/cli/exit"));
|
|
16
|
-
|
|
17
15
|
var _dbFileImport = require("../lib/site-import/db-file-import");
|
|
18
|
-
|
|
19
16
|
var _status = require("../lib/site-import/status");
|
|
20
|
-
|
|
21
17
|
var _command = _interopRequireDefault(require("../lib/cli/command"));
|
|
22
|
-
|
|
23
18
|
var _progress = require("../lib/cli/progress");
|
|
24
|
-
|
|
25
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
26
|
-
|
|
27
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
28
|
-
|
|
29
21
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
30
|
-
|
|
31
22
|
/**
|
|
32
23
|
* Internal dependencies
|
|
33
24
|
*/
|
|
@@ -59,16 +50,13 @@ environments{
|
|
|
59
50
|
id: envId,
|
|
60
51
|
appId
|
|
61
52
|
} = env;
|
|
62
|
-
|
|
63
53
|
const track = _tracker.trackEventWithEnv.bind(null, appId, envId);
|
|
64
|
-
|
|
65
54
|
if (!(0, _dbFileImport.isSupportedApp)(app)) {
|
|
66
55
|
await track('import_sql_command_error', {
|
|
67
56
|
errorType: 'unsupported-app'
|
|
68
57
|
});
|
|
69
58
|
exit.withError('The type of application you specified does not currently support SQL imports.');
|
|
70
59
|
}
|
|
71
|
-
|
|
72
60
|
await track('import_sql_check_status_command_execute');
|
|
73
61
|
const progressTracker = new _progress.ProgressTracker([]);
|
|
74
62
|
progressTracker.prefix = `
|