@be-link/shield-for-tcb-node-sdk 0.1.0 → 0.1.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/index.d.ts +1 -1
- package/index.js +1 -2
- package/modules/config/service.d.ts +0 -9
- package/modules/config/service.js +8 -15
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { backendConfigService
|
|
1
|
+
export { backendConfigService } from './modules/config/service';
|
|
2
2
|
export type { Service as ConfigControllerTypes } from './modules/config/types';
|
package/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.backendConfigService = void 0;
|
|
4
4
|
var service_1 = require("./modules/config/service");
|
|
5
5
|
Object.defineProperty(exports, "backendConfigService", { enumerable: true, get: function () { return service_1.backendConfigService; } });
|
|
6
|
-
Object.defineProperty(exports, "frontendConfigService", { enumerable: true, get: function () { return service_1.frontendConfigService; } });
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
import { Service } from './types';
|
|
2
2
|
import BaseService from '../BaseService';
|
|
3
|
-
type CallerType = 'frontend' | 'backend';
|
|
4
|
-
export interface ConfigServiceOptions {
|
|
5
|
-
caller?: CallerType;
|
|
6
|
-
}
|
|
7
3
|
export declare class ConfigService extends BaseService implements Service.ConfigController {
|
|
8
4
|
protected prefixUrl: string;
|
|
9
|
-
private caller;
|
|
10
|
-
constructor(options?: ConfigServiceOptions);
|
|
11
|
-
private get shouldSkipErrorHandling();
|
|
12
5
|
fetchConfig(req: Service.Request.QueryFetchConfig): Promise<any>;
|
|
13
6
|
fetchGlobalDynamicConfig(): Promise<Service.Response.IFetchGlobalDynamicConfigResponse>;
|
|
14
7
|
getCosTempSecret(): Promise<Service.Response.CosTempSecretResponse>;
|
|
15
8
|
fetchSystemTime(): Promise<number>;
|
|
16
9
|
}
|
|
17
10
|
export declare const backendConfigService: ConfigService;
|
|
18
|
-
export declare const frontendConfigService: ConfigService;
|
|
19
|
-
export {};
|
|
@@ -3,33 +3,26 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.backendConfigService = exports.ConfigService = void 0;
|
|
7
7
|
const http_1 = require("../../utils/http");
|
|
8
8
|
const BaseService_1 = __importDefault(require("../BaseService"));
|
|
9
9
|
class ConfigService extends BaseService_1.default {
|
|
10
|
-
constructor(
|
|
11
|
-
super();
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
12
|
this.prefixUrl = '/shield/config';
|
|
13
|
-
this.caller = options?.caller ?? 'backend';
|
|
14
|
-
}
|
|
15
|
-
get shouldSkipErrorHandling() {
|
|
16
|
-
return this.caller === 'frontend';
|
|
17
13
|
}
|
|
18
14
|
fetchConfig(req) {
|
|
19
|
-
return (0, http_1.callApi)(this.getApiUrl(this.fetchConfig), req
|
|
20
|
-
skipErrorHandling: this.shouldSkipErrorHandling,
|
|
21
|
-
});
|
|
15
|
+
return (0, http_1.callApi)(this.getApiUrl(this.fetchConfig), req);
|
|
22
16
|
}
|
|
23
17
|
fetchGlobalDynamicConfig() {
|
|
24
|
-
return (0, http_1.callApi)(this.getApiUrl(this.fetchGlobalDynamicConfig), undefined
|
|
18
|
+
return (0, http_1.callApi)(this.getApiUrl(this.fetchGlobalDynamicConfig), undefined);
|
|
25
19
|
}
|
|
26
20
|
getCosTempSecret() {
|
|
27
|
-
return (0, http_1.callApi)(this.getApiUrl(this.getCosTempSecret), undefined
|
|
21
|
+
return (0, http_1.callApi)(this.getApiUrl(this.getCosTempSecret), undefined);
|
|
28
22
|
}
|
|
29
23
|
fetchSystemTime() {
|
|
30
|
-
return (0, http_1.callApi)(this.getApiUrl(this.fetchSystemTime), undefined
|
|
24
|
+
return (0, http_1.callApi)(this.getApiUrl(this.fetchSystemTime), undefined);
|
|
31
25
|
}
|
|
32
26
|
}
|
|
33
27
|
exports.ConfigService = ConfigService;
|
|
34
|
-
exports.backendConfigService = new ConfigService(
|
|
35
|
-
exports.frontendConfigService = new ConfigService({ caller: 'frontend' });
|
|
28
|
+
exports.backendConfigService = new ConfigService();
|