@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.
- package/.github/workflows/release.yaml +19 -8
- package/dist/api.d.ts +7831 -0
- package/dist/api.js +4987 -0
- package/dist/api.js.map +1 -0
- package/dist/base.d.ts +66 -0
- package/dist/base.js +69 -0
- package/dist/base.js.map +1 -0
- package/dist/common.d.ts +65 -0
- package/dist/common.js +147 -0
- package/dist/common.js.map +1 -0
- package/dist/configuration.d.ts +91 -0
- package/dist/configuration.js +44 -0
- package/dist/configuration.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -0
- package/openapi.yaml +213 -2
- package/package.json +3 -3
- package/src/.openapi-generator/VERSION +1 -0
- package/{api.ts → src/api.ts} +673 -404
- package/{base.ts → src/base.ts} +17 -3
- package/{common.ts → src/common.ts} +1 -1
- package/{configuration.ts → src/configuration.ts} +9 -0
- package/.openapi-generator/VERSION +0 -1
- package/openapitools.json +0 -7
- /package/{.openapi-generator → src/.openapi-generator}/FILES +0 -0
- /package/{.openapi-generator-ignore → src/.openapi-generator-ignore} +0 -0
- /package/{git_push.sh → src/git_push.sh} +0 -0
- /package/{index.ts → src/index.ts} +0 -0
package/{base.ts → src/base.ts}
RENAMED
|
@@ -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,
|
|
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:
|
|
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
|
|
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: (
|
|
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
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|