@opengis/fastify-table 2.0.96 → 2.0.98

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":"uploadMultiPart.d.ts","sourceRoot":"","sources":["../../../../server/plugins/file/uploadMultiPart.ts"],"names":[],"mappings":"AAqBA,UAAU,KAAK;IACb,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC9B;AAyCD,wBAA8B,eAAe,CAC3C,GAAG,EAAE,GAAG,EACR,EACE,UAAU,EACV,GAAG,EACH,MAAM,EACN,gBAAwB,GACzB,GAAE;IACD,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CACvB,GACL,OAAO,CAAC,KAAK,CAAC,CAgGhB"}
1
+ {"version":3,"file":"uploadMultiPart.d.ts","sourceRoot":"","sources":["../../../../server/plugins/file/uploadMultiPart.ts"],"names":[],"mappings":"AAqBA,UAAU,KAAK;IACb,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC9B;AA2CD,wBAA8B,eAAe,CAC3C,GAAG,EAAE,GAAG,EACR,EACE,UAAU,EACV,GAAG,EACH,MAAM,EACN,gBAAwB,GACzB,GAAE;IACD,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CACvB,GACL,OAAO,CAAC,KAAK,CAAC,CAmGhB"}
@@ -9,7 +9,7 @@ import providers from "./providers/index.js";
9
9
  import { all, images } from "./utils/allowedExtensions.js";
10
10
  import grpc from "../grpc/grpc.js";
11
11
  import getFileType from "./utils/getFileType.js";
12
- import { BadRequestError } from "../../types/errors.js";
12
+ import { BadRequestError, PayloadTooLargeError } from "../../types/errors.js";
13
13
  const { resizeImage } = grpc();
14
14
  const { resizeImageMinSize = 5 } = config; // resize images >= 5 MB by default
