@commercetools-frontend/application-config 22.36.0 → 22.38.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.
@@ -14,12 +14,16 @@ var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
14
14
  var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
15
15
  var _URL = require('@babel/runtime-corejs3/core-js-stable/url');
16
16
  var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
17
- var fs = require('node:fs');
17
+ var fs$1 = require('node:fs');
18
18
  var path = require('node:path');
19
19
  var omitEmpty = require('omit-empty-es');
20
20
  var constants = require('@commercetools-frontend/constants');
21
- var node_child_process = require('node:child_process');
21
+ var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
22
+ var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
23
+ var _parseInt = require('@babel/runtime-corejs3/core-js-stable/parse-int');
24
+ var fs = require('node:fs/promises');
22
25
  var cosmiconfig = require('cosmiconfig');
26
+ var cosmiconfigTypescriptLoader = require('cosmiconfig-typescript-loader');
23
27
  var _Reflect$construct = require('@babel/runtime-corejs3/core-js-stable/reflect/construct');
24
28
  var _createClass = require('@babel/runtime-corejs3/helpers/createClass');
25
29
  var _classCallCheck = require('@babel/runtime-corejs3/helpers/classCallCheck');
@@ -28,12 +32,10 @@ var _inherits = require('@babel/runtime-corejs3/helpers/inherits');
28
32
  var _possibleConstructorReturn = require('@babel/runtime-corejs3/helpers/possibleConstructorReturn');
29
33
  var _getPrototypeOf = require('@babel/runtime-corejs3/helpers/getPrototypeOf');
30
34
  var _wrapNativeSuper = require('@babel/runtime-corejs3/helpers/wrapNativeSuper');
31
- var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
32
35
  var _trimInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/trim');
33
36
  var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
34
37
  var _startsWithInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/starts-with');
35
38
  var _reduceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
36
- var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
37
39
  var formatters = require('./formatters-7f327585.cjs.prod.js');
38
40
  var _Set = require('@babel/runtime-corejs3/core-js-stable/set');
39
41
  var _Array$isArray = require('@babel/runtime-corejs3/core-js-stable/array/is-array');
@@ -58,15 +60,17 @@ var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defin
58
60
  var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
59
61
  var _URL__default = /*#__PURE__*/_interopDefault(_URL);
60
62
  var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
61
- var fs__default = /*#__PURE__*/_interopDefault(fs);
63
+ var fs__default$1 = /*#__PURE__*/_interopDefault(fs$1);
62
64
  var path__default = /*#__PURE__*/_interopDefault(path);
63
65
  var omitEmpty__default = /*#__PURE__*/_interopDefault(omitEmpty);
66
+ var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
67
+ var _parseInt__default = /*#__PURE__*/_interopDefault(_parseInt);
68
+ var fs__default = /*#__PURE__*/_interopDefault(fs);
64
69
  var _Reflect$construct__default = /*#__PURE__*/_interopDefault(_Reflect$construct);
65
70
  var _trimInstanceProperty__default = /*#__PURE__*/_interopDefault(_trimInstanceProperty);
66
71
  var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
67
72
  var _startsWithInstanceProperty__default = /*#__PURE__*/_interopDefault(_startsWithInstanceProperty);
68
73
  var _reduceInstanceProperty__default = /*#__PURE__*/_interopDefault(_reduceInstanceProperty);
69
- var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
70
74
  var _Set__default = /*#__PURE__*/_interopDefault(_Set);
71
75
  var _Array$isArray__default = /*#__PURE__*/_interopDefault(_Array$isArray);
72
76
  var Ajv__default = /*#__PURE__*/_interopDefault(Ajv);
@@ -126,65 +130,71 @@ let MissingOrInvalidConfigError = /*#__PURE__*/function (_Error) {
126
130
  return _createClass(MissingOrInvalidConfigError);
127
131
  }( /*#__PURE__*/_wrapNativeSuper(Error));
128
132
 
