@emilgroup/notification-sdk 0.8.1-beta.62 → 0.8.1-beta.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/api/email-mailboxes-api.ts +6 -3
- package/api/email-messages-api.ts +30 -15
- package/api/email-subscriptions-api.ts +36 -18
- package/api/email-tracking-api.ts +36 -18
- package/api/email-verifications-api.ts +12 -6
- package/api/layouts-api.ts +30 -15
- package/api/notification-templates-api.ts +30 -15
- package/api/notifications-api.ts +12 -6
- package/base.ts +14 -0
- package/dist/api/email-mailboxes-api.js +11 -7
- package/dist/api/email-messages-api.js +53 -34
- package/dist/api/email-subscriptions-api.js +64 -41
- package/dist/api/email-tracking-api.js +62 -40
- package/dist/api/email-verifications-api.js +22 -14
- package/dist/api/layouts-api.js +51 -33
- package/dist/api/notification-templates-api.js +51 -33
- package/dist/api/notifications-api.js +22 -14
- package/dist/base.js +15 -1
- package/package.json +1 -1
|
@@ -103,9 +103,10 @@ var NotificationTemplatesApiAxiosParamCreator = function (configuration) {
|
|
|
103
103
|
createNotificationTemplate: function (createNotificationTemplateRequestDto, authorization, options) {
|
|
104
104
|
if (options === void 0) { options = {}; }
|
|
105
105
|
return __awaiter(_this, void 0, void 0, function () {
|
|
106
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
|
|
107
|
+
var _a;
|
|
108
|
+
return __generator(this, function (_b) {
|
|
109
|
+
switch (_b.label) {
|
|
109
110
|
case 0:
|
|
110
111
|
// verify required parameter 'createNotificationTemplateRequestDto' is not null or undefined
|
|
111
112
|
(0, common_1.assertParamExists)('createNotificationTemplate', 'createNotificationTemplateRequestDto', createNotificationTemplateRequestDto);
|
|
@@ -121,14 +122,17 @@ var NotificationTemplatesApiAxiosParamCreator = function (configuration) {
|
|
|
121
122
|
// authentication bearer required
|
|
122
123
|
// http bearer authentication required
|
|
123
124
|
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
|
|
124
|
-
// Only Authorization falls back to the configured token
|
|
125
|
+
// Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
|
|
126
|
+
// no token is stored, so a refused call still refreshes; a session call (account header) sends none.
|
|
125
127
|
];
|
|
126
128
|
case 1:
|
|
127
129
|
// authentication bearer required
|
|
128
130
|
// http bearer authentication required
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
131
|
+
_b.sent();
|
|
132
|
+
authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
|
|
133
|
+
authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
|
|
134
|
+
authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
|
|
135
|
+
if (authorizationValue || authorizationKeepEmpty) {
|
|
132
136
|
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
133
137
|
}
|
|
134
138
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
@@ -155,9 +159,10 @@ var NotificationTemplatesApiAxiosParamCreator = function (configuration) {
|
|
|
155
159
|
deleteNotificationTemplate: function (id, authorization, options) {
|
|
156
160
|
if (options === void 0) { options = {}; }
|
|
157
161
|
return __awaiter(_this, void 0, void 0, function () {
|
|
158
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
|
|
159
|
-
|
|
160
|
-
|
|
162
|
+
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
|
|
163
|
+
var _a;
|
|
164
|
+
return __generator(this, function (_b) {
|
|
165
|
+
switch (_b.label) {
|
|
161
166
|
case 0:
|
|
162
167
|
// verify required parameter 'id' is not null or undefined
|
|
163
168
|
(0, common_1.assertParamExists)('deleteNotificationTemplate', 'id', id);
|
|
@@ -174,14 +179,17 @@ var NotificationTemplatesApiAxiosParamCreator = function (configuration) {
|
|
|
174
179
|
// authentication bearer required
|
|
175
180
|
// http bearer authentication required
|
|
176
181
|
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
|
|
177
|
-
// Only Authorization falls back to the configured token
|
|
182
|
+
// Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
|
|
183
|
+
// no token is stored, so a refused call still refreshes; a session call (account header) sends none.
|
|
178
184
|
];
|
|
179
185
|
case 1:
|
|
180
186
|
// authentication bearer required
|
|
181
187
|
// http bearer authentication required
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
188
|
+
_b.sent();
|
|
189
|
+
authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
|
|
190
|
+
authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
|
|
191
|
+
authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
|
|
192
|
+
if (authorizationValue || authorizationKeepEmpty) {
|
|
185
193
|
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
186
194
|
}
|
|
187
195
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
@@ -208,9 +216,10 @@ var NotificationTemplatesApiAxiosParamCreator = function (configuration) {
|
|
|
208
216
|
getNotificationTemplate: function (id, id2, authorization, expand, options) {
|
|
209
217
|
if (options === void 0) { options = {}; }
|
|
210
218
|
return __awaiter(_this, void 0, void 0, function () {
|
|
211
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
|
|
212
|
-
|
|
213
|
-
|
|
219
|
+
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
|
|
220
|
+
var _a;
|
|
221
|
+
return __generator(this, function (_b) {
|
|
222
|
+
switch (_b.label) {
|
|
214
223
|
case 0:
|
|
215
224
|
// verify required parameter 'id' is not null or undefined
|
|
216
225
|
(0, common_1.assertParamExists)('getNotificationTemplate', 'id', id);
|
|
@@ -232,15 +241,17 @@ var NotificationTemplatesApiAxiosParamCreator = function (configuration) {
|
|
|
232
241
|
case 1:
|
|
233
242
|
// authentication bearer required
|
|
234
243
|
// http bearer authentication required
|
|
235
|
-
|
|
244
|
+
_b.sent();
|
|
236
245
|
if (id2 !== undefined) {
|
|
237
246
|
localVarQueryParameter['id'] = id2;
|
|
238
247
|
}
|
|
239
248
|
if (expand !== undefined) {
|
|
240
249
|
localVarQueryParameter['expand'] = expand;
|
|
241
250
|
}
|
|
242
|
-
|
|
243
|
-
|
|
251
|
+
authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
|
|
252
|
+
authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
|
|
253
|
+
authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
|
|
254
|
+
if (authorizationValue || authorizationKeepEmpty) {
|
|
244
255
|
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
245
256
|
}
|
|
246
257
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
@@ -271,9 +282,10 @@ var NotificationTemplatesApiAxiosParamCreator = function (configuration) {
|
|
|
271
282
|
listNotificationTemplates: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
|
|
272
283
|
if (options === void 0) { options = {}; }
|
|
273
284
|
return __awaiter(_this, void 0, void 0, function () {
|
|
274
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
|
|
275
|
-
|
|
276
|
-
|
|
285
|
+
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
|
|
286
|
+
var _a;
|
|
287
|
+
return __generator(this, function (_b) {
|
|
288
|
+
switch (_b.label) {
|
|
277
289
|
case 0:
|
|
278
290
|
localVarPath = "/notificationservice/v1/notification-templates";
|
|
279
291
|
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
@@ -290,7 +302,7 @@ var NotificationTemplatesApiAxiosParamCreator = function (configuration) {
|
|
|
290
302
|
case 1:
|
|
291
303
|
// authentication bearer required
|
|
292
304
|
// http bearer authentication required
|
|
293
|
-
|
|
305
|
+
_b.sent();
|
|
294
306
|
if (pageSize !== undefined) {
|
|
295
307
|
localVarQueryParameter['pageSize'] = pageSize;
|
|
296
308
|
}
|
|
@@ -312,8 +324,10 @@ var NotificationTemplatesApiAxiosParamCreator = function (configuration) {
|
|
|
312
324
|
if (filters !== undefined) {
|
|
313
325
|
localVarQueryParameter['filters'] = filters;
|
|
314
326
|
}
|
|
315
|
-
|
|
316
|
-
|
|
327
|
+
authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
|
|
328
|
+
authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
|
|
329
|
+
authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
|
|
330
|
+
if (authorizationValue || authorizationKeepEmpty) {
|
|
317
331
|
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
318
332
|
}
|
|
319
333
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
@@ -339,9 +353,10 @@ var NotificationTemplatesApiAxiosParamCreator = function (configuration) {
|
|
|
339
353
|
updateNotificationTemplate: function (id, updateNotificationTemplateRequestDto, authorization, options) {
|
|
340
354
|
if (options === void 0) { options = {}; }
|
|
341
355
|
return __awaiter(_this, void 0, void 0, function () {
|
|
342
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
|
|
343
|
-
|
|
344
|
-
|
|
356
|
+
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
|
|
357
|
+
var _a;
|
|
358
|
+
return __generator(this, function (_b) {
|
|
359
|
+
switch (_b.label) {
|
|
345
360
|
case 0:
|
|
346
361
|
// verify required parameter 'id' is not null or undefined
|
|
347
362
|
(0, common_1.assertParamExists)('updateNotificationTemplate', 'id', id);
|
|
@@ -360,14 +375,17 @@ var NotificationTemplatesApiAxiosParamCreator = function (configuration) {
|
|
|
360
375
|
// authentication bearer required
|
|
361
376
|
// http bearer authentication required
|
|
362
377
|
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
|
|
363
|
-
// Only Authorization falls back to the configured token
|
|
378
|
+
// Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
|
|
379
|
+
// no token is stored, so a refused call still refreshes; a session call (account header) sends none.
|
|
364
380
|
];
|
|
365
381
|
case 1:
|
|
366
382
|
// authentication bearer required
|
|
367
383
|
// http bearer authentication required
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
384
|
+
_b.sent();
|
|
385
|
+
authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
|
|
386
|
+
authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
|
|
387
|
+
authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
|
|
388
|
+
if (authorizationValue || authorizationKeepEmpty) {
|
|
371
389
|
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
372
390
|
}
|
|
373
391
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
@@ -103,9 +103,10 @@ var NotificationsApiAxiosParamCreator = function (configuration) {
|
|
|
103
103
|
sendEmail: function (sendEmailRequestDto, authorization, options) {
|
|
104
104
|
if (options === void 0) { options = {}; }
|
|
105
105
|
return __awaiter(_this, void 0, void 0, function () {
|
|
106
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
|
|
107
|
+
var _a;
|
|
108
|
+
return __generator(this, function (_b) {
|
|
109
|
+
switch (_b.label) {
|
|
109
110
|
case 0:
|
|
110
111
|
// verify required parameter 'sendEmailRequestDto' is not null or undefined
|
|
111
112
|
(0, common_1.assertParamExists)('sendEmail', 'sendEmailRequestDto', sendEmailRequestDto);
|
|
@@ -121,14 +122,17 @@ var NotificationsApiAxiosParamCreator = function (configuration) {
|
|
|
121
122
|
// authentication bearer required
|
|
122
123
|
// http bearer authentication required
|
|
123
124
|
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
|
|
124
|
-
// Only Authorization falls back to the configured token
|
|
125
|
+
// Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
|
|
126
|
+
// no token is stored, so a refused call still refreshes; a session call (account header) sends none.
|
|
125
127
|
];
|
|
126
128
|
case 1:
|
|
127
129
|
// authentication bearer required
|
|
128
130
|
// http bearer authentication required
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
131
|
+
_b.sent();
|
|
132
|
+
authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
|
|
133
|
+
authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
|
|
134
|
+
authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
|
|
135
|
+
if (authorizationValue || authorizationKeepEmpty) {
|
|
132
136
|
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
133
137
|
}
|
|
134
138
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
@@ -155,9 +159,10 @@ var NotificationsApiAxiosParamCreator = function (configuration) {
|
|
|
155
159
|
sendNotification: function (sendNotificationRequestDto, authorization, options) {
|
|
156
160
|
if (options === void 0) { options = {}; }
|
|
157
161
|
return __awaiter(_this, void 0, void 0, function () {
|
|
158
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
|
|
159
|
-
|
|
160
|
-
|
|
162
|
+
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
|
|
163
|
+
var _a;
|
|
164
|
+
return __generator(this, function (_b) {
|
|
165
|
+
switch (_b.label) {
|
|
161
166
|
case 0:
|
|
162
167
|
// verify required parameter 'sendNotificationRequestDto' is not null or undefined
|
|
163
168
|
(0, common_1.assertParamExists)('sendNotification', 'sendNotificationRequestDto', sendNotificationRequestDto);
|
|
@@ -173,14 +178,17 @@ var NotificationsApiAxiosParamCreator = function (configuration) {
|
|
|
173
178
|
// authentication bearer required
|
|
174
179
|
// http bearer authentication required
|
|
175
180
|
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
|
|
176
|
-
// Only Authorization falls back to the configured token
|
|
181
|
+
// Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
|
|
182
|
+
// no token is stored, so a refused call still refreshes; a session call (account header) sends none.
|
|
177
183
|
];
|
|
178
184
|
case 1:
|
|
179
185
|
// authentication bearer required
|
|
180
186
|
// http bearer authentication required
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
187
|
+
_b.sent();
|
|
188
|
+
authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
|
|
189
|
+
authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
|
|
190
|
+
authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
|
|
191
|
+
if (authorizationValue || authorizationKeepEmpty) {
|
|
184
192
|
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
185
193
|
}
|
|
186
194
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
package/dist/base.js
CHANGED
|
@@ -142,6 +142,15 @@ var BaseAPI = /** @class */ (function () {
|
|
|
142
142
|
this.axios = axios;
|
|
143
143
|
this.loadTokenData();
|
|
144
144
|
if (configuration) {
|
|
145
|
+
// Two accounts in one browser share APP_TOKEN: never take the token or session account saved for
|
|
146
|
+
// another account. The mode stays (an app naming its account keeps its session). Saved with the next refresh.
|
|
147
|
+
var ownUser = configuration.username;
|
|
148
|
+
var storedUser = this.tokenData.username;
|
|
149
|
+
if (ownUser && storedUser && ownUser.toLowerCase() !== storedUser.toLowerCase()) {
|
|
150
|
+
delete this.tokenData.accessToken;
|
|
151
|
+
delete this.tokenData.sub;
|
|
152
|
+
this.tokenData.username = ownUser;
|
|
153
|
+
}
|
|
145
154
|
var accessToken = this.tokenData.accessToken;
|
|
146
155
|
this.configuration = configuration;
|
|
147
156
|
this.basePath = configuration.basePath || this.basePath;
|
|
@@ -452,7 +461,12 @@ var BaseAPI = /** @class */ (function () {
|
|
|
452
461
|
_retry = true;
|
|
453
462
|
this.applyTokenReply(reply);
|
|
454
463
|
this.storeTokenData(this.tokenData);
|
|
455
|
-
|
|
464
|
+
// The limit is for refreshes that do not help; one that worked starts the count again.
|
|
465
|
+
// Not awaited, so a failed retry reaches the app as the same axios error as before.
|
|
466
|
+
return [2 /*return*/, axios.request(__assign({}, this.withCurrentAuth(originalConfig))).then(function (retried) {
|
|
467
|
+
_retry_count = 0;
|
|
468
|
+
return retried;
|
|
469
|
+
})];
|
|
456
470
|
case 9:
|
|
457
471
|
_error_2 = _a.sent();
|
|
458
472
|
if (_error_2.response && _error_2.response.data) {
|