@croct/plug 0.11.0-alpha → 0.11.0-alpha.2

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/constants.d.ts CHANGED
@@ -2,4 +2,4 @@ export declare const CDN_URL = "https://cdn.croct.io/js/v1/lib/plug.js";
2
2
  export declare const PLAYGROUND_ORIGIN = "https://play.croct.com";
3
3
  export declare const PLAYGROUND_CONNECT_URL = "https://play.croct.com/connect.html";
4
4
  export declare const PREVIEW_WIDGET_ORIGIN = "https://cdn.croct.io";
5
- export declare const PREVIEW_WIDGET_URL = "https://cdn.croct.io/js/v1/lib/plug/widget-0.11.0-alpha.html";
5
+ export declare const PREVIEW_WIDGET_URL = "https://cdn.croct.io/js/v1/lib/plug/widget-0.11.0-alpha.2.html";
package/constants.js CHANGED
@@ -5,4 +5,4 @@ exports.CDN_URL = 'https://cdn.croct.io/js/v1/lib/plug.js';
5
5
  exports.PLAYGROUND_ORIGIN = 'https://play.croct.com';
6
6
  exports.PLAYGROUND_CONNECT_URL = 'https://play.croct.com/connect.html';
7
7
  exports.PREVIEW_WIDGET_ORIGIN = 'https://cdn.croct.io';
8
- exports.PREVIEW_WIDGET_URL = 'https://cdn.croct.io/js/v1/lib/plug/widget-0.11.0-alpha.html';
8
+ exports.PREVIEW_WIDGET_URL = 'https://cdn.croct.io/js/v1/lib/plug/widget-0.11.0-alpha.2.html';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@croct/plug",
3
- "version": "0.11.0-alpha",
3
+ "version": "0.11.0-alpha.2",
4
4
  "description": "A fully-featured devkit for building natively personalized applications.",
5
5
  "license": "MIT",
6
6
  "author": {
package/plug.js CHANGED
@@ -208,9 +208,9 @@ class GlobalPlug {
208
208
  .then(result => result === true);
209
209
  }
210
210
  get fetch() {
211
- const logger = this.sdk.getLogger();
212
211
  return this.eap('fetch', (slotId, options = {}) => {
213
212
  const [id, version] = slotId.split('@');
213
+ const logger = this.sdk.getLogger();
214
214
  return this.sdk
215
215
  .contentFetcher
216
216
  .fetch(id, {
package/preview.js CHANGED
@@ -33,6 +33,7 @@ class PreviewPlugin {
33
33
  }
34
34
  updateToken(data) {
35
35
  if (data === PREVIEW_EXIT) {
36
+ this.logger.debug('Exiting preview mode.');
36
37
  this.tokenStore.setToken(null);
37
38
  return;
38
39
  }
@@ -40,6 +41,7 @@ class PreviewPlugin {
40
41
  let token = token_1.Token.parse(data);
41
42
  const { exp } = token.getPayload();
42
43
  if (exp !== undefined && exp <= Date.now() / 1000) {
44
+ this.logger.debug('Preview token expired.');
43
45
  token = null;
44
46
  }
45
47
  this.tokenStore.setToken(token);