@emilgroup/partner-sdk-node 1.9.0 → 1.9.1-beta.1
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/README.md +2 -2
- package/api/partner-relations-api.ts +8 -8
- package/base.ts +7 -15
- package/dist/api/partner-relations-api.d.ts +8 -8
- package/dist/api/partner-relations-api.js +6 -6
- package/dist/base.d.ts +1 -3
- package/dist/base.js +20 -26
- package/dist/models/create-partner-relation-request-dto-rest.d.ts +3 -3
- package/dist/models/partner-relation-class.d.ts +20 -0
- package/models/create-partner-relation-request-dto-rest.ts +3 -3
- package/models/partner-relation-class.ts +20 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,11 +17,11 @@ Although this package can be used in both TypeScript and JavaScript, it is inten
|
|
|
17
17
|
Navigate to the folder of your consuming project and run one of the following commands:
|
|
18
18
|
|
|
19
19
|
```
|
|
20
|
-
npm install @emilgroup/partner-sdk-node@1.9.
|
|
20
|
+
npm install @emilgroup/partner-sdk-node@1.9.1-beta.1 --save
|
|
21
21
|
```
|
|
22
22
|
or
|
|
23
23
|
```
|
|
24
|
-
yarn add @emilgroup/partner-sdk-node@1.9.
|
|
24
|
+
yarn add @emilgroup/partner-sdk-node@1.9.1-beta.1
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
And then you can import `PartnersApi`.
|
|
@@ -234,11 +234,11 @@ export const PartnerRelationsApiAxiosParamCreator = function (configuration?: Co
|
|
|
234
234
|
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
235
235
|
* @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
236
236
|
* @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
|
|
237
|
-
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality</i>
|
|
237
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality, partnerName</i>
|
|
238
238
|
* @param {any} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
239
239
|
* @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.<br/> <br/> <i>Allowed values: id, slug, maxCardinality, inverseMaxCardinality, createdAt, updatedAt</i>
|
|
240
240
|
* @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.<br/> <br/> <i>Allowed values: <i>
|
|
241
|
-
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality</i>
|
|
241
|
+
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality, partnerName</i>
|
|
242
242
|
* @param {*} [options] Override http request option.
|
|
243
243
|
* @throws {RequiredError}
|
|
244
244
|
*/
|
|
@@ -495,11 +495,11 @@ export const PartnerRelationsApiFp = function(configuration?: Configuration) {
|
|
|
495
495
|
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
496
496
|
* @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
497
497
|
* @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
|
|
498
|
-
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality</i>
|
|
498
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality, partnerName</i>
|
|
499
499
|
* @param {any} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
500
500
|
* @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.<br/> <br/> <i>Allowed values: id, slug, maxCardinality, inverseMaxCardinality, createdAt, updatedAt</i>
|
|
501
501
|
* @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.<br/> <br/> <i>Allowed values: <i>
|
|
502
|
-
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality</i>
|
|
502
|
+
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality, partnerName</i>
|
|
503
503
|
* @param {*} [options] Override http request option.
|
|
504
504
|
* @throws {RequiredError}
|
|
505
505
|
*/
|
|
@@ -598,11 +598,11 @@ export const PartnerRelationsApiFactory = function (configuration?: Configuratio
|
|
|
598
598
|
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
599
599
|
* @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
600
600
|
* @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
|
|
601
|
-
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality</i>
|
|
601
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality, partnerName</i>
|
|
602
602
|
* @param {any} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
603
603
|
* @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.<br/> <br/> <i>Allowed values: id, slug, maxCardinality, inverseMaxCardinality, createdAt, updatedAt</i>
|
|
604
604
|
* @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.<br/> <br/> <i>Allowed values: <i>
|
|
605
|
-
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality</i>
|
|
605
|
+
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality, partnerName</i>
|
|
606
606
|
* @param {*} [options] Override http request option.
|
|
607
607
|
* @throws {RequiredError}
|
|
608
608
|
*/
|
|
@@ -753,7 +753,7 @@ export interface PartnerRelationsApiListPartnerRelationTypesRequest {
|
|
|
753
753
|
readonly pageToken?: any
|
|
754
754
|
|
|
755
755
|
/**
|
|
756
|
-
* Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality</i>
|
|
756
|
+
* Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality, partnerName</i>
|
|
757
757
|
* @type {string}
|
|
758
758
|
* @memberof PartnerRelationsApiListPartnerRelationTypes
|
|
759
759
|
*/
|
|
@@ -781,7 +781,7 @@ export interface PartnerRelationsApiListPartnerRelationTypesRequest {
|
|
|
781
781
|
readonly expand?: string
|
|
782
782
|
|
|
783
783
|
/**
|
|
784
|
-
* Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality</i>
|
|
784
|
+
* Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality, partnerName</i>
|
|
785
785
|
* @type {string}
|
|
786
786
|
* @memberof PartnerRelationsApiListPartnerRelationTypes
|
|
787
787
|
*/
|
package/base.ts
CHANGED
|
@@ -79,7 +79,6 @@ export class BaseAPI {
|
|
|
79
79
|
protected configuration: Configuration;
|
|
80
80
|
private username?: string;
|
|
81
81
|
private password?: string;
|
|
82
|
-
private permissions?: string;
|
|
83
82
|
|
|
84
83
|
constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
|
|
85
84
|
if (configuration) {
|
|
@@ -150,10 +149,6 @@ export class BaseAPI {
|
|
|
150
149
|
this.configuration.basePath = env;
|
|
151
150
|
}
|
|
152
151
|
|
|
153
|
-
getPermissions(): Array<string> {
|
|
154
|
-
return this.permissions.split(',');
|
|
155
|
-
}
|
|
156
|
-
|
|
157
152
|
async authorize(username: string, password: string): Promise<void> {
|
|
158
153
|
const options: AxiosRequestConfig = {
|
|
159
154
|
method: 'POST',
|
|
@@ -168,21 +163,20 @@ export class BaseAPI {
|
|
|
168
163
|
|
|
169
164
|
const response = await globalAxios.request<LoginClass>(options);
|
|
170
165
|
|
|
171
|
-
const { data: { accessToken
|
|
166
|
+
const { data: { accessToken } } = response;
|
|
172
167
|
this.configuration.username = username;
|
|
173
168
|
this.configuration.accessToken = `Bearer ${accessToken}`;
|
|
174
|
-
this.permissions = permissions;
|
|
175
169
|
|
|
176
170
|
const refreshToken = this.extractRefreshToken(response)
|
|
177
171
|
this.configuration.refreshToken = refreshToken;
|
|
178
172
|
}
|
|
179
173
|
|
|
180
|
-
async refreshTokenInternal(): Promise<
|
|
174
|
+
async refreshTokenInternal(): Promise<string> {
|
|
181
175
|
const { username, refreshToken } = this.configuration;
|
|
182
176
|
|
|
183
177
|
|
|
184
178
|
if (!username || !refreshToken) {
|
|
185
|
-
|
|
179
|
+
return '';
|
|
186
180
|
}
|
|
187
181
|
|
|
188
182
|
const options: AxiosRequestConfig = {
|
|
@@ -196,9 +190,9 @@ export class BaseAPI {
|
|
|
196
190
|
withCredentials: true,
|
|
197
191
|
};
|
|
198
192
|
|
|
199
|
-
const
|
|
193
|
+
const { data: { accessToken } } = await globalAxios.request<LoginClass>(options);
|
|
200
194
|
|
|
201
|
-
return
|
|
195
|
+
return accessToken;
|
|
202
196
|
}
|
|
203
197
|
|
|
204
198
|
private extractRefreshToken(response: AxiosResponse): string {
|
|
@@ -227,9 +221,8 @@ export class BaseAPI {
|
|
|
227
221
|
if (err.response.status === 401 && !originalConfig._retry) {
|
|
228
222
|
originalConfig._retry = true;
|
|
229
223
|
try {
|
|
230
|
-
const
|
|
224
|
+
const tokenString = await this.refreshTokenInternal();
|
|
231
225
|
const accessToken = `Bearer ${tokenString}`;
|
|
232
|
-
this.permissions = permissions;
|
|
233
226
|
|
|
234
227
|
originalConfig.headers['Authorization'] = `Bearer ${accessToken}`
|
|
235
228
|
|
|
@@ -253,9 +246,8 @@ export class BaseAPI {
|
|
|
253
246
|
){
|
|
254
247
|
_retry_count++;
|
|
255
248
|
try {
|
|
256
|
-
const
|
|
249
|
+
const tokenString = await this.refreshTokenInternal();
|
|
257
250
|
const accessToken = `Bearer ${tokenString}`;
|
|
258
|
-
this.permissions = permissions;
|
|
259
251
|
|
|
260
252
|
_retry = true;
|
|
261
253
|
originalConfig.headers['Authorization'] = accessToken;
|
|
@@ -67,11 +67,11 @@ export declare const PartnerRelationsApiAxiosParamCreator: (configuration?: Conf
|
|
|
67
67
|
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
68
68
|
* @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
69
69
|
* @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
|
|
70
|
-
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality</i>
|
|
70
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality, partnerName</i>
|
|
71
71
|
* @param {any} [search] To search the list by any field, pass search=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.<br/> <br/> <i>Allowed values: id, slug, maxCardinality, inverseMaxCardinality, createdAt, updatedAt</i>
|
|
73
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.<br/> <br/> <i>Allowed values: <i>
|
|
74
|
-
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality</i>
|
|
74
|
+
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality, partnerName</i>
|
|
75
75
|
* @param {*} [options] Override http request option.
|
|
76
76
|
* @throws {RequiredError}
|
|
77
77
|
*/
|
|
@@ -149,11 +149,11 @@ export declare const PartnerRelationsApiFp: (configuration?: Configuration) => {
|
|
|
149
149
|
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
150
150
|
* @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
151
151
|
* @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
|
|
152
|
-
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality</i>
|
|
152
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality, partnerName</i>
|
|
153
153
|
* @param {any} [search] To search the list by any field, pass search=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.<br/> <br/> <i>Allowed values: id, slug, maxCardinality, inverseMaxCardinality, createdAt, updatedAt</i>
|
|
155
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.<br/> <br/> <i>Allowed values: <i>
|
|
156
|
-
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality</i>
|
|
156
|
+
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality, partnerName</i>
|
|
157
157
|
* @param {*} [options] Override http request option.
|
|
158
158
|
* @throws {RequiredError}
|
|
159
159
|
*/
|
|
@@ -231,11 +231,11 @@ export declare const PartnerRelationsApiFactory: (configuration?: Configuration,
|
|
|
231
231
|
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
232
232
|
* @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
233
233
|
* @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
|
|
234
|
-
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality</i>
|
|
234
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality, partnerName</i>
|
|
235
235
|
* @param {any} [search] To search the list by any field, pass search=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.<br/> <br/> <i>Allowed values: id, slug, maxCardinality, inverseMaxCardinality, createdAt, updatedAt</i>
|
|
237
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.<br/> <br/> <i>Allowed values: <i>
|
|
238
|
-
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality</i>
|
|
238
|
+
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality, partnerName</i>
|
|
239
239
|
* @param {*} [options] Override http request option.
|
|
240
240
|
* @throws {RequiredError}
|
|
241
241
|
*/
|
|
@@ -367,7 +367,7 @@ export interface PartnerRelationsApiListPartnerRelationTypesRequest {
|
|
|
367
367
|
*/
|
|
368
368
|
readonly pageToken?: any;
|
|
369
369
|
/**
|
|
370
|
-
* Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality</i>
|
|
370
|
+
* Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality, partnerName</i>
|
|
371
371
|
* @type {string}
|
|
372
372
|
* @memberof PartnerRelationsApiListPartnerRelationTypes
|
|
373
373
|
*/
|
|
@@ -391,7 +391,7 @@ export interface PartnerRelationsApiListPartnerRelationTypesRequest {
|
|
|
391
391
|
*/
|
|
392
392
|
readonly expand?: string;
|
|
393
393
|
/**
|
|
394
|
-
* Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality</i>
|
|
394
|
+
* Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality, partnerName</i>
|
|
395
395
|
* @type {string}
|
|
396
396
|
* @memberof PartnerRelationsApiListPartnerRelationTypes
|
|
397
397
|
*/
|
|
@@ -295,11 +295,11 @@ var PartnerRelationsApiAxiosParamCreator = function (configuration) {
|
|
|
295
295
|
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
296
296
|
* @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
297
297
|
* @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
|
|
298
|
-
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality</i>
|
|
298
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality, partnerName</i>
|
|
299
299
|
* @param {any} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
300
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.<br/> <br/> <i>Allowed values: id, slug, maxCardinality, inverseMaxCardinality, createdAt, updatedAt</i>
|
|
301
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.<br/> <br/> <i>Allowed values: <i>
|
|
302
|
-
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality</i>
|
|
302
|
+
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality, partnerName</i>
|
|
303
303
|
* @param {*} [options] Override http request option.
|
|
304
304
|
* @throws {RequiredError}
|
|
305
305
|
*/
|
|
@@ -586,11 +586,11 @@ var PartnerRelationsApiFp = function (configuration) {
|
|
|
586
586
|
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
587
587
|
* @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
588
588
|
* @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
|
|
589
|
-
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality</i>
|
|
589
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality, partnerName</i>
|
|
590
590
|
* @param {any} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
591
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.<br/> <br/> <i>Allowed values: id, slug, maxCardinality, inverseMaxCardinality, createdAt, updatedAt</i>
|
|
592
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.<br/> <br/> <i>Allowed values: <i>
|
|
593
|
-
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality</i>
|
|
593
|
+
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality, partnerName</i>
|
|
594
594
|
* @param {*} [options] Override http request option.
|
|
595
595
|
* @throws {RequiredError}
|
|
596
596
|
*/
|
|
@@ -716,11 +716,11 @@ var PartnerRelationsApiFactory = function (configuration, basePath, axios) {
|
|
|
716
716
|
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
717
717
|
* @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
718
718
|
* @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
|
|
719
|
-
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality</i>
|
|
719
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality, partnerName</i>
|
|
720
720
|
* @param {any} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
721
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.<br/> <br/> <i>Allowed values: id, slug, maxCardinality, inverseMaxCardinality, createdAt, updatedAt</i>
|
|
722
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.<br/> <br/> <i>Allowed values: <i>
|
|
723
|
-
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality</i>
|
|
723
|
+
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: id, slug, relationName, maxCardinality, inverseMaxCardinality, partnerName</i>
|
|
724
724
|
* @param {*} [options] Override http request option.
|
|
725
725
|
* @throws {RequiredError}
|
|
726
726
|
*/
|
package/dist/base.d.ts
CHANGED
|
@@ -53,16 +53,14 @@ export declare class BaseAPI {
|
|
|
53
53
|
protected configuration: Configuration;
|
|
54
54
|
private username?;
|
|
55
55
|
private password?;
|
|
56
|
-
private permissions?;
|
|
57
56
|
constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
|
|
58
57
|
initialize(env?: Environment): Promise<void>;
|
|
59
58
|
private loadCredentials;
|
|
60
59
|
private readConfigFile;
|
|
61
60
|
private readEnvVariables;
|
|
62
61
|
selectEnvironment(env: Environment): void;
|
|
63
|
-
getPermissions(): Array<string>;
|
|
64
62
|
authorize(username: string, password: string): Promise<void>;
|
|
65
|
-
refreshTokenInternal(): Promise<
|
|
63
|
+
refreshTokenInternal(): Promise<string>;
|
|
66
64
|
private extractRefreshToken;
|
|
67
65
|
getConfiguration(): Configuration;
|
|
68
66
|
private attachInterceptor;
|
package/dist/base.js
CHANGED
|
@@ -242,14 +242,11 @@ var BaseAPI = /** @class */ (function () {
|
|
|
242
242
|
BaseAPI.prototype.selectEnvironment = function (env) {
|
|
243
243
|
this.configuration.basePath = env;
|
|
244
244
|
};
|
|
245
|
-
BaseAPI.prototype.getPermissions = function () {
|
|
246
|
-
return this.permissions.split(',');
|
|
247
|
-
};
|
|
248
245
|
BaseAPI.prototype.authorize = function (username, password) {
|
|
249
246
|
return __awaiter(this, void 0, void 0, function () {
|
|
250
|
-
var options, response,
|
|
251
|
-
return __generator(this, function (
|
|
252
|
-
switch (
|
|
247
|
+
var options, response, accessToken, refreshToken;
|
|
248
|
+
return __generator(this, function (_a) {
|
|
249
|
+
switch (_a.label) {
|
|
253
250
|
case 0:
|
|
254
251
|
options = {
|
|
255
252
|
method: 'POST',
|
|
@@ -263,11 +260,10 @@ var BaseAPI = /** @class */ (function () {
|
|
|
263
260
|
};
|
|
264
261
|
return [4 /*yield*/, axios_1.default.request(options)];
|
|
265
262
|
case 1:
|
|
266
|
-
response =
|
|
267
|
-
|
|
263
|
+
response = _a.sent();
|
|
264
|
+
accessToken = response.data.accessToken;
|
|
268
265
|
this.configuration.username = username;
|
|
269
266
|
this.configuration.accessToken = "Bearer ".concat(accessToken);
|
|
270
|
-
this.permissions = permissions;
|
|
271
267
|
refreshToken = this.extractRefreshToken(response);
|
|
272
268
|
this.configuration.refreshToken = refreshToken;
|
|
273
269
|
return [2 /*return*/];
|
|
@@ -277,13 +273,13 @@ var BaseAPI = /** @class */ (function () {
|
|
|
277
273
|
};
|
|
278
274
|
BaseAPI.prototype.refreshTokenInternal = function () {
|
|
279
275
|
return __awaiter(this, void 0, void 0, function () {
|
|
280
|
-
var _a, username, refreshToken, options,
|
|
276
|
+
var _a, username, refreshToken, options, accessToken;
|
|
281
277
|
return __generator(this, function (_b) {
|
|
282
278
|
switch (_b.label) {
|
|
283
279
|
case 0:
|
|
284
280
|
_a = this.configuration, username = _a.username, refreshToken = _a.refreshToken;
|
|
285
281
|
if (!username || !refreshToken) {
|
|
286
|
-
|
|
282
|
+
return [2 /*return*/, ''];
|
|
287
283
|
}
|
|
288
284
|
options = {
|
|
289
285
|
method: 'POST',
|
|
@@ -297,8 +293,8 @@ var BaseAPI = /** @class */ (function () {
|
|
|
297
293
|
};
|
|
298
294
|
return [4 /*yield*/, axios_1.default.request(options)];
|
|
299
295
|
case 1:
|
|
300
|
-
|
|
301
|
-
return [2 /*return*/,
|
|
296
|
+
accessToken = (_b.sent()).data.accessToken;
|
|
297
|
+
return [2 /*return*/, accessToken];
|
|
302
298
|
}
|
|
303
299
|
});
|
|
304
300
|
});
|
|
@@ -318,27 +314,26 @@ var BaseAPI = /** @class */ (function () {
|
|
|
318
314
|
axios.interceptors.response.use(function (res) {
|
|
319
315
|
return res;
|
|
320
316
|
}, function (err) { return __awaiter(_this, void 0, void 0, function () {
|
|
321
|
-
var originalConfig,
|
|
322
|
-
return __generator(this, function (
|
|
323
|
-
switch (
|
|
317
|
+
var originalConfig, tokenString, accessToken, _error_1, tokenString, accessToken, _error_2;
|
|
318
|
+
return __generator(this, function (_a) {
|
|
319
|
+
switch (_a.label) {
|
|
324
320
|
case 0:
|
|
325
321
|
originalConfig = err.config;
|
|
326
322
|
if (!err.response) return [3 /*break*/, 5];
|
|
327
323
|
if (!(err.response.status === 401 && !originalConfig._retry)) return [3 /*break*/, 4];
|
|
328
324
|
originalConfig._retry = true;
|
|
329
|
-
|
|
325
|
+
_a.label = 1;
|
|
330
326
|
case 1:
|
|
331
|
-
|
|
327
|
+
_a.trys.push([1, 3, , 4]);
|
|
332
328
|
return [4 /*yield*/, this.refreshTokenInternal()];
|
|
333
329
|
case 2:
|
|
334
|
-
|
|
330
|
+
tokenString = _a.sent();
|
|
335
331
|
accessToken = "Bearer ".concat(tokenString);
|
|
336
|
-
this.permissions = permissions;
|
|
337
332
|
originalConfig.headers['Authorization'] = "Bearer ".concat(accessToken);
|
|
338
333
|
this.configuration.accessToken = accessToken;
|
|
339
334
|
return [2 /*return*/, axios.request(originalConfig)];
|
|
340
335
|
case 3:
|
|
341
|
-
_error_1 =
|
|
336
|
+
_error_1 = _a.sent();
|
|
342
337
|
if (_error_1.response && _error_1.response.data) {
|
|
343
338
|
return [2 /*return*/, Promise.reject(_error_1.response.data)];
|
|
344
339
|
}
|
|
@@ -354,20 +349,19 @@ var BaseAPI = /** @class */ (function () {
|
|
|
354
349
|
&& originalConfig.headers.hasOwnProperty('Authorization')
|
|
355
350
|
&& _retry_count < 4)) return [3 /*break*/, 9];
|
|
356
351
|
_retry_count++;
|
|
357
|
-
|
|
352
|
+
_a.label = 6;
|
|
358
353
|
case 6:
|
|
359
|
-
|
|
354
|
+
_a.trys.push([6, 8, , 9]);
|
|
360
355
|
return [4 /*yield*/, this.refreshTokenInternal()];
|
|
361
356
|
case 7:
|
|
362
|
-
|
|
357
|
+
tokenString = _a.sent();
|
|
363
358
|
accessToken = "Bearer ".concat(tokenString);
|
|
364
|
-
this.permissions = permissions;
|
|
365
359
|
_retry = true;
|
|
366
360
|
originalConfig.headers['Authorization'] = accessToken;
|
|
367
361
|
this.configuration.accessToken = accessToken;
|
|
368
362
|
return [2 /*return*/, axios.request(__assign({}, originalConfig))];
|
|
369
363
|
case 8:
|
|
370
|
-
_error_2 =
|
|
364
|
+
_error_2 = _a.sent();
|
|
371
365
|
if (_error_2.response && _error_2.response.data) {
|
|
372
366
|
return [2 /*return*/, Promise.reject(_error_2.response.data)];
|
|
373
367
|
}
|
|
@@ -38,19 +38,19 @@ export interface CreatePartnerRelationRequestDtoRest {
|
|
|
38
38
|
* @type {string}
|
|
39
39
|
* @memberof CreatePartnerRelationRequestDtoRest
|
|
40
40
|
*/
|
|
41
|
-
'startDate'
|
|
41
|
+
'startDate'?: string;
|
|
42
42
|
/**
|
|
43
43
|
* The end datetime of the relationship, provided in ISO 8601 format
|
|
44
44
|
* @type {string}
|
|
45
45
|
* @memberof CreatePartnerRelationRequestDtoRest
|
|
46
46
|
*/
|
|
47
|
-
'endDate'
|
|
47
|
+
'endDate'?: string;
|
|
48
48
|
/**
|
|
49
49
|
* A note about the relationship, provided as a string
|
|
50
50
|
* @type {string}
|
|
51
51
|
* @memberof CreatePartnerRelationRequestDtoRest
|
|
52
52
|
*/
|
|
53
|
-
'note'
|
|
53
|
+
'note'?: string;
|
|
54
54
|
}
|
|
55
55
|
export declare const CreatePartnerRelationRequestDtoRestRelationTypeSlugEnum: {
|
|
56
56
|
readonly Parent: "parent";
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
* https://openapi-generator.tech
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
|
+
import { PartnerClass } from './partner-class';
|
|
13
|
+
import { PartnerRelationTypeClass } from './partner-relation-type-class';
|
|
12
14
|
/**
|
|
13
15
|
*
|
|
14
16
|
* @export
|
|
@@ -39,6 +41,12 @@ export interface PartnerRelationClass {
|
|
|
39
41
|
* @memberof PartnerRelationClass
|
|
40
42
|
*/
|
|
41
43
|
'partnerRelationTypeSlug': string;
|
|
44
|
+
/**
|
|
45
|
+
* Relation type object
|
|
46
|
+
* @type {PartnerRelationTypeClass}
|
|
47
|
+
* @memberof PartnerRelationClass
|
|
48
|
+
*/
|
|
49
|
+
'partnerRelationType'?: PartnerRelationTypeClass;
|
|
42
50
|
/**
|
|
43
51
|
* Starting date of the relation - will default to current time if not provided
|
|
44
52
|
* @type {string}
|
|
@@ -81,4 +89,16 @@ export interface PartnerRelationClass {
|
|
|
81
89
|
* @memberof PartnerRelationClass
|
|
82
90
|
*/
|
|
83
91
|
'updatedBy': string;
|
|
92
|
+
/**
|
|
93
|
+
* Partner 1 object
|
|
94
|
+
* @type {PartnerClass}
|
|
95
|
+
* @memberof PartnerRelationClass
|
|
96
|
+
*/
|
|
97
|
+
'partner1'?: PartnerClass;
|
|
98
|
+
/**
|
|
99
|
+
* Partner 2 object
|
|
100
|
+
* @type {PartnerClass}
|
|
101
|
+
* @memberof PartnerRelationClass
|
|
102
|
+
*/
|
|
103
|
+
'partner2'?: PartnerClass;
|
|
84
104
|
}
|
|
@@ -43,19 +43,19 @@ export interface CreatePartnerRelationRequestDtoRest {
|
|
|
43
43
|
* @type {string}
|
|
44
44
|
* @memberof CreatePartnerRelationRequestDtoRest
|
|
45
45
|
*/
|
|
46
|
-
'startDate'
|
|
46
|
+
'startDate'?: string;
|
|
47
47
|
/**
|
|
48
48
|
* The end datetime of the relationship, provided in ISO 8601 format
|
|
49
49
|
* @type {string}
|
|
50
50
|
* @memberof CreatePartnerRelationRequestDtoRest
|
|
51
51
|
*/
|
|
52
|
-
'endDate'
|
|
52
|
+
'endDate'?: string;
|
|
53
53
|
/**
|
|
54
54
|
* A note about the relationship, provided as a string
|
|
55
55
|
* @type {string}
|
|
56
56
|
* @memberof CreatePartnerRelationRequestDtoRest
|
|
57
57
|
*/
|
|
58
|
-
'note'
|
|
58
|
+
'note'?: string;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
export const CreatePartnerRelationRequestDtoRestRelationTypeSlugEnum = {
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
|
|
16
|
+
import { PartnerClass } from './partner-class';
|
|
17
|
+
import { PartnerRelationTypeClass } from './partner-relation-type-class';
|
|
16
18
|
|
|
17
19
|
/**
|
|
18
20
|
*
|
|
@@ -44,6 +46,12 @@ export interface PartnerRelationClass {
|
|
|
44
46
|
* @memberof PartnerRelationClass
|
|
45
47
|
*/
|
|
46
48
|
'partnerRelationTypeSlug': string;
|
|
49
|
+
/**
|
|
50
|
+
* Relation type object
|
|
51
|
+
* @type {PartnerRelationTypeClass}
|
|
52
|
+
* @memberof PartnerRelationClass
|
|
53
|
+
*/
|
|
54
|
+
'partnerRelationType'?: PartnerRelationTypeClass;
|
|
47
55
|
/**
|
|
48
56
|
* Starting date of the relation - will default to current time if not provided
|
|
49
57
|
* @type {string}
|
|
@@ -86,5 +94,17 @@ export interface PartnerRelationClass {
|
|
|
86
94
|
* @memberof PartnerRelationClass
|
|
87
95
|
*/
|
|
88
96
|
'updatedBy': string;
|
|
97
|
+
/**
|
|
98
|
+
* Partner 1 object
|
|
99
|
+
* @type {PartnerClass}
|
|
100
|
+
* @memberof PartnerRelationClass
|
|
101
|
+
*/
|
|
102
|
+
'partner1'?: PartnerClass;
|
|
103
|
+
/**
|
|
104
|
+
* Partner 2 object
|
|
105
|
+
* @type {PartnerClass}
|
|
106
|
+
* @memberof PartnerRelationClass
|
|
107
|
+
*/
|
|
108
|
+
'partner2'?: PartnerClass;
|
|
89
109
|
}
|
|
90
110
|
|