@memberjunction/communication-types 2.0.0 → 2.1.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/BaseEngine.d.ts +10 -4
- package/dist/BaseEngine.d.ts.map +1 -1
- package/dist/BaseEngine.js +14 -18
- package/dist/BaseEngine.js.map +1 -1
- package/package.json +5 -5
package/dist/BaseEngine.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseEngine, UserInfo } from "@memberjunction/core";
|
|
2
|
-
import { CommunicationBaseMessageTypeEntity, CommunicationLogEntity, CommunicationRunEntity } from "@memberjunction/core-entities";
|
|
2
|
+
import { CommunicationBaseMessageTypeEntity, CommunicationLogEntity, CommunicationProviderMessageTypeEntity, CommunicationRunEntity, EntityCommunicationFieldEntity, EntityCommunicationMessageTypeEntity } from "@memberjunction/core-entities";
|
|
3
3
|
import { CommunicationProviderEntityExtended, ProcessedMessage } from "./BaseProvider";
|
|
4
4
|
/**
|
|
5
5
|
* Base class for communications. This class can be sub-classed if desired if you would like to modify the logic across ALL actions. To do so, sub-class this class and use the
|
|
@@ -10,9 +10,7 @@ export declare class CommunicationEngineBase extends BaseEngine<CommunicationEng
|
|
|
10
10
|
* Returns the global instance of the class. This is a singleton class, so there is only one instance of it in the application. Do not directly create new instances of it, always use this method to get the instance.
|
|
11
11
|
*/
|
|
12
12
|
static get Instance(): CommunicationEngineBase;
|
|
13
|
-
private
|
|
14
|
-
private _Providers;
|
|
15
|
-
private _ProviderMessageTypes;
|
|
13
|
+
private _Metadata;
|
|
16
14
|
/**
|
|
17
15
|
* This method is called to configure the engine. It loads the metadata and caches it in the GlobalObjectStore. You must call this method before doing anything else with the engine.
|
|
18
16
|
* If this method was previously run on the instance of the engine, it will return immediately without re-loading the metadata. If you want to force a reload of the metadata, you can pass true for the forceReload parameter.
|
|
@@ -23,6 +21,14 @@ export declare class CommunicationEngineBase extends BaseEngine<CommunicationEng
|
|
|
23
21
|
protected AdditionalLoading(contextUser?: UserInfo): Promise<void>;
|
|
24
22
|
get BaseMessageTypes(): CommunicationBaseMessageTypeEntity[];
|
|
25
23
|
get Providers(): CommunicationProviderEntityExtended[];
|
|
24
|
+
get ProviderMessageTypes(): CommunicationProviderMessageTypeEntity[];
|
|
25
|
+
get Metadata(): {
|
|
26
|
+
BaseMessageTypes: CommunicationBaseMessageTypeEntity[];
|
|
27
|
+
Providers: CommunicationProviderEntityExtended[];
|
|
28
|
+
ProviderMessageTypes: CommunicationProviderMessageTypeEntity[];
|
|
29
|
+
EntityCommunicationMessageTypes: EntityCommunicationMessageTypeEntity[];
|
|
30
|
+
EntityCommunicationFields: EntityCommunicationFieldEntity[];
|
|
31
|
+
};
|
|
26
32
|
/**
|
|
27
33
|
* Starts a communication run
|
|
28
34
|
*/
|
package/dist/BaseEngine.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseEngine.d.ts","sourceRoot":"","sources":["../src/BaseEngine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"BaseEngine.d.ts","sourceRoot":"","sources":["../src/BaseEngine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsC,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChG,OAAO,EAAE,kCAAkC,EAAE,sBAAsB,EAAE,sCAAsC,EAAE,sBAAsB,EAAE,8BAA8B,EAAE,oCAAoC,EAAE,MAAM,+BAA+B,CAAC;AACjP,OAAO,EAAE,mCAAmC,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvF;;;GAGG;AACH,qBAAa,uBAAwB,SAAQ,UAAU,CAAC,uBAAuB,CAAC;IAC5E;;OAEG;IACH,WAAkB,QAAQ,IAAI,uBAAuB,CAEpD;IAED,OAAO,CAAC,SAAS,CAMf;IAEF;;;;;OAKG;IACW,MAAM,CAAC,YAAY,GAAE,OAAe,EAAE,WAAW,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;cAahE,iBAAiB,CAAC,WAAW,CAAC,EAAE,QAAQ;IAOjE,IAAW,gBAAgB,IAAI,kCAAkC,EAAE,CAElE;IACD,IAAW,SAAS,IAAI,mCAAmC,EAAE,CAE5D;IACD,IAAW,oBAAoB,IAAI,sCAAsC,EAAE,CAE1E;IAED,IAAW,QAAQ;;;;;;MAElB;IAGD;;OAEG;cACa,QAAQ,IAAI,OAAO,CAAC,sBAAsB,CAAC;IAc3D;;;;OAIG;cACa,MAAM,CAAC,GAAG,EAAE,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC;IAMrE;;;;OAIG;cACa,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,GAAG,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAsB/H"}
|
package/dist/BaseEngine.js
CHANGED
|
@@ -22,35 +22,31 @@ class CommunicationEngineBase extends core_1.BaseEngine {
|
|
|
22
22
|
async Config(forceRefresh = false, contextUser) {
|
|
23
23
|
const config = [
|
|
24
24
|
{
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
EntityName: 'Communication Providers',
|
|
30
|
-
PropertyName: '_Providers'
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
EntityName: 'Communication Provider Message Types',
|
|
34
|
-
PropertyName: '_ProviderMessageTypes'
|
|
25
|
+
Type: 'dataset',
|
|
26
|
+
DatasetName: 'Communication_Metadata',
|
|
27
|
+
DatasetResultHandling: "single_property",
|
|
28
|
+
PropertyName: "_Metadata"
|
|
35
29
|
}
|
|
36
30
|
];
|
|
37
31
|
await this.Load(config, forceRefresh, contextUser);
|
|
38
32
|
}
|
|
39
33
|
async AdditionalLoading(contextUser) {
|
|
40
34
|
// a little post-processing done within the context of the base classes loading architecture...
|
|
41
|
-
this.
|
|
42
|
-
provider.MessageTypes = this.
|
|
35
|
+
this._Metadata.Providers.forEach((provider) => {
|
|
36
|
+
provider.MessageTypes = this._Metadata.ProviderMessageTypes.filter((pmt) => pmt.CommunicationProviderID === provider.ID);
|
|
43
37
|
});
|
|
44
38
|
}
|
|
45
39
|
get BaseMessageTypes() {
|
|
46
|
-
|
|
47
|
-
throw new Error(`Metadata not loaded. Call Config() before accessing metadata.`);
|
|
48
|
-
return this._BaseMessageTypes;
|
|
40
|
+
return this._Metadata.BaseMessageTypes;
|
|
49
41
|
}
|
|
50
42
|
get Providers() {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
43
|
+
return this._Metadata.Providers;
|
|
44
|
+
}
|
|
45
|
+
get ProviderMessageTypes() {
|
|
46
|
+
return this._Metadata.ProviderMessageTypes;
|
|
47
|
+
}
|
|
48
|
+
get Metadata() {
|
|
49
|
+
return this._Metadata;
|
|
54
50
|
}
|
|
55
51
|
/**
|
|
56
52
|
* Starts a communication run
|
package/dist/BaseEngine.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseEngine.js","sourceRoot":"","sources":["../src/BaseEngine.ts"],"names":[],"mappings":";;;AAAA,+
|
|
1
|
+
{"version":3,"file":"BaseEngine.js","sourceRoot":"","sources":["../src/BaseEngine.ts"],"names":[],"mappings":";;;AAAA,+CAAgG;AAKhG;;;GAGG;AACH,MAAa,uBAAwB,SAAQ,iBAAmC;IAC5E;;OAEG;IACI,MAAM,KAAK,QAAQ;QACvB,OAAO,KAAK,CAAC,WAAW,EAA2B,CAAC;IACvD,CAAC;IAUD;;;;;OAKG;IACK,KAAK,CAAC,MAAM,CAAC,eAAwB,KAAK,EAAE,WAAsB;QACtE,MAAM,MAAM,GAAwC;YAChD;gBACI,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,wBAAwB;gBACrC,qBAAqB,EAAE,iBAAiB;gBACxC,YAAY,EAAE,WAAW;aAC5B;SACJ,CAAA;QAED,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE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|
"name": "@memberjunction/communication-types",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "MemberJunction: Communication Framework Library Generic Types",
|
|
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": "2.
|
|
23
|
-
"@memberjunction/core": "2.
|
|
24
|
-
"@memberjunction/templates-base-types": "2.
|
|
25
|
-
"@memberjunction/core-entities": "2.
|
|
22
|
+
"@memberjunction/global": "2.1.0",
|
|
23
|
+
"@memberjunction/core": "2.1.0",
|
|
24
|
+
"@memberjunction/templates-base-types": "2.1.0",
|
|
25
|
+
"@memberjunction/core-entities": "2.1.0",
|
|
26
26
|
"rxjs": "^7.8.1"
|
|
27
27
|
}
|
|
28
28
|
}
|