@commercetools-frontend/application-config 24.8.0 → 24.9.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.
@@ -111,6 +111,11 @@
111
111
  },
112
112
  "teamId": {
113
113
  "type": "string"
114
+ },
115
+ "mcIdentityLoginModeOverride": {
116
+ "description": "Set to 'legacy' to use legacy login mode for development, sending x-mc-identity-login-mode-override header instead of cookies",
117
+ "type": "string",
118
+ "enum": ["legacy"]
114
119
  }
115
120
  },
116
121
  "additionalProperties": false,
@@ -111,6 +111,11 @@
111
111
  "hostUriPath": {
112
112
  "description": "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#envdevelopmenthosturipath",
113
113
  "type": "string"
114
+ },
115
+ "mcIdentityLoginModeOverride": {
116
+ "description": "Set to 'legacy' to use legacy login mode for development, sending x-mc-identity-login-mode-override header instead of cookies",
117
+ "type": "string",
118
+ "enum": ["legacy"]
114
119
  }
115
120
  },
116
121
  "additionalProperties": false,
@@ -416,6 +416,13 @@ var customApplicationSchemaJson = {
416
416
  },
417
417
  teamId: {
418
418
  type: "string"
419
+ },
420
+ mcIdentityLoginModeOverride: {
421
+ description: "Set to 'legacy' to use legacy login mode for development, sending x-mc-identity-login-mode-override header instead of cookies",
422
+ type: "string",
423
+ "enum": [
424
+ "legacy"
425
+ ]
419
426
  }
420
427
  },
421
428
  additionalProperties: false,
@@ -770,6 +777,13 @@ var customViewSchemaJson = {
770
777
  hostUriPath: {
771
778
  description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#envdevelopmenthosturipath",
772
779
  type: "string"
780
+ },
781
+ mcIdentityLoginModeOverride: {
782
+ description: "Set to 'legacy' to use legacy login mode for development, sending x-mc-identity-login-mode-override header instead of cookies",
783
+ type: "string",
784
+ "enum": [
785
+ "legacy"
786
+ ]
773
787
  }
774
788
  },
775
789
  additionalProperties: false,
@@ -1151,7 +1165,7 @@ const getLoadedConfigurationType = configFileName => {
1151
1165
  };
1152
1166
  const trimTrailingSlash = value => value.replace(/\/$/, '');
1153
1167
  const omitDevConfigIfEmpty = devConfig => {
1154
- if (devConfig && (Object.hasOwn(devConfig, 'accountLinks') || Object.hasOwn(devConfig, 'menuLinks') || Object.hasOwn(devConfig, 'customViewHostUrl') || Object.hasOwn(devConfig, 'oidc'))) {
1168
+ if (devConfig && (Object.hasOwn(devConfig, 'accountLinks') || Object.hasOwn(devConfig, 'menuLinks') || Object.hasOwn(devConfig, 'customViewHostUrl') || Object.hasOwn(devConfig, 'oidc') || Object.hasOwn(devConfig, 'mcIdentityLoginModeOverride'))) {
1155
1169
  return devConfig;
1156
1170
  }
1157
1171
  return undefined;
@@ -1191,7 +1205,8 @@ const getRuntimeEnvironmentConfigForDevelopment = _ref => {
1191
1205
  return omitDevConfigIfEmpty({
1192
1206
  oidc: oidcConfig,
1193
1207
  customViewConfig: configurationData,
1194
- customViewHostUrl: hostUrl.href
1208
+ customViewHostUrl: hostUrl.href,
1209
+ mcIdentityLoginModeOverride: appConfig.env.development.mcIdentityLoginModeOverride
1195
1210
  });
1196
1211
  }
1197
1212
  return omitDevConfigIfEmpty({
@@ -1202,7 +1217,8 @@ const getRuntimeEnvironmentConfigForDevelopment = _ref => {
1202
1217
  submenuLinks: configurationData.submenuLinks
1203
1218
  }),
1204
1219
  // @ts-expect-error: the `accountLinks` is not explicitly typed as it's only used by the account app.
1205
- accountLinks: appConfig.accountLinks
1220
+ accountLinks: appConfig.accountLinks,
1221
+ mcIdentityLoginModeOverride: appConfig.env.development.mcIdentityLoginModeOverride
1206
1222
  });
1207
1223
  };
