@emilgroup/partner-sdk-node 1.4.0 → 1.5.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.
Files changed (56) hide show
  1. package/README.md +38 -5
  2. package/api/default-api.ts +4 -0
  3. package/api/partner-relations-api.ts +12 -8
  4. package/api/partner-tags-api.ts +12 -8
  5. package/api/partner-types-api.ts +8 -4
  6. package/api/partner-version-api.ts +8 -4
  7. package/api/partners-api.ts +12 -8
  8. package/api.ts +4 -0
  9. package/base.ts +94 -65
  10. package/common.ts +1 -0
  11. package/configuration.ts +8 -0
  12. package/dist/api/default-api.js +5 -1
  13. package/dist/api/partner-relations-api.d.ts +8 -8
  14. package/dist/api/partner-relations-api.js +17 -13
  15. package/dist/api/partner-tags-api.d.ts +8 -8
  16. package/dist/api/partner-tags-api.js +16 -12
  17. package/dist/api/partner-types-api.d.ts +4 -4
  18. package/dist/api/partner-types-api.js +13 -9
  19. package/dist/api/partner-version-api.d.ts +4 -4
  20. package/dist/api/partner-version-api.js +9 -5
  21. package/dist/api/partners-api.d.ts +8 -8
  22. package/dist/api/partners-api.js +17 -13
  23. package/dist/base.d.ts +11 -8
  24. package/dist/base.js +138 -47
  25. package/dist/common.d.ts +1 -0
  26. package/dist/common.js +2 -1
  27. package/dist/configuration.d.ts +7 -0
  28. package/dist/models/create-partner-type-response-class.d.ts +1 -1
  29. package/dist/models/get-partner-type-response-class.d.ts +1 -1
  30. package/dist/models/get-partner-version-response-class.d.ts +3 -3
  31. package/dist/models/list-partner-relation-class.d.ts +1 -1
  32. package/dist/models/list-partner-relation-types-class.d.ts +1 -1
  33. package/dist/models/list-partner-types-response-class.d.ts +1 -1
  34. package/dist/models/list-partner-versions-response-class.d.ts +7 -1
  35. package/dist/models/list-partners-response-class.d.ts +1 -1
  36. package/dist/models/partner-class.d.ts +12 -6
  37. package/dist/models/partner-relation-class.d.ts +12 -0
  38. package/dist/models/partner-relation-type-class.d.ts +12 -0
  39. package/dist/models/partner-type-class.d.ts +12 -0
  40. package/dist/models/tag-class.d.ts +12 -0
  41. package/dist/models/update-partner-type-response-class.d.ts +1 -1
  42. package/models/create-partner-type-response-class.ts +1 -1
  43. package/models/get-partner-type-response-class.ts +1 -1
  44. package/models/get-partner-version-response-class.ts +3 -3
  45. package/models/list-partner-relation-class.ts +1 -1
  46. package/models/list-partner-relation-types-class.ts +1 -1
  47. package/models/list-partner-types-response-class.ts +1 -1
  48. package/models/list-partner-versions-response-class.ts +7 -1
  49. package/models/list-partners-response-class.ts +1 -1
  50. package/models/partner-class.ts +12 -6
  51. package/models/partner-relation-class.ts +12 -0
  52. package/models/partner-relation-type-class.ts +12 -0
  53. package/models/partner-type-class.ts +12 -0
  54. package/models/tag-class.ts +12 -0
  55. package/models/update-partner-type-response-class.ts +1 -1
  56. package/package.json +5 -2
package/base.ts CHANGED
@@ -14,13 +14,20 @@
14
14
 
15
15
 
16
16
  import { Configuration } from "./configuration";
17
- import { defaultStorage } from "./common";
18
17
  // Some imports not used depending on template conditions
19
18
  // @ts-ignore
20
19
  import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
21
-
20
+ import * as fs from 'fs';
21
+ import * as path from 'path';
22
+ import * as os from 'os';
22
23
 
23
24
  export const BASE_PATH = "https://apiv2.emil.de".replace(/\/+$/, "");
