skapi-js 1.0.47-beta.0 → 1.0.47

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.
@@ -380,8 +380,16 @@ export function clientSecretRequest(params) {
380
380
  }
381
381
  }
382
382
  }
383
+ if (params.headers) {
384
+ for (let k in params.headers) {
385
+ if (typeof params.headers[k] === 'string' && params.headers[k].includes('$CLIENT_SECRET')) {
386
+ hasSecret = true;
387
+ break;
388
+ }
389
+ }
390
+ }
383
391
  if (!hasSecret) {
384
- throw new SkapiError(`At least one parameter value should include "$CLIENT_SECRET" in ${params.method.toLowerCase() === 'post' ? '"data"' : '"params"'}.`, { code: 'INVALID_PARAMETER' });
392
+ throw new SkapiError(`At least one parameter value should include "$CLIENT_SECRET" in ${params.method.toLowerCase() === 'post' ? '"data"' : '"params"'} or "headers".`, { code: 'INVALID_PARAMETER' });
385
393
  }
386
394
  return request.bind(this)("client-secret-request", params);
387
395
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skapi-js",
3
- "version": "1.0.47-beta.0",
3
+ "version": "1.0.47",
4
4
  "description": "Skapi: Backend API Library for HTML frontend.",
5
5
  "main": "./dist/skapi.module.js",
6
6
  "types": "./js/Main.d.ts",