@etainabl/nodejs-sdk 1.3.174 → 1.3.176

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/dist/index.js CHANGED
@@ -75978,8 +75978,10 @@ var init_dist_es53 = __esm({
75978
75978
  // src/index.ts
75979
75979
  var index_exports = {};
75980
75980
  __export(index_exports, {
75981
+ EventNamesByCategory: () => EventNamesByCategory,
75981
75982
  NotificationCategoryList: () => NotificationCategoryList,
75982
75983
  NotificationDefaultChannels: () => NotificationDefaultChannels,
75984
+ NotificationTemplateCategories: () => NotificationTemplateCategories,
75983
75985
  ObjectId: () => import_mongodb2.ObjectId,
75984
75986
  api: () => api_default,
75985
75987
  consumption: () => consumption_exports,
@@ -76219,12 +76221,6 @@ var api_default = (auth, instanceOptions = {}) => {
76219
76221
  removeAccount: factory.remove(etainablApi, "accounts"),
76220
76222
  getAccountSchema: factory.get(etainablApi, "accounts", "schema"),
76221
76223
  invalidateAccountCache: factory.customWithId(etainablApi, "put", "accounts", "invalidate-cache"),
76222
- // alert templates
76223
- getAlertTemplate: factory.getWithId(etainablApi, "alert-templates"),
76224
- listAlertTemplates: factory.list(etainablApi, "alert-templates"),
76225
- updateAlertTemplate: factory.update(etainablApi, "alert-templates"),
76226
- createAlertTemplate: factory.create(etainablApi, "alert-templates"),
76227
- removeAlertTemplate: factory.remove(etainablApi, "alert-templates"),
76228
76224
  // alert triggers
76229
76225
  getAlertTrigger: factory.getWithId(etainablApi, "alert-triggers"),
76230
76226
  listAlertTriggers: factory.list(etainablApi, "alert-triggers"),
@@ -76238,6 +76234,15 @@ var api_default = (auth, instanceOptions = {}) => {
76238
76234
  ),
76239
76235
  retryAlertTrigger: factory.customWithId(etainablApi, "post", "alert-triggers", "retry"),
76240
76236
  cancelAlertTrigger: factory.customWithId(etainablApi, "post", "alert-triggers", "cancel"),
76237
+ // custom alert triggers
76238
+ getCustomAlertTrigger: factory.getWithId(etainablApi, "custom-alert-triggers"),
76239
+ listCustomAlertTriggers: factory.list(etainablApi, "custom-alert-triggers"),
76240
+ updateCustomAlertTrigger: factory.update(etainablApi, "custom-alert-triggers"),
76241
+ bulkUpdateCustomAlertTriggers: factory.create(
76242
+ etainablApi,
76243
+ "custom-alert-triggers",
76244
+ "bulk-update"
76245
+ ),
76241
76246
  // assets
76242
76247
  getAsset: factory.getWithId(etainablApi, "assets"),
76243
76248
  listAssets: factory.list(etainablApi, "assets"),
@@ -76306,6 +76311,12 @@ var api_default = (auth, instanceOptions = {}) => {
76306
76311
  createLog: factory.create(etainablApi, "logs"),
76307
76312
  createLogBulk: factory.create(etainablApi, "logs", "bulk"),
76308
76313
  removeLog: factory.remove(etainablApi, "logs"),
76314
+ getJob: factory.getWithId(etainablApi, "jobs"),
76315
+ listJobs: factory.list(etainablApi, "jobs"),
76316
+ updateJob: factory.update(etainablApi, "jobs"),
76317
+ createJob: factory.create(etainablApi, "jobs"),
76318
+ createJobBulk: factory.create(etainablApi, "jobs", "bulk"),
76319
+ removeJob: factory.remove(etainablApi, "jobs"),
76309
76320
  // notifications
76310
76321
  getNotification: factory.getWithId(etainablApi, "notifications"),
76311
76322
  listNotifications: factory.list(etainablApi, "notifications"),
@@ -76314,6 +76325,12 @@ var api_default = (auth, instanceOptions = {}) => {
76314
76325
  bulkCreateNotifications: factory.create(etainablApi, "notifications", "bulk"),
76315
76326
  bulkUpdateNotificationDeliveryStatus: factory.create(etainablApi, "notifications", "bulk-delivery-status"),
76316
76327
  removeNotification: factory.remove(etainablApi, "notifications"),
76328
+ // notification templates
76329
+ getNotificationTemplate: factory.getWithId(etainablApi, "notification-templates"),
76330
+ listNotificationTemplates: factory.list(etainablApi, "notification-templates"),
76331
+ updateNotificationTemplate: factory.update(etainablApi, "notification-templates"),
76332
+ createNotificationTemplate: factory.create(etainablApi, "notification-templates"),
76333
+ removeNotificationTemplate: factory.remove(etainablApi, "notification-templates"),
76317
76334
  // readings
76318
76335
  getReading: factory.getWithId(etainablApi, "readings"),
76319
76336
  listReadings: factory.list(etainablApi, "readings"),
@@ -76930,6 +76947,7 @@ var notification_exports = {};
76930
76947
  // src/notificationQueue.ts
76931
76948
  var notificationQueue_exports = {};
76932
76949
  __export(notificationQueue_exports, {
76950
+ createNotificationMessage: () => createNotificationMessage,
76933
76951
  sendNotificationMessage: () => sendNotificationMessage
76934
76952
  });
76935
76953
 
@@ -78380,10 +78398,11 @@ var SendMessageCommand = class extends Command.classBuilder().ep(commonParams).m
78380
78398
 
78381
78399
  // src/notificationQueue.ts
78382
78400
  function createNotificationMessage(eventName, context, input) {
78401
+ const { timestamp, ...payload } = input;
78383
78402
  return {
78384
78403
  eventName,
78385
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
78386
- ...input,
78404
+ timestamp: timestamp ?? (/* @__PURE__ */ new Date()).toISOString(),
78405
+ ...payload,
78387
78406
  context
78388
78407
  };
78389
78408
  }
@@ -85841,10 +85860,30 @@ var NotificationDefaultChannels = {
85841
85860
  email: false,
85842
85861
  sms: false
85843
85862
  };
85863
+
85864
+ // src/types/notificationTemplate.ts
85865
+ var NotificationTemplateCategories = [
85866
+ "automation",
85867
+ "report",
85868
+ "team",
85869
+ "dataQuality",
85870
+ "discussion",
85871
+ "scraper"
85872
+ ];
85873
+ var EventNamesByCategory = {
85874
+ automation: ["runError", "runCompleted", "hasnotRun", "fileNotExpected"],
85875
+ report: ["runCompleted", "runError"],
85876
+ team: ["newUserSignIn"],
85877
+ dataQuality: ["thresholdBreached", "approachingThreshold", "readingOverdue", "readingDueSoon", "contractRenewalUpcoming", "contractRenewalOverdue"],
85878
+ discussion: ["commentAdded", "mentionInComment"],
85879
+ scraper: ["scraperLoginError", "scraperHasnotRun", "scraperRunCompleted"]
85880
+ };
85844
85881
  // Annotate the CommonJS export names for ESM import in node:
85845
85882
  0 && (module.exports = {
85883
+ EventNamesByCategory,
85846
85884
  NotificationCategoryList,
85847
85885
  NotificationDefaultChannels,
85886
+ NotificationTemplateCategories,
85848
85887
  ObjectId,
85849
85888
  api,
85850
85889
  consumption,