@teemill/countries 0.1.0 → 0.1.2

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.
Files changed (59) hide show
  1. package/README.md +40 -3
  2. package/api.ts +185 -0
  3. package/base.ts +86 -0
  4. package/common.ts +150 -0
  5. package/configuration.ts +115 -0
  6. package/dist/api.d.ts +121 -0
  7. package/dist/api.js +133 -0
  8. package/dist/base.d.ts +66 -0
  9. package/dist/base.js +65 -0
  10. package/dist/common.d.ts +65 -0
  11. package/dist/common.js +161 -0
  12. package/dist/configuration.d.ts +91 -0
  13. package/dist/configuration.js +44 -0
  14. package/dist/esm/api.d.ts +121 -0
  15. package/dist/esm/api.js +126 -0
  16. package/dist/esm/base.d.ts +66 -0
  17. package/dist/esm/base.js +60 -0
  18. package/dist/esm/common.d.ts +65 -0
  19. package/dist/esm/common.js +149 -0
  20. package/dist/esm/configuration.d.ts +91 -0
  21. package/dist/esm/configuration.js +40 -0
  22. package/dist/esm/index.d.ts +13 -0
  23. package/dist/esm/index.js +15 -0
  24. package/dist/index.d.ts +13 -3
  25. package/dist/index.js +15 -5
  26. package/docs/ApiError.md +22 -0
  27. package/docs/CountriesApi.md +55 -0
  28. package/docs/Country.md +22 -0
  29. package/docs/InlineObject.md +20 -0
  30. package/git_push.sh +57 -0
  31. package/index.ts +18 -0
  32. package/package.json +18 -4
  33. package/tsconfig.esm.json +7 -0
  34. package/tsconfig.json +4 -6
  35. package/.openapi-generator/FILES +0 -13
  36. package/.openapi-generator/VERSION +0 -1
  37. package/.openapi-generator-ignore +0 -23
  38. package/dist/apis/CountriesApi.d.ts +0 -28
  39. package/dist/apis/CountriesApi.js +0 -136
  40. package/dist/apis/index.d.ts +0 -1
  41. package/dist/apis/index.js +0 -19
  42. package/dist/models/ApiError.d.ts +0 -37
  43. package/dist/models/ApiError.js +0 -53
  44. package/dist/models/Country.d.ts +0 -37
  45. package/dist/models/Country.js +0 -53
  46. package/dist/models/GetCountries200Response.d.ts +0 -32
  47. package/dist/models/GetCountries200Response.js +0 -51
  48. package/dist/models/index.d.ts +0 -3
  49. package/dist/models/index.js +0 -21
  50. package/dist/runtime.d.ts +0 -187
  51. package/dist/runtime.js +0 -565
  52. package/src/apis/CountriesApi.ts +0 -77
  53. package/src/apis/index.ts +0 -3
  54. package/src/index.ts +0 -5
  55. package/src/models/ApiError.ts +0 -74
  56. package/src/models/Country.ts +0 -75
  57. package/src/models/GetCountries200Response.ts +0 -72
  58. package/src/models/index.ts +0 -5
  59. package/src/runtime.ts +0 -441
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Countries API
6
+ * Manage PodOS Countries
7
+ *
8
+ * The version of the OpenAPI document: 0.1.2
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.Configuration = void 0;
17
+ class Configuration {
18
+ constructor(param = {}) {
19
+ var _a;
20
+ this.apiKey = param.apiKey;
21
+ this.username = param.username;
22
+ this.password = param.password;
23
+ this.accessToken = param.accessToken;
24
+ this.basePath = param.basePath;
25
+ this.serverIndex = param.serverIndex;
26
+ this.baseOptions = Object.assign(Object.assign({}, param.baseOptions), { headers: Object.assign({}, (_a = param.baseOptions) === null || _a === void 0 ? void 0 : _a.headers) });
27
+ this.formDataCtor = param.formDataCtor;
28
+ }
29
+ /**
30
+ * Check if the given MIME is a JSON MIME.
31
+ * JSON MIME examples:
32
+ * application/json
33
+ * application/json; charset=UTF8
34
+ * APPLICATION/JSON
35
+ * application/vnd.company+json
36
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
37
+ * @return True if the given MIME is JSON, false otherwise.
38
+ */
39
+ isJsonMime(mime) {
40
+ const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
41
+ return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
42
+ }
43
+ }
44
+ exports.Configuration = Configuration;
@@ -0,0 +1,121 @@
1
+ /**
2
+ * Countries API
3
+ * Manage PodOS Countries
4
+ *
5
+ * The version of the OpenAPI document: 0.1.2
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import type { Configuration } from './configuration';
13
+ import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
14
+ import type { RequestArgs } from './base';
15
+ import { BaseAPI } from './base';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface ApiError
20
+ */
21
+ export interface ApiError {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof ApiError
26
+ */
27
+ 'code'?: string;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof ApiError
32
+ */
33
+ 'message': string;
34
+ }
35
+ /**
36
+ *
37
+ * @export
38
+ * @interface Country
39
+ */
40
+ export interface Country {
41
+ /**
42
+ * The unique identifier for the country
43
+ * @type {string}
44
+ * @memberof Country
45
+ */
46
+ 'id': string;
47
+ /**
48
+ * The name of the country
49
+ * @type {string}
50
+ * @memberof Country
51
+ */
52
+ 'name': string;
53
+ }
54
+ /**
55
+ *
56
+ * @export
57
+ * @interface InlineObject
58
+ */
59
+ export interface InlineObject {
60
+ /**
61
+ *
62
+ * @type {Array<Country>}
63
+ * @memberof InlineObject
64
+ */
65
+ 'countries'?: Array<Country>;
66
+ }
67
+ /**
68
+ * CountriesApi - axios parameter creator
69
+ * @export
70
+ */
71
+ export declare const CountriesApiAxiosParamCreator: (configuration?: Configuration) => {
72
+ /**
73
+ * List all countries
74
+ * @summary List countries
75
+ * @param {*} [options] Override http request option.
76
+ * @throws {RequiredError}
77
+ */
78
+ getCountries: (options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
79
+ };
80
+ /**
81
+ * CountriesApi - functional programming interface
82
+ * @export
83
+ */
84
+ export declare const CountriesApiFp: (configuration?: Configuration) => {
85
+ /**
86
+ * List all countries
87
+ * @summary List countries
88
+ * @param {*} [options] Override http request option.
89
+ * @throws {RequiredError}
90
+ */
91
+ getCountries(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<InlineObject>>;
92
+ };
93
+ /**
94
+ * CountriesApi - factory interface
95
+ * @export
96
+ */
97
+ export declare const CountriesApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
98
+ /**
99
+ * List all countries
100
+ * @summary List countries
101
+ * @param {*} [options] Override http request option.
102
+ * @throws {RequiredError}
103
+ */
104
+ getCountries(options?: RawAxiosRequestConfig): AxiosPromise<InlineObject>;
105
+ };
106
+ /**
107
+ * CountriesApi - object-oriented interface
108
+ * @export
109
+ * @class CountriesApi
110
+ * @extends {BaseAPI}
111
+ */
112
+ export declare class CountriesApi extends BaseAPI {
113
+ /**
114
+ * List all countries
115
+ * @summary List countries
116
+ * @param {*} [options] Override http request option.
117
+ * @throws {RequiredError}
118
+ * @memberof CountriesApi
119
+ */
120
+ getCountries(options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<InlineObject, any>>;
121
+ }
@@ -0,0 +1,126 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Countries API
5
+ * Manage PodOS Countries
6
+ *
7
+ * The version of the OpenAPI document: 0.1.2
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ import globalAxios from 'axios';
24
+ // Some imports not used depending on template conditions
25
+ // @ts-ignore
26
+ import { DUMMY_BASE_URL, setApiKeyToObject, setOAuthToObject, setSearchParams, toPathString, createRequestFunction } from './common';
27
+ // @ts-ignore
28
+ import { BASE_PATH, BaseAPI, operationServerMap } from './base';
29
+ /**
30
+ * CountriesApi - axios parameter creator
31
+ * @export
32
+ */
33
+ export const CountriesApiAxiosParamCreator = function (configuration) {
34
+ return {
35
+ /**
36
+ * List all countries
37
+ * @summary List countries
38
+ * @param {*} [options] Override http request option.
39
+ * @throws {RequiredError}
40
+ */
41
+ getCountries: (...args_1) => __awaiter(this, [...args_1], void 0, function* (options = {}) {
42
+ const localVarPath = `/v1/countries`;
43
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
44
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
45
+ let baseOptions;
46
+ if (configuration) {
47
+ baseOptions = configuration.baseOptions;
48
+ }
49
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
50
+ const localVarHeaderParameter = {};
51
+ const localVarQueryParameter = {};
52
+ // authentication session-oauth required
53
+ // oauth required
54
+ yield setOAuthToObject(localVarHeaderParameter, "session-oauth", [], configuration);
55
+ // authentication api-key required
56
+ yield setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
57
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
58
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
59
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
60
+ return {
61
+ url: toPathString(localVarUrlObj),
62
+ options: localVarRequestOptions,
63
+ };
64
+ }),
65
+ };
66
+ };
67
+ /**
68
+ * CountriesApi - functional programming interface
69
+ * @export
70
+ */
71
+ export const CountriesApiFp = function (configuration) {
72
+ const localVarAxiosParamCreator = CountriesApiAxiosParamCreator(configuration);
73
+ return {
74
+ /**
75
+ * List all countries
76
+ * @summary List countries
77
+ * @param {*} [options] Override http request option.
78
+ * @throws {RequiredError}
79
+ */
80
+ getCountries(options) {
81
+ return __awaiter(this, void 0, void 0, function* () {
82
+ var _a, _b, _c;
83
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getCountries(options);
84
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
85
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['CountriesApi.getCountries']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
86
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
87
+ });
88
+ },
89
+ };
90
+ };
91
+ /**
92
+ * CountriesApi - factory interface
93
+ * @export
94
+ */
95
+ export const CountriesApiFactory = function (configuration, basePath, axios) {
96
+ const localVarFp = CountriesApiFp(configuration);
97
+ return {
98
+ /**
99
+ * List all countries
100
+ * @summary List countries
101
+ * @param {*} [options] Override http request option.
102
+ * @throws {RequiredError}
103
+ */
104
+ getCountries(options) {
105
+ return localVarFp.getCountries(options).then((request) => request(axios, basePath));
106
+ },
107
+ };
108
+ };
109
+ /**
110
+ * CountriesApi - object-oriented interface
111
+ * @export
112
+ * @class CountriesApi
113
+ * @extends {BaseAPI}
114
+ */
115
+ export class CountriesApi extends BaseAPI {
116
+ /**
117
+ * List all countries
118
+ * @summary List countries
119
+ * @param {*} [options] Override http request option.
120
+ * @throws {RequiredError}
121
+ * @memberof CountriesApi
122
+ */
123
+ getCountries(options) {
124
+ return CountriesApiFp(this.configuration).getCountries(options).then((request) => request(this.axios, this.basePath));
125
+ }
126
+ }
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Countries API
3
+ * Manage PodOS Countries
4
+ *
5
+ * The version of the OpenAPI document: 0.1.2
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import type { Configuration } from './configuration';
13
+ import type { AxiosInstance, RawAxiosRequestConfig } from 'axios';
14
+ export declare const BASE_PATH: string;
15
+ /**
16
+ *
17
+ * @export
18
+ */
19
+ export declare const COLLECTION_FORMATS: {
20
+ csv: string;
21
+ ssv: string;
22
+ tsv: string;
23
+ pipes: string;
24
+ };
25
+ /**
26
+ *
27
+ * @export
28
+ * @interface RequestArgs
29
+ */
30
+ export interface RequestArgs {
31
+ url: string;
32
+ options: RawAxiosRequestConfig;
33
+ }
34
+ /**
35
+ *
36
+ * @export
37
+ * @class BaseAPI
38
+ */
39
+ export declare class BaseAPI {
40
+ protected basePath: string;
41
+ protected axios: AxiosInstance;
42
+ protected configuration: Configuration | undefined;
43
+ constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
44
+ }
45
+ /**
46
+ *
47
+ * @export
48
+ * @class RequiredError
49
+ * @extends {Error}
50
+ */
51
+ export declare class RequiredError extends Error {
52
+ field: string;
53
+ constructor(field: string, msg?: string);
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 {};
@@ -0,0 +1,60 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Countries API
5
+ * Manage PodOS Countries
6
+ *
7
+ * The version of the OpenAPI document: 0.1.2
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ import globalAxios from 'axios';
15
+ export const BASE_PATH = "https://localhost:8080".replace(/\/+$/, "");
16
+ /**
17
+ *
18
+ * @export
19
+ */
20
+ export const COLLECTION_FORMATS = {
21
+ csv: ",",
22
+ ssv: " ",
23
+ tsv: "\t",
24
+ pipes: "|",
25
+ };
26
+ /**
27
+ *
28
+ * @export
29
+ * @class BaseAPI
30
+ */
31
+ export class BaseAPI {
32
+ constructor(configuration, basePath = BASE_PATH, axios = globalAxios) {
33
+ var _a;
34
+ this.basePath = basePath;
35
+ this.axios = axios;
36
+ if (configuration) {
37
+ this.configuration = configuration;
38
+ this.basePath = (_a = configuration.basePath) !== null && _a !== void 0 ? _a : basePath;
39
+ }
40
+ }
41
+ }
42
+ ;
43
+ /**
44
+ *
45
+ * @export
46
+ * @class RequiredError
47
+ * @extends {Error}
48
+ */
49
+ export class RequiredError extends Error {
50
+ constructor(field, msg) {
51
+ super(msg);
52
+ this.field = field;
53
+ this.name = "RequiredError";
54
+ }
55
+ }
56
+ /**
57
+ *
58
+ * @export
59
+ */
60
+ export const operationServerMap = {};
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Countries API
3
+ * Manage PodOS Countries
4
+ *
5
+ * The version of the OpenAPI document: 0.1.2
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import type { Configuration } from "./configuration";
13
+ import type { RequestArgs } from "./base";
14
+ import type { AxiosInstance, AxiosResponse } from 'axios';
15
+ /**
16
+ *
17
+ * @export
18
+ */
19
+ export declare const DUMMY_BASE_URL = "https://example.com";
20
+ /**
21
+ *
22
+ * @throws {RequiredError}
23
+ * @export
24
+ */
25
+ export declare const assertParamExists: (functionName: string, paramName: string, paramValue: unknown) => void;
26
+ /**
27
+ *
28
+ * @export
29
+ */
30
+ export declare const setApiKeyToObject: (object: any, keyParamName: string, configuration?: Configuration) => Promise<void>;
31
+ /**
32
+ *
33
+ * @export
34
+ */
35
+ export declare const setBasicAuthToObject: (object: any, configuration?: Configuration) => void;
36
+ /**
37
+ *
38
+ * @export
39
+ */
40
+ export declare const setBearerAuthToObject: (object: any, configuration?: Configuration) => Promise<void>;
41
+ /**
42
+ *
43
+ * @export
44
+ */
45
+ export declare const setOAuthToObject: (object: any, name: string, scopes: string[], configuration?: Configuration) => Promise<void>;
46
+ /**
47
+ *
48
+ * @export
49
+ */
50
+ export declare const setSearchParams: (url: URL, ...objects: any[]) => void;
51
+ /**
52
+ *
53
+ * @export
54
+ */
55
+ export declare const serializeDataIfNeeded: (value: any, requestOptions: any, configuration?: Configuration) => any;
56
+ /**
57
+ *
58
+ * @export
59
+ */
60
+ export declare const toPathString: (url: URL) => string;
61
+ /**
62
+ *
63
+ * @export
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>;
@@ -0,0 +1,149 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Countries API
5
+ * Manage PodOS Countries
6
+ *
7
+ * The version of the OpenAPI document: 0.1.2
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ import { RequiredError } from "./base";
24
+ /**
25
+ *
26
+ * @export
27
+ */
28
+ export const DUMMY_BASE_URL = 'https://example.com';
29
+ /**
30
+ *
31
+ * @throws {RequiredError}
32
+ * @export
33
+ */
34
+ export const assertParamExists = function (functionName, paramName, paramValue) {
35
+ if (paramValue === null || paramValue === undefined) {
36
+ throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
37
+ }
38
+ };
39
+ /**
40
+ *
41
+ * @export
42
+ */
43
+ export const setApiKeyToObject = function (object, keyParamName, configuration) {
44
+ return __awaiter(this, void 0, void 0, function* () {
45
+ if (configuration && configuration.apiKey) {
46
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
47
+ ? yield configuration.apiKey(keyParamName)
48
+ : yield configuration.apiKey;
49
+ object[keyParamName] = localVarApiKeyValue;
50
+ }
51
+ });
52
+ };
53
+ /**
54
+ *
55
+ * @export
56
+ */
57
+ export const setBasicAuthToObject = function (object, configuration) {
58
+ if (configuration && (configuration.username || configuration.password)) {
59
+ object["auth"] = { username: configuration.username, password: configuration.password };
60
+ }
61
+ };
62
+ /**
63
+ *
64
+ * @export
65
+ */
66
+ export const setBearerAuthToObject = function (object, configuration) {
67
+ return __awaiter(this, void 0, void 0, function* () {
68
+ if (configuration && configuration.accessToken) {
69
+ const accessToken = typeof configuration.accessToken === 'function'
70
+ ? yield configuration.accessToken()
71
+ : yield configuration.accessToken;
72
+ object["Authorization"] = "Bearer " + accessToken;
73
+ }
74
+ });
75
+ };
76
+ /**
77
+ *
78
+ * @export
79
+ */
80
+ export const setOAuthToObject = function (object, name, scopes, configuration) {
81
+ return __awaiter(this, void 0, void 0, function* () {
82
+ if (configuration && configuration.accessToken) {
83
+ const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
84
+ ? yield configuration.accessToken(name, scopes)
85
+ : yield configuration.accessToken;
86
+ object["Authorization"] = "Bearer " + localVarAccessTokenValue;
87
+ }
88
+ });
89
+ };
90
+ function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
91
+ if (parameter == null)
92
+ return;
93
+ if (typeof parameter === "object") {
94
+ if (Array.isArray(parameter)) {
95
+ parameter.forEach(item => setFlattenedQueryParams(urlSearchParams, item, key !== '' ? `${key}[]` : key));
96
+ }
97
+ else {
98
+ Object.keys(parameter).forEach(currentKey => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`));
99
+ }
100
+ }
101
+ else {
102
+ if (urlSearchParams.has(key)) {
103
+ urlSearchParams.append(key, parameter);
104
+ }
105
+ else {
106
+ urlSearchParams.set(key, parameter);
107
+ }
108
+ }
109
+ }
110
+ /**
111
+ *
112
+ * @export
113
+ */
114
+ export const setSearchParams = function (url, ...objects) {
115
+ const searchParams = new URLSearchParams(url.search);
116
+ setFlattenedQueryParams(searchParams, objects);
117
+ url.search = decodeURIComponent(searchParams.toString());
118
+ };
119
+ /**
120
+ *
121
+ * @export
122
+ */
123
+ export const serializeDataIfNeeded = function (value, requestOptions, configuration) {
124
+ const nonString = typeof value !== 'string';
125
+ const needsSerialization = nonString && configuration && configuration.isJsonMime
126
+ ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
127
+ : nonString;
128
+ return needsSerialization
129
+ ? JSON.stringify(value !== undefined ? value : {})
130
+ : (value || "");
131
+ };
132
+ /**
133
+ *
134
+ * @export
135
+ */
136
+ export const toPathString = function (url) {
137
+ return url.pathname + url.search + url.hash;
138
+ };
139
+ /**
140
+ *
141
+ * @export
142
+ */
143
+ export const createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
144
+ return (axios = globalAxios, basePath = BASE_PATH) => {
145
+ var _a;
146
+ const axiosRequestArgs = Object.assign(Object.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 });
147
+ return axios.request(axiosRequestArgs);
148
+ };
149
+ };