@commercetools-frontend/mc-scripts 27.5.1 → 27.5.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/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.dev.js +19 -39
- package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.prod.js +19 -39
- package/cli/dist/commercetools-frontend-mc-scripts-cli.esm.js +11 -11
- package/dist/{build-7c7442bd.cjs.prod.js → build-BP3m-wjz.cjs.prod.js} +23 -23
- package/dist/{build-2cbde331.cjs.dev.js → build-Dq8dqtsd.cjs.dev.js} +23 -23
- package/dist/{build-4ab9306b.esm.js → build-GEMI3W9m.esm.js} +7 -7
- package/dist/{build-vite-1526e4f8.esm.js → build-vite-CO8mi4hd.esm.js} +20 -10
- package/dist/{build-vite-71889a4a.cjs.prod.js → build-vite-D67xSRU1.cjs.prod.js} +46 -36
- package/dist/{build-vite-2fb9320e.cjs.dev.js → build-vite-Dxi3rfHf.cjs.dev.js} +46 -36
- package/dist/commercetools-frontend-mc-scripts.cjs.dev.js +2 -4
- package/dist/commercetools-frontend-mc-scripts.cjs.prod.js +2 -4
- package/dist/commercetools-frontend-mc-scripts.esm.js +2 -2
- package/dist/{compile-html-025cd493.esm.js → compile-html-BVvy3IQD.esm.js} +2 -2
- package/dist/{compile-html-f4ac88cc.cjs.dev.js → compile-html-DZlUpFXg.cjs.prod.js} +8 -8
- package/dist/{compile-html-50fd05ec.cjs.prod.js → compile-html-Ds1YojsY.cjs.dev.js} +8 -8
- package/dist/{config-sync-d5c4aa9b.esm.js → config-sync-Bu7U5gn5.esm.js} +5 -5
- package/dist/{config-sync-7ae74804.cjs.dev.js → config-sync-Cd0sSSrd.cjs.dev.js} +22 -22
- package/dist/{config-sync-d3d5d721.cjs.prod.js → config-sync-D6xLjo9S.cjs.prod.js} +22 -22
- package/dist/{config-sync-ci-d3104a62.cjs.prod.js → config-sync-ci-CXgQcemF.cjs.prod.js} +21 -21
- package/dist/{config-sync-ci-9c50ed6f.esm.js → config-sync-ci-Dq7bAqeu.esm.js} +5 -5
- package/dist/{config-sync-ci-732e0c5d.cjs.dev.js → config-sync-ci-SDsF-Onw.cjs.dev.js} +21 -21
- package/dist/{config-sync-helpers-ea628bce.cjs.prod.js → config-sync-helpers-9kvPwuoy.cjs.prod.js} +47 -47
- package/dist/{config-sync-helpers-bea5f027.esm.js → config-sync-helpers-BLXJp1-D.esm.js} +3 -3
- package/dist/{config-sync-helpers-178da465.cjs.dev.js → config-sync-helpers-DUK45F_R.cjs.dev.js} +47 -47
- package/dist/{create-postcss-config-f6a5f68b.esm.js → create-postcss-config-CN9_8Usa.esm.js} +1 -1
- package/dist/{create-postcss-config-3f3bda09.cjs.prod.js → create-postcss-config-DAShdAyB.cjs.prod.js} +3 -3
- package/dist/{create-postcss-config-e4c767b4.cjs.dev.js → create-postcss-config-NN2FAhvH.cjs.dev.js} +3 -3
- package/dist/{create-webpack-config-for-development-c6e48557.esm.js → create-webpack-config-for-development-5HpRHV9G.esm.js} +5 -5
- package/dist/{create-webpack-config-for-development-4a2616e9.cjs.prod.js → create-webpack-config-for-development-CxGehl7I.cjs.prod.js} +25 -25
- package/dist/{create-webpack-config-for-development-a2df037a.cjs.dev.js → create-webpack-config-for-development-hxSNyq2_.cjs.dev.js} +25 -25
- package/dist/{create-webpack-config-for-production-04a7a9f8.esm.js → create-webpack-config-for-production-BY0UNoNz.esm.js} +5 -5
- package/dist/{create-webpack-config-for-production-443f6fe7.cjs.prod.js → create-webpack-config-for-production-CW0DlZBz.cjs.prod.js} +32 -32
- package/dist/{create-webpack-config-for-production-12e257fc.cjs.dev.js → create-webpack-config-for-production-Edp9dzmw.cjs.dev.js} +32 -32
- package/dist/{credentials-storage-fd195144.cjs.dev.js → credentials-storage-B0tDCH7i.cjs.dev.js} +10 -10
- package/dist/{credentials-storage-67deadc3.esm.js → credentials-storage-B79bb0Ns.esm.js} +1 -1
- package/dist/{credentials-storage-ea1c16dc.cjs.prod.js → credentials-storage-C3TlK0a8.cjs.prod.js} +10 -10
- package/dist/{deployment-previews-set-491442d7.cjs.dev.js → deployment-previews-set-BuHX8wKo.cjs.dev.js} +22 -22
- package/dist/{deployment-previews-set-4b020cb4.esm.js → deployment-previews-set-C2OPIfy-.esm.js} +4 -4
- package/dist/{deployment-previews-set-2b334c11.cjs.prod.js → deployment-previews-set-nvkAPwYw.cjs.prod.js} +22 -22
- package/dist/{does-file-exist-be53305d.cjs.prod.js → does-file-exist-DrcZIPe6.cjs.dev.js} +2 -2
- package/dist/{does-file-exist-eb86baca.cjs.dev.js → does-file-exist-DrcZIPe6.cjs.prod.js} +2 -2
- package/dist/{graphql-requests-bd7a3fe9.cjs.dev.js → graphql-requests-BeUd4g3v.cjs.dev.js} +9 -9
- package/dist/{graphql-requests-6ead2029.cjs.prod.js → graphql-requests-D0rtMo7K.cjs.prod.js} +9 -9
- package/dist/{graphql-requests-87338c52.esm.js → graphql-requests-DCLX_2y0.esm.js} +4 -4
- package/dist/{i18n-message-complilation-7311cb29.cjs.dev.js → i18n-message-complilation-CdVhuyWk.cjs.dev.js} +3 -3
- package/dist/{i18n-message-complilation-7762da61.cjs.prod.js → i18n-message-complilation-CdVhuyWk.cjs.prod.js} +3 -3
- package/dist/{login-2d10deff.cjs.dev.js → login-BagHOLO1.cjs.prod.js} +42 -60
- package/dist/{login-26cfe1af.cjs.prod.js → login-DKzmRa46.cjs.dev.js} +42 -60
- package/dist/{login-ab249036.esm.js → login-DZVfG3Jq.esm.js} +3 -3
- package/dist/{optimizations-da5a0cfa.cjs.prod.js → optimizations-CEaq4axa.cjs.dev.js} +8 -8
- package/dist/{optimizations-56be74d6.cjs.dev.js → optimizations-CEaq4axa.cjs.prod.js} +8 -8
- package/dist/{optimizations-54382f7b.esm.js → optimizations-Cjrg77Gu.esm.js} +1 -1
- package/dist/package-B1Y3_DDl.cjs.dev.js +17 -0
- package/dist/package-BiK3ergJ.esm.js +15 -0
- package/dist/package-DxhqRLHb.cjs.prod.js +12 -0
- package/dist/{paths-b76fc753.cjs.dev.js → paths-B0WM5jb9.cjs.dev.js} +5 -5
- package/dist/{paths-39f22b8b.esm.js → paths-Cg5Vq6RE.esm.js} +1 -1
- package/dist/{paths-7768b440.cjs.prod.js → paths-DtvtCG0U.cjs.prod.js} +5 -5
- package/dist/{serve-b1c12985.cjs.dev.js → serve-BwNRk6vi.cjs.prod.js} +13 -13
- package/dist/{serve-3837602d.cjs.prod.js → serve-BxRJOSeR.cjs.dev.js} +13 -13
- package/dist/{serve-22475fec.esm.js → serve-fXDv4-Pm.esm.js} +2 -2
- package/dist/{start-19facf6d.cjs.prod.js → start-CQgQhNhU.cjs.prod.js} +17 -17
- package/dist/{start-9b1252f9.cjs.dev.js → start-OjGog63p.cjs.dev.js} +17 -17
- package/dist/{start-3c1e5902.esm.js → start-suUcoYml.esm.js} +7 -7
- package/dist/{start-vite-7d1161e8.esm.js → start-vite-BOrX5xsW.esm.js} +3 -3
- package/dist/{start-vite-29078b3a.cjs.prod.js → start-vite-Bf9UIg63.cjs.prod.js} +14 -14
- package/dist/{start-vite-068e9f73.cjs.dev.js → start-vite-CeaoWKrT.cjs.dev.js} +14 -14
- package/dist/{vite-plugin-svgr-4034a834.cjs.prod.js → vite-plugin-svgr-CRRIY_Py.cjs.dev.js} +6 -24
- package/dist/{vite-plugin-svgr-7d06f400.cjs.dev.js → vite-plugin-svgr-CRRIY_Py.cjs.prod.js} +6 -24
- package/package.json +8 -8
- package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.dev.js +2 -4
- package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.prod.js +2 -4
- package/postcss/dist/commercetools-frontend-mc-scripts-postcss.esm.js +2 -2
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.dev.js +8 -10
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.prod.js +8 -10
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.esm.js +8 -8
- package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.cjs.dev.js +2 -2
- package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.cjs.prod.js +2 -2
- package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.esm.js +1 -1
- package/dist/package-62998a4b.cjs.prod.js +0 -167
- package/dist/package-a686a0ee.esm.js +0 -165
- package/dist/package-fe1840f3.cjs.dev.js +0 -167
- /package/dist/{does-file-exist-32618334.esm.js → does-file-exist-C7l6j7NP.esm.js} +0 -0
- /package/dist/{i18n-message-complilation-21d3b0aa.esm.js → i18n-message-complilation-BRZ7ffQI.esm.js} +0 -0
- /package/dist/{vendors-to-transpile-04a49d40.cjs.prod.js → vendors-to-transpile-DLHlk7c-.cjs.dev.js} +0 -0
- /package/dist/{vendors-to-transpile-6ab4ea06.cjs.dev.js → vendors-to-transpile-DLHlk7c-.cjs.prod.js} +0 -0
- /package/dist/{vendors-to-transpile-7dc84a72.esm.js → vendors-to-transpile-uu9TNPDO.esm.js} +0 -0
- /package/dist/{vite-plugin-svgr-de6ee7da.esm.js → vite-plugin-svgr-B1JerYlQ.esm.js} +0 -0
|
@@ -7,9 +7,9 @@ var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/ins
|
|
|
7
7
|
var chalk = require('chalk');
|
|
8
8
|
var prompts = require('prompts');
|
|
9
9
|
var applicationConfig = require('@commercetools-frontend/application-config');
|
|
10
|
-
var configSyncHelpers = require('./config-sync-helpers-
|
|
11
|
-
var credentialsStorage$1 = require('./credentials-storage-
|
|
12
|
-
var graphqlRequests = require('./graphql-requests-
|
|
10
|
+
var configSyncHelpers = require('./config-sync-helpers-9kvPwuoy.cjs.prod.js');
|
|
11
|
+
var credentialsStorage$1 = require('./credentials-storage-C3TlK0a8.cjs.prod.js');
|
|
12
|
+
var graphqlRequests = require('./graphql-requests-D0rtMo7K.cjs.prod.js');
|
|
13
13
|
require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
14
14
|
require('lodash/omit');
|
|
15
15
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
@@ -30,15 +30,15 @@ require('@babel/runtime-corejs3/core-js-stable/date/now');
|
|
|
30
30
|
require('node:fs');
|
|
31
31
|
require('node:os');
|
|
32
32
|
require('node:path');
|
|
33
|
-
require('./does-file-exist-
|
|
33
|
+
require('./does-file-exist-DrcZIPe6.cjs.prod.js');
|
|
34
34
|
require('@babel/runtime-corejs3/core-js-stable/instance/some');
|
|
35
35
|
require('graphql');
|
|
36
36
|
require('graphql-request');
|
|
37
37
|
require('@commercetools-frontend/constants');
|
|
38
38
|
require('@commercetools/http-user-agent');
|
|
39
|
-
require('./package-
|
|
39
|
+
require('./package-DxhqRLHb.cjs.prod.js');
|
|
40
40
|
|
|
41
|
-
function _interopDefault (e) { return e && e.__esModule ? e : {
|
|
41
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
42
42
|
|
|
43
43
|
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
|
|
44
44
|
var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
|
|
@@ -69,11 +69,11 @@ async function promptForOrganization(_ref) {
|
|
|
69
69
|
name: organization.name
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
|
-
const organizationChoices = _mapInstanceProperty__default
|
|
72
|
+
const organizationChoices = _mapInstanceProperty__default.default(_context = userOrganizations.results).call(_context, organization => ({
|
|
73
73
|
title: organization.name,
|
|
74
74
|
value: organization.id
|
|
75
75
|
}));
|
|
76
|
-
const _await$prompts = await prompts__default
|
|
76
|
+
const _await$prompts = await prompts__default.default({
|
|
77
77
|
type: 'select',
|
|
78
78
|
name: 'organizationId',
|
|
79
79
|
message: 'Select an Organization',
|
|
@@ -84,7 +84,7 @@ async function promptForOrganization(_ref) {
|
|
|
84
84
|
if (!selectedOrganizationId) {
|
|
85
85
|
throw new Error(`No Organization selected, aborting.`);
|
|
86
86
|
}
|
|
87
|
-
const organizationName = _findInstanceProperty__default
|
|
87
|
+
const organizationName = _findInstanceProperty__default.default(organizationChoices).call(organizationChoices, _ref2 => {
|
|
88
88
|
let value = _ref2.value;
|
|
89
89
|
return value === selectedOrganizationId;
|
|
90
90
|
}).title;
|
|
@@ -98,15 +98,15 @@ async function confirmAction(_ref3) {
|
|
|
98
98
|
let message = _ref3.message,
|
|
99
99
|
dryRun = _ref3.dryRun,
|
|
100
100
|
dryRunMessage = _ref3.dryRunMessage;
|
|
101
|
-
const _await$prompts2 = await prompts__default
|
|
101
|
+
const _await$prompts2 = await prompts__default.default({
|
|
102
102
|
type: 'text',
|
|
103
103
|
name: 'confirmation',
|
|
104
|
-
message: _filterInstanceProperty__default
|
|
104
|
+
message: _filterInstanceProperty__default.default(_context2 = [message, dryRun && chalk__default.default.gray(dryRunMessage)]).call(_context2, Boolean).join('\n'),
|
|
105
105
|
initial: 'yes'
|
|
106
106
|
}),
|
|
107
107
|
confirmation = _await$prompts2.confirmation;
|
|
108
108
|
if (!confirmation || confirmation.toLowerCase().charAt(0) !== 'y') {
|
|
109
|
-
console.log(chalk__default
|
|
109
|
+
console.log(chalk__default.default.red('Aborted.'));
|
|
110
110
|
return false;
|
|
111
111
|
}
|
|
112
112
|
return true;
|
|
@@ -130,7 +130,7 @@ async function createOrUpdateCustomApplication(_ref4) {
|
|
|
130
130
|
entityType: 'Custom Application'
|
|
131
131
|
});
|
|
132
132
|
const confirmed = await confirmAction({
|
|
133
|
-
message: `You are about to create a new Custom Application in the "${chalk__default
|
|
133
|
+
message: `You are about to create a new Custom Application in the "${chalk__default.default.green(organization.name)}" organization. Are you sure you want to proceed?`,
|
|
134
134
|
dryRun: options.dryRun,
|
|
135
135
|
dryRunMessage: 'Using "--dry-run", no data will be created.'
|
|
136
136
|
});
|
|
@@ -148,15 +148,15 @@ async function createOrUpdateCustomApplication(_ref4) {
|
|
|
148
148
|
|
|
149
149
|
// Check for changes
|
|
150
150
|
if (!status.configDiff) {
|
|
151
|
-
console.log(chalk__default
|
|
152
|
-
console.log(`You can inspect the Custom Application data in the Merchant Center at "${chalk__default
|
|
151
|
+
console.log(chalk__default.default.green(`Custom Application up-to-date.`));
|
|
152
|
+
console.log(`You can inspect the Custom Application data in the Merchant Center at "${chalk__default.default.gray(status.link)}".`);
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
155
155
|
console.log('Changes detected:');
|
|
156
156
|
console.log(status.configDiff);
|
|
157
157
|
console.log();
|
|
158
158
|
const confirmed = await confirmAction({
|
|
159
|
-
message: `You are about to update the Custom Application "${chalk__default
|
|
159
|
+
message: `You are about to update the Custom Application "${chalk__default.default.green(localCustomEntityData.entryPointUriPath)}" with the changes above. Are you sure you want to proceed?`,
|
|
160
160
|
dryRun: options.dryRun,
|
|
161
161
|
dryRunMessage: 'Using "--dry-run", no data will be updated.'
|
|
162
162
|
});
|
|
@@ -191,7 +191,7 @@ async function createOrUpdateCustomView(_ref5) {
|
|
|
191
191
|
entityType: 'Custom View'
|
|
192
192
|
});
|
|
193
193
|
const confirmed = await confirmAction({
|
|
194
|
-
message: `You are about to create a new Custom View in the "${chalk__default
|
|
194
|
+
message: `You are about to create a new Custom View in the "${chalk__default.default.green(organization.name)}" organization. Are you sure you want to proceed?`,
|
|
195
195
|
dryRun: options.dryRun,
|
|
196
196
|
dryRunMessage: 'Using "--dry-run", no data will be created.'
|
|
197
197
|
});
|
|
@@ -209,15 +209,15 @@ async function createOrUpdateCustomView(_ref5) {
|
|
|
209
209
|
|
|
210
210
|
// Check for changes
|
|
211
211
|
if (!status.configDiff) {
|
|
212
|
-
console.log(chalk__default
|
|
213
|
-
console.log(`You can inspect the Custom View data in the Merchant Center at "${chalk__default
|
|
212
|
+
console.log(chalk__default.default.green(`Custom View up-to-date.`));
|
|
213
|
+
console.log(`You can inspect the Custom View data in the Merchant Center at "${chalk__default.default.gray(status.link)}".`);
|
|
214
214
|
return;
|
|
215
215
|
}
|
|
216
216
|
console.log('Changes detected:');
|
|
217
217
|
console.log(status.configDiff);
|
|
218
218
|
console.log();
|
|
219
219
|
const confirmed = await confirmAction({
|
|
220
|
-
message: `You are about to update the Custom View "${chalk__default
|
|
220
|
+
message: `You are about to update the Custom View "${chalk__default.default.green(localCustomEntityData.defaultLabel)}" with the changes above. Are you sure you want to proceed?`,
|
|
221
221
|
dryRun: options.dryRun,
|
|
222
222
|
dryRunMessage: 'Using "--dry-run", no data will be updated.'
|
|
223
223
|
});
|
|
@@ -238,7 +238,7 @@ async function run(options) {
|
|
|
238
238
|
mcApiUrl = _applicationConfig$en.mcApiUrl,
|
|
239
239
|
applicationIdentifier = _applicationConfig$en.applicationIdentifier,
|
|
240
240
|
customViewId = _applicationConfig$en.customViewId;
|
|
241
|
-
console.log(`Using Merchant Center environment "${chalk__default
|
|
241
|
+
console.log(`Using Merchant Center environment "${chalk__default.default.green(mcApiUrl)}".`);
|
|
242
242
|
console.log();
|
|
243
243
|
const isSessionValid = credentialsStorage.isSessionValid(mcApiUrl);
|
|
244
244
|
if (!isSessionValid) {
|
|
@@ -262,4 +262,4 @@ async function run(options) {
|
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
264
|
|
|
265
|
-
exports
|
|
265
|
+
exports.default = run;
|
|
@@ -5,12 +5,12 @@ var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/insta
|
|
|
5
5
|
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
6
6
|
var chalk = require('chalk');
|
|
7
7
|
var applicationConfig = require('@commercetools-frontend/application-config');
|
|
8
|
-
var configSyncHelpers = require('./config-sync-helpers-
|
|
9
|
-
var graphqlRequests = require('./graphql-requests-
|
|
8
|
+
var configSyncHelpers = require('./config-sync-helpers-9kvPwuoy.cjs.prod.js');
|
|
9
|
+
var graphqlRequests = require('./graphql-requests-D0rtMo7K.cjs.prod.js');
|
|
10
10
|
var _Date$now = require('@babel/runtime-corejs3/core-js-stable/date/now');
|
|
11
11
|
var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
12
12
|
var jwtDecode = require('jwt-decode');
|
|
13
|
-
var credentialsStorage = require('./credentials-storage-
|
|
13
|
+
var credentialsStorage = require('./credentials-storage-C3TlK0a8.cjs.prod.js');
|
|
14
14
|
require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
15
15
|
require('lodash/omit');
|
|
16
16
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
@@ -31,15 +31,15 @@ require('graphql');
|
|
|
31
31
|
require('graphql-request');
|
|
32
32
|
require('@commercetools-frontend/constants');
|
|
33
33
|
require('@commercetools/http-user-agent');
|
|
34
|
-
require('./package-
|
|
34
|
+
require('./package-DxhqRLHb.cjs.prod.js');
|
|
35
35
|
require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
36
36
|
require('@babel/runtime-corejs3/helpers/createClass');
|
|
37
37
|
require('node:fs');
|
|
38
38
|
require('node:os');
|
|
39
39
|
require('node:path');
|
|
40
|
-
require('./does-file-exist-
|
|
40
|
+
require('./does-file-exist-DrcZIPe6.cjs.prod.js');
|
|
41
41
|
|
|
42
|
-
function _interopDefault (e) { return e && e.__esModule ? e : {
|
|
42
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
43
43
|
|
|
44
44
|
var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
|
|
45
45
|
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
|
|
@@ -68,8 +68,8 @@ async function authenticateForCI(_ref) {
|
|
|
68
68
|
const envToken = process.env[ENV_VARS$1.TOKEN];
|
|
69
69
|
if (envToken) {
|
|
70
70
|
try {
|
|
71
|
-
const decodedToken = jwtDecode__default
|
|
72
|
-
const now = Math.floor(_Date$now__default
|
|
71
|
+
const decodedToken = jwtDecode__default.default(envToken);
|
|
72
|
+
const now = Math.floor(_Date$now__default.default() / 1000);
|
|
73
73
|
if (decodedToken.exp <= now) {
|
|
74
74
|
throw new Error('The provided MC_ACCESS_TOKEN has expired');
|
|
75
75
|
}
|
|
@@ -84,7 +84,7 @@ async function authenticateForCI(_ref) {
|
|
|
84
84
|
};
|
|
85
85
|
} catch (error) {
|
|
86
86
|
var _context;
|
|
87
|
-
if (error instanceof Error && _includesInstanceProperty__default
|
|
87
|
+
if (error instanceof Error && _includesInstanceProperty__default.default(_context = error.message).call(_context, 'expired')) {
|
|
88
88
|
throw error;
|
|
89
89
|
}
|
|
90
90
|
throw new Error('The provided MC_ACCESS_TOKEN is invalid');
|
|
@@ -95,7 +95,7 @@ async function authenticateForCI(_ref) {
|
|
|
95
95
|
if (credentialsStorage$1.isSessionValid(mcApiUrl)) {
|
|
96
96
|
const token = credentialsStorage$1.getToken(mcApiUrl);
|
|
97
97
|
if (token) {
|
|
98
|
-
const decodedToken = jwtDecode__default
|
|
98
|
+
const decodedToken = jwtDecode__default.default(token);
|
|
99
99
|
return {
|
|
100
100
|
token,
|
|
101
101
|
expiresAt: decodedToken.exp
|
|
@@ -131,7 +131,7 @@ async function resolveOrganization(_ref) {
|
|
|
131
131
|
const organizationName = process.env[ENV_VARS.ORGANIZATION_NAME];
|
|
132
132
|
if (organizationId) {
|
|
133
133
|
var _context;
|
|
134
|
-
const matchingOrg = _findInstanceProperty__default
|
|
134
|
+
const matchingOrg = _findInstanceProperty__default.default(_context = userOrganizations.results).call(_context, org => org.id === organizationId);
|
|
135
135
|
if (!matchingOrg) {
|
|
136
136
|
throw new Error(`Organization with ID "${organizationId}" (from ${ENV_VARS.ORGANIZATION_ID}) not found or you don't have admin access to it.`);
|
|
137
137
|
}
|
|
@@ -142,7 +142,7 @@ async function resolveOrganization(_ref) {
|
|
|
142
142
|
}
|
|
143
143
|
if (organizationName) {
|
|
144
144
|
var _context2;
|
|
145
|
-
const matchingOrg = _findInstanceProperty__default
|
|
145
|
+
const matchingOrg = _findInstanceProperty__default.default(_context2 = userOrganizations.results).call(_context2, org => org.name === organizationName);
|
|
146
146
|
if (!matchingOrg) {
|
|
147
147
|
throw new Error(`Organization with name "${organizationName}" (from ${ENV_VARS.ORGANIZATION_NAME}) not found or you don't have admin access to it.`);
|
|
148
148
|
}
|
|
@@ -156,7 +156,7 @@ async function resolveOrganization(_ref) {
|
|
|
156
156
|
if (userOrganizations.total === 1) {
|
|
157
157
|
const _userOrganizations$re = _slicedToArray(userOrganizations.results, 1),
|
|
158
158
|
organization = _userOrganizations$re[0];
|
|
159
|
-
console.log(`Using organization "${chalk__default
|
|
159
|
+
console.log(`Using organization "${chalk__default.default.green(organization.name)}" (only one available).`);
|
|
160
160
|
return {
|
|
161
161
|
id: organization.id,
|
|
162
162
|
name: organization.name
|
|
@@ -164,7 +164,7 @@ async function resolveOrganization(_ref) {
|
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
// Multiple organizations and none specified - error in CI mode
|
|
167
|
-
const orgNames = _mapInstanceProperty__default
|
|
167
|
+
const orgNames = _mapInstanceProperty__default.default(_context3 = userOrganizations.results).call(_context3, org => ` - "${org.name}" (ID: ${org.id})`).join('\n');
|
|
168
168
|
throw new Error(`Multiple organizations found. Please specify one using ${ENV_VARS.ORGANIZATION_ID} or ${ENV_VARS.ORGANIZATION_NAME} environment variable:\n${orgNames}`);
|
|
169
169
|
}
|
|
170
170
|
async function handleCustomApplication(_ref2) {
|
|
@@ -197,8 +197,8 @@ async function handleCustomApplication(_ref2) {
|
|
|
197
197
|
|
|
198
198
|
// Check for changes
|
|
199
199
|
if (!status.configDiff) {
|
|
200
|
-
console.log(chalk__default
|
|
201
|
-
console.log(`URL: ${chalk__default
|
|
200
|
+
console.log(chalk__default.default.green('Custom Application is up-to-date.'));
|
|
201
|
+
console.log(`URL: ${chalk__default.default.gray(status.link)}`);
|
|
202
202
|
return;
|
|
203
203
|
}
|
|
204
204
|
console.log('Changes detected:');
|
|
@@ -245,8 +245,8 @@ async function handleCustomView(_ref3) {
|
|
|
245
245
|
|
|
246
246
|
// Check for changes
|
|
247
247
|
if (!status.configDiff) {
|
|
248
|
-
console.log(chalk__default
|
|
249
|
-
console.log(`URL: ${chalk__default
|
|
248
|
+
console.log(chalk__default.default.green('Custom View is up-to-date.'));
|
|
249
|
+
console.log(`URL: ${chalk__default.default.gray(status.link)}`);
|
|
250
250
|
return;
|
|
251
251
|
}
|
|
252
252
|
console.log('Changes detected:');
|
|
@@ -268,7 +268,7 @@ async function run(options) {
|
|
|
268
268
|
mcApiUrl = _applicationConfig$en.mcApiUrl,
|
|
269
269
|
applicationIdentifier = _applicationConfig$en.applicationIdentifier,
|
|
270
270
|
customViewId = _applicationConfig$en.customViewId;
|
|
271
|
-
console.log(`Environment: ${chalk__default
|
|
271
|
+
console.log(`Environment: ${chalk__default.default.green(mcApiUrl)}`);
|
|
272
272
|
|
|
273
273
|
// Authenticate for CI
|
|
274
274
|
console.log('Authenticating...');
|
|
@@ -276,7 +276,7 @@ async function run(options) {
|
|
|
276
276
|
await authenticateForCI({
|
|
277
277
|
mcApiUrl
|
|
278
278
|
});
|
|
279
|
-
console.log(chalk__default
|
|
279
|
+
console.log(chalk__default.default.green('Authentication successful.'));
|
|
280
280
|
} catch (error) {
|
|
281
281
|
if (error instanceof Error) {
|
|
282
282
|
throw new Error(`Authentication failed: ${error.message}`);
|
|
@@ -302,4 +302,4 @@ async function run(options) {
|
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
304
|
|
|
305
|
-
exports
|
|
305
|
+
exports.default = run;
|
|
@@ -3,12 +3,12 @@ import _findInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instanc
|
|
|
3
3
|
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
|
|
4
4
|
import chalk from 'chalk';
|
|
5
5
|
import { processConfig } from '@commercetools-frontend/application-config';
|
|
6
|
-
import { i as isCustomViewData, c as
|
|
7
|
-
import { f as fetchUserOrganizations } from './graphql-requests-
|
|
6
|
+
import { i as isCustomViewData, c as checkCustomViewStatus, p as performCreateCustomView, a as performUpdateCustomView, b as checkCustomApplicationStatus, d as performCreateCustomApplication, e as performUpdateCustomApplication } from './config-sync-helpers-BLXJp1-D.esm.js';
|
|
7
|
+
import { f as fetchUserOrganizations } from './graphql-requests-DCLX_2y0.esm.js';
|
|
8
8
|
import _Date$now from '@babel/runtime-corejs3/core-js-stable/date/now';
|
|
9
9
|
import _includesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
10
10
|
import jwtDecode from 'jwt-decode';
|
|
11
|
-
import { C as CredentialsStorage } from './credentials-storage-
|
|
11
|
+
import { C as CredentialsStorage } from './credentials-storage-B79bb0Ns.esm.js';
|
|
12
12
|
import '@babel/runtime-corejs3/core-js-stable/json/stringify';
|
|
13
13
|
import 'lodash/omit';
|
|
14
14
|
import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
|
|
@@ -29,13 +29,13 @@ import 'graphql';
|
|
|
29
29
|
import 'graphql-request';
|
|
30
30
|
import '@commercetools-frontend/constants';
|
|
31
31
|
import '@commercetools/http-user-agent';
|
|
32
|
-
import './package-
|
|
32
|
+
import './package-BiK3ergJ.esm.js';
|
|
33
33
|
import '@babel/runtime-corejs3/helpers/classCallCheck';
|
|
34
34
|
import '@babel/runtime-corejs3/helpers/createClass';
|
|
35
35
|
import 'node:fs';
|
|
36
36
|
import 'node:os';
|
|
37
37
|
import 'node:path';
|
|
38
|
-
import './does-file-exist-
|
|
38
|
+
import './does-file-exist-C7l6j7NP.esm.js';
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* Environment variable names for CI authentication
|
|
@@ -5,12 +5,12 @@ var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/insta
|
|
|
5
5
|
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
6
6
|
var chalk = require('chalk');
|
|
7
7
|
var applicationConfig = require('@commercetools-frontend/application-config');
|
|
8
|
-
var configSyncHelpers = require('./config-sync-helpers-
|
|
9
|
-
var graphqlRequests = require('./graphql-requests-
|
|
8
|
+
var configSyncHelpers = require('./config-sync-helpers-DUK45F_R.cjs.dev.js');
|
|
9
|
+
var graphqlRequests = require('./graphql-requests-BeUd4g3v.cjs.dev.js');
|
|
10
10
|
var _Date$now = require('@babel/runtime-corejs3/core-js-stable/date/now');
|
|
11
11
|
var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
12
12
|
var jwtDecode = require('jwt-decode');
|
|
13
|
-
var credentialsStorage = require('./credentials-storage-
|
|
13
|
+
var credentialsStorage = require('./credentials-storage-B0tDCH7i.cjs.dev.js');
|
|
14
14
|
require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
15
15
|
require('lodash/omit');
|
|
16
16
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
@@ -31,15 +31,15 @@ require('graphql');
|
|
|
31
31
|
require('graphql-request');
|
|
32
32
|
require('@commercetools-frontend/constants');
|
|
33
33
|
require('@commercetools/http-user-agent');
|
|
34
|
-
require('./package-
|
|
34
|
+
require('./package-B1Y3_DDl.cjs.dev.js');
|
|
35
35
|
require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
36
36
|
require('@babel/runtime-corejs3/helpers/createClass');
|
|
37
37
|
require('node:fs');
|
|
38
38
|
require('node:os');
|
|
39
39
|
require('node:path');
|
|
40
|
-
require('./does-file-exist-
|
|
40
|
+
require('./does-file-exist-DrcZIPe6.cjs.dev.js');
|
|
41
41
|
|
|
42
|
-
function _interopDefault (e) { return e && e.__esModule ? e : {
|
|
42
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
43
43
|
|
|
44
44
|
var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
|
|
45
45
|
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
|
|
@@ -68,8 +68,8 @@ async function authenticateForCI(_ref) {
|
|
|
68
68
|
const envToken = process.env[ENV_VARS$1.TOKEN];
|
|
69
69
|
if (envToken) {
|
|
70
70
|
try {
|
|
71
|
-
const decodedToken = jwtDecode__default
|
|
72
|
-
const now = Math.floor(_Date$now__default
|
|
71
|
+
const decodedToken = jwtDecode__default.default(envToken);
|
|
72
|
+
const now = Math.floor(_Date$now__default.default() / 1000);
|
|
73
73
|
if (decodedToken.exp <= now) {
|
|
74
74
|
throw new Error('The provided MC_ACCESS_TOKEN has expired');
|
|
75
75
|
}
|
|
@@ -84,7 +84,7 @@ async function authenticateForCI(_ref) {
|
|
|
84
84
|
};
|
|
85
85
|
} catch (error) {
|
|
86
86
|
var _context;
|
|
87
|
-
if (error instanceof Error && _includesInstanceProperty__default
|
|
87
|
+
if (error instanceof Error && _includesInstanceProperty__default.default(_context = error.message).call(_context, 'expired')) {
|
|
88
88
|
throw error;
|
|
89
89
|
}
|
|
90
90
|
throw new Error('The provided MC_ACCESS_TOKEN is invalid');
|
|
@@ -95,7 +95,7 @@ async function authenticateForCI(_ref) {
|
|
|
95
95
|
if (credentialsStorage$1.isSessionValid(mcApiUrl)) {
|
|
96
96
|
const token = credentialsStorage$1.getToken(mcApiUrl);
|
|
97
97
|
if (token) {
|
|
98
|
-
const decodedToken = jwtDecode__default
|
|
98
|
+
const decodedToken = jwtDecode__default.default(token);
|
|
99
99
|
return {
|
|
100
100
|
token,
|
|
101
101
|
expiresAt: decodedToken.exp
|
|
@@ -131,7 +131,7 @@ async function resolveOrganization(_ref) {
|
|
|
131
131
|
const organizationName = process.env[ENV_VARS.ORGANIZATION_NAME];
|
|
132
132
|
if (organizationId) {
|
|
133
133
|
var _context;
|
|
134
|
-
const matchingOrg = _findInstanceProperty__default
|
|
134
|
+
const matchingOrg = _findInstanceProperty__default.default(_context = userOrganizations.results).call(_context, org => org.id === organizationId);
|
|
135
135
|
if (!matchingOrg) {
|
|
136
136
|
throw new Error(`Organization with ID "${organizationId}" (from ${ENV_VARS.ORGANIZATION_ID}) not found or you don't have admin access to it.`);
|
|
137
137
|
}
|
|
@@ -142,7 +142,7 @@ async function resolveOrganization(_ref) {
|
|
|
142
142
|
}
|
|
143
143
|
if (organizationName) {
|
|
144
144
|
var _context2;
|
|
145
|
-
const matchingOrg = _findInstanceProperty__default
|
|
145
|
+
const matchingOrg = _findInstanceProperty__default.default(_context2 = userOrganizations.results).call(_context2, org => org.name === organizationName);
|
|
146
146
|
if (!matchingOrg) {
|
|
147
147
|
throw new Error(`Organization with name "${organizationName}" (from ${ENV_VARS.ORGANIZATION_NAME}) not found or you don't have admin access to it.`);
|
|
148
148
|
}
|
|
@@ -156,7 +156,7 @@ async function resolveOrganization(_ref) {
|
|
|
156
156
|
if (userOrganizations.total === 1) {
|
|
157
157
|
const _userOrganizations$re = _slicedToArray(userOrganizations.results, 1),
|
|
158
158
|
organization = _userOrganizations$re[0];
|
|
159
|
-
console.log(`Using organization "${chalk__default
|
|
159
|
+
console.log(`Using organization "${chalk__default.default.green(organization.name)}" (only one available).`);
|
|
160
160
|
return {
|
|
161
161
|
id: organization.id,
|
|
162
162
|
name: organization.name
|
|
@@ -164,7 +164,7 @@ async function resolveOrganization(_ref) {
|
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
// Multiple organizations and none specified - error in CI mode
|
|
167
|
-
const orgNames = _mapInstanceProperty__default
|
|
167
|
+
const orgNames = _mapInstanceProperty__default.default(_context3 = userOrganizations.results).call(_context3, org => ` - "${org.name}" (ID: ${org.id})`).join('\n');
|
|
168
168
|
throw new Error(`Multiple organizations found. Please specify one using ${ENV_VARS.ORGANIZATION_ID} or ${ENV_VARS.ORGANIZATION_NAME} environment variable:\n${orgNames}`);
|
|
169
169
|
}
|
|
170
170
|
async function handleCustomApplication(_ref2) {
|
|
@@ -197,8 +197,8 @@ async function handleCustomApplication(_ref2) {
|
|
|
197
197
|
|
|
198
198
|
// Check for changes
|
|
199
199
|
if (!status.configDiff) {
|
|
200
|
-
console.log(chalk__default
|
|
201
|
-
console.log(`URL: ${chalk__default
|
|
200
|
+
console.log(chalk__default.default.green('Custom Application is up-to-date.'));
|
|
201
|
+
console.log(`URL: ${chalk__default.default.gray(status.link)}`);
|
|
202
202
|
return;
|
|
203
203
|
}
|
|
204
204
|
console.log('Changes detected:');
|
|
@@ -245,8 +245,8 @@ async function handleCustomView(_ref3) {
|
|
|
245
245
|
|
|
246
246
|
// Check for changes
|
|
247
247
|
if (!status.configDiff) {
|
|
248
|
-
console.log(chalk__default
|
|
249
|
-
console.log(`URL: ${chalk__default
|
|
248
|
+
console.log(chalk__default.default.green('Custom View is up-to-date.'));
|
|
249
|
+
console.log(`URL: ${chalk__default.default.gray(status.link)}`);
|
|
250
250
|
return;
|
|
251
251
|
}
|
|
252
252
|
console.log('Changes detected:');
|
|
@@ -268,7 +268,7 @@ async function run(options) {
|
|
|
268
268
|
mcApiUrl = _applicationConfig$en.mcApiUrl,
|
|
269
269
|
applicationIdentifier = _applicationConfig$en.applicationIdentifier,
|
|
270
270
|
customViewId = _applicationConfig$en.customViewId;
|
|
271
|
-
console.log(`Environment: ${chalk__default
|
|
271
|
+
console.log(`Environment: ${chalk__default.default.green(mcApiUrl)}`);
|
|
272
272
|
|
|
273
273
|
// Authenticate for CI
|
|
274
274
|
console.log('Authenticating...');
|
|
@@ -276,7 +276,7 @@ async function run(options) {
|
|
|
276
276
|
await authenticateForCI({
|
|
277
277
|
mcApiUrl
|
|
278
278
|
});
|
|
279
|
-
console.log(chalk__default
|
|
279
|
+
console.log(chalk__default.default.green('Authentication successful.'));
|
|
280
280
|
} catch (error) {
|
|
281
281
|
if (error instanceof Error) {
|
|
282
282
|
throw new Error(`Authentication failed: ${error.message}`);
|
|
@@ -302,4 +302,4 @@ async function run(options) {
|
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
304
|
|
|
305
|
-
exports
|
|
305
|
+
exports.default = run;
|