@rc-ex/auto-refresh 0.1.1 → 0.1.3
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 +1 -1
- package/lib/index.js.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +2 -2
package/README.md
CHANGED
|
@@ -23,6 +23,6 @@ autoRefreshExtension.start();
|
|
|
23
23
|
|
|
24
24
|
For a working sample, please check this [test case](../../../test/auto-refresh-extension.spec.ts).
|
|
25
25
|
|
|
26
|
-
|
|
27
26
|
## Disclaimer
|
|
27
|
+
|
|
28
28
|
[Token management](https://medium.com/ringcentral-developers/ringcentral-token-management-477578f00954) is a complicated topic. There is no one-fit-all solution. This extension is an quick-and-dirty out-of-box solution to refresh your token. It is by no means the best practice. It simply starts a background timers to refresh your token periodically. For serious production applications, you may need better token management strategy.
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AACA,gFAAwD;AAMxD,MAAM,oBAAqB,SAAQ,sBAAY;IAK7C,YAAmB,UAA8B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AACA,gFAAwD;AAMxD,MAAM,oBAAqB,SAAQ,sBAAY;IAK7C,YAAmB,UAA8B,EAAE,QAAQ,EAAE,IAAI,GAAG,EAAE,GAAG,EAAE,EAAE;QAC3E,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,EAAe;QAClC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACf,CAAC;IAEM,KAAK;QACV,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,gBAAgB;QAC7B,IAAI,CAAC,OAAO,GAAG,WAAW,CAAC,GAAG,EAAE;YAC9B,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC;QACpB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC5B,CAAC;IAEM,IAAI;QACT,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC5B,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;QAC3B,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,MAAM;QACjB,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;CACF;AAED,kBAAe,oBAAoB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rc-ex/auto-refresh",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Auto Refresh extension for ringcentral-extensible project",
|
|
5
5
|
"author": "Tyler Liu <tyler.liu@ringcentral.com>",
|
|
6
6
|
"homepage": "https://github.com/ringcentral/ringcentral-extensible/tree/master/packages/extensions/auto-refresh",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"access": "public"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@rc-ex/core": "^1.
|
|
21
|
+
"@rc-ex/core": "^1.4.1"
|
|
22
22
|
},
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "5b5b176fbdecfda9f388d1a34281178c54840ece"
|
|
24
24
|
}
|
package/src/index.ts
CHANGED
|
@@ -10,7 +10,7 @@ class AutoRefreshExtension extends SdkExtension {
|
|
|
10
10
|
public options: AutoRefreshOptions;
|
|
11
11
|
private timeout?: NodeJS.Timeout;
|
|
12
12
|
|
|
13
|
-
public constructor(options: AutoRefreshOptions = {interval: 1000 * 60 * 30}) {
|
|
13
|
+
public constructor(options: AutoRefreshOptions = { interval: 1000 * 60 * 30 }) {
|
|
14
14
|
super();
|
|
15
15
|
this.options = options;
|
|
16
16
|
}
|
|
@@ -27,7 +27,7 @@ class AutoRefreshExtension extends SdkExtension {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
public stop() {
|
|
30
|
-
if(this.timeout) {
|
|
30
|
+
if (this.timeout) {
|
|
31
31
|
clearInterval(this.timeout);
|
|
32
32
|
this.timeout = undefined;
|
|
33
33
|
}
|