1208
1224
  const getRuntimeEnvironmentConfig = _ref2 => {
@@ -1312,7 +1328,7 @@ const processConfig = async function () {
1312
1328
  // the CSP point of view, it will say only the file `app` can be used as a source, so
1313
1329
  // any other file from that domain will be forbidden. Using the slash (ex: https://www.my-domain.com/app/)
1314
1330
  // at the end it's like using a wildcard so anything 'below' `app` will be allowed.
1315
- 'connect-src': getUniqueValues(appConfig.headers?.csp?.['connect-src'], _concatInstanceProperty__default["default"](_context = [mcApiUrl.origin]).call(_context, isProd ? [`${trimTrailingSlash(appUrl.href)}/`] : [])),
1331
+ 'connect-src': getUniqueValues(appConfig.headers?.csp?.['connect-src'], _concatInstanceProperty__default["default"](_context = [mcApiUrl.origin]).call(_context, isProd ? [`${trimTrailingSlash(appUrl.href)}/`, `${trimTrailingSlash(cdnUrl.href)}/`] : [])),
1316
1332
  'script-src': getUniqueValues(appConfig.headers?.csp?.['script-src'], isProd ? [`${trimTrailingSlash(appUrl.href)}/`, `${trimTrailingSlash(cdnUrl.href)}/`] : []),
1317
1333
  'style-src': getUniqueValues(appConfig.headers?.csp?.['style-src'], isProd ? [`${trimTrailingSlash(appUrl.href)}/`, `${trimTrailingSlash(cdnUrl.href)}/`] : [])
1318
1334
  })
@@ -416,6 +416,13 @@ var customApplicationSchemaJson = {
416
416
  },
417
417
  teamId: {
418
418
  type: "string"
419
+ },
420
+ mcIdentityLoginModeOverride: {
421
+ description: "Set to 'legacy' to use legacy login mode for development, sending x-mc-identity-login-mode-override header instead of cookies",
422
+ type: "string",
423
+ "enum": [
424
+ "legacy"
425
+ ]
419
426
  }
420
427
  },
421
428
  additionalProperties: false,
@@ -770,6 +777,13 @@ var customViewSchemaJson = {
770
777
  hostUriPath: {
771
778
  description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#envdevelopmenthosturipath",
772
779
  type: "string"
780
+ },
781
+ mcIdentityLoginModeOverride: {
782
+ description: "Set to 'legacy' to use legacy login mode for development, sending x-mc-identity-login-mode-override header instead of cookies",
783
+ type: "string",
784
+ "enum": [
785
+ "legacy"
786
+ ]
773
787
  }
774
788
  },
775
789
  additionalProperties: false,
@@ -1151,7 +1165,7 @@ const getLoadedConfigurationType = configFileName => {
1151
1165
  };
1152
1166
  const trimTrailingSlash = value => value.replace(/\/$/, '');
1153
1167
  const omitDevConfigIfEmpty = devConfig => {
1154
- if (devConfig && (Object.hasOwn(devConfig, 'accountLinks') || Object.hasOwn(devConfig, 'menuLinks') || Object.hasOwn(devConfig, 'customViewHostUrl') || Object.hasOwn(devConfig, 'oidc'))) {
1168
+ if (devConfig && (Object.hasOwn(devConfig, 'accountLinks') || Object.hasOwn(devConfig, 'menuLinks') || Object.hasOwn(devConfig, 'customViewHostUrl') || Object.hasOwn(devConfig, 'oidc') || Object.hasOwn(devConfig, 'mcIdentityLoginModeOverride'))) {
1155
1169
  return devConfig;
1156
1170
  }
1157
1171
  return undefined;
@@ -1191,7 +1205,8 @@ const getRuntimeEnvironmentConfigForDevelopment = _ref => {
1191
1205
  return omitDevConfigIfEmpty({
1192
1206
  oidc: oidcConfig,
1193
1207
  customViewConfig: configurationData,
1194
- customViewHostUrl: hostUrl.href
1208
+ customViewHostUrl: hostUrl.href,
1209
+ mcIdentityLoginModeOverride: appConfig.env.development.mcIdentityLoginModeOverride
1195
1210
  });
1196
1211
  }
1197
1212
  return omitDevConfigIfEmpty({
@@ -1202,7 +1217,8 @@ const getRuntimeEnvironmentConfigForDevelopment = _ref => {
1202
1217
  submenuLinks: configurationData.submenuLinks
1203
1218
  }),
1204
1219
  // @ts-expect-error: the `accountLinks` is not explicitly typed as it's only used by the account app.
1205
- accountLinks: appConfig.accountLinks
1220
+ accountLinks: appConfig.accountLinks,
1221
+ mcIdentityLoginModeOverride: appConfig.env.development.mcIdentityLoginModeOverride
1206
1222
  });
1207
1223
  };
