@commercetools-frontend/application-config 20.10.4 → 20.12.1
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/dist/commercetools-frontend-application-config.cjs.dev.js +37 -34
- package/dist/commercetools-frontend-application-config.cjs.prod.js +37 -34
- package/dist/commercetools-frontend-application-config.esm.js +5 -2
- package/dist/declarations/src/schema.d.ts +1 -0
- package/dist/declarations/src/utils.d.ts +0 -2
- package/package.json +7 -10
- package/schema.json +4 -1
|
@@ -59,9 +59,9 @@ var uniq__default = /*#__PURE__*/_interopDefault(uniq);
|
|
|
59
59
|
var _trimInstanceProperty__default = /*#__PURE__*/_interopDefault(_trimInstanceProperty);
|
|
60
60
|
var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
61
61
|
|
|
62
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct__default[
|
|
62
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
63
63
|
|
|
64
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct__default[
|
|
64
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
65
65
|
|
|
66
66
|
var MissingOrInvalidConfigError = /*#__PURE__*/function (_Error) {
|
|
67
67
|
_inherits(MissingOrInvalidConfigError, _Error);
|
|
@@ -75,7 +75,7 @@ var MissingOrInvalidConfigError = /*#__PURE__*/function (_Error) {
|
|
|
75
75
|
|
|
76
76
|
_this = _super.call(this, message);
|
|
77
77
|
|
|
78
|
-
_Object$defineProperty__default[
|
|
78
|
+
_Object$defineProperty__default["default"](_assertThisInitialized(_this), 'name', {
|
|
79
79
|
value: 'MissingOrInvalidConfigError'
|
|
80
80
|
});
|
|
81
81
|
|
|
@@ -88,26 +88,26 @@ var MissingOrInvalidConfigError = /*#__PURE__*/function (_Error) {
|
|
|
88
88
|
// for instance in respect to both source files and dist files.
|
|
89
89
|
|
|
90
90
|
var findPackageRootPath = function findPackageRootPath(dir) {
|
|
91
|
-
var packageJsonPath = path__default[
|
|
91
|
+
var packageJsonPath = path__default["default"].join(dir, 'package.json');
|
|
92
92
|
|
|
93
|
-
if (fs__default[
|
|
93
|
+
if (fs__default["default"].existsSync(packageJsonPath)) {
|
|
94
94
|
return dir;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
var parentDir = path__default[
|
|
97
|
+
var parentDir = path__default["default"].join(dir, '..');
|
|
98
98
|
return findPackageRootPath(parentDir);
|
|
99
99
|
};
|
|
100
100
|
|
|
101
101
|
var loadJsModule = function loadJsModule(filePath) {
|
|
102
102
|
var packageRootPath = findPackageRootPath( // Start from the parent folder
|
|
103
|
-
path__default[
|
|
103
|
+
path__default["default"].join(__dirname, '..')); // Load the JS module using a child process. This is primarly to avoid
|
|
104
104
|
// unwanted behaviors using `@babel/register` in the main process.
|
|
105
105
|
// The loader script does the actual `require` of the given `filePath`
|
|
106
106
|
// and uses `@babel/register` to correctly parse and execute the file.
|
|
107
107
|
// The "required module output" is then written into `stdout` and parsed
|
|
108
108
|
// as JSON.
|
|
109
109
|
|
|
110
|
-
var output = child_process.execFileSync(path__default[
|
|
110
|
+
var output = child_process.execFileSync(path__default["default"].join(packageRootPath, 'scripts/load-js-module.js'), [filePath], {
|
|
111
111
|
encoding: 'utf8'
|
|
112
112
|
});
|
|
113
113
|
return JSON.parse(output);
|
|
@@ -287,6 +287,9 @@ var schemaJson = {
|
|
|
287
287
|
},
|
|
288
288
|
"style-src": {
|
|
289
289
|
$ref: "#/definitions/cspDirective"
|
|
290
|
+
},
|
|
291
|
+
"frame-src": {
|
|
292
|
+
$ref: "#/definitions/cspDirective"
|
|
290
293
|
}
|
|
291
294
|
},
|
|
292
295
|
additionalProperties: false,
|
|
@@ -324,7 +327,7 @@ var schemaJson = {
|
|
|
324
327
|
type: "object",
|
|
325
328
|
properties: {
|
|
326
329
|
icon: {
|
|
327
|
-
description: "The SVG icon that represents this application. Pass the raw SVG string or a path to an SVG file, for example a relative path `${path:./app.svg}`, or a path from a module `${path:@commercetools-frontend/assets/application-icons/
|
|
330
|
+
description: "The SVG icon that represents this application. Pass the raw SVG string or a path to an SVG file, for example a relative path `${path:./app.svg}`, or a path from a module `${path:@commercetools-frontend/assets/application-icons/Rocket.svg}`.",
|
|
328
331
|
type: "string"
|
|
329
332
|
},
|
|
330
333
|
defaultLabel: {
|
|
@@ -457,7 +460,7 @@ var schemaJson = {
|
|
|
457
460
|
]
|
|
458
461
|
};
|
|
459
462
|
|
|
460
|
-
var ajv = new Ajv__default[
|
|
463
|
+
var ajv = new Ajv__default["default"]({
|
|
461
464
|
strict: true,
|
|
462
465
|
useDefaults: true
|
|
463
466
|
});
|
|
@@ -468,17 +471,17 @@ var printErrors = function printErrors(errors) {
|
|
|
468
471
|
return 'No errors';
|
|
469
472
|
}
|
|
470
473
|
|
|
471
|
-
return _mapInstanceProperty__default[
|
|
474
|
+
return _mapInstanceProperty__default["default"](errors).call(errors, function (error) {
|
|
472
475
|
var _context, _context2, _context3;
|
|
473
476
|
|
|
474
|
-
var baseMessage = _concatInstanceProperty__default[
|
|
477
|
+
var baseMessage = _concatInstanceProperty__default["default"](_context = "".concat(error.instancePath, " ")).call(_context, error.message);
|
|
475
478
|
|
|
476
479
|
switch (error.keyword) {
|
|
477
480
|
case 'additionalProperties':
|
|
478
|
-
return _concatInstanceProperty__default[
|
|
481
|
+
return _concatInstanceProperty__default["default"](_context2 = "".concat(baseMessage, ": ")).call(_context2, error.params.additionalProperty);
|
|
479
482
|
|
|
480
483
|
case 'enum':
|
|
481
|
-
return _concatInstanceProperty__default[
|
|
484
|
+
return _concatInstanceProperty__default["default"](_context3 = "".concat(baseMessage, ": ")).call(_context3, error.params.allowedValues.toString());
|
|
482
485
|
|
|
483
486
|
default:
|
|
484
487
|
return baseMessage;
|
|
@@ -531,7 +534,7 @@ var mapCloudIdentifierToApiUrl = function mapCloudIdentifierToApiUrl(key) {
|
|
|
531
534
|
default:
|
|
532
535
|
// We would probably never get to this point, as the JSON schema validation
|
|
533
536
|
// kicks in before.
|
|
534
|
-
throw new Error(_concatInstanceProperty__default[
|
|
537
|
+
throw new Error(_concatInstanceProperty__default["default"](_context = "Unknown cloud identifier \"".concat(key, "\". Supported values: ")).call(_context, _Object$values__default["default"](CLOUD_IDENTIFIERS).toString()));
|
|
535
538
|
}
|
|
536
539
|
};
|
|
537
540
|
|
|
@@ -540,7 +543,7 @@ var getUniqueValues = function getUniqueValues() {
|
|
|
540
543
|
|
|
541
544
|
var initialValues = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
542
545
|
var additionalValues = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
543
|
-
return uniq__default[
|
|
546
|
+
return uniq__default["default"](_concatInstanceProperty__default["default"](_context2 = []).call(_context2, _toConsumableArray(initialValues), _toConsumableArray(additionalValues)));
|
|
544
547
|
};
|
|
545
548
|
|
|
546
549
|
var nonProductionEnvironment = ['development', 'test'];
|
|
@@ -550,7 +553,7 @@ var getIsProd = function getIsProd(env) {
|
|
|
550
553
|
// a production environment unless it's one of `development` or `test`.
|
|
551
554
|
// This allows to use for example the `staging` value, which from the
|
|
552
555
|
// application perspective is still considered a production environment.
|
|
553
|
-
env.MC_APP_ENV ? !_includesInstanceProperty__default[
|
|
556
|
+
env.MC_APP_ENV ? !_includesInstanceProperty__default["default"](nonProductionEnvironment).call(nonProductionEnvironment, env.MC_APP_ENV) : env.NODE_ENV === 'production'
|
|
554
557
|
);
|
|
555
558
|
};
|
|
556
559
|
|
|
@@ -567,7 +570,7 @@ var getOrThrow = function getOrThrow(fn, errorMessage) {
|
|
|
567
570
|
* Allows variable placeholders. Supported types are:
|
|
568
571
|
* - `env`: For example `${env:MC_API_URL}`.
|
|
569
572
|
* - `intl`: For example `${intl:en:Menu.title}`.
|
|
570
|
-
* - `path`: For example `${path:./app.svg}`, or `${path:@commercetools-frontend/assets/application-icons/
|
|
573
|
+
* - `path`: For example `${path:./app.svg}`, or `${path:@commercetools-frontend/assets/application-icons/Rocket.svg}`.
|
|
571
574
|
*/
|
|
572
575
|
var variableSyntax = /\${([ ~:\w.'",\-/()@]+?)}/g;
|
|
573
576
|
var envRefSyntax = /^env:/g;
|
|
@@ -605,7 +608,7 @@ var substituteEnvVariablePlaceholder = function substituteEnvVariablePlaceholder
|
|
|
605
608
|
if (!hasEnvField) {
|
|
606
609
|
var _context;
|
|
607
610
|
|
|
608
|
-
throw new Error(_concatInstanceProperty__default[
|
|
611
|
+
throw new Error(_concatInstanceProperty__default["default"](_context = "Missing environment variable '".concat(requestedEnvVar, "' specified in config as 'env:")).call(_context, requestedEnvVar, "'."));
|
|
609
612
|
}
|
|
610
613
|
|
|
611
614
|
var escapedMatchedString = matchedString.replace(/[${}:]/g, '\\$&');
|
|
@@ -629,7 +632,7 @@ var substituteIntlVariablePlaceholder = function substituteIntlVariablePlacehold
|
|
|
629
632
|
if (!hasIntlMessage) {
|
|
630
633
|
var _context2, _context3;
|
|
631
634
|
|
|
632
|
-
throw new Error(_concatInstanceProperty__default[
|
|
635
|
+
throw new Error(_concatInstanceProperty__default["default"](_context2 = _concatInstanceProperty__default["default"](_context3 = "Missing message key '".concat(requestedIntlMessageId, "' specified in config as 'intl:")).call(_context3, locale, ":")).call(_context2, requestedIntlMessageId, "'."));
|
|
633
636
|
}
|
|
634
637
|
|
|
635
638
|
var escapedMatchedString = matchedString.replace(/[${}:]/g, '\\$&');
|
|
@@ -641,7 +644,7 @@ var substituteFilePathVariablePlaceholder = function substituteFilePathVariableP
|
|
|
641
644
|
_valueOfPlaceholder$s6 = _slicedToArray(_valueOfPlaceholder$s5, 2),
|
|
642
645
|
filePathOrModule = _valueOfPlaceholder$s6[1];
|
|
643
646
|
|
|
644
|
-
var content = fs__default[
|
|
647
|
+
var content = fs__default["default"].readFileSync(require.resolve(filePathOrModule, {
|
|
645
648
|
// Relative paths should be resolved from the application folder.
|
|
646
649
|
paths: [meta.applicationPath]
|
|
647
650
|
}), {
|
|
@@ -653,12 +656,12 @@ var substituteFilePathVariablePlaceholder = function substituteFilePathVariableP
|
|
|
653
656
|
|
|
654
657
|
var getValueOfPlaceholder = function getValueOfPlaceholder(valueWithPlaceholder) {
|
|
655
658
|
return valueWithPlaceholder.replace(variableSyntax, function (_match, varName) {
|
|
656
|
-
return _trimInstanceProperty__default[
|
|
659
|
+
return _trimInstanceProperty__default["default"](varName).call(varName);
|
|
657
660
|
}).replace(/\s/g, '');
|
|
658
661
|
};
|
|
659
662
|
|
|
660
663
|
var substituteVariablePlaceholders = function substituteVariablePlaceholders(config, meta) {
|
|
661
|
-
return JSON.parse(_JSON$stringify__default[
|
|
664
|
+
return JSON.parse(_JSON$stringify__default["default"](config), function (_key, value) {
|
|
662
665
|
// Only strings are allowed
|
|
663
666
|
var substitutedValue = value;
|
|
664
667
|
|
|
@@ -666,7 +669,7 @@ var substituteVariablePlaceholders = function substituteVariablePlaceholders(con
|
|
|
666
669
|
var matchResult = substitutedValue.match(variableSyntax);
|
|
667
670
|
|
|
668
671
|
if (matchResult) {
|
|
669
|
-
_forEachInstanceProperty__default[
|
|
672
|
+
_forEachInstanceProperty__default["default"](matchResult).call(matchResult, function (matchedString) {
|
|
670
673
|
var valueOfPlaceholder = getValueOfPlaceholder(matchedString);
|
|
671
674
|
|
|
672
675
|
if (isEnvVariablePlaceholder(valueOfPlaceholder)) {
|
|
@@ -684,9 +687,9 @@ var substituteVariablePlaceholders = function substituteVariablePlaceholders(con
|
|
|
684
687
|
});
|
|
685
688
|
};
|
|
686
689
|
|
|
687
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default[
|
|
690
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); if (enumerableOnly) { symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
688
691
|
|
|
689
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context3; _forEachInstanceProperty__default[
|
|
692
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context3; _forEachInstanceProperty__default["default"](_context3 = ownKeys(Object(source), true)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors__default["default"]) { _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)); } else { var _context4; _forEachInstanceProperty__default["default"](_context4 = ownKeys(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
|
|
690
693
|
// TODO: make it configurable.
|
|
691
694
|
var developmentPort = 3001;
|
|
692
695
|
var developmentAppUrl = "http://localhost:".concat(developmentPort);
|
|
@@ -710,7 +713,7 @@ var processConfig = function processConfig() {
|
|
|
710
713
|
_ref$processEnv = _ref.processEnv,
|
|
711
714
|
processEnv = _ref$processEnv === void 0 ? process.env : _ref$processEnv,
|
|
712
715
|
_ref$applicationPath = _ref.applicationPath,
|
|
713
|
-
applicationPath = _ref$applicationPath === void 0 ? fs__default[
|
|
716
|
+
applicationPath = _ref$applicationPath === void 0 ? fs__default["default"].realpathSync(process.cwd()) : _ref$applicationPath;
|
|
714
717
|
|
|
715
718
|
if (cachedConfig && !disableCache) return cachedConfig;
|
|
716
719
|
var appEnvKey = (_ref2 = (_processEnv$MC_APP_EN = processEnv.MC_APP_ENV) !== null && _processEnv$MC_APP_EN !== void 0 ? _processEnv$MC_APP_EN : processEnv.NODE_ENV) !== null && _ref2 !== void 0 ? _ref2 : 'development';
|
|
@@ -729,15 +732,15 @@ var processConfig = function processConfig() {
|
|
|
729
732
|
|
|
730
733
|
var envAppUrl = isProd ? appConfig.env.production.url : developmentAppUrl;
|
|
731
734
|
var appUrl = getOrThrow(function () {
|
|
732
|
-
return new _URL__default[
|
|
735
|
+
return new _URL__default["default"](envAppUrl);
|
|
733
736
|
}, "Invalid application URL: \"".concat(envAppUrl, "\"")); // Use `||` instead of `??` to include empty string values.
|
|
734
737
|
|
|
735
738
|
var envCdnUrl = isProd ? appConfig.env.production.cdnUrl || appUrl.href : developmentAppUrl;
|
|
736
739
|
var cdnUrl = getOrThrow(function () {
|
|
737
|
-
return new _URL__default[
|
|
740
|
+
return new _URL__default["default"](envCdnUrl);
|
|
738
741
|
}, "Invalid application CDN URL: \"".concat(envCdnUrl, "\""));
|
|
739
742
|
var mcApiUrl = getOrThrow(function () {
|
|
740
|
-
return new _URL__default[
|
|
743
|
+
return new _URL__default["default"]( // Use `||` instead of `??` to include empty string values.
|
|
741
744
|
appConfig.mcApiUrl || mapCloudIdentifierToApiUrl(appConfig.cloudIdentifier));
|
|
742
745
|
}, "Invalid MC API URL: \"".concat(appConfig.mcApiUrl, "\"")); // The real application ID is only used in production.
|
|
743
746
|
// In development, we prefix the entry point with the "__local" prefix.
|
|
@@ -751,7 +754,7 @@ var processConfig = function processConfig() {
|
|
|
751
754
|
if (appConfig.env.production.applicationId) {
|
|
752
755
|
var _context;
|
|
753
756
|
|
|
754
|
-
applicationId = _concatInstanceProperty__default[
|
|
757
|
+
applicationId = _concatInstanceProperty__default["default"](_context = "".concat(appConfig.env.production.applicationId, ":")).call(_context, appConfig.entryPointUriPath);
|
|
755
758
|
} else {
|
|
756
759
|
// As long as we don't require the application ID in production, we should
|
|
757
760
|
// fall back to unset the value.
|
|
@@ -760,7 +763,7 @@ var processConfig = function processConfig() {
|
|
|
760
763
|
}
|
|
761
764
|
|
|
762
765
|
var developmentConfig = isProd ? undefined : omitDevConfigIfEmpty({
|
|
763
|
-
oidc: isOidcForDevelopmentEnabled ? omitEmpty__default[
|
|
766
|
+
oidc: isOidcForDevelopmentEnabled ? omitEmpty__default["default"]({
|
|
764
767
|
authorizeUrl: [// In case the MC API url points to localhost, we need to point
|
|
765
768
|
// to a local running dev login page to handle the workflow properly.
|
|
766
769
|
mcApiUrl.hostname === 'localhost' ? mcApiUrl.origin.replace(mcApiUrl.port, String(developmentPort)) : mcApiUrl.origin.replace('mc-api', 'mc'), '/login/authorize'].join(''),
|
|
@@ -773,7 +776,7 @@ var processConfig = function processConfig() {
|
|
|
773
776
|
accountLinks: appConfig.accountLinks
|
|
774
777
|
});
|
|
775
778
|
cachedConfig = {
|
|
776
|
-
env: _objectSpread(_objectSpread(_objectSpread({}, omitEmpty__default[
|
|
779
|
+
env: _objectSpread(_objectSpread(_objectSpread({}, omitEmpty__default["default"](additionalAppEnv)), {}, {
|
|
777
780
|
// TODO: how else should we provide the app identifier?
|
|
778
781
|
applicationId: applicationId,
|
|
779
782
|
applicationName: appConfig.name,
|
|
@@ -791,7 +794,7 @@ var processConfig = function processConfig() {
|
|
|
791
794
|
}),
|
|
792
795
|
headers: _objectSpread(_objectSpread({}, appConfig.headers), {}, {
|
|
793
796
|
csp: _objectSpread(_objectSpread({}, (_appConfig$headers = appConfig.headers) === null || _appConfig$headers === void 0 ? void 0 : _appConfig$headers.csp), {}, {
|
|
794
|
-
'connect-src': getUniqueValues((_appConfig$headers2 = appConfig.headers) === null || _appConfig$headers2 === void 0 ? void 0 : _appConfig$headers2.csp['connect-src'], _concatInstanceProperty__default[
|
|
797
|
+
'connect-src': getUniqueValues((_appConfig$headers2 = appConfig.headers) === null || _appConfig$headers2 === void 0 ? void 0 : _appConfig$headers2.csp['connect-src'], _concatInstanceProperty__default["default"](_context2 = [mcApiUrl.origin]).call(_context2, isProd ? [appUrl.href] : [])),
|
|
795
798
|
'script-src': getUniqueValues((_appConfig$headers3 = appConfig.headers) === null || _appConfig$headers3 === void 0 ? void 0 : _appConfig$headers3.csp['script-src'], isProd ? [appUrl.href, cdnUrl.href] : []),
|
|
796
799
|
'style-src': getUniqueValues((_appConfig$headers4 = appConfig.headers) === null || _appConfig$headers4 === void 0 ? void 0 : _appConfig$headers4.csp['style-src'], isProd ? [appUrl.href, cdnUrl.href] : [])
|
|
797
800
|
})
|
|
@@ -59,9 +59,9 @@ var uniq__default = /*#__PURE__*/_interopDefault(uniq);
|
|
|
59
59
|
var _trimInstanceProperty__default = /*#__PURE__*/_interopDefault(_trimInstanceProperty);
|
|
60
60
|
var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
61
61
|
|
|
62
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct__default[
|
|
62
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
63
63
|
|
|
64
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct__default[
|
|
64
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
65
65
|
|
|
66
66
|
var MissingOrInvalidConfigError = /*#__PURE__*/function (_Error) {
|
|
67
67
|
_inherits(MissingOrInvalidConfigError, _Error);
|
|
@@ -75,7 +75,7 @@ var MissingOrInvalidConfigError = /*#__PURE__*/function (_Error) {
|
|
|
75
75
|
|
|
76
76
|
_this = _super.call(this, message);
|
|
77
77
|
|
|
78
|
-
_Object$defineProperty__default[
|
|
78
|
+
_Object$defineProperty__default["default"](_assertThisInitialized(_this), 'name', {
|
|
79
79
|
value: 'MissingOrInvalidConfigError'
|
|
80
80
|
});
|
|
81
81
|
|
|
@@ -88,26 +88,26 @@ var MissingOrInvalidConfigError = /*#__PURE__*/function (_Error) {
|
|
|
88
88
|
// for instance in respect to both source files and dist files.
|
|
89
89
|
|
|
90
90
|
var findPackageRootPath = function findPackageRootPath(dir) {
|
|
91
|
-
var packageJsonPath = path__default[
|
|
91
|
+
var packageJsonPath = path__default["default"].join(dir, 'package.json');
|
|
92
92
|
|
|
93
|
-
if (fs__default[
|
|
93
|
+
if (fs__default["default"].existsSync(packageJsonPath)) {
|
|
94
94
|
return dir;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
var parentDir = path__default[
|
|
97
|
+
var parentDir = path__default["default"].join(dir, '..');
|
|
98
98
|
return findPackageRootPath(parentDir);
|
|
99
99
|
};
|
|
100
100
|
|
|
101
101
|
var loadJsModule = function loadJsModule(filePath) {
|
|
102
102
|
var packageRootPath = findPackageRootPath( // Start from the parent folder
|
|
103
|
-
path__default[
|
|
103
|
+
path__default["default"].join(__dirname, '..')); // Load the JS module using a child process. This is primarly to avoid
|
|
104
104
|
// unwanted behaviors using `@babel/register` in the main process.
|
|
105
105
|
// The loader script does the actual `require` of the given `filePath`
|
|
106
106
|
// and uses `@babel/register` to correctly parse and execute the file.
|
|
107
107
|
// The "required module output" is then written into `stdout` and parsed
|
|
108
108
|
// as JSON.
|
|
109
109
|
|
|
110
|
-
var output = child_process.execFileSync(path__default[
|
|
110
|
+
var output = child_process.execFileSync(path__default["default"].join(packageRootPath, 'scripts/load-js-module.js'), [filePath], {
|
|
111
111
|
encoding: 'utf8'
|
|
112
112
|
});
|
|
113
113
|
return JSON.parse(output);
|
|
@@ -287,6 +287,9 @@ var schemaJson = {
|
|
|
287
287
|
},
|
|
288
288
|
"style-src": {
|
|
289
289
|
$ref: "#/definitions/cspDirective"
|
|
290
|
+
},
|
|
291
|
+
"frame-src": {
|
|
292
|
+
$ref: "#/definitions/cspDirective"
|
|
290
293
|
}
|
|
291
294
|
},
|
|
292
295
|
additionalProperties: false,
|
|
@@ -324,7 +327,7 @@ var schemaJson = {
|
|
|
324
327
|
type: "object",
|
|
325
328
|
properties: {
|
|
326
329
|
icon: {
|
|
327
|
-
description: "The SVG icon that represents this application. Pass the raw SVG string or a path to an SVG file, for example a relative path `${path:./app.svg}`, or a path from a module `${path:@commercetools-frontend/assets/application-icons/
|
|
330
|
+
description: "The SVG icon that represents this application. Pass the raw SVG string or a path to an SVG file, for example a relative path `${path:./app.svg}`, or a path from a module `${path:@commercetools-frontend/assets/application-icons/Rocket.svg}`.",
|
|
328
331
|
type: "string"
|
|
329
332
|
},
|
|
330
333
|
defaultLabel: {
|
|
@@ -457,7 +460,7 @@ var schemaJson = {
|
|
|
457
460
|
]
|
|
458
461
|
};
|
|
459
462
|
|
|
460
|
-
var ajv = new Ajv__default[
|
|
463
|
+
var ajv = new Ajv__default["default"]({
|
|
461
464
|
strict: true,
|
|
462
465
|
useDefaults: true
|
|
463
466
|
});
|
|
@@ -468,17 +471,17 @@ var printErrors = function printErrors(errors) {
|
|
|
468
471
|
return 'No errors';
|
|
469
472
|
}
|
|
470
473
|
|
|
471
|
-
return _mapInstanceProperty__default[
|
|
474
|
+
return _mapInstanceProperty__default["default"](errors).call(errors, function (error) {
|
|
472
475
|
var _context, _context2, _context3;
|
|
473
476
|
|
|
474
|
-
var baseMessage = _concatInstanceProperty__default[
|
|
477
|
+
var baseMessage = _concatInstanceProperty__default["default"](_context = "".concat(error.instancePath, " ")).call(_context, error.message);
|
|
475
478
|
|
|
476
479
|
switch (error.keyword) {
|
|
477
480
|
case 'additionalProperties':
|
|
478
|
-
return _concatInstanceProperty__default[
|
|
481
|
+
return _concatInstanceProperty__default["default"](_context2 = "".concat(baseMessage, ": ")).call(_context2, error.params.additionalProperty);
|
|
479
482
|
|
|
480
483
|
case 'enum':
|
|
481
|
-
return _concatInstanceProperty__default[
|
|
484
|
+
return _concatInstanceProperty__default["default"](_context3 = "".concat(baseMessage, ": ")).call(_context3, error.params.allowedValues.toString());
|
|
482
485
|
|
|
483
486
|
default:
|
|
484
487
|
return baseMessage;
|
|
@@ -531,7 +534,7 @@ var mapCloudIdentifierToApiUrl = function mapCloudIdentifierToApiUrl(key) {
|
|
|
531
534
|
default:
|
|
532
535
|
// We would probably never get to this point, as the JSON schema validation
|
|
533
536
|
// kicks in before.
|
|
534
|
-
throw new Error(_concatInstanceProperty__default[
|
|
537
|
+
throw new Error(_concatInstanceProperty__default["default"](_context = "Unknown cloud identifier \"".concat(key, "\". Supported values: ")).call(_context, _Object$values__default["default"](CLOUD_IDENTIFIERS).toString()));
|
|
535
538
|
}
|
|
536
539
|
};
|
|
537
540
|
|
|
@@ -540,7 +543,7 @@ var getUniqueValues = function getUniqueValues() {
|
|
|
540
543
|
|
|
541
544
|
var initialValues = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
542
545
|
var additionalValues = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
543
|
-
return uniq__default[
|
|
546
|
+
return uniq__default["default"](_concatInstanceProperty__default["default"](_context2 = []).call(_context2, _toConsumableArray(initialValues), _toConsumableArray(additionalValues)));
|
|
544
547
|
};
|
|
545
548
|
|
|
546
549
|
var nonProductionEnvironment = ['development', 'test'];
|
|
@@ -550,7 +553,7 @@ var getIsProd = function getIsProd(env) {
|
|
|
550
553
|
// a production environment unless it's one of `development` or `test`.
|
|
551
554
|
// This allows to use for example the `staging` value, which from the
|
|
552
555
|
// application perspective is still considered a production environment.
|
|
553
|
-
env.MC_APP_ENV ? !_includesInstanceProperty__default[
|
|
556
|
+
env.MC_APP_ENV ? !_includesInstanceProperty__default["default"](nonProductionEnvironment).call(nonProductionEnvironment, env.MC_APP_ENV) : env.NODE_ENV === 'production'
|
|
554
557
|
);
|
|
555
558
|
};
|
|
556
559
|
|
|
@@ -567,7 +570,7 @@ var getOrThrow = function getOrThrow(fn, errorMessage) {
|
|
|
567
570
|
* Allows variable placeholders. Supported types are:
|
|
568
571
|
* - `env`: For example `${env:MC_API_URL}`.
|
|
569
572
|
* - `intl`: For example `${intl:en:Menu.title}`.
|
|
570
|
-
* - `path`: For example `${path:./app.svg}`, or `${path:@commercetools-frontend/assets/application-icons/
|
|
573
|
+
* - `path`: For example `${path:./app.svg}`, or `${path:@commercetools-frontend/assets/application-icons/Rocket.svg}`.
|
|
571
574
|
*/
|
|
572
575
|
var variableSyntax = /\${([ ~:\w.'",\-/()@]+?)}/g;
|
|
573
576
|
var envRefSyntax = /^env:/g;
|
|
@@ -605,7 +608,7 @@ var substituteEnvVariablePlaceholder = function substituteEnvVariablePlaceholder
|
|
|
605
608
|
if (!hasEnvField) {
|
|
606
609
|
var _context;
|
|
607
610
|
|
|
608
|
-
throw new Error(_concatInstanceProperty__default[
|
|
611
|
+
throw new Error(_concatInstanceProperty__default["default"](_context = "Missing environment variable '".concat(requestedEnvVar, "' specified in config as 'env:")).call(_context, requestedEnvVar, "'."));
|
|
609
612
|
}
|
|
610
613
|
|
|
611
614
|
var escapedMatchedString = matchedString.replace(/[${}:]/g, '\\$&');
|
|
@@ -629,7 +632,7 @@ var substituteIntlVariablePlaceholder = function substituteIntlVariablePlacehold
|
|
|
629
632
|
if (!hasIntlMessage) {
|
|
630
633
|
var _context2, _context3;
|
|
631
634
|
|
|
632
|
-
throw new Error(_concatInstanceProperty__default[
|
|
635
|
+
throw new Error(_concatInstanceProperty__default["default"](_context2 = _concatInstanceProperty__default["default"](_context3 = "Missing message key '".concat(requestedIntlMessageId, "' specified in config as 'intl:")).call(_context3, locale, ":")).call(_context2, requestedIntlMessageId, "'."));
|
|
633
636
|
}
|
|
634
637
|
|
|
635
638
|
var escapedMatchedString = matchedString.replace(/[${}:]/g, '\\$&');
|
|
@@ -641,7 +644,7 @@ var substituteFilePathVariablePlaceholder = function substituteFilePathVariableP
|
|
|
641
644
|
_valueOfPlaceholder$s6 = _slicedToArray(_valueOfPlaceholder$s5, 2),
|
|
642
645
|
filePathOrModule = _valueOfPlaceholder$s6[1];
|
|
643
646
|
|
|
644
|
-
var content = fs__default[
|
|
647
|
+
var content = fs__default["default"].readFileSync(require.resolve(filePathOrModule, {
|
|
645
648
|
// Relative paths should be resolved from the application folder.
|
|
646
649
|
paths: [meta.applicationPath]
|
|
647
650
|
}), {
|
|
@@ -653,12 +656,12 @@ var substituteFilePathVariablePlaceholder = function substituteFilePathVariableP
|
|
|
653
656
|
|
|
654
657
|
var getValueOfPlaceholder = function getValueOfPlaceholder(valueWithPlaceholder) {
|
|
655
658
|
return valueWithPlaceholder.replace(variableSyntax, function (_match, varName) {
|
|
656
|
-
return _trimInstanceProperty__default[
|
|
659
|
+
return _trimInstanceProperty__default["default"](varName).call(varName);
|
|
657
660
|
}).replace(/\s/g, '');
|
|
658
661
|
};
|
|
659
662
|
|
|
660
663
|
var substituteVariablePlaceholders = function substituteVariablePlaceholders(config, meta) {
|
|
661
|
-
return JSON.parse(_JSON$stringify__default[
|
|
664
|
+
return JSON.parse(_JSON$stringify__default["default"](config), function (_key, value) {
|
|
662
665
|
// Only strings are allowed
|
|
663
666
|
var substitutedValue = value;
|
|
664
667
|
|
|
@@ -666,7 +669,7 @@ var substituteVariablePlaceholders = function substituteVariablePlaceholders(con
|
|
|
666
669
|
var matchResult = substitutedValue.match(variableSyntax);
|
|
667
670
|
|
|
668
671
|
if (matchResult) {
|
|
669
|
-
_forEachInstanceProperty__default[
|
|
672
|
+
_forEachInstanceProperty__default["default"](matchResult).call(matchResult, function (matchedString) {
|
|
670
673
|
var valueOfPlaceholder = getValueOfPlaceholder(matchedString);
|
|
671
674
|
|
|
672
675
|
if (isEnvVariablePlaceholder(valueOfPlaceholder)) {
|
|
@@ -684,9 +687,9 @@ var substituteVariablePlaceholders = function substituteVariablePlaceholders(con
|
|
|
684
687
|
});
|
|
685
688
|
};
|
|
686
689
|
|
|
687
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default[
|
|
690
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); if (enumerableOnly) { symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
688
691
|
|
|
689
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context3; _forEachInstanceProperty__default[
|
|
692
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context3; _forEachInstanceProperty__default["default"](_context3 = ownKeys(Object(source), true)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors__default["default"]) { _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)); } else { var _context4; _forEachInstanceProperty__default["default"](_context4 = ownKeys(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
|
|
690
693
|
// TODO: make it configurable.
|
|
691
694
|
var developmentPort = 3001;
|
|
692
695
|
var developmentAppUrl = "http://localhost:".concat(developmentPort);
|
|
@@ -710,7 +713,7 @@ var processConfig = function processConfig() {
|
|
|
710
713
|
_ref$processEnv = _ref.processEnv,
|
|
711
714
|
processEnv = _ref$processEnv === void 0 ? process.env : _ref$processEnv,
|
|
712
715
|
_ref$applicationPath = _ref.applicationPath,
|
|
713
|
-
applicationPath = _ref$applicationPath === void 0 ? fs__default[
|
|
716
|
+
applicationPath = _ref$applicationPath === void 0 ? fs__default["default"].realpathSync(process.cwd()) : _ref$applicationPath;
|
|
714
717
|
|
|
715
718
|
if (cachedConfig && !disableCache) return cachedConfig;
|
|
716
719
|
var appEnvKey = (_ref2 = (_processEnv$MC_APP_EN = processEnv.MC_APP_ENV) !== null && _processEnv$MC_APP_EN !== void 0 ? _processEnv$MC_APP_EN : processEnv.NODE_ENV) !== null && _ref2 !== void 0 ? _ref2 : 'development';
|
|
@@ -729,15 +732,15 @@ var processConfig = function processConfig() {
|
|
|
729
732
|
|
|
730
733
|
var envAppUrl = isProd ? appConfig.env.production.url : developmentAppUrl;
|
|
731
734
|
var appUrl = getOrThrow(function () {
|
|
732
|
-
return new _URL__default[
|
|
735
|
+
return new _URL__default["default"](envAppUrl);
|
|
733
736
|
}, "Invalid application URL: \"".concat(envAppUrl, "\"")); // Use `||` instead of `??` to include empty string values.
|
|
734
737
|
|
|
735
738
|
var envCdnUrl = isProd ? appConfig.env.production.cdnUrl || appUrl.href : developmentAppUrl;
|
|
736
739
|
var cdnUrl = getOrThrow(function () {
|
|
737
|
-
return new _URL__default[
|
|
740
|
+
return new _URL__default["default"](envCdnUrl);
|
|
738
741
|
}, "Invalid application CDN URL: \"".concat(envCdnUrl, "\""));
|
|
739
742
|
var mcApiUrl = getOrThrow(function () {
|
|
740
|
-
return new _URL__default[
|
|
743
|
+
return new _URL__default["default"]( // Use `||` instead of `??` to include empty string values.
|
|
741
744
|
appConfig.mcApiUrl || mapCloudIdentifierToApiUrl(appConfig.cloudIdentifier));
|
|
742
745
|
}, "Invalid MC API URL: \"".concat(appConfig.mcApiUrl, "\"")); // The real application ID is only used in production.
|
|
743
746
|
// In development, we prefix the entry point with the "__local" prefix.
|
|
@@ -751,7 +754,7 @@ var processConfig = function processConfig() {
|
|
|
751
754
|
if (appConfig.env.production.applicationId) {
|
|
752
755
|
var _context;
|
|
753
756
|
|
|
754
|
-
applicationId = _concatInstanceProperty__default[
|
|
757
|
+
applicationId = _concatInstanceProperty__default["default"](_context = "".concat(appConfig.env.production.applicationId, ":")).call(_context, appConfig.entryPointUriPath);
|
|
755
758
|
} else {
|
|
756
759
|
// As long as we don't require the application ID in production, we should
|
|
757
760
|
// fall back to unset the value.
|
|
@@ -760,7 +763,7 @@ var processConfig = function processConfig() {
|
|
|
760
763
|
}
|
|
761
764
|
|
|
762
765
|
var developmentConfig = isProd ? undefined : omitDevConfigIfEmpty({
|
|
763
|
-
oidc: isOidcForDevelopmentEnabled ? omitEmpty__default[
|
|
766
|
+
oidc: isOidcForDevelopmentEnabled ? omitEmpty__default["default"]({
|
|
764
767
|
authorizeUrl: [// In case the MC API url points to localhost, we need to point
|
|
765
768
|
// to a local running dev login page to handle the workflow properly.
|
|
766
769
|
mcApiUrl.hostname === 'localhost' ? mcApiUrl.origin.replace(mcApiUrl.port, String(developmentPort)) : mcApiUrl.origin.replace('mc-api', 'mc'), '/login/authorize'].join(''),
|
|
@@ -773,7 +776,7 @@ var processConfig = function processConfig() {
|
|
|
773
776
|
accountLinks: appConfig.accountLinks
|
|
774
777
|
});
|
|
775
778
|
cachedConfig = {
|
|
776
|
-
env: _objectSpread(_objectSpread(_objectSpread({}, omitEmpty__default[
|
|
779
|
+
env: _objectSpread(_objectSpread(_objectSpread({}, omitEmpty__default["default"](additionalAppEnv)), {}, {
|
|
777
780
|
// TODO: how else should we provide the app identifier?
|
|
778
781
|
applicationId: applicationId,
|
|
779
782
|
applicationName: appConfig.name,
|
|
@@ -791,7 +794,7 @@ var processConfig = function processConfig() {
|
|
|
791
794
|
}),
|
|
792
795
|
headers: _objectSpread(_objectSpread({}, appConfig.headers), {}, {
|
|
793
796
|
csp: _objectSpread(_objectSpread({}, (_appConfig$headers = appConfig.headers) === null || _appConfig$headers === void 0 ? void 0 : _appConfig$headers.csp), {}, {
|
|
794
|
-
'connect-src': getUniqueValues((_appConfig$headers2 = appConfig.headers) === null || _appConfig$headers2 === void 0 ? void 0 : _appConfig$headers2.csp['connect-src'], _concatInstanceProperty__default[
|
|
797
|
+
'connect-src': getUniqueValues((_appConfig$headers2 = appConfig.headers) === null || _appConfig$headers2 === void 0 ? void 0 : _appConfig$headers2.csp['connect-src'], _concatInstanceProperty__default["default"](_context2 = [mcApiUrl.origin]).call(_context2, isProd ? [appUrl.href] : [])),
|
|
795
798
|
'script-src': getUniqueValues((_appConfig$headers3 = appConfig.headers) === null || _appConfig$headers3 === void 0 ? void 0 : _appConfig$headers3.csp['script-src'], isProd ? [appUrl.href, cdnUrl.href] : []),
|
|
796
799
|
'style-src': getUniqueValues((_appConfig$headers4 = appConfig.headers) === null || _appConfig$headers4 === void 0 ? void 0 : _appConfig$headers4.csp['style-src'], isProd ? [appUrl.href, cdnUrl.href] : [])
|
|
797
800
|
})
|
|
@@ -259,6 +259,9 @@ var schemaJson = {
|
|
|
259
259
|
},
|
|
260
260
|
"style-src": {
|
|
261
261
|
$ref: "#/definitions/cspDirective"
|
|
262
|
+
},
|
|
263
|
+
"frame-src": {
|
|
264
|
+
$ref: "#/definitions/cspDirective"
|
|
262
265
|
}
|
|
263
266
|
},
|
|
264
267
|
additionalProperties: false,
|
|
@@ -296,7 +299,7 @@ var schemaJson = {
|
|
|
296
299
|
type: "object",
|
|
297
300
|
properties: {
|
|
298
301
|
icon: {
|
|
299
|
-
description: "The SVG icon that represents this application. Pass the raw SVG string or a path to an SVG file, for example a relative path `${path:./app.svg}`, or a path from a module `${path:@commercetools-frontend/assets/application-icons/
|
|
302
|
+
description: "The SVG icon that represents this application. Pass the raw SVG string or a path to an SVG file, for example a relative path `${path:./app.svg}`, or a path from a module `${path:@commercetools-frontend/assets/application-icons/Rocket.svg}`.",
|
|
300
303
|
type: "string"
|
|
301
304
|
},
|
|
302
305
|
defaultLabel: {
|
|
@@ -539,7 +542,7 @@ var getOrThrow = function getOrThrow(fn, errorMessage) {
|
|
|
539
542
|
* Allows variable placeholders. Supported types are:
|
|
540
543
|
* - `env`: For example `${env:MC_API_URL}`.
|
|
541
544
|
* - `intl`: For example `${intl:en:Menu.title}`.
|
|
542
|
-
* - `path`: For example `${path:./app.svg}`, or `${path:@commercetools-frontend/assets/application-icons/
|
|
545
|
+
* - `path`: For example `${path:./app.svg}`, or `${path:@commercetools-frontend/assets/application-icons/Rocket.svg}`.
|
|
543
546
|
*/
|
|
544
547
|
var variableSyntax = /\${([ ~:\w.'",\-/()@]+?)}/g;
|
|
545
548
|
var envRefSyntax = /^env:/g;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="webpack-env" />
|
|
3
1
|
import { CLOUD_IDENTIFIERS } from './constants';
|
|
4
2
|
declare const mapCloudIdentifierToApiUrl: (key: typeof CLOUD_IDENTIFIERS[keyof typeof CLOUD_IDENTIFIERS]) => string;
|
|
5
3
|
declare const getUniqueValues: (initialValues?: string[], additionalValues?: string[]) => string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/application-config",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.12.1",
|
|
4
4
|
"description": "Configuration utilities for building Custom Applications",
|
|
5
5
|
"bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
6
6
|
"repository": {
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
"homepage": "https://docs.commercetools.com/custom-applications",
|
|
12
12
|
"keywords": ["javascript", "frontend", "react", "toolkit", "config"],
|
|
13
13
|
"license": "MIT",
|
|
14
|
-
"private": false,
|
|
15
14
|
"publishConfig": {
|
|
16
15
|
"access": "public"
|
|
17
16
|
},
|
|
@@ -26,17 +25,15 @@
|
|
|
26
25
|
"README.md"
|
|
27
26
|
],
|
|
28
27
|
"scripts": {
|
|
29
|
-
"prepare": "./../../scripts/version.js replace",
|
|
30
|
-
"prebuild": "yarn build:schema",
|
|
31
28
|
"build:schema": "json2ts schema.json src/schema.ts --style.singleQuote --bannerComment '/* eslint-disable prettier/prettier */\n// This file was automatically generated by json-schema-to-typescript.\n// DO NOT MODIFY IT BY HAND. Instead, modify the source schema.json file.'"
|
|
32
29
|
},
|
|
33
30
|
"dependencies": {
|
|
34
|
-
"@babel/register": "7.
|
|
35
|
-
"@babel/runtime": "7.
|
|
36
|
-
"@babel/runtime-corejs3": "7.
|
|
37
|
-
"@commercetools-frontend/babel-preset-mc-app": "20.
|
|
38
|
-
"ajv": "8.
|
|
39
|
-
"core-js": "3.19.
|
|
31
|
+
"@babel/register": "7.16.0",
|
|
32
|
+
"@babel/runtime": "7.16.3",
|
|
33
|
+
"@babel/runtime-corejs3": "7.16.3",
|
|
34
|
+
"@commercetools-frontend/babel-preset-mc-app": "20.12.1",
|
|
35
|
+
"ajv": "8.8.2",
|
|
36
|
+
"core-js": "3.19.3",
|
|
40
37
|
"cosmiconfig": "7.0.1",
|
|
41
38
|
"lodash": "4.17.21",
|
|
42
39
|
"omit-empty-es": "1.1.3"
|
package/schema.json
CHANGED
|
@@ -136,6 +136,9 @@
|
|
|
136
136
|
},
|
|
137
137
|
"style-src": {
|
|
138
138
|
"$ref": "#/definitions/cspDirective"
|
|
139
|
+
},
|
|
140
|
+
"frame-src": {
|
|
141
|
+
"$ref": "#/definitions/cspDirective"
|
|
139
142
|
}
|
|
140
143
|
},
|
|
141
144
|
"additionalProperties": false,
|
|
@@ -166,7 +169,7 @@
|
|
|
166
169
|
"type": "object",
|
|
167
170
|
"properties": {
|
|
168
171
|
"icon": {
|
|
169
|
-
"description": "The SVG icon that represents this application. Pass the raw SVG string or a path to an SVG file, for example a relative path `${path:./app.svg}`, or a path from a module `${path:@commercetools-frontend/assets/application-icons/
|
|
172
|
+
"description": "The SVG icon that represents this application. Pass the raw SVG string or a path to an SVG file, for example a relative path `${path:./app.svg}`, or a path from a module `${path:@commercetools-frontend/assets/application-icons/Rocket.svg}`.",
|
|
170
173
|
"type": "string"
|
|
171
174
|
},
|
|
172
175
|
"defaultLabel": {
|