@emilgroup/notification-sdk-node 1.3.0 → 1.4.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.
@@ -52,17 +52,17 @@ export declare const NotificationTemplatesApiAxiosParamCreator: (configuration?:
52
52
  /**
53
53
  *
54
54
  * @param {string} [authorization] Bearer Token
55
- * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
55
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. 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=1, your subsequent call can include pageToken=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.
59
- * @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.
58
+ * @param {any} [search] To search the list by any field, pass search=xxx to fetch the result.
60
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.
61
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.
61
+ * @param {any} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
62
62
  * @param {*} [options] Override http request option.
63
63
  * @throws {RequiredError}
64
64
  */
65
- listNotificationTemplates: (authorization?: string, pageSize?: any, pageToken?: any, filter?: any, filters?: any, search?: any, order?: any, expand?: any, options?: AxiosRequestConfig) => Promise<RequestArgs>;
65
+ listNotificationTemplates: (authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, filters?: any, options?: AxiosRequestConfig) => Promise<RequestArgs>;
66
66
  /**
67
67
  *
68
68
  * @param {number} id
@@ -107,17 +107,17 @@ export declare const NotificationTemplatesApiFp: (configuration?: Configuration)
107
107
  /**
108
108
  *
109
109
  * @param {string} [authorization] Bearer Token
110
- * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
110
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
111
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.
112
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.
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
+ * @param {any} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
115
114
  * @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.
116
115
  * @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.
116
+ * @param {any} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
117
117
  * @param {*} [options] Override http request option.
118
118
  * @throws {RequiredError}
119
119
  */
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>>;
120
+ listNotificationTemplates(authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, filters?: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListNotificationTemplatesResponseClass>>;
121
121
  /**
122
122
  *
123
123
  * @param {number} id
@@ -162,17 +162,17 @@ export declare const NotificationTemplatesApiFactory: (configuration?: Configura
162
162
  /**
163
163
  *
164
164
  * @param {string} [authorization] Bearer Token
165
- * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
165
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
166
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.
167
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.
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.
168
+ * @param {any} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
170
169
  * @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.
171
170
  * @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.
171
+ * @param {any} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
172
172
  * @param {*} [options] Override http request option.
173
173
  * @throws {RequiredError}
174
174
  */
175
- listNotificationTemplates(authorization?: string, pageSize?: any, pageToken?: any, filter?: any, filters?: any, search?: any, order?: any, expand?: any, options?: any): AxiosPromise<ListNotificationTemplatesResponseClass>;
175
+ listNotificationTemplates(authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, filters?: any, options?: any): AxiosPromise<ListNotificationTemplatesResponseClass>;
176
176
  /**
177
177
  *
178
178
  * @param {number} id
@@ -265,7 +265,7 @@ export interface NotificationTemplatesApiListNotificationTemplatesRequest {
265
265
  */
266
266
  readonly authorization?: string;
267
267
  /**
268
- * A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
268
+ * A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
269
269
  * @type {any}
270
270
  * @memberof NotificationTemplatesApiListNotificationTemplates
271
271
  */
@@ -283,13 +283,7 @@ export interface NotificationTemplatesApiListNotificationTemplatesRequest {
283
283
  */
284
284
  readonly filter?: any;
285
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;
291
- /**
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.
286
+ * To search the list by any field, pass search&#x3D;xxx to fetch the result.
293
287
  * @type {any}
294
288
  * @memberof NotificationTemplatesApiListNotificationTemplates
295
289
  */
@@ -306,6 +300,12 @@ export interface NotificationTemplatesApiListNotificationTemplatesRequest {
306
300
  * @memberof NotificationTemplatesApiListNotificationTemplates
307
301
  */
308
302
  readonly expand?: any;
303
+ /**
304
+ * Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
305
+ * @type {any}
306
+ * @memberof NotificationTemplatesApiListNotificationTemplates
307
+ */
308
+ readonly filters?: any;
309
309
  }
310
310
  /**
311
311
  * Request parameters for updateNotificationTemplate operation in NotificationTemplatesApi.
@@ -251,17 +251,17 @@ var NotificationTemplatesApiAxiosParamCreator = function (configuration) {
251
251
  /**
252
252
  *
253
253
  * @param {string} [authorization] Bearer Token
254
- * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
254
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. 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.
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.
257
+ * @param {any} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
259
258
  * @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.
260
259
  * @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
+ * @param {any} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
261
261
  * @param {*} [options] Override http request option.
262
262
  * @throws {RequiredError}
263
263
  */
264
- listNotificationTemplates: function (authorization, pageSize, pageToken, filter, filters, search, order, expand, options) {
264
+ listNotificationTemplates: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
265
265
  if (options === void 0) { options = {}; }
266
266
  return __awaiter(_this, void 0, void 0, function () {
267
267
  var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
@@ -293,9 +293,6 @@ var NotificationTemplatesApiAxiosParamCreator = function (configuration) {
293
293
  if (filter !== undefined) {
294
294
  localVarQueryParameter['filter'] = filter;
295
295
  }
296
- if (filters !== undefined) {
297
- localVarQueryParameter['filters'] = filters;
298
- }
299
296
  if (search !== undefined) {
300
297
  localVarQueryParameter['search'] = search;
301
298
  }
@@ -305,6 +302,9 @@ var NotificationTemplatesApiAxiosParamCreator = function (configuration) {
305
302
  if (expand !== undefined) {
306
303
  localVarQueryParameter['expand'] = expand;
307
304
  }
305
+ if (filters !== undefined) {
306
+ localVarQueryParameter['filters'] = filters;
307
+ }
308
308
  if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
309
309
  localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
310
310
  }
@@ -446,22 +446,22 @@ var NotificationTemplatesApiFp = function (configuration) {
446
446
  /**
447
447
  *
448
448
  * @param {string} [authorization] Bearer Token
449
- * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
449
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
450
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.
451
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.
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.
452
+ * @param {any} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
454
453
  * @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.
455
454
  * @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.
455
+ * @param {any} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
456
456
  * @param {*} [options] Override http request option.
457
457
  * @throws {RequiredError}
458
458
  */
459
- listNotificationTemplates: function (authorization, pageSize, pageToken, filter, filters, search, order, expand, options) {
459
+ listNotificationTemplates: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
460
460
  return __awaiter(this, void 0, void 0, function () {
461
461
  var localVarAxiosArgs;
462
462
  return __generator(this, function (_a) {
463
463
  switch (_a.label) {
464
- case 0: return [4 /*yield*/, localVarAxiosParamCreator.listNotificationTemplates(authorization, pageSize, pageToken, filter, filters, search, order, expand, options)];
464
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.listNotificationTemplates(authorization, pageSize, pageToken, filter, search, order, expand, filters, options)];
465
465
  case 1:
466
466
  localVarAxiosArgs = _a.sent();
467
467
  return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
@@ -535,18 +535,18 @@ var NotificationTemplatesApiFactory = function (configuration, basePath, axios)
535
535
  /**
536
536
  *
537
537
  * @param {string} [authorization] Bearer Token
538
- * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
538
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
539
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.
540
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.
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.
541
+ * @param {any} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
543
542
  * @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.
544
543
  * @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.
544
+ * @param {any} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
545
545
  * @param {*} [options] Override http request option.
546
546
  * @throws {RequiredError}
547
547
  */
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); });
548
+ listNotificationTemplates: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
549
+ return localVarFp.listNotificationTemplates(authorization, pageSize, pageToken, filter, search, order, expand, filters, options).then(function (request) { return request(axios, basePath); });
550
550
  },
551
551
  /**
552
552
  *
@@ -616,7 +616,7 @@ var NotificationTemplatesApi = /** @class */ (function (_super) {
616
616
  NotificationTemplatesApi.prototype.listNotificationTemplates = function (requestParameters, options) {
617
617
  var _this = this;
618
618
  if (requestParameters === void 0) { requestParameters = {}; }
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); });
619
+ return (0, exports.NotificationTemplatesApiFp)(this.configuration).listNotificationTemplates(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, options).then(function (request) { return request(_this.axios, _this.basePath); });
620
620
  };
621
621
  /**
622
622
  *
package/dist/base.d.ts CHANGED
@@ -29,6 +29,7 @@ export interface LoginClass {
29
29
  export declare enum Environment {
30
30
  Production = "https://apiv2.emil.de",
31
31
  Test = "https://apiv2-test.emil.de",
32
+ Staging = "https://apiv2-staging.emil.de",
32
33
  Development = "https://apiv2-dev.emil.de",
33
34
  ProductionZurich = "https://eu-central-2.apiv2.emil.de"
34
35
  }
@@ -53,16 +54,14 @@ export declare class BaseAPI {
53
54
  protected configuration: Configuration;
54
55
  private username?;
55
56
  private password?;
56
- private permissions?;
57
57
  constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
58
58
  initialize(env?: Environment): Promise<void>;
59
59
  private loadCredentials;
60
60
  private readConfigFile;
61
61
  private readEnvVariables;
62
62
  selectEnvironment(env: Environment): void;
63
- getPermissions(): Array<string>;
64
63
  authorize(username: string, password: string): Promise<void>;
65
- refreshTokenInternal(): Promise<LoginClass>;
64
+ refreshTokenInternal(): Promise<string>;
66
65
  private extractRefreshToken;
67
66
  getConfiguration(): Configuration;
68
67
  private attachInterceptor;
package/dist/base.js CHANGED
@@ -129,6 +129,7 @@ var Environment;
129
129
  (function (Environment) {
130
130
  Environment["Production"] = "https://apiv2.emil.de";
131
131
  Environment["Test"] = "https://apiv2-test.emil.de";
132
+ Environment["Staging"] = "https://apiv2-staging.emil.de";
132
133
  Environment["Development"] = "https://apiv2-dev.emil.de";
133
134
  Environment["ProductionZurich"] = "https://eu-central-2.apiv2.emil.de";
134
135
  })(Environment = exports.Environment || (exports.Environment = {}));
@@ -242,14 +243,11 @@ var BaseAPI = /** @class */ (function () {
242
243
  BaseAPI.prototype.selectEnvironment = function (env) {
243
244
  this.configuration.basePath = env;
244
245
  };
245
- BaseAPI.prototype.getPermissions = function () {
246
- return this.permissions.split(',');
247
- };
248
246
  BaseAPI.prototype.authorize = function (username, password) {
249
247
  return __awaiter(this, void 0, void 0, function () {
250
- var options, response, _a, accessToken, permissions, refreshToken;
251
- return __generator(this, function (_b) {
252
- switch (_b.label) {
248
+ var options, response, accessToken, refreshToken;
249
+ return __generator(this, function (_a) {
250
+ switch (_a.label) {
253
251
  case 0:
254
252
  options = {
255
253
  method: 'POST',
@@ -263,11 +261,10 @@ var BaseAPI = /** @class */ (function () {
263
261
  };
264
262
  return [4 /*yield*/, axios_1.default.request(options)];
265
263
  case 1:
266
- response = _b.sent();
267
- _a = response.data, accessToken = _a.accessToken, permissions = _a.permissions;
264
+ response = _a.sent();
265
+ accessToken = response.data.accessToken;
268
266
  this.configuration.username = username;
269
267
  this.configuration.accessToken = "Bearer ".concat(accessToken);
270
- this.permissions = permissions;
271
268
  refreshToken = this.extractRefreshToken(response);
272
269
  this.configuration.refreshToken = refreshToken;
273
270
  return [2 /*return*/];
@@ -277,13 +274,13 @@ var BaseAPI = /** @class */ (function () {
277
274
  };
278
275
  BaseAPI.prototype.refreshTokenInternal = function () {
279
276
  return __awaiter(this, void 0, void 0, function () {
280
- var _a, username, refreshToken, options, response;
277
+ var _a, username, refreshToken, options, accessToken;
281
278
  return __generator(this, function (_b) {
282
279
  switch (_b.label) {
283
280
  case 0:
284
281
  _a = this.configuration, username = _a.username, refreshToken = _a.refreshToken;
285
282
  if (!username || !refreshToken) {
286
- throw new Error('Failed to refresh token.');
283
+ return [2 /*return*/, ''];
287
284
  }
288
285
  options = {
289
286
  method: 'POST',
@@ -297,8 +294,8 @@ var BaseAPI = /** @class */ (function () {
297
294
  };
298
295
  return [4 /*yield*/, axios_1.default.request(options)];
299
296
  case 1:
300
- response = _b.sent();
301
- return [2 /*return*/, response.data];
297
+ accessToken = (_b.sent()).data.accessToken;
298
+ return [2 /*return*/, accessToken];
302
299
  }
303
300
  });
304
301
  });
@@ -318,27 +315,26 @@ var BaseAPI = /** @class */ (function () {
318
315
  axios.interceptors.response.use(function (res) {
319
316
  return res;
320
317
  }, function (err) { return __awaiter(_this, void 0, void 0, function () {
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) {
318
+ var originalConfig, tokenString, accessToken, _error_1, tokenString, accessToken, _error_2;
319
+ return __generator(this, function (_a) {
320
+ switch (_a.label) {
324
321
  case 0:
325
322
  originalConfig = err.config;
326
323
  if (!err.response) return [3 /*break*/, 5];
327
324
  if (!(err.response.status === 401 && !originalConfig._retry)) return [3 /*break*/, 4];
328
325
  originalConfig._retry = true;
329
- _c.label = 1;
326
+ _a.label = 1;
330
327
  case 1:
331
- _c.trys.push([1, 3, , 4]);
328
+ _a.trys.push([1, 3, , 4]);
332
329
  return [4 /*yield*/, this.refreshTokenInternal()];
333
330
  case 2:
334
- _a = _c.sent(), tokenString = _a.accessToken, permissions = _a.permissions;
331
+ tokenString = _a.sent();
335
332
  accessToken = "Bearer ".concat(tokenString);
336
- this.permissions = permissions;
337
333
  originalConfig.headers['Authorization'] = "Bearer ".concat(accessToken);
338
334
  this.configuration.accessToken = accessToken;
339
335
  return [2 /*return*/, axios.request(originalConfig)];
340
336
  case 3:
341
- _error_1 = _c.sent();
337
+ _error_1 = _a.sent();
342
338
  if (_error_1.response && _error_1.response.data) {
343
339
  return [2 /*return*/, Promise.reject(_error_1.response.data)];
344
340
  }
@@ -354,20 +350,19 @@ var BaseAPI = /** @class */ (function () {
354
350
  && originalConfig.headers.hasOwnProperty('Authorization')
355
351
  && _retry_count < 4)) return [3 /*break*/, 9];
356
352
  _retry_count++;
357
- _c.label = 6;
353
+ _a.label = 6;
358
354
  case 6:
359
- _c.trys.push([6, 8, , 9]);
355
+ _a.trys.push([6, 8, , 9]);
360
356
  return [4 /*yield*/, this.refreshTokenInternal()];
361
357
  case 7:
362
- _b = _c.sent(), tokenString = _b.accessToken, permissions = _b.permissions;
358
+ tokenString = _a.sent();
363
359
  accessToken = "Bearer ".concat(tokenString);
364
- this.permissions = permissions;
365
360
  _retry = true;
366
361
  originalConfig.headers['Authorization'] = accessToken;
367
362
  this.configuration.accessToken = accessToken;
368
363
  return [2 /*return*/, axios.request(__assign({}, originalConfig))];
369
364
  case 8:
370
- _error_2 = _c.sent();
365
+ _error_2 = _a.sent();
371
366
  if (_error_2.response && _error_2.response.data) {
372
367
  return [2 /*return*/, Promise.reject(_error_2.response.data)];
373
368
  }
@@ -51,10 +51,4 @@ export interface HtmlTemplateClass {
51
51
  * @memberof HtmlTemplateClass
52
52
  */
53
53
  'updatedAt': string;
54
- /**
55
- * Html template deleted at
56
- * @type {string}
57
- * @memberof HtmlTemplateClass
58
- */
59
- 'deletedAt': string;
60
54
  }
@@ -19,6 +19,7 @@ export * from './layout-class';
19
19
  export * from './list-layouts-response-class';
20
20
  export * from './list-notification-templates-response-class';
21
21
  export * from './notification-template-class';
22
+ export * from './s3-document-dto';
22
23
  export * from './send-notification-request-dto';
23
24
  export * from './send-notification-response-class';
24
25
  export * from './update-html-template-request-dto';
@@ -35,6 +35,7 @@ __exportStar(require("./layout-class"), exports);
35
35
  __exportStar(require("./list-layouts-response-class"), exports);
36
36
  __exportStar(require("./list-notification-templates-response-class"), exports);
37
37
  __exportStar(require("./notification-template-class"), exports);
38
+ __exportStar(require("./s3-document-dto"), exports);
38
39
  __exportStar(require("./send-notification-request-dto"), exports);
39
40
  __exportStar(require("./send-notification-response-class"), exports);
40
41
  __exportStar(require("./update-html-template-request-dto"), exports);
@@ -22,7 +22,7 @@ export interface InitiateEmailVerificationDto {
22
22
  */
23
23
  'email': string;
24
24
  /**
25
- * A slug is a human-readable, unique identifier, used to identify a resource instead of a less human-readable identifier like an id.
25
+ * A slug is a human-readable, unique identifier, used to identify a resource instead of a less human-readable identifier like an id.
26
26
  * @type {string}
27
27
  * @memberof InitiateEmailVerificationDto
28
28
  */
@@ -23,32 +23,32 @@ export interface InlineResponse200 {
23
23
  'status'?: string;
24
24
  /**
25
25
  *
26
- * @type {{ [key: string]: { [key: string]: string; }; }}
26
+ * @type {{ [key: string]: { [key: string]: object; }; }}
27
27
  * @memberof InlineResponse200
28
28
  */
29
29
  'info'?: {
30
30
  [key: string]: {
31
- [key: string]: string;
31
+ [key: string]: object;
32
32
  };
33
33
  } | null;
34
34
  /**
35
35
  *
36
- * @type {{ [key: string]: { [key: string]: string; }; }}
36
+ * @type {{ [key: string]: { [key: string]: object; }; }}
37
37
  * @memberof InlineResponse200
38
38
  */
39
39
  'error'?: {
40
40
  [key: string]: {
41
- [key: string]: string;
41
+ [key: string]: object;
42
42
  };
43
43
  } | null;
44
44
  /**
45
45
  *
46
- * @type {{ [key: string]: { [key: string]: string; }; }}
46
+ * @type {{ [key: string]: { [key: string]: object; }; }}
47
47
  * @memberof InlineResponse200
48
48
  */
49
49
  'details'?: {
50
50
  [key: string]: {
51
- [key: string]: string;
51
+ [key: string]: object;
52
52
  };
53
53
  };
54
54
  }
@@ -23,32 +23,32 @@ export interface InlineResponse503 {
23
23
  'status'?: string;
24
24
  /**
25
25
  *
26
- * @type {{ [key: string]: { [key: string]: string; }; }}
26
+ * @type {{ [key: string]: { [key: string]: object; }; }}
27
27
  * @memberof InlineResponse503
28
28
  */
29
29
  'info'?: {
30
30
  [key: string]: {
31
- [key: string]: string;
31
+ [key: string]: object;
32
32
  };
33
33
  } | null;
34
34
  /**
35
35
  *
36
- * @type {{ [key: string]: { [key: string]: string; }; }}
36
+ * @type {{ [key: string]: { [key: string]: object; }; }}
37
37
  * @memberof InlineResponse503
38
38
  */
39
39
  'error'?: {
40
40
  [key: string]: {
41
- [key: string]: string;
41
+ [key: string]: object;
42
42
  };
43
43
  } | null;
44
44
  /**
45
45
  *
46
- * @type {{ [key: string]: { [key: string]: string; }; }}
46
+ * @type {{ [key: string]: { [key: string]: object; }; }}
47
47
  * @memberof InlineResponse503
48
48
  */
49
49
  'details'?: {
50
50
  [key: string]: {
51
- [key: string]: string;
51
+ [key: string]: object;
52
52
  };
53
53
  };
54
54
  }
@@ -0,0 +1,36 @@
1
+ /**
2
+ * EMIL NotificationService
3
+ * The EMIL NotificationService API description
4
+ *
5
+ * The version of the OpenAPI document: 1.0
6
+ * Contact: kontakt@emil.de
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface S3DocumentDto
16
+ */
17
+ export interface S3DocumentDto {
18
+ /**
19
+ *
20
+ * @type {string}
21
+ * @memberof S3DocumentDto
22
+ */
23
+ 'bucket'?: string;
24
+ /**
25
+ *
26
+ * @type {string}
27
+ * @memberof S3DocumentDto
28
+ */
29
+ 'key': string;
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof S3DocumentDto
34
+ */
35
+ 'filename'?: string;
36
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * EMIL NotificationService
6
+ * The EMIL NotificationService API description
7
+ *
8
+ * The version of the OpenAPI document: 1.0
9
+ * Contact: kontakt@emil.de
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -9,6 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ import { S3DocumentDto } from './s3-document-dto';
12
13
  /**
13
14
  *
14
15
  * @export
@@ -53,10 +54,10 @@ export interface SendNotificationRequestDto {
53
54
  'emailBcc': Array<string>;
54
55
  /**
55
56
  * Attachments for the email. Any attachement has to be uploaded to S3 first before being sent.
56
- * @type {Array<string>}
57
+ * @type {Array<S3DocumentDto>}
57
58
  * @memberof SendNotificationRequestDto
58
59
  */
59
- 'attachments': Array<string>;
60
+ 'attachments': Array<S3DocumentDto>;
60
61
  /**
61
62
  * 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
63
  * @type {string}
@@ -56,11 +56,5 @@ export interface HtmlTemplateClass {
56
56
  * @memberof HtmlTemplateClass
57
57
  */
58
58
  'updatedAt': string;
59
- /**
60
- * Html template deleted at
61
- * @type {string}
62
- * @memberof HtmlTemplateClass
63
- */
64
- 'deletedAt': string;
65
59
  }
66
60
 
package/models/index.ts CHANGED
@@ -19,6 +19,7 @@ export * from './layout-class';
19
19
  export * from './list-layouts-response-class';
20
20
  export * from './list-notification-templates-response-class';
21
21
  export * from './notification-template-class';
22
+ export * from './s3-document-dto';
22
23
  export * from './send-notification-request-dto';
23
24
  export * from './send-notification-response-class';
24
25
  export * from './update-html-template-request-dto';
@@ -27,7 +27,7 @@ export interface InitiateEmailVerificationDto {
27
27
  */
28
28
  'email': string;
29
29
  /**
30
- * A slug is a human-readable, unique identifier, used to identify a resource instead of a less human-readable identifier like an id.
30
+ * A slug is a human-readable, unique identifier, used to identify a resource instead of a less human-readable identifier like an id.
31
31
  * @type {string}
32
32
  * @memberof InitiateEmailVerificationDto
33
33
  */
@@ -28,21 +28,21 @@ export interface InlineResponse200 {
28
28
  'status'?: string;
29
29
  /**
30
30
  *
31
- * @type {{ [key: string]: { [key: string]: string; }; }}
31
+ * @type {{ [key: string]: { [key: string]: object; }; }}
32
32
  * @memberof InlineResponse200
33
33
  */
34
- 'info'?: { [key: string]: { [key: string]: string; }; } | null;
34
+ 'info'?: { [key: string]: { [key: string]: object; }; } | null;
35
35
  /**
36
36
  *
37
- * @type {{ [key: string]: { [key: string]: string; }; }}
37
+ * @type {{ [key: string]: { [key: string]: object; }; }}
38
38
  * @memberof InlineResponse200
39
39
  */
40
- 'error'?: { [key: string]: { [key: string]: string; }; } | null;
40
+ 'error'?: { [key: string]: { [key: string]: object; }; } | null;
41
41
  /**
42
42
  *
43
- * @type {{ [key: string]: { [key: string]: string; }; }}
43
+ * @type {{ [key: string]: { [key: string]: object; }; }}
44
44
  * @memberof InlineResponse200
45
45
  */
46
- 'details'?: { [key: string]: { [key: string]: string; }; };
46
+ 'details'?: { [key: string]: { [key: string]: object; }; };
47
47
  }
48
48