1208
1224
  const getRuntimeEnvironmentConfig = _ref2 => {
@@ -1312,7 +1328,7 @@ const processConfig = async function () {
1312
1328
  // the CSP point of view, it will say only the file `app` can be used as a source, so
1313
1329
  // any other file from that domain will be forbidden. Using the slash (ex: https://www.my-domain.com/app/)
1314
1330
  // at the end it's like using a wildcard so anything 'below' `app` will be allowed.
1315
- 'connect-src': getUniqueValues(appConfig.headers?.csp?.['connect-src'], _concatInstanceProperty__default["default"](_context = [mcApiUrl.origin]).call(_context, isProd ? [`${trimTrailingSlash(appUrl.href)}/`] : [])),
1331
+ 'connect-src': getUniqueValues(appConfig.headers?.csp?.['connect-src'], _concatInstanceProperty__default["default"](_context = [mcApiUrl.origin]).call(_context, isProd ? [`${trimTrailingSlash(appUrl.href)}/`, `${trimTrailingSlash(cdnUrl.href)}/`] : [])),
1316
1332
  'script-src': getUniqueValues(appConfig.headers?.csp?.['script-src'], isProd ? [`${trimTrailingSlash(appUrl.href)}/`, `${trimTrailingSlash(cdnUrl.href)}/`] : []),
1317
1333
  'style-src': getUniqueValues(appConfig.headers?.csp?.['style-src'], isProd ? [`${trimTrailingSlash(appUrl.href)}/`, `${trimTrailingSlash(cdnUrl.href)}/`] : [])
1318
1334
  })
@@ -382,6 +382,13 @@ var customApplicationSchemaJson = {
382
382
  },
383
383
  teamId: {
384
384
  type: "string"
385
+ },
386
+ mcIdentityLoginModeOverride: {
387
+ description: "Set to 'legacy' to use legacy login mode for development, sending x-mc-identity-login-mode-override header instead of cookies",
388
+ type: "string",
389
+ "enum": [
390
+ "legacy"
391
+ ]
385
392
  }
386
393
  },
387
394
  additionalProperties: false,
@@ -736,6 +743,13 @@ var customViewSchemaJson = {
736
743
  hostUriPath: {
737
744
  description: "See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#envdevelopmenthosturipath",
738
745
  type: "string"
746
+ },
747
+ mcIdentityLoginModeOverride: {
748
+ description: "Set to 'legacy' to use legacy login mode for development, sending x-mc-identity-login-mode-override header instead of cookies",
749
+ type: "string",
750
+ "enum": [
751
+ "legacy"
752
+ ]
739
753
  }
740
754
  },
741
755
  additionalProperties: false,
@@ -1117,7 +1131,7 @@ const getLoadedConfigurationType = configFileName => {
1117
1131
  };
1118
1132
  const trimTrailingSlash = value => value.replace(/\/$/, '');
1119
1133
  const omitDevConfigIfEmpty = devConfig => {
1120
- if (devConfig && (Object.hasOwn(devConfig, 'accountLinks') || Object.hasOwn(devConfig, 'menuLinks') || Object.hasOwn(devConfig, 'customViewHostUrl') || Object.hasOwn(devConfig, 'oidc'))) {
1134
+ if (devConfig && (Object.hasOwn(devConfig, 'accountLinks') || Object.hasOwn(devConfig, 'menuLinks') || Object.hasOwn(devConfig, 'customViewHostUrl') || Object.hasOwn(devConfig, 'oidc') || Object.hasOwn(devConfig, 'mcIdentityLoginModeOverride'))) {
1121
1135
  return devConfig;
1122
1136
  }
1123
1137
  return undefined;
@@ -1157,7 +1171,8 @@ const getRuntimeEnvironmentConfigForDevelopment = _ref => {
1157
1171
  return omitDevConfigIfEmpty({
1158
1172
  oidc: oidcConfig,
1159
1173
  customViewConfig: configurationData,
1160
- customViewHostUrl: hostUrl.href
1174
+ customViewHostUrl: hostUrl.href,
1175
+ mcIdentityLoginModeOverride: appConfig.env.development.mcIdentityLoginModeOverride
1161
1176
  });
1162
1177
  }
1163
1178
  return omitDevConfigIfEmpty({
@@ -1168,7 +1183,8 @@ const getRuntimeEnvironmentConfigForDevelopment = _ref => {
1168
1183
  submenuLinks: configurationData.submenuLinks
1169
1184
  }),
1170
1185
  // @ts-expect-error: the `accountLinks` is not explicitly typed as it's only used by the account app.
1171
- accountLinks: appConfig.accountLinks
1186
+ accountLinks: appConfig.accountLinks,
1187
+ mcIdentityLoginModeOverride: appConfig.env.development.mcIdentityLoginModeOverride
1172
1188
  });
1173
1189
  };
