@memberjunction/server 1.5.3 → 1.6.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/CHANGELOG.json +132 -1
- package/CHANGELOG.md +32 -2
- package/dist/resolvers/EntityCommunicationsResolver.d.ts +4 -4
- package/dist/resolvers/EntityCommunicationsResolver.d.ts.map +1 -1
- package/dist/resolvers/EntityCommunicationsResolver.js +21 -11
- package/dist/resolvers/EntityCommunicationsResolver.js.map +1 -1
- package/dist/resolvers/UserFavoriteResolver.d.ts +0 -1
- package/dist/resolvers/UserFavoriteResolver.d.ts.map +1 -1
- package/dist/resolvers/UserFavoriteResolver.js +0 -25
- package/dist/resolvers/UserFavoriteResolver.js.map +1 -1
- package/package.json +20 -20
- package/src/resolvers/EntityCommunicationsResolver.ts +25 -15
- package/src/resolvers/UserFavoriteResolver.ts +7 -45
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,138 @@
|
|
|
2
2
|
"name": "@memberjunction/server",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "Tue, 11 Jun 2024
|
|
5
|
+
"date": "Tue, 11 Jun 2024 04:56:58 GMT",
|
|
6
|
+
"version": "1.6.0",
|
|
7
|
+
"tag": "@memberjunction/server_v1.6.0",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "97354817+AN-BC@users.noreply.github.com",
|
|
12
|
+
"package": "@memberjunction/server",
|
|
13
|
+
"commit": "ae19772d1ffa3655cd21bf43d78a1e8e5203ba90",
|
|
14
|
+
"comment": "Applying package updates [skip ci]"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"minor": [
|
|
18
|
+
{
|
|
19
|
+
"author": "beachball",
|
|
20
|
+
"package": "@memberjunction/server",
|
|
21
|
+
"comment": "Bump @memberjunction/actions to v1.6.0",
|
|
22
|
+
"commit": "not available"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"author": "beachball",
|
|
26
|
+
"package": "@memberjunction/server",
|
|
27
|
+
"comment": "Bump @memberjunction/ai to v1.6.0",
|
|
28
|
+
"commit": "not available"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"author": "beachball",
|
|
32
|
+
"package": "@memberjunction/server",
|
|
33
|
+
"comment": "Bump @memberjunction/ai-mistral to v1.6.0",
|
|
34
|
+
"commit": "not available"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"author": "beachball",
|
|
38
|
+
"package": "@memberjunction/server",
|
|
39
|
+
"comment": "Bump @memberjunction/ai-openai to v1.6.0",
|
|
40
|
+
"commit": "not available"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"author": "beachball",
|
|
44
|
+
"package": "@memberjunction/server",
|
|
45
|
+
"comment": "Bump @memberjunction/ai-vectors-pinecone to v1.6.0",
|
|
46
|
+
"commit": "not available"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"author": "beachball",
|
|
50
|
+
"package": "@memberjunction/server",
|
|
51
|
+
"comment": "Bump @memberjunction/aiengine to v1.6.0",
|
|
52
|
+
"commit": "not available"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"author": "beachball",
|
|
56
|
+
"package": "@memberjunction/server",
|
|
57
|
+
"comment": "Bump @memberjunction/core to v1.6.0",
|
|
58
|
+
"commit": "not available"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"author": "beachball",
|
|
62
|
+
"package": "@memberjunction/server",
|
|
63
|
+
"comment": "Bump @memberjunction/core-actions to v1.6.0",
|
|
64
|
+
"commit": "not available"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"author": "beachball",
|
|
68
|
+
"package": "@memberjunction/server",
|
|
69
|
+
"comment": "Bump @memberjunction/core-entities to v1.6.0",
|
|
70
|
+
"commit": "not available"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"author": "beachball",
|
|
74
|
+
"package": "@memberjunction/server",
|
|
75
|
+
"comment": "Bump @memberjunction/data-context to v1.6.0",
|
|
76
|
+
"commit": "not available"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"author": "beachball",
|
|
80
|
+
"package": "@memberjunction/server",
|
|
81
|
+
"comment": "Bump @memberjunction/data-context-server to v1.6.0",
|
|
82
|
+
"commit": "not available"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"author": "beachball",
|
|
86
|
+
"package": "@memberjunction/server",
|
|
87
|
+
"comment": "Bump @memberjunction/doc-utils to v1.6.0",
|
|
88
|
+
"commit": "not available"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"author": "beachball",
|
|
92
|
+
"package": "@memberjunction/server",
|
|
93
|
+
"comment": "Bump @memberjunction/global to v1.6.0",
|
|
94
|
+
"commit": "not available"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"author": "beachball",
|
|
98
|
+
"package": "@memberjunction/server",
|
|
99
|
+
"comment": "Bump @memberjunction/queue to v1.6.0",
|
|
100
|
+
"commit": "not available"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"author": "beachball",
|
|
104
|
+
"package": "@memberjunction/server",
|
|
105
|
+
"comment": "Bump @memberjunction/skip-types to v1.6.0",
|
|
106
|
+
"commit": "not available"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"author": "beachball",
|
|
110
|
+
"package": "@memberjunction/server",
|
|
111
|
+
"comment": "Bump @memberjunction/sqlserver-dataprovider to v1.6.0",
|
|
112
|
+
"commit": "not available"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"author": "beachball",
|
|
116
|
+
"package": "@memberjunction/server",
|
|
117
|
+
"comment": "Bump @memberjunction/storage to v1.6.0",
|
|
118
|
+
"commit": "not available"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"author": "beachball",
|
|
122
|
+
"package": "@memberjunction/server",
|
|
123
|
+
"comment": "Bump @memberjunction/templates to v1.6.0",
|
|
124
|
+
"commit": "not available"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"author": "beachball",
|
|
128
|
+
"package": "@memberjunction/server",
|
|
129
|
+
"comment": "Bump @memberjunction/entity-communications-server to v1.6.0",
|
|
130
|
+
"commit": "not available"
|
|
131
|
+
}
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"date": "Tue, 11 Jun 2024 04:01:37 GMT",
|
|
6
137
|
"version": "1.5.3",
|
|
7
138
|
"tag": "@memberjunction/server_v1.5.3",
|
|
8
139
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,42 @@
|
|
|
1
1
|
# Change Log - @memberjunction/server
|
|
2
2
|
|
|
3
|
-
This log was last generated on Tue, 11 Jun 2024
|
|
3
|
+
This log was last generated on Tue, 11 Jun 2024 04:56:58 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 1.6.0
|
|
8
|
+
|
|
9
|
+
Tue, 11 Jun 2024 04:56:58 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- Bump @memberjunction/actions to v1.6.0
|
|
14
|
+
- Bump @memberjunction/ai to v1.6.0
|
|
15
|
+
- Bump @memberjunction/ai-mistral to v1.6.0
|
|
16
|
+
- Bump @memberjunction/ai-openai to v1.6.0
|
|
17
|
+
- Bump @memberjunction/ai-vectors-pinecone to v1.6.0
|
|
18
|
+
- Bump @memberjunction/aiengine to v1.6.0
|
|
19
|
+
- Bump @memberjunction/core to v1.6.0
|
|
20
|
+
- Bump @memberjunction/core-actions to v1.6.0
|
|
21
|
+
- Bump @memberjunction/core-entities to v1.6.0
|
|
22
|
+
- Bump @memberjunction/data-context to v1.6.0
|
|
23
|
+
- Bump @memberjunction/data-context-server to v1.6.0
|
|
24
|
+
- Bump @memberjunction/doc-utils to v1.6.0
|
|
25
|
+
- Bump @memberjunction/global to v1.6.0
|
|
26
|
+
- Bump @memberjunction/queue to v1.6.0
|
|
27
|
+
- Bump @memberjunction/skip-types to v1.6.0
|
|
28
|
+
- Bump @memberjunction/sqlserver-dataprovider to v1.6.0
|
|
29
|
+
- Bump @memberjunction/storage to v1.6.0
|
|
30
|
+
- Bump @memberjunction/templates to v1.6.0
|
|
31
|
+
- Bump @memberjunction/entity-communications-server to v1.6.0
|
|
32
|
+
|
|
33
|
+
### Patches
|
|
34
|
+
|
|
35
|
+
- Applying package updates [skip ci] (97354817+AN-BC@users.noreply.github.com)
|
|
36
|
+
|
|
7
37
|
## 1.5.3
|
|
8
38
|
|
|
9
|
-
Tue, 11 Jun 2024
|
|
39
|
+
Tue, 11 Jun 2024 04:01:37 GMT
|
|
10
40
|
|
|
11
41
|
### Patches
|
|
12
42
|
|
|
@@ -16,11 +16,11 @@ export declare class TemplateInputType {
|
|
|
16
16
|
ID: number;
|
|
17
17
|
Name: string;
|
|
18
18
|
Description: string;
|
|
19
|
-
UserPrompt
|
|
20
|
-
CategoryID
|
|
19
|
+
UserPrompt?: string;
|
|
20
|
+
CategoryID?: number;
|
|
21
21
|
UserID: number;
|
|
22
|
-
ActiveAt
|
|
23
|
-
DisabledAt
|
|
22
|
+
ActiveAt?: Date;
|
|
23
|
+
DisabledAt?: Date;
|
|
24
24
|
IsActive: boolean;
|
|
25
25
|
CreatedAt: Date;
|
|
26
26
|
UpdatedAt: Date;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityCommunicationsResolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/EntityCommunicationsResolver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"EntityCommunicationsResolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/EntityCommunicationsResolver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CAAC,EAAE,MAAM,CAAC;IAKjB,eAAe,CAAC,EAAE,iBAAiB,CAAC;IAMpC,WAAW,CAAC,EAAE,GAAG,CAAC;CAC5B;AAED,qBACa,gCAAgC;IAE3C,OAAO,EAAE,OAAO,CAAC;IAGjB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,qBACa,cAAc;IAEnB,8BAA8B,CAA8B,QAAQ,EAAE,MAAM,EACK,gBAAgB,EAAE,gBAAgB,EAChD,YAAY,EAAE,MAAM,EACT,uBAAuB,EAAE,MAAM,EAC5B,OAAO,EAAE,yBAAyB,EAC5E,EAAE,WAAW,EAAE,EAAE,UAAU,GAAG,OAAO,CAAC,gCAAgC,CAAC;CAyBrH"}
|
|
@@ -15,8 +15,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.ReportResolver = exports.RunEntityCommunicationResultType = exports.CommunicationMessageInput = exports.TemplateInputType = exports.CommunicationProviderMessageType = void 0;
|
|
16
16
|
const type_graphql_1 = require("type-graphql");
|
|
17
17
|
const RunViewResolver_1 = require("../generic/RunViewResolver");
|
|
18
|
+
const communication_types_1 = require("@memberjunction/communication-types");
|
|
18
19
|
const entity_communications_server_1 = require("@memberjunction/entity-communications-server");
|
|
19
20
|
const graphql_type_json_1 = require("graphql-type-json");
|
|
21
|
+
const templates_1 = require("@memberjunction/templates");
|
|
20
22
|
let CommunicationProviderMessageType = class CommunicationProviderMessageType {
|
|
21
23
|
};
|
|
22
24
|
exports.CommunicationProviderMessageType = CommunicationProviderMessageType;
|
|
@@ -79,11 +81,11 @@ __decorate([
|
|
|
79
81
|
__metadata("design:type", String)
|
|
80
82
|
], TemplateInputType.prototype, "Description", void 0);
|
|
81
83
|
__decorate([
|
|
82
|
-
(0, type_graphql_1.Field)(),
|
|
84
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
83
85
|
__metadata("design:type", String)
|
|
84
86
|
], TemplateInputType.prototype, "UserPrompt", void 0);
|
|
85
87
|
__decorate([
|
|
86
|
-
(0, type_graphql_1.Field)(),
|
|
88
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
87
89
|
__metadata("design:type", Number)
|
|
88
90
|
], TemplateInputType.prototype, "CategoryID", void 0);
|
|
89
91
|
__decorate([
|
|
@@ -91,11 +93,11 @@ __decorate([
|
|
|
91
93
|
__metadata("design:type", Number)
|
|
92
94
|
], TemplateInputType.prototype, "UserID", void 0);
|
|
93
95
|
__decorate([
|
|
94
|
-
(0, type_graphql_1.Field)(),
|
|
96
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
95
97
|
__metadata("design:type", Date)
|
|
96
98
|
], TemplateInputType.prototype, "ActiveAt", void 0);
|
|
97
99
|
__decorate([
|
|
98
|
-
(0, type_graphql_1.Field)(),
|
|
100
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
99
101
|
__metadata("design:type", Date)
|
|
100
102
|
], TemplateInputType.prototype, "DisabledAt", void 0);
|
|
101
103
|
__decorate([
|
|
@@ -111,11 +113,11 @@ __decorate([
|
|
|
111
113
|
__metadata("design:type", Date)
|
|
112
114
|
], TemplateInputType.prototype, "UpdatedAt", void 0);
|
|
113
115
|
__decorate([
|
|
114
|
-
(0, type_graphql_1.Field)(),
|
|
116
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
115
117
|
__metadata("design:type", String)
|
|
116
118
|
], TemplateInputType.prototype, "Category", void 0);
|
|
117
119
|
__decorate([
|
|
118
|
-
(0, type_graphql_1.Field)(),
|
|
120
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
119
121
|
__metadata("design:type", String)
|
|
120
122
|
], TemplateInputType.prototype, "User", void 0);
|
|
121
123
|
exports.TemplateInputType = TemplateInputType = __decorate([
|
|
@@ -185,11 +187,19 @@ let ReportResolver = class ReportResolver {
|
|
|
185
187
|
async RunEntityCommunicationByViewID(entityID, runViewByIDInput, providerName, providerMessageTypeName, message, { userPayload }) {
|
|
186
188
|
try {
|
|
187
189
|
await entity_communications_server_1.EntityCommunicationsEngine.Instance.Config(false, userPayload.userRecord);
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
}
|
|
190
|
+
const newMessage = new communication_types_1.Message(message);
|
|
191
|
+
await templates_1.TemplateEngineServer.Instance.Config(false, userPayload.userRecord);
|
|
192
|
+
if (newMessage.BodyTemplate) {
|
|
193
|
+
newMessage.BodyTemplate = templates_1.TemplateEngineServer.Instance.FindTemplate(newMessage.BodyTemplate.Name);
|
|
194
|
+
}
|
|
195
|
+
if (newMessage.HTMLBodyTemplate) {
|
|
196
|
+
newMessage.HTMLBodyTemplate = templates_1.TemplateEngineServer.Instance.FindTemplate(newMessage.HTMLBodyTemplate.Name);
|
|
197
|
+
}
|
|
198
|
+
if (newMessage.SubjectTemplate) {
|
|
199
|
+
newMessage.SubjectTemplate = templates_1.TemplateEngineServer.Instance.FindTemplate(newMessage.SubjectTemplate.Name);
|
|
200
|
+
}
|
|
201
|
+
const result = await entity_communications_server_1.EntityCommunicationsEngine.Instance.RunEntityCommunication(entityID, runViewByIDInput, providerName, providerMessageTypeName, newMessage);
|
|
202
|
+
return result;
|
|
193
203
|
}
|
|
194
204
|
catch (e) {
|
|
195
205
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityCommunicationsResolver.js","sourceRoot":"","sources":["../../src/resolvers/EntityCommunicationsResolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAA4F;AAE5F,gEAA8D;
|
|
1
|
+
{"version":3,"file":"EntityCommunicationsResolver.js","sourceRoot":"","sources":["../../src/resolvers/EntityCommunicationsResolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAA4F;AAE5F,gEAA8D;AAC9D,6EAA8D;AAC9D,+FAA0F;AAE1F,yDAAsD;AACtD,yDAAiE;AAI1D,IAAM,gCAAgC,GAAtC,MAAM,gCAAgC;CA8B5C,CAAA;AA9BY,4EAAgC;AAEzC;IADC,IA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AAC;QAClB,CAAC;QACD,OAAO,CAAC,EAAE,CAAC;YACP,OAAO;gBACH,OAAO,EAAE,KAAK;gBACd,YAAY,EAAE,CAAC,CAAC,OAAO;aAC1B,CAAA;QACL,CAAC;IACH,CAAC;CACF,CAAA;AAhCY,wCAAc;AAEnB;IADL,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,gCAAgC,CAAC;IACP,WAAA,IAAA,kBAAG,EAAC,UAAU,EAAE,GAAG,EAAE,CAAC,kBAAG,CAAC,CAAA;IAC1B,WAAA,IAAA,kBAAG,EAAC,kBAAkB,EAAE,GAAG,EAAE,CAAC,kCAAgB,CAAC,CAAA;IAC/C,WAAA,IAAA,kBAAG,EAAC,cAAc,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,CAAA;IACjC,WAAA,IAAA,kBAAG,EAAC,yBAAyB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,CAAA;IAC5C,WAAA,IAAA,kBAAG,EAAC,SAAS,EAAE,GAAG,EAAE,CAAC,yBAAyB,CAAC,CAAA;IAC/C,WAAA,IAAA,kBAAG,GAAE,CAAA;;6CAJ6D,kCAAgB,kBAGzB,yBAAyB;;oEAyBxH;yBA/BU,cAAc;IAD1B,IAAA,uBAAQ,EAAC,gCAAgC,CAAC;GAC9B,cAAc,CAgC1B"}
|
|
@@ -37,7 +37,6 @@ export declare class UserFavoriteResolver extends UserFavoriteResolverBase {
|
|
|
37
37
|
IsFavorite: boolean;
|
|
38
38
|
};
|
|
39
39
|
private GetTestData;
|
|
40
|
-
private TestCommunicationFramework;
|
|
41
40
|
}
|
|
42
41
|
export default UserFavoriteResolver;
|
|
43
42
|
//# sourceMappingURL=UserFavoriteResolver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserFavoriteResolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/UserFavoriteResolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,YAAY,EAAY,MAAM,sBAAsB,CAA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AAU;;;;;;;IAoBrI,OAAO,CAAC,WAAW;CA0DpB;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -17,8 +17,6 @@ const core_1 = require("@memberjunction/core");
|
|
|
17
17
|
const server_1 = require("@memberjunction/server");
|
|
18
18
|
const sqlserver_dataprovider_1 = require("@memberjunction/sqlserver-dataprovider");
|
|
19
19
|
const generated_1 = require("../generated/generated");
|
|
20
|
-
const communication_core_1 = require("@memberjunction/communication-core");
|
|
21
|
-
const templates_1 = require("@memberjunction/templates");
|
|
22
20
|
let UserFavoriteSearchParams = class UserFavoriteSearchParams {
|
|
23
21
|
};
|
|
24
22
|
exports.UserFavoriteSearchParams = UserFavoriteSearchParams;
|
|
@@ -113,7 +111,6 @@ let UserFavoriteResolver = class UserFavoriteResolver extends generated_1.UserFa
|
|
|
113
111
|
const e = md.Entities.find((e) => e.ID === params.EntityID);
|
|
114
112
|
const u = sqlserver_dataprovider_1.UserCache.Users.find((u) => u.ID === userPayload.userRecord.ID);
|
|
115
113
|
if (e) {
|
|
116
|
-
this.TestCommunicationFramework(userPayload.userRecord);
|
|
117
114
|
md.SetRecordFavoriteStatus(params.UserID, e.Name, pk, params.IsFavorite, u);
|
|
118
115
|
return {
|
|
119
116
|
Success: true,
|
|
@@ -183,28 +180,6 @@ let UserFavoriteResolver = class UserFavoriteResolver extends generated_1.UserFa
|
|
|
183
180
|
}
|
|
184
181
|
];
|
|
185
182
|
}
|
|
186
|
-
async TestCommunicationFramework(user) {
|
|
187
|
-
const engine = communication_core_1.CommunicationEngine.Instance;
|
|
188
|
-
await engine.Config(true, user);
|
|
189
|
-
const tEngine = templates_1.TemplateEngine.Instance;
|
|
190
|
-
await tEngine.Config(true, user);
|
|
191
|
-
const t = templates_1.TemplateEngine.Instance.FindTemplate('Test Template');
|
|
192
|
-
const s = templates_1.TemplateEngine.Instance.FindTemplate('Test Subject Template');
|
|
193
|
-
const data = this.GetTestData();
|
|
194
|
-
await engine.SendMessages('SendGrid', 'Email', {
|
|
195
|
-
To: null,
|
|
196
|
-
From: "amith@bluecypress.io",
|
|
197
|
-
BodyTemplate: t,
|
|
198
|
-
SubjectTemplate: s,
|
|
199
|
-
ContextData: data,
|
|
200
|
-
MessageType: null
|
|
201
|
-
}, data.map((d) => {
|
|
202
|
-
return {
|
|
203
|
-
To: d.email,
|
|
204
|
-
ContextData: d
|
|
205
|
-
};
|
|
206
|
-
}));
|
|
207
|
-
}
|
|
208
183
|
};
|
|
209
184
|
exports.UserFavoriteResolver = UserFavoriteResolver;
|
|
210
185
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserFavoriteResolver.js","sourceRoot":"","sources":["../../src/resolvers/UserFavoriteResolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAsF;AACtF,mDAA2K;AAC3K,mFAAmE;AAGnE,sDAAiF;
|
|
1
|
+
{"version":3,"file":"UserFavoriteResolver.js","sourceRoot":"","sources":["../../src/resolvers/UserFavoriteResolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAsF;AACtF,mDAA2K;AAC3K,mFAAmE;AAGnE,sDAAiF;AAM1E,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;CASpC,CAAA;AATY,4DAAwB;AAEnC;IADC,IAAA,cAAK,EAAC,GAAG,EAAE,CAAC,YAAG,CAAC;;0DACA;AAGjB;IADC,IAAA,cAAK,EAAC,GAAG,EAAE,CAAC,8BAAqB,CAAC;8BACrB,8BAAqB;8DAAC;AAGpC;IADC,IAAA,cAAK,EAAC,GAAG,EAAE,CAAC,YAAG,CAAC;;wDACF;mCARJ,wBAAwB;IADpC,IAAA,kBAAS,GAAE;GACC,wBAAwB,CASpC;AAGM,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;CAYjC,CAAA;AAZY,sDAAqB;AAEhC;IADC,IAAA,cAAK,EAAC,GAAG,EAAE,CAAC,YAAG,CAAC;;uDACA;AAGjB;IADC,IAAA,cAAK,EAAC,G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3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "MemberJunction: This project provides API access via GraphQL to the common data store.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -21,26 +21,26 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@apollo/server": "^4.9.1",
|
|
23
23
|
"@graphql-tools/utils": "^10.0.1",
|
|
24
|
-
"@memberjunction/actions": "1.
|
|
25
|
-
"@memberjunction/ai": "1.
|
|
26
|
-
"@memberjunction/ai-mistral": "1.
|
|
27
|
-
"@memberjunction/ai-openai": "1.
|
|
28
|
-
"@memberjunction/ai-vectors-pinecone": "1.
|
|
29
|
-
"@memberjunction/aiengine": "1.
|
|
24
|
+
"@memberjunction/actions": "1.6.0",
|
|
25
|
+
"@memberjunction/ai": "1.6.0",
|
|
26
|
+
"@memberjunction/ai-mistral": "1.6.0",
|
|
27
|
+
"@memberjunction/ai-openai": "1.6.0",
|
|
28
|
+
"@memberjunction/ai-vectors-pinecone": "1.6.0",
|
|
29
|
+
"@memberjunction/aiengine": "1.6.0",
|
|
30
30
|
"@memberjunction/communication-core": "1.5.2",
|
|
31
|
-
"@memberjunction/core": "1.
|
|
32
|
-
"@memberjunction/core-actions": "1.
|
|
33
|
-
"@memberjunction/core-entities": "1.
|
|
34
|
-
"@memberjunction/data-context": "1.
|
|
35
|
-
"@memberjunction/data-context-server": "1.
|
|
36
|
-
"@memberjunction/doc-utils": "1.
|
|
37
|
-
"@memberjunction/global": "1.
|
|
38
|
-
"@memberjunction/queue": "1.
|
|
39
|
-
"@memberjunction/skip-types": "1.
|
|
40
|
-
"@memberjunction/sqlserver-dataprovider": "1.
|
|
41
|
-
"@memberjunction/storage": "1.
|
|
42
|
-
"@memberjunction/templates": "1.
|
|
43
|
-
"@memberjunction/entity-communications-server": "1.
|
|
31
|
+
"@memberjunction/core": "1.6.0",
|
|
32
|
+
"@memberjunction/core-actions": "1.6.0",
|
|
33
|
+
"@memberjunction/core-entities": "1.6.0",
|
|
34
|
+
"@memberjunction/data-context": "1.6.0",
|
|
35
|
+
"@memberjunction/data-context-server": "1.6.0",
|
|
36
|
+
"@memberjunction/doc-utils": "1.6.0",
|
|
37
|
+
"@memberjunction/global": "1.6.0",
|
|
38
|
+
"@memberjunction/queue": "1.6.0",
|
|
39
|
+
"@memberjunction/skip-types": "1.6.0",
|
|
40
|
+
"@memberjunction/sqlserver-dataprovider": "1.6.0",
|
|
41
|
+
"@memberjunction/storage": "1.6.0",
|
|
42
|
+
"@memberjunction/templates": "1.6.0",
|
|
43
|
+
"@memberjunction/entity-communications-server": "1.6.0",
|
|
44
44
|
"@types/cors": "^2.8.13",
|
|
45
45
|
"@types/jsonwebtoken": "9.0.6",
|
|
46
46
|
"@types/node": "20.14.2",
|
|
@@ -5,6 +5,7 @@ import { Message } from '@memberjunction/communication-types';
|
|
|
5
5
|
import { EntityCommunicationsEngine } from '@memberjunction/entity-communications-server';
|
|
6
6
|
import { RunViewParams } from '@memberjunction/core';
|
|
7
7
|
import { GraphQLJSONObject } from 'graphql-type-json';
|
|
8
|
+
import { TemplateEngineServer } from '@memberjunction/templates';
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
@InputType()
|
|
@@ -51,20 +52,20 @@ export class TemplateInputType {
|
|
|
51
52
|
@Field()
|
|
52
53
|
Description: string;
|
|
53
54
|
|
|
54
|
-
@Field()
|
|
55
|
-
UserPrompt
|
|
55
|
+
@Field({ nullable: true})
|
|
56
|
+
UserPrompt?: string;
|
|
56
57
|
|
|
57
|
-
@Field()
|
|
58
|
-
CategoryID
|
|
58
|
+
@Field({ nullable: true})
|
|
59
|
+
CategoryID?: number;
|
|
59
60
|
|
|
60
61
|
@Field()
|
|
61
62
|
UserID: number;
|
|
62
63
|
|
|
63
|
-
@Field()
|
|
64
|
-
ActiveAt
|
|
64
|
+
@Field({ nullable: true})
|
|
65
|
+
ActiveAt?: Date;
|
|
65
66
|
|
|
66
|
-
@Field()
|
|
67
|
-
DisabledAt
|
|
67
|
+
@Field({ nullable: true})
|
|
68
|
+
DisabledAt?: Date;
|
|
68
69
|
|
|
69
70
|
@Field()
|
|
70
71
|
IsActive: boolean;
|
|
@@ -75,10 +76,10 @@ export class TemplateInputType {
|
|
|
75
76
|
@Field()
|
|
76
77
|
UpdatedAt: Date;
|
|
77
78
|
|
|
78
|
-
@Field()
|
|
79
|
+
@Field({ nullable: true})
|
|
79
80
|
Category?: string;
|
|
80
81
|
|
|
81
|
-
@Field()
|
|
82
|
+
@Field({ nullable: true})
|
|
82
83
|
User?: string;
|
|
83
84
|
}
|
|
84
85
|
@InputType()
|
|
@@ -168,11 +169,20 @@ export class ReportResolver {
|
|
|
168
169
|
@Ctx() { userPayload }: AppContext): Promise<RunEntityCommunicationResultType> {
|
|
169
170
|
try {
|
|
170
171
|
await EntityCommunicationsEngine.Instance.Config(false, userPayload.userRecord);
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
172
|
+
const newMessage = new Message(<Message>message);
|
|
173
|
+
await TemplateEngineServer.Instance.Config(false, userPayload.userRecord);
|
|
174
|
+
// for the templates, replace the values from the input with the objects from the Template Engine we have here
|
|
175
|
+
if (newMessage.BodyTemplate) {
|
|
176
|
+
newMessage.BodyTemplate = TemplateEngineServer.Instance.FindTemplate(newMessage.BodyTemplate.Name);
|
|
177
|
+
}
|
|
178
|
+
if (newMessage.HTMLBodyTemplate) {
|
|
179
|
+
newMessage.HTMLBodyTemplate = TemplateEngineServer.Instance.FindTemplate(newMessage.HTMLBodyTemplate.Name);
|
|
180
|
+
}
|
|
181
|
+
if (newMessage.SubjectTemplate) {
|
|
182
|
+
newMessage.SubjectTemplate = TemplateEngineServer.Instance.FindTemplate(newMessage.SubjectTemplate.Name);
|
|
183
|
+
}
|
|
184
|
+
const result = await EntityCommunicationsEngine.Instance.RunEntityCommunication(entityID, <RunViewParams>runViewByIDInput, providerName, providerMessageTypeName, newMessage);
|
|
185
|
+
return result;
|
|
176
186
|
}
|
|
177
187
|
catch (e) {
|
|
178
188
|
return {
|
|
@@ -4,8 +4,6 @@ import { UserCache } from '@memberjunction/sqlserver-dataprovider';
|
|
|
4
4
|
import { UserFavoriteEntity } from '@memberjunction/core-entities';
|
|
5
5
|
|
|
6
6
|
import { UserFavorite_, UserFavoriteResolverBase } from '../generated/generated';
|
|
7
|
-
import { CommunicationEngine } from '@memberjunction/communication-core';
|
|
8
|
-
import { TemplateEngine } from '@memberjunction/templates';
|
|
9
7
|
|
|
10
8
|
//****************************************************************************
|
|
11
9
|
// INPUT TYPE for User Favorite Queries
|
|
@@ -91,7 +89,6 @@ export class UserFavoriteResolver extends UserFavoriteResolverBase {
|
|
|
91
89
|
const e = md.Entities.find((e) => e.ID === params.EntityID);
|
|
92
90
|
const u = UserCache.Users.find((u) => u.ID === userPayload.userRecord.ID);
|
|
93
91
|
if (e) {
|
|
94
|
-
this.TestCommunicationFramework(userPayload.userRecord);
|
|
95
92
|
md.SetRecordFavoriteStatus(params.UserID, e.Name, pk, params.IsFavorite, u);
|
|
96
93
|
return {
|
|
97
94
|
Success: true,
|
|
@@ -100,14 +97,14 @@ export class UserFavoriteResolver extends UserFavoriteResolverBase {
|
|
|
100
97
|
CompositeKey: params.CompositeKey,
|
|
101
98
|
IsFavorite: params.IsFavorite,
|
|
102
99
|
};
|
|
103
|
-
}
|
|
104
|
-
else
|
|
100
|
+
}
|
|
101
|
+
else
|
|
105
102
|
throw new Error(`Entity ID:${params.EntityID} not found`);
|
|
106
103
|
|
|
107
104
|
}
|
|
108
|
-
|
|
105
|
+
|
|
109
106
|
private GetTestData() {
|
|
110
|
-
return [{
|
|
107
|
+
return [{
|
|
111
108
|
firstName: 'John',
|
|
112
109
|
lastName: 'Doe',
|
|
113
110
|
title: 'Software Engineer II',
|
|
@@ -126,7 +123,7 @@ export class UserFavoriteResolver extends UserFavoriteResolverBase {
|
|
|
126
123
|
},
|
|
127
124
|
{
|
|
128
125
|
title: 'The Art of Debugging',
|
|
129
|
-
url: 'https://example.com/article2'
|
|
126
|
+
url: 'https://example.com/article2'
|
|
130
127
|
},
|
|
131
128
|
{
|
|
132
129
|
title: 'Using Templates Effectively',
|
|
@@ -153,7 +150,7 @@ export class UserFavoriteResolver extends UserFavoriteResolverBase {
|
|
|
153
150
|
},
|
|
154
151
|
{
|
|
155
152
|
title: 'AI and Software Development: A New Frontier',
|
|
156
|
-
url: 'https://example.com/article2'
|
|
153
|
+
url: 'https://example.com/article2'
|
|
157
154
|
},
|
|
158
155
|
{
|
|
159
156
|
title: 'Gardening Tips for Fun Loving Software Developers',
|
|
@@ -163,42 +160,7 @@ export class UserFavoriteResolver extends UserFavoriteResolverBase {
|
|
|
163
160
|
}
|
|
164
161
|
]
|
|
165
162
|
}
|
|
166
|
-
|
|
167
|
-
const engine = CommunicationEngine.Instance;
|
|
168
|
-
await engine.Config(true, user);
|
|
169
|
-
const tEngine = TemplateEngine.Instance;
|
|
170
|
-
await tEngine.Config(true, user);
|
|
171
|
-
const t = TemplateEngine.Instance.FindTemplate('Test Template');
|
|
172
|
-
const s = TemplateEngine.Instance.FindTemplate('Test Subject Template');
|
|
173
|
-
const data = this.GetTestData();
|
|
174
|
-
|
|
175
|
-
// try single message
|
|
176
|
-
// const d = data[0];
|
|
177
|
-
// await engine.SendSingleMessage('SendGrid', 'Email', {
|
|
178
|
-
// To: d.email,
|
|
179
|
-
// From: "amith@bluecypress.io",
|
|
180
|
-
// BodyTemplate: t,
|
|
181
|
-
// SubjectTemplate: s,
|
|
182
|
-
// ContextData: d,
|
|
183
|
-
// MessageType: null
|
|
184
|
-
// });
|
|
185
|
-
|
|
186
|
-
// try multiple messages
|
|
187
|
-
await engine.SendMessages('SendGrid', 'Email', {
|
|
188
|
-
To: null,
|
|
189
|
-
From: "amith@bluecypress.io",
|
|
190
|
-
BodyTemplate: t,
|
|
191
|
-
SubjectTemplate: s,
|
|
192
|
-
ContextData: data,
|
|
193
|
-
MessageType: null
|
|
194
|
-
}, data.map((d) => {
|
|
195
|
-
return {
|
|
196
|
-
To: d.email,
|
|
197
|
-
ContextData: d
|
|
198
|
-
}
|
|
199
|
-
}));
|
|
200
|
-
}
|
|
201
|
-
|
|
163
|
+
|
|
202
164
|
}
|
|
203
165
|
|
|
204
166
|
export default UserFavoriteResolver;
|