ob-bms-sdk 0.0.14 → 0.0.15
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 +0 -83
- package/dist/api/api.d.ts +0 -46
- package/dist/api/api.js +1 -63
- package/dist/index.d.ts +2 -1
- package/dist/index.js +7 -2
- package/index.ts +8 -3
- package/package.json +1 -1
- package/test.ts +6 -2
package/api/api.ts
CHANGED
|
@@ -897,26 +897,6 @@ export interface WrappedResponseFindMemberResultData {
|
|
|
897
897
|
*/
|
|
898
898
|
'member'?: FindMemberResultMember;
|
|
899
899
|
}
|
|
900
|
-
/**
|
|
901
|
-
*
|
|
902
|
-
* @export
|
|
903
|
-
* @interface WrappedResponseNull
|
|
904
|
-
*/
|
|
905
|
-
export interface WrappedResponseNull {
|
|
906
|
-
/**
|
|
907
|
-
*
|
|
908
|
-
* @type {Array<number>}
|
|
909
|
-
* @memberof WrappedResponseNull
|
|
910
|
-
*/
|
|
911
|
-
'data': Array<WrappedResponseNullDataEnum>;
|
|
912
|
-
}
|
|
913
|
-
|
|
914
|
-
export const WrappedResponseNullDataEnum = {
|
|
915
|
-
NUMBER_null: null
|
|
916
|
-
} as const;
|
|
917
|
-
|
|
918
|
-
export type WrappedResponseNullDataEnum = typeof WrappedResponseNullDataEnum[keyof typeof WrappedResponseNullDataEnum];
|
|
919
|
-
|
|
920
900
|
/**
|
|
921
901
|
*
|
|
922
902
|
* @export
|
|
@@ -1304,39 +1284,6 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati
|
|
|
1304
1284
|
options: localVarRequestOptions,
|
|
1305
1285
|
};
|
|
1306
1286
|
},
|
|
1307
|
-
/**
|
|
1308
|
-
*
|
|
1309
|
-
* @param {string} id
|
|
1310
|
-
* @param {*} [options] Override http request option.
|
|
1311
|
-
* @throws {RequiredError}
|
|
1312
|
-
*/
|
|
1313
|
-
visitorsDestroy: async (id: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
1314
|
-
// verify required parameter 'id' is not null or undefined
|
|
1315
|
-
assertParamExists('visitorsDestroy', 'id', id)
|
|
1316
|
-
const localVarPath = `/visitors/{id}`
|
|
1317
|
-
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
1318
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1319
|
-
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
1320
|
-
let baseOptions;
|
|
1321
|
-
if (configuration) {
|
|
1322
|
-
baseOptions = configuration.baseOptions;
|
|
1323
|
-
}
|
|
1324
|
-
|
|
1325
|
-
const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
|
|
1326
|
-
const localVarHeaderParameter = {} as any;
|
|
1327
|
-
const localVarQueryParameter = {} as any;
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
1332
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1333
|
-
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
1334
|
-
|
|
1335
|
-
return {
|
|
1336
|
-
url: toPathString(localVarUrlObj),
|
|
1337
|
-
options: localVarRequestOptions,
|
|
1338
|
-
};
|
|
1339
|
-
},
|
|
1340
1287
|
/**
|
|
1341
1288
|
*
|
|
1342
1289
|
* @param {string} id
|
|
@@ -1450,16 +1397,6 @@ export const DefaultApiFp = function(configuration?: Configuration) {
|
|
|
1450
1397
|
const localVarAxiosArgs = await localVarAxiosParamCreator.visitorsCreate(createVisitorBody, options);
|
|
1451
1398
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
1452
1399
|
},
|
|
1453
|
-
/**
|
|
1454
|
-
*
|
|
1455
|
-
* @param {string} id
|
|
1456
|
-
* @param {*} [options] Override http request option.
|
|
1457
|
-
* @throws {RequiredError}
|
|
1458
|
-
*/
|
|
1459
|
-
async visitorsDestroy(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<WrappedResponseNull>> {
|
|
1460
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.visitorsDestroy(id, options);
|
|
1461
|
-
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
1462
|
-
},
|
|
1463
1400
|
/**
|
|
1464
1401
|
*
|
|
1465
1402
|
* @param {string} id
|
|
@@ -1543,15 +1480,6 @@ export const DefaultApiFactory = function (configuration?: Configuration, basePa
|
|
|
1543
1480
|
visitorsCreate(createVisitorBody: CreateVisitorBody, options?: any): AxiosPromise<WrappedResponseCreateVisitorResponse> {
|
|
1544
1481
|
return localVarFp.visitorsCreate(createVisitorBody, options).then((request) => request(axios, basePath));
|
|
1545
1482
|
},
|
|
1546
|
-
/**
|
|
1547
|
-
*
|
|
1548
|
-
* @param {string} id
|
|
1549
|
-
* @param {*} [options] Override http request option.
|
|
1550
|
-
* @throws {RequiredError}
|
|
1551
|
-
*/
|
|
1552
|
-
visitorsDestroy(id: string, options?: any): AxiosPromise<WrappedResponseNull> {
|
|
1553
|
-
return localVarFp.visitorsDestroy(id, options).then((request) => request(axios, basePath));
|
|
1554
|
-
},
|
|
1555
1483
|
/**
|
|
1556
1484
|
*
|
|
1557
1485
|
* @param {string} id
|
|
@@ -1648,17 +1576,6 @@ export class DefaultApi extends BaseAPI {
|
|
|
1648
1576
|
return DefaultApiFp(this.configuration).visitorsCreate(createVisitorBody, options).then((request) => request(this.axios, this.basePath));
|
|
1649
1577
|
}
|
|
1650
1578
|
|
|
1651
|
-
/**
|
|
1652
|
-
*
|
|
1653
|
-
* @param {string} id
|
|
1654
|
-
* @param {*} [options] Override http request option.
|
|
1655
|
-
* @throws {RequiredError}
|
|
1656
|
-
* @memberof DefaultApi
|
|
1657
|
-
*/
|
|
1658
|
-
public visitorsDestroy(id: string, options?: AxiosRequestConfig) {
|
|
1659
|
-
return DefaultApiFp(this.configuration).visitorsDestroy(id, options).then((request) => request(this.axios, this.basePath));
|
|
1660
|
-
}
|
|
1661
|
-
|
|
1662
1579
|
/**
|
|
1663
1580
|
*
|
|
1664
1581
|
* @param {string} id
|
package/dist/api/api.d.ts
CHANGED
|
@@ -897,23 +897,6 @@ export interface WrappedResponseFindMemberResultData {
|
|
|
897
897
|
*/
|
|
898
898
|
'member'?: FindMemberResultMember;
|
|
899
899
|
}
|
|
900
|
-
/**
|
|
901
|
-
*
|
|
902
|
-
* @export
|
|
903
|
-
* @interface WrappedResponseNull
|
|
904
|
-
*/
|
|
905
|
-
export interface WrappedResponseNull {
|
|
906
|
-
/**
|
|
907
|
-
*
|
|
908
|
-
* @type {Array<number>}
|
|
909
|
-
* @memberof WrappedResponseNull
|
|
910
|
-
*/
|
|
911
|
-
'data': Array<WrappedResponseNullDataEnum>;
|
|
912
|
-
}
|
|
913
|
-
export declare const WrappedResponseNullDataEnum: {
|
|
914
|
-
readonly NUMBER_null: null;
|
|
915
|
-
};
|
|
916
|
-
export type WrappedResponseNullDataEnum = typeof WrappedResponseNullDataEnum[keyof typeof WrappedResponseNullDataEnum];
|
|
917
900
|
/**
|
|
918
901
|
*
|
|
919
902
|
* @export
|
|
@@ -1104,13 +1087,6 @@ export declare const DefaultApiAxiosParamCreator: (configuration?: Configuration
|
|
|
1104
1087
|
* @throws {RequiredError}
|
|
1105
1088
|
*/
|
|
1106
1089
|
visitorsCreate: (createVisitorBody: CreateVisitorBody, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
1107
|
-
/**
|
|
1108
|
-
*
|
|
1109
|
-
* @param {string} id
|
|
1110
|
-
* @param {*} [options] Override http request option.
|
|
1111
|
-
* @throws {RequiredError}
|
|
1112
|
-
*/
|
|
1113
|
-
visitorsDestroy: (id: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
1114
1090
|
/**
|
|
1115
1091
|
*
|
|
1116
1092
|
* @param {string} id
|
|
@@ -1173,13 +1149,6 @@ export declare const DefaultApiFp: (configuration?: Configuration) => {
|
|
|
1173
1149
|
* @throws {RequiredError}
|
|
1174
1150
|
*/
|
|
1175
1151
|
visitorsCreate(createVisitorBody: CreateVisitorBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<WrappedResponseCreateVisitorResponse>>;
|
|
1176
|
-
/**
|
|
1177
|
-
*
|
|
1178
|
-
* @param {string} id
|
|
1179
|
-
* @param {*} [options] Override http request option.
|
|
1180
|
-
* @throws {RequiredError}
|
|
1181
|
-
*/
|
|
1182
|
-
visitorsDestroy(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<WrappedResponseNull>>;
|
|
1183
1152
|
/**
|
|
1184
1153
|
*
|
|
1185
1154
|
* @param {string} id
|
|
@@ -1242,13 +1211,6 @@ export declare const DefaultApiFactory: (configuration?: Configuration, basePath
|
|
|
1242
1211
|
* @throws {RequiredError}
|
|
1243
1212
|
*/
|
|
1244
1213
|
visitorsCreate(createVisitorBody: CreateVisitorBody, options?: any): AxiosPromise<WrappedResponseCreateVisitorResponse>;
|
|
1245
|
-
/**
|
|
1246
|
-
*
|
|
1247
|
-
* @param {string} id
|
|
1248
|
-
* @param {*} [options] Override http request option.
|
|
1249
|
-
* @throws {RequiredError}
|
|
1250
|
-
*/
|
|
1251
|
-
visitorsDestroy(id: string, options?: any): AxiosPromise<WrappedResponseNull>;
|
|
1252
1214
|
/**
|
|
1253
1215
|
*
|
|
1254
1216
|
* @param {string} id
|
|
@@ -1320,14 +1282,6 @@ export declare class DefaultApi extends BaseAPI {
|
|
|
1320
1282
|
* @memberof DefaultApi
|
|
1321
1283
|
*/
|
|
1322
1284
|
visitorsCreate(createVisitorBody: CreateVisitorBody, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<WrappedResponseCreateVisitorResponse, any>>;
|
|
1323
|
-
/**
|
|
1324
|
-
*
|
|
1325
|
-
* @param {string} id
|
|
1326
|
-
* @param {*} [options] Override http request option.
|
|
1327
|
-
* @throws {RequiredError}
|
|
1328
|
-
* @memberof DefaultApi
|
|
1329
|
-
*/
|
|
1330
|
-
visitorsDestroy(id: string, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<WrappedResponseNull, any>>;
|
|
1331
1285
|
/**
|
|
1332
1286
|
*
|
|
1333
1287
|
* @param {string} id
|
package/dist/api/api.js
CHANGED
|
@@ -25,16 +25,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
25
25
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
26
|
};
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.DefaultApi = exports.DefaultApiFactory = exports.DefaultApiFp = exports.DefaultApiAxiosParamCreator =
|
|
28
|
+
exports.DefaultApi = exports.DefaultApiFactory = exports.DefaultApiFp = exports.DefaultApiAxiosParamCreator = void 0;
|
|
29
29
|
const axios_1 = __importDefault(require("axios"));
|
|
30
30
|
// Some imports not used depending on template conditions
|
|
31
31
|
// @ts-ignore
|
|
32
32
|
const common_1 = require("./common");
|
|
33
33
|
// @ts-ignore
|
|
34
34
|
const base_1 = require("./base");
|
|
35
|
-
exports.WrappedResponseNullDataEnum = {
|
|
36
|
-
NUMBER_null: null
|
|
37
|
-
};
|
|
38
35
|
/**
|
|
39
36
|
* DefaultApi - axios parameter creator
|
|
40
37
|
* @export
|
|
@@ -244,34 +241,6 @@ const DefaultApiAxiosParamCreator = function (configuration) {
|
|
|
244
241
|
options: localVarRequestOptions,
|
|
245
242
|
};
|
|
246
243
|
}),
|
|
247
|
-
/**
|
|
248
|
-
*
|
|
249
|
-
* @param {string} id
|
|
250
|
-
* @param {*} [options] Override http request option.
|
|
251
|
-
* @throws {RequiredError}
|
|
252
|
-
*/
|
|
253
|
-
visitorsDestroy: (id, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
254
|
-
// verify required parameter 'id' is not null or undefined
|
|
255
|
-
(0, common_1.assertParamExists)('visitorsDestroy', 'id', id);
|
|
256
|
-
const localVarPath = `/visitors/{id}`
|
|
257
|
-
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
258
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
259
|
-
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
260
|
-
let baseOptions;
|
|
261
|
-
if (configuration) {
|
|
262
|
-
baseOptions = configuration.baseOptions;
|
|
263
|
-
}
|
|
264
|
-
const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
|
|
265
|
-
const localVarHeaderParameter = {};
|
|
266
|
-
const localVarQueryParameter = {};
|
|
267
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
268
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
269
|
-
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
270
|
-
return {
|
|
271
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
272
|
-
options: localVarRequestOptions,
|
|
273
|
-
};
|
|
274
|
-
}),
|
|
275
244
|
/**
|
|
276
245
|
*
|
|
277
246
|
* @param {string} id
|
|
@@ -394,18 +363,6 @@ const DefaultApiFp = function (configuration) {
|
|
|
394
363
|
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
395
364
|
});
|
|
396
365
|
},
|
|
397
|
-
/**
|
|
398
|
-
*
|
|
399
|
-
* @param {string} id
|
|
400
|
-
* @param {*} [options] Override http request option.
|
|
401
|
-
* @throws {RequiredError}
|
|
402
|
-
*/
|
|
403
|
-
visitorsDestroy(id, options) {
|
|
404
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
405
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.visitorsDestroy(id, options);
|
|
406
|
-
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
407
|
-
});
|
|
408
|
-
},
|
|
409
366
|
/**
|
|
410
367
|
*
|
|
411
368
|
* @param {string} id
|
|
@@ -491,15 +448,6 @@ const DefaultApiFactory = function (configuration, basePath, axios) {
|
|
|
491
448
|
visitorsCreate(createVisitorBody, options) {
|
|
492
449
|
return localVarFp.visitorsCreate(createVisitorBody, options).then((request) => request(axios, basePath));
|
|
493
450
|
},
|
|
494
|
-
/**
|
|
495
|
-
*
|
|
496
|
-
* @param {string} id
|
|
497
|
-
* @param {*} [options] Override http request option.
|
|
498
|
-
* @throws {RequiredError}
|
|
499
|
-
*/
|
|
500
|
-
visitorsDestroy(id, options) {
|
|
501
|
-
return localVarFp.visitorsDestroy(id, options).then((request) => request(axios, basePath));
|
|
502
|
-
},
|
|
503
451
|
/**
|
|
504
452
|
*
|
|
505
453
|
* @param {string} id
|
|
@@ -589,16 +537,6 @@ class DefaultApi extends base_1.BaseAPI {
|
|
|
589
537
|
visitorsCreate(createVisitorBody, options) {
|
|
590
538
|
return (0, exports.DefaultApiFp)(this.configuration).visitorsCreate(createVisitorBody, options).then((request) => request(this.axios, this.basePath));
|
|
591
539
|
}
|
|
592
|
-
/**
|
|
593
|
-
*
|
|
594
|
-
* @param {string} id
|
|
595
|
-
* @param {*} [options] Override http request option.
|
|
596
|
-
* @throws {RequiredError}
|
|
597
|
-
* @memberof DefaultApi
|
|
598
|
-
*/
|
|
599
|
-
visitorsDestroy(id, options) {
|
|
600
|
-
return (0, exports.DefaultApiFp)(this.configuration).visitorsDestroy(id, options).then((request) => request(this.axios, this.basePath));
|
|
601
|
-
}
|
|
602
540
|
/**
|
|
603
541
|
*
|
|
604
542
|
* @param {string} id
|
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,19 @@ 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({ basePath: process.env['OB_BMS_URL'] || 'http://localhost:3000' });
|
|
12
|
+
const client = new api_1.DefaultApi(config, undefined, axiosInstance);
|
|
12
13
|
exports.client = client;
|
|
13
14
|
function setAcessToken(accessToken) {
|
|
14
15
|
axiosInstance.defaults.headers.common['x-access-token'] = accessToken;
|
|
15
16
|
}
|
|
16
17
|
exports.setAcessToken = setAcessToken;
|
|
18
|
+
function setBaseUrl(string) {
|
|
19
|
+
axiosInstance.defaults.baseURL = string;
|
|
20
|
+
}
|
|
21
|
+
exports.setBaseUrl = setBaseUrl;
|
package/index.ts
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
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({ basePath: process.env['OB_BMS_URL'] || 'http://localhost:3000' });
|
|
7
|
+
const client = new DefaultApi(config, undefined, axiosInstance);
|
|
7
8
|
|
|
8
9
|
function setAcessToken(accessToken: string): void {
|
|
9
10
|
axiosInstance.defaults.headers.common['x-access-token'] = accessToken;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
function setBaseUrl(string: string): void {
|
|
14
|
+
axiosInstance.defaults.baseURL = string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { client, axiosInstance, setAcessToken, setBaseUrl };
|
package/package.json
CHANGED
package/test.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import * as OB_BMS_SDK from './dist';
|
|
2
2
|
|
|
3
3
|
OB_BMS_SDK.setAcessToken('123');
|
|
4
|
-
|
|
4
|
+
OB_BMS_SDK.axiosInstance.defaults.baseURL = '123';
|
|
5
5
|
(async () => {
|
|
6
|
-
|
|
6
|
+
try {
|
|
7
|
+
await OB_BMS_SDK.client.visitorsShow('1');
|
|
8
|
+
} catch (err) {
|
|
9
|
+
console.log(err);
|
|
10
|
+
}
|
|
7
11
|
})();
|