25
+ const CONFIG_DIRECTORY = '.emil';
26
+ const CONFIG_FILENAME = 'credentials';
27
+ const KEY_USERNAME = 'emil_username';
28
+ const KEY_PASSWORD = 'emil_password';
29
+
30
+ const filePath = os.homedir() + path.sep + CONFIG_DIRECTORY + path.sep + CONFIG_FILENAME;
24
31
  /**
25
32
  *
26
33
  * @export
@@ -34,7 +41,7 @@ export const COLLECTION_FORMATS = {
34
41
 
35
42
  export interface LoginClass {
36
43
  accessToken: string;
37
- permissions: Array<string>;
44
+ permissions: string;
38
45
  }
39
46
 
40
47
  export enum Environment {
@@ -61,13 +68,7 @@ export interface RequestArgs {
61
68
  options: AxiosRequestConfig;
62
69
  }
63
70
 
64
- interface TokenData {
65
- accessToken?: string;
66
- username?: string;
67
- }
68
-
69
71
  const NETWORK_ERROR_MESSAGE = "Network Error";
70
- const TOKEN_DATA = 'APP_TOKEN';
71
72
 
72
73
  /**
73
74
  *
@@ -75,43 +76,82 @@ const TOKEN_DATA = 'APP_TOKEN';
75
76
  * @class BaseAPI
76
77
  */
