@mhubcloud/tms_core 3.1.3-beta.1 → 3.1.3-beta.2

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.
Files changed (2) hide show
  1. package/dist/index.js +5 -35
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -271,7 +271,9 @@ async function defaultPublisher(azureFunctionContext, serviceBusMessage, source,
271
271
  azureFunctionContext.log,
272
272
  new Error(result.reason)
273
273
  );
274
- throw new Error(result.reason);
274
+ throw new Error(
275
+ typeof result.reason === "object" ? JSON.stringify(result.reason) : result.reason
276
+ );
275
277
  }
276
278
  }
277
279
  }
@@ -301,7 +303,7 @@ async function processMessage(message, log3, platformPublisher, source, trigger)
301
303
  eventPublisher.config,
302
304
  platformPublisher,
303
305
  {
304
- message: `mhub/platformSent`,
306
+ message: `Event dispatched to platform`,
305
307
  severity: 1,
306
308
  properties: {
307
309
  publisher: platformPublisher.source ? platformPublisher.source : source,
@@ -555,36 +557,6 @@ var piano = {
555
557
  }
556
558
  };
557
559
 
558
- // src/publishers/tablestorage.ts
559
- var tableStorage = {
560
- source: "f_TableStorage",
561
- async publish(log3, config, data, event) {
562
- if (config.SASToken && config.tableName) {
563
- data = removeUndefined(data);
564
- const requestOptions = {
565
- method: "POST",
566
- headers: {
567
- // eslint-disable-next-line @typescript-eslint/naming-convention
568
- "User-Agent": "mHub Cloud"
569
- },
570
- body: JSON.stringify(data)
571
- };
572
- const baseUrl = `https://${config.account}.table.core.windows.net/${config.tableName}`;
573
- const query = config.SASToken;
574
- await handlePlatformRequest({
575
- source: this.source,
576
- baseUrl,
577
- requestOptions,
578
- query,
579
- event,
580
- logger: log3
581
- });
582
- } else {
583
- throw new Error("Invalid config for platform " + this.source);
584
- }
585
- }
586
- };
587
-
588
560
  // src/publishers/universalAnalytics.ts
589
561
  var universalAnalytics = {
590
562
  source: "UniversalAnalytics",
@@ -663,9 +635,7 @@ var publisher = {
663
635
  // eslint-disable-next-line @typescript-eslint/naming-convention
664
636
  Piano: piano,
665
637
  // eslint-disable-next-line @typescript-eslint/naming-convention
666
- AffiliatePort: affiliatePort,
667
- // eslint-disable-next-line @typescript-eslint/naming-convention
668
- TableStorage: tableStorage
638
+ AffiliatePort: affiliatePort
669
639
  };
670
640
  // Annotate the CommonJS export names for ESM import in node:
671
641
  0 && (module.exports = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mhubcloud/tms_core",
3
- "version": "3.1.3-beta.1",
3
+ "version": "3.1.3-beta.2",
4
4
  "description": "Core function for mHub Cloud TMS publishers",
5
5
  "homepage": "https://mhubcloud.com/",
6
6
  "license": "Apache 2.0",