@platzio/sdk 0.5.3-beta.3 → 0.6.0-beta.0

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.
@@ -16,7 +16,7 @@
16
16
  import type { Configuration } from './configuration';
17
17
  // Some imports not used depending on template conditions
18
18
  // @ts-ignore
19
- import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
19
+ import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
20
20
  import globalAxios from 'axios';
21
21
 
22
22
  export const BASE_PATH = "http://localhost".replace(/\/+$/, "");
@@ -39,7 +39,7 @@ export const COLLECTION_FORMATS = {
39
39
  */
40
40
  export interface RequestArgs {
41
41
  url: string;
42
- options: AxiosRequestConfig;
42
+ options: RawAxiosRequestConfig;
43
43
  }
44
44
 
45
45
  /**
@@ -53,7 +53,7 @@ export class BaseAPI {
53
53
  constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
54
54
  if (configuration) {
55
55
  this.configuration = configuration;
56
- this.basePath = configuration.basePath || this.basePath;
56
+ this.basePath = configuration.basePath ?? basePath;
57
57
  }
58
58
  }
59
59
  };
@@ -70,3 +70,17 @@ export class RequiredError extends Error {
70
70
  this.name = "RequiredError"
71
71
  }
72
72
  }
73
+
74
+ interface ServerMap {
75
+ [key: string]: {
76
+ url: string,
77
+ description: string,
78
+ }[];
79
+ }
80
+
81
+ /**
82
+ *
83
+ * @export
84
+ */
85
+ export const operationServerMap: ServerMap = {
86
+ }
@@ -144,7 +144,7 @@ export const toPathString = function (url: URL) {
144
144
  */
145
145
  export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
146
146
  return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
147
- const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || axios.defaults.baseURL || basePath) + axiosArgs.url};
147
+ const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url};
148
148
  return axios.request<T, R>(axiosRequestArgs);
149
149
  };
150
150
  }
@@ -19,6 +19,7 @@ export interface ConfigurationParameters {
19
19
  password?: string;
20
20
  accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
21
21
  basePath?: string;
22
+ serverIndex?: number;
22
23
  baseOptions?: any;
23
24
  formDataCtor?: new () => any;
24
25
  }
@@ -58,6 +59,13 @@ export class Configuration {
58
59
  * @memberof Configuration
59
60
  */
60
61
  basePath?: string;
62
+ /**
63
+ * override server index
64
+ *
65
+ * @type {number}
66
+ * @memberof Configuration
67
+ */
68
+ serverIndex?: number;
61
69
  /**
62
70
  * base options for axios calls
63
71
  *
@@ -80,6 +88,7 @@ export class Configuration {
80
88
  this.password = param.password;
81
89
  this.accessToken = param.accessToken;
82
90
  this.basePath = param.basePath;
91
+ this.serverIndex = param.serverIndex;
83
92
  this.baseOptions = param.baseOptions;
84
93
  this.formDataCtor = param.formDataCtor;
85
94
  }
@@ -1 +0,0 @@
1
- 7.0.1
package/openapitools.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
3
- "spaces": 2,
4
- "generator-cli": {
5
- "version": "7.0.1"
6
- }
7
- }
File without changes
File without changes