@commercetools-frontend/mc-scripts 22.4.0 → 22.5.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-6f3a7149.cjs.prod.js} +3 -3
- package/dist/{build-32a4bc3a.esm.js → build-d37ecde4.esm.js} +3 -3
- package/dist/{build-70a0794f.cjs.dev.js → build-ee6252ed.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-9afcab14.esm.js → config-sync-2474895f.esm.js} +42 -31
- package/dist/{config-sync-009c314b.cjs.dev.js → config-sync-53812761.cjs.dev.js} +42 -31
- package/dist/{config-sync-106632f3.cjs.prod.js → config-sync-b3cf13d6.cjs.prod.js} +42 -31
- package/dist/{create-postcss-config-d6df1e76.cjs.dev.js → create-postcss-config-38955806.cjs.dev.js} +1 -1
- package/dist/{create-postcss-config-2a08421b.esm.js → create-postcss-config-7d5a084a.esm.js} +1 -1
- package/dist/{create-postcss-config-bb079951.cjs.prod.js → create-postcss-config-987f981f.cjs.prod.js} +1 -1
- package/dist/{create-webpack-config-for-development-7df9cb91.cjs.prod.js → create-webpack-config-for-development-1dc75155.cjs.prod.js} +1 -1
- package/dist/{create-webpack-config-for-development-665736e0.esm.js → create-webpack-config-for-development-20d11b2f.esm.js} +1 -1
- package/dist/{create-webpack-config-for-development-9562ef33.cjs.dev.js → create-webpack-config-for-development-adec942a.cjs.dev.js} +1 -1
- package/dist/{create-webpack-config-for-production-37851297.esm.js → create-webpack-config-for-production-2714501d.esm.js} +1 -1
- package/dist/{create-webpack-config-for-production-07317658.cjs.dev.js → create-webpack-config-for-production-5d05e2a4.cjs.dev.js} +1 -1
- package/dist/{create-webpack-config-for-production-18ecf52e.cjs.prod.js → create-webpack-config-for-production-7fa7f889.cjs.prod.js} +1 -1
- package/dist/{credentials-storage-13af9f16.cjs.dev.js → credentials-storage-0e2adbdc.cjs.dev.js} +1 -1
- package/dist/{credentials-storage-5251c078.cjs.prod.js → credentials-storage-40a6085d.cjs.prod.js} +1 -1
- package/dist/{credentials-storage-46f24013.esm.js → credentials-storage-c29c0759.esm.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-6afc68fd.esm.js +91 -0
- package/dist/login-8d95b69d.cjs.dev.js +109 -0
- package/dist/login-af6845ba.cjs.prod.js +109 -0
- package/dist/{package-3e2831fa.cjs.prod.js → package-2abcd320.cjs.prod.js} +11 -11
- package/dist/{package-8fa7c736.cjs.dev.js → package-b7315dcf.cjs.dev.js} +11 -11
- package/dist/{package-afbf1ded.esm.js → package-f07b5369.esm.js} +11 -11
- package/dist/{start-c255f540.cjs.prod.js → start-141e54b8.cjs.prod.js} +3 -3
- package/dist/{start-e37cc629.esm.js → start-1786dd0e.esm.js} +3 -3
- package/dist/{start-d9039435.cjs.dev.js → start-718872ee.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-b7315dcf.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-718872ee.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-ee6252ed.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-8d95b69d.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-53812761.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-2abcd320.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-141e54b8.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-6f3a7149.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-af6845ba.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-b3cf13d6.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-f07b5369.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-1786dd0e.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-d37ecde4.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-6afc68fd.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-2474895f.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-7fa7f889.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-987f981f.cjs.prod.js');
|
|
42
42
|
require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
43
|
-
require('./package-
|
|
43
|
+
require('./package-2abcd320.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-2714501d.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-7d5a084a.esm.js';
|
|
40
40
|
import '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
41
|
-
import './package-
|
|
41
|
+
import './package-f07b5369.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-5d05e2a4.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-38955806.cjs.dev.js');
|
|
42
42
|
require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
43
|
-
require('./package-
|
|
43
|
+
require('./package-b7315dcf.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.5.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.5.0";
|
|
9
9
|
|
|
10
10
|
// These exports are deprecated.
|
|
11
11
|
|
|
@@ -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-c29c0759.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-f07b5369.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), "\"."));
|
|
@@ -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-0e2adbdc.cjs.dev.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-b7315dcf.cjs.dev.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');
|
|
@@ -420,23 +420,18 @@ var FetchCustomApplicationFromCli = { kind: "Document", definitions: [{ kind: "O
|
|
|
420
420
|
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 } } } };
|
|
421
421
|
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 } } } };
|
|
422
422
|
const credentialsStorage$1 = new credentialsStorage$2.CredentialsStorage();
|
|
423
|
-
const client = new graphqlRequest.GraphQLClient('',
|
|
424
|
-
// <-- Set on demand
|
|
425
|
-
{
|
|
426
|
-
headers: {
|
|
427
|
-
Accept: 'application/json',
|
|
428
|
-
'Content-Type': 'application/json',
|
|
429
|
-
'x-user-agent': credentialsStorage$2.userAgent
|
|
430
|
-
}
|
|
431
|
-
});
|
|
432
423
|
async function requestWithTokenRetry(document, requestOptions) {
|
|
433
424
|
let retryCount = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
434
425
|
const token = credentialsStorage$1.getToken(requestOptions.mcApiUrl);
|
|
435
|
-
client.
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
426
|
+
const client = new graphqlRequest.GraphQLClient("".concat(requestOptions.mcApiUrl, "/graphql"), {
|
|
427
|
+
headers: _objectSpread(_objectSpread({
|
|
428
|
+
Accept: 'application/json',
|
|
429
|
+
'Content-Type': 'application/json',
|
|
430
|
+
'x-user-agent': credentialsStorage$2.userAgent
|
|
431
|
+
}, token ? {
|
|
432
|
+
'x-mc-cli-access-token': token
|
|
433
|
+
} : {}), requestOptions.headers)
|
|
434
|
+
});
|
|
440
435
|
try {
|
|
441
436
|
const result = await client.rawRequest(graphql.print(document), requestOptions.variables);
|
|
442
437
|
|
|
@@ -477,13 +472,15 @@ async function requestWithTokenRetry(document, requestOptions) {
|
|
|
477
472
|
}
|
|
478
473
|
const fetchCustomApplication = async _ref => {
|
|
479
474
|
let mcApiUrl = _ref.mcApiUrl,
|
|
480
|
-
entryPointUriPath = _ref.entryPointUriPath
|
|
475
|
+
entryPointUriPath = _ref.entryPointUriPath,
|
|
476
|
+
applicationIdentifier = _ref.applicationIdentifier;
|
|
481
477
|
const customAppData = await requestWithTokenRetry(FetchCustomApplicationFromCli, {
|
|
482
478
|
variables: {
|
|
483
479
|
entryPointUriPath
|
|
484
480
|
},
|
|
485
481
|
mcApiUrl,
|
|
486
482
|
headers: {
|
|
483
|
+
'x-application-id': applicationIdentifier,
|
|
487
484
|
'x-graphql-target': constants.GRAPHQL_TARGETS.SETTINGS_SERVICE
|
|
488
485
|
}
|
|
489
486
|
});
|
|
@@ -493,7 +490,8 @@ const updateCustomApplication = async _ref2 => {
|
|
|
493
490
|
let mcApiUrl = _ref2.mcApiUrl,
|
|
494
491
|
applicationId = _ref2.applicationId,
|
|
495
492
|
organizationId = _ref2.organizationId,
|
|
496
|
-
data = _ref2.data
|
|
493
|
+
data = _ref2.data,
|
|
494
|
+
applicationIdentifier = _ref2.applicationIdentifier;
|
|
497
495
|
const updatedCustomAppsData = await requestWithTokenRetry(UpdateCustomApplicationFromCli, {
|
|
498
496
|
variables: {
|
|
499
497
|
organizationId,
|
|
@@ -502,6 +500,7 @@ const updateCustomApplication = async _ref2 => {
|
|
|
502
500
|
},
|
|
503
501
|
mcApiUrl,
|
|
504
502
|
headers: {
|
|
503
|
+
'x-application-id': applicationIdentifier,
|
|
505
504
|
'x-graphql-target': constants.GRAPHQL_TARGETS.SETTINGS_SERVICE
|
|
506
505
|
}
|
|
507
506
|
});
|
|
@@ -510,7 +509,8 @@ const updateCustomApplication = async _ref2 => {
|
|
|
510
509
|
const createCustomApplication = async _ref3 => {
|
|
511
510
|
let mcApiUrl = _ref3.mcApiUrl,
|
|
512
511
|
organizationId = _ref3.organizationId,
|
|
513
|
-
data = _ref3.data
|
|
512
|
+
data = _ref3.data,
|
|
513
|
+
applicationIdentifier = _ref3.applicationIdentifier;
|
|
514
514
|
const createdCustomAppData = await requestWithTokenRetry(CreateCustomApplicationFromCli, {
|
|
515
515
|
variables: {
|
|
516
516
|
organizationId,
|
|
@@ -518,16 +518,19 @@ const createCustomApplication = async _ref3 => {
|
|
|
518
518
|
},
|
|
519
519
|
mcApiUrl,
|
|
520
520
|
headers: {
|
|
521
|
+
'x-application-id': applicationIdentifier,
|
|
521
522
|
'x-graphql-target': constants.GRAPHQL_TARGETS.SETTINGS_SERVICE
|
|
522
523
|
}
|
|
523
524
|
});
|
|
524
525
|
return createdCustomAppData.createCustomApplication;
|
|
525
526
|
};
|
|
526
527
|
const fetchUserOrganizations = async _ref4 => {
|
|
527
|
-
let mcApiUrl = _ref4.mcApiUrl
|
|
528
|
+
let mcApiUrl = _ref4.mcApiUrl,
|
|
529
|
+
applicationIdentifier = _ref4.applicationIdentifier;
|
|
528
530
|
const userOrganizations = await requestWithTokenRetry(FetchMyOrganizationsFromCli, {
|
|
529
531
|
mcApiUrl,
|
|
530
532
|
headers: {
|
|
533
|
+
'x-application-id': applicationIdentifier,
|
|
531
534
|
'x-graphql-target': constants.GRAPHQL_TARGETS.ADMINISTRATION_SERVICE
|
|
532
535
|
}
|
|
533
536
|
});
|
|
@@ -542,10 +545,14 @@ const getMcUrlLink = (mcApiUrl, organizationId, applicationId) => {
|
|
|
542
545
|
return customAppLink;
|
|
543
546
|
};
|
|
544
547
|
async function run(options) {
|
|
545
|
-
var
|
|
548
|
+
var _context3, _context6;
|
|
546
549
|
const applicationConfig$1 = applicationConfig.processConfig();
|
|
547
550
|
const localCustomAppData = applicationConfig$1.data;
|
|
548
|
-
const
|
|
551
|
+
const _applicationConfig$en = applicationConfig$1.env,
|
|
552
|
+
mcApiUrl = _applicationConfig$en.mcApiUrl,
|
|
553
|
+
applicationId = _applicationConfig$en.applicationId,
|
|
554
|
+
entryPointUriPath = _applicationConfig$en.entryPointUriPath;
|
|
555
|
+
const applicationIdentifier = _concatInstanceProperty__default["default"](_context3 = "".concat(applicationId, ":")).call(_context3, entryPointUriPath);
|
|
549
556
|
console.log("Using Merchant Center environment \"".concat(chalk__default["default"].green(mcApiUrl), "\"."));
|
|
550
557
|
console.log();
|
|
551
558
|
const isSessionValid = credentialsStorage.isSessionValid(mcApiUrl);
|
|
@@ -554,12 +561,14 @@ async function run(options) {
|
|
|
554
561
|
}
|
|
555
562
|
const fetchedCustomApplication = await fetchCustomApplication({
|
|
556
563
|
mcApiUrl,
|
|
557
|
-
entryPointUriPath: localCustomAppData.entryPointUriPath
|
|
564
|
+
entryPointUriPath: localCustomAppData.entryPointUriPath,
|
|
565
|
+
applicationIdentifier
|
|
558
566
|
});
|
|
559
567
|
if (!fetchedCustomApplication) {
|
|
560
|
-
var
|
|
568
|
+
var _context5;
|
|
561
569
|
const userOrganizations = await fetchUserOrganizations({
|
|
562
|
-
mcApiUrl
|
|
570
|
+
mcApiUrl,
|
|
571
|
+
applicationIdentifier
|
|
563
572
|
});
|
|
564
573
|
let organizationId, organizationName;
|
|
565
574
|
if (userOrganizations.total === 0) {
|
|
@@ -571,8 +580,8 @@ async function run(options) {
|
|
|
571
580
|
organizationId = organization.id;
|
|
572
581
|
organizationName = organization.name;
|
|
573
582
|
} else {
|
|
574
|
-
var
|
|
575
|
-
const organizationChoices = _mapInstanceProperty__default["default"](
|
|
583
|
+
var _context4;
|
|
584
|
+
const organizationChoices = _mapInstanceProperty__default["default"](_context4 = userOrganizations.results).call(_context4, organization => ({
|
|
576
585
|
title: organization.name,
|
|
577
586
|
value: organization.id
|
|
578
587
|
}));
|
|
@@ -596,7 +605,7 @@ async function run(options) {
|
|
|
596
605
|
const _await$prompts2 = await prompts__default["default"]({
|
|
597
606
|
type: 'text',
|
|
598
607
|
name: 'confirmation',
|
|
599
|
-
message: _filterInstanceProperty__default["default"](
|
|
608
|
+
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'),
|
|
600
609
|
initial: 'yes'
|
|
601
610
|
}),
|
|
602
611
|
confirmation = _await$prompts2.confirmation;
|
|
@@ -615,7 +624,8 @@ async function run(options) {
|
|
|
615
624
|
const createdCustomApplication = await createCustomApplication({
|
|
616
625
|
mcApiUrl,
|
|
617
626
|
organizationId,
|
|
618
|
-
data
|
|
627
|
+
data,
|
|
628
|
+
applicationIdentifier
|
|
619
629
|
});
|
|
620
630
|
|
|
621
631
|
// This check is technically not necessary, as the `graphql-request` client
|
|
@@ -643,7 +653,7 @@ async function run(options) {
|
|
|
643
653
|
const _await$prompts3 = await prompts__default["default"]({
|
|
644
654
|
type: 'text',
|
|
645
655
|
name: 'confirmation',
|
|
646
|
-
message: _filterInstanceProperty__default["default"](
|
|
656
|
+
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'),
|
|
647
657
|
initial: 'yes'
|
|
648
658
|
}),
|
|
649
659
|
confirmation = _await$prompts3.confirmation;
|
|
@@ -663,7 +673,8 @@ async function run(options) {
|
|
|
663
673
|
mcApiUrl,
|
|
664
674
|
organizationId: fetchedCustomApplication.organizationId,
|
|
665
675
|
data: omit__default["default"](localCustomAppData, ['id']),
|
|
666
|
-
applicationId: fetchedCustomApplication.application.id
|
|
676
|
+
applicationId: fetchedCustomApplication.application.id,
|
|
677
|
+
applicationIdentifier
|
|
667
678
|
});
|
|
668
679
|
console.log(chalk__default["default"].green("Custom Application updated."));
|
|
669
680
|
console.log("You can inspect the Custom Application data in the Merchant Center at \"".concat(chalk__default["default"].gray(customAppLink), "\"."));
|