@commercetools-frontend/mc-scripts 22.4.0 → 22.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.dev.js +5 -5
- package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.prod.js +5 -5
- package/cli/dist/commercetools-frontend-mc-scripts-cli.esm.js +5 -5
- package/dist/{build-e3507064.cjs.prod.js → build-174de015.cjs.prod.js} +3 -3
- package/dist/{build-32a4bc3a.esm.js → build-20382ed9.esm.js} +3 -3
- package/dist/{build-70a0794f.cjs.dev.js → build-409e1cf9.cjs.dev.js} +3 -3
- package/dist/commercetools-frontend-mc-scripts.cjs.dev.js +1 -1
- package/dist/commercetools-frontend-mc-scripts.cjs.prod.js +1 -1
- package/dist/commercetools-frontend-mc-scripts.esm.js +1 -1
- package/dist/{config-sync-106632f3.cjs.prod.js → config-sync-6e8c35ff.cjs.prod.js} +42 -31
- package/dist/{config-sync-9afcab14.esm.js → config-sync-7fc13a38.esm.js} +42 -31
- package/dist/{config-sync-009c314b.cjs.dev.js → config-sync-c0eecd23.cjs.dev.js} +42 -31
- package/dist/{create-postcss-config-bb079951.cjs.prod.js → create-postcss-config-46307dce.cjs.prod.js} +1 -1
- package/dist/{create-postcss-config-d6df1e76.cjs.dev.js → create-postcss-config-6fc28778.cjs.dev.js} +1 -1
- package/dist/{create-postcss-config-2a08421b.esm.js → create-postcss-config-c8008bd1.esm.js} +1 -1
- package/dist/{create-webpack-config-for-development-9562ef33.cjs.dev.js → create-webpack-config-for-development-2b6dbee0.cjs.dev.js} +1 -1
- package/dist/{create-webpack-config-for-development-665736e0.esm.js → create-webpack-config-for-development-b15bcea4.esm.js} +1 -1
- package/dist/{create-webpack-config-for-development-7df9cb91.cjs.prod.js → create-webpack-config-for-development-da70d662.cjs.prod.js} +1 -1
- package/dist/{create-webpack-config-for-production-37851297.esm.js → create-webpack-config-for-production-4737ad2c.esm.js} +1 -1
- package/dist/{create-webpack-config-for-production-18ecf52e.cjs.prod.js → create-webpack-config-for-production-aa3f0e35.cjs.prod.js} +1 -1
- package/dist/{create-webpack-config-for-production-07317658.cjs.dev.js → create-webpack-config-for-production-e55825a8.cjs.dev.js} +1 -1
- package/dist/{credentials-storage-13af9f16.cjs.dev.js → credentials-storage-0c7aa073.cjs.dev.js} +1 -1
- package/dist/{credentials-storage-46f24013.esm.js → credentials-storage-5fa2c02b.esm.js} +1 -1
- package/dist/{credentials-storage-5251c078.cjs.prod.js → credentials-storage-dd126329.cjs.prod.js} +1 -1
- package/dist/declarations/src/generated/core.d.ts +46 -35
- package/dist/declarations/src/generated/settings.d.ts +27 -0
- package/dist/declarations/src/utils/auth.d.ts +1 -1
- package/dist/declarations/src/utils/graphql-requests.d.ts +8 -4
- package/dist/login-45455a1d.cjs.dev.js +109 -0
- package/dist/login-61c28c52.cjs.prod.js +109 -0
- package/dist/login-7135212b.esm.js +91 -0
- package/dist/{package-3e2831fa.cjs.prod.js → package-3ff5877f.cjs.prod.js} +11 -11
- package/dist/{package-afbf1ded.esm.js → package-5a8d10a0.esm.js} +11 -11
- package/dist/{package-8fa7c736.cjs.dev.js → package-78ef5945.cjs.dev.js} +11 -11
- package/dist/{start-e37cc629.esm.js → start-c362db35.esm.js} +3 -3
- package/dist/{start-c255f540.cjs.prod.js → start-ccd7ebf7.cjs.prod.js} +3 -3
- package/dist/{start-d9039435.cjs.dev.js → start-eced2251.cjs.dev.js} +3 -3
- package/package.json +11 -11
- package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.dev.js +2 -2
- package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.prod.js +2 -2
- package/postcss/dist/commercetools-frontend-mc-scripts-postcss.esm.js +2 -2
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.dev.js +4 -4
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.prod.js +4 -4
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.esm.js +4 -4
- package/dist/login-53879681.cjs.dev.js +0 -82
- package/dist/login-c87a9584.esm.js +0 -73
- package/dist/login-ddc51e40.cjs.prod.js +0 -82
|
@@ -10,7 +10,7 @@ var path = require('path');
|
|
|
10
10
|
var cac = require('cac');
|
|
11
11
|
var dotenv = require('dotenv');
|
|
12
12
|
var dotenvExpand = require('dotenv-expand');
|
|
13
|
-
var _package = require('../../dist/package-
|
|
13
|
+
var _package = require('../../dist/package-78ef5945.cjs.dev.js');
|
|
14
14
|
|
|
15
15
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
16
16
|
|
|
@@ -56,7 +56,7 @@ async function run() {
|
|
|
56
56
|
console.log('Experimental Vite bundler enabled! 🚀');
|
|
57
57
|
console.log('');
|
|
58
58
|
}
|
|
59
|
-
const startCommand = shouldUseExperimentalBundler ? await Promise.resolve().then(function () { return require('../../dist/start-vite-3966d625.cjs.dev.js'); }) : await Promise.resolve().then(function () { return require('../../dist/start-
|
|
59
|
+
const startCommand = shouldUseExperimentalBundler ? await Promise.resolve().then(function () { return require('../../dist/start-vite-3966d625.cjs.dev.js'); }) : await Promise.resolve().then(function () { return require('../../dist/start-eced2251.cjs.dev.js'); });
|
|
60
60
|
await startCommand.default();
|
|
61
61
|
});
|
|
62
62
|
|
|
@@ -77,7 +77,7 @@ async function run() {
|
|
|
77
77
|
console.log('Experimental Vite bundler enabled! 🚀');
|
|
78
78
|
console.log('');
|
|
79
79
|
}
|
|
80
|
-
const buildCommand = shouldUseExperimentalBundler ? await Promise.resolve().then(function () { return require('../../dist/build-vite-e7a6315c.cjs.dev.js'); }) : await Promise.resolve().then(function () { return require('../../dist/build-
|
|
80
|
+
const buildCommand = shouldUseExperimentalBundler ? await Promise.resolve().then(function () { return require('../../dist/build-vite-e7a6315c.cjs.dev.js'); }) : await Promise.resolve().then(function () { return require('../../dist/build-409e1cf9.cjs.dev.js'); });
|
|
81
81
|
await buildCommand.default();
|
|
82
82
|
const shouldAlsoCompile = !options.buildOnly;
|
|
83
83
|
if (shouldAlsoCompile) {
|
|
@@ -126,7 +126,7 @@ async function run() {
|
|
|
126
126
|
|
|
127
127
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
128
128
|
process.env.NODE_ENV = 'production';
|
|
129
|
-
const loginCommand = await Promise.resolve().then(function () { return require('../../dist/login-
|
|
129
|
+
const loginCommand = await Promise.resolve().then(function () { return require('../../dist/login-45455a1d.cjs.dev.js'); });
|
|
130
130
|
await loginCommand.default();
|
|
131
131
|
});
|
|
132
132
|
|
|
@@ -141,7 +141,7 @@ async function run() {
|
|
|
141
141
|
|
|
142
142
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
143
143
|
process.env.NODE_ENV = 'production';
|
|
144
|
-
const configSyncCommand = await Promise.resolve().then(function () { return require('../../dist/config-sync-
|
|
144
|
+
const configSyncCommand = await Promise.resolve().then(function () { return require('../../dist/config-sync-c0eecd23.cjs.dev.js'); });
|
|
145
145
|
await configSyncCommand.default(options);
|
|
146
146
|
});
|
|
147
147
|
cli.help();
|
|
@@ -10,7 +10,7 @@ var path = require('path');
|
|
|
10
10
|
var cac = require('cac');
|
|
11
11
|
var dotenv = require('dotenv');
|
|
12
12
|
var dotenvExpand = require('dotenv-expand');
|
|
13
|
-
var _package = require('../../dist/package-
|
|
13
|
+
var _package = require('../../dist/package-3ff5877f.cjs.prod.js');
|
|
14
14
|
|
|
15
15
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
16
16
|
|
|
@@ -56,7 +56,7 @@ async function run() {
|
|
|
56
56
|
console.log('Experimental Vite bundler enabled! 🚀');
|
|
57
57
|
console.log('');
|
|
58
58
|
}
|
|
59
|
-
const startCommand = shouldUseExperimentalBundler ? await Promise.resolve().then(function () { return require('../../dist/start-vite-5c78605b.cjs.prod.js'); }) : await Promise.resolve().then(function () { return require('../../dist/start-
|
|
59
|
+
const startCommand = shouldUseExperimentalBundler ? await Promise.resolve().then(function () { return require('../../dist/start-vite-5c78605b.cjs.prod.js'); }) : await Promise.resolve().then(function () { return require('../../dist/start-ccd7ebf7.cjs.prod.js'); });
|
|
60
60
|
await startCommand.default();
|
|
61
61
|
});
|
|
62
62
|
|
|
@@ -77,7 +77,7 @@ async function run() {
|
|
|
77
77
|
console.log('Experimental Vite bundler enabled! 🚀');
|
|
78
78
|
console.log('');
|
|
79
79
|
}
|
|
80
|
-
const buildCommand = shouldUseExperimentalBundler ? await Promise.resolve().then(function () { return require('../../dist/build-vite-1ba28dd8.cjs.prod.js'); }) : await Promise.resolve().then(function () { return require('../../dist/build-
|
|
80
|
+
const buildCommand = shouldUseExperimentalBundler ? await Promise.resolve().then(function () { return require('../../dist/build-vite-1ba28dd8.cjs.prod.js'); }) : await Promise.resolve().then(function () { return require('../../dist/build-174de015.cjs.prod.js'); });
|
|
81
81
|
await buildCommand.default();
|
|
82
82
|
const shouldAlsoCompile = !options.buildOnly;
|
|
83
83
|
if (shouldAlsoCompile) {
|
|
@@ -126,7 +126,7 @@ async function run() {
|
|
|
126
126
|
|
|
127
127
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
128
128
|
process.env.NODE_ENV = 'production';
|
|
129
|
-
const loginCommand = await Promise.resolve().then(function () { return require('../../dist/login-
|
|
129
|
+
const loginCommand = await Promise.resolve().then(function () { return require('../../dist/login-61c28c52.cjs.prod.js'); });
|
|
130
130
|
await loginCommand.default();
|
|
131
131
|
});
|
|
132
132
|
|
|
@@ -141,7 +141,7 @@ async function run() {
|
|
|
141
141
|
|
|
142
142
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
143
143
|
process.env.NODE_ENV = 'production';
|
|
144
|
-
const configSyncCommand = await Promise.resolve().then(function () { return require('../../dist/config-sync-
|
|
144
|
+
const configSyncCommand = await Promise.resolve().then(function () { return require('../../dist/config-sync-6e8c35ff.cjs.prod.js'); });
|
|
145
145
|
await configSyncCommand.default(options);
|
|
146
146
|
});
|
|
147
147
|
cli.help();
|
|
@@ -6,7 +6,7 @@ import path from 'path';
|
|
|
6
6
|
import { cac } from 'cac';
|
|
7
7
|
import dotenv from 'dotenv';
|
|
8
8
|
import dotenvExpand from 'dotenv-expand';
|
|
9
|
-
import { p as pkgJson } from '../../dist/package-
|
|
9
|
+
import { p as pkgJson } from '../../dist/package-5a8d10a0.esm.js';
|
|
10
10
|
|
|
11
11
|
const cli = cac('mc-scripts');
|
|
12
12
|
|
|
@@ -42,7 +42,7 @@ async function run() {
|
|
|
42
42
|
console.log('Experimental Vite bundler enabled! 🚀');
|
|
43
43
|
console.log('');
|
|
44
44
|
}
|
|
45
|
-
const startCommand = shouldUseExperimentalBundler ? await import('../../dist/start-vite-cf0213a1.esm.js') : await import('../../dist/start-
|
|
45
|
+
const startCommand = shouldUseExperimentalBundler ? await import('../../dist/start-vite-cf0213a1.esm.js') : await import('../../dist/start-c362db35.esm.js');
|
|
46
46
|
await startCommand.default();
|
|
47
47
|
});
|
|
48
48
|
|
|
@@ -63,7 +63,7 @@ async function run() {
|
|
|
63
63
|
console.log('Experimental Vite bundler enabled! 🚀');
|
|
64
64
|
console.log('');
|
|
65
65
|
}
|
|
66
|
-
const buildCommand = shouldUseExperimentalBundler ? await import('../../dist/build-vite-9de4820c.esm.js') : await import('../../dist/build-
|
|
66
|
+
const buildCommand = shouldUseExperimentalBundler ? await import('../../dist/build-vite-9de4820c.esm.js') : await import('../../dist/build-20382ed9.esm.js');
|
|
67
67
|
await buildCommand.default();
|
|
68
68
|
const shouldAlsoCompile = !options.buildOnly;
|
|
69
69
|
if (shouldAlsoCompile) {
|
|
@@ -112,7 +112,7 @@ async function run() {
|
|
|
112
112
|
|
|
113
113
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
114
114
|
process.env.NODE_ENV = 'production';
|
|
115
|
-
const loginCommand = await import('../../dist/login-
|
|
115
|
+
const loginCommand = await import('../../dist/login-7135212b.esm.js');
|
|
116
116
|
await loginCommand.default();
|
|
117
117
|
});
|
|
118
118
|
|
|
@@ -127,7 +127,7 @@ async function run() {
|
|
|
127
127
|
|
|
128
128
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
129
129
|
process.env.NODE_ENV = 'production';
|
|
130
|
-
const configSyncCommand = await import('../../dist/config-sync-
|
|
130
|
+
const configSyncCommand = await import('../../dist/config-sync-7fc13a38.esm.js');
|
|
131
131
|
await configSyncCommand.default(options);
|
|
132
132
|
});
|
|
133
133
|
cli.help();
|
|
@@ -10,7 +10,7 @@ var formatWebpackMessages = require('react-dev-utils/formatWebpackMessages');
|
|
|
10
10
|
var printBuildError = require('react-dev-utils/printBuildError');
|
|
11
11
|
var webpack = require('webpack');
|
|
12
12
|
var assets = require('@commercetools-frontend/assets');
|
|
13
|
-
var createWebpackConfigForProduction = require('./create-webpack-config-for-production-
|
|
13
|
+
var createWebpackConfigForProduction = require('./create-webpack-config-for-production-aa3f0e35.cjs.prod.js');
|
|
14
14
|
var paths = require('./paths-854af5ef.cjs.prod.js');
|
|
15
15
|
require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
16
16
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
@@ -38,9 +38,9 @@ require('@babel/runtime-corejs3/core-js-stable/instance/bind');
|
|
|
38
38
|
require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
39
39
|
require('@babel/runtime-corejs3/core-js-stable/object/assign');
|
|
40
40
|
require('fs');
|
|
41
|
-
require('./create-postcss-config-
|
|
41
|
+
require('./create-postcss-config-46307dce.cjs.prod.js');
|
|
42
42
|
require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
43
|
-
require('./package-
|
|
43
|
+
require('./package-3ff5877f.cjs.prod.js');
|
|
44
44
|
require('./has-jsx-runtime-c3202df5.cjs.prod.js');
|
|
45
45
|
require('./vendors-to-transpile-04a49d40.cjs.prod.js');
|
|
46
46
|
require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
@@ -8,7 +8,7 @@ import formatWebpackMessages from 'react-dev-utils/formatWebpackMessages';
|
|
|
8
8
|
import printBuildError from 'react-dev-utils/printBuildError';
|
|
9
9
|
import webpack from 'webpack';
|
|
10
10
|
import { packageLocation } from '@commercetools-frontend/assets';
|
|
11
|
-
import { c as createWebpackConfigForProduction } from './create-webpack-config-for-production-
|
|
11
|
+
import { c as createWebpackConfigForProduction } from './create-webpack-config-for-production-4737ad2c.esm.js';
|
|
12
12
|
import { p as paths } from './paths-ded20ae1.esm.js';
|
|
13
13
|
import '@babel/runtime-corejs3/core-js-stable/object/keys';
|
|
14
14
|
import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
|
|
@@ -36,9 +36,9 @@ import '@babel/runtime-corejs3/core-js-stable/instance/bind';
|
|
|
36
36
|
import '@babel/runtime-corejs3/core-js-stable/instance/reduce';
|
|
37
37
|
import '@babel/runtime-corejs3/core-js-stable/object/assign';
|
|
38
38
|
import 'fs';
|
|
39
|
-
import './create-postcss-config-
|
|
39
|
+
import './create-postcss-config-c8008bd1.esm.js';
|
|
40
40
|
import '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
41
|
-
import './package-
|
|
41
|
+
import './package-5a8d10a0.esm.js';
|
|
42
42
|
import './has-jsx-runtime-e3ecb09b.esm.js';
|
|
43
43
|
import './vendors-to-transpile-7dc84a72.esm.js';
|
|
44
44
|
import '@babel/runtime-corejs3/core-js-stable/instance/find';
|
|
@@ -10,7 +10,7 @@ var formatWebpackMessages = require('react-dev-utils/formatWebpackMessages');
|
|
|
10
10
|
var printBuildError = require('react-dev-utils/printBuildError');
|
|
11
11
|
var webpack = require('webpack');
|
|
12
12
|
var assets = require('@commercetools-frontend/assets');
|
|
13
|
-
var createWebpackConfigForProduction = require('./create-webpack-config-for-production-
|
|
13
|
+
var createWebpackConfigForProduction = require('./create-webpack-config-for-production-e55825a8.cjs.dev.js');
|
|
14
14
|
var paths = require('./paths-d1febc82.cjs.dev.js');
|
|
15
15
|
require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
16
16
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
@@ -38,9 +38,9 @@ require('@babel/runtime-corejs3/core-js-stable/instance/bind');
|
|
|
38
38
|
require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
39
39
|
require('@babel/runtime-corejs3/core-js-stable/object/assign');
|
|
40
40
|
require('fs');
|
|
41
|
-
require('./create-postcss-config-
|
|
41
|
+
require('./create-postcss-config-6fc28778.cjs.dev.js');
|
|
42
42
|
require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
43
|
-
require('./package-
|
|
43
|
+
require('./package-78ef5945.cjs.dev.js');
|
|
44
44
|
require('./has-jsx-runtime-aa5d21ee.cjs.dev.js');
|
|
45
45
|
require('./vendors-to-transpile-6ab4ea06.cjs.dev.js');
|
|
46
46
|
require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var vendorsToTranspile = require('./vendors-to-transpile-6ab4ea06.cjs.dev.js');
|
|
6
6
|
|
|
7
7
|
// NOTE: This string will be replaced on build time with the package version.
|
|
8
|
-
var version = "22.
|
|
8
|
+
var version = "22.6.0";
|
|
9
9
|
|
|
10
10
|
// These exports are deprecated.
|
|
11
11
|
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var vendorsToTranspile = require('./vendors-to-transpile-04a49d40.cjs.prod.js');
|
|
6
6
|
|
|
7
7
|
// NOTE: This string will be replaced on build time with the package version.
|
|
8
|
-
var version = "22.
|
|
8
|
+
var version = "22.6.0";
|
|
9
9
|
|
|
10
10
|
// These exports are deprecated.
|
|
11
11
|
|
|
@@ -10,7 +10,7 @@ var chalk = require('chalk');
|
|
|
10
10
|
var omit = require('lodash/omit');
|
|
11
11
|
var prompts = require('prompts');
|
|
12
12
|
var applicationConfig = require('@commercetools-frontend/application-config');
|
|
13
|
-
var credentialsStorage$2 = require('./credentials-storage-
|
|
13
|
+
var credentialsStorage$2 = require('./credentials-storage-dd126329.cjs.prod.js');
|
|
14
14
|
var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
15
15
|
var _Object$getOwnPropertyDescriptor = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor');
|
|
16
16
|
var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors');
|
|
@@ -27,7 +27,7 @@ var graphql = require('graphql');
|
|
|
27
27
|
var graphqlRequest = require('graphql-request');
|
|
28
28
|
var constants = require('@commercetools-frontend/constants');
|
|
29
29
|
require('@commercetools/http-user-agent');
|
|
30
|
-
require('./package-
|
|
30
|
+
require('./package-3ff5877f.cjs.prod.js');
|
|
31
31
|
require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
32
32
|
require('@babel/runtime-corejs3/helpers/createClass');
|
|
33
33
|
require('@babel/runtime-corejs3/core-js-stable/date/now');
|
|
@@ -414,23 +414,18 @@ var FetchCustomApplicationFromCli = { kind: "Document", definitions: [{ kind: "O
|
|
|
414
414
|
var FetchMyOrganizationsFromCli = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchMyOrganizationsFromCli" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "myOrganizations" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 112, source: { body: "query FetchMyOrganizationsFromCli {\n myOrganizations {\n total\n results {\n id\n name\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
415
415
|
var UpdateCustomApplicationFromCli = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "UpdateCustomApplicationFromCli" }, 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: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "applicationId" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "ID" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "updateCustomApplication" }, 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" } } }, { kind: "Argument", name: { kind: "Name", value: "applicationId" }, value: { kind: "Variable", name: { kind: "Name", value: "applicationId" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 268, source: { body: "mutation UpdateCustomApplicationFromCli(\n $organizationId: String!\n $data: CustomApplicationDraftDataInput!\n $applicationId: ID!\n) {\n updateCustomApplication(\n organizationId: $organizationId\n data: $data\n applicationId: $applicationId\n ) {\n id\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
416
416
|
const credentialsStorage$1 = new credentialsStorage$2.CredentialsStorage();
|
|
417
|
-
const client = new graphqlRequest.GraphQLClient('',
|
|
418
|
-
// <-- Set on demand
|
|
419
|
-
{
|
|
420
|
-
headers: {
|
|
421
|
-
Accept: 'application/json',
|
|
422
|
-
'Content-Type': 'application/json',
|
|
423
|
-
'x-user-agent': credentialsStorage$2.userAgent
|
|
424
|
-
}
|
|
425
|
-
});
|
|
426
417
|
async function requestWithTokenRetry(document, requestOptions) {
|
|
427
418
|
let retryCount = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
428
419
|
const token = credentialsStorage$1.getToken(requestOptions.mcApiUrl);
|
|
429
|
-
client.
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
420
|
+
const client = new graphqlRequest.GraphQLClient("".concat(requestOptions.mcApiUrl, "/graphql"), {
|
|
421
|
+
headers: _objectSpread(_objectSpread({
|
|
422
|
+
Accept: 'application/json',
|
|
423
|
+
'Content-Type': 'application/json',
|
|
424
|
+
'x-user-agent': credentialsStorage$2.userAgent
|
|
425
|
+
}, token ? {
|
|
426
|
+
'x-mc-cli-access-token': token
|
|
427
|
+
} : {}), requestOptions.headers)
|
|
428
|
+
});
|
|
434
429
|
try {
|
|
435
430
|
const result = await client.rawRequest(graphql.print(document), requestOptions.variables);
|
|
436
431
|
|
|
@@ -471,13 +466,15 @@ async function requestWithTokenRetry(document, requestOptions) {
|
|
|
471
466
|
}
|
|
472
467
|
const fetchCustomApplication = async _ref => {
|
|
473
468
|
let mcApiUrl = _ref.mcApiUrl,
|
|
474
|
-
entryPointUriPath = _ref.entryPointUriPath
|
|
469
|
+
entryPointUriPath = _ref.entryPointUriPath,
|
|
470
|
+
applicationIdentifier = _ref.applicationIdentifier;
|
|
475
471
|
const customAppData = await requestWithTokenRetry(FetchCustomApplicationFromCli, {
|
|
476
472
|
variables: {
|
|
477
473
|
entryPointUriPath
|
|
478
474
|
},
|
|
479
475
|
mcApiUrl,
|
|
480
476
|
headers: {
|
|
477
|
+
'x-application-id': applicationIdentifier,
|
|
481
478
|
'x-graphql-target': constants.GRAPHQL_TARGETS.SETTINGS_SERVICE
|
|
482
479
|
}
|
|
483
480
|
});
|
|
@@ -487,7 +484,8 @@ const updateCustomApplication = async _ref2 => {
|
|
|
487
484
|
let mcApiUrl = _ref2.mcApiUrl,
|
|
488
485
|
applicationId = _ref2.applicationId,
|
|
489
486
|
organizationId = _ref2.organizationId,
|
|
490
|
-
data = _ref2.data
|
|
487
|
+
data = _ref2.data,
|
|
488
|
+
applicationIdentifier = _ref2.applicationIdentifier;
|
|
491
489
|
const updatedCustomAppsData = await requestWithTokenRetry(UpdateCustomApplicationFromCli, {
|
|
492
490
|
variables: {
|
|
493
491
|
organizationId,
|
|
@@ -496,6 +494,7 @@ const updateCustomApplication = async _ref2 => {
|
|
|
496
494
|
},
|
|
497
495
|
mcApiUrl,
|
|
498
496
|
headers: {
|
|
497
|
+
'x-application-id': applicationIdentifier,
|
|
499
498
|
'x-graphql-target': constants.GRAPHQL_TARGETS.SETTINGS_SERVICE
|
|
500
499
|
}
|
|
501
500
|
});
|
|
@@ -504,7 +503,8 @@ const updateCustomApplication = async _ref2 => {
|
|
|
504
503
|
const createCustomApplication = async _ref3 => {
|
|
505
504
|
let mcApiUrl = _ref3.mcApiUrl,
|
|
506
505
|
organizationId = _ref3.organizationId,
|
|
507
|
-
data = _ref3.data
|
|
506
|
+
data = _ref3.data,
|
|
507
|
+
applicationIdentifier = _ref3.applicationIdentifier;
|
|
508
508
|
const createdCustomAppData = await requestWithTokenRetry(CreateCustomApplicationFromCli, {
|
|
509
509
|
variables: {
|
|
510
510
|
organizationId,
|
|
@@ -512,16 +512,19 @@ const createCustomApplication = async _ref3 => {
|
|
|
512
512
|
},
|
|
513
513
|
mcApiUrl,
|
|
514
514
|
headers: {
|
|
515
|
+
'x-application-id': applicationIdentifier,
|
|
515
516
|
'x-graphql-target': constants.GRAPHQL_TARGETS.SETTINGS_SERVICE
|
|
516
517
|
}
|
|
517
518
|
});
|
|
518
519
|
return createdCustomAppData.createCustomApplication;
|
|
519
520
|
};
|
|
520
521
|
const fetchUserOrganizations = async _ref4 => {
|
|
521
|
-
let mcApiUrl = _ref4.mcApiUrl
|
|
522
|
+
let mcApiUrl = _ref4.mcApiUrl,
|
|
523
|
+
applicationIdentifier = _ref4.applicationIdentifier;
|
|
522
524
|
const userOrganizations = await requestWithTokenRetry(FetchMyOrganizationsFromCli, {
|
|
523
525
|
mcApiUrl,
|
|
524
526
|
headers: {
|
|
527
|
+
'x-application-id': applicationIdentifier,
|
|
525
528
|
'x-graphql-target': constants.GRAPHQL_TARGETS.ADMINISTRATION_SERVICE
|
|
526
529
|
}
|
|
527
530
|
});
|
|
@@ -536,10 +539,14 @@ const getMcUrlLink = (mcApiUrl, organizationId, applicationId) => {
|
|
|
536
539
|
return customAppLink;
|
|
537
540
|
};
|
|
538
541
|
async function run(options) {
|
|
539
|
-
var
|
|
542
|
+
var _context3, _context6;
|
|
540
543
|
const applicationConfig$1 = applicationConfig.processConfig();
|
|
541
544
|
const localCustomAppData = applicationConfig$1.data;
|
|
542
|
-
const
|
|
545
|
+
const _applicationConfig$en = applicationConfig$1.env,
|
|
546
|
+
mcApiUrl = _applicationConfig$en.mcApiUrl,
|
|
547
|
+
applicationId = _applicationConfig$en.applicationId,
|
|
548
|
+
entryPointUriPath = _applicationConfig$en.entryPointUriPath;
|
|
549
|
+
const applicationIdentifier = _concatInstanceProperty__default["default"](_context3 = "".concat(applicationId, ":")).call(_context3, entryPointUriPath);
|
|
543
550
|
console.log("Using Merchant Center environment \"".concat(chalk__default["default"].green(mcApiUrl), "\"."));
|
|
544
551
|
console.log();
|
|
545
552
|
const isSessionValid = credentialsStorage.isSessionValid(mcApiUrl);
|
|
@@ -548,12 +555,14 @@ async function run(options) {
|
|
|
548
555
|
}
|
|
549
556
|
const fetchedCustomApplication = await fetchCustomApplication({
|
|
550
557
|
mcApiUrl,
|
|
551
|
-
entryPointUriPath: localCustomAppData.entryPointUriPath
|
|
558
|
+
entryPointUriPath: localCustomAppData.entryPointUriPath,
|
|
559
|
+
applicationIdentifier
|
|
552
560
|
});
|
|
553
561
|
if (!fetchedCustomApplication) {
|
|
554
|
-
var
|
|
562
|
+
var _context5;
|
|
555
563
|
const userOrganizations = await fetchUserOrganizations({
|
|
556
|
-
mcApiUrl
|
|
564
|
+
mcApiUrl,
|
|
565
|
+
applicationIdentifier
|
|
557
566
|
});
|
|
558
567
|
let organizationId, organizationName;
|
|
559
568
|
if (userOrganizations.total === 0) {
|
|
@@ -565,8 +574,8 @@ async function run(options) {
|
|
|
565
574
|
organizationId = organization.id;
|
|
566
575
|
organizationName = organization.name;
|
|
567
576
|
} else {
|
|
568
|
-
var
|
|
569
|
-
const organizationChoices = _mapInstanceProperty__default["default"](
|
|
577
|
+
var _context4;
|
|
578
|
+
const organizationChoices = _mapInstanceProperty__default["default"](_context4 = userOrganizations.results).call(_context4, organization => ({
|
|
570
579
|
title: organization.name,
|
|
571
580
|
value: organization.id
|
|
572
581
|
}));
|
|
@@ -590,7 +599,7 @@ async function run(options) {
|
|
|
590
599
|
const _await$prompts2 = await prompts__default["default"]({
|
|
591
600
|
type: 'text',
|
|
592
601
|
name: 'confirmation',
|
|
593
|
-
message: _filterInstanceProperty__default["default"](
|
|
602
|
+
message: _filterInstanceProperty__default["default"](_context5 = ["You are about to create a new Custom Application in the \"".concat(chalk__default["default"].green(organizationName), "\" organization. Are you sure you want to proceed?"), options.dryRun && chalk__default["default"].gray('Using "--dry-run", no data will be created.')]).call(_context5, Boolean).join('\n'),
|
|
594
603
|
initial: 'yes'
|
|
595
604
|
}),
|
|
596
605
|
confirmation = _await$prompts2.confirmation;
|
|
@@ -609,7 +618,8 @@ async function run(options) {
|
|
|
609
618
|
const createdCustomApplication = await createCustomApplication({
|
|
610
619
|
mcApiUrl,
|
|
611
620
|
organizationId,
|
|
612
|
-
data
|
|
621
|
+
data,
|
|
622
|
+
applicationIdentifier
|
|
613
623
|
});
|
|
614
624
|
|
|
615
625
|
// This check is technically not necessary, as the `graphql-request` client
|
|
@@ -637,7 +647,7 @@ async function run(options) {
|
|
|
637
647
|
const _await$prompts3 = await prompts__default["default"]({
|
|
638
648
|
type: 'text',
|
|
639
649
|
name: 'confirmation',
|
|
640
|
-
message: _filterInstanceProperty__default["default"](
|
|
650
|
+
message: _filterInstanceProperty__default["default"](_context6 = ["You are about to update the Custom Application \"".concat(chalk__default["default"].green(localCustomAppData.entryPointUriPath), "\" with the changes above. Are you sure you want to proceed?"), options.dryRun && chalk__default["default"].gray('Using "--dry-run", no data will be updated.')]).call(_context6, Boolean).join('\n'),
|
|
641
651
|
initial: 'yes'
|
|
642
652
|
}),
|
|
643
653
|
confirmation = _await$prompts3.confirmation;
|
|
@@ -657,7 +667,8 @@ async function run(options) {
|
|
|
657
667
|
mcApiUrl,
|
|
658
668
|
organizationId: fetchedCustomApplication.organizationId,
|
|
659
669
|
data: omit__default["default"](localCustomAppData, ['id']),
|
|
660
|
-
applicationId: fetchedCustomApplication.application.id
|
|
670
|
+
applicationId: fetchedCustomApplication.application.id,
|
|
671
|
+
applicationIdentifier
|
|
661
672
|
});
|
|
662
673
|
console.log(chalk__default["default"].green("Custom Application updated."));
|
|
663
674
|
console.log("You can inspect the Custom Application data in the Merchant Center at \"".concat(chalk__default["default"].gray(customAppLink), "\"."));
|
|
@@ -8,7 +8,7 @@ import chalk from 'chalk';
|
|
|
8
8
|
import omit from 'lodash/omit';
|
|
9
9
|
import prompts from 'prompts';
|
|
10
10
|
import { sanitizeSvg, processConfig } from '@commercetools-frontend/application-config';
|
|
11
|
-
import { C as CredentialsStorage, u as userAgent } from './credentials-storage-
|
|
11
|
+
import { C as CredentialsStorage, u as userAgent } from './credentials-storage-5fa2c02b.esm.js';
|
|
12
12
|
import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
|
|
13
13
|
import _Object$getOwnPropertyDescriptor from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor';
|
|
14
14
|
import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors';
|
|
@@ -25,7 +25,7 @@ import { print } from 'graphql';
|
|
|
25
25
|
import { GraphQLClient, ClientError } from 'graphql-request';
|
|
26
26
|
import { GRAPHQL_TARGETS } from '@commercetools-frontend/constants';
|
|
27
27
|
import '@commercetools/http-user-agent';
|
|
28
|
-
import './package-
|
|
28
|
+
import './package-5a8d10a0.esm.js';
|
|
29
29
|
import '@babel/runtime-corejs3/helpers/classCallCheck';
|
|
30
30
|
import '@babel/runtime-corejs3/helpers/createClass';
|
|
31
31
|
import '@babel/runtime-corejs3/core-js-stable/date/now';
|
|
@@ -396,23 +396,18 @@ var FetchCustomApplicationFromCli = { kind: "Document", definitions: [{ kind: "O
|
|
|
396
396
|
var FetchMyOrganizationsFromCli = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchMyOrganizationsFromCli" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "myOrganizations" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 112, source: { body: "query FetchMyOrganizationsFromCli {\n myOrganizations {\n total\n results {\n id\n name\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
397
397
|
var UpdateCustomApplicationFromCli = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "UpdateCustomApplicationFromCli" }, 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: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "applicationId" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "ID" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "updateCustomApplication" }, 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" } } }, { kind: "Argument", name: { kind: "Name", value: "applicationId" }, value: { kind: "Variable", name: { kind: "Name", value: "applicationId" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 268, source: { body: "mutation UpdateCustomApplicationFromCli(\n $organizationId: String!\n $data: CustomApplicationDraftDataInput!\n $applicationId: ID!\n) {\n updateCustomApplication(\n organizationId: $organizationId\n data: $data\n applicationId: $applicationId\n ) {\n id\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
398
398
|
const credentialsStorage$1 = new CredentialsStorage();
|
|
399
|
-
const client = new GraphQLClient('',
|
|
400
|
-
// <-- Set on demand
|
|
401
|
-
{
|
|
402
|
-
headers: {
|
|
403
|
-
Accept: 'application/json',
|
|
404
|
-
'Content-Type': 'application/json',
|
|
405
|
-
'x-user-agent': userAgent
|
|
406
|
-
}
|
|
407
|
-
});
|
|
408
399
|
async function requestWithTokenRetry(document, requestOptions) {
|
|
409
400
|
let retryCount = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
410
401
|
const token = credentialsStorage$1.getToken(requestOptions.mcApiUrl);
|
|
411
|
-
client
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
402
|
+
const client = new GraphQLClient("".concat(requestOptions.mcApiUrl, "/graphql"), {
|
|
403
|
+
headers: _objectSpread(_objectSpread({
|
|
404
|
+
Accept: 'application/json',
|
|
405
|
+
'Content-Type': 'application/json',
|
|
406
|
+
'x-user-agent': userAgent
|
|
407
|
+
}, token ? {
|
|
408
|
+
'x-mc-cli-access-token': token
|
|
409
|
+
} : {}), requestOptions.headers)
|
|
410
|
+
});
|
|
416
411
|
try {
|
|
417
412
|
const result = await client.rawRequest(print(document), requestOptions.variables);
|
|
418
413
|
|
|
@@ -453,13 +448,15 @@ async function requestWithTokenRetry(document, requestOptions) {
|
|
|
453
448
|
}
|
|
454
449
|
const fetchCustomApplication = async _ref => {
|
|
455
450
|
let mcApiUrl = _ref.mcApiUrl,
|
|
456
|
-
entryPointUriPath = _ref.entryPointUriPath
|
|
451
|
+
entryPointUriPath = _ref.entryPointUriPath,
|
|
452
|
+
applicationIdentifier = _ref.applicationIdentifier;
|
|
457
453
|
const customAppData = await requestWithTokenRetry(FetchCustomApplicationFromCli, {
|
|
458
454
|
variables: {
|
|
459
455
|
entryPointUriPath
|
|
460
456
|
},
|
|
461
457
|
mcApiUrl,
|
|
462
458
|
headers: {
|
|
459
|
+
'x-application-id': applicationIdentifier,
|
|
463
460
|
'x-graphql-target': GRAPHQL_TARGETS.SETTINGS_SERVICE
|
|
464
461
|
}
|
|
465
462
|
});
|
|
@@ -469,7 +466,8 @@ const updateCustomApplication = async _ref2 => {
|
|
|
469
466
|
let mcApiUrl = _ref2.mcApiUrl,
|
|
470
467
|
applicationId = _ref2.applicationId,
|
|
471
468
|
organizationId = _ref2.organizationId,
|
|
472
|
-
data = _ref2.data
|
|
469
|
+
data = _ref2.data,
|
|
470
|
+
applicationIdentifier = _ref2.applicationIdentifier;
|
|
473
471
|
const updatedCustomAppsData = await requestWithTokenRetry(UpdateCustomApplicationFromCli, {
|
|
474
472
|
variables: {
|
|
475
473
|
organizationId,
|
|
@@ -478,6 +476,7 @@ const updateCustomApplication = async _ref2 => {
|
|
|
478
476
|
},
|
|
479
477
|
mcApiUrl,
|
|
480
478
|
headers: {
|
|
479
|
+
'x-application-id': applicationIdentifier,
|
|
481
480
|
'x-graphql-target': GRAPHQL_TARGETS.SETTINGS_SERVICE
|
|
482
481
|
}
|
|
483
482
|
});
|
|
@@ -486,7 +485,8 @@ const updateCustomApplication = async _ref2 => {
|
|
|
486
485
|
const createCustomApplication = async _ref3 => {
|
|
487
486
|
let mcApiUrl = _ref3.mcApiUrl,
|
|
488
487
|
organizationId = _ref3.organizationId,
|
|
489
|
-
data = _ref3.data
|
|
488
|
+
data = _ref3.data,
|
|
489
|
+
applicationIdentifier = _ref3.applicationIdentifier;
|
|
490
490
|
const createdCustomAppData = await requestWithTokenRetry(CreateCustomApplicationFromCli, {
|
|
491
491
|
variables: {
|
|
492
492
|
organizationId,
|
|
@@ -494,16 +494,19 @@ const createCustomApplication = async _ref3 => {
|
|
|
494
494
|
},
|
|
495
495
|
mcApiUrl,
|
|
496
496
|
headers: {
|
|
497
|
+
'x-application-id': applicationIdentifier,
|
|
497
498
|
'x-graphql-target': GRAPHQL_TARGETS.SETTINGS_SERVICE
|
|
498
499
|
}
|
|
499
500
|
});
|
|
500
501
|
return createdCustomAppData.createCustomApplication;
|
|
501
502
|
};
|
|
502
503
|
const fetchUserOrganizations = async _ref4 => {
|
|
503
|
-
let mcApiUrl = _ref4.mcApiUrl
|
|
504
|
+
let mcApiUrl = _ref4.mcApiUrl,
|
|
505
|
+
applicationIdentifier = _ref4.applicationIdentifier;
|
|
504
506
|
const userOrganizations = await requestWithTokenRetry(FetchMyOrganizationsFromCli, {
|
|
505
507
|
mcApiUrl,
|
|
506
508
|
headers: {
|
|
509
|
+
'x-application-id': applicationIdentifier,
|
|
507
510
|
'x-graphql-target': GRAPHQL_TARGETS.ADMINISTRATION_SERVICE
|
|
508
511
|
}
|
|
509
512
|
});
|
|
@@ -518,10 +521,14 @@ const getMcUrlLink = (mcApiUrl, organizationId, applicationId) => {
|
|
|
518
521
|
return customAppLink;
|
|
519
522
|
};
|
|
520
523
|
async function run(options) {
|
|
521
|
-
var
|
|
524
|
+
var _context3, _context6;
|
|
522
525
|
const applicationConfig = processConfig();
|
|
523
526
|
const localCustomAppData = applicationConfig.data;
|
|
524
|
-
const
|
|
527
|
+
const _applicationConfig$en = applicationConfig.env,
|
|
528
|
+
mcApiUrl = _applicationConfig$en.mcApiUrl,
|
|
529
|
+
applicationId = _applicationConfig$en.applicationId,
|
|
530
|
+
entryPointUriPath = _applicationConfig$en.entryPointUriPath;
|
|
531
|
+
const applicationIdentifier = _concatInstanceProperty(_context3 = "".concat(applicationId, ":")).call(_context3, entryPointUriPath);
|
|
525
532
|
console.log("Using Merchant Center environment \"".concat(chalk.green(mcApiUrl), "\"."));
|
|
526
533
|
console.log();
|
|
527
534
|
const isSessionValid = credentialsStorage.isSessionValid(mcApiUrl);
|
|
@@ -530,12 +537,14 @@ async function run(options) {
|
|
|
530
537
|
}
|
|
531
538
|
const fetchedCustomApplication = await fetchCustomApplication({
|
|
532
539
|
mcApiUrl,
|
|
533
|
-
entryPointUriPath: localCustomAppData.entryPointUriPath
|
|
540
|
+
entryPointUriPath: localCustomAppData.entryPointUriPath,
|
|
541
|
+
applicationIdentifier
|
|
534
542
|
});
|
|
535
543
|
if (!fetchedCustomApplication) {
|
|
536
|
-
var
|
|
544
|
+
var _context5;
|
|
537
545
|
const userOrganizations = await fetchUserOrganizations({
|
|
538
|
-
mcApiUrl
|
|
546
|
+
mcApiUrl,
|
|
547
|
+
applicationIdentifier
|
|
539
548
|
});
|
|
540
549
|
let organizationId, organizationName;
|
|
541
550
|
if (userOrganizations.total === 0) {
|
|
@@ -547,8 +556,8 @@ async function run(options) {
|
|
|
547
556
|
organizationId = organization.id;
|
|
548
557
|
organizationName = organization.name;
|
|
549
558
|
} else {
|
|
550
|
-
var
|
|
551
|
-
const organizationChoices = _mapInstanceProperty(
|
|
559
|
+
var _context4;
|
|
560
|
+
const organizationChoices = _mapInstanceProperty(_context4 = userOrganizations.results).call(_context4, organization => ({
|
|
552
561
|
title: organization.name,
|
|
553
562
|
value: organization.id
|
|
554
563
|
}));
|
|
@@ -572,7 +581,7 @@ async function run(options) {
|
|
|
572
581
|
const _await$prompts2 = await prompts({
|
|
573
582
|
type: 'text',
|
|
574
583
|
name: 'confirmation',
|
|
575
|
-
message: _filterInstanceProperty(
|
|
584
|
+
message: _filterInstanceProperty(_context5 = ["You are about to create a new Custom Application in the \"".concat(chalk.green(organizationName), "\" organization. Are you sure you want to proceed?"), options.dryRun && chalk.gray('Using "--dry-run", no data will be created.')]).call(_context5, Boolean).join('\n'),
|
|
576
585
|
initial: 'yes'
|
|
577
586
|
}),
|
|
578
587
|
confirmation = _await$prompts2.confirmation;
|
|
@@ -591,7 +600,8 @@ async function run(options) {
|
|
|
591
600
|
const createdCustomApplication = await createCustomApplication({
|
|
592
601
|
mcApiUrl,
|
|
593
602
|
organizationId,
|
|
594
|
-
data
|
|
603
|
+
data,
|
|
604
|
+
applicationIdentifier
|
|
595
605
|
});
|
|
596
606
|
|
|
597
607
|
// This check is technically not necessary, as the `graphql-request` client
|
|
@@ -619,7 +629,7 @@ async function run(options) {
|
|
|
619
629
|
const _await$prompts3 = await prompts({
|
|
620
630
|
type: 'text',
|
|
621
631
|
name: 'confirmation',
|
|
622
|
-
message: _filterInstanceProperty(
|
|
632
|
+
message: _filterInstanceProperty(_context6 = ["You are about to update the Custom Application \"".concat(chalk.green(localCustomAppData.entryPointUriPath), "\" with the changes above. Are you sure you want to proceed?"), options.dryRun && chalk.gray('Using "--dry-run", no data will be updated.')]).call(_context6, Boolean).join('\n'),
|
|
623
633
|
initial: 'yes'
|
|
624
634
|
}),
|
|
625
635
|
confirmation = _await$prompts3.confirmation;
|
|
@@ -639,7 +649,8 @@ async function run(options) {
|
|
|
639
649
|
mcApiUrl,
|
|
640
650
|
organizationId: fetchedCustomApplication.organizationId,
|
|
641
651
|
data: omit(localCustomAppData, ['id']),
|
|
642
|
-
applicationId: fetchedCustomApplication.application.id
|
|
652
|
+
applicationId: fetchedCustomApplication.application.id,
|
|
653
|
+
applicationIdentifier
|
|
643
654
|
});
|
|
644
655
|
console.log(chalk.green("Custom Application updated."));
|
|
645
656
|
console.log("You can inspect the Custom Application data in the Merchant Center at \"".concat(chalk.gray(customAppLink), "\"."));
|