skapi-js 1.0.46 → 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.
- package/dist/skapi.js +1 -1
- package/dist/skapi.js.map +1 -1
- package/dist/skapi.module.js +1 -1
- package/dist/skapi.module.js.map +1 -1
- package/js/main/skapi.js +2 -3
- package/js/methods/user.js +9 -1
- package/package.json +1 -1
package/js/main/skapi.js
CHANGED
|
@@ -23,7 +23,7 @@ export default class Skapi {
|
|
|
23
23
|
set user(value) {
|
|
24
24
|
}
|
|
25
25
|
constructor(service, owner, options, __etc) {
|
|
26
|
-
this.version = '1.0.
|
|
26
|
+
this.version = '1.0.47';
|
|
27
27
|
this.session = null;
|
|
28
28
|
this.connection = null;
|
|
29
29
|
this.host = 'skapi';
|
|
@@ -178,10 +178,9 @@ export default class Skapi {
|
|
|
178
178
|
return (process instanceof Promise) ? process.then(() => exec()) : exec();
|
|
179
179
|
};
|
|
180
180
|
window.addEventListener('beforeunload', () => {
|
|
181
|
-
this.closeRealtime();
|
|
182
181
|
storeClassProperties();
|
|
182
|
+
this.closeRealtime();
|
|
183
183
|
});
|
|
184
|
-
window.addEventListener("visibilitychange", storeClassProperties);
|
|
185
184
|
await process;
|
|
186
185
|
await this.__authConnection;
|
|
187
186
|
let skapi = `%c\r\n $$\\ $$\\ \r\n $$ | \\__|\r\n $$$$$$$\\ $$ | $$\\ $$$$$$\\ $$$$$$\\ $$\\ \r\n$$ _____|$$ | $$ |\\____$$\\ $$ __$$\\ $$ |\r\n\\$$$$$$\\ $$$$$$ \/ $$$$$$$ |$$ \/ $$ |$$ |\r\n \\____$$\\ $$ _$$< $$ __$$ |$$ | $$ |$$ |\r\n$$$$$$$ |$$ | \\$$\\\\$$$$$$$ |$$$$$$$ |$$ |\r\n\\_______\/ \\__| \\__|\\_______|$$ ____\/ \\__|\r\n $$ | \r\n $$ | \r\n \\__| \r\n`;
|
package/js/methods/user.js
CHANGED
|
@@ -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
|
}
|