@emilgroup/notification-sdk 0.8.1-beta.7 → 0.8.1-beta.71

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.
Files changed (122) hide show
  1. package/.openapi-generator/FILES +25 -0
  2. package/README.md +2 -2
  3. package/api/email-mailboxes-api.ts +153 -0
  4. package/api/email-messages-api.ts +197 -40
  5. package/api/email-subscriptions-api.ts +799 -0
  6. package/api/email-tracking-api.ts +313 -52
  7. package/api/email-verifications-api.ts +32 -14
  8. package/api/health-api.ts +1 -1
  9. package/api/layouts-api.ts +96 -51
  10. package/api/msgraph-webhooks-api.ts +278 -0
  11. package/api/notification-templates-api.ts +96 -51
  12. package/api/notifications-api.ts +128 -7
  13. package/api.ts +6 -0
  14. package/base.ts +239 -43
  15. package/common.ts +3 -2
  16. package/configuration.ts +20 -0
  17. package/dist/api/email-mailboxes-api.d.ts +87 -0
  18. package/dist/api/email-mailboxes-api.js +225 -0
  19. package/dist/api/email-messages-api.d.ts +110 -32
  20. package/dist/api/email-messages-api.js +199 -56
  21. package/dist/api/email-subscriptions-api.d.ts +432 -0
  22. package/dist/api/email-subscriptions-api.js +761 -0
  23. package/dist/api/email-tracking-api.d.ts +174 -44
  24. package/dist/api/email-tracking-api.js +299 -64
  25. package/dist/api/email-verifications-api.d.ts +18 -10
  26. package/dist/api/email-verifications-api.js +46 -24
  27. package/dist/api/health-api.d.ts +1 -1
  28. package/dist/api/health-api.js +1 -1
  29. package/dist/api/layouts-api.d.ts +61 -41
  30. package/dist/api/layouts-api.js +119 -70
  31. package/dist/api/msgraph-webhooks-api.d.ts +168 -0
  32. package/dist/api/msgraph-webhooks-api.js +305 -0
  33. package/dist/api/notification-templates-api.d.ts +61 -41
  34. package/dist/api/notification-templates-api.js +119 -70
  35. package/dist/api/notifications-api.d.ts +66 -5
  36. package/dist/api/notifications-api.js +123 -12
  37. package/dist/api.d.ts +3 -0
  38. package/dist/api.js +3 -0
  39. package/dist/base.d.ts +26 -0
  40. package/dist/base.js +243 -60
  41. package/dist/common.d.ts +1 -1
  42. package/dist/common.js +1 -0
  43. package/dist/configuration.d.ts +17 -0
  44. package/dist/configuration.js +2 -0
  45. package/dist/models/assign-email-thread-entity-body-dto.d.ts +43 -0
  46. package/dist/models/assign-email-thread-entity-body-dto.js +22 -0
  47. package/dist/models/assign-email-thread-entity-response-class.d.ts +25 -0
  48. package/dist/models/assign-email-thread-entity-response-class.js +15 -0
  49. package/dist/models/catch-up-email-subscription-response-class.d.ts +24 -0
  50. package/dist/models/catch-up-email-subscription-response-class.js +15 -0
  51. package/dist/models/catch-up-email-subscriptions-request-dto.d.ts +24 -0
  52. package/dist/models/catch-up-email-subscriptions-request-dto.js +15 -0
  53. package/dist/models/catch-up-email-subscriptions-response-class.d.ts +30 -0
  54. package/dist/models/catch-up-email-subscriptions-response-class.js +15 -0
  55. package/dist/models/email-mailbox-class.d.ts +47 -0
  56. package/dist/models/email-mailbox-class.js +20 -0
  57. package/dist/models/email-message-class.d.ts +102 -7
  58. package/dist/models/email-message-class.js +25 -2
  59. package/dist/models/email-message-summary-class.d.ts +121 -0
  60. package/dist/models/email-message-summary-class.js +37 -0
  61. package/dist/models/email-subscription-class.d.ts +110 -0
  62. package/dist/models/email-subscription-class.js +23 -0
  63. package/dist/models/email-thread-class.d.ts +37 -5
  64. package/dist/models/entity-ref-class.d.ts +37 -0
  65. package/dist/models/entity-ref-class.js +22 -0
  66. package/dist/models/get-email-subscription-response-class.d.ts +25 -0
  67. package/dist/models/get-email-subscription-response-class.js +15 -0
  68. package/dist/models/grpc-send-email-request-dto.d.ts +137 -0
  69. package/dist/models/grpc-send-email-request-dto.js +22 -0
  70. package/dist/models/index.d.ts +22 -0
  71. package/dist/models/index.js +22 -0
  72. package/dist/models/inline-attachment-dto.d.ts +36 -0
  73. package/dist/models/inline-attachment-dto.js +15 -0
  74. package/dist/models/list-email-mailboxes-response-class.d.ts +43 -0
  75. package/dist/models/list-email-mailboxes-response-class.js +15 -0
  76. package/dist/models/list-email-subscriptions-response-class.d.ts +43 -0
  77. package/dist/models/list-email-subscriptions-response-class.js +15 -0
  78. package/dist/models/reconcile-email-subscriptions-request-dto.d.ts +24 -0
  79. package/dist/models/reconcile-email-subscriptions-request-dto.js +15 -0
  80. package/dist/models/reconcile-email-subscriptions-response-class.d.ts +48 -0
  81. package/dist/models/reconcile-email-subscriptions-response-class.js +15 -0
  82. package/dist/models/renew-email-subscription-response-class.d.ts +25 -0
  83. package/dist/models/renew-email-subscription-response-class.js +15 -0
  84. package/dist/models/resend-email-message-body-dto.d.ts +30 -0
  85. package/dist/models/resend-email-message-body-dto.js +15 -0
  86. package/dist/models/resend-email-message-response-class.d.ts +25 -0
  87. package/dist/models/resend-email-message-response-class.js +15 -0
  88. package/dist/models/send-email-request-dto.d.ts +131 -0
  89. package/dist/models/send-email-request-dto.js +22 -0
  90. package/dist/models/send-email-response-class.d.ts +24 -0
  91. package/dist/models/send-email-response-class.js +15 -0
  92. package/dist/models/send-notification-request-dto.d.ts +10 -1
  93. package/dist/models/send-notification-request-dto.js +2 -1
  94. package/dist/models/unassign-email-thread-entity-response-class.d.ts +25 -0
  95. package/dist/models/unassign-email-thread-entity-response-class.js +15 -0
  96. package/models/assign-email-thread-entity-body-dto.ts +52 -0
  97. package/models/assign-email-thread-entity-response-class.ts +31 -0
  98. package/models/catch-up-email-subscription-response-class.ts +30 -0
  99. package/models/catch-up-email-subscriptions-request-dto.ts +30 -0
  100. package/models/catch-up-email-subscriptions-response-class.ts +36 -0
  101. package/models/email-mailbox-class.ts +56 -0
  102. package/models/email-message-class.ts +108 -8
  103. package/models/email-message-summary-class.ts +133 -0
  104. package/models/email-subscription-class.ts +119 -0
  105. package/models/email-thread-class.ts +37 -5
  106. package/models/entity-ref-class.ts +46 -0
  107. package/models/get-email-subscription-response-class.ts +31 -0
  108. package/models/grpc-send-email-request-dto.ts +144 -0
  109. package/models/index.ts +22 -0
  110. package/models/inline-attachment-dto.ts +42 -0
  111. package/models/list-email-mailboxes-response-class.ts +49 -0
  112. package/models/list-email-subscriptions-response-class.ts +49 -0
  113. package/models/reconcile-email-subscriptions-request-dto.ts +30 -0
  114. package/models/reconcile-email-subscriptions-response-class.ts +54 -0
  115. package/models/renew-email-subscription-response-class.ts +31 -0
  116. package/models/resend-email-message-body-dto.ts +36 -0
  117. package/models/resend-email-message-response-class.ts +31 -0
  118. package/models/send-email-request-dto.ts +138 -0
  119. package/models/send-email-response-class.ts +30 -0
  120. package/models/send-notification-request-dto.ts +9 -2
  121. package/models/unassign-email-thread-entity-response-class.ts +31 -0
  122. package/package.json +2 -2