77
78
  export class BaseAPI {
78
- protected configuration: Configuration | undefined;
79
- private tokenData?: TokenData;
80
- private permissions: Array<string> = [];
81
-
82
- constructor(configuration?: Configuration,
83
- protected basePath: string = BASE_PATH,
84
- protected axios: AxiosInstance = globalAxios) {
85
-
86
- this.loadTokenData();
79
+ protected configuration: Configuration;
80
+ private username?: string;
81
+ private password?: string;
82
+ private permissions?: string;
87
83
 
84
+ constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
88
85
  if (configuration) {
89
86
  this.configuration = configuration;
90
87
  this.basePath = configuration.basePath || this.basePath;
91
- this.configuration.accessToken = this.tokenData.accessToken ? `Bearer ${this.tokenData.accessToken}` : '';
92
88
  } else {
93
- const { accessToken, username } = this.tokenData;
94
-
95
89
  this.configuration = new Configuration({
96
90
  basePath: this.basePath,
97
- accessToken: accessToken ? `Bearer ${accessToken}` : '',
98
- username,
99
91
  });
100
92
  }
101
93
 
102
94
  this.attachInterceptor(axios);
103
95
  }
104
96
 
105
- selectEnvironment(env: Environment) {
106
- this.selectBasePath(env);
97
+ async initialize(env: Environment = Environment.Production) {
98
+ this.configuration.basePath = env;
99
+
100
+ await this.loadCredentials();
101
+
102
+ if (this.username) {
103
+ await this.authorize(this.username, this.password);
104
+ this.password = null; // to avoid keeping password loaded in memory.
105
+ }
107
106
  }
108
107
 
109
- selectBasePath(path: string) {
110
- this.configuration.basePath = path;
108
+ private async loadCredentials() {
109
+ try {
110
+ await this.readConfigFile();
111
+ } catch (error) {
112
+ console.warn(`No credentials file found. Check that ${filePath} exists.`);
113
+ }
114
+
115
+ this.readEnvVariables();
116
+
117
+ if (!this.username) {
118
+ console.info(`No credentials found in credentials file or environment variables. Either provide some or use
119
+ authorize() function.`);
120
+ }
121
+ }
122
+
123
+ private async readConfigFile() {
124
+ const file = await fs.promises.readFile(filePath, 'utf-8');
125
+
126
+ const lines = file.split(os.EOL)
127
+ .filter(Boolean);
128
+
129
+ lines.forEach((line: string) => {
130
+ if (line.startsWith(KEY_USERNAME)) {
131
+ this.username = line.length > KEY_USERNAME.length + 1 ? line.substring(KEY_USERNAME.length + 1) : '';
132
+ } else if (line.startsWith(KEY_PASSWORD)) {
133
+ this.password = line.length > KEY_PASSWORD.length + 1 ? line.substring(KEY_PASSWORD.length + 1) : '';
134
+ }
135
+ });
136
+ }
137
+
138
+ private readEnvVariables(): boolean {
139
+ if (process.env.EMIL_USERNAME) {
140
+ this.username = process.env.EMIL_USERNAME;
141
+ this.password = process.env.EMIL_PASSWORD || '';
142
+
143
+ return true;
144
+ }
145
+
146
+ return false;
147
+ }
148
+
149
+ selectEnvironment(env: Environment) {
150
+ this.configuration.basePath = env;
111
151
  }
112
152
 
113
153
  getPermissions(): Array<string> {
114
- return this.permissions;
154
+ return this.permissions.split(',');
115
155
  }
116
156
 
117
157
  async authorize(username: string, password: string): Promise<void> {
@@ -129,22 +169,19 @@ export class BaseAPI {
129
169
  const response = await globalAxios.request<LoginClass>(options);
130
170
 
131
171
  const { data: { accessToken, permissions } } = response;
132
-
133
172
  this.configuration.username = username;
134
173
  this.configuration.accessToken = `Bearer ${accessToken}`;
135
- this.tokenData.username = username;
136
- this.tokenData.accessToken = accessToken;
137
174
  this.permissions = permissions;
138
175
 
139
- this.storeTokenData({
140
- ...this.tokenData
141
- });
176
+ const refreshToken = this.extractRefreshToken(response)
177
+ this.configuration.refreshToken = refreshToken;
142
178
  }
143
179
 
144
180
  async refreshTokenInternal(): Promise<LoginClass> {
145
- const { username } = this.configuration;
181
+ const { username, refreshToken } = this.configuration;
182
+
146
183
 
147
- if (!username) {
184
+ if (!username || !refreshToken) {
148
185
  throw new Error('Failed to refresh token.');
149
186
  }
150
187
 
@@ -153,6 +190,7 @@ export class BaseAPI {
153
190
  url: `${this.configuration.basePath}/authservice/v1/refresh-token`,
154
191
  headers: {
155
192
  'Content-Type': 'application/json',
193
+ Cookie: refreshToken,
156
194
  },
157
195
  data: { username: username },
158
196
  withCredentials: true,
@@ -163,22 +201,18 @@ export class BaseAPI {
163
201
  return response.data;
164
202
  }
165
203
 
166
- private storeTokenData(tokenData?: TokenData) {
167
- if (typeof window !== 'undefined') {
168
- defaultStorage().set<TokenData>(TOKEN_DATA, tokenData);
169
- }
170
- }
204
+ private extractRefreshToken(response: AxiosResponse): string {
205
+ if (response.headers && response.headers['set-cookie']
206
+ && response.headers['set-cookie'].length > 0) {
171
207
 
172
- public loadTokenData() {
173
- if (typeof window !== 'undefined') {
174
- this.tokenData = defaultStorage().get<TokenData>(TOKEN_DATA) || {};
175
- } else {
176
- this.tokenData = {};
208
+ return `${response.headers['set-cookie'][0].split(';')[0]};`;
177
209
  }
210
+
211
+ return '';
178
212
  }
179
213
 
180
- public cleanTokenData() {
181
- this.storeTokenData(null);
214
+ getConfiguration(): Configuration {
215
+ return this.configuration;
182
216
  }
183
217
 
184
218
  private attachInterceptor(axios: AxiosInstance) {
@@ -188,26 +222,20 @@ export class BaseAPI {
188
222
  },
189
223
  async (err) => {
190
224
  let originalConfig = err.config;
191
- if (err.response && !(err.response instanceof XMLHttpRequest)) { // sometimes buggy and is of type request
225
+ if (err.response) {
192
226
  // Access Token was expired
193
- if ((err.response.status === 401 || err.response.status === 403)
194
- && !originalConfig._retry) {
227
+ if (err.response.status === 401 && !originalConfig._retry) {
195
228
  originalConfig._retry = true;
196
229
  try {
197
230
  const { accessToken: tokenString, permissions } = await this.refreshTokenInternal();
198
231
  const accessToken = `Bearer ${tokenString}`;
199
232
  this.permissions = permissions;
200
233
 
201
- delete originalConfig.headers['Authorization']
202
-
203
- originalConfig.headers['Authorization'] = accessToken;
234
+ originalConfig.headers['Authorization'] = `Bearer ${accessToken}`
204
235
 
205
236
  this.configuration.accessToken = accessToken;
206
- this.tokenData.accessToken = tokenString;
207
-
208
- this.storeTokenData(this.tokenData);
209
237
 
210
- return axios(originalConfig);
238
+ return axios.request(originalConfig);
211
239
  } catch (_error) {
212
240
  if (_error.response && _error.response.data) {
213
241
  return Promise.reject(_error.response.data);
@@ -215,10 +243,14 @@ export class BaseAPI {
215
243
  return Promise.reject(_error);
216
244
  }
217
245
  }
218
- } else if (err.message === NETWORK_ERROR_MESSAGE
246
+ if (err.response.status === 403 && err.response.data) {
247
+ return Promise.reject(err.response.data);
248
+ }
249
+ } else if(err.message === NETWORK_ERROR_MESSAGE
250
+ && err.isAxiosError
219
251
  && originalConfig.headers.hasOwnProperty('Authorization')
220
252
  && _retry_count < 4
221
- ) {
253
+ ){
222
254
  _retry_count++;
223
255
  try {
224
256
  const { accessToken: tokenString, permissions } = await this.refreshTokenInternal();
@@ -226,12 +258,9 @@ export class BaseAPI {
226
258
  this.permissions = permissions;
227
259
 
228
260
  _retry = true;
229
- originalConfig.headers['Authorization'] = accessToken;
261
+ originalConfig.headers['Authorization'] = accessToken;
230
262
 
231
263
  this.configuration.accessToken = accessToken;
232
- this.tokenData.accessToken = tokenString;
233
-
234
- this.storeTokenData(this.tokenData);
235
264
 
236
265
  return axios.request({
237
266
  ...originalConfig,
@@ -241,7 +270,7 @@ export class BaseAPI {
241
270
  return Promise.reject(_error.response.data);
242
271
  }
243
272
  return Promise.reject(_error);
244
- }
273
+ }
245
274
  }
246
275
  return Promise.reject(err);
247
276
  }
package/common.ts CHANGED
@@ -16,6 +16,7 @@
16
16
  import { Configuration } from "./configuration";
17
17
  import { RequiredError, RequestArgs } from "./base";
18
18
  import { AxiosInstance, AxiosResponse } from 'axios';
19
+ import { URL, URLSearchParams } from 'url';
19
20
  /**
20
21
  *
21
22
  * @export
package/configuration.ts CHANGED
@@ -74,6 +74,14 @@ export class Configuration {
74
74
  */
75
75
  formDataCtor?: new () => any;
76
76
 
77
+ /**
78
+ * parameter for automatically refreshing access token for oauth2 security
79
+ *
80
+ * @type {string}
81
+ * @memberof Configuration
82
+ */
83
+ refreshToken?: string;
84
+
77
85
  constructor(param: ConfigurationParameters = {}) {
78
86
  this.apiKey = param.apiKey;
79
87
  this.username = param.username;
@@ -85,6 +85,10 @@ var axios_1 = __importDefault(require("axios"));
85
85
  var common_1 = require("../common");
86
86
  // @ts-ignore
87
87
  var base_1 = require("../base");
88
+ // URLSearchParams not necessarily used
89
+ // @ts-ignore
90
+ var url_1 = require("url");
91
+ var FormData = require('form-data');
88
92
  /**
89
93
  * DefaultApi - axios parameter creator
90
94
  * @export
@@ -104,7 +108,7 @@ var DefaultApiAxiosParamCreator = function (configuration) {
104
108
  var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
105
109
  return __generator(this, function (_a) {
106
110
  localVarPath = "/partnerservice/health";
107
- localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
111
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
108
112
  if (configuration) {
109
113
  baseOptions = configuration.baseOptions;
110
114
  baseAccessToken = configuration.accessToken;
@@ -70,7 +70,7 @@ export declare const PartnerRelationsApiAxiosParamCreator: (configuration?: Conf
70
70
  * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality&lt;/i&gt;
71
71
  * @param {any} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
72
72
  * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, slug, maxCardinality, inverseMaxCardinality, createdAt, updatedAt&lt;/i&gt;
73
- * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: .&lt;i&gt;
73
+ * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: &lt;i&gt;
74
74
  * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality&lt;/i&gt;
75
75
  * @param {*} [options] Override http request option.
76
76
  * @throws {RequiredError}
@@ -85,7 +85,7 @@ export declare const PartnerRelationsApiAxiosParamCreator: (configuration?: Conf
85
85
  * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, partner1Id, partner2Id, partnerRelationTypeSlug, partnerRelationTypeId&lt;/i&gt;
86
86
  * @param {any} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
87
87
  * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, partnerRelationTypeId, startDate, endDate, createdAt, updatedAt&lt;/i&gt;
88
- * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: partnerRelationType.&lt;i&gt;
88
+ * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: partnerRelationType&lt;i&gt;
89
89
  * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, partner1Id, partner2Id, partnerRelationTypeSlug, partnerRelationTypeId&lt;/i&gt;
90
90
  * @param {*} [options] Override http request option.
91
91
  * @throws {RequiredError}
@@ -152,7 +152,7 @@ export declare const PartnerRelationsApiFp: (configuration?: Configuration) => {
152
152
  * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality&lt;/i&gt;
153
153
  * @param {any} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
154
154
  * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, slug, maxCardinality, inverseMaxCardinality, createdAt, updatedAt&lt;/i&gt;
155
- * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: .&lt;i&gt;
155
+ * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: &lt;i&gt;
156
156
  * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality&lt;/i&gt;
157
157
  * @param {*} [options] Override http request option.
158
158
  * @throws {RequiredError}
@@ -167,7 +167,7 @@ export declare const PartnerRelationsApiFp: (configuration?: Configuration) => {
167
167
  * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, partner1Id, partner2Id, partnerRelationTypeSlug, partnerRelationTypeId&lt;/i&gt;
168
168
  * @param {any} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
169
169
  * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, partnerRelationTypeId, startDate, endDate, createdAt, updatedAt&lt;/i&gt;
170
- * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: partnerRelationType.&lt;i&gt;
170
+ * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: partnerRelationType&lt;i&gt;
171
171
  * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, partner1Id, partner2Id, partnerRelationTypeSlug, partnerRelationTypeId&lt;/i&gt;
172
172
  * @param {*} [options] Override http request option.
173
173
  * @throws {RequiredError}
@@ -234,7 +234,7 @@ export declare const PartnerRelationsApiFactory: (configuration?: Configuration,
234
234
  * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality&lt;/i&gt;
235
235
  * @param {any} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
236
236
  * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, slug, maxCardinality, inverseMaxCardinality, createdAt, updatedAt&lt;/i&gt;
237
- * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: .&lt;i&gt;
237
+ * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: &lt;i&gt;
238
238
  * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality&lt;/i&gt;
239
239
  * @param {*} [options] Override http request option.
240
240
  * @throws {RequiredError}
@@ -249,7 +249,7 @@ export declare const PartnerRelationsApiFactory: (configuration?: Configuration,
249
249
  * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, partner1Id, partner2Id, partnerRelationTypeSlug, partnerRelationTypeId&lt;/i&gt;
250
250
  * @param {any} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
251
251
  * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, partnerRelationTypeId, startDate, endDate, createdAt, updatedAt&lt;/i&gt;
252
- * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: partnerRelationType.&lt;i&gt;
252
+ * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: partnerRelationType&lt;i&gt;
253
253
  * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, partner1Id, partner2Id, partnerRelationTypeSlug, partnerRelationTypeId&lt;/i&gt;
254
254
  * @param {*} [options] Override http request option.
255
255
  * @throws {RequiredError}
@@ -385,7 +385,7 @@ export interface PartnerRelationsApiListPartnerRelationTypesRequest {
385
385
  */
386
386
  readonly order?: string;
387
387
  /**
388
- * Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: .&lt;i&gt;
388
+ * Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: &lt;i&gt;
389
389
  * @type {string}
390
390
  * @memberof PartnerRelationsApiListPartnerRelationTypes
391
391
  */
@@ -440,7 +440,7 @@ export interface PartnerRelationsApiListPartnerRelationsRequest {
440
440
  */
441
441
  readonly order?: string;
442
442
  /**
443
- * Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: partnerRelationType.&lt;i&gt;
443
+ * Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: partnerRelationType&lt;i&gt;
444
444
  * @type {string}
445
445
  * @memberof PartnerRelationsApiListPartnerRelations
446
446
  */
@@ -85,6 +85,10 @@ var axios_1 = __importDefault(require("axios"));
85
85
  var common_1 = require("../common");
86
86
  // @ts-ignore
87
87
  var base_1 = require("../base");
88
+ // URLSearchParams not necessarily used
89
+ // @ts-ignore
90
+ var url_1 = require("url");
91
+ var FormData = require('form-data');
88
92
  /**
89
93
  * PartnerRelationsApi - axios parameter creator
90
94
  * @export
@@ -110,7 +114,7 @@ var PartnerRelationsApiAxiosParamCreator = function (configuration) {
110
114
  // verify required parameter 'createPartnerRelationRequestDtoRest' is not null or undefined
111
115
  (0, common_1.assertParamExists)('createPartnerRelation', 'createPartnerRelationRequestDtoRest', createPartnerRelationRequestDtoRest);
112
116
  localVarPath = "/partnerservice/v1/partners/relations";
113
- localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
117
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
114
118
  if (configuration) {
115
119
  baseOptions = configuration.baseOptions;
116
120
  baseAccessToken = configuration.accessToken;
@@ -160,7 +164,7 @@ var PartnerRelationsApiAxiosParamCreator = function (configuration) {
160
164
  (0, common_1.assertParamExists)('deletePartnerRelation', 'id', id);
161
165
  localVarPath = "/partnerservice/v1/partners/relations/{id}"
162
166
  .replace("{".concat("id", "}"), encodeURIComponent(String(id)));
163
- localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
167
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
164
168
  if (configuration) {
165
169
  baseOptions = configuration.baseOptions;
166
170
  baseAccessToken = configuration.accessToken;
@@ -208,7 +212,7 @@ var PartnerRelationsApiAxiosParamCreator = function (configuration) {
208
212
  (0, common_1.assertParamExists)('getPartnerRelation', 'id', id);
209
213
  localVarPath = "/partnerservice/v1/partners/relations/{id}"
210
214
  .replace("{".concat("id", "}"), encodeURIComponent(String(id)));
211
- localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
215
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
212
216
  if (configuration) {
213
217
  baseOptions = configuration.baseOptions;
214
218
  baseAccessToken = configuration.accessToken;
@@ -256,7 +260,7 @@ var PartnerRelationsApiAxiosParamCreator = function (configuration) {
256
260
  (0, common_1.assertParamExists)('getPartnerRelationType', 'slug', slug);
257
261
  localVarPath = "/partnerservice/v1/partners/relations/types/{slug}"
258
262
  .replace("{".concat("slug", "}"), encodeURIComponent(String(slug)));
259
- localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
263
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
260
264
  if (configuration) {
261
265
  baseOptions = configuration.baseOptions;
262
266
  baseAccessToken = configuration.accessToken;
@@ -294,7 +298,7 @@ var PartnerRelationsApiAxiosParamCreator = function (configuration) {
294
298
  * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality&lt;/i&gt;
295
299
  * @param {any} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
296
300
  * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, slug, maxCardinality, inverseMaxCardinality, createdAt, updatedAt&lt;/i&gt;
297
- * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: .&lt;i&gt;
301
+ * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: &lt;i&gt;
298
302
  * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality&lt;/i&gt;
299
303
  * @param {*} [options] Override http request option.
300
304
  * @throws {RequiredError}
@@ -307,7 +311,7 @@ var PartnerRelationsApiAxiosParamCreator = function (configuration) {
307
311
  switch (_a.label) {
308
312
  case 0:
309
313
  localVarPath = "/partnerservice/v1/partners/relations/types";
310
- localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
314
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
311
315
  if (configuration) {
312
316
  baseOptions = configuration.baseOptions;
313
317
  baseAccessToken = configuration.accessToken;
@@ -366,7 +370,7 @@ var PartnerRelationsApiAxiosParamCreator = function (configuration) {
366
370
  * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, partner1Id, partner2Id, partnerRelationTypeSlug, partnerRelationTypeId&lt;/i&gt;
367
371
  * @param {any} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
368
372
  * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, partnerRelationTypeId, startDate, endDate, createdAt, updatedAt&lt;/i&gt;
369
- * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: partnerRelationType.&lt;i&gt;
373
+ * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: partnerRelationType&lt;i&gt;
370
374
  * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, partner1Id, partner2Id, partnerRelationTypeSlug, partnerRelationTypeId&lt;/i&gt;
371
375
  * @param {*} [options] Override http request option.
372
376
  * @throws {RequiredError}
@@ -379,7 +383,7 @@ var PartnerRelationsApiAxiosParamCreator = function (configuration) {
379
383
  switch (_a.label) {
380
384
  case 0:
381
385
  localVarPath = "/partnerservice/v1/partners/relations";
382
- localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
386
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
383
387
  if (configuration) {
384
388
  baseOptions = configuration.baseOptions;
385
389
  baseAccessToken = configuration.accessToken;
@@ -451,7 +455,7 @@ var PartnerRelationsApiAxiosParamCreator = function (configuration) {
451
455
  (0, common_1.assertParamExists)('updatePartnerRelation', 'updatePartnerRelationRequestDtoRest', updatePartnerRelationRequestDtoRest);
452
456
  localVarPath = "/partnerservice/v1/partners/relations/{id}"
453
457
  .replace("{".concat("id", "}"), encodeURIComponent(String(id)));
454
- localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
458
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
455
459
  if (configuration) {
456
460
  baseOptions = configuration.baseOptions;
457
461
  baseAccessToken = configuration.accessToken;
@@ -585,7 +589,7 @@ var PartnerRelationsApiFp = function (configuration) {
585
589
  * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality&lt;/i&gt;
586
590
  * @param {any} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
587
591
  * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, slug, maxCardinality, inverseMaxCardinality, createdAt, updatedAt&lt;/i&gt;
588
- * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: .&lt;i&gt;
592
+ * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: &lt;i&gt;
589
593
  * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality&lt;/i&gt;
590
594
  * @param {*} [options] Override http request option.
591
595
  * @throws {RequiredError}
@@ -612,7 +616,7 @@ var PartnerRelationsApiFp = function (configuration) {
612
616
  * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, partner1Id, partner2Id, partnerRelationTypeSlug, partnerRelationTypeId&lt;/i&gt;
613
617
  * @param {any} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
614
618
  * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, partnerRelationTypeId, startDate, endDate, createdAt, updatedAt&lt;/i&gt;
615
- * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: partnerRelationType.&lt;i&gt;
619
+ * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: partnerRelationType&lt;i&gt;
616
620
  * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, partner1Id, partner2Id, partnerRelationTypeSlug, partnerRelationTypeId&lt;/i&gt;
617
621
  * @param {*} [options] Override http request option.
618
622
  * @throws {RequiredError}
@@ -715,7 +719,7 @@ var PartnerRelationsApiFactory = function (configuration, basePath, axios) {
715
719
  * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality&lt;/i&gt;
716
720
  * @param {any} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
717
721
  * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, slug, maxCardinality, inverseMaxCardinality, createdAt, updatedAt&lt;/i&gt;
718
- * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: .&lt;i&gt;
722
+ * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: &lt;i&gt;
719
723
  * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality&lt;/i&gt;
720
724
  * @param {*} [options] Override http request option.
721
725
  * @throws {RequiredError}
@@ -732,7 +736,7 @@ var PartnerRelationsApiFactory = function (configuration, basePath, axios) {
732
736
  * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, partner1Id, partner2Id, partnerRelationTypeSlug, partnerRelationTypeId&lt;/i&gt;
733
737
  * @param {any} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
734
738
  * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, partnerRelationTypeId, startDate, endDate, createdAt, updatedAt&lt;/i&gt;
735
- * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: partnerRelationType.&lt;i&gt;
739
+ * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: partnerRelationType&lt;i&gt;
736
740
  * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, partner1Id, partner2Id, partnerRelationTypeSlug, partnerRelationTypeId&lt;/i&gt;
737
741
  * @param {*} [options] Override http request option.
738
742
  * @throws {RequiredError}