@commercetools-frontend/application-cli 2.3.1 → 2.4.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-application-cli-cli.cjs.dev.js +133 -278
- package/cli/dist/commercetools-frontend-application-cli-cli.cjs.prod.js +133 -278
- package/cli/dist/commercetools-frontend-application-cli-cli.esm.js +131 -277
- package/dist/commercetools-frontend-application-cli.cjs.dev.js +2 -3
- package/dist/commercetools-frontend-application-cli.cjs.prod.js +2 -3
- package/dist/commercetools-frontend-application-cli.esm.js +2 -1
- package/dist/declarations/src/constants.d.ts +0 -8
- package/dist/declarations/src/types.d.ts +1 -1
- package/dist/{storage-buckets-config-705b6341.esm.js → storage-buckets-config-2fc2b441.esm.js} +22 -20
- package/dist/{storage-buckets-config-28a1d76e.cjs.dev.js → storage-buckets-config-91932b24.cjs.dev.js} +22 -21
- package/dist/{storage-buckets-config-e3ea6d6f.cjs.prod.js → storage-buckets-config-b6d36938.cjs.prod.js} +22 -21
- package/package.json +8 -8
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var storageBucketsConfig = require('./storage-buckets-config-
|
|
5
|
+
var storageBucketsConfig = require('./storage-buckets-config-91932b24.cjs.dev.js');
|
|
6
6
|
require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
|
|
7
7
|
require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
8
|
+
require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
8
9
|
require('cosmiconfig');
|
|
9
10
|
require('ts-deepmerge');
|
|
10
11
|
|
|
@@ -12,8 +13,6 @@ require('ts-deepmerge');
|
|
|
12
13
|
|
|
13
14
|
exports.bucketEnvironments = storageBucketsConfig.bucketEnvironments;
|
|
14
15
|
exports.bucketRegions = storageBucketsConfig.bucketRegions;
|
|
15
|
-
exports.bucketUrls = storageBucketsConfig.bucketUrls;
|
|
16
16
|
exports.clusterContexts = storageBucketsConfig.clusterContexts;
|
|
17
17
|
exports.defineStorageBucketsConfig = storageBucketsConfig.defineStorageBucketsConfig;
|
|
18
|
-
exports.publicStorageUrls = storageBucketsConfig.publicStorageUrls;
|
|
19
18
|
exports.storageProviders = storageBucketsConfig.storageProviders;
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var storageBucketsConfig = require('./storage-buckets-config-
|
|
5
|
+
var storageBucketsConfig = require('./storage-buckets-config-b6d36938.cjs.prod.js');
|
|
6
6
|
require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
|
|
7
7
|
require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
8
|
+
require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
8
9
|
require('cosmiconfig');
|
|
9
10
|
require('ts-deepmerge');
|
|
10
11
|
|
|
@@ -12,8 +13,6 @@ require('ts-deepmerge');
|
|
|
12
13
|
|
|
13
14
|
exports.bucketEnvironments = storageBucketsConfig.bucketEnvironments;
|
|
14
15
|
exports.bucketRegions = storageBucketsConfig.bucketRegions;
|
|
15
|
-
exports.bucketUrls = storageBucketsConfig.bucketUrls;
|
|
16
16
|
exports.clusterContexts = storageBucketsConfig.clusterContexts;
|
|
17
17
|
exports.defineStorageBucketsConfig = storageBucketsConfig.defineStorageBucketsConfig;
|
|
18
|
-
exports.publicStorageUrls = storageBucketsConfig.publicStorageUrls;
|
|
19
18
|
exports.storageProviders = storageBucketsConfig.storageProviders;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { b as bucketEnvironments, a as bucketRegions,
|
|
1
|
+
export { b as bucketEnvironments, a as bucketRegions, c as clusterContexts, d as defineStorageBucketsConfig, s as storageProviders } from './storage-buckets-config-2fc2b441.esm.js';
|
|
2
2
|
import '@babel/runtime-corejs3/core-js-stable/instance/for-each';
|
|
3
3
|
import '@babel/runtime-corejs3/core-js-stable/object/keys';
|
|
4
|
+
import '@babel/runtime-corejs3/core-js-stable/instance/filter';
|
|
4
5
|
import 'cosmiconfig';
|
|
5
6
|
import 'ts-deepmerge';
|
|
@@ -36,12 +36,4 @@ export declare const bucketRegions: {
|
|
|
36
36
|
readonly asia: "merchant-center-asia";
|
|
37
37
|
readonly china: "merchant-center-china";
|
|
38
38
|
};
|
|
39
|
-
export declare const publicStorageUrls: {
|
|
40
|
-
readonly google: "https://storage.googleapis.com";
|
|
41
|
-
readonly aws: "https://s3.amazonaws.com";
|
|
42
|
-
readonly china: "https://mc-storage.cn-northwest-1.aws.commercetools.cn";
|
|
43
|
-
};
|
|
44
|
-
export declare const bucketUrls: {
|
|
45
|
-
readonly china: "commercetools-mc-storage-aws-cn-prod-merchant-center";
|
|
46
|
-
};
|
|
47
39
|
export declare const storageProviders: Record<TStorageProviderTag, TStorageProvider>;
|
package/dist/{storage-buckets-config-705b6341.esm.js → storage-buckets-config-2fc2b441.esm.js}
RENAMED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/for-each';
|
|
2
2
|
import _Object$keys from '@babel/runtime-corejs3/core-js-stable/object/keys';
|
|
3
|
+
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/filter';
|
|
3
4
|
import { cosmiconfig } from 'cosmiconfig';
|
|
4
5
|
import { merge } from 'ts-deepmerge';
|
|
5
6
|
|
|
@@ -40,20 +41,12 @@ const bucketRegions = {
|
|
|
40
41
|
asia: 'merchant-center-asia',
|
|
41
42
|
china: 'merchant-center-china'
|
|
42
43
|
};
|
|
43
|
-
const publicStorageUrls = {
|
|
44
|
-
google: 'https://storage.googleapis.com',
|
|
45
|
-
aws: 'https://s3.amazonaws.com',
|
|
46
|
-
china: 'https://mc-storage.cn-northwest-1.aws.commercetools.cn'
|
|
47
|
-
};
|
|
48
|
-
const bucketUrls = {
|
|
49
|
-
china: 'commercetools-mc-storage-aws-cn-prod-merchant-center'
|
|
50
|
-
};
|
|
51
44
|
const storageProviders = {
|
|
52
45
|
gs: {
|
|
53
46
|
tag: 'gs',
|
|
54
47
|
urls: {
|
|
55
48
|
public: {
|
|
56
|
-
default:
|
|
49
|
+
default: 'https://storage.googleapis.com'
|
|
57
50
|
}
|
|
58
51
|
}
|
|
59
52
|
},
|
|
@@ -61,12 +54,16 @@ const storageProviders = {
|
|
|
61
54
|
tag: 's3',
|
|
62
55
|
urls: {
|
|
63
56
|
public: {
|
|
64
|
-
default:
|
|
65
|
-
'ctp-aws-staging-cn':
|
|
66
|
-
'ctp-aws-production-cn':
|
|
57
|
+
default: null,
|
|
58
|
+
'ctp-aws-staging-cn': 'https://mc-storage.cn-northwest-1.aws.commercetools.cn',
|
|
59
|
+
'ctp-aws-production-cn': 'https://mc-storage.cn-northwest-1.aws.commercetools.cn',
|
|
60
|
+
'ctp-aws-production-ohio': 'https://mc-storage.us-east-2.aws.commercetools.com',
|
|
61
|
+
'ctp-aws-production-fra': 'https://mc-storage.eu-central-1.aws.commercetools.com'
|
|
67
62
|
},
|
|
68
63
|
bucket: {
|
|
69
|
-
'merchant-center-china':
|
|
64
|
+
'merchant-center-china': 'commercetools-mc-storage-aws-cn-prod-merchant-center',
|
|
65
|
+
'merchant-center-europe': 'commercetools-mc-storage-aws-eu-prod-merchant-center',
|
|
66
|
+
'merchant-center-north-america': 'commercetools-mc-storage-aws-us-prod-merchant-center'
|
|
70
67
|
}
|
|
71
68
|
}
|
|
72
69
|
}
|
|
@@ -91,7 +88,8 @@ const defaultConfig = {
|
|
|
91
88
|
}],
|
|
92
89
|
[bucketRegions.europe]: [{
|
|
93
90
|
cloudEnvironment: clusterContexts['ctp_production_aws_eu-central-1_v1'],
|
|
94
|
-
bucketEnvironment: bucketEnvironments['ctp-aws-production-fra']
|
|
91
|
+
bucketEnvironment: bucketEnvironments['ctp-aws-production-fra'],
|
|
92
|
+
storageProviders: ['gs', 's3']
|
|
95
93
|
}, {
|
|
96
94
|
cloudEnvironment: clusterContexts['ctp_production_gcp_europe-west1_v1'],
|
|
97
95
|
bucketEnvironment: bucketEnvironments['ctp-gcp-production-eu']
|
|
@@ -104,7 +102,8 @@ const defaultConfig = {
|
|
|
104
102
|
bucketEnvironment: bucketEnvironments['ctp-att-production-va']
|
|
105
103
|
}, {
|
|
106
104
|
cloudEnvironment: clusterContexts['ctp_production_aws_us-east-2_v1'],
|
|
107
|
-
bucketEnvironment: bucketEnvironments['ctp-aws-production-ohio']
|
|
105
|
+
bucketEnvironment: bucketEnvironments['ctp-aws-production-ohio'],
|
|
106
|
+
storageProviders: ['gs', 's3']
|
|
108
107
|
}, {
|
|
109
108
|
cloudEnvironment: clusterContexts['ctp_production_gcp_us-central1_v1'],
|
|
110
109
|
bucketEnvironment: bucketEnvironments['ctp-gcp-production-us']
|
|
@@ -127,24 +126,27 @@ const defaultConfig = {
|
|
|
127
126
|
}]
|
|
128
127
|
};
|
|
129
128
|
function defineStorageBucketsConfig() {
|
|
129
|
+
var _options$disabledBuck, _options$disabledEnvi;
|
|
130
130
|
let _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
131
131
|
regions = _ref.regions,
|
|
132
132
|
options = _ref.options;
|
|
133
133
|
const actualConfig = regions ? merge(defaultConfig, regions) : defaultConfig;
|
|
134
|
-
const disabledBucketRegions = options
|
|
135
|
-
const disabledEnvironments = options
|
|
134
|
+
const disabledBucketRegions = (_options$disabledBuck = options === null || options === void 0 ? void 0 : options.disabledBucketRegions) !== null && _options$disabledBuck !== void 0 ? _options$disabledBuck : [];
|
|
135
|
+
const disabledEnvironments = (_options$disabledEnvi = options === null || options === void 0 ? void 0 : options.disabledEnvironments) !== null && _options$disabledEnvi !== void 0 ? _options$disabledEnvi : [];
|
|
136
136
|
_forEachInstanceProperty(disabledBucketRegions).call(disabledBucketRegions, disabledBucketRegion => {
|
|
137
137
|
delete actualConfig[disabledBucketRegion];
|
|
138
138
|
});
|
|
139
139
|
const allBucketRegions = _Object$keys(actualConfig);
|
|
140
140
|
_forEachInstanceProperty(disabledEnvironments).call(disabledEnvironments, disabledEnvrionment => {
|
|
141
141
|
_forEachInstanceProperty(allBucketRegions).call(allBucketRegions, bucketRegionToBeRemoved => {
|
|
142
|
-
|
|
142
|
+
var _actualConfig$bucketR;
|
|
143
|
+
actualConfig[bucketRegionToBeRemoved] = (_actualConfig$bucketR = actualConfig[bucketRegionToBeRemoved]) === null || _actualConfig$bucketR === void 0 ? void 0 : _filterInstanceProperty(_actualConfig$bucketR).call(_actualConfig$bucketR, bucketEnvironmentConfig => bucketEnvironmentConfig.cloudEnvironment !== disabledEnvrionment);
|
|
143
144
|
});
|
|
144
145
|
});
|
|
145
146
|
return actualConfig;
|
|
146
147
|
}
|
|
147
148
|
async function loadStorageBucketsConfig() {
|
|
149
|
+
var _explorerResult;
|
|
148
150
|
let explorerResult;
|
|
149
151
|
const storageBucketConfigExplorer = cosmiconfig('storage-buckets', {
|
|
150
152
|
searchStrategy: 'project'
|
|
@@ -158,7 +160,7 @@ async function loadStorageBucketsConfig() {
|
|
|
158
160
|
if (!explorerResult) {
|
|
159
161
|
throw new Error('Failed loading a storage bucket configuration');
|
|
160
162
|
}
|
|
161
|
-
return explorerResult
|
|
163
|
+
return (_explorerResult = explorerResult) === null || _explorerResult === void 0 ? void 0 : _explorerResult.config;
|
|
162
164
|
}
|
|
163
165
|
|
|
164
|
-
export { bucketRegions as a, bucketEnvironments as b, clusterContexts as c, defineStorageBucketsConfig as d,
|
|
166
|
+
export { bucketRegions as a, bucketEnvironments as b, clusterContexts as c, defineStorageBucketsConfig as d, loadStorageBucketsConfig as l, storageProviders as s };
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
|
|
4
4
|
var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
5
|
+
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
5
6
|
var cosmiconfig = require('cosmiconfig');
|
|
6
7
|
var tsDeepmerge = require('ts-deepmerge');
|
|
7
8
|
|
|
@@ -9,6 +10,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e };
|
|
|
9
10
|
|
|
10
11
|
var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachInstanceProperty);
|
|
11
12
|
var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
|
|
13
|
+
var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
|
|
12
14
|
|
|
13
15
|
const clusterContexts = {
|
|
14
16
|
'ctp_staging_gcp_europe-west1_v1': 'ctp_staging_gcp_europe-west1_v1',
|
|
@@ -47,20 +49,12 @@ const bucketRegions = {
|
|
|
47
49
|
asia: 'merchant-center-asia',
|
|
48
50
|
china: 'merchant-center-china'
|
|
49
51
|
};
|
|
50
|
-
const publicStorageUrls = {
|
|
51
|
-
google: 'https://storage.googleapis.com',
|
|
52
|
-
aws: 'https://s3.amazonaws.com',
|
|
53
|
-
china: 'https://mc-storage.cn-northwest-1.aws.commercetools.cn'
|
|
54
|
-
};
|
|
55
|
-
const bucketUrls = {
|
|
56
|
-
china: 'commercetools-mc-storage-aws-cn-prod-merchant-center'
|
|
57
|
-
};
|
|
58
52
|
const storageProviders = {
|
|
59
53
|
gs: {
|
|
60
54
|
tag: 'gs',
|
|
61
55
|
urls: {
|
|
62
56
|
public: {
|
|
63
|
-
default:
|
|
57
|
+
default: 'https://storage.googleapis.com'
|
|
64
58
|
}
|
|
65
59
|
}
|
|
66
60
|
},
|
|
@@ -68,12 +62,16 @@ const storageProviders = {
|
|
|
68
62
|
tag: 's3',
|
|
69
63
|
urls: {
|
|
70
64
|
public: {
|
|
71
|
-
default:
|
|
72
|
-
'ctp-aws-staging-cn':
|
|
73
|
-
'ctp-aws-production-cn':
|
|
65
|
+
default: null,
|
|
66
|
+
'ctp-aws-staging-cn': 'https://mc-storage.cn-northwest-1.aws.commercetools.cn',
|
|
67
|
+
'ctp-aws-production-cn': 'https://mc-storage.cn-northwest-1.aws.commercetools.cn',
|
|
68
|
+
'ctp-aws-production-ohio': 'https://mc-storage.us-east-2.aws.commercetools.com',
|
|
69
|
+
'ctp-aws-production-fra': 'https://mc-storage.eu-central-1.aws.commercetools.com'
|
|
74
70
|
},
|
|
75
71
|
bucket: {
|
|
76
|
-
'merchant-center-china':
|
|
72
|
+
'merchant-center-china': 'commercetools-mc-storage-aws-cn-prod-merchant-center',
|
|
73
|
+
'merchant-center-europe': 'commercetools-mc-storage-aws-eu-prod-merchant-center',
|
|
74
|
+
'merchant-center-north-america': 'commercetools-mc-storage-aws-us-prod-merchant-center'
|
|
77
75
|
}
|
|
78
76
|
}
|
|
79
77
|
}
|
|
@@ -98,7 +96,8 @@ const defaultConfig = {
|
|
|
98
96
|
}],
|
|
99
97
|
[bucketRegions.europe]: [{
|
|
100
98
|
cloudEnvironment: clusterContexts['ctp_production_aws_eu-central-1_v1'],
|
|
101
|
-
bucketEnvironment: bucketEnvironments['ctp-aws-production-fra']
|
|
99
|
+
bucketEnvironment: bucketEnvironments['ctp-aws-production-fra'],
|
|
100
|
+
storageProviders: ['gs', 's3']
|
|
102
101
|
}, {
|
|
103
102
|
cloudEnvironment: clusterContexts['ctp_production_gcp_europe-west1_v1'],
|
|
104
103
|
bucketEnvironment: bucketEnvironments['ctp-gcp-production-eu']
|
|
@@ -111,7 +110,8 @@ const defaultConfig = {
|
|
|
111
110
|
bucketEnvironment: bucketEnvironments['ctp-att-production-va']
|
|
112
111
|
}, {
|
|
113
112
|
cloudEnvironment: clusterContexts['ctp_production_aws_us-east-2_v1'],
|
|
114
|
-
bucketEnvironment: bucketEnvironments['ctp-aws-production-ohio']
|
|
113
|
+
bucketEnvironment: bucketEnvironments['ctp-aws-production-ohio'],
|
|
114
|
+
storageProviders: ['gs', 's3']
|
|
115
115
|
}, {
|
|
116
116
|
cloudEnvironment: clusterContexts['ctp_production_gcp_us-central1_v1'],
|
|
117
117
|
bucketEnvironment: bucketEnvironments['ctp-gcp-production-us']
|
|
@@ -134,24 +134,27 @@ const defaultConfig = {
|
|
|
134
134
|
}]
|
|
135
135
|
};
|
|
136
136
|
function defineStorageBucketsConfig() {
|
|
137
|
+
var _options$disabledBuck, _options$disabledEnvi;
|
|
137
138
|
let _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
138
139
|
regions = _ref.regions,
|
|
139
140
|
options = _ref.options;
|
|
140
141
|
const actualConfig = regions ? tsDeepmerge.merge(defaultConfig, regions) : defaultConfig;
|
|
141
|
-
const disabledBucketRegions = options
|
|
142
|
-
const disabledEnvironments = options
|
|
142
|
+
const disabledBucketRegions = (_options$disabledBuck = options === null || options === void 0 ? void 0 : options.disabledBucketRegions) !== null && _options$disabledBuck !== void 0 ? _options$disabledBuck : [];
|
|
143
|
+
const disabledEnvironments = (_options$disabledEnvi = options === null || options === void 0 ? void 0 : options.disabledEnvironments) !== null && _options$disabledEnvi !== void 0 ? _options$disabledEnvi : [];
|
|
143
144
|
_forEachInstanceProperty__default["default"](disabledBucketRegions).call(disabledBucketRegions, disabledBucketRegion => {
|
|
144
145
|
delete actualConfig[disabledBucketRegion];
|
|
145
146
|
});
|
|
146
147
|
const allBucketRegions = _Object$keys__default["default"](actualConfig);
|
|
147
148
|
_forEachInstanceProperty__default["default"](disabledEnvironments).call(disabledEnvironments, disabledEnvrionment => {
|
|
148
149
|
_forEachInstanceProperty__default["default"](allBucketRegions).call(allBucketRegions, bucketRegionToBeRemoved => {
|
|
149
|
-
|
|
150
|
+
var _actualConfig$bucketR;
|
|
151
|
+
actualConfig[bucketRegionToBeRemoved] = (_actualConfig$bucketR = actualConfig[bucketRegionToBeRemoved]) === null || _actualConfig$bucketR === void 0 ? void 0 : _filterInstanceProperty__default["default"](_actualConfig$bucketR).call(_actualConfig$bucketR, bucketEnvironmentConfig => bucketEnvironmentConfig.cloudEnvironment !== disabledEnvrionment);
|
|
150
152
|
});
|
|
151
153
|
});
|
|
152
154
|
return actualConfig;
|
|
153
155
|
}
|
|
154
156
|
async function loadStorageBucketsConfig() {
|
|
157
|
+
var _explorerResult;
|
|
155
158
|
let explorerResult;
|
|
156
159
|
const storageBucketConfigExplorer = cosmiconfig.cosmiconfig('storage-buckets', {
|
|
157
160
|
searchStrategy: 'project'
|
|
@@ -165,14 +168,12 @@ async function loadStorageBucketsConfig() {
|
|
|
165
168
|
if (!explorerResult) {
|
|
166
169
|
throw new Error('Failed loading a storage bucket configuration');
|
|
167
170
|
}
|
|
168
|
-
return explorerResult
|
|
171
|
+
return (_explorerResult = explorerResult) === null || _explorerResult === void 0 ? void 0 : _explorerResult.config;
|
|
169
172
|
}
|
|
170
173
|
|
|
171
174
|
exports.bucketEnvironments = bucketEnvironments;
|
|
172
175
|
exports.bucketRegions = bucketRegions;
|
|
173
|
-
exports.bucketUrls = bucketUrls;
|
|
174
176
|
exports.clusterContexts = clusterContexts;
|
|
175
177
|
exports.defineStorageBucketsConfig = defineStorageBucketsConfig;
|
|
176
178
|
exports.loadStorageBucketsConfig = loadStorageBucketsConfig;
|
|
177
|
-
exports.publicStorageUrls = publicStorageUrls;
|
|
178
179
|
exports.storageProviders = storageProviders;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
|
|
4
4
|
var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
5
|
+
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
5
6
|
var cosmiconfig = require('cosmiconfig');
|
|
6
7
|
var tsDeepmerge = require('ts-deepmerge');
|
|
7
8
|
|
|
@@ -9,6 +10,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e };
|
|
|
9
10
|
|
|
10
11
|
var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachInstanceProperty);
|
|
11
12
|
var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
|
|
13
|
+
var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
|
|
12
14
|
|
|
13
15
|
const clusterContexts = {
|
|
14
16
|
'ctp_staging_gcp_europe-west1_v1': 'ctp_staging_gcp_europe-west1_v1',
|
|
@@ -47,20 +49,12 @@ const bucketRegions = {
|
|
|
47
49
|
asia: 'merchant-center-asia',
|
|
48
50
|
china: 'merchant-center-china'
|
|
49
51
|
};
|
|
50
|
-
const publicStorageUrls = {
|
|
51
|
-
google: 'https://storage.googleapis.com',
|
|
52
|
-
aws: 'https://s3.amazonaws.com',
|
|
53
|
-
china: 'https://mc-storage.cn-northwest-1.aws.commercetools.cn'
|
|
54
|
-
};
|
|
55
|
-
const bucketUrls = {
|
|
56
|
-
china: 'commercetools-mc-storage-aws-cn-prod-merchant-center'
|
|
57
|
-
};
|
|
58
52
|
const storageProviders = {
|
|
59
53
|
gs: {
|
|
60
54
|
tag: 'gs',
|
|
61
55
|
urls: {
|
|
62
56
|
public: {
|
|
63
|
-
default:
|
|
57
|
+
default: 'https://storage.googleapis.com'
|
|
64
58
|
}
|
|
65
59
|
}
|
|
66
60
|
},
|
|
@@ -68,12 +62,16 @@ const storageProviders = {
|
|
|
68
62
|
tag: 's3',
|
|
69
63
|
urls: {
|
|
70
64
|
public: {
|
|
71
|
-
default:
|
|
72
|
-
'ctp-aws-staging-cn':
|
|
73
|
-
'ctp-aws-production-cn':
|
|
65
|
+
default: null,
|
|
66
|
+
'ctp-aws-staging-cn': 'https://mc-storage.cn-northwest-1.aws.commercetools.cn',
|
|
67
|
+
'ctp-aws-production-cn': 'https://mc-storage.cn-northwest-1.aws.commercetools.cn',
|
|
68
|
+
'ctp-aws-production-ohio': 'https://mc-storage.us-east-2.aws.commercetools.com',
|
|
69
|
+
'ctp-aws-production-fra': 'https://mc-storage.eu-central-1.aws.commercetools.com'
|
|
74
70
|
},
|
|
75
71
|
bucket: {
|
|
76
|
-
'merchant-center-china':
|
|
72
|
+
'merchant-center-china': 'commercetools-mc-storage-aws-cn-prod-merchant-center',
|
|
73
|
+
'merchant-center-europe': 'commercetools-mc-storage-aws-eu-prod-merchant-center',
|
|
74
|
+
'merchant-center-north-america': 'commercetools-mc-storage-aws-us-prod-merchant-center'
|
|
77
75
|
}
|
|
78
76
|
}
|
|
79
77
|
}
|
|
@@ -98,7 +96,8 @@ const defaultConfig = {
|
|
|
98
96
|
}],
|
|
99
97
|
[bucketRegions.europe]: [{
|
|
100
98
|
cloudEnvironment: clusterContexts['ctp_production_aws_eu-central-1_v1'],
|
|
101
|
-
bucketEnvironment: bucketEnvironments['ctp-aws-production-fra']
|
|
99
|
+
bucketEnvironment: bucketEnvironments['ctp-aws-production-fra'],
|
|
100
|
+
storageProviders: ['gs', 's3']
|
|
102
101
|
}, {
|
|
103
102
|
cloudEnvironment: clusterContexts['ctp_production_gcp_europe-west1_v1'],
|
|
104
103
|
bucketEnvironment: bucketEnvironments['ctp-gcp-production-eu']
|
|
@@ -111,7 +110,8 @@ const defaultConfig = {
|
|
|
111
110
|
bucketEnvironment: bucketEnvironments['ctp-att-production-va']
|
|
112
111
|
}, {
|
|
113
112
|
cloudEnvironment: clusterContexts['ctp_production_aws_us-east-2_v1'],
|
|
114
|
-
bucketEnvironment: bucketEnvironments['ctp-aws-production-ohio']
|
|
113
|
+
bucketEnvironment: bucketEnvironments['ctp-aws-production-ohio'],
|
|
114
|
+
storageProviders: ['gs', 's3']
|
|
115
115
|
}, {
|
|
116
116
|
cloudEnvironment: clusterContexts['ctp_production_gcp_us-central1_v1'],
|
|
117
117
|
bucketEnvironment: bucketEnvironments['ctp-gcp-production-us']
|
|
@@ -134,24 +134,27 @@ const defaultConfig = {
|
|
|
134
134
|
}]
|
|
135
135
|
};
|
|
136
136
|
function defineStorageBucketsConfig() {
|
|
137
|
+
var _options$disabledBuck, _options$disabledEnvi;
|
|
137
138
|
let _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
138
139
|
regions = _ref.regions,
|
|
139
140
|
options = _ref.options;
|
|
140
141
|
const actualConfig = regions ? tsDeepmerge.merge(defaultConfig, regions) : defaultConfig;
|
|
141
|
-
const disabledBucketRegions = options
|
|
142
|
-
const disabledEnvironments = options
|
|
142
|
+
const disabledBucketRegions = (_options$disabledBuck = options === null || options === void 0 ? void 0 : options.disabledBucketRegions) !== null && _options$disabledBuck !== void 0 ? _options$disabledBuck : [];
|
|
143
|
+
const disabledEnvironments = (_options$disabledEnvi = options === null || options === void 0 ? void 0 : options.disabledEnvironments) !== null && _options$disabledEnvi !== void 0 ? _options$disabledEnvi : [];
|
|
143
144
|
_forEachInstanceProperty__default["default"](disabledBucketRegions).call(disabledBucketRegions, disabledBucketRegion => {
|
|
144
145
|
delete actualConfig[disabledBucketRegion];
|
|
145
146
|
});
|
|
146
147
|
const allBucketRegions = _Object$keys__default["default"](actualConfig);
|
|
147
148
|
_forEachInstanceProperty__default["default"](disabledEnvironments).call(disabledEnvironments, disabledEnvrionment => {
|
|
148
149
|
_forEachInstanceProperty__default["default"](allBucketRegions).call(allBucketRegions, bucketRegionToBeRemoved => {
|
|
149
|
-
|
|
150
|
+
var _actualConfig$bucketR;
|
|
151
|
+
actualConfig[bucketRegionToBeRemoved] = (_actualConfig$bucketR = actualConfig[bucketRegionToBeRemoved]) === null || _actualConfig$bucketR === void 0 ? void 0 : _filterInstanceProperty__default["default"](_actualConfig$bucketR).call(_actualConfig$bucketR, bucketEnvironmentConfig => bucketEnvironmentConfig.cloudEnvironment !== disabledEnvrionment);
|
|
150
152
|
});
|
|
151
153
|
});
|
|
152
154
|
return actualConfig;
|
|
153
155
|
}
|
|
154
156
|
async function loadStorageBucketsConfig() {
|
|
157
|
+
var _explorerResult;
|
|
155
158
|
let explorerResult;
|
|
156
159
|
const storageBucketConfigExplorer = cosmiconfig.cosmiconfig('storage-buckets', {
|
|
157
160
|
searchStrategy: 'project'
|
|
@@ -165,14 +168,12 @@ async function loadStorageBucketsConfig() {
|
|
|
165
168
|
if (!explorerResult) {
|
|
166
169
|
throw new Error('Failed loading a storage bucket configuration');
|
|
167
170
|
}
|
|
168
|
-
return explorerResult
|
|
171
|
+
return (_explorerResult = explorerResult) === null || _explorerResult === void 0 ? void 0 : _explorerResult.config;
|
|
169
172
|
}
|
|
170
173
|
|
|
171
174
|
exports.bucketEnvironments = bucketEnvironments;
|
|
172
175
|
exports.bucketRegions = bucketRegions;
|
|
173
|
-
exports.bucketUrls = bucketUrls;
|
|
174
176
|
exports.clusterContexts = clusterContexts;
|
|
175
177
|
exports.defineStorageBucketsConfig = defineStorageBucketsConfig;
|
|
176
178
|
exports.loadStorageBucketsConfig = loadStorageBucketsConfig;
|
|
177
|
-
exports.publicStorageUrls = publicStorageUrls;
|
|
178
179
|
exports.storageProviders = storageProviders;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/application-cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "Internal CLI to manage Merchant Center application deployments across various environments.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"commercetools",
|
|
@@ -22,22 +22,22 @@
|
|
|
22
22
|
"@babel/core": "^7.22.11",
|
|
23
23
|
"@babel/runtime": "^7.21.0",
|
|
24
24
|
"@babel/runtime-corejs3": "^7.21.0",
|
|
25
|
-
"@commercetools-frontend/application-config": "22.
|
|
26
|
-
"@commercetools-frontend/constants": "22.
|
|
27
|
-
"@commercetools-frontend/l10n": "22.
|
|
25
|
+
"@commercetools-frontend/application-config": "22.23.3",
|
|
26
|
+
"@commercetools-frontend/constants": "22.23.3",
|
|
27
|
+
"@commercetools-frontend/l10n": "22.23.3",
|
|
28
28
|
"@manypkg/find-root": "2.2.1",
|
|
29
29
|
"cac": "^6.7.14",
|
|
30
30
|
"cosmiconfig": "9.0.0",
|
|
31
|
-
"dotenv": "16.4.
|
|
31
|
+
"dotenv": "16.4.5",
|
|
32
32
|
"execa": "5.1.1",
|
|
33
33
|
"jsonschema": "^1.4.1",
|
|
34
|
-
"listr2": "8.0
|
|
34
|
+
"listr2": "8.2.0",
|
|
35
35
|
"node-fetch": "2.7.0",
|
|
36
36
|
"ts-deepmerge": "7.0.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@tsconfig/node20": "20.1.
|
|
40
|
-
"@types/node": "20.12.
|
|
39
|
+
"@tsconfig/node20": "20.1.4",
|
|
40
|
+
"@types/node": "20.12.7",
|
|
41
41
|
"typescript": "5.2.2"
|
|
42
42
|
},
|
|
43
43
|
"engines": {
|