@memberjunction/entity-communications-client 1.5.3

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.
@@ -0,0 +1,18 @@
1
+ import { RunViewParams } from "@memberjunction/core";
2
+ import { EntityCommunicationsEngineBase } from "@memberjunction/entity-communications-base";
3
+ import { Message } from "@memberjunction/communication-types";
4
+ export declare class EntityCommunicationsEngineClient extends EntityCommunicationsEngineBase {
5
+ /**
6
+ * Executes a given message request against a view of records for a given entity
7
+ * @param entityID
8
+ * @param runViewParams
9
+ * @param providerName
10
+ * @param providerMessageTypeName
11
+ * @param message
12
+ */
13
+ RunEntityCommunication(entityID: number, runViewParams: RunViewParams, providerName: string, providerMessageTypeName: string, message: Message): Promise<{
14
+ Success: boolean;
15
+ ErrorMessage: string;
16
+ }>;
17
+ }
18
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,8BAA8B,EAAE,MAAM,4CAA4C,CAAC;AAC5F,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAI9D,qBAAa,gCAAiC,SAAQ,8BAA8B;IAChF;;;;;;;OAOG;IACU,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,EAAE,uBAAuB,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC;QAAC,OAAO,EAAE,OAAO,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAC,CAAC;CAsBlN"}
package/dist/client.js ADDED
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EntityCommunicationsEngineClient = void 0;
4
+ const core_1 = require("@memberjunction/core");
5
+ const entity_communications_base_1 = require("@memberjunction/entity-communications-base");
6
+ const graphql_dataprovider_1 = require("@memberjunction/graphql-dataprovider");
7
+ class EntityCommunicationsEngineClient extends entity_communications_base_1.EntityCommunicationsEngineBase {
8
+ /**
9
+ * Executes a given message request against a view of records for a given entity
10
+ * @param entityID
11
+ * @param runViewParams
12
+ * @param providerName
13
+ * @param providerMessageTypeName
14
+ * @param message
15
+ */
16
+ async RunEntityCommunication(entityID, runViewParams, providerName, providerMessageTypeName, message) {
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) {
20
+ Success
21
+ ErrorMessage
22
+ }
23
+ }`;
24
+ const result = await graphql_dataprovider_1.GraphQLDataProvider.ExecuteGQL(gql, {
25
+ entityID: entityID,
26
+ runViewByIDInput: runViewParams,
27
+ providerName: providerName,
28
+ providerMessageTypeName: providerMessageTypeName,
29
+ message: message
30
+ });
31
+ return result?.RunEntityCommunicationByViewID;
32
+ }
33
+ catch (err) {
34
+ (0, core_1.LogError)('Error executing RunEntityCommunication query', undefined, err);
35
+ }
36
+ }
37
+ }
38
+ exports.EntityCommunicationsEngineClient = EntityCommunicationsEngineClient;
39
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;AAAA,+CAAyE;AACzE,2FAA4F;AAE5F,+EAA2E;AAG3E,MAAa,gCAAiC,SAAQ,2DAA8B;IAChF;;;;;;;OAOG;IACI,KAAK,CAAC,sBAAsB,CAAC,QAAgB,EAAE,aAA4B,EAAE,YAAoB,EAAE,uBAA+B,EAAE,OAAgB;QACvJ,IAAI,CAAC;YACD,MAAM,GAAG,GAAG;;;;;cAKV,CAAA;YACF,MAAM,MAAM,GAAG,MAAM,0CAAmB,CAAC,UAAU,CAAC,GAAG,EAAE;gBACrD,QAAQ,EAAE,QAAQ;gBAClB,gBAAgB,EAAE,aAAa;gBAC/B,YAAY,EAAE,YAAY;gBAC1B,uBAAuB,EAAE,uBAAuB;gBAChD,OAAO,EAAE,OAAO;aACnB,CAAC,CAAC;YAEH,OAAO,MAAM,EAAE,8BAA8B,CAAC;QAClD,CAAC;QACD,OAAO,GAAG,EAAE,CAAC;YACT,IAAA,eAAQ,EAAC,8CAA8C,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;QAC7E,CAAC;IACL,CAAC;CACJ;AA/BD,4EA+BC"}
@@ -0,0 +1,2 @@
1
+ export * from './client';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,UAAU,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,19 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ // PUBLIC API SURFACE AREA
18
+ __exportStar(require("./client"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0BAA0B;AAC1B,2CAAyB"}
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@memberjunction/entity-communications-client",
3
+ "version": "1.5.3",
4
+ "description": "MemberJunction: Client for interacting with Entity Communications Engine",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "/dist"
9
+ ],
10
+ "scripts": {
11
+ "start": "ts-node-dev src/index.ts",
12
+ "build": "tsc",
13
+ "test": "echo \"Error: no test specified\" && exit 1"
14
+ },
15
+ "author": "MemberJunction.com",
16
+ "license": "ISC",
17
+ "devDependencies": {
18
+ "ts-node-dev": "^2.0.0",
19
+ "typescript": "^5.4.5"
20
+ },
21
+ "dependencies": {
22
+ "@memberjunction/global": "1.5.3",
23
+ "@memberjunction/core": "1.5.3",
24
+ "@memberjunction/core-entities": "1.5.3",
25
+ "@memberjunction/entity-communications-base": "1.5.3",
26
+ "@memberjunction/graphql-dataprovider": "1.5.3"
27
+ }
28
+ }