@emilgroup/notification-sdk-node 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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/notification-sdk-node@1.1.0 --save
20
+ npm install @emilgroup/notification-sdk-node@1.3.0 --save
21
21
  ```
22
22
  or
23
23
  ```
24
- yarn add @emilgroup/notification-sdk-node@1.1.0
24
+ yarn add @emilgroup/notification-sdk-node@1.3.0
25
25
  ```
26
26
 
27
27
  And then you can import `LayoutApi`.
@@ -47,6 +47,22 @@ export EMIL_USERNAME=XXXXX@XXXX.XXX
47
47
  export EMIL_PASSWORD=XXXXXXXXXXXXXX
48
48
  ```
49
49
 
50
+ ## Base path
51
+
52
+ To select the basic path for using the API, we can use two approaches. The first is to use one of the predefined environments, and the second is to specify the domain as a string.
53
+
54
+ ```ts
55
+ import { LayoutApi, Environment } from '@emilgroup/notification-sdk-node'
56
+
57
+ const LayoutsApi = new LayoutApi();
58
+
59
+ // Allows you to simply choose environment. It will usually be Environment.Production.
60
+ LayoutsApi.selectEnvironment(Environment.Production);
61
+
62
+ // For advanced users, use the custom baseUrl of the website you need to connect to.
63
+ LayoutsApi.selectBasePath('https://my-custom-domain.com');
64
+ ```
65
+
50
66
  ## Example
51
67
 
52
68
  Here is a basic functionning example:
@@ -189,13 +189,14 @@ export const LayoutsApiAxiosParamCreator = function (configuration?: Configurati
189
189
  * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
190
190
  * @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.
191
191
  * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
192
+ * @param {any} [filters] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
192
193
  * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code=xxx in order to fetch the result.
193
194
  * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
194
195
  * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
195
196
  * @param {*} [options] Override http request option.
196
197
  * @throws {RequiredError}
197
198
  */
198
- listLayouts: async (authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
199
+ listLayouts: async (authorization?: string, pageSize?: any, pageToken?: any, filter?: any, filters?: any, search?: any, order?: any, expand?: any, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
199
200
  const localVarPath = `/notificationservice/v1/layouts`;
200
201
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
201
202
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
@@ -226,6 +227,10 @@ export const LayoutsApiAxiosParamCreator = function (configuration?: Configurati
226
227
  localVarQueryParameter['filter'] = filter;
227
228
  }
228
229
 
230
+ if (filters !== undefined) {
231
+ localVarQueryParameter['filters'] = filters;
232
+ }
233
+
229
234
  if (search !== undefined) {
230
235
  localVarQueryParameter['search'] = search;
231
236
  }
@@ -353,14 +358,15 @@ export const LayoutsApiFp = function(configuration?: Configuration) {
353
358
  * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
354
359
  * @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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
355
360
  * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
361
+ * @param {any} [filters] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
356
362
  * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
357
363
  * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
358
364
  * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
359
365
  * @param {*} [options] Override http request option.
360
366
  * @throws {RequiredError}
361
367
  */
362
- async listLayouts(authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListLayoutsResponseClass>> {
363
- const localVarAxiosArgs = await localVarAxiosParamCreator.listLayouts(authorization, pageSize, pageToken, filter, search, order, expand, options);
368
+ async listLayouts(authorization?: string, pageSize?: any, pageToken?: any, filter?: any, filters?: any, search?: any, order?: any, expand?: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListLayoutsResponseClass>> {
369
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listLayouts(authorization, pageSize, pageToken, filter, filters, search, order, expand, options);
364
370
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
365
371
  },
366
372
  /**
@@ -422,14 +428,15 @@ export const LayoutsApiFactory = function (configuration?: Configuration, basePa
422
428
  * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
423
429
  * @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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
424
430
  * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
431
+ * @param {any} [filters] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
425
432
  * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
426
433
  * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
427
434
  * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
428
435
  * @param {*} [options] Override http request option.
429
436
  * @throws {RequiredError}
430
437
  */
431
- listLayouts(authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, options?: any): AxiosPromise<ListLayoutsResponseClass> {
432
- return localVarFp.listLayouts(authorization, pageSize, pageToken, filter, search, order, expand, options).then((request) => request(axios, basePath));
438
+ listLayouts(authorization?: string, pageSize?: any, pageToken?: any, filter?: any, filters?: any, search?: any, order?: any, expand?: any, options?: any): AxiosPromise<ListLayoutsResponseClass> {
439
+ return localVarFp.listLayouts(authorization, pageSize, pageToken, filter, filters, search, order, expand, options).then((request) => request(axios, basePath));
433
440
  },
434
441
  /**
435
442
  *
@@ -549,6 +556,13 @@ export interface LayoutsApiListLayoutsRequest {
549
556
  */
550
557
  readonly filter?: any
551
558
 
559
+ /**
560
+ * Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
561
+ * @type {any}
562
+ * @memberof LayoutsApiListLayouts
563
+ */
564
+ readonly filters?: any
565
+
552
566
  /**
553
567
  * Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
554
568
  * @type {any}
@@ -647,7 +661,7 @@ export class LayoutsApi extends BaseAPI {
647
661
  * @memberof LayoutsApi
648
662
  */
649
663
  public listLayouts(requestParameters: LayoutsApiListLayoutsRequest = {}, options?: AxiosRequestConfig) {
650
- return LayoutsApiFp(this.configuration).listLayouts(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, options).then((request) => request(this.axios, this.basePath));
664
+ return LayoutsApiFp(this.configuration).listLayouts(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.filters, requestParameters.search, requestParameters.order, requestParameters.expand, options).then((request) => request(this.axios, this.basePath));
651
665
  }
652
666
 
653
667
  /**
@@ -194,13 +194,14 @@ export const NotificationTemplatesApiAxiosParamCreator = function (configuration
194
194
  * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
195
195
  * @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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
196
196
  * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
197
+ * @param {any} [filters] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
197
198
  * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
198
199
  * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
199
200
  * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
200
201
  * @param {*} [options] Override http request option.
201
202
  * @throws {RequiredError}
202
203
  */
203
- listNotificationTemplates: async (authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
204
+ listNotificationTemplates: async (authorization?: string, pageSize?: any, pageToken?: any, filter?: any, filters?: any, search?: any, order?: any, expand?: any, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
204
205
  const localVarPath = `/notificationservice/v1/notification-templates`;
205
206
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
206
207
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
@@ -231,6 +232,10 @@ export const NotificationTemplatesApiAxiosParamCreator = function (configuration
231
232
  localVarQueryParameter['filter'] = filter;
232
233
  }
233
234
 
235
+ if (filters !== undefined) {
236
+ localVarQueryParameter['filters'] = filters;
237
+ }
238
+
234
239
  if (search !== undefined) {
235
240
  localVarQueryParameter['search'] = search;
236
241
  }
@@ -359,14 +364,15 @@ export const NotificationTemplatesApiFp = function(configuration?: Configuration
359
364
  * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
360
365
  * @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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
361
366
  * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
367
+ * @param {any} [filters] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
362
368
  * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
363
369
  * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
364
370
  * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
365
371
  * @param {*} [options] Override http request option.
366
372
  * @throws {RequiredError}
367
373
  */
368
- async listNotificationTemplates(authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListNotificationTemplatesResponseClass>> {
369
- const localVarAxiosArgs = await localVarAxiosParamCreator.listNotificationTemplates(authorization, pageSize, pageToken, filter, search, order, expand, options);
374
+ async listNotificationTemplates(authorization?: string, pageSize?: any, pageToken?: any, filter?: any, filters?: any, search?: any, order?: any, expand?: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListNotificationTemplatesResponseClass>> {
375
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listNotificationTemplates(authorization, pageSize, pageToken, filter, filters, search, order, expand, options);
370
376
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
371
377
  },
372
378
  /**
@@ -429,14 +435,15 @@ export const NotificationTemplatesApiFactory = function (configuration?: Configu
429
435
  * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
430
436
  * @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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
431
437
  * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
438
+ * @param {any} [filters] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
432
439
  * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
433
440
  * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
434
441
  * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
435
442
  * @param {*} [options] Override http request option.
436
443
  * @throws {RequiredError}
437
444
  */
438
- listNotificationTemplates(authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, options?: any): AxiosPromise<ListNotificationTemplatesResponseClass> {
439
- return localVarFp.listNotificationTemplates(authorization, pageSize, pageToken, filter, search, order, expand, options).then((request) => request(axios, basePath));
445
+ listNotificationTemplates(authorization?: string, pageSize?: any, pageToken?: any, filter?: any, filters?: any, search?: any, order?: any, expand?: any, options?: any): AxiosPromise<ListNotificationTemplatesResponseClass> {
446
+ return localVarFp.listNotificationTemplates(authorization, pageSize, pageToken, filter, filters, search, order, expand, options).then((request) => request(axios, basePath));
440
447
  },
441
448
  /**
442
449
  *
@@ -563,6 +570,13 @@ export interface NotificationTemplatesApiListNotificationTemplatesRequest {
563
570
  */
564
571
  readonly filter?: any
565
572
 
573
+ /**
574
+ * Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
575
+ * @type {any}
576
+ * @memberof NotificationTemplatesApiListNotificationTemplates
577
+ */
578
+ readonly filters?: any
579
+
566
580
  /**
567
581
  * Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
568
582
  * @type {any}
@@ -661,7 +675,7 @@ export class NotificationTemplatesApi extends BaseAPI {
661
675
  * @memberof NotificationTemplatesApi
662
676
  */
663
677
  public listNotificationTemplates(requestParameters: NotificationTemplatesApiListNotificationTemplatesRequest = {}, options?: AxiosRequestConfig) {
664
- return NotificationTemplatesApiFp(this.configuration).listNotificationTemplates(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, options).then((request) => request(this.axios, this.basePath));
678
+ return NotificationTemplatesApiFp(this.configuration).listNotificationTemplates(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.filters, requestParameters.search, requestParameters.order, requestParameters.expand, options).then((request) => request(this.axios, this.basePath));
665
679
  }
666
680
 
667
681
  /**
package/base.ts CHANGED
@@ -41,7 +41,7 @@ export const COLLECTION_FORMATS = {
41
41
 
42
42
  export interface LoginClass {
43
43
  accessToken: string;
44
- permissions: Array<string>;
44
+ permissions: string;
45
45
  }
46
46
 
47
47
  export enum Environment {
@@ -79,6 +79,7 @@ export class BaseAPI {
79
79
  protected configuration: Configuration;
80
80
  private username?: string;
81
81
  private password?: string;
82
+ private permissions?: string;
82
83
 
83
84
  constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
84
85
  if (configuration) {
@@ -149,6 +150,10 @@ export class BaseAPI {
149
150
  this.configuration.basePath = env;
150
151
  }
151
152
 
153
+ getPermissions(): Array<string> {
154
+ return this.permissions.split(',');
155
+ }
156
+
152
157
  async authorize(username: string, password: string): Promise<void> {
153
158
  const options: AxiosRequestConfig = {
154
159
  method: 'POST',
@@ -163,20 +168,21 @@ export class BaseAPI {
163
168
 
164
169
  const response = await globalAxios.request<LoginClass>(options);
165
170
 
166
- const { data: { accessToken } } = response;
171
+ const { data: { accessToken, permissions } } = response;
167
172
  this.configuration.username = username;
168
173
  this.configuration.accessToken = `Bearer ${accessToken}`;
174
+ this.permissions = permissions;
169
175
 
170
176
  const refreshToken = this.extractRefreshToken(response)
171
177
  this.configuration.refreshToken = refreshToken;
172
178
  }
173
179
 
174
- async refreshTokenInternal(): Promise<string> {
180
+ async refreshTokenInternal(): Promise<LoginClass> {
175
181
  const { username, refreshToken } = this.configuration;
176
182
 
177
183
 
178
184
  if (!username || !refreshToken) {
179
- return '';
185
+ throw new Error('Failed to refresh token.');
180
186
  }
181
187
 
182
188
  const options: AxiosRequestConfig = {
@@ -190,9 +196,9 @@ export class BaseAPI {
190
196
  withCredentials: true,
191
197
  };
192
198
 
193
- const { data: { accessToken } } = await globalAxios.request<LoginClass>(options);
199
+ const response = await globalAxios.request<LoginClass>(options);
194
200
 
195
- return accessToken;
201
+ return response.data;
196
202
  }
197
203
 
198
204
  private extractRefreshToken(response: AxiosResponse): string {
@@ -221,8 +227,9 @@ export class BaseAPI {
221
227
  if (err.response.status === 401 && !originalConfig._retry) {
222
228
  originalConfig._retry = true;
223
229
  try {
224
- const tokenString = await this.refreshTokenInternal();
230
+ const { accessToken: tokenString, permissions } = await this.refreshTokenInternal();
225
231
  const accessToken = `Bearer ${tokenString}`;
232
+ this.permissions = permissions;
226
233
 
227
234
  originalConfig.headers['Authorization'] = `Bearer ${accessToken}`
228
235
 
@@ -246,8 +253,9 @@ export class BaseAPI {
246
253
  ){
247
254
  _retry_count++;
248
255
  try {
249
- const tokenString = await this.refreshTokenInternal();
256
+ const { accessToken: tokenString, permissions } = await this.refreshTokenInternal();
250
257
  const accessToken = `Bearer ${tokenString}`;
258
+ this.permissions = permissions;
251
259
 
252
260
  _retry = true;
253
261
  originalConfig.headers['Authorization'] = accessToken;
@@ -54,13 +54,14 @@ export declare const LayoutsApiAxiosParamCreator: (configuration?: Configuration
54
54
  * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
55
55
  * @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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
56
56
  * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
57
+ * @param {any} [filters] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
57
58
  * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
58
59
  * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
59
60
  * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
60
61
  * @param {*} [options] Override http request option.
61
62
  * @throws {RequiredError}
62
63
  */
63
- listLayouts: (authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, options?: AxiosRequestConfig) => Promise<RequestArgs>;
64
+ listLayouts: (authorization?: string, pageSize?: any, pageToken?: any, filter?: any, filters?: any, search?: any, order?: any, expand?: any, options?: AxiosRequestConfig) => Promise<RequestArgs>;
64
65
  /**
65
66
  *
66
67
  * @param {number} id
@@ -107,13 +108,14 @@ export declare const LayoutsApiFp: (configuration?: Configuration) => {
107
108
  * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
108
109
  * @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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
109
110
  * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
111
+ * @param {any} [filters] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
110
112
  * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
111
113
  * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
112
114
  * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
113
115
  * @param {*} [options] Override http request option.
114
116
  * @throws {RequiredError}
115
117
  */
116
- listLayouts(authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListLayoutsResponseClass>>;
118
+ listLayouts(authorization?: string, pageSize?: any, pageToken?: any, filter?: any, filters?: any, search?: any, order?: any, expand?: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListLayoutsResponseClass>>;
117
119
  /**
118
120
  *
119
121
  * @param {number} id
@@ -160,13 +162,14 @@ export declare const LayoutsApiFactory: (configuration?: Configuration, basePath
160
162
  * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
161
163
  * @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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
162
164
  * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
165
+ * @param {any} [filters] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
163
166
  * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
164
167
  * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
165
168
  * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
166
169
  * @param {*} [options] Override http request option.
167
170
  * @throws {RequiredError}
168
171
  */
169
- listLayouts(authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, options?: any): AxiosPromise<ListLayoutsResponseClass>;
172
+ listLayouts(authorization?: string, pageSize?: any, pageToken?: any, filter?: any, filters?: any, search?: any, order?: any, expand?: any, options?: any): AxiosPromise<ListLayoutsResponseClass>;
170
173
  /**
171
174
  *
172
175
  * @param {number} id
@@ -270,6 +273,12 @@ export interface LayoutsApiListLayoutsRequest {
270
273
  * @memberof LayoutsApiListLayouts
271
274
  */
272
275
  readonly filter?: any;
276
+ /**
277
+ * Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
278
+ * @type {any}
279
+ * @memberof LayoutsApiListLayouts
280
+ */
281
+ readonly filters?: any;
273
282
  /**
274
283
  * Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
275
284
  * @type {any}
@@ -250,13 +250,14 @@ var LayoutsApiAxiosParamCreator = function (configuration) {
250
250
  * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
251
251
  * @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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
252
252
  * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
253
+ * @param {any} [filters] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
253
254
  * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
254
255
  * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
255
256
  * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
256
257
  * @param {*} [options] Override http request option.
257
258
  * @throws {RequiredError}
258
259
  */
259
- listLayouts: function (authorization, pageSize, pageToken, filter, search, order, expand, options) {
260
+ listLayouts: function (authorization, pageSize, pageToken, filter, filters, search, order, expand, options) {
260
261
  if (options === void 0) { options = {}; }
261
262
  return __awaiter(_this, void 0, void 0, function () {
262
263
  var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
@@ -288,6 +289,9 @@ var LayoutsApiAxiosParamCreator = function (configuration) {
288
289
  if (filter !== undefined) {
289
290
  localVarQueryParameter['filter'] = filter;
290
291
  }
292
+ if (filters !== undefined) {
293
+ localVarQueryParameter['filters'] = filters;
294
+ }
291
295
  if (search !== undefined) {
292
296
  localVarQueryParameter['search'] = search;
293
297
  }
@@ -440,18 +444,19 @@ var LayoutsApiFp = function (configuration) {
440
444
  * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
441
445
  * @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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
442
446
  * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
447
+ * @param {any} [filters] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
443
448
  * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
444
449
  * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
445
450
  * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
446
451
  * @param {*} [options] Override http request option.
447
452
  * @throws {RequiredError}
448
453
  */
449
- listLayouts: function (authorization, pageSize, pageToken, filter, search, order, expand, options) {
454
+ listLayouts: function (authorization, pageSize, pageToken, filter, filters, search, order, expand, options) {
450
455
  return __awaiter(this, void 0, void 0, function () {
451
456
  var localVarAxiosArgs;
452
457
  return __generator(this, function (_a) {
453
458
  switch (_a.label) {
454
- case 0: return [4 /*yield*/, localVarAxiosParamCreator.listLayouts(authorization, pageSize, pageToken, filter, search, order, expand, options)];
459
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.listLayouts(authorization, pageSize, pageToken, filter, filters, search, order, expand, options)];
455
460
  case 1:
456
461
  localVarAxiosArgs = _a.sent();
457
462
  return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
@@ -527,14 +532,15 @@ var LayoutsApiFactory = function (configuration, basePath, axios) {
527
532
  * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
528
533
  * @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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
529
534
  * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
535
+ * @param {any} [filters] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
530
536
  * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
531
537
  * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
532
538
  * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
533
539
  * @param {*} [options] Override http request option.
534
540
  * @throws {RequiredError}
535
541
  */
536
- listLayouts: function (authorization, pageSize, pageToken, filter, search, order, expand, options) {
537
- return localVarFp.listLayouts(authorization, pageSize, pageToken, filter, search, order, expand, options).then(function (request) { return request(axios, basePath); });
542
+ listLayouts: function (authorization, pageSize, pageToken, filter, filters, search, order, expand, options) {
543
+ return localVarFp.listLayouts(authorization, pageSize, pageToken, filter, filters, search, order, expand, options).then(function (request) { return request(axios, basePath); });
538
544
  },
539
545
  /**
540
546
  *
@@ -604,7 +610,7 @@ var LayoutsApi = /** @class */ (function (_super) {
604
610
  LayoutsApi.prototype.listLayouts = function (requestParameters, options) {
605
611
  var _this = this;
606
612
  if (requestParameters === void 0) { requestParameters = {}; }
607
- return (0, exports.LayoutsApiFp)(this.configuration).listLayouts(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
613
+ return (0, exports.LayoutsApiFp)(this.configuration).listLayouts(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.filters, requestParameters.search, requestParameters.order, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
608
614
  };
609
615
  /**
610
616
  *
@@ -55,13 +55,14 @@ export declare const NotificationTemplatesApiAxiosParamCreator: (configuration?:
55
55
  * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
56
56
  * @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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
57
57
  * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
58
+ * @param {any} [filters] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
58
59
  * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
59
60
  * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
60
61
  * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
61
62
  * @param {*} [options] Override http request option.
62
63
  * @throws {RequiredError}
63
64
  */
64
- listNotificationTemplates: (authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, options?: AxiosRequestConfig) => Promise<RequestArgs>;
65
+ listNotificationTemplates: (authorization?: string, pageSize?: any, pageToken?: any, filter?: any, filters?: any, search?: any, order?: any, expand?: any, options?: AxiosRequestConfig) => Promise<RequestArgs>;
65
66
  /**
66
67
  *
67
68
  * @param {number} id
@@ -109,13 +110,14 @@ export declare const NotificationTemplatesApiFp: (configuration?: Configuration)
109
110
  * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
110
111
  * @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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
111
112
  * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
113
+ * @param {any} [filters] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
112
114
  * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
113
115
  * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
114
116
  * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
115
117
  * @param {*} [options] Override http request option.
116
118
  * @throws {RequiredError}
117
119
  */
118
- listNotificationTemplates(authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListNotificationTemplatesResponseClass>>;
120
+ listNotificationTemplates(authorization?: string, pageSize?: any, pageToken?: any, filter?: any, filters?: any, search?: any, order?: any, expand?: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListNotificationTemplatesResponseClass>>;
119
121
  /**
120
122
  *
121
123
  * @param {number} id
@@ -163,13 +165,14 @@ export declare const NotificationTemplatesApiFactory: (configuration?: Configura
163
165
  * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
164
166
  * @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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
165
167
  * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
168
+ * @param {any} [filters] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
166
169
  * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
167
170
  * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
168
171
  * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
169
172
  * @param {*} [options] Override http request option.
170
173
  * @throws {RequiredError}
171
174
  */
172
- listNotificationTemplates(authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, options?: any): AxiosPromise<ListNotificationTemplatesResponseClass>;
175
+ listNotificationTemplates(authorization?: string, pageSize?: any, pageToken?: any, filter?: any, filters?: any, search?: any, order?: any, expand?: any, options?: any): AxiosPromise<ListNotificationTemplatesResponseClass>;
173
176
  /**
174
177
  *
175
178
  * @param {number} id
@@ -279,6 +282,12 @@ export interface NotificationTemplatesApiListNotificationTemplatesRequest {
279
282
  * @memberof NotificationTemplatesApiListNotificationTemplates
280
283
  */
281
284
  readonly filter?: any;
285
+ /**
286
+ * Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
287
+ * @type {any}
288
+ * @memberof NotificationTemplatesApiListNotificationTemplates
289
+ */
290
+ readonly filters?: any;
282
291
  /**
283
292
  * Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
284
293
  * @type {any}
@@ -254,13 +254,14 @@ var NotificationTemplatesApiAxiosParamCreator = function (configuration) {
254
254
  * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
255
255
  * @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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
256
256
  * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
257
+ * @param {any} [filters] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
257
258
  * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
258
259
  * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
259
260
  * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
260
261
  * @param {*} [options] Override http request option.
261
262
  * @throws {RequiredError}
262
263
  */
263
- listNotificationTemplates: function (authorization, pageSize, pageToken, filter, search, order, expand, options) {
264
+ listNotificationTemplates: function (authorization, pageSize, pageToken, filter, filters, search, order, expand, options) {
264
265
  if (options === void 0) { options = {}; }
265
266
  return __awaiter(_this, void 0, void 0, function () {
266
267
  var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
@@ -292,6 +293,9 @@ var NotificationTemplatesApiAxiosParamCreator = function (configuration) {
292
293
  if (filter !== undefined) {
293
294
  localVarQueryParameter['filter'] = filter;
294
295
  }
296
+ if (filters !== undefined) {
297
+ localVarQueryParameter['filters'] = filters;
298
+ }
295
299
  if (search !== undefined) {
296
300
  localVarQueryParameter['search'] = search;
297
301
  }
@@ -445,18 +449,19 @@ var NotificationTemplatesApiFp = function (configuration) {
445
449
  * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
446
450
  * @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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
447
451
  * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
452
+ * @param {any} [filters] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
448
453
  * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
449
454
  * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
450
455
  * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
451
456
  * @param {*} [options] Override http request option.
452
457
  * @throws {RequiredError}
453
458
  */
454
- listNotificationTemplates: function (authorization, pageSize, pageToken, filter, search, order, expand, options) {
459
+ listNotificationTemplates: function (authorization, pageSize, pageToken, filter, filters, search, order, expand, options) {
455
460
  return __awaiter(this, void 0, void 0, function () {
456
461
  var localVarAxiosArgs;
457
462
  return __generator(this, function (_a) {
458
463
  switch (_a.label) {
459
- case 0: return [4 /*yield*/, localVarAxiosParamCreator.listNotificationTemplates(authorization, pageSize, pageToken, filter, search, order, expand, options)];
464
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.listNotificationTemplates(authorization, pageSize, pageToken, filter, filters, search, order, expand, options)];
460
465
  case 1:
461
466
  localVarAxiosArgs = _a.sent();
462
467
  return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
@@ -533,14 +538,15 @@ var NotificationTemplatesApiFactory = function (configuration, basePath, axios)
533
538
  * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
534
539
  * @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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
535
540
  * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
541
+ * @param {any} [filters] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
536
542
  * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
537
543
  * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
538
544
  * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
539
545
  * @param {*} [options] Override http request option.
540
546
  * @throws {RequiredError}
541
547
  */
542
- listNotificationTemplates: function (authorization, pageSize, pageToken, filter, search, order, expand, options) {
543
- return localVarFp.listNotificationTemplates(authorization, pageSize, pageToken, filter, search, order, expand, options).then(function (request) { return request(axios, basePath); });
548
+ listNotificationTemplates: function (authorization, pageSize, pageToken, filter, filters, search, order, expand, options) {
549
+ return localVarFp.listNotificationTemplates(authorization, pageSize, pageToken, filter, filters, search, order, expand, options).then(function (request) { return request(axios, basePath); });
544
550
  },
545
551
  /**
546
552
  *
@@ -610,7 +616,7 @@ var NotificationTemplatesApi = /** @class */ (function (_super) {
610
616
  NotificationTemplatesApi.prototype.listNotificationTemplates = function (requestParameters, options) {
611
617
  var _this = this;
612
618
  if (requestParameters === void 0) { requestParameters = {}; }
613
- return (0, exports.NotificationTemplatesApiFp)(this.configuration).listNotificationTemplates(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
619
+ return (0, exports.NotificationTemplatesApiFp)(this.configuration).listNotificationTemplates(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.filters, requestParameters.search, requestParameters.order, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
614
620
  };
615
621
  /**
616
622
  *
package/dist/base.d.ts CHANGED
@@ -24,7 +24,7 @@ export declare const COLLECTION_FORMATS: {
24
24
  };
25
25
  export interface LoginClass {
26
26
  accessToken: string;
27
- permissions: Array<string>;
27
+ permissions: string;
28
28
  }
29
29
  export declare enum Environment {
30
30
  Production = "https://apiv2.emil.de",
@@ -53,14 +53,16 @@ export declare class BaseAPI {
53
53
  protected configuration: Configuration;
54
54
  private username?;
55
55
  private password?;
56
+ private permissions?;
56
57
  constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
57
58
  initialize(env?: Environment): Promise<void>;
58
59
  private loadCredentials;
59
60
  private readConfigFile;
60
61
  private readEnvVariables;
61
62
  selectEnvironment(env: Environment): void;
63
+ getPermissions(): Array<string>;
62
64
  authorize(username: string, password: string): Promise<void>;
63
- refreshTokenInternal(): Promise<string>;
65
+ refreshTokenInternal(): Promise<LoginClass>;
64
66
  private extractRefreshToken;
65
67
  getConfiguration(): Configuration;
66
68
  private attachInterceptor;
package/dist/base.js CHANGED
@@ -242,11 +242,14 @@ 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
+ };
245
248
  BaseAPI.prototype.authorize = function (username, password) {
246
249
  return __awaiter(this, void 0, void 0, function () {
247
- var options, response, accessToken, refreshToken;
248
- return __generator(this, function (_a) {
249
- switch (_a.label) {
250
+ var options, response, _a, accessToken, permissions, refreshToken;
251
+ return __generator(this, function (_b) {
252
+ switch (_b.label) {
250
253
  case 0:
251
254
  options = {
252
255
  method: 'POST',
@@ -260,10 +263,11 @@ var BaseAPI = /** @class */ (function () {
260
263
  };
261
264
  return [4 /*yield*/, axios_1.default.request(options)];
262
265
  case 1:
263
- response = _a.sent();
264
- accessToken = response.data.accessToken;
266
+ response = _b.sent();
267
+ _a = response.data, accessToken = _a.accessToken, permissions = _a.permissions;
265
268
  this.configuration.username = username;
266
269
  this.configuration.accessToken = "Bearer ".concat(accessToken);
270
+ this.permissions = permissions;
267
271
  refreshToken = this.extractRefreshToken(response);
268
272
  this.configuration.refreshToken = refreshToken;
269
273
  return [2 /*return*/];
@@ -273,13 +277,13 @@ var BaseAPI = /** @class */ (function () {
273
277
  };
274
278
  BaseAPI.prototype.refreshTokenInternal = function () {
275
279
  return __awaiter(this, void 0, void 0, function () {
276
- var _a, username, refreshToken, options, accessToken;
280
+ var _a, username, refreshToken, options, response;
277
281
  return __generator(this, function (_b) {
278
282
  switch (_b.label) {
279
283
  case 0:
280
284
  _a = this.configuration, username = _a.username, refreshToken = _a.refreshToken;
281
285
  if (!username || !refreshToken) {
282
- return [2 /*return*/, ''];
286
+ throw new Error('Failed to refresh token.');
283
287
  }
284
288
  options = {
285
289
  method: 'POST',
@@ -293,8 +297,8 @@ var BaseAPI = /** @class */ (function () {
293
297
  };
294
298
  return [4 /*yield*/, axios_1.default.request(options)];
295
299
  case 1:
296
- accessToken = (_b.sent()).data.accessToken;
297
- return [2 /*return*/, accessToken];
300
+ response = _b.sent();
301
+ return [2 /*return*/, response.data];
298
302
  }
299
303
  });
300
304
  });
@@ -314,26 +318,27 @@ var BaseAPI = /** @class */ (function () {
314
318
  axios.interceptors.response.use(function (res) {
315
319
  return res;
316
320
  }, function (err) { return __awaiter(_this, void 0, void 0, function () {
317
- var originalConfig, tokenString, accessToken, _error_1, tokenString, accessToken, _error_2;
318
- return __generator(this, function (_a) {
319
- switch (_a.label) {
321
+ var originalConfig, _a, tokenString, permissions, accessToken, _error_1, _b, tokenString, permissions, accessToken, _error_2;
322
+ return __generator(this, function (_c) {
323
+ switch (_c.label) {
320
324
  case 0:
321
325
  originalConfig = err.config;
322
326
  if (!err.response) return [3 /*break*/, 5];
323
327
  if (!(err.response.status === 401 && !originalConfig._retry)) return [3 /*break*/, 4];
324
328
  originalConfig._retry = true;
325
- _a.label = 1;
329
+ _c.label = 1;
326
330
  case 1:
327
- _a.trys.push([1, 3, , 4]);
331
+ _c.trys.push([1, 3, , 4]);
328
332
  return [4 /*yield*/, this.refreshTokenInternal()];
329
333
  case 2:
330
- tokenString = _a.sent();
334
+ _a = _c.sent(), tokenString = _a.accessToken, permissions = _a.permissions;
331
335
  accessToken = "Bearer ".concat(tokenString);
336
+ this.permissions = permissions;
332
337
  originalConfig.headers['Authorization'] = "Bearer ".concat(accessToken);
333
338
  this.configuration.accessToken = accessToken;
334
339
  return [2 /*return*/, axios.request(originalConfig)];
335
340
  case 3:
336
- _error_1 = _a.sent();
341
+ _error_1 = _c.sent();
337
342
  if (_error_1.response && _error_1.response.data) {
338
343
  return [2 /*return*/, Promise.reject(_error_1.response.data)];
339
344
  }
@@ -349,19 +354,20 @@ var BaseAPI = /** @class */ (function () {
349
354
  && originalConfig.headers.hasOwnProperty('Authorization')
350
355
  && _retry_count < 4)) return [3 /*break*/, 9];
351
356
  _retry_count++;
352
- _a.label = 6;
357
+ _c.label = 6;
353
358
  case 6:
354
- _a.trys.push([6, 8, , 9]);
359
+ _c.trys.push([6, 8, , 9]);
355
360
  return [4 /*yield*/, this.refreshTokenInternal()];
356
361
  case 7:
357
- tokenString = _a.sent();
362
+ _b = _c.sent(), tokenString = _b.accessToken, permissions = _b.permissions;
358
363
  accessToken = "Bearer ".concat(tokenString);
364
+ this.permissions = permissions;
359
365
  _retry = true;
360
366
  originalConfig.headers['Authorization'] = accessToken;
361
367
  this.configuration.accessToken = accessToken;
362
368
  return [2 /*return*/, axios.request(__assign({}, originalConfig))];
363
369
  case 8:
364
- _error_2 = _a.sent();
370
+ _error_2 = _c.sent();
365
371
  if (_error_2.response && _error_2.response.data) {
366
372
  return [2 /*return*/, Promise.reject(_error_2.response.data)];
367
373
  }
@@ -57,6 +57,12 @@ export interface SendNotificationRequestDto {
57
57
  * @memberof SendNotificationRequestDto
58
58
  */
59
59
  'attachments': Array<string>;
60
+ /**
61
+ * It is possible to use the product slug to fetch a different senderEmail from the tenant settings. It should be in the form of productSlug_sender-email
62
+ * @type {string}
63
+ * @memberof SendNotificationRequestDto
64
+ */
65
+ 'productSlug'?: string;
60
66
  /**
61
67
  * Payload is used by the template engine to replace all template variables with proper data. For more information, please go to https://github.com/flosch/pongo2.
62
68
  * @type {object}
@@ -62,6 +62,12 @@ export interface SendNotificationRequestDto {
62
62
  * @memberof SendNotificationRequestDto
63
63
  */
64
64
  'attachments': Array<string>;
65
+ /**
66
+ * It is possible to use the product slug to fetch a different senderEmail from the tenant settings. It should be in the form of productSlug_sender-email
67
+ * @type {string}
68
+ * @memberof SendNotificationRequestDto
69
+ */
70
+ 'productSlug'?: string;
65
71
  /**
66
72
  * Payload is used by the template engine to replace all template variables with proper data. For more information, please go to https://github.com/flosch/pongo2.
67
73
  * @type {object}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emilgroup/notification-sdk-node",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "description": "OpenAPI client for @emilgroup/notification-sdk-node",
5
5
  "author": "OpenAPI-Generator Contributors",
6
6
  "keywords": [
@@ -23,7 +23,7 @@
23
23
  "url": "^0.11.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@types/node": "^12.11.5",
26
+ "@types/node": "^12.11.5",
27
27
  "typescript": "^4.0"
28
28
  }
29
29
  }