@socialgouv/matomo-postgres 2.4.0 → 2.4.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.
@@ -64,7 +64,7 @@ const MATOMO_INSERT_COLUMN_SQL = sql.join(MATOMO_INSERT_COLUMNS.map((column) =>
64
64
  * @return {Promise<void>}
65
65
  */
66
66
  export const importEvent = (event) => __awaiter(void 0, void 0, void 0, function* () {
67
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15;
67
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14;
68
68
  // Build a sanitized, typed data object to reduce drift and ensure defaults in one place
69
69
  const eventData = {
70
70
  action_id: (_a = event.action_id) !== null && _a !== void 0 ? _a : '',
@@ -115,7 +115,7 @@ export const importEvent = (event) => __awaiter(void 0, void 0, void 0, function
115
115
  referrertype: (_12 = event.referrertype) !== null && _12 !== void 0 ? _12 : null,
116
116
  referrername: (_13 = event.referrername) !== null && _13 !== void 0 ? _13 : null,
117
117
  resolution: (_14 = event.resolution) !== null && _14 !== void 0 ? _14 : null,
118
- experiments: (_15 = event.experiments) !== null && _15 !== void 0 ? _15 : null
118
+ experiments: event.experiments != null ? JSON.stringify(event.experiments) : null
119
119
  };
120
120
  // Minimal runtime validation for required fields
121
121
  if (!eventData.action_id || eventData.action_id.trim().length === 0) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@socialgouv/matomo-postgres",
3
3
  "description": "Extract visitor events from Matomo API and push to Postgres",
4
- "version": "2.4.0",
4
+ "version": "2.4.2",
5
5
  "packageManager": "pnpm@10.28.1",
6
6
  "types": "types/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -21,6 +21,9 @@
21
21
  "bin",
22
22
  "dist"
23
23
  ],
24
+ "engines": {
25
+ "node": ">=18"
26
+ },
24
27
  "scripts": {
25
28
  "start": "pnpm migrate && node ./bin/index.js",
26
29
  "build": "tsc",