@memberjunction/entity-communications-client 1.8.1 → 2.1.1
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/client.d.ts +12 -17
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +45 -35
- package/dist/client.js.map +1 -1
- package/package.json +6 -6
package/dist/client.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { EntityCommunicationsEngineBase } from "@memberjunction/entity-communications-base";
|
|
3
|
-
import { Message } from "@memberjunction/communication-types";
|
|
1
|
+
import { EntityCommunicationParams, EntityCommunicationResult, EntityCommunicationsEngineBase } from "@memberjunction/entity-communications-base";
|
|
4
2
|
import { TemplateEntityExtended } from "@memberjunction/templates-base-types";
|
|
5
3
|
import { CommunicationProviderMessageTypeEntity } from "@memberjunction/core-entities";
|
|
6
4
|
export declare class EntityCommunicationsEngineClient extends EntityCommunicationsEngineBase {
|
|
@@ -12,34 +10,31 @@ export declare class EntityCommunicationsEngineClient extends EntityCommunicatio
|
|
|
12
10
|
* @param providerMessageTypeName
|
|
13
11
|
* @param message
|
|
14
12
|
*/
|
|
15
|
-
RunEntityCommunication(
|
|
16
|
-
Success: boolean;
|
|
17
|
-
ErrorMessage: string;
|
|
18
|
-
}>;
|
|
13
|
+
RunEntityCommunication(params: EntityCommunicationParams): Promise<EntityCommunicationResult>;
|
|
19
14
|
protected getMessageTypeValues(messageType: CommunicationProviderMessageTypeEntity): {
|
|
20
|
-
ID:
|
|
21
|
-
CommunicationProviderID:
|
|
22
|
-
CommunicationBaseMessageTypeID:
|
|
15
|
+
ID: string;
|
|
16
|
+
CommunicationProviderID: string;
|
|
17
|
+
CommunicationBaseMessageTypeID: string;
|
|
23
18
|
Name: string;
|
|
24
19
|
Status: "Active" | "Disabled";
|
|
25
20
|
AdditionalAttributes: string;
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
_mj_CreatedAt: Date;
|
|
22
|
+
_mj_UpdatedAt: Date;
|
|
28
23
|
CommunicationProvider: string;
|
|
29
24
|
CommunicationBaseMessageType: string;
|
|
30
25
|
};
|
|
31
26
|
protected getTemplateValues(template: TemplateEntityExtended): {
|
|
32
|
-
ID:
|
|
27
|
+
ID: string;
|
|
33
28
|
Name: string;
|
|
34
29
|
Description: string;
|
|
35
30
|
UserPrompt: string;
|
|
36
|
-
CategoryID:
|
|
37
|
-
UserID:
|
|
31
|
+
CategoryID: string;
|
|
32
|
+
UserID: string;
|
|
38
33
|
ActiveAt: Date;
|
|
39
34
|
DisabledAt: Date;
|
|
40
35
|
IsActive: boolean;
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
_mj_CreatedAt: Date;
|
|
37
|
+
_mj_UpdatedAt: Date;
|
|
43
38
|
Category: string;
|
|
44
39
|
User: string;
|
|
45
40
|
};
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,8BAA8B,EAAE,MAAM,4CAA4C,CAAC;AAGlJ,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,sCAAsC,EAAE,MAAM,+BAA+B,CAAC;AAGvF,qBAAa,gCAAiC,SAAQ,8BAA8B;IAChF;;;;;;;OAOG;IACU,sBAAsB,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,yBAAyB,CAAC;IA2D1G,SAAS,CAAC,oBAAoB,CAAC,WAAW,EAAE,sCAAsC;;;;;;;;;;;;IAkBlF,SAAS,CAAC,iBAAiB,CAAC,QAAQ,EAAE,sBAAsB;;;;;;;;;;;;;;;CAoB/D"}
|
package/dist/client.js
CHANGED
|
@@ -13,48 +13,58 @@ class EntityCommunicationsEngineClient extends entity_communications_base_1.Enti
|
|
|
13
13
|
* @param providerMessageTypeName
|
|
14
14
|
* @param message
|
|
15
15
|
*/
|
|
16
|
-
async RunEntityCommunication(
|
|
16
|
+
async RunEntityCommunication(params) {
|
|
17
17
|
try {
|
|
18
|
-
const gql = `query RunEntityCommunicationByViewID($entityID: Int!, $runViewByIDInput: RunViewByIDInput!, $providerName: String!, $providerMessageTypeName: String!, $message: CommunicationMessageInput!) {
|
|
19
|
-
RunEntityCommunicationByViewID(entityID: $entityID, runViewByIDInput: $runViewByIDInput, providerName: $providerName, providerMessageTypeName: $providerMessageTypeName, message: $message) {
|
|
18
|
+
const gql = `query RunEntityCommunicationByViewID($entityID: Int!, $runViewByIDInput: RunViewByIDInput!, $providerName: String!, $providerMessageTypeName: String!, $message: CommunicationMessageInput!, $previewOnly: Boolean!, $includeProcessedMessages: Boolean!) {
|
|
19
|
+
RunEntityCommunicationByViewID(entityID: $entityID, runViewByIDInput: $runViewByIDInput, providerName: $providerName, providerMessageTypeName: $providerMessageTypeName, message: $message, previewOnly: $previewOnly, includeProcessedMessages: $includeProcessedMessages) {
|
|
20
20
|
Success
|
|
21
21
|
ErrorMessage
|
|
22
|
+
Results
|
|
22
23
|
}
|
|
23
24
|
}`;
|
|
24
25
|
const result = await graphql_dataprovider_1.GraphQLDataProvider.ExecuteGQL(gql, {
|
|
25
|
-
entityID:
|
|
26
|
+
entityID: params.EntityID,
|
|
27
|
+
previewOnly: params.PreviewOnly,
|
|
28
|
+
includeProcessedMessages: params.IncludeProcessedMessages,
|
|
26
29
|
runViewByIDInput: {
|
|
27
|
-
ViewID:
|
|
28
|
-
ExtraFilter:
|
|
29
|
-
OrderBy:
|
|
30
|
-
Fields:
|
|
31
|
-
UserSearchString:
|
|
32
|
-
ExcludeUserViewRunID:
|
|
33
|
-
OverrideExcludeFilter:
|
|
34
|
-
SaveViewResults:
|
|
35
|
-
ExcludeDataFromAllPriorViewRuns:
|
|
36
|
-
IgnoreMaxRows:
|
|
37
|
-
MaxRows:
|
|
38
|
-
ForceAuditLog:
|
|
39
|
-
AuditLogDescription:
|
|
40
|
-
ResultType:
|
|
30
|
+
ViewID: params.RunViewParams.ViewID,
|
|
31
|
+
ExtraFilter: params.RunViewParams.ExtraFilter,
|
|
32
|
+
OrderBy: params.RunViewParams.OrderBy,
|
|
33
|
+
Fields: params.RunViewParams.Fields,
|
|
34
|
+
UserSearchString: params.RunViewParams.UserSearchString,
|
|
35
|
+
ExcludeUserViewRunID: params.RunViewParams.ExcludeUserViewRunID,
|
|
36
|
+
OverrideExcludeFilter: params.RunViewParams.OverrideExcludeFilter,
|
|
37
|
+
SaveViewResults: params.RunViewParams.SaveViewResults,
|
|
38
|
+
ExcludeDataFromAllPriorViewRuns: params.RunViewParams.ExcludeDataFromAllPriorViewRuns,
|
|
39
|
+
IgnoreMaxRows: params.RunViewParams.IgnoreMaxRows,
|
|
40
|
+
MaxRows: params.RunViewParams.MaxRows,
|
|
41
|
+
ForceAuditLog: params.RunViewParams.ForceAuditLog,
|
|
42
|
+
AuditLogDescription: params.RunViewParams.AuditLogDescription,
|
|
43
|
+
ResultType: params.RunViewParams.ResultType
|
|
41
44
|
},
|
|
42
|
-
providerName:
|
|
43
|
-
providerMessageTypeName:
|
|
45
|
+
providerName: params.ProviderName,
|
|
46
|
+
providerMessageTypeName: params.ProviderMessageTypeName,
|
|
44
47
|
message: {
|
|
45
|
-
MessageType: this.getMessageTypeValues(
|
|
46
|
-
From:
|
|
47
|
-
To:
|
|
48
|
-
Body:
|
|
49
|
-
BodyTemplate: this.getTemplateValues(
|
|
50
|
-
HTMLBody:
|
|
51
|
-
HTMLBodyTemplate: this.getTemplateValues(
|
|
52
|
-
Subject:
|
|
53
|
-
SubjectTemplate: this.getTemplateValues(
|
|
54
|
-
ContextData:
|
|
48
|
+
MessageType: this.getMessageTypeValues(params.Message.MessageType),
|
|
49
|
+
From: params.Message.From ? params.Message.From : "",
|
|
50
|
+
To: params.Message.To ? params.Message.To : "",
|
|
51
|
+
Body: params.Message.Body,
|
|
52
|
+
BodyTemplate: this.getTemplateValues(params.Message.BodyTemplate),
|
|
53
|
+
HTMLBody: params.Message.HTMLBody,
|
|
54
|
+
HTMLBodyTemplate: this.getTemplateValues(params.Message.HTMLBodyTemplate),
|
|
55
|
+
Subject: params.Message.Subject,
|
|
56
|
+
SubjectTemplate: this.getTemplateValues(params.Message.SubjectTemplate),
|
|
57
|
+
ContextData: params.Message.ContextData
|
|
55
58
|
}
|
|
56
59
|
});
|
|
57
|
-
|
|
60
|
+
if (result && result.RunEntityCommunicationByViewID) {
|
|
61
|
+
const r = result.RunEntityCommunicationByViewID;
|
|
62
|
+
return {
|
|
63
|
+
Success: r.Success,
|
|
64
|
+
ErrorMessage: r.ErrorMessage,
|
|
65
|
+
Results: r.Results?.Results // flatten out the Results, the Results property is an object that wraps the Results array
|
|
66
|
+
};
|
|
67
|
+
}
|
|
58
68
|
}
|
|
59
69
|
catch (err) {
|
|
60
70
|
(0, core_1.LogError)('Error executing RunEntityCommunication query', undefined, err);
|
|
@@ -70,8 +80,8 @@ class EntityCommunicationsEngineClient extends entity_communications_base_1.Enti
|
|
|
70
80
|
Name: messageType.Name,
|
|
71
81
|
Status: messageType.Status,
|
|
72
82
|
AdditionalAttributes: messageType.AdditionalAttributes ? messageType.AdditionalAttributes : '',
|
|
73
|
-
|
|
74
|
-
|
|
83
|
+
_mj_CreatedAt: messageType.__mj_CreatedAt,
|
|
84
|
+
_mj_UpdatedAt: messageType.__mj_UpdatedAt,
|
|
75
85
|
CommunicationProvider: messageType.CommunicationProvider,
|
|
76
86
|
CommunicationBaseMessageType: messageType.CommunicationBaseMessageType,
|
|
77
87
|
};
|
|
@@ -89,8 +99,8 @@ class EntityCommunicationsEngineClient extends entity_communications_base_1.Enti
|
|
|
89
99
|
ActiveAt: template.ActiveAt,
|
|
90
100
|
DisabledAt: template.DisabledAt,
|
|
91
101
|
IsActive: template.IsActive,
|
|
92
|
-
|
|
93
|
-
|
|
102
|
+
_mj_CreatedAt: template.__mj_CreatedAt,
|
|
103
|
+
_mj_UpdatedAt: template.__mj_UpdatedAt,
|
|
94
104
|
Category: template.Category ? template.Category : '',
|
|
95
105
|
User: template.User,
|
|
96
106
|
};
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;AAAA,+CAAyE;AACzE,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;AAAA,+CAAyE;AACzE,2FAAkJ;AAElJ,+EAA2E;AAK3E,MAAa,gCAAiC,SAAQ,2DAA8B;IAChF;;;;;;;OAOG;IACI,KAAK,CAAC,sBAAsB,CAAC,MAAiC;QACjE,IAAI,CAAC;YACD,MAAM,GAAG,GAAG;;;;;;cAMV,CAAA;YACF,MAAM,MAAM,GAAG,MAAM,0CAAmB,CAAC,UAAU,CAAC,GAAG,EAAE;gBACrD,QAAQ,EAAE,MAAM,CAAC,QAAQ;gBACzB,WAAW,EAAE,MAAM,CAAC,WAAW;gBAC/B,wBAAwB,EAAE,MAAM,CAAC,wBAAwB;gBACzD,gBAAgB,EAAE;oBACd,MAAM,EAAE,MAAM,CAAC,aAAa,CAAC,MAAM;oBACnC,WAAW,EAAE,MAAM,CAAC,aAAa,CAAC,WAAW;oBAC7C,OAAO,EAAE,MAAM,CAAC,aAAa,CAAC,OAAO;oBACrC,MAAM,EAAE,MAAM,CAAC,aAAa,CAAC,MAAM;oBACnC,gBAAgB,EAAE,MAAM,CAAC,aAAa,CAAC,gBAAgB;oBACvD,oBAAoB,EAAE,MAAM,CAAC,aAAa,CAAC,oBAAoB;oBAC/D,qBAAqB,EAAE,MAAM,CAAC,aAAa,CAAC,qBAAqB;oBACjE,eAAe,EAAE,MAAM,CAAC,aAAa,CAAC,eAAe;oBACrD,+BAA+B,EAAE,MAAM,CAAC,aAAa,CAAC,+B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,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE;YAC1D,UAAU,EAAE,QAAQ,CAAC,UAAU;YAC/B,MAAM,EAAE,QAAQ,CAAC,MAAM;YACvB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;YAC3B,UAAU,EAAE,QAAQ,CAAC,UAAU;YAC/B,QAAQ,EAAE,QAAQ,CAAC,QAAQ;YAC3B,aAAa,EAAE,QAAQ,CAAC,cAAc;YACtC,aAAa,EAAE,QAAQ,CAAC,cAAc;YACtC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE;YACpD,IAAI,EAAE,QAAQ,CAAC,IAAI;SACpB,CAAC;IACN,CAAC;CACJ;AA1GD,4EA0GC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/entity-communications-client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "MemberJunction: Client for interacting with Entity Communications Engine",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"typescript": "^5.4.5"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@memberjunction/global": "1.
|
|
23
|
-
"@memberjunction/core": "1.
|
|
24
|
-
"@memberjunction/core-entities": "1.
|
|
25
|
-
"@memberjunction/entity-communications-base": "1.
|
|
26
|
-
"@memberjunction/graphql-dataprovider": "1.
|
|
22
|
+
"@memberjunction/global": "2.1.1",
|
|
23
|
+
"@memberjunction/core": "2.1.1",
|
|
24
|
+
"@memberjunction/core-entities": "2.1.1",
|
|
25
|
+
"@memberjunction/entity-communications-base": "2.1.1",
|
|
26
|
+
"@memberjunction/graphql-dataprovider": "2.1.1"
|
|
27
27
|
}
|
|
28
28
|
}
|