@develit-services/notification 0.6.3 → 1.0.1

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.
@@ -138,7 +138,7 @@ let NotificationServiceBase = class extends backendSdk.develitWorker(
138
138
  async _sendEmail(input) {
139
139
  return this.handleAction(
140
140
  { data: input, schema: webhook_connector.sendEmailInputSchema },
141
- { successMessage: "Email sent." },
141
+ { successMessage: "Email sent.", sensitiveKeys: ["attachments"] },
142
142
  async (params) => {
143
143
  const {
144
144
  email,
@@ -175,10 +175,10 @@ let NotificationServiceBase = class extends backendSdk.develitWorker(
175
175
  userAgent,
176
176
  outcome: "success",
177
177
  description: `Email sent to ${email.to}`,
178
- details: JSON.stringify({
178
+ details: {
179
179
  subject: email.subject,
180
180
  templateId: email.templateId
181
- })
181
+ }
182
182
  });
183
183
  } catch (e) {
184
184
  console.error("Failed to push email audit log", e);
@@ -229,7 +229,7 @@ let NotificationServiceBase = class extends backendSdk.develitWorker(
229
229
  userAgent,
230
230
  outcome: "success",
231
231
  description: `SMS sent to ${to}`,
232
- details: JSON.stringify({ message })
232
+ details: { message }
233
233
  });
234
234
  } catch (e) {
235
235
  console.error("Failed to push sms audit log", e);
@@ -241,7 +241,7 @@ let NotificationServiceBase = class extends backendSdk.develitWorker(
241
241
  async sendEmail(input) {
242
242
  return this.handleAction(
243
243
  { data: input, schema: webhook_connector.sendEmailInputSchema },
244
- { successMessage: "Email sent." },
244
+ { successMessage: "Email sent.", sensitiveKeys: ["attachments"] },
245
245
  async (params) => {
246
246
  const { email, metadata } = params;
247
247
  await this.pushToQueue(
@@ -259,17 +259,7 @@ let NotificationServiceBase = class extends backendSdk.develitWorker(
259
259
  );
260
260
  }
261
261
  async sendEmailSync(input) {
262
- return this.handleAction(
263
- { data: input, schema: webhook_connector.sendEmailInputSchema },
264
- { successMessage: "Email sent." },
265
- async (params) => {
266
- const { email, metadata } = params;
267
- return this._sendEmail({
268
- email,
269
- metadata
270
- });
271
- }
272
- );
262
+ return this._sendEmail(input);
273
263
  }
274
264
  async sendSms(input) {
275
265
  return this.handleAction(
@@ -329,9 +319,9 @@ let NotificationServiceBase = class extends backendSdk.develitWorker(
329
319
  userAgent: metadata?.userAgent,
330
320
  outcome: "success",
331
321
  description: "Slack notification sent",
332
- details: JSON.stringify({
322
+ details: {
333
323
  message: slack.message
334
- })
324
+ }
335
325
  });
336
326
  return {};
337
327
  }
@@ -398,9 +388,9 @@ let NotificationServiceBase = class extends backendSdk.develitWorker(
398
388
  userAgent,
399
389
  outcome: "success",
400
390
  description: `Webhook sent to ${webhook.url}`,
401
- details: JSON.stringify({
391
+ details: {
402
392
  url: webhook.url
403
- })
393
+ }
404
394
  });
405
395
  } catch (e) {
406
396
  console.error("Failed to push webhook audit log", e);
@@ -134,7 +134,7 @@ let NotificationServiceBase = class extends develitWorker(
134
134
  async _sendEmail(input) {
135
135
  return this.handleAction(
136
136
  { data: input, schema: sendEmailInputSchema },
137
- { successMessage: "Email sent." },
137
+ { successMessage: "Email sent.", sensitiveKeys: ["attachments"] },
138
138
  async (params) => {
139
139
  const {
140
140
  email,
@@ -171,10 +171,10 @@ let NotificationServiceBase = class extends develitWorker(
171
171
  userAgent,
172
172
  outcome: "success",
173
173
  description: `Email sent to ${email.to}`,
174
- details: JSON.stringify({
174
+ details: {
175
175
  subject: email.subject,
176
176
  templateId: email.templateId
177
- })
177
+ }
178
178
  });
179
179
  } catch (e) {
180
180
  console.error("Failed to push email audit log", e);
@@ -225,7 +225,7 @@ let NotificationServiceBase = class extends develitWorker(
225
225
  userAgent,
226
226
  outcome: "success",
227
227
  description: `SMS sent to ${to}`,
228
- details: JSON.stringify({ message })
228
+ details: { message }
229
229
  });
230
230
  } catch (e) {
231
231
  console.error("Failed to push sms audit log", e);
@@ -237,7 +237,7 @@ let NotificationServiceBase = class extends develitWorker(
237
237
  async sendEmail(input) {
238
238
  return this.handleAction(
239
239
  { data: input, schema: sendEmailInputSchema },
240
- { successMessage: "Email sent." },
240
+ { successMessage: "Email sent.", sensitiveKeys: ["attachments"] },
241
241
  async (params) => {
242
242
  const { email, metadata } = params;
243
243
  await this.pushToQueue(
@@ -255,17 +255,7 @@ let NotificationServiceBase = class extends develitWorker(
255
255
  );
256
256
  }
257
257
  async sendEmailSync(input) {
258
- return this.handleAction(
259
- { data: input, schema: sendEmailInputSchema },
260
- { successMessage: "Email sent." },
261
- async (params) => {
262
- const { email, metadata } = params;
263
- return this._sendEmail({
264
- email,
265
- metadata
266
- });
267
- }
268
- );
258
+ return this._sendEmail(input);
269
259
  }
270
260
  async sendSms(input) {
271
261
  return this.handleAction(
@@ -325,9 +315,9 @@ let NotificationServiceBase = class extends develitWorker(
325
315
  userAgent: metadata?.userAgent,
326
316
  outcome: "success",
327
317
  description: "Slack notification sent",
328
- details: JSON.stringify({
318
+ details: {
329
319
  message: slack.message
330
- })
320
+ }
331
321
  });
332
322
  return {};
333
323
  }
@@ -394,9 +384,9 @@ let NotificationServiceBase = class extends develitWorker(
394
384
  userAgent,
395
385
  outcome: "success",
396
386
  description: `Webhook sent to ${webhook.url}`,
397
- details: JSON.stringify({
387
+ details: {
398
388
  url: webhook.url
399
- })
389
+ }
400
390
  });
401
391
  } catch (e) {
402
392
  console.error("Failed to push webhook audit log", e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@develit-services/notification",
3
- "version": "0.6.3",
3
+ "version": "1.0.1",
4
4
  "author": "Develit.io s.r.o.",
5
5
  "type": "module",
6
6
  "exports": {