@cosmotech/api-ts 3.1.9 → 3.2.5

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/dist/base.d.ts CHANGED
@@ -2,15 +2,15 @@
2
2
  * Cosmo Tech Platform API
3
3
  * Cosmo Tech Platform API
4
4
  *
5
- * The version of the OpenAPI document: 3.1.9
5
+ * The version of the OpenAPI document: 3.2.5
6
6
  * Contact: platform@cosmotech.com
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import { Configuration } from "./configuration";
13
- import { AxiosInstance, AxiosRequestConfig } from 'axios';
12
+ import type { Configuration } from './configuration';
13
+ import type { AxiosInstance, RawAxiosRequestConfig } from 'axios';
14
14
  export declare const BASE_PATH: string;
15
15
  /**
16
16
  *
@@ -29,7 +29,7 @@ export declare const COLLECTION_FORMATS: {
29
29
  */
30
30
  export interface RequestArgs {
31
31
  url: string;
32
- options: AxiosRequestConfig;
32
+ options: RawAxiosRequestConfig;
33
33
  }
34
34
  /**
35
35
  *
@@ -50,6 +50,17 @@ export declare class BaseAPI {
50
50
  */
51
51
  export declare class RequiredError extends Error {
52
52
  field: string;
53
- name: "RequiredError";
54
53
  constructor(field: string, msg?: string);
55
54
  }
55
+ interface ServerMap {
56
+ [key: string]: {
57
+ url: string;
58
+ description: string;
59
+ }[];
60
+ }
61
+ /**
62
+ *
63
+ * @export
64
+ */
65
+ export declare const operationServerMap: ServerMap;
66
+ export {};
package/dist/base.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * Cosmo Tech Platform API
6
6
  * Cosmo Tech Platform API
7
7
  *
8
- * The version of the OpenAPI document: 3.1.9
8
+ * The version of the OpenAPI document: 3.2.5
9
9
  * Contact: platform@cosmotech.com
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -16,19 +16,19 @@ var __extends = (this && this.__extends) || (function () {
16
16
  var extendStatics = function (d, b) {
17
17
  extendStatics = Object.setPrototypeOf ||
18
18
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
19
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
19
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
20
20
  return extendStatics(d, b);
21
21
  };
22
22
  return function (d, b) {
23
+ if (typeof b !== "function" && b !== null)
24
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
23
25
  extendStatics(d, b);
24
26
  function __() { this.constructor = d; }
25
27
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
26
28
  };
27
29
  })();
28
30
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
30
- // Some imports not used depending on template conditions
31
- // @ts-ignore
31
+ exports.operationServerMap = exports.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
32
32
  var axios_1 = require("axios");
33
33
  exports.BASE_PATH = "https://dev.api.cosmotech.com".replace(/\/+$/, "");
