@teleporthq/teleport-plugin-next-workflows 0.45.6 → 0.45.8

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.
@@ -1 +1 @@
1
- {"version":3,"file":"analytics-track-outcome.d.ts","sourceRoot":"","sources":["../../../../src/nodes/analytics/analytics-track-outcome.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAkH/C,eAAO,MAAM,qBAAqB,EAAE,oBASnC,CAAA"}
1
+ {"version":3,"file":"analytics-track-outcome.d.ts","sourceRoot":"","sources":["../../../../src/nodes/analytics/analytics-track-outcome.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AA8H/C,eAAO,MAAM,qBAAqB,EAAE,oBASnC,CAAA"}
@@ -18,6 +18,13 @@
18
18
  * the visitor id is the tracker's alone: a browser may still hold a persistent
19
19
  * id from before its consent was withdrawn.
20
20
  *
21
+ * The service takes exactly the money outcomes from a server, each with the
22
+ * order or booking id it dedupes a retried report on, and every other outcome
23
+ * from a browser only. So on the server any other name is refused as
24
+ * `browser-only` (an automation, a webhook or a cron has no visitor's page to
25
+ * report it from), and a money outcome without an id as `no-outcome-id`: an id
26
+ * made up here would count a retried report twice. Both say why in the logs.
27
+ *
21
28
  * Never throws: an outcome that cannot be reported answers `{ sent: false }`
22
29
  * and the workflow continues — analytics must never cost a sale.
23
30
  */
@@ -53,6 +60,10 @@ const SERVER_BODY = `async function analytics_track_outcome(config, context) {
53
60
  if (!name) {
54
61
  return { sent: false, reason: 'no-name' };
55
62
  }
63
+ if (${JSON.stringify(SERVER_ONLY_OUTCOMES)}.indexOf(name) === -1) {
64
+ console.warn('[analytics] the "' + name + '" outcome was not reported: only a visitor\\'s browser can report it, never a server step');
65
+ return { sent: false, reason: 'browser-only' };
66
+ }
56
67
  // \`globalThis.process\` (member access): webpack rewrites a bare \`process\`.
57
68
  var env = globalThis.process && globalThis.process.env;
58
69
  var baseUrl = (env && env.NEXT_PUBLIC_TELEPORT_ANALYTICS_URL) || '';
@@ -63,6 +74,7 @@ const SERVER_BODY = `async function analytics_track_outcome(config, context) {
63
74
  }
64
75
  // The service dedupes on this id and drops an outcome without one.
65
76
  if (config.outcomeId == null || config.outcomeId === '') {
77
+ console.warn('[analytics] the "' + name + '" outcome was not reported: it has no order or booking id');
66
78
  return { sent: false, reason: 'no-outcome-id' };
67
79
  }
68
80
  var ids = context && context.__tpa && typeof context.__tpa === 'object' ? context.__tpa : {};
@@ -1 +1 @@
1
- {"version":3,"file":"analytics-track-outcome.js","sourceRoot":"","sources":["../../../../src/nodes/analytics/analytics-track-outcome.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,oBAAoB,GAAG,CAAC,UAAU,EAAE,cAAc,CAAC,CAAA;AAEzD,MAAM,WAAW,GAAG;;;;;QAKZ,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC;;;;;;;;;;;;;;;;;;;;EAoB1C,CAAA;AAEF,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0DlB,CAAA;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAyB;IACzD,QAAQ,EAAE,yBAAyB;IACnC,YAAY,EAAE,WAAW;IACzB,eAAe;QACb,OAAO,WAAW,CAAA;IACpB,CAAC;IACD,qBAAqB;QACnB,OAAO,WAAW,CAAA;IACpB,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"analytics-track-outcome.js","sourceRoot":"","sources":["../../../../src/nodes/analytics/analytics-track-outcome.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,oBAAoB,GAAG,CAAC,UAAU,EAAE,cAAc,CAAC,CAAA;AAEzD,MAAM,WAAW,GAAG;;;;;QAKZ,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC;;;;;;;;;;;;;;;;;;;;EAoB1C,CAAA;AAEF,MAAM,WAAW,GAAG;;;;;QAKZ,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0D1C,CAAA;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAyB;IACzD,QAAQ,EAAE,yBAAyB;IACnC,YAAY,EAAE,WAAW;IACzB,eAAe;QACb,OAAO,WAAW,CAAA;IACpB,CAAC;IACD,qBAAqB;QACnB,OAAO,WAAW,CAAA;IACpB,CAAC;CACF,CAAA"}