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