@rc-ex/debug 0.8.0 → 0.9.1
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/lib/index.d.ts +1 -0
- package/lib/index.js +4 -1
- package/lib/index.js.map +1 -1
- package/package.json +4 -4
- package/{index.ts → src/index.ts} +8 -4
- package/tsconfig.json +3 -2
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -11,7 +11,8 @@ class DebugExtension extends SdkExtension_1.default {
|
|
|
11
11
|
var _b;
|
|
12
12
|
super();
|
|
13
13
|
this.options = options;
|
|
14
|
-
|
|
14
|
+
// eslint-disable-next-line no-console
|
|
15
|
+
(_a = (_b = this.options).loggingAction) !== null && _a !== void 0 ? _a : (_b.loggingAction = (message) => console.debug(message));
|
|
15
16
|
}
|
|
16
17
|
async install(rc) {
|
|
17
18
|
const request = rc.request.bind(rc);
|
|
@@ -24,6 +25,8 @@ class DebugExtension extends SdkExtension_1.default {
|
|
|
24
25
|
return r;
|
|
25
26
|
};
|
|
26
27
|
}
|
|
28
|
+
// eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-empty-function
|
|
29
|
+
async revoke() { }
|
|
27
30
|
}
|
|
28
31
|
exports.default = DebugExtension;
|
|
29
32
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;AAMA,kEAA0C;AAC1C,gFAAwD;AAMxD,MAAM,cAAe,SAAQ,sBAAY;IAGvC,YAAY,UAAwB,EAAE;;;QACpC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,YAAA,IAAI,CAAC,OAAO,EAAC,aAAa,uCAAb,aAAa,GAAK,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAMA,kEAA0C;AAC1C,gFAAwD;AAMxD,MAAM,cAAe,SAAQ,sBAAY;IAGvC,YAAY,UAAwB,EAAE;;;QACpC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,sCAAsC;QACtC,YAAA,IAAI,CAAC,OAAO,EAAC,aAAa,uCAAb,aAAa,GAAK,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,EAAC;IACrE,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,EAAe;QAC3B,MAAM,OAAO,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACpC,EAAE,CAAC,OAAO,GAAG,KAAK,EAChB,MAAkB,EAClB,QAAgB,EAChB,OAAY,EACZ,WAAgB,EAChB,MAA0B,EACA,EAAE;YAC5B,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;gBACjB,OAAO,OAAO,CAAI,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;aACnE;YACD,MAAM,CAAC,GAAG,MAAM,OAAO,CACrB,MAAM,EACN,QAAQ,EACR,OAAO,EACP,WAAW,EACX,MAAM,CACP,CAAC;YACF,IAAI,CAAC,OAAO,CAAC,aAAc,CAAC,eAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;YACpD,OAAO,CAAC,CAAC;QACX,CAAC,CAAC;IACJ,CAAC;IAED,wFAAwF;IACxF,KAAK,CAAC,MAAM,KAAoB,CAAC;CAClC;AAED,kBAAe,cAAc,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rc-ex/debug",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "Debug 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/debug",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"access": "public"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@rc-ex/core": "^0.
|
|
21
|
+
"@rc-ex/core": "^0.13.1"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@rc-ex/core": "^0.
|
|
24
|
+
"@rc-ex/core": "^0.13.0"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "3f44680a8445d8d86a42a100bd971fbf54cb5246"
|
|
27
27
|
}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
RestRequestConfig,
|
|
4
4
|
RestResponse,
|
|
5
5
|
RestMethod,
|
|
6
|
-
} from '@rc-ex/core/lib/
|
|
6
|
+
} from '@rc-ex/core/lib/types';
|
|
7
7
|
import Utils from '@rc-ex/core/lib/Utils';
|
|
8
8
|
import SdkExtension from '@rc-ex/core/lib/SdkExtension';
|
|
9
9
|
|
|
@@ -17,7 +17,8 @@ class DebugExtension extends SdkExtension {
|
|
|
17
17
|
constructor(options: DebugOptions = {}) {
|
|
18
18
|
super();
|
|
19
19
|
this.options = options;
|
|
20
|
-
|
|
20
|
+
// eslint-disable-next-line no-console
|
|
21
|
+
this.options.loggingAction ??= (message) => console.debug(message);
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
async install(rc: RingCentral) {
|
|
@@ -27,7 +28,7 @@ class DebugExtension extends SdkExtension {
|
|
|
27
28
|
endpoint: string,
|
|
28
29
|
content?: {},
|
|
29
30
|
queryParams?: {},
|
|
30
|
-
config?: RestRequestConfig
|
|
31
|
+
config?: RestRequestConfig,
|
|
31
32
|
): Promise<RestResponse<T>> => {
|
|
32
33
|
if (!this.enabled) {
|
|
33
34
|
return request<T>(method, endpoint, content, queryParams, config);
|
|
@@ -37,12 +38,15 @@ class DebugExtension extends SdkExtension {
|
|
|
37
38
|
endpoint,
|
|
38
39
|
content,
|
|
39
40
|
queryParams,
|
|
40
|
-
config
|
|
41
|
+
config,
|
|
41
42
|
);
|
|
42
43
|
this.options.loggingAction!(Utils.formatTraffic(r));
|
|
43
44
|
return r;
|
|
44
45
|
};
|
|
45
46
|
}
|
|
47
|
+
|
|
48
|
+
// eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-empty-function
|
|
49
|
+
async revoke(): Promise<void> { }
|
|
46
50
|
}
|
|
47
51
|
|
|
48
52
|
export default DebugExtension;
|