@emilgroup/notification-sdk-node 1.3.0 → 1.4.1-beta.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/.openapi-generator/FILES +1 -0
- package/README.md +2 -2
- package/api/default-api.ts +8 -4
- package/api/email-verifications-api.ts +8 -8
- package/api/layouts-api.ts +71 -71
- package/api/notification-templates-api.ts +71 -71
- package/api/notifications-api.ts +4 -4
- package/base.ts +55 -20
- package/common.ts +2 -2
- package/configuration.ts +9 -0
- package/dist/api/default-api.d.ts +8 -4
- package/dist/api/default-api.js +8 -4
- package/dist/api/email-verifications-api.d.ts +8 -8
- package/dist/api/email-verifications-api.js +8 -8
- package/dist/api/layouts-api.d.ts +64 -64
- package/dist/api/layouts-api.js +50 -50
- package/dist/api/notification-templates-api.d.ts +64 -64
- package/dist/api/notification-templates-api.js +50 -50
- package/dist/api/notifications-api.d.ts +4 -4
- package/dist/api/notifications-api.js +4 -4
- package/dist/base.d.ts +13 -5
- package/dist/base.js +64 -30
- package/dist/common.js +2 -2
- package/dist/configuration.d.ts +6 -0
- package/dist/configuration.js +8 -0
- package/dist/models/html-template-class.d.ts +0 -6
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +1 -0
- package/dist/models/initiate-email-verification-dto.d.ts +1 -1
- package/dist/models/inline-response200.d.ts +6 -6
- package/dist/models/inline-response503.d.ts +6 -6
- package/dist/models/s3-document-dto.d.ts +36 -0
- package/dist/models/s3-document-dto.js +15 -0
- package/dist/models/send-notification-request-dto.d.ts +3 -2
- package/models/html-template-class.ts +0 -6
- package/models/index.ts +1 -0
- package/models/initiate-email-verification-dto.ts +1 -1
- package/models/inline-response200.ts +6 -6
- package/models/inline-response503.ts +6 -6
- package/models/s3-document-dto.ts +42 -0
- package/models/send-notification-request-dto.ts +3 -2
- package/package.json +1 -1
- package/tsconfig.json +1 -0
|
@@ -43,7 +43,7 @@ const FormData = require('form-data');
|
|
|
43
43
|
export const NotificationTemplatesApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
44
44
|
return {
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
46
|
+
* undefined **Required Permissions** \"notification-management.email-templates.create\"
|
|
47
47
|
* @param {CreateNotificationTemplateRequestDto} createNotificationTemplateRequestDto
|
|
48
48
|
* @param {string} [authorization] Bearer Token
|
|
49
49
|
* @param {*} [options] Override http request option.
|
|
@@ -89,7 +89,7 @@ export const NotificationTemplatesApiAxiosParamCreator = function (configuration
|
|
|
89
89
|
};
|
|
90
90
|
},
|
|
91
91
|
/**
|
|
92
|
-
*
|
|
92
|
+
* undefined **Required Permissions** \"notification-management.email-templates.delete\"
|
|
93
93
|
* @param {number} id
|
|
94
94
|
* @param {string} [authorization] Bearer Token
|
|
95
95
|
* @param {*} [options] Override http request option.
|
|
@@ -133,7 +133,7 @@ export const NotificationTemplatesApiAxiosParamCreator = function (configuration
|
|
|
133
133
|
};
|
|
134
134
|
},
|
|
135
135
|
/**
|
|
136
|
-
*
|
|
136
|
+
* undefined **Required Permissions** \"notification-management.email-templates.view\"
|
|
137
137
|
* @param {number} id
|
|
138
138
|
* @param {number} id2
|
|
139
139
|
* @param {string} [authorization] Bearer Token
|
|
@@ -189,19 +189,19 @@ export const NotificationTemplatesApiAxiosParamCreator = function (configuration
|
|
|
189
189
|
};
|
|
190
190
|
},
|
|
191
191
|
/**
|
|
192
|
-
*
|
|
192
|
+
* undefined **Required Permissions** \"notification-management.email-templates.view\"
|
|
193
193
|
* @param {string} [authorization] Bearer Token
|
|
194
|
-
* @param {
|
|
195
|
-
* @param {
|
|
196
|
-
* @param {
|
|
197
|
-
* @param {
|
|
198
|
-
* @param {
|
|
199
|
-
* @param {
|
|
200
|
-
* @param {
|
|
194
|
+
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
195
|
+
* @param {string} [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.
|
|
196
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
|
|
197
|
+
* @param {string} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
198
|
+
* @param {string} [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
|
+
* @param {string} [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
|
+
* @param {string} [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.
|
|
201
201
|
* @param {*} [options] Override http request option.
|
|
202
202
|
* @throws {RequiredError}
|
|
203
203
|
*/
|
|
204
|
-
listNotificationTemplates: async (authorization?: string, pageSize?:
|
|
204
|
+
listNotificationTemplates: async (authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
205
205
|
const localVarPath = `/notificationservice/v1/notification-templates`;
|
|
206
206
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
207
207
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
@@ -232,10 +232,6 @@ export const NotificationTemplatesApiAxiosParamCreator = function (configuration
|
|
|
232
232
|
localVarQueryParameter['filter'] = filter;
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
-
if (filters !== undefined) {
|
|
236
|
-
localVarQueryParameter['filters'] = filters;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
235
|
if (search !== undefined) {
|
|
240
236
|
localVarQueryParameter['search'] = search;
|
|
241
237
|
}
|
|
@@ -248,6 +244,10 @@ export const NotificationTemplatesApiAxiosParamCreator = function (configuration
|
|
|
248
244
|
localVarQueryParameter['expand'] = expand;
|
|
249
245
|
}
|
|
250
246
|
|
|
247
|
+
if (filters !== undefined) {
|
|
248
|
+
localVarQueryParameter['filters'] = filters;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
251
|
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
252
252
|
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
253
253
|
}
|
|
@@ -264,7 +264,7 @@ export const NotificationTemplatesApiAxiosParamCreator = function (configuration
|
|
|
264
264
|
};
|
|
265
265
|
},
|
|
266
266
|
/**
|
|
267
|
-
*
|
|
267
|
+
* undefined **Required Permissions** \"notification-management.email-templates.update\"
|
|
268
268
|
* @param {number} id
|
|
269
269
|
* @param {UpdateNotificationTemplateRequestDto} updateNotificationTemplateRequestDto
|
|
270
270
|
* @param {string} [authorization] Bearer Token
|
|
@@ -324,7 +324,7 @@ export const NotificationTemplatesApiFp = function(configuration?: Configuration
|
|
|
324
324
|
const localVarAxiosParamCreator = NotificationTemplatesApiAxiosParamCreator(configuration)
|
|
325
325
|
return {
|
|
326
326
|
/**
|
|
327
|
-
*
|
|
327
|
+
* undefined **Required Permissions** \"notification-management.email-templates.create\"
|
|
328
328
|
* @param {CreateNotificationTemplateRequestDto} createNotificationTemplateRequestDto
|
|
329
329
|
* @param {string} [authorization] Bearer Token
|
|
330
330
|
* @param {*} [options] Override http request option.
|
|
@@ -335,7 +335,7 @@ export const NotificationTemplatesApiFp = function(configuration?: Configuration
|
|
|
335
335
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
336
336
|
},
|
|
337
337
|
/**
|
|
338
|
-
*
|
|
338
|
+
* undefined **Required Permissions** \"notification-management.email-templates.delete\"
|
|
339
339
|
* @param {number} id
|
|
340
340
|
* @param {string} [authorization] Bearer Token
|
|
341
341
|
* @param {*} [options] Override http request option.
|
|
@@ -346,7 +346,7 @@ export const NotificationTemplatesApiFp = function(configuration?: Configuration
|
|
|
346
346
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
347
347
|
},
|
|
348
348
|
/**
|
|
349
|
-
*
|
|
349
|
+
* undefined **Required Permissions** \"notification-management.email-templates.view\"
|
|
350
350
|
* @param {number} id
|
|
351
351
|
* @param {number} id2
|
|
352
352
|
* @param {string} [authorization] Bearer Token
|
|
@@ -359,24 +359,24 @@ export const NotificationTemplatesApiFp = function(configuration?: Configuration
|
|
|
359
359
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
360
360
|
},
|
|
361
361
|
/**
|
|
362
|
-
*
|
|
362
|
+
* undefined **Required Permissions** \"notification-management.email-templates.view\"
|
|
363
363
|
* @param {string} [authorization] Bearer Token
|
|
364
|
-
* @param {
|
|
365
|
-
* @param {
|
|
366
|
-
* @param {
|
|
367
|
-
* @param {
|
|
368
|
-
* @param {
|
|
369
|
-
* @param {
|
|
370
|
-
* @param {
|
|
364
|
+
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
365
|
+
* @param {string} [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.
|
|
366
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
|
|
367
|
+
* @param {string} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
368
|
+
* @param {string} [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.
|
|
369
|
+
* @param {string} [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.
|
|
370
|
+
* @param {string} [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.
|
|
371
371
|
* @param {*} [options] Override http request option.
|
|
372
372
|
* @throws {RequiredError}
|
|
373
373
|
*/
|
|
374
|
-
async listNotificationTemplates(authorization?: string, pageSize?:
|
|
375
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.listNotificationTemplates(authorization, pageSize, pageToken, filter,
|
|
374
|
+
async listNotificationTemplates(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListNotificationTemplatesResponseClass>> {
|
|
375
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.listNotificationTemplates(authorization, pageSize, pageToken, filter, search, order, expand, filters, options);
|
|
376
376
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
377
377
|
},
|
|
378
378
|
/**
|
|
379
|
-
*
|
|
379
|
+
* undefined **Required Permissions** \"notification-management.email-templates.update\"
|
|
380
380
|
* @param {number} id
|
|
381
381
|
* @param {UpdateNotificationTemplateRequestDto} updateNotificationTemplateRequestDto
|
|
382
382
|
* @param {string} [authorization] Bearer Token
|
|
@@ -398,7 +398,7 @@ export const NotificationTemplatesApiFactory = function (configuration?: Configu
|
|
|
398
398
|
const localVarFp = NotificationTemplatesApiFp(configuration)
|
|
399
399
|
return {
|
|
400
400
|
/**
|
|
401
|
-
*
|
|
401
|
+
* undefined **Required Permissions** \"notification-management.email-templates.create\"
|
|
402
402
|
* @param {CreateNotificationTemplateRequestDto} createNotificationTemplateRequestDto
|
|
403
403
|
* @param {string} [authorization] Bearer Token
|
|
404
404
|
* @param {*} [options] Override http request option.
|
|
@@ -408,7 +408,7 @@ export const NotificationTemplatesApiFactory = function (configuration?: Configu
|
|
|
408
408
|
return localVarFp.createNotificationTemplate(createNotificationTemplateRequestDto, authorization, options).then((request) => request(axios, basePath));
|
|
409
409
|
},
|
|
410
410
|
/**
|
|
411
|
-
*
|
|
411
|
+
* undefined **Required Permissions** \"notification-management.email-templates.delete\"
|
|
412
412
|
* @param {number} id
|
|
413
413
|
* @param {string} [authorization] Bearer Token
|
|
414
414
|
* @param {*} [options] Override http request option.
|
|
@@ -418,7 +418,7 @@ export const NotificationTemplatesApiFactory = function (configuration?: Configu
|
|
|
418
418
|
return localVarFp.deleteNotificationTemplate(id, authorization, options).then((request) => request(axios, basePath));
|
|
419
419
|
},
|
|
420
420
|
/**
|
|
421
|
-
*
|
|
421
|
+
* undefined **Required Permissions** \"notification-management.email-templates.view\"
|
|
422
422
|
* @param {number} id
|
|
423
423
|
* @param {number} id2
|
|
424
424
|
* @param {string} [authorization] Bearer Token
|
|
@@ -430,23 +430,23 @@ export const NotificationTemplatesApiFactory = function (configuration?: Configu
|
|
|
430
430
|
return localVarFp.getNotificationTemplate(id, id2, authorization, expand, options).then((request) => request(axios, basePath));
|
|
431
431
|
},
|
|
432
432
|
/**
|
|
433
|
-
*
|
|
433
|
+
* undefined **Required Permissions** \"notification-management.email-templates.view\"
|
|
434
434
|
* @param {string} [authorization] Bearer Token
|
|
435
|
-
* @param {
|
|
436
|
-
* @param {
|
|
437
|
-
* @param {
|
|
438
|
-
* @param {
|
|
439
|
-
* @param {
|
|
440
|
-
* @param {
|
|
441
|
-
* @param {
|
|
435
|
+
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
436
|
+
* @param {string} [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.
|
|
437
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
|
|
438
|
+
* @param {string} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
439
|
+
* @param {string} [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.
|
|
440
|
+
* @param {string} [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.
|
|
441
|
+
* @param {string} [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.
|
|
442
442
|
* @param {*} [options] Override http request option.
|
|
443
443
|
* @throws {RequiredError}
|
|
444
444
|
*/
|
|
445
|
-
listNotificationTemplates(authorization?: string, pageSize?:
|
|
446
|
-
return localVarFp.listNotificationTemplates(authorization, pageSize, pageToken, filter,
|
|
445
|
+
listNotificationTemplates(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: any): AxiosPromise<ListNotificationTemplatesResponseClass> {
|
|
446
|
+
return localVarFp.listNotificationTemplates(authorization, pageSize, pageToken, filter, search, order, expand, filters, options).then((request) => request(axios, basePath));
|
|
447
447
|
},
|
|
448
448
|
/**
|
|
449
|
-
*
|
|
449
|
+
* undefined **Required Permissions** \"notification-management.email-templates.update\"
|
|
450
450
|
* @param {number} id
|
|
451
451
|
* @param {UpdateNotificationTemplateRequestDto} updateNotificationTemplateRequestDto
|
|
452
452
|
* @param {string} [authorization] Bearer Token
|
|
@@ -550,53 +550,53 @@ export interface NotificationTemplatesApiListNotificationTemplatesRequest {
|
|
|
550
550
|
readonly authorization?: string
|
|
551
551
|
|
|
552
552
|
/**
|
|
553
|
-
* A limit on the number of objects to be returned. Limit ranges between 1 and
|
|
554
|
-
* @type {
|
|
553
|
+
* A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
554
|
+
* @type {number}
|
|
555
555
|
* @memberof NotificationTemplatesApiListNotificationTemplates
|
|
556
556
|
*/
|
|
557
|
-
readonly pageSize?:
|
|
557
|
+
readonly pageSize?: number
|
|
558
558
|
|
|
559
559
|
/**
|
|
560
|
-
* 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,
|
|
561
|
-
* @type {
|
|
560
|
+
* 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.
|
|
561
|
+
* @type {string}
|
|
562
562
|
* @memberof NotificationTemplatesApiListNotificationTemplates
|
|
563
563
|
*/
|
|
564
|
-
readonly pageToken?:
|
|
564
|
+
readonly pageToken?: string
|
|
565
565
|
|
|
566
566
|
/**
|
|
567
567
|
* Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
|
|
568
|
-
* @type {
|
|
568
|
+
* @type {string}
|
|
569
569
|
* @memberof NotificationTemplatesApiListNotificationTemplates
|
|
570
570
|
*/
|
|
571
|
-
readonly filter?:
|
|
571
|
+
readonly filter?: string
|
|
572
572
|
|
|
573
573
|
/**
|
|
574
|
-
*
|
|
575
|
-
* @type {
|
|
574
|
+
* To search the list by any field, pass search=xxx to fetch the result.
|
|
575
|
+
* @type {string}
|
|
576
576
|
* @memberof NotificationTemplatesApiListNotificationTemplates
|
|
577
577
|
*/
|
|
578
|
-
readonly
|
|
578
|
+
readonly search?: string
|
|
579
579
|
|
|
580
580
|
/**
|
|
581
|
-
*
|
|
582
|
-
* @type {
|
|
581
|
+
* 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.
|
|
582
|
+
* @type {string}
|
|
583
583
|
* @memberof NotificationTemplatesApiListNotificationTemplates
|
|
584
584
|
*/
|
|
585
|
-
readonly
|
|
585
|
+
readonly order?: string
|
|
586
586
|
|
|
587
587
|
/**
|
|
588
|
-
*
|
|
589
|
-
* @type {
|
|
588
|
+
* 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.
|
|
589
|
+
* @type {string}
|
|
590
590
|
* @memberof NotificationTemplatesApiListNotificationTemplates
|
|
591
591
|
*/
|
|
592
|
-
readonly
|
|
592
|
+
readonly expand?: string
|
|
593
593
|
|
|
594
594
|
/**
|
|
595
|
-
*
|
|
596
|
-
* @type {
|
|
595
|
+
* 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.
|
|
596
|
+
* @type {string}
|
|
597
597
|
* @memberof NotificationTemplatesApiListNotificationTemplates
|
|
598
598
|
*/
|
|
599
|
-
readonly
|
|
599
|
+
readonly filters?: string
|
|
600
600
|
}
|
|
601
601
|
|
|
602
602
|
/**
|
|
@@ -635,7 +635,7 @@ export interface NotificationTemplatesApiUpdateNotificationTemplateRequest {
|
|
|
635
635
|
*/
|
|
636
636
|
export class NotificationTemplatesApi extends BaseAPI {
|
|
637
637
|
/**
|
|
638
|
-
*
|
|
638
|
+
* undefined **Required Permissions** \"notification-management.email-templates.create\"
|
|
639
639
|
* @param {NotificationTemplatesApiCreateNotificationTemplateRequest} requestParameters Request parameters.
|
|
640
640
|
* @param {*} [options] Override http request option.
|
|
641
641
|
* @throws {RequiredError}
|
|
@@ -646,7 +646,7 @@ export class NotificationTemplatesApi extends BaseAPI {
|
|
|
646
646
|
}
|
|
647
647
|
|
|
648
648
|
/**
|
|
649
|
-
*
|
|
649
|
+
* undefined **Required Permissions** \"notification-management.email-templates.delete\"
|
|
650
650
|
* @param {NotificationTemplatesApiDeleteNotificationTemplateRequest} requestParameters Request parameters.
|
|
651
651
|
* @param {*} [options] Override http request option.
|
|
652
652
|
* @throws {RequiredError}
|
|
@@ -657,7 +657,7 @@ export class NotificationTemplatesApi extends BaseAPI {
|
|
|
657
657
|
}
|
|
658
658
|
|
|
659
659
|
/**
|
|
660
|
-
*
|
|
660
|
+
* undefined **Required Permissions** \"notification-management.email-templates.view\"
|
|
661
661
|
* @param {NotificationTemplatesApiGetNotificationTemplateRequest} requestParameters Request parameters.
|
|
662
662
|
* @param {*} [options] Override http request option.
|
|
663
663
|
* @throws {RequiredError}
|
|
@@ -668,18 +668,18 @@ export class NotificationTemplatesApi extends BaseAPI {
|
|
|
668
668
|
}
|
|
669
669
|
|
|
670
670
|
/**
|
|
671
|
-
*
|
|
671
|
+
* undefined **Required Permissions** \"notification-management.email-templates.view\"
|
|
672
672
|
* @param {NotificationTemplatesApiListNotificationTemplatesRequest} requestParameters Request parameters.
|
|
673
673
|
* @param {*} [options] Override http request option.
|
|
674
674
|
* @throws {RequiredError}
|
|
675
675
|
* @memberof NotificationTemplatesApi
|
|
676
676
|
*/
|
|
677
677
|
public listNotificationTemplates(requestParameters: NotificationTemplatesApiListNotificationTemplatesRequest = {}, options?: AxiosRequestConfig) {
|
|
678
|
-
return NotificationTemplatesApiFp(this.configuration).listNotificationTemplates(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.
|
|
678
|
+
return NotificationTemplatesApiFp(this.configuration).listNotificationTemplates(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, options).then((request) => request(this.axios, this.basePath));
|
|
679
679
|
}
|
|
680
680
|
|
|
681
681
|
/**
|
|
682
|
-
*
|
|
682
|
+
* undefined **Required Permissions** \"notification-management.email-templates.update\"
|
|
683
683
|
* @param {NotificationTemplatesApiUpdateNotificationTemplateRequest} requestParameters Request parameters.
|
|
684
684
|
* @param {*} [options] Override http request option.
|
|
685
685
|
* @throws {RequiredError}
|
package/api/notifications-api.ts
CHANGED
|
@@ -35,7 +35,7 @@ const FormData = require('form-data');
|
|
|
35
35
|
export const NotificationsApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
36
36
|
return {
|
|
37
37
|
/**
|
|
38
|
-
*
|
|
38
|
+
* undefined **Required Permissions** none
|
|
39
39
|
* @param {SendNotificationRequestDto} sendNotificationRequestDto
|
|
40
40
|
* @param {string} [authorization] Bearer Token
|
|
41
41
|
* @param {*} [options] Override http request option.
|
|
@@ -91,7 +91,7 @@ export const NotificationsApiFp = function(configuration?: Configuration) {
|
|
|
91
91
|
const localVarAxiosParamCreator = NotificationsApiAxiosParamCreator(configuration)
|
|
92
92
|
return {
|
|
93
93
|
/**
|
|
94
|
-
*
|
|
94
|
+
* undefined **Required Permissions** none
|
|
95
95
|
* @param {SendNotificationRequestDto} sendNotificationRequestDto
|
|
96
96
|
* @param {string} [authorization] Bearer Token
|
|
97
97
|
* @param {*} [options] Override http request option.
|
|
@@ -112,7 +112,7 @@ export const NotificationsApiFactory = function (configuration?: Configuration,
|
|
|
112
112
|
const localVarFp = NotificationsApiFp(configuration)
|
|
113
113
|
return {
|
|
114
114
|
/**
|
|
115
|
-
*
|
|
115
|
+
* undefined **Required Permissions** none
|
|
116
116
|
* @param {SendNotificationRequestDto} sendNotificationRequestDto
|
|
117
117
|
* @param {string} [authorization] Bearer Token
|
|
118
118
|
* @param {*} [options] Override http request option.
|
|
@@ -153,7 +153,7 @@ export interface NotificationsApiSendNotificationRequest {
|
|
|
153
153
|
*/
|
|
154
154
|
export class NotificationsApi extends BaseAPI {
|
|
155
155
|
/**
|
|
156
|
-
*
|
|
156
|
+
* undefined **Required Permissions** none
|
|
157
157
|
* @param {NotificationsApiSendNotificationRequest} requestParameters Request parameters.
|
|
158
158
|
* @param {*} [options] Override http request option.
|
|
159
159
|
* @throws {RequiredError}
|
package/base.ts
CHANGED
|
@@ -44,9 +44,20 @@ export interface LoginClass {
|
|
|
44
44
|
permissions: string;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
export interface SwitchWorkspaceRequest {
|
|
48
|
+
username: string;
|
|
49
|
+
targetWorkspace: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface SwitchWorkspaceResponseClass {
|
|
53
|
+
accessToken: string;
|
|
54
|
+
permissions: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
47
57
|
export enum Environment {
|
|
48
58
|
Production = 'https://apiv2.emil.de',
|
|
49
59
|
Test = 'https://apiv2-test.emil.de',
|
|
60
|
+
Staging = 'https://apiv2-staging.emil.de',
|
|
50
61
|
Development = 'https://apiv2-dev.emil.de',
|
|
51
62
|
ProductionZurich = 'https://eu-central-2.apiv2.emil.de',
|
|
52
63
|
}
|
|
@@ -79,7 +90,6 @@ export class BaseAPI {
|
|
|
79
90
|
protected configuration: Configuration;
|
|
80
91
|
private username?: string;
|
|
81
92
|
private password?: string;
|
|
82
|
-
private permissions?: string;
|
|
83
93
|
|
|
84
94
|
constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
|
|
85
95
|
if (configuration) {
|
|
@@ -94,13 +104,13 @@ export class BaseAPI {
|
|
|
94
104
|
this.attachInterceptor(axios);
|
|
95
105
|
}
|
|
96
106
|
|
|
97
|
-
async initialize(env: Environment = Environment.Production) {
|
|
107
|
+
async initialize(env: Environment = Environment.Production, targetWorkspace?: string) {
|
|
98
108
|
this.configuration.basePath = env;
|
|
99
109
|
|
|
100
110
|
await this.loadCredentials();
|
|
101
111
|
|
|
102
112
|
if (this.username) {
|
|
103
|
-
await this.authorize(this.username, this.password);
|
|
113
|
+
await this.authorize(this.username, this.password, targetWorkspace);
|
|
104
114
|
this.password = null; // to avoid keeping password loaded in memory.
|
|
105
115
|
}
|
|
106
116
|
}
|
|
@@ -150,11 +160,7 @@ export class BaseAPI {
|
|
|
150
160
|
this.configuration.basePath = env;
|
|
151
161
|
}
|
|
152
162
|
|
|
153
|
-
|
|
154
|
-
return this.permissions.split(',');
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
async authorize(username: string, password: string): Promise<void> {
|
|
163
|
+
async authorize(username: string, password: string, targetWorkspace?: string): Promise<void> {
|
|
158
164
|
const options: AxiosRequestConfig = {
|
|
159
165
|
method: 'POST',
|
|
160
166
|
url: `${this.configuration.basePath}/authservice/v1/login`,
|
|
@@ -168,21 +174,52 @@ export class BaseAPI {
|
|
|
168
174
|
|
|
169
175
|
const response = await globalAxios.request<LoginClass>(options);
|
|
170
176
|
|
|
171
|
-
const { data: { accessToken
|
|
177
|
+
const { data: { accessToken } } = response;
|
|
172
178
|
this.configuration.username = username;
|
|
173
179
|
this.configuration.accessToken = `Bearer ${accessToken}`;
|
|
174
|
-
this.permissions = permissions;
|
|
175
180
|
|
|
176
181
|
const refreshToken = this.extractRefreshToken(response)
|
|
177
182
|
this.configuration.refreshToken = refreshToken;
|
|
183
|
+
|
|
184
|
+
// Switch workspace if provided
|
|
185
|
+
if (targetWorkspace) {
|
|
186
|
+
await this.switchWorkspace(targetWorkspace);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
async switchWorkspace(targetWorkspace: string): Promise<void> {
|
|
191
|
+
const options: AxiosRequestConfig = {
|
|
192
|
+
method: 'POST',
|
|
193
|
+
url: `${this.configuration.basePath}/authservice/v1/workspaces/switch`,
|
|
194
|
+
headers: {
|
|
195
|
+
'Content-Type': 'application/json',
|
|
196
|
+
'Authorization': `Bearer ${this.configuration.accessToken}`,
|
|
197
|
+
'Cookie': this.configuration.refreshToken,
|
|
198
|
+
},
|
|
199
|
+
data: {
|
|
200
|
+
username: this.configuration.username,
|
|
201
|
+
targetWorkspace,
|
|
202
|
+
} as SwitchWorkspaceRequest,
|
|
203
|
+
withCredentials: true,
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
const response = await globalAxios.request<SwitchWorkspaceResponseClass>(options);
|
|
207
|
+
|
|
208
|
+
const { data: { accessToken } } = response;
|
|
209
|
+
this.configuration.accessToken = `Bearer ${accessToken}`;
|
|
210
|
+
|
|
211
|
+
const refreshToken = this.extractRefreshToken(response);
|
|
212
|
+
if (refreshToken) {
|
|
213
|
+
this.configuration.refreshToken = refreshToken;
|
|
214
|
+
}
|
|
178
215
|
}
|
|
179
216
|
|
|
180
|
-
async refreshTokenInternal(): Promise<
|
|
217
|
+
async refreshTokenInternal(): Promise<string> {
|
|
181
218
|
const { username, refreshToken } = this.configuration;
|
|
182
219
|
|
|
183
220
|
|
|
184
221
|
if (!username || !refreshToken) {
|
|
185
|
-
|
|
222
|
+
return '';
|
|
186
223
|
}
|
|
187
224
|
|
|
188
225
|
const options: AxiosRequestConfig = {
|
|
@@ -196,9 +233,9 @@ export class BaseAPI {
|
|
|
196
233
|
withCredentials: true,
|
|
197
234
|
};
|
|
198
235
|
|
|
199
|
-
const
|
|
236
|
+
const { data: { accessToken } } = await globalAxios.request<LoginClass>(options);
|
|
200
237
|
|
|
201
|
-
return
|
|
238
|
+
return accessToken;
|
|
202
239
|
}
|
|
203
240
|
|
|
204
241
|
private extractRefreshToken(response: AxiosResponse): string {
|
|
@@ -227,11 +264,10 @@ export class BaseAPI {
|
|
|
227
264
|
if (err.response.status === 401 && !originalConfig._retry) {
|
|
228
265
|
originalConfig._retry = true;
|
|
229
266
|
try {
|
|
230
|
-
const
|
|
267
|
+
const tokenString = await this.refreshTokenInternal();
|
|
231
268
|
const accessToken = `Bearer ${tokenString}`;
|
|
232
|
-
this.permissions = permissions;
|
|
233
269
|
|
|
234
|
-
originalConfig.headers['Authorization'] =
|
|
270
|
+
originalConfig.headers['Authorization'] = accessToken;
|
|
235
271
|
|
|
236
272
|
this.configuration.accessToken = accessToken;
|
|
237
273
|
|
|
@@ -253,9 +289,8 @@ export class BaseAPI {
|
|
|
253
289
|
){
|
|
254
290
|
_retry_count++;
|
|
255
291
|
try {
|
|
256
|
-
const
|
|
292
|
+
const tokenString = await this.refreshTokenInternal();
|
|
257
293
|
const accessToken = `Bearer ${tokenString}`;
|
|
258
|
-
this.permissions = permissions;
|
|
259
294
|
|
|
260
295
|
_retry = true;
|
|
261
296
|
originalConfig.headers['Authorization'] = accessToken;
|
|
@@ -285,7 +320,7 @@ export class BaseAPI {
|
|
|
285
320
|
* @extends {Error}
|
|
286
321
|
*/
|
|
287
322
|
export class RequiredError extends Error {
|
|
288
|
-
name: "RequiredError" = "RequiredError";
|
|
323
|
+
override name: "RequiredError" = "RequiredError";
|
|
289
324
|
constructor(public field: string, msg?: string) {
|
|
290
325
|
super(msg);
|
|
291
326
|
}
|
package/common.ts
CHANGED
|
@@ -66,7 +66,7 @@ export const setBearerAuthToObject = async function (object: any, configuration?
|
|
|
66
66
|
const accessToken = typeof configuration.accessToken === 'function'
|
|
67
67
|
? await configuration.accessToken()
|
|
68
68
|
: await configuration.accessToken;
|
|
69
|
-
object["Authorization"] =
|
|
69
|
+
object["Authorization"] = configuration.getBearerToken(accessToken);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
|
|
@@ -79,7 +79,7 @@ export const setOAuthToObject = async function (object: any, name: string, scope
|
|
|
79
79
|
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
|
|
80
80
|
? await configuration.accessToken(name, scopes)
|
|
81
81
|
: await configuration.accessToken;
|
|
82
|
-
object["Authorization"] =
|
|
82
|
+
object["Authorization"] = configuration.getBearerToken(localVarAccessTokenValue);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
|
package/configuration.ts
CHANGED
|
@@ -106,4 +106,13 @@ export class Configuration {
|
|
|
106
106
|
const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
|
|
107
107
|
return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
|
|
108
108
|
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Returns "Bearer" token.
|
|
112
|
+
* @param token - access token.
|
|
113
|
+
* @return Bearer token.
|
|
114
|
+
*/
|
|
115
|
+
public getBearerToken(token?: string): string {
|
|
116
|
+
return ('' + token).startsWith("Bearer") ? token : "Bearer " + token;
|
|
117
|
+
}
|
|
109
118
|
}
|
|
@@ -19,7 +19,8 @@ import { InlineResponse200 } from '../models';
|
|
|
19
19
|
*/
|
|
20
20
|
export declare const DefaultApiAxiosParamCreator: (configuration?: Configuration) => {
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* Returns the health status of the notification service. This endpoint is used to monitor the operational status of the notification service. It typically returns a simple status indicator, such as \'UP\' or \'OK\', confirming that the service is operational and available.
|
|
23
|
+
* @summary Health Check
|
|
23
24
|
* @param {*} [options] Override http request option.
|
|
24
25
|
* @throws {RequiredError}
|
|
25
26
|
*/
|
|
@@ -31,7 +32,8 @@ export declare const DefaultApiAxiosParamCreator: (configuration?: Configuration
|
|
|
31
32
|
*/
|
|
32
33
|
export declare const DefaultApiFp: (configuration?: Configuration) => {
|
|
33
34
|
/**
|
|
34
|
-
*
|
|
35
|
+
* Returns the health status of the notification service. This endpoint is used to monitor the operational status of the notification service. It typically returns a simple status indicator, such as \'UP\' or \'OK\', confirming that the service is operational and available.
|
|
36
|
+
* @summary Health Check
|
|
35
37
|
* @param {*} [options] Override http request option.
|
|
36
38
|
* @throws {RequiredError}
|
|
37
39
|
*/
|
|
@@ -43,7 +45,8 @@ export declare const DefaultApiFp: (configuration?: Configuration) => {
|
|
|
43
45
|
*/
|
|
44
46
|
export declare const DefaultApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
|
|
45
47
|
/**
|
|
46
|
-
*
|
|
48
|
+
* Returns the health status of the notification service. This endpoint is used to monitor the operational status of the notification service. It typically returns a simple status indicator, such as \'UP\' or \'OK\', confirming that the service is operational and available.
|
|
49
|
+
* @summary Health Check
|
|
47
50
|
* @param {*} [options] Override http request option.
|
|
48
51
|
* @throws {RequiredError}
|
|
49
52
|
*/
|
|
@@ -57,7 +60,8 @@ export declare const DefaultApiFactory: (configuration?: Configuration, basePath
|
|
|
57
60
|
*/
|
|
58
61
|
export declare class DefaultApi extends BaseAPI {
|
|
59
62
|
/**
|
|
60
|
-
*
|
|
63
|
+
* Returns the health status of the notification service. This endpoint is used to monitor the operational status of the notification service. It typically returns a simple status indicator, such as \'UP\' or \'OK\', confirming that the service is operational and available.
|
|
64
|
+
* @summary Health Check
|
|
61
65
|
* @param {*} [options] Override http request option.
|
|
62
66
|
* @throws {RequiredError}
|
|
63
67
|
* @memberof DefaultApi
|