@opengis/fastify-table 2.0.150 → 2.0.151

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":"logChanges.d.ts","sourceRoot":"","sources":["../../../../../../server/plugins/crud/funcs/utils/logChanges.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,2BAA2B,CAAC;AA8C5D,wBAA8B,UAAU,CAAC,EACvC,EAAE,EACF,KAAK,EAAE,MAAM,EACb,SAAS,EACT,OAAO,EACP,EAAE,EACF,IAAI,EACJ,GAAO,EACP,IAAI,GACL,EAAE;IACD,EAAE,EAAE,UAAU,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC;CACd;;;;;;;;;;;;;;;;;;;;UA8MA"}
1
+ {"version":3,"file":"logChanges.d.ts","sourceRoot":"","sources":["../../../../../../server/plugins/crud/funcs/utils/logChanges.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,2BAA2B,CAAC;AA8C5D,wBAA8B,UAAU,CAAC,EACvC,EAAE,EACF,KAAK,EAAE,MAAM,EACb,SAAS,EACT,OAAO,EACP,EAAE,EACF,IAAI,EACJ,GAAO,EACP,IAAI,GACL,EAAE;IACD,EAAE,EAAE,UAAU,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC;CACd;;;;;;;;;;;;;;;;;;;;UAiNA"}
@@ -123,20 +123,24 @@ export default async function logChanges({ pg, table: table1, tokenData, referer
123
123
  return acc;
124
124
  });
125
125
  }
126
- const newGeoms = await Promise.all(Object.keys(newObj1)
126
+ await Promise.all(Object.keys(row)
127
127
  .filter((key) => row[key] && columnTypes[key] === "geometry")
128
128
  .map(async (key) => pg
129
129
  .query(typeof row[key] === "string" // binary geometry as string via update?
130
130
  ? "select st_asgeojson(st_pointonsurface($1))::json"
131
131
  : "select st_asgeojson(st_pointonsurface(st_geomfromgeojson($1)))::json", [row[key]])
132
- .then((el) => ({ key, geometry: el.rows[0].st_asgeojson })))).then((r) => r.reduce((acc, curr) => {
132
+ .then((el) => ({ key, geometry: el.rows[0].st_asgeojson })))).then((r) => r.forEach((curr) => {
133
133
  const value = curr.geometry.coordinates.join(",");
134
134
  const hash = createHash("md5")
135
135
  .update(JSON.stringify(value))
136
136
  .digest("hex");
137
- newObj1[curr.key] = { value, hash };
138
- return { ...acc, [curr.key]: { value, hash } };
139
- }, {}));
137
+ if (titles[curr.key]) {
138
+ newObj1[titles[curr.key]] = { value, hash };
139
+ }
140
+ else {
141
+ newObj1[curr.key] = { value, hash };
142
+ }
143
+ }));
140
144
  const changesData = Object.keys(newObj1 || {})
141
145
  .filter((key) => typeof newObj1?.[key] === "boolean" || newObj1?.[key])
142
146
  .filter((key) => old[key] ? old[key].hash !== newObj1[key]?.hash : newObj1[key]?.hash)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "2.0.150",
3
+ "version": "2.0.151",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "keywords": [