ob-parking-sdk 0.0.22 → 0.0.24

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 CHANGED
@@ -952,7 +952,7 @@ export interface Item {
952
952
  * @type {string}
953
953
  * @memberof Item
954
954
  */
955
- 'total_price': string;
955
+ 'total_price'?: string;
956
956
  }
957
957
  /**
958
958
  *
package/dist/api/api.d.ts CHANGED
@@ -924,7 +924,7 @@ export interface Item {
924
924
  * @type {string}
925
925
  * @memberof Item
926
926
  */
927
- 'total_price': string;
927
+ 'total_price'?: string;
928
928
  }
929
929
  /**
930
930
  *
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { DefaultApi } from './api';
2
2
  declare const axiosInstance: import("axios").AxiosInstance;
3
3
  declare function setAcessToken(accessToken: string): void;
4
- declare function setBaseUrl(string: string): void;
4
+ declare function setBaseUrl(url: string): void;
5
+ declare function setTraceId(traceId: string): void;
5
6
  declare const client: DefaultApi;
6
- export { client, axiosInstance, setAcessToken, setBaseUrl };
7
+ export { client, axiosInstance, setAcessToken, setBaseUrl, setTraceId };
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ 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.setBaseUrl = exports.setAcessToken = exports.axiosInstance = exports.client = void 0;
6
+ exports.setTraceId = 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({
@@ -14,9 +14,14 @@ function setAcessToken(accessToken) {
14
14
  axiosInstance.defaults.headers.common['x-access-token'] = `Bearer ${accessToken}`;
15
15
  }
16
16
  exports.setAcessToken = setAcessToken;
17
- function setBaseUrl(string) {
18
- axiosInstance.defaults.baseURL = string;
17
+ function setBaseUrl(url) {
18
+ axiosInstance.defaults.baseURL = url;
19
19
  }
20
20
  exports.setBaseUrl = setBaseUrl;
21
+ // always set TraceId before calling any function
22
+ function setTraceId(traceId) {
23
+ axiosInstance.defaults.headers.common['x-trace-id'] = traceId;
24
+ }
25
+ exports.setTraceId = setTraceId;
21
26
  const client = new api_1.DefaultApi(undefined, undefined, axiosInstance);
22
27
  exports.client = client;
package/index.ts CHANGED
@@ -11,10 +11,15 @@ function setAcessToken(accessToken: string): void {
11
11
  ] = `Bearer ${accessToken}`;
12
12
  }
13
13
 
14
- function setBaseUrl(string: string): void {
15
- axiosInstance.defaults.baseURL = string;
14
+ function setBaseUrl(url: string): void {
15
+ axiosInstance.defaults.baseURL = url;
16
+ }
17
+
18
+ // always set TraceId before calling any function
19
+ function setTraceId(traceId: string): void {
20
+ axiosInstance.defaults.headers.common['x-trace-id'] = traceId;
16
21
  }
17
22
 
18
23
  const client = new DefaultApi(undefined, undefined, axiosInstance);
19
24
 
20
- export { client, axiosInstance, setAcessToken, setBaseUrl };
25
+ export { client, axiosInstance, setAcessToken, setBaseUrl, setTraceId };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ob-parking-sdk",
3
- "version": "0.0.22",
3
+ "version": "0.0.24",
4
4
  "description": "API interfaces for OB PARKING",
5
5
  "main": "./dist/index.js",
6
6
  "license": "MIT"