@automattic/vip 2.38.1 → 2.38.3
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/dist/bin/vip-app-deploy.js +12 -4
- package/dist/bin/vip-app-list.js +1 -1
- package/dist/bin/vip-app.js +1 -1
- package/dist/bin/vip-cache-purge-url.js +1 -1
- package/dist/bin/vip-db-phpmyadmin.js +1 -0
- package/dist/bin/vip-dev-env-create.js +1 -1
- package/dist/bin/vip-import-media-abort.js +2 -2
- package/dist/bin/vip-import-media-status.js +1 -1
- package/dist/bin/vip-import-media.js +1 -1
- package/dist/bin/vip-import-sql-status.js +1 -1
- package/dist/bin/vip-import-sql.js +10 -6
- package/dist/bin/vip-import-validate-sql.js +1 -1
- package/dist/bin/vip-logs.js +1 -1
- package/dist/bin/vip-search-replace.js +1 -1
- package/dist/bin/vip-slowlogs.js +1 -1
- package/dist/bin/vip-sync.js +1 -1
- package/dist/bin/vip-validate-preflight.js +2 -2
- package/dist/bin/vip-whoami.js +1 -1
- package/dist/bin/vip-wp.js +3 -3
- package/dist/bin/vip.js +4 -2
- package/dist/commands/backup-db.js +3 -3
- package/dist/commands/dev-env-import-sql.js +1 -1
- package/dist/commands/dev-env-sync-sql.js +1 -1
- package/dist/commands/export-sql.js +4 -4
- package/dist/commands/phpmyadmin.js +5 -5
- package/dist/lib/api/app.js +12 -3
- package/dist/lib/api/cache-purge.js +1 -1
- package/dist/lib/api/feature-flags.js +1 -6
- package/dist/lib/api/user.js +1 -1
- package/dist/lib/api.js +8 -12
- package/dist/lib/app-logs/app-logs.js +1 -1
- package/dist/lib/app-slowlogs/app-slowlogs.js +1 -1
- package/dist/lib/cli/apiConfig.js +1 -1
- package/dist/lib/cli/command.js +2 -2
- package/dist/lib/config/software.js +2 -2
- package/dist/lib/custom-deploy/custom-deploy.js +32 -9
- package/dist/lib/dev-environment/dev-environment-configuration-file.js +1 -1
- package/dist/lib/envvar/api-delete.js +1 -1
- package/dist/lib/envvar/api-get-all.js +1 -1
- package/dist/lib/envvar/api-list.js +1 -1
- package/dist/lib/envvar/api-set.js +1 -1
- package/dist/lib/media-import/status.js +1 -1
- package/dist/lib/read-file.js +1 -1
- package/dist/lib/search-and-replace.js +1 -1
- package/dist/lib/site-import/status.js +2 -2
- package/dist/lib/validations/custom-deploy.js +1 -1
- package/dist/lib/validations/is-multi-site.js +2 -2
- package/dist/lib/validations/is-multisite-domain-mapped.js +2 -2
- package/dist/lib/validations/line-by-line.js +1 -1
- package/dist/lib/validations/sql.js +1 -1
- package/docs/CHANGELOG.md +50 -0
- package/docs/SETUP.md +1 -0
- package/npm-shrinkwrap.json +931 -958
- package/package.json +6 -6
package/dist/lib/api.js
CHANGED
|
@@ -27,14 +27,9 @@ function disableGlobalGraphQLErrorHandling() {
|
|
|
27
27
|
function enableGlobalGraphQLErrorHandling() {
|
|
28
28
|
globalGraphQLErrorHandlingEnabled = true;
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
function API({
|
|
31
31
|
exitOnError = true
|
|
32
32
|
} = {}) {
|
|
33
|
-
const authToken = await _token.default.get();
|
|
34
|
-
const headers = {
|
|
35
|
-
'User-Agent': _env.default.userAgent,
|
|
36
|
-
Authorization: `Bearer ${authToken.raw}`
|
|
37
|
-
};
|
|
38
33
|
const errorLink = (0, _error.onError)(({
|
|
39
34
|
networkError,
|
|
40
35
|
graphQLErrors
|
|
@@ -53,25 +48,26 @@ async function API({
|
|
|
53
48
|
}
|
|
54
49
|
});
|
|
55
50
|
const withToken = (0, _context.setContext)(async () => {
|
|
56
|
-
const token = await _token.default.get();
|
|
51
|
+
const token = (await _token.default.get()).raw;
|
|
57
52
|
return {
|
|
58
53
|
token
|
|
59
54
|
};
|
|
60
55
|
});
|
|
61
56
|
const authLink = new _core2.ApolloLink((operation, forward) => {
|
|
62
57
|
const ctx = operation.getContext();
|
|
63
|
-
const
|
|
58
|
+
const headers = {
|
|
59
|
+
'User-Agent': _env.default.userAgent,
|
|
60
|
+
Authorization: `Bearer ${ctx.token}`,
|
|
61
|
+
...ctx.headers
|
|
62
|
+
};
|
|
64
63
|
operation.setContext({
|
|
65
|
-
headers
|
|
66
|
-
Authorization: `Bearer ${token.raw}`
|
|
67
|
-
}
|
|
64
|
+
headers
|
|
68
65
|
});
|
|
69
66
|
return forward(operation);
|
|
70
67
|
});
|
|
71
68
|
const proxyAgent = (0, _proxyAgent.createProxyAgent)(API_URL);
|
|
72
69
|
const httpLink = new _core.HttpLink({
|
|
73
70
|
uri: API_URL,
|
|
74
|
-
headers,
|
|
75
71
|
fetch: _http.default,
|
|
76
72
|
fetchOptions: {
|
|
77
73
|
agent: proxyAgent
|
|
@@ -31,7 +31,7 @@ const QUERY_ENVIRONMENT_LOGS = (0, _graphqlTag.default)`
|
|
|
31
31
|
}
|
|
32
32
|
`;
|
|
33
33
|
async function getRecentLogs(appId, envId, type, limit, after) {
|
|
34
|
-
const api =
|
|
34
|
+
const api = (0, _api.default)({
|
|
35
35
|
exitOnError: false
|
|
36
36
|
});
|
|
37
37
|
const response = await api.query({
|
|
@@ -29,7 +29,7 @@ const QUERY_ENVIRONMENT_SLOWLOGS = (0, _graphqlTag.default)`
|
|
|
29
29
|
}
|
|
30
30
|
`;
|
|
31
31
|
async function getRecentSlowlogs(appId, envId, limit, after) {
|
|
32
|
-
const api =
|
|
32
|
+
const api = (0, _api.default)({
|
|
33
33
|
exitOnError: false
|
|
34
34
|
});
|
|
35
35
|
const response = await api.query({
|
|
@@ -10,7 +10,7 @@ var _token = _interopRequireDefault(require("../../lib/token"));
|
|
|
10
10
|
var _tracker = require("../../lib/tracker");
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
14
|
async function checkFeatureEnabled(featureName, exitOnFalse = false) {
|
|
15
15
|
// TODO: eventually let's look at more feature flags coming from the public api,
|
|
16
16
|
// for now, let's see if the user of the CLI is VIP
|
package/dist/lib/cli/command.js
CHANGED
|
@@ -19,7 +19,7 @@ var _app = _interopRequireDefault(require("../../lib/api/app"));
|
|
|
19
19
|
var _tracker = require("../../lib/tracker");
|
|
20
20
|
var _userError = _interopRequireDefault(require("../user-error"));
|
|
21
21
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
22
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
22
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
23
23
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
24
|
function uncaughtError(err) {
|
|
25
25
|
// Error raised when trying to write to an already closed stream
|
|
@@ -156,7 +156,7 @@ _args.default.argv = async function (argv, cb) {
|
|
|
156
156
|
if (_opts.appContext) {
|
|
157
157
|
// If --app is not set, try to infer the app context
|
|
158
158
|
if (!options.app) {
|
|
159
|
-
const api =
|
|
159
|
+
const api = (0, _api.default)();
|
|
160
160
|
await (0, _tracker.trackEvent)('command_appcontext_list_fetch');
|
|
161
161
|
try {
|
|
162
162
|
res = await api.query({
|
|
@@ -245,7 +245,7 @@ const promptForUpdate = async (appTypeId, opts, softwareSettings) => {
|
|
|
245
245
|
exports.promptForUpdate = promptForUpdate;
|
|
246
246
|
const triggerUpdate = async variables => {
|
|
247
247
|
debug('Triggering update', variables);
|
|
248
|
-
const api =
|
|
248
|
+
const api = (0, _api.default)();
|
|
249
249
|
return api.mutate({
|
|
250
250
|
mutation: updateSoftwareMutation,
|
|
251
251
|
variables
|
|
@@ -253,7 +253,7 @@ const triggerUpdate = async variables => {
|
|
|
253
253
|
};
|
|
254
254
|
exports.triggerUpdate = triggerUpdate;
|
|
255
255
|
const _getLatestJob = async (appId, envId) => {
|
|
256
|
-
const api =
|
|
256
|
+
const api = (0, _api.default)();
|
|
257
257
|
const result = await api.query({
|
|
258
258
|
query: updateJobQuery,
|
|
259
259
|
variables: {
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.gates = gates;
|
|
5
4
|
exports.isSupportedApp = isSupportedApp;
|
|
5
|
+
exports.validateCustomDeployKey = validateCustomDeployKey;
|
|
6
|
+
exports.validateFile = validateFile;
|
|
6
7
|
var _fs = _interopRequireDefault(require("fs"));
|
|
8
|
+
var _graphqlTag = _interopRequireDefault(require("graphql-tag"));
|
|
9
|
+
var _api = _interopRequireDefault(require("../../lib/api"));
|
|
7
10
|
var exit = _interopRequireWildcard(require("../../lib/cli/exit"));
|
|
8
11
|
var _clientFileUploader = require("../../lib/client-file-uploader");
|
|
9
12
|
var _fileSize = require("../../lib/constants/file-size");
|
|
@@ -11,17 +14,43 @@ var _vipgo = require("../../lib/constants/vipgo");
|
|
|
11
14
|
var _tracker = require("../../lib/tracker");
|
|
12
15
|
var _customDeploy = require("../../lib/validations/custom-deploy");
|
|
13
16
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
17
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
19
|
const DEPLOY_MAX_FILE_SIZE = 4 * _fileSize.GB_IN_BYTES;
|
|
20
|
+
const WPVIP_DEPLOY_TOKEN = process.env.WPVIP_DEPLOY_TOKEN;
|
|
17
21
|
function isSupportedApp(app) {
|
|
18
22
|
return _vipgo.WORDPRESS_SITE_TYPE_IDS.includes(app.typeId);
|
|
19
23
|
}
|
|
24
|
+
async function validateCustomDeployKey(envId) {
|
|
25
|
+
if (!WPVIP_DEPLOY_TOKEN) {
|
|
26
|
+
exit.withError('Valid custom deploy key is required.');
|
|
27
|
+
}
|
|
28
|
+
const VALIDATE_CUSTOM_DEPLOY_ACCESS_MUTATION = (0, _graphqlTag.default)`
|
|
29
|
+
mutation ValidateCustomDeployAccess {
|
|
30
|
+
validateCustomDeployAccess( input: { environmentIds: ${envId} } ) {
|
|
31
|
+
success
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
const api = (0, _api.default)();
|
|
36
|
+
try {
|
|
37
|
+
await api.mutate({
|
|
38
|
+
mutation: VALIDATE_CUSTOM_DEPLOY_ACCESS_MUTATION,
|
|
39
|
+
context: {
|
|
40
|
+
headers: {
|
|
41
|
+
Authorization: `Bearer ${WPVIP_DEPLOY_TOKEN}`
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
} catch (error) {
|
|
46
|
+
exit.withError(`Unauthorized: Invalid or non-existent custom deploy key for environment ${envId}.`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
20
49
|
|
|
21
50
|
/**
|
|
22
51
|
* @param {FileMeta} fileMeta
|
|
23
52
|
*/
|
|
24
|
-
async function
|
|
53
|
+
async function validateFile(app, env, fileMeta) {
|
|
25
54
|
const {
|
|
26
55
|
fileName,
|
|
27
56
|
basename,
|
|
@@ -58,12 +87,6 @@ async function gates(app, env, fileMeta) {
|
|
|
58
87
|
});
|
|
59
88
|
exit.withError(error);
|
|
60
89
|
}
|
|
61
|
-
if (!isSupportedApp(app)) {
|
|
62
|
-
await track('deploy_app_command_error', {
|
|
63
|
-
error_type: 'unsupported-app'
|
|
64
|
-
});
|
|
65
|
-
exit.withError('The type of application you specified does not currently support deploys.');
|
|
66
|
-
}
|
|
67
90
|
try {
|
|
68
91
|
await (0, _clientFileUploader.checkFileAccess)(fileName);
|
|
69
92
|
} catch (err) {
|
|
@@ -12,7 +12,7 @@ var _nodePath = _interopRequireDefault(require("node:path"));
|
|
|
12
12
|
var _devEnvironmentCli = require("./dev-environment-cli");
|
|
13
13
|
var exit = _interopRequireWildcard(require("../cli/exit"));
|
|
14
14
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
15
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
const debug = (0, _debug.default)('@automattic/vip:bin:dev-environment');
|
|
18
18
|
const CONFIGURATION_FILE_NAME = exports.CONFIGURATION_FILE_NAME = 'vip-dev-env.yml';
|
|
@@ -24,7 +24,7 @@ const query = (0, _graphqlTag.default)`
|
|
|
24
24
|
|
|
25
25
|
// List the names (but not values) of environment variables.
|
|
26
26
|
async function listEnvVars(appId, envId) {
|
|
27
|
-
const api =
|
|
27
|
+
const api = (0, _api.default)();
|
|
28
28
|
const variables = {
|
|
29
29
|
appId,
|
|
30
30
|
envId
|
|
@@ -129,7 +129,7 @@ async function mediaImportCheckStatus({
|
|
|
129
129
|
progressTracker.stopPrinting();
|
|
130
130
|
|
|
131
131
|
// NO `console.log` in this function (until results are final)! It will break the progress printing.
|
|
132
|
-
const api =
|
|
132
|
+
const api = (0, _api.default)();
|
|
133
133
|
if (!(0, _mediaFileImport.currentUserCanImportForApp)(app)) {
|
|
134
134
|
throw new Error('The currently authenticated account does not have permission to view Media Import status.');
|
|
135
135
|
}
|
package/dist/lib/read-file.js
CHANGED
|
@@ -5,7 +5,7 @@ exports.readFromFile = readFromFile;
|
|
|
5
5
|
var _promises = require("node:fs/promises");
|
|
6
6
|
var exit = _interopRequireWildcard(require("../lib/cli/exit"));
|
|
7
7
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
8
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
8
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
9
9
|
async function readFromFile(path) {
|
|
10
10
|
try {
|
|
11
11
|
const data = await (0, _promises.readFile)(path, 'utf-8');
|
|
@@ -15,7 +15,7 @@ var _prompt = require("../lib/cli/prompt");
|
|
|
15
15
|
var _clientFileUploader = require("../lib/client-file-uploader");
|
|
16
16
|
var _tracker = require("../lib/tracker");
|
|
17
17
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
18
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
18
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
20
|
const debug = (0, _debug.default)('@automattic/vip:lib:search-and-replace');
|
|
21
21
|
function getReadAndWriteStreams({
|
|
@@ -11,7 +11,7 @@ var _api = _interopRequireDefault(require("../../lib/api"));
|
|
|
11
11
|
var exit = _interopRequireWildcard(require("../../lib/cli/exit"));
|
|
12
12
|
var _format = require("../../lib/cli/format");
|
|
13
13
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
16
|
/* eslint-disable complexity */
|
|
17
17
|
|
|
@@ -150,7 +150,7 @@ async function importSqlCheckStatus({
|
|
|
150
150
|
progressTracker.stopPrinting();
|
|
151
151
|
|
|
152
152
|
// NO `console.log` in this function (until results are final)! It will break the progress printing.
|
|
153
|
-
const api =
|
|
153
|
+
const api = (0, _api.default)();
|
|
154
154
|
if (!(0, _dbFileImport.currentUserCanImportForApp)(app)) {
|
|
155
155
|
throw new Error('The currently authenticated account does not have permission to view SQL import status.');
|
|
156
156
|
}
|
|
@@ -6,7 +6,7 @@ exports.validateFilename = validateFilename;
|
|
|
6
6
|
var _path = _interopRequireDefault(require("path"));
|
|
7
7
|
var exit = _interopRequireWildcard(require("../../lib/cli/exit"));
|
|
8
8
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
9
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
9
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
/**
|
|
12
12
|
* Check if a file has a valid extension
|
|
@@ -7,7 +7,7 @@ var _api = _interopRequireDefault(require("../../lib/api"));
|
|
|
7
7
|
var exit = _interopRequireWildcard(require("../../lib/cli/exit"));
|
|
8
8
|
var _tracker = require("../../lib/tracker");
|
|
9
9
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
10
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
10
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
const isMultiSite = new WeakMap();
|
|
13
13
|
async function isMultiSiteInSiteMeta(appId, envId) {
|
|
@@ -21,7 +21,7 @@ async function isMultiSiteInSiteMeta(appId, envId) {
|
|
|
21
21
|
if ('boolean' === typeof ret) {
|
|
22
22
|
return ret;
|
|
23
23
|
}
|
|
24
|
-
const api =
|
|
24
|
+
const api = (0, _api.default)();
|
|
25
25
|
let res;
|
|
26
26
|
try {
|
|
27
27
|
res = await api.query({
|
|
@@ -9,7 +9,7 @@ var _api = _interopRequireDefault(require("../../lib/api"));
|
|
|
9
9
|
var exit = _interopRequireWildcard(require("../../lib/cli/exit"));
|
|
10
10
|
var _tracker = require("../../lib/tracker");
|
|
11
11
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
14
|
/**
|
|
15
15
|
* Extracts the domain for site with ID 1 from an INSERT INTO `wp_site` SQL statement
|
|
@@ -68,7 +68,7 @@ const getPrimaryDomain = function (statements, searchReplace) {
|
|
|
68
68
|
exports.getPrimaryDomain = getPrimaryDomain;
|
|
69
69
|
async function isMultisitePrimaryDomainMapped(appId, envId, primaryDomain) {
|
|
70
70
|
const track = _tracker.trackEventWithEnv.bind(null, appId, envId);
|
|
71
|
-
const api =
|
|
71
|
+
const api = (0, _api.default)();
|
|
72
72
|
let res;
|
|
73
73
|
try {
|
|
74
74
|
res = await api.query({
|
|
@@ -9,7 +9,7 @@ var _promises = require("node:fs/promises");
|
|
|
9
9
|
var _nodeReadline = require("node:readline");
|
|
10
10
|
var exit = _interopRequireWildcard(require("../../lib/cli/exit"));
|
|
11
11
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
14
|
const debug = (0, _debug.default)('vip:validations:line-by-line');
|
|
15
15
|
async function getReadInterface(filename) {
|
|
@@ -12,7 +12,7 @@ var _clientFileUploader = require("../../lib/client-file-uploader");
|
|
|
12
12
|
var _tracker = require("../../lib/tracker");
|
|
13
13
|
var _lineByLine = require("../../lib/validations/line-by-line");
|
|
14
14
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
15
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
let problemsFound = 0;
|
|
18
18
|
let lineNum = 1;
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,55 @@
|
|
|
1
1
|
## Changelog
|
|
2
2
|
|
|
3
|
+
### 2.38.2
|
|
4
|
+
|
|
5
|
+
* New develop release: 2.38.2-dev.0 by @github-actions in https://github.com/Automattic/vip-cli/pull/1697
|
|
6
|
+
* build(deps-dev): bump nock from 13.5.1 to 13.5.3 by @dependabot in https://github.com/Automattic/vip-cli/pull/1701
|
|
7
|
+
* build(deps-dev): bump @types/node from 18.19.15 to 18.19.17 by @dependabot in https://github.com/Automattic/vip-cli/pull/1699
|
|
8
|
+
* style: fix issues found by ESLint by @sjinks in https://github.com/Automattic/vip-cli/pull/1702
|
|
9
|
+
* build(deps-dev): bump eslint from 8.56.0 to 8.57.0 by @dependabot in https://github.com/Automattic/vip-cli/pull/1707
|
|
10
|
+
* build(deps): bump open from 10.0.3 to 10.0.4 by @dependabot in https://github.com/Automattic/vip-cli/pull/1705
|
|
11
|
+
* build(deps-dev): bump @types/semver from 7.5.7 to 7.5.8 by @dependabot in https://github.com/Automattic/vip-cli/pull/1706
|
|
12
|
+
* build(deps-dev): bump @types/dockerode from 3.3.23 to 3.3.24 by @dependabot in https://github.com/Automattic/vip-cli/pull/1704
|
|
13
|
+
* build(deps-dev): bump @types/node from 18.19.17 to 18.19.18 by @dependabot in https://github.com/Automattic/vip-cli/pull/1703
|
|
14
|
+
* Add environment name to PHPMyAdmin AppQuery by @chriszarate in https://github.com/Automattic/vip-cli/pull/1711
|
|
15
|
+
* New package release: v2.38.2 by @github-actions in https://github.com/Automattic/vip-cli/pull/1712
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
**Full Changelog**: https://github.com/Automattic/vip-cli/compare/2.38.1...2.38.2
|
|
19
|
+
|
|
20
|
+
### 2.38.1
|
|
21
|
+
|
|
22
|
+
* New develop release: 2.38.1-dev.0 by @github-actions in https://github.com/Automattic/vip-cli/pull/1678
|
|
23
|
+
* build(deps-dev): bump @types/node from 18.19.9 to 18.19.14 by @dependabot in https://github.com/Automattic/vip-cli/pull/1680
|
|
24
|
+
* build(deps-dev): bump the testing group with 1 update by @dependabot in https://github.com/Automattic/vip-cli/pull/1679
|
|
25
|
+
* build(deps-dev): bump @types/uuid from 9.0.7 to 9.0.8 by @dependabot in https://github.com/Automattic/vip-cli/pull/1670
|
|
26
|
+
* build(deps-dev): bump nock from 13.5.0 to 13.5.1 by @dependabot in https://github.com/Automattic/vip-cli/pull/1671
|
|
27
|
+
* build(deps-dev): bump the babel group with 3 updates by @dependabot in https://github.com/Automattic/vip-cli/pull/1668
|
|
28
|
+
* build(deps): bump semver from 7.5.4 to 7.6.0 by @dependabot in https://github.com/Automattic/vip-cli/pull/1684
|
|
29
|
+
* BYOR: Update to use renamed CustomDeploy mutation by @rebeccahum in https://github.com/Automattic/vip-cli/pull/1687
|
|
30
|
+
* Fix prompt handling causing duplicate messages to be shown for export sql and dev-env sync by @abdullah-kasim in https://github.com/Automattic/vip-cli/pull/1682
|
|
31
|
+
* Support default OrbStack Docker socket path by @chriszarate in https://github.com/Automattic/vip-cli/pull/1686
|
|
32
|
+
* Update publish docs request parameters by @seanlanglands in https://github.com/Automattic/vip-cli/pull/1688
|
|
33
|
+
* build(deps-dev): bump @types/semver from 7.5.6 to 7.5.7 by @dependabot in https://github.com/Automattic/vip-cli/pull/1692
|
|
34
|
+
* build(deps): bump @json2csv/plainjs from 7.0.5 to 7.0.6 by @dependabot in https://github.com/Automattic/vip-cli/pull/1691
|
|
35
|
+
* build(deps-dev): bump @types/node from 18.19.14 to 18.19.15 by @dependabot in https://github.com/Automattic/vip-cli/pull/1690
|
|
36
|
+
* chores (phpmyadmin): Add insufficient-permission message by @aswasif007 in https://github.com/Automattic/vip-cli/pull/1694
|
|
37
|
+
* New package release: v2.38.1 by @github-actions in https://github.com/Automattic/vip-cli/pull/1696
|
|
38
|
+
|
|
39
|
+
**Full Changelog**: https://github.com/Automattic/vip-cli/compare/2.38.0...2.38.1
|
|
40
|
+
|
|
41
|
+
### 2.38.0
|
|
42
|
+
|
|
43
|
+
* New develop release: 2.37.1-dev.0 by @github-actions in https://github.com/Automattic/vip-cli/pull/1663
|
|
44
|
+
* fix(dev-env): always lowercase environment slug by @sjinks in https://github.com/Automattic/vip-cli/pull/1659
|
|
45
|
+
* Use vip dev-env configuration file from parent directories by @alecgeatches in https://github.com/Automattic/vip-cli/pull/1468
|
|
46
|
+
* build(deps): bump @json2csv/plainjs from 7.0.4 to 7.0.5 by @dependabot in https://github.com/Automattic/vip-cli/pull/1664
|
|
47
|
+
* build(deps-dev): bump @types/node from 18.19.8 to 18.19.9 by @dependabot in https://github.com/Automattic/vip-cli/pull/1666
|
|
48
|
+
* feat(phpmyadmin): Add `vip db phpmyadmin` command by @aswasif007 in https://github.com/Automattic/vip-cli/pull/1526
|
|
49
|
+
* New package release: v2.38.0 by @github-actions in https://github.com/Automattic/vip-cli/pull/1677
|
|
50
|
+
|
|
51
|
+
**Full Changelog**: https://github.com/Automattic/vip-cli/compare/2.37.0...2.38.0
|
|
52
|
+
|
|
3
53
|
### 2.37.0
|
|
4
54
|
|
|
5
55
|
- build(deps-dev): bump the babel group with 2 updates
|
package/docs/SETUP.md
CHANGED
|
@@ -109,6 +109,7 @@ TODO: Update description of the variables.
|
|
|
109
109
|
- `NO_PROXY`:
|
|
110
110
|
- `VIP_PROXY`: [For internal VIP use](TESTING.md#local-testing).
|
|
111
111
|
- `VIP_USE_SYSTEM_PROXY`:
|
|
112
|
+
- `WPVIP_DEPLOY_TOKEN`: For use with `vip app deploy` on sites that have custom deploys enabled.
|
|
112
113
|
|
|
113
114
|
### Configuration files
|
|
114
115
|
|