@mhubcloud/tms_core 3.4.2 → 3.4.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.
- package/dist/index.js +3 -11
- package/package.json +1 -1
- package/src/defaultPublisher.ts +2 -10
- package/src/index.ts +3 -3
- package/src/publishers/googleAds.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -431,19 +431,13 @@ async function defaultPublisher(azureFunctionContext, serviceBusMessage, source,
|
|
|
431
431
|
if (result.status === "rejected") {
|
|
432
432
|
if (result.reason instanceof Error) {
|
|
433
433
|
const formattedError = formatError(result.reason);
|
|
434
|
-
logException(
|
|
435
|
-
azureFunctionContext.log,
|
|
436
|
-
new Error(formattedError.message)
|
|
437
|
-
);
|
|
434
|
+
logException(new Error(formattedError.message));
|
|
438
435
|
throw formattedError;
|
|
439
436
|
} else {
|
|
440
437
|
const formattedError = formatError(
|
|
441
438
|
typeof result.reason === "object" ? JSON.stringify(result.reason) : result.reason
|
|
442
439
|
);
|
|
443
|
-
logException(
|
|
444
|
-
azureFunctionContext.log,
|
|
445
|
-
new Error(formattedError.message)
|
|
446
|
-
);
|
|
440
|
+
logException(new Error(formattedError.message));
|
|
447
441
|
throw formattedError;
|
|
448
442
|
}
|
|
449
443
|
}
|
|
@@ -481,7 +475,6 @@ async function processMessage(message, log2, platformPublisher, trigger) {
|
|
|
481
475
|
publishedAny = true;
|
|
482
476
|
} else {
|
|
483
477
|
logException(
|
|
484
|
-
log2,
|
|
485
478
|
new Error(
|
|
486
479
|
`The message has not been published. Source: ${platformPublisher.source}`
|
|
487
480
|
)
|
|
@@ -490,7 +483,6 @@ async function processMessage(message, log2, platformPublisher, trigger) {
|
|
|
490
483
|
}
|
|
491
484
|
if (!publishedAny) {
|
|
492
485
|
logException(
|
|
493
|
-
log2,
|
|
494
486
|
new Error(
|
|
495
487
|
"The message has not been published to any publisher configuration"
|
|
496
488
|
)
|
|
@@ -899,7 +891,7 @@ var publisher = {
|
|
|
899
891
|
Facebook: facebook,
|
|
900
892
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
901
893
|
CJ: cj,
|
|
902
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
894
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-unnecessary-type-assertion
|
|
903
895
|
GoogleAds: googleAds,
|
|
904
896
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
905
897
|
GoogleAnalytics4: googleAnalytics4,
|
package/package.json
CHANGED
package/src/defaultPublisher.ts
CHANGED
|
@@ -41,10 +41,7 @@ export async function defaultPublisher(
|
|
|
41
41
|
if (result.status === 'rejected') {
|
|
42
42
|
if (result.reason instanceof Error) {
|
|
43
43
|
const formattedError = utils.formatError(result.reason);
|
|
44
|
-
utils.logException(
|
|
45
|
-
azureFunctionContext.log,
|
|
46
|
-
new Error(formattedError.message),
|
|
47
|
-
);
|
|
44
|
+
utils.logException(new Error(formattedError.message));
|
|
48
45
|
throw formattedError;
|
|
49
46
|
} else {
|
|
50
47
|
const formattedError = utils.formatError(
|
|
@@ -52,10 +49,7 @@ export async function defaultPublisher(
|
|
|
52
49
|
? JSON.stringify(result.reason)
|
|
53
50
|
: (result.reason as Error['message']),
|
|
54
51
|
);
|
|
55
|
-
utils.logException(
|
|
56
|
-
azureFunctionContext.log,
|
|
57
|
-
new Error(formattedError.message),
|
|
58
|
-
);
|
|
52
|
+
utils.logException(new Error(formattedError.message));
|
|
59
53
|
throw formattedError;
|
|
60
54
|
}
|
|
61
55
|
}
|
|
@@ -112,7 +106,6 @@ async function processMessage(
|
|
|
112
106
|
publishedAny = true;
|
|
113
107
|
} else {
|
|
114
108
|
utils.logException(
|
|
115
|
-
log,
|
|
116
109
|
new Error(
|
|
117
110
|
`The message has not been published. Source: ${platformPublisher.source}`,
|
|
118
111
|
),
|
|
@@ -121,7 +114,6 @@ async function processMessage(
|
|
|
121
114
|
}
|
|
122
115
|
if (!publishedAny) {
|
|
123
116
|
utils.logException(
|
|
124
|
-
log,
|
|
125
117
|
new Error(
|
|
126
118
|
'The message has not been published to any publisher configuration',
|
|
127
119
|
),
|
package/src/index.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { defaultPublisher } from './defaultPublisher';
|
|
|
3
3
|
import { affiliatePort } from './publishers/affiliatePort';
|
|
4
4
|
import { cj } from './publishers/cj';
|
|
5
5
|
import { facebook } from './publishers/facebook';
|
|
6
|
-
import { googleAds } from './publishers/googleAds';
|
|
6
|
+
import { googleAds, GoogleAdsPlatformPublisher } from './publishers/googleAds';
|
|
7
7
|
import { googleAnalytics4 } from './publishers/googleAnalytics4';
|
|
8
8
|
import { piano } from './publishers/piano';
|
|
9
9
|
import { universalAnalytics } from './publishers/universalAnalytics';
|
|
@@ -15,8 +15,8 @@ export const publisher = {
|
|
|
15
15
|
Facebook: facebook,
|
|
16
16
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
17
17
|
CJ: cj,
|
|
18
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
19
|
-
GoogleAds: googleAds,
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-unnecessary-type-assertion
|
|
19
|
+
GoogleAds: googleAds as GoogleAdsPlatformPublisher,
|
|
20
20
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
21
21
|
GoogleAnalytics4: googleAnalytics4,
|
|
22
22
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
@@ -3,7 +3,7 @@ import * as utils from './../utils/utils';
|
|
|
3
3
|
import { EventToLog } from '../types/EventToLog';
|
|
4
4
|
import { TypeSafeObject } from '../types/UtilTypes';
|
|
5
5
|
|
|
6
|
-
interface GoogleAdsPlatformPublisher {
|
|
6
|
+
export interface GoogleAdsPlatformPublisher {
|
|
7
7
|
source: string;
|
|
8
8
|
publish: (
|
|
9
9
|
log: Logger,
|