1174
1190
  const getRuntimeEnvironmentConfig = _ref2 => {
@@ -1278,7 +1294,7 @@ const processConfig = async function () {
1278
1294
  // the CSP point of view, it will say only the file `app` can be used as a source, so
1279
1295
  // any other file from that domain will be forbidden. Using the slash (ex: https://www.my-domain.com/app/)
1280
1296
  // at the end it's like using a wildcard so anything 'below' `app` will be allowed.
1281
- 'connect-src': getUniqueValues(appConfig.headers?.csp?.['connect-src'], _concatInstanceProperty(_context = [mcApiUrl.origin]).call(_context, isProd ? [`${trimTrailingSlash(appUrl.href)}/`] : [])),
1297
+ 'connect-src': getUniqueValues(appConfig.headers?.csp?.['connect-src'], _concatInstanceProperty(_context = [mcApiUrl.origin]).call(_context, isProd ? [`${trimTrailingSlash(appUrl.href)}/`, `${trimTrailingSlash(cdnUrl.href)}/`] : [])),
1282
1298
  'script-src': getUniqueValues(appConfig.headers?.csp?.['script-src'], isProd ? [`${trimTrailingSlash(appUrl.href)}/`, `${trimTrailingSlash(cdnUrl.href)}/`] : []),
1283
1299
  'style-src': getUniqueValues(appConfig.headers?.csp?.['style-src'], isProd ? [`${trimTrailingSlash(appUrl.href)}/`, `${trimTrailingSlash(cdnUrl.href)}/`] : [])
1284
1300
  })
@@ -61,6 +61,10 @@ export interface JSONSchemaForCustomApplicationConfigurationFiles {
61
61
  */
62
62
  initialProjectKey: string;
63
63
  teamId?: string;
64
+ /**
65
+ * Set to 'legacy' to use legacy login mode for development, sending x-mc-identity-login-mode-override header instead of cookies
66
+ */
67
+ mcIdentityLoginModeOverride?: 'legacy';
64
68
  };
65
69
  production: {
66
70
  /**
@@ -61,6 +61,10 @@ export interface JSONSchemaForCustomViewConfigurationFiles {
61
61
  * See https://docs.commercetools.com/merchant-center-customizations/tooling-and-configuration/custom-view-config#envdevelopmenthosturipath
62
62
  */
63
63
  hostUriPath?: string;
64
+ /**
65
+ * Set to 'legacy' to use legacy login mode for development, sending x-mc-identity-login-mode-override header instead of cookies
66
+ */
67
+ mcIdentityLoginModeOverride?: 'legacy';
64
68
  };
65
69
  production: {
66
70
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercetools-frontend/application-config",
3
- "version": "24.8.0",
3
+ "version": "24.9.0",
4
4
  "description": "Configuration utilities for building Custom Applications",
5
5
  "bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
6
6
  "repository": {
@@ -45,7 +45,7 @@
45
45
  "@babel/register": "^7.22.15",
46
46
  "@babel/runtime": "^7.22.15",
47
47
  "@babel/runtime-corejs3": "^7.22.15",
48
- "@commercetools-frontend/constants": "24.8.0",
48
+ "@commercetools-frontend/constants": "24.9.0",
49
49
  "@types/lodash": "^4.14.198",
50
50
  "@types/react": "^19.0.3",
51
51
  "ajv": "8.17.1",
@@ -60,7 +60,7 @@
60
60
  "devDependencies": {
61
61
  "@types/jsdom": "^21.1.2",
62
62
  "json-schema-to-typescript": "15.0.4",
63
- "@commercetools-frontend/assets": "24.8.0"
63
+ "@commercetools-frontend/assets": "24.9.0"
64
64
  },
65
65
  "engines": {
66
66
  "node": "18.x || 20.x || >=22.0.0"