34
34
  /**
@@ -50,11 +50,12 @@ var BaseAPI = /** @class */ (function () {
50
50
  function BaseAPI(configuration, basePath, axios) {
51
51
  if (basePath === void 0) { basePath = exports.BASE_PATH; }
52
52
  if (axios === void 0) { axios = axios_1.default; }
53
+ var _a;
53
54
  this.basePath = basePath;
54
55
  this.axios = axios;
55
56
  if (configuration) {
56
57
  this.configuration = configuration;
57
- this.basePath = configuration.basePath || this.basePath;
58
+ this.basePath = (_a = configuration.basePath) !== null && _a !== void 0 ? _a : basePath;
58
59
  }
59
60
  }
60
61
  return BaseAPI;
@@ -78,3 +79,8 @@ var RequiredError = /** @class */ (function (_super) {
78
79
  return RequiredError;
79
80
  }(Error));
80
81
  exports.RequiredError = RequiredError;
82
+ /**
83
+ *
84
+ * @export
85
+ */
86
+ exports.operationServerMap = {};
package/dist/common.d.ts CHANGED
@@ -2,16 +2,16 @@
2
2
  * Cosmo Tech Platform API
3
3
  * Cosmo Tech Platform API
4
4
  *
5
- * The version of the OpenAPI document: 3.1.9
5
+ * The version of the OpenAPI document: 3.2.5
6
6
  * Contact: platform@cosmotech.com
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import { Configuration } from "./configuration";
13
- import { RequestArgs } from "./base";
14
- import { AxiosInstance, AxiosResponse } from 'axios';
12
+ import type { Configuration } from "./configuration";
13
+ import type { RequestArgs } from "./base";
14
+ import type { AxiosInstance, AxiosResponse } from 'axios';
15
15
  /**
16
16
  *
17
17
  * @export
@@ -62,4 +62,4 @@ export declare const toPathString: (url: URL) => string;
62
62
  *
63
63
  * @export
64
64
  */
65
- export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => <T = unknown, R = AxiosResponse<T>>(axios?: AxiosInstance, basePath?: string) => Promise<R>;
65
+ export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => <T = unknown, R = AxiosResponse<T, any>>(axios?: AxiosInstance, basePath?: string) => Promise<R>;
package/dist/common.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * Cosmo Tech Platform API
6
6
  * Cosmo Tech Platform API
7
7
  *
8
- * The version of the OpenAPI document: 3.1.9
8
+ * The version of the OpenAPI document: 3.2.5
9
9
  * Contact: platform@cosmotech.com
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -38,7 +38,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
38
38
  function verb(n) { return function (v) { return step([n, v]); }; }
39
39
  function step(op) {
40
40
  if (f) throw new TypeError("Generator is already executing.");
41
- while (_) try {
41
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
42
42
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
43
43
  if (y = 0, t) op = [op[0] & 2, t.value];
44
44
  switch (op[0]) {
@@ -72,16 +72,17 @@ exports.DUMMY_BASE_URL = 'https://example.com';
72
72
  * @throws {RequiredError}
73
73
  * @export
74
74
  */
75
- exports.assertParamExists = function (functionName, paramName, paramValue) {
75
+ var assertParamExists = function (functionName, paramName, paramValue) {
76
76
  if (paramValue === null || paramValue === undefined) {
77
- throw new base_1.RequiredError(paramName, "Required parameter " + paramName + " was null or undefined when calling " + functionName + ".");
77
+ throw new base_1.RequiredError(paramName, "Required parameter ".concat(paramName, " was null or undefined when calling ").concat(functionName, "."));
78
78
  }
79
79
  };
80
+ exports.assertParamExists = assertParamExists;
80
81
  /**
81
82
  *
82
83
  * @export
83
84
  */
84
- exports.setApiKeyToObject = function (object, keyParamName, configuration) {
85
+ var setApiKeyToObject = function (object, keyParamName, configuration) {
85
86
  return __awaiter(this, void 0, void 0, function () {
86
87
  var localVarApiKeyValue, _a;
87
88
  return __generator(this, function (_b) {
@@ -106,20 +107,22 @@ exports.setApiKeyToObject = function (object, keyParamName, configuration) {
106
107
  });
107
108
  });
108
109
  };
110
+ exports.setApiKeyToObject = setApiKeyToObject;
109
111
  /**
110
112
  *
111
113
  * @export
112
114
  */
113
- exports.setBasicAuthToObject = function (object, configuration) {
115
+ var setBasicAuthToObject = function (object, configuration) {
114
116
  if (configuration && (configuration.username || configuration.password)) {
115
117
  object["auth"] = { username: configuration.username, password: configuration.password };
116
118
  }
117
119
  };
120
+ exports.setBasicAuthToObject = setBasicAuthToObject;
118
121
  /**
119
122
  *
120
123
  * @export
121
124
  */
122
- exports.setBearerAuthToObject = function (object, configuration) {
125
+ var setBearerAuthToObject = function (object, configuration) {
123
126
  return __awaiter(this, void 0, void 0, function () {
124
127
  var accessToken, _a;
125
128
  return __generator(this, function (_b) {
@@ -144,11 +147,12 @@ exports.setBearerAuthToObject = function (object, configuration) {
144
147
  });
145
148
  });
146
149
  };
150
+ exports.setBearerAuthToObject = setBearerAuthToObject;
147
151
  /**
148
152
  *
149
153
  * @export
150
154
  */
151
- exports.setOAuthToObject = function (object, name, scopes, configuration) {
155
+ var setOAuthToObject = function (object, name, scopes, configuration) {
152
156
  return __awaiter(this, void 0, void 0, function () {
153
157
  var localVarAccessTokenValue, _a;
154
158
  return __generator(this, function (_b) {
@@ -173,38 +177,49 @@ exports.setOAuthToObject = function (object, name, scopes, configuration) {
173
177
  });
174
178
  });
175
179
  };
180
+ exports.setOAuthToObject = setOAuthToObject;
181
+ function setFlattenedQueryParams(urlSearchParams, parameter, key) {
182
+ if (key === void 0) { key = ""; }
183
+ if (parameter == null)
184
+ return;
185
+ if (typeof parameter === "object") {
186
+ if (Array.isArray(parameter)) {
187
+ parameter.forEach(function (item) { return setFlattenedQueryParams(urlSearchParams, item, key); });
188
+ }
189
+ else {
190
+ Object.keys(parameter).forEach(function (currentKey) {
191
+ return setFlattenedQueryParams(urlSearchParams, parameter[currentKey], "".concat(key).concat(key !== '' ? '.' : '').concat(currentKey));
192
+ });
193
+ }
194
+ }
195
+ else {
196
+ if (urlSearchParams.has(key)) {
197
+ urlSearchParams.append(key, parameter);
198
+ }
199
+ else {
200
+ urlSearchParams.set(key, parameter);
201
+ }
202
+ }
203
+ }
176
204
  /**
177
205
  *
178
206
  * @export
179
207
  */
180
- exports.setSearchParams = function (url) {
208
+ var setSearchParams = function (url) {
181
209
  var objects = [];
182
210
  for (var _i = 1; _i < arguments.length; _i++) {
183
211
  objects[_i - 1] = arguments[_i];
184
212
  }
185
213
  var searchParams = new URLSearchParams(url.search);
186
- for (var _a = 0, objects_1 = objects; _a < objects_1.length; _a++) {
187
- var object = objects_1[_a];
188
- for (var key in object) {
189
- if (Array.isArray(object[key])) {
190
- searchParams.delete(key);
191
- for (var _b = 0, _c = object[key]; _b < _c.length; _b++) {
192
- var item = _c[_b];
193
- searchParams.append(key, item);
194
- }
195
- }
196
- else {
197
- searchParams.set(key, object[key]);
198
- }
199
- }
200
- }
214
+ setFlattenedQueryParams(searchParams, objects);
201
215
  url.search = searchParams.toString();
202
216
  };
217
+ exports.setSearchParams = setSearchParams;
203
218
  /**
204
219
  *
205
220
  * @export
206
221
  */
207
- exports.serializeDataIfNeeded = function (value, requestOptions, configuration) {
222
+ var serializeDataIfNeeded = function (value, requestOptions, configuration) {
208
223
  var nonString = typeof value !== 'string';
209
224
  var needsSerialization = nonString && configuration && configuration.isJsonMime
210
225
  ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
@@ -213,22 +228,26 @@ exports.serializeDataIfNeeded = function (value, requestOptions, configuration)
213
228
  ? JSON.stringify(value !== undefined ? value : {})
214
229
  : (value || "");
215
230
  };
231
+ exports.serializeDataIfNeeded = serializeDataIfNeeded;
216
232
  /**
217
233
  *
218
234
  * @export
219
235
  */
220
- exports.toPathString = function (url) {
236
+ var toPathString = function (url) {
221
237
  return url.pathname + url.search + url.hash;
222
238
  };
239
+ exports.toPathString = toPathString;
223
240
  /**
224
241
  *
225
242
  * @export
226
243
  */
227
- exports.createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
244
+ var createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
228
245
  return function (axios, basePath) {
246
+ var _a;
229
247
  if (axios === void 0) { axios = globalAxios; }
230
248
  if (basePath === void 0) { basePath = BASE_PATH; }
231
- var axiosRequestArgs = __assign(__assign({}, axiosArgs.options), { url: ((configuration === null || configuration === void 0 ? void 0 : configuration.basePath) || basePath) + axiosArgs.url });
249
+ var axiosRequestArgs = __assign(__assign({}, axiosArgs.options), { url: (axios.defaults.baseURL ? '' : (_a = configuration === null || configuration === void 0 ? void 0 : configuration.basePath) !== null && _a !== void 0 ? _a : basePath) + axiosArgs.url });
232
250
  return axios.request(axiosRequestArgs);
233
251
  };
234
252
  };
253
+ exports.createRequestFunction = createRequestFunction;
@@ -2,7 +2,7 @@
2
2
  * Cosmo Tech Platform API
3
3
  * Cosmo Tech Platform API
4
4
  *
5
- * The version of the OpenAPI document: 3.1.9
5
+ * The version of the OpenAPI document: 3.2.5
6
6
  * Contact: platform@cosmotech.com
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -15,6 +15,7 @@ export interface ConfigurationParameters {
15
15
  password?: string;
16
16
  accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
17
17
  basePath?: string;
18
+ serverIndex?: number;
18
19
  baseOptions?: any;
19
20
  formDataCtor?: new () => any;
20
21
  }
@@ -53,6 +54,13 @@ export declare class Configuration {
53
54
  * @memberof Configuration
54
55
  */
55
56
  basePath?: string;
57
+ /**
58
+ * override server index
59
+ *
60
+ * @type {number}
61
+ * @memberof Configuration
62
+ */
63
+ serverIndex?: number;
56
64
  /**
57
65
  * base options for axios calls
58
66
  *
@@ -5,7 +5,7 @@
5
5
  * Cosmo Tech Platform API
6
6
  * Cosmo Tech Platform API
7
7
  *
8
- * The version of the OpenAPI document: 3.1.9
8
+ * The version of the OpenAPI document: 3.2.5
9
9
  * Contact: platform@cosmotech.com
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -22,6 +22,7 @@ var Configuration = /** @class */ (function () {
22
22
  this.password = param.password;
23
23
  this.accessToken = param.accessToken;
24
24
  this.basePath = param.basePath;
25
+ this.serverIndex = param.serverIndex;
25
26
  this.baseOptions = param.baseOptions;
26
27
  this.formDataCtor = param.formDataCtor;
27
28
  }
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Cosmo Tech Platform API
3
3
  * Cosmo Tech Platform API
4
4
  *
5
- * The version of the OpenAPI document: 3.1.9
5
+ * The version of the OpenAPI document: 3.2.5
6
6
  * Contact: platform@cosmotech.com
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * Cosmo Tech Platform API
6
6
  * Cosmo Tech Platform API
7
7
  *
8
- * The version of the OpenAPI document: 3.1.9
8
+ * The version of the OpenAPI document: 3.2.5
9
9
  * Contact: platform@cosmotech.com
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -14,13 +14,17 @@
14
14
  */
15
15
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16
16
  if (k2 === undefined) k2 = k;
17
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
17
+ var desc = Object.getOwnPropertyDescriptor(m, k);
18
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
19
+ desc = { enumerable: true, get: function() { return m[k]; } };
20
+ }
21
+ Object.defineProperty(o, k2, desc);
18
22
  }) : (function(o, m, k, k2) {
19
23
  if (k2 === undefined) k2 = k;
20
24
  o[k2] = m[k];
21
25
  }));
22
26
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
23
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
27
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
24
28
  };
25
29
  Object.defineProperty(exports, "__esModule", { value: true });
26
30
  __exportStar(require("./api"), exports);
package/index.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * Cosmo Tech Platform API
5
5
  * Cosmo Tech Platform API
6
6
  *
7
- * The version of the OpenAPI document: 3.1.9
7
+ * The version of the OpenAPI document: 3.2.5
8
8
  * Contact: platform@cosmotech.com
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/package.json CHANGED
@@ -1,8 +1,12 @@
1
1
  {
2
2
  "name": "@cosmotech/api-ts",
3
- "version": "3.1.9",
3
+ "version": "3.2.5",
4
4
  "description": "OpenAPI client for @cosmotech/api-ts",
5
5
  "author": "OpenAPI-Generator Contributors",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
9
+ },
6
10
  "keywords": [
7
11
  "axios",
8
12
  "typescript",
@@ -14,14 +18,14 @@
14
18
  "main": "./dist/index.js",
15
19
  "typings": "./dist/index.d.ts",
16
20
  "scripts": {
17
- "build": "tsc --outDir dist/",
21
+ "build": "tsc",
18
22
  "prepare": "npm run build"
19
23
  },
20
24
  "dependencies": {
21
- "axios": "^0.21.4"
25
+ "axios": "^1.6.1"
22
26
  },
23
27
  "devDependencies": {
24
28
  "@types/node": "^12.11.5",
25
- "typescript": "^3.6.4"
29
+ "typescript": "^4.0"
26
30
  }
27
31
  }
package/tsconfig.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "declaration": true,
4
- "target": "es5",
4
+ "target": "ES5",
5
5
  "module": "commonjs",
6
6
  "noImplicitAny": true,
7
7
  "outDir": "dist",