@memberjunction/communication-ms-graph 2.7.0 → 2.7.2
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.
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import { BaseCommunicationProvider, MessageResult, ProcessedMessage } from "@memberjunction/communication-types";
|
|
2
|
-
import { User } from "@microsoft/microsoft-graph-types";
|
|
1
|
+
import { BaseCommunicationProvider, GetMessagesResult, MessageResult, ProcessedMessage } from "@memberjunction/communication-types";
|
|
2
|
+
import { User, Message } from "@microsoft/microsoft-graph-types";
|
|
3
|
+
import { compiledFunction } from "html-to-text";
|
|
3
4
|
/**
|
|
4
5
|
* Implementation of the MS Graph provider for sending and receiving messages
|
|
5
6
|
*/
|
|
6
7
|
export declare class MSGraphProvider extends BaseCommunicationProvider {
|
|
7
8
|
ServiceAccount: User | null;
|
|
9
|
+
HTMLConverter: compiledFunction;
|
|
8
10
|
constructor();
|
|
9
11
|
SendSingleMessage(message: ProcessedMessage): Promise<MessageResult>;
|
|
10
|
-
|
|
12
|
+
ReplyToMessage(message: ProcessedMessage, messageID: string): Promise<MessageResult>;
|
|
13
|
+
GetMessages(params: Record<string, any>): Promise<GetMessagesResult<Message>>;
|
|
11
14
|
protected GetServiceAccount(email?: string): Promise<User | null>;
|
|
15
|
+
protected MarkMessageAsRead(userID: string, messageID: string): Promise<boolean>;
|
|
12
16
|
}
|
|
13
17
|
export declare function LoadMSGraphProvider(): void;
|
|
14
18
|
//# sourceMappingURL=MSGraphProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MSGraphProvider.d.ts","sourceRoot":"","sources":["../src/MSGraphProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"MSGraphProvider.d.ts","sourceRoot":"","sources":["../src/MSGraphProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAqB,iBAAiB,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAEvJ,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAKjE,OAAO,EAAW,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGzD;;GAEG;AACH,qBACa,eAAgB,SAAQ,yBAAyB;IAE1D,cAAc,EAAE,IAAI,GAAG,IAAI,CAAQ;IACnC,aAAa,EAAE,gBAAgB,CAAC;;IAUnB,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,aAAa,CAAC;IAwDpE,cAAc,CAAC,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IA2CpF,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;cA4D1E,iBAAiB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;cAwBvD,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAiBzF;AAED,wBAAgB,mBAAmB,SAElC"}
|
package/dist/MSGraphProvider.js
CHANGED
|
@@ -35,6 +35,7 @@ const global_1 = require("@memberjunction/global");
|
|
|
35
35
|
const core_1 = require("@memberjunction/core");
|
|
36
36
|
const Auth = __importStar(require("./auth"));
|
|
37
37
|
const Config = __importStar(require("./config"));
|
|
38
|
+
const html_to_text_1 = require("html-to-text");
|
|
38
39
|
/**
|
|
39
40
|
* Implementation of the MS Graph provider for sending and receiving messages
|
|
40
41
|
*/
|
|
@@ -42,14 +43,25 @@ let MSGraphProvider = class MSGraphProvider extends communication_types_1.BaseCo
|
|
|
42
43
|
constructor() {
|
|
43
44
|
super();
|
|
44
45
|
this.ServiceAccount = null;
|
|
46
|
+
this.HTMLConverter = (0, html_to_text_1.compile)({
|
|
47
|
+
wordwrap: 130
|
|
48
|
+
});
|
|
45
49
|
}
|
|
46
50
|
async SendSingleMessage(message) {
|
|
47
51
|
try {
|
|
52
|
+
const user = await this.GetServiceAccount();
|
|
53
|
+
if (!user) {
|
|
54
|
+
return {
|
|
55
|
+
Message: message,
|
|
56
|
+
Success: false,
|
|
57
|
+
Error: 'Service account not found'
|
|
58
|
+
};
|
|
59
|
+
}
|
|
48
60
|
if (!message) {
|
|
49
61
|
return {
|
|
50
62
|
Message: message,
|
|
51
63
|
Success: false,
|
|
52
|
-
Error: '
|
|
64
|
+
Error: 'Message is null'
|
|
53
65
|
};
|
|
54
66
|
}
|
|
55
67
|
const sendMail = {
|
|
@@ -69,7 +81,47 @@ let MSGraphProvider = class MSGraphProvider extends communication_types_1.BaseCo
|
|
|
69
81
|
},
|
|
70
82
|
saveToSentItems: 'false'
|
|
71
83
|
};
|
|
72
|
-
|
|
84
|
+
const sendMessagePath = `${Auth.ApiConfig.uri}/${user.id}/sendMail`;
|
|
85
|
+
await Auth.GraphClient.api(sendMessagePath).post(sendMail);
|
|
86
|
+
return {
|
|
87
|
+
Message: message,
|
|
88
|
+
Success: true,
|
|
89
|
+
Error: ''
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
catch (ex) {
|
|
93
|
+
(0, core_1.LogError)(ex);
|
|
94
|
+
return {
|
|
95
|
+
Message: message,
|
|
96
|
+
Success: false,
|
|
97
|
+
Error: 'Error sending message'
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
async ReplyToMessage(message, messageID) {
|
|
102
|
+
try {
|
|
103
|
+
const user = await this.GetServiceAccount();
|
|
104
|
+
if (!user) {
|
|
105
|
+
return {
|
|
106
|
+
Message: message,
|
|
107
|
+
Success: false,
|
|
108
|
+
Error: 'Service account not found'
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
const reply = {
|
|
112
|
+
message: {
|
|
113
|
+
toRecipients: [
|
|
114
|
+
{
|
|
115
|
+
emailAddress: {
|
|
116
|
+
address: message.To
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
comment: message.ProcessedBody || message.ProcessedHTMLBody
|
|
122
|
+
};
|
|
123
|
+
const sendMessagePath = `${Auth.ApiConfig.uri}/${user.id}/messages/${messageID}/reply`;
|
|
124
|
+
await Auth.GraphClient.api(sendMessagePath).post(reply);
|
|
73
125
|
return {
|
|
74
126
|
Message: message,
|
|
75
127
|
Success: true,
|
|
@@ -86,16 +138,19 @@ let MSGraphProvider = class MSGraphProvider extends communication_types_1.BaseCo
|
|
|
86
138
|
}
|
|
87
139
|
}
|
|
88
140
|
async GetMessages(params) {
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
141
|
+
const contextData = params.ContextData;
|
|
142
|
+
const user = await this.GetServiceAccount(contextData?.Email);
|
|
143
|
+
if (!user || !user.id) {
|
|
144
|
+
return {
|
|
145
|
+
Messages: []
|
|
146
|
+
};
|
|
92
147
|
}
|
|
93
148
|
let filter = "(isRead eq false) and (startswith(subject, '[support]') or startswith(subject, 'RE: [support]'))";
|
|
94
149
|
let top = 10;
|
|
95
|
-
if (
|
|
150
|
+
if (contextData && contextData.Filter) {
|
|
96
151
|
filter = params.ContextData.Filter;
|
|
97
152
|
}
|
|
98
|
-
if (
|
|
153
|
+
if (contextData && contextData.Top) {
|
|
99
154
|
top = params.ContextData.Top;
|
|
100
155
|
}
|
|
101
156
|
const messagesPath = `${Auth.ApiConfig.uri}/${user.id}/messages`;
|
|
@@ -103,13 +158,31 @@ let MSGraphProvider = class MSGraphProvider extends communication_types_1.BaseCo
|
|
|
103
158
|
const response = await Client.api(messagesPath)
|
|
104
159
|
.filter(filter).top(top).get();
|
|
105
160
|
if (!response) {
|
|
106
|
-
|
|
107
|
-
return {
|
|
161
|
+
(0, core_1.LogError)('Error: could not get messages');
|
|
162
|
+
return {
|
|
163
|
+
Messages: []
|
|
164
|
+
};
|
|
108
165
|
}
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
SourceData:
|
|
166
|
+
const sourceMessages = response.value;
|
|
167
|
+
let messageResults = {
|
|
168
|
+
SourceData: sourceMessages,
|
|
169
|
+
Messages: []
|
|
112
170
|
};
|
|
171
|
+
const messages = sourceMessages.map((message) => {
|
|
172
|
+
return {
|
|
173
|
+
From: message.from?.emailAddress?.address || '',
|
|
174
|
+
ReplyTo: message.replyTo?.map((replyTo) => replyTo.emailAddress?.address || '') || [],
|
|
175
|
+
Subject: message.subject || '',
|
|
176
|
+
Body: contextData?.ReturnAsPlainTex ? this.HTMLConverter(message.body?.content || '') : message.body?.content || '',
|
|
177
|
+
ExternalSystemRecordID: message.id || '',
|
|
178
|
+
};
|
|
179
|
+
});
|
|
180
|
+
messageResults.Messages = messages;
|
|
181
|
+
if (contextData && contextData.MarkAsRead) {
|
|
182
|
+
for (let message of messages) {
|
|
183
|
+
this.MarkMessageAsRead(user.id, message.ExternalSystemRecordID);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
113
186
|
return messageResults;
|
|
114
187
|
}
|
|
115
188
|
async GetServiceAccount(email) {
|
|
@@ -131,6 +204,22 @@ let MSGraphProvider = class MSGraphProvider extends communication_types_1.BaseCo
|
|
|
131
204
|
this.ServiceAccount = user;
|
|
132
205
|
return user;
|
|
133
206
|
}
|
|
207
|
+
async MarkMessageAsRead(userID, messageID) {
|
|
208
|
+
try {
|
|
209
|
+
const Client = Auth.GraphClient;
|
|
210
|
+
const updatePath = `${Auth.ApiConfig.uri}/${userID}/messages/${messageID}`;
|
|
211
|
+
const updatedMessage = {
|
|
212
|
+
isRead: true
|
|
213
|
+
};
|
|
214
|
+
await Client.api(updatePath).update(updatedMessage);
|
|
215
|
+
return true;
|
|
216
|
+
}
|
|
217
|
+
catch (ex) {
|
|
218
|
+
(0, core_1.LogStatus)(`Failed to mark message ${messageID} as read`);
|
|
219
|
+
(0, core_1.LogError)(ex);
|
|
220
|
+
return false;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
134
223
|
};
|
|
135
224
|
exports.MSGraphProvider = MSGraphProvider;
|
|
136
225
|
exports.MSGraphProvider = MSGraphProvider = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MSGraphProvider.js","sourceRoot":"","sources":["../src/MSGraphProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"MSGraphProvider.js","sourceRoot":"","sources":["../src/MSGraphProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6EAAuJ;AAGvJ,mDAAuD;AACvD,+CAA2D;AAC3D,6CAA+B;AAC/B,iDAAmC;AACnC,+CAAyD;AAGzD;;GAEG;AAEI,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,+CAAyB;IAK1D;QACI,KAAK,EAAE,CAAC;QAJZ,mBAAc,GAAgB,IAAI,CAAC;QAM/B,IAAI,CAAC,aAAa,GAAG,IAAA,sBAAO,EAAC;YACzB,QAAQ,EAAE,GAAG;SAChB,CAAC,CAAC;IACP,CAAC;IAEM,KAAK,CAAC,iBAAiB,CAAC,OAAyB;QACpD,IAAG,CAAC;YACA,MAAM,IAAI,GAAgB,MAAM,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACzD,IAAG,CAAC,IAAI,EAAC,CAAC;gBACN,OAAO;oBACH,OAAO,EAAE,OAAO;oBAChB,OAAO,EAAE,KAAK;oBACd,KAAK,EAAE,2BAA2B;iBACrC,CAAC;YACN,CAAC;YAED,IAAG,CAAC,OAAO,EAAC,CAAC;gBACT,OAAO;oBACH,OAAO,EAAE,OAAO;oBAChB,OAAO,EAAE,KAAK;oBACd,KAAK,EAAE,iBAAiB;iBAC3B,CAAC;YACN,CAAC;YAED,MAAM,QAAQ,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,EAAE,CAAC;YACnF,MAAM,cAAc,GAAG;gBACnB,MAAM,EAAE,IAAI;aACf,CAAC;YAEF,MAAM,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;YACpD,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,OAAM,EAAE,EAAC,CAAC;YACN,IAAA,gBAAS,EAAC,0BAA0B,SAAS,UAAU,CAAC,CAAC;YACzD,IAAA,eAAQ,EAAC,EAAE,CAAC,CAAC;YACb,OAAO,KAAK,CAAC;QACjB,CAAC;IACL,CAAC;CACJ,CAAA;AArNY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,sBAAa,EAAC,+CAAyB,EAAE,iBAAiB,CAAC;GAC/C,eAAe,CAqN3B;AAED,SAAgB,mBAAmB;IAC/B,kEAAkE;AACtE,CAAC;AAFD,kDAEC"}
|
package/dist/generic/models.d.ts
CHANGED
|
@@ -3,6 +3,19 @@ export type MSGraphGetResponse<T> = {
|
|
|
3
3
|
value: T;
|
|
4
4
|
};
|
|
5
5
|
export type GetMessagesContextDataParams = {
|
|
6
|
+
/**
|
|
7
|
+
* The email address of the service account to use. If not provide,
|
|
8
|
+
* defaults to the AZURE_ACCOUNT_EMAIL config variable
|
|
9
|
+
*/
|
|
10
|
+
Email?: string;
|
|
11
|
+
/**
|
|
12
|
+
* If true, messages will be returned with the body stripped of HTLM tags
|
|
13
|
+
*/
|
|
14
|
+
ReturnAsPlainText?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* If true, messages will be marked as read after being processed
|
|
17
|
+
*/
|
|
18
|
+
MarkAsRead?: boolean;
|
|
6
19
|
/**
|
|
7
20
|
* Filter to use in the MS Graph request to fetch messages. Defaults to fetching messages not marked as read.
|
|
8
21
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/generic/models.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAAI;IAChC,gBAAgB,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,CAAC,CAAA;CACX,CAAA;AAED,MAAM,MAAM,4BAA4B,GAAG;IACvC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB,
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/generic/models.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAAI;IAChC,gBAAgB,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,CAAC,CAAA;CACX,CAAA;AAED,MAAM,MAAM,4BAA4B,GAAG;IACvC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/communication-ms-graph",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.2",
|
|
4
4
|
"description": "MemberJunction: Microsoft Graph Provider for the MJ Communication Framework",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@azure/identity": "^4.4.1",
|
|
25
25
|
"@azure/msal-node": "^2.13.1",
|
|
26
|
-
"@memberjunction/communication-types": "2.
|
|
27
|
-
"@memberjunction/ai": "2.
|
|
28
|
-
"@memberjunction/ai-openai": "2.
|
|
29
|
-
"@memberjunction/aiengine": "2.
|
|
30
|
-
"@memberjunction/core": "2.
|
|
31
|
-
"@memberjunction/core-entities": "2.
|
|
32
|
-
"@memberjunction/global": "2.
|
|
33
|
-
"@memberjunction/sqlserver-dataprovider": "2.
|
|
26
|
+
"@memberjunction/communication-types": "2.8.0",
|
|
27
|
+
"@memberjunction/ai": "2.8.0",
|
|
28
|
+
"@memberjunction/ai-openai": "2.8.0",
|
|
29
|
+
"@memberjunction/aiengine": "2.8.0",
|
|
30
|
+
"@memberjunction/core": "2.8.0",
|
|
31
|
+
"@memberjunction/core-entities": "2.8.0",
|
|
32
|
+
"@memberjunction/global": "2.8.0",
|
|
33
|
+
"@memberjunction/sqlserver-dataprovider": "2.8.0",
|
|
34
34
|
"@microsoft/microsoft-graph-client": "^3.0.7",
|
|
35
35
|
"html-to-text": "^9.0.5",
|
|
36
36
|
"axios": "^1.7.7",
|