15
15
  async function writeFileToDisk(file, buffer) {
@@ -17,7 +17,7 @@ async function writeFileToDisk(file, buffer) {
17
17
  return null;
18
18
  }
19
19
  // resize big images
20
- if (images.find((el) => el === file.extension) &&
20
+ if (images.find((el) => el === file.extension && !["tif", "tiff"].includes(file.extension)) &&
21
21
  file.size >= resizeImageMinSize * 1024 * 1024) {
22
22
  const { width = 320, height = 240 } = imageSize(buffer) || {};
23
23
  const ratio = width / height;
@@ -62,6 +62,7 @@ export default async function uploadMultiPart(req, { extensions, raw, subdir, or
62
62
  value.file.on("data", (chunk) => chunks.push(chunk));
63
63
  value.file.on("end", () => res(Buffer.concat(chunks)));
64
64
  value.file.on("error", rej);
65
+ value.file.on("limit", () => rej(new PayloadTooLargeError("file size exceeds limit")));
65
66
  });
66
67
  if (!fileBuffer?.length) {
67
68
  throw new BadRequestError("file buffer is empty");
@@ -1 +1 @@
1
- {"version":3,"file":"getMeta.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/pg/funcs/getMeta.ts"],"names":[],"mappings":"AAIA,wBAA8B,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,gBAkE5D"}
1
+ {"version":3,"file":"getMeta.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/pg/funcs/getMeta.ts"],"names":[],"mappings":"AAKA,wBAA8B,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,gBAyE5D"}
@@ -1,9 +1,16 @@
1
+ import init from "./init.js";
1
2
  import getPG from "./getPG.js";
2
3
  const data = {};
3
4
  export default async function getMeta(opt, nocache) {
4
5
  const pg = opt?.pg || getPG({ name: "client" });
5
6
  if (!pg)
6
7
  return { error: "pg connection not established", status: 400 };
8
+ // reconnect if at start of process connection was unavailable
9
+ if (!pg.pk) {
10
+ pg.connectionAttempt = 0;
11
+ pg.init = init(pg);
12
+ await init(pg);
13
+ }
7
14
  const table1 = opt?.table || opt;
8
15
  const table = pg.pk?.[table1] ? table1 : table1?.replace?.(/"/g, "");
9
16
  if (pg?.options?.database && data[pg.options.database]?.[table] && !nocache)
@@ -1 +1 @@
1
- {"version":3,"file":"getPG.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/pg/funcs/getPG.ts"],"names":[],"mappings":"AAYA,iBAAS,KAAK,CAAC,KAAK,GAAE,GAAQ,OA6C7B;AAED,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"getPG.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/pg/funcs/getPG.ts"],"names":[],"mappings":"AAYA,iBAAS,KAAK,CAAC,KAAK,GAAE,GAAQ,OAgD7B;AAED,eAAe,KAAK,CAAC"}
@@ -32,10 +32,11 @@ function getPG(param = {}) {
32
32
  return null;
33
33
  }
34
34
  pgClients[name] = new pg.Pool(dbConfig);
35
- pgClients[name].init = async () => {
36
- await init(pgClients[name]);
37
- };
38
- init(pgClients[name]);
35
+ pgClients[name].on("error", (err, client) => {
36
+ console.warn("Unexpected error on idle client", client?.options?.database);
37
+ });
38
+ pgClients[name].init = async () => init(pgClients[name]);
39
+ // pgClients[name].init();
39
40
  return pgClients[name];
40
41
  }
41
42
  export default getPG;
@@ -1 +1 @@
1
- {"version":3,"file":"getPGAsync.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/pg/funcs/getPGAsync.ts"],"names":[],"mappings":"AAYA,iBAAe,UAAU,CAAC,KAAK,EAAE,GAAG,gBAyDnC;AAED,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"getPGAsync.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/pg/funcs/getPGAsync.ts"],"names":[],"mappings":"AAYA,iBAAe,UAAU,CAAC,KAAK,EAAE,GAAG,gBA6DnC;AAED,eAAe,UAAU,CAAC"}
@@ -31,11 +31,14 @@ async function getPGAsync(param) {
31
31
  return null;
32
32
  }
33
33
  pgClients[name] = new pg.Pool(dbConfig);
34
+ pgClients[name].on("error", (err, client) => {
35
+ console.warn("Unexpected error on idle client", client?.options?.database);
36
+ });
34
37
  try {
35
38
  await init(pgClients[name]);
36
39
  }
37
40
  catch (err) {
38
- console.error("pg client init error", host, port, database);
41
+ console.warn("pg client init error", host, port, database);
39
42
  // debug only
40
43
  if (config.local && name !== "client") {
41
44
  console.warn("fall back to default pgClient", pgClients.client?.host, pgClients.client?.port, pgClients.client?.database);
@@ -1,4 +1,4 @@
1
- import pg from "pg";
2
- declare function init(client: pg.Pool): Promise<void>;
1
+ import { ExtendedPG } from "../../../types/core.js";
2
+ declare function init(client: ExtendedPG): Promise<void>;
3
3
  export default init;
4
4
  //# sourceMappingURL=init.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/pg/funcs/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AASpB,iBAAe,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,iBA2MlC;AAGD,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/pg/funcs/init.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAsBpD,iBAAe,IAAI,CAAC,MAAM,EAAE,UAAU,iBA4NrC;AAGD,eAAe,IAAI,CAAC"}
@@ -4,16 +4,40 @@ import config from "../../../../config.js";
4
4
  import getRedis from "../../redis/funcs/getRedis.js";
5
5
  import logger from "../../logger/getLogger.js";
6
6
  const rclient = getRedis({ db: 0 });
7
+ const { reconnectAttempts = 2, reconnectInterval } = config.pg || {};
8
+ function delay(ms) {
9
+ return new Promise((resolve) => setTimeout(resolve, ms));
10
+ }
11
+ // avoid process exit with exception on network changes: disconnect from db, internet altogether etc
12
+ process.on("uncaughtException", (err) => {
13
+ if (err.message === "Connection terminated unexpectedly" ||
14
+ err.code === "ECONNRESET") {
15
+ console.warn("Ignored pg connection drop:", err.toString());
16
+ return;
17
+ }
18
+ throw err; // keep normal behavior
19
+ });
7
20
  async function init(client) {
8
21
  if (!client?.options?.database) {
9
22
  return;
10
23
  }
24
+ if (!client?.init) {
25
+ return;
26
+ }
27
+ client.connectionAttempt = ++client.connectionAttempt || 1;
28
+ if (client.connectionAttempt - 1 > reconnectAttempts) {
29
+ return;
30
+ }
11
31
  try {
32
+ console.log(client.connectionAttempt, "init pg attempt");
12
33
  await client.connect();
13
34
  }
14
35
  catch (err) {
15
- console.error("Error connecting to PostgreSQL:", client?.options?.database, err.message);
16
- return;
36
+ console.warn("Error connecting to PostgreSQL:", client?.options?.database, err.message);
37
+ const wait = +(reconnectInterval || 500) * client.connectionAttempt;
38
+ // resolve fastify plugin register promise
39
+ await delay(wait);
40
+ return init(client);
17
41
  }
18
42
  const { pgType, pk } = await client
19
43
  .query(`SELECT
@@ -104,10 +128,10 @@ async function init(client) {
104
128
  }
105
129
  catch (err) {
106
130
  if (err.code === "57014") {
107
- console.error("pg.querySafe timeout", q);
131
+ console.warn("pg.querySafe timeout", q);
108
132
  return { rows: [], timeout: true };
109
133
  }
110
- console.error("pg.querySafe error", q);
134
+ console.warn("pg.querySafe error", q);
111
135
  throw err;
112
136
  }
113
137
  finally {
@@ -175,6 +199,7 @@ async function init(client) {
175
199
  queryNotice,
176
200
  querySafe,
177
201
  });
202
+ client.init = undefined;
178
203
  console.log("pg connected", client.options?.database);
179
204
  }
180
205
  // export default client;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/plugins/pg/index.ts"],"names":[],"mappings":"AA+BA,iBAAS,MAAM,CAAC,OAAO,EAAE,GAAG,QA0B3B;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/plugins/pg/index.ts"],"names":[],"mappings":"AA+BA,iBAAS,MAAM,CAAC,OAAO,EAAE,GAAG,QAwB3B;AAED,eAAe,MAAM,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"pgClients.d.ts","sourceRoot":"","sources":["../../../../server/plugins/pg/pgClients.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,CAAC;AAiB1C,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"pgClients.d.ts","sourceRoot":"","sources":["../../../../server/plugins/pg/pgClients.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,CAAC;AAkB1C,eAAe,SAAS,CAAC"}
@@ -12,10 +12,11 @@ if (config.pg) {
12
12
  statement_timeout: config.pg?.statement_timeout || 10000,
13
13
  connectionTimeoutMillis: config.pg?.connectionTimeoutMillis || 5000,
14
14
  });
15
- client.init = async () => {
16
- await init(client);
17
- };
18
- client.init();
15
+ client.on("error", (err, client1) => {
16
+ console.warn("Unexpected error on idle client", client1?.options?.database);
17
+ });
18
+ client.init = async () => init(client);
19
+ // client.init();
19
20
  pgClients.client = client;
20
21
  }
21
22
  export default pgClients;
@@ -1 +1 @@
1
- {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../../server/routes/crud/controllers/table.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAe5C,wBAA8B,QAAQ,CACpC,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,GAAG,gBAuNZ"}
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../../server/routes/crud/controllers/table.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAe5C,wBAA8B,QAAQ,CACpC,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,GAAG,gBA0NZ"}
@@ -2,7 +2,11 @@ import { config, getAccess, getTemplate, getMeta, setToken, applyHook, getToken,
2
2
  import extraDataGet from "../../../plugins/extra/extraDataGet.js";
3
3
  export default async function tableAPI(req, reply, called) {
4
4
  const { pg = pgClients.client, params, user = {}, query = {} } = req;
5
- const tokenData = (await getToken({ token: params?.table, uid: user.uid, json: 1 })) || {};
5
+ const tokenData = await getToken({
6
+ token: params?.table,
7
+ uid: user.uid,
8
+ json: 1,
9
+ });
6
10
  const hookData = (await applyHook("preTable", {
7
11
  pg,
8
12
  table: params?.table,
@@ -13,24 +17,24 @@ export default async function tableAPI(req, reply, called) {
13
17
  if (hookData?.message && hookData?.status) {
14
18
  return reply.status(hookData?.status).send(hookData?.message);
15
19
  }
16
- const templateName = hookData?.table || tokenData.table || params.table;
20
+ const templateName = hookData?.table || tokenData?.table || params.table;
17
21
  const loadTable = await getTemplate("table", templateName);
18
22
  if (!loadTable &&
19
- !pg.pk?.[tokenData.table] &&
23
+ !pg.pk?.[tokenData?.table] &&
20
24
  !(pg.pk?.[templateName] && called)) {
21
25
  return reply.status(404).send("not found");
22
26
  }
23
- const { table: table1 = params.table, form: form1, obj, } = hookData || loadTable || tokenData;
27
+ const { table: table1 = params.table, form: form1, obj, } = hookData || loadTable || tokenData || {};
24
28
  const table = loadTable?.table || table1;
25
29
  const form = loadTable?.form || form1;
26
- const id = hookData?.id || tokenData.id || params.id;
30
+ const id = hookData?.id || tokenData?.id || params.id;
27
31
  if (tokenData && !id)
28
32
  return { message: {} };
29
33
  if (!table && !id) {
30
34
  return reply.status(400).send("not enough params");
31
35
  }
32
36
  const { actions = [], query: accessQuery } = (await getAccess({
33
- table,
37
+ table: templateName,
34
38
  form,
35
39
  id,
36
40
  user,
@@ -52,7 +52,7 @@ export default async function exportTable({ pg = pgClients.client, headers, user
52
52
  }
53
53
  const slice = query.slice ? Math.min(+query.slice || 16, 16) : null;
54
54
  const date = new Date();
55
- const sufixName = `${filter}-${cols || "all"}-${search}-${query.limit || "unlimited"}-${id}`;
55
+ const sufixName = `${filter}-${cols || "all"}-${search}-${query.limit || "unlimited"}-${query.slice || "full"}-${id}`;
56
56
  const sufixDate = [
57
57
  date.getFullYear(),
58
58
  date.getMonth(),
@@ -5,6 +5,7 @@ declare let Database: any;
5
5
  export interface ExtendedPG extends Pool {
6
6
  readonly?: any;
7
7
  init?: () => void;
8
+ connectionAttempt: number;
8
9
  pk?: Record<string, string>;
9
10
  pgType?: Record<any, string>;
10
11
  tlist?: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../server/types/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,oBAAoB,EAAE,MAAM,SAAS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EAAE,MAAM,IAAI,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAC5B,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,0BAA2B,SAAQ,oBAAoB;IACtE,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
@@ -4,7 +4,11 @@ export declare const NotFoundError: createError.FastifyErrorConstructor<{
4
4
  statusCode: 404;
5
5
  }, [any?, any?, any?]>;
6
6
  export declare const BadRequestError: createError.FastifyErrorConstructor<{
7
- code: "NOT_FOUND_ERROR";
7
+ code: "BAD_REQUEST_ERROR";
8
8
  statusCode: 400;
9
9
  }, [any?, any?, any?]>;
10
+ export declare const PayloadTooLargeError: createError.FastifyErrorConstructor<{
11
+ code: "PAYLOAD_TOO_LARGE_ERROR";
12
+ statusCode: 413;
13
+ }, [any?, any?, any?]>;
10
14
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../server/types/errors.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,gBAAgB,CAAC;AAEzC,eAAO,MAAM,aAAa;;;sBAIzB,CAAC;AACF,eAAO,MAAM,eAAe;;;sBAI3B,CAAC"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../server/types/errors.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,eAAO,MAAM,aAAa;;;sBAIzB,CAAC;AACF,eAAO,MAAM,eAAe;;;sBAI3B,CAAC;AACF,eAAO,MAAM,oBAAoB;;;sBAIhC,CAAC"}
@@ -1,3 +1,4 @@
1
1
  import createError from "@fastify/error";
2
2
  export const NotFoundError = createError("NOT_FOUND_ERROR", "Resource not found: %s", 404);
3
- export const BadRequestError = createError("NOT_FOUND_ERROR", "Bad request: %s", 400);
3
+ export const BadRequestError = createError("BAD_REQUEST_ERROR", "Bad request: %s", 400);
4
+ export const PayloadTooLargeError = createError("PAYLOAD_TOO_LARGE_ERROR", "Payload Too Large: %s", 413);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "2.0.96",
3
+ "version": "2.0.98",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "keywords": [