@@ -93,7 +93,64 @@ var NotificationsApiAxiosParamCreator = function (configuration) {
93
93
  var _this = this;
94
94
  return {
95
95
  /**
96
- * undefined **Required Permissions** none
96
+ * Sends an email with a caller-supplied HTML and/or text body, delivered as given. Attachments can reference documents already in S3 or be sent inline as base64. **Required Permissions** none
97
+ * @summary Send an email without a template
98
+ * @param {SendEmailRequestDto} sendEmailRequestDto
99
+ * @param {string} [authorization] Bearer Token
100
+ * @param {*} [options] Override http request option.
101
+ * @throws {RequiredError}
102
+ */
103
+ sendEmail: function (sendEmailRequestDto, authorization, options) {
104
+ if (options === void 0) { options = {}; }
105
+ return __awaiter(_this, void 0, void 0, function () {
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) {
110
+ case 0:
111
+ // verify required parameter 'sendEmailRequestDto' is not null or undefined
112
+ (0, common_1.assertParamExists)('sendEmail', 'sendEmailRequestDto', sendEmailRequestDto);
113
+ localVarPath = "/notificationservice/v1/notifications/emails";
114
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
115
+ if (configuration) {
116
+ baseOptions = configuration.baseOptions;
117
+ baseAccessToken = configuration.accessToken;
118
+ }
119
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
120
+ localVarHeaderParameter = {};
121
+ localVarQueryParameter = {};
122
+ // authentication bearer required
123
+ // http bearer authentication required
124
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
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.
127
+ ];
128
+ case 1:
129
+ // authentication bearer required
130
+ // http bearer authentication required
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) {
136
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
137
+ }
138
+ localVarHeaderParameter['Content-Type'] = 'application/json';
139
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
140
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
141
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
142
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(sendEmailRequestDto, localVarRequestOptions, configuration);
143
+ return [2 /*return*/, {
144
+ url: (0, common_1.toPathString)(localVarUrlObj),
145
+ options: localVarRequestOptions,
146
+ }];
147
+ }
148
+ });
149
+ });
150
+ },
151
+ /**
152
+ * Sends an email using the notification template identified by `templateSlug`. Provide `entityType` and `entityCode` to track replies in an email thread. **Required Permissions** none
153
+ * @summary Send a notification
97
154
  * @param {SendNotificationRequestDto} sendNotificationRequestDto
98
155
  * @param {string} [authorization] Bearer Token
99
156
  * @param {*} [options] Override http request option.
@@ -102,9 +159,10 @@ var NotificationsApiAxiosParamCreator = function (configuration) {
102
159
  sendNotification: function (sendNotificationRequestDto, authorization, options) {
103
160
  if (options === void 0) { options = {}; }
104
161
  return __awaiter(_this, void 0, void 0, function () {
105
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
106
- return __generator(this, function (_a) {
107
- switch (_a.label) {
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) {
108
166
  case 0:
109
167
  // verify required parameter 'sendNotificationRequestDto' is not null or undefined
110
168
  (0, common_1.assertParamExists)('sendNotification', 'sendNotificationRequestDto', sendNotificationRequestDto);
@@ -119,13 +177,19 @@ var NotificationsApiAxiosParamCreator = function (configuration) {
119
177
  localVarQueryParameter = {};
120
178
  // authentication bearer required
121
179
  // http bearer authentication required
122
- return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
180
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
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.
183
+ ];
123
184
  case 1:
124
185
  // authentication bearer required
125
186
  // http bearer authentication required
126
- _a.sent();
127
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
128
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
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) {
192
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
129
193
  }
130
194
  localVarHeaderParameter['Content-Type'] = 'application/json';
131
195
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
@@ -151,7 +215,29 @@ var NotificationsApiFp = function (configuration) {
151
215
  var localVarAxiosParamCreator = (0, exports.NotificationsApiAxiosParamCreator)(configuration);
152
216
  return {
153
217
  /**
154
- * undefined **Required Permissions** none
218
+ * Sends an email with a caller-supplied HTML and/or text body, delivered as given. Attachments can reference documents already in S3 or be sent inline as base64. **Required Permissions** none
219
+ * @summary Send an email without a template
220
+ * @param {SendEmailRequestDto} sendEmailRequestDto
221
+ * @param {string} [authorization] Bearer Token
222
+ * @param {*} [options] Override http request option.
223
+ * @throws {RequiredError}
224
+ */
225
+ sendEmail: function (sendEmailRequestDto, authorization, options) {
226
+ return __awaiter(this, void 0, void 0, function () {
227
+ var localVarAxiosArgs;
228
+ return __generator(this, function (_a) {
229
+ switch (_a.label) {
230
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.sendEmail(sendEmailRequestDto, authorization, options)];
231
+ case 1:
232
+ localVarAxiosArgs = _a.sent();
233
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
234
+ }
235
+ });
236
+ });
237
+ },
238
+ /**
239
+ * Sends an email using the notification template identified by `templateSlug`. Provide `entityType` and `entityCode` to track replies in an email thread. **Required Permissions** none
240
+ * @summary Send a notification
155
241
  * @param {SendNotificationRequestDto} sendNotificationRequestDto
156
242
  * @param {string} [authorization] Bearer Token
157
243
  * @param {*} [options] Override http request option.
@@ -181,7 +267,19 @@ var NotificationsApiFactory = function (configuration, basePath, axios) {
181
267
  var localVarFp = (0, exports.NotificationsApiFp)(configuration);
182
268
  return {
183
269
  /**
184
- * undefined **Required Permissions** none
270
+ * Sends an email with a caller-supplied HTML and/or text body, delivered as given. Attachments can reference documents already in S3 or be sent inline as base64. **Required Permissions** none
271
+ * @summary Send an email without a template
272
+ * @param {SendEmailRequestDto} sendEmailRequestDto
273
+ * @param {string} [authorization] Bearer Token
274
+ * @param {*} [options] Override http request option.
275
+ * @throws {RequiredError}
276
+ */
277
+ sendEmail: function (sendEmailRequestDto, authorization, options) {
278
+ return localVarFp.sendEmail(sendEmailRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
279
+ },
280
+ /**
281
+ * Sends an email using the notification template identified by `templateSlug`. Provide `entityType` and `entityCode` to track replies in an email thread. **Required Permissions** none
282
+ * @summary Send a notification
185
283
  * @param {SendNotificationRequestDto} sendNotificationRequestDto
186
284
  * @param {string} [authorization] Bearer Token
187
285
  * @param {*} [options] Override http request option.
@@ -205,7 +303,20 @@ var NotificationsApi = /** @class */ (function (_super) {
205
303
  return _super !== null && _super.apply(this, arguments) || this;
206
304
  }
207
305
  /**
208
- * undefined **Required Permissions** none
306
+ * Sends an email with a caller-supplied HTML and/or text body, delivered as given. Attachments can reference documents already in S3 or be sent inline as base64. **Required Permissions** none
307
+ * @summary Send an email without a template
308
+ * @param {NotificationsApiSendEmailRequest} requestParameters Request parameters.
309
+ * @param {*} [options] Override http request option.
310
+ * @throws {RequiredError}
311
+ * @memberof NotificationsApi
312
+ */
313
+ NotificationsApi.prototype.sendEmail = function (requestParameters, options) {
314
+ var _this = this;
315
+ return (0, exports.NotificationsApiFp)(this.configuration).sendEmail(requestParameters.sendEmailRequestDto, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
316
+ };
317
+ /**
318
+ * Sends an email using the notification template identified by `templateSlug`. Provide `entityType` and `entityCode` to track replies in an email thread. **Required Permissions** none
319
+ * @summary Send a notification
209
320
  * @param {NotificationsApiSendNotificationRequest} requestParameters Request parameters.
210
321
  * @param {*} [options] Override http request option.
211
322
  * @throws {RequiredError}
@@ -213,7 +324,7 @@ var NotificationsApi = /** @class */ (function (_super) {
213
324
  */
214
325
  NotificationsApi.prototype.sendNotification = function (requestParameters, options) {
215
326
  var _this = this;
216
- return (0, exports.NotificationsApiFp)(this.configuration).sendNotification(requestParameters.sendNotificationRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
327
+ return (0, exports.NotificationsApiFp)(this.configuration).sendNotification(requestParameters.sendNotificationRequestDto, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
217
328
  };
218
329
  return NotificationsApi;
219
330
  }(base_1.BaseAPI));
package/dist/api.d.ts CHANGED
@@ -9,10 +9,13 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ export * from './api/email-mailboxes-api';
12
13
  export * from './api/email-messages-api';
14
+ export * from './api/email-subscriptions-api';
13
15
  export * from './api/email-tracking-api';
14
16
  export * from './api/email-verifications-api';
15
17
  export * from './api/health-api';
16
18
  export * from './api/layouts-api';
19
+ export * from './api/msgraph-webhooks-api';
17
20
  export * from './api/notification-templates-api';
18
21
  export * from './api/notifications-api';
package/dist/api.js CHANGED
@@ -27,10 +27,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
27
27
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
28
28
  };
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
+ __exportStar(require("./api/email-mailboxes-api"), exports);
30
31
  __exportStar(require("./api/email-messages-api"), exports);
32
+ __exportStar(require("./api/email-subscriptions-api"), exports);
31
33
  __exportStar(require("./api/email-tracking-api"), exports);
32
34
  __exportStar(require("./api/email-verifications-api"), exports);
33
35
  __exportStar(require("./api/health-api"), exports);
34
36
  __exportStar(require("./api/layouts-api"), exports);
37
+ __exportStar(require("./api/msgraph-webhooks-api"), exports);
35
38
  __exportStar(require("./api/notification-templates-api"), exports);
36
39
  __exportStar(require("./api/notifications-api"), exports);
package/dist/base.d.ts CHANGED
@@ -22,9 +22,19 @@ export declare const COLLECTION_FORMATS: {
22
22
  tsv: string;
23
23
  pipes: string;
24
24
  };
25
+ export interface SessionClass {
26
+ sub: string;
27
+ username?: string;
28
+ email?: string;
29
+ tenantSlug?: string;
30
+ permissions?: string;
31
+ expiresAt?: number;
32
+ }
25
33
  export interface LoginClass {
26
34
  accessToken: string;
27
35
  permissions: string;
36
+ authMode?: string;
37
+ session?: SessionClass;
28
38
  }
29
39
  export interface SwitchWorkspaceRequest {
30
40
  username: string;
@@ -33,6 +43,8 @@ export interface SwitchWorkspaceRequest {
33
43
  export interface SwitchWorkspaceResponseClass {
34
44
  accessToken: string;
35
45
  permissions: string;
46
+ authMode?: string;
47
+ session?: SessionClass;
36
48
  }
37
49
  export declare enum Environment {
38
50
  Production = "https://apiv2.emil.de",
@@ -63,6 +75,18 @@ export declare class BaseAPI {
63
75
  protected configuration: Configuration | undefined;
64
76
  private tokenData?;
65
77
  constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
78
+ private sessionAccount;
79
+ private authBasePath;
80
+ private usesSession;
81
+ private useSessionAuth;
82
+ private useHeaderAuth;
83
+ private applyTokenReply;
84
+ private sessionHeaders;
85
+ private withCurrentAuth;
86
+ private canRetryWithToken;
87
+ private canResend;
88
+ private switchToToken;
89
+ private retryWithToken;
66
90
  selectEnvironment(env: Environment): void;
67
91
  selectBasePath(path: string): void;
68
92
  getPermissions(): Array<string>;
@@ -72,6 +96,8 @@ export declare class BaseAPI {
72
96
  private storeTokenData;
73
97
  loadTokenData(): void;
74
98
  cleanTokenData(): void;
99
+ private ownAccount;
100
+ protected withOwner(options?: AxiosRequestConfig): AxiosRequestConfig;
75
101
  private attachInterceptor;
76
102
  }
77
103
  /**