@alanszp/eventbridge-client 7.1.0 → 7.4.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/basicEventbridgeClient.d.ts +1 -1
- package/dist/basicEventbridgeClient.js +1 -2
- package/dist/basicEventbridgeClient.js.map +1 -1
- package/dist/helpers/mapLaraEventToAWSEvent.js +1 -1
- package/dist/helpers/mapLaraEventToAWSEvent.js.map +1 -1
- package/package.json +2 -2
- package/src/basicEventbridgeClient.ts +1 -3
- package/src/helpers/mapLaraEventToAWSEvent.ts +1 -1
|
@@ -27,6 +27,6 @@ export declare class BasicEventbridgeClient {
|
|
|
27
27
|
private bus;
|
|
28
28
|
protected getLogger: () => ILogger;
|
|
29
29
|
protected context: SharedContext;
|
|
30
|
-
constructor(appName: string, env: string, getLogger: () => ILogger, context: SharedContext, bus
|
|
30
|
+
constructor(appName: string, env: string, getLogger: () => ILogger, context: SharedContext, bus: string);
|
|
31
31
|
protected sendEvents(events: LaraEvent[]): Promise<EventDispatchResult>;
|
|
32
32
|
}
|
|
@@ -13,13 +13,12 @@ exports.BasicEventbridgeClient = void 0;
|
|
|
13
13
|
const lodash_1 = require("lodash");
|
|
14
14
|
const aws_1 = require("./aws");
|
|
15
15
|
const mapLaraEventToAWSEvent_1 = require("./helpers/mapLaraEventToAWSEvent");
|
|
16
|
-
const DEFAULT_CUSTOM_BUS_NAME_SUFFIX = "lara-eventbus";
|
|
17
16
|
/**
|
|
18
17
|
* Basic client for Eventbridge.
|
|
19
18
|
* Usage will be done by extending this class and implementing methods that internally call the protected sendEvents method.
|
|
20
19
|
*/
|
|
21
20
|
class BasicEventbridgeClient {
|
|
22
|
-
constructor(appName, env, getLogger, context, bus
|
|
21
|
+
constructor(appName, env, getLogger, context, bus) {
|
|
23
22
|
this.appName = appName;
|
|
24
23
|
this.env = env;
|
|
25
24
|
this.bus = bus;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basicEventbridgeClient.js","sourceRoot":"","sources":["../src/basicEventbridgeClient.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,mCAA4C;AAC5C,+BAA+E;AAC/E,6EAA0E;AAoB1E
|
|
1
|
+
{"version":3,"file":"basicEventbridgeClient.js","sourceRoot":"","sources":["../src/basicEventbridgeClient.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,mCAA4C;AAC5C,+BAA+E;AAC/E,6EAA0E;AAoB1E;;;GAGG;AACH,MAAa,sBAAsB;IAQjC,YACE,OAAe,EACf,GAAW,EACX,SAAwB,EACxB,OAAsB,EACtB,GAAW;QAEX,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAEe,UAAU,CACxB,MAAmB;;YAEnB,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;YAEhC,MAAM,YAAY,GAAiB;gBACjC,OAAO,EAAE,IAAA,gBAAO,EACd,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACnB,IAAA,+CAAsB,EACpB,KAAK,EACL,IAAI,CAAC,GAAG,EACR,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,GAAG,EACR,MAAM,EACN,IAAI,CAAC,OAAO,CACb,CACF,CACF;aACF,CAAC;YAEF,MAAM,MAAM,GAAG,MAAM,uBAAiB,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC;YACzE,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;YAC1D,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,GAAG,IAAA,kBAAS,EAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAE1E,MAAM,CAAC,IAAI,CAAC,mCAAmC,EAAE;gBAC/C,UAAU;gBACV,MAAM;aACP,CAAC,CAAC;YAEH,OAAO;gBACL,UAAU;gBACV,MAAM;gBACN,WAAW;aACZ,CAAC;QACJ,CAAC;KAAA;CACF;AAzDD,wDAyDC"}
|
|
@@ -13,7 +13,7 @@ function mapLaraEventToAWSEvent({ topic, body }, env, appName, bus, logger, cont
|
|
|
13
13
|
try {
|
|
14
14
|
return {
|
|
15
15
|
DetailType: topic,
|
|
16
|
-
Detail: JSON.stringify(Object.assign(Object.assign({}, body), { lch })),
|
|
16
|
+
Detail: JSON.stringify(Object.assign(Object.assign({}, body), { lch, lid })),
|
|
17
17
|
Source: `${env}.lara.${appName}`,
|
|
18
18
|
EventBusName: bus,
|
|
19
19
|
Time: new Date(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapLaraEventToAWSEvent.js","sourceRoot":"","sources":["../../src/helpers/mapLaraEventToAWSEvent.ts"],"names":[],"mappings":";;;;;;AAIA,mCAAiC;AACjC,gDAAwB;AAExB,SAAgB,sBAAsB,CACpC,EAAE,KAAK,EAAE,IAAI,EAAa,EAC1B,GAAW,EACX,OAAe,EACf,GAAW,EACX,MAAe,EACf,OAAsB;IAEtB,MAAM,GAAG,GAAG,OAAO,CAAC,cAAc,EAAE,IAAI,IAAA,cAAI,GAAE,CAAC;IAC/C,MAAM,OAAO,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAC5C,MAAM,GAAG,GAAG,IAAA,gBAAO,EAAC,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5D,IAAI;QACF,OAAO;YACL,UAAU,EAAE,KAAK;YACjB,MAAM,EAAE,IAAI,CAAC,SAAS,iCAAM,IAAI,KAAE,GAAG,IAAG;
|
|
1
|
+
{"version":3,"file":"mapLaraEventToAWSEvent.js","sourceRoot":"","sources":["../../src/helpers/mapLaraEventToAWSEvent.ts"],"names":[],"mappings":";;;;;;AAIA,mCAAiC;AACjC,gDAAwB;AAExB,SAAgB,sBAAsB,CACpC,EAAE,KAAK,EAAE,IAAI,EAAa,EAC1B,GAAW,EACX,OAAe,EACf,GAAW,EACX,MAAe,EACf,OAAsB;IAEtB,MAAM,GAAG,GAAG,OAAO,CAAC,cAAc,EAAE,IAAI,IAAA,cAAI,GAAE,CAAC;IAC/C,MAAM,OAAO,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAC5C,MAAM,GAAG,GAAG,IAAA,gBAAO,EAAC,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5D,IAAI;QACF,OAAO;YACL,UAAU,EAAE,KAAK;YACjB,MAAM,EAAE,IAAI,CAAC,SAAS,iCAAM,IAAI,KAAE,GAAG,EAAE,GAAG,IAAG;YAC7C,MAAM,EAAE,GAAG,GAAG,SAAS,OAAO,EAAE;YAChC,YAAY,EAAE,GAAG;YACjB,IAAI,EAAE,IAAI,IAAI,EAAE;YAChB,WAAW,EAAE,GAAG;SACjB,CAAC;KACH;IAAC,WAAM;QACN,MAAM,GAAG,GAAG,IAAI,CAAC,qBAA+B,CAAC;QACjD,MAAM,CAAC,KAAK,CAAC,sDAAsD,EAAE;YACnE,KAAK;YACL,GAAG;YACH,GAAG;SACJ,CAAC,CAAC;QACH,OAAO,SAAS,CAAC;KAClB;AACH,CAAC;AA7BD,wDA6BC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alanszp/eventbridge-client",
|
|
3
|
-
"version": "7.1
|
|
3
|
+
"version": "7.4.1",
|
|
4
4
|
"description": "Alan's basic eventbridge client.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"cuid": "^2.1.8",
|
|
31
31
|
"lodash": "^4.17.21"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "84e3f67bf87c2e574df3899a8f9a95303739d423"
|
|
34
34
|
}
|
|
@@ -22,8 +22,6 @@ export interface EventDispatchResult {
|
|
|
22
22
|
failedCount: number | undefined;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
const DEFAULT_CUSTOM_BUS_NAME_SUFFIX = "lara-eventbus";
|
|
26
|
-
|
|
27
25
|
/**
|
|
28
26
|
* Basic client for Eventbridge.
|
|
29
27
|
* Usage will be done by extending this class and implementing methods that internally call the protected sendEvents method.
|
|
@@ -41,7 +39,7 @@ export class BasicEventbridgeClient {
|
|
|
41
39
|
env: string,
|
|
42
40
|
getLogger: () => ILogger,
|
|
43
41
|
context: SharedContext,
|
|
44
|
-
bus
|
|
42
|
+
bus: string
|
|
45
43
|
) {
|
|
46
44
|
this.appName = appName;
|
|
47
45
|
this.env = env;
|
|
@@ -19,7 +19,7 @@ export function mapLaraEventToAWSEvent(
|
|
|
19
19
|
try {
|
|
20
20
|
return {
|
|
21
21
|
DetailType: topic,
|
|
22
|
-
Detail: JSON.stringify({ ...body, lch }),
|
|
22
|
+
Detail: JSON.stringify({ ...body, lch, lid }), // lid is included here since the TraceHeader is not sent to the targets by aws
|
|
23
23
|
Source: `${env}.lara.${appName}`,
|
|
24
24
|
EventBusName: bus,
|
|
25
25
|
Time: new Date(),
|