@cellaware/utils 8.6.32 → 8.6.34
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/chatwms/teams.d.ts +45 -64
- package/dist/chatwms/teams.js +28 -55
- package/package.json +1 -1
package/dist/chatwms/teams.d.ts
CHANGED
|
@@ -33,9 +33,10 @@ export declare function createTeamsReportBriefCard(briefMarkdown: string, report
|
|
|
33
33
|
};
|
|
34
34
|
body: ({
|
|
35
35
|
type: string;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
facts: {
|
|
37
|
+
title: string;
|
|
38
|
+
value: string;
|
|
39
|
+
}[];
|
|
39
40
|
} | {
|
|
40
41
|
type: string;
|
|
41
42
|
text: string;
|
|
@@ -44,17 +45,7 @@ export declare function createTeamsReportBriefCard(briefMarkdown: string, report
|
|
|
44
45
|
wrap: boolean;
|
|
45
46
|
} | {
|
|
46
47
|
type: string;
|
|
47
|
-
|
|
48
|
-
type: string;
|
|
49
|
-
horizontalItemsAlignment: string;
|
|
50
|
-
minItemWidth: string;
|
|
51
|
-
}[];
|
|
52
|
-
items: {
|
|
53
|
-
type: string;
|
|
54
|
-
text: string;
|
|
55
|
-
}[];
|
|
56
|
-
} | {
|
|
57
|
-
type: string;
|
|
48
|
+
separator: boolean;
|
|
58
49
|
items: {
|
|
59
50
|
type: string;
|
|
60
51
|
text: string;
|
|
@@ -70,19 +61,21 @@ export declare function createTeamsReportTableCard(lineTitle: string, table: any
|
|
|
70
61
|
};
|
|
71
62
|
body: ({
|
|
72
63
|
type: string;
|
|
64
|
+
facts: {
|
|
65
|
+
title: string;
|
|
66
|
+
value: string;
|
|
67
|
+
}[];
|
|
68
|
+
} | {
|
|
69
|
+
type: string;
|
|
70
|
+
separator: boolean;
|
|
73
71
|
text: string;
|
|
74
72
|
size: string;
|
|
75
73
|
} | {
|
|
76
74
|
type: string;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}[];
|
|
82
|
-
items: {
|
|
83
|
-
type: string;
|
|
84
|
-
text: string;
|
|
85
|
-
}[];
|
|
75
|
+
text: string;
|
|
76
|
+
size: string;
|
|
77
|
+
isSubtle: boolean;
|
|
78
|
+
wrap: boolean;
|
|
86
79
|
} | {
|
|
87
80
|
type: string;
|
|
88
81
|
roundedCorners: boolean;
|
|
@@ -99,9 +92,10 @@ export declare function createTeamsReportValueCard(lineTitle: string, columnName
|
|
|
99
92
|
};
|
|
100
93
|
body: ({
|
|
101
94
|
type: string;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
95
|
+
facts: {
|
|
96
|
+
title: string;
|
|
97
|
+
value: string;
|
|
98
|
+
}[];
|
|
105
99
|
} | {
|
|
106
100
|
type: string;
|
|
107
101
|
text: string;
|
|
@@ -110,17 +104,7 @@ export declare function createTeamsReportValueCard(lineTitle: string, columnName
|
|
|
110
104
|
wrap: boolean;
|
|
111
105
|
} | {
|
|
112
106
|
type: string;
|
|
113
|
-
|
|
114
|
-
type: string;
|
|
115
|
-
horizontalItemsAlignment: string;
|
|
116
|
-
minItemWidth: string;
|
|
117
|
-
}[];
|
|
118
|
-
items: {
|
|
119
|
-
type: string;
|
|
120
|
-
text: string;
|
|
121
|
-
}[];
|
|
122
|
-
} | {
|
|
123
|
-
type: string;
|
|
107
|
+
separator: boolean;
|
|
124
108
|
roundedCorners: boolean;
|
|
125
109
|
style: string | undefined;
|
|
126
110
|
items: {
|
|
@@ -142,9 +126,10 @@ export declare function createTeamsReportChartCard(lineTitle: string, png: strin
|
|
|
142
126
|
};
|
|
143
127
|
body: ({
|
|
144
128
|
type: string;
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
129
|
+
facts: {
|
|
130
|
+
title: string;
|
|
131
|
+
value: string;
|
|
132
|
+
}[];
|
|
148
133
|
} | {
|
|
149
134
|
type: string;
|
|
150
135
|
text: string;
|
|
@@ -153,17 +138,7 @@ export declare function createTeamsReportChartCard(lineTitle: string, png: strin
|
|
|
153
138
|
wrap: boolean;
|
|
154
139
|
} | {
|
|
155
140
|
type: string;
|
|
156
|
-
|
|
157
|
-
type: string;
|
|
158
|
-
horizontalItemsAlignment: string;
|
|
159
|
-
minItemWidth: string;
|
|
160
|
-
}[];
|
|
161
|
-
items: {
|
|
162
|
-
type: string;
|
|
163
|
-
text: string;
|
|
164
|
-
}[];
|
|
165
|
-
} | {
|
|
166
|
-
type: string;
|
|
141
|
+
separator: boolean;
|
|
167
142
|
url: string;
|
|
168
143
|
})[];
|
|
169
144
|
};
|
|
@@ -175,21 +150,15 @@ export declare function createTeamsAlertTableCard(condition: string, rows: any[]
|
|
|
175
150
|
};
|
|
176
151
|
body: ({
|
|
177
152
|
type: string;
|
|
178
|
-
|
|
179
|
-
|
|
153
|
+
facts: {
|
|
154
|
+
title: string;
|
|
155
|
+
value: string;
|
|
156
|
+
}[];
|
|
180
157
|
} | {
|
|
181
158
|
type: string;
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
size: string;
|
|
186
|
-
style: string;
|
|
187
|
-
} | {
|
|
188
|
-
type: string;
|
|
189
|
-
text: string;
|
|
190
|
-
size?: undefined;
|
|
191
|
-
style?: undefined;
|
|
192
|
-
})[];
|
|
159
|
+
separator: boolean;
|
|
160
|
+
text: string;
|
|
161
|
+
size: string;
|
|
193
162
|
} | {
|
|
194
163
|
type: string;
|
|
195
164
|
roundedCorners: boolean;
|
|
@@ -224,6 +193,18 @@ export declare function createTeamsAlertTableCard(condition: string, rows: any[]
|
|
|
224
193
|
}[];
|
|
225
194
|
}[];
|
|
226
195
|
})[];
|
|
196
|
+
text?: undefined;
|
|
197
|
+
size?: undefined;
|
|
198
|
+
style?: undefined;
|
|
199
|
+
} | {
|
|
200
|
+
type: string;
|
|
201
|
+
text: string;
|
|
202
|
+
size: string;
|
|
203
|
+
style: string;
|
|
204
|
+
roundedCorners?: undefined;
|
|
205
|
+
firstRowAsHeaders?: undefined;
|
|
206
|
+
columns?: undefined;
|
|
207
|
+
rows?: undefined;
|
|
227
208
|
})[];
|
|
228
209
|
};
|
|
229
210
|
export declare function sendTeamsWebhook(url: string, card: any): Promise<Response>;
|
package/dist/chatwms/teams.js
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { createTeamsTableColumns, createTeamsTableRow, DATAGRID_HTML_COLS, DATAGRID_TEAMS_ROWS, mapTeamsStyles } from "./datagrid.js";
|
|
2
|
-
function createTeamsTitleItem(title) {
|
|
2
|
+
function createTeamsTitleItem(title, value) {
|
|
3
3
|
return {
|
|
4
|
-
type: "
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
type: "FactSet",
|
|
5
|
+
facts: [
|
|
6
|
+
{
|
|
7
|
+
title: `${title}:`,
|
|
8
|
+
value
|
|
9
|
+
}
|
|
10
|
+
]
|
|
8
11
|
};
|
|
9
12
|
}
|
|
10
13
|
function createTeamsTableQualifierItem() {
|
|
11
14
|
return {
|
|
12
15
|
type: "TextBlock",
|
|
16
|
+
separator: true,
|
|
13
17
|
text: `Displaying first **${DATAGRID_TEAMS_ROWS} rows** and **${DATAGRID_HTML_COLS} columns**`,
|
|
14
18
|
size: "Small"
|
|
15
19
|
};
|
|
@@ -23,41 +27,6 @@ function createTeamsSummaryItem(summary) {
|
|
|
23
27
|
wrap: true
|
|
24
28
|
};
|
|
25
29
|
}
|
|
26
|
-
function createTeamsReportSourceItem(reportTitle) {
|
|
27
|
-
return {
|
|
28
|
-
type: "Container",
|
|
29
|
-
layouts: [
|
|
30
|
-
{
|
|
31
|
-
type: "Layout.Flow",
|
|
32
|
-
horizontalItemsAlignment: "Left",
|
|
33
|
-
minItemWidth: "0px"
|
|
34
|
-
}
|
|
35
|
-
],
|
|
36
|
-
items: [
|
|
37
|
-
{
|
|
38
|
-
type: "TextBlock",
|
|
39
|
-
text: `Report: **${reportTitle}**`
|
|
40
|
-
}
|
|
41
|
-
]
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
function createTeamsAlertSourceItem(alertTitle) {
|
|
45
|
-
return {
|
|
46
|
-
type: "Container",
|
|
47
|
-
items: [
|
|
48
|
-
{
|
|
49
|
-
type: "Badge",
|
|
50
|
-
text: "Alert",
|
|
51
|
-
size: "Large",
|
|
52
|
-
style: "Attention"
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
type: "TextBlock",
|
|
56
|
-
text: `Alert: **${alertTitle}**`
|
|
57
|
-
}
|
|
58
|
-
]
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
30
|
export function createTeamsTableItem(rows) {
|
|
62
31
|
if (rows.length === 0) {
|
|
63
32
|
return [];
|
|
@@ -75,9 +44,10 @@ export function createTeamsReportBriefCard(briefMarkdown, reportTitle) {
|
|
|
75
44
|
version: "1.5",
|
|
76
45
|
msteams: { width: "Full" },
|
|
77
46
|
body: [
|
|
78
|
-
createTeamsTitleItem('Brief'),
|
|
47
|
+
createTeamsTitleItem(reportTitle, 'Brief'),
|
|
79
48
|
{
|
|
80
49
|
type: "Container",
|
|
50
|
+
separator: true,
|
|
81
51
|
items: [
|
|
82
52
|
{
|
|
83
53
|
type: "TextBlock",
|
|
@@ -86,8 +56,7 @@ export function createTeamsReportBriefCard(briefMarkdown, reportTitle) {
|
|
|
86
56
|
}
|
|
87
57
|
]
|
|
88
58
|
},
|
|
89
|
-
createTeamsSummaryItem('ChatWMS can make mistakes. [Check important info.](https://chatwms.io/user-manual/chatwms/disclaimer)')
|
|
90
|
-
createTeamsReportSourceItem(reportTitle)
|
|
59
|
+
createTeamsSummaryItem('ChatWMS can make mistakes. [Check important info.](https://chatwms.io/user-manual/chatwms/disclaimer)')
|
|
91
60
|
]
|
|
92
61
|
};
|
|
93
62
|
}
|
|
@@ -97,7 +66,7 @@ export function createTeamsReportTableCard(lineTitle, table, summary, reportTitl
|
|
|
97
66
|
version: "1.5",
|
|
98
67
|
msteams: { width: "Full" },
|
|
99
68
|
body: [
|
|
100
|
-
createTeamsTitleItem(lineTitle),
|
|
69
|
+
createTeamsTitleItem(reportTitle, lineTitle),
|
|
101
70
|
createTeamsTableQualifierItem(),
|
|
102
71
|
{
|
|
103
72
|
type: "Table",
|
|
@@ -106,8 +75,7 @@ export function createTeamsReportTableCard(lineTitle, table, summary, reportTitl
|
|
|
106
75
|
columns: table.length === 0 ? [] : table[0].cells.map(() => ({ width: 3 })),
|
|
107
76
|
rows: table
|
|
108
77
|
},
|
|
109
|
-
createTeamsSummaryItem(summary)
|
|
110
|
-
createTeamsReportSourceItem(reportTitle)
|
|
78
|
+
createTeamsSummaryItem(summary)
|
|
111
79
|
]
|
|
112
80
|
};
|
|
113
81
|
}
|
|
@@ -146,9 +114,10 @@ export function createTeamsReportValueCard(lineTitle, columnName, value, styles,
|
|
|
146
114
|
version: "1.5",
|
|
147
115
|
msteams: { width: "Full" },
|
|
148
116
|
body: [
|
|
149
|
-
createTeamsTitleItem(lineTitle),
|
|
117
|
+
createTeamsTitleItem(reportTitle, lineTitle),
|
|
150
118
|
{
|
|
151
119
|
type: "Container",
|
|
120
|
+
separator: true,
|
|
152
121
|
roundedCorners: true,
|
|
153
122
|
style,
|
|
154
123
|
items: [
|
|
@@ -163,8 +132,7 @@ export function createTeamsReportValueCard(lineTitle, columnName, value, styles,
|
|
|
163
132
|
}
|
|
164
133
|
]
|
|
165
134
|
},
|
|
166
|
-
createTeamsSummaryItem(summary)
|
|
167
|
-
createTeamsReportSourceItem(reportTitle)
|
|
135
|
+
createTeamsSummaryItem(summary)
|
|
168
136
|
]
|
|
169
137
|
};
|
|
170
138
|
}
|
|
@@ -174,13 +142,13 @@ export function createTeamsReportChartCard(lineTitle, png, summary, reportTitle)
|
|
|
174
142
|
version: "1.5",
|
|
175
143
|
msteams: { width: "Full" },
|
|
176
144
|
body: [
|
|
177
|
-
createTeamsTitleItem(lineTitle),
|
|
145
|
+
createTeamsTitleItem(reportTitle, lineTitle),
|
|
178
146
|
{
|
|
179
147
|
type: "Image",
|
|
180
|
-
|
|
148
|
+
separator: true,
|
|
149
|
+
url: png,
|
|
181
150
|
},
|
|
182
|
-
createTeamsSummaryItem(summary)
|
|
183
|
-
createTeamsReportSourceItem(reportTitle)
|
|
151
|
+
createTeamsSummaryItem(summary)
|
|
184
152
|
]
|
|
185
153
|
};
|
|
186
154
|
}
|
|
@@ -191,7 +159,7 @@ export function createTeamsAlertTableCard(condition, rows, alertTitle) {
|
|
|
191
159
|
version: "1.5",
|
|
192
160
|
msteams: { width: "Full" },
|
|
193
161
|
body: [
|
|
194
|
-
createTeamsTitleItem(condition),
|
|
162
|
+
createTeamsTitleItem(alertTitle, condition),
|
|
195
163
|
createTeamsTableQualifierItem(),
|
|
196
164
|
{
|
|
197
165
|
type: "Table",
|
|
@@ -200,7 +168,12 @@ export function createTeamsAlertTableCard(condition, rows, alertTitle) {
|
|
|
200
168
|
columns: table.length === 0 ? [] : table[0].cells.map(() => ({ width: 3 })),
|
|
201
169
|
rows: table
|
|
202
170
|
},
|
|
203
|
-
|
|
171
|
+
{
|
|
172
|
+
type: "Badge",
|
|
173
|
+
text: "Alert",
|
|
174
|
+
size: "Large",
|
|
175
|
+
style: "Attention"
|
|
176
|
+
}
|
|
204
177
|
]
|
|
205
178
|
};
|
|
206
179
|
}
|