129
- function doesFileExist(path) {
133
+ // See the following issues for more context, contributing to failing Jest tests:
134
+ // - Issue: https://github.com/nodejs/node/issues/40058
135
+ // - Resolution: https://github.com/nodejs/node/pull/48510 (Node v20.8.0)
136
+ // Copied from @commitlint/load/src/utils/load-config.ts
137
+ const isDynamicAwaitSupported = () => {
138
+ var _context;
139
+ const _process$version$repl = _mapInstanceProperty__default["default"](_context = process.version.replace('v', '').split('.')).call(_context, val => _parseInt__default["default"](val)),
140
+ _process$version$repl2 = _slicedToArray(_process$version$repl, 2),
141
+ major = _process$version$repl2[0],
142
+ minor = _process$version$repl2[1];
143
+ return major >= 20 && minor >= 8;
144
+ };
145
+
146
+ // Is the given directory set up to use ESM (ECMAScript Modules)?
147
+ // Copied from @commitlint/load/src/utils/load-config.ts
148
+ const isEsmModule = async cwd => {
149
+ const packagePath = path__default["default"].join(cwd, 'package.json');
130
150
  try {
131
- fs__default["default"].accessSync(path);
132
- return true;
151
+ const packageJSON = await fs__default["default"].readFile(packagePath, {
152
+ encoding: 'utf-8'
153
+ });
154
+ return JSON.parse(packageJSON)?.type === 'module';
133
155
  } catch (error) {
134
156
  return false;
135
157
  }
136
- }
137
- // Helper function to find the package root path from the current location,
138
- // for instance in respect to both source files and dist files.
139
- const findPackageRootPath = dir => {
140
- const packageJsonPath = path__default["default"].join(dir, 'package.json');
141
- if (doesFileExist(packageJsonPath)) {
142
- return dir;
143
- }
144
- const parentDir = path__default["default"].join(dir, '..');
145
- return findPackageRootPath(parentDir);
146
- };
147
- const loadJsModule = filePath => {
148
- const packageRootPath = findPackageRootPath(
149
- // Start from the parent folder
150
- path__default["default"].join(__dirname, '..'));
151
- // Load the JS module using a child process. This is primarly to avoid
152
- // unwanted behaviors using `@babel/register` in the main process.
153
- // The loader script does the actual `require` of the given `filePath`
154
- // and uses `@babel/register` to correctly parse and execute the file.
155
- // The "required module output" is then written into `stdout` and parsed
156
- // as JSON.
157
- const output = node_child_process.execFileSync('node', [path__default["default"].join(packageRootPath, 'scripts/load-js-module.js'), filePath], {
158
- encoding: 'utf8'
159
- });
160
- return JSON.parse(output);
161
158
  };
162
- const createExplorerFor = configFileName => {
163
- return cosmiconfig.cosmiconfigSync(configFileName, {
164
- // Restrict the supported file formats / names
165
- searchPlaces: [`.${configFileName}rc`, `.${configFileName}.json`, `.${configFileName}.js`, `.${configFileName}.cjs`, `.${configFileName}.mjs`, `.${configFileName}.ts`, `${configFileName}.json`, `${configFileName}.js`, `${configFileName}.cjs`, `${configFileName}.mjs`, `${configFileName}.ts`],
159
+ const createExplorerFor = async configFileName => {
160
+ // Copied from @commitlint/load/src/utils/load-config.ts
161
+ let tsLoaderInstance;
162
+ const tsLoader = function () {
163
+ if (!tsLoaderInstance) {
164
+ tsLoaderInstance = cosmiconfigTypescriptLoader.TypeScriptLoader();
165
+ }
166
+ return tsLoaderInstance(...arguments);
167
+ };
168
+
169
+ // If dynamic await is supported (Node >= v20.8.0) or directory uses ESM, support
170
+ // async js/cjs loaders (dynamic import). Otherwise, use synchronous js/cjs loaders.
171
+ const loaders = isDynamicAwaitSupported() || (await isEsmModule(process.cwd())) ? cosmiconfig.defaultLoaders : cosmiconfig.defaultLoadersSync;
172
+ return cosmiconfig.cosmiconfig(configFileName, {
173
+ searchStrategy: 'project',
174
+ searchPlaces: [`${configFileName}.js`, `${configFileName}.cjs`, `${configFileName}.mjs`, `${configFileName}.ts`],
166
175
  loaders: {
167
- noExt: cosmiconfig.defaultLoaders['.json'],
168
- '.js': loadJsModule,
169
- '.cjs': loadJsModule,
170
- '.mjs': loadJsModule,
171
- '.ts': loadJsModule
176
+ '.js': loaders['.js'],
177
+ '.cjs': loaders['.cjs'],
178
+ '.mjs': tsLoader,
179
+ '.ts': tsLoader
172
180
  }
173
181
  });
174
182
  };
175
- const customApplicationExplorer = createExplorerFor('custom-application-config');
176
- const customViewExplorer = createExplorerFor('custom-view-config');
177
- const getConfigPath = () => {
178
- const customApplicationConfigFile = customApplicationExplorer.search();
179
- const customViewConfigFile = customViewExplorer.search();
183
+ const getConfigPath = async () => {
184
+ const customApplicationExplorer = await createExplorerFor('custom-application-config');
185
+ const customViewExplorer = await createExplorerFor('custom-view-config');
186
+ const customApplicationConfigFile = await customApplicationExplorer.search();
187
+ const customViewConfigFile = await customViewExplorer.search();
180
188
  if (!customApplicationConfigFile && !customViewConfigFile) {
181
189
  throw new Error(`Missing or invalid configuration file.`);
182
190
  }
183
191
  return customApplicationConfigFile?.filepath || customViewConfigFile?.filepath;
184
192
  };
185
- const loadConfig = applicationPath => {
186
- const customApplicationConfigFile = customApplicationExplorer.search(applicationPath);
187
- const customViewConfigFile = customViewExplorer.search(applicationPath);
193
+ const loadConfig = async applicationPath => {
194
+ const customApplicationExplorer = await createExplorerFor('custom-application-config');
195
+ const customViewExplorer = await createExplorerFor('custom-view-config');
196
+ const customApplicationConfigFile = await customApplicationExplorer.search(applicationPath);
197
+ const customViewConfigFile = await customViewExplorer.search(applicationPath);
188
198
  if ((!customApplicationConfigFile || !customApplicationConfigFile.config) && (!customViewConfigFile || !customViewConfigFile.config)) {
189
199
  throw new MissingOrInvalidConfigError(`Missing or invalid configuration file.`);
190
200
  }
@@ -252,7 +262,7 @@ const substituteFilePathVariablePlaceholder = (valueOfPlaceholder, matchedString
252
262
  const _valueOfPlaceholder$s5 = valueOfPlaceholder.split(':'),
253
263
  _valueOfPlaceholder$s6 = _slicedToArray(_valueOfPlaceholder$s5, 2),
254
264
  filePathOrModule = _valueOfPlaceholder$s6[1];
255
- const content = fs__default["default"].readFileSync(require.resolve(filePathOrModule, {
265
+ const content = fs__default$1["default"].readFileSync(require.resolve(filePathOrModule, {
256
266
  // Relative paths should be resolved from the application folder.
257
267
  paths: [loadingOptions.applicationPath]
258
268
  }), {
@@ -299,31 +309,31 @@ var customApplicationSchemaJson = {
299
309
  },
300
310
  properties: {
301
311
  name: {
302
- description: "See https://docs.commercetools.com/merchant-center-customizations/api-reference/custom-application-config#name",
312
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#name",
303
313
  type: "string"
304
314
  },
305
315
  description: {
306
- description: "See https://docs.commercetools.com/merchant-center-customizations/api-reference/custom-application-config#description",
316
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#description",
307
317
  type: "string"
308
318
  },
309
319
  entryPointUriPath: {
310
- description: "See https://docs.commercetools.com/merchant-center-customizations/api-reference/custom-application-config#entrypointuripath",
320
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#entrypointuripath",
311
321
  type: "string"
312
322
  },
313
323
  cloudIdentifier: {
314
- description: "See https://docs.commercetools.com/merchant-center-customizations/api-reference/custom-application-config#cloudidentifier",
324
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#cloudidentifier",
315
325
  type: "string"
316
326
  },
317
327
  mcApiUrl: {
318
- description: "See https://docs.commercetools.com/merchant-center-customizations/api-reference/custom-application-config#mcapiurl",
328
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#mcapiurl",
319
329
  type: "string"
320
330
  },
321
331
  oAuthScopes: {
322
- description: "See https://docs.commercetools.com/merchant-center-customizations/api-reference/custom-application-config#oauthscopes",
332
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#oauthscopes",
323
333
  type: "object",
324
334
  properties: {
325
335
  view: {
326
- description: "See https://docs.commercetools.com/merchant-center-customizations/api-reference/custom-application-config#oauthscopesview",
336
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#oauthscopesview",
327
337
  type: "array",
328
338
  "default": [
329
339
  ],
@@ -334,7 +344,7 @@ var customApplicationSchemaJson = {
334
344
  uniqueItems: true
335
345
  },
336
346
  manage: {
337
- description: "See https://docs.commercetools.com/merchant-center-customizations/api-reference/custom-application-config#oauthscopesmanage",
347
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#oauthscopesmanage",
338
348
  type: "array",
339
349
  "default": [
340
350
  ],
@@ -352,7 +362,7 @@ var customApplicationSchemaJson = {
352
362
  ]
353
363
  },
354
364
  additionalOAuthScopes: {
355
- description: "See https://docs.commercetools.com/merchant-center-customizations/api-reference/custom-application-config#additionaloauthscopes",
365
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#additionaloauthscopes",
356
366
  type: "array",
357
367
  "default": [
358
368
  ],
@@ -361,11 +371,11 @@ var customApplicationSchemaJson = {
361
371
  type: "object",
362
372
  properties: {
363
373
  name: {
364
- description: "See https://docs.commercetools.com/merchant-center-customizations/api-reference/custom-application-config#additionaloauthscopesname",
374
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#additionaloauthscopesname",
365
375
  type: "string"
366
376
  },
367
377
  view: {
368
- description: "See https://docs.commercetools.com/merchant-center-customizations/api-reference/custom-application-config#additionaloauthscopesview",
378
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#additionaloauthscopesview",
369
379
  type: "array",
370
380
  "default": [
371
381
  ],
@@ -376,7 +386,7 @@ var customApplicationSchemaJson = {
376
386
  uniqueItems: true
377
387
  },
378
388
  manage: {
379
- description: "See https://docs.commercetools.com/merchant-center-customizations/api-reference/custom-application-config#additionaloauthscopesmanage",
389
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#additionaloauthscopesmanage",
380
390
  type: "array",
381
391
  "default": [
382
392
  ],
@@ -396,14 +406,14 @@ var customApplicationSchemaJson = {
396
406
  }
397
407
  },
398
408
  env: {
399
- description: "See https://docs.commercetools.com/merchant-center-customizations/api-reference/custom-application-config#env",
409
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#env",
400
410
  type: "object",
401
411
  properties: {
402
412
  development: {
403
413
  type: "object",
404
414
  properties: {
405
415
  initialProjectKey: {
406
- description: "See https://docs.commercetools.com/merchant-center-customizations/api-reference/custom-application-config#envdevelopmentinitialprojectkey",
416
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#envdevelopmentinitialprojectkey",
407
417
  type: "string"
408
418
  },
409
419
  teamId: {
@@ -419,15 +429,15 @@ var customApplicationSchemaJson = {
419
429
  type: "object",
420
430
  properties: {
421
431
  applicationId: {
422
- description: "See https://docs.commercetools.com/merchant-center-customizations/api-reference/custom-application-config#envproductionapplicationid",
432
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#envproductionapplicationid",
423
433
  type: "string"
424
434
  },
425
435
  url: {
426
- description: "See https://docs.commercetools.com/merchant-center-customizations/api-reference/custom-application-config#envproductionurl",
436
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#envproductionurl",
427
437
  type: "string"
428
438
  },
429
439
  cdnUrl: {
430
- description: "See https://docs.commercetools.com/merchant-center-customizations/api-reference/custom-application-config#envproductioncdnurl",
440
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#envproductioncdnurl",
431
441
  type: "string"
432
442
  }
433
443
  },
@@ -445,15 +455,15 @@ var customApplicationSchemaJson = {
445
455
  ]
446
456
  },
447
457
  additionalEnv: {
448
- description: "See https://docs.commercetools.com/merchant-center-customizations/api-reference/custom-application-config#additionalenv",
458
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#additionalenv",
449
459
  type: "object"
450
460
  },
451
461
  headers: {
452
- description: "See https://docs.commercetools.com/merchant-center-customizations/api-reference/custom-application-config#headers",
462
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#headers",
453
463
  type: "object",
454
464
  properties: {
455
465
  csp: {
456
- description: "See https://docs.commercetools.com/merchant-center-customizations/api-reference/custom-application-config#headerscsp",
466
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#headerscsp",
457
467
  type: "object",
458
468
  properties: {
459
469
  "connect-src": {
@@ -481,11 +491,10 @@ var customApplicationSchemaJson = {
481
491
  ]
482
492
  },
483
493
  permissionsPolicies: {
484
- description: "See https://docs.commercetools.com/merchant-center-customizations/api-reference/custom-application-config#headerspermissionspolicies",
494
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#headerspermissionspolicies",
485
495
  type: "object"
486
496
  },
487
497
  strictTransportSecurity: {
488
- description: "See https://docs.commercetools.com/merchant-center-customizations/api-reference/custom-application-config#headersstricttransportsecurity",
489
498
  type: "array",
490
499
  items: {
491
500
  "enum": [
@@ -493,25 +502,26 @@ var customApplicationSchemaJson = {
493
502
  "preload"
494
503
  ]
495
504
  },
496
- uniqueItems: true
505
+ uniqueItems: true,
506
+ deprecated: true
497
507
  }
498
508
  },
499
509
  additionalProperties: false
500
510
  },
501
511
  icon: {
502
- description: "See https://docs.commercetools.com/merchant-center-customizations/api-reference/custom-application-config#icon",
512
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#icon",
503
513
  type: "string"
504
514
  },
505
515
  mainMenuLink: {
506
- description: "See https://docs.commercetools.com/merchant-center-customizations/api-reference/custom-application-config#mainmenulink",
516
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#mainmenulink",
507
517
  type: "object",
508
518
  properties: {
509
519
  defaultLabel: {
510
- description: "See https://docs.commercetools.com/merchant-center-customizations/api-reference/custom-application-config#mainmenulinkdefaultlabel",
520
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#mainmenulinkdefaultlabel",
511
521
  type: "string"
512
522
  },
513
523
  labelAllLocales: {
514
- description: "See https://docs.commercetools.com/merchant-center-customizations/api-reference/custom-application-config#mainmenulinklabelalllocales",
524
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#mainmenulinklabelalllocales",
515
525
  type: "array",
516
526
  "default": [
517
527
  ],
@@ -540,7 +550,7 @@ var customApplicationSchemaJson = {
540
550
  }
541
551
  },
542
552
  permissions: {
543
- description: "See https://docs.commercetools.com/merchant-center-customizations/api-reference/custom-application-config#mainmenulinkpermissions",
553
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#mainmenulinkpermissions",
544
554
  type: "array",
545
555
  "default": [
546
556
  ],
@@ -557,7 +567,7 @@ var customApplicationSchemaJson = {
557
567
  ]
558
568
  },
559
569
  submenuLinks: {
560
- description: "See https://docs.commercetools.com/merchant-center-customizations/api-reference/custom-application-config#submenulinks",
570
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#submenulinks",
561
571
  "default": [
562
572
  ],
563
573
  type: "array",
@@ -565,15 +575,15 @@ var customApplicationSchemaJson = {
565
575
  type: "object",
566
576
  properties: {
567
577
  uriPath: {
568
- description: "See https://docs.commercetools.com/merchant-center-customizations/api-reference/custom-application-config#submenulinksuripath",
578
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#submenulinksuripath",
569
579
  type: "string"
570
580
  },
571
581
  defaultLabel: {
572
- description: "See https://docs.commercetools.com/merchant-center-customizations/api-reference/custom-application-config#submenulinksdefaultlabel",
582
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#submenulinksdefaultlabel",
573
583
  type: "string"
574
584
  },
575
585
  labelAllLocales: {
576
- description: "See https://docs.commercetools.com/merchant-center-customizations/api-reference/custom-application-config#submenulinkslabelalllocales",
586
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#submenulinkslabelalllocales",
577
587
  type: "array",
578
588
  "default": [
579
589
  ],
@@ -602,7 +612,7 @@ var customApplicationSchemaJson = {
602
612
  }
603
613
  },
604
614
  permissions: {
605
- description: "See https://docs.commercetools.com/merchant-center-customizations/api-reference/custom-application-config#submenulinkspermissions",
615
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-application-config#submenulinkspermissions",
606
616
  type: "array",
607
617
  "default": [
608
618
  ],
@@ -650,27 +660,27 @@ var customViewSchemaJson = {
650
660
  },
651
661
  properties: {
652
662
  name: {
653
- description: "See https://docs.commercetools.com/TODO",
663
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#name",
654
664
  type: "string"
655
665
  },
656
666
  description: {
657
- description: "See https://docs.commercetools.com/TODO",
667
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#description",
658
668
  type: "string"
659
669
  },
660
670
  cloudIdentifier: {
661
- description: "See https://docs.commercetools.com/TODO",
671
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#cloudidentifier",
662
672
  type: "string"
663
673
  },
664
674
  mcApiUrl: {
665
- description: "See https://docs.commercetools.com/TODO",
675
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#mcapiurl",
666
676
  type: "string"
667
677
  },
668
678
  oAuthScopes: {
669
- description: "See https://docs.commercetools.com/TODO",
679
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#oauthscopes",
670
680
  type: "object",
671
681
  properties: {
672
682
  view: {
673
- description: "See https://docs.commercetools.com/TODO",
683
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#oauthscopesview",
674
684
  type: "array",
675
685
  "default": [
676
686
  ],
@@ -681,7 +691,7 @@ var customViewSchemaJson = {
681
691
  uniqueItems: true
682
692
  },
683
693
  manage: {
684
- description: "See https://docs.commercetools.com/TODO",
694
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#oauthscopesmanage",
685
695
  type: "array",
686
696
  "default": [
687
697
  ],
@@ -699,7 +709,7 @@ var customViewSchemaJson = {
699
709
  ]
700
710
  },
701
711
  additionalOAuthScopes: {
702
- description: "See https://docs.commercetools.com/TODO",
712
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#additionaloauthscopes",
703
713
  type: "array",
704
714
  "default": [
705
715
  ],
@@ -708,11 +718,11 @@ var customViewSchemaJson = {
708
718
  type: "object",
709
719
  properties: {
710
720
  name: {
711
- description: "See https://docs.commercetools.com/TODO",
721
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#additionaloauthscopesname",
712
722
  type: "string"
713
723
  },
714
724
  view: {
715
- description: "See https://docs.commercetools.com/TODO",
725
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#additionaloauthscopesview",
716
726
  type: "array",
717
727
  "default": [
718
728
  ],
@@ -723,7 +733,7 @@ var customViewSchemaJson = {
723
733
  uniqueItems: true
724
734
  },
725
735
  manage: {
726
- description: "See https://docs.commercetools.com/TODO",
736
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#additionaloauthscopesmanage",
727
737
  type: "array",
728
738
  "default": [
729
739
  ],
@@ -743,21 +753,21 @@ var customViewSchemaJson = {
743
753
  }
744
754
  },
745
755
  env: {
746
- description: "See https://docs.commercetools.com/TODO",
756
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#env",
747
757
  type: "object",
748
758
  properties: {
749
759
  development: {
750
760
  type: "object",
751
761
  properties: {
752
762
  initialProjectKey: {
753
- description: "See https://docs.commercetools.com/TODO",
763
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#envdevelopmentinitialprojectkey",
754
764
  type: "string"
755
765
  },
756
766
  teamId: {
757
767
  type: "string"
758
768
  },
759
769
  hostUriPath: {
760
- description: "See https://docs.commercetools.com/TODO",
770
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#envdevelopmenthosturipath",
761
771
  type: "string"
762
772
  }
763
773
  },
@@ -770,15 +780,15 @@ var customViewSchemaJson = {
770
780
  type: "object",
771
781
  properties: {
772
782
  customViewId: {
773
- description: "See https://docs.commercetools.com/TODO",
783
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#envproductioncustomviewid",
774
784
  type: "string"
775
785
  },
776
786
  url: {
777
- description: "See https://docs.commercetools.com/TODO",
787
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#envproductionurl",
778
788
  type: "string"
779
789
  },
780
790
  cdnUrl: {
781
- description: "See https://docs.commercetools.com/TODO",
791
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#envproductioncdnurl",
782
792
  type: "string"
783
793
  }
784
794
  },
@@ -796,15 +806,15 @@ var customViewSchemaJson = {
796
806
  ]
797
807
  },
798
808
  additionalEnv: {
799
- description: "See https://docs.commercetools.com/TODO",
809
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#additionalenv",
800
810
  type: "object"
801
811
  },
802
812
  headers: {
803
- description: "See https://docs.commercetools.com/TODO",
813
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#headers",
804
814
  type: "object",
805
815
  properties: {
806
816
  csp: {
807
- description: "See https://docs.commercetools.com/TODO",
817
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#headerscsp",
808
818
  type: "object",
809
819
  properties: {
810
820
  "connect-src": {
@@ -832,11 +842,10 @@ var customViewSchemaJson = {
832
842
  ]
833
843
  },
834
844
  permissionsPolicies: {
835
- description: "See https://docs.commercetools.com/TODO",
845
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#headerspermissionspolicies",
836
846
  type: "object"
837
847
  },
838
848
  strictTransportSecurity: {
839
- description: "See https://docs.commercetools.com/TODO",
840
849
  type: "array",
841
850
  items: {
842
851
  "enum": [
@@ -844,13 +853,14 @@ var customViewSchemaJson = {
844
853
  "preload"
845
854
  ]
846
855
  },
847
- uniqueItems: true
856
+ uniqueItems: true,
857
+ deprecated: true
848
858
  }
849
859
  },
850
860
  additionalProperties: false
851
861
  },
852
862
  labelAllLocales: {
853
- description: "See https://docs.commercetools.com/TODO",
863
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#labelalllocales",
854
864
  type: "array",
855
865
  "default": [
856
866
  ],
@@ -879,18 +889,18 @@ var customViewSchemaJson = {
879
889
  }
880
890
  },
881
891
  type: {
882
- description: "See https://docs.commercetools.com/TODO",
892
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#type",
883
893
  type: "string",
884
894
  "enum": [
885
895
  "CustomPanel"
886
896
  ]
887
897
  },
888
898
  typeSettings: {
889
- description: "See https://docs.commercetools.com/TODO",
899
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#typesettings",
890
900
  type: "object",
891
901
  properties: {
892
902
  size: {
893
- description: "See https://docs.commercetools.com/TODO",
903
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#typesettingssize",
894
904
  type: "string",
895
905
  "enum": [
896
906
  "SMALL",
@@ -900,7 +910,7 @@ var customViewSchemaJson = {
900
910
  }
901
911
  },
902
912
  locators: {
903
- description: "See https://docs.commercetools.com/TODO",
913
+ description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#locators",
904
914
  type: "array",
905
915
  "default": [
906
916
  ],
@@ -1241,7 +1251,7 @@ const getRuntimeEnvironmentConfig = _ref2 => {
1241
1251
  // Keep a reference to the config so that requiring the module
1242
1252
  // again will result in returning the cached value.
1243
1253
  let cachedConfig;
1244
- const processConfig = function () {
1254
+ const processConfig = async function () {
1245
1255
  var _context;
1246
1256
  let _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1247
1257
  _ref3$disableCache = _ref3.disableCache,
@@ -1249,11 +1259,11 @@ const processConfig = function () {
1249
1259
  _ref3$processEnv = _ref3.processEnv,
1250
1260
  processEnv = _ref3$processEnv === void 0 ? process.env : _ref3$processEnv,
1251
1261
  _ref3$applicationPath = _ref3.applicationPath,
1252
- applicationPath = _ref3$applicationPath === void 0 ? fs__default["default"].realpathSync(process.cwd()) : _ref3$applicationPath;
1262
+ applicationPath = _ref3$applicationPath === void 0 ? fs__default$1["default"].realpathSync(process.cwd()) : _ref3$applicationPath;
1253
1263
  if (cachedConfig && !disableCache) return cachedConfig;
1254
- const _loadConfig = loadConfig(applicationPath),
1255
- filepath = _loadConfig.filepath,
1256
- rawConfig = _loadConfig.config;
1264
+ const _await$loadConfig = await loadConfig(applicationPath),
1265
+ filepath = _await$loadConfig.filepath,
1266
+ rawConfig = _await$loadConfig.config;
1257
1267
  const configType = getLoadedConfigurationType(path.parse(filepath).name);
1258
1268
  validateConfig(configType, rawConfig);
1259
1269
  const appConfig = substituteVariablePlaceholders(rawConfig, {