@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,8 +7,8 @@ var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/insta
|
|
|
7
7
|
var chalk = require('chalk');
|
|
8
8
|
var prompts = require('prompts');
|
|
9
9
|
var applicationConfig = require('@commercetools-frontend/application-config');
|
|
10
|
-
var credentialsStorage$1 = require('./credentials-storage-
|
|
11
|
-
var graphqlRequests = require('./graphql-requests-
|
|
10
|
+
var credentialsStorage$1 = require('./credentials-storage-B0tDCH7i.cjs.dev.js');
|
|
11
|
+
var graphqlRequests = require('./graphql-requests-BeUd4g3v.cjs.dev.js');
|
|
12
12
|
require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
13
13
|
require('@babel/runtime-corejs3/helpers/createClass');
|
|
14
14
|
require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
@@ -16,7 +16,7 @@ require('@babel/runtime-corejs3/core-js-stable/date/now');
|
|
|
16
16
|
require('node:fs');
|
|
17
17
|
require('node:os');
|
|
18
18
|
require('node:path');
|
|
19
|
-
require('./does-file-exist-
|
|
19
|
+
require('./does-file-exist-DrcZIPe6.cjs.dev.js');
|
|
20
20
|
require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
21
21
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
22
22
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor');
|
|
@@ -30,9 +30,9 @@ require('graphql');
|
|
|
30
30
|
require('graphql-request');
|
|
31
31
|
require('@commercetools-frontend/constants');
|
|
32
32
|
require('@commercetools/http-user-agent');
|
|
33
|
-
require('./package-
|
|
33
|
+
require('./package-B1Y3_DDl.cjs.dev.js');
|
|
34
34
|
|
|
35
|
-
function _interopDefault (e) { return e && e.__esModule ? e : {
|
|
35
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
36
36
|
|
|
37
37
|
var _URL__default = /*#__PURE__*/_interopDefault(_URL);
|
|
38
38
|
var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
|
|
@@ -46,8 +46,8 @@ const validateUrl = function () {
|
|
|
46
46
|
let url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
47
47
|
try {
|
|
48
48
|
var _context;
|
|
49
|
-
const urlSchema = new _URL__default
|
|
50
|
-
return _includesInstanceProperty__default
|
|
49
|
+
const urlSchema = new _URL__default.default(url);
|
|
50
|
+
return _includesInstanceProperty__default.default(_context = ['http:', 'https:']).call(_context, urlSchema.protocol);
|
|
51
51
|
} catch (error) {
|
|
52
52
|
return false;
|
|
53
53
|
}
|
|
@@ -55,7 +55,7 @@ const validateUrl = function () {
|
|
|
55
55
|
const validateAlias = function () {
|
|
56
56
|
let alias = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
57
57
|
try {
|
|
58
|
-
new _URL__default
|
|
58
|
+
new _URL__default.default(`https://${alias}.commercetools.com/`);
|
|
59
59
|
return true;
|
|
60
60
|
} catch (error) {
|
|
61
61
|
return false;
|
|
@@ -99,37 +99,37 @@ async function setDeploymentPreview(_ref2) {
|
|
|
99
99
|
// If the alias was not provided as an argument to the script, let's ask for it.
|
|
100
100
|
if (!deploymentAlias) {
|
|
101
101
|
var _context2;
|
|
102
|
-
const _await$prompts = await prompts__default
|
|
102
|
+
const _await$prompts = await prompts__default.default({
|
|
103
103
|
type: 'text',
|
|
104
104
|
name: 'alias',
|
|
105
|
-
message: _filterInstanceProperty__default
|
|
105
|
+
message: _filterInstanceProperty__default.default(_context2 = [`Enter the alias for the deployment preview`, options.dryRun && chalk__default.default.gray('Using "--dry-run", no deployment preview will be created.')]).call(_context2, Boolean).join('\n'),
|
|
106
106
|
validate: value => validateAlias(value)
|
|
107
107
|
}),
|
|
108
108
|
alias = _await$prompts.alias;
|
|
109
109
|
deploymentAlias = alias;
|
|
110
110
|
}
|
|
111
|
-
const existingDeploymentPreview = _findInstanceProperty__default
|
|
111
|
+
const existingDeploymentPreview = _findInstanceProperty__default.default(_context3 = fetchedCustomApplication.application.deployments).call(_context3, deployment => deployment.alias === deploymentAlias);
|
|
112
112
|
if (!options.alias && !options.url && existingDeploymentPreview) {
|
|
113
113
|
var _context4;
|
|
114
|
-
const _await$prompts2 = await prompts__default
|
|
114
|
+
const _await$prompts2 = await prompts__default.default({
|
|
115
115
|
type: 'confirm',
|
|
116
116
|
name: 'aliasOverrideConfirmation',
|
|
117
|
-
message: _filterInstanceProperty__default
|
|
117
|
+
message: _filterInstanceProperty__default.default(_context4 = [`The alias "${chalk__default.default.green(deploymentAlias)}" already exists. Do you want to proceed and update the URL?`, options.dryRun && chalk__default.default.gray('Using "--dry-run", no deployment preview will be created.')]).call(_context4, Boolean).join('\n'),
|
|
118
118
|
initial: false
|
|
119
119
|
}),
|
|
120
120
|
aliasOverrideConfirmation = _await$prompts2.aliasOverrideConfirmation;
|
|
121
121
|
if (!aliasOverrideConfirmation) {
|
|
122
|
-
console.log(chalk__default
|
|
122
|
+
console.log(chalk__default.default.red('Aborted.'));
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
let deploymentUrl = options.url;
|
|
127
127
|
if (!deploymentUrl) {
|
|
128
128
|
var _context5;
|
|
129
|
-
const _await$prompts3 = await prompts__default
|
|
129
|
+
const _await$prompts3 = await prompts__default.default({
|
|
130
130
|
type: 'text',
|
|
131
131
|
name: 'url',
|
|
132
|
-
message: _filterInstanceProperty__default
|
|
132
|
+
message: _filterInstanceProperty__default.default(_context5 = [`Enter the URL for the deployment preview`, options.dryRun && chalk__default.default.gray('Using "--dry-run", no deployment preview will be created.')]).call(_context5, Boolean).join('\n'),
|
|
133
133
|
validate: value => validateUrl(value)
|
|
134
134
|
}),
|
|
135
135
|
url = _await$prompts3.url;
|
|
@@ -156,8 +156,8 @@ async function setDeploymentPreview(_ref2) {
|
|
|
156
156
|
url: deploymentUrl
|
|
157
157
|
}
|
|
158
158
|
});
|
|
159
|
-
console.log(chalk__default
|
|
160
|
-
console.log(chalk__default
|
|
159
|
+
console.log(chalk__default.default.green(`Deployment preview with alias "${deploymentAlias}" updated successfully with URL "${deploymentUrl}".`));
|
|
160
|
+
console.log(chalk__default.default.green(`You can access the deployment previews at: ${mcDeploymentPreviewsLink}`));
|
|
161
161
|
} else {
|
|
162
162
|
await graphqlRequests.createCustomApplicationDeploymentPreview({
|
|
163
163
|
mcApiUrl,
|
|
@@ -169,8 +169,8 @@ async function setDeploymentPreview(_ref2) {
|
|
|
169
169
|
url: deploymentUrl
|
|
170
170
|
}
|
|
171
171
|
});
|
|
172
|
-
console.log(chalk__default
|
|
173
|
-
console.log(chalk__default
|
|
172
|
+
console.log(chalk__default.default.green(`Deployment preview with alias "${deploymentAlias}" created successfully with URL "${deploymentUrl}".`));
|
|
173
|
+
console.log(chalk__default.default.green(`You can access the deployment previews at: ${mcDeploymentPreviewsLink}`));
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
async function run(options) {
|
|
@@ -180,7 +180,7 @@ async function run(options) {
|
|
|
180
180
|
mcApiUrl = _applicationConfig$en.mcApiUrl,
|
|
181
181
|
applicationIdentifier = _applicationConfig$en.applicationIdentifier;
|
|
182
182
|
const isCustomView = isCustomViewData(localCustomEntityData);
|
|
183
|
-
console.log(`Using Merchant Center environment "${chalk__default
|
|
183
|
+
console.log(`Using Merchant Center environment "${chalk__default.default.green(mcApiUrl)}".`);
|
|
184
184
|
console.log();
|
|
185
185
|
const isSessionValid = credentialsStorage.isSessionValid(mcApiUrl);
|
|
186
186
|
if (!isSessionValid) {
|
|
@@ -199,4 +199,4 @@ async function run(options) {
|
|
|
199
199
|
});
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
-
exports
|
|
202
|
+
exports.default = run;
|
package/dist/{deployment-previews-set-4b020cb4.esm.js → deployment-previews-set-C2OPIfy-.esm.js}
RENAMED
|
@@ -5,8 +5,8 @@ import _findInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instanc
|
|
|
5
5
|
import chalk from 'chalk';
|
|
6
6
|
import prompts from 'prompts';
|
|
7
7
|
import { processConfig } from '@commercetools-frontend/application-config';
|
|
8
|
-
import { C as CredentialsStorage } from './credentials-storage-
|
|
9
|
-
import {
|
|
8
|
+
import { C as CredentialsStorage } from './credentials-storage-B79bb0Ns.esm.js';
|
|
9
|
+
import { a as fetchCustomApplication, u as updateCustomApplicationDeploymentPreview, c as createCustomApplicationDeploymentPreview } from './graphql-requests-DCLX_2y0.esm.js';
|
|
10
10
|
import '@babel/runtime-corejs3/helpers/classCallCheck';
|
|
11
11
|
import '@babel/runtime-corejs3/helpers/createClass';
|
|
12
12
|
import '@babel/runtime-corejs3/core-js-stable/json/stringify';
|
|
@@ -14,7 +14,7 @@ import '@babel/runtime-corejs3/core-js-stable/date/now';
|
|
|
14
14
|
import 'node:fs';
|
|
15
15
|
import 'node:os';
|
|
16
16
|
import 'node:path';
|
|
17
|
-
import './does-file-exist-
|
|
17
|
+
import './does-file-exist-C7l6j7NP.esm.js';
|
|
18
18
|
import '@babel/runtime-corejs3/core-js-stable/object/keys';
|
|
19
19
|
import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
|
|
20
20
|
import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor';
|
|
@@ -28,7 +28,7 @@ import 'graphql';
|
|
|
28
28
|
import 'graphql-request';
|
|
29
29
|
import '@commercetools-frontend/constants';
|
|
30
30
|
import '@commercetools/http-user-agent';
|
|
31
|
-
import './package-
|
|
31
|
+
import './package-BiK3ergJ.esm.js';
|
|
32
32
|
|
|
33
33
|
const credentialsStorage = new CredentialsStorage();
|
|
34
34
|
const validateUrl = function () {
|
|
@@ -7,8 +7,8 @@ var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/insta
|
|
|
7
7
|
var chalk = require('chalk');
|
|
8
8
|
var prompts = require('prompts');
|
|
9
9
|
var applicationConfig = require('@commercetools-frontend/application-config');
|
|
10
|
-
var credentialsStorage$1 = require('./credentials-storage-
|
|
11
|
-
var graphqlRequests = require('./graphql-requests-
|
|
10
|
+
var credentialsStorage$1 = require('./credentials-storage-C3TlK0a8.cjs.prod.js');
|
|
11
|
+
var graphqlRequests = require('./graphql-requests-D0rtMo7K.cjs.prod.js');
|
|
12
12
|
require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
13
13
|
require('@babel/runtime-corejs3/helpers/createClass');
|
|
14
14
|
require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
@@ -16,7 +16,7 @@ require('@babel/runtime-corejs3/core-js-stable/date/now');
|
|
|
16
16
|
require('node:fs');
|
|
17
17
|
require('node:os');
|
|
18
18
|
require('node:path');
|
|
19
|
-
require('./does-file-exist-
|
|
19
|
+
require('./does-file-exist-DrcZIPe6.cjs.prod.js');
|
|
20
20
|
require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
21
21
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
22
22
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor');
|
|
@@ -30,9 +30,9 @@ require('graphql');
|
|
|
30
30
|
require('graphql-request');
|
|
31
31
|
require('@commercetools-frontend/constants');
|
|
32
32
|
require('@commercetools/http-user-agent');
|
|
33
|
-
require('./package-
|
|
33
|
+
require('./package-DxhqRLHb.cjs.prod.js');
|
|
34
34
|
|
|
35
|
-
function _interopDefault (e) { return e && e.__esModule ? e : {
|
|
35
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
36
36
|
|
|
37
37
|
var _URL__default = /*#__PURE__*/_interopDefault(_URL);
|
|
38
38
|
var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
|
|
@@ -46,8 +46,8 @@ const validateUrl = function () {
|
|
|
46
46
|
let url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
47
47
|
try {
|
|
48
48
|
var _context;
|
|
49
|
-
const urlSchema = new _URL__default
|
|
50
|
-
return _includesInstanceProperty__default
|
|
49
|
+
const urlSchema = new _URL__default.default(url);
|
|
50
|
+
return _includesInstanceProperty__default.default(_context = ['http:', 'https:']).call(_context, urlSchema.protocol);
|
|
51
51
|
} catch (error) {
|
|
52
52
|
return false;
|
|
53
53
|
}
|
|
@@ -55,7 +55,7 @@ const validateUrl = function () {
|
|
|
55
55
|
const validateAlias = function () {
|
|
56
56
|
let alias = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
57
57
|
try {
|
|
58
|
-
new _URL__default
|
|
58
|
+
new _URL__default.default(`https://${alias}.commercetools.com/`);
|
|
59
59
|
return true;
|
|
60
60
|
} catch (error) {
|
|
61
61
|
return false;
|
|
@@ -99,37 +99,37 @@ async function setDeploymentPreview(_ref2) {
|
|
|
99
99
|
// If the alias was not provided as an argument to the script, let's ask for it.
|
|
100
100
|
if (!deploymentAlias) {
|
|
101
101
|
var _context2;
|
|
102
|
-
const _await$prompts = await prompts__default
|
|
102
|
+
const _await$prompts = await prompts__default.default({
|
|
103
103
|
type: 'text',
|
|
104
104
|
name: 'alias',
|
|
105
|
-
message: _filterInstanceProperty__default
|
|
105
|
+
message: _filterInstanceProperty__default.default(_context2 = [`Enter the alias for the deployment preview`, options.dryRun && chalk__default.default.gray('Using "--dry-run", no deployment preview will be created.')]).call(_context2, Boolean).join('\n'),
|
|
106
106
|
validate: value => validateAlias(value)
|
|
107
107
|
}),
|
|
108
108
|
alias = _await$prompts.alias;
|
|
109
109
|
deploymentAlias = alias;
|
|
110
110
|
}
|
|
111
|
-
const existingDeploymentPreview = _findInstanceProperty__default
|
|
111
|
+
const existingDeploymentPreview = _findInstanceProperty__default.default(_context3 = fetchedCustomApplication.application.deployments).call(_context3, deployment => deployment.alias === deploymentAlias);
|
|
112
112
|
if (!options.alias && !options.url && existingDeploymentPreview) {
|
|
113
113
|
var _context4;
|
|
114
|
-
const _await$prompts2 = await prompts__default
|
|
114
|
+
const _await$prompts2 = await prompts__default.default({
|
|
115
115
|
type: 'confirm',
|
|
116
116
|
name: 'aliasOverrideConfirmation',
|
|
117
|
-
message: _filterInstanceProperty__default
|
|
117
|
+
message: _filterInstanceProperty__default.default(_context4 = [`The alias "${chalk__default.default.green(deploymentAlias)}" already exists. Do you want to proceed and update the URL?`, options.dryRun && chalk__default.default.gray('Using "--dry-run", no deployment preview will be created.')]).call(_context4, Boolean).join('\n'),
|
|
118
118
|
initial: false
|
|
119
119
|
}),
|
|
120
120
|
aliasOverrideConfirmation = _await$prompts2.aliasOverrideConfirmation;
|
|
121
121
|
if (!aliasOverrideConfirmation) {
|
|
122
|
-
console.log(chalk__default
|
|
122
|
+
console.log(chalk__default.default.red('Aborted.'));
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
let deploymentUrl = options.url;
|
|
127
127
|
if (!deploymentUrl) {
|
|
128
128
|
var _context5;
|
|
129
|
-
const _await$prompts3 = await prompts__default
|
|
129
|
+
const _await$prompts3 = await prompts__default.default({
|
|
130
130
|
type: 'text',
|
|
131
131
|
name: 'url',
|
|
132
|
-
message: _filterInstanceProperty__default
|
|
132
|
+
message: _filterInstanceProperty__default.default(_context5 = [`Enter the URL for the deployment preview`, options.dryRun && chalk__default.default.gray('Using "--dry-run", no deployment preview will be created.')]).call(_context5, Boolean).join('\n'),
|
|
133
133
|
validate: value => validateUrl(value)
|
|
134
134
|
}),
|
|
135
135
|
url = _await$prompts3.url;
|
|
@@ -156,8 +156,8 @@ async function setDeploymentPreview(_ref2) {
|
|
|
156
156
|
url: deploymentUrl
|
|
157
157
|
}
|
|
158
158
|
});
|
|
159
|
-
console.log(chalk__default
|
|
160
|
-
console.log(chalk__default
|
|
159
|
+
console.log(chalk__default.default.green(`Deployment preview with alias "${deploymentAlias}" updated successfully with URL "${deploymentUrl}".`));
|
|
160
|
+
console.log(chalk__default.default.green(`You can access the deployment previews at: ${mcDeploymentPreviewsLink}`));
|
|
161
161
|
} else {
|
|
162
162
|
await graphqlRequests.createCustomApplicationDeploymentPreview({
|
|
163
163
|
mcApiUrl,
|
|
@@ -169,8 +169,8 @@ async function setDeploymentPreview(_ref2) {
|
|
|
169
169
|
url: deploymentUrl
|
|
170
170
|
}
|
|
171
171
|
});
|
|
172
|
-
console.log(chalk__default
|
|
173
|
-
console.log(chalk__default
|
|
172
|
+
console.log(chalk__default.default.green(`Deployment preview with alias "${deploymentAlias}" created successfully with URL "${deploymentUrl}".`));
|
|
173
|
+
console.log(chalk__default.default.green(`You can access the deployment previews at: ${mcDeploymentPreviewsLink}`));
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
async function run(options) {
|
|
@@ -180,7 +180,7 @@ async function run(options) {
|
|
|
180
180
|
mcApiUrl = _applicationConfig$en.mcApiUrl,
|
|
181
181
|
applicationIdentifier = _applicationConfig$en.applicationIdentifier;
|
|
182
182
|
const isCustomView = isCustomViewData(localCustomEntityData);
|
|
183
|
-
console.log(`Using Merchant Center environment "${chalk__default
|
|
183
|
+
console.log(`Using Merchant Center environment "${chalk__default.default.green(mcApiUrl)}".`);
|
|
184
184
|
console.log();
|
|
185
185
|
const isSessionValid = credentialsStorage.isSessionValid(mcApiUrl);
|
|
186
186
|
if (!isSessionValid) {
|
|
@@ -199,4 +199,4 @@ async function run(options) {
|
|
|
199
199
|
});
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
-
exports
|
|
202
|
+
exports.default = run;
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
var fs = require('node:fs');
|
|
4
4
|
|
|
5
|
-
function _interopDefault (e) { return e && e.__esModule ? e : {
|
|
5
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
6
6
|
|
|
7
7
|
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
8
8
|
|
|
9
9
|
function doesFileExist(path) {
|
|
10
10
|
try {
|
|
11
|
-
fs__default
|
|
11
|
+
fs__default.default.accessSync(path);
|
|
12
12
|
return true;
|
|
13
13
|
} catch (error) {
|
|
14
14
|
return false;
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
var fs = require('node:fs');
|
|
4
4
|
|
|
5
|
-
function _interopDefault (e) { return e && e.__esModule ? e : {
|
|
5
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
6
6
|
|
|
7
7
|
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
8
8
|
|
|
9
9
|
function doesFileExist(path) {
|
|
10
10
|
try {
|
|
11
|
-
fs__default
|
|
11
|
+
fs__default.default.accessSync(path);
|
|
12
12
|
return true;
|
|
13
13
|
} catch (error) {
|
|
14
14
|
return false;
|
|
@@ -14,11 +14,11 @@ var chalk = require('chalk');
|
|
|
14
14
|
var graphql = require('graphql');
|
|
15
15
|
var graphqlRequest = require('graphql-request');
|
|
16
16
|
var constants = require('@commercetools-frontend/constants');
|
|
17
|
-
var credentialsStorage$1 = require('./credentials-storage-
|
|
17
|
+
var credentialsStorage$1 = require('./credentials-storage-B0tDCH7i.cjs.dev.js');
|
|
18
18
|
var createHttpUserAgent = require('@commercetools/http-user-agent');
|
|
19
|
-
var _package = require('./package-
|
|
19
|
+
var _package = require('./package-B1Y3_DDl.cjs.dev.js');
|
|
20
20
|
|
|
21
|
-
function _interopDefault (e) { return e && e.__esModule ? e : {
|
|
21
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
22
22
|
|
|
23
23
|
var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
|
|
24
24
|
var _Object$getOwnPropertySymbols__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertySymbols);
|
|
@@ -32,7 +32,7 @@ var _someInstanceProperty__default = /*#__PURE__*/_interopDefault(_someInstanceP
|
|
|
32
32
|
var chalk__default = /*#__PURE__*/_interopDefault(chalk);
|
|
33
33
|
var createHttpUserAgent__default = /*#__PURE__*/_interopDefault(createHttpUserAgent);
|
|
34
34
|
|
|
35
|
-
const userAgent = createHttpUserAgent__default
|
|
35
|
+
const userAgent = createHttpUserAgent__default.default({
|
|
36
36
|
name: 'graphql-request',
|
|
37
37
|
libraryName: 'mc-scripts',
|
|
38
38
|
libraryVersion: _package.pkgJson.version,
|
|
@@ -41,8 +41,8 @@ const userAgent = createHttpUserAgent__default["default"]({
|
|
|
41
41
|
contactEmail: 'support@commercetools.com'
|
|
42
42
|
});
|
|
43
43
|
|
|
44
|
-
function ownKeys(e, r) { var t = _Object$keys__default
|
|
45
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default
|
|
44
|
+
function ownKeys(e, r) { var t = _Object$keys__default.default(e); if (_Object$getOwnPropertySymbols__default.default) { var o = _Object$getOwnPropertySymbols__default.default(e); r && (o = _filterInstanceProperty__default.default(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default.default(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
45
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default.default(_context2 = ownKeys(Object(t), true)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default.default ? _Object$defineProperties__default.default(e, _Object$getOwnPropertyDescriptors__default.default(t)) : _forEachInstanceProperty__default.default(_context3 = ownKeys(Object(t))).call(_context3, function (r) { _Object$defineProperty__default.default(e, r, _Object$getOwnPropertyDescriptor__default.default(t, r)); }); } return e; }
|
|
46
46
|
var CreateCustomApplicationDeploymentPreviewFromCli = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "CreateCustomApplicationDeploymentPreview" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "organizationId" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "applicationId" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "ID" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "CustomApplicationDeploymentPreviewCreateInput" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "createCustomApplicationDeploymentPreview" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "organizationId" }, value: { kind: "Variable", name: { kind: "Name", value: "organizationId" } } }, { kind: "Argument", name: { kind: "Name", value: "applicationId" }, value: { kind: "Variable", name: { kind: "Name", value: "applicationId" } } }, { kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "alias" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "url" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 327, source: { body: "mutation CreateCustomApplicationDeploymentPreview(\n $organizationId: String!\n $applicationId: ID!\n $data: CustomApplicationDeploymentPreviewCreateInput!\n) {\n createCustomApplicationDeploymentPreview(\n organizationId: $organizationId\n applicationId: $applicationId\n data: $data\n ) {\n id\n alias\n url\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
47
47
|
var CreateCustomApplicationFromCli = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "CreateCustomApplicationFromCli" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "organizationId" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "CustomApplicationDraftDataInput" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "createCustomApplication" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "organizationId" }, value: { kind: "Variable", name: { kind: "Name", value: "organizationId" } } }, { kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 201, source: { body: "mutation CreateCustomApplicationFromCli(\n $organizationId: String!\n $data: CustomApplicationDraftDataInput!\n) {\n createCustomApplication(organizationId: $organizationId, data: $data) {\n id\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
48
48
|
var CreateCustomViewFromCli = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "CreateCustomViewFromCli" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "organizationId" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "CustomViewDraftDataInput" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "createCustomView" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "organizationId" }, value: { kind: "Variable", name: { kind: "Name", value: "organizationId" } } }, { kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 180, source: { body: "mutation CreateCustomViewFromCli(\n $organizationId: String!\n $data: CustomViewDraftDataInput!\n) {\n createCustomView(organizationId: $organizationId, data: $data) {\n id\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
@@ -72,7 +72,7 @@ async function requestWithTokenRetry(document, requestOptions) {
|
|
|
72
72
|
// In case a new session token is returned from the server, save it.
|
|
73
73
|
const refreshedSessionToken = result.headers.get('x-refreshed-session-token');
|
|
74
74
|
if (refreshedSessionToken) {
|
|
75
|
-
console.log(chalk__default
|
|
75
|
+
console.log(chalk__default.default.green('Session token refreshed.'));
|
|
76
76
|
console.log();
|
|
77
77
|
const refreshedSessionTokenExpiresAt = result.headers.get('x-refreshed-session-token-expires-at');
|
|
78
78
|
// Store the updated access token.
|
|
@@ -87,9 +87,9 @@ async function requestWithTokenRetry(document, requestOptions) {
|
|
|
87
87
|
// If it's an unauthorized error, retry the request to force the token to be refreshed.
|
|
88
88
|
if (retryCount === 0 && error.response.errors && error.response.errors.length > 0) {
|
|
89
89
|
var _context;
|
|
90
|
-
const isUnauthorizedError = _someInstanceProperty__default
|
|
90
|
+
const isUnauthorizedError = _someInstanceProperty__default.default(_context = error.response.errors).call(_context, graphqlError => graphqlError.extensions?.code === 'UNAUTHENTICATED');
|
|
91
91
|
if (isUnauthorizedError) {
|
|
92
|
-
console.log(chalk__default
|
|
92
|
+
console.log(chalk__default.default.yellow('Expired or invalid session token, attempting to retry the request with a refreshed token...'));
|
|
93
93
|
return requestWithTokenRetry(document, _objectSpread(_objectSpread({}, requestOptions), {}, {
|
|
94
94
|
headers: _objectSpread(_objectSpread({}, requestOptions.headers), {}, {
|
|
95
95
|
'X-Force-Token': 'true'
|
package/dist/{graphql-requests-6ead2029.cjs.prod.js → graphql-requests-D0rtMo7K.cjs.prod.js}
RENAMED
|
@@ -14,11 +14,11 @@ var chalk = require('chalk');
|
|
|
14
14
|
var graphql = require('graphql');
|
|
15
15
|
var graphqlRequest = require('graphql-request');
|
|
16
16
|
var constants = require('@commercetools-frontend/constants');
|
|
17
|
-
var credentialsStorage$1 = require('./credentials-storage-
|
|
17
|
+
var credentialsStorage$1 = require('./credentials-storage-C3TlK0a8.cjs.prod.js');
|
|
18
18
|
var createHttpUserAgent = require('@commercetools/http-user-agent');
|
|
19
|
-
var _package = require('./package-
|
|
19
|
+
var _package = require('./package-DxhqRLHb.cjs.prod.js');
|
|
20
20
|
|
|
21
|
-
function _interopDefault (e) { return e && e.__esModule ? e : {
|
|
21
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
22
22
|
|
|
23
23
|
var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
|
|
24
24
|
var _Object$getOwnPropertySymbols__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertySymbols);
|
|
@@ -32,7 +32,7 @@ var _someInstanceProperty__default = /*#__PURE__*/_interopDefault(_someInstanceP
|
|
|
32
32
|
var chalk__default = /*#__PURE__*/_interopDefault(chalk);
|
|
33
33
|
var createHttpUserAgent__default = /*#__PURE__*/_interopDefault(createHttpUserAgent);
|
|
34
34
|
|
|
35
|
-
const userAgent = createHttpUserAgent__default
|
|
35
|
+
const userAgent = createHttpUserAgent__default.default({
|
|
36
36
|
name: 'graphql-request',
|
|
37
37
|
libraryName: 'mc-scripts',
|
|
38
38
|
libraryVersion: _package.pkgJson.version,
|
|
@@ -41,8 +41,8 @@ const userAgent = createHttpUserAgent__default["default"]({
|
|
|
41
41
|
contactEmail: 'support@commercetools.com'
|
|
42
42
|
});
|
|
43
43
|
|
|
44
|
-
function ownKeys(e, r) { var t = _Object$keys__default
|
|
45
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default
|
|
44
|
+
function ownKeys(e, r) { var t = _Object$keys__default.default(e); if (_Object$getOwnPropertySymbols__default.default) { var o = _Object$getOwnPropertySymbols__default.default(e); r && (o = _filterInstanceProperty__default.default(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default.default(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
45
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default.default(_context2 = ownKeys(Object(t), true)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default.default ? _Object$defineProperties__default.default(e, _Object$getOwnPropertyDescriptors__default.default(t)) : _forEachInstanceProperty__default.default(_context3 = ownKeys(Object(t))).call(_context3, function (r) { _Object$defineProperty__default.default(e, r, _Object$getOwnPropertyDescriptor__default.default(t, r)); }); } return e; }
|
|
46
46
|
var CreateCustomApplicationDeploymentPreviewFromCli = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "CreateCustomApplicationDeploymentPreview" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "organizationId" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "applicationId" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "ID" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "CustomApplicationDeploymentPreviewCreateInput" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "createCustomApplicationDeploymentPreview" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "organizationId" }, value: { kind: "Variable", name: { kind: "Name", value: "organizationId" } } }, { kind: "Argument", name: { kind: "Name", value: "applicationId" }, value: { kind: "Variable", name: { kind: "Name", value: "applicationId" } } }, { kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "alias" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "url" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 327, source: { body: "mutation CreateCustomApplicationDeploymentPreview(\n $organizationId: String!\n $applicationId: ID!\n $data: CustomApplicationDeploymentPreviewCreateInput!\n) {\n createCustomApplicationDeploymentPreview(\n organizationId: $organizationId\n applicationId: $applicationId\n data: $data\n ) {\n id\n alias\n url\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
47
47
|
var CreateCustomApplicationFromCli = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "CreateCustomApplicationFromCli" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "organizationId" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "CustomApplicationDraftDataInput" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "createCustomApplication" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "organizationId" }, value: { kind: "Variable", name: { kind: "Name", value: "organizationId" } } }, { kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 201, source: { body: "mutation CreateCustomApplicationFromCli(\n $organizationId: String!\n $data: CustomApplicationDraftDataInput!\n) {\n createCustomApplication(organizationId: $organizationId, data: $data) {\n id\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
48
48
|
var CreateCustomViewFromCli = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "CreateCustomViewFromCli" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "organizationId" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "CustomViewDraftDataInput" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "createCustomView" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "organizationId" }, value: { kind: "Variable", name: { kind: "Name", value: "organizationId" } } }, { kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 180, source: { body: "mutation CreateCustomViewFromCli(\n $organizationId: String!\n $data: CustomViewDraftDataInput!\n) {\n createCustomView(organizationId: $organizationId, data: $data) {\n id\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
@@ -72,7 +72,7 @@ async function requestWithTokenRetry(document, requestOptions) {
|
|
|
72
72
|
// In case a new session token is returned from the server, save it.
|
|
73
73
|
const refreshedSessionToken = result.headers.get('x-refreshed-session-token');
|
|
74
74
|
if (refreshedSessionToken) {
|
|
75
|
-
console.log(chalk__default
|
|
75
|
+
console.log(chalk__default.default.green('Session token refreshed.'));
|
|
76
76
|
console.log();
|
|
77
77
|
const refreshedSessionTokenExpiresAt = result.headers.get('x-refreshed-session-token-expires-at');
|
|
78
78
|
// Store the updated access token.
|
|
@@ -87,9 +87,9 @@ async function requestWithTokenRetry(document, requestOptions) {
|
|
|
87
87
|
// If it's an unauthorized error, retry the request to force the token to be refreshed.
|
|
88
88
|
if (retryCount === 0 && error.response.errors && error.response.errors.length > 0) {
|
|
89
89
|
var _context;
|
|
90
|
-
const isUnauthorizedError = _someInstanceProperty__default
|
|
90
|
+
const isUnauthorizedError = _someInstanceProperty__default.default(_context = error.response.errors).call(_context, graphqlError => graphqlError.extensions?.code === 'UNAUTHENTICATED');
|
|
91
91
|
if (isUnauthorizedError) {
|
|
92
|
-
console.log(chalk__default
|
|
92
|
+
console.log(chalk__default.default.yellow('Expired or invalid session token, attempting to retry the request with a refreshed token...'));
|
|
93
93
|
return requestWithTokenRetry(document, _objectSpread(_objectSpread({}, requestOptions), {}, {
|
|
94
94
|
headers: _objectSpread(_objectSpread({}, requestOptions.headers), {}, {
|
|
95
95
|
'X-Force-Token': 'true'
|
|
@@ -12,9 +12,9 @@ import chalk from 'chalk';
|
|
|
12
12
|
import { print } from 'graphql';
|
|
13
13
|
import { GraphQLClient, ClientError } from 'graphql-request';
|
|
14
14
|
import { GRAPHQL_TARGETS, SUPPORTED_HEADERS } from '@commercetools-frontend/constants';
|
|
15
|
-
import { C as CredentialsStorage } from './credentials-storage-
|
|
15
|
+
import { C as CredentialsStorage } from './credentials-storage-B79bb0Ns.esm.js';
|
|
16
16
|
import createHttpUserAgent from '@commercetools/http-user-agent';
|
|
17
|
-
import { p as pkgJson } from './package-
|
|
17
|
+
import { p as pkgJson } from './package-BiK3ergJ.esm.js';
|
|
18
18
|
|
|
19
19
|
const userAgent = createHttpUserAgent({
|
|
20
20
|
name: 'graphql-request',
|
|
@@ -26,7 +26,7 @@ const userAgent = createHttpUserAgent({
|
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
29
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context2 = ownKeys(Object(t),
|
|
29
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context2 = ownKeys(Object(t), true)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context3 = ownKeys(Object(t))).call(_context3, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
30
30
|
var CreateCustomApplicationDeploymentPreviewFromCli = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "CreateCustomApplicationDeploymentPreview" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "organizationId" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "applicationId" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "ID" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "CustomApplicationDeploymentPreviewCreateInput" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "createCustomApplicationDeploymentPreview" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "organizationId" }, value: { kind: "Variable", name: { kind: "Name", value: "organizationId" } } }, { kind: "Argument", name: { kind: "Name", value: "applicationId" }, value: { kind: "Variable", name: { kind: "Name", value: "applicationId" } } }, { kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "alias" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "url" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 327, source: { body: "mutation CreateCustomApplicationDeploymentPreview(\n $organizationId: String!\n $applicationId: ID!\n $data: CustomApplicationDeploymentPreviewCreateInput!\n) {\n createCustomApplicationDeploymentPreview(\n organizationId: $organizationId\n applicationId: $applicationId\n data: $data\n ) {\n id\n alias\n url\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
31
31
|
var CreateCustomApplicationFromCli = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "CreateCustomApplicationFromCli" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "organizationId" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "CustomApplicationDraftDataInput" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "createCustomApplication" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "organizationId" }, value: { kind: "Variable", name: { kind: "Name", value: "organizationId" } } }, { kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 201, source: { body: "mutation CreateCustomApplicationFromCli(\n $organizationId: String!\n $data: CustomApplicationDraftDataInput!\n) {\n createCustomApplication(organizationId: $organizationId, data: $data) {\n id\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
32
32
|
var CreateCustomViewFromCli = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "CreateCustomViewFromCli" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "organizationId" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "CustomViewDraftDataInput" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "createCustomView" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "organizationId" }, value: { kind: "Variable", name: { kind: "Name", value: "organizationId" } } }, { kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 180, source: { body: "mutation CreateCustomViewFromCli(\n $organizationId: String!\n $data: CustomViewDraftDataInput!\n) {\n createCustomView(organizationId: $organizationId, data: $data) {\n id\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
@@ -252,4 +252,4 @@ const updateCustomApplicationDeploymentPreview = async _ref9 => {
|
|
|
252
252
|
return updatedDeploymentPreviewResult.updateCustomApplicationDeploymentPreview;
|
|
253
253
|
};
|
|
254
254
|
|
|
255
|
-
export {
|
|
255
|
+
export { fetchCustomApplication as a, fetchCustomView as b, createCustomApplicationDeploymentPreview as c, createCustomView as d, updateCustomView as e, fetchUserOrganizations as f, createCustomApplication as g, updateCustomApplication as h, updateCustomApplicationDeploymentPreview as u };
|
|
@@ -3,19 +3,19 @@
|
|
|
3
3
|
var _Object$values = require('@babel/runtime-corejs3/core-js-stable/object/values');
|
|
4
4
|
var chalk = require('chalk');
|
|
5
5
|
|
|
6
|
-
function _interopDefault (e) { return e && e.__esModule ? e : {
|
|
6
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
7
|
|
|
8
8
|
var _Object$values__default = /*#__PURE__*/_interopDefault(_Object$values);
|
|
9
9
|
var chalk__default = /*#__PURE__*/_interopDefault(chalk);
|
|
10
10
|
|
|
11
11
|
function getI18nMessageFormat(source) {
|
|
12
12
|
const messageContents = JSON.parse(source);
|
|
13
|
-
const firstValue = _Object$values__default
|
|
13
|
+
const firstValue = _Object$values__default.default(messageContents)[0];
|
|
14
14
|
return typeof firstValue === 'string' ? 'simple' : 'transifex';
|
|
15
15
|
}
|
|
16
16
|
function handleMessageCompilationError(fileIdentifier, error, warnFunction) {
|
|
17
17
|
if (!process.env.CI) {
|
|
18
|
-
warnFunction(new Error(`[i18n message compilation] Message compilation on ${fileIdentifier} has failed.\n` + `Consider setting the environmental variable ${chalk__default
|
|
18
|
+
warnFunction(new Error(`[i18n message compilation] Message compilation on ${fileIdentifier} has failed.\n` + `Consider setting the environmental variable ${chalk__default.default.yellow('DISABLE_I18N_MESSAGE_COMPILATION')} to true to disable the message loader or resolve the issues on the messages file.\n` + `${error instanceof Error ? `Error: ${error.message}` : ''}`));
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -3,19 +3,19 @@
|
|
|
3
3
|
var _Object$values = require('@babel/runtime-corejs3/core-js-stable/object/values');
|
|
4
4
|
var chalk = require('chalk');
|
|
5
5
|
|
|
6
|
-
function _interopDefault (e) { return e && e.__esModule ? e : {
|
|
6
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
7
|
|
|
8
8
|
var _Object$values__default = /*#__PURE__*/_interopDefault(_Object$values);
|
|
9
9
|
var chalk__default = /*#__PURE__*/_interopDefault(chalk);
|
|
10
10
|
|
|
11
11
|
function getI18nMessageFormat(source) {
|
|
12
12
|
const messageContents = JSON.parse(source);
|
|
13
|
-
const firstValue = _Object$values__default
|
|
13
|
+
const firstValue = _Object$values__default.default(messageContents)[0];
|
|
14
14
|
return typeof firstValue === 'string' ? 'simple' : 'transifex';
|
|
15
15
|
}
|
|
16
16
|
function handleMessageCompilationError(fileIdentifier, error, warnFunction) {
|
|
17
17
|
if (!process.env.CI) {
|
|
18
|
-
warnFunction(new Error(`[i18n message compilation] Message compilation on ${fileIdentifier} has failed.\n` + `Consider setting the environmental variable ${chalk__default
|
|
18
|
+
warnFunction(new Error(`[i18n message compilation] Message compilation on ${fileIdentifier} has failed.\n` + `Consider setting the environmental variable ${chalk__default.default.yellow('DISABLE_I18N_MESSAGE_COMPILATION')} to true to disable the message loader or resolve the issues on the messages file.\n` + `${error instanceof Error ? `Error: ${error.message}` : ''}`));
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|