@commercetools-backend/express 22.23.3 → 22.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -14,4 +14,4 @@ This package is primarily built for HTTP servers used by Custom Applications and
14
14
  $ npm install --save @commercetools-backend/express
15
15
  ```
16
16
 
17
- Check out the [documentation](https://docs.commercetools.com/custom-applications/concepts/integrate-with-your-own-api) for more information.
17
+ Check out the [documentation](https://docs.commercetools.com/merchant-center-customizations/concepts/integrate-with-your-own-api) for more information.
@@ -110,7 +110,7 @@ const writeSessionContext = request => {
110
110
  // Given a cloud identifier, try to map it to one of the supported
111
111
  // environments and return the MC API URL for that environment.
112
112
  // The URL points to the new hostnames.
113
- // https://docs.commercetools.com/custom-applications/concepts/merchant-center-api#hostnames
113
+ // https://docs.commercetools.com/merchant-center-customizations/concepts/merchant-center-api#hostnames
114
114
  const mapCloudIdentifierToIssuer = issuer => {
115
115
  switch (issuer) {
116
116
  case CLOUD_IDENTIFIERS.GCP_AU:
@@ -146,7 +146,7 @@ const throwIfIssuerIsNotAValidUrl = issuer => {
146
146
  try {
147
147
  new _URL__default["default"](issuer);
148
148
  } catch (error) {
149
- throw new Error("Invalid issuer URL \"".concat(issuer, "\". Expected a valid URL to the Merchant Center API Gateway, or a cloud identifier to one of the available cloud regions. See https://docs.commercetools.com/custom-applications/concepts/merchant-center-api#hostnames."));
149
+ throw new Error("Invalid issuer URL \"".concat(issuer, "\". Expected a valid URL to the Merchant Center API Gateway, or a cloud identifier to one of the available cloud regions. See https://docs.commercetools.com/merchant-center-customizations/concepts/merchant-center-api#hostnames."));
150
150
  }
151
151
  };
152
152
  // Validates required option values.
@@ -210,7 +210,7 @@ function createSessionAuthVerifier(options) {
210
210
  }
211
211
  const requestUrlPath = options.getRequestUrl ? options.getRequestUrl(request) : (_request$originalUrl = request.originalUrl) !== null && _request$originalUrl !== void 0 ? _request$originalUrl : request.url;
212
212
  if (!requestUrlPath || !_startsWithInstanceProperty__default["default"](requestUrlPath).call(requestUrlPath, '/')) {
213
- throw new Error("Invalid request URI path \"".concat(requestUrlPath, "\". Please make sure that the \"request\" object has either a property \"originalUrl\" or \"url\". If not, you should implement the \"getRequestUrl\" function and make sure to return a valid URI path value starting with \"/\". More info at https://docs.commercetools.com/custom-applications/concepts/integrate-with-your-own-api#validating-the-json-web-token"));
213
+ throw new Error("Invalid request URI path \"".concat(requestUrlPath, "\". Please make sure that the \"request\" object has either a property \"originalUrl\" or \"url\". If not, you should implement the \"getRequestUrl\" function and make sure to return a valid URI path value starting with \"/\". More info at https://docs.commercetools.com/merchant-center-customizations/concepts/integrate-with-your-own-api#validating-the-json-web-token"));
214
214
  }
215
215
  const audience = getConfiguredAudience(options, requestUrlPath);
216
216
  return new _Promise__default["default"]((resolve, reject) => {
@@ -110,7 +110,7 @@ const writeSessionContext = request => {
110
110
  // Given a cloud identifier, try to map it to one of the supported
111
111
  // environments and return the MC API URL for that environment.
112
112
  // The URL points to the new hostnames.
113
- // https://docs.commercetools.com/custom-applications/concepts/merchant-center-api#hostnames
113
+ // https://docs.commercetools.com/merchant-center-customizations/concepts/merchant-center-api#hostnames
114
114
  const mapCloudIdentifierToIssuer = issuer => {
115
115
  switch (issuer) {
116
116
  case CLOUD_IDENTIFIERS.GCP_AU:
@@ -146,7 +146,7 @@ const throwIfIssuerIsNotAValidUrl = issuer => {
146
146
  try {
147
147
  new _URL__default["default"](issuer);
148
148
  } catch (error) {
149
- throw new Error("Invalid issuer URL \"".concat(issuer, "\". Expected a valid URL to the Merchant Center API Gateway, or a cloud identifier to one of the available cloud regions. See https://docs.commercetools.com/custom-applications/concepts/merchant-center-api#hostnames."));
149
+ throw new Error("Invalid issuer URL \"".concat(issuer, "\". Expected a valid URL to the Merchant Center API Gateway, or a cloud identifier to one of the available cloud regions. See https://docs.commercetools.com/merchant-center-customizations/concepts/merchant-center-api#hostnames."));
150
150
  }
151
151
  };
152
152
  // Validates required option values.
@@ -210,7 +210,7 @@ function createSessionAuthVerifier(options) {
210
210
  }
211
211
  const requestUrlPath = options.getRequestUrl ? options.getRequestUrl(request) : (_request$originalUrl = request.originalUrl) !== null && _request$originalUrl !== void 0 ? _request$originalUrl : request.url;
212
212
  if (!requestUrlPath || !_startsWithInstanceProperty__default["default"](requestUrlPath).call(requestUrlPath, '/')) {
213
- throw new Error("Invalid request URI path \"".concat(requestUrlPath, "\". Please make sure that the \"request\" object has either a property \"originalUrl\" or \"url\". If not, you should implement the \"getRequestUrl\" function and make sure to return a valid URI path value starting with \"/\". More info at https://docs.commercetools.com/custom-applications/concepts/integrate-with-your-own-api#validating-the-json-web-token"));
213
+ throw new Error("Invalid request URI path \"".concat(requestUrlPath, "\". Please make sure that the \"request\" object has either a property \"originalUrl\" or \"url\". If not, you should implement the \"getRequestUrl\" function and make sure to return a valid URI path value starting with \"/\". More info at https://docs.commercetools.com/merchant-center-customizations/concepts/integrate-with-your-own-api#validating-the-json-web-token"));
214
214
  }
215
215
  const audience = getConfiguredAudience(options, requestUrlPath);
216
216
  return new _Promise__default["default"]((resolve, reject) => {
@@ -87,7 +87,7 @@ const writeSessionContext = request => {
87
87
  // Given a cloud identifier, try to map it to one of the supported
88
88
  // environments and return the MC API URL for that environment.
89
89
  // The URL points to the new hostnames.
90
- // https://docs.commercetools.com/custom-applications/concepts/merchant-center-api#hostnames
90
+ // https://docs.commercetools.com/merchant-center-customizations/concepts/merchant-center-api#hostnames
91
91
  const mapCloudIdentifierToIssuer = issuer => {
92
92
  switch (issuer) {
93
93
  case CLOUD_IDENTIFIERS.GCP_AU:
@@ -123,7 +123,7 @@ const throwIfIssuerIsNotAValidUrl = issuer => {
123
123
  try {
124
124
  new _URL(issuer);
125
125
  } catch (error) {
126
- throw new Error("Invalid issuer URL \"".concat(issuer, "\". Expected a valid URL to the Merchant Center API Gateway, or a cloud identifier to one of the available cloud regions. See https://docs.commercetools.com/custom-applications/concepts/merchant-center-api#hostnames."));
126
+ throw new Error("Invalid issuer URL \"".concat(issuer, "\". Expected a valid URL to the Merchant Center API Gateway, or a cloud identifier to one of the available cloud regions. See https://docs.commercetools.com/merchant-center-customizations/concepts/merchant-center-api#hostnames."));
127
127
  }
128
128
  };
129
129
  // Validates required option values.
@@ -187,7 +187,7 @@ function createSessionAuthVerifier(options) {
187
187
  }
188
188
  const requestUrlPath = options.getRequestUrl ? options.getRequestUrl(request) : (_request$originalUrl = request.originalUrl) !== null && _request$originalUrl !== void 0 ? _request$originalUrl : request.url;
189
189
  if (!requestUrlPath || !_startsWithInstanceProperty(requestUrlPath).call(requestUrlPath, '/')) {
190
- throw new Error("Invalid request URI path \"".concat(requestUrlPath, "\". Please make sure that the \"request\" object has either a property \"originalUrl\" or \"url\". If not, you should implement the \"getRequestUrl\" function and make sure to return a valid URI path value starting with \"/\". More info at https://docs.commercetools.com/custom-applications/concepts/integrate-with-your-own-api#validating-the-json-web-token"));
190
+ throw new Error("Invalid request URI path \"".concat(requestUrlPath, "\". Please make sure that the \"request\" object has either a property \"originalUrl\" or \"url\". If not, you should implement the \"getRequestUrl\" function and make sure to return a valid URI path value starting with \"/\". More info at https://docs.commercetools.com/merchant-center-customizations/concepts/integrate-with-your-own-api#validating-the-json-web-token"));
191
191
  }
192
192
  const audience = getConfiguredAudience(options, requestUrlPath);
193
193
  return new _Promise((resolve, reject) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercetools-backend/express",
3
- "version": "22.23.3",
3
+ "version": "22.24.0",
4
4
  "description": "Zero-config HTTP server as Express.js to facilitate development",
5
5
  "bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
6
6
  "repository": {
@@ -8,7 +8,7 @@
8
8
  "url": "https://github.com/commercetools/merchant-center-application-kit.git",
9
9
  "directory": "packages-backend/express"
10
10
  },
11
- "homepage": "https://docs.commercetools.com/custom-applications",
11
+ "homepage": "https://docs.commercetools.com/merchant-center-customizations",
12
12
  "keywords": [
13
13
  "javascript",
14
14
  "nodejs",