ob-bms-sdk 0.0.14 → 0.0.16
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/api/api.ts +12 -0
- package/dist/api/api.d.ts +12 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +9 -2
- package/index.ts +10 -3
- package/package.json +1 -1
- package/test.ts +6 -1
package/api/api.ts
CHANGED
|
@@ -480,6 +480,12 @@ export interface ShowMemberResult {
|
|
|
480
480
|
* @memberof ShowMemberResult
|
|
481
481
|
*/
|
|
482
482
|
'metadata': PrismaJsonValue | null;
|
|
483
|
+
/**
|
|
484
|
+
*
|
|
485
|
+
* @type {string}
|
|
486
|
+
* @memberof ShowMemberResult
|
|
487
|
+
*/
|
|
488
|
+
'account_id': string | null;
|
|
483
489
|
/**
|
|
484
490
|
*
|
|
485
491
|
* @type {Array<ShowMemberTower>}
|
|
@@ -954,6 +960,12 @@ export interface WrappedResponseShowMemberResultData {
|
|
|
954
960
|
* @memberof WrappedResponseShowMemberResultData
|
|
955
961
|
*/
|
|
956
962
|
'metadata': PrismaJsonValue | null;
|
|
963
|
+
/**
|
|
964
|
+
*
|
|
965
|
+
* @type {string}
|
|
966
|
+
* @memberof WrappedResponseShowMemberResultData
|
|
967
|
+
*/
|
|
968
|
+
'account_id': string | null;
|
|
957
969
|
/**
|
|
958
970
|
*
|
|
959
971
|
* @type {Array<ShowMemberTower>}
|
package/dist/api/api.d.ts
CHANGED
|
@@ -480,6 +480,12 @@ export interface ShowMemberResult {
|
|
|
480
480
|
* @memberof ShowMemberResult
|
|
481
481
|
*/
|
|
482
482
|
'metadata': PrismaJsonValue | null;
|
|
483
|
+
/**
|
|
484
|
+
*
|
|
485
|
+
* @type {string}
|
|
486
|
+
* @memberof ShowMemberResult
|
|
487
|
+
*/
|
|
488
|
+
'account_id': string | null;
|
|
483
489
|
/**
|
|
484
490
|
*
|
|
485
491
|
* @type {Array<ShowMemberTower>}
|
|
@@ -951,6 +957,12 @@ export interface WrappedResponseShowMemberResultData {
|
|
|
951
957
|
* @memberof WrappedResponseShowMemberResultData
|
|
952
958
|
*/
|
|
953
959
|
'metadata': PrismaJsonValue | null;
|
|
960
|
+
/**
|
|
961
|
+
*
|
|
962
|
+
* @type {string}
|
|
963
|
+
* @memberof WrappedResponseShowMemberResultData
|
|
964
|
+
*/
|
|
965
|
+
'account_id': string | null;
|
|
954
966
|
/**
|
|
955
967
|
*
|
|
956
968
|
* @type {Array<ShowMemberTower>}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ import { DefaultApi } from './api';
|
|
|
2
2
|
declare const axiosInstance: import("axios").AxiosInstance;
|
|
3
3
|
declare const client: DefaultApi;
|
|
4
4
|
declare function setAcessToken(accessToken: string): void;
|
|
5
|
-
|
|
5
|
+
declare function setBaseUrl(string: string): void;
|
|
6
|
+
export { client, axiosInstance, setAcessToken, setBaseUrl };
|
package/dist/index.js
CHANGED
|
@@ -3,14 +3,21 @@ 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.setAcessToken = exports.axiosInstance = exports.client = void 0;
|
|
6
|
+
exports.setBaseUrl = exports.setAcessToken = exports.axiosInstance = exports.client = void 0;
|
|
7
7
|
const api_1 = require("./api");
|
|
8
8
|
const axios_1 = __importDefault(require("axios"));
|
|
9
9
|
const axiosInstance = axios_1.default.create();
|
|
10
10
|
exports.axiosInstance = axiosInstance;
|
|
11
|
-
const
|
|
11
|
+
const config = new api_1.Configuration({
|
|
12
|
+
basePath: process.env['OB_BMS_URL'] || 'https://dev.glorymtel.xyz/ob-bms',
|
|
13
|
+
});
|
|
14
|
+
const client = new api_1.DefaultApi(config, undefined, axiosInstance);
|
|
12
15
|
exports.client = client;
|
|
13
16
|
function setAcessToken(accessToken) {
|
|
14
17
|
axiosInstance.defaults.headers.common['x-access-token'] = accessToken;
|
|
15
18
|
}
|
|
16
19
|
exports.setAcessToken = setAcessToken;
|
|
20
|
+
function setBaseUrl(string) {
|
|
21
|
+
axiosInstance.defaults.baseURL = string;
|
|
22
|
+
}
|
|
23
|
+
exports.setBaseUrl = setBaseUrl;
|
package/index.ts
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
import { DefaultApi } from './api';
|
|
1
|
+
import { Configuration, DefaultApi } from './api';
|
|
2
2
|
import axios from 'axios';
|
|
3
3
|
|
|
4
4
|
const axiosInstance = axios.create();
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const config: Configuration = new Configuration({
|
|
7
|
+
basePath: process.env['OB_BMS_URL'] || 'https://dev.glorymtel.xyz/ob-bms',
|
|
8
|
+
});
|
|
9
|
+
const client = new DefaultApi(config, undefined, axiosInstance);
|
|
7
10
|
|
|
8
11
|
function setAcessToken(accessToken: string): void {
|
|
9
12
|
axiosInstance.defaults.headers.common['x-access-token'] = accessToken;
|
|
10
13
|
}
|
|
11
14
|
|
|
12
|
-
|
|
15
|
+
function setBaseUrl(string: string): void {
|
|
16
|
+
axiosInstance.defaults.baseURL = string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { client, axiosInstance, setAcessToken, setBaseUrl };
|
package/package.json
CHANGED
package/test.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import * as OB_BMS_SDK from './dist';
|
|
2
2
|
|
|
3
3
|
OB_BMS_SDK.setAcessToken('123');
|
|
4
|
+
OB_BMS_SDK.setBaseUrl('');
|
|
4
5
|
|
|
5
6
|
(async () => {
|
|
6
|
-
|
|
7
|
+
try {
|
|
8
|
+
await OB_BMS_SDK.client.memberShow('1');
|
|
9
|
+
} catch (err) {
|
|
10
|
+
console.log(err);
|
|
11
|
+
}
|
|
7
12
|
})();
|