@memberjunction/communication-ms-graph 2.6.0 → 2.7.0
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/MSGraphProvider.d.ts +5 -1
- package/dist/MSGraphProvider.d.ts.map +1 -1
- package/dist/MSGraphProvider.js +76 -5
- package/dist/MSGraphProvider.js.map +1 -1
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +2 -1
- package/dist/auth.js.map +1 -1
- package/dist/config.d.ts +0 -11
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -13
- package/dist/config.js.map +1 -1
- package/dist/generic/models.d.ts +10 -0
- package/dist/generic/models.d.ts.map +1 -1
- package/package.json +9 -9
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { BaseCommunicationProvider, MessageResult, ProcessedMessage } from "@memberjunction/communication-types";
|
|
2
|
+
import { User } from "@microsoft/microsoft-graph-types";
|
|
2
3
|
/**
|
|
3
|
-
* Implementation of the
|
|
4
|
+
* Implementation of the MS Graph provider for sending and receiving messages
|
|
4
5
|
*/
|
|
5
6
|
export declare class MSGraphProvider extends BaseCommunicationProvider {
|
|
7
|
+
ServiceAccount: User | null;
|
|
6
8
|
constructor();
|
|
7
9
|
SendSingleMessage(message: ProcessedMessage): Promise<MessageResult>;
|
|
10
|
+
GetMessages(params: Record<string, any>): Promise<Record<string, any>>;
|
|
11
|
+
protected GetServiceAccount(email?: string): Promise<User | null>;
|
|
8
12
|
}
|
|
9
13
|
export declare function LoadMSGraphProvider(): void;
|
|
10
14
|
//# 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,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAEjH,OAAO,EAAE,IAAI,EAAW,MAAM,kCAAkC,CAAC;AAMjE;;GAEG;AACH,qBACa,eAAgB,SAAQ,yBAAyB;IAE1D,cAAc,EAAE,IAAI,GAAG,IAAI,CAAQ;;IAMtB,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,aAAa,CAAC;IA8CpE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;cAmCnE,iBAAiB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;CAuB1E;AAED,wBAAgB,mBAAmB,SAElC"}
|
package/dist/MSGraphProvider.js
CHANGED
|
@@ -1,22 +1,47 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
2
18
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
19
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
20
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
21
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
22
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
23
|
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
|
+
if (mod && mod.__esModule) return mod;
|
|
26
|
+
var result = {};
|
|
27
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
28
|
+
__setModuleDefault(result, mod);
|
|
29
|
+
return result;
|
|
30
|
+
};
|
|
8
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
32
|
exports.LoadMSGraphProvider = exports.MSGraphProvider = void 0;
|
|
10
33
|
const communication_types_1 = require("@memberjunction/communication-types");
|
|
11
34
|
const global_1 = require("@memberjunction/global");
|
|
12
35
|
const core_1 = require("@memberjunction/core");
|
|
13
|
-
const
|
|
36
|
+
const Auth = __importStar(require("./auth"));
|
|
37
|
+
const Config = __importStar(require("./config"));
|
|
14
38
|
/**
|
|
15
|
-
* Implementation of the
|
|
39
|
+
* Implementation of the MS Graph provider for sending and receiving messages
|
|
16
40
|
*/
|
|
17
41
|
let MSGraphProvider = class MSGraphProvider extends communication_types_1.BaseCommunicationProvider {
|
|
18
42
|
constructor() {
|
|
19
43
|
super();
|
|
44
|
+
this.ServiceAccount = null;
|
|
20
45
|
}
|
|
21
46
|
async SendSingleMessage(message) {
|
|
22
47
|
try {
|
|
@@ -44,7 +69,7 @@ let MSGraphProvider = class MSGraphProvider extends communication_types_1.BaseCo
|
|
|
44
69
|
},
|
|
45
70
|
saveToSentItems: 'false'
|
|
46
71
|
};
|
|
47
|
-
await
|
|
72
|
+
await Auth.GraphClient.api('/me/sendMail').post(sendMail);
|
|
48
73
|
return {
|
|
49
74
|
Message: message,
|
|
50
75
|
Success: true,
|
|
@@ -56,14 +81,60 @@ let MSGraphProvider = class MSGraphProvider extends communication_types_1.BaseCo
|
|
|
56
81
|
return {
|
|
57
82
|
Message: message,
|
|
58
83
|
Success: false,
|
|
59
|
-
Error:
|
|
84
|
+
Error: 'Error sending message'
|
|
60
85
|
};
|
|
61
86
|
}
|
|
62
87
|
}
|
|
88
|
+
async GetMessages(params) {
|
|
89
|
+
const user = await this.GetServiceAccount();
|
|
90
|
+
if (!user) {
|
|
91
|
+
return {};
|
|
92
|
+
}
|
|
93
|
+
let filter = "(isRead eq false) and (startswith(subject, '[support]') or startswith(subject, 'RE: [support]'))";
|
|
94
|
+
let top = 10;
|
|
95
|
+
if (params.ContextData && params.ContextData.Filter) {
|
|
96
|
+
filter = params.ContextData.Filter;
|
|
97
|
+
}
|
|
98
|
+
if (params.ContextData && params.ContextData.Top) {
|
|
99
|
+
top = params.ContextData.Top;
|
|
100
|
+
}
|
|
101
|
+
const messagesPath = `${Auth.ApiConfig.uri}/${user.id}/messages`;
|
|
102
|
+
const Client = Auth.GraphClient;
|
|
103
|
+
const response = await Client.api(messagesPath)
|
|
104
|
+
.filter(filter).top(top).get();
|
|
105
|
+
if (!response) {
|
|
106
|
+
console.log('Error: could not get messages');
|
|
107
|
+
return {};
|
|
108
|
+
}
|
|
109
|
+
const messages = response.value;
|
|
110
|
+
const messageResults = {
|
|
111
|
+
SourceData: messages
|
|
112
|
+
};
|
|
113
|
+
return messageResults;
|
|
114
|
+
}
|
|
115
|
+
async GetServiceAccount(email) {
|
|
116
|
+
if (this.ServiceAccount) {
|
|
117
|
+
return this.ServiceAccount;
|
|
118
|
+
}
|
|
119
|
+
let accountEmail = email || Config.AZURE_ACCOUNT_EMAIL;
|
|
120
|
+
const path = `${Auth.ApiConfig.uri}/${accountEmail}`;
|
|
121
|
+
const user = await Auth.CallGraphApi(path);
|
|
122
|
+
if (!user) {
|
|
123
|
+
(0, core_1.LogError)('Error: could not get user info');
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
const userID = user.id;
|
|
127
|
+
if (!userID) {
|
|
128
|
+
(0, core_1.LogError)('Error: userID not set for user');
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
this.ServiceAccount = user;
|
|
132
|
+
return user;
|
|
133
|
+
}
|
|
63
134
|
};
|
|
64
135
|
exports.MSGraphProvider = MSGraphProvider;
|
|
65
136
|
exports.MSGraphProvider = MSGraphProvider = __decorate([
|
|
66
|
-
(0, global_1.RegisterClass)(communication_types_1.BaseCommunicationProvider, '
|
|
137
|
+
(0, global_1.RegisterClass)(communication_types_1.BaseCommunicationProvider, 'Microsoft Graph')
|
|
67
138
|
], MSGraphProvider);
|
|
68
139
|
function LoadMSGraphProvider() {
|
|
69
140
|
// do nothing, this prevents tree shaking from removing this class
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MSGraphProvider.js","sourceRoot":"","sources":["../src/MSGraphProvider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MSGraphProvider.js","sourceRoot":"","sources":["../src/MSGraphProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6EAAiH;AAGjH,mDAAuD;AACvD,+CAAgD;AAChD,6CAA+B;AAC/B,iDAAmC;AAEnC;;GAEG;AAEI,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,+CAAyB;IAI1D;QACI,KAAK,EAAE,CAAC;QAHZ,mBAAc,GAAgB,IAAI,CAAC;IAInC,CAAC;IAEM,KAAK,CAAC,iBAAiB,CAAC,OAAyB;QACpD,IAAG,CAAC;YACA,IAAG,CAAC,OAAO,EAAC,CAAC;gBACT,OAAO;oBACH,OAAO,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,MAAM,MAAM,GAAuB,IAAI,CAAC,EAAE,CAAC;QAC3C,IAAG,CAAC,MAAM,EAAC,CAAC;YACR,IAAA,eAAQ,EAAC,gCAAgC,CAAC,CAAC;YAC3C,OAAO,IAAI,CAAC;QAChB,CAAC;QAED,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ,CAAA;AAhHY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,sBAAa,EAAC,+CAAyB,EAAE,iBAAiB,CAAC;GAC/C,eAAe,CAgH3B;AAED,SAAgB,mBAAmB;IAC/B,kEAAkE;AACtE,CAAC;AAFD,kDAEC"}
|
package/dist/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAEA,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAEA,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAsC3D,eAAO,MAAM,WAAW,EAAE,MAAkE,CAAC;AAE7F;;;;GAIG;AACH,eAAO,MAAM,YAAY;;CAExB,CAAC;AAEF,eAAO,MAAM,SAAS;;CAErB,CAAC;AAEF;;;GAGG;AACH,wBAAsB,QAAQ,CAAC,YAAY,EAAE,IAAI,CAAC,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAGpH;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CASzE"}
|
package/dist/auth.js
CHANGED
|
@@ -32,6 +32,7 @@ const Config = __importStar(require("./config"));
|
|
|
32
32
|
const msal_node_1 = __importDefault(require("@azure/msal-node"));
|
|
33
33
|
const microsoft_graph_client_1 = require("@microsoft/microsoft-graph-client");
|
|
34
34
|
const azureTokenCredentials_1 = require("@microsoft/microsoft-graph-client/authProviders/azureTokenCredentials");
|
|
35
|
+
const core_1 = require("@memberjunction/core");
|
|
35
36
|
/**
|
|
36
37
|
* Configuration object to be passed to MSAL instance on creation.
|
|
37
38
|
* For a full list of MSAL Node configuration parameters, visit:
|
|
@@ -89,7 +90,7 @@ async function CallGraphApi(endpoint) {
|
|
|
89
90
|
return response;
|
|
90
91
|
}
|
|
91
92
|
catch (error) {
|
|
92
|
-
|
|
93
|
+
(0, core_1.LogError)(`Error calling api:`, undefined, error);
|
|
93
94
|
return null;
|
|
94
95
|
}
|
|
95
96
|
}
|
package/dist/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAyD;AACzD,iDAAmC;AACnC,iEAAoC;AACpC,8EAA2D;AAC3D,iHAA8H;
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAyD;AACzD,iDAAmC;AACnC,iEAAoC;AACpC,8EAA2D;AAC3D,iHAA8H;AAC9H,+CAAgD;AAEhD;;;;GAIG;AACH,MAAM,UAAU,GAAG;IACf,IAAI,EAAE;QACF,QAAQ,EAAE,MAAM,CAAC,eAAe;QAChC,SAAS,EAAE,MAAM,CAAC,kBAAkB,GAAG,GAAG,GAAG,MAAM,CAAC,eAAe;QACnE,YAAY,EAAE,MAAM,CAAC,mBAAmB;KAC3C;CACJ,CAAC;AAEF;;;GAGG;AACH,MAAM,GAAG,GAAuC,IAAI,mBAAI,CAAC,6BAA6B,CAA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|
1
|
-
export declare const dbHost: string;
|
|
2
|
-
export declare const dbPort: number;
|
|
3
|
-
export declare const dbUsername: string;
|
|
4
|
-
export declare const dbPassword: string;
|
|
5
|
-
export declare const dbDatabase: string;
|
|
6
|
-
export declare const dbInstanceName: string | undefined;
|
|
7
|
-
export declare const dbTrustServerCertificate: boolean | undefined;
|
|
8
|
-
export declare const outputCode: string | undefined;
|
|
9
|
-
export declare const configFile: string;
|
|
10
|
-
export declare const mjCoreSchema: string;
|
|
11
|
-
export declare const graphqlPort: number;
|
|
12
1
|
export declare const AZURE_CLIENT_ID: string;
|
|
13
2
|
export declare const AZURE_AAD_ENDPOINT: string;
|
|
14
3
|
export declare const AZURE_TENANT_ID: string;
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,EAAE,MAAyD,CAAC;AACxF,eAAO,MAAM,kBAAkB,EAAE,MAA4D,CAAC;AAC9F,eAAO,MAAM,eAAe,EAAE,MAAyD,CAAC;AACxF,eAAO,MAAM,mBAAmB,EAAE,MAA6D,CAAC;AAChG,eAAO,MAAM,oBAAoB,EAAE,MAA8D,CAAC;AAClG,eAAO,MAAM,mBAAmB,EAAE,MAA6D,CAAC;AAChG,eAAO,MAAM,gBAAgB,EAAE,MAA2D,CAAC"}
|
package/dist/config.js
CHANGED
|
@@ -3,20 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.AZURE_ACCOUNT_ID = exports.AZURE_ACCOUNT_EMAIL = exports.AZURE_GRAPH_ENDPOINT = exports.AZURE_CLIENT_SECRET = exports.AZURE_TENANT_ID = exports.AZURE_AAD_ENDPOINT = exports.AZURE_CLIENT_ID =
|
|
6
|
+
exports.AZURE_ACCOUNT_ID = exports.AZURE_ACCOUNT_EMAIL = exports.AZURE_GRAPH_ENDPOINT = exports.AZURE_CLIENT_SECRET = exports.AZURE_TENANT_ID = exports.AZURE_AAD_ENDPOINT = exports.AZURE_CLIENT_ID = void 0;
|
|
7
7
|
const env_var_1 = __importDefault(require("env-var"));
|
|
8
|
-
//MJ Related
|
|
9
|
-
exports.dbHost = env_var_1.default.get('DB_HOST').required().asString();
|
|
10
|
-
exports.dbPort = env_var_1.default.get('DB_PORT').default('1433').asPortNumber();
|
|
11
|
-
exports.dbUsername = env_var_1.default.get('DB_USERNAME').required().asString();
|
|
12
|
-
exports.dbPassword = env_var_1.default.get('DB_PASSWORD').required().asString();
|
|
13
|
-
exports.dbDatabase = env_var_1.default.get('DB_DATABASE').required().asString();
|
|
14
|
-
exports.dbInstanceName = env_var_1.default.get('DB_INSTANCE_NAME').asString();
|
|
15
|
-
exports.dbTrustServerCertificate = env_var_1.default.get('DB_TRUST_SERVER_CERTIFICATE').asBool();
|
|
16
|
-
exports.outputCode = env_var_1.default.get('OUTPUT_CODE').asString();
|
|
17
|
-
exports.configFile = env_var_1.default.get('CONFIG_FILE').asString();
|
|
18
|
-
exports.mjCoreSchema = env_var_1.default.get('MJ_CORE_SCHEMA').default('__mj').asString();
|
|
19
|
-
exports.graphqlPort = env_var_1.default.get('GRAPHQL_PORT').default('4000').asPortNumber();
|
|
20
8
|
//Azure Related
|
|
21
9
|
exports.AZURE_CLIENT_ID = env_var_1.default.get('AZURE_CLIENT_ID').required().asString();
|
|
22
10
|
exports.AZURE_AAD_ENDPOINT = env_var_1.default.get('AZURE_AAD_ENDPOINT').required().asString();
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA0B;AAE1B,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA0B;AAE1B,eAAe;AACF,QAAA,eAAe,GAAW,iBAAG,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC;AAC3E,QAAA,kBAAkB,GAAW,iBAAG,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC;AACjF,QAAA,eAAe,GAAW,iBAAG,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC;AAC3E,QAAA,mBAAmB,GAAW,iBAAG,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC;AACnF,QAAA,oBAAoB,GAAW,iBAAG,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC;AACrF,QAAA,mBAAmB,GAAW,iBAAG,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC;AACnF,QAAA,gBAAgB,GAAW,iBAAG,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC"}
|
package/dist/generic/models.d.ts
CHANGED
|
@@ -2,4 +2,14 @@ export type MSGraphGetResponse<T> = {
|
|
|
2
2
|
"@odata.context": string;
|
|
3
3
|
value: T;
|
|
4
4
|
};
|
|
5
|
+
export type GetMessagesContextDataParams = {
|
|
6
|
+
/**
|
|
7
|
+
* Filter to use in the MS Graph request to fetch messages. Defaults to fetching messages not marked as read.
|
|
8
|
+
*/
|
|
9
|
+
Filter?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Number of messages to return, defaults to 10.
|
|
12
|
+
*/
|
|
13
|
+
Top?: number;
|
|
14
|
+
};
|
|
5
15
|
//# sourceMappingURL=models.d.ts.map
|
|
@@ -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"}
|
|
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,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/communication-ms-graph",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
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.7.0",
|
|
27
|
+
"@memberjunction/ai": "2.7.0",
|
|
28
|
+
"@memberjunction/ai-openai": "2.7.0",
|
|
29
|
+
"@memberjunction/aiengine": "2.7.0",
|
|
30
|
+
"@memberjunction/core": "2.7.0",
|
|
31
|
+
"@memberjunction/core-entities": "2.7.0",
|
|
32
|
+
"@memberjunction/global": "2.7.0",
|
|
33
|
+
"@memberjunction/sqlserver-dataprovider": "2.7.0",
|
|
34
34
|
"@microsoft/microsoft-graph-client": "^3.0.7",
|
|
35
35
|
"html-to-text": "^9.0.5",
|
|
36
36
|
"axios": "^1.7.7",
|