@etainabl/nodejs-sdk 1.3.188 → 1.3.191
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/esm/index.js +7 -51
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +7 -51
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -416,6 +416,8 @@ interface Account<IDType = ObjectId | string> {
|
|
|
416
416
|
meterOperatorExpiryDate?: Date;
|
|
417
417
|
dataCollector?: string;
|
|
418
418
|
parentAccountId?: IDType;
|
|
419
|
+
isVirtual?: boolean;
|
|
420
|
+
aggregatedMpans?: string[];
|
|
419
421
|
processingInvoices?: object[];
|
|
420
422
|
contracts?: ContractSchema[];
|
|
421
423
|
creditNotes?: CreditNoteSchema[];
|
|
@@ -1983,9 +1985,7 @@ declare const _default$3: (options: EmailTemplateOptions) => string;
|
|
|
1983
1985
|
interface NotificationEmailOptions {
|
|
1984
1986
|
title: string;
|
|
1985
1987
|
message: string;
|
|
1986
|
-
severity?: NotificationTemplateSeverity;
|
|
1987
1988
|
category?: string;
|
|
1988
|
-
userName?: string;
|
|
1989
1989
|
actions?: Array<{
|
|
1990
1990
|
label: string;
|
|
1991
1991
|
url?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -416,6 +416,8 @@ interface Account<IDType = ObjectId | string> {
|
|
|
416
416
|
meterOperatorExpiryDate?: Date;
|
|
417
417
|
dataCollector?: string;
|
|
418
418
|
parentAccountId?: IDType;
|
|
419
|
+
isVirtual?: boolean;
|
|
420
|
+
aggregatedMpans?: string[];
|
|
419
421
|
processingInvoices?: object[];
|
|
420
422
|
contracts?: ContractSchema[];
|
|
421
423
|
creditNotes?: CreditNoteSchema[];
|
|
@@ -1983,9 +1985,7 @@ declare const _default$3: (options: EmailTemplateOptions) => string;
|
|
|
1983
1985
|
interface NotificationEmailOptions {
|
|
1984
1986
|
title: string;
|
|
1985
1987
|
message: string;
|
|
1986
|
-
severity?: NotificationTemplateSeverity;
|
|
1987
1988
|
category?: string;
|
|
1988
|
-
userName?: string;
|
|
1989
1989
|
actions?: Array<{
|
|
1990
1990
|
label: string;
|
|
1991
1991
|
url?: string;
|
package/dist/index.js
CHANGED
|
@@ -22858,39 +22858,11 @@ var emailTemplate_default = (options) => {
|
|
|
22858
22858
|
|
|
22859
22859
|
// src/notificationEmailTemplate.ts
|
|
22860
22860
|
var import_mjml = __toESM(require("mjml"), 1);
|
|
22861
|
-
var severityConfig = {
|
|
22862
|
-
error: {
|
|
22863
|
-
color: "#FFFFFF",
|
|
22864
|
-
bgColor: "#e04f1a",
|
|
22865
|
-
label: "ERROR"
|
|
22866
|
-
},
|
|
22867
|
-
success: {
|
|
22868
|
-
color: "#FFFFFF",
|
|
22869
|
-
bgColor: "#82b54b",
|
|
22870
|
-
label: "SUCCESS"
|
|
22871
|
-
},
|
|
22872
|
-
warning: {
|
|
22873
|
-
color: "#FFFFFF",
|
|
22874
|
-
bgColor: "#ff9f43",
|
|
22875
|
-
label: "WARNING"
|
|
22876
|
-
},
|
|
22877
|
-
tip: {
|
|
22878
|
-
color: "#FFFFFF",
|
|
22879
|
-
bgColor: "#00bad1",
|
|
22880
|
-
label: "TIP"
|
|
22881
|
-
},
|
|
22882
|
-
info: {
|
|
22883
|
-
color: "#FFFFFF",
|
|
22884
|
-
bgColor: "#5ECFB1",
|
|
22885
|
-
label: "INFO"
|
|
22886
|
-
}
|
|
22887
|
-
};
|
|
22888
22861
|
function generateNotificationEmail(options) {
|
|
22889
22862
|
if (!process.env.ETAINABL_UI_URL) {
|
|
22890
22863
|
throw new Error("ETAINABL_UI_URL environment variable is not set");
|
|
22891
22864
|
}
|
|
22892
|
-
const { title, message,
|
|
22893
|
-
const config = severityConfig[severity];
|
|
22865
|
+
const { title, message, category = "Notification", actions = [], metadata = {}, items = [] } = options;
|
|
22894
22866
|
const isSingleItem = items.length === 1;
|
|
22895
22867
|
const hasMultipleItems = items.length > 1;
|
|
22896
22868
|
const mainTitle = isSingleItem && items[0]?.message ? items[0].message : message;
|
|
@@ -22908,17 +22880,6 @@ function generateNotificationEmail(options) {
|
|
|
22908
22880
|
</mj-attributes>
|
|
22909
22881
|
|
|
22910
22882
|
<mj-style inline="inline">
|
|
22911
|
-
.severity-badge {
|
|
22912
|
-
display: inline-block;
|
|
22913
|
-
padding: 2px 6px;
|
|
22914
|
-
border-radius: 6px;
|
|
22915
|
-
font-size: 9px;
|
|
22916
|
-
font-weight: 600;
|
|
22917
|
-
letter-spacing: 0.5px;
|
|
22918
|
-
background-color: ${config.bgColor};
|
|
22919
|
-
color: ${config.color};
|
|
22920
|
-
}
|
|
22921
|
-
|
|
22922
22883
|
.metadata-table {
|
|
22923
22884
|
width: 100%;
|
|
22924
22885
|
border-collapse: collapse;
|
|
@@ -22963,15 +22924,10 @@ function generateNotificationEmail(options) {
|
|
|
22963
22924
|
<!-- Main Content Card -->
|
|
22964
22925
|
<mj-wrapper background-color="#FFFFFF" border-radius="8px" padding="0">
|
|
22965
22926
|
|
|
22966
|
-
<!--
|
|
22927
|
+
<!-- Category -->
|
|
22967
22928
|
<mj-section padding="32px 32px 20px 32px">
|
|
22968
|
-
<mj-column
|
|
22969
|
-
<mj-text padding="0"
|
|
22970
|
-
<span class="severity-badge">${config.label}</span>
|
|
22971
|
-
</mj-text>
|
|
22972
|
-
</mj-column>
|
|
22973
|
-
<mj-column width="50%">
|
|
22974
|
-
<mj-text padding="0" align="right" color="#6B7280" font-size="12px">
|
|
22929
|
+
<mj-column>
|
|
22930
|
+
<mj-text padding="0" color="#6B7280" font-size="12px">
|
|
22975
22931
|
${category}
|
|
22976
22932
|
</mj-text>
|
|
22977
22933
|
</mj-column>
|
|
@@ -23062,7 +23018,7 @@ function generateNotificationEmail(options) {
|
|
|
23062
23018
|
${actions.map(
|
|
23063
23019
|
(action) => `
|
|
23064
23020
|
<mj-button
|
|
23065
|
-
background-color="
|
|
23021
|
+
background-color="#65c198"
|
|
23066
23022
|
color="#FFFFFF"
|
|
23067
23023
|
border-radius="6px"
|
|
23068
23024
|
font-weight="600"
|
|
@@ -23089,7 +23045,7 @@ function generateNotificationEmail(options) {
|
|
|
23089
23045
|
font-weight="600"
|
|
23090
23046
|
font-size="14px"
|
|
23091
23047
|
padding="12px 24px"
|
|
23092
|
-
href="${process.env.ETAINABL_UI_URL}/
|
|
23048
|
+
href="${process.env.ETAINABL_UI_URL}/notifications/inbox"
|
|
23093
23049
|
align="center"
|
|
23094
23050
|
width="100%"
|
|
23095
23051
|
>
|
|
@@ -23125,7 +23081,7 @@ function generateNotificationEmail(options) {
|
|
|
23125
23081
|
<mj-column>
|
|
23126
23082
|
<mj-text align="center" font-size="12px" color="#6B7280" line-height="1.5">
|
|
23127
23083
|
This is an automated notification from Etainabl<br/>
|
|
23128
|
-
<a href="${process.env.ETAINABL_UI_URL}/
|
|
23084
|
+
<a href="${process.env.ETAINABL_UI_URL}/notifications/inbox" style="color: #5ECFB1; text-decoration: none;">Manage notification preferences</a>
|
|
23129
23085
|
</mj-text>
|
|
23130
23086
|
<mj-text align="center" font-size="11px" color="#9CA3AF" padding-top="16px">
|
|
23131
23087
|
\xA9 ${(/* @__PURE__ */ new Date()).getFullYear()} Etainabl Ltd. All rights reserved.
|